mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-01 13:13:22 +08:00
Fix tag display in experiment table for viewer role [SCI-7696] (#4781)
This commit is contained in:
parent
ef8b8344fd
commit
1fe39a216c
2 changed files with 6 additions and 0 deletions
|
@ -632,6 +632,11 @@ ExperimnetTable.render.assigned = function(data) {
|
|||
|
||||
ExperimnetTable.render.tags = function(data) {
|
||||
const value = parseInt(data.tags, 10) === 0 ? I18n.t('experiments.table.add_tag') : data.tags;
|
||||
|
||||
if (data.tags === 0 && !data.can_create) {
|
||||
return `<span class="disabled">${I18n.t('experiments.table.not_set')}</span>`;
|
||||
}
|
||||
|
||||
return `<a href="${data.edit_url}"
|
||||
id="myModuleTags${data.my_module_id}"
|
||||
data-remote="true"
|
||||
|
|
|
@ -161,6 +161,7 @@ module Experiments
|
|||
{
|
||||
my_module_id: my_module.id,
|
||||
tags: my_module.tags.length,
|
||||
can_create: can_manage_my_module_tags?(@user, my_module),
|
||||
edit_url: my_module_tags_edit_path(my_module, format: :json)
|
||||
}
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue