Skip to content

Commit

Permalink
Change title for "Lag" field and make it a number field
Browse files Browse the repository at this point in the history
  • Loading branch information
HDinger committed Nov 29, 2024
1 parent 54c8e03 commit fdb15b5
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ def destroy_path
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down
3 changes: 2 additions & 1 deletion config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit fdb15b5

Please sign in to comment.