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

Feature: Block Custom Views #2065

Merged
merged 25 commits into from
Jul 5, 2024
Merged

Conversation

nielslyngsoe
Copy link
Member

@nielslyngsoe nielslyngsoe commented Jul 1, 2024

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

  • 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?

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

  • 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.

nielslyngsoe and others added 9 commits July 3, 2024 09:16
# 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
Copy link
Collaborator

@iOvergaard iOvergaard left a 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:

Copy link
Collaborator

@iOvergaard iOvergaard left a 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.

@nielslyngsoe nielslyngsoe merged commit 12764fa into main Jul 5, 2024
7 checks passed
@nielslyngsoe nielslyngsoe deleted the v14/feature/block-custom-views branch July 5, 2024 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants