mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-03-05 04:03:45 +08:00
Fix various issues with Inventories [SCI-10014] (#6979)
- Show added-by column by default. - Show stock column in view mode if stock is disabled. - Prevent column name wrapping in column manage modal.
This commit is contained in:
parent
a719ceb247
commit
7f30547182
4 changed files with 19 additions and 2 deletions
|
@ -686,6 +686,11 @@ var RepositoryDatatable = (function(global) {
|
|||
targets: 5,
|
||||
class: 'added-on',
|
||||
visible: true
|
||||
},{
|
||||
// Added by column
|
||||
targets: 6,
|
||||
class: 'added-by',
|
||||
visible: true
|
||||
}, {
|
||||
targets: '_all',
|
||||
render: function(data) {
|
||||
|
@ -776,8 +781,8 @@ var RepositoryDatatable = (function(global) {
|
|||
var state = localStorage.getItem(`datatables_repositories_state/${repositoryId}/${viewType}`);
|
||||
|
||||
json.state.start = state !== null ? JSON.parse(state).start : 0;
|
||||
if (json.state.columns[6]) json.state.columns[6].visible = archived;
|
||||
if (json.state.columns[7]) json.state.columns[7].visible = archived;
|
||||
if (json.state.columns[8]) json.state.columns[8].visible = archived;
|
||||
if (json.state.search) delete json.state.search;
|
||||
|
||||
if (json.state.ColSizes && json.state.ColSizes.length > 0) {
|
||||
|
|
|
@ -228,7 +228,7 @@ var RepositoryColumns = (function() {
|
|||
var maxLength = $(TABLE_ID).data('max-dropdown-length');
|
||||
if ($.trim(name).length > maxLength) {
|
||||
return `<div class="modal-tooltip">
|
||||
${truncateLongString(name, maxLength)}
|
||||
<span>${truncateLongString(name, maxLength)}</span>
|
||||
<span class="modal-tooltiptext">${name}</span>
|
||||
</div>`;
|
||||
}
|
||||
|
|
|
@ -108,6 +108,12 @@
|
|||
z-index: 99999999;
|
||||
}
|
||||
|
||||
.modal-tooltip > span:first-child {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.col-list-el {
|
||||
align-items: center;
|
||||
background: $color-white;
|
||||
|
@ -120,6 +126,7 @@
|
|||
|
||||
.manage-controls {
|
||||
display: none;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.text {
|
||||
|
|
|
@ -52,6 +52,11 @@ module RepositoryDatatableHelper
|
|||
serialize_repository_cell_value(cell, team, repository, reminders_enabled: reminders_enabled)
|
||||
end
|
||||
|
||||
if repository.repository_columns.stock_type.exists?
|
||||
stock_cell = record.repository_cells.find { |cell| cell.value_type == 'RepositoryStockValue' }
|
||||
row['stock'] = serialize_repository_cell_value(record.repository_stock_cell, team, repository) if stock_cell.present?
|
||||
end
|
||||
|
||||
if has_stock_management
|
||||
stock_cell = record.repository_cells.find { |cell| cell.value_type == 'RepositoryStockValue' }
|
||||
|
||||
|
|
Loading…
Reference in a new issue