Repository navigation
Description
Description
Five improvements to creating content from Content Drive's New menu and its content type picker (dot-content-drive-dialog-content-type-selector, which reuses the UVE palette list in selection mode).
1. One click on a card creates. The picker has a Cancel / Create footer: you select a card, then press Create. Clicking a card should open the create editor for that content type directly, and the footer's Create button goes away.
2. Toolbar button names the type. When Content Drive is narrowed to a single content type, the toolbar's create button should read Create <Content Type name> and open the editor for that type straight away, skipping the picker.
3. Empty state layout. The picker's empty state is not centered and its padding doesn't match the rest of the dialog. Moved to #38379 and fixed there (PR #38707): the list area padded only its left side, so the empty state sat off centre; it now gets the same right padding as the cards, in the shared palette list, so the page editor's palette is centred too.
4. Missing permissions look like "nothing exists". The New menu always lists every base type. Picking one calls GET /api/v1/contenttype?type=<BASE>&system=false, which the server runs as the user, leaving out types they can't read. A user with no permission gets a normal, successful, empty response, not a 403, and the picker shows "No content types available to add. Learn how to create a content type." No existing endpoint can tell the menu ahead of time which base types the user can use: /api/v1/contenttype/basetypes returns the same fixed list for every user, with types: null even for an admin (checked on a running instance). A new endpoint answers that in one request, and the New menu shows only the base types the user can use.
5. New pages open in UVE. After a page is created from Content Drive, the user lands in UVE on that page.
Acceptance Criteria
Picker: create on click
- Clicking a card closes the dialog and opens the create editor for that type, in the folder Content Drive is showing
- The picker has no Create (confirm) button
- The picker can still be closed without creating anything
- Works the same for content types that still use the legacy editor
Toolbar: Create <Content Type>
- With exactly one content type selected in Content Drive, the toolbar's create button reads "Create <that type's name>"
- Clicking it opens the create editor for that type without showing the picker
- With none or more than one selected, the button keeps its current label and behavior
Picker: empty state (moved to #38379, PR #38707)
-
The empty state is centered horizontally and vertically in the dialog body -
Its padding matches the rest of the dialog
Backend: base types available to the user
- A new REST endpoint returns, in one request, the base types for which the current user can see at least one non-system content type: the same set the picker would list for them
- An anonymous request is rejected
- The result respects the user's permissions; an admin gets every base type that has at least one non-system content type
- The endpoint is documented with
@Operation/@Schemaannotations andopenapi.yamlis regenerated - Integration tests cover an admin, a user with partial permissions, and a user with none, and are registered in a MainSuite
New menu: only usable base types
- The New menu calls the endpoint once when it opens and lists only the base types it returns
- "All content types" is hidden when the endpoint returns no base types
- If the endpoint call fails, the menu falls back to listing every base type
Picker: empty fallback
- An empty picker opened from the New menu with no search term shows a Content Drive message naming both causes (no content types of this kind, or no permission to use them), without the "Learn how to create a content type" link
- An empty search result keeps "No results found"
Pages open in UVE
- Saving a new page created from Content Drive takes the user to UVE on that page
- Other base types keep the current behavior
Say where new content was saved
- When an item created from Content Drive is saved outside the site or folder being browsed, the user sees a message naming the site and folder it was saved to
- An item saved where the current view shows it gets no extra message
- If the message links to that location, the link is left out when the user cannot read that site
- Works for the legacy editor too: its save event carries only the identifier, inode and language, so Content Drive looks up the saved item to get its site and folder
Priority
Medium
Additional Context
- Item 4 needs a backend endpoint, because no existing one groups the content types a user can see by base type. Doing it from the frontend alone would take one request per base type each time the menu opens.
- The empty-state messages live in the shared UVE palette (
EMPTY_MESSAGES); the new copy should be specific to Content Drive so UVE keeps its wording.
Decisions
The picker keeps listing content types from every site, and tells the user where a new item was saved.
Where a new item is saved depends on whether its content type has a Host/Folder field, not on which site the type belongs to:
- With the field: Content Drive passes the current folder to the editor (
folderPath), which prefills the field, so the item lands where the user is browsing. - Without the field: the save falls back to the content type's own site and folder (
populateHost,ESContentletAPIImpl.java:11006), so the item lands outside the current view, even for a type on the current site when the user is inside a folder.
A local test, one item of each kind:
| Content type | Item saved on | Shown at the browsed site's root | Shown inside a folder |
|---|---|---|---|
| Another site's type, with the field | the browsed site | yes | lands in that folder |
| Another site's type, no field | the other site | no | no |
| System Host type, no field | System Host | yes | no |
Filtering by the type's site would hide types that work fine, so the picker does not filter by site. The user is told where the item went instead.
Known limitations. The picker checks permission on the content type, not on the site the item will be saved to. A local test with a limited user who had full rights on their own site:
| Permissions on the content types' site | Type in picker | Create, no field | Create, with field, into the user's site |
|---|---|---|---|
| None | no | n/a | n/a |
| Can use its content types and edit its content, cannot read the site | yes | saved on that site, which the user cannot open in Content Drive | works |
| Can use its content types, content is read-only | yes | fails on save ("does not have permission to publish") | works |
Both cases take an unusual permission setup and neither loses work silently: the first is covered by the "Say where new content was saved" criteria, the second by the save error. Hiding types without a Host/Folder field when the user cannot create content on the type's site would need a per-type permission check in the new endpoint; it is left out unless it comes up in practice.
Metadata
Metadata
Assignees
Type
Projects
- StatusShow more project fieldsNext Sprint
Activity
fix(content-drive): regressions and small fixes from #38379