-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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: Data mapping extension + aligning reference lists #18318
base: v15/dev
Are you sure you want to change the base?
Conversation
…/feature/$type-data-mapper-extension
# Conflicts: # src/Umbraco.Web.UI.Client/src/packages/documents/documents/item/document-item-ref.element.ts
export interface ManifestDataMapping<MetaType extends MetaDataMapping = MetaDataMapping> | ||
extends ManifestApi<UmbDataMapping> { | ||
type: 'dataMapping'; | ||
dataSourceIdentifier: string; |
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.
Shouldn't the dataSourceIdentifier
and dataModelIdentifier
be defined in the meta
to be consistent with other manifest types? :-)
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 have been back and forth with these. We only use them for filtering so I saw them in the same category as the forEntitypes
field. Maybe they should have been named forDataSource
and forDataModel
? 🤔
I have no problem moving them if they fit better in meta?
...raco.Web.UI.Client/src/packages/core/repository/data-mapper/mapping/data-mapping-resolver.ts
Show resolved
Hide resolved
src/Umbraco.Web.UI.Client/src/packages/media/media/item/media-item-ref.element.ts
Outdated
Show resolved
Hide resolved
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.
@madsrasmussen I just have one thing that I like you to consider and then I'm happy, I have read all the code and tested the various cases.
Build on top of #18311 - Review this first
This PR implements a fully dynamic approach to listing references in a document/media workspace supporting the polymorphic response from the server.
Until now, the reference lists have had a hardcoded solution with support for document, media, and member entities. With this PR, we use the entityRefItem extension to render a reference based on the entity type in the data.
The reference endpoint returns a "mixed" response, which can consist of multiple entity types. The endpoint doesn't specify the entity type of an entry but only the type of the response model. To prevent a hardcoded solution, the PR introduces a
dataMapping
extension that can map any data based on an identifier in the data.Manifest:
Example: