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

Merge remote-tracking branch 'origin/dev' into feature/meetings-update-flash

Oliver Günther6703a396d2d8
diff --cc frontend/src/turbo/setup.ts
index 50747fa5a7c,e961b198b00..8a2c43b048b
--- a/frontend/src/turbo/setup.ts
+++ b/frontend/src/turbo/setup.ts
@@@ -1,18 -1,21 +1,23 @@@
import '../typings/shims.d.ts';
import * as Turbo from '@hotwired/turbo';
+ import TurboPower from 'turbo_power';
import { registerDialogStreamAction } from './dialog-stream-action';
import { addTurboEventListeners } from './turbo-event-listeners';
+import { registerFlashStreamAction } from './flash-stream-action';
// Disable default turbo-drive for now as we don't need it for now AND it breaks angular routing
Turbo.session.drive = false;
// Start turbo
Turbo.start();
+ // Register our own actions
addTurboEventListeners();
registerDialogStreamAction();
+registerFlashStreamAction();
+ // Register turbo power actions
+ TurboPower.initialize(Turbo.StreamActions);
+
// Error handling when "Content missing" returned
document.addEventListener('turbo:frame-missing', (event:CustomEvent) => {
const { detail: { response, visit } } = event as { detail:{ response:Response, visit:(url:string) => void } };
diff --cc modules/meeting/app/components/meetings/header_component.html.erb
index 487d164bbf5,df2604d9cce..1e219313de4
--- a/modules/meeting/app/components/meetings/header_component.html.erb
+++ b/modules/meeting/app/components/meetings/header_component.html.erb
@@@ -1,83 -1,70 +1,78 @@@
<%=
component_wrapper do
- render(Primer::OpenProject::PageHeader.new(state: @state)) do |header|
+ render(Primer::OpenProject::PageHeader.new(
++ state: @state,
+ data: {
+ controller: "poll-for-changes",
+ poll_for_changes_reference_value: @meeting.changed_hash,
+ poll_for_changes_url_value: check_for_updates_meeting_path(@meeting),
+ poll_for_changes_interval_value: check_for_updates_interval,
+ }
+ )) 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
+ 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"),
+ classes: "hide-when-print",
+ 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 --cc modules/meeting/app/components/meetings/header_component.rb
index 9b76d604d5e,336e9970c96..08bcba7912f
--- a/modules/meeting/app/components/meetings/header_component.rb
+++ b/modules/meeting/app/components/meetings/header_component.rb
@@@ -44,17 -44,8 +44,13 @@@ module Meeting
@state = fetch_or_fallback(STATE_OPTIONS, state)
end
+ # Define the interval so it can be overriden through tests
+ def check_for_updates_interval
+ 10_000
+ end
+
private
- def show_state?
- @state == :show
- end
-
def delete_enabled?
User.current.allowed_in_project?(:delete_meetings, @meeting.project)
end