Compare commits

..
224 Commits
Author SHA1 Message Date
Andy Butland c6ab394947 Merge branch 'release/10.8.11' into v10/dev
# Conflicts:
#	version.json
2025-07-02 06:32:18 +02:00
Kenn JacobsenandGitHub d8f68d2c40 Merge commit from fork 2025-06-24 08:39:17 +02:00
Andy Butland ff88617db0 Bumped version to 10.8.11. 2025-06-05 07:49:09 +02:00
Andy Butland 9f912aea0e Merge branch 'release/10.8.10' into v10/dev
# Conflicts:
#	version.json
2025-05-06 07:15:10 +02:00
Andy Butland ba95c12f09 Resolved failures in unit tests. 2025-05-06 05:37:30 +02:00
Andy ButlandandGitHub 14fbd20665 Merge commit from fork
* Backport user enumeration fix.

* Supress warning on use of .NET 6 with TimeProvider dependency.

* Replace TimeProvider with Stopwatch, as the former isn't tested against .NET 6.0 and generates warnings.

* Remove full path details from exception when requesting a path outside of the physical file system's root.

* Added randomness to login duration.

* Ensured against negative duration.
2025-05-06 05:11:03 +02:00
mole 2d8b5e8786 Use windows agent for nuget push 2025-04-28 10:48:26 +02:00
Andy Butland 747e095178 Bump version to 10.8.10. 2025-04-22 10:06:27 +02:00
Andy Butland 1cfa5a225e Merge branch 'release/10.8.9' into v10/dev
# Conflicts:
#	version.json
2025-03-11 09:20:51 +01:00
7888b9a4ce Merge commit from fork
* Bumped version to 10.8.9.

* Fixed parsing of node if in content and media permission querystring handlers to retrieve expected value when multiple are provided in the querystring.

# Conflicts:
#	tests/Umbraco.Tests.UnitTests/Umbraco.Web.BackOffice/Authorization/ContentPermissionsQueryStringHandlerTests.cs
#	tests/Umbraco.Tests.UnitTests/Umbraco.Web.BackOffice/Authorization/MediaPermissionsQueryStringHandlerTests.cs

* Add HttpPost attributes to backoffice endpoints that should only accept post requests.

* Narrow PermissionQueryString parsing to the releveant UmbracoObjectType

* Add missed update from v10

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
2025-03-11 05:11:08 +01:00
Andy Butland e31582b297 Backport bumped imagesharp to prevent CVE-2025-27598 #18602 2025-03-09 08:58:25 +01:00
Nikolaj Geisle 75cc017a18 Merge branch 'release/10.8.8' into v10/dev
# Conflicts:
#	version.json
2025-01-23 11:08:09 +01:00
d60137e6da Merge commit from fork
* Ensure preview can only be requested with a valid culture code.

* Update src/Umbraco.Web.BackOffice/Controllers/PreviewController.cs

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

* Restricted to predefined culture codes.

---------

Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
2025-01-20 14:14:28 +01:00
Andy Butland 9f9c88781a Bumped version to 10.8.8. 2025-01-07 10:08:01 +01:00
c7014e159b Sort manifest file paths alphabetically (#14466)
* Sort manifest file paths alphabetically

* Update src/Umbraco.Infrastructure/Manifest/ManifestParser.cs

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

---------

Co-authored-by: Ronald Barendse <ronald@barend.se>
2024-11-21 16:19:48 +01:00
Zeegaan 31e1acce67 Merge remote-tracking branch 'origin/release/10.8.7' into v10/dev
# Conflicts:
#	version.json
2024-10-23 08:48:08 +02:00
Sven GeusensandNikolaj Geisle 35c51a029a Prevents XSS when viewing an uploaded SVG
from the media-info and image-preview components.
2024-10-21 12:42:06 +02:00
ElitsaandNikolaj Geisle 8c1128c85b Update the HttpContext's user with the authenticated user's principal 2024-10-21 12:41:42 +02:00
ElitsaandNikolaj Geisle c9021ab2d2 Reduce the time when getRemainingTimeoutSeconds request is made from 30s to 20s, so fewer calls are made 2024-10-21 12:41:18 +02:00
ElitsaandNikolaj Geisle 67a71f8f82 Make sure that the client shows the login screen as close to the server's timout time as possible 2024-10-21 12:41:17 +02:00
Andreas ZerbstandAndreas Zerbst edd0a4a4a9 Updated message pack (#17320)
(cherry picked from commit 11270eaaf5)
2024-10-21 11:46:43 +02:00
Andreas ZerbstandGitHub 11270eaaf5 Updated message pack (#17320) 2024-10-21 11:00:47 +02:00
Bjarke BergandGitHub 2d71b5a63b Updated image sharp to a non vulnerable version (#17290) 2024-10-16 12:16:38 +02:00
Nikolaj Geisle 9bab74d30e Bump version.json 2024-10-07 11:55:34 +02:00
Bjarke Berg 0ee0db8071 Merge remote-tracking branch 'refs/remotes/origin/release/10.8' into v10/dev
# Conflicts:
#	version.json
2024-05-21 08:44:27 +02:00
Bjarke BergandGitHub c17d4e1a60 Merge pull request from GHSA-j74q-mv2c-rxmp 2024-05-17 08:37:51 +02:00
Bjarke Berg fee222daff Bump version 2024-05-03 09:29:37 +02:00
119fde2033 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>
2024-04-24 13:44:20 +02:00
Andy ButlandandGitHub 52c21b0fca Updates JSON schema for Umbraco 10 with latest references for Forms and Deploy (#15918) 2024-03-20 13:20:40 +01:00
Bjarke Berg 99d5a7e609 Merge remote-tracking branch 'origin/release/10.8' into v10/dev 2024-03-19 08:43:59 +01:00
JeyandBjarke Berg 7e1d1a1968 Merge pull request from GHSA-552f-97wf-pmpq
Co-authored-by: jey <jey@umbraco.dk>
(cherry picked from commit b743f6a2df)
2024-03-18 08:28:25 +01:00
b743f6a2df Merge pull request from GHSA-552f-97wf-pmpq
Co-authored-by: jey <jey@umbraco.dk>
2024-03-18 08:27:41 +01:00
Bjarke Berg a2511ff09b Fixing locking issues for document type saves. (#15854)
* Added  ExecuteNonQuery(DbCommand command) on database to ensure we call OnExecutingCommand and OnExecutedCommand when executing DbCommands

* Added Cache Instructions lock, to avoid deadlocks

* Optimized read locks for nucache when only one content type is rebuilt

* Optimized the SqlServer locks, so only one command is executed (and thereby roundtrip) per lock instead of two

* Avoid breaking changes

* Cosmetic changes

* Take locks if everything is rebuild

* Use same lock in scopes, to avoid potential deadlocks between the two

* Use eager locks in PublishedSnapshotService.cs

* Added timeouts to some of the application locks

* Revert "Use eager locks in PublishedSnapshotService.cs"

This reverts commit 01873aae97.

* Revert "Added Cache Instructions lock, to avoid deadlocks"

This reverts commit e3fca7c12a.

* Use single readlock call to lock many

* Use eager locks for reads

* Eager write locks

* Ignore test of lazy locks

* Unique timeout exception messages

---------

Co-authored-by: kjac <kja@umbraco.dk>
(cherry picked from commit 2c23e67c65)
2024-03-15 14:55:20 +01:00
2c23e67c65 Fixing locking issues for document type saves. (#15854)
* Added  ExecuteNonQuery(DbCommand command) on database to ensure we call OnExecutingCommand and OnExecutedCommand when executing DbCommands

* Added Cache Instructions lock, to avoid deadlocks

* Optimized read locks for nucache when only one content type is rebuilt

* Optimized the SqlServer locks, so only one command is executed (and thereby roundtrip) per lock instead of two

* Avoid breaking changes

* Cosmetic changes

* Take locks if everything is rebuild

* Use same lock in scopes, to avoid potential deadlocks between the two

* Use eager locks in PublishedSnapshotService.cs

* Added timeouts to some of the application locks

* Revert "Use eager locks in PublishedSnapshotService.cs"

This reverts commit 01873aae97.

* Revert "Added Cache Instructions lock, to avoid deadlocks"

This reverts commit e3fca7c12a.

* Use single readlock call to lock many

* Use eager locks for reads

* Eager write locks

* Ignore test of lazy locks

* Unique timeout exception messages

---------

Co-authored-by: kjac <kja@umbraco.dk>
2024-03-15 10:56:02 +01:00
Bjarke Berg 8e837d387d Merge remote-tracking branch 'origin/v10/dev' into release/10.8
# Conflicts:
#	version.json
2024-03-14 14:53:42 +01:00
Bjarke Berg 801fb5f885 Bump version 2024-03-14 14:48:09 +01:00
Bjarke BergandGitHub ed517ecd86 Update Imagesharp (#15885) 2024-03-14 14:31:30 +01:00
Bjarke Berg b5e46ba880 Merge remote-tracking branch 'origin/release/10.8' into v10/dev 2024-02-06 11:07:16 +01:00
Nikolaj GeisleandGitHub cbf9f9bcd1 Merge pull request from GHSA-gvpc-3pj6-4m9w
* Add MarkDownPropertyValueEditor with html sanitizer

* Implement IMarkdownSanitizer.
2024-02-06 09:53:40 +01:00
Bjarke Berg 2735f17ed8 Merge remote-tracking branch 'origin/release/10.8' into v10/dev
# Conflicts:
#	version.json
2024-02-01 11:09:47 +01:00
Ronald BarendseandBjarke Berg e37cf30690 Skip cache refresher operations for content blueprints (#15633)
* Skip cache refresher operations for content blueprints

* Fix JsonPayload deserialization error by adding a default constructor and property initializers

* Obsolete JsonPayload constructor and update usages

(cherry picked from commit 3e28e10cdf)
2024-02-01 10:00:42 +01:00
Bjarke BergandGitHub 118ac8e230 V10+ version of https://github.com/umbraco/Umbraco-CMS/pull/15638 (#15664) 2024-02-01 09:58:42 +01:00
Ronald BarendseandGitHub 3e28e10cdf Skip cache refresher operations for content blueprints (#15633)
* Skip cache refresher operations for content blueprints

* Fix JsonPayload deserialization error by adding a default constructor and property initializers

* Obsolete JsonPayload constructor and update usages
2024-02-01 09:55:09 +01:00
AleksanderandBjarke Berg b18b6cc5e7 Pass cache level to properties when creating published content in nucache
(cherry picked from commit d9d2b66e85)

# Conflicts:
#	src/Umbraco.Web/PublishedCache/NuCache/PublishedContent.cs
(cherry picked from commit 040495f359)
2024-01-31 10:52:01 +01:00
Elitsa MarinovskaandBjarke Berg 7a04baf9ef V10: Pass in variation context to published cache (#15563)
* Make sure that we always have variation context

* Fix references

(cherry picked from commit 57b3a196bf)
2024-01-30 15:57:33 +01:00
Sven GeusensandBjarke Berg bc1ddaed8c Run the same cleanup with scaffolding content as when copying. (#15541)
* Run the same cleanup with scaffolding content as when copying.

- Added a new ContentScaffoldedNotification
- Published the notification when a new scaffold has been created from a blueprint (content template)
- Linked up the ComplextPEContent handler to do the same cleanup for the new notification as when copying.
- registered handlers to the event for blocklist, blockgrid and nested content

* PR pattern matching suggestion

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>
(cherry picked from commit dff90c6ec0)
2024-01-30 15:54:33 +01:00
Bjarke Berg 860afb35f2 Bump version 2024-01-30 15:53:21 +01:00
Ronald BarendseandGitHub 9799c550f4 Create shadow file systems in configured LocalTempPath (#15637) 2024-01-29 08:48:45 +01:00
Ronald BarendseandGitHub b7e43a8def Get references from macro parameters using IDataValueReferenceFactory (#15625) 2024-01-23 16:08:17 +01:00
Ronald BarendseandGitHub cdbbd6a921 Optimize relation tracking for adding new and keeping existing relations (#15596)
* Include automatic relation type aliases from factory and fix SQL parameter overflow (#15141)

* Include automatic relation type aliases from factory

* Remove unnessecary distinct and fix SQL parameter overflow issue

* Fixed assertions and test distinct aliases

* Simplified collection assertions

* Improve logging of invalid reference relations (#15160)

* Include automatic relation type aliases from factory

* Remove unnessecary distinct and fix SQL parameter overflow issue

* Fixed assertions and test distinct aliases

* Simplified collection assertions

* Improve logging of invalid reference relations

* Always get all automatic relation type aliases

* Do not set relation type alias for unknown entity types

* Get references from recursive (nested/block) properties

* Optimize relation tracking for adding new and keeping existing relations

* Optimize getting references by grouping by property editor alias and avoiding duplicate parsing of the same value
2024-01-22 14:53:20 +01:00
Ronald BarendseandGitHub 5198e7c52d Backport relation tracking fixes and get references from recursive (nested/block) properties (#15593)
* Include automatic relation type aliases from factory and fix SQL parameter overflow (#15141)

* Include automatic relation type aliases from factory

* Remove unnessecary distinct and fix SQL parameter overflow issue

* Fixed assertions and test distinct aliases

* Simplified collection assertions

* Improve logging of invalid reference relations (#15160)

* Include automatic relation type aliases from factory

* Remove unnessecary distinct and fix SQL parameter overflow issue

* Fixed assertions and test distinct aliases

* Simplified collection assertions

* Improve logging of invalid reference relations

* Always get all automatic relation type aliases

* Do not set relation type alias for unknown entity types

* Get references from recursive (nested/block) properties
2024-01-19 20:02:57 +01:00
Andy ButlandandGitHub 49f5d2e2d4 Updates JSON schema for Umbraco 10 to include details of additional configuration introduced in Forms and Deploy. (#15566) 2024-01-12 13:13:20 +01:00
Elitsa MarinovskaandGitHub 57b3a196bf V10: Pass in variation context to published cache (#15563)
* Make sure that we always have variation context

* Fix references
2024-01-11 12:46:31 +01:00
dff90c6ec0 Run the same cleanup with scaffolding content as when copying. (#15541)
* Run the same cleanup with scaffolding content as when copying.

- Added a new ContentScaffoldedNotification
- Published the notification when a new scaffold has been created from a blueprint (content template)
- Linked up the ComplextPEContent handler to do the same cleanup for the new notification as when copying.
- registered handlers to the event for blocklist, blockgrid and nested content

* PR pattern matching suggestion

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-01-10 12:22:36 +01:00
AleksanderandSebastiaan Janssen 040495f359 Pass cache level to properties when creating published content in nucache
(cherry picked from commit d9d2b66e85)

# Conflicts:
#	src/Umbraco.Web/PublishedCache/NuCache/PublishedContent.cs
2024-01-08 14:42:17 +01:00
Bjarke Berg a2ad95d965 Change content 2023-12-22 13:49:57 +01:00
Bjarke Berg 64f2447c0e Added script to update default version 2023-12-22 13:15:13 +01:00
Bjarke Berg b648126d19 Use wildcard as default valid 2023-12-22 12:59:13 +01:00
812b414d96 Batched more update calls to avoid Sql paramater count error (#15487)
Co-authored-by: Sven Geusens <sge@umbraco.dk>
2023-12-21 09:43:37 +01:00
Bjarke Berg ec91c47158 Merge remote-tracking branch 'origin/release/10.8' into v10/dev
# Conflicts:
#	version.json
2023-12-20 09:51:14 +01:00
Kenn JacobsenandGitHub e04a41be45 Add policies for content template handling (#15482) 2023-12-19 14:18:48 +01:00
Chris Fitz-AvonandBjarke Berg d5156aced2 Remove content section access policy from GetAllLanguages endpoint. #15435 (#15450)
(cherry picked from commit cedfdcc9b2)
2023-12-18 08:25:00 +01:00
Bjarke Berg fa9b0e4718 Bump version 2023-12-18 08:23:34 +01:00
Bjarke Berg 8915064780 Merge remote-tracking branch 'origin/release/10.8' into v10/dev
# Conflicts:
#	version.json
2023-12-13 09:28:19 +01:00
ZeegaanandBjarke Berg 677ff59d04 Loosen up policies so editors can get what they need 2023-12-12 15:46:46 +01:00
Bjarke Berg 1fe2ec08be bump version 2023-12-12 15:35:15 +01:00
Bjarke Berg 5dfa76600a Post fix 2023-12-11 16:32:38 +01:00
Bjarke Berg 83bcd37250 Merge remote-tracking branch 'origin/release/10.8' into v10/dev 2023-12-11 14:37:10 +01:00
Kenn JacobsenandGitHub 4a7ad4a562 Merge pull request from GHSA-v98m-398x-269r 2023-12-11 14:00:23 +01:00
cdd4d2a000 Merge pull request from GHSA-cfr5-7p54-4qg8
* Bump version

* Apply authorization policies to controllers

* Return bad request if we urltracking is disabled

* Apply authorization policies to controllers

* Return bad request if we urltracking is disabled

---------

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-12-11 13:59:59 +01:00
be5a740c96 Merge pull request from GHSA-8qp8-9rpw-j46c
* Added Exception handling and replicated error and info message

* Update auth.resource.js

Fixed the message

* Changed Delay introduction to early phase to avoid repeating code.

---------

Co-authored-by: jey <jey@umbraco.dk>
Co-authored-by: Jey <cyaqublu@gmail.com>
2023-12-11 13:59:35 +01:00
13cc320f19 Merge pull request from GHSA-6324-52pr-h4p5
* Bump version

* Fix https://github.com/umbraco/Umbraco-CMS/security/advisories/GHSA-6324-52pr-h4p5

* Fix https://github.com/umbraco/Umbraco-CMS/security/advisories/GHSA-6324-52pr-h4p5

---------

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-12-11 13:59:03 +01:00
ZeegaanandBjarke Berg b5544aa520 Suppress flow when queueing background threads 2023-12-11 12:43:25 +01:00
Bjarke Berg 9e3f8c7d0c Merge remote-tracking branch 'origin/release/10.8' into v10/dev
# Conflicts:
#	version.json
2023-12-08 13:12:33 +01:00
Bjarke Berg cb76554455 Bugfix: Count existing media correct (#15206)
* https://github.com/umbraco/Umbraco-CMS/issues/15205
Count media correct

* Fix content should be document

(cherry picked from commit d2ff2ea46e)
2023-12-07 09:21:25 +01:00
Jacob Overgaard 37e4d80ce8 Update nightly build (#15359)
* cherry-pick templateParameters from v14/dev

* add isNightly parameter

* remove v9

* add parameter check for myget isNightly
2023-12-05 12:45:23 +01:00
Bjarke Berg d5d4edbe92 Bump Version 2023-11-30 21:51:54 +01:00
Bjarke Berg 8d9343b564 Merge branch 'release/10.8' into v10/dev
# Conflicts:
#	version.json
2023-11-27 18:10:40 +01:00
Bjarke Berg 1ee891c8d5 Merge remote-tracking branch 'origin/release/10.8' into release/10.8 2023-11-27 18:09:41 +01:00
Bjarke Berg bf1a5b9b28 Bump version 2023-11-27 18:09:30 +01:00
Bjarke Berg 696b74cdb6 Merge branch 'release/10.8' into v10/dev 2023-11-27 18:08:30 +01:00
Bjarke BergandGitHub bf8af4588e Centralised NuGet packages (#15293)
* Moved to centralized nuget packages

* Handle JsonSchema

* Change PackageReference to PackageVersion

* Opt out of central package management for mangement api (at least for versions less than 14) and the UI project

* ManagePackageVersionsCentrally = false

* Change folder acceptance tests are build, to avoid reading the test Directory.Packages.props

* Change folder acceptance tests are build, to avoid reading the test Directory.Packages.props

* change working directory

* workingDirectory

* Force the template to use local nuget packages

* Force the template to use local nuget packages

* clean up

* added wait on

* added wait on
2023-11-27 15:18:00 +01:00
Kenn JacobsenandBjarke Berg 4781fb1d8b Ensure content types are updated in ContentStore when a data type changes (#15239) 2023-11-17 10:37:23 +01:00
Bjarke Berg d714741bee Fixed build 2023-11-15 09:53:28 +01:00
Bjarke Berg ea33b73daa Added scope.complete in edge cases. (#15207)
(cherry picked from commit 28e8ac11f0)
2023-11-15 09:46:24 +01:00
Bjarke Berg ba64b46824 Merge remote-tracking branch 'origin/release/10.8' into release/10.8 2023-11-15 09:45:30 +01:00
Bjarke Berg 04e59e9a9d Fixed a couple of occurrences where scopes was auto-completed while modified db state (#14947)
* Fixed a couple of occurrences where scopes was auto-complated while actually modified the state of the database.

* Added temp ctor to fix boot issue

(cherry picked from commit 41f8f03c2c)
2023-11-15 09:45:23 +01:00
Jacob OvergaardandGitHub be39b9c19a V10: Update @umbraco-ui/uui, jQuery, ace-editor, nouislider, spectrum-colorpicker2 (#15197)
* V13: Add support for Node.js 20 (#15022)

* update versionSpec to nodejs 20 and avoid specifying minor and patch versions to improve Azure Pipelines stability

* update engines and package lock files

* update helpful displayNames for npm builds

* add retry to counter nodejs.org timeouts

add retryCountOnTaskFailure as suggested on https://developercommunity.visualstudio.com/t/NodeTool0-task-to-install-nodejs-fails/10455454

* update lockfile

* bump nvm support to latest node.js 20.9 LTS

* build(deps): bump @umbraco-ui/uui from 1.3.0 to 1.5.0

* build(deps): bump public dependencies to latest

* build(deps-dev): bump build dependencies to latest

* build(deps-dev): bump test tools to latest

* build: add script to lint and run --fix

* revert login merge from v13
2023-11-14 13:08:29 +01:00
Bjarke Berg 9a143c0850 Merge remote-tracking branch 'origin/release/10.8' into release/10.8 2023-11-14 11:46:26 +01:00
Bjarke Berg df4cd63962 https://github.com/umbraco/Umbraco-CMS/issues/15195 Fixed issue with media not cached correct (#15196) 2023-11-14 10:59:30 +01:00
Bjarke Berg a17e398f28 Merge remote-tracking branch 'origin/release/10.8' into v10/dev 2023-11-14 09:29:36 +01:00
Bjarke Berg 9af9dd2c02 Merge remote-tracking branch 'origin/release/10.8' into v10/dev 2023-11-14 09:29:09 +01:00
Bjarke BergandGitHub 2266a98fc6 https://github.com/umbraco/Umbraco-CMS/issues/15195 Fixed issue with media not cached correct (#15196) 2023-11-14 09:14:01 +01:00
151fccee97 Performance optimisations related to blocks (and multi url picker) (#15184)
* Added content types to property index value factory, because the deep cloning is too expensive to execute often

* Do not use entityservice in ToEditor, as it goes to the database. We need to use something that is cached.

* Small performance optimization for nested content too

* A little formatting and an obsoletion message

---------

Co-authored-by: kjac <kja@umbraco.dk>
2023-11-14 08:12:05 +01:00
Bjarke Berg abfa07367f Bump version 2023-11-13 18:06:41 +01:00
Bjarke BergandGitHub e5de8bf56b Updated nuget packages (#15192) 2023-11-13 14:59:52 +01:00
Bjarke Berg 00bb5170a0 Merge remote-tracking branch 'origin/v10/dev' into release/10.8
# Conflicts:
#	version.json
2023-11-09 13:53:46 +01:00
919138c299 #14835 Update link on permissionsreport.html (#14872)
* #14835 Update link on permissionsreport.html

Updated link to permissions page to point to 10-LTS documentation

* retrigger checks

---------

Co-authored-by: Rasmus Berntsen <rasmus.berntsen@isobar.com>
2023-11-09 13:53:18 +01:00
Ronald BarendseandGitHub ed65645a33 Add global.json and cleanup UI project file (#14900)
* Add global.json with minimum .NET 6.0.5 SDK version and roll forward policy

* Clean up UI project file
2023-11-09 13:52:21 +01:00
Ronald BarendseandGitHub d0be4ab263 Publish ContentTreeChangeNotification after saving/deleting blueprints (#14898) 2023-11-09 13:51:05 +01:00
Bjarke Berg ddb26632f9 Bump to rc 2023-11-09 13:38:34 +01:00
Bjarke Berg d5b1f5875b Bump version 2023-11-09 13:38:13 +01:00
Bjarke Berg f8c1a560ff Bump version 2023-11-09 13:36:57 +01:00
9e5ff305c8 Batched bulk WhereIn query to avoid To mana paramaters error (#15004)
Co-authored-by: Sven Geusens <sge@umbraco.dk>
2023-11-07 10:49:46 +01:00
Elitsa MarinovskaandGitHub ffaa77eb25 Update correct action (#15142) 2023-11-06 17:54:16 +01:00
Kenn JacobsenandGitHub 6777145079 Ensure that missing access rules do not break the site (#15081) 2023-11-02 08:45:27 +01:00
Elitsa MarinovskaandGitHub 92af8ac881 Check content permissions before performing action (#15043)
* Setting actionContext.Result when authz wasn't successful

* Taking into account permissions when it is a new node

* Cleanup

* Passing nodeId as path when new item
2023-11-01 11:30:32 +01:00
Lucas Bach BisgaardandSebastiaan Janssen bde88caf14 Fixes #14351 - Using Fallback to default langauge on a specific item changes the whole VariationContext (#14620)
(cherry picked from commit 738749b705)
2023-10-26 11:47:44 +02:00
Bjarke BergandGitHub f4ac6cdded Added "pr: none" to nightly trigger (#15044) 2023-10-26 09:01:25 +02:00
Elitsa MarinovskaandGitHub 132935c2d7 Handle corrupted index (#14889) 2023-10-09 10:19:36 +02:00
Kenn JacobsenandGitHub 04b05714e5 Add notification state to "final" published notification when publishing with descendants (#14922)
* Revert "V10/bugfix/14543 publish descendants (#14763)"

This reverts commit f750bca453.

* Add notification state to "final" published notification when publishing with descendants
2023-10-05 14:39:00 +02:00
Kenn JacobsenandGitHub 7be1852827 Make sure to sign out external users if an error occurs during sign-in (#14867) 2023-09-28 13:25:11 +02:00
Andreas ZerbstandGitHub 158cef1692 V10 fixed up failing acceptance test (#14829)
* Updated playwright, our builders, and our helpers

* Updated the use of our testhelper methods, we removed the need for sending umbracoApi through the methods as a parameter since it was unnecessary

* Added a timeout

* Updated successNotifications and added a locator

* Removed timeout from successNotification

* Added additional timeouts and updated old locators which were failing

* Updated locator so it only finds one element

* Removed timeouts and added a waitForTimeout

* Removed timeouts

* Removed timeouts

* Added timeouts

* Updated locator

* Added a timeout

* Updated locators for clicking button

* Changed locator for adding the image, sometimes the old locator would find 2 locators
2023-09-20 12:15:24 +02:00
Bjarke Berg 1a4f3981eb Merge remote-tracking branch 'origin/v10/dev' into v10/dev 2023-09-20 09:42:28 +02:00
Bjarke Berg 7765f98ee1 Added random delay in forgot password to lessen the risk the response times can be use to determine whether the mail exist or not. 2023-09-20 09:02:32 +02:00
6b72880c0b fix: ensured that allowed user name characters are supported in backoffice users as well (#14810) (#14825)
Co-authored-by: Arkadiusz Biel <bielu@bielu.com.pl>
2023-09-19 09:01:35 +02:00
Andy ButlandandGitHub d9f3936a43 Updated dependencies to Forms and Deploy for JSON schema generation. (#14826) 2023-09-19 08:54:41 +02:00
bf09c87f87 Mention MultiUrlPickerValueConverter instead (#14818)
Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-09-18 13:48:11 +02:00
Sven GeusensandGitHub ec2134dea0 Disabled nighly build branch trigger (#14807) 2023-09-15 10:02:29 +02:00
Nikolaj GeisleandGitHub 8ccc2faee0 Add UsePagedSqlQuery setting to NucacheSettings (#14806)
* imlement UsePagedSqlQuery

* Remove unneccesary spacing
2023-09-14 20:11:08 +02:00
Jacob Overgaard 0a4cc27a5d V12: Property editors should only contain layout when in preview mode (#14796)
* Revert "Make sure the property editor layout is contained within its container (prevent Z-index bleed-through) (#13583)"

This reverts commit 8463d906a7.

* remove seemingly unused attribute readonly

* contain everything with contain:layout

this is set if the property editor is in preview mode to make sure all overlays work

* Revert "remove seemingly unused attribute readonly"

This reverts commit 7a2743e8f6.
2023-09-14 13:19:36 +02:00
c8e054baa2 V10/feature/pipeline test filters (#14766)
* Add configuration/code to not run certain tests based on variables/release builds

* Applied longrunning testAttribute to the worst offenders (>200ms on my machine)

* Fix yaml notation

* split up windows/non windows test runs

* Added supression for moved tests

* Fix yaml validation issues

* Change yaml string parameter null value to empty string

* Convert empty strings to whitespace strings

* Rename and cleanup some paramater to better reflect why we use them

* Nightly build test

* Change nightly build authentication type

* template paramater fix

* Update nightly pipeline name

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
2023-09-12 14:16:27 +02:00
Bjarke Berg 95ffdae475 Merge remote-tracking branch 'origin/v10/dev' into v10/dev 2023-09-12 09:43:52 +02:00
Andreas ZerbstandJacob Overgaard ca8ac21f4b Added test for checking if settings model contains default value (#14513)
* Added test for checking if a settings model contains default value.
Fixed tests

* Bumped version

* Moved createSliderWithDefaultValue function to our testHelpers. Removed the use of count in test since there was only one
2023-09-11 15:13:08 +02:00
Jacob Overgaard f85a0d1715 Render all tabs in the background to ensure they register their initial state on any $scope.model in the stack. (#14493)
Sometimes a tab, e.g. a "block list settings model" might register some default values, but if the user never clicks on the tab then they are not registered due to how AngularJS renders views with "ng-if".
2023-09-11 15:12:48 +02:00
Andreas ZerbstandGitHub 2fc29e638c Limbo models builder changes the content to element when using Compositions (#14776) 2023-09-07 17:18:57 +02:00
Andreas ZerbstandGitHub 56486b1ace V10 Cherrypicked issuu RTE embed (#14777)
* Added a UserAgent to header

* Added the use of iframe. This allows us to see the issuu embed in the RTE
2023-09-07 16:28:11 +02:00
Bjarke Berg fd043f6ecf Merge remote-tracking branch 'origin/v10/dev' into release/10.7 2023-09-05 10:19:13 +02:00
Bjarke Berg 39a102ed8a rollback version 2023-09-05 10:14:21 +02:00
f750bca453 V10/bugfix/14543 publish descendants (#14763)
* WIP: Fix publish descendants and related notifications

* Removed related entitities from publish notification

* Fixed root not being saved when publishingWithDescendants

* Updated integrationtests to reflect the update view on when to save the root when its part of a branch

* PR formatting fix

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

* PR Cleanup

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

* Spicing up the codebase with some PR pattern matching

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-09-05 10:14:06 +02:00
Bjarke Berg 7e36203f60 Merge remote-tracking branch 'origin/release/10.7' into v10/dev
# Conflicts:
#	version.json
2023-09-04 10:24:22 +02:00
Bjarke Berg 334dff8645 bump version number 2023-09-04 10:23:44 +02:00
Bjarke Berg 9fd140f81d Merge remote-tracking branch 'origin/release/10.7' into v10/dev 2023-08-28 11:35:41 +02:00
Bjarke BergandGitHub 1198c76d67 Remove parsing of short into integer (#14721) 2023-08-25 13:07:42 +02:00
Nikolaj 869b480dae Bump version 2023-08-24 10:49:50 +02:00
Nikolaj 12704b112e Merge branch 'release/10.7' into v10/dev 2023-08-24 10:49:11 +02:00
Ronald BarendseandNikolaj 3c37653012 Fix exceptions in Slider and Tags property value converters (#13782)
* Fix IndexOutOfRangeException when converting single value to range in SliderValueConverter

* Fix NullReferenceException while deserializing empty value in TagsValueConverter

* Use invariant decimal parsing

* Handle converting from slider to single value

* Fix parsing range as single value

* Make Handle methods autonomous

---------

Co-authored-by: nikolajlauridsen <nikolajlauridsen@protonmail.ch>
2023-08-23 10:50:25 +02:00
e5a8d01004 Fix exceptions in Slider and Tags property value converters (#13782)
* Fix IndexOutOfRangeException when converting single value to range in SliderValueConverter

* Fix NullReferenceException while deserializing empty value in TagsValueConverter

* Use invariant decimal parsing

* Handle converting from slider to single value

* Fix parsing range as single value

* Make Handle methods autonomous

---------

Co-authored-by: nikolajlauridsen <nikolajlauridsen@protonmail.ch>
2023-08-23 10:09:43 +02:00
Andy ButlandandBjarke Berg 9fd0b1986c Updated JSON schema reference for Umbraco Forms. (#14701) 2023-08-22 13:30:26 +02:00
Andy ButlandandGitHub 80ea5174c6 Updated JSON schema reference for Umbraco Forms. (#14701) 2023-08-22 13:28:01 +02:00
Niels Lyngsøandkjac e1b4aebb0f directly render labels without angularJS template code (#14700) 2023-08-22 11:35:38 +02:00
Niels LyngsøandGitHub 38910a8d5c directly render labels without angularJS template code (#14700) 2023-08-22 11:27:16 +02:00
Kenn JacobsenandGitHub 0dc18982ee Do not allow content type property aliases that conflict with IPublishedElement (#14683) 2023-08-21 13:17:15 +02:00
311d322129 Add code infrastructure to validate file content (#14657)
* Implemented modular architecture for filestream security sanitization with an svg-html example

* 31440: Refactoring, applied to more entry points and removed test analyzer

* 31440 Added Unittests for FileStreamSecurityValidator

* PR fixes and better unittest mock names

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
2023-08-21 13:08:26 +02:00
Andreas ZerbstandGitHub e7af98027d Updated the name of our Acceptance test project in the pipeline (#14691)
* Updated the name of our Acceptance test project.

The reason is because we want the naming to be clear and concise.

* Changed the name of the e2e pipeline project name for linux

* Updated dll file
2023-08-18 13:36:54 +03:00
Anders ReusandBjarke Berg 30f0cfc15d Add exclusion filter setting to typefinder settings (#14426)
* Obsolete constructor with deprecated IScopeProvider

* Add exclusion setting to typefinder settings

* The old TypeFinder constructor calls the new constructor now instead and excluded duplicates by using Union instead of Concat.

* Revert "The old TypeFinder constructor calls the new constructor now instead and excluded duplicates by using Union instead of Concat."

This reverts commit 87801c6c1c.

* Add changes to TypeFinder

* Do not use null when type is not nullable

---------

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2023-08-15 09:58:58 +02:00
Ronald BarendseandBjarke Berg b743e715d4 Add DynamicRequestCultureProviderBase and improve locking (#14064) 2023-08-10 11:16:23 +02:00
d3243f8700 Bugfix 31584 - Remove Lazy "caching" that retains keys of deleted ContentTypes which causes unecesary validation errors (#14643)
The validation errors should not happen as the model mapping cleans up block data for entity types that do not longer exist (which is checked on the aformentioned key)

Co-authored-by: Sven Geusens <sge@umbraco.dk>
2023-08-09 13:11:44 +02:00
264e4f8b57 Add config so it is configurable whether to explicitly index each nested property (#14648)
* Added new configuration "Umbraco:CMS:Examine:ExplicitlyIndexEachNestedProperty" that can be used to avoid nested properties like block grid to index each property individually.

* Moved the setting "Umbraco:CMS:Examine:ExplicitlyIndexEachNestedProperty" to "Umbraco:CMS:Indexing:ExplicitlyIndexEachNestedProperty" to make it more future proof

* Added missing registration

* Fixed registration

* Small readability improvement

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
2023-08-09 11:47:45 +02:00
Sven Geusens 2b3f048db7 Revert "Implemented modular architecture for filestream security sanitization with an svg-html example"
This reverts commit 18ee016ae9.
2023-08-08 16:26:59 +02:00
Sven Geusens 18ee016ae9 Implemented modular architecture for filestream security sanitization with an svg-html example 2023-08-08 14:49:18 +02:00
Bjarke BergandGitHub 512199c8ab Pass the existing notification state to the ContentUnpublishingNotification so it can be shared. (#14638) 2023-08-08 09:40:44 +02:00
Bjarke BergandGitHub 4e410a9dd5 Stop event propagation when clicking on the expand-arrow in the tree. (#14637) 2023-08-08 09:27:23 +02:00
Jacob OvergaardandNiels Lyngsø e16e36c68f V12: Remove avatar step from login (#14629)
Co-authored-by: Niels Lyngsø <niels.lyngso@gmail.com>
2023-08-07 11:02:53 +02:00
Bjarke Berg f384e0c30c Allow newlines in invite email and escape other html (#14618) 2023-08-02 14:17:39 +02:00
Bjarke Berg 04b74dddd0 Added missing async awaits in notifications that ensures objects are not disposed too early
Fixes https://github.com/umbraco/Umbraco-CMS/issues/14574
2023-08-02 11:37:39 +02:00
Kenn JacobsenandGitHub 43700d2bcb Ensure that the Slider does not crash the back-office (#14601)
* Ensure that the Slider does not crash the back-office

* Add field descriptions to config
2023-07-25 08:39:59 +02:00
Adrian CojocariuandGitHub eed9feb5f3 Fix method invoke. (#14597) 2023-07-24 15:18:23 +02:00
b2a5ce3e48 V10: Dropzone should handle internal and external errors when uploading (#14578)
* fix: mark files that result in error as processed

* fix: for safety measure check that a file is truthy before trying to upload it

* fix: push an error when file.$error is encountered to make sure it does not get uploaded

* fix: remove header from error messages since it is not being used anyway

* fix: check for maxFileSize before uploading pasted images in tinymce

* use stored blob variable

* feat: add property to fileManager to get and format the maxFileSize

* fix: make tinymce use fileManager to get maxFileSize

* fix(image cropper): check for maxFileSize before setting file to upload

* multiply by 1000 to get bytes

---------

Co-authored-by: Elitsa <elm@umbraco.dk>
2023-07-24 10:17:21 +02:00
Andy ButlandandGitHub 0ae404ce03 Extends JSON schema/Intellisense to full details of InstallDefaultData settings. (#14568)
* Fixes an incorrect property name used for generating JSON schema.

* Added JSON schema/intellisense for default data dictionary keys.

* Renamed private variable to match setting name.
2023-07-20 13:51:05 +02:00
ab836d2326 V10: Find and persist embedded images in rich text (#14546)
* add method to find and persist embedded base64 (data-uri) images in a html string

* use method to find embedded images in the Umbraco.TinyMce and Umbraco.Grid property editors

* rename method to better reflect what it does

* set allowed upload file types for integration tests

* add test for embedded images in Umbraco.TinyMce

* let old ctor call new ctor

* Apply suggestions from code review

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

* apply pattern matching

---------

Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
2023-07-18 09:17:19 +02:00
Andy ButlandandGitHub c12cce6d8c Fixes an incorrect property name used for generating JSON schema. (#14542) 2023-07-14 09:27:02 +02:00
nikolajlauridsen 78e1da3231 Merge branch 'release/10.6' into v10/dev 2023-07-13 10:55:36 +02:00
82eae48d09 Merge pull request from GHSA-h8wc-r4jh-mg7m
* Don't login after install

* Fail the install if database is not created

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
Co-authored-by: Nikolaj <nikolajlauridsen@protonmail.ch>
2023-07-13 06:03:39 +02:00
Elitsa MarinovskaandGitHub a5ba32bfd7 Store tags as text (instead of nvarchar) (#14510)
* Migrate tags from NVarchar To NText

* Cleanup
2023-07-07 14:23:32 +02:00
Bjarke Berg c695f2192f Merge remote-tracking branch 'origin/release/10.6' into v10/dev
# Conflicts:
#	version.json
2023-07-07 08:27:51 +02:00
Zeegaan dc5c7a14a5 Bump version 2023-07-06 10:40:50 +02:00
Zeegaan c751e90928 Merge branch 'release/10.6' into v10/dev
# Conflicts:
#	version.json
2023-07-06 09:20:47 +02:00
Zeegaan d86e4b2d38 Bumb version 2023-07-05 10:46:14 +02:00
MaartenandSebastiaan Janssen 3f196a9de4 Fix broken CookieAuthenticationRedirect caused by PR #14036 for non-api requests (#14399)
* Fix broken CookieAuthenticationRedirect caused by PR #14036 when not in an API controller

* Added Integration Tests for the MemberAuthorizationFilter

* Fix merge conflict

---------

Co-authored-by: Elitsa <elm@umbraco.dk>
(cherry picked from commit 1d239a30ca)
2023-07-04 11:10:58 +02:00
Nikolaj Brask-NielsenandSebastiaan Janssen 30ec9d9bc7 fix: Allows copying from unsaved content (#14464)
#14459

(cherry picked from commit 1d14158d82)
2023-07-04 11:08:39 +02:00
Anders BjernerandSebastiaan Janssen 3087fc3ba9 Added missing Danish translation for general_change (#14461)
* Added missing Danish translation for `general_change`

* Update en_us.xml

(cherry picked from commit a090997aa1)
2023-07-04 11:07:21 +02:00
christophnzandSebastiaan Janssen 7fd7a8715d Fixed typo "optinal" to "optional" for translation dictionary import dialog and 2 other occurrences
(cherry picked from commit 77a2e4b557)
2023-07-04 10:42:56 +02:00
Bjarne FyrstenborgandSebastiaan Janssen 62fd860a9e Show SVG icons for toolbar in configuration of richtext editor (#14404)
* Load default icons to show them next to checkboxes in configuration of richtext editor

* More mapping of icons

* Fix vertical align items centered not reflected

* Wrap mapping in function

* Map a few more icons

* Cleanup and formatting

* Cleanup

* Cleanup

* Add period in description

(cherry picked from commit 583965cf9d)
2023-07-04 10:41:40 +02:00
Mads Mørch SchouandSebastiaan Janssen 76ad99beb0 Makes sure the nucache is not truncated when its null (#14395)
* Makes sure the nucache is not truncated when its null
* Removed parentheses

(cherry picked from commit 0a4a938b88)
2023-07-04 10:36:57 +02:00
Jason ElkinandSebastiaan Janssen ebe375d23b Add ContentDeletingNotification to EmptyRecycleBin (#14397)
* Add ContentDeletingNotification to EmptyRecycleBin

* Fix formatting.

(cherry picked from commit 118f914158)
2023-07-04 10:35:08 +02:00
Marco TeodoroandSebastiaan Janssen 2f35967bb2 fix: #12253 Anchor picker does not appear (#13492)
* fix: #12253 Anchor picker does not appear

* Update ContentServiceExtensions.cs

fix: #12253  #13492 ; implement PR suggestions, test the new changes to confirm that they fix the issue with the anchorlink implementation on RTE from blocklist, blockgrid and normal RTE properties
Co-Authored-By: Laura Neto <12862535+lauraneto@users.noreply.github.com>

* Removed unnecessary using and code

* Small adjustments

---------

Co-authored-by: Laura Neto <12862535+lauraneto@users.noreply.github.com>
(cherry picked from commit 1ba834a9ca)
2023-07-04 10:33:05 +02:00
Paul SealandSebastiaan Janssen f93f3d88da Fix/delete language error message 14333 (#14396)
* Update the tour text to the correct text and to save confusion

* Added extra information to the delete language warning to inform the user that it will also delete all content related to the language

* Updated language files with same message re deletion

---------

Co-authored-by: Paul Seal <p.seal@clerkswell.com>
Co-authored-by: Emma Garland <emma.garland@rocksolidknowledge.com>
(cherry picked from commit 542d0f7f74)
2023-07-04 10:06:26 +02:00
Bjarne FyrstenborgandSebastiaan Janssen dbd009ffcd Update label in Danish translation
(cherry picked from commit 575f00d6f0)
2023-07-04 10:05:17 +02:00
alevak09andSebastiaan Janssen b99e14e288 Add Croatian Language (#14379)
Croatian language translation of Umbraco backoffice and culture settings

(cherry picked from commit 9f4d3e5525)
2023-07-04 10:03:42 +02:00
Paul SealandSebastiaan Janssen b8415ed7f0 Update the tour text to the correct text and to save confusion
(cherry picked from commit 5073a26e7f)
2023-07-04 10:00:09 +02:00
Miguel PintoandSebastiaan Janssen 8f6370a480 Swapped the sortCreateDateAscending and sortCreateDateDescending translation values to match the intended behavior (#14315)
(cherry picked from commit 76cb85224e)
2023-07-04 09:53:46 +02:00
RussellandSebastiaan Janssen aa4a1b3498 Fix for User null from IP address "::1" has logged out (#14322)
(cherry picked from commit dd59ef17f5)
2023-07-04 09:51:59 +02:00
RussellandSebastiaan Janssen b716e98780 Change "Media Picker" in RTE to "Image Picker" (#14321)
(cherry picked from commit 0220621337)

# Conflicts:
#	src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js
2023-07-04 09:49:34 +02:00
Elitsa MarinovskaandGitHub e86fb0eeb6 Adding null check and descriptive error (#14469) 2023-06-27 13:35:01 +02:00
Elitsa MarinovskaandGitHub fe1080dd64 Check the cases where there might be a custom image type, instead of an the default Umbraco image type (#14463) 2023-06-27 10:33:46 +02:00
Bjarke Berg 1133c4e7f2 Merge remote-tracking branch 'origin/release/10.6' into v10/dev 2023-06-27 09:06:17 +02:00
Jacob Overgaard f5b834974d package-lock.json sync 2023-06-26 14:28:59 +02:00
Nikolaj 75113a90fb Bump version 2023-06-22 09:18:57 +02:00
miguelcrpintoandZeegaan 7e573c70a3 Updated the IsoDateTimeConverter initialization in the JsonDateTimeFormatAttribute to set the Culture to InvariantCulture so that the custom DateTime format symbols ( date and time separators) are respected independent of the CurrentCulture being used. 2023-06-21 14:04:56 +02:00
dependabot[bot]andNikolaj 5c5de77965 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-21 09:45:50 +02:00
dependabot[bot]andNikolaj 2f486610bb 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-21 09:45:45 +02:00
Nikolaj d19a30768f Merge remote-tracking branch 'origin/v10/dev' into v10/dev 2023-06-21 09:20:26 +02:00
Nikolaj b451bb802b Revert "Case-insensitive tag names with SQLite provider (#14012)"
This reverts commit bb7752c483.
2023-06-21 08:45:54 +02:00
MoleandGitHub 785390efd7 Add Noop property indexer to multi url picker (#14416) 2023-06-20 12:14:35 +02:00
nikolajlauridsenandBjarke Berg 3b3e1cec40 Add Noop property indexer to multi url picker 2023-06-20 12:12:00 +02:00
Jacob OvergaardandGitHub 89d104e176 v10: Backoffice JS updates (#14406)
* update @umbraco-ui/uui to 1.3.0

* update ace editor to 1.22.1

* update diff to 5.1.0

* update autoprefixer to 10.4.14

* update underscore to 1.13.6

* update jQuery to 3.7.0

* fix pr-first-response workflow
2023-06-20 09:24:07 +02:00
Bjarne FyrstenborgandNikolaj 9a3e655645 Fix transparent background after upgrade of spectrum color picker (#14251) 2023-06-19 08:50:57 +02:00
Andy ButlandandGitHub 5f15b8abb1 Updated Forms and Deploy references in JSON schema project for Umbraco 10. (#14383) 2023-06-16 10:01:09 +02:00
Andreas ZerbstandGitHub 4df3e19af7 Added a mapper for the IPropertyType (#14373) 2023-06-12 11:18:57 +02:00
89d670372d Update security stamps on logout (#14362)
Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-06-12 09:56:04 +02:00
Mole b5ab115318 Remove external login tokens before removing external logins (#14341) 2023-06-06 14:11:20 +02:00
407263d090 V10: Handle blob images (#14317)
* Handle blob images

* remove dots from mapping

* Revert bad formatting

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-05-31 08:43:14 +02:00
b37bb517ab V10: Implement varying blocklist indexing (#14287)
* Implement available culture in Interface and base classes

* Add available cultures

* DI localizationService and use it

* Make the new method have default implementation to avoid breaking change

* Create implementations for old method

* Pass available cultures

* Pass localization service

* Create new method that takes available cultures

* Add ILocalizationService to DI

* implement missing method

* Add database for schema test

* Fixed issue with indexes not added correctly to nested types..

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2023-05-25 08:36:42 +02:00
MoleandGitHub 999a83995e V10: Add external login provider count to detailed telemetry (#14282)
* Add backoffice external login provider count to telemetry

* Update translation

* Fix integration test
2023-05-24 11:48:56 +02:00
Kenn Jacobsenandnikolajlauridsen b3a93ac86c Ensure that blocks always open automatically when added to block list or block grid (#14294) 2023-05-24 10:23:40 +02:00
Andy ButlandandGitHub e79246368b Update JSON schema package references for Forms and Deploy. (#14285) 2023-05-23 09:38:01 +02:00
Sebastiaan Janssen b67c7fbe77 Cherry pick b8d6613bd8 accidentally kept both lines instead of just the one, this fixes the problem. 2023-05-22 15:15:19 +02:00
Dhanesh Kumar MjandSebastiaan Janssen 16f448a802 [Fix] Block editor labels showing Angular JS on first load. (#14143)
Co-authored-by: Dhanesh Kumar <“dhanesh.kumar@phases.io”>
(cherry picked from commit 58695b6e9f)
2023-05-19 11:25:15 +02:00
b3bedb4efe XPath can unambiguously use $site/$parent (#14127)
* XPath can unambiguously use $site/$parent

* add deprecation notices and obsolete methods

* Update deprecation description text/instruction

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

* Small spelling fix on deprecation description

* keep depr. getByQuery and handle legacy usage

---------

Co-authored-by: Kalle Macklin <karlmacklin@users.noreply.github.co>
Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>
2023-05-15 08:48:36 +02:00
Andreas ZerbstandGitHub 5b73fc19ee V10: Fix NoopPublishedValuefallback varation context member not implemented (#14227)
* Added missing VariationContextAccessor

* Fixed identation
2023-05-10 14:31:40 +02:00
4cdab08910 Fixes #14102 - NestedPropertyIndexValueFactoryBase ignores compositions (#14115) (#14219)
Co-authored-by: Nuklon <Nuklon@users.noreply.github.com>
2023-05-09 09:49:04 +02:00
MoleandGitHub 391cade75f Merge pull request #14205 from umbraco/v10/bugfix/fix_acceptance_test
Fix acceptance test
2023-05-04 10:24:24 +02:00
Anders BrohusandSebastiaan Janssen e27e8d1189 Fixing danish typos (#14184)
* Fixed typo

* Fixed another typo

* Removed space from translation

(cherry picked from commit 7df5c9c212)
2023-05-04 10:13:51 +02:00
MichałandSebastiaan Janssen 1e0ace7a34 Save and preview translation.
(cherry picked from commit 0765a2ebbb)
2023-05-04 10:10:56 +02:00
Nikolaj 21c6828b59 Use regex for class 2023-05-04 09:32:32 +02:00
Nikolaj f7f361239c Try quick fix for test 2023-05-04 09:32:27 +02:00
Nikolaj 05908e2c78 Remove test.only 2023-05-04 09:32:18 +02:00
Jacob Overgaard 3a7ba530a2 Fix: Form elements in thirdparty dashboard views get removed (#14152) 2023-05-03 11:07:33 +02:00
Jacob Overgaard f4073c1dc7 update @umbraco-ui/uui to 1.2.1 2023-05-03 11:07:10 +02:00
Niels LyngsøandJacob Overgaard 7b5233803e fix situation when config was not available. (#14148) 2023-05-03 08:42:19 +02:00
Jacob OvergaardandGitHub 822febb8e8 update @umbraco-ui/uui to 1.2.1 (#14186) 2023-05-03 08:07:04 +02:00
MoleandGitHub bf7b9a20a8 Set culture variation when getting property types for indexing (#14167) 2023-04-26 14:51:55 +02:00
Elitsa MarinovskaandGitHub 9aadb41f4a Change state to publishing before handling ContentSavingNotification (#14114) 2023-04-25 15:08:15 +02:00
1129 changed files with 32036 additions and 22510 deletions
+4
View File
@@ -22,3 +22,7 @@ RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/
# https://docs.npmjs.com/cli/v6/using-npm/config#unsafe-perm
# Default: false if running as root, true otherwise (we are ROOT)
#RUN npm -g config set user vscode && npm -g config set unsafe-perm
# Generate and trust a local developer certificate for Kestrel
# This is needed for Kestrel to bind on https
RUN dotnet dev-certs https --trust
+2 -52
View File
@@ -6,7 +6,6 @@
"service": "app",
"workspaceFolder": "/workspace",
// Set *default* container specific settings.json values on container create.
"settings": {
"omnisharp.defaultLaunchSolution": "umbraco.sln",
@@ -14,62 +13,13 @@
"omnisharp.enableRoslynAnalyzers": true
},
"features": {
// Workaround until the image is updated to include the latest version of .NET Core - .NET7
// https://github.com/devcontainers/templates/issues/38#issuecomment-1310803259
"ghcr.io/devcontainers/features/dotnet:1": {
"version": "7"
},
// Adds SSH support to the container
// Allowing the Github CLI `gh codespace ssh` to work
"ghcr.io/devcontainers/features/sshd:1": {
"version": "latest"
},
// Adds SQLite feature from apt install
// Also adds the SQLite VSCode extension
"ghcr.io/warrenbuckley/codespace-features/sqlite:1": {}
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-dotnettools.csharp"
],
// This is used in the prebuilds - so dotnet build (nuget restore and node stuff) is done
"updateContentCommand": "dotnet build umbraco.sln && dotnet dev-certs https --trust",
// Use 'forwardPorts' to make a list of ports inside the container available locallAdd "forwardPorts": [9000, 5000, 25],
// Port needed to help discover SMTP4Dev
"forwardPorts": [
5000
],
"portsAttributes": {
"5000": {
"label": "SMTP4Dev",
"protocol": "http",
"onAutoForward": "notify"
},
"9000": {
"label": "Umbraco HTTP",
"protocol": "http",
"onAutoForward": "notify"
},
"44331": {
"label": "Umbraco HTTPS",
"protocol": "https",
"onAutoForward": "notify"
}
},
"customizations": {
"codespaces": {
"openFiles": [
".github/codespaces-readme.md"
]
}
}
// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [9000, 5000, 25]
// [Optional] To reuse of your local HTTPS dev cert:
//
-1
View File
@@ -248,7 +248,6 @@ csharp_preserve_single_line_blocks = true
##########################################
[*.{cs,csx,cake,vb,vbx}]
dotnet_diagnostic.CS1591.severity = suggestion
##########################################
# Styles
+149 -18
View File
@@ -1,4 +1,4 @@
# Umbraco CMS Build
# Umbraco CMS Build
## Are you sure?
@@ -27,7 +27,7 @@ If you want to run a build without debugging, see [Building from source](#buildi
In order to build the Umbraco source code locally with Visual Studio Code, first make sure you have the following installed.
* [Visual Studio Code](https://code.visualstudio.com/)
* [dotnet SDK v7+](https://dotnet.microsoft.com/en-us/download)
* [dotnet SDK v6.0.2+](https://dotnet.microsoft.com/en-us/download)
* [Node.js v14+](https://nodejs.org/en/download/)
* npm v7+ (installed with Node.js)
* [Git command line](https://git-scm.com/download/)
@@ -72,7 +72,7 @@ When the page eventually loads in your web browser, you can follow the installer
In order to build the Umbraco source code locally with Visual Studio, first make sure you have the following installed.
* [Visual Studio 2022 v17+ with .NET 7+](https://visualstudio.microsoft.com/vs/) ([the community edition is free](https://www.visualstudio.com/thank-you-downloading-visual-studio/?sku=Community&rel=15) for you to use to contribute to Open Source projects)
* [Visual Studio 2019 v16.8+ with .NET 6.0.2+](https://visualstudio.microsoft.com/vs/) ([the community edition is free](https://www.visualstudio.com/thank-you-downloading-visual-studio/?sku=Community&rel=15) for you to use to contribute to Open Source projects)
* [Node.js v14+](https://nodejs.org/en/download/)
* npm v7+ (installed with Node.js)
* [Git command line](https://git-scm.com/download/)
@@ -99,33 +99,111 @@ When the page eventually loads in your web browser, you can follow the installer
Did you read ["Are you sure"](#are-you-sure)?
Do note that this is only required if you want to test out your custom changes in a separate site (not the one in the Umbraco.Web.UI), if you just want to test your changes you can run the included test site using: `dotnet run` from `src/Umbraco.Web.UI/`
### Quick!
You may want to build a set of NuGet packages with your changes, this can be done using the dotnet pack command.
To build Umbraco, fire up PowerShell and move to Umbraco's repository root (the directory that contains `src`, `build`, `LICENSE.md`...). There, trigger the build with the following command:
First enter the root of the project in a command line environment, and then use the following command to build the NuGet packages:
build/build.ps1
`dotnet pack -c Release -o Build.Out`
If you only see a build.bat-file, you're probably on the wrong branch. If you switch to the correct branch (v8/contrib) the file will appear and you can build it.
This will restore and build the project using the release configuration, and put all the outputted files in a folder called `Build.Out`
You might run into [Powershell quirks](#powershell-quirks).
You can then add these as a local NuGet feed using the following command:
If it runs without errors; Hooray! Now you can continue with [the next step](CONTRIBUTING.md#how-do-i-begin) and open the solution and build it.
`dotnet nuget add source <Path to Build.Out folder> -n MyLocalFeed`
This will add a local nuget feed with the name "MyLocalFeed" and you'll now be able to use your custom built NuGet packages.
### Build Infrastructure
The Umbraco Build infrastructure relies on a PowerShell object. The object can be retrieved with:
$ubuild = build/build.ps1 -get
The object exposes various properties and methods that can be used to fine-grain build Umbraco. Some, but not all, of them are detailed below.
#### Properties
The object exposes the following properties:
* `SolutionRoot`: the absolute path to the solution root
* `VisualStudio`: a Visual Studio object (see below)
* `NuGet`: the absolute path to the NuGet executable
* `Zip`: the absolute path to the 7Zip executable
* `VsWhere`: the absolute path to the VsWhere executable
* `NodePath`: the absolute path to the Node install
* `NpmPath`: the absolute path to the Npm install
The Visual Studio object is `null` when Visual Studio has not been detected (eg on VSTS). When not null, the object exposes the following properties:
* `Path`: Visual Studio installation path (eg some place under `Program Files`)
* `Major`: Visual Studio major version (eg `15` for VS 2017)
* `Minor`: Visual Studio minor version
* `MsBuild`: the absolute path to the MsBuild executable
#### GetUmbracoVersion
Gets an object representing the current Umbraco version. Example:
$v = $ubuild.GetUmbracoVersion()
Write-Host $v.Semver
The object exposes the following properties:
* `Semver`: the semver object representing the version
* `Release`: the main part of the version (eg `7.6.33`)
* `Comment`: the pre release part of the version (eg `alpha02`)
* `Build`: the build number part of the version (eg `1234`)
#### SetUmbracoVersion
Modifies Umbraco files with the new version.
>This entirely replaces the legacy `UmbracoVersion.txt` file. Do *not* edit version infos in files.
The version must be a valid semver version. It can include a *pre release* part (eg `alpha02`) and/or a *build number* (eg `1234`). Examples:
$ubuild.SetUmbracoVersion("7.6.33")
$ubuild.SetUmbracoVersion("7.6.33-alpha.2")
$ubuild.SetUmbracoVersion("7.6.33+1234")
$ubuild.SetUmbracoVersion("7.6.33-beta.5+5678")
#### Build
Builds Umbraco. Temporary files are generated in `build.tmp` while the actual artifacts (zip files, NuGet packages...) are produced in `build.out`. Example:
$ubuild.Build()
Some log files, such as MsBuild logs, are produced in `build.tmp` too. The `build` directory should remain clean during a build.
**Note: web.config**
Building Umbraco requires a clean `web.config` file in the `Umbraco.Web.UI` project. If a `web.config` file already exists, the `pre-build` task (see below) will save it as `web.config.temp-build` and replace it with a clean copy of `web.Template.config`. The original file is replaced once it is safe to do so, by the `pre-packages` task.
#### Build-UmbracoDocs
Builds umbraco documentation. Temporary files are generated in `build.tmp` while the actual artifacts (docs...) are produced in `build.out`. Example:
Build-UmbracoDocs
Some log files, such as MsBuild logs, are produced in `build.tmp` too. The `build` directory should remain clean during a build.
#### Verify-NuGet
Verifies that projects all require the same version of their dependencies, and that NuSpec files require versions that are consistent with projects. Example:
Verify-NuGet
### Cleaning up
Once the solution has been used to run a site, one may want to "reset" the solution in order to run a fresh new site again.
The easiest way to do this by deleting the following files and folders:
* src/Umbraco.Web.UI/appsettings.json
* src/Umbraco.Web.UI/umbraco/Data
At the very minimum, you want
You only have to remove the connection strings from the appsettings, but removing the data folder ensures that the sqlite database gets deleted too.
git clean -Xdf src/Umbraco.Web.UI/App_Data
rm src/Umbraco.Web.UI/web.config
Next time you run a build the `appsettings.json` file will be re-created in its default state.
Then, a simple 'Rebuild All' in Visual Studio will recreate a fresh `web.config` but should be quite fast (since it does not really need to rebuild anything).
The `clean` Git command force (`-f`) removes (`-X`, note the capital X) all files and directories (`-d`) that are ignored by Git.
This will leave media files and views around, but in most cases, it will be enough.
@@ -141,12 +219,65 @@ For git documentation see:
## Azure DevOps
Umbraco uses Azure DevOps for continuous integration, nightly builds and release builds. The Umbraco CMS project on DevOps [is available for anonymous users](https://umbraco.visualstudio.com/Umbraco%20Cms)..
Umbraco uses Azure DevOps for continuous integration, nightly builds and release builds. The Umbraco CMS project on DevOps [is available for anonymous users](https://umbraco.visualstudio.com/Umbraco%20Cms).
The produced artifacts are published in a container that can be downloaded from DevOps called "nupkg" which contains all the NuGet packages that got built.
DevOps uses the `Build-Umbraco` command several times, each time passing a different *target* parameter. The supported targets are:
* `pre-build`: prepares the build
* `compile-belle`: compiles Belle
* `compile-umbraco`: compiles Umbraco
* `pre-tests`: prepares the tests
* `compile-tests`: compiles the tests
* `pre-packages`: prepares the packages
* `pkg-zip`: creates the zip files
* `pre-nuget`: prepares NuGet packages
* `pkg-nuget`: creates NuGet packages
All these targets are executed when `Build-Umbraco` is invoked without a parameter (or with the `all` parameter). On VSTS, compilations (of Umbraco and tests) are performed by dedicated DevOps tasks. Similarly, creating the NuGet packages is also performed by dedicated DevOps tasks.
Finally, the produced artifacts are published in two containers that can be downloaded from DevOps: `zips` contains the zip files while `nuget` contains the NuGet packages.
>During a DevOps build, some environment `UMBRACO_*` variables are exported by the `pre-build` target and can be reused in other targets *and* in DevOps tasks. The `UMBRACO_TMP` environment variable is used in `Umbraco.Tests` to disable some tests that have issues with DevOps at the moment.
## Quirks
### PowerShell Quirks
There is a good chance that running `build.ps1` ends up in error, with messages such as
>The file ...\build.ps1 is not digitally signed. You cannot run this script on the current system. For more information about running scripts and setting execution policy, see about_Execution_Policies.
PowerShell has *Execution Policies* that may prevent the script from running. You can check the current policies with:
PS> Get-ExecutionPolicy -List
Scope ExecutionPolicy
----- ---------------
MachinePolicy Undefined
UserPolicy Undefined
Process Undefined
CurrentUser Undefined
LocalMachine RemoteSigned
Policies can be `Restricted`, `AllSigned`, `RemoteSigned`, `Unrestricted` and `Bypass`. Scopes can be `MachinePolicy`, `UserPolicy`, `Process`, `CurrentUser`, `LocalMachine`. You need the current policy to be `RemoteSigned`&mdash;as long as it is `Undefined`, the script cannot run. You can change the current user policy with:
PS> Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned
Alternatively, you can do it at machine level, from within an elevated PowerShell session:
PS> Set-ExecutionPolicy -Scope LocalMachine -ExecutionPolicy RemoteSigned
And *then* the script should run. It *might* however still complain about executing scripts, with messages such as:
>Security warning - Run only scripts that you trust. While scripts from the internet can be useful, this script can potentially harm your computer. If you trust this script, use the Unblock-File cmdlet to allow the script to run without this warning message. Do you want to run ...\build.ps1?
[D] Do not run [R] Run once [S] Suspend [?] Help (default is "D"):
This is usually caused by the scripts being *blocked*. And that usually happens when the source code has been downloaded as a Zip file. When Windows downloads Zip files, they are marked as *blocked* (technically, they have a Zone.Identifier alternate data stream, with a value of "3" to indicate that they were downloaded from the Internet). And when such a Zip file is un-zipped, each and every single file is also marked as blocked.
The best solution is to unblock the Zip file before un-zipping: right-click the files, open *Properties*, and there should be a *Unblock* checkbox at the bottom of the dialog. If, however, the Zip file has already been un-zipped, it is possible to recursively unblock all files from PowerShell with:
PS> Get-ChildItem -Recurse *.* | Unblock-File
### Git Quirks
Git might have issues dealing with long file paths during build. You may want/need to enable `core.longpaths` support (see [this page](https://github.com/msysgit/msysgit/wiki/Git-cannot-create-a-file-or-directory-with-a-long-path) for details).
+15 -19
View File
@@ -103,7 +103,7 @@ Great question! The short version goes like this:
1. **Switch to the correct branch**
Switch to the `contrib` branch
Switch to the `v10/contrib` branch
1. **Build**
@@ -111,7 +111,7 @@ Great question! The short version goes like this:
1. **Branch**
Create a new branch now and name it after the issue you're fixing, we usually follow the format: `temp-12345`. This means it's a temporary branch for the particular issue you're working on, in this case issue number `12345`. Don't commit to `contrib`, create a new branch first.
Create a new branch now and name it after the issue you're fixing, we usually follow the format: `temp-12345`. This means it's a temporary branch for the particular issue you're working on, in this case issue number `12345`. Don't commit to `v10/contrib`, create a new branch first.
1. **Change**
@@ -121,7 +121,7 @@ Great question! The short version goes like this:
Done? Yay! 🎉
Remember to commit to your new `temp` branch, and don't commit to `contrib`. Then you can push the changes up to your fork on GitHub.
Remember to commit to your new `temp` branch, and don't commit to `v10/contrib`. Then you can push the changes up to your fork on GitHub.
#### Keeping your Umbraco fork in sync with the main repository
[sync fork]: #keeping-your-umbraco-fork-in-sync-with-the-main-repository
@@ -138,10 +138,10 @@ Then when you want to get the changes from the main repository:
```
git fetch upstream
git rebase upstream/contrib
git rebase upstream/v10/contrib
```
In this command we're syncing with the `contrib` branch, but you can of course choose another one if needed.
In this command we're syncing with the `v10/contrib` branch, but you can of course choose another one if needed.
[More information on how this works can be found on the thoughtbot blog.][sync fork ext]
@@ -169,7 +169,7 @@ We recommend you to [sync with our repository][sync fork] before you submit your
GitHub will have picked up on the new branch you've pushed and will offer to create a Pull Request. Click that green button and away you go.
![Create a pull request](img/createpullrequest.png)
We like to use [git flow][git flow] as much as possible, but don't worry if you are not familiar with it. The most important thing you need to know is that when you fork the Umbraco repository, the default branch is set to `contrib`. This is the branch you should be targeting.
We like to use [git flow][git flow] as much as possible, but don't worry if you are not familiar with it. The most important thing you need to know is that when you fork the Umbraco repository, the default branch is set to something, usually `v10/contrib`. If you are working on v9, this is the branch you should be targeting.
Please note: we are no longer accepting features for v8 and below but will continue to merge security fixes as and when they arise.
@@ -208,13 +208,11 @@ There will be times that we really like your proposed changes and well finish
The Core Contributors team consists of one member of Umbraco HQ, [Sebastiaan][Sebastiaan], who gets assistance from the following community members who have committed to volunteering their free time:
- [Busra Sengul][Busra Sengul]
- [Emma Garland][Emma Garland]
- [George Bidder][George Bidder]
- [Jason Elkin][Jason Elkin]
- [Laura Neto][Laura Neto]
- [Nathan Woulfe][Nathan Woulfe]
- [Joe Glombek][Joe Glombek]
- [Laura Weatherhead][Laura Weatherhead]
- [Michael Latouche][Michael Latouche]
- [Sebastiaan][Sebastiaan]
- [Owain Williams][Owain Williams]
These wonderful people aim to provide you with a reply to your PR, review and test out your changes and on occasions, they might ask more questions. If they are happy with your work, they'll let Umbraco HQ know by approving the PR. HQ will have final sign-off and will check the work again before it is merged.
@@ -229,14 +227,12 @@ These wonderful people aim to provide you with a reply to your PR, review and te
<!-- External -->
[Busra Sengul]: https://github.com/busrasengul "Busra's GitHub profile"
[Emma Garland]: https://github.com/emmagarland "Emma's GitHub profile"
[George Bidder]: https://github.com/georgebid "George's GitHub profile"
[Jason Elkin]: https://github.com/jasonelkin "Jason's GitHub profile"
[Kyle Eck]: https://github.com/teckspeed "Kyle's GitHub profile"
[Laura Neto]: https://github.com/lauraneto "Laura's GitHub profile"
[Nathan Woulfe]: https://github.com/nathanwoulfe "Nathan's GitHub profile"
[Joe Glombek]: https://github.com/glombek "Joe's GitHub profile"
[Laura Weatherhead]: https://github.com/lssweatherhead "Laura's GitHub profile"
[Michael Latouche]: https://github.com/mikecp "Michael's GitHub profile"
[Sebastiaan]: https://github.com/nul800sebastiaan "Sebastiaan's GitHub profile"
[Owain Williams]: https://github.com/OwainWilliams "Owain's GitHub profile"
[Sebastiaan]: https://github.com/nul800sebastiaan "Senastiaan's GitHub profile"
[ Umbrabot ]: https://github.com/umbrabot
[git flow]: https://jeffkreeftmeijer.com/git-flow/ "An explanation of git flow"
[sync fork ext]: http://robots.thoughtbot.com/post/5133345960/keeping-a-git-fork-updated "Details on keeping a git fork updated"
+2 -3
View File
@@ -1,4 +1,4 @@
# [Umbraco CMS](https://umbraco.com) &middot; [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](../LICENSE.md) [![Build status](https://umbraco.visualstudio.com/Umbraco%20Cms/_apis/build/status/Cms%208%20Continuous?branchName=v8/contrib)](https://umbraco.visualstudio.com/Umbraco%20Cms/_build?definitionId=75) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md) [![Twitter](https://img.shields.io/twitter/follow/umbraco.svg?style=social&label=Follow)](https://twitter.com/intent/follow?screen_name=umbraco) [![Discord](https://img.shields.io/discord/869656431308189746)](https://discord.gg/umbraco) [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/codespaces/new?hide_repo_select=true&ref=v11%2Fcontrib&repo=10601208&machine=basicLinux32gb&devcontainer_path=.devcontainer%2Fdevcontainer.json&location=WestEurope)
# [Umbraco CMS](https://umbraco.com) &middot; [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](../LICENSE.md) [![Build status](https://umbraco.visualstudio.com/Umbraco%20Cms/_apis/build/status/Cms%208%20Continuous?branchName=v8/contrib)](https://umbraco.visualstudio.com/Umbraco%20Cms/_build?definitionId=75) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md) [![Twitter](https://img.shields.io/twitter/follow/umbraco.svg?style=social&label=Follow)](https://twitter.com/intent/follow?screen_name=umbraco) [![Discord](https://img.shields.io/discord/869656431308189746)](https://discord.gg/umbraco)
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.
@@ -31,8 +31,7 @@ The documentation for Umbraco CMS can be found [on Our Umbraco](https://docs.umb
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.
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)
Besides "Our", we all support each other also via Twitter: [Umbraco HQ](https://twitter.com/umbraco), [Release Updates](https://twitter.com/umbracoproject), [#umbraco](https://twitter.com/hashtag/umbraco)
## Contributing
-21
View File
@@ -1,21 +0,0 @@
# GitHub CodeSpaces
Umbraco source code can be edited inside the browser with VSCode and CodeSpaces.
This development environment comes with all the tools you need to build Umbraco source code.
## Debugging and Running
From VSCode browse to the Run and Debug section and then click the green button. This will build the Umbraco source code and attach a debugger and launch the site.
## Default Umbraco credentials
Username: test@umbraco.com
Password: password1234
## Test Email Server
A SMTP4Dev instance for testing email is available on port 5000.
## SQLite Database
The SQLite extension is preinstalled and allows you to open, query, edit the data inside the Umbraco SQLite database for ease of use.
+2 -2
View File
@@ -15,8 +15,8 @@ permissions:
contents: read
env:
dotnetVersion: 7.x
dotnetIncludePreviewVersions: true
dotnetVersion: 6.x
dotnetIncludePreviewVersions: false
solution: umbraco.sln
buildConfiguration: SkipTests
DOTNET_NOLOGO: true
@@ -18,6 +18,8 @@ jobs:
uses: actions/github-script@v6
with:
script: |
const fetch = require('node-fetch')
const response = await fetch('https://collaboratorsv2.euwest01.umbraco.io/umbraco/api/comments/PostComment', {
method: 'post',
body: JSON.stringify({
+2 -5
View File
@@ -11,9 +11,6 @@ jobs:
issues: write
pull-requests: write
steps:
- name: Install dependencies
run: |
npm install node-fetch@2
- name: Fetch random comment 🗣️ and add it to the PR
uses: actions/github-script@v6
with:
@@ -44,13 +41,13 @@ jobs:
});
} else {
console.log("Returned data not indicate success.");
if(response.status !== 200) {
console.log("Status code:", response.status)
}
console.log("Returned data:", data);
if(data === '') {
console.log("An empty response usually indicates that either no comment was found or the actor user was not eligible for getting an automated response (HQ users are not getting auto-responses).")
}
@@ -20,6 +20,7 @@ jobs:
uses: actions/github-script@v6
with:
script: |
const fetch = require('node-fetch');
const response = await fetch('https://collaboratorsv2.euwest01.umbraco.io/umbraco/api/comments/PostComment', {
method: 'post',
body: JSON.stringify({
+2 -8
View File
@@ -101,12 +101,6 @@ preserve.belle
/tests/Umbraco.Tests.UnitTests/[Uu]mbraco/[Dd]ata/TEMP/
# Ignore auto-generated schema
/src/Umbraco.Cms.Targets/tasks/
/src/Umbraco.Cms.Targets/appsettings-schema.*.json
/src/Umbraco.Web.UI/appsettings-schema.json
/src/Umbraco.Web.UI/appsettings-schema.*.json
/tests/Umbraco.Tests.Integration/appsettings-schema.json
/tests/Umbraco.Tests.Integration/appsettings-schema.*.json
/src/Umbraco.Cms/appsettings-schema.json
playwright-report
trace.zip
/src/Umbraco.Web.UI/appsettings-schema.json
/tests/Umbraco.Tests.Integration/appsettings-schema.json
+1
View File
@@ -8,6 +8,7 @@
"name": ".NET Core Launch (web)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "Dotnet build",
"program": "dotnet",
"args": ["run"],
"cwd": "${workspaceFolder}/src/Umbraco.Web.UI",
+4 -5
View File
@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<LangVersion>latest</LangVersion>
<TargetFramework>net6.0</TargetFramework>
<Company>Umbraco HQ</Company>
<Authors>Umbraco</Authors>
<Copyright>Copyright © Umbraco $([System.DateTime]::Today.ToString('yyyy'))</Copyright>
@@ -29,9 +28,8 @@
<!-- Package Validation -->
<PropertyGroup>
<GenerateCompatibilitySuppressionFile>false</GenerateCompatibilitySuppressionFile>
<EnablePackageValidation>true</EnablePackageValidation>
<PackageValidationBaselineVersion>11.0.0</PackageValidationBaselineVersion>
<PackageValidationBaselineVersion>10.0.0</PackageValidationBaselineVersion>
<EnableStrictModeForCompatibleFrameworksInPackage>true</EnableStrictModeForCompatibleFrameworksInPackage>
<EnableStrictModeForCompatibleTfms>true</EnableStrictModeForCompatibleTfms>
</PropertyGroup>
@@ -41,7 +39,7 @@
<PackageReference Include="Nerdbank.GitVersioning" Version="3.5.113" PrivateAssets="all" IsImplicitlyDefined="true" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.406" PrivateAssets="all" IsImplicitlyDefined="true" />
<PackageReference Include="Umbraco.Code" Version="2.0.0" PrivateAssets="all" IsImplicitlyDefined="true" />
<PackageReference Include="Umbraco.GitVersioning.Extensions" Version="0.2.0" PrivateAssets="all" IsImplicitlyDefined="true" />
<PackageReference Include="Umbraco.GitVersioning.Extensions" Version="0.1.1" PrivateAssets="all" IsImplicitlyDefined="true" />
</ItemGroup>
<ItemGroup>
@@ -51,4 +49,5 @@
<PropertyGroup>
<GitVersionBaseDirectory>$(MSBuildThisFileDirectory)</GitVersionBaseDirectory>
</PropertyGroup>
</Project>
+102 -42
View File
@@ -21,11 +21,35 @@ parameters:
displayName: Upload API docs
type: boolean
default: false
- name: forceReleaseTestFilter
displayName: Force to use the release test filters
type: boolean
default: false
- name: integrationNonReleaseTestFilter
displayName: TestFilter used for non-release type builds
type: string
default: '--filter TestCategory!=LongRunning&TestCategory!=NonCritical'
- name: integrationReleaseTestFilter
displayName: TestFilter used for release type builds
type: string
default: ' '
- name: nonWindowsIntegrationNonReleaseTestFilter
displayName: TestFilter used for non-release type builds on non windows agents
type: string
default: '--filter TestCategory!=LongRunning&TestCategory!=NonCritical'
- name: nonWindowsIntegrationReleaseTestFilter
displayName: TestFilter used for release type builds on non windows agents
type: string
default: ' '
- name: isNightly
displayName: 'Is nightly build (used for MyGet feed)'
type: boolean
default: false
variables:
nodeVersion: 16.17.0
dotnetVersion: 7.x
dotnetIncludePreviewVersions: true
nodeVersion: 20
dotnetVersion: 6.x
dotnetIncludePreviewVersions: false
solution: umbraco.sln
buildConfiguration: Release
UMBRACO__CMS__GLOBAL__ID: 00000000-0000-0000-0000-000000000042
@@ -49,6 +73,7 @@ stages:
steps:
- task: NodeTool@0
displayName: Use Node.js $(nodeVersion)
retryCountOnTaskFailure: 3
inputs:
versionSpec: $(nodeVersion)
- task: Cache@2
@@ -61,9 +86,9 @@ stages:
path: $(npm_config_cache)
- script: npm ci --no-fund --no-audit --prefer-offline
workingDirectory: src/Umbraco.Web.UI.Client
displayName: Run npm ci
displayName: Run npm ci (Backoffice)
- task: gulp@0
displayName: Run gulp build
displayName: Run gulp build (Backoffice)
inputs:
gulpFile: src/Umbraco.Web.UI.Client/gulpfile.js
targets: coreBuild
@@ -72,6 +97,7 @@ stages:
displayName: Use .NET $(dotnetVersion)
inputs:
version: $(dotnetVersion)
performMultiLevelLookup: true
includePreviewVersions: $(dotnetIncludePreviewVersions)
- task: DotNetCoreCLI@2
displayName: Run dotnet restore
@@ -79,29 +105,12 @@ stages:
command: restore
projects: $(solution)
- task: DotNetCoreCLI@2
displayName: Run dotnet build
name: build
displayName: Run dotnet build and generate NuGet packages
inputs:
command: build
projects: $(solution)
arguments: '--configuration $(buildConfiguration) --no-restore -p:ContinuousIntegrationBuild=true'
- script: |
version="$(Build.BuildNumber)"
echo "Version: $version"
major="$(echo $version | cut -d '.' -f 1)"
echo "Major version: $major"
echo "##vso[task.setvariable variable=majorVersion;isOutput=true]$major"
displayName: Set major version
name: determineMajorVersion
- script: dotnet pack $(solution) --configuration $(buildConfiguration) --no-build --property:PackageOutputPath=$(Build.ArtifactStagingDirectory)/nupkg
displayName: Run dotnet pack
- script: |
sha="$(Build.SourceVersion)"
sha=${sha:0:7}
buildnumber="$(Build.BuildNumber)_$(Build.BuildId)_$sha"
echo "##vso[build.updatebuildnumber]$buildnumber"
displayName: Update build number
arguments: '--configuration $(buildConfiguration) --no-restore --property:ContinuousIntegrationBuild=true --property:GeneratePackageOnBuild=true --property:PackageOutputPath=$(Build.ArtifactStagingDirectory)/nupkg'
- task: PublishPipelineArtifact@1
displayName: Publish nupkg
inputs:
@@ -114,11 +123,11 @@ stages:
artifactName: build_output
- stage: Build_Docs
condition: and(succeeded(), or(startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'), ${{parameters.buildApiDocs}}))
condition: and(succeeded(), or(eq(dependencies.Build.outputs['A.build.NBGV_PublicRelease'], 'True'), ${{parameters.buildApiDocs}}))
displayName: Prepare API Documentation
dependsOn: Build
variables:
umbracoMajorVersion: $[ stageDependencies.Build.A.outputs['determineMajorVersion.majorVersion'] ]
umbracoMajorVersion: $[ stageDependencies.Build.A.outputs['build.NBGV_VersionMajor'] ]
jobs:
# C# API Reference
- job:
@@ -172,9 +181,10 @@ stages:
vmImage: 'ubuntu-latest'
steps:
- task: NodeTool@0
displayName: Use Node.js 10.15.0
displayName: Use Node.js 10.15.x
retryCountOnTaskFailure: 3
inputs:
versionSpec: 10.15.0 # Won't work with higher versions
versionSpec: 10.15.x # Won't work with higher versions
- script: |
npm ci --no-fund --no-audit --prefer-offline
npx gulp docs
@@ -230,6 +240,7 @@ stages:
displayName: Use .NET $(dotnetVersion)
inputs:
version: $(dotnetVersion)
performMultiLevelLookup: true
includePreviewVersions: $(dotnetIncludePreviewVersions)
- task: DotNetCoreCLI@2
displayName: Run dotnet test
@@ -242,6 +253,8 @@ stages:
- stage: Integration
displayName: Integration Tests
dependsOn: Build
variables:
releaseTestFilter: eq(dependencies.Build.outputs['A.build.NBGV_PublicRelease'], 'True')
jobs:
# Integration Tests (SQLite)
- job:
@@ -266,14 +279,33 @@ stages:
displayName: Use .NET $(dotnetVersion)
inputs:
version: $(dotnetVersion)
performMultiLevelLookup: true
includePreviewVersions: $(dotnetIncludePreviewVersions)
- task: DotNetCoreCLI@2
displayName: Run dotnet test
displayName: Run dotnet test Windows
condition: eq(variables['Agent.OS'],'Windows_NT')
inputs:
command: test
projects: '**/*.Tests.Integration.csproj'
arguments: '--configuration $(buildConfiguration) --no-build'
testRunTitle: Integration Tests SQLite - $(Agent.OS)
${{ if or(variables.releaseTestFilter, parameters.forceReleaseTestFilter) }}:
arguments: '--configuration $(buildConfiguration) --no-build ${{parameters.integrationReleaseTestFilter}}'
${{ else }}:
arguments: '--configuration $(buildConfiguration) ${{parameters.integrationNonReleaseTestFilter}}'
env:
Tests__Database__DatabaseType: 'Sqlite'
Umbraco__CMS__Global__MainDomLock: 'FileSystemMainDomLock'
- task: DotNetCoreCLI@2
displayName: Run dotnet test Non Windows
condition: ne(variables['Agent.OS'],'Windows_NT')
inputs:
command: test
projects: '**/*.Tests.Integration.csproj'
testRunTitle: Integration Tests SQLite - $(Agent.OS)
${{ if or(variables.releaseTestFilter, parameters.forceReleaseTestFilter) }}:
arguments: '--configuration $(buildConfiguration) --no-build ${{parameters.nonWindowsIntegrationReleaseTestFilter}}'
${{ else }}:
arguments: '--configuration $(buildConfiguration) ${{parameters.nonWindowsIntegrationNonReleaseTestFilter}}'
env:
Tests__Database__DatabaseType: 'Sqlite'
Umbraco__CMS__Global__MainDomLock: 'FileSystemMainDomLock'
@@ -281,7 +313,7 @@ stages:
# Integration Tests (SQL Server)
- job:
timeoutInMinutes: 120
condition: or(startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'), ${{parameters.sqlServerIntegrationTests}})
condition: or(eq(stageDependencies.Build.A.outputs['build.NBGV_PublicRelease'], 'True'), ${{parameters.sqlServerIntegrationTests}})
displayName: Integration Tests (SQL Server)
strategy:
matrix:
@@ -292,7 +324,7 @@ stages:
Linux:
vmImage: 'ubuntu-latest'
testDb: SqlServer
connectionString: 'Server=localhost,1433;User Id=sa;Password=$(SA_PASSWORD);'
connectionString: 'Server=localhost,1433;User Id=sa;Password=$(SA_PASSWORD);TrustServerCertificate=true'
pool:
vmImage: $(vmImage)
variables:
@@ -315,12 +347,31 @@ stages:
displayName: Start SQL Server (Linux only)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
- task: DotNetCoreCLI@2
displayName: Run dotnet test
displayName: Run dotnet test Windows
condition: eq(variables['Agent.OS'],'Windows_NT')
inputs:
command: test
projects: '**/*.Tests.Integration.csproj'
arguments: '--configuration $(buildConfiguration) --no-build'
testRunTitle: Integration Tests SQL Server - $(Agent.OS)
${{ if or(variables.releaseTestFilter, parameters.forceReleaseTestFilter) }}:
arguments: '--configuration $(buildConfiguration) --no-build ${{parameters.integrationReleaseTestFilter}}'
${{ else }}:
arguments: '--configuration $(buildConfiguration) --no-build ${{parameters.integrationNonReleaseTestFilter}}'
env:
Tests__Database__DatabaseType: $(testDb)
Tests__Database__SQLServerMasterConnectionString: $(connectionString)
Umbraco__CMS__Global__MainDomLock: 'SqlMainDomLock'
- task: DotNetCoreCLI@2
displayName: Run dotnet test NonWindows
condition: ne(variables['Agent.OS'],'Windows_NT')
inputs:
command: test
projects: '**/*.Tests.Integration.csproj'
testRunTitle: Integration Tests SQL Server - $(Agent.OS)
${{ if or(variables.releaseTestFilter, parameters.forceReleaseTestFilter) }}:
arguments: '--configuration $(buildConfiguration) --no-build ${{parameters.nonWindowsIntegrationReleaseTestFilter}}'
${{ else }}:
arguments: '--configuration $(buildConfiguration) --no-build ${{parameters.nonWindowsIntegrationNonReleaseTestFilter}}'
env:
Tests__Database__DatabaseType: $(testDb)
Tests__Database__SQLServerMasterConnectionString: $(connectionString)
@@ -356,7 +407,7 @@ stages:
Umbraco__CMS__Unattended__InstallUnattended: true
Umbraco__CMS__Global__InstallMissingDatabase: true
UmbracoDatabaseServer: (LocalDB)\MSSQLLocalDB
UmbracoDatabaseName: Playwright
UmbracoDatabaseName: AcceptanceTestDB
ConnectionStrings__umbracoDbDSN: Server=$(UmbracoDatabaseServer);Database=$(UmbracoDatabaseName);Integrated Security=true;
# Custom Umbraco settings
Umbraco__CMS__Global__VersionCheckPeriod: 0
@@ -373,6 +424,7 @@ stages:
path: $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/misc/nupkg
- task: NodeTool@0
displayName: Use Node.js $(nodeVersion)
retryCountOnTaskFailure: 3
inputs:
versionSpec: $(nodeVersion)
- task: Cache@2
@@ -402,6 +454,7 @@ stages:
displayName: Use .NET $(dotnetVersion)
inputs:
version: $(dotnetVersion)
performMultiLevelLookup: true
includePreviewVersions: $(dotnetIncludePreviewVersions)
- pwsh: |
$sha = 'g$(Build.SourceVersion)'.substring(0, 8)
@@ -416,7 +469,7 @@ stages:
workingDirectory: tests/Umbraco.Tests.AcceptanceTest/misc
- pwsh: |
dotnet new --install ./nupkg/Umbraco.Templates.*.nupkg
dotnet new umbraco --name Playwright --no-restore --output .
dotnet new umbraco --name AcceptanceTestProject --no-restore --output .
dotnet restore --configfile ./nuget.config
dotnet build --configuration $(buildConfiguration) --no-restore
dotnet dev-certs https
@@ -477,9 +530,11 @@ stages:
- Unit
- Integration
# - E2E # TODO: Enable when stable.
condition: and(succeeded(), or(startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'), ${{parameters.myGetDeploy}}))
condition: and(succeeded(), or(eq(dependencies.Build.outputs['A.build.NBGV_PublicRelease'], 'True'), ${{parameters.myGetDeploy}}))
jobs:
- job:
pool:
vmImage: "windows-latest" # NuGetCommand@2 is no longer supported on Ubuntu 24.04 so we'll use windows until an alternative is available.
displayName: Push to pre-release feed
steps:
- checkout: none
@@ -494,15 +549,20 @@ stages:
command: 'push'
packagesToPush: $(Build.ArtifactStagingDirectory)/**/*.nupkg
nuGetFeedType: 'external'
publishFeedCredentials: 'MyGet - Pre-releases'
${{ if eq(parameters.isNightly, true) }}:
publishFeedCredentials: 'MyGet - Umbraco Nightly'
${{ else }}:
publishFeedCredentials: 'MyGet - Pre-releases'
- stage: Deploy_NuGet
displayName: NuGet release
dependsOn:
- Deploy_MyGet
- Build_Docs
condition: and(succeeded(), or(startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'), ${{parameters.nuGetDeploy}}))
condition: and(succeeded(), or(eq(dependencies.Build.outputs['A.build.NBGV_PublicRelease'], 'True'), ${{parameters.nuGetDeploy}}))
jobs:
- job:
pool:
vmImage: "windows-latest" # NuGetCommand@2 is no longer supported on Ubuntu 24.04 so we'll use windows until an alternative is available.
displayName: Push to NuGet
steps:
- checkout: none
@@ -523,12 +583,12 @@ stages:
pool:
vmImage: 'windows-latest' # Apparently AzureFileCopy is windows only :(
variables:
umbracoMajorVersion: $[ stageDependencies.Build.A.outputs['determineMajorVersion.majorVersion'] ]
umbracoMajorVersion: $[ stageDependencies.Build.A.outputs['build.NBGV_VersionMajor'] ]
displayName: Upload API Documention
dependsOn:
- Build
- Deploy_NuGet
condition: and(succeeded(), or(startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'), ${{parameters.uploadApiDocs}}))
condition: and(succeeded(), or(eq(dependencies.Build.outputs['A.build.NBGV_PublicRelease'], 'True'), ${{parameters.uploadApiDocs}}))
jobs:
- job:
displayName: Upload C# Docs
+35
View File
@@ -0,0 +1,35 @@
name: Nightly_$(TeamProject)_$(Build.DefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r)
pr: none
trigger: none
schedules:
- cron: '0 0 * * *'
displayName: Daily midnight build
branches:
include:
- v10/dev
- v12/dev
- v13/dev
- v14/dev
steps:
- checkout: none
- task: TriggerBuild@4
inputs:
definitionIsInCurrentTeamProject: true
buildDefinition: '301'
queueBuildForUserThatTriggeredBuild: true
ignoreSslCertificateErrors: false
useSameSourceVersion: false
useCustomSourceVersion: false
useSameBranch: true
waitForQueuedBuildsToFinish: false
storeInEnvironmentVariable: false
templateParameters: 'sqlServerIntegrationTests: true, forceReleaseTestFilter: true, myGetDeploy: true, isNightly: true'
authenticationMethod: 'OAuth Token'
enableBuildInQueueCondition: false
dependentOnSuccessfulBuildCondition: false
dependentOnFailedBuildCondition: false
checkbuildsoncurrentbranch: false
failTaskIfConditionsAreNotFulfilled: false
+6
View File
@@ -0,0 +1,6 @@
{
"sdk": {
"version": "6.0.300",
"rollForward": "latestFeature"
}
}
+53
View File
@@ -0,0 +1,53 @@
name: issue-first-response
on:
issues:
types: [opened]
jobs:
send-response:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- name: Install dependencies
run: |
npm install node-fetch@2
- name: Fetch random comment 🗣️ and add it to the issue
uses: actions/github-script@v6
with:
script: |
const fetch = require('node-fetch')
const response = await fetch('https://collaboratorsv2.euwest01.umbraco.io/umbraco/api/comments/PostComment', {
method: 'post',
body: JSON.stringify({
repo: '${{ github.repository }}',
number: '${{ github.event.number }}',
actor: '${{ github.actor }}',
commentType: 'opened-issue-first-comment'
}),
headers: {
'Authorization': 'Bearer ${{ secrets.OUR_BOT_API_TOKEN }}',
'Content-Type': 'application/json'
}
});
try {
const data = await response.text();
if(response.status === 200 && data !== '') {
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: data
});
} else {
console.log("Status code did not indicate success:", response.status);
console.log("Returned data:", data);
}
} catch(error) {
console.log(error);
}
+67
View File
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<NoWarn>NU1507</NoWarn>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="Dazinator.Extensions.FileProviders" Version="2.0.0" />
<PackageVersion Include="Examine" Version="3.0.1" />
<PackageVersion Include="Examine.Core" Version="3.0.1" />
<PackageVersion Include="HtmlAgilityPack" Version="1.11.54" />
<PackageVersion Include="IPNetwork2" Version="2.6.618" />
<PackageVersion Include="K4os.Compression.LZ4" Version="1.3.6" />
<PackageVersion Include="MailKit" Version="3.2.0" />
<PackageVersion Include="Markdown" Version="2.2.1" />
<PackageVersion Include="MessagePack" Version="2.5.187" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.24" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="6.0.24" />
<PackageVersion Include="Microsoft.Data.Sqlite" Version="6.0.24" />
<PackageVersion Include="Microsoft.CSharp" Version="4.7.0" />
<PackageVersion Include="Microsoft.Extensions.FileProviders.Embedded" Version="6.0.24" />
<PackageVersion Include="Microsoft.Extensions.FileProviders.Physical" Version="6.0.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="6.0.0" />
<PackageVersion Include="Microsoft.Extensions.Identity.Core" Version="6.0.24" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="6.0.0" />
<PackageVersion Include="Microsoft.Extensions.Options" Version="6.0.0" />
<PackageVersion Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="6.0.0" />
<PackageVersion Include="Microsoft.Extensions.Options.DataAnnotations" Version="6.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="6.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="6.0.1" />
<PackageVersion Include="Microsoft.Extensions.Http" Version="6.0.0" />
<PackageVersion Include="Microsoft.Extensions.Identity.Stores" Version="6.0.24" />
<PackageVersion Include="MiniProfiler.AspNetCore.Mvc" Version="4.2.22" />
<PackageVersion Include="MiniProfiler.Shared" Version="4.2.22" />
<PackageVersion Include="ncrontab" Version="3.3.3" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
<PackageVersion Include="NPoco.SqlServer" Version="5.3.2" />
<PackageVersion Include="Serilog" Version="2.12.0" />
<PackageVersion Include="Serilog.AspNetCore" Version="5.0.0" />
<PackageVersion Include="Serilog.Enrichers.Process" Version="2.0.2" />
<PackageVersion Include="Serilog.Enrichers.Thread" Version="3.1.0" />
<PackageVersion Include="Serilog.Expressions" Version="3.4.1" />
<PackageVersion Include="Serilog.Extensions.Hosting" Version="4.2.0" />
<PackageVersion Include="Serilog.Formatting.Compact" Version="1.1.0" />
<PackageVersion Include="Serilog.Formatting.Compact.Reader" Version="1.0.5" />
<PackageVersion Include="Serilog.Settings.Configuration" Version="3.4.0" />
<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="2.1.10" />
<PackageVersion Include="SixLabors.ImageSharp.Web" Version="2.0.2" />
<PackageVersion Include="Smidge.InMemory" Version="4.3.0" />
<PackageVersion Include="Smidge.Nuglify" Version="4.2.1" />
<PackageVersion Include="System.IO.FileSystem.AccessControl" Version="5.0.0" />
<PackageVersion Include="System.Security.Cryptography.Pkcs" Version="6.0.4" />
<PackageVersion Include="System.Threading.Tasks.Dataflow" Version="6.0.0" />
<PackageVersion Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageVersion Include="System.Reflection.Emit.Lightweight" Version="4.7.0" />
<PackageVersion Include="System.Runtime.Caching" Version="6.0.0" />
<PackageVersion Include="Umbraco.CSharpTest.Net.Collections" Version="14.906.1403.1085" />
<!-- Add dependencies that we force an update to, even that we do not use them explicitly and they seems to be taken from the framework instead of from Nuget -->
<PackageVersion Include="System.Net.Http" Version="4.3.4" />
<PackageVersion Include="System.Security.Cryptography.Xml" Version="6.0.1" />
<PackageVersion Include="System.Text.RegularExpressions" Version="4.3.1" />
</ItemGroup>
</Project>
+152
View File
@@ -0,0 +1,152 @@
// Copyright (c) Umbraco.
// See LICENSE for more details.
using Umbraco.Cms.Core.Configuration;
using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Deploy.Core.Configuration.DebugConfiguration;
using Umbraco.Deploy.Core.Configuration.DeployConfiguration;
using Umbraco.Deploy.Core.Configuration.DeployProjectConfiguration;
using Umbraco.Forms.Core.Configuration;
using SecuritySettings = Umbraco.Cms.Core.Configuration.Models.SecuritySettings;
namespace JsonSchema
{
internal class AppSettings
{
/// <summary>
/// Gets or sets the Umbraco
/// </summary>
public UmbracoDefinition? Umbraco { get; set; }
/// <summary>
/// Configuration of Umbraco CMS and packages
/// </summary>
internal class UmbracoDefinition
{
// ReSharper disable once InconsistentNaming
public CmsDefinition? CMS { get; set; }
public FormsDefinition? Forms { get; set; }
public DeployDefinition? Deploy { get; set; }
/// <summary>
/// Configurations for the Umbraco CMS
/// </summary>
public class CmsDefinition
{
public ContentSettings? Content { get; set; }
public CoreDebugSettings? Debug { get; set; }
public ExceptionFilterSettings? ExceptionFilter { get; set; }
public ModelsBuilderSettings? ModelsBuilder { get; set; }
public GlobalSettings? Global { get; set; }
public HealthChecksSettings? HealthChecks { get; set; }
public HostingSettings? Hosting { get; set; }
public ImagingSettings? Imaging { get; set; }
public IndexCreatorSettings? Examine { get; set; }
public IndexingSettings? Indexing { get; set; }
public KeepAliveSettings? KeepAlive { get; set; }
public LoggingSettings? Logging { get; set; }
public NuCacheSettings? NuCache { get; set; }
public RequestHandlerSettings? RequestHandler { get; set; }
public RuntimeSettings? Runtime { get; set; }
public SecuritySettings? Security { get; set; }
public TourSettings? Tours { get; set; }
public TypeFinderSettings? TypeFinder { get; set; }
public WebRoutingSettings? WebRouting { get; set; }
public UmbracoPluginSettings? Plugins { get; set; }
public UnattendedSettings? Unattended { get; set; }
public RichTextEditorSettings? RichTextEditor { get; set; }
public RuntimeMinificationSettings? RuntimeMinification { get; set; }
public BasicAuthSettings? BasicAuth { get; set; }
public PackageMigrationSettings? PackageMigration { get; set; }
public LegacyPasswordMigrationSettings? LegacyPasswordMigration { get; set; }
public ContentDashboardSettings? ContentDashboard { get; set; }
public HelpPageSettings? HelpPage { get; set; }
public InstallDefaultData? InstallDefaultData { get; set; }
public DataTypesSettings? DataTypes { get; set; }
public MarketplaceSettings? Marketplace { get; set; }
}
/// <summary>
/// Configurations for the Umbraco CMS InstallDefaultData configuration.
/// </summary>
public class InstallDefaultData
{
public InstallDefaultDataSettings? Languages { get; set; }
public InstallDefaultDataSettings? DataTypes { get; set; }
public InstallDefaultDataSettings? MediaTypes { get; set; }
public InstallDefaultDataSettings? MemberTypes { get; set; }
}
/// <summary>
/// Configurations for the Umbraco Forms package to Umbraco CMS
/// </summary>
public class FormsDefinition
{
public FormDesignSettings? FormDesign { get; set; }
public PackageOptionSettings? Options { get; set; }
public Umbraco.Forms.Core.Configuration.SecuritySettings? Security { get; set; }
public FieldTypesDefinition? FieldTypes { get; set; }
/// <summary>
/// Configurations for the Umbraco Forms Field Types
/// </summary>
public class FieldTypesDefinition
{
public DatePickerSettings? DatePicker { get; set; }
public Recaptcha2Settings? Recaptcha2 { get; set; }
public Recaptcha3Settings? Recaptcha3 { get; set; }
}
}
/// <summary>
/// Configurations for the Umbraco Deploy package to Umbraco CMS
/// </summary>
public class DeployDefinition
{
public DeploySettings? Settings { get; set; }
public DeployProjectConfig? Project { get; set; }
public DebugSettings? Debug { get; set; }
}
}
}
}
+19
View File
@@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<IsPackable>false</IsPackable>
<EnablePackageValidation>false</EnablePackageValidation>
<ManagePackageVersionsCentrally>false</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.9.1" />
<PackageReference Include="NJsonSchema" Version="10.9.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Umbraco.Core\Umbraco.Core.csproj" />
<PackageReference Include="Umbraco.Deploy.Core" Version="10.4.0" />
<PackageReference Include="Umbraco.Forms.Core" Version="10.5.4" />
</ItemGroup>
</Project>
@@ -0,0 +1,13 @@
// Copyright (c) Umbraco.
// See LICENSE for more details.
using System;
using NJsonSchema.Generation;
namespace JsonSchema
{
internal class NamespacePrefixedSchemaNameGenerator : DefaultSchemaNameGenerator
{
public override string Generate(Type type) => type.Namespace?.Replace(".", string.Empty) + base.Generate(type);
}
}
+13
View File
@@ -0,0 +1,13 @@
// Copyright (c) Umbraco.
// See LICENSE for more details.
using CommandLine;
namespace JsonSchema
{
internal class Options
{
[Option('o', "outputFile", Required = false, HelpText = "Set path of the output file.", Default = "appsettings-schema.json")]
public string OutputFile { get; set; } = null!;
}
}
+41
View File
@@ -0,0 +1,41 @@
// Copyright (c) Umbraco.
// See LICENSE for more details.
using System;
using System.IO;
using System.Threading.Tasks;
using CommandLine;
namespace JsonSchema
{
internal class Program
{
public static async Task Main(string[] args)
{
try
{
await Parser.Default.ParseArguments<Options>(args)
.WithParsedAsync(Execute);
}
catch (Exception e)
{
Console.WriteLine(e);
throw;
}
}
private static async Task Execute(Options options)
{
var generator = new UmbracoJsonSchemaGenerator();
var schema = await generator.Generate();
var path = Path.GetFullPath(Path.Combine(Environment.CurrentDirectory, options.OutputFile));
Console.WriteLine("Path to use {0}", path);
Directory.CreateDirectory(Path.GetDirectoryName(path)!);
Console.WriteLine("Ensured directory exists");
await File.WriteAllTextAsync(path, schema);
Console.WriteLine("File written at {0}", path);
}
}
}
@@ -0,0 +1,58 @@
// Copyright (c) Umbraco.
// See LICENSE for more details.
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using NJsonSchema.Generation;
using Umbraco.Cms.Core.Configuration.Models;
namespace JsonSchema
{
/// <summary>
/// Generator of the JsonSchema for AppSettings.json including A specific Umbraco version.
/// </summary>
public class UmbracoJsonSchemaGenerator
{
private static readonly HttpClient s_client = new ();
private readonly JsonSchemaGenerator _innerGenerator;
/// <summary>
/// Initializes a new instance of the <see cref="UmbracoJsonSchemaGenerator" /> class.
/// </summary>
public UmbracoJsonSchemaGenerator()
=> _innerGenerator = new JsonSchemaGenerator(new UmbracoJsonSchemaGeneratorSettings());
/// <summary>
/// Generates a json representing the JsonSchema for AppSettings.json including A specific Umbraco version..
/// </summary>
public async Task<string> Generate()
{
JObject umbracoSchema = GenerateUmbracoSchema();
JObject officialSchema = await GetOfficialAppSettingsSchema();
officialSchema.Merge(umbracoSchema);
return officialSchema.ToString();
}
private async Task<JObject> GetOfficialAppSettingsSchema()
{
HttpResponseMessage response = await s_client.GetAsync("https://json.schemastore.org/appsettings.json")
.ConfigureAwait(false);
var result = await response.Content.ReadAsStringAsync();
return JsonConvert.DeserializeObject<JObject>(result)!;
}
private JObject GenerateUmbracoSchema()
{
NJsonSchema.JsonSchema schema = _innerGenerator.Generate(typeof(AppSettings));
// TODO: when the "UmbracoPath" setter is removed from "GlobalSettings" (scheduled for V12), remove this line as well
schema.Definitions["UmbracoCmsCoreConfigurationModelsGlobalSettings"]?.Properties?.Remove(nameof(GlobalSettings.UmbracoPath));
return JsonConvert.DeserializeObject<JObject>(schema.ToJson())!;
}
}
}
@@ -0,0 +1,43 @@
// Copyright (c) Umbraco.
// See LICENSE for more details.
using System;
using System.Collections.Generic;
using System.Linq;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Serialization;
using NJsonSchema.Generation;
namespace JsonSchema
{
/// <inheritdoc />
public class UmbracoJsonSchemaGeneratorSettings : JsonSchemaGeneratorSettings
{
/// <summary>
/// Initializes a new instance of the <see cref="UmbracoJsonSchemaGeneratorSettings"/> class.
/// </summary>
public UmbracoJsonSchemaGeneratorSettings()
{
AlwaysAllowAdditionalObjectProperties = true;
SerializerSettings = new JsonSerializerSettings()
{
ContractResolver = new WritablePropertiesOnlyResolver()
};
DefaultReferenceTypeNullHandling = ReferenceTypeNullHandling.NotNull;
SchemaNameGenerator = new NamespacePrefixedSchemaNameGenerator();
SerializerSettings.Converters.Add(new StringEnumConverter());
IgnoreObsoleteProperties = true;
GenerateExamples = true;
}
private class WritablePropertiesOnlyResolver : DefaultContractResolver
{
protected override IList<JsonProperty> CreateProperties(Type type, MemberSerialization memberSerialization)
{
IList<JsonProperty> props = base.CreateProperties(type, memberSerialization);
return props.Where(p => p.Writable).ToList();
}
}
}
}
@@ -1,16 +0,0 @@
using Umbraco.Cms.Core.Composing;
using Umbraco.Cms.Core.DependencyInjection;
using Umbraco.Extensions;
namespace Umbraco.Cms.Imaging.ImageSharp;
/// <summary>
/// Adds imaging support using ImageSharp/ImageSharp.Web.
/// </summary>
/// <seealso cref="Umbraco.Cms.Core.Composing.IComposer" />
public sealed class ImageSharpComposer : IComposer
{
/// <inheritdoc />
public void Compose(IUmbracoBuilder builder)
=> builder.AddUmbracoImageSharp();
}
@@ -1,23 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Title>Umbraco CMS - Imaging - ImageSharp</Title>
<Description>Adds imaging support using ImageSharp/ImageSharp.Web to Umbraco CMS.</Description>
<!-- TODO: Enable when final version is shipped (because there's currently no previous version) -->
<EnablePackageValidation>false</EnablePackageValidation>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="SixLabors.ImageSharp" Version="2.1.3" />
<PackageReference Include="SixLabors.ImageSharp.Web" Version="2.0.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Umbraco.Web.Common\Umbraco.Web.Common.csproj" />
</ItemGroup>
<ItemGroup>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
<_Parameter1>Umbraco.Tests.UnitTests</_Parameter1>
</AssemblyAttribute>
</ItemGroup>
</Project>
@@ -1,54 +0,0 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.Web.Caching;
using SixLabors.ImageSharp.Web.DependencyInjection;
using SixLabors.ImageSharp.Web.Middleware;
using SixLabors.ImageSharp.Web.Providers;
using Umbraco.Cms.Core.DependencyInjection;
using Umbraco.Cms.Core.Media;
using Umbraco.Cms.Imaging.ImageSharp.ImageProcessors;
using Umbraco.Cms.Imaging.ImageSharp.Media;
using Umbraco.Cms.Web.Common.ApplicationBuilder;
using Umbraco.Extensions;
namespace Umbraco.Cms.Imaging.ImageSharp;
public static class UmbracoBuilderExtensions
{
/// <summary>
/// Adds Image Sharp with Umbraco settings
/// </summary>
public static IServiceCollection AddUmbracoImageSharp(this IUmbracoBuilder builder)
{
// Add default ImageSharp configuration and service implementations
builder.Services.AddSingleton(Configuration.Default);
builder.Services.AddUnique<IImageDimensionExtractor, ImageSharpDimensionExtractor>();
builder.Services.AddSingleton<IImageUrlGenerator, ImageSharpImageUrlGenerator>();
builder.Services.AddImageSharp()
// Replace default image provider
.ClearProviders()
.AddProvider<WebRootImageProvider>()
// Add custom processors
.AddProcessor<CropWebProcessor>();
// Configure middleware
builder.Services.AddTransient<IConfigureOptions<ImageSharpMiddlewareOptions>, ConfigureImageSharpMiddlewareOptions>();
// Configure cache options
builder.Services.AddTransient<IConfigureOptions<PhysicalFileSystemCacheOptions>, ConfigurePhysicalFileSystemCacheOptions>();
// Important we handle image manipulations before the static files, otherwise the querystring is just ignored
builder.Services.Configure<UmbracoPipelineOptions>(options =>
{
options.AddFilter(new UmbracoPipelineFilter(nameof(ImageSharpComposer))
{
PrePipeline = prePipeline => prePipeline.UseImageSharp()
});
});
return builder.Services;
}
}
@@ -0,0 +1,22 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.ManagementApi.ViewModels.Pagination;
namespace Umbraco.Cms.ManagementApi.Controllers.Analytics;
public class AllAnalyticsController : AnalyticsControllerBase
{
[HttpGet("all")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(PagedViewModel<TelemetryLevel>), StatusCodes.Status200OK)]
public async Task<PagedViewModel<TelemetryLevel>> GetAll(int skip, int take)
{
TelemetryLevel[] levels = Enum.GetValues<TelemetryLevel>();
return await Task.FromResult(new PagedViewModel<TelemetryLevel>
{
Total = levels.Length,
Items = levels.Skip(skip).Take(take),
});
}
}
@@ -0,0 +1,13 @@
using Microsoft.AspNetCore.Mvc;
using NSwag.Annotations;
using Umbraco.New.Cms.Web.Common.Routing;
namespace Umbraco.Cms.ManagementApi.Controllers.Analytics;
[ApiController]
[BackOfficeRoute("api/v{version:apiVersion}/analytics")]
[OpenApiTag("Analytics")]
[ApiVersion("1.0")]
public abstract class AnalyticsControllerBase : ManagementApiControllerBase
{
}
@@ -0,0 +1,18 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.ManagementApi.ViewModels.Analytics;
namespace Umbraco.Cms.ManagementApi.Controllers.Analytics;
public class GetAnalyticsController : AnalyticsControllerBase
{
private readonly IMetricsConsentService _metricsConsentService;
public GetAnalyticsController(IMetricsConsentService metricsConsentService) => _metricsConsentService = metricsConsentService;
[HttpGet]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(AnalyticsLevelViewModel), StatusCodes.Status200OK)]
public async Task<AnalyticsLevelViewModel> Get() => await Task.FromResult(new AnalyticsLevelViewModel { AnalyticsLevel = _metricsConsentService.GetConsentLevel() });
}
@@ -1,35 +1,36 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.ManagementApi.ViewModels.Telemetry;
using Umbraco.Cms.ManagementApi.ViewModels.Analytics;
using Umbraco.Cms.ManagementApi.ViewModels.Server;
namespace Umbraco.Cms.ManagementApi.Controllers.Telemetry;
namespace Umbraco.Cms.ManagementApi.Controllers.Analytics;
public class SetTelemetryController : TelemetryControllerBase
public class SetAnalyticsController : AnalyticsControllerBase
{
private readonly IMetricsConsentService _metricsConsentService;
public SetTelemetryController(IMetricsConsentService metricsConsentService) => _metricsConsentService = metricsConsentService;
public SetAnalyticsController(IMetricsConsentService metricsConsentService) => _metricsConsentService = metricsConsentService;
[HttpPost("level")]
[HttpPost]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
[ProducesResponseType(StatusCodes.Status200OK)]
public async Task<IActionResult> SetConsentLevel(TelemetryViewModel telemetryViewModel)
public async Task<IActionResult> SetConsentLevel(AnalyticsLevelViewModel analyticsLevelViewModel)
{
if (!Enum.IsDefined(telemetryViewModel.TelemetryLevel))
if (!Enum.IsDefined(analyticsLevelViewModel.AnalyticsLevel))
{
var invalidModelProblem = new ProblemDetails
{
Title = "Invalid TelemetryLevel value",
Detail = "The provided value for TelemetryLevel is not valid",
Title = "Invalid AnalyticsLevel value",
Detail = "The provided value for AnalyticsLevel is not valid",
Status = StatusCodes.Status400BadRequest,
Type = "Error",
};
return BadRequest(invalidModelProblem);
}
_metricsConsentService.SetConsentLevel(telemetryViewModel.TelemetryLevel);
_metricsConsentService.SetConsentLevel(analyticsLevelViewModel.AnalyticsLevel);
return await Task.FromResult(Ok());
}
}
@@ -1,11 +1,12 @@
using Microsoft.AspNetCore.Mvc;
using NSwag.Annotations;
using Umbraco.New.Cms.Web.Common.Routing;
namespace Umbraco.Cms.ManagementApi.Controllers.Culture;
[ApiController]
[VersionedApiBackOfficeRoute("culture")]
[ApiExplorerSettings(GroupName = "Culture")]
[BackOfficeRoute("api/v{version:apiVersion}/culture")]
[OpenApiTag("Culture")]
[ApiVersion("1.0")]
public abstract class CultureControllerBase : ManagementApiControllerBase
{
@@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Mvc;
using NSwag.Annotations;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Models.Entities;
@@ -11,8 +12,8 @@ namespace Umbraco.Cms.ManagementApi.Controllers.DataType.Tree;
[ApiVersion("1.0")]
[ApiController]
[VersionedApiBackOfficeRoute($"{Constants.Web.RoutePath.Tree}/{Constants.UdiEntityType.DataType}")]
[ApiExplorerSettings(GroupName = "Data Type")]
[VersionedApiBackOfficeRoute($"{Constants.UdiEntityType.DataType}/tree")]
[OpenApiTag(nameof(Constants.UdiEntityType.DataType))]
public class DataTypeTreeControllerBase : FolderTreeControllerBase<FolderTreeItemViewModel>
{
private readonly IDataTypeService _dataTypeService;
@@ -12,7 +12,7 @@ public class ItemsDataTypeTreeController : DataTypeTreeControllerBase
{
}
[HttpGet("item")]
[HttpGet("items")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(IEnumerable<FolderTreeItemViewModel>), StatusCodes.Status200OK)]
public async Task<ActionResult<IEnumerable<FolderTreeItemViewModel>>> Items([FromQuery(Name = "key")] Guid[] keys)
@@ -1,11 +1,12 @@
using Microsoft.AspNetCore.Mvc;
using NSwag.Annotations;
using Umbraco.New.Cms.Web.Common.Routing;
namespace Umbraco.Cms.ManagementApi.Controllers.Dictionary;
[ApiController]
[VersionedApiBackOfficeRoute("dictionary")]
[ApiExplorerSettings(GroupName = "Dictionary")]
[BackOfficeRoute("api/v{version:apiVersion}/dictionary")]
[OpenApiTag("Dictionary")]
[ApiVersion("1.0")]
// TODO: Add authentication
public abstract class DictionaryControllerBase : ManagementApiControllerBase
@@ -23,13 +23,13 @@ public class ExportDictionaryController : DictionaryControllerBase
[HttpGet("export/{key:guid}")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(FileContentResult), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(NotFoundResult), StatusCodes.Status404NotFound)]
[ProducesResponseType(typeof(NotFoundObjectResult), StatusCodes.Status404NotFound)]
public async Task<IActionResult> ExportDictionary(Guid key, bool includeChildren = false)
{
IDictionaryItem? dictionaryItem = _localizationService.GetDictionaryItemById(key);
if (dictionaryItem is null)
{
return await Task.FromResult(NotFound());
return await Task.FromResult(NotFound("No dictionary item found with id "));
}
XElement xml = _entityXmlSerializer.Serialize(dictionaryItem, includeChildren);
@@ -4,7 +4,6 @@ using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Extensions;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.ManagementApi.Services;
@@ -14,15 +13,18 @@ namespace Umbraco.Cms.ManagementApi.Controllers.Dictionary;
public class ImportDictionaryController : DictionaryControllerBase
{
private readonly IHostingEnvironment _hostingEnvironment;
private readonly IDictionaryService _dictionaryService;
private readonly IWebHostEnvironment _webHostEnvironment;
private readonly ILoadDictionaryItemService _loadDictionaryItemService;
public ImportDictionaryController(
IHostingEnvironment hostingEnvironment,
IDictionaryService dictionaryService,
IWebHostEnvironment webHostEnvironment,
ILoadDictionaryItemService loadDictionaryItemService)
{
_hostingEnvironment = hostingEnvironment;
_dictionaryService = dictionaryService;
_webHostEnvironment = webHostEnvironment;
_loadDictionaryItemService = loadDictionaryItemService;
@@ -39,7 +41,7 @@ public class ImportDictionaryController : DictionaryControllerBase
return NotFound();
}
var filePath = Path.Combine(_webHostEnvironment.MapPathContentRoot(Constants.SystemDirectories.Data), file);
var filePath = Path.Combine(_hostingEnvironment.MapPathContentRoot(Constants.SystemDirectories.Data), file);
if (_webHostEnvironment.ContentRootFileProvider.GetFileInfo(filePath) is null)
{
return await Task.FromResult(NotFound());
@@ -6,11 +6,11 @@ using Umbraco.Cms.ManagementApi.Services.Paging;
using Umbraco.Cms.ManagementApi.ViewModels.Pagination;
using Umbraco.Cms.ManagementApi.ViewModels.Tree;
namespace Umbraco.Cms.ManagementApi.Controllers.Dictionary.Tree;
namespace Umbraco.Cms.ManagementApi.Controllers.DictionaryItem.Tree;
public class ChildrenDictionaryTreeController : DictionaryTreeControllerBase
public class ChildrenDictionaryItemTreeController : DictionaryItemTreeControllerBase
{
public ChildrenDictionaryTreeController(IEntityService entityService, ILocalizationService localizationService)
public ChildrenDictionaryItemTreeController(IEntityService entityService, ILocalizationService localizationService)
: base(entityService, localizationService)
{
}
@@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Mvc;
using NSwag.Annotations;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Services;
@@ -6,17 +7,17 @@ using Umbraco.Cms.ManagementApi.Controllers.Tree;
using Umbraco.Cms.ManagementApi.ViewModels.Tree;
using Umbraco.New.Cms.Web.Common.Routing;
namespace Umbraco.Cms.ManagementApi.Controllers.Dictionary.Tree;
namespace Umbraco.Cms.ManagementApi.Controllers.DictionaryItem.Tree;
[ApiVersion("1.0")]
[ApiController]
[VersionedApiBackOfficeRoute($"{Constants.Web.RoutePath.Tree}/dictionary")]
[ApiExplorerSettings(GroupName = "Dictionary")]
// NOTE: at the moment dictionary items (renamed to dictionary tree) aren't supported by EntityService, so we have little use of the
[VersionedApiBackOfficeRoute($"{Constants.UdiEntityType.DictionaryItem}/tree")]
[OpenApiTag(nameof(Constants.UdiEntityType.DictionaryItem))]
// NOTE: at the moment dictionary items 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 : EntityTreeControllerBase<EntityTreeItemViewModel>
public class DictionaryItemTreeControllerBase : EntityTreeControllerBase<EntityTreeItemViewModel>
{
public DictionaryTreeControllerBase(IEntityService entityService, ILocalizationService localizationService)
public DictionaryItemTreeControllerBase(IEntityService entityService, ILocalizationService localizationService)
: base(entityService) =>
LocalizationService = localizationService;
@@ -4,16 +4,16 @@ using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.ManagementApi.ViewModels.Tree;
namespace Umbraco.Cms.ManagementApi.Controllers.Dictionary.Tree;
namespace Umbraco.Cms.ManagementApi.Controllers.DictionaryItem.Tree;
public class ItemsDictionaryTreeController : DictionaryTreeControllerBase
public class ItemsDictionaryItemTreeController : DictionaryItemTreeControllerBase
{
public ItemsDictionaryTreeController(IEntityService entityService, ILocalizationService localizationService)
public ItemsDictionaryItemTreeController(IEntityService entityService, ILocalizationService localizationService)
: base(entityService, localizationService)
{
}
[HttpGet("item")]
[HttpGet("items")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(IEnumerable<FolderTreeItemViewModel>), StatusCodes.Status200OK)]
public async Task<ActionResult<IEnumerable<FolderTreeItemViewModel>>> Items([FromQuery(Name = "key")] Guid[] keys)
@@ -6,11 +6,11 @@ using Umbraco.Cms.ManagementApi.Services.Paging;
using Umbraco.Cms.ManagementApi.ViewModels.Pagination;
using Umbraco.Cms.ManagementApi.ViewModels.Tree;
namespace Umbraco.Cms.ManagementApi.Controllers.Dictionary.Tree;
namespace Umbraco.Cms.ManagementApi.Controllers.DictionaryItem.Tree;
public class RootDictionaryTreeController : DictionaryTreeControllerBase
public class RootDictionaryItemTreeController : DictionaryItemTreeControllerBase
{
public RootDictionaryTreeController(IEntityService entityService, ILocalizationService localizationService)
public RootDictionaryItemTreeController(IEntityService entityService, ILocalizationService localizationService)
: base(entityService, localizationService)
{
}
@@ -1,5 +1,6 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using NSwag.Annotations;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Models.Entities;
@@ -13,10 +14,10 @@ namespace Umbraco.Cms.ManagementApi.Controllers.Document.RecycleBin;
[ApiVersion("1.0")]
[ApiController]
[VersionedApiBackOfficeRoute($"{Constants.Web.RoutePath.RecycleBin}/{Constants.UdiEntityType.Document}")]
[VersionedApiBackOfficeRoute($"{Constants.UdiEntityType.Document}/recycle-bin")]
[RequireDocumentTreeRootAccess]
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
[ApiExplorerSettings(GroupName = nameof(Constants.UdiEntityType.Document))]
[OpenApiTag(nameof(Constants.UdiEntityType.Document))]
public class DocumentRecycleBinControllerBase : RecycleBinControllerBase<RecycleBinItemViewModel>
{
public DocumentRecycleBinControllerBase(IEntityService entityService)
@@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Mvc;
using NSwag.Annotations;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Cache;
using Umbraco.Cms.Core.Models;
@@ -15,8 +16,8 @@ namespace Umbraco.Cms.ManagementApi.Controllers.Document.Tree;
[ApiVersion("1.0")]
[ApiController]
[VersionedApiBackOfficeRoute($"{Constants.Web.RoutePath.Tree}/{Constants.UdiEntityType.Document}")]
[ApiExplorerSettings(GroupName = nameof(Constants.UdiEntityType.Document))]
[VersionedApiBackOfficeRoute($"{Constants.UdiEntityType.Document}/tree")]
[OpenApiTag(nameof(Constants.UdiEntityType.Document))]
public abstract class DocumentTreeControllerBase : UserStartNodeTreeControllerBase<DocumentTreeItemViewModel>
{
private readonly IPublicAccessService _publicAccessService;
@@ -21,7 +21,7 @@ public class ItemsDocumentTreeController : DocumentTreeControllerBase
{
}
[HttpGet("item")]
[HttpGet("items")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(IEnumerable<DocumentTreeItemViewModel>), StatusCodes.Status200OK)]
public async Task<ActionResult<IEnumerable<DocumentTreeItemViewModel>>> Items([FromQuery(Name = "key")] Guid[] keys, Guid? dataTypeKey = null, string? culture = null)
@@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Mvc;
using NSwag.Annotations;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Models.Entities;
@@ -11,8 +12,8 @@ namespace Umbraco.Cms.ManagementApi.Controllers.DocumentBlueprint.Tree;
[ApiVersion("1.0")]
[ApiController]
[VersionedApiBackOfficeRoute($"{Constants.Web.RoutePath.Tree}/{Constants.UdiEntityType.DocumentBlueprint}")]
[ApiExplorerSettings(GroupName = "Document Blueprint")]
[VersionedApiBackOfficeRoute($"{Constants.UdiEntityType.DocumentBlueprint}/tree")]
[OpenApiTag(nameof(Constants.UdiEntityType.DocumentBlueprint))]
public class DocumentBlueprintTreeControllerBase : EntityTreeControllerBase<DocumentBlueprintTreeItemViewModel>
{
private readonly IContentTypeService _contentTypeService;
@@ -13,7 +13,7 @@ public class ItemsDocumentBlueprintTreeController : DocumentBlueprintTreeControl
{
}
[HttpGet("item")]
[HttpGet("items")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(IEnumerable<DocumentBlueprintTreeItemViewModel>), StatusCodes.Status200OK)]
public async Task<ActionResult<IEnumerable<DocumentBlueprintTreeItemViewModel>>> Items([FromQuery(Name = "key")] Guid[] keys)
@@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Mvc;
using NSwag.Annotations;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Models.Entities;
@@ -11,8 +12,8 @@ namespace Umbraco.Cms.ManagementApi.Controllers.DocumentType.Tree;
[ApiVersion("1.0")]
[ApiController]
[VersionedApiBackOfficeRoute($"{Constants.Web.RoutePath.Tree}/{Constants.UdiEntityType.DocumentType}")]
[ApiExplorerSettings(GroupName = "Document Type")]
[VersionedApiBackOfficeRoute($"{Constants.UdiEntityType.DocumentType}/tree")]
[OpenApiTag(nameof(Constants.UdiEntityType.DocumentType))]
public class DocumentTypeTreeControllerBase : FolderTreeControllerBase<DocumentTypeTreeItemViewModel>
{
private readonly IContentTypeService _contentTypeService;
@@ -12,7 +12,7 @@ public class ItemsDocumentTypeTreeController : DocumentTypeTreeControllerBase
{
}
[HttpGet("item")]
[HttpGet("items")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(IEnumerable<DocumentTypeTreeItemViewModel>), StatusCodes.Status200OK)]
public async Task<ActionResult<IEnumerable<DocumentTypeTreeItemViewModel>>> Items([FromQuery(Name = "key")] Guid[] keys)
@@ -0,0 +1,12 @@
using Microsoft.AspNetCore.Mvc;
using NSwag.Annotations;
using Umbraco.New.Cms.Web.Common.Routing;
namespace Umbraco.Cms.ManagementApi.Controllers.ExamineManagement;
[ApiController]
[BackOfficeRoute("api/v{version:apiVersion}/examineManagement")]
[OpenApiTag("ExamineManagement")]
public class ExamineManagementControllerBase : ManagementApiControllerBase
{
}
@@ -2,21 +2,21 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.ManagementApi.Factories;
using Umbraco.Cms.ManagementApi.ViewModels.Search;
using Umbraco.Cms.ManagementApi.ViewModels.ExamineManagement;
namespace Umbraco.Cms.ManagementApi.Controllers.Indexer;
namespace Umbraco.Cms.ManagementApi.Controllers.ExamineManagement;
[ApiVersion("1.0")]
public class DetailsIndexerController : IndexerControllerBase
public class IndexExamineManagementController : ExamineManagementControllerBase
{
private readonly IIndexViewModelFactory _indexViewModelFactory;
private readonly IExamineIndexViewModelFactory _examineIndexViewModelFactory;
private readonly IExamineManager _examineManager;
public DetailsIndexerController(
IIndexViewModelFactory indexViewModelFactory,
public IndexExamineManagementController(
IExamineIndexViewModelFactory examineIndexViewModelFactory,
IExamineManager examineManager)
{
_indexViewModelFactory = indexViewModelFactory;
_examineIndexViewModelFactory = examineIndexViewModelFactory;
_examineManager = examineManager;
}
@@ -29,15 +29,15 @@ public class DetailsIndexerController : IndexerControllerBase
/// This is kind of rudimentary since there's no way we can know that the index has rebuilt, we
/// have a listener for the index op complete so we'll just check if that key is no longer there in the runtime cache
/// </remarks>
[HttpGet("{indexName}")]
[HttpGet("index")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
[ProducesResponseType(typeof(IndexViewModel), StatusCodes.Status200OK)]
public async Task<ActionResult<IndexViewModel?>> Details(string indexName)
[ProducesResponseType(typeof(ExamineIndexViewModel), StatusCodes.Status200OK)]
public async Task<ActionResult<ExamineIndexViewModel?>> Index(string indexName)
{
if (_examineManager.TryGetIndex(indexName, out IIndex? index))
{
return await Task.FromResult(_indexViewModelFactory.Create(index!));
return await Task.FromResult(_examineIndexViewModelFactory.Create(index!));
}
var invalidModelProblem = new ProblemDetails
@@ -0,0 +1,42 @@
using Examine;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Infrastructure.Examine;
using Umbraco.Cms.ManagementApi.Factories;
using Umbraco.Cms.ManagementApi.ViewModels.ExamineManagement;
using Umbraco.Cms.ManagementApi.ViewModels.Pagination;
using Umbraco.Extensions;
namespace Umbraco.Cms.ManagementApi.Controllers.ExamineManagement;
[ApiVersion("1.0")]
public class IndexesExamineManagementController : ExamineManagementControllerBase
{
private readonly IExamineManager _examineManager;
private readonly IExamineIndexViewModelFactory _examineIndexViewModelFactory;
public IndexesExamineManagementController(
IExamineManager examineManager,
IExamineIndexViewModelFactory examineIndexViewModelFactory)
{
_examineManager = examineManager;
_examineIndexViewModelFactory = examineIndexViewModelFactory;
}
/// <summary>
/// Get the details for indexers
/// </summary>
/// <returns></returns>
[HttpGet("indexes")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(PagedViewModel<ExamineIndexViewModel>), StatusCodes.Status200OK)]
public async Task<PagedViewModel<ExamineIndexViewModel>> Indexes(int skip, int take)
{
ExamineIndexViewModel[] indexes = _examineManager.Indexes
.Select(_examineIndexViewModelFactory.Create)
.OrderBy(examineIndexModel => examineIndexModel.Name?.TrimEnd("Indexer")).ToArray();
var viewModel = new PagedViewModel<ExamineIndexViewModel> { Items = indexes.Skip(skip).Take(take), Total = indexes.Length };
return viewModel;
}
}
@@ -5,17 +5,17 @@ using Microsoft.Extensions.Logging;
using Umbraco.Cms.Infrastructure.Examine;
using Umbraco.New.Cms.Infrastructure.Services;
namespace Umbraco.Cms.ManagementApi.Controllers.Indexer;
namespace Umbraco.Cms.ManagementApi.Controllers.ExamineManagement;
[ApiVersion("1.0")]
public class RebuildIndexerController : IndexerControllerBase
public class RebuildExamineManagementController : ExamineManagementControllerBase
{
private readonly ILogger<RebuildIndexerController> _logger;
private readonly ILogger<RebuildExamineManagementController> _logger;
private readonly IIndexingRebuilderService _indexingRebuilderService;
private readonly IExamineManager _examineManager;
public RebuildIndexerController(
ILogger<RebuildIndexerController> logger,
public RebuildExamineManagementController(
ILogger<RebuildExamineManagementController> logger,
IIndexingRebuilderService indexingRebuilderService,
IExamineManager examineManager)
{
@@ -29,7 +29,7 @@ public class RebuildIndexerController : IndexerControllerBase
/// </summary>
/// <param name="indexName"></param>
/// <returns></returns>
[HttpPost("{indexName}/rebuild")]
[HttpPost("rebuild")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
[ProducesResponseType(typeof(OkResult), StatusCodes.Status200OK)]
@@ -4,28 +4,28 @@ using Lucene.Net.QueryParsers.Classic;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.ManagementApi.Services;
using Umbraco.Cms.ManagementApi.ViewModels.ExamineManagement;
using Umbraco.Cms.ManagementApi.ViewModels.Pagination;
using Umbraco.Cms.ManagementApi.ViewModels.Search;
using Umbraco.Extensions;
namespace Umbraco.Cms.ManagementApi.Controllers.Searcher;
namespace Umbraco.Cms.ManagementApi.Controllers.ExamineManagement;
[ApiVersion("1.0")]
public class QuerySearcherController : SearcherControllerBase
public class SearchExamineManagementController : ExamineManagementControllerBase
{
private readonly IExamineManagerService _examineManagerService;
public QuerySearcherController(IExamineManagerService examineManagerService) => _examineManagerService = examineManagerService;
public SearchExamineManagementController(IExamineManagerService examineManagerService) => _examineManagerService = examineManagerService;
[HttpGet("{searcherName}/query")]
[HttpGet("search")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(PagedViewModel<SearchResultViewModel>), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(PagedViewModel<PagedViewModel<SearchResultViewModel>>), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
public async Task<ActionResult<PagedViewModel<SearchResultViewModel>>> Query(string searcherName, string? term, int skip, int take)
public async Task<ActionResult<PagedViewModel<SearchResultViewModel>>> GetSearchResults(string searcherName, string? query, int skip, int take)
{
term = term?.Trim();
query = query?.Trim();
if (term.IsNullOrWhiteSpace())
if (query.IsNullOrWhiteSpace())
{
return new PagedViewModel<SearchResultViewModel>();
}
@@ -50,7 +50,7 @@ public class QuerySearcherController : SearcherControllerBase
{
results = searcher
.CreateQuery()
.NativeQuery(term)
.NativeQuery(query)
.Execute(QueryOptions.SkipTake(skip, take));
}
catch (ParseException)
@@ -1,27 +1,28 @@
using Examine;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Infrastructure.Examine;
using Umbraco.Cms.ManagementApi.ViewModels.ExamineManagement;
using Umbraco.Cms.ManagementApi.ViewModels.Pagination;
using Umbraco.Cms.ManagementApi.ViewModels.Search;
using Umbraco.Extensions;
namespace Umbraco.Cms.ManagementApi.Controllers.Searcher;
namespace Umbraco.Cms.ManagementApi.Controllers.ExamineManagement;
[ApiVersion("1.0")]
public class AllSearcherController : SearcherControllerBase
public class SearchersExamineManagementController : ExamineManagementControllerBase
{
private readonly IExamineManager _examineManager;
public AllSearcherController(IExamineManager examineManager) => _examineManager = examineManager;
public SearchersExamineManagementController(IExamineManager examineManager) => _examineManager = examineManager;
/// <summary>
/// Get the details for searchers
/// </summary>
/// <returns></returns>
[HttpGet]
[HttpGet("searchers")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(PagedViewModel<SearcherViewModel>), StatusCodes.Status200OK)]
public async Task<ActionResult<PagedViewModel<SearcherViewModel>>> All(int skip, int take)
public async Task<ActionResult<PagedViewModel<SearcherViewModel>>> Searchers(int skip, int take)
{
var searchers = new List<SearcherViewModel>(
_examineManager.RegisteredSearchers.Select(searcher => new SearcherViewModel { Name = searcher.Name })
@@ -1,11 +1,12 @@
using Microsoft.AspNetCore.Mvc;
using NSwag.Annotations;
using Umbraco.New.Cms.Web.Common.Routing;
namespace Umbraco.Cms.ManagementApi.Controllers.Help;
[ApiController]
[VersionedApiBackOfficeRoute("help")]
[ApiExplorerSettings(GroupName = "Help")]
[BackOfficeRoute("api/v{version:apiVersion}/help")]
[OpenApiTag("Help")]
[ApiVersion("1.0")]
public abstract class HelpControllerBase : ManagementApiControllerBase
{
@@ -1,41 +0,0 @@
using Examine;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.ManagementApi.Factories;
using Umbraco.Cms.ManagementApi.ViewModels.Pagination;
using Umbraco.Cms.ManagementApi.ViewModels.Search;
using Umbraco.Extensions;
namespace Umbraco.Cms.ManagementApi.Controllers.Indexer;
[ApiVersion("1.0")]
public class AllIndexerController : IndexerControllerBase
{
private readonly IExamineManager _examineManager;
private readonly IIndexViewModelFactory _indexViewModelFactory;
public AllIndexerController(
IExamineManager examineManager,
IIndexViewModelFactory indexViewModelFactory)
{
_examineManager = examineManager;
_indexViewModelFactory = indexViewModelFactory;
}
/// <summary>
/// Get the details for indexers
/// </summary>
/// <returns></returns>
[HttpGet]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(PagedViewModel<IndexViewModel>), StatusCodes.Status200OK)]
public Task<PagedViewModel<IndexViewModel>> All(int skip, int take)
{
IndexViewModel[] indexes = _examineManager.Indexes
.Select(_indexViewModelFactory.Create)
.OrderBy(indexModel => indexModel.Name.TrimEnd("Indexer")).ToArray();
var viewModel = new PagedViewModel<IndexViewModel> { Items = indexes.Skip(skip).Take(take), Total = indexes.Length };
return Task.FromResult(viewModel);
}
}
@@ -1,11 +0,0 @@
using Microsoft.AspNetCore.Mvc;
using Umbraco.New.Cms.Web.Common.Routing;
namespace Umbraco.Cms.ManagementApi.Controllers.Indexer;
[ApiController]
[VersionedApiBackOfficeRoute("indexer")]
[ApiExplorerSettings(GroupName = "Indexer")]
public class IndexerControllerBase : ManagementApiControllerBase
{
}
@@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Mvc;
using NSwag.Annotations;
using Umbraco.Cms.Core;
using Umbraco.Cms.ManagementApi.Filters;
using Umbraco.New.Cms.Web.Common.Routing;
@@ -7,7 +8,7 @@ namespace Umbraco.Cms.ManagementApi.Controllers.Install;
[ApiController]
[VersionedApiBackOfficeRoute("install")]
[ApiExplorerSettings(GroupName = "Install")]
[OpenApiTag("Install")]
[RequireRuntimeLevel(RuntimeLevel.Install)]
public abstract class InstallControllerBase : ManagementApiControllerBase
{
@@ -21,7 +21,7 @@ public class ValidateDatabaseInstallController : InstallControllerBase
_mapper = mapper;
}
[HttpPost("validate-database")]
[HttpPost("validateDatabase")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
[ProducesResponseType(StatusCodes.Status200OK)]
@@ -1,11 +1,12 @@
using Microsoft.AspNetCore.Mvc;
using NSwag.Annotations;
using Umbraco.New.Cms.Web.Common.Routing;
namespace Umbraco.Cms.ManagementApi.Controllers.Language;
[ApiController]
[VersionedApiBackOfficeRoute("language")]
[ApiExplorerSettings(GroupName = "Language")]
[BackOfficeRoute("api/v{version:apiVersion}/language")]
[OpenApiTag("Language")]
[ApiVersion("1.0")]
public abstract class LanguageControllerBase : ManagementApiControllerBase
{
@@ -1,5 +1,6 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using NSwag.Annotations;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Models.Entities;
@@ -13,10 +14,10 @@ namespace Umbraco.Cms.ManagementApi.Controllers.Media.RecycleBin;
[ApiVersion("1.0")]
[ApiController]
[VersionedApiBackOfficeRoute($"{Constants.Web.RoutePath.RecycleBin}/{Constants.UdiEntityType.Media}")]
[VersionedApiBackOfficeRoute($"{Constants.UdiEntityType.Media}/recycle-bin")]
[RequireMediaTreeRootAccess]
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
[ApiExplorerSettings(GroupName = nameof(Constants.UdiEntityType.Media))]
[OpenApiTag(nameof(Constants.UdiEntityType.Media))]
public class MediaRecycleBinControllerBase : RecycleBinControllerBase<RecycleBinItemViewModel>
{
public MediaRecycleBinControllerBase(IEntityService entityService)
@@ -20,7 +20,7 @@ public class ItemsMediaTreeController : MediaTreeControllerBase
{
}
[HttpGet("item")]
[HttpGet("items")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(IEnumerable<ContentTreeItemViewModel>), StatusCodes.Status200OK)]
public async Task<ActionResult<IEnumerable<ContentTreeItemViewModel>>> Items([FromQuery(Name = "key")] Guid[] keys, Guid? dataTypeKey = null)
@@ -1,5 +1,5 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc;
using NSwag.Annotations;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Cache;
using Umbraco.Cms.Core.Models;
@@ -15,8 +15,8 @@ namespace Umbraco.Cms.ManagementApi.Controllers.Media.Tree;
[ApiVersion("1.0")]
[ApiController]
[VersionedApiBackOfficeRoute($"{Constants.Web.RoutePath.Tree}/{Constants.UdiEntityType.Media}")]
[ApiExplorerSettings(GroupName = nameof(Constants.UdiEntityType.Media))]
[VersionedApiBackOfficeRoute($"{Constants.UdiEntityType.Media}/tree")]
[OpenApiTag(nameof(Constants.UdiEntityType.Media))]
public class MediaTreeControllerBase : UserStartNodeTreeControllerBase<ContentTreeItemViewModel>
{
private readonly AppCaches _appCaches;
@@ -12,7 +12,7 @@ public class ItemsMediaTypeTreeController : MediaTypeTreeControllerBase
{
}
[HttpGet("item")]
[HttpGet("items")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(IEnumerable<FolderTreeItemViewModel>), StatusCodes.Status200OK)]
public async Task<ActionResult<IEnumerable<FolderTreeItemViewModel>>> Items([FromQuery(Name = "key")] Guid[] keys)
@@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Mvc;
using NSwag.Annotations;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Models.Entities;
@@ -11,8 +12,8 @@ namespace Umbraco.Cms.ManagementApi.Controllers.MediaType.Tree;
[ApiVersion("1.0")]
[ApiController]
[VersionedApiBackOfficeRoute($"{Constants.Web.RoutePath.Tree}/{Constants.UdiEntityType.MediaType}")]
[ApiExplorerSettings(GroupName = "Media Type")]
[VersionedApiBackOfficeRoute($"{Constants.UdiEntityType.MediaType}/tree")]
[OpenApiTag(nameof(Constants.UdiEntityType.MediaType))]
public class MediaTypeTreeControllerBase : FolderTreeControllerBase<FolderTreeItemViewModel>
{
private readonly IMediaTypeService _mediaTypeService;
@@ -12,7 +12,7 @@ public class ItemsMemberGroupTreeController : MemberGroupTreeControllerBase
{
}
[HttpGet("item")]
[HttpGet("items")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(IEnumerable<EntityTreeItemViewModel>), StatusCodes.Status200OK)]
public async Task<ActionResult<IEnumerable<EntityTreeItemViewModel>>> Items([FromQuery(Name = "key")] Guid[] keys)
@@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Mvc;
using NSwag.Annotations;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Models.Entities;
@@ -11,8 +12,8 @@ namespace Umbraco.Cms.ManagementApi.Controllers.MemberGroup.Tree;
[ApiVersion("1.0")]
[ApiController]
[VersionedApiBackOfficeRoute($"{Constants.Web.RoutePath.Tree}/{Constants.UdiEntityType.MemberGroup}")]
[ApiExplorerSettings(GroupName = "Member Group")]
[VersionedApiBackOfficeRoute($"{Constants.UdiEntityType.MemberGroup}/tree")]
[OpenApiTag(nameof(Constants.UdiEntityType.MemberGroup))]
public class MemberGroupTreeControllerBase : EntityTreeControllerBase<EntityTreeItemViewModel>
{
public MemberGroupTreeControllerBase(IEntityService entityService)
@@ -12,7 +12,7 @@ public class ItemsMemberTypeTreeController : MemberTypeTreeControllerBase
{
}
[HttpGet("item")]
[HttpGet("items")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(IEnumerable<EntityTreeItemViewModel>), StatusCodes.Status200OK)]
public async Task<ActionResult<IEnumerable<EntityTreeItemViewModel>>> Items([FromQuery(Name = "key")] Guid[] keys)
@@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Mvc;
using NSwag.Annotations;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Models.Entities;
@@ -11,8 +12,8 @@ namespace Umbraco.Cms.ManagementApi.Controllers.MemberType.Tree;
[ApiVersion("1.0")]
[ApiController]
[VersionedApiBackOfficeRoute($"{Constants.Web.RoutePath.Tree}/{Constants.UdiEntityType.MemberType}")]
[ApiExplorerSettings(GroupName = "Member Type")]
[VersionedApiBackOfficeRoute($"{Constants.UdiEntityType.MemberType}/tree")]
[OpenApiTag(nameof(Constants.UdiEntityType.MemberType))]
public class MemberTypeTreeControllerBase : EntityTreeControllerBase<EntityTreeItemViewModel>
{
public MemberTypeTreeControllerBase(IEntityService entityService)
@@ -1,51 +1,25 @@
using System.ComponentModel;
using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Cms.Core.DependencyInjection;
using Umbraco.Cms.Infrastructure.ModelsBuilder;
using Umbraco.Cms.Infrastructure.ModelsBuilder.Building;
using Umbraco.Extensions;
namespace Umbraco.Cms.ManagementApi.Controllers.ModelsBuilder;
namespace Umbraco.Cms.ManagementApi.Controllers.ModelsBuilderDashboard;
public class BuildModelsBuilderController : ModelsBuilderControllerBase
{
private ModelsBuilderSettings _modelsBuilderSettings;
private readonly ModelsGenerationError _mbErrors;
private readonly IModelsGenerator _modelGenerator;
private readonly ModelsGenerator _modelGenerator;
// TODO: Remove in v13
private readonly ModelsGenerator? _concreteModelGenerator;
[Obsolete("This constructor is obsolete and will be removed in v13. Use the constructor with IModelsGenerator instead.")]
[Browsable(false)]
public BuildModelsBuilderController(
IOptionsMonitor<ModelsBuilderSettings> modelsBuilderSettings,
ModelsGenerationError mbErrors,
ModelsGenerator modelGenerator)
: this(modelsBuilderSettings, mbErrors, StaticServiceProvider.Instance.GetRequiredService<IModelsGenerator>())
{
}
[Obsolete("This constructor is obsolete and will be removed in v13. Use the constructor with only IModelsGenerator instead.")]
[Browsable(false)]
public BuildModelsBuilderController(
IOptionsMonitor<ModelsBuilderSettings> modelsBuilderSettings,
ModelsGenerationError mbErrors,
ModelsGenerator concreteModelGenerator,
IModelsGenerator modelGenerator)
: this(modelsBuilderSettings, mbErrors, modelGenerator)
{
}
[ActivatorUtilitiesConstructor]
public BuildModelsBuilderController(
IOptionsMonitor<ModelsBuilderSettings> modelsBuilderSettings,
ModelsGenerationError mbErrors,
IModelsGenerator modelGenerator)
{
_mbErrors = mbErrors;
_modelGenerator = modelGenerator;
@@ -1,9 +1,10 @@
using Microsoft.AspNetCore.Http;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.ManagementApi.Factories;
using Umbraco.Cms.ManagementApi.ViewModels.ModelsBuilderDashboard;
namespace Umbraco.Cms.ManagementApi.Controllers.ModelsBuilder;
namespace Umbraco.Cms.ManagementApi.Controllers.ModelsBuilderDashboard;
public class GetModelsBuilderController : ModelsBuilderControllerBase
{
@@ -11,8 +12,8 @@ public class GetModelsBuilderController : ModelsBuilderControllerBase
public GetModelsBuilderController(IModelsBuilderViewModelFactory modelsBuilderViewModelFactory) => _modelsBuilderViewModelFactory = modelsBuilderViewModelFactory;
[HttpGet("dashboard")]
[ProducesResponseType(typeof(ModelsBuilderViewModel), StatusCodes.Status200OK)]
[HttpGet]
[ProducesResponseType(typeof(CreatedResult), StatusCodes.Status200OK)]
[MapToApiVersion("1.0")]
public async Task<ActionResult<ModelsBuilderViewModel>> GetDashboard() => await Task.FromResult(Ok(_modelsBuilderViewModelFactory.Create()));
}
@@ -1,11 +1,12 @@
using Microsoft.AspNetCore.Mvc;
using NSwag.Annotations;
using Umbraco.New.Cms.Web.Common.Routing;
namespace Umbraco.Cms.ManagementApi.Controllers.ModelsBuilder;
namespace Umbraco.Cms.ManagementApi.Controllers.ModelsBuilderDashboard;
[ApiController]
[VersionedApiBackOfficeRoute("models-builder")]
[ApiExplorerSettings(GroupName = "Models Builder")]
[VersionedApiBackOfficeRoute("modelsBuilder")]
[OpenApiTag("ModelsBuilder")]
[ApiVersion("1.0")]
public class ModelsBuilderControllerBase : ManagementApiControllerBase
@@ -5,7 +5,7 @@ using Umbraco.Cms.Infrastructure.ModelsBuilder;
using Umbraco.Cms.ManagementApi.ViewModels.ModelsBuilderDashboard;
using Umbraco.New.Cms.Core.Models;
namespace Umbraco.Cms.ManagementApi.Controllers.ModelsBuilder;
namespace Umbraco.Cms.ManagementApi.Controllers.ModelsBuilderDashboard;
public class StatusModelsBuilderController : ModelsBuilderControllerBase
{
@@ -12,7 +12,7 @@ public class ItemsPartialViewTreeController : PartialViewTreeControllerBase
{
}
[HttpGet("item")]
[HttpGet("items")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(IEnumerable<FileSystemTreeItemViewModel>), StatusCodes.Status200OK)]
public async Task<ActionResult<IEnumerable<FileSystemTreeItemViewModel>>> Items([FromQuery(Name = "path")] string[] paths)
@@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Mvc;
using NSwag.Annotations;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.IO;
using Umbraco.Cms.ManagementApi.Controllers.Tree;
@@ -8,8 +9,8 @@ namespace Umbraco.Cms.ManagementApi.Controllers.PartialView.Tree;
[ApiVersion("1.0")]
[ApiController]
[VersionedApiBackOfficeRoute($"{Constants.Web.RoutePath.Tree}/{Constants.UdiEntityType.PartialView}")]
[ApiExplorerSettings(GroupName = "Partial View")]
[VersionedApiBackOfficeRoute($"{Constants.UdiEntityType.PartialView}/tree")]
[OpenApiTag(nameof(Constants.UdiEntityType.PartialView))]
public class PartialViewTreeControllerBase : FileSystemTreeControllerBase
{
public PartialViewTreeControllerBase(FileSystems fileSystems)
@@ -1,12 +1,13 @@
using Microsoft.AspNetCore.Mvc;
using NSwag.Annotations;
using Umbraco.New.Cms.Web.Common.Routing;
namespace Umbraco.Cms.ManagementApi.Controllers.Profiling;
[ApiVersion("1.0")]
[ApiController]
[VersionedApiBackOfficeRoute("profiling")]
[ApiExplorerSettings(GroupName = "Profiling")]
[BackOfficeRoute("api/v{version:apiVersion}/profiling")]
[OpenApiTag("Profiling")]
public class ProfilingControllerBase : ManagementApiControllerBase
{
}
@@ -1,12 +1,13 @@
using Microsoft.AspNetCore.Mvc;
using NSwag.Annotations;
using Umbraco.New.Cms.Web.Common.Routing;
namespace Umbraco.Cms.ManagementApi.Controllers.PublishedCache;
[ApiVersion("1.0")]
[ApiController]
[VersionedApiBackOfficeRoute("published-cache")]
[ApiExplorerSettings(GroupName = "Published Cache")]
[BackOfficeRoute("api/v{version:apiVersion}/published-cache")]
[OpenApiTag("PublishedCache")]
public class PublishedCacheControllerBase : ManagementApiControllerBase
{
}
@@ -14,7 +14,7 @@ public class RebuildPublishedCacheController : PublishedCacheControllerBase
[HttpPost("rebuild")]
[MapToApiVersion("1.0")]
[ProducesResponseType(StatusCodes.Status200OK)]
public async Task<ActionResult> Rebuild()
public async Task<ActionResult> Collect()
{
_publishedSnapshotService.Rebuild();
return await Task.FromResult(Ok());
@@ -22,7 +22,7 @@ public class ByChildRelationController : RelationControllerBase
_relationViewModelFactory = relationViewModelFactory;
}
[HttpGet("child-relation/{childId:int}")]
[HttpGet("childRelations/{childId:int}")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(PagedViewModel<RelationViewModel>), StatusCodes.Status200OK)]
public async Task<PagedViewModel<RelationViewModel>> ByChild(int childId, int skip, int take, string? relationTypeAlias = "")
@@ -1,11 +1,12 @@
using Microsoft.AspNetCore.Mvc;
using NSwag.Annotations;
using Umbraco.New.Cms.Web.Common.Routing;
namespace Umbraco.Cms.ManagementApi.Controllers.Relation;
[ApiController]
[VersionedApiBackOfficeRoute("relation")]
[ApiExplorerSettings(GroupName = "Relation")]
[BackOfficeRoute("api/v{version:apiVersion}/relation")]
[OpenApiTag("Relation")]
[ApiVersion("1.0")]
// TODO: Implement Authentication
public abstract class RelationControllerBase : ManagementApiControllerBase
@@ -14,7 +14,7 @@ public class ItemsRelationTypeTreeController : RelationTypeTreeControllerBase
: base(entityService) =>
_relationService = relationService;
[HttpGet("item")]
[HttpGet("items")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(IEnumerable<FolderTreeItemViewModel>), StatusCodes.Status200OK)]
public async Task<ActionResult<IEnumerable<FolderTreeItemViewModel>>> Items([FromQuery(Name = "key")] Guid[] keys)
@@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Mvc;
using NSwag.Annotations;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Services;
@@ -10,8 +11,8 @@ namespace Umbraco.Cms.ManagementApi.Controllers.RelationType.Tree;
[ApiVersion("1.0")]
[ApiController]
[VersionedApiBackOfficeRoute($"{Constants.Web.RoutePath.Tree}/{Constants.UdiEntityType.RelationType}")]
[ApiExplorerSettings(GroupName = "Relation Type")]
[VersionedApiBackOfficeRoute($"{Constants.UdiEntityType.RelationType}/tree")]
[OpenApiTag(nameof(Constants.UdiEntityType.RelationType))]
// NOTE: at the moment relation types 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 RelationTypeTreeControllerBase : EntityTreeControllerBase<EntityTreeItemViewModel>
@@ -12,7 +12,7 @@ public class ItemsScriptTreeController : ScriptTreeControllerBase
{
}
[HttpGet("item")]
[HttpGet("items")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(IEnumerable<FileSystemTreeItemViewModel>), StatusCodes.Status200OK)]
public async Task<ActionResult<IEnumerable<FileSystemTreeItemViewModel>>> Items([FromQuery(Name = "path")] string[] paths)
@@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Mvc;
using NSwag.Annotations;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.IO;
using Umbraco.Cms.ManagementApi.Controllers.Tree;
@@ -8,8 +9,8 @@ namespace Umbraco.Cms.ManagementApi.Controllers.Script.Tree;
[ApiVersion("1.0")]
[ApiController]
[VersionedApiBackOfficeRoute($"{Constants.Web.RoutePath.Tree}/{Constants.UdiEntityType.Script}")]
[ApiExplorerSettings(GroupName = nameof(Constants.UdiEntityType.Script))]
[VersionedApiBackOfficeRoute($"{Constants.UdiEntityType.Script}/tree")]
[OpenApiTag(nameof(Constants.UdiEntityType.Script))]
public class ScriptTreeControllerBase : FileSystemTreeControllerBase
{
public ScriptTreeControllerBase(FileSystems fileSystems)
@@ -1,11 +0,0 @@
using Microsoft.AspNetCore.Mvc;
using Umbraco.New.Cms.Web.Common.Routing;
namespace Umbraco.Cms.ManagementApi.Controllers.Searcher;
[ApiController]
[VersionedApiBackOfficeRoute("searcher")]
[ApiExplorerSettings(GroupName = "Searcher")]
public class SearcherControllerBase : ManagementApiControllerBase
{
}
@@ -1,144 +0,0 @@
using System.Security.Claims;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using OpenIddict.Abstractions;
using OpenIddict.Server.AspNetCore;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Cms.Core.Security;
using Umbraco.Cms.Web.BackOffice.Security;
using Umbraco.Extensions;
using Umbraco.New.Cms.Web.Common.Routing;
using SignInResult = Microsoft.AspNetCore.Mvc.SignInResult;
using IdentitySignInResult = Microsoft.AspNetCore.Identity.SignInResult;
namespace Umbraco.Cms.ManagementApi.Controllers.Security;
[ApiController]
[VersionedApiBackOfficeRoute(Paths.BackOfficeApiEndpointTemplate)]
[ApiExplorerSettings(GroupName = "Security")]
public class BackOfficeController : ManagementApiControllerBase
{
private readonly IHttpContextAccessor _httpContextAccessor;
private readonly IBackOfficeSignInManager _backOfficeSignInManager;
private readonly IBackOfficeUserManager _backOfficeUserManager;
private readonly IOptions<SecuritySettings> _securitySettings;
public BackOfficeController(
IHttpContextAccessor httpContextAccessor,
IBackOfficeSignInManager backOfficeSignInManager,
IBackOfficeUserManager backOfficeUserManager,
IOptions<SecuritySettings> securitySettings)
{
_httpContextAccessor = httpContextAccessor;
_backOfficeSignInManager = backOfficeSignInManager;
_backOfficeUserManager = backOfficeUserManager;
_securitySettings = securitySettings;
}
[HttpGet("authorize")]
[HttpPost("authorize")]
[MapToApiVersion("1.0")]
public async Task<IActionResult> Authorize()
{
HttpContext context = _httpContextAccessor.GetRequiredHttpContext();
OpenIddictRequest? request = context.GetOpenIddictServerRequest();
if (request == null)
{
return BadRequest("Unable to obtain OpenID data from the current request");
}
return request.IdentityProvider.IsNullOrWhiteSpace()
? await AuthorizeInternal(request)
: await AuthorizeExternal(request);
}
private async Task<IActionResult> AuthorizeInternal(OpenIddictRequest request)
{
// TODO: ensure we handle sign-in notifications for internal logins.
// when the new login screen is implemented for internal logins, make sure it still handles
// user sign-in notifications (calls BackOfficeSignInManager.HandleSignIn) as part of the
// sign-in process
// for future reference, notifications are already handled for the external login flow by
// by calling BackOfficeSignInManager.ExternalLoginSignInAsync
// retrieve the user principal stored in the authentication cookie.
AuthenticateResult cookieAuthResult = await HttpContext.AuthenticateAsync(Constants.Security.BackOfficeAuthenticationType);
var userName = cookieAuthResult.Succeeded
? cookieAuthResult.Principal?.Identity?.Name
: null;
if (userName != null)
{
BackOfficeIdentityUser? backOfficeUser = await _backOfficeUserManager.FindByNameAsync(userName);
if (backOfficeUser != null)
{
return await SignInBackOfficeUser(backOfficeUser, request);
}
}
return DefaultChallengeResult();
}
private async Task<IActionResult> AuthorizeExternal(OpenIddictRequest request)
{
var provider = request.IdentityProvider ?? throw new ArgumentException("No identity provider found in request", nameof(request));
ExternalLoginInfo? loginInfo = await _backOfficeSignInManager.GetExternalLoginInfoAsync();
if (loginInfo?.Principal != null)
{
IdentitySignInResult result = await _backOfficeSignInManager.ExternalLoginSignInAsync(loginInfo, false, _securitySettings.Value.UserBypassTwoFactorForExternalLogins);
if (result.Succeeded)
{
// Update any authentication tokens if succeeded
await _backOfficeSignInManager.UpdateExternalAuthenticationTokensAsync(loginInfo);
// sign in the backoffice user associated with the login provider and unique provider key
BackOfficeIdentityUser? backOfficeUser = await _backOfficeUserManager.FindByLoginAsync(loginInfo.LoginProvider, loginInfo.ProviderKey);
if (backOfficeUser != null)
{
return await SignInBackOfficeUser(backOfficeUser, request);
}
}
else
{
// avoid infinite auth loops when something fails by performing the default challenge (default login screen)
return DefaultChallengeResult();
}
}
AuthenticationProperties properties = _backOfficeSignInManager.ConfigureExternalAuthenticationProperties(provider, null);
return new ChallengeResult(provider, properties);
}
private async Task<IActionResult> SignInBackOfficeUser(BackOfficeIdentityUser backOfficeUser, OpenIddictRequest request)
{
ClaimsPrincipal backOfficePrincipal = await _backOfficeSignInManager.CreateUserPrincipalAsync(backOfficeUser);
backOfficePrincipal.SetClaim(OpenIddictConstants.Claims.Subject, backOfficeUser.Key.ToString());
// TODO: it is not optimal to append all claims to the token.
// the token size grows with each claim, although it is still smaller than the old cookie.
// see if we can find a better way so we do not risk leaking sensitive data in bearer tokens.
// maybe work with scopes instead?
Claim[] backOfficeClaims = backOfficePrincipal.Claims.ToArray();
foreach (Claim backOfficeClaim in backOfficeClaims)
{
backOfficeClaim.SetDestinations(OpenIddictConstants.Destinations.AccessToken);
}
if (request.GetScopes().Contains(OpenIddictConstants.Scopes.OfflineAccess))
{
// "offline_access" scope is required to use refresh tokens
backOfficePrincipal.SetScopes(OpenIddictConstants.Scopes.OfflineAccess);
}
return new SignInResult(OpenIddictServerAspNetCoreDefaults.AuthenticationScheme, backOfficePrincipal);
}
private static IActionResult DefaultChallengeResult() => new ChallengeResult(Constants.Security.BackOfficeAuthenticationType);
}
@@ -1,12 +0,0 @@
namespace Umbraco.Cms.ManagementApi.Controllers.Security;
public static class Paths
{
public const string BackOfficeApiEndpointTemplate = "security/back-office";
public static readonly string BackOfficeApiAuthorizationEndpoint = BackOfficeApiEndpointPath($"{BackOfficeApiEndpointTemplate}/authorize");
public static readonly string BackOfficeApiTokenEndpoint = BackOfficeApiEndpointPath($"{BackOfficeApiEndpointTemplate}/token");
private static string BackOfficeApiEndpointPath(string relativePath) => $"/umbraco/management/api/v1.0/{relativePath}";
}
@@ -1,11 +1,12 @@
using Microsoft.AspNetCore.Mvc;
using NSwag.Annotations;
using Umbraco.New.Cms.Web.Common.Routing;
namespace Umbraco.Cms.ManagementApi.Controllers.Server;
[ApiController]
[VersionedApiBackOfficeRoute("server")]
[ApiExplorerSettings(GroupName = "Server")]
[OpenApiTag("Server")]
public abstract class ServerControllerBase : ManagementApiControllerBase
{
@@ -12,7 +12,7 @@ public class ItemsStaticFileTreeController : StaticFileTreeControllerBase
{
}
[HttpGet("item")]
[HttpGet("items")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(IEnumerable<FileSystemTreeItemViewModel>), StatusCodes.Status200OK)]
public async Task<ActionResult<IEnumerable<FileSystemTreeItemViewModel>>> Items([FromQuery(Name = "path")] string[] paths)
@@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Mvc;
using NSwag.Annotations;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.IO;
using Umbraco.Cms.ManagementApi.Controllers.Tree;
@@ -8,8 +9,8 @@ namespace Umbraco.Cms.ManagementApi.Controllers.StaticFile.Tree;
[ApiVersion("1.0")]
[ApiController]
[VersionedApiBackOfficeRoute($"{Constants.Web.RoutePath.Tree}/static-file")]
[ApiExplorerSettings(GroupName = "Static File")]
[VersionedApiBackOfficeRoute("static-file/tree")]
[OpenApiTag("StaticFile")]
public class StaticFileTreeControllerBase : FileSystemTreeControllerBase
{
private static readonly string[] _allowedRootFolders = { "App_Plugins", "wwwroot" };
@@ -12,7 +12,7 @@ public class ItemsStylesheetTreeController : StylesheetTreeControllerBase
{
}
[HttpGet("item")]
[HttpGet("items")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(IEnumerable<FileSystemTreeItemViewModel>), StatusCodes.Status200OK)]
public async Task<ActionResult<IEnumerable<FileSystemTreeItemViewModel>>> Items([FromQuery(Name = "path")] string[] paths)
@@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Mvc;
using NSwag.Annotations;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.IO;
using Umbraco.Cms.ManagementApi.Controllers.Tree;
@@ -8,8 +9,8 @@ namespace Umbraco.Cms.ManagementApi.Controllers.Stylesheet.Tree;
[ApiVersion("1.0")]
[ApiController]
[VersionedApiBackOfficeRoute($"{Constants.Web.RoutePath.Tree}/{Constants.UdiEntityType.Stylesheet}")]
[ApiExplorerSettings(GroupName = nameof(Constants.UdiEntityType.Stylesheet))]
[VersionedApiBackOfficeRoute($"{Constants.UdiEntityType.Stylesheet}/tree")]
[OpenApiTag(nameof(Constants.UdiEntityType.Stylesheet))]
public class StylesheetTreeControllerBase : FileSystemTreeControllerBase
{
public StylesheetTreeControllerBase(FileSystems fileSystems)
@@ -1,23 +0,0 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.ManagementApi.ViewModels.Pagination;
using Umbraco.Cms.ManagementApi.ViewModels.Telemetry;
namespace Umbraco.Cms.ManagementApi.Controllers.Telemetry;
public class AllTelemetryController : TelemetryControllerBase
{
[HttpGet]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(PagedViewModel<TelemetryViewModel>), StatusCodes.Status200OK)]
public async Task<PagedViewModel<TelemetryViewModel>> GetAll(int skip, int take)
{
TelemetryLevel[] levels = Enum.GetValues<TelemetryLevel>();
return await Task.FromResult(new PagedViewModel<TelemetryViewModel>
{
Total = levels.Length,
Items = levels.Skip(skip).Take(take).Select(level => new TelemetryViewModel { TelemetryLevel = level }),
});
}
}
@@ -1,18 +0,0 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.ManagementApi.ViewModels.Telemetry;
namespace Umbraco.Cms.ManagementApi.Controllers.Telemetry;
public class GetTelemetryController : TelemetryControllerBase
{
private readonly IMetricsConsentService _metricsConsentService;
public GetTelemetryController(IMetricsConsentService metricsConsentService) => _metricsConsentService = metricsConsentService;
[HttpGet("level")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(TelemetryViewModel), StatusCodes.Status200OK)]
public async Task<TelemetryViewModel> Get() => await Task.FromResult(new TelemetryViewModel { TelemetryLevel = _metricsConsentService.GetConsentLevel() });
}
@@ -1,12 +0,0 @@
using Microsoft.AspNetCore.Mvc;
using Umbraco.New.Cms.Web.Common.Routing;
namespace Umbraco.Cms.ManagementApi.Controllers.Telemetry;
[ApiController]
[VersionedApiBackOfficeRoute("telemetry")]
[ApiExplorerSettings(GroupName = "Telemetry")]
[ApiVersion("1.0")]
public abstract class TelemetryControllerBase : ManagementApiControllerBase
{
}
@@ -12,7 +12,7 @@ public class ItemsTemplateTreeController : TemplateTreeControllerBase
{
}
[HttpGet("item")]
[HttpGet("items")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(IEnumerable<EntityTreeItemViewModel>), StatusCodes.Status200OK)]
public async Task<ActionResult<IEnumerable<EntityTreeItemViewModel>>> Items([FromQuery(Name = "key")] Guid[] keys)
@@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Mvc;
using NSwag.Annotations;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Models.Entities;
@@ -11,8 +12,8 @@ namespace Umbraco.Cms.ManagementApi.Controllers.Template.Tree;
[ApiVersion("1.0")]
[ApiController]
[VersionedApiBackOfficeRoute($"{Constants.Web.RoutePath.Tree}/{Constants.UdiEntityType.Template}")]
[ApiExplorerSettings(GroupName = nameof(Constants.UdiEntityType.Template))]
[VersionedApiBackOfficeRoute($"{Constants.UdiEntityType.Template}/tree")]
[OpenApiTag(nameof(Constants.UdiEntityType.Template))]
public class TemplateTreeControllerBase : EntityTreeControllerBase<EntityTreeItemViewModel>
{
public TemplateTreeControllerBase(IEntityService entityService)

Some files were not shown because too many files have changed in this diff Show More