Skip to content
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

Improvement: Use constant for language workspace alias #2157

Merged

Conversation

bjarnef
Copy link
Contributor

@bjarnef bjarnef commented Jul 31, 2024

Description

This add a constant for language workspace alias similar to other ManifestWorkspaces.
However it doesn't really seems consistent. Some are included in manifests.ts as here:
https://github.com/umbraco/Umbraco.CMS.Backoffice/blob/4e840b9de043f8ddb03352897c5ef2a575ca8776/src/packages/documents/document-blueprints/workspace/manifests.ts#L14C14-L14C52

while other are just in a constant.ts as here:
https://github.com/umbraco/Umbraco.CMS.Backoffice/blob/4e840b9de043f8ddb03352897c5ef2a575ca8776/src/packages/user/user/workspace/constants.ts

or index.ts:

export const UMB_BLOCK_WORKSPACE_ALIAS = 'Umb.Workspace.Block';

It would be great if it could be more consistency and easier to work with codebase.

Some places I noticed we have workspace under workspace/entity and entity/workspace.

I also noticed the fallback language picker seems broken at language and under user section.
It set the value, but somehow items always seems to be an empty array.

image

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (minor updates related to the tooling or maintenance of the repository, does not impact compiled assets)

Motivation and context

How to test?

Screenshots (if appropriate)

Checklist

  • If my change requires a change to the documentation, I have updated the documentation in this pull request.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

@madsrasmussen madsrasmussen self-assigned this Aug 5, 2024
Copy link

sonarcloud bot commented Aug 5, 2024

Copy link
Contributor

@madsrasmussen madsrasmussen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @bjarnef

Thanks for the PR.

Yes, you are correct that we have inconsistencies between where we put the constants. We are currently moving all constants inside manifests and files with implementations (mostly contexts) to a constants file. This makes it possible to import the constant without loading the entire implementation.

I have updated your PR with this change.

Thanks 🥳

@madsrasmussen madsrasmussen added ignore-for-release Pull requests that will not be included in the automated release notes. release/14.2.0 and removed ignore-for-release Pull requests that will not be included in the automated release notes. labels Aug 5, 2024
@madsrasmussen madsrasmussen merged commit c7652f3 into umbraco:main Aug 5, 2024
8 checks passed
@bjarnef bjarnef deleted the feature/language-workspace-alias branch August 5, 2024 11:33
@madsrasmussen madsrasmussen changed the title Use constant for language workspace alias Improvement: Use constant for language workspace alias Aug 6, 2024
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