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

Use separate label and placeholder for Duration

Alexander Brandon Coles721c2a7b0b3d
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 68b5971eb03..7b95ca41278 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -2149,6 +2149,9 @@ en:
one: "1 s"
other: "%{count} s"
units:
+ minute_abbreviated:
+ one: "min"
+ other: "mins"
hour:
one: "hour"
other: "hours"
diff --git a/modules/meeting/app/forms/meeting_agenda_item/duration.rb b/modules/meeting/app/forms/meeting_agenda_item/duration.rb
index f8d40142f8d..116c785f16f 100644
--- a/modules/meeting/app/forms/meeting_agenda_item/duration.rb
+++ b/modules/meeting/app/forms/meeting_agenda_item/duration.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) the OpenProject GmbH
@@ -31,7 +32,7 @@ class MeetingAgendaItem::Duration < ApplicationForm
form do |agenda_item_form|
agenda_item_form.text_field(
name: :duration_in_minutes,
- placeholder: I18n.t("activerecord.attributes.meeting_agenda_item.duration_in_minutes"),
+ placeholder: I18n.t("datetime.units.minute_abbreviated", count: 2),
label: MeetingAgendaItem.human_attribute_name(:duration_in_minutes),
leading_visual: { icon: :stopwatch },
visually_hide_label: true,
diff --git a/modules/meeting/config/locales/en.yml b/modules/meeting/config/locales/en.yml
index 215dece663b..b2b5ab049dd 100644
--- a/modules/meeting/config/locales/en.yml
+++ b/modules/meeting/config/locales/en.yml
@@ -56,7 +56,7 @@ en:
meeting_agenda_item:
title: "Title"
author: "Author"
- duration_in_minutes: "min"
+ duration_in_minutes: "Duration"
description: "Notes"
presenter: "Presenter"
meeting_section:
diff --git a/modules/meeting/spec/components/meeting_agenda_items/form_component_spec.rb b/modules/meeting/spec/components/meeting_agenda_items/form_component_spec.rb
index 03b3d9a3be4..e6265ee79b5 100644
--- a/modules/meeting/spec/components/meeting_agenda_items/form_component_spec.rb
+++ b/modules/meeting/spec/components/meeting_agenda_items/form_component_spec.rb
@@ -59,7 +59,7 @@ RSpec.describe MeetingAgendaItems::FormComponent, type: :component do
end
it "renders duration field" do
- expect(rendered_component).to have_field "min", type: :number
+ expect(rendered_component).to have_field "Duration", type: :number, placeholder: "mins"
end
it "renders presenter field" do
diff --git a/modules/meeting/spec/features/structured_meetings/history_spec.rb b/modules/meeting/spec/features/structured_meetings/history_spec.rb
index 78d9296e73d..252b096e245 100644
--- a/modules/meeting/spec/features/structured_meetings/history_spec.rb
+++ b/modules/meeting/spec/features/structured_meetings/history_spec.rb
@@ -132,7 +132,7 @@ RSpec.describe "history",
show_page.add_agenda_item do
fill_in "Title", with: "My agenda item"
- fill_in "min", with: "25"
+ fill_in "Duration", with: "25"
end
show_page.expect_agenda_item(title: "My agenda item")
@@ -157,7 +157,7 @@ RSpec.describe "history",
item = MeetingAgendaItem.find_by(title: "My agenda item")
show_page.edit_agenda_item(item) do
fill_in "Title", with: "Updated title"
- fill_in "min", with: "5"
+ fill_in "Duration", with: "5"
click_on "Save"
end
diff --git a/modules/meeting/spec/features/structured_meetings/structured_meeting_crud_spec.rb b/modules/meeting/spec/features/structured_meetings/structured_meeting_crud_spec.rb
index 02be677f193..ba3bb042a06 100644
--- a/modules/meeting/spec/features/structured_meetings/structured_meeting_crud_spec.rb
+++ b/modules/meeting/spec/features/structured_meetings/structured_meeting_crud_spec.rb
@@ -96,7 +96,7 @@ RSpec.describe "Meetings CRUD",
# Can add and edit a single item
show_page.add_agenda_item do
fill_in "Title", with: "My agenda item"
- fill_in "min", with: "25"
+ fill_in "Duration", with: "25"
end
show_page.expect_agenda_item title: "My agenda item"
@@ -181,7 +181,7 @@ RSpec.describe "Meetings CRUD",
show_page.add_agenda_item do
fill_in "Title", with: "My agenda item"
- fill_in "min", with: "25"
+ fill_in "Duration", with: "25"
end
show_page.expect_agenda_item title: "My agenda item"
@@ -268,7 +268,7 @@ RSpec.describe "Meetings CRUD",
# Can add and edit a single item
show_page.add_agenda_item do
fill_in "Title", with: "My agenda item"
- fill_in "min", with: "25"
+ fill_in "Duration", with: "25"
end
show_page.expect_agenda_item title: "My agenda item"
@@ -290,7 +290,7 @@ RSpec.describe "Meetings CRUD",
show_page.add_agenda_item do
fill_in "Title", with: "My agenda item"
- fill_in "min", with: "25"
+ fill_in "Duration", with: "25"
end
show_page.expect_agenda_item title: "My agenda item"
@@ -468,7 +468,7 @@ RSpec.describe "Meetings CRUD",
# add an item to the latest section
show_page.add_agenda_item do
fill_in "Title", with: "First item"
- fill_in "min", with: "25"
+ fill_in "Duration", with: "25"
end
show_page.expect_agenda_item_in_section title: "First item", section: second_section
@@ -479,7 +479,7 @@ RSpec.describe "Meetings CRUD",
item_in_second_section = MeetingAgendaItem.find_by!(title: "First item")
show_page.edit_agenda_item(item_in_second_section) do
- fill_in "min", with: "15"
+ fill_in "Duration", with: "15"
click_on "Save"
end