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

Remove restrictions for attribute help texts

Oliver Günther65b22297d6df
diff --git a/app/controllers/attribute_help_texts_controller.rb b/app/controllers/attribute_help_texts_controller.rb
index 6ba1d5e982d..18a5cc9c481 100644
--- a/app/controllers/attribute_help_texts_controller.rb
+++ b/app/controllers/attribute_help_texts_controller.rb
@@ -31,7 +31,6 @@ class AttributeHelpTextsController < ApplicationController
menu_item :attribute_help_texts
before_action :authorize_global
- before_action :require_ee_token, except: %i[upsale]
before_action :find_entry, only: %i(edit update destroy)
before_action :find_type_scope
@@ -88,12 +87,6 @@ class AttributeHelpTextsController < ApplicationController
protected
- def require_ee_token
- unless EnterpriseToken.allows_to?(:attribute_help_texts)
- redirect_to upsale_attribute_help_texts_path
- end
- end
-
def default_breadcrumb
if action_name == 'index'
t('attribute_help_texts.label_plural')
diff --git a/app/services/authorization/enterprise_service.rb b/app/services/authorization/enterprise_service.rb
index f2333fb65ec..06bfbc87460 100644
--- a/app/services/authorization/enterprise_service.rb
+++ b/app/services/authorization/enterprise_service.rb
@@ -30,7 +30,6 @@ class Authorization::EnterpriseService
attr_accessor :token
GUARDED_ACTIONS = %i(
- attribute_help_texts
baseline_comparison
board_view
conditional_highlighting
diff --git a/config/initializers/menus.rb b/config/initializers/menus.rb
index e887dd6fb6a..e4e0ea01545 100644
--- a/config/initializers/menus.rb
+++ b/config/initializers/menus.rb
@@ -348,8 +348,7 @@ Redmine::MenuManager.map :admin_menu do |menu|
{ controller: '/attribute_help_texts' },
caption: :'attribute_help_texts.label_plural',
icon: 'help2',
- if: Proc.new { User.current.allowed_globally?(:edit_attribute_help_texts) },
- enterprise_feature: 'attribute_help_texts'
+ if: Proc.new { User.current.allowed_globally?(:edit_attribute_help_texts) }
menu.push :enumerations,
{ controller: '/enumerations' },
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 49ea414b360..413d4ec4502 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -108,8 +108,6 @@ en:
show_preview: "Preview text"
add_new: "Add help text"
edit: "Edit help text for %{attribute_caption}"
- enterprise:
- description: "Provide additional information for attributes (incl. custom fields) of work packages and projects. Help texts are displayed when users click on the question mark symbol next to input fields in projects and work packages."
background_jobs:
status:
diff --git a/spec/controllers/attribute_help_texts_controller_spec.rb b/spec/controllers/attribute_help_texts_controller_spec.rb
index 8b2947bfb9a..399437dabdc 100644
--- a/spec/controllers/attribute_help_texts_controller_spec.rb
+++ b/spec/controllers/attribute_help_texts_controller_spec.rb
@@ -1,6 +1,6 @@
require 'spec_helper'
-RSpec.describe AttributeHelpTextsController, with_ee: %i[attribute_help_texts] do
+RSpec.describe AttributeHelpTextsController do
let(:user) { build_stubbed(:user) }
let(:model) { build(:work_package_help_text) }
@@ -30,12 +30,6 @@ RSpec.describe AttributeHelpTextsController, with_ee: %i[attribute_help_texts] d
expect(response).to be_successful
expect(assigns(:texts_by_type)).to eql('WorkPackage' => [model])
end
-
- context 'with help texts disallowed by the enterprise token', with_ee: false do
- it 'redirects to upsale' do
- expect(response).to redirect_to upsale_attribute_help_texts_path
- end
- end
end
describe '#edit' do
@@ -52,12 +46,6 @@ RSpec.describe AttributeHelpTextsController, with_ee: %i[attribute_help_texts] d
end
end
- context 'with help texts disallowed by the enterprise token', with_ee: false do
- it 'redirects to upsale' do
- expect(response).to redirect_to upsale_attribute_help_texts_path
- end
- end
-
context 'when not found' do
let(:find_expectation) do
allow(AttributeHelpText)
@@ -131,15 +119,5 @@ RSpec.describe AttributeHelpTextsController, with_ee: %i[attribute_help_texts] d
expect(response).to have_http_status :not_found
end
end
-
- context 'with help texts disallowed by the enterprise token', with_ee: false do
- before do
- call
- end
-
- it 'redirects to upsale' do
- expect(response).to redirect_to upsale_attribute_help_texts_path
- end
- end
end
end
diff --git a/spec/features/admin/attribute_help_texts_spec.rb b/spec/features/admin/attribute_help_texts_spec.rb
index 8451a0b268e..9256022fdd3 100644
--- a/spec/features/admin/attribute_help_texts_spec.rb
+++ b/spec/features/admin/attribute_help_texts_spec.rb
@@ -37,7 +37,7 @@ RSpec.describe 'Attribute help texts', :js, :with_cuprite do
let(:image_fixture) { UploadedFile.load_from('spec/fixtures/files/image.png') }
let(:enterprise_token) { true }
- describe 'Work package help texts', with_ee: %i[attribute_help_texts] do
+ describe 'Work package help texts' do
before do
login_as(user_with_permission)
visit attribute_help_texts_path
@@ -152,12 +152,5 @@ RSpec.describe 'Attribute help texts', :js, :with_cuprite do
expect(AttributeHelpText.count).to be_zero
end
end
-
- context 'with help texts disallowed by the enterprise token', with_ee: false do
- it 'hides CRUD to attribute help texts' do
- expect(page).to have_current_path /upsale/
- expect(page).to have_text I18n.t('attribute_help_texts.enterprise.description')
- end
- end
end
end
diff --git a/spec/services/authorization/enterprise_service_spec.rb b/spec/services/authorization/enterprise_service_spec.rb
index ccdca03b538..21409fcf798 100644
--- a/spec/services/authorization/enterprise_service_spec.rb
+++ b/spec/services/authorization/enterprise_service_spec.rb
@@ -73,8 +73,7 @@ RSpec.describe Authorization::EnterpriseService do
end
end
- %i(attribute_help_texts
- baseline_comparison
+ %i(baseline_comparison
board_view
conditional_highlighting
custom_actions