mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-10 09:23:58 +08:00
Merge pull request #7546 from aignatov-bio/ai-sci-10675-update-results-counter-logic
Update results counter logic [SCI-10675]
This commit is contained in:
commit
a87347cde6
2 changed files with 9 additions and 1 deletions
|
@ -155,6 +155,14 @@ class MyModule < ApplicationRecord
|
|||
experiment
|
||||
end
|
||||
|
||||
def results_count(view_mode = 'active')
|
||||
return results.size if archived_branch?
|
||||
|
||||
return results.archived.size if view_mode == 'archived'
|
||||
|
||||
results.active.size
|
||||
end
|
||||
|
||||
def navigable?
|
||||
!experiment.archived? && experiment.navigable?
|
||||
end
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
data-e2e="e2e-BT-taskTabs-results"
|
||||
>
|
||||
<%= t("nav2.modules.results") %>
|
||||
<%= "[#{(@my_module.archived_branch? ? @my_module.results : @my_module.results.active).size}]" %>
|
||||
<%= "[#{@my_module.results_count(params[:view_mode])}]" %>
|
||||
</a>
|
||||
<a class="p-3 border-b-4 border-transparent hover:no-underline uppercase text-bold capitalize <%= is_module_activities? ? "text-sn-blue" : "text-sn-grey" %>"
|
||||
href="<%= activities_my_module_url(@my_module, view_mode: params[:view_mode]) %>"
|
||||
|
|
Loading…
Reference in a new issue