mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-10 17:36:33 +08:00
Merge pull request #2829 from aignatov-bio/ai-sci-4983-add-descriptions-for-conditions
Add description for conditions [SCI-4983]
This commit is contained in:
commit
5d9d7d6a12
4 changed files with 14 additions and 2 deletions
|
@ -81,6 +81,7 @@
|
|||
align-items: center;
|
||||
display: grid;
|
||||
grid-template-columns: 1fr min-content 1fr;
|
||||
grid-template-rows: 28px;
|
||||
justify-content: space-around;
|
||||
position: relative;
|
||||
|
||||
|
|
|
@ -4,7 +4,11 @@
|
|||
module MyModuleStatusConditions
|
||||
class Active < MyModuleStatusCondition
|
||||
def call(my_module)
|
||||
my_module.errors.add(:status_conditions, 'MyModule should be active') unless my_module.active?
|
||||
my_module.errors.add(:status_conditions, I18n.t('my_module_statuses.conditions.error.my_module_not_active')) unless my_module.active?
|
||||
end
|
||||
|
||||
def description
|
||||
I18n.t('my_module_statuses.conditions.error.my_module_not_active')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -14,7 +14,11 @@
|
|||
<div class="status-block" style="background: <%= status[:color] %>">
|
||||
<%= status[:name] %>
|
||||
</div>
|
||||
<div class="status-comment"><%= status[:status_comment] %></div>
|
||||
<div class="status-comment">
|
||||
<% status.next_status&.my_module_status_conditions&.each do |condition| %>
|
||||
<%= condition.description %><br>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
|
|
@ -8,3 +8,6 @@ en:
|
|||
update_status:
|
||||
error:
|
||||
no_permission: You dont have permission to change the status
|
||||
conditions:
|
||||
error:
|
||||
my_module_not_active: 'Task should be active'
|
||||
|
|
Loading…
Reference in a new issue