Skip to content

Add ContentTypeManagement widget to ui.xml#3903

Open
jmendeza wants to merge 4 commits intocraftercms:developfrom
jmendeza:feature/8496
Open

Add ContentTypeManagement widget to ui.xml#3903
jmendeza wants to merge 4 commits intocraftercms:developfrom
jmendeza:feature/8496

Conversation

@jmendeza
Copy link
Copy Markdown
Member

@jmendeza jmendeza commented Mar 19, 2026

Add ContentTypeManagement widget to ui.xml
craftercms/craftercms#8496
Related to
craftercms/craftercms#8583

Summary by CodeRabbit

  • New Features

    • Adds a Content Type Management widget to Studio UI for configuring page and component schemas, system properties, control icons and datasource icon mappings.
  • Chores

    • Adds automated upgrade steps to apply the UI update during version upgrades.
  • Tests

    • Adds test coverage validating the UI upgrade/XSLT transformation.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 19, 2026

Warning

Rate limit exceeded

@jmendeza has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 49 minutes and 37 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 61413b1c-1e72-49aa-b532-e61e3466b32e

📥 Commits

Reviewing files that changed from the base of the PR and between 32700c1 and 273e6b2.

📒 Files selected for processing (7)
  • src/main/resources/crafter/studio/upgrade/5.0.x/config/ui/ui-v5.0.0.1.xslt
  • src/main/webapp/repo-bootstrap/global/blueprints/1000_website_editorial/config/studio/ui.xml
  • src/main/webapp/repo-bootstrap/global/blueprints/2000_headless_store/config/studio/ui.xml
  • src/main/webapp/repo-bootstrap/global/blueprints/4000_empty/config/studio/ui.xml
  • src/main/webapp/repo-bootstrap/global/blueprints/5000_headless_blog/config/studio/ui.xml
  • src/main/webapp/repo-bootstrap/global/configuration/samples/sample-ui.xml
  • src/test/resources/crafter/studio/upgrade/xslt/ui/v5.0/5.0.0.1/expected.xml

Walkthrough

Adds an XSLT upgrade that conditionally injects a new craftercms.components.ContentTypeManagement widget (with object types page and component, fields, controls, and datasources) into siteUi; adds pipeline wiring, repo-bootstrap/sample UI entries, and unit test + fixtures validating the XSLT.

Changes

Content-Type Management XSLT upgrade

Layer / File(s) Summary
Repo-bootstrap / Sample UI (data shape)
src/main/webapp/repo-bootstrap/global/blueprints/1000_website_editorial/config/studio/ui.xml, src/main/webapp/repo-bootstrap/global/configuration/samples/sample-ui.xml
Adds craftercms.components.ContentTypeManagement widget declarations with objectTypes id="page" and id="component", their field descriptors (file-name, internal-name, navLabel, placeInNav), sections, and control/datasource icon mappings.
XSLT transformation (core implementation)
src/main/resources/crafter/studio/upgrade/5.0.x/config/ui/ui-v5.0.0.1.xslt
New XSLT 2.0 identity stylesheet that overrides siteUi/widget[last()] to copy existing widgets and conditionally append the craftercms.components.ContentTypeManagement widget (full configuration, controls, datasources) only if absent.
Upgrade pipeline (wiring)
src/main/resources/crafter/studio/upgrade/pipelines.yaml
Adds pipelines.system.versions step (5.0.0.15 → 5.0.0.16) updating sample UI and a configurations.ui.pipeline.versions step (5.0.0.0 → 5.0.0.1) that runs the new xsltFileUpgrader using the XSLT template.
Tests / Fixtures
src/test/java/org/craftercms/studio/XsltTest.java, src/test/resources/crafter/studio/upgrade/xslt/ui/v5.0/5.0.0.1/input.xml, .../expected.xml
Adds TestNG data provider and test method exercising the new XSLT with input fixture (baseline siteUi) and expected fixture (siteUi including injected ContentTypeManagement configuration).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested reviewers

  • sumerjabri
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add ContentTypeManagement widget to ui.xml' accurately reflects the main change across the pull request—adding a new ContentTypeManagement widget to ui.xml and related configuration files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
src/main/resources/crafter/studio/upgrade/pipelines.yaml (1)

1365-1367: Misleading commit message.

The commitDetails says "Update the UI to use new icons for dashboard widgets" but the actual change performed by ui-v5.0.0.1.xslt is injecting the craftercms.components.ContentTypeManagement widget. Consider updating to accurately describe the change, e.g., "Add ContentTypeManagement widget to ui.xml".

Suggested fix
             -   currentVersion: 5.0.0.0
                 nextVersion: 5.0.0.1
                 operations:
                     -   type: xsltFileUpgrader
                         template: crafter/studio/upgrade/5.0.x/config/ui/ui-v5.0.0.1.xslt
-                        commitDetails: Update the UI to use new icons for dashboard widgets
+                        commitDetails: Add ContentTypeManagement widget to ui.xml
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/main/resources/crafter/studio/upgrade/pipelines.yaml` around lines 1365 -
1367, The commitDetails for the xsltFileUpgrader entry referencing template
crafter/studio/upgrade/5.0.x/config/ui/ui-v5.0.0.1.xslt is misleading; change
the commitDetails string from "Update the UI to use new icons for dashboard
widgets" to an accurate description such as "Add ContentTypeManagement widget to
ui.xml" so it reflects that the XSLT injects the
craftercms.components.ContentTypeManagement widget.
src/main/webapp/repo-bootstrap/global/blueprints/1000_website_editorial/config/studio/ui.xml (1)

394-479: Add ContentTypeManagement widget definition to other blueprints for consistency.

The 2000_headless_store, 4000_empty, and 5000_headless_blog blueprints reference craftercms.components.ContentTypeManagement as a tool with only a self-closing widget tag, while 1000_website_editorial includes the full widget definition with configuration for objectTypes (page and component). Adding the widget definition to the other blueprints would align their configuration with 1000_website_editorial.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/main/webapp/repo-bootstrap/global/blueprints/1000_website_editorial/config/studio/ui.xml`
around lines 394 - 479, The other blueprints (2000_headless_store, 4000_empty,
5000_headless_blog) only include a self-closing <widget
id="craftercms.components.ContentTypeManagement" /> while 1000_website_editorial
defines the full widget with <configuration> containing <objectTypes id="page">
and <objectTypes id="component">; update those blueprints to replace the
self-closing widget with the full ContentTypeManagement widget definition copied
from 1000_website_editorial (including the page and component <descriptor>
entries, fields like file-name, internal-name, navLabel, placeInNav, and the
System Properties <sections>) so all blueprints share the same configured
craftercms.components.ContentTypeManagement widget.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/main/resources/crafter/studio/upgrade/pipelines.yaml`:
- Around line 1365-1367: The commitDetails for the xsltFileUpgrader entry
referencing template crafter/studio/upgrade/5.0.x/config/ui/ui-v5.0.0.1.xslt is
misleading; change the commitDetails string from "Update the UI to use new icons
for dashboard widgets" to an accurate description such as "Add
ContentTypeManagement widget to ui.xml" so it reflects that the XSLT injects the
craftercms.components.ContentTypeManagement widget.

In
`@src/main/webapp/repo-bootstrap/global/blueprints/1000_website_editorial/config/studio/ui.xml`:
- Around line 394-479: The other blueprints (2000_headless_store, 4000_empty,
5000_headless_blog) only include a self-closing <widget
id="craftercms.components.ContentTypeManagement" /> while 1000_website_editorial
defines the full widget with <configuration> containing <objectTypes id="page">
and <objectTypes id="component">; update those blueprints to replace the
self-closing widget with the full ContentTypeManagement widget definition copied
from 1000_website_editorial (including the page and component <descriptor>
entries, fields like file-name, internal-name, navLabel, placeInNav, and the
System Properties <sections>) so all blueprints share the same configured
craftercms.components.ContentTypeManagement widget.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 4c373df2-5efd-48b6-a71e-0cb765884d68

📥 Commits

Reviewing files that changed from the base of the PR and between c233f16 and 40a3714.

📒 Files selected for processing (7)
  • src/main/resources/crafter/studio/upgrade/5.0.x/config/ui/ui-v5.0.0.1.xslt
  • src/main/resources/crafter/studio/upgrade/pipelines.yaml
  • src/main/webapp/repo-bootstrap/global/blueprints/1000_website_editorial/config/studio/ui.xml
  • src/main/webapp/repo-bootstrap/global/configuration/samples/sample-ui.xml
  • src/test/java/org/craftercms/studio/XsltTest.java
  • src/test/resources/crafter/studio/upgrade/xslt/ui/v5.0/5.0.0.1/expected.xml
  • src/test/resources/crafter/studio/upgrade/xslt/ui/v5.0/5.0.0.1/input.xml

@jmendeza jmendeza marked this pull request as ready for review April 20, 2026 20:24
@jmendeza jmendeza requested a review from sumerjabri as a code owner April 20, 2026 20:24
@jvega190
Copy link
Copy Markdown
Member

All good here

Copy link
Copy Markdown
Member

@russdanner russdanner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The one thing that stands out to me is the name of this tag is plural but it represents a signle objectType. I think this will lead to mistakes.

<objectTypes id="component">

You see the same patter with controls and data sources:

<controls id="input-email">

@sumerjabri
Copy link
Copy Markdown
Member

@russdanner I'll hold off until you approve this PR.

@russdanner
Copy link
Copy Markdown
Member

The one thing that stands out to me is the name of this tag is plural but it represents a signle objectType. I think this will lead to mistakes.

<objectTypes id="component">

You see the same patter with controls and data sources:

<controls id="input-email">

@rart @sumerjabri We need a decision on this

@sumerjabri
Copy link
Copy Markdown
Member

@russdanner will changing this to singular break backward compat?

@russdanner
Copy link
Copy Markdown
Member

No. Not in a direct sense. The change to use ui.xml breaks backward compatibility, not the names of the tags.

@sumerjabri
Copy link
Copy Markdown
Member

@jmendeza please fix the plural thing, and let's include that in UM as needed to make sure the upgrades are smooth.

Copy link
Copy Markdown
Member

@sumerjabri sumerjabri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my note above.

@jvega190
Copy link
Copy Markdown
Member

jvega190 commented May 8, 2026

@sumerjabri the UI also needs to be updated to handle the correct structure. I'll check with Jonathan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants