Commit Graph

12489 Commits

Author SHA1 Message Date
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
Alina-Magdalena Tincas
85747593cc Update v14 api docs with info from umbraco docs (#15977)
* update api docs

* small update
2024-04-11 11:19:23 +02:00
Sven Geusens
513f39f623 Prevent template circular references (#15907)
* Added a simpel circular reference check to templates

* Upgraded detecting to all levels

* Rename method and add comment to clarify why we have 2 similar methods

* Apply suggestions from code review

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

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
2024-04-11 11:18:00 +02:00
Kenn Jacobsen
acae5f2d57 Remove "additional data" from entities (#16024)
* Remove "additional data" from entities

* Fix merge issue

---------

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2024-04-11 10:55:21 +02:00
Kenn Jacobsen
a982df97a6 Remove manifest validators (#16027)
* Remove manifest validators

* Remove "Configuration" from RegexValidator
2024-04-11 10:42:22 +02:00
Kenn Jacobsen
459cd79a06 Remove RTE embedded image handling + clean up file upload configuration (#16025) 2024-04-11 10:40:44 +02:00
Kenn Jacobsen
d47638df98 Remove remnants of the Angular implementation (#16026) 2024-04-11 09:08:56 +02:00
Ronald Barendse
16dd5327d4 v14: Refactor and enhance System.Text.Json converters (#15960)
* Update JsonUdiConverter to support Udi, GuidUdi and StringUdi types

* Require boolean (like) value and rename to JsonFuzzyBooleanConverter

* Add read/write only JsonConverters and align naming

* Rename SystemTextJsonSerializer to DefaultJsonSerializer

* Rename SystemTextConfigurationEditorJsonSerializer to DefaultConfigurationEditorJsonSerializer

* Add JsonUdiRangeConverter

* Rename JsonFuzzyBooleanConverter back to JsonBooleanConverter

* Fix value type check in JsonObjectConverter

* Revert class names

* Updated tests

* Post fix after merge.

---------

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2024-04-10 20:21:24 +02:00
Kenn Jacobsen
1c799802c5 Deduplicate the magic string "/management/api/" (#16016) 2024-04-10 14:21:59 +02:00
Kenn Jacobsen
d50b3a521e Simplify user group authorization failure statuses (#16009)
Co-authored-by: Elitsa <elm@umbraco.dk>
2024-04-10 12:39:22 +02:00
Bjarke Berg
fcda25af50 Premigrations + Updated NuGet Dependencies (#15987)
* Updated nuget packages + added migrations for OpenIddict - Currently can only be executed using unatttended installs

* Added new Premigration concept - Migrations that always runs unattended before other migrations

* Apply suggestions from code review

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

---------

Co-authored-by: Zeegaan <skrivdetud@gmail.com>
Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
2024-04-10 12:30:30 +02:00
Bjarke Berg
082d504b33 Fix tracked reference queries for SqlServer (#16020)
* Fixed issue with SqlServer and optimized queries to not do the actual paging if total count is 0

* Cleanup

---------

Co-authored-by: Elitsa <elm@umbraco.dk>
2024-04-10 12:03:32 +02:00
Ronald Barendse
4c3c3cd158 v14: Align Deploy interfaces, remove obsolete methods and default interface implementations (#15965)
* Align FromArtifact return type with IDataType.ConfigurationData

* Align Alias nullability with interface

* Lazily initialize ArtifactDependency collection when not set

* Remove ShouldSerializeChecksum (not used by STJ)

* Remove obsolete methods and default interface implementations

* Order dependencies once when setting collection

* Update test to include artifact Checksum property
2024-04-10 10:12:38 +02:00
Kenn Jacobsen
41238d141a Move manifest endpoints to their own, independent API group and fix access policies accordingly (#15989)
* Move manifests to their own API group and fix access policies

* Update OpenApi.json

* add an endpoint to fetch "private" packages, i.e. AllowPublicAccess=false

* Review comments

* update OpenAPI.json

* update OpenApi.json

* allow /umbraco/logout to be used for PostLogoutRedirectUris when logging out through the management api

* use the Umbraco.Extensions string extensions instead

* add constraints to the BackofficeDefaultController to handle the cases of 'install', 'upgrade', and 'logout'

---------

Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>
2024-04-09 17:44:49 +02:00
Elitsa Marinovska
ac7e4c1fa3 Clean up comments that won't apply (#16018) 2024-04-09 12:07:55 +02:00
Sven Geusens
b8ae3e34ff Convert Tourdata into a more generic concept (#15923)
* Added UserData and migrated tours data into it

* Remove tourdata from user

* Removed tour definition/manipulation classes

Fixed a userData error typo

* Removed toursettings

* Update openapi spec

* V13: Align database schemas of migrated and new database (#15934)

* Drop default constraint umbracoCacheInstruction table

* Align umbracoContentVersion table

* Update indexes on external login table

* Align node table

* Make relation type index unique

* Remove user-group default constraint

* Re-order methods

* Make webhook url not nullable

* Cleanup

* Cleanup

* Update OpenApi.json

* Update src/Umbraco.Cms.Api.Management/Controllers/UserData/UserDataControllerBase.cs

* Remove tour settings from schema

* Add cancelation tokens

* Dont inject, but take as parameter

* Remove some from injection

* Update schema

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>
Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
Co-authored-by: Zeegaan <skrivdetud@gmail.com>
2024-04-09 11:59:43 +02:00
Elitsa Marinovska
9c18cd22e0 V14: Deleted code marked as obsolete for V14 (#15998)
* Obsoletions related to Delivery API

* Fix TypeLoader and TypeFinder tests

* Remove obsolete and default implementations of IFileSource and IFileTypeCollection

* More Delivery API related obsoletions

* VariationContextAccessor related

* ValueFactories obsoletion and fix references

* ValueSetBuilders obsoletions

* ValueConverters obsoletions

* Other obsolete ctors and methods

* Forgotten VariationContextAccessor obsoletion

* More obsoletions

* XPath related obsoletions

* Revert XmlHelper changes

* Delete RenamedRootNavigator and its tests

* Fix test

* XmlHelper obsoletion

* Return null instead of GetXPathValue

* Obsolete entire class instead

* Remove XPath obsoletions from IPublishedCache

* Remove XPath-related if-block that is no longer needed

* Change obsolete msg for classes needed for NuCache

* Moving classes to NuCache and making them internal

* Remove more XPath-related obsoletions

* Remove NavigableNavigator and its tests

* Cleanup

* Remove Xpath references from tests

* Revert interface deletion in MediaCache

* Using XOR operation

Co-authored-by: Nuklon <Nuklon@users.noreply.github.com>

---------

Co-authored-by: Nuklon <Nuklon@users.noreply.github.com>
2024-04-09 09:06:48 +02:00
Kenn Jacobsen
ddf663d30b Support containers for blueprints (#15983)
* Support containers for blueprints

* Update OpenApi.json

* Fix tree ordering

* Add CancellationToken to new endpoints

* Change to doc blueprint specific things

* Fix policies

* Cleanup

* Use ContentBlueprintEditingService methods instead of underlying ContentService

* Review comments

---------

Co-authored-by: Elitsa <elm@umbraco.dk>
2024-04-08 14:55:46 +02:00
Elitsa Marinovska
e326370b5f V14: Deleted code marked as obsolete for V12 and V13 (#15999)
* Forgotten v12 obsoletions

* V13 obsoletions

* Remove LegacyStaticServiceProvider and fix using statements of StaticServiceProvider

* Remove obsolete ctors for v13

* More v13 obsoletions

* UmbracoMapper obsoletion

* UmbracoPipelineFilter obsoletion

---------

Co-authored-by: nikolajlauridsen <nikolajlauridsen@protonmail.ch>
2024-04-08 11:17:32 +02:00
Kenn Jacobsen
b552ccb885 Rename Examine based entity search service (#15991)
* Rename Examine based entity search service

* Add a few comments to make it easier to tell the "indexed" search service from the "regular" one.
2024-04-05 17:42:08 +02:00
Sven Geusens
45e584c061 Merge remote-tracking branch 'origin/v13/dev' into v14/dev
# Conflicts:
#	src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs

# Ignored Conflicts (Umbraco.Web.UI.Client is completly replaced in v14)
#	src/Umbraco.Web.UI.Client/src/common/directives/components/application/umbtour/umbtourstep.directive.js
#	src/Umbraco.Web.UI.Client/src/views/components/application/umb-tour.html
#	src/Umbraco.Web.UI.Client/src/views/components/application/umbtour/umb-tour-step-content.html
#	src/Umbraco.Web.UI.Client/src/views/components/application/umbtour/umb-tour-step-counter.html
#	src/Umbraco.Web.UI.Client/src/views/components/application/umbtour/umb-tour-step-header.html
#	src/Umbraco.Web.UI.Client~HEAD
#	src/Umbraco.Web.UI.Login/package-lock.json
#	src/Umbraco.Web.UI.Login/package.json
2024-04-05 14:14:45 +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
Sebastiaan Janssen
e993c23d5c Merge branch 'v13/dev' into contrib
# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
2024-04-04 11:25:13 +02:00
Elitsa Marinovska
43f77eef64 Remove StaticServiceProvider usage (#15978) 2024-04-04 11:25:13 +02:00
Kenn Jacobsen
70878f501e Make property container type parsing explicit (#15963) 2024-04-04 09:32:24 +02:00
Kenn Jacobsen
75b1d4729f Examine entity search for documents, media and members (#15972) 2024-04-03 18:49:23 +02:00
Chad
682b7656bc Update RefreshMethodType.cs 2024-04-02 21:49:03 +01: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
Sven Geusens
95849c265b Document version endpoints (#15946)
* Rename/Move/duplicate PaginationService to facilitate conversion closer to the data layer

Duplication is because of internal modifier as we don't want to expose these temporary classes

* Move Guid to Int Extensions into core + add unittests

* Added Document version endpoints

Updated used services to use async methods

* Moved PaginationConverter into core so it can be used by the service layer

* Endpoint structure improvements

* Updating OpenApi.json

* Add greedy constructors for contentService tests

* Namespace changes and naming cleanup

* Update openapispec again...

* Refactor injected services

* PR suggestion updates

- Move endpoints into their own structural section as they are also in a different swagger section
- Naming improvements
- Allign PresentationFactories with similar classes
- Cleanup unused assignments
- Cleanup refactoring comments
- Improve obsoletion remarks

* Cleanup

* ResponseModel improvements

* OpenApi spec update

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
Co-authored-by: Elitsa <elm@umbraco.dk>
2024-04-02 12:12:36 +02:00
Kenn Jacobsen
1866b61e12 Use an extension method for fetching a required user in a common way (#15953) 2024-04-02 11:20:05 +02:00
Kenn Jacobsen
96f2b17c5a Entity search - take one (#15951)
* Add entity search endpoints (to be replaced with Examine based ones for content, media and member)

* Update OpenApi.json
2024-04-02 10:40:45 +02:00
Sven Geusens
67d80da9ed Merge branch 'v13/dev' into v14/dev
# Conflicts:
#	src/Umbraco.Infrastructure/PropertyEditors/MultiUrlPickerValueEditor.cs
#	src/Umbraco.Web.Common/Profiler/WebProfiler.cs
#	src/Umbraco.Web.UI.Client/package-lock.json
#	src/Umbraco.Web.UI.Client/src/common/directives/validation/valpropertymsg.directive.js
#	src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/linkpicker/linkpicker.controller.js
#	src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/linkpicker/linkpicker.html
#	src/Umbraco.Web.UI.Client/src/views/content/content.create.controller.js
#	src/Umbraco.Web.UI.Client/src/views/content/create.html
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/umbBlockGridPropertyEditor.component.js
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/multiurlpicker/multiurlpicker.controller.js
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/multiurlpicker/multiurlpicker.html
#	src/Umbraco.Web.UI.Client~HEAD

# Ignored changes
#  https://github.com/umbraco/Umbraco-CMS/pull/14787
#  https://github.com/umbraco/Umbraco-CMS/pull/15853
#  https://github.com/umbraco/Umbraco-CMS/pull/15841
2024-03-27 16:13:09 +01: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
Ethan Nagano
ce372abf8a Add check for ContentVariation.Nothing when copying documents. (#15185)
A new check for ContentVariation.Nothing is necessary when copying from
documents to ensure that if there is no content variation as defined by
the Nothing property, values are still copied even if variation is not
supported since the content itself will not vary.
2024-03-25 13:27:36 +00: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
b1c3473856 Introduce path provider and resolver for the Content Delivery API (#15922) 2024-03-22 14:12:33 +01:00
Nikolaj Geisle
dd68a6da7f V14: Add reserved fields to config endpoints (#15919)
* Add reserved fields to documents

* Add member configuration endpoint

* Add reserved field to media configuration

* Refactor to use service instead on hardcoded methods

* Clean up, aligning

* Update OpenApi

---------

Co-authored-by: Elitsa <elm@umbraco.dk>
2024-03-22 12:11:38 +01:00
Kenn Jacobsen
0ed65671bb Use the correct localization keys for core property validation errors (#15931) 2024-03-22 10:19:33 +01:00
Kenn Jacobsen
e750d29d14 Ensure correct access to all manifests + introduce "public" package manifests (#15921)
* Introduce "public" package manifests

* Make sure "all manifests" are available to anyone with backoffice access

* review comments
2024-03-21 09:55:30 +01:00
Ronald Barendse
dd5d5ecf51 Add additional lock timeouts and clean-up ObjectCacheAppCache (#15911)
* Remove IHostEnvironment parameter and update clear cache

* Add lock timeouts and update exception messages

* Update constructor to internal
2024-03-19 18:38:05 +01:00
Nikolaj Geisle
30e2dea57a v14: Remove mentions of UmbracoApiController (#15863)
* Remove mentions of UmbracoApiController

* Remove last mentions of UmbracoApi controller
2024-03-19 14:42:08 +01:00
Sebastiaan Janssen
9030b1c19f Merge branch 'v13/dev' into contrib 2024-03-19 14:40:30 +01:00
Andreas Zerbst
e7f40affac V14 Bugfix ensures correct line endings for partial view snippets (#15906)
* Created extension class so we can ensure native line endings

* Added usage of extension method for ensuring native line endings

* Added tests, to see if the snippets return the correct content

* Removed space
2024-03-19 13:14:38 +01:00
Matthew Care
2c41388096 Preserve user populated link title when selecting nodes in link picker (#14787)
* Prevent user populated link names being removed

When selecting a node in a link picker, the "name" (Link title) field is always overridden with the selected node's name.
This change prevents the field from being overridden if it is user populated.

* Don't update for media either

If there is already a name, don't update when selecting media

* Deselect current node

When selecting media, deselect current node if there is one

* Change to suggested functionality

Update to more elaborate functionality which will always use the *current* node name. i.e If you change the node name then the link picker name changes also.

* Reapply changes

Repply changes after merge from contrib branch

* Use IsCulturePublished() and only track node name

* Fallback to node name in preview

* Fix setting media name

---------

Co-authored-by: Ronald Barendse <ronald@barend.se>
2024-03-19 11:31:31 +00:00
Bjarke Berg
1e69695650 Added missing locks and use timeout on all of them in ObjectCacheAppCache (#15902)
* Added missing locks, and ensure we have timeout on all of them

* Wrap the removable of objects from the hashset in a lock

* remove old comment

* Exit correct lock
2024-03-19 10:23:11 +01:00
Kenn Jacobsen
39085b9ad4 Add DB locking for container APIs (#15870) 2024-03-18 14:27:11 +01:00
Mole
1408298adf V14: Extend IContentEntitySlim (#15890)
* Extend EntitySlim with key

* Add ListView to GenericContentEntityDto and ContentEntitySlim

* Move ContentTypeKey and ListViewKey back to BaseDto

* Remove extra DB call when mapping to DocumentTypeReferenceResponseModel

* Remove extra DB call when mapping to MediaTypeReferenceResponseModel

* Remove duplicate db call for members

* Remove now redundant base class

* Fix comment
2024-03-18 10:46:03 +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
3e08ce1efb Fix after merge 2024-03-15 15:58:22 +01:00
Bjarke Berg
1011a2c1a6 Merge 2024-03-15 15:35:08 +01:00