Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Remove recurring meeting feature flag" #17478

Merged
merged 1 commit into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions config/initializers/feature_decisions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
description: "Allows to generate a PDF document from a work package description. " \
"See #45896 for details."

OpenProject::FeatureDecisions.add :recurring_meetings,
description: "Differentiate between one-time and recurring meetings."

# TODO: Remove once the feature flag primerized_work_package_activities is removed altogether
OpenProject::FeatureDecisions.define_singleton_method(:primerized_work_package_activities_active?) do
Rails.env.production? ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,30 @@
I18n.t(:label_meeting)
end

menu.with_item(label: I18n.t("meeting.types.structured"),
tag: :a,
href: new_dialog_meetings_path(project_id: @project&.id, type: :structured),
content_arguments: { data: { controller: "async-dialog" }}
) do |item|
item.with_description.with_content(t("meeting.types.structured_text"))
end
if OpenProject::FeatureDecisions.recurring_meetings_active?
menu.with_item(label: I18n.t("meeting.types.one_time"),
tag: :a,
href: new_dialog_meetings_path(project_id: @project&.id, type: :structured),
content_arguments: { data: { controller: "async-dialog" }}
) do |item|
item.with_description.with_content(t("meeting.types.structured_text"))
end

menu.with_item(label: I18n.t("meeting.types.recurring"),
tag: :a,
href: new_dialog_meetings_path(project_id: @project&.id, type: :recurring),
content_arguments: { data: { controller: "async-dialog" }}
) do |item|
item.with_description.with_content(t("meeting.types.recurring_text"))
menu.with_item(label: I18n.t("meeting.types.recurring"),
tag: :a,
href: new_dialog_meetings_path(project_id: @project&.id, type: :recurring),
content_arguments: { data: { controller: "async-dialog" }}
) do |item|
item.with_description.with_content(t("meeting.types.recurring_text"))
end
else
menu.with_item(label: I18n.t("meeting.types.structured"),
tag: :a,
href: new_dialog_meetings_path(project_id: @project&.id, type: :structured),
content_arguments: { data: { controller: "async-dialog" }}
) do |item|
item.with_description.with_content(t("meeting.types.structured_text"))
end
end

menu.with_item(label: I18n.t("meeting.types.classic"),
Expand Down
14 changes: 11 additions & 3 deletions modules/meeting/app/menus/meetings/menu.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ def initialize(params:, project: nil)
def menu_items
[
OpenProject::Menu::MenuGroup.new(header: nil, children: top_level_menu_items),
OpenProject::Menu::MenuGroup.new(header: I18n.t(:label_meeting_series), children: meeting_series_menu_items),
meeting_series_menu_group,
OpenProject::Menu::MenuGroup.new(header: I18n.t(:label_involvement), children: involvement_sidebar_menu_items)
]
].compact
end

def top_level_menu_items
Expand All @@ -49,7 +49,13 @@ def top_level_menu_items
recurring_menu_item,
menu_item(title: I18n.t(:label_all_meetings),
query_params: { filters: all_filter })
]
].compact
end

def meeting_series_menu_group
return unless OpenProject::FeatureDecisions.recurring_meetings_active?

OpenProject::Menu::MenuGroup.new(header: I18n.t(:label_meeting_series), children: meeting_series_menu_items)
end

def meeting_series_menu_items
Expand All @@ -71,6 +77,8 @@ def meeting_series_menu_items
end

def recurring_menu_item
return unless OpenProject::FeatureDecisions.recurring_meetings_active?

recurring_filter = [{ type: { operator: "=", values: ["t"] } }].to_json

menu_item(title: I18n.t("label_recurring_meeting_plural"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ def human_name
I18n.t("label_recurring_meeting_part_of")
end

def available?
OpenProject::FeatureDecisions.recurring_meetings_active?
end

def apply_to(query_scope)
if allowed_values.first.intersect?(values)
query_scope.recurring
Expand Down
3 changes: 2 additions & 1 deletion modules/meeting/config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,8 @@ en:
types:
classic: "Classic"
classic_text: "Organize your meeting as a single formattable text agenda and protocol."
structured: "One-time"
structured: "Structured"
one_time: "One-time"
recurring: "Recurring"
recurring_text: "Create meeting series with dynamic template for each occurrence."
structured_text: "Organize your meeting as a dynamic list of agenda items, optionally linking them to a work package."
Expand Down
2 changes: 1 addition & 1 deletion modules/meeting/spec/features/meetings_index_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ def invite_to_meeting(meeting)
meetings_page.expect_create_new_button
end

it "allows creation of both types of meetings" do
it "allows creation of both types of meetings", with_flag: { recurring_meetings: true } do
meetings_page.visit!

meetings_page.expect_create_new_types
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@

RSpec.describe "Recurring meetings creation",
:js,
:with_cuprite do
:with_cuprite,
with_flag: { recurring_meetings: true } do
include Components::Autocompleter::NgSelectAutocompleteHelpers

shared_let(:project) { create(:project, enabled_module_names: %w[meetings]) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@

RSpec.describe "Recurring meetings CRUD",
:js,
:with_cuprite do
:with_cuprite,
with_flag: { recurring_meetings: true } do
include Components::Autocompleter::NgSelectAutocompleteHelpers

shared_let(:project) { create(:project, enabled_module_names: %w[meetings]) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@

RSpec.describe "Structured meetings CRUD",
:js,
:with_cuprite do
:with_cuprite,
with_flag: { recurring_meetings: true } do
include Components::Autocompleter::NgSelectAutocompleteHelpers

shared_let(:project) { create(:project, enabled_module_names: %w[meetings work_package_tracking]) }
Expand Down
Loading