From fb3c6a780cb1b3c2b9209450965fff7ae51c48f6 Mon Sep 17 00:00:00 2001 From: Behrokh Satarnejad Date: Thu, 28 Mar 2024 19:46:48 +0100 Subject: [PATCH] (not complete we should discuss) there is no action type for rendering component or form as an action in page-header component --- .../storages/admin/storages/edit.html.erb | 37 +++++++------------ .../storages/admin/storages/index.html.erb | 6 ++- 2 files changed, 18 insertions(+), 25 deletions(-) diff --git a/modules/storages/app/views/storages/admin/storages/edit.html.erb b/modules/storages/app/views/storages/admin/storages/edit.html.erb index c0035698bf10..32c51675ad41 100644 --- a/modules/storages/app/views/storages/admin/storages/edit.html.erb +++ b/modules/storages/app/views/storages/admin/storages/edit.html.erb @@ -44,33 +44,22 @@ See COPYRIGHT and LICENSE files for more details. <% end %> <% end %> - <% header.with_back_button(href: admin_settings_storages_path, 'aria-label': I18n.t("button_back")) %> - - <% header.with_parent_link(href: admin_settings_storages_path, 'aria-label': I18n.t("button_back")) do %> - <%= t(:project_module_storages) %> - <% end %> - - <% header.with_actions(test_selector: 'page-header-actions') do %> - <%= - primer_form_with( + <% header.with_breadcrumbs([{href: admin_index_path, text: t("label_administration")}, + {href: admin_settings_storages_path, text: t("project_module_storages")}, + @storage.name]) %> + <%= primer_form_with( model: @storage, url: confirm_destroy_admin_settings_storage_path(@storage), method: :get - ) do |_form| - render( - Primer::Beta::Button.new( - scheme: :danger, - size: :medium, - type: :submit, - aria: { label: I18n.t("storages.label_delete_storage") }, - test_selector: 'storage-delete-button' - ) - ) do |button| - button.with_leading_visual_icon(icon: :trash) - I18n.t('button_delete') - end - end - %> + ) do %> + <% header.with_action_button(mt: 2, mb: 2, data: { 'test-selector': "project-query-name"}, scheme: :danger,mobile_icon: "trash", mobile_label: I18n.t('button_delete'), + size: :medium, + type: :submit, + aria: { label: I18n.t("storages.label_delete_storage") }, + test_selector: "storage-delete-button") do |button| + button.with_leading_visual_icon(icon: :trash) + I18n.t("button_delete") + end %> <% end %> <% end %> diff --git a/modules/storages/app/views/storages/admin/storages/index.html.erb b/modules/storages/app/views/storages/admin/storages/index.html.erb index c435a0ba87ea..4601b5a0d68d 100644 --- a/modules/storages/app/views/storages/admin/storages/index.html.erb +++ b/modules/storages/app/views/storages/admin/storages/index.html.erb @@ -10,7 +10,11 @@ <%= t("storages.page_titles.file_storages.subtitle") %> <% end %> - <% header.with_actions do %> + <% header.with_breadcrumbs(breadcrumb_paths( + link_to(t(:label_administration), admin_index_path), + default_breadcrumb + )) %> + <% header.with_action_button(mobile_icon: "star", mobile_label: "Star") do %> <%= render(Storages::Admin::NewStorageButtonComponent.new) %> <% end %> <% end %>