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

Block Grid - Block label value does not change #14649

Closed
miljepetrovic opened this issue Aug 8, 2023 · 6 comments · Fixed by #14700
Closed

Block Grid - Block label value does not change #14649

miljepetrovic opened this issue Aug 8, 2023 · 6 comments · Fixed by #14700

Comments

@miljepetrovic
Copy link

miljepetrovic commented Aug 8, 2023

Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)

v10.6.1

Bug summary

I have a Block Grid Data Type where I added the Block and specify Content Model. When I try to change the configuration of that Block and update the Label value it does not change. It always displays the name of the Content Model.

https://prnt.sc/m5unMqkWoUuG
https://prnt.sc/eV7ztuKDjkYp

I did not specify any custom template or custom style.

I use this default gridblock.editor.html.

https://github.com/umbraco/Umbraco-CMS/blob/v10/dev/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/blockgridentryeditors/gridblock/gridblock.editor.html

Specifics

No response

Steps to reproduce

Create Block Grid Data Type
Add Block and specify block label
Try to add new block in the block grid data type and Content Model Name will be displayed

Expected result / actual result

No response


This item has been added to our backlog AB#31901

@github-actions
Copy link

github-actions bot commented Aug 8, 2023

Hi there @miljepetrovic!

Firstly, a big thank you for raising this issue. Every piece of feedback we receive helps us to make Umbraco better.

We really appreciate your patience while we wait for our team to have a look at this but we wanted to let you know that we see this and share with you the plan for what comes next.

  • We'll assess whether this issue relates to something that has already been fixed in a later version of the release that it has been raised for.
  • If it's a bug, is it related to a release that we are actively supporting or is it related to a release that's in the end-of-life or security-only phase?
  • We'll replicate the issue to ensure that the problem is as described.
  • We'll decide whether the behavior is an issue or if the behavior is intended.

We wish we could work with everyone directly and assess your issue immediately but we're in the fortunate position of having lots of contributions to work with and only a few humans who are able to do it. We are making progress though and in the meantime, we will keep you in the loop and let you know when we have any questions.

Thanks, from your friendly Umbraco GitHub bot 🤖 🙂

@kjac
Copy link
Contributor

kjac commented Aug 10, 2023

Hi @miljepetrovic,

Thanks a lot for reporting this ❤️

I can reproduce this on V11 for both the Block List and the Block Grid. Seems it's a general issue for labels.

My findings so far:

  1. "Pure" Angular templates work as expected - i.e. {{title}}
  2. "Mixed" templates work as expected - i.e. This is the title: {{title}}
  3. "Simple" labels do not work at all; they block title reverts to the element type name (as reported in this issue).

The only workaround for "simple" labels is to use an Angular expression to print out the label - i.e. {{'This is the title'}}. That's rather quirky to say the least 😄

The docs do not mention "simple" labels, but they do indicate that "simple" labels should be possible. At least that's how I read them 🤔

We'll see if we can create a fix in an upcoming sprint.

@miljepetrovic
Copy link
Author

miljepetrovic commented Aug 10, 2023

You are welcome @kjac. I am more than happy to be able to help you.

I think that it would be helpful as well to be able to display value from the Settings Model by using the "Pure" template. You might consider that as well.

Kind regards,
Milan

@bjarnef
Copy link
Contributor

bjarnef commented Aug 14, 2023

@kjac I wonder if this PR https://github.com/umbraco/Umbraco-CMS/pull/14143/files affected this as I think simple label also used to work in Block List / Block Grid.

It seems the PR removed this part blockObject.config.label.

It mention:

Replace blockObject.config.label with blockObject.labelInterpolator(blockObject.data), because of blockObject.config.label always has the property alias eg: {{propertyAlias}}

Later this was changed:

blockObject.label = (blockObject.labelInterpolator(blockObject.data) || blockObject.content?.contentTypeName) ?? "";

to this:

blockObject.label = blockObject.content?.contentTypeName || "";

@nielslyngsoe
Copy link
Member

Hi @bjarnef Good catch, I've made a solution that should make everyone happy again.

So no flashing of AngularJS Template code but still rendering the 'simple' labels.

#14700

@kjac kjac removed the state/sprint-candidate We're trying to get this in a sprint at HQ in the next few weeks label Aug 22, 2023
@kjac
Copy link
Contributor

kjac commented Aug 22, 2023

Fixed in #14700

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

Successfully merging a pull request may close this issue.

4 participants