-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Introduced sign providers for trees and implemented one for documents with schedule pending #19806
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
…ering a page of tree item view models. Re-work tree controller constructors to provide registered providers as a collection.
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 introduces a sign provider infrastructure for server-side provision of backoffice "signs" (icon overlays) on tree nodes to indicate various states. The implementation targets document trees initially and includes a concrete provider for indicating scheduled publish status.
Key changes:
- Introduces
ISignProvider
abstraction with collection-based registration for extensibility - Implements
HasScheduleSignProvider
to show scheduled publication status - Updates all tree controllers to integrate with the new sign provider system
Reviewed Changes
Copilot reviewed 63 out of 63 changed files in this pull request and generated 4 comments.
Show a summary per file
File | Description |
---|---|
SignModel.cs | Defines the response model for sign data with provider and alias properties |
ISignProvider.cs | Core abstraction defining tree sign provision operations |
HasScheduleSignProvider.cs | Concrete provider implementation for scheduled publication signs |
SignProviderCollection.cs/.Builder.cs | Collection infrastructure for registering and managing sign providers |
EntityTreeItemResponseModel.cs | Base tree model updated with sign collection and manipulation methods |
EntityTreeControllerBase.cs | Updated to integrate sign population in all tree endpoints |
Various tree controllers | Updated constructors to accept SignProviderCollection dependency |
IContentService.cs/ContentService.cs | New method to retrieve scheduled content keys |
DocumentRepository.cs | Database query implementation for scheduled content retrieval |
Comments suppressed due to low confidence (1)
src/Umbraco.Cms.Api.Management/Controllers/DataType/Tree/RootDataTypeTreeController.cs:6
- This removed import appears to be unrelated to the sign provider changes and may indicate accidental cleanup that could affect other functionality if this namespace was needed elsewhere in the file.
using Umbraco.Cms.Api.Management.ViewModels.Tree;
src/Umbraco.Infrastructure/Persistence/Repositories/Implement/DocumentRepository.cs
Outdated
Show resolved
Hide resolved
src/Umbraco.Cms.Api.Management/Services/Signs/HasScheduleSignProvider.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <[email protected]>
…co/Umbraco-CMS into v16/feature/sign-providers # Conflicts: # src/Umbraco.Cms.Api.Management/Services/Signs/HasScheduleSignProvider.cs
# Conflicts: # src/Umbraco.Cms.Api.Management/Controllers/DataType/Tree/SiblingsDataTypeTreeController.cs # src/Umbraco.Cms.Api.Management/Controllers/Document/Tree/SiblingsDocumentTreeController.cs # src/Umbraco.Cms.Api.Management/Controllers/DocumentBlueprint/Tree/SiblingsDocumentBlueprintTreeController.cs # src/Umbraco.Cms.Api.Management/Controllers/DocumentType/Tree/SiblingsDocumentTypeTreeController.cs # src/Umbraco.Cms.Api.Management/Controllers/Media/Tree/SiblingsMediaTreeController.cs # src/Umbraco.Cms.Api.Management/Controllers/MediaType/Tree/SiblingsMediaTypeTreeController.cs # src/Umbraco.Cms.Api.Management/Controllers/Template/Tree/SiblingsTemplateTreeController.cs # src/Umbraco.Cms.Api.Management/Controllers/Tree/EntityTreeControllerBase.cs # src/Umbraco.Cms.Api.Management/Controllers/Tree/UserStartNodeTreeControllerBase.cs
…viderTests.cs to no longer assert the provider
...aco.Tests.UnitTests/Umbraco.Cms.Api.Management/Services/Signs/IsProtectedSignProviderTest.cs
Outdated
Show resolved
Hide resolved
src/Umbraco.Cms.Api.Management/Services/Signs/IsProtectedSignProvider.cs
Outdated
Show resolved
Hide resolved
…d collections. Fixed updates to base content controllers (no need to introduce a new type variable). Removed passing entities for populating tree signs (we aren't using it, so simplifies things).
…me constructor obsoletion
Description
This PR proposes an implementation for server-side provision of backoffice "signs" (where we want to be able to show small icon overlays on nodes and entries indicating various states).
Internal reference: AB48452
This should include trees and collections - this PR targets only trees so we can agree the approach, and then a further one can be added for collections.
We need to ensure this is extensible for packages.
I've taken the approach of registering a collection of
ISignProviders
. When rendering trees, after retrieving a paged collection of tree item view models, this whole collection is provided to the registered providers which can add or remove signs.These seems the most efficient approach, meaning an implementation of a sign provider has the option to retrieve all the data needed in one query, avoiding an N+1 concern if each were updated individually. Offering this server-side also avoids additional requests from the client.
In addition to the abstraction I've implemented a single provider that can be used to indicate which items in the tree have a pending publish scheduled.
Testing
Via a management API, make requests to retrieve document tree items, e.g. via:
For items that have a scheduled publication saved, you should see this in the response:
If there are no signs an empty array will be returned.
Note that rather than a string, I've followed conventions in the management API to always return an object. All core aliases will be prefixed with
Umb.
.