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

Change meeting flash banner width to 80%

Oliver Güntherff859be5e8bf
diff --git a/app/views/layouts/base.html.erb b/app/views/layouts/base.html.erb
index 47ac73419ed..0d3485e6f41 100644
--- a/app/views/layouts/base.html.erb
+++ b/app/views/layouts/base.html.erb
@@ -119,7 +119,7 @@ See COPYRIGHT and LICENSE files for more details.
<main id="content-wrapper" class="<%= initial_classes %>">
<%= render_primer_banner_message %>
<%= render_streameable_primer_banner_message %>
- <turbo-frame id="flash-messages">
+ <turbo-frame id="flash-messages" class="op-primer-banner">
<%= render_flash_messages %>
</turbo-frame>
<% if show_onboarding_modal? %>
diff --git a/frontend/src/global_styles/primer/_banners.sass b/frontend/src/global_styles/primer/_banners.sass
new file mode 100644
index 00000000000..5f26272ffc3
--- /dev/null
+++ b/frontend/src/global_styles/primer/_banners.sass
@@ -0,0 +1,40 @@
+//-- 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.
+//++
+
+$op-primer-banner-toaster-width: 80%
+
+.op-primer-banner
+ &--wrapper
+ // Move below sidebar
+ z-index: 599
+ position: absolute
+ max-width: $op-primer-banner-toaster-width
+ margin: 0 auto
+ left: 10%
+ right: 10%
+ top: 1rem
diff --git a/frontend/src/global_styles/primer/_index.sass b/frontend/src/global_styles/primer/_index.sass
index cd140c4f036..05cc6f6ffcb 100644
--- a/frontend/src/global_styles/primer/_index.sass
+++ b/frontend/src/global_styles/primer/_index.sass
@@ -1,2 +1,3 @@
@import icons
@import overrides
+@import banners
diff --git a/frontend/src/turbo/flash-stream-action.ts b/frontend/src/turbo/flash-stream-action.ts
index 47e08a4c8fc..7e9dc69c90a 100644
--- a/frontend/src/turbo/flash-stream-action.ts
+++ b/frontend/src/turbo/flash-stream-action.ts
@@ -3,6 +3,7 @@ import { StreamActions, StreamElement } from '@hotwired/turbo';
export function registerFlashStreamAction() {
StreamActions.flash = function dialogStreamAction(this:StreamElement) {
const content = this.templateElement.content;
- document.body.append(content);
+ const target = document.getElementById('flash-messages');
+ target?.append(content);
};
}
diff --git a/modules/meeting/app/components/meetings/update_flash_component.html.erb b/modules/meeting/app/components/meetings/update_flash_component.html.erb
index 61aa1b40fad..2f6d2837443 100644
--- a/modules/meeting/app/components/meetings/update_flash_component.html.erb
+++ b/modules/meeting/app/components/meetings/update_flash_component.html.erb
@@ -1,23 +1,19 @@
-<%=
- component_wrapper do
- flex_layout do |flex|
- flex.with_row(classes: "op-toast--wrapper") do
- render(Primer::Alpha::Banner.new(
- full: false,
- icon: 'info',
- scheme: :default,
- data: {
- singleton: true
- }
- )) do |component|
- component.with_action_button(
- tag: :a,
- href: meeting_path(@meeting),
- data: { turbo: false },
- size: :medium) { I18n.t("label_meeting_reload") }
- I18n.t("notice_meeting_updated")
- end
- end
+<div class="op-primer-banner--wrapper">
+ <%=
+ render(Primer::Alpha::Banner.new(
+ full: false,
+ icon: :info,
+ scheme: :default,
+ data: {
+ singleton: true
+ }
+ )) do |component|
+ component.with_action_button(
+ tag: :a,
+ href: meeting_path(@meeting),
+ data: { turbo: false },
+ size: :medium) { I18n.t("label_meeting_reload") }
+ I18n.t("notice_meeting_updated")
end
- end
-%>
+ %>
+</div>