mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-07 21:55:20 +08:00
Stock editing and reminder fixes [SCI-6803] (#4078)
* Fix stock editing after adding new value [SCI-6803] * Don't load reminders for snapshots [SCI-6803]
This commit is contained in:
parent
297c58c0cd
commit
98ac1c126f
3 changed files with 9 additions and 3 deletions
|
@ -78,9 +78,11 @@ var RepositoryStockValues = (function() {
|
|||
|
||||
$manageModal.find('form').on('ajax:success', function(_, data) {
|
||||
$manageModal.modal('hide');
|
||||
$('.dataTable').find(
|
||||
let $cell = $('.dataTable').find(
|
||||
`tr:nth-child(${rowIndex}) td:nth-child(${colIndex + 1})`
|
||||
).html(
|
||||
);
|
||||
$cell.parent().data('manage-stock-url', data.manageStockUrl);
|
||||
$cell.html(
|
||||
$.fn.dataTable.render.RepositoryStockValue(data)
|
||||
);
|
||||
});
|
||||
|
|
|
@ -49,7 +49,8 @@ class RepositoryStockValuesController < ApplicationController
|
|||
|
||||
render json: {
|
||||
stock_managable: true,
|
||||
stock_status: @repository_stock_value.status
|
||||
stock_status: @repository_stock_value.status,
|
||||
manageStockUrl: edit_repository_stock_repository_repository_row_url(@repository, @repository_row)
|
||||
}.merge(display_cell_value(@repository_stock_value.repository_cell, current_team, @repository))
|
||||
end
|
||||
|
||||
|
|
|
@ -275,6 +275,9 @@ module RepositoryDatatableHelper
|
|||
# don't load reminders for archived repositories
|
||||
return [] if repository_rows.blank? || repository.archived?
|
||||
|
||||
# don't load reminders for snapshots
|
||||
return [] if repository.is_a?(RepositorySnapshot)
|
||||
|
||||
repository_rows.active.with_active_reminders(current_user).to_a.pluck(:id).uniq
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue