Fix: align glossary term relation type colors with design system#27142
Fix: align glossary term relation type colors with design system#27142sonika-shah merged 12 commits intomainfrom
Conversation
System-defined relation types (relatedTo, synonym, antonym, etc.) were initialized with old Ant Design palette colors (#1890ff, #722ed1, …) while the frontend RELATION_META constants had been updated to the new design system colors (#1570ef, #b42318, …). Because renderColorBadge used record.color (from the backend) unconditionally, the stale Ant Design colors were always displayed instead of the intended ones. - Frontend: renderColorBadge now treats RELATION_META as authoritative for system-defined types so the correct design-system color is always shown, regardless of what color value is stored in the backend. - Backend (SettingsCache.java): default colors updated for new installs. - DB migration (2.0.0): postDataMigrationSQLScript added for MySQL and PostgreSQL to update colors in existing deployments without touching user-added custom relation types. - Tests: unit tests for renderColorBadge color-resolution logic; integration test asserting all ten system-defined types return the expected hex values from the API. Fixes #openmetadata/OpenMetadata
There was a problem hiding this comment.
Pull request overview
Aligns system-defined glossary term relation type colors with the current design system by making the UI prefer frontend constants for system types, updating backend defaults for new installs, and providing DB migrations to sync existing stored settings.
Changes:
- UI: Prefer
RELATION_METAcolors forisSystemDefinedrelation types when rendering the color badge. - Backend: Update default system-defined relation type colors in
SettingsCachefor fresh installations. - Migrations + tests: Add MySQL/Postgres post-migration scripts for 2.0.0 and add unit/integration tests to validate the corrected colors.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| openmetadata-ui/src/main/resources/ui/src/pages/GlossaryTermRelationSettings/GlossaryTermRelationSettings.tsx | Ensures system-defined types render design-system colors regardless of stale DB values. |
| openmetadata-ui/src/main/resources/ui/src/pages/GlossaryTermRelationSettings/GlossaryTermRelationSettings.test.tsx | Adds unit tests for system-defined vs custom color rendering behavior. |
| openmetadata-service/src/main/java/org/openmetadata/service/resources/settings/SettingsCache.java | Updates default colors for system-defined glossary term relation types for new installs. |
| openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/GlossaryTermRelationSettingsIT.java | Adds integration test asserting design-system colors are returned by the settings API. |
| bootstrap/sql/migrations/native/2.0.0/postgres/postDataMigrationSQLScript.sql | Postgres migration to update stored system-defined relation type colors in settings JSON. |
| bootstrap/sql/migrations/native/2.0.0/mysql/postDataMigrationSQLScript.sql | MySQL migration to update stored system-defined relation type colors in settings JSON. |
🟡 Playwright Results — all passed (27 flaky)✅ 3597 passed · ❌ 0 failed · 🟡 27 flaky · ⏭️ 207 skipped
🟡 27 flaky test(s) (passed on retry)
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
…te 1.13.0 migration; Remove glossary term relation migrations mistakenly re-added in 1.13.0 and update relation type colors in the 1.14.0 migration INSERT to use design system tokens instead of old Ant Design colors.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Regarding the frontend unit test removal — discussed with the team, the test file is not required for this PR. The color logic is covered by the backend integration test ( cc - @gitar-bot please update the comment accordingly #27142 (comment) |
Code Review
|
| Compact |
|
Was this helpful? React with 👍 / 👎 | Gitar
|
|



Fixes #3344
Summary
#1890ff,#722ed1, …) when the feature launched. The frontendRELATION_METAconstants were later updated to the new design-system colors (#1570ef,#b42318, …), but the stored backend values were never synced. BecauserenderColorBadgeusedrecord.color(from the backend) unconditionally, the stale colors always won.renderColorBadgenow treatsRELATION_METAas authoritative for system-defined types — correct colors show immediately regardless of what is stored in the DB.SettingsCache.javaupdated for brand-new installations.2.0.0):postDataMigrationSQLScript.sqladded for both MySQL and PostgreSQL. Updates only the color field of each named system-defined type using JSON path lookups — custom relation types added by users are untouched.Color mapping
#1890ff#1570ef#722ed1#b42318#f5222d#b54708#597ef7#067647#85a5ff#4e5ba6#13c2c2#026aa2#36cfc9#155eef#faad14#6938ef#ffc53d#ba24d5#eb2f96#c11574Test plan
GlossaryTermRelationSettings.test.tsx):#1890ff) renders the design-system label, not the raw hex—GlossaryTermRelationSettingsIT#test_systemDefinedRelationTypesHaveCorrectDesignSystemColors): asserts each of the 10 system-defined types returns the expected design-system hex from the settings APIGlossaryTermRelationSettingsITcontinue to passglossaryTermRelationSettingsrow and restart the server — relation type colors in Settings UI should match the expected values