Commit Graph

16 Commits

Author SHA1 Message Date
Elitsa Marinovska
b61b71ee9d Returning the correct totalItems amount (#16799) 2024-07-25 10:01:53 +02:00
Bjarke Berg
3cc14888a9 Moved logic from FolderTreeControllerBase service layer (#15976)
* Moved logic from FolderTreeControllerBase into EntityService and EntityRepository

* Custom sorting for data types, not media types

* Ensure ordering is the same for SQLite and SQLServer

---------

Co-authored-by: kjac <kja@umbraco.dk>
2024-04-04 11:27:13 +02:00
Kenn Jacobsen
f6f868e463 Add ancestor endpoints and remove explicit parent context (#15746)
* Remove explicit parent context in API outputs

* Add ancestor endpoints for document and data type (experimental for now)

* Add ancestor endpoints for doctypes, media, mediatypes, partial views, scripts, static files, stylesheets and templates

* Add unit tests for ancestor ID parsing

* Add ancestor endpoint for dictionary items

* Update OpenApi.json

* Fix merge and regenerate OpenApi.json

* Regenerate OpenApi.json

* Rename "folder" to "parent" for consistency

* Fix merge

* Fix merge

* Include "self" in ancestor endpoints

* Handle ancestors for root items correctly

* Remove "type" from recycle bin items

* Tests against fixed values instead of calculated ones.

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
2024-03-25 12:15:50 +01:00
Kenn Jacobsen
469a54cbbe Workaround for failing entity tree children (#15887)
* Workaround for failing entity tree children

* Fix typo from original PR

* Expose and actually use GetPagedTrashedChildren on EntityService (the default implementation on the interface is currently used).

* Ensure that ID/Key mapping for recycle bins work
2024-03-15 11:21:36 +01:00
Kenn Jacobsen
7964f33d0d Removed "type" from tree item response models (#15862) 2024-03-15 10:37:32 +01:00
Mole
ae675b28f7 V14: Remove duplicate pagination helper (#15856)
* Remove management PaginationService

* Remove usage of PaginationHelper in FilterMemberFilterController
2024-03-12 12:57:29 +01:00
Elitsa Marinovska
04400054ac V14: Cleanup [ApiController] attribute usage (#15842)
* Applying [ApiController] to ManagementApiControllerBase and the rest derive it from it

* Removing [ApiController] from deriving controllers

* Removing [ApiVersion("1.0")] from controller base

* Cleanup

* [ApiController] from deriving DeliveryApiControllerBase controller
2024-03-05 15:49:40 +01:00
Kenn Jacobsen
9b454bec6b Model mapping PoC (#15546)
* First take at new models for improved mapping between client and server

* Add variants to Media

* Re-introduced lost names

* Start breaking apart "Id" reference properties in request models as well

* Refactor to fix OpenAPI spec

* Discard TODO (not relevant)

* Split recycle bin response models

* Delete unused marker interface

* Use reference properties for content and media type handling

* Rework document and media types to be explicit in relations (do not expose "content type", it is an implementation detail)

* Mapping for document and media type copy + move

* Ensure correct response model for Media

* Regenerate OpenAPI JSON after forward merge

* Fix forward merge issues

* Fix forward merge + regenerate OpenApi.json

* Added unit tests for content state helper

* Move "allowed document types" endpoint to document type silo, refactored services and added "allowed media types"

* Regenerate OpenApi.json after forward merge

* Do not include content state for media items

* Review fix
2024-01-30 12:19:05 +01:00
Kenn Jacobsen
e4f9f98f2d File system endpoints redo (#15521)
* First stab at a massive remake of file system based endpoints

* Do not prefix system paths with directory separator char

* Ensure correct and consistent response types

* Fix partial view snippets endpoints

* Clean up IO (path) operations

* Update OpenAPI JSON to match new endpoints

* Return 201 when renaming file system resources

* Add "IsFolder" to file system item endpoints

* Replace "parentPath" with a "parent" object for file system creation endpoints

* Update OpenAPI JSON

* Rewrite snippets

* Regenerate OpenAPI JSON after forward merge

* Remove stylesheet overview endpoint

* Regenerate OpenAPI JSON after forward merge

* add server-file-system module to importmap

* Expose generated resource identifier in 201 responses

---------

Co-authored-by: Mads Rasmussen <madsr@hey.com>
2024-01-22 08:20:45 +01:00
Sven Geusens
c937d0f2ed V14/feature/management tree count by take zero (#15308)
* Allow Tree endpoints that query entities to return count without entity data

* Apply count by take 0 in FileSystem Endpoints

* Apply count by take 0 in Dictionary Endpoints

* Apply count by take 0 in RootRelationType Endpoints

* Revert PaginationService takeZero flag as it only guards against things that already blow up

* Mark PagedResult as Obsolete as we want to step away from classic pagination system to skip/take

* Pushed management api RelationType pagination and async preperation down to the service layer

* Scope fix and allocation optimizations

* Pushed management api dictionary pagination and down to the service layer

Also did some nice allocation optimizations

* PR feedback + related strange count behaviour

* Moved count by pagesize logic from EntryController to service

* A tiny bit of formatting and comments

* Fix bad count filter logic

* Added integration tests for creating datatypes in a folder

* Added tests for count testing on TreeControllers

- ChildrenDataType
- RootDataType
- ChildrenDictionary
- RootDictionary
- ChildrenDocument
- RootDocument
- RootBluePrint
- RootDocumentType
- ChildrenDocumentType

* Revert "Added tests for count testing on TreeControllers", should be on services

This reverts commit ee2501fe620a584bba13ecd4fdce8142133fd82b.
This reverts commit 808d5b276fad267a645e474ead3278d4bb79d0c4.

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
Co-authored-by: kjac <kja@umbraco.dk>
Co-authored-by: Andreas Zerbst <andr317c@live.dk>
2024-01-02 13:53:24 +01:00
Nikolaj Geisle
ed83b65de3 V14: Refactor icons for tree items (#14477)
* Remove icons from base models

* Update OpenApi spec

* Updated schema

* Cleanup

* Fix Response Type

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
Co-authored-by: Elitsa <elm@umbraco.dk>
2023-07-05 15:09:39 +03:00
Bjarke Berg
6313b8b3a1 Changed "Key" to "Id" in management API (#14045) 2023-04-04 13:20:29 +02:00
Bjarke Berg
b981f53254 Fix key names to id and allow sending id on create for datatypes (#14035)
* Changed some keys to ids and fixed so users can provide Ids when creating

* updated OpenApi.json

* Fixed issue with datatypes when wrong propertyEditorAlias was used and allow creating with key

* Updated OpenApi.json

* Handle duplicate names correct

* Fix for parent not found

* Handle if parent is not a container

* Update CompatibilitySuppressions

---------

Co-authored-by: Nikolaj <nikolajlauridsen@protonmail.ch>
2023-03-31 13:59:44 +02:00
Nikolaj Geisle
5107375cd8 V13/feature/rename viewmodels to request response (#13952)
* Rename DocumentType/ContentType models

* Rename all viewmodels

* Rename factories

* Update OpenApi.json

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-03-13 10:49:21 +01:00
Kenn Jacobsen
801966f1ae Created a common library for the APIs (#13530)
* Created a common library for the APIs and moved stuff that is required for the new content API. Also moved the versioned backoffice API route handling to the management API where it belongs.

* Remove test auth attribute from Media
2022-12-09 08:52:17 +01:00
Kenn Jacobsen
bc94b2e16c Rename management API from Umbraco.Cms.ManagementApi to Umbraco.Cms.Api.Management (#13512) 2022-12-02 11:33:02 +01:00