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

hide link on project phase on missing enterprise token

ulferts27d87c798671
diff --git a/app/components/projects/settings/life_cycle_steps/step_component.html.erb b/app/components/projects/settings/life_cycle_steps/step_component.html.erb
index c198e9f52bf..9532a793670 100644
--- a/app/components/projects/settings/life_cycle_steps/step_component.html.erb
+++ b/app/components/projects/settings/life_cycle_steps/step_component.html.erb
@@ -7,7 +7,7 @@
render(
Projects::PhaseDefinitionComponent.new(
definition,
- edit_link: User.current.admin?,
+ edit_link: definition_editable?,
phase_text_options: { classes: "filter-target-visible-text" }
)
)
diff --git a/app/components/projects/settings/life_cycle_steps/step_component.rb b/app/components/projects/settings/life_cycle_steps/step_component.rb
index 2dd0f59b647..f53990c6670 100644
--- a/app/components/projects/settings/life_cycle_steps/step_component.rb
+++ b/app/components/projects/settings/life_cycle_steps/step_component.rb
@@ -33,6 +33,7 @@ module Projects
include ApplicationHelper
include OpPrimer::ComponentHelpers
include OpTurbo::Streamable
+ include Projects::LifeCycleDefinitionHelper
options :definition,
:active?
@@ -40,6 +41,10 @@ module Projects
def toggle_aria_label
I18n.t("projects.settings.life_cycle.step.use_in_project", step: definition.name)
end
+
+ def definition_editable?
+ User.current.admin? && allowed_to_customize_life_cycle?
+ end
end
end
end