Commit Graph

15 Commits

Author SHA1 Message Date
Anders Reus
105cb9da41 Added trashed state so when requesting content from the recycle bin via the management api it will return trashed instead of published state (#20542)
Added trashed state so when requesting content from the recycle bin via the management api, the state will be trashed instead of published.
2025-10-17 14:40:18 +02:00
Nicklas Kramer
f6d0667e91 V16 - Renaming signs to flags (#20109)
* Renaming the providers, collection builder and model

* Renaming the items using signs

* Renaming in controllers

* Renaming mapping flags

* Renaming sign tests to flags

* Changing the test files names from signs to flags

* Updated a couple more references.

---------

Co-authored-by: Andy Butland <abutland73@gmail.com>
2025-09-16 11:40:48 +00:00
Nicklas Kramer
d51561b202 V16 - Introducing signs to variants (#20053)
* Adding signs to variants and adjusting HasPendingChangesSignProvider.cs

* HasPendingChangesSignProvider.cs now populates variants & refactoring to move logic to DocumentPresentationFactory.cs

* Working HasScheduleSignProvider.cs to provide variant signs

* Refactoring ISignProvider.cs to take an IEnumerable again

* Moving code from controllers to factories

* Refactoring HasPendingChangesSignProvider.cs to use the right Interface method

* Refactoring HasScheduleSignProvider.cs to be less bloated, and more readable (hopefully)

* Refactoring tests to look at variants and include a list

* Changing instantiation to be better

* Fixed minor logic issue in HasScheduleSignProvider.cs

* Refactoring to include just 1 database call.

* Adjusting tests to use the new methods.

* Reverted breaking changes
2025-09-09 10:31:10 +02:00
Andy Butland
cebfb21eec Introduced sign providers for trees and implemented one for documents with schedule pending (#19806)
* Create sign provider collection and call registered providers on rendering a page of tree item view models.
Re-work tree controller constructors to provide registered providers as a collection.

* Stub implementation of sign provider for documents with a scheduled publish pending.

* Complete implementation of tree sign for pending scheduled publish.

* Added integration test for new method on IContentService.

* Added unit test for HasScheduleSignProvider.

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Tidied usings and clarified method header comments.

* Adding a fixed prefix to all future signs, and removing the provider property

* Adding a sign for protected tree documents.

* Adding IsProtectedSignProviderTest.cs & correcting HasScheduleSignProviderTests.cs to no longer assert the provider

* Fixing minor things in accordance with CR

* Adding collection items compatibility

* Introduced IHasSigns interface to provide more re-use across trees and collections.
Fixed updates to base content controllers (no need to introduce a new type variable).
Removed passing entities for populating tree signs (we aren't using it, so simplifies things).

* Refactoring a bit to make existing code less duplicated and fixing some constructor obsoletion

* Introducing a has pending changes sign.

* Applying changes based on CR

* Introducing tests for HasPendingChangesSignProvider.cs and stopped the use of contentService

* Introducing tests for HasPendingChangesSignProvider.cs and slight logic change

* Introduced HasCollectionSignProvider.cs and tests.

* Introducing collection signs to Media Tree & Media Collection items

* Introducing Plain Items and tests. Refactoring tests as well

* Introduced alternative CanProvideSigns() implementation on IsProtectedSignProvider.cs

* Slight refactoring to reduce bloating.

* Adding [ActivatorUtilitiesConstructor] since it threw an error otherwise

* Minor cleanup.

* Updated OpenApi.json.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: NillasKA <kramernicklas@gmail.com>
2025-08-20 10:32:23 +01:00
Sven Geusens
85b58f2015 Custom serialization for ValidationProblemDetails to allign paths in custom and mvc error messages (#19111)
* Rowrked #18771 with a more brute force solution

* Fixes class name. Adds unit test verifying behaviour.

* Corrected test name.

---------

Co-authored-by: Kenn Jacobsen <kja@umbraco.dk>
Co-authored-by: Andy Butland <abutland73@gmail.com>
2025-04-23 10:17:18 +02:00
Andy Butland
83b92666ac Use maximum available value for JSON serialization depth (#19001)
* Use maximum available value for JSON serialization depth.

* Updated unittests with best practices

---------

Co-authored-by: Migaroez <geusens@gmail.com>
2025-04-14 13:50:19 +02:00
Mole
aaad9c0b23 V15: Notification Hub (#17776)
* Initial stab at how this could look

* Authorization PoC wip

* Add connection manager

* Add DI to its own class

* Use enum instead of string

* Use groups

* Refactor group management into its own service

* Update a users groups when it's saved

* Add saved events

* Wire up deleted notifications

* Ensure update date and create date is the same

* Cleanup

* Minor cleanup

* Remove unusued usings

* Move route to constant

* Add docstrings to server event router

* Fix and suppress warnings

* Refactor to authorizer pattern

* Update EventType

* Remove unused enums

* Add trashed events

* Notify current user that they've been updated

* Add broadcast

We don't need it, but seems like a thing that a server event router should be able to do.

* Add ServerEventRouterTests

* Add ServerEventUserManagerTests

* Use TimeProvider

* Remove principal null check

* Don't assign event type

* Minor cleanup

* Rename AuthorizedEventSources

* Change permission for relations

* Exctract event authorization into its own service

* Add some tests

* Update name

* Add forgotten file

* Rmember to add to DI
2025-01-10 09:36:44 +01:00
Sven Geusens
f833350218 Fix broken logger in tests 2024-12-12 11:06:43 +01:00
Sven Geusens
742307dc32 [v14] backoffice user login providers endpoint (#16141)
* Added endpoint and backing service for backoffice login providers and the status per user.

* Improve link login redirect forming and error handling

* Add responseModel and mapping instead of returning core model

* Moved unlink endpoint logic into a service

* Refactored ExternalLinkLoginCallback logic into BackofficeExternalLoginService method

* typo and minor code style improvements

* async method name alignment

* Add BackOfficeExternalLoginService tests

* Remove helper method that makes less sense that thought.

* Minor formatting, clean-up and conventions

* Replaced cookie authentication in link-login with a short lived secret

Applied PR feedback

* Update openapi

* Changed link login to a form endpoint

* fix broken comment link

* Do not store claimsprinciple in secret + comments

* update redirect paths

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
Co-authored-by: kjac <kja@umbraco.dk>
Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>
2024-05-14 15:55:32 +02:00
Elitsa Marinovska
53654d3b28 V14: Return the unhealthy error message from Examine index (#16228)
* Use Attempt<string> result to display the unhealthy error message

* Update OpenApi.json

* Code readability improvements

* Add unittest covering the bug

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
2024-05-08 08:41:18 +02:00
Nikolaj Geisle
595ee242aa V14: Remove old backoffice project. (#15752)
* Move magical route to management api

* Move auth around

* Remove "New" cookies, as they are no longer needed

* Move all installer related

* Remove BackOfficeServerVariables.cs and trees

* Move webhooks to management api

* Remove remainting controllers

* Remove last services

* Move preview to management api

* Remove mroe extensions

* Remove tours

* Remove old Auth handlers

* Remove server variables entirely

* Remove old backoffice controller

* Remove controllers namespace entirely

* Move rest of preview

* move last services

* Move language file extension

* Remove old backoffice entirely (Backoffice and Web.UI projects)

* Clean up unused security classes

* Fix up installer route

* Remove obsolete tests

* Fix up DI in integration test

* Add missing property mapping

* Move core mapping into core

* Add composers to integration test

* remove identity

* Fix up DI

* Outcomment failing test :)

* Fix up remaining test

* Update mapper

* Remove the actual project files

* Remove backoffice cs proj

* Remove old backoffice from yml

* Run belissima before login

* Remove caching

* Refactor file paths

* Remove belle from static assets

* Dont refer to old project in templates

* update gitignore

* Add missing files

* Remove install view as its no longer used

* Fix up failing test

* Remove outcommented code

* Update submodule to latest

* fix build

---------

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2024-02-27 12:40:30 +01:00
Kenn Jacobsen
183b5cc454 Management API model mapping take two (#15667)
* Re-modelling API models (take two)

* Do not use "content" - use "document" and "media" instead.

* Move "item" endpoints to their own silo

* Use "Id", not "Key"

* Regenerate OpenApi.json

* Rename user start node IDs from "content" to "document"

* Regererate OpenApi.json after forward merge

* update importmap

---------

Co-authored-by: Mads Rasmussen <madsr@hey.com>
2024-02-06 13:19:30 +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
Bjarke Berg
0f1c2f7022 Ensure no management api for v12 (#14197)
* Remove management api

* Remove actual files
2023-05-04 13:32:41 +02: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