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

Change title for "Lag" field and make it a number field

Henriette Dargefdb15b5f8109
diff --git a/app/components/work_package_relations_tab/relation_component.html.erb b/app/components/work_package_relations_tab/relation_component.html.erb
index 845b5cd6475..b4cdd78822b 100644
--- a/app/components/work_package_relations_tab/relation_component.html.erb
+++ b/app/components/work_package_relations_tab/relation_component.html.erb
@@ -66,8 +66,7 @@ flex_layout do |flex|
end
dates_row.with_column(mr: 3) do
render(Primer::Beta::Text.new) do
- "#{I18n.t("work_package_relations_tab.lag.title")}: #{I18n.t('datetime.distance_in_words.x_days',
- count: relation.lag)}"
+ lag_as_text(relation.lag)
end
end
end
@@ -95,8 +94,7 @@ flex_layout do |flex|
end
dates_row.with_column(mr: 1) do
render(Primer::Beta::Text.new) do
- "#{I18n.t("work_package_relations_tab.lag.title")}: #{I18n.t('datetime.distance_in_words.x_days',
- count: relation.lag)}"
+ lag_as_text(relation.lag)
end
end
end
diff --git a/app/components/work_package_relations_tab/relation_component.rb b/app/components/work_package_relations_tab/relation_component.rb
index 18305fceb00..2e3159517dc 100644
--- a/app/components/work_package_relations_tab/relation_component.rb
+++ b/app/components/work_package_relations_tab/relation_component.rb
@@ -95,6 +95,10 @@ class WorkPackageRelationsTab::RelationComponent < ApplicationComponent
end
end
+ def lag_as_text(lag)
+ "#{I18n.t('work_package_relations_tab.lag.subject')}: #{I18n.t('datetime.distance_in_words.x_days', count: lag)}"
+ end
+
def action_menu_test_selector
"op-relation-row-#{underlying_resource_id}-action-menu"
end
diff --git a/app/components/work_package_relations_tab/work_package_relation_form_component.html.erb b/app/components/work_package_relations_tab/work_package_relation_form_component.html.erb
index fb5f19b82d3..265c386fd47 100644
--- a/app/components/work_package_relations_tab/work_package_relation_form_component.html.erb
+++ b/app/components/work_package_relations_tab/work_package_relation_form_component.html.erb
@@ -63,7 +63,8 @@
if lag_shown
my_form.text_field(
name: :lag,
- label: Relation.human_attribute_name(:lag),
+ type: :number,
+ label: I18n.t("work_package_relations_tab.lag.title"),
caption: I18n.t("work_package_relations_tab.lag.caption"),
input_width: :small,
)
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 387c253df5d..354204222c6 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -717,7 +717,8 @@ en:
label_edit_x: "Edit %{x}"
label_add_description: "Add description"
lag:
- title: "Lag"
+ subject: "Lag"
+ title: "Lag (in days)"
caption: "The gap in number of working days in between the two work packages"
relations:
label_relates_singular: "related to"