mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-10 17:36:33 +08:00
Merge pull request #4668 from G-Chubinidze/gc_SCI_7494
Archived table view filters update [SCI-7494]
This commit is contained in:
commit
2d04357ba8
3 changed files with 40 additions and 0 deletions
|
@ -468,6 +468,36 @@ ExperimnetTable.filters.push({
|
|||
}
|
||||
});
|
||||
|
||||
ExperimnetTable.filters.push({
|
||||
name: 'archived_on_from',
|
||||
init: () => {},
|
||||
closeFilter: () => {},
|
||||
apply: ($container) => {
|
||||
return ExperimnetTable.selectDate($('.archived-on-filter .from-date', $container));
|
||||
},
|
||||
active: (value) => { return value; },
|
||||
clearFilter: ($container) => {
|
||||
if ($('.archived-on-filter .from-date', $container).data('DateTimePicker')) {
|
||||
$('.archived-on-filter .from-date', $container).data('DateTimePicker').clear();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
ExperimnetTable.filters.push({
|
||||
name: 'archived_on_to',
|
||||
init: () => {},
|
||||
closeFilter: () => {},
|
||||
apply: ($container) => {
|
||||
return ExperimnetTable.selectDate($('.archived-on-filter .to-date', $container));
|
||||
},
|
||||
active: (value) => { return value; },
|
||||
clearFilter: ($container) => {
|
||||
if ($('.archived-on-filter .to-date', $container).data('DateTimePicker')) {
|
||||
$('.archived-on-filter .to-date', $container).data('DateTimePicker').clear();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
ExperimnetTable.filters.push({
|
||||
name: 'assigned_users',
|
||||
init: ($container) => {
|
||||
|
|
|
@ -181,6 +181,14 @@ module Experiments
|
|||
my_modules.where('my_modules.due_date <= ?', value)
|
||||
end
|
||||
|
||||
def archived_on_from_filter(my_modules, value)
|
||||
my_modules.where('my_modules.archived_on >= ?', value)
|
||||
end
|
||||
|
||||
def archived_on_to_filter(my_modules, value)
|
||||
my_modules.where('my_modules.archived_on <= ?', value)
|
||||
end
|
||||
|
||||
def assigned_users_filter(my_modules, value)
|
||||
my_modules.joins(:user_my_modules).where(user_my_modules: { user_id: value })
|
||||
end
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
} do %>
|
||||
<%= render partial: 'shared/filter_dropdown/text_search', locals: {container_class: 'task-name-filter', label_text: t('experiments.table.filters.name')} %>
|
||||
<%= render partial: 'shared/filter_dropdown/datetime_search', locals: {container_class: 'due-date-filter', label: t('experiments.table.filters.due_date'), view_mode: nil } %>
|
||||
<%= render partial: 'shared/filter_dropdown/datetime_search', locals: {container_class: 'archived-on-filter', label: t("filters_modal.archived_on.label"), view_mode: 'archived' } if params[:view_mode] == 'archived' %>
|
||||
|
||||
<div class="select-block status-container">
|
||||
<label><%= t('experiments.table.filters.status') %></label>
|
||||
<select class="status-filter"
|
||||
|
|
Loading…
Reference in a new issue