Add variancy information to reference response model#18645
Merged
nikolajlauridsen merged 4 commits intov15/devfrom Mar 24, 2025
Merged
Add variancy information to reference response model#18645nikolajlauridsen merged 4 commits intov15/devfrom
nikolajlauridsen merged 4 commits intov15/devfrom
Conversation
nikolajlauridsen
requested changes
Mar 19, 2025
Contributor
nikolajlauridsen
left a comment
There was a problem hiding this comment.
Minor nitpicks, otherwise looks good 👍
src/Umbraco.Cms.Api.Management/Factories/RelationTypePresentationFactory.cs
Outdated
Show resolved
Hide resolved
src/Umbraco.Cms.Api.Management/Factories/RelationTypePresentationFactory.cs
Outdated
Show resolved
Hide resolved
This was referenced Sep 28, 2025
This was referenced Oct 23, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Task description
The *ReferenceResponseModel does not follow the same structure as an Item-model, especially around the name/state, where we for documents have all the variant names available on items.
In the front end, we would like to show the name/state of the current active variant which we currently do based on the variants array.
Approach
Since this mostly an output/client requirement, I decided to use existing domain logic that can fetch the additional data from a cached repository and combine it in the PresentationFactory.
A better solution will be able to be build once we make media and members variant so this information is relevant to all tracked references/relation types in the system and thus the repository queries can be updated to include this extra information
Testing
Create some documents and media with pickers and pick the different items on each other.
Query the endpoint. If an item is picked by a document, then that documents status and culture should be returned in the output