Skip to content

[74931] Show type of field beside the attribute#23205

Open
bsatarnejad wants to merge 6 commits into
devfrom
74931-show-type-of-field-beside-the-attribute
Open

[74931] Show type of field beside the attribute#23205
bsatarnejad wants to merge 6 commits into
devfrom
74931-show-type-of-field-beside-the-attribute

Conversation

@bsatarnejad
Copy link
Copy Markdown
Contributor

Ticket

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

What are you trying to accomplish?

Show field type of each custom field beside it.
I ignore the label for query group, because in our current version it is a separated group.

Screenshots

Screenshot 2026-05-13 at 17 21 54

@bsatarnejad bsatarnejad self-assigned this May 13, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds field type labels to the work package type form configuration so administrators can see whether an attribute is built-in or which custom field format it uses.

Changes:

  • Adds field_format metadata for work package custom fields.
  • Maps form configuration attributes to a new field_type label.
  • Renders field type labels on active attribute rows and adds related specs/localization.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
app/models/type/attributes.rb Adds custom field format metadata to form attribute definitions.
app/helpers/types_helper.rb Computes field type labels for form configuration attributes.
app/components/work_package_types/form_configuration/group_attribute_row_component.html.erb Displays field type labels beside active attributes.
config/locales/en.yml Adds the built-in field label translation.
spec/helpers/types_helper_spec.rb Covers helper-generated field type labels.
spec/features/types/form_configuration_spec.rb Adds UI coverage for field type labels and a cancel-edit wait assertion.

Comment thread config/locales/en.yml Outdated
Comment thread app/helpers/types_helper.rb
Comment on lines +253 to +260
it "shows field type labels beside attributes" do
# Built-in attributes show "Builtin field"
builtin_label = I18n.t("types.edit.form_configuration.builtin_field")
assignee_row = page.find('li[data-attr-key="assignee"]')
expect(assignee_row).to have_text(builtin_label)

date_row = page.find('li[data-attr-key="date"]')
expect(date_row).to have_text(builtin_label)
end
if @attribute[:field_type].present?
left.with_column(ml: 2) do
render(Primer::Beta::Text.new(color: :muted, font_size: :small)) { @attribute[:field_type] }
Copy link
Copy Markdown
Contributor

@myabc myabc May 15, 2026

Choose a reason for hiding this comment

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

This should be a Primer::Beta::Text, I think.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We already uses Primer::Beta::Text

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I meant Primer::Beta::Label

@bsatarnejad bsatarnejad marked this pull request as ready for review May 15, 2026 13:01
@bsatarnejad bsatarnejad requested a review from myabc May 15, 2026 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants