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

Bugfix: Add correct Block Type label to Block Workspace editor #2017

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

Conversation

rickbutterfield
Copy link
Contributor

Description

Correctly loads the Block Type from the Block Manager, gets the label property and saves it within the Block Workspace context for loading in the create/edit modal.

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

Fixes umbraco/Umbraco-CMS#16463

How to test?

Try creating or editing any block within a Block List or Block Grid, and make sure the modal shows the correct Block Type name

Screenshots (if appropriate)

Before:
Before screenshot

After:
On create
image

On edit
image

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.

@rickbutterfield rickbutterfield marked this pull request as ready for review June 19, 2024 15:11
@rickbutterfield rickbutterfield changed the title Add correct Block Type label to Block Workspace Editor Bugfix: Add correct Block Type label to Block Workspace editor Jun 19, 2024
@@ -218,6 +229,11 @@ export class UmbBlockWorkspaceContext<LayoutDataType extends UmbBlockLayoutBaseM
throw new Error('Block Entries could not create block');
}

const blockType = this.#blockManager!.getBlockTypeOf(contentElementTypeId);
if (blockType?.label) {
this.setName(blockType.label);
Copy link
Member

Choose a reason for hiding this comment

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

We are still missing the Label interpretation feature, meaning using the Label (template) would not necessary be very pretty.

How was it in v.13, did we show the interpolated label in the header of the modal? :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, you're right! The modal label shows the interpolated version of it. 🤦‍♂️ Shall I draft this until that gets resolved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Block list editor heading feels a little intimidating?
2 participants