Compare commits

...
1437 Commits
Author SHA1 Message Date
Andreas ZerbstandGitHub 9ab0abca99 E2E: Stop running version 14 on nightly test pipeline (#20558)
Stops 14 from running on our nightly test pipeline
2025-10-20 12:05:42 +02:00
Andy Butland 009a999e22 Merge branch 'release/14.3.4' into v14/dev 2025-04-08 07:15:06 +02:00
Andy ButlandandGitHub d3c1443b14 Merge commit from fork
* Prevent path traveral vulnerability with upload of temporary files.

* Used BadRequest instead of NotFound for invalid file name response.
2025-04-08 05:03:40 +02:00
Andy Butland 8a9db11422 Merge branch 'release/14.3.3' into v14/dev
# Conflicts:
#	Directory.Packages.props
#	version.json
2025-03-11 09:28:52 +01:00
Andy ButlandandGitHub d9fb6df16e Merge commit from fork
* Bumped version to 15.2.1.

# Conflicts:
#	version.json

* Tighten management API endpoint access rules.
2025-03-11 05:11:35 +01:00
Andy Butland 14ed3348bf bumped imagesharp to prevent CVE-2025-27598 (#18602)
# Conflicts:
#	Directory.Packages.props
2025-03-09 08:54:03 +01:00
Sven Geusens 9e7a36865a Merge branch 'v13/dev' into v14/dev
Revert #18249 as it is reimplemented for v15
Revert #18320 as the new architecture explictly throws an error

# Conflicts:
#	build/azure-pipelines.yml
#	src/Umbraco.Core/EmbeddedResources/Lang/en.xml
#	src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml
#	src/Umbraco.Core/Models/ContentEditing/ContentSaveAction.cs
#	src/Umbraco.Core/Services/ContentService.cs
#	src/Umbraco.Core/Services/IContentService.cs
#	src/Umbraco.Core/Services/MemberService.cs
#	src/Umbraco.Infrastructure/PropertyEditors/RichTextEditorPastedImages.cs
#	src/Umbraco.Infrastructure/Security/BackOfficeUserStore.cs
#	src/Umbraco.Infrastructure/Security/MemberUserStore.cs
#	src/Umbraco.Web.BackOffice/Controllers/ContentController.cs
#	src/Umbraco.Web.BackOffice/Controllers/EntityController.cs
#	src/Umbraco.Web.BackOffice/Controllers/MediaController.cs
#	src/Umbraco.Web.BackOffice/Controllers/MemberController.cs
#	src/Umbraco.Web.BackOffice/Controllers/PreviewController.cs
#	src/Umbraco.Web.BackOffice/Controllers/UsersController.cs
#	src/Umbraco.Web.BackOffice/DependencyInjection/UmbracoBuilder.BackOfficeAuth.cs
#	src/Umbraco.Web.BackOffice/Filters/ContentSaveValidationAttribute.cs
#	src/Umbraco.Web.BackOffice/Filters/MemberSaveModelValidator.cs
#	src/Umbraco.Web.BackOffice/Filters/MemberSaveValidationAttribute.cs
#	src/Umbraco.Web.BackOffice/Trees/ContentTreeController.cs
#	src/Umbraco.Web.Common/RuntimeMinification/SmidgeOptionsSetup.cs
#	src/Umbraco.Web.Common/RuntimeMinification/SmidgeRuntimeMinifier.cs
#	src/Umbraco.Web.Common/Views/UmbracoViewPage.cs
#	src/Umbraco.Web.UI.Client/src/common/directives/components/buttons/umbbuttongroup.directive.js
#	src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js
#	src/Umbraco.Web.UI.Client/src/common/directives/components/content/umbtabbedcontent.directive.js
#	src/Umbraco.Web.UI.Client/src/common/directives/components/property/umbproperty.directive.js
#	src/Umbraco.Web.UI.Client/src/common/resources/content.resource.js
#	src/Umbraco.Web.UI.Client/src/common/resources/publicaccess.resource.js
#	src/Umbraco.Web.UI.Client/src/common/resources/users.resource.js
#	src/Umbraco.Web.UI.Client/src/common/services/assets.service.js
#	src/Umbraco.Web.UI.Client/src/views/common/drawers/help/help.controller.js
#	src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/linkpicker/linkpicker.controller.js
#	src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/mediaentryeditor/mediaentryeditor.controller.js
#	src/Umbraco.Web.UI.Client/src/views/components/content/umb-tabbed-content.html
#	src/Umbraco.Web.UI.Client/src/views/components/property/umb-property.html
#	src/Umbraco.Web.UI.Client/src/views/content/content.create.controller.js
#	src/Umbraco.Web.UI.Client/src/views/content/overlays/publishdescendants.controller.js
#	src/Umbraco.Web.UI.Client/src/views/content/overlays/publishdescendants.html
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.controller.js
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.component.js
#	src/Umbraco.Web.UI.Client/src/views/users/views/user/details.html
#	src/Umbraco.Web.UI.Client/src/views/webhooks/edit.controller.js
#	src/Umbraco.Web.UI.Client/src/views/webhooks/edit.html
#	src/Umbraco.Web.UI.Client/test/unit/app/content/create-content-controller.spec.js
#	src/Umbraco.Web.UI.Client~HEAD
#	src/Umbraco.Web.UI.Login/src/auth.element.ts
#	tests/Umbraco.TestData/UmbracoTestDataController.cs
#	tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentServiceTests.cs
#	tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentEventsTests.cs
#	tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServicePublishBranchTests.cs
#	tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServiceTagsTests.cs
#	tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Security/MemberUserStoreTests.cs
#	tests/Umbraco.Tests.UnitTests/Umbraco.Web.BackOffice/Controllers/MemberControllerUnitTests.cs
#	version.json
2025-02-17 19:25:45 +01:00
Andy ButlandandGitHub db1d999721 Avoid exception when attempting to find member by Id when Id is not an expected Guid or integer, as can be the case with external member providers. (#18320) 2025-02-17 12:47:52 +01:00
Andy ButlandandGitHub 18047a7cfb Only filter post retrieval of entities for start nodes if working with entities that support start nodes. (#18287) 2025-02-17 12:45:51 +01:00
Andy ButlandandGitHub def7ebd48c Html encodes the user's name in the invite email. (#18343) 2025-02-17 12:25:12 +01:00
8c2b1ebdc5 V13: Introduce publishNotifications method on IMembershipMemberService (#18207)
* Introduce publishNotifications method on IMembershipMemberService.cs

* Fix test

* Add PublishNotificationSaveOptions

* Fix up according to comments

* Use numeric values for flag enum

* Update src/Umbraco.Core/Services/MemberService.cs

Co-authored-by: Andy Butland <abutland73@gmail.com>

* Update src/Umbraco.Core/Services/MemberService.cs

Co-authored-by: Andy Butland <abutland73@gmail.com>

---------

Co-authored-by: Andy Butland <abutland73@gmail.com>
2025-02-12 13:30:41 +01:00
Andy ButlandandGitHub 9227517a50 Split force for publish descendants into separate options for publish unpublish and re-publish unedited (13) (#18249)
* Split force for publish descendents into separate options for publish unpublish and re-publish unedited.

* Added integration task verifying updated behaviour.

* Variant integration test.

* Update test data controller.

* Remove usued function parameters.

* Refactor to enum.

* Fixed flags enum.

* Variable name refactor.

* Applied changes from code review.

* Refactored method name.

* Aligned js boolean checks.
2025-02-12 11:30:27 +00:00
Andy Butland 5322d0f7b5 Bumped version to 13.8.0-rc. 2025-02-12 08:13:58 +01:00
Andy Butland 8056a59a10 Fix schema defined in JSON schema tool definition after merge from 13. 2025-01-21 15:52:31 +01:00
Kenn JacobsenandSven Geusens 56c0aebd76 Add NoopCurrentMemberClaimsProvider so Umbraco can boot without the Delivery API enabled (#18049) 2025-01-21 09:12:20 +01:00
Sven Geusens 4b9771c0eb Merge branch 'v13/dev' into v14/dev
# Conflicts:
#	Directory.Packages.props
#	build/azure-pipelines.yml
#	src/Umbraco.Cms.Api.Common/DependencyInjection/UmbracoBuilderAuthExtensions.cs
#	src/Umbraco.Cms.Persistence.EFCore/Locking/SqlServerEFCoreDistributedLockingMechanism.cs
#	src/Umbraco.Core/Configuration/Models/RichTextEditorSettings.cs
#	src/Umbraco.Core/EmbeddedResources/Lang/da.xml
#	src/Umbraco.Core/EmbeddedResources/Lang/en.xml
#	src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml
#	src/Umbraco.Core/Services/ContentService.cs
#	src/Umbraco.Web.BackOffice/Authorization/ContentPermissionsQueryStringHandler.cs
#	src/Umbraco.Web.BackOffice/Authorization/ContentPermissionsResourceHandler.cs
#	src/Umbraco.Web.BackOffice/Controllers/ContentController.cs
#	src/Umbraco.Web.BackOffice/Controllers/ExamineManagementController.cs
#	src/Umbraco.Web.BackOffice/Controllers/MediaController.cs
#	src/Umbraco.Web.BackOffice/Trees/StaticFilesTreeController.cs
#	src/Umbraco.Web.UI.Client/package-lock.json
#	src/Umbraco.Web.UI.Client/package.json
#	src/Umbraco.Web.UI.Client/src/common/directives/components/buttons/umbbuttongroup.directive.js
#	src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js
#	src/Umbraco.Web.UI.Client/src/common/filters/simpleMarkdown.filter.js
#	src/Umbraco.Web.UI.Client/src/common/filters/simpleMarkdown.filter.js.js
#	src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js
#	src/Umbraco.Web.UI.Client/src/less/components/umb-group-builder.less
#	src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/mediaentryeditor/mediaentryeditor.less
#	src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/propertysettings/propertysettings.html
#	src/Umbraco.Web.UI.Client/src/views/common/overlays/ysod/ysod.controller.js
#	src/Umbraco.Web.UI.Client/src/views/common/overlays/ysod/ysod.html
#	src/Umbraco.Web.UI.Client/src/views/components/buttons/umb-button-group.html
#	src/Umbraco.Web.UI.Client/src/views/content/overlays/sendtopublish.controller.js
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/prevalue/blockgrid.blockconfiguration.overlay.controller.js
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/prevalue/blockgrid.blockconfiguration.overlay.html
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/prevalue/blocklist.blockconfiguration.overlay.controller.js
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/prevalue/blocklist.blockconfiguration.overlay.html
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.component.js
#	src/Umbraco.Web.UI.Client~HEAD
#	src/Umbraco.Web.UI.Login/package-lock.json
#	src/Umbraco.Web.UI.Login/package.json
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/BlockGridEditor/Content/blockGridEditorContent.spec.ts
#	tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServiceNotificationTests.cs
#	tests/Umbraco.Tests.UnitTests/Umbraco.Web.BackOffice/Controllers/ContentControllerTests.cs
#	tools/Umbraco.JsonSchema/UmbracoCmsSchema.cs
#	version.json
2025-01-21 08:47:38 +01:00
Jacob Overgaard abc312c9b4 update backoffice submodule to 14.3.2 2025-01-21 08:44:10 +01:00
Ronald BarendseandNikolaj Geisle 65bb2801b0 Merge commit from fork
* Add TimedScope

* Use TimedScope in login endpoint

* Use seperate default duration and only calculate average of actual successful responses

* Only return detailed error responses if credentials are valid

* Cancel timed scope when credentials are valid

* Add UserDefaultFailedLoginDuration and UserMinimumFailedLoginDuration settings
2025-01-20 16:44:28 +01:00
Andy ButlandandGitHub a0a4af6a0c Merge commit from fork 2025-01-20 14:54:14 +01:00
Jacob Overgaard e8d6cded2b update backoffice submodule to 14.3.2 2025-01-20 14:42:17 +01:00
Bjarke BergandJacob Overgaard c65204a146 update backoffice submodule to 14.3.2 2025-01-20 14:34:03 +01:00
Andy ButlandandGitHub 86f3033334 Merge commit from fork 2025-01-20 14:14:28 +01:00
Nikolaj GeisleandGitHub 58d6404ec8 V14: Reintroduce BackOfficeUserManagerAuditer (#17349)
* Reintroduce BackOfficeUserManagerAuditer

* Cleanup legacy code

* Notify user logout on logout
2025-01-09 21:14:24 +01:00
Nikolaj GeisleandJacob Overgaard 53a5813189 V15: Dont create invalid media (#17534)
* Don't allow create when there is validation errors

* Fix tests

* Add tests

* Fix last test

* Fix more tests

---------

Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>
2025-01-09 12:21:54 +01:00
Andy Butland 0166727eee Bumped version to 14.3.2. 2025-01-07 10:13:02 +01:00
Nikolaj GeisleandGitHub 77b6e6e6d9 override PerformGetAll (#17822) 2024-12-16 13:35:02 +01:00
Elitsa MarinovskaandGitHub 32d0cb477e V14: Adding the ability to conditionally serialize version bound properties for the Delivery API (#16731)
* Property level versioning for the Delivery API using a custom System.Text.Json resolver

* Adding a converter base class that custom converters can implement

* Revert resolver

* Use IHttpContextAccessor for the API version

* Fix attribute and checks in ShouldIncludeProperty

* Fix enumeration

* Fix comment

* Unit tests

* Refactoring

* Remove Assert.Multiple where no needed
2024-12-16 11:34:55 +01:00
Nikolaj GeisleandElitsa d451390d78 V13: Clear username cache (#17815)
* Clear member username cache on delete

* Also refresh cache on update
2024-12-16 09:56:54 +02:00
Bjarke BergandGitHub cb88cbba43 Merge pull request #17761 from umbraco/v14/task/media-picker-min-max-validation
V14 min/max validator for mediapicker
2024-12-13 08:28:13 +01:00
Nhu DinhandGitHub e9758321ce V14 Added Content tests with Approved Color (#16725)
* Added Content tests with Approved Color

* Bumped version of test helper

* Make Content tests run in the pipeline

* Using custom datatype builder instead of changing the default approved color data type

* Updated variables

* Fixed comment

* Make all Content tests run in the pipeline

* Reverted
2024-12-10 14:52:46 +07:00
Nikolaj GeisleandGitHub 82e58eae3e V14: cherry pick #17656 (#17763)
* V15: Fix webhook RTE serialization (#17656)

* Make base type resolver class

* Add new webhook serializer

* fix comment

* Update src/Umbraco.Infrastructure/Serialization/ContentJsonTypeResolverBase.cs

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

* Update src/Umbraco.Core/Services/WebhookRequestService.cs

---------

Co-authored-by: Elitsa <elm@umbraco.dk>
Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com>
(cherry picked from commit 6f081785e6)

* Add back missing usings
2024-12-09 16:09:54 +01:00
Sven Geusens de78560343 Fix unit test mocks 2024-12-09 15:08:22 +01:00
Sven Geusens f569553d79 Added min/max validator for mediapicker3 2024-12-09 14:26:14 +01:00
f048cfe62d v14: DecimalConverter - add check for integer (#17679)
* Add check for integer

* Fix typo

---------

Co-authored-by: Elitsa <elm@umbraco.dk>
2024-12-04 15:18:12 +01:00
Nikolaj GeisleandElitsa 9cab0e8bb1 Add content to TreeAccessTemplate (#17694) 2024-12-04 11:08:57 +01:00
21e3518a69 Fix copy document with descendants onto self (#17661)
* Filter self out of descedants for self onto self copy

* Optimized code

---------

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2024-12-01 13:02:47 +01:00
Sven Geusens 28756d449b Rectify v13 in v14 merge 2024-11-27 14:35:22 +01:00
Sven Geusens 38a96db369 Merge branch 'v13/dev' into v14/dev
# Conflicts:
#	src/Umbraco.Cms.Imaging.ImageSharp/ConfigureImageSharpMiddlewareOptions.cs
#	src/Umbraco.Core/Models/AuditItem.cs
#	src/Umbraco.Core/Routing/UmbracoRequestPaths.cs
#	src/Umbraco.Core/Services/ContentService.cs
#	src/Umbraco.Infrastructure/Persistence/Repositories/Implement/AuditRepository.cs
#	src/Umbraco.Infrastructure/Persistence/Repositories/Implement/MediaRepository.cs
#	src/Umbraco.Web.BackOffice/Controllers/ContentController.cs
#	src/Umbraco.Web.UI.Client/package-lock.json
#	src/Umbraco.Web.UI.Client/package.json
#	src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js
#	src/Umbraco.Web.UI.Client/src/common/directives/components/content/umbtabbedcontent.directive.js
#	src/Umbraco.Web.UI.Client/src/common/directives/components/media/umbmedianodeinfo.directive.js
#	src/Umbraco.Web.UI.Client/src/common/directives/components/upload/umbfiledropzone.directive.js
#	src/Umbraco.Web.UI.Client/src/common/services/mediahelper.service.js
#	src/Umbraco.Web.UI.Client/src/common/services/rte-blockeditor-clipboard.service.js
#	src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js
#	src/Umbraco.Web.UI.Client/src/common/services/user.service.js
#	src/Umbraco.Web.UI.Client/src/less/components/umb-media-grid.less
#	src/Umbraco.Web.UI.Client/src/views/components/media/umbimagepreview/umb-image-preview.html
#	src/Umbraco.Web.UI.Client/src/views/components/media/umbimagepreview/umbimagepreview.controller.js
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.controller.js
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.component.js
#	src/Umbraco.Web.UI.Client/src/views/templates/edit.html
#	src/Umbraco.Web.UI.Client~HEAD
#	src/Umbraco.Web.UI.Login/package-lock.json
#	src/Umbraco.Web.UI.Login/package.json
#	src/Umbraco.Web.UI.Login/src/auth.element.ts
#	src/Umbraco.Web.UI.Login/src/components/pages/login.page.element.ts
#	src/Umbraco.Web.UI.Login/src/index.ts
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Login/login.spec.ts
#	tests/Umbraco.Tests.UnitTests/Umbraco.Core/Routing/UmbracoRequestPathsTests.cs
2024-11-27 14:04:41 +01:00
Nikolaj Geisle 772c523a23 Validate email for member models (#17532)
* Validate email for member models

* Add null check or more test cases

* return invalid when not a valid email

* Cleanup

* remove private method in favor of extension

* Remove non used, using statement

---------

Co-authored-by: Elitsa <elm@umbraco.dk>
(cherry picked from commit 6b0f8e7b7c)
2024-11-25 13:56:45 +01:00
1e9182cfa4 V14: Use decimal in slider property editor (#17568)
* Allow SliderPropertyEditor to use decimals

* Add tests

* Boyscout unittest update

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
2024-11-19 11:14:53 +01:00
Andreas ZerbstandGitHub 33eb4dd5a4 V14 QA updated playwright config (#17544)
* Only run windows SQL Server

* Updated timeout and retry count

* Updated condition

* Fixed indentation

* Skipped
2024-11-18 08:30:50 +01:00
Bjarke Berg d7b98a2f00 Use catch all for urls what ends with a path (#17468)
(cherry picked from commit 3c0f7a03ba)
2024-11-14 12:29:40 +01:00
Sven Geusensandnikolajlauridsen 9edd21a3b0 Made some membertype endpoints available for member related actions (#17440)
Co-authored-by: nikolajlauridsen <nikolajlauridsen@protonmail.ch>
2024-11-13 13:47:37 +01:00
Andreas ZerbstandGitHub 7010ff1d26 V14 QA added rich text editor with stylesheet test (#17449)
* Rte tests

* Cleaned up

* Bumped version

* Added ensure not exists
2024-11-11 10:47:41 +01:00
Andreas ZerbstandGitHub 6acdf21eab V14 QA user groups permissions tests (#17429)
* Added tests for userGroup

* Clean up

* Updated userGroup tests

* Updated tests

* Updated tests

* Cleane up

* Cleaned up

* Bumped versions

* Run user tests

* Cleaned up

* Added permission tests

* Added tests, not done

* Updated tests

* Fixed tests

* Cleaned up

* Bumped version

* More cleanup

* Run user tests

* Added wait

* Added tests and cleaned up naming

* Bumped versions

* Reverted smokeTest command
2024-11-11 09:45:22 +01:00
Andreas ZerbstandGitHub a5479bc96e V14 QA members section user tests (#17448)
* Added tests for the members

* Cleaned up tests

* Bumped version

* Removed skip
2024-11-11 09:43:57 +01:00
Sven Geusensandnikolajlauridsen 0acdd26850 Made some stylesheet endpoints available for document/media/member related actions (#17442) 2024-11-08 12:19:10 +01:00
Nhu DinhandGitHub 2d027ce9a1 V14 QA Added acceptance tests for rendering content with content picker (#17378)
* Added tests for rendering content with content picker

* Bumped version

* Make all the tests for rendering content run in the pipeline

* Reverted
2024-11-06 16:09:37 +07:00
Andreas ZerbstandGitHub b1d9085c83 V14 QA Added user groups acceptance tests (#17344)
* Added tests for userGroup

* Clean up

* Updated userGroup tests

* Updated tests

* Updated tests

* Cleane up

* Cleaned up

* Bumped versions

* Run user tests

* Cleaned up

* Added method for checking if the document tree is empty

* Bumped version

* Reverted
2024-10-28 11:11:28 +01:00
Nhu DinhandGitHub 41da2e2cf3 V14 Added acceptance tests for the List View Media and custom data type in Content section (#17025)
* Added Content tests with custom data type

* Added tests for List View Media data type in Media section

* Updated method name due to api helper changes

* Updated the assertion of Content tests with custom data type

* Bumped version of test helper

* Make all Content tests run in the pipeline

* Skipped test for code editor as it is removed

* Fixed comment

* Make Media tests running in the pipeline

* Bumped version

* Updated code due to ui helper changes

* Bumped version of test helper

* Updated tests for bulk trash in the media section

* Fixed notification message

* Make Content tests and Media tests run in the pipeline

* Added more waits

* Reverted
2024-10-28 10:53:33 +07:00
Nhu DinhandGitHub 76fcf19b15 V14 QA Added acceptance tests for rendering content with Dropdown, Radiobutton and ImageCropper (#17357)
* Added tests for rendering content with numeric

* Added tests for rendering content with textarea

* Added tests for rendering content with approved color

* Added tests for rendering content with numeric

* Added tests for rendering content with tags

* Added tests for rendering content with textarea

* Updated tests for rendering content with textstring due to test helper changes

* Added tests for rendering content with truefalse

* Bumped version of test helper

* Make all tests for rendering content run in the pipeline

* Fixed comments

* Removed blank lines

* Fixed name

* Make all smoke tests run in the pipeline

* Added tests for rendering content with dropdown

* Added tests for rendering content with Image Cropper - not done

* Updated tests for rendering content due to ui helper changes

* Updated tests for rendering content with image cropper

* Updated tests due to the api helper changes

* Bumped version of test helper

* Make all the tests for rendering content run in the pipeline

* Removed blank lines

* Format code

* Fixed test name

* Reverted
2024-10-25 18:19:53 +07:00
Nhu DinhandGitHub 11ccafeb97 V14 QA Added tests for rendering content with checkboxlist and date picker (#17332)
* Added tests for rendering content with numeric

* Added tests for rendering content with textarea

* Added tests for rendering content with approved color

* Added tests for rendering content with numeric

* Added tests for rendering content with tags

* Added tests for rendering content with textarea

* Updated tests for rendering content with textstring due to test helper changes

* Added tests for rendering content with truefalse

* Added tests for rendering content with checkbox list

* Added tests for rendering content with date picker - not done

* Updated tests for rendering content with date picker

* Updated tests for rendering content due to ui helper changes

* Bumped version

* Removed blank lines

* Make Rendering Content tests run in the pipeline

* Changed method name due to test helper changes

* Reverted
2024-10-25 15:16:28 +07:00
Nikolaj GeisleandGitHub aa9f194d76 Format sql statement (#17354) 2024-10-24 14:45:23 +02:00
Nikolaj GeisleandZeegaan 73d70ba9fc Swap to windows vm for build (#17348)
(cherry picked from commit 199a2f4619)
2024-10-24 09:47:59 +02:00
Zeegaan 6435ff0bb3 Merge remote-tracking branch 'origin/release/14.3' into v14/dev
# Conflicts:
#	version.json
2024-10-23 09:03:05 +02:00
Andreas ZerbstandGitHub 728dc89909 V14 QA Skip Users tests on Sqlite (#17330)
* Split sqlite test because we run into db locks

* Uses the new command
2024-10-22 13:12:42 +02:00
Nhu DinhandGitHub e36dc1f554 V14 QA Added the acceptance tests for rendering content with different value (#17293)
* Added tests for rendering content with numeric

* Added tests for rendering content with textarea

* Added tests for rendering content with approved color

* Added tests for rendering content with numeric

* Added tests for rendering content with tags

* Added tests for rendering content with textarea

* Updated tests for rendering content with textstring due to test helper changes

* Added tests for rendering content with truefalse

* Bumped version of test helper

* Make all tests for rendering content run in the pipeline

* Fixed comments

* Removed blank lines

* Fixed name

* Make all smoke tests run in the pipeline
2024-10-22 10:26:59 +07:00
Andreas ZerbstandAndreas Zerbst 6caf53ed2e Updated version of messagepack (#17321)
(cherry picked from commit 8a22672c7f)
(cherry picked from commit 6399f235f2)
2024-10-21 11:54:26 +02:00
Andreas ZerbstandAndreas Zerbst 6399f235f2 Updated version of messagepack (#17321)
(cherry picked from commit 8a22672c7f)
2024-10-21 11:17:50 +02:00
Bjarke BergandGitHub 4be183a20d Do not rely on NuCache to do key/id lookups (#17291)
* Fixes #17182

* Ensure wait-on is installed
2024-10-21 09:49:34 +02:00
Andreas ZerbstandGitHub ba1080541b Updated to string.empty (#17294) 2024-10-17 09:59:41 +02:00
Jacob Overgaard 1581eb61d3 V15: Rich Text Editor links do not work with query strings and anchors (#17288)
* fix: anchors and query strings do not work

Since the change from UDIs to localLinks in href, the pattern matched a little too much in the href section completely ignoring any "extras" such as querystrings and anchors after the locallink, which meant that the locallink did not get replaced at all if they were present. This is fixed by limiting the regexp a bit.

* fix: legacy links do not follow the same regexp as new links

Because we are no longer matching the whole `href` attribute but only some of its contents, we need to fix up the old pattern. It has been extended with matching groups that follow the same pattern as the new links.

* feat: allow a-tags to be multiline

example:

```html
<a
  type="document"
  href="/{localLink:<GUID>}">
Test
</a>
```

* fix: split regex into two parts: first a tokenizer for a-tags and then a type-finder

* fix: ensure only "document" and "media" are matching to speed up the pattern

* feat: allow a-tags to be multiline

(cherry picked from commit 35e8f2e460)
2024-10-17 09:06:48 +02:00
Andreas ZerbstandGitHub 2b3a91757d V14 QA added user permission tests (#17226)
* Added test

* Small changes

* Added content start node tests

* Added media start node tests

* Cleaned up

* More updates

* Cleaned up

* Added wait

* Cleaned up

* Bumped helpers

* Updated to run user tests

* Fixed user tests

* Bumped helpers

* Added missing semicolon

* Fixes based on comments

* Run smoke tests
2024-10-16 13:26:36 +02:00
Andreas ZerbstandGitHub 00563013b6 V14 QA Updated package E2E tests (#17236)
* Updated tests

* Cleaned package tests

* Updated package test file

* Bumped version

* Added missing semicolons

* Run all smoke tests

* Run smoke tests
2024-10-16 12:46:24 +02:00
Ronald BarendseandBjarke Berg 378d4ecfef Fix ContentStore locking exceptions in async code (#17246)
* Add ContentCache test

* Use SemaphoreSlim as write lock

* Apply lock imrpovements to SnapDictionary

* Obsolete unused MonitorLock

(cherry picked from commit c3db3457e7)
2024-10-16 12:34:44 +02:00
Andreas ZerbstandBjarke Berg a497f3f4dd Updated nuget package (#17286)
(cherry picked from commit 5183391a86)
2024-10-16 12:24:31 +02:00
Andreas ZerbstandGitHub 5183391a86 Updated nuget package (#17286) 2024-10-16 10:07:25 +02:00
Nhu DinhandGitHub 0551976126 V14 QA Added acceptance tests for notification message (#17195)
* Updated step to verify the notification message

* Added tests for notification message

* Bumped version

* Updated expected notification message

* Bumped version
2024-10-14 13:26:55 +07:00
Nhu DinhandGitHub da2a4d1713 V14 QA Added the acceptance tests for rendering content with textstring (#17247)
* Added tests for textstring in the rendered content

* Updated tests for rendering content with textstring

* Added tests for rendering content with numeric

* Added tests for rendering content with textarea

* Removed tests

* Bumped version

* Make all tests for rendering content run in the pipeline

* Make all smoke tests run in the pipeline
2024-10-14 11:57:52 +07:00
Nhu DinhandGitHub 9f5867bdf8 V14 QA Fixing the failing acceptance tests in the pipeline v14 (#17214)
* Added more waits

* Updated assert steps

* Fixed api method name

* Added more waits to avoid the failing test in window

* Updated tests due to business changes

* Added more waits to avoid the failing tests in window

* Updated test due to Ui changes

* Bumped version

* Bumped version of test helper

* Bumped version
2024-10-11 12:15:49 +02:00
Jacob Overgaard ed63b51e46 update backoffice submodule 2024-10-07 15:46:21 +02:00
Jacob Overgaard ea608cc630 update backoffice submodule 2024-10-07 15:46:06 +02:00
Jacob Overgaard 4cfe498628 update backoffice submodule 2024-10-07 13:45:04 +02:00
Jacob Overgaard 42912dd5c9 update backoffice submodule 2024-10-07 13:44:18 +02:00
Nikolaj Geisle 865787db1d Bump version.json 2024-10-07 11:48:41 +02:00
Bjarke Berg c58a7b7b23 Merge remote-tracking branch 'origin/release/14.3' into v14/dev 2024-10-03 07:50:18 +02:00
Bjarke Berg 32c00f9a09 Merge remote-tracking branch 'origin/release/14.3' into release/14.3 2024-10-01 17:40:35 +02:00
Bjarke Berg 348f1f2bae Change webhook permissions to require webhook tree access for all endpoints 2024-10-01 07:58:41 +02:00
Jacob Overgaard 73c8d8e0f9 Merge remote-tracking branch 'origin/release/14.3' into release/14.3 2024-09-30 10:24:17 +02:00
Jacob Overgaard 2d7c00f27f update backoffice submodule 2024-09-30 10:24:03 +02:00
Andreas ZerbstandGitHub 4fae91d55c V14 QA added content tests with list view content (#17115)
* Added tests for List view

* More tests

* Added rest of test

* Bumped version

* Fixed failing tests

* Added tests and fixed comments

* Cleaned up tests

* Bumped testhelpers

* Bumped again

* Set condition to only run sql server when enabled

* Run all content test

* Reverted changes
2024-09-27 17:32:44 +02:00
Sebastiaan Janssen 6c08f69801 Merge branch 'contrib' into v14/dev 2024-09-27 09:04:32 +02:00
Sebastiaan Janssen 910fb4062b Merge branch 'v14/dev' into contrib 2024-09-27 08:54:49 +02:00
Bjarke Berg f2e4e44db1 Merge remote-tracking branch 'origin/release/14.3' into v14/dev 2024-09-27 07:47:59 +02:00
Bjarke Berg d57d12d54d Fixed imagesharp 2 also 2024-09-27 07:43:12 +02:00
NguyenThuyLanandBjarke Berg 46604909be Fix error format code (#17146)
* update ImageSharpMiddlewareOption for fixing invalid width and height (#17126)

Co-authored-by: Lan Nguyen Thuy <lnt@umbraco.dk>

* Fix issue format parameters

---------

Co-authored-by: Lan Nguyen Thuy <lnt@umbraco.dk>

(cherry picked from commit 9a12eea495)
2024-09-27 07:42:30 +02:00
9a12eea495 Fix error format code (#17146)
* update ImageSharpMiddlewareOption for fixing invalid width and height (#17126)

Co-authored-by: Lan Nguyen Thuy <lnt@umbraco.dk>

* Fix issue format parameters

---------

Co-authored-by: Lan Nguyen Thuy <lnt@umbraco.dk>
2024-09-27 07:41:55 +02:00
NguyenThuyLanandBjarke Berg 762d72b018 update ImageSharpMiddlewareOption for fixing invalid width and height (#17126)
Co-authored-by: Lan Nguyen Thuy <lnt@umbraco.dk>
(cherry picked from commit 9b19d63a6a)
2024-09-27 07:40:42 +02:00
Nhu DinhandGitHub 45f43a6b7a V14 Added Content tests with different document types properties (#17131)
* Added tests for Allow At Root property

* Added Content tests for Allowed Child Nodes property

* Added Content tests for the Allow at root property

* Added Content tests for the Allowed child node property

* Added Content tests for the Collection property

* Added Content tests with allow vary by culture

* Added more waits

* Updated tests due to api helper changes

* Added Content tests with allowed templates

* Bumped version of test helper

* Updated code due to api helper changes

* Fixed naming
2024-09-27 10:36:15 +07:00
Jacob Overgaard c9c9374de1 update backoffice submodule 2024-09-26 14:39:12 +02:00
Jacob Overgaard 6bd558c016 update backoffice submodule 2024-09-26 14:38:27 +02:00
Bjarke Berg f1cddd91c6 Missing context complete
(cherry picked from commit fdb9cfa3e7)
2024-09-26 09:55:19 +02:00
Bjarke Berg fdb9cfa3e7 Missing context complete 2024-09-26 09:54:43 +02:00
Bjarke Berg 009394982c Merge remote-tracking branch 'origin/release/14.3' into v14/dev 2024-09-26 08:54:19 +02:00
Jacob Overgaard a43db4ff05 update backoffice submodule 2024-09-26 08:52:40 +02:00
Jacob Overgaard 8c4780380d update backoffice submodule 2024-09-26 08:51:36 +02:00
Kenn JacobsenandBjarke Berg d3a67fe4e0 Move all V14 User and User Group migration to pre-migrations (#17130)
(cherry picked from commit 910d70302e)
2024-09-26 08:45:37 +02:00
Kenn JacobsenandGitHub 910d70302e Move all V14 User and User Group migration to pre-migrations (#17130) 2024-09-26 08:45:08 +02:00
Ronald BarendseandBjarke Berg 0c1daa290b Add RemoveDefault() extension method to fluent API for CMS webhook events (#15424)
* Add RemoveDefault extension method

* Move default webhook event types to single list

(cherry picked from commit 8f26263178)
2024-09-26 07:53:54 +02:00
Ronald BarendseandGitHub 8f26263178 Add RemoveDefault() extension method to fluent API for CMS webhook events (#15424)
* Add RemoveDefault extension method

* Move default webhook event types to single list
2024-09-26 07:52:39 +02:00
Ronald BarendseandBjarke Berg 635d9b83f9 Use version of the assembly with the same name as the package ID (#16544)
(cherry picked from commit 14a0e62278)
2024-09-26 07:51:35 +02:00
Ronald BarendseandGitHub 14a0e62278 Use version of the assembly with the same name as the package ID (#16544) 2024-09-26 07:51:16 +02:00
Ronald BarendseandBjarke Berg a76af1de9d Fix IContentBase.GetUdi() extension method to support document-blueprint entity type (#16939)
* Add tests for all UDI entity types

* Fix IContentBase UDI entity type for blueprints

* Remove redundant switch statements and reorder methods

(cherry picked from commit 609b5f76d4)
2024-09-26 07:48:10 +02:00
Ronald BarendseandGitHub 609b5f76d4 Fix IContentBase.GetUdi() extension method to support document-blueprint entity type (#16939)
* Add tests for all UDI entity types

* Fix IContentBase UDI entity type for blueprints

* Remove redundant switch statements and reorder methods
2024-09-26 07:47:33 +02:00
Andreas ZerbstandGitHub e4dacf5c8c V14 QA fixed E2E tests for SQL server (#17122)
* Updated version of test helpers

* Added option to run smoke tests

* Found the issue

* Fixed pipeline

* Removed duplicate file creation

* Removed

* Always run sql server tests

* Removed unused parameter

* Enables sqlServer E2E to run on pipeline

* Removed comment
2024-09-25 07:04:12 +02:00
dependabot[bot]andJacob Overgaard 99125ef5cc Bump rollup from 4.21.3 to 4.22.4 in /src/Umbraco.Web.UI.Login
Bumps [rollup](https://github.com/rollup/rollup) from 4.21.3 to 4.22.4.
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollup/rollup/compare/v4.21.3...v4.22.4)

---
updated-dependencies:
- dependency-name: rollup
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-24 14:43:07 +02:00
Jacob Overgaard 264fbb6987 update backoffice submodule 2024-09-24 14:34:00 +02:00
Emma L GarlandandGitHub ac575662ac Resolved more warnings, and marked more warning types as errors (#16991)
* Fix warnings SA1111, SA1028, SA1500, IDE1270  in Umbraco.Web.Website, and updated rules.

* Remove warnings: IDE0270: Null check can be simplified

* More SqlServer project warnings resolved

* CS0105 namespace appeared already

* Suppress warning until implementation:

#pragma warning disable CS0162 // Unreachable code detected
#pragma warning disable CS0618 // Type or member is obsolete

CS0162 remove unreachable code
SA1028 remove trailing whitespace
SA1106 no empty statements
CS1570 malformed XML
CS1572 corrected xml parameter
CS1573 param tag added
IDE0007 var not explicit
IDE0008 explicit not var
IDE0057 simplify substring
IDE0074 compound assignment
CA1825 array.empty

Down to 3479 warnings

* - SA1116, SA117 params on same line
- IDE0057 substring simplified

Specific warnings for Umbraco.Tests.Benchmarks

* Fixed IDE0074 compound assignment and added specific warnings for Umbraco.Tests.Common

* Specific warnings for Umbraco.Tests.Integration and Umbraco.Tests.Common

Fixed:

- SA1111, SA1116, SA117 params and line formatting (not all as there are many)
- SA1122 string.Empty
- IDE0057 simplify substring
- IDE0044,IDE0044 make field readonly
- IDE1006 naming rule violation (add _)
- SA1111 closing parenthesis on line of last parameter
- SA1649 filename match type name
- SA1312,SA1306 lowercase variable and field names

* Fixed various warnings where they are more straight-forward, including:

- SA1649 file name match type name
- SA111 parenthesis on line of last parameter
- IDE0028 simplify collection initializer
- SA1306 lower-case letter field
- IDE044 readonly field
- SA1122 string.Empty
- SA1116 params same line
- IDE1006 upper casing
- IDE0041 simplify null check

Updated the following projects to only list their remaining specific warning codes:

- Umbraco.Tests.UnitTests

Typo in `Umbraco.Web.Website` project

* Reverted test change

* Now 1556 warnings.

Fixed various warnings where they are more straight-forward, including:

- SA1111/SA1116/SA1119 parenthesis
- SA1117 params
- SA1312 lowercase variable
- SA1121 built-in type
- SA1500/SA1513/SA1503 formatting braces
- SA1400 declare access modifier
- SA1122 string.Empty
- SA1310 no underscore
- IDE0049 name simplified
- IDE0057 simplify substring
- IDE0074 compound assignment
- IDE0032 use auto-property
- IDE0037 simplify member name
- IDE0008 explicit type not var
- IDE0016/IDE0270/IDE0041 simplify null checks
- IDE0048/SA1407 clarity in arithmetic
- IDE1006 correct param names
- IDE0042 deconstruct variable
- IDE0044 readonly
- IDE0018 inline variable declarations
- IDE0074/IDE0054 compound assignment
- IDE1006 naming
- CS1573 param XML
- CS0168 unused variable

Comment formatting in project files for consistency.

Updated all projects to only list remaining specific warning codes as warnings instead of errors (errors is now default).

* Type not var, and more warning exceptions

* Tweaked merge issue, readded comment about rollback

* Readded comment re rollback.

* Readded comments

* Comment tweak

* Comment tweak
2024-09-24 12:56:28 +01:00
Andreas ZerbstandAndreas Zerbst e92b4f3172 V15 QA Enabled Nightly E2E Pipeline to run on V15 (#17103)
* Uncommented

* Added timeout

(cherry picked from commit 142db8c0fb)
2024-09-23 14:00:32 +02:00
Jacob Overgaard c70c8d86f9 update backoffice submodule 2024-09-23 09:58:52 +02:00
Bjarke Berg e733ec1717 Merge remote-tracking branch 'origin/release/14.3' into v14/dev 2024-09-18 13:48:55 +02:00
Bjarke Berg fa7b81474c Bump version to 14.3.0 2024-09-18 13:48:23 +02:00
Bjarke Berg 753aa6f9db Fixed version 2024-09-18 13:46:05 +02:00
Bjarke Berg 59aac9053f Bump version 2024-09-18 13:17:16 +02:00
Bjarke Berg 234c2673f6 Allow the client to send all content, with all languages, even when the user do not have permissions to save a specific language. (#17052)
(cherry picked from commit c5243e562e)
2024-09-18 13:16:25 +02:00
Bjarke Berg d2d6d3493f Revert "Bump version"
This reverts commit f8e26f5ba1.
2024-09-18 13:15:59 +02:00
Bjarke BergandGitHub c5243e562e Allow the client to send all content, with all languages, even when the user do not have permissions to save a specific language. (#17052) 2024-09-18 13:10:15 +02:00
Bjarke Berg 5c857aa97d Bump version 2024-09-18 12:57:05 +02:00
Bjarke Berg f8e26f5ba1 Bump version 2024-09-18 12:56:19 +02:00
Bjarke Berg 47d843f424 Merge remote-tracking branch 'refs/remotes/origin/contrib' into v14/dev
# Conflicts:
#	tests/Umbraco.Tests.AcceptanceTest/package-lock.json
2024-09-18 11:05:15 +02:00
dependabot[bot]andJacob Overgaard c8899afed6 Bump vite from 5.3.1 to 5.4.6 in /src/Umbraco.Web.UI.Login
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.3.1 to 5.4.6.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v5.4.6/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.4.6/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-18 10:31:40 +02:00
Jacob Overgaard 939b2aaa3d update backoffice submodule to 14.3 release branch 2024-09-18 09:45:21 +02:00
f72c39ef59 V14: Fix templates not having set master template on package install (#16978)
* Reorder templates to save master templates first, and use new ITemplateService

* Add obsoletion

* Fix if statement

* Refactor async calls into async method to avoid multiple get awaiters

* Update interface

* Avoid breaking changes

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2024-09-17 14:43:05 +02:00
MoleandGitHub 991b9a791e Updaet template to reference 13.5 (#17063) 2024-09-17 14:42:25 +02:00
Bjarke BergandGitHub 920591bcd1 Updated the assembly names to avoid a debug-warning in the log (#16997) 2024-09-17 14:41:29 +02:00
Andreas ZerbstandGitHub 66aeafe797 V14 QA Content with upload video (#17066)
* Added tests for upload video in content

* Added ogv file

* Added ogv to test

* Reverted smokeTest command
2024-09-17 12:13:35 +02:00
Andreas ZerbstandGitHub f32d40a35e V14 QA Content with vector graphics (#17065)
* Added tests for Upload vector graphics

* Run all content tests

* Fixed indentation

* Reverted smokeTest string
2024-09-17 12:13:10 +02:00
Jacob Overgaard 625366f82b update backoffice submodule 2024-09-17 11:46:51 +02:00
Jacob Overgaard 8ebc44f959 update OpenApi.json 2024-09-17 11:01:30 +02:00
Kenn JacobsenandJacob Overgaard e6f379034f Add notification alias to document notifications endpoint output (#17028) 2024-09-17 10:59:33 +02:00
Andreas ZerbstandGitHub d12dedb526 V14 QA update fetch depth (#17068)
* Removed fetch depth

* Added fetch depth 0
2024-09-17 10:16:29 +07:00
Bjarke BergandGitHub 017209c5ba Updated nuget packages (#17062) 2024-09-16 12:15:36 +02:00
Andreas ZerbstandGitHub 48e4cdaa88 V14 QA new E2E test pipeline (#17064)
* Added E2E pipeline

* Set up CI with Azure Pipelines

[skip ci]

* Update nightly-E2E-test-pipelines.yml for Azure Pipelines

* Updated solution file

* Added fetch depth

* Update nightly-E2E-test-pipelines.yml for Azure Pipelines

* Added a step for installing wait-on

* Added runSqlServerE2ETests

* Update nightly-E2E-test-pipelines.yml for Azure Pipelines

* Update nightly-E2E-test-pipelines.yml for Azure Pipelines

* Updated pipeline so we only run smoke

* Update nightly-E2E-test-pipelines.yml for Azure Pipelines

* Update nightly-E2E-test-pipelines.yml for Azure Pipelines

* Removed pipeline
2024-09-16 10:13:26 +02:00
Jacob Overgaard ce379bc153 update backoffice submodule 2024-09-13 13:54:43 +02:00
Bjarke Berg 26bf04c085 Merge remote-tracking branch 'origin/v13/dev' into v14/dev 2024-09-13 08:12:23 +02:00
Andreas ZerbstandGitHub a96a304860 V14 Fix E2E tests (#17011)
* Fixed tests

* Fixed tests

* Added timeout

* Fixed rest of the failing tests

* Bumped version

* Added timeout

* Bumped version of helpers

* Added parameter

* Applied fixes for tests and did some skips

* Small changes

* Bumped version

* Fixed comments
2024-09-12 11:04:12 +02:00
Kenn JacobsenandGitHub 3d3f6b5021 Add endpoint for upgrade checks (#17026)
* Fix upgrade check repo, so it's able to check more than once :)

* Add VersionCheckPeriod to server configuration output

* Add upgrade check endpoint

* Obsolete unused response model

* Update OpenAPI JSON
2024-09-11 17:08:50 +02:00
Jacob Overgaard 78aaafedc7 update backoffice submodule 2024-09-11 07:53:34 +02:00
Emma L GarlandandGitHub 862820c6a6 Resolved more warnings, and marked more warning types as errors (#16990)
* Fix warnings SA1111, SA1028, SA1500, IDE1270  in Umbraco.Web.Website, and updated rules.

* Remove warnings: IDE0270: Null check can be simplified

* More SqlServer project warnings resolved

* CS0105 namespace appeared already

* Suppress warning until implementation:

#pragma warning disable CS0162 // Unreachable code detected
#pragma warning disable CS0618 // Type or member is obsolete

CS0162 remove unreachable code
SA1028 remove trailing whitespace
SA1106 no empty statements
CS1570 malformed XML
CS1572 corrected xml parameter
CS1573 param tag added
IDE0007 var not explicit
IDE0008 explicit not var
IDE0057 simplify substring
IDE0074 compound assignment
CA1825 array.empty

Down to 3479 warnings
2024-09-10 15:17:29 +01:00
Jacob Overgaard a30827145c update backoffice submodule 2024-09-09 16:01:25 +02:00
kasparboelkjeldsenandGitHub 3d5e70654b ModelsGenerator to IModelsGenerator in BuildModelsBuilderController (#16919)
* ModelsGenerator to IModelsGenerator in BuildModelsBuilderController

* Added obsolete constructors for backwards compatibility
2024-09-09 08:06:52 +02:00
marwaldvandMatthew-Wise 7acce83c83 Update LogDto.cs
fix: issue resolved, where content saving breaks due to saving to umbracoLog with error message like that: String or binary data would be truncated in table 'dto.umbracoLog', column 'parameters'. Truncated value: 'English (United States), German (Switzerland), French (France), Italian (Italy), Arabic (Iraq), Pers'...
2024-09-05 14:55:35 +02:00
Bjarke Berg 3b3c9c57ca Merge remote-tracking branch 'refs/remotes/origin/v13/dev' into v14/dev 2024-09-04 14:20:43 +02:00
087a01de83 V14/fix/cookie breaking installer (#16993)
* Do not run authentication if Umbraco is not ready for it. Fail instead.

* Fix breaking change

* Spelling + code style :)

---------

Co-authored-by: kjac <kja@umbraco.dk>
2024-09-03 11:05:22 +02:00
Jacob Overgaard 9321774613 Merge branch 'v14/dev' of github.com:umbraco/Umbraco-CMS into v14/dev 2024-08-29 11:38:35 +02:00
Jacob Overgaard 590b28110b update backoffice submodule 2024-08-29 11:38:24 +02:00
c277005b62 improve missingProperties data returned for missing propertie values (#16910)
Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
2024-08-29 10:12:43 +02:00
Andreas ZerbstandGitHub 6851113cf1 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
2024-08-29 08:47:24 +02:00
98e9a300bc Treat warnings as errors for initial projects (#15019)
* Treat warnings as errors for Umbraco.Cms, Umbraco.Cms.Api.Common and Umbraco.Cms.Api.Delivery projects.

* Treat warnings as errors for Umbraco.Cms.Imaging.ImageSharp and Umbraco.Cms.Imaging.ImageSharp2 projects

* Treat warnings as errors for Umbraco.Cms.Persistence.EFCore.Sqlite, Umbraco.Cms.Persistence.EFCore.SqlServer and Umbraco.Cms.StaticAssets

* Treat warnings as errors for Umbraco.Cms.Targets

* Treat warnings as errors for templates/Umbraco.Templates and Umbraco.JsonSchema

* More projects with warnings as errors.

* Reverted warnings as errors due to some file changes since the update.

* Remove unwanted tag

* Removed warnings as errors on TestData project

* Implement warnings as errors in props file, and exclude specific warnings where appropriate as per PR review suggestions.

* Reverted spaces

* Revert "Reverted spaces"

This reverts commit 3734c45e22.

* Update sdk version to fully support Umbraco.code 2.2.0 dependency on Microsoft.CodeAnalysis.CSharp.Workspaces 4.10.0

* Ignore PathToLongErrors for now in static assets

---------

Co-authored-by: Emma Garland <emma.garland@rocksolidknowledge.com>
Co-authored-by: Sven Geusens <sge@umbraco.dk>
2024-08-27 18:56:09 +02:00
Sven GeusensandGitHub 95f08e748e Update sdk version to fully support Umbraco.code 2.2.0 dependency on Microsoft.CodeAnalysis.CSharp.Workspaces 4.10.0 (#16963) 2024-08-27 18:55:42 +02:00
Jacob OvergaardandGitHub 04d96c6a94 fix: appEntryPoint types are not executed unless we have the UmbappEntryPointExtensionInitializer running (#16967) 2024-08-27 16:07:50 +01:00
Sven GeusensandGitHub 27108036b4 Support parentId in document/media item search endpoints (#16933)
* Updated search services to start searching from a guid based key.

* Solved api breaking changes with new minor version

* Ordering and formatting

* Changed interface default implementation to the new method...

* Consolidated version

* PR review cleanup and renaming
2024-08-27 15:18:25 +02:00
148d51bf8c Remove warnings from Umbraco.Web.UI (#16958)
* Fixed warning SA1119 for Umbraco.Web.UI project (unnecessary parenthesis)

* Remove parenthesis (startup no longer exists)

---------

Co-authored-by: Emma Garland <emma.garland@rocksolidknowledge.com>
2024-08-27 11:29:02 +01:00
Andreas ZerbstandGitHub 3f8bae1a29 V14 QA added Block grid acceptance tests (#16908)
* Added blockgrid tests

* Additional tests

* Added more tets

* Split tests

* Block updates

* Bumped version

* Added block tests

* Fixes, not done

* Fixed

* Updated helper

* Bumped version

* Bumped helpers

* Fixed conflicts

* Removed page

* Removed page

* Bumped

* Reverted to run smoke tests
2024-08-27 10:36:44 +02:00
Nhu DinhandGitHub c5e5fa2dd1 V14 QA Added Content tests with various of data types (#16824)
* Added Content tests with content picker

* Removed the test for content picker

* Added Content tests with the default content picker

* Added more Content tests with Content Picker data type

* Added the Content tests with Dropdown

* Added Content tests with Image Cropper

* Updated upload file method due to test helper changes

* Added Content tests with Image Cropper

* Added Content tests with Image Cropper data type

* Added Content tests with Media Picker data type

* Updated Media tests due to ui helper changes

* Bumped version of test helper and json builder

* Make all Content tests run in pipeline - should remove it before merging

* Fixed the name of tests

* Updated the tests for Media Picker in Content section

* Added the Content tests with Multiple Media Picker

* Updated the Content test with Content Picker due to the test helper changes

* Bumped version of test helper

* Fixed the failing tests for Content

* Removed Image Cropper test in this branch

* Added more waits

* Added smoke tags

* Make smoke tests run in the pipeline

* Added Content tests for Image Cropper

* Added smoke tags to make all Image Cropper tests running in the pipeline

* Added Content tests with Member Picker

* Added Content tests with Multiple Image Media Picker

* Added Content tests with Numeric

* Bumped version of test helper

* Make all Content tests running in the pipeline

* Assert that the content is published

* Assert that the content is published

* Fixed code conflict

* Fixed comment and code conflict

* Make all Content tests run in the pipeline

* Refactor the Content tests with different data type

* Cleaned code

* Make the smoke tests run in the pipeline
2024-08-27 13:53:35 +07:00
MoleandGitHub a31e4265bd Improve dotnet templates (#16815)
* Add delivery api toggle

* Add Dockerfile

* add docker compose template

* Ensure no duplicate database containers

* Remove wwwroot/umbraco permission check

We don't need write access to this folder

* Provide environment variables from dokcer-compose

* Build as debug from compose

The compose file is intended to be used for local dev

* Don't store password in docker files

Still not great to store it in .env but it's fine for dev

* Add additional template files

* Add docker ignore file

* Enable delivery API in settings too

* Enable models builder mode toggle

* Add WIP for umbraco release option

* Add starterkit option

* Add option to chose LTS or latest

* Add development mode option

* Add descriptions

* Add display names

* Add backoffice development at explicit default

* Rearrange DevelopmentMode before ModelsBuilderMode

* Allow specifying a port for the compose file

* Add some notes

* Move starterkits into its own template

* Don't update version

* Remove test configuration from Dockerfile

* Add default modelsbuilder option

* Update descriptions

* overwrite default values in IDE development

* Remove obsolete runtime minification

* Try and fix healthcheck

* Don't use post action for starterkit

otherwise it won't work with Rider, also make the version 13.0.0 if LTS is chosen

* Move UmbracoVersion above FinalVersion

Otherwise, rider will use UmbracoVersion for some weird reason

* Fix healthcheck

* Use else instead of second if for modelsbuilder

* Obsolete UmbracoVersion

* Remove custom release option

* Use forward slashes for volumes

* Add MSSQL_SA_PASSWORD env variable

* Temporarily limit acceptance tests so it works

* Try again

* Disable SQLServer integration tests

* Set UseHttps to false in appsettings.Development.json

You still want to be able to use non-https when developing locally

* Fix LTS version

LTS still needs installer endpoints added

* Update permissions of wwwroot/umbraco for v13 sites

* Fix conditional in Program.cs

* Undo pipeline shenanigans
2024-08-26 11:21:02 +02:00
Terence BurridgeandEmma L Garland 385a5345b1 Update valid reasons not to have a template on a content node to include having a redirect field 2024-08-25 22:01:38 +01:00
Jason ElkinandMatthew-Wise 862e45eca3 Ignore Visual Studio's generated launchSettings file. 2024-08-25 15:31:51 +01:00
Nhu DinhandGitHub 17d441760d V14 QA Fixed the failing smoke tests (#16953)
* Updated api tests for Data type due to test helper changes

* Fixed Data Type tests due to test helper changes

* Updated the test for edit password due to ui helper changes

* Bumped version
2024-08-23 16:18:28 +07:00
Nhu DinhandGitHub 8eeac2774b V14 Added the Content tests with Upload Article, Upload Audio and Upload File data type (#16945)
* Added the test files for article

* Added Content tests with Upload Article datatype

* Added the audio test files

* Fix format

* Updated the Content tests with Upload Article

* Added Content tests with Upload Audio

* Added Content tests with Upload File

* Bumped version

* Make all Content tests run in the pipeline

* Cleaned code

* Make the smoke tests run in the pipeline
2024-08-23 15:17:30 +07:00
Nhu DinhandGitHub 405fd9724f V14 Added the Content tests with Textarea, Textstring, TrueFalse datatype (#16946)
* Added Contents test with Textarea

* Added Content tests with textstring

* Removed the tests for Textarea property editor

* Added Content tests for TrueFalse data type

* Bumped version of test helper

* Make all Content tests run in the pipeline

* Cleaned code

* Make the smoke tests run in the pipeline
2024-08-23 13:54:14 +07:00
dependabot[bot]andJason Elkin e8051978e9 Bump axios from 1.6.5 to 1.7.4 in /tests/Umbraco.Tests.AcceptanceTest
Bumps [axios](https://github.com/axios/axios) from 1.6.5 to 1.7.4.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v1.6.5...v1.7.4)

---
updated-dependencies:
- dependency-name: axios
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-22 20:49:13 +01:00
Sven Geusens 136753f0b0 Merge branch 'release/14.2' into v14/dev with correct version bump
# Conflicts:
#	version.json
2024-08-22 16:07:40 +02:00
Sven Geusens 1b21caa20a Update backoffice submodule with hotfix for breaking change that broke forms. 2024-08-22 12:14:43 +02:00
Nhu DinhandGitHub bbda1c8330 V14 Added Content tests with Multi URL picker (#16885)
* Added Content tests with Multi URL Picker

* Bumped version of test helper

* Make all Content tests run in the pipeline - remove it before merging

* Added goToSection step

* Fix comments

* Fix comments

* Fixed comments

* Make the smoke tests run in the pipeline
2024-08-22 16:00:35 +07:00
Nikolaj Geisle bf805a181a Bump version 2024-08-20 12:54:19 +02:00
Nikolaj Geisle 66592bfbcc Merge branch 'release/14.1' into release/14.2
# Conflicts:
#	version.json
2024-08-20 12:53:40 +02:00
Sven Geusens 1a69bc9d8b Merge branch 'v13/dev' into v14/dev
# Conflicts:
#	Directory.Packages.props
#	src/Umbraco.Core/EmbeddedResources/Lang/sv.xml
2024-08-20 11:25:31 +02:00
leekelleher 1ff3858a9e update backoffice submodule 2024-08-20 09:56:00 +01:00
Bjarke BergandNikolaj Geisle b76070c794 Merge commit from fork
* Use Debug Mode to determine content of the ProblemDetails

* Cache the debug value
2024-08-19 15:10:44 +02:00
Sven GeusensandNikolaj Geisle 72bef8861d Merge commit from fork 2024-08-19 15:10:24 +02:00
Bjarke BergandGitHub d0c76171dd Merge commit from fork
* Use Debug Mode to determine content of the ProblemDetails

* Cache the debug value
2024-08-19 15:05:02 +02:00
Sven GeusensandGitHub b0988e6136 Merge commit from fork 2024-08-19 15:04:08 +02:00
Nhu DinhandGitHub 20087c8e80 V14 Added the Content tests with Radiobox and Tags datatype (#16909)
* Added Content tests with Radiobox data type - not done

* Removed Content test with Tags property editor

* Added Content tests with Radiobox datatype

* Added Content tests with Tags data type

* Created content with data type via API

* Bumped version of test helper

* Make all Content tests run in the pipeline

* Make all smoke tests run in the pipeline
2024-08-19 13:54:55 +07:00
Matthew CareandGitHub 3b6fbf1a4c Cache a dictionary of dictionaries (#15908)
* Re-commit change

Re-commit change after merge

* Fix issues after merge

Update usings after merge

* Re-delete obsolete

Remove the obsolete method
2024-08-17 15:00:24 +01:00
Emanuel GustafzonandGitHub 9338395a59 Stripped username before login (#16921)
* Stripped username before login
2024-08-16 20:59:10 +01:00
Nikolaj Geisle a3ede67777 bump version 2024-08-16 09:29:03 +02:00
Sebastiaan Janssen 3560fc9848 Merge branch 'v14/dev' into contrib 2024-08-15 11:10:30 +02:00
Jason Elkin 80b8b2a4ed Issue-15712: MemberDefaultLockoutTimeInMinutes fix. 2024-08-15 09:51:27 +02:00
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
PeterGitHubKvyatkovsky, Petr <pkvyatkovsky@qulix.com>
3a9ef3810b Making method ExecuteAsync virtual. (#16496)
Co-authored-by: Kvyatkovsky, Petr <pkvyatkovsky@qulix.com>
2024-08-14 21:07:36 +01:00
Andreas ZerbstandGitHub 7a700f3029 V14 QA content image media picker tests (#16890)
* Started some tests for imageMediaPicker

* Added tests

* Added additional test

* Fixed based on updates to helpers

* Bumped versions

* Fixes based on comments

* Updated so we run all content test

* Cleaned
2024-08-14 21:05:09 +02:00
Nikolaj GeisleandGitHub de57523b4f Use browse instead of protect (#16907) 2024-08-14 10:03:35 +02:00
56b3f17355 V14: Don't duplicate audit loggin for media trashing (#16903)
* Remove auditlogging from media service

* Refactor to use backofficeSecurityaccessor to get backoffice user

* Fix constructor error

* Reinstate media service move

* Go back to audit type delete

---------

Co-authored-by: Elitsa <elm@umbraco.dk>
2024-08-13 12:29:29 +02:00
Nikolaj Geisle 66ccc92399 change version after merge 2024-08-13 08:57:26 +02:00
Nikolaj Geisle 8aee8a8bc9 Merge branch 'release/14.2' into v14/dev 2024-08-13 08:57:05 +02:00
Nikolaj Geisle a36535b354 bump version 2024-08-13 08:56:18 +02:00
Kenn JacobsenandNikolaj Geisle 79807999ee Add the default date-with-time configuration if missing (#16902) 2024-08-12 16:37:01 +02:00
Kenn JacobsenandGitHub 61a9386209 Add the default date-with-time configuration if missing (#16902) 2024-08-12 14:25:27 +02:00
Kenn JacobsenandZeegaan 506d3b3a9c Fix date conversion on the server-side (#16841)
(cherry picked from commit ceddf8681b)
2024-08-12 13:15:27 +02:00
Kenn JacobsenandGitHub ceddf8681b Fix date conversion on the server-side (#16841) 2024-08-12 12:41:37 +02:00
c288d038dd v14: TryGetUmbracouser default implementation (#16899)
* Add default implementation

* Update src/Umbraco.Core/Security/Authorization/IAuthorizationHelper.cs

Co-authored-by: Bjarke Berg <mail@bergmania.dk>

---------

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2024-08-12 12:38:28 +02:00
a235591521 Add Content-Security-Policy (CSP) health check (#16830)
* Add CSP Header Check

* Update src/Umbraco.Core/EmbeddedResources/Lang/en.xml

Co-authored-by: Laura Neto <12862535+lauraneto@users.noreply.github.com>

* Update src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml

Co-authored-by: Laura Neto <12862535+lauraneto@users.noreply.github.com>

---------

Co-authored-by: Laura Neto <12862535+lauraneto@users.noreply.github.com>
2024-08-12 10:18:20 +02:00
leekelleher 35d6fc2f39 update backoffice submodule 2024-08-12 08:16:20 +01:00
Zeegaan d3d057db60 bumb version.json 2024-08-12 09:04:37 +02:00
Andreas ZerbstandGitHub b30a45a248 V14 QA applied changes from our test helpers (#16889)
* Made fixes based on changes in our test helpers

* Bumped version

* Fixed user tests
2024-08-12 10:28:34 +07:00
leekelleher cae00d49d8 update backoffice submodule 2024-08-08 09:04:34 +01:00
Bjarke BergandGitHub 58e515da11 Do not allow save of invalid domains (#16880) 2024-08-07 13:38:32 +02:00
Sebastiaan Janssen 1c1b4c6ee8 Merge branch 'v14/dev' into contrib 2024-08-06 14:42:37 +02:00
Nikolaj Geisle 0f16dae269 Merge remote-tracking branch 'origin/v13/dev' into v14/dev
# Conflicts:
#	src/Umbraco.Infrastructure/Migrations/Upgrade/V_10_7_0/MigrateTagsFromNVarcharToNText.cs
#	src/Umbraco.Infrastructure/Migrations/Upgrade/V_12_0_0/UseNvarcharInsteadOfNText.cs
2024-08-06 09:09:10 +02:00
Nikolaj GeisleandGitHub 4f63324411 Create new AccessPolicy (#16865) 2024-08-06 08:47:01 +02:00
18d2656414 FIX: Deleting language can make the backoffice client unusable (#16863)
* Make missing languages a non blocker for usergroup retrieval

* Add logging

* Update obsolete message

---------

Co-authored-by: Zeegaan <skrivdetud@gmail.com>
2024-08-05 13:30:18 +02:00
Bjarke BergandGitHub 4cd2f4637b Updated nuget packages (#16861) 2024-08-05 11:23:21 +02:00
Callum WhyteandGitHub d26f1e474d Remove favicon from dotnet templates (#16840) 2024-08-05 10:22:42 +01:00
Sven GeusensandGitHub c48490bf13 OpenIddict needs to process the /.well-known/openid-configuration url to be able to return the data. (#16845) 2024-08-05 11:11:56 +02:00
Bartlomiej KomendarczukandGitHub fc5cd6bdd1 Added apostrophe to allowed characters for username. (#16406) 2024-08-02 13:26:16 +01:00
688790e90a Fixing regression bug introduced in #14806 and found during investigation of #16803 - well tested on db with 300k+ nodes (#16837)
Co-authored-by: Wojciech Tengler <wtengler@umbracare.net>
2024-08-02 11:21:48 +02:00
Kenn JacobsenandGitHub 5d866d7bae Graceful handling of unauthorized requests to the Management API (#16836) 2024-07-31 09:45:34 +02:00
mcl-szandGitHub 55f9b09ab7 Combining OpenId and OfflineAccess scope (#16220)
* Combining OpenId and OfflineAccess scope

When the client scope is set to "openid offline_access", the returned scope only has the "offline_access" scope. The "openid" scope and the "id_token" are missing. By combining the OpenId and OfflineAccess as return scope, the refresh_token and id_token are returned.

* Update MemberController.cs

Cleaner way, provided by @kjac, to check if the scope has openid and/or offiline_access set.
2024-07-30 08:38:06 +02:00
Sven GeusensandGitHub f8079608fe Clean up Processed local image links in Management api (#16828)
* Removed type attribute from processed local links

improved code readabilty by using multi return type to private class

* Removed type attribute from processed locallinks in delivery api

* Removed type attribute from expected output regarding locallink parsing

* Added type atttribute removal in deliveryapi for local image link and invalid local links

Test rename for clarity and
2024-07-29 13:32:42 +02:00
Jacob Overgaard ceb86b6c36 Merge remote-tracking branch 'origin/v14/dev' into v14/dev 2024-07-26 11:06:25 +02:00
Jacob Overgaard 18c7fc5767 update backoffice submodule 2024-07-26 11:06:15 +02:00
Nhu DinhandGitHub 15a74e2511 V14 Fixing the failing smoke tests (#16822)
* Added tests with empty name for Partial View, Stylesheet, Script and Template

* Added tests with non-empty folder for Partial View, Stylesheet, Script

* Added tests to create a partial view in a folder in a folder

* Moved goToSetting to Arrange

* Fixed the failing tests and added the unhappy path tests

* Fixed the failing tests due to UI changes

* Fixed format

* Bumped version of test helper

* Run the tests for Settings in the pipeline

* Fixed the Member failing tests

* Fixed the Document Type Design Tab failing tests

* Fixed the Media Type Design Tab failing tests

* Fixed the Script failing tests

* Bumped version of test helper

* Bumped version of test helper
2024-07-26 10:56:23 +02:00
b14ac811ef Make block editor base classes public (#16774)
* Make block editor base classes public

* Update BlockEditorValues.cs

Change to trigger a new build for #16774

---------

Co-authored-by: Kenn Jacobsen <kja@umbraco.dk>
2024-07-26 08:16:08 +02:00
Jacob Overgaard bec0bd6641 update backoffice submodule 2024-07-25 18:20:17 +02:00
Nhu DinhandGitHub 4f62746053 V14 Added Content tests with various data types (#16809)
* Added Content tests with content picker

* Removed the test for content picker

* Added Content tests with the default content picker

* Added more Content tests with Content Picker data type

* Added the Content tests with Dropdown

* Added Content tests with Image Cropper

* Updated upload file method due to test helper changes

* Added Content tests with Image Cropper

* Added Content tests with Image Cropper data type

* Added Content tests with Media Picker data type

* Updated Media tests due to ui helper changes

* Bumped version of test helper and json builder

* Make all Content tests run in pipeline - should remove it before merging

* Fixed the name of tests

* Updated the tests for Media Picker in Content section

* Added the Content tests with Multiple Media Picker

* Updated the Content test with Content Picker due to the test helper changes

* Bumped version of test helper

* Fixed the failing tests for Content

* Removed Image Cropper test in this branch

* Added more waits

* Added smoke tags

* Make smoke tests run in the pipeline
2024-07-25 17:59:47 +07:00
Elitsa MarinovskaandGitHub b61b71ee9d Returning the correct totalItems amount (#16799) 2024-07-25 10:01:53 +02:00
9a49ab712b Add Health Check for Runtime mode (#16715)
* Add Health Check for Runtime mode

* Update src/Umbraco.Core/EmbeddedResources/Lang/en.xml

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

* Update src/Umbraco.Core/HealthChecks/Checks/LiveEnvironment/RuntimeModeCheck.cs

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

* Update lang file

* Fix typo.

---------

Co-authored-by: Jason Elkin <jasonelkin86@gmail.com>
2024-07-24 17:36:17 +01:00
Ronald BarendseandGitHub 2f78d1a8f3 Fix UdiRange.Parse() throwing ArgumentException for valid value (#16788)
* Add test to assert UdiRange can round-trip all selectors

* Fix parsing UdiRange without a selector
2024-07-24 14:28:19 +02:00
Jacob Overgaard 7e444e5604 update backoffice submodule 2024-07-24 10:12:54 +02:00
9e0fb54ea5 Removed Type attribute from parsed local links (#16780)
* Removed type attribute from processed local links

improved code readabilty by using multi return type to private class

* Removed type attribute from processed locallinks in delivery api

* Removed type attribute from expected output regarding locallink parsing

* Cleanup

* Fixed spacing bug

* Added 2 more edge test cases

---------

Co-authored-by: Elitsa <elm@umbraco.dk>
2024-07-23 10:25:54 +02:00
Nikolaj Geisle 94ee50c819 Merge branch 'release/14.1.1' into v14/dev
# Conflicts:
#	src/Umbraco.Web.UI.Client
#	version.json
2024-07-22 08:12:16 +02:00
MoleandGitHub 213a13db81 Merge pull request #16800 from umbraco/v14/merge
V14: Merge
2024-07-19 11:22:01 +02:00
nikolajlauridsen a7bfc6fbf0 Merge branch 'refs/heads/v13/dev' into v14/merge 2024-07-19 10:15:08 +02:00
nikolajlauridsen 635076d657 Revert "fix: revert the inert attribute on Tours since you are expected to be able to work with the background in certain steps"
This reverts commit d72fc5c4e8.
2024-07-19 10:14:54 +02:00
Jacob OvergaardandGitHub cad5502f79 V14: Remove user-defined.css (#16792)
* chore: remove the `user-defined.css` asset from the RCL

You cannot overwrite an asset in an RCL just like that, as the user-defined.css were intended.

* delete actual file
2024-07-18 13:06:27 +01:00
Jacob Overgaard 2f7afa67a3 update backoffice submodule 2024-07-18 12:56:58 +02:00
Jacob Overgaard eb4fc97c5d update backoffice submodule (datepicker hotfix) 2024-07-16 09:22:47 +02:00
Jacob Overgaard f6074b4c32 bump version to 14.1.1 2024-07-15 14:31:37 +02:00
Jacob Overgaard efe2f51d13 update backoffice submodule 2024-07-15 09:58:47 +02:00
Nikolaj Geisle cbb6c5c9bf Merge branch 'release/14.1' into v14/dev
# Conflicts:
#	src/Umbraco.Web.UI.Client
2024-07-11 11:37:40 +02:00
Zeegaan e4b776a56c bump version 2024-07-10 11:53:07 +02:00
Jacob Overgaard fd3f77c477 update backoffice submodule (hotfix ufm) 2024-07-10 11:50:40 +02:00
Jacob Overgaard d05e32b6e9 update backoffice submodule 2024-07-10 11:49:47 +02:00
nikolajlauridsen 40a782e50f Merge remote-tracking branch 'refs/remotes/origin/v13/dev' into v14/dev
# Conflicts:
#	src/Umbraco.Core/DependencyInjection/UmbracoBuilder.Collections.cs
#	src/Umbraco.Web.BackOffice/Controllers/EntityController.cs
2024-07-10 09:21:40 +02:00
Elitsa MarinovskaandGitHub 510f805223 Keeping launchBrowser settings as in v13 (#16765) 2024-07-09 09:57:26 +02:00
Jacob OvergaardandGitHub 512114bcd7 V14: Add usernameIsEmail to the user configuration object (#16759)
* fix: move usernameIsEmail from the current user to the user configuration since it is a static variable not only relevant to the current user

* update OpenApi.json

* update OpenApi.json

* update OpenApi.json
2024-07-08 16:15:48 +02:00
Jacob Overgaard 26084d8bb5 update backoffice submodule 2024-07-05 13:45:27 +02:00
Jacob Overgaard 58a766293e update backoffice submodule 2024-07-05 13:29:59 +02:00
8681a4e4e8 Move ReservedFieldNames to type configuration endpoints (#16735)
* Move ReservedFieldNames to type configuration endpoints

* Update obsoletion messages

* Update src/Umbraco.Cms.Api.Management/Controllers/MemberType/ConfigurationMemberTypeController.cs

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

---------

Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com>
2024-07-05 12:34:25 +03:00
Jacob Overgaard 4283f34fd1 update backoffice submodule 2024-07-05 11:05:18 +02:00
Jacob Overgaard a79f2705da introduce an "other changes" category 2024-07-05 09:10:19 +02:00
Jacob Overgaard ff3b1d678b introduce an "other changes" category 2024-07-05 09:10:06 +02:00
Jacob Overgaard d3fe69afe4 add type/improvement to list of bug fixes 2024-07-05 09:05:42 +02:00
Jacob Overgaard 36d00bd967 add type/improvement to list of bug fixes 2024-07-05 09:05:23 +02:00
Jason Elkin f20528c9fa Merge branch 'v14/dev' into contrib 2024-07-04 12:56:41 +01:00
Nhu DinhandGitHub ffa85ee3b5 V14 Added Content tests with Checkbox list (#16733)
* Added Content tests with checkbox list

* Bumped version of test helper

* Make the Content tests run in the pipeline

* Moved goToBackOffice to beforeEach

* Removed the unnecessary file

* Moved goToBackOffice to beforeEach

* Make smoke test run in the pipeline
2024-07-04 16:57:55 +07:00
Nikolaj Geisle dd67fd16fe Merge branch 'v14/dev' into release/14.1 2024-07-04 09:20:38 +02:00
Ronald BarendseandBjarke Berg 33338add76 Support parsing object to DateTimeOffset and preserve timezone offset (#16732)
(cherry picked from commit 4643b7dba3)
2024-07-04 07:36:58 +02:00
Ronald BarendseandGitHub 4643b7dba3 Support parsing object to DateTimeOffset and preserve timezone offset (#16732) 2024-07-04 07:36:09 +02:00
Lee KelleherandGitHub 0a9df3c105 V14: OpenAPI: Explicitly set ByRelationTypeKey endpoint name (#16729)
This is because of an `operationId` name clash with `ByKeyRelationTypeController.ByKey`,
ref: https://github.com/umbraco/Umbraco-CMS/blob/release-14.0.0/src/Umbraco.Cms.Api.Management/Controllers/RelationType/ByKeyRelationTypeController.cs#L27

This change attempts to ensure a unique `operationId` in the OpenAPI/Swagger JSON.
2024-07-03 12:54:31 +02:00
Lee KelleherandGitHub 32fe23ba41 V14: Expose Umb-Notifications HTTP header (#16728)
Enables client-side dev env to access the custom header.
2024-07-03 11:25:44 +02:00
6069610f83 v14: Implement backoffice signalR hub (#16723)
* Implement backoffice signalR hub

* Fix test

* Refactor to use object instead of string

* Update src/Umbraco.Cms.Api.Management/Routing/BackofficeHub.cs

Co-authored-by: Bjarke Berg <mail@bergmania.dk>

---------

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2024-07-02 17:14:43 +02:00
Sven GeusensandGitHub 46acd51759 [V14] Make the backend work with the new localLinks format (#16661)
* Support new localLink format in core link parsing

* Updated devliery api to work with the new locallinks format

Added tests for old and new format handling.

* Fix error regarding type attribute not always being present (for example old format or non local links)
2024-07-02 14:22:19 +02:00
Jacob OvergaardandGitHub 13b77d35df V14: Build and publish Typedoc docs (#16724)
* rename display names of 'ui docs' to 'storybook'

* add new jobs to build and publish the ui-api docs (typedoc) to the blob storage
2024-07-02 09:40:53 +02:00
Jacob Overgaard ecd6e05c48 Merge remote-tracking branch 'origin/release/14.1' into v14/dev 2024-07-02 09:08:18 +02:00
Jacob Overgaard 9efcc4d8ed Merge branch 'release/14.1' into v14/dev 2024-07-02 09:05:46 +02:00
d2707acd3b V14: Create seperate Create and Update in ContentTypeServiceBase (#16714)
* Create seperate Create and Update in ContentTypeServiceBase

* Fix up notification for update

---------

Co-authored-by: nikolajlauridsen <nikolajlauridsen@protonmail.ch>
2024-07-01 15:29:42 +02:00
Jacob OvergaardandGitHub 2122af7e96 V14: Build and release the type declarations of the Backoffice to npm (#16718)
* separate backoffice install into its own template

* add new job to build the backoffice npm package

* move location of templates

* set version, then build, then pack

* use nbgv to get just the NpmPackageVersion

* calculate version earlier and for both builds

* merge two tasks

* add Build keyword to the display name

* get the node version from the backoffice

* update backoffice submodule

* bump npm version before restoring cache to ensure the cache key doesn't change

* add template to umbraco.sln
2024-07-01 12:23:58 +02:00
Jacob Overgaard 2185be1b03 update backoffice submodule 2024-06-28 15:26:28 +02:00
Zeegaan 2010a241fe Bumb version 2024-06-28 09:30:06 +02:00
Sven GeusensandZeegaan 921598b667 Fixed toolbar not showing for seeded,untouched and then migrated RTE datatypes (#16665)
Moved 14.1 migrations into their own namespace

Co-authored-by: Sven Geusens <sge@umbraco.dk>
(cherry picked from commit d170193a95)
2024-06-28 09:29:55 +02:00
d170193a95 Fixed toolbar not showing for seeded,untouched and then migrated RTE datatypes (#16665)
Moved 14.1 migrations into their own namespace

Co-authored-by: Sven Geusens <sge@umbraco.dk>
2024-06-28 09:28:55 +02:00
Bjarke Bergandnikolajlauridsen 2fa4149b62 Use the configured backoffice url to initialize openiddict if it is available and just fallback to the one from the first request. (#16660)
Fixes https://github.com/umbraco/Umbraco-CMS/issues/16179
2024-06-27 10:49:19 +02:00
Bjarke BergandGitHub 1ea65c1fb2 Use the configured backoffice url to initialize openiddict if it is available and just fallback to the one from the first request. (#16660)
Fixes https://github.com/umbraco/Umbraco-CMS/issues/16179
2024-06-27 10:47:41 +02:00
Jacob Overgaard ed220035ef backoffice submodule release/14.1 2024-06-26 14:40:57 +02:00
Jacob Overgaard dacd324c9a Merge remote-tracking branch 'refs/remotes/origin/v14/dev' into release/14.1
# Conflicts:
#	src/Umbraco.Web.UI.Client
2024-06-26 14:26:04 +02:00
Jacob Overgaard 195d8b5843 backoffice submodule release/14.1 2024-06-26 13:33:07 +02:00
Jacob Overgaard 1774d4e234 update backoffice submodule 2024-06-26 13:32:28 +02:00
Jacob Overgaard f1b54fe426 fix login build errors 2024-06-26 11:34:52 +02:00
Jacob Overgaard bb058c4f89 update lockfile 2024-06-26 11:22:45 +02:00
Sebastiaan Janssen 3ce2e97f5e Merge branch 'v14/dev' into contrib 2024-06-26 10:45:31 +02:00
Jacob Overgaard 7e8dd02e79 update backoffice submodule 2024-06-26 10:32:45 +02:00
Nikolaj GeisleandGitHub 8ca637d0cb V14: Fix source code editor not showing on fresh install / upgrade (#16655)
* Create richtext with sourcecode by default

* Add rich text migration

* Create migration for migration "ace" value to "sourcecode"
2024-06-26 10:18:05 +02:00
Andreas ZerbstandGitHub 0b868638e0 V14 QA updated dictionary naming in E2E test (#16657)
* Updated naming

* Bumped version of helper
2024-06-25 17:24:47 +02:00
Bjarke Berg 37d22766b1 Merge remote-tracking branch 'refs/remotes/origin/v13/dev' into v14/dev 2024-06-25 14:10:22 +02:00
Bjarke BergandGitHub a01be0d16f Merge pull request #16653 from umbraco/v14/nuget-update-2024-06-25
Nuget update 2024 06 25
2024-06-25 12:03:20 +02:00
Bjarke Berg 3c34eaf739 Updated nuget packages 2024-06-25 11:20:52 +02:00
Bjarke Berg 3c3d9269ca Merge remote-tracking branch 'refs/remotes/origin/v13/dev' into v14/dev
# Conflicts:
#	Directory.Packages.props
2024-06-25 10:34:20 +02:00
Kenn JacobsenandGitHub 76bb2b0847 Add endpoint for calculating effective user start nodes (#16609)
* Add endpoint for calculating effective user start nodes

* Fix OpenAPI
2024-06-25 10:34:16 +02:00
Bjarke BergandGitHub 215fc4378e Merge pull request #16652 from umbraco/v14/feature/merge-2024-06-25
Code changes from V13.4
2024-06-25 10:32:27 +02:00
Bjarke Berg 9ad67e27c5 Fixed test by moving when the publishing notification is fired. 2024-06-25 10:03:19 +02:00
Bjarke Berg bda23c35e3 Merge remote-tracking branch 'refs/remotes/origin/v14/dev' into v14/feature/merge-2024-06-25
# Conflicts:
#	src/Umbraco.Web.UI.Client
2024-06-25 08:47:38 +02:00
Bjarke Berg 4cfa021132 Merged v13/dev into v14 2024-06-25 08:44:36 +02:00
Jacob Overgaard 2a57af8240 update backoffice submodule 2024-06-24 14:52:49 +02:00
Josh BrownandGitHub cb090353f4 Fix unguarded calls to ServiceDescriptor.ImplementationType for keyed services (#16604)
* Update integration test base class to verify that calls to ServiceDescriptor.ImplementationType are guarded for keyed services

* Fix unguarded calls to ServiceDescriptor.ImplementationType for keyed services
2024-06-22 10:20:12 +01:00
Lars-Erik AabechandGitHub de74ae4c04 Added custom mvc setup method to testserver base class (#16545) 2024-06-21 16:43:30 +01:00
georgebid 53139a1046 Revert "test"
This reverts commit 462903397f.
2024-06-21 16:23:35 +01:00
georgebid 462903397f test 2024-06-21 16:22:40 +01:00
Bjarke BergandGitHub f717a5d0b7 Simplified how we disable the TransportSecurityRequirement in OpenIddict (#16629) 2024-06-20 10:39:24 +02:00
Bjarke BergandGitHub 75c42f4ea4 Added post configuration of OpenIddictServerOptions that removes the ValidateTransportSecurityRequirement iff globalsettings.usehttps is false. (#16614) 2024-06-19 15:21:57 +02:00
Kenn JacobsenandGitHub 1f52d01493 Do not rely on claims to figure out user access + prepare for claims removal (#16552)
* Do not rely on claims to figure out user access + prepare for claims removal

* Fix typos :)

* Ensure we fire all relevant notifications when creating and updating user groups

* Leave it to the cache refreshers to flush user cache data (start nodes)
2024-06-19 15:19:31 +02:00
Andreas ZerbstandGitHub 01909ca204 V14 QA Users acceptance tests (#15916)
* Added tests for users

* Additional tests

* Found additional test scenarios

* File select

* Fixed tests

* Cleaned up user tests

* Bumped versions of helpers and builder

* Updated naming of method

* More updates

* Added more tests

* Fixed tests

* Fixed skipped tests

* Final touches

* Bumped

* Run userTests

* Fixes made based on review

* Updated so we run our smoketest again
2024-06-18 13:36:00 +02:00
Nikolaj GeisleandGitHub 8edb1885c9 Add missing translations (#16612) 2024-06-18 10:40:59 +02:00
dependabot[bot]andJason Elkin 8e98c1e023 Bump braces from 3.0.2 to 3.0.3 in /tests/Umbraco.Tests.AcceptanceTest
Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3.
- [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micromatch/braces/compare/3.0.2...3.0.3)

---
updated-dependencies:
- dependency-name: braces
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-17 16:57:09 +01:00
Kenn JacobsenandGitHub a64dbe12a1 OpenIddict should only handle /umbraco/ requests (#16549) 2024-06-10 13:31:51 +02:00
Jacob Overgaard fe559c20ab set version to 14.1.0-rc 2024-06-10 12:11:24 +02:00
Jacob Overgaard 4d7e722b99 bump version back to 14.1 2024-06-10 12:09:39 +02:00
Jacob Overgaard 777bb4cd57 Merge remote-tracking branch 'refs/remotes/origin/contrib' into v14/dev 2024-06-10 11:28:04 +02:00
Matt DarbyandMatthew-Wise 0bb46b9667 Fix broken logo URL + replace old nonodes background 2024-06-10 10:23:52 +01:00
Jacob Overgaard fc9de30604 update backoffice submodule 2024-06-10 10:29:18 +02:00
46c0b66a70 V14 Adding unhappy path tests for Member and Member Group (#16564)
* Added unhappy path tests for MemberGroup

* Added unhappy path tests for Member

* Bumped version of test helpers

* Added smoke tag to make all the tests running in the pipeline

* Update tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Members/Members.spec.ts

* Removed smoke tags before merging

---------

Co-authored-by: Andreas Zerbst <73799582+andr317c@users.noreply.github.com>
2024-06-07 12:53:54 +02:00
Nhu DinhandGitHub d5176d668d V14 Added acceptance test for Document Blueprint (#16563)
* Added tests for Document blueprints

* Fixed the failing tests for Partial View

* Updated tests for Document Blueprints

* Fixed the delete document blueprints tests

* Fixed method name due to the test helpers changes

* Fix arrange steps

* Bumped version of test helpers

* Removed 's' in the file name

* Removed the step to reload tree

* Fixed comments

* Removed test.describe before merging
2024-06-07 11:33:36 +02:00
b04e4d7586 V14: Add missing action parameters mapping (#16557)
* Add missing mapping for ActionParameters

* Remove -ActionParameters as that is now mapped

* Update OpenApi.json

---------

Co-authored-by: Elitsa <elm@umbraco.dk>
2024-06-07 10:22:13 +02:00
42ce64c357 V14 QA Fixed DocumentType and MediaType tests (#16539)
* Changed name of locator click

* fixed tests

* Bumped version of testHelpers

* Update tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/DocumentType/DocumentTypeDesignTab.spec.ts

Co-authored-by: Nhu Dinh <150406148+nhudinh0309@users.noreply.github.com>

---------

Co-authored-by: Nhu Dinh <150406148+nhudinh0309@users.noreply.github.com>
2024-06-07 08:06:06 +02:00
71199b3323 V14 Added acceptance tests for Data Type - p2 (#15873)
* Added tests for Multi URL Picker

* Added tests for Multiple Media Picker

* Added tests for RichTextEditor - not done

* Added tests for Richtext Editor

* Added tests for Content Picker

* Added tests for Tags

* Fixed the tests for Approved Color

* Added tests for Checkbox list

* Fixed tests for DataTypeFolder

* Fixed tests for DatePicker due to api changes

* Added tests for Dropdown

* Fixed tests for ImageCropper due to ui changes

* Added tests for List View

* Added tests for Multiple Media Picker

* Added tests for RichTextEditor

* Added tests for Radiobox

* Added tests for True false

* Added tests for Upload

* Bumped version of test helper

* Bumped version

* Fixed code format

* Removed hard waits

* Updated tests for Template and Partial View - not done

* Added insert section tests

* Used defaultTemplateContent to avoid duplicate code

* Added insert section tests

* Added missing tests for Partial View

* Added missing tests for Scripts

* Added missing tests for Stylesheet

* Added missing tests for Template

* Changed method's name due to test helper changes

* Added skip tests

* Bumped version of test helper

* Reversed waits

* Changed createThreeDotsButton to createButton due to UI changes

* Removed List View - Members tests as the UI changes

* Added more waits

* Removed unnecessary waits

* Added and removed skip tests

* Fixed and added missing tests

* Changed name of test file for Media Picker, Image Media Picker, Multiple Media Picker and Multiple Image Media Picker

* Updated and added missing tests for Data Types

* Bumped version of test helper

* Changed configuration of smokeTest to make all DataType tests run in the pipeline. It should remove before merging

* Added skip for all tests of Numeric as there is no configuration now

* Removed test.describle

* Change syntax of smoke tag

* Removed duplicate code

* Added the tests that avoid the minimum value is greater than the maximum value

* Added the tests that avoid the min height value is greater than the max height value

* Added test for adding available block to RTE

* Remove skip and add more tests

* Added tests for create an empty data type

* Fixed the create data type tests

* Added tests for changing setting a data type

* Updated the test for creating a new data type

* Added skip tests due to UI changes

* Skipped unhappy tests as the front-end is not ready

* Changed the way to create a new stylesheet

* Updated method names due to test helpers changes

* Bumped version of test helper

* Updated expected result

* Updated method name due to UI changes

* Bumped version of test helper

* Bumped version of test helper

* Fixed add start node tests

* Added skip tests

* Updated the expected result

* Fixed add layout tests

* Added more waits

* Add skip tests

* Removed , in the objects and renamed some tests

* Added tests for updating the option

* Fixed naming and removed unnecessary commas

* Update tests/Umbraco.Tests.AcceptanceTest/package.json

Co-authored-by: Andreas Zerbst <73799582+andr317c@users.noreply.github.com>

---------

Co-authored-by: Andreas Zerbst <andr317c@live.dk>
Co-authored-by: Andreas Zerbst <73799582+andr317c@users.noreply.github.com>
2024-06-06 14:36:49 +02:00
Nikolaj GeisleandGitHub 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
Don BuddhiandMatthew-Wise e4ac7c9752 Added git submodule update --init command to the documentation 2024-06-03 09:44:58 +01:00
Nhu DinhandGitHub 1f8b7f3a35 V14 QA Added acceptance tests for Members and Member Group (#16074)
* Updated tests for Member Group - not done

* Added api tests for Member

* Added api tests for Member Group

* Added ui tests for Members

* Added ui tests for Member Group

* Added tests for Member Type

* Added code to block unnecessary resources

* Updated createFolder

* Bumped version of test helper

* Changed clickCreateButton to clickCreateLink due to UI changes

* Bumped version of json builder

* Reversed previous code

* Removed waitForTimeout

* Removed waitForTimeout after login

* Bumped version of json builder

* Changed delete folder method

* Bumped version of test helper

* Update create link

* Removed waitForTimeout

* Added skip tests since currently only can view relations

* Added more explicit wait

* Removed hard wait

* Removed invalid verification step due to paging

* Moved get set telemetry level from test to before/after test

* Bumped version of test helper

* Added smoke tags - not done

* Added smoke tags

* Changed locator due to Ui changes

* Changed update to rename method due to test helpers change

* Bumped version of test helpers

* Removed tests for MemberType

* Fixed merge conflict

* Added code to run smoke E2E tests after each build instead of full E2E tests

* Updated command to run smoke test

* Added more smoke tag

* Added smoke tags

* Updated the syntax of smoke tag

* Added smoke tag to make all tests run in the pipeline

* Bumped version of test helper

* Fixed comment

* Removed unnecessary lines

* Removed test.describle
2024-06-03 10:23:50 +02:00
e0c64e4d6a V14: Add required dependency to management api (#16532)
* Add registration to management api

* Check for registration

* Update src/Umbraco.Cms.Api.Common/DependencyInjection/UmbracoBuilderApiExtensions.cs

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

---------

Co-authored-by: Nuklon <Nuklon@users.noreply.github.com>
2024-06-03 10:01:17 +02:00
Shannon DeminickandMatthew-Wise f9a6712403 Fixes a bug where the ValueSetValidator is null which will cause a NullReferenceException.
Fixes a bug where the ValueSetValidator is null which will cause a NullReferenceException.
2024-06-01 13:03:47 +01:00
Nikolaj GeisleandGitHub 4478d22390 Add retries to flaky tests (#16529) 2024-05-31 13:02:43 +02:00
Bjarke BergandGitHub 7c1f541bbb Handle MasterTemplateNotFound as bad request instead of unepxected (#16445) 2024-05-31 12:39:48 +02:00
Bjarke BergandGitHub e6568c69dc Added a notifiction handler that checks if we wanna have domain publish warnings. If so it adds as Umb-Notifications and logs it. (#16507) 2024-05-31 12:26:37 +02:00
Elitsa MarinovskaandGitHub 464eaa0409 Adding a base class of oembedresponse, so we can handle string values for dimentions (#16514) 2024-05-31 11:39:09 +02:00
Nikolaj GeisleandGitHub 71e1b74337 v14: Validate file name to return correct error (#16419)
* Validate name

* Add missing case for HandleRename
2024-05-31 11:25:27 +02:00
Nikolaj GeisleandGitHub 133f985293 Include description in DocumentTypeItemResponseModel (#16503) 2024-05-31 09:08:33 +02:00
Ronald BarendseandGitHub bb3ac68241 Include umbraco-package.json manifests in telemetry data (#16430)
* Include umbraco-package.json manifests in package telemetry and add ID

* Add package ID to ManifestResponseModel

* Use async service method and HTTP client factory

* Avoid breaking changes
2024-05-31 09:02:36 +02:00
Nhu DinhandGitHub d78a063f07 V14 QA Added Content acceptance tests (#16289)
* Added api tests for Document - not done

* Added ui tests for Content - not done

* Added api test for Documents

* Added ui tests for Content

* Updated method name due to ui changes

* Bumped version of test helpers and json builders

* Added smoke tag to run all Content tests in the pipeline

* Bumped version of json builder

* Revert files

* Updated the syntax of smoke tag

* Added tests for content with different property editors

* Added tests for Info Tab

* Added more steps for before tests

* Added more tests for Redirect Management

* Added more tests for Content

* Bumped version of test helper

* Changed test name

* Updated the method name due to the test helper changes

* Fixed typo

* Added more waits and skip tests

* Updated the test name

* Changed click action for save button

* Bumped version of test helper

* Bumped version of test helper

* Updated choose document type step after clicking create button due to UI changes

* Added skip tests

* Changed clean method

* Fixed arrange step

* Fixed the arrange steps

* Removed test.describe and unnecessary variables

* Added smoke tests
2024-05-31 08:45:07 +02:00
Bjarke Berg d10596896e Added PackageValidation 2024-05-30 13:49:48 +02:00
Jacob Overgaard 4041e290bf update backoffice submodule 2024-05-30 09:59:08 +02:00
Sebastiaan Janssen 41dddee620 Merge branch 'v14/dev' into contrib
# Conflicts:
#	src/Umbraco.Web.UI.Login/package-lock.json
#	src/Umbraco.Web.UI.Login/package.json
2024-05-30 08:41:49 +02:00
Zeegaan 48c8ffcbc5 Merge branch 'release/14.0' into v14/dev
# Conflicts:
#	src/Umbraco.Web.UI.Client
2024-05-30 08:14:30 +02:00
Jacob Overgaard 0c38eea6f7 update backoffice submodule 2024-05-29 10:20:47 +02:00
Jacob Overgaard 48c4d75886 update backoffice submodule 2024-05-29 10:18:47 +02:00
Jacob Overgaard 8685c7d64a fix: edit blocks in areas 2024-05-29 09:56:34 +02:00
Bjarke Berg 926a077374 Merge remote-tracking branch 'origin/release/14.0' into release/14.0 2024-05-29 07:47:37 +02:00
Bjarke Berg e39c600415 Bump version 2024-05-29 07:47:30 +02:00
Bjarke BergandGitHub 23461b3698 Handle the case where the editorvalue is from the db and just is a path. (#16429) 2024-05-28 15:27:23 +02:00
Jacob Overgaard 2a9808c776 update backoffice submodule 2024-05-28 15:01:32 +02:00
Jacob Overgaard 4046d13c29 update backoffice submodule 2024-05-28 15:00:45 +02:00
Jacob Overgaard d38421286f update backoffice submodule 2024-05-28 09:48:05 +02:00
Jacob Overgaard 17e1b823de update backoffice submodule 2024-05-28 09:45:23 +02:00
Jacob Overgaard 799e0dcca8 update backoffice submodule 2024-05-28 09:43:11 +02:00
Andreas ZerbstandGitHub 0ad177a522 V14 QA Fix E2E tests (#16427)
* Moved group

* Fixed button name

* Bumped version of testHelpers
2024-05-28 09:16:03 +02:00
Nikolaj Geisle 5a966ec3e7 Merge branch 'v14/dev' into release/14.0 2024-05-28 08:55:05 +02:00
Jacob Overgaard 64dbfd0bc9 update backoffice submodule 2024-05-28 00:10:58 +02:00
Nikolaj Geisle 7bfe3eda56 bumb version.json 2024-05-27 22:11:46 +02:00
Nikolaj Geisle 7eaaa8e2e6 Merge branch 'v14/dev' into release/14.0 2024-05-27 22:11:24 +02:00
Kenn JacobsenandGitHub 5296013d89 Enrich the datatype references output with content type data (#16417) 2024-05-27 19:38:57 +02:00
Kenn JacobsenandGitHub ce8e258d6d Make sure listviews are initialized correctly in a new DB (#16418) 2024-05-27 18:35:43 +02:00
Jacob Overgaard 57cca63d81 update backoffice submodule 2024-05-27 17:38:14 +02:00
Andreas ZerbstandGitHub b6be3c50f1 V14 QA Decreased retry amount (#16423)
* Decreased retry once again

* Changed fallback value to 1
2024-05-27 16:17:03 +02:00
Kenn JacobsenandGitHub 1f7b7043b3 The "item" endpoints should be accessible for all users (#16422) 2024-05-27 15:25:17 +02:00
806fce8ed9 Add editor ui alias to package xml (#16420)
* Add editor ui alias to package xml

* Update src/Umbraco.Infrastructure/Packaging/PackageDataInstallation.cs

* Add AllowAtRoot and AllowInAreas

---------

Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
2024-05-27 14:10:19 +02:00
Jacob Overgaard f4a77ce217 update backoffice submodule 2024-05-27 13:35:58 +02:00
Kenn JacobsenandGitHub e7780265fa Use runtime mode to determine cache TTL for manifest files (#16393)
* Use runtime mode to determine cache TTL for manifest files

* Remove unused manifest settings
2024-05-27 10:33:49 +02:00
Jacob Overgaard 53ca2910fa update backoffice submodule 2024-05-27 09:49:31 +02:00
e5e87c96db [v14] Fix multiple upgrader issues (#16339)
* Made previewhubupdater work with full cache refreshes

* Make signout_Async available on coreSignInManager

* Allow Migrations to signout the logged in user

* Adding a guid to a user requires resignin

* Added a token revoke mechanism during migrations

* Revert "Make signout_Async available on coreSignInManager"

This reverts commit b103cf119a.

* Revert add allRefreshed on preview hub

Clarified with a comment

* Updated failing test setups

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
2024-05-27 07:17:45 +02:00
Jacob OvergaardandGitHub c083b3bc8a fix: correct the validation localization constants to match the client (#16401) 2024-05-27 06:44:55 +02:00
Kenn JacobsenandGitHub d927146855 Fix issues with initial creation of external users (#16363)
* Use constant instead of "sub"

* Re-assign the newly created user key as well as its ID
2024-05-24 14:55:56 +02:00
Sebastiaan JanssenandGitHub 729016e429 Update README.md 2024-05-24 14:29:06 +02:00
Sebastiaan JanssenandGitHub 5545051cb1 Task/update readme (#16403)
* Update readme
2024-05-24 14:18:03 +02:00
Kenn JacobsenandGitHub 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
MoleandGitHub 8383532fd5 Fix use cache issue when deleting (#16284) 2024-05-23 15:35:08 +02:00
Jacob OvergaardandGitHub 7582b9bcea V14: Login updates (#16359)
* switch logos around to support new login image

* add new login image

* update npm dependencies

* chore: compress the image further
2024-05-23 15:14:23 +02:00
Kenn JacobsenandGitHub 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
Jacob Overgaard 8f4f23938d Merge remote-tracking branch 'origin/v14/dev' into contrib 2024-05-23 14:32:53 +02:00
Jacob Overgaard 228aab1154 remove temp database 2024-05-23 14:13:02 +02:00
Andreas ZerbstandGitHub cff1dd5219 V14 QA Added document type acceptance test (#16211)
* Added tests

* Added the rest of the tests

* Few changes to failing test

* Added tests for folders

* More cleanup

* Updates

* Fixed tests

* More documentType fixes

* Fixed test

* Cleaned up

* Cleaned

* Bumped version of testHelpers

* Added @smoke in the define to test all our tests

* Updated version

* Added smoke tags

* Remove reload

* Added clean

* Updates from comments, not done

* Added smoke tag

* Uncommented test.describe

* Bumped version

* Added semicolon

* Split documentType tests into more files

* Bumped version

* Removed test describe and fixed indentation
2024-05-23 12:00:01 +02:00
Andreas ZerbstandGitHub 876e91d41d V14 QA media type tests (#16282)
* Added mediaType and mediaTypeFolder

* Added more tests

* More tests!

* Even more tests

* More fixes

* Clean up

* Added smoke tags

* Bumped version

* Added wait after clicking login

* Added remaining tests

* Bumped version of testHelpers

* Skipped failing test

* Fixed to comments

* Fixed comments and added missing test

* Bumped version

* Split mediaType tests into different files

* Removed test.describe and fixed indentation
2024-05-23 11:59:43 +02:00
Jacob OvergaardandGitHub 380c5bbbe2 feat: add autofocus to the email/username field (#16350)
this field will be automatically focused when the user sees the login screen, and it should be valid according to a11y best practices as this is the first and main element on the page

fixes #16276
2024-05-23 11:17:57 +02:00
Bjarke BergandGitHub aabb5b7c48 Updated nuget packages (#16349) 2024-05-23 10:41:28 +02:00
Jacob Overgaard 0c5d7b2627 Merge branch 'refs/heads/v14/dev' into release/14.0 2024-05-23 09:13:33 +02:00
Jacob Overgaard fcf82240d0 update backoffice submodule 2024-05-23 09:13:15 +02:00
Sebastiaan Janssen 9dd5e706b1 Merge branch 'v14/dev' into contrib 2024-05-22 15:29:46 +02:00
Jacob Overgaard 3f20abf767 Merge branch 'v14/dev' into release/14.0 2024-05-22 14:32:10 +02:00
Jacob Overgaard b1f012f85f update backoffice submodule 2024-05-22 14:31:55 +02:00
Bjarke BergandGitHub dd537f8ae8 Update path (#16346) 2024-05-22 14:24:19 +02:00
Jacob Overgaard b940578d9d bump version to 14.0.0-rc4 2024-05-22 13:54:58 +02:00
Jacob Overgaard 9186d1de5e Merge branch 'v14/dev' into release/14.0 2024-05-22 13:54:28 +02:00
Jacob Overgaard beba9d92e8 update backoffice submodule 2024-05-22 13:53:37 +02:00
Kenn JacobsenandGitHub 9ab8b816b2 The preview hub throws an exception during DB upgrade (#16338) 2024-05-22 12:11:01 +02:00
+3 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
Nikolaj GeisleandGitHub 8ddb911a52 V14; Refactor permissions for Document/Media/Member (#16310)
* Refactor permissions

* Fix user startnode caching

* Relax permissions on user item endpoint

* Refactor media types to align with newly refactored content permissions

* Remove permissions from member type item endpoint
2024-05-22 10:56:26 +02:00
Andreas ZerbstandGitHub b56d14322a V14 QA remove test describe (#16330)
* Removed test.describe and fixed indentation

* Removed test.describe, fixed indentation and moved test file to settings
2024-05-22 15:28:43 +07:00
Jacob Overgaard 03be7b8f2c update backoffice submodule 2024-05-22 09:11:06 +02:00
Jacob Overgaard 365e3b39ca update backoffice submodule 2024-05-21 11:14:18 +02:00
393566a3fb V14: Adds preview.js (#16305)
* Adds `preview.js`

to replace the legacy `umbraco.websitepreview.min.js` script.

Updates the content's `Id` with `Key`.

* allow any protected route to render the backoffice

* optimise component so it doesn't need to observe its attributes and use the popover API to show it on top of the content

* handle case where the culture could be set to "invariant" - we just want to set the "lang" attribute to the default ui language

* convert 'end preview' into an api request and reset the style of the button

* minimize function

* move static text into constants

---------

Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>
2024-05-21 11:13:26 +02:00
5a75488d0e Clean up null values in datatype configs (#16296)
Co-authored-by: Sven Geusens <sge@umbraco.dk>
2024-05-21 09:50:02 +02:00
Nhu DinhandGitHub bfbb9756f3 Updated smoke tag (#16326) 2024-05-21 08:36:02 +02:00
11e5257b56 V14: Untangle the preview functionality from the auth cookie (#16308)
* AB40660 - untangle the preview cookie from the auth cookie

* Clean up

* Allow anonymous to end preview sessions

* Some refinements

* update OpenApi.json

* Fix enter preview test

* correct tests to match new expectations of the preview cookie

* sync preview tests with correct expectations of access level

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>
2024-05-17 16:06:26 +02:00
80794f3efd [V14] import/export media/document type endpoints (#16100)
* Working import/export media/document types

* WIP

* Refactoring of import doctype/media types

- added analyze endpoint to extract relevant data without fully processing the file
- split up import endpoints into POST & PUT
- removed availableAtAction as the new endpoint allows clients to call the POST/PUT endpoints with confidence
- Added a new service that is responsible for turning temp files into Import compatible XML and being able to extracty partial information from it

* Wrap persistance access in scopes

* Typos, formatting, clean-up

* PR feedback

* update openapi spec

* Changed deleteFile flag to _temporaryFileService.EnlistDeleteIfScopeCompletes

* Itty bitty typo

* Moved magic cleanup into its own method so orchestration can decide when.

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
Co-authored-by: kjac <kja@umbraco.dk>
2024-05-17 14:35:18 +02:00
MoleandGitHub 13f2d52576 V14: Fix package creation (#16309)
* Fix documents and document types

* Fix remaining parts
2024-05-17 12:30:26 +02:00
56e0e1cc2b merge user/current/logins and user/current/login-providers (#16307)
also deleted unused requestmodel

Co-authored-by: Sven Geusens <sge@umbraco.dk>
2024-05-17 09:23:56 +02:00
295f6f8720 V14: Backend changes to facilitate Preview mode in Bellissimma (#16279)
* Sends GUID instead of the numeric ID for SignalR Preview Hub

* Add possibility to set cookies as HttpOnly

* Set UMB_PREVIEW cookie as HttpOnly

* fixup! Add possibility to set cookies as HttpOnly

* Refactor ContentFinderByIdPath to more readable

* Create ContentFinderByKeyPath reusing logic from ContentFinderByIdPath

* Add a comment to DisableFindContentByIdPath setting

* Append new content finder

* Change ordering of content finders registrations

* Refactor with a base class

* Update/refactor and add tests regarding ContentFindersByIdentifier

* Fix comment

* Avoiding breaking change

* Make usages use non-obsolete implementation

* Fixed todo in config instead of use the one old legacy name even more. Also obsoleted the ContentFinderByIdPath

* add `preview` as an allowed backoffice client route

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>
2024-05-16 15:53:42 +02:00
Kenn JacobsenandGitHub 93db1912a6 Fix the editor UI alias migration and re-run it (#16292) 2024-05-16 15:20:29 +02:00
Nikolaj GeisleandGitHub d20892e329 Refactor UserGroupService methods to use attempt (#16302) 2024-05-16 15:04:54 +02:00
Andreas ZerbstandGitHub a8f6e8f8dd Bumped version of testHelpers (#16304) 2024-05-16 13:29:55 +02:00
Jacob Overgaard 9f83ff3ab5 update backoffice submodule 2024-05-16 10:10:26 +02:00
Jacob Overgaard 7287e7d740 update backoffice submodule 2024-05-16 08:57:13 +02:00
Nikolaj GeisleandGitHub 520e5e4206 V14: Refactor user and usergroups with referency by id model (#16287)
* Refactor user group endpoints to use reference by id models instead

* Update user endpoints to use reference by id models

* Update usergroup ids to ReferenceByIdModel
2024-05-15 14:55:54 +02:00
MoleandGitHub bdd231caee V14: Fix null ref exception in current user permission endpoint (#16286)
* Fix null reference exception

* Align behaviour with document and media version
2024-05-15 14:23:04 +02:00
MoleandGitHub e46a8d2d31 Use SearchRedirectUrls (#16285) 2024-05-15 09:54:08 +02:00
Jacob Overgaard 3c4da9df53 update backoffice submodule 2024-05-15 09:53:32 +02:00
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
MoleandGitHub 7f654a1c63 Add JsonDocumentOptions skipping comments (#16281) 2024-05-14 14:12:02 +02:00
cbf9781ae8 DX: Add BlockValue constructors to force correct property editor alias and layout item type (#16266)
* Improve getting and initializing new block value layouts

* Remove unnecessary generic type constraints

* Add and use new block value/layout item constructors in tests

* Removed GetLayouts that did not make sense

* Added constructor to BlockItemData to simplify explicit usages

---------

Co-authored-by: kjac <kja@umbraco.dk>
2024-05-14 13:34:54 +02:00
Jacob Overgaard 6a9f936cce update backoffice submodule 2024-05-14 11:04:58 +02:00
d18bce0ea7 V14: Resize url endpoint (#16275)
* Add image resizing endpoint

* Rename factory

* Actually use height and width

---------

Co-authored-by: nikolajlauridsen <nikolajlauridsen@protonmail.ch>
2024-05-14 10:42:33 +02:00
Nhu DinhandGitHub eda4a6cc55 V14 QA Added missing acceptance tests for Dictionary (#16241)
* Changed name from Dictionary to Translation

* Removed old Dictionary

* Adding missing tests for Dictionary

* Added smoke tag to test

* Bumped version of test helper

* Add comments

* Fixed comments

* Removed smoke tag
2024-05-14 13:45:47 +07:00
Jacob OvergaardandGitHub 22c0c250e0 V14: The login page does not respect certain error codes (#16244)
* handle 403 and unknown error codes from the server

* resolve 2fa errors in repository

error handling was never being activated because this specific endpoint did not return api errors as it works exactly like the "authorize" endpoint, which is being called directly

* chore: add obsolete message to unused `SetupViewPath`

* chore: remove unused events

* add missing labels

* fix: send only 'error' back if the response is not ok

* chore: remove duplicate error handling for 500 errors

* fix: add hack to allow to submit the form on enter click
2024-05-13 12:39:38 +01:00
leekelleher 2cc5f496f3 update backoffice submodule 2024-05-13 12:31:33 +01:00
39e9408a09 Allow FileUpload and Imagecropper to upload files in the same way (#16214)
* Allow FileUpload and Imagecropper to upload files in the same way

* Fixed issue with backward compatibility

* Exclude from converter

* Bugfix if editorvalue is not a string

* Fix file upload value editor + clean up + throw explicitly if editor value is invalid

* Revert changes to FileUploadPropertyEditor - the stored property data format remains the file path

* Actually revert all changes to FileUploadPropertyEditor

* Also revert JsonValueConverter

* Cleanup remove unused equality methods

---------

Co-authored-by: kjac <kja@umbraco.dk>
2024-05-13 12:29:31 +01:00
Kenn JacobsenandGitHub 079097427b Return all templates from GetAllAsync if no keys are passed (#16254) 2024-05-13 11:23:20 +02:00
Bjarke BergandGitHub 962bedac29 Ensure we do not expose any cultures we do not accept in languages. Futhermore, I moved it to a service to people can replace the logic (#16265) 2024-05-13 11:09:46 +02:00
Kenn JacobsenandGitHub 46864daf7a Use a fixed access token timeout for developer clients (#16255)
* Use a fixed access token timeout for developer clients

* Re-introduce auth persistence in Swagger UI
2024-05-13 09:41:13 +02:00
87c7347900 V14: Reintroduce umbraco api controller as obsolete (#16263)
* Revert "v14: Remove mentions of UmbracoApiController (#15863)"

This reverts commit 30e2dea57a.

* Obsolete UmbracoApiController

* Added a few more obsoletion messages

* Removed some of the reintroduced stuff again

* Add obsoletion to FrontEndRoutes controller

---------

Co-authored-by: kjac <kja@umbraco.dk>
2024-05-13 08:28:42 +02:00
Bjarke Berg b4b512dd53 Return 403 when missing permissions instead of 401 2024-05-10 14:36:25 +02:00
Bjarke Berg e9074ea97a Return 403 when missing permissions instead of 401 2024-05-10 13:28:15 +02:00
Bjarke BergandGitHub 86d98eda8d Return 401 in case the signin was not successfully (#16258) 2024-05-10 11:27:34 +02:00
c7328bcbbc v14: Return all data types from DataTypeService.GetAllAsync() (#16230)
* Return all data types from GetAllAsync

* Remove unnecessary async/awaits

* Ensure we don't accidentally fetch all data types when we mean to fetch none.

---------

Co-authored-by: kjac <kja@umbraco.dk>
2024-05-10 08:12:25 +02:00
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
Jacob OvergaardandGitHub 6577b56d23 V14: The dev server for the login app does not work (#16225)
* bump from es2020 to es2022 for better javascript support

* remove the hardcoded "paths" in tsconfig and replace with the backoffice package

* import uui-css to have styling on the dev server

* change endpoint mock url

* cleanup unused code
2024-05-07 13:54:26 +02:00
Jacob Overgaard 78d93a11d0 Merge branch 'refs/heads/v14/dev' into release/14.0 2024-05-07 10:27:38 +02:00
Jacob Overgaard f65d465a8a update backoffice submodule 2024-05-07 10:27:23 +02:00
2260da210d Management api should use datetimeoffset (#16196)
* Move audit log endpoints to their respective silos and clean up

* Fix failing integration tests

* Using DateTimeOffset in management api and new methods in service layer

---------

Co-authored-by: kjac <kja@umbraco.dk>
2024-05-07 08:07:20 +02:00
f44fb59b34 V14 QA Added acceptance tests for Language (#15997)
* Fixed failing tests

* Updated tests to use the updated helpers

* Clean up tests

* Enabled our pipeline for E2E testing

* Updated the CMS URl for our E2E tests

* Bumped version of our testHelpers

* Did some fixing, still a bit more to do

* Updated auth tests to use LoginUiHelper

* Updated Telemetry tests to use TelemetryUiHelper

* Updated LogViewer tests to use LogViewerUiHelper

* Updated api tests to apply AAA pattern and fix failed tests

* Removed unused import

* Updated api tests for Language

* Added ui tests for Language

* Updated ui test of Language as test helper is changed

* Bumped version of test helper

* Updated create language tests

* Updated delete language test

* Added Language folder

* Fixed method name

* Bumped version of test helper

* Fix merge conflict

* Fixed typo

* Added more waits

* Fixed locator

* Updated locator

* Added timeout

* Fixed password

* Reversed file

* Bumped version

* Bumped version of test helper

* Added more waits

* Added skip for add language test

* Bumped version of test helper

* Added smoke tags

* Fix conflict

* Added @smoke tag to test all Language tests in the pipeline

* Fixed comment

* Removed smoke tag in describe

---------

Co-authored-by: Andreas Zerbst <andr317c@live.dk>
2024-05-07 11:59:59 +07:00
Jacob Overgaard 4035550dfa Merge branch 'refs/heads/v14/dev' into release/14.0 2024-05-06 18:15:32 +02:00
Jacob OvergaardandGitHub 91d81063a3 V14: Login page throws validation errors (#16222)
* remove unused login-input.element.ts

* fix: use regular html inputs to prevent validation errors that arose when we removed the shadow dom
2024-05-06 18:14:49 +02:00
Jacob Overgaard 97dcc90601 Merge branch 'refs/heads/v14/dev' into release/14.0 2024-05-06 14:17:20 +02:00
Jacob Overgaard 70cc0a5a05 update backoffice submodule 2024-05-06 14:15:14 +02:00
Elitsa MarinovskaandNikolaj Geisle e352be14ea Change order of service converter check (#16182) 2024-05-06 13:39:44 +02:00
Elitsa MarinovskaandGitHub 4736683273 Change order of service converter check (#16182) 2024-05-06 13:38:29 +02:00
Jacob Overgaard b2d6bb20ba add release.yml to be able to categorise github release notes (#16219) 2024-05-06 11:28:48 +02:00
Jacob OvergaardandGitHub b0b2b59740 add release.yml to be able to categorise github release notes (#16219) 2024-05-06 11:22:54 +02:00
Kenn JacobsenandGitHub b98a6aaa41 Use the correct editor UI for MNTP (#16217) 2024-05-06 11:22:28 +02:00
Jacob Overgaard 73646a88b1 Merge branch 'refs/heads/v14/dev' into release/14.0 2024-05-06 10:46:45 +02:00
Jacob Overgaard 09a8be12ec update backoffice submodule 2024-05-06 10:46:24 +02:00
Jacob Overgaard ba06e859c3 Merge branch 'refs/heads/v14/dev' into release/14.0 2024-05-06 10:32:05 +02:00
Jacob Overgaard 6dbb7e286d update backoffice submodule 2024-05-06 10:31:45 +02:00
Jacob Overgaard 01ce93510e update backoffice submodule 2024-05-06 10:30:32 +02:00
Nikolaj GeisleandGitHub d13278af80 V14: Webhook endpoint fixes (#16215)
* Update to use presentation factory

* remove unused usings

* Update delete endpoint to work

* Remember to map key

* Map key for updating webhooks
2024-05-06 10:25:33 +02:00
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
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
Sebastiaan Janssen 8b878a7aa6 Merge branch 'v14/dev' into contrib 2024-05-02 15:33:32 +02:00
Jacob Overgaard caebf37f51 Merge branch 'refs/heads/v14/dev' into release/14.0 2024-05-02 13:50:24 +02:00
Jacob OvergaardandGitHub f0dae526bf add the new oauth_complete path to the list of exemptions for the backoffice client (#16210) 2024-05-02 13:09:20 +02:00
Jacob Overgaard 8c8ebc0de1 update backoffice submodule 2024-05-02 12:59:30 +02:00
Jacob Overgaard 6eb8624291 update backoffice submodule 2024-05-02 12:50:11 +02:00
Jacob Overgaard 4a09e8dfd9 update backoffice submodule 2024-05-02 12:46:21 +02:00
Jacob Overgaard 7230091010 bump version.json 2024-05-02 12:04:47 +02:00
Jacob Overgaard 8db9913bdd Merge branch 'refs/heads/v14/dev' into release/14.0 2024-05-02 12:04:28 +02:00
Jacob Overgaard 859e1e65f1 update backoffice submodule 2024-05-02 11:59:31 +02:00
Jacob OvergaardandGitHub fe1ee46115 V14: Unique OAuth callback route (#16194)
* set the default for `AuthorizeCallbackPathName` to "/umbraco/oauth_complete" to allow the server to redirect the user back to a route where we don't load the entire backoffice.

* remove redundant method
2024-05-02 11:56:27 +02:00
2009989f6a [V14] Allow specifying ID on the create package endpoint (#16203)
* Allow package creation to specify the ID

* update openapi

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
2024-05-02 11:33:15 +02:00
Nhu DinhandGitHub 0cfa8626b1 V14 QA Setting up the smoke E2E tests in pipeline (#16082)
* Added code to block unnecessary resources

* Updated createFolder

* Bumped version of test helper

* Changed clickCreateButton to clickCreateLink due to UI changes

* Bumped version of json builder

* Reversed previous code

* Removed waitForTimeout

* Removed waitForTimeout after login

* Bumped version of json builder

* Changed delete folder method

* Bumped version of test helper

* Update create link

* Removed waitForTimeout

* Added skip tests since currently only can view relations

* Added more explicit wait

* Removed hard wait

* Removed invalid verification step due to paging

* Moved get set telemetry level from test to before/after test

* Bumped version of test helper

* Added smoke tags - not done

* Added smoke tags

* Fixed merge conflict

* Added code to run smoke E2E tests after each build instead of full E2E tests

* Updated command to run smoke test

* Added more smoke tag

* Added reload tree steps

* Bumped version

* Removed hard waits

* Reduced wait time

* Reversed hard waits

* Set up full test suite in nightly build

* Fixed conditions

* Changed config
2024-05-02 10:09:48 +02:00
Nikolaj Geisle 5c02a560f4 Update openapi for webhooks 2024-05-02 09:55:09 +02:00
Nikolaj GeisleandGitHub bad211027b Don't validate credentials first (#16199) 2024-05-01 14:42:25 +02:00
374d699fd9 Move audit log endpoints to their respective silos and clean up (#16170)
* Move audit log endpoints to their respective silos and clean up

* Fix failing integration tests

---------

Co-authored-by: Mads Rasmussen <madsr@hey.com>
2024-05-01 12:07:06 +02:00
c8180d508b V14: Test new content and media list view service (#16193)
* Fix operation status msg

* Cleanup

* Removing unused status

* Adding WithConfigurationEditor on DataEditorBuilder to be able to create new list views with custom configuration

* Adding list view service tests for content and media

* Adding list view service tests base

* Consistency

* Clean up

* More cleanup

---------

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2024-05-01 10:54:26 +02:00
Andreas ZerbstandGitHub 94b0f4d1a2 Skips failing test (#16197) 2024-05-01 10:00:34 +02:00
Nikolaj GeisleandGitHub abcb837eeb Add events v14/feature/add-webhook-events-endpoint (#16192) 2024-05-01 08:28:32 +02:00
Kenn JacobsenandGitHub e4986b9793 Set the data type editor UI aliases at install time (#16185) 2024-05-01 08:11:32 +02:00
Kenn JacobsenandGitHub 404cb28c59 Add data type editor UI aliases on upgrade (#16183) 2024-05-01 07:50:26 +02:00
d953a78ae6 Add avatarUrls to the userItem responsemodel (#16190)
Move "mapping" to the factory as there are now dependencies to build the model.

Co-authored-by: Sven Geusens <sge@umbraco.dk>
2024-04-30 18:16:30 +02:00
Jacob Overgaard 87e21f5339 update backoffice submodule 2024-04-30 16:41:17 +02:00
Kenn JacobsenandGitHub b5f24d5297 Add member type icon to member type tree output (#16178) 2024-04-30 15:00:53 +02:00
Kenn JacobsenandGitHub de230334be Add user group filter endpoint (#16087) 2024-04-30 14:55:20 +02:00
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
Bjarke BergandGitHub 3eef9b9579 Add oEmbed endpoint to the management api (#16188)
* OEmbed query endpoint

* Log provider instead of url from user
2024-04-30 14:21:50 +02:00
e3a4d4dae2 Handle multiple simultaneous block editor layouts (#16184)
* Handle multiple simultaneous block editor layouts

* Cleanup

---------

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2024-04-30 12:53:26 +02:00
Nhu DinhandGitHub b833bace1e V14 QA Fixing failing tests for Partial View (#16181)
* Added code to block unnecessary resources

* Updated createFolder

* Bumped version of test helper

* Changed clickCreateButton to clickCreateLink due to UI changes

* Bumped version of json builder

* Reversed previous code

* Removed waitForTimeout

* Removed waitForTimeout after login

* Bumped version of json builder

* Changed delete folder method

* Bumped version of test helper

* Update create link

* Removed waitForTimeout

* Added skip tests since currently only can view relations

* Added more explicit wait

* Removed hard wait

* Removed invalid verification step due to paging

* Moved get set telemetry level from test to before/after test

* Bumped version of test helper

* Added smoke tags - not done

* Added smoke tags

* Fixed merge conflict

* Added code to run smoke E2E tests after each build instead of full E2E tests

* Updated command to run smoke test

* Added more smoke tag

* Added reload tree steps

* Bumped version

* Removed hard waits

* Reduced wait time

* Reversed hard waits

* Set up full test suite in nightly build

* Fixed conditions

* Changed config

* Added more waits

* Reversed yaml file

* Reversed yaml files

* Reversed YAML files

* Added .skip for failing tests due to RTE
2024-04-30 09:11:38 +02:00
Jacob OvergaardandGitHub 171eef9078 chore: remove import from backoffice icons since we now only have to rely on the ui library (#16155)
this also fixes an issue where icons did not work anymore due to changes in the backoffice taking over
2024-04-29 16:34:45 +01:00
976146b46e Persist claims from OnExternalLogin event (#16180)
* This fix ensures the claims added doing OnExternalLogin is persisted in the OpenIddict tokens

* Update comment

* Tiniest bit of formatting

---------

Co-authored-by: kjac <kja@umbraco.dk>
2024-04-29 11:54:39 +02:00
0e12b94107 Translate member picker property editor value to V14 compatible format (and back again) (#16149)
* Translate member picker property editor value to V14 compatible format (and back again)

* Fix typo

---------

Co-authored-by: Elitsa <elm@umbraco.dk>
2024-04-29 10:23:07 +02:00
Kenn JacobsenandGitHub d1e90dd3d8 Always use IActionResult - not ActionResult (#16145) 2024-04-29 09:07:19 +02:00
Bjarke Berg 25b47719ad Merge remote-tracking branch 'origin/v14/dev' into v14/dev 2024-04-29 08:23:11 +02:00
Andreas ZerbstandGitHub 9236d6a3b9 V14 QA added acceptance tests for the media section (#16039)
* Added media tests

* Bumped versions

* Bumped version of testhelpers

* Cleaned up

* Added additional media tests

* Bumped version of playwright and testHelpers
2024-04-29 12:07:15 +07:00
Kenn JacobsenandGitHub 16a1f42985 Translate member group picker property editor value to V14 compatible format (and back again) (#16150) 2024-04-26 10:43:33 +02:00
Jacob OvergaardandGitHub e296c173cc V14: add authorized logout callback path (#16152)
* add option to SecuritySettings.cs to allow the developer to set an authorized logout callback path in line with the login callback path

* allow clients using the "Umbraco back-office access" descriptor to return back to either the login path or the logout path
2024-04-26 08:32:42 +02:00
Nikolaj GeisleandGitHub fcbfecd28e Reverse boolean check, to not fail if valid (#16153) 2024-04-26 08:29:50 +02:00
Andreas ZerbstandGitHub e1692f867f Skips failing test (#16148) 2024-04-26 09:22:44 +07:00
Bjarke Berg c4d49c2d73 Merge remote-tracking branch 'refs/remotes/origin/v13/hotfix/performance-optimizations-based-on-eu-data' into v14/dev
# Conflicts:
#	src/Umbraco.Core/Services/UserService.cs
#	src/Umbraco.Infrastructure/Templates/HtmlMacroParameterParser.cs
2024-04-25 15:57:55 +02:00
Nikolaj GeisleandGitHub 7bd499565d V14: Cache user by id (#16139)
* Cache user by id

* Add todo

* Fix tests

* Clear cache after update

* Refer to base class cache instead of implementing own

* Dont hardcode cache key

* Update to be Payload cache refresher instead
2024-04-25 15:56:01 +02:00
Kenn JacobsenandGitHub f824280162 Translate user picker property editor value to V14 compatible format (and back again) (#16151) 2024-04-25 13:20:41 +02:00
Kenn JacobsenandGitHub c85b1d4d37 Make public access endpoints work correctly (#16136) 2024-04-25 13:17:24 +02:00
Kenn JacobsenandGitHub b9e72a2d82 RTE media folder config is stored as a GUID in V14 (#16138) 2024-04-25 12:56:46 +02:00
9fc083fece V14: Migrate notify action from char to string (#16142)
* Migrate nofication chars to strings

* Add a length to the UserGroup2PermissionDto.Permission

* Remove StripWhitespace

It was only nececary when it was nchar

* Better name for migration

* Reuse dictionary in migrations

---------

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2024-04-25 12:51:17 +02:00
Kenn JacobsenandGitHub 7a39314586 Remove all RTE config from appsettings (#16140) 2024-04-25 12:25:47 +02:00
Kenn JacobsenandGitHub ca84d002a4 Fix RTEs stylesheet loading error (#16128) 2024-04-25 12:19:41 +02:00
Zeegaan 37ae17ad20 Use renamed controller 2024-04-25 12:12:56 +02:00
Kenn JacobsenandGitHub 0cac0f8b5c Add endpoint for retrieveing the configured default language (#16086)
* Add endpoint for retrieveing the configured default language

* Update OpenApi.json
2024-04-25 11:42:16 +02:00
Kenn JacobsenandGitHub c7b3175621 Fix data parsing error for dropdown and checkbox list (#16132) 2024-04-25 11:21:12 +02:00
Jacob Overgaard 4b922c65e7 Merge branch 'v14/dev' into release/14.0 2024-04-25 11:09:31 +02:00
Jacob Overgaard f4cc408a11 update backoffice submodule 2024-04-25 11:08:11 +02:00
Bjarke BergandGitHub 89755157c1 Support member saving Cancel (#16147)
* Fixes https://github.com/umbraco/Umbraco-CMS/issues/15152

Handle when a notification cancels the member saving operation.

* Fixed unit tests
2024-04-25 10:59:41 +02:00
Jacob Overgaard a8021c46f6 update backoffice submodule 2024-04-25 10:33:24 +02:00
Bjarke BergandGitHub 73de6e164f Configured the swagger UI to persist the authentication token (still only valid for 5 minutes, as it cannot use refreshtoken) and added filtering. (#16146) 2024-04-25 09:45:36 +02:00
f1e43a7376 Align various controllers (#16137)
* Renamed the language item controllers to follow the current standard (they should not be called "entity")

* Renamed the webhook item controllers to follow the current standard (they should not be called "entity")

* Moved the webhook item controllers to the "/item" silo

* Renamed the user gorup controller base to be singular instead of plural

* Create member group endpoint should yield a 201 created response

* Update member endpoint should yield an empty 200 OK upon success

* Update UpdateUserDataController with correct action name and return an empty 200 OK upon success

* More item endpoints alignment

---------

Co-authored-by: Elitsa <elm@umbraco.dk>
2024-04-25 08:34:21 +02:00
Kenn JacobsenandGitHub c4958365fe Support OpenAPI polymorphic output with JsonDerivedType (#16144) 2024-04-25 08:26:44 +02:00
Nikolaj GeisleandGitHub fc9b47a2ea V14: Fixup webhook endpoints (#16143)
* Use presentation factory, as there is no map definition

* Refactor to actually get entities by key
2024-04-24 15:41:32 +02:00
Kenn JacobsenandGitHub ed64dbf3e4 Cleaned up V13 related and obsoleted system directory constants (#16133)
* Cleaned up V13 related and obsoleted system directory constants

* The LogFiles constant is still used, it seems
2024-04-24 13:54:15 +02:00
c7a1205180 Refactor endpoints to return 0 items if the ids/paths are empty (#16126)
Co-authored-by: Elitsa <elm@umbraco.dk>
2024-04-24 12:28:24 +02:00
Jacob Overgaard ca0c90e321 set version to rc2 2024-04-24 11:47:05 +02:00
Jacob Overgaard a62fbf4269 update backoffice submodule 2024-04-24 11:46:04 +02:00
Andreas ZerbstandGitHub aec90b2e58 Fixed failing test (#16130) 2024-04-24 08:59:18 +02:00
Nikolaj GeisleandGitHub 7bbef2a584 V14: Fix member mapping (#16106)
* convert key to name before saving roles

* Rework MemberEditingService to convert keys

* Rename variable to groups

* Extract to variable
2024-04-23 12:25:36 +02:00
94bf4efe10 V14: Obsolete runtime minification settings (#16123)
* Obsolete RuntimeMinificationSettings

* Obsolete RuntimeMinificationValidator

* Update src/Umbraco.Core/Constants-Configuration.cs

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

* Obsolete RuntimeMinificationCacheBuster

---------

Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com>
2024-04-23 11:17:50 +02:00
Bjarke Berg 07431e092b Do a distinct on user ids before building index, to avoid issue with more than 2100 parameters 2024-04-23 11:03:42 +02:00
Sebastiaan Janssen d4188022af Merge branch 'v14/dev' into contrib 2024-04-23 10:01:39 +02:00
Jacob Overgaard 263b995991 update backoffice submodule 2024-04-23 09:54:14 +02:00
Nikolaj GeisleandGitHub 4118f441c9 Remove UI settings (#16064) 2024-04-22 13:05:12 +02:00
7b46d44eeb RC2 Breaking - Ensure migrations persist the executed key, when executed. (#16113)
* Adds new functionality to the migrations.

This requires a migration to call Context.SetDone() on the migration context. This happens automatically on scoped migrations before the scope is completed. But migrations inheriting the UnScopedMigrationBase needs to call this manually, inside the scopes or when it is considered done.

Thereby, we minimize the risk (and eliminate it for SqlServer) that a migration is executed but the state is not saved.

If a migration is executed without the SetDone is called, the migration upgrader throws an error, so we do not start executing the next migration

* Updated tests

* Renamed after review suggestion

* Rename in test

* More renaming after review

* Remove public modifier from interface

* Add missing space in exception message

---------

Co-authored-by: nikolajlauridsen <nikolajlauridsen@protonmail.ch>
2024-04-22 12:21:16 +02:00
Jacob Overgaard c6898ec3f6 update backoffice submodule 2024-04-22 09:45:39 +02:00
Andreas ZerbstandGitHub b392a499cf V14 QA Token access fix (#16111)
* Added fixtures

* Fixed existing tests

* Temporary file path for updating StorageState

* Fixed indentation

* Bumped version

* Added a storageStatePath

* Deleted unnecessary fixtures

* Deleted commented out code

* Bumped version of testHelpers

* Updated Pipeline

* Bumped version

* Added fixes from review

* Added another wait and goToSection
2024-04-22 13:58:05 +07:00
Nikolaj GeisleandGitHub cceb4180f2 V14: Redirect to login screen (#16051)
* Redirect to login screen after flows complete

* Revoke tokens after completing flow

* Use Ok not Redirect

* skip length check
2024-04-19 09:42:13 +02:00
Jacob Overgaard 4dfd26e59e update backoffice submodule 2024-04-19 09:32:47 +02:00
Bjarke Berg 5c16cfb947 Use TryGetValue instead 2024-04-18 20:44:26 +02:00
Bjarke Berg 61908b4235 Lookup content types once instead of one by one 2024-04-18 16:27:56 +02:00
Bjarke Berg c2d1b7a315 Do not ask options every time for the timeout, instead listen for updates 2024-04-18 16:27:26 +02:00
Bjarke Berg e1e584ba64 Wrap indexing for delivery API in a scope 2024-04-18 16:26:57 +02:00
Bjarke Berg 487f480548 Clean up 2024-04-18 13:43:01 +02:00
d04769a84b V14/feature/all segment endpoint (#16054)
* Added All Segments service with backing noopService

* Add openapi spec

* Apply suggestions from code review

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

* Fix ctor

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
2024-04-18 12:20:26 +02:00
Jacob OvergaardandGitHub 337d547698 Do not refer to $npmTag which does not exist (#16075)
`--access` is not required either since we now specify that in the package.json file
2024-04-18 10:22:11 +02:00
Nikolaj Geisle 8247360700 Merge branch 'release/14.0' into v14/dev 2024-04-18 09:02:28 +02:00
Nikolaj Geisle 8b0bf9da27 bump version 2024-04-18 09:01:17 +02:00
e33d7a779d V14: Apply sliding window token expiry based on the configured max login lifetime (#16028)
* Consider max login lifetime with access and refresh tokens

* Adding clarification comment

* Updated comment and added a little explanation for future clarity

---------

Co-authored-by: kjac <kja@umbraco.dk>
2024-04-18 08:24:58 +02:00
Nhu DinhandGitHub e20e001c12 V14 QA Added skip to the failing test due to UI changes (#16076)
* Added skip to the failing test due to UI changes

* Added skip tests

* Added skip tests
2024-04-17 15:33:05 +02:00
Andreas ZerbstandGitHub 55f68f477f Added timeout (#16073) 2024-04-17 15:30:51 +02:00
ChadandMichael Latouche cc39d36ff5 Correct BasicAuthSettings.Enabled description
Correct BasicAuthSettings.Enabled description.
2024-04-17 15:24:35 +02:00
Bjarke Berg 5d51d81545 Unbreak change by adding obsolete ctor 2024-04-17 13:05:03 +02:00
Bjarke Berg 7b4581bd8d Request cache the permission lookup 2024-04-17 12:55:14 +02:00
Jacob Overgaard 15b85d0e4a update backoffice submodule 2024-04-17 12:36:35 +02:00
Jacob Overgaard 8a15c14e70 update backoffice submodule 2024-04-17 11:21:17 +02:00
Jacob Overgaard 1e7b048756 update backoffice submodule 2024-04-17 09:38:48 +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
Zeegaan 0993a61d39 dont depend on e2e 2024-04-17 08:07:01 +02:00
dependabot[bot]andJacob Overgaard bb9e66d0da Bump vite from 5.2.2 to 5.2.6 in /src/Umbraco.Web.UI.Login
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.2.2 to 5.2.6.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.2.6/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-16 17:23:20 +02:00
ElitsaandJacob Overgaard dc9c28db9a Added missing endpoints 2024-04-16 17:18:51 +02:00
Jacob Overgaard db0c315aae bump to 14.0.0-rc1 2024-04-16 17:14:45 +02:00
6dd08b2377 V14 External login linking + Proposed error handling (#16052)
* Added mostly working linking methods to the backoffice controller

Cleanup still required

* Added proposed default error handling extionsion methods

* Cleanup, clarification and PR feedback

* More cleanup

* Transformed the OAuthOptionsExtensions into a helper class

this allows for proper DI for the dependencies

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
2024-04-16 17:08:55 +02:00
Lee KelleherandGitHub 298f4de973 Merge pull request #16069 from umbraco/v14/feature/login-assets-cleanup
V14: Optimise login screen javascript
2024-04-16 15:59:12 +01:00
Jacob Overgaard 9be314b509 load the auth bundle 2024-04-16 16:52:28 +02:00
Bjarke BergandGitHub 36bde9e7f0 Add JsonObjectConverter to the default serializer and make a safe check before adding index (#16067)
* Do not add index if it already exists

* Add the JsonObjectConverter by default. This is required by the block editor

* Update test to reflect that fact we have the json object converter applied
2024-04-16 16:47:58 +02:00
Jacob Overgaard 41bbe67343 update backoffice submodule 2024-04-16 16:43:35 +02:00
Jacob Overgaard 9698b8331e make the login client load in the uui-css assets directly from the backoffice client since we are hooking on to the uui javascript anyway (this way we dont have to maintain uui several places) 2024-04-16 16:34:43 +02:00
Jacob Overgaard 43e4d3e83d make sure the login screen doesn't load entrypoints meant for the backoffice client (only simple extensions are supported on the login screen) 2024-04-16 16:31:15 +02:00
Jacob OvergaardandGitHub a15c8ddf3b V14/chore/pipelines e2e nuget (#16066)
* make the myget release wait for e2e tests

* update api docs after the nuget stage
2024-04-16 14:56:40 +02:00
Bjarke BergandGitHub 43bf2a26d1 Fixed issue with custom fields not determined as custom (#16065) 2024-04-16 13:39:14 +02:00
cd6f2b4b6d V14: Support custom Swagger schema and operation identifiers for external packages (#16062)
* Adding ISchemaIdHandler and core implementation enabling custom package implementations

* Adding IOperationIdSelector and refactoring core implementation to enable custom package implementations

* Adding OperationIdSelector core implementation enabling custom package

* Removing old way of Operation id extensibility

* Registering schema and operation id handlers

* Refactoring based on unnecessary param

* Obsoletion

* Refactoring SchemaIdSelector to make use of the new ISchemaIdHandler

* Update OpenApi.json

* Revert "Update OpenApi.json"

This reverts commit c9165f174b.

---------

Co-authored-by: kjac <kja@umbraco.dk>
2024-04-16 12:52:45 +02:00
Nhu DinhandGitHub 0988f4a7be V14 QA Added missing tests for Partial View, Stylesheet, Script, Template (#16059)
* Removed hard waits

* Updated tests for Template and Partial View - not done

* Added insert section tests

* Used defaultTemplateContent to avoid duplicate code

* Added insert section tests

* Added missing tests for Partial View

* Added missing tests for Scripts

* Added missing tests for Stylesheet

* Added missing tests for Template

* Changed method's name due to test helper changes

* Added skip tests

* Bumped version of test helper

* Reversed waits

* Changed createThreeDotsButton to createButton due to UI changes

* Removed List View - Members tests as the UI changes

* Added more waits

* Removed unnecessary waits
2024-04-16 12:12:09 +02:00
Jacob OvergaardandGitHub 9f6af970b4 V14/feature/login image (#16063)
* update the login image to the v14 variant

* switch out the default value of the "alternative" logo to the dark version since it fits better in this version
2024-04-16 11:34:19 +02:00
Ronald BarendseandGitHub e680be506f v14: Update ImageSharp and MailKit dependencies (#16061)
* Remove duplicate PackageReferences

* Update ImageSharp dependencies

* Update MailKit dependency to 4.5.0
2024-04-16 11:12:05 +02:00
Lee KelleherandGitHub 68f623ede8 V14: MediaPicker/MNTP - Changed StartNodeId from a Udi to Guid (#16042)
* MediaPicker3: Changed `StartNodeId` from a `Udi` to `Guid`

* MNTP: Changed `StartNodeId` from a `Udi` to `Guid`
2024-04-16 11:01:18 +02:00
Ronald BarendseandGitHub 2d850bf8f1 v14: Add async methods to Deploy interfaces (#16055)
* Add async method to IContextCache

* Add async methods to IImageSourceParser and ILocalLinkParser

* Add async methods to IDataTypeConfigurationConnector, IServiceConnector and IValueConnector

* Obsolete non-aysnc methods

* Add cancellation tokens to new async methods

* Add ConfigureAwait(false) to awaits
2024-04-15 18:04:47 +02:00
Kenn JacobsenandGitHub 5ddf7a1be7 Clean up FIXMEs in security controllers (#16038) 2024-04-15 17:27:37 +02:00
3edc783ddb V14: Additional blueprint endpoints (#16047)
* Fix /item endpoint response when 0 ids

* Adding GetPagedByContentTypeKeyAsync to IContentBlueprintEditingService

* Adding mapping for new DocumentTypeBlueprintItemResponseModel

* New endpoint and operation status handling

* Fix test cases

* Added tests

* Fixed partial test references

* Rename method

* Add ancestors endpoint for blueprints

* Change == to is

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

---------

Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
2024-04-15 13:49:08 +02:00
MoleandGitHub 2a889f502b V14: Clean up backend translation files (#16050)
* Remove unused translation areas

* Cleanup translation files
2024-04-15 11:13:58 +02:00
Bjarke Berg ee5936804d Do not execute query if no macros found 2024-04-15 10:55:42 +02:00
Nikolaj GeisleandGitHub e15bddcc39 Set invite users to false if deny local login is true (#16043) 2024-04-15 10:26:49 +02:00
Ronald BarendseandGitHub ad82fe89cf v14: JSON schema tool improvements (#16035)
* Use require modifier instead of setting null-suppressed default values

* Only remove read-only properties when IgnoreReadOnlyProperties is set

* Obsolete UmbracoPath property and remove work-around for obsolete setter
2024-04-15 08:58:52 +02:00
767c417153 Only add a SQL in statement if there are keys to filter on (#16044)
* Only add a SQL in statement if there are keys to filter on

* Improved faulty query fix by calling a cached path.

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
2024-04-15 08:55:50 +02:00
Kenn JacobsenandGitHub 576b360cce Removed leftover System.Text.Json dependencies (#16040) 2024-04-15 08:51:00 +02:00
Bjarke BergandGitHub 2f0b3d055f Fixed check to support unix/linux OS (#16045) 2024-04-12 14:57:31 +02:00
89de08a1e8 V14: Remove member list view (#15979)
* Remove default member list view

* Fix up test

---------

Co-authored-by: nikolajlauridsen <nikolajlauridsen@protonmail.ch>
2024-04-12 10:58:26 +02:00
Sebastiaan Janssen 62421f67ac Sync submodule 2024-04-11 17:08:55 +02:00
Sebastiaan Janssen 403ab49c22 Merge branch 'v14/dev' into contrib 2024-04-11 16:49:21 +02:00
Jacob Overgaard 5c3527d4f4 bump to 14.0.0-beta004 2024-04-11 15:57:48 +02:00
Jacob Overgaard 159e103936 Merge branch 'release/14.0' into v14/dev 2024-04-11 15:56:22 +02:00
Jacob Overgaard ba16aef194 add manual check for validation 2024-04-11 14:59:39 +02:00
Jacob Overgaard 8965e9c180 update dependencies 2024-04-11 14:59:19 +02:00
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
Nikolaj GeisleandGitHub 0b62df2bb4 Add "UserIsAlreadyLoggedIn" property to BackOfficeLoginModel (#16034) 2024-04-11 13:48:20 +02:00
Jacob Overgaard 821e4e439e Merge remote-tracking branch 'origin/v14/dev' into release/14.0 2024-04-11 12:21:12 +02:00
Jacob Overgaard 40e6359499 update backoffice submodule 2024-04-11 12:20:45 +02:00
Jacob Overgaard 5c197cfa43 Merge remote-tracking branch 'origin/v14/dev' into release/14.0 2024-04-11 12:20:16 +02:00
Bjarke BergandGitHub 782c009754 Improvements to the OpenAPI Docs (#14754)
* Ensure APIS only can produce one response type

* Ensure APIs document Unauthorized and Forbidden results

* If a controller constructor injects IAuthorizationService we assume the actions can return forbidden

* Updated OpenApi.json

* OpenApi.json

* Update OpenApi.json

* Update OpenApi.json
2024-04-11 11:58:47 +02:00
Alina-Magdalena TincasandGitHub 85747593cc Update v14 api docs with info from umbraco docs (#15977)
* update api docs

* small update
2024-04-11 11:19:23 +02:00
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
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 JacobsenandGitHub faee63627f Cleaned up some low-hanging FIXMEs (#16010)
* Cleaned up some low-hanging FIXMEs

* Fixed merge
2024-04-11 10:50:31 +02:00
Kenn JacobsenandGitHub a982df97a6 Remove manifest validators (#16027)
* Remove manifest validators

* Remove "Configuration" from RegexValidator
2024-04-11 10:42:22 +02:00
Kenn JacobsenandGitHub 459cd79a06 Remove RTE embedded image handling + clean up file upload configuration (#16025) 2024-04-11 10:40:44 +02:00
Jacob Overgaard 10fa3b87bf update backoffice submodule 2024-04-11 10:30:40 +02:00
Jacob OvergaardandGitHub 858a1af6c1 update imports on Web.Ui.Login after breaking change merged in the backoffice client (#16033) 2024-04-11 09:27:56 +02:00
Kenn JacobsenandGitHub 45a169f62b Clean up explicit test dependencies for System.Text.Json serializer (#16017) 2024-04-11 09:17:48 +02:00
Jacob Overgaard 5a87b1af6f update backoffice submodule 2024-04-11 09:15:23 +02:00
48e9be2b73 Content & media url endpoints (#15832)
* First go at the document url controller

Added optimizations for documenturlFactory

* Updated Document Url endpoint

Duplicated the endpoint for media
Cleaned up some code marked async that will never hit a long running operation

* Remove dupplicate attributes

* Rename resource sets to response model

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
2024-04-11 09:10:45 +02:00
Kenn JacobsenandGitHub d47638df98 Remove remnants of the Angular implementation (#16026) 2024-04-11 09:08:56 +02:00
Ronald BarendseandGitHub 80c5d28316 v14: Update .NET dependencies to 8.0.4 (#16031)
* Update .NET dependencies to 8.0.4

* Update StyleCop.Analyzers to 1.2.0-beta.556
2024-04-10 21:32:58 +02:00
Ronald BarendseandGitHub 7c2a0f8976 Update to NJsonSchema 11.0.0 and use SystemTextJsonSchemaGeneratorSettings (#16030) 2024-04-10 21:25:54 +02:00
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
Ronald BarendseandGitHub 1c5e27397b Remove Newtonsoft.Json from tests (#16029) 2024-04-10 19:30:32 +02:00
Kenn JacobsenandGitHub 1c799802c5 Deduplicate the magic string "/management/api/" (#16016) 2024-04-10 14:21:59 +02:00
Bjarke Berg 7b6db02426 Merge remote-tracking branch 'origin/v14/dev' into v14/dev 2024-04-10 13:21:38 +02:00
Bjarke Berg 46994c2d1c Added missing index, while adding column key to users 2024-04-10 13:21:32 +02:00
d50b3a521e Simplify user group authorization failure statuses (#16009)
Co-authored-by: Elitsa <elm@umbraco.dk>
2024-04-10 12:39:22 +02:00
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
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
Jacob Overgaard c241bfd85a update backoffice submodule 2024-04-10 11:56:59 +02:00
Ronald BarendseandGitHub 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
Jacob Overgaard eecb493585 use correct types for login build 2024-04-10 08:53:47 +02:00
Jacob Overgaard fe7f79aacf update backoffice submodule 2024-04-09 17:45:44 +02:00
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 MarinovskaandGitHub ac7e4c1fa3 Clean up comments that won't apply (#16018) 2024-04-09 12:07:55 +02:00
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
Sebastiaan Janssen 9ad413db4c Merge branch 'v14/dev' into contrib 2024-04-09 11:18:11 +02:00
Kenn JacobsenandGitHub de1fc65393 Swagger: Don't use allOf for inheritance + fix polymorphic models (#15985)
* Swagger: Don't use allOf for inheritance + fix polymorphic models

* Cannot mix $ref and nullable in OpenAPI

* Update OpenApi.json

* Regenerate OpenApi.json
2024-04-09 10:20:20 +02:00
MoleandGitHub 91085d9b21 Refactor DocumentPresentationFactory to use ITemplateService instead of IFileService (#15995) 2024-04-09 10:18:26 +02:00
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
187d45860a V14: Add cancellation tokens to all endpoints (#15984)
* Add CancellationToken to controllers

* Fix GetManagementApiUrl

* Forgotten Item and Tree controllers

* Document Blueprint and Version endpoints

* Fix merge conflict

* Cleanup

---------

Co-authored-by: Elitsa <elm@umbraco.dk>
2024-04-09 08:18:45 +02:00
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
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
Bjarke BergandGitHub 85d35b3a69 Ensure the user is authenticated to see webprofiler/miniprofiler logs (#16007) 2024-04-08 11:14:25 +02:00
Kenn JacobsenandGitHub 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
Kenn JacobsenandGitHub c6f1189418 Return 404 instead of 500 when an "original parent" has been deleted (#15990) 2024-04-05 12:49:24 +02:00
Lars-ErikandJason Elkin b0016687eb Implementors using Umbraco.Tests.Integration won't have to override GetLocalizedTextService 2024-04-04 17:07:24 +01:00
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
Elitsa MarinovskaandGitHub 43f77eef64 Remove StaticServiceProvider usage (#15978) 2024-04-04 11:25:13 +02:00
Nhu DinhandGitHub 978d191039 Bumped version of test helper (#15981) 2024-04-04 10:58:49 +02:00
Lee KelleherandGitHub ac1ef52aba Download Created Package MIME type (#15982)
Sets the appropriate MIME type of the Created Package download,
this would be either an XML string or a ZIP file. The MIME type will
be used on the client-side to handle the responds accordingly.
2024-04-04 10:37:42 +02:00
Nikolaj GeisleandGitHub b5c6a2088f Return null if container type is not found (#15974) 2024-04-04 09:50:31 +02:00
Elitsa MarinovskaandGitHub 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 JacobsenandGitHub 70878f501e Make property container type parsing explicit (#15963) 2024-04-04 09:32:24 +02:00
Jacob Overgaard d74b4d99d1 update backoffice submodule 2024-04-04 09:14:50 +02:00
Kenn JacobsenandGitHub 75b1d4729f Examine entity search for documents, media and members (#15972) 2024-04-03 18:49:23 +02:00
a95a092c39 V14: login screen (#15932)
* remove the temp login screen

* set login build back to esm

* convert razor entrypoint to show new login screen

* enable loading a user defined stylesheet that can be overridden through RCL mechanics

* remove unused file

* for now, remove the call to the old `localizedtext` endpoint until a replacement has been built

* add fallback font

* remove login to the old backoffice

* change models for twoFactorView

* Send view that have to be used for 2fa.

* get 2fa providers from the login call directly

* Return 2fa providers

* map enabledTwoFactorProviderNames to the view

* use correct endpoints for 2fa

* Send link

* change key to id in querystring

* improve localization

* merge authUrl

* Added flow query parameter

* remove unused getter

* remove debug info

* fix fallback value

* fallback value

* Added invite url to email

* Clean up

* Added password configuration to the verify responses, so the client knows, and have confirmed the user is allwed to see it

* allow reset password

* Allow anonymous on invite create password

* open api

* check for invite

* fix fallback text

* validate invite token

* try to extract the problem details object

* add error logging

* fix invite user parameters

* Use correct id for performing user

* Allow password reset on yourself without the old password, if you are currently invited

* hardcode the authorize endpoint url for now

* fix handlers and disable icons for now

* import icons from backoffice client

* add backoffice path to icons

* fix handler for 2fa custom view

* update image temporarily

* remove old icon registry

* convert login components to UmbLitElement

* convert `UmbAuthContext` into a real context with a token

* cleanup dependencies

* optimise vite

* remove lit

* optimise external login component loader

* use generated resources for reset password

* use generated resources for all methods

* import and register the main bundle

* register localization

* change localization keys

* update all localization keys to new format

* replace tokens

* copy code

* added danish translations

* convert to lowercase

* all languages should have same weight

* added german translations

* add missing variable

* missing text

* added dutch translations

* added swedish translations

* added norwegian translations

* add temporary fix so the login app can be built

* make sure BuildLogin is run only after BuildBellissima has been run to ensure the dependencies are present on disk

* run the real login build in pipelines

* set vite language to en-us

* optimise msw warnings

* wait a bit before rendering the form so we know everything has been loaded

* Add external login endpoint + move models around

* Allow FORM submissions to the external login endpoint

* rename `IdentityProvider` back to `Provider` to avoid a breaking change from V13

* type in url for login-external manually (for now) since route attributes are no longer a thing

* move GET back to POST for external forms

* load in public manifests on boot of the login screen

* Clean up

* handle the case where an external login provider has disabled local login and show a message instead of the login form

* remove external login providers from the server login screen

* add more translations

* use the friendly greeting for the error layout

* show login form

* add mock handler for public manifest endpoint

* remove the external login layout

* fix test

* Added generic English localization

as a fallback language.

---------

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
Co-authored-by: kjac <kja@umbraco.dk>
Co-authored-by: leekelleher <leekelleher@gmail.com>
2024-04-03 15:45:09 +02:00
be58f3142d V14 QA Fixed/Cleaned up the api acceptance tests (#15964)
* Removed api tests for RelationType since it is impossible to create/update/delete relation type

* Fixed api tests for UserGroup

* Fixed api tests for UserAvatar

* Fixed api tests for User

* Fixed api tests for Temporary File

* Fixed api tests for Dictionary

* Fixed api tests for DataType

* Fixed api tests for DataTypeFolder

* Cleaned up

* Bumped version of test helper

* Update tests/Umbraco.Tests.AcceptanceTest/tests/ApiTesting/Dictionary/Dictionary.spec.ts

Co-authored-by: Andreas Zerbst <73799582+andr317c@users.noreply.github.com>

* Reversed the api tests for Relation Type

---------

Co-authored-by: Andreas Zerbst <73799582+andr317c@users.noreply.github.com>
2024-04-03 12:06:54 +02:00
1437483a68 V14: Add IsAdmin to user and current user response models (#15969)
* Added isAdmin og user response models

* updated factory

* revert line removal

---------

Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
2024-04-03 11:08:47 +02:00
Kenn JacobsenandGitHub 06cfec25aa Fix swagger schema error after #15946 (#15971) 2024-04-03 10:16:02 +02:00
Elitsa MarinovskaandGitHub 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
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 JacobsenandGitHub 1866b61e12 Use an extension method for fetching a required user in a common way (#15953) 2024-04-02 11:20:05 +02:00
Kenn JacobsenandGitHub 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
Nhu DinhandGitHub 892a39d39a V14 QA Fixed the failing tests due to UI changes (#15944)
* Bumped version of test helper

* Changed clickCreateButton to clickCreateLink due to UI changes

* Bumped version of json builder

* Changed delete folder method

* Bumped version of test helper

* Added skip tests since currently only can view relations
2024-04-02 09:39:01 +02:00
Jacob Overgaard b3c25ca477 update backoffice submodule 2024-03-27 17:43:59 +01: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
Jacob Overgaard 03044202fa update backoffice submodule 2024-03-27 15:20:40 +01:00
1fdc0e2582 Relations/types mangement api cleanup (#15910)
* Made Relation types read only trough the management api

* Removed path from RelationTypeResponseModel

* Removed RelationTypes tree controllers

* Deleted ByChildRelationController as the usecase has been internalized

* Reworked RelationResponseModel

* Added the ID the toe relation response model

* RelationType.IsDeletable is no longer relevant for the management api

Since types are only managed trough code.

* Removed RelationType create/update leftovers

Brought RelationType responsemodels more in line with similar models
Update openapi spec

* Review improvements

* Renamed controller file to match class name

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
Co-authored-by: Mads Rasmussen <madsr@hey.com>
Co-authored-by: kjac <kja@umbraco.dk>
2024-03-27 10:01:29 +01:00
e1ee896556 Refactor Tracked references endpoints (#15933)
* Moved tracked references under their respective sources

Prepped the endpoints to be more inline with how we will optimize in the future

* Fixed some endpoint signature issues and update openapi spec

* Partial Revert "Moved tracked references under their respective sources"

This reverts the submodule update in commit 3819276a74.

* Fix duplicate line

* Rework for polymorphic output

* Improved endpoint naming

* Regenerate OpenApi.json

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
Co-authored-by: kjac <kja@umbraco.dk>
2024-03-26 14:32:56 +01:00
Jacob Overgaard 2175d523cc update backoffice submodule 2024-03-26 09:55:04 +01:00
Jacob Overgaard 7cb03c3a71 update backoffice submodule 2024-03-26 09:07:41 +01:00
3e6d48e6d0 Fixed contentTypeIds being mapped to the id of the wrapping entity (#15941)
Co-authored-by: Sven Geusens <sge@umbraco.dk>
2024-03-25 17:45:50 +01:00
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
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
Jacob Overgaard e441639786 update backoffice submodule 2024-03-25 11:10:18 +01:00
Jacob Overgaard 82f725b2be update backoffice submodule 2024-03-25 10:57:08 +01:00
Jacob Overgaard c620b84fdc update backoffice submodule 2024-03-25 09:57:16 +01:00
Jacob Overgaard d5d7023eaa update backoffice submodule 2024-03-22 13:28:02 +01:00
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 JacobsenandGitHub 0ed65671bb Use the correct localization keys for core property validation errors (#15931) 2024-03-22 10:19:33 +01:00
Jacob Overgaard 113068e17d update backoffice submodule 2024-03-22 09:55:34 +01:00
kjac bef0d659c0 Update OpenApi.json (add missing manifest method) 2024-03-21 15:01:35 +01:00
Kenn JacobsenandGitHub 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
Andreas ZerbstandGitHub 129e9004d8 Bumped timeout for auth test (#15917) 2024-03-20 13:03:55 +01:00
Bjarke BergandGitHub a9e5a46829 Added missing 404 (#15915) 2024-03-20 11:19:52 +01:00
Bjarke Berg d03362486b Merge remote-tracking branch 'origin/v14/dev' into v14/dev 2024-03-20 10:30:40 +01:00
Jacob Overgaard 1ab7c304bb update backoffice submodule 2024-03-20 10:23:26 +01:00
Bjarke Berg 2cb7597749 Merge remote-tracking branch 'origin/v14/dev' into v14/dev 2024-03-20 09:44:43 +01:00
Ronald BarendseandGitHub 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
Jacob Overgaard 3f95af9b02 update backoffice submodule 2024-03-19 17:34:34 +01:00
Jacob Overgaard 0ed1d6869a update beta002 backoffice submodule 2024-03-19 16:36:14 +01:00
Jacob Overgaard 5a23127832 update beta002 backoffice submodule 2024-03-19 16:22:15 +01:00
Nikolaj GeisleandGitHub 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
Jacob Overgaard 08783c6065 bump version to beta003 2024-03-19 14:20:23 +01:00
Jacob Overgaard 7213e940ca Merge branch 'v14/dev' into release/14.0 2024-03-19 14:14:17 +01:00
Jacob Overgaard 4e0df98c34 update backoffice submodule 2024-03-19 13:44:12 +01:00
Andreas ZerbstandGitHub d2f8b18456 Skipped flaky test (#15905) 2024-03-19 13:31:08 +01:00
Andreas ZerbstandGitHub 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
Bjarke BergandGitHub 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
Bjarke Berg 697c13c649 Merge remote-tracking branch 'origin/v13/dev' into v14/dev
# Conflicts:
#	src/Umbraco.Infrastructure/Migrations/PreMigration/DataTypeSplitDataCollector.cs
2024-03-19 08:52:47 +01:00
Kenn JacobsenandGitHub 39085b9ad4 Add DB locking for container APIs (#15870) 2024-03-18 14:27:11 +01:00
Elitsa MarinovskaandGitHub e9cfcf4e99 Revoke previous sessions when AllowConcurrentLogins is false (#15892) 2024-03-18 13:18:57 +01:00
Andreas ZerbstandGitHub 76066eac5a Skipped failing tests (#15897) 2024-03-18 12:04:51 +01:00
Jacob Overgaard 82611f9fd2 update backoffice submodule 2024-03-18 11:59:05 +01:00
MoleandGitHub 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 cb02c51da7 Merge remote-tracking branch 'origin/v13/dev' into v14/dev 2024-03-18 08:36:36 +01:00
Bjarke Berg 6f26aae708 Update client 2024-03-15 17:13:16 +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
Nikolaj GeisleandGitHub 0bafede51a Remove mention of backoffice project (#15894) 2024-03-15 13:40:09 +01:00
MoleandGitHub b619399edb Remove KeepAliveJob (#15891) 2024-03-15 12:48:31 +01:00
Jacob Overgaard c2fe847ba5 update backoffice submodule 2024-03-15 11:46:19 +01:00
Kenn JacobsenandGitHub 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 JacobsenandGitHub 7964f33d0d Removed "type" from tree item response models (#15862) 2024-03-15 10:37:32 +01:00
Jacob Overgaard ab3e420cd2 update backoffice submodule 2024-03-15 09:08:52 +01:00
Kenn JacobsenandGitHub 072903cb7a Port V13 backoffice cookie validation to V14 (#15886)
* Port V13 backoffice cookie validator to V14

* Don't use ISystemClock
2024-03-15 07:53:06 +01:00
6e1924d054 V14: Create member filter (#15877)
* Update filter to include membergroup name

* add filter by isApproved

* Add isLockedOut

* Implement member filter

* Move filter logic to repository

* Add more fields to sort by

* Update openApi

---------

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2024-03-14 14:24:10 +01:00
Jacob Overgaard 88a1768b1d update backoffice submodule 2024-03-14 11:16:00 +01:00
ffcc4ac170 fix udi leaking in the management api (#15684)
* [WIP] Stop Udi leaking on ConterPicker

* Refined Udi conversion for contentPicker

Cleaned up base construcor usage to move away from the obsoleted one.

* Fixed Udi lieaking in MNTP

* Stopped Udi bleeding for MultiUrlPicker

* Remove unused assignment

* Resolved namespace issue

* Use correct configuration value for MNTP udi parsing

* Turn helper auto props into local helper function to avoid unnecesary serialization

* Remove Newtonsoft.Json from Multi URL picker

* Fixed MNTP configuration serialization

* Changed MNTP editor data from csv guid to EditorEntityReference[]

* Added remarks for the MNTP editor conversion logic

* Reworked MNTPPropertyEditor Unittests

changed intent of one
fixed bug because of 1 rework

* Update OpenApi.json

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
Co-authored-by: Elitsa <elm@umbraco.dk>
Co-authored-by: kjac <kja@umbraco.dk>
2024-03-14 11:06:46 +01:00
Jacob Overgaard f41a4f1f06 update backoffice submodule 2024-03-14 10:48:03 +01:00
9c3bc4a5c0 V14: Fix FIXMEs (#15869)
* Fix FIXMEs

* Bring AuthorizationPolicies.DenyLocalLoginIfConfigured authz policy to an action level as it doesn't apply to all

* Remove unnecessary policy

* Remove AuthorizationPolicies.DenyLocalLoginIfConfigured from base and apply to specific controllers

* Fix comment

* AllowAnonymous as it doesn't get it from the base anymore

* Reorder

---------

Co-authored-by: Elitsa <elm@umbraco.dk>
2024-03-14 09:02:17 +01:00
3fdf43cff5 Make GetByIds in ContentService extensions non nullable (#15736)
* Make GetByIds in MediaService extensions nullable

* Update src/Umbraco.Core/Packaging/PackagesRepository.cs

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

* Update src/Umbraco.Core/Services/MediaServiceExtensions.cs

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

* Update src/Umbraco.Infrastructure/Persistence/Repositories/Implement/CreatedPackageSchemaRepository.cs

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

* Make extensions non nullable

* Update src/Umbraco.Infrastructure/Persistence/Repositories/Implement/CreatedPackageSchemaRepository.cs

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

---------

Co-authored-by: Jason Elkin <jasonelkin86@gmail.com>
Co-authored-by: Sebastiaan Janssen <sebastiaan@umbraco.com>
2024-03-13 15:20:31 +01:00
36bb1c9d78 Add "is deletable" to relation types + align namespaces for controllers (#15867)
Co-authored-by: Elitsa <elm@umbraco.dk>
2024-03-13 15:01:07 +01:00
MoleandGitHub ae675b28f7 V14: Remove duplicate pagination helper (#15856)
* Remove management PaginationService

* Remove usage of PaginationHelper in FilterMemberFilterController
2024-03-12 12:57:29 +01:00
Zeegaan e84e8fdcec Update sln to include management api 2024-03-12 11:10:15 +01:00
MoleandGitHub 1e59041667 Expose default listview ids in datatype configuration endpoint (#15865) 2024-03-12 10:40:48 +01:00
9c58714343 V14: Rename new projects (#15836)
* Rename Web.UI.New back to Web.UI

* Delete new backoffiec folder

* Rename client project

* Add new submodule

* Update template csproj

* Remove more mentions of new

* Add missing views

* Moving up the "Umbraco.Web.UI" proj reference, so that it is the first project listed in solution file (.sln) since it will be selected as startup one in VS by default.

* don't include grid

* Update with section of how to get started with backoffice

* Update .github/BUILD.md

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

* Add line about white page

---------

Co-authored-by: Elitsa <elm@umbraco.dk>
Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com>
2024-03-12 10:17:42 +01:00
Kenn JacobsenandGitHub 69a691f315 Removed unused content editing models (#15855) 2024-03-11 13:15:25 +01:00
Bjarne FyrstenborgandGitHub ae541f5636 Webhook paged results (#15802)
* Add controller to fetch paged results of webhooks

* Return OK directly

* Fix total

* Update all languages
2024-03-11 09:56:32 +01:00
ea31ddea6d Enable member management authorization (#15843)
* Enabled Section authorization on member management endpoints

Changed filter endpoints from tree style auth to section as it returns the same model and be in line with other filter endpoints

* Clean up member filter base inheritance

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
Co-authored-by: kjac <kja@umbraco.dk>
2024-03-08 10:37:46 +01:00
MoleandGitHub eca13ea011 V14: Add additional validation around manipulating groups (#15834)
* Add additional validation when removing a user from usergroup

* Add additional validation to UpdateUserGroups

* Don't re-implement operation results

* Add additional validation to the update user endpoint

* Complete scopes where it's safe to do so
2024-03-07 13:21:48 +01:00
Jacob Overgaard 614c384c47 bump version to beta002 2024-03-06 16:28:07 +00:00
Jacob Overgaard 396ee78a51 Merge branch 'v14/dev' into release/14.0 2024-03-06 15:08:00 +00:00
Jacob Overgaard 6f7c94efdb update backoffice submodule 2024-03-06 15:07:27 +00:00
Bjarke Berg 2cdc6fddc7 Merge branch 'v14/dev' into release/14.0 2024-03-06 14:33:52 +01:00
Jacob Overgaard a48e7a7452 update backoffice submodule 2024-03-06 10:26:05 +01:00
9e455f9325 Check for duplicate keys on media if we know it's a fresh entity (#15838)
Co-authored-by: Sven Geusens <sge@umbraco.dk>
2024-03-06 08:21:33 +01:00
da6aa7735a V14: add checkboxlist to list of migrations (#15844)
* add checkboxlist to the list of migrations that should be converted

* Adds string-array type-checking

to the `ValueListUniqueValueValidator`.

As `value?.ToString()` would give you a literal string of the
object-type, e.g. `"System.Collections.Generic.List`1[System.String]"`.

* Clean up and add tests

---------

Co-authored-by: leekelleher <leekelleher@gmail.com>
Co-authored-by: kjac <kja@umbraco.dk>
2024-03-06 06:53:17 +01:00
Elitsa MarinovskaandGitHub 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
Jacob Overgaard 7710d9d66c update backoffice submodule 2024-03-05 14:18:40 +01:00
Kenn JacobsenandGitHub 3830e40eff Remove legacy media picker from install (#15835)
* Remove legacy media picker from install

* Fix bad auth policy
2024-03-05 13:33:04 +01:00
Jacob Overgaard cc6aa93ee7 update backoffice submodule 2024-03-04 22:01:09 +01:00
Jacob Overgaard 72cda44db0 correct version name replacing the double dashes with a single dash 2024-03-04 21:59:00 +01:00
Jacob Overgaard 28b5113969 update backoffice submodule 2024-03-04 17:44:41 +01:00
Jacob Overgaard fb2b6d446e update backoffice submodule 2024-03-04 17:40:55 +01:00
Jacob Overgaard 1b85341a6d update backoffice submodule 2024-03-04 17:13:46 +01:00
1fd4fce3a8 Rename policies to original names (#15825)
* Removed the "New" from all policy names now that the legacy backoffice is gone.

* more policy renaming

* more policy renaming

* Uncommenting tests

* Cleanup

* Removing unused policy names

* Renaming AdminUserEditsRequireAdmin to a more meaningful UserPermissionByResource

* Completing TODO and some alphabetical rearranging

---------

Co-authored-by: Elitsa <elm@umbraco.dk>
2024-03-04 15:51:24 +01:00
Jacob Overgaard 4c1cd3008c update backoffice submodule 2024-03-04 14:37:03 +01:00
3c36fd5f06 V14: Data type filter endpoint (#15804)
* Implement endpoints

* Update to orderby and orderdirection

* Implement Filter endpoint

* Remove old ByEditorUiAlias endpoint

* Add clarifying comments

* Fix up according to review

* use model in reflection

* Remove leftover sorting

* remove ordering

* Implement skip and take directly in service

* Dont use GetAllAsync

* Update OpenApi

* Refactor get all to return full list if no keys are given

* Revert "Refactor get all to return full list if no keys are given"

This reverts commit 1dd3167e96.

* Use invariant contains

* A little query optimization

---------

Co-authored-by: kjac <kja@umbraco.dk>
2024-03-04 13:21:40 +01:00
Sven Geusens 3c653d11bb Removed smidge injection in viewImports since we no longer include smidge 2024-03-04 10:11:08 +01:00
Kenn JacobsenandGitHub d523541340 Validate culture codes for document variants (#15818)
* Validate culture codes for document variants

* Validate culture with casing in publish and unpublish

* Fix merge
2024-03-04 10:07:01 +01:00
0208522f79 V14: member group controllers fixes (#15817)
* Remove mention of keys outwards

* Get member group by id

* Update openapi.json

* Rename to align

---------

Co-authored-by: Elitsa <elm@umbraco.dk>
2024-03-04 08:06:20 +01:00
Andreas ZerbstandGitHub 86ed066490 Skipped failing tests. (#15821)
The reasons they are being skipped is because we are timing out on the pipeline
2024-03-03 20:36:32 +01:00
Kenn JacobsenandGitHub 55d8954b0c Align parent contexts (#15819)
* Remove explicit parent context in API outputs

* Rename "folder" to "parent" for consistency

* Regenerate OpenApi.json
2024-03-03 15:53:50 +01:00
Elitsa MarinovskaandGitHub f990ea3693 Removing workaround since we now have the content type and list view binding in place (#15816) 2024-03-01 15:10:50 +01:00
Nikolaj GeisleandGitHub 7c33afa3a9 enable start node calculation (#15813) 2024-03-01 14:18:22 +01:00
Jacob Overgaard a9c0e10595 bump to beta001 2024-03-01 14:16:34 +01:00
Elitsa MarinovskaandGitHub 6010565fab V14: Segments configuration (#15812)
* Adding configuration options for segment settings

* Add "useSegments" to the document type configuration endpoint

* Adding additional configuration for creation of non-existing segments
2024-03-01 13:06:03 +01:00
9cb1d66b10 V14: Remove Newtonsoft from packed projects (#15811)
* Migrate ObjectJsonExtensions

* Use more generic exception to not use Newtonsoft

It should matter if it's a JsonReaderException, if we can't read we can't read

* Remove obsoleted constructors

* Use more generic exception in ContentValueSetBuilder

* Fix constructors

* Remove UdiRangeJsonConverter

* Remove more legacy newtonsoft stuff

* Migrate away from newtonsoft in CacheInstructionService

* Remove unused model binders

* Remove more newtonsoft

* Remove newtonsoft from DatabaseServerMessenger

* Remove now irrelevant benchmark

* Remove the usage of Newtonsoft from ImageCropperTemplateCoreExtensions

The value converter will never return JObject, JsonDocument, or JsonNode

* Remove usages of newtonsoft in ComplexPropertyEditorContentNotificationHandler

JTokens are no longer returned, so we don't need to check for it

* Remove newtonsoft references

* Re-add newtonsoft dependency to Umbraco.Tests.Common

* Fix package references

* move dependency

---------

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2024-03-01 12:51:21 +01:00
Jacob Overgaard 72d8b02426 bump version.json 2024-03-01 12:43:57 +01:00
Jacob Overgaard dd1c4fb8b7 Merge branch 'v14/dev' into release/14.0 2024-03-01 12:01:39 +01:00
Jacob Overgaard 2080fd5524 update backoffice submodule 2024-03-01 12:01:05 +01:00
Kenn JacobsenandGitHub d8659ca53e Refactor content updates to shift responsibility downwards (#15807) 2024-03-01 10:45:19 +01:00
Elitsa MarinovskaandGitHub 33c1d4e1fb V14: Return all (even nested) compositions when getting a content type by id (#15800)
* Adding a generic implementation to get all content type compositions, even the nested ones

* Modifying mappers to use the generic implementation
2024-03-01 10:23:40 +01:00
Jacob Overgaard 1bcd45f4df update backoffice submodule 2024-03-01 09:23:45 +01:00
Bjarke Berg efb72b5b49 Merge remote-tracking branch 'origin/v13/dev' into v14/dev
# Conflicts:
#	src/Umbraco.Cms.StaticAssets/umbraco/UmbracoBackOffice/Default.cshtml
#	src/Umbraco.Core/Security/ContentPermissions.cs
#	src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/pickdynamicrootcustomstep/pickdynamicrootcustomstep.controller.js
#	src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/pickdynamicrootorigin/pickdynamicrootorigin.controller.js
#	src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/pickdynamicrootquerystep/pickdynamicrootquerystep.controller.js
#	src/Umbraco.Web.UI.Client/src/views/prevalueeditors/treesourcetypepicker.controller.js
#	version.json
2024-03-01 08:17:06 +01:00
Jacob Overgaard add6908e3f update backoffice submodule 2024-02-29 17:17:42 +01:00
Kenn JacobsenandGitHub 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
Kenn JacobsenandGitHub 47d07bf2d8 ValueListConfiguration should not use ValueListItem (#15796)
* ValueListConfiguration should not use ValueListItem

* Fix test
2024-02-29 15:10:54 +01:00
b8577e3af2 V14: Unpublish multiple cultures (#15789)
* Refactor to accept multiple cultures

* Add test

* Move logic into service

* Remember to complete scope

* Move scope creation.

* Add test

* Close scope on early return

* Handle invalid cultures with bad request

* Handle valid cultures based on content

* Change return type if a culture is required

* Refactor content publishing service to have 1 unpublish method

* Update tests

* Return better error

* Scope completes

---------

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2024-02-29 14:38:47 +01:00
Kenn JacobsenandGitHub 10c18e4162 Swap Newtonsoft.Json dependency for System.Text.Json in BlockEditorPropertyNotificationHandlerBase (#15790)
* Swap Newtonsoft.Json dependency for System.Text.Json in BlockEditorPropertyNotificationHandlerBase

* Review comments
2024-02-29 14:38:32 +01:00
Jacob Overgaard 7d1feb4ad5 update backoffice submodule 2024-02-29 14:05:28 +01:00
Kenn JacobsenandGitHub d7b77b0163 Remove Newtonsoft.Json from ImageCropperPropertyEditor (#15784)
* Remove Newtonsoft.Json from ImageCropperPropertyEditor.cs

* Make the media JSON valid
2024-02-29 13:04:41 +01:00
Kenn JacobsenandGitHub 04849948f1 Fix build errors for user permissions (#15797) 2024-02-29 11:40:47 +01:00
cf9b00bffc Refactor authorizers to be reusable from the core project (#15782)
* Refactored the Authorizers to be reuseable from core by now knowing about principal but only the IUser. Also moved them to core

* Fix multiple enumeration

* Fix more multiple enumerations

---------

Co-authored-by: Nikolaj <nikolajlauridsen@protonmail.ch>
2024-02-29 10:41:56 +01:00
393d178b58 User endpoint additions and corrections (#15773)
* Make create user endpoint work with the supplied id

Return 201 instead of 200 with correct resource identifier

* Add ResetPassword endpoint

* Bring changepassword route inline with other resource actions

* Fixed User endpoints not advertising all their possible response codes/ models

Fixed certain endpoints not authorizing targeted user(s) versus the admin needs admin authorization requirement
Fixed a user not found response bug for the update flow
Fix spacing

* Fixed CurrentUser endpoints not advertising all their possible response codes/ models

Fix incorrect responseStatus in UserService.GetPermissionsAsync

* Update OpenApi definition

Fix smal model oversights in previous commits

* Update incorrect Response type

* Check for duplicate id's in user create validation

* Remove unnecasary returnmodel from changepassword

Renamed the model to it's remaining usage

* rename bad constructor parameter

* Renamed method parameters for better readability and usage

* Fixed wrong userkey being passed down because of (refactored) bad naming

Technically doesn't change anything as the two id's should be the same in this case (reset with token is always for self)

* Fixed resetpassword bug

* Update openapi

* Update src/Umbraco.Core/Services/UserService.cs

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

* Remove old password from change user password request model

Only makes sense when doing it for the logged in user => current endpoint

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
Co-authored-by: Kenn Jacobsen <kja@umbraco.dk>
2024-02-29 10:40:48 +01:00
Nikolaj GeisleandGitHub 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
Jacob Overgaard 3d5bb07ab1 update backoffice submodule 2024-02-29 09:15:18 +01:00
Nhu DinhandGitHub 9448854942 V14 QA Updated Dashboard acceptance tests (#15787)
* Added tests for Examine Management tab

* Added tests for Heath Check

* Added tests for Models Builder

* Added tests for Profiling

* Added tests for Published Status

* Bumped version

* Added tests for Welcome Dashboard

* Updated test name

* Bumped version of test helper

* Bumped version of test helpers

* Replace " with '

* Fixed comments

* Bumped version of test helper
2024-02-29 07:26:17 +01:00
Andreas ZerbstandGitHub 664473d8eb Skips failing test so the pipeline can run (#15793) 2024-02-28 20:43:27 +01:00
Lee KelleherandGitHub ed8df56ff0 Checks that contentType isn't null before checking for .ListView (#15791)
For a collection use at the Media root, the `contentType` will be
`null`, and not have a `.ListView` configured, so would need to
fallback to the default collection configuration (data-type).

This was a small regression in PR #15687.
https://github.com/umbraco/Umbraco-CMS/pull/15687/files#diff-2ad7a39ca3a7e9fd7c4cbc72a2a28b28bf0d24c12449beff76ff8eb3b0a3ce99L192
2024-02-28 17:15:42 +01:00
Jacob Overgaard 5d31a23902 update backoffice submodule 2024-02-28 15:39:16 +01:00
fa007ac257 Output notification handler messages as a header (#15786)
* Output notification handler messages as a header

* Make the notification contract public

* Moved the Notification type and added it to swagger schema

* Update swagger docs

---------

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2024-02-28 15:09:08 +01:00
Kenn JacobsenandGitHub 4b4b003fc6 Add filter option to the "dictionar overview" endpoint (#15777) 2024-02-28 12:41:32 +01:00
3fea1b441c Removes more old backoffice files + Smidge! (#15788)
* Removes lots of files used by the old backoffice and that is not needed for the management api

* A little clean-up

---------

Co-authored-by: kjac <kja@umbraco.dk>
2024-02-28 12:27:54 +01:00
68a101371a Allow operation id selector to work for non-CMS API's (#15771)
* Allow OperationIdSelector to work for non CMS APIs

https://github.com/umbraco/Umbraco-CMS/issues/15716

* Fixed condition to be more readable

---------

Co-authored-by: Elitsa <elm@umbraco.dk>
2024-02-28 12:11:56 +01:00
Nhu DinhandGitHub cc6ebf35fb V14 Added acceptance tests for Dashboard (#15748)
* Added tests for Examine Management tab

* Added tests for Heath Check

* Added tests for Models Builder

* Added tests for Profiling

* Added tests for Published Status

* Bumped version

* Added tests for Welcome Dashboard

* Updated test name

* Bumped version of test helper

* Bumped version of test helpers

* Replace " with '
2024-02-28 08:40:54 +01:00
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
Kenn JacobsenandGitHub 3c2ae389f4 Remove Newtonsoft.Json from Multi URL picker (#15768) 2024-02-27 17:18:58 +01:00
Bjarke Berg 64bfe88fba Fixes tests after killing of old backoffice 2024-02-27 13:53:45 +01:00
Bjarke Berg 3db8ef029f Merge remote-tracking branch 'origin/v14/dev' into v14/dev 2024-02-27 13:01:07 +01:00
Bjarke Berg 99ce994a3c disable step for now, as it do not make sense before the client code is in the same repo 2024-02-27 13:01:03 +01:00
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 MarinovskaandGitHub 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
Jacob Overgaard 9a274084d6 update backoffice submodule 2024-02-27 09:51:34 +01:00
Kenn JacobsenandGitHub 48d371a9d5 Finalized the data type config migration (#15766) 2024-02-27 09:33:29 +01:00
Jacob Overgaard 9d7aea6da0 update backoffice submodule 2024-02-27 08:45:07 +01:00
Kenn JacobsenandGitHub 4443f8b88a Validate collisions in domain assignments (#15759)
* Validate collisions in domain assignments

* Update OpenApi.json
2024-02-26 15:52:02 +01:00
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 GeisleandGitHub 01a7643164 Add webhooks to openapi schema (#15772) 2024-02-26 15:39:53 +01:00
Kenn JacobsenandGitHub 3f1635d742 Validate data type configuration values (#15757) 2024-02-26 15:25:41 +01:00
f47830b165 V14: Webhook Management API (#15147)
* Add webhook to management api

* Update webhook controllers

* Add ByKey webhook controller

* Fix typo

* Fix typo

* Update multiple webhooks

* Update using

* Remove duplicate constant after merge

* Fix typo in file name

* Update casing of IWebhookService

* Fix typo

* Use Webhook entity type

* Fix ambiguous reference

* Update webhook mapping

* Update after change of CreatedAtAction

* Use CreatedAtId instead

* Update src/Umbraco.Cms.Api.Management/Controllers/Webhook/ByKeyWebhookController.cs

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

* Update src/Umbraco.Cms.Api.Management/Controllers/Webhook/ByKeyWebhookController.cs

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

* Update src/Umbraco.Cms.Api.Management/ViewModels/Webhook/CreateWebhookRequestModel.cs

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

* Update src/Umbraco.Cms.Api.Management/Controllers/Webhook/DeleteWebhookController.cs

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

* Update src/Umbraco.Cms.Api.Management/Controllers/Webhook/CreateWebhookController.cs

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

* Add Guid to WebhookResponseModel

* Cleanup

* Add Auth

* Move webhook logic from backoffice to management api

* Add mapping

---------

Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
2024-02-26 14:35:35 +01:00
Jacob Overgaard 0f6705795a update backoffice submodule 2024-02-26 13:36:19 +01:00
Jacob Overgaard fbfb3ad1f7 update backoffice submodule 2024-02-26 13:18:05 +01:00
Kenn JacobsenandGitHub e3d890ce47 Regenerate OpenApi.json to match current server schema (#15763) 2024-02-26 13:05:59 +01:00
Jacob Overgaard bc5d140640 generate api models before building 2024-02-26 11:23:13 +01:00
Jacob Overgaard 7ffa68e822 update backoffice submodule 2024-02-26 11:20:51 +01:00
Jacob Overgaard 405a494938 update backoffice submodule 2024-02-26 11:09:44 +01:00
Bjarke Berg 6016ecb9cf Updated openapi and added response type to temp file config 2024-02-26 10:33:59 +01:00
Kenn JacobsenandGitHub afa7c5789b Fix datatype configs for new installs (#15756) 2024-02-26 10:23:33 +01:00
203b003e41 V14 Added missing tests and fixed failed tests for Partial View (#15635)
* Added beforeEach() and remove .skip for the passed tests

* Fixed failed tests and add the tests to cover query builder

* Bumped version of test helper

* Updated api tests for Partial View as the endpoints are changed

* Fixed failed tests and remove .skip tests

* Updated test helper version and api tests for Partial View as the name of method changes

* Changed createButton() to createThreeDotsButton()

* Bumped version

* Bumped version of test helper

* Fixed comments

* Added more waits

* Splited tests out

* Changed verification method

* Added debug

* Removed console.log() and increased wait time

* Changed expect from toEqual to toBeTruthy

* Changed to use "" instead of ''

* more changes

* Updated the expectedPartialViewContent

* Changes

* Removed

* Fixed test

* Update PartialView.spec.ts

* Removed .skip

* Added code to detect os platform

* Updated expectedPartialViewContent varibale

* Added waits

* Bumped version of test helper

---------

Co-authored-by: Andreas Zerbst <andr317c@live.dk>
Co-authored-by: Andreas Zerbst <73799582+andr317c@users.noreply.github.com>
2024-02-23 12:41:35 +01:00
Kenn JacobsenandGitHub 7b80d59c36 Align tree item namespaces (#15754) 2024-02-23 11:27:48 +01:00
00dade48f6 Document and Media restore endpoints (#15681)
* Added Endpoint to get Document restore information

* Add media version of original paent recycle bin

update document permission
regisered interfaces

* Added restore endpoints

* PR feedback and other cleanup

* Update orignal root parent logic & shrank return model

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2024-02-22 17:37:27 +01:00
Jacob Overgaard 8027873438 update backoffice submodule 2024-02-22 17:03:41 +01:00
Kenn JacobsenandGitHub 918457d9f8 Output "operationStatus" for error scenarios whenever possible (#15703) 2024-02-22 15:17:06 +01:00
1bb4fdf43a Do not allow ignoring user start nodes for system data types (#15739)
* Do not allow ignoring start nodes for system data types

* Update OpenApi.json

* Update src/Umbraco.Cms.Api.Management/Mapping/DataType/DataTypeViewModelMapDefinition.cs

Co-authored-by: Sven Geusens <geusens@gmail.com>

* Regenerate OpenApi.json

---------

Co-authored-by: Sven Geusens <geusens@gmail.com>
2024-02-22 15:16:31 +01:00
Jacob Overgaard 641c160e60 update backoffice submodule 2024-02-22 15:13:36 +01:00
Kenn JacobsenandGitHub ac01abd55f Clean up leftovers from old dictionary pagination (#15747) 2024-02-22 13:03:25 +01:00
Jacob Overgaard 4ca2c814f5 down version to 007 2024-02-22 12:55:46 +01:00
Kenn JacobsenandGitHub 00d1ebe3de Remove the default value constraint on "isContainer" before deleting the column (#15751)
* Remove the default value constraint on "isContainer" before deleting the column

* Swap migrations to avoid targeting missing column
2024-02-22 12:47:07 +01:00
Jacob OvergaardandGitHub da41373f85 V14: Run SQL Server Integration/Acceptance tests manually (#15750)
* temp fix until we stop getting timeouts: sql server tests should only be run manually

* simplify condition
2024-02-22 12:22:28 +01:00
Jacob Overgaard e0e1688e6a update backoffice submodule 2024-02-22 11:41:39 +01:00
MoleandGitHub 7735552877 V14: Migrate Newtonsoft to System.Text in value converters (#15728)
* Force system text json for IJSonSerializer

* Migrate ColorPickerValueConverter

* Move ColorPickerValueConverter

* Clean up ColorPickerValueConverter

* Remove obsoleted property editors

* Migrate FlexibleDropdownPropertyValueConverter to System.Text.Json

* Use IJsonSerializer instead and move the value converter to Core

* Migrate ImageCropperValueConverter to System.Text.Json

* Inject jsonserializer in test and obsolete old constructor

* Migrate JsonValueConverter to System.Text.Json

* Remove ContextualConfigurationEditorJsonSerializer

* Remove JsonNetSerializer

* Remove obsolete DeserializeSubset from JsonSerializer interface

* Fix FlexibleDropdownPropertyValueConverter

* Update test JSON to be actual valid json

* Update more test json

* Update time format to be valid

* Add JsonPropertyName to models
2024-02-22 11:22:57 +01:00
Jacob Overgaard 58bc868374 update backoffice submodule 2024-02-22 10:47:44 +01:00
Jacob Overgaard 9c7949d46f add test to ensure the json converter do not mess with the extensions list 2024-02-22 10:47:43 +01:00
Kenn JacobsenandGitHub 1a8797e694 Migrate data type configurations from V7.0+ (#15733)
* Migrate data type configurations from V7.0+

* Update listview defaults to match the install ones
2024-02-22 10:31:48 +01:00
Zeegaan b744f58b58 Order migrations correctly 2024-02-22 10:17:19 +01:00
Nikolaj GeisleandGitHub 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
Jacob Overgaard ce24845907 allow release tags to reference public releases 2024-02-21 15:57:24 +01:00
Sven Geusens 793b0e591f Merge branch 'v14/dev' of https://github.com/umbraco/Umbraco-CMS into v14/dev 2024-02-21 15:02:55 +01:00
Sven Geusens 1b95679c89 Fix v14 tests 2024-02-21 15:02:48 +01:00
Jacob Overgaard 32117dbfd7 Merge branch 'v14/dev' of https://github.com/umbraco/Umbraco-CMS into v14/dev 2024-02-21 14:46:08 +01:00
Jacob Overgaard aab4acce8d bump to preview008 2024-02-21 14:45:46 +01:00
Sven Geusens 380d3eab6d Merge branch 'v14/dev' of https://github.com/umbraco/Umbraco-CMS into v14/dev 2024-02-21 14:41:21 +01:00
Sven Geusens ed7b4ce44f Merge branch 'v13/dev' into v14/dev
# Conflicts:
#	Directory.Packages.props
#	src/Umbraco.Core/DependencyInjection/UmbracoBuilder.cs
#	src/Umbraco.Core/Models/Mapping/ContentPropertyDisplayMapper.cs
#	src/Umbraco.Core/Services/DataTypeService.cs
#	src/Umbraco.Infrastructure/PropertyEditors/BlockEditorPropertyValueEditor.cs
#	src/Umbraco.Infrastructure/PropertyEditors/BlockValuePropertyValueEditorBase.cs
#	src/Umbraco.Infrastructure/PropertyEditors/ImageCropperPropertyValueEditor.cs
#	src/Umbraco.Infrastructure/PropertyEditors/MediaPicker3PropertyEditor.cs
#	src/Umbraco.Infrastructure/PropertyEditors/NestedContentPropertyEditor.cs
#	src/Umbraco.Infrastructure/PropertyEditors/RichTextPropertyEditor.cs
2024-02-21 14:39:41 +01:00
Jacob Overgaard f2ee2d6c60 update backoffice submodule 2024-02-21 14:39:11 +01:00
Elitsa MarinovskaandGitHub 76e1db87a7 V14: Align routes (#15732)
* Fixing route for temp file

* Adding missing ApiController attribute

* Adding new filter view port

* Creating base classes for member and user filters

* Moving actual filter controllers to correct places

* Update OpenApi.json
2024-02-21 12:29:22 +01:00
Kenn JacobsenandGitHub d9aed7f9a7 Ensure that data types required by the core cannot be deleted. (#15738)
* Ensure that data types required by the core cannot be deleted.

* Update OpenApi.json
2024-02-21 10:22:22 +01:00
Jacob Overgaard c12b88801a update backoffice submodule 2024-02-21 09:13:14 +01:00
608f2e3c76 Scheduled publishing in Management API (#15680)
* Only use datetimeoffset in API

* Updated publish endpoint to take schedule information

* Fixed test builds

* OpenApi updates

* Update OpenApi schema

* Fixed issues with publishing.

* Added validation before publishing. Had to move a lot of classes to core.

* added missing files

* Added validation info to error

* Typo

* Clean up and adding missing result

* Updating to AvailableCultures instead of PublishedCultures

* Handle time needs to be in the future

* validate only cultures that needs to be published

* Fix typos

* Filter out cultures that we are not trying to publish from the validation errors

* Don't filter out only the available cultures, to accommodate non-created variants

* Only allow publish of existing cultures

* Fixed issues found in test

* fixed build

---------

Co-authored-by: Elitsa <elm@umbraco.dk>
2024-02-21 09:10:48 +01:00
Elitsa MarinovskaandGitHub 5b1fab1165 V14: Member collection view/filter endpoint (#15727)
* Adding missing members policy

* Adding a member filter endpoint

* Adding response types to user filter endpoint

* Adding create multiple to factory

* Updating OpenApi.json
2024-02-18 16:06:41 +01:00
Jacob Overgaard 638446bd43 update backoffice submodule 2024-02-16 15:10:32 +01:00
b2a9521184 Member response model must not have a name property (#15695)
* Member response model must not have a name (its name is in the variants collection)

* update import map

---------

Co-authored-by: Mads Rasmussen <madsr@hey.com>
Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>
2024-02-16 14:05:21 +01:00
Sven Geusens 95c0c0adad Merge branch 'v13/dev' into v14/dev
# Conflicts:
#	src/Umbraco.Cms.StaticAssets/umbraco/UmbracoBackOffice/Default.cshtml
#	src/Umbraco.Cms.StaticAssets/umbraco/UmbracoLogin/Index.cshtml
#	src/Umbraco.Core/Services/DataTypeService.cs
2024-02-16 11:19:15 +01:00
Jacob Overgaard 3c9976d734 update backoffice submodule 2024-02-15 15:38:47 +01:00
d0145ed7e9 V14: generate dynamic importmap (#15710)
* register a new IPackageManifestReader to allow to scan the /umbraco/backoffice path for umbraco packages

* add constant

* add logic to extract the importmap from umbraco package manifests

* add html helper to render an importmap

* replace static importmap with new dynamic importmap

* update tests and be more specific about scopes

* remove recursion from PackageManifestReader.cs

* add extra test to validate the importmap

* combine all string manipulation to produce an importmap into HtmlHelperBackOfficeExtensions.cs

* rename IStaticFileHostGenerator to something reflecting its actual usage, and also fix the file names

* use auto properties where applicable

* add getter for BackOfficeHash and use to simplify BackofficeAssetsPath

* ensure BackOffice is always spelled with capital O

* add a way to replace the cachebuster for assets imported through an importmap and ensure magic strings are encapsulated into business logic or constants

* Review changes

* convert primary constructors to explicit and add comments

* convert primary constructor to explicit

---------

Co-authored-by: kjac <kja@umbraco.dk>
2024-02-15 15:23:01 +01:00
Kenn JacobsenandGitHub 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
ec1ba6031f V14: Document and media collection view endpoints (#15696)
* Fix authz status

* Adding another silo for list views

* Adding base classes and handling collection operation statuses

* Change signature to reuse functionality. Fix references

* Adding collection response models

* Adding content and media type collection response models

* Adding mapping

* Adding mapping for document and media types

* Adding list view page model

* Initial implementation

* Moving implementation to service base

* Adding content and media service interfaces for handling list views

* Registering and implementation

* Update controllers to use new services

* Renaming param

* Refactor to pass content type instead of content type key

* Handle the case where only data type is provided

* Add missing operation status

* Update OpenApi.json

* Added comment for a temp workaround

* Removing orderCulture from media interface as it is not yet supported

* Adding a base class for content type collection reference model

* Adding common collection controller base and moving the ContentCollectionOperationStatusResult to there

* Cleaning up controllers after implementing the base class

* Cleaning up concrete controller bases

* OpenApi.json updates

* Changing GetPagedChildren to return a paged model

* Fix ordering

* Adding ,

* Fix wording

* Append operation status to unsuccessful API responses

* A little bit of clean-up

* Update default orderBy value

* Update the default value of orderBy

* Adding missing owner and updater system fields

* Updating OpenApi.json with owner and updater props

* Create base and rename owner to creator

* Update OpenApi.json

* Reordering of properties

* "Owner" will be "creator"

* Fix comment

---------

Co-authored-by: kjac <kja@umbraco.dk>
2024-02-14 15:13:56 +01:00
Jacob Overgaard 72e2b20b32 bump to preview007 2024-02-14 14:28:41 +01:00
Andreas ZerbstandGitHub f98599a431 Changed locator (#15714) 2024-02-14 14:08:42 +01:00
Jacob Overgaard b8d6c3e4fa update backoffice submodule 2024-02-14 13:10:06 +01:00
2dcdff5392 V14: Migrate nucache to use System.Text.Json (#15685)
* Create system text serializer

* Assign property names with system text

* Use the new serializer

* Impement AutoInterningStringConverter with System.Text.Json

* Implement TextAutoInterningStringKeyCaseInsensitiveDictionaryConverter

* Make CaseInsensitiveDictionaryConverter

* Force datetimes to be read as UTC

* Remove usages of Newtonsoft.Json

* Remove text prefixes

* Remove unused Newtonsoft converter

* Remove more newtonsoft

* Remove duplicate implementation

* Rmove usage of missing class in tests

* Ignore null values

* Fix tests

* Remove Newtonstoft reference from NuCache

---------

Co-authored-by: Elitsa <elm@umbraco.dk>
2024-02-14 12:10:45 +01:00
Kenn JacobsenandGitHub 4f04669dce Enable reuse of BackOfficeSecurityRequirementsOperationFilter for custom APIs (#15699) 2024-02-13 15:08:42 +01:00
Andreas ZerbstandGitHub 690bfe3e68 V14 QA fix failing dictionary acceptance tests. (#15709)
* Updated test to work. And skips tests unable to work until frontend is ready

* Decreased time for tests

* Update playwright.config.ts

Decreased to 40 seconds
2024-02-13 13:28:28 +01:00
Jacob Overgaard 7577433cd5 update backoffice submodule 2024-02-13 12:18:09 +01:00
Andreas ZerbstandGitHub f92c23438e Decreased retry of test from 5 to 3. (#15705) 2024-02-13 09:04:50 +01:00
Jacob Overgaard c27532fe72 update backoffice submodule 2024-02-12 15:33:50 +01:00
d057626f29 V14 Added acceptance tests for DataTypes (#15679)
* Fixed failing tests

* Updated tests to use the updated helpers

* Clean up tests

* Enabled our pipeline for E2E testing

* Updated the CMS URl for our E2E tests

* Bumped version of our testHelpers

* Did some fixing, still a bit more to do

* Updated auth tests to use LoginUiHelper

* Updated Telemetry tests to use TelemetryUiHelper

* Updated LogViewer tests to use LogViewerUiHelper

* Updated api tests to apply AAA pattern and fix failed tests

* Removed unused import

* Fixed comments

* Bumped version of test helper

* Updated the version to 10 instead of 11

* Updated the package-lock.json file to contain the correct versions

* Added a waitForTimeout
The reason for this is that this test is failing on the pipeline

* V14 Added acceptance test for basic functions of Data Type, Approved Color and Label (#15551)

* Updated api tests for DataType

* Added ui tests for basic functions of DataType

* Added ui tests for Approved color

* Added ui tests for Label

* Fixed comments

* V14 Added acceptance tests for Date Picker (#15561)

* Updated api tests for DataType

* Added ui tests for basic functions of DataType

* Added ui tests for Approved color

* Added ui tests for Label

* Added ui tests for Date Picker

* Removed blank line

Co-authored-by: Andreas Zerbst <73799582+andr317c@users.noreply.github.com>

---------

Co-authored-by: Andreas Zerbst <73799582+andr317c@users.noreply.github.com>

* V14 Added acceptance test for List View (#15575)

* Updated api tests for DataType

* Added ui tests for basic functions of DataType

* Added ui tests for Approved color

* Added ui tests for Label

* Added ui tests for Date Picker

* Fix merged

* Updated DatePicker and Label tests to apply best practices

* Added ui tests for ListView

* V14 Added acceptance tests for Image Cropper, Numeric and Radiobox (#15599)

* Added ui tests for ImageCropper

* Added ui tests for Numeric

* Added ui tests for Radiobox

* Updated tests for Approved Color to change the way to arrange test data

* Change "" to '' and updated before/after methods

* V14 Added acceptance test for Textarea, Textstring, Upload (#15606)

* Added ui tests for Textarea

* Added ui tests for Textstring

* Added ui tests for Upload Article, Upload Audio, Upload File, Upload Vector Graphics, Upload Video

* Fixed failing tests due to api changes

* Changed propertyEditorAlias to editorAlias due to api changes

* Removed the step to check notification displays and changed string variables to numeric variables due to api changes

* Updated the skip tests

* Added skip tests and update method name due to test helper changes

* Splited tests out

* Bumped version

* Changed '' to '

---------

Co-authored-by: Andreas Zerbst <andr317c@live.dk>
Co-authored-by: Andreas Zerbst <73799582+andr317c@users.noreply.github.com>
2024-02-12 13:59:39 +01:00
Jacob Overgaard 629f854bf7 update backoffice submodule 2024-02-12 11:06:10 +01:00
Jacob Overgaard 6f6405a445 update backoffice submodule 2024-02-12 09:31:39 +01:00
Jacob Overgaard 21dc62ec22 update backoffice submodule 2024-02-09 15:43:54 +01:00
Jacob Overgaard afff4d7578 update backoffice submodule 2024-02-09 13:55:40 +01:00
Jacob Overgaard 10e328afda Merge branch 'release/14.0' into v14/dev 2024-02-07 14:33:19 +01:00
Jacob Overgaard 86bf666faf fix useDotNet job 2024-02-07 14:31:16 +01:00
Jacob Overgaard b67b06bfc3 bump version to 14.0.0--preview006 2024-02-07 13:47:36 +01:00
Jacob Overgaard da5a95ac22 Merge remote-tracking branch 'origin/v14/dev' into v14/dev 2024-02-07 12:08:03 +01:00
Jacob Overgaard fdb9b68bc0 update backoffice submodule 2024-02-07 12:07:41 +01:00
024bb8903c V14/feature/delete media in recyblebin (#15636)
* Bugfix: MediaCacheRefresher needs to always clear the mediaCache no matter what the publishedState is

* fix: check correct permissions for deleteDocumentFromRecycleBin

* Fix: ImageCropper propertyValues should not hold invalid values.

* Added media delete endpoints

* PR comment fix: Do not schedule cleanup if we know the file does not exist.

* resolved forward merge build conflicts

namespace cleanup

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
2024-02-07 10:44:20 +01:00
Kenn JacobsenandGitHub 9d07268ead Remove template scaffolding from the API (#15659)
* Remove template scaffolding from the API

* Regenerate OpenApi.json

* Regenerate OpenApi.json after forward merging
2024-02-07 09:07:54 +01:00
Jacob Overgaard 79866e0370 update backoffice submodule 2024-02-07 09:01:01 +01:00
Bjarke Berg c1aa526999 Merge remote-tracking branch 'origin/v13/dev' into v14/dev 2024-02-06 14:25:12 +01:00
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
8c6e03d346 V14: Invalidate user tokens (#15651)
* Adding revoke user auth token handler and registering it

* Maintain method clarity by grouping new calls into its own method

* Rename functions to what they do

* Suggested linq function of tripple nesting

* Reduce nesting by early loop continuation

* Fix PR suggestion async typo

* Review suggestions

* Log msg alignment between members and users

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
2024-02-06 13:02:35 +01:00
71b3076de9 Members and member types in the Management API (#15662)
* Members and member types in the Management API

* Add validation endpoints for members

* Include validation result in service response + add unit tests

* Regenerate OpenApi.json

* Regenerate OpenApi.json after merge

* Don't throw an exception when trying to set valid variation levels for member types

* Added missing ProducesResponseType

* Remove TODO, as that works

* Allow creation of member with explicit key

* Do not feature "parent" for member creation + add missing response type

* Do not feature a "Folder" in create member type (folders are not supported)

* Added missing build methods

* Fixed issue with mapping

---------

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2024-02-05 06:42:07 +01:00
Andreas ZerbstandGitHub dde2ccfd41 V14 QA fix failing acceptance tests on pipeline (#15652)
* Fixes, not done

* Fixed failing tests

* Fixes

* Updated tests

* Bumped version

* Did small adjustments

* Split tests out

* Skips failing package test

* Added missing semicolon

* Updated variables

* Added afterEach to ensureNameNotExists
2024-02-05 09:54:29 +07:00
Jacob Overgaard 52a9939480 Merge remote-tracking branch 'origin/v13/dev' into v14/dev
# Conflicts:
#	.artifactignore
#	build/azure-pipelines.yml
#	tests/Umbraco.Tests.AcceptanceTest/misc/umbraco-linux.docker
2024-02-02 13:48:28 +01:00
2193ded62d V14 Added acceptance tests for Relation Types (#15653)
* Fixed failing tests

* Updated tests to use the updated helpers

* Clean up tests

* Enabled our pipeline for E2E testing

* Updated the CMS URl for our E2E tests

* Bumped version of our testHelpers

* Did some fixing, still a bit more to do

* Updated auth tests to use LoginUiHelper

* Updated Telemetry tests to use TelemetryUiHelper

* Updated LogViewer tests to use LogViewerUiHelper

* Updated api tests to apply AAA pattern and fix failed tests

* Removed unused import

* Added api tests for RelationType

* Added ui tests for Relation Type

* Bumped test helper version

* Added api tests for Relation Types

* Updated ui tests for Relation types

* Updated method due to the test helper changes

* Bumped version

* Fixed merged

* Update tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Relation Types/RelationTypes.spec.ts

Added ;

Co-authored-by: Andreas Zerbst <73799582+andr317c@users.noreply.github.com>

* Update tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Relation Types/RelationTypes.spec.ts

Updated name of method

Co-authored-by: Andreas Zerbst <73799582+andr317c@users.noreply.github.com>

* Update tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Relation Types/RelationTypes.spec.ts

Updated name of method

Co-authored-by: Andreas Zerbst <73799582+andr317c@users.noreply.github.com>

---------

Co-authored-by: Andreas Zerbst <andr317c@live.dk>
Co-authored-by: Andreas Zerbst <73799582+andr317c@users.noreply.github.com>
2024-02-01 19:46:49 +01:00
Jacob Overgaard 2f702b28ff update backoffice submodule 2024-02-01 16:13:42 +01:00
Jacob Overgaard 1f636583c3 Merge remote-tracking branch 'origin/v13/dev' into v14/dev 2024-02-01 15:58:33 +01:00
Jacob OvergaardandGitHub 0a6dd9538a add retry count for flaky test (#15632)
* add retry count for flaky test

* add retry to try and have test pass
2024-02-01 14:28:47 +01:00
Bjarke Berg 3a71eab1ce Merge remote-tracking branch 'origin/v14/dev' into v14/dev 2024-02-01 12:17:50 +01:00
d29e05efb7 Move document related operations to DocumentControllerBase (#15661)
* Clean up ContentControllerBase and move document related operations to DocumentControllerBase

* Rename content to document

---------

Co-authored-by: Elitsa <elm@umbraco.dk>
2024-02-01 11:29:52 +01:00
Bjarke Berg 9eb36c0234 Merge remote-tracking branch 'origin/v13/dev' into v14/dev
# Conflicts:
#	Directory.Packages.props
#	src/Umbraco.Infrastructure/Migrations/Upgrade/V_10_0_0/AddMemberPropertiesAsColumns.cs
#	src/Umbraco.Infrastructure/Migrations/Upgrade/V_10_2_0/AddHasAccessToAllLanguagesColumn.cs
#	src/Umbraco.Infrastructure/Migrations/Upgrade/V_10_2_0/AddUserGroup2LanguageTable.cs
#	src/Umbraco.Infrastructure/Migrations/Upgrade/V_10_3_0/AddBlockGridPartialViews.cs
#	src/Umbraco.Infrastructure/Migrations/Upgrade/V_10_4_0/AddBlockGridPartialViews.cs
#	src/Umbraco.Infrastructure/Migrations/Upgrade/V_10_5_0/AddPrimaryKeyConstrainToContentVersionCleanupDtos.cs
#	src/Umbraco.Infrastructure/Migrations/Upgrade/V_10_7_0/MigrateTagsFromNVarcharToNText.cs
#	src/Umbraco.Infrastructure/Migrations/Upgrade/V_11_3_0/AddDomainSortOrder.cs
#	src/Umbraco.Infrastructure/Migrations/Upgrade/V_11_4_0/AlterKeyValueDataType.cs
#	src/Umbraco.Infrastructure/Migrations/Upgrade/V_12_0_0/ResetCache.cs
#	src/Umbraco.Infrastructure/Migrations/Upgrade/V_12_0_0/UseNvarcharInsteadOfNText.cs
#	src/Umbraco.Infrastructure/Migrations/Upgrade/V_12_1_0/AddOpenIddict.cs
#	src/Umbraco.Infrastructure/Migrations/Upgrade/V_12_1_0/TablesIndexesImprovement.cs
#	src/Umbraco.Web.UI.Docs/README.md
#	src/Umbraco.Web.UI.Docs/gulpfile.js
2024-02-01 11:24:43 +01:00
Kenn JacobsenandGitHub 296b7e061a Align presentation model factory naming (#15663) 2024-02-01 11:22:16 +01:00
Elitsa MarinovskaandGitHub a562198520 Rename items to item to be consistent (#15660) 2024-02-01 09:23:10 +01:00
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 JacobsenandGitHub d631ef1802 Move the ContentControllerBase to the correct location (#15656) 2024-01-31 16:22:15 +01:00
0dd2beb484 V14: Update DataTypeControllerBase to use GetAllAsync() (#15641)
* Update to use GetAllAsync()

* Obsolete GetAll

---------

Co-authored-by: Elitsa <elm@umbraco.dk>
2024-01-31 15:00:47 +01:00
MoleandGitHub 008083f096 V14: Migration Cleanup (#15629)
* Remove obsoleted migrations

* Re-add default log queries

* Remove unused PreValueMigratorCollectionBuilder from DI

* Remove unused unit test

* Obsolete unused migrations

* Remove migrations prior to v13 from UmbracoPlan

* Fix whitespace

* Use array instead of IEnumerable

* Remove unused migrations
2024-01-31 12:45:56 +01:00
Kenn JacobsenandGitHub 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
Jacob Overgaard e0e6dee896 update lockfile 2024-01-31 10:06:35 +01:00
8c8405bbbf V14: Fix up install controller (#15646)
* Rename InstallVResponseModel to InstallRequestModel

* Align SettingsInstallController

* Rename split DatabaseInstallResponseModel in two

* Change UserInstallResponseModel to UserInstallViewModel

* Use PresentationModel instead of ViewModel

* Use operation status pattern when validating database

* Prepare for install to return a message

* Begin updating steps

* Make StepBase sharable between upgrade and install

* Update steps

* Use error message from install steps in install controller

* Use error message from upgrade steps in upgrade controller

* Use 500 for install/upgrade failed

It's entirely likely that it has nothing to do with the request

* Updated OpenApi.Json

---------

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2024-01-30 13:12:08 +01:00
Kenn JacobsenandGitHub 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
bb46d23730 V14 Bugfix, fixed some of the document controllers (#15449)
* Updated naming to route correctly

* Added a check for null

* Added another status code for the PublicAccess

* Added a check for null

* Updated naming to match route

* Added attempt pattern

* added a ProblemDetailsBuilder for the EntryNotFound

---------

Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
2024-01-29 12:58:03 +01:00
Jacob Overgaard aea9b79513 update backoffice submodule 2024-01-26 15:55:30 +01:00
Nikolaj GeisleandGitHub e7749ecb58 V14/feature/more configuration endpoints (#15603)
* Add template configuration endpoint

* Implement template endpoint

* rename template configuration response model

* Implement package configuration endpoint

* Add media configuration endpoint

* Implement document configuration endpoint

* Refactor enabled to disabled

* implement document type configuratio endpoint

* Add required to view model properties

* Update OpenApi.json
2024-01-26 11:03:22 +01:00
Jacob Overgaard 170d91c183 ignore wwwroot in new ui temp project 2024-01-25 14:22:47 +01:00
Jacob Overgaard 2c13ce8877 add wwwroot/media to .gitignore 2024-01-25 14:20:47 +01:00
Andreas ZerbstandGitHub a93980b64c V14 Acceptance Test for the Package Section (#15618)
* In progress tests

* Updated createdPackaged tests

* Added test for checking if we are able to see the marketplace

* Added tests for checking if the correct message is shown

* Made quite a lot of changes, used the locators in the testHelpers. Added additional tests

* Updated to match changes to the Ui TestHelpers

* Fixed test

* added package file

* Bumped versions

* Updated naming

* Fixed Acceptance Test to match patterns

* Updated locator in test.

* Added Act comment

* Followed comments from PR
2024-01-25 16:56:25 +07:00
Bjarke Berg d8eef9eca5 Fix build 2024-01-24 11:24:40 +01:00
Bjarke Berg 91119308a2 Merge remote-tracking branch 'origin/v14/dev' into v14/dev 2024-01-24 11:12:45 +01:00
MoleandGitHub 76181a8af4 V14: Migrate JsonConfigManipulator to System.Text.Json (#15609)
* Minor cleanup

* Remove old obsoleted property

* Reimplement save connection string

* Remove old method using newtonsoft

* Implement RemoveConnectionStringAsync

* Implement SaveConfigValue

* Implement SaveDisableRedirectUrlTracking

* Cleanup

* Implement SetGlobalIdAsync

* Fix recursive default implementation

* Split manipulating dom and saving json

Otherwise SaveConnectionStringAsync would write twice.

* Add some documentation strings

* Reduce indentation

* Obsolete non-async methods

* Move JsonConfigManipulator to correct namespace and make it internal
2024-01-24 11:07:18 +01:00
Bjarke Berg 7a6b316f4b Merge remote-tracking branch 'origin/v13/dev' into v14/dev
# Conflicts:
#	src/Umbraco.Infrastructure/PropertyEditors/BlockEditorPropertyValueEditor.cs
#	src/Umbraco.Infrastructure/PropertyEditors/NestedContentPropertyEditor.cs
#	src/Umbraco.Web.BackOffice/Security/BackOfficeSignInManager.cs
#	tests/Umbraco.Tests.UnitTests/Umbraco.Core/PropertyEditors/DataValueEditorReuseTests.cs
#	version.json
2024-01-24 08:36:55 +01:00
Jacob Overgaard 80df1d17db Merge branch 'release/14.0' into v14/dev 2024-01-23 18:59:45 +01:00
aaca7a5ff4 2FA for users in management API (#15607)
* Added 2FA management endpoints

* Ensure not found do not lead to forbidden results

* Do not inherit the requirement to have access to users, from the current user base class

* Updated OpenApi.json

* Handle 2FA in login scenario (only backend)

* Added the endpoint to use for client to post 2FA code

* Fixed tests and allow injecting the authentication type settings

* fix test build

* Fallback to use Constants.Security.BackOfficeAuthenticationType

* remove unused variable

* Review fixes

* Build fix

* Update src/Umbraco.Cms.Api.Management/Controllers/User/Current/DisableTwoFactorProviderCurrentUserController.cs

Co-authored-by: Sven Geusens <geusens@gmail.com>

* Handle case where 2fa provider is already setup

---------

Co-authored-by: Sven Geusens <geusens@gmail.com>
2024-01-23 18:07:21 +01:00
Jacob Overgaard e9082dafa6 clean apidocs before upload 2024-01-23 16:43:27 +01:00
Jacob Overgaard 71651decbc variables probably do not work without a real stage dependency 2024-01-23 16:38:16 +01:00
Jacob Overgaard bfb500612a bump version to 14.0.0--preview005 2024-01-23 15:34:28 +01:00
Jacob Overgaard 7b99bdea9d remove unused parameter 2024-01-23 13:48:03 +01:00
Jacob Overgaard 789c47eb98 update backoffice submodule (signout) 2024-01-23 09:54:52 +01:00
8bf8483dcb V14 QA Added acceptance tests for Dictionary (#15479)
* Bumped version of TestHelper

* Added .udt test files

* Updated api tests for Dictionary

* Added ui tests for Dictionary

* Updated ui tets for Dictionary as TestHelper is changed

* Updated ui tests of Dictionary

* Updated verify step

* Fixed comments

* Imported crypto into Dictionary.spec.ts

Co-authored-by: Andreas Zerbst <73799582+andr317c@users.noreply.github.com>

* Fixed format

---------

Co-authored-by: Andreas Zerbst <73799582+andr317c@users.noreply.github.com>
2024-01-23 09:47:23 +01:00
Jacob Overgaard e21932283c update backoffice submodule 2024-01-23 09:07:48 +01:00
Bjarke Berg 0760fbd702 Increase timeout so we can figure out which tests are slow 2024-01-23 08:49:25 +01:00
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
acc71b6d45 Add management api delete document endpoints (#15600)
* Added Delete document endpoint

* Added delete from recylebin endpoint

Added/restructured unittests

* Clarifications

* Moved document specific mapping from base recyclebin to document recyclebin

* Refactor OperationStatusResult mapping trough inheritance

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
2024-01-22 15:58:18 +01:00
Elitsa MarinovskaandGitHub bb0395349f V14: Fix composition endpoints namespaces (#15620)
* Fix namespace in media type related classes

* Fix namespace in document type composition related classes
2024-01-22 14:11:11 +01:00
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
Jacob Overgaard 681903a1a7 update backoffice submodule 2024-01-19 13:32:33 +01:00
1fe39de589 Add missing empty recycle bin endpoints (#15602)
* Added empty document recyble bin

* Made EmptyDocumentRecycleBinController leaner

Cleaned up obsolete constructor

* Added empty media recycle bin endpoint

* Cleanup

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
Co-authored-by: Elitsa <elm@umbraco.dk>
2024-01-19 10:58:33 +01:00
Kenn JacobsenandGitHub 5429aa78a5 "Created at" responses should not have a response body (#15590) 2024-01-17 13:37:24 +01:00
43791c2b33 v14: Merge NewBackOfficeSettings into SecuritySettings. (#15586)
* Merge NewBackOfficeSettings into SecuritySettings.

* Apply suggestions from code review

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

* Remove hardcoded callback path

---------

Co-authored-by: Kenn Jacobsen <kja@umbraco.dk>
2024-01-17 13:26:09 +01:00
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
40a28a938c Management API for dynamic root and query steps. (#15505)
* Added management API for dynamic root and query steps.

* Open API

* Split models, use required and rename a little

* Rename query steps

* Make request culture and segment optional

* Introduce explicit back-office variation context

* Simplify query endpoint path

* Correct field naming

* Updated OpenApi.json

---------

Co-authored-by: kjac <kja@umbraco.dk>
2024-01-16 07:47:43 +01:00
Jacob Overgaard 852f0fb4a6 update backoffice submodule 2024-01-15 14:26:41 +01:00
Jacob Overgaard 201433fb71 update backoffice submodule 2024-01-15 11:57:59 +01:00
Jacob Overgaard 3f65046a7d update backoffice submodule 2024-01-15 11:45:35 +01:00
Bjarke Berg ea9226f169 Fixed exception type 2024-01-13 22:24:44 +01:00
Bjarke Berg eb8a27016e Fix merge issue with an old package reference 2024-01-13 21:27:24 +01:00
Bjarke Berg 9811eaebeb Post merge fix 2024-01-13 20:47:16 +01:00
Bjarke Berg aa6f704353 Merge remote-tracking branch 'origin/v14/dev' into v14/dev
# Conflicts:
#	src/Umbraco.Infrastructure/BackgroundJobs/Jobs/OpenIddictCleanupJob.cs
2024-01-12 13:34:30 +01:00
664da17c39 V14 QA Fixed the failed acceptance tests (#15527)
* Fixed failing tests

* Updated tests to use the updated helpers

* Clean up tests

* Enabled our pipeline for E2E testing

* Updated the CMS URl for our E2E tests

* Bumped version of our testHelpers

* Did some fixing, still a bit more to do

* Updated auth tests to use LoginUiHelper

* Updated Telemetry tests to use TelemetryUiHelper

* Updated LogViewer tests to use LogViewerUiHelper

* Updated api tests to apply AAA pattern and fix failed tests

* Removed unused import

* Fixed comments

* Bumped version of test helper

* Updated the version to 10 instead of 11

* Updated the package-lock.json file to contain the correct versions

* Added a waitForTimeout
The reason for this is that this test is failing on the pipeline

* Bumped version of testhelpers

* Removed TODO

* Updated EnsurePathExists so we create the stylesheet and scripts folder

* Added a waits for response, otherwise our test would be too fast

* Sometimes it reloads before the save is complete

* Added timeout for locator

* Removed duplicate

* Wait until save

* This was an actual bug, so we should not use a workaround, we should fix it

* Skips the tests for script.

* Bug was fixed, so this can be used again

---------

Co-authored-by: Andreas Zerbst <andr317c@live.dk>
2024-01-12 13:32:25 +01:00
MoleandGitHub a8fd00a3b4 Make an exception for root path (#15570) 2024-01-12 12:29:23 +01:00
c5c24d36d9 V14: Copy and move endpoints for content and media types (#15553)
* Create new request models

* Create new structural operation status

* Handling of new structural operation status

* New CopyAsync and MoveAsync

* New endpoints

* Update schema

* Adding NotFound status

* Adding BadRequest response type

* Moving getbyid check to service

* Fix signature and implement get by id check in service

* Update OpenApi schema

* Use PUT instead of POST in "move" controllers

* Use PUT instead of POST in some more "move" controllers

---------

Co-authored-by: kjac <kja@umbraco.dk>
2024-01-12 08:59:21 +01:00
Ronald BarendseandBjarke Berg 05921ee6cc Refactor System.Runtime.Caching to Microsoft.Extensions.Caching.Memory 2024-01-11 14:26:19 +01:00
Ronald BarendseandBjarke Berg ace5c54da2 Remove unused/untested dependent files support from IAppPolicyCache 2024-01-11 14:25:54 +01:00
Bjarke BergandGitHub e291fae01e Migrated ReportSite, OpenIddictCleanup and TemporaryFileCleanup to background jobs (#15555)
* Migrated ReportSite, OpenIddictCleanup and TemporaryFileCleanup to the new background jobs introduced in v13.

* Fixed delay and period
2024-01-11 13:18:10 +01:00
MoleandGitHub 416c19854d V14: Migrate examine integration tests to V14 (#15536)
* Begin migrating test to use new service calls

* Fix formatting

* Add todo to add timeout so our tests dont stall entirely

* Add timeout so tests can run

Still need to figure out why the index only seems to update sometimes

* Migrate BackOfficeExamineSearcherTests to use new service calls

* Remove unused imports

* Migrate to languageservice in external index searcher test

* Use seperate save and publish calls

* Use scopes in ExamineExternalIndexTests

* Use scopes in BackOfficeExamineSearcherTests
2024-01-11 11:12:47 +01:00
8516a7b2e5 V14: Add security related configurations (#15557)
* Implement user configuration endpoint

* Add password configuration factory

* refactor users to use new password configuration model

* Implement current user configuration endpoint

* Add auth policy

* Refacor current user to use PasswordConfigurationReponseModel

* Implement configuration security controller

* Rename property to less confusing name

* Add version to ConfigurationSecurityController.cs

* Review changes

---------

Co-authored-by: kjac <kja@umbraco.dk>
2024-01-11 10:30:22 +01:00
33f2b26bf6 [v14] Absolute media urls (#15503)
* Made a replaceble solution to support absolute urls for media/user avatars in the management API

* PR suggestion

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

* PR suggestion

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

* PR suggestion/fix and added missing switch case

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
2024-01-10 10:01:06 +01:00
a6ccd5a7a9 Implement temporary file configuration endpoint (#15518)
* Implement temporary file configuration endpoint

* Update MaxfileSize to be a string.

* Make max file size a nullable integer

---------

Co-authored-by: Elitsa <elm@umbraco.dk>
2024-01-10 09:20:29 +01:00
Bjarke Berg 5f4c8ea0bf Merge remote-tracking branch 'origin/v13/dev' into v14/dev
# Conflicts:
#	src/Umbraco.Cms.StaticAssets/umbraco/UmbracoBackOffice/Default.cshtml
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Login/login.spec.ts
2024-01-10 08:36:50 +01:00
3acda751b9 v14: Add Preview controller (#15481)
* Add Preview controller

* Implement PreviewService

* Add tests for endpoints.

* Add Authorization to previews

* Apply suggestions from code review

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

---------

Co-authored-by: Elitsa <elm@umbraco.dk>
Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com>
2024-01-09 15:51:59 +01:00
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 ee2501fe62.
This reverts commit 808d5b276f.

---------

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
Elitsa MarinovskaandGitHub f3cb8fe117 V14: User token revocation and session sign-out (#15511)
* Fix token revocation endpoints registration for .well-known

* Add logout and revocation endpoints to OpenIddict permissions

* Register urls for post_logout_redirect_uri

* Create /signout endpoint
2024-01-02 13:42:39 +01:00
674c48ab9a V14: Add optional key to template create model (#15471)
* Implement Id for request model

* Make key optional

* Add test for use case

---------

Co-authored-by: Elitsa <elm@umbraco.dk>
2024-01-02 08:57:07 +01:00
f026010102 Implement server configuration (#15507)
Co-authored-by: Elitsa <elm@umbraco.dk>
2023-12-29 13:47:44 +01:00
Bjarke Berg 1bf13b4ad4 Remove legacy file upload attribute usage 2023-12-22 15:49:33 +01:00
Bjarke Berg 6395feb3a3 Remove the DataTypeSplitDataCollector.cs 2023-12-22 15:48:53 +01:00
Bjarke Berg 1e849ad539 Merge remote-tracking branch 'origin/v13/dev' into v14/dev
# Conflicts:
#	Directory.Build.props
#	src/Umbraco.Web.BackOffice/Controllers/ContentController.cs
2023-12-22 14:19:04 +01:00
fc71724386 V14: Server information (#15497)
* Rename information endpoint to troubleshooting

* Rename information endpoint to troubleshooting

* Add new information endpoint

* Fix bad merge

* Add InformationServerController.cs back

* Update serverTime offset to non hard-coded value.

* Add dictionary to swagger models

* Update OpenApi.json file

* Rename map definition

* Add ServerConfigurationBaseModel

* Implement ServerConfigurationBaseModel.cs

* Updated OpenApi

* Updated endpoint to return correct type in openapi

* Use explicit class for server information

* Remove version endpoint, as that is contained in server information.

---------

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2023-12-22 10:21:11 +01:00
8acb5665e8 Add post and delete methods to user-group/id/users to add/remove user… (#15490)
* Add post and delete methods to user-group/id/users to add/remove users from group

* Update OpenApi contract

* PR feedbac

Moved fetch usergroup logic into service layer
Renamed methods to async

* Naming

* Introduced user not found on UserGroupOperationStatus, as otherwise the return message is wrong

* Added authentication

* Removed authorization from the service layer as its determined that that responsibiliity does not belong there.

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2023-12-22 08:05:45 +01:00
Bjarke Berg 4b3131fda4 Merge remote-tracking branch 'origin/v13/dev' into v14/dev 2023-12-20 15:17:37 +01:00
Jacob Overgaard 7694588c86 update backoffice submodule 2023-12-18 14:32:32 +01:00
Jacob OvergaardandGitHub 650a9dad3b add the cors policy as first item on the pipeline filter (#15472)
this ensures that any assets loaded as "modules" also get the right Access-Control-Allow-* headers
2023-12-18 14:19:53 +01:00
Kenn JacobsenandGitHub c2b970d0de Make "create folder" return HTTP 201 Created for file system folders (#15459)
* Make "create folder" return 201 and add expected return types to "create" and "delete" for all file system folder endpoints

* Update OpenApi.json
2023-12-18 11:01:53 +01:00
Jacob Overgaard 32cecbe14f update backoffice submodule 2023-12-16 11:01:01 +01:00
Jacob Overgaard 6df3b5bd66 update backoffice submodule 2023-12-16 09:47:06 +01:00
Jacob Overgaard bb43db2601 update backoffice submodule 2023-12-16 09:14:56 +01:00
Jacob Overgaard 786f584de9 update backoffice submodule 2023-12-15 10:29:49 +01:00
Jacob Overgaard 38b4e44479 update backoffice submodule 2023-12-15 09:48:32 +01:00
Elitsa MarinovskaandGitHub dbdf3cf03d V14: Tighten permissions for folder controllers (#15457)
* Fixing folder controller policies

* Remove unused policy
2023-12-14 15:03:35 +01:00
b4ca478f2c Required on view models (#15356)
* Added required on view models

* Updated OpenApi.json

* mark all fields required

* Force non-nullable as required.

* Missing import

* Update OpenApi.json

---------

Co-authored-by: Mads Rasmussen <madsr@hey.com>
2023-12-14 11:46:02 +01:00
Niels LyngsøandGitHub d368bd3ebf Update import maps (#15446)
* append 'property' and 'static-file'

* latest front-end commit
2023-12-14 11:45:44 +01:00
MoleandGitHub db9dc4a20d Rename user controller files to match class names (#15442) 2023-12-14 10:36:43 +01:00
Bjarke Berg 93fe9f3dea build 2023-12-14 09:04:23 +01:00
Bjarke Berg baf29649c9 Move package to central 2023-12-14 08:42:20 +01:00
Bjarke Berg d1b53c0ec9 Added ignore on new tests (Temporarily) 2023-12-13 16:34:17 +01:00
Bjarke Berg f8dda5a7b5 Post merge fixes 2023-12-13 16:25:28 +01:00
Bjarke Berg 95094361cc Merge remote-tracking branch 'origin/v13/dev' into v14/dev
# Conflicts:
#	Directory.Packages.props
#	build/azure-pipelines.yml
#	src/Umbraco.Cms.Api.Delivery/Handlers/InitializeMemberApplicationNotificationHandler.cs
#	src/Umbraco.Cms.StaticAssets/umbraco/UmbracoBackOffice/Default.cshtml
#	src/Umbraco.Cms.StaticAssets/umbraco/UmbracoLogin/Index.cshtml
#	src/Umbraco.Core/DependencyInjection/UmbracoBuilder.CollectionBuilders.cs
#	src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs
#	src/Umbraco.Infrastructure/Models/Blocks/BlockListEditorDataConverter.cs
#	src/Umbraco.Infrastructure/PropertyEditors/BlockListPropertyEditorBase.cs
#	src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/BlockListPropertyValueConverter.cs
#	src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/BlockListPropertyValueCreator.cs
#	tests/Directory.Packages.props
#	tests/Umbraco.Tests.AcceptanceTest/package.json
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/BlockListEditor/blockListEditorDataType.spec.ts
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/HelpPanel/helpLinks.spec.ts
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Login/login.spec.ts
#	tests/Umbraco.Tests.UnitTests/Umbraco.Core/PropertyEditors/BlockListPropertyValueConverterTests.cs
#	version.json
2023-12-13 15:34:22 +01:00
Nhu DinhandGitHub ced1a82c4e Renamed GetRichTextRulesByPath controller (#15443) 2023-12-13 10:58:56 +01:00
7fdd342643 PropertyEditor(UI)Alias name refactor (#15408)
* PropertyEditor(UI)Alias name refactor

* Updated OpenApi.json

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2023-12-13 09:50:52 +01:00
Jacob Overgaard 81b23a60a4 update backoffice submodule 2023-12-11 16:05:26 +01:00
fda866fc9e V14: Add authorization policies to Management API controllers - p2 (#15211)
* Making ProblemDetails details more generic

* Adding authorizer that can be replaces for external authz in handlers. Adding handler and requirement for UserBelongsToUserGroupInRequest policy

* Adding method to get the GUID from claims

* Adding service methods to check user group authz

* Porting MustSatisfyRequirementAuthorizationHandler

* Adding controllers authz

* Fix return status code + produced response type

* Moving to folder

* Adding DenyLocalLogin policy scaffold

* Implement a temp DenyLocalLoginHandler

* Introducing a new Fobidden result

* Fix comment

* Introducing a helper class for authorizers

* Changed nullability for GetCurrentUser

* Changes from Attempt to Status + FIXME comments

* Create a UserGroupAuthorizationStatus to be used in the future

* Introduces a new authz status for checking media acess

* Introducing a new permission service for media

* Adding fixme

* Adding more policy configurations

* Adding Media policy requirement and handler

* Adding media authorizer

* Fix order of params

* Adding duplicate code comment

* Adding authz to media controllers

* Migrating more logic from MediaPermissions.cs

* Adding more MediaAuthorizationStatus-es

* Handling of new authorization status

* Fix comment

* Adding NotFound case

* Adding NewDenyLocalLoginIfConfigured policy && commenting [AllowAnonymous] where the policy is applied since it is already handled

* Changed Forbid() to Forbidden() to get the correct status code

* Remove policy that is applied on the base controller already

* Implement and apply NewUmbracoFeatureEnabled policy

* Renaming classes to add Permission in the name

* Register permission services

* Add FIXME

* Introduce new IUserGroupPermissionService and refactor accordingly

* Add single overload with default implementation

* Adding user permission policy and related

* Applying admin policy

* Register all new policies

* Better wording

* Add default implementation for a single overload

* Adding remarks to IContentPermissionService.cs

* Supporting null as key in ContentPermissionService

* Fix namespace

* Reverting back to not supporting null as content key, but having dedicated implementation

* Adding content authorizer with null values to represent root item

* Removing null key support and adding dedicated implementation

* Removing remarks

* Adding content resource with null support

* Removing null support

* Adding requirement and status

* Adding content authorizer + handlers

* Applying policies to content controllers

* Update comment

* Handling of Authorization Statuses

* More authz in controllers

* Fix comments

* New branch handler

* Obsolete old implementation

* Adding dedicated policies to root and bin

* Adding a branch specific namespace

* Bin specific requirement and namespace

* Root specific requirement and namespace

* Changing to new root policy

* Refactoring

* Save policies

* Fix null check/reference

* Add TODO comment

* Create media root- and bin-specific policies, handlers, etc.

* Apply correct policy in create and update media controllers

* Apply root policy to move and sort controllers

* Fix wording

* Adding UserGroupAuthorizationStatusResult

* Remove all AuthorizationStatusResult as we cannot get the specific AuthorizationStatus

* Fixing Umbraco feature policy

* Fix allow anonymous endpoints - the value returned from DenyLocalLoginHandler wasn't enough, we need to succeed DenyAnonymousAuthorizationRequirement as it is required for some of the endpoints that had the attribute

* Apply DenyLocalLoginIfConfigured policy to corresponding re-implementation of PostSetInvitedUserPassword

* Fix comment

* Renaming performingUser to user and fixing comments

* Rename helper method

* Fix references

* Re-add merge conflict deletion

* Adding Backoffice requirement and relevant

* Registering

* Added a simple policy test

* Fixed small test things and clean up

* Temp solution

* Added one more test and fix another static issue

* Fix another merge conflict

* Remove BackOfficePermissionRequirement and handler as they might not be necessary

* Comment out again [AllowAnonymous]

* Remove AuthorizationPolicies.BackOfficeAccessWithoutApproval policy as it might not be necessary

* Fix temp implementation

* Fix reference to correct handler

* Apply authz policy to new publish/unpublish controllers

* Fix comments

* Removing duplicate ProducesResponseTypes

* Added swagger documentation about the 401 and 403

* Added Resources to Media, User and UserGroup

* Handle root, recycle bin and branch in the same handler

* Handle both parent and target when moving

* Check Ids for all sort requests

* Xml docs

* Clean up

* Clean up

* Fix build

* Cleanup

* Remove TODO

* Added missing overload

* Use yield

* Adding some keys to check

---------

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
Co-authored-by: Andreas Zerbst <andr317c@live.dk>
2023-12-11 08:25:29 +01:00
Jacob Overgaard f8b95e5c69 update backoffice submodule 2023-12-07 10:06:46 +01:00
Jacob Overgaard f5a49d87c3 update backoffice submodule 2023-12-06 15:32:47 +01:00
Kenn JacobsenandGitHub 4e6b9af959 Allow specifying root access for user groups (#15364) 2023-12-06 10:18:32 +01:00
Jacob Overgaard 1be548b680 Update nightly build (#15359)
* cherry-pick templateParameters from v14/dev

* add isNightly parameter

* remove v9

* add parameter check for myget isNightly
2023-12-05 13:11:15 +01:00
Jacob OvergaardandGitHub cd10d5840d V14: Publish Bellissima package to npm via Pipelines (#14926)
* ignore node_modules specifically to limit size of build_output

* build and publish backoffice artifacts

* instruct GitVersioning to output all variables such as npm to use in Pipelines

* use NBGV variables

* prepare npm package for nightlies

* instruct to deploy to MyGet for nightlies

* Deploy to npm only after Myget

* add public access to publish

* write scopes to .npmrc file

* add scope to registry.npmjs.org

* nightly param
2023-12-05 10:54:23 +01:00
48befe730b V14 QA Refactor code of Partial View acceptance tests (#15325)
* Refactor acceptance tests for Partial View

* Refactor api tests for Partial View

* Bumped version of Test Helper

* Added suggestion from review

* Bumped version to testhelpers 2.0.8

---------

Co-authored-by: Andreas Zerbst <andr317c@live.dk>
2023-12-01 11:20:57 +01:00
Kenn JacobsenandGitHub f9ecd9514e Management API should expose if a user group is a system group (#15333) 2023-12-01 09:39:27 +01:00
Kenn JacobsenandGitHub 42234cdd40 Move system information away from the User API (#15316)
* Move system information away from the User API

* Review comments
2023-11-30 14:29:16 +01:00
Bjarke Berg 53d0057ac6 Update test dependencies 2023-11-29 12:46:28 +01:00
Kenn JacobsenandGitHub c9c234492b Add missing API version attributes to management API controllers (#15310) 2023-11-29 09:23:23 +01:00
Bjarke Berg ddf9f05a8f Merge remote-tracking branch 'origin/v13/dev' into v14/dev
# Conflicts:
#	src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs
#	tests/Umbraco.Tests.AcceptanceTest/package-lock.json
#	version.json
2023-11-28 15:18:24 +01:00
Bjarke Berg 17ea20ee3d Merge remote-tracking branch 'origin/v13/dev' into v14/dev
# Conflicts:
#	src/Umbraco.Cms.StaticAssets/umbraco/UmbracoBackOffice/Default.cshtml
#	src/Umbraco.Cms.StaticAssets/umbraco/UmbracoInstall/Index.cshtml
#	src/Umbraco.Cms.StaticAssets/umbraco/UmbracoLogin/Index.cshtml
2023-11-28 15:09:48 +01:00
Jacob Overgaard 98e2a1b897 update backoffice submodule 2023-11-28 13:54:03 +01:00
d6f0c33d83 V14 added acceptance tests for the Stylesheets (#15265)
* Added acceptance test for Stylesheets

* Updated api test for stylesheet using new helpers and apply AAA pattern

* Bumped version of Test Helpers

* Updated api and ui tests of Stylesheet after modifying TestHelper

* Updated stylesheets ui tests using openActionMenuAtRoot()

* Added suggestions from review

* Added wait for the flaky tests

* Fixed package-lock.json

---------

Co-authored-by: Andreas Zerbst <andr317c@live.dk>
2023-11-23 09:33:51 +01:00
Jacob Overgaard e04b015026 update backoffice submodule 2023-11-22 16:19:55 +01:00
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
Elitsa MarinovskaandGitHub 42dd2da579 V14: Allowing custom backoffice host with CORS policy (#15269)
* Allowing custom backoffice host with CORS policy

* Adding missing allow
2023-11-21 15:49:29 +01:00
Elitsa MarinovskaandGitHub 8274822577 V14: Start using user group permission service (#15200)
* Adding a replacement to IUserGroupAuthorizationService

* Replacement for the implementation as well

* Adding AuthorizationStatus & mapping it to the corresponding OperationStatus

* Fix references

* Fix another reference

* Fix statuses

* Fix status result messages

* Fix wording

* Moving check for user part of user group earlier

* Review suggestion

* Fix section name
2023-11-17 11:52:29 +01:00
Nhu DinhandGitHub dc79b84700 V14 added acceptance tests for the Partial Views (#15210)
* add UI acceptance tests for Partial Views

* Added additional timeout

* fixed comments

* Fixed suggestions from review
2023-11-17 08:24:31 +01:00
Andreas ZerbstandGitHub 8b5717500d V14 QA added Scripts acceptance tests (#15212)
* Updated api script tests for using new helpers and the AAA pattern

* Added acceptance tests for the scripts

* updated naming

* Bumped version of testHelpers

* Added suggestions from review
2023-11-17 10:11:43 +07:00
Jacob Overgaard 549b219a8b update backoffice submodule 2023-11-16 15:24:32 +01:00
Jacob Overgaard 30ee7ae045 update backoffice submodule 2023-11-16 15:23:41 +01:00
Bjarke Berg 5b3e9c580a Merge remote-tracking branch 'origin/v13/dev' into v14/dev
# Conflicts:
#	version.json
2023-11-16 09:12:01 +01:00
Bjarke Berg 696867b305 Merge remote-tracking branch 'origin/v14/dev' into v14/dev
# Conflicts:
#	src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs
2023-11-16 09:08:30 +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
c5c8a59736 Allow ID for a new dictionary-item to be specified (#15187)
* Allow ID for a new dictionary-item to be specified

* PR: Pattern matching hotness

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>
2023-11-14 13:01:59 +01:00
Mads RasmussenandGitHub 7d9db0ab30 update import map for data type (#15199) 2023-11-14 12:27:35 +01:00
Andreas ZerbstandGitHub 3d6c5850dc V14 added test for the Templates (#15179)
* Updated existing locator as it was prone to failing

* Removed old tests from earlier versions

* Added a timeout and an await. This was because the locator sometimes failed

* Added missing import for crypto

* Updated locator as it sometimes failed.

* Updated the README to include information for using the UI mode for playwright

* Bumped the timeout time for our tests

* We updated the naming for out methods in our testHelpers, so we need to update the usage as well

* Added additional timeout

* Updated the config so it is easier to understand what you need to input

* Added UI acceptance tests for templates

* Added types/node, allows us to use crypto. Updated the testhelpers to use the newest version.

* fixed error with testhelper dependency

* Bumped testhelper version

* Moved to settings instead of templating
2023-11-13 09:36:23 +01:00
Kenn JacobsenandGitHub 589c74e918 Data type icons should not be served from the Management API (#15155)
* Remove data type icons from management API output and add editor UI alias instead

* Update OpenApi.json
2023-11-10 14:17:50 +01:00
Jacob Overgaard a0ff997ab0 Merge remote-tracking branch 'origin/v13/dev' into v14/dev 2023-11-10 13:49:54 +01:00
Jacob OvergaardandGitHub c03df2b74e V14: make v13 login screen work initially with Management API (#15170)
* make the login check a bit more robust to be able to handle both old postlogin and new management api response types

* v14 only: update the login url to work with the management api (this will still work with the old backoffice to some extent)

* Revert "v14 only: update the login url to work with the management api (this will still work with the old backoffice to some extent)"

This reverts commit 0639ca80f0.

* V14 only: additionally authenticate with the Management API to set the right cookies
2023-11-10 13:38:08 +01:00
Bjarke Berg e13ab13183 Merge remote-tracking branch 'origin/v13/dev' into v14/dev
# Conflicts:
#	Directory.Build.props
#	src/Umbraco.Core/CompatibilitySuppressions.xml
#	src/Umbraco.Infrastructure/CompatibilitySuppressions.xml
#	src/Umbraco.Web.BackOffice/CompatibilitySuppressions.xml
#	src/Umbraco.Web.Common/CompatibilitySuppressions.xml
#	tests/Umbraco.Tests.Common/CompatibilitySuppressions.xml
#	tests/Umbraco.Tests.Integration/CompatibilitySuppressions.xml
2023-11-09 09:41:39 +01:00
Bjarke Berg e9857c800a Merge remote-tracking branch 'origin/v14/dev' into v14/dev 2023-11-09 07:57:00 +01:00
Jacob Overgaard 1f4bbe2f06 update backoffice submodule 2023-11-08 14:39:46 +01:00
Bjarke Berg fd0c233362 Merge remote-tracking branch 'origin/v13/dev' into v14/dev 2023-11-08 05:53:03 +01:00
Bjarke Berg 5e37b997af Merge remote-tracking branch 'origin/v14/dev' into v14/dev 2023-11-08 05:52:35 +01:00
2f4f2ae384 V14/feature/custom generic swagger (#15025)
Co-authored-by: Sven Geusens <sge@umbraco.dk>
2023-11-07 16:15:56 +01:00
Andreas ZerbstandGitHub 66ea4fe29a V14 QA Added Log Viewer Tests (#15108)
* Added log viewer tests, not done yet

* Updated auth to work

* Updated the authentication test

* Cleaned up the Logviewer tests

* Removed old acceptance tests

* Fixed failing test

* Updated old tests and added additional log viewer tests

* Bumped version and deleted duplicate dependencies

* Fixed naming

* Added a TODO
2023-11-06 11:33:25 +01:00
Jacob Overgaard 3f4bb50a98 update backoffice submodule 2023-11-02 16:50:12 +01:00
Jacob Overgaard 2bbd5fa541 update backoffice submodule 2023-11-02 16:32:06 +01:00
Jacob Overgaard 0a65f0a576 lockfile 2023-11-02 14:06:21 +01:00
Bjarke Berg 83ed42998a Merge remote-tracking branch 'origin/v13/dev' into v14/dev 2023-11-02 13:12:46 +01:00
Kenn JacobsenandGitHub 0f91ed895d Merge pull request #15100 from umbraco/v14/feature/merge-01-11-2023
V13 to V14 merge 01-11-2023
2023-11-02 12:38:26 +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
Bjarke Berg ef80e25aa6 Merge remote-tracking branch 'origin/v13/dev' into v14/dev
# Conflicts:
#	build/azure-pipelines.yml
#	src/Umbraco.Core/Constants-Configuration.cs
#	src/Umbraco.Core/DependencyInjection/UmbracoBuilder.Configuration.cs
#	src/Umbraco.Core/Factories/IDatabaseSettingsFactory.cs
#	src/Umbraco.Core/Factories/IInstallSettingsFactory.cs
#	src/Umbraco.Core/Factories/IUpgradeSettingsFactory.cs
#	src/Umbraco.Core/Factories/InstallSettingsFactory.cs
#	src/Umbraco.Core/Factories/UpgradeSettingsFactory.cs
#	src/Umbraco.Core/Factories/UserSettingsFactory.cs
#	src/Umbraco.Core/Installer/IInstallStep.cs
#	src/Umbraco.Core/Installer/IUpgradeStep.cs
#	src/Umbraco.Core/Installer/NewInstallStepCollection.cs
#	src/Umbraco.Core/Installer/NewInstallStepCollectionBuilder.cs
#	src/Umbraco.Core/Installer/Steps/FilePermissionsStep.cs
#	src/Umbraco.Core/Installer/Steps/RestartRuntimeStep.cs
#	src/Umbraco.Core/Installer/Steps/TelemetryIdentifierStep.cs
#	src/Umbraco.Core/Installer/UpgradeStepCollection.cs
#	src/Umbraco.Core/Installer/UpgradeStepCollectionBuilder.cs
#	src/Umbraco.Core/Models/Blocks/RichTextBlockLayoutItem.cs
#	src/Umbraco.Core/Models/Blocks/RichTextEditorBlockDataConverter.cs
#	src/Umbraco.Core/Models/Configuration/NewBackOfficeSettings.cs
#	src/Umbraco.Core/Models/Configuration/NewBackOfficeSettingsValidator.cs
#	src/Umbraco.Core/Models/Installer/ConsentLevelModel.cs
#	src/Umbraco.Core/Models/Installer/DatabaseInstallData.cs
#	src/Umbraco.Core/Models/Installer/DatabaseSettingsModel.cs
#	src/Umbraco.Core/Models/Installer/InstallData.cs
#	src/Umbraco.Core/Models/Installer/InstallSettingsModel.cs
#	src/Umbraco.Core/Models/Installer/PasswordSettingsModel.cs
#	src/Umbraco.Core/Models/Installer/UpgradeSettingsModel.cs
#	src/Umbraco.Core/Models/Installer/UserInstallData.cs
#	src/Umbraco.Core/Models/Installer/UserSettingsModel.cs
#	src/Umbraco.Core/Models/OutOfDateType.cs
#	src/Umbraco.Core/PaginationHelper.cs
#	src/Umbraco.Core/Services/Installer/IInstallService.cs
#	src/Umbraco.Core/Services/Installer/IUpgradeService.cs
#	src/Umbraco.Core/Services/Installer/InstallService.cs
#	src/Umbraco.Core/Services/Installer/UpgradeService.cs
#	src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.Repositories.cs
#	src/Umbraco.Infrastructure/Factories/Installer/DatabaseSettingsFactory.cs
#	src/Umbraco.Infrastructure/Installer/Steps/CreateUserStep.cs
#	src/Umbraco.Infrastructure/Installer/Steps/DatabaseConfigureStep.cs
#	src/Umbraco.Infrastructure/Installer/Steps/DatabaseInstallStep.cs
#	src/Umbraco.Infrastructure/Installer/Steps/DatabaseUpgradeStep.cs
#	src/Umbraco.Infrastructure/Installer/Steps/RegisterInstallCompleteStep.cs
#	src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs
#	src/Umbraco.Infrastructure/Models/Blocks/BlockEditorDataConverter.cs
#	src/Umbraco.Infrastructure/PropertyEditors/BlockEditorPropertyValueEditor.cs
#	src/Umbraco.Infrastructure/PropertyEditors/BlockEditorValidator.cs
#	src/Umbraco.Infrastructure/PropertyEditors/BlockEditorValues.cs
#	src/Umbraco.Infrastructure/PropertyEditors/RichTextPropertyEditor.cs
#	src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/BlockGridPropertyValueConverter.cs
#	src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/BlockListPropertyValueConverter.cs
#	src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/BlockPropertyValueConverterBase.cs
#	src/Umbraco.Infrastructure/Security/IBackOfficeApplicationManager.cs
#	src/Umbraco.Infrastructure/Services/IIndexingRebuilderService.cs
#	src/Umbraco.Infrastructure/Services/IndexingRebuilderService.cs
#	src/Umbraco.New.Cms.Core/Umbraco.New.Cms.Core.csproj
#	src/Umbraco.New.Cms.Infrastructure/Umbraco.New.Cms.Infrastructure.csproj
#	src/Umbraco.New.Cms.Web.Common/Umbraco.New.Cms.Web.Common.csproj
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/content.spec.ts
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Login/login.spec.ts
#	tests/Umbraco.Tests.UnitTests/Umbraco.Core/PropertyEditors/BlockListPropertyValueConverterTests.cs
#	version.json
2023-11-01 13:50:38 +01:00
Bjarke Berg e159124643 Merge branch 'v14/feature/merge-29-10-2023' into v14/dev 2023-11-01 12:41:12 +01:00
Bjarke Berg 2856dc19a4 revert wrong merge for installer 2023-11-01 12:22:52 +01:00
Jacob Overgaard 985799068b update backoffice submodule 2023-10-31 16:46:28 +01:00
Jacob Overgaard fe8fe821d4 update backoffice submodule 2023-10-31 15:14:18 +01:00
Jacob Overgaard 0281b71dc8 update importmap 2023-10-31 11:50:35 +01:00
6c5d38eb1a V14/feature/resend user invite endpoint (#14985)
* Added endpoint to resend invites for users.

* improve async return signatures + usings cleanup

* Improve/fix controller details

* Small improvements/clarifications

* Minor whitespace and naming fixes

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
Co-authored-by: Nikolaj <nikolajlauridsen@protonmail.ch>
2023-10-31 10:07:30 +01:00
Jacob Overgaard bf6b2b1939 add new imports 2023-10-31 09:19:46 +01:00
Jacob Overgaard 7a750da8aa update build markers for StaticAssets to support Belle, Bellissima, Auth, and Login 2023-10-31 08:01:24 +01:00
Jacob Overgaard 8e925cb44c add condition to allow V13 and V14 login screens to work simultaneously 2023-10-30 15:58:29 +01:00
Jacob Overgaard 230164efd8 update backoffice submodule to ensure "auth app" is set to output its files properly 2023-10-30 15:45:38 +01:00
Jacob Overgaard 060ce40475 set new v14 "auth app" to output its files into a new "auth" folder to ensure it doesnt conflict with v13 login screen 2023-10-30 15:44:02 +01:00
Jacob Overgaard ca03034afb Add UmbracoLogin/Index.cshtml from V13 into the Umbraco.Web.UI executable to override the V14 login screen 2023-10-30 15:43:02 +01:00
Jacob Overgaard ebef3e2359 The default login view should be the v14 compliant login component until the v13 login screen is migrated properly 2023-10-30 15:42:31 +01:00
Bjarke Berg bd0a8bfdf7 post merge 2023-10-30 15:13:12 +01:00
Bjarke Berg dfe5dfa4c1 Merge remote-tracking branch 'origin/v14/dev' into v14/dev
# Conflicts:
#	src/Umbraco.Cms.Api.Common/DependencyInjection/UmbracoBuilderAuthExtensions.cs
#	src/Umbraco.Core/DeliveryApi/IApiContentQueryProvider.cs
#	src/Umbraco.Core/DeliveryApi/IApiContentQueryService.cs
#	src/Umbraco.Core/Services/ITagService.cs
#	src/Umbraco.Core/Services/UserService.cs
#	src/Umbraco.Web.BackOffice/Controllers/MediaController.cs
2023-10-26 09:50:08 +02:00
Bjarke Berg e147c93cf9 Merge remote-tracking branch 'origin/v13/dev' into v14/dev
# Conflicts:
#	Directory.Build.props
#	build/azure-pipelines.yml
#	src/Umbraco.Cms.Api.Common/DependencyInjection/UmbracoBuilderAuthExtensions.cs
#	src/Umbraco.Cms.Api.Common/OpenApi/SwaggerRouteTemplatePipelineFilter.cs
#	src/Umbraco.Cms.Api.Common/Security/Paths.cs
#	src/Umbraco.Cms.Api.Delivery/Controllers/Security/MemberController.cs
#	src/Umbraco.Cms.Api.Delivery/DependencyInjection/UmbracoBuilderExtensions.cs
#	src/Umbraco.Cms.Api.Delivery/Handlers/InitializeMemberApplicationNotificationHandler.cs
#	src/Umbraco.Cms.Api.Delivery/Handlers/RevokeMemberAuthenticationTokensNotificationHandler.cs
#	src/Umbraco.Cms.Api.Delivery/Security/MemberApplicationManager.cs
#	src/Umbraco.Cms.Api.Delivery/Services/RequestMemberAccessService.cs
#	src/Umbraco.Cms.StaticAssets/umbraco/UmbracoBackOffice/Default.cshtml
#	src/Umbraco.Cms.StaticAssets/umbraco/UmbracoLogin/Index.cshtml
#	src/Umbraco.Core/Constants-OAuthClaims.cs
#	src/Umbraco.Core/Constants-OAuthClientIds.cs
#	src/Umbraco.Core/DeliveryApi/IApiContentQueryProvider.cs
#	src/Umbraco.Core/DeliveryApi/IApiContentQueryService.cs
#	src/Umbraco.Core/DeliveryApi/IRequestMemberAccessService.cs
#	src/Umbraco.Core/DeliveryApi/NoopRequestMemberAccessService.cs
#	src/Umbraco.Core/Models/DeliveryApi/ProtectedAccess.cs
#	src/Umbraco.Core/Services/ITagService.cs
#	src/Umbraco.Core/Services/UserService.cs
#	src/Umbraco.Infrastructure/Security/IMemberApplicationManager.cs
#	src/Umbraco.Infrastructure/Security/OpenIdDictApplicationManagerBase.cs
#	src/Umbraco.Web.BackOffice/Controllers/BackOfficeController.cs
#	src/Umbraco.Web.BackOffice/Controllers/MediaController.cs
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/HelpPanel/systemInformation.spec.ts
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Login/login.spec.ts
#	version.json
2023-10-26 09:48:05 +02:00
Kenn JacobsenandGitHub b7a1cd5ab4 Cleaned up V14 TODOs from ContentApiItemControllerBase (#15026) 2023-10-24 10:08:28 +02:00
kjac 37082ac53d Remove duplicate reference to Core
(cherry picked from commit 304a64be5a)
2023-10-23 19:34:38 +02:00
Ronald Barendseandkjac ebc6e38b86 Ensure PackageVersion is set correctly before transforming template.json
(cherry picked from commit 0170ecaec1)
(cherry picked from commit 69c1bcec3a)
2023-10-23 19:34:30 +02:00
kjac e30a87d1fd Merge branch 'v13/dev' into v14/dev
# Conflicts:
#	Directory.Build.props
#	build/azure-pipelines.yml
#	src/Umbraco.Cms.Api.Common/DependencyInjection/UmbracoBuilderAuthExtensions.cs
#	src/Umbraco.Cms.Api.Common/OpenApi/SwaggerRouteTemplatePipelineFilter.cs
#	src/Umbraco.Cms.Api.Common/Security/Paths.cs
#	src/Umbraco.Cms.Api.Delivery/Controllers/Security/MemberController.cs
#	src/Umbraco.Cms.Api.Delivery/DependencyInjection/UmbracoBuilderExtensions.cs
#	src/Umbraco.Cms.Api.Delivery/Handlers/InitializeMemberApplicationNotificationHandler.cs
#	src/Umbraco.Cms.Api.Delivery/Handlers/RevokeMemberAuthenticationTokensNotificationHandler.cs
#	src/Umbraco.Cms.Api.Delivery/Security/MemberApplicationManager.cs
#	src/Umbraco.Cms.Api.Delivery/Services/RequestMemberAccessService.cs
#	src/Umbraco.Core/Constants-OAuthClaims.cs
#	src/Umbraco.Core/Constants-OAuthClientIds.cs
#	src/Umbraco.Core/DeliveryApi/IApiContentQueryProvider.cs
#	src/Umbraco.Core/DeliveryApi/IApiContentQueryService.cs
#	src/Umbraco.Core/DeliveryApi/IRequestMemberAccessService.cs
#	src/Umbraco.Core/DeliveryApi/NoopRequestMemberAccessService.cs
#	src/Umbraco.Core/Models/DeliveryApi/ProtectedAccess.cs
#	src/Umbraco.Core/Services/ITagService.cs
#	src/Umbraco.Core/Services/UserService.cs
#	src/Umbraco.Infrastructure/Security/IMemberApplicationManager.cs
#	src/Umbraco.Infrastructure/Security/OpenIdDictApplicationManagerBase.cs
#	src/Umbraco.Web.BackOffice/Controllers/MediaController.cs
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/HelpPanel/systemInformation.spec.ts
#	version.json
2023-10-23 19:03:13 +02:00
Andreas ZerbstandGitHub ace8d80183 Refactored from ISystemClock to TimeProvider (#14963)
* Removed obsolete ISystemClock. The SecurityStampValidator provides the TimeProvider.

* Removed obsolete ISystemClock.

* Refactored obsolete ISystemClock with TimeProvider
2023-10-12 13:58:51 +02:00
6fb2550690 V14/feature/response model trash tracking (#14948)
* Clearify UmbracoMapper functionality trough comment

* Add trash tracking to doc/media(item) response models

* Add mapping for ITracksTrashing

* Removed uneccesary abstraction and seperation

* Cleanup after removing abstractions

* Cleanup unused DI item

* Clean up and formatting

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
Co-authored-by: kjac <kja@umbraco.dk>
2023-10-12 07:00:06 +02:00
Elitsa MarinovskaandGitHub 517e0e9d19 Removing dev certificates and adding enc and signing keys that are required by OpenIddict but won't be used when we calling UseDataProtection() (#14958) 2023-10-11 14:15:08 +02:00
Nikolaj GeisleandGitHub 443f03688e Fix update to update foreach Group (#14945) 2023-10-11 10:46:25 +02:00
Mads RasmussenandGitHub 332ef6fa7e align user import map (#14952) 2023-10-11 10:01:22 +02:00
Bjarke Berg 838fd95f41 Merge remote-tracking branch 'origin/v13/dev' into v14/dev
# Conflicts:
#	tests/Umbraco.Tests.AcceptanceTest/package-lock.json
#	tests/Umbraco.Tests.AcceptanceTest/package.json
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/BlockGridEditor/Content/blockGridEditorAdvanced.spec.ts
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/BlockGridEditor/Content/blockGridEditorAreasContent.spec.ts
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/BlockGridEditor/Content/blockGridEditorSettings.spec.ts
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/BlockGridEditor/Datatype/BlockGridEditorDataTypeBlocks.spec.ts
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/BlockListEditor/blockListEditorDocument.spec.ts
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/content.spec.ts
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/routing.spec.ts
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/partialViews.spec.ts
2023-10-10 13:47:18 +02:00
Jacob Overgaard 7995df6cfd update backoffice submodule 2023-10-09 17:33:53 +02:00
Mads RasmussenandGitHub 99a1aa9301 update event path in importmap (#14844) 2023-10-09 16:15:40 +02:00
Jacob Overgaard 5b57234b52 update backoffice submodule 2023-10-06 12:04:21 +02:00
Mads RasmussenandGitHub ded1cbb9fa update import map to repository module (#14845) 2023-10-06 12:03:45 +02:00
Kenn JacobsenandGitHub 05522010d8 Default value editors for all (meaningful) value types (#14928)
* Expose editor UI alias in published property type, so custom value converters can use it

* Add default property value converters for all value types (#14869)

* Add default property value converters for all value types

* Clean up some left-over stuff

(cherry picked from commit ce86abe8ac)

* Added "plain" property editors for all (meaningful) value types
2023-10-06 10:42:23 +02:00
Jacob Overgaard 5c63561629 update backoffice submodule 2023-09-28 12:41:29 +02:00
83321a8fad Add member auth to the Delivery API (#14730)
* Refactor OpenIddict for shared usage between APIs + implement member authentication and handling within the Delivery API

* Make SwaggerRouteTemplatePipelineFilter UI config overridable

* Enable token revocation + rename logout endpoint to signout

* Add default implementation of SwaggerGenOptions configuration for enabling Delivery API member auth in Swagger

* Correct notification handling when (un)protecting content

* Fixing integration test framework

* Cleanup test to not execute some composers twice

* Update paths to match docs

* Return Forbidden when a member is authorized but not allowed to access the requested resource

* Cleanup

* Rename RequestMemberService to RequestMemberAccessService

* Rename badly named variable

* Review comments

* Hide the auth controller from Swagger

* Remove semaphore

* Add security requirements for content API operations in Swagger

* Hide the back-office auth endpoints from Swagger

* Fix merge

* Update back-office API auth endpoint paths + add revoke and sign-out endpoints (as of now they do not exist, a separate task will fix that)

* Swap endpoint order to maintain backwards compat with the current login screen for new back-office (will be swapped back again to ensure correct .well-known endpoints, see FIXME comment)

* Make "items by IDs" endpoint support member auth

* Add 401 and 403 to "items by IDs" endpoint responses

---------

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
Co-authored-by: Elitsa <elm@umbraco.dk>
2023-09-26 09:22:45 +02:00
Bjarke Berg 624f9a0508 Checkout submodule for v14 integration tests 2023-09-25 11:35:29 +02:00
Bjarke Berg c653dff3c0 Cleanup duplicate package references 2023-09-25 11:21:58 +02:00
Bjarke Berg d2410d5150 Bump version 2023-09-22 10:56:28 +02:00
Bjarke Berg 866ef1a886 Merge remote-tracking branch 'origin/v13/dev' into v14/dev 2023-09-22 10:56:05 +02:00
Bjarke Berg 3184bdf5a9 Merge remote-tracking branch 'origin/v13/dev' into v14/dev 2023-09-22 10:24:40 +02:00
b8f948785a Added necesary classes to define the StringPropertyEditor (#14769)
* Added necesary classes to define the StringPropertyEditor

* Removed unnecesary code, baseclass takes care of everything

* More cleanup and added a propertyValueConverter

* Upped the expected default dataEditors in tests by 1 since we added one.

* Fixed a bad undo action

* PR feedback Removed unnecesary code and simplified methods

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
2023-09-20 14:49:53 +02:00
Bjarke Berg 49c71b1989 Merge 2023-09-20 14:13:21 +02:00
Bjarke Berg 8050bb97af Merge remote-tracking branch 'origin/release/14.0' into v14/dev 2023-09-19 15:31:20 +02:00
Bjarke Berg 964e3b5797 Fixed test 2023-09-19 15:30:48 +02:00
Bjarke Berg c0e378cc41 fixed issue after minimal hosting model 2023-09-19 14:59:46 +02:00
Bjarke Berg 463068c07b Updated to latest .net and fixes small issues with installer after 2023-09-19 14:57:24 +02:00
Bjarke Berg 4f98b546c5 Merge branch 'release/14.0' into v14/dev 2023-09-19 14:53:27 +02:00
Bjarke Berg ac8663ea13 Merge remote-tracking branch 'origin/v13/dev' into v14/dev 2023-09-19 13:02:53 +02:00
Bjarke Berg e059ac2e5b Add missing ImportMap replacement 2023-09-19 10:55:10 +02:00
Bjarke Berg c4f5a2aca8 Merge remote-tracking branch 'origin/v13/dev' into v14/dev 2023-09-19 10:44:02 +02:00
Jacob Overgaard 4b918cbb3a update backoffice submodule 2023-09-15 14:06:43 +02:00
Kenn JacobsenandGitHub 981bf09325 Minor Management API changes from FE (#14804)
* Change document delete into move-to-recycle-bin

* Make it possible to supply an explicit ID when creating content and media

* Change media delete into move-to-recycle-bin

* Merge "allowed child content types" controllers into one + fixed a bug that allowed all types if none were defined

* Update OpenAPI JSON to reflect merged endpoints
2023-09-14 10:07:08 +02:00
Bjarke Berg 925b195e4c Updated submodule and fixed import map 2023-09-12 10:40:05 +02:00
Bjarke Berg 45abec6e88 Merge remote-tracking branch 'origin/v14/feature/front-end-importmap-update' into v14/dev
# Conflicts:
#	src/Umbraco.Cms.StaticAssets/umbraco/UmbracoBackOffice/Default.cshtml
#	src/Umbraco.Cms.StaticAssets/umbraco/UmbracoInstall/Index.cshtml
2023-09-12 10:35:53 +02:00
Bjarke Berg 8ca57c50c2 Merge remote-tracking branch 'origin/v13/dev' into v14/dev 2023-09-12 10:22:37 +02:00
Mads RasmussenandJacob Overgaard db98f88773 add culture module 2023-09-11 15:24:04 +02:00
Mads RasmussenandJacob Overgaard 622041fabc rename context module to app module 2023-09-11 15:23:45 +02:00
Jacob Overgaard 4e0f6a5696 update backoffice submodule 2023-09-08 13:58:26 +02:00
Niels LyngsøandJacob Overgaard 8cb0862142 append 3 more things to the import maps of C# 2023-09-08 13:49:13 +02:00
Jacob Overgaard 597b0a2be2 update submodule 2023-09-08 13:39:35 +02:00
Jacob Overgaard 420503fe40 bump to preview003 2023-09-08 13:39:11 +02:00
Niels Lyngsø ff0c2ef57c append 3 more things to the import maps of C# 2023-09-08 13:33:09 +02:00
Niels LyngsøandJacob Overgaard 10047c7ea8 update sub module 2023-09-08 10:08:04 +02:00
e4cc2a0550 Fix/in browser postman auth & editor config boolean serialization (#14739)
* Add in-browser postman callback url

* Added a jsonconverter for property editor configuration boolean values that are persisted as numbers and serialized as strings...

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
2023-09-04 14:24:37 +02:00
Bjarke Berg dede983941 Merge remote-tracking branch 'origin/v13/dev' into v14/dev 2023-09-04 10:50:18 +02:00
Bjarke Berg ffa664f217 Merge remote-tracking branch 'origin/v13/dev' into v14/dev 2023-09-04 10:45:50 +02:00
4f5fc0b8a1 Bulk delete functionality for management api (#14735)
* Bulk delete

* Bulk delete

* Added bulk delete user groups

* Clean

---------

Co-authored-by: Nikolaj <nikolajlauridsen@protonmail.ch>
2023-08-29 15:51:20 +02:00
Bjarke Berg a07d29b76a Merge remote-tracking branch 'origin/v14/dev' into v14/dev 2023-08-28 12:17:40 +02:00
Bjarke Berg 1b3f7afe20 Use the IFileStreamSecurityValidator in the temporary file service 2023-08-28 12:17:34 +02:00
b8af4bab7d User forgot password functionality for Management API (#14704)
* Added attribute filter to ensure a request is taking a minimum time to response

* Added functionality to management api to send forgot password emails and verify these + do the actual reset using the token

* Renamed UserKey to UserId and updated OpenApi.json

* Update src/Umbraco.Core/Services/IUserService.cs

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

* Cleanup

* Renaming param

* Fixing send user username instead of email + wrong EmailTypes

* Fixed issue with forgot password functionality after reusing other functionality

* Rename prop

* Adding docs and renaming param

* Handle password validation return types

* More cleanup

---------

Co-authored-by: Elitsa <elm@umbraco.dk>
Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com>
2023-08-28 12:14:16 +02:00
Bjarke Berg 6fbf04592c Merge remote-tracking branch 'origin/v13/dev' into v14/dev
# Conflicts:
#	build/azure-pipelines.yml
#	src/Umbraco.Cms.Api.Delivery/Controllers/DeliveryApiControllerBase.cs
#	src/Umbraco.Core/DependencyInjection/UmbracoBuilder.cs
#	src/Umbraco.Infrastructure/PropertyEditors/FileUploadPropertyValueEditor.cs
#	src/Umbraco.Infrastructure/PropertyEditors/ImageCropperPropertyValueEditor.cs
#	src/Umbraco.Web.BackOffice/Controllers/MediaController.cs
#	tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Packaging/PackageDataInstallationTests.cs
#	tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/LocalizationServiceTests.cs
2023-08-28 11:46:22 +02:00
Bjarke BergandGitHub b17a7689ab Fixed up the relation management api endpoints to use guids and paging (#14706)
* Fixed up the relation management api endpoints to use guids and paging

* Cleanup

* Updated OpenApi.json
2023-08-28 11:16:56 +02:00
f2d11e3095 Add content and media sorting to the Management API (#14712)
* Add content and media sorting to the Management API

* Rename "id" to "key" throughout the ContentEditingService

* Update Open API json file

* Use "key" instead of "id" in ContentEditingServiceBase

* Use "key" instead of "id" in IMediaEditingService and MediaEditingService

* Turn delegates into abstracts + fix bug that allowed deleting items outside of the recycle bin

* Use PUT instead of POST

* Update src/Umbraco.Core/Services/MediaEditingService.cs

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

* Update src/Umbraco.Core/Services/MediaEditingService.cs

Co-authored-by: Bjarke Berg <mail@bergmania.dk>

* Update Open API JSON

---------

Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2023-08-28 08:56:57 +02:00
Kenn JacobsenandGitHub a9d7f3cbbb Content type and media type container CRUD controllers and services (#14682)
* CRUD for content and media type folders + refactor data type folder CRUD controllers and services to match

* Correct response types + update OpenAPI JSON

* Review changes

* Review changes

* Update OpenAPI JSON after merge
2023-08-24 09:32:36 +02:00
Andreas ZerbstandGitHub 98bcf15373 Added missing scope (#14711) 2023-08-23 13:24:16 +02:00
Bjarke Berg 6f10517fc6 Merge remote-tracking branch 'origin/v13/dev' into v14/dev
# Conflicts:
#	build/azure-pipelines.yml
2023-08-21 08:05:22 +02:00
0096addcb9 Content and media type CRUD controllers and services (#14665)
* Add GetAsync method

* Fix up delete document type controller

* Add scope to delete async

* Add some scaffolding

* Add create model

* Start working on validation

* Move validation to its own service

* Use GetAllAsync instead of GetAsync

* Add initial composition support

Still need to figure out some kinks

* Validate compositions when creating

* Add initial folder support

* Initial handling of generic properties

* Add operation status responses

* Move create operation into service

* Add first test

* Fix issued shown by test

* Ensure a specific key can be specified when creating

* Rename container id to container key

Let's try and be consistent

* Create basic composition test

* Ensure new property groups are created with the correct key

* Add test showing property type issue

* Fix property types not using the expected key.

* Validate against model fetched from content type service

Just to make sure nothing explodes on the round trip

* Make helper for creating create models

* Add helper for creating container

* Make helper methods simpler to use

* Add test for compositions using compositions

* Add more composition tests

* Fix bug allowing element types to be composed by non element types

* Remove validators

This can just be a part of the editing service

* Minor cleanup

* Ensure that multiple levels of inheritance is possible

* Ensure doctype cannot be used as both composition and inheritance on the same doctype

* Ensure no duplicate aliases from composition and that compositions exists

* Minor cleanup

* Address todos

* Add SaveAsync method

* Renamed some models

* Rename from DocumentType to ContentType

* Clarify ParentKey as being container only + untangle things a tiny bit

* Clean out another TODO (less duplicate code) + more tests

* Refactor for reuse across different content types + add media type editing service + unit tests

* Refactor in preparation for update handling

* More tests + fixed bugs found while testing

* Simplify things a bit

* Content type update + a lot of unit tests + some refactor + fix bugs found while testing

* Begin building presentation factories for mapping view models to editing models

* Use async save

* Mapping factories and some clean-up

* Rename Key to Id (ParentKey to ParentId)

* Fix slight typo

* Use editing service in document type controllers and introduce media type controllers

* Validate containers and align container aliases with the current backoffice

* Remove ParentId from response

* Fix scope handling in DeleteAsync

* Refactor ContentTypeSort

* A little renaming for clarity + safeguard against changes to inheritance

* Persist allowed content types

* Fix bad merge + update controller response annotations

* Update OpenAPI JSON

* Update src/Umbraco.Cms.Api.Management/Controllers/DocumentType/DocumentTypeControllerBase.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Fix review comments

* Update usage of MapCreateAsync to ValidateAndMapForCreationAsync

---------

Co-authored-by: Nikolaj <nikolajlauridsen@protonmail.ch>
2023-08-17 12:28:16 +02:00
a1f6531453 V14: Consistently refer to user key (#14685)
* Fixup UserService

* Fixup PartialViewService

* Fixup ScriptService

* Fixup StylesheetService

* Use keys with usergroups instead of IDs

* Fix missed instances of performingUser

* Fixup DataTypeFolderControllerBase

---------

Co-authored-by: kjac <kja@umbraco.dk>
2023-08-17 08:35:48 +02:00
Bjarke Berg fb3ead87b8 Post merge fixes 2023-08-15 11:18:10 +02:00
Bjarke Berg 822d57135e Merge remote-tracking branch 'origin/v13/dev' into v14/dev
# Conflicts:
#	src/Umbraco.Cms.Persistence.EFCore/Composition/UmbracoEFCoreComposer.cs
#	src/Umbraco.Infrastructure/PropertyEditors/BlockEditorValues.cs
#	src/Umbraco.Web.UI.Docs/gulpfile.js
2023-08-15 11:14:00 +02:00
Jacob Overgaard 826ec6a94f update backoffice submodule 2023-08-11 15:38:23 +02:00
Jacob Overgaard f540fe59ed update backoffice submodule 2023-08-11 15:36:43 +02:00
Jacob Overgaard 6fcb67e319 bump to preview002 2023-08-09 10:21:13 +02:00
Jacob Overgaard 6ccf825c48 outcomment c# docs for now (they do not work with .NET 8) 2023-08-09 10:21:04 +02:00
Jacob Overgaard d1547ffe0b typo 2023-08-09 10:20:51 +02:00
Jacob Overgaard 9e9c299cf8 update backoffice preview002 2023-08-08 15:41:16 +02:00
Jacob Overgaard 7e25f1b55f update importmap 2023-08-08 15:37:46 +02:00
Bjarke Berg d9f528f3ae Post merge fixes 2023-08-08 12:19:29 +02:00
Bjarke Berg 2839131033 Merge remote-tracking branch 'origin/v13/dev' into v14/dev 2023-08-08 12:10:18 +02:00
Jacob Overgaard 9b26aec4c3 set default culture for backoffice 2023-08-08 09:54:54 +02:00
Jacob Overgaard 9274c3fad9 update backoffice submodule 2023-08-08 09:49:42 +02:00
Bjarke BergandGitHub 45033437a2 Updated all 404 and 500 responses to use problem details model (#14634)
* Updated all 404 and 500 responses to use problem details

* Updated OpenApi.json

* Add missing ProducesResponseType

* Updated OpenApi.json
2023-08-04 10:51:20 +02:00
Jacob Overgaard 7b78fe9ced update backoffice submodule 2023-08-02 17:04:02 +02:00
Bjarke Berg 254e471d9b post merge fixes 2023-08-02 10:27:39 +02:00
Bjarke Berg bd0f20f4e4 Merge remote-tracking branch 'origin/v13/dev' into v14/dev
# Conflicts:
#	src/Umbraco.Core/CompatibilitySuppressions.xml
#	src/Umbraco.Infrastructure/CompatibilitySuppressions.xml
#	src/Umbraco.Web.BackOffice/CompatibilitySuppressions.xml
#	src/Umbraco.Web.Common/CompatibilitySuppressions.xml
#	tests/Umbraco.Tests.Common/CompatibilitySuppressions.xml
#	tests/Umbraco.Tests.Integration/CompatibilitySuppressions.xml
2023-08-02 10:23:53 +02:00
Bjarke Berg 68475a97d6 Do not sign in user after install, like in v12 2023-07-31 14:02:48 +02:00
Bjarke Berg 42ffb3b7d8 Reimplement fix from v12 to allow newlines in invite email 2023-07-31 13:59:53 +02:00
Nikolaj Geisle ea3712fb96 Remove v10 fix, as it hopefully should not be relevant for 14 2023-07-25 11:56:46 +02:00
Nikolaj Geisle 2ecee0ca32 Merge branch 'v13/dev' into v14/dev 2023-07-25 11:44:03 +02:00
Jacob Overgaard 9e0344d85a update backoffice submodule 2023-07-24 10:45:34 +02:00
MoleandGitHub e1281afb71 Merge pull request #14589 from umbraco/v14/merge
V14/merge
2023-07-21 13:47:06 +02:00
nikolajlauridsen 7ed856ae8e Comment out richtext test
This should no longer be nececary in new backoffice
2023-07-21 12:21:56 +02:00
nikolajlauridsen 473c27213e Undo props changes 2023-07-21 11:38:15 +02:00
nikolajlauridsen 90598dce0b Re-add package validation skips 2023-07-21 11:28:35 +02:00
nikolajlauridsen a4c287f1e8 Try re-adding submodule 2023-07-21 11:14:52 +02:00
nikolajlauridsen 7753df40ce Merge v13/dev 2023-07-21 10:59:47 +02:00
Nikolaj GeisleandGitHub 963151a1c1 V14: Rename folder response model (#14576)
* Rename FolderResposneModel

* Update OpenApi.json
2023-07-19 13:54:17 +02:00
Elitsa MarinovskaandGitHub 036876f349 V14: Add authorization policies to new Backoffice API controllers - p1 (#14551)
* AuditLog policies

* DataType policies

* Dictionary policies

* Document controllers policies

* DocumentBlueprint controllers policies

* DocumentType controllers policies

* HealthCheck controllers policies

* Language controllers policies

* LogViewer controllers policies

* Media controllers policies

* MediaType controllers policies

* Member controllers policies

* MemberGroup controllers policies

* MemberType controllers policies

* ModelsBuilder controllers policies

* Package controllers policies

* PartialView controllers policies

* Profiling controllers policies

* PropertyType controllers policies

* RedirectUrlManagement controllers policies

* Relation controllers policies

* RelationType controllers policies

* Script controllers policies

* Stylesheet controllers policies

* Telemetry controllers policies

* Template controllers policies

* TrackedReference controllers policies

* Upgrade controllers policies

* User controllers policies

* UserGroup controllers policies

* Other controllers cleanup

* Moved CreatePolicies to its own Extensions class

* Added TreeAccessScripts and TreeAccessStylesheets policies

* Remove comments

* Forgotten "New" prefix

* Duplicate Auth Policy

* Removed comment since we are using reference tokens and this is no longer a problem

* Fix AdminUserEditsRequireAdmin auth policy to use a constant

* Revert change

* Revery UpgradeControllerBase attribute

* Removed AdminUserEditsRequireAdmin policy as it will be implemented later on

* Adding RequireAdminAccess policy for Upgrade controller

* Wrong claim type
2023-07-19 08:02:51 +02:00
Jacob Overgaard 33f926853b update backoffice submodule 2023-07-18 13:47:48 +02:00
MoleandGitHub d306a65bd4 V14: Fix pipelines (#14566)
* Try undoing inheritance change

Just to see if the issue stems from there

* Try specifying order again

* Log something

* Maybe it's a culture thing

* That wasn't it

* Maybe content deliver need to exist as an applicationPart

* Order found types

* Cleanup
2023-07-18 10:18:31 +02:00
b31c59d2a5 V14: refactor property editor aliases (#14536)
* Rename migrations folder to v14

* Add renaming migration

* Add missing namespace to migration in plan

* Rename Tiny to richtext

* Obsolete old TinyMce

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
Co-authored-by: Elitsa <elm@umbraco.dk>
2023-07-14 15:31:09 +03:00
nikolajlauridsen f533d923d8 Merge remote-tracking branch 'origin/v13/dev' into v14/dev
# Conflicts:
#	src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs
#	tests/Umbraco.Tests.AcceptanceTest/package-lock.json
#	tests/Umbraco.Tests.AcceptanceTest/package.json
#	tests/Umbraco.Tests.AcceptanceTest/playwright.config.ts
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/BlockGridEditor/Content/blockGridEditorAdvanced.spec.ts
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/BlockGridEditor/Content/blockGridEditorAreasContent.spec.ts
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/BlockGridEditor/Content/blockGridEditorContent.spec.ts
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/BlockGridEditor/Content/blockGridEditorRendering.spec.ts
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/BlockGridEditor/Content/blockGridEditorSettings.spec.ts
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/BlockListEditor/blockListEditorContent.spec.ts
#	version.json
2023-07-14 10:04:53 +02:00
e40f1839c4 V14: Refactor LogViewerService (#14511)
* Refactor GetPagedLogsAsync to not use ILogViewer

* Refactor GetPagedLogsAsync to not use ILogViewer

* Reorder using statements

* Introduce ILogViewerRepository

* Remove skip and take from repository

* Return IEnumerable instead of pagedModel

* Remove local GetLogs

* Return IEnumerable instead of pagedmodel

* Remove serilog entirely from ILogViewerService

* Move LogViewerService

* Inject LogViewerService as core service instead

* Implement LogViewerServiceTests.cs

* Add more happy path tests

* Add saved query tests

* Refactor private path fields  to normal variables in setup method

* Capitalize logs for Unix systems

* Added missing documentation

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
Co-authored-by: Elitsa <elm@umbraco.dk>
2023-07-10 15:36:20 +03:00
Jacob Overgaard 82f79cafe8 update backoffice submodule 2023-07-10 11:22:37 +02:00
MoleandGitHub 578ced2778 Enable inheritance after merge (#14512)
* Enable inheritance after merge

* Update OpenApi.json
2023-07-10 10:13:46 +02:00
Jacob Overgaard 11dd958a33 update backoffice submodule 2023-07-07 15:49:40 +02:00
Bjarke Berg 47d5ef88c4 Post merge fixes - Including temp workaround for .net8 efcore breaking change (Should be fixed again in preview 7) 2023-07-07 10:55:29 +02:00
Bjarke Berg d991285466 Merge remote-tracking branch 'origin/v13/dev' into v14/dev
# Conflicts:
#	Directory.Build.props
#	src/Umbraco.Web.BackOffice/Controllers/MediaController.cs
2023-07-07 08:56:17 +02:00
c7a38cdac4 V14: Public access controller (#14501)
* Implement GetEntryByContentKey

* Implement PublicAccessResponseModel

* Implement IPublicAccessPresentationFactory

* Rename MemberGroupItemReponseModel to MemberGroupItemResponseModel

* Refactor PublicAccessResponseModel to use Ids instead of entire content items

* Return attempt instead of PresentationModel

* Add missing statuses to PublicAccessOperationStatusResult

* Implement PublicAccessDocumentController.cs

* Refacotr PublicAccessResponseModel to use a base model

* Add CreatePublicAccessEntry method

* Refactor AccessRequestModel to use names not ids :(

* Rename ErrorPageNotFound to ErrorNodeNotFound

* Implement new SaveAsync method

* Introduce more OperationResults

* Implement PublicAccessEntrySlim

* Implement SaveAsync

* Remove CreatePublicAccessEntry from presentation factory

* Rename to CreateAsync

* Implement UpdateAsync

* Rename to async

* Implement CreatePublicAccessEntry

* Implement update endpoint

* remove PublicAccessEntrySlim mapping

* implement CreatePublicAccessEntrySlim method

* Refactor UpdateAsync

* Remove ContentId from request model as it should be in the request

* Use new service layer

* Amend method name in update controller

* Refactor create public access entry to use async method and return entity

* Refactor to use saveAsync method instead of synchronously

* Use presentation factory instead of mapping

* Implement deleteAsync endpoint

* Add produces response type

* Refactor mapping to not use UmbracoMapper, as that causes errors

* Update OpenApi.json

* Refactor out variables to intermediate object

* Validate that groups and names are not specified at the same time

* Make presentation factory not async

* Minor cleanup

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
Co-authored-by: Nikolaj <nikolajlauridsen@protonmail.ch>
2023-07-05 14:56:51 +02:00
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
59df7439db Verify user invite token (#14491)
* Added functionality to verify user invite tokens and create the initial password

* Add response types

* Fail ValidateCredentialsAsync when user is not approved

* Enable user as part of initial password creating using validation token

* Adds documentation to badrequest and changed nocontent to ok, to align with other APIs

* Fixed tests and added a new one

---------

Co-authored-by: nikolajlauridsen <nikolajlauridsen@protonmail.ch>
2023-07-05 12:42:52 +02:00
Jacob Overgaard 8bccab3b60 update backoffice submodule 2023-07-03 14:14:09 +02:00
Kenn JacobsenandGitHub 0496fba70b Fix EFCore.Sqlite and EFCore.SqlServer project load in solution file (#14480) 2023-06-29 18:36:29 +02:00
Jacob Overgaard 113b1ff216 update backoffice submodule 2023-06-29 14:12:52 +02:00
Elitsa MarinovskaandGitHub cdfae0ce0b V14: Skip and take updates (#14478)
* Adding default values to skip and take to align with the rest of the controllers

* Changing skip and take type from long to int to align with the rest

* Fixing wrong response type

* Remove double skip and take

* Update json file
2023-06-29 12:33:31 +02:00
d5a0dda89a V14: allowed children endpoints (#14434)
* Implement allowed children of root

* Allow children by key controller

* Update to be document controlller instead

* Fix AllowedChildrenOfRootDocumentController

* Create GetAllAsync method in ContentTypeServiceBaseOfTRepositoryTItemTService

* Revert "Create GetAllAsync method in ContentTypeServiceBaseOfTRepositoryTItemTService"

This reverts commit b01b5b9240.

* Implement attemp pattern in IContentTypeService

* Create IContentCreatingService

* Use new contentCreatingService in controller

* Revert if statement

* Use total from attempt

* Throw exceptions instead of returning attempt

* Wrap in scope

* Rename to GetAllowedChildrenContentTypesAsync

* Fix summary

* Removed unneccessary await Task.FromResult

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2023-06-29 09:38:05 +02:00
Andreas ZerbstandGitHub 85ad419cb7 Updated our API acceptance tests to use our updated testHelpers (#14476)
* Updated our dataType API tests to use our updated testHelpers

* Updated our dataTypeFolder API tests to use our updated testHelpers

* Updated our dictionary API tests to use our updated testHelpers

* Updated our language API tests to use our updated testHelpers

* Updated our partialView API tests to use our updated testHelpers

* Updated our partialViewFolder API tests to use our updated testHelpers

* Updated our script API tests to use our updated testHelpers

* Updated our scriptFolder API tests to use our updated testHelpers

* Updated our stylesheet API tests to use our updated testHelpers

* Updated our stylesheetFolder API tests to use our updated testHelpers

* Updated our telemetry API tests to use our updated testHelpers

* Updated our template API tests to use our updated testHelpers

* Updated our temporaryFile API tests to use our updated testHelpers

* Updated our user API tests to use our updated testHelpers

* Updated our userAvatar API tests to use our updated testHelpers

* Updated our userGroup API tests to use our updated testHelpers

* Fixed failing text

* Bumped to use the newest version of our testHelpers
2023-06-29 07:16:33 +02:00
ddca33337b v14: Rewrite static assets for the backoffice (#14472)
* add extension method to rewrite requests meant for backoffice static assets

* add backoffice rewrites to application builder

* embed the umbraco hash into the static assets requested on the backoffice

* Added a IStaticFileHostGenerator so its possible to replace our logic

* add docs and ensure the path is uniform with single slashes

---------

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2023-06-28 14:55:19 +02:00
7265d5c3be Use OpenIddict with real db instead of inmemory (#14465)
* Add OpenIddict tables to database (#14449)

* Added migrations to install EF Core OpenIddict tables

* Handle Install of ef core data (Needs to be outside of transaction

* Cleanup and renaming, as these things will be reused for more than openiddict in the future

* Cleanup

* Extract db context setup

* Minor cleanup

---------

Co-authored-by: Nikolaj <nikolajlauridsen@protonmail.ch>

* Use OpenIddict from DB instead of InMemoryDb

* Do not try to clean up, while not it run mode

* Fixed tests

* Clean up

---------

Co-authored-by: Nikolaj <nikolajlauridsen@protonmail.ch>
Co-authored-by: Elitsa <elm@umbraco.dk>
2023-06-28 09:40:28 +03:00
dfc7054720 V14: refactor GetPermissions to use attempt pattern (#14470)
* Refactor GetPermissions to take params

* Rework GetPermissionsAsync to attempt pattern

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-06-27 14:34:02 +02:00
Bjarke Berg 135a43f5a4 Add Microsoft.EntityFrameworkCore.Design to UI.New 2023-06-27 10:20:19 +02:00
Jacob Overgaard 44a3d86986 package-lock sync 2023-06-27 10:03:04 +02:00
Jacob Overgaard 8bb43a8eda Merge branch 'v13/dev' into v14/dev 2023-06-27 10:02:46 +02:00
Jacob Overgaard 2511be61cc package-lock sync 2023-06-27 10:01:45 +02:00
Bjarke Berg 4aa7001fbf Merge remote-tracking branch 'origin/v12/dev' into v14/dev
# Conflicts:
#	src/Umbraco.Core/Services/ContentService.cs
#	src/Umbraco.Infrastructure/CompatibilitySuppressions.xml
#	src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs
#	src/Umbraco.Web.BackOffice/Controllers/MediaController.cs
2023-06-27 09:50:37 +02:00
Andreas ZerbstandGitHub de235c224a Added missing scope (#14460) 2023-06-26 16:43:22 +02:00
Andreas ZerbstandGitHub 437db52e5e Added UI acceptance for the telemetry section (#14456)
* Added auth to gitignore

* Added a setup for logging in which allows us to save the token for the user

* Added simple acceptance test for testing our api for the DataTypes

* Added simple acceptance tests for testing the API for the PartialView section

* Added simple acceptance tests for testing the API for the Script section

* Added acceptance tests for testing the API for the Stylesheet section.

* Added acceptance tests for testing the API for the User section

* Bumped the version of our testhelpers!

* Added acceptance tests for testing the API for the Dictionary section.

* Added acceptance tests for testing the API for the Language section.

* Added acceptance tests for testing the API for the UserGroups section.

* Added acceptance tests for testing the API for the Template section

* Added acceptance tests for testing the API for the TemporaryFiles section

* Our first UI test for v14

Added acceptance tests for the telemetry section

* Removed page.pause
2023-06-26 15:05:50 +02:00
Andreas ZerbstandGitHub acf8f575a8 Added acceptance tests for testing the API for the UserGroups section. (#14448)
* Added auth to gitignore

* Added a setup for logging in which allows us to save the token for the user

* Added simple acceptance test for testing our api for the DataTypes

* Added simple acceptance tests for testing the API for the PartialView section

* Added simple acceptance tests for testing the API for the Script section

* Added acceptance tests for testing the API for the Stylesheet section.

* Added acceptance tests for testing the API for the User section

* Bumped the version of our testhelpers!

* Added acceptance tests for testing the API for the Dictionary section.

* Added acceptance tests for testing the API for the Language section.

* Added acceptance tests for testing the API for the UserGroups section.

* Added acceptance tests for testing the API for the Template section (#14450)

* Added acceptance tests for testing the API for the Template section

* Added acceptance tests for testing the API for the TemporaryFiles section (#14451)
2023-06-26 13:09:41 +02:00
Andreas ZerbstandGitHub ad419dd460 Added acceptance tests for testing the API for the Language section. (#14447)
* Added auth to gitignore

* Added a setup for logging in which allows us to save the token for the user

* Added simple acceptance test for testing our api for the DataTypes

* Added simple acceptance tests for testing the API for the PartialView section

* Added simple acceptance tests for testing the API for the Script section

* Added acceptance tests for testing the API for the Stylesheet section.

* Added acceptance tests for testing the API for the User section

* Bumped the version of our testhelpers!

* Added acceptance tests for testing the API for the Dictionary section.

* Added acceptance tests for testing the API for the Language section.
2023-06-26 12:23:01 +02:00
Andreas ZerbstandGitHub fbc8d453e3 Added acceptance tests for testing the API for the Dictionary section. (#14446)
* Added auth to gitignore

* Added a setup for logging in which allows us to save the token for the user

* Added simple acceptance test for testing our api for the DataTypes

* Added simple acceptance tests for testing the API for the PartialView section

* Added simple acceptance tests for testing the API for the Script section

* Added acceptance tests for testing the API for the Stylesheet section.

* Added acceptance tests for testing the API for the User section

* Bumped the version of our testhelpers!

* Added acceptance tests for testing the API for the Dictionary section.
2023-06-26 12:21:09 +02:00
Jacob Overgaard ca6f9ffadb Merge remote-tracking branch 'origin/v14/dev' into v14/dev 2023-06-26 10:19:46 +02:00
Jacob Overgaard 7a8c4af161 update backoffice submodule 2023-06-26 10:19:38 +02:00
Andreas ZerbstandGitHub b0b29f05af Added acceptance tests for testing the API for the Users section. (#14445)
* Added auth to gitignore

* Added a setup for logging in which allows us to save the token for the user

* Added simple acceptance test for testing our api for the DataTypes

* Added simple acceptance tests for testing the API for the PartialView section

* Added simple acceptance tests for testing the API for the Script section

* Added acceptance tests for testing the API for the Stylesheet section.

* Added acceptance tests for testing the API for the User section

* Bumped the version of our testhelpers!
2023-06-26 10:13:36 +02:00
Andreas ZerbstandGitHub 87a66c064f Added acceptance tests for testing the API for the Script section (#14441)
* Added auth to gitignore

* Added a setup for logging in which allows us to save the token for the user

* Added simple acceptance test for testing our api for the DataTypes

* Added simple acceptance tests for testing the API for the PartialView section

* Added simple acceptance tests for testing the API for the Script section

* Added acceptance tests for testing the API for the Stylesheet section. (#14442)
2023-06-23 12:00:16 +02:00
Andreas ZerbstandGitHub ea520cb851 Added acceptance tests for testing the API for the PartialView section (#14438)
* Added auth to gitignore

* Added a setup for logging in which allows us to save the token for the user

* Added simple acceptance test for testing our api for the DataTypes

* Added simple acceptance tests for testing the API for the PartialView section
2023-06-23 11:09:47 +02:00
Andreas ZerbstandGitHub 893e00f100 Added acceptance test for testing our api for the DataTypes section (#14437)
* Added auth to gitignore

* Added a setup for logging in which allows us to save the token for the user

* Added simple acceptance test for testing our api for the DataTypes
2023-06-23 10:32:17 +02:00
Andreas ZerbstandGitHub 1d215aa1b1 V14/qa/new acceptance tests (#14435)
* Added auth to gitignore

* Added a setup for logging in which allows us to save the token for the user
2023-06-23 08:56:30 +02:00
Bjarke Berg 1149cddc09 Update openAPI 2023-06-22 12:46:25 +02:00
Bjarke Berg 053f2e6dff Merge remote-tracking branch 'origin/v12/dev' into v14/dev 2023-06-22 11:37:44 +02:00
Bjarke Berg b7df9f2357 Post merge, add missing swagger UI options 2023-06-22 11:28:22 +02:00
Bjarke Berg 4f93542909 Updated OpenApi.json 2023-06-21 10:18:36 +02:00
Bjarke Berg 37d8513b42 Remove wrong obsolete message that have been merged up 2023-06-21 09:14:55 +02:00
Bjarke Berg 2ed2fc3533 Added TrustServerCertificate to install apis 2023-06-21 09:12:00 +02:00
Bjarke Berg 22b2f79d15 Merge remote-tracking branch 'origin/v12/dev' into v14/dev
# Conflicts:
#	src/Umbraco.Cms.Api.Common/DependencyInjection/UmbracoBuilderApiExtensions.cs
#	src/Umbraco.Core/CompatibilitySuppressions.xml
#	src/Umbraco.Infrastructure/CompatibilitySuppressions.xml
#	src/Umbraco.Web.Common/Profiler/WebProfiler.cs
2023-06-21 09:06:42 +02:00
Bjarke Berg 7a4a4f60c4 Merge remote-tracking branch 'origin/release/14.0' into v14/dev 2023-06-21 09:05:31 +02:00
Jacob Overgaard 95f7cdd418 add dependency on 'Build' stage to get output parameter 2023-06-20 13:56:45 +02:00
dependabot[bot]andJacob Overgaard 8d6d933600 Bump socket.io-parser from 4.2.1 to 4.2.4 in /src/Umbraco.Web.UI.Client
Bumps [socket.io-parser](https://github.com/socketio/socket.io-parser) from 4.2.1 to 4.2.4.
- [Release notes](https://github.com/socketio/socket.io-parser/releases)
- [Changelog](https://github.com/socketio/socket.io-parser/blob/main/CHANGELOG.md)
- [Commits](https://github.com/socketio/socket.io-parser/compare/4.2.1...4.2.4)

---
updated-dependencies:
- dependency-name: socket.io-parser
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-20 13:30:43 +02:00
dependabot[bot]andJacob Overgaard 0fa42a10b5 Bump socket.io-parser from 4.2.1 to 4.2.4 in /src/Umbraco.Web.UI.Client
Bumps [socket.io-parser](https://github.com/socketio/socket.io-parser) from 4.2.1 to 4.2.4.
- [Release notes](https://github.com/socketio/socket.io-parser/releases)
- [Changelog](https://github.com/socketio/socket.io-parser/blob/main/CHANGELOG.md)
- [Commits](https://github.com/socketio/socket.io-parser/compare/4.2.1...4.2.4)

---
updated-dependencies:
- dependency-name: socket.io-parser
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-20 13:30:31 +02:00
dependabot[bot]andJacob Overgaard 8622344b96 Bump fast-xml-parser and is-svg in /src/Umbraco.Web.UI.Client
Bumps [fast-xml-parser](https://github.com/NaturalIntelligence/fast-xml-parser) and [is-svg](https://github.com/sindresorhus/is-svg). These dependencies needed to be updated together.

Updates `fast-xml-parser` from 3.20.3 to 4.2.4
- [Release notes](https://github.com/NaturalIntelligence/fast-xml-parser/releases)
- [Changelog](https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/NaturalIntelligence/fast-xml-parser/commits)

Updates `is-svg` from 4.3.1 to 4.4.0
- [Release notes](https://github.com/sindresorhus/is-svg/releases)
- [Commits](https://github.com/sindresorhus/is-svg/compare/v4.3.1...v4.4.0)

---
updated-dependencies:
- dependency-name: fast-xml-parser
  dependency-type: indirect
- dependency-name: is-svg
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-20 13:24:20 +02:00
dependabot[bot]andJacob Overgaard c665ab453d Bump fast-xml-parser and is-svg in /src/Umbraco.Web.UI.Client
Bumps [fast-xml-parser](https://github.com/NaturalIntelligence/fast-xml-parser) and [is-svg](https://github.com/sindresorhus/is-svg). These dependencies needed to be updated together.

Updates `fast-xml-parser` from 3.20.3 to 4.2.4
- [Release notes](https://github.com/NaturalIntelligence/fast-xml-parser/releases)
- [Changelog](https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/NaturalIntelligence/fast-xml-parser/commits)

Updates `is-svg` from 4.3.1 to 4.4.0
- [Release notes](https://github.com/sindresorhus/is-svg/releases)
- [Commits](https://github.com/sindresorhus/is-svg/compare/v4.3.1...v4.4.0)

---
updated-dependencies:
- dependency-name: fast-xml-parser
  dependency-type: indirect
- dependency-name: is-svg
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-20 13:24:13 +02:00
Jacob Overgaard b4ab76c2a8 update backoffice submodule 2023-06-20 13:17:26 +02:00
Jacob Overgaard 2cb1d31375 Merge branch 'v14/dev' of https://github.com/umbraco/Umbraco-CMS into v14/dev 2023-06-20 11:02:41 +02:00
Jacob Overgaard 645345a51b v11: Backoffice JS Updates (#14407)
* update @umbraco-ui/uui to 1.3.0

* update @microsoft/signalr to 7.0.7

* update ace editor to 1.22.1

* update jQuery to 3.7.0

* update nouislider to 15.7.1

* update tinymce to 6.5.1

* update spectrum-colorpicker2 to 2.0.10

* update build dependencies
2023-06-20 11:02:32 +02:00
Jacob Overgaard 43fb128292 v11: Backoffice JS Updates (#14407)
* update @umbraco-ui/uui to 1.3.0

* update @microsoft/signalr to 7.0.7

* update ace editor to 1.22.1

* update jQuery to 3.7.0

* update nouislider to 15.7.1

* update tinymce to 6.5.1

* update spectrum-colorpicker2 to 2.0.10

* update build dependencies
2023-06-20 11:02:20 +02:00
MoleandGitHub dd90ef2d81 Update OpenApi.json (#14417) 2023-06-20 10:23:41 +02:00
Jacob OvergaardandGitHub 5900f5bede v14: update package templates with new umbraco-package.json format (#14412)
* update package templates with new umbraco-package.json format

* remove $schema for now because we dont know where people will locate this file (refer to documentation)
2023-06-19 15:29:27 +02:00
Jacob Overgaard a463415b47 update backoffice submodule 2023-06-19 14:47:32 +02:00
Jacob Overgaard c512039083 upload api docs after myget release 2023-06-13 12:52:16 +02:00
Jacob Overgaard 3ed89c9a6d Merge branch 'v14/dev' into release/14.0 2023-06-13 12:50:14 +02:00
Jacob Overgaard 2c3c86a55d update backoffice submodule 2023-06-13 12:49:45 +02:00
Jacob Overgaard 0fcb2890aa Merge remote-tracking branch 'origin/v14/dev' into release/14.0 2023-06-12 14:20:51 +02:00
Jacob Overgaard d9c1de928b update backoffice submodule 2023-06-12 14:17:06 +02:00
Jacob OvergaardandGitHub da0ad33818 V14: frontend ui docs (#14374)
* update script to compile frontend api docs

* update backoffice submodule

* set the base path for the ui docs

* update env syntax

* remove Umbraco.Web.UI.Docs

* replace BASE_PATH in assets

* Make Upload API step able to run without releasing on nuget

* add dependOn Build to get major version number
2023-06-12 14:12:02 +02:00
Bjarke Berg 520309e3f8 Merge remote-tracking branch 'origin/v12/dev' into v14/dev
# Conflicts:
#	src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs
#	src/Umbraco.Infrastructure/Persistence/Repositories/Implement/UserRepository.cs
#	src/Umbraco.Web.BackOffice/Controllers/MediaController.cs
#	src/Umbraco.Web.BackOffice/Filters/FileUploadCleanupFilterAttribute.cs
2023-06-12 10:10:08 +02:00
Jacob Overgaard 1e95437a0a update backoffice submodule 2023-06-09 11:18:38 +02:00
MoleandGitHub 64c7c6b439 Fetch GUID directly and make it non async (#14358) 2023-06-08 14:49:52 +02:00
MoleandGitHub 040bf2c1e3 Replace use of SortedSet with HashSets and ISets (#14353) 2023-06-08 10:30:23 +02:00
Bjarke Berg 9a8edbabb3 Merge remote-tracking branch 'origin/v12/dev' into v14/dev 2023-06-08 10:12:10 +02:00
Bjarke Berg 63b1865053 Merge remote-tracking branch 'origin/release/14.0' into v14/dev 2023-06-08 10:12:02 +02:00
Bjarke Berg c84a3e2fe4 Merge remote-tracking branch 'origin/v12/dev' into release/14.0
# Conflicts:
#	src/Umbraco.Core/Manifest/PackageManifest.cs
#	src/Umbraco.Core/Telemetry/TelemetryService.cs
#	src/Umbraco.Infrastructure/Manifest/LegacyManifestParser.cs
#	src/Umbraco.Infrastructure/Migrations/Upgrade/V_12_0_0/ResetCache.cs
#	src/Umbraco.Infrastructure/Persistence/Repositories/Implement/CreatedPackageSchemaRepository.cs
#	src/Umbraco.Infrastructure/Services/Implement/PackagingService.cs
#	tests/Umbraco.Tests.UnitTests/Umbraco.Core/Telemetry/TelemetryServiceTests.cs
2023-06-08 10:07:29 +02:00
MoleandGitHub fdf5beb22a Add get ByEditorUiAlias datatype item endpoint (#14352) 2023-06-08 09:04:48 +02:00
Bjarke Berg 498eb083dd Updated version number 2023-06-07 16:12:47 +02:00
Niels LyngsøandGitHub fe714805bb Add location header for CORS requests (#14349) 2023-06-07 10:15:16 +02:00
MoleandGitHub 582b784ffe V14: Update template controllers (#14326)
* Add alias to document item response

* Add master template key to detailed model

* Add mater template key as optiona parameter to Scaffolding

* Check for duplicate alias when creating templates directly

* Clean

* Ensure integration tests creates templates with unique aliases

* Perform mapping in presentation factory
2023-06-06 13:45:39 +02:00
Jacob Overgaard 9947d4a15a update backoffice submodule 2023-06-06 10:44:18 +02:00
Kenn JacobsenandGitHub fe0cbc50c8 Temporary CRUD API for content types (#14334)
* Add temporary controllers for document type CRUD

* Update OpenAPI json

* Review comments

* Add comment for future refactoring
2023-06-06 09:32:02 +02:00
4180170acf Get current user endpoint in management api (#14336)
* Add current user data endpoint

* Add Change password endpoint

* Add SetAvatar

* Add get node permissions

* Add endpoint for getting currently logged in users linked logins

* Add tour service

* Add get tours

* Add set tour endpoint

* Added PermissionNames to IReadOnlyUserGroup

* Only require backend auth on management api

* Use ISet in response model

* Fixed issue with saving null as startMediaId, where it was ignored

* Add get current user endpoint

* Fix missing linebreak

* Append "New" keyword to policies

* Update OpenApi

---------

Co-authored-by: Nikolaj <nikolajlauridsen@protonmail.ch>
2023-06-05 15:20:18 +02:00
MoleandGitHub 0ad0179cd6 V14: Current user controller (#14323)
* Add current user data endpoint

* Add Change password endpoint

* Add SetAvatar

* Add get node permissions

* Add endpoint for getting currently logged in users linked logins

* Add tour service

* Add get tours

* Add set tour endpoint

* Split permissions endpoint in two, one for media and one for document
2023-06-05 08:42:29 +02:00
Jacob Overgaard 4a07f9a839 update backoffice submodule 2023-06-02 12:08:34 +02:00
Jacob Overgaard ef0e085c74 add login build to azure 2023-06-02 11:46:47 +02:00
Jacob Overgaard 6c731ca4ec update backoffice submodule 2023-06-02 11:23:01 +02:00
Jacob Overgaard 1e76ace11a add asp-append-version to static assets for backoffice 2023-06-01 11:29:10 +02:00
Jacob Overgaard 7839e14163 update backoffice submodule 2023-06-01 08:52:01 +02:00
Jacob OvergaardandGitHub 43ffeb673b v14: login app (#14318)
* ignore output files

* add new umb-login element

* allow to build and clean 'login' assets

* remove unused AuthUrl since this is now coded into the frontend code for each context

* ensure the ReturnUrl has a fallback to the default installation directory, since if you accidentally hit the login page and login, nothing happens if there is no return url

* switch to DependsOnTargets to account for if this is the only target being run (we need node_modules installed)

* add UmbracoUrl property

* add taghelper to use asp-append-version on login static assets
2023-06-01 08:50:21 +02:00
Jacob OvergaardandGitHub 33cb74dff1 V14: umbraco-package.json schema (#14319)
* copy umbraco-package-schema.json over from the New.Client build

* when a project referencing Cms.Targets is  building, we want to copy out the umbraco-package-schema.json file to the project directory if it does not exist

* ignore built output files

* fix typo

* add PackageReference to Umbraco.Cms.Targets to ensure dependent json schema files are copied over

* add to gitignore

* add target to remove the _UmbracoCmsPackageSchemaReference on clean

* Revert "add PackageReference to Umbraco.Cms.Targets to ensure dependent json schema files are copied over"

This reverts commit 339043a36f.

* generate umbraco-package-schema.json on demand in Cms.Targets

* add generated file to .gitignore
2023-05-31 19:12:00 +02:00
Jacob Overgaard cdd3adfd3c update backoffice submodule 2023-05-31 14:41:23 +02:00
Bjarke Berg dbfedf31bd Merge remote-tracking branch 'origin/v12/dev' into v14/dev 2023-05-31 09:46:59 +02:00
Jacob Overgaard 61c4aac0c9 update backoffice submodule 2023-05-30 16:10:56 +02:00
Jacob Overgaard 917b227294 update backoffice submodule 2023-05-30 14:13:23 +02:00
MoleandGitHub 138148481d V14: Add information to tree items (#14301)
* Add variant information to the document tree model

* Add content type key to document tree and item

* Add sort order to PropertyTypeResponseModelBase
2023-05-30 11:00:22 +02:00
Jacob Overgaard 3c3ab83411 update backoffice submodule 2023-05-26 16:10:36 +02:00
Jacob Overgaard 2d7a62eac5 update backoffice submodule 2023-05-26 11:22:59 +02:00
Bjarke Berg b9c0e18fb1 Merge remote-tracking branch 'origin/v12/dev' into v14/dev
# Conflicts:
#	src/Umbraco.Cms.Api.Delivery/Services/ApiContentQueryService.cs
#	src/Umbraco.Core/CompatibilitySuppressions.xml
#	src/Umbraco.Core/DeliveryApi/IApiContentQueryProvider.cs
#	src/Umbraco.Core/DeliveryApi/IApiContentQueryService.cs
#	src/Umbraco.Core/DeliveryApi/NoopApiContentQueryService.cs
2023-05-25 14:51:28 +02:00
Bjarke Berg 32b3b3b4a0 Updated version number 2023-05-25 13:35:11 +02:00
Bjarke Berg e04bb9d18d Fix tests by updating OpenApi.json 2023-05-25 12:34:26 +02:00
Jacob Overgaard b245f319d9 update backoffice submodule 2023-05-25 11:20:16 +02:00
Bjarke Berg 803e1be7dd Add PKCE to swagger.. Missing after refactor 2023-05-25 11:04:02 +02:00
Bjarke Berg b5ed4ea43a Rename the security definition as this is only for users.. 2023-05-25 11:03:56 +02:00
Bjarke BergandGitHub 28712bd5cd Make new backoffice packable (#14286)
* This moves around files and deletes the temp projects with files that are not moved to Core, Infrastructure etc.

Also moves the from new backoffice to static access, and override those with the old views in the legacy executeable

* Removes old files from the new executeable.

* Added missing files

* Added EF Core project to solution file

* fix build
2023-05-25 10:38:44 +02:00
714cf374f0 Management API: Property editor temporary file handling (#14244)
* Use new temporary files handling for property editors

* Add compat suppressions

* Add missing compat suppressions

* Don't discard valid file upload values

* Rename cuid and puid to contentKey and propertyTypeKey

* Update src/Umbraco.Infrastructure/PropertyEditors/MediaPicker3PropertyEditor.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Fetch user async + remove unnecessary dependency

---------

Co-authored-by: nikolajlauridsen <nikolajlauridsen@protonmail.ch>
2023-05-24 12:31:19 +02:00
Jacob Overgaard fc0e2cbf00 update backoffice submodule 2023-05-23 13:08:56 +02:00
Bjarke Berg b4e7d55e4d Align versions 2023-05-23 12:29:56 +02:00
Bjarke Berg 8f5f7f72fa Merge remote-tracking branch 'origin/v12/dev' into v13/dev
# Conflicts:
#	version.json
2023-05-23 12:23:27 +02:00
Jacob Overgaard 38aacfc30a update backoffice submodule 2023-05-22 13:27:56 +02:00
Jacob Overgaard c5f1af8adc update backoffice submodule 2023-05-17 11:11:37 +02:00
Andreas ZerbstandGitHub ac0f76f162 Changed so we are checking if the FolderExits (#14196) 2023-05-15 09:05:22 +02:00
Bjarke Berg f2def5307c Fix build 2023-05-15 09:02:53 +02:00
Bjarke Berg 979e023d73 Merge remote-tracking branch 'origin/v12/dev' into v13/dev
# Conflicts:
#	src/Umbraco.Infrastructure/CompatibilitySuppressions.xml
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/BlockGridEditor/Content/blockGridEditorAdvanced.spec.ts
2023-05-15 08:51:50 +02:00
Bjarke Berg ebbd3f0e51 Compatibility files 2023-05-12 12:33:03 +02:00
Bjarke Berg 2922c1fc92 Merge remote-tracking branch 'origin/v12/dev' into v13/dev
# Conflicts:
#	src/Umbraco.Cms.Api.Common/DependencyInjection/UmbracoBuilderApiExtensions.cs
#	src/Umbraco.Cms.Api.Delivery/Controllers/DeliveryApiControllerBase.cs
#	src/Umbraco.Core/CompatibilitySuppressions.xml
#	src/Umbraco.Web.Common/Configuration/ConfigureApiVersioningOptions.cs
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Tabs/tabs.spec.ts
2023-05-12 11:42:15 +02:00
Jacob Overgaard efe03d328a update backoffice submodule 2023-05-11 10:00:10 +02:00
MoleandGitHub f615e7bcfc Only consider alias duplicate if the key matches (#14169) 2023-05-09 10:46:31 +02:00
Bjarke Berg 0391c1d0c7 Merge remote-tracking branch 'origin/v13/dev' into v13/dev
# Conflicts:
#	src/Umbraco.Cms.Api.Common/Configuration/ConfigureApiExplorerOptions.cs
2023-05-09 09:21:36 +02:00
Bjarke Berg 5dd945f372 Reintroduced management api after v12 merge 2023-05-09 09:21:16 +02:00
Bjarke BergandGitHub 417e92dad0 Updated API version package and moved attribute to each controller (#14209)
* Updated API version package and moved attribute to each controller as it cannot be inherited.

* Ignore "$type" on types implementing interfaces in the delivery api
2023-05-09 08:38:07 +02:00
Bjarke Berg 6ce895e9ac Cherry picked removal of management api and rolled back. 2023-05-08 17:44:44 +02:00
Bjarke Berg 839999e76f Ensure no management api for v12 (#14197)
* Remove management api

* Remove actual files

And rolled both back again
2023-05-08 17:42:43 +02:00
Jacob Overgaard 25df33b9c1 update backoffice submodule 2023-05-08 15:58:00 +02:00
Jacob Overgaard 6bab6e8a0d update backoffice submodule 2023-05-08 09:42:44 +02:00
MoleandGitHub a5744c50ae Merge pull request #14206 from umbraco/v13/bugfix/rename_usergroup_controller
New Backoffice: Rename UserGroup Controllers
2023-05-04 11:22:47 +02:00
Nikolaj 0a64ac5485 Update OpenApi 2023-05-04 10:42:00 +02:00
Nikolaj f71a4fa968 Rename SaveUserGroupRequestModel to CreateUserGroupRequestModel 2023-05-04 10:09:39 +02:00
Nikolaj abdfcf4e14 Rename UserGroupPresentationModel to UserGroupResponseModel 2023-05-04 10:02:07 +02:00
Jacob Overgaard d6aa10cc55 update backoffice submodule 2023-05-02 10:41:41 +02:00
Jacob Overgaard cced44a72f update backoffice submodule 2023-04-28 10:23:22 +02:00
b411452f79 New backoffice: Add new codefile controllers and services (#14157)
* Add scaffolding

* Entities not Entitys

* Remove unececary obsoleted constructor

* Implement create script

* Return a simplified ScriptFile instead of IScript

That file abstraction seems way too bloated, containing a lot of stuff that's not relevant for files, such as IDs and keys.

* Use IScript instead of custom return model

* Add validation when creating script

* Add Get script endpoint

* Add response types

* Add Delete

* Throw if user key not found

* Remove unused maapper

* Add update endpoint

* Add Get by path

* Add create folder endpoint

* Don't pass performingUserId to folder creation

* Remove update folder

* Add delete folder endpoint

* Use specific ScriptFolderOperationStatus instead of ScriptOperationStatus

* Add OperationStatusResult

* Check folder for invalid name

* Check name for invalid characters

* Add partial view snippet endpoint

* Start working on CreatePartialView

* Add create partial view endpoint

* Retrieve key from audit method

* Add operation status results

* Add Get endpoint

* Return 201 when creating

* Add update partial view endpoint

* Add delete endpoint

* Add response types

* Add folder base implementation

* Add folder endpoints

* User property for allowed file extensions

* Rename async method to async

* Break snippet into endpoint in two

* Make content non-nullable

* Remove IService

* Add get by path

* Add viewmodels

* Add create and update models

* Add create stylesheet

* Add update endpoint

* Rename StylesheetControllerBase to StylesheetControllerBase

* Add stylesheet delete

* Rename controller bases

* Add stylesheet folders

* Add status results

* Add response types to folders

* Add richtext rules endpoints

* Add Get all endpoint

* Add get rules by path endpoint

* Aling validates so they're not async

These are private methods, so there's no reason to make them preemptively async

* Add template obsoletions to interface

* Add stream methods

This is evidently used by deploy 🤷

* Obsolete stylesheet operations

* Add get and getall across all services

* Obsolete script operations

* Obsolete old partial view methods

* Add some method docs

* Add compatibility suppression

* Update OpenApi.json

* Rename action

* formatting

* Fix import

* add expression body

* Invert if

* Move base on own line

* Rename file

* Rename to all

* Change to stylesheet instead of script

* Add Umbraco.Code.MapAll to map definitions

* Add comment about auditing

* use publish cancelable async

* use expression body

* formatting

* fix to use pattern matching

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-04-26 13:47:47 +02:00
Jacob Overgaard 17fef47450 backoffice submodule update 2023-04-26 08:07:06 +02:00
Jacob Overgaard 2ce9e338dc update backoffice submodule 2023-04-25 16:23:20 +02:00
Bjarke Berg bde0714b34 Merge remote-tracking branch 'origin/v12/dev' into v13/dev
# Conflicts:
#	src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/BlockGridEditor/Document/BlockGridEditorInDocument.spec.ts
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/BlockListEditor/blockListEditorContent.spec.ts
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Languages/languages.spec.ts
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Media/mediaFiles.spec.ts
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Media/mediaSection.spec.ts
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/ModelsBuilder/modelsbuilder.spec.ts
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/partialViews.spec.ts
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Tour/tours.spec.ts
2023-04-25 15:46:10 +02:00
Kenn JacobsenandGitHub d98f635eed Fix DataValueEditor configuration handling + update naming to be more explicit (#14104) 2023-04-25 15:32:29 +02:00
MoleandGitHub d96346313e Return created from invite (#14158) 2023-04-25 14:19:31 +02:00
MoleandGitHub dfa7eff7c2 New backoffice: Fix typo on user model (#14154)
* LastLockoutDate not LastlockoutDate

* Update open api
2023-04-25 10:58:38 +02:00
Kenn JacobsenandGitHub 57377a8f7a Make Block Grid and Block List use System.Text.Json instead of Json.NET (#14125)
* Make block grid and block list use System.Text.Json instead of Json.NET

* Add compat suppressions

* Move block editor models to Core
2023-04-25 10:48:48 +02:00
MoleandGitHub 2e23c81677 New backoffice: Updated missed controller paths (#14130)
* Updated missed controller paths

* Update openapi
2023-04-24 15:22:42 +02:00
f3df3e600f Only add non default version to operation id (#14146)
* Only add version to operationId when the version is not the default version

* Updated OpenApi.json

* A little code formatting

* Update OpenAPI JSON so the tests pass

---------

Co-authored-by: kjac <kja@umbraco.dk>
2023-04-24 14:15:36 +02:00
Jacob Overgaard db70750bba add picker-input importmap 2023-04-20 14:39:24 +02:00
38947e0870 Added functionality to split det swagger doc into multiple definitions (#14126)
* Added functionality to split det swagger doc into multiple definitions. Most (maybe too much) is still shared between the apis.

* Fixed issue with duplicate operation ids when we have multiple versions of an endpoint

* use strong types instead of var

* Updated OpenApi.json

* Formatting

* formatting

* Delete old files that is not implemented in api.common

* Updated openAPi after merge

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-04-20 12:38:31 +02:00
518bb60a45 New backoffice: Use singular name for user and user group controllers (#14121)
* Rename UsersController to UserController

* Rename namespace to User

* Rename UserGroupsControllerBase to UserGroupControllerBase

* Rename namespace to UserGroup

* New backoffice: User and member item endpoints (#14079)

* Implement ByKeys in MemberService

* Implement member item endpoint

* Add routing to static file item controller

* Implement user item endpoint

* Implement user group item endpoint

* return proper response model

* update OpenApi.json

* Add CompatibilitySuppressions

* Cleanup

* Update OpenApi

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
Co-authored-by: Elitsa <elm@umbraco.dk>

* Make user-group item endpoint singular

* Make user item endpoint singular

* Renamer user and user group folders

* Move from Users namespace to user

* Move from UserGroups namespace to UserGroup

* Update OpenApi.json

* Fix namespace after merge

* Move user item endpoint to singular namespace

* Move user group item endpoint to singular namespace

* Fix open api schema

---------

Co-authored-by: Nikolaj Geisle <70372949+zeegaan@users.noreply.github.com>
Co-authored-by: Zeegaan <nge@umbraco.dk>
Co-authored-by: Elitsa <elm@umbraco.dk>
2023-04-20 09:40:48 +02:00
Andreas ZerbstandGitHub b43d3ff98e Updated so it now shows the parentId instead of null (#14123) 2023-04-20 09:11:35 +02:00
7b62fb282f Dedicated cookie setup for new backoffice login (#14122)
* Add a dedicated (temporary) cookie setup for new backoffice logins, so old and new backoffice can co-exist behind separate logins

* use temp management api login endpoint for authentication

* Update OpenAPI JSON

---------

Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>
2023-04-19 13:32:11 +02:00
Bjarke Berg fff393c9ed Merge remote-tracking branch 'origin/v12/dev' into v13/dev
# Conflicts:
#	src/Umbraco.Cms.Api.Management/ManagementApiComposer.cs
#	src/Umbraco.Core/CompatibilitySuppressions.xml
#	src/Umbraco.Infrastructure/CompatibilitySuppressions.xml
2023-04-19 11:42:01 +02:00
cb682e2f3e New backoffice: User and member item endpoints (#14079)
* Implement ByKeys in MemberService

* Implement member item endpoint

* Add routing to static file item controller

* Implement user item endpoint

* Implement user group item endpoint

* return proper response model

* update OpenApi.json

* Add CompatibilitySuppressions

* Cleanup

* Update OpenApi

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
Co-authored-by: Elitsa <elm@umbraco.dk>
2023-04-19 09:43:01 +02:00
MoleandGitHub cbb8f62457 Fix iso code validator (#14107) 2023-04-17 15:23:34 +02:00
861b883d29 Throw from IUserIdKeyResolver if id/key not found. (#14101)
* Throw from IUserIdKeyResolver if id/key not found. This is too critical to not throw.

* Fixed tests

* Explicitly test that we can resolve super user key/ID from their counterparts

---------

Co-authored-by: kjac <kja@umbraco.dk>
2023-04-14 12:03:25 +02:00
Bjarke Berg d625fee1ad Merge remote-tracking branch 'origin/v12/dev' into v13/dev
# Conflicts:
#	src/Umbraco.Infrastructure/CompatibilitySuppressions.xml
#	src/Umbraco.Infrastructure/Migrations/MigrationPlanExecutor.cs
#	src/Umbraco.Infrastructure/Migrations/UnscopedMigrationBase.cs
#	tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Migrations/MigrationPlanTests.cs
remove double request to get init status
2023-04-14 10:35:30 +02:00
c2af43d9d9 Copy and move API for content and media (#14040)
* Copy and Move API for Content and Media

* Update OpenAPI JSON schema

* Update OpenApi JSON file after merge

* Rename key to id

---------

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2023-04-14 09:44:52 +02:00
Jacob Overgaard a188844a68 Merge remote-tracking branch 'origin/v13/dev' into v13/dev 2023-04-13 15:52:17 +02:00
Jacob Overgaard d01c95b3d5 simplify return url 2023-04-13 15:52:10 +02:00
Jacob Overgaard b8813aed3d set the path of the login page to /<backofficeurl>/login 2023-04-13 15:51:56 +02:00
Jacob Overgaard 5b94b3051f update temp login page to handle a POST to the authentication url and handle the returnUrl 2023-04-13 15:51:19 +02:00
f26e5d12a0 Management API: Data type or property is used endpoints (#14078)
* Added is-used endpoints

* Updated CompatibilitySuppressions.xml

* Minor cleanup

* Fix issue where only document types was supported. Now also media and member types is supported

* CompatibilitySuppressions.xml

---------

Co-authored-by: Nikolaj <nikolajlauridsen@protonmail.ch>
2023-04-13 14:58:16 +02:00
Jacob Overgaard 7be31a5305 update backoffice submodule 2023-04-13 11:23:10 +02:00
Jacob Overgaard a7c082e522 ignore umbraco-package-schema.json 2023-04-12 14:43:46 +02:00
MoleandGitHub f32dcb0823 V13: Ensure Predictable User-Group Keys (#14075)
* Add user group keys to constants

* Update migration to assign the right keys

* Update DataCreator

* Fix FIXME with removing ExcludedUserGroupAliases

* Obsolete group aliases
2023-04-12 11:22:50 +02:00
0f1e7f64ff New backoffice: Tag controller (#14072)
* Implement ByQueryEndpoint

* Implement new async methods on tag service

* dont have nullable query

* Formatting

* Add default implementation to interface

* Allow nullable query in api

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
Co-authored-by: Nikolaj <nikolajlauridsen@protonmail.ch>
2023-04-12 09:39:02 +02:00
Jacob Overgaard 507102348d update backoffice submodule 2023-04-12 09:20:42 +02:00
Andreas ZerbstandGitHub bd0fd4237b Removed the acceptance tests from v13 (#14073)
* Removed the acceptance tests from v13

* commented out the pipeline for e2e tests because there are no test left
2023-04-11 15:34:59 +02:00
Bjarke Berg b6c16afeea Fix OpenApi.json 2023-04-05 13:45:51 +02:00
Bjarke Berg b34b1906de Rename key to id 2023-04-05 13:43:54 +02:00
Jacob Overgaard ee1cac68e8 Merge remote-tracking branch 'origin/v13/dev' into v13/dev 2023-04-05 13:18:03 +02:00
Jacob Overgaard 4ead24edc9 add importmap to installer 2023-04-05 13:17:14 +02:00
9fadb3a926 V13: Entity viewports (#14050)
* Add language entity

* Refactor LanguageEntities

* Rename ItemsLanguageController.cs to ItemsLanguageEntityController.cs

* Change route to match old pattern

* Implement datatype item endpoint

* Rename controllers to item instead of entity

* Implement dictionary item endpoint

* Add DocumentItemControllerBase.cs

* Implement ItemDocumentItemController.cs

* Implement documnent-type controller

* Implement media type controller

* Move to item folder

* Implement MemberGroupItem viewport

* Implement member type item viewport

* Implement partial view viewport

* Implement partial view viewport

* Implement Relation type viewport

* Implement script items endpoint

* Refactor FileItemPresentationModelFactory

* Implement StaticFile viewport

* Implement stylesheet viewport

* Implement template item viewport

* Fix up routing

* Implement taking start nodes into account

* Implement filtering by culture too

* Delete old endpoints

* Implement document blueprint endpoint

* Implement media item viewport

* remove unneccesary $

* add fixme comment

* Fix response moedl

* update OpenApi.json

* Update OpenApi.json

* Update openapi file

* filter languages på isocode

* Change to sorted set to avoid duplicates

* Implement GetMultipleAsync for ILanguageService

* Fixed issue with params from GET needs to be querystring

* Removed Icon from base and only return Icon if explicitly set

* Fixed openAPI spec

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2023-04-05 12:50:41 +02:00
21b0a7ffae New Backoffice: Fix feedback to users controller (#14031)
* Add specific not found results

* Add tests for the enable/disable not found tweak

* Cache ids and key in UserIdKeyResolver

* Don't cache null keys

* BackOffice not Backoffice

* Move fetching the user out of the ChangePasswordUsersController

* Move resolving user out of SetAvatar

* Move resolving user out of Update

* Return more specific notfound in bykey

* Use ErrorResult for all endpoints with unknown errors

* Split integration tests

* Add mappers

* Use ?: consistently

* Add reuseable iso code validator

* Validate ISO code

* Update supressions

* Use method from base to get current user key

* Rename ISo to Iso

* Use keys in services instead of user groups + Added a couple of new validations

---------

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2023-04-04 15:41:12 +02:00
Bjarke BergandGitHub 6313b8b3a1 Changed "Key" to "Id" in management API (#14045) 2023-04-04 13:20:29 +02:00
Bjarke Berg c8f4ae2e29 Merge remote-tracking branch 'origin/v12/dev' into v13/dev 2023-04-04 09:25:39 +02:00
Jacob Overgaard dbbfc0c69e add https support for development CORS 2023-04-03 14:58:37 +02:00
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
Bjarke Berg 1f83e9ab19 Merge remote-tracking branch 'origin/v12/dev' into v13/dev 2023-03-29 11:08:53 +02:00
Kenn JacobsenandGitHub fd3bb0fcb8 Add content notifications API (#14010) 2023-03-29 10:48:30 +02:00
9b626d02c8 New backoffice: User controller (#13947)
* Add UserResponseModel

* Add factory to created UserResponseModel

* Add GetByKey controller

* Add GetAllUsers endpoint

* User proper response model

* Make naming consistent

* Order by username in GetAll

* Add user filter endpoint

* Fix includer user states

* Remove gravatar from the backend

* Send user avatars in response

* Add create user model

* start working on create

* Validate the create model

* Add authorization to create

* Use UserRepository instead of UserService to ValidateSessíonId

* Create IBackofficeUserStore interface

This is essentially a core-friendly version of the BackOfficeUserStore, additionally it contains basic methods for managing users, I.E. Get users, save users, create users, etc.

* Remove more usages of user service

* Remove usages of IUserService in BackofficeUserStore

* Add documentation

* Fix tests and DI

* add IBackOfficeUserStoreAccessor to resolve it in singleton services

* Resolve circular dependency

* Remove obsolete constructor

* Add core friendly user manager

* Finish createasync in user service

* Add WIP create endpoint

* Save newly creates users user groups

* Use service scope for user service

* Remove now unnecessary accessors

* Add response types

* Add update user endpoint

* Add EmailUserInviteSender

* Add technology free way of creating confirmation token

* Add invite uri provider

* Add invite user to user service

* Add invite user controller

* Add delete endpoint

* Add operation status responses

* Add operation status responses

* Added temporary file uploads including a repository implementation using local temp folder.

* Add Disable users endpoint

* missing files

* Fixed copy paste error

* Fix create users return type

* Updated OpenApi.json

* Updated OpenApi.json

* Handle if created failed in identity

* Add enable user

* Make users plural in enable/disable

We're doing the operation on multiple entities

* Added file extension check

* Add unlock user endpoint

* Clean up. Removed old TemporaryFileService and UploadFileService and updated dictionary items to use this new items

* Clean up

* Add reset password

* Add UpdateUserGroupsOnUsers method

* Add UpdateUserGroups

* Get rid of stream directly on TemporaryFileModel, and use delegate to open stream instead.

* Fix post merge

* Use keys instead of IDs

* Add ClearAvatar endpoint

* Review changes

* Moved models to their own files

* Reverted launch settings

* Move enlist extension to its own namespace

* Create set avatar endpoint

* Add reponse types

* Remove infrastructure extension after merge

* Add Cmapatibility suppressions

* Add test suppression

* Add integration tests

* Fix issue found in tests

* Add invited user to UserInvitationResult

* Add more tests

* Add update tests

* Hide different tests under parent

* Return DuplicatUserName user operation status if username matches an email

* Add update tests

* Change sorted set to HashSet

It doesn't work if it's not IComparable

* Change ID to Key when checking super

* Add get tests

* Add more GetAllTests

* Move tests to the right namespace

* Add filter test

* Fix including disabled users bug found by test

* Add test to ensure invited user state

* Add test case for UserState.All

* Add more filter tests

* Add enable disable tests

* Add resolver for keys and ids

* Replace usages of IUserService with IUserIdKeyResolver

* Add CompatibilitySuppressions

* Add UserIdKeyResolverTests

* Fix UserIdKeyResolver

* Add missing user operation results

* Updates from review

* ID not key

* Post instead of patch

* Use set instead of params for enable/disable

* Don't call to array

* Use sets for usergroup keys and user keys instead

* LanguageIsoCode instead of Language

* Update CompatibilitySuppressions after changin enumerable to set

---------

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
Co-authored-by: kjac <kja@umbraco.dk>
2023-03-29 08:14:47 +02:00
kjac 313eed96b9 Revert "Add content notifications API"
This reverts commit 8202879ba7.
2023-03-27 07:55:55 +02:00
kjac 8202879ba7 Add content notifications API 2023-03-27 07:55:18 +02:00
af24f304be New Backoffice: Fix total number of items (health checks, log viewer, packages) (#14003)
* Fix total number of items for health check controllers

* Fix total amount of items for log viewer controller

* Fixing AllMigrationStatusPackageController

* Fixing total items for package controllers

* Adding default implementation

* Update Nerdbank.GitVersioning dependency to 3.5.119

---------

Co-authored-by: Ronald Barendse <ronald@barend.se>
2023-03-24 11:47:59 +01:00
Jacob Overgaard 91d4389d2c add router lib to importmap 2023-03-24 11:01:33 +01:00
Jacob OvergaardandGitHub 03f1ff65fe V13: build new backoffice on Azure (#14005)
* add build scripts for new BO so it doesn't run through msbuild

* add node config for max_old_space_size to increase allowed heap size
2023-03-24 10:19:42 +01:00
Jacob Overgaard 5e721da35e bump memory for node.js builds 2023-03-22 16:05:49 +01:00
Jacob Overgaard 7bc5e0e3a1 update backoffice git submodule 2023-03-22 16:00:48 +01:00
Jacob Overgaard 458229a6ee update backoffice git submodule 2023-03-22 15:46:44 +01:00
93da4371e3 V13: Rework attempt pattern to use userkey (#13964)
* Add default super user key to migrations

* Start refactoring all interfaces signatures with ids

* Refactor datatype service to use userKey pattern instead

* Refactor ContentEditingService to use userkeys

* Refactor services to userKey

* Refactor more services to use userkey instead of id

* Refactor RelationService to use userKeys

* Refactor template service to use keys instead of ids

* Refactor fileservice to use keys instead of ids

* Refactor LocalizationService to use keys instead of ids

* Refactor PackagingService to use keys instead of ids

* Refactor TemplateController to use current user keys

* Refactor DataTypeContainerService.cs

* Refactor DataTypeService to use keys instead of ids

* Fix up tests

* Fix up media editing service to use userkey instead of ID

* Update service ctor to avoid ambigious ctors

* refactor DataTypeService

* Refactor DataTypeService to not have a default value for parentKey

* Apply suggestions from code review

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

* Update comment

* Add suppression file

* Add backoffice CompatibilitySuppressions

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com>
2023-03-21 12:41:20 +01:00
Jacob Overgaard 8a8421c841 backoffice git submodule 2023-03-21 12:11:29 +01:00
Jacob Overgaard c26c00474c update importmap to reflect latest backoffice libraries 2023-03-21 12:11:19 +01:00
Bjarke Berg ec9b873fac Added CompatibilitySuppressions files 2023-03-20 09:55:40 +01:00
Bjarke Berg 03afef299d Added CompatibilitySuppressions files 2023-03-20 09:53:22 +01:00
Bjarke Berg 27103355a5 Post merge fixes 2023-03-20 09:37:11 +01:00
Bjarke Berg 8a99222e26 Merge remote-tracking branch 'origin/v12/dev' into v13/dev
# Conflicts:
#	src/Umbraco.Core/CompatibilitySuppressions.xml
#	src/Umbraco.Core/Routing/UmbracoRequestPaths.cs
#	src/Umbraco.Infrastructure/CompatibilitySuppressions.xml
#	src/Umbraco.Web.BackOffice/Controllers/ContentController.cs
#	tests/Umbraco.Tests.UnitTests/Umbraco.Web.BackOffice/Controllers/ContentControllerTests.cs
2023-03-20 08:49:27 +01:00
835388ced0 Temporary files endpoints for management api (#13944)
* Added temporary file uploads including a repository implementation using local temp folder.

* missing files

* Fixed copy paste error

* Updated OpenApi.json

* Updated OpenApi.json

* Added file extension check

* Clean up. Removed old TemporaryFileService and UploadFileService and updated dictionary items to use this new items

* Clean up

* Get rid of stream directly on TemporaryFileModel, and use delegate to open stream instead.

* Review changes

* Moved models to their own files

* Reverted launch settings

* Update open API JSON file

---------

Co-authored-by: kjac <kja@umbraco.dk>
2023-03-16 08:25:15 +01:00
1e4c17a5f9 V13: Add default superuser key (#13955)
* Add default super user key to migrations

* Minor tweaks

* Obsolete superuser id

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
Co-authored-by: Nikolaj <nikolajlauridsen@protonmail.ch>
2023-03-15 10:32:00 +01:00
Kenn JacobsenandGitHub 4fb011e0fc Domains and hosts API (#13963)
* API for domains and hostnames incl. unit tests

* Update Open API json

* Update other unit tests to use new domain service methods where applicable

* Fix merge + update models to new naming scheme

* Handle attempts to add the same domain twice + unit tests for duplicate domain handling

* Review fixes
2023-03-15 10:28:23 +01:00
Jacob Overgaard ea1402de52 update git submodule 2023-03-15 08:06:22 +01:00
Jacob Overgaard 28e41f7cdc update git submodule 2023-03-14 12:52:00 +01:00
Jacob Overgaard 4d24312fe2 update git submodule 2023-03-13 15:32:23 +01:00
Jacob Overgaard 3b49e34e79 Merge remote-tracking branch 'origin/v13/dev' into v13/dev 2023-03-13 15:32:10 +01:00
Jacob Overgaard 6878334c3e add notification as separate library 2023-03-13 15:32:01 +01:00
5ac0087013 Rename data to values (#13892)
* Rename data to values

* Rename data to values

* Update OpenApi.json

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-03-13 15:03:54 +01:00
Kenn JacobsenandGitHub c0975f341c CRUD API for media + get-by-id for media type (#13934)
* CRUD API for media + get by ID for media types

* A little housekeeping for documents (align with media)

* Update Open API json

* Add messages to NotFound results (both content and media)

* Review changes; use same model for content and media URLs + return bad request when trying to move something to trash that is already in trash

* Fix bad merge + rename base (response) classes appropriately between both media and content types
2023-03-13 15:02:30 +01:00
Jacob Overgaard 8df3bca5fe git submodule update 2023-03-13 11:50:06 +01:00
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
Jacob Overgaard 44bbf48540 Merge remote-tracking branch 'origin/v13/dev' into v13/dev 2023-03-13 09:57:27 +01:00
Jacob Overgaard 22937cb550 optimise importmaps 2023-03-08 14:23:46 +01:00
Andreas ZerbstandGitHub 4d6e1e9531 Removed test file because the test are broken (#13924)
* Removed test file because the test are broken

* Removed outdated failing tests
2023-03-08 14:04:59 +01:00
Bjarke Berg 381c0e0978 Fixed issue with serializing structured values from serilog. 2023-03-08 13:30:58 +01:00
Bjarke Berg de6df01485 Merge remote-tracking branch 'origin/v12/dev' into v13/dev 2023-03-08 11:12:21 +01:00
1b8ce54e49 Remove Json.NET dependencies for more property editors (#13912)
* Make the Tags property editor JSON serialization agnostic

* Make the Multiple Value editor JSON serializer agnostic

* Make Media Picker 3 value converter work with System.Text.Json instead of Json.NET

* Make Image Cropper value converter work with System.Text.Json instead of Json.NET

* Remove Json.NET dependencies from ImageCropperTemplateExtensions

* Update src/Umbraco.Infrastructure/PropertyEditors/ImageCropperPropertyValueEditor.cs

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

* Update src/Umbraco.Infrastructure/PropertyEditors/ImageCropperPropertyValueEditor.cs

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

* Update src/Umbraco.Infrastructure/PropertyEditors/MediaPicker3PropertyEditor.cs

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

* Update src/Umbraco.Infrastructure/PropertyEditors/TagsPropertyEditor.cs

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

* Update src/Umbraco.Infrastructure/PropertyEditors/TagsPropertyEditor.cs

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

* Update src/Umbraco.Infrastructure/PropertyEditors/TagsPropertyEditor.cs

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

---------

Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
2023-03-07 14:31:27 +01:00
Jacob Overgaard 3b77debbfb update git submodule 2023-03-03 11:29:05 +01:00
Jacob Overgaard 25ac2253b5 Merge remote-tracking branch 'origin/v13/dev' into v13/dev 2023-03-02 14:51:09 +01:00
Jacob Overgaard 7316a0e82c add importmap to Default.cshtml 2023-03-02 14:50:51 +01:00
Nikolaj GeisleandGitHub f3ca18ccbf Apply skip take after (#13903) 2023-03-02 14:09:22 +01:00
Jacob Overgaard cbfa841413 add gitignore stuff from old executable 2023-03-02 13:52:35 +01:00
Bjarke Berg d53ecc16dd Merge remote-tracking branch 'origin/v12/dev' into v13/dev
# Conflicts:
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Media/mediaSection.spec.ts
2023-03-02 08:50:05 +01:00
27ca36db53 V13: relation type controller (#13856)
* Create RelationTypeControllerBase.cs

* Implement ByKey endpoint

* Move controllers

* Implement ByRelationTypeKeyRelationController

* Refactor relation service to use skip/take in interface

* change httpget

* Implement object types endpoint

* Add ObjectTypeViewModelFactory.cs

* Change signature to IActionResult

* Implement CreateRelationTypeController.cs

* Implement CreateRelationTypeController.cs

* Add optional key parameter to RelationType

* Add optional key to RelationTypeSavingViewModel

* Update ProducsResponseType

* Implement UpdateRelationTypeController

* Update routes

* Implement DeleteRelationTypeController

* Remove key from UpdatingViewmoDel

* Implement UpdatingViewModel factory method

* Update relationType factory

* Fix paging for object types

* Implement CreateAsync

* Update create action to use CreateAsync

* Implement update async

* Add default implementations to avoid breaking changes

* actually use userIds

* Add ProducesResponseType status 400 to endpoints

* Implement new DeleteAsync method

* Update OpenApi.json

* Add mapping to DI

* Update 404 to return proper HTTP status

* Add not found to ByKey action

* Rename viewmodels to request/response

* Update OpenApi.json

* All RelationServiceTests.cs

* Add allowed object types test

* Fix grouping

* Implement AllowedRelationObjectTypesService.cs

* Refactor view model factory to use new service

* Implement non-happy path tests

* Implement allowed child/parent object types

* refactor test to return proper relationTypeOperationStatus

* Add can create relation type with key

* Add Id test

* formatting

* Refactor service to have validation logic in save method

* move object types endpoint to own silo

* Delete unused using

* Update OpenApi.json

* Update OpenApi.json

* Update tests to user proper child/parent

* Implement RelationTypeBaseModel

* Update OpenApi.json

* Use array instead of enumerable

* Rename view model factory to presentation factory

* Rename GetPagedByRelationTypeKey

* Rename IRelationViewModelFactory

* Rename IRelationTypeViewModelFactory

* Update error description

* Update OpenApi.json

* Update OpenApi.json

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
Co-authored-by: Nikolaj <nikolajlauridsen@protonmail.ch>
2023-03-01 08:51:17 +01:00
Bjarke BergandGitHub a00421602e Merge pull request #13891 from umbraco/v13/feature/content-create-update-delete
Create/update/delete API for Document
2023-02-28 16:00:48 +01:00
Bjarke BergandGitHub 1d8941cf28 Merge pull request #13884 from umbraco/v13/feature/extension-model
Add extension model for new backoffice
2023-02-28 10:26:26 +01:00
b9ffd01f69 Update src/Umbraco.Core/Configuration/Models/PackageManifestSettings.cs
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2023-02-28 09:43:00 +01:00
kjac 0f95dbbfa6 Review changes and fixes 2023-02-28 08:36:48 +01:00
459e6f5421 Update src/Umbraco.Infrastructure/Manifest/PackageManifestReader.cs
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2023-02-28 08:01:17 +01:00
b5de843b84 Update src/Umbraco.Infrastructure/Manifest/PackageManifestService.cs
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2023-02-28 07:55:10 +01:00
Bjarke Berg 8bce0074c0 Merge branch 'v13/dev' into v13/feature/content-create-update-delete 2023-02-28 07:51:24 +01:00
Jacob Overgaard 7535576edf update git submodule 2023-02-27 14:43:16 +01:00
Jacob Overgaard 95a56238c9 update git submodule 2023-02-27 14:42:49 +01:00
kjac 51bb7b01bd Update open API JSON with renamed model names 2023-02-27 11:28:26 +01:00
kjac 207c1b6dde Rename ViewModel to ResponseModel + rename ViewModel factory to Presentation factory 2023-02-27 11:27:26 +01:00
kjac 9152d05613 Update open API JSON 2023-02-27 11:19:17 +01:00
kjac 34fa4aa5fc Clean up models 2023-02-27 09:25:35 +01:00
kjac 7d15e6d5ea Merge branch 'v13/dev' into v13/feature/content-create-update-delete 2023-02-27 08:42:13 +01:00
5e90fa26c1 V13: Add parentkey to notifications (#13832)
* Add parent key to CopyingNotification

* Use parentkey on notifications

* Implement ParentKeys for Copying notification

* Obsolete parentId

* Implement MoveToEventInfoBase

* Refactor MovingToRecycleBinNotification to use the new MoveEVentInfoBase

* Refactor MediaMovingToRecycleBinNotification

* Refactor MovedToRecycleBinNotification to use new MoveEventInfo

* Refactor ContentMovedToRecycleBinNotification to use new MoveEventInfo

* Start implementing parent key in moveinfo

* Add FIXME's to move methods

* Refactor Move to get parentKey for descendants

* Add FIXME for move method

* Use MoveToRecycleBinEventInfo in RelateOnTrashNotificationHandler

* Add fixme's to DataTypeRepository

* Add obsolete messages

* Revert changes in ContentTypeServiceBaseOfTRepositoryTItemTService.cs

* Fix bad indentation

* Pass the recursive variable

* Revert changes in ContentService.cs

* Refactor MoveEventInfo to not duplicate equals method

* Refactor Equals to not duplicate code

* Add UnitTests of Equals

* make equals public and add non-happy path tests

* Remvoe duplicate call to base

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-02-27 08:40:17 +01:00
kjac 502713fdbb Rename models as per new naming conventions + clean up duplicate models 2023-02-23 16:57:49 +01:00
kjac 9e8a0645cd Merge branch 'v13/dev' into v13/feature/content-create-update-delete 2023-02-23 16:50:19 +01:00
kjac 997f568303 Make the package manifest endpoint non-paginated 2023-02-23 16:49:20 +01:00
kjac 583b10562d Add missing compat suppression 2023-02-23 15:37:47 +01:00
kjac a70d76e4b5 Renamed controller for consistency 2023-02-23 15:37:15 +01:00
kjac e3b216c087 Re-apply missing legacy manifest renaming + re-generate compat suppressions after merge 2023-02-23 15:36:59 +01:00
kjac 5d2a90f974 Merge branch 'v13/dev' into v13/feature/extension-model
# Conflicts:
#	src/Umbraco.Cms.Api.Management/Controllers/Package/PackageControllerBase.cs
#	src/Umbraco.Cms.Api.Management/DependencyInjection/PackageBuilderExtensions.cs
#	src/Umbraco.Cms.Api.Management/ManagementApiComposer.cs
#	src/Umbraco.Core/CompatibilitySuppressions.xml
#	src/Umbraco.Infrastructure/CompatibilitySuppressions.xml
#	src/Umbraco.Infrastructure/Serialization/ContextualJsonSerializer.cs
#	src/Umbraco.Web.BackOffice/CompatibilitySuppressions.xml
2023-02-23 15:28:44 +01:00
c2ecc8dc33 New Backoffice: Package controller (#13578)
* Adding migration to update the default GUID value of created packages

* Updating the GUID if it is the default value when a package is saved

* Adding PackageDefinitionViewModel for representing a package

* Adding a mapping for package representation

* Adding PackageControllerBase, GetAllCreated and GetEmpty endpoints

* Adding GetCreatedByKey endpoint

* Adding GetByKey implementation for created packages

* Include MapAll comment

* Adding Download package endpoint

* Saving created package endpoint

* Adding a factory to create a PackageDefinition from view model

* Cleanup

* Fix error message

* Check for duplicate package name

* Remove commented out DuplicateNameException

* Moving created packages to /created folder/base

* Implement delete endpoint

* Update OpenApi.json

* Fix package route

* Fix OpenApi.json

* Add Ok() around the result

* Create PackageBuilderExtensions

* Adding suppression changes

* Cleanup

* Use ProblemDetailsBuilder

* Extract collecting installed packages from package migration plans into its own method

* Use GetInstalledPackagesFromMigrationPlans to return all migration statuses

* Add Status to DictionaryControllerBase ProblemDetails

* Implement RunMigrationPackageController

* Adding more information to the log message

* Update OpenApi.json

* Change param name

* Fix OpenApi.json

* Fix response type for Log viewer endpoint

* Remove EmptyPackageController

* Rename to RunPendingPackageMigrations

* Introduce new PackageOperationStatus

* Making methods async and introducing new Create, Update and Delete methods

* Fix async calls

* Fix Mapper - multiple enumeration and cleanup

* Creating special action models

* Fixing the factory with new models changes

* Service implementation changes

* Removing SaveCreatedPackageController as the functionality is split between Create and UpdateCreatedPackageController

* Utilize the new DeleteCreatedPackageAsync

* Refactor DownloadCreatedPackageController as some responsibility is moved to the service

* Refactor PackagingService to use auditService

* Refactor PackagingService to use skip/take

* Refactor services to return pagedmodel

* Refactor controller to use new return value

* update OpenApi.json

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-02-23 14:36:21 +01:00
b96302a9da V13: Audit log controller (#13842)
* Implement AuditLogByTypeViewModel

* Add GetLogs endpoint

* Implement AuditLogViewModelFactory and use it

* Remove mapping and do that in ViewModelFactory

* Add Skip take pagination to AuditService.cs

* Get entity key from repository

* Only create filter if sincedate has value

* Refactor to handle enitity not being found

* Add by type route

* Rename AuditLogViewModel.cs

* Add CreateAuditLogWithUsernameViewModel method to factory

* Rename method in factory

* Fix up controllers to use async service

* Refactor to use pagedModel

* Update sincedate query

* Add FIXME

* Move entity call in scope

* Rename methods to async

* Update src/Umbraco.Core/PaginationHelper.cs

* Refactor to use IActionResult

* Audit log in two words

* Fix up by key

* Fix routing

* Fix ByType

* Update ByType routing

* Refactor to also pass DateStamp

* Add Key to WithUserNameViewModel

* Refactor extension method to call new GetAsync method

* use new GetAsync method

* Rename models and implement base class

* Update OpenApi.json

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
Co-authored-by: Nikolaj <nikolajlauridsen@protonmail.ch>
2023-02-23 11:32:24 +01:00
kjac 93149160a7 Make various value editors handle their respective data as concrete types rather than strings or otherwise strange legacy data formats 2023-02-23 09:12:10 +01:00
kjac 710ae3c788 Make the JSON object converter return generic lists of types whenever applicable - and JsonArray for JSON objects. 2023-02-23 09:09:08 +01:00
kjac 767e3cd9eb Add tests for content editing service 2023-02-23 07:31:05 +01:00
Bjarke Berg 37ac85ee96 Merge remote-tracking branch 'origin/v12/dev' into v13/dev 2023-02-23 07:18:25 +01:00
46cc9d6a97 V13: Add Guids to Users (#13868)
* Add MSSQL migration

* Make upgrade possible when user doesn't have a key yet

* Migrate SQLite

* Migrate the external login column

* Fix logging in after migration

* Handle fake GUID correctly

* Make GetByKey async

* Resolve external logins by key instead of id

* Remove usage of naive UserIdToInt

* Dont use ToGuid for property type defaults

* Use constant GUID for user groups

* Ensure that the same GUID is used to create the root user.

* Add migration for two factor logins

* Add default implementations

* Fix unit test

* Remove TODO

* Fix integration tests

* Add default implementation instead of throwing

Co-authored-by: Bjarke Berg <mail@bergmania.dk>

* Make SQLServer migration idempotent

* Add comment about SQLite

* Fix typo

---------

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2023-02-22 12:33:41 +01:00
kjac 95ec06e119 Fix model name clash in Swagger 2023-02-22 11:39:14 +01:00
kjac 6a0f6267f1 Add missing JSON converters to configuration editor serializer 2023-02-22 11:28:21 +01:00
Bjarke BergandGitHub f734f1fc6a Merge pull request #13861 from umbraco/v13/bugfix/fixed_profiling_endpoints
Fixed profiling status endpoints and added an update endpoint
2023-02-22 07:27:52 +01:00
Nikolaj 74f7ab4e1a Check if value is false consistently 2023-02-21 15:37:49 +01:00
Nikolaj 3608540d45 Use is false instead of negation 2023-02-21 15:35:36 +01:00
0619a7de41 Use keys for tracked references (#13849)
* Use Keys for tracked references instead of int id's.

* Updated OpenApi.json

* Handle filterMustBeIsDependency consistently

---------

Co-authored-by: Nikolaj <nikolajlauridsen@protonmail.ch>
2023-02-21 15:20:34 +01:00
kjac cf12b9540e Merge branch 'v13/dev' into v13/feature/content-create-update-delete
# Conflicts:
#	src/Umbraco.Cms.Api.Management/Controllers/Document/ByKeyDocumentController.cs
#	src/Umbraco.Cms.Api.Management/Controllers/Document/DocumentControllerBase.cs
#	src/Umbraco.Cms.Api.Management/DependencyInjection/DocumentBuilderExtensions.cs
#	src/Umbraco.Cms.Api.Management/Mapping/Content/ContentMapDefinition.cs
#	src/Umbraco.Cms.Api.Management/Mapping/Document/DocumentMapDefinition.cs
#	src/Umbraco.Cms.Api.Management/ViewModels/Content/ContentViewModelBase.cs
#	src/Umbraco.Cms.Api.Management/ViewModels/Content/VariantViewModelBase.cs
#	src/Umbraco.Cms.Api.Management/ViewModels/Document/DocumentViewModel.cs
#	src/Umbraco.Infrastructure/Serialization/SystemTextJsonSerializer.cs
2023-02-21 14:07:36 +01:00
2eebd0558c Document and document type read API (#13853)
* Basic structure for document and document type read API

* Handle unpublished, non-variant content

* Expose content type key on ContentTypeSort

* Add the remaining properties to document type (minus list view info, still pending)

* Obsolete more ILocalizationService usage

* Add URLs and template data to document view model

* Clean up + add proprety type appearance

* update submodule commit

* front-end commit

* latest front-end commit

* latest commit

* latest front-end commit

* Rename content property to content value in view model layer

* Add contextual JSON serialization as default JSON serializer

* Add FIXME to content type sort + rearrange constructor parameters

* Fix broken remark tag

* Whitelist breakage for ContentTypeSort

* Add variance info to property type output

* Update src/Umbraco.Cms.Api.Management/Controllers/Document/ByKeyDocumentController.cs

Co-authored-by: Bjarke Berg <mail@bergmania.dk>

* Update src/Umbraco.Cms.Api.Management/Controllers/DocumentType/ByKeyDocumentTypeController.cs

Co-authored-by: Bjarke Berg <mail@bergmania.dk>

* Update src/Umbraco.Cms.Api.Management/Factories/ContentUrlFactory.cs

Co-authored-by: Bjarke Berg <mail@bergmania.dk>

* Add a few FIXME comments about async entity retrieval

---------

Co-authored-by: Niels Lyngsø <niels.lyngso@gmail.com>
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2023-02-21 13:40:41 +01:00
Bjarke Berg 14d9fe796a Fix test 2023-02-21 12:19:56 +01:00
Bjarke Berg ed25342311 Fixed tess 2023-02-21 11:28:21 +01:00
kjac d7ad194a5b Merge branch 'v13/dev' into v13/feature/content-create-update-delete 2023-02-21 09:47:44 +01:00
kjac ff90e2a865 Add async get method to content editing service 2023-02-21 09:46:23 +01:00
kjac 9b63d33b33 Merge branch 'v13/feature/content-and-content-type-read-api' into v13/feature/content-create-update-delete 2023-02-21 09:33:21 +01:00
kjac 8541919880 Add a few FIXME comments about async entity retrieval 2023-02-21 09:32:49 +01:00
6982b38ebd Update src/Umbraco.Cms.Api.Management/Factories/ContentUrlFactory.cs
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2023-02-21 09:22:19 +01:00
ee4bfa8f5a Update src/Umbraco.Cms.Api.Management/Controllers/DocumentType/ByKeyDocumentTypeController.cs
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2023-02-21 09:22:09 +01:00
c269ebc347 Update src/Umbraco.Cms.Api.Management/Controllers/Document/ByKeyDocumentController.cs
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2023-02-21 09:22:00 +01:00
kjac a541e24508 Add variance info to property type output 2023-02-21 09:18:57 +01:00
Bjarke Berg be8f120851 Updated OpenApi.json 2023-02-20 15:08:29 +01:00
Bjarke Berg 0d29ad9333 Moved logic from all around into the repository 2023-02-20 14:42:12 +01:00
Bjarke Berg 0ce5a5bb29 Fixed nonodes page css 2023-02-20 14:25:58 +01:00
Bjarke Berg 3587172e02 Fixed and added profiling endpoints 2023-02-20 14:22:35 +01:00
kjac 51189febfb Make Multi URL Picker value editor able to utilize System.Text.Json 2023-02-20 11:09:57 +01:00
kjac 361db0ed3c Add create, update and delete (move to recycle bin) operations for Document 2023-02-20 11:08:22 +01:00
kjac e12fbdf5b7 Add Udi and GuidUdi support in JSON serializer 2023-02-20 11:05:56 +01:00
kjac ec46cbcd71 Make JSON object converter return JsonArray for arrays of JSON items 2023-02-20 11:04:57 +01:00
kjac df7cb851e8 Whitelist breakage for ContentTypeSort 2023-02-18 14:15:19 +01:00
kjac 6f726c3e67 Fix broken remark tag 2023-02-18 14:14:46 +01:00
kjac 0bc08e6a91 Add FIXME to content type sort + rearrange constructor parameters 2023-02-18 13:58:02 +01:00
kjac 323a1b731b Add contextual JSON serialization as default JSON serializer 2023-02-18 13:41:54 +01:00
Andreas ZerbstandGitHub 1f7874dfc8 Removed failing test (#13846) 2023-02-17 11:46:38 +01:00
Bjarke BergandGitHub 8d1218374f Merge pull request #13843 from umbraco/v13/feature/website_assets_directly_from_static_assets
V13: website assets directly from static assets
2023-02-17 10:02:39 +01:00
Bjarke Berg 889f87f2ae Added missing files and updated gitignore 2023-02-17 08:32:07 +01:00
Bjarke Berg 85436ee7c9 check out submodules too 2023-02-16 15:30:52 +01:00
Bjarke Berg 8f9c67ffee Handle static assets for the website directly in static assets project. These should not be build by the backoffice scripts as they are not owned by backoffice 2023-02-16 15:15:59 +01:00
Bjarke BergandGitHub d7ef924c32 Miniprofiler for v13 (#13841)
* Updated miniprofiler and added a few configurations

* added fixme

* Remove file that should not have been committed

* added ignore list. We check the entire path and ignore client requests anyway
2023-02-16 13:08:57 +01:00
Bjarke Berg a8b6eb714d Merge remote-tracking branch 'origin/v12/dev' into v13/dev 2023-02-16 11:16:30 +01:00
5182f46bdb New Backoffice: User Groups Controller (#13811)
* Add key to UserGroupDto

* Fix renaming table in sqlite

The SqliteSyntaxProvider needed an overload to use the correct query

* Start work on user group GUID migration

* Add key index to UserGroupDto

* Copy over data when migrating sqlite

* Make sqlite column migration work

* Remove PostMigrations

These should be replaced with Notification usage

* Remove outer scope from Upgrader

* Remove unececary null check

* Add marker base class for migrations

* Enable scopeless migrations

* Remove unnecessary state check

The final state of the migration is no longer necessarily the final state of the plan.

* Extend ExecutedMigrationPlan

* Ensure that MigrationPlanExecutor.Execute always returns a result.

* Always save final state, regardless of errors

* Remove obsolete Execute

* Add Umbraco specific migration notification

* Publish notification after umbraco migration

* Throw the exception that failed a migration after publishing notification

* Handle notification publishing in DatabaseBuilder

* Fix tests

* Remember to complete scope

* Clean up MigrationPlanExecutor

* Run each package migration in a separate scope

* Add PartialMigrationsTests

* Add unhappy path test

* Fix bug shown by test

* Move PartialMigrationsTests into the correct folder

* Comment out refresh cache in data type migration

Need to add this back again as a notification handler or something.

* Start working on a notification test

* Allow migrations to request a cache rebuild

* Set RebuildCache from MigrateDataTypeConfigurations

* Clean MigrationPlanExecutor

* Add comment explaining the need to partial migration success

* Fix tests

* Allow overriding DefinePlan of UmbracoPlan

This is needed to test the DatabaseBuilder

* Fix notification test

* Don't throw exception to be immediately re-caught

* Assert that scopes notification are always published

* Ensure that scopes are created when requested

* Make test classes internal.

It doesn't really matter, but this way it doesn't show up in intellisense

* Add notification handler for clearing cookies

* Add CompatibilitySuppressions

* Use unscoped migration for adding GUID to user group

* Make sqlite migration work

It's really not pretty, square peg, round hole.

* Don't re-enable foreign keys

This will happen automatically next time a connection is started.

* Scope database when using SQLServer

* Don't call complete transaction

* Tidy up a couple of comment

* Only allow scoping the database from UnscopedMigrationBase

* Fix comment

* Remove remark in UnscopedMigrationBase as it's no longer true

* Add keys when creating default user groups

* Map database value from DTO to entity

* Fix migration

Rename also renamed the foreign keys, making it not work

* Make migration idempotent

* Fix unit test

* Update CompatibilitySuppressions.xml

* Add GetUserGroupByKey to UserService

* Add ByKey endpoint

* Add UniqueId to AppendGroupBy

Otherwise MSSQL grenades

* Ensure that languages are returned by PerformGetByQuery

* add POC displaying model

* Clean up by key controller

* Add GetAllEndpoint

* Add delete endpoint

* Use GetKey to get GUID from id

Instead of pulling up the entire entity.

* Add UserGroup2Permission table

* Fetch the new permissions when getting user groups

* Dont ToString int to parse it to a short

I'm pretty sure this is some way old migration type code that doesn't make any sense anymore

* Add new relation to GetDeleteClauses

* Persist the permissions

* Split UserGroupViewModel into multiple models

This is to make it possible to make endpoints more rest-ish

* Bootstrap create and update endpoints

* Make GetAllUserGroupController paged

* Add method to create IUserGroup from UserGroupSaveModel

* Add sanity check version of endpoint

* Fix persisting permissions

* Map section aliases to the name the frontend expects

This is a temporary fix till we find out how we really want to handle this

* Fix up post merge

* Make naming more consistent

* Implement initial update endpoint

* Fix media start node

* Clean name for XSS when mapping to IUserGroup

* Use a set instead of a list for permission names

We don't want dupes

* Make permission column nvarchar max

* Add UserGroupOperationStatuses

* Add IUserGroupAuthorizationService

* Add specific user group creation method to user service

* Move validating and authorizing into its own methods

* Add operation result to action result mapping

* Update create controller to use the create method

* Fix create end point

* Comment out getting current user untill we have auth

* Add usergroup service

* Obsolete usergroup things from IUserService

* Add update to UserGroupService interface

* User IUserGroupService in controllers

* User async notifications overloads

* Move authorize user group creation into its own service

* Add AuthorizeUserGroupUpdate method

* Make new service implementations internal and sealed

* Add update user

* Add GetAll to usergroup service

* Remove or obsolete usages of GetAllUserGroups

* Add usergroup service to DI

* Remove usage of GetGroupsByAlias

* Remove usages of GetUserGroupByAlias

* Remove usage of GetUserGroupById

* Add new table when creating a new database

* Implement Delete

* Add skip and take to getall

* Move skip take into the service

* Fixup suggestions in user group service

* Fixup unit tests

* Allow admins to change user groups they're not a part of

* Add CompatibilitySuppressions

* Update openapi

* Uppdate OpenApi.json

again

* Add missing compatibility suppression

* Added missing type info in ProducesResponseTypeAttribute

* Added INamedEntityViewModel and added on the relevant view models

* Fixed bug, resulting in serialization not being the same as swagger reported. Now all types objects implementing an interface, is serialized with the $type property

* updated OpenApi.json

* Added missing title in notfound response

* Typo

* .Result to .GetAwaiter().GetResult()

* Update comment to mention it should be implemented on CurrentUserController

* Validate that start nodes actually exists

* Handle not found consistently

* Use iso codes instead of ids

* Update OpenAPI

* Automatically infer statuscode in problemdetails

* Ensure that the language exists

* Fix usergroup 2 permission index

* Validate that group name and alias is not too long

* Only return status from validation

We're just returning the same usergroups, and this is less boilerplate code

* Handle empty and null group names

* Remove group prefix from statuses

* Add some basic validation tests

* Don't allow updating a usergroup to having a duplicate alias

---------

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2023-02-16 09:39:17 +01:00
kjac 41fbaa2343 Merge branch 'v13/dev' into v13/feature/content-and-content-type-read-api 2023-02-16 09:27:35 +01:00
kjac e0c396afd6 Rename PluginConfiguration to PackageManifest + a little more legacy manifest renaming 2023-02-15 15:17:50 +01:00
kjac d2ed03a5d8 Rename old manifest stuff to legacy manifest 2023-02-15 14:58:10 +01:00
Bjarke Berg 808d563aa0 Merge remote-tracking branch 'origin/v12/dev' into v13/dev
# Conflicts:
#	src/Umbraco.Core/Models/PublishedContent/PublishedValueFallback.cs
2023-02-15 14:19:19 +01:00
kjac 04ea016293 Merge branch 'v13/dev' into v13/feature/extension-model 2023-02-15 14:06:15 +01:00
Bjarke BergandGitHub bf4e745b6a Updated OpenIddict to v4 (#13830)
* Updated OpenIddict to v4 and when through the migration guide.

(SetAuthorizationEndpointUris and SetTokenEndpointUris should not start with a leading / anymore)

* Fixed issue where the old backoffice did not build

* Fixed build

* Fake a change - hopefully npm can see the file now?

* try using npm install instead of npm ci

* Another trial

* remove build of old backoffice

* Oops build new backoffice - not the old

* rollback changes to static assets

* Foreach csproj file instead. Fix for breaking change in dotnet sdk 7.0.200
2023-02-15 13:56:45 +01:00
kjac e4223ef2de Use async telemetry report in ReportSiteTask 2023-02-14 19:08:21 +01:00
kjac 4087f7805e Rename ExtensionManifest to PluginConfiguration 2023-02-14 16:59:08 +01:00
Jacob Overgaard a04ae368c8 update git submodule 2023-02-14 15:43:35 +01:00
kjac 92e53c236e Rename extension file to umbraco-package.json 2023-02-14 14:22:23 +01:00
kjac ba87025de8 Cache manifests in service layer 2023-02-14 11:39:56 +01:00
kjac bdffbb49ae Add async caching extension methods 2023-02-14 11:39:39 +01:00
kjac 341db24ec0 Rename manifest reader method 2023-02-14 10:52:30 +01:00
kjac 51f2b6cd88 Rename content property to content value in view model layer 2023-02-14 10:47:16 +01:00
kjac 1868269905 Merge branch 'v13/dev' into v13/feature/content-and-content-type-read-api
# Conflicts:
#	src/Umbraco.Web.UI.New.Client
2023-02-14 10:33:51 +01:00
kjac bd61ac14e4 Add unit tests 2023-02-14 10:19:23 +01:00
Bjarke BergandGitHub 3e8247f324 add response location header for 201 (#13829)
* Fixed issues where we returned incorrectly 201 with CreatedResultViewModel

* Updated OpenAPI Spec

* Fixed OpenApi

* Added response header to swagger when 201 result

* Clean up
2023-02-14 09:48:09 +01:00
kjac b34f0280c5 Move System.Text.Json serializer to Infrastructure project 2023-02-14 07:03:25 +01:00
kjac eb0ec7bee8 Initial implementation for extension manifests 2023-02-13 19:03:58 +01:00
Kenn JacobsenandGitHub 620a673fa3 A little Monday cleanup (#13823)
* Introduce root key constant

* Do not enforce ProblemDetails on every non-success response from the API + remove invalid NotFoundResult response types from various endpoints

* Update OpenAPI JSON contract to reflect the new NotFound results
2023-02-13 15:16:21 +01:00
Jacob Overgaard 233be8dc8f update git submodule 2023-02-13 10:07:25 +01:00
Jacob Overgaard 66118e556a update git submodule 2023-02-13 09:06:15 +01:00
Niels Lyngsø 89a3243771 latest front-end commit 2023-02-10 16:29:16 +01:00
Niels Lyngsø fb47b02ed0 latest commit 2023-02-10 16:27:35 +01:00
Niels Lyngsø 84c6d3b204 latest front-end commit 2023-02-10 16:23:35 +01:00
Niels Lyngsø b70491a782 front-end commit 2023-02-10 15:28:39 +01:00
Niels Lyngsø 5722108454 Merge remote-tracking branch 'origin/v13/dev' into v13/feature/content-and-content-type-read-api 2023-02-10 15:17:02 +01:00
Niels Lyngsø 72c5ec696d update submodule commit 2023-02-10 15:16:41 +01:00
50f19549b6 Add move/copy operations to datatype API (#13791)
* Add move/copy operations to datatype API

* Add compat suppressions for new interface methods

* Regenerate OpenAPI JSON

* Update OpenApi.json

* Ensure we can copy a datatype to root + make the target key nullable (explicit) for move and copy operation models

* Handle parent not found status

* Update the OpenAPI spec to reflect new nullability

* Cleanup

---------

Co-authored-by: Elitsa Marinovska <elm@umbraco.dk>
2023-02-10 15:11:49 +01:00
Jacob Overgaard 525d73d205 update git submodule 2023-02-10 11:25:37 +01:00
Kenn JacobsenandGitHub 36dc35f8aa Add "move" to dictionary API (#13810)
* Sanitize dictionary overview and export actions

* Amend dictionary services with async and attempt pattern + isolate temporary file handling in its own service.

* Update OpenAPI schema to match new dictionary bulk actions

* Implement move API for dictionary items.

* Add unit tests for dictionary item move

* Fix merge

* Update OpenAPI json after merge
2023-02-10 08:32:24 +01:00
Jacob Overgaard 42f8cde259 update to backoffice directory 2023-02-09 13:32:20 +01:00
9b7bf81ad1 Serialization and deserialziation with polymorphism (#13762)
* Support polymophism when sending or receiving interfaces

* Handle attempts to deserialize interfaces nicer

* updated OpenApi.json

* Update src/Umbraco.Cms.Api.Common/Json/NamedSystemTextJsonInputFormatter.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update src/Umbraco.Cms.Api.Management/ManagementApiComposer.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update src/Umbraco.Cms.Api.Management/OpenApi/ConfigureUmbracoSwaggerGenOptions.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update src/Umbraco.Infrastructure/Serialization/UmbracoJsonTypeInfoResolver.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update src/Umbraco.Infrastructure/Serialization/UmbracoJsonTypeInfoResolver.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update src/Umbraco.Infrastructure/Serialization/UmbracoJsonTypeInfoResolver.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update src/Umbraco.Infrastructure/Serialization/UmbracoJsonTypeInfoResolver.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update src/Umbraco.Infrastructure/Serialization/UmbracoJsonTypeInfoResolver.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update src/Umbraco.Infrastructure/Serialization/UmbracoJsonTypeInfoResolver.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update src/Umbraco.Infrastructure/Serialization/UmbracoJsonTypeInfoResolver.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update src/Umbraco.Infrastructure/Serialization/UmbracoJsonTypeInfoResolver.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Invert to avoid nesting

* Updated OpenApi.json

* Update schema

---------

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>
2023-02-08 18:29:30 +01:00
Elitsa MarinovskaandGitHub 20534b7a97 New Backoffice: Health check controller refactor (#13763)
* Refactor AllHealthCheckGroupController to return just the names of the groups + changes in the HealthCheckFactory

* Introduce a new "get by name without results" endpoint

* Create a "check" endpoint

* View models changes

* Factory renaming changes

* Remove Task.FromResult

* Update OpenApi.json

* Minor updates

* Inject HealthCheckCollection directly into the factory
2023-02-08 14:16:21 +01:00
fdf416550a Refactor dictionary bulk action APIs (#13786)
* Sanitize dictionary overview and export actions

* Amend dictionary services with async and attempt pattern + isolate temporary file handling in its own service.

* Update OpenAPI schema to match new dictionary bulk actions

* Update src/Umbraco.Cms.Api.Management/Services/DictionaryItemImportService.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update src/Umbraco.Cms.Api.Management/Services/DictionaryItemImportService.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update src/Umbraco.Cms.Api.Management/Services/TemporaryFileService.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update src/Umbraco.Cms.Api.Management/ViewModels/Dictionary/DictionaryImportModel.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Refactor - split dictionary import handling into smaller methods

* Rename view model due to name clash in new SwaggerGen + update OpenAPI JSON file

---------

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>
2023-02-08 13:18:08 +01:00
Bjarke Berg b582bfa39b Merge remote-tracking branch 'origin/v13/dev' into v13/dev 2023-02-08 12:55:31 +01:00
Bjarke Berg e5609592cd Merge remote-tracking branch 'origin/v12/dev' into v13/dev
# Conflicts:
#	src/Umbraco.Core/Models/ContentEditing/Language.cs
#	src/Umbraco.Core/Models/DictionaryItem.cs
#	src/Umbraco.Core/Models/DictionaryItemExtensions.cs
#	src/Umbraco.Core/Models/DictionaryTranslation.cs
#	src/Umbraco.Core/Models/IDictionaryTranslation.cs
#	src/Umbraco.Core/Models/Language.cs
#	src/Umbraco.Core/Models/Membership/ReadOnlyUserGroup.cs
#	src/Umbraco.Core/Models/Membership/UserGroupExtensions.cs
#	src/Umbraco.Core/Services/DataTypeService.cs
#	tests/Umbraco.Tests.Common/Builders/LanguageBuilder.cs
#	tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Editors/UserEditorAuthorizationHelperTests.cs
2023-02-08 12:38:43 +01:00
Kenn JacobsenandGitHub 59448aeaac Add "Model" postfix for all models in the Swagger output (#13806) 2023-02-08 12:34:11 +01:00
Nathan Woulfe b5e87a82f2 Merge branch 'v13/dev' of https://github.com/umbraco/umbraco-cms into v13/dev 2023-02-08 09:47:02 +10:00
Nathan Woulfe 41a03f4b8b uses correct constant for dictionary icon (needs to be added to uui icon registry) 2023-02-08 09:46:58 +10:00
6808a63e73 New backoffice: Add GUIDS to user groups (#13672)
* Add key to UserGroupDto

* Fix renaming table in sqlite

The SqliteSyntaxProvider needed an overload to use the correct query

* Start work on user group GUID migration

* Add key index to UserGroupDto

* Copy over data when migrating sqlite

* Make sqlite column migration work

* Remove PostMigrations

These should be replaced with Notification usage

* Remove outer scope from Upgrader

* Remove unececary null check

* Add marker base class for migrations

* Enable scopeless migrations

* Remove unnecessary state check

The final state of the migration is no longer necessarily the final state of the plan.

* Extend ExecutedMigrationPlan

* Ensure that MigrationPlanExecutor.Execute always returns a result.

* Always save final state, regardless of errors

* Remove obsolete Execute

* Add Umbraco specific migration notification

* Publish notification after umbraco migration

* Throw the exception that failed a migration after publishing notification

* Handle notification publishing in DatabaseBuilder

* Fix tests

* Remember to complete scope

* Clean up MigrationPlanExecutor

* Run each package migration in a separate scope

* Add PartialMigrationsTests

* Add unhappy path test

* Fix bug shown by test

* Move PartialMigrationsTests into the correct folder

* Comment out refresh cache in data type migration

Need to add this back again as a notification handler or something.

* Start working on a notification test

* Allow migrations to request a cache rebuild

* Set RebuildCache from MigrateDataTypeConfigurations

* Clean MigrationPlanExecutor

* Add comment explaining the need to partial migration success

* Fix tests

* Allow overriding DefinePlan of UmbracoPlan

This is needed to test the DatabaseBuilder

* Fix notification test

* Don't throw exception to be immediately re-caught

* Assert that scopes notification are always published

* Ensure that scopes are created when requested

* Make test classes internal.

It doesn't really matter, but this way it doesn't show up in intellisense

* Add notification handler for clearing cookies

* Add CompatibilitySuppressions

* Use unscoped migration for adding GUID to user group

* Make sqlite migration work

It's really not pretty, square peg, round hole.

* Don't re-enable foreign keys

This will happen automatically next time a connection is started.

* Scope database when using SQLServer

* Don't call complete transaction

* Tidy up a couple of comment

* Only allow scoping the database from UnscopedMigrationBase

* Fix comment

* Remove remark in UnscopedMigrationBase as it's no longer true

* Add keys when creating default user groups

* Map database value from DTO to entity

* Fix migration

Rename also renamed the foreign keys, making it not work

* Make migration idempotent

* Fix unit test

* Update CompatibilitySuppressions.xml

* Add UniqueId to AppendGroupBy

Otherwise MSSQL grenades

* Cleanup

* Update CompatibilitySuppressions

* Rename UniqueId to Key

* Cleanup

---------

Co-authored-by: Elitsa Marinovska <elm@umbraco.dk>
2023-02-07 08:30:33 +01:00
kjac ad1797eb41 Clean up + add proprety type appearance 2023-02-06 11:11:24 +01:00
kjac c88d00797a Add URLs and template data to document view model 2023-02-04 13:21:34 +01:00
kjac 0d7d8edaae Obsolete more ILocalizationService usage 2023-02-04 13:20:01 +01:00
kjac 8c2fa7274c Add the remaining properties to document type (minus list view info, still pending) 2023-02-04 12:03:43 +01:00
kjac 43c10a7fc0 Expose content type key on ContentTypeSort 2023-02-04 12:02:58 +01:00
kjac 54e76b74c4 Handle unpublished, non-variant content 2023-02-02 09:29:36 +01:00
kjac d04c50b988 Basic structure for document and document type read API 2023-02-01 15:35:38 +01:00
Andreas ZerbstandAndreas Zerbst fdd059fb2b Updated the ID of the locator in the test 'can set a minimum of required blocks in content with a block list editor' to match the correct ID. (#13769) 2023-02-01 15:21:33 +01:00
70aa626991 Fix sln file for the new backoffice (#13765)
* Fix sln file and add README commands to get started

* expand the docs a bit

---------

Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>
2023-02-01 10:37:21 +01:00
8caee5297b Use ISO codes instead of language IDs for fallback languages and translations (#13751)
* Use language ISO code for language fallback instead of language ID

* Remove language and language ID from dictionary item and dictionary item translation

* ADd unit test for dictionary item translation value extension

* Make the internal service implementations sealed

* Rename translation ISO code to be more explicit in its origin (Language)

* Add breaking changes suppression

* Handle save of invalid fallback iso code

* Fixed test

* Only allow non-UserCustomCulture's

* Fixed and added tests

* Rename ISO code validation method

* Fix language telemetry test (create Swedish with the correct ISO code)

---------

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2023-02-01 09:37:37 +01:00
Kenn JacobsenandGitHub 641cae7fb5 Align the data type API (#13760)
* Make data type CRUD operations async using Attempt pattern

* Refactor data type container management to its own service + add unit tests for it

* Add compatability suppression for new interface methods and unit test changes
2023-02-01 08:38:36 +01:00
Kenn JacobsenandGitHub ac8cfcf634 Align template API with dictionary API (#13714)
* Align the template services and API with the dictionary ones (use attempt pattern)

* A little controller clean-up

* Mimic old file service behavior, make unit tests happy

* Align CreateForContentTypeAsync return value with the rest of the TemplateService API

* Scaffold endpoint should no longer feature master templates

* Update the OpenAPI JSON
2023-01-31 12:20:46 +01:00
Bjarke Berg 5f8ef4cfff Merge remote-tracking branch 'origin/v12/dev' into v13/dev 2023-01-30 08:02:44 +01:00
Jacob Overgaard 219940f523 update backoffice submodule 2023-01-27 09:08:55 +01:00
Kenn JacobsenandGitHub 0297152249 Split localization service into dedicated services (#13731)
* Rework language service and API

* Revert unintended commit of Directory.Build.props

* Create OS conditional test for invalid ISO codes

* Reintroduce and obsolete old Delete method on ILocalizationService + make new Delete method delete by ISO code + add obsoletion attrs to service implementation

* Review comments + utilize new Delete method

* Do not allow model reuse when creating a new language

* Fix bad merge

* Split localization service into dedicated services for language and dictionary item handling

* Replaced ILocalizationService usage in management API (as much as can be done for now)

* Ensure we can create dictionary items with explicit keys (but no duplicates)

* Fix culture controller so it works properly with pagination

* Update OpenAPI JSON

* Actually update the language being updated...

* Unit test for invalid ISO now no longer needs to differ between OS :)

* A little bit of code health improvements

* A litte less code duplication

* Remove duplicate validation
2023-01-26 13:34:11 +01:00
aa90efa5b7 New Backoffice: Log viewer controller (#13648)
* Fixing a few nullable reference types for log viewer (#13634)

(cherry picked from commit b4ca2a6636)

* Adding LogControllerBase

* Migrating GetLogLevels()

* Migrating GetNumberOfErrors()

* Migrating GetLogLevelCounts()

* Migrating GetCanViewLogs()

* Migrating GetMessageTemplates()

* Migrating GetLogs()

* Migrating GetSavedSearches()

* Migrating PostSavedSearch()

* Migrating DeleteSavedSearch()

* Adding LoggerViewModel

* Adding LogViewModelMapDefinition

* Update OpenApi.json

* Cleanup

* V12: Change nullability for the log searches (#13647)

* Changing nullability

* Obsolete DeleteSavedSearch since the query param is not used

* Fix a bit more referenced

* Add default implementation for the new overload of DeleteSavedSearch

(cherry picked from commit 5e06f5a8a0)

* Updates based on nullability fix

* Adding GetSavedSearchByName

* Implementing ByName endpoint

* Refactoring Delete endpoint based on GetSavedSearchByName

* Refactoring Create endpoint to return the item's location

* Suppress new GetSavedSearchByName in ILogViewer interfaces

* Update OpenApi.json

* Adding github initials to FIXME

* Renaming

* Moving files to Core proj

* Adding GetLogs with skip and take

* Introducing ILogViewerService

* Supressing xml for ILogViewer.GetLogsAsPagedModel()

* Changing to our own Enum representation of LogLevel

* Creating ILogEntry needed for GetPagedLogs()

* Refactoring controllers to use the new logViewerService

* Removing base class methods since those have been moved to the new service

* Removing ErrorCountLogViewerController since the result can be calculated from another endpoint

* Refactoring the MapDefinition because of the new return types from the service

* Update OpenApi.json

* Obsoleting old methods in favor of the ILogViewerService

* Cleanup

* Fixing enum representation as strings for Swagger

* Adding documentation

* Changing enum representation to string in OpenApi.OpenApi.json

* Fix FIXME (use CreatedAtAction)

* Removing JsonStringEnumConverter as there should be another way to fix enum representation for Swagger

* Removing MappingBuilderExtensions and making specific LogViewerBuilderExtensions

* Changes to the .sln file

* Take only the result in the response

* Register the LogViewer extensions

* Update OpenApi.json

* Fix the supressions.xml

* Add inheritdoc

* Remove GetSavedSearchByName as it isn't necessary to introduce it anymore

* Obsolete interfaces

* Rename ViewPermission controller to ValidateLogFileSize

* Make rest of the methods async

* Route name change

* Remove methods obsoletion

* Introduce the "attempt" pattern

* Refactoring of ILogViewerService

* Refactoring controllers

* Another OpenApi.json update

* Adding fixme

* Re-add new client project

Co-authored-by: nikolajlauridsen <nikolajlauridsen@protonmail.ch>
2023-01-25 11:53:42 +01:00
Bjarke Berg 0fd90c1294 Merge remote-tracking branch 'origin/v12/dev' into v13/dev 2023-01-24 12:04:01 +01:00
Kenn JacobsenandGitHub ff2d90d775 Rework dictionary CRUD operations (#13688)
* Rework dictionary CRUD operations

* Update OpenAPI json

* Move responsibility to localization service, introduce new attempt pattern for create and update operations, update unit tests accordingly

* Fix merge

* Rollback assumption that we can map entities from scratch (entity relations got in the way)

* Update OpenAPI JSON

* Add breakage supressions

* Add compat suppressions for integration test project

* Make dictionary item deletion follow same pattern as create and update

* Review comments + update delete to use new pattern

* Update breakage suppressions to match the new Delete method
2023-01-20 13:40:24 +01:00
Bjarke Berg 4be798ddfb Merge remote-tracking branch 'origin/v12/dev' into v13/dev
# Conflicts:
#	src/Umbraco.Infrastructure/Install/PackageMigrationRunner.cs
#	src/Umbraco.Infrastructure/Migrations/IMigrationContext.cs
#	src/Umbraco.Infrastructure/Migrations/IMigrationPlanExecutor.cs
#	src/Umbraco.Infrastructure/Migrations/Install/DatabaseBuilder.cs
#	src/Umbraco.Infrastructure/Migrations/MigrationContext.cs
#	src/Umbraco.Infrastructure/Migrations/MigrationPlan.cs
#	src/Umbraco.Infrastructure/Migrations/MigrationPlanExecutor.cs
#	src/Umbraco.Infrastructure/Migrations/PostMigrations/ClearCsrfCookies.cs
#	src/Umbraco.Infrastructure/Migrations/PostMigrations/DeleteLogViewerQueryFile.cs
#	src/Umbraco.Infrastructure/Migrations/PostMigrations/RebuildPublishedSnapshot.cs
#	src/Umbraco.Infrastructure/Migrations/Upgrade/Upgrader.cs
#	src/Umbraco.Web.BackOffice/Controllers/MacroRenderingController.cs
#	tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Migrations/MigrationPlanTests.cs
#	tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Migrations/PostMigrationTests.cs
2023-01-19 10:43:07 +01:00
9c00c95f01 v13: New Backoffice in CMS (POC) (#13664)
* Added a new executeable to new backoffice

* add new backoffice client as submodule

* add new backoffice client as project

* add bootstrap of backoffice client

* experimentally allow CORS from local vite app running the backoffice

* fix base path

* move new backoffice projects to NewBackoffice folder

* add support for redirect urls to login page (temporary)

* update references to v13

* override databaseinstall/index.cshtml

* copy ignore lines from normal project

* remove redirect to AuthorizeUpgrade

* codeql: checkout submodules

* Section catch-all route

* fixed tests

* remove starter-kit file

* remove grid views

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2023-01-18 15:02:59 +01:00
Kenn JacobsenandGitHub 4640a317b8 Support non-nullable reference types in OpenAPI doc (#13685)
* Refactored ManagementApiComposer into several extension classes

* ADd support for non-nullable reference types in OpenAPI doc

* Update OpenAPI JSON to reflect new (lack of) nullability

* Don't add factories twice :)

* Rework composing + move backoffice route detection for management API to core
2023-01-18 13:11:42 +01:00
Elitsa MarinovskaandGitHub 2c8927c2e9 Rename old FIXME to TODO (#13646)
* Rename old FIXME to TODO, so we can track new FIXME starting v13

* Remove empty TODO
2023-01-18 12:28:54 +01:00
Kenn JacobsenandGitHub de8e307295 Add "is trashed" data for content and media tree controllers (#13687) 2023-01-17 14:04:22 +01:00
Kenn JacobsenandGitHub 25f66e7413 Turn the indexer health status into an enum + rearrange the view models according to controller namespaces (#13686) 2023-01-17 14:04:13 +01:00
13fb2a4f52 New Backoffice: Refactor migrations to allow for unscoped migrations (#13654)
* Remove PostMigrations

These should be replaced with Notification usage

* Remove outer scope from Upgrader

* Remove unececary null check

* Add marker base class for migrations

* Enable scopeless migrations

* Remove unnecessary state check

The final state of the migration is no longer necessarily the final state of the plan.

* Extend ExecutedMigrationPlan

* Ensure that MigrationPlanExecutor.Execute always returns a result.

* Always save final state, regardless of errors

* Remove obsolete Execute

* Add Umbraco specific migration notification

* Publish notification after umbraco migration

* Throw the exception that failed a migration after publishing notification

* Handle notification publishing in DatabaseBuilder

* Fix tests

* Remember to complete scope

* Clean up MigrationPlanExecutor

* Run each package migration in a separate scope

* Add PartialMigrationsTests

* Add unhappy path test

* Fix bug shown by test

* Move PartialMigrationsTests into the correct folder

* Comment out refresh cache in data type migration

Need to add this back again as a notification handler or something.

* Start working on a notification test

* Allow migrations to request a cache rebuild

* Set RebuildCache from MigrateDataTypeConfigurations

* Clean MigrationPlanExecutor

* Add comment explaining the need to partial migration success

* Fix tests

* Allow overriding DefinePlan of UmbracoPlan

This is needed to test the DatabaseBuilder

* Fix notification test

* Don't throw exception to be immediately re-caught

* Assert that scopes notification are always published

* Ensure that scopes are created when requested

* Make test classes internal.

It doesn't really matter, but this way it doesn't show up in intellisense

* Add notification handler for clearing cookies

* Add CompatibilitySuppressions

* Rename Execute to ExecutePlan

We have to do this to be able to obsolete :(

* Update CompatibilitySuppressions

* Update src/Umbraco.Infrastructure/Migrations/MigrationPlanExecutor.cs

Co-authored-by: Bjarke Berg <mail@bergmania.dk>

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2023-01-16 14:52:51 +01:00
01224fce89 Template API for new backoffice (#13642)
* Template query builder API

* Create a dedicated template service (copy template operations from file service)

* CRUD API for templates

* Make file service consume the template service (remove duplicated code)

* Use the template service in the old template controller so we can track changes better (note: this is breaking, but it doesn't matter as the controller will be deleted)

* Add scaffolding to the template API

* Make the route differ between query settings and execution

* Get rid of ugly string constants

* Refactor query execution a little to improve code health

* Fix build checks (compat)

* Deduce the master template from the template contents

* Make template service async, move master template parsing into template service

* Fix open API test

* Make sure the unit tests use new template parsing

* Add FIXME for SetMasterTemplate

* added obsolete attributes

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2023-01-11 14:40:41 +01:00
c81918c9ee Return true if connectionstring configured (#13640)
Signed-off-by: Zeegaan <nge@umbraco.dk>

Signed-off-by: Zeegaan <nge@umbraco.dk>
Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-01-09 08:53:31 +01:00
Bjarke Berg 08c1708730 Merge remote-tracking branch 'origin/v12/dev' into v13/dev
# Conflicts:
#	src/Umbraco.Cms.Api.Management/Controllers/ManagementApiControllerBase.cs
2023-01-06 10:30:58 +01:00
c44fa56661 New backoffice: Data type API (#13633)
* Add PropertyEditorUiAlias to datatype incl. migration for persistence

* Add configuration validation

* Folder CRUD (reusable for other folder trees) + datatype delete + more RESTish response from datatype create and update

* API for datatype references

* Clean up response types, swagger metadata and fix OpenAPI test

* Allow breakage in the build

* Use yield return pattern

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

* Fix incorrect return type from references API

Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
2023-01-06 08:45:06 +01:00
Kenn JacobsenandGitHub a8f070d834 Datatype configuration refactor (#13605)
* Moved refactor from V12 based branch

* Remove obsolete config property to avoid obsoletion warnings

* Clean up test models

* Make the datatype API a little less confusing by introducing explicit models for create and update

* Remame "Configuration" to "Data" to make FE happy :)

* Safeguard deserialization of empty configs

* Less strict number handling for deserialization

* Prepare for data type config migrations

* Attempt to have contextual config serializers

* Update OpenAPI spec with (temporary) data type controller

* Fix unit tests

* Update compat suppressions (allow breakage for datatype and configuration editor)

* Make the duplicate JsonObjectConverter implementation private
2022-12-21 14:29:59 +01:00
6496 changed files with 170979 additions and 387343 deletions
+1
View File
@@ -1,3 +1,4 @@
**/*
!tests/Umbraco.Tests.Integration/bin/**
!tests/Umbraco.Tests.UnitTests/bin/**
**/node_modules
+10
View File
@@ -13,6 +13,16 @@ If the answer is yes, please read on. Otherwise, make sure to head on over [to t
↖️ You can jump to any section by using the "table of contents" button ( ![Table of contents icon](img/tableofcontentsicon.svg) ) above.
## Getting Started:
To run umbraco, we first need to initialize the client git submodule:
* Execute `git submodule update --init` to get the files into Umbraco.Web.UI.Client project
* If you are going to work on the Backoffice, you can either go to the Umbraco.Web.UI.Client folder and check out a new branch or set it up in your IDE, which will allow you to commit to each repository simultaneously:
* **Rider**: Preferences -> Version Control -> Directory Mappings -> Click the '+' sign
* If you get a white page delete Umbraco.Cms.StaticAssets\wwwroot\umbraco folder and run `npm ci && npm run build:for:cms` inside Umbraco.Web.UI.Client folder to clear out any leftover files from older versions.
### Latest version
* If you want to get the latest changes from the client repository, run `git submodule update` again which will pull the latest main branch.
## Debugging source locally
-18
View File
@@ -1,18 +0,0 @@
# New backoffice
> **Warning**:
> This is an early WIP and is set not to be packable since we don't want to release this yet. There will be breaking changes in these projects.
This solution folder contains the projects for the new backoffice. If you're looking to fix or improve the existing CMS, this is not the place to do it, although we do very much appreciate your efforts.
### Project structure
Since the new backoffice API is still very much a work in progress, we've created new projects for the new backoffice API:
* Umbrao.Cms.ManagementApi - The "presentation layer" for the management API
* "New" versions of existing projects, should be merged with the existing projects when the new API is released:
* Umbraco.New.Cms.Core
* Umbraco.New.Cms.Infrastructure
* Umbraco.New.Cms.Web.Common
This also means that we have to use "InternalsVisibleTo" for the new projects since these should be able to access the internal classes since they will when they get merged.
+26 -21
View File
@@ -2,47 +2,52 @@
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](../LICENSE.md)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md)
[![Follow Umbraco on Twitter](https://img.shields.io/badge/Follow-blue?logo=twitter&logoColor=fff)](https://twitter.com/intent/follow?screen_name=umbraco)
![Mastodon Follow](https://img.shields.io/mastodon/follow/110661369750014952?domain=https%3A%2F%2Fumbracocommunity.social)
[![Chat about Umbraco on Discord](https://img.shields.io/discord/869656431308189746?logo=discord&logoColor=fff)](https://discord.gg/umbraco)
[![Read what's going on in the Umbraco Discord chat now](https://img.shields.io/badge/read-discord-blue)](https://discord-chats.umbraco.com)
[![Build status](https://img.shields.io/azure-devops/build/umbraco/Umbraco%2520Cms/301?logo=azurepipelines&label=Azure%20Pipelines)](https://umbraco.visualstudio.com/Umbraco%20Cms/_build?definitionId=301)
[![Open in GitHub Codespaces](https://img.shields.io/badge/Open%20in%20GitHub%20Codespaces-525252?logo=github)](https://github.com/codespaces/new?hide_repo_select=true&ref=contrib&repo=10601208&machine=basicLinux32gb&devcontainer_path=.devcontainer%2Fdevcontainer.json&location=WestEurope)
Umbraco is the friendliest, most flexible and fastest growing ASP.NET CMS, and used by more than 500,000 websites worldwide. Our mission is to help you deliver delightful digital experiences by making Umbraco friendly, simpler and social.
### Umbraco is a free and open source .NET content management system. Our mission is to help you deliver delightful digital experiences by making Umbraco friendly, simpler and social.
Learn more at [umbraco.com](https://umbraco.com)
<p align="center">
<img src="img/logo.png" alt="Umbraco Logo" />
<img src="img/logo.png" alt="Umbraco Logo" />
</p>
See the official [Umbraco website](https://umbraco.com) for an introduction, core mission and values of the product and team behind it.
## <a name="install"></a>Looking to install Umbraco?
- [Getting Started](#getting-started)
- [Documentation](#documentation)
- [Community](#join-the-umbraco-community)
- [Contributing](#contributing)
You can get started using the following commands on Windows, Linux and MacOS (after installing the [.NET Runtime and SDK](https://docs.umbraco.com/umbraco-cms/fundamentals/setup/requirements)):
Please also see our [Code of Conduct](https://github.com/umbraco/.github/blob/main/.github/CODE_OF_CONDUCT.md).
## Getting Started
[Umbraco Cloud](https://umbraco.com/cloud) is the easiest and fastest way to use Umbraco yet, with full support for all your custom .NET code and integrations. You're up and running in less than a minute, and your life will be made easier with automated upgrades and a built-in deployment engine. We offer a free 14-day trial, no credit card needed.
If you want to DIY, then you can [download Umbraco]((https://our.umbraco.com/download)) either as a ZIP file or via NuGet. It's the same version of Umbraco CMS that powers Umbraco Cloud, but you'll need to find a place to host it yourself, and handling deployments and upgrades will be all up to you.
```
dotnet new install Umbraco.Templates
dotnet new umbraco --name MyProject
cd MyProject
dotnet run
```
## Documentation
The documentation for Umbraco CMS can be found [on Our Umbraco](https://docs.umbraco.com/). The source for the Umbraco docs is [open source as well](https://github.com/umbraco/UmbracoDocs) and we're happy to look at your documentation contributions.
Our [comprehensive documentation](https://docs.umbraco.com/umbraco-cms) takes you from the fundamentals on how to start with Umbraco to deploying it to production.
## Join the Umbraco community
Some important documentation links to get you started:
Our friendly community is available 24/7 at the community hub, we call ["Our Umbraco"](https://our.umbraco.com/). Our Umbraco features forums for questions and answers, documentation, downloadable plugins for Umbraco, and a rich collection of community resources.
- [Installing Umbraco CMS](https://docs.umbraco.com/umbraco-cms/fundamentals/setup/install)
- [Getting to know Umbraco](https://docs.umbraco.com/umbraco-cms/fundamentals/get-to-know-umbraco)
- [Tutorials for creating a basic website and customizing the editing experience](https://docs.umbraco.com/umbraco-cms/tutorials/overview)
Besides "Our", we all support each other in our [Community Discord Server](https://discord.gg/umbraco) and on Twitter: [Umbraco HQ](https://twitter.com/umbraco), [Release Updates](https://twitter.com/umbracoproject), [#umbraco](https://twitter.com/hashtag/umbraco)
## Get help
If you need a bit of feedback while building your Umbraco projects, we are [chatty on Discord](https://discord.umbraco.com). Our Discord server serves both a social space but also has channels for questions and answers. Feel free to lurk or join in with your own questions. Or just post your daily Wordle score, up to you!
## Looking to contribute back to Umbraco?
## Contributing
You came to the right place! Our GitHub repository is available for all kinds of contributions:
- [Create a bug report](https://github.com/umbraco/Umbraco-CMS/issues)
- [Create a feature request](https://github.com/umbraco/Umbraco-CMS/discussions)
Umbraco is contribution-focused and community-driven. If you want to contribute back to the Umbraco source code, please check out our [guide to contributing](CONTRIBUTING.md).
### Tip: You should not run Umbraco from source code found here. Umbraco is extremely extensible and can do whatever you need. Instead, [install Umbraco as noted above](#looking-to-install-umbraco) and then [extend it any way you want to](https://docs.umbraco.com/umbraco-cms/extending/).
+38
View File
@@ -0,0 +1,38 @@
# .github/release.yml
changelog:
exclude:
labels:
- ignore-for-release
- duplicate
- wontfix
categories:
- title: 🙌 Notable Changes
labels:
- category/notable
- title: 💥 Breaking Changes
labels:
- category/breaking
- title: 🐛 Bug Fixes
labels:
- type/bug
- category/bug
- type/improvement
- title: 📄 Documentation
labels:
- category/documentation
- title: 🏠 Internal
labels:
- internal
- title: 📦 Dependencies
labels:
- dependencies
- title: 🌈 A11Y
labels:
- category/accessibility
- title: 🚀 New Features
labels:
- type/feature
- title: Other Changes
labels:
- '*'
+2
View File
@@ -23,6 +23,7 @@ env:
DOTNET_GENERATE_ASPNET_CERTIFICATE: false
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
NODE_OPTIONS: --max_old_space_size=16384
jobs:
CodeQL-Build:
@@ -37,6 +38,7 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: true
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
+11 -5
View File
@@ -50,10 +50,6 @@ tools/docfx/
# Ignore rule for clearing out Belle (avoid rebuilding all the time)
preserve.belle
# Ignore rule for output of generated documentation files from grunt docserve
/src/Umbraco.Web.UI.Docs/api/
/src/Umbraco.Web.UI.Docs/package-lock.json
# csharp-docs
/build/csharp-docs/api/
/build/csharp-docs/_site/
@@ -68,7 +64,13 @@ preserve.belle
/build/docs.zip
/build/ui-docs.zip
/build/csharp-docs.zip
/src/Umbraco.Cms.StaticAssets/wwwroot/umbraco/
/src/Umbraco.Cms.StaticAssets/wwwroot/umbraco/auth
/src/Umbraco.Cms.StaticAssets/wwwroot/umbraco/backoffice
/src/Umbraco.Cms.StaticAssets/wwwroot/umbraco/assets
/src/Umbraco.Cms.StaticAssets/wwwroot/umbraco/js
/src/Umbraco.Cms.StaticAssets/wwwroot/umbraco/lib
/src/Umbraco.Cms.StaticAssets/wwwroot/umbraco/views
/src/Umbraco.Cms.StaticAssets/wwwroot/umbraco/login
# Environment specific data
/src/Umbraco.Web.UI.Client/[Bb]uild/
@@ -91,6 +93,7 @@ preserve.belle
# Tests
/tests/Umbraco.Tests.AcceptanceTest/.env
/tests/Umbraco.Tests.AcceptanceTest/playwright/.auth
/tests/Umbraco.Tests.Integration.SqlCe/DatabaseContextTests.sdf
/tests/Umbraco.Tests.Integration.SqlCe/[Uu]mbraco/[Dd]ata/TEMP/
/tests/Umbraco.Tests.Integration/appsettings.Tests.Local.json
@@ -103,10 +106,13 @@ preserve.belle
# Ignore auto-generated schema
/src/Umbraco.Cms.Targets/tasks/
/src/Umbraco.Cms.Targets/appsettings-schema.*.json
/src/Umbraco.Cms.Targets/umbraco-package-schema.json
/src/Umbraco.Web.UI/appsettings-schema.json
/src/Umbraco.Web.UI/appsettings-schema.*.json
/src/Umbraco.Web.UI/umbraco-package-schema.json
/tests/Umbraco.Tests.Integration/appsettings-schema.json
/tests/Umbraco.Tests.Integration/appsettings-schema.*.json
/tests/Umbraco.Tests.Integration/umbraco-package-schema.json
/src/Umbraco.Cms/appsettings-schema.json
playwright-report
trace.zip
+3
View File
@@ -0,0 +1,3 @@
[submodule "src/Umbraco.Web.UI.Client"]
path = src/Umbraco.Web.UI.Client
url = https://github.com/umbraco/Umbraco.CMS.Backoffice.git
+2 -1
View File
@@ -14,6 +14,7 @@
<NeutralLanguage>en-US</NeutralLanguage>
<Nullable>enable</Nullable>
<WarningsAsErrors>nullable</WarningsAsErrors>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<ImplicitUsings>enable</ImplicitUsings>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<WarnOnPackingNonPackableProject>false</WarnOnPackingNonPackableProject>
@@ -30,7 +31,7 @@
<PropertyGroup>
<GenerateCompatibilitySuppressionFile>false</GenerateCompatibilitySuppressionFile>
<EnablePackageValidation>true</EnablePackageValidation>
<PackageValidationBaselineVersion>13.0.0</PackageValidationBaselineVersion>
<PackageValidationBaselineVersion>14.0.0</PackageValidationBaselineVersion>
<EnableStrictModeForCompatibleFrameworksInPackage>true</EnableStrictModeForCompatibleFrameworksInPackage>
<EnableStrictModeForCompatibleTfms>true</EnableStrictModeForCompatibleTfms>
</PropertyGroup>
+9 -17
View File
@@ -6,7 +6,7 @@
<!-- Global packages (private, build-time packages for all projects) -->
<ItemGroup>
<GlobalPackageReference Include="Nerdbank.GitVersioning" Version="3.6.139" />
<GlobalPackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.507" />
<GlobalPackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.556" />
<GlobalPackageReference Include="Umbraco.Code" Version="2.2.0" />
<GlobalPackageReference Include="Umbraco.GitVersioning.Extensions" Version="0.2.0" />
</ItemGroup>
@@ -20,6 +20,7 @@
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.11" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.11" />
<PackageVersion Include="Microsoft.Extensions.Caching.Abstractions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="8.0.1" />
@@ -33,7 +34,6 @@
<PackageVersion Include="Microsoft.Extensions.Options" Version="8.0.2" />
<PackageVersion Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Options.DataAnnotations" Version="8.0.0" />
<PackageVersion Include="System.Runtime.Caching" Version="8.0.1" />
</ItemGroup>
<!-- Umbraco packages -->
<ItemGroup>
@@ -42,12 +42,13 @@
</ItemGroup>
<!-- Third-party packages -->
<ItemGroup>
<PackageVersion Include="Asp.Versioning.Mvc" Version="7.1.1" />
<PackageVersion Include="Asp.Versioning.Mvc.ApiExplorer" Version="7.1.0" />
<PackageVersion Include="Asp.Versioning.Mvc" Version="8.1.0" />
<PackageVersion Include="Asp.Versioning.Mvc.ApiExplorer" Version="8.1.0" />
<PackageVersion Include="Dazinator.Extensions.FileProviders" Version="2.0.0" />
<PackageVersion Include="Examine" Version="3.5.0" />
<PackageVersion Include="Examine.Core" Version="3.5.0" />
<PackageVersion Include="HtmlAgilityPack" Version="1.11.71" />
<PackageVersion Include="JsonPatch.Net" Version="3.1.1" />
<PackageVersion Include="K4os.Compression.LZ4" Version="1.3.8" />
<PackageVersion Include="MailKit" Version="4.8.0" />
<PackageVersion Include="Markdown" Version="2.2.1" />
@@ -55,12 +56,11 @@
<PackageVersion Include="MiniProfiler.AspNetCore.Mvc" Version="4.3.8" />
<PackageVersion Include="MiniProfiler.Shared" Version="4.3.8" />
<PackageVersion Include="ncrontab" Version="3.3.3" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
<PackageVersion Include="NPoco" Version="5.7.1" />
<PackageVersion Include="NPoco.SqlServer" Version="5.7.1" />
<PackageVersion Include="OpenIddict.Abstractions" Version="4.10.1" />
<PackageVersion Include="OpenIddict.AspNetCore" Version="4.10.1" />
<PackageVersion Include="OpenIddict.EntityFrameworkCore" Version="4.10.1" />
<PackageVersion Include="OpenIddict.Abstractions" Version="5.7.0" />
<PackageVersion Include="OpenIddict.AspNetCore" Version="5.7.0" />
<PackageVersion Include="OpenIddict.EntityFrameworkCore" Version="5.7.0" />
<PackageVersion Include="Serilog" Version="3.1.1" />
<PackageVersion Include="Serilog.AspNetCore" Version="8.0.3" />
<PackageVersion Include="Serilog.Enrichers.Process" Version="2.0.2" />
@@ -73,10 +73,8 @@
<PackageVersion Include="Serilog.Sinks.Async" Version="1.5.0" />
<PackageVersion Include="Serilog.Sinks.File" Version="5.0.0" />
<PackageVersion Include="Serilog.Sinks.Map" Version="1.0.2" />
<PackageVersion Include="SixLabors.ImageSharp" Version="3.1.6" />
<PackageVersion Include="SixLabors.ImageSharp" Version="3.1.7" />
<PackageVersion Include="SixLabors.ImageSharp.Web" Version="3.1.3" />
<PackageVersion Include="Smidge.InMemory" Version="4.4.0" />
<PackageVersion Include="Smidge.Nuglify" Version="4.5.1" />
<PackageVersion Include="Swashbuckle.AspNetCore" Version="6.9.0" />
</ItemGroup>
<!-- Transitive pinned versions (only required because our direct dependencies have vulnerable versions of transitive dependencies) -->
@@ -93,11 +91,5 @@
<PackageVersion Include="Microsoft.IdentityModel.JsonWebTokens" Version="7.7.1" />
<!-- Examine.Lucene bring in a vulnerable version of Lucene.Net.Replicator -->
<PackageVersion Include="Lucene.Net.Replicator" Version="4.8.0-beta00017" />
<!-- Both OpenIddict.AspNetCore, Microsoft.EntityFrameworkCore.* bring in a vulnerable version of Microsoft.Extensions.Caching.Memory -->
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="8.0.1" />
<!-- Both Azure.Identity, Microsoft.EntityFrameworkCore.SqlServer,NPoco.SqlServer, and more bring in a vulnerable version of System.Text.Json -->
<PackageVersion Include="System.Text.Json" Version="8.0.5" />
<!-- Both Microsoft.EntityFrameworkCore.SqlServer and NPoco.SqlServer bring in a vulnerable version of Microsoft.Data.SqlClient -->
<PackageVersion Include="Microsoft.Data.SqlClient" Version="5.2.2" />
</ItemGroup>
</Project>
+197 -136
View File
@@ -5,8 +5,8 @@ parameters:
displayName: Run SQL Server Integration Tests
type: boolean
default: false
- name: sqlServerAcceptanceTests
displayName: Run SQL Server Acceptance Tests
- name: sqlServerLinuxAcceptanceTests
displayName: Run SQL Server Linux Acceptance Tests
type: boolean
default: false
- name: myGetDeploy
@@ -17,6 +17,10 @@ parameters:
displayName: Deploy to NuGet
type: boolean
default: false
- name: npmDeploy
displayName: Deploy to Npm
type: boolean
default: false
- name: buildApiDocs
displayName: Build API docs
type: boolean
@@ -59,64 +63,36 @@ variables:
DOTNET_GENERATE_ASPNET_CERTIFICATE: false
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
npm_config_cache: $(Pipeline.Workspace)/.npm_client
NODE_OPTIONS: --max_old_space_size=16384
stages:
###############################################
## Build
###############################################
- stage: Build
variables:
npm_config_cache: $(Pipeline.Workspace)/.npm_client
jobs:
- job: A
displayName: Build Umbraco CMS
pool:
vmImage: 'ubuntu-latest'
vmImage: 'windows-latest'
steps:
- checkout: self
submodules: false
lfs: false,
fetchDepth: 500
- task: NodeTool@0
displayName: Use Node.js $(nodeVersion)
retryCountOnTaskFailure: 3
inputs:
versionSpec: $(nodeVersion)
- task: Cache@2
displayName: Cache node_modules
inputs:
key: '"npm_client" | "$(Agent.OS)" | $(Build.SourcesDirectory)/src/Umbraco.Web.UI.Client/package-lock.json'
restoreKeys: |
"npm_client" | "$(Agent.OS)"
"npm_client"
path: $(npm_config_cache)
- script: npm ci --no-fund --no-audit --prefer-offline
workingDirectory: src/Umbraco.Web.UI.Client
displayName: Run npm ci (Backoffice)
- task: gulp@0
displayName: Run gulp build (Backoffice)
inputs:
gulpFile: src/Umbraco.Web.UI.Client/gulpfile.js
targets: coreBuild
workingDirectory: src/Umbraco.Web.UI.Client
- task: npm@1
displayName: Run npm ci (Login)
inputs:
command: custom
workingDir: src/Umbraco.Web.UI.Login
verbose: false
customCommand: ci
- task: npm@1
displayName: Run npm build (Login)
inputs:
command: custom
workingDir: src/Umbraco.Web.UI.Login
verbose: false
customCommand: run build
submodules: true
- task: UseDotNet@2
displayName: Use .NET SDK from global.json
inputs:
useGlobalJson: true
- template: templates/backoffice-install.yml
- script: npm run build:for:cms
displayName: Run build (Bellissima)
workingDirectory: src/Umbraco.Web.UI.Client
- script: npm ci --no-fund --no-audit --prefer-offline
displayName: Run npm ci (Login)
workingDirectory: src/Umbraco.Web.UI.Login
- script: npm run build
displayName: Run npm build (Login)
workingDirectory: src/Umbraco.Web.UI.Login
- task: DotNetCoreCLI@2
displayName: Run dotnet restore
inputs:
@@ -140,6 +116,31 @@ stages:
targetPath: $(Build.SourcesDirectory)
artifactName: build_output
- job: B
displayName: Build Bellissima Package
pool:
vmImage: 'ubuntu-latest'
steps:
- checkout: self
submodules: true
- template: templates/backoffice-install.yml
- script: npm run build:for:npm
displayName: Run build:for:npm
workingDirectory: src/Umbraco.Web.UI.Client
- bash: |
echo "##[command]Running npm pack"
echo "##[debug]Output directory: $(Build.ArtifactStagingDirectory)"
mkdir $(Build.ArtifactStagingDirectory)/npm
npm pack --pack-destination $(Build.ArtifactStagingDirectory)/npm
mv .npmrc $(Build.ArtifactStagingDirectory)/npm/
displayName: Run npm pack
workingDirectory: src/Umbraco.Web.UI.Client
- task: PublishPipelineArtifact@1
displayName: Publish Bellissima npm artifact
inputs:
targetPath: $(Build.ArtifactStagingDirectory)/npm
artifactName: npm
- stage: Build_Docs
condition: and(succeeded(), or(eq(dependencies.Build.outputs['A.build.NBGV_PublicRelease'], 'True'), ${{parameters.buildApiDocs}}))
displayName: Prepare API Documentation
@@ -201,41 +202,45 @@ stages:
displayName: Build js API Reference
pool:
vmImage: 'ubuntu-latest'
variables:
BASE_PATH: /v$(umbracoMajorVersion)/ui
steps:
- checkout: self
submodules: false
lfs: false,
fetchDepth: 1
fetchFilter: tree:0
- task: NodeTool@0
displayName: Use Node.js 10.15.x
retryCountOnTaskFailure: 3
inputs:
versionSpec: 10.15.x # Won't work with higher versions
- script: |
npm ci --no-fund --no-audit --prefer-offline
npx gulp docs
major="$(umbracoMajorVersion)"
echo "major version: $major"
baseUrl="https://apidocs.umbraco.com/v$major/ui/"
echo "baseUrl: $baseUrl"
sed -i "s|baseUrl = .*|baseUrl = '$baseUrl',|" api/index.html
displayName: Generate js Docs
workingDirectory: $(Build.SourcesDirectory)/src/Umbraco.Web.UI.Docs
submodules: true
- template: templates/backoffice-install.yml
- script: npm run storybook:build
displayName: Build Storybook
env:
VITE_BASE_PATH: $(BASE_PATH)/
workingDirectory: $(Build.SourcesDirectory)/src/Umbraco.Web.UI.Client
- script: sed -i "s|/umbraco/backoffice|$(BASE_PATH)/umbraco/backoffice|" assets/*.js
displayName: Replace BASE_PATH on assets
workingDirectory: $(Build.SourcesDirectory)/src/Umbraco.Web.UI.Client/storybook-static
- task: ArchiveFiles@2
displayName: Archive js Docs
displayName: Archive Storybook
inputs:
rootFolderOrFile: $(Build.SourcesDirectory)/src/Umbraco.Web.UI.Docs/api
rootFolderOrFile: $(Build.SourcesDirectory)/src/Umbraco.Web.UI.Client/storybook-static
includeRootFolder: false
archiveFile: $(Build.ArtifactStagingDirectory)/ui-docs.zip
- task: PublishPipelineArtifact@1
displayName: Publish js Docs
displayName: Publish Storybook
inputs:
targetPath: $(Build.ArtifactStagingDirectory)/ui-docs.zip
artifact: ui-docs
- script: npm run generate:ui-api-docs
displayName: Generate API Docs
workingDirectory: $(Build.SourcesDirectory)/src/Umbraco.Web.UI.Client
- task: ArchiveFiles@2
displayName: Archive UI API Docs
inputs:
rootFolderOrFile: $(Build.SourcesDirectory)/src/Umbraco.Web.UI.Client/ui-api
includeRootFolder: false
archiveFile: $(Build.ArtifactStagingDirectory)/ui-api-docs.zip
- task: PublishPipelineArtifact@1
displayName: Publish UI API Docs
inputs:
targetPath: $(Build.ArtifactStagingDirectory)/ui-api-docs.zip
artifact: ui-api-docs
###############################################
## Test
@@ -258,11 +263,6 @@ stages:
pool:
vmImage: $(vmImage)
steps:
- checkout: self
submodules: false
lfs: false,
fetchDepth: 1
fetchFilter: tree:0
- task: DownloadPipelineArtifact@2
displayName: Download build artifacts
inputs:
@@ -302,11 +302,6 @@ stages:
variables:
Tests__Database__DatabaseType: 'Sqlite'
steps:
- checkout: self
submodules: false
lfs: false,
fetchDepth: 1
fetchFilter: tree:0
# Setup test environment
- task: DownloadPipelineArtifact@2
displayName: Download build artifacts
@@ -337,8 +332,9 @@ stages:
# Integration Tests (SQL Server)
- job:
timeoutInMinutes: 120
condition: or(eq(stageDependencies.Build.A.outputs['build.NBGV_PublicRelease'], 'True'), ${{parameters.sqlServerIntegrationTests}})
timeoutInMinutes: 180
# condition: or(eq(stageDependencies.Build.A.outputs['build.NBGV_PublicRelease'], 'True'), ${{parameters.sqlServerIntegrationTests}}) # Outcommented due to timeouts
condition: eq(${{parameters.sqlServerIntegrationTests}}, True)
displayName: Integration Tests (SQL Server)
strategy:
matrix:
@@ -434,24 +430,10 @@ stages:
CONNECTIONSTRINGS__UMBRACODBDSN_PROVIDERNAME: Microsoft.Data.Sqlite
strategy:
matrix:
LinuxPart1Of3:
vmImage: "ubuntu-latest"
testCommand: "npm run test -- --shard=1/3"
LinuxPart2Of3:
vmImage: "ubuntu-latest"
testCommand: "npm run test -- --shard=2/3"
LinuxPart3Of3:
vmImage: "ubuntu-latest"
testCommand: "npm run test -- --shard=3/3"
WindowsPart1Of3:
vmImage: "windows-latest"
testCommand: "npm run test -- --shard=1/3"
WindowsPart2Of3:
vmImage: "windows-latest"
testCommand: "npm run test -- --shard=2/3"
WindowsPart3Of3:
vmImage: "windows-latest"
testCommand: "npm run test -- --shard=3/3"
Linux:
vmImage: 'ubuntu-latest'
Windows:
vmImage: 'windows-latest'
pool:
vmImage: $(vmImage)
steps:
@@ -476,7 +458,8 @@ stages:
- pwsh: |
"UMBRACO_USER_LOGIN=$(UMBRACO__CMS__UNATTENDED__UNATTENDEDUSEREMAIL)
UMBRACO_USER_PASSWORD=$(UMBRACO__CMS__UNATTENDED__UNATTENDEDUSERPASSWORD)
URL=$(ASPNETCORE_URLS)" | Out-File .env
URL=$(ASPNETCORE_URLS)
STORAGE_STAGE_PATH=$(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/playwright/.auth/user.json" | Out-File .env
displayName: Generate .env
workingDirectory: $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest
@@ -523,6 +506,10 @@ stages:
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
workingDirectory: $(Agent.BuildDirectory)/app
# Ensures we have the package wait-on installed
- pwsh: npm install wait-on
displayName: Install wait-on package
# Wait for application to start responding to requests
- pwsh: npx wait-on -v --interval 1000 --timeout 120000 $(ASPNETCORE_URLS)
displayName: Wait for application
@@ -534,7 +521,7 @@ stages:
workingDirectory: tests/Umbraco.Tests.AcceptanceTest
# Test
- pwsh: $(testCommand)
- pwsh: npm run smokeTestSqlite --ignore-certificate-errors
displayName: Run Playwright tests
continueOnError: true
workingDirectory: tests/Umbraco.Tests.AcceptanceTest
@@ -555,7 +542,7 @@ stages:
# Copy artifacts
- pwsh: |
if (Test-Path tests/Umbraco.Tests.AcceptanceTest/results/*) {
Copy-Item tests/Umbraco.Tests.AcceptanceTest/results/* $(Build.ArtifactStagingDirectory) -Recurse
Copy-Item tests/Umbraco.Tests.AcceptanceTest/results $(Build.ArtifactStagingDirectory) -Recurse
}
displayName: Copy Playwright results
condition: succeededOrFailed()
@@ -566,40 +553,23 @@ stages:
condition: succeededOrFailed()
inputs:
targetPath: $(Build.ArtifactStagingDirectory)
artifact: "Acceptance Test Results - $(Agent.JobName) - Attempt #$(System.JobAttempt)"
artifact: 'Acceptance Tests - $(Agent.JobName) - Attempt #$(System.JobAttempt)'
- job:
displayName: E2E Tests (SQL Server)
condition: or(eq(stageDependencies.Build.A.outputs['build.NBGV_PublicRelease'], 'True'), ${{parameters.sqlServerAcceptanceTests}})
variables:
# Connection string
CONNECTIONSTRINGS__UMBRACODBDSN: Data Source=(localdb)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\Umbraco.mdf;Integrated Security=True
CONNECTIONSTRINGS__UMBRACODBDSN_PROVIDERNAME: Microsoft.Data.SqlClient
strategy:
matrix:
LinuxPart1Of3:
testCommand: "npm run testSqlite -- --shard=1/3"
vmImage: "ubuntu-latest"
SA_PASSWORD: $(UMBRACO__CMS__UNATTENDED__UNATTENDEDUSERPASSWORD)
CONNECTIONSTRINGS__UMBRACODBDSN: "Server=(local);Database=Umbraco;User Id=sa;Password=$(SA_PASSWORD);TrustServerCertificate=True"
LinuxPart2Of3:
testCommand: "npm run testSqlite -- --shard=2/3"
vmImage: "ubuntu-latest"
SA_PASSWORD: $(UMBRACO__CMS__UNATTENDED__UNATTENDEDUSERPASSWORD)
CONNECTIONSTRINGS__UMBRACODBDSN: "Server=(local);Database=Umbraco;User Id=sa;Password=$(SA_PASSWORD);TrustServerCertificate=True"
LinuxPart3Of3:
testCommand: "npm run testSqlite -- --shard=3/3"
vmImage: "ubuntu-latest"
SA_PASSWORD: $(UMBRACO__CMS__UNATTENDED__UNATTENDEDUSERPASSWORD)
CONNECTIONSTRINGS__UMBRACODBDSN: "Server=(local);Database=Umbraco;User Id=sa;Password=$(SA_PASSWORD);TrustServerCertificate=True"
WindowsPart1Of3:
vmImage: "windows-latest"
testCommand: "npm run testSqlite -- --shard=1/3"
WindowsPart2Of3:
vmImage: "windows-latest"
testCommand: "npm run testSqlite -- --shard=2/3"
WindowsPart3Of3:
vmImage: "windows-latest"
testCommand: "npm run testSqlite -- --shard=3/3"
${{ if eq(parameters.sqlServerLinuxAcceptanceTests, True) }} :
Linux:
vmImage: 'ubuntu-latest'
SA_PASSWORD: $(UMBRACO__CMS__UNATTENDED__UNATTENDEDUSERPASSWORD)
CONNECTIONSTRINGS__UMBRACODBDSN: 'Server=(local);Database=Umbraco;User Id=sa;Password=$(SA_PASSWORD);TrustServerCertificate=True'
Windows:
vmImage: 'windows-latest'
pool:
vmImage: $(vmImage)
steps:
@@ -623,7 +593,8 @@ stages:
- pwsh: |
"UMBRACO_USER_LOGIN=$(UMBRACO__CMS__UNATTENDED__UNATTENDEDUSEREMAIL)
UMBRACO_USER_PASSWORD=$(UMBRACO__CMS__UNATTENDED__UNATTENDEDUSERPASSWORD)
URL=$(ASPNETCORE_URLS)" | Out-File .env
URL=$(ASPNETCORE_URLS)
STORAGE_STAGE_PATH=$(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/playwright/.auth/user.json" | Out-File .env
displayName: Generate .env
workingDirectory: $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest
@@ -690,7 +661,7 @@ stages:
workingDirectory: tests/Umbraco.Tests.AcceptanceTest
# Test
- pwsh: $(testCommand)
- pwsh: npm run smokeTest --ignore-certificate-errors
displayName: Run Playwright tests
continueOnError: true
workingDirectory: tests/Umbraco.Tests.AcceptanceTest
@@ -720,7 +691,7 @@ stages:
# Copy artifacts
- pwsh: |
if (Test-Path tests/Umbraco.Tests.AcceptanceTest/results/*) {
Copy-Item tests/Umbraco.Tests.AcceptanceTest/results/* $(Build.ArtifactStagingDirectory) -Recurse
Copy-Item tests/Umbraco.Tests.AcceptanceTest/results $(Build.ArtifactStagingDirectory) -Recurse
}
displayName: Copy Playwright results
condition: succeededOrFailed()
@@ -731,7 +702,7 @@ stages:
condition: succeededOrFailed()
inputs:
targetPath: $(Build.ArtifactStagingDirectory)
artifact: "Acceptance Test Results - $(Agent.JobName) - Attempt #$(System.JobAttempt)"
artifact: 'Acceptance Tests - $(Agent.JobName) - Attempt #$(System.JobAttempt)'
###############################################
## Release
@@ -741,7 +712,7 @@ stages:
dependsOn:
- Unit
- Integration
# - E2E # TODO: Enable when stable.
# - E2E
condition: and(succeeded(), or(eq(dependencies.Build.outputs['A.build.NBGV_PublicRelease'], 'True'), ${{parameters.myGetDeploy}}))
jobs:
- job:
@@ -763,6 +734,41 @@ stages:
publishFeedCredentials: 'MyGet - Umbraco Nightly'
${{ else }}:
publishFeedCredentials: 'MyGet - Pre-releases'
- job:
displayName: Push to pre-release feed (npm)
steps:
- checkout: none
- download: current
artifact: npm
- bash: |
# Check if we are on a nightly build
if [ $isNightly = "False" ]; then
echo "##[debug]Prerelease build detected"
registry="https://www.myget.org/F/umbracoprereleases/npm/"
else
echo "##[debug]Nightly build detected"
registry="https://www.myget.org/F/umbraconightly/npm/"
fi
echo "@umbraco-cms:registry=$registry" >> .npmrc
env:
isNightly: ${{parameters.isNightly}}
workingDirectory: $(Pipeline.Workspace)/npm
displayName: Add scoped registry to .npmrc
- task: npmAuthenticate@0
displayName: Authenticate with npm (MyGet)
inputs:
workingFile: '$(Pipeline.Workspace)/npm/.npmrc'
customEndpoint: 'MyGet (npm) - Umbracoprereleases, MyGet (npm) - Umbraconightly'
- bash: |
# Setup temp npm project to load in defaults from the local .npmrc
npm init -y
# Find the first .tgz file in the current directory and publish it
files=( ./*.tgz )
npm publish "${files[0]}"
displayName: Push to npm (MyGet)
workingDirectory: $(Pipeline.Workspace)/npm
- stage: Deploy_NuGet
displayName: NuGet release
dependsOn:
@@ -787,12 +793,42 @@ stages:
nuGetFeedType: 'external'
publishFeedCredentials: 'NuGet - Umbraco.*'
- stage: Deploy_Npm
displayName: Npm release
condition: and(succeeded(), or(eq(dependencies.Build.outputs['A.build.NBGV_PublicRelease'], 'True'), ${{parameters.npmDeploy}}))
dependsOn:
- Deploy_NuGet
jobs:
- job: Publish
displayName: Push to NPM
steps:
- checkout: none
- download: current
artifact: npm
- bash: echo "@umbraco-cms:registry=https://registry.npmjs.org" >> .npmrc
workingDirectory: $(Pipeline.Workspace)/npm
displayName: Add scoped registry to .npmrc
- task: npmAuthenticate@0
displayName: Authenticate with npm
inputs:
workingFile: $(Pipeline.Workspace)/npm/.npmrc
customEndpoint: 'NPM - Umbraco Backoffice'
- script: |
# Setup temp npm project to load in defaults from the local .npmrc
npm init -y
# Find the first .tgz file in the current directory and publish it
files=( ./*.tgz )
npm publish "${files[0]}"
displayName: Push to npm
workingDirectory: $(Pipeline.Workspace)/npm
- stage: Upload_API_Docs
pool:
vmImage: 'windows-latest' # Apparently AzureFileCopy is windows only :(
variables:
umbracoMajorVersion: $[ stageDependencies.Build.A.outputs['build.NBGV_VersionMajor'] ]
displayName: Upload API Documention
displayName: Upload API Documentation
dependsOn:
- Build
- Deploy_NuGet
@@ -820,8 +856,9 @@ stages:
storage: umbracoapidocs
ContainerName: '$web'
BlobPrefix: v$(umbracoMajorVersion)/csharp
CleanTargetBeforeCopy: true
- job:
displayName: Upload js Docs
displayName: Upload Storybook
steps:
- checkout: none
- task: DownloadPipelineArtifact@2
@@ -834,7 +871,7 @@ stages:
archiveFilePatterns: $(Build.SourcesDirectory)/ui-docs.zip
destinationFolder: $(Build.ArtifactStagingDirectory)/ui-docs
- task: AzureFileCopy@4
displayName: 'Copy UI Docs to blob storage'
displayName: 'Copy Storybook to blob storage'
inputs:
SourcePath: '$(Build.ArtifactStagingDirectory)/ui-docs/*'
azureSubscription: umbraco-storage
@@ -842,3 +879,27 @@ stages:
storage: umbracoapidocs
ContainerName: '$web'
BlobPrefix: v$(umbracoMajorVersion)/ui
CleanTargetBeforeCopy: true
- job:
displayName: Upload UI API Docs
steps:
- checkout: none
- task: DownloadPipelineArtifact@2
displayName: Download artifact
inputs:
artifact: ui-api-docs
path: $(Build.SourcesDirectory)
- task: ExtractFiles@1
inputs:
archiveFilePatterns: $(Build.SourcesDirectory)/ui-api-docs.zip
destinationFolder: $(Build.ArtifactStagingDirectory)/ui-api-docs
- task: AzureFileCopy@4
displayName: 'Copy UI API Docs to blob storage'
inputs:
SourcePath: '$(Build.ArtifactStagingDirectory)/ui-api-docs/*'
azureSubscription: umbraco-storage
Destination: AzureBlob
storage: umbracoapidocs
ContainerName: '$web'
BlobPrefix: v$(umbracoMajorVersion)/ui-api
CleanTargetBeforeCopy: true
+399
View File
@@ -0,0 +1,399 @@
name: Nightly_E2E_Test_$(TeamProject)_$(Build.DefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r)
pr: none
trigger: none
# schedules:
# - cron: '0 0 * * *'
# displayName: Daily midnight build
# branches:
# include:
# - v14/dev
variables:
nodeVersion: 20
solution: umbraco.sln
buildConfiguration: Release
UMBRACO__CMS__GLOBAL__ID: 00000000-0000-0000-0000-000000000042
DOTNET_NOLOGO: true
DOTNET_GENERATE_ASPNET_CERTIFICATE: false
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
npm_config_cache: $(Pipeline.Workspace)/.npm_client
NODE_OPTIONS: --max_old_space_size=16384
parameters:
- name: runSmokeTests
displayName: Run the smoke tests
type: boolean
default: false
stages:
###############################################
## Build
###############################################
- stage: Build
jobs:
- job: A
displayName: Build Umbraco CMS
pool:
vmImage: 'ubuntu-latest'
steps:
- checkout: self
fetchDepth: 0
submodules: true
- task: UseDotNet@2
displayName: Use .NET SDK from global.json
inputs:
useGlobalJson: true
- template: templates/backoffice-install.yml
- script: npm run build:for:cms
displayName: Run build (Bellissima)
workingDirectory: src/Umbraco.Web.UI.Client
- script: npm ci --no-fund --no-audit --prefer-offline
displayName: Run npm ci (Login)
workingDirectory: src/Umbraco.Web.UI.Login
- script: npm run build
displayName: Run npm build (Login)
workingDirectory: src/Umbraco.Web.UI.Login
- task: DotNetCoreCLI@2
displayName: Run dotnet restore
inputs:
command: restore
projects: $(solution)
- task: DotNetCoreCLI@2
name: build
displayName: Run dotnet build and generate NuGet packages
inputs:
command: build
projects: $(solution)
arguments: '--configuration $(buildConfiguration) --no-restore --property:ContinuousIntegrationBuild=true --property:GeneratePackageOnBuild=true --property:PackageOutputPath=$(Build.ArtifactStagingDirectory)/nupkg'
- task: PublishPipelineArtifact@1
displayName: Publish nupkg
inputs:
targetPath: $(Build.ArtifactStagingDirectory)/nupkg
artifactName: nupkg
- task: PublishPipelineArtifact@1
displayName: Publish build artifacts
inputs:
targetPath: $(Build.SourcesDirectory)
artifactName: build_output
- stage: E2E
displayName: E2E Tests
dependsOn: Build
variables:
npm_config_cache: $(Pipeline.Workspace)/.npm_e2e
# Enable console logging in Release mode
SERILOG__WRITETO__0__NAME: Async
SERILOG__WRITETO__0__ARGS__CONFIGURE__0__NAME: Console
# Set unattended install settings
UMBRACO__CMS__UNATTENDED__INSTALLUNATTENDED: true
UMBRACO__CMS__UNATTENDED__UNATTENDEDUSERNAME: Playwright Test
UMBRACO__CMS__UNATTENDED__UNATTENDEDUSERPASSWORD: UmbracoAcceptance123!
UMBRACO__CMS__UNATTENDED__UNATTENDEDUSEREMAIL: playwright@umbraco.com
# Custom Umbraco settings
UMBRACO__CMS__CONTENT__CONTENTVERSIONCLEANUPPOLICY__ENABLECLEANUP: false
UMBRACO__CMS__GLOBAL__DISABLEELECTIONFORSINGLESERVER: true
UMBRACO__CMS__GLOBAL__INSTALLMISSINGDATABASE: true
UMBRACO__CMS__GLOBAL__ID: 00000000-0000-0000-0000-000000000042
UMBRACO__CMS__GLOBAL__VERSIONCHECKPERIOD: 0
UMBRACO__CMS__GLOBAL__USEHTTPS: true
UMBRACO__CMS__HEALTHCHECKS__NOTIFICATION__ENABLED: false
UMBRACO__CMS__KEEPALIVE__DISABLEKEEPALIVETASK: true
UMBRACO__CMS__WEBROUTING__UMBRACOAPPLICATIONURL: https://localhost:44331/
ASPNETCORE_URLS: https://localhost:44331
jobs:
# E2E Tests
- job:
displayName: E2E Tests (SQLite)
timeoutInMinutes: 180
variables:
# Connection string
CONNECTIONSTRINGS__UMBRACODBDSN: Data Source=Umbraco;Mode=Memory;Cache=Shared;Foreign Keys=True;Pooling=True
CONNECTIONSTRINGS__UMBRACODBDSN_PROVIDERNAME: Microsoft.Data.Sqlite
strategy:
matrix:
Linux:
vmImage: 'ubuntu-latest'
Windows:
vmImage: 'windows-latest'
pool:
vmImage: $(vmImage)
steps:
# Setup test environment
- task: DownloadPipelineArtifact@2
displayName: Download NuGet artifacts
inputs:
artifact: nupkg
path: $(Agent.BuildDirectory)/app/nupkg
- task: NodeTool@0
displayName: Use Node.js $(nodeVersion)
retryCountOnTaskFailure: 3
inputs:
versionSpec: $(nodeVersion)
- task: UseDotNet@2
displayName: Use .NET SDK from global.json
inputs:
useGlobalJson: true
- pwsh: |
"UMBRACO_USER_LOGIN=$(UMBRACO__CMS__UNATTENDED__UNATTENDEDUSEREMAIL)
UMBRACO_USER_PASSWORD=$(UMBRACO__CMS__UNATTENDED__UNATTENDEDUSERPASSWORD)
URL=$(ASPNETCORE_URLS)
STORAGE_STAGE_PATH=$(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/playwright/.auth/user.json" | Out-File .env
displayName: Generate .env
workingDirectory: $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest
# Cache and restore NPM packages
- task: Cache@2
displayName: Cache NPM packages
inputs:
key: 'npm_e2e | "$(Agent.OS)" | $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/package-lock.json'
restoreKeys: |
npm_e2e | "$(Agent.OS)"
npm_e2e
path: $(npm_config_cache)
- script: npm ci --no-fund --no-audit --prefer-offline
workingDirectory: $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest
displayName: Restore NPM packages
# Build application
- pwsh: |
$cmsVersion = "$(Build.BuildNumber)" -replace "\+",".g"
dotnet new nugetconfig
dotnet nuget add source ./nupkg --name Local
dotnet new install Umbraco.Templates::$cmsVersion
dotnet new umbraco --name UmbracoProject --version $cmsVersion --exclude-gitignore --no-restore --no-update-check
dotnet restore UmbracoProject
cp $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest.UmbracoProject/*.cs UmbracoProject
dotnet build UmbracoProject --configuration $(buildConfiguration) --no-restore
dotnet dev-certs https
displayName: Build application
workingDirectory: $(Agent.BuildDirectory)/app
# Run application
- bash: |
nohup dotnet run --project UmbracoProject --configuration $(buildConfiguration) --no-build --no-launch-profile > $(Build.ArtifactStagingDirectory)/playwright.log 2>&1 &
echo "##vso[task.setvariable variable=AcceptanceTestProcessId]$!"
displayName: Run application (Linux)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
workingDirectory: $(Agent.BuildDirectory)/app
- pwsh: |
$process = Start-Process dotnet "run --project UmbracoProject --configuration $(buildConfiguration) --no-build --no-launch-profile 2>&1" -PassThru -NoNewWindow -RedirectStandardOutput $(Build.ArtifactStagingDirectory)/playwright.log
Write-Host "##vso[task.setvariable variable=AcceptanceTestProcessId]$($process.Id)"
displayName: Run application (Windows)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
workingDirectory: $(Agent.BuildDirectory)/app
# Ensures we have the package wait-on installed
- pwsh: npm install wait-on
displayName: Install wait-on package
# Wait for application to start responding to requests
- pwsh: npx wait-on -v --interval 1000 --timeout 120000 $(ASPNETCORE_URLS)
displayName: Wait for application
workingDirectory: tests/Umbraco.Tests.AcceptanceTest
# Install Playwright and dependencies
- pwsh: npx playwright install --with-deps
displayName: Install Playwright
workingDirectory: tests/Umbraco.Tests.AcceptanceTest
# Test
- ${{ if eq(parameters.runSmokeTests, true) }}:
pwsh: npm run smokeTestSqlite --ignore-certificate-errors
${{ else }}:
pwsh: npm run testSqlite --ignore-certificate-errors
displayName: Run Playwright tests
continueOnError: true
workingDirectory: tests/Umbraco.Tests.AcceptanceTest
env:
CI: true
CommitId: $(Build.SourceVersion)
AgentOs: $(Agent.OS)
# Stop application
- bash: kill -15 $(AcceptanceTestProcessId)
displayName: Stop application (Linux)
condition: and(succeeded(), ne(variables.AcceptanceTestProcessId, ''), eq(variables['Agent.OS'], 'Linux'))
- pwsh: Stop-Process -Id $(AcceptanceTestProcessId)
displayName: Stop application (Windows)
condition: and(succeeded(), ne(variables.AcceptanceTestProcessId, ''), eq(variables['Agent.OS'], 'Windows_NT'))
# Copy artifacts
- pwsh: |
if (Test-Path tests/Umbraco.Tests.AcceptanceTest/results/*) {
Copy-Item tests/Umbraco.Tests.AcceptanceTest/results $(Build.ArtifactStagingDirectory) -Recurse
}
displayName: Copy Playwright results
condition: succeededOrFailed()
# Publish
- task: PublishPipelineArtifact@1
displayName: Publish test artifacts
condition: succeededOrFailed()
inputs:
targetPath: $(Build.ArtifactStagingDirectory)
artifact: 'Acceptance Tests - $(Agent.JobName) - Attempt #$(System.JobAttempt)'
- job:
displayName: E2E Tests (SQL Server)
timeoutInMinutes: 180
variables:
# Connection string
CONNECTIONSTRINGS__UMBRACODBDSN: Data Source=(localdb)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\Umbraco.mdf;Integrated Security=True
CONNECTIONSTRINGS__UMBRACODBDSN_PROVIDERNAME: Microsoft.Data.SqlClient
strategy:
matrix:
Linux:
vmImage: 'ubuntu-latest'
SA_PASSWORD: $(UMBRACO__CMS__UNATTENDED__UNATTENDEDUSERPASSWORD)
CONNECTIONSTRINGS__UMBRACODBDSN: 'Server=(local);Database=Umbraco;User Id=sa;Password=$(SA_PASSWORD);TrustServerCertificate=True'
Windows:
vmImage: 'windows-latest'
pool:
vmImage: $(vmImage)
steps:
# Setup test environment
- task: DownloadPipelineArtifact@2
displayName: Download NuGet artifacts
inputs:
artifact: nupkg
path: $(Agent.BuildDirectory)/app/nupkg
- task: NodeTool@0
displayName: Use Node.js $(nodeVersion)
inputs:
versionSpec: $(nodeVersion)
- task: UseDotNet@2
displayName: Use .NET SDK from global.json
inputs:
useGlobalJson: true
- pwsh: |
"UMBRACO_USER_LOGIN=$(UMBRACO__CMS__UNATTENDED__UNATTENDEDUSEREMAIL)
UMBRACO_USER_PASSWORD=$(UMBRACO__CMS__UNATTENDED__UNATTENDEDUSERPASSWORD)
URL=$(ASPNETCORE_URLS)
STORAGE_STAGE_PATH=$(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/playwright/.auth/user.json" | Out-File .env
displayName: Generate .env
workingDirectory: $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest
# Cache and restore NPM packages
- task: Cache@2
displayName: Cache NPM packages
inputs:
key: 'npm_e2e | "$(Agent.OS)" | $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/package-lock.json'
restoreKeys: |
npm_e2e | "$(Agent.OS)"
npm_e2e
path: $(npm_config_cache)
- script: npm ci --no-fund --no-audit --prefer-offline
workingDirectory: $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest
displayName: Restore NPM packages
# Build application
- pwsh: |
$cmsVersion = "$(Build.BuildNumber)" -replace "\+",".g"
dotnet new nugetconfig
dotnet nuget add source ./nupkg --name Local
dotnet new install Umbraco.Templates::$cmsVersion
dotnet new umbraco --name UmbracoProject --version $cmsVersion --exclude-gitignore --no-restore --no-update-check
dotnet restore UmbracoProject
cp $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest.UmbracoProject/*.cs UmbracoProject
dotnet build UmbracoProject --configuration $(buildConfiguration) --no-restore
dotnet dev-certs https
displayName: Build application
workingDirectory: $(Agent.BuildDirectory)/app
# Start SQL Server
- powershell: docker run --name mssql -d -p 1433:1433 -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=$(SA_PASSWORD)" mcr.microsoft.com/mssql/server:2022-latest
displayName: Start SQL Server Docker image (Linux)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
- pwsh: SqlLocalDB start MSSQLLocalDB
displayName: Start SQL Server LocalDB (Windows)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
# Run application
- bash: |
nohup dotnet run --project UmbracoProject --configuration $(buildConfiguration) --no-build --no-launch-profile > $(Build.ArtifactStagingDirectory)/playwright.log 2>&1 &
echo "##vso[task.setvariable variable=AcceptanceTestProcessId]$!"
displayName: Run application (Linux)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
workingDirectory: $(Agent.BuildDirectory)/app
- pwsh: |
$process = Start-Process dotnet "run --project UmbracoProject --configuration $(buildConfiguration) --no-build --no-launch-profile 2>&1" -PassThru -NoNewWindow -RedirectStandardOutput $(Build.ArtifactStagingDirectory)/playwright.log
Write-Host "##vso[task.setvariable variable=AcceptanceTestProcessId]$($process.Id)"
displayName: Run application (Windows)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
workingDirectory: $(Agent.BuildDirectory)/app
# Ensures we have the package wait-on installed
- pwsh: npm install wait-on
displayName: Install wait-on package
# Wait for application to start responding to requests
- pwsh: npx wait-on -v --interval 1000 --timeout 120000 $(ASPNETCORE_URLS)
displayName: Wait for application
workingDirectory: tests/Umbraco.Tests.AcceptanceTest
# Install Playwright and dependencies
- pwsh: npx playwright install --with-deps
displayName: Install Playwright
workingDirectory: tests/Umbraco.Tests.AcceptanceTest
# Test
- ${{ if eq(parameters.runSmokeTests, true) }}:
pwsh: npm run smokeTest --ignore-certificate-errors
${{ else }}:
pwsh: npm run test --ignore-certificate-errors
displayName: Run Playwright tests
continueOnError: true
workingDirectory: tests/Umbraco.Tests.AcceptanceTest
env:
CI: true
CommitId: $(Build.SourceVersion)
AgentOs: $(Agent.OS)
# Stop application
- bash: kill -15 $(AcceptanceTestProcessId)
displayName: Stop application (Linux)
condition: and(succeeded(), ne(variables.AcceptanceTestProcessId, ''), eq(variables['Agent.OS'], 'Linux'))
- pwsh: Stop-Process -Id $(AcceptanceTestProcessId)
displayName: Stop application (Windows)
condition: and(succeeded(), ne(variables.AcceptanceTestProcessId, ''), eq(variables['Agent.OS'], 'Windows_NT'))
# Stop SQL Server
- pwsh: docker stop mssql
displayName: Stop SQL Server Docker image (Linux)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
- pwsh: SqlLocalDB stop MSSQLLocalDB
displayName: Stop SQL Server LocalDB (Windows)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
# Copy artifacts
- pwsh: |
if (Test-Path tests/Umbraco.Tests.AcceptanceTest/results/*) {
Copy-Item tests/Umbraco.Tests.AcceptanceTest/results $(Build.ArtifactStagingDirectory) -Recurse
}
displayName: Copy Playwright results
condition: succeededOrFailed()
# Publish
- task: PublishPipelineArtifact@1
displayName: Publish test artifacts
condition: succeededOrFailed()
inputs:
targetPath: $(Build.ArtifactStagingDirectory)
artifact: 'Acceptance Tests - $(Agent.JobName) - Attempt #$(System.JobAttempt)'
+31
View File
@@ -0,0 +1,31 @@
steps:
- task: NodeTool@0
displayName: Use Node.js
retryCountOnTaskFailure: 3
inputs:
versionSource: 'fromFile'
versionFilePath: src/Umbraco.Web.UI.Client/.nvmrc
- bash: |
echo "##[command]Install nbgv"
dotnet tool install --tool-path . nbgv
echo "##[command]Running nbgv get-version"
PACKAGE_VERSION=$(nbgv get-version -v NpmPackageVersion)
echo "##[command]Running npm version"
echo "##[debug]Version: $PACKAGE_VERSION"
cd src/Umbraco.Web.UI.Client
npm version $PACKAGE_VERSION --allow-same-version --no-git-tag-version
displayName: Set NPM Version
- task: Cache@2
displayName: Cache node_modules
inputs:
key: '"npm_client" | "$(Agent.OS)"| $(Build.SourcesDirectory)/src/Umbraco.Web.UI.Client/package-lock.json'
restoreKeys: |
"npm_client" | "$(Agent.OS)"
"npm_client"
path: $(npm_config_cache)
- script: npm ci --no-fund --no-audit --prefer-offline
displayName: Run npm ci (Bellissima)
workingDirectory: src/Umbraco.Web.UI.Client
+1 -1
View File
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "8.0.100",
"version": "8.0.300",
"rollForward": "latestFeature"
}
}
@@ -1,5 +1,6 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Extensions;
namespace Umbraco.Cms.Api.Common.Builders;
@@ -8,6 +9,8 @@ public class ProblemDetailsBuilder
private string? _title;
private string? _detail;
private string? _type;
private string? _operationStatus;
private IDictionary<string, object>? _extensions;
public ProblemDetailsBuilder WithTitle(string title)
{
@@ -27,11 +30,45 @@ public class ProblemDetailsBuilder
return this;
}
public ProblemDetails Build() =>
new()
public ProblemDetailsBuilder WithOperationStatus<TEnum>(TEnum operationStatus)
where TEnum : Enum
{
_operationStatus = operationStatus.ToString();
return this;
}
public ProblemDetailsBuilder WithRequestModelErrors(IDictionary<string, string[]> errors)
=> WithExtension(nameof(HttpValidationProblemDetails.Errors).ToFirstLowerInvariant(), errors);
public ProblemDetailsBuilder WithExtension(string key, object value)
{
_extensions ??= new Dictionary<string, object>();
_extensions[key] = value;
return this;
}
public ProblemDetails Build()
{
var problemDetails = new ProblemDetails
{
Title = _title,
Detail = _detail,
Type = _type ?? "Error",
};
if (_operationStatus is not null)
{
problemDetails.Extensions["operationStatus"] = _operationStatus;
}
if (_extensions is not null)
{
foreach (KeyValuePair<string, object> extension in _extensions)
{
problemDetails.Extensions[extension.Key] = extension.Value;
}
}
return problemDetails;
}
}
@@ -0,0 +1,15 @@
using Microsoft.Extensions.Options;
using OpenIddict.Server.AspNetCore;
using Umbraco.Cms.Core.Configuration.Models;
namespace Umbraco.Cms.Api.Common.Configuration;
internal class ConfigureOpenIddict : IConfigureOptions<OpenIddictServerAspNetCoreOptions>
{
private readonly IOptions<GlobalSettings> _globalSettings;
public ConfigureOpenIddict(IOptions<GlobalSettings> globalSettings) => _globalSettings = globalSettings;
public void Configure(OpenIddictServerAspNetCoreOptions options)
=> options.DisableTransportSecurityRequirement = _globalSettings.Value.UseHttps is false;
}
@@ -12,16 +12,22 @@ namespace Umbraco.Cms.Api.Common.Configuration;
public class ConfigureUmbracoSwaggerGenOptions : IConfigureOptions<SwaggerGenOptions>
{
private readonly IOptions<ApiVersioningOptions> _apiVersioningOptions;
private readonly IOperationIdSelector _operationIdSelector;
private readonly ISchemaIdSelector _schemaIdSelector;
[Obsolete("Use non-obsolete constructor. This will be removed in Umbraco 15.")]
public ConfigureUmbracoSwaggerGenOptions(
IOptions<ApiVersioningOptions> apiVersioningOptions,
IOperationIdSelector operationIdSelector,
ISchemaIdSelector schemaIdSelector)
: this(operationIdSelector, schemaIdSelector)
{
}
public ConfigureUmbracoSwaggerGenOptions(
IOperationIdSelector operationIdSelector,
ISchemaIdSelector schemaIdSelector)
{
_apiVersioningOptions = apiVersioningOptions;
_operationIdSelector = operationIdSelector;
_schemaIdSelector = schemaIdSelector;
}
@@ -34,10 +40,10 @@ public class ConfigureUmbracoSwaggerGenOptions : IConfigureOptions<SwaggerGenOpt
{
Title = "Default API",
Version = "Latest",
Description = "All endpoints not defined under specific APIs"
Description = "All endpoints not defined under specific APIs",
});
swaggerGenOptions.CustomOperationIds(description => _operationIdSelector.OperationId(description, _apiVersioningOptions.Value));
swaggerGenOptions.CustomOperationIds(description => _operationIdSelector.OperationId(description));
swaggerGenOptions.DocInclusionPredicate((name, api) =>
{
if (string.IsNullOrWhiteSpace(api.GroupName))
@@ -0,0 +1,62 @@
using Microsoft.AspNetCore.Http;
using OpenIddict.Server;
using OpenIddict.Validation;
using Umbraco.Cms.Core;
using Umbraco.Extensions;
namespace Umbraco.Cms.Api.Common.DependencyInjection;
public class ProcessRequestContextHandler
: IOpenIddictServerHandler<OpenIddictServerEvents.ProcessRequestContext>, IOpenIddictValidationHandler<OpenIddictValidationEvents.ProcessRequestContext>
{
private readonly IHttpContextAccessor _httpContextAccessor;
private readonly string[] _pathsToHandle;
public ProcessRequestContextHandler(IHttpContextAccessor httpContextAccessor)
{
_httpContextAccessor = httpContextAccessor;
var backOfficePathSegment = Constants.System.DefaultUmbracoPath.TrimStart(Constants.CharArrays.Tilde)
.EnsureStartsWith('/')
.EnsureEndsWith('/');
_pathsToHandle = [backOfficePathSegment, "/.well-known/openid-configuration"];
}
public ValueTask HandleAsync(OpenIddictServerEvents.ProcessRequestContext context)
{
if (SkipOpenIddictHandlingForRequest())
{
context.SkipRequest();
}
return ValueTask.CompletedTask;
}
public ValueTask HandleAsync(OpenIddictValidationEvents.ProcessRequestContext context)
{
if (SkipOpenIddictHandlingForRequest())
{
context.SkipRequest();
}
return ValueTask.CompletedTask;
}
private bool SkipOpenIddictHandlingForRequest()
{
var requestPath = _httpContextAccessor.HttpContext?.Request.Path.Value;
if (requestPath.IsNullOrWhiteSpace())
{
return false;
}
foreach (var path in _pathsToHandle)
{
if (requestPath.StartsWith(path))
{
return false;
}
}
return true;
}
}
@@ -11,11 +11,18 @@ public static class UmbracoBuilderApiExtensions
{
public static IUmbracoBuilder AddUmbracoApiOpenApiUI(this IUmbracoBuilder builder)
{
if (builder.Services.Any(x => !x.IsKeyedService && x.ImplementationType == typeof(OperationIdSelector)))
{
return builder;
}
builder.Services.AddSwaggerGen();
builder.Services.ConfigureOptions<ConfigureUmbracoSwaggerGenOptions>();
builder.Services.AddSingleton<IUmbracoJsonTypeInfoResolver, UmbracoJsonTypeInfoResolver>();
builder.Services.AddSingleton<IOperationIdSelector, OperationIdSelector>();
builder.Services.AddSingleton<IOperationIdHandler, OperationIdHandler>();
builder.Services.AddSingleton<ISchemaIdSelector, SchemaIdSelector>();
builder.Services.AddSingleton<ISchemaIdHandler, SchemaIdHandler>();
builder.Services.Configure<UmbracoPipelineOptions>(options => options.AddFilter(new SwaggerRouteTemplatePipelineFilter("UmbracoApiCommon")));
return builder;
@@ -1,23 +1,26 @@
using System.Security.Cryptography;
using System.Security.Cryptography;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.IdentityModel.Tokens;
using OpenIddict.Server;
using OpenIddict.Validation;
using Umbraco.Cms.Api.Common.Configuration;
using Umbraco.Cms.Api.Common.Security;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Cms.Core.DependencyInjection;
using Umbraco.Cms.Infrastructure.HostedServices;
using Umbraco.Cms.Infrastructure.BackgroundJobs.Jobs;
using Umbraco.Extensions;
namespace Umbraco.Cms.Api.Common.DependencyInjection;
public static class UmbracoBuilderAuthExtensions
{
private static bool _initialized;
public static IUmbracoBuilder AddUmbracoOpenIddict(this IUmbracoBuilder builder)
{
if (_initialized is false)
if (builder.Services.Any(x => !x.IsKeyedService && x.ImplementationType == typeof(OpenIddictCleanupJob)) is false)
{
ConfigureOpenIddict(builder);
_initialized = true;
}
return builder;
@@ -31,16 +34,19 @@ public static class UmbracoBuilderAuthExtensions
{
// Enable the authorization and token endpoints.
// - important: member endpoints MUST be added before backoffice endpoints to ensure that auto-discovery works for members
// FIXME: swap paths here so member API is first (see comment above)
options
.SetAuthorizationEndpointUris(
Paths.MemberApi.AuthorizationEndpoint.TrimStart(Constants.CharArrays.ForwardSlash))
Paths.MemberApi.AuthorizationEndpoint.TrimStart(Constants.CharArrays.ForwardSlash),
Paths.BackOfficeApi.AuthorizationEndpoint.TrimStart(Constants.CharArrays.ForwardSlash))
.SetTokenEndpointUris(
Paths.MemberApi.TokenEndpoint.TrimStart(Constants.CharArrays.ForwardSlash))
Paths.MemberApi.TokenEndpoint.TrimStart(Constants.CharArrays.ForwardSlash),
Paths.BackOfficeApi.TokenEndpoint.TrimStart(Constants.CharArrays.ForwardSlash))
.SetLogoutEndpointUris(
Paths.MemberApi.LogoutEndpoint.TrimStart(Constants.CharArrays.ForwardSlash))
Paths.MemberApi.LogoutEndpoint.TrimStart(Constants.CharArrays.ForwardSlash),
Paths.BackOfficeApi.LogoutEndpoint.TrimStart(Constants.CharArrays.ForwardSlash))
.SetRevocationEndpointUris(
Paths.MemberApi.RevokeEndpoint.TrimStart(Constants.CharArrays.ForwardSlash))
Paths.MemberApi.RevokeEndpoint.TrimStart(Constants.CharArrays.ForwardSlash),
Paths.BackOfficeApi.RevokeEndpoint.TrimStart(Constants.CharArrays.ForwardSlash))
.SetUserinfoEndpointUris(
Paths.MemberApi.UserinfoEndpoint.TrimStart(Constants.CharArrays.ForwardSlash));
@@ -63,6 +69,17 @@ public static class UmbracoBuilderAuthExtensions
.UseReferenceAccessTokens()
.UseReferenceRefreshTokens();
// Apply sliding window expiry based on the configured max login lifetime
GlobalSettings globalSettings = builder.Config
.GetSection(Constants.Configuration.ConfigGlobal)
.Get<GlobalSettings>() ?? new GlobalSettings();
TimeSpan timeOut = globalSettings.TimeOut;
// Make the access token lifetime 25% of the refresh token lifetime, to help ensure that new access tokens
// are obtained by the client before the refresh token expires.
options.SetAccessTokenLifetime(new TimeSpan(timeOut.Ticks / 4));
options.SetRefreshTokenLifetime(timeOut);
// Use ASP.NET Core Data Protection for tokens instead of JWT.
// This is more secure, and has the added benefit of having a high throughput
// but means that all servers (such as in a load balanced setup)
@@ -85,6 +102,13 @@ public static class UmbracoBuilderAuthExtensions
options
.AddEncryptionKey(new SymmetricSecurityKey(RandomNumberGenerator.GetBytes(32))) // generate a cryptographically secure random 256-bits key
.AddSigningKey(new RsaSecurityKey(RSA.Create(keySizeInBits: 2048))); // generate RSA key with recommended size of 2048-bits
// Add custom handler for the "ProcessRequestContext" server event, to stop OpenIddict from handling
// every last request to the server (including front-end requests).
options.AddEventHandler<OpenIddictServerEvents.ProcessRequestContext>(configuration =>
{
configuration.UseSingletonHandler<ProcessRequestContextHandler>().SetOrder(OpenIddict.Server.AspNetCore.OpenIddictServerAspNetCoreHandlers.ResolveRequestUri.Descriptor.Order - 1);
});
})
// Register the OpenIddict validation components.
@@ -102,8 +126,16 @@ public static class UmbracoBuilderAuthExtensions
// Use ASP.NET Core Data Protection for tokens instead of JWT. (see note in AddServer)
options.UseDataProtection();
// Add custom handler for the "ProcessRequestContext" validation event, to stop OpenIddict from handling
// every last request to the server (including front-end requests).
options.AddEventHandler<OpenIddictValidationEvents.ProcessRequestContext>(configuration =>
{
configuration.UseSingletonHandler<ProcessRequestContextHandler>().SetOrder(OpenIddict.Validation.AspNetCore.OpenIddictValidationAspNetCoreHandlers.ResolveRequestUri.Descriptor.Order - 1);
});
});
builder.Services.AddHostedService<OpenIddictCleanup>();
builder.Services.AddRecurringBackgroundJob<OpenIddictCleanupJob>();
builder.Services.ConfigureOptions<ConfigureOpenIddict>();
}
}
@@ -0,0 +1,50 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Routing;
using Microsoft.Extensions.DependencyInjection;
using Umbraco.Cms.Core;
namespace Umbraco.Cms.Api.Common.Mvc.ActionResults;
/// <summary>
/// A "created at" action result with no response body.
/// </summary>
public sealed class EmptyCreatedAtActionResult : ActionResult
{
private readonly string _actionName;
private readonly string _controllerName;
private readonly object _routeValues;
private readonly string _resourceIdentifier;
public EmptyCreatedAtActionResult(string actionName, string controllerName, object routeValues, string resourceIdentifier)
{
_actionName = actionName;
_controllerName = controllerName;
_routeValues = routeValues;
_resourceIdentifier = resourceIdentifier;
}
public override void ExecuteResult(ActionContext context)
{
ArgumentNullException.ThrowIfNull(context);
HttpRequest request = context.HttpContext.Request;
IUrlHelper urlHelper = context.HttpContext.RequestServices.GetRequiredService<IUrlHelperFactory>().GetUrlHelper(context);
var url = urlHelper.Action(
_actionName,
_controllerName,
_routeValues,
request.Scheme,
request.Host.ToUriComponent());
if (string.IsNullOrEmpty(url))
{
throw new InvalidOperationException("No routes could be found that matched the provided route components");
}
context.HttpContext.Response.StatusCode = StatusCodes.Status201Created;
context.HttpContext.Response.Headers.Location = url;
context.HttpContext.Response.Headers[Constants.Headers.GeneratedResource] = _resourceIdentifier;
}
}
@@ -0,0 +1,11 @@
namespace Umbraco.Cms.Api.Common.OpenApi;
/// <summary>
/// Marker interface that ensure the type have a "$type" discriminator in the open api schema.
/// </summary>
/// <remarks>
/// This is required when an endpoint can receive different types, to ensure the correct type is deserialized.
/// </remarks>
public interface IOpenApiDiscriminator
{
}
@@ -0,0 +1,10 @@
using Microsoft.AspNetCore.Mvc.ApiExplorer;
namespace Umbraco.Cms.Api.Common.OpenApi;
public interface IOperationIdHandler
{
bool CanHandle(ApiDescription apiDescription);
string Handle(ApiDescription apiDescription);
}
@@ -5,5 +5,8 @@ namespace Umbraco.Cms.Api.Common.OpenApi;
public interface IOperationIdSelector
{
[Obsolete("Use overload that only takes ApiDescription instead. This will be removed in Umbraco 15.")]
string? OperationId(ApiDescription apiDescription, ApiVersioningOptions apiVersioningOptions);
string? OperationId(ApiDescription apiDescription);
}
@@ -0,0 +1,8 @@
namespace Umbraco.Cms.Api.Common.OpenApi;
public interface ISchemaIdHandler
{
bool CanHandle(Type type);
string Handle(Type type);
}
@@ -0,0 +1,94 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Mvc.ApiExplorer;
using Microsoft.AspNetCore.Mvc.Controllers;
using Microsoft.Extensions.Options;
using Umbraco.Extensions;
namespace Umbraco.Cms.Api.Common.OpenApi;
// NOTE: Left unsealed on purpose, so it is extendable.
public class OperationIdHandler : IOperationIdHandler
{
private readonly ApiVersioningOptions _apiVersioningOptions;
public OperationIdHandler(IOptions<ApiVersioningOptions> apiVersioningOptions)
=> _apiVersioningOptions = apiVersioningOptions.Value;
public bool CanHandle(ApiDescription apiDescription)
{
if (apiDescription.ActionDescriptor is not ControllerActionDescriptor controllerActionDescriptor)
{
return false;
}
return CanHandle(apiDescription, controllerActionDescriptor);
}
protected virtual bool CanHandle(ApiDescription apiDescription, ControllerActionDescriptor controllerActionDescriptor)
=> controllerActionDescriptor.ControllerTypeInfo.Namespace?.StartsWith("Umbraco.Cms.Api") is true;
public virtual string Handle(ApiDescription apiDescription)
=> UmbracoOperationId(apiDescription);
/// <summary>
/// Generates a unique operation identifier for a given API following Umbraco's operation id naming conventions.
/// </summary>
protected string UmbracoOperationId(ApiDescription apiDescription)
{
if (apiDescription.ActionDescriptor is not ControllerActionDescriptor controllerActionDescriptor)
{
throw new ArgumentException($"This handler operates only on {nameof(ControllerActionDescriptor)}.");
}
ApiVersion defaultVersion = _apiVersioningOptions.DefaultApiVersion;
var httpMethod = apiDescription.HttpMethod?.ToLower().ToFirstUpper() ?? "Get";
// if the route info "Name" is supplied we'll use this explicitly as the operation ID
// - usage example: [HttpGet("my-api/route}", Name = "MyCustomRoute")]
if (string.IsNullOrWhiteSpace(apiDescription.ActionDescriptor.AttributeRouteInfo?.Name) == false)
{
var explicitOperationId = apiDescription.ActionDescriptor.AttributeRouteInfo!.Name;
return explicitOperationId.InvariantStartsWith(httpMethod)
? explicitOperationId
: $"{httpMethod}{explicitOperationId}";
}
var relativePath = apiDescription.RelativePath;
if (string.IsNullOrWhiteSpace(relativePath))
{
throw new InvalidOperationException(
$"There is no relative path for controller action {apiDescription.ActionDescriptor.RouteValues["controller"]}");
}
// Remove the prefixed base path with version, e.g. /umbraco/management/api/v1/tracked-reference/{id} => tracked-reference/{id}
var unprefixedRelativePath = OperationIdRegexes
.VersionPrefixRegex()
.Replace(relativePath, string.Empty);
// Remove template placeholders, e.g. tracked-reference/{id} => tracked-reference/Id
var formattedOperationId = OperationIdRegexes
.TemplatePlaceholdersRegex()
.Replace(unprefixedRelativePath, m => $"By{m.Groups[1].Value.ToFirstUpper()}");
// Remove dashes (-) and slashes (/) and convert the following letter to uppercase with
// the word "By" in front, e.g. tracked-reference/Id => TrackedReferenceById
formattedOperationId = OperationIdRegexes
.ToCamelCaseRegex()
.Replace(formattedOperationId, m => m.Groups[1].Value.ToUpper());
// Get map to version attribute
string? version = null;
var versionAttributeValue = controllerActionDescriptor.MethodInfo.GetMapToApiVersionAttributeValue();
// We only want to add a version, if it is not the default one.
if (string.Equals(versionAttributeValue, defaultVersion.ToString()) == false)
{
version = versionAttributeValue;
}
// Return the operation ID with the formatted http method verb in front, e.g. GetTrackedReferenceById
return $"{httpMethod}{formattedOperationId.ToFirstUpper()}{version}";
}
}
@@ -1,79 +1,27 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Mvc.ApiExplorer;
using Microsoft.AspNetCore.Mvc.Controllers;
using Umbraco.Extensions;
namespace Umbraco.Cms.Api.Common.OpenApi;
public class OperationIdSelector : IOperationIdSelector
{
public virtual string? OperationId(ApiDescription apiDescription, ApiVersioningOptions apiVersioningOptions)
{
if (apiDescription.ActionDescriptor is not ControllerActionDescriptor controllerActionDescriptor
|| controllerActionDescriptor.ControllerTypeInfo.Namespace?.StartsWith("Umbraco.Cms.Api") is not true)
{
return null;
}
private readonly IEnumerable<IOperationIdHandler> _operationIdHandlers;
return UmbracoOperationId(apiDescription, apiVersioningOptions);
[Obsolete("Use non-obsolete constructor. This will be removed in Umbraco 15.")]
public OperationIdSelector()
: this(Enumerable.Empty<IOperationIdHandler>())
{
}
protected string? UmbracoOperationId(ApiDescription apiDescription, ApiVersioningOptions apiVersioningOptions)
public OperationIdSelector(IEnumerable<IOperationIdHandler> operationIdHandlers)
=> _operationIdHandlers = operationIdHandlers;
[Obsolete("Use overload that only takes ApiDescription instead. This will be removed in Umbraco 15.")]
public virtual string? OperationId(ApiDescription apiDescription, ApiVersioningOptions apiVersioningOptions) => OperationId(apiDescription);
public virtual string? OperationId(ApiDescription apiDescription)
{
if (apiDescription.ActionDescriptor is not ControllerActionDescriptor controllerActionDescriptor)
{
return null;
}
ApiVersion defaultVersion = apiVersioningOptions.DefaultApiVersion;
var httpMethod = apiDescription.HttpMethod?.ToLower().ToFirstUpper() ?? "Get";
// if the route info "Name" is supplied we'll use this explicitly as the operation ID
// - usage example: [HttpGet("my-api/route}", Name = "MyCustomRoute")]
if (string.IsNullOrWhiteSpace(apiDescription.ActionDescriptor.AttributeRouteInfo?.Name) == false)
{
var explicitOperationId = apiDescription.ActionDescriptor.AttributeRouteInfo!.Name;
return explicitOperationId.InvariantStartsWith(httpMethod)
? explicitOperationId
: $"{httpMethod}{explicitOperationId}";
}
var relativePath = apiDescription.RelativePath;
if (string.IsNullOrWhiteSpace(relativePath))
{
throw new Exception(
$"There is no relative path for controller action {apiDescription.ActionDescriptor.RouteValues["controller"]}");
}
// Remove the prefixed base path with version, e.g. /umbraco/management/api/v1/tracked-reference/{id} => tracked-reference/{id}
var unprefixedRelativePath = OperationIdRegexes
.VersionPrefixRegex()
.Replace(relativePath, string.Empty);
// Remove template placeholders, e.g. tracked-reference/{id} => tracked-reference/Id
var formattedOperationId = OperationIdRegexes
.TemplatePlaceholdersRegex()
.Replace(unprefixedRelativePath, m => $"By{m.Groups[1].Value.ToFirstUpper()}");
// Remove dashes (-) and slashes (/) and convert the following letter to uppercase with
// the word "By" in front, e.g. tracked-reference/Id => TrackedReferenceById
formattedOperationId = OperationIdRegexes
.ToCamelCaseRegex()
.Replace(formattedOperationId, m => m.Groups[1].Value.ToUpper());
//Get map to version attribute
string? version = null;
var versionAttributeValue = controllerActionDescriptor.MethodInfo.GetMapToApiVersionAttributeValue();
// We only wanna add a version, if it is not the default one.
if (string.Equals(versionAttributeValue, defaultVersion.ToString()) == false)
{
version = versionAttributeValue;
}
// Return the operation ID with the formatted http method verb in front, e.g. GetTrackedReferenceById
return $"{httpMethod}{formattedOperationId.ToFirstUpper()}{version}";
IOperationIdHandler? handler = _operationIdHandlers.FirstOrDefault(h => h.CanHandle(apiDescription));
return handler?.Handle(apiDescription);
}
}
@@ -0,0 +1,51 @@
using System.Text.RegularExpressions;
using Umbraco.Extensions;
namespace Umbraco.Cms.Api.Common.OpenApi;
// NOTE: Left unsealed on purpose, so it is extendable.
public class SchemaIdHandler : ISchemaIdHandler
{
public virtual bool CanHandle(Type type)
=> type.Namespace?.StartsWith("Umbraco.Cms") is true;
public virtual string Handle(Type type)
=> UmbracoSchemaId(type);
/// <summary>
/// Generates a sanitized and consistent schema identifier for a given type following Umbraco's schema id naming conventions.
/// </summary>
protected string UmbracoSchemaId(Type type)
{
var name = SanitizedTypeName(type);
name = HandleGenerics(name, type);
if (name.EndsWith("Model") == false)
{
// because some models names clash with common classes in TypeScript (i.e. Document),
// we need to add a "Model" postfix to all models
name = $"{name}Model";
}
// make absolutely sure we don't pass any invalid named by removing all non-word chars
return Regex.Replace(name, @"[^\w]", string.Empty);
}
private string SanitizedTypeName(Type t) => t.Name
// first grab the "non-generic" part of any generic type name (i.e. "PagedViewModel`1" becomes "PagedViewModel")
.Split('`').First()
// then remove the "ViewModel" postfix from type names
.TrimEnd("ViewModel");
private string HandleGenerics(string name, Type type)
{
if (!type.IsGenericType)
{
return name;
}
// use attribute custom name or append the generic type names, ultimately turning i.e. "PagedViewModel<RelationItemViewModel>" into "PagedRelationItem"
return $"{name}{string.Join(string.Empty, type.GenericTypeArguments.Select(SanitizedTypeName))}";
}
}
@@ -1,36 +1,15 @@
using System.Text.RegularExpressions;
using Umbraco.Extensions;
namespace Umbraco.Cms.Api.Common.OpenApi;
namespace Umbraco.Cms.Api.Common.OpenApi;
public class SchemaIdSelector : ISchemaIdSelector
{
private readonly IEnumerable<ISchemaIdHandler> _schemaIdHandlers;
public SchemaIdSelector(IEnumerable<ISchemaIdHandler> schemaIdHandlers)
=> _schemaIdHandlers = schemaIdHandlers;
public virtual string SchemaId(Type type)
=> type.Namespace?.StartsWith("Umbraco.Cms") is true ? UmbracoSchemaId(type) : type.Name;
protected string UmbracoSchemaId(Type type)
{
string SanitizedTypeName(Type t) => t.Name
// first grab the "non generic" part of any generic type name (i.e. "PagedViewModel`1" becomes "PagedViewModel")
.Split('`').First()
// then remove the "ViewModel" postfix from type names
.TrimEnd("ViewModel");
var name = SanitizedTypeName(type);
if (type.IsGenericType)
{
// append the generic type names, ultimately turning i.e. "PagedViewModel<RelationItemViewModel>" into "PagedRelationItem"
name = $"{name}{string.Join(string.Empty, type.GenericTypeArguments.Select(SanitizedTypeName))}";
}
if (name.EndsWith("Model") == false)
{
// because some models names clash with common classes in TypeScript (i.e. Document),
// we need to add a "Model" postfix to all models
name = $"{name}Model";
}
// make absolutely sure we don't pass any invalid named by removing all non-word chars
return Regex.Replace(name, @"[^\w]", string.Empty);
ISchemaIdHandler? handler = _schemaIdHandlers.FirstOrDefault(h => h.CanHandle(type));
return handler?.Handle(type) ?? type.Name;
}
}
@@ -62,6 +62,11 @@ public class SwaggerRouteTemplatePipelineFilter : UmbracoPipelineFilter
swaggerUiOptions.SwaggerEndpoint($"{name}/swagger.json", $"{apiInfo.Title}");
}
// Add custom configuration from https://swagger.io/docs/open-source-tools/swagger-ui/usage/configuration/
swaggerUiOptions.ConfigObject.PersistAuthorization = true; // persists authorization data so it would not be lost on browser close/refresh
swaggerUiOptions.ConfigObject.Filter = string.Empty; // Enable the filter with an empty string as default filter.
swaggerUiOptions.OAuthClientId(Constants.OAuthClientIds.Swagger);
swaggerUiOptions.OAuthUsePkce();
}
+18 -1
View File
@@ -1,7 +1,24 @@
namespace Umbraco.Cms.Api.Common.Security;
using Umbraco.Cms.Core;
namespace Umbraco.Cms.Api.Common.Security;
public static class Paths
{
public static class BackOfficeApi
{
public const string EndpointTemplate = "security/back-office";
public static readonly string AuthorizationEndpoint = EndpointPath($"{EndpointTemplate}/authorize");
public static readonly string TokenEndpoint = EndpointPath($"{EndpointTemplate}/token");
public static readonly string LogoutEndpoint = EndpointPath($"{EndpointTemplate}/signout");
public static readonly string RevokeEndpoint = EndpointPath($"{EndpointTemplate}/revoke");
private static string EndpointPath(string relativePath) => $"/umbraco{Constants.Web.ManagementApiPath}v1/{relativePath}";
}
public static class MemberApi
{
public const string EndpointTemplate = "security/member";
@@ -5,4 +5,6 @@ namespace Umbraco.Cms.Api.Common.Serialization;
public interface IUmbracoJsonTypeInfoResolver : IJsonTypeInfoResolver
{
IEnumerable<Type> FindSubTypes(Type type);
string? GetTypeDiscriminatorValue(Type type);
}
@@ -1,7 +1,10 @@
using System.Collections.Concurrent;
using System.Text.Json;
using System.Text.Json.Serialization;
using System.Text.Json.Serialization.Metadata;
using Umbraco.Cms.Api.Common.OpenApi;
using Umbraco.Cms.Core.Composing;
using Umbraco.Extensions;
namespace Umbraco.Cms.Api.Common.Serialization;
@@ -11,51 +14,60 @@ public sealed class UmbracoJsonTypeInfoResolver : DefaultJsonTypeInfoResolver, I
private readonly ConcurrentDictionary<Type, ISet<Type>> _subTypesCache = new ConcurrentDictionary<Type, ISet<Type>>();
public UmbracoJsonTypeInfoResolver(ITypeFinder typeFinder)
{
_typeFinder = typeFinder;
}
=> _typeFinder = typeFinder;
public IEnumerable<Type> FindSubTypes(Type type)
{
JsonDerivedTypeAttribute[] explicitJsonDerivedTypes = type
.GetCustomAttributes<JsonDerivedTypeAttribute>(false)
.ToArray();
if (explicitJsonDerivedTypes.Any())
{
return explicitJsonDerivedTypes.Select(a => a.DerivedType);
}
if (type.IsInterface is false)
{
// IMPORTANT: do NOT return an empty enumerable here. it will cause nullability to fail on reference
// properties, because "$ref" does not mix and match well with "nullable" in OpenAPI.
// see also https://github.com/OAI/OpenAPI-Specification/issues/1368
return new[] { type };
}
if (_subTypesCache.TryGetValue(type, out ISet<Type>? cachedResult))
{
return cachedResult;
}
var result = _typeFinder.FindClassesOfType(type).ToHashSet();
var result = _typeFinder.FindClassesOfType(type).OrderBy(x => x.Name).ToHashSet();
_subTypesCache.TryAdd(type, result);
return result;
}
public string? GetTypeDiscriminatorValue(Type type)
{
JsonDerivedTypeAttribute? jsonDerivedTypeAttribute = type
.GetBaseTypes(false)
.WhereNotNull()
.SelectMany(baseType => baseType.GetCustomAttributes<JsonDerivedTypeAttribute>(false))
.FirstOrDefault(attr => attr.DerivedType == type);
if (jsonDerivedTypeAttribute is not null)
{
// IMPORTANT: do NOT perform fallback to type.Name here - it will work for the schema generation,
// but not for the actual serialization, and then it's only going to cause confusion.
return jsonDerivedTypeAttribute.TypeDiscriminator?.ToString();
}
return typeof(IOpenApiDiscriminator).IsAssignableFrom(type) ? type.Name : null;
}
public override JsonTypeInfo GetTypeInfo(Type type, JsonSerializerOptions options)
{
JsonTypeInfo result = base.GetTypeInfo(type, options);
if (type.IsInterface)
{
return GetTypeInfoForInterface(result, type, options);
}
else
{
return GetTypeInfoForClass(result, type, options);
}
}
private JsonTypeInfo GetTypeInfoForClass(JsonTypeInfo result, Type type, JsonSerializerOptions options)
{
if (result.Kind != JsonTypeInfoKind.Object || !type.GetInterfaces().Any())
{
return result;
}
JsonPolymorphismOptions jsonPolymorphismOptions = result.PolymorphismOptions ?? new JsonPolymorphismOptions();
jsonPolymorphismOptions.DerivedTypes.Add(new JsonDerivedType(type, type.Name));
result.PolymorphismOptions = jsonPolymorphismOptions;
return result;
return type.IsInterface
? GetTypeInfoForInterface(result, type, options)
: result;
}
private JsonTypeInfo GetTypeInfoForInterface(JsonTypeInfo result, Type type, JsonSerializerOptions options)
@@ -3,12 +3,13 @@
<Title>Umbraco CMS - API Common</Title>
<Description>Contains the bits and pieces that are shared between the Umbraco CMS APIs.</Description>
</PropertyGroup>
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Asp.Versioning.Mvc "/>
<PackageReference Include="Asp.Versioning.Mvc.ApiExplorer" />
<PackageReference Include="Swashbuckle.AspNetCore" />
<PackageReference Include="OpenIddict.Abstractions" />
<PackageReference Include="OpenIddict.AspNetCore" />
@@ -23,5 +24,6 @@
<ItemGroup>
<ProjectReference Include="..\Umbraco.Core\Umbraco.Core.csproj" />
<ProjectReference Include="..\Umbraco.Web.Common\Umbraco.Web.Common.csproj" />
</ItemGroup>
</Project>
@@ -1,12 +1,9 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Cms.Core.DependencyInjection;
using Umbraco.Cms.Core.Models.DeliveryApi;
using Umbraco.Cms.Core.Models.PublishedContent;
using Umbraco.Cms.Core.Services;
namespace Umbraco.Cms.Api.Delivery.Controllers.Content;
@@ -16,32 +13,6 @@ public class ByIdContentApiController : ContentApiItemControllerBase
{
private readonly IRequestMemberAccessService _requestMemberAccessService;
[Obsolete($"Please use the constructor that does not accept {nameof(IPublicAccessService)}. Will be removed in V14.")]
public ByIdContentApiController(
IApiPublishedContentCache apiPublishedContentCache,
IApiContentResponseBuilder apiContentResponseBuilder,
IPublicAccessService publicAccessService)
: this(
apiPublishedContentCache,
apiContentResponseBuilder,
StaticServiceProvider.Instance.GetRequiredService<IRequestMemberAccessService>())
{
}
[Obsolete($"Please use the constructor that does not accept {nameof(IPublicAccessService)}. Will be removed in V14.")]
public ByIdContentApiController(
IApiPublishedContentCache apiPublishedContentCache,
IApiContentResponseBuilder apiContentResponseBuilder,
IPublicAccessService publicAccessService,
IRequestMemberAccessService requestMemberAccessService)
: this(
apiPublishedContentCache,
apiContentResponseBuilder,
requestMemberAccessService)
{
}
[ActivatorUtilitiesConstructor]
public ByIdContentApiController(
IApiPublishedContentCache apiPublishedContentCache,
IApiContentResponseBuilder apiContentResponseBuilder,
@@ -1,12 +1,9 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Cms.Core.DependencyInjection;
using Umbraco.Cms.Core.Models.DeliveryApi;
using Umbraco.Cms.Core.Models.PublishedContent;
using Umbraco.Cms.Core.Services;
using Umbraco.Extensions;
namespace Umbraco.Cms.Api.Delivery.Controllers.Content;
@@ -17,32 +14,6 @@ public class ByIdsContentApiController : ContentApiItemControllerBase
{
private readonly IRequestMemberAccessService _requestMemberAccessService;
[Obsolete($"Please use the constructor that does not accept {nameof(IPublicAccessService)}. Will be removed in V14.")]
public ByIdsContentApiController(
IApiPublishedContentCache apiPublishedContentCache,
IApiContentResponseBuilder apiContentResponseBuilder,
IPublicAccessService publicAccessService)
: this(
apiPublishedContentCache,
apiContentResponseBuilder,
StaticServiceProvider.Instance.GetRequiredService<IRequestMemberAccessService>())
{
}
[Obsolete($"Please use the constructor that does not accept {nameof(IPublicAccessService)}. Will be removed in V14.")]
public ByIdsContentApiController(
IApiPublishedContentCache apiPublishedContentCache,
IApiContentResponseBuilder apiContentResponseBuilder,
IPublicAccessService publicAccessService,
IRequestMemberAccessService requestMemberAccessService)
: this(
apiPublishedContentCache,
apiContentResponseBuilder,
requestMemberAccessService)
{
}
[ActivatorUtilitiesConstructor]
public ByIdsContentApiController(
IApiPublishedContentCache apiPublishedContentCache,
IApiContentResponseBuilder apiContentResponseBuilder,
@@ -21,43 +21,6 @@ public class ByRouteContentApiController : ContentApiItemControllerBase
private readonly IRequestMemberAccessService _requestMemberAccessService;
private const string PreviewContentRequestPathPrefix = $"/{Constants.DeliveryApi.Routing.PreviewContentPathPrefix}";
[Obsolete($"Please use the constructor that does not accept {nameof(IPublicAccessService)}. Will be removed in V14.")]
public ByRouteContentApiController(
IApiPublishedContentCache apiPublishedContentCache,
IApiContentResponseBuilder apiContentResponseBuilder,
IPublicAccessService publicAccessService,
IRequestRoutingService requestRoutingService,
IRequestRedirectService requestRedirectService,
IRequestPreviewService requestPreviewService)
: this(
apiPublishedContentCache,
apiContentResponseBuilder,
requestRoutingService,
requestRedirectService,
requestPreviewService,
StaticServiceProvider.Instance.GetRequiredService<IRequestMemberAccessService>())
{
}
[Obsolete($"Please use the constructor that does not accept {nameof(IPublicAccessService)}. Will be removed in V14.")]
public ByRouteContentApiController(
IApiPublishedContentCache apiPublishedContentCache,
IApiContentResponseBuilder apiContentResponseBuilder,
IPublicAccessService publicAccessService,
IRequestRoutingService requestRoutingService,
IRequestRedirectService requestRedirectService,
IRequestPreviewService requestPreviewService,
IRequestMemberAccessService requestMemberAccessService)
: this(
apiPublishedContentCache,
apiContentResponseBuilder,
requestRoutingService,
requestRedirectService,
requestPreviewService,
requestMemberAccessService)
{
}
[Obsolete($"Please use the constructor that accepts {nameof(IApiContentPathResolver)}. Will be removed in V15.")]
public ByRouteContentApiController(
IApiPublishedContentCache apiPublishedContentCache,
@@ -1,35 +1,18 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Cms.Core.DependencyInjection;
using Umbraco.Cms.Core.Models.PublishedContent;
using Umbraco.Cms.Core.Security;
using Umbraco.Cms.Core.Services;
namespace Umbraco.Cms.Api.Delivery.Controllers.Content;
public abstract class ContentApiItemControllerBase : ContentApiControllerBase
{
// TODO: Remove this in V14 when the obsolete constructors have been removed
private readonly IPublicAccessService _publicAccessService;
[Obsolete($"Please use the constructor that does not accept {nameof(IPublicAccessService)}. Will be removed in V14.")]
protected ContentApiItemControllerBase(
IApiPublishedContentCache apiPublishedContentCache,
IApiContentResponseBuilder apiContentResponseBuilder,
IPublicAccessService publicAccessService)
: this(apiPublishedContentCache, apiContentResponseBuilder)
{
}
protected ContentApiItemControllerBase(
IApiPublishedContentCache apiPublishedContentCache,
IApiContentResponseBuilder apiContentResponseBuilder)
: base(apiPublishedContentCache, apiContentResponseBuilder)
=> _publicAccessService = StaticServiceProvider.Instance.GetRequiredService<IPublicAccessService>();
[Obsolete($"Please use {nameof(IPublicAccessService)} to test for content protection. Will be removed in V14.")]
protected bool IsProtected(IPublishedContent content) => _publicAccessService.IsProtected(content.Path);
{
}
protected async Task<IActionResult?> HandleMemberAccessAsync(IPublishedContent contentItem, IRequestMemberAccessService requestMemberAccessService)
{
@@ -1,11 +1,9 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
using Umbraco.Cms.Api.Common.ViewModels.Pagination;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Cms.Core.DependencyInjection;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Models.DeliveryApi;
using Umbraco.Cms.Core.Models.PublishedContent;
@@ -21,20 +19,6 @@ public class QueryContentApiController : ContentApiControllerBase
private readonly IRequestMemberAccessService _requestMemberAccessService;
private readonly IApiContentQueryService _apiContentQueryService;
[Obsolete($"Please use the constructor that accepts {nameof(IRequestMemberAccessService)}. Will be removed in V14.")]
public QueryContentApiController(
IApiPublishedContentCache apiPublishedContentCache,
IApiContentResponseBuilder apiContentResponseBuilderBuilder,
IApiContentQueryService apiContentQueryService)
: this(
apiPublishedContentCache,
apiContentResponseBuilderBuilder,
apiContentQueryService,
StaticServiceProvider.Instance.GetRequiredService<IRequestMemberAccessService>())
{
}
[ActivatorUtilitiesConstructor]
public QueryContentApiController(
IApiPublishedContentCache apiPublishedContentCache,
IApiContentResponseBuilder apiContentResponseBuilderBuilder,
@@ -1,16 +1,20 @@
using System.Net;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Common.Attributes;
using Umbraco.Cms.Api.Common.Filters;
using Umbraco.Cms.Api.Delivery.Configuration;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Features;
using Umbraco.Cms.Web.Common.Authorization;
namespace Umbraco.Cms.Api.Delivery.Controllers;
[ApiController]
[JsonOptionsName(Constants.JsonOptionsNames.DeliveryApi)]
[MapToApi(DeliveryApiConfiguration.ApiName)]
public abstract class DeliveryApiControllerBase : Controller
[Authorize(Policy = AuthorizationPolicies.UmbracoFeatureEnabled)]
public abstract class DeliveryApiControllerBase : Controller, IUmbracoFeature
{
protected string DecodePath(string path)
{
@@ -1,4 +1,4 @@
using System.Security.Claims;
using System.Security.Claims;
using Asp.Versioning;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Authentication;
@@ -15,13 +15,12 @@ using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Cms.Core.Security;
using Umbraco.Cms.Web.Common.Security;
using Umbraco.Extensions;
using SignInResult = Microsoft.AspNetCore.Mvc.SignInResult;
using IdentitySignInResult = Microsoft.AspNetCore.Identity.SignInResult;
using SignInResult = Microsoft.AspNetCore.Mvc.SignInResult;
namespace Umbraco.Cms.Api.Delivery.Controllers.Security;
[ApiVersion("1.0")]
[ApiController]
[VersionedDeliveryApiRoute(Common.Security.Paths.MemberApi.EndpointTemplate)]
[ApiExplorerSettings(IgnoreApi = true)]
public class MemberController : DeliveryApiControllerBase
@@ -1,18 +0,0 @@
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.SwaggerGen;
namespace Umbraco.Cms.Api.Delivery.Filters;
[Obsolete($"Superseded by {nameof(SwaggerContentDocumentationFilter)} and {nameof(SwaggerMediaDocumentationFilter)}. Will be removed in V14.")]
public class SwaggerDocumentationFilter : IOperationFilter, IParameterFilter
{
public void Apply(OpenApiOperation operation, OperationFilterContext context)
{
// retained for backwards compat
}
public void Apply(OpenApiParameter parameter, ParameterFilterContext context)
{
// retained for backwards compat
}
}
@@ -1,4 +1,4 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Umbraco.Cms.Core;
@@ -1,4 +1,4 @@
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using OpenIddict.Abstractions;
using Umbraco.Cms.Core.Configuration.Models;
@@ -73,7 +73,7 @@ internal sealed class RevokeMemberAuthenticationTokensNotificationHandler
return;
}
_logger.LogInformation("Deleting {count} active tokens for member with ID {id}", tokens.Length, member.Id);
_logger.LogInformation("Revoking {count} active tokens for member with ID {id}", tokens.Length, member.Id);
foreach (var token in tokens)
{
await _tokenManager.DeleteAsync(token);
@@ -1,56 +1,7 @@
using System.Text.Json;
using System.Text.Json.Serialization;
using System.Text.Json.Serialization.Metadata;
using Umbraco.Cms.Core.Models.DeliveryApi;
using Umbraco.Cms.Infrastructure.Serialization;
namespace Umbraco.Cms.Api.Delivery.Json;
// see https://learn.microsoft.com/en-us/dotnet/standard/serialization/system-text-json/polymorphism?pivots=dotnet-7-0
public class DeliveryApiJsonTypeResolver : DefaultJsonTypeInfoResolver
{
public override JsonTypeInfo GetTypeInfo(Type type, JsonSerializerOptions options)
{
JsonTypeInfo jsonTypeInfo = base.GetTypeInfo(type, options);
Type[] derivedTypes = GetDerivedTypes(jsonTypeInfo);
if (derivedTypes.Length > 0)
{
ConfigureJsonPolymorphismOptions(jsonTypeInfo, derivedTypes);
}
return jsonTypeInfo;
}
protected virtual Type[] GetDerivedTypes(JsonTypeInfo jsonTypeInfo)
{
if (jsonTypeInfo.Type == typeof(IApiContent))
{
return new[] { typeof(ApiContent) };
}
if (jsonTypeInfo.Type == typeof(IApiContentResponse))
{
return new[] { typeof(ApiContentResponse) };
}
if (jsonTypeInfo.Type == typeof(IRichTextElement))
{
return new[] { typeof(RichTextRootElement), typeof(RichTextGenericElement), typeof(RichTextTextElement) };
}
return Array.Empty<Type>();
}
protected void ConfigureJsonPolymorphismOptions(JsonTypeInfo jsonTypeInfo, params Type[] derivedTypes)
{
jsonTypeInfo.PolymorphismOptions = new JsonPolymorphismOptions
{
UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FailSerialization,
};
foreach (Type derivedType in derivedTypes)
{
jsonTypeInfo.PolymorphismOptions.DerivedTypes.Add(new JsonDerivedType(derivedType));
}
}
}
public class DeliveryApiJsonTypeResolver : ContentJsonTypeResolverBase
{ }
@@ -0,0 +1,88 @@
using System.Reflection;
using System.Text.Json;
using System.Text.Json.Serialization;
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Umbraco.Cms.Core.DeliveryApi;
namespace Umbraco.Cms.Api.Delivery.Json;
public abstract class DeliveryApiVersionAwareJsonConverterBase<T> : JsonConverter<T>
{
private readonly IHttpContextAccessor _httpContextAccessor;
private readonly JsonConverter<T> _defaultConverter = (JsonConverter<T>)JsonSerializerOptions.Default.GetConverter(typeof(T));
public DeliveryApiVersionAwareJsonConverterBase(IHttpContextAccessor httpContextAccessor)
=> _httpContextAccessor = httpContextAccessor;
/// <inheritdoc />
public override T? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
=> _defaultConverter.Read(ref reader, typeToConvert, options);
/// <inheritdoc />
public override void Write(Utf8JsonWriter writer, T value, JsonSerializerOptions options)
{
Type type = typeof(T);
var apiVersion = GetApiVersion();
// Get the properties in the specified order
PropertyInfo[] properties = type.GetProperties().OrderBy(GetPropertyOrder).ToArray();
writer.WriteStartObject();
foreach (PropertyInfo property in properties)
{
// Filter out properties based on the API version
var include = apiVersion is null || ShouldIncludeProperty(property, apiVersion.Value);
if (include is false)
{
continue;
}
var propertyName = property.Name;
writer.WritePropertyName(options.PropertyNamingPolicy?.ConvertName(propertyName) ?? propertyName);
JsonSerializer.Serialize(writer, property.GetValue(value), options);
}
writer.WriteEndObject();
}
private int? GetApiVersion()
{
HttpContext? httpContext = _httpContextAccessor.HttpContext;
ApiVersion? apiVersion = httpContext?.GetRequestedApiVersion();
return apiVersion?.MajorVersion;
}
private int GetPropertyOrder(PropertyInfo prop)
{
var attribute = prop.GetCustomAttribute<JsonPropertyOrderAttribute>();
return attribute?.Order ?? 0;
}
/// <summary>
/// Determines whether a property should be included based on version bounds.
/// </summary>
/// <param name="propertyInfo">The property info.</param>
/// <param name="version">An integer representing an API version.</param>
/// <returns><c>true</c> if the property should be included; otherwise, <c>false</c>.</returns>
private bool ShouldIncludeProperty(PropertyInfo propertyInfo, int version)
{
var attribute = propertyInfo
.GetCustomAttributes(typeof(IncludeInApiVersionAttribute), false)
.FirstOrDefault();
if (attribute is not IncludeInApiVersionAttribute apiVersionAttribute)
{
return true; // No attribute means include the property
}
// Check if the version is within the specified bounds
var isWithinMinVersion = apiVersionAttribute.MinVersion.HasValue is false || version >= apiVersionAttribute.MinVersion.Value;
var isWithinMaxVersion = apiVersionAttribute.MaxVersion.HasValue is false || version <= apiVersionAttribute.MaxVersion.Value;
return isWithinMinVersion && isWithinMaxVersion;
}
}
@@ -15,7 +15,8 @@ public sealed class AncestorsSelector : QueryOptionBase, ISelectorHandler
private readonly IRequestPreviewService _requestPreviewService;
[Obsolete("Please use the non-obsolete constructor. Will be removed in V17.")]
public AncestorsSelector(IPublishedSnapshotAccessor publishedSnapshotAccessor,
public AncestorsSelector(
IPublishedSnapshotAccessor publishedSnapshotAccessor,
IRequestRoutingService requestRoutingService)
: this(publishedSnapshotAccessor, requestRoutingService, StaticServiceProvider.Instance.GetRequiredService<IRequestPreviewService>())
{
@@ -1,4 +1,4 @@
using OpenIddict.Abstractions;
using OpenIddict.Abstractions;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Infrastructure.Security;
@@ -36,7 +36,7 @@ public class MemberApplicationManager : OpenIdDictApplicationManagerBase, IMembe
{
DisplayName = "Umbraco member access",
ClientId = Constants.OAuthClientIds.Member,
Type = OpenIddictConstants.ClientTypes.Public,
ClientType = OpenIddictConstants.ClientTypes.Public,
Permissions =
{
OpenIddictConstants.Permissions.Endpoints.Authorization,
@@ -48,17 +48,6 @@ internal sealed class ApiContentQueryProvider : IApiContentQueryProvider
}
[Obsolete($"Use the {nameof(ExecuteQuery)} method that accepts {nameof(ProtectedAccess)}. Will be removed in V14.")]
public PagedModel<Guid> ExecuteQuery(
SelectorOption selectorOption,
IList<FilterOption> filterOptions,
IList<SortOption> sortOptions,
string culture,
bool preview,
int skip,
int take)
=> ExecuteQuery(selectorOption, filterOptions, sortOptions, culture, ProtectedAccess.None, preview, skip, take);
/// <inheritdoc/>
public PagedModel<Guid> ExecuteQuery(
SelectorOption selectorOption,
@@ -37,15 +37,6 @@ internal sealed class ApiContentQueryService : IApiContentQueryService
_requestPreviewService = requestPreviewService;
}
[Obsolete($"Use the {nameof(ExecuteQuery)} method that accepts {nameof(ProtectedAccess)}. Will be removed in V14.")]
public Attempt<PagedModel<Guid>, ApiContentQueryOperationStatus> ExecuteQuery(
string? fetch,
IEnumerable<string> filters,
IEnumerable<string> sorts,
int skip,
int take)
=> ExecuteQuery(fetch, filters, sorts, ProtectedAccess.None, skip, take);
/// <inheritdoc/>
public Attempt<PagedModel<Guid>, ApiContentQueryOperationStatus> ExecuteQuery(
string? fetch,
@@ -1,4 +1,4 @@
using System.Security.Claims;
using System.Security.Claims;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Options;
@@ -3,7 +3,11 @@
<Title>Umbraco CMS - Delivery API</Title>
<Description>Contains the presentation layer for the Umbraco CMS Delivery API.</Description>
</PropertyGroup>
<PropertyGroup>
<!-- TODO: [ASP0019] use IHeaderDictionary.Append or the indexer to append or set headers,
and remove this override -->
<WarningsNotAsErrors>ASP0019</WarningsNotAsErrors>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Umbraco.Cms.Api.Common\Umbraco.Cms.Api.Common.csproj" />
<ProjectReference Include="..\Umbraco.Web.Common\Umbraco.Web.Common.csproj" />
@@ -0,0 +1,254 @@
using System.Security.Claims;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.AspNetCore.DataProtection;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using Umbraco.Cms.Api.Management.Security;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Cms.Core.Net;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Web.Common.Security;
using Umbraco.Extensions;
namespace Umbraco.Cms.Api.Management.Configuration;
/// <summary>
/// Used to configure <see cref="CookieAuthenticationOptions" /> for the back office authentication type
/// </summary>
public class ConfigureBackOfficeCookieOptions : IConfigureNamedOptions<CookieAuthenticationOptions>
{
private readonly IDataProtectionProvider _dataProtection;
private readonly GlobalSettings _globalSettings;
private readonly IIpResolver _ipResolver;
private readonly IRuntimeState _runtimeState;
private readonly SecuritySettings _securitySettings;
private readonly IUserService _userService;
private readonly TimeProvider _timeProvider;
/// <summary>
/// Initializes a new instance of the <see cref="ConfigureBackOfficeCookieOptions" /> class.
/// </summary>
/// <param name="securitySettings">The <see cref="SecuritySettings" /> options</param>
/// <param name="globalSettings">The <see cref="GlobalSettings" /> options</param>
/// <param name="runtimeState">The <see cref="IRuntimeState" /></param>
/// <param name="dataProtection">The <see cref="IDataProtectionProvider" /></param>
/// <param name="userService">The <see cref="IUserService" /></param>
/// <param name="ipResolver">The <see cref="IIpResolver" /></param>
/// <param name="timeProvider">The <see cref="TimeProvider" /></param>
public ConfigureBackOfficeCookieOptions(
IOptions<SecuritySettings> securitySettings,
IOptions<GlobalSettings> globalSettings,
IRuntimeState runtimeState,
IDataProtectionProvider dataProtection,
IUserService userService,
IIpResolver ipResolver,
TimeProvider timeProvider)
{
_securitySettings = securitySettings.Value;
_globalSettings = globalSettings.Value;
_runtimeState = runtimeState;
_dataProtection = dataProtection;
_userService = userService;
_ipResolver = ipResolver;
_timeProvider = timeProvider;
}
/// <inheritdoc />
public void Configure(string? name, CookieAuthenticationOptions options)
{
if (name != Constants.Security.BackOfficeAuthenticationType)
{
return;
}
Configure(options);
}
/// <inheritdoc />
public void Configure(CookieAuthenticationOptions options)
{
options.SlidingExpiration = false;
options.ExpireTimeSpan = _globalSettings.TimeOut;
options.Cookie.Domain = _securitySettings.AuthCookieDomain;
options.Cookie.Name = _securitySettings.AuthCookieName;
options.Cookie.HttpOnly = true;
options.Cookie.SecurePolicy =
_globalSettings.UseHttps ? CookieSecurePolicy.Always : CookieSecurePolicy.SameAsRequest;
options.Cookie.Path = "/";
// NOTE: matches route in BackOfficeLoginController
const string backOfficeLoginPath = "/umbraco/login";
options.LoginPath = backOfficeLoginPath;
options.LogoutPath = backOfficeLoginPath;
options.AccessDeniedPath = backOfficeLoginPath;
options.DataProtectionProvider = _dataProtection;
// NOTE: This is borrowed directly from aspnetcore source
// Note: the purpose for the data protector must remain fixed for interop to work.
IDataProtector dataProtector = options.DataProtectionProvider.CreateProtector(
"Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationMiddleware",
Constants.Security.BackOfficeAuthenticationType,
"v2");
var ticketDataFormat = new TicketDataFormat(dataProtector);
options.TicketDataFormat = new BackOfficeSecureDataFormat(_globalSettings.TimeOut, ticketDataFormat);
options.Events = new CookieAuthenticationEvents
{
// IMPORTANT! If you set any of OnRedirectToLogin, OnRedirectToAccessDenied, OnRedirectToLogout, OnRedirectToReturnUrl
// you need to be aware that this will bypass the default behavior of returning the correct status codes for ajax requests and
// not redirecting for non-ajax requests. This is because the default behavior is baked into this class here:
// https://github.com/dotnet/aspnetcore/blob/master/src/Security/Authentication/Cookies/src/CookieAuthenticationEvents.cs#L58
// It would be possible to re-use the default behavior if any of these need to be set but that must be taken into account else
// our back office requests will not function correctly. For now we don't need to set/configure any of these callbacks because
// the defaults work fine with our setup.
OnValidatePrincipal = async ctx =>
{
// We need to resolve the BackOfficeSecurityStampValidator per request as a requirement (even in aspnetcore they do this)
BackOfficeSecurityStampValidator securityStampValidator =
ctx.HttpContext.RequestServices.GetRequiredService<BackOfficeSecurityStampValidator>();
// Same goes for the signinmanager
IBackOfficeSignInManager signInManager =
ctx.HttpContext.RequestServices.GetRequiredService<IBackOfficeSignInManager>();
ClaimsIdentity? backOfficeIdentity = ctx.Principal?.GetUmbracoIdentity();
if (backOfficeIdentity == null)
{
ctx.RejectPrincipal();
await signInManager.SignOutAsync();
}
// ensure the thread culture is set
backOfficeIdentity?.EnsureCulture();
EnsureTicketRenewalIfKeepUserLoggedIn(ctx);
// add or update a claim to track when the cookie expires, we use this to track time remaining
backOfficeIdentity?.AddOrUpdateClaim(new Claim(
Constants.Security.TicketExpiresClaimType,
ctx.Properties.ExpiresUtc!.Value.ToString("o"),
ClaimValueTypes.DateTime,
Constants.Security.BackOfficeAuthenticationType,
Constants.Security.BackOfficeAuthenticationType,
backOfficeIdentity));
await securityStampValidator.ValidateAsync(ctx);
// We have to manually specify Issued and Expires,
// because the SecurityStampValidator refreshes the principal every 30 minutes,
// When the principal is refreshed the Issued is update to time of refresh, however, the Expires remains unchanged
// When we then try and renew, the difference of issued and expires effectively becomes the new ExpireTimeSpan
// meaning we effectively lose 30 minutes of our ExpireTimeSpan for EVERY principal refresh if we don't
// https://github.com/dotnet/aspnetcore/blob/main/src/Security/Authentication/Cookies/src/CookieAuthenticationHandler.cs#L115
ctx.Properties.IssuedUtc = _timeProvider.GetUtcNow();
ctx.Properties.ExpiresUtc = _timeProvider.GetUtcNow().Add(_globalSettings.TimeOut);
ctx.ShouldRenew = true;
},
OnSigningIn = ctx =>
{
// occurs when sign in is successful but before the ticket is written to the outbound cookie
ClaimsIdentity? backOfficeIdentity = ctx.Principal?.GetUmbracoIdentity();
if (backOfficeIdentity != null)
{
// generate a session id and assign it
// create a session token - if we are configured and not in an upgrade state then use the db, otherwise just generate one
Guid session = _runtimeState.Level == RuntimeLevel.Run
? _userService.CreateLoginSession(
backOfficeIdentity.GetId()!.Value,
_ipResolver.GetCurrentRequestIpAddress())
: Guid.NewGuid();
// add our session claim
backOfficeIdentity.AddClaim(new Claim(
Constants.Security.SessionIdClaimType,
session.ToString(),
ClaimValueTypes.String,
Constants.Security.BackOfficeAuthenticationType,
Constants.Security.BackOfficeAuthenticationType,
backOfficeIdentity));
// since it is a cookie-based authentication add that claim
backOfficeIdentity.AddClaim(new Claim(
ClaimTypes.CookiePath,
"/",
ClaimValueTypes.String,
Constants.Security.BackOfficeAuthenticationType,
Constants.Security.BackOfficeAuthenticationType,
backOfficeIdentity));
}
return Task.CompletedTask;
},
OnSignedIn = ctx =>
{
// occurs when sign in is successful and after the ticket is written to the outbound cookie
// When we are signed in with the cookie, assign the principal to the current HttpContext
ctx.HttpContext.SetPrincipalForRequest(ctx.Principal);
return Task.CompletedTask;
},
OnSigningOut = ctx =>
{
// Clear the user's session on sign out
if (ctx.HttpContext?.User?.Identity != null)
{
var claimsIdentity = ctx.HttpContext.User.Identity as ClaimsIdentity;
var sessionId = claimsIdentity?.FindFirstValue(Constants.Security.SessionIdClaimType);
if (sessionId.IsNullOrWhiteSpace() == false && Guid.TryParse(sessionId, out Guid guidSession))
{
_userService.ClearLoginSession(guidSession);
}
}
// Remove all of our cookies
var cookies = new[]
{
_securitySettings.AuthCookieName,
Constants.Web.PreviewCookieName, Constants.Security.BackOfficeExternalCookieName,
Constants.Web.CsrfValidationCookieName
};
foreach (var cookie in cookies)
{
ctx.Options.CookieManager.DeleteCookie(ctx.HttpContext!, cookie, new CookieOptions { Path = "/" });
}
return Task.CompletedTask;
}
};
}
/// <summary>
/// Ensures the ticket is renewed if the <see cref="SecuritySettings.KeepUserLoggedIn" /> is set to true
/// and the current request is for the get user seconds endpoint
/// </summary>
/// <param name="context">The <see cref="CookieValidatePrincipalContext" /></param>
private void EnsureTicketRenewalIfKeepUserLoggedIn(CookieValidatePrincipalContext context)
{
if (!_securitySettings.KeepUserLoggedIn)
{
return;
}
DateTimeOffset currentUtc = _timeProvider.GetUtcNow();
DateTimeOffset? issuedUtc = context.Properties.IssuedUtc;
DateTimeOffset? expiresUtc = context.Properties.ExpiresUtc;
if (expiresUtc.HasValue && issuedUtc.HasValue)
{
TimeSpan timeElapsed = currentUtc.Subtract(issuedUtc.Value);
TimeSpan timeRemaining = expiresUtc.Value.Subtract(currentUtc);
// if it's time to renew, then do it
if (timeRemaining < timeElapsed)
{
context.ShouldRenew = true;
}
}
}
}
@@ -0,0 +1,28 @@
using Microsoft.Extensions.Options;
using Umbraco.Cms.Api.Management.Security;
using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Cms.Web.Common.Security;
namespace Umbraco.Cms.Api.Management.Configuration;
/// <summary>
/// Configures the back office security stamp options.
/// </summary>
public class ConfigureBackOfficeSecurityStampValidatorOptions : IConfigureOptions<BackOfficeSecurityStampValidatorOptions>
{
private readonly SecuritySettings _securitySettings;
private readonly TimeProvider _timeProvider;
public ConfigureBackOfficeSecurityStampValidatorOptions(IOptions<SecuritySettings> securitySettings, TimeProvider timeProvider)
{
_timeProvider = timeProvider;
_securitySettings = securitySettings.Value;
}
/// <inheritdoc />
public void Configure(BackOfficeSecurityStampValidatorOptions options)
{
options.TimeProvider = _timeProvider;
ConfigureSecurityStampOptions.ConfigureOptions(options, _securitySettings);
}
}
@@ -0,0 +1,66 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.SwaggerGen;
using Umbraco.Cms.Api.Common.OpenApi;
using Umbraco.Cms.Api.Common.Serialization;
using Umbraco.Cms.Api.Management.DependencyInjection;
using Umbraco.Cms.Api.Management.OpenApi;
namespace Umbraco.Cms.Api.Management.Configuration;
public class ConfigureUmbracoManagementApiSwaggerGenOptions : IConfigureOptions<SwaggerGenOptions>
{
private IUmbracoJsonTypeInfoResolver _umbracoJsonTypeInfoResolver;
public ConfigureUmbracoManagementApiSwaggerGenOptions(IUmbracoJsonTypeInfoResolver umbracoJsonTypeInfoResolver)
{
_umbracoJsonTypeInfoResolver = umbracoJsonTypeInfoResolver;
}
public void Configure(SwaggerGenOptions swaggerGenOptions)
{
swaggerGenOptions.SwaggerDoc(
ManagementApiConfiguration.ApiName,
new OpenApiInfo
{
Title = ManagementApiConfiguration.ApiTitle,
Version = "Latest",
Description = "This shows all APIs available in this version of Umbraco - including all the legacy apis that are available for backward compatibility",
});
swaggerGenOptions.OperationFilter<ResponseHeaderOperationFilter>();
swaggerGenOptions.SelectSubTypesUsing(_umbracoJsonTypeInfoResolver.FindSubTypes);
swaggerGenOptions.UseOneOfForPolymorphism();
// Ensure all types that implements the IOpenApiDiscriminator have a $type property in the OpenApi schema with the default value (The class name) that is expected by the server
swaggerGenOptions.SelectDiscriminatorNameUsing(type => _umbracoJsonTypeInfoResolver.GetTypeDiscriminatorValue(type) is not null ? "$type" : null);
swaggerGenOptions.SelectDiscriminatorValueUsing(_umbracoJsonTypeInfoResolver.GetTypeDiscriminatorValue);
swaggerGenOptions.AddSecurityDefinition(
ManagementApiConfiguration.ApiSecurityName,
new OpenApiSecurityScheme
{
In = ParameterLocation.Header,
Name = "Umbraco",
Type = SecuritySchemeType.OAuth2,
Description = "Umbraco Authentication",
Flows = new OpenApiOAuthFlows
{
AuthorizationCode = new OpenApiOAuthFlow
{
AuthorizationUrl =
new Uri(Common.Security.Paths.BackOfficeApi.AuthorizationEndpoint, UriKind.Relative),
TokenUrl = new Uri(Common.Security.Paths.BackOfficeApi.TokenEndpoint, UriKind.Relative)
}
}
});
// Sets Security requirement on backoffice apis
swaggerGenOptions.OperationFilter<BackOfficeSecurityRequirementsOperationFilter>();
swaggerGenOptions.OperationFilter<NotificationHeaderFilter>();
swaggerGenOptions.SchemaFilter<RequireNonNullablePropertiesSchemaFilter>();
}
}
@@ -0,0 +1,69 @@
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Cms.Core.Hosting;
namespace Umbraco.Cms.Api.Management;
[BindProperties]
public class BackOfficeLoginModel
{
/// <summary>
/// Gets or sets the value of the "ReturnUrl" query parameter or defaults to the configured Umbraco directory.
/// </summary>
[FromQuery(Name = "ReturnUrl")]
public string? ReturnUrl { get; set; }
/// <summary>
/// The configured Umbraco directory.
/// </summary>
public string? UmbracoUrl { get; set; }
public bool UserIsAlreadyLoggedIn { get; set; }
}
[ApiExplorerSettings(IgnoreApi=true)]
[Route(LoginPath)]
public class BackOfficeLoginController : Controller
{
public const string LoginPath = "/umbraco/login";
private readonly IHostingEnvironment _hostingEnvironment;
private readonly GlobalSettings _globalSettings;
public BackOfficeLoginController(
IOptionsSnapshot<GlobalSettings> globalSettings,
IHostingEnvironment hostingEnvironment)
{
_hostingEnvironment = hostingEnvironment;
_globalSettings = globalSettings.Value ?? throw new ArgumentNullException(nameof(globalSettings));
}
// GET
public async Task<IActionResult> Index(CancellationToken cancellationToken, BackOfficeLoginModel model)
{
AuthenticateResult cookieAuthResult = await HttpContext.AuthenticateAsync(Constants.Security.BackOfficeAuthenticationType);
if (cookieAuthResult.Succeeded)
{
model.UserIsAlreadyLoggedIn = true;
}
if (string.IsNullOrEmpty(model.UmbracoUrl))
{
model.UmbracoUrl = _hostingEnvironment.ToAbsolute(_globalSettings.UmbracoPath);
}
if (string.IsNullOrEmpty(model.ReturnUrl))
{
model.ReturnUrl = model.UmbracoUrl;
}
if ( Uri.TryCreate(model.ReturnUrl, UriKind.Relative, out _) is false) // Needs to test for relative and not absolute, as /whatever/ is an absolute path on linux
{
return BadRequest("ReturnUrl must be a relative path.");
}
return View("/umbraco/UmbracoLogin/Index.cshtml", model);
}
}
@@ -0,0 +1,95 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Common.ViewModels.Pagination;
using Umbraco.Cms.Api.Management.ViewModels.Content;
using Umbraco.Cms.Core.Mapping;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Models.ContentEditing;
using Umbraco.Cms.Core.PropertyEditors;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Extensions;
namespace Umbraco.Cms.Api.Management.Controllers.Content;
public abstract class ContentCollectionControllerBase<TContent, TCollectionResponseModel, TValueResponseModelBase, TVariantResponseModel> : ManagementApiControllerBase
where TContent : class, IContentBase
where TCollectionResponseModel : ContentResponseModelBase<TValueResponseModelBase, TVariantResponseModel>
where TValueResponseModelBase : ValueModelBase
where TVariantResponseModel : VariantResponseModelBase
{
private readonly IUmbracoMapper _mapper;
protected ContentCollectionControllerBase(IUmbracoMapper mapper) => _mapper = mapper;
protected IActionResult CollectionResult(ListViewPagedModel<TContent> result)
{
PagedModel<TContent> collectionItemsResult = result.Items;
ListViewConfiguration collectionConfiguration = result.ListViewConfiguration;
var collectionPropertyAliases = collectionConfiguration
.IncludeProperties
.Select(p => p.Alias)
.WhereNotNull()
.ToArray();
List<TCollectionResponseModel> collectionResponseModels =
_mapper.MapEnumerable<TContent, TCollectionResponseModel>(collectionItemsResult.Items, context =>
{
context.SetIncludedProperties(collectionPropertyAliases);
});
var pageViewModel = new PagedViewModel<TCollectionResponseModel>
{
Items = collectionResponseModels,
Total = collectionItemsResult.Total,
};
return Ok(pageViewModel);
}
protected IActionResult ContentCollectionOperationStatusResult(ContentCollectionOperationStatus status, string type) =>
OperationStatusResult(status, problemDetailsBuilder => status switch
{
ContentCollectionOperationStatus.CollectionNotFound => new NotFoundObjectResult(problemDetailsBuilder
.WithTitle("Collection data type could not be found")
.WithDetail($"No collection data type was found for the corresponding {type} type. Ensure that the default and/or a custom collection data types exists")
.Build()),
ContentCollectionOperationStatus.ContentNotCollection => new BadRequestObjectResult(problemDetailsBuilder
.WithTitle($"The {type} item is not configured as a collection")
.WithDetail($"The specified {type} is not configured as a collection")
.Build()),
ContentCollectionOperationStatus.ContentNotFound => new NotFoundObjectResult(problemDetailsBuilder
.WithTitle($"The specified {type} could not be found")
.Build()),
ContentCollectionOperationStatus.ContentTypeNotFound => new BadRequestObjectResult(problemDetailsBuilder
.WithTitle($"The related {type} type could not be found")
.Build()),
ContentCollectionOperationStatus.DataTypeNotCollection => new BadRequestObjectResult(problemDetailsBuilder
.WithTitle("Data type id does not belong to a collection")
.WithDetail("The specified data type does not represent a collection")
.Build()),
ContentCollectionOperationStatus.DataTypeNotContentProperty => new BadRequestObjectResult(problemDetailsBuilder
.WithTitle($"Data type id is not a {type} property")
.WithDetail($"The specified data type is not part of the {type} properties")
.Build()),
ContentCollectionOperationStatus.DataTypeNotFound => new NotFoundObjectResult(problemDetailsBuilder
.WithTitle("The specified collection data type could not be found")
.Build()),
ContentCollectionOperationStatus.DataTypeWithoutContentType => new BadRequestObjectResult(problemDetailsBuilder
.WithTitle($"Missing {type} when specifying a collection data type")
.WithDetail($"The specified collection data type needs to be used in conjunction with a {type} item.")
.Build()),
ContentCollectionOperationStatus.MissingPropertiesInCollectionConfiguration => new BadRequestObjectResult(problemDetailsBuilder
.WithTitle("Missing properties in collection configuration")
.WithDetail("No properties are configured to display in the collection configuration")
.Build()),
ContentCollectionOperationStatus.OrderByNotPartOfCollectionConfiguration => new BadRequestObjectResult(problemDetailsBuilder
.WithTitle("Order by value is not a property on the configured collection")
.WithDetail("The specified orderBy property is not part of the collection configuration")
.Build()),
_ => new ObjectResult("Unknown content collection operation status")
{
StatusCode = StatusCodes.Status500InternalServerError,
},
});
}
@@ -0,0 +1,138 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.ViewModels.Content;
using Umbraco.Cms.Core.Mapping;
using Umbraco.Cms.Core.Models.ContentEditing;
using Umbraco.Cms.Core.Models.ContentEditing.Validation;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Extensions;
namespace Umbraco.Cms.Api.Management.Controllers.Content;
public abstract class ContentControllerBase : ManagementApiControllerBase
{
protected IActionResult ContentEditingOperationStatusResult(ContentEditingOperationStatus status)
=> OperationStatusResult(status, problemDetailsBuilder => status switch
{
ContentEditingOperationStatus.CancelledByNotification => BadRequest(problemDetailsBuilder
.WithTitle("Cancelled by notification")
.WithDetail("A notification handler prevented the content operation.")
.Build()),
ContentEditingOperationStatus.ContentTypeNotFound => NotFound(problemDetailsBuilder
.WithTitle("The requested content type could not be found")
.Build()),
ContentEditingOperationStatus.ContentTypeCultureVarianceMismatch => BadRequest(problemDetailsBuilder
.WithTitle("Content type culture variance mismatch")
.WithDetail("The content type variance did not match that of the passed content data.")
.Build()),
ContentEditingOperationStatus.NotFound => NotFound(problemDetailsBuilder
.WithTitle("The content could not be found")
.Build()),
ContentEditingOperationStatus.ParentNotFound => NotFound(problemDetailsBuilder
.WithTitle("The targeted content parent could not be found")
.Build()),
ContentEditingOperationStatus.ParentInvalid => BadRequest(problemDetailsBuilder
.WithTitle("Invalid parent")
.WithDetail("The targeted parent was not valid for the operation.")
.Build()),
ContentEditingOperationStatus.NotAllowed => BadRequest(problemDetailsBuilder
.WithTitle("Operation not permitted")
.WithDetail(
"The attempted operation was not permitted, likely due to a permission/configuration mismatch with the operation.")
.Build()),
ContentEditingOperationStatus.TemplateNotFound => NotFound(problemDetailsBuilder
.WithTitle("The template could not be found")
.Build()),
ContentEditingOperationStatus.TemplateNotAllowed => BadRequest(problemDetailsBuilder
.WithTitle("Template not allowed")
.WithDetail("The selected template was not allowed for the operation.")
.Build()),
ContentEditingOperationStatus.PropertyTypeNotFound => NotFound(problemDetailsBuilder
.WithTitle("One or more property types could not be found")
.Build()),
ContentEditingOperationStatus.InTrash => BadRequest(problemDetailsBuilder
.WithTitle("Content is in the recycle bin")
.WithDetail("Could not perform the operation because the targeted content was in the recycle bin.")
.Build()),
ContentEditingOperationStatus.NotInTrash => BadRequest(problemDetailsBuilder
.WithTitle("Content is not in the recycle bin")
.WithDetail("The attempted operation requires the targeted content to be in the recycle bin.")
.Build()),
ContentEditingOperationStatus.SortingInvalid => BadRequest(problemDetailsBuilder
.WithTitle("Invalid sorting options")
.WithDetail("The supplied sorting operations were invalid. Additional details can be found in the log.")
.Build()),
ContentEditingOperationStatus.InvalidCulture => BadRequest(problemDetailsBuilder
.WithTitle("Invalid culture")
.WithDetail("One or more of the supplied culture codes did not match the configured languages.")
.Build()),
ContentEditingOperationStatus.DuplicateKey => BadRequest(problemDetailsBuilder
.WithTitle("Invalid Id")
.WithDetail("The supplied id is already in use.")
.Build()),
ContentEditingOperationStatus.DuplicateName => BadRequest(problemDetailsBuilder
.WithTitle("Duplicate name")
.WithDetail("The supplied name is already in use for the same content type.")
.Build()),
ContentEditingOperationStatus.Unknown => StatusCode(
StatusCodes.Status500InternalServerError,
problemDetailsBuilder
.WithTitle("Unknown error. Please see the log for more details.")
.Build()),
_ => StatusCode(StatusCodes.Status500InternalServerError, problemDetailsBuilder
.WithTitle("Unknown content operation status.")
.Build()),
});
protected IActionResult ContentEditingOperationStatusResult<TContentModelBase, TValueModel, TVariantModel>(
ContentEditingOperationStatus status,
TContentModelBase requestModel,
ContentValidationResult validationResult)
where TContentModelBase : ContentModelBase<TValueModel, TVariantModel>
where TValueModel : ValueModelBase
where TVariantModel : VariantModelBase
{
if (status is not ContentEditingOperationStatus.PropertyValidationError)
{
return ContentEditingOperationStatusResult(status);
}
var errors = new SortedDictionary<string, string[]>();
var missingPropertyModels = new List<PropertyValidationResponseModel>();
foreach (PropertyValidationError validationError in validationResult.ValidationErrors)
{
TValueModel? requestValue = requestModel.Values.FirstOrDefault(value =>
value.Alias == validationError.Alias
&& value.Culture == validationError.Culture
&& value.Segment == validationError.Segment);
if (requestValue is null)
{
missingPropertyModels.Add(MapMissingProperty(validationError));
continue;
}
var index = requestModel.Values.IndexOf(requestValue);
var key = $"$.{nameof(ContentModelBase<TValueModel, TVariantModel>.Values).ToFirstLowerInvariant()}[{index}].{nameof(ValueModelBase.Value).ToFirstLowerInvariant()}{validationError.JsonPath}";
errors.Add(key, validationError.ErrorMessages);
}
return OperationStatusResult(status, problemDetailsBuilder
=> BadRequest(problemDetailsBuilder
.WithTitle("Validation failed")
.WithDetail("One or more properties did not pass validation")
.WithRequestModelErrors(errors)
.WithExtension("missingValues", missingPropertyModels.ToArray())
.Build()));
}
private PropertyValidationResponseModel MapMissingProperty(PropertyValidationError source) =>
new()
{
Alias = source.Alias,
Segment = source.Segment,
Culture = source.Culture,
Messages = source.ErrorMessages,
};
}
@@ -0,0 +1,43 @@
using System.Globalization;
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Core.Mapping;
using Umbraco.Cms.Api.Management.ViewModels.Culture;
using Umbraco.Cms.Api.Common.ViewModels.Pagination;
using Umbraco.Cms.Core.Services;
namespace Umbraco.Cms.Api.Management.Controllers.Culture;
[ApiVersion("1.0")]
public class AllCultureController : CultureControllerBase
{
private readonly IUmbracoMapper _umbracoMapper;
private readonly ICultureService _cultureService;
public AllCultureController(IUmbracoMapper umbracoMapper, ICultureService cultureService)
{
_umbracoMapper = umbracoMapper;
_cultureService = cultureService;
}
/// <summary>
/// Returns all cultures available for creating languages.
/// </summary>
/// <returns></returns>
[HttpGet]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(PagedViewModel<CultureReponseModel>), StatusCodes.Status200OK)]
public async Task<PagedViewModel<CultureReponseModel>> GetAll(CancellationToken cancellationToken, int skip = 0, int take = 100)
{
CultureInfo[] all = _cultureService.GetValidCultureInfos();
var viewModel = new PagedViewModel<CultureReponseModel>
{
Items = _umbracoMapper.MapEnumerable<CultureInfo, CultureReponseModel>(all.Skip(skip).Take(take)),
Total = all.Length
};
return await Task.FromResult(viewModel);
}
}
@@ -0,0 +1,10 @@
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.Routing;
namespace Umbraco.Cms.Api.Management.Controllers.Culture;
[VersionedApiBackOfficeRoute("culture")]
[ApiExplorerSettings(GroupName = "Culture")]
public abstract class CultureControllerBase : ManagementApiControllerBase
{
}
@@ -0,0 +1,37 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.ViewModels.DataType;
using Umbraco.Cms.Core.Mapping;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Services;
namespace Umbraco.Cms.Api.Management.Controllers.DataType;
[ApiVersion("1.0")]
public class ByKeyDataTypeController : DataTypeControllerBase
{
private readonly IDataTypeService _dataTypeService;
private readonly IUmbracoMapper _umbracoMapper;
public ByKeyDataTypeController(IDataTypeService dataTypeService, IUmbracoMapper umbracoMapper)
{
_dataTypeService = dataTypeService;
_umbracoMapper = umbracoMapper;
}
[HttpGet("{id:guid}")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(DataTypeResponseModel), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
public async Task<IActionResult> ByKey(CancellationToken cancellationToken, Guid id)
{
IDataType? dataType = await _dataTypeService.GetAsync(id);
if (dataType == null)
{
return DataTypeNotFound();
}
return Ok(_umbracoMapper.Map<DataTypeResponseModel>(dataType));
}
}
@@ -0,0 +1,31 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using Umbraco.Cms.Api.Management.ViewModels.DataType;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Configuration.Models;
namespace Umbraco.Cms.Api.Management.Controllers.DataType;
[ApiVersion("1.0")]
public class ConfigurationDataTypeController : DataTypeControllerBase
{
private readonly DataTypesSettings _dataTypesSettings;
public ConfigurationDataTypeController(IOptionsSnapshot<DataTypesSettings> dataTypesSettings) => _dataTypesSettings = dataTypesSettings.Value;
[HttpGet("configuration")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(DatatypeConfigurationResponseModel), StatusCodes.Status200OK)]
public Task<IActionResult> Configuration(CancellationToken cancellationToken)
{
var responseModel = new DatatypeConfigurationResponseModel
{
CanBeChanged = _dataTypesSettings.CanBeChanged,
DocumentListViewId = Constants.DataTypes.Guids.ListViewContentGuid,
MediaListViewId = Constants.DataTypes.Guids.ListViewMediaGuid,
};
return Task.FromResult<IActionResult>(Ok(responseModel));
}
}
@@ -0,0 +1,46 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.ViewModels.DataType;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Security;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Cms.Web.Common.Authorization;
namespace Umbraco.Cms.Api.Management.Controllers.DataType;
[ApiVersion("1.0")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessDataTypes)]
public class CopyDataTypeController : DataTypeControllerBase
{
private readonly IDataTypeService _dataTypeService;
private readonly IBackOfficeSecurityAccessor _backOfficeSecurityAccessor;
public CopyDataTypeController(IDataTypeService dataTypeService, IBackOfficeSecurityAccessor backOfficeSecurityAccessor)
{
_dataTypeService = dataTypeService;
_backOfficeSecurityAccessor = backOfficeSecurityAccessor;
}
[HttpPost("{id:guid}/copy")]
[MapToApiVersion("1.0")]
[ProducesResponseType(StatusCodes.Status201Created)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
public async Task<IActionResult> Copy(CancellationToken cancellationToken, Guid id, CopyDataTypeRequestModel copyDataTypeRequestModel)
{
IDataType? source = await _dataTypeService.GetAsync(id);
if (source is null)
{
return DataTypeNotFound();
}
Attempt<IDataType, DataTypeOperationStatus> result = await _dataTypeService.CopyAsync(source, copyDataTypeRequestModel.Target?.Id, CurrentUserKey(_backOfficeSecurityAccessor));
return result.Success
? CreatedAtId<ByKeyDataTypeController>(controller => nameof(controller.ByKey), result.Result.Key)
: DataTypeOperationStatusResult(result.Status);
}
}
@@ -0,0 +1,50 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.Factories;
using Umbraco.Cms.Api.Management.ViewModels.DataType;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Security;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Cms.Web.Common.Authorization;
namespace Umbraco.Cms.Api.Management.Controllers.DataType;
[ApiVersion("1.0")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessDataTypes)]
public class CreateDataTypeController : DataTypeControllerBase
{
private readonly IDataTypeService _dataTypeService;
private readonly IDataTypePresentationFactory _dataTypePresentationFactory;
private readonly IBackOfficeSecurityAccessor _backOfficeSecurityAccessor;
public CreateDataTypeController(IDataTypeService dataTypeService, IDataTypePresentationFactory dataTypePresentationFactory, IBackOfficeSecurityAccessor backOfficeSecurityAccessor)
{
_dataTypeService = dataTypeService;
_dataTypePresentationFactory = dataTypePresentationFactory;
_backOfficeSecurityAccessor = backOfficeSecurityAccessor;
}
[HttpPost]
[MapToApiVersion("1.0")]
[ProducesResponseType(StatusCodes.Status201Created)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
public async Task<IActionResult> Create(CancellationToken cancellationToken, CreateDataTypeRequestModel createDataTypeRequestModel)
{
var attempt = await _dataTypePresentationFactory.CreateAsync(createDataTypeRequestModel);
if (!attempt.Success)
{
return DataTypeOperationStatusResult(attempt.Status);
}
Attempt<IDataType, DataTypeOperationStatus> result = await _dataTypeService.CreateAsync(attempt.Result, CurrentUserKey(_backOfficeSecurityAccessor));
return result.Success
? CreatedAtId<ByKeyDataTypeController>(controller => nameof(controller.ByKey), result.Result.Key)
: DataTypeOperationStatusResult(result.Status);
}
}
@@ -0,0 +1,62 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Common.Builders;
using Umbraco.Cms.Api.Management.Routing;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Cms.Web.Common.Authorization;
namespace Umbraco.Cms.Api.Management.Controllers.DataType;
[VersionedApiBackOfficeRoute(Constants.UdiEntityType.DataType)]
[ApiExplorerSettings(GroupName = "Data Type")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessDocumentOrMediaOrContentTypes)]
public abstract class DataTypeControllerBase : ManagementApiControllerBase
{
protected IActionResult DataTypeOperationStatusResult(DataTypeOperationStatus status) =>
OperationStatusResult(status, problemDetailsBuilder => status switch
{
DataTypeOperationStatus.InvalidConfiguration => BadRequest(problemDetailsBuilder
.WithTitle("Invalid data type configuration")
.WithDetail("The supplied data type configuration was not valid. Please see the log for more details.")
.Build()),
DataTypeOperationStatus.NotFound => DataTypeNotFound(problemDetailsBuilder),
DataTypeOperationStatus.InvalidName => BadRequest(problemDetailsBuilder
.WithTitle("Invalid data type name")
.WithDetail("The data type name must be non-empty and no longer than 255 characters.")
.Build()),
DataTypeOperationStatus.ParentNotContainer => BadRequest(problemDetailsBuilder
.WithTitle("parent id is not a container")
.WithDetail("The parent id does not represent a container.")
.Build()),
DataTypeOperationStatus.DuplicateKey => BadRequest(problemDetailsBuilder
.WithTitle("The id is already used")
.WithDetail("The data type id must be unique.")
.Build()),
DataTypeOperationStatus.CancelledByNotification => BadRequest(problemDetailsBuilder
.WithTitle("Cancelled by notification")
.WithDetail("A notification handler prevented the data type operation.")
.Build()),
DataTypeOperationStatus.PropertyEditorNotFound => NotFound(problemDetailsBuilder
.WithTitle("The targeted property editor was not found.")
.Build()),
DataTypeOperationStatus.ParentNotFound => NotFound(problemDetailsBuilder
.WithTitle("The targeted parent for the data type operation was not found.")
.Build()),
DataTypeOperationStatus.NonDeletable => BadRequest(problemDetailsBuilder
.WithTitle("The data type is non-deletable")
.WithDetail("The specified data type is required by the system and cannot be deleted.")
.Build()),
_ => StatusCode(StatusCodes.Status500InternalServerError, problemDetailsBuilder
.WithTitle("Unknown data type operation status.")
.Build()),
});
protected IActionResult DataTypeNotFound() => OperationStatusResult(DataTypeOperationStatus.NotFound, DataTypeNotFound);
private IActionResult DataTypeNotFound(ProblemDetailsBuilder problemDetailsBuilder)
=> NotFound(problemDetailsBuilder
.WithTitle("The data type could not be found")
.Build());
}
@@ -0,0 +1,40 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Security;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Cms.Web.Common.Authorization;
namespace Umbraco.Cms.Api.Management.Controllers.DataType;
[ApiVersion("1.0")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessDataTypes)]
public class DeleteDataTypeController : DataTypeControllerBase
{
private readonly IDataTypeService _dataTypeService;
private readonly IBackOfficeSecurityAccessor _backOfficeSecurityAccessor;
public DeleteDataTypeController(IDataTypeService dataTypeService, IBackOfficeSecurityAccessor backOfficeSecurityAccessor)
{
_dataTypeService = dataTypeService;
_backOfficeSecurityAccessor = backOfficeSecurityAccessor;
}
[HttpDelete("{id:guid}")]
[MapToApiVersion("1.0")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
public async Task<IActionResult> Delete(CancellationToken cancellationToken, Guid id)
{
Attempt<IDataType?, DataTypeOperationStatus> result = await _dataTypeService.DeleteAsync(id, CurrentUserKey(_backOfficeSecurityAccessor));
return result.Success
? Ok()
: DataTypeOperationStatusResult(result.Status);
}
}
@@ -0,0 +1,15 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.Routing;
using Umbraco.Cms.Core;
using Umbraco.Cms.Web.Common.Authorization;
namespace Umbraco.Cms.Api.Management.Controllers.DataType.Filter;
[ApiExplorerSettings(GroupName = "Data Type")]
[VersionedApiBackOfficeRoute($"{Constants.Web.RoutePath.Filter}/{Constants.UdiEntityType.DataType}")]
// This auth policy might become problematic, as when getting DataTypes on Media types, you don't need access to the document tree.
[Authorize(Policy = AuthorizationPolicies.TreeAccessDocumentsOrDocumentTypes)]
public abstract class DataTypeFilterControllerBase : ManagementApiControllerBase
{
}
@@ -0,0 +1,46 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Common.ViewModels.Pagination;
using Umbraco.Cms.Api.Management.ViewModels.DataType.Item;
using Umbraco.Cms.Api.Management.ViewModels.Language;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Mapping;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Services;
namespace Umbraco.Cms.Api.Management.Controllers.DataType.Filter;
[ApiVersion("1.0")]
public class FilterDataTypeFilterController : DataTypeFilterControllerBase
{
private readonly IDataTypeService _dataTypeService;
private readonly IUmbracoMapper _mapper;
public FilterDataTypeFilterController(IDataTypeService dataTypeService, IUmbracoMapper mapper)
{
_dataTypeService = dataTypeService;
_mapper = mapper;
}
[HttpGet]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(PagedViewModel<DataTypeItemResponseModel>), StatusCodes.Status200OK)]
public async Task<IActionResult> Filter(
CancellationToken cancellationToken,
int skip = 0,
int take = 100,
string name = "",
string? editorUiAlias = null,
string? editorAlias = null)
{
PagedModel<IDataType> dataTypes = await _dataTypeService.FilterAsync(name, editorUiAlias, editorAlias, skip, take);
List<DataTypeItemResponseModel> responseModels = _mapper.MapEnumerable<IDataType, DataTypeItemResponseModel>(dataTypes.Items);
var viewModel = new PagedViewModel<DataTypeItemResponseModel>
{
Total = dataTypes.Total,
Items = responseModels,
};
return Ok(viewModel);
}
}
@@ -0,0 +1,25 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.ViewModels.Folder;
using Umbraco.Cms.Core.Security;
using Umbraco.Cms.Core.Services;
namespace Umbraco.Cms.Api.Management.Controllers.DataType.Folder;
[ApiVersion("1.0")]
public class ByKeyDataTypeFolderController : DataTypeFolderControllerBase
{
public ByKeyDataTypeFolderController(
IBackOfficeSecurityAccessor backOfficeSecurityAccessor,
IDataTypeContainerService dataTypeContainerService)
: base(backOfficeSecurityAccessor, dataTypeContainerService)
{
}
[HttpGet("{id:guid}")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(FolderResponseModel), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
public async Task<IActionResult> ByKey(CancellationToken cancellationToken, Guid id) => await GetFolderAsync(id);
}
@@ -0,0 +1,29 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.ViewModels.Folder;
using Umbraco.Cms.Core.Security;
using Umbraco.Cms.Core.Services;
namespace Umbraco.Cms.Api.Management.Controllers.DataType.Folder;
[ApiVersion("1.0")]
public class CreateDataTypeFolderController : DataTypeFolderControllerBase
{
public CreateDataTypeFolderController(
IBackOfficeSecurityAccessor backOfficeSecurityAccessor,
IDataTypeContainerService dataTypeContainerService)
: base(backOfficeSecurityAccessor, dataTypeContainerService)
{
}
[HttpPost]
[MapToApiVersion("1.0")]
[ProducesResponseType(StatusCodes.Status201Created)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
public async Task<IActionResult> Create(CancellationToken cancellationToken, CreateFolderRequestModel createFolderRequestModel)
=> await CreateFolderAsync<ByKeyDataTypeFolderController>(
createFolderRequestModel,
controller => nameof(controller.ByKey));
}
@@ -0,0 +1,23 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.Routing;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Security;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Web.Common.Authorization;
namespace Umbraco.Cms.Api.Management.Controllers.DataType.Folder;
[VersionedApiBackOfficeRoute($"{Constants.UdiEntityType.DataType}/folder")]
[ApiExplorerSettings(GroupName = "Data Type")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessDocumentTypes)]
public abstract class DataTypeFolderControllerBase : FolderManagementControllerBase<IDataType>
{
protected DataTypeFolderControllerBase(
IBackOfficeSecurityAccessor backOfficeSecurityAccessor,
IDataTypeContainerService dataTypeContainerService)
: base(backOfficeSecurityAccessor, dataTypeContainerService)
{
}
}
@@ -0,0 +1,25 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Core.Security;
using Umbraco.Cms.Core.Services;
namespace Umbraco.Cms.Api.Management.Controllers.DataType.Folder;
[ApiVersion("1.0")]
public class DeleteDataTypeFolderController : DataTypeFolderControllerBase
{
public DeleteDataTypeFolderController(
IBackOfficeSecurityAccessor backOfficeSecurityAccessor,
IDataTypeContainerService dataTypeContainerService)
: base(backOfficeSecurityAccessor, dataTypeContainerService)
{
}
[HttpDelete("{id:guid}")]
[MapToApiVersion("1.0")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
public async Task<IActionResult> Delete(CancellationToken cancellationToken, Guid id) => await DeleteFolderAsync(id);
}
@@ -0,0 +1,30 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.ViewModels.Folder;
using Umbraco.Cms.Core.Security;
using Umbraco.Cms.Core.Services;
namespace Umbraco.Cms.Api.Management.Controllers.DataType.Folder;
[ApiVersion("1.0")]
public class UpdateDataTypeFolderController : DataTypeFolderControllerBase
{
public UpdateDataTypeFolderController(
IBackOfficeSecurityAccessor backOfficeSecurityAccessor,
IDataTypeContainerService dataTypeContainerService)
: base(backOfficeSecurityAccessor, dataTypeContainerService)
{
}
[HttpPut("{id:guid}")]
[MapToApiVersion("1.0")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
public async Task<IActionResult> Update(
CancellationToken cancellationToken,
Guid id,
UpdateFolderResponseModel updateFolderResponseModel)
=> await UpdateFolderAsync(id, updateFolderResponseModel);
}
@@ -0,0 +1,32 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Services.OperationStatus;
namespace Umbraco.Cms.Api.Management.Controllers.DataType;
[ApiVersion("1.0")]
public class IsUsedDataTypeController : DataTypeControllerBase
{
private readonly IDataTypeUsageService _dataTypeUsageService;
public IsUsedDataTypeController(IDataTypeUsageService dataTypeUsageService)
{
_dataTypeUsageService = dataTypeUsageService;
}
[HttpGet("{id:guid}/is-used")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(bool), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
public async Task<IActionResult> IsUsed(CancellationToken cancellationToken, Guid id)
{
Attempt<bool, DataTypeOperationStatus> result = await _dataTypeUsageService.HasSavedValuesAsync(id);
return result.Success
? Ok(result.Result)
: DataTypeOperationStatusResult(result.Status);
}
}
@@ -0,0 +1,11 @@
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.Routing;
using Umbraco.Cms.Core;
namespace Umbraco.Cms.Api.Management.Controllers.DataType.Item;
[VersionedApiBackOfficeRoute($"{Constants.Web.RoutePath.Item}/{Constants.UdiEntityType.DataType}")]
[ApiExplorerSettings(GroupName = "Data Type")]
public class DatatypeItemControllerBase : ManagementApiControllerBase
{
}
@@ -0,0 +1,48 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.ViewModels.DataType.Item;
using Umbraco.Cms.Core.Mapping;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Services;
namespace Umbraco.Cms.Api.Management.Controllers.DataType.Item;
[ApiVersion("1.0")]
public class ItemDatatypeItemController : DatatypeItemControllerBase
{
private readonly IDataTypeService _dataTypeService;
private readonly IUmbracoMapper _mapper;
public ItemDatatypeItemController(IDataTypeService dataTypeService, IUmbracoMapper mapper)
{
_dataTypeService = dataTypeService;
_mapper = mapper;
}
[HttpGet]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(IEnumerable<DataTypeItemResponseModel>), StatusCodes.Status200OK)]
public async Task<IActionResult> Item(
CancellationToken cancellationToken,
[FromQuery(Name = "id")] HashSet<Guid> ids)
{
if (ids.Count is 0)
{
return Ok(Enumerable.Empty<DataTypeItemResponseModel>());
}
var dataTypes = new List<IDataType>();
foreach (Guid id in ids)
{
IDataType? dataType = await _dataTypeService.GetAsync(id);
if (dataType is not null)
{
dataTypes.Add(dataType);
}
}
List<DataTypeItemResponseModel> responseModels = _mapper.MapEnumerable<IDataType, DataTypeItemResponseModel>(dataTypes);
return Ok(responseModels);
}
}
@@ -0,0 +1,46 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.ViewModels.DataType.Item;
using Umbraco.Cms.Core.Mapping;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Models.Entities;
using Umbraco.Cms.Core.Services;
namespace Umbraco.Cms.Api.Management.Controllers.DataType.Item;
[ApiVersion("1.0")]
public class SearchDataTypeItemController : DatatypeItemControllerBase
{
private readonly IEntitySearchService _entitySearchService;
private readonly IDataTypeService _dataTypeService;
private readonly IUmbracoMapper _mapper;
public SearchDataTypeItemController(IEntitySearchService entitySearchService, IDataTypeService dataTypeService, IUmbracoMapper mapper)
{
_entitySearchService = entitySearchService;
_dataTypeService = dataTypeService;
_mapper = mapper;
}
[HttpGet("search")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(PagedModel<DataTypeItemResponseModel>), StatusCodes.Status200OK)]
public async Task<IActionResult> Search(CancellationToken cancellationToken, string query, int skip = 0, int take = 100)
{
PagedModel<IEntitySlim> searchResult = _entitySearchService.Search(UmbracoObjectTypes.DataType, query, skip, take);
if (searchResult.Items.Any() is false)
{
return Ok(new PagedModel<DataTypeItemResponseModel> { Total = searchResult.Total });
}
IEnumerable<IDataType> dataTypes = await _dataTypeService.GetAllAsync(searchResult.Items.Select(item => item.Key).ToArray());
var result = new PagedModel<DataTypeItemResponseModel>
{
Items = _mapper.MapEnumerable<IDataType, DataTypeItemResponseModel>(dataTypes),
Total = searchResult.Total
};
return Ok(result);
}
}
@@ -0,0 +1,46 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.ViewModels.DataType;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Security;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Cms.Web.Common.Authorization;
namespace Umbraco.Cms.Api.Management.Controllers.DataType;
[ApiVersion("1.0")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessDataTypes)]
public class MoveDataTypeController : DataTypeControllerBase
{
private readonly IDataTypeService _dataTypeService;
private readonly IBackOfficeSecurityAccessor _backOfficeSecurityAccessor;
public MoveDataTypeController(IDataTypeService dataTypeService, IBackOfficeSecurityAccessor backOfficeSecurityAccessor)
{
_dataTypeService = dataTypeService;
_backOfficeSecurityAccessor = backOfficeSecurityAccessor;
}
[HttpPut("{id:guid}/move")]
[MapToApiVersion("1.0")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
public async Task<IActionResult> Move(CancellationToken cancellationToken, Guid id, MoveDataTypeRequestModel moveDataTypeRequestModel)
{
IDataType? source = await _dataTypeService.GetAsync(id);
if (source is null)
{
return DataTypeNotFound();
}
Attempt<IDataType, DataTypeOperationStatus> result = await _dataTypeService.MoveAsync(source, moveDataTypeRequestModel.Target?.Id, CurrentUserKey(_backOfficeSecurityAccessor));
return result.Success
? Ok()
: DataTypeOperationStatusResult(result.Status);
}
}
@@ -0,0 +1,39 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.Factories;
using Umbraco.Cms.Api.Management.ViewModels.DataType;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Services.OperationStatus;
namespace Umbraco.Cms.Api.Management.Controllers.DataType;
[ApiVersion("1.0")]
public class ReferencesDataTypeController : DataTypeControllerBase
{
private readonly IDataTypeService _dataTypeService;
private readonly IDataTypeReferencePresentationFactory _dataTypeReferencePresentationFactory;
public ReferencesDataTypeController(IDataTypeService dataTypeService, IDataTypeReferencePresentationFactory dataTypeReferencePresentationFactory)
{
_dataTypeService = dataTypeService;
_dataTypeReferencePresentationFactory = dataTypeReferencePresentationFactory;
}
[HttpGet("{id:guid}/references")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(DataTypeReferenceResponseModel[]), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
public async Task<IActionResult> References(CancellationToken cancellationToken, Guid id)
{
Attempt<IReadOnlyDictionary<Udi, IEnumerable<string>>, DataTypeOperationStatus> result = await _dataTypeService.GetReferencesAsync(id);
if (result.Success == false)
{
return DataTypeOperationStatusResult(result.Status);
}
DataTypeReferenceResponseModel[] viewModels = _dataTypeReferencePresentationFactory.CreateDataTypeReferenceViewModels(result.Result).ToArray();
return Ok(viewModels);
}
}
@@ -0,0 +1,22 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.ViewModels.Tree;
using Umbraco.Cms.Core.Services;
namespace Umbraco.Cms.Api.Management.Controllers.DataType.Tree;
[ApiVersion("1.0")]
public class AncestorsDataTypeTreeController : DataTypeTreeControllerBase
{
public AncestorsDataTypeTreeController(IEntityService entityService, IDataTypeService dataTypeService)
: base(entityService, dataTypeService)
{
}
[HttpGet("ancestors")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(IEnumerable<DataTypeTreeItemResponseModel>), StatusCodes.Status200OK)]
public async Task<ActionResult<IEnumerable<DataTypeTreeItemResponseModel>>> Ancestors(CancellationToken cancellationToken, Guid descendantId)
=> await GetAncestors(descendantId);
}
@@ -0,0 +1,26 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Api.Common.ViewModels.Pagination;
using Umbraco.Cms.Api.Management.ViewModels.Tree;
namespace Umbraco.Cms.Api.Management.Controllers.DataType.Tree;
[ApiVersion("1.0")]
public class ChildrenDataTypeTreeController : DataTypeTreeControllerBase
{
public ChildrenDataTypeTreeController(IEntityService entityService, IDataTypeService dataTypeService)
: base(entityService, dataTypeService)
{
}
[HttpGet("children")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(PagedViewModel<DataTypeTreeItemResponseModel>), StatusCodes.Status200OK)]
public async Task<ActionResult<PagedViewModel<DataTypeTreeItemResponseModel>>> Children(CancellationToken cancellationToken, Guid parentId, int skip = 0, int take = 100, bool foldersOnly = false)
{
RenderFoldersOnly(foldersOnly);
return await GetChildren(parentId, skip, take);
}
}
@@ -0,0 +1,61 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.Controllers.Tree;
using Umbraco.Cms.Api.Management.Routing;
using Umbraco.Cms.Api.Management.ViewModels.Tree;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Models.Entities;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Web.Common.Authorization;
using Umbraco.Extensions;
namespace Umbraco.Cms.Api.Management.Controllers.DataType.Tree;
[VersionedApiBackOfficeRoute($"{Constants.Web.RoutePath.Tree}/{Constants.UdiEntityType.DataType}")]
[ApiExplorerSettings(GroupName = "Data Type")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessDataTypes)]
public class DataTypeTreeControllerBase : FolderTreeControllerBase<DataTypeTreeItemResponseModel>
{
private readonly IDataTypeService _dataTypeService;
public DataTypeTreeControllerBase(IEntityService entityService, IDataTypeService dataTypeService)
: base(entityService) =>
_dataTypeService = dataTypeService;
protected override UmbracoObjectTypes ItemObjectType => UmbracoObjectTypes.DataType;
protected override UmbracoObjectTypes FolderObjectType => UmbracoObjectTypes.DataTypeContainer;
protected override Ordering ItemOrdering
{
get
{
var ordering = Ordering.By(nameof(Infrastructure.Persistence.Dtos.NodeDto.NodeObjectType), Direction.Descending); // We need to override to change direction
ordering.Next = Ordering.By(nameof(Infrastructure.Persistence.Dtos.NodeDto.Text));
return ordering;
}
}
protected override DataTypeTreeItemResponseModel[] MapTreeItemViewModels(Guid? parentId, IEntitySlim[] entities)
{
Dictionary<int, IDataType> dataTypes = entities.Any()
? _dataTypeService
.GetAllAsync(entities.Select(entity => entity.Key).ToArray()).GetAwaiter().GetResult()
.ToDictionary(contentType => contentType.Id)
: new Dictionary<int, IDataType>();
return entities.Select(entity =>
{
DataTypeTreeItemResponseModel responseModel = MapTreeItemViewModel(parentId, entity);
if (dataTypes.TryGetValue(entity.Id, out IDataType? dataType))
{
responseModel.EditorUiAlias = dataType.EditorUiAlias;
responseModel.IsDeletable = dataType.IsDeletableDataType();
}
return responseModel;
}).ToArray();
}
}
@@ -0,0 +1,27 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Api.Common.ViewModels.Pagination;
using Umbraco.Cms.Api.Management.ViewModels.DataType.Item;
using Umbraco.Cms.Api.Management.ViewModels.Tree;
namespace Umbraco.Cms.Api.Management.Controllers.DataType.Tree;
[ApiVersion("1.0")]
public class RootDataTypeTreeController : DataTypeTreeControllerBase
{
public RootDataTypeTreeController(IEntityService entityService, IDataTypeService dataTypeService)
: base(entityService, dataTypeService)
{
}
[HttpGet("root")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(PagedViewModel<DataTypeTreeItemResponseModel>), StatusCodes.Status200OK)]
public async Task<ActionResult<PagedViewModel<DataTypeTreeItemResponseModel>>> Root(CancellationToken cancellationToken, int skip = 0, int take = 100, bool foldersOnly = false)
{
RenderFoldersOnly(foldersOnly);
return await GetRoot(skip, take);
}
}
@@ -0,0 +1,55 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.Factories;
using Umbraco.Cms.Api.Management.ViewModels.DataType;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Security;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Cms.Web.Common.Authorization;
namespace Umbraco.Cms.Api.Management.Controllers.DataType;
[ApiVersion("1.0")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessDataTypes)]
public class UpdateDataTypeController : DataTypeControllerBase
{
private readonly IDataTypeService _dataTypeService;
private readonly IBackOfficeSecurityAccessor _backOfficeSecurityAccessor;
private IDataTypePresentationFactory _dataTypePresentationFactory;
public UpdateDataTypeController(IDataTypeService dataTypeService, IBackOfficeSecurityAccessor backOfficeSecurityAccessor, IDataTypePresentationFactory dataTypePresentationFactory)
{
_dataTypeService = dataTypeService;
_backOfficeSecurityAccessor = backOfficeSecurityAccessor;
_dataTypePresentationFactory = dataTypePresentationFactory;
}
[HttpPut("{id:guid}")]
[MapToApiVersion("1.0")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
public async Task<IActionResult> Update(CancellationToken cancellationToken, Guid id, UpdateDataTypeRequestModel updateDataTypeViewModel)
{
IDataType? current = await _dataTypeService.GetAsync(id);
if (current == null)
{
return DataTypeNotFound();
}
Attempt<IDataType, DataTypeOperationStatus> attempt = await _dataTypePresentationFactory.CreateAsync(updateDataTypeViewModel, current);
if (!attempt.Success)
{
return DataTypeOperationStatusResult(attempt.Status);
}
Attempt<IDataType, DataTypeOperationStatus> result = await _dataTypeService.UpdateAsync(attempt.Result, CurrentUserKey(_backOfficeSecurityAccessor));
return result.Success
? Ok()
: DataTypeOperationStatusResult(result.Status);
}
}
@@ -0,0 +1,43 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Core.Mapping;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Api.Management.ViewModels.Dictionary;
using Umbraco.Cms.Api.Common.ViewModels.Pagination;
using Umbraco.Cms.Core;
namespace Umbraco.Cms.Api.Management.Controllers.Dictionary;
[ApiVersion("1.0")]
public class AllDictionaryController : DictionaryControllerBase
{
private readonly IDictionaryItemService _dictionaryItemService;
private readonly IUmbracoMapper _umbracoMapper;
public AllDictionaryController(IDictionaryItemService dictionaryItemService, IUmbracoMapper umbracoMapper)
{
_dictionaryItemService = dictionaryItemService;
_umbracoMapper = umbracoMapper;
}
[HttpGet]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(PagedViewModel<DictionaryOverviewResponseModel>), StatusCodes.Status200OK)]
public async Task<ActionResult<PagedViewModel<DictionaryOverviewResponseModel>>> All(
CancellationToken cancellationToken,
string? filter = null,
int skip = 0,
int take = 100)
{
// unfortunately we can't paginate here...we'll have to get all and paginate in memory
IDictionaryItem[] items = (await _dictionaryItemService.GetDescendantsAsync(Constants.System.RootKey, filter)).ToArray();
var model = new PagedViewModel<DictionaryOverviewResponseModel>
{
Total = items.Length,
Items = _umbracoMapper.MapEnumerable<IDictionaryItem, DictionaryOverviewResponseModel>(items.Skip(skip).Take(take))
};
return await Task.FromResult(model);
}
}
@@ -0,0 +1,37 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.Factories;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Api.Management.ViewModels.Dictionary;
namespace Umbraco.Cms.Api.Management.Controllers.Dictionary;
[ApiVersion("1.0")]
public class ByKeyDictionaryController : DictionaryControllerBase
{
private readonly IDictionaryItemService _dictionaryItemService;
private readonly IDictionaryPresentationFactory _dictionaryPresentationFactory;
public ByKeyDictionaryController(IDictionaryItemService dictionaryItemService, IDictionaryPresentationFactory dictionaryPresentationFactory)
{
_dictionaryItemService = dictionaryItemService;
_dictionaryPresentationFactory = dictionaryPresentationFactory;
}
[HttpGet($"{{{nameof(id)}:guid}}")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(DictionaryItemResponseModel), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
public async Task<IActionResult> ByKey(CancellationToken cancellationToken, Guid id)
{
IDictionaryItem? dictionary = await _dictionaryItemService.GetAsync(id);
if (dictionary == null)
{
return DictionaryItemNotFound();
}
return Ok(await _dictionaryPresentationFactory.CreateDictionaryItemViewModelAsync(dictionary));
}
}
@@ -0,0 +1,67 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.Factories;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Security;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Api.Management.ViewModels.Dictionary;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Security.Authorization;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Cms.Web.Common.Authorization;
using Umbraco.Extensions;
namespace Umbraco.Cms.Api.Management.Controllers.Dictionary;
[ApiVersion("1.0")]
public class CreateDictionaryController : DictionaryControllerBase
{
private readonly IDictionaryItemService _dictionaryItemService;
private readonly IBackOfficeSecurityAccessor _backOfficeSecurityAccessor;
private readonly IDictionaryPresentationFactory _dictionaryPresentationFactory;
private readonly IAuthorizationService _authorizationService;
public CreateDictionaryController(
IDictionaryItemService dictionaryItemService,
IBackOfficeSecurityAccessor backOfficeSecurityAccessor,
IDictionaryPresentationFactory dictionaryPresentationFactory,
IAuthorizationService authorizationService)
{
_dictionaryItemService = dictionaryItemService;
_backOfficeSecurityAccessor = backOfficeSecurityAccessor;
_dictionaryPresentationFactory = dictionaryPresentationFactory;
_authorizationService = authorizationService;
}
[HttpPost]
[MapToApiVersion("1.0")]
[ProducesResponseType(StatusCodes.Status201Created)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status409Conflict)]
public async Task<IActionResult> Create(
CancellationToken cancellationToken,
CreateDictionaryItemRequestModel createDictionaryItemRequestModel)
{
IDictionaryItem created = await _dictionaryPresentationFactory.MapCreateModelToDictionaryItemAsync(createDictionaryItemRequestModel);
AuthorizationResult authorizationResult = await _authorizationService.AuthorizeResourceAsync(
User,
new DictionaryPermissionResource(createDictionaryItemRequestModel.Translations.Select(t => t.IsoCode)),
AuthorizationPolicies.DictionaryPermissionByResource);
if (authorizationResult.Succeeded is false)
{
return Forbidden();
}
Attempt<IDictionaryItem, DictionaryItemOperationStatus> result =
await _dictionaryItemService.CreateAsync(created, CurrentUserKey(_backOfficeSecurityAccessor));
return result.Success
? CreatedAtId<ByKeyDictionaryController>(controller => nameof(controller.ByKey), result.Result!.Key)
: DictionaryItemOperationStatusResult(result.Status);
}
}
@@ -0,0 +1,37 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Security;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Services.OperationStatus;
namespace Umbraco.Cms.Api.Management.Controllers.Dictionary;
[ApiVersion("1.0")]
public class DeleteDictionaryController : DictionaryControllerBase
{
private readonly IDictionaryItemService _dictionaryItemService;
private readonly IBackOfficeSecurityAccessor _backOfficeSecurityAccessor;
public DeleteDictionaryController(IDictionaryItemService dictionaryItemService, IBackOfficeSecurityAccessor backOfficeSecurityAccessor)
{
_dictionaryItemService = dictionaryItemService;
_backOfficeSecurityAccessor = backOfficeSecurityAccessor;
}
[HttpDelete($"{{{nameof(id)}:guid}}")]
[MapToApiVersion("1.0")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
public async Task<IActionResult> Delete(CancellationToken cancellationToken, Guid id)
{
Attempt<IDictionaryItem?, DictionaryItemOperationStatus> result = await _dictionaryItemService.DeleteAsync(id, CurrentUserKey(_backOfficeSecurityAccessor));
return result.Success
? Ok()
: DictionaryItemOperationStatusResult(result.Status);
}
}
@@ -0,0 +1,46 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Common.Builders;
using Umbraco.Cms.Api.Management.Routing;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Cms.Web.Common.Authorization;
namespace Umbraco.Cms.Api.Management.Controllers.Dictionary;
[VersionedApiBackOfficeRoute("dictionary")]
[ApiExplorerSettings(GroupName = "Dictionary")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessDictionary)]
public abstract class DictionaryControllerBase : ManagementApiControllerBase
{
protected IActionResult DictionaryItemOperationStatusResult(DictionaryItemOperationStatus status) =>
OperationStatusResult(status, problemDetailsBuilder => status switch
{
DictionaryItemOperationStatus.DuplicateItemKey => Conflict(problemDetailsBuilder
.WithTitle("Duplicate dictionary item name detected")
.WithDetail("Another dictionary item exists with the same name. Dictionary item names must be unique.")
.Build()),
DictionaryItemOperationStatus.ItemNotFound => DictionaryItemNotFound(problemDetailsBuilder),
DictionaryItemOperationStatus.ParentNotFound => NotFound(problemDetailsBuilder
.WithTitle("The dictionary item parent could not be found")
.Build()),
DictionaryItemOperationStatus.CancelledByNotification => BadRequest(problemDetailsBuilder
.WithTitle("Cancelled by notification")
.WithDetail("A notification handler prevented the dictionary item operation.")
.Build()),
DictionaryItemOperationStatus.InvalidParent => BadRequest(problemDetailsBuilder
.WithTitle("Invalid parent")
.WithDetail("The targeted parent dictionary item is not valid for this dictionary item operation.")
.Build()),
_ => StatusCode(StatusCodes.Status500InternalServerError, problemDetailsBuilder
.WithTitle("Unknown dictionary operation status.")
.Build()),
});
protected IActionResult DictionaryItemNotFound() => OperationStatusResult(DictionaryItemOperationStatus.ItemNotFound, DictionaryItemNotFound);
private IActionResult DictionaryItemNotFound(ProblemDetailsBuilder problemDetailsBuilder)
=> NotFound(problemDetailsBuilder
.WithTitle("The dictionary item could not be found")
.Build());
}
@@ -0,0 +1,41 @@
using System.Net.Mime;
using System.Text;
using System.Xml.Linq;
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Services;
using Umbraco.Extensions;
namespace Umbraco.Cms.Api.Management.Controllers.Dictionary;
[ApiVersion("1.0")]
public class ExportDictionaryController : DictionaryControllerBase
{
private readonly IDictionaryItemService _dictionaryItemService;
private readonly IEntityXmlSerializer _entityXmlSerializer;
public ExportDictionaryController(IDictionaryItemService dictionaryItemService, IEntityXmlSerializer entityXmlSerializer)
{
_dictionaryItemService = dictionaryItemService;
_entityXmlSerializer = entityXmlSerializer;
}
[HttpGet("{id:guid}/export")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(FileContentResult), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
public async Task<IActionResult> Export(CancellationToken cancellationToken, Guid id, bool includeChildren = false)
{
IDictionaryItem? dictionaryItem = await _dictionaryItemService.GetAsync(id);
if (dictionaryItem is null)
{
return DictionaryItemNotFound();
}
XElement xml = _entityXmlSerializer.Serialize(dictionaryItem, includeChildren);
return File(Encoding.UTF8.GetBytes(xml.ToDataString()), MediaTypeNames.Application.Octet, $"{dictionaryItem.ItemKey}.udt");
}
}
@@ -0,0 +1,66 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Common.Builders;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Api.Management.Services;
using Umbraco.Cms.Api.Management.Services.OperationStatus;
using Umbraco.Cms.Api.Management.ViewModels.Dictionary;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Security;
namespace Umbraco.Cms.Api.Management.Controllers.Dictionary;
[ApiVersion("1.0")]
public class ImportDictionaryController : DictionaryControllerBase
{
private readonly IDictionaryItemImportService _dictionaryItemImportService;
private readonly IBackOfficeSecurityAccessor _backOfficeSecurityAccessor;
public ImportDictionaryController(
IDictionaryItemImportService dictionaryItemImportService,
IBackOfficeSecurityAccessor backOfficeSecurityAccessor)
{
_dictionaryItemImportService = dictionaryItemImportService;
_backOfficeSecurityAccessor = backOfficeSecurityAccessor;
}
[HttpPost("import")]
[MapToApiVersion("1.0")]
[ProducesResponseType(StatusCodes.Status201Created)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
public async Task<IActionResult> Import(
CancellationToken cancellationToken,
ImportDictionaryRequestModel importDictionaryRequestModel)
{
Attempt<IDictionaryItem?, DictionaryImportOperationStatus> result = await _dictionaryItemImportService
.ImportDictionaryItemFromUdtFileAsync(
importDictionaryRequestModel.TemporaryFile.Id,
importDictionaryRequestModel.Parent?.Id,
CurrentUserKey(_backOfficeSecurityAccessor));
return result.Success
? CreatedAtId<ByKeyDictionaryController>(controller => nameof(controller.ByKey), result.Result!.Key)
: OperationStatusResult(result.Status, problemDetailsBuilder => result.Status switch
{
DictionaryImportOperationStatus.ParentNotFound => NotFound(problemDetailsBuilder
.WithTitle("The parent dictionary item could not be found.")
.Build()),
DictionaryImportOperationStatus.TemporaryFileNotFound => NotFound(problemDetailsBuilder
.WithTitle("The temporary file with specified id could not be found.")
.Build()),
DictionaryImportOperationStatus.InvalidFileType => BadRequest(problemDetailsBuilder
.WithTitle("Invalid file type")
.WithDetail("The dictionary import only supports UDT files.")
.Build()),
DictionaryImportOperationStatus.InvalidFileContent => BadRequest(problemDetailsBuilder
.WithTitle("Invalid file content")
.WithDetail("The uploaded file could not be read as a valid UDT file.")
.Build()),
_ => StatusCode(StatusCodes.Status500InternalServerError, problemDetailsBuilder
.WithTitle("Unknown dictionary import operation status.")
.Build()),
});
}
}
@@ -0,0 +1,11 @@
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.Routing;
using Umbraco.Cms.Core;
namespace Umbraco.Cms.Api.Management.Controllers.Dictionary.Item;
[VersionedApiBackOfficeRoute($"{Constants.Web.RoutePath.Item}/dictionary")]
[ApiExplorerSettings(GroupName = "Dictionary")]
public class DictionaryItemControllerBase : ManagementApiControllerBase
{
}
@@ -0,0 +1,40 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.ViewModels.Dictionary.Item;
using Umbraco.Cms.Core.Mapping;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Services;
namespace Umbraco.Cms.Api.Management.Controllers.Dictionary.Item;
[ApiVersion("1.0")]
public class ItemDictionaryItemController : DictionaryItemControllerBase
{
private readonly IDictionaryItemService _dictionaryItemService;
private readonly IUmbracoMapper _mapper;
public ItemDictionaryItemController(IDictionaryItemService dictionaryItemService, IUmbracoMapper mapper)
{
_dictionaryItemService = dictionaryItemService;
_mapper = mapper;
}
[HttpGet]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(IEnumerable<DictionaryItemItemResponseModel>), StatusCodes.Status200OK)]
public async Task<IActionResult> Item(
CancellationToken cancellationToken,
[FromQuery(Name = "id")] HashSet<Guid> ids)
{
if (ids.Count is 0)
{
return Ok(Enumerable.Empty<DictionaryItemItemResponseModel>());
}
IEnumerable<IDictionaryItem> dictionaryItems = await _dictionaryItemService.GetManyAsync(ids.ToArray());
List<DictionaryItemItemResponseModel> responseModels = _mapper.MapEnumerable<IDictionaryItem, DictionaryItemItemResponseModel>(dictionaryItems);
return Ok(responseModels);
}
}
@@ -0,0 +1,50 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.ViewModels.Dictionary;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Security;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Services.OperationStatus;
namespace Umbraco.Cms.Api.Management.Controllers.Dictionary;
[ApiVersion("1.0")]
public class MoveDictionaryController : DictionaryControllerBase
{
private readonly IDictionaryItemService _dictionaryItemService;
private readonly IBackOfficeSecurityAccessor _backOfficeSecurityAccessor;
public MoveDictionaryController(IDictionaryItemService dictionaryItemService, IBackOfficeSecurityAccessor backOfficeSecurityAccessor)
{
_dictionaryItemService = dictionaryItemService;
_backOfficeSecurityAccessor = backOfficeSecurityAccessor;
}
[HttpPut("{id:guid}/move")]
[MapToApiVersion("1.0")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
public async Task<IActionResult> Move(
CancellationToken cancellationToken,
Guid id,
MoveDictionaryRequestModel moveDictionaryRequestModel)
{
IDictionaryItem? source = await _dictionaryItemService.GetAsync(id);
if (source == null)
{
return DictionaryItemNotFound();
}
Attempt<IDictionaryItem, DictionaryItemOperationStatus> result = await _dictionaryItemService.MoveAsync(
source,
moveDictionaryRequestModel.Target?.Id,
CurrentUserKey(_backOfficeSecurityAccessor));
return result.Success
? Ok()
: DictionaryItemOperationStatusResult(result.Status);
}
}
@@ -0,0 +1,22 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.ViewModels.Tree;
using Umbraco.Cms.Core.Services;
namespace Umbraco.Cms.Api.Management.Controllers.Dictionary.Tree;
[ApiVersion("1.0")]
public class AncestorsDictionaryTreeController : DictionaryTreeControllerBase
{
public AncestorsDictionaryTreeController(IEntityService entityService, IDictionaryItemService dictionaryItemService)
: base(entityService, dictionaryItemService)
{
}
[HttpGet("ancestors")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(IEnumerable<NamedEntityTreeItemResponseModel>), StatusCodes.Status200OK)]
public async Task<ActionResult<IEnumerable<NamedEntityTreeItemResponseModel>>> Ancestors(CancellationToken cancellationToken, Guid descendantId)
=> await GetAncestors(descendantId);
}
@@ -0,0 +1,28 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Api.Common.ViewModels.Pagination;
using Umbraco.Cms.Api.Management.ViewModels.Tree;
namespace Umbraco.Cms.Api.Management.Controllers.Dictionary.Tree;
[ApiVersion("1.0")]
public class ChildrenDictionaryTreeController : DictionaryTreeControllerBase
{
public ChildrenDictionaryTreeController(IEntityService entityService, IDictionaryItemService dictionaryItemService)
: base(entityService, dictionaryItemService)
{
}
[HttpGet("children")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(PagedViewModel<NamedEntityTreeItemResponseModel>), StatusCodes.Status200OK)]
public async Task<ActionResult<PagedViewModel<NamedEntityTreeItemResponseModel>>> Children(CancellationToken cancellationToken, Guid parentId, int skip = 0, int take = 100)
{
PagedModel<IDictionaryItem> paginatedItems = await DictionaryItemService.GetPagedAsync(parentId, skip, take);
return Ok(PagedViewModel(await MapTreeItemViewModels(paginatedItems.Items), paginatedItems.Total));
}
}
@@ -0,0 +1,77 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.Controllers.Tree;
using Umbraco.Cms.Api.Management.Routing;
using Umbraco.Cms.Api.Management.ViewModels;
using Umbraco.Cms.Api.Management.ViewModels.Tree;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Web.Common.Authorization;
namespace Umbraco.Cms.Api.Management.Controllers.Dictionary.Tree;
[VersionedApiBackOfficeRoute($"{Constants.Web.RoutePath.Tree}/dictionary")]
[ApiExplorerSettings(GroupName = "Dictionary")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessDictionaryOrTemplates)]
// NOTE: at the moment dictionary items (renamed to dictionary tree) aren't supported by EntityService, so we have little use of the
// tree controller base. We'll keep it though, in the hope that we can mend EntityService.
public class DictionaryTreeControllerBase : NamedEntityTreeControllerBase<NamedEntityTreeItemResponseModel>
{
public DictionaryTreeControllerBase(IEntityService entityService, IDictionaryItemService dictionaryItemService)
: base(entityService) =>
DictionaryItemService = dictionaryItemService;
// dictionary items do not currently have a known UmbracoObjectType, so we'll settle with Unknown for now
protected override UmbracoObjectTypes ItemObjectType => UmbracoObjectTypes.Unknown;
protected IDictionaryItemService DictionaryItemService { get; }
protected async Task<IEnumerable<NamedEntityTreeItemResponseModel>> MapTreeItemViewModels(IEnumerable<IDictionaryItem> dictionaryItems)
=> await Task.WhenAll(dictionaryItems.Select(CreateEntityTreeItemViewModelAsync));
protected override async Task<ActionResult<IEnumerable<NamedEntityTreeItemResponseModel>>> GetAncestors(Guid descendantKey, bool includeSelf = true)
{
IDictionaryItem? dictionaryItem = await DictionaryItemService.GetAsync(descendantKey);
if (dictionaryItem is null)
{
// this looks weird - but we actually mimic how the rest of the ancestor (and children) endpoints actually work
return Ok(Enumerable.Empty<NamedEntityTreeItemResponseModel>());
}
var ancestors = new List<IDictionaryItem>();
if (includeSelf)
{
ancestors.Add(dictionaryItem);
}
while (dictionaryItem?.ParentId is not null)
{
dictionaryItem = await DictionaryItemService.GetAsync(dictionaryItem.ParentId.Value);
if (dictionaryItem is not null)
{
ancestors.Add(dictionaryItem);
}
}
NamedEntityTreeItemResponseModel[] viewModels = await Task.WhenAll(ancestors.Select(CreateEntityTreeItemViewModelAsync));
return Ok(viewModels.Reverse());
}
private async Task<NamedEntityTreeItemResponseModel> CreateEntityTreeItemViewModelAsync(IDictionaryItem dictionaryItem)
{
var hasChildren = await DictionaryItemService.CountChildrenAsync(dictionaryItem.Key) > 0;
return new NamedEntityTreeItemResponseModel
{
Name = dictionaryItem.ItemKey,
Id = dictionaryItem.Key,
HasChildren = hasChildren,
Parent = dictionaryItem.ParentId.HasValue
? new ReferenceByIdModel
{
Id = dictionaryItem.ParentId.Value
}
: null
};
}
}
@@ -0,0 +1,28 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Api.Common.ViewModels.Pagination;
using Umbraco.Cms.Api.Management.ViewModels.Tree;
namespace Umbraco.Cms.Api.Management.Controllers.Dictionary.Tree;
[ApiVersion("1.0")]
public class RootDictionaryTreeController : DictionaryTreeControllerBase
{
public RootDictionaryTreeController(IEntityService entityService, IDictionaryItemService dictionaryItemService)
: base(entityService, dictionaryItemService)
{
}
[HttpGet("root")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(PagedViewModel<NamedEntityTreeItemResponseModel>), StatusCodes.Status200OK)]
public async Task<ActionResult<PagedViewModel<NamedEntityTreeItemResponseModel>>> Root(CancellationToken cancellationToken, int skip = 0, int take = 100)
{
PagedModel<IDictionaryItem> paginatedItems = await DictionaryItemService.GetPagedAsync(null, skip, take);
return Ok(PagedViewModel(await MapTreeItemViewModels(paginatedItems.Items), paginatedItems.Total));
}
}
@@ -0,0 +1,74 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.Factories;
using Umbraco.Cms.Api.Management.Security.Authorization.Dictionary;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Api.Management.ViewModels.Dictionary;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Security;
using Umbraco.Cms.Core.Security.Authorization;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Cms.Web.Common.Authorization;
using Umbraco.Extensions;
namespace Umbraco.Cms.Api.Management.Controllers.Dictionary;
[ApiVersion("1.0")]
public class UpdateDictionaryController : DictionaryControllerBase
{
private readonly IDictionaryItemService _dictionaryItemService;
private readonly IBackOfficeSecurityAccessor _backOfficeSecurityAccessor;
private readonly IDictionaryPresentationFactory _dictionaryPresentationFactory;
private readonly IAuthorizationService _authorizationService;
public UpdateDictionaryController(
IDictionaryItemService dictionaryItemService,
IBackOfficeSecurityAccessor backOfficeSecurityAccessor,
IDictionaryPresentationFactory dictionaryPresentationFactory,
IAuthorizationService authorizationService)
{
_dictionaryItemService = dictionaryItemService;
_backOfficeSecurityAccessor = backOfficeSecurityAccessor;
_dictionaryPresentationFactory = dictionaryPresentationFactory;
_authorizationService = authorizationService;
}
[HttpPut($"{{{nameof(id)}:guid}}")]
[MapToApiVersion("1.0")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
public async Task<IActionResult> Update(
CancellationToken cancellationToken,
Guid id,
UpdateDictionaryItemRequestModel updateDictionaryItemRequestModel)
{
IDictionaryItem? current = await _dictionaryItemService.GetAsync(id);
if (current == null)
{
return DictionaryItemNotFound();
}
AuthorizationResult authorizationResult = await _authorizationService.AuthorizeResourceAsync(
User,
new DictionaryPermissionResource(updateDictionaryItemRequestModel.Translations.Select(t => t.IsoCode)),
AuthorizationPolicies.DictionaryPermissionByResource);
if (authorizationResult.Succeeded is false)
{
return Forbidden();
}
IDictionaryItem updated = await _dictionaryPresentationFactory.MapUpdateModelToDictionaryItemAsync(current, updateDictionaryItemRequestModel);
Attempt<IDictionaryItem, DictionaryItemOperationStatus> result =
await _dictionaryItemService.UpdateAsync(updated, CurrentUserKey(_backOfficeSecurityAccessor));
return result.Success
? Ok()
: DictionaryItemOperationStatusResult(result.Status);
}
}
@@ -0,0 +1,59 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.Factories;
using Umbraco.Cms.Api.Management.Security.Authorization.Content;
using Umbraco.Cms.Api.Management.ViewModels.Document;
using Umbraco.Cms.Core.Actions;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Security.Authorization;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Web.Common.Authorization;
using Umbraco.Extensions;
namespace Umbraco.Cms.Api.Management.Controllers.Document;
[ApiVersion("1.0")]
public class ByKeyDocumentController : DocumentControllerBase
{
private readonly IAuthorizationService _authorizationService;
private readonly IContentEditingService _contentEditingService;
private readonly IDocumentPresentationFactory _documentPresentationFactory;
public ByKeyDocumentController(
IAuthorizationService authorizationService,
IContentEditingService contentEditingService,
IDocumentPresentationFactory documentPresentationFactory)
{
_authorizationService = authorizationService;
_contentEditingService = contentEditingService;
_documentPresentationFactory = documentPresentationFactory;
}
[HttpGet("{id:guid}")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(DocumentResponseModel), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
public async Task<IActionResult> ByKey(CancellationToken cancellationToken, Guid id)
{
AuthorizationResult authorizationResult = await _authorizationService.AuthorizeResourceAsync(
User,
ContentPermissionResource.WithKeys(ActionBrowse.ActionLetter, id),
AuthorizationPolicies.ContentPermissionByResource);
if (!authorizationResult.Succeeded)
{
return Forbidden();
}
IContent? content = await _contentEditingService.GetAsync(id);
if (content == null)
{
return DocumentNotFound();
}
DocumentResponseModel model = await _documentPresentationFactory.CreateResponseModelAsync(content);
return Ok(model);
}
}

Some files were not shown because too many files have changed in this diff Show More