[
https://issues.apache.org/jira/browse/ATLAS-5371?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18103913#comment-18103913
]
ASF subversion and git services commented on ATLAS-5371:
--------------------------------------------------------
Commit 40de707c84a4a599764f02bbc4ffd1bb04dd15a6 in atlas's branch
refs/heads/master from Prasad Pawar
[ https://gitbox.apache.org/repos/asf?p=atlas.git;h=40de707c8 ]
ATLAS-5371: Atlas UI: Render ENUM-typed entity attributes as dropdowns in
Create/Edit Entity form (#723)
> Atlas UI: Render ENUM-typed entity attributes as dropdowns in Create/Edit
> Entity form
> -------------------------------------------------------------------------------------
>
> Key: ATLAS-5371
> URL: https://issues.apache.org/jira/browse/ATLAS-5371
> Project: Atlas
> Issue Type: Bug
> Components: atlas-webui
> Affects Versions: 3.0.0, 2.5.0
> Reporter: Prasad P. Pawar
> Assignee: Prasad P. Pawar
> Priority: Major
> Attachments: Screenshot 2026-08-10 at 10.19.03 PM.png, Screenshot
> 2026-08-10 at 10.19.13 PM.png, Screenshot 2026-08-10 at 10.19.31 PM.png,
> Screenshot 2026-08-10 at 10.20.08 PM.png, Screenshot 2026-08-10 at 10.20.56
> PM.png, Screenshot 2026-08-10 at 10.21.15 PM.png
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> When creating or editing a custom entity with attributes whose typeName
> references
> an Atlas ENUM typedef (e.g., glossario_natureza_termo), the Atlas UI renders a
> freeform text input instead of a dropdown populated with the enum's allowed
> values.
> Users expect to select predefined values (e.g., term categories, City
> metadata)
> from a combo box when filling custom entity attributes, matching behavior
> already
> available in Business Metadata and Classification tag attribute forms.
> h2. Expected Behavior
> * Attributes with typeName matching an ENUM typedef should render as a
> <select>
> dropdown populated from the enum's elementDefs.
> * Optional attributes should show a placeholder option (e.g., "-- Select
> --").
> * On entity edit, the current enum value should be pre-selected.
> * Support array<enumType> for LIST cardinality (multi-select), consistent
> with
> Business Metadata behavior.
> h2. Actual Behavior
> * ENUM-typed entity attributes render as plain text <input> fields in the
> Create/Edit Entity modal.
> * Users must manually type enum values, with no UI guidance on valid options.
> h2. Root Cause
> CreateEntityLayoutView.getElement() does not check enumDefCollection for ENUM
> types. Unsupported types fall through to getInput().
> Additionally, CreateEntityLayoutView does not receive enumDefCollection from
> its parent views, even though parent views (SearchResultLayoutView, etc.)
> already
> have it loaded.
> h2. Reference Implementations (working enum dropdowns)
> * EntityBusinessMetaDataItemView.js (~lines 234–250)
> * AddTagModalView.js (~lines 437–445)
> h2. Affected Files
> * dashboardv2/public/js/views/entity/CreateEntityLayoutView.js
> * dashboardv3/public/js/views/entity/CreateEntityLayoutView.js
> * Callers: SearchResultLayoutView, SearchDefaultLayoutView,
> EntityDetailTableLayoutView (v2 + v3)
> h2. Proposed Fix
> # Pass enumDefCollection to CreateEntityLayoutView from all instantiation
> points.
> # In getElement(), detect ENUM types via enumDefCollection lookup.
> # Render <select> with options from elementDefs (mirror Business Metadata
> logic).
> # Add unit tests for enum attribute rendering (create + edit, optional +
> required,
> single + array).
> h2. Acceptance Criteria
> * Creating an entity with an ENUM-typed attribute shows a dropdown with all
> enum values from elementDefs.
> * Editing an entity pre-selects the stored enum value in the dropdown.
> * Optional enum attributes allow empty/unset selection.
> * Invalid enum values cannot be submitted via UI (only predefined options
> shown).
> * Behavior is consistent between dashboardv2 and dashboardv3.
> * No regression for entity references, boolean, struct, map, or primitive
> types.
> h2. Notes
> * Backend/REST API already validates enum values correctly; this is UI-only.
> * Business Metadata enum dropdowns can serve as the implementation reference.
>
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)