Compare commits

...
1631 Commits
Author SHA1 Message Date
Andy Butland 0a98a47db0 Update Examine to 3.8.0. 2026-06-07 21:17:09 +02:00
Andy Butland 18a9da080a Bumped version to 13.15.0-rc 2026-04-30 08:07:45 +02:00
Andy Butland 6104efdd47 Merge branch 'release/13.14.0' into v13/dev 2026-04-30 08:06:57 +02:00
Andy Butland 7d400e7742 Bumped version to 13.14.0 2026-04-30 06:36:08 +02:00
Andy Butland 8295f833f8 Bump version to 13.14.0-rc3. 2026-04-23 16:40:12 +02:00
8d6645b0ef Surface controllers: validate redirect url in public surface controllers (v13) (#22565)
* Fix: prevent open redirect in public surface controllers by validating RedirectUrl with Url.IsLocalUrl

* Fixed spacing in comment.

---------

Co-authored-by: Lan Nguyen Thuy <lnt@umbraco.dk>
Co-authored-by: Andy Butland <abutland73@gmail.com>
2026-04-23 16:39:31 +02:00
a0cb9b2826 Surface controllers: validate redirect url in public surface controllers (v13) (#22565)
* Fix: prevent open redirect in public surface controllers by validating RedirectUrl with Url.IsLocalUrl

* Fixed spacing in comment.

---------

Co-authored-by: Lan Nguyen Thuy <lnt@umbraco.dk>
Co-authored-by: Andy Butland <abutland73@gmail.com>
2026-04-23 16:37:53 +02:00
Andy Butland b2ff910a92 Bumped version to 13.14.0-rc2. 2026-04-17 14:03:37 +02:00
GinoandAndy Butland b70d2b482d Dependencies: Pin System.Security.Cryptography.Xml to resolve vulnerability warning (Umbraco 13) (#22513)
* Update System.Security.Cryptography.Xml - fix vulnerability

* Update Directory.Packages.props

use correct/latest version of the system.security.cryptohraphy.xml package.

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

---------

Co-authored-by: Andy Butland <abutland73@gmail.com>
2026-04-17 14:02:46 +02:00
ac22eef92f Dependencies: Pin System.Security.Cryptography.Xml to resolve vulnerability warning (Umbraco 13) (#22513)
* Update System.Security.Cryptography.Xml - fix vulnerability

* Update Directory.Packages.props

use correct/latest version of the system.security.cryptohraphy.xml package.

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

---------

Co-authored-by: Andy Butland <abutland73@gmail.com>
2026-04-17 11:59:55 +00:00
24ef23e133 Backport #21910 to V13 (#22314)
* Backport #21910 to V13

* Update src/Umbraco.Infrastructure/Search/IndexingNotificationHandler.ContentType.cs

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

* Backport #21856 as well

* Fix issue where removing a property type wasn't detecting and returning the expected change type.

---------

Co-authored-by: Andy Butland <abutland73@gmail.com>
2026-04-07 09:07:07 +02:00
Andy Butland c8fb306e67 Bumped version to 13.14.0-rc. 2026-03-12 06:46:44 +01:00
Andy Butland 667c2f5a47 Set version to 13.13.1. 2026-03-06 11:58:38 +01:00
Andy ButlandandGitHub 8230efd722 Media Picker: Fix media picker folder navigation with "ignore user start nodes" enabled (closes #21840 for 13) (#21899)
Fix media picker folder navigation with "ignore user start nodes" enabled.
2026-03-06 11:02:35 +01:00
Ronald BarendseandGitHub f420b0b894 Remove legacy Windows path length checks and related tests (#21884)
Removed explicit 260-character path length checks from PhysicalFileSystem.GetFullPath and deleted associated unit tests. Updated tests to focus on path normalization and validity, and improved path assertions for clarity and cross-platform compatibility. No longer enforce or test for legacy Windows path length restrictions.
2026-02-24 11:18:11 +01:00
Andy Butland b196ee89b7 Merge branch 'release/13.13' into v13/dev
# Conflicts:
#	version.json
2025-12-18 06:39:51 +01:00
Andy Butland b998afcd93 Merge branch 'release/13.13' of https://github.com/umbraco/Umbraco-CMS into release/13.13 2025-12-17 15:59:36 +01:00
Andy Butland 8c0bdb4b0b Bump version to 13.13.0. 2025-12-17 15:59:23 +01:00
66d090b4e3 Media picker: Fix image selection after upload when media picker presents multiple pages (closes #21115) (#21117)
* Fix image selection after upload when media picker presents multiple pages.

* Apply suggestions from code review

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

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-17 08:25:03 +01:00
Andy Butland b779123946 Members: Fix GetLockoutEnd to return DateTimeOffSet max rather than DateTime max (closes #21155) (#21157)
Fix GetLockoutEnd to return DateTimeOffSet max rather than DateTime max, to align with type of function result and avoid chance of overflow when timezone is minus UTC.
2025-12-16 07:04:56 +01:00
Andy ButlandandGitHub ed36b31576 Members: Fix GetLockoutEnd to return DateTimeOffSet max rather than DateTime max (closes #21155) (#21157)
Fix GetLockoutEnd to return DateTimeOffSet max rather than DateTime max, to align with type of function result and avoid chance of overflow when timezone is minus UTC.
2025-12-16 05:44:49 +00:00
Andy Butland 4871c0bab1 Merge branch 'release/13.13' into v13/dev
# Conflicts:
#	version.json
2025-12-11 07:17:23 +01:00
bfe567f075 Updates dependencies to latest patch for 13.13 (#21108)
* Update server-side dependencies to latest patch releases.

* Update client-side dependencies.

* Bumped version to 13.13.0-rc3.

* Reverted change to node version.

* Apply suggestions from code review

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

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-10 14:12:44 +00:00
Andy Butland 328c43c225 Merge branch 'release/13.12.1' into release/13.13
# Conflicts:
#	version.json
2025-12-09 06:25:00 +01:00
Andy Butland 56de595457 Merge branch 'release/13.12.1' into v13/dev
# Conflicts:
#	version.json
2025-12-09 06:24:24 +01:00
Andy ButlandandGitHub 7505efd433 Merge commit from fork
* Ensure imported dictionary item is only processed from the expected temporary uploads folder.

* Ensured content type upload input is only a file and not a string that can be interpretted as a file path.

* Amend dictionary import to extract file name and prepend path rather than rely on provided path.

* Tidied usings.

* Ensure file name cannot contain path separator characters.
2025-12-09 05:15:53 +01:00
Andy Butland 934126ae6e Bump version to 13.13.0-rc2. 2025-12-05 15:25:16 +01:00
Bjarne FyrstenborgandAndy Butland 632f04afd2 Rich text Editor: Ensure readonly attribute has been observed (#21004)
* Set toolbar and readonly when readonly attribute has been observed

* Simplify
2025-12-05 15:24:27 +01:00
Bjarne FyrstenborgandGitHub edae01a152 Rich text Editor: Ensure readonly attribute has been observed (#21004)
* Set toolbar and readonly when readonly attribute has been observed

* Simplify
2025-12-05 15:22:12 +01:00
d418f4f4d5 Media Picker: Present root nodes for users with more than one media root node assigned (closes #20967) (#20993)
* Presented root nodes in media picker for users with more than one media root node assigned.

* Apply suggestions from code review

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

* Improved variable names.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-01 13:11:34 +00:00
Andy ButlandandGitHub da677c42ed Media Picker Fixed folder navigation when returning from an empty folder (closes #20975) (#20987)
* Fixed media picker folder navigation when returning from an empty folder.

* Applied suggestions from code review.
2025-12-01 12:59:12 +00:00
Andy ButlandandGitHub 467db7736c Content picker: Remove multi-node content picker entries by UDI to account for index not aligning with stored values (#20950)
* Remove multi-node content picker entries by udi to account for index not aligning with stored values.

* Handled issues raised in code review.
2025-12-01 12:49:19 +00:00
Bjarne FyrstenborgandGitHub aced6916ff Content editing: Correct handling of read-only of name field when A action is removed in SendingContentNotification (#20072)
Set header name to readonly
2025-12-01 06:36:31 +00:00
Bjarne FyrstenborgandGitHub dc0005f394 Block Grid: Streamline readonly with other property editors (#21007)
* Align cursor style and readonly mode for other property editors

* Show disabled actions as in other property editors when readonly

* Disable sortmode as well when readonly

* Formatting

* Ensure delete action remains disabled if readonly
2025-12-01 05:53:28 +00:00
Andy ButlandandGitHub 0da1146fcd Content picker: Allow selections on a content picker on a read-only document to be opened (closes #20816) (#20819)
Allow selections on a content picker on a read-only document to be opened.
2025-11-24 16:50:28 +00:00
a7b4481c6c Redirects: Fix self referencing redirects for 13 (#20908)
* Ported fix to 13

* Mocking context and cache

* Removing unused parameter in constructor

* Removed a couple of unused variables in the tests.

---------

Co-authored-by: Andy Butland <abutland73@gmail.com>
2025-11-20 15:29:58 +00:00
Andy Butland 90ec85386b Merge branch 'release/13.12' into release/13.12.1
# Conflicts:
#	version.json
2025-11-20 06:47:36 +01:00
Andy Butland 9baaad40d1 Merge branch 'release/13.12' into v13/dev
# Conflicts:
#	version.json
2025-11-20 06:46:39 +01:00
Andy Butland 7dcc7303c2 Bumped version to 13.12.0. 2025-11-19 18:49:49 +01:00
Andy Butland 7edc6ec11d Bump version to 13.12.1. 2025-11-17 09:30:40 +01:00
Andy Butland f2589b5af5 Fix memory leak with IOptionsMonitor.OnChange and non-singleton registered components (closes #20709 for 13) (#20722)
* Fix memory leak with IOptionsMonitor.OnChange and non-singleton registered components.

* Added XML docs.

* Apply fix to DeliveryApiContentIndexingNotificationHandler.

* Dispose disposable data editors in ValueEditorCache.

* Removed unnecessary refactoring and clarified code comments.
2025-11-06 17:30:31 +01:00
Andy ButlandandGitHub 23b09b1a7e Fix memory leak with IOptionsMonitor.OnChange and non-singleton registered components (closes #20709 for 13) (#20722)
* Fix memory leak with IOptionsMonitor.OnChange and non-singleton registered components.

* Added XML docs.

* Apply fix to DeliveryApiContentIndexingNotificationHandler.

* Dispose disposable data editors in ValueEditorCache.

* Removed unnecessary refactoring and clarified code comments.
2025-11-06 15:02:57 +00:00
Andy Butland 951f9a9e46 Bump version to 13.12.0-rc2. 2025-11-06 10:41:41 +01:00
Andy Butland 8949fd2d22 Dependencies: Update dotnet sdk and node development dependency to latest secure version of current major (13) (#20729)
Update dotnet sdk and node development dependency to latest secure version of current major.
2025-11-05 21:25:44 +01:00
Andy ButlandandGitHub 5d6f4f2135 Dependencies: Update dotnet sdk and node development dependency to latest secure version of current major (13) (#20729)
Update dotnet sdk and node development dependency to latest secure version of current major.
2025-11-05 21:24:27 +01:00
Sven GeusensandAndy Butland 21520eebd6 Webhooks: Register OutputExpansionStrategy for webhooks if Delivery API is not enabled (closes #20272 for 13) (#20721)
V13 implementation off #20559 (Webhooks: Register OutputExpansionStrategy for webhooks if Delivery API is not enabled)
2025-11-03 19:11:05 +01:00
Sven GeusensandGitHub 87e20ceec6 Webhooks: Register OutputExpansionStrategy for webhooks if Delivery API is not enabled (closes #20272 for 13) (#20721)
V13 implementation off #20559 (Webhooks: Register OutputExpansionStrategy for webhooks if Delivery API is not enabled)
2025-11-03 19:10:14 +01:00
Laura NetoandGitHub f7b874d3ef Dependency track for V13 pipeline (#20702)
* Dependency track for V13 pipeline

* Rename bom-backend to bom-build
2025-10-31 16:03:14 +01:00
ArjanandAndy Butland dedc77c883 Backoffice Caching: Added cache buster for block list stylesheets (closes #20683) (#20686)
Fixed, added cache buster to Block List Editor stylesheets
2025-10-30 16:24:33 +01:00
ArjanandGitHub 8110b80318 Backoffice Caching: Added cache buster for block list stylesheets (closes #20683) (#20686)
Fixed, added cache buster to Block List Editor stylesheets
2025-10-30 16:23:37 +01:00
Andy Butland 9de905cba3 Bumped version to 13.13.0-rc. 2025-10-29 08:02:54 +01:00
Andy ButlandandGitHub 802fa70154 Notifications: Populate IncludeDescendants on ContentPublishedNotification when publishing branch (#20578)
Populate IncludeDescendants on ContentPublishedNotification when publishing branch.
2025-10-22 13:23:19 +02:00
bhcoderandGitHub ebf397702d Grid (Legacy): Fix for RTE drag and drop issue (closes #16591) (#20498)
* #16591- Fix RTE drag and drop issue in Grid Layout (Legacy)

* Change case for variable
2025-10-14 16:07:54 +02:00
388e5f9239 Dependencies: Fixed dependency conflicts when installing Microsoft.EntityFrameworkCore.Design (closes #17839) (#20480)
* Add explicit references to Microsoft.CodeAnalysis.* packages to fix conflicts when installing Microsoft.EntityFrameworkCore.Design

* Disable CPM for UI project to better reflect consumers

* Update src/Umbraco.Infrastructure/Umbraco.Infrastructure.csproj

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

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-13 11:19:32 +02:00
Andy Butland d20cdd4930 Merge branch 'v13/dev' of https://github.com/umbraco/Umbraco-CMS into v13/dev 2025-10-09 07:58:28 +02:00
Andy Butland a604b2053e Merge branch 'release/13.11' into v13/dev
# Conflicts:
#	version.json
2025-10-09 07:58:11 +02:00
Andy Butland c177c305ba Bumped version to 13.11.0. 2025-10-09 06:40:37 +02:00
e840a0c7c4 Do not convert calculated lockedOutUntil time to UTC (#17007)
* Do not convert calculated lockedOutUntil time to UTC

* Handle conversion to UTC when we know we have server time values in IdentityMapDefinition for members.

---------

Co-authored-by: Andy Butland <abutland73@gmail.com>
2025-10-08 16:15:36 +02:00
c9d5c7f95b Repositories: v13 UserService.GetAllInGroup fix (#20425)
* Fix: Used FetchByGroups to batch queries to stop SQL limit bug

* Tidied up indentation.

---------

Co-authored-by: Andy Butland <abutland73@gmail.com>
2025-10-08 13:44:32 +00:00
Andy ButlandandGitHub 4c9d02e90b Configuration: Fixed integer overflow in setting MaxRequestBodySize and MultipartBodyLengthLimit (#20348)
Fixed integer overflow in setting MaxRequestBodySize and MultipartBodyLengthLimit.
2025-10-02 13:34:47 +02:00
Andy Butland d39395a1ff Bump version to 13.11.0-rc2. 2025-10-02 09:51:12 +02:00
Andy Butlandandkjac d45ddc315a Caching: Fixes regression of the caching of null representations for missing dictionary items (#20344)
* Fixed regression with handling of null representation in cache.

* Added integration test to verify behaviour.

* Use helper methods.

* Amend tests so they verify that cached null values are also removed

---------

Co-authored-by: kjac <kja@umbraco.dk>
2025-10-02 09:50:07 +02:00
7d87ce35bc Caching: Fixes regression of the caching of null representations for missing dictionary items (#20344)
* Fixed regression with handling of null representation in cache.

* Added integration test to verify behaviour.

* Use helper methods.

* Amend tests so they verify that cached null values are also removed

---------

Co-authored-by: kjac <kja@umbraco.dk>
2025-10-02 07:46:40 +00:00
mcl-szandGitHub d4805faee7 Prevent RTE being marked as dirty when content contains empty paragraph (#20335)
Prevent RTE being marked as dirty when content containt empty paragraph

In Tinymce, an empty paragraph is marked with a non-breaking space character.
When saving the content, the DOMParser replaces this empty non-breaking space character with an &nbsp; entity.
This causes the editor to always be dirty when the content contains an empty paragraph.
By making these the same befor the comparison, this is prevented.
2025-10-01 16:05:57 +02:00
3deccdbcf3 Dependencies: Update ImageSharp to latest patch releases (13) (#20275)
Update ImageSharp dependencies.

Co-authored-by: Kenn Jacobsen <kja@umbraco.dk>
2025-09-29 08:09:01 +00:00
9ad24ac2a7 [v13] Media Picker: implement paging using getPagedChildren (no server changes) (#20202)
* Avoid throwing an exception on getting references when migrating content with changed data types.

* Revert and handle exception at the consumer side

* Clean up

* Fix issue 12364

fix bug for Media Picker is slow when you have a large number of images at the root folder #12364

* Revert "Fix issue 12364"

This reverts commit 4d867345eb.

* Media Picker: use getPagedChildren with paging & sorting

Replaces folder view calls to entityResource.getChildren with
entityResource.getPagedChildren in MediaPickerController.

- Adds orderBy/Direction and increases default pageSize to 200
- Resets pagination when entering folders or clearing search
- Updates changePagination to work for both search and folder views
- Keeps legacy behaviour for searchMedia (no breaking server changes)

* Update mediapicker.controller.js

* Update mediapicker.controller.js

* Update mediapicker.controller.js

* Update mediapicker.controller.js

* Fix default values for paging.

* Refactor Media Picker controller: simplify pagination and clarify comments

- Removed unnecessary helper methods (pickPositive / pickNonNegative) and assign pagination values directly,
  as backend always provides valid positive/ non-negative numbers.
- Renamed or removed review-only comments to keep codebase clean.
- Clarified purpose of resetting `vm.searchOptions.filter` to explain why the filter is cleared after loading items.
- Adjusted indentation and minor formatting for consistency.

* Media Picker: fix lost paging on reopen by chaining navigation promises

Ensures the Media Picker always loads a paged result when restoring the last
visited folder.

- run(), ensureWithinStartNode(), gotoStartNode(), and gotoFolder() now return
  and chain the same promise flow.
- gotoFolder() resolves path → sets current folder → resets pagination →
  calls getChildren() (which uses getPagedChildren).
- Fixed cases where reopening the picker showed all items with no pager.
- Kept existing UX: filter is cleared on folder navigation to start unfiltered.
- Minor indentation/formatting cleanups.

* Tidied up indentation.

---------

Co-authored-by: Andy Butland <abutland73@gmail.com>
Co-authored-by: Kenn Jacobsen <kja@umbraco.dk>
2025-09-26 07:34:15 +00:00
Andy Butland 0751728b05 Merge branch 'release/13.10.1' into release/13.11
# Conflicts:
#	version.json
2025-09-23 07:08:09 +02:00
Andy Butland e504011b76 Merge branch 'release/13.10.1' into v13/dev
# Conflicts:
#	version.json
2025-09-23 07:06:44 +02:00
Andy ButlandandGitHub 4d9ea1e2e3 Property editors: Ensure values no longer allowed as options in checkbox list configuration are removed from the value, such that they will be removed from the persisted data when saved (#20208)
Ensure values no longer allowed as options in checkbox list configuration are removed from the value, such that they will be removed from the persisted data when saved.
2025-09-22 10:48:36 +02:00
6796829908 Querying extensions: Allow ContentAtRoot() to accept culture (#20129)
* Allow ContentAtRoot to accept culture

* Update comments about old TypedContentAtRoot

* Remove old method as new is optional parameter

* Change binary breaking change

* Obsolete methods

* Reverted to non-optional overloads.

* Used nullable string.

---------

Co-authored-by: Andy Butland <abutland73@gmail.com>
2025-09-22 08:27:41 +00:00
67f7d99696 Allow fetching multiple content and media by Guid and Udi (#15289)
* Allow fetching content by Guid and Udi

* Get media by Guid and Udi ids

* Fix array parameters

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

---------

Co-authored-by: Ronald Barendse <ronald@barend.se>
2025-09-20 18:56:55 +02:00
Rick ButterfieldandGitHub 27e3184550 Add support for UrlMode parameter in HtmlLocalLinkParser (#20200)
* Add support for `UrlMode` in `HtmlLocalLinkParser`

* Fix broken tests
2025-09-20 12:48:50 +02:00
Rick ButterfieldandGitHub c98fd7b219 UX: Fix overflow of umb-editor-header if the description is locked and too long (#20190)
Fix overflow of `umb-editor-header` if the description is locked and too long
2025-09-19 08:46:17 +02:00
Kenn JacobsenandGitHub 301be352ae Make notification service able to handle segmented content (#20160) 2025-09-17 06:51:10 +02:00
Andy Butland 7c180f6e4f Merge branch 'v13/dev' of https://github.com/umbraco/Umbraco-CMS into v13/dev
# Conflicts:
#	src/Umbraco.Core/Models/DeliveryApi/IApiContentRoute.cs
2025-09-16 12:22:58 +02:00
e119186e34 Avoid throwing an exception on getting references when migrating content with changed data types (#20079)
* Avoid throwing an exception on getting references when migrating content with changed data types.

* Revert and handle exception at the consumer side

* Clean up

---------

Co-authored-by: Kenn Jacobsen <kja@umbraco.dk>
2025-09-16 09:58:07 +00:00
Kenn JacobsenandGitHub a282002c30 Support querystring and anchor for local links in Delivery API output (#20142)
* Support querystring and anchor for local links in Delivery API output

* Add default implementation for backwards compat

* Add default implementation for backwards compat (also on the interface)

* Fix default implementation
2025-09-16 08:25:22 +02:00
Andy Butland a2c36d602f Bump version to 13.10.1. 2025-09-16 07:55:33 +02:00
Andy Butland a45917f132 Update Smidge dependencies. 2025-09-16 07:54:56 +02:00
Andy Butland fe358b8eab Merge branch 'v13/bugfix/18475-locallinks-parsing' of https://github.com/umbraco/Umbraco-CMS into v13/dev 2025-09-16 06:47:56 +02:00
kjac 60f84f7378 Support querystring and anchor for local links in Delivery API output 2025-09-15 19:54:00 +02:00
Andy ButlandandGitHub 45f7b7ad98 Retain original backoffice location on login after timeout (#19984)
Retain original backoffice location on login after timeout.
2025-09-15 17:53:17 +00:00
85aa6d3b57 Add Arabic (ar) backoffice translation (#19896)
* feat: Add Arabic (ar) backoffice translation

* Make Arabic language general until having special words for other
countries.

* Corrected the language header

---------

Co-authored-by: Andy Butland <abutland73@gmail.com>
2025-08-15 09:06:51 +00:00
Andy Butland 33e201c4b5 Merge branch 'release/13.10' into v13/dev
# Conflicts:
#	version.json
2025-08-14 09:48:50 +01:00
Andy Butland c2890e15c3 Bumped version to 13.10.0 2025-08-14 07:39:22 +01:00
784e09e240 Use a regex to filter our invalid culture codes rather than relying on the culture being installed on the operating system (#19821)
* Use a regex to filter our invalid culture codes rather than relying on the culture being installed on the operating system.

* Update to more restrictive regex

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

---------

Co-authored-by: Nuklon <Nuklon@users.noreply.github.com>
2025-08-06 10:34:08 +02:00
214f3fbc64 Umbraco Engage UmbracoUrlAlias Fix - Fixes #19654 (#19827)
* Fixes #19654

Adds the propertyAlias to the VariationContext so that products implementing the GetSegment method are aware which propertyAlias it's being called for

* Re-implement original variation context for backwards compatibility

* Fixes hidden overload method

Ensures the `GetSegment` method overload is not hidden when a null `propertyAlias` is passed.

* Resolve backward compatibility issues.

* Improved comments.

---------

Co-authored-by: Andy Butland <abutland73@gmail.com>
2025-08-04 11:40:00 +02:00
b622e7e4fb Content picker search with start node configured not taking user start nodes into account (#19800)
* Fix users being able to see nodes they don't have access to when using the picker search

* Readability and naming improvements

* Additional fixes

* Adjust tests

* Additional fixes

* Small improvement

* Replaced the root ids with constants

* Update src/Umbraco.Web.BackOffice/Trees/MemberTreeController.cs

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

---------

Co-authored-by: Andy Butland <abutland73@gmail.com>
2025-08-01 11:50:14 +02:00
Andy Butland a352c42742 Merge branch 'release/13.9.3' into release/13.10
# Conflicts:
#	version.json
2025-07-29 07:17:06 +02:00
Andy Butland 8eff28b80c Merge branch 'release/13.9.3' into v13/dev
# Conflicts:
#	version.json
2025-07-29 07:16:23 +02:00
9f37db18d1 Merge commit from fork
Co-authored-by: kjac <kja@umbraco.dk>
2025-07-29 05:10:52 +02:00
0d94f8bfaf Fix issue with use of EF Core scopes within notification handlers (take 2 - handling scopes with a base parent) (#19797)
* Add integration tests that shows the problem

* Fix the problem and add explenation

* Improved comments slightly to help when we come back here!
Moved tests alongside existing ones related to scopes.
Removed long running attribute from tests (they are quite fast).

* Fixed casing in comment.

---------

Co-authored-by: Andy Butland <abutland73@gmail.com>
2025-07-25 13:09:27 +02:00
AaronandGitHub 509a2e18d0 The filter param should be urlencoded (#19774) 2025-07-23 11:54:22 +02:00
Andy Butland 22f748161a Bumped version to 13.11.0-rc. 2025-07-22 10:11:54 +02:00
Andy ButlandandGitHub 59ad07209b Retrieve only user external logins when invalidate following removal of backoffice external user login (#19766)
* Retrieve only user external logins when invalidate following removal of backoffice external user login.

* Improved variable name.
2025-07-22 07:50:05 +00:00
Kenn JacobsenandGitHub 67abecc252 Add defensive coding to the member application initializer (#19760) 2025-07-21 12:24:51 +02:00
Andy Butland ebd0017f6e Bumped version to 13.9.3. 2025-07-21 11:53:33 +02:00
Andy ButlandandGitHub 417f15197e Parse update date before sorting in media list view (#19711)
* Parse update date before sorting in media list view.

* Moved function placement.
2025-07-16 09:45:17 +01:00
ce40103c4f Add support for programmatic creation of property types providing the data type key (#19720)
* Add support for programmatic creation of property types providing the data type key.

* Add integration tests

---------

Co-authored-by: kjac <kja@umbraco.dk>
2025-07-15 13:57:48 +02:00
Andy ButlandandGitHub 2748fdfc48 Adds variation by the header name Accept-Language to the delivery API output cache policy (#19709)
* Adds variation by the header name Accept-Language to the develivery API output cache policy

* Removed obsolete constructor (not necessary as the class is internal).

* Introduce contants for header names.
2025-07-11 15:51:05 +02:00
Andy ButlandandGitHub 53cc663bde Register no-op implementation of IMemberPartialViewCacheInvalidator in headless setups (#19666)
* Register no-op implementation of IMemberPartialViewCacheInvalidator in headless setups.

* Tidied usings.
2025-07-08 15:40:53 +02:00
Andy ButlandandGitHub 13a2cd71c4 Clear member cache by older user name when member user name is updated. (#19672)
* Clear member cache by older user name when member user name is updated.

* Added unit test.
2025-07-07 14:01:36 +02:00
kowsandGitHub a60ccd389b #16772 partial fix backoffice redirect after login (#19663)
* #16772 partial fix backoffice redirect after login

* #16772 partial fix backoffice OpenId redirect after login
2025-07-07 10:51:50 +02:00
Andy Butland fd95dc3915 Merge branch 'release/13.9.2' into v13/dev
# Conflicts:
#	version.json
2025-07-02 06:29:04 +02:00
Andy ButlandandGitHub 990e379ea8 Ensures that null values aren't used to create a CompositeStringStringKey (#19646)
Ensures that null values aren't used to create a CompositeStringStringKey.
2025-07-01 12:11:04 +00:00
1f5c21c631 Fix pagination in Content Delivery API Index Helper (#19606)
* Refactor descendant enumeration in DeliveryApiContentIndexHelper

Improved loop condition to allow for processing of more than 10.000 descendants for indexing.

* Add failing test for original issue.

* Renamed variable for clarity.

---------

Co-authored-by: Brynjar Þorsteinsson <brynjar@vettvangur.is>
Co-authored-by: Andy Butland <abutland73@gmail.com>
2025-07-01 08:11:00 +02:00
Kenn JacobsenandGitHub b4144564c8 Merge commit from fork 2025-06-24 08:39:17 +02:00
4ad18dc963 Preserve word boundaries when indexing RTE content with <br> tags (#19540)
* Preserve word boundaries when indexing RTE content with <br> tags

Replace <br> tags with spaces before HTML stripping to prevent word
concatenation in Examine index. Fixes issue where "John Smith<br>Company ABC"
was indexed as "John SmithCompany ABC" instead of "John Smith Company ABC".

- Add regex to replace <br> variants with spaces in RichTextPropertyIndexValueFactory
- Handles <br>, <br/> with spaces and attributes
- Maintains existing StripHtml() behavior for all other HTML tags

* Added unit test with test cases for expected index values

* Regex tweak to avoid matches on <break> <branything> etc

* Tweaked tests as per PR feedback

* Update tests/Umbraco.Tests.UnitTests/Umbraco.Core/PropertyEditors/RichTextPropertyIndexValueFactoryTests.cs

Updated tests

Co-authored-by: Kenn Jacobsen <post@kennjacobsen.dk>

* Tweaked test expectations

---------

Co-authored-by: Emma Garland <emma.garland@rocksolidknowledge.com>
Co-authored-by: Emma L Garland <emmagarland77@gmail.com>
Co-authored-by: Kenn Jacobsen <post@kennjacobsen.dk>
2025-06-23 09:34:51 +00:00
Andy Butland 881535af7d Merge branch 'v13/dev' into v13/main 2025-06-13 07:20:11 +02:00
Laura NetoandGitHub 1e66fb6ab3 Add a warning to the CreateContentFromBlueprint method xml docs (#19542)
Add a remark to `ContentService.CreateContentFromBlueprint`
2025-06-13 07:15:19 +02:00
Andy Butland e1b9e5efad Merge branch 'release/13.9.1' into v13/dev
# Conflicts:
#	version.json
2025-06-10 09:56:08 +02:00
Andy Butland f6dbe0f33e Bumped version to 13.9.2. 2025-06-10 08:33:39 +02:00
Andy ButlandandGitHub 28570b43e8 Fix issues with removal of user logins on change to external login provider configuration (13) (#19511)
* Ensure to delete related tokens when removing logins for removed external login providers.
Ensure to avoid removing logins for members.

* Applied suggestions from code review.

* Removed unnecessary <= check.
2025-06-10 08:19:52 +02:00
Andy Butland a01382d756 Merge branch 'release/13.9' into v13/dev 2025-06-05 10:00:12 +02:00
Andy Butland 1d6e7f15b9 Bumped version to 13.9.1. 2025-06-05 07:47:57 +02:00
Andy Butland 97cc3ca581 Bumped version to 13.9.0. 2025-06-05 06:24:08 +02:00
Sven GeusensandGitHub 0bcae3e87b Fix null member edgecase (#19463) 2025-06-03 03:32:03 +00:00
ebd228c3d7 Ensure tag operations are case insensitive on insert across database types (#19439)
* Ensure tag operations are case insensitve on insert across database types.

* Ensure tags provided in a single property are case insensitively distinct when saving the tags and relationships.

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

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

* Handle case sensitivity on insert with tag groups too.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-05-30 09:05:22 +02:00
Andy ButlandandGitHub 4b83a74bdb Resolved exception thrown from NuCache locking mechanism on near-simultaneous content publish requests (#19434)
* Removed the check before the wait that threw the recursive lock exception.
Added additional check to ensure we don't release a lock that's already released.

* Removed unnecessary check on releasing the lock.
2025-05-28 14:33:47 +02:00
Rowan BottemaandGitHub b348b84b63 Lock appropriate tree for media operations (#19422)
The MediaService currently locks the ContentTree for GetPagedOfType(s) operations, but it's querying the MediaTree. This ensures we lock the correct tree.
2025-05-27 06:51:30 +02:00
Andy Butland 7f4a8d5974 Merge branch 'v13/dev' into v13/main 2025-05-27 06:49:05 +02:00
Andy ButlandandGitHub 4d8ca457ec Removes unnecessary newlines from rich text as JSON delivery API output (#19391)
* Removes unnecessary newlines from rich text as JSON delivery API output.

* Fix case from PR feedback.
2025-05-23 12:19:43 +02:00
Andy ButlandandGitHub d677e948f1 Fix issue with requests to delivery API by path where URL segment contains special characters (#19390)
Fix issue with requests to delivery API by path where URL segment contains special characters.
2025-05-23 09:41:15 +02:00
Andy Butland d4e6af50bd Merge branch 'release/13.9' into v13/dev 2025-05-22 10:15:39 +02:00
Andy Butland c609cafa9b Fixed check for navigation to list after delete of member (#19364)
Fixed check for navigation to list after delete of member.
2025-05-22 10:14:52 +02:00
Andy ButlandandGitHub 5556b0fe0c Fixed check for navigation to list after delete of member (#19364)
Fixed check for navigation to list after delete of member.
2025-05-22 10:13:31 +02:00
Andy Butland eee04f4703 fix: check for NullRepresentationInCache in AppCacheExtensions (#19350)
* fix: add appcache null check

* Moved constant into standard location.
Removed now unnecessary comment.

---------

Co-authored-by: Andy Butland <abutland73@gmail.com>
# Conflicts:
#	src/Umbraco.Core/Cache/AppCacheExtensions.cs
#	src/Umbraco.Core/Constants-Cache.cs
2025-05-22 08:58:37 +02:00
127c6c4b53 Optimize the member save as part of the member login process, by-passing locking and audit steps and handling only the expected update properties (#19308)
* Optimize the member save as part of the member login process, by-passing locking and audit steps and handling only the expected update properties.

* Added unit test to verify new behaviour.

* Update src/Umbraco.Infrastructure/Security/MemberUserStore.cs

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

* Updates from code review.

* Improved comments.

* Add state information to notification indicating whether a member is saved via only the update of login properties.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Migaroez <geusens@gmail.com>
2025-05-20 15:27:42 +01:00
7d6a1e54e6 Optimize the member save as part of the member login process, by-passing locking and audit steps and handling only the expected update properties (#19308)
* Optimize the member save as part of the member login process, by-passing locking and audit steps and handling only the expected update properties.

* Added unit test to verify new behaviour.

* Update src/Umbraco.Infrastructure/Security/MemberUserStore.cs

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

* Updates from code review.

* Improved comments.

* Add state information to notification indicating whether a member is saved via only the update of login properties.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Migaroez <geusens@gmail.com>
2025-05-20 13:21:23 +00:00
David ChallenerandGitHub 8433b2b637 User invite email fails if visited more than once without completing (#17901)
Don't change securitystamp until user created
2025-05-14 10:03:53 +01:00
87b2153794 Adds support for retrieval of data type references when data type is routed using a GUID (#19184)
* Adds support for retrieval of data type references when data type is routed using a GUID.

* Fixed typos in comments.

* Use IIdKeyMap to resolve ID instead of fetching datatype

* Use IDKeyMap instead

---------

Co-authored-by: mole <nikolajlauridsen@protonmail.ch>
2025-05-14 10:54:00 +02:00
Andy ButlandandGitHub 0fc5b2a95c Avoids unnecessary additional domain save notification publishing when sorting an already sorted collection of domains (#19106)
Avoids unnecessary additional domain save notification publishings when sorting an already sorted collection of domains.
2025-05-14 10:25:49 +02:00
Andreas ZerbstandGitHub 6c2f93e85d V13 QA Updated linux test images to match actual (#19309)
Updated linux images
2025-05-14 07:19:32 +00:00
4f1604fea1 V13/bugfix/partial cache (#19314)
* Make sure that each optional section of the cachekey always starts and ends with a -

* Move secondary logic of clearing the membercaches into its own replacable class

* Regsiter the new implementation

* Add a mock to the integration tests as appCaches are disabled

* Added header comments to components.

* Refactored cache key into a method and exposed for testing.
Added unit tests to verify behaviour.

* Verified also that regex matches only the supplied member and asserted on the key itself.

---------

Co-authored-by: Andy Butland <abutland73@gmail.com>
2025-05-14 08:46:07 +02:00
059766291b Fix for block grid styling regression issue #15973 (#19014)
Co-authored-by: Andy Butland <abutland73@gmail.com>
2025-05-13 06:36:20 +02:00
e471c1fc8b [V13] User notifications not sent correctly when having more than 400 users (#18370)
Co-authored-by: Vedran Antović <vedran.antovic@isatis.com>
Co-authored-by: Andy Butland <abutland73@gmail.com>
2025-05-13 06:35:42 +02:00
0fb91ef859 add single blocklist delete (#18073)
Co-authored-by: Andy Butland <abutland73@gmail.com>
2025-05-12 10:36:39 +00:00
Andy Butland c0a0a34cbb Backport variable name updates and fix found porting the invalidation of sessions after removal of external login provider to 16. 2025-05-09 14:57:08 +02:00
Andy ButlandandGitHub 3d44a6fdf9 Invalidate external login session on removal of provider (#19273) 2025-05-09 10:22:13 +00:00
0eee307622 Added custom RichTextRegexValidator to validate markup instead of JSON (#19045)
Co-authored-by: Migaroez <geusens@gmail.com>
2025-05-08 14:51:06 +02:00
6a4aa04b47 Handle existing RichTextEditorValue when parsing from markup or JSON structure (#19266)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-05-08 10:29:40 +02:00
643f073945 TimedScope improvements and login duration clean-up (#19243)
Co-authored-by: Andy Butland <abutland73@gmail.com>
2025-05-07 18:30:49 +02:00
Andy Butland 5ba40c65fc Merge branch 'release/13.8.1' into v13/dev
# Conflicts:
#	version.json
2025-05-06 07:13:40 +02:00
Andy Butland dcbbed4160 Fixed failures in unit tests. 2025-05-06 05:35:21 +02:00
Andy Butland e94e165593 Fixed pipeline definition. 2025-05-06 05:17:05 +02:00
Andy ButlandandGitHub 34709be6cc Merge commit from fork
* Backport user enumeration fix.

* Bump gitversion.

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

* Adds randomness to failed login duration.
2025-05-06 05:11:04 +02:00
83107bb31a Fix: #18421 - Added Max Length validation to PropertyTypeBasic Alias (#18427)
Co-authored-by: Daniel Nelson <daniel.nelson@cantarus.com>
2025-05-05 15:11:47 +02:00
Kenn JacobsenandGitHub 3caa43a5bf Fix root path regression for the Delivery API (#19216) 2025-05-03 15:26:20 +02:00
1efe860a89 V13: Clear Member Username Cache in Load Balanced Environments (#19191)
* Clear usernamekey

* Odd explaining comment

* Update src/Umbraco.Core/Cache/Refreshers/Implement/MemberCacheRefresher.cs

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

* Make UserNameCachePrefix readonly for better immutabilityly

* Move prefix to CacheKeys constants

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-04-29 18:03:28 +02:00
Andy Butland d49965549c Merge branch 'v13/contrib' into v13/dev 2025-04-29 14:26:00 +02:00
Dave WoestenborghsandGitHub 8d85259025 Upgrade examine to 3.7.1 (#19186) 2025-04-29 14:15:27 +02:00
Andreas ZerbstandGitHub 097d0456cc V13 QA updated pipeline for acceptance to avoid issue when installing playwright (#19140)
* Updated pipeline to install only the chromium browser

* Added junit as reporter for acceptance tests
2025-04-29 11:48:38 +00:00
mole a62fa93c77 Use windows agent for nuget push 2025-04-28 10:58:29 +02:00
Andy Butland a22dcf05f2 Merge branch 'v13/contrib' into v13/dev 2025-04-28 06:46:10 +02:00
afa6fa5ca2 attempted fix for Save and Preview button #15360 (#19138)
Co-authored-by: Navya Sinha <navya.sinha@method4.co.uk>
2025-04-25 21:28:46 +02:00
c6effef622 Handle file paths as not found in delivery API by route requests (#19063)
* Handle file paths as not found in delivery API by route requests.

* Move check earlier to handle redirect logic as well.

* Spelling: Changed "resolveable" to "resolvable"

---------

Co-authored-by: kjac <kja@umbraco.dk>
2025-04-22 06:46:33 +02:00
Andy Butland ab31fbb0aa Bump version to 13.8.1. 2025-04-17 11:14:17 +02:00
Andy Butland 7d9a2c6e70 Merge branch 'release/13.8.0' into v13/dev
# Conflicts:
#	version.json
2025-04-10 11:19:32 +02:00
Andy Butland a486d5df33 Bumped version to 13.8.0. 2025-04-10 07:38:20 +02:00
Andy Butland 3c8a621817 Merge branch 'v13/dev' into v13/contrib 2025-04-04 08:01:38 +02:00
Andy Butland 0e0aca55af Verify endpoint selection candidates with host attribute are ignored if request doesn't match the configured hosts. (#18820) 2025-04-04 06:54:56 +02:00
0f02584143 attempted fix for Datepicker v13 issue #16008 (#18903)
Co-authored-by: Navya Sinha <navya.sinha@method4.co.uk>
2025-04-04 03:52:48 +02:00
a3db45609a Move database cache rebuild to a background task with polling (13) (#18922)
* Converts rebuild database cache operation to submit and poll.

* Update src/Umbraco.Web.UI.Client/src/views/dashboard/settings/publishedsnapshotcache.controller.js

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

* Handle HTTP error in status retrieval.

* Fixed test build.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-04-03 21:58:56 +02:00
Andy ButlandandGitHub d60a2a217c Verify endpoint selection candidates with host attribute are ignored if request doesn't match the configured hosts. (#18820) 2025-04-03 21:13:45 +02:00
Andy Butland 3e9ff6b5cb Check we have matched a preview URL by ID when exiting preview. (#18841) 2025-04-03 10:39:47 +02:00
Andy ButlandandGitHub 05a7d337de Check we have matched a preview URL by ID when exiting preview. (#18841) 2025-04-03 10:32:27 +02:00
Jacob OvergaardandGitHub fdca086a47 build(deps): bump @umbraco-ui/uui from 1.12.2 to 1.13.0 (#18830) 2025-03-26 14:32:29 +00:00
Andreas ZerbstandGitHub 42a81beeac V13 hotfix sqlserver integration tests (#18744)
* Disabled encrypt

* Skips integration tests for SQl Server on releases

* Removed encrypt
2025-03-20 11:59:03 +01:00
Andy Butland 9284b9e0b1 Make preview check for delivery API content case insensitive. (#18731) 2025-03-20 06:58:57 +01:00
Andy ButlandandGitHub eb91f4fef4 Make preview check for delivery API content case insensitive. (#18731) 2025-03-20 06:53:43 +01:00
Andy Butland 68acc2aa51 Bumped version to 13.9.0-rc. 2025-03-19 16:39:34 +01:00
Andy ButlandandGitHub 5570583f70 Fixes issue with macro rendering in an RTE when GUIDs are used for backoffice document routes (#18691)
* Fixes issue with macro rendering in an RTE when GUIDs are used for backoffice document routes.

* Fixed null reference error.
2025-03-18 11:10:23 +01:00
Andy ButlandandGitHub eb979625d1 Render folders before files in static files picker. (#18701) 2025-03-18 11:05:54 +01:00
Andy ButlandandGitHub e1e5f527e4 Updates dependency on Examine to 3.7. (#18676) 2025-03-17 09:13:09 +01:00
Lan Nguyen ThuyandJacob Overgaard f016dbd223 Fix issue text overflow when user name is too long 2025-03-13 11:07:57 +01:00
Andy Butland b2aa04ae1a Merge branch 'release/13.7.2' into v13/dev
# Conflicts:
#	version.json
2025-03-12 12:18:45 +01:00
Andy ButlandandGitHub e270adc50f Reverts UI updates from publish with desdendants dialog. (#18647) 2025-03-12 08:10:34 +01:00
Andy Butland fd5b8de533 Bumped version to 13.7.2 2025-03-12 07:25:35 +01:00
Andy Butland e3d9b042c2 Avoids collection was modified issue when flowing identities to the authenticated user's principal. (#18527) 2025-03-12 07:24:50 +01:00
Andy Butland f4ae796b30 Merge branch 'v13/dev' of https://github.com/umbraco/Umbraco-CMS into v13/dev 2025-03-11 09:18:25 +01:00
Andy Butland 367d0386b6 Merge branch 'release/13.7.1' into v13/dev
# Conflicts:
#	version.json
2025-03-11 09:18:12 +01:00
5b54bed406 Merge commit from fork
* Fixed parsing of node if in content and media permission querystring handlers to retrieve expected value when multiple are provided in the querystring.

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

* Bumped version to 13.6.1.

* 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
Anders BjernerandMichael Latouche d3b60277d7 Fixed typo in TinyMCE's da.js 2025-03-10 15:38:50 +01:00
twoday-rolandkockandAndy Butland 2ec6ff4ebc bumped imagesharp to prevent CVE-2025-27598 (#18602) 2025-03-09 08:43:52 +01:00
twoday-rolandkockandGitHub 78a8d017a2 bumped imagesharp to prevent CVE-2025-27598 (#18602) 2025-03-09 08:41:06 +01:00
1a205d8727 Handle multiline statements in migrations (#18478)
* Handle multiline statements in migrations

* Fixed failing unit tests and incorrect obsoletion.

* Fixed failing integration tests.

* Applied suggestion from code review.

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
2025-03-04 17:27:33 +01:00
Andy ButlandandGitHub 396b5ea211 Avoids collection was modified issue when flowing identities to the authenticated user's principal. (#18527) 2025-03-04 12:12:29 +01:00
Andy ButlandandGitHub 3cf9099f56 Remove version from models builder generated code header when configured to do so. (#18501) 2025-03-04 11:52:20 +01:00
Andy Butland 451b5f96e7 Use windows for build agent to avoid hanging issues with Linux. 2025-02-28 06:57:35 +01:00
Andy Butland 15ebae5025 Bumped version to 13.7.1. 2025-02-28 06:57:00 +01:00
Andy Butland 32bfbadb8e Merge branch 'release/13.7.0' into v13/dev
# Conflicts:
#	version.json
2025-02-27 06:47:15 +01:00
Kenn JacobsenandGitHub 5ed09ebefa Backport ShowUnroutableContentWarnings to V13 (#18479) 2025-02-26 20:13:27 +01:00
Andy Butland eaea7a67ba Bump version to 13.7.0. 2025-02-26 08:14:26 +01:00
Andy ButlandandGitHub de2114b8c5 Adds warning to publish descendants dialog when force re-publish is selected. (#18409) 2025-02-22 09:39:58 +01:00
Andy ButlandandGitHub 64607ddbaa Disable webhook firing if disable in configuration. (#18383) 2025-02-19 12:17:04 +01:00
Andy ButlandandGitHub db1d999721 Avoid exception when attempting to find member by Id when Id is not an expected Guid or integer, as can be the case with external member providers. (#18320) 2025-02-17 12:47:52 +01:00
Andy ButlandandGitHub 18047a7cfb Only filter post retrieval of entities for start nodes if working with entities that support start nodes. (#18287) 2025-02-17 12:45:51 +01:00
Andy ButlandandGitHub def7ebd48c Html encodes the user's name in the invite email. (#18343) 2025-02-17 12:25:12 +01:00
8c2b1ebdc5 V13: Introduce publishNotifications method on IMembershipMemberService (#18207)
* Introduce publishNotifications method on IMembershipMemberService.cs

* Fix test

* Add PublishNotificationSaveOptions

* Fix up according to comments

* Use numeric values for flag enum

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

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

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

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

---------

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

* Added integration task verifying updated behaviour.

* Variant integration test.

* Update test data controller.

* Remove usued function parameters.

* Refactor to enum.

* Fixed flags enum.

* Variable name refactor.

* Applied changes from code review.

* Refactored method name.

* Aligned js boolean checks.
2025-02-12 11:30:27 +00:00
Andy Butland 5322d0f7b5 Bumped version to 13.8.0-rc. 2025-02-12 08:13:58 +01:00
Andy ButlandandGitHub a282cc5691 Backport use of thread delay over sleep and handle dispose in FileSystemMainDomLock (#18151)
* Backport use of thread delay over sleep and handle dispose in FileSystemMainDomLock (from PRs #18119 and #18147)

* Applied suggestion from code review.
2025-02-12 08:06:50 +01:00
Andy ButlandandGitHub 048f8bcdf9 Fixed userResource request to get all users. (#18105) 2025-02-11 17:06:18 +01:00
Andy ButlandandGitHub 7bcbc748d4 URL encodes member user names when passing information for public access setting such that those with user names as emails containing a plus will be included in the rule. (#18142) 2025-02-11 13:36:19 +01:00
Andy ButlandandGitHub f30e6cfe7f Prevents folder selection in media picker when used from the multi URL picker. (#18288) 2025-02-11 09:18:01 +01:00
Andy ButlandandGitHub 026e80e026 Avoid an exception on sign out when the principal is populated from an incomplete external login (#18078)
* Avoid an exception on signout when the principal is populated from an incomplete external login.

* Tidied up comment.
2025-02-10 12:51:35 +01:00
Andy ButlandandGitHub a3b77cff63 Add validation to prevent update of a user or member to an invalid username (13) (#18261)
* Add validation to prevent update of a user or member to an invalid username.

* Avoid password manager updates of user name field on user details screen.
2025-02-10 10:40:53 +01:00
Niels LyngsøandGitHub 4ca68d6995 Add client-side validation for RTE (#18257) 2025-02-07 11:43:04 +00:00
Sven GeusensandGitHub 280cb7f2b1 Fix issues in newly added buttongroup localization (#18254)
* Fix #18253 nullref exception

* Fix #18239 by listening to broader scope changes
2025-02-07 07:00:34 +01:00
095a73132c Review: Allow Duplicate Email for Members (#16202)
* init

* Aligned default values on security settings.

* Added validator for security settings.

* Provide default implementation for get members by email.

* Refactored constructor of MemberController.

* Validate on unique member email only when configured to do so.

* Further code tidy and use of DI in constructor.

* Used new constructor in tests.

* Add unit test for modified behaviour.

* Removed validator for security settings (it's not necessary, I got confused with users and members).

* Spelling.

---------

Co-authored-by: Andy Butland <abutland73@gmail.com>
2025-02-05 12:38:40 +01:00
Andy Butland cfb0fc23ac Merge branch 'v13/dev' into v13/contrib 2025-02-04 12:35:49 +01:00
6620aca9fe Cache null dictionary values by key (#15576)
* Add CacheNullValues option to RepositoryCachePolicy

* Cache null values in DictionaryByKeyRepository

* Fixed issue with nullable reference.

* Updated logic for caching of null values.

* Update src/Umbraco.Infrastructure/Cache/DefaultRepositoryCachePolicy.cs

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

* Made the NullValueRepresentation overwritable in a generic manner

* Improve generic NullValueCachePolicyResolver

* Revert Commits and clarify logic with comment

This reverts commit 8befb43792 "Improve generic NullValueCachePolicyResolver"
Also reverts 8adf0a2 - Made the NullValueRepresentation overwritable in a generic manner
And 8adf0a2 - Made the NullValueRepresentation overwritable in a generic manner

* Update src/Umbraco.Infrastructure/Cache/DefaultRepositoryCachePolicy.cs

---------

Co-authored-by: Andy Butland <abutland73@gmail.com>
Co-authored-by: Sven Geusens <geusens@gmail.com>
Co-authored-by: Sven Geusens <sge@umbraco.dk>
2025-02-04 12:29:21 +01:00
2422a02b23 Set Smidge cachebuster type (#18198)
* Set Smidge cachebuster type

* Amend exception and fix typo

* Minor tweak to comment and exception message.

---------

Co-authored-by: Simon Hartfield <simon.hartfield@googlemail.com>
Co-authored-by: Andy Butland <abutland73@gmail.com>
2025-02-04 11:00:44 +00:00
b4a9dc0770 V13: Fix members while using basic auth. (#18206)
* Flow additional identities to new principal

* Add extension to more easily get member identity

* Ensure the member is used instead of the backoffice user in `MemberManager`

* Update snippet

* Fix the comment that I broke

* Update src/Umbraco.Web.Common/Extensions/MemberClaimsPrincipalExtensions.cs

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

---------

Co-authored-by: Andy Butland <abutland73@gmail.com>
2025-02-03 19:48:08 +01:00
Andy ButlandandGitHub e7411244fd Show notifications menu only to users with permission for the feature. (#18184) 2025-02-03 13:24:58 +01:00
Kenn JacobsenandGitHub 9f357173c3 Enforce user start nodes for media uploads through the RTE (#18204) 2025-02-03 12:50:23 +01:00
Andy Butland 7dc6e3ed5b Merge branch 'v13/dev' into v13/contrib 2025-01-31 16:16:22 +01:00
Gareth WrightandGitHub 5dfff212d0 Update auth.element.ts (#18192)
auth_username => general_username
2025-01-31 14:59:25 +01:00
17615f966b Fix out of memory of 2gb+ (max 4gb) error introduced by #14657 SVG xss security fix (#17421)
Co-authored-by: Andy Butland <abutland73@gmail.com>
2025-01-31 13:46:56 +00:00
Kenn JacobsenandGitHub 7a2d6b6c63 More robust resolving of Delivery API redirects (#18160) 2025-01-31 14:26:07 +01:00
Sven Geusens 343867f6ee Merge branch 'release/13.6' into v13/dev and version bump
# Conflicts:
#	src/Umbraco.Web.BackOffice/Controllers/PreviewController.cs
#	version.json
2025-01-30 16:27:49 +01:00
Bjarke BergandSven Geusens b9837ac77c Optimize Azure pipeline (#17674)
* Only fetch single commit

* Hopefully fixes Nerdbank.GitVersioning.GitException: Shallow clone lacks the objects required to calculate version height. Use full clones or clones with a history at least as deep as the last version height resetting change.

* Do not checkout again

* More test pipeline

* Another attempt

* yet another attempt

* more attempts

* Revert "more attempts"

This reverts commit 5694d97ba6.

* Test without building backoffice and login explicitly

* Fix mem leak in integration tests

* Fixes sqlserver lock test
# Conflicts:
#	build/azure-pipelines.yml
2025-01-30 14:10:05 +01:00
Sven Geusens bb73ec6c68 Set release version 2025-01-30 09:52:50 +01:00
Andy ButlandandGitHub ee2d7bbb1b Excluded tags from trashed content (#18164) 2025-01-29 21:10:11 +01:00
Andy ButlandandGitHub 5d48bc7371 Provides an option to remove the inessential version number from the generated models (#18081)
* Provides an option to remove the inessential version number from the generated models.

* Clarified comment.
2025-01-29 13:33:49 +01:00
Kenn JacobsenandGitHub 59a4649528 Do not allow editing read-only properties by clicking their labels (#18152)
* Do not allow editing read-only properties by clicking their labels

* Simplify the fix :)

* Fix linting issue
2025-01-29 10:29:58 +01:00
Andy ButlandandGitHub f54b6033ab Added Resharper test assemblies to exclude list on TypeFinder. (#18145) 2025-01-29 10:27:17 +01:00
Jacob OvergaardandGitHub bf340cd7d4 fix: remove unused parameters and documentation (#18095)
this fixes an issue where unused parameters were published as supported, but they were in fact never supported.
2025-01-28 10:53:00 +00:00
Andy Butland 313417cb91 Tidied up XML header comment in ITagQuery. 2025-01-28 10:52:21 +01:00
7850078623 Redirect to the published URL when exiting preview (#18114)
Co-authored-by: Andy Butland <abutland73@gmail.com>
2025-01-24 18:46:28 +00:00
44bf3b77b3 Make it possible to reset media picker crops (#18110)
Co-authored-by: Andy Butland <abutland73@gmail.com>
2025-01-24 13:41:30 +00:00
Kenn JacobsenandGitHub 8485458896 Add clientside validation to webhook events (#18089) 2025-01-23 17:01:55 +01:00
Nikolaj Geisle 3d253f5f06 bump version 2025-01-23 11:15:26 +01:00
Nikolaj Geisle 64287d7e1a Merge branch 'release/13.5.3' into release/13.6
# Conflicts:
#	version.json
2025-01-23 11:14:47 +01:00
Andy ButlandandGitHub edc78a5a4c Handles migration case where an expected constraint is renamed but the constraint does not exist. (#18063) 2025-01-22 12:26:06 +01:00
1a18d6c035 Replaced deprecated navigator.platform with navigator.userAgent for platform detection. (#17373)
Co-authored-by: Niels Lyngsø <nsl@umbraco.dk>
2025-01-21 13:56:40 +01:00
Andy Butland 3e877182b5 Merge branch 'v13/contrib' into v13/dev 2025-01-21 09:47:20 +01:00
Martin VennevoldandGitHub 0e4f883bc1 Fix create child issue in list view with infinite editor (#13355). (#17637) 2025-01-21 09:44:22 +01:00
Andy Butland 265cc62ab8 Merge branch 'release/13.6' into v13/dev 2025-01-21 09:21:36 +01:00
Andy Butland 800c16970e Merge branch 'release/13.6' of https://github.com/umbraco/Umbraco-CMS into release/13.6 2025-01-21 09:20:11 +01:00
Andy Butland 6bd11bf233 Fixes failing front-end unit test to align with new behaviour from PR #17818 (
Allow skipSelect blueprints only when one blueprint exists).
2025-01-21 09:19:31 +01:00
Kenn Jacobsen a2fd82a3f3 Add NoopCurrentMemberClaimsProvider so Umbraco can boot without the Delivery API enabled (#18049) 2025-01-21 09:13:31 +01:00
Kenn JacobsenandGitHub 7567990da1 Add NoopCurrentMemberClaimsProvider so Umbraco can boot without the Delivery API enabled (#18049) 2025-01-21 09:10:43 +01:00
Zeegaan c7d157bbfd build on ubuntu 2025-01-21 09:02:00 +01:00
Nikolaj Geisle 2161edb871 Bump version 2025-01-21 07:41:06 +01:00
Nikolaj Geisle e77e9c5691 Format sql statement (#17354)
(cherry picked from commit aa9f194d76)
2025-01-20 18:27:54 +01:00
Nikolaj Geisle e934a943b5 build on windows 2025-01-20 17:37:04 +01:00
Andy ButlandandGitHub 95eb58587b Merge commit from fork 2025-01-20 14:14:28 +01:00
25628a8b76 Lucene Package Update to Address CVE-2024-43383 (#17942)
* Update Lucene Package to 4.8.0-beta00017

* Add Package Reference

---------

Co-authored-by: Sebastiaan Janssen <sebastiaan@umbraco.com>
2025-01-20 11:45:35 +01:00
Callum WhyteandAndy Butland 7552e315fb Allow skipSelect blueprints only when one blueprint exists (#17818) 2025-01-20 11:45:26 +01:00
Callum WhyteandGitHub d15b5b221e Allow skipSelect blueprints only when one blueprint exists (#17818) 2025-01-20 10:27:54 +01:00
60e3fa97a9 Lucene Package Update to Address CVE-2024-43383 (#17942)
* Update Lucene Package to 4.8.0-beta00017

* Add Package Reference

---------

Co-authored-by: Sebastiaan Janssen <sebastiaan@umbraco.com>
2025-01-20 10:04:02 +01:00
Sven Geusens fd1bd51aff bump version 2025-01-16 10:10:04 +01:00
Sven Geusens b12620af9c Merge branch 'release/13.6' into v13/dev 2025-01-16 10:08:43 +01:00
Sven Geusens d1af59fdf0 Merge branch 'v13/dev' into release/13.6 2025-01-15 22:13:42 +01:00
Andreas ZerbstandGitHub 1b050ebc47 V13 QA added parallelization for E2E tests (#17995)
* Added script for running tests

* Added parallelization for our E2E tests

* Removed line

* Removed condition
2025-01-15 22:12:45 +01:00
Sven Geusens ff3e457c58 Merge branch 'v13/dev' into release/13.6 2025-01-15 20:55:41 +01:00
Andy ButlandandGitHub 2ffaede07b Added a maxlength setting to the regular expression pattern field. (#17982) 2025-01-15 20:54:54 +01:00
Sven GeusensandGitHub 2a83f57262 Do not re-map schedule modal on error as it leads to broken bindings (#17990) 2025-01-15 17:35:23 +01:00
Kenn JacobsenandGitHub 5be9193978 Do not show "Save and preview" by default (#17986) 2025-01-15 15:42:37 +01:00
Niels LyngsøandSven Geusens d3f264fc54 Fix: only fire event when instance is available (issue 17847) (#17987)
* only fire event when instance is available

* avoid js issue when no markup
2025-01-15 14:01:33 +01:00
Niels LyngsøandGitHub 04ea002bf3 Fix: only fire event when instance is available (issue 17847) (#17987)
* only fire event when instance is available

* avoid js issue when no markup
2025-01-15 13:56:53 +01:00
Kenn JacobsenandGitHub 8f42a3a0ea Make the RTE handle inline elements gracefully for JSON (#17983) 2025-01-15 11:26:03 +01:00
Kenn JacobsenandGitHub 4dd8fbe25d Enforce the "Save and preview" button after when switching content app (#17985) 2025-01-15 09:55:00 +01:00
Sven GeusensandGitHub ee727c43e1 Added localizations for composite key of missing New (media) Audit item (#17981) 2025-01-14 21:08:47 +01:00
Jacob OvergaardandGitHub 395213946b build(deps): update @microsoft/signalr from 7.0.12 to 8.0.7 (#17973) 2025-01-14 15:44:52 +00:00
Andy ButlandandGitHub ed0b236208 Resets send to approval dialog on close such that when re-opening the selection and operation can still be triggered. (#17956) 2025-01-14 16:25:26 +01:00
Kenn JacobsenandGitHub 8d56e75257 Add Vary header to all content API operations (#17962)
* Add Vary header to all content API operations

* Make attribute sealed
2025-01-14 15:54:19 +01:00
Jacob OvergaardandGitHub b3c27415d1 build(deps): bump @umbraco-ui/uui from 1.11.0 to 1.12.2 (#17972) 2025-01-14 15:48:34 +01:00
Justin NevilleandNikolaj Geisle 9839b0ee66 Fixes issue with the IVirtualPageController not setting PublishedRequest content via FindContent (#15121)
* Fixes issue https://github.com/umbraco/Umbraco-CMS/issues/12834

* Re-worked based on feedback

* Use dependency injection

* Only call new constructor

---------

Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
(cherry picked from commit fd9c1a0e9c)
2025-01-14 13:57:00 +01:00
f3f57f9748 Improve YSOD rendering in the client (#17940)
* Conditionally render error details and make sure something is rendered

* V13 QA updated locator for failing E2E test (#17825)

* Added timeouts

* Nullcheck user in Content permission handlers (#17846)

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
Co-authored-by: Niels Lyngsø <nsl@umbraco.dk>

---------

Co-authored-by: Andreas Zerbst <73799582+andr317c@users.noreply.github.com>
Co-authored-by: Niels Lyngsø <nsl@umbraco.dk>
2025-01-14 13:38:07 +01:00
Nikolaj GeisleandGitHub 85d16a4354 V13: Show validation error, when saving invalid media (#17961)
* Don't save invalid media

* Revert "Don't save invalid media"

This reverts commit c4b6acf542.

* Still allow save, but show validation error, not popup error

* Add clarifying comment
2025-01-14 11:18:36 +01:00
Kenn JacobsenandGitHub c0517c3562 Allow filtering for multiple content types (#17960) 2025-01-14 10:40:45 +01:00
92e535a1c9 V13 QA updated locator for failing E2E test (#17825)
* Added timeouts

* Nullcheck user in Content permission handlers (#17846)

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
Co-authored-by: Niels Lyngsø <nsl@umbraco.dk>
2025-01-14 09:12:41 +01:00
Kenn JacobsenandGitHub 7411c2552b Added integration test to verify the Delivery API contract (#17949) 2025-01-13 15:15:37 +01:00
Andy ButlandandGitHub f2410f376e Corrected property names and structure used in JSON schema generation for configuration of default data to install. (#17946) 2025-01-13 11:05:51 +01:00
Kenn JacobsenandGitHub a9313c1367 Make the Delivery API "ancestors" selector work with preview (#17938) 2025-01-13 07:47:14 +01:00
Nikolaj Geisleandkjac 5b3b9d770a V13: Add rcl files to static files tree (#17671)
* Refactor to use IWebhostEnvironment for wwwroot files.

* Obsolete ctor

* Add ActivatorUtiiliesConstructor

* Refactor logic to include folders

* Fix so we can see files in wwwroot/App_Plugins

* Cosmetic: Use invariant comparison for the "umbraco" folder".

---------

Co-authored-by: kjac <kja@umbraco.dk>
2025-01-09 10:02:34 +01:00
4a54215fa1 V13: Add rcl files to static files tree (#17671)
* Refactor to use IWebhostEnvironment for wwwroot files.

* Obsolete ctor

* Add ActivatorUtiiliesConstructor

* Refactor logic to include folders

* Fix so we can see files in wwwroot/App_Plugins

* Cosmetic: Use invariant comparison for the "umbraco" folder".

---------

Co-authored-by: kjac <kja@umbraco.dk>
2025-01-09 09:36:32 +01:00
Sven Geusensandnikolajlauridsen 52fbb34ddd Nullcheck user in Content permission handlers (#17846) 2025-01-07 15:07:42 +01:00
Sven GeusensandGitHub c96dc7eaa1 Nullcheck user in Content permission handlers (#17846) 2025-01-07 14:52:40 +01:00
Jacob Overgaard f19409ba5b Revert "bump version"
This reverts commit 679c42ef90.
2025-01-06 12:51:10 +01:00
Jacob Overgaard 679c42ef90 bump version 2025-01-06 12:46:03 +01:00
Elitsa MarinovskaandGitHub 3304c6f472 Enable anonymous calls to HandleLogout action (#17807) 2024-12-16 07:26:12 +01:00
Nikolaj GeisleandGitHub 34f09fa260 V13: Clear username cache (#17815)
* Clear member username cache on delete

* Also refresh cache on update
2024-12-16 08:18:30 +02:00
Jacob Overgaard fd4efd38cd Merge branch 'v13/dev' into release/13.6 2024-12-13 10:07:46 +01:00
Jacob Overgaard e4e9bfc3e9 bump version to 13.6.0-rc2 2024-12-13 09:58:13 +01:00
Jacob Overgaard 3774dbe38c Merge remote-tracking branch 'origin/v13/contrib' into v13/dev 2024-12-13 09:56:46 +01:00
Dan ListerandJacob Overgaard 4ef50642ad Fixed an issue where bold markdown would not work inside a property description 2024-12-13 09:53:36 +01:00
Bjarke BergandGitHub f95fb78022 Merge pull request #17800 from umbraco/v13/bugfix/corrupt-examine-dashboard
Make sure Examine dashboard still functions when an index is corrupt
2024-12-12 12:07:06 +01:00
Sven Geusens 0f9a8bde61 Broadend the error catching when building the examine dashboard 2024-12-12 09:38:35 +01:00
Sven Geusens 129d369c1a Version bump to release 2024-12-11 13:46:38 +01:00
Sven Geusens dd2c591a5b Merge branch 'release/13.6' into v13/dev 2024-12-11 13:45:35 +01:00
Kenn JacobsenandNikolaj Geisle 16749a724d Add (un)publishing details to TreeChange notifications (#17757)
(cherry picked from commit 404a62aa0b)
2024-12-09 11:42:53 +01:00
Kenn JacobsenandNikolaj Geisle a627930b58 Warn about un-routable content at publish time (#17705)
(cherry picked from commit 2d9cfc880b)
2024-12-09 11:42:46 +01:00
Kenn JacobsenandGitHub 404a62aa0b Add (un)publishing details to TreeChange notifications (#17757) 2024-12-09 11:36:48 +01:00
Kenn JacobsenandGitHub 2d9cfc880b Warn about un-routable content at publish time (#17705) 2024-12-09 11:07:32 +01:00
Kenn JacobsenandGitHub ee8bdfc4ac Add "user info" endpoint for the Delivery API (#17719)
* Add "user info" endpoint for the Delivery API

* Add comment about public and unsealed class
2024-12-09 09:57:21 +01:00
Bjarke BergandGitHub b55d484863 Updated NuGet Packages for v13 (#17704)
* Update nuget packages

* Cherry pick fixes from v15

* Fixed: Projects that use central package version management should not define the version on the PackageReference items but on the PackageVersion items

* rollback update in tool
2024-12-03 08:51:23 +01:00
Ronald BarendseandGitHub ed0058a503 Fix PanicException: failed to get child with id= after updating content types (#17702)
* Remove tree node from hierarchy after clearing branch

* Refactor ClearBranchLocked to split clearing child and siblings
2024-12-03 08:00:18 +01:00
Jacob OvergaardandGitHub b0aed393d6 fix: keep the lead char when editing an existing link (#17667) 2024-11-28 14:04:59 +00:00
Sven Geusens a1ea203281 Merge branch 'v10/dev' into v13/dev
# Conflicts:
#	src/Directory.Packages.props
#	src/Umbraco.Infrastructure/Manifest/ManifestParser.cs
2024-11-26 21:08:22 +01:00
Kenn JacobsenandGitHub 4590739fa5 Add ASCII file name conversion (#17580) 2024-11-26 11:26:44 +01:00
7c617f2976 Revert #14234 add update error message for DB connection failures (#17612)
* Revert #14234

* Make the boot failure message more descriptive when unable to connect to DB

* Update src/Umbraco.Infrastructure/Runtime/RuntimeState.cs

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

* Revert changes

* Obsolete InstallMissingDatabase from V16

---------

Co-authored-by: Ronald Barendse <ronald@barend.se>
2024-11-26 11:06:40 +01:00
Lee KelleherandGitHub 9141f61708 V13: Dropzone, upload complete callback with processed file array (#17631)
* Dropzone, upload complete callback with processed file array

* Media card: cosmetic fix for image border-radius

The image's square corners were poking out.
2024-11-25 15:51:16 +01:00
ba4120050f Add cache key to GetByUserName (#17350)
* Add cache key to GetByUserName

* Remove constants

* create new cache policy for member repository

---------

Co-authored-by: Elitsa <elm@umbraco.dk>
2024-11-25 15:27:22 +01:00
Kenn JacobsenandGitHub cbd4dc6e0d Handle "all slashes" routes (#17596) 2024-11-22 09:06:10 +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
Sven Geusensandnikolajlauridsen 9febbc7db1 Distinguish between default zero and intentional zero sort order for new documents (#17517)
* Distinguish between default value and initial zero

* Update special value comment documentation

* Redid solution with dirty/new entity tracking

* rework copy branch sortorder fix

* Change == false to is false

---------

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>
2024-11-21 09:09:25 +01:00
Kenn JacobsenandGitHub ec8e10f406 Fix RTE console error when blocks are not available (#17582) 2024-11-21 08:53:59 +01:00
EalseandJacob Overgaard 3233b24a4e fix: infinite editor stuck in create action (#15945) 2024-11-20 10:00:50 +01:00
Anders BjernerandJacob Overgaard 5775e9cb18 Added fix for <umb-button-group /> label issues 2024-11-20 09:59:27 +01:00
MoleandGitHub 570005f5e1 Run both cms and package migrations in upgrader (#17575)
* Run both cms and package migrations in upgrader

* Use correct setting
2024-11-20 08:38:33 +01:00
Bjarne FyrstenborgandLaura Neto fbaa3440f2 Don't shrink crops container on right side 2024-11-18 20:11:48 +01:00
Bjarne FyrstenborgandJacob Overgaard e662468ecc Set TinyMCE to readonly 2024-11-18 08:51:04 +01:00
Bjarne FyrstenborgandMatthew-Wise c8efc30654 Fallback value when setttings element type doesn't exists as it can have reference, but no available element type 2024-11-17 17:05:28 +00:00
marwaldvandJacob Overgaard 79d117026f Add swiss languages as backoffice languages
Add missing backoffice languages as properties etc. are translated via translation section (e.g. with "#Backoffice Settings"). At the moment the swiss languages always need to be added via the umbraco/Config folder.
2024-11-09 12:29:44 +01:00
Casper LundgreenandGitHub 2709054bdb Fix NameIdentifier is not an integer. (TryParse implemented) (#17414)
Issue: 17383
2024-11-08 13:27:53 +01:00
MoleandGitHub 2d4230c001 Include create date in audit item (#17447) 2024-11-08 08:58:38 +01:00
Zeegaan f7729508cf Merge branch 'release/13.5' into v13/dev
# Conflicts:
#	version.json
2024-10-23 08:57:30 +02: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
Andreas ZerbstandGitHub aa1f3df76b Updated to match locator (#17334) 2024-10-23 08:37:24 +02:00
Sven GeusensandNikolaj Geisle 3431f76320 Prevents XSS when viewing an uploaded SVG
from the media-info and image-preview components.
2024-10-21 12:50:12 +02:00
ElitsaandNikolaj Geisle 1bc5466a8d Update the HttpContext's user with the authenticated user's principal 2024-10-21 12:45:38 +02:00
ElitsaandNikolaj Geisle d83daf44d3 Reduce the time when getRemainingTimeoutSeconds request is made from 30s to 20s, so fewer calls are made 2024-10-21 12:44:40 +02:00
ElitsaandNikolaj Geisle 2ad5ecd5d5 Make sure that the client shows the login screen as close to the server's timout time as possible 2024-10-21 12:44:39 +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 97d74f39e7 Updated version of messagepack (#17321)
(cherry picked from commit 8a22672c7f)
2024-10-21 11:49:13 +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 8a22672c7f Updated version of messagepack (#17321) 2024-10-21 11:15:59 +02:00
Andreas ZerbstandGitHub 11270eaaf5 Updated message pack (#17320) 2024-10-21 11:00:47 +02:00
Justin NevilleandGitHub 1e32d59ecb Query for media using the full file path as well as the original file path for files that contain the sizes in the file name (i.e. image_200x200.jpg) (#17314) 2024-10-21 09:53:17 +02:00
Kenn JacobsenandGitHub eab27123dd MNTP: Re-initialize contextual dialog options upon content creation (#17301) 2024-10-18 09:39:29 +02:00
Kenn JacobsenandGitHub a6253957c8 MNTP: Improve site and root context for dynamic root (#17303) 2024-10-18 09:17:17 +02:00
Jacob OvergaardandGitHub a8f5631144 V13: Update @umbraco-ui/uui to 1.11.0 (#17281)
* build(deps): update @umbraco-ui/uui from 1.7.1 to 1.11.0

* fix: umb-login-element no attributes

Cherry-picked a fix from V14 where the custom login input component was no longer needed, which was fixed because it errors out. This simplifies the login form.

* cherry-pick code to handle 'enter' click from v14
2024-10-17 10:25:02 +01:00
Jason ElkinandNikolaj Geisle 6d98162e19 Unlock form after unsuccessful save and publish. (#17285)
(cherry picked from commit ee37ad0f4b)
2024-10-16 15:09:31 +02:00
Jason ElkinandGitHub ee37ad0f4b Unlock form after unsuccessful save and publish. (#17285) 2024-10-16 15:08:37 +02:00
Bjarke BergandGitHub 2d71b5a63b Updated image sharp to a non vulnerable version (#17290) 2024-10-16 12:16:38 +02:00
Bjarke BergandGitHub f4f83bccbe Added an explicit dependency to Microsoft.Extensions.Caching.Memory to force it to use a non-vulnerable version (#17287) 2024-10-16 10:25:17 +02:00
Ronald BarendseandBjarke Berg 30b114d538 Fix ContentStore locking exceptions in async code (#17246)
* Add ContentCache test

* Use SemaphoreSlim as write lock

* Apply lock imrpovements to SnapDictionary

* Obsolete unused MonitorLock

(cherry picked from commit c3db3457e7)
2024-10-11 09:47:31 +02:00
Ronald BarendseandGitHub c3db3457e7 Fix ContentStore locking exceptions in async code (#17246)
* Add ContentCache test

* Use SemaphoreSlim as write lock

* Apply lock imrpovements to SnapDictionary

* Obsolete unused MonitorLock
2024-10-11 09:45:01 +02:00
Sven GeusensandGitHub 7787af2df1 Fix install url detection (#17241) 2024-10-10 18:09:11 +02:00
Wojciech WróbelandJacob Overgaard 3730109cce Fixed issue #17225. The 'code' html element added as valid to RTE configuration 2024-10-09 14:19:38 +02:00
Nikolaj Geisle b814608c06 Bump version 2024-10-08 12:34:23 +02:00
Nikolaj Geisle 9bab74d30e Bump version.json 2024-10-07 11:55:34 +02:00
Bjarke Berg 63a487bc0b Merge remote-tracking branch 'origin/v13/dev' into v13/dev 2024-09-26 07:54:43 +02:00
Ronald BarendseandBjarke Berg a40eadcfce Add RemoveDefault() extension method to fluent API for CMS webhook events (#15424)
* Add RemoveDefault extension method

* Move default webhook event types to single list

(cherry picked from commit 8f26263178)
2024-09-26 07:54:26 +02:00
9b19d63a6a update ImageSharpMiddlewareOption for fixing invalid width and height (#17126)
Co-authored-by: Lan Nguyen Thuy <lnt@umbraco.dk>
2024-09-25 13:19:09 +02:00
Terence BurridgeandSebastiaan Janssen 6939472f37 Update valid reasons not to have a template on a content node to include having a redirect field
Cherry-picked from: 385a5345b1
2024-09-23 14:30:13 +02:00
Sebastiaan Janssen 0387307301 Merge branch 'v13/dev' into v13/contrib 2024-09-23 14:27:48 +02:00
Bjarke Berg 25a5dde8e9 Merge remote-tracking branch 'origin/release/13.5' into v13/dev
# Conflicts:
#	version.json
2024-09-18 12:55:35 +02:00
Bjarke Berg 2e068bb73e Merge remote-tracking branch 'origin/release/13.5' into release/13.5 2024-09-17 14:51:05 +02:00
Bjarke Berg 842cacde19 Bump version 2024-09-17 14:50:57 +02:00
Dennis ÖhmanandSebastiaan Janssen 6a453a0910 v13.5 - New Swedish translation crashes Umbraco, removed duplicate areas. (#17059)
Cherry-picked from d64bf5de22
2024-09-17 14:04:22 +02:00
Sebastiaan Janssen ff9903b14d Merge branch 'v13/contrib' of https://github.com/umbraco/Umbraco-CMS into v13/contrib 2024-09-17 13:58:37 +02:00
Dennis ÖhmanandGitHub d64bf5de22 v13.5 - New Swedish translation crashes Umbraco, removed duplicate areas. (#17059) 2024-09-17 13:56:58 +02:00
Sebastiaan Janssen 9300d867fb Merge branch 'v13/dev' into v13/contrib 2024-09-17 13:12:04 +02:00
Niels LyngsøandGitHub eb0f8b5c24 fire change event (#17078) 2024-09-17 10:06:16 +02:00
Niels LyngsøandGitHub d58768f26d utilize lock unlock events for readonly mode while saving (#17077) 2024-09-17 09:52:00 +02:00
Niels LyngsøandGitHub 3667217053 only resolve if value is present (#17070) 2024-09-17 09:51:47 +02:00
Sven Geusens b237285703 Merge branch 'release/13.5' into v13/dev and version bump 2024-09-12 15:12:20 +02:00
Sven Geusens a6c5581942 Update version to non RC 2024-09-10 18:10:57 +02:00
Sven GeusensandGitHub 9a088d36b9 Expand RedirectUrl.Url storage type to avoid truncation (#17038)
* Add migration to expand RedirectUrl.Url to varcharMax

* Simplify Migration

* readded notnull attribute
2024-09-10 18:07:20 +02:00
Sven Geusens 407734ff4a Fix null reference exception in CacheValues.For when building the CompositeStringStringKey (#17024)
* Fix null ref exeption based on IPropertyValue.Culture documentation

* Clarify comment
2024-09-10 12:50:02 +02:00
Sven GeusensandGitHub a74d963cfa Fix null reference exception in CacheValues.For when building the CompositeStringStringKey (#17024)
* Fix null ref exeption based on IPropertyValue.Culture documentation

* Clarify comment
2024-09-09 18:13:14 +02:00
Niels LyngsøandNiels Lyngsø 02a47695e7 dispatch change event when embedded media has been added (#17008) 2024-09-09 13:09:31 +02:00
Niels Lyngsø 0f37cd3a45 PR 17018 2024-09-09 13:07:47 +02:00
Yari MariënandGitHub 5fe18bb78c Content.EditorDirectiveController: added formSubmittedValidationFailed broadcast to prevent fields to stay disabled (#17018) 2024-09-09 13:05:12 +02:00
Niels LyngsøandGitHub b16dfa9ca1 dispatch change event when embedded media has been added (#17008) 2024-09-09 12:49:07 +02:00
3e6116fcba No longer shows success message if content moving is cancelled (#15051)
* Fix for issue https://github.com/umbraco/Umbraco-CMS/issues/13923
 - Added AttemptMove method to the ContentService
 - Updated ContentController PostMove method to return ValidationProblem whenever the node is not moved

* Align changes with V14 solution. Make it non breaking.

---------

Co-authored-by: Laura Neto <12862535+lauraneto@users.noreply.github.com>
2024-09-05 14:08:48 +02:00
Ronald BarendseandGitHub ef3bf496e9 Avoid concurrent build of Umbraco.JsonSchema tool and add execution timeouts to Exec build tasks (#17006)
* Disable building Umbraco.JsonSchema and Umbraco.Tests.AcceptanceTest.UmbracoProject

* Add 10 minute timeout to Exec MSBuild tasks
2024-09-04 13:44:19 +02:00
Sebastiaan Janssen bff293213d Merge branch 'v13/dev' into v13/contrib 2024-09-03 11:01:39 +02:00
a47a1775f2 Prevent templates being editable when using Production runtime mode (#16923)
Co-authored-by: Nick Hoang <nick@codeberwery.com>
Co-authored-by: Jason Elkin <jason@bumpdigital.co.uk>
2024-09-03 00:54:32 +01:00
Jason Elkin b2a2df7a8a Ignore Visual Studio's generated launchSettings file. 2024-08-28 14:08:52 +01:00
Sven Geusens 34179f5b7d Merge branch 'release/13.5' into v13/dev and bump version 2024-08-28 10:14:09 +02:00
Sven Geusens d38b744c08 Merge branch 'v13/dev' into release/13.5 2024-08-27 18:54:54 +02:00
Niels LyngsøandGitHub ef58416814 V13: Read only mode while saving (#16961)
* make a clear console error when case happens

* turn Content into readonly mode when submitting form aka saving
2024-08-27 15:01:59 +01:00
Sven GeusensandGitHub 62b7c9468e Fix undefined property read (#16941) 2024-08-27 14:28:04 +01:00
Bjarke BergandGitHub bafdb21b45 Fix mandatory RTE validation (#16962)
* Added a custom RichTextRequiredValidator, to check that the empty richtext object (still with json) can be required or not. We are now testing the markdown needs to have a value

* Fixed namespaced and moved back wrong class

* Cleanup
2024-08-26 15:03:11 +02:00
Bjarke BergandGitHub 79080ffa93 Updated nuget packages and take a explicit dependency on Microsoft.IdentityModel.JsonWebTokens (#16935) 2024-08-21 10:25:39 +02:00
Sven GeusensandGitHub f99f821a6d Fix Mismatching constraint names in old migration (#16891)
* Find the constraint name based on table,column,type name instead of hardcoding it

* removed unnecesary using

* Check constraint rename seperatly from column rename
2024-08-21 09:07:09 +02:00
Niels LyngsøandGitHub 3b51475150 move and rename (#16916) 2024-08-15 12:53:57 +02:00
Sebastiaan Janssen b41de5764b Merge branch 'v13/dev' into v13/contrib 2024-08-15 11:28:55 +02:00
PeterandSebastiaan Janssen bb1c36f591 Making method ExecuteAsync virtual. (#16496)
Co-authored-by: Kvyatkovsky, Petr <pkvyatkovsky@qulix.com>
(cherry picked from commit 3a9ef3810b)
2024-08-15 11:15:24 +02:00
Andrii KudandJason Elkin 09f16c33d1 Issue-15712: MemberDefaultLockoutTimeInMinutes fix. 2024-08-15 08:48:58 +01:00
9d94658372 V13: fix 16663 (#16866)
* fix unit testing

* fix server value update case

* PastePropertyResolver for RTE Blocks

---------

Co-authored-by: leekelleher <leekelleher@gmail.com>
2024-08-13 09:43:20 +01:00
Niels LyngsøandGitHub 81f36df066 V13: fix 15516 (#16864)
* fix unit testing

* fix server value update case

* re initialize Block if it was offloaded
2024-08-13 09:25:24 +01:00
EalseandEmma L Garland 7afc2b9963 fix: uploaded item not selected in media picker 2024-08-12 21:42:35 +01:00
Sven GeusensandGitHub 2e3369a09a Upgrade imagesharp2 dependency (#16883) 2024-08-07 15:20:28 +02:00
Bjarke BergandGitHub 212b2c999f Updated to lastest nuget minor or patch versions (#16871) 2024-08-07 10:17:00 +02:00
mcl-szandSebastiaan Janssen 2761f5cd20 Combining OpenId and OfflineAccess scope (#16220)
* Combining OpenId and OfflineAccess scope

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

* Update MemberController.cs

Cleaner way, provided by @kjac, to check if the scope has openid and/or offiline_access set.

(cherry picked from commit 55f9b09ab7)
2024-08-06 14:35:59 +02:00
Sebastiaan Janssen d5831fea94 Merge branch 'v13/dev' into v13/contrib 2024-08-06 09:07:06 +02:00
Sebastiaan Janssen 71afa21701 Revert "Configure WebP encoder to use Lossy by default (#16769)"
This reverts commit ee0fd7dd5f.
2024-08-06 09:04:27 +02:00
Wojciech TenglerandZeegaan 2736a513a3 Fixing regression bug introduced in #14806 and found during investigation of #16803 - well tested on db with 300k+ nodes (#16837)
Co-authored-by: Wojciech Tengler <wtengler@umbracare.net>
(cherry picked from commit 688790e90a)
2024-08-02 11:58:02 +02:00
Sven GeusensandGitHub bb654360bf Improve migration performance (#16784)
* Improve migration performance

* Fix PR review comments

* Revert tags migration for sql lite as the optimized sql doesn't work properly and sqlLite datasets should not be large anyway
2024-07-31 10:35:28 +02:00
Daniël KnippersandGitHub ee0fd7dd5f Configure WebP encoder to use Lossy by default (#16769)
This greatly reduces file sizes in many cases compared to the default
Lossless setting that seems to be used for PNGs.
2024-07-16 20:48:32 +01:00
Elitsa MarinovskaandGitHub dfe41d7f76 V13: Ensure TransformingIndexValues event is also raised from the DeliveryApiContentIndex (#16756)
* Removing override of OnTransformingIndexValues from DeliveryApiContentIndex

* Making sure that TransformingIndexValues event is raised for DeliveryApiContentIndex without performing the special index value transformations

* Review suggestion
2024-07-15 10:45:57 +02:00
Jacob Overgaard be81586b46 set version to 13.5.0-rc 2024-07-11 15:07:36 +02:00
Jacob Overgaard c33b06274d Merge remote-tracking branch 'origin/release/13.4' into v13/dev 2024-07-11 15:06:42 +02:00
Jacob Overgaard d72fc5c4e8 fix: revert the inert attribute on Tours since you are expected to be able to work with the background in certain steps 2024-07-11 12:50:49 +02:00
Jacob OvergaardandSebastiaan Janssen a41555cc0d fix: revert the inert attribute on Tours since you are expected to be able to work with the background in certain steps 2024-07-11 12:38:37 +02:00
Jacob Overgaard c1bf3a7e15 bump version to 13.4.1 2024-07-11 12:02:39 +02:00
Elitsa 5f6be40bdf Revert "Removing override of OnTransformingIndexValues from DeliveryApiContentIndex"
This reverts commit f6deaca452.
2024-07-08 09:30:12 +03:00
Elitsa 8dc02fa081 Revert "Making sure base.OnTransformingIndexValues(e); is called for DeliveryApiContentIndex without the special index value transformations"
This reverts commit a7ff32891e.
2024-07-08 09:30:12 +03:00
Elitsa a7ff32891e Making sure base.OnTransformingIndexValues(e); is called for DeliveryApiContentIndex without the special index value transformations 2024-07-08 09:28:34 +03:00
Elitsa f6deaca452 Removing override of OnTransformingIndexValues from DeliveryApiContentIndex 2024-07-08 09:27:36 +03:00
Elitsa MarinovskaandGitHub ef01c27fad Respect user start nodes in GetPagedChildren (used in List View) (#16722) 2024-07-02 09:55:03 +02:00
Elitsa MarinovskaandGitHub d8b4361936 V13: Update url scheme for Twitter OEmbedProvider (#16650)
* Adds url support for x.com/.*/status/.*

* Updated regex

* Obsoleting Twitter as OEmbedProvider

* Introducing X as its new alternative

* Adding X and removing Twitter from EmbedProvidersCollection

* Typo
2024-06-27 09:23:47 +02:00
Bjarke BergandGitHub 0afb4f7283 Make GetHeaderValue support HttpContext unavailable (#16654)
* Make GetHeaderValue tolerant for when the http context is not available. Now it just returns null.

* Add unit tests
2024-06-25 13:47:25 +02:00
Vlael LayugandGitHub 4e746d367e Use parentElement instead of parent when setting focus for modals with tabs (#16257)
* added null checker for umb-tab when it's trying to get the elm.parent

* use parentElement instead of parent
2024-06-22 13:01:04 +01:00
Nikolaj Geisle e3d65967aa Bump version.json 2024-06-20 14:45:13 +02:00
Nikolaj Geisle 73408f1cce Merge branch 'release/13.4' into v13/dev 2024-06-20 14:44:40 +02:00
Andreas ZerbstandNikolaj Geisle 6e3a6917c8 Decreased to 1 retry for this file only (#16623) 2024-06-20 11:30:22 +02:00
Andreas ZerbstandNikolaj Geisle b2b112eb8b V13 QA Updated depedencies (#16606)
* Bumped version of helper and builder

* Removed faker
2024-06-20 11:30:21 +02:00
MoleandNikolaj Geisle 56710d5b5b V13: Eaglery route domains for virtual page controllers (#16635)
* Do domain routing eagerly

* Cleanup

* Fix comment
2024-06-20 11:30:11 +02:00
MoleandGitHub 00ca9e0d2d V13: Eaglery route domains for virtual page controllers (#16635)
* Do domain routing eagerly

* Cleanup

* Fix comment
2024-06-20 11:25:02 +02:00
Andreas ZerbstandGitHub 65c76fcfab Decreased to 1 retry for this file only (#16623) 2024-06-19 09:49:04 +02:00
a686ba2a0e V13: Update nuget packages (#16616)
* Update nuget packages

* Fix Imagesharp 2

---------

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2024-06-19 07:50:52 +02:00
Nikolaj Geisle 344245b1ea bump to final version 2024-06-18 10:05:36 +02:00
Nikolaj Geisle 82b4f506c2 bump version to rc2 2024-06-18 09:08:40 +02:00
Andreas ZerbstandGitHub 5e31fde416 V13 QA Updated depedencies (#16606)
* Bumped version of helper and builder

* Removed faker
2024-06-17 10:49:16 +02:00
Christian YngvessonandGitHub b60665d096 Feature/swedish translations (#16582)
* Added some translations

* Update sv.xml - Minor typo
2024-06-14 16:18:18 +01:00
Zeegaan 24abc117fe update version.json 2024-06-07 12:50:46 +02:00
MoleandGitHub 5ae5fe338a V13: Set request culture for VirtualPageController (#16572)
* Rename FindDomain to FindAndSetDomain

* Ensure VariationContext and PublishedRequest is updated for virtual page controller
2024-06-07 12:49:13 +02:00
Zeegaan 5f8eac0464 bump version.json 2024-06-06 10:22:18 +02:00
Zeegaan fc951ee100 Merge branch 'release/13.4' into v13/dev 2024-06-06 10:21:53 +02:00
Nikolaj Geisle 78bf04ef67 bump version.json 2024-06-04 14:56:22 +02:00
Andreas ZerbstandGitHub ae7db56f77 Decreased retry count (#16554) 2024-06-04 14:25:57 +02:00
Kenn JacobsenandGitHub 3dace4fc9d RTE and media picker should route medias the same way in the Delivery API (#16550)
* RTE and media picker should route medias the same way in the Delivery API

* Fix failing unit test

* Fixed failing tests
2024-06-04 10:32:37 +02:00
Nikolaj GeisleandGitHub 32912b0c35 Update to query to SqlRaw (#16542) 2024-06-03 13:34:43 +02:00
Nikolaj Geisle f15be3ed65 Merge branch 'v13/dev' into release/13.4 2024-06-03 12:30:44 +02:00
Sebastiaan Janssen 46e99910e7 Merge branch 'v13/contrib' into v13/dev 2024-06-03 12:26:54 +02:00
Nikolaj Geisle c3e7dad236 bumb to rc version 2024-06-03 12:09:37 +02:00
MoleandGitHub 100f2c3bcd Add check to ensure that RenderControllers and SurfaceControllers are always routed through the UmbracoRouteValueTransforms (#16540) 2024-06-03 12:03:40 +02:00
0aaac78cfa A bunch of minor performance optimizations (#16335)
* Do not execute query if no macros found

* Request cache the permission lookup

* Unbreak change by adding obsolete ctor

* Clean up

* Wrap indexing for delivery API in a scope

* Do not ask options every time for the timeout, instead listen for updates

* Lookup content types once instead of one by one

* Use TryGetValue instead

* Do a distinct on user ids before building index, to avoid issue with more than 2100 parameters

* Don't map ContentDto (it's unused)

* Introduce request bound block editor element cache

---------

Co-authored-by: kjac <kja@umbraco.dk>
2024-06-03 11:23:25 +02:00
Johan RunstenandMatthew-Wise 5795cf119a Typo when getting query parm 2024-06-01 12:24:09 +01:00
Bjarke Berg 528583430f Merge remote-tracking branch 'refs/remotes/origin/release/13.3' into v13/dev
# Conflicts:
#	src/Umbraco.Web.Website/Routing/EagerMatcherPolicy.cs
#	version.json
2024-05-23 13:31:34 +02:00
Bjarke BergandGitHub 696a71166c Ensure ufprt-token requests are handle in the UmbracoRouteValueTransformer (#16347) 2024-05-23 10:14:37 +02:00
MoleandBjarke Berg 5f082df3ab Ensure there is always at least 1 valid candidate (#16344)
(cherry picked from commit eb6bb99eaf)
2024-05-22 13:30:54 +02:00
MoleandGitHub eb6bb99eaf Ensure there is always at least 1 valid candidate (#16344) 2024-05-22 13:29:17 +02:00
Bjarke Berg fd2138c1fd Bump version 2024-05-22 12:21:56 +02:00
Nikolaj GeisleandGitHub 0f3160f727 Move publishing notification after validation (#16331) 2024-05-22 12:17:04 +02:00
Bjarke Berg 04ed514a21 Merge remote-tracking branch 'refs/remotes/origin/v12/dev' into v13/dev 2024-05-21 08:57:43 +02:00
Bjarke Berg 4f382abc66 Merge remote-tracking branch 'refs/remotes/origin/v11/dev' into v12/dev
# Conflicts:
#	src/Umbraco.Web.BackOffice/Controllers/MediaController.cs
2024-05-21 08:49:33 +02:00
Bjarke Berg 60f656006d Merge remote-tracking branch 'refs/remotes/origin/release/12.3' into v12/dev
# Conflicts:
#	version.json
2024-05-21 08:48:54 +02:00
Bjarke Berg 5c777f3182 Merge remote-tracking branch 'refs/remotes/origin/v10/dev' into v11/dev
# Conflicts:
#	src/Umbraco.Web.BackOffice/Controllers/MediaController.cs
2024-05-21 08:46:37 +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 Berg 9bacd13ce2 Merge remote-tracking branch 'refs/remotes/origin/release/13.3' into v13/dev
# Conflicts:
#	version.json
2024-05-17 14:39:44 +02:00
Bjarke BergandGitHub c17d4e1a60 Merge pull request from GHSA-j74q-mv2c-rxmp 2024-05-17 08:37:51 +02:00
Bjarke BergandGitHub 5f24de3085 Merge pull request from GHSA-j74q-mv2c-rxmp 2024-05-17 08:37:51 +02:00
Bjarke BergandGitHub d8df405db4 Merge pull request from GHSA-j74q-mv2c-rxmp 2024-05-17 08:37:51 +02:00
Kenn JacobsenandBjarke Berg 94cef504a3 Property source level variation should only be applied when configured (#16270)
(cherry picked from commit ab32bac5d9)
2024-05-13 15:45:45 +02:00
Kenn JacobsenandGitHub ab32bac5d9 Property source level variation should only be applied when configured (#16270) 2024-05-13 15:44:07 +02:00
MoleandBjarke Berg 18765465ae V13: Optimize custom MVC routing (#16218)
* Introduce EagerMatcherPolicy to conditionally bypass content routing

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

* Skip Umbraco endpoints

* Simplify logic a bit

* Move install logic to matcher

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

* Fixup comments

* Reduce nesting a bit

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

* Remove excess check, since installer requests are statically routed

(cherry picked from commit ba9ddd11da)
2024-05-10 11:37:11 +02:00
MoleandGitHub ba9ddd11da V13: Optimize custom MVC routing (#16218)
* Introduce EagerMatcherPolicy to conditionally bypass content routing

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

* Skip Umbraco endpoints

* Simplify logic a bit

* Move install logic to matcher

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

* Fixup comments

* Reduce nesting a bit

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

* Remove excess check, since installer requests are statically routed
2024-05-10 11:36:12 +02:00
Rasmus John PedersenandGitHub cfcdc9c98d Webhook log improvements (#16200)
* fix: include all headers in webhook log

* feat: return webhook log status from server

* feat: make webhook logs deep linkable

* feat: add webhook log pagination

* feat: improve webhook request/response body preview
2024-05-06 13:14:11 +02:00
Sebastiaan JanssenandGitHub 23d0a6b9b2 Since v13 properties can sometimes be of type IRichTextEditorIntermediateValue - this was unexpected in the XPath navigator code (#16121) 2024-05-06 09:40:52 +02:00
Bjarke Berg fee222daff Bump version 2024-05-03 09:29:37 +02:00
Bjarke Berg edb516f71a Bump version 2024-05-03 09:28:43 +02:00
Bjarke Berg b6031dea1a bump version 2024-05-03 09:27:20 +02:00
Joshua Daniel Pratt NielsenandSebastiaan Janssen 5b46c718e6 Fix logic for retrieving lastKnownElement
(cherry picked from commit cae106bfe8)
2024-04-26 09:59:49 +02:00
Lars-ErikandSebastiaan Janssen 599ec18ecc Implementors using Umbraco.Tests.Integration won't have to override GetLocalizedTextService
(cherry picked from commit b0016687eb)
(cherry picked from commit 2bb56f1b81)
2024-04-26 09:59:32 +02:00
Joshua Daniel Pratt NielsenandSebastiaan Janssen cae106bfe8 Fix logic for retrieving lastKnownElement 2024-04-26 09:55:05 +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
MoleandGitHub 0980350172 Add blocks in RTE telemetry (#16104)
* Add blocks telemetry

* Use constants and update tests

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

* Add property type counts to telemetry

* Use constants and fix tests

* Update description
2024-04-22 12:56:36 +02:00
Sven Geusens a27a4dcd84 Bump to next minor 2024-04-18 15:36:44 +02:00
Sven Geusens adc2435073 Merge branch 'release/13.3.0' into v13/dev 2024-04-18 15:24:41 +02:00
Sven Geusens a325ba339b bump rc to regular 2024-04-18 09:10:22 +02:00
MoleandGitHub 096991ac79 V13: Add webhook information to detailed telemetry (#16060)
* Cleanup ReportSiteJob

* Report on registered webhook event types

* Report on custom header webhook count

* Use constants instead of magic strings

* Update tests

* Update translation files
2024-04-16 14:36:02 +02:00
Kenn JacobsenandGitHub a6a76d1815 Make the API content response builder extendable (#16056)
* Make the API content response builder extendable

* DeliveryApiJsonTypeResolver needs to be extendable too
2024-04-16 12:03:44 +02:00
6379f2fd35 Ported over #15928 changes for 13.3 RC (#16023)
* Ported over #15928 changes for 13.3 RC

* Use GetOrAdd()

* Lock dictionary initialization

---------

Co-authored-by: Jason Elkin <jasonelkin86@gmail.com>
2024-04-16 08:55:40 +02:00
Lars-ErikandSebastiaan Janssen 2bb56f1b81 Implementors using Umbraco.Tests.Integration won't have to override GetLocalizedTextService
(cherry picked from commit b0016687eb)
2024-04-09 12:56:15 +02:00
Sebastiaan Janssen e993c23d5c Merge branch 'v13/dev' into contrib
# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
2024-04-04 11:25:13 +02:00
dependabot[bot]andSebastiaan Janssen 71e16d20ef Bump vite from 5.1.1 to 5.1.7 in /src/Umbraco.Web.UI.Login
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.1.1 to 5.1.7.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v5.1.7/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.1.7/packages/vite)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-04 11:12:22 +02:00
ChadandJason Elkin 682b7656bc Update RefreshMethodType.cs 2024-04-02 21:49:03 +01:00
MoleandGitHub d765e69713 V13: Align database schemas of migrated and new database (#15934)
* Drop default constraint umbracoCacheInstruction table

* Align umbracoContentVersion table

* Update indexes on external login table

* Align node table

* Make relation type index unique

* Remove user-group default constraint

* Re-order methods

* Make webhook url not nullable

* Cleanup

* Cleanup
2024-04-02 08:31:38 +02:00
Sven Geusens 43920f9adc Merge branch 'v12/dev' into v13/dev 2024-03-27 15:04:00 +01:00
Ethan NaganoandGitHub fdea8c28c8 14744 tour not coded to best practice (#15133)
* Apply focusLockService to TourStepDirective

Apply focusLockService to TourStepDirective in order to ensure that
non-modal page contents are inert and do not interfere with focus on
modal dialog with regards to screen reading technologies.

* Add properties to umb-tour.html.

Add properties to umb-tour html page to ensure that it aligns with modal
dialog best practices.

* Add dialog properties to Umbraco tour .html files.

Add properties relating to dialog and accessibility to the Umbraco tour
.html files, including aria-label, role, and tab index.
2024-03-26 09:39:34 +00:00
Ethan NaganoandGitHub ce372abf8a Add check for ContentVariation.Nothing when copying documents. (#15185)
A new check for ContentVariation.Nothing is necessary when copying from
documents to ensure that if there is no content variation as defined by
the Nothing property, values are still copied even if variation is not
supported since the content itself will not vary.
2024-03-25 13:27:36 +00:00
Kenn JacobsenandGitHub b1c3473856 Introduce path provider and resolver for the Content Delivery API (#15922) 2024-03-22 14:12:33 +01: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 b7533b57b4 Merge remote-tracking branch 'origin/release/13.2' into v13/dev
# Conflicts:
#	version.json
2024-03-20 07:15:18 +01:00
Bjarke Berg 0dc13cf23f Merge remote-tracking branch 'origin/release/12.3' into v12/dev
# Conflicts:
#	version.json
2024-03-20 07:14:33 +01:00
dependabot[bot]andSebastiaan Janssen d3b96a163f Bump follow-redirects in /src/Umbraco.Web.UI.Client
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.4 to 1.15.6.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.15.4...v1.15.6)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-19 14:42:03 +01:00
dependabot[bot]andSebastiaan Janssen 95aba6d696 Bump follow-redirects in /tests/Umbraco.Tests.AcceptanceTest
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.4 to 1.15.6.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.15.4...v1.15.6)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-19 14:41:45 +01:00
Sebastiaan Janssen 9030b1c19f Merge branch 'v13/dev' into contrib 2024-03-19 14:40:30 +01:00
Bjarke Berg 79d241a910 Bump version 2024-03-19 13:59:49 +01:00
Bjarke Berg c48d6f5a38 Update imagesharp 3 2024-03-19 13:59:38 +01:00
Bjarke Berg d9e890e954 Fixed duplicate reference 2024-03-19 13:58:43 +01:00
Bjarke Berg ecdbd9653b Update imagesharp 2 2024-03-19 13:57:46 +01:00
Bjarke Berg e0bb4b6a23 Bump version 2024-03-19 13:57:36 +01:00
2c41388096 Preserve user populated link title when selecting nodes in link picker (#14787)
* Prevent user populated link names being removed

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

* Don't update for media either

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

* Deselect current node

When selecting media, deselect current node if there is one

* Change to suggested functionality

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

* Reapply changes

Repply changes after merge from contrib branch

* Use IsCulturePublished() and only track node name

* Fallback to node name in preview

* Fix setting media name

---------

Co-authored-by: Ronald Barendse <ronald@barend.se>
2024-03-19 11:31:31 +00:00
Bjarke Berg 0ec9423e0a Merge remote-tracking branch 'origin/release/13.2' into v13/dev
# Conflicts:
#	version.json
2024-03-19 08:48:07 +01:00
Bjarke Berg efe24289bf Merge remote-tracking branch 'origin/v11/dev' into v12/dev 2024-03-19 08:45:29 +01:00
Bjarke Berg 03aa17e602 Merge remote-tracking branch 'origin/v10/dev' into v11/dev 2024-03-19 08:44:55 +01:00
Bjarke Berg 99d5a7e609 Merge remote-tracking branch 'origin/release/10.8' into v10/dev 2024-03-19 08:43:59 +01:00
Bjarke Berg 383617ec17 Fix after wrong log merge 2024-03-18 19:00:30 +01:00
Sven GeusensandBjarke Berg a39030f4ba DataTypeSplit datacollector should not care about propertyEditors (#15898)
This ensures keys are correctly assumed to be unique => safe for dictionary usage

Co-authored-by: Sven Geusens <sge@umbraco.dk>
(cherry picked from commit e267b41575)
2024-03-18 13:21:35 +01:00
e267b41575 DataTypeSplit datacollector should not care about propertyEditors (#15898)
This ensures keys are correctly assumed to be unique => safe for dictionary usage

Co-authored-by: Sven Geusens <sge@umbraco.dk>
2024-03-18 12:39:24 +01:00
Bjarke Berg 6e3496d3f5 Fix after merge
(cherry picked from commit 3e08ce1efb)

(cherry picked from commit 7e822bb8a1)
2024-03-18 08:53:35 +01:00
Bjarke Berg 14f3336941 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-18 08:53:15 +01:00
Bjarke Berg da43d2f08c Fix after merge
(cherry picked from commit 3e08ce1efb)

(cherry picked from commit 7e822bb8a1)
2024-03-18 08:42:59 +01:00
Bjarke Berg 827fa188f4 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-18 08:42:27 +01:00
Bjarke Berg 352b6fa45b Bump version 2024-03-18 08:39:19 +01:00
Bjarke Berg 8789a643ec Bump version 2024-03-18 08:38:55 +01:00
Bjarke Berg 8696f66915 Merge remote-tracking branch 'origin/v12/dev' into v13/dev 2024-03-18 08:35:17 +01:00
Bjarke Berg 98de8acece Merge remote-tracking branch 'origin/v11/dev' into v12/dev 2024-03-18 08:33:15 +01:00
Bjarke Berg 0f076f7a13 Merge remote-tracking branch 'origin/v10/dev' into v11/dev
# Conflicts:
#	src/Umbraco.Infrastructure/Security/UmbracoUserManager.cs
2024-03-18 08:31:10 +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 7e822bb8a1 Fix after merge
(cherry picked from commit 3e08ce1efb)
2024-03-15 17:16:04 +01:00
Bjarke Berg 3e08ce1efb Fix after merge 2024-03-15 15:58:22 +01:00
Bjarke Berg 77bfff83f2 Merge remote-tracking branch 'origin/v12/dev' into v13/dev 2024-03-15 15:05:17 +01:00
Bjarke Berg a34c63a313 Merge remote-tracking branch 'origin/v11/dev' into v12/dev
# Conflicts:
#	src/Umbraco.Infrastructure/Scoping/Scope.cs
#	tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/LocksTests.cs
2024-03-15 15:01:36 +01:00
Bjarke Berg 6ea84db0ae Merge remote-tracking branch 'origin/v10/dev' into v11/dev 2024-03-15 14:55:56 +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 3718a9cdd4 Revert "Ignore test of lazy locks"
This reverts commit e03ff2661b.
2024-03-15 09:47:18 +01:00
Bjarke Berg e03ff2661b Ignore test of lazy locks 2024-03-15 09:35:19 +01:00
Bjarke Berg d82e262e13 Update imagesharp 3 2024-03-15 08:22:53 +01:00
Bjarke Berg 0e7e16f455 Merge remote-tracking branch 'origin/v12/dev' into v13/dev 2024-03-15 08:21:10 +01:00
Bjarke Berg 7585918821 Revert ImageSharp 3 upgrade due to breaking changes 2024-03-15 08:20:50 +01:00
Bjarke Berg 0e43c43609 Update imagesharp 3 2024-03-15 08:09:39 +01:00
Bjarke Berg 233452cb55 Merge remote-tracking branch 'origin/v12/dev' into v13/dev
# Conflicts:
#	src/Directory.Packages.props
2024-03-15 08:09:05 +01:00
Bjarke Berg 659e74d831 Update imagesharp 3 2024-03-15 08:08:27 +01:00
Bjarke Berg b4e2191a4d Merge remote-tracking branch 'origin/v12/dev' into v13/dev
# Conflicts:
#	src/Directory.Packages.props
2024-03-15 08:07:14 +01:00
Bjarke Berg fc86f2222c Merge remote-tracking branch 'origin/v11/dev' into v12/dev
# Conflicts:
#	src/Directory.Packages.props
2024-03-15 08:05:53 +01:00
Bjarke Berg 26958df79e Merge remote-tracking branch 'origin/v10/dev' into v11/dev
# Conflicts:
#	src/Directory.Packages.props
2024-03-15 07:58:21 +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
albinjandSebastiaan Janssen 4a977b85a2 Fix UmbracoMapper InvalidOperationException due to concurrent modification of inner dictionary (#15830) 2024-03-14 11:05:18 +01:00
ChadandGitHub 2fbda6e64b Dispose IDisposable instances (#15810) 2024-03-13 14:59:28 +00:00
nzdevandJason Elkin ac5539a8be Avoid string.Format allocations when profiler is not enabled. 2024-03-13 14:39:57 +00:00
Bishal TimandGitHub d8b0616434 Update documentation for GetAllContentTags method in ITagQuery interface (#15860) 2024-03-12 10:23:22 +00:00
Stefan StankovicandMichael Latouche d97cbf486d Show BlockGrid Create Dialog if there are items in clipboard
Default behavior:

If you have only one available module for an area Umbraco will
open a dialog for adding the module. If you have more than one
module you will get a dialog to choose a module and that dialog
will have a Paste option in the top right corner.

New behavior:

If there is a module in the clipboard, Umbraco will open a dialog
with the Paste option even thou there is only one available module
in the area. In other cases, it will work as usual.

Reported issue: https://github.com/umbraco/Umbraco-CMS/issues/15755
2024-03-10 19:55:11 +01:00
Joe DearsleyandMichael Latouche 90864d8e58 Validation messages for blocklists no longer show HTML markup. #15697 2024-03-09 01:23:14 +01:00
Paul SealandBusra Sengul 7813acfa2b Added a check for the runtime mode and showed the relevant error message if 2024-03-08 14:18:50 +03:00
Elitsa MarinovskaandGitHub 90820483d5 Try to parse string as int and return id.ToString(CultureInfo.InvariantCulture) (#15848) 2024-03-08 08:36:00 +01:00
Nikolaj Geisle b86eeb6b52 bumb version 2024-03-07 09:54:14 +01:00
Nikolaj Geisle bf942d17bf Merge branch 'release/13.2' into v13/dev 2024-03-07 09:53:42 +01:00
3344274616 Xpath Query on Multinode Treepicker no longer working for new Nodes (#15159)
* fix for #14698

* Adjust XPath logic so it uses parentId as $current only when nodeContextId is null or 0

---------

Co-authored-by: Laura Neto <12862535+lauraneto@users.noreply.github.com>
2024-03-06 18:45:20 +01:00
Nikolaj Geisle 7dff3a3755 bump version 2024-03-06 11:01:37 +01:00
Erik-Jan WestendorpandBusra Sengul ce769ffff4 Add health checks results to payload 2024-03-05 14:24:34 +03:00
Steve MorganandGitHub 3b4ca0b0f5 Media Picker - upload button disabled bug #13383 (#15115) 2024-03-05 11:13:44 +01:00
Kenn JacobsenandGitHub ca9a3bbf1b Use same cache level for MNTP no matter the output channel (#15828) 2024-03-04 13:17:38 +01:00
Kenn JacobsenandGitHub 21126b7ba6 Localize validation messages with user lang files (#15820)
* Localize validation messages with user lang files

* Fixed unit tests
2024-03-04 12:50:24 +01:00
Ethan NaganoandBusra Sengul 0cf436fa5c Add handling of failed publish.
When publishing, if the selected page does not yet have a page created,
handle the FailedPublishNothingToPublish error so that the user is not
presented with an exception. A warning is shown to the user that some
languages failed to publish due to nothing to publish and to check that
a page has been created for selected languages. Additionally fixed a
validation issue where publish would always succeed if all languages
were selected.

Issue: 15352
2024-03-01 10:42:59 +03:00
MihailichenkoPavelandMichael Latouche 4f9c793d00 fix user login 2024-03-01 02:31:56 +01:00
Sebastiaan Janssen eff25b5abe Merge branch 'v13/dev' into contrib 2024-02-29 14:06:35 +01:00
Owain JonesandMichael Latouche beb431900a Update Welsh lang file 2024-02-29 01:46:28 +01:00
fg-gscandGitHub 7a7b8461c5 Added the possibility to select all the cultures at once in the save and save&publish dialogs (#15776) 2024-02-28 15:54:50 +00:00
Jacob OvergaardandSebastiaan Janssen f17f5522c0 revert changes in Default.cshtml regarding external login providers, as there are still parts of the backoffice using the AngularJS variables 2024-02-26 10:44:25 +01:00
Sven Geusens 99f841b7ae Bump rc version 2024-02-22 14:44:01 +01:00
Sebastiaan Janssen 3e1abd1404 Merge branch 'v13/dev' into contrib 2024-02-22 10:34:56 +01:00
Christian VåganandJason Elkin a7cacc9bb3 Add CultureInfo.InvariantCulture argument to nodeId.ToString() in CheckPermissionsPath() call 2024-02-21 22:29:11 +00:00
Jeavon LeopoldandJason Elkin 5978412b23 Add custom Examine FileSystemDirectoryFactory
So that the Umbraco SiteName property is used when generating the temp folder name hash
2024-02-21 22:14:06 +00:00
129adf2699 Fix excessive datatype load times in propertyValueEditors and backoffice mapping (#15731)
* Introduced IDataTypeConfigurationCache
* Applied IDataTypeConfigurationCache to Property Editors and display mapping
* Invalidate new cache trough DataTypeConfigurationCacheRefresher
* Improve IDatatype service to use cached int path when fetching by guid (using idkeymap)
---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
Co-authored-by: Ronald Barendse <ronald@barend.se>
2024-02-21 09:05:44 +01:00
Jacob OvergaardandGitHub 12355219d4 V13: The login screen does not display external login errors (#15715)
* show external login errors as a subheadline on the login screen
* fix: migrate error handling from v12 for external login
* cleanup unused client-side javascript
2024-02-14 13:24:10 +01:00
Bjarne FyrstenborgandGitHub 8145a90094 Content type picker in dynamic root pickers (#15514) 2024-02-14 12:34:18 +01:00
Jacob OvergaardandGitHub 3d7e79c3e5 V13: Update Login UI to Lit 3 and update the UI Library to 1.7.1 (#15713)
* update dependencies to latest (lit 3, vite 5) and fix related issues

* update ui library to 1.7.1

* mark all backoffice svg icons with fill="currentColor"

* set label on user.html
2024-02-14 07:38:17 +01:00
Sebastiaan Janssen 43e373d352 Merge branch 'v13/dev' into contrib
# Conflicts:
#	src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml
#	src/Umbraco.Web.BackOffice/Mapping/WebhookMapDefinition.cs
2024-02-13 14:05:46 +01:00
Bjarne FyrstenborgandGitHub f78c5675ea Use <umb-node-preview> component in dynamic root nodes (#15510) 2024-02-13 13:41:25 +01:00
Jan SkovgaardandGitHub 3553e7546a Bugfix: #14742 - Tabs not coded according to best practice (#14979) 2024-02-13 12:59:29 +01:00
Anna GevelandMichael Latouche 37d96db979 Fixed StackOverflow exception when using NoopPropertyIndexValueFactory
Removed recursive call from the GetIndexValues method of NoopPropertyIndexValueFactory for backward compatibility and alignment with other property index value factory classes
2024-02-13 02:03:28 +01:00
Ethan NaganoandGitHub 9ed2e48ff4 15209 media picker shows incorrect date (#15414)
* Trim update date to exclude Z character.

When picking media, the items from an SQL database contain an update
date that is formated in UTC-0 time by way of a Z character at the end
of the string. Removing this string will result in the update date
always displaying local time as expected.

Issue: 15209

* Use dateHelper instead of slicing Z from date string.

For most front end date formatting, dateHelper is used to get the local
date. The dateHelper is now passed in to the media picker controller and
used to format the date.
2024-02-12 23:41:20 +01:00
rbottemaandSebastiaan Janssen 14be246802 Fix QR code icon
Strips the width and height from the QR code SVG to ensure display is correct on all sizes. Used https://svgomg.net/ to optimize and minify the SVG.
2024-02-12 10:15:07 +01:00
Lars-ErikandSebastiaan Janssen 3e871f2c33 Add WithIsElement to ContentTypeBuilder 2024-02-12 10:03:02 +01:00
Jeavon LeopoldandSebastiaan Janssen ea7ae74ccb Fix certificate health check so that it validates multiple times
Also switch deprecated request.Properties to request.Options
2024-02-12 09:58:55 +01:00
9e5eb2da08 Remove clean xss from datatype name and alias. (#15552)
* Remove clean xss from datatype name and alias.

* Edit / and \ to the exclusions argument

* Forgot to escape the backslash

---------

Co-authored-by: Lucas Bach Bisgaard <lom@novicell.dk>
2024-02-10 01:50:03 +01:00
Erik-Jan WestendorpandMichael Latouche 7046c3585b Add localization key for 'Cancel and clear query' 2024-02-07 21:19:42 +01:00
Terence BurridgeandGitHub 318d994cf3 Reload the List View after a copy, if to the same parent (#15312) 2024-02-07 18:07:46 +01:00
Jacob Overgaard e1b4d1b982 fix useDotNet task 2024-02-07 14:35:49 +01:00
839b2ff6a2 Fixes #15136: Search includes fields from other cultures (#15148)
* Fixes #15136: Search includes fields from other cultures

Regex was updated to support block list fields
Unpublished nodes on the supplied culture are not filtered out

* Making the code non-breaking

* Fixed failing publish content query integration tests

The tests were not setting the content as publish in the specifed culture
causing the content items to be ignored

---------

Co-authored-by: Laura Neto <12862535+lauraneto@users.noreply.github.com>
2024-02-07 13:43:37 +01:00
Markus JohanssonandMichael Latouche 2221c4f1c7 #15568 fixed by adding IRichTextEditorIntermediateValue 2024-02-07 02:32:14 +01:00
MehmetandGitHub 5d0486fddc Add missing list view usages to data type references (#14485) (#14617)
* Add missing list view usages to data type references (#14485)

* Added default implementation #14617
2024-02-06 14:50:16 +00:00
Bjarke Berg 0e7d5464ae Merge remote-tracking branch 'origin/v12/dev' into v13/dev 2024-02-06 12:56:36 +01:00
Bjarke Berg 073e59c89a Merge remote-tracking branch 'origin/v11/dev' into v12/dev
# Conflicts:
#	src/Umbraco.Infrastructure/Cache/DistributedCacheExtensions.cs
#	src/Umbraco.PublishedCache.NuCache/PublishedSnapshotService.cs
#	tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/PublishedCache/PublishedSnapshotServiceCollectionTests.cs
2024-02-06 12:44:23 +01:00
Bjarke Berg 742e12c9c3 Merge remote-tracking branch 'origin/v10/dev' into v11/dev 2024-02-06 12:43:04 +01:00
Bjarke Berg 3a12b6591d Merge remote-tracking branch 'origin/release/13.1' into v13/dev 2024-02-06 11:09:25 +01:00
Bjarke Berg 897af1b013 Merge remote-tracking branch 'origin/release/12.3' into v12/dev 2024-02-06 11:08:16 +01:00
Bjarke Berg b5e46ba880 Merge remote-tracking branch 'origin/release/10.8' into v10/dev 2024-02-06 11:07:16 +01:00
Bjarke Berg cd47bdbb0c Fix breaking change 2024-02-06 10:08:12 +01:00
Nikolaj GeisleandGitHub 1b712fe6ec Merge pull request from GHSA-gvpc-3pj6-4m9w
* Add MarkDownPropertyValueEditor with html sanitizer

* Implement IMarkdownSanitizer.
2024-02-06 09:53:40 +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
Nikolaj GeisleandGitHub d090176272 Merge pull request from GHSA-gvpc-3pj6-4m9w
* Add MarkDownPropertyValueEditor with html sanitizer

* Implement IMarkdownSanitizer.
2024-02-06 09:53:40 +01:00
Nikolaj GeisleandGitHub 6b8067815c Merge pull request from GHSA-74p6-39f2-23v3
* Don't display exception if not in debug mode

* Only display not OK status code in production
2024-02-06 09:53:17 +01:00
Matthew-WiseandGitHub 3ce438399a Fix UriUtilityCore's handling of anchors and querystrings, also optimized with Span (#15678) 2024-02-05 08:03:42 +01:00
Ethan NaganoandMichael Latouche ec26e5eabf Update nouislider options for image cropper.
Previous slider min and max values caused home and end keys to behave
incorrectly. Min is now 0 to reflect 0% zoom and max is now 100 to
reflect max zoom. Additionally, adjusted step to 0.01 to avoid slow
adjustments when using arrow keys or page up / page down keys.

Issue: #15578
2024-02-05 03:33:44 +01:00
Jacob Overgaard 36402a149a Merge remote-tracking branch 'origin/v13/dev' into contrib
# Conflicts:
#	build/azure-pipelines.yml
2024-02-02 13:43:49 +01:00
Jacob Overgaard 0765a1d809 force node.js version to 20.x 2024-02-02 13:41:30 +01:00
Ronald BarendseandJacob Overgaard 30c1baecd7 Remove Linux only Docker build for E2E tests (#14042)
* Remove Linux only Docker build for E2E tests

* Fix cmsVersion variable

* Remove custom build number step (already done by Nerdbank.GitVersioning)

* Add and use global.json to configure .NET SDK version

* Only publish tests build output

* Only include unit tests and integration build output (without reference assemblies)

* Added "pr: none" to nightly trigger (#15044)

* Only run SQL Server Acceptance Tests on release builds or when parameter is set

* Use SQLite in-memory database and configure database optimizations (#15461)

* Disable content version cleanup and server election

* Reference Umbraco.Tests.AcceptanceTest.UmbracoProject instead of copying files

* Suspend/disable scheduled publishing

* Ensure all Playwright results are copied to the artifact staging directory

* Update E2E SQL Server job and also run on Linux

* Fix building acceptance test project

* Fix building acceptance test project (suing PrivateAssets)

* Explicitly disable building project references in E2E tests and use pre-built output

* Include obj folder of acceptance test project in build artifacts

* Download build artifacts

* Re-add PrivateAssets

* Revert to copying C# files to E2E application

* Disable Integrated Security for SQL Server on Linux

* Update SQL Server on Linux connection string

* Disable encryption on SQL Server for Linux

* Update SQL Server on Linux steps

* Add Database to SQL Server connection string on Linux

* Update Integration Tests and use SQL Server 2022 Docker image

---------

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
(cherry picked from commit 0e1ca76d6e)
2024-02-02 13:40:09 +01:00
Andy ButlandandGitHub b5b9c13bad Allow methods that call GetCropUrl to be verified in unit tests. (#15674) 2024-02-02 13:12:26 +01:00
0e1ca76d6e Remove Linux only Docker build for E2E tests (#14042)
* Remove Linux only Docker build for E2E tests

* Fix cmsVersion variable

* Remove custom build number step (already done by Nerdbank.GitVersioning)

* Add and use global.json to configure .NET SDK version

* Only publish tests build output

* Only include unit tests and integration build output (without reference assemblies)

* Added "pr: none" to nightly trigger (#15044)

* Only run SQL Server Acceptance Tests on release builds or when parameter is set

* Use SQLite in-memory database and configure database optimizations (#15461)

* Disable content version cleanup and server election

* Reference Umbraco.Tests.AcceptanceTest.UmbracoProject instead of copying files

* Suspend/disable scheduled publishing

* Ensure all Playwright results are copied to the artifact staging directory

* Update E2E SQL Server job and also run on Linux

* Fix building acceptance test project

* Fix building acceptance test project (suing PrivateAssets)

* Explicitly disable building project references in E2E tests and use pre-built output

* Include obj folder of acceptance test project in build artifacts

* Download build artifacts

* Re-add PrivateAssets

* Revert to copying C# files to E2E application

* Disable Integrated Security for SQL Server on Linux

* Update SQL Server on Linux connection string

* Disable encryption on SQL Server for Linux

* Update SQL Server on Linux steps

* Add Database to SQL Server connection string on Linux

* Update Integration Tests and use SQL Server 2022 Docker image

---------

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2024-02-02 10:17:40 +01:00
Sven GeusensandBjarke Berg 802758ed59 Fixed nested RTE's index method not being called due to obsolete fallbacks (#15670)
Co-authored-by: Sven Geusens <sge@umbraco.dk>
(cherry picked from commit 1e72b1cf0b)
2024-02-02 08:25:23 +01:00
1e72b1cf0b Fixed nested RTE's index method not being called due to obsolete fallbacks (#15670)
Co-authored-by: Sven Geusens <sge@umbraco.dk>
2024-02-02 08:22:51 +01:00
Jacob Overgaard 5c33c6fbf6 Login assets should be built independently of the Backoffice (#15668)
* picked from v14/dev to distinguish between Belle and Login so the correct assets are being built when you run Umbraco.Web.UI

* syntax
2024-02-01 15:52:41 +01:00
Jacob OvergaardandGitHub 836d45e5c5 Login assets should be built independently of the Backoffice (#15668)
* picked from v14/dev to distinguish between Belle and Login so the correct assets are being built when you run Umbraco.Web.UI

* syntax
2024-02-01 14:36:37 +00:00
Sebastiaan Janssen c18ec80e34 Merge branch 'v13/dev' into contrib 2024-02-01 12:45:39 +01:00
Bjarke Berg 13299a2c73 Merge remote-tracking branch 'origin/v12/dev' into v13/dev 2024-02-01 11:19:12 +01:00
Bjarke Berg 49acf8b35c Merge remote-tracking branch 'origin/release/13.1' into v13/dev
# Conflicts:
#	version.json
2024-02-01 11:18:58 +01:00
Bjarke Berg 23ee6fa83f Merge remote-tracking branch 'origin/release/12.3' into v12/dev
# Conflicts:
#	version.json
2024-02-01 11:11:58 +01:00
Bjarke Berg adb67c709b Merge remote-tracking branch 'origin/v10/dev' into v11/dev 2024-02-01 11:11:10 +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 25139dabe0 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 10:29:31 +01:00
Bjarke Berg e7c53d4768 V10+ version of https://github.com/umbraco/Umbraco-CMS/pull/15638 (#15664) 2024-02-01 10:29:28 +01:00
Ronald BarendseandBjarke Berg 4aed6a1034 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 10:13:00 +01:00
Bjarke Berg ac02e97e0c V10+ version of https://github.com/umbraco/Umbraco-CMS/pull/15638 (#15664) 2024-02-01 10:01:52 +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
Bjarke Berg 94b8c11f0f Do not dispose EF Core contexts manually (#15649)
* Attempt to fix #15090. Save connection string in private variable after setup.

* Do not dispose ef core contexts when if the connectionstring changes.

A Ef core context is protected from creations when no connection string is present. If it changes that single instance will continue with the connection string it was initialized with.

* Clean up

* Review Equals methods

(cherry picked from commit 5146f05625)
2024-01-31 15:09:32 +01:00
Bjarke BergandGitHub 5146f05625 Do not dispose EF Core contexts manually (#15649)
* Attempt to fix #15090. Save connection string in private variable after setup.

* Do not dispose ef core contexts when if the connectionstring changes.

A Ef core context is protected from creations when no connection string is present. If it changes that single instance will continue with the connection string it was initialized with.

* Clean up

* Review Equals methods
2024-01-31 15:09:12 +01:00
MoleandGitHub 7379a752f1 Obsolete old migrations (#15650) 2024-01-31 12:10:07 +01:00
AleksanderandBjarke Berg 5b102e3b8e 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:55:34 +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
Sebastiaan Janssen db545a33e1 Merge branch 'v13/dev' into contrib 2024-01-31 10:49:42 +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
Bjarke Berg ec25c3a61d Bump version 2024-01-30 15:52:25 +01:00
Bjarke Berg b22c7b5350 Bump version 2024-01-30 15:51:11 +01:00
Bjarne FyrstenborgandGitHub f9bdbb0539 Media picker crop image size (#15574)
* Remove empty comment

* Formatting

* Return full size for image crop like Image Cropper does
2024-01-30 12:43:44 +00:00
Rachel DrakeandMichael Latouche 2d2d17d928 Fixing #14088.
Match content finder functionality in the url provider for umbracoUrlAlias.
2024-01-30 03:02:42 +01:00
Erik-Jan WestendorpandGitHub 7256d49761 Use constants for all webhook event aliases (#15492)
* Use constants for all webhook event aliases

* Fix
2024-01-30 02:52:50 +01:00
Ronald BarendseandGitHub 9799c550f4 Create shadow file systems in configured LocalTempPath (#15637) 2024-01-29 08:48:45 +01:00
Nikolaj Brask-NielsenandGitHub 860acd7ba1 feat: Make JSON tag value fallback (#14856)
* feat: Make JSON tag value fallback

* feat: Make fix more concise

* feat: Add try catch
2024-01-28 10:40:24 +01:00
Bjarne FyrstenborgandMichael Latouche 62bc748a87 Map webhook id property 2024-01-26 22:29:06 +01:00
MrJackWilsonandGitHub f1db40392f Fix for issue 15598 (#15617)
* Make GetIndexValues virtual

* First try get values as JSON. If empty, try as CSV.
2024-01-26 22:09:56 +01:00
Sven Geusens fd8c31908d Merge branch 'release/13.1.0' into v13/dev
# Conflicts:
#	version.json
2024-01-25 12:40:32 +01:00
Jacob Overgaard 802e5a8c27 update apidocs ui section to Umbraco 13 2024-01-24 16:29:00 +01:00
Sven Geusens 0821fb64bb version bump 2024-01-24 10:47:06 +01:00
Bjarke Berg a12361deb5 Fixed test 2024-01-23 18:56:47 +01:00
Bjarke Berg 61a28c9b34 Merge remote-tracking branch 'origin/v12/dev' into v13/dev 2024-01-23 16:21:59 +01:00
Bjarke Berg c24cd2e53b Merge remote-tracking branch 'origin/v11/dev' into v12/dev 2024-01-23 16:20:48 +01:00
Bjarke Berg 1886553148 Merge remote-tracking branch 'origin/v10/dev' into v11/dev 2024-01-23 16:20:24 +01:00
Ronald BarendseandGitHub b7e43a8def Get references from macro parameters using IDataValueReferenceFactory (#15625) 2024-01-23 16:08:17 +01:00
Bjarke Berg b3d6c60ce2 Revert breaking changes 2024-01-23 14:46:58 +01:00
Bjarke Berg 4421b920f0 Revert breaking changes 2024-01-23 14:26:47 +01:00
Bjarke Berg b853a5e14a Revert breaking changes 2024-01-23 14:11:42 +01:00
Bjarke Berg 088f907dcc Merge remote-tracking branch 'origin/v12/dev' into v13/dev
# Conflicts:
#	src/Umbraco.Core/PropertyEditors/DataValueReferenceFactoryCollection.cs
#	src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ContentRepositoryBase.cs
#	src/Umbraco.Infrastructure/PropertyEditors/BlockEditorPropertyValueEditor.cs
#	tests/Umbraco.Tests.UnitTests/Umbraco.Core/PropertyEditors/DataValueEditorReuseTests.cs
#	tests/Umbraco.Tests.UnitTests/Umbraco.Core/PropertyEditors/DataValueReferenceFactoryCollectionTests.cs
2024-01-23 13:40:07 +01:00
Bjarke Berg 5b44503577 Merge remote-tracking branch 'origin/v11/dev' into v12/dev
# Conflicts:
#	src/Umbraco.Core/PropertyEditors/DataValueReferenceFactoryCollection.cs
#	src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ContentRepositoryBase.cs
#	src/Umbraco.Infrastructure/PropertyEditors/BlockEditorPropertyValueEditor.cs
#	src/Umbraco.Infrastructure/PropertyEditors/NestedContentPropertyEditor.cs
2024-01-23 09:40:07 +01:00
Bjarke Berg e55921ce80 Merge remote-tracking branch 'origin/v10/dev' into v11/dev 2024-01-23 09:35:52 +01:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
e04c4a89ad Bump vite from 4.5.1 to 4.5.2 in /src/Umbraco.Web.UI.Login (#15616)
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 4.5.1 to 4.5.2.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v4.5.2/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v4.5.2/packages/vite)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-22 16:59:49 +01:00
Bjarke BergandGitHub 5940a54585 Updated minor and patch dependencies. (#15619) 2024-01-22 15:40:26 +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
Jacob OvergaardandGitHub f3ed935213 allow the blockeditormodelobject.service.js to fall back to -20 for currentPageId if we are not in an editor mode (#15615)
we detect the editor mode by checking for `contentTypeKey` which only exists on content contexts
2024-01-22 13:37:15 +01:00
Liam LavertyandGitHub dd3ab3a0dc Temp/15591 serilog string conventions (#15592)
* Updaets `MigrationPlanExecutor.cs` to use serilog convention for strings

* Updaets `ExamineManagementController.cs` to use serilog convention for strings

* Updaets `HelpController.cs` to use serilog convention for strings

* Updaets `PreviewAuthenticationMiddleware.cs` to use serilog convention for strings
2024-01-22 02:57:58 +01:00
Bjarke Berg bee20b525f Post merge fix 2024-01-20 11:26:40 +01:00
f5096ba8f3 Now properly checks the lockedoutdate (#14908)
* Now properly checks the lockedoutdate

* Also fix Test (failed constructor)

* Processed feedback

* Added obsolete constructor

---------

Co-authored-by: Ambert van Unen <AvanUnen@ilionx.com>
2024-01-20 01:33:11 +01:00
Bjarke Berg fbf3e6dc71 Merge remote-tracking branch 'origin/v10/dev' into v11/dev
# Conflicts:
#	src/Umbraco.Core/Composing/BuilderCollectionBase.cs
2024-01-19 20:15:50 +01:00
Ronald BarendseandBjarke Berg ce22315520 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

(cherry picked from commit 5198e7c52d)
2024-01-19 20:06:41 +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
LFLavertyandLaura Neto 4bc36a7eb8 Updates to the new media article link 2024-01-19 17:51:49 +01:00
Søren KottalandSven Geusens bc803ae78b Fix RTE block rendering failing (#15583)
Adds optional class attribute to regex responsible for parsing RTE values to block models
2024-01-19 13:22:46 +01:00
Søren KottalandGitHub b0b98865c6 Fix RTE block rendering failing (#15583)
Adds optional class attribute to regex responsible for parsing RTE values to block models
2024-01-19 13:21:17 +01:00
Jacob Overgaardandleekelleher 9df6e65552 V13: Rich text editor does not show its toolbar on grid layout rte's (#15595)
* synchronize normal rte with grid-rte

* restore pinToolbar and unpinToolbar from v10 and update to tinymce v6 and apply to grid-rte

* linting

* Reverting `pinToolbar` from v8

* remove unused variable

---------

Co-authored-by: leekelleher <leekelleher@gmail.com>
2024-01-19 09:11:40 +01:00
9196d7ad00 V13: Rich text editor does not show its toolbar on grid layout rte's (#15595)
* synchronize normal rte with grid-rte

* restore pinToolbar and unpinToolbar from v10 and update to tinymce v6 and apply to grid-rte

* linting

* Reverting `pinToolbar` from v8

* remove unused variable

---------

Co-authored-by: leekelleher <leekelleher@gmail.com>
2024-01-18 13:19:36 +01:00
Jacob Overgaard 14299b6674 bump version to 13.2.0-rc 2024-01-17 15:10:14 +01:00
Erik-Jan WestendorpandMichael Latouche 8088b726b4 localize webhook edit view 2024-01-17 02:09:59 +01:00
Kenn JacobsenandGitHub a70c606c27 Do not log direct query inputs (#15577) 2024-01-15 14:14:27 +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
Nikolaj Geisle 597d8553c0 bump version.json 2024-01-11 12:49:33 +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
d3dc85f31f Only update security stamp once per request (#15562)
* Add item in requestcache when security stamp is already updated in request

* Propagate constructur obsoletion to implementing services and fix unit tests

---------

Co-authored-by: kjac <kja@umbraco.dk>
2024-01-11 10:20:58 +01:00
Jacob OvergaardandGitHub b916c85738 V13: TinyMCE does not toggle plugin buttons (#15558)
* bump tinymce from 6.8.1 to 6.8.2

* replace stateSelector with appropriate onSetup() functionality and replace addButton() with addToggleButton() to support toggling
2024-01-10 15:30:51 +01:00
Niels LyngsøandGitHub 83a0bf4f4b Fix: No Blocks Mode for RTE when required context for Blocks is not present (#15556)
* noBlocksMode

* another blockEditorApi check
2024-01-10 14:53:26 +01:00
Sven GeusensandZeegaan 9da46462f7 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-10 12:27:11 +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
Bjarke Berg f381e8391c Merge remote-tracking branch 'origin/v12/dev' into v13/dev
# Conflicts:
#	src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ContentRepositoryBase.cs
2024-01-10 08:32:02 +01:00
Bjarke Berg a4f6c5d355 Merge remote-tracking branch 'origin/v11/dev' into v12/dev 2024-01-10 07:46:45 +01:00
Bjarke Berg 4463d04850 Merge remote-tracking branch 'origin/v10/dev' into v11/dev 2024-01-10 07:44:30 +01:00
dependabot[bot]andSebastiaan Janssen 2e61d6449a Bump follow-redirects in /src/Umbraco.Web.UI.Client
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.14.9 to 1.15.4.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.14.9...v1.15.4)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-09 10:57:36 +01:00
dependabot[bot]andSebastiaan Janssen e8eec901d1 Bump follow-redirects in /tests/Umbraco.Tests.AcceptanceTest
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.3 to 1.15.4.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.15.3...v1.15.4)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-09 10:57:13 +01:00
Sebastiaan Janssen 94e8bc1db6 Merge branch 'v13/dev' into contrib 2024-01-09 08:59:48 +01:00
Markus JohanssonandSebastiaan Janssen 704aebed0c Fixes #15512 to allow curly braces in anchors 2024-01-08 15:23:25 +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
JesmoDevandGitHub 06fdf8d3dc use opacity instead of hardcoded color (#15534) 2024-01-08 09:41:37 +01:00
Jacob OvergaardandGitHub 77861ae55b V13: Load TinyMCE premium plugins through tiny.cloud (#15367)
* add tinymce cloud api key to configuration

* forward apikey through proxied config object after retrieving it from the server

* load the plugins.min.js file from tiny.cloud if cloud api key is set

* bump tinymce from 6.7.3 to 6.8.1

* disable premium promotion and make plugins unique

* make sure tinymce local assets are loaded before trying to load the plugins.js from cloud and before configuring tinymce
2024-01-08 08:58:57 +01:00
alevak09andGitHub cceabf88cd Update hr.xml (#15413)
Update croatian translation language file
2024-01-05 16:24:54 +00:00
Bjarne FyrstenborgandGitHub 425023f83b Ensure datepicker input is cleared (#15338) 2024-01-05 15:23:57 +00:00
Erik-Jan WestendorpandMichael Latouche 6c725dbd67 Fix aliases 2024-01-03 13:20:12 +01:00
Andy ButlandandGitHub 99119a506f Ensured removal of any auto-relations from custom relation types used in nested property values, to ensure there will be no duplicate error when the relations are saved. (#15447) 2024-01-03 10:50:58 +01:00
Shannon DeminickandGitHub a36c7beabf Decouple Lucene from Content Delivery API (#15493)
* Decouples Lucene from the Content Delivery API

* oops removes other refs
2024-01-02 16:20:53 +01:00
Sebastiaan Janssen 6258fa6a35 Merge branch 'v13/dev' into contrib
# Conflicts:
#	src/Umbraco.Cms.StaticAssets/umbraco/UmbracoBackOffice/Default.cshtml
#	src/Umbraco.Core/EmbeddedResources/Lang/en.xml
#	src/Umbraco.Web.UI.Client/src/common/services/blockeditormodelobject.service.js
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Login/login.spec.ts
2024-01-02 10:33:35 +01:00
Bjarke Berg 8b82addd53 Merge remote-tracking branch 'origin/v12/dev' into v13/dev 2023-12-22 14:11:21 +01:00
Bjarke Berg 3538737681 Merge remote-tracking branch 'origin/v11/dev' into v12/dev 2023-12-22 14:10:57 +01:00
Bjarke Berg b0c5101b2b fix build 2023-12-22 14:10:00 +01:00
Bjarke Berg 23341c8f35 Merge remote-tracking branch 'origin/v12/dev' into v13/dev 2023-12-22 14:06:50 +01:00
Bjarke Berg 4489cf45d1 Merge remote-tracking branch 'origin/v11/dev' into v12/dev 2023-12-22 14:06:05 +01:00
Bjarke Berg 91e37b80e3 Merge remote-tracking branch 'origin/v10/dev' into v11/dev 2023-12-22 14:05:12 +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
Bjarke Berg 52810b9ee1 Merge branch 'release/13.0' into v13/dev
# Conflicts:
#	version.json
2023-12-21 19:16:44 +01:00
Bjarke Berg a0f3c158df Bump version 2023-12-21 14:56:26 +01:00
Ronald BarendseandBjarke Berg 1e55ac97cd Ensure artifact dependency keeps correct mode, ordering and checksum values (#15500)
(cherry picked from commit f705479767)
2023-12-21 14:56:06 +01:00
Ronald BarendseandGitHub f705479767 Ensure artifact dependency keeps correct mode, ordering and checksum values (#15500) 2023-12-21 14:55:43 +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 5b29843b9f Merge remote-tracking branch 'origin/v12/dev' into v13/dev 2023-12-20 15:13:55 +01:00
Bjarke Berg c1766b0c57 Merge remote-tracking branch 'origin/v11/dev' into v12/dev 2023-12-20 15:13:24 +01:00
Bjarke Berg 851e060a25 Merge remote-tracking branch 'origin/v10/dev' into v11/dev 2023-12-20 15:13:06 +01:00
Bjarke Berg 0b811d6648 Reenabled package validation and fixed breaking change in test 2023-12-20 13:36:01 +01:00
Bjarke Berg 28fc85a96c Merge remote-tracking branch 'origin/release/13.0' into v13/dev
# Conflicts:
#	version.json
2023-12-20 09:52:57 +01:00
Bjarke Berg b1d9573e47 Merge remote-tracking branch 'origin/release/12.3' into v12/dev
# Conflicts:
#	version.json
2023-12-20 09:52:16 +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 JacobsenandBjarke Berg e8a81e30b1 Add policies for content template handling (#15482) 2023-12-19 14:22:09 +01:00
Bjarke Berg 11cef81c77 Bump version 2023-12-19 14:21:00 +01:00
Kenn JacobsenandBjarke Berg e34b2c09e0 Add policies for content template handling (#15482) 2023-12-19 14:20:31 +01:00
Kenn JacobsenandGitHub e04a41be45 Add policies for content template handling (#15482) 2023-12-19 14:18:48 +01:00
78850087f8 Added a temporary DataCollector for v14 editorAlias migrations (#15463)
* Added a temporary DataCollector for v14 editorAlias migrations

* PR feedback

Do not run the collector on subscribers or non running instances
Reduced logger noise

* Extra v14 sanity check

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
2023-12-19 14:18:10 +01:00
Chris Fitz-AvonandBjarke Berg 38f7df2b0c Remove content section access policy from GetAllLanguages endpoint. #15435 (#15450)
(cherry picked from commit cedfdcc9b2)
2023-12-18 08:27:01 +01:00
Bjarke Berg f9ea546c66 Bump version 2023-12-18 08:26:38 +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 BergandGitHub bf498b411c RebuildOnStartupHandler should not inject ExamineIndexRebuilder, but only the interface (#15465) 2023-12-18 06:58:12 +01:00
Nikolaj Geisle 8ecc5552ab Merge branch 'release/13.0' into v13/dev
# Conflicts:
#	version.json
2023-12-14 16:33:27 +01:00
Nikolaj GeisleandGitHub 36b7b86384 Remove sections setting authorization policy (#15456) 2023-12-14 13:57:52 +01:00
Chris Fitz-AvonandNikolaj Geisle cedfdcc9b2 Remove content section access policy from GetAllLanguages endpoint. #15435 (#15450) 2023-12-14 13:54:40 +01:00
Chris Fitz-AvonandGitHub c9feaa150e Remove content section access policy from GetAllLanguages endpoint. #15435 (#15450) 2023-12-14 13:49:46 +01:00
Nikolaj GeisleandGitHub c930b91ede 13: Add old databasemodel to ChangeLogStatusCode migration (#15454)
* Add old model to migration and use that instead

* Remove new column
2023-12-14 11:44:55 +01:00
Nikolaj Geisle 02188393f2 bumb version 2023-12-14 09:11:37 +01:00
Bjarke Berg 38879e11df Merge remote-tracking branch 'origin/release/13.0' into v13/dev
# Conflicts:
#	src/Umbraco.Infrastructure/Persistence/Repositories/Implement/CreatedPackageSchemaRepository.cs
#	version.json
2023-12-13 10:44:10 +01:00
Bjarke Berg 8a9e6ee82d Merge remote-tracking branch 'origin/v12/dev' into v13/dev
# Conflicts:
#	global.json
#	src/Umbraco.Cms.StaticAssets/umbraco/UmbracoBackOffice/Default.cshtml
#	src/Umbraco.Cms.StaticAssets/wwwroot/App_Plugins/Umbraco.BlockGridEditor.DefaultCustomViews/umbBlockGridDemoRichTextBlock.html
#	src/Umbraco.Core/EmbeddedResources/Lang/da.xml
#	src/Umbraco.Core/EmbeddedResources/Lang/en.xml
#	src/Umbraco.Core/EmbeddedResources/Lang/fr.xml
#	src/Umbraco.Core/EmbeddedResources/Lang/tr.xml
#	src/Umbraco.Core/Models/PublishedContent/PublishedPropertyType.cs
#	src/Umbraco.Infrastructure/BackgroundJobs/Jobs/HealthCheckNotifierJob.cs
#	src/Umbraco.Infrastructure/BackgroundJobs/RecurringBackgroundJobHostedServiceRunner.cs
#	src/Umbraco.Web.Common/DependencyInjection/UmbracoBuilderExtensions.cs
#	src/Umbraco.Web.UI.Client/src/common/services/blockeditormodelobject.service.js
#	src/Umbraco.Web.UI.Client/src/common/services/editor.service.js
#	src/Umbraco.Web.UI.Client/src/views/components/application/umb-login.html
#	src/Umbraco.Web.UI/Startup.cs
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Login/login.spec.ts
#	tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/BackgroundJobs/Jobs/HealthCheckNotifierJobTests.cs
#	version.json
2023-12-13 09:55:34 +01:00
Bjarke Berg bd3a26801d Merge remote-tracking branch 'origin/v11/dev' into v12/dev 2023-12-13 09:36:55 +01:00
Bjarke Berg 5a4aaae7f2 Merge remote-tracking branch 'origin/release/12.3' into v12/dev
# Conflicts:
#	version.json
2023-12-13 09:36:44 +01:00
Bjarke Berg 4e12f1e4e6 Merge remote-tracking branch 'origin/release/12.3.4' into v12/dev 2023-12-13 09:36:25 +01:00
Bjarke Berg 923c98a29f Merge remote-tracking branch 'origin/v10/dev' into v11/dev
# Conflicts:
#	src/Umbraco.Web.BackOffice/Controllers/LanguageController.cs
2023-12-13 09:31:54 +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
Bjarke Berg 9dfb3005bc fix build 2023-12-12 17:00:30 +01:00
Bjarke Berg c2c1285d17 Fix json schema 2023-12-12 15:56:54 +01:00
Nikolaj Geisleandkjac 3720b5d930 Merge pull request from GHSA-v98m-398x-269r
Co-authored-by: kjac <kja@umbraco.dk>
2023-12-12 15:56:44 +01:00
Nikolaj GeisleandZeegaan d0c5372c6b Merge pull request from GHSA-cfr5-7p54-4qg8
* Apply authorization policies to controllers

* Return bad request if we urltracking is disabled

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-12-12 15:56:44 +01:00
f7e4832898 Merge pull request from GHSA-8qp8-9rpw-j46c
* Ensure that missing access rules do not break the site (#15081)

(cherry picked from commit 6777145079)

* 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: Kenn Jacobsen <kja@umbraco.dk>
Co-authored-by: jey <jey@umbraco.dk>
Co-authored-by: Jey <cyaqublu@gmail.com>
2023-12-12 15:56:31 +01:00
Nikolaj GeisleandZeegaan b3caf747df Merge pull request from GHSA-6324-52pr-h4p5
Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-12-12 15:56:13 +01:00
ZeegaanandNikolaj Geisle 497927303f Suppress flow when queueing background threads 2023-12-12 15:55:05 +01:00
ZeegaanandBjarke Berg 13079eb667 Loosen up policies so editors can get what they need 2023-12-12 15:50:09 +01:00
ZeegaanandBjarke Berg 73fab105d2 Loosen up policies so editors can get what they need 2023-12-12 15:48:37 +01:00
Bjarke Berg 0c355b0cf1 Bump version 2023-12-12 15:47:43 +01:00
Bjarke Berg 0ed0338d8f Merge remote-tracking branch 'origin/release/12.3.4' into release/12.3 2023-12-12 15:47:28 +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
Jacob OvergaardandGitHub 6f123224de V13: Regression with global window.uui export (#15412)
* revert change to load commonjs version of uui

* revert to load uui

* build login first

* build login assets as iife to support loading inside the backoffice
2023-12-12 12:03:49 +01:00
Zeegaan e37e2b5973 bump version 2023-12-12 11:20:44 +01:00
Kenn JacobsenandGitHub fa0b8c7b4d Ensure thread safety for block editor constructor caches (#15425) 2023-12-12 09:55:56 +01:00
Bjarke Berg fe6d6f7156 Post fix 2023-12-11 16:43:21 +01:00
Bjarke Berg 4a0d364d10 Post fix 2023-12-11 16:33:56 +01:00
Bjarke Berg 5dfa76600a Post fix 2023-12-11 16:32:38 +01:00
Bjarke Berg 4b78fabd54 Merge remote-tracking branch 'origin/v10/dev' into v11/dev
# Conflicts:
#	src/Umbraco.Web.UI.Client/src/views/common/login.controller.js
2023-12-11 14:41:17 +01:00
Bjarke Berg bab22d8b5f Merge remote-tracking branch 'origin/release/12.3.4' into release/13.0
# Conflicts:
#	version.json
2023-12-11 14:39:32 +01:00
Bjarke Berg 9f375ede65 Merge remote-tracking branch 'origin/release/12.3.4' into v12/dev 2023-12-11 14:37:36 +01:00
Bjarke Berg 83bcd37250 Merge remote-tracking branch 'origin/release/10.8' into v10/dev 2023-12-11 14:37:10 +01:00
237e4e56b2 Merge pull request from GHSA-v98m-398x-269r
Co-authored-by: kjac <kja@umbraco.dk>
2023-12-11 14:00:23 +01:00
Kenn JacobsenandGitHub 4a7ad4a562 Merge pull request from GHSA-v98m-398x-269r 2023-12-11 14:00:23 +01:00
42ae37e502 Merge pull request from GHSA-cfr5-7p54-4qg8
* Apply authorization policies to controllers

* Return bad request if we urltracking is disabled

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-12-11 13:59:59 +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
3331788c5c Merge pull request from GHSA-8qp8-9rpw-j46c
* Ensure that missing access rules do not break the site (#15081)

(cherry picked from commit 6777145079)

* 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: Kenn Jacobsen <kja@umbraco.dk>
Co-authored-by: jey <jey@umbraco.dk>
Co-authored-by: Jey <cyaqublu@gmail.com>
2023-12-11 13:59:35 +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
50a107f885 Merge pull request from GHSA-6324-52pr-h4p5
Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-12-11 13:59:03 +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 3a697d90fc Suppress flow when queueing background threads 2023-12-11 12:44:06 +01:00
ZeegaanandBjarke Berg b5544aa520 Suppress flow when queueing background threads 2023-12-11 12:43:25 +01:00
Ronald BarendseandGitHub 406848b76f Remove date header from webhook request and use constants (#15407)
* Remove date header

* Move webhook event header names to constants
2023-12-11 08:49:37 +01:00
Kenn JacobsenandGitHub d752853d89 Fix disposed DbContext issue (#15090) (#15410) 2023-12-10 19:18:32 +01:00
Sebastiaan Janssen 422218ea15 Merge branch 'v13/dev' into contrib 2023-12-08 15:54:34 +01:00
Sebastiaan Janssen 6f582451ed Merge branch 'release/13.0' into v13/dev
# Conflicts:
#	version.json
2023-12-08 15:54:06 +01:00
Andreas ZerbstandSebastiaan Janssen 258ab59286 Updated the keys for adding a block list 2023-12-08 15:00:47 +01:00
Ronald BarendseandGitHub 9e96bba9bc Disable transitive package version pinning (#15406)
* Disable transitive package version pinning

* Take top-level dependencies on Azure.Identity and System.Net.Http

* Take top-level dependencies on System.Security.Cryptography.Xml and System.Text.RegularExpressions
2023-12-08 15:00:18 +01:00
Bjarke Berg cf2ec50d15 Merge remote-tracking branch 'origin/release/12.3.4' into v12/dev
# Conflicts:
#	version.json
2023-12-08 13:34:41 +01:00
Bjarke Berg 614cb5da20 Merge remote-tracking branch 'origin/v10/dev' into v11/dev 2023-12-08 13:30:20 +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
Sebastiaan Janssen 75ec1f82ac Merge branch 'contrib' of https://github.com/umbraco/Umbraco-CMS into contrib 2023-12-08 12:42:39 +01:00
Sebastiaan Janssen 67c8f098a0 Add login screen to the readme 2023-12-08 12:42:29 +01:00
Zeegaan f65e76ba5a Bump version 2023-12-08 09:04:51 +01:00
Bjarne FyrstenborgandGitHub 87b8023f2c Fix typo in dictionary (#15380) 2023-12-07 17:51:28 +00:00
Nikolaj Geisle 4b5bbbd531 Change webhook-> logs to Deliveries 2023-12-07 15:23:21 +01:00
Nikolaj GeisleandGitHub b50353b238 V13: Log webhook firing exceptions when they happen (#15393)
* Refactor Webhook logging to handle exceptions

* Add Exception occured property to WebhookLog.
2023-12-07 14:25:26 +01:00
Nikolaj GeisleandGitHub d31bb14f57 Link to log on exception/error (#15391) 2023-12-07 12:11:38 +01:00
Nikolaj GeisleandGitHub 0534c5f776 Log retrycount and properly log request headers (#15390) 2023-12-07 12:10:19 +01:00
Bjarke BergandGitHub 1a93dae0c4 Ensure the toggles return booleans and not integers. (#15354) 2023-12-07 11:25:31 +01:00
Nikolaj GeisleandGitHub 80a6ec44ba Migrate url columms to NVarCharMax (#15331) 2023-12-07 10:26:55 +01:00
4ff2572d78 Use named HttpClients (#15375)
* Use named HttpClients

* Register as named client

* Set headers on request message.

* Add User agent header to http client

* Add headers within Try-catch

* Add using for HttpResponseMessage

* Update src/Umbraco.Infrastructure/BackgroundJobs/Jobs/WebhookFiring.cs

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

* Update src/Umbraco.Infrastructure/BackgroundJobs/Jobs/WebhookFiring.cs

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

* Log key instead of entire webhook

* Update src/Umbraco.Web.Common/DependencyInjection/UmbracoBuilderExtensions.cs

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

* Create constant for User agent header name

* Update src/Umbraco.Infrastructure/BackgroundJobs/Jobs/WebhookFiring.cs

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

* Use datetime.now

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
Co-authored-by: Ronald Barendse <ronald@barend.se>
Co-authored-by: Kenn Jacobsen <kja@umbraco.dk>
2023-12-07 09:51:44 +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
Bjarne FyrstenborgandSebastiaan Janssen b97564ba3a Fix console errors in content type editor with single block mode 2023-12-06 14:15:15 +01:00
dependabot[bot]andSebastiaan Janssen 4bea40dfb4 Bump vite from 4.5.0 to 4.5.1 in /src/Umbraco.Web.UI.Login
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 4.5.0 to 4.5.1.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v4.5.1/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v4.5.1/packages/vite)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-06 14:05:39 +01:00
Sebastiaan Janssen 5a159a756d Merge branch 'v13/dev' into contrib
# Conflicts:
#	global.json
#	src/Umbraco.Cms.StaticAssets/umbraco/UmbracoBackOffice/Default.cshtml
#	src/Umbraco.Cms.StaticAssets/wwwroot/App_Plugins/Umbraco.BlockGridEditor.DefaultCustomViews/umbBlockGridDemoRichTextBlock.html
#	src/Umbraco.Core/EmbeddedResources/Lang/da.xml
#	src/Umbraco.Core/EmbeddedResources/Lang/en.xml
#	src/Umbraco.Core/EmbeddedResources/Lang/fr.xml
#	src/Umbraco.Core/EmbeddedResources/Lang/tr.xml
#	src/Umbraco.Core/Models/PublishedContent/PublishedPropertyType.cs
#	src/Umbraco.Infrastructure/BackgroundJobs/Jobs/HealthCheckNotifierJob.cs
#	src/Umbraco.Infrastructure/BackgroundJobs/RecurringBackgroundJobHostedServiceRunner.cs
#	src/Umbraco.Web.Common/DependencyInjection/UmbracoBuilderExtensions.cs
#	src/Umbraco.Web.UI.Client/src/common/services/blockeditormodelobject.service.js
#	src/Umbraco.Web.UI.Client/src/common/services/editor.service.js
#	src/Umbraco.Web.UI/Startup.cs
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Login/login.spec.ts
#	tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/BackgroundJobs/Jobs/HealthCheckNotifierJobTests.cs
2023-12-06 13:06:30 +01:00
Sebastiaan Janssen 024a57e098 Merge branch 'v12/dev' into v13/dev
# Conflicts:
#	global.json
#	src/Umbraco.Cms.StaticAssets/umbraco/UmbracoBackOffice/Default.cshtml
#	src/Umbraco.Cms.StaticAssets/wwwroot/App_Plugins/Umbraco.BlockGridEditor.DefaultCustomViews/umbBlockGridDemoRichTextBlock.html
#	src/Umbraco.Core/EmbeddedResources/Lang/da.xml
#	src/Umbraco.Core/EmbeddedResources/Lang/en.xml
#	src/Umbraco.Core/EmbeddedResources/Lang/tr.xml
#	src/Umbraco.Core/Models/PublishedContent/PublishedPropertyType.cs
#	src/Umbraco.Infrastructure/BackgroundJobs/Jobs/HealthCheckNotifierJob.cs
#	src/Umbraco.Infrastructure/BackgroundJobs/RecurringBackgroundJobHostedServiceRunner.cs
#	src/Umbraco.Web.Common/DependencyInjection/UmbracoBuilderExtensions.cs
#	src/Umbraco.Web.UI.Client/src/common/services/blockeditormodelobject.service.js
#	src/Umbraco.Web.UI.Client/src/common/services/editor.service.js
#	src/Umbraco.Web.UI/Startup.cs
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Login/login.spec.ts
#	tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/BackgroundJobs/Jobs/HealthCheckNotifierJobTests.cs

(cherry picked from commit ef3f2c48198d8baed9d3340f926cd07e80720428)
2023-12-06 12:47:51 +01:00
Bjarke Berg 312276bde7 Bump version 2023-12-06 10:21:46 +01:00
Kenn JacobsenandGitHub 370e1cc125 Media Picker 3 should not be used as a macro parameter (#15330) 2023-12-06 10:18:23 +01:00
Sebastiaan Janssen a31d4746b3 Merge branch 'contrib' into v12/dev 2023-12-06 10:00:22 +01:00
Bjarke Berg 9a54b5ed6e Merge remote-tracking branch 'origin/release/13.0' into v13/dev 2023-12-06 08:28:44 +01:00
Ronald BarendseandGitHub 8fefca557f Improve Central Package Management, update dependencies and fix package validation/MSBuild warnings (#15362)
* Use version overrides for ImageSharp 2

* Move Directory.Packages.props to root, use GlobalPackageReference and replace Microsoft.CSharp with Microsoft.CodeAnalysis.CSharp

* Replace NPoco.SqlServer with NPoco and remove unused System dependencies

* Fix package validation and MSBuild warnings

* Add nuget.config and enable package source mapping

* Remove explicitly set C# language version

* Add empty Directory.Packages.props file for acceptance test

* Downgrade SixLabors.ImageSharp back to 3.0.2 because of breaking changes

* Update ImageSharp/ImageSharp.Web to 3.1.0 and use ComputeHMAC
2023-12-06 08:19:46 +01:00
Richard OckerbyandLaura Neto 17eda54bfb Don't overwrite default values in the block list editor if they don't exist in the data model (for new creations) 2023-12-05 21:22:45 +01:00
Sebastiaan JanssenandGitHub a6b53b0a93 Fixing PR #15318 which updated an interface, which is breaking (#15363) 2023-12-05 16:49:55 +01:00
Jacob Overgaard 25e36871d7 use dotnet 8 2023-12-05 13:15:03 +01:00
Jacob Overgaard 0a048d9231 Update nightly build (#15359)
* cherry-pick templateParameters from v14/dev

* add isNightly parameter

* remove v9

* add parameter check for myget isNightly
2023-12-05 13:01:19 +01:00
Jacob Overgaard d3f0506f0b Merge remote-tracking branch 'origin/v11/dev' into v12/dev 2023-12-05 12:58:36 +01:00
Jacob Overgaard 051dfd1fff Merge remote-tracking branch 'origin/v10/dev' into v11/dev 2023-12-05 12:57:47 +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
Sebastiaan Janssen 14a64857df Merge branch 'contrib' of https://github.com/umbraco/Umbraco-CMS into contrib 2023-12-05 12:41:21 +01:00
Jacob OvergaardandGitHub 79af9e8e2b 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:38:14 +01:00
Sebastiaan Janssen 319d98ef23 Merge branch 'v12/dev' into contrib 2023-12-05 12:36:34 +01:00
Kenn JacobsenandGitHub e7279d2ff0 Add range filter options to the Delivery API (#15353)
* Add range filter options to the Delivery API

* Add range filter examples to Swagger docs
2023-12-05 11:01:25 +01:00
Ronald BarendseandGitHub c598171d85 Change WebhookEventCollectionBuilder to set collection (#15351)
* Change WebhookEventCollectionBuilder to set collection

* Fix AddHealthCheck extension method
2023-12-05 10:33:47 +01:00
Ronald BarendseandGitHub 12a43c2406 v13: Update deploy types (add setter to ArtifactDependency.Checksum and TryGetValue()/GetEntityTypes() to IFileTypeCollection) (#15318) 2023-12-04 16:00:54 +01:00
Erik-Jan WestendorpandSebastiaan Janssen d5c137583d AddDynamicRootStep 2023-12-04 15:00:03 +01:00
Sebastiaan Janssen 941705b03d Revert "Grant all users access to the content recycle bin (#14977)"
This reverts commit ed006931a4.
2023-12-04 14:34:47 +01:00
Ronald Barendse 8a65c00279 Fix health check webhook event registration 2023-12-04 14:11:42 +01:00
Erik-Jan WestendorpandGitHub 80dcc04df0 Add HealthCheckCompletedWebhookEvent (#15337) 2023-12-04 14:04:57 +01:00
Ronald BarendseandGitHub c20d96c705 Use fluent API for adding webhook events and add document type events (#15345)
* Move adding webhooks to extension methods

* Clean up WebhookEventCollectionBuilder

* Rename AddAllAvailableWebhooks to AddCmsWebhooks and internalize defaults

* Use fluent CmsWebhookEventCollectionBuilder for adding CMS specific webhook events

* Split media and media type webhook events

* Use fluent CmsUserWebhookEventCollectionBuilder for adding CMS user specific webhook events

* Rename extension methods and add onlyDefault parameter

* Remove duplicate UserForgotPasswordRequestedWebhookEvent

* Add document type webhook events and use fluent builders for content and content types

* Use fluent WebhookEventCollectionBuilderCmsMember for adding member/member group webhook events

* Use fluent WebhookEventCollectionBuilderCmsTemplate for template/partial view webhook events

* Use fluent WebhookEventCollectionBuilderCmsFile for file based webhook events (instead of only template/partial view)

* Move all webhook events to Umbraco.Cms.Core.Webhooks.Events namespace

* Reorder AddFile method and update documentation
2023-12-04 13:25:51 +01:00
Ronald BarendseandGitHub da56f16abf Move helper methods for adding webhooks to extension methods (#15344)
* Move adding webhooks to extension methods

* Clean up WebhookEventCollectionBuilder

* Rename AddAllAvailableWebhooks to AddCmsWebhooks and internalize defaults
2023-12-04 10:58:11 +01:00
2a56d4e376 V12 Integration test for InternalIndex and ExternalIndex Search (#15167)
* Added the possibility for us to search through the external index

* Added ForceInstantExecution

* Added InternalIndex integration tests

* Added External Index integration tests

* Removed comments

* Remove unused internal field

* Add mechanism to wait for index rebuilding

* Remove some of the usages of sleep

* Remove sleeps

* Added comments from review

* Added a method for getting the IndexPath

---------

Co-authored-by: Nikolaj <nikolajlauridsen@protonmail.ch>
2023-12-04 10:00:26 +01:00
kjac 55c901e2d7 Merge branch 'v13/dev' into release/13.0 2023-12-03 14:54:11 +01:00
Bjarne FyrstenborgandGitHub c6d01178c0 Update z-index of block actions (#15329) 2023-12-01 13:51:42 +00:00
Vitor Rodriguesandkjac a4b4107190 Expose the Delivery API CLR type (#15150)
* Expose the Delivery API CLR type

* Updated field naming and warnings

Addresses PR feedback

* Added default implementation to prevent breaking change

(cherry picked from commit 7f4378066d)
2023-12-01 13:50:18 +01:00
Vitor RodriguesandGitHub 7f4378066d Expose the Delivery API CLR type (#15150)
* Expose the Delivery API CLR type

* Updated field naming and warnings

Addresses PR feedback

* Added default implementation to prevent breaking change
2023-12-01 13:43:39 +01:00
Vitor RodriguesandGitHub d315a1082e Fixed potential NuCache file lock causing unusable website (#14940)
* Fixed potential NuCache file lock causing unusable website

* Remove unnecessary volatile read
2023-12-01 13:05:50 +01:00
Ronald BarendseandGitHub 50baed151d Use version range on project references (#14719) 2023-12-01 11:12:18 +01:00
Jacob OvergaardandGitHub 8f497c8f7e V13 RC: Fix regression for external login providers (#15334)
* add check for the presence of the ?logout=true parameter on the login screen to avoid autoredirect to external login

* refactor controller to eliminate need for duplicate defaultResponse and externalLoginResponse (they are always the same)

* refactor to reduce nesting
2023-12-01 10:32:54 +01:00
Bjarne FyrstenborgandBjarke Berg da6aaa07db Don't change format in convertToLocalMomentTime (#15223)
(cherry picked from commit 963e57723a)
2023-12-01 10:03:23 +01:00
Bjarke Berg d5d4edbe92 Bump Version 2023-11-30 21:51:54 +01:00
Bjarne FyrstenborgandSebastiaan Janssen 0a718b0585 Fix log message in Verify2FACode 2023-11-30 20:03:20 +01:00
Bjarne FyrstenborgandGitHub 8c23075ec5 Adjust content type picker to support different content types (#15080) 2023-11-30 19:38:56 +01:00
Bjarne FyrstenborgandGitHub 86d98658f1 Make Block List configuration consistent with Block Grid (#15087) 2023-11-30 19:29:06 +01:00
Søren MastrupandSebastiaan Janssen e947daff45 Added password toggle to Umbraco installer form 2023-11-30 19:27:55 +01:00
Bjarne FyrstenborgandGitHub ee8339d563 Add contentTypeEditor to editorService (#15034) 2023-11-30 19:25:03 +01:00
Jan SkovgaardandGitHub 7e26d09f77 Bugfix: #14481 - Landmark roles missing (#14980) 2023-11-30 19:21:48 +01:00
Matthew WiseandSebastiaan Janssen eaf07d2189 Added logging around adding a property value during examine indexing 2023-11-30 19:16:58 +01:00
Kevin FuandSebastiaan Janssen 1d5a684fd5 fixed #14832 user without HasAccessToSensitiveData change sensitive data: IsApproved IsApproved IsTwoFactorEnabled 2023-11-30 19:15:05 +01:00
Amalie WowernandSebastiaan Janssen c893027f7c Added ReSharperTestRunner to KnownAssemblyExclusionFilter 2023-11-30 19:08:17 +01:00
Anders BjernerandSebastiaan Janssen 71a3452361 Added [NotNullWhen(true)] attribute to IPublishedSnapshotAccessor and UmbracoContextPublishedSnapshotAccessor 2023-11-30 17:23:15 +01:00
Brett SmithandGitHub ecc31a308a Added BlockEditorDataConverter method to BlockListPropertyEditorBase … (#14960) 2023-11-30 17:21:09 +01:00
Michael LatoucheandGitHub 212b566214 Add webhook labels to FR file (#15183) 2023-11-30 16:07:15 +01:00
Erik-Jan WestendorpandGitHub feaac58027 localization for webhooks (#15191) 2023-11-30 16:05:38 +01:00
Ronald BarendseandSebastiaan Janssen e7f7492ce9 Configure Angular cookie using defaults from antiforgery options and fix logging 2023-11-30 16:02:17 +01:00
Erik-Jan WestendorpandGitHub c0e0e7bad8 Add HealthCheckCompletedNotification (#15276) 2023-11-30 15:53:05 +01:00
Warren BuckleyandGitHub d088ed8bf6 V13: Webhook all the things (#15161) 2023-11-30 15:41:45 +01:00
Bjarke BergandJacob Overgaard 320310fbc0 Added "pr: none" to nightly trigger (#15044) 2023-11-30 11:43:05 +01:00
Kenn JacobsenandGitHub 528b7d346a Rollback some #14816 changes to fix 2FA (#15317) 2023-11-30 11:32:49 +01:00
Kenn JacobsenandGitHub 016709eecd Add query string info to links in API output (#15327) 2023-11-30 10:36:53 +01:00
Kenn JacobsenandGitHub b596900246 Log meaningful job names and use template based log messages (#15307)
* Log meaningful job names and use template based log messages

* Review changes
2023-11-29 15:35:43 +01:00
6b599b641c Prevent RTE in fullscreen being partially covered by the left menu column (should fix #14890) (#15002)
* Should fix #14890

* Set z-index of #leftcolumn to 0 when Tiny MCE is in fullscreen mode

---------

Co-authored-by: Jannik Anker <jaa@kfforsikring.dk>
Co-authored-by: Jason Elkin <jason@bumpdigital.co.uk>
2023-11-29 14:59:20 +01:00
leekelleherandSebastiaan Janssen b74aadff97 Block editors - replaces hardcoded -20 with current node ID 2023-11-29 14:40:37 +01:00
a8dc058cb5 V13: Delivery API composite id handler (#15305)
* Implement DeliveryApiCompositeIdHandler

* Replace duplicate decomposing with Handler instead

* Add obsolete messages

* Make Id integer instead of string

* Move from examine to core

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-11-29 14:10:25 +01:00
Kenn JacobsenandGitHub 88f907912b Cache block item constructors for block based editors (#15264)
* Cache block item constructors for block based editors

* Fix unit tests

* Fixed Grid unit tests

* Clear constructor caches when content types and data types change (to support InMemoryAuto models)
2023-11-29 12:27:07 +01:00
34d6695c89 Don't expect specific .NET feature versions - utilize rollForward instead. (#15304)
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2023-11-28 13:21:09 +01:00
Kenn JacobsenandGitHub 0a852aeb07 Don't expect specific .NET feature versions - utilize rollForward instead. (#15303) 2023-11-28 13:02:52 +01:00
Bjarke Berg 1f527fefd8 Merge remote-tracking branch 'origin/v12/dev' into v13/dev
# Conflicts:
#	build/azure-pipelines.yml
#	src/Umbraco.New.Cms.Infrastructure/Umbraco.New.Cms.Infrastructure.csproj
#	src/Umbraco.Web.UI.Client/package-lock.json
#	src/Umbraco.Web.UI.Client/package.json
#	tests/Umbraco.Tests.Integration/CompatibilitySuppressions.xml
2023-11-28 11:20:02 +01:00
Bjarke Berg 1176f04caf Updated pacakge-lock files 2023-11-28 09:45:07 +01:00
Bjarke Berg 280518c9d6 Merge remote-tracking branch 'origin/v11/dev' into v12/dev
# Conflicts:
#	build/azure-pipelines.yml
#	src/Umbraco.Cms.ManagementApi/Umbraco.Cms.ManagementApi.csproj
#	src/Umbraco.Infrastructure/Logging/Viewer/LogViewerConfig.cs
#	src/Umbraco.Web.UI.Client/.nvmrc
#	src/Umbraco.Web.UI.Client/package-lock.json
#	src/Umbraco.Web.UI.Client/package.json
2023-11-28 09:39:31 +01:00
Sven Geusens 87380902f0 Bump version 2023-11-28 09:35:34 +01:00
Sven GeusensandSven Geusens c73b7f42d9 Move localdb file management of PublishedSnapshotService into itself. (#15085)
* Move localdb file management of PublishedSnapshotService into itself.

Added a way for the PublishedSnapshot service to clean up it's local files so (for example) Upgrade migrations have a reliable way of removing known invalid cache files without running into locking issues

* Small rename to differentiate existing method from simple getter

* Fix breaking change

Long live default implementations 🎉

* Another breaking change fix

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
2023-11-28 09:31:11 +01:00
Jacob Overgaard 32493c759a add -login prefix to curves color 2023-11-28 08:48:55 +01:00
Jacob OvergaardandGitHub 8d76e32941 V13: Add more css custom properties to style the login screen (#15301)
* add more css custom properties to control the login screen

* add override for text color

* add variables to control the font-size of the headline
2023-11-28 08:37:59 +01:00
Bjarke Berg 008d797a66 Added <ManagePackageVersionsCentrally>false</ManagePackageVersionsCentrally> 2023-11-27 19:54:03 +01:00
Bjarke Berg ab781560bc Merge remote-tracking branch 'origin/v10/dev' into v11/dev
# Conflicts:
#	build/azure-pipelines.yml
#	src/Umbraco.Web.BackOffice/Controllers/ContentController.cs
#	src/Umbraco.Web.UI.Client/package-lock.json
#	src/Umbraco.Web.UI.Client/package.json
#	tests/Umbraco.Tests.AcceptanceTest/package-lock.json
2023-11-27 19:47:24 +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
92a864077b Fixed filter queries for numeric and date based filters (#15286)
Co-authored-by: Elitsa <elm@umbraco.dk>
2023-11-27 14:53:34 +01:00
Zeegaan 7443dd2bdc bump version 2023-11-27 10:36:56 +01:00
bfe8b715d8 V13: Change request column to NVarcharMax (#15252)
* Change request column to NVarcharMax

* Rename migration

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-11-27 09:06:00 +01:00
Zeegaan be443189e1 Merge branch 'v13/dev' into release/13.0
# Conflicts:
#	src/Umbraco.Web.UI.Client/src/views/webhooks/overlays/details.html
2023-11-27 08:26:41 +01:00
SteveandGitHub ade61f7ec5 Add missing translations in EN (#15257)
And remove the ones that don't exist anymore in the leading dictionary EN-US.
2023-11-23 16:55:19 +00:00
Jacob OvergaardandGitHub 3b518050bd V13: Login page backwards compatibility (#15285) 2023-11-23 08:45:49 +01:00
5ad400184a Fix IWebhook.GetUdi() and IEntity.GetUdi() extension methods (#15288)
* Fix IWebhook and IEntity GetUdi extension method

* Refactor to use switch expressions

* Add GetUdiForWebhook test

* Added a webhook builder for unit tests.

---------

Co-authored-by: Andy Butland <abutland73@gmail.com>
2023-11-23 08:02:57 +01:00
Yuval-AmidrorandGitHub e80d117a2a Redirect is broken with Hebrew chars on Linux (#15261)
* add HttpUtility.UrlPathEncode encode so paths that are not in english will not throw errors of NON-ASCII characters

* remove unnecessary using
2023-11-22 23:43:18 +00:00
dependabot[bot]andJason Elkin 1dacab8b9a Bump axios and wait-on in /tests/Umbraco.Tests.AcceptanceTest
Bumps [axios](https://github.com/axios/axios) to 1.6.2 and updates ancestor dependency [wait-on](https://github.com/jeffbski/wait-on). These dependencies need to be updated together.


Updates `axios` from 0.25.0 to 1.6.2
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v0.25.0...v1.6.2)

Updates `wait-on` from 6.0.1 to 7.2.0
- [Release notes](https://github.com/jeffbski/wait-on/releases)
- [Commits](https://github.com/jeffbski/wait-on/compare/v6.0.1...v7.2.0)

---
updated-dependencies:
- dependency-name: axios
  dependency-type: indirect
- dependency-name: wait-on
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-22 22:29:39 +00:00
Bjarne FyrstenborgandJason Elkin 58e693a75d Fix typo in umbImageGravity 2023-11-22 21:53:24 +00:00
1c2602f57c Dynamic root with culture and segment (#15287)
* parse culture and segment for dynamic root.

* Handle new culture and segment parameters

---------

Co-authored-by: Niels Lyngsø <niels.lyngso@gmail.com>
2023-11-22 19:58:06 +01:00
bcd386ac70 V13: Fix missing contenttype in webhook (#15282)
* Create missing node for content type

* Change to Unknown instead of deleted

* Cleared contentTypes and removed console.log

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
Co-authored-by: Andreas Zerbst <andr317c@live.dk>
2023-11-22 13:54:11 +01:00
ErikandGitHub d34be8ce34 Improved punctuation and sentence structure for better readability. (#15279)
* Improved punctuation and sentence structure for better readability.

* To be coherent with the rest of the written text
2023-11-22 10:11:33 +01:00
Bjarke Berg 6aca62b202 Bump version 2023-11-22 08:22:07 +01:00
b499660101 V13 Bugfix. Added backend validation for checking if a webhook has any events (#15272)
* Added a webhookOperationStatus for noEvents

* Added a method for validating Webhooks. Currently checks if the webhooks has any events or not

* Added WebhookOperationStatus for NoEvents

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

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

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

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

---------

Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
2023-11-21 14:49:40 +01:00
8755703845 V13: Implement webook as i entity (#15267)
* Add webhook service to service context

* Refactor webhooks to implement IEntity

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-11-21 14:38:47 +01:00
4c3b4752db V13: Change WebhookLog status for clarity (#15247)
* Refactor to show icon and status code to make status more clear

* Fix up migration

* Add change log status migration

* Fix up frontend to display cross when fail

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-11-21 13:55:52 +01:00
Ronald Barendse 4b60394488 Update ImageSharp2 dependency and add upper version limit 2023-11-21 13:35:36 +01:00
Ronald BarendseandGitHub 524b5ef700 Merge pull request #15268 from umbraco/v13/improvement/update-dependencies
Update and remove unnecessary package dependencies
2023-11-21 13:12:20 +01:00
Ronald Barendse 4b602dc8e2 Fix incorrect merge resolution of package dependencies 2023-11-21 12:08:51 +01:00
Ronald Barendse 28550b88c8 Remove implicitly set EmbedUntrackedSources property 2023-11-21 11:39:04 +01:00
Ronald Barendse 40dd163e3a Update to Microsoft.ICU.ICU4C.Runtime 72.1.0.3 2023-11-21 10:52:25 +01:00
Ronald Barendse e22c43b471 Update to Serilog 8.0.0 2023-11-21 10:51:03 +01:00
Ronald Barendse 49fc7f9786 Update to OpenIddict 4.10.0 2023-11-21 10:51:02 +01:00
Ronald Barendse a77b77d98a Remove AngleSharp package reference 2023-11-21 10:51:02 +01:00
Ronald Barendse 93c46b1d10 Remove explicit SourceLink package reference (included in .NET 8 SDK) 2023-11-21 10:50:52 +01:00
Ronald BarendseandGitHub 48bfbb00cd Clear cached PublishedDataTypes when content types are updated (#15253)
* Clear cached PublishedDataTypes when content types are updated

* Optimize published data type cache initialization
2023-11-21 10:28:26 +01:00
Bjarne FyrstenborgandZeegaan 3ff6bd191a V13: Webhook logs formatting (#15246)
* Use code snippet component for request and response

* Change overlay size to medium

* Format log date

* Handle JS as JavaScript

* Try format JSON

* Update less syntax

* Add word wrap

* Formatting

* Update variable

* Remove unused editorService

* Add missing details controller and fix formatting in catch block

* Set data object

* Update overlay size to match umb-editor overlay

* Use editorService instead to show details on overlay

* Add general box header

(cherry picked from commit 13db9b308e)
2023-11-21 09:30:02 +01:00
Bjarne FyrstenborgandGitHub 13db9b308e V13: Webhook logs formatting (#15246)
* Use code snippet component for request and response

* Change overlay size to medium

* Format log date

* Handle JS as JavaScript

* Try format JSON

* Update less syntax

* Add word wrap

* Formatting

* Update variable

* Remove unused editorService

* Add missing details controller and fix formatting in catch block

* Set data object

* Update overlay size to match umb-editor overlay

* Use editorService instead to show details on overlay

* Add general box header
2023-11-21 09:24:48 +01:00
Kenn JacobsenandGitHub a4c7047a50 Add output caching to the Delivery API (#15216) 2023-11-20 11:01:36 +01:00
dependabot[bot]andJacob Overgaard 7dcef22702 Bump tinymce from 6.7.1 to 6.7.3 in /src/Umbraco.Web.UI.Client
Bumps [tinymce](https://github.com/tinymce/tinymce/tree/HEAD/modules/tinymce) from 6.7.1 to 6.7.3.
- [Changelog](https://github.com/tinymce/tinymce/blob/develop/modules/tinymce/CHANGELOG.md)
- [Commits](https://github.com/tinymce/tinymce/commits/6.7.3/modules/tinymce)

---
updated-dependencies:
- dependency-name: tinymce
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-20 10:17:27 +01:00
dependabot[bot]andJacob Overgaard 6587ecac2d Bump tinymce from 6.7.1 to 6.7.3 in /src/Umbraco.Web.UI.Client
Bumps [tinymce](https://github.com/tinymce/tinymce/tree/HEAD/modules/tinymce) from 6.7.1 to 6.7.3.
- [Changelog](https://github.com/tinymce/tinymce/blob/develop/modules/tinymce/CHANGELOG.md)
- [Commits](https://github.com/tinymce/tinymce/commits/6.7.3/modules/tinymce)

---
updated-dependencies:
- dependency-name: tinymce
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-20 10:10:42 +01:00
dependabot[bot]andJacob Overgaard bb9a8fc3be Bump tinymce from 6.7.1 to 6.7.3 in /src/Umbraco.Web.UI.Client
Bumps [tinymce](https://github.com/tinymce/tinymce/tree/HEAD/modules/tinymce) from 6.7.1 to 6.7.3.
- [Changelog](https://github.com/tinymce/tinymce/blob/develop/modules/tinymce/CHANGELOG.md)
- [Commits](https://github.com/tinymce/tinymce/commits/6.7.3/modules/tinymce)

---
updated-dependencies:
- dependency-name: tinymce
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-20 10:09:53 +01:00
Jacob OvergaardandGitHub 8447123ef3 V13: Allow external login custom views to see where they are being shown (#15251)
* fix: make sure isTimedOut state is forwarded to the login screen

* fix: make umb-custom-view work without attributeChangedCallback

* style subheadline

* add support for userViewState on external login custom views

* fix: subheadline should be a span

* check for isTimedOut on internal login screen

* reformat code

* add args to external login provider custom view

* send args to custom view

* set state to "logout" when clicking the logout button

* force user to new login page /umbraco/login?logout=true if logged out
2023-11-20 08:52:20 +01:00
Erik-Jan WestendorpandGitHub 7bad6b9fd8 Fix button styling in block list & block grid overlay (#14929)
* Update blocklist.blockconfiguration.overlay.less

Change noValue color

* Update blockgrid.blockconfiguration.overlay.less

Change noValue color for block-grid
2023-11-17 15:53:08 +00:00
Jacob Overgaard 77288caeed Revert change to user dialog that accidentally removed user dashboards 2023-11-17 15:59:29 +01:00
dependabot[bot]andJacob Overgaard d709994c61 Bump tinymce from 6.7.1 to 6.7.3 in /src/Umbraco.Web.UI.Client
Bumps [tinymce](https://github.com/tinymce/tinymce/tree/HEAD/modules/tinymce) from 6.7.1 to 6.7.3.
- [Changelog](https://github.com/tinymce/tinymce/blob/develop/modules/tinymce/CHANGELOG.md)
- [Commits](https://github.com/tinymce/tinymce/commits/6.7.3/modules/tinymce)

---
updated-dependencies:
- dependency-name: tinymce
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-17 14:54:32 +01:00
89cdba6b23 V13: login screen design refresh (#15037)
* add new login images

* layout styling

* styling

* fix line height

* use image and logo

* add comments

* remove border and shadow

* change logos and images

* use styleMap and add dark logo property

* add new content setting for dark logo variant

* add loginLogoImageDark to angular server variables

* set logo-dark attribute on the auth element and rename "logo-image" to "logo-light"

* styling

* update auth element

* replace logo files with new brand logos

* use different logo on install screen

* no-nodes: move logo to img file

* use different logo for umb-avatar

* use different logo for backoffice

* use different logo for BootFailed

* tranparent background

* switch dark and light logo

* image flip horizontal

* fix background

* inject native inputs into auth element

* use native inputs in login

* get input values and submit on enter press

* wip validation

* wip custom login input. And inject entire form instead

* use external submit button

* use uui-labels instead

* style inputs

* cleanup

* convert to function

* add translations

* wait for slot update before getting form

* fix divider to work on transparent backgrounds

* background less transparent

* load css from file

* fix logo

* fix mobile padding

* add documentation and fix name of input field for username

* revert to old login background

* revert to old login background

* add labels for login fields

* fix label warning

* fix fallback for messages

* replace background image

* do not transform background image

* add mocked texts

* use new generic "Welcome" title

* use correct user_email for email field

* update "Welcome..." to "Welcome" to use with the new login screen

* reformat code

* update greeting headline

* update actions

* update mocks

* update fallback value

* update texts

* improve query safety

* add logoImageAlternative and ensure naming is correct from backend to frontend

* add remarks to avoid changing the color configuration of an external login button

* format

* update auth styles

* external login provider element

* auth layout

* external login providers layout

* login input element

* invite page

* login page

* new password page

* typesafe

* fix custom view login provider

* divider color

* prevent pink lines from overflowing image

* replace login background

* add umb prefix to css variables

* avoid using 'umbraco' in alt texts and add check for logo alternative

* adjust greeting size

* Revert "add umb prefix to css variables"

This reverts commit 005813cbfd.

* add new blue button color

* font-size on headlines

* align styling on all pages

* use error layout

* ts happy

* adjust divider to work better with rounded buttons

* add overflow to in case of very long forms

* adjust h2 size

* update mocks to match cms

* first headline on a page should be a h1

* first headline on a page should be a h1

* first headline on a page should be a h1

* copy styling to mfa page

* first headline on a page should be a h1

* make the blue logo default for Umbraco 13

* move background-color to auth-layout so it also takes effect inside the cms

* adjust padding on the internal div on the buttons

* reformat code

* fix async text for external login buttons

* align design of mfa page with the other screens

* align logos

* reformat code

* use white logo for nonodes

* add safety measure to returnPath

* lowercase the 'or' text

* force uui-select to use the background-color as other regular inputs

* match uui-select-height with other input fields

* revert back to default look for outline uui-button

* move background-color to layout element to span the entire browser

* align headlines across components

* adjust max-width on #content to better fit headlines

* align line-height on headlines across components

* allow error text a bit of top margin

---------

Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>
2023-11-17 14:53:58 +01:00
Nikolaj GeisleandGitHub 0085f9862e V13: Fix proper serialization of webhook object (#15248)
* deserialize object again before firing

* Dont serialize and already serialized object

* Update to use constant instead of hard coded string
2023-11-17 14:35:43 +01:00
Nikolaj GeisleandGitHub a60ea1f49d V13: Fix AddWebhookDatabaseLock migration (#15250)
* Change to proper constant

* Update with comments
2023-11-17 14:14:41 +01:00
Kenn JacobsenandBjarke Berg 92c23eceae Ensure content types are updated in ContentStore when a data type changes (#15239) 2023-11-17 10:37:56 +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
Kenn JacobsenandGitHub f286b1168c Ensure content types are updated in ContentStore when a data type changes (#15239) 2023-11-17 10:26:59 +01:00
960d70ec54 V13: Webhook logging cleanup (#15198)
* Add log cleanup settings

* Start implementation of WebhookLoggingCleanup

* Add WebhookLog database locks

* Refactor repository to allow cleanup

* Refactor WebhookLoggingCleanup to fix bugs

* FIx up tests

* WebhookLoggingCleanup PR review suggestions

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
Co-authored-by: Sven Geusens <sge@umbraco.dk>
2023-11-16 13:49:05 +01:00
Bjarne FyrstenborgandGitHub 93415a9957 Click row on dictionary list (#15194) 2023-11-16 12:34:17 +01:00
Bjarne FyrstenborgandGitHub 963e57723a Don't change format in convertToLocalMomentTime (#15223) 2023-11-16 10:38:53 +01:00
Bjarke Berg eb0c1cd4a9 Merge remote-tracking branch 'origin/release/13.0' into v13/dev 2023-11-16 09:07:36 +01:00
Andy ButlandandGitHub ead7741ee2 Updated rich text parser interfaces to support context cache. (#15220) 2023-11-16 06:33:36 +01:00
Bjarke Berg ab2ebba690 remove imagesharp reference 2023-11-15 12:05:19 +01:00
Bjarke Berg 73eb9e04da bump version 2023-11-15 12:05:09 +01:00
Vitor RodriguesandNikolaj Geisle 44c3c3741e Fix potential NullReferenceException 2023-11-15 11:49:36 +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
Bjarke Berg 6f139ced53 Merge remote-tracking branch 'origin/v12/dev' into v13/dev 2023-11-15 09:37:40 +01:00
Bjarke Berg ecb1b3b9ac Merge remote-tracking branch 'origin/release/12.3' into v12/dev
# Conflicts:
#	version.json
2023-11-15 09:36:10 +01:00
Bjarke BergandGitHub d2ff2ea46e Bugfix: Count existing media correct (#15206)
* https://github.com/umbraco/Umbraco-CMS/issues/15205
Count media correct

* Fix content should be document
2023-11-15 09:34:27 +01:00
Bjarke BergandGitHub 65b7967fed Updated to .NET 8 final (#15204) 2023-11-15 09:29:50 +01:00
Bjarke BergandGitHub 28e8ac11f0 Added scope.complete in edge cases. (#15207) 2023-11-15 09:03:08 +01:00
Erik-Jan WestendorpandGitHub c7e5d94f45 Dynamic root feature translations (Dutch) (#15109)
* Fix typo

* Add Dutch translations
2023-11-15 08:39:01 +01:00
Andreas ZerbstandBjarke Berg b8a1c42660 V12 Bugfix, Added compare provider name extension for Sqlite (#15189)
* Created an extension for comparing the current and the outdated providerName for Sqlite

* Added usages for the CompareProviderNames

* Added another case if the providerName is the outdated SQLite

* Both cases use Sqlite, so there is no need to have duplicate code

(cherry picked from commit d0cd22b09d)
2023-11-14 20:39:33 +01:00
Andreas ZerbstandGitHub d0cd22b09d V12 Bugfix, Added compare provider name extension for Sqlite (#15189)
* Created an extension for comparing the current and the outdated providerName for Sqlite

* Added usages for the CompareProviderNames

* Added another case if the providerName is the outdated SQLite

* Both cases use Sqlite, so there is no need to have duplicate code
2023-11-14 20:38:18 +01:00
Bjarke Berg 8ffddb77ff Bump version 2023-11-14 18:55:52 +01:00
Bjarke Berg 60644fadc0 Update global.json 2023-11-14 13:27:50 +01:00
Bjarke Berg 039543ab43 Post merge 2023-11-14 13:19:55 +01:00
Bjarke Berg 2402d2f8f1 Merge remote-tracking branch 'origin/v12/dev' into v13/dev
# Conflicts:
#	src/Umbraco.Infrastructure/PropertyEditors/RichTextPropertyEditor.cs
2023-11-14 13:17:47 +01:00
Bjarke Berg 46d5db51e8 Post merge fix 2023-11-14 13:16:51 +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 80631e77c9 Post merge fixes with versions and updated nuget packages 2023-11-14 12:49:02 +01:00
Bjarke Berg c22783e45e Merge remote-tracking branch 'origin/release/13.0' into v13/dev 2023-11-14 12:43:11 +01:00
Bjarke Berg a1c527dcbd Merge remote-tracking branch 'origin/v12/dev' into v13/dev 2023-11-14 12:03:09 +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
4d98937af9 Delivery API nested property expansion and output limiting (#15124)
* V2 output expansion + field limiting incl. deprecation of V1 APIs

* Performance optimizations for Content and Block based property editors

* A little formatting

* Support API versioning in Delivery API endpoint matcher policy

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

* Renamed route for "multiple items by ID"

* Review changes

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

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

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

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

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

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

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

This reverts commit 0d5a57956b.

* Introduce explicit API cache levels for property expansion

* Friendly handling of bad expand/fields parameters

---------

Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com>
2023-11-14 11:16:12 +01:00
Bjarke Berg 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 97d8039a21 Merge remote-tracking branch 'origin/v11/dev' into v12/dev 2023-11-14 10:52:06 +01:00
Bjarke Berg 97aa623e87 Fixed smalled things due to nullable refernece types 2023-11-14 10:51:06 +01:00
Bjarke Berg 737104624e Fixed reference 2023-11-14 09:56:34 +01:00
Bjarke Berg 162a6a0085 Post merge 2023-11-14 09:39:39 +01:00
Bjarke Berg cea6c3f20e Merge remote-tracking branch 'origin/v12/dev' into v13/dev 2023-11-14 09:31:25 +01:00
Bjarke Berg 74f06bd6bd Merge remote-tracking branch 'origin/release/13.0' into v13/dev 2023-11-14 09:30:53 +01:00
Bjarke Berg 2cf2176613 Merge remote-tracking branch 'origin/v11/dev' into v12/dev 2023-11-14 09:30:15 +01:00
Bjarke Berg 4a8ffd1b37 Merge remote-tracking branch 'origin/v10/dev' into v11/dev 2023-11-14 09:29:59 +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 Berg 24fef823ba Merge branch 'release/12.3' into v12/dev
# Conflicts:
#	version.json
2023-11-14 09:28:24 +01:00
Bjarke Berg 2b7785fcd3 https://github.com/umbraco/Umbraco-CMS/issues/15195 Fixed issue with media not cached correct (#15196) 2023-11-14 09:14:39 +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
Bjarke Berg d112ba5e40 Bump version 2023-11-14 09:11:58 +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 fee9bf12c0 Updated nuget packages 2023-11-13 18:56:57 +01:00
Bjarke Berg 633f649be9 Merge remote-tracking branch 'origin/v11/dev' into v12/dev
# Conflicts:
#	src/Umbraco.Cms.ManagementApi/Umbraco.Cms.ManagementApi.csproj
#	src/Umbraco.Infrastructure/Cache/DistributedCacheBinder_Handlers.cs
2023-11-13 18:40:11 +01:00
Bjarke Berg 74cfd9c9a0 Updated nuget packages 2023-11-13 18:38:15 +01:00
0e8c92a6e7 V13: Refactor webhookservice to attempt pattern (#15180)
* Refactor IWebhookService to attempt pattern

* Remove unwanted file

* Fix up tests

* Fix after merge

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-11-13 18:36:05 +01:00
Bjarke Berg d6751e2832 Merge remote-tracking branch 'origin/v10/dev' into v11/dev
# Conflicts:
#	version.json
2023-11-13 18:30:50 +01:00
Bjarke Berg abfa07367f Bump version 2023-11-13 18:06:41 +01:00
46df3a05a7 V13: request queueing (#15176)
* Implement persistence

* Start implementing repository

* Implement repository

* Implement request service

* Dont run WebhookFiring if not in runtime mode run

* Refactor repository and service to have full CRUD

* add tests for Request service

* Implement WebhookRequest lock

* Register hosted service

* Add try catch when firing HttpRequest

* Add migration

* Refactor to use renamed IWebhookService

* Refactor tests too

* Add setting to configure webhook firing period

* Update docs

* Review fixes

* Add column renaming migration

* Remove unused service

* run request in parralel

* Refactor to fire parallel in background

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2023-11-13 15:49:02 +01:00
Bjarke BergandGitHub e5de8bf56b Updated nuget packages (#15192) 2023-11-13 14:59:52 +01:00
Bjarke BergandGitHub 16a27a4c52 use header value instead if present to set culture on request (#15168) 2023-11-13 13:33:02 +01:00
Bjarke Berg 261586f14f Merge branch 'v13/dev' into release/13.0 2023-11-13 12:47:31 +01:00
Andrew McKaskillandBjarke Berg 04ac1542aa Refactor hostedServices into background jobs (#14291)
* Refactor jobs from HostedServices into BackgroundJobs

* Clean up generics and DI setup

* Add RecurringBackgroundJob Unit Tests

* Add ServiceCollection helper

* Add Obsolete attributes

* Add Notification Classes

* Add UnitTests for RecurringBackgroundJob HostedService

* Add NotificationEvents

* Add state to notifications

* Update UnitTests

* Add Obsolete Attributes to old hosted service classes

* Updated xmldoc in IRecurringBackgroundJob.cs

* Update Obsolete attribute messages to indicate classes will be removed in Umbraco 14

(cherry picked from commit c30ffa9ac3)
2023-11-13 11:10:58 +01:00
Bjarne FyrstenborgandGitHub 1d43a67934 Add edit page for webhook (#15175)
* Add edit page for webhook

* Remove function again

* Remove old edit in overlay

* Update language keys

* Update GetByKey to get model as camel case properties

* Localize "select event"

* Localize "create header"

* Don't show input field in header for now

* Add generic class to limit property editor width

* Remove loading check since already checked when loading entire editor view

* Add empty message

* Update col span

* Set edit name

* Map id property

* Return webhook model after update

* Translate speech bubble text

* Resolve content types

* Only push if not already exists

* Check webhook headers

* Set webhook enabled by default
2023-11-13 10:14:40 +01:00
e48e7ff146 Add [SpecialType] attributes to request & response (#15103)
Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-11-13 09:11:11 +01:00
Nikolaj GeisleandGitHub 7c87743191 Add Auth attribute to controller (#15178) 2023-11-10 14:14:32 +01:00
Jacob Overgaard f4cb7e71fa Cherry-picked c03df2b74e into v13/dev 2023-11-10 13:45:00 +01:00
Jacob Overgaard 81caf2b384 V14: make v13 login screen work initially with Management API (#15170)
* make the login check a bit more robust to be able to handle both old postlogin and new management api response types

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

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

This reverts commit 0639ca80f0.

* V14 only: additionally authenticate with the Management API to set the right cookies
2023-11-10 13:42:28 +01:00
Erik-Jan WestendorpandGitHub 31678bb676 Translate webhooks keys to Dutch (#15091) 2023-11-10 10:41:31 +01:00
Andy ButlandandGitHub 8f8302358a Added notifications to the webhook service (#15174)
* Added webhooks to UdiEntityTypes and UdiGetterExtensions.

* Renamed IWebhookservice and amended signature of CreateAsync to allow returning of null.
Added notifications for webhooks.

* Further renames.

* Fixed failing unit test.

* Removed inadvertently added file.
2023-11-10 10:17:36 +01:00
Ronald BarendseandGitHub b8f5078135 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
2023-11-10 09:07:10 +01:00
e143133bcf V13: Update IWebHookService to proper casing (#15169)
* Update to proper casing

* Fixed naming

---------

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

* refactor frontend to filter on eventType.

* Display event names

* refactor to use eventNames

* remove npm from overview

* implement alias for WebhookEvents

* Implement [WebhookEvent] attribute

* Refactor IWebhookService to get by event alias and not name

* Rename parameter to fit method name

* to lower event type to avoid casing issues

* Apply suggestions from code review

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

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

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

* Add renaming column migration

* display event alias in logs

* Update migration to check if old column is there

* Apply suggestions from code review

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

* add determineResource function to avoid duplicate code

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
Co-authored-by: Ronald Barendse <ronald@barend.se>
Co-authored-by: Kenn Jacobsen <kja@umbraco.dk>
2023-11-09 14:18:34 +01:00
Bjarke Berg 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
Jacob Overgaard 1fcb96288f correct localization key of 2fa view 2023-11-09 11:14:55 +01:00
Bjarke Berg 836f173925 Merge remote-tracking branch 'origin/release/13.0' into v13/dev 2023-11-09 09:23:44 +01:00
Ronald BarendseandGitHub 9f062e38eb 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
2023-11-09 08:42:22 +01:00
Ronald BarendseandGitHub d301679e53 Include Umbraco.Web.UI.Login project, update compatibility suppressions and remove unnecessary package references (#15163)
* Fix Umbraco.Web.UI.Login not showing up in solution

* Update PackageValidationBaselineVersion  to 13.0.0-rc1 and remove all CompatibilitySuppressions.xml files

* Remove unnecessary package references

* Move Microsoft.EntityFrameworkCore.Design reference and add comment

* Disable package validation and fix override in tests

* Inherit package validation setting for EF Core projects
2023-11-09 08:39:42 +01:00
Ronald BarendseandGitHub 915b63db29 Fix rendering and parsing new RTE markup object in backoffice (#15166)
* Render RTE markup in custom view

* Fix ncRichText filter to support RTE markup object
2023-11-09 06:30:25 +01:00
Bjarke Berg 1ba025cf8b Merge remote-tracking branch 'origin/v12/dev' into release/13.0
# Conflicts:
#	src/Umbraco.Web.UI.Client/package-lock.json
#	src/Umbraco.Web.UI.Client/package.json
#	version.json
2023-11-07 20:17:17 +01:00
Bjarke Berg e0220cb47f Merge remote-tracking branch 'origin/v11/dev' into v12/dev 2023-11-07 20:14:55 +01:00
Bjarke Berg 81063d083c Merge remote-tracking branch 'origin/v10/dev' into v11/dev 2023-11-07 20:14:04 +01:00
997434cebb Move localdb file management of PublishedSnapshotService into itself. (#15085)
* Move localdb file management of PublishedSnapshotService into itself.

Added a way for the PublishedSnapshot service to clean up it's local files so (for example) Upgrade migrations have a reliable way of removing known invalid cache files without running into locking issues

* Small rename to differentiate existing method from simple getter

* Fix breaking change

Long live default implementations 🎉

* Another breaking change fix

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
2023-11-07 16:02:20 +01:00
kasparboelkjeldsenandGitHub e5c8627abf Add strict contextual escaping on the $scope for grid controller (#14923)
* Add strict contextual escaping on the $scope for grid controller

* use safe_html filter instead
2023-11-07 11:44:11 +00:00
Bjarke Berg c90f05c57c bump version 2023-11-07 11:55:06 +01:00
Bjarne FyrstenborgandGitHub a648dda61b Add tree access to webhooks (#15156)
* Add tree access to webhooks

* Update authorize attribute

* Add webhooks tree policy
2023-11-07 11:17:31 +01:00
Bjarne FyrstenborgandGitHub 90ddd63742 Add comments to methods in IWebHookService (#15151)
* Add comments to methods in IWebHookService

* Inherit doc
2023-11-07 11:14:06 +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
Kenn JacobsenandBjarke Berg 80fac866c9 Ensure invariant properties return the correct cache value at source level (#15145)
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2023-11-07 09:02:08 +01:00
06d61094cc Ensure invariant properties return the correct cache value at source level (#15145)
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2023-11-07 09:01:27 +01:00
Jacob OvergaardandGitHub 613ed5955c V13 RC: Fix issue with 2FA login (#15140)
* add returnPath to 2fa custom views so they know where to redirect the user to

* fix(2fa): send back the user details in the login-success event emitter in case the login happens inside the backoffice overlay
2023-11-07 08:42:13 +01:00
Bjarke Berg 3306fe53e8 Fix build 2023-11-06 20:15:34 +01:00
Warren BuckleyandBjarke Berg c8dff604a0 Changes PackageMigrationsPlans to be a weighted collection like dashboards 2023-11-06 18:22:32 +01:00
Ronald BarendseandGitHub 289ab6740b Fix WithCollectionBuilder helper methods nullability (#15143)
* Fix WithCollectionBuilder helper methods nullability

* Remove unnecessary lamba expressions
2023-11-06 18:10:09 +01:00
Ronald BarendseandGitHub e7bab6995a Move IContextCache parameter to base Deploy interfaces and add checksum to artifact dependency (#15144)
* Move IContextCache parameter to base interfaces

* Add checksum to artifact dependency
2023-11-06 18:05:02 +01:00
Andy ButlandandGitHub 8d3883df14 Aligned parameters on sync and async methods on IFileSource. (#15128) 2023-11-06 17:59:30 +01:00
fee32bd6ec Remove parameter value/return nullability in IImageSourceParser, ILocalLinkParser and IMacroParser (#15130)
* Align nullability of ILocalLinkParser with other rich text content parsers (IMacroParser and IImageSourceParser).

* Remove value/return nullability in IImageSourceParser, ILocalLinkParser and IMacroParser

---------

Co-authored-by: Ronald Barendse <ronald@barend.se>
2023-11-06 17:58:01 +01:00
Elitsa MarinovskaandBjarke Berg d35c6f0e94 Update correct action (#15142)
(cherry picked from commit ffaa77eb25)
2023-11-06 17:56:08 +01:00
Bjarke Berg b12d88818d bump version 2023-11-06 17:54:38 +01:00
Elitsa MarinovskaandGitHub ffaa77eb25 Update correct action (#15142) 2023-11-06 17:54:16 +01:00
Erik-Jan WestendorpandGitHub c0ca4685e8 Fix FurthestAncestorOrSelfDynamicRootQueryStep and FurthestDescendantOrSelfDynamicRootQueryStep (#15113)
* Rename FarthestDescendantOrSelfDynamicRootQueryStep to FurthestDescendantOrSelfDynamicRootQueryStep

* Rename FarthestAncestorOrSelfDynamicRootQueryStep to FurthestAncestorOrSelfDynamicRootQueryStep

* Update integration test and repo
2023-11-06 10:44:12 +01:00
Erik-Jan WestendorpandGitHub 913f48806a AddWebhookEvent to UmbracoBuilderExtensions (#15099) 2023-11-06 08:54:29 +01:00
Bjarne FyrstenborgandZeegaan 5f3c0c56cc Update webhook log table using constant (#15101)
(cherry picked from commit f7d1ef722e)
2023-11-06 08:24:11 +01:00
Bjarne FyrstenborgandZeegaan 79d9ac759b V13: Webhook corrections (#15077)
* Update icons

* Update tree headers

* Cleanup and change icon name

* Use button element instead

* Disable button instead

* Fix overlay title

* Simplify labels

* Add datalist for common headers

* Use Utilties function

* Events in plural form

* Cleanup and formatting

* Formatting

* More formatting

* Stop event bubbling when clicking delete button

* Sync tree node and show loading indicator

* Add webhook icon

* Remove globe icon to not confuse with languages

* Update logs

* Remove extra column with delete button which shouldn't be there

* Use umb-icon and update titles

* Use content type picker

(cherry picked from commit 29be27ba46)
2023-11-06 08:24:10 +01:00
Kevin JumpandZeegaan c31df57bdc New WebhookEventBase class (#15129)
(cherry picked from commit 145107be45)
2023-11-06 08:23:34 +01:00
Matthew WiseandEmma L Garland a2a2680def String comparision was using current culture which resulting in incorrect resuts for some languages 2023-11-03 14:00:59 +00:00
Vitor RodriguesandEmma L Garland 53b152d501 Fix potential NullReferenceException 2023-11-03 13:31:01 +00:00
Kevin JumpandGitHub 145107be45 New WebhookEventBase class (#15129) 2023-11-03 14:30:13 +01:00
Vitor RodriguesandEmma L Garland 5c514ca6c6 Fixed open api enum schema filter not setting type
By not setting the type and format, it would remain integer is this case, which would result in an invalid specification as the enum members are strings.
2023-11-03 13:14:20 +00:00
Bjarne FyrstenborgandGitHub e17fa957d6 Don't allow to select folder in create dialog under media type (#14840)
* Only allow creating folder at root or under another folder

* Fix typos in error message

* Add data-element to member type create dialog
2023-11-03 12:49:41 +00:00
Jacob Overgaard b11e13f8cd bump nvm support to latest node.js 20.9 LTS 2023-11-03 11:25:55 +01:00
Jacob OvergaardandGitHub 74a32fe0c0 V13 RC: Avoid duplicate id's on the login screen (#15111)
* avoid duplicate id's on the login screen

this removes the id attr from the inner input element of umb-login-input

* disallow form to validate

the validate behavior is controlled by the UI library
2023-11-03 09:36:38 +01:00
Mike MaseyandMichael Latouche a907be54b4 fix: add select all sr-only text to umb table select all button 2023-11-02 17:02:14 +01:00
Mike MaseyandJason Elkin 7886af4397 fix: ensure alt tag isn't remove on build
There seems to be an odd bug where on build, the alt tag is removed is it is alt="". Simply adding a space fixes this.
2023-11-02 15:50:04 +00:00
Jason ElkinandMichael Latouche c7f9417063 Remove legacy test project 2023-11-02 16:30:20 +01:00
Zeb SadiqandMichael Latouche 7b0ae3c5d9 Fixed one warning for Umbraco.Infrastructure . 'AesCryptoServiceProvider' is obsolete. 2023-11-02 16:26:29 +01:00
Richard JacksonandMichael Latouche 7a57e8861d Removed parenthesis from compiler directive
Removes warning from Umbraco.Web.UI as part of #15015
2023-11-02 16:08:45 +01:00
ff05886e43 Remove setter from WebhookEvent (#15106)
Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-11-02 14:37:28 +01:00
Bjarne FyrstenborgandMichael Latouche 69139eda52 Allow dashboard content to grow 2023-11-02 13:29:20 +01:00
Bjarne FyrstenborgandGitHub f7d1ef722e Update webhook log table using constant (#15101) 2023-11-02 13:27:48 +01:00
Andrew McKaskillandGitHub c30ffa9ac3 Refactor hostedServices into background jobs (#14291)
* Refactor jobs from HostedServices into BackgroundJobs

* Clean up generics and DI setup

* Add RecurringBackgroundJob Unit Tests

* Add ServiceCollection helper

* Add Obsolete attributes

* Add Notification Classes

* Add UnitTests for RecurringBackgroundJob HostedService

* Add NotificationEvents

* Add state to notifications

* Update UnitTests

* Add Obsolete Attributes to old hosted service classes

* Updated xmldoc in IRecurringBackgroundJob.cs

* Update Obsolete attribute messages to indicate classes will be removed in Umbraco 14
2023-11-02 13:15:14 +01:00
Jeroen BreuerandJason Elkin 67fe7e7e11 Fix warning CS0618: 'IHostingEnvironment.MapPathContentRoot(string)' is obsolete. 2023-11-02 11:05:53 +00:00
Zeegaan 10264f244b bump version 2023-11-02 09:14:18 +01:00
Zeegaan 609a3ebca1 Merge branch 'release/12.3.0' into v12/dev 2023-11-02 08:53:11 +01:00
Kenn JacobsenandGitHub 6777145079 Ensure that missing access rules do not break the site (#15081) 2023-11-02 08:45:27 +01:00
Bjarne FyrstenborgandGitHub 29be27ba46 V13: Webhook corrections (#15077)
* Update icons

* Update tree headers

* Cleanup and change icon name

* Use button element instead

* Disable button instead

* Fix overlay title

* Simplify labels

* Add datalist for common headers

* Use Utilties function

* Events in plural form

* Cleanup and formatting

* Formatting

* More formatting

* Stop event bubbling when clicking delete button

* Sync tree node and show loading indicator

* Add webhook icon

* Remove globe icon to not confuse with languages

* Update logs

* Remove extra column with delete button which shouldn't be there

* Use umb-icon and update titles

* Use content type picker
2023-11-01 16:55:03 +01:00
Nikolaj Geisle c42eb28129 Bump version 2023-11-01 14:40:51 +01:00
Bjarke Berg 6bd4642bb2 Merge remote-tracking branch 'origin/v12/dev' into v13/dev
# Conflicts:
#	src/Umbraco.Web.UI.Client/package-lock.json
#	src/Umbraco.Web.UI.Client/package.json
2023-11-01 12:26:08 +01:00
Bjarke Berg c6e760c114 Merge remote-tracking branch 'origin/v11/dev' into v12/dev 2023-11-01 12:24:04 +01:00
Bjarke Berg 1ce71b6760 Merge remote-tracking branch 'origin/v10/dev' into v11/dev 2023-11-01 12:21:12 +01:00
Elitsa MarinovskaandNikolaj Geisle fc81cc8f38 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:50:24 +01:00
Nikolaj GeisleandGitHub 52fd853d52 Move to core (#15084) 2023-11-01 11:47: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
Nikolaj Brask-NielsenandNikolaj Geisle d5ff80352e Fix custom dbcontexts extention methods (#14937)
* test: Create failing test

* feat: New extension methods for adding Umbraco DBContexts

* test: Cleaned up integration tests
2023-11-01 10:06:17 +01:00
Nikolaj Brask-NielsenandGitHub c19e747bbe Fix custom dbcontexts extention methods (#14937)
* test: Create failing test

* feat: New extension methods for adding Umbraco DBContexts

* test: Cleaned up integration tests
2023-11-01 09:59:32 +01:00
Bjarke Berg aaf7171f75 Bump version 2023-10-31 19:36:43 +01:00
Bjarke Berg 890da5f57b Fixed login tests 2023-10-31 18:45:09 +01:00
Bjarne FyrstenborgandGitHub b1b48ec5cd Set max height of media item in grid (#15066)
* Set max height of media item in grid to avoid portrait images of take up much of height

* Style image preview in for SVG

* Set max height instead
2023-10-31 17:23:15 +00:00
Bjarke Berg 15fb4205ff Fixed issue with member creation and fixed test with non-breakable-space issue 2023-10-31 17:14:25 +01:00
Bjarke Berg d4dad9cb5b Merge remote-tracking branch 'origin/v13/dev' into release/13.0 2023-10-31 15:10:49 +01:00
Jacob OvergaardandGitHub 78f46abe63 V13/bugfix/login screen autofill (#15075)
* pass in fields from outside login-page to make autofill APIs work

* remove unused property

* disable spellcheck for login form

* add name to login form

* remove unused property

* clean-up imports

* use inputmode instead of type=email

* refactor arguments into opts object
2023-10-31 15:10:27 +01:00
Bjarke Berg 8e7edde564 Merge remote-tracking branch 'origin/v13/dev' into release/13.0 2023-10-31 12:52:54 +01:00
ae84d324ab V13/feature/blocks in rte (#15029)
* insert umb rte block web component in rte

* First stab at moving the RTE markup to a nested "markup" property in the property value.

* initial work

* only rewrite markup

* transform RTE into component

* parse scope in grid.rte

* revert use a fallback instead

* block insertion and sync in place

* block picker partly impl

* remove test of old controller

* remove test of old controller

* block with block data

* proper block with api connection

* remove log

* styling

* Persist blocks data (still a temporary solution)

* styling allows for interaction

* block actions

* tinyMCE styling

* paste feature

* prevalue display Inline toggle

* inline mode in RTE

* todo note

* fixes wording

* preparation for editor communication

* remove val-server-match for now

* clean up blocks that does not belong in markup

* remove blocks not used in the markup

* liveEditing

* displayAsBlock formatting

* clean up

* TODO note

* Serverside handling for RTE blocks (incl. refactor of Block List and Block Grid)

* ensure rich text loads after block editor

* trigger resize on block init

* Handle RTE blocks output in Delivery API

* sanitize ng classes

* simplify calls to init blocks

* move sanitisation

* make validation work

* only warn when missing one

* clean up

* remove validation border as it does not work

* more clean up

* add unsupported block entry editor

* Revert breaking functionality for Block List and Grid

* prevent re-inits of blocks

* make sure delete blocks triggers an update

* Refactor RichTextPropertyIndexValueFactory to index values from blocks + clean up RichTextPropertyEditor dependencies

* first working cursor solution

* inline element approach

* Handle both inline and block level blocks

* Fix the RTE block parser regex so it handles multiple inline blocks.

* Fix reference and tags tracking, add tests, make the editor backwards compatible and make deploy happy

* Use RichTextPropertyEditorHelper serialization in tests

* Ensure correct model in Block Grid value converter (incl unit test to prove it)

* do not include umbblockpicker in grid

* make blocks the new default, instead of macros

* only send value of body from DOMParser

* Blocks of deleted ElementTypes shows unsupported

* do not edit a unsupported block

* remove trying to be smart on the init

* fix missing culture issue

* set dirty

* alert when no blocks

* Revert "make blocks the new default, instead of macros"

This reverts commit 283e8aa473.

---------

Co-authored-by: kjac <kja@umbraco.dk>
2023-10-31 12:52:35 +01:00
Bjarke Berg a3a4917a94 Merge remote-tracking branch 'origin/v13/dev' into release/13.0 2023-10-31 12:40:12 +01:00
Andy ButlandandGitHub d08d141bcf Updates and support for re-use of CMS logic in Deploy (#14990)
* Adds additional parameter to IFileSource.GetFilesAsync allowing the caller to continue on a file not found exception.

* Moved redirect tracking and creation logic out of handler into a service, allowing for re-use in Deploy.

* Reverted breaking change in IFileSource by obsoleting old method and
2023-10-31 12:38:44 +01:00
Jacob OvergaardandGitHub 53b87cb78c V13: npm updates (ace-editor) (#15033)
* bump vite from 4.4.11 to 4.5.0

* bump ace editor from 1.30.0 to 1.31.0

* bump eslint from 8.51.0 to 8.52.0

* update lockfile
2023-10-31 12:34:52 +01:00
Bjarke Berg 5665ad2b75 Merge remote-tracking branch 'origin/v13/dev' into release/13.0 2023-10-31 12:31:26 +01:00
Zeegaan eb355f4ab6 Compare invariant to string instead, as SqlServer rounds DateTime 2023-10-31 12:30:12 +01:00
Ronald BarendseandGitHub 7677708917 Fix JsonNetSerializer settings leaking into derived implementations (#14814)
* Change settings static field to instance property

* Rename property to Settings
2023-10-31 12:18:51 +01:00
Jeffrey SchoemakerandGitHub 8e7831f4b8 Update NestedContentPropertyEditor.cs - Update obsolete message (#14953)
Nested Content is removed in v14, not in v13 anymore. This makes sure developers won't get confused / in panic mode
2023-10-31 12:17:34 +01:00
Bjarke Berg 2cf839f686 Merge remote-tracking branch 'origin/v13/dev' into release/13.0 2023-10-31 11:39:05 +01:00
6658a521b2 Dynamic Root (Alternative to XPath in MNTP) (#15035)
* Temp commit.. Initial work on XPath alternative for dymamically finding start nodes

* First commit that goes all the way from ui to db for NearestAncestorOrSelf

* Added more filters + return null from controller instead of not found

* Bugfix

* rewrite query to make sqlserver happy?

* Added more tests

* clean up initial step

* Added tests and refactor

* Update endpoint to take model instead of json

* pick origin

* Use model for config instead of string

* append add filter button

* fix

* default filter

* rename json fields

* correct field names

* minor corrections

* Renaming..

* Rename endpoint

* initial work for appending query steps

* query steps ui

* more localization

* query step UI

* Use doc type keys instead of alias

* only for Documents

* change to send keys to anyOfDocTypeKeys

* Fix potential bug

* Fix when level is impossible to get

* correct prop to dynamicRoot

* noValidStartNode dialog

* custom query step

* Renaming

* Rollback unintended file change

* Fixed issue if no doc type is chosen

* Remove unintended file changes

* More unintended changes

* Renaming

* Optimizations

- IDE Recommendation for better source
- Renaming for better clarity
- Improving spacing/formatting
- Typo corrections
- Remove warnings concerning IEnumerable

* Fix failed attempt bug

---------

Co-authored-by: Niels Lyngsø <niels.lyngso@gmail.com>
Co-authored-by: Sven Geusens <sge@umbraco.dk>
2023-10-31 11:38:24 +01:00
Bjarke Berg 892e4a5678 Merge remote-tracking branch 'origin/v13/dev' into release/13.0 2023-10-31 10:07:38 +01:00
1b34d33eb7 Webhooks administration from Backoffice (#15050)
* Create webhook models

* Define interfaces for service and repository

* Create Webhook dto and corresponding factory

* implement WebhookRepository.cs

* Remove entity name from models, as that should be resolved in mapping instead

* Add new table to schema creator

* Register repo for DI

* Remove more mentions of entityname

* Refactor repository to guids

* Implement WebhookService

* Use scopes in service

* Start creating tests for service

* Refactor delete to use Id and not entire entity

* Rework Webhooks to be able to have multiple entity keys

* Implement GetAll functionality

* Implement webhook controller

* Imeplement get all events action

* Add equalityComparer deletegate to Webhook

* Add datacontract attirbutes to properties

* Implement backoffice webhooks tree

* Implement first webhooks menu

* Make WebHookController authorized

* Update to have tabs with webhooks and logs

* Enable create overlay

* Push to entityKeys array

* Fix up pagination

* Implement delete functionality

* remove pagination

* add log view

* Fix create to be able to select more than one content type

* implement type name resolving for content

* Refactor to use less duplication

* Implement update functionality in frontend

* Rename database table

* Make multiple events possible

* create new event picker

* Refactor to actually add new database table with proper name

* Make it possible to select multiple events

* Fix updating current items

* Fix up update functionality after db rework

* Add webhook icon

* Switch to match heartcore icons

* Refactor to use bases instead of Enum

* Refactor to make IWebhookEvent to Collection, so it can be injected instead of using reflection

* Fix up frontend to match new models

* Fix integration tests

* Remove obsolete entity key from webhookdto

* Introduce constants instead of hard coded strings

* Start implementation of firing mechanism

* Add new GetByEventName method

* Add 1 to many list on WebhookDto

* Implement new repository pattern

* Implement GetByEventName

* Fix up repository to use all async

* Refactor events to fire

* Refactor WebhookEvents to be more DRY

* Add custom header

* Start implementing log repository

* Implement GetPaged

* Implement WebhookLogService

* Implement GetLogs

* Add url to webhook log

* Implement log overview

* Formatting

* Implement details view

* Refactor to get actual retry count

* Refactor firing to fire only when Enabled

* Add Status code to detailed view

* Add configuration to disable webhooks entirely

* Implement custom headers frontend

* Implement persistence of custom headers

* Refactor retry service to also retry on non success status codes.

* Refactor registration of Webhooks, to also register as NotificationHandler

* Add webhooks migration

* Add key for adding webhook headers

* Fix up test

* Change event icon to flag

* Remember event, when editing what events you have chosen

* Refactor reflection to check if INotificationAsyncHandler instead

* Formatting

* Refactor webhook model to no longer derive from EntityBase

* Rename entityKeys to content keys

* Rename controller to lowercase H

* Add null check before trying to access selectedEvents

* Add configuration for maximum number of retries

* Add index to date

* Add webhook Key to logs

* Check for SchedulingPublisher before sending webhooks

* rename requestObject to payload

* Refactor event to send appropriate payloads

* Refactor logging to happen for every try.

* Order date by descending

* Add todo

* Change firing service to use String not ByteContent

* Update Headers to Interface instead of concrete implementation

* Dont return if a table exists already

* Rename updateModel to webhook

* Annotate WebhookController.cs with PluginController attribute

* Add danish translations

* Do not check if fail

* Dont filter when selecting custom items

* Remove delay from WebhookFiringService

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-10-31 10:06:14 +01:00
Jacob Overgaard d40797b91b Merge remote-tracking branch 'origin/v13/dev' into release/13.0 2023-10-30 14:58:06 +01:00
Jacob Overgaard 107a70ad31 bump @umbraco-ui/uui from 1.4.0 to 1.5.0 2023-10-30 14:54:53 +01:00
Jacob Overgaard 5bfd7d405f bump @umbraco-ui/uui from 1.4.0 to 1.5.0 2023-10-30 14:50:09 +01:00
Jacob Overgaard bab06b7749 bump @umbraco-ui/uui from 1.4.0 to 1.5.0 2023-10-30 14:50:00 +01:00
Bjarke Berg 73fd3c02fe use dotnet 8 for docs 2023-10-30 13:55:26 +01:00
Bjarke Berg f1a12e2a50 Update docfx and use dotnet global tool 2023-10-30 13:13:32 +01:00
Bjarke Berg 60e910e7e5 Remove the parts later moved to v14 2023-10-30 12:31:17 +01:00
Bjarke Berg 761088c0e9 Update version 2023-10-30 08:59:38 +01:00
Chriztian SteinmeierandGitHub 8e609af901 Updates to Danish translations (#15057)
* Updates to Danish translations

Typo fixes & grammar fixes

* Updating as discussed in the PR
2023-10-28 17:19:34 +02:00
Marc GoodsonandGitHub 51553e0270 Make clearer where to go to see build documentation (#15054)
* Make clearer where to go to see build documentation

* lose a bracket
2023-10-27 11:47:42 +01:00
MichaelandEmma L Garland 38a0417ef3 Correct typo's... 2023-10-27 11:26:59 +01:00
MichaelandEmma L Garland d5859669f6 Updated FR file 2023-10-27 11:26:59 +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
de12019fea Bugfix: UI for preview bug related to single language & non variant content (#15032)
* Bump tinymce from 6.7.0 to 6.7.1

* Ensure PackageVersion is set correctly before transforming template.json

* rerun watchers every time we reinit the data

* handle variant content with only one language

---------

Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>
Co-authored-by: Ronald Barendse <ronald@barend.se>
2023-10-26 09:25:50 +02:00
Sebastiaan Janssen 634afc4b18 Add "unwanted changes" doc back 2023-10-26 09:15:54 +02:00
Bjarke Berg 1ad5b05ef5 Merge remote-tracking branch 'origin/v12/dev' into v13/dev 2023-10-26 09:03:04 +02:00
Bjarke Berg e7f4d321c5 Merge remote-tracking branch 'origin/v11/dev' into v12/dev 2023-10-26 09:02:42 +02:00
Bjarke Berg 610080afc4 Merge remote-tracking branch 'origin/v10/dev' into v11/dev 2023-10-26 09:02:04 +02:00
8dff55fced Update nuget packages (#15039)
* Update nuget packages

* Update to use latest rc2 version of packages instead of specific

* Update src/Umbraco.Cms.Persistence.EFCore.SqlServer/Umbraco.Cms.Persistence.EFCore.SqlServer.csproj

* dont add private/include assets

* Remove duplicate serilog reference

* Revert Moq update

* Update src/Umbraco.Web.UI/Umbraco.Web.UI.csproj

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2023-10-26 09:01:29 +02:00
Bjarke BergandGitHub f4ac6cdded Added "pr: none" to nightly trigger (#15044) 2023-10-26 09:01:25 +02:00
Bjarke Berg af39733a96 Merge remote-tracking branch 'origin/v12/dev' into v13/dev 2023-10-25 20:26:18 +02:00
Sebastiaan JanssenandGitHub ca5dce571c Update CONTRIBUTING.md 2023-10-25 16:45:38 +02:00
Busra SengulandGitHub 31e22710f0 Contributing section seperation (#14849) 2023-10-25 16:43:04 +02:00
Sebastiaan Janssen d1da22b665 Merge branch 'v12/dev' into contrib 2023-10-25 14:23:58 +02:00
Nikolaj GeisleandGitHub e1a1dedfb9 Dont explicitly index nested property by default (#15028) 2023-10-24 14:43:57 +02:00
Jacob OvergaardandGitHub 922be1c416 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
2023-10-24 13:59:42 +02:00
b423329d97 Turkish language support changes (#15005)
* Turkish language support changes

* small updates and corrections

---------

Co-authored-by: Nurhak Kaya <nurhak.kaya@greatstate.co>
2023-10-24 00:20:04 +02:00
kjac 304a64be5a Remove duplicate reference to Core 2023-10-23 14:00:33 +02:00
Ronald Barendseandkjac 69c1bcec3a Ensure PackageVersion is set correctly before transforming template.json
(cherry picked from commit 0170ecaec1)
2023-10-23 13:06:21 +02:00
Ronald BarendseandGitHub 0170ecaec1 Ensure PackageVersion is set correctly before transforming template.json 2023-10-23 11:17:40 +02:00
Jacob Overgaard dcdc4d9a48 run npm audit fix 2023-10-23 10:57:41 +02:00
a27267e5d3 V13: New login screen (#14780)
* implement interface

* add build targets for login screen

* package lock

* move components to pages folder

* load logo and background from property

* styling

* move mocks around

* remove unused vars

* add backoffice handlers

* install rxjs

* add mock data

* add element and context for localization

* mock data

* use umb-localize

* remove the extra logic with check for section_

* change key for login button

* add base to vite environment

* login styling

* cleanup and button styling

* use correct reset url

* change body of reset request

* validate password reset code

* redirect to /login/new on reset password code verify

* add obsolete messages

* remove inline scripts for old backoffice

* remove shadowdom from localize element

* Revert "remove shadowdom from localize element"

This reverts commit 46ae282f7c.

* hook up reset password to api

* rename pages to state as it is not actually used as different pages

* reset password styling

* more styling

* add confirmation page to new password

* set router to firstUpdated to avoid rAF

* set a custom baseUrl on the router to make sure it works without trailing slash

* use route parameters to redirect on the login page to ensure correct escaping

* add server variables

* make sure auth layout uses the provided properties for images

* format

* redirect to code expired page

* add missing properties

* use allowPasswordReset and allowInvite properties in routing and layout

* make ts happy

* cleanup

* init invite page

* hook up usernameIsEmail

* init external login providers

* add mock provider

* add padding to buttons

* replace uui button with normal button

* add external login providers as slot

* add disableLocalLogin property

* add form to external login providers

* remove unused method

* fix build errors

* add attributes for external login

* add custom view to external login

* add new custom icon registry

* attach two icon registries

* use relative paths

* use relative paths

* use main registry instead of providing directly

* add look and color to external login

* implement getIcons() method

* use getIcons() to request icons

* install remixicon to supplement backoffice icons (replacing font-awesome eventually)

* move icon registries to auth element

* Revert "install remixicon to supplement backoffice icons (replacing font-awesome eventually)"

This reverts commit 0c6659d8d9.

* add icons for common external providers

* add more icons

* remove resetCode hack as it is no longer needed

* add validation to new password

* get gretting from translation file

* add hack to get text left aligned in uui-button

* add custom router

* WIP Use router

* also change the URL during an action

* update login action to redirect to /new when needed

* redirect to login from reset and new if not allowed

* fix new password button href

* use property on login element instead of context

* check for redirect on invite-user

* move fake external login providers to index.html for use in dev server

* allow password reset on dev server

* add look and color

* only set styles for default view buttons

* suppress vite import warning

* check and inform for errors and show 'nothing' if a custom view fails to load

* fix mock path for localizedtext

* fix build errors

* ensure that msw (and all its dependencies) do not end up in the production bundle (saved ~500 KB)

* Revert AngularValueExternalLoginInfoScriptAsync removal

* forward the providerName to custom views

* change default icon

* add button look and color to external login provider options

* add obsolete to ButtonStyle and add a mapper to new values

* add required xml comments

* map external login providers to <umb-login-external />

* fix typo

* only show external login layout if there are slotted children

* pass on name as "provider"

* send externalLoginUrl to custom views

* cleanup

* global import

* hide external logins completely when empty

* cleanup

* setup redirect to invite

* rename pages to name-page

* fix names and paths

* use new password layout for invite and new password

* add comments

* cleanup and use confirmation element

* set parameters after successful verifyinvite

* map display-name and provider-name to the external element

* map display-name

* set up external login to handle correct display- and provider-name with documentation

* add support for disabling local login

* update path to handlers

* add more localization

* add handlers for 2fa

* router should support a factory for component

* push login to ?flow=mfa on 402 codes

* add page to handle 2fa/mfa

* add support for custom routing

* add fallback for welcome greeting

* handle AngularJS silliness

* fix typo

* fix router and replace custom umbroute:statechange  event with native pushState

* simplify code and cleanup

* a11y improvements

* you can now navigate to anywhere from anywhere with pushState

* access the "twoFactorView" from the backend

* set the default implemented twoFactorView to NULL

* add initial logic to handle a custom mfa view

* roll back custom pushState changes

* add mocks for 2fa custom view

* use router redirect

* re-enable click url change

* cleanup

* remove debug buttons

* add unsafeHTML to localize element

* load mfa custom views

* load custom view

* improve external login custom views

* using optimisation

* add current culture

* only show mfa page if 402 code has been encountered in same session

* format

* remove unnesesary action

* add new user invite password

* remove console log

* fix getting stuck at new password page if you've triggered custom validity

* unify layouts

* add styling to buttons in error layout

* remove unused css

* add error message to new password page

* add error message to reset password

* add error message to invite page

* fix invite page not being rendered

* cleanup

* add obsolete notice to PostSetInvitedUserPassword

* add request model to set a new password for an invited user

* add new method to handle invited user password

* add get password config api call

* fix password config parameters and add invite call

* get invited user

* get password config

* assign unique guid to login project

* add userId to get password config and use the config as validation

* fix

* add alerts

* fix the new password layout

* auth redirects invite error to error page

* use password config on new password page

* remove console log

* move file and remove unused extension

* make ts happy

* file structure

* rename login-extern to external-login-provider

* update element name

* update dependencies

* export custom-view.element.ts

* remove debug

* use umb-custom-view to load custom views

* build types

* move @umbraco/uui to the login app and import from there in backoffice

* make the ui library and icon registry generally available as exports from the login app

* add mock handler for icons

* cleanup package

* use uui for external login providers in the backoffice

* add imports and enable the backoffice icon registry globally

* disable shadowdom

* default background image

* use undefined

* revert angular values

* remove legacy sys variables

* add logic to handle mfa in an overlay scenario without routing

* add new login screen to replace the overlay when logged in to the backoffice

* update spec to work with locators

* cleanup of legacy context

* ViewData is not always required

* add method to solely return the default view of the backoffice to simply BackofficeController as well as unit tests

* add test for the login view

* cleanup usings

* Apply suggestions from code review

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

* remove 'remember me'

* add more contrast to external login divider

* update dependencies

* set "lang" attribute to lowercase

* remove default headline

* localize the "Or" divider and add aria-hidden

* remove Umbraco reference from logo and add aria-hidden

* add aria-hidden to uui-icon inside external login buttons

* format code

* update dependencies

* update dependencies

* add translations to invite user page

* use back to login button

* update localization-context.ts to match api from old LocalizeService in Angular

* add tsc to watch

* formatting

* add missing localizations

* fix a11y issues with muted text

* refresh current user after login

* remove unused variable

* add localization

* add localization for error messages

* remove unused var

* return user after login and set successful auth

* retry request queue after login

* add language keys for failed login

* add language keys for failed login

* render the views without a router so that it works inside a modal in the backoffice

* add autocomplete to reset password fields

* add autocomplete to login screen

* add generic error layout to new-password-page

* new-password-layout should be able to handle with and without username

* update language keys

* check for userId before trying to request invited user

* show error when no invited user is found

* place back-to-login button on all error layouts

* update lockfile

---------

Co-authored-by: Jesper Møller Jensen <26099018+JesmoDev@users.noreply.github.com>
Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
2023-10-23 10:06:17 +02:00
Jacob Overgaard f8f58eacd2 Merge branch 'v12/dev' into v13/dev 2023-10-23 09:43:59 +02:00
Jacob Overgaard 3936fec57f Bump tinymce from 6.7.0 to 6.7.1 2023-10-23 09:41:15 +02:00
dependabot[bot]andJacob Overgaard 223598b037 Bump tinymce from 6.5.1 to 6.7.1 in /src/Umbraco.Web.UI.Client
Bumps [tinymce](https://github.com/tinymce/tinymce/tree/HEAD/modules/tinymce) from 6.5.1 to 6.7.1.
- [Changelog](https://github.com/tinymce/tinymce/blob/develop/modules/tinymce/CHANGELOG.md)
- [Commits](https://github.com/tinymce/tinymce/commits/6.7.1/modules/tinymce)

---
updated-dependencies:
- dependency-name: tinymce
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-23 09:36:30 +02:00
Lucas Bach BisgaardandEmma L Garland 7c59a81e5c Bug fix for compistion on member and media give 404 2023-10-22 19:22:00 +01:00
Ambert van UnenandMichael Latouche 71c00579e4 Added aria-labelledby so no longer 'empty' 2023-10-22 19:48:09 +02:00
d749731413 Condition on the userState instead of the dates. (#14950)
Co-authored-by: Lucas Bach Bisgaard <lom@novicell.dk>
2023-10-22 19:25:51 +02:00
Richard ThompsonandGitHub ed006931a4 Grant all users access to the content recycle bin (#14977)
* Grant all users access to the content recycle bin

If users don't have access to the root node of the content section they now get access to the recycle bin.

* Content editors get access to their nodes and recycle bin

All users with access to the content section will get access to the recycle bin as well as the nodes they have access to, even if they don't have access to the root of the content section
2023-10-22 18:48:52 +02:00
kjac 6a8f8a48ed Fixed merge conflicts and ensured same version of OpenIddict abstractions across the solution 2023-10-22 11:48:27 +02:00
kjac 3169ff9581 Merge branch 'v12/dev' into v13/dev
# Conflicts:
#	build/azure-pipelines.yml
#	src/Umbraco.Core/Configuration/Models/SecuritySettings.cs
#	version.json
2023-10-22 11:23:04 +02:00
Emma GarlandandMichael Latouche 16c5c4c4e8 Fixed warning SA1116 (The parameters should begin on the line after the declaration...), whenever in ctor 2023-10-22 02:20:45 +02:00
Emma GarlandandMichael Latouche f3028a00b3 Added word-wrap so block item doesn't extend over the whole line 2023-10-22 02:03:53 +02:00
Matthew CareandMichael Latouche f8b66aaf50 Fix issue with pressing enter on color picker labels
Prevent form submission when pressing enter in color picker labels, instead execute "add" code.
Improve validation highlights.
2023-10-20 01:57:06 +02:00
Richard ThompsonandGitHub 0c82b9b700 Stopped the second tab being highlighted by default (#14969)
* The second button shouldn't be highlighted automatically if it's in the second tab otherwise both the first and second tabs are highlighted

* Corrected the logic
2023-10-19 17:00:54 +01:00
Ronald BarendseandGitHub 2c572c6f72 Only pack transformed template.json file
When building and packaging at the same time, the original template.json file was still included in the generated NuGet package, which resulted in duplicate files with the same name. This change explicitly disables packaging the original file, ensuring only the transformed template.json file (containing the current Umbraco version) is included.
2023-10-19 10:49:10 +02:00
Dave WoestenborghsandGitHub b26709b0af Fix permissions for assign hostname (#14896)
* Fix permissions for assign hostname

* Reduced code duplication
2023-10-19 03:30:35 +02:00
dependabot[bot]andJason Elkin 74af2a0700 Bump @babel/traverse from 7.22.5 to 7.23.2 in /src/Umbraco.Web.UI.Client
Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.22.5 to 7.23.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-18 23:50:24 +01:00
georgebidandGitHub c0b01807a4 New login page playwright test - Ensure Show/hide password button works as expected. (#14970) 2023-10-18 23:13:48 +01:00
Georgina BidderandJason Elkin 74d01c6573 our umbraco link works as expected. 2023-10-18 23:10:40 +01:00
Jan SkovgaardandGitHub d4d594bdb5 14523: Return focus to trigger element when close event occurs (#14991)
* Return focus to trigger element when close event occurs

* Add missing semi colon
2023-10-18 22:44:58 +01:00
Marc GoodsonandJason Elkin b9c7de39ed don't overwrite linkpicker title when you pick from tree IF
the editor has just typed into the linktitle
2023-10-18 20:57:30 +01:00
Ronald BarendseandGitHub 0c7f9ec64f Fix unrecognized value stageDependencies in jobs 2023-10-18 14:58:44 +02:00
Ronald BarendseandGitHub eac6af6878 Use correct stage to stage condition dependencies 2023-10-18 14:52:08 +02:00
Ronald BarendseandGitHub fb73a6a66b Remove duplicate/incorrect Umbraco.Core project reference 2023-10-18 12:17:29 +02:00
Kenn JacobsenandGitHub 684508643f Ensure additional preview URLs work on non-variant content (#14995) 2023-10-18 10:45:16 +02:00
Jacob OvergaardandGitHub 4a63788079 V12: Update Backoffice dependencies: jQuery, TinyMCE, SignalR, Ace Editor, Umbraco UI Library (#14994)
* bump @microsoft/signalr to 7.0.12

* bump @umbraco-ui/uui to 1.4.0

* bump ace editor to 1.30.0

* bump frontend build dependencies

* bump jquery to 3.7.1

* bump tinymce to 6.7.0

* bump frontend test suite tools
2023-10-18 10:44:06 +02:00
Sebastiaan Janssen 9c1abf23b0 Merge branch 'contrib' into v12/dev 2023-10-17 13:27:10 +02:00
Lucas Bach BisgaardandGitHub 738749b705 Fixes #14351 - Using Fallback to default langauge on a specific item changes the whole VariationContext (#14620) 2023-10-17 13:24:24 +02:00
b0ca3444f4 V13: Add config to limit concurrent logins (#14989)
* Add config to limit concurrent logins (#14967)

* Add new config options

* Change validation interval + related changes

* Fix typo

* Temp fix

* Set new setting to false for new dotnet projects

* Added logic to update security stamp on sign in + fixed wierd code calling handle signIn twice

* Cleanup

* Adding empty ctors

---------

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

* Set default setting to false + remove it from templates

---------

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2023-10-17 12:58:02 +02:00
0a8b12793e Add config to limit concurrent logins (#14967)
* Add new config options

* Change validation interval + related changes

* Fix typo

* Temp fix

* Set new setting to false for new dotnet projects

* Added logic to update security stamp on sign in + fixed wierd code calling handle signIn twice

* Cleanup

* Adding empty ctors

---------

Co-authored-by: Elitsa <elm@umbraco.dk>
2023-10-17 10:23:52 +02:00
Kenn JacobsenandGitHub ea4f07bd08 Create matcher policy to pick the correct item endpoint (#14987) 2023-10-17 08:55:09 +02:00
7cf1ad7592 add Audit Trail to the media info tab just alike the conten (#14781)
* add Audit Trail to the media info tab just alike the conten

* Change the tranlation from "content ..." to "Media ..."

---------

Co-authored-by: Lucas Bach Bisgaard <lom@novicell.dk>
2023-10-16 16:55:30 +01:00
Sebastiaan Janssen 13913cd9fb Merge branch 'v12/dev' into contrib
# Conflicts:
#	version.json
2023-10-16 12:53:07 +02:00
Kenn JacobsenandGitHub 4bd9baa2eb Backport Delivery API member auth from V14 (#14964)
* Backport Delivery API member auth from V14

* Add default implementations to avoid breakage

* Review changes
2023-10-16 11:25:29 +02:00
4520fbe5b8 Out-of-date models status flag is created when using SourceCodeManual and Development Runtime (#14966)
* Update UmbracoBuilderDependencyInjectionExtensions.cs

* Remove duplicate OutOfDateModelStatus handlers

---------

Co-authored-by: Ronald Barendse <ronald@barend.se>
2023-10-16 10:46:58 +02:00
Owain JonesandGitHub 1b3642e7f3 Updated Welsh lang file (#14978)
* Added missing Welsh translations

* added missing mfa en_us keys

* Removed outdated lang keys from the cy lang file

* Fixed some instances of &lt;/&gt; to use actual angle brackets in the cy lang file.
2023-10-15 01:09:09 +02:00
0b5d1f8aa6 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>
2023-10-14 17:13:26 +02:00
Georgina BidderandSebastiaan Janssen 8b1191c332 help links tests + clean up of system info 2023-10-14 16:04:15 +02:00
Bjarne FyrstenborgandEmma L Garland 70d36301ab Remove duplicate name attribute in 2FA login form 2023-10-14 10:56:34 +01:00
Bram HovenandGitHub b8928e9de0 Add IExceptionHandlerFeature check to dynamic route check (#14905)
* Add IExceptionHandlerFeature check to dynamic route check

* Decrease code complexity
2023-10-14 02:01:59 +02:00
Erik-Jan WestendorpandEmma L Garland 73fc6bdcdf a11y improvement 2023-10-13 13:47:53 +01:00
b850cd3ee0 Add SetMemberSignInManager builder extension (#14761)
* Add SetMemberSignInManager builder extension

* Added required using statement

---------

Co-authored-by: Emma Garland <emma.garland@rocksolidknowledge.com>
2023-10-13 12:30:13 +01:00
Lucas Bach BisgaardandGitHub 0ece94bf46 Bug fix whre mediapicker dont load before an event fires elsewhere #14250 (#14803) 2023-10-13 10:34:45 +01:00
Michael 0362dcffc8 Remove submodule 2023-10-12 03:21:53 +02:00
KNOWIT\anndal3andMichael Latouche 612b6039f2 Add aria label to umbraco property 2023-10-12 02:22:21 +02:00
Ronald BarendseandGitHub b6f0db7b73 Fix build logging of warnings/errors during packaging step (#14933)
* Use DotNetCoreCLI for dotnet pack command

* Use NBGV to get major version and set build number

* Use NBGV_PublicRelease to determine stable build

* Use latest Node patch versions

* Generate NuGet packages during build
2023-10-11 11:25:05 +02:00
Bjarke Berg 42bc50eccf Merge remote-tracking branch 'origin/v12/dev' into v13/dev 2023-10-10 13:44:46 +02:00
Bjarke Berg 0844cb8b29 Merge remote-tracking branch 'origin/v11/dev' into v12/dev
# Conflicts:
#	src/Umbraco.Core/Services/ContentService.cs
#	tests/Umbraco.Tests.AcceptanceTest/package-lock.json
#	tests/Umbraco.Tests.AcceptanceTest/package.json
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/BlockGridEditor/Content/blockGridEditorAdvanced.spec.ts
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/BlockGridEditor/Content/blockGridEditorAreasContent.spec.ts
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/BlockGridEditor/Content/blockGridEditorSettings.spec.ts
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/BlockGridEditor/Datatype/BlockGridEditorDataTypeBlocks.spec.ts
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/content.spec.ts
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/ModelsBuilder/modelsbuilder.spec.ts
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/partialViewMacroFiles.spec.ts
2023-10-10 12:49:22 +02:00
Bjarke Berg e6a1640c1b Merge remote-tracking branch 'origin/v10/dev' into v11/dev
# Conflicts:
#	tests/Umbraco.Tests.AcceptanceTest/package-lock.json
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/content.spec.ts
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataTypes/dataTypes.spec.ts
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/ModelsBuilder/modelsbuilder.spec.ts
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/partialViews.spec.ts
2023-10-10 12:27:33 +02:00
Bjarke BergandGitHub 41f8f03c2c 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
2023-10-10 11:51:47 +02:00
Elitsa MarinovskaandGitHub 132935c2d7 Handle corrupted index (#14889) 2023-10-09 10:19:36 +02:00
Richard OckerbyandEmma L Garland 6e154e0a0f Corrected mark-up
An extra closing div tag was lurking around
2023-10-09 08:48:15 +01:00
Vitor RodriguesandLaura Neto 39492f9654 Fixed URL tracking not working for invariant pages with culture variant ancestors 2023-10-06 18:30:02 +02:00
Erik-Jan WestendorpandEmma L Garland 6e937692be Update MemberService.cs 2023-10-06 13:54:48 +01:00
Erik-Jan WestendorpandEmma L Garland 7aa246b855 Update MediaController 2023-10-06 13:46:07 +01:00
JamesandEmma L Garland cd2855634e Update umbBlockGridPropertyEditor.component.js
currently checks the first group or tab (index 0) that was added to see if there are properties.

This doesn't work well when the tab has a single group, and the group is created after the tab, as the tab will be empty, even though the group has the properties. 

there is also some interactions when composing tabs from other doc types, but I didn't have a good amount of time to test this.
2023-10-06 13:22:29 +01:00
Bjarne FyrstenborgandEmma L Garland 46b0833d52 Pass in format parameter 2023-10-06 12:13:22 +01:00
Bjarne FyrstenborgandEmma L Garland d3ceeb0ace Update keywords 2023-10-06 12:13:22 +01:00
Bjarne FyrstenborgandEmma L Garland b917d64eec Allow to specify format and parsing format in dateHelper functions 2023-10-06 12:13:22 +01:00
justinbotgerandMichael Latouche 9e168f6502 Updated Dutch translation for "import"
Updated Dutch translation for "import"
2023-10-06 10:44:44 +02:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
961f6a0bab Bump postcss from 8.4.24 to 8.4.31 in /src/Umbraco.Web.UI.Client (#14920)
Bumps [postcss](https://github.com/postcss/postcss) from 8.4.24 to 8.4.31.
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/8.4.24...8.4.31)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-05 15:41:17 +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
thomashdkandLaura Neto ced8e0582d Update umb-tabs-nav.html
Added data-element="tab-{{tab.alias}}" to the dropdown tabs list
2023-10-03 19:29:56 +02:00
Laura NetoandGitHub 44a4abdfbd Updating contributing docs to add unwanted changes section (#14853)
* Updating contributing docs to add unwanted changes section

* Added new section to table of contents
2023-10-03 17:44:10 +01:00
1cac8ffe88 made link to umbraco learning base youtube visible with underline sty… (#14884)
* made link to umbraco learning base youtube visible with underline style as per the other links on other dashboards.

* Update membersdashboardvideos.html

---------

Co-authored-by: Georgina Bidder <georgina.bidder@truedigital.co.uk>
Co-authored-by: georgebid <91198628+georgebid@users.noreply.github.com>
2023-10-03 17:42:29 +01:00
Bjarne FyrstenborgandGitHub 34892101a9 Ensure focus on specific action in block card (#14846)
* Ensure focus on specific action in block card

* Move if statement to parent

* Change buttons in groups as well

* Adjust styling
2023-10-03 17:02:20 +01:00
Erik-Jan WestendorpandMichael Latouche 930f9f6704 Translate dictionary_noItemsFound 2023-10-03 16:19:59 +02:00
Anders BjernerandGitHub 4932119807 Replaced [MaybeNullWhen(false)] with [NotNullWhen(true)] for UdiParser.TryParse method (#14880)
* Replaced [MaybeNullWhen(false)] with [NotNullWhen(true)] for UdiParser.TryParse method

* Removing some empty lines
2023-10-03 14:43:54 +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
Kenn JacobsenandGitHub ce86abe8ac Add default property value converters for all value types (#14869)
* Add default property value converters for all value types

* Clean up some left-over stuff
2023-09-28 13:20:03 +02:00
Kenn JacobsenandGitHub ccd54bfb0e Fix property variance cache issue (#14824)
* Property variance should be the union of variance between content type and property type

* Fix a few comments in the tests

* Review changes
2023-09-25 13:45:28 +02:00
Bjarke Berg 06272d9337 Merge remote-tracking branch 'origin/v12/dev' into v13/dev 2023-09-22 10:54:25 +02:00
CarlandJason Elkin 511ee96c9e Fix spelling mistake, and add details of additional packages
Notices this spelling mistake, quick fix
2023-09-22 09:53:12 +01:00
Bjarke BergandGitHub d39502674e Added our own db context pool, that basically bypass the bool until umbraco is in Run mode (#14852) 2023-09-22 10:38:55 +02:00
Bjarke Berg 43cc3b8314 Rollback unintended changes to imagesharp 2 2023-09-22 10:22:25 +02:00
Jason Elkin 336b7ff499 Revert ""big PR" github action"
This reverts commit a3cfbbf56a.
2023-09-21 15:04:14 +01:00
Jason Elkin a3cfbbf56a "big PR" github action 2023-09-21 15:02:06 +01:00
Nikolaj Geisle 4ee21f19f9 Merge remote-tracking branch 'origin/release/12.2' into v12/dev
# Conflicts:
#	version.json
2023-09-21 09:59:07 +02:00
Kenn JacobsenandGitHub 2335924b57 Ensure that value type JSON is translated correctly for Delivery API output (#14839) 2023-09-21 09:25:29 +02:00
Bjarke Berg 03108f4af4 Merge remote-tracking branch 'origin/v13/dev' into v13/dev 2023-09-20 13:12:57 +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
Zeegaan 173d8dcf47 Bump version 2023-09-20 10:29:50 +02:00
Bjarke Berg 9f0f6279b4 Merge remote-tracking branch 'origin/v12/dev' into v13/dev
# Conflicts:
#	tests/Umbraco.Tests.Integration/CompatibilitySuppressions.xml
2023-09-20 10:11:12 +02:00
Bjarke Berg aa7632b271 Merge remote-tracking branch 'origin/v11/dev' into v12/dev 2023-09-20 10:03:39 +02:00
Bjarke Berg e263db7b3b post merge fix 2023-09-20 10:02:58 +02:00
Bjarke Berg 912e9f277e post merge fix 2023-09-20 10:02:25 +02:00
Bjarke Berg ed73b82fd0 Merge remote-tracking branch 'origin/v11/dev' into v12/dev
# Conflicts:
#	tests/Umbraco.Tests.Integration/NewBackoffice/OpenAPIContractTest.cs
#	tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentServiceTests.cs
2023-09-20 09:51:56 +02:00
Bjarke Berg 4dd3c295e0 Merge remote-tracking branch 'origin/v10/dev' into v11/dev 2023-09-20 09:43:41 +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
Bjarke BergandGitHub 989759fa20 Updated NuGet Dependencies (#14795)
* Updated nuget packages and fixed breaking changes in ImageSharp

* Update to .net8 rc1
2023-09-19 11:23:20 +02:00
Andreas ZerbstandGitHub e132bcb2a6 We updated our locator to use data-element instead of alias (#14828) 2023-09-19 10:50:58 +02:00
Bjarke Berg a133a4b57b We need to explicty call UseAntiforgery, otherwise it is called automatically before our middleware that will lead to UmbracoRouteValueTransformer being called instead of static file middleware. 2023-09-19 10:22:42 +02:00
Bjarke Berg 96397adf1f UseDeveloperExceptionPage is called automatically in minimal hosting model 2023-09-19 10:21: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
Arkadiusz BielandGitHub 86697ff137 fix: ensured that allowed user name characters are supported in backoffice users as well (#14810) 2023-09-18 14:55:59 +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
Mads RasmussenandGitHub cb4d8e34ce Feature: Add buttons for additional preview URLs (#14773)
* add button group for multiple preview urls

* generate default + sub buttons for urls

* allow button group to render label without a localisation key

* remove the existing preview button

* add data-element attr for buttons for tours + tests

* use info button style

* set the target of the new window

* get the additional preview urls from the active variant
2023-09-15 09:44:50 +02:00
Jacob Overgaard 643b79c145 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-15 09:19:23 +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 7bbe994fc9 Merge remote-tracking branch 'origin/v10/dev' into v11/dev
# Conflicts:
#	src/Umbraco.Web.UI.Client/src/less/components/umb-property-editor.less
2023-09-14 13:20:55 +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
Jacob OvergaardandGitHub 614aee2fec 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:17:35 +02:00
Andreas ZerbstandGitHub 8ae4c6bf5b V12 Fixed flaky tests (#14789)
* Added a longer timeout for the tests. Also bumped the timeout for isSuccessNotificationVisible

* Added a longer timeout for our tests and the isSuccessNotificationVisible method

* Updated the locator for the flaky test. The locator we had before could sometimes find two elements, which resulted in flaky tests.

* Bumped version of playwright

* Updated to use isSuccessNotificationVisible()

* Added a wait for timeout

* Updated to use isSuccessNotificationVisible()

* Bumped the timeouts

* Bumped our timeouts

* Bumped version of our testhelpers

* Updated the button for save and publish and added an wait for timeout

* Added a missing save for the test

* The test could sometimes find two locators. It should be fixes now

* Removed old usage of notification to be visible

* Removed unnecessary timeouts since we have defined the timeouts in the test helpers
2023-09-13 14:01:08 +02:00
Sebastiaan JanssenandGitHub 1f24b79531 Update README.md 2023-09-13 08:38:54 +02:00
Johan MöllerandGitHub 0bbda02931 Fixes #14722 - DateTime picker calendar does not get updated when custom date format (#14767)
* Seperate properties for input ng-model and datepicker.

Since flatpickr can't handle custom formatting.

* Set picker format to default.
2023-09-12 17:22:29 +01: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 8af8a2b755 Merge remote-tracking branch 'origin/v13/dev' into v13/dev 2023-09-12 09:57:41 +02:00
Bjarke Berg 3fe34d520f Merge remote-tracking branch 'origin/v12/dev' into v13/dev
# Conflicts:
#	version.json
2023-09-12 09:57:30 +02:00
Bjarke Berg 2d76e447bb Post merge build fix 2023-09-12 09:53:10 +02:00
Bjarke Berg 2ce0505784 Merge remote-tracking branch 'origin/v11/dev' into v12/dev
# Conflicts:
#	src/Umbraco.Core/Services/ContentService.cs
2023-09-12 09:50:35 +02:00
Bjarke Berg d47d79af6a Merge remote-tracking branch 'origin/release/12.2' into v12/dev 2023-09-12 09:50:05 +02:00
Bjarke Berg bd9b30f143 Merge remote-tracking branch 'origin/v10/dev' into v11/dev
# Conflicts:
#	version.json
2023-09-12 09:46:24 +02:00
Bjarke Berg ca8c260b6c Bump version 2023-09-12 09:46:07 +02:00
Bjarke Berg f332fe325e Merge branch 'release/11.5' into v11/dev 2023-09-12 09:45:23 +02:00
Bjarke Berg 95ffdae475 Merge remote-tracking branch 'origin/v10/dev' into v10/dev 2023-09-12 09:43:52 +02:00
trba1810andMichael Latouche 7f318e8993 added validation messages in swedish language 2023-09-12 09:00:51 +02:00
Johan MöllerandGitHub 916e495dc4 Fixes: #14486 - Some sr-only texts not localized (#14750)
* Add visuallyHiddenTexts area and keys to swedish

Translations contributed by @plannero

* Add missing localizations.

* Revert prettier formatting

* Format in visual studio

* Change default UpgradeUnattended value to true (#13281)

* add labels to default en.xml + small glitch fix
2023-09-12 08:26:49 +02:00
Andreas ZerbstandJacob Overgaard c42ca63b8d 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:16:41 +02:00
Jacob Overgaard cee485c6db 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:16:20 +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
Bjarne FyrstenborgandEmma L Garland 417e37ab1e Clean output 2023-09-11 12:02:20 +01:00
Bjarne FyrstenborgandEmma L Garland 2ea4b5793d Fallback to value in case no label exists 2023-09-11 12:02:20 +01:00
Bjarne FyrstenborgandEmma L Garland bfdd71944a Cleanup 2023-09-11 12:02:20 +01:00
Bjarne FyrstenborgandEmma L Garland 0296e70b30 Update syntax 2023-09-11 12:02:20 +01:00
Bjarne FyrstenborgandEmma L Garland da92c38dec Newer JS syntax 2023-09-11 12:02:20 +01:00
Bjarne FyrstenborgandEmma L Garland 65321e8f68 Simplify radiobuttonlist prevalue editor 2023-09-11 12:02:20 +01:00
Bjarne FyrstenborgandEmma L Garland 1f97c62a1b Update class name 2023-09-11 12:00:36 +01:00
Bjarne FyrstenborgandEmma L Garland c285caf260 Add dropdown prevalue editor 2023-09-11 12:00:36 +01: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 81b0886021 Fix issue with too long audit log messages 2023-09-07 08:55:27 +02:00
Nikolaj Brask-NielsenandGitHub 6d48091328 docs: XML warnings (#14663)
* chore: Fix XML warnings

* docs: Fix XML warnings

* docs: Fix XML in resource designer

* docs: Fix XML warnings

* Revert "docs: Fix XML in resource designer"

This reverts commit 8ea61c51ac.
2023-09-06 20:08:17 +02:00
Elitsa MarinovskaandGitHub eef0da096e Being able to specify a start item in preview through Start-Item header (#14757) 2023-09-06 10:18:04 +02:00
Kenn JacobsenandGitHub 280d0a236b Breaking changes for the Delivery API (#14745)
* Use interfaces for API media return values + introduce dedicated models for crops and focal points

* Move content and media controllers to their own namespaces
2023-09-06 09:49:44 +02:00
Bjarke Berg 28d16f69ba bump version 2023-09-06 08:51:36 +02:00
147b46440f 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:25:21 +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
Sebastiaan Janssen 401c881567 Merge branch 'contrib' into v12/dev 2023-09-05 10:09:02 +02:00
Bjarke Berg 297b954df4 Merge remote-tracking branch 'origin/v11/dev' into release/11.5
# Conflicts:
#	version.json
2023-09-05 08:05:18 +02:00
Bjarke Berg fd8f809524 bump version 2023-09-05 08:04:16 +02:00
Bjarke Berg c21530e17a Merge remote-tracking branch 'origin/v12/dev' into v13/dev 2023-09-04 10:50:00 +02:00
Ronald BarendseandBjarke Berg 003ac02009 Revert #13281 and only set UpgradeUnattended value to true for new projects (#14764)
* Revert "Change default UpgradeUnattended value to true (#13281)"

This reverts commit e5d6372dbd.

* Set UpgradeUnattended value to true for new projects
2023-09-04 10:49:33 +02:00
Ronald BarendseandGitHub bc68f11d82 Revert #13281 and only set UpgradeUnattended value to true for new projects (#14764)
* Revert "Change default UpgradeUnattended value to true (#13281)"

This reverts commit e5d6372dbd.

* Set UpgradeUnattended value to true for new projects
2023-09-04 10:49:19 +02:00
Bjarke Berg 134ec4ece9 Merge remote-tracking branch 'origin/v12/dev' into v13/dev 2023-09-04 10:30:56 +02:00
Bjarke Berg 155efb8019 Merge remote-tracking branch 'origin/v12/dev' into v12/dev 2023-09-04 10:29:19 +02:00
Ronald BarendseandBjarke Berg 5c7b3a3d48 Change default UpgradeUnattended value to true (#13281) 2023-09-04 10:29:05 +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
Ronald BarendseandGitHub e5d6372dbd Change default UpgradeUnattended value to true (#13281) 2023-09-01 15:45:06 +01:00
Vitor RodriguesandSebastiaan Janssen efe00910f3 DeliveryApi: Ensure the ContentType property is serialized first
This is needed so it can be used as a discriminator field by System.Text.Json
Changed both ApiElement and IApiElement to ensure not only ApiContentResponse,
but also ApiBlockItem, which uses the interface directly, are adjusted.
2023-08-29 12:34:36 +02:00
Vitor RodriguesandSebastiaan Janssen 4d80073547 Fixed incorrect BlockListPropertyValueConverter delivery api property value type 2023-08-29 09:59:42 +02:00
Sebastiaan Janssen 1bcfcf4e84 Merge branch 'v12/dev' into contrib 2023-08-28 12:49:14 +02:00
Bjarke Berg d43e6abc8b Merge remote-tracking branch 'origin/v12/dev' into v13/dev 2023-08-28 11:40:36 +02:00
Bjarke Berg 4964066b59 Merge remote-tracking branch 'origin/v11/dev' into v12/dev
# Conflicts:
#	src/Umbraco.Web.BackOffice/Controllers/MediaController.cs
#	version.json
2023-08-28 11:39:20 +02:00
Bjarke Berg b7738f5d17 Merge remote-tracking branch 'origin/release/12.1' into v12/dev
# Conflicts:
#	version.json
2023-08-28 11:38:52 +02:00
Bjarke Berg 630bbc1e12 Merge remote-tracking branch 'origin/v10/dev' into v11/dev
# Conflicts:
#	version.json
2023-08-28 11:38:15 +02:00
Bjarke Berg f35b31956a Merge remote-tracking branch 'origin/release/11.5' into v11/dev 2023-08-28 11:36:56 +02:00
Bjarke Berg 9fd140f81d Merge remote-tracking branch 'origin/release/10.7' into v10/dev 2023-08-28 11:35:41 +02:00
Nikolaj Brask-NielsenandSebastiaan Janssen fdb0bed960 test: Simplify test project references 2023-08-28 11:08:06 +02:00
Sebastiaan Janssen ab48af878a Merge branch 'contrib' into v12/dev 2023-08-28 10:16:35 +02:00
Sebastiaan Janssen d7ae0aa129 Merge branch 'contrib' of https://github.com/umbraco/Umbraco-CMS into contrib
# Conflicts:
#	src/Umbraco.Cms.Persistence.EFCore/UmbracoDbContext.cs
2023-08-28 10:02:43 +02:00
Nikolaj 9230b253b6 Bump version 2023-08-28 09:47:14 +02:00
Nathan WoulfeandNikolaj 27441dfee1 Don't pass content object to save method - it's not a suitable label key :) (#14496)
* don't set label key to entire content model...

* Remove the default parameter value

---------

Co-authored-by: kjac <kja@umbraco.dk>
(cherry picked from commit 5dfb914e0f)
2023-08-28 09:46:44 +02:00
Bjarke Berg 3a53f51ef3 Remove parsing of short into integer (#14721) 2023-08-25 13:08:51 +02:00
Bjarke BergandGitHub 1198c76d67 Remove parsing of short into integer (#14721) 2023-08-25 13:07:42 +02:00
Christian Funder SommerlundandGitHub fec51a9ec5 Add ReSharperTestRunner64 to the assembly exclusion list in TypeFinder (#14498) 2023-08-24 13:06:21 +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
Nikolaj f2b0c0e8eb Bump version 2023-08-24 10:44:01 +02:00
Nikolaj Brask-NielsenandGitHub 3f6ebe7656 feat: Let the DbContext handle the connection to the database (#14674) 2023-08-24 10:15:18 +02:00
Ronald BarendseandNikolaj f97e9a9f34 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:55:48 +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
Elitsa MarinovskaandGitHub d553297369 V12: Get multiple items by ids endpoints (#14702)
* Adding get multiple items by their ids endpoint

* Adding get multiple items by their ids endpoint for the Media API as well
2023-08-23 07:13:20 +02:00
Nikolaj Brask-NielsenandGitHub 7b336c45f7 perf: Don't call GetNextUsers when we don't have to (#14670) 2023-08-22 15:52:27 +01: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 19ee8e9254 directly render labels without angularJS template code (#14700) 2023-08-22 12:54:36 +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
5dfb914e0f Don't pass content object to save method - it's not a suitable label key :) (#14496)
* don't set label key to entire content model...

* Remove the default parameter value

---------

Co-authored-by: kjac <kja@umbraco.dk>
2023-08-22 11:10:58 +02:00
Nikolaj 380af0057b Bump version 2023-08-22 10:25:55 +02:00
Nikolaj 85f81ed44c Merge remote-tracking branch 'origin/v10/dev' into v11/dev 2023-08-22 10:24:26 +02:00
Nikolaj Brask-NielsenandGitHub a5a6fe4f76 docs: Improve DbContext XML docs (#14673) 2023-08-22 09:34:19 +02:00
Nikolaj Brask-NielsenandGitHub 9a63542645 refactor: Only use pooled DbContexts (#14672) 2023-08-21 14:55:41 +02:00
66bbad3379 Media Delivery API (#14692)
* Introduce media API - controllers, services, tests, Swagger docs

* Add path to media API response + add "by path" endpoint

* Review comments

* Implement filtering and sorting

* Add explicit media access configuration

* Cleanup

* Adding default case as in the MediaApiControllerBase

* Update src/Umbraco.Cms.Api.Delivery/Services/ApiMediaQueryService.cs

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

* Swap sort order calculation to align with Content API

* Add CreateDate and UpdateDate to media responses

* Mirror Content Delivery API behavior for empty children selector

---------

Co-authored-by: Elitsa <elm@umbraco.dk>
Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com>
2023-08-21 13:57:36 +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
b1e42e334d Move to Minimal Hosting Model in a backwards compatible way (#14656)
* Use minimal hosting model

* Make CoreRuntime backward compatible to the old hosting model

* Remove unneccessary methods from interface again

* Pushed the timeout for E2E test to 120 minutes instead of 60

* Updated the preview version from 6 to 7

* Explicitly call BootUmbracoAsync

* Add CreateUmbracoBuilder extension method

* Do not add IRuntime as hosted service when using WebApplication/WebApplicationBuilder

* Set StaticServiceProvider.Instance before booting

* Ensure Umbraco is booted and StaticServiceProvider.Instance is set before configuring middleware

* Do not enable static web assets on production environments

* Removed root namespace from viewImports

---------

Co-authored-by: Andreas Zerbst <andr317c@live.dk>
Co-authored-by: Ronald Barendse <ronald@barend.se>
2023-08-21 12:24:17 +02:00
Bjarke Berg 84cd7a163c Merge remote-tracking branch 'origin/v12/dev' into v13/dev 2023-08-21 08:03:18 +02:00
Bjarke Berg 29d0c6770c Merge remote-tracking branch 'origin/v11/dev' into v12/dev 2023-08-21 08:02:15 +02:00
Bjarke Berg d676850f6c Merge remote-tracking branch 'origin/v10/dev' into v11/dev 2023-08-21 07:58:22 +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
Nikolaj Brask-NielsenandJason Elkin d7cbd9bf61 fix: Translations keys from #12776 2023-08-17 10:38:27 +01:00
Nikolaj Brask-NielsenandJason Elkin 685b867456 fix: Pass correct user id to Audit log 2023-08-16 23:42:59 +01:00
Nikolaj Brask-NielsenandGitHub d33c44c0a3 Fix userid zero in integration tests (#14639)
* test: Fix invalid user ids

* feat: Update parameter defaults with constants
2023-08-16 22:37:10 +01:00
Nikolaj Brask-NielsenandGitHub 3a7e388547 Adds hide toggle to hide unavailable compositions (#12776)
* feat: Added hide toggle to hide unavailable compositions

* fix: Fixed - being .

* chore: Move toggle to top
2023-08-16 15:44:05 +01:00
Bjarke Berg 7eda978cb1 Merge remote-tracking branch 'origin/v12/dev' into v13/dev 2023-08-15 11:07:06 +02:00
Nikolaj 5f28f6d293 Merge branch 'release/12.1' into v12/dev
# Conflicts:
#	version.json
2023-08-15 11:02:43 +02:00
Bjarke Berg b668fd47c6 Merge remote-tracking branch 'origin/v12/dev' into v13/dev 2023-08-15 10:59:44 +02:00
Bjarke Berg f39ae725a4 Merge remote-tracking branch 'origin/v11/dev' into v12/dev 2023-08-15 10:17:49 +02:00
Bjarke Berg 6f25d96b48 Merge remote-tracking branch 'origin/v10/dev' into v11/dev 2023-08-15 10:15:28 +02: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
767bd1bcc0 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:46:27 +02:00
Nikolaj 6cdd56176f Bump version 2023-08-14 18:49:56 +02:00
MoleandGitHub 7abfd146ad Ensure EfCore is known regardless of DeliveryApi (#14678) 2023-08-14 15:15:44 +02:00
Bjarne FyrstenborgandMichael Latouche c472a910e2 Use generic Content Type instead of Document Type 2023-08-13 00:36:18 +02:00
Ronald BarendseandBjarke Berg b743e715d4 Add DynamicRequestCultureProviderBase and improve locking (#14064) 2023-08-10 11:16:23 +02:00
Jacob Overgaard 327ea77294 Merge remote-tracking branch 'origin/v12/dev' into v12/dev 2023-08-10 10:35:32 +02:00
Jacob Overgaard dd94dabd61 update UI docs title to Umbraco 12 2023-08-10 10:35:12 +02:00
Søren GregersenandSebastiaan Janssen 0edee82b0b Remove todo - that has been done 2023-08-10 09:31:03 +02:00
Sebastiaan Janssen e7f940b358 Merge branch 'v12/dev' into contrib 2023-08-10 09:01:26 +02:00
Nikolaj Brask-NielsenandGitHub 7537509ede feat: Show published state in tree picker (#14641) 2023-08-09 16:30:28 +01:00
Bjarke Berg 843d41e564 Update .net 8 to preview 7 2023-08-09 15:53:31 +02:00
Bjarke Berg 5327413092 Merge remote-tracking branch 'origin/v12/dev' into v13/dev
# Conflicts:
#	version.json
2023-08-09 15:28:49 +02:00
Bjarke Berg f7e6480f4b Merge remote-tracking branch 'origin/v11/dev' into v12/dev 2023-08-09 15:27:39 +02:00
Bjarke Berg d421be9d3c Added Indexing to v11+ UmbracoCmsSchema.cs 2023-08-09 15:27:13 +02:00
Bjarke Berg 5fbc922814 Merge remote-tracking branch 'origin/v10/dev' into v11/dev
# Conflicts:
#	src/JsonSchema/AppSettings.cs
2023-08-09 15:27:01 +02:00
Bjarke Berg 667627a6e2 Merge remote-tracking branch 'origin/release/12.1' into v12/dev 2023-08-09 13:21:20 +02:00
d9c3ebdfe8 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:12:39 +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
Bjarke Berg ea51daa086 bump version 2023-08-09 13:09:16 +02:00
Bjarke Berg 336ba22a01 Merge remote-tracking branch 'origin/release/12.1' into v12/dev 2023-08-09 13:08:50 +02:00
Bjarke Berg a4f84ed490 Added Indexing to v11+ UmbracoCmsSchema.cs 2023-08-09 11:51:47 +02:00
Bjarke BergandSven Geusens 945e3be553 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:51:01 +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
Bjarke Berg cae22a6b9f bump version 2023-08-09 08:39:53 +02:00
Bjarne FyrstenborgandMichael Latouche 8e8a09f1ba Fix warning icon color in health check dashboard 2023-08-09 01:17:11 +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 Berg dce320839c Updated .net 8 to preview 6 2023-08-08 12:05:53 +02:00
Bjarke Berg df16f4fbd2 Merge remote-tracking branch 'origin/v12/dev' into v13/dev 2023-08-08 11:40:45 +02:00
Bjarke Berg 85311f9277 Merge remote-tracking branch 'origin/v11/dev' into v12/dev
# Conflicts:
#	src/Umbraco.Core/Events/EventAggregator.Notifications.cs
#	src/Umbraco.Core/Events/EventAggregator.cs
2023-08-08 11:30:40 +02:00
Bjarke Berg 7cf4826e2f Merge remote-tracking branch 'origin/v10/dev' into v11/dev 2023-08-08 11:26:01 +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
Bjarke Berg ef13b1fe1f Merge remote-tracking branch 'origin/release/12.1' into v12/dev 2023-08-07 20:16:45 +02:00
dddabdb8dc Small changes to the EF Core implementations (#14640)
* Added explicit migration for AddOpenIddict and

* Renamed the UmbracoOpenIddictDbContextModelSnapshot to UmbracoDbContextModelSnapshot to align with the name of the DBContext

* Added comment to UmbracoDbContext about it is for internal use

* Only execute all migrations at initial install time

---------

Co-authored-by: kjac <kja@umbraco.dk>
2023-08-07 19:16:35 +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
Jacob OvergaardandNiels Lyngsø cf12de50d8 V12: Remove avatar step from login (#14629)
Co-authored-by: Niels Lyngsø <niels.lyngso@gmail.com>
2023-08-07 11:00:48 +02:00
Rasmus SöderströmandBjarke Berg 7d253d3454 Fix for #14565 - Empty DocType folders hidden (#14581) 2023-08-07 08:48:14 +02:00
Erik-Jan WestendorpandBjarke Berg 0046f1a9f8 Add missing translation (#14588) 2023-08-07 08:47:07 +02:00
Bjarke Berg b10b77bb08 Allow newlines in invite email and escape other html (#14618) 2023-08-07 08:19:43 +02:00
1d8ad9dabb V12: Remove avatar step from login (#14629)
Co-authored-by: Niels Lyngsø <niels.lyngso@gmail.com>
2023-08-04 16:20:27 +02:00
Sebastiaan Janssen 772fa5e23b Revert "Fix for escaping markdown characters in property descriptions (#12345)"
This reverts commit 4aa1597138.
2023-08-02 15:15:11 +02:00
Bjarke Berg f384e0c30c Allow newlines in invite email and escape other html (#14618) 2023-08-02 14:17:39 +02:00
Bjarke BergandGitHub 0d82258803 Allow newlines in invite email and escape other html (#14618) 2023-08-02 12:39:06 +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
Bjarke Berg e48350e064 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:29:02 +02:00
MigaroezandGitHub 85b3d006bf Merge pull request #14626 from umbraco/v12/bugfix/14574_fixed_issue_with_disposed_objects_in_async_notifications
Fixed issue with disposed objects in async notifications
2023-08-02 11:26:05 +02:00
Bjarke Berg 6d64cfbbc4 Merge remote-tracking branch 'origin/v12/dev' into v13/dev 2023-08-02 10:23:32 +02:00
Bjarke Berg 982dd3700d Merge remote-tracking branch 'origin/v11/dev' into v12/dev
# Conflicts:
#	src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js
#	src/Umbraco.Web.UI.Client/src/views/components/upload/umb-file-dropzone.html
2023-08-02 10:13:02 +02:00
Bjarke Berg 8ce48a2634 post merge fix 2023-08-02 10:01:20 +02:00
Bjarke Berg dcdbdbfadd Merge remote-tracking branch 'origin/v10/dev' into v11/dev
# Conflicts:
#	src/Umbraco.Web.UI.Client/src/common/directives/components/upload/umbfiledropzone.directive.js
#	src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js
#	src/Umbraco.Web.UI.Client/src/views/components/upload/umb-file-dropzone.html
2023-08-02 09:53:17 +02:00
Bjarke Berg bbaa2a2212 Added CompatibilitySuppressions for .NET7 2023-08-02 09:46:31 +02:00
Bjarke Berg 41625e3ad2 Updated template to .net8 2023-08-02 09:46:14 +02:00
Sebastiaan Janssen bc127d95ba Fixed note on #13145 - don't make IncludeDescendants settable 2023-08-01 16:11:44 +02:00
b923c32525 fix: mark MultiUrlPickerValueConverter with DefaultValueConverter (#13347)
Co-authored-by: georgebid <91198628+georgebid@users.noreply.github.com>
2023-08-01 14:20:22 +01:00
Bjarne FyrstenborgandGitHub 8f5fee9f76 Add cache buster to injected icons CSS in block grid (#14621)
* Inject icons css via shadow DOM

* Fix typo

* Import icons.less instead
2023-08-01 14:09:10 +01:00
Bjarke Berg c11d0d3f5a 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-01 14:23:30 +02:00
Miguel PintoandGitHub 96f8f70ed5 Fixed incorrect assignment of Last Login Date after a user accepts an invite and sets the password (#14619) 2023-07-31 22:14:20 +02:00
Callum WhyteandGitHub b778834dea Update QR code icon (#14609) 2023-07-31 21:58:47 +02:00
Callum WhyteandGitHub b2831dcd5e Sort content template tree items alphabetically, exclude element types (#14454) 2023-07-31 21:44:02 +02:00
Erik-Jan WestendorpandSebastiaan Janssen 3572642873 Add AddMapDefinition Extension Method 2023-07-31 20:30:17 +02:00
Bjarne FyrstenborgandGitHub 88c35e97a2 Compile css for icons style (#14615) 2023-07-31 20:12:09 +02:00
Dhanesh Kumar MjandGitHub 2282099577 considering id, key & name as filter params for content listview (#14514) 2023-07-31 15:42:21 +02:00
Bjarne FyrstenborgandGitHub 7f09802712 Allow Media Picker 3 to be used as macro parameter editor (#14594) 2023-07-31 15:10:40 +02:00
Bjarne FyrstenborgandGitHub b7f3976831 Ignore 1Password as well in noPasswordManager directive (#14613) 2023-07-31 13:31:47 +02:00
71d990504e Fix incorrect redirectUrl check with external authentication (#14198) (#14423)
* Fix check local redirect url

* Removed line break

* Small adjustment

---------

Co-authored-by: Laura Neto <12862535+lauraneto@users.noreply.github.com>
2023-07-29 17:47:43 +02:00
rasmusmedjandMichael Latouche dc94797784 #14190: Save all languages sent to approval in audit log 2023-07-29 00:32:10 +02:00
Bjarne FyrstenborgandGitHub 157005194f Block grid area allowance editor (#14582)
* Add position relative to button to fix issue with umb-outline on button element

* Add pattern attribute to get more specific virtual numeric keyboard on some devices as we expect integer values

* Fix missing localization of title attributes due missing @ prefix

* Fix incorrect end-closing tag
2023-07-26 16:16:30 +01:00
Bjarne FyrstenborgandGitHub ea642d69e5 Replace attribute with noPasswordManager directive (#14593) 2023-07-25 22:38:40 +01:00
Nikolaj Geisle 8797e93f2e Merge remote-tracking branch 'origin/v12/dev' into v13/dev 2023-07-25 11:37:04 +02:00
978da0384e Merge v11 into v12 (#14604)
* V12: Dropzone should handle internal and external errors when uploading (#14579)

* 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: mark file as done if it errors

* format error messages

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

* remove the image from the DOM if any error is encountered

* 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

* V11/merge v10 into v11 (#14602)

* 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>

* Fix method invoke. (#14597)

* 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

---------

Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>
Co-authored-by: Elitsa <elm@umbraco.dk>
Co-authored-by: Adrian Cojocariu <95346674+acoumb@users.noreply.github.com>
Co-authored-by: Kenn Jacobsen <kja@umbraco.dk>

---------

Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>
Co-authored-by: Elitsa <elm@umbraco.dk>
Co-authored-by: Adrian Cojocariu <95346674+acoumb@users.noreply.github.com>
Co-authored-by: Kenn Jacobsen <kja@umbraco.dk>
2023-07-25 11:16:00 +02:00
c8206cd7d7 V11/merge v10 into v11 (#14602)
* 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>

* Fix method invoke. (#14597)

* 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

---------

Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>
Co-authored-by: Elitsa <elm@umbraco.dk>
Co-authored-by: Adrian Cojocariu <95346674+acoumb@users.noreply.github.com>
Co-authored-by: Kenn Jacobsen <kja@umbraco.dk>
2023-07-25 10:18:49 +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
Bjarne FyrstenborgandGitHub 05b89999af Set max length of text input to avoid server error due character length in database (#14592) 2023-07-24 17:51:02 +01:00
Erik-Jan WestendorpandBusra Sengul 557fe38a98 Change 'Comment' to 'Commentaar' 2023-07-24 17:39:06 +03:00
Adrian CojocariuandGitHub eed9feb5f3 Fix method invoke. (#14597) 2023-07-24 15:18:23 +02:00
dependabot[bot]andJacob Overgaard 46aad34396 Bump word-wrap from 1.2.3 to 1.2.4 in /src/Umbraco.Web.UI.Client
Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.4.
- [Release notes](https://github.com/jonschlinkert/word-wrap/releases)
- [Commits](https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.4)

---
updated-dependencies:
- dependency-name: word-wrap
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-24 08:33:57 +00:00
Jacob Overgaard 24844c6ce2 V12: Dropzone should handle internal and external errors when uploading (#14579)
* 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: mark file as done if it errors

* format error messages

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

* remove the image from the DOM if any error is encountered

* 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
2023-07-24 10:20:07 +02:00
Jacob OvergaardandGitHub 41c7e34059 V12: Dropzone should handle internal and external errors when uploading (#14579)
* 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: mark file as done if it errors

* format error messages

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

* remove the image from the DOM if any error is encountered

* 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
2023-07-24 10:17:58 +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
Erik-Jan WestendorpandGitHub 1527b2577e Add missing translation (#14588) 2023-07-21 10:31:28 +02:00
nikolajlauridsen 28dae0387f Merge remote-tracking branch 'origin/v12/dev' into v13/dev
# Conflicts:
#	Directory.Build.props
2023-07-21 10:20:08 +02:00
nikolajlauridsen 04a10be2a9 Merge remote-tracking branch 'origin/v11/dev' into v12/dev 2023-07-21 10:17:57 +02:00
nikolajlauridsen 0884ee0a4e Merge remote-tracking branch 'origin/v10/dev' into v11/dev
# Conflicts:
#	src/JsonSchema/AppSettings.cs
#	src/Umbraco.Infrastructure/Migrations/Install/DatabaseSchemaCreator.cs
2023-07-21 10:16:50 +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
Rasmus SöderströmandGitHub a936fe09ab Fix for #14565 - Empty DocType folders hidden (#14581) 2023-07-20 12:36:29 +01:00
Ronald BarendseandGitHub 57852f5e62 Add PreRouting and PostRouting pipeline filters (#14503) 2023-07-20 12:23:38 +01:00
Andy ButlandandGitHub 3a857ab584 Added tests for TopoGraph. (#14583) 2023-07-20 08:33:49 +02:00
MoleandGitHub 4824fc8839 Supress execution context flow when queuing email task. (#14571) 2023-07-19 14:42:25 +03:00
Jacob Overgaard 43b44b1004 remove submodule 2023-07-19 10:06:12 +02:00
Dennis ÖhmanandGitHub a49a9851dc #14325 - Remove wildcard-background from RTE (#14439)
* Update rte-content.less

#14325 - Remove wildcard-background from RTE

* Update rte-content.less

I did an update. 🙂

The transparent background is there because the tinymce theme Oxide adds a background-color to all selected elements.
So the umbraco added transparent background makes white text not be visible.

https://github.com/tinymce/oxide/blob/012346905578b0d7e59f7000d447f56243243b4a/src/less/theme/content/selection/selection.less#L50C2-L50C2


So I put back the transparent background-color and added a @blueExtraDark as text-color

I have updated the issue with more details.
2023-07-18 17:10:33 +01:00
Andy ButlandandGitHub d1aac3964c Restored order of operations on scope dispose to that used in Umbraco 11 before refactor into Scope inheriting CoreScope. (#14573) 2023-07-18 12:57:09 +02:00
Sebastiaan Janssen dad49b846f Merge branch 'v12/dev' into contrib 2023-07-18 11:18:26 +02:00
Elitsa MarinovskaandGitHub ba423a0108 V12: Add ISO codes to make the migration from language IDs easier (#14567)
* Change the obsoletion messages for language IDs to target V14 instead of V13.

* Wrong Language file

* Add ISO codes required to migrate custom code from language IDs

* Population of the new language FallbackIsoCode prop

* Changing obsoletion msgs from v13 to v14

* Fix breaking changes
2023-07-18 10:53:14 +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
NuklonandGitHub d52dcb78bb Use built-in Enum parse method, avoids keeping single-use Enums in memory 2023-07-17 20:52:04 +01:00
NuklonandGitHub 531ad2e4d5 Improve Enum performance (#14384) 2023-07-17 17:35:44 +01:00
dependabot[bot]andJacob Overgaard 99263113a0 Bump tough-cookie from 4.1.2 to 4.1.3 in /src/Umbraco.Web.UI.Client
Bumps [tough-cookie](https://github.com/salesforce/tough-cookie) from 4.1.2 to 4.1.3.
- [Release notes](https://github.com/salesforce/tough-cookie/releases)
- [Changelog](https://github.com/salesforce/tough-cookie/blob/master/CHANGELOG.md)
- [Commits](https://github.com/salesforce/tough-cookie/compare/v4.1.2...v4.1.3)

---
updated-dependencies:
- dependency-name: tough-cookie
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-17 06:55:00 +00:00
nikolajlauridsen f902b83940 Fix version 2023-07-14 09:59:56 +02:00
nikolajlauridsen 4df770aa76 Merge remote-tracking branch 'origin/v12/dev' into v13/dev 2023-07-14 09:59:26 +02:00
nikolajlauridsen 103a792074 Merge remote-tracking branch 'origin/v11/dev' into v12/dev
# Conflicts:
#	src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs
#	version.json
2023-07-14 09:44:25 +02:00
nikolajlauridsen af44f7f59d Fix migration plan 2023-07-14 09:38:16 +02:00
nikolajlauridsen 9122885c67 Merge remote-tracking branch 'origin/v10/dev' into v11/dev
# Conflicts:
#	src/JsonSchema/AppSettings.cs
#	src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs
2023-07-14 09:33:57 +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
nikolajlauridsen 291f90d03d Bump version 2023-07-13 10:48:43 +02:00
nikolajlauridsen e317aa29f7 Merge branch 'release/11.4' into v11/dev 2023-07-13 10:48:03 +02:00
nikolajlauridsen 4c39734b51 Merge branch 'release/12.0' into v12/dev
# Conflicts:
#	version.json
2023-07-13 10:38:03 +02:00
20a4e475c8 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:18:34 +02:00
nikolajlauridsen 2a601ae0d0 Bump version 2023-07-13 06:17:34 +02:00
1f26f2c6f3 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:10:51 +02:00
nikolajlauridsen 596284f32d Bump version 2023-07-13 06:07:59 +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
Jacob Overgaard 6f417722ac Merge remote-tracking branch 'origin/v12/dev' into v13/dev 2023-07-12 15:06:29 +02:00
Bjarne FyrstenborgandGitHub 2b62969395 Make it possible to remove blocks using tab key in block grid configuration (#14518) 2023-07-11 15:14:19 +01:00
Sebastiaan JanssenandGitHub dd697ab71c Delete add-issues-to-review-project.yml 2023-07-11 12:58:11 +02:00
Andreas ZerbstandGitHub 313fdf79fe 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-07-10 10:38:43 +02:00
Andreas ZerbstandGitHub 45083b6735 Removed usage of sending umbracoApi to our testHelpers (#14526)
* Cleaned up in Advanced

* Cleaned up in Areas

* Cleaned up in Content

* Cleaned up in Rendering

* Cleaned up in Settings

* Updated the timeout to 40 seconds, 30 seconds is not always enough anymore.

* Bumped version of testhelpers and builders
2023-07-07 14:49:08 +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
d116366b28 V12: Deprecate XPath (#14372)
* Deprecate all outward facing methods that uses XPath

* Add more obsolete messages

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-07-07 11:12:04 +02:00
Bjarke Berg fe6cdb0f17 Merge remote-tracking branch 'origin/v12/dev' into v13/dev 2023-07-07 08:48:33 +02:00
Bjarke Berg 16c78b76dd Merge remote-tracking branch 'origin/v11/dev' into v12/dev
# Conflicts:
#	src/Umbraco.Web.BackOffice/Controllers/MediaController.cs
2023-07-07 08:37:20 +02:00
Bjarke Berg 02e87233c1 Merge remote-tracking branch 'origin/v10/dev' into v11/dev
# Conflicts:
#	src/Umbraco.Web.BackOffice/Controllers/MediaController.cs
#	src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js
2023-07-07 08:34:15 +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
Bjarne FyrstenborgandGitHub 0c595ccc5f Only show groups when any filtered results in group (#14505) 2023-07-06 17:22:49 +01:00
0da33d064a Fixes #12904 UmbracoHelper.GetDictionaryValue defaults to en-US when used in non-front end code (#12942)
* adding new overload/rename a method

* remove this keyword

* fix comment

* remove space

* commit

* revert

* replace param name

* public backward compatibility

* Minor style tweaks

* Don't change default culture in UmbracoCultureDictionary

---------

Co-authored-by: Nikolaj <nikolajlauridsen@protonmail.ch>
2023-07-06 12:29:18 +02:00
Zeegaan dc5c7a14a5 Bump version 2023-07-06 10:40:50 +02:00
Jacob OvergaardandGitHub f18d4b2078 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-07-06 09:52:11 +02:00
Zeegaan c751e90928 Merge branch 'release/10.6' into v10/dev
# Conflicts:
#	version.json
2023-07-06 09:20:47 +02:00
41805af0d9 Updated the package validation baseline version to 12.0.0 (#14389)
* Updated the package validation baseline version to 12 RC1

* Update PackageValidationBaselineVersion to 12.0.0 and remove CompatibilitySuppressions.xml files

* Clean up project files

---------

Co-authored-by: Ronald Barendse <ronald@barend.se>
2023-07-06 07:51:49 +02:00
Andreas ZerbstandGitHub c61e6c4901 Revert "Ensure package view path is generated with consideration the current section (#14268)" (#14508)
This reverts commit 5382820e58.
2023-07-05 13:38:02 +02:00
0ad0f86e6e Update to dotnet 8 preview 5 (#14492)
* Update to .net 8 preview 1

* Update npoco to 5.7.0

* Update pipeline to use .net 8

* Revert "Update npoco to 5.7.0"

This reverts commit f7795afa77.

* Fix tests and updated OpenApi.json

* use dotnet 8 in linux container

* Updated templates and docker image to dotnet 8

* Bugfix

* R
Updated docker images to 8.0 preview 1

* linux docker images updated

* Force use c# 11, in hope of the acceptance tests will pass

* Do not use C# 8 :)

* Update to preview 2

* CompatibilitySuppressions

* updated templates

* Disable package validation

* Update to .net8 preview 4

* change EnableStrictModeForCompatibleFrameworksInPackage to false

* Package validation

* Added CompatibilitySuppressions.xml

* Fix up IP networks

* Updated to preview 5

* Update docker images

* Post merge fixes

* Try to update dotnet version of codeql

* Delete empty suppression files

* Remove dependency

* Cleanup

---------

Co-authored-by: Elitsa <elm@umbraco.dk>
2023-07-05 14:13:52 +03:00
Zeegaan d86e4b2d38 Bumb version 2023-07-05 10:46:14 +02:00
Sebastiaan Janssen c4c524deb5 Merge branch 'v12/dev' into contrib 2023-07-04 11:14:47 +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
1d239a30ca 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>
2023-07-04 10:37:13 +03:00
5382820e58 Ensure package view path is generated with consideration the current section (#14268)
* check section when determining package template path

* return sectionAlias as packageFolder and the route segment won't always match

* fix test

* adds PluginController attribute to StylesheetsTreeController
fixes actionUrl generation to ensure valid URL
find controller by fullname to avoid incorrect controller selection when multiple exist with same name

* Fix frontend breaking changes

* Adding missing PluginController attribute for ScriptsTreeController

---------

Co-authored-by: Elitsa <elm@umbraco.dk>
2023-07-03 15:17:24 +03:00
Kenn JacobsenandGitHub fad710364c Add additional preview URLs option (#14479) 2023-06-30 08:26:31 +03:00
Nikolaj 4d8409ffdf Merge remote-tracking branch 'origin/release/12.0' into v12/dev
# Conflicts:
#	version.json
2023-06-29 09:21:22 +02:00
Nikolaj Brask-NielsenandGitHub 1d14158d82 fix: Allows copying from unsaved content (#14464)
#14459
2023-06-27 17:18:07 +01:00
Anders BjernerandGitHub a090997aa1 Added missing Danish translation for general_change (#14461)
* Added missing Danish translation for `general_change`

* Update en_us.xml
2023-06-27 15:50:11 +01:00
Nikolaj ba724ed97d Bump version to final 2023-06-27 14:15:13 +02:00
Nikolaj 2ef75c5067 Merge branch 'release/12.0' into v12/dev 2023-06-27 14:13:29 +02:00
Elitsa MarinovskaandGitHub e86fb0eeb6 Adding null check and descriptive error (#14469) 2023-06-27 13:35:01 +02:00
Bjarke Berg 2cbf44dd4c Updated login svg 2023-06-27 11:53:10 +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
Jacob Overgaard 3a790b9f04 Merge branch 'release/12.0' into v12/dev 2023-06-27 10:06:36 +02:00
Jacob Overgaard 941dc933fb package-lock sync 2023-06-27 10:04:23 +02:00
Bjarke Berg 685820c295 Merge remote-tracking branch 'origin/v11/dev' into v12/dev 2023-06-27 09:18:17 +02:00
Bjarke Berg f04b49a96c Merge remote-tracking branch 'origin/release/12.0' into v12/dev 2023-06-27 09:18:08 +02:00
Bjarke Berg c7699f2909 Merge remote-tracking branch 'origin/v10/dev' into v11/dev
# Conflicts:
#	src/Umbraco.Web.UI.Client/package-lock.json
#	version.json
2023-06-27 09:07:40 +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
2973f9fe5a Add OpenIddict tables to database (#14449)
* Added migrations to install EF Core OpenIddict tables

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

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

* Cleanup

* Extract db context setup

* Minor cleanup

---------

Co-authored-by: Nikolaj <nikolajlauridsen@protonmail.ch>
2023-06-26 13:50:57 +02:00
2c9d0b2cb1 Add create and update dates to Delivery API response (#14427)
Co-authored-by: Elitsa <elm@umbraco.dk>
2023-06-26 08:33:16 +03:00
Kenn JacobsenandGitHub e92ea34098 Remove content from public facing Examine indexes when it is made protected (#14415)
* Remove content from Examine indexes when it gets protected

* Remove backwards compat for discoverability

* Fixed build error for tests
2023-06-23 12:00:32 +02:00
Elitsa MarinovskaandGitHub 115e79113e Delivery API: Ensure the path parameter starts with forward slash (#14428)
* Ensure path starts with forward slash in all cases

* Fix path in preview when getting by route

* Reintroduce path.length check

* Revert previous changes
2023-06-23 11:22:13 +02:00
Sebastiaan Janssen 62f692e617 Merge branch 'v12/dev' into contrib 2023-06-22 13:11:50 +02:00
Nikolaj 0f0c256beb Don't leak swagger out of delivery document 2023-06-22 11:38:00 +02:00
Nikolaj 8b1e4fa5c2 Don't leak swagger out of delivery document 2023-06-22 11:37:15 +02:00
Kenn JacobsenandGitHub 1fb8ea0411 Return raw markdown in the Delivery API (#14429)
* Return raw markdown in the Delivery API

* Reflect markdown value converter changes in the unit tests
2023-06-22 10:48:45 +02:00
Nikolaj 75113a90fb Bump version 2023-06-22 09:18:57 +02:00
Anders ReusandGitHub 4b0e971cf5 Obsolete constructor with deprecated IScopeProvider (#14424) 2023-06-21 22:44:39 +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
Bjarke Berg 159dbcc655 Merge remote-tracking branch 'origin/v11/dev' into v12/dev
# Conflicts:
#	version.json
2023-06-21 08:54:10 +02:00
Bjarke Berg 3c81f968c3 post merge clean up 2023-06-21 08:53:18 +02:00
Bjarke Berg 44fde47ad9 Merge remote-tracking branch 'origin/release/11.4.1' into v11/dev 2023-06-21 08:52:40 +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
Bjarke Berg 7ab6598d0b Merge remote-tracking branch 'origin/v10/dev' into v11/dev
# Conflicts:
#	src/Umbraco.Web.UI.Client/package-lock.json
#	src/Umbraco.Web.UI.Client/package.json
2023-06-21 08:41:35 +02:00
Bjarke Berg 6e41a3123d Merge remote-tracking branch 'origin/release/12.0' into v12/dev 2023-06-21 08:37:43 +02:00
Bjarke Berg 7cdf7258f4 Merge remote-tracking branch 'origin/release/12.0' into v12/dev
# Conflicts:
#	version.json
2023-06-21 08:37:15 +02:00
Kenn JacobsenandGitHub 0cdea6120b Add support for property value fallbacks in the delivery API (#14421)
* Add support for property value fallbacks in the delivery API

* Add dedicated tests for the IDeliveryApiPropertyValueConverter interface

* Rewrite for less impact and more streamlined with Razor output
2023-06-21 08:32:57 +02:00
nikolajlauridsen dcd400810c Bump version 2023-06-20 14:47:54 +02:00
miguelcrpintoandEmma L Garland 4d63b3ce30 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-20 13:15:03 +01:00
Sebastiaan Janssen f91fde2462 Fixes #14269 - semaphore released too many times as it always happens in the finally, which is 1 too many times when the upload was a success 2023-06-20 14:02:53 +02:00
Bjarke Berg 197efbb12c Merge remote-tracking branch 'origin/release/12.0' into v12/dev
# Conflicts:
#	src/Umbraco.Infrastructure/Sync/ServerMessengerBase.cs
#	version.json
2023-06-20 13:56:27 +02:00
leekelleherandSebastiaan Janssen c608cc83ba 📓 Updated README
Moved the badges lower down and tweaked for consistency.
2023-06-20 13:36:58 +02:00
dependabot[bot]andJacob Overgaard 9c1f912639 Bump socket.io-parser from 4.2.1 to 4.2.4 in /src/Umbraco.Web.UI.Client
Bumps [socket.io-parser](https://github.com/socketio/socket.io-parser) from 4.2.1 to 4.2.4.
- [Release notes](https://github.com/socketio/socket.io-parser/releases)
- [Changelog](https://github.com/socketio/socket.io-parser/blob/main/CHANGELOG.md)
- [Commits](https://github.com/socketio/socket.io-parser/compare/4.2.1...4.2.4)

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

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

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-20 13:30:09 +02:00
Jacob Overgaard 29f8f0be39 Merge branch 'v11/dev' into release/11.4.1 2023-06-20 13:29:47 +02:00
dependabot[bot]andJacob Overgaard fba1afe7fe Bump socket.io-parser from 4.2.1 to 4.2.4 in /src/Umbraco.Web.UI.Client
Bumps [socket.io-parser](https://github.com/socketio/socket.io-parser) from 4.2.1 to 4.2.4.
- [Release notes](https://github.com/socketio/socket.io-parser/releases)
- [Changelog](https://github.com/socketio/socket.io-parser/blob/main/CHANGELOG.md)
- [Commits](https://github.com/socketio/socket.io-parser/compare/4.2.1...4.2.4)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-20 13:20:50 +02:00
Jacob Overgaard b725153be1 v11: Backoffice JS Updates (#14407)
* update @umbraco-ui/uui to 1.3.0

* update @microsoft/signalr to 7.0.7

* update ace editor to 1.22.1

* update jQuery to 3.7.0

* update nouislider to 15.7.1

* update tinymce to 6.5.1

* update spectrum-colorpicker2 to 2.0.10

* update build dependencies
2023-06-20 13:18:25 +02:00
Bjarke BergandGitHub 54479c9538 Updated nuget packages to latest versions (#14419) 2023-06-20 12:21:16 +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
MoleandGitHub 446544c045 V12: Add deliver api information to detailed telemetry (#14418)
* Add deliver api information to detailed telemetry

* Update translation
2023-06-20 12:03:46 +02:00
Ronald BarendseandGitHub c989c5e214 Support publishing multiple notifications, filter on handler type and add IDistributedCacheNotificationHandler<TNotification> (optimizes cache refreshers) (#14332)
* Clean up DistributedCache and add additional checks

* Add IEnumerable overloads to DistributedCacheExtensions

* Update handlers to use new IEnumerable overloads

* Move DistributedCacheExtensions to Core

* Restructure cache refreshers into folders

* Add IDistributedCacheNotificationHandler

* Rewrite DistributedCacheBinder into seperate IDistributedCacheNotificationHandler implementations

* Obsolete DistributedCacheBinder and use new IDistributedCacheHandler implementations

* Clean up ServerMessengerBase

* Ensure cache refreshers only process distinct values

* Add support for publishing multiple notifications and filter on handler type

* Suppress compatibility issues

* Remove DistributedCacheBinder and suppress compatibility issues

* Add ScopedNotificationPublisher<TNotificationHandler>

* Improve notification type lookup/enumeration

* Ensure INotificationAsyncHandler handles multiple notitications sequentially

* Minimize cache instruction JSON

* Chunk notifications by type to keep publish order

* Only serialize required RefreshInstruction properties
2023-06-20 11:15:47 +02:00
Jacob Overgaard 326eab7d3c v11: Backoffice JS Updates (#14407)
* update @umbraco-ui/uui to 1.3.0

* update @microsoft/signalr to 7.0.7

* update ace editor to 1.22.1

* update jQuery to 3.7.0

* update nouislider to 15.7.1

* update tinymce to 6.5.1

* update spectrum-colorpicker2 to 2.0.10

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

* update @microsoft/signalr to 7.0.7

* update ace editor to 1.22.1

* update jQuery to 3.7.0

* update nouislider to 15.7.1

* update tinymce to 6.5.1

* update spectrum-colorpicker2 to 2.0.10

* update build dependencies
2023-06-20 11:00:31 +02:00
nikolajlauridsen 06492d9daf Set version 2023-06-20 10:01:59 +02:00
christophnzandBusra Sengul 77a2e4b557 Fixed typo "optinal" to "optional" for translation dictionary import dialog and 2 other occurrences 2023-06-20 10:38:50 +03:00
Jacob OvergaardandGitHub bcabc678a7 v11: Backoffice JS Updates (#14407)
* update @umbraco-ui/uui to 1.3.0

* update @microsoft/signalr to 7.0.7

* update ace editor to 1.22.1

* update jQuery to 3.7.0

* update nouislider to 15.7.1

* update tinymce to 6.5.1

* update spectrum-colorpicker2 to 2.0.10

* update build dependencies
2023-06-20 09:24:42 +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
4fb605c086 Delivery API: Add query params and headers to Swagger document (#14370)
* Adding query params documentation

* Adding headers

* Rename file

* Added a few more descriptions and changed a few as well

---------

Co-authored-by: kjac <kja@umbraco.dk>
2023-06-19 14:24:45 +02:00
Bjarne FyrstenborgandJacob Overgaard 78c8328501 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
2023-06-19 13:51:42 +02:00
Bjarne FyrstenborgandJacob Overgaard d42ef7b340 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
2023-06-19 13:50:15 +02:00
Bjarne FyrstenborgandJacob Overgaard 529d056c0c 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
2023-06-19 13:49:50 +02:00
Bjarne FyrstenborgandGitHub 583965cf9d 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
2023-06-19 13:48:03 +02:00
Bjarne FyrstenborgandNikolaj 9a3e655645 Fix transparent background after upgrade of spectrum color picker (#14251) 2023-06-19 08:50:57 +02:00
Mads Mørch SchouandGitHub 0a4a938b88 Makes sure the nucache is not truncated when its null (#14395)
* Makes sure the nucache is not truncated when its null
* Removed parentheses
2023-06-16 18:22:39 +01:00
Jason ElkinandGitHub 118f914158 Add ContentDeletingNotification to EmptyRecycleBin (#14397)
* Add ContentDeletingNotification to EmptyRecycleBin

* Fix formatting.
2023-06-16 16:45:49 +03:00
1ba834a9ca 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>
2023-06-16 14:40:19 +02:00
542d0f7f74 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>
2023-06-16 12:11:23 +01:00
Jan SkovgaardandGitHub a823055c9d Change nonodes image (#14392) 2023-06-16 13:44:05 +03:00
Bjarne FyrstenborgandMichael Latouche 575f00d6f0 Update label in Danish translation 2023-06-16 11:33:34 +02:00
alevak09andGitHub 9f4d3e5525 Add Croatian Language (#14379)
Croatian language translation of Umbraco backoffice and culture settings
2023-06-16 09:49:22 +01:00
Paul SealandMichael Latouche 5073a26e7f Update the tour text to the correct text and to save confusion 2023-06-16 10:46:06 +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
9a5e1c437e V12/feature/enable trust server certificate from installer (#14361)
* Enable checkbox with Trust server certificate in installer

* Fix up behavioral change

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-06-12 10:58:40 +02:00
10631decb1 Update security stamps on logout (#14362)
Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-06-12 10:07:44 +02:00
Bjarke Berg 1033806c49 Merge remote-tracking branch 'origin/v11/dev' into v12/dev 2023-06-12 10:05:49 +02:00
Bjarke Berg f24ff4918e Merge remote-tracking branch 'origin/v10/dev' into v11/dev 2023-06-12 10:03:26 +02:00
89d670372d Update security stamps on logout (#14362)
Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-06-12 09:56:04 +02:00
Kenn JacobsenandGitHub cbf42bd91a Make the API versioning and Swagger config less intrusive (#14363) 2023-06-12 09:31:39 +02:00
Kenn JacobsenandGitHub 6b280bd165 Make the Delivery API JSON type info resolver un-sealed (#14368) 2023-06-12 07:58:35 +02:00
MoleandGitHub 45fd5d218b Use ComputeHMACAsync instead of ComputeHMAC in URL generator (#14364) 2023-06-09 09:20:07 +02:00
8b7094c8cf V12: use database when testing examine (#14360)
* Use databases for examine tests

* Use same schema for entire fixture

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-06-08 12:05:10 +02:00
d9dced55c4 Disable sortable if readonly or max is limited to one item (#14252)
* Disable sortable if readonly or max is set limited to one item

* Disable sortable on single URL picker

* Don't disable block list sorting based on validation limit, but do for single block mode

* Disable sorting in media picker 3 in single mode

* Remove extra whitespace

* Disable draggable

* Tweaked wording of "item(s)"

---------

Co-authored-by: Sebastiaan Janssen <sebastiaan@umbraco.com>
Co-authored-by: Emma Garland <emma.garland@rocksolidknowledge.com>
2023-06-08 10:31:16 +01:00
4aa1597138 Fix for escaping markdown characters in property descriptions (#12345)
* Added secure to the UMB-XSRF-V cookie when global https is true.

* tweaked markdown handling

* added in link handling tweak for simpleMarkdown filter

* tweaked simple markdown filter to modify all links instead of just the first one

* moved transformation of markdown content in description into C# code

* Format of white space

* Reverted unecessary change.

* Removed unwanted framework version lines

* Reduce nesting of if statements.

* Changed to .Contains for readability.

---------

Co-authored-by: Corey Philipp <CPhilipp@dewpoint.com>
Co-authored-by: jaandrews <jaandrews88@gmail.com>
Co-authored-by: Emma Garland <emma.garland@rocksolidknowledge.com>
2023-06-08 10:11:18 +01:00
Kenn JacobsenandGitHub ddade09b14 Fix broken name sorting in the Delivery API (#14350) 2023-06-08 10:59:29 +02:00
Sebastiaan Janssen 8447350915 Merge branch 'v12/dev' into contrib 2023-06-08 10:24:39 +02:00
Bjarke Berg c9bb48aabf Merge remote-tracking branch 'origin/v11/dev' into v12/dev 2023-06-08 10:10:45 +02:00
Bjarke Berg 96dc594269 Merge remote-tracking branch 'origin/v11/dev' into release/12.0
# Conflicts:
#	tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/IndexTest.cs
#	version.json
2023-06-08 08:37:30 +02:00
Bjarke Berg 8ae0c82e85 Merge remote-tracking branch 'origin/v10/dev' into v11/dev 2023-06-08 08:36:15 +02:00
Lili RossiterandSebastiaan Janssen b60ddf484f fix for focus state of checkbox 2023-06-07 14:01:13 +02:00
ChadandGitHub e784cfa960 Improve logging performance by checking Trace/Debug log level is enabled (#12793) 2023-06-07 11:47:05 +02:00
Mole b5ab115318 Remove external login tokens before removing external logins (#14341) 2023-06-06 14:11:20 +02:00
nikolajlauridsen 599bfea496 Bump version 2023-06-06 13:52:53 +02:00
nikolajlauridsen 537e078d43 Merge branch 'release/12.0' into v12/dev 2023-06-06 13:52:17 +02:00
nikolajlauridsen a6bb637fab Add scopes to tests 2023-06-06 12:24:29 +02:00
MoleandGitHub 4744d711ed Use scopes in PackaginService (#14343) 2023-06-06 12:00:53 +02:00
Mole 2dd7d610da Update OpenIdDict (#14340) 2023-06-06 10:15:53 +02:00
MoleandGitHub cd3f06349b Update OpenIdDict (#14340) 2023-06-06 10:15:31 +02:00
MoleandGitHub b391fc50e9 Remove external login tokens before removing external logins (#14341) 2023-06-06 09:29:03 +02:00
809883f088 Support entirely unpublished content in preview mode (#14307)
* Support draft-only content in the Delivery API query

* Allow outputting "entirely unpublished" content

* Make the preview path explicit to avoid clashing endpoints

* Handle trailing slash setting for preview URLs

* Update src/Umbraco.Infrastructure/Examine/DeliveryApiContentIndexValueSetBuilder.cs

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

* Remove superfluous (and incorrect) unpublished route handling

* Make sure preview output includes routes for unpublished cultures

* Ensure that published content with unpublished ancestors are available in preview

* Fix route start item when previewing published content with unpublished parent

---------

Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com>
2023-06-05 12:00:25 +02:00
Nikolaj Geisle c65f22a1d6 Use hosting environment to get local temp path (#14335) 2023-06-05 10:57:39 +02:00
Nikolaj GeisleandGitHub 6073662140 Use hosting environment to get local temp path (#14335) 2023-06-05 10:56:56 +02:00
Arkadiusz BielandGitHub 9bafdbd992 Add notification flag to indicate the current publish operation includes descendants (#13145) 2023-05-31 17:33:23 +02:00
Bjarne FyrstenborgandGitHub 676efb9f89 Show summary of Examine search results (#14300) 2023-05-31 17:25:24 +02:00
Callum WhyteandGitHub e6903bffcd Convert collections for XPath in PropertyValueConverterBase (#14275) 2023-05-31 16:58:42 +02:00
Miguel PintoandGitHub 76cb85224e Swapped the sortCreateDateAscending and sortCreateDateDescending translation values to match the intended behavior (#14315) 2023-05-31 16:39:37 +02:00
AhmetandGitHub cf6a7a3bc0 Fix #14270 - ImageCropperValue.GetCropUrl(alias, imageUrlGenerator) always returns null (#14308) 2023-05-31 13:47:09 +02:00
RussellandGitHub dd59ef17f5 Fix for User null from IP address "::1" has logged out (#14322) 2023-05-31 12:46:02 +02:00
RussellandGitHub 0220621337 Change "Media Picker" in RTE to "Image Picker" (#14321) 2023-05-31 12:45:02 +02:00
184cf9f26d Fix URL encoded paths for the item endpoint (#14311)
* Fix URL encoded paths for the item endpoint

* Sanity check accept-language headers before accepting them

---------

Co-authored-by: Elitsa <elm@umbraco.dk>
2023-05-31 12:14:26 +02:00
Ronald BarendseandGitHub 41e51d6e71 Add PackageId to package manifest and PackageMigrationPlan (#14047)
* Add VersionAssemblyName to package manifest

* Fix/improve nullability

* Ensure package version from manifest is set when package migration exists

* Set versionAssemblyName in umbracopackage template

* Use Assembly.Load instead of ITypeFinder

* Use AssemblyLoadContext to get asesmbly by name

* Add PackageId to package manifest

* Show ID on installed packages overview

* Fallback to package ID to get assembly version

* Include package ID in telemetry data

* Set id in umbracopackage template

* Add PackageId to PackageMigrationPlan

* Get version from package migration assembly

* Hide unknown package version

* Always use package name from manifest

* Use IPackagingService to return package telemety data

* Set versionAssemblyName in umbracopackage-rcl template

* Set id in umbracopackage-rcl template
2023-05-31 11:31:37 +02:00
Bjarke Berg 82746518d4 Merge remote-tracking branch 'origin/v11/dev' into v12/dev
# Conflicts:
#	tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/IndexTest.cs
#	version.json
2023-05-31 09:11:24 +02:00
Bjarke Berg 2407d42de6 Merge remote-tracking branch 'origin/v10/dev' into v11/dev
# Conflicts:
#	src/Umbraco.Core/Constants-Telemetry.cs
#	tests/Umbraco.Tests.Integration/Umbraco.Core/Telemetry/TelemetryServiceTests.cs
2023-05-31 08:48:28 +02:00
Kenn JacobsenandGitHub 3b433e6658 Expose "expanding" state in API value conversion (#14312)
* Expose "expanding" state in API value conversion

* Add unit test

* Add non-breaking and obsoletion

* Add compat suppressions
2023-05-31 08:46:30 +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
Ronald BarendseandGitHub 84a0cd8c09 Add VersionAssemblyName to package manifest (#14046)
* Add VersionAssemblyName to package manifest

* Fix/improve nullability

* Ensure package version from manifest is set when package migration exists

* Set versionAssemblyName in umbracopackage template

* Use Assembly.Load instead of ITypeFinder

* Use AssemblyLoadContext to get asesmbly by name

* Get version from package migration assembly

* Hide unknown package version

* Set versionAssemblyName in umbracopackage-rcl template
2023-05-30 15:47:36 +02:00
michiel-sjandGitHub 0f18b50126 Adding logging and make sure PostAddFile always releases the file semaphore (#14269) 2023-05-26 13:51:29 +02:00
fcf477191f Delivery API: Adding support for "Contains" filters (#14289)
* Adding support for contains filters

* Making a dedicated name filter and making changes to the sort indexer

* Fixed the merge from release/12.0

* Make the "name" filter support OR for comma separated filter values

---------

Co-authored-by: kjac <kja@umbraco.dk>
2023-05-25 13:43:45 +02:00
Nikolaj 9ed54eb158 Fix version 2023-05-25 13:03:13 +02:00
Nikolaj c6d94b3fd4 Merge remote-tracking branch 'origin/release/11.4' into v11/dev 2023-05-25 12:59:24 +02:00
dependabot[bot]andJacob Overgaard fccbed125c Bump engine.io and socket.io in /src/Umbraco.Web.UI.Client
Bumps [engine.io](https://github.com/socketio/engine.io) and [socket.io](https://github.com/socketio/socket.io). These dependencies needed to be updated together.

Updates `engine.io` from 6.2.1 to 6.4.2
- [Release notes](https://github.com/socketio/engine.io/releases)
- [Changelog](https://github.com/socketio/engine.io/blob/main/CHANGELOG.md)
- [Commits](https://github.com/socketio/engine.io/compare/6.2.1...6.4.2)

Updates `socket.io` from 4.5.3 to 4.6.1
- [Release notes](https://github.com/socketio/socket.io/releases)
- [Changelog](https://github.com/socketio/socket.io/blob/main/CHANGELOG.md)
- [Commits](https://github.com/socketio/socket.io/compare/4.5.3...4.6.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-25 11:33:19 +02:00
Bjarke Berg efb9452678 Merge remote-tracking branch 'origin/release/12.0' into v12/dev
# Conflicts:
#	src/Umbraco.Cms.Api.Delivery/Services/ApiContentQueryProvider.cs
#	src/Umbraco.Cms.Api.Delivery/Services/ApiContentQueryService.cs
#	src/Umbraco.Core/DeliveryApi/IApiContentQueryProvider.cs
2023-05-25 11:29:10 +02:00
dependabot[bot]andJacob Overgaard 715dfa7ee0 Bump qs from 6.10.1 to 6.11.0 in /src/Umbraco.Web.UI.Docs
Bumps [qs](https://github.com/ljharb/qs) from 6.10.1 to 6.11.0.
- [Release notes](https://github.com/ljharb/qs/releases)
- [Changelog](https://github.com/ljharb/qs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ljharb/qs/compare/v6.10.1...v6.11.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-25 11:28:48 +02:00
Kenn JacobsenandGitHub 53e0227c98 Fix the namespace for PagedModel (#14296)
* Fix the namespace for PagedModel

* Add compat suppressions
2023-05-25 11:27:37 +02:00
dependabot[bot]andJacob Overgaard 010a1b53f6 Bump decode-uri-component in /src/Umbraco.Web.UI.Docs
Bumps [decode-uri-component](https://github.com/SamVerschueren/decode-uri-component) from 0.2.0 to 0.2.2.
- [Release notes](https://github.com/SamVerschueren/decode-uri-component/releases)
- [Commits](https://github.com/SamVerschueren/decode-uri-component/compare/v0.2.0...v0.2.2)

---
updated-dependencies:
- dependency-name: decode-uri-component
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-25 11:27:16 +02:00
dependabot[bot]andJacob Overgaard 426ade5c70 Bump minimist from 0.2.1 to 0.2.4 in /src/Umbraco.Web.UI.Docs
Bumps [minimist](https://github.com/minimistjs/minimist) from 0.2.1 to 0.2.4.
- [Release notes](https://github.com/minimistjs/minimist/releases)
- [Changelog](https://github.com/minimistjs/minimist/blob/main/CHANGELOG.md)
- [Commits](https://github.com/minimistjs/minimist/compare/v0.2.1...v0.2.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-25 11:26:55 +02:00
dependabot[bot]andJacob Overgaard 7a530f9c07 Bump socket.io-parser from 4.2.1 to 4.2.3 in /src/Umbraco.Web.UI.Client
Bumps [socket.io-parser](https://github.com/socketio/socket.io-parser) from 4.2.1 to 4.2.3.
- [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.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-25 11:24:33 +02:00
Jacob OvergaardandBjarke Berg 7f798bcc91 v12: add support for Node.js 18 (#14259)
* add .nvmrc to instruct NVM of preferred version

* update azure-pipelines.yml with node 18.16

* update "engines" section of package.json with preferred node.js 18.16

* update lockfiles in accordance with node 18 (lockfileVersion: 3)
2023-05-25 11:19:03 +02:00
Jacob OvergaardandGitHub 6791a99872 v12: add support for Node.js 18 (#14259)
* add .nvmrc to instruct NVM of preferred version

* update azure-pipelines.yml with node 18.16

* update "engines" section of package.json with preferred node.js 18.16

* update lockfiles in accordance with node 18 (lockfileVersion: 3)
2023-05-25 11:18:29 +02:00
Nikolaj e52e98741e Fix integration tests 2023-05-25 08:54:38 +02:00
6bcec26db3 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:40:10 +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
Kenn JacobsenandGitHub 5ae984aca6 Empty filter and sort values should not be considered when executing queries (#14295) 2023-05-24 13:22:27 +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
Kenn Jacobsenandnikolajlauridsen 6a725f870a Ensure that blocks always open automatically when added to block list or block grid (#14294) 2023-05-24 10:23:05 +02:00
Kenn JacobsenandGitHub 315f08c55d Ensure that blocks always open automatically when added to block list or block grid (#14294) 2023-05-24 10:22:31 +02:00
Andy ButlandandGitHub e0d9084d04 Updated the installer text about Codegarden (#14276)
* Updated the installer text about Codegarden

* Further update to Codegarden installer message

* Removed whitespace
2023-05-24 09:59:31 +02:00
nikolajlauridsen 3fa49c7a55 Bump version to non-rc 2023-05-24 08:09:25 +02:00
3cadd35d40 Start-item support in RTE markup (#14283)
* Append start item to RTE markup

* Split the Examine specifics from API query service (#14257)

* Split the Examine specifics from API query service to a provider based model

* Review changes: Use paged model as provider return value + add logging

* Fix version

* Revert incidentally changed version number by targeting wrong branch

* Fix wrongly changed version number --- it's RC2 now

---------

Co-authored-by: Nikolaj <nikolajlauridsen@protonmail.ch>
2023-05-24 08:02:42 +02:00
Matt BrailsfordandGitHub afddb3d781 Enforce passing tree alias to tree api requests (#12678)
* Enforce passing tree alias to tree api proxy

* Update ApplicationTreeController.cs
2023-05-23 16:30:21 +01:00
Sebastiaan Janssen df8f13d6b8 Merge branch 'v12/dev' into contrib 2023-05-23 13:22:04 +02:00
Bjarke Berg c878567633 Merge remote-tracking branch 'origin/v11/dev' into v12/dev 2023-05-23 12:17:40 +02:00
Bjarke Berg 86f867479b Merge branch 'release/12.0' into v12/dev
# Conflicts:
#	version.json
2023-05-23 12:16:32 +02:00
Bjarke Berg 7e1620cbc3 Merge remote-tracking branch 'origin/v10/dev' into v11/dev 2023-05-23 12:15:39 +02:00
Andy ButlandandGitHub e79246368b Update JSON schema package references for Forms and Deploy. (#14285) 2023-05-23 09:38:01 +02:00
Nikolaj 7776cded73 Bump version to next RC 2023-05-22 15:19:13 +02:00
Nikolaj 54af079d97 Fix version 2023-05-22 15:18:14 +02:00
Nikolaj dee01e950c Merge branch 'release/12.0' into v12/dev 2023-05-22 15:17:25 +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
Kenn JacobsenandGitHub 8bbca79e55 Split the Examine specifics from API query service (#14257)
* Split the Examine specifics from API query service to a provider based model

* Review changes: Use paged model as provider return value + add logging
2023-05-22 11:06:22 +02:00
Dhanesh Kumar MjandSebastiaan Janssen 7d3c22b28a [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:27:01 +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
58695b6e9f [Fix] Block editor labels showing Angular JS on first load. (#14143)
Co-authored-by: Dhanesh Kumar <“dhanesh.kumar@phases.io”>
2023-05-19 11:21:40 +02:00
Sebastiaan Janssen bd7de1c89b Merge branch 'v12/dev' into contrib 2023-05-19 10:47:27 +02:00
Mykyta ZakharovandGitHub 4b62cb59b7 Issue-12704: added new necessary indexes. 2023-05-18 12:28:00 +01:00
Marc GoodsonandGitHub 9640616b56 Update ContentValueSetValidator to allow include/exclude of fields (#14177) 2023-05-17 10:19:18 +02:00
Vitor RodriguesandEmma L Garland 6fcdb1a6e4 Fix build required before initial publish for packages 2023-05-16 21:33:20 +01:00
Bjarne FyrstenborgandGitHub 53e3c99af6 Fix transparent background after upgrade of spectrum color picker (#14251) 2023-05-16 15:32:32 +01:00
Warren BuckleyandJason Elkin 8c42f19d0d Fix the args used in log endMessages in the profillingLogger 2023-05-16 12:07:05 +01:00
Lucas Bach BisgaardandGitHub 9f028e0bd5 Add posibillty to use composition on memberstype (#14060) 2023-05-15 15:51:14 +02:00
Sebastiaan Janssen f7bdba6279 Merge branch 'v12/dev' into contrib 2023-05-15 10:48:51 +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
5377c17b5d 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:42:58 +02:00
Kenn JacobsenandGitHub eb08a48c3a Fix "save and close"/"publish and close" for infinite editing of language variant content (#12577) 2023-05-12 00:11:51 +01:00
Niels LyngsøandGitHub 7d512bea39 enable hovering your way to a parent actions + remove unused part (#13692) 2023-05-11 16:25:35 +01:00
martinaronnysdotterandGitHub 921ee4bc62 Sv translation (#14229)
* Adding swedish translations

* Adding swedish translations
2023-05-11 08:52:46 +01:00
Sebastiaan Janssen db50b11a67 Merge branch 'v12/dev' into contrib 2023-05-10 13:13:45 +02:00
NuklonandGitHub dfde6798d9 Fixes #14102 - NestedPropertyIndexValueFactoryBase ignores compositions (#14115) 2023-05-09 09:04:01 +02:00
Jacob OvergaardandGitHub f3668e0aab Fix: Form elements in thirdparty dashboard views get removed (#14152) 2023-05-03 10:37:57 +02:00
1945 changed files with 83227 additions and 32597 deletions
+2 -2
View File
@@ -1,3 +1,3 @@
**/*
!**/bin/**
!**/obj/**
!tests/Umbraco.Tests.Integration/bin/**
!tests/Umbraco.Tests.UnitTests/bin/**
+9 -5
View File
@@ -40,18 +40,22 @@ You can also run the tasks manually on the command line:
```
cd src\Umbraco.Web.UI.Client
npm install
npm i
npm run dev
```
or
If you just want to build the UI Client to `Umbraco.Web.UI` then instead of running `dev`, you can do: `npm run build`.
The login screen is a different frontend build, for that one you can run it as follows:
```
cd src\Umbraco.Web.UI.Client
npm install
gulp dev
cd src\Umbraco.Web.UI.Login
npm i
npm run dev
```
If you just want to build the Login screen to `Umbraco.Web.UI` then instead of running `dev`, you can do: `npm run build`.
**The initial Gulp build might take a long time - don't worry, this will be faster on subsequent runs.**
You might run into [Gulp quirks](#gulp-quirks).
+23 -215
View File
@@ -4,248 +4,56 @@
These contribution guidelines are mostly just that - guidelines, not rules. This is what we've found to work best over the years, but if you choose to ignore them, we still love you! 💖 Use your best judgement, and feel free to propose changes to this document in a pull request.
## Coding not your thing? Or want more ways to contribute?
## Getting Started
We have a guide on [what to consider before you start](contributing-before-you-start.md) and more detailed guides at the end of this article.
This document covers contributing to the codebase of the CMS but [the community site has plenty of inspiration for other ways to get involved.][get involved]
If you don't feel you'd like to make code changes here, you can visit our [documentation repository][docs repo] and use your experience to contribute to making the docs we have, even better.
We also encourage community members to feel free to comment on others' pull requests and issues - the expertise we have is not limited to the Core Collaborators and HQ. So, if you see something on the issue tracker or pull requests you feel you can add to, please don't be shy.
## Table of contents
- [Before you start](#before-you-start)
* [Code of Conduct](#code-of-conduct)
* [What can I contribute?](#what-can-i-contribute)
+ [Making larger changes](#making-larger-changes)
+ [Pull request or package?](#pull-request-or-package)
+ [Ownership and copyright](#ownership-and-copyright)
- [Finding your first issue: Up for grabs](#finding-your-first-issue-up-for-grabs)
- [Making your changes](#making-your-changes)
+ [Keeping your Umbraco fork in sync with the main repository](#keeping-your-umbraco-fork-in-sync-with-the-main-repository)
+ [Style guide](#style-guide)
+ [Questions?](#questions)
- [Creating a pull request](#creating-a-pull-request)
- [The review process](#the-review-process)
* [Dealing with requested changes](#dealing-with-requested-changes)
+ [No longer available?](#no-longer-available)
* [The Core Collaborators team](#the-core-collaborators-team)
## Before you start
### Code of Conduct
This project and everyone participating in it, is governed by the [our Code of Conduct][code of conduct].
### What can I contribute?
We categorise pull requests (PRs) into two categories:
| PR type | Definition |
| --------- | ------------------------------------------------------------ |
| Small PRs | Bug fixes and small improvements - can be recognized by seeing a small number of changes and possibly a small number of new files. |
| Large PRs | New features and large refactorings - can be recognized by seeing a large number of changes, plenty of new files, updates to package manager files (NuGets packages.config, NPMs packages.json, etc.). |
Were usually able to handle small PRs pretty quickly. A community volunteer will do the initial review and flag it for Umbraco HQ as “community tested”. If everything looks good, it will be merged pretty quickly [as per the described process][review process].
We would love to follow the same process for larger PRs but this is not always possible due to time limitations and priorities that need to be aligned. We dont want to put up any barriers, but this document should set the correct expectations.
Not all changes are wanted, so on occasion we might close a PR without merging it but if we do, we will give you feedback why we can't accept your changes. **So make sure to [talk to us before making large changes][making larger changes]**, so we can ensure that you don't put all your hard work into something we would not be able to merge.
#### Making larger changes
[making larger changes]: #making-larger-changes
Please make sure to describe your larger ideas in an [issue (bugs)][issues] or [discussion (new features)][discussions], it helps to put in mock up screenshots or videos. If the change makes sense for HQ to include in Umbraco CMS we will leave you some feedback on how wed like to see it being implemented.
If a larger pull request is encouraged by Umbraco HQ, the process will be similar to what is described in the small PRs process above, we strive to feedback within 14 days. Finalizing and merging the PR might take longer though as it will likely need to be picked up by the development team to make sure everything is in order. Well keep you posted on the progress.
#### Pull request or package?
[pr or package]: #pull-request-or-package
If you're unsure about whether your changes belong in the core Umbraco CMS or if you should turn your idea into a package instead, make sure to [talk to us][making larger changes].
If it doesnt fit in CMS right now, we will likely encourage you to make it into a package instead. A package is a great way to check out popularity of a feature, learn how people use it, validate good usability and fix bugs. Eventually, a package could "graduate" to be included in the CMS.
#### Ownership and copyright
It is your responsibility to make sure that you're allowed to share the code you're providing us. For example, you should have permission from your employer or customer to share code.
Similarly, if your contribution is copied or adapted from somewhere else, make sure that the license allows you to reuse that for a contribution to Umbraco-CMS.
If you're not sure, leave a note on your contribution and we will be happy to guide you.
When your contribution has been accepted, it will be [MIT licensed][MIT license] from that time onwards.
## Finding your first issue: Up for grabs
Umbraco HQ will regularly mark newly created issues on the issue tracker with [the `community/up-for-grabs` tag][up for grabs issues]. This means that the proposed changes are wanted in Umbraco but the HQ does not have the time to make them at this time. We encourage anyone to pick them up and help out.
If you do start working on something, make sure to leave a small comment on the issue saying something like: "I'm working on this". That way other people stumbling upon the issue know they don't need to pick it up, someone already has.
## Making your changes
Great question! The short version goes like this:
The following steps are a quick-start guide:
1. **Fork**
Create a fork of [`Umbraco-CMS` on GitHub][Umbraco CMS repo]
Create a fork of [`Umbraco-CMS` on GitHub](https://github.com/umbraco/Umbraco-CMS)
![Fork the repository](img/forkrepository.png)
1. **Clone**
2. **Clone**
When GitHub has created your fork, you can clone it in your favorite Git tool
When GitHub has created your fork, you can clone it in your favorite Git tool or on the command line with `git clone https://github.com/[YourUsername]/Umbraco-CMS`.
![Clone the fork](img/clonefork.png)
1. **Switch to the correct branch**
3. **Switch to the correct branch**
Switch to the `contrib` branch
1. **Build**
4. **Build**
Build your fork of Umbraco locally as described in the build documentation: you can [debug with Visual Studio Code][build - debugging with code] or [with Visual Studio][build - debugging with vs].
Build your fork of Umbraco locally [as described in the build documentation](BUILD.md), you can build with any IDE that supports dotnet or the command line.
1. **Branch**
5. **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 `contrib`, create a new branch first.
1. **Change**
6. **Change**
Make your changes, experiment, have fun, explore and learn, and don't be afraid. We welcome all contributions and will [happily give feedback][questions].
Make your changes, experiment, have fun, explore and learn, and don't be afraid. We welcome all contributions and will [happily give feedback](contributing-first-issue.md#questions).
1. **Commit and push**
7. **Commit and push**
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.
#### Keeping your Umbraco fork in sync with the main repository
[sync fork]: #keeping-your-umbraco-fork-in-sync-with-the-main-repository
8. **Create pull request**
Once you've already got a fork and cloned your fork locally, you can skip steps 1 and 2 going forward. Just remember to keep your fork up to date before making further changes.
On GitHub, in your forked repository (`https://github.com/[YourUsername]/Umbraco-CMS`) you will see a banner saying that you pushed a new branch and a button to make a pull request. Tap the button and follow the instuctions.
To sync your fork with this original one, you'll have to add the upstream url. You only have to do this once:
Want to read further? [Creating a pull request and what happens next](contributing-creating-a-pr.md).
```
git remote add upstream https://github.com/umbraco/Umbraco-CMS.git
```
## Further contribution guides
Then when you want to get the changes from the main repository:
- [Before you start](contributing-before-you-start.md)
- [Finding your first issue: Up for grabs](contributing-before-you-start.md)
- [Contributing to the new backoffice](https://docs.umbraco.com/umbraco-backoffice/)
- [Unwanted changes](contributing-unwanted-changes.md)
- [Other ways to contribute](contributing-other-ways-to-contribute.md)
```
git fetch upstream
git rebase upstream/contrib
```
In this command we're syncing with the `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]
#### Style guide
To be honest, we don't like rules very much. We trust you have the best of intentions and we encourage you to create working code. If it doesn't look perfect then we'll happily help clean it up.
That said, the Umbraco development team likes to follow the hints that ReSharper gives us (no problem if you don't have this installed) and we've added a `.editorconfig` file so that Visual Studio knows what to do with whitespace, line endings, etc.
#### Questions?
[questions]: #questions
You can get in touch with [the core contributors team][core collabs] in multiple ways; we love open conversations and we are a friendly bunch. No question you have is stupid. Any question you have usually helps out multiple people with the same question. Ask away:
- If there's an existing issue on the issue tracker then that's a good place to leave questions and discuss how to start or move forward.
- If you want to ask questions on some code you've already written you can create a draft pull request, [detailed in a GitHub blog post][draft prs].
- Unsure where to start? Did something not work as expected? Try leaving a note in the ["Contributing to Umbraco"][contrib forum] forum. The team monitors that one closely, so one of us will be on hand and ready to point you in the right direction.
## Creating a pull request
Exciting! You're ready to show us your changes.
We recommend you to [sync with our repository][sync fork] before you submit your pull request. That way, you can fix any potential merge conflicts and make our lives a little bit easier.
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.
Please note: we are no longer accepting features for v8 and below but will continue to merge security fixes as and when they arise.
## The review process
[review process]: #the-review-process
You've sent us your first contribution - congratulations! Now what?
The [Core Collaborators team][Core collabs] can now start reviewing your proposed changes and give you feedback on them. If it's not perfect, we'll either fix up what we need or we can request that you make some additional changes.
You will get an initial automated reply from our [Friendly Umbraco Robot, Umbrabot][Umbrabot], to acknowledge that weve seen your PR and well pick it up as soon as we can. You can take this opportunity to double check everything is in order based off the handy checklist Umbrabot provides.
You will get feedback as soon as the [Core Collaborators team][Core collabs] can after opening the PR. Youll most likely get feedback within a couple of weeks. Then there are a few possible outcomes:
- Your proposed change is awesome! We merge it in and it will be included in the next minor release of Umbraco
- If the change is a high priority bug fix, we will cherry-pick it into the next patch release as well so that we can release it as soon as possible
- Your proposed change is awesome but needs a bit more work, well give you feedback on the changes wed like to see
- Your proposed change is awesome but... not something were looking to include at this point. Well close your PR and the related issue (well be nice about it!). See [making larger changes][making larger changes] and [pull request or package?][pr or package]
### Dealing with requested changes
If you make the corrections we ask for in the same branch and push them to your fork again, the pull request automatically updates with the additional commit(s) so we can review it again. If all is well, we'll merge the code and your commits are forever part of Umbraco!
#### No longer available?
We understand you have other things to do and can't just drop everything to help us out.
So if were asking for your help to improve the PR well wait for two weeks to give you a fair chance to make changes. Well ask for an update if we dont hear back from you after that time.
If we dont hear back from you for 4 weeks, well close the PR so that it doesnt just hang around forever. Youre very welcome to re-open it once you have some more time to spend on it.
There will be times that we really like your proposed changes and well finish the final improvements wed like to see ourselves. You still get the credits and your commits will live on in the git repository.
### The Core Collaborators team
[Core collabs]: #the-core-collaborators-team
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]
- [Michael Latouche][Michael Latouche]
- [Sebastiaan][Sebastiaan]
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.
<!-- Reference links for easy updating -->
<!-- Local -->
[MIT license]: ../LICENSE.md "Umbraco's license declaration"
[build - debugging with vs]: BUILD.md#debugging-with-visual-studio "Details on building and debugging Umbraco with Visual Studio"
[build - debugging with code]: BUILD.md#debugging-with-vs-code "Details on building and debugging Umbraco with Visual Studio Code"
<!-- 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"
[Michael Latouche]: https://github.com/mikecp "Michael's GitHub profile"
[Sebastiaan]: https://github.com/nul800sebastiaan "Sebastiaan'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"
[draft prs]: https://github.blog/2019-02-14-introducing-draft-pull-requests/ "Github's blog post providing details on draft pull requests"
[contrib forum]: https://our.umbraco.com/forum/contributing-to-umbraco-cms/
[get involved]: https://community.umbraco.com/get-involved/
[docs repo]: https://github.com/umbraco/UmbracoDocs
[code of conduct]: https://github.com/umbraco/.github/blob/main/.github/CODE_OF_CONDUCT.md
[up for grabs issues]: https://github.com/umbraco/Umbraco-CMS/issues?q=is%3Aissue+is%3Aopen+label%3Acommunity%2Fup-for-grabs
[Umbraco CMS repo]: https://github.com/umbraco/Umbraco-CMS
[issues]: https://github.com/umbraco/Umbraco-CMS/issues
[discussions]: https://github.com/umbraco/Umbraco-CMS/discussions
+9 -1
View File
@@ -1,4 +1,12 @@
# [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)
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](../LICENSE.md)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md)
[![Follow Umbraco on Twitter](https://img.shields.io/badge/Follow-blue?logo=twitter&logoColor=fff)](https://twitter.com/intent/follow?screen_name=umbraco)
[![Chat about Umbraco on Discord](https://img.shields.io/discord/869656431308189746?logo=discord&logoColor=fff)](https://discord.gg/umbraco)
[![Read what's going on in the Umbraco Discord chat now](https://img.shields.io/badge/read-discord-blue)](https://discord-chats.umbraco.com)
[![Build status](https://img.shields.io/azure-devops/build/umbraco/Umbraco%2520Cms/301?logo=azurepipelines&label=Azure%20Pipelines)](https://umbraco.visualstudio.com/Umbraco%20Cms/_build?definitionId=301)
[![Open in GitHub Codespaces](https://img.shields.io/badge/Open%20in%20GitHub%20Codespaces-525252?logo=github)](https://github.com/codespaces/new?hide_repo_select=true&ref=contrib&repo=10601208&machine=basicLinux32gb&devcontainer_path=.devcontainer%2Fdevcontainer.json&location=WestEurope)
Umbraco is the friendliest, most flexible and fastest growing ASP.NET CMS, and used by more than 500,000 websites worldwide. Our mission is to help you deliver delightful digital experiences by making Umbraco friendly, simpler and social.
+54
View File
@@ -0,0 +1,54 @@
## Before you start
### Code of Conduct
This project and everyone participating in it, is governed by the [our Code of Conduct][code of conduct].
### What can I contribute?
We categorise pull requests (PRs) into two categories:
| PR type | Definition |
| --------- | ------------------------------------------------------------ |
| Small PRs | Bug fixes and small improvements - can be recognized by seeing a small number of changes and possibly a small number of new files. |
| Large PRs | New features and large refactorings - can be recognized by seeing a large number of changes, plenty of new files, updates to package manager files (NuGets packages.config, NPMs packages.json, etc.). |
Were usually able to handle small PRs pretty quickly. A community volunteer will do the initial review and flag it for Umbraco HQ as “community tested”. If everything looks good, it will be merged pretty quickly [as per the described process][review process].
We would love to follow the same process for larger PRs but this is not always possible due to time limitations and priorities that need to be aligned. We dont want to put up any barriers, but this document should set the correct expectations.
Not all changes are wanted, so on occasion we might close a PR without merging it but if we do, we will give you feedback why we can't accept your changes. **So make sure to [talk to us before making large changes][making larger changes]**, so we can ensure that you don't put all your hard work into something we would not be able to merge.
#### Making larger changes
[making larger changes]: #making-larger-changes
Please make sure to describe your larger ideas in an [issue (bugs)][issues] or [discussion (new features)][discussions], it helps to put in mock up screenshots or videos. If the change makes sense for HQ to include in Umbraco CMS we will leave you some feedback on how wed like to see it being implemented.
If a larger pull request is encouraged by Umbraco HQ, the process will be similar to what is described in the small PRs process above, we strive to feedback within 14 days. Finalizing and merging the PR might take longer though as it will likely need to be picked up by the development team to make sure everything is in order. Well keep you posted on the progress.
#### Pull request or package?
[pr or package]: #pull-request-or-package
If you're unsure about whether your changes belong in the core Umbraco CMS or if you should turn your idea into a package instead, make sure to [talk to us][making larger changes].
If it doesnt fit in CMS right now, we will likely encourage you to make it into a package instead. A package is a great way to check out popularity of a feature, learn how people use it, validate good usability and fix bugs. Eventually, a package could "graduate" to be included in the CMS.
#### Ownership and copyright
It is your responsibility to make sure that you're allowed to share the code you're providing us. For example, you should have permission from your employer or customer to share code.
Similarly, if your contribution is copied or adapted from somewhere else, make sure that the license allows you to reuse that for a contribution to Umbraco-CMS.
If you're not sure, leave a note on your contribution and we will be happy to guide you.
When your contribution has been accepted, it will be [MIT licensed][MIT license] from that time onwards.
[MIT license]: ../LICENSE.md "Umbraco's license declaration"
[issues]: https://github.com/umbraco/Umbraco-CMS/issues
[discussions]: https://github.com/umbraco/Umbraco-CMS/discussions
+28
View File
@@ -0,0 +1,28 @@
### The Core Collaborators team
[Core collabs]: #the-core-collaborators-team
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]
- [Kyle Eck][Kyle Eck]
- [Michael Latouche][Michael Latouche]
- [Sebastiaan][Sebastiaan]
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.
<!-- 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"
[Michael Latouche]: https://github.com/mikecp "Michael's GitHub profile"
[Sebastiaan]: https://github.com/nul800sebastiaan "Sebastiaan's GitHub profile"
+51
View File
@@ -0,0 +1,51 @@
## Creating a pull request
Exciting! You're ready to show us your changes.
We recommend you to [sync with our repository][sync fork] before you submit your pull request. That way, you can fix any potential merge conflicts and make our lives a little bit easier.
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.
Please note: we are no longer accepting features for v8 and below but will continue to merge security fixes as and when they arise.
## The review process
[review process]: #the-review-process
You've sent us your contribution - congratulations! Now what?
The [Core Collaborators team][Core collabs] can now start reviewing your proposed changes and give you feedback on them. If it's not perfect, we'll either fix up what we need or we can request that you make some additional changes.
You will get an initial automated reply from our [Friendly Umbraco Robot, Umbrabot][Umbrabot], to acknowledge that weve seen your PR and well pick it up as soon as we can. You can take this opportunity to double check everything is in order based off the handy checklist Umbrabot provides.
You will get feedback as soon as the [Core Collaborators team][Core collabs] can after opening the PR. Youll most likely get feedback within a couple of weeks. Then there are a few possible outcomes:
- Your proposed change is awesome! We merge it in and it will be included in the next minor release of Umbraco
- If the change is a high priority bug fix, we will cherry-pick it into the next patch release as well so that we can release it as soon as possible
- Your proposed change is awesome but needs a bit more work, well give you feedback on the changes wed like to see
- Your proposed change is awesome but... not something were looking to include at this point. Well close your PR and the related issue (well be nice about it!). See [making larger changes][making larger changes] and [pull request or package?][pr or package]
### Dealing with requested changes
If you make the corrections we ask for in the same branch and push them to your fork again, the pull request automatically updates with the additional commit(s) so we can review it again. If all is well, we'll merge the code and your commits are forever part of Umbraco!
#### No longer available?
We understand you have other things to do and can't just drop everything to help us out.
So if were asking for your help to improve the PR well wait for two weeks to give you a fair chance to make changes. Well ask for an update if we dont hear back from you after that time.
If we dont hear back from you for 4 weeks, well close the PR so that it doesnt just hang around forever. Youre very welcome to re-open it once you have some more time to spend on it.
There will be times that we really like your proposed changes and well finish the final improvements wed like to see ourselves. You still get the credits and your commits will live on in the git repository.
[ Umbrabot ]: https://github.com/umbrabot
[git flow]: https://jeffkreeftmeijer.com/git-flow/ "An explanation of git flow"
[making larger changes]: contributing-before-you-start.md#making-large-changes
[pr or package]: contributing-before-you-start.md#pull-request-or-package
[Core collabs]: contributing-core-collabs-team.md
+93
View File
@@ -0,0 +1,93 @@
## Finding your first issue: Up for grabs
Umbraco HQ will regularly mark newly created issues on the issue tracker with [the `community/up-for-grabs` tag][up for grabs issues]. This means that the proposed changes are wanted in Umbraco but the HQ does not have the time to make them at this time. We encourage anyone to pick them up and help out.
If you do start working on something, make sure to leave a small comment on the issue saying something like: "I'm working on this". That way other people stumbling upon the issue know they don't need to pick it up, someone already has.
## Making your changes
Great question! The short version goes like this:
1. **Fork**
Create a fork of [`Umbraco-CMS` on GitHub][Umbraco CMS repo]
![Fork the repository](img/forkrepository.png)
1. **Clone**
When GitHub has created your fork, you can clone it in your favorite Git tool
![Clone the fork](img/clonefork.png)
1. **Switch to the correct branch**
Switch to the `contrib` branch
1. **Build**
Build your fork of Umbraco locally as described in the build documentation: you can [debug with Visual Studio Code][build - debugging with code] or [with Visual Studio][build - debugging with vs].
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.
1. **Change**
Make your changes, experiment, have fun, explore and learn, and don't be afraid. We welcome all contributions and will [happily give feedback][questions].
1. **Commit and push**
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.
#### Keeping your Umbraco fork in sync with the main repository
[sync fork]: #keeping-your-umbraco-fork-in-sync-with-the-main-repository
Once you've already got a fork and cloned your fork locally, you can skip steps 1 and 2 going forward. Just remember to keep your fork up to date before making further changes.
To sync your fork with this original one, you'll have to add the upstream url. You only have to do this once:
```
git remote add upstream https://github.com/umbraco/Umbraco-CMS.git
```
Then when you want to get the changes from the main repository:
```
git fetch upstream
git rebase upstream/contrib
```
In this command we're syncing with the `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]
#### Style guide
To be honest, we don't like rules very much. We trust you have the best of intentions and we encourage you to create working code. If it doesn't look perfect then we'll happily help clean it up.
That said, the Umbraco development team likes to follow the hints that ReSharper gives us (no problem if you don't have this installed) and we've added a `.editorconfig` file so that Visual Studio knows what to do with whitespace, line endings, etc.
#### Questions?
[questions]: #questions
You can get in touch with [the core contributors team][core collabs] in multiple ways; we love open conversations and we are a friendly bunch. No question you have is stupid. Any question you have usually helps out multiple people with the same question. Ask away:
- If there's an existing issue on the issue tracker then that's a good place to leave questions and discuss how to start or move forward.
- If you want to ask questions on some code you've already written you can create a draft pull request, [detailed in a GitHub blog post][draft prs].
- Unsure where to start? Did something not work as expected? Try leaving a note in the ["Contributing to Umbraco"][contrib forum] forum. The team monitors that one closely, so one of us will be on hand and ready to point you in the right direction.
<!-- Local -->
[build - debugging with vs]: BUILD.md#debugging-with-visual-studio "Details on building and debugging Umbraco with Visual Studio"
[build - debugging with code]: BUILD.md#debugging-with-vs-code "Details on building and debugging Umbraco with Visual Studio Code"
[sync fork ext]: http://robots.thoughtbot.com/post/5133345960/keeping-a-git-fork-updated "Details on keeping a git fork updated"
[draft prs]: https://github.blog/2019-02-14-introducing-draft-pull-requests/ "Github's blog post providing details on draft pull requests"
[contrib forum]: https://our.umbraco.com/forum/contributing-to-umbraco-cms/
[Umbraco CMS repo]: https://github.com/umbraco/Umbraco-CMS
[up for grabs issues]: https://github.com/umbraco/Umbraco-CMS/issues?q=is%3Aissue+is%3Aopen+label%3Acommunity%2Fup-for-grabs
@@ -0,0 +1,10 @@
## Coding not your thing? Or want more ways to contribute?
This document covers contributing to the codebase of the CMS but [the community site has plenty of inspiration for other ways to get involved.][get involved]
If you don't feel you'd like to make code changes here, you can visit our [documentation repository][docs repo] and use your experience to contribute to making the docs we have, even better.
We also encourage community members to feel free to comment on others' pull requests and issues - the expertise we have is not limited to the Core Collaborators and HQ. So, if you see something on the issue tracker or pull requests you feel you can add to, please don't be shy.
[get involved]: https://community.umbraco.com/get-involved/
[docs repo]: https://github.com/umbraco/UmbracoDocs
+18
View File
@@ -0,0 +1,18 @@
## Unwanted changes
While most changes are welcome, there are certain types of changes that are discouraged and might get your pull request refused.
Of course this will depend heavily on the specific change, but please take the following examples in mind.
- **Breaking changes (code and/or behavioral) 💥** - sometimes it can be a bit hard to know if a change is breaking or not. Fortunately, if it relates to code, the build will fail and warn you.
- **Large refactors 🤯** - the larger the refactor, the larger the probability of introducing new bugs/issues.
- **Changes to obsolete code and/or property editors ✍️**
- **Adding new config options 🦾** - while having more flexibility is (most of the times) better, having too many options can also become overwhelming/confusing, especially if there are other (good/simple) ways to achieve it.
- **Whitespace changes 🫥** - while some of our files might not follow the formatting/whitespace rules (mostly old ones), changing several of them in one go would cause major merge conflicts with open pull requests or other work in progress. Do feel free to fix these when you are working on another issue/feature and end up "touching" those files!
- **Adding new extension/helper methods ✋** - keep in mind that more code also means more to maintain, so if a helper is only meaningful for a few, it might not be worth adding it to the core.
While these are only a few examples, it is important to ask yourself these questions before making a pull request:
- How many will benefit from this change?
- Are there other ways to achieve this? And if so, how do they compare?
- How maintainable is the change?
- What would be the effort to test it properly?
- Do the benefits outweigh the risks?
@@ -1,58 +0,0 @@
name: Add issues to review project
on:
issues:
types:
- opened
permissions:
contents: read
jobs:
get-user-type:
runs-on: ubuntu-latest
outputs:
ignored: ${{ steps.set-output.outputs.ignored }}
steps:
- name: Install dependencies
run: |
npm install node-fetch@2
- uses: actions/github-script@v5
name: "Determing HQ user or not"
id: set-output
with:
script: |
const fetch = require('node-fetch');
const response = await fetch('https://collaboratorsv2.euwest01.umbraco.io/umbraco/api/users/IsIgnoredUser', {
method: 'post',
body: JSON.stringify('${{ github.event.issue.user.login }}'),
headers: {
'Authorization': 'Bearer ${{ secrets.OUR_BOT_API_TOKEN }}',
'Content-Type': 'application/json'
}
});
var isIgnoredUser = true;
try {
if(response.status === 200) {
const data = await response.text();
isIgnoredUser = data === "true";
} else {
console.log("Returned data not indicate success:", response.status);
}
} catch(error) {
console.log(error);
};
core.setOutput("ignored", isIgnoredUser);
console.log("Ignored is", isIgnoredUser);
add-to-project:
permissions:
repository-projects: write # for actions/add-to-project
if: needs.get-user-type.outputs.ignored == 'false'
runs-on: ubuntu-latest
needs: [get-user-type]
steps:
- uses: actions/add-to-project@main
with:
project-url: https://github.com/orgs/${{ github.repository_owner }}/projects/21
github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}
+1 -1
View File
@@ -15,7 +15,7 @@ permissions:
contents: read
env:
dotnetVersion: 7.x
dotnetVersion: 8.x
dotnetIncludePreviewVersions: true
solution: umbraco.sln
buildConfiguration: SkipTests
+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).")
}
+16 -14
View File
@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<LangVersion>latest</LangVersion>
<TargetFramework>net8.0</TargetFramework>
<Company>Umbraco HQ</Company>
<Authors>Umbraco</Authors>
<Copyright>Copyright © Umbraco $([System.DateTime]::Today.ToString('yyyy'))</Copyright>
@@ -17,12 +16,12 @@
<WarningsAsErrors>nullable</WarningsAsErrors>
<ImplicitUsings>enable</ImplicitUsings>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<WarnOnPackingNonPackableProject>false</WarnOnPackingNonPackableProject>
</PropertyGroup>
<!-- SourceLink -->
<PropertyGroup>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>
@@ -31,24 +30,27 @@
<PropertyGroup>
<GenerateCompatibilitySuppressionFile>false</GenerateCompatibilitySuppressionFile>
<EnablePackageValidation>true</EnablePackageValidation>
<PackageValidationBaselineVersion>11.0.0</PackageValidationBaselineVersion>
<PackageValidationBaselineVersion>13.0.0</PackageValidationBaselineVersion>
<EnableStrictModeForCompatibleFrameworksInPackage>true</EnableStrictModeForCompatibleFrameworksInPackage>
<EnableStrictModeForCompatibleTfms>true</EnableStrictModeForCompatibleTfms>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="all" IsImplicitlyDefined="true" />
<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" />
</ItemGroup>
<!-- Calculate version only once for the whole repository -->
<PropertyGroup>
<GitVersionBaseDirectory>$(MSBuildThisFileDirectory)</GitVersionBaseDirectory>
</PropertyGroup>
<!-- Include icon in generated NuGet packages -->
<ItemGroup>
<Content Include="$(MSBuildThisFileDirectory)icon.png" Pack="true" PackagePath="" Visible="false" />
</ItemGroup>
<PropertyGroup>
<GitVersionBaseDirectory>$(MSBuildThisFileDirectory)</GitVersionBaseDirectory>
</PropertyGroup>
<!-- Use version range on project references (to limit on major version in generated packages) -->
<Target Name="_GetProjectReferenceVersionRanges" AfterTargets="_GetProjectReferenceVersions">
<ItemGroup>
<_ProjectReferencesWithVersions Condition="'%(ProjectVersion)' != ''">
<ProjectVersion>[%(ProjectVersion), $([MSBuild]::Add($([System.Text.RegularExpressions.Regex]::Match('%(ProjectVersion)', '^\d+').Value), 1)))</ProjectVersion>
</_ProjectReferencesWithVersions>
</ItemGroup>
</Target>
</Project>
+104
View File
@@ -0,0 +1,104 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<!-- Global packages (private, build-time packages for all projects) -->
<ItemGroup>
<GlobalPackageReference Include="Nerdbank.GitVersioning" Version="3.6.139" />
<GlobalPackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.507" />
<GlobalPackageReference Include="Umbraco.Code" Version="2.2.0" />
<GlobalPackageReference Include="Umbraco.GitVersioning.Extensions" Version="0.2.0" />
</ItemGroup>
<!-- Microsoft packages -->
<ItemGroup>
<PackageVersion Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.22" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="8.0.22" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.10.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.10.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="4.10.0" />
<PackageVersion Include="Microsoft.Data.Sqlite" Version="8.0.11" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.22" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.22" />
<PackageVersion Include="Microsoft.Extensions.Caching.Abstractions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.FileProviders.Embedded" Version="8.0.22" />
<PackageVersion Include="Microsoft.Extensions.FileProviders.Physical" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Http" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.Identity.Core" Version="8.0.22" />
<PackageVersion Include="Microsoft.Extensions.Identity.Stores" Version="8.0.22" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.Options" Version="8.0.2" />
<PackageVersion Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Options.DataAnnotations" Version="8.0.0" />
<PackageVersion Include="System.Runtime.Caching" Version="8.0.1" />
</ItemGroup>
<!-- Umbraco packages -->
<ItemGroup>
<PackageVersion Include="Umbraco.JsonSchema.Extensions" Version="0.3.0" />
<PackageVersion Include="Umbraco.CSharpTest.Net.Collections" Version="15.0.0" />
</ItemGroup>
<!-- Third-party packages -->
<ItemGroup>
<PackageVersion Include="Asp.Versioning.Mvc" Version="7.1.1" />
<PackageVersion Include="Asp.Versioning.Mvc.ApiExplorer" Version="7.1.0" />
<PackageVersion Include="Dazinator.Extensions.FileProviders" Version="2.0.0" />
<PackageVersion Include="Examine" Version="3.8.0" />
<PackageVersion Include="Examine.Core" Version="3.8.0" />
<PackageVersion Include="HtmlAgilityPack" Version="1.11.74" />
<PackageVersion Include="K4os.Compression.LZ4" Version="1.3.8" />
<PackageVersion Include="MailKit" Version="4.8.0" />
<PackageVersion Include="Markdown" Version="2.2.1" />
<PackageVersion Include="MessagePack" Version="2.5.192" />
<PackageVersion Include="MiniProfiler.AspNetCore.Mvc" Version="4.3.8" />
<PackageVersion Include="MiniProfiler.Shared" Version="4.3.8" />
<PackageVersion Include="ncrontab" Version="3.3.3" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.4" />
<PackageVersion Include="NPoco" Version="5.7.1" />
<PackageVersion Include="NPoco.SqlServer" Version="5.7.1" />
<PackageVersion Include="OpenIddict.Abstractions" Version="4.10.1" />
<PackageVersion Include="OpenIddict.AspNetCore" Version="4.10.1" />
<PackageVersion Include="OpenIddict.EntityFrameworkCore" Version="4.10.1" />
<PackageVersion Include="Serilog" Version="3.1.1" />
<PackageVersion Include="Serilog.AspNetCore" Version="8.0.3" />
<PackageVersion Include="Serilog.Enrichers.Process" Version="2.0.2" />
<PackageVersion Include="Serilog.Enrichers.Thread" Version="3.1.0" />
<PackageVersion Include="Serilog.Expressions" Version="4.0.0" />
<PackageVersion Include="Serilog.Extensions.Hosting" Version="8.0.0" />
<PackageVersion Include="Serilog.Formatting.Compact" Version="2.0.0" />
<PackageVersion Include="Serilog.Formatting.Compact.Reader" Version="3.0.0" />
<PackageVersion Include="Serilog.Settings.Configuration" Version="8.0.4" />
<PackageVersion Include="Serilog.Sinks.Async" Version="1.5.0" />
<PackageVersion Include="Serilog.Sinks.File" Version="5.0.0" />
<PackageVersion Include="Serilog.Sinks.Map" Version="1.0.2" />
<PackageVersion Include="SixLabors.ImageSharp" Version="3.1.12" />
<PackageVersion Include="SixLabors.ImageSharp.Web" Version="3.1.5" />
<PackageVersion Include="Smidge.InMemory" Version="4.6.0" />
<PackageVersion Include="Smidge.Nuglify" Version="4.6.0" />
<PackageVersion Include="Swashbuckle.AspNetCore" Version="6.9.0" />
</ItemGroup>
<!-- Transitive pinned versions (only required because our direct dependencies have vulnerable versions of transitive dependencies) -->
<ItemGroup>
<!-- Both Microsoft.EntityFrameworkCore.SqlServer and NPoco.SqlServer bring in a vulnerable version of Azure.Identity -->
<PackageVersion Include="Azure.Identity" Version="1.13.2" />
<!-- Dazinator.Extensions.FileProviders brings in a vulnerable version of System.Net.Http -->
<PackageVersion Include="System.Net.Http" Version="4.3.4" />
<!-- Examine brings in a vulnerable version of System.Security.Cryptography.Xml -->
<PackageVersion Include="System.Security.Cryptography.Xml" Version="8.0.3" />
<!-- Both Dazinator.Extensions.FileProviders and MiniProfiler.AspNetCore.Mvc bring in a vulnerable version of System.Text.RegularExpressions -->
<PackageVersion Include="System.Text.RegularExpressions" Version="4.3.1" />
<!-- Both OpenIddict.AspNetCore, Npoco.SqlServer and Microsoft.EntityFrameworkCore.SqlServer bring in a vulnerable version of Microsoft.IdentityModel.JsonWebTokens -->
<PackageVersion Include="Microsoft.IdentityModel.JsonWebTokens" Version="7.7.1" />
<!-- Examine.Lucene bring in a vulnerable version of Lucene.Net.Replicator -->
<PackageVersion Include="Lucene.Net.Replicator" Version="4.8.0-beta00017" />
<!-- Both OpenIddict.AspNetCore, Microsoft.EntityFrameworkCore.* bring in a vulnerable version of Microsoft.Extensions.Caching.Memory -->
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="8.0.1" />
<!-- Both Azure.Identity, Microsoft.EntityFrameworkCore.SqlServer,NPoco.SqlServer, and more bring in a vulnerable version of System.Text.Json -->
<PackageVersion Include="System.Text.Json" Version="8.0.6" />
<!-- Both Microsoft.EntityFrameworkCore.SqlServer and NPoco.SqlServer bring in a vulnerable version of Microsoft.Data.SqlClient -->
<PackageVersion Include="Microsoft.Data.SqlClient" Version="5.2.3" />
</ItemGroup>
</Project>
+526 -177
View File
@@ -5,6 +5,10 @@ parameters:
displayName: Run SQL Server Integration Tests
type: boolean
default: false
- name: sqlServerAcceptanceTests
displayName: Run SQL Server Acceptance Tests
type: boolean
default: false
- name: myGetDeploy
displayName: Deploy to MyGet
type: boolean
@@ -21,11 +25,37 @@ parameters:
displayName: Upload API docs
type: boolean
default: false
- name: uploadDependencyTrack
displayName: Upload BOMs to Dependency Track
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
solution: umbraco.sln
buildConfiguration: Release
UMBRACO__CMS__GLOBAL__ID: 00000000-0000-0000-0000-000000000042
@@ -45,10 +75,15 @@ stages:
- job: A
displayName: Build Umbraco CMS
pool:
vmImage: 'ubuntu-latest'
vmImage: 'windows-latest'
steps:
- checkout: self
submodules: false
lfs: false,
fetchDepth: 500
- task: NodeTool@0
displayName: Use Node.js $(nodeVersion)
retryCountOnTaskFailure: 3
inputs:
versionSpec: $(nodeVersion)
- task: Cache@2
@@ -61,47 +96,56 @@ 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)
- powershell: |
npm install --global @cyclonedx/cyclonedx-npm
cyclonedx-npm -o $(Build.ArtifactStagingDirectory)\bom\bom-backoffice.xml --ignore-npm-errors --verbose
displayName: Generate Backoffice UI BOM
workingDirectory: src/Umbraco.Web.UI.Client
- task: gulp@0
displayName: Run gulp build
displayName: Run gulp build (Backoffice)
inputs:
gulpFile: src/Umbraco.Web.UI.Client/gulpfile.js
targets: coreBuild
workingDirectory: src/Umbraco.Web.UI.Client
- task: UseDotNet@2
displayName: Use .NET $(dotnetVersion)
- task: npm@1
displayName: Run npm ci (Login)
inputs:
version: $(dotnetVersion)
includePreviewVersions: $(dotnetIncludePreviewVersions)
command: custom
workingDir: src/Umbraco.Web.UI.Login
verbose: false
customCommand: ci
- powershell: |
cyclonedx-npm -o $(Build.ArtifactStagingDirectory)\bom\bom-login.xml --ignore-npm-errors --verbose
displayName: Generate Login UI BOM
workingDirectory: src/Umbraco.Web.UI.Login
- task: npm@1
displayName: Run npm build (Login)
inputs:
command: custom
workingDir: src/Umbraco.Web.UI.Login
verbose: false
customCommand: run build
- task: UseDotNet@2
displayName: Use .NET SDK from global.json
inputs:
useGlobalJson: true
- task: DotNetCoreCLI@2
displayName: Run dotnet restore
inputs:
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'
- powershell: |
dotnet tool install --global CycloneDX
dotnet-CycloneDX $(solution) --output $(Build.ArtifactStagingDirectory)/bom --filename bom-dotnet.xml
displayName: 'Generate Backend BOM'
- task: PublishPipelineArtifact@1
displayName: Publish nupkg
inputs:
@@ -112,13 +156,42 @@ stages:
inputs:
targetPath: $(Build.SourcesDirectory)
artifactName: build_output
- task: PublishPipelineArtifact@1
displayName: Publish Backend BOM
inputs:
targetPath: $(Build.ArtifactStagingDirectory)/bom
artifactName: bom-build
- stage: E2E_BOM
displayName: E2E Tests BOM Generation
dependsOn: []
jobs:
- job:
displayName: E2E Generate BOM
pool:
vmImage: "ubuntu-latest"
steps:
- checkout: self
fetchDepth: 500
- template: templates/e2e-install.yml
parameters:
nodeVersion: ${{ variables.nodeVersion }}
npm_config_cache: ${{ variables.npm_config_cache }}
- powershell: |
npm install --global @cyclonedx/cyclonedx-npm
cyclonedx-npm -o $(Build.ArtifactStagingDirectory)/bom/bom-e2e.xml --ignore-npm-errors --verbose
displayName: Generate E2E Tests BOM
workingDirectory: tests/Umbraco.Tests.AcceptanceTest
- publish: $(Build.ArtifactStagingDirectory)/bom
artifact: bom-e2e
displayName: 'Publish E2E BOM'
- 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:
@@ -126,6 +199,10 @@ stages:
pool:
vmImage: 'windows-latest'
steps:
- task: UseDotNet@2
displayName: Use .NET SDK from global.json
inputs:
useGlobalJson: true
- task: PowerShell@2
displayName: Install DocFX
inputs:
@@ -171,10 +248,16 @@ stages:
pool:
vmImage: 'ubuntu-latest'
steps:
- checkout: self
submodules: false
lfs: false,
fetchDepth: 1
fetchFilter: tree:0
- 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
@@ -221,27 +304,33 @@ stages:
pool:
vmImage: $(vmImage)
steps:
- checkout: self
submodules: false
lfs: false,
fetchDepth: 1
fetchFilter: tree:0
- task: DownloadPipelineArtifact@2
displayName: Download build artifacts
inputs:
artifact: build_output
path: $(Build.SourcesDirectory)
- task: UseDotNet@2
displayName: Use .NET $(dotnetVersion)
displayName: Use .NET SDK from global.json
inputs:
version: $(dotnetVersion)
includePreviewVersions: $(dotnetIncludePreviewVersions)
useGlobalJson: true
- task: DotNetCoreCLI@2
displayName: Run dotnet test
inputs:
command: test
projects: '**/*.Tests.UnitTests.csproj'
projects: 'tests/Umbraco.Tests.UnitTests/Umbraco.Tests.UnitTests.csproj'
arguments: '--configuration $(buildConfiguration) --no-build'
testRunTitle: Unit Tests - $(Agent.OS)
- stage: Integration
displayName: Integration Tests
dependsOn: Build
variables:
releaseTestFilter: eq(dependencies.Build.outputs['A.build.NBGV_PublicRelease'], 'True')
jobs:
# Integration Tests (SQLite)
- job:
@@ -256,217 +345,470 @@ stages:
vmImage: 'macOS-latest'
pool:
vmImage: $(vmImage)
variables:
Tests__Database__DatabaseType: 'Sqlite'
steps:
- checkout: self
submodules: false
lfs: false,
fetchDepth: 1
fetchFilter: tree:0
# Setup test environment
- task: DownloadPipelineArtifact@2
displayName: Download build artifacts
inputs:
artifact: build_output
path: $(Build.SourcesDirectory)
- task: UseDotNet@2
displayName: Use .NET $(dotnetVersion)
displayName: Use .NET SDK from global.json
inputs:
version: $(dotnetVersion)
includePreviewVersions: $(dotnetIncludePreviewVersions)
useGlobalJson: true
# Test
- task: DotNetCoreCLI@2
displayName: Run dotnet test
inputs:
command: test
projects: '**/*.Tests.Integration.csproj'
arguments: '--configuration $(buildConfiguration) --no-build'
projects: 'tests/Umbraco.Tests.Integration/Umbraco.Tests.Integration.csproj'
testRunTitle: Integration Tests SQLite - $(Agent.OS)
env:
Tests__Database__DatabaseType: 'Sqlite'
Umbraco__CMS__Global__MainDomLock: 'FileSystemMainDomLock'
${{ if and(eq(variables['Agent.OS'],'Windows_NT'), or(variables.releaseTestFilter, parameters.forceReleaseTestFilter)) }}:
arguments: '--configuration $(buildConfiguration) --no-build ${{parameters.integrationReleaseTestFilter}}'
${{ elseif eq(variables['Agent.OS'],'Windows_NT') }}:
arguments: '--configuration $(buildConfiguration) --no-build ${{parameters.integrationNonReleaseTestFilter}}'
${{ elseif or(variables.releaseTestFilter, parameters.forceReleaseTestFilter) }}:
arguments: '--configuration $(buildConfiguration) --no-build ${{parameters.nonWindowsIntegrationReleaseTestFilter}}'
${{ else }}:
arguments: '--configuration $(buildConfiguration) --no-build ${{parameters.nonWindowsIntegrationNonReleaseTestFilter}}'
# Integration Tests (SQL Server)
- job:
timeoutInMinutes: 120
condition: or(startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'), ${{parameters.sqlServerIntegrationTests}})
# We are currently encountering issues when running SQL Server Linux tests Microsoft.Data.SqlClient.SqlException (0x80131904)
# condition: or(eq(stageDependencies.Build.A.outputs['build.NBGV_PublicRelease'], 'True'), ${{parameters.sqlServerIntegrationTests}})
condition: eq(${{parameters.sqlServerIntegrationTests}}, True)
displayName: Integration Tests (SQL Server)
strategy:
matrix:
Windows:
vmImage: 'windows-latest'
testDb: LocalDb
connectionString: N/A
Tests__Database__DatabaseType: LocalDb
Tests__Database__SQLServerMasterConnectionString: N/A
Linux:
vmImage: 'ubuntu-latest'
testDb: SqlServer
connectionString: 'Server=localhost,1433;User Id=sa;Password=$(SA_PASSWORD);TrustServerCertificate=true'
SA_PASSWORD: UmbracoIntegration123!
Tests__Database__DatabaseType: SqlServer
Tests__Database__SQLServerMasterConnectionString: 'Server=(local);User Id=sa;Password=$(SA_PASSWORD);TrustServerCertificate=True'
pool:
vmImage: $(vmImage)
variables:
SA_PASSWORD: UmbracoIntegration123!
steps:
# Setup test environment
- task: DownloadPipelineArtifact@2
displayName: Download build artifacts
inputs:
artifact: build_output
path: $(Build.SourcesDirectory)
- task: UseDotNet@2
displayName: Use .NET $(dotnetVersion)
displayName: Use .NET SDK from global.json
inputs:
version: $(dotnetVersion)
includePreviewVersions: $(dotnetIncludePreviewVersions)
- powershell: sqllocaldb start mssqllocaldb
displayName: Start localdb (Windows only)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
- powershell: docker run --name mssql -d -p 1433:1433 -e ACCEPT_EULA=Y -e SA_PASSWORD=$(SA_PASSWORD) -e MSSQL_PID=Developer mcr.microsoft.com/mssql/server:2019-latest
displayName: Start SQL Server (Linux only)
useGlobalJson: true
# Start SQL Server
- powershell: docker run --name mssql -d -p 1433:1433 -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=$(SA_PASSWORD)" mcr.microsoft.com/mssql/server:2022-latest
displayName: Start SQL Server Docker image (Linux)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
- pwsh: SqlLocalDB start MSSQLLocalDB
displayName: Start SQL Server LocalDB (Windows)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
# Test
- task: DotNetCoreCLI@2
displayName: Run dotnet test
inputs:
command: test
projects: '**/*.Tests.Integration.csproj'
arguments: '--configuration $(buildConfiguration) --no-build'
projects: 'tests/Umbraco.Tests.Integration/Umbraco.Tests.Integration.csproj'
testRunTitle: Integration Tests SQL Server - $(Agent.OS)
env:
Tests__Database__DatabaseType: $(testDb)
Tests__Database__SQLServerMasterConnectionString: $(connectionString)
Umbraco__CMS__Global__MainDomLock: 'SqlMainDomLock'
${{ if and(eq(variables['Agent.OS'],'Windows_NT'), or(variables.releaseTestFilter, parameters.forceReleaseTestFilter)) }}:
arguments: '--configuration $(buildConfiguration) --no-build ${{parameters.integrationReleaseTestFilter}}'
${{ elseif eq(variables['Agent.OS'],'Windows_NT') }}:
arguments: '--configuration $(buildConfiguration) --no-build ${{parameters.integrationNonReleaseTestFilter}}'
${{ elseif or(variables.releaseTestFilter, parameters.forceReleaseTestFilter) }}:
arguments: '--configuration $(buildConfiguration) --no-build ${{parameters.nonWindowsIntegrationReleaseTestFilter}}'
${{ else }}:
arguments: '--configuration $(buildConfiguration) --no-build ${{parameters.nonWindowsIntegrationNonReleaseTestFilter}}'
# Stop SQL Server
- pwsh: docker stop mssql
displayName: Stop SQL Server Docker image (Linux)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
- pwsh: SqlLocalDB stop MSSQLLocalDB
displayName: Stop SQL Server LocalDB (Windows)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
- stage: E2E
variables:
npm_config_cache: $(Pipeline.Workspace)/.npm_e2e
displayName: E2E Tests
dependsOn: Build
variables:
npm_config_cache: $(Pipeline.Workspace)/.npm_e2e
# Enable console logging in Release mode
SERILOG__WRITETO__0__NAME: Async
SERILOG__WRITETO__0__ARGS__CONFIGURE__0__NAME: Console
# Set unattended install settings
UMBRACO__CMS__UNATTENDED__INSTALLUNATTENDED: true
UMBRACO__CMS__UNATTENDED__UNATTENDEDUSERNAME: Playwright Test
UMBRACO__CMS__UNATTENDED__UNATTENDEDUSERPASSWORD: UmbracoAcceptance123!
UMBRACO__CMS__UNATTENDED__UNATTENDEDUSEREMAIL: playwright@umbraco.com
# Custom Umbraco settings
UMBRACO__CMS__CONTENT__CONTENTVERSIONCLEANUPPOLICY__ENABLECLEANUP: false
UMBRACO__CMS__GLOBAL__DISABLEELECTIONFORSINGLESERVER: true
UMBRACO__CMS__GLOBAL__INSTALLMISSINGDATABASE: true
UMBRACO__CMS__GLOBAL__ID: 00000000-0000-0000-0000-000000000042
UMBRACO__CMS__GLOBAL__VERSIONCHECKPERIOD: 0
UMBRACO__CMS__GLOBAL__USEHTTPS: true
UMBRACO__CMS__HEALTHCHECKS__NOTIFICATION__ENABLED: false
UMBRACO__CMS__KEEPALIVE__DISABLEKEEPALIVETASK: true
UMBRACO__CMS__WEBROUTING__UMBRACOAPPLICATIONURL: https://localhost:44331/
ASPNETCORE_URLS: https://localhost:44331
jobs:
# E2E Tests
- job:
displayName: E2E Tests
displayName: E2E Tests (SQLite)
variables:
Umbraco__CMS__Unattended__UnattendedUserName: Playwright Test
Umbraco__CMS__Unattended__UnattendedUserPassword: UmbracoAcceptance123!
Umbraco__CMS__Unattended__UnattendedUserEmail: playwright@umbraco.com
ASPNETCORE_URLS: https://localhost:8443
# Connection string
CONNECTIONSTRINGS__UMBRACODBDSN: Data Source=Umbraco;Mode=Memory;Cache=Shared;Foreign Keys=True;Pooling=True
CONNECTIONSTRINGS__UMBRACODBDSN_PROVIDERNAME: Microsoft.Data.Sqlite
strategy:
matrix:
Linux:
vmImage: 'ubuntu-latest'
dockerfile: umbraco-linux.docker
dockerImageName: umbraco-linux
Windows:
vmImage: 'windows-latest'
DOTNET_GENERATE_ASPNET_CERTIFICATE: true # Automatically generate HTTPS development certificate on Windows
# Enable console logging in Release mode
Serilog__WriteTo__0__Name: Async
Serilog__WriteTo__0__Args__configure__0__Name: Console
# Set unattended install settings
Umbraco__CMS__Unattended__InstallUnattended: true
Umbraco__CMS__Global__InstallMissingDatabase: true
UmbracoDatabaseServer: (LocalDB)\MSSQLLocalDB
UmbracoDatabaseName: Playwright
ConnectionStrings__umbracoDbDSN: Server=$(UmbracoDatabaseServer);Database=$(UmbracoDatabaseName);Integrated Security=true;
# Custom Umbraco settings
Umbraco__CMS__Global__VersionCheckPeriod: 0
Umbraco__CMS__Global__UseHttps: true
Umbraco__CMS__HealthChecks__Notification__Enabled: false
Umbraco__CMS__KeepAlive__DisableKeepAliveTask: true
LinuxPart1Of3:
vmImage: "ubuntu-latest"
testCommand: "npm run test -- --shard=1/3"
LinuxPart2Of3:
vmImage: "ubuntu-latest"
testCommand: "npm run test -- --shard=2/3"
LinuxPart3Of3:
vmImage: "ubuntu-latest"
testCommand: "npm run test -- --shard=3/3"
WindowsPart1Of3:
vmImage: "windows-latest"
testCommand: "npm run test -- --shard=1/3"
WindowsPart2Of3:
vmImage: "windows-latest"
testCommand: "npm run test -- --shard=2/3"
WindowsPart3Of3:
vmImage: "windows-latest"
testCommand: "npm run test -- --shard=3/3"
pool:
vmImage: $(vmImage)
steps:
# Setup test environment
- task: DownloadPipelineArtifact@2
displayName: Download nupkg
displayName: Download NuGet artifacts
inputs:
artifact: nupkg
path: $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/misc/nupkg
- task: NodeTool@0
displayName: Use Node.js $(nodeVersion)
inputs:
versionSpec: $(nodeVersion)
- task: Cache@2
displayName: Cache node_modules
inputs:
key: '"npm_e2e" | "$(Agent.OS)" | $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/package-lock.json'
restoreKeys: |
"npm_e2e" | "$(Agent.OS)"
"npm_e2e"
path: $(npm_config_cache)
- pwsh: |
New-Item -Path "." -Name ".env" -ItemType "file" -Value "UMBRACO_USER_LOGIN=$(Umbraco__CMS__Unattended__UnattendedUserEmail)
UMBRACO_USER_PASSWORD=$(Umbraco__CMS__Unattended__UnattendedUserPassword)
URL=$(ASPNETCORE_URLS)"
displayName: Generate .env
workingDirectory: $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/
- script: npm ci --no-fund --no-audit --prefer-offline
workingDirectory: $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/
displayName: Run npm ci
- pwsh: sqllocaldb start mssqllocaldb
displayName: Start localdb (Windows only)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
- pwsh: Invoke-Sqlcmd -Query "CREATE DATABASE $env:UmbracoDatabaseName" -ServerInstance $env:UmbracoDatabaseServer
displayName: Create database (Windows only)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
path: $(Agent.BuildDirectory)/app/nupkg
- task: UseDotNet@2
displayName: Use .NET $(dotnetVersion)
displayName: Use .NET SDK from global.json
inputs:
version: $(dotnetVersion)
includePreviewVersions: $(dotnetIncludePreviewVersions)
useGlobalJson: true
- template: templates/e2e-install.yml
parameters:
nodeVersion: $(nodeVersion)
npm_config_cache: $(npm_config_cache)
PlaywrightUserEmail: $(UMBRACO__CMS__UNATTENDED__UNATTENDEDUSEREMAIL)
PlaywrightPassword: $(UMBRACO__CMS__UNATTENDED__UNATTENDEDUSERPASSWORD)
ASPNETCORE_URLS: $(ASPNETCORE_URLS)
# Build application
- pwsh: |
$sha = 'g$(Build.SourceVersion)'.substring(0, 8)
docker build -t $(dockerImageName):$sha -f $(dockerfile) .
mkdir -p $(Build.ArtifactStagingDirectory)/docker-images
docker save -o $(Build.ArtifactStagingDirectory)/docker-images/$(dockerImageName).$sha.tar $(dockerImageName):$sha
dotnet dev-certs https -ep ${HOME}/.aspnet/https/aspnetapp.pfx -p $(Umbraco__CMS__Unattended__UnattendedUserPassword)
docker run --name $(dockerImageName) -dp 8080:5000 -dp 8443:5001 -e UMBRACO__CMS__GLOBAL__ID=$(UMBRACO__CMS__GLOBAL__ID) -e ASPNETCORE_Kestrel__Certificates__Default__Password="$(Umbraco__CMS__Unattended__UnattendedUserPassword)" -e ASPNETCORE_Kestrel__Certificates__Default__Path=/https/aspnetapp.pfx -v ${HOME}/.aspnet/https:/https/ $(dockerImageName):$sha
docker ps
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
displayName: Build and run container (Linux only)
workingDirectory: tests/Umbraco.Tests.AcceptanceTest/misc
- pwsh: |
dotnet new --install ./nupkg/Umbraco.Templates.*.nupkg
dotnet new umbraco --name Playwright --no-restore --output .
dotnet restore --configfile ./nuget.config
dotnet build --configuration $(buildConfiguration) --no-restore
$cmsVersion = "$(Build.BuildNumber)" -replace "\+",".g"
dotnet new nugetconfig
dotnet nuget add source ./nupkg --name Local
dotnet new install Umbraco.Templates::$cmsVersion
dotnet new umbraco --name UmbracoProject --version $cmsVersion --exclude-gitignore --no-restore --no-update-check
dotnet restore UmbracoProject
cp $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest.UmbracoProject/*.cs UmbracoProject
dotnet build UmbracoProject --configuration $(buildConfiguration) --no-restore
dotnet dev-certs https
$process = Start-Process -FilePath "dotnet" -ArgumentList "run --configuration $(buildConfiguration) --no-build --no-launch-profile 2>&1" -PassThru -RedirectStandardOutput $(Build.ArtifactStagingDirectory)/playwright.log
displayName: Build application
workingDirectory: $(Agent.BuildDirectory)/app
# Run application
- bash: |
nohup dotnet run --project UmbracoProject --configuration $(buildConfiguration) --no-build --no-launch-profile > $(Build.ArtifactStagingDirectory)/playwright.log 2>&1 &
echo "##vso[task.setvariable variable=AcceptanceTestProcessId]$!"
displayName: Run application (Linux)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
workingDirectory: $(Agent.BuildDirectory)/app
- pwsh: |
$process = Start-Process dotnet "run --project UmbracoProject --configuration $(buildConfiguration) --no-build --no-launch-profile 2>&1" -PassThru -NoNewWindow -RedirectStandardOutput $(Build.ArtifactStagingDirectory)/playwright.log
Write-Host "##vso[task.setvariable variable=AcceptanceTestProcessId]$($process.Id)"
displayName: Run application (Windows)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
displayName: Build and run app (Windows only)
workingDirectory: tests/Umbraco.Tests.AcceptanceTest/misc
workingDirectory: $(Agent.BuildDirectory)/app
# Wait for application to start responding to requests
- pwsh: npx wait-on -v --interval 1000 --timeout 120000 $(ASPNETCORE_URLS)
displayName: Wait for app
displayName: Wait for application
workingDirectory: tests/Umbraco.Tests.AcceptanceTest
- pwsh: npx playwright install --with-deps
displayName: Install Playwright
# Install Playwright and dependencies
- pwsh: npx playwright install chromium
displayName: Install Playwright only with Chromium browser
workingDirectory: tests/Umbraco.Tests.AcceptanceTest
- pwsh: npm run test --ignore-certificate-errors
displayName: Run Playwright (Desktop)
# Test
- pwsh: $(testCommand)
displayName: Run Playwright tests
continueOnError: true
workingDirectory: tests/Umbraco.Tests.AcceptanceTest
env:
CI: true
CommitId: $(Build.SourceVersion)
AgentOs: $(Agent.OS)
# Stop application
- bash: kill -15 $(AcceptanceTestProcessId)
displayName: Stop application (Linux)
condition: and(succeeded(), ne(variables.AcceptanceTestProcessId, ''), eq(variables['Agent.OS'], 'Linux'))
- pwsh: Stop-Process -Id $(AcceptanceTestProcessId)
displayName: Stop application (Windows)
condition: and(succeeded(), ne(variables.AcceptanceTestProcessId, ''), eq(variables['Agent.OS'], 'Windows_NT'))
# Copy artifacts
- pwsh: |
docker logs $(dockerImageName) > $(Build.ArtifactStagingDirectory)/playwright.log 2>&1
docker stop $(dockerImageName)
condition: eq(variables['Agent.OS'], 'Linux')
displayName: Stop app (Linux only)
- pwsh: Stop-Process $env:AcceptanceTestProcessId
condition: eq(variables['Agent.OS'], 'Windows_NT')
displayName: Stop app (Windows only)
- task: PowerShell@2
displayName: Check if artifacts folder exists
inputs:
targetType: inline
script: |
$MyVariable = Test-Path -Path $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/results
Write-Host "##vso[task.setvariable variable=resultFolderExists;]$MyVariable"
- task: CopyFiles@2
displayName: Prepare artifacts
condition: eq(variables.resultFolderExists, 'True')
inputs:
sourceFolder: $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/results/
targetFolder: $(Build.ArtifactStagingDirectory)/playwright
if (Test-Path tests/Umbraco.Tests.AcceptanceTest/results/*) {
Copy-Item tests/Umbraco.Tests.AcceptanceTest/results/* $(Build.ArtifactStagingDirectory) -Recurse
}
displayName: Copy Playwright results
condition: succeededOrFailed()
# Publish test artifacts
- task: PublishPipelineArtifact@1
condition: always()
displayName: Publish test artifacts
condition: succeededOrFailed()
inputs:
targetPath: $(Build.ArtifactStagingDirectory)
artifact: 'E2E artifacts - $(Agent.OS) - Attempt #$(System.JobAttempt)'
artifact: "Acceptance Test Results - $(Agent.JobName) - Attempt #$(System.JobAttempt)"
# Publish test results
- task: PublishTestResults@2
displayName: "Publish test results"
condition: succeededOrFailed()
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: '*.xml'
searchFolder: "tests/Umbraco.Tests.AcceptanceTest/results"
testRunTitle: "$(Agent.JobName)"
- job:
displayName: E2E Tests (SQL Server)
condition: or(eq(stageDependencies.Build.A.outputs['build.NBGV_PublicRelease'], 'True'), ${{parameters.sqlServerAcceptanceTests}})
variables:
# Connection string
CONNECTIONSTRINGS__UMBRACODBDSN: Data Source=(localdb)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\Umbraco.mdf;Integrated Security=True
CONNECTIONSTRINGS__UMBRACODBDSN_PROVIDERNAME: Microsoft.Data.SqlClient
strategy:
matrix:
LinuxPart1Of3:
testCommand: "npm run testSqlite -- --shard=1/3"
vmImage: "ubuntu-latest"
SA_PASSWORD: $(UMBRACO__CMS__UNATTENDED__UNATTENDEDUSERPASSWORD)
CONNECTIONSTRINGS__UMBRACODBDSN: "Server=(local);Database=Umbraco;User Id=sa;Password=$(SA_PASSWORD);TrustServerCertificate=True"
LinuxPart2Of3:
testCommand: "npm run testSqlite -- --shard=2/3"
vmImage: "ubuntu-latest"
SA_PASSWORD: $(UMBRACO__CMS__UNATTENDED__UNATTENDEDUSERPASSWORD)
CONNECTIONSTRINGS__UMBRACODBDSN: "Server=(local);Database=Umbraco;User Id=sa;Password=$(SA_PASSWORD);TrustServerCertificate=True"
LinuxPart3Of3:
testCommand: "npm run testSqlite -- --shard=3/3"
vmImage: "ubuntu-latest"
SA_PASSWORD: $(UMBRACO__CMS__UNATTENDED__UNATTENDEDUSERPASSWORD)
CONNECTIONSTRINGS__UMBRACODBDSN: "Server=(local);Database=Umbraco;User Id=sa;Password=$(SA_PASSWORD);TrustServerCertificate=True"
WindowsPart1Of3:
vmImage: "windows-latest"
testCommand: "npm run testSqlite -- --shard=1/3"
WindowsPart2Of3:
vmImage: "windows-latest"
testCommand: "npm run testSqlite -- --shard=2/3"
WindowsPart3Of3:
vmImage: "windows-latest"
testCommand: "npm run testSqlite -- --shard=3/3"
pool:
vmImage: $(vmImage)
steps:
# Setup test environment
- task: DownloadPipelineArtifact@2
displayName: Download NuGet artifacts
inputs:
artifact: nupkg
path: $(Agent.BuildDirectory)/app/nupkg
- task: NodeTool@0
displayName: Use Node.js $(nodeVersion)
inputs:
versionSpec: $(nodeVersion)
- task: UseDotNet@2
displayName: Use .NET SDK from global.json
inputs:
useGlobalJson: true
- pwsh: |
"UMBRACO_USER_LOGIN=$(UMBRACO__CMS__UNATTENDED__UNATTENDEDUSEREMAIL)
UMBRACO_USER_PASSWORD=$(UMBRACO__CMS__UNATTENDED__UNATTENDEDUSERPASSWORD)
URL=$(ASPNETCORE_URLS)" | Out-File .env
displayName: Generate .env
workingDirectory: $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest
# Cache and restore NPM packages
- task: Cache@2
displayName: Cache NPM packages
inputs:
key: 'npm_e2e | "$(Agent.OS)" | $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/package-lock.json'
restoreKeys: |
npm_e2e | "$(Agent.OS)"
npm_e2e
path: $(npm_config_cache)
- script: npm ci --no-fund --no-audit --prefer-offline
workingDirectory: $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest
displayName: Restore NPM packages
# Build application
- pwsh: |
$cmsVersion = "$(Build.BuildNumber)" -replace "\+",".g"
dotnet new nugetconfig
dotnet nuget add source ./nupkg --name Local
dotnet new install Umbraco.Templates::$cmsVersion
dotnet new umbraco --name UmbracoProject --version $cmsVersion --exclude-gitignore --no-restore --no-update-check
dotnet restore UmbracoProject
cp $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest.UmbracoProject/*.cs UmbracoProject
dotnet build UmbracoProject --configuration $(buildConfiguration) --no-restore
dotnet dev-certs https
displayName: Build application
workingDirectory: $(Agent.BuildDirectory)/app
# Start SQL Server
- powershell: docker run --name mssql -d -p 1433:1433 -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=$(SA_PASSWORD)" mcr.microsoft.com/mssql/server:2022-latest
displayName: Start SQL Server Docker image (Linux)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
- pwsh: SqlLocalDB start MSSQLLocalDB
displayName: Start SQL Server LocalDB (Windows)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
# Run application
- bash: |
nohup dotnet run --project UmbracoProject --configuration $(buildConfiguration) --no-build --no-launch-profile > $(Build.ArtifactStagingDirectory)/playwright.log 2>&1 &
echo "##vso[task.setvariable variable=AcceptanceTestProcessId]$!"
displayName: Run application (Linux)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
workingDirectory: $(Agent.BuildDirectory)/app
- pwsh: |
$process = Start-Process dotnet "run --project UmbracoProject --configuration $(buildConfiguration) --no-build --no-launch-profile 2>&1" -PassThru -NoNewWindow -RedirectStandardOutput $(Build.ArtifactStagingDirectory)/playwright.log
Write-Host "##vso[task.setvariable variable=AcceptanceTestProcessId]$($process.Id)"
displayName: Run application (Windows)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
workingDirectory: $(Agent.BuildDirectory)/app
# Wait for application to start responding to requests
- pwsh: npx wait-on -v --interval 1000 --timeout 120000 $(ASPNETCORE_URLS)
displayName: Wait for application
workingDirectory: tests/Umbraco.Tests.AcceptanceTest
# Install Playwright and dependencies
- pwsh: npx playwright install chromium
displayName: Install Playwright only with Chromium browser
workingDirectory: tests/Umbraco.Tests.AcceptanceTest
# Test
- pwsh: $(testCommand)
displayName: Run Playwright tests
workingDirectory: tests/Umbraco.Tests.AcceptanceTest
env:
CI: true
CommitId: $(Build.SourceVersion)
AgentOs: $(Agent.OS)
# Stop application
- bash: kill -15 $(AcceptanceTestProcessId)
displayName: Stop application (Linux)
condition: and(succeeded(), ne(variables.AcceptanceTestProcessId, ''), eq(variables['Agent.OS'], 'Linux'))
- pwsh: Stop-Process -Id $(AcceptanceTestProcessId)
displayName: Stop application (Windows)
condition: and(succeeded(), ne(variables.AcceptanceTestProcessId, ''), eq(variables['Agent.OS'], 'Windows_NT'))
# Stop SQL Server
- pwsh: docker stop mssql
displayName: Stop SQL Server Docker image (Linux)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
- pwsh: SqlLocalDB stop MSSQLLocalDB
displayName: Stop SQL Server LocalDB (Windows)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
# Copy artifacts
- pwsh: |
if (Test-Path tests/Umbraco.Tests.AcceptanceTest/results/*) {
Copy-Item tests/Umbraco.Tests.AcceptanceTest/results/* $(Build.ArtifactStagingDirectory) -Recurse
}
displayName: Copy Playwright results
condition: succeededOrFailed()
# Publish test artifacts
- task: PublishPipelineArtifact@1
displayName: Publish test artifacts
condition: succeededOrFailed()
inputs:
targetPath: $(Build.ArtifactStagingDirectory)
artifact: "Acceptance Test Results - $(Agent.JobName) - Attempt #$(System.JobAttempt)"
# Publish test results
- task: PublishTestResults@2
displayName: "Publish test results"
condition: succeededOrFailed()
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: '*.xml'
searchFolder: "tests/Umbraco.Tests.AcceptanceTest/results"
testRunTitle: "$(Agent.JobName)"
- stage: Dependency_Track
displayName: Dependency Track
dependsOn:
- Build
- E2E_BOM
condition: and(succeeded(), or(eq(dependencies.Build.outputs['A.build.NBGV_PublicRelease'], 'True'), ${{parameters.uploadDependencyTrack}}))
variables:
# Determine Umbraco version based on whether it's a public release or not. If public release, use major version, else use full NuGet package version.
umbracoVersion: $[ iif(eq(stageDependencies.Build.A.outputs['build.NBGV_PublicRelease'], 'True'), stageDependencies.Build.A.outputs['build.NBGV_VersionMajor'], stageDependencies.Build.A.outputs['build.NBGV_NuGetPackageVersion']) ]
jobs:
- template: templates/dependency-track.yml
parameters:
projectName: "Umbraco-CMS"
umbracoVersion: $(umbracoVersion)
projects:
- name: "Backend"
artifact: "bom-build"
bomFilePath: "bom-dotnet.xml"
- name: "Login"
artifact: "bom-build"
bomFilePath: "bom-login.xml"
- name: "Backoffice"
artifact: "bom-build"
bomFilePath: "bom-backoffice.xml"
- name: "E2E"
artifact: "bom-e2e"
bomFilePath: "bom-e2e.xml"
###############################################
## Release
@@ -477,9 +819,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 +838,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 +872,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
+56
View File
@@ -0,0 +1,56 @@
parameters:
- name: projectName
type: string
- name: umbracoVersion
type: string
- name: projects
type: object
jobs:
- job: Create_DT_Project
displayName: Create Dependency Track Project
steps:
- checkout: none
- bash: |
project_id=$(curl --no-progress-meter -H "X-Api-Key: $(DT_API_KEY)" "$(DT_API_URL)/v1/project/lookup?name=${{ parameters.projectName }}&version=${{ parameters.umbracoVersion }}" | jq -r '.uuid')
if [ "$project_id" != "null" ] && [ -n "$project_id" ]; then
echo "Project '${{ parameters.projectName }}' with version '${{ parameters.umbracoVersion }}' already exists (ID: $project_id)."
else
project_id=$(curl --no-progress-meter \
-X PUT "$(DT_API_URL)/v1/project" \
-H "X-Api-Key: $(DT_API_KEY)" \
-H "Content-Type: application/json" \
-d '{"name": "${{ parameters.projectName }}", "version": "${{ parameters.umbracoVersion }}", "collectionLogic": "AGGREGATE_DIRECT_CHILDREN"}' \
| jq -r '.uuid')
if [ -z "$project_id" ] || [ "$project_id" == "null" ]; then
echo "Failed to create project '${{ parameters.projectName }}' version '${{ parameters.umbracoVersion }}'."
exit 1
fi
echo "Created project '${{ parameters.projectName }}' with version '${{ parameters.umbracoVersion }}' (ID: $project_id)."
fi
displayName: Ensure main project exists in Dependency Track
- ${{ each project in parameters.projects }}:
- job:
displayName: Upload ${{ project.name }} BOM
dependsOn: Create_DT_Project
steps:
- checkout: none
- download: current
artifact: ${{ project.artifact }}
displayName: Download ${{ project.artifact }} artifact
- script: |
curl --no-progress-meter --fail-with-body \
-X POST "$(DT_API_URL)/v1/bom" \
-H "X-Api-Key: $(DT_API_KEY)" \
-H "Content-Type: multipart/form-data" \
-F "autoCreate=true" \
-F "projectName=${{ parameters.projectName }}-${{ project.name }}" \
-F "projectVersion=${{ parameters.umbracoVersion }}" \
-F "parentName=${{ parameters.projectName }}" \
-F "parentVersion=${{ parameters.umbracoVersion }}" \
-F "bom=@$(Pipeline.Workspace)/${{ project.artifact }}/${{ project.bomFilePath }}"
displayName: Upload ${{ project.name }} BOM to Dependency Track
+47
View File
@@ -0,0 +1,47 @@
parameters:
- name: nodeVersion
type: string
default: ''
- name: npm_config_cache
type: string
default: ''
- name: PlaywrightUserEmail
type: string
default: ''
- name: PlaywrightPassword
type: string
default: ''
- name: ASPNETCORE_URLS
type: string
default: ''
steps:
- task: NodeTool@0
displayName: Use Node.js $(nodeVersion)
inputs:
versionSpec: $(nodeVersion)
- pwsh: |
"UMBRACO_USER_LOGIN=${{ parameters.PlaywrightUserEmail }}
UMBRACO_USER_PASSWORD=${{ parameters.PlaywrightPassword }}
URL=${{ parameters.ASPNETCORE_URLS }}" | Out-File .env
displayName: Generate .env
workingDirectory: $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest
# Cache and restore NPM packages
- task: Cache@2
displayName: Cache NPM packages
inputs:
key: 'npm_e2e | "$(Agent.OS)" | $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/package-lock.json'
restoreKeys: |
npm_e2e | "$(Agent.OS)"
npm_e2e
path: ${{ parameters.npm_config_cache }}
- script: npm ci --no-fund --no-audit --prefer-offline
workingDirectory: $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest
displayName: Restore NPM packages
+6
View File
@@ -0,0 +1,6 @@
{
"sdk": {
"version": "8.0.415",
"rollForward": "latestFeature"
}
}
-119
View File
@@ -1,119 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
</configSections>
<appSettings>
<add key="Umbraco.Core.ConfigurationStatus" value="6.0.0"/>
<add key="Umbraco.Core.ReservedUrls" value="~/config/splashes/booting.aspx,~/install/default.aspx,~/config/splashes/noNodes.aspx,~/VSEnterpriseHelper.axd,~/.well-known" />
<add key="Umbraco.Core.ReservedPaths" value="~/install/"/>
<add key="Umbraco.Core.Path" value="~/umbraco"/>
<add key="Umbraco.Core.HideTopLevelNodeFromPath" value="true"/>
<add key="Umbraco.Core.TimeOutInMinutes" value="20"/>
<add key="Umbraco.Core.DefaultUILanguage" value="en"/>
<add key="Umbraco.Core.UseHttps" value="false"/>
<add key="dataAnnotations:dataTypeAttribute:disableRegEx" value="false"/>
</appSettings>
<connectionStrings>
<add name="umbracoDbDSN" connectionString="Datasource=|DataDirectory|UmbracoNPocoTests.sdf;Flush Interval=1;" providerName="System.Data.SqlServerCe.4.0"/>
</connectionStrings>
<system.data>
<DbProviderFactories>
<remove invariant="System.Data.SqlServerCe.4.0"/>
<add name="Microsoft SQL Server Compact Data Provider 4.0" invariant="System.Data.SqlServerCe.4.0" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=4.0.0.1, Culture=neutral, PublicKeyToken=89845dcd8080cc91"/>
</DbProviderFactories>
</system.data>
<system.web>
<httpRuntime targetFramework="4.5"/>
<compilation defaultLanguage="c#" debug="true" batch="false" targetFramework="4.0"></compilation>
<machineKey validationKey="5E7B955FCE36F5F2A867C2A0D85DC61E7FEA9E15F1561E8386F78BFE9EE23FF18B21E6A44AA17300B3B9D5DBEB37AA61A2C73884A5BBEDA6D3B14BA408A7A8CD" decryptionKey="116B853D031219E404E088FCA0986D6CF2DFA77E1957B59FCC9404B8CA3909A1" validation="SHA1" decryption="AES"/>
<!--<trust level="Medium" originUrl=".*"/>-->
<!-- Sitemap provider-->
<siteMap defaultProvider="UmbracoSiteMapProvider" enabled="true">
<providers>
<clear/>
<add name="UmbracoSiteMapProvider" type="umbraco.presentation.nodeFactory.UmbracoSiteMapProvider" defaultDescriptionAlias="description" securityTrimmingEnabled="true"/>
</providers>
</siteMap>
<!-- Membership Provider -->
<membership defaultProvider="UmbracoMembershipProvider" userIsOnlineTimeWindow="15">
<providers>
<clear/>
<add name="UmbracoMembershipProvider" type="Umbraco.Web.Security.Providers.MembersMembershipProvider, Umbraco.Web" minRequiredNonalphanumericCharacters="0" minRequiredPasswordLength="4" useLegacyEncoding="false" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" defaultMemberTypeAlias="Member" passwordFormat="Hashed"/>
</providers>
</membership>
</system.web>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/>
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin.Security.Cookies" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin.Security.OAuth" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.2.5.0" newVersion="1.2.5.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.7.0" newVersion="5.2.7.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.7.0" newVersion="5.2.7.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="0.0.0.0-5.2.7.0" newVersion="5.2.7.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.ComponentModel.Annotations" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.1.0" newVersion="4.2.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
<bindingRedirect oldVersion="4.0.0.0-4.0.3.0" newVersion="4.0.3.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
<bindingRedirect oldVersion="4.0.0.0-4.0.1.1" newVersion="4.0.1.1"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
<bindingRedirect oldVersion="4.0.0.0-4.1.4.0" newVersion="4.1.4.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
@@ -1,41 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Umbraco.Tests")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Umbraco.Tests")]
[assembly: AssemblyCopyright("Copyright © 2012")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("33ddf9b7-505c-4a12-8370-7fee9de5df6d")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
// Internals must be visible to DynamicProxyGenAssembly2
// in order to mock loggers loggers with types from the assembly
// I.E. Mock.Of<ILogger<TestControllerFactory>>()
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")]
@@ -1,43 +0,0 @@
using System;
using System.Collections.Generic;
using NUnit.Framework;
using Umbraco.Cms.Core.Models.PublishedContent;
namespace Umbraco.Tests.Published
{
[TestFixture]
public class ModelTypeTests
{
//TODO these is not easy to move to the Unittest project due to underlysing NotImplementedException of Type.IsSZArray
[Test]
public void ModelTypeToStringTests()
{
var modelType = ModelType.For("alias1");
var modelTypeArray = modelType.MakeArrayType();
Assert.AreEqual("{alias1}", modelType.ToString());
// there's an "*" there because the arrays are not true SZArray - but that changes when we map
Assert.AreEqual("{alias1}[*]", modelTypeArray.ToString());
var enumArray = typeof(IEnumerable<>).MakeGenericType(modelTypeArray);
Assert.AreEqual("System.Collections.Generic.IEnumerable`1[{alias1}[*]]", enumArray.ToString());
}
[Test]
public void ModelTypeFullNameTests()
{
Assert.AreEqual("{alias1}", ModelType.For("alias1").FullName);
Type type = ModelType.For("alias1");
Assert.AreEqual("{alias1}", type.FullName);
// there's an "*" there because the arrays are not true SZArray - but that changes when we map
Assert.AreEqual("{alias1}[*]", ModelType.For("alias1").MakeArrayType().FullName);
// note the inner assembly qualified name
Assert.AreEqual("System.Collections.Generic.IEnumerable`1[[{alias1}[*], Umbraco.Core, Version=0.5.0.0, Culture=neutral, PublicKeyToken=null]]", typeof(IEnumerable<>).MakeGenericType(ModelType.For("alias1").MakeArrayType()).FullName);
}
}
}
@@ -1,45 +0,0 @@
using System.Linq;
using Microsoft.Extensions.DependencyInjection;
using Moq;
using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Cms.Core.Models.PublishedContent;
using Umbraco.Cms.Core.Routing;
using Umbraco.Cms.Core.Web;
using Umbraco.Cms.Tests.Common;
using Umbraco.Tests.TestHelpers;
namespace Umbraco.Tests.Routing
{
public abstract class BaseUrlProviderTest : BaseWebTest
{
protected IUmbracoContextAccessor UmbracoContextAccessor { get; } = new TestUmbracoContextAccessor();
protected abstract bool HideTopLevelNodeFromPath { get; }
protected override void Compose()
{
base.Compose();
Builder.Services.AddTransient<ISiteDomainMapper, SiteDomainMapper>();
}
protected override void ComposeSettings()
{
var contentSettings = new ContentSettings();
var userPasswordConfigurationSettings = new UserPasswordConfigurationSettings();
Builder.Services.AddTransient(x => Microsoft.Extensions.Options.Options.Create(contentSettings));
Builder.Services.AddTransient(x => Microsoft.Extensions.Options.Options.Create(userPasswordConfigurationSettings));
}
protected IPublishedUrlProvider GetPublishedUrlProvider(IUmbracoContext umbracoContext, DefaultUrlProvider urlProvider)
{
var webRoutingSettings = new WebRoutingSettings();
return new UrlProvider(
new TestUmbracoContextAccessor(umbracoContext),
Microsoft.Extensions.Options.Options.Create(webRoutingSettings),
new UrlProviderCollection(new[] { urlProvider }),
new MediaUrlProviderCollection(Enumerable.Empty<IMediaUrlProvider>()),
Mock.Of<IVariationContextAccessor>());
}
}
}
@@ -1,206 +0,0 @@
using System;
using System.Linq;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using Moq;
using Newtonsoft.Json;
using NUnit.Framework;
using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Cms.Core.IO;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Models.PublishedContent;
using Umbraco.Cms.Core.PropertyEditors;
using Umbraco.Cms.Core.PropertyEditors.ValueConverters;
using Umbraco.Cms.Core.Routing;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Strings;
using Umbraco.Cms.Core.Web;
using Umbraco.Cms.Tests.Common;
using Umbraco.Cms.Tests.Common.Testing;
using Umbraco.Tests.PublishedContent;
using Umbraco.Tests.TestHelpers;
using Constants = Umbraco.Cms.Core.Constants;
namespace Umbraco.Tests.Routing
{
[TestFixture]
[UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerFixture)]
public class MediaUrlProviderTests : BaseWebTest
{
private DefaultMediaUrlProvider _mediaUrlProvider;
public override void SetUp()
{
base.SetUp();
var loggerFactory = NullLoggerFactory.Instance;
var mediaFileManager = new MediaFileManager(Mock.Of<IFileSystem>(), Mock.Of<IMediaPathScheme>(),
loggerFactory.CreateLogger<MediaFileManager>(), Mock.Of<IShortStringHelper>());
var contentSettings = new ContentSettings();
var dataTypeService = Mock.Of<IDataTypeService>();
var propertyEditors = new MediaUrlGeneratorCollection(new IMediaUrlGenerator[]
{
new FileUploadPropertyEditor(DataValueEditorFactory, mediaFileManager, Microsoft.Extensions.Options.Options.Create(contentSettings), dataTypeService, LocalizationService, LocalizedTextService, UploadAutoFillProperties, ContentService),
new ImageCropperPropertyEditor(DataValueEditorFactory, loggerFactory, mediaFileManager, Microsoft.Extensions.Options.Options.Create(contentSettings), dataTypeService, IOHelper, UploadAutoFillProperties, ContentService),
});
_mediaUrlProvider = new DefaultMediaUrlProvider(propertyEditors, UriUtility);
}
public override void TearDown()
{
base.TearDown();
_mediaUrlProvider = null;
}
[Test]
public void Get_Media_Url_Resolves_Url_From_Upload_Property_Editor()
{
const string expected = "/media/rfeiw584/test.jpg";
var umbracoContext = GetUmbracoContext("/");
var publishedContent = CreatePublishedContent(Constants.PropertyEditors.Aliases.UploadField, expected, null);
var resolvedUrl = GetPublishedUrlProvider(umbracoContext).GetMediaUrl(publishedContent, UrlMode.Auto);
Assert.AreEqual(expected, resolvedUrl);
}
[Test]
public void Get_Media_Url_Resolves_Url_From_Image_Cropper_Property_Editor()
{
const string expected = "/media/rfeiw584/test.jpg";
var configuration = new ImageCropperConfiguration();
var imageCropperValue = JsonConvert.SerializeObject(new ImageCropperValue
{
Src = expected
});
var umbracoContext = GetUmbracoContext("/");
var publishedContent = CreatePublishedContent(Constants.PropertyEditors.Aliases.ImageCropper, imageCropperValue, configuration);
var resolvedUrl = GetPublishedUrlProvider(umbracoContext).GetMediaUrl(publishedContent, UrlMode.Auto);
Assert.AreEqual(expected, resolvedUrl);
}
[Test]
public void Get_Media_Url_Can_Resolve_Absolute_Url()
{
const string mediaUrl = "/media/rfeiw584/test.jpg";
var expected = $"http://localhost{mediaUrl}";
var umbracoContext = GetUmbracoContext("http://localhost");
var publishedContent = CreatePublishedContent(Constants.PropertyEditors.Aliases.UploadField, mediaUrl, null);
var resolvedUrl = GetPublishedUrlProvider(umbracoContext).GetMediaUrl(publishedContent, UrlMode.Absolute);
Assert.AreEqual(expected, resolvedUrl);
}
[Test]
public void Get_Media_Url_Returns_Absolute_Url_If_Stored_Url_Is_Absolute()
{
const string expected = "http://localhost/media/rfeiw584/test.jpg";
var umbracoContext = GetUmbracoContext("http://localhost");
var publishedContent = CreatePublishedContent(Constants.PropertyEditors.Aliases.UploadField, expected, null);
var resolvedUrl = GetPublishedUrlProvider(umbracoContext).GetMediaUrl(publishedContent, UrlMode.Relative);
Assert.AreEqual(expected, resolvedUrl);
}
[Test]
public void Get_Media_Url_Returns_Empty_String_When_PropertyType_Is_Not_Supported()
{
var umbracoContext = GetUmbracoContext("/");
var publishedContent = CreatePublishedContent(Constants.PropertyEditors.Aliases.Boolean, "0", null);
var resolvedUrl = GetPublishedUrlProvider(umbracoContext).GetMediaUrl(publishedContent, UrlMode.Absolute, propertyAlias: "test");
Assert.AreEqual(string.Empty, resolvedUrl);
}
[Test]
public void Get_Media_Url_Can_Resolve_Variant_Property_Url()
{
var umbracoContext = GetUmbracoContext("http://localhost");
var umbracoFilePropertyType = CreatePropertyType(Constants.PropertyEditors.Aliases.UploadField, null, ContentVariation.Culture);
const string enMediaUrl = "/media/rfeiw584/en.jpg";
const string daMediaUrl = "/media/uf8ewud2/da.jpg";
var property = new SolidPublishedPropertyWithLanguageVariants
{
Alias = "umbracoFile",
PropertyType = umbracoFilePropertyType,
};
property.SetSourceValue("en", enMediaUrl, true);
property.SetSourceValue("da", daMediaUrl);
var contentType = new PublishedContentType(Guid.NewGuid(), 666, "alias", PublishedItemType.Content, Enumerable.Empty<string>(), new [] { umbracoFilePropertyType }, ContentVariation.Culture);
var publishedContent = new SolidPublishedContent(contentType) {Properties = new[] {property}};
var resolvedUrl = GetPublishedUrlProvider(umbracoContext).GetMediaUrl(publishedContent, UrlMode.Auto, "da");
Assert.AreEqual(daMediaUrl, resolvedUrl);
}
private IPublishedUrlProvider GetPublishedUrlProvider(IUmbracoContext umbracoContext)
{
var webRoutingSettings = new WebRoutingSettings();
return new UrlProvider(
new TestUmbracoContextAccessor(umbracoContext),
Microsoft.Extensions.Options.Options.Create(webRoutingSettings),
new UrlProviderCollection(Enumerable.Empty<IUrlProvider>()),
new MediaUrlProviderCollection(new []{_mediaUrlProvider}),
Mock.Of<IVariationContextAccessor>()
);
}
private static IPublishedContent CreatePublishedContent(string propertyEditorAlias, string propertyValue, object dataTypeConfiguration)
{
var umbracoFilePropertyType = CreatePropertyType(propertyEditorAlias, dataTypeConfiguration, ContentVariation.Nothing);
var contentType = new PublishedContentType(Guid.NewGuid(), 666, "alias", PublishedItemType.Content, Enumerable.Empty<string>(),
new[] {umbracoFilePropertyType}, ContentVariation.Nothing);
return new SolidPublishedContent(contentType)
{
Id = 1234,
Key = Guid.NewGuid(),
Properties = new[]
{
new SolidPublishedProperty
{
Alias = "umbracoFile",
SolidSourceValue = propertyValue,
SolidHasValue = true,
PropertyType = umbracoFilePropertyType
}
}
};
}
private static PublishedPropertyType CreatePropertyType(string propertyEditorAlias, object dataTypeConfiguration, ContentVariation variation)
{
var uploadDataType = new PublishedDataType(1234, propertyEditorAlias, new Lazy<object>(() => dataTypeConfiguration));
var propertyValueConverters = new PropertyValueConverterCollection(new IPropertyValueConverter[]
{
new UploadPropertyConverter(),
new ImageCropperValueConverter(Mock.Of<ILogger<ImageCropperValueConverter>>()),
});
var publishedModelFactory = Mock.Of<IPublishedModelFactory>();
var publishedContentTypeFactory = new Mock<IPublishedContentTypeFactory>();
publishedContentTypeFactory.Setup(x => x.GetDataType(It.IsAny<int>()))
.Returns(uploadDataType);
return new PublishedPropertyType("umbracoFile", 42, true, variation, propertyValueConverters, publishedModelFactory, publishedContentTypeFactory.Object);
}
}
}
-199
View File
@@ -1,199 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{5D3B8245-ADA6-453F-A008-50ED04BFE770}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Umbraco.Tests</RootNamespace>
<AssemblyName>Umbraco.Tests</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile />
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>8</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Data.Entity.Design" />
<Reference Include="System.Drawing" />
<Reference Include="System.IO" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.IO.Compression.FileSystem" />
<Reference Include="System.Runtime.Caching" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Text.Encoding" />
<Reference Include="System.Web" />
<Reference Include="System.Web.ApplicationServices" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Web.Services" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Castle.Core" Version="4.4.1" />
<PackageReference Include="Examine.Core">
<Version>2.0.0</Version>
</PackageReference>
<PackageReference Include="Castle.Core" Version="4.3.1" />
<PackageReference Include="Examine" Version="2.0.0" />
<PackageReference Include="HtmlAgilityPack">
<Version>1.11.31</Version>
</PackageReference>
<PackageReference Include="Lucene.Net.Contrib" Version="3.0.3" />
<PackageReference Include="Microsoft.AspNet.Identity.Core" Version="2.2.3" />
<PackageReference Include="Microsoft.AspNet.Mvc" Version="5.2.7" />
<PackageReference Include="Microsoft.AspNet.WebApi" Version="5.2.7" />
<PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="5.2.7" />
<PackageReference Include="Microsoft.AspNet.WebApi.Owin" Version="5.2.7" />
<PackageReference Include="Microsoft.AspNet.WebApi.SelfHost" Version="5.2.7" />
<PackageReference Include="Microsoft.AspNet.WebApi.Tracing" Version="5.2.7" />
<PackageReference Include="Microsoft.AspNet.WebApi.WebHost" Version="5.2.7" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions">
<Version>5.0.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Logging" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console">
<Version>5.0.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="5.0.0" />
<PackageReference Include="Microsoft.Owin" Version="4.1.1" />
<PackageReference Include="Microsoft.Owin.Hosting" Version="4.1.1" />
<PackageReference Include="Microsoft.Owin.Security" Version="4.1.1" />
<PackageReference Include="Microsoft.Owin.Testing" Version="4.1.1" />
<PackageReference Include="Microsoft.Web.Infrastructure" Version="1.0.0.0" />
<PackageReference Include="MiniProfiler" Version="4.2.22" />
<PackageReference Include="Moq" Version="4.16.1" />
<PackageReference Include="NUnit" Version="3.13.1" />
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="MiniProfiler" Version="4.0.138" />
<PackageReference Include="Moq" Version="4.10.1" />
<PackageReference Include="Moq" Version="4.14.5" />
<PackageReference Include="NPoco" Version="3.9.4" />
<PackageReference Include="NUnit" Version="3.11.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.12.0" />
<PackageReference Include="NPoco" Version="4.0.3" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
<PackageReference Include="Owin" Version="1.0" />
<PackageReference Include="Selenium.WebDriver" Version="3.141.0" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="5.0.0" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageReference Include="System.Data.SqlClient" Version="4.8.2" />
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.4" />
<PackageReference Include="Umbraco.SqlServerCE" Version="4.0.0.1" />
</ItemGroup>
<ItemGroup>
<Compile Include="Published\ModelTypeTests.cs" />
<Compile Include="Routing\BaseUrlProviderTest.cs" />
<Compile Include="Routing\MediaUrlProviderTests.cs" />
<Compile Include="Scoping\ScopedNuCacheTests.cs" />
<Compile Include="Web\Controllers\AuthenticationControllerTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config">
<SubType>Designer</SubType>
</None>
<None Include="unit-test-logger.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Umbraco.Core\Umbraco.Core.csproj">
<Project>{29aa69d9-b597-4395-8d42-43b1263c240a}</Project>
<Name>Umbraco.Core</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\Umbraco.Examine.Lucene\Umbraco.Examine.Lucene.csproj">
<Project>{0fad7d2a-d7dd-45b1-91fd-488bb6cdacea}</Project>
<Name>Umbraco.Examine.Lucene</Name>
</ProjectReference>
<ProjectReference Include="...\..\srcUmbraco.Infrastructure\Umbraco.Infrastructure.csproj">
<Project>{3ae7bf57-966b-45a5-910a-954d7c554441}</Project>
<Name>Umbraco.Infrastructure</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\Umbraco.Persistence.SqlCe\Umbraco.Persistence.SqlCe.csproj">
<Project>{33085570-9bf2-4065-a9b0-a29d920d13ba}</Project>
<Name>Umbraco.Persistence.SqlCe</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\Umbraco.PublishedCache.NuCache\Umbraco.PublishedCache.NuCache.csproj">
<Project>{f6de8da0-07cc-4ef2-8a59-2bc81dbb3830}</Project>
<Name>Umbraco.PublishedCache.NuCache</Name>
</ProjectReference>
<ProjectReference Include="..\Umbraco.Tests.Common\Umbraco.Tests.Common.csproj">
<Project>{a499779c-1b3b-48a8-b551-458e582e6e96}</Project>
<Name>Umbraco.Tests.Common</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\Umbraco.Web\Umbraco.Web.csproj">
<Project>{651E1350-91B6-44B7-BD60-7207006D7003}</Project>
<Name>Umbraco.Web</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<ItemGroup />
<!-- get NuGet packages directory -->
<PropertyGroup>
<NuGetPackages>$(NuGetPackageFolders.Split(';')[0])</NuGetPackages>
</PropertyGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="BeforeBuild">
<Message Text="-BeforeBuild-" Importance="high" />
<Message Text="MSBuildExtensionsPath: $(MSBuildExtensionsPath)" Importance="high" />
<Message Text="WebPublishingTasks: $(WebPublishingTasks)" Importance="high" />
<Message Text="NuGetPackageFolders: $(NuGetPackageFolders)" Importance="high" />
<Message Text="NuGetPackages: $(NuGetPackages)" Importance="high" />
</Target>
</Project>
@@ -1,122 +0,0 @@
using Moq;
using NUnit.Framework;
using Umbraco.Cms.Core.Features;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Tests.Common.Testing;
using Umbraco.Extensions;
using Umbraco.Tests.TestHelpers;
using Umbraco.Tests.Testing;
namespace Umbraco.Tests.Web.Controllers
{
[TestFixture]
[UmbracoTest(Database = UmbracoTestOptions.Database.None)]
public class AuthenticationControllerTests : TestWithDatabaseBase
{
protected override void ComposeApplication(bool withApplication)
{
base.ComposeApplication(withApplication);
//if (!withApplication) return;
// replace the true IUserService implementation with a mock
// so that each test can configure the service to their liking
Builder.Services.AddUnique(f => Mock.Of<IUserService>());
// kill the true IEntityService too
Builder.Services.AddUnique(f => Mock.Of<IEntityService>());
Builder.Services.AddUnique<UmbracoFeatures>();
}
// TODO Reintroduce when moved to .NET Core
// [Test]
// public async System.Threading.Tasks.Task GetCurrentUser_Fips()
// {
// ApiController CtrlFactory(HttpRequestMessage message, IUmbracoContextAccessor umbracoContextAccessor)
// {
// //setup some mocks
// var userServiceMock = Mock.Get(ServiceContext.UserService);
// userServiceMock.Setup(service => service.GetUserById(It.IsAny<int>()))
// .Returns(() => null);
//
// if (Thread.GetDomain().GetData(".appPath") != null)
// {
// HttpContext.Current = new HttpContext(new SimpleWorkerRequest("", "", new StringWriter()));
// }
// else
// {
// var baseDir = IOHelper.MapPath("").TrimEnd(Path.DirectorySeparatorChar);
// HttpContext.Current = new HttpContext(new SimpleWorkerRequest("/", baseDir, "", "", new StringWriter()));
// }
//
// var usersController = new AuthenticationController(
// new TestUserPasswordConfig(),
// Factory.GetInstance<IGlobalSettings>(),
// Factory.GetInstance<IHostingEnvironment>(),
// umbracoContextAccessor,
// Factory.GetInstance<ISqlContext>(),
// Factory.GetInstance<ServiceContext>(),
// Factory.GetInstance<AppCaches>(),
// Factory.GetInstance<IProfilingLogger>(),
// Factory.GetInstance<IRuntimeState>(),
// Factory.GetInstance<UmbracoMapper>(),
// Factory.GetInstance<ISecuritySettings>(),
// Factory.GetInstance<IPublishedUrlProvider>(),
// Factory.GetInstance<IRequestAccessor>(),
// Factory.GetInstance<IEmailSender>()
// );
// return usersController;
// }
//
// Mock.Get(Current.SqlContext)
// .Setup(x => x.Query<IUser>())
// .Returns(new Query<IUser>(Current.SqlContext));
//
// var syntax = new SqlCeSyntaxProvider();
//
// Mock.Get(Current.SqlContext)
// .Setup(x => x.SqlSyntax)
// .Returns(syntax);
//
// var mappers = new MapperCollection(new[]
// {
// new UserMapper(new Lazy<ISqlContext>(() => Current.SqlContext), new ConcurrentDictionary<Type, ConcurrentDictionary<string, string>>())
// });
//
// Mock.Get(Current.SqlContext)
// .Setup(x => x.Mappers)
// .Returns(mappers);
//
// // Testing what happens if the system were configured to only use FIPS-compliant algorithms
// var typ = typeof(CryptoConfig);
// var flds = typ.GetFields(BindingFlags.Static | BindingFlags.NonPublic);
// var haveFld = flds.FirstOrDefault(f => f.Name == "s_haveFipsAlgorithmPolicy");
// var isFld = flds.FirstOrDefault(f => f.Name == "s_fipsAlgorithmPolicy");
// var originalFipsValue = CryptoConfig.AllowOnlyFipsAlgorithms;
//
// try
// {
// if (!originalFipsValue)
// {
// haveFld.SetValue(null, true);
// isFld.SetValue(null, true);
// }
//
// var runner = new TestRunner(CtrlFactory);
// var response = await runner.Execute("Authentication", "GetCurrentUser", HttpMethod.Get);
//
// var obj = JsonConvert.DeserializeObject<UserDetail>(response.Item2);
// Assert.AreEqual(-1, obj.UserId);
// }
// finally
// {
// if (!originalFipsValue)
// {
// haveFld.SetValue(null, false);
// isFld.SetValue(null, false);
// }
// }
// }
}
}
@@ -1,6 +0,0 @@
<?xml version="1.0"?>
<log4net>
<root>
<priority value="OFF"/>
</root>
</log4net>
@@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<!-- Global Log Level event -->
<add key="serilog:minimum-level" value="Warning" />
<!-- Write to console -->
<add key="serilog:using:Console" value="Serilog.Sinks.Console" />
<add key="serilog:write-to:Console.theme" value="Serilog.Sinks.SystemConsole.Themes.AnsiConsoleTheme::Code, Serilog.Sinks.Console" />
<add key="serilog:write-to:Console.outputTemplate" value="[{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj} &lt;s:{SourceContext}&gt;{NewLine}{Exception}" />
<!-- Namespace log levels -->
<add key="serilog:minimum-level:override:Umbraco.Core.Publishing.PublishingStrategy" value="Warning" />
<add key="serilog:minimum-level:override:Umbraco.Core.TypeLoader" value="Warning" />
<add key="serilog:minimum-level:override:Umbraco.Core.Persistence.UmbracoDatabase" value="Debug" />
<add key="serilog:minimum-level:override:Umbraco.Core.Persistence.Migrations.Initial.DatabaseSchemaCreation" value="Warning" />
<add key="serilog:minimum-level:override:Umbraco.Core.Persistence.Migrations.Initial.BaseDataCreation" value="Warning" />
</appSettings>
</configuration>
@@ -2,7 +2,12 @@
<configuration>
<packageSources>
<clear />
<add key="local" value="./nupkg" />
<add key="nuget" value="https://api.nuget.org/v3/index.json" />
</packageSources>
<packageSourceMapping>
<!-- Ensure all packages are pulled from NuGet -->
<packageSource key="nuget">
<package pattern="*" />
</packageSource>
</packageSourceMapping>
</configuration>
@@ -6,18 +6,25 @@ using Microsoft.Extensions.Options;
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.SwaggerGen;
using Umbraco.Cms.Api.Common.OpenApi;
using Umbraco.Cms.Core.Models.DeliveryApi;
using Umbraco.Extensions;
using OperationIdRegexes = Umbraco.Cms.Api.Common.OpenApi.OperationIdRegexes;
namespace Umbraco.Cms.Api.Common.Configuration;
public class ConfigureUmbracoSwaggerGenOptions : IConfigureOptions<SwaggerGenOptions>
{
private readonly IOptions<ApiVersioningOptions> _apiVersioningOptions;
private readonly IOperationIdSelector _operationIdSelector;
private readonly ISchemaIdSelector _schemaIdSelector;
public ConfigureUmbracoSwaggerGenOptions(IOptions<ApiVersioningOptions> apiVersioningOptions)
=> _apiVersioningOptions = apiVersioningOptions;
public ConfigureUmbracoSwaggerGenOptions(
IOptions<ApiVersioningOptions> apiVersioningOptions,
IOperationIdSelector operationIdSelector,
ISchemaIdSelector schemaIdSelector)
{
_apiVersioningOptions = apiVersioningOptions;
_operationIdSelector = operationIdSelector;
_schemaIdSelector = schemaIdSelector;
}
public void Configure(SwaggerGenOptions swaggerGenOptions)
{
@@ -30,9 +37,7 @@ public class ConfigureUmbracoSwaggerGenOptions : IConfigureOptions<SwaggerGenOpt
Description = "All endpoints not defined under specific APIs"
});
swaggerGenOptions.CustomOperationIds(description =>
CustomOperationId(description, _apiVersioningOptions.Value));
swaggerGenOptions.CustomOperationIds(description => _operationIdSelector.OperationId(description, _apiVersioningOptions.Value));
swaggerGenOptions.DocInclusionPredicate((name, api) =>
{
if (string.IsNullOrWhiteSpace(api.GroupName))
@@ -43,97 +48,18 @@ public class ConfigureUmbracoSwaggerGenOptions : IConfigureOptions<SwaggerGenOpt
if (api.ActionDescriptor is ControllerActionDescriptor controllerActionDescriptor)
{
return controllerActionDescriptor.MethodInfo.HasMapToApiAttribute(name);
}
return false;
});
swaggerGenOptions.TagActionsBy(api => new[] { api.GroupName });
swaggerGenOptions.OrderActionsBy(ActionOrderBy);
swaggerGenOptions.DocumentFilter<MimeTypeDocumentFilter>();
swaggerGenOptions.SchemaFilter<EnumSchemaFilter>();
swaggerGenOptions.CustomSchemaIds(SchemaIdGenerator.Generate);
swaggerGenOptions.CustomSchemaIds(_schemaIdSelector.SchemaId);
swaggerGenOptions.SupportNonNullableReferenceTypes();
swaggerGenOptions.UseOneOfForPolymorphism();
swaggerGenOptions.UseAllOfForInheritance();
var cachedApiElementNamespace = typeof(ApiElement).Namespace ?? string.Empty;
swaggerGenOptions.SelectDiscriminatorNameUsing(type =>
{
if (type.Namespace != null && type.Namespace.StartsWith(cachedApiElementNamespace))
{
// We do not show type on delivery, as it is read only.
return null;
}
if (type.GetInterfaces().Any())
{
return "$type";
}
return null;
});
swaggerGenOptions.SelectDiscriminatorValueUsing(x => x.Name);
}
private static string CustomOperationId(ApiDescription api, ApiVersioningOptions apiVersioningOptions)
{
ApiVersion defaultVersion = apiVersioningOptions.DefaultApiVersion;
var httpMethod = api.HttpMethod?.ToLower().ToFirstUpper() ?? "Get";
// if the route info "Name" is supplied we'll use this explicitly as the operation ID
// - usage example: [HttpGet("my-api/route}", Name = "MyCustomRoute")]
if (string.IsNullOrWhiteSpace(api.ActionDescriptor.AttributeRouteInfo?.Name) == false)
{
var explicitOperationId = api.ActionDescriptor.AttributeRouteInfo!.Name;
return explicitOperationId.InvariantStartsWith(httpMethod)
? explicitOperationId
: $"{httpMethod}{explicitOperationId}";
}
var relativePath = api.RelativePath;
if (string.IsNullOrWhiteSpace(relativePath))
{
throw new Exception(
$"There is no relative path for controller action {api.ActionDescriptor.RouteValues["controller"]}");
}
// Remove the prefixed base path with version, e.g. /umbraco/management/api/v1/tracked-reference/{id} => tracked-reference/{id}
var unprefixedRelativePath = OperationIdRegexes
.VersionPrefixRegex()
.Replace(relativePath, string.Empty);
// Remove template placeholders, e.g. tracked-reference/{id} => tracked-reference/Id
var formattedOperationId = OperationIdRegexes
.TemplatePlaceholdersRegex()
.Replace(unprefixedRelativePath, m => $"By{m.Groups[1].Value.ToFirstUpper()}");
// Remove dashes (-) and slashes (/) and convert the following letter to uppercase with
// the word "By" in front, e.g. tracked-reference/Id => TrackedReferenceById
formattedOperationId = OperationIdRegexes
.ToCamelCaseRegex()
.Replace(formattedOperationId, m => m.Groups[1].Value.ToUpper());
//Get map to version attribute
string? version = null;
if (api.ActionDescriptor is ControllerActionDescriptor controllerActionDescriptor)
{
var versionAttributeValue = controllerActionDescriptor.MethodInfo.GetMapToApiVersionAttributeValue();
// We only wanna add a version, if it is not the default one.
if (string.Equals(versionAttributeValue, defaultVersion.ToString()) == false)
{
version = versionAttributeValue;
}
}
// Return the operation ID with the formatted http method verb in front, e.g. GetTrackedReferenceById
return $"{httpMethod}{formattedOperationId.ToFirstUpper()}{version}";
}
// see https://github.com/domaindrivendev/Swashbuckle.AspNetCore#change-operation-sort-order-eg-for-ui-sorting
private static string ActionOrderBy(ApiDescription apiDesc)
=> $"{apiDesc.GroupName}_{apiDesc.ActionDescriptor.AttributeRouteInfo?.Template ?? apiDesc.ActionDescriptor.RouteValues["controller"]}_{apiDesc.ActionDescriptor.RouteValues["action"]}_{apiDesc.HttpMethod}";
}
@@ -1,20 +1,9 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.FileProviders;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Options;
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.SwaggerGen;
using Umbraco.Cms.Api.Common.Configuration;
using Umbraco.Cms.Api.Common.OpenApi;
using Umbraco.Cms.Api.Common.Serialization;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Cms.Core.DependencyInjection;
using Umbraco.Cms.Web.Common.ApplicationBuilder;
using Umbraco.Extensions;
using IHostingEnvironment = Umbraco.Cms.Core.Hosting.IHostingEnvironment;
namespace Umbraco.Cms.Api.Common.DependencyInjection;
@@ -25,50 +14,9 @@ public static class UmbracoBuilderApiExtensions
builder.Services.AddSwaggerGen();
builder.Services.ConfigureOptions<ConfigureUmbracoSwaggerGenOptions>();
builder.Services.AddSingleton<IUmbracoJsonTypeInfoResolver, UmbracoJsonTypeInfoResolver>();
builder.Services.Configure<UmbracoPipelineOptions>(options =>
{
options.AddFilter(new UmbracoPipelineFilter(
"UmbracoApiCommon",
applicationBuilder =>
{
},
applicationBuilder =>
{
IServiceProvider provider = applicationBuilder.ApplicationServices;
IWebHostEnvironment webHostEnvironment = provider.GetRequiredService<IWebHostEnvironment>();
IOptions<SwaggerGenOptions> swaggerGenOptions = provider.GetRequiredService<IOptions<SwaggerGenOptions>>();
if (!webHostEnvironment.IsProduction())
{
GlobalSettings? settings = provider.GetRequiredService<IOptions<GlobalSettings>>().Value;
IHostingEnvironment hostingEnvironment = provider.GetRequiredService<IHostingEnvironment>();
var umbracoPath = settings.GetBackOfficePath(hostingEnvironment);
applicationBuilder.UseSwagger(swaggerOptions =>
{
swaggerOptions.RouteTemplate =
$"{umbracoPath.TrimStart(Constants.CharArrays.ForwardSlash)}/swagger/{{documentName}}/swagger.json";
});
applicationBuilder.UseSwaggerUI(
swaggerUiOptions =>
{
swaggerUiOptions.RoutePrefix = $"{umbracoPath.TrimStart(Constants.CharArrays.ForwardSlash)}/swagger";
foreach ((var name, OpenApiInfo? apiInfo) in swaggerGenOptions.Value.SwaggerGeneratorOptions.SwaggerDocs.OrderBy(x=>x.Value.Title))
{
swaggerUiOptions.SwaggerEndpoint($"{name}/swagger.json", $"{apiInfo.Title}");
}
});
}
},
applicationBuilder =>
{
}));
});
builder.Services.AddSingleton<IOperationIdSelector, OperationIdSelector>();
builder.Services.AddSingleton<ISchemaIdSelector, SchemaIdSelector>();
builder.Services.Configure<UmbracoPipelineOptions>(options => options.AddFilter(new SwaggerRouteTemplatePipelineFilter("UmbracoApiCommon")));
return builder;
}
@@ -0,0 +1,109 @@
using System.Security.Cryptography;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.IdentityModel.Tokens;
using Umbraco.Cms.Api.Common.Security;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.DependencyInjection;
using Umbraco.Cms.Infrastructure.HostedServices;
namespace Umbraco.Cms.Api.Common.DependencyInjection;
public static class UmbracoBuilderAuthExtensions
{
private static bool _initialized;
public static IUmbracoBuilder AddUmbracoOpenIddict(this IUmbracoBuilder builder)
{
if (_initialized is false)
{
ConfigureOpenIddict(builder);
_initialized = true;
}
return builder;
}
private static void ConfigureOpenIddict(IUmbracoBuilder builder)
{
builder.Services.AddOpenIddict()
// Register the OpenIddict server components.
.AddServer(options =>
{
// Enable the authorization and token endpoints.
// - important: member endpoints MUST be added before backoffice endpoints to ensure that auto-discovery works for members
// FIXME: swap paths here so member API is first (see comment above)
options
.SetAuthorizationEndpointUris(
Paths.MemberApi.AuthorizationEndpoint.TrimStart(Constants.CharArrays.ForwardSlash))
.SetTokenEndpointUris(
Paths.MemberApi.TokenEndpoint.TrimStart(Constants.CharArrays.ForwardSlash))
.SetLogoutEndpointUris(
Paths.MemberApi.LogoutEndpoint.TrimStart(Constants.CharArrays.ForwardSlash))
.SetRevocationEndpointUris(
Paths.MemberApi.RevokeEndpoint.TrimStart(Constants.CharArrays.ForwardSlash))
.SetUserinfoEndpointUris(
Paths.MemberApi.UserinfoEndpoint.TrimStart(Constants.CharArrays.ForwardSlash));
// Enable authorization code flow with PKCE
options
.AllowAuthorizationCodeFlow()
.RequireProofKeyForCodeExchange()
.AllowRefreshTokenFlow();
// Register the ASP.NET Core host and configure for custom authentication endpoint.
options
.UseAspNetCore()
.EnableAuthorizationEndpointPassthrough()
.EnableLogoutEndpointPassthrough()
.EnableUserinfoEndpointPassthrough();
// Enable reference tokens
// - see https://documentation.openiddict.com/configuration/token-storage.html
options
.UseReferenceAccessTokens()
.UseReferenceRefreshTokens();
// Use ASP.NET Core Data Protection for tokens instead of JWT.
// This is more secure, and has the added benefit of having a high throughput
// but means that all servers (such as in a load balanced setup)
// needs to use the same application name and key ring,
// however this is already recommended for load balancing, so should be fine.
// See https://documentation.openiddict.com/configuration/token-formats.html#switching-to-data-protection-tokens
// and https://learn.microsoft.com/en-us/aspnet/core/security/data-protection/configuration/overview?view=aspnetcore-7.0
// for more information
options.UseDataProtection();
// Register encryption and signing credentials to protect tokens.
// Note that for tokens generated/validated using ASP.NET Core Data Protection,
// a separate key ring is used, distinct from the credentials discussed in
// https://documentation.openiddict.com/configuration/encryption-and-signing-credentials.html
// More details can be found here: https://github.com/openiddict/openiddict-core/issues/1892#issuecomment-1737308506
// "When using ASP.NET Core Data Protection to generate opaque tokens, the signing and encryption credentials
// registered via Add*Key/Certificate() are not used". But since OpenIddict requires the registration of such,
// we can generate random keys per instance without them taking effect.
// - see also https://github.com/openiddict/openiddict-core/issues/1231
options
.AddEncryptionKey(new SymmetricSecurityKey(RandomNumberGenerator.GetBytes(32))) // generate a cryptographically secure random 256-bits key
.AddSigningKey(new RsaSecurityKey(RSA.Create(keySizeInBits: 2048))); // generate RSA key with recommended size of 2048-bits
})
// Register the OpenIddict validation components.
.AddValidation(options =>
{
// Import the configuration from the local OpenIddict server instance.
options.UseLocalServer();
// Register the ASP.NET Core host.
options.UseAspNetCore();
// Enable token entry validation
// - see https://documentation.openiddict.com/configuration/token-storage.html#enabling-token-entry-validation-at-the-api-level
options.EnableTokenEntryValidation();
// Use ASP.NET Core Data Protection for tokens instead of JWT. (see note in AddServer)
options.UseDataProtection();
});
builder.Services.AddHostedService<OpenIddictCleanup>();
}
}
@@ -12,6 +12,8 @@ public class EnumSchemaFilter : ISchemaFilter
{
if (context.Type.IsEnum)
{
model.Type = "string";
model.Format = null;
model.Enum.Clear();
foreach (var name in Enum.GetNames(context.Type))
{
@@ -0,0 +1,9 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Mvc.ApiExplorer;
namespace Umbraco.Cms.Api.Common.OpenApi;
public interface IOperationIdSelector
{
string? OperationId(ApiDescription apiDescription, ApiVersioningOptions apiVersioningOptions);
}
@@ -0,0 +1,6 @@
namespace Umbraco.Cms.Api.Common.OpenApi;
public interface ISchemaIdSelector
{
string SchemaId(Type type);
}
@@ -5,12 +5,21 @@ using Umbraco.Extensions;
namespace Umbraco.Cms.Api.Common.OpenApi;
/// <summary>
/// This filter explicitly removes all other mime types than application/json from the produced OpenAPI document when application/json is accepted.
/// This filter explicitly removes all other mime types than application/json from a named OpenAPI document when application/json is accepted.
/// </summary>
public class MimeTypeDocumentFilter : IDocumentFilter
{
private readonly string _documentName;
public MimeTypeDocumentFilter(string documentName) => _documentName = documentName;
public void Apply(OpenApiDocument swaggerDoc, DocumentFilterContext context)
{
if (context.DocumentName != _documentName)
{
return;
}
OpenApiOperation[] operations = swaggerDoc.Paths
.SelectMany(path => path.Value.Operations.Values)
.ToArray();
@@ -0,0 +1,79 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Mvc.ApiExplorer;
using Microsoft.AspNetCore.Mvc.Controllers;
using Umbraco.Extensions;
namespace Umbraco.Cms.Api.Common.OpenApi;
public class OperationIdSelector : IOperationIdSelector
{
public virtual string? OperationId(ApiDescription apiDescription, ApiVersioningOptions apiVersioningOptions)
{
if (apiDescription.ActionDescriptor is not ControllerActionDescriptor controllerActionDescriptor
|| controllerActionDescriptor.ControllerTypeInfo.Namespace?.StartsWith("Umbraco.Cms.Api") is not true)
{
return null;
}
return UmbracoOperationId(apiDescription, apiVersioningOptions);
}
protected string? UmbracoOperationId(ApiDescription apiDescription, ApiVersioningOptions apiVersioningOptions)
{
if (apiDescription.ActionDescriptor is not ControllerActionDescriptor controllerActionDescriptor)
{
return null;
}
ApiVersion defaultVersion = apiVersioningOptions.DefaultApiVersion;
var httpMethod = apiDescription.HttpMethod?.ToLower().ToFirstUpper() ?? "Get";
// if the route info "Name" is supplied we'll use this explicitly as the operation ID
// - usage example: [HttpGet("my-api/route}", Name = "MyCustomRoute")]
if (string.IsNullOrWhiteSpace(apiDescription.ActionDescriptor.AttributeRouteInfo?.Name) == false)
{
var explicitOperationId = apiDescription.ActionDescriptor.AttributeRouteInfo!.Name;
return explicitOperationId.InvariantStartsWith(httpMethod)
? explicitOperationId
: $"{httpMethod}{explicitOperationId}";
}
var relativePath = apiDescription.RelativePath;
if (string.IsNullOrWhiteSpace(relativePath))
{
throw new Exception(
$"There is no relative path for controller action {apiDescription.ActionDescriptor.RouteValues["controller"]}");
}
// Remove the prefixed base path with version, e.g. /umbraco/management/api/v1/tracked-reference/{id} => tracked-reference/{id}
var unprefixedRelativePath = OperationIdRegexes
.VersionPrefixRegex()
.Replace(relativePath, string.Empty);
// Remove template placeholders, e.g. tracked-reference/{id} => tracked-reference/Id
var formattedOperationId = OperationIdRegexes
.TemplatePlaceholdersRegex()
.Replace(unprefixedRelativePath, m => $"By{m.Groups[1].Value.ToFirstUpper()}");
// Remove dashes (-) and slashes (/) and convert the following letter to uppercase with
// the word "By" in front, e.g. tracked-reference/Id => TrackedReferenceById
formattedOperationId = OperationIdRegexes
.ToCamelCaseRegex()
.Replace(formattedOperationId, m => m.Groups[1].Value.ToUpper());
//Get map to version attribute
string? version = null;
var versionAttributeValue = controllerActionDescriptor.MethodInfo.GetMapToApiVersionAttributeValue();
// We only wanna add a version, if it is not the default one.
if (string.Equals(versionAttributeValue, defaultVersion.ToString()) == false)
{
version = versionAttributeValue;
}
// Return the operation ID with the formatted http method verb in front, e.g. GetTrackedReferenceById
return $"{httpMethod}{formattedOperationId.ToFirstUpper()}{version}";
}
}
@@ -3,9 +3,12 @@ using Umbraco.Extensions;
namespace Umbraco.Cms.Api.Common.OpenApi;
internal static class SchemaIdGenerator
public class SchemaIdSelector : ISchemaIdSelector
{
public static string Generate(Type type)
public virtual string SchemaId(Type type)
=> type.Namespace?.StartsWith("Umbraco.Cms") is true ? UmbracoSchemaId(type) : type.Name;
protected string UmbracoSchemaId(Type type)
{
string SanitizedTypeName(Type t) => t.Name
// first grab the "non generic" part of any generic type name (i.e. "PagedViewModel`1" becomes "PagedViewModel")
@@ -0,0 +1,75 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Options;
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.SwaggerGen;
using Swashbuckle.AspNetCore.SwaggerUI;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Cms.Web.Common.ApplicationBuilder;
using Umbraco.Extensions;
using IHostingEnvironment = Umbraco.Cms.Core.Hosting.IHostingEnvironment;
namespace Umbraco.Cms.Api.Common.OpenApi;
public class SwaggerRouteTemplatePipelineFilter : UmbracoPipelineFilter
{
public SwaggerRouteTemplatePipelineFilter(string name)
: base(name)
=> PostPipeline = PostPipelineAction;
private void PostPipelineAction(IApplicationBuilder applicationBuilder)
{
if (SwaggerIsEnabled(applicationBuilder) is false)
{
return;
}
IOptions<SwaggerGenOptions> swaggerGenOptions = applicationBuilder.ApplicationServices.GetRequiredService<IOptions<SwaggerGenOptions>>();
applicationBuilder.UseSwagger(swaggerOptions =>
{
swaggerOptions.RouteTemplate = SwaggerRouteTemplate(applicationBuilder);
});
applicationBuilder.UseSwaggerUI(swaggerUiOptions => SwaggerUiConfiguration(swaggerUiOptions, swaggerGenOptions.Value, applicationBuilder));
}
protected virtual bool SwaggerIsEnabled(IApplicationBuilder applicationBuilder)
{
IWebHostEnvironment webHostEnvironment = applicationBuilder.ApplicationServices.GetRequiredService<IWebHostEnvironment>();
return webHostEnvironment.IsProduction() is false;
}
protected virtual string SwaggerRouteTemplate(IApplicationBuilder applicationBuilder)
=> $"{GetUmbracoPath(applicationBuilder).TrimStart(Constants.CharArrays.ForwardSlash)}/swagger/{{documentName}}/swagger.json";
protected virtual string SwaggerUiRoutePrefix(IApplicationBuilder applicationBuilder)
=> $"{GetUmbracoPath(applicationBuilder).TrimStart(Constants.CharArrays.ForwardSlash)}/swagger";
protected virtual void SwaggerUiConfiguration(
SwaggerUIOptions swaggerUiOptions,
SwaggerGenOptions swaggerGenOptions,
IApplicationBuilder applicationBuilder)
{
swaggerUiOptions.RoutePrefix = SwaggerUiRoutePrefix(applicationBuilder);
foreach ((var name, OpenApiInfo? apiInfo) in swaggerGenOptions.SwaggerGeneratorOptions.SwaggerDocs
.OrderBy(x => x.Value.Title))
{
swaggerUiOptions.SwaggerEndpoint($"{name}/swagger.json", $"{apiInfo.Title}");
}
swaggerUiOptions.OAuthUsePkce();
}
private string GetUmbracoPath(IApplicationBuilder applicationBuilder)
{
GlobalSettings settings = applicationBuilder.ApplicationServices.GetRequiredService<IOptions<GlobalSettings>>().Value;
IHostingEnvironment hostingEnvironment = applicationBuilder.ApplicationServices.GetRequiredService<IHostingEnvironment>();
return settings.GetBackOfficePath(hostingEnvironment);
}
}
@@ -0,0 +1,22 @@
namespace Umbraco.Cms.Api.Common.Security;
public static class Paths
{
public static class MemberApi
{
public const string EndpointTemplate = "security/member";
public static readonly string AuthorizationEndpoint = EndpointPath($"{EndpointTemplate}/authorize");
public static readonly string TokenEndpoint = EndpointPath($"{EndpointTemplate}/token");
public static readonly string LogoutEndpoint = EndpointPath($"{EndpointTemplate}/signout");
public static readonly string RevokeEndpoint = EndpointPath($"{EndpointTemplate}/revoke");
public static readonly string UserinfoEndpoint = EndpointPath($"{EndpointTemplate}/userinfo");
// NOTE: we're NOT using /api/v1.0/ here because it will clash with the Delivery API docs
private static string EndpointPath(string relativePath) => $"/umbraco/delivery/api/v1/{relativePath}";
}
}
@@ -2,17 +2,24 @@
<PropertyGroup>
<Title>Umbraco CMS - API Common</Title>
<Description>Contains the bits and pieces that are shared between the Umbraco CMS APIs.</Description>
<IsPackable>true</IsPackable>
<EnablePackageValidation>false</EnablePackageValidation>
<AssemblyName>Umbraco.Cms.Api.Common</AssemblyName>
<RootNamespace>Umbraco.Cms.Api.Common</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.2.8" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
<PackageReference Include="OpenIddict.Abstractions" Version="4.2.0" />
<PackageReference Include="OpenIddict.AspNetCore" Version="4.2.0" />
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Swashbuckle.AspNetCore" />
<PackageReference Include="OpenIddict.Abstractions" />
<PackageReference Include="OpenIddict.AspNetCore" />
<!-- Both OpenIddict.AspNetCore, Npoco.SqlServer and Microsoft.EntityFrameworkCore.SqlServer bring in a vulnerable version of Microsoft.IdentityModel.JsonWebTokens -->
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens"/>
<!-- Take top-level depedendency on OpenIddict.AspNetCore depends on a vulnerable version -->
<PackageReference Include="Microsoft.Extensions.Caching.Memory" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Umbraco.Core\Umbraco.Core.csproj" />
<ProjectReference Include="..\Umbraco.Web.Common\Umbraco.Web.Common.csproj" />
@@ -0,0 +1,43 @@
using Microsoft.AspNetCore.OutputCaching;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Primitives;
using Umbraco.Cms.Core.DeliveryApi;
namespace Umbraco.Cms.Api.Delivery.Caching;
internal sealed class DeliveryApiOutputCachePolicy : IOutputCachePolicy
{
private readonly TimeSpan _duration;
private readonly StringValues _varyByHeaderNames;
public DeliveryApiOutputCachePolicy(TimeSpan duration, StringValues varyByHeaderNames)
{
_duration = duration;
_varyByHeaderNames = varyByHeaderNames;
}
ValueTask IOutputCachePolicy.CacheRequestAsync(OutputCacheContext context, CancellationToken cancellationToken)
{
IRequestPreviewService requestPreviewService = context
.HttpContext
.RequestServices
.GetRequiredService<IRequestPreviewService>();
IApiAccessService apiAccessService = context
.HttpContext
.RequestServices
.GetRequiredService<IApiAccessService>();
context.EnableOutputCaching = requestPreviewService.IsPreview() is false && apiAccessService.HasPublicAccess();
context.ResponseExpirationTimeSpan = _duration;
context.CacheVaryByRules.HeaderNames = _varyByHeaderNames;
return ValueTask.CompletedTask;
}
ValueTask IOutputCachePolicy.ServeFromCacheAsync(OutputCacheContext context, CancellationToken cancellationToken)
=> ValueTask.CompletedTask;
ValueTask IOutputCachePolicy.ServeResponseAsync(OutputCacheContext context, CancellationToken cancellationToken)
=> ValueTask.CompletedTask;
}
@@ -0,0 +1,14 @@
using Microsoft.AspNetCore.Builder;
using Umbraco.Cms.Web.Common.ApplicationBuilder;
namespace Umbraco.Cms.Api.Delivery.Caching;
internal sealed class OutputCachePipelineFilter : UmbracoPipelineFilter
{
public OutputCachePipelineFilter(string name)
: base(name)
=> PostPipeline = PostPipelineAction;
private void PostPipelineAction(IApplicationBuilder applicationBuilder)
=> applicationBuilder.UseOutputCache();
}
@@ -2,6 +2,8 @@ using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.SwaggerGen;
using Umbraco.Cms.Api.Common.OpenApi;
using Umbraco.Cms.Api.Delivery.Filters;
namespace Umbraco.Cms.Api.Delivery.Configuration;
@@ -15,6 +17,14 @@ public class ConfigureUmbracoDeliveryApiSwaggerGenOptions: IConfigureOptions<Swa
{
Title = DeliveryApiConfiguration.ApiTitle,
Version = "Latest",
Description = $"You can find out more about the {DeliveryApiConfiguration.ApiTitle} in [the documentation]({DeliveryApiConfiguration.ApiDocumentationContentArticleLink})."
});
swaggerGenOptions.DocumentFilter<MimeTypeDocumentFilter>(DeliveryApiConfiguration.ApiName);
swaggerGenOptions.OperationFilter<SwaggerContentDocumentationFilter>();
swaggerGenOptions.OperationFilter<SwaggerMediaDocumentationFilter>();
swaggerGenOptions.ParameterFilter<SwaggerContentDocumentationFilter>();
swaggerGenOptions.ParameterFilter<SwaggerMediaDocumentationFilter>();
}
}
@@ -0,0 +1,74 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.SwaggerGen;
using Umbraco.Cms.Api.Common.Security;
using Umbraco.Cms.Api.Delivery.Controllers.Content;
using Umbraco.Cms.Api.Delivery.Filters;
namespace Umbraco.Cms.Api.Delivery.Configuration;
/// <summary>
/// This configures member authentication for the Delivery API in Swagger. Consult the docs for
/// member authentication within the Delivery API for instructions on how to use this.
/// </summary>
/// <remarks>
/// This class is not used by the core CMS due to the required installation dependencies (local login page among other things).
/// </remarks>
public class ConfigureUmbracoMemberAuthenticationDeliveryApiSwaggerGenOptions : IConfigureOptions<SwaggerGenOptions>
{
private const string AuthSchemeName = "Umbraco Member";
public void Configure(SwaggerGenOptions options)
{
options.AddSecurityDefinition(
AuthSchemeName,
new OpenApiSecurityScheme
{
In = ParameterLocation.Header,
Name = AuthSchemeName,
Type = SecuritySchemeType.OAuth2,
Description = "Umbraco Member Authentication",
Flows = new OpenApiOAuthFlows
{
AuthorizationCode = new OpenApiOAuthFlow
{
AuthorizationUrl = new Uri(Paths.MemberApi.AuthorizationEndpoint, UriKind.Relative),
TokenUrl = new Uri(Paths.MemberApi.TokenEndpoint, UriKind.Relative)
}
}
});
// add security requirements for content API operations
options.OperationFilter<DeliveryApiSecurityFilter>();
}
private class DeliveryApiSecurityFilter : SwaggerFilterBase<ContentApiControllerBase>, IOperationFilter
{
public void Apply(OpenApiOperation operation, OperationFilterContext context)
{
if (CanApply(context) is false)
{
return;
}
operation.Security = new List<OpenApiSecurityRequirement>
{
new OpenApiSecurityRequirement
{
{
new OpenApiSecurityScheme
{
Reference = new OpenApiReference
{
Type = ReferenceType.SecurityScheme,
Id = AuthSchemeName,
}
},
new string[] { }
}
}
};
}
}
}
@@ -5,4 +5,8 @@ internal static class DeliveryApiConfiguration
internal const string ApiTitle = "Umbraco Delivery API";
internal const string ApiName = "delivery";
internal const string ApiDocumentationContentArticleLink = "https://docs.umbraco.com/umbraco-cms/reference/content-delivery-api";
internal const string ApiDocumentationMediaArticleLink = "https://docs.umbraco.com/umbraco-cms/reference/content-delivery-api/media-delivery-api";
}
@@ -1,54 +0,0 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Cms.Core.Models.DeliveryApi;
using Umbraco.Cms.Core.Models.PublishedContent;
using Umbraco.Cms.Core.Services;
namespace Umbraco.Cms.Api.Delivery.Controllers;
[ApiVersion("1.0")]
public class ByIdContentApiController : ContentApiItemControllerBase
{
public ByIdContentApiController(
IApiPublishedContentCache apiPublishedContentCache,
IApiContentResponseBuilder apiContentResponseBuilder,
IPublicAccessService publicAccessService)
: base(apiPublishedContentCache, apiContentResponseBuilder, publicAccessService)
{
}
/// <summary>
/// Gets a content item by id.
/// </summary>
/// <param name="id">The unique identifier of the content item.</param>
/// <returns>The content item or not found result.</returns>
[HttpGet("item/{id:guid}")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(IApiContentResponse), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
public async Task<IActionResult> ById(Guid id)
{
IPublishedContent? contentItem = ApiPublishedContentCache.GetById(id);
if (contentItem is null)
{
return NotFound();
}
if (IsProtected(contentItem))
{
return Unauthorized();
}
IApiContentResponse? apiContentResponse = ApiContentResponseBuilder.Build(contentItem);
if (apiContentResponse is null)
{
return NotFound();
}
return await Task.FromResult(Ok(apiContentResponse));
}
}
@@ -1,70 +0,0 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Cms.Core.Models.DeliveryApi;
using Umbraco.Cms.Core.Models.PublishedContent;
using Umbraco.Cms.Core.Services;
namespace Umbraco.Cms.Api.Delivery.Controllers;
[ApiVersion("1.0")]
public class ByRouteContentApiController : ContentApiItemControllerBase
{
private readonly IRequestRoutingService _requestRoutingService;
private readonly IRequestRedirectService _requestRedirectService;
public ByRouteContentApiController(
IApiPublishedContentCache apiPublishedContentCache,
IApiContentResponseBuilder apiContentResponseBuilder,
IPublicAccessService publicAccessService,
IRequestRoutingService requestRoutingService,
IRequestRedirectService requestRedirectService)
: base(apiPublishedContentCache, apiContentResponseBuilder, publicAccessService)
{
_requestRoutingService = requestRoutingService;
_requestRedirectService = requestRedirectService;
}
/// <summary>
/// Gets a content item by route.
/// </summary>
/// <param name="path">The path to the content item.</param>
/// <remarks>
/// Optional URL segment for the root content item
/// can be added through the "start-item" header.
/// </remarks>
/// <returns>The content item or not found result.</returns>
[HttpGet("item/{*path}")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(IApiContentResponse), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
public async Task<IActionResult> ByRoute(string path = "/")
{
var contentRoute = _requestRoutingService.GetContentRoute(path);
IPublishedContent? contentItem = ApiPublishedContentCache.GetByRoute(contentRoute);
if (contentItem is not null)
{
if (IsProtected(contentItem))
{
return Unauthorized();
}
return await Task.FromResult(Ok(ApiContentResponseBuilder.Build(contentItem)));
}
IApiContentRoute? redirectRoute = _requestRedirectService.GetRedirectRoute(path);
return redirectRoute != null
? RedirectTo(redirectRoute)
: NotFound();
}
private IActionResult RedirectTo(IApiContentRoute redirectRoute)
{
Response.Headers.Add("Location-Start-Item-Path", redirectRoute.StartItem.Path);
Response.Headers.Add("Location-Start-Item-Id", redirectRoute.StartItem.Id.ToString("D"));
return RedirectPermanent(redirectRoute.Path);
}
}
@@ -0,0 +1,99 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Cms.Core.DependencyInjection;
using Umbraco.Cms.Core.Models.DeliveryApi;
using Umbraco.Cms.Core.Models.PublishedContent;
using Umbraco.Cms.Core.Services;
namespace Umbraco.Cms.Api.Delivery.Controllers.Content;
[ApiVersion("1.0")]
[ApiVersion("2.0")]
public class ByIdContentApiController : ContentApiItemControllerBase
{
private readonly IRequestMemberAccessService _requestMemberAccessService;
[Obsolete($"Please use the constructor that does not accept {nameof(IPublicAccessService)}. Will be removed in V14.")]
public ByIdContentApiController(
IApiPublishedContentCache apiPublishedContentCache,
IApiContentResponseBuilder apiContentResponseBuilder,
IPublicAccessService publicAccessService)
: this(
apiPublishedContentCache,
apiContentResponseBuilder,
StaticServiceProvider.Instance.GetRequiredService<IRequestMemberAccessService>())
{
}
[Obsolete($"Please use the constructor that does not accept {nameof(IPublicAccessService)}. Will be removed in V14.")]
public ByIdContentApiController(
IApiPublishedContentCache apiPublishedContentCache,
IApiContentResponseBuilder apiContentResponseBuilder,
IPublicAccessService publicAccessService,
IRequestMemberAccessService requestMemberAccessService)
: this(
apiPublishedContentCache,
apiContentResponseBuilder,
requestMemberAccessService)
{
}
[ActivatorUtilitiesConstructor]
public ByIdContentApiController(
IApiPublishedContentCache apiPublishedContentCache,
IApiContentResponseBuilder apiContentResponseBuilder,
IRequestMemberAccessService requestMemberAccessService)
: base(apiPublishedContentCache, apiContentResponseBuilder)
=> _requestMemberAccessService = requestMemberAccessService;
[HttpGet("item/{id:guid}")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(IApiContentResponse), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
[ProducesResponseType(StatusCodes.Status403Forbidden)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
[Obsolete("Please use version 2 of this API. Will be removed in V15.")]
public async Task<IActionResult> ById(Guid id)
=> await HandleRequest(id);
/// <summary>
/// Gets a content item by id.
/// </summary>
/// <param name="id">The unique identifier of the content item.</param>
/// <returns>The content item or not found result.</returns>
[HttpGet("item/{id:guid}")]
[MapToApiVersion("2.0")]
[ProducesResponseType(typeof(IApiContentResponse), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
[ProducesResponseType(StatusCodes.Status403Forbidden)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
public async Task<IActionResult> ByIdV20(Guid id)
=> await HandleRequest(id);
private async Task<IActionResult> HandleRequest(Guid id)
{
IPublishedContent? contentItem = ApiPublishedContentCache.GetById(id);
if (contentItem is null)
{
return NotFound();
}
IActionResult? deniedAccessResult = await HandleMemberAccessAsync(contentItem, _requestMemberAccessService);
if (deniedAccessResult is not null)
{
return deniedAccessResult;
}
IApiContentResponse? apiContentResponse = ApiContentResponseBuilder.Build(contentItem);
if (apiContentResponse is null)
{
return NotFound();
}
return Ok(apiContentResponse);
}
}
@@ -0,0 +1,92 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Cms.Core.DependencyInjection;
using Umbraco.Cms.Core.Models.DeliveryApi;
using Umbraco.Cms.Core.Models.PublishedContent;
using Umbraco.Cms.Core.Services;
using Umbraco.Extensions;
namespace Umbraco.Cms.Api.Delivery.Controllers.Content;
[ApiVersion("1.0")]
[ApiVersion("2.0")]
public class ByIdsContentApiController : ContentApiItemControllerBase
{
private readonly IRequestMemberAccessService _requestMemberAccessService;
[Obsolete($"Please use the constructor that does not accept {nameof(IPublicAccessService)}. Will be removed in V14.")]
public ByIdsContentApiController(
IApiPublishedContentCache apiPublishedContentCache,
IApiContentResponseBuilder apiContentResponseBuilder,
IPublicAccessService publicAccessService)
: this(
apiPublishedContentCache,
apiContentResponseBuilder,
StaticServiceProvider.Instance.GetRequiredService<IRequestMemberAccessService>())
{
}
[Obsolete($"Please use the constructor that does not accept {nameof(IPublicAccessService)}. Will be removed in V14.")]
public ByIdsContentApiController(
IApiPublishedContentCache apiPublishedContentCache,
IApiContentResponseBuilder apiContentResponseBuilder,
IPublicAccessService publicAccessService,
IRequestMemberAccessService requestMemberAccessService)
: this(
apiPublishedContentCache,
apiContentResponseBuilder,
requestMemberAccessService)
{
}
[ActivatorUtilitiesConstructor]
public ByIdsContentApiController(
IApiPublishedContentCache apiPublishedContentCache,
IApiContentResponseBuilder apiContentResponseBuilder,
IRequestMemberAccessService requestMemberAccessService)
: base(apiPublishedContentCache, apiContentResponseBuilder)
=> _requestMemberAccessService = requestMemberAccessService;
[HttpGet("item")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(IEnumerable<IApiContentResponse>), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
[ProducesResponseType(StatusCodes.Status403Forbidden)]
[Obsolete("Please use version 2 of this API. Will be removed in V15.")]
public async Task<IActionResult> Item([FromQuery(Name = "id")] HashSet<Guid> ids)
=> await HandleRequest(ids);
/// <summary>
/// Gets content items by ids.
/// </summary>
/// <param name="ids">The unique identifiers of the content items to retrieve.</param>
/// <returns>The content items.</returns>
[HttpGet("items")]
[MapToApiVersion("2.0")]
[ProducesResponseType(typeof(IEnumerable<IApiContentResponse>), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
[ProducesResponseType(StatusCodes.Status403Forbidden)]
public async Task<IActionResult> ItemsV20([FromQuery(Name = "id")] HashSet<Guid> ids)
=> await HandleRequest(ids);
private async Task<IActionResult> HandleRequest(HashSet<Guid> ids)
{
IPublishedContent[] contentItems = ApiPublishedContentCache.GetByIds(ids).ToArray();
IActionResult? deniedAccessResult = await HandleMemberAccessAsync(contentItems, _requestMemberAccessService);
if (deniedAccessResult is not null)
{
return deniedAccessResult;
}
IApiContentResponse[] apiContentItems = contentItems
.Select(ApiContentResponseBuilder.Build)
.WhereNotNull()
.ToArray();
return await Task.FromResult(Ok(apiContentItems));
}
}
@@ -0,0 +1,201 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Cms.Core.DependencyInjection;
using Umbraco.Cms.Core.Models.DeliveryApi;
using Umbraco.Cms.Core.Models.PublishedContent;
using Umbraco.Cms.Core.Services;
namespace Umbraco.Cms.Api.Delivery.Controllers.Content;
[ApiVersion("1.0")]
[ApiVersion("2.0")]
public class ByRouteContentApiController : ContentApiItemControllerBase
{
private readonly IApiContentPathResolver _apiContentPathResolver;
private readonly IRequestRedirectService _requestRedirectService;
private readonly IRequestPreviewService _requestPreviewService;
private readonly IRequestMemberAccessService _requestMemberAccessService;
private const string PreviewContentRequestPathPrefix = $"/{Umbraco.Cms.Core.Constants.DeliveryApi.Routing.PreviewContentPathPrefix}";
[Obsolete($"Please use the constructor that does not accept {nameof(IPublicAccessService)}. Will be removed in V14.")]
public ByRouteContentApiController(
IApiPublishedContentCache apiPublishedContentCache,
IApiContentResponseBuilder apiContentResponseBuilder,
IPublicAccessService publicAccessService,
IRequestRoutingService requestRoutingService,
IRequestRedirectService requestRedirectService,
IRequestPreviewService requestPreviewService)
: this(
apiPublishedContentCache,
apiContentResponseBuilder,
requestRoutingService,
requestRedirectService,
requestPreviewService,
StaticServiceProvider.Instance.GetRequiredService<IRequestMemberAccessService>())
{
}
[Obsolete($"Please use the constructor that does not accept {nameof(IPublicAccessService)}. Will be removed in V14.")]
public ByRouteContentApiController(
IApiPublishedContentCache apiPublishedContentCache,
IApiContentResponseBuilder apiContentResponseBuilder,
IPublicAccessService publicAccessService,
IRequestRoutingService requestRoutingService,
IRequestRedirectService requestRedirectService,
IRequestPreviewService requestPreviewService,
IRequestMemberAccessService requestMemberAccessService)
: this(
apiPublishedContentCache,
apiContentResponseBuilder,
requestRoutingService,
requestRedirectService,
requestPreviewService,
requestMemberAccessService)
{
}
[Obsolete($"Please use the constructor that accepts {nameof(IApiContentPathResolver)}. Will be removed in V15.")]
public ByRouteContentApiController(
IApiPublishedContentCache apiPublishedContentCache,
IApiContentResponseBuilder apiContentResponseBuilder,
IRequestRoutingService requestRoutingService,
IRequestRedirectService requestRedirectService,
IRequestPreviewService requestPreviewService,
IRequestMemberAccessService requestMemberAccessService)
: this(
apiPublishedContentCache,
apiContentResponseBuilder,
requestRedirectService,
requestPreviewService,
requestMemberAccessService,
StaticServiceProvider.Instance.GetRequiredService<IApiContentPathResolver>())
{
}
[Obsolete($"Please use the non-obsolete constructor. Will be removed in V15.")]
public ByRouteContentApiController(
IApiPublishedContentCache apiPublishedContentCache,
IApiContentResponseBuilder apiContentResponseBuilder,
IPublicAccessService publicAccessService,
IRequestRoutingService requestRoutingService,
IRequestRedirectService requestRedirectService,
IRequestPreviewService requestPreviewService,
IRequestMemberAccessService requestMemberAccessService,
IApiContentPathResolver apiContentPathResolver)
: this(
apiPublishedContentCache,
apiContentResponseBuilder,
requestRedirectService,
requestPreviewService,
requestMemberAccessService,
apiContentPathResolver)
{
}
[ActivatorUtilitiesConstructor]
public ByRouteContentApiController(
IApiPublishedContentCache apiPublishedContentCache,
IApiContentResponseBuilder apiContentResponseBuilder,
IRequestRedirectService requestRedirectService,
IRequestPreviewService requestPreviewService,
IRequestMemberAccessService requestMemberAccessService,
IApiContentPathResolver apiContentPathResolver)
: base(apiPublishedContentCache, apiContentResponseBuilder)
{
_requestRedirectService = requestRedirectService;
_requestPreviewService = requestPreviewService;
_requestMemberAccessService = requestMemberAccessService;
_apiContentPathResolver = apiContentPathResolver;
}
[HttpGet("item/{*path}")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(IApiContentResponse), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
[ProducesResponseType(StatusCodes.Status403Forbidden)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
[Obsolete("Please use version 2 of this API. Will be removed in V15.")]
public async Task<IActionResult> ByRoute(string path = "")
=> await HandleRequest(path);
/// <summary>
/// Gets a content item by route.
/// </summary>
/// <param name="path">The path to the content item.</param>
/// <remarks>
/// Optional URL segment for the root content item
/// can be added through the "start-item" header.
/// </remarks>
/// <returns>The content item or not found result.</returns>
[HttpGet("item/{*path}")]
[MapToApiVersion("2.0")]
[ProducesResponseType(typeof(IApiContentResponse), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
[ProducesResponseType(StatusCodes.Status403Forbidden)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
public async Task<IActionResult> ByRouteV20(string path = "")
=> await HandleRequest(path);
private async Task<IActionResult> HandleRequest(string path)
{
path = DecodePath(path);
path = path.Length == 0 ? "/" : path;
if (_apiContentPathResolver.IsResolvablePath(path) is false)
{
return NotFound();
}
IPublishedContent? contentItem = GetContent(path);
if (contentItem is not null)
{
IActionResult? deniedAccessResult = await HandleMemberAccessAsync(contentItem, _requestMemberAccessService);
if (deniedAccessResult is not null)
{
return deniedAccessResult;
}
return await Task.FromResult(Ok(ApiContentResponseBuilder.Build(contentItem)));
}
IApiContentRoute? redirectRoute = _requestRedirectService.GetRedirectRoute(path);
return redirectRoute != null
? RedirectTo(redirectRoute)
: NotFound();
}
private IPublishedContent? GetContent(string path)
=> path.StartsWith(PreviewContentRequestPathPrefix)
? GetPreviewContent(path)
: GetPublishedContent(path);
private IPublishedContent? GetPublishedContent(string path)
=> _apiContentPathResolver.ResolveContentPath(path);
private IPublishedContent? GetPreviewContent(string path)
{
if (_requestPreviewService.IsPreview() is false)
{
return null;
}
if (Guid.TryParse(path.AsSpan(PreviewContentRequestPathPrefix.Length).TrimEnd("/"), out Guid contentId) is false)
{
return null;
}
IPublishedContent? contentItem = ApiPublishedContentCache.GetById(contentId);
return contentItem;
}
private IActionResult RedirectTo(IApiContentRoute redirectRoute)
{
Response.Headers.Add("Location-Start-Item-Path", redirectRoute.StartItem.Path);
Response.Headers.Add("Location-Start-Item-Id", redirectRoute.StartItem.Id.ToString("D"));
return RedirectPermanent(redirectRoute.Path);
}
}
@@ -1,4 +1,6 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.OutputCaching;
using Umbraco.Cms.Api.Common.Builders;
using Umbraco.Cms.Api.Delivery.Filters;
using Umbraco.Cms.Api.Delivery.Routing;
@@ -6,12 +8,15 @@ using Umbraco.Cms.Core;
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Cms.Core.Services.OperationStatus;
namespace Umbraco.Cms.Api.Delivery.Controllers;
namespace Umbraco.Cms.Api.Delivery.Controllers.Content;
[DeliveryApiAccess]
[VersionedDeliveryApiRoute("content")]
[ApiExplorerSettings(GroupName = "Content")]
[LocalizeFromAcceptLanguageHeader]
[ValidateStartItem]
[AddVaryHeader]
[OutputCache(PolicyName = Constants.DeliveryApi.OutputCache.ContentCachePolicy)]
public abstract class ContentApiControllerBase : DeliveryApiControllerBase
{
protected IApiPublishedContentCache ApiPublishedContentCache { get; }
@@ -31,10 +36,6 @@ public abstract class ContentApiControllerBase : DeliveryApiControllerBase
.WithTitle("Filter option not found")
.WithDetail("One of the attempted 'filter' options does not exist")
.Build()),
ApiContentQueryOperationStatus.IndexNotFound => BadRequest(new ProblemDetailsBuilder()
.WithTitle("Examine index not found")
.WithDetail($"No index found with name {Constants.UmbracoIndexes.DeliveryApiContentIndexName}")
.Build()),
ApiContentQueryOperationStatus.SelectorOptionNotFound => BadRequest(new ProblemDetailsBuilder()
.WithTitle("Selector option not found")
.WithDetail("The attempted 'fetch' option does not exist")
@@ -43,5 +44,19 @@ public abstract class ContentApiControllerBase : DeliveryApiControllerBase
.WithTitle("Sort option not found")
.WithDetail("One of the attempted 'sort' options does not exist")
.Build()),
_ => BadRequest(new ProblemDetailsBuilder()
.WithTitle("Unknown content query status")
.WithDetail($"Content query status \"{status}\" was not expected here")
.Build()),
};
/// <summary>
/// Creates a 403 Forbidden result.
/// </summary>
/// <remarks>
/// Use this method instead of <see cref="ControllerBase.Forbid()"/> on the controller base. The latter will yield
/// a redirect to an access denied URL because of the default cookie auth scheme. This method ensures that a proper
/// 403 Forbidden status code is returned to the client.
/// </remarks>
protected IActionResult Forbidden() => new StatusCodeResult(StatusCodes.Status403Forbidden);
}
@@ -0,0 +1,58 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Cms.Core.DependencyInjection;
using Umbraco.Cms.Core.Models.PublishedContent;
using Umbraco.Cms.Core.Security;
using Umbraco.Cms.Core.Services;
namespace Umbraco.Cms.Api.Delivery.Controllers.Content;
public abstract class ContentApiItemControllerBase : ContentApiControllerBase
{
// TODO: Remove this in V14 when the obsolete constructors have been removed
private readonly IPublicAccessService _publicAccessService;
[Obsolete($"Please use the constructor that does not accept {nameof(IPublicAccessService)}. Will be removed in V14.")]
protected ContentApiItemControllerBase(
IApiPublishedContentCache apiPublishedContentCache,
IApiContentResponseBuilder apiContentResponseBuilder,
IPublicAccessService publicAccessService)
: this(apiPublishedContentCache, apiContentResponseBuilder)
{
}
protected ContentApiItemControllerBase(
IApiPublishedContentCache apiPublishedContentCache,
IApiContentResponseBuilder apiContentResponseBuilder)
: base(apiPublishedContentCache, apiContentResponseBuilder)
=> _publicAccessService = StaticServiceProvider.Instance.GetRequiredService<IPublicAccessService>();
[Obsolete($"Please use {nameof(IPublicAccessService)} to test for content protection. Will be removed in V14.")]
protected bool IsProtected(IPublishedContent content) => _publicAccessService.IsProtected(content.Path);
protected async Task<IActionResult?> HandleMemberAccessAsync(IPublishedContent contentItem, IRequestMemberAccessService requestMemberAccessService)
{
PublicAccessStatus accessStatus = await requestMemberAccessService.MemberHasAccessToAsync(contentItem);
return accessStatus is PublicAccessStatus.AccessAccepted
? null
: accessStatus is PublicAccessStatus.AccessDenied
? Forbidden()
: Unauthorized();
}
protected async Task<IActionResult?> HandleMemberAccessAsync(IEnumerable<IPublishedContent> contentItems, IRequestMemberAccessService requestMemberAccessService)
{
foreach (IPublishedContent content in contentItems)
{
IActionResult? result = await HandleMemberAccessAsync(content, requestMemberAccessService);
// if any of the content items yield an error based on the current member access, return that error
if (result is not null)
{
return result;
}
}
return null;
}
}
@@ -1,28 +1,64 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
using Umbraco.Cms.Api.Common.ViewModels.Pagination;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Cms.Core.DependencyInjection;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Models.DeliveryApi;
using Umbraco.Cms.Core.Models.PublishedContent;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Extensions;
using Umbraco.New.Cms.Core.Models;
namespace Umbraco.Cms.Api.Delivery.Controllers;
namespace Umbraco.Cms.Api.Delivery.Controllers.Content;
[ApiVersion("1.0")]
[ApiVersion("2.0")]
public class QueryContentApiController : ContentApiControllerBase
{
private readonly IRequestMemberAccessService _requestMemberAccessService;
private readonly IApiContentQueryService _apiContentQueryService;
[Obsolete($"Please use the constructor that accepts {nameof(IRequestMemberAccessService)}. Will be removed in V14.")]
public QueryContentApiController(
IApiPublishedContentCache apiPublishedContentCache,
IApiContentResponseBuilder apiContentResponseBuilderBuilder,
IApiContentQueryService apiContentQueryService)
: this(
apiPublishedContentCache,
apiContentResponseBuilderBuilder,
apiContentQueryService,
StaticServiceProvider.Instance.GetRequiredService<IRequestMemberAccessService>())
{
}
[ActivatorUtilitiesConstructor]
public QueryContentApiController(
IApiPublishedContentCache apiPublishedContentCache,
IApiContentResponseBuilder apiContentResponseBuilderBuilder,
IApiContentQueryService apiContentQueryService,
IRequestMemberAccessService requestMemberAccessService)
: base(apiPublishedContentCache, apiContentResponseBuilderBuilder)
=> _apiContentQueryService = apiContentQueryService;
{
_apiContentQueryService = apiContentQueryService;
_requestMemberAccessService = requestMemberAccessService;
}
[HttpGet]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(PagedViewModel<IApiContentResponse>), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
[Obsolete("Please use version 2 of this API. Will be removed in V15.")]
public async Task<IActionResult> Query(
string? fetch,
[FromQuery] string[] filter,
[FromQuery] string[] sort,
int skip = 0,
int take = 10)
=> await HandleRequest(fetch, filter, sort, skip, take);
/// <summary>
/// Gets a paginated list of content item(s) from query.
@@ -34,18 +70,22 @@ public class QueryContentApiController : ContentApiControllerBase
/// <param name="take">The amount of items to take.</param>
/// <returns>The paged result of the content item(s).</returns>
[HttpGet]
[MapToApiVersion("1.0")]
[MapToApiVersion("2.0")]
[ProducesResponseType(typeof(PagedViewModel<IApiContentResponse>), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
public async Task<IActionResult> Query(
public async Task<IActionResult> QueryV20(
string? fetch,
[FromQuery] string[] filter,
[FromQuery] string[] sort,
int skip = 0,
int take = 10)
=> await HandleRequest(fetch, filter, sort, skip, take);
private async Task<IActionResult> HandleRequest(string? fetch, string[] filter, string[] sort, int skip, int take)
{
Attempt<PagedModel<Guid>, ApiContentQueryOperationStatus> queryAttempt = _apiContentQueryService.ExecuteQuery(fetch, filter, sort, skip, take);
ProtectedAccess protectedAccess = await _requestMemberAccessService.MemberAccessAsync();
Attempt<PagedModel<Guid>, ApiContentQueryOperationStatus> queryAttempt = _apiContentQueryService.ExecuteQuery(fetch, filter, sort, protectedAccess, skip, take);
if (queryAttempt.Success is false)
{
@@ -62,6 +102,6 @@ public class QueryContentApiController : ContentApiControllerBase
Items = apiContentItems
};
return await Task.FromResult(Ok(model));
return Ok(model);
}
}
@@ -1,22 +0,0 @@
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Cms.Core.Models.PublishedContent;
using Umbraco.Cms.Core.Services;
namespace Umbraco.Cms.Api.Delivery.Controllers;
public abstract class ContentApiItemControllerBase : ContentApiControllerBase
{
private readonly IPublicAccessService _publicAccessService;
protected ContentApiItemControllerBase(
IApiPublishedContentCache apiPublishedContentCache,
IApiContentResponseBuilder apiContentResponseBuilder,
IPublicAccessService publicAccessService)
: base(apiPublishedContentCache, apiContentResponseBuilder)
=> _publicAccessService = publicAccessService;
// NOTE: we're going to test for protected content at item endpoint level, because the check has already been
// performed at content index time for the query endpoint and we don't want that extra overhead when
// returning multiple items.
protected bool IsProtected(IPublishedContent content) => _publicAccessService.IsProtected(content.Path);
}
@@ -1,17 +1,29 @@
using Asp.Versioning;
using System.Net;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Common.Attributes;
using Umbraco.Cms.Api.Common.Filters;
using Umbraco.Cms.Api.Delivery.Configuration;
using Umbraco.Cms.Api.Delivery.Filters;
using Umbraco.Cms.Core;
namespace Umbraco.Cms.Api.Delivery.Controllers;
[ApiController]
[DeliveryApiAccess]
[JsonOptionsName(Constants.JsonOptionsNames.DeliveryApi)]
[MapToApi(DeliveryApiConfiguration.ApiName)]
public abstract class DeliveryApiControllerBase : Controller
{
protected string DecodePath(string path)
{
// OpenAPI does not allow reserved chars as "in:path" parameters, so clients based on the Swagger JSON will URL
// encode the path. Normally, ASP.NET Core handles that encoding with an automatic decoding - apparently just not
// for forward slashes, for whatever reason... so we need to deal with those. Hopefully this will be addressed in
// an upcoming version of ASP.NET Core.
// See also https://github.com/dotnet/aspnetcore/issues/11544
if (path.Contains("%2F", StringComparison.OrdinalIgnoreCase))
{
path = WebUtility.UrlDecode(path);
}
return path;
}
}
@@ -0,0 +1,51 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Core.Models.DeliveryApi;
using Umbraco.Cms.Core.Models.PublishedContent;
using Umbraco.Cms.Core.PublishedCache;
using Umbraco.Cms.Infrastructure.DeliveryApi;
namespace Umbraco.Cms.Api.Delivery.Controllers.Media;
[ApiVersion("1.0")]
[ApiVersion("2.0")]
public class ByIdMediaApiController : MediaApiControllerBase
{
public ByIdMediaApiController(IPublishedSnapshotAccessor publishedSnapshotAccessor, IApiMediaWithCropsResponseBuilder apiMediaWithCropsResponseBuilder)
: base(publishedSnapshotAccessor, apiMediaWithCropsResponseBuilder)
{
}
[HttpGet("item/{id:guid}")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(IApiMediaWithCropsResponse), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
[Obsolete("Please use version 2 of this API. Will be removed in V15.")]
public async Task<IActionResult> ById(Guid id)
=> await HandleRequest(id);
/// <summary>
/// Gets a media item by id.
/// </summary>
/// <param name="id">The unique identifier of the media item.</param>
/// <returns>The media item or not found result.</returns>
[HttpGet("item/{id:guid}")]
[MapToApiVersion("2.0")]
[ProducesResponseType(typeof(IApiMediaWithCropsResponse), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
public async Task<IActionResult> ByIdV20(Guid id)
=> await HandleRequest(id);
private async Task<IActionResult> HandleRequest(Guid id)
{
IPublishedContent? media = PublishedMediaCache.GetById(id);
if (media is null)
{
return await Task.FromResult(NotFound());
}
return Ok(BuildApiMediaWithCrops(media));
}
}
@@ -0,0 +1,52 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Core.Models.DeliveryApi;
using Umbraco.Cms.Core.Models.PublishedContent;
using Umbraco.Cms.Core.PublishedCache;
using Umbraco.Cms.Infrastructure.DeliveryApi;
using Umbraco.Extensions;
namespace Umbraco.Cms.Api.Delivery.Controllers.Media;
[ApiVersion("1.0")]
[ApiVersion("2.0")]
public class ByIdsMediaApiController : MediaApiControllerBase
{
public ByIdsMediaApiController(IPublishedSnapshotAccessor publishedSnapshotAccessor, IApiMediaWithCropsResponseBuilder apiMediaWithCropsResponseBuilder)
: base(publishedSnapshotAccessor, apiMediaWithCropsResponseBuilder)
{
}
[HttpGet("item")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(IEnumerable<IApiMediaWithCropsResponse>), StatusCodes.Status200OK)]
[Obsolete("Please use version 2 of this API. Will be removed in V15.")]
public async Task<IActionResult> Item([FromQuery(Name = "id")] HashSet<Guid> ids)
=> await HandleRequest(ids);
/// <summary>
/// Gets media items by ids.
/// </summary>
/// <param name="ids">The unique identifiers of the media items to retrieve.</param>
/// <returns>The media items.</returns>
[HttpGet("items")]
[MapToApiVersion("2.0")]
[ProducesResponseType(typeof(IEnumerable<IApiMediaWithCropsResponse>), StatusCodes.Status200OK)]
public async Task<IActionResult> ItemsV20([FromQuery(Name = "id")] HashSet<Guid> ids)
=> await HandleRequest(ids);
private async Task<IActionResult> HandleRequest(HashSet<Guid> ids)
{
IPublishedContent[] mediaItems = ids
.Select(PublishedMediaCache.GetById)
.WhereNotNull()
.ToArray();
IApiMediaWithCropsResponse[] apiMediaItems = mediaItems
.Select(BuildApiMediaWithCrops)
.ToArray();
return await Task.FromResult(Ok(apiMediaItems));
}
}
@@ -0,0 +1,57 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Cms.Core.Models.DeliveryApi;
using Umbraco.Cms.Core.Models.PublishedContent;
using Umbraco.Cms.Core.PublishedCache;
using Umbraco.Cms.Infrastructure.DeliveryApi;
namespace Umbraco.Cms.Api.Delivery.Controllers.Media;
[ApiVersion("1.0")]
[ApiVersion("2.0")]
public class ByPathMediaApiController : MediaApiControllerBase
{
private readonly IApiMediaQueryService _apiMediaQueryService;
public ByPathMediaApiController(
IPublishedSnapshotAccessor publishedSnapshotAccessor,
IApiMediaWithCropsResponseBuilder apiMediaWithCropsResponseBuilder,
IApiMediaQueryService apiMediaQueryService)
: base(publishedSnapshotAccessor, apiMediaWithCropsResponseBuilder)
=> _apiMediaQueryService = apiMediaQueryService;
[HttpGet("item/{*path}")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(IApiMediaWithCropsResponse), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
[Obsolete("Please use version 2 of this API. Will be removed in V15.")]
public async Task<IActionResult> ByPath(string path)
=> await HandleRequest(path);
/// <summary>
/// Gets a media item by its path.
/// </summary>
/// <param name="path">The path of the media item.</param>
/// <returns>The media item or not found result.</returns>
[HttpGet("item/{*path}")]
[MapToApiVersion("2.0")]
[ProducesResponseType(typeof(IApiMediaWithCropsResponse), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
public async Task<IActionResult> ByPathV20(string path)
=> await HandleRequest(path);
private async Task<IActionResult> HandleRequest(string path)
{
path = DecodePath(path);
IPublishedContent? media = _apiMediaQueryService.GetByPath(path);
if (media is null)
{
return await Task.FromResult(NotFound());
}
return Ok(BuildApiMediaWithCrops(media));
}
}
@@ -0,0 +1,59 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.OutputCaching;
using Umbraco.Cms.Api.Common.Builders;
using Umbraco.Cms.Api.Delivery.Filters;
using Umbraco.Cms.Api.Delivery.Routing;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Models.DeliveryApi;
using Umbraco.Cms.Core.Models.PublishedContent;
using Umbraco.Cms.Core.PublishedCache;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Cms.Infrastructure.DeliveryApi;
using Umbraco.Extensions;
namespace Umbraco.Cms.Api.Delivery.Controllers.Media;
[DeliveryApiMediaAccess]
[VersionedDeliveryApiRoute("media")]
[ApiExplorerSettings(GroupName = "Media")]
[OutputCache(PolicyName = Constants.DeliveryApi.OutputCache.MediaCachePolicy)]
public abstract class MediaApiControllerBase : DeliveryApiControllerBase
{
private readonly IApiMediaWithCropsResponseBuilder _apiMediaWithCropsResponseBuilder;
private readonly IPublishedSnapshotAccessor _publishedSnapshotAccessor;
private IPublishedMediaCache? _publishedMediaCache;
protected MediaApiControllerBase(IPublishedSnapshotAccessor publishedSnapshotAccessor, IApiMediaWithCropsResponseBuilder apiMediaWithCropsResponseBuilder)
{
_publishedSnapshotAccessor = publishedSnapshotAccessor;
_apiMediaWithCropsResponseBuilder = apiMediaWithCropsResponseBuilder;
}
protected IPublishedMediaCache PublishedMediaCache => _publishedMediaCache
??= _publishedSnapshotAccessor.GetRequiredPublishedSnapshot().Media
?? throw new InvalidOperationException("Could not obtain the published media cache");
protected IApiMediaWithCropsResponse BuildApiMediaWithCrops(IPublishedContent media)
=> _apiMediaWithCropsResponseBuilder.Build(media);
protected IActionResult ApiMediaQueryOperationStatusResult(ApiMediaQueryOperationStatus status) =>
status switch
{
ApiMediaQueryOperationStatus.FilterOptionNotFound => BadRequest(new ProblemDetailsBuilder()
.WithTitle("Filter option not found")
.WithDetail("One of the attempted 'filter' options does not exist")
.Build()),
ApiMediaQueryOperationStatus.SelectorOptionNotFound => BadRequest(new ProblemDetailsBuilder()
.WithTitle("Selector option not found")
.WithDetail("The attempted 'fetch' option does not exist")
.Build()),
ApiMediaQueryOperationStatus.SortOptionNotFound => BadRequest(new ProblemDetailsBuilder()
.WithTitle("Sort option not found")
.WithDetail("One of the attempted 'sort' options does not exist")
.Build()),
_ => BadRequest(new ProblemDetailsBuilder()
.WithTitle("Unknown media query status")
.WithDetail($"Media query status \"{status}\" was not expected here")
.Build()),
};
}
@@ -0,0 +1,84 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Common.ViewModels.Pagination;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Models.DeliveryApi;
using Umbraco.Cms.Core.Models.PublishedContent;
using Umbraco.Cms.Core.PublishedCache;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Cms.Infrastructure.DeliveryApi;
using Umbraco.Extensions;
namespace Umbraco.Cms.Api.Delivery.Controllers.Media;
[ApiVersion("1.0")]
[ApiVersion("2.0")]
public class QueryMediaApiController : MediaApiControllerBase
{
private readonly IApiMediaQueryService _apiMediaQueryService;
public QueryMediaApiController(
IPublishedSnapshotAccessor publishedSnapshotAccessor,
IApiMediaWithCropsResponseBuilder apiMediaWithCropsResponseBuilder,
IApiMediaQueryService apiMediaQueryService)
: base(publishedSnapshotAccessor, apiMediaWithCropsResponseBuilder)
=> _apiMediaQueryService = apiMediaQueryService;
[HttpGet]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(PagedViewModel<IApiMediaWithCropsResponse>), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
[Obsolete("Please use version 2 of this API. Will be removed in V15.")]
public async Task<IActionResult> Query(
string? fetch,
[FromQuery] string[] filter,
[FromQuery] string[] sort,
int skip = 0,
int take = 10)
=> await HandleRequest(fetch, filter, sort, skip, take);
/// <summary>
/// Gets a paginated list of media item(s) from query.
/// </summary>
/// <param name="fetch">Optional fetch query parameter value.</param>
/// <param name="filter">Optional filter query parameters values.</param>
/// <param name="sort">Optional sort query parameters values.</param>
/// <param name="skip">The amount of items to skip.</param>
/// <param name="take">The amount of items to take.</param>
/// <returns>The paged result of the media item(s).</returns>
[HttpGet]
[MapToApiVersion("2.0")]
[ProducesResponseType(typeof(PagedViewModel<IApiMediaWithCropsResponse>), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
public async Task<IActionResult> QueryV20(
string? fetch,
[FromQuery] string[] filter,
[FromQuery] string[] sort,
int skip = 0,
int take = 10)
=> await HandleRequest(fetch, filter, sort, skip, take);
private async Task<IActionResult> HandleRequest(string? fetch, string[] filter, string[] sort, int skip, int take)
{
Attempt<PagedModel<Guid>, ApiMediaQueryOperationStatus> queryAttempt = _apiMediaQueryService.ExecuteQuery(fetch, filter, sort, skip, take);
if (queryAttempt.Success is false)
{
return ApiMediaQueryOperationStatusResult(queryAttempt.Status);
}
PagedModel<Guid> pagedResult = queryAttempt.Result;
IPublishedContent[] mediaItems = pagedResult.Items.Select(PublishedMediaCache.GetById).WhereNotNull().ToArray();
var model = new PagedViewModel<IApiMediaWithCropsResponse>
{
Total = pagedResult.Total,
Items = mediaItems.Select(BuildApiMediaWithCrops)
};
return await Task.FromResult(Ok(model));
}
}
@@ -0,0 +1,28 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using OpenIddict.Server.AspNetCore;
using Umbraco.Cms.Api.Delivery.Routing;
using Umbraco.Cms.Core.DeliveryApi;
namespace Umbraco.Cms.Api.Delivery.Controllers.Security;
[ApiVersion("1.0")]
[ApiController]
[VersionedDeliveryApiRoute(Common.Security.Paths.MemberApi.EndpointTemplate)]
[ApiExplorerSettings(IgnoreApi = true)]
[Authorize(AuthenticationSchemes = OpenIddictServerAspNetCoreDefaults.AuthenticationScheme)]
public class CurrentMemberController : DeliveryApiControllerBase
{
private readonly ICurrentMemberClaimsProvider _currentMemberClaimsProvider;
public CurrentMemberController(ICurrentMemberClaimsProvider currentMemberClaimsProvider)
=> _currentMemberClaimsProvider = currentMemberClaimsProvider;
[HttpGet("userinfo")]
public async Task<IActionResult> Userinfo()
{
Dictionary<string, object> claims = await _currentMemberClaimsProvider.GetClaimsAsync();
return Ok(claims);
}
}
@@ -0,0 +1,172 @@
using System.Security.Claims;
using Asp.Versioning;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using OpenIddict.Abstractions;
using OpenIddict.Server.AspNetCore;
using Umbraco.Cms.Api.Delivery.Routing;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Cms.Core.Security;
using Umbraco.Cms.Web.Common.Security;
using Umbraco.Extensions;
using SignInResult = Microsoft.AspNetCore.Mvc.SignInResult;
using IdentitySignInResult = Microsoft.AspNetCore.Identity.SignInResult;
namespace Umbraco.Cms.Api.Delivery.Controllers.Security;
[ApiVersion("1.0")]
[ApiController]
[VersionedDeliveryApiRoute(Common.Security.Paths.MemberApi.EndpointTemplate)]
[ApiExplorerSettings(IgnoreApi = true)]
public class MemberController : DeliveryApiControllerBase
{
private readonly IHttpContextAccessor _httpContextAccessor;
private readonly IMemberSignInManager _memberSignInManager;
private readonly IMemberManager _memberManager;
private readonly DeliveryApiSettings _deliveryApiSettings;
private readonly ILogger<MemberController> _logger;
public MemberController(
IHttpContextAccessor httpContextAccessor,
IMemberSignInManager memberSignInManager,
IMemberManager memberManager,
IOptions<DeliveryApiSettings> deliveryApiSettings,
ILogger<MemberController> logger)
{
_httpContextAccessor = httpContextAccessor;
_memberSignInManager = memberSignInManager;
_memberManager = memberManager;
_logger = logger;
_deliveryApiSettings = deliveryApiSettings.Value;
}
[HttpGet("authorize")]
[MapToApiVersion("1.0")]
public async Task<IActionResult> Authorize()
{
// in principle this is not necessary for now, since the member application has been removed, thus making
// the member client ID invalid for the authentication code flow. However, if we ever add additional flows
// to the API, we should perform this check, so we might as well include it upfront.
if (_deliveryApiSettings.MemberAuthorizationIsEnabled() is false)
{
return BadRequest("Member authorization is not allowed.");
}
HttpContext context = _httpContextAccessor.GetRequiredHttpContext();
OpenIddictRequest? request = context.GetOpenIddictServerRequest();
if (request is null)
{
return BadRequest("Unable to obtain OpenID data from the current request.");
}
// make sure this endpoint ONLY handles member authentication
if (request.ClientId is not Constants.OAuthClientIds.Member)
{
return BadRequest("The specified client ID cannot be used here.");
}
return request.IdentityProvider.IsNullOrWhiteSpace()
? await AuthorizeInternal(request)
: await AuthorizeExternal(request);
}
[HttpGet("signout")]
[MapToApiVersion("1.0")]
public async Task<IActionResult> Signout()
{
await _memberSignInManager.SignOutAsync();
return SignOut(OpenIddictServerAspNetCoreDefaults.AuthenticationScheme);
}
private async Task<IActionResult> AuthorizeInternal(OpenIddictRequest request)
{
// retrieve the user principal stored in the authentication cookie.
AuthenticateResult cookieAuthResult = await HttpContext.AuthenticateAsync(IdentityConstants.ApplicationScheme);
var userName = cookieAuthResult.Succeeded
? cookieAuthResult.Principal?.Identity?.Name
: null;
if (userName is null)
{
return Challenge(IdentityConstants.ApplicationScheme);
}
MemberIdentityUser? member = await _memberManager.FindByNameAsync(userName);
if (member is null)
{
_logger.LogError("The member with username {userName} was successfully authorized, but could not be retrieved by the member manager", userName);
return BadRequest("The member could not be found.");
}
return await SignInMember(member, request);
}
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 _memberSignInManager.GetExternalLoginInfoAsync();
if (loginInfo?.Principal is null)
{
AuthenticationProperties properties = _memberSignInManager.ConfigureExternalAuthenticationProperties(provider, null);
return Challenge(properties, provider);
}
// NOTE: if we're going to support 2FA for members, we need to:
// - use SecuritySettings.MemberBypassTwoFactorForExternalLogins instead of the hardcoded value (true) for "bypassTwoFactor".
// - handle IdentitySignInResult.TwoFactorRequired
IdentitySignInResult result = await _memberSignInManager.ExternalLoginSignInAsync(loginInfo, false, true);
if (result == IdentitySignInResult.Success)
{
// get the member and perform sign-in
MemberIdentityUser? member = await _memberManager.FindByLoginAsync(loginInfo.LoginProvider, loginInfo.ProviderKey);
if (member is null)
{
_logger.LogError("A member was successfully authorized using external authentication, but could not be retrieved by the member manager");
return BadRequest("The member could not be found.");
}
// update member authentication tokens if succeeded
await _memberSignInManager.UpdateExternalAuthenticationTokensAsync(loginInfo);
return await SignInMember(member, request);
}
var errorProperties = new AuthenticationProperties(new Dictionary<string, string?>
{
[OpenIddictServerAspNetCoreConstants.Properties.Error] = OpenIddictConstants.Errors.AccessDenied,
[OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = "The member is not allowed to access this resource."
});
return Forbid(errorProperties, provider);
}
private async Task<IActionResult> SignInMember(MemberIdentityUser member, OpenIddictRequest request)
{
ClaimsPrincipal memberPrincipal = await _memberSignInManager.CreateUserPrincipalAsync(member);
memberPrincipal.SetClaim(OpenIddictConstants.Claims.Subject, member.Key.ToString());
IList<string> roles = await _memberManager.GetRolesAsync(member);
memberPrincipal.SetClaim(Constants.OAuthClaims.MemberKey, member.Key.ToString());
memberPrincipal.SetClaim(Constants.OAuthClaims.MemberRoles, string.Join(",", roles));
Claim[] claims = memberPrincipal.Claims.ToArray();
foreach (Claim claim in claims.Where(claim => claim.Type is not Constants.Security.SecurityStampClaimType))
{
claim.SetDestinations(OpenIddictConstants.Destinations.AccessToken);
}
// "openid" and "offline_access" are the only scopes allowed for members; explicitly ensure we only add those
// NOTE: the "offline_access" scope is required to use refresh tokens
IEnumerable<string> allowedScopes = request
.GetScopes()
.Intersect(new[] { OpenIddictConstants.Scopes.OpenId, OpenIddictConstants.Scopes.OfflineAccess });
memberPrincipal.SetScopes(allowedScopes);
return new SignInResult(OpenIddictServerAspNetCoreDefaults.AuthenticationScheme, memberPrincipal);
}
}
@@ -1,16 +1,29 @@
using System.Text.Json;
using System.Text.Json.Serialization;
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Routing;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Umbraco.Cms.Api.Common.Configuration;
using Microsoft.Extensions.Primitives;
using Umbraco.Cms.Api.Common.DependencyInjection;
using Umbraco.Cms.Api.Delivery.Accessors;
using Umbraco.Cms.Api.Delivery.Caching;
using Umbraco.Cms.Api.Delivery.Configuration;
using Umbraco.Cms.Api.Delivery.Handlers;
using Umbraco.Cms.Api.Delivery.Json;
using Umbraco.Cms.Api.Delivery.Rendering;
using Umbraco.Cms.Api.Delivery.Routing;
using Umbraco.Cms.Api.Delivery.Security;
using Umbraco.Cms.Api.Delivery.Services;
using Umbraco.Cms.Api.Delivery.Services.QueryBuilders;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Cms.Core.DependencyInjection;
using Umbraco.Cms.Core.Notifications;
using Umbraco.Cms.Infrastructure.Security;
using Umbraco.Cms.Web.Common.ApplicationBuilder;
namespace Umbraco.Extensions;
@@ -19,15 +32,43 @@ public static class UmbracoBuilderExtensions
public static IUmbracoBuilder AddDeliveryApi(this IUmbracoBuilder builder)
{
builder.Services.AddScoped<IRequestStartItemProvider, RequestStartItemProvider>();
builder.Services.AddScoped<IOutputExpansionStrategy, RequestContextOutputExpansionStrategy>();
builder.Services.AddScoped<RequestContextOutputExpansionStrategy>();
builder.Services.AddScoped<RequestContextOutputExpansionStrategyV2>();
builder.Services.AddUnique<IOutputExpansionStrategy>(
provider =>
{
HttpContext? httpContext = provider.GetRequiredService<IHttpContextAccessor>().HttpContext;
ApiVersion? apiVersion = httpContext?.GetRequestedApiVersion();
if (apiVersion is null)
{
return provider.GetRequiredService<RequestContextOutputExpansionStrategyV2>();
}
// V1 of the Delivery API uses a different expansion strategy than V2+
return apiVersion.MajorVersion == 1
? provider.GetRequiredService<RequestContextOutputExpansionStrategy>()
: provider.GetRequiredService<RequestContextOutputExpansionStrategyV2>();
},
ServiceLifetime.Scoped);
builder.Services.AddSingleton<IRequestCultureService, RequestCultureService>();
builder.Services.AddSingleton<IRequestRoutingService, RequestRoutingService>();
builder.Services.AddSingleton<IRequestRedirectService, RequestRedirectService>();
builder.Services.AddSingleton<IRequestPreviewService, RequestPreviewService>();
builder.Services.AddSingleton<IOutputExpansionStrategyAccessor, RequestContextOutputExpansionStrategyAccessor>();
// Webooks register a more basic implementation, remove it.
builder.Services.AddUnique<IOutputExpansionStrategyAccessor, RequestContextOutputExpansionStrategyAccessor>(ServiceLifetime.Singleton);
builder.Services.AddSingleton<IRequestStartItemProviderAccessor, RequestContextRequestStartItemProviderAccessor>();
builder.Services.AddSingleton<IApiAccessService, ApiAccessService>();
builder.Services.AddSingleton<IApiContentQueryService, ApiContentQueryService>();
builder.Services.AddSingleton<IApiContentQueryProvider, ApiContentQueryProvider>();
builder.Services.AddSingleton<IApiContentQueryFactory, ApiContentQueryFactory>();
builder.Services.AddSingleton<IApiMediaQueryService, ApiMediaQueryService>();
builder.Services.AddTransient<IMemberApplicationManager, MemberApplicationManager>();
builder.Services.AddTransient<IRequestMemberAccessService, RequestMemberAccessService>();
builder.Services.AddTransient<ICurrentMemberClaimsProvider, CurrentMemberClaimsProvider>();
builder.Services.ConfigureOptions<ConfigureUmbracoDeliveryApiSwaggerGenOptions>();
builder.AddUmbracoApiOpenApiUI();
@@ -43,6 +84,56 @@ public static class UmbracoBuilderExtensions
options.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter());
});
builder.Services.AddAuthentication();
builder.AddUmbracoOpenIddict();
builder.AddNotificationAsyncHandler<UmbracoApplicationStartingNotification, InitializeMemberApplicationNotificationHandler>();
builder.AddNotificationAsyncHandler<MemberSavedNotification, RevokeMemberAuthenticationTokensNotificationHandler>();
builder.AddNotificationAsyncHandler<MemberDeletedNotification, RevokeMemberAuthenticationTokensNotificationHandler>();
builder.AddNotificationAsyncHandler<AssignedMemberRolesNotification, RevokeMemberAuthenticationTokensNotificationHandler>();
builder.AddNotificationAsyncHandler<RemovedMemberRolesNotification, RevokeMemberAuthenticationTokensNotificationHandler>();
// FIXME: remove this when Delivery API V1 is removed
builder.Services.AddSingleton<MatcherPolicy, DeliveryApiItemsEndpointsMatcherPolicy>();
builder.AddOutputCache();
return builder;
}
private static IUmbracoBuilder AddOutputCache(this IUmbracoBuilder builder)
{
DeliveryApiSettings.OutputCacheSettings outputCacheSettings =
builder.Config.GetSection(Constants.Configuration.ConfigDeliveryApi).Get<DeliveryApiSettings>()?.OutputCache
?? new DeliveryApiSettings.OutputCacheSettings();
if (outputCacheSettings.Enabled is false || outputCacheSettings is { ContentDuration.TotalSeconds: <= 0, MediaDuration.TotalSeconds: <= 0 })
{
return builder;
}
builder.Services.AddOutputCache(options =>
{
options.AddBasePolicy(_ => { });
if (outputCacheSettings.ContentDuration.TotalSeconds > 0)
{
options.AddPolicy(
Constants.DeliveryApi.OutputCache.ContentCachePolicy,
new DeliveryApiOutputCachePolicy(
outputCacheSettings.ContentDuration,
new StringValues([Constants.DeliveryApi.HeaderNames.AcceptLanguage, Constants.DeliveryApi.HeaderNames.StartItem])));
}
if (outputCacheSettings.MediaDuration.TotalSeconds > 0)
{
options.AddPolicy(
Constants.DeliveryApi.OutputCache.MediaCachePolicy,
new DeliveryApiOutputCachePolicy(
outputCacheSettings.MediaDuration,
Constants.DeliveryApi.HeaderNames.StartItem));
}
});
builder.Services.Configure<UmbracoPipelineOptions>(options => options.AddFilter(new OutputCachePipelineFilter("UmbracoDeliveryApiOutputCache")));
return builder;
}
}
@@ -0,0 +1,13 @@
using Microsoft.AspNetCore.Mvc.Filters;
namespace Umbraco.Cms.Api.Delivery.Filters;
public sealed class AddVaryHeaderAttribute : ActionFilterAttribute
{
private const string Vary = "Accept-Language, Preview, Start-Item";
public override void OnResultExecuting(ResultExecutingContext context)
=> context.HttpContext.Response.Headers.Vary = context.HttpContext.Response.Headers.Vary.Count > 0
? $"{context.HttpContext.Response.Headers.Vary}, {Vary}"
: Vary;
}
@@ -0,0 +1,35 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
using Umbraco.Cms.Core.DeliveryApi;
namespace Umbraco.Cms.Api.Delivery.Filters;
internal sealed class DeliveryApiMediaAccessAttribute : TypeFilterAttribute
{
public DeliveryApiMediaAccessAttribute()
: base(typeof(DeliveryApiMediaAccessFilter))
{
}
private class DeliveryApiMediaAccessFilter : IActionFilter
{
private readonly IApiAccessService _apiAccessService;
public DeliveryApiMediaAccessFilter(IApiAccessService apiAccessService)
=> _apiAccessService = apiAccessService;
public void OnActionExecuting(ActionExecutingContext context)
{
if (_apiAccessService.HasMediaAccess())
{
return;
}
context.Result = new UnauthorizedResult();
}
public void OnActionExecuted(ActionExecutedContext context)
{
}
}
}
@@ -0,0 +1,182 @@
using Microsoft.OpenApi.Any;
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.SwaggerGen;
using Umbraco.Cms.Api.Delivery.Configuration;
using Umbraco.Cms.Api.Delivery.Controllers;
using Umbraco.Cms.Api.Delivery.Controllers.Content;
namespace Umbraco.Cms.Api.Delivery.Filters;
internal sealed class SwaggerContentDocumentationFilter : SwaggerDocumentationFilterBase<ContentApiControllerBase>
{
protected override string DocumentationLink => DeliveryApiConfiguration.ApiDocumentationContentArticleLink;
protected override void ApplyOperation(OpenApiOperation operation, OperationFilterContext context)
{
operation.Parameters ??= new List<OpenApiParameter>();
AddExpand(operation, context);
AddFields(operation, context);
operation.Parameters.Add(new OpenApiParameter
{
Name = Core.Constants.DeliveryApi.HeaderNames.AcceptLanguage,
In = ParameterLocation.Header,
Required = false,
Description = "Defines the language to return. Use this when querying language variant content items.",
Schema = new OpenApiSchema { Type = "string" },
Examples = new Dictionary<string, OpenApiExample>
{
{ "Default", new OpenApiExample { Value = new OpenApiString(string.Empty) } },
{ "English culture", new OpenApiExample { Value = new OpenApiString("en-us") } }
}
});
AddApiKey(operation);
operation.Parameters.Add(new OpenApiParameter
{
Name = Core.Constants.DeliveryApi.HeaderNames.Preview,
In = ParameterLocation.Header,
Required = false,
Description = "Whether to request draft content.",
Schema = new OpenApiSchema { Type = "boolean" }
});
operation.Parameters.Add(new OpenApiParameter
{
Name = Core.Constants.DeliveryApi.HeaderNames.StartItem,
In = ParameterLocation.Header,
Required = false,
Description = "URL segment or GUID of a root content item.",
Schema = new OpenApiSchema { Type = "string" }
});
}
protected override void ApplyParameter(OpenApiParameter parameter, ParameterFilterContext context)
{
switch (parameter.Name)
{
case "fetch":
AddQueryParameterDocumentation(parameter, FetchQueryParameterExamples(), "Specifies the content items to fetch");
break;
case "filter":
AddQueryParameterDocumentation(parameter, FilterQueryParameterExamples(), "Defines how to filter the fetched content items");
break;
case "sort":
AddQueryParameterDocumentation(parameter, SortQueryParameterExamples(), "Defines how to sort the found content items");
break;
case "skip":
parameter.Description = PaginationDescription(true, "content");
break;
case "take":
parameter.Description = PaginationDescription(false, "content");
break;
default:
return;
}
}
private Dictionary<string, OpenApiExample> FetchQueryParameterExamples() =>
new()
{
{ "Select all", new OpenApiExample { Value = new OpenApiString(string.Empty) } },
{
"Select all ancestors of a node by id",
new OpenApiExample { Value = new OpenApiString("ancestors:id") }
},
{
"Select all ancestors of a node by path",
new OpenApiExample { Value = new OpenApiString("ancestors:path") }
},
{
"Select all children of a node by id",
new OpenApiExample { Value = new OpenApiString("children:id") }
},
{
"Select all children of a node by path",
new OpenApiExample { Value = new OpenApiString("children:path") }
},
{
"Select all descendants of a node by id",
new OpenApiExample { Value = new OpenApiString("descendants:id") }
},
{
"Select all descendants of a node by path",
new OpenApiExample { Value = new OpenApiString("descendants:path") }
}
};
private Dictionary<string, OpenApiExample> FilterQueryParameterExamples() =>
new()
{
{ "Default filter", new OpenApiExample { Value = new OpenApiString(string.Empty) } },
{
"Filter by content type (equals)",
new OpenApiExample { Value = new OpenApiArray { new OpenApiString("contentType:alias1") } }
},
{
"Filter by name (contains)",
new OpenApiExample { Value = new OpenApiArray { new OpenApiString("name:nodeName") } }
},
{
"Filter by creation date (less than)",
new OpenApiExample { Value = new OpenApiArray { new OpenApiString("createDate<2024-01-01") } }
},
{
"Filter by update date (greater than or equal)",
new OpenApiExample { Value = new OpenApiArray { new OpenApiString("updateDate>:2023-01-01") } }
}
};
private Dictionary<string, OpenApiExample> SortQueryParameterExamples() =>
new()
{
{ "Default sort", new OpenApiExample { Value = new OpenApiString(string.Empty) } },
{
"Sort by create date",
new OpenApiExample
{
Value = new OpenApiArray
{
new OpenApiString("createDate:asc"), new OpenApiString("createDate:desc")
}
}
},
{
"Sort by level",
new OpenApiExample
{
Value = new OpenApiArray { new OpenApiString("level:asc"), new OpenApiString("level:desc") }
}
},
{
"Sort by name",
new OpenApiExample
{
Value = new OpenApiArray { new OpenApiString("name:asc"), new OpenApiString("name:desc") }
}
},
{
"Sort by sort order",
new OpenApiExample
{
Value = new OpenApiArray
{
new OpenApiString("sortOrder:asc"), new OpenApiString("sortOrder:desc")
}
}
},
{
"Sort by update date",
new OpenApiExample
{
Value = new OpenApiArray
{
new OpenApiString("updateDate:asc"), new OpenApiString("updateDate:desc")
}
}
}
};
}
@@ -0,0 +1,18 @@
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.SwaggerGen;
namespace Umbraco.Cms.Api.Delivery.Filters;
[Obsolete($"Superseded by {nameof(SwaggerContentDocumentationFilter)} and {nameof(SwaggerMediaDocumentationFilter)}. Will be removed in V14.")]
public class SwaggerDocumentationFilter : IOperationFilter, IParameterFilter
{
public void Apply(OpenApiOperation operation, OperationFilterContext context)
{
// retained for backwards compat
}
public void Apply(OpenApiParameter parameter, ParameterFilterContext context)
{
// retained for backwards compat
}
}
@@ -0,0 +1,159 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.OpenApi.Any;
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.SwaggerGen;
namespace Umbraco.Cms.Api.Delivery.Filters;
internal abstract class SwaggerDocumentationFilterBase<TBaseController>
: SwaggerFilterBase<TBaseController>, IOperationFilter, IParameterFilter
where TBaseController : Controller
{
public void Apply(OpenApiOperation operation, OperationFilterContext context)
{
if (CanApply(context))
{
ApplyOperation(operation, context);
}
}
public void Apply(OpenApiParameter parameter, ParameterFilterContext context)
{
if (CanApply(context))
{
ApplyParameter(parameter, context);
}
}
protected abstract string DocumentationLink { get; }
protected abstract void ApplyOperation(OpenApiOperation operation, OperationFilterContext context);
protected abstract void ApplyParameter(OpenApiParameter parameter, ParameterFilterContext context);
protected void AddQueryParameterDocumentation(OpenApiParameter parameter, Dictionary<string, OpenApiExample> examples, string description)
{
parameter.Description = QueryParameterDescription(description);
parameter.Examples = examples;
}
protected void AddExpand(OpenApiOperation operation, OperationFilterContext context)
{
if (IsApiV1(context))
{
AddExpandV1(operation);
}
else
{
AddExpand(operation);
}
}
protected void AddFields(OpenApiOperation operation, OperationFilterContext context)
{
if (IsApiV1(context))
{
// "fields" is not a thing in Delivery API V1
return;
}
AddFields(operation);
}
protected void AddApiKey(OpenApiOperation operation) =>
operation.Parameters.Add(new OpenApiParameter
{
Name = Core.Constants.DeliveryApi.HeaderNames.ApiKey,
In = ParameterLocation.Header,
Required = false,
Description = "API key specified through configuration to authorize access to the API.",
Schema = new OpenApiSchema { Type = "string" }
});
protected string PaginationDescription(bool skip, string itemType)
=> $"Specifies the number of found {itemType} items to {(skip ? "skip" : "take")}. Use this to control pagination of the response.";
private string QueryParameterDescription(string description)
=> $"{description}. Refer to [the documentation]({DocumentationLink}#query-parameters) for more details on this.";
// FIXME: remove this when Delivery API V1 has been removed (expectedly in V15)
private static bool IsApiV1(OperationFilterContext context)
=> context.ApiDescription.RelativePath?.Contains("api/v1") is true;
// FIXME: remove this when Delivery API V1 has been removed (expectedly in V15)
private void AddExpandV1(OpenApiOperation operation)
=> operation.Parameters.Add(new OpenApiParameter
{
Name = "expand",
In = ParameterLocation.Query,
Required = false,
Description = QueryParameterDescription("Defines the properties that should be expanded in the response"),
Schema = new OpenApiSchema { Type = "string" },
Examples = new Dictionary<string, OpenApiExample>
{
{ "Expand none", new OpenApiExample { Value = new OpenApiString(string.Empty) } },
{ "Expand all", new OpenApiExample { Value = new OpenApiString("all") } },
{
"Expand specific property",
new OpenApiExample { Value = new OpenApiString("property:alias1") }
},
{
"Expand specific properties",
new OpenApiExample { Value = new OpenApiString("property:alias1,alias2") }
}
}
});
private void AddExpand(OpenApiOperation operation)
=> operation.Parameters.Add(new OpenApiParameter
{
Name = "expand",
In = ParameterLocation.Query,
Required = false,
Description = QueryParameterDescription("Defines the properties that should be expanded in the response"),
Schema = new OpenApiSchema { Type = "string" },
Examples = new Dictionary<string, OpenApiExample>
{
{ "Expand none", new OpenApiExample { Value = new OpenApiString(string.Empty) } },
{ "Expand all properties", new OpenApiExample { Value = new OpenApiString("properties[$all]") } },
{
"Expand specific property",
new OpenApiExample { Value = new OpenApiString("properties[alias1]") }
},
{
"Expand specific properties",
new OpenApiExample { Value = new OpenApiString("properties[alias1,alias2]") }
},
{
"Expand nested properties",
new OpenApiExample { Value = new OpenApiString("properties[alias1[properties[nestedAlias1,nestedAlias2]]]") }
}
}
});
private void AddFields(OpenApiOperation operation)
=> operation.Parameters.Add(new OpenApiParameter
{
Name = "fields",
In = ParameterLocation.Query,
Required = false,
Description = QueryParameterDescription("Explicitly defines which properties should be included in the response (by default all properties are included)"),
Schema = new OpenApiSchema { Type = "string" },
Examples = new Dictionary<string, OpenApiExample>
{
{ "Include all properties", new OpenApiExample { Value = new OpenApiString("properties[$all]") } },
{
"Include only specific property",
new OpenApiExample { Value = new OpenApiString("properties[alias1]") }
},
{
"Include only specific properties",
new OpenApiExample { Value = new OpenApiString("properties[alias1,alias2]") }
},
{
"Include only specific nested properties",
new OpenApiExample { Value = new OpenApiString("properties[alias1[properties[nestedAlias1,nestedAlias2]]]") }
}
}
});
}
@@ -0,0 +1,19 @@
using System.Reflection;
using Microsoft.AspNetCore.Mvc;
using Swashbuckle.AspNetCore.SwaggerGen;
using Umbraco.Extensions;
namespace Umbraco.Cms.Api.Delivery.Filters;
internal abstract class SwaggerFilterBase<TBaseController>
where TBaseController : Controller
{
protected bool CanApply(OperationFilterContext context)
=> CanApply(context.MethodInfo);
protected bool CanApply(ParameterFilterContext context)
=> CanApply(context.ParameterInfo.Member);
private bool CanApply(MemberInfo member)
=> member.DeclaringType?.Implements<TBaseController>() is true;
}
@@ -0,0 +1,122 @@
using Microsoft.OpenApi.Any;
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.SwaggerGen;
using Umbraco.Cms.Api.Delivery.Configuration;
using Umbraco.Cms.Api.Delivery.Controllers;
using Umbraco.Cms.Api.Delivery.Controllers.Media;
namespace Umbraco.Cms.Api.Delivery.Filters;
internal sealed class SwaggerMediaDocumentationFilter : SwaggerDocumentationFilterBase<MediaApiControllerBase>
{
protected override string DocumentationLink => DeliveryApiConfiguration.ApiDocumentationMediaArticleLink;
protected override void ApplyOperation(OpenApiOperation operation, OperationFilterContext context)
{
operation.Parameters ??= new List<OpenApiParameter>();
AddExpand(operation, context);
AddFields(operation, context);
AddApiKey(operation);
}
protected override void ApplyParameter(OpenApiParameter parameter, ParameterFilterContext context)
{
switch (parameter.Name)
{
case "fetch":
AddQueryParameterDocumentation(parameter, FetchQueryParameterExamples(), "Specifies the media items to fetch");
break;
case "filter":
AddQueryParameterDocumentation(parameter, FilterQueryParameterExamples(), "Defines how to filter the fetched media items");
break;
case "sort":
AddQueryParameterDocumentation(parameter, SortQueryParameterExamples(), "Defines how to sort the found media items");
break;
case "skip":
parameter.Description = PaginationDescription(true, "media");
break;
case "take":
parameter.Description = PaginationDescription(false, "media");
break;
default:
return;
}
}
private Dictionary<string, OpenApiExample> FetchQueryParameterExamples() =>
new()
{
{
"Select all children at root level",
new OpenApiExample { Value = new OpenApiString("children:/") }
},
{
"Select all children of a media item by id",
new OpenApiExample { Value = new OpenApiString("children:id") }
},
{
"Select all children of a media item by path",
new OpenApiExample { Value = new OpenApiString("children:path") }
}
};
private Dictionary<string, OpenApiExample> FilterQueryParameterExamples() =>
new()
{
{ "Default filter", new OpenApiExample { Value = new OpenApiString(string.Empty) } },
{
"Filter by media type",
new OpenApiExample { Value = new OpenApiArray { new OpenApiString("mediaType:alias1") } }
},
{
"Filter by name",
new OpenApiExample { Value = new OpenApiArray { new OpenApiString("name:nodeName") } }
}
};
private Dictionary<string, OpenApiExample> SortQueryParameterExamples() =>
new()
{
{ "Default sort", new OpenApiExample { Value = new OpenApiString(string.Empty) } },
{
"Sort by create date",
new OpenApiExample
{
Value = new OpenApiArray
{
new OpenApiString("createDate:asc"), new OpenApiString("createDate:desc")
}
}
},
{
"Sort by name",
new OpenApiExample
{
Value = new OpenApiArray { new OpenApiString("name:asc"), new OpenApiString("name:desc") }
}
},
{
"Sort by sort order",
new OpenApiExample
{
Value = new OpenApiArray
{
new OpenApiString("sortOrder:asc"), new OpenApiString("sortOrder:desc")
}
}
},
{
"Sort by update date",
new OpenApiExample
{
Value = new OpenApiArray
{
new OpenApiString("updateDate:asc"), new OpenApiString("updateDate:desc")
}
}
}
};
}
@@ -0,0 +1,112 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Cms.Core.Events;
using Umbraco.Cms.Core.Notifications;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Sync;
using Umbraco.Cms.Infrastructure.Security;
namespace Umbraco.Cms.Api.Delivery.Handlers;
internal sealed class InitializeMemberApplicationNotificationHandler : INotificationAsyncHandler<UmbracoApplicationStartingNotification>
{
private readonly IRuntimeState _runtimeState;
private readonly ILogger<InitializeMemberApplicationNotificationHandler> _logger;
private readonly DeliveryApiSettings _deliveryApiSettings;
private readonly IServiceScopeFactory _serviceScopeFactory;
private readonly IServerRoleAccessor _serverRoleAccessor;
private static readonly SemaphoreSlim _locker = new(1);
private static bool _isInitialized = false;
public InitializeMemberApplicationNotificationHandler(
IRuntimeState runtimeState,
IOptions<DeliveryApiSettings> deliveryApiSettings,
ILogger<InitializeMemberApplicationNotificationHandler> logger,
IServiceScopeFactory serviceScopeFactory,
IServerRoleAccessor serverRoleAccessor)
{
_runtimeState = runtimeState;
_logger = logger;
_serviceScopeFactory = serviceScopeFactory;
_serverRoleAccessor = serverRoleAccessor;
_deliveryApiSettings = deliveryApiSettings.Value;
}
public async Task HandleAsync(UmbracoApplicationStartingNotification notification, CancellationToken cancellationToken)
{
if (_runtimeState.Level != RuntimeLevel.Run)
{
return;
}
if (_serverRoleAccessor.CurrentServerRole is ServerRole.Subscriber)
{
// subscriber instances should not alter the member application
return;
}
try
{
await _locker.WaitAsync(cancellationToken);
if (_isInitialized)
{
return;
}
_isInitialized = true;
// we cannot inject the IMemberApplicationManager because it ultimately takes a dependency on the DbContext ... and during
// install that is not allowed (no connection string means no DbContext)
using IServiceScope scope = _serviceScopeFactory.CreateScope();
IMemberApplicationManager memberApplicationManager = scope.ServiceProvider.GetRequiredService<IMemberApplicationManager>();
if (_deliveryApiSettings.MemberAuthorization?.AuthorizationCodeFlow?.Enabled is not true)
{
await memberApplicationManager.DeleteMemberApplicationAsync(cancellationToken);
return;
}
if (ValidateRedirectUrls(_deliveryApiSettings.MemberAuthorization.AuthorizationCodeFlow.LoginRedirectUrls) is false)
{
await memberApplicationManager.DeleteMemberApplicationAsync(cancellationToken);
return;
}
if (_deliveryApiSettings.MemberAuthorization.AuthorizationCodeFlow.LogoutRedirectUrls.Any()
&& ValidateRedirectUrls(_deliveryApiSettings.MemberAuthorization.AuthorizationCodeFlow.LogoutRedirectUrls) is false)
{
await memberApplicationManager.DeleteMemberApplicationAsync(cancellationToken);
return;
}
await memberApplicationManager.EnsureMemberApplicationAsync(
_deliveryApiSettings.MemberAuthorization.AuthorizationCodeFlow.LoginRedirectUrls,
_deliveryApiSettings.MemberAuthorization.AuthorizationCodeFlow.LogoutRedirectUrls,
cancellationToken);
}
finally
{
_locker.Release();
}
}
private bool ValidateRedirectUrls(Uri[] redirectUrls)
{
if (redirectUrls.Any() is false)
{
_logger.LogWarning("No redirect URLs defined for Delivery API member authentication - cannot enable member authentication");
return false;
}
if (redirectUrls.All(url => url.IsAbsoluteUri) is false)
{
_logger.LogWarning("All redirect URLs defined for Delivery API member authentication must be absolute - cannot enable member authentication");
return false;
}
return true;
}
}
@@ -0,0 +1,102 @@
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using OpenIddict.Abstractions;
using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Cms.Core.Events;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Notifications;
using Umbraco.Cms.Core.Services;
namespace Umbraco.Cms.Api.Delivery.Handlers;
internal sealed class RevokeMemberAuthenticationTokensNotificationHandler
: INotificationAsyncHandler<MemberSavedNotification>,
INotificationAsyncHandler<MemberDeletedNotification>,
INotificationAsyncHandler<AssignedMemberRolesNotification>,
INotificationAsyncHandler<RemovedMemberRolesNotification>
{
private readonly IMemberService _memberService;
private readonly IOpenIddictTokenManager _tokenManager;
private readonly bool _enabled;
private readonly ILogger<RevokeMemberAuthenticationTokensNotificationHandler> _logger;
public RevokeMemberAuthenticationTokensNotificationHandler(
IMemberService memberService,
IOpenIddictTokenManager tokenManager,
IOptions<DeliveryApiSettings> deliveryApiSettings,
ILogger<RevokeMemberAuthenticationTokensNotificationHandler> logger)
{
_memberService = memberService;
_tokenManager = tokenManager;
_logger = logger;
_enabled = deliveryApiSettings.Value.MemberAuthorizationIsEnabled();
}
public async Task HandleAsync(MemberSavedNotification notification, CancellationToken cancellationToken)
{
if (_enabled is false)
{
return;
}
foreach (IMember member in notification.SavedEntities.Where(member => member.IsLockedOut || member.IsApproved is false))
{
// member is locked out and/or un-approved, make sure we revoke all tokens
await RevokeTokensAsync(member);
}
}
public async Task HandleAsync(MemberDeletedNotification notification, CancellationToken cancellationToken)
{
if (_enabled is false)
{
return;
}
foreach (IMember member in notification.DeletedEntities)
{
await RevokeTokensAsync(member);
}
}
public async Task HandleAsync(AssignedMemberRolesNotification notification, CancellationToken cancellationToken)
=> await MemberRolesChangedAsync(notification);
public async Task HandleAsync(RemovedMemberRolesNotification notification, CancellationToken cancellationToken)
=> await MemberRolesChangedAsync(notification);
private async Task RevokeTokensAsync(IMember member)
{
var tokens = await _tokenManager.FindBySubjectAsync(member.Key.ToString()).ToArrayAsync();
if (tokens.Any() is false)
{
return;
}
_logger.LogInformation("Deleting {count} active tokens for member with ID {id}", tokens.Length, member.Id);
foreach (var token in tokens)
{
await _tokenManager.DeleteAsync(token);
}
}
private async Task MemberRolesChangedAsync(MemberRolesNotification notification)
{
if (_enabled is false)
{
return;
}
foreach (var memberId in notification.MemberIds)
{
IMember? member = _memberService.GetById(memberId);
if (member is null)
{
_logger.LogWarning("Unable to find member with ID {id}", memberId);
continue;
}
await RevokeTokensAsync(member);
}
}
}
@@ -0,0 +1,15 @@
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Cms.Core.Models;
namespace Umbraco.Cms.Api.Delivery.Indexing.Filters;
public sealed class NameFilterIndexer : IContentIndexHandler
{
internal const string FieldName = "name";
public IEnumerable<IndexFieldValue> GetFieldValues(IContent content, string? culture)
=> new[] { new IndexFieldValue { FieldName = FieldName, Values = new object[] { content.GetCultureName(culture) ?? string.Empty } } };
public IEnumerable<IndexField> GetFields()
=> new[] { new IndexField { FieldName = FieldName, FieldType = FieldType.StringAnalyzed, VariesByCulture = true } };
}
@@ -5,7 +5,7 @@ namespace Umbraco.Cms.Api.Delivery.Indexing.Sorts;
public sealed class NameSortIndexer : IContentIndexHandler
{
internal const string FieldName = "name";
internal const string FieldName = "sortName";
public IEnumerable<IndexFieldValue> GetFieldValues(IContent content, string? culture)
=> new[] { new IndexFieldValue { FieldName = FieldName, Values = new object[] { content.GetCultureName(culture) ?? string.Empty } } };
@@ -6,30 +6,42 @@ using Umbraco.Cms.Core.Models.DeliveryApi;
namespace Umbraco.Cms.Api.Delivery.Json;
// see https://learn.microsoft.com/en-us/dotnet/standard/serialization/system-text-json/polymorphism?pivots=dotnet-7-0
// TODO: if this type resolver is to be used for extendable content models (custom IApiContent implementations) we need to work out an extension model for known derived types
internal sealed class DeliveryApiJsonTypeResolver : DefaultJsonTypeInfoResolver
public class DeliveryApiJsonTypeResolver : DefaultJsonTypeInfoResolver
{
public override JsonTypeInfo GetTypeInfo(Type type, JsonSerializerOptions options)
{
JsonTypeInfo jsonTypeInfo = base.GetTypeInfo(type, options);
if (jsonTypeInfo.Type == typeof(IApiContent))
Type[] derivedTypes = GetDerivedTypes(jsonTypeInfo);
if (derivedTypes.Length > 0)
{
ConfigureJsonPolymorphismOptions(jsonTypeInfo, typeof(ApiContent));
}
else if (jsonTypeInfo.Type == typeof(IApiContentResponse))
{
ConfigureJsonPolymorphismOptions(jsonTypeInfo, typeof(ApiContentResponse));
}
else if (jsonTypeInfo.Type == typeof(IRichTextElement))
{
ConfigureJsonPolymorphismOptions(jsonTypeInfo, typeof(RichTextGenericElement), typeof(RichTextTextElement));
ConfigureJsonPolymorphismOptions(jsonTypeInfo, derivedTypes);
}
return jsonTypeInfo;
}
private void ConfigureJsonPolymorphismOptions(JsonTypeInfo jsonTypeInfo, params Type[] derivedTypes)
protected virtual Type[] GetDerivedTypes(JsonTypeInfo jsonTypeInfo)
{
if (jsonTypeInfo.Type == typeof(IApiContent))
{
return new[] { typeof(ApiContent) };
}
if (jsonTypeInfo.Type == typeof(IApiContentResponse))
{
return new[] { typeof(ApiContentResponse) };
}
if (jsonTypeInfo.Type == typeof(IRichTextElement))
{
return new[] { typeof(RichTextRootElement), typeof(RichTextGenericElement), typeof(RichTextTextElement) };
}
return Array.Empty<Type>();
}
protected void ConfigureJsonPolymorphismOptions(JsonTypeInfo jsonTypeInfo, params Type[] derivedTypes)
{
jsonTypeInfo.PolymorphismOptions = new JsonPolymorphismOptions
{
@@ -0,0 +1,78 @@
using System.Text.RegularExpressions;
using Umbraco.Cms.Core.DeliveryApi;
namespace Umbraco.Cms.Api.Delivery.Querying.Filters;
public abstract class ContainsFilterBase : IFilterHandler
{
/// <summary>
/// The regex to parse the filter query. Must supply two match groups named "operator" and "value", where "operator"
/// contains the filter operator (i.e. ">") and "value" contains the value to filter on.
/// </summary>
/// <remarks>
/// Supported operators:
/// <list type="bullet">
/// <item>":" = Is (the filter value equals the index field value)</item>
/// <item>":!" = IsNot (the filter value does not equal the index field value)</item>
/// <item>"&gt;" = GreaterThan (the filter value is greater than the index field value)</item>
/// <item>"&gt;:" = GreaterThanOrEqual (the filter value is greater than or equal to the index field value)</item>
/// <item>"&lt;" = LessThan (the filter value is less than the index field value)</item>
/// <item>"&lt;:" = LessThanOrEqual (the filter value is less than or equal to the index field value)</item>
/// </list>
/// Range operators (greater than, less than) only work with numeric and date type filters.
/// </remarks>
protected abstract Regex QueryParserRegex { get; }
/// <summary>
/// The index field name to filter on.
/// </summary>
protected abstract string FieldName { get; }
/// <inheritdoc />
public bool CanHandle(string query)
=> QueryParserRegex.IsMatch(query);
/// <inheritdoc/>
public FilterOption BuildFilterOption(string filter)
{
GroupCollection groups = QueryParserRegex.Match(filter).Groups;
if (groups.Count != 3 || groups.ContainsKey("operator") is false || groups.ContainsKey("value") is false)
{
return DefaultFilterOption();
}
FilterOperation? filterOperation = ParseFilterOperation(groups["operator"].Value);
if (filterOperation.HasValue is false)
{
return DefaultFilterOption();
}
return new FilterOption
{
FieldName = FieldName,
Values = new[] { groups["value"].Value },
Operator = filterOperation.Value
};
FilterOption DefaultFilterOption()
=> new FilterOption
{
FieldName = FieldName,
Values = new[] { Guid.NewGuid().ToString() },
Operator = FilterOperation.Is
};
}
private FilterOperation? ParseFilterOperation(string filterOperation)
=> filterOperation switch
{
":" => FilterOperation.Is,
":!" => FilterOperation.IsNot,
">" => FilterOperation.GreaterThan,
">:" => FilterOperation.GreaterThanOrEqual,
"<" => FilterOperation.LessThan,
"<:" => FilterOperation.LessThanOrEqual,
_ => null
};
}
@@ -1,6 +1,5 @@
using Umbraco.Cms.Api.Delivery.Indexing.Filters;
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Extensions;
namespace Umbraco.Cms.Api.Delivery.Querying.Filters;
@@ -15,15 +14,15 @@ public sealed class ContentTypeFilter : IFilterHandler
/// <inheritdoc/>
public FilterOption BuildFilterOption(string filter)
{
var alias = filter.Substring(ContentTypeSpecifier.Length);
var filterValue = filter.Substring(ContentTypeSpecifier.Length);
var negate = filterValue.StartsWith('!');
var aliases = filterValue.TrimStart('!').Split(',', StringSplitOptions.TrimEntries | StringSplitOptions.RemoveEmptyEntries);
return new FilterOption
{
FieldName = ContentTypeFilterIndexer.FieldName,
Values = alias.IsNullOrWhiteSpace() == false
? new[] { alias.TrimStart('!') }
: Array.Empty<string>(),
Operator = alias.StartsWith('!')
Values = aliases,
Operator = negate
? FilterOperation.IsNot
: FilterOperation.Is
};
@@ -0,0 +1,14 @@
using System.Text.RegularExpressions;
using Umbraco.Cms.Api.Delivery.Indexing.Sorts;
namespace Umbraco.Cms.Api.Delivery.Querying.Filters;
public sealed partial class CreateDateFilter : ContainsFilterBase
{
protected override string FieldName => CreateDateSortIndexer.FieldName;
protected override Regex QueryParserRegex => CreateDateRegex();
[GeneratedRegex("createDate(?<operator>[><:]{1,2})(?<value>.*)", RegexOptions.IgnoreCase)]
public static partial Regex CreateDateRegex();
}
@@ -1,6 +1,6 @@
using Umbraco.Cms.Api.Delivery.Indexing.Sorts;
using Umbraco.Cms.Api.Delivery.Indexing.Filters;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Extensions;
namespace Umbraco.Cms.Api.Delivery.Querying.Filters;
@@ -16,16 +16,16 @@ public sealed class NameFilter : IFilterHandler
public FilterOption BuildFilterOption(string filter)
{
var value = filter.Substring(NameSpecifier.Length);
var negate = value.StartsWith('!');
var values = value.TrimStart('!').Split(Constants.CharArrays.Comma);
return new FilterOption
{
FieldName = NameSortIndexer.FieldName,
Values = value.IsNullOrWhiteSpace() == false
? new[] { value.TrimStart('!') }
: Array.Empty<string>(),
Operator = value.StartsWith('!')
? FilterOperation.IsNot
: FilterOperation.Is
FieldName = NameFilterIndexer.FieldName,
Values = values,
Operator = negate
? FilterOperation.DoesNotContain
: FilterOperation.Contains
};
}
}
@@ -0,0 +1,14 @@
using System.Text.RegularExpressions;
using Umbraco.Cms.Api.Delivery.Indexing.Sorts;
namespace Umbraco.Cms.Api.Delivery.Querying.Filters;
public sealed partial class UpdateDateFilter : ContainsFilterBase
{
protected override string FieldName => UpdateDateSortIndexer.FieldName;
protected override Regex QueryParserRegex => UpdateDateRegex();
[GeneratedRegex("updateDate(?<operator>[><:]{1,2})(?<value>.*)", RegexOptions.IgnoreCase)]
public static partial Regex UpdateDateRegex();
}
@@ -10,7 +10,8 @@ public abstract class QueryOptionBase
private readonly IPublishedSnapshotAccessor _publishedSnapshotAccessor;
private readonly IRequestRoutingService _requestRoutingService;
public QueryOptionBase(IPublishedSnapshotAccessor publishedSnapshotAccessor,
public QueryOptionBase(
IPublishedSnapshotAccessor publishedSnapshotAccessor,
IRequestRoutingService requestRoutingService)
{
_publishedSnapshotAccessor = publishedSnapshotAccessor;
@@ -1,5 +1,7 @@
using Microsoft.Extensions.DependencyInjection;
using Umbraco.Cms.Api.Delivery.Indexing.Selectors;
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Cms.Core.DependencyInjection;
using Umbraco.Cms.Core.Models.PublishedContent;
using Umbraco.Cms.Core.PublishedCache;
using Umbraco.Extensions;
@@ -10,10 +12,21 @@ public sealed class AncestorsSelector : QueryOptionBase, ISelectorHandler
{
private const string AncestorsSpecifier = "ancestors:";
private readonly IPublishedSnapshotAccessor _publishedSnapshotAccessor;
private readonly IRequestPreviewService _requestPreviewService;
public AncestorsSelector(IPublishedSnapshotAccessor publishedSnapshotAccessor, IRequestRoutingService requestRoutingService)
: base(publishedSnapshotAccessor, requestRoutingService) =>
[Obsolete("Please use the non-obsolete constructor. Will be removed in V17.")]
public AncestorsSelector(IPublishedSnapshotAccessor publishedSnapshotAccessor,
IRequestRoutingService requestRoutingService)
: this(publishedSnapshotAccessor, requestRoutingService, StaticServiceProvider.Instance.GetRequiredService<IRequestPreviewService>())
{
}
public AncestorsSelector(IPublishedSnapshotAccessor publishedSnapshotAccessor, IRequestRoutingService requestRoutingService, IRequestPreviewService requestPreviewService)
: base(publishedSnapshotAccessor, requestRoutingService)
{
_publishedSnapshotAccessor = publishedSnapshotAccessor;
_requestPreviewService = requestPreviewService;
}
/// <inheritdoc />
public bool CanHandle(string query)
@@ -37,10 +50,20 @@ public sealed class AncestorsSelector : QueryOptionBase, ISelectorHandler
};
}
IPublishedSnapshot publishedSnapshot = _publishedSnapshotAccessor.GetRequiredPublishedSnapshot();
IPublishedContentCache contentCache = _publishedSnapshotAccessor.GetRequiredPublishedSnapshot()?.Content
?? throw new InvalidOperationException("Could not obtain the content cache");
IPublishedContent contentItem = publishedSnapshot.Content?.GetById((Guid)id)
?? throw new InvalidOperationException("Could not obtain the content cache");
IPublishedContent? contentItem = contentCache.GetById(_requestPreviewService.IsPreview(), id.Value);
if (contentItem is null)
{
// no such content item, make sure the selector does not yield any results
return new SelectorOption
{
FieldName = AncestorsSelectorIndexer.FieldName,
Values = Array.Empty<string>()
};
}
var ancestorKeys = contentItem.Ancestors().Select(a => a.Key.ToString("D")).ToArray();
@@ -8,13 +8,15 @@ namespace Umbraco.Cms.Api.Delivery.Rendering;
internal sealed class RequestContextOutputExpansionStrategy : IOutputExpansionStrategy
{
private readonly IApiPropertyRenderer _propertyRenderer;
private readonly bool _expandAll;
private readonly string[] _expandAliases;
private ExpansionState _state;
public RequestContextOutputExpansionStrategy(IHttpContextAccessor httpContextAccessor)
public RequestContextOutputExpansionStrategy(IHttpContextAccessor httpContextAccessor, IApiPropertyRenderer propertyRenderer)
{
_propertyRenderer = propertyRenderer;
(bool ExpandAll, string[] ExpanedAliases) initialState = InitialRequestState(httpContextAccessor);
_expandAll = initialState.ExpandAll;
_expandAliases = initialState.ExpanedAliases;
@@ -24,7 +26,7 @@ internal sealed class RequestContextOutputExpansionStrategy : IOutputExpansionSt
public IDictionary<string, object?> MapElementProperties(IPublishedElement element)
=> element.Properties.ToDictionary(
p => p.Alias,
p => p.GetDeliveryApiValue(_state == ExpansionState.Expanding));
p => GetPropertyValue(p, _state == ExpansionState.Expanding));
public IDictionary<string, object?> MapContentProperties(IPublishedContent content)
=> content.ItemType == PublishedItemType.Content
@@ -66,7 +68,7 @@ internal sealed class RequestContextOutputExpansionStrategy : IOutputExpansionSt
_state = ExpansionState.Expanding;
}
var value = property.GetDeliveryApiValue(_state == ExpansionState.Expanding);
var value = GetPropertyValue(property, _state == ExpansionState.Expanding);
// always revert to pending after rendering the property value
_state = ExpansionState.Pending;
@@ -84,7 +86,7 @@ internal sealed class RequestContextOutputExpansionStrategy : IOutputExpansionSt
_state = ExpansionState.Expanded;
var rendered = properties.ToDictionary(
property => property.Alias,
property => property.GetDeliveryApiValue(false));
property => GetPropertyValue(property, false));
_state = ExpansionState.Expanding;
return rendered;
}
@@ -108,6 +110,9 @@ internal sealed class RequestContextOutputExpansionStrategy : IOutputExpansionSt
: Array.Empty<string>());
}
private object? GetPropertyValue(IPublishedProperty property, bool expanding)
=> _propertyRenderer.GetPropertyValue(property, expanding);
private enum ExpansionState
{
Initial,
@@ -0,0 +1,49 @@
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Logging;
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Cms.Web.Common.Rendering;
namespace Umbraco.Cms.Api.Delivery.Rendering;
internal sealed class RequestContextOutputExpansionStrategyV2 : ElementOnlyOutputExpansionStrategy, IOutputExpansionStrategy
{
private readonly ILogger<RequestContextOutputExpansionStrategyV2> _logger;
public RequestContextOutputExpansionStrategyV2(
IHttpContextAccessor httpContextAccessor,
IApiPropertyRenderer propertyRenderer,
ILogger<RequestContextOutputExpansionStrategyV2> logger)
: base(propertyRenderer)
{
_logger = logger;
InitializeExpandAndInclude(httpContextAccessor);
}
private void InitializeExpandAndInclude(IHttpContextAccessor httpContextAccessor)
{
string? QueryValue(string key) => httpContextAccessor.HttpContext?.Request.Query[key];
var toExpand = QueryValue(ExpandParameterName) ?? None;
var toInclude = QueryValue(FieldsParameterName) ?? All;
try
{
ExpandProperties.Push(Node.Parse(toExpand));
}
catch (ArgumentException ex)
{
_logger.LogError(ex, $"Could not parse the '{ExpandParameterName}' parameter. See exception for details.");
throw new ArgumentException($"Could not parse the '{ExpandParameterName}' parameter: {ex.Message}");
}
try
{
IncludeProperties.Push(Node.Parse(toInclude));
}
catch (ArgumentException ex)
{
_logger.LogError(ex, $"Could not parse the '{FieldsParameterName}' parameter. See exception for details.");
throw new ArgumentException($"Could not parse the '{FieldsParameterName}' parameter: {ex.Message}");
}
}
}
@@ -0,0 +1,82 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc.Controllers;
using Microsoft.AspNetCore.Routing;
using Microsoft.AspNetCore.Routing.Matching;
using Umbraco.Cms.Api.Delivery.Controllers.Content;
using Umbraco.Cms.Api.Delivery.Controllers.Media;
namespace Umbraco.Cms.Api.Delivery.Routing;
// FIXME: remove this when Delivery API V1 is removed
internal sealed class DeliveryApiItemsEndpointsMatcherPolicy : MatcherPolicy, IEndpointSelectorPolicy
{
public override int Order => 100;
public bool AppliesToEndpoints(IReadOnlyList<Endpoint> endpoints)
{
for (var i = 0; i < endpoints.Count; i++)
{
ControllerActionDescriptor? controllerActionDescriptor = endpoints[i].Metadata.GetMetadata<ControllerActionDescriptor>();
if (IsByIdsController(controllerActionDescriptor) || IsByRouteController(controllerActionDescriptor))
{
return true;
}
}
return false;
}
public Task ApplyAsync(HttpContext httpContext, CandidateSet candidates)
{
var hasIdQueryParameter = httpContext.Request.Query.ContainsKey("id");
ApiVersion? requestedApiVersion = httpContext.GetRequestedApiVersion();
for (var i = 0; i < candidates.Count; i++)
{
CandidateState candidate = candidates[i];
Endpoint? endpoint = candidate.Endpoint;
// NOTE: nullability for the CandidateState.Endpoint property is not correct - it *can* be null
if (endpoint is null)
{
continue;
}
if (EndpointSupportsApiVersion(endpoint, requestedApiVersion) is false)
{
candidates.SetValidity(i, false);
continue;
}
ControllerActionDescriptor? controllerActionDescriptor = endpoint.Metadata.GetMetadata<ControllerActionDescriptor>();
if (IsByIdsController(controllerActionDescriptor))
{
candidates.SetValidity(i, hasIdQueryParameter);
}
else if (IsByRouteController(controllerActionDescriptor))
{
candidates.SetValidity(i, hasIdQueryParameter is false);
}
}
return Task.CompletedTask;
}
private static bool EndpointSupportsApiVersion(Endpoint endpoint, ApiVersion? requestedApiVersion)
{
ApiVersion[]? supportedApiVersions = endpoint.Metadata.GetMetadata<MapToApiVersionAttribute>()?.Versions.ToArray();
// if the endpoint is versioned, the requested API version must be among the API versions supported by the endpoint.
// if the endpoint is NOT versioned, it cannot be used with a requested API version
return supportedApiVersions?.Contains(requestedApiVersion) ?? requestedApiVersion is null;
}
private static bool IsByIdsController(ControllerActionDescriptor? controllerActionDescriptor)
=> IsControllerType<ByIdsContentApiController>(controllerActionDescriptor) || IsControllerType<ByIdsMediaApiController>(controllerActionDescriptor);
private static bool IsByRouteController(ControllerActionDescriptor? controllerActionDescriptor)
=> IsControllerType<ByRouteContentApiController>(controllerActionDescriptor) || IsControllerType<ByPathMediaApiController>(controllerActionDescriptor);
private static bool IsControllerType<T>(ControllerActionDescriptor? controllerActionDescriptor)
=> controllerActionDescriptor?.MethodInfo.DeclaringType == typeof(T);
}
@@ -0,0 +1,67 @@
using OpenIddict.Abstractions;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Infrastructure.Security;
namespace Umbraco.Cms.Api.Delivery.Security;
public class MemberApplicationManager : OpenIdDictApplicationManagerBase, IMemberApplicationManager
{
private readonly IRuntimeState _runtimeState;
public MemberApplicationManager(IOpenIddictApplicationManager applicationManager, IRuntimeState runtimeState)
: base(applicationManager)
=> _runtimeState = runtimeState;
public async Task EnsureMemberApplicationAsync(IEnumerable<Uri> loginRedirectUrls, IEnumerable<Uri> logoutRedirectUrls, CancellationToken cancellationToken = default)
{
if (_runtimeState.Level < RuntimeLevel.Run)
{
return;
}
Uri[] loginRedirectUrlsArray = loginRedirectUrls as Uri[] ?? loginRedirectUrls.ToArray();
if (loginRedirectUrlsArray.All(r => r.IsAbsoluteUri) is false)
{
throw new ArgumentException("Expected absolute login redirect URLs for Delivery API member authentication", nameof(loginRedirectUrls));
}
Uri[] logoutRedirectUrlsArray = logoutRedirectUrls as Uri[] ?? logoutRedirectUrls.ToArray();
if (logoutRedirectUrlsArray.All(r => r.IsAbsoluteUri) is false)
{
throw new ArgumentException("Expected absolute logout redirect URLs for Delivery API member authentication", nameof(logoutRedirectUrlsArray));
}
var applicationDescriptor = new OpenIddictApplicationDescriptor
{
DisplayName = "Umbraco member access",
ClientId = Constants.OAuthClientIds.Member,
Type = OpenIddictConstants.ClientTypes.Public,
Permissions =
{
OpenIddictConstants.Permissions.Endpoints.Authorization,
OpenIddictConstants.Permissions.Endpoints.Token,
OpenIddictConstants.Permissions.Endpoints.Logout,
OpenIddictConstants.Permissions.Endpoints.Revocation,
OpenIddictConstants.Permissions.GrantTypes.AuthorizationCode,
OpenIddictConstants.Permissions.GrantTypes.RefreshToken,
OpenIddictConstants.Permissions.ResponseTypes.Code
}
};
foreach (Uri redirectUrl in loginRedirectUrlsArray)
{
applicationDescriptor.RedirectUris.Add(redirectUrl);
}
foreach (Uri redirectUrl in logoutRedirectUrlsArray)
{
applicationDescriptor.PostLogoutRedirectUris.Add(redirectUrl);
}
await CreateOrUpdate(applicationDescriptor, cancellationToken);
}
public async Task DeleteMemberApplicationAsync(CancellationToken cancellationToken = default)
=> await Delete(Constants.OAuthClientIds.Member, cancellationToken);
}
@@ -1,4 +1,4 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Options;
using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Cms.Core.DeliveryApi;
@@ -23,8 +23,13 @@ internal sealed class ApiAccessService : RequestHeaderHandler, IApiAccessService
/// <inheritdoc />
public bool HasPreviewAccess() => IfEnabled(HasValidApiKey);
/// <inheritdoc />
public bool HasMediaAccess() => IfMediaEnabled(() => _deliveryApiSettings is { PublicAccess: true, Media.PublicAccess: true } || HasValidApiKey());
private bool IfEnabled(Func<bool> condition) => _deliveryApiSettings.Enabled && condition();
private bool HasValidApiKey() => _deliveryApiSettings.ApiKey.IsNullOrWhiteSpace() == false
&& _deliveryApiSettings.ApiKey.Equals(GetHeaderValue("Api-Key"));
&& _deliveryApiSettings.ApiKey.Equals(GetHeaderValue(Core.Constants.DeliveryApi.HeaderNames.ApiKey));
private bool IfMediaEnabled(Func<bool> condition) => _deliveryApiSettings is { Enabled: true, Media.Enabled: true } && condition();
}
@@ -0,0 +1,105 @@
using Examine;
using Examine.Search;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Umbraco.Cms.Api.Delivery.Services.QueryBuilders;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Models.DeliveryApi;
using Umbraco.Cms.Infrastructure.Examine;
namespace Umbraco.Cms.Api.Delivery.Services;
/// <summary>
/// This is the Examine implementation of content querying for the Delivery API.
/// </summary>
internal sealed class ApiContentQueryProvider : IApiContentQueryProvider
{
private const string ItemIdFieldName = "itemId";
private readonly IExamineManager _examineManager;
private readonly ILogger<ApiContentQueryProvider> _logger;
private readonly ApiContentQuerySelectorBuilder _selectorBuilder;
private readonly ApiContentQueryFilterBuilder _filterBuilder;
private readonly ApiContentQuerySortBuilder _sortBuilder;
public ApiContentQueryProvider(
IExamineManager examineManager,
ContentIndexHandlerCollection indexHandlers,
IApiContentQueryFactory apiContentQueryFactory,
IOptions<DeliveryApiSettings> deliveryApiSettings,
ILogger<ApiContentQueryProvider> logger)
{
_examineManager = examineManager;
_logger = logger;
// build a look-up dictionary of field types by field name
var fieldTypes = indexHandlers
.SelectMany(handler => handler.GetFields())
.DistinctBy(field => field.FieldName)
.ToDictionary(field => field.FieldName, field => field.FieldType, StringComparer.InvariantCultureIgnoreCase);
// for the time being we're going to keep these as internal implementation details.
// perhaps later on it will make sense to expose them through the DI.
_selectorBuilder = new ApiContentQuerySelectorBuilder(deliveryApiSettings.Value, apiContentQueryFactory);
_filterBuilder = new ApiContentQueryFilterBuilder(fieldTypes, _logger);
_sortBuilder = new ApiContentQuerySortBuilder(fieldTypes, _logger);
}
[Obsolete($"Use the {nameof(ExecuteQuery)} method that accepts {nameof(ProtectedAccess)}. Will be removed in V14.")]
public PagedModel<Guid> ExecuteQuery(
SelectorOption selectorOption,
IList<FilterOption> filterOptions,
IList<SortOption> sortOptions,
string culture,
bool preview,
int skip,
int take)
=> ExecuteQuery(selectorOption, filterOptions, sortOptions, culture, ProtectedAccess.None, preview, skip, take);
/// <inheritdoc/>
public PagedModel<Guid> ExecuteQuery(
SelectorOption selectorOption,
IList<FilterOption> filterOptions,
IList<SortOption> sortOptions,
string culture,
ProtectedAccess protectedAccess,
bool preview,
int skip,
int take)
{
if (!_examineManager.TryGetIndex(Constants.UmbracoIndexes.DeliveryApiContentIndexName, out IIndex? index))
{
_logger.LogError("Could not find the index {IndexName} when attempting to execute a query.", Constants.UmbracoIndexes.DeliveryApiContentIndexName);
return new PagedModel<Guid>();
}
IBooleanOperation queryOperation = _selectorBuilder.Build(selectorOption, index, culture, protectedAccess, preview);
_filterBuilder.Append(filterOptions, queryOperation);
_sortBuilder.Append(sortOptions, queryOperation);
ISearchResults? results = queryOperation
.SelectField(ItemIdFieldName)
.Execute(QueryOptions.SkipTake(skip, take));
if (results is null)
{
// The query yield no results
return new PagedModel<Guid>();
}
Guid[] items = results
.Where(r => r.Values.ContainsKey(ItemIdFieldName))
.Select(r => Guid.Parse(r.Values[ItemIdFieldName]))
.ToArray();
return new PagedModel<Guid>(results.TotalItemCount, items);
}
public SelectorOption AllContentSelectorOption() => new()
{
FieldName = UmbracoExamineFieldNames.CategoryFieldName, Values = new[] { "content" }
};
}
@@ -1,256 +1,135 @@
using Examine;
using Examine.Search;
using Microsoft.Extensions.Logging;
using Umbraco.Cms.Api.Delivery.Indexing.Selectors;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Models.DeliveryApi;
using Umbraco.Cms.Core.Models.PublishedContent;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Cms.Infrastructure.Examine;
using Umbraco.Extensions;
using Umbraco.New.Cms.Core.Models;
namespace Umbraco.Cms.Api.Delivery.Services;
internal sealed class ApiContentQueryService : IApiContentQueryService
{
private const string ItemIdFieldName = "itemId";
private readonly IExamineManager _examineManager;
private readonly IRequestStartItemProviderAccessor _requestStartItemProviderAccessor;
private readonly SelectorHandlerCollection _selectorHandlers;
private readonly FilterHandlerCollection _filterHandlers;
private readonly SortHandlerCollection _sortHandlers;
private readonly IVariationContextAccessor _variationContextAccessor;
private readonly ILogger<ApiContentQueryService> _logger;
private readonly string _fallbackGuidValue;
private readonly Dictionary<string, FieldType> _fieldTypes;
private readonly IApiContentQueryProvider _apiContentQueryProvider;
private readonly IRequestPreviewService _requestPreviewService;
public ApiContentQueryService(
IExamineManager examineManager,
IRequestStartItemProviderAccessor requestStartItemProviderAccessor,
SelectorHandlerCollection selectorHandlers,
FilterHandlerCollection filterHandlers,
SortHandlerCollection sortHandlers,
ContentIndexHandlerCollection indexHandlers,
ILogger<ApiContentQueryService> logger,
IVariationContextAccessor variationContextAccessor)
IVariationContextAccessor variationContextAccessor,
IApiContentQueryProvider apiContentQueryProvider,
IRequestPreviewService requestPreviewService)
{
_examineManager = examineManager;
_requestStartItemProviderAccessor = requestStartItemProviderAccessor;
_selectorHandlers = selectorHandlers;
_filterHandlers = filterHandlers;
_sortHandlers = sortHandlers;
_variationContextAccessor = variationContextAccessor;
_logger = logger;
// A fallback value is needed for Examine queries in case we don't have a value - we can't pass null or empty string
// It is set to a random guid since this would be highly unlikely to yield any results
_fallbackGuidValue = Guid.NewGuid().ToString("D");
// build a look-up dictionary of field types by field name
_fieldTypes = indexHandlers
.SelectMany(handler => handler.GetFields())
.DistinctBy(field => field.FieldName)
.ToDictionary(field => field.FieldName, field => field.FieldType, StringComparer.InvariantCultureIgnoreCase);
_apiContentQueryProvider = apiContentQueryProvider;
_requestPreviewService = requestPreviewService;
}
[Obsolete($"Use the {nameof(ExecuteQuery)} method that accepts {nameof(ProtectedAccess)}. Will be removed in V14.")]
public Attempt<PagedModel<Guid>, ApiContentQueryOperationStatus> ExecuteQuery(
string? fetch,
IEnumerable<string> filters,
IEnumerable<string> sorts,
int skip,
int take)
=> ExecuteQuery(fetch, filters, sorts, ProtectedAccess.None, skip, take);
/// <inheritdoc/>
public Attempt<PagedModel<Guid>, ApiContentQueryOperationStatus> ExecuteQuery(string? fetch, IEnumerable<string> filters, IEnumerable<string> sorts, int skip, int take)
public Attempt<PagedModel<Guid>, ApiContentQueryOperationStatus> ExecuteQuery(
string? fetch,
IEnumerable<string> filters,
IEnumerable<string> sorts,
ProtectedAccess protectedAccess,
int skip,
int take)
{
var emptyResult = new PagedModel<Guid>();
if (!_examineManager.TryGetIndex(Constants.UmbracoIndexes.DeliveryApiContentIndexName, out IIndex? apiIndex))
{
return Attempt.FailWithStatus(ApiContentQueryOperationStatus.IndexNotFound, emptyResult);
}
IQuery baseQuery = apiIndex.Searcher.CreateQuery();
// Handle Selecting
IBooleanOperation? queryOperation = HandleSelector(fetch, baseQuery);
// If no Selector could be found, we return no results
if (queryOperation is null)
SelectorOption? selectorOption = GetSelectorOption(fetch);
if (selectorOption is null)
{
// If no Selector could be found, we return no results
return Attempt.FailWithStatus(ApiContentQueryOperationStatus.SelectorOptionNotFound, emptyResult);
}
// Item culture must be either the requested culture or "none"
var culture = CurrentCulture();
queryOperation.And().GroupedOr(new[] { UmbracoExamineFieldNames.DeliveryApiContentIndex.Culture }, culture.ToLowerInvariant().IfNullOrWhiteSpace(_fallbackGuidValue), "none");
// Handle Filtering
var canApplyFiltering = CanHandleFiltering(filters, queryOperation);
// If there is an invalid Filter option, we return no results
if (canApplyFiltering is false)
var filterOptions = new List<FilterOption>();
foreach (var filter in filters.Where(filter => filter.IsNullOrWhiteSpace() is false))
{
return Attempt.FailWithStatus(ApiContentQueryOperationStatus.FilterOptionNotFound, emptyResult);
FilterOption? filterOption = GetFilterOption(filter);
if (filterOption is null)
{
// If there is an invalid Filter option, we return no results
return Attempt.FailWithStatus(ApiContentQueryOperationStatus.FilterOptionNotFound, emptyResult);
}
filterOptions.Add(filterOption);
}
// Handle Sorting
IOrdering? sortQuery = HandleSorting(sorts, queryOperation);
// If there is an invalid Sort option, we return no results
if (sortQuery is null)
var sortOptions = new List<SortOption>();
foreach (var sort in sorts.Where(sort => sort.IsNullOrWhiteSpace() is false))
{
return Attempt.FailWithStatus(ApiContentQueryOperationStatus.SortOptionNotFound, emptyResult);
SortOption? sortOption = GetSortOption(sort);
if (sortOption is null)
{
// If there is an invalid Sort option, we return no results
return Attempt.FailWithStatus(ApiContentQueryOperationStatus.SortOptionNotFound, emptyResult);
}
sortOptions.Add(sortOption);
}
ISearchResults? results = sortQuery
.SelectField(ItemIdFieldName)
.Execute(QueryOptions.SkipTake(skip, take));
var culture = _variationContextAccessor.VariationContext?.Culture ?? string.Empty;
var isPreview = _requestPreviewService.IsPreview();
if (results is null)
{
// The query yield no results
return Attempt.SucceedWithStatus(ApiContentQueryOperationStatus.Success, emptyResult);
}
Guid[] items = results
.Where(r => r.Values.ContainsKey(ItemIdFieldName))
.Select(r => Guid.Parse(r.Values[ItemIdFieldName]))
.ToArray();
return Attempt.SucceedWithStatus(ApiContentQueryOperationStatus.Success, new PagedModel<Guid>(results.TotalItemCount, items));
PagedModel<Guid> result = _apiContentQueryProvider.ExecuteQuery(selectorOption, filterOptions, sortOptions, culture, protectedAccess, isPreview, skip, take);
return Attempt.SucceedWithStatus(ApiContentQueryOperationStatus.Success, result);
}
private IBooleanOperation? HandleSelector(string? fetch, IQuery baseQuery)
private SelectorOption? GetSelectorOption(string? fetch)
{
string? fieldName = null;
string[] fieldValues = Array.Empty<string>();
if (fetch is not null)
{
ISelectorHandler? selectorHandler = _selectorHandlers.FirstOrDefault(h => h.CanHandle(fetch));
SelectorOption? selector = selectorHandler?.BuildSelectorOption(fetch);
if (selector is null)
{
return null;
}
fieldName = selector.FieldName;
fieldValues = selector.Values.Any()
? selector.Values
: new[] { _fallbackGuidValue };
return selectorHandler?.BuildSelectorOption(fetch);
}
// Take into account the "start-item" header if present, as it defines a starting root node to query from
if (fieldName is null && _requestStartItemProviderAccessor.TryGetValue(out IRequestStartItemProvider? requestStartItemProvider))
if (_requestStartItemProviderAccessor.TryGetValue(out IRequestStartItemProvider? requestStartItemProvider))
{
IPublishedContent? startItem = requestStartItemProvider.GetStartItem();
if (startItem is not null)
{
// Reusing the boolean operation of the "Descendants" selector, as we want to get all the nodes from the given starting point
fieldName = DescendantsSelectorIndexer.FieldName;
fieldValues = new [] { startItem.Key.ToString() };
return new SelectorOption
{
FieldName = DescendantsSelectorIndexer.FieldName, Values = new[] { startItem.Key.ToString() }
};
}
}
// If no params or no fetch value, get everything from the index - this is a way to do that with Examine
fieldName ??= UmbracoExamineFieldNames.CategoryFieldName;
fieldValues = fieldValues.Any() ? fieldValues : new [] { "content" };
return fieldValues.Length == 1
? baseQuery.Field(fieldName, fieldValues.First())
: baseQuery.GroupedOr(new[] { fieldName }, fieldValues);
return _apiContentQueryProvider.AllContentSelectorOption();
}
private bool CanHandleFiltering(IEnumerable<string> filters, IBooleanOperation queryOperation)
private FilterOption? GetFilterOption(string filter)
{
void HandleExact(IQuery query, string fieldName, string[] values)
{
if (values.Length == 1)
{
query.Field(fieldName, values[0]);
}
else
{
query.GroupedOr(new[] { fieldName }, values);
}
}
foreach (var filterValue in filters)
{
IFilterHandler? filterHandler = _filterHandlers.FirstOrDefault(h => h.CanHandle(filterValue));
FilterOption? filter = filterHandler?.BuildFilterOption(filterValue);
if (filter is null)
{
return false;
}
var values = filter.Values.Any()
? filter.Values
: new[] { _fallbackGuidValue };
switch (filter.Operator)
{
case FilterOperation.Is:
// TODO: test this for explicit word matching
HandleExact(queryOperation.And(), filter.FieldName, values);
break;
case FilterOperation.IsNot:
// TODO: test this for explicit word matching
HandleExact(queryOperation.Not(), filter.FieldName, values);
break;
// TODO: Fix
case FilterOperation.Contains:
break;
// TODO: Fix
case FilterOperation.DoesNotContain:
break;
default:
continue;
}
}
return true;
IFilterHandler? filterHandler = _filterHandlers.FirstOrDefault(h => h.CanHandle(filter));
return filterHandler?.BuildFilterOption(filter);
}
private IOrdering? HandleSorting(IEnumerable<string> sorts, IBooleanOperation queryCriteria)
private SortOption? GetSortOption(string sort)
{
IOrdering? orderingQuery = null;
foreach (var sortValue in sorts)
{
ISortHandler? sortHandler = _sortHandlers.FirstOrDefault(h => h.CanHandle(sortValue));
SortOption? sort = sortHandler?.BuildSortOption(sortValue);
if (sort is null)
{
return null;
}
if (_fieldTypes.TryGetValue(sort.FieldName, out FieldType fieldType) is false)
{
_logger.LogWarning("Sort implementation for field name {FieldName} does not match an index handler implementation, cannot resolve field type.", sort.FieldName);
continue;
}
SortType sortType = fieldType switch
{
FieldType.Number => SortType.Int,
FieldType.Date => SortType.Long,
FieldType.StringRaw => SortType.String,
FieldType.StringAnalyzed => SortType.String,
FieldType.StringSortable => SortType.String,
_ => throw new ArgumentOutOfRangeException(nameof(fieldType))
};
orderingQuery = sort.Direction switch
{
Direction.Ascending => queryCriteria.OrderBy(new SortableField(sort.FieldName, sortType)),
Direction.Descending => queryCriteria.OrderByDescending(new SortableField(sort.FieldName, sortType)),
_ => orderingQuery
};
}
// Keep the index sorting as default
return orderingQuery ?? queryCriteria.OrderBy();
ISortHandler? sortHandler = _sortHandlers.FirstOrDefault(h => h.CanHandle(sort));
return sortHandler?.BuildSortOption(sort);
}
private string CurrentCulture()
=> _variationContextAccessor.VariationContext?.Culture ?? string.Empty;
}
@@ -0,0 +1,191 @@
using Microsoft.Extensions.Logging;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Models.PublishedContent;
using Umbraco.Cms.Core.PublishedCache;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Extensions;
namespace Umbraco.Cms.Api.Delivery.Services;
/// <inheritdoc />
internal sealed class ApiMediaQueryService : IApiMediaQueryService
{
private readonly IPublishedSnapshotAccessor _publishedSnapshotAccessor;
private readonly ILogger<ApiMediaQueryService> _logger;
public ApiMediaQueryService(IPublishedSnapshotAccessor publishedSnapshotAccessor, ILogger<ApiMediaQueryService> logger)
{
_publishedSnapshotAccessor = publishedSnapshotAccessor;
_logger = logger;
}
/// <inheritdoc/>
public Attempt<PagedModel<Guid>, ApiMediaQueryOperationStatus> ExecuteQuery(string? fetch, IEnumerable<string> filters, IEnumerable<string> sorts, int skip, int take)
{
var emptyResult = new PagedModel<Guid>();
IEnumerable<IPublishedContent>? source = GetSource(fetch);
if (source is null)
{
return Attempt.FailWithStatus(ApiMediaQueryOperationStatus.SelectorOptionNotFound, emptyResult);
}
source = ApplyFilters(source, filters);
if (source is null)
{
return Attempt.FailWithStatus(ApiMediaQueryOperationStatus.FilterOptionNotFound, emptyResult);
}
source = ApplySorts(source, sorts);
if (source is null)
{
return Attempt.FailWithStatus(ApiMediaQueryOperationStatus.SortOptionNotFound, emptyResult);
}
return PagedResult(source, skip, take);
}
/// <inheritdoc/>
public IPublishedContent? GetByPath(string path)
=> TryGetByPath(path, GetRequiredPublishedMediaCache());
private IPublishedMediaCache GetRequiredPublishedMediaCache()
=> _publishedSnapshotAccessor.GetRequiredPublishedSnapshot().Media
?? throw new InvalidOperationException("Could not obtain the published media cache");
private IPublishedContent? TryGetByPath(string path, IPublishedMediaCache mediaCache)
{
var segments = path.Split(Constants.CharArrays.ForwardSlash, StringSplitOptions.RemoveEmptyEntries);
IEnumerable<IPublishedContent> currentChildren = mediaCache.GetAtRoot();
IPublishedContent? resolvedMedia = null;
foreach (var segment in segments)
{
resolvedMedia = currentChildren.FirstOrDefault(c => segment.InvariantEquals(c.Name));
if (resolvedMedia is null)
{
break;
}
currentChildren = resolvedMedia.Children;
}
return resolvedMedia;
}
private IEnumerable<IPublishedContent>? GetSource(string? fetch)
{
const string childrenOfParameter = "children:";
if (fetch?.StartsWith(childrenOfParameter, StringComparison.OrdinalIgnoreCase) is not true)
{
_logger.LogInformation($"The current implementation of {nameof(IApiMediaQueryService)} expects \"{childrenOfParameter}[id/path]\" in the \"{nameof(fetch)}\" query option");
return null;
}
var childrenOf = fetch.TrimStart(childrenOfParameter);
if (childrenOf.IsNullOrWhiteSpace())
{
// this mirrors the current behavior of the Content Delivery API :-)
return Array.Empty<IPublishedContent>();
}
IPublishedMediaCache mediaCache = GetRequiredPublishedMediaCache();
if (childrenOf.Trim(Constants.CharArrays.ForwardSlash).Length == 0)
{
return mediaCache.GetAtRoot();
}
IPublishedContent? parent = Guid.TryParse(childrenOf, out Guid parentKey)
? mediaCache.GetById(parentKey)
: TryGetByPath(childrenOf, mediaCache);
return parent?.Children ?? Array.Empty<IPublishedContent>();
}
private IEnumerable<IPublishedContent>? ApplyFilters(IEnumerable<IPublishedContent> source, IEnumerable<string> filters)
{
foreach (var filter in filters)
{
var parts = filter.Split(':');
if (parts.Length != 2)
{
// invalid filter
_logger.LogInformation("An invalid filter option was encountered. Please ensure that supplied filter options are two-part, separated by ':'.");
return null;
}
switch (parts[0])
{
case "mediaType":
source = source.Where(c => c.ContentType.Alias == parts[1]);
break;
case "name":
source = source.Where(c => c.Name.InvariantContains(parts[1]));
break;
default:
// unknown filter
_logger.LogInformation("An unsupported filter option was supplied for the query. Please use only valid filter options. See the documentation for details.");
return null;
}
}
return source;
}
private IEnumerable<IPublishedContent>? ApplySorts(IEnumerable<IPublishedContent> source, IEnumerable<string> sorts)
{
foreach (var sort in sorts)
{
var parts = sort.Split(':');
if (parts.Length != 2)
{
// invalid sort
_logger.LogInformation("An invalid sort option was encountered. Please ensure that the supplied sort options are two-part, separated by ':'.");
return null;
}
Func<IPublishedContent, object> keySelector;
switch (parts[0])
{
case "createDate":
keySelector = content => content.CreateDate;
break;
case "updateDate":
keySelector = content => content.UpdateDate;
break;
case "name":
keySelector = content => content.Name.ToLowerInvariant();
break;
case "sortOrder":
keySelector = content => content.SortOrder;
break;
default:
// unknown sort
_logger.LogInformation("An unsupported sort option was supplied for the query. Please use only valid sort options. See the documentation for details.");
return null;
}
source = parts[1].StartsWith("asc")
? source.OrderBy(keySelector)
: source.OrderByDescending(keySelector);
}
return source;
}
private Attempt<PagedModel<Guid>, ApiMediaQueryOperationStatus> PagedResult(IEnumerable<IPublishedContent> children, int skip, int take)
{
IPublishedContent[] childrenAsArray = children as IPublishedContent[] ?? children.ToArray();
var result = new PagedModel<Guid>
{
Total = childrenAsArray.Length,
Items = childrenAsArray.Skip(skip).Take(take).Select(child => child.Key)
};
return Attempt.SucceedWithStatus(ApiMediaQueryOperationStatus.Success, result);
}
}
@@ -0,0 +1,44 @@
using OpenIddict.Abstractions;
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Cms.Core.Security;
namespace Umbraco.Cms.Api.Delivery.Services;
// NOTE: this is public and unsealed to allow overriding the default claims with minimal effort.
public class CurrentMemberClaimsProvider : ICurrentMemberClaimsProvider
{
private readonly IMemberManager _memberManager;
public CurrentMemberClaimsProvider(IMemberManager memberManager)
=> _memberManager = memberManager;
public virtual async Task<Dictionary<string, object>> GetClaimsAsync()
{
MemberIdentityUser? memberIdentityUser = await _memberManager.GetCurrentMemberAsync();
return memberIdentityUser is not null
? await GetClaimsForMemberIdentityAsync(memberIdentityUser)
: throw new InvalidOperationException("Could not retrieve the current member. This method should only ever be invoked when a member has been authorized.");
}
protected virtual async Task<Dictionary<string, object>> GetClaimsForMemberIdentityAsync(MemberIdentityUser memberIdentityUser)
{
var claims = new Dictionary<string, object>
{
[OpenIddictConstants.Claims.Subject] = memberIdentityUser.Key
};
if (memberIdentityUser.Name is not null)
{
claims[OpenIddictConstants.Claims.Name] = memberIdentityUser.Name;
}
if (memberIdentityUser.Email is not null)
{
claims[OpenIddictConstants.Claims.Email] = memberIdentityUser.Email;
}
claims[OpenIddictConstants.Claims.Role] = await _memberManager.GetRolesAsync(memberIdentityUser);
return claims;
}
}
@@ -0,0 +1,26 @@
using Examine;
using Examine.Lucene.Providers;
using Examine.Lucene.Search;
using Examine.Search;
using Umbraco.Cms.Infrastructure.Examine;
namespace Umbraco.Cms.Api.Delivery.Services.QueryBuilders
{
internal sealed class ApiContentQueryFactory : IApiContentQueryFactory
{
/// <inheritdoc/>
public IQuery CreateApiContentQuery(IIndex index)
{
// Needed for enabling leading wildcards searches
BaseLuceneSearcher searcher = index.Searcher as BaseLuceneSearcher ?? throw new InvalidOperationException($"Index searcher must be of type {nameof(BaseLuceneSearcher)}.");
IQuery query = searcher.CreateQuery(
IndexTypes.Content,
BooleanOperation.And,
searcher.LuceneAnalyzer,
new LuceneSearchOptions { AllowLeadingWildcard = true });
return query;
}
}
}
@@ -0,0 +1,244 @@
using Examine.Search;
using Microsoft.Extensions.Logging;
using Umbraco.Cms.Core.DeliveryApi;
namespace Umbraco.Cms.Api.Delivery.Services.QueryBuilders;
internal sealed class ApiContentQueryFilterBuilder
{
private readonly IDictionary<string, FieldType> _fieldTypes;
private readonly ILogger _logger;
private readonly string _fallbackGuidValue;
public ApiContentQueryFilterBuilder(IDictionary<string, FieldType> fieldTypes, ILogger logger)
{
_fieldTypes = fieldTypes;
_logger = logger;
// A fallback value is needed for Examine queries in case we don't have a value - we can't pass null or empty string
// It is set to a random guid since this would be highly unlikely to yield any results
_fallbackGuidValue = Guid.NewGuid().ToString("D");
}
public void Append(IList<FilterOption> filterOptions, IBooleanOperation queryOperation)
{
foreach (FilterOption filterOption in filterOptions)
{
if (_fieldTypes.TryGetValue(filterOption.FieldName, out FieldType fieldType) is false)
{
_logger.LogWarning(
"Filter implementation for field name {FieldName} does not match an index handler implementation, cannot resolve field type.",
filterOption.FieldName);
continue;
}
var values = filterOption.Values.Any()
? filterOption.Values
: new[] { _fallbackGuidValue };
switch (filterOption.Operator)
{
case FilterOperation.Is:
ApplyExactFilter(queryOperation.And(), filterOption.FieldName, values, fieldType);
break;
case FilterOperation.IsNot:
ApplyExactFilter(queryOperation.Not(), filterOption.FieldName, values, fieldType);
break;
case FilterOperation.Contains:
ApplyContainsFilter(queryOperation.And(), filterOption.FieldName, values);
break;
case FilterOperation.DoesNotContain:
ApplyContainsFilter(queryOperation.Not(), filterOption.FieldName, values);
break;
case FilterOperation.LessThan:
case FilterOperation.LessThanOrEqual:
case FilterOperation.GreaterThan:
case FilterOperation.GreaterThanOrEqual:
ApplyRangeFilter(queryOperation.And(), filterOption.FieldName, values, fieldType, filterOption.Operator);
break;
default:
continue;
}
}
}
private void ApplyExactFilter(IQuery query, string fieldName, string[] values, FieldType fieldType)
{
switch (fieldType)
{
case FieldType.Number:
ApplyExactNumberFilter(query, fieldName, values);
break;
case FieldType.Date:
ApplyExactDateFilter(query, fieldName, values);
break;
default:
ApplyExactStringFilter(query, fieldName, values);
break;
}
}
private void ApplyExactNumberFilter(IQuery query, string fieldName, string[] values)
{
if (values.Length == 1)
{
if (TryParseIntFilterValue(values.First(), out int intValue))
{
query.Field(fieldName, intValue);
}
}
else
{
int[] intValues = values
.Select(value => TryParseIntFilterValue(value, out int intValue) ? intValue : (int?)null)
.Where(intValue => intValue.HasValue)
.Select(intValue => intValue!.Value)
.ToArray();
AddGroupedOrFilter(query, fieldName, intValues);
}
}
private void ApplyExactDateFilter(IQuery query, string fieldName, string[] values)
{
if (values.Length == 1)
{
if (TryParseDateTimeFilterValue(values.First(), out DateTime dateValue))
{
query.Field(fieldName, dateValue);
}
}
else
{
DateTime[] dateValues = values
.Select(value => TryParseDateTimeFilterValue(value, out DateTime dateValue) ? dateValue : (DateTime?)null)
.Where(dateValue => dateValue.HasValue)
.Select(dateValue => dateValue!.Value)
.ToArray();
AddGroupedOrFilter(query, fieldName, dateValues);
}
}
private void ApplyExactStringFilter(IQuery query, string fieldName, string[] values)
{
if (values.Length == 1)
{
query.Field(fieldName, values.First());
}
else
{
AddGroupedOrFilter(query, fieldName, values);
}
}
private void ApplyContainsFilter(IQuery query, string fieldName, string[] values)
{
if (values.Length == 1)
{
// The trailing wildcard is added automatically
query.Field(fieldName, (IExamineValue)new ExamineValue(Examineness.ComplexWildcard, $"*{values[0]}"));
}
else
{
// The trailing wildcard is added automatically
IExamineValue[] examineValues = values
.Select(value => (IExamineValue)new ExamineValue(Examineness.ComplexWildcard, $"*{value}"))
.ToArray();
query.GroupedOr(new[] { fieldName }, examineValues);
}
}
private void ApplyRangeFilter(IQuery query, string fieldName, string[] values, FieldType fieldType, FilterOperation filterOperation)
{
switch (fieldType)
{
case FieldType.Number:
ApplyRangeNumberFilter(query, fieldName, values, filterOperation);
break;
case FieldType.Date:
ApplyRangeDateFilter(query, fieldName, values, filterOperation);
break;
default:
_logger.LogWarning("Range filtering cannot be used with String fields. Only Number and Date fields support range filtering.");
break;
}
}
private void ApplyRangeNumberFilter(IQuery query, string fieldName, string[] values, FilterOperation filterOperation)
{
if (TryParseIntFilterValue(values.First(), out int intValue) is false)
{
return;
}
AddRangeFilter(query, fieldName, intValue, filterOperation);
}
private void ApplyRangeDateFilter(IQuery query, string fieldName, string[] values, FilterOperation filterOperation)
{
if (TryParseDateTimeFilterValue(values.First(), out DateTime dateValue) is false)
{
return;
}
AddRangeFilter(query, fieldName, dateValue, filterOperation);
}
private void AddRangeFilter<T>(IQuery query, string fieldName, T value, FilterOperation filterOperation)
where T : struct
{
T? min = null, max = null;
bool minInclusive = false, maxInclusive = false;
switch (filterOperation)
{
case FilterOperation.GreaterThan:
case FilterOperation.GreaterThanOrEqual:
min = value;
minInclusive = filterOperation is FilterOperation.GreaterThanOrEqual;
break;
case FilterOperation.LessThan:
case FilterOperation.LessThanOrEqual:
max = value;
maxInclusive = filterOperation is FilterOperation.LessThanOrEqual;
break;
default:
throw new ArgumentOutOfRangeException(nameof(filterOperation));
}
query.RangeQuery(new[] { fieldName }, min, max, minInclusive, maxInclusive);
}
private void AddGroupedOrFilter<T>(IQuery query, string fieldName, params T[] values)
where T : struct
{
if (values.Length == 0)
{
return;
}
var fields = new[] { fieldName };
query.Group(
nestedQuery =>
{
INestedBooleanOperation nestedQueryOperation =
nestedQuery.RangeQuery<T>(fields, values[0], values[0]);
foreach (T value in values.Skip(1))
{
nestedQueryOperation = nestedQueryOperation.Or().RangeQuery<T>(fields, value, value);
}
return nestedQueryOperation;
});
}
private void AddGroupedOrFilter(IQuery query, string fieldName, params string[] values)
=> query.GroupedOr(new[] { fieldName }, values);
private bool TryParseIntFilterValue(string value, out int intValue)
=> int.TryParse(value, out intValue);
private bool TryParseDateTimeFilterValue(string value, out DateTime dateValue)
=> DateTime.TryParse(value, out dateValue);
}
@@ -0,0 +1,91 @@
using Examine;
using Examine.Search;
using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Cms.Core.Models.DeliveryApi;
using Umbraco.Cms.Infrastructure.Examine;
using Umbraco.Extensions;
namespace Umbraco.Cms.Api.Delivery.Services.QueryBuilders;
internal sealed class ApiContentQuerySelectorBuilder
{
private readonly DeliveryApiSettings _deliveryApiSettings;
private readonly IApiContentQueryFactory _queryFactory;
private readonly string _fallbackGuidValue;
public ApiContentQuerySelectorBuilder(
DeliveryApiSettings deliveryApiSettings,
IApiContentQueryFactory queryFactory)
{
_deliveryApiSettings = deliveryApiSettings;
_queryFactory = queryFactory;
// A fallback value is needed for Examine queries in case we don't have a value - we can't pass null or empty string
// It is set to a random guid since this would be highly unlikely to yield any results
_fallbackGuidValue = Guid.NewGuid().ToString("D");
}
public IBooleanOperation Build(SelectorOption selectorOption, IIndex index, string culture, ProtectedAccess protectedAccess, bool preview)
{
IQuery query = _queryFactory.CreateApiContentQuery(index);
IBooleanOperation selectorOperation = selectorOption.Values.Length == 1
? query.Field(selectorOption.FieldName, selectorOption.Values.First())
: query.GroupedOr(new[] { selectorOption.FieldName }, selectorOption.Values);
AddCultureQuery(culture, selectorOperation);
if (_deliveryApiSettings.MemberAuthorizationIsEnabled())
{
AddProtectedAccessQuery(protectedAccess, selectorOperation);
}
// when not fetching for preview, make sure the "published" field is "y"
if (preview is false)
{
selectorOperation.And().Field(UmbracoExamineFieldNames.DeliveryApiContentIndex.Published, "y");
}
return selectorOperation;
}
private void AddCultureQuery(string culture, IBooleanOperation selectorOperation) =>
selectorOperation
.And()
.GroupedOr(
// Item culture must be either the requested culture or "none"
new[] { UmbracoExamineFieldNames.DeliveryApiContentIndex.Culture },
culture.ToLowerInvariant().IfNullOrWhiteSpace(_fallbackGuidValue),
"none");
private void AddProtectedAccessQuery(ProtectedAccess protectedAccess, IBooleanOperation selectorOperation)
{
var protectedAccessValues = new List<string>();
if (protectedAccess.MemberKey is not null)
{
protectedAccessValues.Add($"u:{protectedAccess.MemberKey}");
}
if (protectedAccess.MemberRoles?.Any() is true)
{
protectedAccessValues.AddRange(protectedAccess.MemberRoles.Select(r => $"r:{r}"));
}
if (protectedAccessValues.Any())
{
selectorOperation.And(
inner => inner
.Field(UmbracoExamineFieldNames.DeliveryApiContentIndex.Protected, "n")
.Or(protectedAccessInner => protectedAccessInner
.GroupedOr(
new[] { UmbracoExamineFieldNames.DeliveryApiContentIndex.ProtectedAccess },
protectedAccessValues.ToArray())),
BooleanOperation.Or);
}
else
{
selectorOperation.And().Field(UmbracoExamineFieldNames.DeliveryApiContentIndex.Protected, "n");
}
}
}
@@ -0,0 +1,49 @@
using Examine.Search;
using Microsoft.Extensions.Logging;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.DeliveryApi;
namespace Umbraco.Cms.Api.Delivery.Services.QueryBuilders;
internal sealed class ApiContentQuerySortBuilder
{
private readonly Dictionary<string, FieldType> _fieldTypes;
private readonly ILogger _logger;
public ApiContentQuerySortBuilder(Dictionary<string, FieldType> fieldTypes, ILogger logger)
{
_fieldTypes = fieldTypes;
_logger = logger;
}
public void Append(IList<SortOption> sortOptions, IOrdering queryOperation)
{
foreach (SortOption sort in sortOptions)
{
if (_fieldTypes.TryGetValue(sort.FieldName, out FieldType fieldType) is false)
{
_logger.LogWarning(
"Sort implementation for field name {FieldName} does not match an index handler implementation, cannot resolve field type.",
sort.FieldName);
continue;
}
SortType sortType = fieldType switch
{
FieldType.Number => SortType.Int,
FieldType.Date => SortType.Long,
FieldType.StringRaw => SortType.String,
FieldType.StringAnalyzed => SortType.String,
FieldType.StringSortable => SortType.String,
_ => throw new ArgumentOutOfRangeException(nameof(fieldType))
};
queryOperation = sort.Direction switch
{
Direction.Ascending => queryOperation.OrderBy(new SortableField(sort.FieldName, sortType)),
Direction.Descending => queryOperation.OrderByDescending(new SortableField(sort.FieldName, sortType)),
_ => queryOperation
};
}
}
}
@@ -0,0 +1,18 @@
using Examine;
using Examine.Search;
namespace Umbraco.Cms.Api.Delivery.Services.QueryBuilders
{
/// <summary>
/// Used to create an <see cref="IQuery"/> instance for content items for the content delivery api.
/// </summary>
public interface IApiContentQueryFactory
{
/// <summary>
/// Creates an <see cref="IQuery"/> for content items for the content delivery api.
/// </summary>
/// <param name="index">The <see cref="IIndex"/>.</param>
/// <returns>An <see cref="IQuery"/> instance.</returns>
IQuery CreateApiContentQuery(IIndex index);
}
}
@@ -1,11 +1,12 @@
using Microsoft.AspNetCore.Http;
using System.Text.RegularExpressions;
using Microsoft.AspNetCore.Http;
using Microsoft.Net.Http.Headers;
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Cms.Core.Models.PublishedContent;
namespace Umbraco.Cms.Api.Delivery.Services;
internal sealed class RequestCultureService : RequestHeaderHandler, IRequestCultureService
internal sealed partial class RequestCultureService : RequestHeaderHandler, IRequestCultureService
{
private readonly IVariationContextAccessor _variationContextAccessor;
@@ -14,7 +15,11 @@ internal sealed class RequestCultureService : RequestHeaderHandler, IRequestCult
_variationContextAccessor = variationContextAccessor;
/// <inheritdoc />
public string? GetRequestedCulture() => GetHeaderValue(HeaderNames.AcceptLanguage);
public string? GetRequestedCulture()
{
var acceptLanguage = GetHeaderValue(HeaderNames.AcceptLanguage) ?? string.Empty;
return ValidLanguageHeaderRegex().IsMatch(acceptLanguage) ? acceptLanguage : null;
}
/// <inheritdoc />
public void SetRequestCulture(string culture)
@@ -26,4 +31,9 @@ internal sealed class RequestCultureService : RequestHeaderHandler, IRequestCult
_variationContextAccessor.VariationContext = new VariationContext(culture);
}
// at the time of writing we're introducing this to get rid of accept-language header values like "en-GB,en-US;q=0.9,en;q=0.8",
// so we don't want to be too restrictive in this regex - keep it simple for now.
[GeneratedRegex(@"^[\w-]*$")]
private static partial Regex ValidLanguageHeaderRegex();
}
@@ -8,11 +8,5 @@ internal abstract class RequestHeaderHandler
protected RequestHeaderHandler(IHttpContextAccessor httpContextAccessor) => _httpContextAccessor = httpContextAccessor;
protected string? GetHeaderValue(string headerName)
{
HttpContext httpContext = _httpContextAccessor.HttpContext ??
throw new InvalidOperationException("Could not obtain an HTTP context");
return httpContext.Request.Headers[headerName];
}
protected string? GetHeaderValue(string headerName) => _httpContextAccessor.HttpContext?.Request.Headers[headerName];
}

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