Commit Graph

220 Commits

Author SHA1 Message Date
Elitsa Marinovska
5a7d563b8a Introduce INavigationService for in-memory navigation data (#16818)
* Tests

* Remove props and use local vars

* Adding preliminary navigation service and content implementation

* Adding preliminary unit tests

* Change from async methods

* Refactor GetParentKey to TryGetParentKey

* Refactor GetChildrenKeys to TryGetChildrenKeys

* Refactor GetDescendantsKeys to TryGetDescendantsKeys

* Refactor GetAncestorsKeys to TryGetAncestorsKeys

* Refactor GetSiblingsKeys to TryGetSiblingsKeys

* Refactor TryGetChildrenKeys

* Initial integration tests

* Use ContentEditingService instead of ContentService

* Remove INavigationService.Copy implementation and unit tests

* Rename var

* Adding clarification

* Initial ContentNavigationRepository

* Initial NavigationFactory

* Remove filtering from factory

* NavigationRepository and implementation

* InitializationService responsible for seeding the in-memory structure

* Register repository and service

* Adding NavigationDto and NavigationNode

* Adding INavigationService dependency and Enlist updating navigation structure actions

* Documentation

* Adding tests for removing descendants as well

* Changed to ConcurrentDictionary

* Remove keys comments for tests

* Adding documentation

* Forgotten ConcurrentDictionary change

* Isolating the operations on the model

* Splitting the INavigationService to separate the querying from the managing functionality

* Introducing specific navigation services for document, document recycle bin, media and media recycle bin

* Making ContentNavigationService into a base as the functionality will be shared between the document, document recycle bin, media and media recycle bin services

* Adding the implementations of document, document recycle bin, media and media recycle bin navigation services

* Fixing comments

* Initializing all 4 collections

* Adapting the navigation unit tests to the base now

* Adapting integration tests to specific navigation service

* Adding test for rebuilding the structure

* Adding implementation for Adding and Getting a node - needed for moving to and restoring from the recycle bin + tests

* Updating the document navigation structure from the ContentService

* Fix typo

* Adding trashed items implementation in base - currently managing 2 structures

* Removing no longer relevant GetNavigationNode and AddNavigationNode

* Fix removing parent when child is removed supporting methods

* Added restoring functionality

* Adding Bin functionality to DocumentNavigationService

* Removing Move signature from IDocumentNavigationService

* Adding RecycleBin query and management services

* Re-adding Move and removing GetNavigationNode and AddNavigationNode signatures from interface

* Rebuilding bin structure using _documentNavigationService, instead of _documentRecycleBinNavigationService

* Fixing test name

* Adding more tests for remove

* Adding tests for restore and removing ones for GetNavigationNode and AddNavigationNode

* Remove comments

* Removing document and media RecycleBinNavigationService and their interfaces

* Adding media rebuild bin

* Fixing initialization with correct interfaces

* Removing RecycleBinNavigationServices' registration

* Remove IDocumentRecycleBinNavigationService dependency

* Updating in-memory nav structure when content updates happen

* Adding the rest of the integration tests

* Clean up IMediaNavigationService

* Fix comments

* Remove CustomTestSetup in integration tests as the structure is updated when content updates happen

* Adding and fixing comments

* Making RebuildBinAsync abstract as well

* Adding DocumentNavigationServiceTestsBase

* Splitting DocumentNavigationServiceTests into partial test classes

* Cleaning up DocumentNavigationServiceTests since tests have been moved to specific partial classes

* Reuse a method for creating content in tests

* Change type in test base

* Adding navigation structure updates in media service

* Adding MediaNavigationServiceTestsBase

* Adding integration tests for media nav str

* Remove services as we will have more concrete ones

* Add document and media IXNavigationQueryService and IXNavigationManagementService

* Inject ManagementService in ContentService.cs and MediaService.cs

* Change implementation to implement the new services + registration

* Make classes sealed

* Inject correct services in InitializationService

* Using the right services in integration tests

* Adding comments

* Removing bin interfaces from main navigation ones

* Rename Remove to MoveToBin

* V14 QA added block list editor tests (#16862)

* Added tests for blocklistEditor

* Added more tets

* Removed faker

* Added blockTest

* Updates

* Added tests

* Removed dependencies

* Fixes

* Clean up

* Fixed naming

* Cleaned up

* Bumped version

* Added missing semicolons

* Added tags

* Only runs the new tests

* Updates

* Bumped version

* Fixed tests

* Cleaned up

* Updated version

* Fixes, not done

* Fixed tests

* Bumped helpers

* Bumped helpers

* Fixed conflict

* Fixed comment

* Reverted to run smokeTests

* Updated helpers

* improve missingProperties data returned for missing propertie values (#16910)

Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>

* update backoffice submodule

* Rename initialization service to initialization hosted service

* Refactor repository to return a collection

* Add interface for the NavigationDto

* Add constants to bind property names between DTOs

* Move factory and fix input type

* Use constants for column names

* Use factory from base

---------

Co-authored-by: Andreas Zerbst <73799582+andr317c@users.noreply.github.com>
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
Co-authored-by: Sven Geusens <sge@umbraco.dk>
Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>
2024-09-04 11:18:08 +02:00
Kenn Jacobsen
874055eeab Add member "kind" - and refactor user "type" to "kind" for consistency (#16979)
* Rename UserType to UserKind

* Add MemberKind to tell API members from regular ones

* Remove user kind from invite user endpoint

---------

Co-authored-by: Mads Rasmussen <madsr@hey.com>
2024-09-03 10:43:09 +02:00
Bjarke Berg
9208980398 Merge remote-tracking branch 'origin/v14/dev' into v15/dev
# Conflicts:
#	Directory.Packages.props
#	src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs
#	tests/Directory.Packages.props
#	version.json
2024-08-27 13:42:21 +02:00
Sven Geusens
fd100602c2 V14/fix/element switch validation (#16421)
* Added Element <-> Document type switch validation

* Apply HasElementconfigured to block grid and block list

Fix smalle bug + optimization

* Moved some of the logic into warnings trough notifcationhandlers and eventmessages

* Cleanup

* Update openApi spec (merge changes)

* Add IsElement check between parent and child on creation

* Typos

* Transformed HasElementConfigured into HasElementConfigured

* Typo

Co-authored-by: Kenn Jacobsen <kja@umbraco.dk>

* IsElement Validation refactor

Moved validation logic regarding doctype IsElement switch into its own service as it will be consumed by more things down the line

* commit missing services...

* Naming improvements

* Bugfix

* First batch of integration tests for ElementSwitchValidator

* More integration tests!

* Little reformatting

* Changed the default values of block based configuration to match expected values.

---------

Co-authored-by: Kenn Jacobsen <kja@umbraco.dk>
2024-08-15 07:11:17 +02:00
Kenn Jacobsen
68db079700 API access with client credentials (core functionality) (#16817)
* First stab

* Delivery API client credentials + a little refactor to ensure unique client IDs

* Introduce user type

* Support user type in the Management API

* Clean up TODOs

* Update API user last login date when issuing a token

* Better error reporting for mismatched user types

* Do not allow password change or reset for API users

* Update OpenApi.json

* Revert change

* Remove obsolete comment

* Make applicable classes abstract or sealed

* Review changes

* Add endpoint for retrieving all user client IDs
2024-07-29 14:34:11 +02:00
Nikolaj Geisle
ebf77024ce V14: Add clearer error for invalid property type (#16530)
* Add clearer error for invalid property type

* Update test
2024-06-06 08:54:47 +02:00
Kenn Jacobsen
07711aac28 Expose and manage system media types (#16343)
* Expose and manage system media types

* Removed license :D
2024-05-24 08:59:47 +02:00
Kenn Jacobsen
2b79d24afa Add endpoint for retrieving "folder" media types. (#16345)
* Add endpoint for retrieving "folder" media types.

* The system Folder media type should always be considered a "folder"
2024-05-23 14:43:00 +02:00
Nikolaj Geisle
a4a9a274bb V14: Merge 13 to 14 (#16340)
* Updates JSON schema for Umbraco 10 with latest references for Forms and Deploy (#15918)

* Ported over #15928 changes for 13.3 RC (#16023)

* Ported over #15928 changes for 13.3 RC

* Use GetOrAdd()

* Lock dictionary initialization

---------

Co-authored-by: Jason Elkin <jasonelkin86@gmail.com>

* Make the API content response builder extendable (#16056)

* Make the API content response builder extendable

* DeliveryApiJsonTypeResolver needs to be extendable too

* bump rc to regular

* Bump to next minor

* Add blocks in RTE telemetry (#16104)

* Add blocks telemetry

* Use constants and update tests

* V13: Add property type information to telemetry (#16109)

* Add property type counts to telemetry

* Use constants and fix tests

* Update description

* V10: Fix for fallback file upload (#14892) (#15868)

* Fix for fallback file upload (#14892)

* Added check for file type

* Removed unneeded null checks and fixed tabs

* Cleaning

* Cleanups, cleanups, and removal of unneeded null checks

* Reverted removal of relationshipservice

* Revert null check removals (too risky)

---------

Co-authored-by: Ambert van Unen <AvanUnen@ilionx.com>
Co-authored-by: Laura Neto <12862535+lauraneto@users.noreply.github.com>

(cherry picked from commit 0b5d1f8aa6)

* Fix up formatting

---------

Co-authored-by: Ambert van Unen <ambertvu@gmail.com>

* Implementors using Umbraco.Tests.Integration won't have to override GetLocalizedTextService

(cherry picked from commit b0016687eb)
(cherry picked from commit 2bb56f1b81)

* Fix logic for retrieving lastKnownElement

(cherry picked from commit cae106bfe8)

* bump version

* Bump version

* Bump version

* Since v13 properties can sometimes be of type IRichTextEditorIntermediateValue - this was unexpected in the XPath navigator code (#16121)

* Webhook log improvements (#16200)

* fix: include all headers in webhook log

* feat: return webhook log status from server

* feat: make webhook logs deep linkable

* feat: add webhook log pagination

* feat: improve webhook request/response body preview

* V13: Optimize custom MVC routing (#16218)

* Introduce EagerMatcherPolicy to conditionally bypass content routing

* Ensure that the candidate we disable dynamic routing for is valid

* Skip Umbraco endpoints

* Simplify logic a bit

* Move install logic to matcher

* Ensure that dynamic routing is still skipped when in upgrade state

* Fixup comments

* Reduce nesting a bit

* Don't show maintenance page when statically routed controllers are hít

* Remove excess check, since installer requests are statically routed

* V13: Optimize custom MVC routing (#16218)

* Introduce EagerMatcherPolicy to conditionally bypass content routing

* Ensure that the candidate we disable dynamic routing for is valid

* Skip Umbraco endpoints

* Simplify logic a bit

* Move install logic to matcher

* Ensure that dynamic routing is still skipped when in upgrade state

* Fixup comments

* Reduce nesting a bit

* Don't show maintenance page when statically routed controllers are hít

* Remove excess check, since installer requests are statically routed

(cherry picked from commit ba9ddd11da)

* Property source level variation should only be applied when configured (#16270)

* Property source level variation should only be applied when configured (#16270)

(cherry picked from commit ab32bac5d9)

* Merge pull request from GHSA-j74q-mv2c-rxmp

* Merge pull request from GHSA-j74q-mv2c-rxmp

* Merge pull request from GHSA-j74q-mv2c-rxmp

* Fix up after merge

* Remove obselete test

---------

Co-authored-by: Andy Butland <abutland73@gmail.com>
Co-authored-by: Kenn Jacobsen <kja@umbraco.dk>
Co-authored-by: Jason Elkin <jasonelkin86@gmail.com>
Co-authored-by: Sven Geusens <sge@umbraco.dk>
Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>
Co-authored-by: Ambert van Unen <ambertvu@gmail.com>
Co-authored-by: Lars-Erik <lars-erik@aabech.no>
Co-authored-by: Joshua Daniel Pratt Nielsen <jdpnielsen@gmail.com>
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
Co-authored-by: Sebastiaan Janssen <sebastiaan@umbraco.com>
Co-authored-by: Rasmus John Pedersen <mail@rjp.dk>
2024-05-22 12:05:41 +02:00
Sven Geusens
f9c0235a35 [v14] Add missing alias and id to usergroup related api models (#16154)
* Added missing alias and Id to usergroup models

create/update/response/item

* Changed userGroup IsSystemGroup to more meaningfull fields

Also enforced the AliasCanBeChanged businessrule 🙈

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
Co-authored-by: Mads Rasmussen <madsr@hey.com>
2024-05-03 10:24:09 +02:00
Kenn Jacobsen
8ad6c36038 Amend user start node handling (#16094)
* Amend user start node handling

* Add "has root access" to current user endpoint

* Add document and media root access to user response model

* Update OpenApi.json

* Applied API suggestions

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
2024-05-03 08:47:10 +02:00
Kenn Jacobsen
39e51a4467 Add endpoint for retrieving allowed media types for file extensions (#16189)
* Add endpoint for retrieving allowed media types for file extensions

* Moved paging into service

---------

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2024-04-30 14:26:12 +02:00
Mole
0980350172 Add blocks in RTE telemetry (#16104)
* Add blocks telemetry

* Use constants and update tests

* V13: Add property type information to telemetry (#16109)

* Add property type counts to telemetry

* Use constants and fix tests

* Update description
2024-04-22 12:56:36 +02:00
Nikolaj Geisle
d25c3ca86d Merge remote-tracking branch 'origin/v13/dev' into release/14.0
# Conflicts:
#	src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml
#	src/Umbraco.Infrastructure/BackgroundJobs/Jobs/ReportSiteJob.cs
#	tests/Umbraco.Tests.Integration/Umbraco.Core/Telemetry/TelemetryServiceTests.cs
2024-04-17 09:10:05 +02:00
Mole
096991ac79 V13: Add webhook information to detailed telemetry (#16060)
* Cleanup ReportSiteJob

* Report on registered webhook event types

* Report on custom header webhook count

* Use constants instead of magic strings

* Update tests

* Update translation files
2024-04-16 14:36:02 +02:00
Nikolaj Geisle
d5809da665 V14: Move towards get guid (#15889)
* Implement using keymap for member

* Remove current usages of GetUserById

* User userId resolver to resolve user key

* Refactor user repository to use GUID not int

* Add happy path test

* Remove user in cache when user gets updated

* Use await in async method

* Fix up according to review

* Update IMetricsConsentService.cs to have async method

* Fix according to review

* Fix more according to comments

* Revert "Fix up according to review"

This reverts commit a75acaaa

* Get current backoffice user from method

* Update user repository delete functionality

* Fix up more test

* Try to get user by id if key fails

* Add user key as required claim

* Fix tests

* Don't set claim in BackofficeController

* Create constant for the Sub claim

---------

Co-authored-by: kjac <kja@umbraco.dk>
2024-04-11 13:53:34 +02:00
Elitsa Marinovska
be16aa0663 V14: Test new content blueprint editing service (#15970)
* Fix wrong service name

* Move tests to correct place and fix naming

* Introducing a test base

* Tests IContentBlueprintEditingService

* Remove comment

* Adding Assert.Multiple

* More Assert.Multiple + Can_Create_With_Basic_Model() and Cannot_Create_When_Content_Type_Not_Found()
2024-04-04 09:40:06 +02:00
Kenn Jacobsen
70878f501e Make property container type parsing explicit (#15963) 2024-04-04 09:32:24 +02:00
Elitsa Marinovska
37734efd15 V14: Blueprint CRUD endpoints (#15947)
* Get blueprint by key

* Renaming

* Implementing DeleteBlueprintAsync

* Fixing tests to use the new method

* Making ContentControllerBase abstract

* Cleanup

* Implementing Delete blueprint endpoint

* Revert obsoletion in ContentService.cs

* More reverting

* Remove usings

* Introducing IContentBlueprintEditingService

* Refactor Get and Delete blueprint endpoints to use the new IContentBlueprintEditingService

* Fix base inheritance case in SchemaIdSelector

* Creating RequestModelBase for UpdateDocument to be reused in both document and blueprint models

* Creating DocumentResponseModelBase to be reused in both document and blueprint models

* Renamed blueprint response model for item endpoint to be aligned with the rest of the item models

* More renaming changes of the DocumentBlueprintItemResponseModel

* Refactor ByKeyDocumentBlueprintController to make use of the new blueprint models

* New blueprint models and mapping

* Adding UpdateAsync to ContentBlueprintEditingService

* Adding IDocumentBlueprintEditingPresentationFactory.cs

* Adding UpdateDocumentBlueprintController.cs

* Adding methods required from the base

* Fixing bug in document type mapping - mapping incorrect key

* Cleanup

* Fix item endpoint

* Adding MapCreateModel

* Adding create model

* Creating request model base + related classes

* Another request model

* Blueprint editing service

* Adding create controllers

* Adding DuplicateName operation status for blueprints and handling it

* Updating OpenApi.json

* Fix comment

* Fix mapping

* Adding comments

* Passing in id for create blueprint from document model

* Mapping default state to Draft - no need to calculate it, it will always be that for blueprints

* Cleanup

* Update OpenApi.json

* Review comments

* Fix policies

* More policy updates
2024-04-02 12:53:06 +02:00
Kenn Jacobsen
4dca7495f8 Handle sensitive properties in the Management API (#15936)
* Handle sensitive properties in the Management API

* Use Assert.Multiple to catch all failing tests in one run

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
2024-03-25 16:56:13 +01:00
Bjarke Berg
17bc6f1d0c Merge remote-tracking branch 'origin/v13/dev' into v14/dev 2024-03-15 16:00:46 +01:00
Bjarke Berg
1011a2c1a6 Merge 2024-03-15 15:35:08 +01:00
Kenn Jacobsen
69a691f315 Removed unused content editing models (#15855) 2024-03-11 13:15:25 +01:00
Kenn Jacobsen
21126b7ba6 Localize validation messages with user lang files (#15820)
* Localize validation messages with user lang files

* Fixed unit tests
2024-03-04 12:50:24 +01:00
Kenn Jacobsen
d8659ca53e Refactor content updates to shift responsibility downwards (#15807) 2024-03-01 10:45:19 +01:00
Kenn Jacobsen
976bca456e Remove macros (#15794)
* Remove macros!

* Clean up snippets

* Add migration that deletes all macros

* Review comments
2024-02-29 15:11:06 +01:00
Nikolaj Geisle
1e043cbcfb V14: Member group controller (#15669)
* Add models & mapping

* Add controller

* Add create async to service

* Add auth policy

* Implement delete

* Rename response model

* Implement updateAsync

* Refactor update to use own model

* Implement all async counterparts for IMemberService

* Add tests

* Implement update member group mapping

* Dont fail if updating the current user group

* Return not found if not found

* Add missing OperationResults to MemberGroupOperationStatusResult

* Add 404 to response type

* Update openapi

* Update OpenApi

* Update OpenApi.json
2024-02-29 09:16:27 +01:00
Bjarke Berg
2494d8c5aa Granular permissions in Management API (#15734)
* It builds..

* Added granular permissions

* Added granular permissions

* Rename content to document

* Added migration

* Fixed issues causing the migration from v13 was not possible.

* Merged Permissions and Granular Permissions in viewmodel

* Prepared the viewmodel to a future where permissions can be more types.

* OpenApi

* Allow to translate a single char to many strings

* Use frontend friendly values for known permissions

* Validate the documents exist

* Allow setting non-document settings

* Add "$type" when required

* Rename to presentation model and update OpenApi.json

* OpenApi.json

* Fix tests

* OpenAPI

* Fixed issues with upgrades

* Add the discriminator name

* Fixed issues that only happended on SqlServer

* Fixed queries for SqlServer

* Clean up

* More cleanup

* Fix issue when migrating sqlserver

* Split fallback permissions into own concept in view model

* Also split on current user

* Added a extenable pattern for mappers between DTO => Granular Permission => ViewModel and ViewModel => Granular Permission

* Fixed issue with new exists method, that did not take duplicate keys into account.

* Added sections to current user response model

* Formatting fixes

* Move class to its own file

* xml comment

---------

Co-authored-by: Zeegaan <skrivdetud@gmail.com>
2024-02-27 21:57:02 +01: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
Elitsa Marinovska
593f1eea6c V14: Align cultures & segments casing (#15745)
* Removing to ToLowerInvariant from culture and segments

* Adding ToLowerInvariant for DeliveryAPIIndex to not modify the stored data

* Fix failing test - remove ToLowerInvariant
2024-02-27 09:56:57 +01:00
Mole
b320cf1b22 V14: Remove legacy manifest parser (#15744)
* Remove legacy manifest parser

* Remove unused usings

---------

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2024-02-26 15:43:48 +01:00
Nikolaj Geisle
4eb1ea6205 V14: List view reference in ContentType (#15687)
* Replace all IsContainer mentions with new ListView property

* Map the list view when creating and updating

* Implement list view migration

* Refactor listview to collection

* Do not assign listview if IsContainer is false

* Fix up HasContainerInPath query

* Update OpenApi.json

* fix up according to review

* Refactor duplicate code to use extension method instead

* Dont make new guid, check for null

* Make extension internal

* Fix up after merge

* Use ReferenceById static method instead of extension
2024-02-22 09:11:31 +01:00
Kenn Jacobsen
cc082e191c Clean up datatype configurations for V14 (#15718)
* Clean up datatype configurations for V14

* Fix merge

* Remove ParameterEditorCollection + revert accidental changes to core project file
2024-02-15 12:36:23 +01:00
Nikolaj Geisle
74db02c444 V14: Don't add published culture infos if not published (#15370)
* Don't add published infos if not published

* Unpublish all cultures as a whole

* Added tests

---------

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2024-02-01 08:33:14 +01:00
Kenn Jacobsen
aaf7075313 Property level validation for Management API (#15644)
* Property level validation for content - initial implementation

* Always succeed create/update regardless of property level validation errors

* Move old complex editor validation classes to Web.BackOffice so they will be deleted

* Include operation status and property validation errors in ProblemDetails

* Refactor property validation to its own service(s)

* Make the problem details builder a little more generic towards extensions

* Validation for item and branch publish

* Moved malplaced test

* Get rid of a TODO

* Integration tests for content validation service

* Simplify validation service

* Add missing response types to create and update for document and media

* Remove test that no longer applies

* Use "errors" for model validation errors (property validation errors)

* Split create/update and validation into their own endpoints

* Fix forward merge

* Correct wrong assumption for missing properties

* Remove localization from validation error messages - decreases dependencies, adds a lot of obsolete constructors

* Reuse existing validation service + support custom error messages

* Fix merge errors

* Review comments
2024-01-31 10:40:58 +01:00
Sven Geusens
26761cc04a Implemented culture based authorization for content (#15580)
* Implemented culture based authorization for content

* Implemented culture auth for create/update of documents

* Applied culture authorization to dictionary create/update

* Added an integration test to test an assumption about the ContentTypeEditingService.CreateAsync method

* Fix processing when result is already false;

* Apply suggestions from code review

Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>

* Refactor method to async + clarify and consilidate comments regarding dictionary locks

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
2024-01-22 21:08:20 +01:00
Elitsa Marinovska
547da0b191 V14: Composition endpoints for Document and Media types (#15584)
* Adding response/request models

* Adding mapping

* Adding factory

* Adding controllers

* Moved to correct (generic domain) namespace

* Renamed to reflect the correct domain + renamed IsAllowed to IsCompatible

* Renaming + TODO

* Removed presentation logic + TODO

* Fixed controller

* Attempt for generic implementation

* Enable composition of media types + refactor content/media type editing tests to prove it (and a little renaming of a mis-named property)

* Remove unused classes

* Introducing GetAvailableCompositionsAsync to EditingServices

* Implement GetAvailableCompositionsAsync

* Base share implementation

* Tests

* Tests

* Renaming

* Clean up controller

* Clean up test

* Remove redundant check

* Create and use generic models

* Add shared implementation

* Fix and rename doc type mapper

* Fix document Type factory

* Add missing response type

* Create a base request model

* Make key nullable when new item

* Media type response models

* Default isElement to false and remove isElement param from media type related things

* Create mappings for media type compositions

* Inject generic base service to reuse implementation amongst concrete services

* Add new composition endpoints for media type

* Use specific type

* Add a reference comment to other test suite

* Add more test cases

---------

Co-authored-by: kjac <kja@umbraco.dk>
2024-01-17 08:36:27 +01:00
Kenn Jacobsen
f9ecd9514e Management API should expose if a user group is a system group (#15333) 2023-12-01 09:39:27 +01:00
Kenn Jacobsen
012b43a1c2 Publishing in the Management API (#14774)
* make CoreScopeProvider available for derived classes

* Create publish controller

* Add publish functionality

* Remove unneeded using

* Implement publish for multiple cultures

* support multiple cultures in controler

* Dont validate properties

* Refactor to use PublishingOperationStatus

* refactor to use proper publish async methods

* Refactor publish logic into own service

* Commit some demo code

* Add notes about what errors can happen when publishing

* Rework ContentPublishingService and introduce explicit Publish and PublishBranch methods in ContentService

* Fix merge

* Allow the publishing strategy to do its job

* Improved check for unsaved changes

* Make the old content controller work (as best possible)

* Remove SaveAndPublish (SaveAndPublishBranch) from all tests

* Proper guards for invalid cultures when publishing

* Fix edge cases for property validation and content unpublishing + add unpublishing to ContentPublishingService

* Clear out a few TODOs - we'll accept the behavior for now

* Unpublish controller

* Fix merge

* Fix branch publish notifications

* Added extra test for publishing unpublished cultures and added FIXME comments for when we fix the state of published cultures in content

---------

Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-11-22 12:52:08 +01:00
Bjarke Berg
fb55e1b244 Merge remote-tracking branch 'origin/v13/dev' into v14/dev
# Conflicts:
#	src/Umbraco.Core/DependencyInjection/UmbracoBuilder.cs
#	src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.Repositories.cs
#	src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs
#	src/Umbraco.Infrastructure/PropertyEditors/MultiUrlPickerValueEditor.cs
2023-11-14 13:22:10 +01:00
Bjarke Berg
c22783e45e Merge remote-tracking branch 'origin/release/13.0' into v13/dev 2023-11-14 12:43:11 +01:00
Kenn Jacobsen
4d98937af9 Delivery API nested property expansion and output limiting (#15124)
* V2 output expansion + field limiting incl. deprecation of V1 APIs

* Performance optimizations for Content and Block based property editors

* A little formatting

* Support API versioning in Delivery API endpoint matcher policy

* Add V2 "expand" and "fields" to Swagger docs

* Renamed route for "multiple items by ID"

* Review changes

* Update src/Umbraco.Cms.Api.Delivery/Controllers/Media/ByIdMediaApiController.cs

Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com>

* Update src/Umbraco.Cms.Api.Delivery/Filters/SwaggerDocumentationFilterBase.cs

Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com>

* Update src/Umbraco.Cms.Api.Delivery/Filters/SwaggerDocumentationFilterBase.cs

Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com>

* Revert "Performance optimizations for Content and Block based property editors"

This reverts commit 0d5a57956b36e94ce951f1dad7a7f3f43eb1f60b.

* Introduce explicit API cache levels for property expansion

* Friendly handling of bad expand/fields parameters

---------

Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com>
2023-11-14 11:16:12 +01:00
Bjarke Berg
162a6a0085 Post merge 2023-11-14 09:39:39 +01:00
Nikolaj Geisle
0e8c92a6e7 V13: Refactor webhookservice to attempt pattern (#15180)
* Refactor IWebhookService to attempt pattern

* Remove unwanted file

* Fix up tests

* Fix after merge

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-11-13 18:36:05 +01:00
Nikolaj Geisle
46df3a05a7 V13: request queueing (#15176)
* Implement persistence

* Start implementing repository

* Implement repository

* Implement request service

* Dont run WebhookFiring if not in runtime mode run

* Refactor repository and service to have full CRUD

* add tests for Request service

* Implement WebhookRequest lock

* Register hosted service

* Add try catch when firing HttpRequest

* Add migration

* Refactor to use renamed IWebhookService

* Refactor tests too

* Add setting to configure webhook firing period

* Update docs

* Review fixes

* Add column renaming migration

* Remove unused service

* run request in parralel

* Refactor to fire parallel in background

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2023-11-13 15:49:02 +01:00
Nikolaj Geisle
e143133bcf V13: Update IWebHookService to proper casing (#15169)
* Update to proper casing

* Fixed naming

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
Co-authored-by: Andreas Zerbst <andr317c@live.dk>
2023-11-10 08:20:22 +01:00
Nikolaj Geisle
7bde16b4ef V13: Add eventype to webhookevents (#15157)
* Refactor IWebhookEvent to contain event type.

* refactor frontend to filter on eventType.

* Display event names

* refactor to use eventNames

* remove npm from overview

* implement alias for WebhookEvents

* Implement [WebhookEvent] attribute

* Refactor IWebhookService to get by event alias and not name

* Rename parameter to fit method name

* to lower event type to avoid casing issues

* Apply suggestions from code review

Co-authored-by: Ronald Barendse <ronald@barend.se>

* Change event names from constants to hard coded. And give more friendly names

* Refactor to not use event names, where it was not intended

* Add renaming column migration

* display event alias in logs

* Update migration to check if old column is there

* Apply suggestions from code review

Co-authored-by: Kenn Jacobsen <kja@umbraco.dk>

* add determineResource function to avoid duplicate code

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
Co-authored-by: Ronald Barendse <ronald@barend.se>
Co-authored-by: Kenn Jacobsen <kja@umbraco.dk>
2023-11-09 14:18:34 +01:00
Bjarke Berg
fd0c233362 Merge remote-tracking branch 'origin/v13/dev' into v14/dev 2023-11-08 05:53:03 +01:00
Erik-Jan Westendorp
c0ca4685e8 Fix FurthestAncestorOrSelfDynamicRootQueryStep and FurthestDescendantOrSelfDynamicRootQueryStep (#15113)
* Rename FarthestDescendantOrSelfDynamicRootQueryStep to FurthestDescendantOrSelfDynamicRootQueryStep

* Rename FarthestAncestorOrSelfDynamicRootQueryStep to FurthestAncestorOrSelfDynamicRootQueryStep

* Update integration test and repo
2023-11-06 10:44:12 +01:00
kjac
e864f3eb05 Fix merge errors and port blocks in RTE implementation to V14 format (strongly typed, no magic JObjects) 2023-11-02 11:55:12 +01:00