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

Incorporate review feedback

Mir Bhatiaa3f92fda068a
diff --git a/frontend/src/stimulus/controllers/dynamic/meetings/form.controller.ts b/frontend/src/stimulus/controllers/dynamic/meetings/form.controller.ts
index b195aefcce4..236c0662de0 100644
--- a/frontend/src/stimulus/controllers/dynamic/meetings/form.controller.ts
+++ b/frontend/src/stimulus/controllers/dynamic/meetings/form.controller.ts
@@ -1,3 +1,33 @@
+/*
+ * -- 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.
+ * ++
+ */
+
import { ApplicationController } from 'stimulus-use';
import { TurboRequestsService } from 'core-app/core/turbo/turbo-requests.service';
import { PathHelperService } from 'core-app/core/path-helper/path-helper.service';
diff --git a/modules/meeting/app/components/meetings/index/form_component.html.erb b/modules/meeting/app/components/meetings/index/form_component.html.erb
index ebc17facfaf..e2b8d4e7b5e 100644
--- a/modules/meeting/app/components/meetings/index/form_component.html.erb
+++ b/modules/meeting/app/components/meetings/index/form_component.html.erb
@@ -7,8 +7,9 @@
data: {
turbo: true,
controller: [
+ "meetings--form",
"show-when-value-selected",
- @meeting.is_a?(RecurringMeeting) ? "recurring-meetings--form meetings--form" : "meetings--form"
+ @meeting.is_a?(RecurringMeeting) ? "recurring-meetings--form" : nil
].compact.join(" "),
"application-target": "dynamic"
},
diff --git a/modules/meeting/app/controllers/meetings_controller.rb b/modules/meeting/app/controllers/meetings_controller.rb
index 40bd8cab8e2..3a49a1af0a3 100644
--- a/modules/meeting/app/controllers/meetings_controller.rb
+++ b/modules/meeting/app/controllers/meetings_controller.rb
@@ -330,6 +330,8 @@ class MeetingsController < ApplicationController
end
def fetch_timezone
+ return unless timezone_params.keys.count == 2
+
User.execute_as(User.current) do
meeting = Meeting.new(timezone_params)
@text = friendly_timezone_name(User.current.time_zone, period: meeting.start_time)
@@ -563,6 +565,6 @@ class MeetingsController < ApplicationController
params.require(:structured_meeting)
end
- meeting_params.permit(:start_date, :start_time_hour).compact_blank
+ @timezone_params ||= meeting_params.permit(:start_date, :start_time_hour).compact_blank
end
end
diff --git a/modules/meeting/app/forms/meeting/time_group.rb b/modules/meeting/app/forms/meeting/time_group.rb
index 01414be73ad..842f09c2753 100644
--- a/modules/meeting/app/forms/meeting/time_group.rb
+++ b/modules/meeting/app/forms/meeting/time_group.rb
@@ -81,8 +81,8 @@ class Meeting::TimeGroup < ApplicationForm
super()
@meeting = meeting
- @initial_time = meeting.start_time_hour.presence || format_time(meeting.start_time, include_date: false, format: "%H:%M")
- @initial_date = meeting.start_date.presence || format_time_as_date(meeting.start_time, format: "%Y-%m-%d")
+ @initial_time = meeting.start_time_hour.presence
+ @initial_date = meeting.start_date.presence
duration = duration_value(meeting)
@duration = duration.nil? ? "" : ChronicDuration.output(duration * 3600, format: :hours_only)