Skip to content

Conversation

@iOvergaard
Copy link
Contributor

@iOvergaard iOvergaard commented Dec 16, 2025

Summary

  • When bulk publishing/unpublishing documents, the variant modal now shows only cultures that exist in the selected documents (not all system languages)
  • Invariant document selections skip the language modal entirely and show a simple confirmation dialog
  • Each culture option displays how many documents have that culture (e.g., "2 documents")
  • All applicable cultures are pre-selected by default

Fixes #19147

Performance optimizations

  • Fetch document items and languages in parallel using Promise.all (reduces initial load time)
  • Defer notification and event context fetching until after user confirmation (no context overhead if user cancels)
  • Extracted helper methods #publishDocuments/#unpublishDocuments and #reloadChildren for cleaner code
  • Extracted the logic to build up the variants into a static method (mirroring the document-variant-language-picker element) to reduce duplication

Screenshot (before)

Listed all possible cultures so nothing was missing, did not reflect the actual state of the selected documents accurately:
image

Screenshot (after)

Shows only the selected cultures (English and German, but not Danish in this instance), pre-selects all of them.

image

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:

image

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

  • Select multiple invariant documents in a collection view → Publish → Should show simple confirmation (no language picker)
  • Select multiple variant documents → Publish → Should show only applicable cultures with document counts
  • Verify document counts are accurate per culture
  • Test unpublish follows the same behavior
  • Test mixed selection (some docs have en-US, some have de-DE) shows union of cultures

Related: https://dev.azure.com/umbraco/D-Team%20Tracker/_workitems/edit/52313

🤖 Generated with Claude Code

 #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]>
Copilot AI review requested due to automatic review settings December 16, 2025 11:03
Copy link
Contributor

Copilot AI left a 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

iOvergaard and others added 3 commits December 16, 2025 12:19
- 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]>
Copy link
Contributor

Copilot AI left a 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.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Investigate Bulk Publish/Unpublish dialog shows all variants for invariant document

2 participants