mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-09-21 07:26:15 +08:00
Merge pull request #2840 from aignatov-bio/ai-sci-5005-update-frontend-permissions-for-status-flow
Update front-end permission check [SCI-5005]
This commit is contained in:
commit
e924dc220f
|
@ -22,7 +22,7 @@
|
|||
align-items: center;
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, auto) 12px minmax(0, auto);
|
||||
padding: .5em 0;
|
||||
padding: .5em 0 0;
|
||||
|
||||
li {
|
||||
display: contents;
|
||||
|
@ -74,13 +74,23 @@
|
|||
grid-column: span 3;
|
||||
line-height: 1em;
|
||||
padding: 0em 1em .5em;
|
||||
|
||||
&:empty {
|
||||
display: none;
|
||||
}
|
||||
|
||||
&.permission-error {
|
||||
padding: .5em 1em;
|
||||
}
|
||||
}
|
||||
|
||||
#viewTaskFlow {
|
||||
border-top: $border-default;
|
||||
cursor: pointer;
|
||||
display: list-item;
|
||||
grid-column: span 3;
|
||||
line-height: 2em;
|
||||
margin-top: .5em;
|
||||
padding: .5em 1em;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
<%= render partial: 'my_module_details' %>
|
||||
</div>
|
||||
<div class="task-flows">
|
||||
<%= render partial: 'my_modules/status_flow/task_flow_button', locals: { my_module: @my_module } if @my_module.my_module_status_flow && can_change_my_module_flow_status?(@my_module) %>
|
||||
<%= render partial: 'my_modules/status_flow/task_flow_button', locals: { my_module: @my_module } if @my_module.my_module_status_flow %>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Notes -->
|
||||
|
|
|
@ -21,38 +21,38 @@
|
|||
<span class="caret pull-right"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu" aria-labelledby="dropdownTaskFlow" id="dropdownTaskFlowList" data-link-url="<%= update_state_my_module_url(my_module) %>">
|
||||
<% unless status.initial_status? %>
|
||||
<% previous_s = status.previous_status %>
|
||||
<% previous_s_errors = previous_s.conditions_errors(my_module) %>
|
||||
<li data-state-id="<%= previous_s.id %>" class="<%= 'disabled' if previous_s_errors.any? %>">
|
||||
<span><%= t('my_module_statuses.dropdown.return_label') %></span>
|
||||
<i class="fas fa-long-arrow-alt-right"></i>
|
||||
<div class=" status-container">
|
||||
<div class="status-name" style="<%= "background-color: #{previous_s.color}" %>"><%= previous_s.name %></div>
|
||||
</div>
|
||||
</li>
|
||||
<span class="error-message">
|
||||
<% previous_s_errors.each do |error| %>
|
||||
<%= error %><br>
|
||||
<% end %>
|
||||
</span>
|
||||
<% end %>
|
||||
<% if can_change_my_module_flow_status?(@my_module) %>
|
||||
<% unless status.initial_status? %>
|
||||
<% previous_s = status.previous_status %>
|
||||
<% previous_s_errors = previous_s.conditions_errors(my_module) %>
|
||||
<li data-state-id="<%= previous_s.id %>" class="<%= 'disabled' if previous_s_errors.any? %>">
|
||||
<span><%= t('my_module_statuses.dropdown.return_label') %></span>
|
||||
<i class="fas fa-long-arrow-alt-right"></i>
|
||||
<div class=" status-container">
|
||||
<div class="status-name" style="<%= "background-color: #{previous_s.color}" %>"><%= previous_s.name %></div>
|
||||
</div>
|
||||
</li>
|
||||
<span class="error-message"><% previous_s_errors.each do |error| %>
|
||||
<%= error %><br>
|
||||
<% end %></span>
|
||||
<% end %>
|
||||
|
||||
<% unless status.final_status? %>
|
||||
<% next_s = status.next_status %>
|
||||
<% next_s_errors = next_s.conditions_errors(my_module) %>
|
||||
<li data-state-id="<%= next_s.id %>" class="<%= 'disabled' if next_s_errors.any? %>">
|
||||
<span><%= t('my_module_statuses.dropdown.move_label') %></span>
|
||||
<i class="fas fa-long-arrow-alt-right"></i>
|
||||
<div class="status-container">
|
||||
<div class="status-name" style="<%= "background-color: #{next_s.color}" %>"><%= next_s.name %></div>
|
||||
</div>
|
||||
</li>
|
||||
<span class="error-message">
|
||||
<% next_s_errors.each do |error| %>
|
||||
<%= error %><br>
|
||||
<% end %>
|
||||
</span>
|
||||
<% unless status.final_status? %>
|
||||
<% next_s = status.next_status %>
|
||||
<% next_s_errors = next_s.conditions_errors(my_module) %>
|
||||
<li data-state-id="<%= next_s.id %>" class="<%= 'disabled' if next_s_errors.any? %>">
|
||||
<span><%= t('my_module_statuses.dropdown.move_label') %></span>
|
||||
<i class="fas fa-long-arrow-alt-right"></i>
|
||||
<div class="status-container">
|
||||
<div class="status-name" style="<%= "background-color: #{next_s.color}" %>"><%= next_s.name %></div>
|
||||
</div>
|
||||
</li>
|
||||
<span class="error-message"><% next_s_errors.each do |error| %>
|
||||
<%= error %><br>
|
||||
<% end %></span>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<span class="error-message permission-error"><%= t('my_module_statuses.dropdown.no_permission_label') %></span>
|
||||
<% end %>
|
||||
<li id="viewTaskFlow">
|
||||
<%= t('my_module_statuses.dropdown.view_flow_label') %>
|
||||
|
|
|
@ -6,6 +6,7 @@ en:
|
|||
move_label: 'Move to'
|
||||
return_label: 'Return to'
|
||||
view_flow_label: 'View task flow'
|
||||
no_permission_label: 'You don’t have permission to change the status of this task.'
|
||||
update_status:
|
||||
error:
|
||||
no_permission: 'You dont have permission to change the status'
|
||||
|
|
Loading…
Reference in a new issue