Skip to content

Add ContentTypeManagement widget to ui.xml#3903

Draft
jmendeza wants to merge 1 commit intocraftercms:developfrom
jmendeza:feature/8496
Draft

Add ContentTypeManagement widget to ui.xml#3903
jmendeza wants to merge 1 commit 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

Summary by CodeRabbit

Release Notes

  • New Features

    • Added Content Type Management widget enabling configuration of page and component content type schemas with customizable field definitions and system properties.
  • Tests

    • Added test coverage for UI configuration upgrade from version 5.0.0.0 to 5.0.0.1.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 19, 2026

Walkthrough

This change introduces a new ContentTypeManagement widget for Crafter Studio UI configuration that defines content type descriptors for pages and components. An XSLT stylesheet conditionally injects this widget during system upgrades, while supporting test fixtures and upgrade pipeline configurations are added.

Changes

Cohort / File(s) Summary
XSLT Transformation Logic
src/main/resources/crafter/studio/upgrade/5.0.x/config/ui/ui-v5.0.0.1.xslt
New XSLT 2.0 stylesheet using identity transform to conditionally inject ContentTypeManagement widget into siteUi structure if not already present. Defines object type descriptors for page and component with field configurations and system properties sections.
Upgrade Pipeline Configuration
src/main/resources/crafter/studio/upgrade/pipelines.yaml
Added two upgrade steps: global repo upgrader for 5.0.0.14 -> 5.0.0.15 updating sample-ui.xml path, and configurations.ui pipeline step for 5.0.0.0 -> 5.0.0.1 applying the XSLT transformation.
UI Configuration Files
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
Added new ContentTypeManagement widget declarations with object type definitions (page and component), field descriptors, and collapsible "System Properties" sections for each type.
Test Fixtures & Validation
src/test/java/org/craftercms/studio/XsltTest.java, src/test/resources/crafter/studio/upgrade/xslt/ui/v5.0/5.0.0.1/*
Added TestNG data provider and test method (ui5001Test) wired to template and input/expected XML resources. Expected output includes full UI configuration with the injected widget; input XML contains baseline configuration without the widget.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested reviewers

  • sumerjabri
🚥 Pre-merge checks | ✅ 2 | ❌ 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 (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title 'Add ContentTypeManagement widget to ui.xml' accurately reflects the main change: adding a new ContentTypeManagement widget definition across multiple UI configuration files.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

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

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.

1 participant