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

Make dropdown (configurable-enum) fields usable in Entity title (toStringAttributes) #2865

Closed
sleidig opened this issue Feb 18, 2025 · 4 comments · Fixed by #2871
Closed
Assignees
Labels
Client: by X Client: GP released on @master managed by CI (semantic-release) released managed by CI (semantic-release)

Comments

@sleidig
Copy link
Member

sleidig commented Feb 18, 2025

Entity Types have configuration how a linked record of this type is displayed. The fields supported for currently have to be of dataType "string". For this, also fields of type "configurable-enum" (i.e. dropdown category fields) should be supported.

e.g. here that the "name" is used when showing a referenced "Child" record:
Image

this is configured in the Admin UI:
Image

User Story / Scenario:

  1. Edit Entity Type by navigating to the Children List; opening "Edit Data Structure"
  2. In the "General Settings" section of Admin UI, I can see and check "Gender" in the "Generated Title of Record" field (to make the gender part of the displayed title)
  3. After saving these changes, I see in the Children list in the "Name" column that in addition to the icon and name there is also the "gender" of that child written out (e.g. "[i] Adikavi Malik male")

Implementation steps & considerations:

  • the fields used for this representation are stored in the Entity Type's toStringAttributes
  • in the Admin UI we only allow the fields with supported dataType to be selected (once new types are supported, the filter there has to be adapted)
  • other components (like the EntityBlockComponent) use the Entity class' toString() method (which builds a "title" for that record based on the toStringAttributes array. The logic in this method needs to be adjusted to handle ConfigurableEnumValue values (because those are objects and we need to use their .label property to get the correct string representation for users)
  • as usual: Test-Driven-Development --> write unit tests for the Entity.toString method first and then implement logic changes only
@github-project-automation github-project-automation bot moved this to Triage / Analysis in All Tasks & Issues Feb 18, 2025
@sleidig sleidig moved this from Triage / Analysis to Todo (ready for work) in All Tasks & Issues Feb 18, 2025
@Abhinegi2 Abhinegi2 moved this from Todo (ready for work) to Planned (current "sprint") in All Tasks & Issues Feb 20, 2025
@Abhinegi2 Abhinegi2 moved this from Planned (current "sprint") to In Progress in All Tasks & Issues Feb 20, 2025
@Abhinegi2
Copy link
Contributor

After reviewing the requirements, my proposed approach is as follows -

  1. Modify the toString() method in the test EntityClass to support configurableDataType.
  2. Add test cases for the updated toString() method.
  3. Update initToStringAttributesOptions to include configurableDataType in the options list.
  4. Verify the overall functionality

Let me know if this approach looks good or if you have any suggestions

@sleidig
Copy link
Member Author

sleidig commented Feb 20, 2025

This sounds good. Please go ahead and raise questions or doubts if any come up during implementation.

@Abhinegi2 Abhinegi2 moved this from In Progress to Technical Review in All Tasks & Issues Feb 21, 2025
@Abhinegi2 Abhinegi2 moved this from Technical Review to Functional Review in All Tasks & Issues Feb 21, 2025
@sleidig sleidig moved this from Functional Review to Done in All Tasks & Issues Feb 21, 2025
sleidig added a commit that referenced this issue Feb 21, 2025
…(toStringAttributes) (#2871)

closes #2865

---------

Co-authored-by: Sebastian Leidig <[email protected]>
@aam-digital-ci
Copy link
Collaborator

🎉 This issue has been resolved in version 3.46.3-master.8 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@aam-digital-ci aam-digital-ci added the released on @master managed by CI (semantic-release) label Feb 21, 2025
@aam-digital-ci
Copy link
Collaborator

🎉 This issue has been resolved in version 3.47.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@aam-digital-ci aam-digital-ci added the released managed by CI (semantic-release) label Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client: by X Client: GP released on @master managed by CI (semantic-release) released managed by CI (semantic-release)
Projects
Archived in project
3 participants