Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Bump primer_view_components to 0.41.0 and octicons to 19.18.0 and replace custom editable PageHeader title forms with the now build-in form that the Primer::OpenProject::PageHeader is offering

Henriette Darge75f372b4c8ba
diff --git a/Gemfile b/Gemfile
index a98d9930baa..fc3cca08ccb 100644
--- a/Gemfile
+++ b/Gemfile
@@ -395,6 +395,6 @@ gemfiles.each do |file|
send(:eval_gemfile, file) if File.readable?(file)
end
-gem "openproject-octicons", "~>19.17.0"
-gem "openproject-octicons_helper", "~>19.17.0"
-gem "openproject-primer_view_components", "~>0.40.0"
+gem "openproject-octicons", "~>19.18.0"
+gem "openproject-octicons_helper", "~>19.18.0"
+gem "openproject-primer_view_components", "~>0.41.0"
diff --git a/Gemfile.lock b/Gemfile.lock
index 2c6a7498b87..fba54d0140e 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -775,12 +775,12 @@ GEM
validate_email
validate_url
webfinger (~> 2.0)
- openproject-octicons (19.17.0)
- openproject-octicons_helper (19.17.0)
+ openproject-octicons (19.18.0)
+ openproject-octicons_helper (19.18.0)
actionview
- openproject-octicons (= 19.17.0)
+ openproject-octicons (= 19.18.0)
railties
- openproject-primer_view_components (0.40.0)
+ openproject-primer_view_components (0.41.0)
actionview (>= 5.0.0)
activesupport (>= 5.0.0)
openproject-octicons (>= 19.17.0)
@@ -1275,10 +1275,10 @@ DEPENDENCIES
openproject-job_status!
openproject-ldap_groups!
openproject-meeting!
- openproject-octicons (~> 19.17.0)
- openproject-octicons_helper (~> 19.17.0)
+ openproject-octicons (~> 19.18.0)
+ openproject-octicons_helper (~> 19.18.0)
openproject-openid_connect!
- openproject-primer_view_components (~> 0.40.0)
+ openproject-primer_view_components (~> 0.41.0)
openproject-recaptcha!
openproject-reporting!
openproject-storages!
diff --git a/app/components/projects/index_page_header_component.html.erb b/app/components/projects/index_page_header_component.html.erb
index b6c1db69689..997a23469b0 100644
--- a/app/components/projects/index_page_header_component.html.erb
+++ b/app/components/projects/index_page_header_component.html.erb
@@ -1,162 +1,155 @@
-<% if show_state? %>
- <%=
- render(Primer::OpenProject::PageHeader.new) do |header|
- header.with_title(data: { 'test-selector': 'project-query-name' }) { page_title }
- header.with_breadcrumbs(breadcrumb_items, selected_item_font_weight: current_breadcrumb_element == page_title ? :bold : :normal)
+<%=
+ 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')
+ page_title
+ end
+ header.with_breadcrumbs(breadcrumb_items, selected_item_font_weight: current_breadcrumb_element == page_title ? :bold : :normal)
- if can_save?
- header_save_action(
- header:,
- message: t("lists.can_be_saved"),
- label: t("button_save"),
- href: project_query_path(query, projects_query_params),
- method: :patch
- )
- elsif can_save_as?
- header_save_action(
- header:,
- message: t("lists.can_be_saved_as"),
- label: t("button_save_as"),
- href: new_project_query_path(projects_query_params)
- )
- end
+ if can_save?
+ header_save_action(
+ header:,
+ message: t("lists.can_be_saved"),
+ label: t("button_save"),
+ href: project_query_path(query, projects_query_params),
+ method: :patch
+ )
+ elsif can_save_as?
+ header_save_action(
+ header:,
+ message: t("lists.can_be_saved_as"),
+ label: t("button_save_as"),
+ href: new_project_query_path(projects_query_params)
+ )
+ end
+
+ if can_access_shares?
+ header.with_action_icon_button(
+ tag: :a,
+ href: dialog_project_query_members_path(query),
+ icon: "share-android",
+ mobile_icon: "share-android",
+ label: t(:label_share),
+ data: { controller: "async-dialog", test_selector: "toggle-share-dialog-button" }
+ )
+ end
- if can_access_shares?
+ if can_toggle_favor?
+ if currently_favored?
header.with_action_icon_button(
+ icon: "star-fill",
+ mobile_icon: "star-fill",
+ label: t(:button_unfavorite),
+ classes: "op-primer--star-icon",
tag: :a,
- href: dialog_project_query_members_path(query),
- icon: "share-android",
- mobile_icon: "share-android",
- label: t(:label_share),
- data: { controller: "async-dialog", test_selector: "toggle-share-dialog-button" }
+ href: helpers.build_favorite_path(query, format: :html),
+ data: { method: :delete, "test-selector": "project-query-unfavorite" },
+ )
+ else
+ header.with_action_icon_button(
+ icon: "star",
+ mobile_icon: "star",
+ label: t(:button_favorite),
+ tag: :a,
+ href: helpers.build_favorite_path(query, format: :html),
+ data: { method: :post, "test-selector": "project-query-favorite" },
)
end
+ end
- if can_toggle_favor?
- if currently_favored?
- header.with_action_icon_button(
- icon: "star-fill",
- mobile_icon: "star-fill",
- label: t(:button_unfavorite),
- classes: "op-primer--star-icon",
- tag: :a,
- href: helpers.build_favorite_path(query, format: :html),
- data: { method: :delete, "test-selector": "project-query-unfavorite" },
- )
- else
- header.with_action_icon_button(
- icon: "star",
- mobile_icon: "star",
- label: t(:button_favorite),
- tag: :a,
- href: helpers.build_favorite_path(query, format: :html),
- data: { method: :post, "test-selector": "project-query-favorite" },
- )
+ header.with_action_menu(
+ menu_arguments: {
+ anchor_align: :end
+ },
+ button_arguments: {
+ icon: "op-kebab-vertical",
+ "aria-label": t(:label_more),
+ data: { "test-selector": "project-more-dropdown-menu" }
+ }
+ ) do |menu|
+ if can_rename?
+ menu.with_item(
+ label: t('button_rename'),
+ href: rename_project_query_path(query),
+ ) do |item|
+ item.with_leading_visual_icon(icon: :pencil)
end
end
- header.with_action_menu(
- menu_arguments: {
- anchor_align: :end
- },
- button_arguments: {
- icon: "op-kebab-vertical",
- "aria-label": t(:label_more),
- data: { "test-selector": "project-more-dropdown-menu" }
- }
- ) do |menu|
- if can_rename?
- menu.with_item(
- label: t('button_rename'),
- href: rename_project_query_path(query),
- ) do |item|
- item.with_leading_visual_icon(icon: :pencil)
- end
- end
-
- if gantt_portfolio_project_ids.any?
- menu.with_item(
- tag: :a,
- label: t('projects.index.open_as_gantt'),
- href: gantt_portfolio_query_link,
- id: 'projects-index-open-as-gantt',
- content_arguments: { target: '_blank' }
- ) do |item|
- item.with_leading_visual_icon(icon: 'op-view-timeline')
- end
- end
-
+ if gantt_portfolio_project_ids.any?
menu.with_item(
tag: :a,
- label: t(:label_overall_activity),
- href: activities_path
+ label: t('projects.index.open_as_gantt'),
+ href: gantt_portfolio_query_link,
+ id: 'projects-index-open-as-gantt',
+ content_arguments: { target: '_blank' }
) do |item|
- item.with_leading_visual_icon(icon: 'tasklist')
+ item.with_leading_visual_icon(icon: 'op-view-timeline')
end
+ end
- if can_save?
- menu_save_item(
- menu:,
- label: t('button_save'),
- href: project_query_path(query, projects_query_params),
- method: :patch
- )
- end
+ menu.with_item(
+ tag: :a,
+ label: t(:label_overall_activity),
+ href: activities_path
+ ) do |item|
+ item.with_leading_visual_icon(icon: 'tasklist')
+ end
- if may_save_as?
- menu_save_item(
- menu:,
- label: t('button_save_as'),
- href: new_project_query_path(projects_query_params)
- )
- end
+ if can_save?
+ menu_save_item(
+ menu:,
+ label: t('button_save'),
+ href: project_query_path(query, projects_query_params),
+ method: :patch
+ )
+ end
- menu.with_item(
- label: t('js.label_export'),
- content_arguments: { 'data-show-dialog-id': Projects::ExportListModalComponent::MODAL_ID }
- ) do |item|
- item.with_leading_visual_icon(icon: 'sign-out')
- end
+ if may_save_as?
+ menu_save_item(
+ menu:,
+ label: t('button_save_as'),
+ href: new_project_query_path(projects_query_params)
+ )
+ end
+
+ menu.with_item(
+ label: t('js.label_export'),
+ content_arguments: { 'data-show-dialog-id': Projects::ExportListModalComponent::MODAL_ID }
+ ) do |item|
+ item.with_leading_visual_icon(icon: 'sign-out')
+ end
+ menu.with_item(
+ label: t(:'queries.configure_view.heading'),
+ content_arguments: { 'data-show-dialog-id': Projects::ConfigureViewModalComponent::MODAL_ID }
+ ) do |item|
+ item.with_leading_visual_icon(icon: :gear)
+ end
+
+ if query.persisted?
menu.with_item(
- label: t(:'queries.configure_view.heading'),
- content_arguments: { 'data-show-dialog-id': Projects::ConfigureViewModalComponent::MODAL_ID }
+ label: t(:button_delete),
+ scheme: :danger,
+ content_arguments: { 'data-show-dialog-id': Projects::DeleteListModalComponent::MODAL_ID }
) do |item|
- item.with_leading_visual_icon(icon: :gear)
- end
-
- if query.persisted?
- menu.with_item(
- label: t(:button_delete),
- scheme: :danger,
- content_arguments: { 'data-show-dialog-id': Projects::DeleteListModalComponent::MODAL_ID }
- ) do |item|
- item.with_leading_visual_icon(icon: 'trash')
- end
+ item.with_leading_visual_icon(icon: 'trash')
end
end
end
- %>
+ end
+%>
+
+<% if show_state? %>
<%= render(Projects::ConfigureViewModalComponent.new(query:)) %>
<%= render(Projects::DeleteListModalComponent.new(query:)) if query.persisted? %>
<%= render(Projects::ExportListModalComponent.new(query:)) %>
-<% else %>
- <%=
- render(Primer::OpenProject::PageHeader.new) do |header|
- header.with_title(data: { 'test-selector': 'project-query-name' }) do
- primer_form_with(model: query,
- url: @query.new_record? ? project_queries_path(projects_query_params) : project_query_path(@query, projects_query_params),
- scope: 'query',
- id: 'project-save-form') do |f|
- render(
- Queries::Projects::Form.new(
- f,
- cancel_url: projects_path(**projects_query_params, **{ query_id: query.id }.compact)
- )
- )
- end
- end
- header.with_breadcrumbs(breadcrumb_items)
- end
- %>
<% end %>
diff --git a/app/components/projects/index_page_header_component.rb b/app/components/projects/index_page_header_component.rb
index 868207da0e6..ee0bdbe3f0d 100644
--- a/app/components/projects/index_page_header_component.rb
+++ b/app/components/projects/index_page_header_component.rb
@@ -37,16 +37,22 @@ class Projects::IndexPageHeaderComponent < ApplicationComponent
:state,
:params
- STATE_OPTIONS = %i[show edit rename].freeze
+ STATE_DEFAULT = :show
+ STATE_EDIT = :edit
delegate :projects_query_params, to: :helpers
- def initialize(current_user:, query:, params:, state: :show)
+ def initialize(current_user:, query:, params:, state: STATE_DEFAULT)
super
self.current_user = current_user
self.query = query
- self.state = fetch_or_fallback(STATE_OPTIONS, state)
+ self.state = case state
+ when :edit, :rename
+ STATE_EDIT
+ else
+ STATE_DEFAULT
+ end
self.params = params
end
diff --git a/app/forms/queries/projects/form.rb b/app/forms/queries/projects/form.rb
deleted file mode 100644
index 7fa0a6b59f1..00000000000
--- a/app/forms/queries/projects/form.rb
+++ /dev/null
@@ -1,63 +0,0 @@
-# -- copyright
-# OpenProject is an open source project management software.
-# Copyright (C) the OpenProject GmbH
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License version 3.
-#
-# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
-# Copyright (C) 2006-2013 Jean-Philippe Lang
-# Copyright (C) 2010-2013 the ChiliProject Team
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# See COPYRIGHT and LICENSE files for more details.
-# ++
-
-class Queries::Projects::Form < ApplicationForm
- include OpenProject::StaticRouting::UrlHelpers
-
- form do |query_form|
- query_form.group(layout: :horizontal) do |group|
- group.text_field(
- visually_hide_label: true,
- required: true,
- autofocus: true,
- name: "name",
- label: ProjectQuery.human_attribute_name(:name),
- placeholder: I18n.t(:"projects.lists.new.placeholder")
- )
-
- group.submit(
- name: :submit,
- label: I18n.t(:button_save),
- scheme: :primary
- )
-
- group.button(
- name: :cancel,
- scheme: :secondary,
- label: I18n.t(:button_cancel),
- tag: :a,
- href: @cancel_url
- )
- end
- end
-
- def initialize(cancel_url:)
- super()
- @cancel_url = cancel_url
- end
-end
diff --git a/frontend/package-lock.json b/frontend/package-lock.json
index db14bc42f83..2e98ff910f0 100644
--- a/frontend/package-lock.json
+++ b/frontend/package-lock.json
@@ -46,8 +46,8 @@
"@ng-select/ng-select": "^13.2.0",
"@ngneat/content-loader": "^7.0.0",
"@ngx-formly/core": "^6.1.4",
- "@openproject/octicons-angular": "^19.17.0",
- "@openproject/primer-view-components": "^0.40.0",
+ "@openproject/octicons-angular": "^19.18.0",
+ "@openproject/primer-view-components": "^0.41.0",
"@openproject/reactivestates": "^3.0.1",
"@primer/css": "^21.3.3",
"@types/hotwired__turbo": "^8.0.1",
@@ -4808,9 +4808,9 @@
"integrity": "sha512-jrqoTI8lk5UziDsDPJ2Y+nmXYCcRhmr6uMARr3v/W6AMxRgsnRLWJyWKYr6FjaGMgbyxXG+OkCUPQY4Xl3toGg=="
},
"node_modules/@openproject/octicons-angular": {
- "version": "19.17.0",
- "resolved": "https://registry.npmjs.org/@openproject/octicons-angular/-/octicons-angular-19.17.0.tgz",
- "integrity": "sha512-GLY5jQpoY+lWM/bYkkDvYP4FDX6ik93QEGDiMFebD6+7LnPKXu/DFkJYv9s1M7zUmCkF9uxhEuwGJfYmzBjvjA==",
+ "version": "19.18.0",
+ "resolved": "https://registry.npmjs.org/@openproject/octicons-angular/-/octicons-angular-19.18.0.tgz",
+ "integrity": "sha512-BXrP73iAiges65Voobkzf7pBuG7YbR3dDtNx6Xx6yZFlpYVXxnEeAoj7dyGPi5C9ZiKBkNYEAygxFeurasXpAA==",
"dependencies": {
"tslib": "^2.3.0"
},
@@ -4822,9 +4822,9 @@
}
},
"node_modules/@openproject/primer-view-components": {
- "version": "0.40.0",
- "resolved": "https://registry.npmjs.org/@openproject/primer-view-components/-/primer-view-components-0.40.0.tgz",
- "integrity": "sha512-qvKqMtfg8/xBIHf2FWi+zzz96eD21jaQ6YtxOcGWPojXwz5j92/mvIZKFN/7xcNaUAjKkvrmBSEOD9RMVF492w==",
+ "version": "0.41.0",
+ "resolved": "https://registry.npmjs.org/@openproject/primer-view-components/-/primer-view-components-0.41.0.tgz",
+ "integrity": "sha512-5oofJDjUViqb+TLykEkRU2SNPpABYdsddXXLvbNjbROnU5/ascRitPWiGjgIomQbKWrP7PiDaYRsTLGvHb9rBw==",
"dependencies": {
"@github/auto-check-element": "^5.2.0",
"@github/auto-complete-element": "^3.6.2",
@@ -4890,9 +4890,9 @@
},
"node_modules/@primer/view-components": {
"name": "@openproject/primer-view-components",
- "version": "0.40.0",
- "resolved": "https://registry.npmjs.org/@openproject/primer-view-components/-/primer-view-components-0.40.0.tgz",
- "integrity": "sha512-qvKqMtfg8/xBIHf2FWi+zzz96eD21jaQ6YtxOcGWPojXwz5j92/mvIZKFN/7xcNaUAjKkvrmBSEOD9RMVF492w==",
+ "version": "0.41.0",
+ "resolved": "https://registry.npmjs.org/@openproject/primer-view-components/-/primer-view-components-0.41.0.tgz",
+ "integrity": "sha512-5oofJDjUViqb+TLykEkRU2SNPpABYdsddXXLvbNjbROnU5/ascRitPWiGjgIomQbKWrP7PiDaYRsTLGvHb9rBw==",
"dependencies": {
"@github/auto-check-element": "^5.2.0",
"@github/auto-complete-element": "^3.6.2",
@@ -25353,17 +25353,17 @@
"integrity": "sha512-jrqoTI8lk5UziDsDPJ2Y+nmXYCcRhmr6uMARr3v/W6AMxRgsnRLWJyWKYr6FjaGMgbyxXG+OkCUPQY4Xl3toGg=="
},
"@openproject/octicons-angular": {
- "version": "19.17.0",
- "resolved": "https://registry.npmjs.org/@openproject/octicons-angular/-/octicons-angular-19.17.0.tgz",
- "integrity": "sha512-GLY5jQpoY+lWM/bYkkDvYP4FDX6ik93QEGDiMFebD6+7LnPKXu/DFkJYv9s1M7zUmCkF9uxhEuwGJfYmzBjvjA==",
+ "version": "19.18.0",
+ "resolved": "https://registry.npmjs.org/@openproject/octicons-angular/-/octicons-angular-19.18.0.tgz",
+ "integrity": "sha512-BXrP73iAiges65Voobkzf7pBuG7YbR3dDtNx6Xx6yZFlpYVXxnEeAoj7dyGPi5C9ZiKBkNYEAygxFeurasXpAA==",
"requires": {
"tslib": "^2.3.0"
}
},
"@openproject/primer-view-components": {
- "version": "0.40.0",
- "resolved": "https://registry.npmjs.org/@openproject/primer-view-components/-/primer-view-components-0.40.0.tgz",
- "integrity": "sha512-qvKqMtfg8/xBIHf2FWi+zzz96eD21jaQ6YtxOcGWPojXwz5j92/mvIZKFN/7xcNaUAjKkvrmBSEOD9RMVF492w==",
+ "version": "0.41.0",
+ "resolved": "https://registry.npmjs.org/@openproject/primer-view-components/-/primer-view-components-0.41.0.tgz",
+ "integrity": "sha512-5oofJDjUViqb+TLykEkRU2SNPpABYdsddXXLvbNjbROnU5/ascRitPWiGjgIomQbKWrP7PiDaYRsTLGvHb9rBw==",
"requires": {
"@github/auto-check-element": "^5.2.0",
"@github/auto-complete-element": "^3.6.2",
@@ -25410,7 +25410,7 @@
"integrity": "sha512-h2ITbCj415T1JpWQDeQd1xYL6TrzkehfUOXxnV0FpblYyMsVBAks6LL7HGJ+ZrydG+Ds0i1rvvi8Q61jErieNA==",
"requires": {
"@primer/primitives": "^8.2.0",
- "@primer/view-components": "npm:@openproject/primer-view-components@^0.40.0"
+ "@primer/view-components": "npm:@openproject/primer-view-components@^0.41.0"
}
},
"@primer/primitives": {
@@ -25419,9 +25419,9 @@
"integrity": "sha512-K8A/DA6xv8P/kD/9DupFn+KYlo06OpcrwfwJf+sKp+KnX7ZRwLLDg1AaEGAoRoaykXRY/gfrXlgDfK7laOTWyA=="
},
"@primer/view-components": {
- "version": "npm:@openproject/[email protected]",
- "resolved": "https://registry.npmjs.org/@openproject/primer-view-components/-/primer-view-components-0.40.0.tgz",
- "integrity": "sha512-qvKqMtfg8/xBIHf2FWi+zzz96eD21jaQ6YtxOcGWPojXwz5j92/mvIZKFN/7xcNaUAjKkvrmBSEOD9RMVF492w==",
+ "version": "npm:@openproject/[email protected]",
+ "resolved": "https://registry.npmjs.org/@openproject/primer-view-components/-/primer-view-components-0.41.0.tgz",
+ "integrity": "sha512-5oofJDjUViqb+TLykEkRU2SNPpABYdsddXXLvbNjbROnU5/ascRitPWiGjgIomQbKWrP7PiDaYRsTLGvHb9rBw==",
"requires": {
"@github/auto-check-element": "^5.2.0",
"@github/auto-complete-element": "^3.6.2",
diff --git a/frontend/package.json b/frontend/package.json
index d3abc54e5c5..732dd0afedb 100644
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -97,8 +97,8 @@
"@ng-select/ng-select": "^13.2.0",
"@ngneat/content-loader": "^7.0.0",
"@ngx-formly/core": "^6.1.4",
- "@openproject/octicons-angular": "^19.17.0",
- "@openproject/primer-view-components": "^0.40.0",
+ "@openproject/octicons-angular": "^19.18.0",
+ "@openproject/primer-view-components": "^0.41.0",
"@openproject/reactivestates": "^3.0.1",
"@primer/css": "^21.3.3",
"@types/hotwired__turbo": "^8.0.1",
@@ -176,6 +176,6 @@
"generate-typings": "tsc -d -p src/tsconfig.app.json"
},
"overrides": {
- "@primer/view-components": "npm:@openproject/primer-view-components@^0.40.0"
+ "@primer/view-components": "npm:@openproject/primer-view-components@^0.41.0"
}
}
diff --git a/modules/meeting/app/components/meetings/header_component.html.erb b/modules/meeting/app/components/meetings/header_component.html.erb
index 19ac108a6d4..6815a47b639 100644
--- a/modules/meeting/app/components/meetings/header_component.html.erb
+++ b/modules/meeting/app/components/meetings/header_component.html.erb
@@ -1,76 +1,69 @@
<%=
component_wrapper do
- render(Primer::OpenProject::PageHeader.new) do |header|
- if show_state?
- header.with_title { @meeting.title }
- header.with_breadcrumbs(breadcrumb_items)
- header.with_description { render(Meetings::HeaderInfolineComponent.new(@meeting)) }
- header.with_action_menu(menu_arguments: {},
- button_arguments: { icon: "kebab-horizontal",
- "aria-label": t("label_meeting_actions"),
- test_selector: 'op-meetings-header-action-trigger'}) do |menu|
- menu.with_item(label: t("label_meeting_edit_title"),
- href: edit_meeting_path(@meeting),
- content_arguments: {
- data: { 'turbo-stream': true }
- }) do |item|
- item.with_leading_visual_icon(icon: :pencil)
- end if @meeting.editable?
-
- menu.with_item(label: t(:button_copy),
- href: copy_meeting_path(@meeting),
- content_arguments: {
- data: { turbo: false }
- }) do |item|
- item.with_leading_visual_icon(icon: :copy)
- end
+ render(Primer::OpenProject::PageHeader.new(state: @state)) do |header|
+ header.with_title do |title|
+ title.with_editable_form(model: @meeting,
+ update_path: update_title_meeting_path(@meeting),
+ cancel_path: cancel_edit_meeting_path(@meeting),
+ label: Meeting.human_attribute_name(:title),
+ placeholder: Meeting.human_attribute_name(:title),)
+ @meeting.title
+ end
+ header.with_breadcrumbs(breadcrumb_items)
+ header.with_description { render(Meetings::HeaderInfolineComponent.new(@meeting)) }
+ header.with_action_menu(menu_arguments: {},
+ button_arguments: { icon: "kebab-horizontal",
+ "aria-label": t("label_meeting_actions"),
+ test_selector: 'op-meetings-header-action-trigger'}) do |menu|
+ menu.with_item(label: t("label_meeting_edit_title"),
+ href: edit_meeting_path(@meeting),
+ content_arguments: {
+ data: { 'turbo-stream': true }
+ }) do |item|
+ item.with_leading_visual_icon(icon: :pencil)
+ end if @meeting.editable?
- menu.with_item(label: t(:label_icalendar_download),
- href: download_ics_meeting_path(@meeting)) do |item|
- item.with_leading_visual_icon(icon: :download)
- end
+ menu.with_item(label: t(:button_copy),
+ href: copy_meeting_path(@meeting),
+ content_arguments: {
+ data: { turbo: false }
+ }) do |item|
+ item.with_leading_visual_icon(icon: :copy)
+ end
- if User.current.allowed_in_project?(:send_meeting_agendas_notification, @meeting.project
- )
- menu.with_item(label: t('meeting.label_mail_all_participants'),
- href: notify_meeting_path(@meeting),
- form_arguments: { method: :post, data: { turbo: 'false' } }) do |item|
- item.with_leading_visual_icon(icon: :mail)
- end
- end
+ menu.with_item(label: t(:label_icalendar_download),
+ href: download_ics_meeting_path(@meeting)) do |item|
+ item.with_leading_visual_icon(icon: :download)
+ end
- menu.with_item(label: t(:label_history),
- tag: :a,
- href: history_meeting_path(@meeting),
- content_arguments: {
- "data-controller": "async-dialog",
- },
- value: ""
- ) do |item|
- item.with_leading_visual_icon(icon: :clock) # or :check TBD
+ if User.current.allowed_in_project?(:send_meeting_agendas_notification, @meeting.project
+ )
+ menu.with_item(label: t('meeting.label_mail_all_participants'),
+ href: notify_meeting_path(@meeting),
+ form_arguments: { method: :post, data: { turbo: 'false' } }) do |item|
+ item.with_leading_visual_icon(icon: :mail)
end
-
- menu.with_item(label: t("label_meeting_delete"),
- scheme: :danger,
- href: meeting_path(@meeting),
- form_arguments: {
- method: :delete, data: { confirm: t("text_are_you_sure"), turbo: 'false' }
- }) do |item|
- item.with_leading_visual_icon(icon: :trash)
- end if delete_enabled?
end
- elsif @meeting.editable?
- header.with_title do
- primer_form_with(
- model: @meeting,
- method: :put,
- url: update_title_meeting_path(@meeting)
- ) do |f|
- render(Meeting::Title.new(f, meeting: @meeting))
- end
+
+ menu.with_item(label: t(:label_history),
+ tag: :a,
+ href: history_meeting_path(@meeting),
+ content_arguments: {
+ "data-controller": "async-dialog",
+ },
+ value: ""
+ ) do |item|
+ item.with_leading_visual_icon(icon: :clock) # or :check TBD
end
- header.with_breadcrumbs(breadcrumb_items)
- header.with_description { render(Meetings::HeaderInfolineComponent.new(@meeting)) }
+
+ menu.with_item(label: t("label_meeting_delete"),
+ scheme: :danger,
+ href: meeting_path(@meeting),
+ form_arguments: {
+ method: :delete, data: { confirm: t("text_are_you_sure"), turbo: 'false' }
+ }) do |item|
+ item.with_leading_visual_icon(icon: :trash)
+ end if delete_enabled?
end
end
end
diff --git a/modules/meeting/app/components/meetings/header_component.rb b/modules/meeting/app/components/meetings/header_component.rb
index ed955332340..336e9970c96 100644
--- a/modules/meeting/app/components/meetings/header_component.rb
+++ b/modules/meeting/app/components/meetings/header_component.rb
@@ -36,7 +36,7 @@ module Meetings
STATE_DEFAULT = :show
STATE_EDIT = :edit
STATE_OPTIONS = [STATE_DEFAULT, STATE_EDIT].freeze
- def initialize(meeting:, project: nil, state: :show)
+ def initialize(meeting:, project: nil, state: STATE_DEFAULT)
super
@meeting = meeting
@@ -46,10 +46,6 @@ module Meetings
private
- def show_state?
- @state == :show
- end
-
def delete_enabled?
User.current.allowed_in_project?(:delete_meetings, @meeting.project)
end
diff --git a/modules/meeting/app/forms/meeting/title.rb b/modules/meeting/app/forms/meeting/title.rb
deleted file mode 100644
index ae03ee3103a..00000000000
--- a/modules/meeting/app/forms/meeting/title.rb
+++ /dev/null
@@ -1,60 +0,0 @@
-#-- copyright
-# OpenProject is an open source project management software.
-# Copyright (C) the OpenProject GmbH
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License version 3.
-#
-# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
-# Copyright (C) 2006-2013 Jean-Philippe Lang
-# Copyright (C) 2010-2013 the ChiliProject Team
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# See COPYRIGHT and LICENSE files for more details.
-#++
-
-class Meeting::Title < ApplicationForm
- include OpenProject::StaticRouting::UrlHelpers
-
- form do |query_form|
- query_form.group(layout: :horizontal) do |group|
- group.text_field(
- name: :title,
- placeholder: Meeting.human_attribute_name(:title),
- label: Meeting.human_attribute_name(:title),
- visually_hide_label: true,
- required: true,
- autofocus: true
- )
-
- group.submit(name: :submit, label: I18n.t("button_save"), scheme: :primary)
-
- group.button(
- name: :cancel,
- scheme: :secondary,
- label: I18n.t(:button_cancel),
- tag: :a,
- data: { "turbo-stream": true },
- href: OpenProject::StaticRouting::StaticUrlHelpers.new.cancel_edit_meeting_path(@meeting)
- )
- end
- end
-
- def initialize(meeting:)
- super()
- @meeting = meeting
- end
-end