Fix tag display in experiment table for viewer role [SCI-7696] (#4781)

This commit is contained in:
ajugo 2023-01-10 11:09:23 +01:00 committed by GitHub
parent ef8b8344fd
commit 1fe39a216c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View file

@ -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"

View file

@ -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