-
Notifications
You must be signed in to change notification settings - Fork 60
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
Feature: Block Custom Views #2065
Conversation
# Conflicts: # src/packages/block/block-grid/components/block-grid-areas-container/block-grid-areas-container.element.ts # src/packages/block/block-grid/components/block-grid-block/block-grid-block.element.ts # src/packages/block/block-grid/context/block-grid-entry.context.ts # src/packages/block/block-grid/property-editors/block-grid-areas-config/property-editor-ui-block-grid-areas-config.element.ts # src/packages/block/block-type/components/input-block-type/input-block-type.element.ts
# Conflicts: # src/packages/block/block-grid/components/block-grid-entries/block-grid-entries.element.ts
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.
I can get a custom view to show. I get all of the content of the block served to my custom element. So the feature looks good.
What I severely missed was a way to display an image in my custom view; I mean, I get the key and everything, but converting that from a GUID into a usable URL was harder than I imagined. I guess we could do some good with a few helper functions in this area. Anyway, that doesn't affect the feature as such.
I left a few comments of things I stumbled upon:
src/packages/block/block-grid/components/block-grid-entry/block-grid-entry.element.ts
Outdated
Show resolved
Hide resolved
src/packages/block/block-grid/components/block-grid-entry/block-grid-entry.element.ts
Show resolved
Hide resolved
# Conflicts: # src/packages/block/block-type/workspace/block-type-workspace.context.ts
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.
LGTM. We can always move the test custom view into the mock handlers in another branch.
Finishes the implementation of custom views for Block Editors.
Only slightly breaking as if someone already did implement a Custom View, then things would have changed a little bit(we do not parse on a prop called
urls
. But the feature was never complete neither exactly working so I do not see it as breaking.Notice, this also makes Extension Initializers call their callback method with an empty array if there is no Extensions that fits the filtering. Giving developers a response to react to, giving knowledge on when to fallback to other approaches than extensions. (This maybe be an even more important breaking change, but not really breaking for any of our implementations as it is perfectly fine to expect retrieving an empty array when nothing was permitted).
This as well has been used in the extension-slot, which now
Fixes umbraco/Umbraco-CMS#16134
Fixes umbraco/Umbraco-CMS#16736
Types of changes
Motivation and context
How to test?
Search for and remove out-commenting of this to have some custom component to test with:
// TODO: Remove test custom view, or transfer to test or similar?
Do correct the manifest of the element to fit your test case.
Screenshots (if appropriate)
Checklist