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
Display new texts only when feature flag enabled
Christophe Bliard0bb4c2349ce9
diff --git a/app/components/work_packages/progress/work_based/modal_body_component.html.erb b/app/components/work_packages/progress/work_based/modal_body_component.html.erbindex 49e1a8bdb25..3451bc3d3b7 100644--- a/app/components/work_packages/progress/work_based/modal_body_component.html.erb+++ b/app/components/work_packages/progress/work_based/modal_body_component.html.erb@@ -40,7 +40,12 @@<% modal_body.with_row(mt: 3) do |_tooltip| %><%= render(Primer::Beta::Text.new(font_weight: :semibold)) { t("work_package.progress.label_note") } %>- <%= render(Primer::Beta::Text.new) { t("work_package.progress.modal.work_based_help_text") } %>+ <% if OpenProject::FeatureDecisions.percent_complete_edition_active? %>+ <%= render(Primer::Beta::Text.new) { t("work_package.progress.modal.work_based_help_text") } %>+ <% else %>+ <%# This condition branch to be removed in 15.0 with :percent_complete_edition feature flag removal %>+ <%= render(Primer::Beta::Text.new) { t("work_package.progress.modal.work_based_help_text_pre_14_4_without_percent_complete_edition") } %>+ <% end %><%= render(Primer::Beta::Link.new(href: learn_more_href)) { t(:label_learn_more) } %><% end %>diff --git a/app/views/admin/settings/work_packages_settings/show.html.erb b/app/views/admin/settings/work_packages_settings/show.html.erbindex 3baa0765efe..24865fffc3c 100644--- a/app/views/admin/settings/work_packages_settings/show.html.erb+++ b/app/views/admin/settings/work_packages_settings/show.html.erb@@ -38,12 +38,11 @@ See COPYRIGHT and LICENSE files for more details.end%>--<%= styled_form_tag({ action: :update }, method: :patch) do %><section class="form--section"data-application-target="dynamic"- data-controller="admin--work-packages-settings">+ data-controller="admin--work-packages-settings"+ data-admin--work-packages-settings-percent-complete-edition-active-value="<%= OpenProject::FeatureDecisions.percent_complete_edition_active? %>"><div class="form--field"><%= setting_check_box :cross_project_work_package_relations %></div><div class="form--field"><%= setting_check_box :display_subprojects_work_packages %></div><div class="form--field"><%= setting_check_box :work_package_startdate_is_adddate %></div>@@ -53,7 +52,14 @@ See COPYRIGHT and LICENSE files for more details.container_class: "-middle",data: { admin__work_packages_settings_target: "progressCalculationModeSelect",action: "change->admin--work-packages-settings#displayWarning" } %>- <div class="form--field-instructions"><%= t("setting_work_package_done_ratio_explanation_html") %></div>+ <div class="form--field-instructions"><%=+ if OpenProject::FeatureDecisions.percent_complete_edition_active?+ t("setting_work_package_done_ratio_explanation_html")+ else+ # This condition branch to be removed in 15.0 with :percent_complete_edition feature flag removal+ t("setting_work_package_done_ratio_explanation_pre_14_4_without_percent_complete_edition_html")+ end+ %></div></div><div class="op-toast -warning -with-bottom-spacing"hidden@@ -76,7 +82,7 @@ See COPYRIGHT and LICENSE files for more details.ee_feature: :conditional_highlighting,explanation: t("js.work_packages.table_configuration.upsale.attribute_highlighting"),link_out: {- href: "https://www.openproject.org/enterprise-edition/?op_edtion=community-edition&op_referrer=settings-wp-attribute-highlighting#attribute-highlighting",+ href: "https://www.openproject.org/enterprise-edition/?op_edition=community-edition&op_referrer=settings-wp-attribute-highlighting#attribute-highlighting",caption: t("js.work_packages.table_configuration.upsale.check_out_link")}} %>diff --git a/config/locales/en.yml b/config/locales/en.ymlindex 4d015ed09ee..37d0bcdd9e9 100644--- a/config/locales/en.yml+++ b/config/locales/en.yml@@ -3220,10 +3220,13 @@ en:setting_work_package_done_ratio: "Progress calculation"setting_work_package_done_ratio_field: "Work-based"setting_work_package_done_ratio_status: "Status-based"+ setting_work_package_done_ratio_explanation_pre_14_4_without_percent_complete_edition_html: >+ In <b>work-based</b> mode, % Complete is calculated from how much work is done in relation to total work.+ In <b>status-based</b> mode, each status has a % Complete value associated with it. Changing status will change % Complete.setting_work_package_done_ratio_explanation_html: >- In <b>work-based</b> mode, % Complete can be freely set to any value.+ In <b>work-based</b> mode, % Complete can be freely set to any value.If you optionally enter a value for Work, Remaining work will automatically be derived.- In <b>status-based</b> mode, each status has a % Complete value associated with it. Changing status will change % Complete.+ In <b>status-based</b> mode, each status has a % Complete value associated with it. Changing status will change % Complete.setting_work_package_properties: "Work package properties"setting_work_package_startdate_is_adddate: "Use current date as start date for new work packages"setting_work_packages_projects_export_limit: "Work packages / Projects export limit"@@ -3691,7 +3694,8 @@ en:progress:label_note: "Note:"modal:- work_based_help_text: "% Complete is automatically derived from Work and Remaining work."+ work_based_help_text: "Each field is automatically calculated from the two others when possible."+ work_based_help_text_pre_14_4_without_percent_complete_edition: "% Complete is automatically derived from Work and Remaining work."status_based_help_text: "% Complete is set by work package status."migration_warning_text: "In work-based progress calculation mode, % Complete cannot be manually set and is tied to Work. The existing value has been kept but cannot be edited. Please input Work first."permissions:diff --git a/config/locales/js-en.yml b/config/locales/js-en.ymlindex e8db63dd3ad..4b3ba8bec20 100644--- a/config/locales/js-en.yml+++ b/config/locales/js-en.yml@@ -306,6 +306,12 @@ en:Are you sure you want to continue?work_packages_settings:+ warning_progress_calculation_mode_change_from_status_to_field_pre_14_4_without_percent_complete_edition_html: >-+ Changing progress calculation mode from status-based to work-based will make+ <i>% Complete</i> a non-editable field whose value is derived from <i>Work</i>+ and <i>Remaining work</i>. Existing values for <i>% Complete</i> are preserved.+ If values for <i>Work</i> and <i>Remaining work</i> were not present, they+ will be required in order to change <i>% Complete</i>.warning_progress_calculation_mode_change_from_status_to_field_html: >-Changing progress calculation mode from status-based to work-based will makethe <i>% Complete</i> field freely editable. If you optionally enter valuesdiff --git a/frontend/src/stimulus/controllers/dynamic/admin/work-packages-settings.controller.ts b/frontend/src/stimulus/controllers/dynamic/admin/work-packages-settings.controller.tsindex 147cb918ba9..12db2a5a736 100644--- a/frontend/src/stimulus/controllers/dynamic/admin/work-packages-settings.controller.ts+++ b/frontend/src/stimulus/controllers/dynamic/admin/work-packages-settings.controller.ts@@ -31,12 +31,18 @@import { Controller } from '@hotwired/stimulus';export default class WorkPackagesSettingsController extends Controller {+ static values = {+ percentCompleteEditionActive: Boolean,+ };+static targets = ['progressCalculationModeSelect','warningText','warningToast',];+ declare readonly percentCompleteEditionActiveValue:boolean;+declare readonly progressCalculationModeSelectTarget:HTMLSelectElement;declare readonly warningTextTarget:HTMLElement;declare readonly warningToastTarget:HTMLElement;@@ -58,9 +64,16 @@ export default class WorkPackagesSettingsController extends Controller {getWarningMessageHtml():string {const newMode = this.progressCalculationModeSelectTarget.value;++ // to be removed in 15.0 with :percent_complete_edition feature flag removal+ if (!this.percentCompleteEditionActiveValue && newMode === 'field') {+ return I18n.t(+ 'js.admin.work_packages_settings.warning_progress_calculation_mode_change_from_status_to_field_pre_14_4_without_percent_complete_edition_html',+ );+ }+return I18n.t(`js.admin.work_packages_settings.warning_progress_calculation_mode_change_from_${this.initialMode}_to_${newMode}_html`,- { defaultValue: '' },);}}