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 in_progress state to meetings

Mir Bhatia974fe972db08
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 d60ac47ca9c..93aa74942a1 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
@@ -87,7 +87,7 @@
end
end
- if OpenProject::FeatureDecisions.meeting_outcomes_active?
+ if outcome_enabled?
grid.with_area(:outcomes, tag: :div) do
flex_layout do |flex|
flex.with_row do
diff --git a/modules/meeting/app/components/meeting_agenda_items/item_component/show_component.rb b/modules/meeting/app/components/meeting_agenda_items/item_component/show_component.rb
index ea9cfb2b6ee..81e5a6edfa8 100644
--- a/modules/meeting/app/components/meeting_agenda_items/item_component/show_component.rb
+++ b/modules/meeting/app/components/meeting_agenda_items/item_component/show_component.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) the OpenProject GmbH
@@ -49,11 +50,16 @@ module MeetingAgendaItems
private
def drag_and_drop_enabled?
- @meeting.open? && User.current.allowed_in_project?(:manage_agendas, @meeting.project)
+ [email protected]? && User.current.allowed_in_project?(:manage_agendas, @meeting.project)
end
def edit_enabled?
- @meeting.open? && User.current.allowed_in_project?(:manage_agendas, @meeting.project)
+ [email protected]? && User.current.allowed_in_project?(:manage_agendas, @meeting.project)
+ end
+
+ def outcome_enabled?
+ User.current.allowed_in_project?(:create_meeting_minutes,
+ @meeting.project) && OpenProject::FeatureDecisions.meeting_outcomes_active?
end
def first?
@@ -147,7 +153,7 @@ module MeetingAgendaItems
end
def notes_classes
- if OpenProject::FeatureDecisions.meeting_outcomes_active?
+ if OpenProject::FeatureDecisions.meeting_outcomes_active? && [email protected]?
"op-uc-container muted-color"
else
"op-uc-container"
diff --git a/modules/meeting/app/components/meeting_agenda_items/outcomes/base_component.html.erb b/modules/meeting/app/components/meeting_agenda_items/outcomes/base_component.html.erb
index a60dfcb8056..7e49b32d03d 100644
--- a/modules/meeting/app/components/meeting_agenda_items/outcomes/base_component.html.erb
+++ b/modules/meeting/app/components/meeting_agenda_items/outcomes/base_component.html.erb
@@ -1,7 +1,7 @@
<%=
component_wrapper do
grid_layout("op-meeting-outcome", tag: :div, id: "outcome-#{@meeting_agenda_item.id}", mt: 2) do |grid|
- if @hide_notes
+ if @hide_notes && outcome_enabled?
grid.with_area(:button) do
render(MeetingAgendaItems::Outcomes::NewButtonComponent.new(meeting: @meeting, meeting_agenda_item: @meeting_agenda_item))
end
@@ -9,7 +9,7 @@
unless @hide_notes
grid.with_area(:notes) do
- if @state == :edit
+ if @state == :edit && outcome_enabled?
render(MeetingAgendaItems::Outcomes::InputComponent.new(meeting: @meeting, meeting_agenda_item: @meeting_agenda_item, meeting_outcome: @meeting_outcome, hidden: false))
elsif @state == :show
render(MeetingAgendaItems::Outcomes::ShowNotesComponent.new(meeting_outcome: @meeting_outcome))
diff --git a/modules/meeting/app/components/meeting_agenda_items/outcomes/base_component.rb b/modules/meeting/app/components/meeting_agenda_items/outcomes/base_component.rb
index 4b4992135ff..b60ce883a0d 100644
--- a/modules/meeting/app/components/meeting_agenda_items/outcomes/base_component.rb
+++ b/modules/meeting/app/components/meeting_agenda_items/outcomes/base_component.rb
@@ -59,5 +59,9 @@ module MeetingAgendaItems
@hide_notes = false
end
end
+
+ def outcome_enabled?
+ @meeting.in_progress?
+ end
end
end
diff --git a/modules/meeting/app/components/meeting_agenda_items/outcomes/show_notes_component.rb b/modules/meeting/app/components/meeting_agenda_items/outcomes/show_notes_component.rb
index 5dba3613efc..488084869fe 100644
--- a/modules/meeting/app/components/meeting_agenda_items/outcomes/show_notes_component.rb
+++ b/modules/meeting/app/components/meeting_agenda_items/outcomes/show_notes_component.rb
@@ -44,7 +44,7 @@ module MeetingAgendaItems
private
def edit_enabled?
- @meeting.open? && User.current.allowed_in_project?(:create_meeting_minutes, @meeting.project)
+ @meeting.in_progress? && User.current.allowed_in_project?(:create_meeting_minutes, @meeting.project)
end
def edit_action_item(menu)
diff --git a/modules/meeting/app/components/meetings/side_panel/state_component.html.erb b/modules/meeting/app/components/meetings/side_panel/state_component.html.erb
index 83646b56bcc..68aa88525aa 100644
--- a/modules/meeting/app/components/meetings/side_panel/state_component.html.erb
+++ b/modules/meeting/app/components/meetings/side_panel/state_component.html.erb
@@ -6,6 +6,7 @@
case @meeting.state
when "open"
section.with_description(display: [:none, nil, :block]) { t("text_meeting_open_description") }
+
flex_layout(classes: "op-meeting-sidebar-state") do |open_state|
open_state.with_row do
render(Primer::Beta::State.new(title: "state", scheme: :open)) do
@@ -24,13 +25,13 @@
if edit_enabled?
section.with_footer_button(
tag: :a,
- href: change_state_project_meeting_path(@project, @meeting, state: "closed"),
+ href: change_state_project_meeting_path(@project, @meeting, state: "in_progress"),
classes: "hide-when-print",
data: { "turbo-stream": true, "turbo-method": "put" },
test_selector: "close-meeting-button"
) do |button|
- button.with_leading_visual_icon(icon: :unlock)
- t("label_meeting_close_action")
+ button.with_leading_visual_icon(icon: :play)
+ t("label_meeting_in_progress_action")
end
end
end
@@ -64,6 +65,38 @@
end
end
end
+ when "in_progress"
+ section.with_description(display: [:none, nil, :block]) { t("text_meeting_in_progress_description") }
+
+ flex_layout(classes: "op-meeting-sidebar-state") do |in_progress_state|
+ in_progress_state.with_row do
+ render(Primer::Beta::State.new(title: "state", scheme: :merged)) do
+ flex_layout do |in_progress_state_label|
+ in_progress_state_label.with_column(mr: 1) do
+ render(Primer::Beta::Octicon.new(icon: "play"))
+ end
+
+ in_progress_state_label.with_column do
+ render(Primer::Beta::Text.new) { t("label_meeting_state_in_progress") }
+ end
+ end
+ end
+ end
+
+ if edit_enabled?
+ section.with_footer_button(
+ tag: :a,
+ href: change_state_project_meeting_path(@project, @meeting, state: "closed"),
+ classes: "hide-when-print",
+ data: { "turbo-stream": true, "turbo-method": "put" },
+ test_selector: "close-meeting-button"
+ ) do |button|
+ button.with_leading_visual_icon(icon: :unlock)
+ t("label_meeting_close_action")
+ end
+ end
+ end
+
end
end
end
diff --git a/modules/meeting/app/controllers/meeting_agenda_items_controller.rb b/modules/meeting/app/controllers/meeting_agenda_items_controller.rb
index 6a9547f4dd0..0bb1055efc8 100644
--- a/modules/meeting/app/controllers/meeting_agenda_items_controller.rb
+++ b/modules/meeting/app/controllers/meeting_agenda_items_controller.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) the OpenProject GmbH
@@ -39,14 +40,14 @@ class MeetingAgendaItemsController < ApplicationController
before_action :authorize
def new
- if @meeting.open?
+ if @meeting.closed?
+ update_all_via_turbo_stream
+ render_error_flash_message_via_turbo_stream(message: t("text_meeting_not_editable_anymore"))
+ else
if params[:meeting_section_id].present?
meeting_section = @meeting.sections.find(params[:meeting_section_id])
end
render_agenda_item_form_via_turbo_stream(meeting_section:, type: @agenda_item_type)
- else
- update_all_via_turbo_stream
- render_error_flash_message_via_turbo_stream(message: t("text_meeting_not_editable_anymore"))
end
respond_with_turbo_streams
diff --git a/modules/meeting/app/controllers/meeting_outcomes_controller.rb b/modules/meeting/app/controllers/meeting_outcomes_controller.rb
index 05b470735ae..5ffb204fe6a 100644
--- a/modules/meeting/app/controllers/meeting_outcomes_controller.rb
+++ b/modules/meeting/app/controllers/meeting_outcomes_controller.rb
@@ -40,7 +40,7 @@ class MeetingOutcomesController < ApplicationController
before_action :authorize, except: %i[new create]
def new
- if @meeting.open?
+ if @meeting.in_progress?
render_outcome_form_via_turbo_stream(meeting: @meeting, meeting_agenda_item: @meeting_agenda_item)
else
update_all_via_turbo_stream
@@ -61,7 +61,7 @@ class MeetingOutcomesController < ApplicationController
.new(user: current_user)
.call(
meeting_agenda_item: @meeting_agenda_item,
- notes: params[:meeting_outcome][:outcome]
+ notes: params[:meeting_outcome][:notes]
)
@meeting_outcome = call.result
@@ -108,7 +108,7 @@ class MeetingOutcomesController < ApplicationController
.new(user: current_user, model: @meeting_outcome)
.call(
meeting_agenda_item: @meeting_agenda_item,
- notes: params[:meeting_outcome][:outcome]
+ notes: params[:meeting_outcome][:notes]
)
if call.success?
diff --git a/modules/meeting/app/controllers/meetings_controller.rb b/modules/meeting/app/controllers/meetings_controller.rb
index b7cfdf97cab..f0b80f93262 100644
--- a/modules/meeting/app/controllers/meetings_controller.rb
+++ b/modules/meeting/app/controllers/meetings_controller.rb
@@ -292,6 +292,8 @@ class MeetingsController < ApplicationController
@meeting.open!
when "closed"
@meeting.closed!
+ when "in_progress"
+ @meeting.in_progress!
end
if @meeting.errors.any?
diff --git a/modules/meeting/app/forms/meeting_agenda_item/outcome/notes.rb b/modules/meeting/app/forms/meeting_agenda_item/outcome/notes.rb
index be49d8d17e2..2f0b4d4a942 100644
--- a/modules/meeting/app/forms/meeting_agenda_item/outcome/notes.rb
+++ b/modules/meeting/app/forms/meeting_agenda_item/outcome/notes.rb
@@ -33,7 +33,7 @@ class MeetingAgendaItem::Outcome::Notes < ApplicationForm
form do |outcome_form|
outcome_form.rich_text_area(
- name: :outcome,
+ name: :notes,
label: "Outcome",
classes: "ck-editor-primer-adjusted",
rich_text_options: {
diff --git a/modules/meeting/app/models/meeting.rb b/modules/meeting/app/models/meeting.rb
index 22a7063d2da..4039e12dd32 100644
--- a/modules/meeting/app/models/meeting.rb
+++ b/modules/meeting/app/models/meeting.rb
@@ -114,6 +114,7 @@ class Meeting < ApplicationRecord
enum state: {
open: 0, # 0 -> default, leave values for future states between open and closed
planned: 1,
+ in_progress: 3,
cancelled: 4,
closed: 5
}
@@ -166,7 +167,7 @@ class Meeting < ApplicationRecord
end
def editable?(user = User.current)
- open? && user.allowed_in_project?(:edit_meetings, project)
+ !closed? && user.allowed_in_project?(:edit_meetings, project)
end
def invited_or_attended_participants
diff --git a/modules/meeting/config/locales/en.yml b/modules/meeting/config/locales/en.yml
index f260cefc795..40227100796 100644
--- a/modules/meeting/config/locales/en.yml
+++ b/modules/meeting/config/locales/en.yml
@@ -448,10 +448,13 @@ en:
label_meeting_state_planned: "Planned"
label_meeting_state_cancelled: "Cancelled"
label_meeting_state_skipped: "Skipped"
+ label_meeting_state_in_progress: "In progress"
label_meeting_reopen_action: "Reopen meeting"
label_meeting_close_action: "Close meeting"
+ label_meeting_in_progress_action: "Mark as in progress"
text_meeting_open_description: "This meeting is open. You can add/remove agenda items and edit them as you please. After the meeting is over, close it to lock it."
text_meeting_closed_description: "This meeting is closed. You cannot add/remove agenda items anymore."
+ text_meeting_in_progress_description: "This meeting is in progress. You can document outcomes for each agenda item, re-arrange them, and even add new ones. Once the meeting is complete, you can mark it as closed to lock it."
label_meeting_manage_participants: "Manage participants"
label_meeting_no_participants: "No participants"