Description
The UVE app (dotema-config-v2) asks for its configuration as raw JSON in a plain textarea. Users get no help writing it and no validation. Mistakes only show up when the editor fails to load. The example in the hint itself is invalid JSON, because it has a trailing comma after "url".
Replace the textarea with a structured Routes editor, keep raw JSON as a fallback tab, and validate the value on both the client and the server. The saved format does not change: it is still the same JSON string in the same configuration secret.
Routes tab (default)
| Element |
Behavior |
| Route card |
One per config entry: Path pattern (RegEx), Server URL, optional Allowed dev URLs list |
| Card title |
Says what the route does, e.g. /blogs/(.*) → myspa.blogs.com, plus a #N order badge |
| Catch-all |
A .* route shows a Default tag and the title "All other pages → host" |
| Order |
Move up and move down buttons, because the first matching pattern wins |
| Unreachable route |
A route after a .* route shows a Never used warning (save is not blocked) |
| Add route |
Appends a new route at the end |
JSON tab
- A Monaco editor with live JSON validation and a Format JSON button.
- The tab is meant for pasting a config, and for keys the form doesn't know about.
- The field hint shows only on this tab.
Backend
- Add a new
JSON value to the app param type enum (com.dotcms.security.apps.Type).
- Validate JSON when saving and updating, in
AppsUtil.validateForSave and AppsHelper.validateFormForUpdate.
- Validate a
JSON param's default value when loading the app YAML, in AppDescriptorHelper.
SecretView reports the descriptor's JSON type for configs that were saved as STRING.
- In
dotema-config-v2.yml, set configuration to type: 'JSON' and rewrite the hint with a valid example.
Hints across all Apps
- Code blocks in any app's hint get a header with the language and a Copy button.
- JSON in those blocks is highlighted with dotCMS theme colors.
Acceptance Criteria
Routes editor
JSON tab
Backend
Hints
Environment-locked values
Priority
Medium
Additional Context
- Prototype: done on local branch
issue-uve-app-new-json-file; not pushed yet.
- Why "Reject import": an invalid UVE config already fails at render time, so rejecting it on import surfaces the problem earlier.
- Supported keys: the UVE reads only
pattern, url and options.allowedDevURLs per entry (dot-ema-shell.component.ts).
- New message keys:
apps.uve.*, apps.json.field.* and apps.code.block.* in Language.properties.
Description
The UVE app (
dotema-config-v2) asks for itsconfigurationas raw JSON in a plain textarea. Users get no help writing it and no validation. Mistakes only show up when the editor fails to load. The example in the hint itself is invalid JSON, because it has a trailing comma after"url".Replace the textarea with a structured Routes editor, keep raw JSON as a fallback tab, and validate the value on both the client and the server. The saved format does not change: it is still the same JSON string in the same
configurationsecret.Routes tab (default)
configentry: Path pattern (RegEx), Server URL, optional Allowed dev URLs list/blogs/(.*) → myspa.blogs.com, plus a#Norder badge.*route shows a Default tag and the title "All other pages → host".*route shows a Never used warning (save is not blocked)JSON tab
Backend
JSONvalue to the app param type enum (com.dotcms.security.apps.Type).AppsUtil.validateForSaveandAppsHelper.validateFormForUpdate.JSONparam's default value when loading the app YAML, inAppDescriptorHelper.SecretViewreports the descriptor'sJSONtype for configs that were saved asSTRING.dotema-config-v2.yml, setconfigurationtotype: 'JSON'and rewrite the hint with a valid example.Hints across all Apps
Acceptance Criteria
Routes editor
configentry, in the saved order..*route.optionsobject are left out of the saved JSON.options, are kept on save.JSON tab
configlist) opens on the JSON tab, and the Routes tab is disabled with an explanation.Backend
configurationwith invalid JSON fails with a clear error message.configurationis invalid JSON is rejected with the same error.STRING, open in the new editor.JSONparam whose default value is not valid JSON fails descriptor validation.Hints
text-shadow.Environment-locked values
Priority
Medium
Additional Context
issue-uve-app-new-json-file; not pushed yet.pattern,urlandoptions.allowedDevURLsper entry (dot-ema-shell.component.ts).apps.uve.*,apps.json.field.*andapps.code.block.*inLanguage.properties.