Fix project actions, fix edit icons [SCI-8391]

This commit is contained in:
Martin Artnik 2023-05-04 15:52:46 +02:00
parent 7a6fe5050d
commit cf9f86b5d2
3 changed files with 28 additions and 15 deletions

View file

@ -56,7 +56,7 @@ module Toolbars
{
name: 'edit',
label: I18n.t('experiments.index.edit_option'),
icon: 'fa fa-pen',
icon: 'fa fa-pencil-alt',
button_class: 'edit-btn',
path: edit_experiment_path(experiment),
type: 'remote-modal'

View file

@ -58,7 +58,7 @@ module Toolbars
{
name: 'edit',
label: I18n.t('experiments.table.toolbar.edit'),
icon: 'fa fa-pen',
icon: 'fa fa-pencil-alt',
button_id: 'editTask',
type: :legacy
}

View file

@ -31,12 +31,12 @@ module Toolbars
return [] if @item_type == :none
[
restore_action,
edit_action,
access_action,
move_action,
export_action,
archive_action,
restore_action,
comments_action,
activities_action,
delete_folder_action
@ -48,20 +48,33 @@ module Toolbars
def edit_action
return unless @single
return unless @item_type == :project
if @items.first.is_a?(Project)
project = @items.first
project = @items.first
return unless can_manage_project?(project)
return unless can_manage_project?(project)
{
name: 'edit',
label: I18n.t('projects.index.edit_option'),
icon: 'fas fa-pencil-alt',
button_class: 'edit-btn',
path: edit_project_path(project),
type: :legacy
}
else
project_folder = @items.first
{
name: 'edit',
label: I18n.t('projects.index.edit_option'),
icon: 'fa fa-pen',
button_class: 'edit-btn',
path: edit_project_path(project),
type: :legacy
}
return unless can_create_project_folders?(project_folder.team)
{
name: 'edit',
label: I18n.t('projects.index.edit_option'),
icon: 'fas fa-pencil-alt',
button_class: 'edit-btn',
path: edit_project_folder_path(project_folder),
type: :legacy
}
end
end
def access_action
@ -82,7 +95,7 @@ module Toolbars
{
name: 'access',
label: I18n.t('general.access'),
icon: 'fa fa-door-open',
icon: 'fas fa-door-open',
button_class: 'access-btn',
path: path,
type: 'remote-modal'