mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-11-10 00:11:22 +08:00
Fix displaying of archived objects for experiments and tasks lists [SCI-10418] (#7255)
This commit is contained in:
parent
e835925ab9
commit
8aadca10c5
4 changed files with 14 additions and 7 deletions
|
|
@ -446,6 +446,9 @@ export default {
|
||||||
handleInfiniteScroll(response) {
|
handleInfiniteScroll(response) {
|
||||||
const newRows = this.rowData.slice();
|
const newRows = this.rowData.slice();
|
||||||
this.formatData(response.data.data).forEach((row) => {
|
this.formatData(response.data.data).forEach((row) => {
|
||||||
|
if (this.currentViewMode === 'active' && row.archived) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
newRows.push(row);
|
newRows.push(row);
|
||||||
});
|
});
|
||||||
this.rowData = newRows;
|
this.rowData = newRows;
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ module Lists
|
||||||
|
|
||||||
attributes :name, :code, :created_at, :updated_at, :workflow_img, :description, :completed_tasks,
|
attributes :name, :code, :created_at, :updated_at, :workflow_img, :description, :completed_tasks,
|
||||||
:total_tasks, :archived_on, :urls, :sa_description, :default_public_user_role_id, :team,
|
:total_tasks, :archived_on, :urls, :sa_description, :default_public_user_role_id, :team,
|
||||||
:top_level_assignable, :hidden
|
:top_level_assignable, :hidden, :archived
|
||||||
|
|
||||||
def created_at
|
def created_at
|
||||||
I18n.l(object.created_at, format: :full_date)
|
I18n.l(object.created_at, format: :full_date)
|
||||||
|
|
@ -61,7 +61,7 @@ module Lists
|
||||||
|
|
||||||
def urls
|
def urls
|
||||||
urls_list = {
|
urls_list = {
|
||||||
show: my_modules_path(experiment_id: object),
|
show: my_modules_path(experiment_id: object, view_mode: archived ? 'archived' : 'active'),
|
||||||
actions: actions_toolbar_experiments_path(items: [{ id: object.id }].to_json),
|
actions: actions_toolbar_experiments_path(items: [{ id: object.id }].to_json),
|
||||||
projects_to_clone: projects_to_clone_experiment_path(object),
|
projects_to_clone: projects_to_clone_experiment_path(object),
|
||||||
projects_to_move: projects_to_move_experiment_path(object),
|
projects_to_move: projects_to_move_experiment_path(object),
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ module Lists
|
||||||
user = scope[:user] || @instance_options[:user]
|
user = scope[:user] || @instance_options[:user]
|
||||||
|
|
||||||
urls_list = {
|
urls_list = {
|
||||||
show: protocols_my_module_path(object, view_mode: object.archived_branch? ? 'archived' : 'active'),
|
show: protocols_my_module_path(object, view_mode: archived ? 'archived' : 'active'),
|
||||||
results: my_module_results_path(object),
|
results: my_module_results_path(object),
|
||||||
assign_tags: my_module_my_module_tags_path(object),
|
assign_tags: my_module_my_module_tags_path(object),
|
||||||
assigned_tags: assigned_tags_my_module_my_module_tags_path(object),
|
assigned_tags: assigned_tags_my_module_my_module_tags_path(object),
|
||||||
|
|
@ -86,7 +86,7 @@ module Lists
|
||||||
end
|
end
|
||||||
|
|
||||||
def due_date_status
|
def due_date_status
|
||||||
if (object.archived_branch? || object.completed?) && object.due_date
|
if (archived || object.completed?) && object.due_date
|
||||||
return :ok
|
return :ok
|
||||||
elsif object.is_one_day_prior? && !object.completed?
|
elsif object.is_one_day_prior? && !object.completed?
|
||||||
return :one_day_prior
|
return :one_day_prior
|
||||||
|
|
@ -98,7 +98,7 @@ module Lists
|
||||||
end
|
end
|
||||||
|
|
||||||
def archived
|
def archived
|
||||||
object.archived?
|
object.archived_branch?
|
||||||
end
|
end
|
||||||
|
|
||||||
def archived_on
|
def archived_on
|
||||||
|
|
@ -110,7 +110,7 @@ module Lists
|
||||||
end
|
end
|
||||||
|
|
||||||
def results
|
def results
|
||||||
(object.archived_branch? ? object.results : object.results.active).length
|
(archived ? object.results : object.results.active).length
|
||||||
end
|
end
|
||||||
|
|
||||||
def status
|
def status
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,11 @@ module Lists
|
||||||
|
|
||||||
def urls
|
def urls
|
||||||
urls_list = {
|
urls_list = {
|
||||||
show: project? ? experiments_path(project_id: object) : project_folder_path(object),
|
show: if project?
|
||||||
|
experiments_path(project_id: object, view_mode: object.archived ? 'archived' : 'active')
|
||||||
|
else
|
||||||
|
project_folder_path(object, view_mode: object.archived ? 'archived' : 'active')
|
||||||
|
end,
|
||||||
actions: actions_toolbar_projects_path(items: [{ id: object.id,
|
actions: actions_toolbar_projects_path(items: [{ id: object.id,
|
||||||
type: project? ? 'projects' : 'project_folders' }].to_json)
|
type: project? ? 'projects' : 'project_folders' }].to_json)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue