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

Add outcome button frontend

Mir Bhatia3d8028d87005
diff --git a/modules/meeting/app/components/meeting_agenda_items/item_component/show_component.html.erb b/modules/meeting/app/components/meeting_agenda_items/item_component/show_component.html.erb
index c5aa4cc412f..e8329f22cc7 100644
--- a/modules/meeting/app/components/meeting_agenda_items/item_component/show_component.html.erb
+++ b/modules/meeting/app/components/meeting_agenda_items/item_component/show_component.html.erb
@@ -86,6 +86,14 @@
end
end
end
+
+ grid.with_area(:outcomes, tag: :div) do
+ flex_layout do |flex|
+ flex.with_row do
+ render(MeetingAgendaItems::Outcomes::NewButtonComponent.new(meeting: @meeting))
+ end
+ end
+ end
end
end
%>
diff --git a/modules/meeting/app/components/meeting_agenda_items/item_component/show_component.sass b/modules/meeting/app/components/meeting_agenda_items/item_component/show_component.sass
index bdc592222af..6a3604d9ff1 100644
--- a/modules/meeting/app/components/meeting_agenda_items/item_component/show_component.sass
+++ b/modules/meeting/app/components/meeting_agenda_items/item_component/show_component.sass
@@ -6,7 +6,7 @@ $meeting-agenda-item--presenter-width--mobile: 150px
.op-meeting-agenda-item
display: grid
grid-template-columns: 20px auto 1fr fit-content($meeting-agenda-item--presenter-width) fit-content(40px)
- grid-template-areas: "drag-handle content duration presenter actions" ". title title title title" ". notes notes notes notes"
+ grid-template-areas: "drag-handle content duration presenter actions" ". title title title title" ". notes notes notes notes" ". outcomes outcomes outcomes outcomes"
&--drag-handle,
&--duration,
@@ -39,7 +39,7 @@ $meeting-agenda-item--presenter-width--mobile: 150px
@media screen and (max-width: $breakpoint-lg)
grid-template-columns: 20px auto 1fr auto 50px
- grid-template-areas: "drag-handle content content content actions" ". title title title title" ". presenter duration . ." ". notes notes notes notes"
+ grid-template-areas: "drag-handle content content content actions" ". title title title title" ". presenter duration . ." ". notes notes notes notes" ". outcomes outcomes outcomes outcomes"
&--author
justify-self: stretch
diff --git a/modules/meeting/app/components/meeting_agenda_items/outcomes/new_button_component.html.erb b/modules/meeting/app/components/meeting_agenda_items/outcomes/new_button_component.html.erb
new file mode 100644
index 00000000000..2d864c3e88a
--- /dev/null
+++ b/modules/meeting/app/components/meeting_agenda_items/outcomes/new_button_component.html.erb
@@ -0,0 +1,18 @@
+<%=
+ component_wrapper(style: "position: relative") do
+ render(Primer::Alpha::ActionMenu.new(classes: "hide-when-print")) do |component|
+ component.with_show_button(scheme: button_scheme, disabled: @disabled) do |button|
+ button.with_leading_visual_icon(icon: :plus)
+ t("outcome.add_button")
+ end
+ component.with_item(
+ label: t("outcome.add_button"),
+ tag: :a,
+ content_arguments: {
+ # href: new_outcome_meeting_agenda_item_path(@meeting, type: "simple", meeting_section_id: @meeting_section&.id),
+ data: { "turbo-stream": true }
+ }
+ )
+ end
+ end
+%>
diff --git a/modules/meeting/app/components/meeting_agenda_items/outcomes/new_button_component.rb b/modules/meeting/app/components/meeting_agenda_items/outcomes/new_button_component.rb
new file mode 100644
index 00000000000..46eb069acb7
--- /dev/null
+++ b/modules/meeting/app/components/meeting_agenda_items/outcomes/new_button_component.rb
@@ -0,0 +1,59 @@
+# frozen_string_literal: true
+
+#-- 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.
+#++
+
+module MeetingAgendaItems::Outcomes
+ class NewButtonComponent < ApplicationComponent
+ include ApplicationHelper
+ include OpTurbo::Streamable
+ include OpPrimer::ComponentHelpers
+
+ def initialize(meeting:, meeting_agenda_item: nil, disabled: false)
+ super
+
+ @meeting = meeting
+ @meeting_agenda_item = meeting_agenda_item
+ @disabled = @meeting.closed? || disabled
+ end
+
+ private
+
+ def wrapper_uniq_by
+ @meeting_agenda_item&.id
+ end
+
+ def render?
+ true
+ end
+
+ def button_scheme
+ :secondary
+ end
+ end
+end
diff --git a/modules/meeting/config/locales/en.yml b/modules/meeting/config/locales/en.yml
index f466d9fc5ce..6b7f917d00d 100644
--- a/modules/meeting/config/locales/en.yml
+++ b/modules/meeting/config/locales/en.yml
@@ -362,6 +362,9 @@ en:
end_series_dialog:
title: "End meeting series"
+ outcome:
+ add_button: "Outcome"
+
notice_successful_notification: "Notification sent successfully"
notice_timezone_missing: No time zone is set and %{zone} is assumed. To choose your time zone, please click here.
notice_meeting_updated: "This page has been updated by someone else. Reload to view changes."