-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Bulk Publish: Filter variant options to applicable cultures only (closes #19147) #21163
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?
Conversation
#19147) When bulk publishing/unpublishing documents from a collection view, the variant selection modal now shows only the cultures that exist in the selected documents, rather than all system languages. Changes: - Fetch document items to determine which cultures exist in the selection - Skip language modal entirely for all-invariant document selections - Filter language options to only show applicable cultures - Pre-select all applicable cultures by default - Display document count per culture in the modal (e.g., "2 documents") - Add `documentCount` property to `UmbDocumentVariantOptionModel` - Add `general_documentCount` localization key for proper pluralization 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR enhances the bulk publish/unpublish functionality in Umbraco CMS to show only applicable culture options for selected documents. Instead of displaying all system languages, it now filters the variant modal to show only cultures that exist in the selected documents, displays document counts per culture, and skips the language modal entirely for invariant documents.
Key Changes:
- Filters language options to show only cultures present in selected documents
- Adds document count display for each culture option
- Skips language modal for invariant documents, showing a simple confirmation instead
- Pre-selects all applicable cultures by default
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
src/Umbraco.Web.UI.Client/src/packages/documents/documents/types.ts |
Added optional documentCount field to UmbDocumentVariantOptionModel interface |
src/Umbraco.Web.UI.Client/src/packages/documents/documents/publishing/unpublish/entity-bulk-action/unpublish.bulk-action.ts |
Implemented logic to fetch document items, detect invariant documents, count cultures, filter options, and handle invariant cases |
src/Umbraco.Web.UI.Client/src/packages/documents/documents/publishing/publish/entity-bulk-action/publish.bulk-action.ts |
Implemented same logic as unpublish for consistency in bulk publish behavior |
src/Umbraco.Web.UI.Client/src/packages/documents/documents/modals/shared/document-variant-language-picker.element.ts |
Added rendering of document count display when available in variant options |
src/Umbraco.Web.UI.Client/src/assets/lang/en.ts |
Added documentCount localization function with singular/plural handling |
src/Umbraco.Web.UI.Client/src/assets/lang/da.ts |
Added Danish translation for documentCount with proper singular/plural forms |
...ackages/documents/documents/publishing/unpublish/entity-bulk-action/unpublish.bulk-action.ts
Outdated
Show resolved
Hide resolved
...rc/packages/documents/documents/publishing/publish/entity-bulk-action/publish.bulk-action.ts
Show resolved
Hide resolved
...ackages/documents/documents/publishing/unpublish/entity-bulk-action/unpublish.bulk-action.ts
Show resolved
Hide resolved
...rc/packages/documents/documents/publishing/publish/entity-bulk-action/publish.bulk-action.ts
Outdated
Show resolved
Hide resolved
...ackages/documents/documents/publishing/unpublish/entity-bulk-action/unpublish.bulk-action.ts
Outdated
Show resolved
Hide resolved
...ackages/documents/documents/publishing/unpublish/entity-bulk-action/unpublish.bulk-action.ts
Outdated
Show resolved
Hide resolved
...rc/packages/documents/documents/publishing/publish/entity-bulk-action/publish.bulk-action.ts
Outdated
Show resolved
Hide resolved
- Fetch document items and languages in parallel using Promise.all - Defer notification and event context fetching until after user confirmation - Extract helper methods for publishing/unpublishing documents - Remove duplicate UmbLocalizationController instantiation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Add early return when documentItems fails to load - Improve comment clarity for culture counting logic - Remove unnecessary optional chaining after guard clause 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
Move duplicated logic for building bulk variant options to a static method on UmbDocumentPublishEntityBulkAction. The unpublish action now imports and uses this shared method, reducing code duplication. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.
Summary
Fixes #19147
Performance optimizations
Promise.all(reduces initial load time)#publishDocuments/#unpublishDocumentsand#reloadChildrenfor cleaner codeScreenshot (before)
Listed all possible cultures so nothing was missing, did not reflect the actual state of the selected documents accurately:

Screenshot (after)
Shows only the selected cultures (English and German, but not Danish in this instance), pre-selects all of them.
Screenshot (after, only invariants selected)
Before, it would show the same as the "before" screenshot (all cultures), but now it knows that all of them are invariant and goes straight to the confirmation modal:
Hint: If you select both invariant and variant, we will have to show cultures, and in that case, the invariants will be listed under the default language
Test plan
Related: https://dev.azure.com/umbraco/D-Team%20Tracker/_workitems/edit/52313
🤖 Generated with Claude Code