Update SubHeader implementations to new mobile requirements in version 0.66.1

This commit is contained in:
Henriette Darge
2025-05-19 12:29:45 +02:00
parent 3913e1e028
commit d7c006ce82
63 changed files with 398 additions and 470 deletions
+1 -1
View File
@@ -418,4 +418,4 @@ end
gem "openproject-octicons", "~>19.25.0"
gem "openproject-octicons_helper", "~>19.25.0"
gem "openproject-primer_view_components", "~>0.65.0"
gem "openproject-primer_view_components", "~>0.66.1"
+3 -3
View File
@@ -860,7 +860,7 @@ GEM
actionview
openproject-octicons (= 19.25.0)
railties
openproject-primer_view_components (0.65.0)
openproject-primer_view_components (0.66.1)
actionview (>= 7.1.0)
activesupport (>= 7.1.0)
openproject-octicons (>= 19.25.0)
@@ -1447,7 +1447,7 @@ DEPENDENCIES
openproject-octicons (~> 19.25.0)
openproject-octicons_helper (~> 19.25.0)
openproject-openid_connect!
openproject-primer_view_components (~> 0.65.0)
openproject-primer_view_components (~> 0.66.1)
openproject-recaptcha!
openproject-reporting!
openproject-storages!
@@ -1818,7 +1818,7 @@ CHECKSUMS
openproject-octicons (19.25.0) sha256=16fc221375e693f0e893b1c208286f2d7719ae4dfe080c5415642b221f51f550
openproject-octicons_helper (19.25.0) sha256=9b1778a67b0015ebe84ca0471f74e31004b985a8dcaaa443f7a2ac365b0a4e2d
openproject-openid_connect (1.0.0)
openproject-primer_view_components (0.65.0) sha256=d8d4ebeb90648e158e270845e9c336497f225bd8b608f08512264682b4fcd9ee
openproject-primer_view_components (0.66.1) sha256=dec183877f43435118f8bf1127fdfd4661ab0d1cf3b84bb70a96b6f3940aded9
openproject-recaptcha (1.0.0)
openproject-reporting (1.0.0)
openproject-storages (1.0.0)
+14 -14
View File
@@ -1,14 +1,14 @@
<%= render(
Primer::Beta::Button.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 %>
<%=
subheader.with_action_button(
scheme: :primary,
leading_icon: leading_icon,
label: aria_label,
title:,
tag: :a,
id:,
href: dynamic_path,
test_selector:
) do
label_text
end
%>
+15 -1
View File
@@ -30,7 +30,13 @@
#
class AddButtonComponent < ApplicationComponent
options :current_project
attr_reader :subheader, :current_project
def initialize(subheader:, current_project: nil)
super
@subheader = subheader
@current_project = current_project
end
def render?
raise "Implement the conditions for which the component should render or not"
@@ -44,6 +50,14 @@ class AddButtonComponent < ApplicationComponent
raise "Implement the id for this component"
end
def test_selector
raise "Implement the test_selector for this component"
end
def leading_icon
:plus
end
def title
accessibility_label_text
end
@@ -34,8 +34,11 @@ See COPYRIGHT and LICENSE files for more details.
flex_layout do |container|
container.with_row do
render(Primer::OpenProject::SubHeader.new) do |subheader|
subheader.with_action_button(tag: :a, scheme: :primary, href: new_item_path) do |button|
button.with_leading_visual_icon(icon: :plus)
subheader.with_action_button(tag: :a,
scheme: :primary,
leading_icon: :plus,
label: t(:label_item),
href: new_item_path) do
I18n.t(:label_item)
end
end
@@ -5,11 +5,12 @@ component_wrapper do
render(Primer::OpenProject::SubHeader.new) do |subheader|
subheader.with_action_button(
scheme: :primary,
leading_icon: :plus,
label: t(:button_add),
tag: :a,
href: helpers.url_for(action: :new),
test_selector: "add-enumeration-button"
) do |button|
button.with_leading_visual_icon(icon: :plus)
) do
I18n.t(:button_add)
end
end
@@ -1,8 +1,6 @@
<%= 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
@@ -11,12 +9,11 @@
subheader.with_action_button(
scheme: :primary,
aria: { label: I18n.t(:button_add_member) },
title: I18n.t(:button_add_member),
leading_icon: :plus,
label: t(:button_add_member),
id: "add-member-button",
data: add_button_data_attributes
) do |button|
button.with_leading_visual_icon(icon: :plus)
) do
t("activerecord.models.member")
end
@@ -1,21 +1,21 @@
<%= 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
subheader.with_segmented_control("aria-label": I18n.t(:label_filter_plural)) do |control|
control.with_item(
tag: :a,
icon: :unread,
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,
icon: :read,
href: notifications_path(facet: "all", **current_filters),
label: t("notifications.facets.all"),
title: t("notifications.facets.all_title"),
selected: @facet == "all"
)
end
subheader.with_action_button(
@@ -23,11 +23,11 @@
href: mark_all_read_notifications_path(**current_filters),
data: { method: :post, confirm: I18n.t("js.notifications.center.mark_all_read_confirmation") },
size: :medium,
aria: { label: I18n.t("js.notifications.center.mark_all_read") },
leading_icon: :"op-read-all",
label: I18n.t("js.notifications.center.mark_all_read"),
disabled: !unread_notifications?,
test_selector: "mark-all-as-read-button"
) do |button|
button.with_leading_visual_icon(icon: :"op-read-all")
) do
I18n.t("js.notifications.center.mark_all_read")
end
end %>
@@ -22,12 +22,12 @@
tag: :a,
href: new_project_path,
scheme: :primary,
leading_icon: :plus,
label: I18n.t(:label_project_new),
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)
) do
Project.model_name.human
end
end
@@ -0,0 +1,11 @@
<%= render(
Primer::Alpha::Dialog.new(
title: t("settings.project_attributes.label_new_section"),
size: :medium_portrait,
id: MODAL_ID
)
) do |d| %>
<% d.with_body do %>
<%= render(Settings::ProjectCustomFieldSections::DialogBodyFormComponent.new) %>
<% end %>
<% end %>
@@ -1,4 +1,3 @@
# frozen_string_literal: true
#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) the OpenProject GmbH
@@ -27,32 +26,13 @@
# See COPYRIGHT and LICENSE files for more details.
#++
module Meetings
class CombinedFilterComponent < ApplicationComponent
include ApplicationHelper
include OpTurbo::Streamable
include OpPrimer::ComponentHelpers
include Redmine::I18n
module Settings
module ProjectCustomFieldSections
class NewSectionDialogComponent < ApplicationComponent
include OpTurbo::Streamable
def initialize(query:, params:, project: nil)
super()
@query = query
@project = project
@params = params
end
def dynamic_path(upcoming: true)
polymorphic_path([@project, :meetings], current_params.merge(upcoming:))
end
def upcoming_query?
filter = @query.filters.find { |f| f.name == :time }
filter ? !filter.past? : true
end
def current_params
@current_params ||= params.slice(:filters, :page, :per_page).permit!
MODAL_ID = "project-custom-field-section-dialog"
FORM_ID = "project-custom-field-section-dialog-form"
end
end
end
@@ -9,27 +9,22 @@
<%=
render Primer::OpenProject::SubHeader.new do |subheader|
subheader.with_action_component do
render(Primer::Alpha::Dialog.new(id: "project-custom-field-section-dialog", title: t("settings.project_attributes.label_new_section"), size: :medium_portrait)) do |dialog|
dialog.with_show_button("aria-label": t("settings.project_attributes.label_new_section")) do |button|
button.with_leading_visual_icon(icon: :plus)
t("settings.project_attributes.label_new_section")
end
dialog.with_body do
render(Settings::ProjectCustomFieldSections::DialogBodyFormComponent.new)
end
end
subheader.with_action_button(leading_icon: :plus,
label: t("settings.project_attributes.label_new_section"),
tag: :a,
href: new_link_admin_settings_project_custom_field_sections_path,
data: { controller: "async-dialog" }) do
t("settings.project_attributes.label_new_section")
end
subheader.with_action_button(
tag: :a,
href: new_admin_settings_project_custom_field_path(type: "ProjectCustomField"),
scheme: :primary,
leading_icon: :plus,
label: t("settings.project_attributes.label_new_attribute"),
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)
) do
t("settings.project_attributes.label_new_attribute")
end
end
@@ -48,18 +48,13 @@ See COPYRIGHT and LICENSE files for more details.
"projects--settings--border-box-filter-target": "filter"
}
)
subheader.with_action_component do
render(
Primer::Beta::Button.new(
scheme: :primary,
aria: { label: I18n.t("settings.project_phase_definitions.label_add_description") },
tag: :a,
href: new_admin_settings_project_phase_definition_path
)
) do |button|
button.with_leading_visual_icon(icon: :plus)
I18n.t("settings.project_phase_definitions.label_add")
end
subheader.with_action_button(scheme: :primary,
leading_icon: :plus,
label: I18n.t("settings.project_phase_definitions.label_add_description"),
tag: :a,
href: new_admin_settings_project_phase_definition_path) do
I18n.t("settings.project_phase_definitions.label_add")
end
end
else
@@ -2,12 +2,11 @@
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),
leading_icon: :plus,
label: t(:label_user_new),
tag: :a,
href: new_user_path
) do |button|
button.with_leading_visual_icon(icon: :plus)
) do
t("activerecord.models.user")
end
@@ -31,13 +31,12 @@ See COPYRIGHT and LICENSE files for more details.
render(Primer::OpenProject::SubHeader.new) do |subheader|
subheader.with_action_button(
scheme: :primary,
aria: { label: t("wiki.index.no_results_content_text") },
title: t("wiki.index.no_results_content_text"),
leading_icon: :plus,
label: t("wiki.index.no_results_content_text"),
tag: :a,
test_selector: "wiki-new-child-button",
href: url_for({ controller: "/wiki", action: "new_child", project_id: @project.identifier, id: @page })
) do |button|
button.with_leading_visual_icon(icon: :plus)
) do
t(:create_wiki_page_button)
end
end
@@ -30,6 +30,7 @@ module Admin::Settings
class ProjectCustomFieldSectionsController < ::Admin::SettingsController
include OpTurbo::ComponentStream
include Admin::Settings::ProjectCustomFields::ComponentStreams
include OpTurbo::DialogStreamHelper
before_action :set_project_custom_field_section, only: %i[update move drop destroy]
@@ -102,6 +103,10 @@ module Admin::Settings
respond_with_turbo_streams
end
def new_link
respond_with_dialog Settings::ProjectCustomFieldSections::NewSectionDialogComponent.new
end
private
def set_project_custom_field_section
@@ -41,18 +41,13 @@ See COPYRIGHT and LICENSE files for more details.
<%=
unless @custom_field.is_for_all?
render(Primer::OpenProject::SubHeader.new(test_selector: "add-projects-sub-header")) do |component|
component.with_action_component do
render(
Primer::Beta::Button.new(
scheme: :primary,
tag: :a,
href: new_custom_field_project_path(@custom_field),
data: { controller: "async-dialog" }
)
) do |button|
button.with_leading_visual_icon(icon: "op-include-projects")
I18n.t(:label_add_projects)
end
component.with_action_button(scheme: :primary,
leading_icon: :"op-include-projects",
label: I18n.t(:label_add_projects),
tag: :a,
href: new_custom_field_project_path(@custom_field),
data: { controller: "async-dialog" }) do
I18n.t(:label_add_projects)
end
end
end
@@ -39,18 +39,13 @@ See COPYRIGHT and LICENSE files for more details.
<%=
unless @custom_field.required?
render(Primer::OpenProject::SubHeader.new(test_selector: "add-projects-sub-header")) do |component|
component.with_action_component do
render(
Primer::Beta::Button.new(
scheme: :primary,
tag: :a,
href: new_link_admin_settings_project_custom_field_path(@custom_field),
data: { controller: "async-dialog" }
)
) do |button|
button.with_leading_visual_icon(icon: "op-include-projects")
I18n.t(:label_add_projects)
end
component.with_action_button(scheme: :primary,
leading_icon: :"op-include-projects",
label: I18n.t(:label_add_projects),
tag: :a,
href: new_link_admin_settings_project_custom_field_path(@custom_field),
data: { controller: "async-dialog" }) do
I18n.t(:label_add_projects)
end
end
end
@@ -48,13 +48,12 @@ See COPYRIGHT and LICENSE files for more details.
render(Primer::OpenProject::SubHeader.new) do |subheader|
subheader.with_action_button(
scheme: :primary,
aria: { label: I18n.t("attribute_help_texts.add_new") },
title: I18n.t("attribute_help_texts.add_new"),
leading_icon: :plus,
label: t(:"attribute_help_texts.add_new"),
tag: :a,
href: new_attribute_help_text_path(name: selected_tab(tabs)[:name]),
test_selector: "attribute-help-texts--create-button"
) do |button|
button.with_leading_visual_icon(icon: :plus)
) do
t("activerecord.models.attribute_help_text")
end
end
+3 -4
View File
@@ -42,12 +42,11 @@ See COPYRIGHT and LICENSE files for more details.
render(Primer::OpenProject::SubHeader.new) do |subheader|
subheader.with_action_button(
scheme: :primary,
aria: { label: I18n.t("colors.index.label_new_color") },
title: I18n.t("colors.index.label_new_color"),
leading_icon: :plus,
label: I18n.t("colors.index.label_new_color"),
tag: :a,
href: new_color_path
) do |button|
button.with_leading_visual_icon(icon: :plus)
) do
t("activerecord.attributes.type.color")
end
end
+3 -4
View File
@@ -15,13 +15,12 @@
render(Primer::OpenProject::SubHeader.new) do |subheader|
subheader.with_action_button(
scheme: :primary,
aria: { label: I18n.t("custom_actions.new") },
title: I18n.t("custom_actions.new"),
leading_icon: :plus,
label: t("custom_actions.new"),
test_selector: "op-admin-custom-actions--button-new",
tag: :a,
href: new_custom_action_path
) do |button|
button.with_leading_visual_icon(icon: :plus)
) do
CustomAction.model_name.human
end
end
+3 -4
View File
@@ -35,12 +35,11 @@ See COPYRIGHT and LICENSE files for more details.
render(Primer::OpenProject::SubHeader.new) do |subheader|
subheader.with_action_button(
scheme: :primary,
aria: { label: I18n.t(:label_custom_field_new) },
title: I18n.t(:label_custom_field_new),
leading_icon: :plus,
label: t(:label_custom_field_new),
tag: :a,
href: new_custom_field_path(type: selected_tab(custom_fields_tabs)[:name])
) do |button|
button.with_leading_visual_icon(icon: :plus)
) do
t("activerecord.models.custom_field")
end
end
+3 -4
View File
@@ -43,12 +43,11 @@ See COPYRIGHT and LICENSE files for more details.
render(Primer::OpenProject::SubHeader.new) do |subheader|
subheader.with_action_button(
scheme: :primary,
aria: { label: t(:label_forum_new) },
title: t(:label_forum_new),
leading_icon: :plus,
label: t(:label_forum_new),
tag: :a,
href: new_project_forum_path(@project)
) do |button|
button.with_leading_visual_icon(icon: :plus)
) do
t("activerecord.models.forum")
end
end
+3 -4
View File
@@ -67,12 +67,11 @@ See COPYRIGHT and LICENSE files for more details.
render(Primer::OpenProject::SubHeader.new) do |subheader|
if authorize_for(:messages, :new)
subheader.with_action_button(scheme: :primary,
aria: { label: t(:label_message_new) },
title: t(:label_message_new),
leading_icon: :plus,
label: t(:label_message_new),
tag: :a,
class: "add-message-button",
href: url_for({ controller: "/messages", action: "new", forum_id: @forum })) do |button|
button.with_leading_visual_icon(icon: :plus)
href: url_for({ controller: "/messages", action: "new", forum_id: @forum })) do
t(:label_message)
end
end
+3 -4
View File
@@ -44,12 +44,11 @@ See COPYRIGHT and LICENSE files for more details.
render(Primer::OpenProject::SubHeader.new) do |subheader|
subheader.with_action_button(
scheme: :primary,
aria: { label: I18n.t(:label_group_new) },
title: I18n.t(:label_group_new),
leading_icon: :plus,
label: t(:label_group_new),
tag: :a,
href: new_group_path
) do |button|
button.with_leading_visual_icon(icon: :plus)
) do
t("activerecord.models.group")
end
end
+3 -4
View File
@@ -44,13 +44,12 @@ See COPYRIGHT and LICENSE files for more details.
render(Primer::OpenProject::SubHeader.new) do |subheader|
subheader.with_action_button(
scheme: :primary,
aria: { label: I18n.t(:label_ldap_auth_source_new) },
title: I18n.t(:label_ldap_auth_source_new),
leading_icon: :plus,
label: t(:label_ldap_auth_source_new),
tag: :a,
test_selector: "op-admin-ldap-connection--button-new",
href: new_ldap_auth_source_path
) do |button|
button.with_leading_visual_icon(icon: :plus)
) do
t(:label_ldap_auth_source)
end
end
+3 -4
View File
@@ -48,14 +48,13 @@ See COPYRIGHT and LICENSE files for more details.
render(Primer::OpenProject::SubHeader.new) do |subheader|
subheader.with_action_button(
scheme: :primary,
aria: { label: t(:label_news_new) },
title: I18n.t(:label_work_package_status_new),
leading_icon: :plus,
label: t(:label_news_new),
tag: :a,
id: "new_news_link",
data: { "test-selector": "add-news-button" },
href: new_project_news_path(@project)
) do |button|
button.with_leading_visual_icon(icon: :plus)
) do
t(:label_news_singular)
end
end
+3 -4
View File
@@ -42,13 +42,12 @@ See COPYRIGHT and LICENSE files for more details.
render(Primer::OpenProject::SubHeader.new) do |subheader|
subheader.with_action_button(
scheme: :primary,
aria: { label: I18n.t("oauth.application.new") },
title: I18n.t("oauth.application.new"),
leading_icon: :plus,
label: t("oauth.application.new"),
tag: :a,
test_selector: "op-admin-oauth--button-new",
href: new_oauth_application_path
) do |button|
button.with_leading_visual_icon(icon: :plus)
) do
t("oauth.application.singular")
end
end
+3 -4
View File
@@ -45,12 +45,11 @@ See COPYRIGHT and LICENSE files for more details.
render(Primer::OpenProject::SubHeader.new) do |subheader|
subheader.with_action_button(
scheme: :primary,
aria: { label: I18n.t(:label_placeholder_user_new) },
title: I18n.t(:label_placeholder_user_new),
leading_icon: :plus,
label: t(:label_placeholder_user_new),
tag: :a,
href: new_placeholder_user_path
) do |button|
button.with_leading_visual_icon(icon: :plus)
) do
t("activerecord.models.placeholder_user")
end
@@ -41,12 +41,11 @@ See COPYRIGHT and LICENSE files for more details.
<%= render(Primer::OpenProject::SubHeader.new) do |subheader|
subheader.with_action_button(
scheme: :primary,
aria: { label: t(:label_version_new) },
title: t(:label_version_new),
leading_icon: :plus,
label: t(:label_version_new),
tag: :a,
href: url_for({ controller: "/versions", action: "new", project_id: @project })
) do |button|
button.with_leading_visual_icon(icon: :plus)
) do
t("activerecord.models.version")
end
end %>
@@ -33,12 +33,11 @@ See COPYRIGHT and LICENSE files for more details.
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),
leading_icon: :plus,
label: 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)
) do
t("activerecord.models.category")
end
end
@@ -34,12 +34,11 @@ See COPYRIGHT and LICENSE files for more details.
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),
leading_icon: :plus,
label: t(:label_custom_field_new),
tag: :a,
href: new_custom_field_path(type: "WorkPackageCustomField")
) do |button|
button.with_leading_visual_icon(icon: :plus)
) do
CustomField.model_name.human
end
end
+3 -4
View File
@@ -43,13 +43,12 @@ See COPYRIGHT and LICENSE files for more details.
render(Primer::OpenProject::SubHeader.new) do |subheader|
subheader.with_action_button(
scheme: :primary,
aria: { label: I18n.t(:label_role_new) },
title: I18n.t(:label_role_new),
leading_icon: :plus,
label: t(:label_role_new),
tag: :a,
test_selector: "roles--create-button",
href: new_role_path
) do |button|
button.with_leading_visual_icon(icon: :plus)
) do
Role.model_name.human
end
end
+3 -4
View File
@@ -43,12 +43,11 @@ See COPYRIGHT and LICENSE files for more details.
render(Primer::OpenProject::SubHeader.new) do |subheader|
subheader.with_action_button(
scheme: :primary,
aria: { label: I18n.t(:label_work_package_status_new) },
title: I18n.t(:label_work_package_status_new),
leading_icon: :plus,
label: t(:label_work_package_status_new),
tag: :a,
href: new_status_path
) do |button|
button.with_leading_visual_icon(icon: :plus)
) do
t(:label_status)
end
end
+3 -4
View File
@@ -43,13 +43,12 @@ See COPYRIGHT and LICENSE files for more details.
render(Primer::OpenProject::SubHeader.new) do |subheader|
subheader.with_action_button(
scheme: :primary,
aria: { label: I18n.t(:label_type_new) },
title: I18n.t(:label_type_new),
leading_icon: :plus,
label: t(:label_type_new),
test_selector: "op-admin-types--button-new",
tag: :a,
href: new_type_path
) do |button|
button.with_leading_visual_icon(icon: :plus)
) do
t("activerecord.attributes.work_package.type")
end
end
+3 -4
View File
@@ -40,12 +40,11 @@ See COPYRIGHT and LICENSE files for more details.
<%= render(Primer::OpenProject::SubHeader.new) do |subheader|
subheader.with_action_button(
scheme: :primary,
aria: { label: t(:label_version_new) },
title: t(:label_version_new),
leading_icon: :plus,
label: t(:label_version_new),
tag: :a,
href: url_for({ controller: "/versions", action: "new", project_id: @project })
) do |button|
button.with_leading_visual_icon(icon: :plus)
) do
t("activerecord.models.version")
end
end %>
+3
View File
@@ -590,6 +590,9 @@ Rails.application.routes.draw do
put :move
put :drop
end
collection do
get :new_link
end
end
resource :working_days_and_hours, controller: "/admin/settings/working_days_and_hours_settings", only: %i[show update]
resource :users, controller: "/admin/settings/users_settings", only: %i[show update]
+14 -14
View File
@@ -50,11 +50,11 @@
"@ngneat/content-loader": "^7.0.0",
"@ngx-formly/core": "^6.1.4",
"@openproject/octicons-angular": "^19.25.0",
"@openproject/primer-view-components": "^0.65.0",
"@openproject/primer-view-components": "^0.66.1",
"@openproject/reactivestates": "^3.0.1",
"@primer/css": "^21.5.0",
"@primer/primitives": "^9.1.2",
"@primer/view-components": "npm:@openproject/primer-view-components@^0.65.0",
"@primer/view-components": "npm:@openproject/primer-view-components@^0.66.1",
"@types/hotwired__turbo": "^8.0.1",
"@uirouter/angular": "^13.0.0",
"@uirouter/core": "^6.1.0",
@@ -4738,9 +4738,9 @@
}
},
"node_modules/@openproject/primer-view-components": {
"version": "0.65.0",
"resolved": "https://registry.npmjs.org/@openproject/primer-view-components/-/primer-view-components-0.65.0.tgz",
"integrity": "sha512-CSfkfz/cN6o8HRaIHeWGoca8Q8Bc0zA6BCcQNAd27mzbzcZlLWyoYcBiZe5625ch7Ku19cCmJKsN5b0OOVbjeg==",
"version": "0.66.1",
"resolved": "https://registry.npmjs.org/@openproject/primer-view-components/-/primer-view-components-0.66.1.tgz",
"integrity": "sha512-YME3MwSP9YSXNed875Fwz2eb0Y74p1vhUbyhcWfKmFcnN/butPsfeU2DELEuilg7K6BPk33Gf6TXQGI9DMeCww==",
"dependencies": {
"@github/auto-check-element": "^6.0.0",
"@github/auto-complete-element": "^3.8.0",
@@ -4835,9 +4835,9 @@
},
"node_modules/@primer/view-components": {
"name": "@openproject/primer-view-components",
"version": "0.65.0",
"resolved": "https://registry.npmjs.org/@openproject/primer-view-components/-/primer-view-components-0.65.0.tgz",
"integrity": "sha512-CSfkfz/cN6o8HRaIHeWGoca8Q8Bc0zA6BCcQNAd27mzbzcZlLWyoYcBiZe5625ch7Ku19cCmJKsN5b0OOVbjeg==",
"version": "0.66.1",
"resolved": "https://registry.npmjs.org/@openproject/primer-view-components/-/primer-view-components-0.66.1.tgz",
"integrity": "sha512-YME3MwSP9YSXNed875Fwz2eb0Y74p1vhUbyhcWfKmFcnN/butPsfeU2DELEuilg7K6BPk33Gf6TXQGI9DMeCww==",
"dependencies": {
"@github/auto-check-element": "^6.0.0",
"@github/auto-complete-element": "^3.8.0",
@@ -25364,9 +25364,9 @@
}
},
"@openproject/primer-view-components": {
"version": "0.65.0",
"resolved": "https://registry.npmjs.org/@openproject/primer-view-components/-/primer-view-components-0.65.0.tgz",
"integrity": "sha512-CSfkfz/cN6o8HRaIHeWGoca8Q8Bc0zA6BCcQNAd27mzbzcZlLWyoYcBiZe5625ch7Ku19cCmJKsN5b0OOVbjeg==",
"version": "0.66.1",
"resolved": "https://registry.npmjs.org/@openproject/primer-view-components/-/primer-view-components-0.66.1.tgz",
"integrity": "sha512-YME3MwSP9YSXNed875Fwz2eb0Y74p1vhUbyhcWfKmFcnN/butPsfeU2DELEuilg7K6BPk33Gf6TXQGI9DMeCww==",
"requires": {
"@github/auto-check-element": "^6.0.0",
"@github/auto-complete-element": "^3.8.0",
@@ -25439,9 +25439,9 @@
}
},
"@primer/view-components": {
"version": "npm:@openproject/primer-view-components@0.65.0",
"resolved": "https://registry.npmjs.org/@openproject/primer-view-components/-/primer-view-components-0.65.0.tgz",
"integrity": "sha512-CSfkfz/cN6o8HRaIHeWGoca8Q8Bc0zA6BCcQNAd27mzbzcZlLWyoYcBiZe5625ch7Ku19cCmJKsN5b0OOVbjeg==",
"version": "npm:@openproject/primer-view-components@0.66.1",
"resolved": "https://registry.npmjs.org/@openproject/primer-view-components/-/primer-view-components-0.66.1.tgz",
"integrity": "sha512-YME3MwSP9YSXNed875Fwz2eb0Y74p1vhUbyhcWfKmFcnN/butPsfeU2DELEuilg7K6BPk33Gf6TXQGI9DMeCww==",
"requires": {
"@github/auto-check-element": "^6.0.0",
"@github/auto-complete-element": "^3.8.0",
+2 -2
View File
@@ -102,11 +102,11 @@
"@ngneat/content-loader": "^7.0.0",
"@ngx-formly/core": "^6.1.4",
"@openproject/octicons-angular": "^19.25.0",
"@openproject/primer-view-components": "^0.65.0",
"@openproject/primer-view-components": "^0.66.1",
"@openproject/reactivestates": "^3.0.1",
"@primer/css": "^21.5.0",
"@primer/primitives": "^9.1.2",
"@primer/view-components": "npm:@openproject/primer-view-components@^0.65.0",
"@primer/view-components": "npm:@openproject/primer-view-components@^0.66.1",
"@types/hotwired__turbo": "^8.0.1",
"@uirouter/angular": "^13.0.0",
"@uirouter/core": "^6.1.0",
@@ -9,8 +9,11 @@ module OpenProject
button.with_trailing_visual_counter(count: "15")
"Filter"
end
component.with_action_button(scheme: :primary) do |button|
button.with_leading_visual_icon(icon: :plus)
component.with_action_button(
leading_icon: :plus,
label: "New item",
scheme: :primary
) do
"Create"
end
end
@@ -34,8 +37,11 @@ module OpenProject
component.with_text { text } unless text.nil?
if show_action_button
component.with_action_button(scheme: :primary) do |button|
button.with_leading_visual_icon(icon: :plus)
component.with_action_button(
leading_icon: :plus,
label: "New item",
scheme: :primary
) do
"Create"
end
end
@@ -12,13 +12,12 @@
<%= render(Primer::OpenProject::SubHeader.new) do |subheader|
subheader.with_action_button(
scheme: :primary,
aria: { label: I18n.t("saml.providers.label_add_new") },
title: I18n.t("saml.providers.label_add_new"),
leading_icon: :plus,
label: I18n.t("saml.providers.label_add_new"),
tag: :a,
disabled: !EnterpriseToken.allows_to?(:sso_auth_providers),
href: new_saml_provider_path
) do |button|
button.with_leading_visual_icon(icon: :plus)
) do
t("saml.providers.singular")
end
end %>
@@ -43,12 +43,11 @@ See COPYRIGHT and LICENSE files for more details.
<%= render(Primer::OpenProject::SubHeader.new) do |subheader|
subheader.with_action_button(
scheme: :primary,
aria: { label: t(:label_version_new) },
title: t(:label_version_new),
leading_icon: :plus,
label: I18n.t(:label_version_new),
tag: :a,
href: url_for({ controller: "/versions", action: "new", project_id: @project })
) do |button|
button.with_leading_visual_icon(icon: :plus)
) do
t("activerecord.models.version")
end
end %>
@@ -57,13 +57,12 @@ See COPYRIGHT and LICENSE files for more details.
render(Primer::OpenProject::SubHeader.new) do |subheader|
subheader.with_action_button(
scheme: :primary,
aria: { label: I18n.t("ifc_models.label_new_ifc_model") },
leading_icon: :plus,
label: I18n.t("ifc_models.label_new_ifc_model"),
data: { test_selector: "ifc-create-button" },
title: I18n.t("ifc_models.label_new_ifc_model"),
tag: :a,
href: new_bcf_project_ifc_model_path
) do |button|
button.with_leading_visual_icon(icon: :plus)
) do
::Bim::IfcModels::IfcModel.model_name.human
end
end
@@ -42,9 +42,7 @@ See COPYRIGHT and LICENSE files for more details.
<%=
render Primer::OpenProject::SubHeader.new do |subheader|
subheader.with_action_component do
render Boards::AddButtonComponent.new(current_project: @project)
end
render Boards::AddButtonComponent.new(subheader:, current_project: @project)
end
%>
@@ -41,13 +41,12 @@ See COPYRIGHT and LICENSE files for more details.
render(Primer::OpenProject::SubHeader.new) do |subheader|
subheader.with_action_button(
scheme: :primary,
aria: { label: I18n.t(:button_add_budget) },
leading_icon: :plus,
label: I18n.t(:button_add_budget),
data: { test_selector: "budget-create-button" },
title: I18n.t(:button_add_budget),
tag: :a,
href: new_projects_budget_path(@project)
) do |button|
button.with_leading_visual_icon(icon: :plus)
) do
t(:label_budget)
end
end
@@ -41,9 +41,7 @@ See COPYRIGHT and LICENSE files for more details.
<%=
render Primer::OpenProject::SubHeader.new do |subheader|
subheader.with_action_component do
render Calendar::AddButtonComponent.new(current_project: @project)
end
render Calendar::AddButtonComponent.new(subheader:, current_project: @project)
end
%>
@@ -5,26 +5,26 @@
component.with_text { title }
component.with_action_component do
render(Primer::Beta::ButtonGroup.new) do |group|
group.with_button(icon: "arrow-left", tag: :a, **previous_attrs)
group.with_button(icon: "arrow-right", tag: :a, **next_attrs)
end
component.with_action_button_group do |group|
group.with_button(icon: "arrow-left", tag: :a, **previous_attrs)
group.with_button(icon: "arrow-right", tag: :a, **next_attrs)
end
component.with_action_button(tag: :a, href: today_href) do |button|
button.with_leading_visual_icon(icon: "op-calendar-day")
component.with_action_button(tag: :a,
href: today_href,
leading_icon: :"op-calendar-day",
label: I18n.t(:label_today)) do
I18n.t(:label_today_capitalized)
end
component.with_action_button(
scheme: :primary,
leading_icon: :plus,
label: I18n.t(:button_log_time),
data: { "turbo-stream" => true },
aria: { "label" => t(:button_log_time) },
tag: :a,
href: dialog_time_entries_path(onlyMe: true, date: date.iso8601)
) do |button|
button.with_leading_visual_icon(icon: "plus")
) do
t(:button_add_time_entry)
end
end %>
@@ -45,12 +45,11 @@ See COPYRIGHT and LICENSE files for more details.
<%= render(Primer::OpenProject::SubHeader.new) do |subheader| %>
<% subheader.with_action_button(
scheme: :primary,
aria: { label: I18n.t(:button_add_cost_type) },
title: I18n.t(:button_add_cost_type),
leading_icon: :plus,
label: I18n.t(:button_add_cost_type),
tag: :a,
href: new_admin_cost_type_path
) do |button|
button.with_leading_visual_icon(icon: :plus)
) do
CostType.model_name.human
end %>
@@ -42,12 +42,11 @@ See COPYRIGHT and LICENSE files for more details.
render(Primer::OpenProject::SubHeader.new) do |subheader|
subheader.with_action_button(
scheme: :primary,
aria: { label: t(:label_document_new) },
title: t(:label_document_new),
leading_icon: :plus,
label: I18n.t(:label_document_new),
tag: :a,
href: url_for({ controller: "/documents", action: "new", project_id: @project })
) do |button|
button.with_leading_visual_icon(icon: :plus)
) do
t("activerecord.models.document")
end
end
@@ -43,12 +43,11 @@ See COPYRIGHT and LICENSE files for more details.
render(Primer::OpenProject::SubHeader.new) do |subheader|
subheader.with_action_button(
scheme: :primary,
aria: { label: I18n.t(:button_add_deploy_target) },
title: I18n.t(:button_add_deploy_target),
leading_icon: :plus,
label: I18n.t(:button_add_deploy_target),
tag: :a,
href: new_deploy_target_path
) do |button|
button.with_leading_visual_icon(icon: :plus)
) do
t(:label_deploy_target)
end
end
@@ -12,30 +12,24 @@
%>
<%= render(Primer::OpenProject::SubHeader.new) do |subheader|
subheader.with_action_component do
render(Primer::Alpha::ActionMenu.new(anchor_align: :end)) do |menu|
menu.with_show_button(
scheme: :primary,
test_selector: "op-admin-synchronized-groups--button-new",
aria: { label: I18n.t(:button_add) }
) do |button|
button.with_leading_visual_icon(icon: :plus)
button.with_trailing_action_icon(icon: :"triangle-down")
I18n.t(:button_add)
end
subheader.with_action_menu(leading_icon: :plus,
trailing_icon: :"triangle-down",
label: I18n.t(:button_add),
anchor_align: :end,
button_arguments: { scheme: :primary,
aria: { label: I18n.t(:button_add) },
test_selector: "op-admin-synchronized-groups--button-new" }) do |menu|
menu.with_item(
label: I18n.t("ldap_groups.synchronized_filters.singular"),
test_selector: "op-admin-synchronized-groups--new-filters",
href: new_ldap_groups_synchronized_filter_path
)
menu.with_item(
label: I18n.t("ldap_groups.synchronized_filters.singular"),
test_selector: "op-admin-synchronized-groups--new-filters",
href: new_ldap_groups_synchronized_filter_path
)
menu.with_item(
label: I18n.t("ldap_groups.synchronized_groups.singular"),
test_selector: "op-admin-synchronized-groups--new-groups",
href: new_ldap_groups_synchronized_group_path
)
end
menu.with_item(
label: I18n.t("ldap_groups.synchronized_groups.singular"),
test_selector: "op-admin-synchronized-groups--new-groups",
href: new_ldap_groups_synchronized_group_path
)
end
end %>
@@ -1,28 +0,0 @@
<%=
flex_layout do |flex|
flex.with_column do
render(Meetings::MeetingFilterButtonComponent.new(query: @query, project: @project))
end
flex.with_column(ml: 1) do
render(Primer::Alpha::SegmentedControl.new("aria-label": I18n.t(:label_meeting_date_time))) do |control|
control.with_item(
tag: :a,
icon: :"arrow-right",
href: dynamic_path,
label: t(:label_upcoming_meetings_short),
title: t(:label_upcoming_meetings),
selected: upcoming_query?
)
control.with_item(
tag: :a,
icon: :history,
href: dynamic_path(upcoming: false),
label: t(:label_past_meetings_short),
title: t(:label_past_meetings),
selected: !upcoming_query?
)
end
end
end
%>
@@ -8,43 +8,54 @@
)
) do |subheader|
subheader.with_filter_component do
render(Meetings::CombinedFilterComponent.new(query: @query, project: @project, params: @params))
render(Meetings::MeetingFilterButtonComponent.new(query: @query, project: @project))
end
subheader.with_segmented_control("aria-label": I18n.t(:label_meeting_date_time)) do |control|
control.with_item(
tag: :a,
icon: :"arrow-right",
href: dynamic_path,
label: t(:label_upcoming_meetings_short),
title: t(:label_upcoming_meetings),
selected: upcoming_query?
)
control.with_item(
tag: :a,
icon: :history,
href: dynamic_path(upcoming: false),
label: t(:label_past_meetings_short),
title: t(:label_past_meetings),
selected: !upcoming_query?
)
end
if render_create_button?
subheader.with_action_component do
render Primer::Alpha::ActionMenu.new(anchor_align: :end, size: :small) do |menu|
menu.with_show_button(
scheme: :primary,
test_selector: "add-meeting-button",
mobile_icon: :plus,
mobile_label: label_text,
id: id,
title: accessibility_label_text,
aria: { label: accessibility_label_text }
) do |button|
button.with_leading_visual_icon(icon: :plus)
button.with_trailing_action_icon(icon: :"triangle-down")
I18n.t(:label_meeting)
end
subheader.with_action_menu(leading_icon: :plus,
trailing_icon: :"triangle-down",
label: label_text,
anchor_align: :end,
size: :small,
button_arguments: { scheme: :primary,
id: id,
aria: { label: accessibility_label_text },
test_selector: "add-meeting-button" }) do |menu|
menu.with_item(
label: I18n.t("meeting.types.one_time"),
tag: :a,
href: polymorphic_path([:new_dialog, @project, :meetings]),
content_arguments: { data: { controller: "async-dialog" } }
) do |item|
item.with_description.with_content(t("meeting.types.structured_text"))
end
menu.with_item(
label: I18n.t("meeting.types.one_time"),
tag: :a,
href: polymorphic_path([:new_dialog, @project, :meetings]),
content_arguments: { data: { controller: "async-dialog" } }
) do |item|
item.with_description.with_content(t("meeting.types.structured_text"))
end
menu.with_item(
label: I18n.t("meeting.types.recurring"),
tag: :a,
href: polymorphic_path([:new_dialog, @project, :meetings], type: :recurring),
content_arguments: { data: { controller: "async-dialog" } }
) do |item|
item.with_description.with_content(t("meeting.types.recurring_text"))
end
menu.with_item(
label: I18n.t("meeting.types.recurring"),
tag: :a,
href: polymorphic_path([:new_dialog, @project, :meetings], type: :recurring),
content_arguments: { data: { controller: "async-dialog" } }
) do |item|
item.with_description.with_content(t("meeting.types.recurring_text"))
end
end
end
@@ -49,10 +49,6 @@ module Meetings
end
end
def dynamic_path
polymorphic_path([:new, @project, :meeting])
end
def id
"add-meeting-button"
end
@@ -64,5 +60,18 @@ module Meetings
def label_text
I18n.t(:label_meeting)
end
def upcoming_query?
filter = @query.filters.find { |f| f.name == :time }
filter ? !filter.past? : true
end
def dynamic_path(upcoming: true)
polymorphic_path([@project, :meetings], current_params.merge(upcoming:))
end
def current_params
@current_params ||= params.slice(:filters, :page, :per_page).permit!
end
end
end
@@ -1,22 +1,22 @@
<%= 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,
icon: :"arrow-right",
href: project_recurring_meeting_path(@meeting.project, @meeting),
label: t(:label_upcoming_meetings_short),
title: t(:label_upcoming_meetings),
selected: @params[:direction] != "past"
)
control.with_item(
tag: :a,
icon: :history,
href: project_recurring_meeting_path(@meeting.project, @meeting, direction: :past),
label: t(:label_past_meetings_short),
title: t(:label_past_meetings),
selected: @params[:direction] == "past"
)
end
end
end %>
<%=
render(Primer::OpenProject::SubHeader.new) do |subheader|
subheader.with_segmented_control("aria-label": I18n.t(:label_filter_plural)) do |control|
control.with_item(
tag: :a,
icon: :"arrow-right",
href: project_recurring_meeting_path(@meeting.project, @meeting),
label: t(:label_upcoming_meetings_short),
title: t(:label_upcoming_meetings),
selected: @params[:direction] != "past"
)
control.with_item(
tag: :a,
icon: :history,
href: project_recurring_meeting_path(@meeting.project, @meeting, direction: :past),
label: t(:label_past_meetings_short),
title: t(:label_past_meetings),
selected: @params[:direction] == "past"
)
end
end
%>
@@ -13,28 +13,18 @@
<%=
render(Primer::OpenProject::SubHeader.new) do |subheader|
subheader.with_action_component do
render(
Primer::Alpha::ActionMenu.new(
anchor_align: :end
subheader.with_action_menu(leading_icon: :plus,
trailing_icon: :"triangle-down",
label: I18n.t("openid_connect.providers.singular"),
anchor_align: :end,
button_arguments: { scheme: :primary,
disabled: !EnterpriseToken.allows_to?(:sso_auth_providers),
aria: { label: I18n.t("openid_connect.providers.label_add_new") } }) do |menu|
OpenIDConnect::Provider::OIDC_PROVIDERS.each do |provider_type|
menu.with_item(
label: I18n.t("openid_connect.providers.#{provider_type}.name"),
href: url_helpers.new_openid_connect_provider_path(oidc_provider: provider_type)
)
) do |menu|
menu.with_show_button(
scheme: :primary,
disabled: !EnterpriseToken.allows_to?(:sso_auth_providers),
aria: { label: I18n.t("openid_connect.providers.label_add_new") }
) do |button|
button.with_leading_visual_icon(icon: :plus)
button.with_trailing_action_icon(icon: :"triangle-down")
I18n.t("openid_connect.providers.singular")
end
OpenIDConnect::Provider::OIDC_PROVIDERS.each do |provider_type|
menu.with_item(
label: I18n.t("openid_connect.providers.#{provider_type}.name"),
href: url_helpers.new_openid_connect_provider_path(oidc_provider: provider_type)
)
end
end
end
end
@@ -61,21 +61,22 @@ See COPYRIGHT and LICENSE files for more details.
render(Primer::OpenProject::SubHeader.new) do |subheader|
subheader.with_action_button(
scheme: :secondary,
leading_icon: :download,
label: download_label,
tag: :a,
href: admin_settings_storage_health_status_report_path(@storage, format: :txt),
data: { turbo: true },
aria: { label: download_label }
) do |button|
button.with_leading_visual_icon(icon: :download)
) do
download_label
end
subheader.with_action_button(
scheme: :primary,
leading_icon: :plus,
label: button_label,
tag: :a,
href: admin_settings_storage_health_status_report_path(@storage),
data: { turbo_method: :post, turbo: true },
aria: { label: button_label }
) do
button_label
end
@@ -16,29 +16,26 @@ end %>
<% end %>
<%= render(Primer::OpenProject::SubHeader.new) do |subheader|
subheader.with_action_component do
render(Primer::Alpha::ActionMenu.new(test_selector: 'storages-select-provider-action-menu',
anchor_align: :end)) do |menu|
menu.with_show_button(scheme: :primary,
aria: { label: I18n.t("storages.label_add_new_storage") },
test_selector: "storages-create-new-provider-button") do |button|
button.with_leading_visual_icon(icon: :plus)
button.with_trailing_action_icon(icon: :"triangle-down")
I18n.t("storages.label_storage")
end
subheader.with_action_menu(leading_icon: :plus,
trailing_icon: :"triangle-down",
label: I18n.t("storages.label_storage"),
test_selector: 'storages-select-provider-action-menu',
anchor_align: :end,
button_arguments: { scheme: :primary,
aria: { label: I18n.t("storages.label_add_new_storage") },
test_selector: "storages-create-new-provider-button"}) do |menu|
::Storages::Storage::PROVIDER_TYPES.each do |provider_type|
short_provider_type = ::Storages::Storage.shorten_provider_type(provider_type)
::Storages::Storage::PROVIDER_TYPES.each do |provider_type|
short_provider_type = ::Storages::Storage.shorten_provider_type(provider_type)
menu.with_item(
label: I18n.t("storages.provider_types.#{short_provider_type}.name"),
href: url_helpers.new_admin_settings_storage_path(provider: short_provider_type)
) do |item|
item.with_trailing_visual_icon(
icon: "op-enterprise-addons",
classes: "upsell-colored"
) if ::Storages::Storage::one_drive_without_ee_token?(provider_type)
end
menu.with_item(
label: I18n.t("storages.provider_types.#{short_provider_type}.name"),
href: url_helpers.new_admin_settings_storage_path(provider: short_provider_type)
) do |item|
item.with_trailing_visual_icon(
icon: "op-enterprise-addons",
classes: "upsell-colored"
) if ::Storages::Storage::one_drive_without_ee_token?(provider_type)
end
end
end
@@ -34,18 +34,13 @@ See COPYRIGHT and LICENSE files for more details.
<%=
if @storage.configured?
render(Primer::OpenProject::SubHeader.new) do |component|
component.with_action_component do
render(
Primer::Beta::Button.new(
scheme: :primary,
tag: :a,
href: new_admin_settings_storage_project_storage_path(@storage),
data: { controller: "async-dialog" }
)
) do |button|
button.with_leading_visual_icon(icon: "op-include-projects")
I18n.t(:label_add_projects)
end
component.with_action_button(scheme: :primary,
leading_icon: :"op-include-projects",
label: I18n.t(:label_add_projects),
tag: :a,
href: new_admin_settings_storage_project_storage_path(@storage),
data: { controller: "async-dialog" }) do
I18n.t(:label_add_projects)
end
end
end
@@ -12,9 +12,7 @@
<%=
render Primer::OpenProject::SubHeader.new do |subheader|
subheader.with_action_component do
render ::TeamPlanner::AddButtonComponent.new(current_project: @project)
end
render ::TeamPlanner::AddButtonComponent.new(subheader:, current_project: @project)
end
%>
@@ -11,9 +11,7 @@
<%=
render Primer::OpenProject::SubHeader.new do |subheader|
subheader.with_action_component do
render ::TeamPlanner::AddButtonComponent.new
end
render ::TeamPlanner::AddButtonComponent.new(subheader:)
end
%>
@@ -11,26 +11,21 @@
%>
<%= render(Primer::OpenProject::SubHeader.new) do |subheader|
subheader.with_action_component do
render(Primer::Alpha::ActionMenu.new(anchor_align: :end, size: :small)) do |menu|
menu.with_show_button(
scheme: :primary,
test_selector: "two_factor_authentication_devices_button",
aria: { label: t("two_factor_authentication.label_device") }
) do |button|
button.with_leading_visual_icon(icon: :plus)
button.with_trailing_action_icon(icon: :"triangle-down")
t("two_factor_authentication.label_device")
end
@available_devices.each_key do |key|
menu.with_item(
label: t("two_factor_authentication.devices.#{key}.title"),
href: url_for(action: :new, type: key),
test_selector: "two_factor_authentication_devices_#{key}"
) do |item|
item.with_description.with_content(t("two_factor_authentication.devices.#{key}.description"))
end
subheader.with_action_menu(leading_icon: :plus,
trailing_icon: :"triangle-down",
label: t("two_factor_authentication.label_device"),
anchor_align: :end,
size: :small,
button_arguments: { scheme: :primary,
test_selector: "two_factor_authentication_devices_button",
aria: { label: t("two_factor_authentication.label_device") } }) do |menu|
@available_devices.each_key do |key|
menu.with_item(
label: t("two_factor_authentication.devices.#{key}.title"),
href: url_for(action: :new, type: key),
test_selector: "two_factor_authentication_devices_#{key}"
) do |item|
item.with_description.with_content(t("two_factor_authentication.devices.#{key}.description"))
end
end
end
@@ -15,12 +15,11 @@
render(Primer::OpenProject::SubHeader.new) do |subheader|
subheader.with_action_button(
scheme: :primary,
aria: { label: I18n.t("webhooks.outgoing.label_add_new") },
title: I18n.t("webhooks.outgoing.label_add_new"),
leading_icon: :plus,
label: I18n.t("webhooks.outgoing.label_add_new"),
tag: :a,
href: new_admin_outgoing_webhook_path
) do |button|
button.with_leading_visual_icon(icon: :plus)
) do
t("webhooks.singular")
end
end