Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump Primer to 0.52.2 version #17667

Merged
merged 10 commits into from
Jan 22, 2025
Merged

Bump Primer to 0.52.2 version #17667

merged 10 commits into from
Jan 22, 2025

Conversation

bsatarnejad
Copy link
Contributor

Ticket

https://community.openproject.org/wp/59860

What are you trying to accomplish?

Bump Primer to 0.52.2 version
Use trailing units in WP create relation modal and meeting add and edit form.

caption: I18n.t("text_in_hours"),
trailing_visual: { text: { text: I18n.t("text_hours") } },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @bsatarnejad! There is already a translation in core that we can use here, I think: datetime.units.hour:

    units:
      hour:
        one: "hour"
        other: "hours"

So you should be able to call I18n.t("datetime.units.hour", count: 2) or I18n.t("datetime.units.hour.other") (I'm not sure which is the more correct use of the I18n API though)

Copy link
Contributor Author

@bsatarnejad bsatarnejad Jan 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @myabc
Thanks for the hint 👍
We may use units more in the future, so it would be better to define them generally in one place, not for a specific case.

@bsatarnejad bsatarnejad self-assigned this Jan 20, 2025
@bsatarnejad bsatarnejad requested review from myabc and HDinger January 21, 2025 07:39
Copy link
Contributor

@HDinger HDinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The syntax trailing_visual: { text: { text: .. looks somehow weird, but since it is coming from Primer, we have to stick with that 🤷‍♀️

@@ -64,7 +64,7 @@ class Meeting::TimeGroup < ApplicationForm
label: Meeting.human_attribute_name(:duration),
visually_hide_label: false,
required: true,
caption: I18n.t("text_in_hours"),
trailing_visual: { text: { text: I18n.t("datetime.units.hour.other") } },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see two issues here:

Bildschirmfoto 2025-01-21 um 10 28 11
  • The unit is shown twice (one time after the value, and one time at the end of the field)
  • The unit at the end is truncated.

So I'd suggest, to get rid of the unit after the value, and at the end use an abbreviated form like "h". We may have to ask product about that however

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻 for "h"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @myabc as discussed here, We continue with 'in hours' as caption for the input field.

@bsatarnejad bsatarnejad requested a review from HDinger January 21, 2025 14:06
@HDinger HDinger merged commit b89260e into dev Jan 22, 2025
9 checks passed
@HDinger HDinger deleted the housekeeping/bump-primer-0-52-2 branch January 22, 2025 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants