diff --git a/app/components/activities/days_component.html.erb b/app/components/activities/days_component.html.erb
index f3be931221e..2faf0cb7d0d 100644
--- a/app/components/activities/days_component.html.erb
+++ b/app/components/activities/days_component.html.erb
@@ -33,10 +33,14 @@ See COPYRIGHT and LICENSE files for more details.
<%=
- render(Activities::ItemComponent.with_collection(events,
- current_project: @current_project,
- display_user: @display_user,
- activity_page: @activity_page))
+ render(
+ Activities::ItemComponent.with_collection(
+ events,
+ current_project: @current_project,
+ display_user: @display_user,
+ activity_page: @activity_page
+ )
+ )
%>
<% end -%>
diff --git a/app/components/activities/item_component.html.erb b/app/components/activities/item_component.html.erb
index bf5fb32d9c4..00520787386 100644
--- a/app/components/activities/item_component.html.erb
+++ b/app/components/activities/item_component.html.erb
@@ -37,13 +37,15 @@ See COPYRIGHT and LICENSE files for more details.
<%= project_suffix %>
<%=
- render(Activities::ItemSubtitleComponent.new(
- user: display_user? && @event.event_author,
- datetime: @event.event_datetime,
- is_creation: initial?,
- is_deletion: deletion?,
- is_work_package: work_package?,
- journable_type: @event.journal.journable_type)
+ render(
+ Activities::ItemSubtitleComponent.new(
+ user: display_user? && @event.event_author,
+ datetime: @event.event_datetime,
+ is_creation: initial?,
+ is_deletion: deletion?,
+ is_work_package: work_package?,
+ journable_type: @event.journal.journable_type
+ )
)
%>
<% if comment.present? -%>
diff --git a/app/components/activities/item_subtitle_component.html.erb b/app/components/activities/item_subtitle_component.html.erb
index 05b60d4a1af..0016a82667a 100644
--- a/app/components/activities/item_subtitle_component.html.erb
+++ b/app/components/activities/item_subtitle_component.html.erb
@@ -29,7 +29,8 @@ See COPYRIGHT and LICENSE files for more details.
<%=
- I18n.t(i18n_key,
+ I18n.t(
+ i18n_key,
user: user_html,
datetime: datetime_html
).html_safe
diff --git a/app/components/add_button_component.html.erb b/app/components/add_button_component.html.erb
index 4db39b90dc4..88aec27eada 100644
--- a/app/components/add_button_component.html.erb
+++ b/app/components/add_button_component.html.erb
@@ -1,10 +1,14 @@
-<%= render(Primer::ButtonComponent.new(scheme: :primary,
- aria: { label: aria_label },
- title:,
- test_selector:,
- tag: :a,
- id:,
- href: dynamic_path) ) do |button|
- button.with_leading_visual_icon(icon: :plus)
- label_text
-end %>
+<%= render(
+ Primer::ButtonComponent.new(
+ scheme: :primary,
+ aria: { label: aria_label },
+ title:,
+ test_selector:,
+ tag: :a,
+ id:,
+ href: dynamic_path
+ )
+ ) do |button|
+ button.with_leading_visual_icon(icon: :plus)
+ label_text
+ end %>
diff --git a/app/components/admin/attachments_settings_header_component.html.erb b/app/components/admin/attachments_settings_header_component.html.erb
index a264231f9aa..65260b6688a 100644
--- a/app/components/admin/attachments_settings_header_component.html.erb
+++ b/app/components/admin/attachments_settings_header_component.html.erb
@@ -30,22 +30,24 @@ See COPYRIGHT and LICENSE files for more details.
<% helpers.html_title t(:label_administration), @title %>
<%= render(Primer::OpenProject::PageHeader.new) do |header|
- header.with_title { t(:"attributes.attachments") }
- header.with_breadcrumbs([{ href: admin_index_path, text: t("label_administration") },
- { href: admin_settings_storages_path, text: t("project_module_storages") },
- t(:"attributes.attachments")])
- header.with_tab_nav(label: nil) do |tab_nav|
- tab_nav.with_tab(selected: @selected == 1, href: admin_settings_attachments_path) do |tab|
- tab.with_text { t("settings.general") }
- end
- tab_nav.with_tab(selected: @selected == 2, href: admin_settings_virus_scanning_path) do |tab|
- tab.with_icon(icon: :"op-enterprise-addons") unless EnterpriseToken.allows_to?("virus_scanning")
- tab.with_text { t(:"settings.antivirus.title") }
- end
- if User.current.admin? && (EnterpriseToken.allows_to?(:virus_scanning) || Attachment.status_quarantined.any?)
- tab_nav.with_tab(selected: @selected == 3, href: admin_quarantined_attachments_path) do |tab|
- tab.with_text { t(:"antivirus_scan.quarantined_attachments.title") }
+ header.with_title { t(:"attributes.attachments") }
+ header.with_breadcrumbs(
+ [{ href: admin_index_path, text: t("label_administration") },
+ { href: admin_settings_storages_path, text: t("project_module_storages") },
+ t(:"attributes.attachments")]
+ )
+ header.with_tab_nav(label: nil) do |tab_nav|
+ tab_nav.with_tab(selected: @selected == 1, href: admin_settings_attachments_path) do |tab|
+ tab.with_text { t("settings.general") }
+ end
+ tab_nav.with_tab(selected: @selected == 2, href: admin_settings_virus_scanning_path) do |tab|
+ tab.with_icon(icon: :"op-enterprise-addons") unless EnterpriseToken.allows_to?("virus_scanning")
+ tab.with_text { t(:"settings.antivirus.title") }
+ end
+ if User.current.admin? && (EnterpriseToken.allows_to?(:virus_scanning) || Attachment.status_quarantined.any?)
+ tab_nav.with_tab(selected: @selected == 3, href: admin_quarantined_attachments_path) do |tab|
+ tab.with_text { t(:"antivirus_scan.quarantined_attachments.title") }
+ end
+ end
end
- end
- end
-end %>
+ end %>
diff --git a/app/components/admin/backups/show_page_header_component.html.erb b/app/components/admin/backups/show_page_header_component.html.erb
index 4b1ddcd8bca..299bdb8e72e 100644
--- a/app/components/admin/backups/show_page_header_component.html.erb
+++ b/app/components/admin/backups/show_page_header_component.html.erb
@@ -29,34 +29,40 @@ See COPYRIGHT and LICENSE files for more details.
<%=
render(Primer::OpenProject::PageHeader.new) do |header|
header.with_title { t(:label_backup) }
- header.with_breadcrumbs([{ href: admin_index_path, text: t(:label_administration) },
- t(:label_backup)])
+ header.with_breadcrumbs(
+ [{ href: admin_index_path, text: t(:label_administration) },
+ t(:label_backup)]
+ )
- header.with_action_button(tag: :a,
- scheme: button_scheme,
- mobile_label: button_title,
- mobile_icon: button_icon,
- size: :medium,
- href: reset_token_admin_backups_path,
- aria: { label: button_title },
- title: button_title) do |button|
+ header.with_action_button(
+ tag: :a,
+ scheme: button_scheme,
+ mobile_label: button_title,
+ mobile_icon: button_icon,
+ size: :medium,
+ href: reset_token_admin_backups_path,
+ aria: { label: button_title },
+ title: button_title
+ ) do |button|
button.with_leading_visual_icon(icon: button_icon)
button_title
end
if @backup_token.present?
- header.with_action_button(tag: :a,
- scheme: :danger,
- mobile_icon: :trash,
- mobile_label: t("backup.label_delete_token"),
- size: :medium,
- href: delete_token_admin_backups_path,
- aria: { label: I18n.t("backup.label_delete_token") },
- data: {
- confirm: I18n.t(:text_are_you_sure),
- method: :post
- },
- title: I18n.t(:button_delete)) do |button|
+ header.with_action_button(
+ tag: :a,
+ scheme: :danger,
+ mobile_icon: :trash,
+ mobile_label: t("backup.label_delete_token"),
+ size: :medium,
+ href: delete_token_admin_backups_path,
+ aria: { label: I18n.t("backup.label_delete_token") },
+ data: {
+ confirm: I18n.t(:text_are_you_sure),
+ method: :post
+ },
+ title: I18n.t(:button_delete)
+ ) do |button|
button.with_leading_visual_icon(icon: :trash)
t("backup.label_delete_token")
end
diff --git a/app/components/admin/custom_fields/custom_field_projects/new_custom_field_projects_form_modal_component.html.erb b/app/components/admin/custom_fields/custom_field_projects/new_custom_field_projects_form_modal_component.html.erb
index 3950d4e83b5..d3be0b0f87b 100644
--- a/app/components/admin/custom_fields/custom_field_projects/new_custom_field_projects_form_modal_component.html.erb
+++ b/app/components/admin/custom_fields/custom_field_projects/new_custom_field_projects_form_modal_component.html.erb
@@ -30,22 +30,28 @@ See COPYRIGHT and LICENSE files for more details.
<%=
component_wrapper do
primer_form_with(
- model: ,
+ model:,
url:,
data: { turbo: true },
method: :post
) do |form|
- concat(render(Primer::Alpha::Dialog::Body.new(
- id: dialog_body_id, test_selector: dialog_body_id, aria: { label: title },
- classes: "Overlay-body_autocomplete_height"
- )) do
- render(Projects::CustomFields::CustomFieldMappingForm.new(form, project_mapping: @custom_field_project_mapping))
- end)
+ concat(
+ render(
+ Primer::Alpha::Dialog::Body.new(
+ id: dialog_body_id, test_selector: dialog_body_id, aria: { label: title },
+ classes: "Overlay-body_autocomplete_height"
+ )
+ ) do
+ render(Projects::CustomFields::CustomFieldMappingForm.new(form, project_mapping: @custom_field_project_mapping))
+ end
+ )
- concat(render(Primer::Alpha::Dialog::Footer.new(show_divider: false)) do
- concat(render(Primer::ButtonComponent.new(data: { 'close-dialog-id': dialog_id })) { cancel_button_text })
- concat(render(Primer::ButtonComponent.new(scheme: :primary, type: :submit)) { submit_button_text })
- end)
+ concat(
+ render(Primer::Alpha::Dialog::Footer.new(show_divider: false)) do
+ concat(render(Primer::ButtonComponent.new(data: { 'close-dialog-id': dialog_id })) { cancel_button_text })
+ concat(render(Primer::ButtonComponent.new(scheme: :primary, type: :submit)) { submit_button_text })
+ end
+ )
end
end
%>
diff --git a/app/components/admin/custom_fields/hierarchy/delete_item_dialog_component.html.erb b/app/components/admin/custom_fields/hierarchy/delete_item_dialog_component.html.erb
index f9735c0fe9e..3297f3c6dde 100644
--- a/app/components/admin/custom_fields/hierarchy/delete_item_dialog_component.html.erb
+++ b/app/components/admin/custom_fields/hierarchy/delete_item_dialog_component.html.erb
@@ -28,12 +28,14 @@ See COPYRIGHT and LICENSE files for more details.
++#%>
<%=
- render(Primer::OpenProject::DangerDialog.new(
- title: I18n.t("custom_fields.admin.items.delete_dialog.title"),
- form_arguments:,
- size: :large,
- test_selector: TEST_SELECTOR
- )) do |dialog|
+ render(
+ Primer::OpenProject::DangerDialog.new(
+ title: I18n.t("custom_fields.admin.items.delete_dialog.title"),
+ form_arguments:,
+ size: :large,
+ test_selector: TEST_SELECTOR
+ )
+ ) do |dialog|
dialog.with_confirmation_message do |message|
message.with_heading(tag: :h2) { I18n.t("custom_fields.admin.items.delete_dialog.heading") }
message.with_description_content(I18n.t("custom_fields.admin.items.delete_dialog.description"))
diff --git a/app/components/admin/custom_fields/hierarchy/item_component.html.erb b/app/components/admin/custom_fields/hierarchy/item_component.html.erb
index 80f2b831b8f..4a6973a1295 100644
--- a/app/components/admin/custom_fields/hierarchy/item_component.html.erb
+++ b/app/components/admin/custom_fields/hierarchy/item_component.html.erb
@@ -58,9 +58,11 @@ See COPYRIGHT and LICENSE files for more details.
item_container.with_column do
render(Primer::Alpha::ActionMenu.new(test_selector: "op-hierarchy-item--action-menu")) do |menu|
- menu.with_show_button(icon: "kebab-horizontal",
- scheme: :invisible,
- "aria-label": I18n.t("custom_fields.admin.items.actions"))
+ menu.with_show_button(
+ icon: "kebab-horizontal",
+ scheme: :invisible,
+ "aria-label": I18n.t("custom_fields.admin.items.actions")
+ )
menu_items(menu)
end
end
diff --git a/app/components/admin/design_header_component.html.erb b/app/components/admin/design_header_component.html.erb
index 5dd58b22d93..5546c157a75 100644
--- a/app/components/admin/design_header_component.html.erb
+++ b/app/components/admin/design_header_component.html.erb
@@ -31,8 +31,10 @@ See COPYRIGHT and LICENSE files for more details.
<%=
render(Primer::OpenProject::PageHeader.new) do |header|
header.with_title { t(:label_custom_style) }
- header.with_breadcrumbs([{ href: admin_index_path, text: t(:label_administration) },
- t(:label_custom_style)])
+ header.with_breadcrumbs(
+ [{ href: admin_index_path, text: t(:label_administration) },
+ t(:label_custom_style)]
+ )
header.with_description { t(:label_custom_style_description) }
if @tabs.present?
diff --git a/app/components/colors/edit_page_header_component.html.erb b/app/components/colors/edit_page_header_component.html.erb
index 55dde57ac10..d03fc0c8987 100644
--- a/app/components/colors/edit_page_header_component.html.erb
+++ b/app/components/colors/edit_page_header_component.html.erb
@@ -32,18 +32,20 @@ See COPYRIGHT and LICENSE files for more details.
header.with_breadcrumbs(breadcrumb_items)
if @color.persisted?
- header.with_action_button(tag: :a,
- scheme: :danger,
- mobile_icon: :trash,
- mobile_label: t(:button_delete),
- size: :medium,
- href: color_path(@color),
- aria: { label: I18n.t(:button_delete) },
- data: {
- confirm: I18n.t(:text_are_you_sure),
- method: :delete
- },
- title: I18n.t(:button_delete)) do |button|
+ header.with_action_button(
+ tag: :a,
+ scheme: :danger,
+ mobile_icon: :trash,
+ mobile_label: t(:button_delete),
+ size: :medium,
+ href: color_path(@color),
+ aria: { label: I18n.t(:button_delete) },
+ data: {
+ confirm: I18n.t(:text_are_you_sure),
+ method: :delete
+ },
+ title: I18n.t(:button_delete)
+ ) do |button|
button.with_leading_visual_icon(icon: :trash)
t(:button_delete)
end
diff --git a/app/components/custom_fields/details_component.html.erb b/app/components/custom_fields/details_component.html.erb
index c4e0409b4f2..491c3a84e1f 100644
--- a/app/components/custom_fields/details_component.html.erb
+++ b/app/components/custom_fields/details_component.html.erb
@@ -3,10 +3,12 @@
flex_layout do |content|
if has_no_items_or_projects?
content.with_row(mb: 3) do
- render Primer::Alpha::Banner.new(scheme: :default,
- icon: :info,
- dismiss_scheme: :hide,
- test_selector: "op-custom-fields--new-hierarchy-banner") do
+ render Primer::Alpha::Banner.new(
+ scheme: :default,
+ icon: :info,
+ dismiss_scheme: :hide,
+ test_selector: "op-custom-fields--new-hierarchy-banner"
+ ) do
I18n.t("custom_fields.admin.notice.remember_items_and_projects")
end
end
diff --git a/app/components/enterprise_edition/banner_component.html.erb b/app/components/enterprise_edition/banner_component.html.erb
index 85448f2903d..2930a0c5e8d 100644
--- a/app/components/enterprise_edition/banner_component.html.erb
+++ b/app/components/enterprise_edition/banner_component.html.erb
@@ -2,9 +2,13 @@
grid_layout("op-ee-banner", **@system_arguments) do |grid|
grid.with_area(:'icon-container') do
content_tag :div, class: "op-ee-banner--shield" do
- render(Primer::Beta::Octicon.new(icon: "op-enterprise-addons",
- size: :medium,
- classes: "op-ee-banner--icon"))
+ render(
+ Primer::Beta::Octicon.new(
+ icon: "op-enterprise-addons",
+ size: :medium,
+ classes: "op-ee-banner--icon"
+ )
+ )
end
end
grid.with_area(:'title-container') { render(Primer::Beta::Text.new) { title } }
diff --git a/app/components/filter/filter_button_component.html.erb b/app/components/filter/filter_button_component.html.erb
index f17a4b500bd..db2baaa23c7 100644
--- a/app/components/filter/filter_button_component.html.erb
+++ b/app/components/filter/filter_button_component.html.erb
@@ -1,9 +1,13 @@
<%= component_wrapper tag: "turbo-frame" do %>
- <%= render(Primer::Beta::Button.new(scheme: :secondary,
- disabled:,
- data: { "filter--filters-form-target": "filterFormToggle",
- action: "filter--filters-form#toggleDisplayFilters" },
- test_selector: "filter-component-toggle")) do |button| %>
+ <%= render(
+ Primer::Beta::Button.new(
+ scheme: :secondary,
+ disabled:,
+ data: { "filter--filters-form-target": "filterFormToggle",
+ action: "filter--filters-form#toggleDisplayFilters" },
+ test_selector: "filter-component-toggle"
+ )
+ ) do |button| %>
<% button.with_trailing_visual_counter(count: filters_count, test_selector: "filters-button-counter") %>
<%= t(:label_filter) %>
<% end %>
diff --git a/app/components/groups/edit_page_header_component.html.erb b/app/components/groups/edit_page_header_component.html.erb
index 62302ef4d8f..1ceaa46e320 100644
--- a/app/components/groups/edit_page_header_component.html.erb
+++ b/app/components/groups/edit_page_header_component.html.erb
@@ -31,30 +31,34 @@ See COPYRIGHT and LICENSE files for more details.
header.with_title { @group.name }
header.with_breadcrumbs(breadcrumb_items)
- header.with_action_button(tag: :a,
- mobile_icon: :person,
- mobile_label: t(:label_profile),
- size: :medium,
- href: show_group_path(@group),
- aria: { label: I18n.t(:label_profile) },
- title: I18n.t(:label_profile)) do |button|
+ header.with_action_button(
+ tag: :a,
+ mobile_icon: :person,
+ mobile_label: t(:label_profile),
+ size: :medium,
+ href: show_group_path(@group),
+ aria: { label: I18n.t(:label_profile) },
+ title: I18n.t(:label_profile)
+ ) do |button|
button.with_leading_visual_icon(icon: :person)
t(:label_profile)
end
if @current_user.admin?
- header.with_action_button(tag: :a,
- scheme: :danger,
- mobile_icon: :trash,
- mobile_label: t(:button_delete),
- size: :medium,
- href: group_path(@group),
- aria: { label: I18n.t(:button_delete) },
- data: {
- confirm: t(:text_are_you_sure),
- method: :delete,
- },
- title: I18n.t(:button_delete)) do |button|
+ header.with_action_button(
+ tag: :a,
+ scheme: :danger,
+ mobile_icon: :trash,
+ mobile_label: t(:button_delete),
+ size: :medium,
+ href: group_path(@group),
+ aria: { label: I18n.t(:button_delete) },
+ data: {
+ confirm: t(:text_are_you_sure),
+ method: :delete,
+ },
+ title: I18n.t(:button_delete)
+ ) do |button|
button.with_leading_visual_icon(icon: :trash)
t(:button_delete)
end
diff --git a/app/components/groups/show_page_header_component.html.erb b/app/components/groups/show_page_header_component.html.erb
index f42886dfed3..cce6470cc23 100644
--- a/app/components/groups/show_page_header_component.html.erb
+++ b/app/components/groups/show_page_header_component.html.erb
@@ -28,34 +28,38 @@ See COPYRIGHT and LICENSE files for more details.
++#%>
<%=
render(Primer::OpenProject::PageHeader.new) do |header|
- header.with_title(test_selector: "groups--title") { @group.name }
+ header.with_title(test_selector: "groups--title") { @group.name }
header.with_breadcrumbs(breadcrumb_items)
if @current_user.admin?
- header.with_action_button(tag: :a,
- mobile_icon: :pencil,
- mobile_label: t(:button_edit),
- size: :medium,
- href: edit_group_path(@group),
- aria: { label: I18n.t(:button_edit) },
- data: { "test-selector": "groups--edit-group-button" },
- title: I18n.t(:button_edit)) do |button|
+ header.with_action_button(
+ tag: :a,
+ mobile_icon: :pencil,
+ mobile_label: t(:button_edit),
+ size: :medium,
+ href: edit_group_path(@group),
+ aria: { label: I18n.t(:button_edit) },
+ data: { "test-selector": "groups--edit-group-button" },
+ title: I18n.t(:button_edit)
+ ) do |button|
button.with_leading_visual_icon(icon: :pencil)
t(:button_edit)
end
- header.with_action_button(tag: :a,
- scheme: :danger,
- mobile_icon: :trash,
- mobile_label: t(:button_delete),
- size: :medium,
- href: group_path(@group),
- aria: { label: I18n.t(:button_delete) },
- data: {
- confirm: t(:text_are_you_sure),
- method: :delete,
- },
- title: I18n.t(:button_delete)) do |button|
+ header.with_action_button(
+ tag: :a,
+ scheme: :danger,
+ mobile_icon: :trash,
+ mobile_label: t(:button_delete),
+ size: :medium,
+ href: group_path(@group),
+ aria: { label: I18n.t(:button_delete) },
+ data: {
+ confirm: t(:text_are_you_sure),
+ method: :delete,
+ },
+ title: I18n.t(:button_delete)
+ ) do |button|
button.with_leading_visual_icon(icon: :trash)
t(:button_delete)
end
diff --git a/app/components/individual_principal_base_filter_component.html.erb b/app/components/individual_principal_base_filter_component.html.erb
index fbad36ec421..070fc1916a4 100644
--- a/app/components/individual_principal_base_filter_component.html.erb
+++ b/app/components/individual_principal_base_filter_component.html.erb
@@ -28,7 +28,7 @@ See COPYRIGHT and LICENSE files for more details.
++#%>
<%= form_tag(filter_path, method: :get) do %>
- <% collapsed_class = initially_visible? ? "" : "collapsed" %>
+ <% collapsed_class = initially_visible? ? "" : "collapsed" %>
<%= t(:label_filter_plural) %>
<% if has_close_icon? %>
@@ -51,14 +51,14 @@ See COPYRIGHT and LICENSE files for more details.
<%= Group.model_name.human %>:
<%= collection_select :group,
- :id,
- groups,
- :id,
- :name,
- { include_blank: true,
- selected: params[:group_id].to_i },
- { name: "group_id",
- class: "simple-filters--filter-value" } %>
+ :id,
+ groups,
+ :id,
+ :name,
+ { include_blank: true,
+ selected: params[:group_id].to_i },
+ { name: "group_id",
+ class: "simple-filters--filter-value" } %>
<% end %>
<% if roles.present? %>
@@ -78,7 +78,8 @@ See COPYRIGHT and LICENSE files for more details.
{
name: "role_id",
class: "simple-filters--filter-value"
- })
+ }
+ )
%>
<% end %>
@@ -96,7 +97,8 @@ See COPYRIGHT and LICENSE files for more details.
include_blank: true,
name: "shared_role_id",
class: "simple-filters--filter-value"
- })
+ }
+ )
%>
<% end %>
diff --git a/app/components/members/index_sub_header_component.html.erb b/app/components/members/index_sub_header_component.html.erb
index 95a0f66214d..c2e2105777b 100644
--- a/app/components/members/index_sub_header_component.html.erb
+++ b/app/components/members/index_sub_header_component.html.erb
@@ -1,22 +1,26 @@
<%= render(Primer::OpenProject::SubHeader.new) do |subheader|
- subheader.with_filter_button(label: I18n.t(:description_filter),
- id: "filter-member-button",
- aria: { label: I18n.t(:description_filter) },
- class: "toggle-member-filter-link",
- data: filter_button_data_attributes) do
- I18n.t(:description_filter)
- end
+ subheader.with_filter_button(
+ label: I18n.t(:description_filter),
+ id: "filter-member-button",
+ aria: { label: I18n.t(:description_filter) },
+ class: "toggle-member-filter-link",
+ data: filter_button_data_attributes
+ ) do
+ I18n.t(:description_filter)
+ end
- subheader.with_action_button(scheme: :primary,
- aria: { label: I18n.t(:button_add_member) },
- title: I18n.t(:button_add_member),
- id: "add-member-button",
- data: add_button_data_attributes) do |button|
- button.with_leading_visual_icon(icon: :plus)
- t("activerecord.models.member")
- end
+ subheader.with_action_button(
+ scheme: :primary,
+ aria: { label: I18n.t(:button_add_member) },
+ title: I18n.t(:button_add_member),
+ id: "add-member-button",
+ data: add_button_data_attributes
+ ) do |button|
+ button.with_leading_visual_icon(icon: :plus)
+ t("activerecord.models.member")
+ end
- subheader.with_bottom_pane_component do
- render ::Members::UserFilterComponent.new(params, **@members_filter_options)
- end
-end %>
+ subheader.with_bottom_pane_component do
+ render ::Members::UserFilterComponent.new(params, **@members_filter_options)
+ end
+ end %>
diff --git a/app/components/messages/show_page_header_component.html.erb b/app/components/messages/show_page_header_component.html.erb
index 2fd3c270434..8714870d380 100644
--- a/app/components/messages/show_page_header_component.html.erb
+++ b/app/components/messages/show_page_header_component.html.erb
@@ -6,48 +6,54 @@
watcher_action_button(header, @topic)
if !@topic.locked? && authorize_for("messages", "reply")
- header.with_action_button(tag: :a,
- scheme: :default,
- mobile_icon: :quote,
- mobile_label: t(:button_quote),
- size: :medium,
- href: url_for({ action: "quote", id: @topic }),
- aria: { label: I18n.t(:button_delete) },
- data: { 'action': "forum-messages#quote", test_selector: "message-quote-button" },
- title: t(:button_quote)) do |button|
+ header.with_action_button(
+ tag: :a,
+ scheme: :default,
+ mobile_icon: :quote,
+ mobile_label: t(:button_quote),
+ size: :medium,
+ href: url_for({ action: "quote", id: @topic }),
+ aria: { label: I18n.t(:button_delete) },
+ data: { 'action': "forum-messages#quote", test_selector: "message-quote-button" },
+ title: t(:button_quote)
+ ) do |button|
button.with_leading_visual_icon(icon: :quote)
t(:button_quote)
end
end
if @message.editable_by?(User.current)
- header.with_action_button(tag: :a,
- scheme: :default,
- mobile_icon: :pencil,
- mobile_label: t(:button_edit),
- size: :medium,
- href: edit_topic_path(@topic),
- aria: { label: t(:button_edit) },
- data: { test_selector: "message-edit-button" },
- title: t(:button_edit)) do |button|
+ header.with_action_button(
+ tag: :a,
+ scheme: :default,
+ mobile_icon: :pencil,
+ mobile_label: t(:button_edit),
+ size: :medium,
+ href: edit_topic_path(@topic),
+ aria: { label: t(:button_edit) },
+ data: { test_selector: "message-edit-button" },
+ title: t(:button_edit)
+ ) do |button|
button.with_leading_visual_icon(icon: :pencil)
t(:button_edit)
end
end
if @message.destroyable_by?(User.current)
- header.with_action_button(tag: :a,
- scheme: :danger,
- mobile_icon: :trash,
- mobile_label: t(:button_delete),
- size: :medium,
- href: topic_path(@topic),
- aria: { label: I18n.t(:button_delete) },
- data: {
- confirm: I18n.t(:text_are_you_sure),
- method: :delete
- },
- title: I18n.t(:button_delete)) do |button|
+ header.with_action_button(
+ tag: :a,
+ scheme: :danger,
+ mobile_icon: :trash,
+ mobile_label: t(:button_delete),
+ size: :medium,
+ href: topic_path(@topic),
+ aria: { label: I18n.t(:button_delete) },
+ data: {
+ confirm: I18n.t(:text_are_you_sure),
+ method: :delete
+ },
+ title: I18n.t(:button_delete)
+ ) do |button|
button.with_leading_visual_icon(icon: :trash)
t(:button_delete)
end
diff --git a/app/components/my/access_token/access_token_created_dialog_component.html.erb b/app/components/my/access_token/access_token_created_dialog_component.html.erb
index ae5e4c791bf..928b20ab901 100644
--- a/app/components/my/access_token/access_token_created_dialog_component.html.erb
+++ b/app/components/my/access_token/access_token_created_dialog_component.html.erb
@@ -28,11 +28,13 @@ See COPYRIGHT and LICENSE files for more details.
++#%>
<%=
- render(Primer::OpenProject::FeedbackDialog.new(
- id:,
- title: I18n.t("my.access_token.create_dialog.title"),
- size: :large
- )) do |dialog|
+ render(
+ Primer::OpenProject::FeedbackDialog.new(
+ id:,
+ title: I18n.t("my.access_token.create_dialog.title"),
+ size: :large
+ )
+ ) do |dialog|
dialog.with_feedback_message do |message|
message.with_heading(tag: :h2) { I18n.t("my.access_token.create_dialog.header", type: "API") }
end
@@ -41,15 +43,18 @@ See COPYRIGHT and LICENSE files for more details.
flex_layout do |flex|
flex.with_row(mb: 2) do
render(Primer::OpenProject::InputGroup.new) do |input_group|
- input_group.with_text_input(name: :openproject_api_access_token,
- label: Token::API.model_name.human,
- visually_hide_label: false,
- value: @token_value)
+ input_group.with_text_input(
+ name: :openproject_api_access_token,
+ label: Token::API.model_name.human,
+ visually_hide_label: false,
+ value: @token_value
+ )
input_group.with_trailing_action_clipboard_copy_button(
value: @token_value,
aria: {
label: I18n.t("button_copy_to_clipboard")
- })
+ }
+ )
end
end
flex.with_row do
diff --git a/app/components/my/access_token/new_access_token_form_component.html.erb b/app/components/my/access_token/new_access_token_form_component.html.erb
index 0e190a81139..c5c6ea5d84d 100644
--- a/app/components/my/access_token/new_access_token_form_component.html.erb
+++ b/app/components/my/access_token/new_access_token_form_component.html.erb
@@ -36,9 +36,11 @@ See COPYRIGHT and LICENSE files for more details.
method: :post
) do |form|
component_collection do |collection|
- collection.with_component(Primer::Alpha::Dialog::Body.new(
- aria: { label: I18n.t("my.access_token.new_access_token_dialog_title") }
- )) do
+ collection.with_component(
+ Primer::Alpha::Dialog::Body.new(
+ aria: { label: I18n.t("my.access_token.new_access_token_dialog_title") }
+ )
+ ) do
flex_layout(mb: 3) do |body|
body.with_row do
render(Primer::Alpha::Banner.new(scheme: :warning)) do
diff --git a/app/components/notifications/index_page_header_component.html.erb b/app/components/notifications/index_page_header_component.html.erb
index dfe0cf2782c..aa1c145fcc0 100644
--- a/app/components/notifications/index_page_header_component.html.erb
+++ b/app/components/notifications/index_page_header_component.html.erb
@@ -1,15 +1,17 @@
<%= render(Primer::OpenProject::PageHeader.new) do |header|
- header.with_title { page_title }
- header.with_breadcrumbs(breadcrumb_items, selected_item_font_weight: current_breadcrumb_element == page_title ? :bold : :normal)
+ header.with_title { page_title }
+ header.with_breadcrumbs(breadcrumb_items, selected_item_font_weight: current_breadcrumb_element == page_title ? :bold : :normal)
- header.with_action_button(tag: :a,
- mobile_icon: :gear,
- mobile_label: I18n.t(:label_setting_plural),
- href: my_notifications_path,
- size: :medium,
- target: "_blank",
- aria: { label: I18n.t("js.notifications.settings.title") }) do |button|
- button.with_leading_visual_icon(icon: :gear)
- I18n.t(:label_setting_plural)
- end
-end %>
+ header.with_action_button(
+ tag: :a,
+ mobile_icon: :gear,
+ mobile_label: I18n.t(:label_setting_plural),
+ href: my_notifications_path,
+ size: :medium,
+ target: "_blank",
+ aria: { label: I18n.t("js.notifications.settings.title") }
+ ) do |button|
+ button.with_leading_visual_icon(icon: :gear)
+ I18n.t(:label_setting_plural)
+ end
+ end %>
diff --git a/app/components/notifications/index_sub_header_component.html.erb b/app/components/notifications/index_sub_header_component.html.erb
index 3554007d2c7..a8aaf99094e 100644
--- a/app/components/notifications/index_sub_header_component.html.erb
+++ b/app/components/notifications/index_sub_header_component.html.erb
@@ -1,25 +1,31 @@
<%= render(Primer::OpenProject::SubHeader.new) do |subheader|
- subheader.with_filter_component do
- render(Primer::Alpha::SegmentedControl.new("aria-label": I18n.t(:label_filter_plural))) do |control|
- control.with_item(tag: :a,
- href: notifications_path(facet: nil, **current_filters),
- label: t("notifications.facets.unread"),
- title: t("notifications.facets.unread_title"),
- selected: @facet != "all")
- control.with_item(tag: :a,
- href: notifications_path(facet: "all", **current_filters),
- label: t("notifications.facets.all"),
- title: t("notifications.facets.all_title"),
- selected: @facet == "all")
- end
- end
+ subheader.with_filter_component do
+ render(Primer::Alpha::SegmentedControl.new("aria-label": I18n.t(:label_filter_plural))) do |control|
+ control.with_item(
+ tag: :a,
+ href: notifications_path(facet: nil, **current_filters),
+ label: t("notifications.facets.unread"),
+ title: t("notifications.facets.unread_title"),
+ selected: @facet != "all"
+ )
+ control.with_item(
+ tag: :a,
+ href: notifications_path(facet: "all", **current_filters),
+ label: t("notifications.facets.all"),
+ title: t("notifications.facets.all_title"),
+ selected: @facet == "all"
+ )
+ end
+ end
- subheader.with_action_button(tag: :a,
- href: mark_all_read_notifications_path(**current_filters),
- data: { method: :post },
- size: :medium,
- aria: { label: I18n.t("js.notifications.center.mark_all_read") }) do |button|
- button.with_leading_visual_icon(icon: :'op-read-all')
- I18n.t("js.notifications.center.mark_all_read")
- end
-end %>
+ subheader.with_action_button(
+ tag: :a,
+ href: mark_all_read_notifications_path(**current_filters),
+ data: { method: :post },
+ size: :medium,
+ aria: { label: I18n.t("js.notifications.center.mark_all_read") }
+ ) do |button|
+ button.with_leading_visual_icon(icon: :'op-read-all')
+ I18n.t("js.notifications.center.mark_all_read")
+ end
+ end %>
diff --git a/app/components/oauth/applications/application_row_component.html.erb b/app/components/oauth/applications/application_row_component.html.erb
index 0a7e9787336..318785556bd 100644
--- a/app/components/oauth/applications/application_row_component.html.erb
+++ b/app/components/oauth/applications/application_row_component.html.erb
@@ -29,14 +29,16 @@
# Actions
oauth_application_container.with_column do
- render(Primer::Alpha::ToggleSwitch.new(
- src: toggle_oauth_application_path(@application),
- csrf_token: form_authenticity_token,
- checked: @application.enabled?,
- data: {
- 'test-selector': "op-admin-oauth--application-enabled-toggle-switch"
- }
- ))
+ render(
+ Primer::Alpha::ToggleSwitch.new(
+ src: toggle_oauth_application_path(@application),
+ csrf_token: form_authenticity_token,
+ checked: @application.enabled?,
+ data: {
+ 'test-selector': "op-admin-oauth--application-enabled-toggle-switch"
+ }
+ )
+ )
end
end
end
diff --git a/app/components/oauth/applications/index_component.html.erb b/app/components/oauth/applications/index_component.html.erb
index e5f0d0b4bee..7e552d021cb 100644
--- a/app/components/oauth/applications/index_component.html.erb
+++ b/app/components/oauth/applications/index_component.html.erb
@@ -3,9 +3,13 @@
flex_layout do |index_container|
if OpenProject::FeatureDecisions.built_in_oauth_applications_active?
index_container.with_row do
- render(border_box_container(mb: 4, data: {
- 'test-selector': "op-admin-oauth--built-in-applications"
- })) do |component|
+ render(
+ border_box_container(
+ mb: 4, data: {
+ 'test-selector': "op-admin-oauth--built-in-applications"
+ }
+ )
+ ) do |component|
component.with_header(font_weight: :bold) do
render(Primer::Beta::Text.new) do
t("oauth.header.builtin_applications")
@@ -14,9 +18,13 @@
if @built_in_applications.empty?
component.with_row do
- render(Primer::Beta::Text.new(data: {
- 'test-selector': "op-admin-oauth--built-in-applications-placeholder"
- })) do
+ render(
+ Primer::Beta::Text.new(
+ data: {
+ 'test-selector': "op-admin-oauth--built-in-applications-placeholder"
+ }
+ )
+ ) do
t("oauth.empty_application_lists")
end
end
diff --git a/app/components/oauth/show_page_header_component.html.erb b/app/components/oauth/show_page_header_component.html.erb
index 8bb3d06627e..af35583704b 100644
--- a/app/components/oauth/show_page_header_component.html.erb
+++ b/app/components/oauth/show_page_header_component.html.erb
@@ -33,29 +33,33 @@ See COPYRIGHT and LICENSE files for more details.
header.with_breadcrumbs(breadcrumb_items)
unless @application.builtin?
- header.with_action_button(tag: :a,
- mobile_icon: :pencil,
- mobile_label: t(:button_edit),
- size: :medium,
- href: edit_oauth_application_path(@application),
- aria: { label: I18n.t(:button_edit) },
- title: I18n.t(:button_edit)) do |button|
+ header.with_action_button(
+ tag: :a,
+ mobile_icon: :pencil,
+ mobile_label: t(:button_edit),
+ size: :medium,
+ href: edit_oauth_application_path(@application),
+ aria: { label: I18n.t(:button_edit) },
+ title: I18n.t(:button_edit)
+ ) do |button|
button.with_leading_visual_icon(icon: :pencil)
t(:button_edit)
end
- header.with_action_button(tag: :a,
- scheme: :danger,
- mobile_icon: :trash,
- mobile_label: t(:button_delete),
- size: :medium,
- href: oauth_application_path(@application),
- aria: { label: I18n.t(:button_delete) },
- data: {
- confirm: I18n.t(:text_are_you_sure),
- method: :delete
- },
- title: I18n.t(:button_delete)) do |button|
+ header.with_action_button(
+ tag: :a,
+ scheme: :danger,
+ mobile_icon: :trash,
+ mobile_label: t(:button_delete),
+ size: :medium,
+ href: oauth_application_path(@application),
+ aria: { label: I18n.t(:button_delete) },
+ data: {
+ confirm: I18n.t(:text_are_you_sure),
+ method: :delete
+ },
+ title: I18n.t(:button_delete)
+ ) do |button|
button.with_leading_visual_icon(icon: :trash)
t(:button_delete)
end
diff --git a/app/components/op_primer/border_box_table_component.html.erb b/app/components/op_primer/border_box_table_component.html.erb
index a026da0f9aa..48c570ce96b 100644
--- a/app/components/op_primer/border_box_table_component.html.erb
+++ b/app/components/op_primer/border_box_table_component.html.erb
@@ -32,20 +32,33 @@ See COPYRIGHT and LICENSE files for more details.
border_box_container(
classes: container_class,
test_selector:,
- )) do |component|
+ )
+ ) do |component|
component.with_header(classes: grid_class, color: :muted) do
headers.each do |name, args|
- concat render(Primer::Beta::Text.new(classes: header_classes(name),
- font_weight: :semibold,
- **header_args(name))) { args[:caption] }
+ concat render(
+ Primer::Beta::Text.new(
+ classes: header_classes(name),
+ font_weight: :semibold,
+ **header_args(name)
+ )
+ ) { args[:caption] }
end
- concat render(Primer::Beta::Text.new(classes: "op-border-box-grid--mobile-heading",
- font_weight: :semibold)) { mobile_title }
+ concat render(
+ Primer::Beta::Text.new(
+ classes: "op-border-box-grid--mobile-heading",
+ font_weight: :semibold
+ )
+ ) { mobile_title }
if has_actions?
- concat render(Primer::BaseComponent.new(classes: heading_class,
- tag: :div))
+ concat render(
+ Primer::BaseComponent.new(
+ classes: heading_class,
+ tag: :div
+ )
+ )
end
end
diff --git a/app/components/op_primer/copy_to_clipboard_component.html.erb b/app/components/op_primer/copy_to_clipboard_component.html.erb
index 0546b100c46..aaaf86694d9 100644
--- a/app/components/op_primer/copy_to_clipboard_component.html.erb
+++ b/app/components/op_primer/copy_to_clipboard_component.html.erb
@@ -2,12 +2,14 @@
flex_layout(align_items: :center, **@system_arguments) do |flex|
if @scheme == :link
flex.with_column(classes: "ellipsis") do
- render(Primer::Beta::Link.new(
- id: @id,
- href: value,
- title: value,
- target: :_blank
- )) { value }
+ render(
+ Primer::Beta::Link.new(
+ id: @id,
+ href: value,
+ title: value,
+ target: :_blank
+ )
+ ) { value }
end
else
flex.with_column(classes: "ellipsis") do
diff --git a/app/components/op_primer/expandable_list_component.html.erb b/app/components/op_primer/expandable_list_component.html.erb
index 0b4cdf1a672..6a16288c97a 100644
--- a/app/components/op_primer/expandable_list_component.html.erb
+++ b/app/components/op_primer/expandable_list_component.html.erb
@@ -19,19 +19,23 @@
hidden_user_list.with_row(mt: 1) { item.to_s }
end
hidden_user_list.with_row(mt: 2) do
- render(Primer::Beta::Button.new(
- scheme: :link,
- data: { action: "expandable-list#hideElements" }
- )) { I18n.t("label_show_less") }
+ render(
+ Primer::Beta::Button.new(
+ scheme: :link,
+ data: { action: "expandable-list#hideElements" }
+ )
+ ) { I18n.t("label_show_less") }
end
end
end
list.with_row(mt: 2) do
- render(Primer::Beta::Button.new(
- scheme: :link,
- data: { "expandable-list-target": "showButton",
- action: "expandable-list#showElements" }
- )) { I18n.t("label_show_more") }
+ render(
+ Primer::Beta::Button.new(
+ scheme: :link,
+ data: { "expandable-list-target": "showButton",
+ action: "expandable-list#showElements" }
+ )
+ ) { I18n.t("label_show_more") }
end
end
end
diff --git a/app/components/op_primer/flash_component.html.erb b/app/components/op_primer/flash_component.html.erb
index 2f2cb190f3a..00ee247d651 100644
--- a/app/components/op_primer/flash_component.html.erb
+++ b/app/components/op_primer/flash_component.html.erb
@@ -28,15 +28,17 @@ See COPYRIGHT and LICENSE files for more details.
++#%>
<%=
- render(Primer::BaseComponent.new(
- tag: :div,
- classes: "op-primer-flash--item",
- data: {
- "flash-target": "item",
- "autohide": @autohide,
- unique_key: @unique_key
- }.compact
- )) do
+ render(
+ Primer::BaseComponent.new(
+ tag: :div,
+ classes: "op-primer-flash--item",
+ data: {
+ "flash-target": "item",
+ "autohide": @autohide,
+ unique_key: @unique_key
+ }.compact
+ )
+ ) do
render_parent
end
%>
diff --git a/app/components/open_project/common/attribute_component.html.erb b/app/components/open_project/common/attribute_component.html.erb
index 5e76a295f59..6c49452377a 100644
--- a/app/components/open_project/common/attribute_component.html.erb
+++ b/app/components/open_project/common/attribute_component.html.erb
@@ -5,40 +5,51 @@
class="op-long-text-attribute">
<%= render(
- Primer::Beta::Text.new(tag: :div,
- classes: ["op-long-text-attribute--text", PARAGRAPH_CSS_CLASS],
- color: text_color,
- style: "max-height: #{max_height};",
- data: {
- 'attribute-target': "descriptionText"
- })) { short_text } %>
+ Primer::Beta::Text.new(
+ tag: :div,
+ classes: ["op-long-text-attribute--text", PARAGRAPH_CSS_CLASS],
+ color: text_color,
+ style: "max-height: #{max_height};",
+ data: {
+ 'attribute-target': "descriptionText"
+ }
+ )
+ ) { short_text } %>
<%= render(
- Primer::Beta::Text.new(tag: :div,
- display: display_expand_button_value,
- classes: "op-long-text-attribute--text-hider",
- data: { 'attribute-target': "textHider" })) %>
+ Primer::Beta::Text.new(
+ tag: :div,
+ display: display_expand_button_value,
+ classes: "op-long-text-attribute--text-hider",
+ data: { 'attribute-target': "textHider" }
+ )
+ ) %>
<%= render(
- Primer::Alpha::HiddenTextExpander.new(inline: false,
- "aria-label": I18n.t("label_attribute_expand_text", attribute: name),
- display: display_expand_button_value,
- data: {
- 'attribute-target': "expandButton",
- 'test-selector': "expand-button"
- },
- button_arguments: { 'data-show-dialog-id': id },
- classes: "op-long-text-attribute--text-expander"
- )) %>
+ Primer::Alpha::HiddenTextExpander.new(
+ inline: false,
+ "aria-label": I18n.t("label_attribute_expand_text", attribute: name),
+ display: display_expand_button_value,
+ data: {
+ 'attribute-target': "expandButton",
+ 'test-selector': "expand-button"
+ },
+ button_arguments: { 'data-show-dialog-id': id },
+ classes: "op-long-text-attribute--text-expander"
+ )
+ ) %>
<%= render(
- Primer::Alpha::Dialog.new(id: id,
- data: {
- 'test-selector': "attribute-dialog"
- },
- title: name,
- size: :large)) do |component|
- component.with_body { full_text }
- component.with_header(variant: :large)
- end %>
+ Primer::Alpha::Dialog.new(
+ id: id,
+ data: {
+ 'test-selector': "attribute-dialog"
+ },
+ title: name,
+ size: :large
+ )
+ ) do |component|
+ component.with_body { full_text }
+ component.with_header(variant: :large)
+ end %>
diff --git a/app/components/open_project/common/submenu_component.html.erb b/app/components/open_project/common/submenu_component.html.erb
index 50cf60b59ba..bdbffbe7b01 100644
--- a/app/components/open_project/common/submenu_component.html.erb
+++ b/app/components/open_project/common/submenu_component.html.erb
@@ -1,26 +1,30 @@
diff --git a/app/components/placeholder_users/edit_page_header_component.html.erb b/app/components/placeholder_users/edit_page_header_component.html.erb
index 71e44dd5e5a..d69189005cb 100644
--- a/app/components/placeholder_users/edit_page_header_component.html.erb
+++ b/app/components/placeholder_users/edit_page_header_component.html.erb
@@ -33,27 +33,31 @@ See COPYRIGHT and LICENSE files for more details.
header.with_breadcrumbs(breadcrumb_items)
unless new_record?
- header.with_action_button(tag: :a,
- mobile_icon: :person,
- mobile_label: t(:label_profile),
- size: :medium,
- href: placeholder_user_path(@placeholder_user),
- aria: { label: I18n.t(:label_profile) },
- title: I18n.t(:label_profile)) do |button|
+ header.with_action_button(
+ tag: :a,
+ mobile_icon: :person,
+ mobile_label: t(:label_profile),
+ size: :medium,
+ href: placeholder_user_path(@placeholder_user),
+ aria: { label: I18n.t(:label_profile) },
+ title: I18n.t(:label_profile)
+ ) do |button|
button.with_leading_visual_icon(icon: :person)
t(:label_profile)
end
- header.with_action_button(tag: :a,
- scheme: :danger,
- mobile_icon: :trash,
- mobile_label: t(:button_delete),
- size: :medium,
- disabled: !deletable?,
- href: delete_button_href,
- aria: { label: I18n.t(:button_delete) },
- data: { "test-selector": "placeholder-user--delete-button" },
- title: delete_button_title) do |button|
+ header.with_action_button(
+ tag: :a,
+ scheme: :danger,
+ mobile_icon: :trash,
+ mobile_label: t(:button_delete),
+ size: :medium,
+ disabled: !deletable?,
+ href: delete_button_href,
+ aria: { label: I18n.t(:button_delete) },
+ data: { "test-selector": "placeholder-user--delete-button" },
+ title: delete_button_title
+ ) do |button|
button.with_leading_visual_icon(icon: :trash)
t(:button_delete)
end
diff --git a/app/components/placeholder_users/show_page_header_component.html.erb b/app/components/placeholder_users/show_page_header_component.html.erb
index 2541493523e..80afe8f33a9 100644
--- a/app/components/placeholder_users/show_page_header_component.html.erb
+++ b/app/components/placeholder_users/show_page_header_component.html.erb
@@ -32,29 +32,33 @@ See COPYRIGHT and LICENSE files for more details.
header.with_breadcrumbs(breadcrumb_items)
if @current_user.allowed_globally?(:manage_placeholder_user)
- header.with_action_button(tag: :a,
- mobile_icon: :pencil,
- mobile_label: t(:button_edit),
- size: :medium,
- accesskey: accesskey(:edit),
- href: edit_placeholder_user_path(@placeholder_user),
- aria: { label: I18n.t(:button_edit) },
- title: I18n.t(:button_edit)) do |button|
+ header.with_action_button(
+ tag: :a,
+ mobile_icon: :pencil,
+ mobile_label: t(:button_edit),
+ size: :medium,
+ accesskey: accesskey(:edit),
+ href: edit_placeholder_user_path(@placeholder_user),
+ aria: { label: I18n.t(:button_edit) },
+ title: I18n.t(:button_edit)
+ ) do |button|
button.with_leading_visual_icon(icon: :pencil)
t(:button_edit)
end
end
- header.with_action_button(tag: :a,
- scheme: :danger,
- mobile_icon: :trash,
- mobile_label: t(:button_delete),
- size: :medium,
- disabled: !deletable?,
- href: delete_button_href,
- aria: { label: I18n.t(:button_delete) },
- data: { "test-selector": "placeholder-user--delete-button" },
- title: delete_button_title) do |button|
+ header.with_action_button(
+ tag: :a,
+ scheme: :danger,
+ mobile_icon: :trash,
+ mobile_label: t(:button_delete),
+ size: :medium,
+ disabled: !deletable?,
+ href: delete_button_href,
+ aria: { label: I18n.t(:button_delete) },
+ data: { "test-selector": "placeholder-user--delete-button" },
+ title: delete_button_title
+ ) do |button|
button.with_leading_visual_icon(icon: :trash)
t(:button_delete)
end
diff --git a/app/components/projects/configure_view_modal_component.html.erb b/app/components/projects/configure_view_modal_component.html.erb
index d19d4001cbb..38dc3d32a5d 100644
--- a/app/components/projects/configure_view_modal_component.html.erb
+++ b/app/components/projects/configure_view_modal_component.html.erb
@@ -1,10 +1,14 @@
-<%= render(Primer::Alpha::Dialog.new(title: t(:'queries.configure_view.heading'),
- size: :large,
- id: MODAL_ID,
- # Hack to give the draggable autcompleter (ng-select) bound to the dialog
- # enough height to display all options.
- # This is necessary as long as ng-select does not support popovers.
- style: "min-height: 480px")) do |d| %>
+<%= render(
+ Primer::Alpha::Dialog.new(
+ title: t(:'queries.configure_view.heading'),
+ size: :large,
+ id: MODAL_ID,
+ # Hack to give the draggable autcompleter (ng-select) bound to the dialog
+ # enough height to display all options.
+ # This is necessary as long as ng-select does not support popovers.
+ style: "min-height: 480px"
+ )
+ ) do |d| %>
<% d.with_header(variant: :large) %>
<%= render(Primer::Alpha::Dialog::Body.new) do %>
<%= primer_form_with(
@@ -14,26 +18,26 @@
method: :get
) do |form| %>
<% helpers.projects_query_params.except(:columns, :sortBy).each do |name, value| %>
- <%= hidden_field_tag name, value, data: {"sort-by-config-target" => name} %>
+ <%= hidden_field_tag name, value, data: { "sort-by-config-target" => name } %>
<% end %>
<%= render(Primer::Alpha::TabPanels.new(label: "label")) do |tab_panel| %>
<% tab_panel.with_tab(selected: true, id: "tab-selects--columns") do |tab| %>
<% tab.with_text { I18n.t("label_columns") } %>
<% tab.with_panel do %>
<%= helpers.angular_component_tag "opce-draggable-autocompleter",
- inputs: {
- options: helpers.projects_columns_options,
- selected: selected_columns,
- protected: helpers.protected_projects_columns_options,
- name: COLUMN_HTML_NAME,
- id: COLUMN_HTML_ID,
- dragAreaName: "#{COLUMN_HTML_ID}_dragarea",
- formControlId: "#{COLUMN_HTML_ID}_autocompleter",
- inputLabel: I18n.t(:'queries.configure_view.columns.input_label'),
- inputPlaceholder: I18n.t(:'queries.configure_view.columns.input_placeholder'),
- dragAreaLabel: I18n.t(:'queries.configure_view.columns.drag_area_label'),
- appendToComponent: true
- } %>
+ inputs: {
+ options: helpers.projects_columns_options,
+ selected: selected_columns,
+ protected: helpers.protected_projects_columns_options,
+ name: COLUMN_HTML_NAME,
+ id: COLUMN_HTML_ID,
+ dragAreaName: "#{COLUMN_HTML_ID}_dragarea",
+ formControlId: "#{COLUMN_HTML_ID}_autocompleter",
+ inputLabel: I18n.t(:'queries.configure_view.columns.input_label'),
+ inputPlaceholder: I18n.t(:'queries.configure_view.columns.input_placeholder'),
+ dragAreaLabel: I18n.t(:'queries.configure_view.columns.drag_area_label'),
+ appendToComponent: true
+ } %>
<% end %>
<% end %>
<% tab_panel.with_tab(id: "tab-selects--sorting") do |tab| %>
@@ -47,9 +51,13 @@
<% end %>
<%= render(Primer::Alpha::Dialog::Footer.new) do %>
<%= render(Primer::ButtonComponent.new(data: { "close-dialog-id": MODAL_ID })) { I18n.t(:button_cancel) } %>
- <%= render(Primer::ButtonComponent.new(scheme: :primary,
- type: :submit,
- data: { "test-selector": "#{MODAL_ID}-submit"},
- form: QUERY_FORM_ID)) { I18n.t(:button_apply) } %>
+ <%= render(
+ Primer::ButtonComponent.new(
+ scheme: :primary,
+ type: :submit,
+ data: { "test-selector": "#{MODAL_ID}-submit" },
+ form: QUERY_FORM_ID
+ )
+ ) { I18n.t(:button_apply) } %>
<% end %>
<% end %>
diff --git a/app/components/projects/delete_list_modal_component.html.erb b/app/components/projects/delete_list_modal_component.html.erb
index 3d850d1f68f..86cea6a7ef8 100644
--- a/app/components/projects/delete_list_modal_component.html.erb
+++ b/app/components/projects/delete_list_modal_component.html.erb
@@ -1,15 +1,25 @@
-<%= render(Primer::Alpha::Dialog.new(title: t(:'projects.lists.delete_modal.title'),
- size: :large,
- id: MODAL_ID,
- data: { 'test-selector': MODAL_ID })) do |d| %>
+<%= render(
+ Primer::Alpha::Dialog.new(
+ title: t(:'projects.lists.delete_modal.title'),
+ size: :large,
+ id: MODAL_ID,
+ data: { 'test-selector': MODAL_ID }
+ )
+ ) do |d| %>
<% d.with_header(variant: :large) %>
<% d.with_body { t(:'projects.lists.delete_modal.text') } %>
<% d.with_footer do %>
<%= render(Primer::Beta::Button.new(data: { "close-dialog-id": MODAL_ID })) { I18n.t(:button_cancel) } %>
- <%= form_with(url: project_query_path(query),
- method: :delete) do %>
- <%= render(Primer::Beta::Button.new(scheme: :danger,
- type: :submit)) { I18n.t(:button_delete) } %>
+ <%= form_with(
+ url: project_query_path(query),
+ method: :delete
+ ) do %>
+ <%= render(
+ Primer::Beta::Button.new(
+ scheme: :danger,
+ type: :submit
+ )
+ ) { I18n.t(:button_delete) } %>
<% end %>
<% end %>
<% end %>
diff --git a/app/components/projects/disk_usage_information_component.html.erb b/app/components/projects/disk_usage_information_component.html.erb
index 0e8f6bc9dbd..81f0d716067 100644
--- a/app/components/projects/disk_usage_information_component.html.erb
+++ b/app/components/projects/disk_usage_information_component.html.erb
@@ -1,6 +1,8 @@
<%= helpers.op_icon("icon-info1") %>
- <%= t(:label_projects_disk_usage_information,
+ <%= t(
+ :label_projects_disk_usage_information,
count: Project.count,
- used_disk_space: number_to_human_size(Project.total_projects_size, precision: 2)) %>
+ used_disk_space: number_to_human_size(Project.total_projects_size, precision: 2)
+ ) %>
diff --git a/app/components/projects/export_list_modal_component.html.erb b/app/components/projects/export_list_modal_component.html.erb
index 5a6b837ad85..edc5ddc0761 100644
--- a/app/components/projects/export_list_modal_component.html.erb
+++ b/app/components/projects/export_list_modal_component.html.erb
@@ -1,5 +1,9 @@
-<%= render(Primer::Alpha::Dialog.new(title: t("js.label_export"),
- id: MODAL_ID)) do |d| %>
+<%= render(
+ Primer::Alpha::Dialog.new(
+ title: t("js.label_export"),
+ id: MODAL_ID
+ )
+ ) do |d| %>
<% d.with_header(variant: :large) %>
<% d.with_body do %>
diff --git a/app/components/projects/index_page_header_component.html.erb b/app/components/projects/index_page_header_component.html.erb
index bce2a3524fa..755a4ed2de0 100644
--- a/app/components/projects/index_page_header_component.html.erb
+++ b/app/components/projects/index_page_header_component.html.erb
@@ -2,15 +2,17 @@
<%=
render(Primer::OpenProject::PageHeader.new(state: @state)) do |header|
header.with_title(data: { 'test-selector': "project-query-name" }) do |title|
- title.with_editable_form(model: query,
- update_path: @query.new_record? ? project_queries_path(projects_query_params) : project_query_path(@query, projects_query_params),
- method: @query.new_record? ? :post : :put,
- cancel_path: projects_path(**projects_query_params, **{ query_id: query.id }.compact),
- input_name: "name",
- label: ProjectQuery.human_attribute_name(:name),
- placeholder: I18n.t(:"projects.lists.new.placeholder"),
- scope: "query",
- id: "project-save-form")
+ title.with_editable_form(
+ model: query,
+ update_path: @query.new_record? ? project_queries_path(projects_query_params) : project_query_path(@query, projects_query_params),
+ method: @query.new_record? ? :post : :put,
+ cancel_path: projects_path(**projects_query_params, **{ query_id: query.id }.compact),
+ input_name: "name",
+ label: ProjectQuery.human_attribute_name(:name),
+ placeholder: I18n.t(:"projects.lists.new.placeholder"),
+ scope: "query",
+ id: "project-save-form"
+ )
page_title
end
header.with_breadcrumbs(breadcrumb_items, selected_item_font_weight: current_breadcrumb_element == page_title ? :bold : :normal)
@@ -136,7 +138,7 @@
tag: :a,
label: t(:'queries.configure_view.heading'),
href: configure_view_modal_project_queries_path(projects_query_params),
- content_arguments: { data: { controller: "async-dialog" }}
+ content_arguments: { data: { controller: "async-dialog" } }
) do |item|
item.with_leading_visual_icon(icon: :gear)
end
@@ -147,7 +149,7 @@
label: t(:button_delete),
scheme: :danger,
href: destroy_confirmation_modal_project_query_path(query.id),
- content_arguments: { data: { controller: "async-dialog" }}
+ content_arguments: { data: { controller: "async-dialog" } }
) do |item|
item.with_leading_visual_icon(icon: "trash")
end
@@ -155,8 +157,7 @@
menu.with_item(
tag: :button,
label: t("label_zen_mode"),
- content_arguments: { data: { controller: "projects-zen-mode", target: "projects-zen-mode.button", action: "click->projects-zen-mode#performAction" }
- }
+ content_arguments: { data: { controller: "projects-zen-mode", target: "projects-zen-mode.button", action: "click->projects-zen-mode#performAction" } }
) do |item|
item.with_leading_visual_icon(icon: "screen-full")
end
diff --git a/app/components/projects/index_sub_header_component.html.erb b/app/components/projects/index_sub_header_component.html.erb
index b2866d23d26..158ebd120df 100644
--- a/app/components/projects/index_sub_header_component.html.erb
+++ b/app/components/projects/index_sub_header_component.html.erb
@@ -1,33 +1,37 @@
<%= component_wrapper(tag: "turbo-frame") do %>
<%= render(Primer::OpenProject::SubHeader.new(data: sub_header_data_attributes)) do |subheader|
- subheader.with_filter_input(name: "name_and_identifier",
- label: t("projects.index.search.label"),
- value: filter_input_value,
- placeholder: t("projects.index.search.placeholder"),
- leading_visual: {
- icon: :search,
- size: :small
- },
- clear_button_id: clear_button_id,
- data: filter_input_data_attributes)
+ subheader.with_filter_input(
+ name: "name_and_identifier",
+ label: t("projects.index.search.label"),
+ value: filter_input_value,
+ placeholder: t("projects.index.search.placeholder"),
+ leading_visual: {
+ icon: :search,
+ size: :small
+ },
+ clear_button_id: clear_button_id,
+ data: filter_input_data_attributes
+ )
- subheader.with_filter_component do
- render(Projects::ProjectFilterButtonComponent.new(query: @query, disabled: @disable_buttons))
- end
+ subheader.with_filter_component do
+ render(Projects::ProjectFilterButtonComponent.new(query: @query, disabled: @disable_buttons))
+ end
- subheader.with_action_button(tag: :a,
- href: new_project_path,
- scheme: :primary,
- disabled: @disable_buttons,
- size: :medium,
- aria: { label: I18n.t(:label_project_new) },
- data: { 'test-selector': "project-new-button" }) do |button|
- button.with_leading_visual_icon(icon: :plus)
- Project.model_name.human
- end if @current_user.allowed_globally?(:add_project)
+ subheader.with_action_button(
+ tag: :a,
+ href: new_project_path,
+ scheme: :primary,
+ disabled: @disable_buttons,
+ size: :medium,
+ aria: { label: I18n.t(:label_project_new) },
+ data: { 'test-selector': "project-new-button" }
+ ) do |button|
+ button.with_leading_visual_icon(icon: :plus)
+ Project.model_name.human
+ end if @current_user.allowed_globally?(:add_project)
- subheader.with_bottom_pane_component(mt: 0) do
- render(Projects::ProjectsFiltersComponent.new(query: @query))
- end
- end %>
+ subheader.with_bottom_pane_component(mt: 0) do
+ render(Projects::ProjectsFiltersComponent.new(query: @query))
+ end
+ end %>
<% end %>
diff --git a/app/components/projects/life_cycle_type_component.html.erb b/app/components/projects/life_cycle_type_component.html.erb
index 921c1cf191a..3f9a0f06e6f 100644
--- a/app/components/projects/life_cycle_type_component.html.erb
+++ b/app/components/projects/life_cycle_type_component.html.erb
@@ -1,8 +1,8 @@
<%= flex_layout(align_items: :center) do |type_container|
- type_container.with_column(mr: 1, classes: icon_color_class) do
- render Primer::Beta::Octicon.new(icon: icon)
- end
- type_container.with_column do
- render(Primer::Beta::Text.new(**text_options)) { text }
- end
-end %>
+ type_container.with_column(mr: 1, classes: icon_color_class) do
+ render Primer::Beta::Octicon.new(icon: icon)
+ end
+ type_container.with_column do
+ render(Primer::Beta::Text.new(**text_options)) { text }
+ end
+ end %>
diff --git a/app/components/projects/settings/index_page_header_component.html.erb b/app/components/projects/settings/index_page_header_component.html.erb
index a81281c601b..c2b0d670b49 100644
--- a/app/components/projects/settings/index_page_header_component.html.erb
+++ b/app/components/projects/settings/index_page_header_component.html.erb
@@ -1,32 +1,38 @@
<%=
render Primer::OpenProject::PageHeader.new do |header|
header.with_title { t(:label_information_plural) }
- header.with_breadcrumbs( [
- { href: project_overview_path(@project.id), text: @project.name },
- { href: project_settings_general_path(@project.id), text: I18n.t("label_project_settings") },
- t(:label_information_plural)
- ])
+ header.with_breadcrumbs(
+ [
+ { href: project_overview_path(@project.id), text: @project.name },
+ { href: project_settings_general_path(@project.id), text: I18n.t("label_project_settings") },
+ t(:label_information_plural)
+ ]
+ )
if User.current.allowed_in_project?(:add_subprojects, @project)
- header.with_action_button(scheme: :primary,
- mobile_icon: :plus,
- mobile_label: t(:label_subproject_new),
- aria: { label: t(:label_subproject_new) },
- title: t(:label_subproject_new),
- tag: :a,
- href: new_project_path(parent_id: @project.id)) do |button|
+ header.with_action_button(
+ scheme: :primary,
+ mobile_icon: :plus,
+ mobile_label: t(:label_subproject_new),
+ aria: { label: t(:label_subproject_new) },
+ title: t(:label_subproject_new),
+ tag: :a,
+ href: new_project_path(parent_id: @project.id)
+ ) do |button|
button.with_leading_visual_icon(icon: :plus)
t(:label_subproject)
end
end
- header.with_action_button(tag: :a,
- mobile_icon: :pencil,
- mobile_label: t("projects.settings.change_identifier"),
- size: :medium,
- href: project_identifier_path(@project),
- aria: { label: t("projects.settings.change_identifier") },
- title: t("projects.settings.change_identifier")) do |button|
+ header.with_action_button(
+ tag: :a,
+ mobile_icon: :pencil,
+ mobile_label: t("projects.settings.change_identifier"),
+ size: :medium,
+ href: project_identifier_path(@project),
+ aria: { label: t("projects.settings.change_identifier") },
+ title: t("projects.settings.change_identifier")
+ ) do |button|
button.with_leading_visual_icon(icon: :pencil)
t("projects.settings.change_identifier")
end
@@ -43,14 +49,14 @@
) do |menu|
if @project.copy_allowed?
menu.with_item(
- label:t(:button_copy),
+ label: t(:button_copy),
href: copy_project_path(@project),
content_arguments: {
data: { turbo: false },
test_selector: "project-settings--copy"
},
accesskey: helpers.accesskey(:copy),
- ) do |item|
+ ) do |item|
item.with_leading_visual_icon(icon: :copy)
end
end
diff --git a/app/components/projects/settings/life_cycle_steps/index_component.html.erb b/app/components/projects/settings/life_cycle_steps/index_component.html.erb
index d214f0f91e1..d627d034020 100644
--- a/app/components/projects/settings/life_cycle_steps/index_component.html.erb
+++ b/app/components/projects/settings/life_cycle_steps/index_component.html.erb
@@ -2,20 +2,22 @@
flex_layout(data: wrapper_data_attributes) do |flex|
flex.with_row do
render(Primer::OpenProject::SubHeader.new) do |subheader|
- subheader.with_filter_input(name: "border-box-filter",
- label: t("projects.settings.life_cycle.filter.label"),
- visually_hide_label: true,
- placeholder: t("projects.settings.life_cycle.filter.label"),
- leading_visual: {
- icon: :search,
- size: :small
- },
- show_clear_button: true,
- clear_button_id: clear_button_id,
- data: {
- action: "input->projects--settings--border-box-filter#filterLists",
- "projects--settings--border-box-filter-target": "filter"
- })
+ subheader.with_filter_input(
+ name: "border-box-filter",
+ label: t("projects.settings.life_cycle.filter.label"),
+ visually_hide_label: true,
+ placeholder: t("projects.settings.life_cycle.filter.label"),
+ leading_visual: {
+ icon: :search,
+ size: :small
+ },
+ show_clear_button: true,
+ clear_button_id: clear_button_id,
+ data: {
+ action: "input->projects--settings--border-box-filter#filterLists",
+ "projects--settings--border-box-filter-target": "filter"
+ }
+ )
end
end
@@ -32,29 +34,33 @@
end
header_container.with_column(flex_layout: true, justify_content: :flex_end) do |actions_container|
actions_container.with_column(data: { 'projects--settings--border-box-filter-target': "hideWhenFiltering" }) do
- render(Primer::Beta::Button.new(
- tag: :a,
- href: enable_all_project_settings_life_cycle_steps_path(project_id: project),
- scheme: :invisible,
- font_weight: :bold,
- color: :subtle,
- 'aria-label': t("projects.settings.actions.label_enable_all"),
- data: { 'turbo-method': :post, test_selector: "enable-all-life-cycle-steps" }
- )) do |button|
+ render(
+ Primer::Beta::Button.new(
+ tag: :a,
+ href: enable_all_project_settings_life_cycle_steps_path(project_id: project),
+ scheme: :invisible,
+ font_weight: :bold,
+ color: :subtle,
+ 'aria-label': t("projects.settings.actions.label_enable_all"),
+ data: { 'turbo-method': :post, test_selector: "enable-all-life-cycle-steps" }
+ )
+ ) do |button|
button.with_leading_visual_icon(icon: "check-circle", color: :subtle)
t("projects.settings.actions.label_enable_all")
end
end
actions_container.with_column(data: { 'projects--settings--border-box-filter-target': "hideWhenFiltering" }) do
- render(Primer::Beta::Button.new(
- tag: :a,
- href: disable_all_project_settings_life_cycle_steps_path(project_id: project),
- scheme: :invisible,
- font_weight: :bold,
- color: :subtle,
- 'aria-label': t("projects.settings.actions.label_disable_all"),
- data: { 'turbo-method': :post, test_selector: "disable-all-life-cycle-steps" }
- )) do |button|
+ render(
+ Primer::Beta::Button.new(
+ tag: :a,
+ href: disable_all_project_settings_life_cycle_steps_path(project_id: project),
+ scheme: :invisible,
+ font_weight: :bold,
+ color: :subtle,
+ 'aria-label': t("projects.settings.actions.label_disable_all"),
+ data: { 'turbo-method': :post, test_selector: "disable-all-life-cycle-steps" }
+ )
+ ) do |button|
button.with_leading_visual_icon(icon: "x-circle", color: :subtle)
t("projects.settings.actions.label_disable_all")
end
@@ -68,8 +74,10 @@
end
else
life_cycle_definitions_and_step_active.each do |definition, active|
- component.with_row(data: { 'projects--settings--border-box-filter-target': "searchItem" },
- test_selector: "project-life-cycle-step-#{definition.id}") do
+ component.with_row(
+ data: { 'projects--settings--border-box-filter-target': "searchItem" },
+ test_selector: "project-life-cycle-step-#{definition.id}"
+ ) do
render(Projects::Settings::LifeCycleSteps::StepComponent.new(definition:, active?: active))
end
end
@@ -77,10 +85,12 @@
end
end
flex.with_row do
- render Primer::Beta::Text.new(display: :none,
- data: {
- "projects--settings--border-box-filter-target": "noResultsText",
- }) do
+ render Primer::Beta::Text.new(
+ display: :none,
+ data: {
+ "projects--settings--border-box-filter-target": "noResultsText",
+ }
+ ) do
I18n.t("js.autocompleter.notFoundText")
end
end
diff --git a/app/components/projects/settings/life_cycle_steps/index_page_header_component.html.erb b/app/components/projects/settings/life_cycle_steps/index_page_header_component.html.erb
index a52affb1790..bce464dcb65 100644
--- a/app/components/projects/settings/life_cycle_steps/index_page_header_component.html.erb
+++ b/app/components/projects/settings/life_cycle_steps/index_page_header_component.html.erb
@@ -2,9 +2,11 @@
render Primer::OpenProject::PageHeader.new do |header|
header.with_title { t("projects.settings.life_cycle.header.title") }
header.with_description do
- t("projects.settings.life_cycle.header.description_html",
+ t(
+ "projects.settings.life_cycle.header.description_html",
overview_url: project_path(project),
- admin_settings_url: admin_settings_project_life_cycle_step_definitions_path)
+ admin_settings_url: admin_settings_project_life_cycle_step_definitions_path
+ )
end
header.with_breadcrumbs(breadcrumb_items)
end
diff --git a/app/components/projects/settings/life_cycle_steps/step_component.html.erb b/app/components/projects/settings/life_cycle_steps/step_component.html.erb
index 9af49ae8f94..6cd3026c60a 100644
--- a/app/components/projects/settings/life_cycle_steps/step_component.html.erb
+++ b/app/components/projects/settings/life_cycle_steps/step_component.html.erb
@@ -1,6 +1,8 @@
<%=
- flex_layout(align_items: :center,
- justify_content: :space_between) do |step_container|
+ flex_layout(
+ align_items: :center,
+ justify_content: :space_between
+ ) do |step_container|
step_container.with_column(flex_layout: true, mr: 2, classes: "min-width-0") do |title_container|
title_container.with_column(pt: 1, mr: 3, classes: "ellipsis") do
render(Primer::Beta::Text.new(classes: "filter-target-visible-text")) { definition.name }
@@ -15,16 +17,18 @@
# small variant + status_label_position: :start leads to a small bounce while toggling
# behavior can be seen on primer's viewbook as well -> https://view-components-storybook.eastus.cloudapp.azure.com/view-components/lookbook/inspect/primer/alpha/toggle_switch/small
# quick fix: don't display loading indicator which is causing the bounce
- render(Primer::Alpha::ToggleSwitch.new(
- src: toggle_project_settings_life_cycle_step_path(id: definition.id),
- csrf_token: form_authenticity_token,
- data: { test_selector: "toggle-project-life-cycle-#{definition.id}" },
- aria: { label: toggle_aria_label },
- checked: active?,
- size: :small,
- status_label_position: :start,
- classes: "op-primer-adjustments__toggle-switch--hidden-loading-indicator",
- ))
+ render(
+ Primer::Alpha::ToggleSwitch.new(
+ src: toggle_project_settings_life_cycle_step_path(id: definition.id),
+ csrf_token: form_authenticity_token,
+ data: { test_selector: "toggle-project-life-cycle-#{definition.id}" },
+ aria: { label: toggle_aria_label },
+ checked: active?,
+ size: :small,
+ status_label_position: :start,
+ classes: "op-primer-adjustments__toggle-switch--hidden-loading-indicator",
+ )
+ )
end
end
%>
diff --git a/app/components/projects/settings/project_custom_field_sections/custom_field_row_component.html.erb b/app/components/projects/settings/project_custom_field_sections/custom_field_row_component.html.erb
index 05d2d13c579..c518982572b 100644
--- a/app/components/projects/settings/project_custom_field_sections/custom_field_row_component.html.erb
+++ b/app/components/projects/settings/project_custom_field_sections/custom_field_row_component.html.erb
@@ -1,15 +1,17 @@
<%=
component_wrapper do
- flex_layout(align_items: :center, justify_content: :space_between, classes: "op-project-custom-field", data: {
- test_selector: "project-custom-field-#{@project_custom_field.id}"
- }) do |custom_field_container|
+ flex_layout(
+ align_items: :center, justify_content: :space_between, classes: "op-project-custom-field", data: {
+ test_selector: "project-custom-field-#{@project_custom_field.id}"
+ }
+ ) do |custom_field_container|
custom_field_container.with_column(flex_layout: true) do |title_container|
title_container.with_column(pt: 1, mr: 2) do
render(Primer::Beta::Text.new(classes: "filter-target-visible-text")) do
@project_custom_field.name
end
end
- title_container.with_column(pt: 1, mr: 2, data: { test_selector: "custom-field-type" } ) do
+ title_container.with_column(pt: 1, mr: 2, data: { test_selector: "custom-field-type" }) do
render(Primer::Beta::Text.new(font_size: :small, color: :subtle)) do
@project_custom_field.field_format.capitalize
end
@@ -28,22 +30,24 @@
# small variant + status_label_position: :start leads to a small bounce while toggling
# behavior can be seen on primer's viewbook as well -> https://view-components-storybook.eastus.cloudapp.azure.com/view-components/lookbook/inspect/primer/alpha/toggle_switch/small
# quick fix: don't display loading indicator which is causing the bounce
- render(Primer::Alpha::ToggleSwitch.new(
- src: toggle_project_settings_project_custom_fields_path(
- project_custom_field_project_mapping: {
- project_id: @project.id,
- custom_field_id: @project_custom_field.id
- }
- ),
- csrf_token: form_authenticity_token,
- data: { 'turbo-method': :put, 'turbo-stream': true,
- test_selector: "toggle-project-custom-field-mapping-#{@project_custom_field.id}" },
- checked: active_in_project?,
- enabled: !@project_custom_field.required?, # required fields cannot be disabled
- size: :small,
- status_label_position: :start,
- classes: "op-primer-adjustments__toggle-switch--hidden-loading-indicator",
- ))
+ render(
+ Primer::Alpha::ToggleSwitch.new(
+ src: toggle_project_settings_project_custom_fields_path(
+ project_custom_field_project_mapping: {
+ project_id: @project.id,
+ custom_field_id: @project_custom_field.id
+ }
+ ),
+ csrf_token: form_authenticity_token,
+ data: { 'turbo-method': :put, 'turbo-stream': true,
+ test_selector: "toggle-project-custom-field-mapping-#{@project_custom_field.id}" },
+ checked: active_in_project?,
+ enabled: !@project_custom_field.required?, # required fields cannot be disabled
+ size: :small,
+ status_label_position: :start,
+ classes: "op-primer-adjustments__toggle-switch--hidden-loading-indicator",
+ )
+ )
end
end
end
diff --git a/app/components/projects/settings/project_custom_field_sections/index_component.html.erb b/app/components/projects/settings/project_custom_field_sections/index_component.html.erb
index 69765f90a53..ef6c8033a65 100644
--- a/app/components/projects/settings/project_custom_field_sections/index_component.html.erb
+++ b/app/components/projects/settings/project_custom_field_sections/index_component.html.erb
@@ -3,29 +3,33 @@
flex_layout do |flex|
flex.with_row do
render(Primer::OpenProject::SubHeader.new) do |subheader|
- subheader.with_filter_input(name: "border-box-filter",
- label: t("projects.settings.project_custom_fields.filter.label"),
- visually_hide_label: true,
- placeholder: t("projects.settings.project_custom_fields.filter.label"),
- leading_visual: {
- icon: :search,
- size: :small
- },
- show_clear_button: true,
- clear_button_id: clear_button_id,
- data: {
- action: "input->projects--settings--border-box-filter#filterLists",
- "projects--settings--border-box-filter-target": "filter"
- })
+ subheader.with_filter_input(
+ name: "border-box-filter",
+ label: t("projects.settings.project_custom_fields.filter.label"),
+ visually_hide_label: true,
+ placeholder: t("projects.settings.project_custom_fields.filter.label"),
+ leading_visual: {
+ icon: :search,
+ size: :small
+ },
+ show_clear_button: true,
+ clear_button_id: clear_button_id,
+ data: {
+ action: "input->projects--settings--border-box-filter#filterLists",
+ "projects--settings--border-box-filter-target": "filter"
+ }
+ )
end
end
@project_custom_field_sections.each do |project_custom_field_section|
flex.with_row do
- render(Projects::Settings::ProjectCustomFieldSections::ShowComponent.new(
- project: @project,
- project_custom_field_section:
- ))
+ render(
+ Projects::Settings::ProjectCustomFieldSections::ShowComponent.new(
+ project: @project,
+ project_custom_field_section:
+ )
+ )
end
end
end
diff --git a/app/components/projects/settings/project_custom_field_sections/index_page_header_component.html.erb b/app/components/projects/settings/project_custom_field_sections/index_page_header_component.html.erb
index 7d7b7d1b5e5..8d21ab6761b 100644
--- a/app/components/projects/settings/project_custom_field_sections/index_page_header_component.html.erb
+++ b/app/components/projects/settings/project_custom_field_sections/index_page_header_component.html.erb
@@ -1,7 +1,11 @@
<%= render Primer::OpenProject::PageHeader.new do |header| %>
<%= header.with_title { t("projects.settings.project_custom_fields.header.title") } %>
- <%= header.with_description { t("projects.settings.project_custom_fields.header.description_html",
- overview_url: project_path(project),
- admin_settings_url: admin_settings_project_custom_fields_path) } %>
+ <%= header.with_description {
+ t(
+ "projects.settings.project_custom_fields.header.description_html",
+ overview_url: project_path(project),
+ admin_settings_url: admin_settings_project_custom_fields_path
+ )
+ } %>
<%= header.with_breadcrumbs(breadcrumb_items) %>
<% end %>
diff --git a/app/components/projects/settings/project_custom_field_sections/show_component.html.erb b/app/components/projects/settings/project_custom_field_sections/show_component.html.erb
index c9368c22581..32730ae8659 100644
--- a/app/components/projects/settings/project_custom_field_sections/show_component.html.erb
+++ b/app/components/projects/settings/project_custom_field_sections/show_component.html.erb
@@ -1,8 +1,12 @@
<%=
component_wrapper do
- render(border_box_container(mb: 3, classes: "op-project-custom-field-section", data: {
- test_selector: "project-custom-field-section-#{@project_custom_field_section.id}"
- })) do |component|
+ render(
+ border_box_container(
+ mb: 3, classes: "op-project-custom-field-section", data: {
+ test_selector: "project-custom-field-section-#{@project_custom_field_section.id}"
+ }
+ )
+ ) do |component|
component.with_header(font_weight: :bold, py: 2) do
flex_layout(justify_content: :space_between, align_items: :center) do |section_header_container|
section_header_container.with_column(py: 2) do |content_container|
@@ -14,39 +18,43 @@
end
section_header_container.with_column(flex_layout: true, justify_content: :flex_end) do |actions_container|
actions_container.with_column(data: { 'projects--settings--border-box-filter-target': "hideWhenFiltering" }) do
- render(Primer::Beta::Button.new(
- tag: :a,
- href: enable_all_of_section_project_settings_project_custom_fields_path(
- project_custom_field_project_mapping: {
- project_id: @project.id,
- custom_field_section_id: @project_custom_field_section.id
- }
- ),
- scheme: :invisible,
- font_weight: :bold,
- color: :subtle,
- 'aria-label': t("projects.settings.actions.label_enable_all"),
- data: { 'turbo-method': :put, 'turbo-stream': true, test_selector: "enable-all-project-custom-field-mappings-#{@project_custom_field_section.id}" }
- )) do |button|
+ render(
+ Primer::Beta::Button.new(
+ tag: :a,
+ href: enable_all_of_section_project_settings_project_custom_fields_path(
+ project_custom_field_project_mapping: {
+ project_id: @project.id,
+ custom_field_section_id: @project_custom_field_section.id
+ }
+ ),
+ scheme: :invisible,
+ font_weight: :bold,
+ color: :subtle,
+ 'aria-label': t("projects.settings.actions.label_enable_all"),
+ data: { 'turbo-method': :put, 'turbo-stream': true, test_selector: "enable-all-project-custom-field-mappings-#{@project_custom_field_section.id}" }
+ )
+ ) do |button|
button.with_leading_visual_icon(icon: "check-circle", color: :subtle)
t("projects.settings.actions.label_enable_all")
end
end
actions_container.with_column(data: { 'projects--settings--border-box-filter-target': "hideWhenFiltering" }) do
- render(Primer::Beta::Button.new(
- tag: :a,
- href: disable_all_of_section_project_settings_project_custom_fields_path(
- project_custom_field_project_mapping: {
- project_id: @project.id,
- custom_field_section_id: @project_custom_field_section.id
- }
- ),
- scheme: :invisible,
- font_weight: :bold,
- color: :subtle,
- 'aria-label': t("projects.settings.actions.label_disable_all"),
- data: { 'turbo-method': :put, 'turbo-stream': true, test_selector: "disable-all-project-custom-field-mappings-#{@project_custom_field_section.id}" }
- )) do |button|
+ render(
+ Primer::Beta::Button.new(
+ tag: :a,
+ href: disable_all_of_section_project_settings_project_custom_fields_path(
+ project_custom_field_project_mapping: {
+ project_id: @project.id,
+ custom_field_section_id: @project_custom_field_section.id
+ }
+ ),
+ scheme: :invisible,
+ font_weight: :bold,
+ color: :subtle,
+ 'aria-label': t("projects.settings.actions.label_disable_all"),
+ data: { 'turbo-method': :put, 'turbo-stream': true, test_selector: "disable-all-project-custom-field-mappings-#{@project_custom_field_section.id}" }
+ )
+ ) do |button|
button.with_leading_visual_icon(icon: "x-circle", color: :subtle)
t("projects.settings.actions.label_disable_all")
end
@@ -61,10 +69,12 @@
else
@project_custom_fields.each do |project_custom_field|
component.with_row(data: { 'projects--settings--border-box-filter-target': "searchItem" }) do
- render(Projects::Settings::ProjectCustomFieldSections::CustomFieldRowComponent.new(
- project: @project,
- project_custom_field:,
- ))
+ render(
+ Projects::Settings::ProjectCustomFieldSections::CustomFieldRowComponent.new(
+ project: @project,
+ project_custom_field:,
+ )
+ )
end
end
end
diff --git a/app/components/projects/table_component.html.erb b/app/components/projects/table_component.html.erb
index 0dd6c900d26..6c317c51d2c 100644
--- a/app/components/projects/table_component.html.erb
+++ b/app/components/projects/table_component.html.erb
@@ -46,11 +46,11 @@ See COPYRIGHT and LICENSE files for more details.
diff --git a/app/components/queries/sort_by_field_component.html.erb b/app/components/queries/sort_by_field_component.html.erb
index 76b128dcb39..543a4e70192 100644
--- a/app/components/queries/sort_by_field_component.html.erb
+++ b/app/components/queries/sort_by_field_component.html.erb
@@ -2,13 +2,13 @@
<% flex.with_column(flex: 1) do %>
<%#- We are just using the classes of the primer component here, because when using the primer component, we cannot detach the input element from the form %>
<%#- The form="none" adds the input to a nonexistant form (as we do not have one with the ID="none" and thus the fields to not get appended to the query string %>
- <%= select_tag "sort_field", select_options, prompt: "-", form: "none", class: "FormControl-select FormControl-medium FormControl--fullWidth", data: { action: "change->sort-by-config#fieldChanged"} %>
+ <%= select_tag "sort_field", select_options, prompt: "-", form: "none", class: "FormControl-select FormControl-medium FormControl--fullWidth", data: { action: "change->sort-by-config#fieldChanged" } %>
<% end %>
<% flex.with_column do %>
<%= render(Primer::Alpha::SegmentedControl.new("aria-label": "Sort order", hide_labels: true, ml: 3)) do |sort_buttons| %>
<%#- The segmented control actions need to be included here as well as they do the visual styling of the currently selected option, just setting our action would remove their action %>
- <% sort_buttons.with_item(icon: "sort-asc", label: "sort ascending", selected: order_asc?, data: { direction: "asc", action: "click:segmented-control#select click->sort-by-config#fieldChanged"}) %>
- <% sort_buttons.with_item(icon: "sort-desc", label: "sort descending", selected: order_desc?, data: { direction: "desc", action: "click:segmented-control#select click->sort-by-config#fieldChanged"}) %>
+ <% sort_buttons.with_item(icon: "sort-asc", label: "sort ascending", selected: order_asc?, data: { direction: "asc", action: "click:segmented-control#select click->sort-by-config#fieldChanged" }) %>
+ <% sort_buttons.with_item(icon: "sort-desc", label: "sort descending", selected: order_desc?, data: { direction: "desc", action: "click:segmented-control#select click->sort-by-config#fieldChanged" }) %>
<% end %>
<% end %>
<% end %>
diff --git a/app/components/settings/project_custom_field_sections/custom_field_row_component.html.erb b/app/components/settings/project_custom_field_sections/custom_field_row_component.html.erb
index 87798ccceb5..7df2939a3c2 100644
--- a/app/components/settings/project_custom_field_sections/custom_field_row_component.html.erb
+++ b/app/components/settings/project_custom_field_sections/custom_field_row_component.html.erb
@@ -6,12 +6,14 @@
render(Primer::OpenProject::DragHandle.new(classes: "handle"))
end
content_container.with_column(mr: 2) do
- render(Primer::Beta::Link.new(
- href: edit_admin_settings_project_custom_field_path(@project_custom_field),
- underline: false,
- font_weight: :bold,
- data: { turbo: "false" }
- )) do
+ render(
+ Primer::Beta::Link.new(
+ href: edit_admin_settings_project_custom_field_path(@project_custom_field),
+ underline: false,
+ font_weight: :bold,
+ data: { turbo: "false" }
+ )
+ ) do
@project_custom_field.name
end
end
@@ -22,8 +24,10 @@
end
content_container.with_column(mr: 2) do
render(Primer::Beta::Text.new(font_size: :small)) do
- t("project.count",
- count: @project_custom_field.project_custom_field_project_mappings.size)
+ t(
+ "project.count",
+ count: @project_custom_field.project_custom_field_project_mappings.size
+ )
end
end
if @project_custom_field.required?
diff --git a/app/components/settings/project_custom_field_sections/index_component.html.erb b/app/components/settings/project_custom_field_sections/index_component.html.erb
index 431ca3ebfe4..cce9946bcd5 100644
--- a/app/components/settings/project_custom_field_sections/index_component.html.erb
+++ b/app/components/settings/project_custom_field_sections/index_component.html.erb
@@ -1,7 +1,7 @@
<%=
component_wrapper(data: wrapper_data_attributes) do
if @project_custom_field_sections.any?
- flex_layout(classes: "dragula-container", data: { 'allowed-drop-type': "section" }.merge(drop_target_config) ) do |flex|
+ flex_layout(classes: "dragula-container", data: { 'allowed-drop-type': "section" }.merge(drop_target_config)) do |flex|
@project_custom_field_sections.each do |section|
flex.with_row(
data: draggable_item_config(section)
diff --git a/app/components/settings/project_custom_field_sections/show_component.html.erb b/app/components/settings/project_custom_field_sections/show_component.html.erb
index 9efa6131d1a..e4fcf6ee50d 100644
--- a/app/components/settings/project_custom_field_sections/show_component.html.erb
+++ b/app/components/settings/project_custom_field_sections/show_component.html.erb
@@ -27,10 +27,12 @@
end
end
actions_container.with_column do
- render(Primer::Alpha::Dialog.new(
- id: "project-custom-field-section-dialog#{@project_custom_field_section.id}", title: t("settings.project_attributes.label_new_section"),
- size: :medium_portrait
- )) do |dialog|
+ render(
+ Primer::Alpha::Dialog.new(
+ id: "project-custom-field-section-dialog#{@project_custom_field_section.id}", title: t("settings.project_attributes.label_new_section"),
+ size: :medium_portrait
+ )
+ ) do |dialog|
render(Settings::ProjectCustomFieldSections::DialogBodyFormComponent.new(project_custom_field_section: @project_custom_field_section))
end
end
@@ -44,17 +46,19 @@
render(Primer::Beta::Text.new(color: :subtle)) { t("settings.project_attributes.label_no_project_custom_fields") }
end
empty_list_container.with_column do
- render(Primer::Beta::Button.new(
+ render(
+ Primer::Beta::Button.new(
tag: :a,
href: new_admin_settings_project_custom_field_path(
type: "ProjectCustomField", custom_field_section_id: @project_custom_field_section.id
),
scheme: :secondary,
data: { turbo: "false", test_selector: "new-project-custom-field-button" }
- )) do |button|
- button.with_leading_visual_icon(icon: :plus)
- t("settings.project_attributes.label_new_attribute")
- end
+ )
+ ) do |button|
+ button.with_leading_visual_icon(icon: :plus)
+ t("settings.project_attributes.label_new_attribute")
+ end
end
end
end
diff --git a/app/components/settings/project_custom_fields/edit_form_header_component.html.erb b/app/components/settings/project_custom_fields/edit_form_header_component.html.erb
index 808f78a5267..a8b6ed3bf0a 100644
--- a/app/components/settings/project_custom_fields/edit_form_header_component.html.erb
+++ b/app/components/settings/project_custom_fields/edit_form_header_component.html.erb
@@ -34,7 +34,7 @@ See COPYRIGHT and LICENSE files for more details.
header.with_tab_nav(label: nil, test_selector: :project_attribute_detail_header) do |tab_nav|
tab_nav.with_tab(
selected: project_custom_field_edit_selected?,
- href: edit_admin_settings_project_custom_field_path(@custom_field)
+ href: edit_admin_settings_project_custom_field_path(@custom_field)
) do |tab|
tab.with_text { t(:label_details) }
end
diff --git a/app/components/settings/project_custom_fields/header_component.html.erb b/app/components/settings/project_custom_fields/header_component.html.erb
index f65b0bddae2..c9a75973229 100644
--- a/app/components/settings/project_custom_fields/header_component.html.erb
+++ b/app/components/settings/project_custom_fields/header_component.html.erb
@@ -21,16 +21,17 @@
end
end
- subheader.with_action_button(tag: :a,
- href: new_admin_settings_project_custom_field_path(type: "ProjectCustomField"),
- scheme: :primary,
- data: { turbo: "false", test_selector: "new-project-custom-field-button" },
- mobile_icon: :plus,
- mobile_label: t("settings.project_attributes.label_new_attribute")) do |button|
+ subheader.with_action_button(
+ tag: :a,
+ href: new_admin_settings_project_custom_field_path(type: "ProjectCustomField"),
+ scheme: :primary,
+ data: { turbo: "false", test_selector: "new-project-custom-field-button" },
+ mobile_icon: :plus,
+ mobile_label: t("settings.project_attributes.label_new_attribute")
+ ) do |button|
button.with_leading_visual_icon(icon: :plus)
t("settings.project_attributes.label_new_attribute")
end
-
end
%>
<% end %>
diff --git a/app/components/settings/project_life_cycle_step_definitions/form_header_component.html.erb b/app/components/settings/project_life_cycle_step_definitions/form_header_component.html.erb
index 4e2a4029b5d..5760eb16da6 100644
--- a/app/components/settings/project_life_cycle_step_definitions/form_header_component.html.erb
+++ b/app/components/settings/project_life_cycle_step_definitions/form_header_component.html.erb
@@ -28,7 +28,7 @@ See COPYRIGHT and LICENSE files for more details.
++#%>
<%= render Primer::OpenProject::PageHeader.new do |header|
- header.with_title { t("settings.project_life_cycle_step_definitions.#{heading_scope}.heading") }
- header.with_description { t("settings.project_life_cycle_step_definitions.new.description") }
- header.with_breadcrumbs(breadcrumbs_items)
-end %>
+ header.with_title { t("settings.project_life_cycle_step_definitions.#{heading_scope}.heading") }
+ header.with_description { t("settings.project_life_cycle_step_definitions.new.description") }
+ header.with_breadcrumbs(breadcrumbs_items)
+ end %>
diff --git a/app/components/settings/project_life_cycle_step_definitions/index_component.html.erb b/app/components/settings/project_life_cycle_step_definitions/index_component.html.erb
index 05f8a68de37..4c0da38678a 100644
--- a/app/components/settings/project_life_cycle_step_definitions/index_component.html.erb
+++ b/app/components/settings/project_life_cycle_step_definitions/index_component.html.erb
@@ -49,8 +49,10 @@ See COPYRIGHT and LICENSE files for more details.
}
)
subheader.with_action_component do
- render(Primer::Alpha::ActionMenu.new(
- anchor_align: :end)
+ render(
+ Primer::Alpha::ActionMenu.new(
+ anchor_align: :end
+ )
) do |menu|
menu.with_show_button(
scheme: :primary,
@@ -108,11 +110,13 @@ See COPYRIGHT and LICENSE files for more details.
**draggable_item_config(definition)
}
) do
- render(Settings::ProjectLifeCycleStepDefinitions::RowComponent.new(
- definition,
- first?: definition == definitions.first,
- last?: definition == definitions.last,
- ))
+ render(
+ Settings::ProjectLifeCycleStepDefinitions::RowComponent.new(
+ definition,
+ first?: definition == definitions.first,
+ last?: definition == definitions.last,
+ )
+ )
end
end
end
diff --git a/app/components/settings/project_life_cycle_step_definitions/row_component.html.erb b/app/components/settings/project_life_cycle_step_definitions/row_component.html.erb
index 645d282ed37..5a0698e192a 100644
--- a/app/components/settings/project_life_cycle_step_definitions/row_component.html.erb
+++ b/app/components/settings/project_life_cycle_step_definitions/row_component.html.erb
@@ -32,9 +32,11 @@ See COPYRIGHT and LICENSE files for more details.
row_container.with_column(flex_layout: true, classes: "gap-2 min-width-0") do |title_container|
if allowed_to_customize_life_cycle?
title_container.with_column do
- render(Primer::OpenProject::DragHandle.new(
- data: { "projects--settings--border-box-filter-target": "hideWhenFiltering" }
- ))
+ render(
+ Primer::OpenProject::DragHandle.new(
+ data: { "projects--settings--border-box-filter-target": "hideWhenFiltering" }
+ )
+ )
end
end
title_container.with_column(classes: "ellipsis", test_selector: "project-life-cycle-step-definition-name") do
diff --git a/app/components/shares/bulk_permission_button_component.html.erb b/app/components/shares/bulk_permission_button_component.html.erb
index 5c2dc77945e..89b9de2588f 100644
--- a/app/components/shares/bulk_permission_button_component.html.erb
+++ b/app/components/shares/bulk_permission_button_component.html.erb
@@ -1,27 +1,33 @@
<%=
- render(Primer::Alpha::ActionMenu.new(select_variant: :single,
- dynamic_label: true,
- anchor_align: :end,
- color: :subtle,
- data: { test_selector: "op-share-dialog-bulk-update-role"})) do |menu|
+ render(
+ Primer::Alpha::ActionMenu.new(
+ select_variant: :single,
+ dynamic_label: true,
+ anchor_align: :end,
+ color: :subtle,
+ data: { test_selector: "op-share-dialog-bulk-update-role" }
+ )
+ ) do |menu|
menu.with_show_button(scheme: :invisible, color: :subtle, data: { 'shares--bulk-selection-target': "bulkUpdateRoleLabel" }) do |button|
button.with_trailing_action_icon(icon: "triangle-down")
"Placeholder"
end
@available_roles.each do |role_hash|
- menu.with_item(label: role_hash[:label],
- href: update_path,
- method: :patch,
- active: false,
- form_arguments: {
- method: :patch,
- name: "role_ids[]",
- value: role_hash[:value],
- data: { 'shares--bulk-selection-target': "bulkForm bulkUpdateRoleForm",
- 'role-name': role_hash[:label],
- 'test-selector': "op-share-dialog-bulk-update-role-permission-#{role_hash[:label]}" }
- }) do |item|
+ menu.with_item(
+ label: role_hash[:label],
+ href: update_path,
+ method: :patch,
+ active: false,
+ form_arguments: {
+ method: :patch,
+ name: "role_ids[]",
+ value: role_hash[:value],
+ data: { 'shares--bulk-selection-target': "bulkForm bulkUpdateRoleForm",
+ 'role-name': role_hash[:label],
+ 'test-selector': "op-share-dialog-bulk-update-role-permission-#{role_hash[:label]}" }
+ }
+ ) do |item|
item.with_description.with_content(role_hash[:description])
end
end
diff --git a/app/components/shares/bulk_selection_counter_component.html.erb b/app/components/shares/bulk_selection_counter_component.html.erb
index 37e7bdfdf4c..bb2c778f1c0 100644
--- a/app/components/shares/bulk_selection_counter_component.html.erb
+++ b/app/components/shares/bulk_selection_counter_component.html.erb
@@ -1,11 +1,15 @@
<%
concat(
- render(Primer::Alpha::CheckBox.new(name: "toggle_all",
- value: nil,
- label: I18n.t("sharing.label_toggle_all"),
- visually_hide_label: true,
- data: { 'shares--bulk-selection-target': "toggleAll",
- action: "shares--bulk-selection#toggle" }))
+ render(
+ Primer::Alpha::CheckBox.new(
+ name: "toggle_all",
+ value: nil,
+ label: I18n.t("sharing.label_toggle_all"),
+ visually_hide_label: true,
+ data: { 'shares--bulk-selection-target': "toggleAll",
+ action: "shares--bulk-selection#toggle" }
+ )
+ )
)
concat(
diff --git a/app/components/shares/counter_component.html.erb b/app/components/shares/counter_component.html.erb
index 8b235ba950a..5077a72fb6e 100644
--- a/app/components/shares/counter_component.html.erb
+++ b/app/components/shares/counter_component.html.erb
@@ -1,5 +1,5 @@
<%=
- component_wrapper(data: { test_selector: "op-share-dialog-active-count"}) do
+ component_wrapper(data: { test_selector: "op-share-dialog-active-count" }) do
render(Primer::Box.new(display: :flex, aligns_items: :center)) do
# There's no point in rendering the BulkSelectionCounterComponent even if
# I'm able to manage shares if the only user that the work package is
diff --git a/app/components/shares/empty_state_component.html.erb b/app/components/shares/empty_state_component.html.erb
index 64e117e461b..a41d292058c 100644
--- a/app/components/shares/empty_state_component.html.erb
+++ b/app/components/shares/empty_state_component.html.erb
@@ -1,15 +1,15 @@
<%= render(Primer::Beta::Blankslate.new) do |component|
- component.with_visual_icon(icon: blankslate_config[:icon], size: :medium)
- component.with_heading(tag: :h2).with_content(
- blankslate_config[:heading_text],
- )
- component.with_description do
- flex_layout do |flex|
- flex.with_row(mb: 2) do
- render(Primer::Beta::Text.new(color: :subtle)) do
- blankslate_config[:description_text]
+ component.with_visual_icon(icon: blankslate_config[:icon], size: :medium)
+ component.with_heading(tag: :h2).with_content(
+ blankslate_config[:heading_text],
+ )
+ component.with_description do
+ flex_layout do |flex|
+ flex.with_row(mb: 2) do
+ render(Primer::Beta::Text.new(color: :subtle)) do
+ blankslate_config[:description_text]
+ end
+ end
end
end
- end
- end
-end %>
+ end %>
diff --git a/app/components/shares/permission_button_component.html.erb b/app/components/shares/permission_button_component.html.erb
index 60cc88a5626..88357a0406d 100644
--- a/app/components/shares/permission_button_component.html.erb
+++ b/app/components/shares/permission_button_component.html.erb
@@ -1,28 +1,36 @@
<%=
component_wrapper do
content_tag(:div, class: tooltip_wrapper_classes, data: { tooltip: tooltip_message }) do
- render(Primer::Alpha::ActionMenu.new(**{ select_variant: :single,
- size: :small,
- dynamic_label: true,
- anchor_align: :end,
- color: :subtle }.deep_merge(@system_arguments))) do |menu|
- menu.with_show_button(disabled: !editable?, data: { 'shares--bulk-selection-target': "userRowRole",
- 'share-id': share.id,
- 'active-role-name': permission_name(active_role.id)}) do |button|
+ render(
+ Primer::Alpha::ActionMenu.new(
+ **{ select_variant: :single,
+ size: :small,
+ dynamic_label: true,
+ anchor_align: :end,
+ color: :subtle }.deep_merge(@system_arguments)
+ )
+ ) do |menu|
+ menu.with_show_button(
+ disabled: !editable?, data: { 'shares--bulk-selection-target': "userRowRole",
+ 'share-id': share.id,
+ 'active-role-name': permission_name(active_role.id) }
+ ) do |button|
button.with_trailing_action_icon(icon: :"triangle-down")
permission_name(active_role.id)
end
strategy.available_roles.each do |role_hash|
- menu.with_item(label: role_hash[:label],
- href: update_path,
- method: :patch,
- active: role_active?(role_hash),
- data: { value: role_hash[:value] },
- form_arguments: {
- method: :patch,
- inputs: form_inputs(role_hash[:value])
- }) do |item|
+ menu.with_item(
+ label: role_hash[:label],
+ href: update_path,
+ method: :patch,
+ active: role_active?(role_hash),
+ data: { value: role_hash[:value] },
+ form_arguments: {
+ method: :patch,
+ inputs: form_inputs(role_hash[:value])
+ }
+ ) do |item|
item.with_description.with_content(role_hash[:description])
end
end
diff --git a/app/components/shares/project_queries/empty_state_component.html.erb b/app/components/shares/project_queries/empty_state_component.html.erb
index 64e117e461b..a41d292058c 100644
--- a/app/components/shares/project_queries/empty_state_component.html.erb
+++ b/app/components/shares/project_queries/empty_state_component.html.erb
@@ -1,15 +1,15 @@
<%= render(Primer::Beta::Blankslate.new) do |component|
- component.with_visual_icon(icon: blankslate_config[:icon], size: :medium)
- component.with_heading(tag: :h2).with_content(
- blankslate_config[:heading_text],
- )
- component.with_description do
- flex_layout do |flex|
- flex.with_row(mb: 2) do
- render(Primer::Beta::Text.new(color: :subtle)) do
- blankslate_config[:description_text]
+ component.with_visual_icon(icon: blankslate_config[:icon], size: :medium)
+ component.with_heading(tag: :h2).with_content(
+ blankslate_config[:heading_text],
+ )
+ component.with_description do
+ flex_layout do |flex|
+ flex.with_row(mb: 2) do
+ render(Primer::Beta::Text.new(color: :subtle)) do
+ blankslate_config[:description_text]
+ end
+ end
end
end
- end
- end
-end %>
+ end %>
diff --git a/app/components/shares/project_queries/public_flag_component.html.erb b/app/components/shares/project_queries/public_flag_component.html.erb
index 67b4925aa8b..5b952aea94b 100644
--- a/app/components/shares/project_queries/public_flag_component.html.erb
+++ b/app/components/shares/project_queries/public_flag_component.html.erb
@@ -1,20 +1,26 @@
<%=
container.with_row do
- render(Primer::Box.new(border: true,
- border_radius: BOX_BORDER_RADIUS,
- p: BOX_PADDING)) do
+ render(
+ Primer::Box.new(
+ border: true,
+ border_radius: BOX_BORDER_RADIUS,
+ p: BOX_PADDING
+ )
+ ) do
content_tag(:div, class: tooltip_wrapper_classes, data: { tooltip: tooltip_message }) do
- render(Primer::Forms::ToggleSwitchForm.new(
- name: "publish_project_query",
- label: t("sharing.project_queries.public_flag.label", instance_name: Setting.app_title),
- caption: t("sharing.project_queries.public_flag.caption"),
- src: toggle_public_flag_link,
- csrf_token: form_authenticity_token,
- status_label_position: :start,
- checked: published?,
- enabled: can_publish?,
- turbo: true
- ))
+ render(
+ Primer::Forms::ToggleSwitchForm.new(
+ name: "publish_project_query",
+ label: t("sharing.project_queries.public_flag.label", instance_name: Setting.app_title),
+ caption: t("sharing.project_queries.public_flag.caption"),
+ src: toggle_public_flag_link,
+ csrf_token: form_authenticity_token,
+ status_label_position: :start,
+ checked: published?,
+ enabled: can_publish?,
+ turbo: true
+ )
+ )
end
end
end
diff --git a/app/components/users/edit_page_header_component.html.erb b/app/components/users/edit_page_header_component.html.erb
index 3551bd5ecd9..092887dd6af 100644
--- a/app/components/users/edit_page_header_component.html.erb
+++ b/app/components/users/edit_page_header_component.html.erb
@@ -31,26 +31,30 @@ See COPYRIGHT and LICENSE files for more details.
header.with_title { @user.name }
header.with_breadcrumbs(breadcrumb_items)
- header.with_action_button(tag: :a,
- mobile_icon: :person,
- mobile_label: t(:label_profile),
- size: :medium,
- href: user_path(@user),
- aria: { label: I18n.t(:label_profile) },
- title: I18n.t(:label_profile)) do |button|
+ header.with_action_button(
+ tag: :a,
+ mobile_icon: :person,
+ mobile_label: t(:label_profile),
+ size: :medium,
+ href: user_path(@user),
+ aria: { label: I18n.t(:label_profile) },
+ title: I18n.t(:label_profile)
+ ) do |button|
button.with_leading_visual_icon(icon: :person)
t(:label_profile)
end
if @current_user.allowed_globally?(:create_user) && @current_user.id != @user.id
- header.with_action_button(tag: :a,
- mobile_icon: :mail,
- mobile_label: t(:label_send_invitation),
- size: :medium,
- href: resend_invitation_user_path(@user),
- data: { method: :post },
- aria: { label: I18n.t(:label_send_invitation) },
- title: I18n.t(:tooltip_resend_invitation)) do |button|
+ header.with_action_button(
+ tag: :a,
+ mobile_icon: :mail,
+ mobile_label: t(:label_send_invitation),
+ size: :medium,
+ href: resend_invitation_user_path(@user),
+ data: { method: :post },
+ aria: { label: I18n.t(:label_send_invitation) },
+ title: I18n.t(:tooltip_resend_invitation)
+ ) do |button|
button.with_leading_visual_icon(icon: :mail)
t(:label_send_invitation)
end
@@ -59,15 +63,17 @@ See COPYRIGHT and LICENSE files for more details.
if @current_user.admin?
unless @current_user.id == @user.id
iterate_user_statusses(@user) do |title, name|
- header.with_action_button(tag: :a,
- mobile_icon: change_user_status_icons[name],
- mobile_label: title,
- size: :medium,
- name: name,
- href: change_status_user_path(@user, { name => "" }),
- data: { method: :post },
- aria: { label: title },
- title: title) do |button|
+ header.with_action_button(
+ tag: :a,
+ mobile_icon: change_user_status_icons[name],
+ mobile_label: title,
+ size: :medium,
+ name: name,
+ href: change_status_user_path(@user, { name => "" }),
+ data: { method: :post },
+ aria: { label: title },
+ title: title
+ ) do |button|
button.with_leading_visual_icon(icon: change_user_status_icons[name])
title
end
@@ -75,14 +81,16 @@ See COPYRIGHT and LICENSE files for more details.
end
if Setting.users_deletable_by_admins?
- header.with_action_button(tag: :a,
- scheme: :danger,
- mobile_icon: :trash,
- mobile_label: t(:button_delete),
- size: :medium,
- href: deletion_info_user_path(@user),
- aria: { label: I18n.t(:button_delete) },
- title: I18n.t(:button_delete)) do |button|
+ header.with_action_button(
+ tag: :a,
+ scheme: :danger,
+ mobile_icon: :trash,
+ mobile_label: t(:button_delete),
+ size: :medium,
+ href: deletion_info_user_path(@user),
+ aria: { label: I18n.t(:button_delete) },
+ title: I18n.t(:button_delete)
+ ) do |button|
button.with_leading_visual_icon(icon: :trash)
t(:button_delete)
end
diff --git a/app/components/users/hover_card_component.html.erb b/app/components/users/hover_card_component.html.erb
index b143e607afd..3626eebb322 100644
--- a/app/components/users/hover_card_component.html.erb
+++ b/app/components/users/hover_card_component.html.erb
@@ -44,9 +44,13 @@ See COPYRIGHT and LICENSE files for more details.
if show_email?
f.with_column(classes: "op-user-hover-card--email") do
- render(Primer::Beta::Text.new(font_size: :small,
- color: :muted,
- data: { test_selector: "user-hover-card-email" })) do
+ render(
+ Primer::Beta::Text.new(
+ font_size: :small,
+ color: :muted,
+ data: { test_selector: "user-hover-card-email" }
+ )
+ ) do
@user.mail
end
end
@@ -69,9 +73,13 @@ See COPYRIGHT and LICENSE files for more details.
end
flex.with_row do
- render(Primer::Beta::Button.new(tag: :a,
- href: helpers.allowed_management_user_profile_path(@user),
- data: { test_selector: "user-hover-card-profile-btn" })) do
+ render(
+ Primer::Beta::Button.new(
+ tag: :a,
+ href: helpers.allowed_management_user_profile_path(@user),
+ data: { test_selector: "user-hover-card-profile-btn" }
+ )
+ ) do
I18n.t("users.open_profile")
end
end
diff --git a/app/components/users/index_page_header_component.html.erb b/app/components/users/index_page_header_component.html.erb
index fb2c24bb392..38b342e6082 100644
--- a/app/components/users/index_page_header_component.html.erb
+++ b/app/components/users/index_page_header_component.html.erb
@@ -6,10 +6,14 @@
%>
<%= t(:label_enterprise_active_users, current: OpenProject::Enterprise.active_user_count, limit: user_limit) %>
- <%= render(Primer::Beta::Button.new(scheme: :primary,
- size: :small,
- tag: :a,
- href: OpenProject::Enterprise.upgrade_path,
- title: t(:title_enterprise_upgrade))) { t(:button_upgrade) } %>
+ <%= render(
+ Primer::Beta::Button.new(
+ scheme: :primary,
+ size: :small,
+ tag: :a,
+ href: OpenProject::Enterprise.upgrade_path,
+ title: t(:title_enterprise_upgrade)
+ )
+ ) { t(:button_upgrade) } %>
<% end if user_limit %>
<% end %>
diff --git a/app/components/users/index_sub_header_component.html.erb b/app/components/users/index_sub_header_component.html.erb
index 55bbe495833..3a7548f9880 100644
--- a/app/components/users/index_sub_header_component.html.erb
+++ b/app/components/users/index_sub_header_component.html.erb
@@ -1,10 +1,12 @@
<%=
render(Primer::OpenProject::SubHeader.new) do |subheader|
- subheader.with_action_button(scheme: :primary,
- aria: { label: I18n.t(:label_user_new) },
- title: I18n.t(:label_user_new),
- tag: :a,
- href: new_user_path) do |button|
+ subheader.with_action_button(
+ scheme: :primary,
+ aria: { label: I18n.t(:label_user_new) },
+ title: I18n.t(:label_user_new),
+ tag: :a,
+ href: new_user_path
+ ) do |button|
button.with_leading_visual_icon(icon: :plus)
t("activerecord.models.user")
end
diff --git a/app/components/users/profile/attributes_component.html.erb b/app/components/users/profile/attributes_component.html.erb
index 2b96040f1a6..0b0c5144725 100644
--- a/app/components/users/profile/attributes_component.html.erb
+++ b/app/components/users/profile/attributes_component.html.erb
@@ -1,6 +1,6 @@
<%=
render(Primer::OpenProject::SidePanel::Section.new) do |section|
- section.with_title { t(:label_information) }
+ section.with_title { t(:label_information) }
component_wrapper do
flex_layout do |details_container|
diff --git a/app/components/users/show_page_header_component.html.erb b/app/components/users/show_page_header_component.html.erb
index 73a8d63c799..b71911afbd6 100644
--- a/app/components/users/show_page_header_component.html.erb
+++ b/app/components/users/show_page_header_component.html.erb
@@ -34,27 +34,31 @@ See COPYRIGHT and LICENSE files for more details.
header.with_breadcrumbs(breadcrumb_items)
if @current_user.allowed_globally?(:manage_user)
- header.with_action_button(tag: :a,
- mobile_icon: :pencil,
- mobile_label: t(:button_edit),
- size: :medium,
- href: edit_user_path(@user),
- aria: { label: I18n.t(:button_edit) },
- title: I18n.t(:button_edit)) do |button|
+ header.with_action_button(
+ tag: :a,
+ mobile_icon: :pencil,
+ mobile_label: t(:button_edit),
+ size: :medium,
+ href: edit_user_path(@user),
+ aria: { label: I18n.t(:button_edit) },
+ title: I18n.t(:button_edit)
+ ) do |button|
button.with_leading_visual_icon(icon: :pencil)
t(:button_edit)
end
end
if @current_user.allowed_globally?(:create_user) && @current_user != @user
- header.with_action_button(tag: :a,
- mobile_icon: :mail,
- mobile_label: t(:label_send_invitation),
- size: :medium,
- href: resend_invitation_user_path(@user),
- data: { method: :post },
- aria: { label: I18n.t(:label_send_invitation) },
- title: I18n.t(:tooltip_resend_invitation)) do |button|
+ header.with_action_button(
+ tag: :a,
+ mobile_icon: :mail,
+ mobile_label: t(:label_send_invitation),
+ size: :medium,
+ href: resend_invitation_user_path(@user),
+ data: { method: :post },
+ aria: { label: I18n.t(:label_send_invitation) },
+ title: I18n.t(:tooltip_resend_invitation)
+ ) do |button|
button.with_leading_visual_icon(icon: :mail)
t(:label_send_invitation)
end
diff --git a/app/components/work_package_relations_tab/add_work_package_child_dialog_component.html.erb b/app/components/work_package_relations_tab/add_work_package_child_dialog_component.html.erb
index 1aedf05ea03..0851442f363 100644
--- a/app/components/work_package_relations_tab/add_work_package_child_dialog_component.html.erb
+++ b/app/components/work_package_relations_tab/add_work_package_child_dialog_component.html.erb
@@ -1,27 +1,38 @@
<%=
- render(Primer::Alpha::Dialog.new(title: dialog_title,
- size: :large,
- id: DIALOG_ID)) do |d|
+ render(
+ Primer::Alpha::Dialog.new(
+ title: dialog_title,
+ size: :large,
+ id: DIALOG_ID
+ )
+ ) do |d|
d.with_header(variant: :large)
d.with_body(classes: body_classes) do
- render(WorkPackageRelationsTab::AddWorkPackageChildFormComponent.new(
- work_package: @work_package
- ))
+ render(
+ WorkPackageRelationsTab::AddWorkPackageChildFormComponent.new(
+ work_package: @work_package
+ )
+ )
end
d.with_footer do
component_collection do |buttons|
- buttons.with_component(Primer::ButtonComponent.new(
- data: {
- 'close-dialog-id': DIALOG_ID
- }
- )) do
+ buttons.with_component(
+ Primer::ButtonComponent.new(
+ data: {
+ 'close-dialog-id': DIALOG_ID
+ }
+ )
+ ) do
t("button_cancel")
end
- buttons.with_component(Primer::ButtonComponent.new(
- scheme: :primary,
- form: FORM_ID,
- data: { turbo: true },
- type: :submit)) do
+ buttons.with_component(
+ Primer::ButtonComponent.new(
+ scheme: :primary,
+ form: FORM_ID,
+ data: { turbo: true },
+ type: :submit
+ )
+ ) do
t("button_save")
end
end
diff --git a/app/components/work_package_relations_tab/index_component.html.erb b/app/components/work_package_relations_tab/index_component.html.erb
index a114b1be1ea..49350866222 100644
--- a/app/components/work_package_relations_tab/index_component.html.erb
+++ b/app/components/work_package_relations_tab/index_component.html.erb
@@ -10,8 +10,12 @@
# Prevent the menu from overflowing on Safari
action_bar.with_column(flex_shrink: 0, ml: 2) do
- render(Primer::Alpha::ActionMenu.new(test_selector: NEW_RELATION_ACTION_MENU,
- menu_id: NEW_RELATION_ACTION_MENU)) do |menu|
+ render(
+ Primer::Alpha::ActionMenu.new(
+ test_selector: NEW_RELATION_ACTION_MENU,
+ menu_id: NEW_RELATION_ACTION_MENU
+ )
+ ) do |menu|
menu.with_show_button do |button|
button.with_leading_visual_icon(icon: :"plus")
button.with_trailing_action_icon(icon: :"triangle-down")
@@ -61,11 +65,13 @@
items: all_relations
) do |relation, visibility|
# Render each relation with its visibility
- render(WorkPackageRelationsTab::RelationComponent.new(
- work_package: work_package,
- relation: relation,
- visibility: visibility
- ))
+ render(
+ WorkPackageRelationsTab::RelationComponent.new(
+ work_package: work_package,
+ relation: relation,
+ visibility: visibility
+ )
+ )
end
end
end
@@ -84,10 +90,14 @@
relation_type: :children,
items: all_children
) do |child, visibility|
- render(WorkPackageRelationsTab::RelationComponent.new(work_package:,
- relation: nil,
- child:,
- visibility: visibility))
+ render(
+ WorkPackageRelationsTab::RelationComponent.new(
+ work_package:,
+ relation: nil,
+ child:,
+ visibility: visibility
+ )
+ )
end
end
end
diff --git a/app/components/work_package_relations_tab/work_package_relation_dialog_component.html.erb b/app/components/work_package_relations_tab/work_package_relation_dialog_component.html.erb
index 7d436a98c10..772aae95f1d 100644
--- a/app/components/work_package_relations_tab/work_package_relation_dialog_component.html.erb
+++ b/app/components/work_package_relations_tab/work_package_relation_dialog_component.html.erb
@@ -1,26 +1,37 @@
<%=
- render(Primer::Alpha::Dialog.new(title: dialog_title,
- size: :large,
- id: DIALOG_ID)) do |d|
+ render(
+ Primer::Alpha::Dialog.new(
+ title: dialog_title,
+ size: :large,
+ id: DIALOG_ID
+ )
+ ) do |d|
d.with_header(variant: :large)
d.with_body(classes: body_classes) do
- render(WorkPackageRelationsTab::WorkPackageRelationFormComponent.new(
- work_package: @work_package,
- relation: @relation
- ))
+ render(
+ WorkPackageRelationsTab::WorkPackageRelationFormComponent.new(
+ work_package: @work_package,
+ relation: @relation
+ )
+ )
end
d.with_footer do
component_collection do |buttons|
- buttons.with_component(Primer::ButtonComponent.new(
- data: { 'close-dialog-id': DIALOG_ID }
- )) do
+ buttons.with_component(
+ Primer::ButtonComponent.new(
+ data: { 'close-dialog-id': DIALOG_ID }
+ )
+ ) do
t(:button_cancel)
end
- buttons.with_component(Primer::ButtonComponent.new(
- scheme: :primary,
- form: FORM_ID,
- data: { turbo: true },
- type: :submit)) do
+ buttons.with_component(
+ Primer::ButtonComponent.new(
+ scheme: :primary,
+ form: FORM_ID,
+ data: { turbo: true },
+ type: :submit
+ )
+ ) do
if @relation.id.present?
t(:button_save)
else
diff --git a/app/components/work_packages/activities_tab/journals/empty_component.html.erb b/app/components/work_packages/activities_tab/journals/empty_component.html.erb
index d15d3349b08..220d60d83f7 100644
--- a/app/components/work_packages/activities_tab/journals/empty_component.html.erb
+++ b/app/components/work_packages/activities_tab/journals/empty_component.html.erb
@@ -1,8 +1,11 @@
<%=
component_wrapper do
- render(Primer::Beta::Blankslate.new(
- border: true,
- data: { test_selector: "op-wp-journals-container-empty"})) do |component|
+ render(
+ Primer::Beta::Blankslate.new(
+ border: true,
+ data: { test_selector: "op-wp-journals-container-empty" }
+ )
+ ) do |component|
component.with_visual_icon(icon: :pulse)
component.with_heading(tag: :h2).with_content(t("activities.work_packages.activity_tab.no_results_title_text"))
component.with_description { t("activities.work_packages.activity_tab.no_results_description_text") }
diff --git a/app/components/work_packages/activities_tab/journals/filter_and_sorting_component.html.erb b/app/components/work_packages/activities_tab/journals/filter_and_sorting_component.html.erb
index 2ac07ec089a..02491a66aa0 100644
--- a/app/components/work_packages/activities_tab/journals/filter_and_sorting_component.html.erb
+++ b/app/components/work_packages/activities_tab/journals/filter_and_sorting_component.html.erb
@@ -1,12 +1,13 @@
<%=
component_wrapper do
-
flex_layout(justify_content: :space_between) do |container|
container.with_column do
- render(Primer::Alpha::ActionMenu.new(
- select_variant: :single, dynamic_label: true,
- data: { "test_selector": "op-wp-journals-filter-menu" }
- )) do |menu|
+ render(
+ Primer::Alpha::ActionMenu.new(
+ select_variant: :single, dynamic_label: true,
+ data: { "test_selector": "op-wp-journals-filter-menu" }
+ )
+ ) do |menu|
menu.with_show_button do |button|
button.with_trailing_action_icon(icon: :"triangle-down")
end
diff --git a/app/components/work_packages/activities_tab/journals/index_component.html.erb b/app/components/work_packages/activities_tab/journals/index_component.html.erb
index 9ef8ded4e52..90c0b8aec7a 100644
--- a/app/components/work_packages/activities_tab/journals/index_component.html.erb
+++ b/app/components/work_packages/activities_tab/journals/index_component.html.erb
@@ -6,8 +6,10 @@
classes: "work-packages-activities-tab-journals-index-component--journals-inner-container",
mb: inner_container_margin_bottom
) do
- flex_layout(id: insert_target_modifier_id,
- data: { test_selector: "op-wp-journals-container" }) do |journals_index_container|
+ flex_layout(
+ id: insert_target_modifier_id,
+ data: { test_selector: "op-wp-journals-container" }
+ ) do |journals_index_container|
if empty_state?
journals_index_container.with_row(mt: 2, mb: 3) do
render(
@@ -27,10 +29,12 @@
if record.is_a?(Changeset)
render(WorkPackages::ActivitiesTab::Journals::RevisionComponent.new(changeset: record, filter:))
else
- render(WorkPackages::ActivitiesTab::Journals::ItemComponent.new(
- journal: record, filter:,
- grouped_emoji_reactions: wp_journals_grouped_emoji_reactions[record.id]
- ))
+ render(
+ WorkPackages::ActivitiesTab::Journals::ItemComponent.new(
+ journal: record, filter:,
+ grouped_emoji_reactions: wp_journals_grouped_emoji_reactions[record.id]
+ )
+ )
end
end
end
@@ -57,10 +61,12 @@
if record.is_a?(Changeset)
render(WorkPackages::ActivitiesTab::Journals::RevisionComponent.new(changeset: record, filter:))
else
- render(WorkPackages::ActivitiesTab::Journals::ItemComponent.new(
- journal: record, filter:,
- grouped_emoji_reactions: wp_journals_grouped_emoji_reactions[record.id]
- ))
+ render(
+ WorkPackages::ActivitiesTab::Journals::ItemComponent.new(
+ journal: record, filter:,
+ grouped_emoji_reactions: wp_journals_grouped_emoji_reactions[record.id]
+ )
+ )
end
end
end
diff --git a/app/components/work_packages/activities_tab/journals/item_component.html.erb b/app/components/work_packages/activities_tab/journals/item_component.html.erb
index 7b0bffa9dd3..96a6f9a3bb1 100644
--- a/app/components/work_packages/activities_tab/journals/item_component.html.erb
+++ b/app/components/work_packages/activities_tab/journals/item_component.html.erb
@@ -1,27 +1,35 @@
<%=
component_wrapper(data: wrapper_data_attributes, class: "work-packages-activities-tab-journals-item-component") do
- flex_layout(data: {
- test_selector: "op-wp-journal-entry-#{journal.id}"
- }) do |journal_container|
+ flex_layout(
+ data: {
+ test_selector: "op-wp-journal-entry-#{journal.id}"
+ }
+ ) do |journal_container|
if show_comment_container?
journal_container.with_row do
- render(border_box_container(
- padding: :condensed,
- "aria-label": I18n.t("activities.work_packages.activity_tab.commented"),
- data: {
- "anchor-activity-id": journal.sequence_version,
- "anchor-comment-id": journal.id,
- }
- )) do |border_box_component|
+ render(
+ border_box_container(
+ padding: :condensed,
+ "aria-label": I18n.t("activities.work_packages.activity_tab.commented"),
+ data: {
+ "anchor-activity-id": journal.sequence_version,
+ "anchor-comment-id": journal.id,
+ }
+ )
+ ) do |border_box_component|
border_box_component.with_header(px: 2, py: 1, data: { test_selector: "op-journal-notes-header" }) do
flex_layout(align_items: :center, justify_content: :space_between) do |header_container|
- header_container.with_column(flex_layout: true,
- classes: "work-packages-activities-tab-journals-item-component--header-start-container ellipsis") do |header_start_container|
+ header_container.with_column(
+ flex_layout: true,
+ classes: "work-packages-activities-tab-journals-item-component--header-start-container ellipsis"
+ ) do |header_start_container|
header_start_container.with_column(mr: 2) do
render Users::AvatarComponent.new(user: journal.user, show_name: false, size: :mini)
end
- header_start_container.with_column(mr: 1, flex_layout: true,
- classes: "work-packages-activities-tab-journals-item-component--user-name-container hidden-for-desktop") do |user_name_container|
+ header_start_container.with_column(
+ mr: 1, flex_layout: true,
+ classes: "work-packages-activities-tab-journals-item-component--user-name-container hidden-for-desktop"
+ ) do |user_name_container|
user_name_container.with_row(classes: "work-packages-activities-tab-journals-item-component--user-name ellipsis") do
truncated_user_name(journal.user)
end
@@ -29,20 +37,22 @@
render(Primer::Beta::Text.new(font_size: :small, color: :subtle, mt: 1)) { format_time(journal.created_at) }
end
end
- header_start_container.with_column(mr: 1,
- classes: "work-packages-activities-tab-journals-item-component--user-name ellipsis hidden-for-mobile") do
+ header_start_container.with_column(
+ mr: 1,
+ classes: "work-packages-activities-tab-journals-item-component--user-name ellipsis hidden-for-mobile"
+ ) do
truncated_user_name(journal.user, hover_card: true)
end
if journal.initial?
- header_start_container.with_column(
- mr: 1,
- classes: "work-packages-activities-tab-journals-item-component-details--journal-type hidden-for-mobile"
- ) do
- render(Primer::Beta::Text.new(font_size: :small, color: :subtle, mt: 1)) do
- I18n.t("activities.work_packages.activity_tab.created_on")
- end
+ header_start_container.with_column(
+ mr: 1,
+ classes: "work-packages-activities-tab-journals-item-component-details--journal-type hidden-for-mobile"
+ ) do
+ render(Primer::Beta::Text.new(font_size: :small, color: :subtle, mt: 1)) do
+ I18n.t("activities.work_packages.activity_tab.created_on")
end
end
+ end
header_start_container.with_column(mr: 1, classes: "hidden-for-mobile") do
if OpenProject::FeatureDecisions.work_package_comment_id_url_active?
activity_anchor_link(journal) { journal_updated_at_formatted_time(journal) }
@@ -54,12 +64,14 @@
header_container.with_column(flex_layout: true, align_items: :center) do |header_end_container|
if has_unread_notifications?
header_end_container.with_column(mr: 2, pt: 1) do
- render(Primer::Beta::Octicon.new(
- :"dot-fill", # color is set via CSS as requested by UI/UX Team
- classes: "work-packages-activities-tab-journals-item-component--notification-dot-icon",
- size: :medium,
- data: { test_selector: "op-journal-unread-notification", "op-ian-center-update-immediate": true }
- ))
+ render(
+ Primer::Beta::Octicon.new(
+ :"dot-fill", # color is set via CSS as requested by UI/UX Team
+ classes: "work-packages-activities-tab-journals-item-component--notification-dot-icon",
+ size: :medium,
+ data: { test_selector: "op-journal-unread-notification", "op-ian-center-update-immediate": true }
+ )
+ )
end
end
@@ -69,12 +81,16 @@
end
end
- header_end_container.with_column(ml: 1,
- classes: "work-packages-activities-tab-journals-item-component--action-menu") do
+ header_end_container.with_column(
+ ml: 1,
+ classes: "work-packages-activities-tab-journals-item-component--action-menu"
+ ) do
render(Primer::Alpha::ActionMenu.new(data: { test_selector: "op-wp-journal-#{journal.id}-action-menu" })) do |menu|
- menu.with_show_button(icon: "kebab-horizontal",
- "aria-label": I18n.t(:button_actions),
- scheme: :invisible)
+ menu.with_show_button(
+ icon: "kebab-horizontal",
+ "aria-label": I18n.t(:button_actions),
+ scheme: :invisible
+ )
copy_url_action_item(menu)
edit_action_item(menu) if allowed_to_edit?
quote_action_item(menu) if journal.notes.present? && allowed_to_quote?
@@ -94,8 +110,12 @@
else
case state
when :show
- render(WorkPackages::ActivitiesTab::Journals::ItemComponent::Show.new(journal:, filter:,
- grouped_emoji_reactions:))
+ render(
+ WorkPackages::ActivitiesTab::Journals::ItemComponent::Show.new(
+ journal:, filter:,
+ grouped_emoji_reactions:
+ )
+ )
when :edit
render(WorkPackages::ActivitiesTab::Journals::ItemComponent::Edit.new(journal:, filter:))
end
@@ -105,8 +125,12 @@
end
end
journal_container.with_row do
- render(WorkPackages::ActivitiesTab::Journals::ItemComponent::Details.new(journal:,
- has_unread_notifications: notification_on_details?, filter:))
+ render(
+ WorkPackages::ActivitiesTab::Journals::ItemComponent::Details.new(
+ journal:,
+ has_unread_notifications: notification_on_details?, filter:
+ )
+ )
end
end
end
diff --git a/app/components/work_packages/activities_tab/journals/item_component/add_reactions.html.erb b/app/components/work_packages/activities_tab/journals/item_component/add_reactions.html.erb
index 95c076c3187..3bb4f7aa7e9 100644
--- a/app/components/work_packages/activities_tab/journals/item_component/add_reactions.html.erb
+++ b/app/components/work_packages/activities_tab/journals/item_component/add_reactions.html.erb
@@ -1,11 +1,13 @@
<%=
component_wrapper do
- render(Primer::Alpha::Overlay.new(
- title: I18n.t("reactions.action_title"),
- padding: :condensed,
- anchor_side: :outside_top,
- visually_hide_title: true
- )) do |overlay|
+ render(
+ Primer::Alpha::Overlay.new(
+ title: I18n.t("reactions.action_title"),
+ padding: :condensed,
+ anchor_side: :outside_top,
+ visually_hide_title: true
+ )
+ ) do |overlay|
overlay.with_show_button(
icon: "smiley",
"aria-label": I18n.t("reactions.add_reaction"),
@@ -18,21 +20,23 @@
flex_layout(flex_wrap: :wrap, classes: "op-add-reactions-overlay") do |add_reactions_container|
EmojiReaction.available_emoji_reactions.each do |emoji, reaction|
add_reactions_container.with_column(mr: 2) do
- render(Primer::Beta::Button.new(
- scheme: button_scheme(reaction),
- color: :default,
- bg: counter_color(reaction),
- id: "overlay-#{journal.id}-#{reaction}",
- test_selector: "overlay-reaction-#{reaction}",
- tag: :a,
- href: href(reaction:),
- data: {
- turbo_stream: true,
- turbo_method: :put,
- "work-packages--activities-tab--index-target": "reactionButton",
- },
- aria: { label: I18n.t("reactions.react_with", reaction: reaction.to_s.humanize(capitalize: false)) }
- )) do
+ render(
+ Primer::Beta::Button.new(
+ scheme: button_scheme(reaction),
+ color: :default,
+ bg: counter_color(reaction),
+ id: "overlay-#{journal.id}-#{reaction}",
+ test_selector: "overlay-reaction-#{reaction}",
+ tag: :a,
+ href: href(reaction:),
+ data: {
+ turbo_stream: true,
+ turbo_method: :put,
+ "work-packages--activities-tab--index-target": "reactionButton",
+ },
+ aria: { label: I18n.t("reactions.react_with", reaction: reaction.to_s.humanize(capitalize: false)) }
+ )
+ ) do
emoji
end
end
diff --git a/app/components/work_packages/activities_tab/journals/item_component/edit.html.erb b/app/components/work_packages/activities_tab/journals/item_component/edit.html.erb
index 3e06b98ddd1..45a6850f905 100644
--- a/app/components/work_packages/activities_tab/journals/item_component/edit.html.erb
+++ b/app/components/work_packages/activities_tab/journals/item_component/edit.html.erb
@@ -14,15 +14,17 @@
end
form_container.with_row(flex_layout: true, mt: 3, justify_content: :flex_end) do |submit_container|
submit_container.with_column(mr: 2) do
- render(Primer::Beta::Button.new(
- scheme: :secondary,
- size: :medium,
- tag: :a,
- href: cancel_edit_work_package_activity_path(work_package.id, id: journal.id, filter:),
- data: { turbo_stream: true }
- )) do
- t("button_cancel")
- end
+ render(
+ Primer::Beta::Button.new(
+ scheme: :secondary,
+ size: :medium,
+ tag: :a,
+ href: cancel_edit_work_package_activity_path(work_package.id, id: journal.id, filter:),
+ data: { turbo_stream: true }
+ )
+ ) do
+ t("button_cancel")
+ end
end
submit_container.with_column do
render(WorkPackages::ActivitiesTab::Journals::Submit.new(f))
diff --git a/app/components/work_packages/activities_tab/journals/new_component.html.erb b/app/components/work_packages/activities_tab/journals/new_component.html.erb
index 3cb7db5a178..6cbb764660d 100644
--- a/app/components/work_packages/activities_tab/journals/new_component.html.erb
+++ b/app/components/work_packages/activities_tab/journals/new_component.html.erb
@@ -5,10 +5,12 @@
display: button_row_display_value,
data: {
"work-packages--activities-tab--index-target": "buttonRow"
- }) do
+ }
+ ) do
flex_layout(justify_content: :space_between) do |button_row|
button_row.with_column(classes: "work-packages-activities-tab-journals-new-component--input-trigger-column", mr: 2) do
- render(Primer::Beta::Button.new(
+ render(
+ Primer::Beta::Button.new(
text_align: :left,
scheme: :default,
size: :medium,
@@ -17,17 +19,20 @@
"action": "click->work-packages--activities-tab--index#showForm dragover->work-packages--activities-tab--index#showForm",
"test_selector": "op-open-work-package-journal-form-trigger"
}
- )) do
+ )
+ ) do
render(Primer::Beta::Text.new(color: :muted, font_weight: :normal)) { t("activities.work_packages.activity_tab.label_type_to_comment") }
end
end
button_row.with_column do
- render(Primer::Beta::IconButton.new(
+ render(
+ Primer::Beta::IconButton.new(
scheme: :default,
icon: :"paper-airplane",
"aria-label": t("activities.work_packages.activity_tab.label_submit_comment"),
disabled: true
- ))
+ )
+ )
end
end
end
@@ -56,16 +61,18 @@
render(WorkPackages::ActivitiesTab::Journals::NotesForm.new(f))
end
form_container.with_column do
- render(Primer::Beta::IconButton.new(
- scheme: :default,
- icon: :"paper-airplane",
- "aria-label": t("activities.work_packages.activity_tab.label_submit_comment"),
- type: :submit,
- data: {
- "test_selector": "op-submit-work-package-journal-form",
- "work-packages--activities-tab--index-target": "formSubmitButton"
- }
- ))
+ render(
+ Primer::Beta::IconButton.new(
+ scheme: :default,
+ icon: :"paper-airplane",
+ "aria-label": t("activities.work_packages.activity_tab.label_submit_comment"),
+ type: :submit,
+ data: {
+ "test_selector": "op-submit-work-package-journal-form",
+ "work-packages--activities-tab--index-target": "formSubmitButton"
+ }
+ )
+ )
end
end
end
diff --git a/app/components/work_packages/activities_tab/journals/revision_component.html.erb b/app/components/work_packages/activities_tab/journals/revision_component.html.erb
index 3529fe071d0..54d7cc44372 100644
--- a/app/components/work_packages/activities_tab/journals/revision_component.html.erb
+++ b/app/components/work_packages/activities_tab/journals/revision_component.html.erb
@@ -1,63 +1,81 @@
<%=
component_wrapper(class: "work-packages-activities-tab-journals-item-component") do
- flex_layout(data: {
- test_selector: "op-wp-revision-entry-#{changeset.id}"
- }) do |revision_container|
+ flex_layout(
+ data: {
+ test_selector: "op-wp-revision-entry-#{changeset.id}"
+ }
+ ) do |revision_container|
revision_container.with_row do
- render(border_box_container(
- id: "activity-anchor-r#{changeset.revision}",
- padding: :condensed,
- "aria-label": I18n.t("activities.work_packages.activity_tab.commented")
- )) do |border_box_component|
+ render(
+ border_box_container(
+ id: "activity-anchor-r#{changeset.revision}",
+ padding: :condensed,
+ "aria-label": I18n.t("activities.work_packages.activity_tab.commented")
+ )
+ ) do |border_box_component|
border_box_component.with_header(px: 2, py: 1, data: { test_selector: "op-revision-header" }) do
flex_layout(align_items: :center, justify_content: :space_between, classes: "work-packages-activities-tab-revision-component--header") do |header_container|
- header_container.with_column(flex_layout: true,
- classes: "work-packages-activities-tab-journals-item-component--header-start-container ellipsis") do |header_start_container|
+ header_container.with_column(
+ flex_layout: true,
+ classes: "work-packages-activities-tab-journals-item-component--header-start-container ellipsis"
+ ) do |header_start_container|
header_start_container.with_column(mr: 2) do
if changeset.user
render(Users::AvatarComponent.new(user: changeset.user, show_name: false, size: :mini))
end
end
- header_start_container.with_column(mr: 1, flex_layout: true,
- classes: "work-packages-activities-tab-journals-item-component--user-name-container hidden-for-desktop") do |user_name_container|
+ header_start_container.with_column(
+ mr: 1, flex_layout: true,
+ classes: "work-packages-activities-tab-journals-item-component--user-name-container hidden-for-desktop"
+ ) do |user_name_container|
user_name_container.with_row(classes: "work-packages-activities-tab-journals-item-component--user-name ellipsis") do
render_user_name
end
user_name_container.with_row do
render(Primer::Beta::Text.new(font_size: :small, color: :subtle, mr: 1)) do
- committed_text = render(Primer::Beta::Link.new(
+ committed_text = render(
+ Primer::Beta::Link.new(
+ href: revision_url,
+ scheme: :secondary,
+ underline: false,
+ font_size: :small,
+ target: "_blank"
+ )
+ ) do
+ I18n.t("js.label_committed_link", revision_identifier: short_revision)
+ end
+ I18n.t(
+ "js.label_committed_at",
+ committed_revision_link: committed_text.html_safe,
+ date: format_time(changeset.committed_on)
+ ).html_safe
+ end
+ end
+ end
+ header_start_container.with_column(
+ mr: 1,
+ classes: "work-packages-activities-tab-journals-item-component--user-name ellipsis hidden-for-mobile"
+ ) do
+ render_user_name
+ end
+ header_start_container.with_column(mr: 1, classes: "hidden-for-mobile") do
+ render(Primer::Beta::Text.new(font_size: :small, color: :subtle, mr: 1)) do
+ committed_text = render(
+ Primer::Beta::Link.new(
href: revision_url,
scheme: :secondary,
underline: false,
font_size: :small,
target: "_blank"
- )) do
- I18n.t("js.label_committed_link", revision_identifier: short_revision)
- end
- I18n.t("js.label_committed_at",
- committed_revision_link: committed_text.html_safe,
- date: format_time(changeset.committed_on)).html_safe
- end
- end
- end
- header_start_container.with_column(mr: 1,
- classes: "work-packages-activities-tab-journals-item-component--user-name ellipsis hidden-for-mobile") do
- render_user_name
- end
- header_start_container.with_column(mr: 1, classes: "hidden-for-mobile") do
- render(Primer::Beta::Text.new(font_size: :small, color: :subtle, mr: 1)) do
- committed_text = render(Primer::Beta::Link.new(
- href: revision_url,
- scheme: :secondary,
- underline: false,
- font_size: :small,
- target: "_blank"
- )) do
+ )
+ ) do
I18n.t("js.label_committed_link", revision_identifier: short_revision)
end
- I18n.t("js.label_committed_at",
- committed_revision_link: committed_text.html_safe,
- date: format_time(changeset.committed_on)).html_safe
+ I18n.t(
+ "js.label_committed_at",
+ committed_revision_link: committed_text.html_safe,
+ date: format_time(changeset.committed_on)
+ ).html_safe
end
end
end
diff --git a/app/components/work_packages/details/tab_component.html.erb b/app/components/work_packages/details/tab_component.html.erb
index 7a2f8c76dfb..9e3d051f7e8 100644
--- a/app/components/work_packages/details/tab_component.html.erb
+++ b/app/components/work_packages/details/tab_component.html.erb
@@ -1,35 +1,46 @@
<%=
- flex_layout(classes: "op-work-package-details-tab-component", data: {
- "application-target": "dynamic",
- controller: "work-packages--details--tabs"
- }) do |flex|
+ flex_layout(
+ classes: "op-work-package-details-tab-component", data: {
+ "application-target": "dynamic",
+ controller: "work-packages--details--tabs"
+ }
+ ) do |flex|
flex.with_column(classes: "op-work-package-details-tab-component--action") do
- render(Primer::Beta::IconButton.new(icon: :"chevron-left",
- tag: :a,
- classes: "hidden-for-tablet",
- scheme: :invisible,
- data: {
- action: "click->work-packages--details--tabs#scrollLeft"
- },
- aria: { label: I18n.t(:label_scroll_left) }))
+ render(
+ Primer::Beta::IconButton.new(
+ icon: :"chevron-left",
+ tag: :a,
+ classes: "hidden-for-tablet",
+ scheme: :invisible,
+ data: {
+ action: "click->work-packages--details--tabs#scrollLeft"
+ },
+ aria: { label: I18n.t(:label_scroll_left) }
+ )
+ )
end
flex.with_column(flex: 1, classes: "op-work-package-details-tab-component--tabs", test_selector: "wp-details-tab-component--tabs") do
- render(Primer::Alpha::UnderlineNav.new(align: :left,
- label: "Tabs",
- data: {
- "work-packages--details--tabs-target": "underlineNav",
- })) do |component|
+ render(
+ Primer::Alpha::UnderlineNav.new(
+ align: :left,
+ label: "Tabs",
+ data: {
+ "work-packages--details--tabs-target": "underlineNav",
+ }
+ )
+ ) do |component|
menu_items.each do |node|
- component.with_tab(selected: @tab == node.name,
- href: helpers.url_for_with_params(**node.url),
- test_selector: "wp-details-tab-component--tab-#{node.name}",
- data: {
- turbo: true,
- turbo_stream: true,
- turbo_action: "replace",
- "work-packages--details--tabs-target": @tab == node.name ? "activeElement" : ""
- }
+ component.with_tab(
+ selected: @tab == node.name,
+ href: helpers.url_for_with_params(**node.url),
+ test_selector: "wp-details-tab-component--tab-#{node.name}",
+ data: {
+ turbo: true,
+ turbo_stream: true,
+ turbo_action: "replace",
+ "work-packages--details--tabs-target": @tab == node.name ? "activeElement" : ""
+ }
) do |c|
c.with_text { t("js.work_packages.tabs.#{node.name}") }
count = node.badge(work_package:).to_i
@@ -40,35 +51,47 @@
end
flex.with_column(classes: "op-work-package-details-tab-component--action") do
- render(Primer::Beta::IconButton.new(icon: :"chevron-right",
- tag: :a,
- classes: "hidden-for-tablet",
- scheme: :invisible,
- data: {
- action: "click->work-packages--details--tabs#scrollRight"
- },
- aria: { label: I18n.t(:label_scroll_right) }))
+ render(
+ Primer::Beta::IconButton.new(
+ icon: :"chevron-right",
+ tag: :a,
+ classes: "hidden-for-tablet",
+ scheme: :invisible,
+ data: {
+ action: "click->work-packages--details--tabs#scrollRight"
+ },
+ aria: { label: I18n.t(:label_scroll_right) }
+ )
+ )
end
flex.with_column(classes: "op-work-package-details-tab-component--action") do
- render(Primer::Beta::IconButton.new(icon: :"screen-full",
- tag: :a,
- classes: "hidden-for-small-laptops",
- href: work_package_path(work_package.id, full_screen_tab),
- target: "_top",
- scheme: :invisible,
- test_selector: "wp-details-tab-component--full-screen",
- aria: { label: I18n.t("js.button_show_fullscreen") }))
+ render(
+ Primer::Beta::IconButton.new(
+ icon: :"screen-full",
+ tag: :a,
+ classes: "hidden-for-small-laptops",
+ href: work_package_path(work_package.id, full_screen_tab),
+ target: "_top",
+ scheme: :invisible,
+ test_selector: "wp-details-tab-component--full-screen",
+ aria: { label: I18n.t("js.button_show_fullscreen") }
+ )
+ )
end
flex.with_column(classes: "op-work-package-details-tab-component--action") do
- render(Primer::Beta::IconButton.new(icon: :x,
- tag: :a,
- href: base_route,
- data: { turbo: true, target: "_top", turbo_action: "advance" },
- scheme: :invisible,
- test_selector: "wp-details-tab-component--close",
- aria: { label: I18n.t(:button_close) }))
+ render(
+ Primer::Beta::IconButton.new(
+ icon: :x,
+ tag: :a,
+ href: base_route,
+ data: { turbo: true, target: "_top", turbo_action: "advance" },
+ scheme: :invisible,
+ test_selector: "wp-details-tab-component--close",
+ aria: { label: I18n.t(:button_close) }
+ )
+ )
end
end
%>
diff --git a/app/components/work_packages/exports/csv/export_settings_component.html.erb b/app/components/work_packages/exports/csv/export_settings_component.html.erb
index dddd90a2649..387bbccad53 100644
--- a/app/components/work_packages/exports/csv/export_settings_component.html.erb
+++ b/app/components/work_packages/exports/csv/export_settings_component.html.erb
@@ -1,20 +1,23 @@
<%= flex_layout do |container| %>
<%= container.with_row do |_columns| %>
<%= render WorkPackages::Exports::ColumnSelectionComponent.new(
- query,
- "columns-select-export-csv",
- I18n.t("export.dialog.columns.input_caption_table")
- ) %>
+ query,
+ "columns-select-export-csv",
+ I18n.t("export.dialog.columns.input_caption_table")
+ ) %>
<% end %>
<%= container.with_row do |_csv_include_description| %>
<%= render OpenProject::Common::DividerComponent.new %>
- <%= render(Primer::Alpha::CheckBox.new(
- id: "show_descriptions_csv",
- name: "show_descriptions",
- value: "true",
- unchecked_value: "false",
- label: I18n.t("export.dialog.xls.include_descriptions.label"),
- caption: I18n.t("export.dialog.xls.include_descriptions.caption"),
- visually_hide_label: false)) %>
+ <%= render(
+ Primer::Alpha::CheckBox.new(
+ id: "show_descriptions_csv",
+ name: "show_descriptions",
+ value: "true",
+ unchecked_value: "false",
+ label: I18n.t("export.dialog.xls.include_descriptions.label"),
+ caption: I18n.t("export.dialog.xls.include_descriptions.caption"),
+ visually_hide_label: false
+ )
+ ) %>
<% end %>
<% end %>
diff --git a/app/components/work_packages/exports/modal_dialog_component.html.erb b/app/components/work_packages/exports/modal_dialog_component.html.erb
index e4469f69b9d..10f597cb27f 100644
--- a/app/components/work_packages/exports/modal_dialog_component.html.erb
+++ b/app/components/work_packages/exports/modal_dialog_component.html.erb
@@ -1,34 +1,37 @@
-<%= render(Primer::Alpha::Dialog.new(
- title: I18n.t("export.dialog.title"),
- size: :xlarge,
- id: MODAL_ID,
- data: {
- "application-target": "dynamic",
- controller: "work-packages--export--dialog"
- }
-)) do |dialog| %>
+<%= render(
+ Primer::Alpha::Dialog.new(
+ title: I18n.t("export.dialog.title"),
+ size: :xlarge,
+ id: MODAL_ID,
+ data: {
+ "application-target": "dynamic",
+ controller: "work-packages--export--dialog"
+ }
+ )
+ ) do |dialog| %>
<% dialog.with_header(variant: :large) %>
<% dialog.with_body do %>
<% flex_layout do |modal_body| %>
<% modal_body.with_row do |_format| %>
<%= render(Primer::Beta::Text.new(tag: "legend", font_size: :normal, mb: 2, font_weight: :bold)) { I18n.t("export.dialog.format.label") } %>
<%= render(Primer::Alpha::SegmentedControl.new(ml: 0, "aria-label": I18n.t("export.dialog.format.label"), size: :medium)) do |component|
- export_formats_settings.each do |format|
- component.with_item(
- label: format[:label], icon: format[:icon], selected: format[:selected],
- data: {
- "work-packages--export--dialog-format-param": format[:id],
- action: "click:segmented-control#select click->work-packages--export--dialog#formatChanged"
- })
- end
- end %>
+ export_formats_settings.each do |format|
+ component.with_item(
+ label: format[:label], icon: format[:icon], selected: format[:selected],
+ data: {
+ "work-packages--export--dialog-format-param": format[:id],
+ action: "click:segmented-control#select click->work-packages--export--dialog#formatChanged"
+ }
+ )
+ end
+ end %>
<%= render OpenProject::Common::DividerComponent.new %>
<% end %>
<% export_formats_settings.each do |format| %>
<% modal_body.with_row(
- classes: format[:selected] ? nil : "d-none",
- data: { format: format[:id], "work-packages--export--dialog-target": "formatTab" }
- ) do |_format_tabs| %>
+ classes: format[:selected] ? nil : "d-none",
+ data: { format: format[:id], "work-packages--export--dialog-target": "formatTab" }
+ ) do |_format_tabs| %>
<%= primer_form_with(
url: export_format_url(format[:id]),
id: "#{EXPORT_FORM_ID}-#{format[:id]}",
@@ -48,12 +51,15 @@
<% end %>
<% dialog.with_footer do %>
<%= render(Primer::ButtonComponent.new(data: { "close-dialog-id": MODAL_ID })) { I18n.t(:button_cancel) } %>
- <%= render(Primer::ButtonComponent.new(
- data: {
- "close-dialog-id": MODAL_ID,
- "work-packages--export--dialog-target": "submit"
- },
- scheme: :primary, type: :submit,
- form: "#{EXPORT_FORM_ID}-#{export_formats_settings.find { |e| e[:selected] }[:id]}")) { I18n.t("export.dialog.submit") } %>
+ <%= render(
+ Primer::ButtonComponent.new(
+ data: {
+ "close-dialog-id": MODAL_ID,
+ "work-packages--export--dialog-target": "submit"
+ },
+ scheme: :primary, type: :submit,
+ form: "#{EXPORT_FORM_ID}-#{export_formats_settings.find { |e| e[:selected] }[:id]}"
+ )
+ ) { I18n.t("export.dialog.submit") } %>
<% end %>
<% end %>
diff --git a/app/components/work_packages/exports/pdf/export_settings_component.html.erb b/app/components/work_packages/exports/pdf/export_settings_component.html.erb
index adfaedd9d96..aa3ed8093c3 100644
--- a/app/components/work_packages/exports/pdf/export_settings_component.html.erb
+++ b/app/components/work_packages/exports/pdf/export_settings_component.html.erb
@@ -1,35 +1,43 @@
<%=
- flex_layout(data: {
- "application-target": "dynamic",
- controller: "work-packages--export--pdf--settings"
- }) do |container|
+ flex_layout(
+ data: {
+ "application-target": "dynamic",
+ controller: "work-packages--export--pdf--settings"
+ }
+ ) do |container|
%>
<%= container.with_row do %>
- <%= render(Primer::Alpha::RadioButtonGroup.new(
- full_width: true,
- name: "pdf_export_type",
- label: I18n.t("export.dialog.pdf.export_type.label"))) do |component|
- pdf_export_types.each do |entry|
- component.radio_button(label: entry[:label],
- value: entry[:value],
- checked: current_pdf_export_type == entry[:value],
- disabled: entry[:disabled] ? true : nil,
- data: {
- "work-packages--export--pdf--settings-name-param": entry[:value],
- action: "work-packages--export--pdf--settings#typeChanged"
- },
- caption: entry[:caption])
- end
- end %>
+ <%= render(
+ Primer::Alpha::RadioButtonGroup.new(
+ full_width: true,
+ name: "pdf_export_type",
+ label: I18n.t("export.dialog.pdf.export_type.label")
+ )
+ ) do |component|
+ pdf_export_types.each do |entry|
+ component.radio_button(
+ label: entry[:label],
+ value: entry[:value],
+ checked: current_pdf_export_type == entry[:value],
+ disabled: entry[:disabled] ? true : nil,
+ data: {
+ "work-packages--export--pdf--settings-name-param": entry[:value],
+ action: "work-packages--export--pdf--settings#typeChanged"
+ },
+ caption: entry[:caption]
+ )
+ end
+ end %>
<%= render OpenProject::Common::DividerComponent.new %>
<% end %>
<% pdf_export_types.reject { |entry| entry[:disabled] }.each do |entry| %>
<%= container.with_row(
- classes: current_pdf_export_type == entry[:value] ? nil : "d-none",
- data: {
- "pdf-export-type": entry[:value],
- "work-packages--export--pdf--settings-target": "fields"
- }) do |_pdf_export_type| %>
+ classes: current_pdf_export_type == entry[:value] ? nil : "d-none",
+ data: {
+ "pdf-export-type": entry[:value],
+ "work-packages--export--pdf--settings-target": "fields"
+ }
+ ) do |_pdf_export_type| %>
<%= render(entry[:component].new(query)) %>
<% end %>
<% end %>
diff --git a/app/components/work_packages/exports/pdf/report/export_settings_component.html.erb b/app/components/work_packages/exports/pdf/report/export_settings_component.html.erb
index 694ac5c7cee..e57594e76f5 100644
--- a/app/components/work_packages/exports/pdf/report/export_settings_component.html.erb
+++ b/app/components/work_packages/exports/pdf/report/export_settings_component.html.erb
@@ -1,11 +1,11 @@
<%= flex_layout do |container| %>
<% container.with_row do |_columns| %>
<%= render WorkPackages::Exports::ColumnSelectionComponent.new(
- query,
- "columns-select-export-pdf-report",
- I18n.t("export.dialog.columns.input_caption_report"),
- I18n.t("export.dialog.columns.input_label_report")
- ) %>
+ query,
+ "columns-select-export-pdf-report",
+ I18n.t("export.dialog.columns.input_caption_report"),
+ I18n.t("export.dialog.columns.input_label_report")
+ ) %>
<% end %>
<% container.with_row do |_columns| %>
<%= render OpenProject::Common::DividerComponent.new %>
@@ -27,12 +27,16 @@
<% end %>
<%= container.with_row do |_pdf_report_images| %>
<%= render OpenProject::Common::DividerComponent.new %>
- <%= render(Primer::Alpha::CheckBox.new(name: "show_images",
- checked: true,
- value: "true",
- unchecked_value: "false",
- label: I18n.t("export.dialog.pdf.include_images.label"),
- caption: I18n.t("export.dialog.pdf.include_images.caption"),
- visually_hide_label: false)) %>
+ <%= render(
+ Primer::Alpha::CheckBox.new(
+ name: "show_images",
+ checked: true,
+ value: "true",
+ unchecked_value: "false",
+ label: I18n.t("export.dialog.pdf.include_images.label"),
+ caption: I18n.t("export.dialog.pdf.include_images.caption"),
+ visually_hide_label: false
+ )
+ ) %>
<% end %>
<% end %>
diff --git a/app/components/work_packages/exports/pdf/table/export_settings_component.html.erb b/app/components/work_packages/exports/pdf/table/export_settings_component.html.erb
index 40cd43cd9ee..64eb44bb3e7 100644
--- a/app/components/work_packages/exports/pdf/table/export_settings_component.html.erb
+++ b/app/components/work_packages/exports/pdf/table/export_settings_component.html.erb
@@ -1,5 +1,5 @@
<%= render WorkPackages::Exports::ColumnSelectionComponent.new(
- query,
- "columns-select-export-pdf-table",
- I18n.t("export.dialog.columns.input_caption_table")
-) %>
+ query,
+ "columns-select-export-pdf-table",
+ I18n.t("export.dialog.columns.input_caption_table")
+ ) %>
diff --git a/app/components/work_packages/exports/xls/export_settings_component.html.erb b/app/components/work_packages/exports/xls/export_settings_component.html.erb
index 802b8fc6e67..7077876b9c9 100644
--- a/app/components/work_packages/exports/xls/export_settings_component.html.erb
+++ b/app/components/work_packages/exports/xls/export_settings_component.html.erb
@@ -1,31 +1,37 @@
<%= flex_layout do |container| %>
<%= container.with_row do |_columns| %>
<%= render WorkPackages::Exports::ColumnSelectionComponent.new(
- query,
- "columns-select-export-xls",
- I18n.t("export.dialog.columns.input_caption_table")
- ) %>
+ query,
+ "columns-select-export-xls",
+ I18n.t("export.dialog.columns.input_caption_table")
+ ) %>
<% end %>
<%= container.with_row do |_xls_include_relations| %>
<%= render OpenProject::Common::DividerComponent.new %>
- <%= render(Primer::Alpha::CheckBox.new(
- id: "show_relations_xls",
- name: "show_relations",
- value: "true",
- unchecked_value: "false",
- label: I18n.t("export.dialog.xls.include_relations.label"),
- caption: I18n.t("export.dialog.xls.include_relations.caption"),
- visually_hide_label: false)) %>
+ <%= render(
+ Primer::Alpha::CheckBox.new(
+ id: "show_relations_xls",
+ name: "show_relations",
+ value: "true",
+ unchecked_value: "false",
+ label: I18n.t("export.dialog.xls.include_relations.label"),
+ caption: I18n.t("export.dialog.xls.include_relations.caption"),
+ visually_hide_label: false
+ )
+ ) %>
<% end %>
<%= container.with_row do |_xls_include_description| %>
<%= render OpenProject::Common::DividerComponent.new %>
- <%= render(Primer::Alpha::CheckBox.new(
- id: "show_descriptions_xls",
- name: "show_descriptions",
- value: "true",
- unchecked_value: "false",
- label: I18n.t("export.dialog.xls.include_descriptions.label"),
- caption: I18n.t("export.dialog.xls.include_descriptions.caption"),
- visually_hide_label: false)) %>
+ <%= render(
+ Primer::Alpha::CheckBox.new(
+ id: "show_descriptions_xls",
+ name: "show_descriptions",
+ value: "true",
+ unchecked_value: "false",
+ label: I18n.t("export.dialog.xls.include_descriptions.label"),
+ caption: I18n.t("export.dialog.xls.include_descriptions.caption"),
+ visually_hide_label: false
+ )
+ ) %>
<% end %>
<% end %>
diff --git a/app/components/work_packages/hover_card_component.html.erb b/app/components/work_packages/hover_card_component.html.erb
index 096bd5b7a57..f729d62d327 100644
--- a/app/components/work_packages/hover_card_component.html.erb
+++ b/app/components/work_packages/hover_card_component.html.erb
@@ -16,12 +16,16 @@
grid.with_area(:assignee, tag: :div, font_size: :small, color: :muted) do
if @assignee.present?
# Render the avatar without a hover card => opening another hover card within a hover card is not supported
- render(Users::AvatarComponent.new(user: @assignee,
- show_name: true,
- link: false,
- size: :mini,
- classes: "op-wp-hover-card--principal",
- hover_card: { active: false }))
+ render(
+ Users::AvatarComponent.new(
+ user: @assignee,
+ show_name: true,
+ link: false,
+ size: :mini,
+ classes: "op-wp-hover-card--principal",
+ hover_card: { active: false }
+ )
+ )
else
concat(render(Primer::Beta::Octicon.new(icon: :person, mr: 1)))
concat(render(Primer::Beta::Text.new) { "-" })
diff --git a/app/components/work_packages/info_line_component.html.erb b/app/components/work_packages/info_line_component.html.erb
index a62250927f1..509a6b07bf8 100644
--- a/app/components/work_packages/info_line_component.html.erb
+++ b/app/components/work_packages/info_line_component.html.erb
@@ -3,14 +3,16 @@
flex.with_column(mr: 2) do
render(WorkPackages::HighlightedTypeComponent.new(work_package: @work_package, font_size: :small))
end
- flex.with_column(mr: 2) do
- render(Primer::Beta::Link.new(
- href: url_for(controller: "/work_packages", action: "show", id: @work_package),
- title: @work_package.subject,
- target: :_blank,
- font_size: @font_size,
- color: :muted
- )) { "##{@work_package.id}" }
+ flex.with_column(mr: 2) do
+ render(
+ Primer::Beta::Link.new(
+ href: url_for(controller: "/work_packages", action: "show", id: @work_package),
+ title: @work_package.subject,
+ target: :_blank,
+ font_size: @font_size,
+ color: :muted
+ )
+ ) { "##{@work_package.id}" }
end
flex.with_column do
render WorkPackages::StatusBadgeComponent.new(status: @work_package.status)
diff --git a/app/components/work_packages/progress/status_based/modal_body_component.html.erb b/app/components/work_packages/progress/status_based/modal_body_component.html.erb
index 602e7a4f149..875852194d2 100644
--- a/app/components/work_packages/progress/status_based/modal_body_component.html.erb
+++ b/app/components/work_packages/progress/status_based/modal_body_component.html.erb
@@ -11,11 +11,15 @@
) do |f| %>
<%= flex_layout do |modal_body| %>
<% modal_body.with_row(classes: "FormControl-horizontalGroup--sm-vertical") do |_fields| %>
- <%= render(WorkPackages::ProgressForm.new(f,
- work_package:,
- mode:,
- focused_field:,
- touched_field_map:)) %>
+ <%= render(
+ WorkPackages::ProgressForm.new(
+ f,
+ work_package:,
+ mode:,
+ focused_field:,
+ touched_field_map:
+ )
+ ) %>
<% end %>
<% modal_body.with_row(mt: 3) do |_tooltip| %>
@@ -27,8 +31,12 @@
<% modal_body.with_row(mt: 3) do |_actions_row| %>
<%= flex_layout(justify_content: :flex_end) do |action_buttons| %>
<%= action_buttons.with_column do %>
- <%= render(Primer::Beta::Button.new(scheme: :primary,
- type: :submit)) { t(:button_save) } %>
+ <%= render(
+ Primer::Beta::Button.new(
+ scheme: :primary,
+ type: :submit
+ )
+ ) { t(:button_save) } %>
<% end %>
<% end %>
<% end %>
diff --git a/app/components/work_packages/progress/work_based/modal_body_component.html.erb b/app/components/work_packages/progress/work_based/modal_body_component.html.erb
index d2b0549278a..af94620a264 100644
--- a/app/components/work_packages/progress/work_based/modal_body_component.html.erb
+++ b/app/components/work_packages/progress/work_based/modal_body_component.html.erb
@@ -11,18 +11,26 @@
) do |f| %>
<%= flex_layout do |modal_body| %>
<% modal_body.with_row(classes: "FormControl-horizontalGroup--sm-vertical") do |_fields| %>
- <%= render(WorkPackages::ProgressForm.new(f,
- work_package:,
- mode:,
- focused_field:,
- touched_field_map:)) %>
+ <%= render(
+ WorkPackages::ProgressForm.new(
+ f,
+ work_package:,
+ mode:,
+ focused_field:,
+ touched_field_map:
+ )
+ ) %>
<% end %>
<% modal_body.with_row(mt: 3) do |_actions_row| %>
<%= flex_layout(justify_content: :flex_end) do |action_buttons| %>
<%= action_buttons.with_column do %>
- <%= render(Primer::Beta::Button.new(scheme: :primary,
- type: :submit)) { t(:button_save) } %>
+ <%= render(
+ Primer::Beta::Button.new(
+ scheme: :primary,
+ type: :submit
+ )
+ ) { t(:button_save) } %>
<% end %>
<% end %>
<% end %>
diff --git a/app/components/work_packages/reminder/modal_body_component.html.erb b/app/components/work_packages/reminder/modal_body_component.html.erb
index 136dddb8190..4c050952b48 100644
--- a/app/components/work_packages/reminder/modal_body_component.html.erb
+++ b/app/components/work_packages/reminder/modal_body_component.html.erb
@@ -15,35 +15,49 @@
<%= render(WorkPackages::Reminder::Note.new(f)) %>
<% end %>
<% if reminder.persisted? %>
- <%= form_flex_container.with_row(flex_layout: true,
- justify_content: :space_between) do |actions_row| %>
+ <%= form_flex_container.with_row(
+ flex_layout: true,
+ justify_content: :space_between
+ ) do |actions_row| %>
<%= actions_row.with_column do %>
- <%= render(Primer::Beta::Button.new(
- scheme: :danger,
- type: :submit,
- formaction: work_package_reminder_path(remindable, reminder),
- formmethod: :delete
- )) { I18n.t(:button_remove_reminder) } %>
+ <%= render(
+ Primer::Beta::Button.new(
+ scheme: :danger,
+ type: :submit,
+ formaction: work_package_reminder_path(remindable, reminder),
+ formmethod: :delete
+ )
+ ) { I18n.t(:button_remove_reminder) } %>
<% end %>
<%= actions_row.with_column(flex_layout: true) do |actions_sub_row| %>
<%= actions_sub_row.with_column(mr: 2) do %>
<%= render(Primer::Beta::Button.new(**cancel_button_props)) { I18n.t(:button_cancel) } %>
<% end %>
<%= actions_sub_row.with_column do %>
- <%= render(Primer::Beta::Button.new(scheme: :primary,
- type: :submit)) { I18n.t(:button_save) } %>
+ <%= render(
+ Primer::Beta::Button.new(
+ scheme: :primary,
+ type: :submit
+ )
+ ) { I18n.t(:button_save) } %>
<% end %>
<% end %>
<% end %>
<% else %>
- <%= form_flex_container.with_row(flex_layout: true,
- justify_content: :flex_end) do |actions_row| %>
+ <%= form_flex_container.with_row(
+ flex_layout: true,
+ justify_content: :flex_end
+ ) do |actions_row| %>
<%= actions_row.with_column(mr: 2) do %>
<%= render(Primer::Beta::Button.new(**cancel_button_props)) { I18n.t(:button_cancel) } %>
<% end %>
<%= actions_row.with_column do %>
- <%= render(Primer::Beta::Button.new(scheme: :primary,
- type: :submit)) { I18n.t(:button_set_reminder) } %>
+ <%= render(
+ Primer::Beta::Button.new(
+ scheme: :primary,
+ type: :submit
+ )
+ ) { I18n.t(:button_set_reminder) } %>
<% end %>
<% end %>
<% end %>
diff --git a/app/components/work_packages/status_button_component.html.erb b/app/components/work_packages/status_button_component.html.erb
index 5c28c8fa34f..3550328d880 100644
--- a/app/components/work_packages/status_button_component.html.erb
+++ b/app/components/work_packages/status_button_component.html.erb
@@ -13,9 +13,11 @@
end
@items.each do |item|
- menu.with_item(label: item.name,
- content_arguments: { classes: "__hl_inline_status_#{item.id}",
- align_items: :center }) do |menu_item|
+ menu.with_item(
+ label: item.name,
+ content_arguments: { classes: "__hl_inline_status_#{item.id}",
+ align_items: :center }
+ ) do |menu_item|
menu_item.with_trailing_visual_icon(icon: :lock) if item.is_readonly?
end
end
diff --git a/app/components/workflows/page_header_component.html.erb b/app/components/workflows/page_header_component.html.erb
index 8ba1be2e573..0c989933946 100644
--- a/app/components/workflows/page_header_component.html.erb
+++ b/app/components/workflows/page_header_component.html.erb
@@ -32,24 +32,28 @@ See COPYRIGHT and LICENSE files for more details.
header.with_title { title }
header.with_breadcrumbs(breadcrumb_items)
- header.with_action_button(tag: :a,
- mobile_icon: :copy,
- mobile_label: t(:button_copy),
- size: :medium,
- href: copy_workflows_path,
- aria: { label: I18n.t(:button_copy) },
- title: I18n.t(:button_copy)) do |button|
+ header.with_action_button(
+ tag: :a,
+ mobile_icon: :copy,
+ mobile_label: t(:button_copy),
+ size: :medium,
+ href: copy_workflows_path,
+ aria: { label: I18n.t(:button_copy) },
+ title: I18n.t(:button_copy)
+ ) do |button|
button.with_leading_visual_icon(icon: :copy)
t(:button_copy)
end
- header.with_action_button(tag: :a,
- mobile_icon: :info,
- mobile_label: t(:label_workflow_summary),
- size: :medium,
- href: workflows_path,
- aria: { label: I18n.t(:label_workflow_summary) },
- title: I18n.t(:label_workflow_summary)) do |button|
+ header.with_action_button(
+ tag: :a,
+ mobile_icon: :info,
+ mobile_label: t(:label_workflow_summary),
+ size: :medium,
+ href: workflows_path,
+ aria: { label: I18n.t(:label_workflow_summary) },
+ title: I18n.t(:label_workflow_summary)
+ ) do |button|
button.with_leading_visual_icon(icon: :info)
t(:label_workflow_summary)
end
diff --git a/app/views/account/_login.html.erb b/app/views/account/_login.html.erb
index 42b76029495..698cd87df3d 100644
--- a/app/views/account/_login.html.erb
+++ b/app/views/account/_login.html.erb
@@ -28,8 +28,10 @@ See COPYRIGHT and LICENSE files for more details.
++#%>
- <%= styled_form_tag({controller: "/account", action: "login"},
- autocomplete: "off", class: "-vertical") do %>
+ <%= styled_form_tag(
+ { controller: "/account", action: "login" },
+ autocomplete: "off", class: "-vertical"
+ ) do %>
<%= back_url_to_current_page_hidden_field_tag %>
@@ -47,8 +49,8 @@ See COPYRIGHT and LICENSE files for more details.
<% elsif Setting::SelfRegistration.enabled? %>
<%# show here if autologin is disabled, otherwise below lost_password link %>
<%= link_to t(:label_register),
- account_register_path,
- title: t(:label_register) %>
+ account_register_path,
+ title: t(:label_register) %>
<% end %>
@@ -60,14 +62,14 @@ See COPYRIGHT and LICENSE files for more details.
diff --git a/app/views/account/_password_login_form.html.erb b/app/views/account/_password_login_form.html.erb
index 7c9e540acf7..98903b8bc75 100644
--- a/app/views/account/_password_login_form.html.erb
+++ b/app/views/account/_password_login_form.html.erb
@@ -28,11 +28,11 @@ See COPYRIGHT and LICENSE files for more details.
++#%>
<%= styled_form_tag(
- {action: "login"},
+ { action: "login" },
autocomplete: "off",
class: "-wide-labels user-login--form",
data: { turbo: false } # allow redirects without turbo
- ) do %>
+ ) do %>
<%= back_url_hidden_field_tag %>
diff --git a/app/views/account/_register.html.erb b/app/views/account/_register.html.erb
index e3826390099..586b3793027 100644
--- a/app/views/account/_register.html.erb
+++ b/app/views/account/_register.html.erb
@@ -31,7 +31,8 @@ See COPYRIGHT and LICENSE files for more details.
@user,
url: account_register_path,
data: { turbo: false },
- html: { class: "form -wide-labels spot-modal" }) do |f| %>
+ html: { class: "form -wide-labels spot-modal" }
+ ) do |f| %>
<%= back_url_hidden_field_tag use_referer: false %>
<%= error_messages_for :user %>
<%= avatar(comment.author) %><%= authoring comment.created_at, comment.author %>
<%= format_text(comment.comments, object: comment) %> diff --git a/app/views/oauth/applications/_form.html.erb b/app/views/oauth/applications/_form.html.erb index 56eda0fbdb1..e8ed22fc5fb 100644 --- a/app/views/oauth/applications/_form.html.erb +++ b/app/views/oauth/applications/_form.html.erb @@ -80,9 +80,11 @@ See COPYRIGHT and LICENSE files for more details.- <%= t("oauth.client_credentials_impersonation_html", + <%= t( + "oauth.client_credentials_impersonation_html", client_credentials_flow_link: static_link_to(:client_credentials_code_flow), - authorization_code_flow_link: static_link_to(:oauth_authorization_code_flow)) %> + authorization_code_flow_link: static_link_to(:oauth_authorization_code_flow) + ) %>
<%= flash[:_application_secret] %>@@ -53,8 +53,8 @@ See COPYRIGHT and LICENSE files for more details. <% if user_id = @application.client_credentials_user_id %> <% component.with_attribute( - key: t("oauth.client_credentials_impersonation_set_to") - ) do %> + key: t("oauth.client_credentials_impersonation_set_to") + ) do %> <%= link_to_user User.find_by(id: user_id) %>
<%= t("oauth.client_credentials_impersonation_warning") %> @@ -62,34 +62,34 @@ See COPYRIGHT and LICENSE files for more details. <% end %> <% component.with_attribute( - key: @application.class.human_attribute_name(:scopes), - value: oauth_scope_translations(@application) - ) %> + key: @application.class.human_attribute_name(:scopes), + value: oauth_scope_translations(@application) + ) %> <% component.with_attribute( - key: @application.class.human_attribute_name(:confidential), - value: @application.confidential? ? t(:general_text_Yes) : t(:general_text_No) - ) %> + key: @application.class.human_attribute_name(:confidential), + value: @application.confidential? ? t(:general_text_Yes) : t(:general_text_No) + ) %> <% component.with_attribute( - key: @application.class.human_attribute_name(:enabled), - value: @application.enabled? ? t(:general_text_Yes) : t(:general_text_No) - ) %> + key: @application.class.human_attribute_name(:enabled), + value: @application.enabled? ? t(:general_text_Yes) : t(:general_text_No) + ) %> <% component.with_attribute( - key: @application.class.human_attribute_name(:redirect_uri), - value: safe_join(@application.redirect_uri.split("\n"), tag(:br)) - ) %> + key: @application.class.human_attribute_name(:redirect_uri), + value: safe_join(@application.redirect_uri.split("\n"), tag(:br)) + ) %> <% if !@application.client_credentials_user_id %> <% component.with_attribute( - key: I18n.t(:'doorkeeper.auth_url'), - value: oauth_authorization_url - ) %> + key: I18n.t(:'doorkeeper.auth_url'), + value: oauth_authorization_url + ) %> <% end %> <% component.with_attribute( - key: I18n.t(:'doorkeeper.access_token_url'), - value: oauth_token_url - ) %> + key: I18n.t(:'doorkeeper.access_token_url'), + value: oauth_token_url + ) %> <% end %> diff --git a/app/views/placeholder_users/_form.html.erb b/app/views/placeholder_users/_form.html.erb index f2366f0bc3c..6a99fea2312 100644 --- a/app/views/placeholder_users/_form.html.erb +++ b/app/views/placeholder_users/_form.html.erb @@ -31,7 +31,7 @@ See COPYRIGHT and LICENSE files for more details.
- <%= t("placeholder_users.deletion_info.heading", - name: content_tag(:em, name)) + <%= t( + "placeholder_users.deletion_info.heading", + name: content_tag(:em, name) + ) .html_safe %>
@@ -52,16 +55,17 @@ See COPYRIGHT and LICENSE files for more details. <%= t("placeholder_users.deletion_info.irreversible") %>- <%= t("placeholder_users.deletion_info.confirmation", + <%= t( + "placeholder_users.deletion_info.confirmation", name: content_tag(:em, name, class: "danger-zone--expected-value") ).html_safe %>
<% end %> diff --git a/app/views/projects/copy.html.erb b/app/views/projects/copy.html.erb index 3a0b9d25452..1ab2ee5fd15 100644 --- a/app/views/projects/copy.html.erb +++ b/app/views/projects/copy.html.erb @@ -33,8 +33,11 @@ See COPYRIGHT and LICENSE files for more details. <%= render Primer::OpenProject::PageHeader.new do |header| header.with_title { title } - header.with_breadcrumbs([{ href: project_overview_path(@project.id), text: @project.name }, - { href: project_settings_general_path(@project.id), text: I18n.t("label_project_settings") }, - title ]) end + header.with_breadcrumbs( + [{ href: project_overview_path(@project.id), text: @project.name }, + { href: project_settings_general_path(@project.id), text: I18n.t("label_project_settings") }, + title] + ) + end %> <%= angular_component_tag "opce-copy-project" %> diff --git a/app/views/projects/destroy_info.html.erb b/app/views/projects/destroy_info.html.erb index ad6ed8fbe7a..a0811099322 100644 --- a/app/views/projects/destroy_info.html.erb +++ b/app/views/projects/destroy_info.html.erb @@ -29,15 +29,20 @@ See COPYRIGHT and LICENSE files for more details. <%= render Primer::OpenProject::PageHeader.new do |header| header.with_title { t("project.destroy.title", name: @project_to_destroy) } - header.with_breadcrumbs([{ href: project_overview_path(@project_to_destroy.id), text: @project_to_destroy.name }, - { href: project_settings_general_path(@project_to_destroy.id), text: I18n.t("label_project_settings") }, - t("project.destroy.title", name: @project_to_destroy)]) end + header.with_breadcrumbs( + [{ href: project_overview_path(@project_to_destroy.id), text: @project_to_destroy.name }, + { href: project_settings_general_path(@project_to_destroy.id), text: I18n.t("label_project_settings") }, + t("project.destroy.title", name: @project_to_destroy)] + ) + end %> -<%= styled_form_tag(project_path(@project_to_destroy), - class: "danger-zone", - data: { turbo: false }, - method: :delete) do %> +<%= styled_form_tag( + project_path(@project_to_destroy), + class: "danger-zone", + data: { turbo: false }, + method: :delete + ) do %><%= styled_button_tag t(:button_add), class: "-with-icon icon-checkmark" %>
<%= t("project.destroy.title", name: "#{h(@project_to_destroy)}").html_safe %> @@ -66,9 +71,9 @@ See COPYRIGHT and LICENSE files for more details.
<%= styled_button_tag title: t(:button_delete), class: "-primary", disabled: true do
- concat content_tag :i, "", class: "button--icon icon-delete"
- concat content_tag :span, t(:button_delete), class: "button--text"
- end %>
+ concat content_tag :i, "", class: "button--icon icon-delete"
+ concat content_tag :span, t(:button_delete), class: "button--text"
+ end %>
<%= link_to projects_path,
title: t(:button_cancel),
class: "button -with-icon icon-cancel" do %>
diff --git a/app/views/projects/identifier/show.html.erb b/app/views/projects/identifier/show.html.erb
index c7e31e15b25..a0209aa6c83 100644
--- a/app/views/projects/identifier/show.html.erb
+++ b/app/views/projects/identifier/show.html.erb
@@ -30,9 +30,12 @@ See COPYRIGHT and LICENSE files for more details.
<%=
render Primer::OpenProject::PageHeader.new do |header|
header.with_title { t("project.identifier.title") }
- header.with_breadcrumbs([{ href: project_overview_path(@project.id), text: @project.name },
- { href: project_settings_general_path(@project.id), text: I18n.t("label_project_settings") },
- t("project.identifier.title")]) end
+ header.with_breadcrumbs(
+ [{ href: project_overview_path(@project.id), text: @project.name },
+ { href: project_settings_general_path(@project.id), text: I18n.t("label_project_settings") },
+ t("project.identifier.title")]
+ )
+ end
%>
<%= error_messages_for @project %>
@@ -70,8 +73,10 @@ See COPYRIGHT and LICENSE files for more details.
- <%= t(:text_length_between, min: 1,
- max: Project::IDENTIFIER_MAX_LENGTH) %>
+ <%= t(
+ :text_length_between, min: 1,
+ max: Project::IDENTIFIER_MAX_LENGTH
+ ) %>
<%= t(:text_project_identifier_info).html_safe %>
diff --git a/app/views/projects/index.html.erb b/app/views/projects/index.html.erb
index abefbf9cc75..ca0ccdac36f 100644
--- a/app/views/projects/index.html.erb
+++ b/app/views/projects/index.html.erb
@@ -38,8 +38,9 @@ See COPYRIGHT and LICENSE files for more details.
) %>
<%= render(Projects::IndexSubHeaderComponent.new(query:, current_user:, disable_buttons: state === :rename)) %>
<%= render Projects::TableComponent.new(
- query:,
- current_user: current_user,
- params:) %>
+ query:,
+ current_user: current_user,
+ params:
+ ) %>
<%= render Projects::DiskUsageInformationComponent.new(current_user: current_user) %>
diff --git a/app/views/projects/new.html.erb b/app/views/projects/new.html.erb
index 794bc43dc58..9837b2701d4 100644
--- a/app/views/projects/new.html.erb
+++ b/app/views/projects/new.html.erb
@@ -29,8 +29,8 @@ See COPYRIGHT and LICENSE files for more details.
<% html_title t("label_project_new") %>
<%=
render(Primer::OpenProject::PageHeader.new) do |header|
- header.with_title { t(:label_project_new)}
- header.with_breadcrumbs([{ href: home_path, text: organization_name}, t(:label_project_new)])
+ header.with_title { t(:label_project_new) }
+ header.with_breadcrumbs([{ href: home_path, text: organization_name }, t(:label_project_new)])
end
%>
<%= angular_component_tag "opce-new-project" %>
diff --git a/app/views/projects/settings/categories/show.html.erb b/app/views/projects/settings/categories/show.html.erb
index 30d21e5ca8c..ff8e71e0cf3 100644
--- a/app/views/projects/settings/categories/show.html.erb
+++ b/app/views/projects/settings/categories/show.html.erb
@@ -29,21 +29,24 @@ See COPYRIGHT and LICENSE files for more details.
<%=
render Primer::OpenProject::PageHeader.new do |header|
header.with_title { t(:label_work_package_category_plural) }
- header.with_breadcrumbs([{ href: project_overview_path(@project.id), text: @project.name },
- { href: project_settings_general_path(@project.id), text: I18n.t("label_project_settings") },
- t(:label_work_package_category_plural)
- ])
+ header.with_breadcrumbs(
+ [{ href: project_overview_path(@project.id), text: @project.name },
+ { href: project_settings_general_path(@project.id), text: I18n.t("label_project_settings") },
+ t(:label_work_package_category_plural)]
+ )
end
%>
<% if current_user.allowed_in_project?(:manage_categories, @project) %>
<%=
render(Primer::OpenProject::SubHeader.new) do |subheader|
- subheader.with_action_button(scheme: :primary,
- aria: { label: t(:label_work_package_category_new) },
- title: t(:label_work_package_category_new),
- tag: :a,
- href: url_for({ controller: "/categories", action: "new", project_id: @project })) do |button|
+ subheader.with_action_button(
+ scheme: :primary,
+ aria: { label: t(:label_work_package_category_new) },
+ title: t(:label_work_package_category_new),
+ tag: :a,
+ href: url_for({ controller: "/categories", action: "new", project_id: @project })
+ ) do |button|
button.with_leading_visual_icon(icon: :plus)
t("activerecord.models.category")
end
diff --git a/app/views/projects/settings/custom_fields/show.html.erb b/app/views/projects/settings/custom_fields/show.html.erb
index fcdc41cd301..7d1a94d91d2 100644
--- a/app/views/projects/settings/custom_fields/show.html.erb
+++ b/app/views/projects/settings/custom_fields/show.html.erb
@@ -30,20 +30,24 @@ See COPYRIGHT and LICENSE files for more details.
<%=
render Primer::OpenProject::PageHeader.new do |header|
header.with_title { I18n.t(:label_custom_field_plural) }
- header.with_breadcrumbs( [ { href: project_overview_path(@project.id), text: @project.name },
- { href: project_settings_general_path(@project.id), text: I18n.t("label_project_settings") },
- I18n.t(:label_custom_field_plural)])
+ header.with_breadcrumbs(
+ [{ href: project_overview_path(@project.id), text: @project.name },
+ { href: project_settings_general_path(@project.id), text: I18n.t("label_project_settings") },
+ I18n.t(:label_custom_field_plural)]
+ )
end
%>
<%=
if current_user.admin?
render(Primer::OpenProject::SubHeader.new) do |subheader|
- subheader.with_action_button(scheme: :primary,
- aria: { label: t(:label_custom_field_new)},
- title: I18n.t(:label_custom_field_new),
- tag: :a,
- href: new_custom_field_path(type: "WorkPackageCustomField")) do |button|
+ subheader.with_action_button(
+ scheme: :primary,
+ aria: { label: t(:label_custom_field_new) },
+ title: I18n.t(:label_custom_field_new),
+ tag: :a,
+ href: new_custom_field_path(type: "WorkPackageCustomField")
+ ) do |button|
button.with_leading_visual_icon(icon: :plus)
CustomField.model_name.human
end
diff --git a/app/views/projects/settings/life_cycle_steps/index.html.erb b/app/views/projects/settings/life_cycle_steps/index.html.erb
index 05e2233b8a8..65805a9c311 100644
--- a/app/views/projects/settings/life_cycle_steps/index.html.erb
+++ b/app/views/projects/settings/life_cycle_steps/index.html.erb
@@ -29,5 +29,9 @@ See COPYRIGHT and LICENSE files for more details.
<%= render(Projects::Settings::LifeCycleSteps::IndexPageHeaderComponent.new(project: @project)) %>
-<%= render(Projects::Settings::LifeCycleSteps::IndexComponent.new(project: @project,
- life_cycle_definitions: @life_cycle_definitions)) %>
+<%= render(
+ Projects::Settings::LifeCycleSteps::IndexComponent.new(
+ project: @project,
+ life_cycle_definitions: @life_cycle_definitions
+ )
+ ) %>
diff --git a/app/views/projects/settings/modules/_form.html.erb b/app/views/projects/settings/modules/_form.html.erb
index 0627c95ebde..da66258b55d 100644
--- a/app/views/projects/settings/modules/_form.html.erb
+++ b/app/views/projects/settings/modules/_form.html.erb
@@ -34,18 +34,20 @@ See COPYRIGHT and LICENSE files for more details.
<%= form.collection_check_box :enabled_module_names,
- name,
- @project.module_enabled?(name),
- l_or_humanize(name, prefix: "project_module_"),
- no_label: true %>
+ name,
+ @project.module_enabled?(name),
+ l_or_humanize(name, prefix: "project_module_"),
+ no_label: true %>
/path/to/repository/.git") %><%= t("repositories.managed_remote_note") %>
@@ -40,13 +41,14 @@ See COPYRIGHT and LICENSE files for more details.file://") %> @@ -45,21 +46,25 @@ See COPYRIGHT and LICENSE files for more details.- <%= link_to_if action_name != "changes", t(:label_history), {action: "changes", project_id: @project, repo_path: to_path_param(@path), rev: @rev } %> | + <%= link_to_if action_name != "changes", t(:label_history), { action: "changes", project_id: @project, repo_path: to_path_param(@path), rev: @rev } %> | <% if @repository.supports_cat? %> <%= link_to_if action_name != "entry", t(:button_view), entry_revision_project_repository_path(project_id: @project, repo_path: to_path_param(@path), rev: @rev) %> | <% end %> <% if @repository.supports_annotate? %> - <%= link_to_if action_name != "annotate", t(:button_annotate), {action: "annotate", project_id: @project, repo_path: to_path_param(@path), rev: @rev } %> | + <%= link_to_if action_name != "annotate", t(:button_annotate), { action: "annotate", project_id: @project, repo_path: to_path_param(@path), rev: @rev } %> | <% end %> - <%= link_to(t(:button_download), {action: "entry", project_id: @project, repo_path: to_path_param(@path), rev: @rev, format: "raw" }) if @repository.supports_cat? %> + <%= link_to(t(:button_download), { action: "entry", project_id: @project, repo_path: to_path_param(@path), rev: @rev, format: "raw" }) if @repository.supports_cat? %> <%= "(#{number_to_human_size(@entry.size)})" if @entry.size %>
<% end %> diff --git a/app/views/repositories/_repository_header.html.erb b/app/views/repositories/_repository_header.html.erb index 774502fae40..878e8f31b64 100644 --- a/app/views/repositories/_repository_header.html.erb +++ b/app/views/repositories/_repository_header.html.erb @@ -28,8 +28,10 @@ See COPYRIGHT and LICENSE files for more details. ++#%><%= t("repositories.destroy.title_not_managed", repository_type: "#{h(@repository.repository_type)} - #{t(:project_module_repository)}").html_safe %>
- <%= t("repositories.destroy.subtitle_not_managed", - repository_type: "#{h(@repository.repository_type)} - #{t(:project_module_repository)}", - project_name: h(@project.identifier), - url: h(@repository.url)).html_safe %>
+ <%= t( + "repositories.destroy.subtitle_not_managed", + repository_type: "#{h(@repository.repository_type)} - #{t(:project_module_repository)}", + project_name: h(@project.identifier), + url: h(@repository.url) + ).html_safe %>
<%= t("repositories.destroy.info_not_managed") %> @@ -89,14 +94,14 @@ See COPYRIGHT and LICENSE files for more details. <%= link_to project_repository_path(@project), title: t(:button_delete), method: :delete, - data: { "test-selector": "remove-repository-button"}, + data: { "test-selector": "remove-repository-button" }, class: "button" do %> <%= op_icon("button--icon icon-remove") %> <%= t(:button_remove) %> <% end %> <%= link_to project_settings_repository_path(@project), - title: t(:button_cancel), - class: "button -with-icon icon-cancel" do %> + title: t(:button_cancel), + class: "button -with-icon icon-cancel" do %> <%= t(:button_cancel) %> <% end %>
diff --git a/app/views/repositories/empty.html.erb b/app/views/repositories/empty.html.erb index a07fdc58ee1..b96f181c6ec 100644 --- a/app/views/repositories/empty.html.erb +++ b/app/views/repositories/empty.html.erb @@ -32,5 +32,7 @@ See COPYRIGHT and LICENSE files for more details. <%= no_results_box %> -<%= call_hook(:repositories_below_empty_warning, - { repository: @repository, project: @project }) %> +<%= call_hook( + :repositories_below_empty_warning, + { repository: @repository, project: @project } + ) %> diff --git a/app/views/repositories/entry.html.erb b/app/views/repositories/entry.html.erb index a7508b6f790..2dd2bc3a724 100644 --- a/app/views/repositories/entry.html.erb +++ b/app/views/repositories/entry.html.erb @@ -38,4 +38,4 @@ See COPYRIGHT and LICENSE files for more details.<%= render partial: "link_to_functions" %>
-<%= render partial: "common/file", locals: {filename: @path, content: @content} %> +<%= render partial: "common/file", locals: { filename: @path, content: @content } %> diff --git a/app/views/repositories/revision.html.erb b/app/views/repositories/revision.html.erb index c14e8d7d9b0..bc572562464 100644 --- a/app/views/repositories/revision.html.erb +++ b/app/views/repositories/revision.html.erb @@ -43,7 +43,7 @@ See COPYRIGHT and LICENSE files for more details. <% end %>- <%= tag("embed", width: 800, - height: 300, - type: "image/svg+xml", - src: url_for(controller: "/repositories", - action: "graph", - project_id: @project.id, - graph: "commits_per_month")) %> + <%= tag( + "embed", width: 800, + height: 300, + type: "image/svg+xml", + src: url_for( + controller: "/repositories", + action: "graph", + project_id: @project.id, + graph: "commits_per_month" + ) + ) %>
<% if @show_commits_per_author %>- <%= tag("embed", width: 800, - height: 400, - type: "image/svg+xml", - src: url_for(controller: "/repositories", - action: "graph", - project_id: @project.id, - graph: "commits_per_author")) %> + <%= tag( + "embed", width: 800, + height: 400, + type: "image/svg+xml", + src: url_for( + controller: "/repositories", + action: "graph", + project_id: @project.id, + graph: "commits_per_author" + ) + ) %>
<% end %> diff --git a/app/views/roles/_form.html.erb b/app/views/roles/_form.html.erb index 22425a3a312..2e27d0b90e8 100644 --- a/app/views/roles/_form.html.erb +++ b/app/views/roles/_form.html.erb @@ -41,12 +41,14 @@ See COPYRIGHT and LICENSE files for more details. <% if role.new_record? %> <%= styled_label_tag :global_role, t(:label_global_role) %>