Skip to content

refactor(ui): consolidate destination form - #32078

Merged
shah-harshit merged 17 commits into
mainfrom
plan-ticket-6030-changes
Sep 3, 2026
Merged

shah-harshit merged 17 commits into
mainfrom
plan-ticket-6030-changes

Conversation

@shah-harshit

@shah-harshit shah-harshit commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

What changed

  • Promote the core-UI destination form to the canonical DestinationFormItem path.
  • Migrate notification, observability, and alert-details flows through a compatibility bridge while their parent pages remain on Ant Form.
  • Preserve source-aware destination filtering, email/team/user receivers, webhook auth/headers/query parameters/HTTP method, timeout defaults and validation, test-destination actions, and read-only behavior.
  • Remove the duplicate V2 tree, legacy Ant Design destination UI/styles, and obsolete destination helpers only after callers and behavior are covered by the canonical component.
  • Move destination constants and pure option/filter helpers into dedicated constants and utility files with focused tests.
  • Use the core component selection API consistently, preserve advanced configuration expansion across nested field-array updates, and retain the user-facing G Chat/Ms Teams labels.
  • Keep disabled core ComboBoxes read-only: selected text remains transparent behind the icon/value layer, and pointer interaction cannot open the options list.
  • Keep the required-destination validation visible when the compatibility bridge blocks a save with an empty destination list.
  • Update destination Playwright helpers to interact with the visible combobox, select trigger, accordion, and input elements exposed by the core components.
Screen.Recording.2026-09-02.at.2.16.23.PM.mov

Validation

  • Focused Jest: 8 suites and 63 tests passed.
  • Destination validation Jest: 3 suites and 20 tests passed, including required and optional empty-destination submissions.
  • UI-core Vitest: 2 disabled ComboBox regression tests passed.
  • UI-core ESLint, Prettier, TypeScript type-check, and production build passed.
  • Focused UI checkstyle: 0 errors; Prettier and import organization applied.
  • Focused Playwright passed for notification multiple filters, notification read-only permissions, observability table alert, and observability read-only permissions.
  • Manually verified the alert configuration view keeps the destination selector disabled, does not open it on click, and renders the destination icon and label without overlap.
  • The notification destination scenario completed the changed UI interactions locally and then reached an unrelated backend-response assertion: the local backend returned testResult.config instead of a redacted response.
  • git diff --check passed.
  • yarn tsc:check reported no errors in the changed destination or alert files; the branch retains unrelated pre-existing type errors elsewhere in the UI.

Related to #6030. Collate companion: open-metadata/openmetadata-collate#6146.

@shah-harshit shah-harshit added UI UI specific issues safe to test Add this label to run secure Github workflows on PRs skip-pr-checks Bypass PR metadata validation check labels Aug 26, 2026
@shah-harshit shah-harshit self-assigned this Aug 26, 2026
@github-actions

github-actions Bot commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 67%
67.88% (88084/129758) 51.93% (54149/104254) 53.51% (16563/30951)

@github-actions

github-actions Bot commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit 77851139c702153319cd634857a5510be60e185a in Playwright run 33607048742, attempt 1.

✅ 818 passed · ❌ 0 failed · 🟡 3 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky

Performance

Blocking targets: ✅ met · Optimization targets: 🟡 in progress

Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting.

🕒 Full workflow signal wall (to summary) 54m 9s

⏱️ Max setup 4m 27s · max shard execution 17m 34s · max shard-job elapsed before upload 20m 42s · reporting 6s

🌐 215.29 requests/attempt · 2.60 app boots/UI scenario · 16.60% common-shard skew

Optimization targets still in progress:

  • Common shard skew was 16.6% (convergence target: at most 15%).
  • Browser traffic was 215.29 requests per attempt (convergence target: fewer than 200).
  • Application boot ratio was 2.6 per UI scenario (2255 boots / 868 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard chromium-01 153 0 0 0 0 0
🟡 Shard chromium-02 143 0 1 0 0 0
✅ Shard chromium-03 157 0 0 0 0 0
🟡 Shard chromium-04 150 0 1 0 0 0
✅ Shard data-asset-rules-01 63 0 0 0 0 0
✅ Shard domain-isolation-01 16 0 0 0 0 0
✅ Shard global-state-01 34 0 0 0 0 0
✅ Shard import-export-01 26 0 0 0 0 0
🟡 Shard ingestion-01 31 0 1 0 0 0
✅ Shard reindex-01 5 0 0 0 0 0
✅ Shard search-01 11 0 0 0 0 0
✅ Shard search-rbac-01 29 0 0 0 0 0
🟡 3 flaky test(s) (passed on retry)
  • Pages/Entity.spec.ts › Delete Search Index (shard chromium-02, 1 retry)
  • Features/DataQuality/TestLibrary.spec.ts › should create, edit, and delete a test definition (shard chromium-04, 1 retry)
  • Features/DataQuality/DataQuality.spec.ts › Pagination functionality in test cases list (shard ingestion-01, 1 retry)

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

@shah-harshit
shah-harshit force-pushed the plan-ticket-6030-changes branch from c148202 to 74c68bb Compare August 26, 2026 07:31
@shah-harshit shah-harshit changed the title chore(ui): remove unused destination form V2 refactor(ui): consolidate destination form Aug 26, 2026
@github-actions

github-actions Bot commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ UI Checkstyle passed — lint findings in changed files

🔍 ESLint findings in this PR's files — 0 error(s), 48 warning(s)

Errors block the build. Warnings do not yet — they are rules whose backlog is still
being worked down, listed so this PR does not add to it. See docs/ui-code-quality-gate.md.

0 error(s), 48 warning(s) across 10 changed file(s).

Count Rule
19 sonarjs/no-duplicate-string
16 react-hooks/exhaustive-deps
5 openmetadata-imports/no-lower-layer-page-imports
5 sonarjs/cyclomatic-complexity
1 sonarjs/expression-complexity
1 sonarjs/no-nested-conditional
1 openmetadata-imports/no-cross-page-imports
All findings
Location Rule Message
🟡 src/components/Alerts/AlertDetails/AlertConfigDetails/AlertConfigDetails.tsx:31:1 openmetadata-imports/no-lower-layer-page-imports Pages are route-level composition modules. Move the shared implementation/type to a lower layer instead of importing a page from here.
🟡 src/components/Alerts/AlertDetails/AlertConfigDetails/AlertConfigDetails.tsx:112:6 react-hooks/exhaustive-deps React Hook useCallback has a missing dependency: 't'. Either include it or remove the dependency array.
🟡 src/components/Alerts/AlertDetails/AlertConfigDetails/AlertConfigDetails.tsx:143:6 react-hooks/exhaustive-deps React Hook useCallback has missing dependencies: 'getResourcePermission' and 't'. Either include them or remove the dependency array.
🟡 src/components/Alerts/AlertDetails/AlertConfigDetails/AlertConfigDetails.tsx:149:6 react-hooks/exhaustive-deps React Hook useEffect has a missing dependency: 'fetchTemplates'. Either include it or remove the dependency array.
🟡 src/components/Alerts/AlertDetails/AlertConfigDetails/AlertConfigDetails.tsx:153:6 react-hooks/exhaustive-deps React Hook useEffect has a missing dependency: 'fetchFunctions'. Either include it or remove the dependency array. Outer scope values like 'Fqn' aren't valid de
🟡 src/components/Alerts/DestinationFormItem/DestinationFormItem.component.tsx:35:1 openmetadata-imports/no-lower-layer-page-imports Pages are route-level composition modules. Move the shared implementation/type to a lower layer instead of importing a page from here.
🟡 src/components/Alerts/DestinationFormItem/DestinationFormItem.component.tsx:73:9 react-hooks/exhaustive-deps The 'destinations' logical expression could make the dependencies of useMemo Hook (at line 95) change on every render. To fix this, wrap the initialization of '
🟡 src/components/Alerts/DestinationFormItem/DestinationFormItem.component.tsx:73:9 react-hooks/exhaustive-deps The 'destinations' logical expression could make the dependencies of useCallback Hook (at line 155) change on every render. To fix this, wrap the initialization
🟡 src/components/Alerts/DestinationFormItem/DestinationFormItem.component.tsx:84:20 sonarjs/no-duplicate-string Define a constant instead of duplicating this literal 3 times.
🟡 src/components/Alerts/DestinationFormItem/DestinationFormItem.component.tsx:171:55 sonarjs/no-duplicate-string Define a constant instead of duplicating this literal 4 times.
🟡 src/components/Alerts/DestinationFormItem/DestinationFormItemFormBridge.tsx:19:1 openmetadata-imports/no-lower-layer-page-imports Pages are route-level composition modules. Move the shared implementation/type to a lower layer instead of importing a page from here.
🟡 src/components/Alerts/DestinationFormItem/DestinationSelectItem/DestinationConfigField/DestinationConfigField.tsx:98:9 react-hooks/exhaustive-deps The 'receivers' logical expression could make the dependencies of useCallback Hook (at line 124) change on every render. To fix this, wrap the initialization of
🟡 src/components/Alerts/DestinationFormItem/DestinationSelectItem/DestinationConfigField/DestinationConfigField.tsx:98:9 react-hooks/exhaustive-deps The 'receivers' logical expression could make the dependencies of useCallback Hook (at line 134) change on every render. To fix this, wrap the initialization of
🟡 src/components/Alerts/DestinationFormItem/DestinationSelectItem/DestinationConfigField/DestinationConfigField.tsx:252:29 sonarjs/no-duplicate-string Define a constant instead of duplicating this literal 9 times.
🟡 src/components/Alerts/DestinationFormItem/DestinationSelectItem/DestinationConfigField/DestinationConfigField.tsx:405:43 sonarjs/no-duplicate-string Define a constant instead of duplicating this literal 3 times.
🟡 src/components/Alerts/DestinationFormItem/DestinationSelectItem/DestinationConfigField/DestinationConfigField.tsx:462:45 sonarjs/no-duplicate-string Define a constant instead of duplicating this literal 3 times.
🟡 src/components/Alerts/DestinationFormItem/DestinationSelectItem/DestinationConfigField/DestinationConfigField.tsx:488:45 sonarjs/no-duplicate-string Define a constant instead of duplicating this literal 3 times.
🟡 src/components/Alerts/DestinationFormItem/DestinationSelectItem/DestinationSelectItem.tsx:46:10 sonarjs/cyclomatic-complexity {"message":"Function has a complexity of 24 which is greater than 10 authorized.","cost":14,"secondaryLocations":[{"line":46,"column":9,"endLine":46,"endColumn"
🟡 src/components/Alerts/DestinationFormItem/DestinationSelectItem/DestinationSelectItem.tsx:59:9 react-hooks/exhaustive-deps The 'destinationItem' logical expression could make the dependencies of useMemo Hook (at line 98) change on every render. To fix this, wrap the initialization o
🟡 src/components/Alerts/DestinationFormItem/DestinationSelectItem/DestinationSelectItem.tsx:174:32 sonarjs/no-duplicate-string Define a constant instead of duplicating this literal 3 times.
🟡 src/components/Alerts/DestinationFormItem/DestinationSelectItem/DestinationSelectItem.tsx:205:29 sonarjs/no-duplicate-string Define a constant instead of duplicating this literal 3 times.
🟡 src/components/Alerts/DestinationFormItem/DestinationSelectItem/DestinationSelectItem.tsx:223:12 sonarjs/expression-complexity Reduce the number of conditional operators (7) used in the expression (maximum allowed 3).
🟡 src/components/Alerts/DestinationFormItem/DestinationSelectItem/DestinationSelectItem.tsx:340:32 sonarjs/no-duplicate-string Define a constant instead of duplicating this literal 3 times.
🟡 src/components/Alerts/DestinationFormItem/TeamAndUserSelectItem/TeamAndUserSelectItem.tsx:47:9 react-hooks/exhaustive-deps The 'selectedOptions' logical expression could make the dependencies of useCallback Hook (at line 78) change on every render. To fix this, wrap the initializati
🟡 src/components/Alerts/DestinationFormItem/TeamAndUserSelectItem/TeamAndUserSelectItem.tsx:47:9 react-hooks/exhaustive-deps The 'selectedOptions' logical expression could make the dependencies of useCallback Hook (at line 89) change on every render. To fix this, wrap the initializati
🟡 src/components/Alerts/DestinationFormItem/TeamAndUserSelectItem/TeamAndUserSelectItem.tsx:221:17 sonarjs/no-nested-conditional Extract this nested ternary operation into an independent statement.
🟡 src/pages/AddNotificationPage/AddNotificationPage.tsx:89:1 openmetadata-imports/no-cross-page-imports Page features must not import another page feature. Move shared code to components, hooks, interfaces, or pure utilities.
🟡 src/pages/AddNotificationPage/AddNotificationPage.tsx:95:32 sonarjs/cyclomatic-complexity {"message":"Function has a complexity of 11 which is greater than 10 authorized.","cost":1,"secondaryLocations":[{"line":95,"column":31,"endLine":95,"endColumn"
🟡 src/pages/AddNotificationPage/AddNotificationPage.tsx:144:48 sonarjs/no-duplicate-string Define a constant instead of duplicating this literal 4 times.
🟡 src/pages/AddNotificationPage/AddNotificationPage.tsx:149:5 react-hooks/exhaustive-deps React Hook useMemo has a missing dependency: 't'. Either include it or remove the dependency array.
🟡 src/pages/AddNotificationPage/AddNotificationPage.tsx:164:11 sonarjs/no-duplicate-string Define a constant instead of duplicating this literal 3 times.
🟡 src/pages/AddNotificationPage/AddNotificationPage.tsx:194:6 react-hooks/exhaustive-deps React Hook useEffect has missing dependencies: 'fetchAlert' and 'fetchFunctions'. Either include them or remove the dependency array.
🟡 src/pages/AddNotificationPage/AddNotificationPage.tsx:222:5 react-hooks/exhaustive-deps React Hook useCallback has missing dependencies: 'getResourceLimit' and 'setInlineAlertDetails'. Either include them or remove the dependency array.
🟡 src/pages/AddNotificationPage/AddNotificationPage.tsx:293:6 react-hooks/exhaustive-deps React Hook useCallback has missing dependencies: 'getResourcePermission' and 't'. Either include them or remove the dependency array.
🟡 src/pages/AddNotificationPage/AddNotificationPage.tsx:299:6 react-hooks/exhaustive-deps React Hook useEffect has a missing dependency: 'fetchTemplates'. Either include it or remove the dependency array.
🟡 src/utils/Alerts/AlertsUtil.test.tsx:38:1 openmetadata-imports/no-lower-layer-page-imports Pages are route-level composition modules. Move the shared implementation/type to a lower layer instead of importing a page from here.
🟡 src/utils/Alerts/AlertsUtil.tsx:154:9 sonarjs/no-duplicate-string Define a constant instead of duplicating this literal 3 times.
🟡 src/utils/Alerts/AlertsUtil.tsx:271:3 sonarjs/cyclomatic-complexity {"message":"Function has a complexity of 18 which is greater than 10 authorized.","cost":8,"secondaryLocations":[{"line":271,"column":2,"endLine":271,"endColumn
🟡 src/utils/Alerts/AlertsUtil.tsx:346:26 sonarjs/no-duplicate-string Define a constant instead of duplicating this literal 9 times.
🟡 src/utils/Alerts/AlertsUtil.tsx:484:26 sonarjs/no-duplicate-string Define a constant instead of duplicating this literal 5 times.
🟡 src/utils/Alerts/AlertsUtil.tsx:707:21 sonarjs/no-duplicate-string Define a constant instead of duplicating this literal 3 times.
🟡 src/utils/Alerts/AlertsUtilPure.ts:37:1 openmetadata-imports/no-lower-layer-page-imports Pages are route-level composition modules. Move the shared implementation/type to a lower layer instead of importing a page from here.
🟡 src/utils/Alerts/AlertsUtilPure.ts:40:62 sonarjs/cyclomatic-complexity {"message":"Function has a complexity of 11 which is greater than 10 authorized.","cost":1,"secondaryLocations":[{"line":40,"column":61,"endLine":40,"endColumn"
🟡 src/utils/Alerts/AlertsUtilPure.ts:57:16 sonarjs/no-duplicate-string Define a constant instead of duplicating this literal 3 times.
🟡 src/utils/Alerts/AlertsUtilPure.ts:441:66 sonarjs/cyclomatic-complexity {"message":"Function has a complexity of 16 which is greater than 10 authorized.","cost":6,"secondaryLocations":[{"line":441,"column":65,"endLine":441,"endColum
🟡 src/utils/Alerts/AlertsUtilPure.ts:444:16 sonarjs/no-duplicate-string Define a constant instead of duplicating this literal 13 times.
🟡 src/utils/Alerts/AlertsUtilPure.ts:445:22 sonarjs/no-duplicate-string Define a constant instead of duplicating this literal 13 times.
🟡 src/utils/Alerts/AlertsUtilPure.ts:458:21 sonarjs/no-duplicate-string Define a constant instead of duplicating this literal 5 times.

Fix locally (fast - only checks files changed in this branch):

make ui-checkstyle-changed

@shah-harshit shah-harshit left a comment

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.

Review focused on behavior parity for the destination-form consolidation.

Framing correction that affects how to read the diff: at the merge base, DestinationFormItemV2 was never wired into any page — only its own tests imported it. All three live callers (AddNotificationPage, ObservabilityAlertFormFields, AlertConfigDetails) rendered the legacy Ant DestinationFormItem. So the real user-facing baseline is the legacy Ant component, and the new core-UI component is essentially V2's body driven through the new DestinationFormItemFormBridge. Parity should be judged against legacy, not V2.

Verdict: build is safe — every removed helper (getConnectionTimeoutField, getReadTimeoutField, getDestinationConfigField, old getTeamOptions) is dead with no dangling refs; the deleted TeamAndUserSelectItem.constants.ts was inlined into its test; no V2 imports remain. Source-aware filtering, internal/external handling, G Chat/Ms Teams labels, webhook auth/headers/query-params/HTTP-method, secret redaction, timeout defaults, test-destination, and read-only pass-through are all preserved. The two-way Ant↔RHF sync in the bridge is guarded against loops/echo and I found no concrete drop-of-edits bug.

The inline comments below are the handful of genuine behavior deltas vs the legacy component (several look like intended fixes, but they are not no-ops, so calling this a 'pure consolidation' is slightly overstated) plus one small regression and one manual-test hotspot. No blockers.

@gitar-bot

gitar-bot Bot commented Sep 2, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 3 resolved / 3 findings

Consolidates destination form by promoting the core-UI component to the canonical path, migrating notification/observability/alert-details flows through a compatibility bridge, and removing duplicate V2 tree and legacy Ant Design UI. Resolves stale validation errors from setValue without shouldValidate, KeyValueList test-id collisions across destinations, and unnecessary bridge re-subscriptions on each render. All validation, filtering, auth configuration, and read-only behavior preserved; focused Jest, Playwright, and type-check tests passed.

✅ 3 resolved
✅ Bug: setValue without shouldValidate leaves stale validation errors

📄 openmetadata-ui/src/main/resources/ui/src/components/Alerts/DestinationFormItem/DestinationSelectItem/DestinationConfigField/DestinationConfigField.tsx:111-114 📄 openmetadata-ui/src/main/resources/ui/src/components/Alerts/DestinationFormItem/DestinationSelectItem/DestinationConfigField/DestinationConfigField.tsx:121-124 📄 openmetadata-ui/src/main/resources/ui/src/components/Alerts/DestinationFormItem/TeamAndUserSelectItem/TeamAndUserSelectItem.tsx:75 📄 openmetadata-ui/src/main/resources/ui/src/components/Alerts/DestinationFormItem/TeamAndUserSelectItem/TeamAndUserSelectItem.tsx:82-85
In EmailTagInput (addEmail/removeEmail), TeamAndUserSelectItem (handleOptionClick/handleTagClose) and KeyValueList, the field value is updated via setValue(path, ...) without { shouldValidate: true }. Because these paths are validated by a wrapping Controller (e.g. the receivers required/validate rule), a previously-shown "required" error will not clear when the user adds the first valid email/team/user — the error text remains until the next submit or blur triggers re-validation. Pass { shouldValidate: true } to the relevant setValue calls so the error clears immediately.

✅ Quality: KeyValueList test-ids/labels collide across multiple destinations

📄 openmetadata-ui/src/main/resources/ui/src/components/Alerts/DestinationFormItem/DestinationSelectItem/DestinationConfigField/DestinationConfigField.tsx:231-232 📄 openmetadata-ui/src/main/resources/ui/src/components/Alerts/DestinationFormItem/DestinationSelectItem/DestinationConfigField/DestinationConfigField.tsx:255-256 📄 openmetadata-ui/src/main/resources/ui/src/components/Alerts/DestinationFormItem/DestinationSelectItem/DestinationConfigField/DestinationConfigField.tsx:278
In KeyValueList the header/query-param input data-testid values are keyed only by row index (e.g. header-key-input-${index}), not by the parent destination fieldName. When more than one destination row has webhook advanced config expanded, these test-ids (and the remove-*-button-${index}) collide, making getByTestId ambiguous and weakening test isolation. Prefix the ids with fieldName (as EmailTagInput does) to keep them unique per destination.

✅ Performance: Bridge re-subscribes watch and re-checks reset every render

📄 openmetadata-ui/src/main/resources/ui/src/components/Alerts/DestinationFormItem/DestinationFormItemFormBridge.tsx:66-80 📄 openmetadata-ui/src/main/resources/ui/src/pages/AddObservabilityPage/components/ObservabilityAlertFormFields.tsx:110-121 📄 openmetadata-ui/src/main/resources/ui/src/components/Alerts/AlertDetails/AlertConfigDetails/AlertConfigDetails.tsx:208-221
The three consumers pass values={{ destinations, readTimeout, resources, timeout }} and onChange={(values) => form.setFieldsValue(values)} as fresh object/function literals on every render. In DestinationFormItemFormBridge, both effects depend on values/onChange, so the RHF watch subscription is torn down and re-created and the effect1 deep-isEqual reset check runs on every parent render. It is functionally correct and guarded, but if a transient render passes values that momentarily deep-differs from the core form, effect1's reset() can clear field-level validation errors that were just surfaced. Consider memoizing the values object (useMemo) and the onChange handler (useCallback) in each consumer to reduce churn.

Options

Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@sonarqubecloud

sonarqubecloud Bot commented Sep 2, 2026

Copy link
Copy Markdown

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs skip-pr-checks Bypass PR metadata validation check UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants