Skip to content

Commit

Permalink
(not complete we should discuss) there is no action type for renderin…
Browse files Browse the repository at this point in the history
…g component or form as an action in page-header component
  • Loading branch information
bsatarnejad committed Mar 28, 2024
1 parent c662b50 commit fb3c6a7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 25 deletions.
37 changes: 13 additions & 24 deletions modules/storages/app/views/storages/admin/storages/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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 %>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 %>
Expand Down

0 comments on commit fb3c6a7

Please sign in to comment.