mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-09-20 23:16:15 +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
|
@ -686,6 +686,11 @@ var RepositoryDatatable = (function(global) {
|
||||||
targets: 5,
|
targets: 5,
|
||||||
class: 'added-on',
|
class: 'added-on',
|
||||||
visible: true
|
visible: true
|
||||||
|
},{
|
||||||
|
// Added by column
|
||||||
|
targets: 6,
|
||||||
|
class: 'added-by',
|
||||||
|
visible: true
|
||||||
}, {
|
}, {
|
||||||
targets: '_all',
|
targets: '_all',
|
||||||
render: function(data) {
|
render: function(data) {
|
||||||
|
@ -776,8 +781,8 @@ var RepositoryDatatable = (function(global) {
|
||||||
var state = localStorage.getItem(`datatables_repositories_state/${repositoryId}/${viewType}`);
|
var state = localStorage.getItem(`datatables_repositories_state/${repositoryId}/${viewType}`);
|
||||||
|
|
||||||
json.state.start = state !== null ? JSON.parse(state).start : 0;
|
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[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.search) delete json.state.search;
|
||||||
|
|
||||||
if (json.state.ColSizes && json.state.ColSizes.length > 0) {
|
if (json.state.ColSizes && json.state.ColSizes.length > 0) {
|
||||||
|
|
|
@ -228,7 +228,7 @@ var RepositoryColumns = (function() {
|
||||||
var maxLength = $(TABLE_ID).data('max-dropdown-length');
|
var maxLength = $(TABLE_ID).data('max-dropdown-length');
|
||||||
if ($.trim(name).length > maxLength) {
|
if ($.trim(name).length > maxLength) {
|
||||||
return `<div class="modal-tooltip">
|
return `<div class="modal-tooltip">
|
||||||
${truncateLongString(name, maxLength)}
|
<span>${truncateLongString(name, maxLength)}</span>
|
||||||
<span class="modal-tooltiptext">${name}</span>
|
<span class="modal-tooltiptext">${name}</span>
|
||||||
</div>`;
|
</div>`;
|
||||||
}
|
}
|
||||||
|
|
|
@ -108,6 +108,12 @@
|
||||||
z-index: 99999999;
|
z-index: 99999999;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.modal-tooltip > span:first-child {
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
.col-list-el {
|
.col-list-el {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
background: $color-white;
|
background: $color-white;
|
||||||
|
@ -120,6 +126,7 @@
|
||||||
|
|
||||||
.manage-controls {
|
.manage-controls {
|
||||||
display: none;
|
display: none;
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.text {
|
.text {
|
||||||
|
|
|
@ -52,6 +52,11 @@ module RepositoryDatatableHelper
|
||||||
serialize_repository_cell_value(cell, team, repository, reminders_enabled: reminders_enabled)
|
serialize_repository_cell_value(cell, team, repository, reminders_enabled: reminders_enabled)
|
||||||
end
|
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
|
if has_stock_management
|
||||||
stock_cell = record.repository_cells.find { |cell| cell.value_type == 'RepositoryStockValue' }
|
stock_cell = record.repository_cells.find { |cell| cell.value_type == 'RepositoryStockValue' }
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue