feat: add FEATURE_FLAG_DOTAI_CONFIG_UI and implement legacy guard to support dotAI configuration redesign - #37222
Conversation
…support dotAI configuration redesign
|
Claude finished @KevinDavilaDotCMS's task in 1m 31s —— View job Code ReviewReviewed the full diff against New Issues
Resolved
Note: |
There was a problem hiding this comment.
Pull request overview
Adds a new FEATURE_FLAG_DOTAI_CONFIG_UI feature flag and uses an Angular canMatch guard to route dotAI config traffic to either the redesigned dotAI config page (flag on) or a restored legacy dotAI JSON editor page (flag off), preserving existing customer behavior by default.
Changes:
- Introduces
FEATURE_FLAG_DOTAI_CONFIG_UIacross backend + frontend (defaults tofalse) and exposes it through the configuration API. - Adds
DotPropertiesService.getFreshFeatureFlag()and acanMatchguard so route matching reflects flag flips without requiring a full reload. - Restores the pre-#37048 dotAI config UI as
DotAiConfigDetailLegacyComponentand adds route fallthrough to it when the flag is disabled.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| dotCMS/src/main/resources/dotmarketing-config.properties | Adds default value + documentation for the new dotAI config UI feature flag |
| dotCMS/src/main/java/com/dotcms/rest/api/v1/system/ConfigurationResource.java | Whitelists/exposes the new feature flag via /api/v1/configuration/config |
| dotCMS/src/main/java/com/dotcms/featureflag/FeatureFlagName.java | Adds backend constant for FEATURE_FLAG_DOTAI_CONFIG_UI |
| core-web/libs/dotcms-models/src/lib/shared-models.ts | Adds frontend enum entry for FEATURE_FLAG_DOTAI_CONFIG_UI |
| core-web/libs/data-access/src/lib/dot-properties/dot-properties.service.ts | Adds uncached feature-flag fetch (getFreshFeatureFlag) and refactors normalization |
| core-web/apps/dotcms-ui/src/app/portlets/dot-apps/dot-apps.routes.ts | Adds canMatch routing split + legacy fallback routes for dotAI create/edit |
| core-web/apps/dotcms-ui/src/app/portlets/dot-apps/components/dot-ai-config-detail/dot-ai-config-detail-match.guard.ts | Implements canMatch guard driven by FEATURE_FLAG_DOTAI_CONFIG_UI |
| core-web/apps/dotcms-ui/src/app/portlets/dot-apps/components/dot-ai-config-detail/dot-ai-config-detail-match.guard.spec.ts | Adds Jest coverage for the new match guard behavior |
| core-web/apps/dotcms-ui/src/app/portlets/dot-apps/components/dot-ai-config-detail/dot-ai-config-detail-legacy.component.ts | Restores legacy dotAI JSON editor component (TS) for off-flag experience |
| core-web/apps/dotcms-ui/src/app/portlets/dot-apps/components/dot-ai-config-detail/dot-ai-config-detail-legacy.component.html | Restores legacy dotAI JSON editor template (HTML) |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…tate handling and error display; introduce SCSS for layout management
89ae034
|
Addressed all 5 review comments from the automated review (commit 89ae034):
Verified locally: |
Merge Group Test / Frontend Unit Tests runs nx affected lint-test (-Pvalidate), which diffs against origin/main (core-web/pom.xml git.origin.branch). The shallow fetch-depth:1 checkout added for #37178 has no origin/main ref, so the job fails: fatal: ambiguous argument 'origin/main': unknown revision which cancels every other job in the merge group. Fetch just that ref, shallow, before the lint-test step runs. Refs #37178
…on-ui--add-feature-flag' into 36826-dotai-provider-configuration-ui--add-feature-flag
72536b3
2026-08-25.14-46-15.mov
Why DotAiConfigDetailLegacyComponent exists
This is not a new screen — it's a verbatim restoration of what DotAiConfigDetailComponent looked like before #37048 (the "Provider Config" JSON editor on the left + "Example JSON" reference on the right), pulled from the commit right before #37048 overwrote it (git show 2a161f6^:.../dot-ai-config-detail.component.ts, where 2a161f6 is #37048's merge commit).
#37048 redesigned DotAiConfigDetailComponent in place, so the old UI no longer exists anywhere in the tree except git history. Since this redesign now ships behind FEATURE_FLAG_DOTAI_CONFIG_UI (default false), simply falling back to the generic Apps config screen when the flag is off would have been a regression for existing customers — that's not the screen they use today for dotAI. Restoring the pre-#37048 component as a separate file (DotAiConfigDetailLegacyComponent, selector dot-ai-config-detail-legacy) preserves their exact current experience: same markup, same EXAMPLE_CONFIG, same DotAiService.getConfig/saveConfig calls against /completions/config, which are unchanged and still live.
dot-apps.routes.ts picks between the two via canMatch: flag on → DotAiConfigDetailComponent (new capability-cards UI); flag off/default → DotAiConfigDetailLegacyComponent (this one), so nothing changes for customers who haven't opted in.
This PR fixes: #36826