Skip to content

Commit 01f8dd5

Browse files
Merge remote-tracking branch 'origin/chore/pir-ee-flag' into release/17.1
2 parents 5ffcb63 + 738e081 commit 01f8dd5

File tree

17 files changed

+75
-48
lines changed

17 files changed

+75
-48
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ gem "aws-sdk-core", "~> 3.241"
202202
# File upload via fog + screenshots on travis
203203
gem "aws-sdk-s3", "~> 1.211"
204204

205-
gem "openproject-token", "~> 8.5.0"
205+
gem "openproject-token", "~> 8.6.0"
206206

207207
gem "plaintext", "~> 0.3.7"
208208

Gemfile.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -884,7 +884,7 @@ GEM
884884
activesupport (>= 7.2.0)
885885
openproject-octicons (>= 19.30.1)
886886
view_component (>= 3.1, < 5.0)
887-
openproject-token (8.5.0)
887+
openproject-token (8.6.0)
888888
activemodel
889889
openssl (4.0.0)
890890
openssl-signature_algorithm (1.3.0)
@@ -1657,7 +1657,7 @@ DEPENDENCIES
16571657
openproject-reporting!
16581658
openproject-storages!
16591659
openproject-team_planner!
1660-
openproject-token (~> 8.5.0)
1660+
openproject-token (~> 8.6.0)
16611661
openproject-two_factor_authentication!
16621662
openproject-webhooks!
16631663
openproject-xls_export!
@@ -2033,7 +2033,7 @@ CHECKSUMS
20332033
openproject-reporting (1.0.0)
20342034
openproject-storages (1.0.0)
20352035
openproject-team_planner (1.0.0)
2036-
openproject-token (8.5.0) sha256=c32481bf8c4a55c44a8ed826e3772c0585e6c5fec1cc0dd28f737de24904631c
2036+
openproject-token (8.6.0) sha256=f5865070bd0586f618f476d22544cfa680916e3ff23aea8199a46e31b8a2970e
20372037
openproject-two_factor_authentication (1.0.0)
20382038
openproject-webhooks (1.0.0)
20392039
openproject-xls_export (1.0.0)
322 KB
Loading

app/controllers/projects/settings/creation_wizard_controller.rb

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class Projects::Settings::CreationWizardController < Projects::SettingsControlle
3333

3434
menu_item :settings_creation_wizard
3535

36-
before_action :check_feature_flag
36+
before_action :check_enterprise_plan, only: :toggle
3737

3838
def show; end
3939

@@ -92,6 +92,16 @@ def disable_all_of_section
9292

9393
private
9494

95+
def check_enterprise_plan
96+
# Allow disabling even without enterprise plan
97+
return if @project.project_creation_wizard_enabled
98+
99+
unless EnterpriseToken.allows_to?(:project_creation_wizard)
100+
flash[:error] = I18n.t(:notice_requires_enterprise_token)
101+
redirect_to project_settings_creation_wizard_path(@project, tab: "attributes"), status: :see_other
102+
end
103+
end
104+
95105
def update_section_mappings(value)
96106
section_id = permitted_params.project_custom_field_project_mapping[:custom_field_section_id]
97107
project_id = permitted_params.project_custom_field_project_mapping[:project_id]
@@ -108,12 +118,6 @@ def update_section_mappings(value)
108118
redirect_to project_settings_creation_wizard_path(@project, tab: "attributes"), status: :see_other
109119
end
110120

111-
def check_feature_flag
112-
unless OpenProject::FeatureDecisions.project_initiation_active?
113-
render_404
114-
end
115-
end
116-
117121
def update_settings_for_tab(tab, settings_params)
118122
call = Projects::UpdateService
119123
.new(model: @project, user: current_user, contract_class: Projects::SettingsContract)

app/services/projects/creation_wizard/reupload_artifact_on_status_changes_service.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ def initialize(current_user:, work_package:)
4646
end
4747

4848
def call!(changes:)
49-
return unless OpenProject::FeatureDecisions.project_initiation_active?
5049
return if changes["status_id"].blank?
5150
return unless update_is_artifact_work_package?
5251

app/views/projects/settings/creation_wizard/show.html.erb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,9 @@ See COPYRIGHT and LICENSE files for more details.
4242
<%= render partial: "export" %>
4343
<% end %>
4444
<% else %>
45-
<%= render Projects::Settings::CreationWizard::BlankSlateComponent.new(project: @project) %>
45+
<% with_enterprise_banner_guard(:project_creation_wizard,
46+
variant: :large,
47+
image: "enterprise/project-creation-wizard.png") do %>
48+
<%= render Projects::Settings::CreationWizard::BlankSlateComponent.new(project: @project) %>
49+
<% end %>
4650
<% end %>

config/initializers/feature_decisions.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,3 @@
6767
description: "Enables the new project overview experience.",
6868
force_active: true
6969

70-
OpenProject::FeatureDecisions.add :project_initiation,
71-
description: "Activate the project creation and initiation wizard"

config/initializers/menus.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -742,8 +742,7 @@
742742
},
743743
project_custom_fields: { caption: :label_project_attributes_plural },
744744
creation_wizard: {
745-
caption: :"settings.project_initiation_request.name.options.project_initiation_request",
746-
if: ->(_) { OpenProject::FeatureDecisions.project_initiation_active? }
745+
caption: :"settings.project_initiation_request.name.options.project_initiation_request"
747746
},
748747
modules: { caption: :label_module_plural },
749748
template: { caption: :"projects.settings.template.menu_title" },

config/locales/en.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2592,6 +2592,7 @@ en:
25922592
one_drive_sharepoint_file_storage: OneDrive/SharePoint File Storage
25932593
placeholder_users: Placeholder Users
25942594
portfolio_management: Portfolio management
2595+
project_creation_wizard: Project initiation request
25952596
project_list_sharing: Project List Sharing
25962597
readonly_work_packages: Readonly Work Packages
25972598
scim_api: SCIM server API
@@ -2677,6 +2678,8 @@ en:
26772678
description: "Enable users to log in via external SSO providers using SAML or OpenID Connect for seamless access and integration with existing identity systems."
26782679
virus_scanning:
26792680
description: "Ensure uploaded files in OpenProject are scanned for viruses before being accessible by other users."
2681+
project_creation_wizard:
2682+
description: "Generate a step-by-step wizard to help project managers fill out a project initiation request."
26802683
placeholder_users:
26812684
title: Placeholder users
26822685
description: >

modules/overviews/app/components/overviews/page_header_component.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@ def allowed_to_archive?
7878
end
7979

8080
def allowed_to_export_project_initiation_pdf?
81-
OpenProject::FeatureDecisions.project_initiation_active? &&
82-
project.project_creation_wizard_enabled &&
81+
project.project_creation_wizard_enabled &&
8382
current_user.allowed_in_project?(:export_projects, project)
8483
end
8584
end

0 commit comments

Comments
 (0)