-
Notifications
You must be signed in to change notification settings - Fork 0
Add bulk actions for rename, workflow, tags, and properties management #110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
a9b0670
2fbbc7a
7ddaf33
3c0134b
69f644c
d257286
432d158
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| --- | ||
| myst: | ||
| html_meta: | ||
| "description": "How to rename, change state, tag, and edit properties for one or more items in the Plone Aurora folder contents view" | ||
| "property=og:description": "How to rename, change state, tag, and edit properties for one or more items in the Plone Aurora folder contents view" | ||
| "property=og:title": "Manage folder contents in bulk" | ||
| "keywords": "Plone Aurora, contents, rename, workflow, tags, properties, bulk" | ||
| --- | ||
|
|
||
| # Manage folder contents in bulk | ||
|
|
||
| This guide shows you how to rename items, change their workflow state, edit their tags, and edit their properties from the folder contents view. | ||
| Each action works on one or several items at once. | ||
|
|
||
| ## Open the folder contents view | ||
|
|
||
| Navigate to a folder, then select the {guilabel}`Contents` button <img alt="Contents" src="../_static/icons/contents.svg" class="inline"> in the toolbar. | ||
| The view lists the items in the folder together with a toolbar of actions. | ||
|
|
||
| ## Select the items to act on | ||
|
|
||
| To select items to act on, check their checkboxes in the first column. | ||
| To either select or deselect all items on the current page, check the checkbox in the table header. | ||
|
|
||
| The {guilabel}`Rename`, {guilabel}`Change state`, {guilabel}`Tags`, and {guilabel}`Properties` actions stay disabled until you select at least one item. | ||
| Each action applies to the current selection. | ||
|
|
||
| ## Rename items | ||
|
|
||
| 1. Select the items to rename. | ||
| 2. Select {guilabel}`Rename` in the toolbar. | ||
| 3. Edit the {guilabel}`Name`, the {guilabel}`URL`, or both for each item in the dialog. | ||
| 4. Select the {guilabel}`→` button to apply the changes. | ||
|
|
||
| The {guilabel}`Name` is the title of the item. | ||
| The {guilabel}`URL` is the last segment of the item's URL. | ||
|
|
||
| ````{note} | ||
| Changing the {guilabel}`URL` changes the item's URL. | ||
| Aurora automatically redirects the old URL to the new one, so existing links and bookmarks keep working. | ||
| ```{todo} | ||
| Document the URL management control panel once it is available. | ||
| See [URL management: redirect control panel + documentation](https://github.com/plone/aurora/issues/121). | ||
| ``` | ||
| ```` | ||
|
|
||
| ## Change the workflow state | ||
|
|
||
| 1. Select the items whose state you want to change. | ||
| 2. Select {guilabel}`Change state` in the toolbar. | ||
| 3. Choose a transition from the list. | ||
| 4. Optionally add a comment. | ||
| 5. Optionally select {guilabel}`Apply to contained items` to apply the transition recursively. | ||
| 6. Select the {guilabel}`→` button to apply the transition. | ||
|
|
||
| The list offers only the transitions that are available for every selected item. | ||
| If the selected items share no common transition, the dialog tells you so, and you can't apply a transition. | ||
|
|
||
| ## Edit tags | ||
|
|
||
| 1. Select the items to tag. | ||
| 2. Select {guilabel}`Tags` in the toolbar. | ||
| 3. Remove a tag by selecting the {guilabel}`×` next to it. | ||
| 4. Add a tag by typing it in the input and pressing {kbd}`Enter`. | ||
| 5. Select {guilabel}`Save tags` to apply the changes. | ||
|
|
||
| The field shows the tags already present on the selection. | ||
| The input suggests existing tags from the site. | ||
| Adding a tag applies it to every selected item, and removing a tag removes it from every selected item. | ||
|
|
||
| ## Edit properties | ||
|
|
||
| 1. Select the items whose properties you want to edit. | ||
| 2. Select {guilabel}`Properties` in the toolbar. | ||
| 3. Edit any of the {guilabel}`Publishing date`, {guilabel}`Expiration date`, {guilabel}`Rights`, {guilabel}`Creators`, or {guilabel}`Exclude from navigation`. | ||
| 4. Select the {guilabel}`→` button to apply the changes. | ||
|
|
||
| The dialog saves only the fields you change. | ||
| Fields you leave untouched keep their current values on each item. | ||
|
|
||
| When you select several items whose values differ for a field, that field shows {guilabel}`Mixed values`. | ||
| Leave it untouched to keep each item's own value, or set a value to apply it to every selected item. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Allowed `updateContent` to set the `subjects` (tags) field. @nils-pzr |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Added an optional `transition` argument to `createWorkflow` so any workflow transition can be triggered, not only `publish`. @nils-pzr |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,17 +7,19 @@ import type { RequestResponse } from '../types'; | |
|
|
||
| export const createWorkflowArgsSchema = z.object({ | ||
| path: z.string(), | ||
| transition: z.string().optional(), | ||
| data: createWorkflowDataSchema.optional(), | ||
| }); | ||
|
|
||
| export type CreateWorkflowArgs = z.infer<typeof createWorkflowArgsSchema>; | ||
|
|
||
| export async function createWorkflow( | ||
| this: PloneClient, | ||
| { path, data }: CreateWorkflowArgs, | ||
| { path, transition, data }: CreateWorkflowArgs, | ||
| ): Promise<RequestResponse<CreateWorkflowResponse>> { | ||
| const validatedArgs = createWorkflowArgsSchema.parse({ | ||
| path, | ||
| transition, | ||
| data, | ||
| }); | ||
|
|
||
|
|
@@ -26,7 +28,9 @@ export async function createWorkflow( | |
| config: this.config, | ||
| }; | ||
|
|
||
| const workflowPath = `${validatedArgs.path}/@workflow/publish`; | ||
| const workflowPath = `${validatedArgs.path}/@workflow/${ | ||
| validatedArgs.transition ?? 'publish' | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would not make this optional in the schema and would not have a fallback here. Thoughts @sneridagh ?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @pnicolli certainly not optional, and clearly an overlook from the original implementation. However, now I am confused. It's createXXX because it's POST? We are not creating a workflow, right? meh... we should review some of the names, although now I remember that the policy was to match the No fallback either, it has no sense (again from the original implementation).
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah then let's remove the optional and the fallback and make the transition parameter mandatory, and let's discuss possible renaming later. |
||
| }`; | ||
|
|
||
| return apiRequest('post', workflowPath, options); | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.