Skip to content

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

Merged
chirag-madlani merged 3 commits into
chirag-madlani/ai-mode-settings-modalfrom
chirag-madlani/ai-mode-settings-modal-pr2
Oct 8, 2026
Merged

chirag-madlani merged 3 commits into
chirag-madlani/ai-mode-settings-modalfrom
chirag-madlani/ai-mode-settings-modal-pr2

Conversation

@chirag-madlani

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

Copy link
Copy Markdown
Collaborator

Describe your changes:

Fixes #34868

Stacked on #34872 (Platform Settings, part 1). Review that PR first. This PR's diff is only the part-2 commit; once #34872 merges, GitHub retargets this PR to main.

Moves three more classic Settings → Preferences pages into the AI-mode settings modal's Platform Settings section: Theme, Profiler Configuration and Data Quality. Platform Settings now covers 9 of the 12 legacy pages. Every page is a read-only view plus an edit form built only from @openmetadata/ui-core-components, with forms on HookForm and no antd or Less. Legacy fields, validation and save behaviour are kept. The classic pages are untouched.

Remaining: Data Asset Rules and Learning Resources (#34869), and Search (#34870).

Type of change:

  • New feature

High-level design:

Builds on the part-1 panel (Profile/tabs/platform-settings/): the page registry, hash routing and view + edit pattern.

Routing for list pages. Data Quality is a list with add/edit.

  • PlatformSettingsView gains an optional itemId. #platform-settings/data-quality/edit means add, and …/edit/<dimension name> means edit that dimension.
  • Pages can supply getEditTitle, which gives "Add Dimension" / "Edit Dimension" instead of the default "Edit {page}".
  • Unknown or stale ids fall back the same way as before: a deleted dimension shows an error and returns to the list.

Theme (ThemeSettings, ThemeSettingsForm, HexColorField, ThemeSettings.utils)

  • Data source: reads and writes the live applicationConfig in the app store, as the classic page did, so a save re-themes the app immediately.
  • Colour input: the core ColorPickerField only offers a fixed palette, but the theme accepts any HEX. HexColorField pairs a native <input type="color"> swatch with a core Input, both bound to the same form value. It's the same two-part control the classic page used, without antd.
  • Behaviour:
    • Picking a primary colour re-derives hover and selected from the generated palette.
    • Logo URLs are validated as absolute URLs, with live previews.
    • Reset clears everything, with no confirmation, as in legacy.
    • Field hints come from the existing CustomLogoConfiguration.md.

Profiler Configuration (ProfilerSettings, ProfilerSettingsForm, ProfilerSettings.utils)

  • Metric rows: a react-hook-form useFieldArray. Each row has a data type (types already used by another row can't be chosen), metrics, and a disable toggle.
  • "All" shortcut: the classic tree-select's "All" parent node is now an "All" option in the multi-select. A row holding every metric loads as "All", and "All" saves as the full metric list, so stored data is unchanged.
  • Sample data: turning on storing also turns on reading.
  • Spark extension: the Collate Spark section (ProfilerConfigurationClassBase.getSparkAgentConfigComponent) still renders when present.

Data Quality (DataQualitySettings, DimensionSettingsForm, DimensionCells, DimensionDeleteDialog)

  • List: core Table with search. Test-case counts show "--" rather than 0 when the count request fails. System dimensions are read-only.
  • Add/edit: the classic drawer is replaced by the add/edit routes above. Edit locks the name and saves a JSON patch.
  • Delete: the confirmation states how many test cases and test definitions are affected, or that the impact is unknown.

Alternatives considered. Keeping the Data Quality drawer inside the modal was rejected: a nested overlay inside the modal fights its focus scope, and the add/edit routes match how every other page edits.

Tests:

Use cases covered

  • Theme: the view shows live logos and colours ("Not set" for blanks). Editing a colour or logo saves and re-themes the app. Invalid HEX values and relative URLs are rejected. A new primary colour re-derives hover and selected. Reset clears everything.
  • Profiler: the view shows metrics per data type, "All" for a full set, and "Disabled" rows. The form adds and removes rows, requires a data type, expands "All" on save, links sample-data storing and reading, and keeps the Spark extension.
  • Data Quality: list, search, read-only system rows, unknown counts shown as "--". Add with name validation and a colour; edit with the name locked; delete with impact warnings; a stale edit link returns to the list.

Unit tests

  • Added for the new logic. They render the real core components and HookForm; only the REST layer and app store are mocked.
  • Files: ThemeSettings.test.tsx, ThemeSettings.utils.test.ts, ProfilerSettings.test.tsx, ProfilerSettings.utils.test.ts, DataQualitySettings.test.tsx; updated PlatformSettingsPanel.test.tsx and PlatformSettings.utils.test.ts.
  • Results: 15 suites / 91 tests in the folder, and all 98 Profile suites / 636 tests pass.
  • Coverage on the part-2 and routing files: 96.7% lines, with 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 13 tests.
    • Theme and Profiler: saves are stubbed on the settings round-trip, so tenant-wide config never changes under parallel workers.
    • Data Quality: adds, edits and deletes a uniquely named dimension against the real API, with cleanup in finally.
  • Spec hardening, also applying to the part-1 tests:
    • The modal is opened without waiting on home-page widget loaders, which never clear on some backends.
    • The landing test allows 30s per page, because loads can queue behind the real /system/status probe in a sibling worker.
  • The impact map already maps tabs/platform-settings/** to this spec (added in Fixes #34867: Move Settings > Preferences into the AI-mode settings modal (Platform Settings, part 1) #34872).

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

Spec Result
Features/ProfilePlatformSettings.spec.ts 13/13 passed in 3 consecutive runs at 4 workers
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.
  2. Theme: checked the live colours and logo previews. In edit, turned on Show Hint for the logo field, picked a new primary colour and saw hover and selected update, entered an invalid HEX and got the error, then cancelled.
  3. Profiler: the view showed the per-type metrics. In edit, added a STRING row, turned on storing sample data (reading followed), and saved.
  4. Data Quality: searched the list, opened Add Dimension, got the validation error for "not valid", then filled a valid name and colour. Edit locks the name; delete shows the impact warning.

UI screen recording / screenshots:

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

01-landing 02-theme-view 03-theme-edit 04-theme-edit-hint 06-profiler-view 07-profiler-edit 08-dq-list 09-dq-add-validation
platform-settings-pr2-walkthrough.mp4

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 7, 2026
@github-actions

github-actions Bot commented Oct 7, 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 7, 2026
@github-actions

github-actions Bot commented Oct 7, 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 → 865
- 14 added, 1 removed, 16 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/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/PlatformSettingsLanding.tsx
  openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/Profile/tabs/platform-settings/PlatformSettingsPanel.tsx
  openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/Profile/tabs/platform-settings/ProfilerSettingsForm.tsx
  … and 4 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 6 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 7, 2026 •

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 76%
76.29% (120194/157537) 62.23% (74390/119537) 63.69% (24869/39044)

@chirag-madlani
chirag-madlani force-pushed the chirag-madlani/ai-mode-settings-modal branch from 96f8793 to 33ab8bb Compare October 8, 2026 09:18
@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 branch from 33ab8bb to 4ea76a5 Compare October 8, 2026 10:48
@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
…n, 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.
@chirag-madlani
chirag-madlani force-pushed the chirag-madlani/ai-mode-settings-modal branch from 4ea76a5 to 788629f Compare October 8, 2026 10:54
@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
…esources (#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.
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.
@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 access-control settings can be disabled from the modal, potentially exposing protected asset metadata in search results.

Migrates Theme, Profiler Configuration, and Data Quality settings pages into the Platform Settings modal with comprehensive test coverage and HookForm-based forms. Addressed the dialog close button dismissing while operations are in flight; no remaining issues.

✅ 1 closed
✅ Edge Case: Dialog close (X) button still dismisses while delete is in flight

📄 openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/Profile/tabs/platform-settings/DimensionDeleteDialog.tsx:56 📄 openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/Profile/tabs/platform-settings/DimensionDeleteDialog.tsx:63
The dialog is meant to stay open while a delete runs: isDismissable={!isDeleting} blocks the overlay and the Cancel button is disabled. The header close button (showCloseButton, onClose={onCancel}) has no such guard, though. If the user clicks X mid-request, the dialog closes as if they cancelled, but handleDelete keeps going and the dimension is still deleted. Fix: make onClose do nothing while isDeleting is true, or hide the close button during the delete.

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

@sonarqubecloud

sonarqubecloud Bot commented Oct 8, 2026

Copy link
Copy Markdown

@chirag-madlani
chirag-madlani merged commit fbdee7f into chirag-madlani/ai-mode-settings-modal Oct 8, 2026
68 of 69 checks passed
@chirag-madlani
chirag-madlani deleted the chirag-madlani/ai-mode-settings-modal-pr2 branch October 8, 2026 12:46
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 — Theme, Profiler Configuration, Data Quality

2 participants