-
Notifications
You must be signed in to change notification settings - Fork 2.8k
hotfix: Correct context tokens for menu structure based workspaces #19172
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: release/16.0
Are you sure you want to change the base?
hotfix: Correct context tokens for menu structure based workspaces #19172
Conversation
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 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
Outdated
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
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 parentsunique
andentityType
. This context will be available for all Entity Actions: in the sidebar menu, collection items, and workspaces.