hotfix: Correct context tokens for menu structure based workspaces#19172
Merged
nielslyngsoe merged 31 commits intorelease/16.0from May 9, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR hotfix aims to correct context token usage for menu structure workspaces, providing more specific types and maintaining backward compatibility.
- Updated base class names and context tokens across document, document type, dictionary, and data type menu structures.
- Refined context consumption and provision to align with the new token implementations while supporting deprecated aliases.
- Adjusted type re-exports and context token definitions to improve type-safety in the workspace and menu directories.
Reviewed Changes
Copilot reviewed 28 out of 28 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/Umbraco.Web.UI.Client/src/packages/documents/documents/menu/document-menu-structure.context.ts | Renamed base class to use the newer UmbVariantMenuStructureWorkspaceContextBase. |
| src/Umbraco.Web.UI.Client/src/packages/documents/document-types/menu/document-type-menu-structure.context.ts | Updated base class reference to the renamed UmbMenuStructureWorkspaceContextBase. |
| src/Umbraco.Web.UI.Client/src/packages/dictionary/menu-item/dictionary-menu-structure.context.ts | Updated context base class import to reflect the new naming. |
| src/Umbraco.Web.UI.Client/src/packages/data-type/menu/data-type-menu-structure.context.ts | Changed the inherited base to the new UmbMenuStructureWorkspaceContextBase. |
| src/Umbraco.Web.UI.Client/src/packages/core/workspace/entity-detail/entity-detail-workspace-base.ts | Integrated the UmbTreeEntityWorkspaceContext interface for context safety. |
| Tokens & Contexts Files | Adjusted definitions and re-exports for context tokens and interfaces across workspaces and menus. |
| Workspace & Menu Breadcrumb Components | Updated context consumption to utilize the new token variables instead of string-based keys. |
Comments suppressed due to low confidence (3)
src/Umbraco.Web.UI.Client/src/packages/core/menu/variant-menu-structure-workspace-context-base.ts:33
- [nitpick] The provided context alias 'UmbMenuStructureWorkspaceContext' may be confusing given the class has been renamed to UmbVariantMenuStructureWorkspaceContextBase. Consider documenting the deprecation of the old alias or updating it for clarity.
this.provideContext('UmbMenuStructureWorkspaceContext', this);
src/Umbraco.Web.UI.Client/src/packages/core/menu/menu-tree-structure-workspace-context-base.ts:27
- [nitpick] The use of the obsolete context alias 'UmbMenuStructureWorkspaceContext' might lead to confusion. It is recommended to include a comment explaining its deprecated status or update the alias if possible.
this.provideContext('UmbMenuStructureWorkspaceContext', this);
src/Umbraco.Web.UI.Client/src/packages/core/workspace/contexts/tokens/index.ts:9
- [nitpick] The syntax 'export type * from' is unconventional and may be confusing without explicit documentation. Ensure this syntax is supported by your build pipeline or consider using a more common pattern for type re-exports.
export type * from '../../workspace-context.interface.js';
…menu-structure-based-workspaces
...mbraco.Web.UI.Client/src/packages/core/menu/variant-menu-structure-workspace-context-base.ts
Show resolved
Hide resolved
…menu-structure-based-workspaces
…d-workspaces' into v16/hotfix/setup-context-tokens-for-menu-structure-based-workspaces--refactor
…n-in-workspace' into v16/hotfix/setup-context-tokens-for-menu-structure-based-workspaces
…menu-structure-based-workspaces
…menu-structure-based-workspaces
…menu-structure-based-workspaces
madsrasmussen
approved these changes
May 9, 2025
leekelleher
reviewed
Jun 3, 2025
...c/packages/core/workspace/contexts/tokens/submittable-tree-entity-workspace.context-token.ts
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes: #19213
This PR aligns the method for retrieving the parent of an entity. Currently, the parent known by the workspace is not set during both the creation and editing processes.
With this PR, a new context will be available to consume the parent context,
UMB_PARENT_ENTITY_CONTEXT. It will provide the parentsuniqueandentityType. This context will be available for all Entity Actions: in the sidebar menu, collection items, and workspaces.