Skip to content

[72005] New Administration for User Custom Fields and Custom Field Sections#23454

Merged
klaustopher merged 22 commits into
devfrom
feature/72005-new-administration-for-user-custom-fields-and-custom-field-sections
Jun 23, 2026
Merged

[72005] New Administration for User Custom Fields and Custom Field Sections#23454
klaustopher merged 22 commits into
devfrom
feature/72005-new-administration-for-user-custom-fields-and-custom-field-sections

Conversation

@dfriquet

@dfriquet dfriquet commented May 29, 2026

Copy link
Copy Markdown
Contributor

Ticket

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

What are you trying to accomplish?

  • For this, Administrators need to manage the layout of the user form
    • The user custom field management is moved as a menu item in the Users & Permissions section in the administration
    • "User custom fields" are renamed "User attributes" to match project attributes
    • User attributes are grouped into sections
    • Additionally to the custom fields, the built-in fields (first name, last name, email, department, etc) are listed there as well and can be re-arranged in the form.
  • When editing or showing the user profile, the data/form is displayed as configured by the admin
  • A user custom field also gets a boolean if that info should be shown in the user information card. If this is checked, the custom field is also shown whenever user details are displayed (see Figma for details)
  • Hierarchy custom fields are also available for user custom fields
  • Primerized.

Screenshots

What approach did you choose and why?

  • The first commit made the move from the flat-list user custom fields administration to user attributes within sections:
    • For the most parts a copy-paste from "Project attributes";
    • New admin area — dedicated UserCustomFieldsController + UserCustomFieldSectionsController with a new "User attributes" entry in the "Users & Permissions" menu;
    • UserCustomFieldSection model — new STI subclass of CustomFieldSection with full Create/Update/Delete service and contract layer;
    • Data migration: creates one untitled default UserCustomFieldSection and bulk-assigns all existing orphaned UserCustomField records to it;
    • Shared code: three small targeted edit to handle UserCustomField alongside ProjectCustomField.
  • The second commit fixes a bug in the "Project attributes" found while working on the "User attributes";
  • The third commit groups the input fields by section in the user form and profile.
  • The fourth commit introduces the visible_on_user_card flag on custom fields and renders those flagged fields in the user hover card;
  • The sixth commit enables hierarchy-type custom fields for users and adds the item management controller, routes, and views for them;
  • The eighth commit includes the five built-in user fields alongside custom fields in the admin sections, making all fields uniformly draggable and reorderable:
    • New attribute_order text[] column on custom_field_sections as the single ordering mechanism;
    • BuiltInAttributeRowComponent in the section admin UI — drag handle, "Built-in" badge, move actions only (no edit or delete), and companion BuiltInAttributesController for move/drop of built-in fields within and across sections.
  • The ninth commit backports Users’ attribute_order into Projects so that all the subclasses uses the same vector, slimming down the STI a bit.

Merge checklist

  • Added/updated tests
  • Added/updated documentation in Lookbook (patterns, previews, etc)
  • Tested major browsers (Chrome, Firefox, Edge, ...)

@dfriquet dfriquet changed the title Feature/72005 new administration for user custom fields and custom field sections [72005] New Administration for User Custom Fields and Custom Field Sections May 29, 2026
@dfriquet dfriquet force-pushed the feature/72005-new-administration-for-user-custom-fields-and-custom-field-sections branch 5 times, most recently from fc67cba to d9347cb Compare June 5, 2026 07:27
@mrmir mrmir self-requested a review June 5, 2026 08:01

@mrmir mrmir left a comment

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.

This is not an exhaustive review, but it seems to work well and matches the mock ups/AC.

I don't know how many of these will change with the upcoming UI/primerisation work, but they're here nonetheless:

  1. Why does a new section in user attributes default to the top?
  2. Can there be a button in the section header to add a new attribute to it directly?
  3. It makes sense to me to return to the user attributes list after saving a new one
  4. There is no search bar to filter user attributes

There are also some inline code remarks.

Additionally, I would like it if the upcoming primerisation work can be done in a separate PR as at 4.5k+ lines this is already rather difficult to review properly in detail, imo.

Comment thread app/views/users/_form.html.erb Outdated
Comment thread app/models/custom_field_section.rb
@dfriquet

dfriquet commented Jun 5, 2026

Copy link
Copy Markdown
Contributor Author

Thank you for your first comments @mrmir

Additionally, I would like it if the upcoming primerisation work can be done in a separate PR as at 4.5k+ lines this is already rather difficult to review properly in detail, imo.

That is indeed my intention too, I really do agree with you. I will even try to make it a separate WP so that we can ship the feature first and the embellishment later.

@dfriquet dfriquet force-pushed the feature/72005-new-administration-for-user-custom-fields-and-custom-field-sections branch 21 times, most recently from 73c29fd to 287e9a6 Compare June 8, 2026 14:36

@klaustopher klaustopher left a comment

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.

Great. Thank you. About the open point... Let's see what will be said during review. But I have no hard opinion there.

@github-actions

Copy link
Copy Markdown

Warning

Flaky specs

  • rspec ./modules/wikis/spec/features/admin/internal_provider_spec.rb[1:1]

@dfriquet dfriquet force-pushed the feature/72005-new-administration-for-user-custom-fields-and-custom-field-sections branch from 55474a1 to 211e72c Compare June 15, 2026 07:22
@klaustopher klaustopher merged commit 27701e1 into dev Jun 23, 2026
15 of 16 checks passed
@klaustopher klaustopher deleted the feature/72005-new-administration-for-user-custom-fields-and-custom-field-sections branch June 23, 2026 14:48
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants