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

V14: Blueprint CRUD endpoints #15947

Merged
merged 47 commits into from
Apr 2, 2024
Merged

Conversation

elit0451
Copy link
Member

@elit0451 elit0451 commented Mar 26, 2024

Details

  • Added the following Blueprint endpoints:
    • Get blueprint by id - GET /umbraco/management/api/v1/document-blueprint/{id}
    • Delete blueprint by id - DELETE /umbraco/management/api/v1/document-blueprint/{id}
    • Update blueprint by id - PUT /umbraco/management/api/v1/document-blueprint/{id}
    • Create new blueprint - POST /umbraco/management/api/v1/document-blueprint
    • Create blueprint from existing content - POST /umbraco/management/api/v1/document-blueprint/from-document
  • Introduced IContentBlueprintEditingService which will follow refactoring to clean up the shared implementation;
    • Tests will be added later.
  • Introduced new Blueprint models and mappings;
    • Added base classes to reuse models between Documents and Blueprints.

Note

In both Create endpoints, the parent object in the request models is not currently utilized; this will make it easier in case we introduce blueprint containers later on:

  "parent": {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  }

Bonus:

  • Making ContentControllerBase abstract;
  • Fix base inheritance case in SchemaIdSelector;
  • Fixed a bug in document type mapping:
    • Mapping the incorrect key resulted in having the same id for both the blueprint and its document type in GET /umbraco/management/api/v1/tree/document-blueprint/root.
  • Fixed a bugs in GET /umbraco/management/api/v1/item/document-blueprint:
    • Returning more entities than it was supposed to;
    • Mapping the Blueprint name instead of the document type name.

Test

  • Create Document types and Document in v13 + Content templates (blueprints);
  • Migrate to this branch;
  • Make sure the newly introduced CRUD endpoints work as expected;
  • Test that both the Root and Item endpoints (in the Document Blueprint swagger group) return the correct data for blueprints.

@elit0451 elit0451 added the project/bellissima AKA "the new backoffice" label Mar 26, 2024
@elit0451 elit0451 marked this pull request as ready for review March 27, 2024 09:53
Copy link
Contributor

@Migaroez Migaroez left a comment

Choose a reason for hiding this comment

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

Small remarks, i will test in the meantime

Copy link
Contributor

@Migaroez Migaroez left a comment

Choose a reason for hiding this comment

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

Looks good and behaves as expected 💪

@elit0451 elit0451 merged commit 37734ef into v14/dev Apr 2, 2024
15 of 16 checks passed
@elit0451 elit0451 deleted the v14/feature/blueprint-crud-endpoints branch April 2, 2024 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
project/bellissima AKA "the new backoffice" release/14.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants