Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Open
wants to merge 29 commits into
base: release/16.0
Choose a base branch
from

Conversation

nielslyngsoe
Copy link
Member

@nielslyngsoe nielslyngsoe commented Apr 27, 2025

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 parents unique and entityType. This context will be available for all Entity Actions: in the sidebar menu, collection items, and workspaces.

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 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';

@nielslyngsoe nielslyngsoe enabled auto-merge (squash) April 27, 2025 19:26
@madsrasmussen madsrasmussen self-assigned this May 6, 2025
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