Compare commits

..
569 Commits
Author SHA1 Message Date
Niels LyngsøandGitHub 0331cd154b Update 01_bug_report.yml (#18513) 2025-03-24 14:59:10 +01:00
Jacob Overgaard 0f98b8342c Update branches (v16)
Removed v12, added v15 and v16
2025-03-20 10:49:02 +01:00
dependabot[bot]andJacob Overgaard b13f90046d Bump esbuild and vite in /src/Umbraco.Web.UI.Client
Bumps [esbuild](https://github.com/evanw/esbuild) to 0.25.1 and updates ancestor dependency [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite). These dependencies need to be updated together.


Updates `esbuild` from 0.24.2 to 0.25.1
- [Release notes](https://github.com/evanw/esbuild/releases)
- [Changelog](https://github.com/evanw/esbuild/blob/main/CHANGELOG-2024.md)
- [Commits](https://github.com/evanw/esbuild/compare/v0.24.2...v0.25.1)

Updates `vite` from 6.1.0 to 6.2.2
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v6.2.2/packages/vite)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-20 10:15:54 +01:00
Jacob Overgaard 304db8c28a Merge branch 'v15/dev' into contrib 2025-03-20 09:42:56 +01:00
dependabot[bot]andJacob Overgaard 723d3be905 Bump esbuild and vite in /src/Umbraco.Web.UI.Login
Bumps [esbuild](https://github.com/evanw/esbuild) to 0.25.1 and updates ancestor dependency [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite). These dependencies need to be updated together.


Updates `esbuild` from 0.24.2 to 0.25.1
- [Release notes](https://github.com/evanw/esbuild/releases)
- [Changelog](https://github.com/evanw/esbuild/blob/main/CHANGELOG-2024.md)
- [Commits](https://github.com/evanw/esbuild/compare/v0.24.2...v0.25.1)

Updates `vite` from 6.1.0 to 6.2.2
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v6.2.2/packages/vite)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-20 09:35:07 +01:00
Andy Butlandandkjac 5f37cd3d20 Make preview check for delivery API content case insensitive. (#18731) 2025-03-20 06:56:43 +01:00
Warren BuckleyandGitHub 203cc0e380 Updates dashboard to use uui-box headline property/attribute & place button in header-actions (#18736) 2025-03-19 23:29:56 +00:00
442de9a803 remove open config (#18592)
Co-authored-by: Niels Lyngsø <niels.lyngso@gmail.com>
2025-03-19 20:24:25 +00:00
Mads RasmussenandGitHub eea6b9b2f1 Feature: Language Item Ref (#18521)
* add entity type to interface

* use item-ref in language input

* register ref item
2025-03-19 20:51:25 +01:00
b3b1ce2dcd Bugfix: block culture permissions (#18665)
* always allow copy

* add back readonly check

* render pencil icon if the property is read only

---------

Co-authored-by: Niels Lyngsø <nsl@umbraco.dk>
2025-03-19 19:42:04 +00:00
69b69a5fc1 V15: Change drag and drop icon (#18519)
* register new drag icons

* use drag icon in sort-children-of modal

* update drag icons

* only use the vertical icon style

* Update property-editor-ui-image-crops.element.ts

* rename to grib

* reset formatting for merge conflict

---------

Co-authored-by: Niels Lyngsø <niels.lyngso@gmail.com>
2025-03-19 19:39:18 +00:00
Mads RasmussenandGitHub 605cda9224 Bugfix: Document granular user permission preset (#18651)
* pass fallback permissions to document granular permissions

* set as preset

* clean up
2025-03-19 19:36:12 +00:00
b65ad4e234 Fix focal point drag not working on firefox (#18674)
* fix focal point drag not working on firefox

* prevent reacting to left click

* only left click for drag

---------

Co-authored-by: Lan Nguyen Thuy <lnt@umbraco.dk>
Co-authored-by: Niels Lyngsø <niels.lyngso@gmail.com>
2025-03-19 16:15:34 +00:00
Jacob OvergaardandGitHub 4e680c88bb build(deps): bump @umbraco-ui/uui from 1.13.0-rc.1 to 1.13.0-rc.2 (#18677) 2025-03-19 15:20:09 +00:00
Jacob OvergaardandGitHub e8f991f485 V15: Adds accepted image types for image cropper (#18715)
* fix: adds accepted image types for image cropper

* chore: cleanup imports and types

* feat: adds a loader until all prerequisites have been resolved for image cropper

* feat: adds method to share temp file configuration
2025-03-19 12:36:51 +00:00
leekelleherandJacob Overgaard 66891333a8 Refactored the Tiptap Table toolbar button
to only show the table actions when the table is active,
otherwise show the Insert Table feature.
2025-03-19 13:26:04 +01:00
Lee KelleherandGitHub 044c9d2c87 Tiptap RTE: Table column/row bubble menu (#18708)
* Code formatting

* Icons for Tiptap table row/column actions

* Combined Tiptap exports

Removed extra constant

* Added Table Column Menu

* Added Table Row Menu

Made the bubble menu reusable
2025-03-19 13:25:13 +01:00
Andy ButlandandGitHub 7b0c419ace Adds detail of how many characters you are over when validating text fields for length. (#18722) 2025-03-19 12:02:40 +01:00
Jacob Overgaard 6ec1b9f1e4 build(deps-dev): bump storybook from 8.5.7 to 8.6.7 and run necessary migrations 2025-03-19 10:14:59 +01:00
Andy ButlandandGitHub 18069633b2 Used documented settings for the media seed cache. (#18723) 2025-03-19 09:47:12 +01:00
b24c29c647 V15: Extend search endpoints (#18634)
* Extend content type search endpoint

* Refactor to be able to specify trashed or not

* Simplify and extract into own method

* Fix breaking ctor

* Make non actions in controllers

* Fox up search service

* Add third ctor to avoid errors

* Update query to filter by is element

* Also implement for media

* Minor formatting and clean-up

* Re-introduce (and obsolete) the previous constructor

---------

Co-authored-by: kjac <kja@umbraco.dk>
2025-03-19 09:12:44 +01:00
Andreas ZerbstandGitHub f3f7fcc051 V15 QA added acceptance tests for block list variants (#18654)
* Moved tests

* Added variant tests

* Updated usage of helper

* Added tests

* Cleaned up

* Bumped version and added test command
2025-03-18 11:17:07 +00:00
Andreas ZerbstandGitHub b6fa93edac V15 QA added Tip Tap block variant acceptance tests (#18668)
* Moved tests

* Added variant tests for tiptap

* Updated file name

* Added test command

* Bumped package lock file

* removed npm command

* Bumped test helpers
2025-03-18 10:37:11 +00:00
Andy ButlandandGitHub b07a24ba55 Added clarifying comments to the logic for granular permissions. (#18705) 2025-03-18 11:08:30 +01:00
Andy ButlandandGitHub 42cb9b5c1e Removes one of the two duplicate ContentPublishingNotification publishings. (#18702) 2025-03-18 10:52:32 +01:00
Andreas ZerbstandGitHub 88657c1bb0 V15 QA added acceptance tests for block grid variants (#18658)
* Added block grid variant tests

* Bumped version

* Updated command to run tests on pipeline

* Removed test command

* Fixed comment
2025-03-18 09:35:28 +00:00
Andy ButlandandGitHub e91a25dcb6 Restrict valid API user client IDs to 100 characters. (#18688) 2025-03-18 06:33:24 +01:00
Lee KelleherandGitHub 81e63e7fa9 Tiptap RTE: Added data-mark attributes (#18689)
Tiptap: adds `data-mark` attributes to RTE, toolbar and toolbar items.
2025-03-18 11:22:20 +07:00
Andy ButlandandGitHub 2f9d58fc68 Fixes link for access to composition from document type property outside of group. (#18686) 2025-03-17 11:16:35 +01:00
Niels Lyngsø e9ba06929f Merge branch 'release/15.3' into v15/dev
# Conflicts:
#	version.json
2025-03-17 11:09:18 +01:00
Andy Butland a5da305093 Merge remote-tracking branch 'origin/v13/dev' into v15/dev
# Conflicts:
#	Directory.Packages.props
#	build/azure-pipelines.yml
#	src/Umbraco.Core/EmbeddedResources/Lang/da.xml
#	src/Umbraco.Core/EmbeddedResources/Lang/en.xml
#	src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml
#	src/Umbraco.Core/Models/ContentEditing/ContentSaveAction.cs
#	src/Umbraco.Web.BackOffice/Authorization/ContentPermissionsQueryStringHandler.cs
#	src/Umbraco.Web.BackOffice/Authorization/MediaPermissionsQueryStringHandler.cs
#	src/Umbraco.Web.BackOffice/Authorization/PermissionsQueryStringHandler.cs
#	src/Umbraco.Web.BackOffice/Controllers/ContentController.cs
#	src/Umbraco.Web.BackOffice/Controllers/MediaController.cs
#	src/Umbraco.Web.BackOffice/Filters/ContentSaveValidationAttribute.cs
#	src/Umbraco.Web.UI.Client/lib/tinymce/langs/da.js
#	src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js
#	src/Umbraco.Web.UI.Client/src/common/resources/content.resource.js
#	src/Umbraco.Web.UI.Client/src/less/components/users/umb-user-cards.less
#	src/Umbraco.Web.UI.Client/src/views/content/overlays/publishdescendants.controller.js
#	src/Umbraco.Web.UI.Client/src/views/content/overlays/publishdescendants.html
#	src/Umbraco.Web.UI.Client/src/views/users/views/users/users.html
#	tests/Umbraco.Tests.UnitTests/Umbraco.Web.BackOffice/Authorization/ContentPermissionsQueryStringHandlerTests.cs
#	tests/Umbraco.Tests.UnitTests/Umbraco.Web.BackOffice/Authorization/MediaPermissionsQueryStringHandlerTests.cs
#	tests/Umbraco.Tests.UnitTests/Umbraco.Web.BackOffice/Authorization/MediaPermissionsResourceHandlerTests.cs
2025-03-17 09:20:40 +01:00
Andy ButlandandGitHub e1e5f527e4 Updates dependency on Examine to 3.7. (#18676) 2025-03-17 09:13:09 +01:00
Niels Lyngsø f4e0e38824 Merge branch 'contrib' into v15/dev 2025-03-14 10:21:27 +01:00
Niels Lyngsø fa09ce6214 justify tag 2025-03-14 10:20:23 +01:00
Lee KelleherandGitHub dd8fb66300 Content Picker: Filter out invalid entity types (#18660)
* Reverted `elementName` constant

+ code tidy-up

* Filter out values that don't match the configured entity-type

Fixes #18476

* Notifies the user of invalid data/configuration

with an option to remove invalid data.
2025-03-14 09:55:45 +01:00
Lee KelleherandGitHub a02db287ce Tiptap RTE: Text Indent extension + toolbar items (#18672)
* Tiptap: Text Indent extension

* Updates indent manifest icons
2025-03-13 14:52:58 +00:00
e9c97f8c9b Allow multiple URL segments per document (#18603)
* Code tidy - XML header comments, method ordering, warning resolution.

* Add extension method for retrieving all URL segments for a document.

* Cache and persist multiple URL segments per document.

* Allowed segment providers to terminate or allow additional segments.
Set up currently failing integration test for expected routes.

* Resolved cache issue to ensure passing new integration tests.

* Fixed failing integration test.

* Test class naming tidy up.

* Added resolution and persistance of a primary segment, to retain previous behaviour when a single segment is retrieved.

* Further integration tests.

* Resolved backward compatibility of interface.

* Supress amends made to integration tests.

* Aligned naming of integration tests.

* Removed unused using, added XML header comment.

* Throw on missing table in migration.

* Code clean-up.

* Fix multiple enumeration

* Used default on migrated column.

* Use 1 over true for default value.

* Remove unused logger

---------

Co-authored-by: mole <nikolajlauridsen@protonmail.ch>
2025-03-13 12:47:46 +00:00
Lan Nguyen ThuyandJacob Overgaard f016dbd223 Fix issue text overflow when user name is too long 2025-03-13 11:07:57 +01:00
Mathias HelsengrenandJacob Overgaard da5669d9fc Remove the hardcoded color for the text in error message 2025-03-13 11:04:30 +01:00
Jacob Overgaard 74aa3d9676 bump version to 15.4.0-rc 2025-03-13 10:46:43 +01:00
Niels LyngsøandGitHub c671668e45 remove min height and max height configuration options (#18648) 2025-03-12 21:33:37 +01:00
Niels LyngsøandGitHub e337821d0e align search icon vertical (#18657) 2025-03-12 21:23:41 +01:00
leekelleherandJacob Overgaard 95fcf645dc Awaits super.openPicker() 2025-03-12 13:35:35 +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
Nhu DinhandGitHub d3c6c87378 V15 QA Added acceptance tests for trash reference by (#18627)
* Added tests for Trash content

* Verified the reference headline

* Updated tests

* Added more tests for trash content

* Updated due to test helper changes

* Bumped version

* Maked trash content tests run in the pipeline

* Fixed comments

* Reverted smokeTest command
2025-03-12 09:58:41 +00:00
Niels LyngsøandGitHub b3e192916d correct labels (#18650) 2025-03-12 09:17:20 +00:00
Andreas ZerbstandGitHub dfe100d7fc V15 QA added block grid with areas tests (#18641)
* Started testing block areas

* Added tests

* Added more tests

* Finished tests

* Moved tests

* Skipped tests

* Fixed comments

* Runs the created tests on the pipeline

* Reverted test command
2025-03-12 09:10:38 +00:00
Andreas ZerbstandGitHub 3420748b35 V15 QA reduced amount of browser downloaded on pipeline to reduce download time (#18642)
* Updated pipeline

* Fixed command
2025-03-12 09:40:03 +01:00
Andy ButlandandGitHub e270adc50f Reverts UI updates from publish with desdendants dialog. (#18647) 2025-03-12 08:10:34 +01:00
Andy Butlandandkjac de282d0fbf Reverts UI updates from publish with descendants dialog (15) (#18646)
* Reverts UI updates from publish with descendants dialog.

* Removed unused variable.
2025-03-12 08:01:00 +01:00
Andy ButlandandGitHub ce9460161f Reverts UI updates from publish with descendants dialog (15) (#18646)
* Reverts UI updates from publish with descendants dialog.

* Removed unused variable.
2025-03-12 07:59:37 +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 ButlandandGitHub 54931472f8 Corrects obsoletion message on ITwoFactorLoginService. (#18623) 2025-03-11 17:55:33 +00:00
df6a88b4d5 V15: Enable umbraco-extension client to auto-build (#18597)
* feat: adds autobuild of umbraco extensions created by the dotnet template

* adds file extensions to imports to follow the esmodule convention + apply formatting

* build(deps): upgrade hey-api, vite, typescript and generate new api

* chore: formatting

* clean up actions as client is now automatically being built when starting the site

* revert change with UMBRACO_VERSION_FROM_TEMPLATE

* revert if(includeExample)

* use template name

* use template name

* feat: update the way it sets the auth token

* add back in IncludeExample if

* fix: rename allowPackageTelemetry to allowTelemetry because that is what it is actually called

* `.csproj` amends

- Adds `BeforeTargets` to "BuildClient" target
- Adds "package.json" to "RestoreClient" target input
- Removes extra parameters from `npm i` command

---------

Co-authored-by: leekelleher <leekelleher@gmail.com>
2025-03-11 16:14:47 +00:00
Jacob OvergaardandGitHub 2cc9d2cab0 fix: adds back support for legacy AllowPackageTelemetry (#18644)
Due to an unfortunate mistake in the Umbraco.Cms.Targets generated JSON schema, we alluded to supporting `allowPackageTelemetry` in the JSON files, however the backend didn't support this.
2025-03-11 15:51:38 +00:00
Jacob OvergaardandGitHub c0b6317da8 V15: Reduce the size of the package json schema (#18643)
* chore: combine similar commands

* fix: add specific ignore on tinymce

* fix: override the RawEditorOptions types from tinymce

this ensures that we do not have 70k lines of schema in the generated schema

* fix: import only from the extension-registry

this will automatically find all registered UmbExtensionManifest regardless of which package is imported
2025-03-11 15:50:26 +00:00
leekelleherandJacob Overgaard b2f69691d6 Adds validation to Checkbox List property editor 2025-03-11 14:33:34 +01:00
b684bf0a69 Prevents attempt to move an item to itself as a parent (#18550)
* Prevents attempt to move an item to itself as a parent.

* add default tree item type

* use pickable filter

---------

Co-authored-by: Mads Rasmussen <madsr@hey.com>
2025-03-11 13:30:24 +01:00
Niels LyngsøandGitHub 3586f137fc avoid indifferences on property-entry property order (#18530) 2025-03-11 12:30:14 +01:00
Lee KelleherandGitHub 434dd50021 Merge pull request #18633 from umbraco/v15/fix-bug/rte-code-editor-modal-pretty-print
Fix bug RTE code editor modal - pretty print not working
2025-03-11 10:55:49 +00:00
Andy ButlandandGitHub 863d3d11c6 Updates sort property and direction together to avoid intermittent failures (#18590)
* Updates sort property and direction together to avoid intermittent failures.

* Removed debug code.
2025-03-11 11:38:14 +01:00
Niels LyngsøandGitHub d906fc346d use change event (#18631) 2025-03-11 09:19:19 +00:00
PhyxionNLandGitHub ced3db8542 Add NuGet badge (#18583) 2025-03-11 10:09:35 +01:00
Andy Butland 1f2afbaa1d Bumped version to 15.3.0-rc2. 2025-03-11 09:45:50 +01:00
Andy Butland e8e1b6ef33 Merge commit from fork
* Tighten management API endpoint access rules.

* Bumped version to 15.2.1.
2025-03-11 09:42:58 +01:00
Andy Butland 4803b4303d bumped imagesharp to prevent CVE-2025-27598 (#18602)
# Conflicts:
#	Directory.Packages.props
2025-03-11 09:42:47 +01:00
leekelleherandJacob Overgaard a48d8a4110 Adds validation to Radio Button List property editor
Fixes #18268
2025-03-11 09:34:31 +01:00
leekelleherandJacob Overgaard c1671f4e9b Adds validation to Dropdown List property editor
Fixes #17271
2025-03-11 09:32:35 +01:00
Andy Butland be4d4bef39 Merge branch 'release/15.2.3' into v15/dev
# Conflicts:
#	version.json
2025-03-11 09:27:22 +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
Lan Nguyen Thuy 1d48261b7b fix bug rte code editor modal pretty print not working 2025-03-11 13:39:55 +07:00
Andy ButlandandGitHub ebb6a580dc Merge commit from fork
* Tighten management API endpoint access rules.

* Bumped version to 15.2.1.
2025-03-11 05:11:36 +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
Nhu DinhandGitHub bc488d78e4 V15 QA Fixed the failing acceptance tests due to UI changes (#18617)
* Fixed the failing tests

* Bumped version

* Fixed can allow bulk trash in the media section

* Fixed notification message
2025-03-10 14:46:22 +00:00
Anders BjernerandMichael Latouche d3b60277d7 Fixed typo in TinyMCE's da.js 2025-03-10 15:38:50 +01:00
a51cbd3ee9 Added description to block list properties hide content editor (#18619)
* Added description to block list properties hide content editor

* Update the description to use localization

---------

Co-authored-by: Oskar kruger <obk@umbraco.dk>
2025-03-10 13:50:28 +00:00
458eb2e52f Tiptap RTE: Anchor extension + toolbar item (#18575)
* Tiptap: Anchor extension

* Corrected import; fixed the build

* Removed icon, mistakenly added to this branch

it was intended for the Character Map feature.

* Updated dialog style

* Scoped the Anchor modal to Tiptap package

Exported modal alias constant.

* Tweaked selected Anchor styling

* Localizes public labels

* Exported Anchor constants correctly

---------

Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>
2025-03-10 13:22:57 +00:00
Lee KelleherandGitHub 7ef11621dd Tiptap RTE: Character Map modal + toolbar item (#18577)
* Tiptap: Character Map extension

* Added missing icon! 🤦

* Added missing manifests

for the CharMap modal

* CharMap dialog styles

* Scoped the Character Map modal to Tiptap package

Exported modal alias constant.
2025-03-10 13:40:58 +01:00
Andy Butland 0d066c4ccc Merge branch 'release/15.3' into v15/dev 2025-03-10 12:04:42 +01:00
Andy ButlandandGitHub 4fe168f540 Removed obsolete integration test. (#18604) 2025-03-10 11:19:40 +01:00
Andy ButlandandGitHub 0d79a1f443 Fixed issue with max validation using default 0 value. (#18616) 2025-03-10 10:57:23 +01:00
Andy Butland ead277ed3e bumped imagesharp to prevent CVE-2025-27598 (#18602)
# Conflicts:
#	Directory.Packages.props
2025-03-09 08:51:18 +01:00
Andy Butland c35d7d18a8 Merge remote-tracking branch 'origin/v13/dev' into v15/dev
# Conflicts:
#	Directory.Packages.props
2025-03-09 08:46:24 +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
Anders ReusandGitHub 50c3756eb0 V15 QA added test for issue 18555 (#18601)
* Added accceptance test for issue 18555

* Bumped version
2025-03-07 13:51:26 +01:00
Sven Geusens c757f9fcb0 Merge remote-tracking branch 'origin/release/15.3' into v15/dev 2025-03-07 09:13:15 +01:00
Niels LyngsøandGitHub c03b1612b6 update UUI (#18593) 2025-03-06 18:55:14 +00:00
Mads RasmussenandGitHub a79095a869 Support root/area allowed types when pasting in Block Grid (#18480)
* poc allowed root types

* optional filter

* wip custom paste action for block grid

* pass filter

* add filter to property action

* add js docs

* add type

* add type

* add type

* implment filter for block grid areas

* use correct types

* use correct types

* clean up

* update root paste

* clean up

* fix grid paste filter

* fix linter

* Update clipboard.property-context.ts
2025-03-06 14:20:47 +01:00
MoleandGitHub 95c892000d V15: Add textbox and text area serverside validation (#18596)
* Add validation to TextOnlyValueEditor

* Fix tests

* Add tests
2025-03-06 12:19:28 +00:00
Andy ButlandandGitHub 7b6cef6083 Added missing translations for dictionary import. (#18551) 2025-03-06 12:40:42 +01:00
Nikolaj GeisleandGitHub cb78e524d8 Remove duplicate webhook registration (#18594) 2025-03-06 11:24:48 +00:00
Lee KelleherandGitHub 5bf63c2fa8 Tiptap: Block extension config refresh (#18569)
Refreshes the UI after the Block extension
option has been set as enabled/disabled.

Fixes #18541
2025-03-06 11:42:44 +01:00
Lee KelleherandGitHub a939f8ee1c Chore: Tiptap code sweep 2 (#18579)
* Updates "rte-content.css" to share the Macro Holder style

* Tiptap toolbar menu padding

* Removed unnecessary `isActive` for Embedded Media toolbar button

* Adds scroll container to available toolbar item selection

* Toolbar config: adds style for "menu" items

* Adds missing mappings for the TinyMCE toolbar conversion

* Updates toolbar "menu" styling
2025-03-06 11:41:51 +01:00
29b4056f68 Added server side validation for the Multi Url Picker. (#18589)
* Plumbing

* Handle null value

* Add tests

* Fix error found in tests

---------

Co-authored-by: mole <nikolajlauridsen@protonmail.ch>
2025-03-06 09:52:55 +00:00
45ea6a3cfc Server side validation for property editors (multiple text strings) (#18581)
* Server-side validation for multiple text strings property editor.

* Added unit tests for block list min/max server validation.

* Add danish translations

* Add test showing issue

* Fix issue

---------

Co-authored-by: mole <nikolajlauridsen@protonmail.ch>
2025-03-06 09:48:48 +00:00
6d0dd82781 Move database cache rebuild to a background task with polling (#18496)
* Use background queue for database cache rebuild and track rebuilding status.

* Updated OpenApi.json and client-side types.

* Updated client to poll for completion of database rebuild.

* Update src/Umbraco.Cms.Api.Management/Controllers/PublishedCache/RebuildPublishedCacheController.cs

Co-authored-by: Sven Geusens <sge@umbraco.dk>

* Removed unnecessary obsolete attribute.

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
2025-03-06 10:23:00 +01:00
7b422598f9 [V15] Align reserved property endpoints code and usage (#18319)
* Remove/enhance duplicate code

contentTypeEditing Services now use the IReservedFieldNamesService to determine invalid property alias values.

* Let Modelsbuilder define it's reserved property alias names

* Update, add tests + fix false positives

* Removed config check to register modelsbuilder required reserved properties

* Updated unittests regarding removed check of modelsbuilder mode

* Fix merge

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
2025-03-06 09:16:00 +01:00
Niels LyngsøandGitHub 52bb32205b JSDocs update (#18586) 2025-03-06 09:15:30 +01:00
Niels Lyngsø 8a68457421 Merge branch 'release/15.3' into v15/dev
# Conflicts:
#	src/Umbraco.Infrastructure/PropertyEditors/MediaPicker3PropertyEditor.cs
#	src/Umbraco.Web.UI.Client/src/packages/documents/document-types/workspace/document-type/document-type-workspace-editor.element.ts
#	src/Umbraco.Web.UI.Client/src/packages/media/media-types/workspace/media-type-workspace-editor.element.ts
#	src/Umbraco.Web.UI.Client/src/packages/members/member-type/workspace/member-type-workspace-editor.element.ts
#	tests/Umbraco.Tests.UnitTests/Umbraco.Core/PropertyEditors/DecimalValueEditorTests.cs
2025-03-05 15:33:48 +01:00
Sven Geusens 04fa0df886 Fix pipeline api docs generation dependancy generation. 2025-03-05 15:18:26 +01:00
Kenn JacobsenandGitHub 11d9b3a1bd Match source block both on culture and alias (#18582) 2025-03-05 14:23:33 +01:00
84d5b7aa52 Server side validation for property editors (drop-down and checkbox list) (#18564)
* WIP...

* Localization and unit tests for multiple value property editor validation.

* Localization fixes.

* Clarified XML header comment.

* Add danish translations

---------

Co-authored-by: mole <nikolajlauridsen@protonmail.ch>
2025-03-05 12:17:31 +00:00
Sven GeusensandGitHub 0cead6f10a Fix Rich text block validation path (#18578)
* Made BlockEditorValidator itemDataGroups.Path overridable

* PR feedback
2025-03-05 12:42:29 +01:00
Andy Butland 62690194cf Fixed failing unit test following merge from v13/dev. 2025-03-05 11:47:27 +01:00
Markus JohanssonandGitHub 900938edd0 V15: Added uui-box around ungrouped properties during block editing (#18571) (#18572) 2025-03-05 08:44:49 +01:00
Mads RasmussenandGitHub bf7efbc268 fix custom views for block list and block rte (#18565) 2025-03-05 08:38:11 +01:00
Lee KelleherandGitHub 00e7602b55 V15: Resolves "Save and Preview" backoffice refresh (#18568)
* Reverted `elementName` constant

* Ensures the backoffice preview URL has correct slashes
2025-03-05 08:12:54 +01:00
Andy Butland 7a9e1b66d9 Merge remote-tracking branch 'origin/v13/dev' into v15/merge-from-13 2025-03-05 06:46:13 +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
867d405992 Provide custom required validator for block list and toggle (#18474)
* Provide custom required validator for block list.

* Adds a custom required validator for the toggle to ensure the value provided is true.

* Remove unnecessary usings

* Remove redundant interface and base constructor

* Remove unnecessary interface

---------

Co-authored-by: mole <nikolajlauridsen@protonmail.ch>
2025-03-04 15:25:10 +00:00
a99c581ab5 V15: Add MNTP serverside validation (#18526)
* Add amount validator

* Add ObjectTypeValidator to MNTP

* Move validate startnode to helper method

* Validate allowed type

* Fix tests

* Added some XML header comments and resolved nit-picky warnings.

* Further XML comments.

* Fix null validation case

---------

Co-authored-by: Andy Butland <abutland73@gmail.com>
2025-03-04 16:06:05 +01:00
Mads RasmussenandGitHub 85883cee85 Feature: Has Children Condition (#18161)
* add children to reload translation

* add has children condition + context

* export

* register manifests

* set hasChildren value for tree items

* add condition to document tree item

* add has children condition to sort children of document

* add conditions for media

* add entity trashed event

* dispatch event when entity is trashed

* remove double event listeners

* export action class

* Update default-tree.context.ts

* wip reload tree when entity is trashed

* move into data folder

* clean up listeners

* move manifest

* wip reload root

* clean up

* add recycle bin tree item

* use for media

* pass entity types through manifest + add recycle bin tree item kind

* remove custom implementation for document recycle bin

* use kind

* rename to supportedEntityTypes

* Update recycle-bin-tree-item.context.ts

* clean up

* remove condition

* only show empty recycle bin if it has children

* remove of sort children
2025-03-04 14:22:22 +00:00
Andy Butland b9cbce561c Merge branch 'release/15.3' of https://github.com/umbraco/Umbraco-CMS into release/15.3 2025-03-04 14:54:44 +01:00
Andy ButlandandMole 51223f44ff Fix issue with server validation from dictionary configuration where floating point values can be be accessed as doubles or ints (#18508)
* Fix issue with server validation from dictionary configuration where floating point values can be be accessed as doubles or ints.

* Fixed typo in comment.

---------

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>
2025-03-04 14:54:30 +01:00
0f9c2332e0 Adds unit tests for RequiredValidator. (#18471)
Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>
2025-03-04 13:49:37 +00:00
Andy Butlandandmole 7629b85861 Fix issue with server validation from dictionary configuration where floating point values can be be accessed as doubles or ints (#18508)
* Fix issue with server validation from dictionary configuration where floating point values can be be accessed as doubles or ints.

* Fixed typo in comment.

---------

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>
2025-03-04 14:47:22 +01:00
a7f5b142e9 Fix issue with server validation from dictionary configuration where floating point values can be be accessed as doubles or ints (#18508)
* Fix issue with server validation from dictionary configuration where floating point values can be be accessed as doubles or ints.

* Fixed typo in comment.

---------

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>
2025-03-04 13:46:54 +00:00
Andy Butland d164892619 Handle create and update validation for media picker. (#18537) 2025-03-04 14:09:07 +01:00
Andy ButlandandGitHub ca6da751f2 Handle create and update validation for media picker. (#18537) 2025-03-04 14:08:08 +01:00
Nikolaj GeisleandGitHub 8d289846e1 Update nuget packages (#18559) 2025-03-04 13:49:11 +01:00
Mads RasmussenandGitHub 5358c0346e remove the word folder in label (#18485) 2025-03-04 12:21:51 +00:00
6d5b6a4553 Server side validation for property editors (colour picker) (#18557)
* Added server-side validation for colour picker.

* Minor refactor.

* Add danish translation

---------

Co-authored-by: mole <nikolajlauridsen@protonmail.ch>
2025-03-04 12:13:37 +00: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
Mads Rasmussen 7e4dda7bab fix block grid custom views 2025-03-04 12:11:01 +01:00
Mads RasmussenandGitHub 3491afefbb fix block grid custom views (#18558) 2025-03-04 12:09:56 +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 d167a60373 Correct handling of step values of zero. (#18532) 2025-03-04 11:51:19 +01:00
Andy ButlandandGitHub 92cb355f4d Correct handling of step values of zero. (#18532) 2025-03-04 11:18:23 +01:00
Mads RasmussenandGitHub fb11191fd1 Feature: Content Type Workspace Editor Header Element (#18520)
* add content-type-workspace-editor-header element

* use for document type

* use in media and member type workspaces

* fix type errors
2025-03-04 10:10:57 +01:00
Andy Butlandandkjac b650e7984e Fixes multiple available constructors exception for execute template query constructor. (#18552) 2025-03-04 10:04:06 +01:00
30186e0bdd V15 QA Fixing the failing acceptance tests 03032025 (#18549)
* Fixed Content tests with slider

* Updated Content tests with true/false

* Fixed due to api helper changes

* Updated tests related to the user has no permission due to an issue

* Added .fixme for Content tests with tiptap

* Bumped version

* Fixed tests for renaming a media

* Added .fixme for the failing tests due to the actual issues

---------

Co-authored-by: Andreas Zerbst <73799582+andr317c@users.noreply.github.com>
2025-03-04 09:00:45 +00:00
Jacob OvergaardandGitHub 2b24b40a75 V15: Workspace buttons cannot be overwritten in all cases (#18525)
* fix: consider that overwrites can be strings OR arrays

* chore: formatting

* chore(mock): use correct javascript for mock plugins

* chore: uses intersection helper method to save on code

* fix: should work without requesting extra update to the the extensions controller refreshing the state
2025-03-04 08:54:38 +00:00
Andy ButlandandGitHub 09bcede957 Fixes multiple available constructors exception for execute template query constructor. (#18552) 2025-03-04 09:51:36 +01:00
Chris HoustonandSebastiaan Janssen 998b6f9296 Fixes the Fatal icon text so it's readable in Dark Mode. (#18375) 2025-03-04 09:45:33 +01:00
2826678049 Added option for filtering the content types allowed as children based on the parent node (#18380)
* Added option for filtering the content types allowed as children based on the parent node.

* Updated OpenApi.json.

* Apply suggestions from code review

Co-authored-by: Sven Geusens <sge@umbraco.dk>

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
2025-03-04 09:34:17 +01:00
Kenn JacobsenandGitHub 67ed38f6a2 Guard against element type mismatch at document type creation (#18529) 2025-03-04 09:29:29 +01:00
Mads RasmussenandGitHub fbe2cfacd8 set additionalOptions on the rollback entity action (#18489) 2025-03-04 09:18:53 +01:00
Andy ButlandandGitHub e8ff21987b Fixed grammer of unauthorized message. (#18553) 2025-03-04 08:37:09 +01:00
Andy Butland b9250c20e9 Merge branch 'v15/dev' into contrib 2025-03-04 07:43:10 +01:00
Jacob OvergaardandGitHub e9ef05057e V15: Adds migration of data type configuration when changing property editor UI (#18534)
* feat: adds comparer to keep useful data around when migrating from one property editor ui to another

this is really useful when migrating from tinymce to tiptap for example

* stores values in property to access later
2025-03-03 21:22:36 +00:00
Mathias HelsengrenandJacob Overgaard 8379cba15d Changed so the the logviewer's date input is using the umb-input-date instead, gave the umb-input-date a color-scheme option, and added the color-scheme dark, for the darkmode css. 2025-03-03 22:02:39 +01:00
51cce234f4 V15: Allows certain adjustments of the logo (#18499)
* feat: uses the app-logo component to show the large logo

* feat: rename and publish CSS variables to modify the logo

* feat: sets size of logo to 55px to match login screen

* feat: adds css variables to customize the dimensions of the login logo

* fix: uses `ifDefined` in case logo is not defined

* fix: uses the intrinsic logo path from `when()`

* Fixed up import types

* uses the intrinsic alternative logo path from `when()`

* feat: changes logo based on theme

* feat: forces dark theme on the header logo

* feat: adds blue logomark

* feat: adds logo-alternative path to the backend

* chore: minify logos

* feat: optimises logo sizes

---------

Co-authored-by: leekelleher <leekelleher@gmail.com>
2025-03-03 15:54:22 +00:00
865a2cd83a Added tests and localization to radio button validation (#18512)
* Added tests and localization to radio button validation.

* Remove unnecessary ToString

* Add danish translations

---------

Co-authored-by: mole <nikolajlauridsen@protonmail.ch>
2025-03-03 12:23:55 +00:00
Andy ButlandandGitHub 33d83e1491 Added obsoletion messages for unused interface and implementation for cache rebuilds (#18524) 2025-03-03 13:16:23 +01:00
Andy ButlandandGitHub f6b4ddf598 Localize the email property editor validation and add tests (#18461)
* Localize the email property editor validation and add tests.

* Reverted trim to ensure behaviour for whitespace is unchanged.
2025-03-03 13:13:50 +01:00
Nhu DinhandGitHub 2ebc6badd7 V15 QA Publish E2E test results in the Azure pipeline (#18498)
* Updated playwright config to export the Junit report

* Published the Junit report

* Fixed

* Updated outputDir

* Make one test failed

* Changed npm command

* Fixed outputFile

* Updated folder to export test result

* Make another tests failed

* Updated publish test results job

* Changed testSQLite command

* Updated testRunTitle

* Changed npm command

* Updated testRunTitle

* Reverted

* Fixed comment

* Make some tests failed to test

* Reverted
2025-03-03 13:11:07 +07:00
Mads Rasmussen 2bb894c038 15.3: Hotfix: Content type discard changes (#18490)
* wrap in entity detail workspace element

* use element on media type and member type

* add developer console warning

* sync current data with owner content type

* Update content-type-workspace-context-base.ts

* fix lint error
2025-02-28 20:15:47 +01:00
Lee KelleherandGitHub 3ef9d64f1a Tiptap RTE: Stylesheets (#18502)
* Copies the "TinyMCE Stylesheets Property Editor UI" to the Templating/Stylesheet package

* Deprecates the "TinyMCE Stylesheets Property Editor UI"

as it may be used in 3rd party extensions.

TinyMCE will be removed in v16, but this deprecation notice in 15.4
will at least notify that the "Umb.PropertyEditorUi.StylesheetPicker"
UI can be used.

* Updates TinyMCE to use the Stylesheet Picker UI

* Prevent Stylesheet folders from being picked

+ UI tweaks

* Updates Stylesheet mock data

* Stylesheet Rule Input - removes Edit button

uses `@open` event for UI consistency with other pickers.

* Updates pangram

* Amending to be "header" instead of "heading"

* Adds "stylesheets" config to Tiptap data-type

* Updates RTE styles for Tiptap

Moves "StarterKit" styles to the RTE Essentials extension registration.

Scopes TinyMCE in "rte-content.css" (for now).
2025-02-28 15:37:52 +00:00
Andy ButlandandJacob Overgaard a20f11e48f Makes a few labels friendlier for screen readers. 2025-02-28 16:07:56 +01:00
Mads RasmussenandGitHub 4795609973 Removet the Tip tap placeholder text (#18486) 2025-02-28 14:01:54 +01:00
Mads RasmussenandGitHub 8e7809d37e align tags (#18487) 2025-02-28 13:56:05 +01:00
Mads RasmussenandGitHub 96febee559 add mandatory attribute (#18488) 2025-02-28 13:55:06 +01:00
Mads RasmussenandGitHub 9dfa110cb8 15.3: Hotfix: Content type discard changes (#18490)
* wrap in entity detail workspace element

* use element on media type and member type

* add developer console warning

* sync current data with owner content type

* Update content-type-workspace-context-base.ts

* fix lint error
2025-02-28 13:38:54 +01:00
Andy Butland 82eeb0737b Merge remote-tracking branch 'origin/v13/dev' into v15/merge-from-13
# Conflicts:
#	src/Umbraco.Core/EmbeddedResources/Lang/da.xml
#	src/Umbraco.Core/EmbeddedResources/Lang/en.xml
#	src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml
#	src/Umbraco.Web.BackOffice/Controllers/ContentController.cs
#	src/Umbraco.Web.UI.Client/src/views/content/overlays/publishdescendants.html
2025-02-28 07:40:43 +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 64024e418f Bumped version to 15.2.3. 2025-02-28 06:48:13 +01:00
Nhu DinhandGitHub a7a6eb8af6 V15 QA Fixing the failing acceptance tests in the nightly build (#18466)
* Updated permission name due to UI changes

* Added skip to flaky tests

* Add skip to flaky tests

* Bumped version

* Updated content tests due to test helper changes
2025-02-27 11:44:39 +00:00
Lee KelleherandGitHub f6ab6eea75 Tiptap RTE: Reusable toolbar menu component (#18483)
* Adds Tiptap Toolbar Menu extension kind

a reusable menu component.

Removes the `unique` property for menu-items.

* Implements Font Family as toolbar menu kind

* Implements Font Size as toolbar menu kind

* Implements Style Select as toolbar menu kind

* Implements Table as toolbar menu kind

* Markup amends

* Mock data RTE content addition

* "TextDirection" manifest correction

* Text Align: made to be toggleable
2025-02-27 09:52:44 +00:00
Lee KelleherandGitHub 9809db4179 Tiptap: Text color + background color (#18482)
adds a reusable "color picker button" kind extension type.
2025-02-27 09:42:25 +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
Nikolaj GeisleandGitHub 2bdeefec16 Pass preview to GetEntryOptions (#18470) 2025-02-26 21:48:03 +00:00
Kenn JacobsenandGitHub 5ed09ebefa Backport ShowUnroutableContentWarnings to V13 (#18479) 2025-02-26 20:13:27 +01:00
Niels LyngsøandGitHub 07bb2d1840 Feature: RTE blocks validation (#18453)
* restructure block list code a bit for better readability

* improve error message

* block list validation

* validation for RTE Blocks

* rte blocks validation
2025-02-26 13:10:59 +00:00
Niels Lyngsø 207bd7283c DX to inform about why there is a discard changes 2025-02-26 12:48:39 +01:00
Niels LyngsøandGitHub afe4a56ca7 createContainer shuld duplicate none owner parent containers (#18462) 2025-02-26 09:29:36 +01:00
Lee KelleherandGitHub 40fc911234 Tiptap: Text Direction extension + toolbar buttons (#18459)
for bidi support, right-to-left; left-to-right.
2025-02-26 08:38:46 +01:00
Andy Butland eaea7a67ba Bump version to 13.7.0. 2025-02-26 08:14:26 +01:00
Jacob OvergaardandGitHub e5d5f03818 V15: Schedule only languages you have access to (#18433)
* fix: shows all languages but only lets user click on available languages

same logic as used in publish modal

* fix: only adds "selected" languages to the value output

otherwise the server will not accept values from languages you do not have access to

* mark private properties
2025-02-25 14:58:20 +00:00
Niels LyngsøandGitHub ef4bef80d7 Fix: content structure promise (#18456)
* client validation for textarea

* keep response
2025-02-25 14:58:09 +00:00
Lee KelleherandGitHub 6938225c83 Chore: Tiptap code sweep (#18447)
* Streamlined Tiptap extension code for consistency

* Corrected `Umb.Kind.TiptapToolbar.Button` manifest

* Simplified the Tiptap placeholder text

* Media Upload: de-duplicated blobUrl 

* Simplified CSS

* Sets rendered Image CSS to 100% width rather than adding `width: 100%` to the `<img>` markup/content.
2025-02-25 14:49:39 +00:00
Mads RasmussenandGitHub 492eb639df implement pagination (#18441) 2025-02-25 15:28:21 +01:00
Niels LyngsøandGitHub 32da5a2358 Feature: enforce block variations to be present in all mandatory languages (#18280)
* no need to re-request cause application refreshes when user changes

* implement promise to retrieve languages

* expose on all mandatory languages, to ensure the right mandatory effect
2025-02-25 14:13:37 +00:00
Lee KelleherandGitHub 0794ff9bf5 Tiptap: Trailing Node extension (#18446) 2025-02-25 15:04:14 +01:00
Lee KelleherandGitHub 5db67ae6b9 Tiptap RTE: Table selection styling (#18444)
* Tiptap table: amend "selected" color

* Tiptap table: correct cell border

for selection.
2025-02-25 15:03:04 +01:00
Lee KelleherandGitHub 52063f04f2 Tiptap RTE: configuration localizations (#18125)
* Adds localizations for general RTE settings

* Adds localizations for Tiptap settings

* Adds "Edit source code" localization

For Tiptap's View Source Code modal headline.

* Added more Tiptap RTE localizations

Applied to TinyMCE where relevant.
2025-02-25 15:02:27 +01:00
4e5512fd8f Feature: Simpler app language request (#18278)
* no need to re-request cause application refreshes when user changes

* implement promise to retrieve languages

* add back the isAuth observable

* Update app-language.context.ts

---------

Co-authored-by: Mads Rasmussen <madsr@hey.com>
2025-02-25 13:33:06 +00:00
Andreas ZerbstandGitHub 2e5a5b65fd V15 QA fixed flaky language tests (#18451)
* Added wait for flaky test

* Updated version
2025-02-25 13:06:52 +00:00
ebc38f4cb3 Server side validation for property editors (integer, decimal and slider) (#18428)
* Server side validation for integer property value editor.

* Apply suggestions from code review

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

* Applied further changes from code review.

* Localized validation messages.

* Added server-side validation for decimal property editor.

* Added server-side validation for slider property editor.

* Moved repeated step validation into a helper method.

* Add danish translations

---------

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>
2025-02-25 13:33:20 +01:00
Niels LyngsøandGitHub fe71f571bb Feature: Property Value Preset (#18423)
* property value preset type

* add version to comment

* move clone controller

* add JSDocs

* sort getByTypeAndFilter

* builder

* updates for extension type

* unit test

* test weight

* dynamic filter depending on situation

* async test

* combine ui and schema test

* make block creation async

* commit todos

* proper deprecation

* value can be undefined

* toggle preset api

* ability to observe and get all languages

* default config field

* change only to expose all Cultures

* Variant Presets

* fix test

* implementation for blocks

* TODO

* improve comment

* implement for ContentTypes

* always set culture and segment for variant values

* only set values that got a value

* todo notes

* also resolve init when createScaffold

* property-value-preset.Slider

* leaving some concept code for another time

* enable undefined

* revert

* sort properties when creating

* refactor into setCurrentData

* refactor to content data manager

* Keep order from persisted data

* refactor to also cover updateCurrent

* add type safety by making persisted partial as well

* lint corrections

* preset for markdown

* refactor to work with frozen data

* implement for MarkDown

* compare based on object properties not object as a whole

* only update persisted data in regards to what was saved

* fix tests
2025-02-25 12:33:01 +00:00
74eb66ef86 V15: Serverside Media Picker Validation (#18429)
* Add TypedJsonValidator to avoid duplicate serialization

* Add allowed type validator

* Validate multiple media toggle

* Add startnode validator

* Fix tests

* Add validation tests

* Apply suggestions from code review

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

* Add XML docs

* Remove unnecessary obsolete constructor

* Avoid multiple checks

* Use value instead of specific member names

* Remove test

* Optimize StartNodeValidator

* Clarify Validates_Allowed_Type

---------

Co-authored-by: Andy Butland <abutland73@gmail.com>
2025-02-25 13:26:16 +01:00
790c451df1 Published status filtering (#18281)
* Initial refactor (pending more tests)

* Fix structural querying across changing publish states + add tests accordingly

* Add tests to validate ancestor and descendant order

* Remove axis querying from published status filtering

---------

Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
2025-02-25 13:25:33 +01:00
Jacob OvergaardandGitHub c19b2286b3 feat: adds validation on date from/to inputs in the schedule modal (#18437) 2025-02-25 11:55:26 +00:00
Andy ButlandandGitHub 913205e614 Restored minimal default permissions for the writer user group. (#18449) 2025-02-25 10:29:54 +00:00
8c931d59bd Add Localization to Documentation Types - Structure - Collection (#18396)
* Localization changes to Documentation Types - Structure - Collection

* added the collections to en-us too

* Delete src/Umbraco.Web.UI/Umbraco.Web.UI.sln

* Adds collection:noItemsTitle

* Adds collection:noItemsTitle

---------

Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>
2025-02-25 09:03:02 +00:00
Niels LyngsøandGitHub 33ee1447cc Fix #18431 (#18445)
* Keep order from persisted data

* refactor to also cover updateCurrent
2025-02-25 09:44:31 +01:00
leekelleherandJacob Overgaard e448f4b174 Added TinyMCE toolbar to Tiptap toolbar mappings
for the Font and Style items.
2025-02-25 09:13:31 +01:00
leekelleherandJacob Overgaard 3dfec52d55 Toolbar style tweaks 2025-02-25 09:13:31 +01:00
leekelleherandJacob Overgaard 86942c34d8 Enhanced Span extension
Changed to be a `Mark`, as `Node`s aren't allowed within paragraphs.

Unregistered the `TextStyle` extension,
as it conflicts with the global `style` attribute feature.
2025-02-25 09:13:31 +01:00
leekelleherandJacob Overgaard 85179dcfd3 Updated mock data 2025-02-25 09:13:31 +01:00
leekelleherandJacob Overgaard 5037cc321f Tiptap TextStyle tweaks 2025-02-25 09:13:31 +01:00
leekelleherandJacob Overgaard da26fd1a3c Updates TinyMCE mock data
to show the font buttons in the toolbar
2025-02-25 09:13:31 +01:00
leekelleherandJacob Overgaard d30af299ef Tiptap: adds Font Size toolbar button 2025-02-25 09:13:31 +01:00
leekelleherandJacob Overgaard 9f00e968a6 Tiptap: adds Font Family toolbar button 2025-02-25 09:13:31 +01:00
Niels LyngsøandGitHub a4f385ba01 Fix: remember validation state when creating (#18432)
* only reset state and load if its a new unique

* related clean up

* return response promise
2025-02-24 22:09:43 +01:00
Niels LyngsøandGitHub 347e898190 simplifying the use of props (#18430) 2025-02-24 18:50:29 +00:00
Kenn JacobsenandGitHub 3e291894e5 Fix validation for blocks in variant block editors (#18438) 2025-02-24 18:47:37 +01:00
Mads RasmussenandGitHub c431a5abfe Implement create options for Member Types + Fix issue when single option is a link (#18310)
* implement create options for member types

* export path consts

* add support for first action being a link

* add comment
2025-02-24 13:49:36 +00:00
a482ab239a Feature: Bulk Delete/Trash referenced by (#18393)
* add trash confirm modal

* make referenceRepo optional + adjust styling

* add referenceRepository to media trash action

* wip entity-item-ref extension point

* clean up

* add ref list element

* fix styling

* Update document-item-ref.element.ts

* move item repo

* implement for input member

* enable action slot

* add null check

* fix sorting again

* fix sorting again

* use member element

* add draft styling back

* move item repository

* implement for user input

* pass readonly and standalone props

* make editPath a state

* Update member-item-ref.element.ts

* Fix user item ref

* remove open button

* remove unused

* remove unused

* check for section permission

* add null check

* change to use entity-item-ref element

* register media item ref

* add fallback element

* show 3 references

* wip data mapper concept

* add unique to modal route registration

* add unique to modal router

* remove unused id

* Update member-item-ref.element.ts

* append unique

* compare with old value

* only recreate the controller if the entity type changes

* fix console warning

* implement for document item ref

* Added $type to ReferenceResponseModels

* move logic to item data resolver

* render draft as a tag

* Update document-item-ref.element.ts

* generate server models

* add more helpers to data resolver

* export resolver

* add observables

* use observables in document item ref

* add data resolver to tree item

* add observable state

* use const

* align models

* get icon from document type object

* observe name and state

* update observed value when a new item is set

* update method name

* update method names

* pass model type

* pass context type

* use api prop instead of context

* use api prop instead of context

* fix types

* use addUniquePaths for modal registration

* add fallback

* use ref list

* use reference items for media

* make mapper name more generic

* make default ref item always readonly

* export types

* temp fake variants array

* add variants array to model

* Update media-references-workspace-info-app.element.ts

* add variants to model

* hardcode fake array

* register media ref item

* update mock data

* dot not allow conditions for data mappers

* add data mapper

* prefix info routes

* prefix all ref routes

* return undefined if there is not edit path

* add types for reference data source + repository

* split trash with relation into its own action

* render descendants with references

* fix length check

* set standalone attribute

* implement for media

* move trash

* wip delete with relation

* move to element

* fix name collision

* require data source identifier

* use management api mapper

* add management api mapper

* fix type errors

* Update index.ts

* align naming

* show references when deleting a document

* Update delete-with-relation-modal.element.ts

* use deleteWithRelation kind for media

* clean up

* localize trash

* fix type

* Update trash-with-relation.action.ts

* override confirm methods in trash and delete actions

* Update index.ts

* export constants

* Limit referenced-by document and media endpoints to references only.

* Update document-reference-table.element.ts

* add methods to get bulk references for documents

* wip bulk trash

* add todo comment

* implement path pattern for media item

* clean up

* more clean up

* sort imports

* member edit path pattern

* clean up

* remove unused variant id

* export extension types

* wip bulk trash with relation

* debounce incoming events

* look up items + notify

* add todo

* temp solution to make it non breaking

* add bulk delete

* better description

* implement methods for are referenced

* change to use bulk trash with relation

* implement delete with relation kind

* deprecation warnings

* move files

* move files

* export const

* use correct kind

* align naming

* upper case Trash

* correct uui-text impl

* add comment about the v2 name

* fix circular depdendencies

* rename const

* split to module

* import global components

* more explicit naming

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
Co-authored-by: Andy Butland <abutland73@gmail.com>
Co-authored-by: Niels Lyngsø <niels.lyngso@gmail.com>
2025-02-24 14:03:26 +01:00
Mads RasmussenandGitHub 5011241a54 remove unused href (#18413) 2025-02-24 13:47:49 +01:00
70be31b8f8 Added obsoletion methods for extension methods to be removed in Umbraco 16 (#18394)
* Added obsoletion methods for extension methods to be removed in Umbraco 16.

* Updated obsolete messages to reference Umbraco 17

* Fix typo

---------

Co-authored-by: mole <nikolajlauridsen@protonmail.ch>
2025-02-24 12:27:04 +00:00
Niels LyngsøandJacob Overgaard 6b50797693 also correct blocks despite markup haven't been touched in this session 2025-02-24 08:41:16 +01:00
Mads RasmussenandGitHub f64eb1261d set value so items can be removed (#18404) 2025-02-24 07:31:31 +00:00
Andy ButlandandGitHub a81cec963d Fixes count of message displayed when more than the maximum amount of blocks are added to a block list. (#18418) 2025-02-23 19:48:28 +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 c3b51301cc Adds warning to publish descendants dialog when force re-publish is selected (15) (#18410) 2025-02-21 23:17:23 +01:00
Jacob OvergaardandGitHub d5e2efbbaa V15: A user cannot switch back to the default language (#18414)
* chore: prettier

* fix: loads all extensions everytime but register only new localizations

this ensures that the browser is updated even if you switch back to a previously loaded language

* test: adds a test to check if we can switch between already loaded languages
2025-02-21 15:58:23 +00:00
a0ddaefaa1 Add localization for Approved color/Color Picker Data type (#18411)
* Add localization for Approved color/Color Picker Data type

* Apply suggestions from code review

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

---------

Co-authored-by: Andy Butland <abutland73@gmail.com>
2025-02-21 11:50:08 +01:00
Andy ButlandandGitHub c5c64f2b54 Ported changes from Umbraco 13 around not throwing exceptions with identity IDs that can't be parsed to an integer or GUID (#18389)
* Ported changes from Umbraco 13 around not throwing exceptions with identity IDs that can't be parsed to an integer or GUID.

* Revert async changes (better done systemically in a separate update).
2025-02-21 09:48:34 +01:00
368f6eb02d V15: Dont delete when referenced setting is enabled (#18359)
* Take content settings into account

* Implement test

* Amend error message

* Move new enums to have same values

* Update to check in ServiceBase

* Fix empty recycle bin

* Return proper operation status

* Apply suggestions from code review

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

* Fix according to feedback

---------

Co-authored-by: Kenn Jacobsen <kja@umbraco.dk>
2025-02-21 07:07:13 +01:00
Niels Lyngsø 21a071675e correct uui-text impl 2025-02-20 16:33:19 +01:00
2c20902c9b Feature: Delete/Trash referenced by (#18351)
* add trash confirm modal

* make referenceRepo optional + adjust styling

* add referenceRepository to media trash action

* wip entity-item-ref extension point

* clean up

* add ref list element

* fix styling

* Update document-item-ref.element.ts

* move item repo

* implement for input member

* enable action slot

* add null check

* fix sorting again

* fix sorting again

* use member element

* add draft styling back

* move item repository

* implement for user input

* pass readonly and standalone props

* make editPath a state

* Update member-item-ref.element.ts

* Fix user item ref

* remove open button

* remove unused

* remove unused

* check for section permission

* add null check

* change to use entity-item-ref element

* register media item ref

* add fallback element

* show 3 references

* wip data mapper concept

* add unique to modal route registration

* add unique to modal router

* remove unused id

* Update member-item-ref.element.ts

* append unique

* compare with old value

* only recreate the controller if the entity type changes

* fix console warning

* implement for document item ref

* Added $type to ReferenceResponseModels

* move logic to item data resolver

* render draft as a tag

* Update document-item-ref.element.ts

* generate server models

* add more helpers to data resolver

* export resolver

* add observables

* use observables in document item ref

* add data resolver to tree item

* add observable state

* use const

* align models

* get icon from document type object

* observe name and state

* update observed value when a new item is set

* update method name

* update method names

* pass model type

* pass context type

* use api prop instead of context

* use api prop instead of context

* fix types

* use addUniquePaths for modal registration

* add fallback

* use ref list

* use reference items for media

* make mapper name more generic

* make default ref item always readonly

* export types

* temp fake variants array

* add variants array to model

* Update media-references-workspace-info-app.element.ts

* add variants to model

* hardcode fake array

* register media ref item

* update mock data

* dot not allow conditions for data mappers

* add data mapper

* prefix info routes

* prefix all ref routes

* return undefined if there is not edit path

* add types for reference data source + repository

* split trash with relation into its own action

* render descendants with references

* fix length check

* set standalone attribute

* implement for media

* move trash

* wip delete with relation

* move to element

* fix name collision

* require data source identifier

* use management api mapper

* add management api mapper

* fix type errors

* Update index.ts

* align naming

* show references when deleting a document

* Update delete-with-relation-modal.element.ts

* use deleteWithRelation kind for media

* clean up

* localize trash

* fix type

* Update trash-with-relation.action.ts

* override confirm methods in trash and delete actions

* Update index.ts

* export constants

* Limit referenced-by document and media endpoints to references only.

* Update document-reference-table.element.ts

* add todo comment

* implement path pattern for media item

* clean up

* more clean up

* sort imports

* member edit path pattern

* clean up

* remove unused variant id

* export extension types

* align naming

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
Co-authored-by: Andy Butland <abutland73@gmail.com>
Co-authored-by: Niels Lyngsø <niels.lyngso@gmail.com>
2025-02-20 15:29:40 +00:00
78554f81f3 Feature: Data mapping extension + aligning reference lists (#18318)
* wip entity-item-ref extension point

* clean up

* add ref list element

* fix styling

* Update document-item-ref.element.ts

* move item repo

* implement for input member

* enable action slot

* add null check

* fix sorting again

* fix sorting again

* use member element

* add draft styling back

* move item repository

* implement for user input

* pass readonly and standalone props

* make editPath a state

* Update member-item-ref.element.ts

* Fix user item ref

* remove open button

* remove unused

* remove unused

* check for section permission

* add fallback element

* wip data mapper concept

* add unique to modal route registration

* add unique to modal router

* remove unused id

* Update member-item-ref.element.ts

* append unique

* compare with old value

* only recreate the controller if the entity type changes

* fix console warning

* implement for document item ref

* Added $type to ReferenceResponseModels

* move logic to item data resolver

* render draft as a tag

* Update document-item-ref.element.ts

* generate server models

* add more helpers to data resolver

* export resolver

* add observables

* use observables in document item ref

* add data resolver to tree item

* add observable state

* use const

* align models

* get icon from document type object

* observe name and state

* update observed value when a new item is set

* update method name

* update method names

* pass model type

* pass context type

* use api prop instead of context

* use api prop instead of context

* fix types

* use addUniquePaths for modal registration

* add fallback

* use ref list

* use reference items for media

* make mapper name more generic

* make default ref item always readonly

* export types

* temp fake variants array

* add variants array to model

* Update media-references-workspace-info-app.element.ts

* add variants to model

* hardcode fake array

* register media ref item

* update mock data

* dot not allow conditions for data mappers

* add data mapper

* prefix info routes

* prefix all ref routes

* return undefined if there is not edit path

* fix name collision

* require data source identifier

* use management api mapper

* add management api mapper

* fix type errors

* Update index.ts

* align naming

* add todo comment

* implement path pattern for media item

* clean up

* more clean up

* sort imports

* member edit path pattern

* clean up

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
Co-authored-by: Niels Lyngsø <niels.lyngso@gmail.com>
2025-02-20 15:48:02 +01:00
DitteKKoustrupandGitHub 60eb55cefe Add Localization to Document Type - Settings - Vary by Culture and Segments (#18397) 2025-02-20 15:20:49 +01:00
MoleandGitHub ec77b2fa1b Check null in cachevalue for (#18395) 2025-02-20 14:14:57 +01:00
Niels LyngsøandGitHub 54dafd4031 update documentation for a simpler and more clear read (#18381) 2025-02-20 10:55:45 +00:00
Jacob OvergaardandGitHub 7a7602f1bb V15: Update Backoffice NPM dependencies (#18376)
* build(deps-dev): update storybook from 8.4.7 to 8.5.6

* build(deps): update tiptap from 2.11.2 to 2.11.5

* build(deps-dev): update eslint stuff to latest

* build(deps): update element-internals-polyfill from 1.3.12 to 1.3.13

* build(deps): update marked from 15.0.6 to 15.0.7

* build(deps-dev): update vite from 5.4.14 to 6.1.0

* build(deps-dev): update globals to 15.15.0 (eslint dependency)

* build(deps): update icon libraries to latest

* build(deps-dev): update prettier from 3.4.2 to 3.5.1

* chore: generate consts

* build(deps-dev): update test-related libraries

* feat: copy over code from the tiny base64-js library because it is not exported as esm and has not been updated in 4 years

* build(deps-dev): remove dependency from base64-js

* build(deps-dev): upgrade rollup dependencies

* test: disable tests for tinyce

* build(deps-dev): update @babel/core to 7.26.9

* build(deps): update storybook to latest

* build(deps-dev): update types

* build(deps-dev): update typedoc from 0.27.6 to 0.27.7

* build(deps-dev): update @rollup/plugin-commonjs to latest

* build(deps): import tiny as default and re-export as module and default to make everyone happy (and avoid commonjs pitfalls)

* build: remove dependency on commonjs to build externals

* build(deps-dev): uninstall @rollup/plugin-commonjs as it is no longer needed

* test: reenable tinymce tests

* fix: sets a default label

this mistake was highlighted by the test runner

* test: reenable tinymce tests

* build: ignores autogenerated test file

* build: adds github error logging to icon generator

* build: log as error

* build: adds tests for generate:* scripts

* build: optimises icons with svgo to remove useless things like comments

this also ensures that icons are unchanged when we upgrade icon library packages as they would normally include things like versions as comments in the files
2025-02-20 10:29:54 +00:00
Niels LyngsøandGitHub 5401a85828 Feature: Support Handle Selector in Sorter (#18356)
* implement handleSelector configuration option for Sorter Controller

* improve sorting of Content Type Groups

* fix ignorerSelector

* remove button from default ignorer

* block grid type group sorter use handle

* fix content type group sorter style

* handle for Block List Entries

* adjustments for block list and grid
2025-02-20 11:14:58 +01:00
37fd4f6ff6 Toggle property Value labels and validation (#18333)
* localizations

* toggle validation

---------

Co-authored-by: Mads Rasmussen <madsr@hey.com>
2025-02-20 09:41:33 +00:00
Sven Geusens 3a9ab25e28 Merge branch 'release/15.2.2' into v15/dev
# Conflicts:
#	src/Umbraco.Web.UI.Client/package-lock.json
#	src/Umbraco.Web.UI.Client/package.json
#	version.json
2025-02-20 10:12:31 +01:00
Niels LyngsøandGitHub 59819e0639 use super.value to trigger validation check (#18303) 2025-02-20 09:56:05 +01:00
Niels LyngsøandGitHub 31bbd7ecfc Merge pull request #18224 from umbraco/v15/feature/block-grid-block-type-validation
Feature: block grid block type area/root validation
2025-02-20 09:50:30 +01:00
Niels LyngsøandGitHub edff2c1c8c Chore: Block Manager + Variant ID Polishing (#18321)
* use observablePart()

* methods for variant ID

* move into a gotManager method
2025-02-20 09:35:53 +01:00
Andy ButlandandGitHub b10a11b5b7 Disable webhook firing if disable in configuration. (#18386) 2025-02-19 15:50:08 +01:00
Lee KelleherandGitHub 040d4fe363 Tiptap RTE: Table extension enhancements (#18365)
* Tiptap: Adds custom button for Table

Provides a popover with table menu actions.

* Moved Table extension to its own folder

* Extended the Tiptap `Table` extensions

* Amended table toolbar actions to have `focus()`

* Markup amends

* Fix up Tiptap mock data

* [WIP] Table column/row bubble menu

* Tiptap, enabled content check for invalid markup

* [WIP] Tiptap toolbar cascading menu items

* Tiptap: relocated Block extension

from "plugins" folder to "extensions" subfolder.

* Table toolbar, moved the menu to the API

* `UmbTiptapToolbarElementApiBase`, made `execute` concrete

so that it becomes optional in extended classes.

* Adds "default" toolbar element API

which does nothing, but satisfies the extension loader controller.

* `@ts-ignore` the `.showPopover()` and `.hidePopover()` calls

* Updated Tiptap toolbar mock data-type.data

to match TinyMCE toolbar layout.

* Implemented "Cascading Menu Popover" as a standalone component

* Reworked Table toolbar to use cascading menu

* [WIP] Tiptap bubble menu

* Adds Tiptap Cascading Menu Popover

Example with a Style Select menu, with default (hard coded) options,
similar to TinyMCE's unconfigured Style Select menu.

* Small code tidy ups

* Added "Insert Table" component

* Removed Table Bubble Menu feature (temporarily)

as its development isn't ready yet.

* Removed `umb-tiptap-hover-menu` component

as it wasn't been used.
I expect this will become the bubble menu feature.
2025-02-19 13:00:23 +01:00
Andy ButlandandGitHub 64607ddbaa Disable webhook firing if disable in configuration. (#18383) 2025-02-19 12:17:04 +01:00
leekelleherandJacob Overgaard 28fb7ad67e Refactors loading core Tipap extension
The unit test doesn't register the manifests, so we'll need
to hard code loading the "Rich Text Essentials" extension.
2025-02-19 12:01:22 +01:00
Jacob Overgaard effa40fabb build(deps-dev): update npm dependencies 2025-02-19 09:49:17 +01:00
Andy ButlandandGitHub f389cc9aa3 Modified AspNetCoreRequestAccessor to gracefully handle the absence of an HttpContext (#18369) 2025-02-19 08:46:14 +00:00
Chris HoustonandGitHub ac3b17b390 Fixes the Fatal icon text so it's readable in Dark Mode. (#18375) 2025-02-18 22:00:19 +01:00
Mads RasmussenandGitHub c216d692c2 Feature: Display current variant item name (#18311)
* wip entity-item-ref extension point

* clean up

* add ref list element

* fix styling

* Update document-item-ref.element.ts

* move item repo

* implement for input member

* enable action slot

* add null check

* fix sorting again

* fix sorting again

* use member element

* add draft styling back

* move item repository

* implement for user input

* pass readonly and standalone props

* make editPath a state

* Update member-item-ref.element.ts

* Fix user item ref

* remove open button

* remove unused

* remove unused

* check for section permission

* add fallback element

* add unique to modal route registration

* add unique to modal router

* remove unused id

* Update member-item-ref.element.ts

* append unique

* compare with old value

* only recreate the controller if the entity type changes

* fix console warning

* implement for document item ref

* move logic to item data resolver

* render draft as a tag

* Update document-item-ref.element.ts

* add more helpers to data resolver

* export resolver

* add observables

* use observables in document item ref

* add data resolver to tree item

* add observable state

* use const

* align models

* get icon from document type object

* observe name and state

* update observed value when a new item is set

* update method name

* update method names

* pass model type

* pass context type

* use api prop instead of context

* use api prop instead of context

* fix types

* use addUniquePaths for modal registration

* fix type errors

* Update index.ts

* clean up

* use path pattern
2025-02-18 19:52:05 +01:00
Jacob Overgaard fdebb66fc8 Merge remote-tracking branch 'origin/contrib' into v15/dev 2025-02-18 16:26:27 +01:00
dependabot[bot]andJacob Overgaard 7ac57790ff Bump dompurify from 3.2.3 to 3.2.4 in /src/Umbraco.Web.UI.Login
Bumps [dompurify](https://github.com/cure53/DOMPurify) from 3.2.3 to 3.2.4.
- [Release notes](https://github.com/cure53/DOMPurify/releases)
- [Commits](https://github.com/cure53/DOMPurify/compare/3.2.3...3.2.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-18 16:08:07 +01:00
leekelleherandJacob Overgaard b3b85b8a6a Adds Tiptap Cascading Menu Popover
Example with a Style Select menu, with default (hard coded) options,
similar to TinyMCE's unconfigured Style Select menu.
2025-02-18 16:07:34 +01:00
Andy ButlandandGitHub 96bbed5abf On retrieving other URLs, don't attempt to walk up the navigation structure to find parents when content is trashed. (#18355) 2025-02-18 13:31:40 +01:00
Niels LyngsøandGitHub 04eb94d958 use display contents instead of setting a height (#18363) 2025-02-18 12:20:33 +01:00
Sven Geusens fe9ea4766a Merge branch 'release/15.2.1' into v15/dev
# Conflicts:
#	version.json
2025-02-18 11:25:45 +01:00
Sven Geusens a9f9cd7811 Merge branch 'v15/dev' of https://github.com/umbraco/Umbraco-CMS into v15/dev 2025-02-18 11:25:00 +01:00
dependabot[bot]andJacob Overgaard 5c2e4da1ce Bump dompurify from 3.2.3 to 3.2.4 in /src/Umbraco.Web.UI.Client
Bumps [dompurify](https://github.com/cure53/DOMPurify) from 3.2.3 to 3.2.4.
- [Release notes](https://github.com/cure53/DOMPurify/releases)
- [Commits](https://github.com/cure53/DOMPurify/compare/3.2.3...3.2.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-18 11:12:11 +01:00
leekelleherandJacob Overgaard 9e0614ff74 Tiptap: relocated the Block extension 2025-02-18 11:11:38 +01:00
leekelleherandJacob Overgaard 50b891a79a Updates Tiptap mock data
and story.
2025-02-18 11:11:00 +01:00
Sven Geusens 01fc5998df Merge branch 'v14/dev' into v15/dev
# Conflicts:
#	src/Umbraco.Infrastructure/Runtime/FileSystemMainDomLock.cs
#	src/Umbraco.Web.Common/Views/UmbracoViewPage.cs
2025-02-18 11:09:52 +01:00
Andy ButlandandGitHub 82d13b50b6 Limit referenced-by document and media endpoints to references only. (#18354) 2025-02-18 10:04:00 +01:00
Sven Geusens 9e7a36865a Merge branch 'v13/dev' into v14/dev
Revert #18249 as it is reimplemented for v15
Revert #18320 as the new architecture explictly throws an error

# Conflicts:
#	build/azure-pipelines.yml
#	src/Umbraco.Core/EmbeddedResources/Lang/en.xml
#	src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml
#	src/Umbraco.Core/Models/ContentEditing/ContentSaveAction.cs
#	src/Umbraco.Core/Services/ContentService.cs
#	src/Umbraco.Core/Services/IContentService.cs
#	src/Umbraco.Core/Services/MemberService.cs
#	src/Umbraco.Infrastructure/PropertyEditors/RichTextEditorPastedImages.cs
#	src/Umbraco.Infrastructure/Security/BackOfficeUserStore.cs
#	src/Umbraco.Infrastructure/Security/MemberUserStore.cs
#	src/Umbraco.Web.BackOffice/Controllers/ContentController.cs
#	src/Umbraco.Web.BackOffice/Controllers/EntityController.cs
#	src/Umbraco.Web.BackOffice/Controllers/MediaController.cs
#	src/Umbraco.Web.BackOffice/Controllers/MemberController.cs
#	src/Umbraco.Web.BackOffice/Controllers/PreviewController.cs
#	src/Umbraco.Web.BackOffice/Controllers/UsersController.cs
#	src/Umbraco.Web.BackOffice/DependencyInjection/UmbracoBuilder.BackOfficeAuth.cs
#	src/Umbraco.Web.BackOffice/Filters/ContentSaveValidationAttribute.cs
#	src/Umbraco.Web.BackOffice/Filters/MemberSaveModelValidator.cs
#	src/Umbraco.Web.BackOffice/Filters/MemberSaveValidationAttribute.cs
#	src/Umbraco.Web.BackOffice/Trees/ContentTreeController.cs
#	src/Umbraco.Web.Common/RuntimeMinification/SmidgeOptionsSetup.cs
#	src/Umbraco.Web.Common/RuntimeMinification/SmidgeRuntimeMinifier.cs
#	src/Umbraco.Web.Common/Views/UmbracoViewPage.cs
#	src/Umbraco.Web.UI.Client/src/common/directives/components/buttons/umbbuttongroup.directive.js
#	src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js
#	src/Umbraco.Web.UI.Client/src/common/directives/components/content/umbtabbedcontent.directive.js
#	src/Umbraco.Web.UI.Client/src/common/directives/components/property/umbproperty.directive.js
#	src/Umbraco.Web.UI.Client/src/common/resources/content.resource.js
#	src/Umbraco.Web.UI.Client/src/common/resources/publicaccess.resource.js
#	src/Umbraco.Web.UI.Client/src/common/resources/users.resource.js
#	src/Umbraco.Web.UI.Client/src/common/services/assets.service.js
#	src/Umbraco.Web.UI.Client/src/views/common/drawers/help/help.controller.js
#	src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/linkpicker/linkpicker.controller.js
#	src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/mediaentryeditor/mediaentryeditor.controller.js
#	src/Umbraco.Web.UI.Client/src/views/components/content/umb-tabbed-content.html
#	src/Umbraco.Web.UI.Client/src/views/components/property/umb-property.html
#	src/Umbraco.Web.UI.Client/src/views/content/content.create.controller.js
#	src/Umbraco.Web.UI.Client/src/views/content/overlays/publishdescendants.controller.js
#	src/Umbraco.Web.UI.Client/src/views/content/overlays/publishdescendants.html
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.controller.js
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.component.js
#	src/Umbraco.Web.UI.Client/src/views/users/views/user/details.html
#	src/Umbraco.Web.UI.Client/src/views/webhooks/edit.controller.js
#	src/Umbraco.Web.UI.Client/src/views/webhooks/edit.html
#	src/Umbraco.Web.UI.Client/test/unit/app/content/create-content-controller.spec.js
#	src/Umbraco.Web.UI.Client~HEAD
#	src/Umbraco.Web.UI.Login/src/auth.element.ts
#	tests/Umbraco.TestData/UmbracoTestDataController.cs
#	tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentServiceTests.cs
#	tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentEventsTests.cs
#	tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServicePublishBranchTests.cs
#	tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServiceTagsTests.cs
#	tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Security/MemberUserStoreTests.cs
#	tests/Umbraco.Tests.UnitTests/Umbraco.Web.BackOffice/Controllers/MemberControllerUnitTests.cs
#	version.json
2025-02-17 19:25:45 +01:00
ed63f278c2 V15: Save the variant before scheduling (#18344)
* feat: adds validation checks and saves a version when scheduling content

* chore: adds mock handler for validate

* docs: adds documentation for umbracoPath

* chore: adds deprecation and todos

* feat: adds a method to output a list format

* test: adds test for list format

* feat: rename to list

* feat: adds localization for scheduling

* feat: adds notifications for publishing by action

* test: fixes naming

* feat: adds notification for publishing in bulk

* feat: fixes todo by adding localization

* feat: adds notification when publishing from workspace

---------

Co-authored-by: leekelleher <leekelleher@gmail.com>
2025-02-17 16:31:34 +00:00
Lee KelleherandGitHub e753e2cbf0 Markdown Editor: adds "Default value" support (#18326) 2025-02-17 17:01:41 +01:00
Sven GeusensandGitHub d87a84be14 Loosen the RTEValue datacontract to improve migrations (#18349) 2025-02-17 15:27:22 +01:00
Mads Rasmussen 8bbb12da5a generate server models + fix client 2025-02-17 13:47:02 +01:00
MoleandGitHub c76d764598 V15: Only cache items if all ancestors are published (#18337)
* Introduce IsDocumentPublishedInAnyCulture

Sometimes we don't care about culture

* Check ancestor path when resolving cache items

* Fix tests

* Rebuild NavigationService

* Only set node if it has a published ancestor path

* Remove branch when unpublished

* Add tests

* Add seed test

* Consider published ancestor path when seeding documents

* Introduce MediaBreadthFirstKeyProviderTests

This is needed since the logic of document and media is no longer the same

* Remove unused services

* Move assert page to helper

* Add variant tests

* Add tests

* Filter keys in ContentTypeSeedKeyProvider

* Fix tests

* Add failing test showing refreshing issue

* Don't blow up if we can't resolve the node from navigation cache

Turns out that this can actually happen :D Should be fine to just return false

* Refactor cache refresher check

* Make NavigationQueryService service protected

* Add comment on how to refactor breadth first key provider

* Refactor if statement
2025-02-17 12:51:33 +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 69e251ad17 Adding additional document collection properties to align model with item response (#18309)
* Added IsTrashed to document collection model.

* Add IsProtected to document collection response model.

* Rework to do setting of IsProtected within the mapper.

* Remove use of service in map definition.

* Refactor document and media by key endpoints to use presentation factories.

* Set IsProtected property.

* Introduced base presentation factory interface for content.
2025-02-17 12:27:53 +01:00
Andy ButlandandGitHub def7ebd48c Html encodes the user's name in the invite email. (#18343) 2025-02-17 12:25:12 +01:00
8f9c8cbaee Allow for multiple backoffice hosts (#18302)
* Allow for multiple backoffice hosts

* Update src/Umbraco.Cms.Api.Management/Security/BackOfficeApplicationManager.cs

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

---------

Co-authored-by: Andy Butland <abutland73@gmail.com>
2025-02-17 11:49:49 +01:00
89d4563e24 V15: Add a button to clear schedule (#18339)
* chore(mock): adds handling for publishing schedules

* chore: removes unused translation key

* feat: shows a message when a culture has pending changes that are not saved

* feat: optimises pending changes text

* feat(UmbInputDateElement): extends the UUIInputElement rather than using it internally, which allows for more advanced form usage as well as usage of its slots

* feat: adds a Clear button on each date field to more easily clear a schedule

* feat: optimises localization with text from the real button

* Display the remove button if the datetime input has a value

---------

Co-authored-by: leekelleher <leekelleher@gmail.com>
2025-02-17 10:48:40 +00:00
Jacob OvergaardandGitHub a485194228 V15: Show duration on time displays (#18341)
* feat: adds a method to output a list format

* test: adds test for list format

* feat: adds a method to show a compounded relative time

* test: improves test to be absolute

* feat: allows dates to be strings

* chore: fixes lit warnings

* feat: adds compounded time to document info view

* feat: rename to list

* feat: use the Intl.DurationFormat API to format durations

* test: adds test for string dates

* feat: times should always be absolute

* feat: adds duration to the umb-localize-date element

* feat: adds support to set your own title

* revert changes

* feat: adds localization to calculate duration past or future

* feat: adds danish localization
2025-02-17 10:43:53 +00:00
leekelleher a6e8b23e42 Fixes broken stories/test. 2025-02-17 09:26:40 +00:00
Niels LyngsøandGitHub 8bbe0533c3 Close active modal if its begin unregistered (#18285) 2025-02-17 09:11:28 +01:00
Lee KelleherandGitHub 5379fec2d3 Data Type create option description (#18338)
* Added description for Data Type create option

* Updated "create_folderDescription" in English fallback

as it had previously been updated in English US only.

* US to GB typo correction
2025-02-14 15:37:41 +00:00
Andreas ZerbstandGitHub 2ae903ef1b V15 QA fixed failing nightly acceptance tests (#18340)
* Start updates

* Fixed tests

* Another fix

* Bumped version

* Updated pipeline

* Removed and

* Cleaned up
2025-02-14 13:49:14 +00:00
Lee KelleherandGitHub 66cf0874bb Code Editor Modal, adds localization support (#18325) 2025-02-14 08:36:23 +01:00
Lee KelleherandGitHub fe7db00450 Property actions: adds localization support (#18323)
also streamlined the icon render code
2025-02-14 08:35:55 +01:00
Lee KelleherandGitHub b38ef14475 LinkedIn icon, adds currentColor fill (#18322) 2025-02-14 08:35:15 +01:00
leekelleherandJacob Overgaard 2cfc4afdaa Content dashboard, CSS tweaks
To tighten up the info boxes, adds drop-shadow.
2025-02-14 08:34:55 +01:00
leekelleherandJacob Overgaard d023ae3f18 Help Header App, code tidy-up 2025-02-14 08:33:44 +01:00
Lee KelleherandGitHub fde00546e8 Removing the propertyEditorSchemaAlias for "Accepted Upload Types" (#18330)
So that it doesn't show up as an available Property Editor in the list.
2025-02-13 19:24:28 +00:00
ee05e5d779 Removes collection action state (#18212)
* remove collection action state

* clean up

* Update collection-action-button.element.ts

* use ellipsis character

* JSDocs

* TODO note

* add more options

* TODO

* additionalOptions for Collection Actions

---------

Co-authored-by: Niels Lyngsø <niels.lyngso@gmail.com>
2025-02-13 20:19:06 +01:00
Nhu DinhandGitHub 8ea58c13eb Make all smoke tests run in the pipeline (#18316) 2025-02-13 18:55:40 +01:00
d1dc45302b Resolves issues related to the setting of a schedule for content publishing (#17868)
* Render scheduled publish and unpublish on content info workspace view.

* Populate previously saved schedule on set schedule dialog.

* Hide workspace button actions that require a saved document when the document is new.

* Convert between local and server time when saving and displaying schedule.

* Fix issues with clearing of previously set schedule.

* Updated OpenApi.json to align with APi amends.

* Added missing constant.

* Fixes following merge.

* Fixed schedule mapping for invariant content.

* Fixed display of publishing/pending changes on info workspace view.

* Removed debug code.

* fix: adds missing localization keys

fixes #18297

* chore: eslint

* fix: render only the selectAll checkbox when more than one language is present

* feat: adds last edited date

* feat: adds 'last published' date

* fix: format input datetimes to datetime-local

* fix: converts the datetime string to an ISO format before sending to the server

this way we ensure the datetime contains the offset

* chore: adds more types to ensure type safety

* chore: use initialized boolean

* fix: makes schedule modal options-based to isolate the `selection` to the actual values

* docs: fix comment

* docs: adds comment

* fix: use helper function to update selection

* revert commit to prevent breaking change

* chore: eslint

* Whitespace tidy-up

* fix: stores a copy of the prevalues to be able to update that internally before finally setting the value from the updated internal values upon submit

* chore: removes unused function

* fix: unifies any pickable filters into one function

---------

Co-authored-by: Niels Lyngsø <nsl@umbraco.dk>
Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>
Co-authored-by: leekelleher <leekelleher@gmail.com>
2025-02-13 15:43:58 +00:00
Mads RasmussenandGitHub 3b7a76843a Update picker-search-result-item-element-base.ts (#18308) 2025-02-13 13:41:45 +00:00
Mads RasmussenandGitHub c5303426b0 Feature: Entity Item Ref Extension (#18265)
* wip entity-item-ref extension point

* clean up

* add ref list element

* fix styling

* Update document-item-ref.element.ts

* move item repo

* implement for input member

* enable action slot

* add null check

* fix sorting again

* fix sorting again

* use member element

* add draft styling back

* move item repository

* implement for user input

* pass readonly and standalone props

* make editPath a state

* Update member-item-ref.element.ts

* Fix user item ref

* remove open button

* remove unused

* remove unused

* check for section permission

* add fallback element

* add unique to modal route registration

* add unique to modal router

* remove unused id

* Update member-item-ref.element.ts

* append unique

* compare with old value

* only recreate the controller if the entity type changes

* fix console warning

* use addUniquePaths for modal registration
2025-02-13 11:15:25 +01:00
Andreas ZerbstandGitHub b360762f1f V15 QA disabled SQLite test workers for acceptance tests (#18306)
* Added a parameter that by default skips the sqlite acceptance tests

* Added timeout for flaky test

* Removed continue on error

* Created tests that fails to ensure that the update is working as expected

* Fixed tests
2025-02-13 10:35:05 +01:00
Nhu DinhandGitHub edeac44566 V15 QA Added acceptance tests for Create options (#18314)
* Added tests for document type create option

* Renamed and added tests for document type create options

* Added tests for data type create options

* Added tests for media type create options

* Fixed tests to create media type folder

* Bumped version

* Make all Create option tests run in the pipeline
2025-02-13 16:05:13 +07:00
Niels LyngsøandGitHub a7bd578f56 Prevent saving or publishing not created variants (#18312)
* prevent actions from handling not created variants

* extend pickable filter locally on the modal
2025-02-13 08:54:40 +01:00
Niels LyngsøandGitHub 5f9b192cbf fix peek error circular reference (#18307)
* move error viewer modal

* late import for peek error
2025-02-12 14:34:25 +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
Niels LyngsøandGitHub ead29a2567 Merge pull request #18221 from umbraco/v15/feature/block-type-element-not-found
Feature: block type element not found
2025-02-12 12:17:49 +01:00
Andy ButlandandGitHub 59c2205e60 Split force for publish descendants into separate options for publish unpublish and re-publish unedited (15) (#18270)
* Port server-side updates from 13 implementation.

* Update openapi.json

* Update typed client.

* Ported over front-end amend from 13.

* Handled edge case of publishing invariant root with variant descendants.

* Refactor to enum.

* Resolved CodeScene warning.

* Resolved CodeScene warning.

* Resolved CodeScene warning.

* Applied suggestions from code review.

* Reverted breaking change in integration tests.

* Refactored method name.
2025-02-12 12:04:58 +01:00
Niels LyngsøandGitHub ac522aba35 Merge pull request #18172 from umbraco/v15/feature/reworking-error-notifications
Feature: reworking error toast notifications
2025-02-12 11:39:34 +01:00
Mads RasmussenandGitHub db49fb3042 Merge branch 'v15/dev' into v15/feature/reworking-error-notifications 2025-02-12 11:07:34 +01:00
Mads RasmussenandGitHub 64efd73dd8 Update peek-error.controller.ts
remove console log
2025-02-12 11:02:37 +01:00
Niels LyngsøandGitHub 9c621607d4 Fix: #17676 (#18298)
* fix 17676

* localize
2025-02-12 10:53:21 +01:00
Niels LyngsøandGitHub 3d8400302a Feature: workspace action additional options ellipsis (#18299)
* adding types and default kind element

* switch to use ?? for code consistency

* add data-mark

* move listener last

* fix tsc

* save action additionalOptions

* hasAdditionalOptions for Save and Publish

* remove unused import

* type arg

* rename to _retrieveWorkspaceContext
2025-02-12 10:16:12 +01:00
Niels LyngsøandGitHub f906d28de6 Fix: #18272 (#18300)
* only localize if string

* better types of localize string

* test for string update
2025-02-12 09:51:00 +01: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
Niels LyngsøandGitHub fdfbd5fc33 Merge branch 'v15/dev' into v15/feature/block-type-element-not-found 2025-02-11 22:09:35 +01:00
Niels LyngsøandGitHub ac53a6d50f Merge branch 'v15/dev' into v15/feature/reworking-error-notifications 2025-02-11 22:09:04 +01:00
Niels LyngsøandGitHub ea3e761808 Merge branch 'v15/dev' into v15/feature/block-grid-block-type-validation 2025-02-11 22:08:45 +01:00
Andy ButlandandGitHub 048f8bcdf9 Fixed userResource request to get all users. (#18105) 2025-02-11 17:06:18 +01:00
5ee351a6bc Added $type to ReferenceResponseModels (#18293)
* Added $type to ReferenceResponseModels

* Updated OpenApi.json and client-side types.

---------

Co-authored-by: Andy Butland <abutland73@gmail.com>
2025-02-11 14:00:07 +00:00
6e20e14542 V15/feature/history cleanup localization (#18295)
* Add localize to headline

* Translate from en to dk

---------

Co-authored-by: Annica <abf@umbraco.dk>
2025-02-11 13:23:59 +00:00
Andreas ZerbstandGitHub 7949a5ba53 V15 QA added clipboard acceptance tests (#18245)
* Added small start for clipboard

* Added more tests

* Added tests

* Added more tests

* More tests

* Bumped version

* Updated tests

* Added tests to run

* Bumped version

* Fixes based on comments

* Reverted npm commands
2025-02-11 13:49:09 +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
5457521f19 Fixing the background color of the "re-login" screen when your session has timed out. (#18284)
* Updated modal background color

The background color of the authentication modal has been updated to use a CSS variable for better customization. The default value remains the same.

* Update umb-app-auth-modal.element.ts to use less specific css custom property

---------

Co-authored-by: Niels Lyngsø <niels.lyngso@gmail.com>
2025-02-11 09:59:06 +00:00
Jacob OvergaardandGitHub 15cba0afd7 feat: bump minimum required node.js version from 20 to 22 and remove upper limit (#18274) 2025-02-11 08:33:32 +00:00
dependabot[bot]andJacob Overgaard 447b36ab67 Bump vite from 5.4.11 to 5.4.14 in /src/Umbraco.Web.UI.Client
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.4.11 to 5.4.14.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v5.4.14/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.4.14/packages/vite)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-11 09:24:40 +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
Nhu DinhandGitHub 1663bc4179 V15 QA Added acceptance tests for the content with block list and block grid (#18026)
* Added tests for content with block grid

* Fixed the test for block grid as api helper changes

* Added tests for content with block lists

* Updated tests for content with block grid

* Updated tests for content with block list

* Updated code due to the test helper changes

* Bumped version

* Make all Content tests run in the pipeline

* Reverted

* Make all Content tests run in the pipeline

* Reverted

* Added step to choose element type

* Added more waits

* Fixed failing tests due to UI changes

* Fixed typo

* Fixed typo

* Fixed the failing test

* Bumped version

* Added the tests for move blocks

* Reverted
2025-02-11 13:30:12 +07:00
Lee KelleherandGitHub 3724a45576 Picker search result item icons for Documents and Members (#18250)
* Refactored `UmbDefaultPickerSearchResultItemElement`

Abstracted to `UmbPickerSearchResultItemElementBase` for reuse

* Exported types

* Adds element for 'Umb.PickerSearchResultItem.Document'

to handle the icon (and, in future, the URL/route)

* Adds element for 'Umb.PickerSearchResultItem.Member'

to handle the icon.
2025-02-10 15:38:34 +01:00
Niels LyngsøandGitHub 4d931e55ca Fix: #18209 (#18276)
* first render ones a option is available

* simpler logic
2025-02-10 15:23:36 +01:00
Niels LyngsøandGitHub 37cc67c6d2 use fewer redirects (#18271) 2025-02-10 15:16:50 +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
Nhu DinhandGitHub 978a068d3c V15 QA Updated acceptance tests for Link Picker (#18231)
* Added tests to ensure that the empty link is not accepted in url picker

* Added tests to ensure that the empty link is not accepted in tiptap

* Updated link picker tests due to UX changes

* Cleaned up

* Make Content tests run in the pipeline

* Added tests for unpublished document

* Fixed comments

* Bumped version

* Cleaned up

* Updated test name

* Reverted

* Bumped version
2025-02-10 17:02:00 +07:00
Andy ButlandandGitHub 8f6d1bc7b8 Add validation to prevent update of a user or member to an invalid username. (#18263)
Avoid password manager updates of user name field on user details screen.
2025-02-10 10:52:41 +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
f14922baae Adds name and description to webhooks (#18217)
* Model, service, test and migration updates to add name and description to webhook.

* Update typed client models.

* Fixed migration.

* Front-end rendering and update of name and description.

* Updated OpenApi.json

* Reworked integration tests to avoid breaking change.

* add name and description to editor header

* remove name and description properties

* render name as first column in the table

* remove focus from url

* remove required from name

* add parentheses to align UX

* add webhook paths

* use edit path const in collection

* add paths for root

* remove unused

* remove unused state

---------

Co-authored-by: Mads Rasmussen <madsr@hey.com>
2025-02-10 09:23:22 +01:00
25a3788255 V15 QA Fixing the acceptance tests for Create Option due to UI changes (#18262)
* Fixed the tests for creating media type due to UI changes

* Updated tests related to create data type due to UI changes

* Bumped version

---------

Co-authored-by: Andreas Zerbst <73799582+andr317c@users.noreply.github.com>
2025-02-10 13:37:24 +07:00
KaritaandGitHub 03690fb330 RTE property editor settings translation for DK&US (#18264) 2025-02-07 15:26:19 +01:00
Niels LyngsøandGitHub ad02cab653 Merge branch 'v15/dev' into v15/feature/reworking-error-notifications 2025-02-07 12:46:29 +01:00
Mads RasmussenandGitHub 6df7ff4322 replace temp event hack with context and skipHost (#18242) 2025-02-07 12:45:49 +01:00
Niels LyngsøandGitHub 4ca68d6995 Add client-side validation for RTE (#18257) 2025-02-07 11:43:04 +00:00
Kenn JacobsenandGitHub 62f46667d2 Remove the hard upper limit for SQL write lock timeout (#18260) 2025-02-07 06:37:11 +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
KaritaandGitHub 066045f139 Granular permissions translation DK, EN, US (#18251)
* Translation for user permissions DK and EN

* Added UI Culture variants for EN-US user permissions section

* removed redundant line

* improved consistency for wording, and moved keys under user

* Translated granular permissions label and description EN, US, DK
2025-02-07 06:38:12 +01:00
Niels LyngsøandGitHub d27b037d07 Merge branch 'v15/dev' into v15/feature/block-grid-block-type-validation 2025-02-06 20:50:02 +01:00
Niels LyngsøandGitHub a639fe07e2 Merge branch 'v15/dev' into v15/feature/block-type-element-not-found 2025-02-06 20:49:50 +01:00
Niels Lyngsø 1aa177fba1 Merge branch 'v15/dev' into v15/feature/reworking-error-notifications
# Conflicts:
#	src/Umbraco.Web.UI.Client/src/packages/core/notification/notification.context.ts
2025-02-06 20:49:14 +01:00
Niels Lyngsø 460c0b3253 change order of Acceptance Test scripts 2025-02-06 20:48:07 +01:00
Lee KelleherandGitHub deeeaf4107 Creating a Template via a new DocType (#18247)
uses the doc-type name, so that the server
can case it appropriately for the template filename.
re: https://github.com/umbraco/Umbraco-CMS/issues/17458#issuecomment-2639213085
2025-02-06 15:51:00 +01:00
Andy ButlandandGitHub 82fcede59a Management API authorization for requests to rollback. (#18240) 2025-02-06 11:03:07 +01:00
Sven Geusens 57c3279849 Merge branch 'release/15.2' into v15/dev and bump version
# Conflicts:
#	src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-change-password/manifests.ts
#	src/Umbraco.Web.UI.Client/src/packages/user/user/entity-actions/manifests.ts
#	src/Umbraco.Web.UI.Client/src/packages/user/user/repository/config/constants.ts
#	src/Umbraco.Web.UI.Client/src/packages/user/user/repository/config/current-user-config.repository.ts
#	src/Umbraco.Web.UI.Client/src/packages/user/user/repository/config/current-user-config.store.token.ts
#	src/Umbraco.Web.UI.Client/src/packages/user/user/repository/config/manifests.ts
#	version.json
2025-02-06 10:39:40 +01:00
Niels LyngsøandGitHub cf8cead8a9 Update README.md (#18238) 2025-02-05 21:26:18 +01:00
Niels LyngsøandGitHub f2944b089a correct manifest (#18237) 2025-02-05 21:23:32 +01:00
fa9ae32a1a Update build and contributing docs (#18223)
* Updates to build and contributing guide.

* Update .github/BUILD.md

Co-authored-by: Sven Geusens <sge@umbraco.dk>

* Add npm ci.

* Apply suggestions from code review

Co-authored-by: Sebastiaan Janssen <sebastiaan@umbraco.com>

* Update .github/BUILD.md

Co-authored-by: Sebastiaan Janssen <sebastiaan@umbraco.com>

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
Co-authored-by: Sebastiaan Janssen <sebastiaan@umbraco.com>
2025-02-05 16:26:53 +01:00
Andy ButlandandGitHub 42e7b37d5d Renamed URL picker document link to content (more familiar to editors). (#18236) 2025-02-05 15:09:28 +00:00
Niels Lyngsø e2fd2afabd mark options as deprecated and avoid lint issue on the argument not used 2025-02-05 15:49:47 +01:00
Lee KelleherandGitHub 664d68e541 Decimal umb-property-editor-ui-number fixes (#18233)
* Numeric: renamed `#parseInt` function to `#parseNumber`

* Numeric: Changed to use `@change` event

* Number input: `max="Infinity"` was invalid markup

We don't need to always set the `min` and `max` attributes.
Leave the browser to do its thing.

* Decimal: adds input `step` config
2025-02-05 15:26:06 +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
KaritaandGitHub cce67b055c Entity permission translation for US, UK and DK (#18225)
* Translation for user permissions DK and EN

* Added UI Culture variants for EN-US user permissions section

* removed redundant line

* improved consistency for wording, and moved keys under user
2025-02-05 10:44:09 +00:00
67a66cb2cc Bugfix: Reload recycle bin on trashed entity (#18228)
* add entity trashed event

* dispatch event when entity is trashed

* remove double event listeners

* export action class

* Update default-tree.context.ts

* wip reload tree when entity is trashed

* move into data folder

* clean up listeners

* move manifest

* wip reload root

* clean up

* add recycle bin tree item

* use for media

* pass entity types through manifest + add recycle bin tree item kind

* remove custom implementation for document recycle bin

* use kind

* rename to supportedEntityTypes

* Update recycle-bin-tree-item.context.ts

* clean up

* Update recycle-bin-tree-item.context.ts

* Update recycle-bin-tree-item.context.ts

---------

Co-authored-by: Niels Lyngsø <nsl@umbraco.dk>
2025-02-05 08:35:06 +00:00
Niels Lyngsø ec48503b5a style update 2025-02-04 20:38:36 +01:00
Niels Lyngsø c0a215be98 isAllowed impl 2025-02-04 16:32:30 +01:00
Niels Lyngsø acb3f01f69 revert 2025-02-04 16:32:15 +01:00
Niels Lyngsø 00b92d8a57 tsc corrections 2025-02-04 15:15:13 +01:00
Niels Lyngsø c741ba2228 remove responsibility to retrieving block type 2025-02-04 15:13:17 +01:00
Niels Lyngsø 079c77006b Merge branch 'v15/dev' into v15/feature/block-grid-block-type-validation
# Conflicts:
#	src/Umbraco.Web.UI.Client/src/assets/lang/en.ts
2025-02-04 14:42:10 +01:00
Niels LyngsøandGitHub b4e59de79f Merge branch 'v15/dev' into v15/feature/block-type-element-not-found 2025-02-04 14:40:33 +01:00
Niels Lyngsø cbd17483a1 append error with reload 2025-02-04 14:38:04 +01:00
Niels Lyngsø ce2f50ce59 update status logic 2025-02-04 14:22:52 +01:00
Niels Lyngsø 49c4a60ecf block-type element type not found 2025-02-04 13:48:19 +01:00
Niels Lyngsø c8bdc99662 move prop 2025-02-04 13:46:45 +01:00
Niels Lyngsø c73cc469b6 invalid binding for grid 2025-02-04 13:45:39 +01:00
97046b9546 Update src/Umbraco.Web.UI.Client/src/packages/core/notification/controllers/peek-error/peek-error-notification.element.ts
Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>
2025-02-04 13:44:33 +01:00
cab07ba6f6 Update src/Umbraco.Web.UI.Client/src/packages/core/notification/modals/error-viewer/error-viewer-modal.token.ts
Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>
2025-02-04 13:44:25 +01:00
e034a64723 Update src/Umbraco.Web.UI.Client/src/packages/core/notification/extractUmbNotificationColor.function.ts
Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>
2025-02-04 13:44:18 +01:00
Lee KelleherandGitHub 14b8eee1db RTE TinyMCE: Compares previous value in #onChange event (#18219)
* TinyMCE input: Compares previous value in onChange

Fixes #18132

* Chore: import type ordering
2025-02-04 13:10:17 +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
Mads RasmussenandGitHub 9c5768e1ab Deprecate get unique param on UmbPickerInputContext and UmbRepositoryItemsManager (#18216)
* Add a deprecation warning for the getUnique param

* fix import

* add specific version number

* remove block usage

* remove input rich media usage

* explicit version

* deprecate getUnique method in picker context

* remove get unique method
2025-02-04 12:18:35 +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
Nhu DinhandGitHub 52aa18c7d1 V15 QA Added acceptance tests to verify the SVG thumbnail (#17966)
* Added tests to verify the media thumbnail

* Added tests to verify the media thumbnail

* Bumped version

* Make the SVG tests run in the pipeline

* Cleaned code

* Updated smokeTest command

* Reverted

* Updated the thumbnail file for audio

* Reverted
2025-02-04 13:37:44 +07:00
1c68e3d825 Added deliveries workspace view to the webhook details workspace (#18175)
* Added deliveries workspace view to the webhook details workspace.

* Front-end linting fixes.

* rename to unique

* update filter value

* make delivery feature folder

* move delivery workspace view for delivery feature folder

* correct details workspace view label and pathname to match name

* remove unused alias

* use singular form to align naming

* remove pagination as the default collection kind already includes this

* show icon

* remove double registration

* add observables for webhook data, add get methods + add jsdocs

* align UX with languages

* remove hardcoded fake name + make url the link

* remove redundant url in table

* render status code as tag

* use tags for enabled/disabled webhook state to align with users

* make the name more explicit

* move webhook root to a feature folder

* export consts

* fix webhook collection pagination

* move menu item manifests into root folder

* move webhook delivery filering responsibility from repo to workspace view

* reorganize

* move workspace

* fix import

* move entity actions

* export delivery consts

* dot not export const

* rename folder

* update name

* make event feature folder

* export consts

* move repository files

* more clean up

* split types

* add deprecation warning for a temp method

* bring back url to deliveries table

---------

Co-authored-by: Mads Rasmussen <madsr@hey.com>
2025-02-04 06:36:38 +01: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
Niels LyngsøandGitHub deca4c8916 Merge pull request #18182 from umbraco/v15/bugfix/18000
Fix: Unsupported Block (18000)
2025-02-03 19:21:38 +01:00
6aaa9d8081 Corrected rendering of member type icons on create button and picker (#18203)
* Corrected rendering of member type icons on create button and picker.

* Removed debug code.

* Member Picker: sets icon

---------

Co-authored-by: leekelleher <leekelleher@gmail.com>
2025-02-03 17:10:08 +00:00
Niels LyngsøandGitHub ee51f2af5b Merge pull request #18194 from umbraco/v15/bugfix/17206
Fix: 17206
2025-02-03 18:05:19 +01:00
fc8ae20e70 Localize reference block labels and properties in the block editing experience (#18201)
* Localize reference block labels and properties in the block editing experience.

* Revert description update.

* Block entry: localize content-type name

* Block entry: localize delete confirm modal

---------

Co-authored-by: leekelleher <leekelleher@gmail.com>
2025-02-03 16:44:15 +00:00
1f4b3e2599 V15: Add progress UI to the Upload Field property editor (#18188)
* feat: uses a blob url over a FileReader to get the temporary file's blob and mimetype

* feat: adds styling to temporary file badge

* use correct styling

* feat: adds uploader ui to track progress of uploaded files

* chore: check for potentially undefined promises

* feat: adds an `AbortSignal` to the xhr requests to allow for the request to be aborted

* feat: adds an `AbortSignal` through the stack to upload a file

* feat: cancel the ongoing request if the user removes the file during an upload

* Code/markup tidy-up

Added "Cancel" button, from @bjarnef's suggestion.

---------

Co-authored-by: leekelleher <leekelleher@gmail.com>
2025-02-03 15:44:00 +00:00
Mads RasmussenandGitHub 1e5bfd8c3a Feature: Media Type Create Options (#18196)
* use extension point for media type create options

* register collection action
2025-02-03 15:42:02 +00:00
Niels Lyngsø 81be464dae added comment 2025-02-03 16:22:50 +01:00
Niels Lyngsø ebad05aa4c validation for Block Type Configurations 2025-02-03 16:22:14 +01:00
Niels LyngsøandGitHub 02b3ec40ab Merge branch 'v15/dev' into v15/bugfix/18000 2025-02-03 15:49:30 +01:00
Jacob Welander JensenandGitHub 058f901293 V15/feature/toggle property editor UI (#18171)
* update the setting for the toggle satet

* update the setting for the toggle satet

* adds a fallback label if no ariaLabel is set in the manifest, using toggleFor
2025-02-03 15:48:34 +01:00
f1cdf50cdd V15: Show server configuration when configuring the Upload Field (#18185)
* feat: shows notification when no suitable media type is found

* chore: rearrange imports

* feat: use a forward ref to find the dropzone

* chore: rearrange imports

* chore(mock): send back correct header

* feat: avoid using the context consumer to get a token, but instead mimick the OpenAPI generator

* chore(mock): allow more file types

* chore(mock): create more upload fields

* chore(mock): also look for mediaPicker fields

* chore(mock): improve media mock db

* chore(mock): add missing endpoints

* chore(mock): update media data

* chore(mock): fix aliases for media grid and table

* chore(mock): add urls to media

* chore(mock): adds missing endpoint for imaging

* fix: reverse order of properties to overwrite existing status

* feat: listen to progress updates on upload and update the `progress` property

* feat: adds tracking of upload progress to placeholders

* feat: bind the progress number up on the temporary file badge to indicate upload status

* feat: optimises progress calculation and makes the badge bigger to be able to show the progress in percent

* feat: allow text to be normal

* chore: use correct localization

* feat: shows error status for anything that isn't waiting or complete

* feat: makes `progress` optional

* feat: adds repository+store for temporary file configuration

* chore(mock): adds mock endpoint for temporary file configuration

* feat: set progress for createTemporaryFiles

* feat: allows a `whitespace` option to notifications

* feat: validates uploads before trying to query the server

* feat: adds `formatBytes` function to format numbers

* chore: export all consts

* feat: exports bytes function

* feat: set decimals to default to 2, which works nicely with the Intl numberformat

* feat: use `formatBytes` to format the error message

* chore(mock): set max file size for mock to 1.4 GB

* feat: adds localization

* Update src/Umbraco.Web.UI.Client/src/packages/core/utils/bytes/bytes.function.ts

Co-authored-by: Lee Kelleher <leekelleher@users.noreply.github.com>

* chore: add end character to comment

* feat: binds multiple text string to validation

* chore: fixes event type

* feat: adds new property editor ui for accepted file types

* feat: changes the upload field to use the property editor ui for accepted file types

* adds localization

* Markup/style refactoring/streamlining

* Renamed "Accepted Types" to "Accepted Upload Types"

---------

Co-authored-by: Lee Kelleher <leekelleher@users.noreply.github.com>
Co-authored-by: leekelleher <leekelleher@gmail.com>
2025-02-03 13:57:55 +00:00
Andy ButlandandGitHub e7411244fd Show notifications menu only to users with permission for the feature. (#18184) 2025-02-03 13:24:58 +01:00
Lee KelleherandGitHub ee231c7bae Corrects filename label on the Upload File component (#18205)
* Corrects input upload filename label

Fixes #18195

* Refactored input upload file code
2025-02-03 12:12:19 +00:00
Kenn JacobsenandGitHub 9f357173c3 Enforce user start nodes for media uploads through the RTE (#18204) 2025-02-03 12:50:23 +01:00
Niels Lyngsø 13bcf16644 revert 2025-01-31 21:31:36 +01:00
Niels Lyngsø 89219d8327 Revert "no need to run validators when we already do so on update"
This reverts commit 23659061a2.
2025-01-31 21:30:43 +01:00
Niels Lyngsø 0ae33f8cbc Revert "Reapply "correct initial value set and remove private version""
This reverts commit 317cc5c6f1.
2025-01-31 21:30:13 +01:00
Niels Lyngsø 317cc5c6f1 Reapply "correct initial value set and remove private version"
This reverts commit ce7c6e010d.
2025-01-31 21:29:16 +01:00
Niels Lyngsø ce7c6e010d Revert "correct initial value set and remove private version"
This reverts commit 09072b6946.
2025-01-31 21:28:28 +01:00
Niels LyngsøandGitHub 40f671dca6 Merge branch 'v15/dev' into v15/bugfix/18000 2025-01-31 21:26:37 +01:00
Jacob OvergaardandGitHub 2cdcacb9a8 V15/feature/notification-whitespace (#18190)
* feat: adds `white-space: pre-line` to all notification messages

* chore: remove invalid values
2025-01-31 21:26:19 +01:00
Niels Lyngsø 2fe2b46670 communicate with console error if it fails 2025-01-31 21:17:45 +01:00
Niels Lyngsø 09072b6946 correct initial value set and remove private version 2025-01-31 21:13:09 +01:00
Niels Lyngsø 23659061a2 no need to run validators when we already do so on update 2025-01-31 21:11:14 +01:00
Niels Lyngsø ae540f66d3 correcting logic 2025-01-31 21:06:07 +01:00
Niels Lyngsø 0b7ed5d6f9 make sure to trigger validation system by using super.value 2025-01-31 20:37:16 +01:00
Andy Butland 3157601724 Merge branch 'v15/dev' into contrib 2025-01-31 16:17:43 +01:00
Andy Butland 7dc6e3ed5b Merge branch 'v13/dev' into v13/contrib 2025-01-31 16:16:22 +01:00
09b3bd14c0 v14: Async healthchecks (#17090)
* Make block editor base classes public

* Update BlockEditorValues.cs

Change to trigger a new build for #16774

* Make healthchecks fully async

* Updated obsolete comments to reference next but one major.

---------

Co-authored-by: Kenn Jacobsen <kja@umbraco.dk>
Co-authored-by: Andy Butland <abutland73@gmail.com>
2025-01-31 16:13:49 +01:00
def9bd096f Less parsing, allocation & LINQ when splitting strings (#18048)
* Less parsing, allocation & LINQ when splitting strings

* Added unit test verifying refactoring of GetIdsFromPathReversed.

---------

Co-authored-by: Andy Butland <abutland73@gmail.com>
2025-01-31 14:22:57 +00: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
3829b0963f V15/sort by selected icons (#18158)
* adds back the custom icon for the content nodes and give a hover effect to indicate that it is grabable, and applys the choosen color

* Update sort-children-of-modal.element.ts

* switches to use the umb-icon and updates styling

* removes the backoffice host

* Update appsettings.Development.template.json

* Update sort-children-of-modal.element.ts

* Update sort-children-of-modal.element.ts

---------

Co-authored-by: Mads Rasmussen <madsr@hey.com>
2025-01-31 13:09:55 +00:00
Lee KelleherandGitHub 9323d8b0e7 Introduces getStyles() for Tiptap extensions (#18075) 2025-01-31 13:24:12 +01:00
85a81b3d6f Ensure min/max property editor settings are valid before rendering for content editing (#17881)
* Ensure min/max property editor settings are valid before rendering for content editing.

* Display message when URL picker data type configuration is not valid.

* Reverted 'umb-input-multi-url' changes

* Added console warnings for misconfigured min/max values

Also adds `label` property for UUI elements

---------

Co-authored-by: Niels Lyngsø <nsl@umbraco.dk>
Co-authored-by: leekelleher <leekelleher@gmail.com>
2025-01-31 13:23:14 +01:00
Lee KelleherandGitHub bb755188b5 User Group picker modal: adds filter input (#18159)
Fixes #16452.
2025-01-31 13:20:55 +01:00
Niels LyngsøandGitHub 7c5c3fd2d8 Merge pull request #18154 from umbraco/v15/feature/enable-document-rollback-as-entity-action
Rollback as entity action + Picker data updates
2025-01-31 12:59:58 +01:00
Niels LyngsøandGitHub 0480a3287f Merge pull request #18189 from umbraco/v15/bugfix/range-input-simpler-infinite-max-indication
ensure default in Infinity
2025-01-31 12:54:15 +01:00
Niels LyngsøandGitHub 341534c5de Merge pull request #18162 from umbraco/v15/feature/hide-icons
Feature: hide icons
2025-01-31 12:40:16 +01:00
Niels LyngsøandGitHub 9896119b8e Merge branch 'v15/dev' into v15/feature/enable-document-rollback-as-entity-action 2025-01-31 12:28:43 +01:00
Niels Lyngsø da3bc9a6a8 no more need for a max 2025-01-31 12:15:31 +01:00
Mads Rasmussen a2378e6b5f use unique instead of discriminator 2025-01-31 12:15:10 +01:00
Niels Lyngsø f155369540 ensure default in Infinity 2025-01-31 12:13:15 +01:00
Kenn JacobsenandGitHub 50ff23b661 Don't assume HtmlString when inserting default values in templates (#18144) 2025-01-31 11:19:33 +01:00
Niels LyngsøandGitHub 30c4408f18 Merge pull request #18014 from umbraco/v15/feature/workspace-info-app-extension
Feature: workspace info app extension
2025-01-31 11:11:48 +01:00
HenrikandGitHub c64ec51305 Nonbreaking performance tweaks (#17106)
* Avoid doing multiple lookups in dictionaries, avoid doing string interpolation & adding single char strings to a StringBuilder, made some private/internal classes & some private methods static when possible, use FrozenSet for InvalidFileNameChars

* Avoid some array + list allocations & async methods and made some private methods static

* Avoid double lookup of XML attribute (and double null check) & avoid an unneeded lookup before writing to a dictionary

* Avoid some double lookups

# Conflicts:
#	src/Umbraco.Core/Services/LocalizedTextService.cs

* Avoid double lookups

# Conflicts:
#	src/Umbraco.Core/Services/LocalizedTextService.cs

* Avoid double lookups

* List AsSpan, also to trigger a new build that hopefully goes through

* Avoid concatting strings when using writer & more static

* Updated CollectionBenchmarks to show that ToArray isn't always the fastest & Lists can be iterated nearly as fast as arrays (and that ToList is nearly as fast as ToArray on IReadOnlyLists in .NET 8)

* Fix rebase

* Use explicit types ❤️ (I thought it was the other way round...)

# Conflicts:
#	src/Umbraco.Core/Services/LocalizedTextService.cs

* Reduce number of lines in HtmlStringUtilities.Truncate to pass code quality analysis

* Avoid double lookups & allocating empty arrays

* Use native List Find instead of LINQ
2025-01-31 10:31:06 +01:00
Niels Lyngsø 412fe69a36 lint fixes 2025-01-31 10:13:38 +01:00
Niels LyngsøandGitHub 8219d1d8c1 Merge branch 'v15/dev' into v15/bugfix/18000 2025-01-31 10:03:02 +01:00
Mads Rasmussen dab3977ebf Update index.ts 2025-01-31 09:27:38 +01:00
Mads Rasmussen 6c618ff9ec Merge branch 'v15/dev' into v15/feature/workspace-info-app-extension 2025-01-31 09:26:46 +01:00
Andreas ZerbstandGitHub c448190e0b V15 QA added fixes for flaky/failing acceptance tests (#18149)
* Fixed tests

* More fixes

* More fixes

* Skipped waits

* Added necessary updates to tests

* Bumped versions

* Removed skipped waits

* Removed more waits

* Cleaned up PR

* Updated tests

* Bumped version

* Added more timeout
2025-01-31 08:58:15 +01:00
Niels Lyngsø 11e2614fe5 unsupported block list 2025-01-30 22:33:14 +01:00
Niels Lyngsø 1f494939ca Block Grid unsupported block 2025-01-30 21:55:30 +01:00
Andy ButlandandGitHub 739a24b8c5 Fixed name of True/False property editor schema manifest. (#18179) 2025-01-30 20:02:51 +00:00
Mads Rasmussen 357128151c remove unused 2025-01-30 17:03:30 +01:00
Mads Rasmussen 54e4a26d77 update consts 2025-01-30 17:02:13 +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
MoleandGitHub 6668f3a867 V15: Add authorization to create (#18169)
* Add failing tests

* Re-add auth
2025-01-30 16:00:33 +01:00
Mads Rasmussen 4aae502572 add layout element 2025-01-30 14:57:40 +01:00
Niels LyngsøandGitHub c1f74f4aab Merge pull request #18094 from umbraco/v15/bugfix/offline-notifcation
Bugfix: show notification when offline
2025-01-30 14:51:53 +01:00
Niels Lyngsø d1fa73c462 Merge branch 'v15/dev' into v15/feature/reworking-error-notifications
# Conflicts:
#	src/Umbraco.Web.UI.Client/src/packages/core/notification/notification.context.ts
2025-01-30 14:22:01 +01:00
Mads Rasmussen b840fec228 wrap in layout element 2025-01-30 14:19:19 +01:00
Mads Rasmussen 5e7065b7db add layout element 2025-01-30 14:18:35 +01:00
Niels Lyngsø 69e36a3b94 fix json display 2025-01-30 14:15:44 +01:00
Niels Lyngsø 32a2bab4f0 todo 2025-01-30 14:15:32 +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
Niels Lyngsø 2ca4e0e1bd remove max-height setting from code-block 2025-01-30 14:01:51 +01:00
Niels Lyngsø 7d703cc9bd peek error modal 2025-01-30 14:01:31 +01:00
Niels Lyngsø 6f9e66de8a localizations 2025-01-30 14:00:27 +01:00
Jacob OvergaardandGitHub 22d974e748 V15: Client should validate maxFileSize and allowed/disallowed file types from server configuration (#18163)
* feat: shows notification when no suitable media type is found

* chore: rearrange imports

* feat: use a forward ref to find the dropzone

* chore: rearrange imports

* chore(mock): send back correct header

* feat: avoid using the context consumer to get a token, but instead mimick the OpenAPI generator

* chore(mock): allow more file types

* chore(mock): create more upload fields

* chore(mock): also look for mediaPicker fields

* chore(mock): improve media mock db

* chore(mock): add missing endpoints

* chore(mock): update media data

* chore(mock): fix aliases for media grid and table

* chore(mock): add urls to media

* chore(mock): adds missing endpoint for imaging

* fix: reverse order of properties to overwrite existing status

* feat: listen to progress updates on upload and update the `progress` property

* feat: adds tracking of upload progress to placeholders

* feat: bind the progress number up on the temporary file badge to indicate upload status

* feat: optimises progress calculation and makes the badge bigger to be able to show the progress in percent

* feat: allow text to be normal

* chore: use correct localization

* feat: shows error status for anything that isn't waiting or complete

* feat: makes `progress` optional

* feat: adds repository+store for temporary file configuration

* chore(mock): adds mock endpoint for temporary file configuration

* feat: set progress for createTemporaryFiles

* feat: allows a `whitespace` option to notifications

* feat: validates uploads before trying to query the server

* feat: adds `formatBytes` function to format numbers

* chore: export all consts

* feat: exports bytes function

* feat: set decimals to default to 2, which works nicely with the Intl numberformat

* feat: use `formatBytes` to format the error message

* chore(mock): set max file size for mock to 1.4 GB

* feat: adds localization
2025-01-30 12:54:17 +00:00
Sven Geusens bb73ec6c68 Set release version 2025-01-30 09:52:50 +01:00
Niels Lyngsø 0006a9bd87 peek error notification element + controller/method 2025-01-29 22:59:40 +01:00
Andy ButlandandGitHub ee2d7bbb1b Excluded tags from trashed content (#18164) 2025-01-29 21:10:11 +01:00
Mads Rasmussen b4f80fda42 Merge branch 'v15/dev' into v15/feature/workspace-info-app-extension 2025-01-29 19:47:30 +01:00
Niels LyngsøandGitHub e124ce91cb Merge branch 'v15/dev' into v15/feature/hide-icons 2025-01-29 14:02:05 +01:00
MoleandGitHub 1752be989d V15: Fix Url Preview (#18072)
* Make URL overview align with the old routing

This means including custom url providers, other URLS, etc.

* Move implementation to its own provider

* Handle could not get url

* Migrate intergration tests to new implementation
2025-01-29 13:59:58 +01:00
Niels Lyngsø e05eb849c0 update script + remove empty lines 2025-01-29 13:59:54 +01:00
Niels Lyngsø 7cd1c75845 deprecation note 2025-01-29 13:56:29 +01:00
Niels Lyngsø 638eef03a1 update icons 2025-01-29 13:55:07 +01:00
Niels Lyngsø fccd203bdc refactor to use hidden as the property for legacy and internal icons 2025-01-29 13:55:01 +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
Jason ElkinandGitHub 55b5d7eecd Fix task return and apply correct disposal pattern for FileSystemMainDomLock (#18147) 2025-01-29 12:13:50 +00:00
Jacob OvergaardandGitHub ab98ea58b5 V15: Show upload progress for dropped files in the Media Library (#18148)
* feat: shows notification when no suitable media type is found

* chore: rearrange imports

* feat: use a forward ref to find the dropzone

* chore: rearrange imports

* chore(mock): send back correct header

* feat: avoid using the context consumer to get a token, but instead mimick the OpenAPI generator

* chore(mock): allow more file types

* chore(mock): create more upload fields

* chore(mock): also look for mediaPicker fields

* chore(mock): improve media mock db

* chore(mock): add missing endpoints

* chore(mock): update media data

* chore(mock): fix aliases for media grid and table

* chore(mock): add urls to media

* chore(mock): adds missing endpoint for imaging

* fix: reverse order of properties to overwrite existing status

* feat: listen to progress updates on upload and update the `progress` property

* feat: adds tracking of upload progress to placeholders

* feat: bind the progress number up on the temporary file badge to indicate upload status

* feat: optimises progress calculation and makes the badge bigger to be able to show the progress in percent

* feat: allow text to be normal

* chore: use correct localization

* feat: shows error status for anything that isn't waiting or complete

* feat: makes `progress` optional
2025-01-29 11:02:29 +00:00
Mads Rasmussen 0a8ac3b2a4 Merge branch 'v15/feature/enable-document-rollback-as-entity-action' of https://github.com/umbraco/Umbraco-CMS into v15/feature/enable-document-rollback-as-entity-action 2025-01-29 11:16:56 +01:00
Mads Rasmussen 99cb36b29d remove unused 2025-01-29 11:16:54 +01:00
Mads RasmussenandGitHub 7f8a4ab8c5 Merge branch 'v15/dev' into v15/feature/enable-document-rollback-as-entity-action 2025-01-29 11:08:04 +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
Andy ButlandandGitHub bca74e0277 Pass user Id to audit when saving and deleting members. (#18120) 2025-01-29 10:14:34 +01:00
Mads RasmussenandGitHub 1e50714d1b Set document to readonly when a user is not allowed to create / update (#18076)
* split manifest file

* use const

* use const

* use const

* require permission to create or update to render save action

* require permission to update to render "save and preview"

* require permission to update + publish to render "save and publish"

* keep button as it is extendable

* keep buttons as they are extendable

* set readonly state based on user permission

* render readonly tag for invariant documents

* remove double array

* return permitted state in callback

* disable save button if all variants are read only

* rename private method

* split check on create vs update

* clear state when resetting the state

* add null check

* remove unused

* Update document-user-permission.condition.ts

* change translation to browse

* remove create permission
2025-01-29 09:06:58 +00:00
Mads Rasmussen 6b94a20043 dispatch event from detail-workspace-base 2025-01-29 10:05:36 +01:00
Mads Rasmussen 0b5e760fd5 correct name 2025-01-29 10:04:57 +01:00
469fd14aff Bugfix: Content Picker Search - support allowed content types config (#18042)
* add option to interface

* pass config to picker

* add option to interface

* force type

* add request args to type

* pass allowed content types as request args

* add comments

* allow for passing type

* more type safety

* use correct types

* use correct types

* add js docs

* remove debugger + map to only pass id to server

* add js docs

* align naming

* add null check

* align types

* implement allowedContentTypes for member search

* fix imports

* add types for media search

* add and use const

* align picker interfaces

* align models

* add entity type

* filter for null value

* explicit naming

* rename field

* use query params

* Implement content type scoped search in item search controllers

* Fix bad naming

* generate server models

* wire up backend

* generate server models

* add selectable filter to member picker

* Update member-picker-modal.element.ts

* Fix indexed search for specific member and media types

* export consts

---------

Co-authored-by: kjac <kja@umbraco.dk>
2025-01-29 08:23:32 +00:00
Mads Rasmussen 017777f8a4 Merge branch 'v15/dev' into v15/feature/enable-document-rollback-as-entity-action 2025-01-29 08:00:12 +01:00
Andy ButlandandGitHub ad45494aa5 Fixes rollback of variant page name. (#18136) 2025-01-29 07:50:48 +01:00
Andy Butland c8856bcf22 Obsolete unused configuration property. 2025-01-29 06:30:07 +01:00
Mads Rasmussen 675e9ab17f Merge branch 'v15/dev' into v15/bugfix/offline-notifcation 2025-01-28 18:32:30 +01:00
Mads Rasmussen 633cce5fd8 show online notification 2025-01-28 18:31:41 +01:00
Mads Rasmussen 08a621b117 Merge branch 'v15/dev' into v15/feature/enable-document-rollback-as-entity-action 2025-01-28 18:10:08 +01:00
Mads Rasmussen aa5c58f753 use reload 2025-01-28 17:15:27 +01:00
Mads Rasmussen e6cc9cfc6c reload items 2025-01-28 14:59:59 +01:00
Mads Rasmussen 4ff07d3556 remove unused 2025-01-28 14:48:05 +01:00
Mads Rasmussen ee1dff2e50 Update rollback-modal.element.ts 2025-01-28 14:34:41 +01:00
Mads Rasmussen ff71caf5a3 Update index.ts 2025-01-28 14:29:30 +01:00
Mads Rasmussen 15342ea2bc remove detail from event 2025-01-28 14:28:39 +01:00
Mads Rasmussen fc55f5eb7f listen to events on entity updates 2025-01-28 14:25:26 +01:00
Mads Rasmussen 7ac2fff839 dispatch event when content is saved 2025-01-28 14:24:57 +01:00
Mads Rasmussen 0a78648175 add event discriminator option 2025-01-28 14:04:35 +01:00
Mads Rasmussen 80b8d6f89f remove from document workspace 2025-01-28 13:40:32 +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
Niels LyngsøandGitHub f2b337a0be Merge pull request #18109 from umbraco/v15/bugfix/media-picker-mandatory-validation
Fix: media picker mandatory validation
2025-01-28 10:26:10 +01:00
Niels LyngsøandGitHub c4ab3bd8e9 Merge pull request #18108 from umbraco/v15/bugfix/17372
Fix: Mandatory for Image Cropper (17372)
2025-01-28 10:13:41 +01:00
Andy ButlandandGitHub f1e69dd16e Added a check that we have a route before attempting to include it in the other URLs for a published document. (#18135) 2025-01-28 10:10:08 +01:00
Jacob OvergaardandGitHub ea63d08989 V15: Media library crashes when uploading large files (#18113)
* chore(mock): adds endpoint handler for allowed media types

* feat: adds new event `UmbDropzoneSubmittedEvent`

* fix: do not await unnecessarily

* fix: simplify error checking

* fix: only proceed if array contains elements

* feat: adds support to render an error state

* fix: react to error state on temporary file badges

* fix: cancel events and simplify error check and react to any status changes

* feat: adds new tryXhrRequest function

* fix: use tryXhrRequest to upload all temporary files

* fix: use error types from hey-api as a temporary solution

* fix: changes limit from int32 to long (64-bit) to allow larger files to be uploaded

* fix: set default baseURL

* fix: use same unique

* fix: do not overwrite status

* fix: adds progress callback for tinymce

* generate openapi.json

* Revert "generate openapi.json"

This reverts commit 3c723e0155.

* Revert "fix: changes limit from int32 to long (64-bit) to allow larger files to be uploaded"

This reverts commit c883a45508.

* chore: generate OpenApi.json
2025-01-28 08:50:43 +00:00
Niels Lyngsø f7f0891d3b remove nothing import 2025-01-28 09:26:07 +01:00
Niels LyngsøandGitHub eeafb3cbc6 Merge pull request #18092 from umbraco/v15/feature/reject-validation-promise
Feature: Clean up validation messages
2025-01-28 09:23:03 +01:00
Niels LyngsøandGitHub c72fa4866b Merge branch 'v15/dev' into v15/bugfix/media-picker-mandatory-validation 2025-01-28 09:14:29 +01:00
Niels Lyngsø 424eef4c93 fix min validation check + emptying cards 2025-01-28 08:50:35 +01:00
Andy ButlandandJacob Overgaard 151e0a89fb Refreshed display of check results after all checks are complete. 2025-01-28 08:45:42 +01:00
Niels Lyngsø 2755372f46 Merge branch 'v15/dev' into v15/bugfix/17372 2025-01-28 08:15:48 +01:00
Niels Lyngsø 677a8594df only check valueMissing if required 2025-01-28 08:15:07 +01:00
Mads Rasmussen bf5caf6aea disable submit button until a version is selected 2025-01-27 21:53:47 +01:00
Mads Rasmussen 11800845e2 render empty states 2025-01-27 21:46:52 +01:00
Mads Rasmussen 77f6ac87c6 submit modal 2025-01-27 15:50:55 +01:00
Mads Rasmussen 1048234d80 reload workspace on entity detail updated event 2025-01-27 15:45:19 +01:00
Mads Rasmussen a68ff52bae change weight 2025-01-27 14:13:51 +01:00
Mads Rasmussen eda13964c9 Update rollback-modal.element.ts
hide box if there are no cultures
2025-01-27 14:13:43 +01:00
Mads Rasmussen d343ab3bce styling adjustments 2025-01-27 14:06:17 +01:00
Mads Rasmussen 7e68573628 support invariant documents 2025-01-27 13:51:33 +01:00
Lee KelleherandGitHub d90002247d Feature: Tiptap: Generic markup support (#18124)
* Adds "HTML Global Attributes" Tiptap extension

This is to add `class`, `id` and `data-*` attributes
to any markup within Tiptap contents.

* Adds "Span" element Tiptap extension

to support generic markup modifications.

* Adds "Div" element Tiptap extension

to support generic markup modifications.

Also modifies "umbEmbeddedMedia" to check explicitly
for the `umb-embed-holder` class name. This is to differentiate
from the generic `div` tag.

* Adds "Rich Text Essentials" Tiptap extension

Previously this was a faux extension, but it is now real.

This extension adds the core extensions for Umbraco RTE support.
e.g. StarterKit, et al, and the new global attributes and generic elements.

* Reverts `elementName` constant
2025-01-27 12:29:44 +00:00
Mads Rasmussen 43005c72db extract logic from rendering 2025-01-27 13:02:50 +01:00
Mads Rasmussen 4988162b36 update naming 2025-01-27 12:53:12 +01:00
Mads Rasmussen 6d31a0ae6c get name from language 2025-01-27 12:39:39 +01:00
Mads Rasmussen 01eed53d42 Merge branch 'v15/dev' into v15/feature/enable-document-rollback-as-entity-action 2025-01-27 12:23:30 +01:00
Mads RasmussenandGitHub 1e89b5a1e0 Bugfix: Align collection item entity actions with menu item entity actions (#18118) 2025-01-27 12:03:09 +01:00
Lee KelleherandGitHub 8f212aec3b Feature: Code Editor modal, adds pretty-print support (#18123)
* Reverts `elementName` constant

* Adds `formatOnLoad` option

* Code editor modal markup tidyup

* Wires up `formatOnLoad` with Tiptap's view-source action
2025-01-27 11:57:32 +01:00
bc3881707e updated the link picker modal and the property editors using it. (#18059)
* updated the link picker modal and the property editors using it.

* updated the last language

* some minor updates to the code so that it uses the correct actions

* Minor change in the language key that is being used.

* use camel case

* use "add" and "update" without "link"

---------

Co-authored-by: Mads Rasmussen <madsr@hey.com>
2025-01-27 09:49:02 +00:00
2648d17cb6 Updated the dialog label for User -> Assign Access -> Media Start nodes (#18043)
* Updated the dialog label User - Assign Access - Media Start nodes

* Minor change to the modal headline

* update based on review.

* updated the languages based on review

* updated based on review

* Small update based on review on PR

* use generic choose media for the media dialog

---------

Co-authored-by: Mads Rasmussen <madsr@hey.com>
2025-01-27 09:45:22 +00:00
Jason ElkinandGitHub 1395d498b7 Use Task Delay instead of Thread.Sleep (#18119) 2025-01-27 09:36:02 +00:00
Mads Rasmussen 719f50024f Merge branch 'v15/dev' into v15/feature/workspace-info-app-extension 2025-01-25 12:50:38 +01:00
Mads Rasmussen d636bba451 Merge branch 'v15/dev' into v15/feature/enable-document-rollback-as-entity-action 2025-01-25 12:50:03 +01:00
Niels LyngsøandGitHub 380492145b remove sidebar padding bottom (#18087) 2025-01-24 22:35:17 +01:00
Niels LyngsøandGitHub 9c02fb419f implement with empty path instead of redirect (#18112) 2025-01-24 22:32:10 +01:00
Mads Rasmussen 55141df271 Update en.ts 2025-01-24 21:44:25 +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
c9758edfb1 V15: Add authorization to saves (#18111)
* Re-add authorization

* Add test plumbing

* Add test helper

* Add happy path test

* Remove usage of negation

* Minor DRYup of test code.

---------

Co-authored-by: Andy Butland <abutland73@gmail.com>
2025-01-24 13:45:56 +01:00
Niels Lyngsø e6785d3223 media picker validation 2025-01-24 11:37:26 +01:00
Niels Lyngsø c6c7d043dd implement focus for content picker 2025-01-24 11:37:11 +01:00
Niels Lyngsø 517f3c909c no need to set pristine cause it begin done by checkValidity 2025-01-24 11:37:00 +01:00
Niels Lyngsø fb3609db0a allow for undefined 2025-01-24 11:36:40 +01:00
Niels Lyngsø b8928bac0b fix observation controller instance property 2025-01-24 11:35:52 +01:00
Niels LyngsøandGitHub 4a6740bfd4 Merge branch 'v15/dev' into v15/bugfix/17372 2025-01-24 11:32:19 +01:00
Niels Lyngsø c6f11ab4b2 implement validation for mandatory 2025-01-24 11:30:47 +01:00
jonat123andGitHub 1d9704d8b1 Fixed wrong localization for button on image crops (#18106) 2025-01-24 09:51:23 +00:00
1e5e9d4c24 Allowed retrieval of current user configuration when accessing user profile as a non-admin user (#18099)
* Allowed retrieval of current user configuration when accessing user profile as a non-admin user.

* Update src/Umbraco.Web.UI.Client/src/packages/user/user/repository/config/current-user-config.repository.ts

---------

Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>
2025-01-24 09:41:03 +00:00
Kenn JacobsenandGitHub 8485458896 Add clientside validation to webhook events (#18089) 2025-01-23 17:01:55 +01:00
Niels LyngsøandGitHub 7b00033c42 Fix: 17764 (#18093)
* Add property value model type

* make the element a Form Control
2025-01-23 14:21:00 +00:00
Mads Rasmussen 1db821ffcb show notification when offline 2025-01-23 14:37:54 +01:00
Niels Lyngsø ec508918d3 reject and clear messages 2025-01-23 14:36:26 +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
Nikolaj Geisle 776e7313d0 Merge branch 'release/15.2' into v15/dev 2025-01-23 11:08:50 +01:00
Niels Lyngsø 27aef0b435 fix test 2025-01-23 10:58:33 +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
Nikolaj GeisleandGitHub c847a111fe 15: Convert pagesize properly to skip and take (#18069)
* convert pagesize properly to skip and take

* Obsolete pagesize & pageIndex GetAll method
2025-01-22 10:39:26 +01:00
98ff36b6a8 Validates and prevents save when providing a number outside of the configured range. (#17991)
* Validates and prevents save when providing a number outside of the configured range.

* Refactored to make use of `UmbFormControlMixin`

This flags the property layout container to be invalid (with prompt).
Adds localization keys.

* Corrected localization parameter order

---------

Co-authored-by: leekelleher <leekelleher@gmail.com>
2025-01-22 09:18:39 +00:00
Jacob Overgaard f67a900cc1 bump version to 15.3.0-rc 2025-01-22 10:15:21 +01:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
ff44cf3a14 Bump vite from 5.4.11 to 5.4.14 in /src/Umbraco.Web.UI.Login (#18066)
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.4.11 to 5.4.14.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v5.4.14/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.4.14/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>
2025-01-22 08:16:40 +00:00
dependabot[bot]andJacob Overgaard 3eca03a735 Bump @umbraco-cms/backoffice in /src/Umbraco.Web.UI.Login
Bumps [@umbraco-cms/backoffice](https://github.com/umbraco/Umbraco-CMS) from 15.0.0 to 15.1.2.
- [Release notes](https://github.com/umbraco/Umbraco-CMS/releases)
- [Commits](https://github.com/umbraco/Umbraco-CMS/compare/release-15.0.0...release-15.1.2)

---
updated-dependencies:
- dependency-name: "@umbraco-cms/backoffice"
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-22 08:36:11 +01:00
Niels LyngsøandGitHub a9bf90053a enable areas to be undefined (#18057) 2025-01-21 19:38:41 +01:00
Niels LyngsøandGitHub 800873c2f1 Fix settings value begin indifference (#18022) 2025-01-21 16:43:11 +00:00
Sven Geusens 880f49abdb Merge branch 'v14/dev' into v15/dev 2025-01-21 16:54:05 +01:00
Andy Butland f79b0f8fa7 Fix schema defined in JSON schema tool definition after merge from 13. 2025-01-21 16:51:27 +01:00
Andy Butland 8056a59a10 Fix schema defined in JSON schema tool definition after merge from 13. 2025-01-21 15:52:31 +01:00
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
Matthew CareandGitHub 5c0cdf5e58 Fix health check link (#17828)
"Back to overview" would push the wrong url to the history, which would break things if you reloaded your page
2025-01-21 07:30:07 +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
Mads Rasmussen a271822f02 wip decouple of workspace 2025-01-17 13:25:09 +01:00
Mads Rasmussen 724cda740f remove condition in manifest 2025-01-17 12:28:20 +01:00
Mads Rasmussen c12f6a2273 Update media-links-workspace-info-app.element.ts 2025-01-17 09:53:05 +01:00
Mads Rasmussen e3dd44f357 split media links into info app 2025-01-17 09:51:55 +01:00
Mads Rasmussen 4a728d88c2 remove double box 2025-01-17 09:29:55 +01:00
Mads Rasmussen a9039389f4 register references 2025-01-17 09:28:05 +01:00
Mads Rasmussen 61c3f529e5 move url files into folder 2025-01-17 08:43:42 +01:00
Mads Rasmussen dc7f02f121 register media history 2025-01-16 22:25:39 +01:00
Mads Rasmussen 810b7d6de3 remove double box containers + adjust styling 2025-01-16 21:05:03 +01:00
Mads Rasmussen df8da92344 wrap apps in a box element 2025-01-16 20:53:32 +01:00
Mads Rasmussen faf13c3f9e localize labels 2025-01-16 18:54:54 +01:00
Mads Rasmussen 6a6353d01b add types for the extension point 2025-01-16 18:50:01 +01:00
Mads Rasmussen f5c0e15716 Merge branch 'v15/dev' into v15/feature/workspace-info-app-extension 2025-01-16 18:30:43 +01:00
Mads Rasmussen daf2e18cd2 get unique from context 2025-01-16 15:55:43 +01:00
Mads Rasmussen 49aae77b8e align naming 2025-01-16 15:18:16 +01:00
Mads Rasmussen 4026e03606 register references as an extension 2025-01-16 15:15:56 +01:00
Mads Rasmussen 04f7da81ec register links and history as info apps 2025-01-16 15:07:54 +01:00
2324 changed files with 44183 additions and 29287 deletions
+72 -35
View File
@@ -1,5 +1,7 @@
# Umbraco CMS Build
This guide will explain how you can build the Umbraco CMS from the source code. You will most likely want to do this if your are setting up a local development environment for contributing code updates to the project. You will need this in order to develop and test your fix or feature.
## Are you sure?
In order to use Umbraco as a CMS and build your website with it, you should not build it yourself. If you're reading this then you're trying to contribute to Umbraco or you're debugging a complex issue.
@@ -13,7 +15,7 @@ If the answer is yes, please read on. Otherwise, make sure to head on over [to t
↖️ You can jump to any section by using the "table of contents" button ( ![Table of contents icon](img/tableofcontentsicon.svg) ) above.
## Debugging source locally
## Working with the Umbraco source code
Did you read ["Are you sure"](#are-you-sure)?
@@ -21,73 +23,109 @@ Did you read ["Are you sure"](#are-you-sure)?
If you want to run a build without debugging, see [Building from source](#building-from-source) below. This runs the build in the same way it is run on our build servers.
> [!NOTE]
> The caching for the back office has been described as 'aggressive' so we often find it's best when making back office changes to [disable caching in the browser (check "Disable cache" on the "Network" tab of developer tools)][disable browser caching] to help you to see the changes you're making.
If you've got this far and are keen to get stuck in helping us fix a bug or implement a feature, great! Please read on...
#### Debugging with VS Code
### Prerequisites
In order to build the Umbraco source code locally with Visual Studio Code, first make sure you have the following installed.
In order to work with the Umbraco source code locally, first make sure you have the following installed.
- [Visual Studio Code](https://code.visualstudio.com/)
- Your favourite IDE: [Visual Studio 2022 v17+ with .NET 7+](https://visualstudio.microsoft.com/vs/), [Rider](https://www.jetbrains.com/rider/) or [Visual Studio Code](https://code.visualstudio.com/)
- [dotnet SDK v9+](https://dotnet.microsoft.com/en-us/download)
- [Node.js v20+](https://nodejs.org/en/download/)
- npm v10+ (installed with Node.js)
- [Git command line](https://git-scm.com/download/)
Open the root folder of the repository in Visual Studio Code.
### Familiarizing yourself with the code
To build the front-end you'll need to open the command pallet (<kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd>) and run `>Tasks: Run Task` followed by `Client Build`.
Umbraco is a .NET application using C#. The solution is broken down into multiple projects. There are several class libraries. The `Umbraco.Web.UI` project is the main project that hosts the back office and login screen. This is the project you will want to run to see your changes.
You can also run the tasks manually on the command line:
There are two web projects in the solution with client-side assets based on TypeScript, `Umbraco.Web.UI.Client` and `Umbraco.Web.UI.Login`.
There are a few different ways to work locally when implementing features or fixing issues with the Umbraco CMS. Depending on whether you are working solely on the front-end, solely on the back-end, or somewhere in between, you may find different workflows work best for you.
Here are some suggestions based on how we work on developing Umbraco at HQ.
### First checkout
When you first clone the source code, build the whole solution via your IDE. You can then start the `Umbraco.Web.UI` project via the IDE or the command line and should find everything across front and back-end is built and running.
```
cd src\Umbraco.Web.UI.Client
npm i
npm run build:for:cms
cd <solution root>\src\Umbraco.Web.UI
dotnet run --no-build
```
If you want to make changes to the UI, you can choose to run a front-end development server. To learn more please read the Umbraco.Web.UI.Client README.md [Run against a local Umbraco instance](../src/Umbraco.Web.UI.Client/.github/README.md#run-against-a-local-umbraco-instance) for more information.
When the page loads in your web browser, you can follow the installer to set up a database for debugging. When complete, you will have an empty Umbraco installation to begin working with. You may also wish to install a [starter kit][https://marketplace.umbraco.com/category/themes-&-starter-kits] to ease your debugging.
The login screen is a different frontend build, for that one you can run it as follows:
### Back-end only changes
If you are working on back-end only features, when switching branches or pulling down the latest from GitHub, you will find the front-end getting rebuilt periodically when you look to build the back-end changes. This can take a while and slow you down. So if for a period of time you don't care about changes in the front-end, you can disable this build step.
Go to `Umbraco.Cms.StaticAssets.csproj` and comment out the following lines of MsBuild by adding a REM statement in front:
```
cd src\Umbraco.Web.UI.Login
npm i
npm run dev
REM npm ci --no-fund --no-audit --prefer-offline
REM npm run build:for:cms
```
If you just want to build the Login screen to `Umbraco.Web.UI` then instead of running `dev`, you can do: `npm run build`.
Just be careful not to include this change in your PR.
To run the C# portion of the project, either hit <kbd>F5</kbd> to begin debugging, or manually using the command line:
### Front-end only changes
Conversely, if you are working on front-end only, you want to build the back-end once and then run it. Before you do so, update the configuration in `appSettings.json` to add the following under `Umbraco:Cms:Security`:
```
dotnet watch --project .\src\Umbraco.Web.UI\Umbraco.Web.UI.csproj
"BackOfficeHost": "http://localhost:5173",
"AuthorizeCallbackPathName": "/oauth_complete",
"AuthorizeCallbackLogoutPathName": "/logout",
"AuthorizeCallbackErrorPathName": "/error"
```
**The initial C# build might take a _really_ long time (seriously, go and make a cup of coffee!) - but don't worry, this will be faster on subsequent runs.**
Then run Umbraco from the command line.
When the page eventually loads in your web browser, you can follow the installer to set up a database for debugging. You may also wish to install a [starter kit][starter kits] to ease your debugging.
```
cd <solution root>\src\Umbraco.Web.UI
dotnet run --no-build
```
#### Debugging with Visual Studio
In another terminal window, run the following to watch the front-end changes and launch Umbraco using the URL indicated from this task.
In order to build the Umbraco source code locally with Visual Studio, first make sure you have the following installed.
```
cd <solution root>\src\Umbraco.Web.UI.Client
npm run dev:server
```
- [Visual Studio 2022 v17+ with .NET 7+](https://visualstudio.microsoft.com/vs/) ([the community edition is free](https://www.visualstudio.com/thank-you-downloading-visual-studio/?sku=Community&rel=15) for you to use to contribute to Open Source projects)
- [Node.js v20+](https://nodejs.org/en/download/)
- npm v10+ (installed with Node.js)
- [Git command line](https://git-scm.com/download/)
You'll find as you make changes to the front-end files, the updates will be picked up and your browser refreshed automatically.
The easiest way to get started is to open `umbraco.sln` in Visual Studio.
> [!NOTE]
> The caching for the back office has been described as 'aggressive' so we often find it's best when making back office changes to [disable caching in the browser (check "Disable cache" on the "Network" tab of developer tools)][disable browser caching] to help you to see the changes you're making.
Umbraco is a C# based codebase, which is mostly ASP.NET Core MVC based. You can make changes, build them in Visual Studio, and hit <kbd>F5</kbd> to see the result. There are two web projects in the solution, `Umbraco.Web.UI.Client` and `Umbraco.Web.UI.Login`. They each have their own build process and can be run separately. The `Umbraco.Web.UI` project is the main project that hosts the back office and login screen. This is the project you will want to run to see your changes. It will automatically restore and build the client projects when you run it.
Whilst most of the backoffice code lives in `Umbraco.Web.UI.Client`, the login screen is in a separate project. If you do any work with that you can build with:
If you want to watch the UI Client to `Umbraco.Web.UI` then you can open a terminal in `src/Umbraco.Web.UI.Client` where you can run `npm run dev:mock` manually. This will launch the Vite dev server on http://localhost:5173 and watch for changes with mocked API responses.
```
cd <solution root>\src\Umbraco.Web.UI.Login
npm run build
```
You can also run `npm run dev:server` to run the Vite server against a local Umbraco instance. In this case, you need to have the .NET project running and accept connections from the Vite server. Please see the Umbraco.Web.UI.Client README.md [Run against a local Umbraco instance](../src/Umbraco.Web.UI.Client/.github/README.md#run-against-a-local-umbraco-instance) for more information.
In both front-end projects, if you've refreshed your branch from the latest on GitHub you may need to update front-end dependencies.
**The initial C# build might take a _really_ long time (seriously, go and make a cup of coffee!) - but don't worry, this will be faster on subsequent runs.**
To do that, run:
When the page eventually loads in your web browser, you can follow the installer to set up a database for debugging. You may also wish to install a [starter kit][starter kits] to ease your debugging.
```
npm ci --no-fund --no-audit --prefer-offline
```
### Full-stack changes
If working across both front and back-end, follow both methods and use `dotnet watch`, or re-run `dotnet run` (or `dotnet build` followed by `dotnet run --no-build`) whenever you need to update the back-end code.
Request and response models used by the management APIs are made available client-side as generated code. If you make changes to the management API, you can re-generate the typed client code with:
```
cd <solution root>\src\Umbraco.Web.UI.Client
npm run generate:server-api-dev
```
Please also update the `OpenApi.json` file held in the solution by copying and pasting the output from `/umbraco/swagger/management/swagger.json`.
## Building from source
@@ -148,5 +186,4 @@ The produced artifacts are published in a container that can be downloaded from
Git might have issues dealing with long file paths during build. You may want/need to enable `core.longpaths` support (see [this page](https://github.com/msysgit/msysgit/wiki/Git-cannot-create-a-file-or-directory-with-a-long-path) for details).
[ contribution guidelines]: CONTRIBUTING.md "Read the guide to contributing for more details on contributing to Umbraco"
[ starter kits ]: https://our.umbraco.com/packages/?category=Starter%20Kits&version=9 "Browse starter kits available for v9 on Our "
[ disable browser caching ]: https://techwiser.com/disable-cache-google-chrome-firefox "Instructions on how to disable browser caching in Chrome and Firefox"
+21 -12
View File
@@ -4,34 +4,43 @@
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.
## 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.
The following steps are a quick-start guide:
## Contribution guide
This guide describes each step to make your first contribution:
1. **Fork**
Create a fork of [`Umbraco-CMS` on GitHub](https://github.com/umbraco/Umbraco-CMS)
![Fork the repository](img/forkrepository.png)
2. **Clone**
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)
![Clone the fork](img/clonefork.png)
3. **Switch to the correct branch**
Switch to the `contrib` branch
4. **Build**
4. **Branch out**
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.
Create a new branch based on `contrib` and name it after the issue you're fixing, For example: `v15/bugfix/18132-rte-tinymce-onchange-value-check`.
5. **Branch**
Please follow this format for branches: `v{major}/{feature|bugfix|task}/{issue}-{description}`.
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.
This is a development branch for the particular issue you're working on, in this case a bug-fix for issue number `18132` that affects Umbraco v.15.
Don't commit to `contrib`, create a new branch first.
5. **Build or run a Development Server**
You can build or run a Development Server with any IDE that supports DotNet or the command line.
Read [Build or run a Development Server](BUILD.md) for the right approach to your needs.
6. **Change**
@@ -41,7 +50,7 @@ The following steps are a quick-start guide:
Done? Yay! 🎉
Remember to commit to your new `temp` branch, and don't commit to `contrib`. Then you can push the changes up to your fork on GitHub.
Remember to commit to your branch. When it's ready push the changes to your fork on GitHub.
8. **Create pull request**
+2 -2
View File
@@ -6,8 +6,8 @@ body:
- type: input
id: "version"
attributes:
label: "Which Umbraco version are you using? (Please write the *exact* version, example: 10.1.0)"
description: "Use the help icon in the Umbraco backoffice to find the version you're using"
label: "Which Umbraco version are you using?"
description: "Please write the *exact* version, example: `10.1.0`. Use the help icon in the Umbraco backoffice to find the version you're using"
validations:
required: true
- type: textarea
+5 -4
View File
@@ -1,11 +1,12 @@
# [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)
![Mastodon Follow](https://img.shields.io/mastodon/follow/110661369750014952?domain=https%3A%2F%2Fumbracocommunity.social)
[![Chat about Umbraco on Discord](https://img.shields.io/discord/869656431308189746?logo=discord&logoColor=fff)](https://discord.gg/umbraco)
[![Read what's going on in the Umbraco Discord chat now](https://img.shields.io/badge/read-discord-blue)](https://discord-chats.umbraco.com)
[![NuGet Version](https://img.shields.io/nuget/v/Umbraco.Cms)](https://www.nuget.org/packages/Umbraco.Cms)
[![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)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md)
[![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)
![Mastodon Follow](https://img.shields.io/mastodon/follow/110661369750014952?domain=https%3A%2F%2Fumbracocommunity.social)
### Umbraco is a free and open source .NET content management system. Our mission is to help you deliver delightful digital experiences by making Umbraco friendly, simpler and social.
+2
View File
@@ -43,6 +43,8 @@ jobs:
- name: Check for circular dependencies
run: node devops/circular/index.js src
- run: npm run lint:errors
- run: npm run generate:tsconfig
- run: npm run generate:icons
- run: npm run build:for:cms
- run: npm run check:paths
- run: npm run generate:jsonschema:dist
+30 -30
View File
@@ -14,25 +14,25 @@
<ItemGroup>
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="9.0.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.10.0" />
<PackageVersion Include="Microsoft.Data.Sqlite" Version="9.0.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.0" />
<PackageVersion Include="Microsoft.Data.Sqlite" Version="9.0.2" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.2" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.2" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.10" />
<PackageVersion Include="Microsoft.Extensions.Caching.Abstractions" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.FileProviders.Embedded" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.FileProviders.Physical" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.Http" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.Identity.Core" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.Identity.Stores" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.Options" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.Options.DataAnnotations" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.Caching.Abstractions" Version="9.0.2" />
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="9.0.2" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="9.0.2" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="9.0.2" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="9.0.2" />
<PackageVersion Include="Microsoft.Extensions.FileProviders.Embedded" Version="9.0.2" />
<PackageVersion Include="Microsoft.Extensions.FileProviders.Physical" Version="9.0.2" />
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="9.0.2" />
<PackageVersion Include="Microsoft.Extensions.Http" Version="9.0.2" />
<PackageVersion Include="Microsoft.Extensions.Identity.Core" Version="9.0.2" />
<PackageVersion Include="Microsoft.Extensions.Identity.Stores" Version="9.0.2" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="9.0.2" />
<PackageVersion Include="Microsoft.Extensions.Options" Version="9.0.2" />
<PackageVersion Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="9.0.2" />
<PackageVersion Include="Microsoft.Extensions.Options.DataAnnotations" Version="9.0.2" />
<PackageVersion Include="Microsoft.Extensions.Caching.Hybrid" Version="9.0.0-preview.9.24556.5" />
</ItemGroup>
<!-- Umbraco packages -->
@@ -45,23 +45,23 @@
<PackageVersion Include="Asp.Versioning.Mvc" Version="8.1.0" />
<PackageVersion Include="Asp.Versioning.Mvc.ApiExplorer" Version="8.1.0" />
<PackageVersion Include="Dazinator.Extensions.FileProviders" Version="2.0.0" />
<PackageVersion Include="Examine" Version="3.6.0" />
<PackageVersion Include="Examine.Core" Version="3.5.0" />
<PackageVersion Include="HtmlAgilityPack" Version="1.11.71" />
<PackageVersion Include="Examine" Version="3.7.0" />
<PackageVersion Include="Examine.Core" Version="3.7.0" />
<PackageVersion Include="HtmlAgilityPack" Version="1.11.74" />
<PackageVersion Include="JsonPatch.Net" Version="3.1.1" />
<PackageVersion Include="K4os.Compression.LZ4" Version="1.3.8" />
<PackageVersion Include="MailKit" Version="4.8.0" />
<PackageVersion Include="MailKit" Version="4.10.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="MiniProfiler.Shared" Version="4.5.4" />
<PackageVersion Include="ncrontab" Version="3.3.3" />
<PackageVersion Include="NPoco" Version="5.7.1" />
<PackageVersion Include="NPoco.SqlServer" Version="5.7.1" />
<PackageVersion Include="OpenIddict.Abstractions" Version="6.0.0-preview3.24551.41" />
<PackageVersion Include="OpenIddict.AspNetCore" Version="6.0.0-preview3.24551.41" />
<PackageVersion Include="OpenIddict.EntityFrameworkCore" Version="6.0.0-preview3.24551.41" />
<PackageVersion Include="Serilog" Version="4.1.0" />
<PackageVersion Include="OpenIddict.Abstractions" Version="6.1.1" />
<PackageVersion Include="OpenIddict.AspNetCore" Version="6.1.1" />
<PackageVersion Include="OpenIddict.EntityFrameworkCore" Version="6.1.1" />
<PackageVersion Include="Serilog" Version="4.2.0" />
<PackageVersion Include="Serilog.AspNetCore" Version="8.0.3" />
<PackageVersion Include="Serilog.Enrichers.Process" Version="3.0.0" />
<PackageVersion Include="Serilog.Enrichers.Thread" Version="4.0.0" />
@@ -73,14 +73,14 @@
<PackageVersion Include="Serilog.Sinks.Async" Version="2.1.0" />
<PackageVersion Include="Serilog.Sinks.File" Version="6.0.0" />
<PackageVersion Include="Serilog.Sinks.Map" Version="2.0.0" />
<PackageVersion Include="SixLabors.ImageSharp" Version="3.1.6" />
<PackageVersion Include="SixLabors.ImageSharp" Version="3.1.7" />
<PackageVersion Include="SixLabors.ImageSharp.Web" Version="3.1.3" />
<PackageVersion Include="Swashbuckle.AspNetCore" Version="7.1.0" />
</ItemGroup>
<!-- Transitive pinned versions (only required because our direct dependencies have vulnerable versions of transitive dependencies) -->
<ItemGroup>
<!-- Microsoft.EntityFrameworkCore.SqlServer and NPoco.SqlServer brings in a vulnerable version of Azure.Identity -->
<!-- Take top-level depedendency on Azure.Identity, because Microsoft.EntityFrameworkCore.SqlServer depends on a vulnerable version -->
<!-- Take top-level depedendency on Azure.Identity, because Microsoft.EntityFrameworkCore.SqlServer depends on a vulnerable version -->
<PackageVersion Include="Azure.Identity" Version="1.13.1" />
<!-- Microsoft.EntityFrameworkCore.SqlServer brings in a vulnerable version of System.Runtime.Caching -->
<PackageVersion Include="System.Runtime.Caching" Version="9.0.0" />
@@ -91,7 +91,7 @@
<!-- Dazinator.Extensions.FileProviders and MiniProfiler.AspNetCore.Mvc brings in a vulnerable version of System.Text.RegularExpressions -->
<PackageVersion Include="System.Text.RegularExpressions" Version="4.3.1" />
<!-- OpenIddict.AspNetCore, Npoco.SqlServer and Microsoft.EntityFrameworkCore.SqlServer brings in a vulnerable version of Microsoft.IdentityModel.JsonWebTokens -->
<!-- Take top-level depedendency on Microsoft.IdentityModel.JsonWebTokens, because OpenIddict.AspNetCore, Npoco.SqlServer and Microsoft.EntityFrameworkCore.SqlServer depends on a vulnerable version -->
<!-- Take top-level depedendency on Microsoft.IdentityModel.JsonWebTokens, because OpenIddict.AspNetCore, Npoco.SqlServer and Microsoft.EntityFrameworkCore.SqlServer depends on a vulnerable version -->
<PackageVersion Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.2.1" />
<!-- Azure.Identity, Microsoft.EntityFrameworkCore.SqlServer and Dazinator.Extensions.FileProviders brings in a legacy version of System.Text.Encodings.Web -->
<PackageVersion Include="System.Text.Encodings.Web" Version="9.0.0" />
+54 -27
View File
@@ -9,6 +9,11 @@ parameters:
displayName: Run SQL Server Linux Acceptance Tests
type: boolean
default: false
# Skipped due to DB locks, the tests are still being run on the Nightly build
- name: sqliteAcceptanceTests
displayName: Run SQLite Acceptance Tests
type: boolean
default: false
- name: myGetDeploy
displayName: Deploy to MyGet
type: boolean
@@ -484,6 +489,8 @@ stages:
# E2E Tests
- job:
displayName: E2E Tests (SQLite)
# currently disabled due to DB locks randomly occuring.
condition: eq(${{parameters.sqliteAcceptanceTests}}, True)
variables:
# Connection string
CONNECTIONSTRINGS__UMBRACODBDSN: Data Source=Umbraco;Mode=Memory;Cache=Shared;Foreign Keys=True;Pooling=True
@@ -492,22 +499,22 @@ stages:
matrix:
LinuxPart1Of3:
vmImage: "ubuntu-latest"
testCommand: "npm run smokeTest -- --shard=1/3"
testCommand: "npm run smokeTestSqlite -- --shard=1/3"
LinuxPart2Of3:
vmImage: "ubuntu-latest"
testCommand: "npm run smokeTest -- --shard=2/3"
testCommand: "npm run smokeTestSqlite -- --shard=2/3"
LinuxPart3Of3:
vmImage: "ubuntu-latest"
testCommand: "npm run smokeTest -- --shard=3/3"
testCommand: "npm run smokeTestSqlite -- --shard=3/3"
WindowsPart1Of3:
vmImage: "windows-latest"
testCommand: "npm run smokeTest -- --shard=1/3"
testCommand: "npm run smokeTestSqlite -- --shard=1/3"
WindowsPart2Of3:
vmImage: "windows-latest"
testCommand: "npm run smokeTest -- --shard=2/3"
testCommand: "npm run smokeTestSqlite -- --shard=2/3"
WindowsPart3Of3:
vmImage: "windows-latest"
testCommand: "npm run smokeTest -- --shard=3/3"
testCommand: "npm run smokeTestSqlite -- --shard=3/3"
pool:
vmImage: $(vmImage)
steps:
@@ -586,14 +593,13 @@ stages:
workingDirectory: tests/Umbraco.Tests.AcceptanceTest
# Install Playwright and dependencies
- pwsh: npx playwright install --with-deps
displayName: Install Playwright
- pwsh: npx playwright install chromium
displayName: Install Playwright only with Chromium browser
workingDirectory: tests/Umbraco.Tests.AcceptanceTest
# Test
- pwsh: $(testCommand)
displayName: Run Playwright tests
continueOnError: true
workingDirectory: tests/Umbraco.Tests.AcceptanceTest
env:
CI: true
@@ -603,11 +609,11 @@ stages:
# Stop application
- bash: kill -15 $(AcceptanceTestProcessId)
displayName: Stop application (Linux)
condition: and(succeeded(), ne(variables.AcceptanceTestProcessId, ''), eq(variables['Agent.OS'], 'Linux'))
condition: and(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'))
condition: and(ne(variables.AcceptanceTestProcessId, ''), eq(variables['Agent.OS'], 'Windows_NT'))
# Copy artifacts
- pwsh: |
@@ -617,13 +623,24 @@ stages:
displayName: Copy Playwright results
condition: succeededOrFailed()
# Publish
# 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)"
- job:
displayName: E2E Tests (SQL Server)
variables:
@@ -634,29 +651,29 @@ stages:
matrix:
${{ if eq(parameters.sqlServerLinuxAcceptanceTests, True) }}:
LinuxPart1Of3:
testCommand: "npm run smokeTestSqlite -- --shard=1/3"
testCommand: "npm run smokeTest -- --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 smokeTestSqlite -- --shard=2/3"
testCommand: "npm run smokeTest -- --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 smokeTestSqlite -- --shard=3/3"
testCommand: "npm run smokeTest -- --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 smokeTestSqlite -- --shard=1/3"
testCommand: "npm run smokeTest -- --shard=1/3"
WindowsPart2Of3:
vmImage: "windows-latest"
testCommand: "npm run smokeTestSqlite -- --shard=2/3"
testCommand: "npm run smokeTest -- --shard=2/3"
WindowsPart3Of3:
vmImage: "windows-latest"
testCommand: "npm run smokeTestSqlite -- --shard=3/3"
testCommand: "npm run smokeTest -- --shard=3/3"
pool:
vmImage: $(vmImage)
steps:
@@ -743,14 +760,13 @@ stages:
workingDirectory: tests/Umbraco.Tests.AcceptanceTest
# Install Playwright and dependencies
- pwsh: npx playwright install --with-deps
displayName: Install Playwright
- pwsh: npx playwright install chromium
displayName: Install Playwright only with Chromium browser
workingDirectory: tests/Umbraco.Tests.AcceptanceTest
# Test
- pwsh: $(testCommand)
displayName: Run Playwright tests
continueOnError: true
workingDirectory: tests/Umbraco.Tests.AcceptanceTest
env:
CI: true
@@ -760,20 +776,20 @@ stages:
# Stop application
- bash: kill -15 $(AcceptanceTestProcessId)
displayName: Stop application (Linux)
condition: and(succeeded(), ne(variables.AcceptanceTestProcessId, ''), eq(variables['Agent.OS'], 'Linux'))
condition: and(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'))
condition: and(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'))
condition: eq(variables['Agent.OS'], 'Linux')
- pwsh: SqlLocalDB stop MSSQLLocalDB
displayName: Stop SQL Server LocalDB (Windows)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
condition: eq(variables['Agent.OS'], 'Windows_NT')
# Copy artifacts
- pwsh: |
@@ -783,13 +799,24 @@ stages:
displayName: Copy Playwright results
condition: succeededOrFailed()
# Publish
# 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)"
###############################################
## Release
###############################################
@@ -798,7 +825,7 @@ stages:
dependsOn:
- Unit
- Integration
# - E2E
- E2E
condition: and(succeeded(), or(eq(dependencies.Build.outputs['A.build.NBGV_PublicRelease'], 'True'), ${{parameters.myGetDeploy}}))
jobs:
- job:
+20
View File
@@ -248,6 +248,16 @@ stages:
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)"
- job:
displayName: E2E Tests (SQL Server)
timeoutInMinutes: 180
@@ -418,3 +428,13 @@ stages:
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)"
+2 -1
View File
@@ -9,9 +9,10 @@ schedules:
branches:
include:
- v10/dev
- v12/dev
- v13/dev
- v14/dev
- v15/dev
- v16/dev
steps:
- checkout: none
@@ -37,12 +37,12 @@ public abstract class ContainsFilterBase : IFilterHandler
{
GroupCollection groups = QueryParserRegex.Match(filter).Groups;
if (groups.Count != 3 || groups.ContainsKey("operator") is false || groups.ContainsKey("value") is false)
if (groups.Count != 3 || groups.TryGetValue("operator", out Group? operatorGroup) is false || groups.TryGetValue("value", out Group? valueGroup) is false)
{
return DefaultFilterOption();
}
FilterOperation? filterOperation = ParseFilterOperation(groups["operator"].Value);
FilterOperation? filterOperation = ParseFilterOperation(operatorGroup.Value);
if (filterOperation.HasValue is false)
{
return DefaultFilterOption();
@@ -51,7 +51,7 @@ public abstract class ContainsFilterBase : IFilterHandler
return new FilterOption
{
FieldName = FieldName,
Values = new[] { groups["value"].Value },
Values = [valueGroup.Value],
Operator = filterOperation.Value
};
@@ -79,10 +79,14 @@ internal sealed class ApiContentQueryProvider : IApiContentQueryProvider
return new PagedModel<Guid>();
}
Guid[] items = results
.Where(r => r.Values.ContainsKey(ItemIdFieldName))
.Select(r => Guid.Parse(r.Values[ItemIdFieldName]))
.ToArray();
List<Guid> items = [];
foreach (ISearchResult result in results)
{
if (result.Values.TryGetValue(ItemIdFieldName, out string? value))
{
items.Add(Guid.Parse(value));
}
}
return new PagedModel<Guid>(results.TotalItemCount, items);
}
@@ -16,12 +16,18 @@ internal sealed class ApiMediaQueryService : IApiMediaQueryService
private readonly IPublishedMediaCache _publishedMediaCache;
private readonly ILogger<ApiMediaQueryService> _logger;
private readonly IMediaNavigationQueryService _mediaNavigationQueryService;
private readonly IPublishedMediaStatusFilteringService _publishedMediaStatusFilteringService;
public ApiMediaQueryService(IPublishedMediaCache publishedMediaCache, ILogger<ApiMediaQueryService> logger, IMediaNavigationQueryService mediaNavigationQueryService)
public ApiMediaQueryService(
IPublishedMediaCache publishedMediaCache,
ILogger<ApiMediaQueryService> logger,
IMediaNavigationQueryService mediaNavigationQueryService,
IPublishedMediaStatusFilteringService publishedMediaStatusFilteringService)
{
_publishedMediaCache = publishedMediaCache;
_logger = logger;
_mediaNavigationQueryService = mediaNavigationQueryService;
_publishedMediaStatusFilteringService = publishedMediaStatusFilteringService;
}
/// <inheritdoc/>
@@ -71,7 +77,7 @@ internal sealed class ApiMediaQueryService : IApiMediaQueryService
break;
}
currentChildren = resolvedMedia.Children(null, _publishedMediaCache, _mediaNavigationQueryService);
currentChildren = resolvedMedia.Children(_mediaNavigationQueryService, _publishedMediaStatusFilteringService);
}
return resolvedMedia;
@@ -104,7 +110,7 @@ internal sealed class ApiMediaQueryService : IApiMediaQueryService
? mediaCache.GetById(parentKey)
: TryGetByPath(childrenOf, mediaCache);
return parent?.Children(null, _publishedMediaCache, _mediaNavigationQueryService) ?? Array.Empty<IPublishedContent>();
return parent?.Children(_mediaNavigationQueryService, _publishedMediaStatusFilteringService) ?? Array.Empty<IPublishedContent>();
}
private IEnumerable<IPublishedContent>? ApplyFilters(IEnumerable<IPublishedContent> source, IEnumerable<string> filters)
@@ -1,4 +1,4 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http;
using Umbraco.Cms.Core.DeliveryApi;
namespace Umbraco.Cms.Api.Delivery.Services;
@@ -11,5 +11,5 @@ internal sealed class RequestPreviewService : RequestHeaderHandler, IRequestPrev
}
/// <inheritdoc />
public bool IsPreview() => GetHeaderValue("Preview") == "true";
public bool IsPreview() => string.Equals(GetHeaderValue("Preview"), "true", StringComparison.OrdinalIgnoreCase);
}
@@ -42,31 +42,42 @@ internal sealed class RequestRedirectService : RoutingServiceBase, IRequestRedir
{
requestedPath = requestedPath.EnsureStartsWith("/");
IPublishedContent? startItem = GetStartItem();
// must append the root content url segment if it is not hidden by config, because
// the URL tracking is based on the actual URL, including the root content url segment
if (_globalSettings.HideTopLevelNodeFromPath == false)
if (_globalSettings.HideTopLevelNodeFromPath == false && startItem?.UrlSegment != null)
{
IPublishedContent? startItem = GetStartItem();
if (startItem?.UrlSegment != null)
{
requestedPath = $"{startItem.UrlSegment.EnsureStartsWith("/")}{requestedPath}";
}
requestedPath = $"{startItem.UrlSegment.EnsureStartsWith("/")}{requestedPath}";
}
var culture = _requestCultureService.GetRequestedCulture();
// append the configured domain content ID to the path if we have a domain bound request,
// because URL tracking registers the tracked url like "{domain content ID}/{content path}"
Uri contentRoute = GetDefaultRequestUri(requestedPath);
DomainAndUri? domainAndUri = GetDomainAndUriForRoute(contentRoute);
if (domainAndUri != null)
// important: redirect URLs are always tracked without trailing slashes
requestedPath = requestedPath.TrimEnd("/");
IRedirectUrl? redirectUrl = _redirectUrlService.GetMostRecentRedirectUrl(requestedPath, culture);
// if a redirect URL was not found, try by appending the start item ID because URL tracking might have tracked
// a redirect with "{root content ID}/{content path}"
if (redirectUrl is null && startItem is not null)
{
requestedPath = GetContentRoute(domainAndUri, contentRoute);
culture ??= domainAndUri.Culture;
redirectUrl = _redirectUrlService.GetMostRecentRedirectUrl($"{startItem.Id}{requestedPath}", culture);
}
// still no redirect URL found - try looking for a configured domain if we have a domain bound request,
// because URL tracking might have tracked a redirect with "{domain content ID}/{content path}"
if (redirectUrl is null)
{
Uri contentRoute = GetDefaultRequestUri(requestedPath);
DomainAndUri? domainAndUri = GetDomainAndUriForRoute(contentRoute);
if (domainAndUri is not null)
{
requestedPath = GetContentRoute(domainAndUri, contentRoute);
culture ??= domainAndUri.Culture;
redirectUrl = _redirectUrlService.GetMostRecentRedirectUrl(requestedPath, culture);
}
}
// important: redirect URLs are always tracked without trailing slashes
IRedirectUrl? redirectUrl = _redirectUrlService.GetMostRecentRedirectUrl(requestedPath.TrimEnd("/"), culture);
IPublishedContent? content = redirectUrl != null
? _apiPublishedContentCache.GetById(redirectUrl.ContentKey)
: null;
@@ -21,6 +21,7 @@ public abstract class ContentCollectionControllerBase<TContent, TCollectionRespo
protected ContentCollectionControllerBase(IUmbracoMapper mapper) => _mapper = mapper;
[Obsolete("This method is no longer used and will be removed in Umbraco 17.")]
protected IActionResult CollectionResult(ListViewPagedModel<TContent> result)
{
PagedModel<TContent> collectionItemsResult = result.Items;
@@ -47,6 +48,17 @@ public abstract class ContentCollectionControllerBase<TContent, TCollectionRespo
return Ok(pageViewModel);
}
protected IActionResult CollectionResult(List<TCollectionResponseModel> collectionResponseModels, long totalNumberOfItems)
{
var pageViewModel = new PagedViewModel<TCollectionResponseModel>
{
Items = collectionResponseModels,
Total = totalNumberOfItems,
};
return Ok(pageViewModel);
}
protected IActionResult ContentCollectionOperationStatusResult(ContentCollectionOperationStatus status, string type) =>
OperationStatusResult(status, problemDetailsBuilder => status switch
{
@@ -76,6 +76,14 @@ public abstract class ContentControllerBase : ManagementApiControllerBase
.WithTitle("Duplicate name")
.WithDetail("The supplied name is already in use for the same content type.")
.Build()),
ContentEditingOperationStatus.CannotDeleteWhenReferenced => BadRequest(problemDetailsBuilder
.WithTitle("Cannot delete a referenced content item")
.WithDetail("Cannot delete a referenced document, while the setting ContentSettings.DisableDeleteWhenReferenced is enabled.")
.Build()),
ContentEditingOperationStatus.CannotMoveToRecycleBinWhenReferenced => BadRequest(problemDetailsBuilder
.WithTitle("Cannot move a referenced document to the recycle bin")
.WithDetail("Cannot move a referenced document to the recycle bin, while the setting ContentSettings.DisableUnpublishWhenReferenced is enabled.")
.Build()),
ContentEditingOperationStatus.Unknown => StatusCode(
StatusCodes.Status500InternalServerError,
problemDetailsBuilder
@@ -1,4 +1,5 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.ViewModels.DataType;
@@ -7,10 +8,12 @@ using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Security;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Cms.Web.Common.Authorization;
namespace Umbraco.Cms.Api.Management.Controllers.DataType;
[ApiVersion("1.0")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessDataTypes)]
public class CopyDataTypeController : DataTypeControllerBase
{
private readonly IDataTypeService _dataTypeService;
@@ -1,4 +1,5 @@
using Asp.Versioning;
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.Factories;
@@ -8,10 +9,12 @@ using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Security;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Cms.Web.Common.Authorization;
namespace Umbraco.Cms.Api.Management.Controllers.DataType;
[ApiVersion("1.0")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessDataTypes)]
public class CreateDataTypeController : DataTypeControllerBase
{
private readonly IDataTypeService _dataTypeService;
@@ -1,4 +1,5 @@
using Asp.Versioning;
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Core;
@@ -6,10 +7,12 @@ using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Security;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Cms.Web.Common.Authorization;
namespace Umbraco.Cms.Api.Management.Controllers.DataType;
[ApiVersion("1.0")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessDataTypes)]
public class DeleteDataTypeController : DataTypeControllerBase
{
private readonly IDataTypeService _dataTypeService;
@@ -1,4 +1,5 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.ViewModels.DataType;
@@ -7,10 +8,12 @@ using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Security;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Cms.Web.Common.Authorization;
namespace Umbraco.Cms.Api.Management.Controllers.DataType;
[ApiVersion("1.0")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessDataTypes)]
public class MoveDataTypeController : DataTypeControllerBase
{
private readonly IDataTypeService _dataTypeService;
@@ -1,4 +1,5 @@
using Asp.Versioning;
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.Factories;
@@ -8,10 +9,12 @@ using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Security;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Cms.Web.Common.Authorization;
namespace Umbraco.Cms.Api.Management.Controllers.DataType;
[ApiVersion("1.0")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessDataTypes)]
public class UpdateDataTypeController : DataTypeControllerBase
{
private readonly IDataTypeService _dataTypeService;
@@ -1,4 +1,4 @@
using Asp.Versioning;
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
@@ -1,4 +1,4 @@
using Asp.Versioning;
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
@@ -53,6 +53,7 @@ public class ByKeyPublishedDocumentController : DocumentControllerBase
}
PublishedDocumentResponseModel model = await _documentPresentationFactory.CreatePublishedResponseModelAsync(content);
return Ok(model);
}
}
@@ -1,9 +1,12 @@
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.Api.Management.Factories;
using Umbraco.Cms.Api.Management.ViewModels.Document.Collection;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.DependencyInjection;
using Umbraco.Cms.Core.Mapping;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Security;
@@ -17,15 +20,32 @@ public class ByKeyDocumentCollectionController : DocumentCollectionControllerBas
{
private readonly IContentListViewService _contentListViewService;
private readonly IBackOfficeSecurityAccessor _backOfficeSecurityAccessor;
private readonly IDocumentCollectionPresentationFactory _documentCollectionPresentationFactory;
[Obsolete("Please use the constructor taking all parameters.")]
public ByKeyDocumentCollectionController(
IContentListViewService contentListViewService,
IBackOfficeSecurityAccessor backOfficeSecurityAccessor,
IUmbracoMapper mapper)
: this(
contentListViewService,
backOfficeSecurityAccessor,
mapper,
StaticServiceProvider.Instance.GetRequiredService<IDocumentCollectionPresentationFactory>())
{
}
[ActivatorUtilitiesConstructor]
public ByKeyDocumentCollectionController(
IContentListViewService contentListViewService,
IBackOfficeSecurityAccessor backOfficeSecurityAccessor,
IUmbracoMapper mapper,
IDocumentCollectionPresentationFactory documentCollectionPresentationFactory)
: base(mapper)
{
_contentListViewService = contentListViewService;
_backOfficeSecurityAccessor = backOfficeSecurityAccessor;
_documentCollectionPresentationFactory = documentCollectionPresentationFactory;
}
[HttpGet("{id:guid}")]
@@ -55,8 +75,12 @@ public class ByKeyDocumentCollectionController : DocumentCollectionControllerBas
skip,
take);
return collectionAttempt.Success
? CollectionResult(collectionAttempt.Result!)
: CollectionOperationStatusResult(collectionAttempt.Status);
if (collectionAttempt.Success is false)
{
return CollectionOperationStatusResult(collectionAttempt.Status);
}
List<DocumentCollectionResponseModel> collectionResponseModels = await _documentCollectionPresentationFactory.CreateCollectionModelAsync(collectionAttempt.Result!);
return CollectionResult(collectionResponseModels, collectionAttempt.Result!.Items.Total);
}
}
@@ -18,21 +18,18 @@ public abstract class CreateDocumentControllerBase : DocumentControllerBase
protected async Task<IActionResult> HandleRequest(CreateDocumentRequestModel requestModel, Func<Task<IActionResult>> authorizedHandler)
{
// TODO This have temporarily been uncommented, to support the client sends values from all cultures, even when the user do not have access to the languages.
// The values are ignored in the ContentEditingService
// We intentionally don't pass in cultures here.
// This is to support the client sending values for all cultures even if the user doesn't have access to the language.
// Values for unauthorized languages are later ignored in the ContentEditingService.
AuthorizationResult authorizationResult = await _authorizationService.AuthorizeResourceAsync(
User,
ContentPermissionResource.WithKeys(ActionNew.ActionLetter, requestModel.Parent?.Id),
AuthorizationPolicies.ContentPermissionByResource);
// IEnumerable<string> cultures = requestModel.Variants
// .Where(v => v.Culture is not null)
// .Select(v => v.Culture!);
// AuthorizationResult authorizationResult = await _authorizationService.AuthorizeResourceAsync(
// User,
// ContentPermissionResource.WithKeys(ActionNew.ActionLetter, requestModel.Parent?.Id, cultures),
// AuthorizationPolicies.ContentPermissionByResource);
//
// if (!authorizationResult.Succeeded)
// {
// return Forbidden();
// }
if (authorizationResult.Succeeded is false)
{
return Forbidden();
}
return await authorizedHandler();
}
@@ -121,6 +121,11 @@ public abstract class DocumentControllerBase : ContentControllerBase
.WithDetail(
"Cannot handle an unpublish time that is not after the current server time.")
.Build()),
ContentPublishingOperationStatus.CannotUnpublishWhenReferenced => BadRequest(problemDetailsBuilder
.WithTitle("Cannot unpublish document when it's referenced somewhere else.")
.WithDetail(
"Cannot unpublish a referenced document, while the setting ContentSettings.DisableUnpublishWhenReferenced is enabled.")
.Build()),
ContentPublishingOperationStatus.FailedBranch => BadRequest(problemDetailsBuilder
.WithTitle("Failed branch operation")
.WithDetail("One or more items in the branch could not complete the operation.")
@@ -1,4 +1,5 @@
using Asp.Versioning;
using System.Text.Json.Serialization;
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.Factories;
@@ -26,12 +27,36 @@ public class SearchDocumentItemController : DocumentItemControllerBase
public async Task<IActionResult> Search(CancellationToken cancellationToken, string query, int skip = 0, int take = 100)
=> await SearchFromParent(cancellationToken, query, skip, take);
[NonAction]
[Obsolete("Scheduled to be removed in v16, use the non obsoleted method instead")]
public async Task<IActionResult> SearchFromParent(CancellationToken cancellationToken, string query, int skip = 0, int take = 100, Guid? parentId = null)
=> await SearchWithTrashed(cancellationToken, query, null, skip, take, parentId);
[NonAction]
[Obsolete("Scheduled to be removed in v16, use the non obsoleted method instead")]
[ProducesResponseType(typeof(PagedModel<DocumentItemResponseModel>), StatusCodes.Status200OK)]
public async Task<IActionResult> SearchFromParentWithAllowedTypes(
CancellationToken cancellationToken,
string query,
int skip = 0,
int take = 100,
Guid? parentId = null,
[FromQuery] IEnumerable<Guid>? allowedDocumentTypes = null) =>
await SearchWithTrashed(cancellationToken, query, null, skip, take, parentId, allowedDocumentTypes);
[HttpGet("search")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(PagedModel<DocumentItemResponseModel>), StatusCodes.Status200OK)]
public async Task<IActionResult> SearchFromParent(CancellationToken cancellationToken, string query, int skip = 0, int take = 100, Guid? parentId = null)
public async Task<IActionResult> SearchWithTrashed(
CancellationToken cancellationToken,
string query,
bool? trashed = null,
int skip = 0,
int take = 100,
Guid? parentId = null,
[FromQuery] IEnumerable<Guid>? allowedDocumentTypes = null)
{
PagedModel<IEntitySlim> searchResult = _indexedEntitySearchService.Search(UmbracoObjectTypes.Document, query, parentId, skip, take);
PagedModel<IEntitySlim> searchResult = _indexedEntitySearchService.Search(UmbracoObjectTypes.Document, query, parentId, allowedDocumentTypes, trashed, skip, take);
var result = new PagedModel<DocumentItemResponseModel>
{
Items = searchResult.Items.OfType<IDocumentEntitySlim>().Select(_documentPresentationFactory.CreateItemResponseModel),
@@ -1,11 +1,11 @@
using Asp.Versioning;
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.Security.Authorization.Content;
using Umbraco.Cms.Api.Management.ViewModels.Document;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Actions;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Models.ContentPublishing;
using Umbraco.Cms.Core.Security;
using Umbraco.Cms.Core.Security.Authorization;
@@ -53,11 +53,22 @@ public class PublishDocumentWithDescendantsController : DocumentControllerBase
Attempt<ContentPublishingBranchResult, ContentPublishingOperationStatus> attempt = await _contentPublishingService.PublishBranchAsync(
id,
requestModel.Cultures,
requestModel.IncludeUnpublishedDescendants,
BuildPublishBranchFilter(requestModel),
CurrentUserKey(_backOfficeSecurityAccessor));
return attempt.Success
? Ok()
: DocumentPublishingOperationStatusResult(attempt.Status, failedBranchItems: attempt.Result.FailedItems);
}
private static PublishBranchFilter BuildPublishBranchFilter(PublishDocumentWithDescendantsRequestModel requestModel)
{
PublishBranchFilter publishBranchFilter = PublishBranchFilter.Default;
if (requestModel.IncludeUnpublishedDescendants)
{
publishBranchFilter |= PublishBranchFilter.IncludeUnpublished;
}
return publishBranchFilter;
}
}
@@ -1,4 +1,4 @@
using Asp.Versioning;
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Common.ViewModels.Pagination;
@@ -37,7 +37,7 @@ public class ReferencedByDocumentController : DocumentControllerBase
int skip = 0,
int take = 20)
{
PagedModel<RelationItemModel> relationItems = await _trackedReferencesService.GetPagedRelationsForItemAsync(id, skip, take, false);
PagedModel<RelationItemModel> relationItems = await _trackedReferencesService.GetPagedRelationsForItemAsync(id, skip, take, true);
var pagedViewModel = new PagedViewModel<IReferenceResponseModel>
{
@@ -17,21 +17,18 @@ public abstract class UpdateDocumentControllerBase : DocumentControllerBase
protected async Task<IActionResult> HandleRequest(Guid id, UpdateDocumentRequestModel requestModel, Func<Task<IActionResult>> authorizedHandler)
{
// TODO This have temporarily been uncommented, to support the client sends values from all cultures, even when the user do not have access to the languages.
// The values are ignored in the ContentEditingService
// We intentionally don't pass in cultures here.
// This is to support the client sending values for all cultures even if the user doesn't have access to the language.
// Values for unauthorized languages are later ignored in the ContentEditingService.
AuthorizationResult authorizationResult = await _authorizationService.AuthorizeResourceAsync(
User,
ContentPermissionResource.WithKeys(ActionUpdate.ActionLetter, id),
AuthorizationPolicies.ContentPermissionByResource);
// IEnumerable<string> cultures = requestModel.Variants
// .Where(v => v.Culture is not null)
// .Select(v => v.Culture!);
// AuthorizationResult authorizationResult = await _authorizationService.AuthorizeResourceAsync(
// User,
// ContentPermissionResource.WithKeys(ActionUpdate.ActionLetter, id, cultures),
// AuthorizationPolicies.ContentPermissionByResource);
//
// if (!authorizationResult.Succeeded)
// {
// return Forbidden();
// }
if (authorizationResult.Succeeded is false)
{
return Forbidden();
}
return await authorizedHandler();
}
@@ -1,5 +1,4 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Common.ViewModels.Pagination;
@@ -9,7 +8,6 @@ using Umbraco.Cms.Core.Mapping;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Cms.Web.Common.Authorization;
namespace Umbraco.Cms.Api.Management.Controllers.DocumentType;
@@ -25,6 +23,15 @@ public class AllowedChildrenDocumentTypeController : DocumentTypeControllerBase
_umbracoMapper = umbracoMapper;
}
[NonAction]
[Obsolete("Use the non obsoleted method instead. Scheduled to be removed in v16")]
public async Task<IActionResult> AllowedChildrenByKey(
CancellationToken cancellationToken,
Guid id,
int skip = 0,
int take = 100)
=> await AllowedChildrenByKey(cancellationToken, id, null, skip, take);
[HttpGet("{id:guid}/allowed-children")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(PagedViewModel<AllowedDocumentType>), StatusCodes.Status200OK)]
@@ -32,10 +39,11 @@ public class AllowedChildrenDocumentTypeController : DocumentTypeControllerBase
public async Task<IActionResult> AllowedChildrenByKey(
CancellationToken cancellationToken,
Guid id,
Guid? parentContentKey = null,
int skip = 0,
int take = 100)
{
Attempt<PagedModel<IContentType>?, ContentTypeOperationStatus> attempt = await _contentTypeService.GetAllowedChildrenAsync(id, skip, take);
Attempt<PagedModel<IContentType>?, ContentTypeOperationStatus> attempt = await _contentTypeService.GetAllowedChildrenAsync(id, parentContentKey, skip, take);
if (attempt.Success is false)
{
return OperationStatusResult(attempt.Status);
@@ -1,14 +1,17 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.Factories;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Cms.Web.Common.Authorization;
namespace Umbraco.Cms.Api.Management.Controllers.DocumentType;
[ApiVersion("1.0")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessDocumentTypes)]
public class ExportDocumentTypeController : DocumentTypeControllerBase
{
private readonly IContentTypeService _contentTypeService;
@@ -1,17 +1,19 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.ViewModels.DocumentType;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Models.Membership;
using Umbraco.Cms.Core.Security;
using Umbraco.Cms.Core.Services.ImportExport;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Cms.Web.Common.Authorization;
namespace Umbraco.Cms.Api.Management.Controllers.DocumentType;
[ApiVersion("1.0")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessDocumentTypes)]
public class ImportExistingDocumentTypeController : DocumentTypeControllerBase
{
private readonly IBackOfficeSecurityAccessor _backOfficeSecurityAccessor;
@@ -1,17 +1,19 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.ViewModels.DocumentType;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Models.Membership;
using Umbraco.Cms.Core.Security;
using Umbraco.Cms.Core.Services.ImportExport;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Cms.Web.Common.Authorization;
namespace Umbraco.Cms.Api.Management.Controllers.DocumentType;
[ApiVersion("1.0")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessDocumentTypes)]
public class ImportNewDocumentTypeController : DocumentTypeControllerBase
{
private readonly IBackOfficeSecurityAccessor _backOfficeSecurityAccessor;
@@ -1,45 +1,60 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
using Umbraco.Cms.Api.Management.ViewModels.DocumentType.Item;
using Umbraco.Cms.Core.DependencyInjection;
using Umbraco.Cms.Core.Mapping;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Models.Entities;
using Umbraco.Cms.Core.Services;
using Umbraco.Extensions;
namespace Umbraco.Cms.Api.Management.Controllers.DocumentType.Item;
[ApiVersion("1.0")]
public class SearchDocumentTypeItemController : DocumentTypeItemControllerBase
{
private readonly IEntitySearchService _entitySearchService;
private readonly IContentTypeService _contentTypeService;
private readonly IUmbracoMapper _mapper;
private readonly IContentTypeSearchService _contentTypeSearchService;
[Obsolete("Please use ctor that only accepts IUmbracoMapper & IContentTypeSearchService, scheduled for removal in v17")]
public SearchDocumentTypeItemController(IEntitySearchService entitySearchService, IContentTypeService contentTypeService, IUmbracoMapper mapper)
: this(mapper, StaticServiceProvider.Instance.GetRequiredService<IContentTypeSearchService>())
{
_entitySearchService = entitySearchService;
_contentTypeService = contentTypeService;
_mapper = mapper;
}
[Obsolete("Please use ctor that only accepts IUmbracoMapper & IContentTypeSearchService, scheduled for removal in v17")]
// We need to have this constructor, or else we get ambiguous constructor error
public SearchDocumentTypeItemController(
IEntitySearchService entitySearchService,
IContentTypeService contentTypeService,
IUmbracoMapper mapper,
IContentTypeSearchService contentTypeSearchService)
: this(mapper, contentTypeSearchService)
{
}
[ActivatorUtilitiesConstructor]
public SearchDocumentTypeItemController(IUmbracoMapper mapper, IContentTypeSearchService contentTypeSearchService)
{
_mapper = mapper;
_contentTypeSearchService = contentTypeSearchService;
}
[NonAction]
[Obsolete("Scheduled to be removed in v16, use the non obsoleted method instead")]
public async Task<IActionResult> Search(CancellationToken cancellationToken, string query, int skip = 0, int take = 100)
=> await SearchDocumentType(cancellationToken, query, null, skip, take);
[HttpGet("search")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(PagedModel<DocumentTypeItemResponseModel>), StatusCodes.Status200OK)]
public async Task<IActionResult> Search(CancellationToken cancellationToken, string query, int skip = 0, int take = 100)
public async Task<IActionResult> SearchDocumentType(CancellationToken cancellationToken, string query, bool? isElement = null, int skip = 0, int take = 100)
{
PagedModel<IEntitySlim> searchResult = _entitySearchService.Search(UmbracoObjectTypes.DocumentType, query, skip, take);
if (searchResult.Items.Any() is false)
{
return await Task.FromResult(Ok(new PagedModel<DocumentTypeItemResponseModel> { Total = searchResult.Total }));
}
IEnumerable<IContentType> contentTypes = _contentTypeService.GetMany(searchResult.Items.Select(item => item.Key).ToArray().EmptyNull());
PagedModel<IContentType> contentTypes = await _contentTypeSearchService.SearchAsync(query, isElement, cancellationToken, skip, take);
var result = new PagedModel<DocumentTypeItemResponseModel>
{
Items = _mapper.MapEnumerable<IContentType, DocumentTypeItemResponseModel>(contentTypes),
Total = searchResult.Total
Items = _mapper.MapEnumerable<IContentType, DocumentTypeItemResponseModel>(contentTypes.Items),
Total = contentTypes.Total
};
return Ok(result);
@@ -1,10 +1,18 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Actions;
using Umbraco.Cms.Core.DependencyInjection;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Security;
using Umbraco.Cms.Core.Security.Authorization;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Cms.Web.Common.Authorization;
using Umbraco.Extensions;
namespace Umbraco.Cms.Api.Management.Controllers.DocumentVersion;
@@ -13,13 +21,29 @@ public class RollbackDocumentVersionController : DocumentVersionControllerBase
{
private readonly IContentVersionService _contentVersionService;
private readonly IBackOfficeSecurityAccessor _backOfficeSecurityAccessor;
private readonly IAuthorizationService _authorizationService;
[ActivatorUtilitiesConstructor]
public RollbackDocumentVersionController(
IContentVersionService contentVersionService,
IBackOfficeSecurityAccessor backOfficeSecurityAccessor)
IBackOfficeSecurityAccessor backOfficeSecurityAccessor,
IAuthorizationService authorizationService)
{
_contentVersionService = contentVersionService;
_backOfficeSecurityAccessor = backOfficeSecurityAccessor;
_authorizationService = authorizationService;
}
// TODO (V16): Remove this constructor.
[Obsolete("Please use the constructor taking all parameters. This constructor will be removed in V16.")]
public RollbackDocumentVersionController(
IContentVersionService contentVersionService,
IBackOfficeSecurityAccessor backOfficeSecurityAccessor)
: this(
contentVersionService,
backOfficeSecurityAccessor,
StaticServiceProvider.Instance.GetRequiredService<IAuthorizationService>())
{
}
[MapToApiVersion("1.0")]
@@ -29,11 +53,29 @@ public class RollbackDocumentVersionController : DocumentVersionControllerBase
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
public async Task<IActionResult> Rollback(CancellationToken cancellationToken, Guid id, string? culture)
{
Attempt<ContentVersionOperationStatus> attempt =
Attempt<IContent?, ContentVersionOperationStatus> getContentAttempt =
await _contentVersionService.GetAsync(id);
if (getContentAttempt.Success is false || getContentAttempt.Result is null)
{
return MapFailure(getContentAttempt.Status);
}
IContent content = getContentAttempt.Result;
AuthorizationResult authorizationResult = await _authorizationService.AuthorizeResourceAsync(
User,
ContentPermissionResource.WithKeys(ActionRollback.ActionLetter, content.Key),
AuthorizationPolicies.ContentPermissionByResource);
if (!authorizationResult.Succeeded)
{
return Forbidden();
}
Attempt<ContentVersionOperationStatus> rollBackAttempt =
await _contentVersionService.RollBackAsync(id, culture, CurrentUserKey(_backOfficeSecurityAccessor));
return attempt.Success
return rollBackAttempt.Success
? Ok()
: MapFailure(attempt.Result);
: MapFailure(rollBackAttempt.Result);
}
}
@@ -61,7 +61,7 @@ public class ExecuteActionHealthCheckController : HealthCheckControllerBase
return BadRequest(invalidModelProblem);
}
HealthCheckStatus result = healthCheck.ExecuteAction(_umbracoMapper.Map<HealthCheckAction>(action)!);
HealthCheckStatus result = await healthCheck.ExecuteActionAsync(_umbracoMapper.Map<HealthCheckAction>(action)!);
return await Task.FromResult(Ok(_umbracoMapper.Map<HealthCheckResultResponseModel>(result)));
}
@@ -39,6 +39,6 @@ public class CheckHealthCheckGroupController : HealthCheckGroupControllerBase
return HealthCheckGroupNotFound();
}
return await Task.FromResult(Ok(_healthCheckGroupPresentationFactory.CreateHealthCheckGroupWithResultViewModel(group)));
return Ok(await _healthCheckGroupPresentationFactory.CreateHealthCheckGroupWithResultViewModelAsync(group));
}
}
@@ -1,9 +1,12 @@
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.Api.Management.Factories;
using Umbraco.Cms.Api.Management.ViewModels.Media.Collection;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.DependencyInjection;
using Umbraco.Cms.Core.Mapping;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Security;
@@ -17,15 +20,32 @@ public class ByKeyMediaCollectionController : MediaCollectionControllerBase
{
private readonly IMediaListViewService _mediaListViewService;
private readonly IBackOfficeSecurityAccessor _backOfficeSecurityAccessor;
private readonly IMediaCollectionPresentationFactory _mediaCollectionPresentationFactory;
[Obsolete("Please use the constructor taking all parameters.")]
public ByKeyMediaCollectionController(
IMediaListViewService mediaListViewService,
IBackOfficeSecurityAccessor backOfficeSecurityAccessor,
IUmbracoMapper mapper)
: this(
mediaListViewService,
backOfficeSecurityAccessor,
mapper,
StaticServiceProvider.Instance.GetRequiredService<IMediaCollectionPresentationFactory>())
{
}
[ActivatorUtilitiesConstructor]
public ByKeyMediaCollectionController(
IMediaListViewService mediaListViewService,
IBackOfficeSecurityAccessor backOfficeSecurityAccessor,
IUmbracoMapper mapper,
IMediaCollectionPresentationFactory mediaCollectionPresentationFactory)
: base(mapper)
{
_mediaListViewService = mediaListViewService;
_backOfficeSecurityAccessor = backOfficeSecurityAccessor;
_mediaCollectionPresentationFactory = mediaCollectionPresentationFactory;
}
[HttpGet]
@@ -53,8 +73,13 @@ public class ByKeyMediaCollectionController : MediaCollectionControllerBase
skip,
take);
return collectionAttempt.Success
? CollectionResult(collectionAttempt.Result!)
: CollectionOperationStatusResult(collectionAttempt.Status);
if (collectionAttempt.Success is false)
{
return CollectionOperationStatusResult(collectionAttempt.Status);
}
List<MediaCollectionResponseModel> collectionResponseModels = await _mediaCollectionPresentationFactory.CreateCollectionModelAsync(collectionAttempt.Result!);
return CollectionResult(collectionResponseModels, collectionAttempt.Result!.Items.Total);
}
}
@@ -26,12 +26,23 @@ public class SearchMediaItemController : MediaItemControllerBase
public async Task<IActionResult> Search(CancellationToken cancellationToken, string query, int skip = 0, int take = 100)
=> await SearchFromParent(cancellationToken, query, skip, take, null);
[NonAction]
[Obsolete("Scheduled to be removed in v16, use the non obsoleted method instead")]
[ProducesResponseType(typeof(PagedModel<MediaItemResponseModel>), StatusCodes.Status200OK)]
public async Task<IActionResult> SearchFromParent(CancellationToken cancellationToken, string query, int skip = 0, int take = 100, Guid? parentId = null)
=> await SearchFromParentWithAllowedTypes(cancellationToken, query, skip, take, parentId);
[NonAction]
[Obsolete("Scheduled to be removed in v16, use the non obsoleted method instead")]
public async Task<IActionResult> SearchFromParentWithAllowedTypes(CancellationToken cancellationToken, string query, int skip = 0, int take = 100, Guid? parentId = null, [FromQuery]IEnumerable<Guid>? allowedMediaTypes = null)
=> await SearchFromParentWithAllowedTypes(cancellationToken, query, null, skip, take, parentId);
[HttpGet("search")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(PagedModel<MediaItemResponseModel>), StatusCodes.Status200OK)]
public async Task<IActionResult> SearchFromParent(CancellationToken cancellationToken, string query, int skip = 0, int take = 100, Guid? parentId = null)
public async Task<IActionResult> SearchFromParentWithAllowedTypes(CancellationToken cancellationToken, string query, bool? trashed = null, int skip = 0, int take = 100, Guid? parentId = null, [FromQuery]IEnumerable<Guid>? allowedMediaTypes = null)
{
PagedModel<IEntitySlim> searchResult = _indexedEntitySearchService.Search(UmbracoObjectTypes.Media, query, parentId, skip, take);
PagedModel<IEntitySlim> searchResult = _indexedEntitySearchService.Search(UmbracoObjectTypes.Media, query, parentId, allowedMediaTypes, trashed, skip, take);
var result = new PagedModel<MediaItemResponseModel>
{
Items = searchResult.Items.OfType<IMediaEntitySlim>().Select(_mediaPresentationFactory.CreateItemResponseModel),
@@ -1,4 +1,4 @@
using Asp.Versioning;
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Common.ViewModels.Pagination;
@@ -37,7 +37,7 @@ public class ReferencedByMediaController : MediaControllerBase
int skip = 0,
int take = 20)
{
PagedModel<RelationItemModel> relationItems = await _trackedReferencesService.GetPagedRelationsForItemAsync(id, skip, take, false);
PagedModel<RelationItemModel> relationItems = await _trackedReferencesService.GetPagedRelationsForItemAsync(id, skip, take, true);
var pagedViewModel = new PagedViewModel<IReferenceResponseModel>
{
@@ -1,4 +1,4 @@
using Asp.Versioning;
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Common.ViewModels.Pagination;
@@ -23,6 +23,15 @@ public class AllowedChildrenMediaTypeController : MediaTypeControllerBase
_umbracoMapper = umbracoMapper;
}
[NonAction]
[Obsolete("Use the non obsoleted method instead. Scheduled for removal in Umbraco 16.")]
public async Task<IActionResult> AllowedChildrenByKey(
CancellationToken cancellationToken,
Guid id,
int skip = 0,
int take = 100)
=> await AllowedChildrenByKey(cancellationToken, id, null, skip, take);
[HttpGet("{id:guid}/allowed-children")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(PagedViewModel<AllowedMediaType>), StatusCodes.Status200OK)]
@@ -30,10 +39,11 @@ public class AllowedChildrenMediaTypeController : MediaTypeControllerBase
public async Task<IActionResult> AllowedChildrenByKey(
CancellationToken cancellationToken,
Guid id,
Guid? parentContentKey = null,
int skip = 0,
int take = 100)
{
Attempt<PagedModel<IMediaType>?, ContentTypeOperationStatus> attempt = await _mediaTypeService.GetAllowedChildrenAsync(id, skip, take);
Attempt<PagedModel<IMediaType>?, ContentTypeOperationStatus> attempt = await _mediaTypeService.GetAllowedChildrenAsync(id, parentContentKey, skip, take);
if (attempt.Success is false)
{
return OperationStatusResult(attempt.Status);
@@ -1,14 +1,17 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.Factories;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Cms.Web.Common.Authorization;
namespace Umbraco.Cms.Api.Management.Controllers.MediaType;
[ApiVersion("1.0")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessMediaTypes)]
public class ExportMediaTypeController : MediaTypeControllerBase
{
private readonly IMediaTypeService _mediaTypeService;
@@ -1,17 +1,19 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.ViewModels.MediaType;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Models.Membership;
using Umbraco.Cms.Core.Security;
using Umbraco.Cms.Core.Services.ImportExport;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Cms.Web.Common.Authorization;
namespace Umbraco.Cms.Api.Management.Controllers.MediaType;
[ApiVersion("1.0")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessMediaTypes)]
public class ImportExistingMediaTypeController : MediaTypeControllerBase
{
private readonly IBackOfficeSecurityAccessor _backOfficeSecurityAccessor;
@@ -1,18 +1,19 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.Controllers.DocumentType;
using Umbraco.Cms.Api.Management.ViewModels.MediaType;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Models.Membership;
using Umbraco.Cms.Core.Security;
using Umbraco.Cms.Core.Services.ImportExport;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Cms.Web.Common.Authorization;
namespace Umbraco.Cms.Api.Management.Controllers.MediaType;
[ApiVersion("1.0")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessMediaTypes)]
public class ImportNewMediaTypeController : MediaTypeControllerBase
{
private readonly IBackOfficeSecurityAccessor _backOfficeSecurityAccessor;
@@ -1,9 +1,8 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.Controllers.DocumentType;
using Umbraco.Cms.Api.Management.Routing;
using Umbraco.Cms.Api.Management.ViewModels.MediaType;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Cms.Web.Common.Authorization;
@@ -21,12 +21,17 @@ public class SearchMemberItemController : MemberItemControllerBase
_memberPresentationFactory = memberPresentationFactory;
}
[NonAction]
[Obsolete("Scheduled to be removed in v16, use the non obsoleted method instead")]
public async Task<IActionResult> Search(CancellationToken cancellationToken, string query, int skip = 0, int take = 100)
=> await SearchWithAllowedTypes(cancellationToken, query, skip, take);
[HttpGet("search")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(PagedModel<MemberItemResponseModel>), StatusCodes.Status200OK)]
public async Task<IActionResult> Search(CancellationToken cancellationToken, string query, int skip = 0, int take = 100)
public async Task<IActionResult> SearchWithAllowedTypes(CancellationToken cancellationToken, string query, int skip = 0, int take = 100, [FromQuery]IEnumerable<Guid>? allowedMemberTypes = null)
{
PagedModel<IEntitySlim> searchResult = _indexedEntitySearchService.Search(UmbracoObjectTypes.Member, query, skip, take);
PagedModel<IEntitySlim> searchResult = _indexedEntitySearchService.Search(UmbracoObjectTypes.Member, query, null, allowedMemberTypes, skip, take);
var result = new PagedModel<MemberItemResponseModel>
{
Items = searchResult.Items.OfType<IMemberEntitySlim>().Select(_memberPresentationFactory.CreateItemResponseModel),
@@ -1,4 +1,4 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Common.Builders;
@@ -58,7 +58,8 @@ public class MemberControllerBase : ContentControllerBase
.WithTitle("Invalid name supplied")
.Build()),
MemberEditingOperationStatus.InvalidUsername => BadRequest(problemDetailsBuilder
.WithTitle("Invalid username supplied")
.WithTitle("Invalid username")
.WithDetail("The username is either empty or contains one or more invalid characters.")
.Build()),
MemberEditingOperationStatus.InvalidEmail => BadRequest(problemDetailsBuilder
.WithTitle("Invalid email supplied")
@@ -1,4 +1,4 @@
using Asp.Versioning;
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Core.PublishedCache;
@@ -17,7 +17,20 @@ public class RebuildPublishedCacheController : PublishedCacheControllerBase
[ProducesResponseType(StatusCodes.Status200OK)]
public async Task<IActionResult> Rebuild(CancellationToken cancellationToken)
{
_databaseCacheRebuilder.Rebuild();
if (_databaseCacheRebuilder.IsRebuilding())
{
var problemDetails = new ProblemDetails
{
Title = "Database cache can not be rebuilt",
Detail = $"The database cache is in the process of rebuilding.",
Status = StatusCodes.Status400BadRequest,
Type = "Error",
};
return await Task.FromResult(Conflict(problemDetails));
}
_databaseCacheRebuilder.Rebuild(true);
return await Task.FromResult(Ok());
}
}
@@ -0,0 +1,27 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.ViewModels.PublishedCache;
using Umbraco.Cms.Core.PublishedCache;
namespace Umbraco.Cms.Api.Management.Controllers.PublishedCache;
[ApiVersion("1.0")]
public class RebuildPublishedCacheStatusController : PublishedCacheControllerBase
{
private readonly IDatabaseCacheRebuilder _databaseCacheRebuilder;
public RebuildPublishedCacheStatusController(IDatabaseCacheRebuilder databaseCacheRebuilder) => _databaseCacheRebuilder = databaseCacheRebuilder;
[HttpGet("rebuild/status")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(RebuildStatusModel), StatusCodes.Status200OK)]
public Task<IActionResult> Status(CancellationToken cancellationToken)
{
var isRebuilding = _databaseCacheRebuilder.IsRebuilding();
return Task.FromResult((IActionResult)Ok(new RebuildStatusModel
{
IsRebuilding = isRebuilding
}));
}
}
@@ -19,6 +19,7 @@ namespace Umbraco.Cms.Api.Management.Controllers.Security;
public class BackOfficeGraphicsController : Controller
{
public const string LogoRouteName = nameof(BackOfficeGraphicsController) + "." + nameof(Logo);
public const string LogoAlternativeRouteName = nameof(BackOfficeGraphicsController) + "." + nameof(LogoAlternative);
public const string LoginBackGroundRouteName = nameof(BackOfficeGraphicsController) + "." + nameof(LoginBackground);
public const string LoginLogoRouteName = nameof(BackOfficeGraphicsController) + "." + nameof(LoginLogo);
public const string LoginLogoAlternativeRouteName = nameof(BackOfficeGraphicsController) + "." + nameof(LoginLogoAlternative);
@@ -44,6 +45,11 @@ public class BackOfficeGraphicsController : Controller
[MapToApiVersion("1.0")]
public IActionResult Logo() => HandleFileRequest(_contentSettings.Value.BackOfficeLogo);
[HttpGet("logo-alternative", Name = LogoAlternativeRouteName)]
[AllowAnonymous]
[MapToApiVersion("1.0")]
public IActionResult LogoAlternative() => HandleFileRequest(_contentSettings.Value.BackOfficeLogoAlternative);
[HttpGet("login-logo", Name = LoginLogoRouteName)]
[AllowAnonymous]
[MapToApiVersion("1.0")]
@@ -1,12 +1,13 @@
using System.Diagnostics;
using System.Diagnostics;
using System.Linq.Expressions;
using System.Runtime.Versioning;
using System.Text;
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
using Umbraco.Cms.Api.Management.ViewModels.Template.Query;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.DependencyInjection;
using Umbraco.Cms.Core.Models.PublishedContent;
using Umbraco.Cms.Core.Models.TemplateQuery;
using Umbraco.Cms.Core.PublishedCache;
@@ -20,14 +21,47 @@ namespace Umbraco.Cms.Api.Management.Controllers.Template.Query;
public class ExecuteTemplateQueryController : TemplateQueryControllerBase
{
private readonly IPublishedContentQuery _publishedContentQuery;
private readonly IVariationContextAccessor _variationContextAccessor;
private readonly IPublishedValueFallback _publishedValueFallback;
private readonly IContentTypeService _contentTypeService;
private readonly IPublishedContentCache _contentCache;
private readonly IDocumentNavigationQueryService _documentNavigationQueryService;
private readonly IPublishedContentStatusFilteringService _publishedContentStatusFilteringService;
private static readonly string _indent = $"{Environment.NewLine} ";
[ActivatorUtilitiesConstructor]
public ExecuteTemplateQueryController(
IPublishedContentQuery publishedContentQuery,
IPublishedValueFallback publishedValueFallback,
IContentTypeService contentTypeService,
IDocumentNavigationQueryService documentNavigationQueryService,
IPublishedContentStatusFilteringService publishedContentStatusFilteringService)
{
_publishedContentQuery = publishedContentQuery;
_publishedValueFallback = publishedValueFallback;
_contentTypeService = contentTypeService;
_documentNavigationQueryService = documentNavigationQueryService;
_publishedContentStatusFilteringService = publishedContentStatusFilteringService;
}
[Obsolete("Please use the non-obsolete constructor. Will be removed in V17.")]
public ExecuteTemplateQueryController(
IPublishedContentQuery publishedContentQuery,
IVariationContextAccessor variationContextAccessor,
IPublishedValueFallback publishedValueFallback,
IContentTypeService contentTypeService,
IPublishedContentCache contentCache,
IDocumentNavigationQueryService documentNavigationQueryService,
IPublishedContentStatusFilteringService publishedContentStatusFilteringService)
: this(
publishedContentQuery,
publishedValueFallback,
contentTypeService,
documentNavigationQueryService,
publishedContentStatusFilteringService)
{
}
[Obsolete("Please use the non-obsolete constructor. Will be removed in V17.")]
public ExecuteTemplateQueryController(
IPublishedContentQuery publishedContentQuery,
IVariationContextAccessor variationContextAccessor,
@@ -35,13 +69,13 @@ public class ExecuteTemplateQueryController : TemplateQueryControllerBase
IContentTypeService contentTypeService,
IPublishedContentCache contentCache,
IDocumentNavigationQueryService documentNavigationQueryService)
: this(
publishedContentQuery,
publishedValueFallback,
contentTypeService,
documentNavigationQueryService,
StaticServiceProvider.Instance.GetRequiredService<IPublishedContentStatusFilteringService>())
{
_publishedContentQuery = publishedContentQuery;
_variationContextAccessor = variationContextAccessor;
_publishedValueFallback = publishedValueFallback;
_contentTypeService = contentTypeService;
_contentCache = contentCache;
_documentNavigationQueryService = documentNavigationQueryService;
}
[HttpPost("execute")]
@@ -98,7 +132,7 @@ public class ExecuteTemplateQueryController : TemplateQueryControllerBase
if (model.RootDocument?.Id is not null)
{
rootContent = _publishedContentQuery.Content(model.RootDocument.Id);
queryExpression.Append($"Umbraco.Content(Guid.Parse(\"{model.RootDocument.Id}\"))");
queryExpression.Append("Umbraco.Content(Guid.Parse(\"").Append(model.RootDocument.Id).Append("\"))");
}
else
{
@@ -115,16 +149,16 @@ public class ExecuteTemplateQueryController : TemplateQueryControllerBase
if (model.DocumentTypeAlias.IsNullOrWhiteSpace() == false)
{
queryExpression.Append($".ChildrenOfType(\"{model.DocumentTypeAlias}\")");
queryExpression.Append(".ChildrenOfType(\"").Append(model.DocumentTypeAlias).Append("\")");
return rootContent == null
? Enumerable.Empty<IPublishedContent>()
: rootContent.ChildrenOfType(_variationContextAccessor, _contentCache, _documentNavigationQueryService, model.DocumentTypeAlias);
: rootContent.ChildrenOfType(_documentNavigationQueryService, _publishedContentStatusFilteringService, model.DocumentTypeAlias);
}
queryExpression.Append(".Children()");
return rootContent == null
? Enumerable.Empty<IPublishedContent>()
: rootContent.Children(_variationContextAccessor, _contentCache, _documentNavigationQueryService);
: rootContent.Children(_documentNavigationQueryService, _publishedContentStatusFilteringService);
}
private IEnumerable<IPublishedContent> ApplyFiltering(IEnumerable<TemplateQueryExecuteFilterPresentationModel>? filters, IEnumerable<IPublishedContent> contentQuery, StringBuilder queryExpression)
@@ -176,7 +210,7 @@ public class ExecuteTemplateQueryController : TemplateQueryControllerBase
//for review - this uses a tonized query rather then the normal linq query.
contentQuery = contentQuery.Where(operation.Compile());
queryExpression.Append(_indent);
queryExpression.Append($".Where({operation})");
queryExpression.Append(".Where(").Append(operation).Append(')');
}
return contentQuery;
@@ -220,7 +254,7 @@ public class ExecuteTemplateQueryController : TemplateQueryControllerBase
return contentQuery;
}
private IEnumerable<IPublishedContent> ApplyPaging(int take, IEnumerable<IPublishedContent> contentQuery, StringBuilder queryExpression)
private static IEnumerable<IPublishedContent> ApplyPaging(int take, IEnumerable<IPublishedContent> contentQuery, StringBuilder queryExpression)
{
if (take <= 0)
{
@@ -229,7 +263,7 @@ public class ExecuteTemplateQueryController : TemplateQueryControllerBase
contentQuery = contentQuery.Take(take);
queryExpression.Append(_indent);
queryExpression.Append($".Take({take})");
queryExpression.Append(".Take(").Append(take).Append(')');
return contentQuery;
}
@@ -1,4 +1,4 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Core.Security.OperationStatus;
@@ -20,7 +20,7 @@ public abstract class ClientCredentialsUserControllerBase : UserControllerBase
.Build()),
BackOfficeUserClientCredentialsOperationStatus.InvalidClientId => BadRequest(problemDetailsBuilder
.WithTitle("Invalid client ID")
.WithDetail("The specified client ID is invalid. A valid client ID can only contain [a-z], [A-Z], [0-9], and [-._~]. Furthermore, including the prefix it cannot be longer than 255 characters.")
.WithDetail("The specified client ID is invalid. A valid client ID can only contain [a-z], [A-Z], [0-9], and [-._~]. Furthermore, including the prefix it cannot be longer than 100 characters.")
.Build()),
_ => StatusCode(StatusCodes.Status500InternalServerError, problemDetailsBuilder
.WithTitle("Unknown client credentials operation status.")
@@ -35,6 +35,10 @@ public abstract class UserOrCurrentUserControllerBase : ManagementApiControllerB
.WithTitle("Email Cannot be changed")
.WithDetail("Local login is disabled, so the email cannot be changed.")
.Build()),
UserOperationStatus.InvalidUserName => BadRequest(problemDetailsBuilder
.WithTitle("Invalid username")
.WithDetail("The username contains one or more invalid characters.")
.Build()),
UserOperationStatus.DuplicateUserName => BadRequest(problemDetailsBuilder
.WithTitle("Duplicate Username")
.WithDetail("The username is already in use.")
@@ -34,7 +34,7 @@ public class AllWebhookController : WebhookControllerBase
var viewModel = new PagedViewModel<WebhookResponseModel>
{
Total = result.Total,
Items = webhooks.Select(x => _webhookPresentationFactory.CreateResponseModel(x)),
Items = webhooks.Select(_webhookPresentationFactory.CreateResponseModel),
};
return Ok(viewModel);
@@ -1,8 +1,8 @@
using Asp.Versioning;
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Common.ViewModels.Pagination;
using Umbraco.Cms.Api.Management.Factories;
using Umbraco.Cms.Api.Management.ViewModels.Webhook;
using Umbraco.Cms.Api.Management.ViewModels.Webhook.Logs;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Services;
@@ -23,12 +23,11 @@ public class AllWebhookLogController : WebhookLogControllerBase
[HttpGet("logs")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(WebhookResponseModel), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
[ProducesResponseType(typeof(PagedViewModel<WebhookLogResponseModel>), StatusCodes.Status200OK)]
public async Task<IActionResult> Logs(CancellationToken cancellationToken, int skip = 0, int take = 100)
{
PagedModel<WebhookLog> logs = await _webhookLogService.Get(skip, take);
IEnumerable<WebhookLogResponseModel> logResponseModels = logs.Items.Select(x => _webhookPresentationFactory.CreateResponseModel(x));
return Ok(logResponseModels);
PagedViewModel<WebhookLogResponseModel> viewModel = CreatePagedWebhookLogResponseModel(logs, _webhookPresentationFactory);
return Ok(viewModel);
}
}
@@ -0,0 +1,33 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Common.ViewModels.Pagination;
using Umbraco.Cms.Api.Management.Factories;
using Umbraco.Cms.Api.Management.ViewModels.Webhook.Logs;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Services;
namespace Umbraco.Cms.Api.Management.Controllers.Webhook.Logs;
[ApiVersion("1.0")]
public class WebhookLogController : WebhookLogControllerBase
{
private readonly IWebhookLogService _webhookLogService;
private readonly IWebhookPresentationFactory _webhookPresentationFactory;
public WebhookLogController(IWebhookLogService webhookLogService, IWebhookPresentationFactory webhookPresentationFactory)
{
_webhookLogService = webhookLogService;
_webhookPresentationFactory = webhookPresentationFactory;
}
[HttpGet("{id:guid}/logs")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(PagedViewModel<WebhookLogResponseModel>), StatusCodes.Status200OK)]
public async Task<IActionResult> Logs(CancellationToken cancellationToken, Guid id, int skip = 0, int take = 100)
{
PagedModel<WebhookLog> logs = await _webhookLogService.Get(id, skip, take);
PagedViewModel<WebhookLogResponseModel> viewModel = CreatePagedWebhookLogResponseModel(logs, _webhookPresentationFactory);
return Ok(viewModel);
}
}
@@ -1,9 +1,26 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Common.ViewModels.Pagination;
using Umbraco.Cms.Api.Management.Factories;
using Umbraco.Cms.Api.Management.Routing;
using Umbraco.Cms.Api.Management.ViewModels.Webhook.Logs;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Models;
namespace Umbraco.Cms.Api.Management.Controllers.Webhook.Logs;
[VersionedApiBackOfficeRoute($"{Constants.UdiEntityType.Webhook}")]
[ApiExplorerSettings(GroupName = "Webhook")]
public class WebhookLogControllerBase : ManagementApiControllerBase;
public class WebhookLogControllerBase : ManagementApiControllerBase
{
protected PagedViewModel<WebhookLogResponseModel> CreatePagedWebhookLogResponseModel(PagedModel<WebhookLog> logs, IWebhookPresentationFactory webhookPresentationFactory)
{
WebhookLogResponseModel[] logResponseModels = logs.Items.Select(webhookPresentationFactory.CreateResponseModel).ToArray();
return new PagedViewModel<WebhookLogResponseModel>
{
Total = logs.Total,
Items = logResponseModels,
};
}
}
@@ -1,4 +1,4 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection;
using Umbraco.Cms.Api.Management.Factories;
using Umbraco.Cms.Api.Management.Mapping.Document;
using Umbraco.Cms.Core.DependencyInjection;
@@ -18,6 +18,7 @@ internal static class DocumentBuilderExtensions
builder.Services.AddTransient<IPublicAccessPresentationFactory, PublicAccessPresentationFactory>();
builder.Services.AddTransient<IDomainPresentationFactory, DomainPresentationFactory>();
builder.Services.AddTransient<IDocumentVersionPresentationFactory, DocumentVersionPresentationFactory>();
builder.Services.AddTransient<IDocumentCollectionPresentationFactory, DocumentCollectionPresentationFactory>();
builder.WithCollectionBuilder<MapDefinitionCollectionBuilder>()
.Add<DocumentMapDefinition>()
@@ -1,4 +1,4 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection;
using Umbraco.Cms.Api.Management.Factories;
using Umbraco.Cms.Api.Management.Mapping.Media;
using Umbraco.Cms.Api.Management.Routing;
@@ -18,6 +18,7 @@ internal static class MediaBuilderExtensions
builder.Services.AddTransient<IMediaUrlFactory, MediaUrlFactory>();
builder.Services.AddTransient<IReziseImageUrlFactory, ReziseImageUrlFactory>();
builder.Services.AddScoped<IAbsoluteUrlBuilder, DefaultAbsoluteUrlBuilder>();
builder.Services.AddTransient<IMediaCollectionPresentationFactory, MediaCollectionPresentationFactory>();
builder.WithCollectionBuilder<MapDefinitionCollectionBuilder>().Add<MediaMapDefinition>();
@@ -64,7 +64,6 @@ public static partial class UmbracoBuilderExtensions
.AddWebhooks()
.AddServer()
.AddCorsPolicy()
.AddWebhooks()
.AddPreview()
.AddServerEvents()
.AddPasswordConfiguration()
@@ -0,0 +1,43 @@
using Umbraco.Cms.Api.Management.ViewModels.Content;
using Umbraco.Cms.Core.Mapping;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Models.ContentEditing;
using Umbraco.Cms.Core.PropertyEditors;
using Umbraco.Extensions;
namespace Umbraco.Cms.Api.Management.Factories;
public abstract class ContentCollectionPresentationFactory<TContent, TCollectionResponseModel, TValueResponseModelBase, TVariantResponseModel>
where TContent : class, IContentBase
where TCollectionResponseModel : ContentResponseModelBase<TValueResponseModelBase, TVariantResponseModel>
where TValueResponseModelBase : ValueResponseModelBase
where TVariantResponseModel : VariantResponseModelBase
{
private readonly IUmbracoMapper _mapper;
protected ContentCollectionPresentationFactory(IUmbracoMapper mapper) => _mapper = mapper;
public async Task<List<TCollectionResponseModel>> CreateCollectionModelAsync(ListViewPagedModel<TContent> contentCollection)
{
PagedModel<TContent> collectionItemsResult = contentCollection.Items;
ListViewConfiguration collectionConfiguration = contentCollection.ListViewConfiguration;
var collectionPropertyAliases = collectionConfiguration
.IncludeProperties
.Select(p => p.Alias)
.WhereNotNull()
.ToArray();
List<TCollectionResponseModel> collectionResponseModels =
_mapper.MapEnumerable<TContent, TCollectionResponseModel>(collectionItemsResult.Items, context =>
{
context.SetIncludedProperties(collectionPropertyAliases);
});
await SetUnmappedProperties(contentCollection, collectionResponseModels);
return collectionResponseModels;
}
protected virtual Task SetUnmappedProperties(ListViewPagedModel<TContent> contentCollection, List<TCollectionResponseModel> collectionResponseModels) => Task.CompletedTask;
}
@@ -0,0 +1,34 @@
using Umbraco.Cms.Api.Management.ViewModels.Document;
using Umbraco.Cms.Api.Management.ViewModels.Document.Collection;
using Umbraco.Cms.Core.Mapping;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Services;
namespace Umbraco.Cms.Api.Management.Factories;
public class DocumentCollectionPresentationFactory : ContentCollectionPresentationFactory<IContent, DocumentCollectionResponseModel, DocumentValueResponseModel, DocumentVariantResponseModel>, IDocumentCollectionPresentationFactory
{
private readonly IPublicAccessService _publicAccessService;
public DocumentCollectionPresentationFactory(IUmbracoMapper mapper, IPublicAccessService publicAccessService)
: base(mapper)
{
_publicAccessService = publicAccessService;
}
protected override Task SetUnmappedProperties(ListViewPagedModel<IContent> contentCollection, List<DocumentCollectionResponseModel> collectionResponseModels)
{
foreach (DocumentCollectionResponseModel item in collectionResponseModels)
{
IContent? matchingContentItem = contentCollection.Items.Items.FirstOrDefault(x => x.Key == item.Id);
if (matchingContentItem is null)
{
continue;
}
item.IsProtected = _publicAccessService.IsProtected(matchingContentItem).Success;
}
return Task.CompletedTask;
}
}
@@ -1,4 +1,4 @@
using Umbraco.Cms.Api.Management.Mapping.Content;
using Umbraco.Cms.Api.Management.Mapping.Content;
using Umbraco.Cms.Api.Management.ViewModels;
using Umbraco.Cms.Api.Management.ViewModels.Document;
using Umbraco.Cms.Api.Management.ViewModels.Document.Item;
@@ -1,31 +1,38 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Umbraco.Cms.Api.Management.ViewModels.Document;
using Umbraco.Cms.Core.DependencyInjection;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Models.PublishedContent;
using Umbraco.Cms.Core.PublishedCache;
using Umbraco.Cms.Core.Routing;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Services.Navigation;
using Umbraco.Cms.Core.Web;
using Umbraco.Extensions;
namespace Umbraco.Cms.Api.Management.Factories;
public class DocumentUrlFactory : IDocumentUrlFactory
{
private readonly IDocumentUrlService _documentUrlService;
private readonly IPublishedUrlInfoProvider _publishedUrlInfoProvider;
[Obsolete("Use the constructor that takes all dependencies, scheduled for removal in v16")]
public DocumentUrlFactory(IDocumentUrlService documentUrlService)
: this(StaticServiceProvider.Instance.GetRequiredService<IPublishedUrlInfoProvider>())
{
_documentUrlService = documentUrlService;
}
[Obsolete("Use the constructor that takes all dependencies, scheduled for removal in v16")]
public DocumentUrlFactory(IDocumentUrlService documentUrlService, IPublishedUrlInfoProvider publishedUrlInfoProvider)
: this(publishedUrlInfoProvider)
{
}
public DocumentUrlFactory(IPublishedUrlInfoProvider publishedUrlInfoProvider)
{
_publishedUrlInfoProvider = publishedUrlInfoProvider;
}
public async Task<IEnumerable<DocumentUrlInfo>> CreateUrlsAsync(IContent content)
{
IEnumerable<UrlInfo> urlInfos = await _documentUrlService.ListUrlsAsync(content.Key);
ISet<UrlInfo> urlInfos = await _publishedUrlInfoProvider.GetAllAsync(content);
return urlInfos
.Where(urlInfo => urlInfo.IsUrl)
@@ -7,6 +7,7 @@ using Umbraco.Cms.Core.Mapping;
namespace Umbraco.Cms.Api.Management.Factories;
// TODO (V16): Make internal sealed.
public class HealthCheckGroupPresentationFactory : IHealthCheckGroupPresentationFactory
{
private readonly HealthChecksSettings _healthChecksSettings;
@@ -40,13 +41,21 @@ public class HealthCheckGroupPresentationFactory : IHealthCheckGroupPresentation
return groups;
}
[Obsolete("Use CreateHealthCheckGroupWithResultViewModelAsync instead. Will be removed in v17.")]
public HealthCheckGroupWithResultResponseModel CreateHealthCheckGroupWithResultViewModel(IGrouping<string?, HealthCheck> healthCheckGroup)
=> CreateHealthCheckGroupWithResultViewModelAsync(healthCheckGroup).GetAwaiter().GetResult();
[Obsolete("Use CreateHealthCheckGroupWithResultViewModelAsync instead. Will be removed in v17.")]
public HealthCheckWithResultPresentationModel CreateHealthCheckWithResultViewModel(HealthCheck healthCheck) =>
CreateHealthCheckWithResultViewModelAsync(healthCheck).GetAwaiter().GetResult();
public async Task<HealthCheckGroupWithResultResponseModel> CreateHealthCheckGroupWithResultViewModelAsync(IGrouping<string?, HealthCheck> healthCheckGroup)
{
var healthChecks = new List<HealthCheckWithResultPresentationModel>();
foreach (HealthCheck healthCheck in healthCheckGroup)
{
healthChecks.Add(CreateHealthCheckWithResultViewModel(healthCheck));
healthChecks.Add(await CreateHealthCheckWithResultViewModelAsync(healthCheck));
}
var healthCheckGroupViewModel = new HealthCheckGroupWithResultResponseModel
@@ -57,11 +66,11 @@ public class HealthCheckGroupPresentationFactory : IHealthCheckGroupPresentation
return healthCheckGroupViewModel;
}
public HealthCheckWithResultPresentationModel CreateHealthCheckWithResultViewModel(HealthCheck healthCheck)
public async Task<HealthCheckWithResultPresentationModel> CreateHealthCheckWithResultViewModelAsync(HealthCheck healthCheck)
{
_logger.LogDebug($"Running health check: {healthCheck.Name}");
IEnumerable<HealthCheckStatus> results = healthCheck.GetStatus().Result;
IEnumerable<HealthCheckStatus> results = await healthCheck.GetStatusAsync();
var healthCheckViewModel = new HealthCheckWithResultPresentationModel
{
@@ -0,0 +1,14 @@
using Umbraco.Cms.Api.Management.ViewModels.Content;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Models.ContentEditing;
namespace Umbraco.Cms.Api.Management.Factories;
public interface IContentCollectionPresentationFactory<TContent, TCollectionResponseModel, TValueResponseModelBase, TVariantResponseModel>
where TContent : class, IContentBase
where TCollectionResponseModel : ContentResponseModelBase<TValueResponseModelBase, TVariantResponseModel>
where TValueResponseModelBase : ValueResponseModelBase
where TVariantResponseModel : VariantResponseModelBase
{
Task<List<TCollectionResponseModel>> CreateCollectionModelAsync(ListViewPagedModel<TContent> content);
}
@@ -0,0 +1,9 @@
using Umbraco.Cms.Api.Management.ViewModels.Document;
using Umbraco.Cms.Api.Management.ViewModels.Document.Collection;
using Umbraco.Cms.Core.Models;
namespace Umbraco.Cms.Api.Management.Factories;
public interface IDocumentCollectionPresentationFactory : IContentCollectionPresentationFactory<IContent, DocumentCollectionResponseModel, DocumentValueResponseModel, DocumentVariantResponseModel>
{
}
@@ -1,4 +1,4 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection;
using Umbraco.Cms.Api.Management.ViewModels.Document;
using Umbraco.Cms.Api.Management.ViewModels.Document.Item;
using Umbraco.Cms.Api.Management.ViewModels.DocumentBlueprint.Item;
@@ -6,5 +6,6 @@ namespace Umbraco.Cms.Api.Management.Factories;
public interface IDocumentUrlFactory
{
Task<IEnumerable<DocumentUrlInfo>> CreateUrlsAsync(IContent content);
Task<IEnumerable<DocumentUrlInfoResponseModel>> CreateUrlSetsAsync(IEnumerable<IContent> contentItems);
}
@@ -7,7 +7,19 @@ public interface IHealthCheckGroupPresentationFactory
{
IEnumerable<IGrouping<string?, HealthCheck>> CreateGroupingFromHealthCheckCollection();
[Obsolete("Use CreateHealthCheckGroupWithResultViewModelAsync instead. Will be removed in v17.")]
HealthCheckGroupWithResultResponseModel CreateHealthCheckGroupWithResultViewModel(IGrouping<string?, HealthCheck> healthCheckGroup);
[Obsolete("Use CreateHealthCheckGroupWithResultViewModelAsync instead. Will be removed in v17.")]
HealthCheckWithResultPresentationModel CreateHealthCheckWithResultViewModel(HealthCheck healthCheck);
Task<HealthCheckGroupWithResultResponseModel> CreateHealthCheckGroupWithResultViewModelAsync(IGrouping<string?, HealthCheck> healthCheckGroup)
#pragma warning disable CS0618 // Type or member is obsolete
=> Task.FromResult(CreateHealthCheckGroupWithResultViewModel(healthCheckGroup));
#pragma warning restore CS0618 // Type or member is obsolete
Task<HealthCheckWithResultPresentationModel> CreateHealthCheckWithResultViewModelAsync(HealthCheck healthCheck)
#pragma warning disable CS0618 // Type or member is obsolete
=> Task.FromResult(CreateHealthCheckWithResultViewModel(healthCheck));
#pragma warning restore CS0618 // Type or member is obsolete
}
@@ -0,0 +1,9 @@
using Umbraco.Cms.Api.Management.ViewModels.Media;
using Umbraco.Cms.Api.Management.ViewModels.Media.Collection;
using Umbraco.Cms.Core.Models;
namespace Umbraco.Cms.Api.Management.Factories;
public interface IMediaCollectionPresentationFactory : IContentCollectionPresentationFactory<IMedia, MediaCollectionResponseModel, MediaValueResponseModel, MediaVariantResponseModel>
{
}
@@ -0,0 +1,14 @@
using Umbraco.Cms.Api.Management.ViewModels.Media;
using Umbraco.Cms.Api.Management.ViewModels.Media.Collection;
using Umbraco.Cms.Core.Mapping;
using Umbraco.Cms.Core.Models;
namespace Umbraco.Cms.Api.Management.Factories;
public class MediaCollectionPresentationFactory : ContentCollectionPresentationFactory<IMedia, MediaCollectionResponseModel, MediaValueResponseModel, MediaVariantResponseModel>, IMediaCollectionPresentationFactory
{
public MediaCollectionPresentationFactory(IUmbracoMapper mapper)
: base(mapper)
{
}
}
@@ -29,6 +29,8 @@ internal class WebhookPresentationFactory : IWebhookPresentationFactory
var target = new WebhookResponseModel
{
Events = webhook.Events.Select(Create).ToArray(),
Name = webhook.Name,
Description = webhook.Description,
Url = webhook.Url,
Enabled = webhook.Enabled,
Id = webhook.Key,
@@ -44,6 +46,8 @@ internal class WebhookPresentationFactory : IWebhookPresentationFactory
var target = new Webhook(webhookRequestModel.Url, webhookRequestModel.Enabled, webhookRequestModel.ContentTypeKeys, webhookRequestModel.Events, webhookRequestModel.Headers)
{
Key = webhookRequestModel.Id ?? Guid.NewGuid(),
Name = webhookRequestModel.Name,
Description = webhookRequestModel.Description,
};
return target;
}
@@ -53,6 +57,8 @@ internal class WebhookPresentationFactory : IWebhookPresentationFactory
var target = new Webhook(webhookRequestModel.Url, webhookRequestModel.Enabled, webhookRequestModel.ContentTypeKeys, webhookRequestModel.Events, webhookRequestModel.Headers)
{
Key = existingWebhookkey,
Name = webhookRequestModel.Name,
Description = webhookRequestModel.Description,
};
return target;
}
@@ -25,8 +25,8 @@ public abstract class ContentTypeMapDefinition<TContentType, TPropertyTypeModel,
{
Id = propertyType.Key,
SortOrder = propertyType.SortOrder,
Container = groupKeysByPropertyKeys.ContainsKey(propertyType.Key)
? new ReferenceByIdModel(groupKeysByPropertyKeys[propertyType.Key])
Container = groupKeysByPropertyKeys.TryGetValue(propertyType.Key, out Guid groupKey)
? new ReferenceByIdModel(groupKey)
: null,
Name = propertyType.Name,
Alias = propertyType.Alias,
@@ -1,4 +1,4 @@
using Umbraco.Cms.Api.Management.Mapping.Content;
using Umbraco.Cms.Api.Management.Mapping.Content;
using Umbraco.Cms.Api.Management.ViewModels.Document;
using Umbraco.Cms.Api.Management.ViewModels.Document.Collection;
using Umbraco.Cms.Api.Management.ViewModels.DocumentBlueprint;
@@ -16,8 +16,7 @@ public class DocumentMapDefinition : ContentMapDefinition<IContent, DocumentValu
private readonly CommonMapper _commonMapper;
public DocumentMapDefinition(PropertyEditorCollection propertyEditorCollection, CommonMapper commonMapper)
: base(propertyEditorCollection)
=> _commonMapper = commonMapper;
: base(propertyEditorCollection) => _commonMapper = commonMapper;
public void DefineMaps(IUmbracoMapper mapper)
{
@@ -68,7 +67,7 @@ public class DocumentMapDefinition : ContentMapDefinition<IContent, DocumentValu
target.IsTrashed = source.Trashed;
}
// Umbraco.Code.MapAll
// Umbraco.Code.MapAll -IsProtected
private void Map(IContent source, DocumentCollectionResponseModel target, MapperContext context)
{
target.Id = source.Key;
@@ -76,6 +75,7 @@ public class DocumentMapDefinition : ContentMapDefinition<IContent, DocumentValu
target.SortOrder = source.SortOrder;
target.Creator = _commonMapper.GetOwnerName(source, context);
target.Updater = _commonMapper.GetCreatorName(source, context);
target.IsTrashed = source.Trashed;
// If there's a set of property aliases specified in the collection configuration, we will check if the current property's
// value should be mapped. If it isn't one of the ones specified in 'includeProperties', we will just return the result
@@ -119,7 +119,10 @@ public class DocumentMapDefinition : ContentMapDefinition<IContent, DocumentValu
{
foreach (ContentSchedule schedule in source.FullSchedule)
{
DocumentVariantResponseModel? variant = target.Variants.FirstOrDefault(v => v.Culture == schedule.Culture || (v.Culture.IsNullOrWhiteSpace() && schedule.Culture.IsNullOrWhiteSpace()));
DocumentVariantResponseModel? variant = target.Variants
.FirstOrDefault(v =>
v.Culture == schedule.Culture ||
(IsInvariant(v.Culture) && IsInvariant(schedule.Culture)));
if (variant is null)
{
continue;
@@ -136,4 +139,6 @@ public class DocumentMapDefinition : ContentMapDefinition<IContent, DocumentValu
}
}
}
private static bool IsInvariant(string? culture) => culture.IsNullOrWhiteSpace() || culture == Core.Constants.System.InvariantCulture;
}
@@ -120,7 +120,7 @@ public class ItemTypeMapDefinition : IMapDefinition
// Umbraco.Code.MapAll
private static void Map(IWebhook source, WebhookItemResponseModel target, MapperContext context)
{
target.Name = string.Empty; //source.Name;
target.Name = source.Name ?? source.Url;
target.Url = source.Url;
target.Enabled = source.Enabled;
target.Events = string.Join(",", source.Events);
@@ -1,5 +1,4 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Extensions;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using Umbraco.Cms.Core;
@@ -15,15 +14,13 @@ namespace Umbraco.Cms.Api.Management.Middleware;
public class BackOfficeAuthorizationInitializationMiddleware : IMiddleware
{
private bool _firstBackOfficeRequest; // this only works because this is a singleton
private SemaphoreSlim _firstBackOfficeRequestLocker = new(1); // this only works because this is a singleton
private ISet<string> _knownHosts = new HashSet<string>(); // this only works because this is a singleton
private readonly UmbracoRequestPaths _umbracoRequestPaths;
private readonly IServiceProvider _serviceProvider;
private readonly IRuntimeState _runtimeState;
private readonly IOptions<GlobalSettings> _globalSettings;
private readonly IOptions<WebRoutingSettings> _webRoutingSettings;
private readonly IHostingEnvironment _hostingEnvironment;
private readonly WebRoutingSettings _webRoutingSettings;
[Obsolete("Use the non-obsolete constructor. This will be removed in Umbraco 16.")]
public BackOfficeAuthorizationInitializationMiddleware(
@@ -34,13 +31,11 @@ public class BackOfficeAuthorizationInitializationMiddleware : IMiddleware
umbracoRequestPaths,
serviceProvider,
runtimeState,
StaticServiceProvider.Instance.GetRequiredService<IOptions<GlobalSettings>>(),
StaticServiceProvider.Instance.GetRequiredService<IOptions<WebRoutingSettings>>(),
StaticServiceProvider.Instance.GetRequiredService<IHostingEnvironment>()
)
StaticServiceProvider.Instance.GetRequiredService<IOptions<WebRoutingSettings>>())
{
}
[Obsolete("Use the non-obsolete constructor. This will be removed in Umbraco 17.")]
public BackOfficeAuthorizationInitializationMiddleware(
UmbracoRequestPaths umbracoRequestPaths,
IServiceProvider serviceProvider,
@@ -48,13 +43,20 @@ public class BackOfficeAuthorizationInitializationMiddleware : IMiddleware
IOptions<GlobalSettings> globalSettings,
IOptions<WebRoutingSettings> webRoutingSettings,
IHostingEnvironment hostingEnvironment)
: this(umbracoRequestPaths, serviceProvider, runtimeState, webRoutingSettings)
{
}
public BackOfficeAuthorizationInitializationMiddleware(
UmbracoRequestPaths umbracoRequestPaths,
IServiceProvider serviceProvider,
IRuntimeState runtimeState,
IOptions<WebRoutingSettings> webRoutingSettings)
{
_umbracoRequestPaths = umbracoRequestPaths;
_serviceProvider = serviceProvider;
_runtimeState = runtimeState;
_globalSettings = globalSettings;
_webRoutingSettings = webRoutingSettings;
_hostingEnvironment = hostingEnvironment;
_webRoutingSettings = webRoutingSettings.Value;
}
public async Task InvokeAsync(HttpContext context, RequestDelegate next)
@@ -65,11 +67,6 @@ public class BackOfficeAuthorizationInitializationMiddleware : IMiddleware
private async Task InitializeBackOfficeAuthorizationOnceAsync(HttpContext context)
{
if (_firstBackOfficeRequest)
{
return;
}
// Install is okay without this, because we do not need a token to install,
// but upgrades do, so we need to execute for everything higher then or equal to upgrade.
if (_runtimeState.Level < RuntimeLevel.Upgrade)
@@ -77,25 +74,35 @@ public class BackOfficeAuthorizationInitializationMiddleware : IMiddleware
return;
}
if (_umbracoRequestPaths.IsBackOfficeRequest(context.Request.Path) == false)
{
return;
}
await _firstBackOfficeRequestLocker.WaitAsync();
if (_firstBackOfficeRequest == false)
if (_knownHosts.Add($"{context.Request.Scheme}://{context.Request.Host}") is false)
{
Uri? backOfficeUrl = string.IsNullOrWhiteSpace(_webRoutingSettings.Value.UmbracoApplicationUrl) is false
? new Uri($"{_webRoutingSettings.Value.UmbracoApplicationUrl.TrimEnd('/')}{_globalSettings.Value.GetBackOfficePath(_hostingEnvironment).EnsureStartsWith('/')}")
: null;
using IServiceScope scope = _serviceProvider.CreateScope();
IBackOfficeApplicationManager backOfficeApplicationManager = scope.ServiceProvider.GetRequiredService<IBackOfficeApplicationManager>();
await backOfficeApplicationManager.EnsureBackOfficeApplicationAsync(backOfficeUrl ?? new Uri(context.Request.GetDisplayUrl()));
_firstBackOfficeRequest = true;
return;
}
await _firstBackOfficeRequestLocker.WaitAsync();
// ensure we explicitly add UmbracoApplicationUrl if configured (https://github.com/umbraco/Umbraco-CMS/issues/16179)
if (_webRoutingSettings.UmbracoApplicationUrl.IsNullOrWhiteSpace() is false)
{
_knownHosts.Add(_webRoutingSettings.UmbracoApplicationUrl);
}
Uri[] backOfficeHosts = _knownHosts
.Select(host => Uri.TryCreate(host, UriKind.Absolute, out Uri? hostUri)
? hostUri
: null)
.WhereNotNull()
.ToArray();
using IServiceScope scope = _serviceProvider.CreateScope();
IBackOfficeApplicationManager backOfficeApplicationManager = scope.ServiceProvider.GetRequiredService<IBackOfficeApplicationManager>();
await backOfficeApplicationManager.EnsureBackOfficeApplicationAsync(backOfficeHosts);
_firstBackOfficeRequestLocker.Release();
}
}
File diff suppressed because it is too large Load Diff
@@ -1,4 +1,4 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.SwaggerGen;
@@ -59,7 +59,7 @@ public abstract class BackOfficeSecurityRequirementsOperationFilterBase : IOpera
{
operation.Responses.Add(StatusCodes.Status403Forbidden.ToString(), new OpenApiResponse()
{
Description = "The authenticated user do not have access to this resource"
Description = "The authenticated user does not have access to this resource"
});
}
}
@@ -32,7 +32,11 @@ public class BackOfficeApplicationManager : OpenIdDictApplicationManagerBase, IB
_authorizeCallbackLogoutPathName = securitySettings.Value.AuthorizeCallbackLogoutPathName;
}
[Obsolete("Please use the overload that allows for multiple back-office hosts. Will be removed in V17.")]
public async Task EnsureBackOfficeApplicationAsync(Uri backOfficeUrl, CancellationToken cancellationToken = default)
=> await EnsureBackOfficeApplicationAsync([backOfficeUrl], cancellationToken);
public async Task EnsureBackOfficeApplicationAsync(IEnumerable<Uri> backOfficeHosts, CancellationToken cancellationToken = default)
{
// Install is okay without this, because we do not need a token to install,
// but upgrades do, so we need to execute for everything higher then or equal to upgrade.
@@ -41,13 +45,14 @@ public class BackOfficeApplicationManager : OpenIdDictApplicationManagerBase, IB
return;
}
if (backOfficeUrl.IsAbsoluteUri is false)
Uri[] backOfficeHostsAsArray = backOfficeHosts as Uri[] ?? backOfficeHosts.ToArray();
if (backOfficeHostsAsArray.Any(url => url.IsAbsoluteUri) is false)
{
throw new ArgumentException($"Expected an absolute URL, got: {backOfficeUrl}", nameof(backOfficeUrl));
throw new ArgumentException($"Expected absolute URLs, got: {string.Join(", ", backOfficeHostsAsArray.Select(url => url.ToString()))}", nameof(backOfficeHosts));
}
await CreateOrUpdate(
BackofficeOpenIddictApplicationDescriptor(backOfficeUrl),
BackofficeOpenIddictApplicationDescriptor(backOfficeHostsAsArray),
cancellationToken);
if (_webHostEnvironment.IsProduction())
@@ -57,90 +62,22 @@ public class BackOfficeApplicationManager : OpenIdDictApplicationManagerBase, IB
}
else
{
var developerClientTimeOutValue = new GlobalSettings().TimeOut.ToString("c", CultureInfo.InvariantCulture);
await CreateOrUpdate(
new OpenIddictApplicationDescriptor
{
DisplayName = "Umbraco Swagger access",
ClientId = Constants.OAuthClientIds.Swagger,
RedirectUris =
{
CallbackUrlFor(backOfficeUrl, "/umbraco/swagger/oauth2-redirect.html")
},
ClientType = OpenIddictConstants.ClientTypes.Public,
Permissions =
{
OpenIddictConstants.Permissions.Endpoints.Authorization,
OpenIddictConstants.Permissions.Endpoints.Token,
OpenIddictConstants.Permissions.GrantTypes.AuthorizationCode,
OpenIddictConstants.Permissions.ResponseTypes.Code
},
Settings =
{
// use a fixed access token lifetime for tokens issued to the Swagger application.
[OpenIddictConstants.Settings.TokenLifetimes.AccessToken] = developerClientTimeOutValue
}
},
DeveloperOpenIddictApplicationDescriptor(
"Umbraco Swagger access",
Constants.OAuthClientIds.Swagger,
backOfficeHostsAsArray.Select(backOfficeUrl => CallbackUrlFor(backOfficeUrl, "/umbraco/swagger/oauth2-redirect.html")).ToArray()),
cancellationToken);
await CreateOrUpdate(
new OpenIddictApplicationDescriptor
{
DisplayName = "Umbraco Postman access",
ClientId = Constants.OAuthClientIds.Postman,
RedirectUris =
{
new Uri("https://oauth.pstmn.io/v1/callback"), new Uri("https://oauth.pstmn.io/v1/browser-callback")
},
ClientType = OpenIddictConstants.ClientTypes.Public,
Permissions =
{
OpenIddictConstants.Permissions.Endpoints.Authorization,
OpenIddictConstants.Permissions.Endpoints.Token,
OpenIddictConstants.Permissions.GrantTypes.AuthorizationCode,
OpenIddictConstants.Permissions.ResponseTypes.Code
},
Settings =
{
// use a fixed access token lifetime for tokens issued to the Postman application.
[OpenIddictConstants.Settings.TokenLifetimes.AccessToken] = developerClientTimeOutValue
}
},
DeveloperOpenIddictApplicationDescriptor(
"Umbraco Postman access",
Constants.OAuthClientIds.Postman,
[new Uri("https://oauth.pstmn.io/v1/callback"), new Uri("https://oauth.pstmn.io/v1/browser-callback")]),
cancellationToken);
}
}
public OpenIddictApplicationDescriptor BackofficeOpenIddictApplicationDescriptor(Uri backOfficeUrl)
{
Uri CallbackUrl(string path) => CallbackUrlFor(_backOfficeHost ?? backOfficeUrl, path);
return new OpenIddictApplicationDescriptor
{
DisplayName = "Umbraco back-office access",
ClientId = Constants.OAuthClientIds.BackOffice,
RedirectUris =
{
CallbackUrl(_authorizeCallbackPathName),
},
ClientType = OpenIddictConstants.ClientTypes.Public,
PostLogoutRedirectUris =
{
CallbackUrl(_authorizeCallbackPathName),
CallbackUrl(_authorizeCallbackLogoutPathName),
},
Permissions =
{
OpenIddictConstants.Permissions.Endpoints.Authorization,
OpenIddictConstants.Permissions.Endpoints.Token,
OpenIddictConstants.Permissions.Endpoints.EndSession,
OpenIddictConstants.Permissions.Endpoints.Revocation,
OpenIddictConstants.Permissions.GrantTypes.AuthorizationCode,
OpenIddictConstants.Permissions.GrantTypes.RefreshToken,
OpenIddictConstants.Permissions.ResponseTypes.Code,
},
};
}
public async Task EnsureBackOfficeClientCredentialsApplicationAsync(string clientId, string clientSecret, CancellationToken cancellationToken = default)
{
var applicationDescriptor = new OpenIddictApplicationDescriptor
@@ -163,5 +100,74 @@ public class BackOfficeApplicationManager : OpenIdDictApplicationManagerBase, IB
public async Task DeleteBackOfficeClientCredentialsApplicationAsync(string clientId, CancellationToken cancellationToken = default)
=> await Delete(clientId, cancellationToken);
[Obsolete("Do not use - for internal usage only. Will be made internal in V17.")]
public OpenIddictApplicationDescriptor BackofficeOpenIddictApplicationDescriptor(Uri backOfficeUrl)
=> BackofficeOpenIddictApplicationDescriptor([backOfficeUrl]);
internal OpenIddictApplicationDescriptor BackofficeOpenIddictApplicationDescriptor(Uri[] backOfficeHosts)
{
if (_backOfficeHost is not null)
{
backOfficeHosts = [_backOfficeHost];
}
var descriptor = new OpenIddictApplicationDescriptor
{
DisplayName = "Umbraco back-office access",
ClientId = Constants.OAuthClientIds.BackOffice,
ClientType = OpenIddictConstants.ClientTypes.Public,
Permissions =
{
OpenIddictConstants.Permissions.Endpoints.Authorization,
OpenIddictConstants.Permissions.Endpoints.Token,
OpenIddictConstants.Permissions.Endpoints.EndSession,
OpenIddictConstants.Permissions.Endpoints.Revocation,
OpenIddictConstants.Permissions.GrantTypes.AuthorizationCode,
OpenIddictConstants.Permissions.GrantTypes.RefreshToken,
OpenIddictConstants.Permissions.ResponseTypes.Code,
},
};
foreach (Uri backOfficeHost in backOfficeHosts)
{
descriptor.RedirectUris.Add(CallbackUrlFor(backOfficeHost, _authorizeCallbackPathName));
descriptor.PostLogoutRedirectUris.Add(CallbackUrlFor(backOfficeHost, _authorizeCallbackPathName));
descriptor.PostLogoutRedirectUris.Add(CallbackUrlFor(backOfficeHost, _authorizeCallbackLogoutPathName));
}
return descriptor;
}
internal OpenIddictApplicationDescriptor DeveloperOpenIddictApplicationDescriptor(string name, string clientId, Uri[] redirectUrls)
{
var developerClientTimeOutValue = new GlobalSettings().TimeOut.ToString("c", CultureInfo.InvariantCulture);
var descriptor = new OpenIddictApplicationDescriptor
{
DisplayName = name,
ClientId = clientId,
ClientType = OpenIddictConstants.ClientTypes.Public,
Permissions =
{
OpenIddictConstants.Permissions.Endpoints.Authorization,
OpenIddictConstants.Permissions.Endpoints.Token,
OpenIddictConstants.Permissions.GrantTypes.AuthorizationCode,
OpenIddictConstants.Permissions.ResponseTypes.Code
},
Settings =
{
// use a fixed access token lifetime for tokens issued to the developer applications.
[OpenIddictConstants.Settings.TokenLifetimes.AccessToken] = developerClientTimeOutValue
}
};
foreach (Uri redirectUrl in redirectUrls)
{
descriptor.RedirectUris.Add(redirectUrl);
}
return descriptor;
}
private static Uri CallbackUrlFor(Uri url, string relativePath) => new Uri($"{url.GetLeftPart(UriPartial.Authority)}/{relativePath.TrimStart(Constants.CharArrays.ForwardSlash)}");
}
@@ -1,4 +1,5 @@
using System.Reflection;
using System.Runtime.InteropServices;
using Umbraco.Cms.Api.Management.Controllers;
using Umbraco.Cms.Core.Composing;
using Umbraco.Cms.Core.Services;
@@ -19,7 +20,7 @@ public class ConflictingRouteService : IConflictingRouteService
public bool HasConflictingRoutes(out string controllerName)
{
var controllers = _typeLoader.GetTypes<ManagementApiControllerBase>().ToList();
foreach (Type controller in controllers)
foreach (Type controller in CollectionsMarshal.AsSpan(controllers))
{
Type[] potentialConflicting = controllers.Where(x => x.Name == controller.Name).ToArray();
if (potentialConflicting.Length > 1)
@@ -3,7 +3,7 @@
<Title>Umbraco CMS - Management API</Title>
<Description>Contains the presentation layer for the Umbraco CMS Management API.</Description>
</PropertyGroup>
<PropertyGroup>
<!--
TODO: Fix and remove overrides:
@@ -22,7 +22,7 @@
-->
<WarningsNotAsErrors>$(WarningsNotAsErrors),SA1117,SA1401,SA1134,CS0108,CS0618,CS9042,CS1998,CS8524,IDE0060,SA1649,CS0419,CS1573,CS1574</WarningsNotAsErrors>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="JsonPatch.Net" />
<PackageReference Include="Swashbuckle.AspNetCore" />
@@ -38,6 +38,9 @@
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
<_Parameter1>Umbraco.Tests.UnitTests</_Parameter1>
</AssemblyAttribute>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
<_Parameter1>Umbraco.Tests.Integration</_Parameter1>
</AssemblyAttribute>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
<_Parameter1>DynamicProxyGenAssembly2</_Parameter1>
</AssemblyAttribute>
@@ -7,5 +7,9 @@ public class DocumentCollectionResponseModel : ContentCollectionResponseModelBas
{
public DocumentTypeCollectionReferenceResponseModel DocumentType { get; set; } = new();
public bool IsTrashed { get; set; }
public bool IsProtected { get; set; }
public string? Updater { get; set; }
}
@@ -1,4 +1,4 @@
using Umbraco.Cms.Api.Management.ViewModels.Content;
using Umbraco.Cms.Api.Management.ViewModels.Content;
namespace Umbraco.Cms.Api.Management.ViewModels.Document;
@@ -1,4 +1,4 @@
using Umbraco.Cms.Api.Management.ViewModels.Content;
using Umbraco.Cms.Api.Management.ViewModels.Content;
using Umbraco.Cms.Api.Management.ViewModels.DocumentType;
using Umbraco.Cms.Api.Management.ViewModels.Item;
@@ -1,4 +1,4 @@
namespace Umbraco.Cms.Api.Management.ViewModels.Document;
namespace Umbraco.Cms.Api.Management.ViewModels.Document;
public class PublishDocumentWithDescendantsRequestModel
{
@@ -0,0 +1,6 @@
namespace Umbraco.Cms.Api.Management.ViewModels.PublishedCache;
public class RebuildStatusModel
{
public bool IsRebuilding { get; set; }
}
@@ -1,6 +1,8 @@
namespace Umbraco.Cms.Api.Management.ViewModels.TrackedReferences;
using Umbraco.Cms.Api.Common.OpenApi;
public interface IReferenceResponseModel
namespace Umbraco.Cms.Api.Management.ViewModels.TrackedReferences;
public interface IReferenceResponseModel : IOpenApiDiscriminator
{
public Guid Id { get; }
@@ -6,6 +6,10 @@ public class WebhookModelBase
{
public bool Enabled { get; set; } = true;
public string? Name { get; set; }
public string? Description { get; set; }
[Required]
public string Url { get; set; } = string.Empty;
@@ -4,7 +4,7 @@
<Description>Adds imaging support using ImageSharp/ImageSharp.Web version 2 to Umbraco CMS.</Description>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="SixLabors.ImageSharp" VersionOverride="[2.1.9, 3)" />
<PackageReference Include="SixLabors.ImageSharp" VersionOverride="[2.1.10, 3)" />
<PackageReference Include="SixLabors.ImageSharp.Web" VersionOverride="[2.0.2, 3)" />
</ItemGroup>
@@ -13,7 +13,7 @@ using Umbraco.Extensions;
namespace Umbraco.Cms.Persistence.EFCore.Locking;
internal class SqlServerEFCoreDistributedLockingMechanism<T> : IDistributedLockingMechanism
internal sealed class SqlServerEFCoreDistributedLockingMechanism<T> : IDistributedLockingMechanism
where T : DbContext
{
private ConnectionStrings _connectionStrings;
@@ -58,7 +58,7 @@ internal class SqlServerEFCoreDistributedLockingMechanism<T> : IDistributedLocki
return new SqlServerDistributedLock(this, lockId, DistributedLockType.WriteLock, obtainLockTimeout.Value);
}
private class SqlServerDistributedLock : IDistributedLock
private sealed class SqlServerDistributedLock : IDistributedLock
{
private readonly SqlServerEFCoreDistributedLockingMechanism<T> _parent;
private readonly TimeSpan _timeout;
@@ -13,7 +13,7 @@ using Umbraco.Extensions;
namespace Umbraco.Cms.Persistence.EFCore.Locking;
internal class SqliteEFCoreDistributedLockingMechanism<T> : IDistributedLockingMechanism
internal sealed class SqliteEFCoreDistributedLockingMechanism<T> : IDistributedLockingMechanism
where T : DbContext
{
private ConnectionStrings _connectionStrings;
@@ -55,7 +55,7 @@ internal class SqliteEFCoreDistributedLockingMechanism<T> : IDistributedLockingM
return new SqliteDistributedLock(this, lockId, DistributedLockType.WriteLock, obtainLockTimeout.Value);
}
private class SqliteDistributedLock : IDistributedLock
private sealed class SqliteDistributedLock : IDistributedLock
{
private readonly SqliteEFCoreDistributedLockingMechanism<T> _parent;
private readonly TimeSpan _timeout;
@@ -164,7 +164,7 @@ internal class SqliteEFCoreDistributedLockingMechanism<T> : IDistributedLockingM
});
}
private bool IsBusyOrLocked(SqliteException ex) =>
private static bool IsBusyOrLocked(SqliteException ex) =>
ex.SqliteErrorCode
is raw.SQLITE_BUSY
or raw.SQLITE_LOCKED
@@ -7,7 +7,7 @@ using Umbraco.Cms.Core.Scoping;
namespace Umbraco.Cms.Persistence.EFCore.Scoping;
internal class EFCoreDetachableScope<TDbContext> : EFCoreScope<TDbContext> where TDbContext : DbContext
internal sealed class EFCoreDetachableScope<TDbContext> : EFCoreScope<TDbContext> where TDbContext : DbContext
{
private readonly IEFCoreScopeAccessor<TDbContext> _efCoreScopeAccessor;
private readonly EFCoreScopeProvider<TDbContext> _efCoreScopeProvider;
@@ -2,7 +2,7 @@ using Microsoft.EntityFrameworkCore;
namespace Umbraco.Cms.Persistence.EFCore.Scoping;
internal class EFCoreScopeAccessor<TDbContext> : IEFCoreScopeAccessor<TDbContext> where TDbContext : DbContext
internal sealed class EFCoreScopeAccessor<TDbContext> : IEFCoreScopeAccessor<TDbContext> where TDbContext : DbContext
{
private readonly IAmbientEFCoreScopeStack<TDbContext> _ambientEfCoreScopeStack;
@@ -13,7 +13,7 @@ using IScopeProvider = Umbraco.Cms.Infrastructure.Scoping.IScopeProvider;
namespace Umbraco.Cms.Persistence.EFCore.Scoping;
internal class EFCoreScopeProvider<TDbContext> : IEFCoreScopeProvider<TDbContext> where TDbContext : DbContext
internal sealed class EFCoreScopeProvider<TDbContext> : IEFCoreScopeProvider<TDbContext> where TDbContext : DbContext
{
private readonly IAmbientEFCoreScopeStack<TDbContext> _ambientEfCoreScopeStack;
private readonly ILoggerFactory _loggerFactory;
@@ -2,7 +2,7 @@ using NPoco;
namespace Umbraco.Cms.Persistence.SqlServer.Dtos;
internal class ColumnInSchemaDto
internal sealed class ColumnInSchemaDto
{
[Column("TABLE_NAME")]
public string TableName { get; set; } = null!;
@@ -2,7 +2,7 @@ using NPoco;
namespace Umbraco.Cms.Persistence.SqlServer.Dtos;
internal class ConstraintPerColumnDto
internal sealed class ConstraintPerColumnDto
{
[Column("TABLE_NAME")]
public string TableName { get; set; } = null!;
@@ -2,7 +2,7 @@ using NPoco;
namespace Umbraco.Cms.Persistence.SqlServer.Dtos;
internal class ConstraintPerTableDto
internal sealed class ConstraintPerTableDto
{
[Column("TABLE_NAME")]
public string TableName { get; set; } = null!;
@@ -2,7 +2,7 @@ using NPoco;
namespace Umbraco.Cms.Persistence.SqlServer.Dtos;
internal class DefaultConstraintPerColumnDto
internal sealed class DefaultConstraintPerColumnDto
{
[Column("TABLE_NAME")]
public string TableName { get; set; } = null!;

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