Skip to content

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

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

AndyButland
Copy link
Contributor

@AndyButland AndyButland commented Jul 28, 2025

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:

/umbraco/management/api/v1/tree/document/children?parentId={id}

For items that have a scheduled publication saved, you should see this in the response:

    {
      ...
      "signs": [
        {
          "alias": "Umb.ScheduledForPublish"
        }
      ],
      ...
    },

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..

@Copilot Copilot AI review requested due to automatic review settings July 28, 2025 12:56
Copilot

This comment was marked as outdated.

@AndyButland AndyButland requested a review from Copilot July 29, 2025 05:00
Copy link
Contributor

@Copilot 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 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;

AndyButland and others added 3 commits July 29, 2025 07:03
…co/Umbraco-CMS into v16/feature/sign-providers

# Conflicts:
#	src/Umbraco.Cms.Api.Management/Services/Signs/HasScheduleSignProvider.cs
AndyButland and others added 4 commits August 11, 2025 09:27
# 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
NillasKA and others added 5 commits August 11, 2025 15:20
…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).
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.

2 participants