-
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
Relations/types mangement api cleanup #15910
Conversation
Since types are only managed trough code.
Brought RelationType responsemodels more in line with similar models Update openapi spec
src/Umbraco.Cms.Api.Management/Controllers/RelationType/AllRelationTypeTreeController.cs
Outdated
Show resolved
Hide resolved
@@ -14,7 +14,6 @@ internal static IUmbracoBuilder AddRelationTypes(this IUmbracoBuilder builder) | |||
.Add<RelationTypeViewModelsMapDefinition>(); | |||
|
|||
builder.Services.AddTransient<IObjectTypePresentationFactory, ObjectTypePresentationFactory>(); | |||
builder.Services.AddTransient<IRelationTypePresentationFactory, RelationTypePresentationFactory>(); |
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 think removing this will clash with #15933
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.
will check
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.
Yup, will do a forward merge when #15933 has been merged in dev and fix it
src/Umbraco.Cms.Api.Management/ViewModels/Relation/RelationReferenceModel.cs
Outdated
Show resolved
Hide resolved
src/Umbraco.Cms.Api.Management/ViewModels/Relation/RelationResponseModel.cs
Outdated
Show resolved
Hide resolved
# Conflicts: # src/Umbraco.Cms.Api.Management/Factories/IRelationTypePresentationFactory.cs # src/Umbraco.Cms.Api.Management/Factories/RelationTypePresentationFactory.cs # src/Umbraco.Cms.Api.Management/OpenApi.json Updated openapi spec Merge fixed RelationTypesBuilderExtensions
Changes
Relation types are only useful if they are used to create relations with. Creating relations of new types requires new code to actually do it. Deleting a type that is actively used by code might cause issues => Do CUD operations trough migrations
Relation types are not nestable, no need to show a path
Relation types are not nestable, so no need for tree support (more like languages)
=> added get all endpoint with paging
This was only used to determine what the original parent was trough a specific relation type, it has since been internalized into /umbraco/management/api/v1/recycle-bin/document/{id}/original-parent
Is now more inline with other models that have references to other things. Also added the type of relation returned
Testing
Make sure the remaining endpoints still work.