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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
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.rbindex 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 < ApplicationControllermenu_item :attribute_help_textsbefore_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 < ApplicationControllerprotected- def require_ee_token- unless EnterpriseToken.allows_to?(:attribute_help_texts)- redirect_to upsale_attribute_help_texts_path- end- end-def default_breadcrumbif action_name == 'index't('attribute_help_texts.label_plural')diff --git a/app/services/authorization/enterprise_service.rb b/app/services/authorization/enterprise_service.rbindex f2333fb65ec..06bfbc87460 100644--- a/app/services/authorization/enterprise_service.rb+++ b/app/services/authorization/enterprise_service.rb@@ -30,7 +30,6 @@ class Authorization::EnterpriseServiceattr_accessor :tokenGUARDED_ACTIONS = %i(- attribute_help_textsbaseline_comparisonboard_viewconditional_highlightingdiff --git a/config/initializers/menus.rb b/config/initializers/menus.rbindex 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.ymlindex 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.rbindex 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 dolet(:user) { build_stubbed(:user) }let(:model) { build(:work_package_help_text) }@@ -30,12 +30,6 @@ RSpec.describe AttributeHelpTextsController, with_ee: %i[attribute_help_texts] dexpect(response).to be_successfulexpect(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- endenddescribe '#edit' do@@ -52,12 +46,6 @@ RSpec.describe AttributeHelpTextsController, with_ee: %i[attribute_help_texts] dendend- 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' dolet(:find_expectation) doallow(AttributeHelpText)@@ -131,15 +119,5 @@ RSpec.describe AttributeHelpTextsController, with_ee: %i[attribute_help_texts] dexpect(response).to have_http_status :not_foundendend-- 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- endendenddiff --git a/spec/features/admin/attribute_help_texts_spec.rb b/spec/features/admin/attribute_help_texts_spec.rbindex 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 dolet(: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' dobefore dologin_as(user_with_permission)visit attribute_help_texts_path@@ -152,12 +152,5 @@ RSpec.describe 'Attribute help texts', :js, :with_cuprite doexpect(AttributeHelpText.count).to be_zeroendend-- 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- endendenddiff --git a/spec/services/authorization/enterprise_service_spec.rb b/spec/services/authorization/enterprise_service_spec.rbindex 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 doendend- %i(attribute_help_texts- baseline_comparison+ %i(baseline_comparisonboard_viewconditional_highlightingcustom_actions