Skip to content

Fixes #34869: Platform Settings part 3 — Data Asset Rules, Learning Resources - #34888

Merged
chirag-madlani merged 2 commits into
chirag-madlani/ai-mode-settings-modal-pr2from
chirag-madlani/ai-mode-settings-modal-pr3
Oct 8, 2026
Merged

chirag-madlani merged 2 commits into
chirag-madlani/ai-mode-settings-modal-pr2from
chirag-madlani/ai-mode-settings-modal-pr3

Conversation

@chirag-madlani

@chirag-madlani chirag-madlani commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Describe your changes:

Fixes #34869

Stacked on #34882 (part 2), which is stacked on #34872 (part 1). Review those first. This PR's diff is only the part-3 commit, and GitHub retargets it as the earlier parts merge.

Moves the last two non-search classic Settings → Preferences pages into the AI-mode settings modal's Platform Settings: Data Asset Rules and Learning Resources. Platform Settings now covers 11 of the 12 legacy pages; Search follows in #34870. The new UI is built only from @openmetadata/ui-core-components, and forms use HookForm. The classic pages are untouched apart from one shared filter row (see below).

Type of change:

  • New feature

High-level design:

Builds on the Platform Settings panel from parts 1–2: the page registry, hash routing, view + edit pages and itemId routes.

Data Asset Rules (DataAssetRulesSettings)

  • A core Table of rules (name, description, Enabled). Toggling saves the rule list through the existing useSemanticsRulesState hook, the same call the classic page makes.
  • Adding rules is not supported yet, so there is no add route or button. An empty list shows a "No Data Asset Rules" placeholder.
  • The landing card carries a Beta badge, as the classic menu entry does.

Learning Resources (LearningResourcesSettings, LearningResourceSettingsForm, LearningResourceSettings.utils)

  • List: reuses the classic page's data hooks (useLearningResources, useLearningResourceFilters, useLearningResourceActions) plus the existing core-based player, card, view toggle and delete modal. So search, quick filters, table/card views, preview and delete behave as before. Add Resource sits in the modal header.
  • Form: the classic antd Drawer + Form is replaced by a HookForm page at #platform-settings/learning-resources/edit[/<id>].
    • The name is locked on edit.
    • Type, categories, context and source URL are required, and the URL must be valid.
    • Fields the form doesn't edit (difficulty, each context's componentId) are carried over on update rather than dropped.
  • Shared filter row: the quick-filter row in useLearningResourceFilters drops its last antd Space for a core Box. The classic page shares that hook; it renders the same, and its tests pass.

Fixes to the earlier parts (included here; they touch code from #34872/#34882):

  • useSettingsFetch loads once per mount. Under StrictMode its effect ran twice. The second response could arrive after the user started typing and form.reset would wipe the edit. This made the Data Quality E2E flaky.
  • Pages are keyed by route. Moving between items (Add → Edit, edit A → edit B, browser back/forward) now remounts the page, so it loads the right item instead of showing a skeleton forever.
  • Dimension edit fetch: the form now fetches only the dimensions, not the two count endpoints it never used.
  • Empty-state centring: empty states centre in the content area rather than the whole modal.
  • Optional form section title: SettingsFormSection's title is now optional; the resource form omits it because the page header already names it.
  • Stale edit link (Gitar review): if the resource to edit can't be loaded (deleted, or a stale bookmark or history entry), the form now returns to the list after the error toast instead of showing a skeleton forever. A unit test covers it.
  • Shared filter row lint: useLearningResourceFilters drops a redundant useMemo dependency, and the selected filter value uses the theme-adapting tw:text-brand-secondary instead of the static tw:text-brand-600.

Tests:

Use cases covered

  • Data Asset Rules:
    • The list shows each rule's Enabled state.
    • Toggling saves the full list with only that rule flipped.
    • The empty state has no Add action.
    • data-asset-rules/edit has no form route.
  • Learning Resources:
    • The list renders, and Add/Edit route to the form; delete asks for confirmation.
    • Edit loads the resource, locks the name and saves an update that keeps componentId/difficulty.
    • Add shows every required-field message and rejects an invalid URL.
  • Routing: moving from Add to Edit remounts the form.

Unit tests

  • Added for the new logic. They use the real core components and HookForm; only the REST layer is mocked.
  • Files: DataAssetRulesSettings.test.tsx, LearningResourcesSettings.test.tsx; updated PlatformSettingsPanel.test.tsx.
  • Results: 17 suites / 105 tests in the folder. All 102 Profile + Learning Resources suites (666 tests) pass, including the classic page's.
  • Coverage on the part-3 and touched files: 95.5% lines, every file ≥ 90%.

Backend integration tests

  • Not applicable (no backend API changes).

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • Extended playwright/e2e/Features/ProfilePlatformSettings.spec.ts to 16 tests:
    • Data Asset Rules toggle, with the save stubbed so tenant settings never change.
    • Data Asset Rules empty state has no Add.
    • Learning Resources add/edit/delete against the real API with cleanup. The two CRUD tests are marked test.slow().

Local run against a dev server (PLAYWRIGHT_IS_OSS=true, local backend on :8585):

Spec Result
Features/ProfilePlatformSettings.spec.ts 16/16 passed in the final runs at 4 workers; the landing test also passed 4/4 run concurrently
Canary and smoke sets Not run locally; left to the merge queue

Manual testing performed

  1. Local stack on :8585 with the UI dev server, logged in as admin, AI mode. Opened Settings → Administration → Platform Settings; Data Asset Rules shows the Beta badge.
  2. Data Asset Rules: toggled a rule and saw the success toast. With no rules, the centred empty state has no Add.
  3. Learning Resources: searched, then opened Add Resource. Saving empty showed every required-field message; then cancelled. Opened Edit on an existing resource: the name is locked and every field is prefilled.
  4. Navigated Add → Edit directly by URL: the edit form loads the resource.

UI screen recording / screenshots:

Recording (platform-settings-pr3-walkthrough.mp4, 44s) and screenshots to be attached.

Checklist:

  • I have read the CONTRIBUTING document.

  • My PR title is Fixes <issue-number>: <short explanation>

  • My PR is linked to a GitHub issue via Fixes #<issue-number> above.

  • I have commented on my code, particularly in hard-to-understand areas.

  • For JSON Schema changes: Not applicable — no schema changes.

  • For UI changes: I attached a screen recording and/or screenshots above.

  • I have added tests (unit / integration / Playwright as applicable) and listed them above.

  • The issue properly describes why the new feature is needed, what's the goal, and how we are building it.

  • I have updated the documentation. Not applicable — UI move; no user-facing docs change.

  • I have added tests around the new logic.

🤖 Generated with Claude Code

@chirag-madlani chirag-madlani added the UI UI specific issues label Oct 8, 2026
@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR checks passed

The linked issue has a description and all required Shipping project fields set. Thanks!

@github-actions github-actions Bot added the safe to test Add this label to run secure Github workflows on PRs label Oct 8, 2026
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

🔄 Playwright impact map auto-refreshed

This PR touched specs or UI source that changed the source→spec routing map. I regenerated .github/playwright/impact-map.generated.json and pushed the diff to this branch.

- source entries: 852 → 867
- 16 added, 1 removed, 20 changed spec-list

New source→spec entries:
  openmetadata-ui/src/main/resources/ui/src/components/Settings/Email/TestEmail/TestEmail.component.tsx
  openmetadata-ui/src/main/resources/ui/src/components/common/atoms/drawer/AiFormModal.tsx
  openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/Profile/tabs/platform-settings/AppModeSettingsForm.tsx
  openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/Profile/tabs/platform-settings/DataAssetRulesSettings.tsx
  openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/Profile/tabs/platform-settings/DataQualitySettings.tsx
  openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/Profile/tabs/platform-settings/DimensionDeleteDialog.tsx
  openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/Profile/tabs/platform-settings/EmailSettings.tsx
  openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/Profile/tabs/platform-settings/HealthCheckSettings.tsx
  openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/Profile/tabs/platform-settings/LearningResourcesSettings.tsx
  openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/Profile/tabs/platform-settings/PlatformSettingsLanding.tsx
  … and 6 more

Removed source→spec entries:
  openmetadata-ui/src/main/resources/ui/src/pages/AppearanceConfigSettingsPage/AppearanceConfigSettingsPage.tsx

Entries whose spec list changed:
  openmetadata-ui/src/main/resources/ui/playwright/e2e/Utils/appMode.ts
  openmetadata-ui/src/main/resources/ui/playwright/support/fixtures/base.ts
  openmetadata-ui/src/main/resources/ui/playwright/utils/common.ts
  openmetadata-ui/src/main/resources/ui/playwright/utils/waitHelpers.ts
  openmetadata-ui/src/main/resources/ui/src/components/AppModeSwitcher/AppModeSwitcher.tsx
  openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityLineage/LineageConfigModal.tsx
  openmetadata-ui/src/main/resources/ui/src/components/MyData/CustomizableComponents/CustomizablePageHeader/CustomizablePageHeader.tsx
  openmetadata-ui/src/main/resources/ui/src/components/Settings/Email/EmailConfigForm/EmailConfigForm.component.tsx
  openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/AIUserMenu/AIUserMenu.tsx
  openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/Profile/ProfileContentHeader.tsx
  … and 10 more

What is this file? It is the auto-generated half of Playwright's PR planner. It routes "if source X changes, run specs Y" by walking spec imports and cross-referencing getByTestId strings. Hand-authored routing in impact-map.json always wins on conflict.

What if I want to regenerate locally instead? Run this before pushing your next change to skip the bot commit:

python3 .github/scripts/generate_playwright_impact_map.py
git add .github/playwright/impact-map.generated.json
git commit --amend --no-edit  # or a separate commit

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 76%
76.29% (120190/157531) 62.23% (74388/119531) 63.69% (24868/39041)

@chirag-madlani
chirag-madlani force-pushed the chirag-madlani/ai-mode-settings-modal-pr2 branch from 7fc58d0 to 8a57e98 Compare October 8, 2026 07:06
@chirag-madlani
chirag-madlani force-pushed the chirag-madlani/ai-mode-settings-modal-pr3 branch from 7dce727 to b1a1a7e Compare October 8, 2026 07:07
@chirag-madlani
chirag-madlani force-pushed the chirag-madlani/ai-mode-settings-modal-pr2 branch from 8a57e98 to e73aeea Compare October 8, 2026 09:18
@chirag-madlani
chirag-madlani force-pushed the chirag-madlani/ai-mode-settings-modal-pr3 branch from b1a1a7e to 372c1eb Compare October 8, 2026 09:18
@chirag-madlani
chirag-madlani force-pushed the chirag-madlani/ai-mode-settings-modal-pr2 branch from e73aeea to 0496389 Compare October 8, 2026 10:49
@chirag-madlani
chirag-madlani force-pushed the chirag-madlani/ai-mode-settings-modal-pr3 branch from 372c1eb to 844c4f4 Compare October 8, 2026 10:49
…esources

Move the classic Settings > Preferences Data Asset Rules and Learning
Resources pages into the AI-mode settings modal on ui-core-components.

- Data Asset Rules: rule list with the in-place Enabled toggle. Adding rules
  is not supported yet, so the empty state has no Add. Marked Beta on the
  landing, as in the classic menu.
- Learning Resources: the list (search, quick filters, table/card views,
  preview, delete) on the classic page's data hooks; the antd drawer form is
  replaced by a HookForm add/edit page (learning-resources/edit[/<id>]) that
  carries over fields it does not edit (difficulty, context componentId).

The Learning Resources quick-filter row drops its last antd Space for a core
Box, which the classic page shares.

Also fixes two issues in the earlier parts:
- useSettingsFetch loads once per mount. Under StrictMode its effect ran twice
  and the second response could reset a form the user had started editing.
- The dimension edit form fetches only the dimensions, not the two count
  endpoints it never used.
- Each page is keyed by its route, so moving between items (add -> edit,
  browser back/forward) remounts it and loads the right data.
- Empty states centre in the content area instead of the whole modal.
@chirag-madlani
chirag-madlani force-pushed the chirag-madlani/ai-mode-settings-modal-pr2 branch from 0496389 to 362e2b3 Compare October 8, 2026 10:54
@chirag-madlani
chirag-madlani force-pushed the chirag-madlani/ai-mode-settings-modal-pr3 branch from 844c4f4 to 3f71a7c Compare October 8, 2026 10:54
@gitar-bot

gitar-bot Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved 1 closed / 1 findings

🔴 High risk · The new search settings can disable role and policy enforcement, potentially exposing search results for assets users are not permitted to access.

Migrates Data Asset Rules and Learning Resources into Platform Settings with HookForm-based edit pages, comprehensive test coverage, and fixes including stale edit link handling that now returns to the list after an error. No issues found.

✅ 1 closed
✅ Edge Case: Edit form stays on a skeleton forever when the resource fetch fails

📄 openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/Profile/tabs/platform-settings/LearningResourceSettingsForm.tsx:213-219
useSettingsFetch catches the error, shows a toast and sets isLoading to false, but leaves data undefined. The guard itemId && (isLoading || !resource) keeps showing the skeleton, and nothing else is rendered: no form, no Cancel and no error state. You can reach this from #platform-settings/learning-resources/edit/<id> with a stale or deleted id, which happens with browser back/forward, a bookmark, or a resource someone else deleted. The only way out is the modal's own navigation. Show the skeleton only while isLoading is true. When the fetch fails, show an empty or error placeholder with a way back to the list.

Review coverage

📋 Rules No rules evaluated

🧪 Functional validation Not enabled · Set up

🤖 Auto-approval Not enabled · Set up

Options

Display: compact → Counting what did not apply, without listing it.

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

Moves Settings > Preferences > Search into the AI-mode settings modal:
the global search settings (access control, column indexing, limits,
hybrid weights, term and field value boosts, reset) and one page per
entity (ranking, matching fields, modes, boosts) with a live preview of
the unsaved draft. Built on ui-core-components only.

Platform Settings pages can now have read-only item sub-pages at
<page>/<itemId>; header titles and breadcrumbs move into getPageHeader.
@chirag-madlani
chirag-madlani merged commit d4bc97c into chirag-madlani/ai-mode-settings-modal-pr2 Oct 8, 2026
54 of 55 checks passed
@chirag-madlani
chirag-madlani deleted the chirag-madlani/ai-mode-settings-modal-pr3 branch October 8, 2026 11:24
@sonarqubecloud

sonarqubecloud Bot commented Oct 8, 2026

Copy link
Copy Markdown

chirag-madlani added a commit that referenced this pull request Oct 8, 2026
…n, Data Quality (#34882)

* Fixes #34868: Platform Settings part 2 — Theme, Profiler Configuration, Data Quality

Move the classic Settings > Preferences Theme, Profiler Configuration and
Data Quality pages into the AI-mode settings modal, each as a read-only view
plus an edit form built on ui-core-components and HookForm.

- Theme: logo/monogram/favicon URLs with live previews, eight free-form HEX
  colours (native swatch + text input), primary colour re-deriving hover and
  selected, and Reset.
- Profiler Configuration: per-data-type metric rows on a field array with the
  "All" shortcut, the disable toggle, sample data settings, and the Collate
  Spark extension point.
- Data Quality: dimension list with search, counts and read-only system rows;
  add/edit routes (data-quality/edit[/<name>]) and a delete confirmation that
  reports affected test cases and definitions.

Routing gains an optional item id and a per-page edit title so list pages can
host add/edit forms.

* Fixes #34869: Platform Settings part 3 — Data Asset Rules, Learning Resources (#34888)

Move the classic Settings > Preferences Data Asset Rules and Learning
Resources pages into the AI-mode settings modal on ui-core-components.

- Data Asset Rules: rule list with the in-place Enabled toggle. Adding rules
  is not supported yet, so the empty state has no Add. Marked Beta on the
  landing, as in the classic menu.
- Learning Resources: the list (search, quick filters, table/card views,
  preview, delete) on the classic page's data hooks; the antd drawer form is
  replaced by a HookForm add/edit page (learning-resources/edit[/<id>]) that
  carries over fields it does not edit (difficulty, context componentId).

The Learning Resources quick-filter row drops its last antd Space for a core
Box, which the classic page shares.

Also fixes two issues in the earlier parts:
- useSettingsFetch loads once per mount. Under StrictMode its effect ran twice
  and the second response could reset a form the user had started editing.
- The dimension edit form fetches only the dimensions, not the two count
  endpoints it never used.
- Each page is keyed by its route, so moving between items (add -> edit,
  browser back/forward) remounts it and loads the right data.
- Empty states centre in the content area instead of the whole modal.

* Keep busy Platform Settings dialogs open until their request finishes

The delete-dimension, confirmation and test-email dialogs blocked outside
clicks while busy, but the close button and Escape still dismissed them,
so the request kept running behind a dialog that looked cancelled. While
busy, the close button is hidden and Escape is ignored.
timothybrush pushed a commit to timothybrush/OpenMetadata that referenced this pull request Oct 8, 2026
…de settings modal (Platform Settings, part 1) (open-metadata#34872)

* Fixes open-metadata#34867: Move Settings > Preferences into the AI-mode settings modal (Platform Settings, part 1)

Add an admin-only Administration > Platform Settings section to the AI-mode
settings modal: a landing of cards with hash routing, and a read-only view
plus edit form for Email (with Test Email), Login Configuration, Health
Check, Lineage, OpenMetadata URL and Default App Mode.

Built only with ui-core-components; forms use HookForm and take their field
hints from the same per-form docs markdown the classic doc panel reads. The
classic /settings/preferences pages are untouched.

The section/row layout is extracted from ProfileDetailsPanel into
SettingsSection so both share it, and the Playwright impact map gains
entries for the new folder and the modal shell.

* Fixes open-metadata#34868: Platform Settings part 2 — Theme, Profiler Configuration, Data Quality (open-metadata#34882)

* Fixes open-metadata#34868: Platform Settings part 2 — Theme, Profiler Configuration, Data Quality

Move the classic Settings > Preferences Theme, Profiler Configuration and
Data Quality pages into the AI-mode settings modal, each as a read-only view
plus an edit form built on ui-core-components and HookForm.

- Theme: logo/monogram/favicon URLs with live previews, eight free-form HEX
  colours (native swatch + text input), primary colour re-deriving hover and
  selected, and Reset.
- Profiler Configuration: per-data-type metric rows on a field array with the
  "All" shortcut, the disable toggle, sample data settings, and the Collate
  Spark extension point.
- Data Quality: dimension list with search, counts and read-only system rows;
  add/edit routes (data-quality/edit[/<name>]) and a delete confirmation that
  reports affected test cases and definitions.

Routing gains an optional item id and a per-page edit title so list pages can
host add/edit forms.

* Fixes open-metadata#34869: Platform Settings part 3 — Data Asset Rules, Learning Resources (open-metadata#34888)

Move the classic Settings > Preferences Data Asset Rules and Learning
Resources pages into the AI-mode settings modal on ui-core-components.

- Data Asset Rules: rule list with the in-place Enabled toggle. Adding rules
  is not supported yet, so the empty state has no Add. Marked Beta on the
  landing, as in the classic menu.
- Learning Resources: the list (search, quick filters, table/card views,
  preview, delete) on the classic page's data hooks; the antd drawer form is
  replaced by a HookForm add/edit page (learning-resources/edit[/<id>]) that
  carries over fields it does not edit (difficulty, context componentId).

The Learning Resources quick-filter row drops its last antd Space for a core
Box, which the classic page shares.

Also fixes two issues in the earlier parts:
- useSettingsFetch loads once per mount. Under StrictMode its effect ran twice
  and the second response could reset a form the user had started editing.
- The dimension edit form fetches only the dimensions, not the two count
  endpoints it never used.
- Each page is keyed by its route, so moving between items (add -> edit,
  browser back/forward) remounts it and loads the right data.
- Empty states centre in the content area instead of the whole modal.

* Keep busy Platform Settings dialogs open until their request finishes

The delete-dimension, confirmation and test-email dialogs blocked outside
clicks while busy, but the close button and Escape still dismissed them,
so the request kept running behind a dialog that looked cancelled. While
busy, the close button is hidden and Escape is ignored.

* Report a Search reset as successful only when the reload works

Resetting the global settings or restoring an entity's defaults showed a
success toast even when the reload after it failed, next to the reload's
error toast, while the page kept the old settings. fetchConfig now reports
whether it loaded, and the success toast waits for it.
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 UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Settings modal: Platform Settings — Data Asset Rules, Learning Resources

2 participants