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

Relations/types mangement api cleanup #15910

Merged
merged 13 commits into from Mar 27, 2024
Merged

Conversation

Migaroez
Copy link
Contributor

@Migaroez Migaroez commented Mar 19, 2024

Changes

  • Made Relation types read only trough the management api (endpoints/models/factories/registrations)
    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
  • Removed path from RelationTypeResponseModel
    Relation types are not nestable, no need to show a path
  • Removed RelationTypes tree controllers
    Relation types are not nestable, so no need for tree support (more like languages)
    => added get all endpoint with paging
  • Deleted ByChildRelationController.
    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
  • Reworked RelationResponseModel
    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.

@Migaroez Migaroez closed this Mar 19, 2024
@Migaroez Migaroez reopened this Mar 19, 2024
@Migaroez Migaroez marked this pull request as ready for review March 19, 2024 14:17
Sven Geusens added 3 commits March 22, 2024 11:09
Brought RelationType responsemodels more in line with similar models
Update openapi spec
@@ -14,7 +14,6 @@ internal static IUmbracoBuilder AddRelationTypes(this IUmbracoBuilder builder)
.Add<RelationTypeViewModelsMapDefinition>();

builder.Services.AddTransient<IObjectTypePresentationFactory, ObjectTypePresentationFactory>();
builder.Services.AddTransient<IRelationTypePresentationFactory, RelationTypePresentationFactory>();
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will check

Copy link
Contributor Author

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

Sven Geusens and others added 3 commits March 26, 2024 11:32
# 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
@Migaroez Migaroez merged commit 1fdc0e2 into v14/dev Mar 27, 2024
16 checks passed
@Migaroez Migaroez deleted the v14/fix/relations-cleanup branch March 27, 2024 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants