pawarprasad123 opened a new pull request, #764:
URL: https://github.com/apache/atlas/pull/764

   Combined React UI improvements across three areas: 
   **Audit tab deleted-entity styling** (Classic UI parity),, **Quick Search 
empty-query validation**, and **Business Metadata enum dropdown rendering** 
(React + Classic UI). Includes unit/integration tests and SCSS updates.
   
   
   ## What changes were proposed in this pull request?
   
   In the React UI entity detail **Audits** tab, expanded audit rows render all 
entity references as active blue links, even when the referenced entity has 
been deleted (e.g. deleted column families in `column_families`). Classic UI 
resolves per-reference status and shows deleted refs with orange styling 
(`#bb5838`) and a trash icon.
   
   ## Solution / Fix
   - Extracted entity-ref rendering into dedicated modules:
     - `AuditEntityRefLink` — merges `referredEntities`, fetches `GET 
/entity/guid/{guid}/header` when status is unknown, passes resolved ref to 
`ExtractObject`
     - `ExtractObject` — renders entity links with `.entity-name-deleted` class 
and delete icon for `DELETED` status
     - `entityRefUtils` / `entityRefRenderers` — shared merge/status helpers 
and audit-aware rendering
   - Slimmed `commonComponents.tsx`; routes audit refs through 
`AuditEntityRefLink` when `auditDetails={true}`
   - `AttributeProperties` passes `auditDetails` as 9th argument to `getValues`
   - `Utils.ts` — improved display name resolution for 
`uniqueAttributes.qualifiedName`
   - `table.scss` — added `.entity-name-deleted { color: #bb5838 }` (Classic UI 
parity)
   
   ### Tests performed
   | Test file | Coverage |
   |-----------|----------|
   | `AuditEntityRefLink.test.tsx` | Header returns DELETED → orange link + 
trash icon; empty header → active styling; API reject → graceful fallback; 
`entityStatus` / `status` variants |
   | `entityRefUtils.test.ts` | `mergeReferredEntity`, `getEntityRefStatus` 
positive/negative cases |
   | `commonComponents.test.tsx` | `auditDetails={true}` uses 
`AuditEntityRefLink`; deleted refs get `.entity-name-deleted`; glossary term 
delete icon rules |
   | `AttributeProperties.test.tsx` | `auditDetails` passed as 9th arg to 
`getValues` in audit mode |
   | `AuditTableDetails.test.tsx` | `auditDetails=true` forwarded to 
`AttributeProperties` for entity and relationship audit expand |
   | `Utils.test.ts` | `uniqueAttributes.qualifiedName` display name extraction 
|
   ---
   
   # 2) Quick Search — Disable Search Button for Empty Query
   ### Problem
   Quick Search (dashboard center + header) allowed submitting an empty or 
whitespace-only query, which could navigate with a wildcard `query=*` and 
return overly broad results.
   ### Solution / Fix
   - Added `hasValidSearchQuery()` — requires ≥1 non-whitespace character
   - Search button `disabled={!isSearchEnabled}` with muted disabled styling 
(`sx` + `.global-search-submit-btn[disabled]` in SCSS)
   - `handleSubmitSearch` and Enter key handler early-return when query is 
invalid — no navigation, no wildcard submit
   ### Tests performed
   | Test file | Coverage |
   |-----------|----------|
   | `QuickSearch.test.tsx` → `Search Button Validation` | Button disabled on 
empty input; disabled for whitespace-only; enabled with valid text; click with 
empty → no navigation; click with valid query → navigates; Enter with empty → 
no navigation |
   ---
   ## 3) Business Metadata — Enum Dropdown Options
   ### Problem
   Business Metadata attributes of enum type on the entity Properties tab did 
not render proper dropdown/select controls in React UI. Users could not 
reliably pick enum values (single or multi-value array enums). Classic UI also 
needed alignment for enum option display.
   ### Solution / Fix
   - **`enumTypeUtils.ts`** — helpers for enum type detection, option building, 
value normalization/serialization (`getInnerTypeName`, `buildEnumOptions`, 
`normalizeMultiEnumValue`, etc.)
   - **`BMAttributesFields.tsx`** — MUI `Select` for single-value enums; 
constrained multi-select `Autocomplete` for `array<enum>`; loading/empty/error 
states; fallback to TextField for unknown enums
   - **`BMAttributes.tsx`** — enum definition fetching, edit/save flow, pending 
state while enum defs load
   - **`propertiesTab.scss`** — enum dropdown and multi-select styling
   - **Classic UI (`dashboardv2`)** — `EntityBusinessMetaDataItemView.js` + 
`business-metadata.scss` for enum dropdown parity
   ### Tests performed
   | Test file | Coverage |
   |-----------|----------|
   | `enumTypeUtils.test.ts` | Type detection, option building, normalization, 
serialization — positive + negative (empty defs, malformed types, missing 
values) |
   | `BMAttributesFields.test.tsx` | Single enum Select; multi enum 
Autocomplete; loading state; no-defs message; unknown enum fallback; 
array<string> stays free-text (negative) |
   | `BMAttributes.test.tsx` | Component-level enum edit/render/save scenarios |
   | `BMAttributes.enum.integration.test.tsx` | End-to-end: enum Select in edit 
mode; save after dropdown change; array enum serialization on save; no save 
when row has no key (negative) |
   ---
   ## Overall Project Coverage (Dashboard)
   After these changes (`npm run test:ci`):
   | Metric | Coverage |
   |--------|----------|
   | **Statements** | **88.82%** |
   | **Branches** | **82.16%** |
   | **Functions** | **80.19%** |
   | **Lines** | **88.82%** |
   **Test results:** 4934 tests passed across 197 suites  
   **Lint:** 0 errors  
   **Build:** Pass (`npm run build`, `npm run typecheck`)
   ### Changed-files coverage (subset)
   | Metric | Coverage |
   |--------|----------|
   | Statements | 94.08% |
   | Branches | 82.36% |
   | Functions | 88.81% |
   
   ---
   ## Manual test plan
   - [ ] Entity detail → Audits tab → expand row with deleted relationship refs 
→ orange link + trash icon
   - [ ] Compare same audit payload with Classic UI (`dashboardv2`)
   - [ ] Dashboard center + header Quick Search: empty/whitespace → Search 
disabled; valid query → navigates
   - [ ] Entity Properties → Business Metadata tab → edit enum attribute → 
dropdown shows options; save works for single and multi enum
   - [ ] Classic UI BM enum dropdown on same entity type
   ---
   
   
   ## How was this patch tested?
   
   Test plan (automated)
   ```bash
   cd dashboard
   npm run lint
   npm run typecheck
   npm run build
   npm test
   
   <img width="1701" height="946" alt="Screenshot 2026-09-20 at 12 54 36 PM" 
src="https://github.com/user-attachments/assets/8d5643d8-bd07-46dd-9a80-5e6944ebf199";
 />
   <img width="1702" height="475" alt="Screenshot 2026-09-20 at 12 55 06 PM" 
src="https://github.com/user-attachments/assets/80953387-a77e-4c51-af8e-e97dc083b60a";
 />
   <img width="1728" height="524" alt="Screenshot 2026-09-20 at 12 55 15 PM" 
src="https://github.com/user-attachments/assets/48107d84-748f-4b5b-8d4b-ccc3e2024225";
 />
   <img width="1684" height="935" alt="Screenshot 2026-09-20 at 12 55 38 PM" 
src="https://github.com/user-attachments/assets/62e97c1d-0ff6-4abc-9737-3fb6f4b659cd";
 />
   <img width="1710" height="923" alt="Screenshot 2026-09-20 at 12 55 57 PM" 
src="https://github.com/user-attachments/assets/c1d694f9-fe0f-48f1-8a77-36ce6fab57ee";
 />
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to