Compare commits

..
741 Commits
Author SHA1 Message Date
20a4e475c8 Merge pull request from GHSA-h8wc-r4jh-mg7m
* Don't login after install

* Fail the install if database is not created

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
Co-authored-by: Nikolaj <nikolajlauridsen@protonmail.ch>
2023-07-13 06:18:34 +02:00
nikolajlauridsen 2a601ae0d0 Bump version 2023-07-13 06:17:34 +02:00
Nikolaj ba724ed97d Bump version to final 2023-06-27 14:15:13 +02:00
Bjarke Berg 2cbf44dd4c Updated login svg 2023-06-27 11:53:10 +02:00
Jacob Overgaard 941dc933fb package-lock sync 2023-06-27 10:04:23 +02:00
2c9d0b2cb1 Add create and update dates to Delivery API response (#14427)
Co-authored-by: Elitsa <elm@umbraco.dk>
2023-06-26 08:33:16 +03:00
Kenn JacobsenandGitHub e92ea34098 Remove content from public facing Examine indexes when it is made protected (#14415)
* Remove content from Examine indexes when it gets protected

* Remove backwards compat for discoverability

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

* Fix path in preview when getting by route

* Reintroduce path.length check

* Revert previous changes
2023-06-23 11:22:13 +02:00
Nikolaj 0f0c256beb Don't leak swagger out of delivery document 2023-06-22 11:38:00 +02:00
Kenn JacobsenandGitHub 1fb8ea0411 Return raw markdown in the Delivery API (#14429)
* Return raw markdown in the Delivery API

* Reflect markdown value converter changes in the unit tests
2023-06-22 10:48:45 +02:00
Kenn JacobsenandGitHub 0cdea6120b Add support for property value fallbacks in the delivery API (#14421)
* Add support for property value fallbacks in the delivery API

* Add dedicated tests for the IDeliveryApiPropertyValueConverter interface

* Rewrite for less impact and more streamlined with Razor output
2023-06-21 08:32:57 +02:00
nikolajlauridsen dcd400810c Bump version 2023-06-20 14:47:54 +02:00
dependabot[bot]andJacob Overgaard 9c1f912639 Bump socket.io-parser from 4.2.1 to 4.2.4 in /src/Umbraco.Web.UI.Client
Bumps [socket.io-parser](https://github.com/socketio/socket.io-parser) from 4.2.1 to 4.2.4.
- [Release notes](https://github.com/socketio/socket.io-parser/releases)
- [Changelog](https://github.com/socketio/socket.io-parser/blob/main/CHANGELOG.md)
- [Commits](https://github.com/socketio/socket.io-parser/compare/4.2.1...4.2.4)

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

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

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

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

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-20 13:23:56 +02:00
Bjarke BergandGitHub 54479c9538 Updated nuget packages to latest versions (#14419) 2023-06-20 12:21:16 +02:00
MoleandGitHub 446544c045 V12: Add deliver api information to detailed telemetry (#14418)
* Add deliver api information to detailed telemetry

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

* Add IEnumerable overloads to DistributedCacheExtensions

* Update handlers to use new IEnumerable overloads

* Move DistributedCacheExtensions to Core

* Restructure cache refreshers into folders

* Add IDistributedCacheNotificationHandler

* Rewrite DistributedCacheBinder into seperate IDistributedCacheNotificationHandler implementations

* Obsolete DistributedCacheBinder and use new IDistributedCacheHandler implementations

* Clean up ServerMessengerBase

* Ensure cache refreshers only process distinct values

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

* Suppress compatibility issues

* Remove DistributedCacheBinder and suppress compatibility issues

* Add ScopedNotificationPublisher<TNotificationHandler>

* Improve notification type lookup/enumeration

* Ensure INotificationAsyncHandler handles multiple notitications sequentially

* Minimize cache instruction JSON

* Chunk notifications by type to keep publish order

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

* update @microsoft/signalr to 7.0.7

* update ace editor to 1.22.1

* update jQuery to 3.7.0

* update nouislider to 15.7.1

* update tinymce to 6.5.1

* update spectrum-colorpicker2 to 2.0.10

* update build dependencies
2023-06-20 11:01:59 +02:00
4fb605c086 Delivery API: Add query params and headers to Swagger document (#14370)
* Adding query params documentation

* Adding headers

* Rename file

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

---------

Co-authored-by: kjac <kja@umbraco.dk>
2023-06-19 14:24:45 +02:00
Bjarne FyrstenborgandJacob Overgaard 78c8328501 Show SVG icons for toolbar in configuration of richtext editor (#14404)
* Load default icons to show them next to checkboxes in configuration of richtext editor

* More mapping of icons

* Fix vertical align items centered not reflected

* Wrap mapping in function

* Map a few more icons

* Cleanup and formatting

* Cleanup

* Cleanup

* Add period in description
2023-06-19 13:51:42 +02:00
9a5e1c437e V12/feature/enable trust server certificate from installer (#14361)
* Enable checkbox with Trust server certificate in installer

* Fix up behavioral change

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-06-12 10:58:40 +02:00
10631decb1 Update security stamps on logout (#14362)
Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-06-12 10:07:44 +02:00
Kenn JacobsenandGitHub cbf42bd91a Make the API versioning and Swagger config less intrusive (#14363) 2023-06-12 09:31:39 +02:00
Kenn JacobsenandGitHub 6b280bd165 Make the Delivery API JSON type info resolver un-sealed (#14368) 2023-06-12 07:58:35 +02:00
MoleandGitHub 45fd5d218b Use ComputeHMACAsync instead of ComputeHMAC in URL generator (#14364) 2023-06-09 09:20:07 +02:00
8b7094c8cf V12: use database when testing examine (#14360)
* Use databases for examine tests

* Use same schema for entire fixture

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-06-08 12:05:10 +02:00
Kenn JacobsenandGitHub ddade09b14 Fix broken name sorting in the Delivery API (#14350) 2023-06-08 10:59:29 +02:00
Bjarke Berg 96dc594269 Merge remote-tracking branch 'origin/v11/dev' into release/12.0
# Conflicts:
#	tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/IndexTest.cs
#	version.json
2023-06-08 08:37:30 +02:00
Bjarke Berg 8ae0c82e85 Merge remote-tracking branch 'origin/v10/dev' into v11/dev 2023-06-08 08:36:15 +02:00
nikolajlauridsen 599bfea496 Bump version 2023-06-06 13:52:53 +02:00
nikolajlauridsen a6bb637fab Add scopes to tests 2023-06-06 12:24:29 +02:00
MoleandGitHub 4744d711ed Use scopes in PackaginService (#14343) 2023-06-06 12:00:53 +02:00
Mole 2dd7d610da Update OpenIdDict (#14340) 2023-06-06 10:15:53 +02:00
MoleandGitHub b391fc50e9 Remove external login tokens before removing external logins (#14341) 2023-06-06 09:29:03 +02:00
809883f088 Support entirely unpublished content in preview mode (#14307)
* Support draft-only content in the Delivery API query

* Allow outputting "entirely unpublished" content

* Make the preview path explicit to avoid clashing endpoints

* Handle trailing slash setting for preview URLs

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

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

* Remove superfluous (and incorrect) unpublished route handling

* Make sure preview output includes routes for unpublished cultures

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

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

---------

Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com>
2023-06-05 12:00:25 +02:00
Nikolaj Geisle c65f22a1d6 Use hosting environment to get local temp path (#14335) 2023-06-05 10:57:39 +02:00
184cf9f26d Fix URL encoded paths for the item endpoint (#14311)
* Fix URL encoded paths for the item endpoint

* Sanity check accept-language headers before accepting them

---------

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

* Fix/improve nullability

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

* Set versionAssemblyName in umbracopackage template

* Use Assembly.Load instead of ITypeFinder

* Use AssemblyLoadContext to get asesmbly by name

* Add PackageId to package manifest

* Show ID on installed packages overview

* Fallback to package ID to get assembly version

* Include package ID in telemetry data

* Set id in umbracopackage template

* Add PackageId to PackageMigrationPlan

* Get version from package migration assembly

* Hide unknown package version

* Always use package name from manifest

* Use IPackagingService to return package telemety data

* Set versionAssemblyName in umbracopackage-rcl template

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

* Add unit test

* Add non-breaking and obsoletion

* Add compat suppressions
2023-05-31 08:46:30 +02:00
Ronald BarendseandGitHub 84a0cd8c09 Add VersionAssemblyName to package manifest (#14046)
* Add VersionAssemblyName to package manifest

* Fix/improve nullability

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

* Set versionAssemblyName in umbracopackage template

* Use Assembly.Load instead of ITypeFinder

* Use AssemblyLoadContext to get asesmbly by name

* Get version from package migration assembly

* Hide unknown package version

* Set versionAssemblyName in umbracopackage-rcl template
2023-05-30 15:47:36 +02:00
fcf477191f Delivery API: Adding support for "Contains" filters (#14289)
* Adding support for contains filters

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

* Fixed the merge from release/12.0

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

---------

Co-authored-by: kjac <kja@umbraco.dk>
2023-05-25 13:43:45 +02:00
Nikolaj 9ed54eb158 Fix version 2023-05-25 13:03:13 +02:00
Nikolaj c6d94b3fd4 Merge remote-tracking branch 'origin/release/11.4' into v11/dev 2023-05-25 12:59:24 +02:00
Kenn JacobsenandGitHub 53e0227c98 Fix the namespace for PagedModel (#14296)
* Fix the namespace for PagedModel

* Add compat suppressions
2023-05-25 11:27:37 +02:00
Jacob OvergaardandBjarke Berg 7f798bcc91 v12: add support for Node.js 18 (#14259)
* add .nvmrc to instruct NVM of preferred version

* update azure-pipelines.yml with node 18.16

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

* update lockfiles in accordance with node 18 (lockfileVersion: 3)
2023-05-25 11:19:03 +02:00
Nikolaj e52e98741e Fix integration tests 2023-05-25 08:54:38 +02:00
6bcec26db3 V10: Implement varying blocklist indexing (#14287)
* Implement available culture in Interface and base classes

* Add available cultures

* DI localizationService and use it

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

* Create implementations for old method

* Pass available cultures

* Pass localization service

* Create new method that takes available cultures

* Add ILocalizationService to DI

* implement missing method

* Add database for schema test

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

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2023-05-25 08:40:10 +02:00
Kenn JacobsenandGitHub 5ae984aca6 Empty filter and sort values should not be considered when executing queries (#14295) 2023-05-24 13:22:27 +02:00
Kenn Jacobsenandnikolajlauridsen 6a725f870a Ensure that blocks always open automatically when added to block list or block grid (#14294) 2023-05-24 10:23:05 +02:00
Kenn JacobsenandGitHub 315f08c55d Ensure that blocks always open automatically when added to block list or block grid (#14294) 2023-05-24 10:22:31 +02:00
nikolajlauridsen 3fa49c7a55 Bump version to non-rc 2023-05-24 08:09:25 +02:00
3cadd35d40 Start-item support in RTE markup (#14283)
* Append start item to RTE markup

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

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

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

* Fix version

* Revert incidentally changed version number by targeting wrong branch

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

---------

Co-authored-by: Nikolaj <nikolajlauridsen@protonmail.ch>
2023-05-24 08:02:42 +02:00
Bjarke Berg 7e1620cbc3 Merge remote-tracking branch 'origin/v10/dev' into v11/dev 2023-05-23 12:15:39 +02:00
Nikolaj 7776cded73 Bump version to next RC 2023-05-22 15:19:13 +02:00
459d664531 V12: Map |DataDirectory| to path in connectionString (#14278)
* Add Data directory as constants

* Use new constants instead of internal ones

* Replace data directory in connection string if its there

* Update src/Umbraco.Cms.Persistence.EFCore/Extensions/UmbracoEFCoreServiceCollectionExtensions.cs

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>
2023-05-22 12:44:52 +02:00
MoleandGitHub 1e6c220610 Downgrade OpenIdDict (#14279) 2023-05-22 12:29:16 +02:00
Dhanesh Kumar MjandSebastiaan Janssen 7d3c22b28a [Fix] Block editor labels showing Angular JS on first load. (#14143)
Co-authored-by: Dhanesh Kumar <“dhanesh.kumar@phases.io”>
(cherry picked from commit 58695b6e9f)
2023-05-19 11:27:01 +02:00
Nikolaj 867a8a4066 Bump version to next RC 2023-05-17 13:25:08 +02:00
Bjarke BergandGitHub a4202f352a Ignore macros completely in deliveryapi (#14262)
* Hack a fix for MNTP that saves content in configuration instead of document

* Ignore macro parsing in delivery api, instead of exploding
2023-05-17 11:03:27 +02:00
Kenn JacobsenandGitHub c5e524c9b9 Wrap RTE content in a dedicated model for future expansion (#14258) 2023-05-16 19:08:38 +02:00
c632908a51 Re-added the postmigration from the migration context (#14255)
* Re-added the postmigration from the migration context

* Minor cleanup

* Add executed migration contexts to the result object

---------

Co-authored-by: Nikolaj <nikolajlauridsen@protonmail.ch>
2023-05-16 14:28:30 +02:00
0548266d0f Check folder exist before trying to delete (#14249)
Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-05-15 16:09:36 +02:00
Bjarke BergandGitHub 27e5b55e05 Added OpenIddict dependencies for future usage (#14247) 2023-05-15 13:24:19 +02:00
Nikolaj e50a3d1340 Trust Test DB certificate 2023-05-15 12:43:13 +02:00
Nikolaj 79ae829ac7 Set version to rc1 2023-05-15 10:55:43 +02:00
e572dcfa2d Delivery API: Handle more unhappy paths when querying (#14245)
* Handle more unhappy paths

* Review comments

---------

Co-authored-by: kjac <kja@umbraco.dk>
2023-05-15 10:46:29 +02:00
Kenn JacobsenandGitHub b32b8c2265 Un-routable content should never be accessible in the delivery API (#14242) 2023-05-15 10:27:20 +02:00
Kenn JacobsenandGitHub 85d46c3e82 Merge local and global crops for MediaPicker3 (#14237) 2023-05-15 10:06:24 +02:00
Kenn JacobsenandGitHub 368e9f2f59 Fix delivery API cache level for media picker property editors (#14238) 2023-05-15 08:49:01 +02:00
Andreas ZerbstandGitHub 401fa7334b Fixed: an block grid editor accceptance test on the pipeline for v12 (#14240)
* The attribute we asserted on has been changed which failed our test. The test is updated to match with the correct url

* Updated so we use encodeURI instead of replacing the values in the path
2023-05-15 08:04:16 +02:00
Bjarke Berg 5df655d599 Unbreak breaking change 2023-05-15 07:58:43 +02:00
Bjarke Berg d48a8d7c75 Merge remote-tracking branch 'origin/v11/dev' into v12/dev
# Conflicts:
#	src/Umbraco.Cms.ManagementApi/ViewModels/Installer/InstallViewModel.cs
2023-05-15 07:57:45 +02:00
Bjarke Berg a29d63475c Merge remote-tracking branch 'origin/v10/dev' into v11/dev 2023-05-15 07:55:39 +02:00
Elitsa MarinovskaandGitHub 1a8dc32b02 Adding Unauthorized to ProducesResponseType for single-item endpoints (#14239) 2023-05-12 09:26:26 +02:00
487e85cacd Entity Framework Core Support (#14109)
* Add UmbracoEFCore project

* Add EFCore composer

* Add Locking Mechanisms

* Add scope interfaces

* Add excecute scalar extension method

* fix up query in locking mechanism

* Add scoping

* Add scoping

* Add test DbContext classes

* add locking test of EFCore

* Creat ScopedFileSystemsTests

* Add EFCoreScopeInfrastructureScopeLockTests

* Add EFCoreScopeInfrastructureScopeTests

* Add EFCoreScopeNotificationsTest.cs

* Add EFCoreScopeTest.cs

* Remake AddUmbracoEFCoreContext to use connection string

* Remove unused code from extension method

* Reference EFCore reference to Cms.csproj

* Remove unused parameter

* Dont have default implementation, breaking change instead

* Add compatability suppression file

* Updated EFCore packages

* Use timespan for timeout

* Allow overriding default EF Core actions

* Option lifetime needs to be singleton

* Use given timeout in database call

* dont use timespan.zero, use null instead

* Use variable timeout

* Update test to use locking mechanism

* Remove unneccesary duplicate code

* Change to catch proper exception number

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2023-05-12 09:25:19 +02:00
36fe2f7e49 V12: Remove test.only for acceptance tests (#14232)
* Remove test.only

* Try quick fix for test

* Fixed failing test so it now locates the correct class. Updated the locators aswell

---------

Co-authored-by: Nikolaj <nikolajlauridsen@protonmail.ch>
2023-05-11 15:02:52 +02:00
Kenn JacobsenandGitHub 06bd728c18 Only index content for the Delivery API when it is enabled (#14235) 2023-05-11 14:42:57 +02:00
Nikolaj GeisleandGitHub 8d4e55f8bb Enable ForceCreateDatabase for SqlServer (#14234) 2023-05-11 14:39:21 +02:00
Nikolaj GeisleandGitHub e4c03e0d4e V11: Obsolete action to publish (#14208)
* Add obsolete message to ActionToPublish

* Obsolete handler for ContentSentTOPublishNotifcation
2023-05-11 13:58:57 +02:00
36d72ac85c Fallback to detailed if not telemetry level not set (#14134)
Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-05-11 13:50:47 +02:00
02669e930c V12: Update dependencies to latest (#14204)
* Update dependencies to latest

* revert npoco back to 5.5.0

* Updated Npoco and Serilog

---------

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2023-05-11 13:32:14 +02:00
Kenn JacobsenandGitHub b7cf00ac5d Handle applied public access restrictions in the Delivery API content index (#14233)
* Automatically remove content from the delivery API content index when public access restrictions are applied

* Review changes
2023-05-11 11:19:34 +02:00
Ronald BarendseandGitHub b0d19bf9d2 v12: Rename V2 to Umbraco.Cms.Imaging.ImageSharp2 (#14223)
* Rename Umbraco.Cms.Imaging.ImageSharp.V2 to Umbraco.Cms.Imaging.ImageSharp2

* Rename Umbraco.Cms.Imaging.ImageSharp to Umbraco.Cms.Imaging.ImageSharp3

* Rename Umbraco.Cms.Imaging.ImageSharp3 back to Umbraco.Cms.Imaging.ImageSharp
2023-05-11 11:01:59 +02:00
Ronald BarendseandGitHub 27ae8bdba9 v12: Add HMAC image processing protection (#14181)
* Update to ImageSharp 2.1.0 and ImageSharp.Web 2.0.0-alpha.0.23

* Rename CachedNameLength to CacheHashLength and add CacheFolderDepth setting

* Replace PhysicalFileSystemProvider with WebRootImageProvider

* Support EXIF-orientation in image dimention extractor

* Remove virtual methods on FileProviderImageProvider

* Simplify FileInfoImageResolver

* Update to SixLabors.ImageSharp.Web 2.0.0-alpha.0.25 and remove custom providers

* Make CropWebProcessor EXIF orientation-aware

* Improve width/height sanitization

* Also use 'v' as cache buster value

* Add WebP to supported image file types

* Update to SixLabors.ImageSharp.Web 2.0.0-alpha.0.27 and fix test

* Fix rounding error and add test cases

* Update to newest and stable releases

* Move ImageSharpImageUrlGenerator to Umbraco.Web.Common

* Use IConfigureOptions to configure ImageSharp options

* Implement IEquatable on ImageUrlGenerationOptions classes

* Fix empty/null values in image URL generation and corresponding tests

* Use IsSupportedImageFormat extension method

* Remove unneeded reflection

* Add HMACSecretKey setting and add token when generating image URLs

* Ensure backoffice image URLs are generated by the server (and include a correct HMAC token)

* Abstract HMAC generation to IImageUrlTokenGenerator

* Change cache buster value to 'v' and use hexadecimal timestamp

* Update comments

* Fix backoffice thumbnail URL generation

* Update grid media thumbnail URL generation

* Remove breaking changes

* Strip unknown commands from image URL token

* Remove HMAC whitelisting possibility (not supported by ImageSharp)

* Update to SixLabors.ImageSharp 2.1.3

* Add comment to internal constructor

* Fix to support absolute image URLs

* Update to SixLabors.ImageSharp.Web 2.0.3-alpha.0.3

* Remove IImageUrlTokenGenerator and use ImageSharpRequestAuthorizationUtilities

* Move NuGet feed to config file

* Update to ImageSharp v3
2023-05-11 11:01:03 +02:00
Kenn JacobsenandGitHub f4ee0d027a Move all routing tokens (incl. API versioning) to Web.Common (#14231)
* Move all routing tokens (incl. API versioning) to Cms.Web.Common, so the site can start without adding the delivery API in Startup

* Fixed merge

* Fix backwards compat
2023-05-11 08:18:43 +02:00
f804c8c209 Handle culture variance and add more options for indexing fields (#14185)
* Handle culture variance and add more options for indexing fields

* Workaround for missing DB on install

* Add a document per language to the delivery API content index

* Filters and Selectors must be able to match multiple values (as OR)

* A few review changes

* Change TODO for a note

* Workaround for lazily resolved field value types in Examine

* Make removal tracking more granular to cover both single and all culture deletion

---------

Co-authored-by: Elitsa <elm@umbraco.dk>
2023-05-10 15:48:00 +02:00
Nikolaj GeisleandGitHub eb0c7e617e Unbreak IMigrationPlanExecutor.cs (#14225) 2023-05-10 15:23:00 +02:00
Nikolaj GeisleandGitHub b0b591821b V11: prevent currentuser resetting password without old password (#14189)
* Implement check for current user if no old password

* Add default implementation to avoid breaking change9
2023-05-10 14:55:06 +02:00
Kenn JacobsenandGitHub 2f7cb83462 IAppCache implementations should not cache null values (#14218)
* IAppCache implementations should not cache null values

* Add comment
2023-05-10 14:23:02 +02:00
b0f42a2c86 Move the built-in properties back to the delivery API media model + support property expansion for other media properties (#14224)
Co-authored-by: Elitsa <elm@umbraco.dk>
2023-05-10 14:04:42 +02:00
9187d92a2c Copied back swagger for delivery api from v13 implementation (#14222)
Co-authored-by: Nikolaj <nikolajlauridsen@protonmail.ch>
2023-05-10 13:29:45 +02:00
e3e6582715 Always use text elements in RTE JSON output (#14220)
* Always wrap text in #text elements for RTE JSON output

* Small cleanup

---------

Co-authored-by: Elitsa <elm@umbraco.dk>
2023-05-10 08:47:23 +02:00
7ed59f05cb Delivery API: Not Found response when the start-item in "Start-Item" header is invalid (#14217)
* Update comment

* Implement ValidateStartItemAttribute

* Implement StartItemHeaderHasValue() on IRequestStartItemProvider

* Fix case-sensitivity problem on url segment

* Change StartItemHeaderHasValue() to RequestedStartItem()

* Fix variant start-item header bug

* Rearranging attributes

* Revert to not explicitly get the culture from IRequestCultureService

---------

Co-authored-by: kjac <kja@umbraco.dk>
2023-05-10 08:05:57 +02:00
6f3cf6ead5 Migration needs to check for completed transitions before accessing (#14174)
* check for completed transitions before accessing target state

* upgrader should be happy with initial and final state being the same value - only an empty final state should throw

* refactor

* reduce complexity

* Don't check for successfull

* Add test that runs migration twice

---------

Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
2023-05-09 12:26:41 +02:00
MoleandGitHub 5e9ce916cf V12: Update ImageSharp V3 and Add Legacy V2 Project (#14216)
* Rename old imagesharp to v2

* Add Ronalds PR as imagesharp

* Ensure that we use V3 by default
2023-05-09 10:09:54 +02:00
Bjarke Berg 7ca6cb97d3 Merge remote-tracking branch 'origin/v12/dev' into v12/dev 2023-05-08 16:59:57 +02:00
Bjarke Berg aee358330d Merge remote-tracking branch 'origin/v11/dev' into v12/dev
# Conflicts:
#	src/Umbraco.Cms.ManagementApi/Controllers/ModelsBuilder/BuildModelsBuilderController.cs
#	src/Umbraco.Cms.ManagementApi/DependencyInjection/MappingBuilderExtensions.cs
#	src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Tabs/tabs.spec.ts
2023-05-08 16:57:26 +02:00
43e0dfc7c7 Delivery API: Make classes sealed (#14214)
* Make implementations sealed and internal if possible

* Remove usings

* Making some models sealed as well

* Making more models sealed

* Last model changes

* Un-seal ApiContentResponse

---------

Co-authored-by: kjac <kja@umbraco.dk>
2023-05-08 13:20:02 +02:00
Bjarke Berg fb11fc6bc4 Merge remote-tracking branch 'origin/v10/dev' into v11/dev
# Conflicts:
#	src/Umbraco.Web.UI.Client/package-lock.json
#	src/Umbraco.Web.UI.Client/package.json
2023-05-08 10:36:26 +02:00
8f8eeefd90 Delivery API: Fix default sorting when querying (#14207)
* Fix default sort for the query endpoint

* Revert changes in PathSortIndexer

* If no sort query option is provided, keep the index sorting as default

* Delete path sort and path sort indexer

---------

Co-authored-by: kjac <kja@umbraco.dk>
2023-05-08 09:34:43 +02:00
Elitsa MarinovskaandGitHub 83230d377c Handle unhappy paths for the multiple items endpoint (#14199) 2023-05-08 06:52:02 +02:00
Bjarke BergandGitHub 0f1c2f7022 Ensure no management api for v12 (#14197)
* Remove management api

* Remove actual files
2023-05-04 13:32:41 +02:00
Nikolaj b39525b881 Merge branch 'release/11.4' into v11/dev
# Conflicts:
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Tabs/tabs.spec.ts
2023-05-04 09:23:05 +02:00
Nikolaj 842f1f886f Use regex for class 2023-05-03 13:15:17 +02:00
Nikolaj a744cd465a Try quick fix for test 2023-05-03 13:13:39 +02:00
Nikolaj cc7798b343 Remove test.only 2023-05-03 12:13:34 +02:00
Nikolaj e7f07a881b Revert "Case-insensitive tag names with SQLite provider (#14012)"
This reverts commit bb7752c483.
2023-05-03 11:39:24 +02:00
Jacob Overgaard 3c5de5a321 Backoffice JS dependency updates (#14179)
* updates @babel/* to 7.21.4

* update @microsoft/signalr to 7.0.5

* update @umbraco-ui/uui to 1.2.1

* update ace editor to 1.18.0

* update all build dependencies to latest version

* update jquery to 3.6.4

* update spectrum-colorpicker2 to 2.0.10

* Add icon for "styles" alias (style select)

* update tinymce to 6.4.2

Read more here: https://www.tiny.cloud/docs/tinymce/6/6.4.1-release-notes/
2023-05-03 11:10:12 +02:00
Jacob Overgaard c2a550daf0 Fix: Form elements in thirdparty dashboard views get removed (#14152) 2023-05-03 11:09:29 +02:00
Jacob Overgaard c4d84e1c91 Fix: Form elements in thirdparty dashboard views get removed (#14152) 2023-05-03 11:09:11 +02:00
Jacob Overgaard 32b4627ee8 Fix: Form elements in thirdparty dashboard views get removed (#14152) 2023-05-03 11:08:54 +02:00
Nikolaj bcf7d907ed Merge remote-tracking branch 'origin/v11/dev' into release/11.4 2023-05-03 10:03:47 +02:00
Sebastiaan Janssen b3d580de31 Merge branch 'v11/dev' into contrib 2023-05-03 09:56:43 +02:00
Ronald BarendseandNikolaj 47ae6e4ee8 Add DynamicRequestCultureProviderBase and improve locking (#14064) 2023-05-03 09:49:55 +02:00
Jacob OvergaardandZeegaan aeb0251727 Backoffice JS dependency updates (#14179)
* updates @babel/* to 7.21.4

* update @microsoft/signalr to 7.0.5

* update @umbraco-ui/uui to 1.2.1

* update ace editor to 1.18.0

* update all build dependencies to latest version

* update jquery to 3.6.4

* update spectrum-colorpicker2 to 2.0.10

* Add icon for "styles" alias (style select)

* update tinymce to 6.4.2

Read more here: https://www.tiny.cloud/docs/tinymce/6/6.4.1-release-notes/
2023-05-03 08:21:27 +02:00
Jacob OvergaardandGitHub 99049c2c07 Backoffice JS dependency updates (#14179)
* updates @babel/* to 7.21.4

* update @microsoft/signalr to 7.0.5

* update @umbraco-ui/uui to 1.2.1

* update ace editor to 1.18.0

* update all build dependencies to latest version

* update jquery to 3.6.4

* update spectrum-colorpicker2 to 2.0.10

* Add icon for "styles" alias (style select)

* update tinymce to 6.4.2

Read more here: https://www.tiny.cloud/docs/tinymce/6/6.4.1-release-notes/
2023-05-03 08:10:32 +02:00
Anders BrohusandGitHub 7df5c9c212 Fixing danish typos (#14184)
* Fixed typo

* Fixed another typo

* Removed space from translation
2023-05-02 10:13:47 +01:00
Ronald BarendseandGitHub 3caa2a3ce2 Add DynamicRequestCultureProviderBase and improve locking (#14064) 2023-05-02 09:46:43 +02:00
367e110681 Move relation mapping (#14153)
Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-05-02 07:40:09 +02:00
a3160fe022 Move relation mapping (#14153)
Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-05-02 07:37:59 +02:00
2aa9ceab1a Add member system fields to ListView (#14069)
* Add member system fields to ListView

* Small fix

* Add sort options for new systemfield for members.

---------

Co-authored-by: Lucas Bach Bisgaard <lom@novicell.dk>
2023-04-28 16:37:22 +02:00
fc3f342906 Add sort handlers for create and update date (#14178)
* Add sort handlers for create and update date

* Make things sealed

* Update the field names

---------

Co-authored-by: Elitsa <elm@umbraco.dk>
2023-04-28 11:14:50 +02:00
376c0bf7ba Update the delivery API content index at un/publish (#14175)
* Update the delivery API content index at un/publish

* Make the query service use "itemId" instead of "id" when extracting GUIDs + only fetch that single field rather than all fields

* Simplify the code a little

* Making AncestorsSelectorIndexer sealed

---------

Co-authored-by: Elitsa <elm@umbraco.dk>
2023-04-28 09:46:28 +02:00
Elitsa MarinovskaandGitHub ca5c3c240a Delivery API: Apply start-item in the base querying request (#14168)
* Taking into account the start item when no "fetch" selector is present

* Fix spacing

* Get rid of extra DefaultSelect method

* Remove comment for default selector

* Apply default sorting directly in HandleSorting()

* Get rid of nesting conditional logic
2023-04-27 19:32:05 +02:00
d72eb23102 Handle unroutable published content (#14166)
Co-authored-by: Elitsa <elm@umbraco.dk>
2023-04-27 13:32:15 +02:00
d2a8068ca6 Filter out disallowed content types from the delivery API content index (#14156)
* Filter out disallowed content types from the delivery api content index

* Added .

* Allow children of disallowed content types in the index

---------

Co-authored-by: Elitsa <elm@umbraco.dk>
2023-04-27 10:30:30 +02:00
a0d325cfe0 Make delivery API indexers and handlers public (sealed) so they can be overridden by custom ones (#14160)
* Make delivery API indexers and handlers public (sealed) so they can be overridden by custom ones

* Making the rest of the indexers public (sealed)

---------

Co-authored-by: Elitsa <elm@umbraco.dk>
2023-04-26 15:13:26 +02:00
MoleandZeegaan d589115b67 Set culture variation when getting property types for indexing (#14167) 2023-04-26 15:01:35 +02:00
Bjarke Berg 4fcdcb4002 Merge remote-tracking branch 'origin/v11/dev' into v12/dev 2023-04-25 15:43:22 +02:00
Bjarke Berg a45f158d9e Merge remote-tracking branch 'origin/v11/dev' into v11/dev 2023-04-25 15:42:21 +02:00
Elitsa MarinovskaandNikolaj c33ec7ca55 Change state to publishing before handling ContentSavingNotification (#14114) 2023-04-25 15:10:13 +02:00
Michałandgeorgebid 0765a2ebbb Save and preview translation. 2023-04-25 14:05:25 +01:00
7e49493c8c V12: Reset cache on migrating (#14133)
* Reset cache when migrating

* Manually delete cache file

* Rewrite migration to delete files

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-04-25 14:50:17 +02:00
Bjarke Berg c85a6274f8 Merge remote-tracking branch 'origin/v10/dev' into v11/dev
# Conflicts:
#	tests/Umbraco.Tests.AcceptanceTest/package-lock.json
#	tests/Umbraco.Tests.AcceptanceTest/package.json
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/BlockGridEditor/Document/BlockGridEditorInDocument.spec.ts
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Media/mediaFiles.spec.ts
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Media/mediaSection.spec.ts
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/ModelsBuilder/modelsbuilder.spec.ts
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/partialViews.spec.ts
2023-04-25 13:45:26 +02:00
7e117d2496 Delivery API content index handlers + unpublished/protected content handling (#14138)
* Introduce content index handlers for the Delivery API

* Do not add protected content to the index

* Re-introduce public collection builder extensions

* Add backwards compatible constructor to ConfigureIndexOptions

* Fix edge case for published children of unpublished parents

* Reduce number of hardcoded field names

* Fixed copy/paste comment

* Fix field definition type for date

* Do not add trashed items to the content index

* Don't expose protected content through the item endpoints

* Removing ReSharper comment

---------

Co-authored-by: Elitsa <elm@umbraco.dk>
2023-04-25 09:21:33 +02:00
Niels LyngsøandZeegaan 08bedd7c13 fix situation when config was not available. (#14148) 2023-04-25 09:14:37 +02:00
Richard OckerbyandGitHub eb1523cc81 Alter the datatype of the UmbracoKeyValue value column (#14085) 2023-04-24 12:38:21 +02:00
Niels LyngsøandGitHub 3b104bf256 fix situation when config was not available. (#14148) 2023-04-24 12:24:36 +02:00
Kenn JacobsenandGitHub 6760f72512 Fix the "disposed object" error when rendering RTE content as JSON (#14147) 2023-04-24 12:04:05 +02:00
Mark DrakeandGitHub 1436fe4e15 Edge Cases for Issue #13838: Hotkey Actions Triggered from Web Components (#14098) 2023-04-21 14:12:18 +02:00
Kenn JacobsenandGitHub ced4f84dfe JSON output from RTE - review changes (#14139) 2023-04-21 11:42:49 +02:00
Dhanesh Kumar MjandGitHub 00eab03d50 Save and Preview blank on second use #14052 (#14094) 2023-04-21 11:27:08 +02:00
Michael RobertsonandGitHub 2987dcb30e Add IModelsGenerator Interface (#12210) 2023-04-20 11:12:53 +02:00
c06e89af64 Content Delivery API (#14051)
* Add the core parts of the headless PoC

* Add Content API project (WIP - loads of TODOs and dupes that need to be fixed!)

* Rename the content API project and namespaces

* Fixed bad merge

* Rename everything "Headless" to "ContentApi" or "Api"

* Refactor Content + Media: Key => Id, Name not nullable

* Make Content API property return value types independent of datatype configuration

* Clean up refactorings

* First stab at an expansion strategy using content picker as example implementation

* Use named JSON options for content API serialization

* Proper inclusion and registration of the content API

* Introduce API media builder

* Make MNTP return API content/media depending on configuration (instead of links) and support output expansion

* Content API: Get by controllers (#13740)

* Adding ContentApiControllerBase

* Adding get by id and url controllers

* Change route of get all test controller

* Rename to ContentApiController

* Refactoring

* Removing test controller

* Content API: Add start-node header value to deal with url collisions (#13746)

* Use start-node header value to deal with url collisions

* Cleanup

* Rename "url" param to "path"

* Adding a start node service to get the start-node header value

* Trim '/' from both beginning and end

* Content API: Support Accept-Language header (#13831)

* Move the content API JSON type resolver to an appropriate namespace

* Add localization based on Accept-Language header

* Content API: Output expansion  (#13848)

* Implement request based output expansion strategy + expansion output cache at property level

* Slighty leaner implementation for default output expansion strategy

* Clarify the code a bit

* Fix bad merge

* Encapsulate content API dependencies in the DI

* Support multi-site and multi-culture routing + a little rename/refactor (#13882)

* Support multi-site and multi-culture routing + a little rename/refactor

* Make the by route controller handle root nodes

* Rename Url to Path in API content output

* Add a few comments for magic route creation

* Rename services from "Default" to "Noop"

* Ensure that Umbraco can boot without adding "AddContentApi()" to ConfigureServices

* Moved incorrectly placed media builder

* Fix API routes (#13915)

* Fix multi URL picker value converter trying to access disposed objects in edge cases

* Delivery API: Content routing and structure (#13984)

* Introduce content route instead of content path, rename and rework start item (previously start node) handling

* Strip out start node path in generated route path

* Make the start-item header take precedence over the request domain

* Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)

* Include umbraco properties (width, height, ...) in the Media Properties collection (#14023)

* Move umbraco properties (width, height, ...) to the Properties collection of the API Media model

* Don't output the umbracoFile property of media items

* Add content type deny list (#14025)

* Create a deny list of content types and utilize it for output generation

* Add unit tests

* Dedicated property cache level for Content API (#14027)

* Support redirect tracking (#14033)

* Create a deny list of content types and utilize it for output generation

* Add unit tests

* Handle redirect tracking in the content API

* Include start item routing info for redirects

* Add cultures and their routes to the API output (#14038)

* Create a deny list of content types and utilize it for output generation

* Add unit tests

* Handle redirect tracking in the content API

* Include start item routing info for redirects

* Add culture routes to root output (for HREFLANG support)

* Rename redirect service method to better match its purpose

* Review changes

* Delivery API: Query controller (#14041)

* Initial commit

* Custom ContentAPIFieldDefinitionCollection

* Make index IUmbracoContentIndex

* Add querying for children by parent id (key)

* Add missing interface

* Adding querying endpoint

* Test code

* Compose unpublishedValueSet, so that you get the correct data in the ContentAPI index

* Renaming

* Fix ancestorKeys index values

* Adding IApiQueryExtensionService to be able to query the ContentAPI index in a generic way

* Fix IApiQueryService and clean up QueryContentApiController using it

* Support querying for path

* Fix content API indexing

* Fix default sorting

* Implement concrete QueryOption implementations

* Introduce new ExecuteQuery that uses the Core OptionHandlers

* Implement ExecuteQuery

* Change ExecuteQuery signature and implementation

* Implement demo sorting and fetching

* Add query option handlers and collection builder for them

* Cleanup

* Revert "Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)"

This reverts commit 78e1f748e5.

* Revert "Delivery API: Content routing and structure (#13984)"

This reverts commit a0292ae535.

* Revert "Fix multi URL picker value converter trying to access disposed objects in edge cases"

This reverts commit 6b7c37a5bf.

* Revert "Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)"

This reverts commit 78e1f748e5.

* Revert "Delivery API: Content routing and structure (#13984)"

This reverts commit a0292ae535.

* Revert "Fix multi URL picker value converter trying to access disposed objects in edge cases"

This reverts commit 6b7c37a5bf.

* Fix multi URL picker value converter trying to access disposed objects in edge cases

* Delivery API: Content routing and structure (#13984)

* Introduce content route instead of content path, rename and rework start item (previously start node) handling

* Strip out start node path in generated route path

* Make the start-item header take precedence over the request domain

* Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)

* Test commit

* Refactored interfaces for the query handlers and for the selectors (that will handle the value of the fetch query option)

* Implemented a base class for the query options

* Refactored the names of the selectors and made use of the base class

* Refactored the ApiQueryService

* Refactored the QueryContentApiController.cs

* Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)

* Fixing merge gone wrong

* Fix multi URL picker value converter trying to access disposed objects in edge cases

* Delivery API: Content routing and structure (#13984)

* Introduce content route instead of content path, rename and rework start item (previously start node) handling

* Strip out start node path in generated route path

* Make the start-item header take precedence over the request domain

* Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)

* Make fetching work with the new setup

* Moving files to dedicated folders

* Removing ? for array

* Rename selector query method

* Implement FilterHandler and some filters

* Implement SortHandler and sort some sorts

* Refactoring

* Adding more fields to index due to querying

* Appending filtering and sorting queries

* Implementing a new ISelectorHandler without Examine types

* Re-implementing the collection to have a dedicated one for the selectors

* Implementing a new IFilterHandler without Examine types & refactoring the filters implementing it

* Adding a new collection dedicated to filters

* Renaming the old collection

* Implementing a new ISortHandler without Examine types & refactoring the sorts implementing it

* Adding a new collection for the sorts & adding all collections to UmbracoBuilder.Collections

* Refactoring the service to use the new collections and types

* Refactoring the fields in ContentApiFieldDefinitionCollection

* Remove nullability in Handlers

* Don't return null for selector

* Add TODO for having the filters support negation

* Changing the SortType to FieldType with our custom types on the SortOption

* Fix AncestorsSelector

* Fix ApiQueryService

* Documentation

* Fix Swagger docs

* Refactor the QueryContentApiController

* Adding handling for the IApiContentResponse in the JsonTypeResolver

* Refactor the service to use a safe fallback value in Examine queries

* Adding Noop for the IApiQueryService

* Cleanup

* Remove comment

* Fix name field for indexing

* Don't inherit QueryOptionBase in filters

* Fix casing for API index constant + swap FIXME with TODO

* Add TODO for handling missing fetch with start-item header

* Rename query handler parameters to not leak source (i.e. query string)

---------

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

* Delivery API: Adding pagination to query endpoint (#14083)

* Adding pagination to query endpoint

* Optimize the paging using Examine directly

* Fix comment

* Remove skip/take code duplication

---------

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

* Add missing CompatibilitySuppressions.xml

* Make Delivery API packable

* Make Api.Common packable

* Renamed extension method and namespace so it is discoverable

* Untangle ApiVersion configuration into api.common, so delivery api do not require the management api to boot.

* configure options in management api

* RTE output as JSON for Content API (#14067)

* Conditionally serve RTE output as JSON instead of HTML

* Fixed merge

* Rename to Delivery API (#14119)

* Rename ContentApi to DeliveryApi

* Rename delivery API index implementation

* Update comments from "Content API" to "Delivery API"

* Rename project from Content to Delivery

* Add dedicated controller base for content delivery API

* Rename delivery API content index to include "content" specifically

* Fix compat suppressions

---------

Co-authored-by: kjac <kja@umbraco.dk>
Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com>
Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-04-19 11:21:31 +02:00
Søren KottalandGitHub c4cf5f910d Adds padding to the icon in btn-social (#14080) 2023-04-18 16:29:31 +02:00
Sebastiaan Janssen 11ac2ca971 Merge branch 'v11/dev' into contrib 2023-04-18 14:23:42 +02:00
Markus JohanssonandLaura Neto 80f6bb404a #14016 Fixed, added cache buster to Block Grid Editor stylesheets 2023-04-15 18:16:15 +02:00
Mark Drakeandgeorgebid 9a638b6edc resolve spacing issues with block list inline editor when it is the last property editor on the current tab 2023-04-14 14:48:36 +01:00
Bjarke Berg 2af425fd90 Merge remote-tracking branch 'origin/v11/dev' into v12/dev
# Conflicts:
#	version.json
2023-04-14 10:12:51 +02:00
Bjarke Berg 4521c881db Merge remote-tracking branch 'origin/v10/dev' into v11/dev
# Conflicts:
#	version.json
2023-04-14 10:04:35 +02:00
Dhanesh KumarandMichael Latouche 2c580e8d4f fix for the char limit(512) for textboxdatatype 2023-04-13 23:06:23 +02:00
Erik-Jan WestendorpandGitHub f43bc50e7d Translate tree headers to Romanian (#14077)
* Translate treeHeaders

* Oops
2023-04-13 20:07:06 +02:00
eb31889be9 V12: Cherry pick unscoped migrations (#14086)
* New Backoffice: Refactor migrations to allow for unscoped migrations (#13654)

* Remove PostMigrations

These should be replaced with Notification usage

* Remove outer scope from Upgrader

* Remove unececary null check

* Add marker base class for migrations

* Enable scopeless migrations

* Remove unnecessary state check

The final state of the migration is no longer necessarily the final state of the plan.

* Extend ExecutedMigrationPlan

* Ensure that MigrationPlanExecutor.Execute always returns a result.

* Always save final state, regardless of errors

* Remove obsolete Execute

* Add Umbraco specific migration notification

* Publish notification after umbraco migration

* Throw the exception that failed a migration after publishing notification

* Handle notification publishing in DatabaseBuilder

* Fix tests

* Remember to complete scope

* Clean up MigrationPlanExecutor

* Run each package migration in a separate scope

* Add PartialMigrationsTests

* Add unhappy path test

* Fix bug shown by test

* Move PartialMigrationsTests into the correct folder

* Comment out refresh cache in data type migration

Need to add this back again as a notification handler or something.

* Start working on a notification test

* Allow migrations to request a cache rebuild

* Set RebuildCache from MigrateDataTypeConfigurations

* Clean MigrationPlanExecutor

* Add comment explaining the need to partial migration success

* Fix tests

* Allow overriding DefinePlan of UmbracoPlan

This is needed to test the DatabaseBuilder

* Fix notification test

* Don't throw exception to be immediately re-caught

* Assert that scopes notification are always published

* Ensure that scopes are created when requested

* Make test classes internal.

It doesn't really matter, but this way it doesn't show up in intellisense

* Add notification handler for clearing cookies

* Add CompatibilitySuppressions

* Rename Execute to ExecutePlan

We have to do this to be able to obsolete :(

* Update CompatibilitySuppressions

* Update src/Umbraco.Infrastructure/Migrations/MigrationPlanExecutor.cs

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

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

* generate compatability suppresion file

---------

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-04-13 12:23:44 +02:00
fe11f3c8e1 Bumped version to 12.0.0-rc (#14087)
* Bumped version to 12.0.0-alpha1

* Update version.json

---------

Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
2023-04-13 11:01:28 +02:00
Nikolaj c636c7a7d2 Bump version 2023-04-13 08:52:50 +02:00
Nikolaj 810df46823 Merge branch 'release/11.3' into v11/dev 2023-04-13 08:49:32 +02:00
Nikolaj a1d6f65cff Bump to non-rc 2023-04-12 09:36:49 +02:00
Mike MaseyandMichael Latouche cb544f15ee feat: add cite as valid element for tinymce default settings 2023-04-07 23:48:37 +02:00
9223b5737e Update target to execute during packaging (#13521)
Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
2023-04-05 12:59:01 +02:00
Ronald BarendseandGitHub 4cb46f06ae Update default UmbracoVersion template value using MSBuild target (#13481)
* Update default UmbracoVersion template value using MSBuild target

* Fix target order when using pack --no-build

* Use JsonPathUpdateValue MSBuild task to update default UmbracoVersion template value

* Update UmbracoVersion in Umbraco Package RCL
2023-04-05 11:16:43 +02:00
Ronald BarendseandGitHub 92d92feb15 Add new 'Umbraco Package RCL' project template (#13776)
* Add new 'Umbraco Package RCL' project template

* Add --no-restore, hide --framework and remove conflicting -v parameter in Umbraco Package project template

* Hide --framework and --PackageTestSiteName, remove conflicting -v parameter in Umbraco project template and persist selected parameters

* Revert changes to Framework and UmbracoVersion parameter names
2023-04-05 09:32:48 +02:00
Bjarke Berg be2887683b Merge remote-tracking branch 'origin/v11/dev' into v12/dev 2023-04-04 09:18:03 +02:00
Lewis HazellandGitHub 37d737f9bc Case-insensitive tag names with SQLite provider (#14012)
* Ensure case insensitivity in tag name queries.

Use LIKE instead of = to ignore collation rules.

* Add integration test for creating tag relations with mixed casing.
2023-03-31 20:36:25 +02:00
b8899459dc Determine correct if we can create a database with current connectionstring (#14030)
* Fix CanForceCreateDatabase method and add some unit tests

* Fixed an old copy/paste error

* A little nitpicking over wording and formatting

---------

Co-authored-by: kjac <kja@umbraco.dk>
2023-03-31 11:37:41 +02:00
Lucas Bach BisgaardandLaura Neto 3385947c4e Fix bug, in multiurlpicker where you cannot deselect a selected entity. 2023-03-31 10:03:18 +02:00
c662f5a36e Determine correct if we can create a database with current connectionstring (#14030)
* Fix CanForceCreateDatabase method and add some unit tests

* Fixed an old copy/paste error

* A little nitpicking over wording and formatting

---------

Co-authored-by: kjac <kja@umbraco.dk>
2023-03-30 10:19:35 +02:00
e30587f90d Support readonly set via SendingContentNotification (#13557)
* Support readonly set via SendingContentNotification

* Apply changes to second umb-property-editor as well

* Remove check on property.supportsReadOnly

* Disable allow unlock

* Add check on property.readonly

* Small adjustment in the order of preview checks

---------

Co-authored-by: Laura Neto <12862535+lauraneto@users.noreply.github.com>
2023-03-30 09:15:46 +02:00
Bjarke Berg 8e7798b8f0 Merge remote-tracking branch 'origin/v11/dev' into v12/dev 2023-03-29 10:58:40 +02:00
Bjarke Berg 61a33c734c Merge remote-tracking branch 'origin/v10/dev' into v11/dev
# Conflicts:
#	src/Umbraco.Core/Routing/UmbracoRequestPaths.cs
2023-03-29 10:30:16 +02:00
BatJanandSebastiaan Janssen 69010baceb Change style to class 2023-03-28 12:54:26 +02:00
7349ae1c5c Fix pressing enter in a property editor name field (#13329)
Co-authored-by: Sebastiaan Janssen <sebastiaan@umbraco.com>
2023-03-28 12:53:13 +02:00
patrickdemooij9andGitHub b17d9004fd Memory improvements to ShortStringHelper (#13089) 2023-03-28 10:18:41 +02:00
Bjarne FyrstenborgandGitHub 3a214975ed Add sortorder to configuration field (#13075) 2023-03-28 09:58:56 +02:00
1f6307944b Fixes: listitem: <li> elements must be contained in a <ul> or <ol> (#13120)
Co-authored-by: Rob Nicolson <rob.nicolson@brightwire.net>
2023-03-28 09:36:53 +02:00
Sebastiaan Janssen a88d0c0ec9 Unit tests need updating now that the WriterId is properly being set after merging #12843 2023-03-27 17:46:13 +02:00
Matthew CareandGitHub b34a93ed59 Prevent overflowing property values (#12943) 2023-03-27 12:40:39 +02:00
Ealse BoumaandSebastiaan Janssen 93a85a46f3 Fix: Infinite Editor creates each save action a new version when content is invalid (#12713) 2023-03-27 11:29:07 +02:00
Patrick de MooijandSebastiaan Janssen 3ee9bfbc93 12748: Make sure to set writerId 2023-03-27 09:54:35 +02:00
Sebastiaan Janssen 47bcc3e209 Merge branch 'v11/dev' into contrib 2023-03-24 10:51:31 +01:00
Bjarke BergandGitHub f8e5205aa7 Reverse the EnablePackageValidation in tests, so it is explicity opt-in. Otherwise the generated csproj file in Benchmarks will always fail (#14004) 2023-03-24 08:40:51 +01:00
patrickdemooij9andGitHub e550a4ce3a Performance improvement for ReplaceFirst function (#13018)
* Some benchmarks for replacefirst & span method
2023-03-23 20:11:59 +00:00
LandLogic ITandMichael Latouche 99268f6211 Add it key translation 2023-03-23 19:14:29 +01:00
031beee989 Improve ImageSharpImageUrlGenerationTests (#13332)
* Improve ImageSharpImageUrlGenerationTests

Removed a few "stale" tests that look to have been from code of old.
Add tests for all ImageUrlGenerationOptions.
Add some edge case tests to make the tests more sensitive.
Reduce scope for certain tests so the test is more focused on one thing rather than multiple

* Amending a mis-spelt variable.

---------

Co-authored-by: georgebid <91198628+georgebid@users.noreply.github.com>
2023-03-23 09:38:18 +00:00
Nikolaj 1ece9627f7 Convert path to absolute 2023-03-23 09:22:51 +01:00
DennisandGitHub f64f634979 Fix equality check on property group (#13133)
* Fix equality check on property group

Also fix circular reference on PropertyTypeCollection
2023-03-21 23:38:10 +00:00
Nikolaj 21036a4c50 Merge remote-tracking branch 'origin/release/11.2.1' into v11/dev
# Conflicts:
#	build/azure-pipelines.yml
#	version.json
2023-03-21 08:54:08 +01:00
jesperweberandSebastiaan Janssen 36069aa813 Added sort audit to nodes actually being sorted 2023-03-20 16:21:38 +01:00
Sebastiaan Janssen d1fae0e350 Merge branch 'v11/dev' into contrib
# Conflicts:
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.controller.js
2023-03-20 16:01:08 +01:00
Joel MandellandGitHub 451d1cec6a Fixing issue #13865 (i.e. Rich text link picker not resolving correct variant when using .ValueFor()). (#13889) 2023-03-20 15:52:36 +01:00
Busra SengulandGitHub 5d3e3a4c71 Updated core collabs team member on contributing page 2023-03-20 11:14:52 +00:00
Bjarke Berg 298890436a Merge remote-tracking branch 'origin/v11/dev' into v12/dev 2023-03-20 08:41:29 +01:00
Bjarke Berg 5e21ddccc4 Merge remote-tracking branch 'origin/v10/dev' into v11/dev
# Conflicts:
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.controller.js
2023-03-20 08:38:28 +01:00
9a5e21702d small wording change for Element Type description (#13971)
* small wording change for Element Type description

* updated language files IRT Element Types

* replacing a duplicate Block List with Block Grid

---------

Co-authored-by: Rheannon <ral@umbraco.dk>
2023-03-18 00:03:49 +01:00
Donald NairnandKyle Eck 5915c9b29f Remove limitation on nested content to 1,000 items where max items unset. 2023-03-17 09:19:29 -04:00
Dhanesh Kumar MjandGitHub 71e7836001 [fix] Infinite Editor from member property with a media picker (#13817) 2023-03-17 12:20:23 +01:00
Sebastiaan Janssen 70b6aaf963 Merge branch 'v10/dev' into v11/dev
# Conflicts:
#	src/Umbraco.Web.UI.Client/src/common/directives/components/umbavatar.directive.js
#	src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js
2023-03-17 08:56:55 +01:00
Ronald BarendseandGitHub 180fae342e Revert breaking changes from #13936 and remove CompatibilitySuppressions.xml (#13979)
* Revert breaking changes introduced by PR #13936

* Update PackageValidationBaselineVersion to 11.0.0 (stable version) and remove all CompatibilitySuppressions.xml files

* Fix build pipeline (pack solution again, avoiding trying to pack template projects)
2023-03-16 20:32:54 +01:00
Sebastiaan Janssen 28ce2c5787 Merge branch 'v11/dev' into contrib 2023-03-16 08:07:25 +01:00
Lennard FonteijnandMichael Latouche e10ff16fa1 Fixed issue where filtering allowed element types with a NotificationHandler causes issues with Block Grid areas 2023-03-16 04:34:32 +01:00
Matt BegentandGitHub f6ebcdcfb6 Add skip links to header (#13938)
* Add skip links to header

* Tweak skip link z-index
2023-03-15 20:49:53 +01:00
6594c1350f Updated the version requirements for running the current back office (#13940)
* Updated the maximum Node version supported

Building the current version of the back office is only supported on Node v16 and earlier so have updated the docs to reflect that.

* Updated the .Net and VS requirements

For v11 you now need to be running .Net 7 and VS 2022 so have updated the docs to reflect that.

* Apply suggestions from code review

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

---------

Co-authored-by: Sebastiaan Janssen <sebastiaan@umbraco.com>
Co-authored-by: Jason Elkin <jasonelkin86@gmail.com>
2023-03-15 12:56:47 +01:00
Erik-Jan WestendorpandGitHub 11b20cc6cc Add Romanian language (#13965) 2023-03-15 07:26:11 +01:00
Jason ElkinandSebastiaan Janssen 50c4f8c6b5 Use correct listenAddress for Karma on node 18+ 2023-03-15 07:24:28 +01:00
Nikolaj 921a32ee03 Bump version 2023-03-14 14:20:31 +01:00
Bjarke BergandNikolaj fcca1cf5c0 Check the tmpimg path is in the expected folder 2023-03-14 14:19:11 +01:00
Karn Blackmoreandgeorgebid daf54468b1 Fix algiment issues by setting the editor to position fix. 2023-03-14 12:18:01 +00:00
kiasynandGitHub 62b49c7ea7 Fix ViewContext.FormContext not being set during BeginUmbracoForm (#13914)
* Fix ViewContext.FormContext not being set during BeginUmbracoForm

Client validation is broken without this if there are multiple forms with the same field names on a page.

* Tweaked comment
2023-03-13 14:37:51 +01:00
ChadandGitHub 7c30da9fbf Faster cache key generation (#13504)
* Reduce the number of string concatenations required to generate cache keys.
* Updated to match existing Nucache keys.

---------
2023-03-13 13:06:02 +00:00
1fb6afbc03 Add setting to disable domain warnings (#13954)
* Add appsetting and return if domain warning are disabled

* Fix unit tests

* Add default value

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-03-13 14:04:16 +01:00
70a34105e0 V11: obsolete legacy data types (#13953)
* Obsolete the grid

* Obsolete the legacy media picker

* Obsolete nested content

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-03-13 11:33:27 +01:00
Joe GlombekandMichael Latouche 066276a532 Add checkered background to file upload
(including SVGs added to the media library)
2023-03-11 02:13:29 +01:00
44077e15e3 Extract redirect URL from route values for member logout (#13933)
* Extract redirect URL from route values for member logout

* Update src/Umbraco.Web.Website/Controllers/UmbLoginStatusController.cs

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

---------

Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
2023-03-10 10:55:28 +01:00
AaronandGitHub ca515c3ed7 Changed to cast double to long (#13935) 2023-03-09 16:54:29 +01:00
64bd310037 update block label not assigning fixes: #13833 (#13937)
Co-authored-by: Sean Thorne <sean.thorne@truedigital.co.uk>
Co-authored-by: georgebid <91198628+georgebid@users.noreply.github.com>
2023-03-09 15:34:38 +00:00
AaronandGitHub 888dccaec4 Reversed X-XSS (#13936) 2023-03-09 16:19:37 +01:00
AaronandJason Elkin 393845ce4d Solves tooltip issue for block column editor on remove block column editor option 2023-03-09 15:13:57 +00:00
Paul SealandGitHub d8f204ddf9 Fix the reference to the .targets file (#13847)
Updates the reference to the .targets file to use the correct folder name of `buildTransitive` instead of `build`
2023-03-09 13:33:53 +00:00
be72c8147d Faster full nucache table rebuild (#13501)
* SQL Server Truncate when full nucache SQL rebuild.

* Optimize truncate for SQL Lite

* Remove comment.

* Use current DB Types

* I added a couple of formatting changes.

---------

Co-authored-by: georgebid <91198628+georgebid@users.noreply.github.com>
2023-03-09 12:25:07 +00:00
CyberReiterandGitHub 0cfc1fb664 Fall back to object if PublishedPropertyType modelType is null (#13553)
* add null check

* return object when type is null
2023-03-08 11:14:22 +00:00
30abbb0c5d Fix install when adding custom default languages (#13904)
* Adding ids to language installation

---------

Co-authored-by: Jason Elkin <jasonelkin86@gmail.com>
2023-03-08 10:18:17 +00:00
Bjarke Berg 52ddcb8d1d Merge remote-tracking branch 'origin/v11/dev' into v12/dev 2023-03-08 11:01:06 +01:00
Bjarke Berg 2c8ba19531 Merge remote-tracking branch 'origin/v10/dev' into v11/dev 2023-03-08 10:59:46 +01:00
Bjarke BergandGitHub e2a15b58ed Fallback to use ActivatorUtilities to create controller from type, if it is not registered in DI (#13910) 2023-03-07 11:21:57 +01:00
Nikolaj Brask-NielsenandGitHub 0789bb9eb1 Remove transitive project references
* refactor: Remove transitive project relations

* refactor: Remove transitive project relations
2023-03-02 16:43:08 +00:00
Miska HusgafvelandEmma L Garland 282b7ac3d5 Ensure cropperHelper.pixelsToCoordinates returns valid coordinates 2023-03-02 15:52:11 +00:00
Erik-Jan WestendorpandGitHub 5158d8119d Map BackOfficeNotification in ContentMapDefinitions (#13874)
* Map Notifications

* Empty line
2023-03-02 14:23:20 +01:00
Erik-Jan WestendorpandGitHub 9771e77243 IsNullOrWhiteSpace Extension method for HtmlEncodedString (#13747)
* Add IsNullOrWhiteSpace Extension method

IsNullOrWhiteSpace extension method for IHtmlEncodedString

* Move extension method

* Add a UnitTest for the IsNullOrWhiteSpace extension method

* Update unit test
2023-03-02 13:57:43 +03:00
Sebastiaan Janssen 2172765b01 Merge branch 'v11/dev' into contrib 2023-03-02 09:39:10 +01:00
Bjarke Berg ef7db1dec9 Merge remote-tracking branch 'origin/v11/dev' into v12/dev 2023-03-02 08:47:38 +01:00
Bjarke Berg eac6eb820b Merge remote-tracking branch 'origin/v10/dev' into v11/dev 2023-03-02 08:46:58 +01:00
Menno MoutandMichael Latouche ca23784898 Added a CalculateMediaStartNodeIds method call when the startNode passed in as parameter is null. When this does return an array of startNodes the first one is being used. The question remains if this is desired behaviour. With this implementation the user has no real control over where the file is going to go. Atleast with this implementation the user can now see the file. 2023-03-02 04:56:14 +01:00
Andreas ZerbstandGitHub 922c79ae86 V11/bugfix/fixed flaky test (#13893)
* Moved deleteAllMedia to afterEach, the reason for that is that we delete all the media in each test.

* Added additional timeout and a WaitForTimeout(), the reason for the WaitForTimeout is because it can take a second for the modelsbuilder to update the view.

* Added more timeout for the isSuccessNotificationVisible. Updated the helper ensureNameNotExists so they actually delete the partialViews

* Updated the locators for deleting the UK language. Added an expect for checking if the UK language is visible in the UI

* Updated the position where the dragAndDrop drops to

* Changed the trace so we only save the trace on the first retry, it saves a lot of time when the tests are running, since we dont need to save the trace and then delete the trace after each successful test

* Updated locators. Added an expect so the test waits until the / is visible in the URL before going further into the test

* Changed back to retain on failure on the pipelines, the reason for that is if a test only fails once, then we wont see what the actual error was in the test when looking on the pipeline.

* Added an expect so we wait until the page is  loaded for packages

* Updated the dragAndDrop so they hopefully work.

* Changed values for dragAndDrop

* Updated the dragAndDrop values

* Bumped playwright version
2023-03-01 08:52:26 +01:00
mwillebrandsandJason Elkin 6ce30fb561 Fix for #13860
Undefined error when inserting an empty link in the RTE editor
2023-02-28 17:20:36 +00:00
niekvanderreestandGitHub 27e38e1606 Change GetMinNonAlphaNumericChars() to return 1 (#13876) 2023-02-28 14:47:53 +01:00
Bjarke BergandGitHub ea1ca14f1e Updated to use latest c# language version instead of csharp 8, when build views (#13894) 2023-02-28 09:57:17 +01:00
Andreas ZerbstandGitHub 4719f4eb5a V11/feature/block grid editor content tests rendering (#13885)
* Added tests for testing if the rendering is working as intended for the block grid editor

* Added Layout stylesheets for testing

* We are now using the page.toHaveScreenshot() which checks if the test looks the same as the pngs.

* Updated the toHaveScreenShot so they now take in a shorter name for the pngs

* Updated the page.goto so they new go the to baseUrl based on the umbracoConfig

* Added additional pngs for the Linux tests

* Updated the pngs for linux yet again
2023-02-28 08:16:31 +01:00
Andreas ZerbstandGitHub 610a519045 Added test for testing the content editor with a block grid editor (#13887) 2023-02-28 08:06:43 +01:00
Miska HusgafvelandMichael Latouche 44e8d0ac6d Make additionalRouteVals nullable in Umbraco.Extensions.HtmlHelperRenderExtensions.BeginUmbracoForm() - Fixes #13662 2023-02-27 01:31:59 +01:00
Menno MoutandGitHub 37db3ae3da Listview batch publishing on multi language site, publishes all variants #13755 - Fix (#13772)
* Modified PostPublishById to handle content that is culture variant. Added model and modified the javascript function that call the api endpoint.

* Added separate method for publishing with cultures. Added if else statment to js function.

* Moved check for all cultures being published to the top of PostPublishByIdAndCulture. Added parameter to ngDoc. Added Where Query.
2023-02-26 14:00:28 +01:00
Andreas ZerbstandGitHub 6128ad1bde V11/feature/blockgrid editor content tests advanced (#13877)
* Added test for the advanced section under the block grid editor in content

* Bumped versions

* Added fixture template and customView

* Updated naming of tests
2023-02-23 14:44:58 +01:00
Andreas ZerbstandGitHub e3f5bf8cdf Added test for the settings section (#13878) 2023-02-23 14:30:29 +01:00
Nikolaj GeisleandGitHub d91ed4f568 Obsolete ctor (#13875) 2023-02-23 10:54:20 +01:00
Andreas ZerbstandGitHub c81e9decb8 V11/feature/block grid editor content tests area (#13867)
* Added test for testing the area of the blockGridDataType

* Bumped version of playwright, builders and the helpers

* Added additional test timeout

* Added additional timeout since some test can be slow and timeout

* Added additional mediaLibrary to the path

* Changed so we now use slow which increases the test timeout by three times

* Changed to slow instead of setting timeout
2023-02-23 09:08:46 +01:00
Sebastiaan Janssen 8d714e5d3f Merge branch 'v11/dev' into contrib 2023-02-23 08:10:13 +01:00
Bjarke Berg 8cb9edb69d Merge remote-tracking branch 'origin/v11/dev' into v12/dev 2023-02-23 07:17:56 +01:00
Bjarke Berg 7b818b2fce Merge remote-tracking branch 'origin/v11/dev' into v12/dev 2023-02-23 07:17:21 +01:00
Bjarke Berg 4be6e5b71c Merge remote-tracking branch 'origin/v10/dev' into v11/dev 2023-02-23 07:16:50 +01:00
2a3c0358b1 Add support for Inline Macro - To enable: Add a Macro Parameter called: enableInlineMacro with Umbraco.TrueFalse set to True (value:"1") (#13628)
- Custom Macro Parameter with true as default value can be created for those prefering that in their project

Co-authored-by: Jo Mehmet Sollihagen <jomehmet@solsol.no>
2023-02-22 15:21:53 +01:00
Bjarne FyrstenborgandGitHub 62fdbd159c Reset selected index/searcher (#13866) 2023-02-22 14:54:47 +01:00
Andreas Zerbstandnikolajlauridsen cf1cd51266 Removed path so we can generate templates 2023-02-22 08:49:15 +01:00
Bjarke Bergandnikolajlauridsen 0e65af701f Fixed pipeline after dotnet sdk 7.0.200 2023-02-22 08:49:10 +01:00
nikolajlauridsen 0014f0e6db Bump version 2023-02-22 08:38:16 +01:00
81b28df6ab Merge dev into contrib (#13871)
* Removed path so we can generate templates

* Remove old proj ref to core from cs proj (#13870)

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

---------

Co-authored-by: Andreas Zerbst <andr317c@live.dk>
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-02-21 13:49:03 +01:00
Sebastiaan Janssen 0d1db91be5 Merge branch 'v11/dev' into contrib 2023-02-21 13:23:04 +01:00
Smayke95andGitHub 42d143c6b2 Add Bosnian language (#13854)
* Add Bosnian language

* fix

* Fix issue with Marketplace
2023-02-21 12:42:01 +01:00
79a9d73a90 Remove old proj ref to core from cs proj (#13870)
Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-02-21 12:17:17 +01:00
Simone ChiarettaandGitHub 362832b594 Changed modifier for ContentPickerValueConverter (#13864)
Changed internal to public for ContentPickerValueConverter, which was the only property value converter defined as `internal`
Fixes issue umbraco#13858
2023-02-21 08:05:56 +01:00
dependabot[bot]andMichael Latouche d61c32c1e4 Bump @sideway/formula in /tests/Umbraco.Tests.AcceptanceTest
Bumps [@sideway/formula](https://github.com/sideway/formula) from 3.0.0 to 3.0.1.
- [Release notes](https://github.com/sideway/formula/releases)
- [Commits](https://github.com/sideway/formula/compare/v3.0.0...v3.0.1)

---
updated-dependencies:
- dependency-name: "@sideway/formula"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-16 23:17:10 +01:00
de27eb697e Fixes #13732 - IsBackOfficeRequest is extremely inefficient (#13743)
* Update UmbracoRequestPaths.cs

* Update UmbracoRequestPaths.cs

* remove redundant check

---------

Co-authored-by: Michael <michael@crossingpaths.be>
2023-02-16 23:09:26 +01:00
Bjarke Berg 622c3b437b Merge remote-tracking branch 'origin/v11/dev' into v12/dev 2023-02-16 10:08:19 +01:00
Bjarke BergandGitHub c77c5cad3c Merge pull request #13840 from umbraco/v11/bugfix/build-pipeline
Removed path so we can generate templates
2023-02-16 09:28:59 +01:00
Andreas Zerbst 5c276c2d10 Removed path so we can generate templates 2023-02-16 09:18:14 +01:00
Sebastiaan Janssen b3235f1c0e Merge branch 'v11/dev' into contrib 2023-02-15 16:35:54 +01:00
Sebastiaan JanssenandGitHub 37b34aea11 Update up-for-grabs-response.yml 2023-02-15 14:29:28 +01:00
Sebastiaan JanssenandGitHub 09d15b5e30 Update pr-first-response.yml 2023-02-15 14:29:10 +01:00
Sebastiaan JanssenandGitHub 23cacf892f Update issues-first-response.yml 2023-02-15 14:28:42 +01:00
Bjarke Berg 96c94f707a Merge remote-tracking branch 'origin/v11/dev' into v12/dev
# Conflicts:
#	src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs
2023-02-15 14:15:28 +01:00
Bjarke Berg 88a1c9eb57 Merge remote-tracking branch 'origin/v11/dev' into v11/dev 2023-02-15 14:10:43 +01:00
Bjarke Berg acbf937534 Merge remote-tracking branch 'origin/v10/dev' into v11/dev 2023-02-15 14:10:30 +01:00
Bjarke Berg 776f5ce1a0 Merge remote-tracking branch 'origin/v10/dev' into v11/dev 2023-02-15 14:06:39 +01:00
Bjarke Berg 0204da1123 Merge remote-tracking branch 'origin/v11/dev' into v11/dev 2023-02-15 13:58:22 +01:00
Bjarke Berg 3ffe7f6d5d Fixed pipeline after dotnet sdk 7.0.200 2023-02-15 13:57:58 +01:00
tristanjthompsonandMichael Latouche e9f5b562ad Update JITOptimizerValidator error message. 2023-02-15 12:32:52 +01:00
45036f54dd Sort domains (Culture and Hostnames) (#13797)
* Add sort order to IDomain, UmbracoDomain and DomainDto

* Add migration to create domain sort order column

* Add Sort method to domain service

* Set sort order when persisting new domain and order results

* Add multiple and block style support to umb-button-group

* Allow sorting domains in back-office, improve UI and rewrite PostSaveLanguageAndDomains for correctly sorting domains

* Ensure routing and cache keeps the domain sort order

* Update test to assert correct domain order

* Move migration to target 11.3 and cleanup plan

* Fix formatting/styling and make SelectDomains private

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

---------

Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
2023-02-14 10:35:45 +01:00
Ronald BarendseandGitHub 7348171c01 Add DefaultLanguage fallback policy for published values (#13814)
* Add DefaultLanguage fallback

* Implement DefaultLanguage fallback

* Add DefaultLanguage fallback test
2023-02-13 14:50:41 +01:00
Nikolaj bbc8ade227 Bump version 2023-02-09 08:25:01 +01:00
Sebastiaan Janssen 665328f01c Merge branch 'v11/dev' into contrib 2023-02-08 13:02:17 +01:00
280fbdd870 Remove special characters in avatar [part 2] (#13796)
* Update regex

* Update src/Umbraco.Web.UI.Client/src/common/directives/components/umbavatar.directive.js

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

---------

Co-authored-by: Ronald Barendse <ronald@barend.se>
2023-02-08 12:47:46 +01:00
Bjarke Berg 317891e8cf Merge remote-tracking branch 'origin/v11/dev' into v12/dev 2023-02-08 12:28:32 +01:00
Bjarke Berg da4e9487e2 Merge remote-tracking branch 'origin/v10/dev' into v11/dev 2023-02-08 12:28:03 +01:00
Jacob OvergaardandGitHub f3bcfcd5d9 v11: npm updates for february (#13803)
* update ace-builds from 1.14.0 to 1.15.0

* update eslint from 8.32.0 to 8.33.0

* update jsdom from 21.0.0 to 21.1.0

* update nouislider from 15.6.1 to 15.7.0
2023-02-08 09:58:40 +01:00
Nikolaj GeisleandZeegaan 3d47cac9ac V10: fix content version cleanup dto migration (#13788)
* Add DoesPrimaryKeyExist method

* Add primary key name to dto

* Add extension method PrimaryKeyExists

* Dont use sql_master table

* Implement DoesPrimaryKeyExists

* Rename without plural s

* Refactor to get proper primary key name and not column name

* Use primary key name and not column name

* Dont filter tables in memory

* Remove .Where

* Don't select all, select only sql

* throw NotImplementedException by default

* USe virtual instead of abstract to avoid breaking change

* Reinstert primary key attribute

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-02-07 13:48:36 +01:00
Anders BrohusandMichael Latouche 559e56949f 2FA translations
Added and changed some translations about 2FA
2023-02-07 12:59:10 +01:00
Bjarke BergandGitHub e3135bd97e Updated nuget dependencies (#13787) 2023-02-06 14:58:48 +01:00
Jacob OvergaardandGitHub 80112d88f4 V11: Fix for media library type dialog (#13780)
* let the server determine the type rather than assuming it is an image

this is especially useful for SVGs that would otherwise be uploaded as images instead of the more appropriate Vector Graphics default type

* do not start processing of the queue if a dialog is shown

return early if the dialog is shown (if _requestChooseMediaTypeDialog() does not immediately return false) because that means the user will pick the media type

* clean up of the scope for performance

remove 'handleFile' since it is not being used and make the other callbacks one-way bound since we are not changing them

* add jsdoc to improve understanding of the dropzone directive
2023-02-06 14:39:57 +01:00
Sebastiaan Janssen 74e2e58935 Merge branch 'contrib' into v11/dev 2023-02-06 14:35:47 +01:00
66f483e88c New backoffice: Obsolete ReadOnlyUserGroup constructor. (#13676)
* Obsolete old ReadOnlyUserGroup constructor

* Update src/Umbraco.Core/Models/Membership/ReadOnlyUserGroup.cs

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

---------

Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com>
2023-02-06 14:32:27 +01:00
Sebastiaan Janssen 75f16b79fb Merge branch 'v11/dev' into contrib 2023-02-06 14:29:48 +01:00
2f5726384d Mini-list view search by id,name & key is fixed. (#13735)
* Mini-list view search by id,name & key is fixed.
Added  multiple conditions in the query to consider id or name or key from the filter param(search bar from minilistview)

* make it more simple ,now using || instead of clause conditions.

---------

Co-authored-by: Dhanesh Kumar <dhanesh.kumar@phases.dk>
Co-authored-by: Michael <michael@crossingpaths.be>
2023-02-06 12:57:36 +01:00
Erik-Jan WestendorpandGitHub 371679b2e5 Remove special characters in avatar (#13766)
* Remove special characters

* Remove some chars not all
2023-02-06 12:40:28 +01:00
Bjarke Berg 6d7b619d94 post merge 2023-02-06 10:18:15 +01:00
Bjarke Berg fe2d071fd5 Merge remote-tracking branch 'origin/v10/dev' into v11/dev 2023-02-06 10:16:49 +01:00
Jacob OvergaardandGitHub 36cbcc36de add check for editorState.getCurrent to find the current editor (relevant in infinite editors), and throw a warning if an editor completely misses the current node context (#13778)
disable drag&drop entirely if the property editor did not get a node through bindings or editorState
2023-02-03 10:20:23 +01:00
Andreas ZerbstandAndreas Zerbst 46742d125a Updated the ID of the locator in the test 'can set a minimum of required blocks in content with a block list editor' to match the correct ID. (#13769) 2023-02-01 15:19:23 +01:00
Andreas ZerbstandAndreas Zerbst eaf7994dca Updated the ID of the locator in the test 'can set a minimum of required blocks in content with a block list editor' to match the correct ID. (#13769) 2023-02-01 15:17:28 +01:00
Andreas ZerbstandAndreas Zerbst 8a5e553986 Updated the ID of the locator in the test 'can set a minimum of required blocks in content with a block list editor' to match the correct ID. (#13769) 2023-02-01 15:16:00 +01:00
Andreas ZerbstandGitHub b538318b5c V11/feature/block grid editor datatype tests (#13666)
* Added tests for the BlockGridEditorDataType

* Bumped versions

* Split the file into two, so we now have a file with the Blocks and one with the Configuration of the datatype

* Changed function variables to class variables.
Changed tests to use the ConstantHelpers
Changed naming
2023-02-01 15:11:18 +01:00
Sebastiaan Janssen 5e03f9bb4e Revert "IScopeProvider" is used from Umbraco.Cms.Infrastructure.Scoping"
This reverts commit 0907255931.
2023-02-01 14:01:29 +01:00
Andreas ZerbstandGitHub fca689b140 V11/feature/block grid editor document test (#13667)
* Added tests for BlockGridEditorInDocument

* Bumped version

* Updated naming
Removed unnecessary reload
2023-02-01 13:32:01 +01:00
Kenn JacobsenandGitHub 4453459f06 Obsolete language ID related properties and methods for V13 (#13753) 2023-02-01 09:37:43 +01:00
Jeroen BreuerandSebastiaan Janssen ff3d8c1c6c Make methods virtual so they can be redefined in derived classes. 2023-01-31 19:43:24 +01:00
dKumarmjandSebastiaan Janssen 0907255931 IScopeProvider" is used from Umbraco.Cms.Infrastructure.Scoping 2023-01-31 18:13:54 +01:00
Bjarke Berg e79198c990 Merge remote-tracking branch 'origin/v11/dev' into v11/dev 2023-01-31 12:58:48 +01:00
Bjarke Berg 11d393e419 Updated version number 2023-01-31 12:58:33 +01:00
Ealse BoumaandSebastiaan Janssen 5c0673930a Changed default initialized button permissions for listviews 2023-01-31 11:14:20 +01:00
Sebastiaan Janssen 61685a459b Merge branch 'v11/dev' into contrib 2023-01-31 10:17:54 +01:00
417f31fba5 Send email notification on password reset (#13757)
Co-authored-by: Aleksander <alf@umrabco.dk>
2023-01-31 09:04:26 +01:00
Warren BuckleyandGitHub d38fabea4a Fixes #13715 Simple LogViewer queries not returning results (#13748)
* Fixes #13715 issue with simple logviewer searches

* Update Logviewer test - to ensure MessageLike and simple equivalent returns same result count to help catch
2023-01-30 10:32:28 +01:00
Bjarke Berg 432326cc20 Updated the BPlusTree package to reflect the update in the underlying package. 2023-01-30 08:01:54 +01:00
Marc GoodsonandMichael Latouche 23b03f408e Add .woff2 to BrowsableFileExtensions 2023-01-29 20:27:47 +01:00
Bjarke Berg cec613c0cc Merge remote-tracking branch 'origin/v11/dev' into v12/dev 2023-01-27 09:50:35 +01:00
Bjarke Berg e94328ad57 Merge remote-tracking branch 'origin/v11/dev' into v11/dev 2023-01-27 09:50:06 +01:00
Bjarke Berg 700a33ac73 Merge remote-tracking branch 'origin/v10/dev' into v11/dev 2023-01-27 09:49:47 +01:00
dependabot[bot]andJacob Overgaard d3b4bae1b5 Bump ua-parser-js from 0.7.31 to 0.7.33 in /src/Umbraco.Web.UI.Client
Bumps [ua-parser-js](https://github.com/faisalman/ua-parser-js) from 0.7.31 to 0.7.33.
- [Release notes](https://github.com/faisalman/ua-parser-js/releases)
- [Changelog](https://github.com/faisalman/ua-parser-js/blob/master/changelog.md)
- [Commits](https://github.com/faisalman/ua-parser-js/compare/0.7.31...0.7.33)

---
updated-dependencies:
- dependency-name: ua-parser-js
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-27 08:56:52 +01:00
Sebastiaan Janssen 33adbf41fa Update contributing docs with the correct branch name 2023-01-26 15:38:54 +01:00
Sebastiaan Janssen 3a7624c385 Merge branch 'v11/dev' into v11/contrib 2023-01-26 15:31:39 +01:00
c868c60ed2 V11: Fix decimal variants (#13741)
* fix sqlite with variants

* Create and register SqlSpecificMapper

* Delete obsolete file

* Add back inheritance

Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-01-26 12:26:06 +01:00
Bjarke Berg d180247915 Merge remote-tracking branch 'origin/v11/dev' into v12/dev 2023-01-24 12:02:09 +01:00
Bjarke Berg be0138e526 Merge remote-tracking branch 'origin/v10/dev' into v11/dev 2023-01-24 11:56:32 +01:00
Bjarne FyrstenborgandGitHub 14af1aea9b Ensure to reset padding and border as well for textarea in richtext (#13012) 2023-01-24 09:18:54 +01:00
MoleandGitHub 17248ce494 V11: Add improved log message on compilation failure using InMemoryAuto (#13678)
* Add improved log message when in memory compilation fails.

* Move LogCompilationFailure into its own method

And hopefully make codescene happeh

* Reduce nesting

* Replace null check with linq
2023-01-23 08:19:15 +01:00
Jacob OvergaardandGitHub 7aee15d6d1 V11: Prevalues as toggles have problems in datatype settings view (#13709)
* format preValues with DataTypeHelper.createPreValuesProps before rendering so they have the 'alias' prop used for input-id to umb-toggle

* preValues are now formatted on fetch so we do not need to do it again
2023-01-20 08:13:37 +01:00
Jacob Overgaard a8acefcaba introduce lint option for gulp so we only lint when building and not watching, which makes dev, watch and fastdev even faster 2023-01-19 12:56:55 +01:00
Jacob OvergaardandGitHub b97dd46608 V11: fix issue where editing a macro was not possible (#13702)
* remove the onSetup for the macro button since we want to always be able to interact with the macro button (either insert or edit)

* let the onAction method find the currently selected macro by asking the active editor for its selection instead of relying on the NodeChanged event
2023-01-19 11:02:33 +01:00
Bjarke Berg 4c62fcfb98 Merge remote-tracking branch 'origin/v11/dev' into v12/dev
# Conflicts:
#	src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs
2023-01-19 09:52:41 +01:00
Bjarke Berg 8c22de0bad Merge remote-tracking branch 'origin/v11/dev' into v11/dev 2023-01-19 09:50:54 +01:00
Bjarke Berg 1b88e0a7a1 Merge remote-tracking branch 'origin/v10/dev' into v11/dev
# Conflicts:
#	src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs
#	version.json
2023-01-19 09:41:00 +01:00
Jacob OvergaardandGitHub f23ebaefa6 v11: javascript dependency updates (UUI, TinyMCE, jQuery, signalR, and more) (#13696)
* build(deps-dev): update development dependencies

* update the Umbraco UI library to 1.1.0

* update ace editor to 1.14.0

* update diff to 5.1.0

* update jquery to 3.6.3

* update tinymce to 6.3.1

* update underscore to 1.13.6

* update @microsoft/signalr to 7.0.2
2023-01-19 09:39:57 +01:00
Bjarke Berg 2dd38f8393 Merge remote-tracking branch 'origin/v11/contrib' into v11/dev 2023-01-19 09:32:04 +01:00
MoleandGitHub 46049bfd74 Obsolete things broken in migrations refactor (#13658)
* Obsolete chings changed in v13

* Fix tests

* Obsolete Execute and add ExecutePlan with default implementation.

This just calls the old implementation and creates an ExecutedMigrationPlan from the result

In V13 this has its own implementation.

* Mention notification in obsolete message
2023-01-19 09:27:33 +01:00
Jacob OvergaardandGitHub 0d4d3ce33c add workaround for line-height issues with tinymce (#13700)
based on this upstream issue: https://github.com/tinymce/tinymce/issues/6431
2023-01-19 09:26:00 +01:00
Jacob OvergaardandGitHub cfdc4a9573 add the s html element to allow list for TinyMCE (#13697)
Fixes #13637
2023-01-19 09:25:44 +01:00
8fdb5a55ea Updating german translation (#13684)
* updating german translations

* translating missing sections

* added missing closing tag

Co-authored-by: Michael <michael@crossingpaths.be>
2023-01-19 00:19:13 +01:00
Mike MaseyandMichael Latouche 3ebd15b67e fix: move list view selection options to after list in focus order 2023-01-15 22:42:48 +01:00
Bjarne FyrstenborgandMichael Latouche eb9f9c68dd Add separator before reload node in Media Types tree 2023-01-15 21:56:18 +01:00
ustadstarandMichael Latouche fd992f65bb Fix copy content with descendants not copying sort order (#13464) 2023-01-13 01:30:48 +01:00
Kenn JacobsenandGitHub 8463d906a7 Make sure the property editor layout is contained within its container (prevent Z-index bleed-through) (#13583) 2023-01-12 10:55:02 +01:00
Nikolaj 314f79bd07 Bump version 2023-01-11 15:39:26 +01:00
Nikolaj 1438b0a731 Merge branch 'release/11.1' into v11/dev 2023-01-11 15:38:45 +01:00
Nikolaj bad914842a Bump version 2023-01-11 10:25:31 +01:00
Andy ButlandandNikolaj a91c81ee56 Changed healthcheck collection configuration to use a concrete type to ensure configuration settings are bound. 2023-01-11 10:22:39 +01:00
Elitsa MarinovskaandGitHub 5e06f5a8a0 V12: Change nullability for the log searches (#13647)
* Changing nullability

* Obsolete DeleteSavedSearch since the query param is not used

* Fix a bit more referenced

* Add default implementation for the new overload of DeleteSavedSearch
2023-01-09 14:16:16 +01:00
Bjarne FyrstenborgandGitHub 3e415b242f Hide colors from icon picker (#13079)
* Ensure border is set so it doesn't jump on selection

* Allow to hide color from icon picker

* Use CSS grid instead to fill icons and with minimum width

* Remove odd flex size

* Set minimum to 60px instead
2023-01-07 03:15:51 +01:00
Bjarke Berg 46798c42b5 Merge remote-tracking branch 'origin/v11/dev' into v11/contrib 2023-01-06 13:52:29 +01:00
Bjarke Berg 84d78e1393 Merge 2023-01-06 10:14:59 +01:00
Bjarke Berg 6d8a3c550f Merge remote-tracking branch 'origin/v10/dev' into v11/dev 2023-01-06 08:44:50 +01:00
Erik-Jan WestendorpandMichael Latouche 045c755ccf Translate dictionary area 2023-01-06 02:48:26 +01:00
dependabot[bot]andJacob Overgaard 591c78ae0c Bump decode-uri-component in /src/Umbraco.Web.UI.Client
Bumps [decode-uri-component](https://github.com/SamVerschueren/decode-uri-component) from 0.2.0 to 0.2.2.
- [Release notes](https://github.com/SamVerschueren/decode-uri-component/releases)
- [Commits](https://github.com/SamVerschueren/decode-uri-component/compare/v0.2.0...v0.2.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-05 11:10:19 +01:00
dependabot[bot]andJacob Overgaard 3ddb6e6832 Bump json5 from 2.2.1 to 2.2.3 in /src/Umbraco.Web.UI.Client
Bumps [json5](https://github.com/json5/json5) from 2.2.1 to 2.2.3.
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](https://github.com/json5/json5/compare/v2.2.1...v2.2.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-05 11:09:10 +01:00
Bjarke Berg a1a4f288cd Merge remote-tracking branch 'origin/v11/dev' into v11/contrib 2023-01-05 10:29:30 +01:00
Mykola GorbatenkoandMichael Latouche b52a4363c4 added Ukrainian language 2023-01-05 03:32:52 +01:00
Vitor RodriguesandGitHub 7d9bb8f595 Exposed media file provider configuration method (#13294)
This is required for consumers that intend to use WithCustomMiddleware instead of WithMiddleware, as otherwise they are forced to re-implement this code
2023-01-04 10:23:16 +01:00
Elitsa MarinovskaandGitHub b4ca2a6636 Fixing a few nullable reference types for log viewer (#13634) 2023-01-04 09:24:43 +01:00
Kenn JacobsenandGitHub d1fd1f16fd Move resources and implementations for System.Text.Json for reuse across projects (#13626)
* Moved resources and implementations for System.Text.Json for reuse across projects.

* Move MvcBuilderExtensions as well
2023-01-03 15:34:23 +01:00
CyberReiterandMichael Latouche b7a26360e5 minor improvements to indexing performance 2023-01-02 01:26:25 +01:00
Robert FosterandGitHub e7a986b1c3 fix for #13623 by hiding Member Edit Action Menu on Infinite editing … (#13624)
* fix for #13623 by hiding Member Edit Action Menu on Infinite editing for consistency

* added missing attribute to umb-editor-header for Member editing
2022-12-31 03:51:33 +01:00
MehmetandGitHub 59c5226d68 Rename title marketplace to packages (#13625) 2022-12-30 13:29:51 +01:00
dc46b649f7 fixes data-element attribute on media section (#13621)
* fixes data-element attribute on media section

* Revert "fixes data-element attribute on media section"

This reverts commit 2a35c9fbed.

* use property alias on members umb-property

Co-authored-by: Mario Lopez <mario@luminary.com>
2022-12-28 08:50:37 +01:00
Calvin DavisandMichael Latouche 4fbb0805e8 Add margin-right to block card name and subname 2022-12-26 02:55:14 +01:00
Nikolaj 2b72df09bb Merge branch 'release/11.1' into v11/dev 2022-12-21 13:54:29 +01:00
f37c02ea79 V10: Dont disable invited users (#13600)
* Dont allow disable user when invited

* Use data instead of selection

* return succesfully disabled users

* Disable disable button when invited

* Add integration tests

* Remove unused usings

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

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

* Create DisabledUsersModel

* use data.disabledUsers

* Return OK if no users to be saved

* User disabledUsersModel

Co-authored-by: Zeegaan <nge@umbraco.dk>
Co-authored-by: Kenn Jacobsen <kja@umbraco.dk>
2022-12-21 10:07:11 +01:00
Bjarke Berg a1ef0903c9 Merge remote-tracking branch 'origin/v11/dev' into v12/dev 2022-12-20 10:20:44 +01:00
Bjarke Berg 03e00cbed2 Merge remote-tracking branch 'origin/v10/dev' into v11/dev 2022-12-20 10:19:36 +01:00
Bjarke Berg 9c087f584d Fixed build warnings in ManagementApi 2022-12-20 08:53:37 +01:00
Ronald BarendseandBjarke Berg 832e44cb01 Also fix GetBackOfficeUrl in UrlHelperExtensions 2022-12-20 08:31:37 +01:00
Ronald BarendseandBjarke Berg 58da7f754b Rename fixed extension method to GetUmbracoBackOfficeUrl and obsolete old one 2022-12-20 08:31:37 +01:00
Ronald BarendseandBjarke Berg 751c1883ce Fix GetBackOfficeUrl extension method 2022-12-20 08:31:37 +01:00
Bjarke BergandGitHub 1332ba51e8 Merge pull request #13599 from umbraco/v11/bugfix/getbackofficeurl
Add `GetUmbracoBackOfficeUrl` extension methods
2022-12-20 08:30:45 +01:00
Bjarke Berg e375ab4b1b Added new ContentAndWebRootFileProviderFactory and use that for IManifestFileProviderFactory, so manifests can be found in /app_plugins folder too (#13597)
Fixes https://github.com/umbraco/Umbraco-CMS/issues/13565
2022-12-20 08:10:47 +01:00
Bjarke BergandGitHub 6430c61ee9 Added new ContentAndWebRootFileProviderFactory and use that for IManifestFileProviderFactory, so manifests can be found in /app_plugins folder too (#13597)
Fixes https://github.com/umbraco/Umbraco-CMS/issues/13565
2022-12-20 07:00:07 +01:00
Elitsa MarinovskaandGitHub fef793326f New Backoffice: Health check controller (#13543)
* Adding health check controllers - getAll & getGroupByName

* Adding HealthCheckGroup mapper

* Adding viewModels

* Adding a factory for building a health check group with result view model

* Registering the mapper and factory

* Updating OpenApi.json

* Remove unnecessary checks - we instantiate the target before calling the Map()

* Adding ProducesResponseType for GetAll()

* Fixing usings

* Making checks required for a health check group

* Adding OK() around result to be explicit

* Adding default values to skip and take

* Adding Umbraco.Code comments

* Removing ? from HealthCheckGroupWithResultViewModel return type

* Move the grouping creation to the factory

* Adding Actions[] for each health check + mapping

* Defaulting ValueRequired to false

* Refactoring routes - from health-check to health-check-group

* Move to HealthCheckGroup folder

* Fix OpenApi.json

* Changing class name and making Key of HealthCheckActionViewModel non-nullable

* Fixing namespace

* Migrating ExecuteAction endpoint

* Add execute-action endpoint to OpenApi.json

* Use Task.FromResult() around the action result

* Fixing namespaces and swagger group name

* Fixing naming of the key in the health check action

* Fix tag names in OpenApi.json
2022-12-19 13:50:18 +01:00
Ronald Barendse 532636cdbe Also fix GetBackOfficeUrl in UrlHelperExtensions 2022-12-19 12:04:35 +01:00
Ronald Barendse 900dd22277 Rename fixed extension method to GetUmbracoBackOfficeUrl and obsolete old one 2022-12-19 11:52:48 +01:00
Ronald Barendse b457734f18 Fix GetBackOfficeUrl extension method 2022-12-19 11:31:18 +01:00
Bjarne FyrstenborgandMichael Latouche 05a511a16c Only show rollback button if allowed action 2022-12-18 01:26:04 +01:00
Kenn Jacobsenandnikolajlauridsen d173a99fc8 Support space (and more) in tag groups (#13589) 2022-12-16 14:24:51 +01:00
nikolajlauridsen 6835436ed5 Merge remote-tracking branch 'origin/v10/dev' into v11/dev 2022-12-16 14:24:17 +01:00
Kenn Jacobsenandnikolajlauridsen a5a80fdd41 Multi URL picker improvements for V11 (#13586)
* Use bulk lookup to find URLs for multi URL picker items

* Make sure URLs and anchors are loaded correctly when no culture is supplied
2022-12-16 13:07:40 +01:00
Kenn JacobsenandGitHub aee1d70f64 Multi URL picker improvements for V11 (#13586)
* Use bulk lookup to find URLs for multi URL picker items

* Make sure URLs and anchors are loaded correctly when no culture is supplied
2022-12-16 13:06:27 +01:00
Kenn Jacobsenandnikolajlauridsen a897e3bdd3 Improved support for TinyMCE custom style formats (#13582) 2022-12-16 12:42:50 +01:00
Kenn JacobsenandGitHub 7b0f678c38 Improved support for TinyMCE custom style formats (#13582) 2022-12-16 12:41:19 +01:00
Ronald BarendseandElitsa Marinovska 48f4d8b7d1 Set redirect URL when building model (#12969)
Co-authored-by: Elitsa Marinovska <elm@umbraco.dk>
(cherry picked from commit 544cb30602)
2022-12-16 11:25:00 +01:00
544cb30602 Set redirect URL when building model (#12969)
Co-authored-by: Elitsa Marinovska <elm@umbraco.dk>
2022-12-16 11:17:56 +01:00
Nikolaj adfc38503c Upgrade BPlusTree dependency 2022-12-15 14:06:59 +01:00
Nikolaj e86b90faff Merge branch 'v11/dev' into v12/dev 2022-12-15 14:03:22 +01:00
Nikolaj 0234c5b637 Roll back BPlusTree dependency 2022-12-15 13:56:57 +01:00
Bjarke Berg ace43452e4 Merge remote-tracking branch 'origin/v11/dev' into v11/dev 2022-12-15 10:36:23 +01:00
Bjarke Berg 6f4b60c76c Updated Nuget packages 2022-12-15 10:36:13 +01:00
MoleandGitHub 0b04ae76da New backoffice: Redirect Url Management controller (#13572)
* Add status endpoint

* Refactor GetStatus to use a factory for the viewmodel

* Move controllers to correct namespace

* Add response type to GetStatus

* Create query endpoint

* Create GetAll endpoint

* Add by key

* Add delete by key

* Rename enabled controller

* Add SetEnabled endpoint

* Update OpenApi.json

* Replace query endpoint with a optional filter parameter

* Use enum to enabled and disable url tracking

* Update OpenApi.json

* Add bad request response type to GetAll endpoint
2022-12-15 10:04:44 +01:00
Nikolaj 2bab96fb85 Merge remote-tracking branch 'origin/v11/dev' into v12/dev 2022-12-15 09:56:28 +01:00
Nikolaj 1c2b5d34fd Merge remote-tracking branch 'origin/v10/dev' into v11/dev
# Conflicts:
#	src/Umbraco.Core/EmbeddedResources/Lang/en.xml
#	src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/prevalue/blockgrid.blockconfiguration.controller.js
2022-12-15 09:32:03 +01:00
Bjarke Berg aec88e8418 Merge remote-tracking branch 'origin/v11/dev' into v12/dev 2022-12-14 09:11:30 +01:00
Bjarke Berg cec87e400f post merge fix 2022-12-14 09:09:20 +01:00
Bjarke Berg fd974a416c Merge remote-tracking branch 'origin/v10/dev' into v11/dev
# Conflicts:
#	src/Umbraco.Web.UI.Client/src/views/packages/views/repo.html
#	tests/Umbraco.Tests.UnitTests/Umbraco.Web.Common/Routing/InstallAreaRoutesTests.cs
2022-12-14 08:51:45 +01:00
c4b83972bc Map AdditionalData (#13567)
* Map AdditionalData

Signed-off-by: Zeegaan <nge@umbraco.dk>

* Re-implement private setter

* Remove obsolete MapAll condition

Signed-off-by: Zeegaan <nge@umbraco.dk>
Co-authored-by: Zeegaan <nge@umbraco.dk>
2022-12-13 15:04:39 +01:00
Bjarke BergandGitHub 76c99772a0 Merge pull request #13571 from umbraco/v11/feature/loggingsettingsextensions
Change `GetAbsoluteLoggingPath` to extension method
2022-12-13 10:28:27 +01:00
Sebastiaan Janssen d5e1c7398f Disable healthChecks test for now as it has different results on the build server versus local machine 2022-12-13 09:13:36 +01:00
Ronald Barendse a49151f552 Change GetAbsoluteLoggingPath to extension method 2022-12-13 09:11:59 +01:00
Sebastiaan Janssen ca8f84f254 Simplify healthcheck button selector 2022-12-12 18:33:50 +01:00
Sebastiaan Janssen 2e4db50781 Fix wrong expectation in the security health checks 2022-12-12 16:58:56 +01:00
Sebastiaan Janssen b366b26f19 Fix failing integration test (runtime mode was added to system info) 2022-12-12 15:48:36 +01:00
Kenn JacobsenandGitHub e397ac9011 REST-ify dictionary and language controllers (#13531)
* Update signatures to always return ActionResult<> or IActionResult

* Make a few endpoints more RESTish

* Update OpenAPI json
2022-12-12 15:03:36 +01:00
1fd4ed1de7 V12: Named json options (#13537)
* Introduce named JSON options for specific input/output JSON formatting

* Handle empty objects

* Remove obsolete attributes

* Update src/Umbraco.Cms.Api.Management/DependencyInjection/MvcBuilderExtensions.cs

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

* Add constant for Backoffice NamedJsonOptions

Co-authored-by: kjac <kja@umbraco.dk>
Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>
Co-authored-by: Zeegaan <nge@umbraco.dk>
2022-12-12 14:15:54 +01:00
Sebastiaan Janssen 5c993ea3c6 Merge branch 'v11/dev' into v11/contrib 2022-12-12 13:59:03 +01:00
TiffanyandMichael Latouche 105670dcc1 Tree Roots are H1 2022-12-10 19:03:55 +01:00
Matthew WiseandMichael Latouche ec56778c9f standarising ActionLetter and ActionName for IAction 2022-12-10 01:59:45 +01:00
Kenn JacobsenandGitHub 801966f1ae Created a common library for the APIs (#13530)
* Created a common library for the APIs and moved stuff that is required for the new content API. Also moved the versioned backoffice API route handling to the management API where it belongs.

* Remove test auth attribute from Media
2022-12-09 08:52:17 +01:00
Bjarne FyrstenborgandMichael Latouche 2d2d8df82e Show published in tracked references 2022-12-09 01:00:07 +01:00
sofietoftandNikolaj 311c11074f Updated docs links to point to new platform (#13426)
* Updated docs links to point to new platform

* Update settingsdashboardintro.html

Co-authored-by: nikolajlauridsen <nikolajlauridsen@protonmail.ch>
2022-12-08 14:50:04 +01:00
Jacob OvergaardandGitHub 63e4adca92 Tree picker support for selecting containers (#13507)
Fixes https://github.com/umbraco/Umbraco-CMS/issues/13463
2022-12-07 15:21:15 +01:00
Bjarke Berg f3396a04fc Merge remote-tracking branch 'origin/v11/dev' into v12/dev
# Conflicts:
#	src/Umbraco.Cms.ManagementApi/Controllers/Security/BackOfficeController.cs
#	tests/Umbraco.Tests.AcceptanceTest/package-lock.json
#	tests/Umbraco.Tests.AcceptanceTest/package.json
2022-12-07 11:42:39 +01:00
Bjarke Berg b491b8c7a3 Merge remote-tracking branch 'origin/v10/dev' into v11/dev
# Conflicts:
#	src/JsonSchema/AppSettings.cs
#	src/Umbraco.Core/Configuration/Models/MarketplaceSettings.cs
#	src/Umbraco.Web.UI.Client/src/views/packages/views/repo.controller.js
#	src/Umbraco.Web.UI.Client/src/views/packages/views/repo.html
2022-12-07 10:57:32 +01:00
Bjarke BergandGitHub 388daf88c2 Merge pull request #13533 from umbraco/v11/feature/merge_v10.4_into_v11.1
V11/feature/merge v10.4 into v11.1
2022-12-07 10:55:59 +01:00
Bjarke BergandGitHub 519b3295ee Merge pull request #13532 from umbraco/revert-13528-v11/feature/merge_v10.4_into_v11.1
Revert "Merge v10.4 into v11.1"
2022-12-07 10:55:32 +01:00
Bjarke BergandGitHub 685193df77 Revert "Merge v10.4 into v11.1 (#13528)"
This reverts commit 443e8a8272.
2022-12-07 10:53:09 +01:00
+17 443e8a8272 Merge v10.4 into v11.1 (#13528)
* Bump version

* Add PrivateAssets="all" to mangement api project reference (#13249)

* Bump version

* Use the actual save function for saving the copy (#13066)

* Use the actual save function for saving the copy

* PR feedback

(cherry picked from commit 3802097a32)

* Unbreak breaking change in #13066 (#13288)

(cherry picked from commit e4741b0c64)

* Bump version to 10.3.2

* Parse lockId as invariant (#13284)

Co-authored-by: Zeegaan <nge@umbraco.dk>
(cherry picked from commit 272e922020)

* Allow for configuration of additional languages to install and ensure one is set as default. (#13290)

* Allow for configuration of additional languages to install and ensure one is set as default.

* Amended install default language method to handle invalid ISO codes and ensure the first specified language is always made the default.

* Removed unnecessary using.

* Apply suggestions from code review

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

* Clean up.

* Update src/Umbraco.Infrastructure/Migrations/Install/DatabaseDataCreator.cs

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

Co-authored-by: Ronald Barendse <ronald@barend.se>
Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>

* Updated Smidge (#13331)

* Fix casing in fileSystemBasePath (#13306)

* Add guard statement (#13340)

* Move block grid single area rendering to its own dedicated view (#13359)

* Block Grid Editor Improvements (#13282)

* remove console log

* Updated references for Forms and Deploy in JSON schema project. (#13411)

* Enable single block mode (#13216)

* Enable single block mode

* Fixes tests, and adds test for single block mode output type

* Update src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/BlockListPropertyValueConverter.cs

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

* Update src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/BlockListPropertyValueConverter.cs

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

* Fix breaking change

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

* Block Grid Editor: Removal of the forced placement feature (#13400)

* removal of the forceLeft/forceRight code

* removal of forced placement in css

* bring back removed code

* V10: AllowedUploadFiles appsetting not working (#13408)

* Add new Settings

* Use new settings instead of old ones

* Implement AllowedUploadedFiles value to be copied to AllowedUplayedFileExtensions

* Obsolete old settings

* Rename DisallowedUploadFileExtensions

* Implement same fix for DisallowedUploadFiles

* Use new settings for backoffice server variables

* Update the correct setting

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

* Feature: Media Picker drag and drop upload directly on property editor (#13393)

* prototype drag and drop upload

* Add upload image endpoint

* Add MediaPickerThreeController.cs

* Revert "Add upload image endpoint"

This reverts commit 4bb5865480.

* Update IIOHelper dependency

* show preview when uploading a new media item

* open uploaded media in media entry editor

* map data from uploaded media entry to support cropper

* add crop data to uploaded media item

* remove media library buttons for media entries not created in the media library

* Implement temp images save & add to media picker 3

* Implement ITemporaryImageService

* Remove save logic from MediaPicker3PropertyEditor

* Dont use a TempImageDto

* Add GetByAlias endpoint

* Add additonal xml doc

* Refactor to take array of aliases

* Add FromQuery attribute

* Formatting

* add resource to get media types by alias

* validate file size and file type based on server variables

* Update OpenApi.json
Add media picker three to BackOfficeServerVariables

* rename endpoint to upload media

* Use baseurl Method

* Dont upload in rte folder

* pass params correctly to end point

* queue files before uploading

* handle invalid files

* progress bar design adjustments

* only create data url for images

* disable edit and name buttons when uploading

* fix missing error messages for invalid files

* add temp location to media entry

* Add startNode to TemporaryImageService.cs

* Refactor get by alias

* Rename to GetAllFiltered

* use getAllFiltered method

* remove autoselect option

* fix missing alias when selecting media type

* fix file filter

* don't overwrite invalid entries from dropping new files

* add disallowed files to filter

* remove console.log

* move media uploader logic to reusable function

* fix missing tmp location

* attach media type alias to the mediaEntry

* support readonly mode

* show discard changes when files has been dropped

* add disabled prop to button group

* emit events when upload queue starts and ends

* pass node to media picker property editor

* add service to keep track of all uploads in progress

* add upload in progress to uploadTracker when the queue starts and ends

* disabled buttons when any upload is in progress

* return a subscription to align with eventsService

* Fix up cases where StartNodeId was null

* scope css

* Show filename in dialog for selecting media type

* reuse translation from media library dropzone

* Don't check for only images

* Remove composer

* Add mediaTypeAlias to TemporaryImageService

* Rename ITemporaryImageService to ITemporaryMediaService

* prefix client side only props with $ so we don't send unnecessary data to the server

* use prefixed dataURL in media entry editor

* render icon for non images

* fix auto select media type

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

* V10: merge v8 blobstorage file deletion fix (#13415)

* Implement fix from v8 https://github.com/umbraco/Umbraco-CMS/pull/11998

* Clean-up

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

* Bump socket.io-parser from 4.0.4 to 4.0.5 in /src/Umbraco.Web.UI.Client

Bumps [socket.io-parser](https://github.com/socketio/socket.io-parser) from 4.0.4 to 4.0.5.
- [Release notes](https://github.com/socketio/socket.io-parser/releases)
- [Changelog](https://github.com/socketio/socket.io-parser/blob/main/CHANGELOG.md)
- [Commits](https://github.com/socketio/socket.io-parser/compare/4.0.4...4.0.5)

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

Signed-off-by: dependabot[bot] <support@github.com>

* update block grid panel name (#13325)

Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>

* Bump async from 2.6.3 to 2.6.4 in /src/Umbraco.Web.UI.Client

Bumps [async](https://github.com/caolan/async) from 2.6.3 to 2.6.4.
- [Release notes](https://github.com/caolan/async/releases)
- [Changelog](https://github.com/caolan/async/blob/v2.6.4/CHANGELOG.md)
- [Commits](https://github.com/caolan/async/compare/v2.6.3...v2.6.4)

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

Signed-off-by: dependabot[bot] <support@github.com>

* Bump minimist from 1.2.5 to 1.2.7 in /src/Umbraco.Web.UI.Client

Bumps [minimist](https://github.com/minimistjs/minimist) from 1.2.5 to 1.2.7.
- [Release notes](https://github.com/minimistjs/minimist/releases)
- [Changelog](https://github.com/minimistjs/minimist/blob/main/CHANGELOG.md)
- [Commits](https://github.com/minimistjs/minimist/compare/v1.2.5...v1.2.7)

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

Signed-off-by: dependabot[bot] <support@github.com>

* Bump eventsource from 1.1.0 to 1.1.2 in /src/Umbraco.Web.UI.Client

Bumps [eventsource](https://github.com/EventSource/eventsource) from 1.1.0 to 1.1.2.
- [Release notes](https://github.com/EventSource/eventsource/releases)
- [Changelog](https://github.com/EventSource/eventsource/blob/master/HISTORY.md)
- [Commits](https://github.com/EventSource/eventsource/compare/v1.1.0...v1.1.2)

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

Signed-off-by: dependabot[bot] <support@github.com>

* updated package-lock

* Bump minimatch from 3.0.4 to 3.1.2 in /src/Umbraco.Web.UI.Client

Bumps [minimatch](https://github.com/isaacs/minimatch) from 3.0.4 to 3.1.2.
- [Release notes](https://github.com/isaacs/minimatch/releases)
- [Commits](https://github.com/isaacs/minimatch/compare/v3.0.4...v3.1.2)

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

Signed-off-by: dependabot[bot] <support@github.com>

* Block Grid Editor sorting directive (#13391)

* make sure area border is on top of block views.

* rename class to avoid confusion

* change witch UI goes on top on hover

* Description informing all blocks are allowed when none is configured.

* add 'When empty'

* Sort mode

* ability to switch out property actions

* enter and exit sortmode from property actions

* gridsortblock

* rename block class to use sortblock

* Sort mode styling

* remove unused css selector

* fixing style for inline-creat button to appear above and not when hovering contextbar

* work on block grid inline editor

* use uui-button + enable installing demo blocks when its not the first dataType of this kind.

* improvements to inline editing POC

* update title of area config overlay editor

* reset columnSpan if no column span options is defined.

* Inline editing

* remove html comment

* remove code for transfer of stylesheets

* ability to hide label from directive

* inline editing using slots to render the umb-property in light dom

* remove property editor proxies when moving a block to a new area/block/context

* minor adjustments to custom views

* use individual slots for each area.

* Inline editing

* a little smaller rte min-height

* fire Custom focus/blur event for Block Grid Editor to catch for focus imitation

* disable inline editing prevalue field when custom view is set

* Fix scroll parent block into view

* initial work on sorter directive

* remove mediaBlock controller

* initial notes and structure

* further concept work

* remove consol log

* CSS for getting bigger areas

* removal of the forceLeft/forceRight code

* proven concept

* fix grid space detection. vertical/horizontal

* clean up and notes

* move into inner containers as well

* use last available index pr default

* boundary selector, for improved choise of dropping into an area

* hide last inline create button when dragging around

* remove console.log

* removal of forced placement in css

* default config and clean up

* notes

* bring back removed code

* show area ui when in dragging mode

* more specific selector

* drop allowance + clean up

* notes and clean up

* auto scroll

* turn --umb-block-grid--dragging-mode into conditional CSS Custom Property

* auto scroll

* refactoring

* fix condition mistake

* scope.config.resolveVerticalDirection

* wrap up simple setDragImage solution

* bring back vm.notifyVisualUpdate and clean up

* make draggableSelector optional, fallback to element

* implement umb-block-grid-sorter for Area PreValue editor

* remove sortableJS dependency

* remove sortableJs from dependencies

* wups, bring back the comma

* removed sortablejs from package-lock

* finished implementation of sorter for PreValue Block Areas

* fix for FireFox shadowDom issue, contains temprorary code.

* stop auto scroll

* make full thing dragable

* fix firefox issue (applying translateZ)

* comment

* make block fit in context columns

* revert element to where it came from if sync could not succeed + clean up

* ensure block does not push the amount of columns, this occourse when dragging item around.

* take horizontalPlaceAfter into account

* implement horizontalPlaceAfter in Areas Prevalue editor

* clean up dependencies

* Shift related el to first in row or last in row when there is no horizontal room

* clean up and correct calculation

* remove unused attribute

* revert to using el.getBoundingClientRect(), as the config.draggableSelector is not available for the placeholder item.

* bind model via dedicated binding to ensure it stay connected with the source model

* Update src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/prevalue/umb-block-grid-area-editor.html

Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>

* fix eslint issues

* ensure missingColumnWidth is above 0

* Do not allow dragging something thats not found in the model.

* remove as this is not an error.

* update to Flexbox solution

* as the complex model does not change we can use single way binding

Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>

* Block Grid Editor adjust while sorting (#13442)

* make sure area border is on top of block views.

* rename class to avoid confusion

* change witch UI goes on top on hover

* Description informing all blocks are allowed when none is configured.

* add 'When empty'

* Sort mode

* ability to switch out property actions

* enter and exit sortmode from property actions

* gridsortblock

* rename block class to use sortblock

* Sort mode styling

* remove unused css selector

* fixing style for inline-creat button to appear above and not when hovering contextbar

* work on block grid inline editor

* use uui-button + enable installing demo blocks when its not the first dataType of this kind.

* improvements to inline editing POC

* update title of area config overlay editor

* reset columnSpan if no column span options is defined.

* Inline editing

* remove html comment

* remove code for transfer of stylesheets

* ability to hide label from directive

* inline editing using slots to render the umb-property in light dom

* remove property editor proxies when moving a block to a new area/block/context

* minor adjustments to custom views

* use individual slots for each area.

* Inline editing

* a little smaller rte min-height

* fire Custom focus/blur event for Block Grid Editor to catch for focus imitation

* disable inline editing prevalue field when custom view is set

* Fix scroll parent block into view

* initial work on sorter directive

* remove mediaBlock controller

* initial notes and structure

* further concept work

* remove consol log

* CSS for getting bigger areas

* removal of the forceLeft/forceRight code

* proven concept

* fix grid space detection. vertical/horizontal

* clean up and notes

* move into inner containers as well

* use last available index pr default

* boundary selector, for improved choise of dropping into an area

* hide last inline create button when dragging around

* remove console.log

* removal of forced placement in css

* default config and clean up

* notes

* bring back removed code

* show area ui when in dragging mode

* more specific selector

* drop allowance + clean up

* notes and clean up

* auto scroll

* turn --umb-block-grid--dragging-mode into conditional CSS Custom Property

* auto scroll

* refactoring

* fix condition mistake

* scope.config.resolveVerticalDirection

* wrap up simple setDragImage solution

* bring back vm.notifyVisualUpdate and clean up

* make draggableSelector optional, fallback to element

* implement umb-block-grid-sorter for Area PreValue editor

* remove sortableJS dependency

* remove sortableJs from dependencies

* wups, bring back the comma

* removed sortablejs from package-lock

* finished implementation of sorter for PreValue Block Areas

* fix for FireFox shadowDom issue, contains temprorary code.

* stop auto scroll

* make full thing dragable

* fix firefox issue (applying translateZ)

* comment

* make block fit in context columns

* revert element to where it came from if sync could not succeed + clean up

* ensure block does not push the amount of columns, this occourse when dragging item around.

* take horizontalPlaceAfter into account

* implement horizontalPlaceAfter in Areas Prevalue editor

* clean up dependencies

* Shift related el to first in row or last in row when there is no horizontal room

* clean up and correct calculation

* remove unused attribute

* revert to using el.getBoundingClientRect(), as the config.draggableSelector is not available for the placeholder item.

* bind model via dedicated binding to ensure it stay connected with the source model

* Update src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/prevalue/umb-block-grid-area-editor.html

Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>

* fix eslint issues

* ensure missingColumnWidth is above 0

* Do not allow dragging something thats not found in the model.

* remove as this is not an error.

* update to Flexbox solution

* as the complex model does not change we can use single way binding

* Adjust columnSpan to context container, keep start columnSpan as the target for the calculation.

* change let to const

* Revert "change let to const"

This reverts commit fe19f8c5ed.

Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>

* Block Grid Editor - make prevalue overlay medium sized (#13443)

* make sure area border is on top of block views.

* rename class to avoid confusion

* change witch UI goes on top on hover

* Description informing all blocks are allowed when none is configured.

* add 'When empty'

* Sort mode

* ability to switch out property actions

* enter and exit sortmode from property actions

* gridsortblock

* rename block class to use sortblock

* Sort mode styling

* remove unused css selector

* fixing style for inline-creat button to appear above and not when hovering contextbar

* work on block grid inline editor

* use uui-button + enable installing demo blocks when its not the first dataType of this kind.

* improvements to inline editing POC

* update title of area config overlay editor

* reset columnSpan if no column span options is defined.

* Inline editing

* remove html comment

* remove code for transfer of stylesheets

* ability to hide label from directive

* inline editing using slots to render the umb-property in light dom

* remove property editor proxies when moving a block to a new area/block/context

* minor adjustments to custom views

* use individual slots for each area.

* Inline editing

* a little smaller rte min-height

* fire Custom focus/blur event for Block Grid Editor to catch for focus imitation

* disable inline editing prevalue field when custom view is set

* Fix scroll parent block into view

* initial work on sorter directive

* remove mediaBlock controller

* initial notes and structure

* further concept work

* remove consol log

* CSS for getting bigger areas

* removal of the forceLeft/forceRight code

* proven concept

* fix grid space detection. vertical/horizontal

* clean up and notes

* move into inner containers as well

* use last available index pr default

* boundary selector, for improved choise of dropping into an area

* hide last inline create button when dragging around

* remove console.log

* removal of forced placement in css

* default config and clean up

* notes

* bring back removed code

* show area ui when in dragging mode

* more specific selector

* drop allowance + clean up

* notes and clean up

* auto scroll

* turn --umb-block-grid--dragging-mode into conditional CSS Custom Property

* auto scroll

* refactoring

* fix condition mistake

* scope.config.resolveVerticalDirection

* wrap up simple setDragImage solution

* bring back vm.notifyVisualUpdate and clean up

* make draggableSelector optional, fallback to element

* implement umb-block-grid-sorter for Area PreValue editor

* remove sortableJS dependency

* remove sortableJs from dependencies

* wups, bring back the comma

* removed sortablejs from package-lock

* finished implementation of sorter for PreValue Block Areas

* fix for FireFox shadowDom issue, contains temprorary code.

* stop auto scroll

* make full thing dragable

* fix firefox issue (applying translateZ)

* comment

* make block fit in context columns

* revert element to where it came from if sync could not succeed + clean up

* ensure block does not push the amount of columns, this occourse when dragging item around.

* take horizontalPlaceAfter into account

* implement horizontalPlaceAfter in Areas Prevalue editor

* clean up dependencies

* Shift related el to first in row or last in row when there is no horizontal room

* clean up and correct calculation

* remove unused attribute

* revert to using el.getBoundingClientRect(), as the config.draggableSelector is not available for the placeholder item.

* bind model via dedicated binding to ensure it stay connected with the source model

* Update src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/prevalue/umb-block-grid-area-editor.html

Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>

* fix eslint issues

* ensure missingColumnWidth is above 0

* Do not allow dragging something thats not found in the model.

* remove as this is not an error.

* update to Flexbox solution

* as the complex model does not change we can use single way binding

* Adjust columnSpan to context container, keep start columnSpan as the target for the calculation.

* make prevalue editor overlay medium size

Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>

* block grid editor visual adjustments (#13446)

* make sure area border is on top of block views.

* rename class to avoid confusion

* change witch UI goes on top on hover

* Description informing all blocks are allowed when none is configured.

* add 'When empty'

* Sort mode

* ability to switch out property actions

* enter and exit sortmode from property actions

* gridsortblock

* rename block class to use sortblock

* Sort mode styling

* remove unused css selector

* fixing style for inline-creat button to appear above and not when hovering contextbar

* work on block grid inline editor

* use uui-button + enable installing demo blocks when its not the first dataType of this kind.

* improvements to inline editing POC

* update title of area config overlay editor

* reset columnSpan if no column span options is defined.

* Inline editing

* remove html comment

* remove code for transfer of stylesheets

* ability to hide label from directive

* inline editing using slots to render the umb-property in light dom

* remove property editor proxies when moving a block to a new area/block/context

* minor adjustments to custom views

* use individual slots for each area.

* Inline editing

* a little smaller rte min-height

* fire Custom focus/blur event for Block Grid Editor to catch for focus imitation

* disable inline editing prevalue field when custom view is set

* Fix scroll parent block into view

* initial work on sorter directive

* remove mediaBlock controller

* initial notes and structure

* further concept work

* remove consol log

* CSS for getting bigger areas

* removal of the forceLeft/forceRight code

* proven concept

* fix grid space detection. vertical/horizontal

* clean up and notes

* move into inner containers as well

* use last available index pr default

* boundary selector, for improved choise of dropping into an area

* hide last inline create button when dragging around

* remove console.log

* removal of forced placement in css

* default config and clean up

* notes

* bring back removed code

* show area ui when in dragging mode

* more specific selector

* drop allowance + clean up

* notes and clean up

* auto scroll

* turn --umb-block-grid--dragging-mode into conditional CSS Custom Property

* auto scroll

* refactoring

* fix condition mistake

* scope.config.resolveVerticalDirection

* wrap up simple setDragImage solution

* bring back vm.notifyVisualUpdate and clean up

* make draggableSelector optional, fallback to element

* implement umb-block-grid-sorter for Area PreValue editor

* remove sortableJS dependency

* remove sortableJs from dependencies

* wups, bring back the comma

* removed sortablejs from package-lock

* finished implementation of sorter for PreValue Block Areas

* fix for FireFox shadowDom issue, contains temprorary code.

* stop auto scroll

* make full thing dragable

* fix firefox issue (applying translateZ)

* comment

* make block fit in context columns

* revert element to where it came from if sync could not succeed + clean up

* ensure block does not push the amount of columns, this occourse when dragging item around.

* take horizontalPlaceAfter into account

* implement horizontalPlaceAfter in Areas Prevalue editor

* clean up dependencies

* Shift related el to first in row or last in row when there is no horizontal room

* clean up and correct calculation

* remove unused attribute

* revert to using el.getBoundingClientRect(), as the config.draggableSelector is not available for the placeholder item.

* bind model via dedicated binding to ensure it stay connected with the source model

* Update src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/prevalue/umb-block-grid-area-editor.html

Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>

* fix eslint issues

* ensure missingColumnWidth is above 0

* Do not allow dragging something thats not found in the model.

* remove as this is not an error.

* update to Flexbox solution

* as the complex model does not change we can use single way binding

* Adjust columnSpan to context container, keep start columnSpan as the target for the calculation.

* make prevalue editor overlay medium size

* more white borders on UI

* move Catalogue appearance to Advanced

Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>

* Display media trashed state on custom view for image demo block (#13448)

* Block Grid Editor translations and Area size keyboard navigation (#13450)

* use custom prop for calculated width (#13451)

* Bump engine.io and socket.io in /src/Umbraco.Web.UI.Client

Bumps [engine.io](https://github.com/socketio/engine.io) and [socket.io](https://github.com/socketio/socket.io). These dependencies needed to be updated together.

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

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

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

Signed-off-by: dependabot[bot] <support@github.com>

* Cherry pick #13373 to v10/dev

* remove the hidding of catelouge appearance as its not located under advance (#13456)

* Fix preview issue for new (empty) variants (#13455)

* Fix save and preview for new (unsaved) variants

* Rework & simplify

* Rollback improvements (#13452)

* Rollback improvements - hide draft version, allow rolling back to last published version

* UX improvements to rollback, revert some overly complex logic in favor of better UX

* Ensure title update when changing rollback version

* Clean up

* Fix rollback playwright text

* Cherry pick #13404 to v10

* Delete references using custom relation types (#13389)

undefined

* V11: Fix ordering by published in list of content (#13474)

* Update sort statement to use published field for invariant content

* Order by published if invariant

* Add support for tags in block editors and nested content (#13412)

* feat: add tags extension points and remove hardcoded tags handling

* feat: allow tags editor in nested content and block editors

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

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

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

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

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

* Ensure that all automatic relation types are updated (#13470)

* Make sure contexbar fits within the available space (#13467)

* Make sure contexbar fits within the available space

* Ensuring context bar moves above, no matter size of it.

* Fixing apperance of connection-fixers

* do not set layout gaps (#13496)

* V10/feature/fixing flaky acceptance test (#13473)

* Updated Forms dependency for JSON schema to the latest version. (#13505)

* Accessibility - Fix Packages - Modal - Empty buttons (#13114)

* Changing the way we create the temp file for SQLite file (#13439)

* Fix concurrency issue in UmbracoMapper (#13524)

* Add logging to UmbracoMapper

* Add NullLogger to tests

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

* Allow indexing variant nodes when not all variants are published - fixes issues 11383. (#12669)

* This fixes issues 11383.
The introduction of the new Examine library caused an unintended consequence that it stopped indexing of nodes with language variants on them when one of the variants was unpublished.

These changes align ValueSetValidationStatus.Filtered to indicate that a node is intended as filtered out of a search, not that parts of its contents had been excluded from the result.

This brings it inline with how it is used in Umbraco.Examine.Lucene/UmbracoContentIndex

Unit tests changed to indicate the intent of ValueSetValidationStatus.Filtered

Change to UmbracoViewPage to make model variable nullable (because the solution wouldn't build otherwise on 2022)

* revert to use explicit type instead of var

Co-authored-by: Nathan Woulfe <nathan@nathanw.com.au>
Co-authored-by: Bjarke Berg <mail@bergmania.dk>

* V11/feature/flaky test work (#13513) (#13527)

* Removed all the DeleteAllContent since I delete the doctypes in the before and after each functions which also deletes the content.

* fixed the test so it selects the specific button!

* I was dumb and forgot to remove the out commented code

* Added additional timeout so the pipeline has more time

* Removed language in settings because it was a duplicate of languages / languages

* Fixed the tests so they now check if each individual language that was created actually exists instead of checking for how many languages there are which could be flaky if another test touching the languages failed

* Bumped version

* Added a better locator for the buttons and increased timeouts

Signed-off-by: Zeegaan <nge@umbraco.dk>

Signed-off-by: Zeegaan <nge@umbraco.dk>
Co-authored-by: Andreas Zerbst <73799582+andr317c@users.noreply.github.com>

* Fix for issue 13017 - BeginUmbracoForm doesn't work with custom umbraco routes (#13103)

* Fix issue with custom Umbraco routes not working after submitting to a Surface controller

* Added comments

* Fixed breaking changes

* Fixed test by using correct new ctor

* Fixed initializtion of UmbracoRouteValueTransformer due to ambiguous ctor

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

* Rollback project imports

* Remove duplicated lines in translations

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Zeegaan <nge@umbraco.dk>
Co-authored-by: Nikolaj <nikolajlauridsen@protonmail.ch>
Co-authored-by: patrickdemooij9 <patrickdemooij98@hotmail.com>
Co-authored-by: Sebastiaan Janssen <sebastiaan@umbraco.com>
Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
Co-authored-by: Andy Butland <abutland73@gmail.com>
Co-authored-by: Ronald Barendse <ronald@barend.se>
Co-authored-by: Kenn Jacobsen <kja@umbraco.dk>
Co-authored-by: Niels Lyngsø <nsl@umbraco.dk>
Co-authored-by: Niels Lyngsø <niels.lyngso@gmail.com>
Co-authored-by: Søren Kottal <sk@ecreo.dk>
Co-authored-by: Zeegaan <nge@umbraco.dk>
Co-authored-by: Mads Rasmussen <madsr@hey.com>
Co-authored-by: Elitsa Marinovska <elm@umbraco.dk>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Blake Watt <bkclerke@users.noreply.github.com>
Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>
Co-authored-by: niekvanderreest <niekvanderreest@hotmail.com>
Co-authored-by: Bjarne Fyrstenborg <bjarne_fyrstenborg@hotmail.com>
Co-authored-by: Rasmus John Pedersen <mail@rjp.dk>
Co-authored-by: Andreas Zerbst <73799582+andr317c@users.noreply.github.com>
Co-authored-by: Jan Skovgaard <1932158+BatJan@users.noreply.github.com>
Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com>
Co-authored-by: Jonny Muir <jonnymoo@hotmail.com>
Co-authored-by: Nathan Woulfe <nathan@nathanw.com.au>
Co-authored-by: Justin Neville <67802060+justin-nevitech@users.noreply.github.com>
2022-12-07 08:51:00 +01:00
Bjarke Berg 2b6205a88c Remove duplicated lines in translations 2022-12-07 07:22:59 +01:00
MoleandGitHub 73515560b7 New backoffice: Token storage (#13519)
* Enable reference tokens

* Enable token validation

* Add Data protection
2022-12-07 06:48:53 +01:00
ustadstarandMichael Latouche f7e73fbff5 Fix check for existing userStatesFilter 2022-12-07 00:38:30 +01:00
Bjarke Berg e83e2dedb4 Rollback project imports 2022-12-06 13:32:06 +01:00
Bjarke Berg 962c1a1a5b Merge branch 'v10/dev' into v11/dev
# Conflicts:
#	src/Umbraco.Core/EmbeddedResources/Lang/en.xml
#	src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml
#	src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs
#	src/Umbraco.Web.UI.Client/src/views/packages/views/repo.html
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/blockgridui.less
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/prevalue/blockgrid.blockconfiguration.controller.js
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/prevalue/blockgrid.blockconfiguration.overlay.html
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/umbblockgridentries.component.js
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Branding/logo.spec.ts
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Login/login.spec.ts
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/macro.spec.ts
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/templates.spec.ts
2022-12-06 12:53:37 +01:00
Justin NevilleandBjarke Berg e2b8cc7060 Fix for issue 13017 - BeginUmbracoForm doesn't work with custom umbraco routes (#13103)
* Fix issue with custom Umbraco routes not working after submitting to a Surface controller

* Added comments

* Fixed breaking changes

* Fixed test by using correct new ctor

* Fixed initializtion of UmbracoRouteValueTransformer due to ambiguous ctor

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2022-12-06 12:40:47 +01:00
d08f21d638 Fix for issue 13017 - BeginUmbracoForm doesn't work with custom umbraco routes (#13103)
* Fix issue with custom Umbraco routes not working after submitting to a Surface controller

* Added comments

* Fixed breaking changes

* Fixed test by using correct new ctor

* Fixed initializtion of UmbracoRouteValueTransformer due to ambiguous ctor

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2022-12-06 12:39:43 +01:00
Andreas ZerbstandGitHub 2da4b725b1 V11/feature/flaky test work (#13513)
* Removed all the DeleteAllContent since I delete the doctypes in the before and after each functions which also deletes the content.

* fixed the test so it selects the specific button!

* I was dumb and forgot to remove the out commented code

* Added additional timeout so the pipeline has more time

* Removed language in settings because it was a duplicate of languages / languages

* Fixed the tests so they now check if each individual language that was created actually exists instead of checking for how many languages there are which could be flaky if another test touching the languages failed

* Bumped version

* Added a better locator for the buttons and increased timeouts
2022-12-06 10:34:03 +01:00
4e823982c7 Allow indexing variant nodes when not all variants are published - fixes issues 11383. (#12669)
* This fixes issues 11383.
The introduction of the new Examine library caused an unintended consequence that it stopped indexing of nodes with language variants on them when one of the variants was unpublished.

These changes align ValueSetValidationStatus.Filtered to indicate that a node is intended as filtered out of a search, not that parts of its contents had been excluded from the result.

This brings it inline with how it is used in Umbraco.Examine.Lucene/UmbracoContentIndex

Unit tests changed to indicate the intent of ValueSetValidationStatus.Filtered

Change to UmbracoViewPage to make model variable nullable (because the solution wouldn't build otherwise on 2022)

* revert to use explicit type instead of var

Co-authored-by: Nathan Woulfe <nathan@nathanw.com.au>
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2022-12-06 08:19:44 +01:00
5e03236e70 Allow indexing variant nodes when not all variants are published - fixes issues 11383. (#12669)
* This fixes issues 11383.
The introduction of the new Examine library caused an unintended consequence that it stopped indexing of nodes with language variants on them when one of the variants was unpublished.

These changes align ValueSetValidationStatus.Filtered to indicate that a node is intended as filtered out of a search, not that parts of its contents had been excluded from the result.

This brings it inline with how it is used in Umbraco.Examine.Lucene/UmbracoContentIndex

Unit tests changed to indicate the intent of ValueSetValidationStatus.Filtered

Change to UmbracoViewPage to make model variable nullable (because the solution wouldn't build otherwise on 2022)

* revert to use explicit type instead of var

Co-authored-by: Nathan Woulfe <nathan@nathanw.com.au>
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2022-12-06 08:17:58 +01:00
Kenn JacobsenandGitHub bc94b2e16c Rename management API from Umbraco.Cms.ManagementApi to Umbraco.Cms.Api.Management (#13512) 2022-12-02 11:33:02 +01:00
Jason ElkinandGitHub 96918a9f1f Improve system information/telemetry (#13159)
* Differentiate between IIS and IIS Express in system information telemetry

* Add runtime mode to system information telemetry
2022-12-02 09:03:23 +01:00
Corné HoskamandGitHub 9099bf44ac Added various Block Grid translations (NL) - Pt 2. (#13508)
* Added various translations

* Added another translation

* Change request

* Added various other area translations

* Resolve conflict

* Forgot one!

* Update nl.xml
2022-12-01 14:26:58 +01:00
0b95d5e1e5 Forward merge v11/dev to v12/dev (#13509)
* update marketplace url to its final, live url

* Added various Block Grid translations (EN & NL) (#13488)

* Added various translations

* Added another translation

* Change request

* Revert breaking changes adding IContextCache to deploy connectors (#13489)

* Remove breaking changes in Deploy connector interfaces

* Add extension methods for calling the new interface methods in a backwards-compatible way

* Create and pack empty file to add TFM dependency (#13475)

* Change login image to new SVG. (#13493)

* Only add global usings when ImplicitUsings is enabled (#13491)

* bump to rc6

* V11: Allow changing logging directory from configuration (#13485)

* Allow changing logging directory from configuration

* Clean up

* Missing return statement

* Apply suggestions from code review

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

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

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

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

* Move login.svg file

* Make sure contexbar fits within the available space (#13467)

* Make sure contexbar fits within the available space

* Ensuring context bar moves above, no matter size of it.

* Fixing apperance of connection-fixers

* Info panes not loading prerequisites (#13486)

* load relations immediately on init and remove call to non-existing function `appTabChange` on destroy

* load relations immediately on init and remove now not-used eventsService

* do not set layout gaps (#13496)

* Nuget updates (#13478)

* Updated nuget packages

* Remove npoco update

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

* Nuget updates (#13478)

* Updated nuget packages

* Remove npoco update

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

* Bump version to final

* V11/cherry pick flaky test (#13506)

* V10/feature/fixing flaky acceptance test (#13473)

* Bumped version

* Handle external authentication providers (#13487)

Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>
Co-authored-by: Corné Hoskam <choskam@hotmail.com>
Co-authored-by: Ronald Barendse <ronald@barend.se>
Co-authored-by: Niels Lyngsø <nsl@umbraco.dk>
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
Co-authored-by: nikolajlauridsen <nikolajlauridsen@protonmail.ch>
Co-authored-by: Andreas Zerbst <73799582+andr317c@users.noreply.github.com>
2022-12-01 12:50:28 +01:00
Kenn JacobsenandGitHub 2143d8c3fe Handle external authentication providers (#13487) 2022-12-01 10:38:24 +01:00
Andreas ZerbstandGitHub 2ce205953c V11/cherry pick flaky test (#13506)
* V10/feature/fixing flaky acceptance test (#13473)

* Bumped version
2022-12-01 08:55:33 +01:00
Nikolaj 934bb8be7a Merge tag 'release-11.0.0' into v11/dev
# Conflicts:
#	version.json
2022-12-01 08:29:47 +01:00
Justin NevilleandSebastiaan Janssen 8bf6a9246f Added aria label to time period on log dashboard 2022-11-30 16:20:31 +01:00
Justin NevilleandSebastiaan Janssen 88ff05a836 Allow empty valuesets to be indexed so the back-offce does not hang when rebuilding empty indexes 2022-11-30 16:19:17 +01:00
Markus JohanssonandSebastiaan Janssen d2ab80534a LogViewe: Adding support for destructed properties 2022-11-30 16:17:27 +01:00
Matthew CareandSebastiaan Janssen 67c60d8a19 Update to latest framework version
Update reference to old framework version in web site projects
2022-11-30 16:16:08 +01:00
Erik-Jan WestendorpandSebastiaan Janssen 4f129baebd Use constants instead of hardcoded strings 2022-11-30 16:13:47 +01:00
Lotte PitcherandGitHub da9eae1252 Remove reference to installing a local package via backoffice (#13330) 2022-11-30 16:08:54 +01:00
Lotte PitcherandGitHub af4333b8e4 Fixing some comments errors to reduce CodeQL warnings (#13327) 2022-11-30 16:01:36 +01:00
CyberReiterandSebastiaan Janssen 02dcf98e3d make use of spans in UriExtensions to make them faster 2022-11-30 15:56:47 +01:00
Vitor RodriguesandSebastiaan Janssen 7ad1e638e6 Re-use any existing ReloadableLogger
It's possible that consumers have already set up a bootstrap logger themselves before Umbraco had a chance too, if that's the case we just reload it.
2022-11-30 15:51:36 +01:00
Vitor RodriguesandSebastiaan Janssen d4c921264d Added missing content-type header to BootFailedMiddleware response
When Umbraco is configured with X-Content-Type-Options nosniff as is recommended (there's even a health check for it), any boot failure would simply show the html source code in the browser instead of properly rendering the html, as the content-type wasn't being set.
2022-11-30 15:48:46 +01:00
Marc GoodsonandGitHub 2461b7d805 Adjust the wording of some of the helper text around the new Block Grid editor (#13484) 2022-11-30 15:36:23 +01:00
Kristian Tolleshaug MørchandSebastiaan Janssen 69c725b3ec Ensure format processor is before quality processor. 2022-11-30 13:50:06 +01:00
Vlael LayugandMichael Latouche f7b42a50cc add default culture when there's only 1 language configured 2022-11-30 08:50:30 +01:00
nikolajlauridsen d713b383c9 Bump version to final 2022-11-29 16:40:47 +01:00
Bjarke Bergandnikolajlauridsen 18fd0c9ed7 Nuget updates (#13478)
* Updated nuget packages

* Remove npoco update

Co-authored-by: nikolajlauridsen <nikolajlauridsen@protonmail.ch>
2022-11-29 14:17:07 +01:00
6c13c87f15 Nuget updates (#13478)
* Updated nuget packages

* Remove npoco update

Co-authored-by: nikolajlauridsen <nikolajlauridsen@protonmail.ch>
2022-11-29 14:16:49 +01:00
Niels LyngsøandGitHub acbaaecbcc do not set layout gaps (#13496) 2022-11-29 13:35:07 +01:00
Callum WhyteandGitHub 5ef43cb4f0 Rename StaticServiceProvider namespace Umbraco.Cms.Core.DependencyInjection (#13239) 2022-11-29 12:22:57 +01:00
Bjarne FyrstenborgandGitHub 30a7bca0ef UserController should use getLocalDate from dateHelper (#13469)
* Use `getLocalDate` from dateHelper

* Remove duplicate import

* Keep function getLocalDate but use dateHelper

* Mark function as deprecated
2022-11-29 11:56:12 +01:00
Bjarke Berg abd490f460 Merge remote-tracking branch 'origin/release/11.0' into release/11.0 2022-11-29 10:36:13 +01:00
MoleandGitHub 1875568e0b Merge pull request #13494 from umbraco/v12/fix/merge-with-v11-dev
Merge v11/dev to v12/dev
2022-11-29 10:31:12 +01:00
Jacob OvergaardandGitHub b5a3dcb81e Info panes not loading prerequisites (#13486)
* load relations immediately on init and remove call to non-existing function `appTabChange` on destroy

* load relations immediately on init and remove now not-used eventsService
2022-11-29 10:07:52 +01:00
Niels Lyngsøandnikolajlauridsen b9990f23db Make sure contexbar fits within the available space (#13467)
* Make sure contexbar fits within the available space

* Ensuring context bar moves above, no matter size of it.

* Fixing apperance of connection-fixers
2022-11-29 09:59:49 +01:00
Bjarke Berg 9bed0cde9a Move login.svg file 2022-11-29 09:30:11 +01:00
Bjarke Berg a76d68bd37 Merge remote-tracking branch 'origin/release/11.0' into v11/dev
# Conflicts:
#	version.json
2022-11-29 08:19:27 +01:00
kjac 7329113885 Fix merge 2022-11-29 07:29:23 +01:00
bfe9579a0c V11: Allow changing logging directory from configuration (#13485)
* Allow changing logging directory from configuration

* Clean up

* Missing return statement

* Apply suggestions from code review

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

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

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

Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
2022-11-29 07:27:59 +01:00
kjac d8c62080e6 Merge branch 'v11/dev' into v12/fix/merge-with-v11-dev
# Conflicts:
#	src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs
2022-11-29 07:26:14 +01:00
Roy BerrisandGitHub 1ed24e78c8 Notification documentation (#13207) 2022-11-28 23:26:59 +01:00
CyberReiterandSebastiaan Janssen f99378c5d3 Use ToArray instead of ToList 2022-11-28 23:18:54 +01:00
Erik-Jan WestendorpandGitHub 65dd52ad05 Add AddManifestFilter extension method to UmbracoBuilder.CollectionBuilders.cs (#13161) 2022-11-28 23:14:24 +01:00
Lars-Erik AabechandSebastiaan Janssen 4d23e8a6bd Ensure culture is always set in LocalizeText 2022-11-28 23:11:28 +01:00
bkclerkeandSebastiaan Janssen 1009238f32 add aria-labelledby attribute to tags input 2022-11-28 23:04:13 +01:00
Jan SkovgaardandGitHub 97fa4d76dc Accessibility: Fix - Missing table description: A data table is present with no description associated to it (#13117) 2022-11-28 22:54:54 +01:00
Asbjørn Riis-KnudsenandGitHub 50d361c4e6 Skip populating the PropertyTypeGroup alias column if it is already populated (#13109) 2022-11-28 22:44:59 +01:00
patrickdemooij9andGitHub 475cea40a1 Use span in StripFileExtension to speed up and use less memory (#13101) 2022-11-28 22:12:30 +01:00
Anders BjernerandSebastiaan Janssen 33668a5d95 Added "loading" parameter to "umbEditorHeader" directive 2022-11-28 21:46:49 +01:00
Bjarne FyrstenborgandGitHub a7368542d8 Add input id to args in toggleValue event (#13108) 2022-11-28 21:33:59 +01:00
Karl ButlerandGitHub 2d560e9766 Accessibility Fixes for Users and Packages pages (#13087) 2022-11-28 21:17:04 +01:00
JesseandGitHub e87701c482 added fix for ncNodeName filter in list view (#13086) 2022-11-28 20:38:12 +01:00
Bjarke Berg 65f66c2560 Merge remote-tracking branch 'origin/release/11.0' into release/11.0 2022-11-28 19:58:10 +01:00
Bjarke Berg 082864f529 bump to rc6 2022-11-28 19:58:02 +01:00
Ronald BarendseandGitHub 8c483e8d3b Only add global usings when ImplicitUsings is enabled (#13491) 2022-11-28 19:57:36 +01:00
Niels LyngsøandBjarke Berg ed67cd887f Change login image to new SVG. (#13493) 2022-11-28 19:56:04 +01:00
Niels LyngsøandGitHub 188fa237cd Change login image to new SVG. (#13493) 2022-11-28 19:55:15 +01:00
Ronald BarendseandGitHub a3361606e0 Create and pack empty file to add TFM dependency (#13475) 2022-11-28 19:48:29 +01:00
Ronald BarendseandGitHub e45ed3d7f1 Revert breaking changes adding IContextCache to deploy connectors (#13489)
* Remove breaking changes in Deploy connector interfaces

* Add extension methods for calling the new interface methods in a backwards-compatible way
2022-11-28 19:16:19 +01:00
bakersbakebreadandSebastiaan Janssen 3377a7c96b add setDirty() logic to remove actions on mediaPicker3 property editor 2022-11-28 15:50:41 +01:00
Corné HoskamandNikolaj 493e93cc89 Added various Block Grid translations (EN & NL) (#13488)
* Added various translations

* Added another translation

* Change request
2022-11-28 14:58:10 +01:00
Corné HoskamandGitHub a4e67bf444 Added various Block Grid translations (EN & NL) (#13488)
* Added various translations

* Added another translation

* Change request
2022-11-28 14:54:03 +01:00
Nikolaj 7342fde17f Revert "Add status endpoint"
This reverts commit b594ad8ccf.
2022-11-28 14:42:22 +01:00
Nikolaj b594ad8ccf Add status endpoint 2022-11-28 14:41:15 +01:00
Sebastiaan Janssen 8c2329f2b2 Merge branch 'v11/dev' into v11/contrib
# Conflicts:
#	src/Umbraco.Core/EmbeddedResources/Lang/en.xml
#	src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml
#	src/Umbraco.Web.UI.Client/src/views/packages/views/repo.html
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/prevalue/blockgrid.blockconfiguration.controller.js
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/prevalue/blockgrid.blockconfiguration.overlay.html
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/prevalue/umb-block-grid-configuration-area-entry.html
2022-11-28 13:50:44 +01:00
Elitsa MarinovskaandGitHub af6b8fc5cb Enabling an Umbraco admin user to disable 2FA for a member (#13369)
* Fix Invalid authentication code bug

* Add translation keys for 2fa

* Display toggle for 2FA on member

* Add TwoFactorEnabled prop when saving member

* Handle disabling of 2FA

* Fix tests

* Changing obsolete msg
2022-11-28 13:42:38 +01:00
MoleandGitHub 06924ed0f4 Ensure that all automatic relation types are updated (#13470) 2022-11-28 12:49:14 +01:00
Jacob Overgaard 1a0983f0c7 update marketplace url to its final, live url 2022-11-28 11:15:48 +01:00
MoleandGitHub 37b33641c3 V11: Fix ordering by published in list of content (#13474)
* Update sort statement to use published field for invariant content

* Order by published if invariant
2022-11-25 11:37:46 +01:00
Sean ThorneandMichael Latouche 88ce31197e add health-check basic tests 2022-11-25 09:40:23 +01:00
Owain JonesandMichael Latouche 079b2b7452 Updated welsh translations file 2022-11-25 02:16:37 +01:00
Paul SealandGitHub d86d29807d created an add current domain button to the cultures and hostnames sc… (#13436)
* created an add current domain button to the cultures and hostnames screen

* removed unwanted space
2022-11-25 02:07:03 +01:00
Bjarne FyrstenborgandGitHub a500ef9497 Delete references using custom relation types (#13389)
undefined
2022-11-23 15:43:51 +01:00
MoleandGitHub aeb52ed94e Merge pull request #13404 from sean-p-m/temp-13402
13402 - Update PreviewAuthenticationMiddleware to support chunked aut…
2022-11-23 11:36:15 +01:00
Jacob OvergaardandGitHub 02275ed772 Add sensible eslint rules with newest eslint version (#13457) 2022-11-23 11:26:20 +01:00
MoleandGitHub 525a204c40 Merge pull request #13459 from umbraco/v11/merge_release_into_dev
Merge release into dev
2022-11-22 16:08:59 +01:00
Warren BuckleyandGitHub b392ac78b3 Merge pull request #13458 from umbraco/v11/codespaces/updated-sqlite-feature-location
Codespaces: Updated SQLite DevContainer feature after rename
2022-11-22 14:59:03 +00:00
f83c946c96 Updated docs links to point to new platform (#13426)
* Updated docs links to point to new platform

* Update settingsdashboardintro.html

Co-authored-by: nikolajlauridsen <nikolajlauridsen@protonmail.ch>
2022-11-22 15:37:15 +01:00
nikolajlauridsen d188ff9730 Merge branch 'release/11.0' into v11/merge_release_into_dev
# Conflicts:
#	src/JsonSchema/AppSettings.cs
#	src/Umbraco.Core/Configuration/Models/MarketplaceSettings.cs
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/blockgridui.less
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/prevalue/blockgrid.blockconfiguration.overlay.html
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/umbblockgridentries.component.js
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/umbraco-blockgridlayout-flexbox.css
#	version.json
2022-11-22 15:30:45 +01:00
Warren Buckley 03253afabe The repo & package for the SQLite DevContainer feature has moved after I renamed the repo 2022-11-22 14:11:24 +00:00
Kenn JacobsenandGitHub cbd5d45bbf Split search/index API into two separate APIs (#13447)
* Split searcher and indexer API into two separate ones

* Fixed bad merge + fixed namespaces

* Update OpenAPI json scheme
2022-11-22 13:43:50 +01:00
Bjarne Fyrstenborgandnikolajlauridsen dc1b10f324 Adjust sorting of block grid editor groups to y-axis only (#13225)
fixes https://github.com/umbraco/Umbraco-CMS/issues/13180
2022-11-22 12:53:52 +01:00
Ronald BarendseandGitHub 2e54579a2f Simplify JSON schema, generation, copying and updating (#13427)
* Simplify JSON schema and only generate appsettings-schema.Umbraco.Cms.json

* Use Umbraco.JsonSchema.Extensions to dynamically add JSON schema references

* Move DependentUpon items to shared MSBuild props

* Update LangVersion to latest

* Update Umbraco.GitVersioning.Extensions to 0.2.0

* Remove JSON schemas on clean

* Remove Umbraco.JsonSchema.Core project

* Fix JSON schema nullability

* Ignore additional JSON schema files in template

* Update CompatibilitySuppressions.xml

* Remove GlobalSettings.UmbracoPath from JSON schema again

* Remove RemoveUmbracoJsonSchemaFiles target

* Update Umbraco.JsonSchema.Extensions to 0.2.0 and add weights

* Flatten generated JSON schema hierarchy

* Remove LicensesSettings from CMS codebase

* Change AdditionalParameters to IDictionary
2022-11-22 12:48:11 +01:00
Bjarne FyrstenborgandGitHub d4c5f5017f Adjust sorting of block grid editor groups to y-axis only (#13225)
fixes https://github.com/umbraco/Umbraco-CMS/issues/13180
2022-11-22 10:57:31 +01:00
Niels Lyngsøandnikolajlauridsen 85842bde9f remove the hidding of catelouge appearance as its not located under advance (#13456) 2022-11-22 10:55:14 +01:00
nikolajlauridsen 22caf2319d Bump version 2022-11-22 09:51:34 +01:00
niekvanderreestandnikolajlauridsen 82cd8330ea Cherry pick #13373 to v10/dev 2022-11-22 09:48:15 +01:00
dependabot[bot]andnikolajlauridsen 36a505ee78 Bump engine.io and socket.io in /src/Umbraco.Web.UI.Client
Bumps [engine.io](https://github.com/socketio/engine.io) and [socket.io](https://github.com/socketio/socket.io). These dependencies needed to be updated together.

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

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

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-22 09:48:03 +01:00
Niels Lyngsøandnikolajlauridsen bde2f7c0c3 use custom prop for calculated width (#13451) 2022-11-22 09:44:09 +01:00
Niels Lyngsøandnikolajlauridsen 0def36ac31 Block Grid Editor translations and Area size keyboard navigation (#13450) 2022-11-22 09:44:01 +01:00
Niels Lyngsøandnikolajlauridsen a0f348862f Display media trashed state on custom view for image demo block (#13448) 2022-11-22 09:43:45 +01:00
3b9fc38078 block grid editor visual adjustments (#13446)
* make sure area border is on top of block views.

* rename class to avoid confusion

* change witch UI goes on top on hover

* Description informing all blocks are allowed when none is configured.

* add 'When empty'

* Sort mode

* ability to switch out property actions

* enter and exit sortmode from property actions

* gridsortblock

* rename block class to use sortblock

* Sort mode styling

* remove unused css selector

* fixing style for inline-creat button to appear above and not when hovering contextbar

* work on block grid inline editor

* use uui-button + enable installing demo blocks when its not the first dataType of this kind.

* improvements to inline editing POC

* update title of area config overlay editor

* reset columnSpan if no column span options is defined.

* Inline editing

* remove html comment

* remove code for transfer of stylesheets

* ability to hide label from directive

* inline editing using slots to render the umb-property in light dom

* remove property editor proxies when moving a block to a new area/block/context

* minor adjustments to custom views

* use individual slots for each area.

* Inline editing

* a little smaller rte min-height

* fire Custom focus/blur event for Block Grid Editor to catch for focus imitation

* disable inline editing prevalue field when custom view is set

* Fix scroll parent block into view

* initial work on sorter directive

* remove mediaBlock controller

* initial notes and structure

* further concept work

* remove consol log

* CSS for getting bigger areas

* removal of the forceLeft/forceRight code

* proven concept

* fix grid space detection. vertical/horizontal

* clean up and notes

* move into inner containers as well

* use last available index pr default

* boundary selector, for improved choise of dropping into an area

* hide last inline create button when dragging around

* remove console.log

* removal of forced placement in css

* default config and clean up

* notes

* bring back removed code

* show area ui when in dragging mode

* more specific selector

* drop allowance + clean up

* notes and clean up

* auto scroll

* turn --umb-block-grid--dragging-mode into conditional CSS Custom Property

* auto scroll

* refactoring

* fix condition mistake

* scope.config.resolveVerticalDirection

* wrap up simple setDragImage solution

* bring back vm.notifyVisualUpdate and clean up

* make draggableSelector optional, fallback to element

* implement umb-block-grid-sorter for Area PreValue editor

* remove sortableJS dependency

* remove sortableJs from dependencies

* wups, bring back the comma

* removed sortablejs from package-lock

* finished implementation of sorter for PreValue Block Areas

* fix for FireFox shadowDom issue, contains temprorary code.

* stop auto scroll

* make full thing dragable

* fix firefox issue (applying translateZ)

* comment

* make block fit in context columns

* revert element to where it came from if sync could not succeed + clean up

* ensure block does not push the amount of columns, this occourse when dragging item around.

* take horizontalPlaceAfter into account

* implement horizontalPlaceAfter in Areas Prevalue editor

* clean up dependencies

* Shift related el to first in row or last in row when there is no horizontal room

* clean up and correct calculation

* remove unused attribute

* revert to using el.getBoundingClientRect(), as the config.draggableSelector is not available for the placeholder item.

* bind model via dedicated binding to ensure it stay connected with the source model

* Update src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/prevalue/umb-block-grid-area-editor.html

Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>

* fix eslint issues

* ensure missingColumnWidth is above 0

* Do not allow dragging something thats not found in the model.

* remove as this is not an error.

* update to Flexbox solution

* as the complex model does not change we can use single way binding

* Adjust columnSpan to context container, keep start columnSpan as the target for the calculation.

* make prevalue editor overlay medium size

* more white borders on UI

* move Catalogue appearance to Advanced

Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>
2022-11-22 09:43:21 +01:00
195cf4f9ec Block Grid Editor - make prevalue overlay medium sized (#13443)
* make sure area border is on top of block views.

* rename class to avoid confusion

* change witch UI goes on top on hover

* Description informing all blocks are allowed when none is configured.

* add 'When empty'

* Sort mode

* ability to switch out property actions

* enter and exit sortmode from property actions

* gridsortblock

* rename block class to use sortblock

* Sort mode styling

* remove unused css selector

* fixing style for inline-creat button to appear above and not when hovering contextbar

* work on block grid inline editor

* use uui-button + enable installing demo blocks when its not the first dataType of this kind.

* improvements to inline editing POC

* update title of area config overlay editor

* reset columnSpan if no column span options is defined.

* Inline editing

* remove html comment

* remove code for transfer of stylesheets

* ability to hide label from directive

* inline editing using slots to render the umb-property in light dom

* remove property editor proxies when moving a block to a new area/block/context

* minor adjustments to custom views

* use individual slots for each area.

* Inline editing

* a little smaller rte min-height

* fire Custom focus/blur event for Block Grid Editor to catch for focus imitation

* disable inline editing prevalue field when custom view is set

* Fix scroll parent block into view

* initial work on sorter directive

* remove mediaBlock controller

* initial notes and structure

* further concept work

* remove consol log

* CSS for getting bigger areas

* removal of the forceLeft/forceRight code

* proven concept

* fix grid space detection. vertical/horizontal

* clean up and notes

* move into inner containers as well

* use last available index pr default

* boundary selector, for improved choise of dropping into an area

* hide last inline create button when dragging around

* remove console.log

* removal of forced placement in css

* default config and clean up

* notes

* bring back removed code

* show area ui when in dragging mode

* more specific selector

* drop allowance + clean up

* notes and clean up

* auto scroll

* turn --umb-block-grid--dragging-mode into conditional CSS Custom Property

* auto scroll

* refactoring

* fix condition mistake

* scope.config.resolveVerticalDirection

* wrap up simple setDragImage solution

* bring back vm.notifyVisualUpdate and clean up

* make draggableSelector optional, fallback to element

* implement umb-block-grid-sorter for Area PreValue editor

* remove sortableJS dependency

* remove sortableJs from dependencies

* wups, bring back the comma

* removed sortablejs from package-lock

* finished implementation of sorter for PreValue Block Areas

* fix for FireFox shadowDom issue, contains temprorary code.

* stop auto scroll

* make full thing dragable

* fix firefox issue (applying translateZ)

* comment

* make block fit in context columns

* revert element to where it came from if sync could not succeed + clean up

* ensure block does not push the amount of columns, this occourse when dragging item around.

* take horizontalPlaceAfter into account

* implement horizontalPlaceAfter in Areas Prevalue editor

* clean up dependencies

* Shift related el to first in row or last in row when there is no horizontal room

* clean up and correct calculation

* remove unused attribute

* revert to using el.getBoundingClientRect(), as the config.draggableSelector is not available for the placeholder item.

* bind model via dedicated binding to ensure it stay connected with the source model

* Update src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/prevalue/umb-block-grid-area-editor.html

Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>

* fix eslint issues

* ensure missingColumnWidth is above 0

* Do not allow dragging something thats not found in the model.

* remove as this is not an error.

* update to Flexbox solution

* as the complex model does not change we can use single way binding

* Adjust columnSpan to context container, keep start columnSpan as the target for the calculation.

* make prevalue editor overlay medium size

Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>
2022-11-22 09:42:53 +01:00
f2798a6790 Block Grid Editor adjust while sorting (#13442)
* make sure area border is on top of block views.

* rename class to avoid confusion

* change witch UI goes on top on hover

* Description informing all blocks are allowed when none is configured.

* add 'When empty'

* Sort mode

* ability to switch out property actions

* enter and exit sortmode from property actions

* gridsortblock

* rename block class to use sortblock

* Sort mode styling

* remove unused css selector

* fixing style for inline-creat button to appear above and not when hovering contextbar

* work on block grid inline editor

* use uui-button + enable installing demo blocks when its not the first dataType of this kind.

* improvements to inline editing POC

* update title of area config overlay editor

* reset columnSpan if no column span options is defined.

* Inline editing

* remove html comment

* remove code for transfer of stylesheets

* ability to hide label from directive

* inline editing using slots to render the umb-property in light dom

* remove property editor proxies when moving a block to a new area/block/context

* minor adjustments to custom views

* use individual slots for each area.

* Inline editing

* a little smaller rte min-height

* fire Custom focus/blur event for Block Grid Editor to catch for focus imitation

* disable inline editing prevalue field when custom view is set

* Fix scroll parent block into view

* initial work on sorter directive

* remove mediaBlock controller

* initial notes and structure

* further concept work

* remove consol log

* CSS for getting bigger areas

* removal of the forceLeft/forceRight code

* proven concept

* fix grid space detection. vertical/horizontal

* clean up and notes

* move into inner containers as well

* use last available index pr default

* boundary selector, for improved choise of dropping into an area

* hide last inline create button when dragging around

* remove console.log

* removal of forced placement in css

* default config and clean up

* notes

* bring back removed code

* show area ui when in dragging mode

* more specific selector

* drop allowance + clean up

* notes and clean up

* auto scroll

* turn --umb-block-grid--dragging-mode into conditional CSS Custom Property

* auto scroll

* refactoring

* fix condition mistake

* scope.config.resolveVerticalDirection

* wrap up simple setDragImage solution

* bring back vm.notifyVisualUpdate and clean up

* make draggableSelector optional, fallback to element

* implement umb-block-grid-sorter for Area PreValue editor

* remove sortableJS dependency

* remove sortableJs from dependencies

* wups, bring back the comma

* removed sortablejs from package-lock

* finished implementation of sorter for PreValue Block Areas

* fix for FireFox shadowDom issue, contains temprorary code.

* stop auto scroll

* make full thing dragable

* fix firefox issue (applying translateZ)

* comment

* make block fit in context columns

* revert element to where it came from if sync could not succeed + clean up

* ensure block does not push the amount of columns, this occourse when dragging item around.

* take horizontalPlaceAfter into account

* implement horizontalPlaceAfter in Areas Prevalue editor

* clean up dependencies

* Shift related el to first in row or last in row when there is no horizontal room

* clean up and correct calculation

* remove unused attribute

* revert to using el.getBoundingClientRect(), as the config.draggableSelector is not available for the placeholder item.

* bind model via dedicated binding to ensure it stay connected with the source model

* Update src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/prevalue/umb-block-grid-area-editor.html

Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>

* fix eslint issues

* ensure missingColumnWidth is above 0

* Do not allow dragging something thats not found in the model.

* remove as this is not an error.

* update to Flexbox solution

* as the complex model does not change we can use single way binding

* Adjust columnSpan to context container, keep start columnSpan as the target for the calculation.

* change let to const

* Revert "change let to const"

This reverts commit fe19f8c5ed.

Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>
2022-11-22 09:29:54 +01:00
72bdebf419 v11: Umbraco Marketplace replaces packages repo (#13371)
* add lang keys for marketplace

* remove old 'repo' page and deprecate related services

* add new view for Umbraco Marketplace

* optimise margin/padding for other tabs

* mark Our Repository constants as obsolete

* improve css path to iframe slightly with more aliases and classnames

* remove style qs

* update URL of Marketplace

* add ng-controller with utitlities for future PostMessage API

* rename marketplace loaded function

* remove iframe postmessage logic for time being

* add handling of dynamic querystring params

* assume url does not change

* Added support for additional parameters for marketplace

* Update src/JsonSchema/AppSettings.cs

Fix styling issue

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

* Update src/Umbraco.Core/Configuration/Models/MarketplaceSettings.cs

Fix styling issue

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

* Update src/Umbraco.Core/Configuration/Models/MarketplaceSettings.cs

Make comment more descriptive

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

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

Fix styling issue

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

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
Co-authored-by: Ronald Barendse <ronald@barend.se>
2022-11-22 09:28:15 +01:00
1196a4d07b Block Grid Editor sorting directive (#13391)
* make sure area border is on top of block views.

* rename class to avoid confusion

* change witch UI goes on top on hover

* Description informing all blocks are allowed when none is configured.

* add 'When empty'

* Sort mode

* ability to switch out property actions

* enter and exit sortmode from property actions

* gridsortblock

* rename block class to use sortblock

* Sort mode styling

* remove unused css selector

* fixing style for inline-creat button to appear above and not when hovering contextbar

* work on block grid inline editor

* use uui-button + enable installing demo blocks when its not the first dataType of this kind.

* improvements to inline editing POC

* update title of area config overlay editor

* reset columnSpan if no column span options is defined.

* Inline editing

* remove html comment

* remove code for transfer of stylesheets

* ability to hide label from directive

* inline editing using slots to render the umb-property in light dom

* remove property editor proxies when moving a block to a new area/block/context

* minor adjustments to custom views

* use individual slots for each area.

* Inline editing

* a little smaller rte min-height

* fire Custom focus/blur event for Block Grid Editor to catch for focus imitation

* disable inline editing prevalue field when custom view is set

* Fix scroll parent block into view

* initial work on sorter directive

* remove mediaBlock controller

* initial notes and structure

* further concept work

* remove consol log

* CSS for getting bigger areas

* removal of the forceLeft/forceRight code

* proven concept

* fix grid space detection. vertical/horizontal

* clean up and notes

* move into inner containers as well

* use last available index pr default

* boundary selector, for improved choise of dropping into an area

* hide last inline create button when dragging around

* remove console.log

* removal of forced placement in css

* default config and clean up

* notes

* bring back removed code

* show area ui when in dragging mode

* more specific selector

* drop allowance + clean up

* notes and clean up

* auto scroll

* turn --umb-block-grid--dragging-mode into conditional CSS Custom Property

* auto scroll

* refactoring

* fix condition mistake

* scope.config.resolveVerticalDirection

* wrap up simple setDragImage solution

* bring back vm.notifyVisualUpdate and clean up

* make draggableSelector optional, fallback to element

* implement umb-block-grid-sorter for Area PreValue editor

* remove sortableJS dependency

* remove sortableJs from dependencies

* wups, bring back the comma

* removed sortablejs from package-lock

* finished implementation of sorter for PreValue Block Areas

* fix for FireFox shadowDom issue, contains temprorary code.

* stop auto scroll

* make full thing dragable

* fix firefox issue (applying translateZ)

* comment

* make block fit in context columns

* revert element to where it came from if sync could not succeed + clean up

* ensure block does not push the amount of columns, this occourse when dragging item around.

* take horizontalPlaceAfter into account

* implement horizontalPlaceAfter in Areas Prevalue editor

* clean up dependencies

* Shift related el to first in row or last in row when there is no horizontal room

* clean up and correct calculation

* remove unused attribute

* revert to using el.getBoundingClientRect(), as the config.draggableSelector is not available for the placeholder item.

* bind model via dedicated binding to ensure it stay connected with the source model

* Update src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/prevalue/umb-block-grid-area-editor.html

Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>

* fix eslint issues

* ensure missingColumnWidth is above 0

* Do not allow dragging something thats not found in the model.

* remove as this is not an error.

* update to Flexbox solution

* as the complex model does not change we can use single way binding

Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>
2022-11-22 09:27:13 +01:00
Anders Bjernerandnikolajlauridsen 65479706a9 NullOrWhiteSpaceAsNull should be nullable 2022-11-22 09:26:42 +01:00
niekvanderreestandnikolajlauridsen b3555eb374 Cherry pick #13373 to v10/dev 2022-11-22 09:24:06 +01:00
dependabot[bot]andJacob Overgaard 9791c4964f Bump engine.io and socket.io in /src/Umbraco.Web.UI.Client
Bumps [engine.io](https://github.com/socketio/engine.io) and [socket.io](https://github.com/socketio/socket.io). These dependencies needed to be updated together.

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

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

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-22 09:11:06 +01:00
dependabot[bot]andJacob Overgaard 0f4b2300ab Bump engine.io and socket.io in /src/Umbraco.Web.UI.Client
Bumps [engine.io](https://github.com/socketio/engine.io) and [socket.io](https://github.com/socketio/socket.io). These dependencies needed to be updated together.

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

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

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-22 09:10:08 +01:00
Warren BuckleyandGitHub a2e61b7899 Merge pull request #13453 from umbraco/v11/codespace-SQLite-as-container-feature
Codespaces: Adds SQLite to DevContainer via Features
2022-11-22 07:59:43 +00:00
Warren Buckley 16a1cda67c Uses the SQLite DevContainer Feature I wrote as GitHub won't write one 2022-11-21 22:42:41 +00:00
Kenn JacobsenandGitHub 48733e6132 Support explicit operation IDs (#13449) 2022-11-21 19:51:42 +01:00
Jan SkovgaardandGitHub 2288d98481 Block Grid Editor: Replace "TODO" text in titles (#13433) 2022-11-21 16:52:51 +01:00
4e98df799f v11: Umbraco Marketplace replaces packages repo (#13371)
* add lang keys for marketplace

* remove old 'repo' page and deprecate related services

* add new view for Umbraco Marketplace

* optimise margin/padding for other tabs

* mark Our Repository constants as obsolete

* improve css path to iframe slightly with more aliases and classnames

* remove style qs

* update URL of Marketplace

* add ng-controller with utitlities for future PostMessage API

* rename marketplace loaded function

* remove iframe postmessage logic for time being

* add handling of dynamic querystring params

* assume url does not change

* Added support for additional parameters for marketplace

* Update src/JsonSchema/AppSettings.cs

Fix styling issue

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

* Update src/Umbraco.Core/Configuration/Models/MarketplaceSettings.cs

Fix styling issue

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

* Update src/Umbraco.Core/Configuration/Models/MarketplaceSettings.cs

Make comment more descriptive

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

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

Fix styling issue

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

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
Co-authored-by: Ronald Barendse <ronald@barend.se>
2022-11-18 15:06:24 +01:00
d089825537 Feature: Media Picker drag and drop upload directly on property editor (#13393)
* prototype drag and drop upload

* Add upload image endpoint

* Add MediaPickerThreeController.cs

* Revert "Add upload image endpoint"

This reverts commit 4bb5865480.

* Update IIOHelper dependency

* show preview when uploading a new media item

* open uploaded media in media entry editor

* map data from uploaded media entry to support cropper

* add crop data to uploaded media item

* remove media library buttons for media entries not created in the media library

* Implement temp images save & add to media picker 3

* Implement ITemporaryImageService

* Remove save logic from MediaPicker3PropertyEditor

* Dont use a TempImageDto

* Add GetByAlias endpoint

* Add additonal xml doc

* Refactor to take array of aliases

* Add FromQuery attribute

* Formatting

* add resource to get media types by alias

* validate file size and file type based on server variables

* Update OpenApi.json
Add media picker three to BackOfficeServerVariables

* rename endpoint to upload media

* Use baseurl Method

* Dont upload in rte folder

* pass params correctly to end point

* queue files before uploading

* handle invalid files

* progress bar design adjustments

* only create data url for images

* disable edit and name buttons when uploading

* fix missing error messages for invalid files

* add temp location to media entry

* Add startNode to TemporaryImageService.cs

* Refactor get by alias

* Rename to GetAllFiltered

* use getAllFiltered method

* remove autoselect option

* fix missing alias when selecting media type

* fix file filter

* don't overwrite invalid entries from dropping new files

* add disallowed files to filter

* remove console.log

* move media uploader logic to reusable function

* fix missing tmp location

* attach media type alias to the mediaEntry

* support readonly mode

* show discard changes when files has been dropped

* add disabled prop to button group

* emit events when upload queue starts and ends

* pass node to media picker property editor

* add service to keep track of all uploads in progress

* add upload in progress to uploadTracker when the queue starts and ends

* disabled buttons when any upload is in progress

* return a subscription to align with eventsService

* Fix up cases where StartNodeId was null

* scope css

* Show filename in dialog for selecting media type

* reuse translation from media library dropzone

* Don't check for only images

* Remove composer

* Add mediaTypeAlias to TemporaryImageService

* Rename ITemporaryImageService to ITemporaryMediaService

* prefix client side only props with $ so we don't send unnecessary data to the server

* use prefixed dataURL in media entry editor

* render icon for non images

* fix auto select media type

Co-authored-by: Zeegaan <nge@umbraco.dk>
Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
2022-11-18 11:47:42 +01:00
Nikolaj GeisleGitHubZeegaanMoleRonald Barendsedependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>Blake WattJacob Overgaard
fb48ecb57f V11: merge dev to contrib (#13438)
* V11: add test flakyness reporting (#13386)

* update json-models-builders

* Add reporting to all before each loops

* Add commitId to env for pipelines

* Test reports correctly

* Bumb testhelper version

* Update playwright-testhelpers version

* Bumb playwright test-helper version

* Bumb playwright-testhelpers version

* Add AgentOs to yaml env

* Bumb playwright-testhelper version

* Try different AgentOS

* Revert "Try different AgentOS"

This reverts commit fc90620aef.

* Revert logo test

* Add missing semicolons

* Update package-lock.json

* Add reports to Blocklist tests

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

* V10: AllowedUploadFiles appsetting not working (#13408)

* Add new Settings

* Use new settings instead of old ones

* Implement AllowedUploadedFiles value to be copied to AllowedUplayedFileExtensions

* Obsolete old settings

* Rename DisallowedUploadFileExtensions

* Implement same fix for DisallowedUploadFiles

* Use new settings for backoffice server variables

* Update the correct setting

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

* V11: Add  compatibility suppressions (#13425)

* Add suprressions

* Revert "Add suprressions"

This reverts commit 1c924ee967.

* Update CompatibilitySuppressions.xml

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

* Bump socket.io-parser from 4.0.4 to 4.0.5 in /src/Umbraco.Web.UI.Client

Bumps [socket.io-parser](https://github.com/socketio/socket.io-parser) from 4.0.4 to 4.0.5.
- [Release notes](https://github.com/socketio/socket.io-parser/releases)
- [Changelog](https://github.com/socketio/socket.io-parser/blob/main/CHANGELOG.md)
- [Commits](https://github.com/socketio/socket.io-parser/compare/4.0.4...4.0.5)

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

Signed-off-by: dependabot[bot] <support@github.com>

* update block grid panel name (#13325)

Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>

* Bump async from 2.6.3 to 2.6.4 in /src/Umbraco.Web.UI.Client

Bumps [async](https://github.com/caolan/async) from 2.6.3 to 2.6.4.
- [Release notes](https://github.com/caolan/async/releases)
- [Changelog](https://github.com/caolan/async/blob/v2.6.4/CHANGELOG.md)
- [Commits](https://github.com/caolan/async/compare/v2.6.3...v2.6.4)

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

Signed-off-by: dependabot[bot] <support@github.com>

* Bump eventsource from 1.1.0 to 1.1.2 in /src/Umbraco.Web.UI.Client

Bumps [eventsource](https://github.com/EventSource/eventsource) from 1.1.0 to 1.1.2.
- [Release notes](https://github.com/EventSource/eventsource/releases)
- [Changelog](https://github.com/EventSource/eventsource/blob/master/HISTORY.md)
- [Commits](https://github.com/EventSource/eventsource/compare/v1.1.0...v1.1.2)

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

Signed-off-by: dependabot[bot] <support@github.com>

* Bump minimist from 1.2.5 to 1.2.7 in /src/Umbraco.Web.UI.Client

Bumps [minimist](https://github.com/minimistjs/minimist) from 1.2.5 to 1.2.7.
- [Release notes](https://github.com/minimistjs/minimist/releases)
- [Changelog](https://github.com/minimistjs/minimist/blob/main/CHANGELOG.md)
- [Commits](https://github.com/minimistjs/minimist/compare/v1.2.5...v1.2.7)

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

Signed-off-by: dependabot[bot] <support@github.com>

* Management API: SearchController improvements (#13420)

* remove typo of double PagedViewModel in response

* add providerProperties with custom formatter

* use a more descriptive variable name

* use a more descriptive variable name for property types

* generate new schema

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

* Bump minimatch from 3.0.4 to 3.1.2 in /src/Umbraco.Web.UI.Client

Bumps [minimatch](https://github.com/isaacs/minimatch) from 3.0.4 to 3.1.2.
- [Release notes](https://github.com/isaacs/minimatch/releases)
- [Commits](https://github.com/isaacs/minimatch/compare/v3.0.4...v3.1.2)

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

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Zeegaan <nge@umbraco.dk>
Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>
Co-authored-by: Ronald Barendse <ronald@barend.se>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Blake Watt <bkclerke@users.noreply.github.com>
Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>
2022-11-18 09:00:43 +01:00
dependabot[bot]andNikolaj 695b5bd57a Bump minimatch from 3.0.4 to 3.1.2 in /src/Umbraco.Web.UI.Client
Bumps [minimatch](https://github.com/isaacs/minimatch) from 3.0.4 to 3.1.2.
- [Release notes](https://github.com/isaacs/minimatch/releases)
- [Commits](https://github.com/isaacs/minimatch/compare/v3.0.4...v3.1.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-17 15:22:14 +01:00
dependabot[bot]andNikolaj f7a314cd6b Bump minimist from 1.2.5 to 1.2.7 in /src/Umbraco.Web.UI.Client
Bumps [minimist](https://github.com/minimistjs/minimist) from 1.2.5 to 1.2.7.
- [Release notes](https://github.com/minimistjs/minimist/releases)
- [Changelog](https://github.com/minimistjs/minimist/blob/main/CHANGELOG.md)
- [Commits](https://github.com/minimistjs/minimist/compare/v1.2.5...v1.2.7)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-17 15:21:14 +01:00
dependabot[bot]andNikolaj 44d1c2d722 Bump eventsource from 1.1.0 to 1.1.2 in /src/Umbraco.Web.UI.Client
Bumps [eventsource](https://github.com/EventSource/eventsource) from 1.1.0 to 1.1.2.
- [Release notes](https://github.com/EventSource/eventsource/releases)
- [Changelog](https://github.com/EventSource/eventsource/blob/master/HISTORY.md)
- [Commits](https://github.com/EventSource/eventsource/compare/v1.1.0...v1.1.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-17 15:21:09 +01:00
dependabot[bot]andNikolaj 5e40b3f0d6 Bump async from 2.6.3 to 2.6.4 in /src/Umbraco.Web.UI.Client
Bumps [async](https://github.com/caolan/async) from 2.6.3 to 2.6.4.
- [Release notes](https://github.com/caolan/async/releases)
- [Changelog](https://github.com/caolan/async/blob/v2.6.4/CHANGELOG.md)
- [Commits](https://github.com/caolan/async/compare/v2.6.3...v2.6.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-17 15:21:03 +01:00
dependabot[bot]andJacob Overgaard 7281c6ba26 Bump minimatch from 3.0.4 to 3.1.2 in /src/Umbraco.Web.UI.Client
Bumps [minimatch](https://github.com/isaacs/minimatch) from 3.0.4 to 3.1.2.
- [Release notes](https://github.com/isaacs/minimatch/releases)
- [Commits](https://github.com/isaacs/minimatch/compare/v3.0.4...v3.1.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-17 15:20:35 +01:00
dependabot[bot]andJacob Overgaard 98da07cfb4 Bump minimatch from 3.0.4 to 3.1.2 in /src/Umbraco.Web.UI.Client
Bumps [minimatch](https://github.com/isaacs/minimatch) from 3.0.4 to 3.1.2.
- [Release notes](https://github.com/isaacs/minimatch/releases)
- [Commits](https://github.com/isaacs/minimatch/compare/v3.0.4...v3.1.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-17 15:20:08 +01:00
267656d793 Management API: SearchController improvements (#13420)
* remove typo of double PagedViewModel in response

* add providerProperties with custom formatter

* use a more descriptive variable name

* use a more descriptive variable name for property types

* generate new schema

Co-authored-by: Zeegaan <nge@umbraco.dk>
2022-11-17 14:46:42 +01:00
dependabot[bot]andJacob Overgaard a4098ce0b1 Bump minimist from 1.2.5 to 1.2.7 in /src/Umbraco.Web.UI.Client
Bumps [minimist](https://github.com/minimistjs/minimist) from 1.2.5 to 1.2.7.
- [Release notes](https://github.com/minimistjs/minimist/releases)
- [Changelog](https://github.com/minimistjs/minimist/blob/main/CHANGELOG.md)
- [Commits](https://github.com/minimistjs/minimist/compare/v1.2.5...v1.2.7)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-17 14:18:38 +01:00
dependabot[bot]andJacob Overgaard 8048a11944 Bump eventsource from 1.1.0 to 1.1.2 in /src/Umbraco.Web.UI.Client
Bumps [eventsource](https://github.com/EventSource/eventsource) from 1.1.0 to 1.1.2.
- [Release notes](https://github.com/EventSource/eventsource/releases)
- [Changelog](https://github.com/EventSource/eventsource/blob/master/HISTORY.md)
- [Commits](https://github.com/EventSource/eventsource/compare/v1.1.0...v1.1.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-17 14:18:30 +01:00
dependabot[bot]andJacob Overgaard ba8d2e87d5 Bump async from 2.6.3 to 2.6.4 in /src/Umbraco.Web.UI.Client
Bumps [async](https://github.com/caolan/async) from 2.6.3 to 2.6.4.
- [Release notes](https://github.com/caolan/async/releases)
- [Changelog](https://github.com/caolan/async/blob/v2.6.4/CHANGELOG.md)
- [Commits](https://github.com/caolan/async/compare/v2.6.3...v2.6.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-17 14:18:27 +01:00
dependabot[bot]andJacob Overgaard d1f10f486d Bump eventsource from 1.1.0 to 1.1.2 in /src/Umbraco.Web.UI.Client
Bumps [eventsource](https://github.com/EventSource/eventsource) from 1.1.0 to 1.1.2.
- [Release notes](https://github.com/EventSource/eventsource/releases)
- [Changelog](https://github.com/EventSource/eventsource/blob/master/HISTORY.md)
- [Commits](https://github.com/EventSource/eventsource/compare/v1.1.0...v1.1.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-17 14:16:53 +01:00
dependabot[bot]andJacob Overgaard 55b7897d86 Bump minimist from 1.2.5 to 1.2.7 in /src/Umbraco.Web.UI.Client
Bumps [minimist](https://github.com/minimistjs/minimist) from 1.2.5 to 1.2.7.
- [Release notes](https://github.com/minimistjs/minimist/releases)
- [Changelog](https://github.com/minimistjs/minimist/blob/main/CHANGELOG.md)
- [Commits](https://github.com/minimistjs/minimist/compare/v1.2.5...v1.2.7)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-17 14:16:07 +01:00
dependabot[bot]andJacob Overgaard cf6042ce37 Bump async from 2.6.3 to 2.6.4 in /src/Umbraco.Web.UI.Client
Bumps [async](https://github.com/caolan/async) from 2.6.3 to 2.6.4.
- [Release notes](https://github.com/caolan/async/releases)
- [Changelog](https://github.com/caolan/async/blob/v2.6.4/CHANGELOG.md)
- [Commits](https://github.com/caolan/async/compare/v2.6.3...v2.6.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-17 14:15:39 +01:00
Blake WattandJacob Overgaard 3b08f4a964 update block grid panel name (#13325)
Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>
2022-11-17 14:11:25 +01:00
7239a78ad1 update block grid panel name (#13325)
Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>
2022-11-17 14:10:37 +01:00
dependabot[bot]andJacob Overgaard 9ec7b1ce49 Bump socket.io-parser from 4.0.4 to 4.0.5 in /src/Umbraco.Web.UI.Client
Bumps [socket.io-parser](https://github.com/socketio/socket.io-parser) from 4.0.4 to 4.0.5.
- [Release notes](https://github.com/socketio/socket.io-parser/releases)
- [Changelog](https://github.com/socketio/socket.io-parser/blob/main/CHANGELOG.md)
- [Commits](https://github.com/socketio/socket.io-parser/compare/4.0.4...4.0.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-17 13:59:38 +01:00
dependabot[bot]andJacob Overgaard 0415ed8267 Bump socket.io-parser from 4.0.4 to 4.0.5 in /src/Umbraco.Web.UI.Client
Bumps [socket.io-parser](https://github.com/socketio/socket.io-parser) from 4.0.4 to 4.0.5.
- [Release notes](https://github.com/socketio/socket.io-parser/releases)
- [Changelog](https://github.com/socketio/socket.io-parser/blob/main/CHANGELOG.md)
- [Commits](https://github.com/socketio/socket.io-parser/compare/4.0.4...4.0.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-17 13:59:11 +01:00
MoleandRonald Barendse f18209f616 V11: Add compatibility suppressions (#13425)
* Add suprressions

* Revert "Add suprressions"

This reverts commit 1c924ee967.

* Update CompatibilitySuppressions.xml

Co-authored-by: Ronald Barendse <ronald@barend.se>
2022-11-17 13:56:09 +01:00
0042343e0b V11: Add compatibility suppressions (#13425)
* Add suprressions

* Revert "Add suprressions"

This reverts commit 1c924ee967.

* Update CompatibilitySuppressions.xml

Co-authored-by: Ronald Barendse <ronald@barend.se>
2022-11-17 13:54:14 +01:00
Warren BuckleyandGitHub 76078b29dc Merge pull request #13428 from umbraco/v11/codespaces-updated-readme
Codespaces: Updated readme
2022-11-17 10:38:58 +00:00
Warren Buckley 74b7ee142c Updated readme 2022-11-17 10:35:18 +00:00
Anders BjernerandMichael Latouche 5ffc2b1ccb NullOrWhiteSpaceAsNull should be nullable 2022-11-17 11:13:49 +01:00
5ce7cd39b9 V10: AllowedUploadFiles appsetting not working (#13408)
* Add new Settings

* Use new settings instead of old ones

* Implement AllowedUploadedFiles value to be copied to AllowedUplayedFileExtensions

* Obsolete old settings

* Rename DisallowedUploadFileExtensions

* Implement same fix for DisallowedUploadFiles

* Use new settings for backoffice server variables

* Update the correct setting

Co-authored-by: Zeegaan <nge@umbraco.dk>
2022-11-17 09:55:54 +01:00
d545c1fa1e V10: AllowedUploadFiles appsetting not working (#13408)
* Add new Settings

* Use new settings instead of old ones

* Implement AllowedUploadedFiles value to be copied to AllowedUplayedFileExtensions

* Obsolete old settings

* Rename DisallowedUploadFileExtensions

* Implement same fix for DisallowedUploadFiles

* Use new settings for backoffice server variables

* Update the correct setting

Co-authored-by: Zeegaan <nge@umbraco.dk>
2022-11-17 09:55:27 +01:00
22bcc9b054 V11: add test flakyness reporting (#13386)
* update json-models-builders

* Add reporting to all before each loops

* Add commitId to env for pipelines

* Test reports correctly

* Bumb testhelper version

* Update playwright-testhelpers version

* Bumb playwright test-helper version

* Bumb playwright-testhelpers version

* Add AgentOs to yaml env

* Bumb playwright-testhelper version

* Try different AgentOS

* Revert "Try different AgentOS"

This reverts commit fc90620aef.

* Revert logo test

* Add missing semicolons

* Update package-lock.json

* Add reports to Blocklist tests

Co-authored-by: Zeegaan <nge@umbraco.dk>
2022-11-17 09:27:47 +01:00
Sebastiaan Janssen 60765b976c Merge branch 'v11/dev' into v11/contrib
# Conflicts:
#	.gitignore
#	src/Umbraco.Cms.ManagementApi/ManagementApiComposer.cs
#	src/Umbraco.Cms.ManagementApi/OpenApi.json
2022-11-17 09:26:44 +01:00
Niels LyngsøandNikolaj dc2358f4f0 Block Grid Editor: Removal of the forced placement feature (#13400)
* removal of the forceLeft/forceRight code

* removal of forced placement in css

* bring back removed code
2022-11-17 08:42:18 +01:00
Niels LyngsøandNikolaj 9b13a260e9 Block Grid Editor: Removal of the forced placement feature (#13400)
* removal of the forceLeft/forceRight code

* removal of forced placement in css

* bring back removed code
2022-11-17 08:41:21 +01:00
Jacob OvergaardandNikolaj 8a04f9fd99 v11: Fix for TinyMCE dropdowns (#13417)
* Set higher z-index for TinyMCE overlays as they were set below that of our property editor overlays

Fixes #13414

* replace !important with more specificity
2022-11-17 08:39:47 +01:00
Warren BuckleyandGitHub 137b4eba68 Merge pull request #13421 from umbraco/v11/codespace-fwd-port-smtp4dev
Codespaces: List port 5000 for Smtp4Dev
2022-11-16 16:34:59 +00:00
Warren Buckley dbc8c2680e List port 5000 for Smtp4Dev 2022-11-16 16:21:05 +00:00
Jacob OvergaardandGitHub f2de42f38e v11: Fix for TinyMCE dropdowns (#13417)
* Set higher z-index for TinyMCE overlays as they were set below that of our property editor overlays

Fixes #13414

* replace !important with more specificity
2022-11-16 11:48:18 +01:00
Warren BuckleyandGitHub 079d2f91b9 Merge pull request #13416 from umbraco/v11/codespaces-auto-open-codespace-readme
CodeSpaces: Scaffold out a file for a specific Codespace readme to auto open
2022-11-15 16:58:12 +00:00
Warren Buckley d3905b4c5c Scaffold out a file for a specific Codespace readme 2022-11-15 16:16:08 +00:00
7af8a407d3 Management API operation IDs (#13374)
* add a custom operationId generator to swagger operations based on the name of the action

* mark 'total' and 'items' as required in all paged models seeing as they should be there always non-nullable

* fix action typo collect -> rebuild to avoid duplicates

* fix operations for server status + version

* add factory to format custom operation ids

* Revert "fix operations for server status + version"

This reverts commit 066a59e1c2.

* Throw exception if no relative path and remove template placeholders completely

* Revert "Throw exception if no relative path and remove template placeholders completely"

This reverts commit 40af0721d6.

* Move source generated regex statements to its own file (#13410)

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>
2022-11-15 15:43:12 +01:00
Warren BuckleyandGitHub be8b083746 Merge pull request #13409 from umbraco/v11/codespace-sqlite-extension
Codespaces: Adds SQLite extension & ensures SQLite thats needed for it
2022-11-15 14:01:51 +00:00
Warren Buckley 2f976b41b4 Adds SQLite extension & ensures SQLite thats needed for it 2022-11-15 13:33:26 +00:00
Warren BuckleyandGitHub c7e78bcb72 Merge pull request #13407 from umbraco/v11/codespace-remove-build-before-launch
Codespaces: Removes the explicit build before attaching debugger launch task
2022-11-15 11:52:23 +00:00
Warren Buckley 704dda9575 Removes the explicit build before attaching debugger launch task 2022-11-15 11:23:53 +00:00
Warren BuckleyandGitHub d4949ae613 Merge pull request #13405 from umbraco/v11/codespaces-prebuild-dev-cert
Codespaces: dotnet devcert in the docker was not working so moved to updateContentCommand
2022-11-15 10:47:53 +00:00
Warren BuckleyandGitHub f0a34bd2a4 Merge branch 'v11/contrib' into v11/codespaces-prebuild-dev-cert 2022-11-15 10:19:39 +00:00
Warren BuckleyandGitHub aaf76ec5b8 Merge pull request #13401 from umbraco/v11/feature/codespaces-port-forward-config
Enable CodeSpaces PortForwarding Config
2022-11-15 10:14:35 +00:00
Warren Buckley 1d78a06509 The devcert in the docker was not working so moved to updateContentCommand 2022-11-15 10:14:29 +00:00
Sean Maloney c365c64bea 13402 - Update PreviewAuthenticationMiddleware to support chunked authentication cookies 2022-11-15 10:12:10 +00:00
Warren Buckley b32b0371ae Open Browser config is not working for some unknown reason 2022-11-15 09:47:10 +00:00
Warren Buckley 0cad30a8fa Adds SMTP4Dev and opens browser to HTTPs Umbraco 2022-11-15 08:55:39 +00:00
Warren Buckley 5d3b2e2e8a Enable CodeSpaces PortForwarding Config as SMTP4Dev did not auto appear in new prebuilds 2022-11-15 08:43:21 +00:00
Jacob OvergaardandNikolaj 6bc537713c v11: Rich text editor - remove distraction-free mode and optimise inline mode (#13394)
* combine 'inline' and 'distraction-free' modes with the quickbars plugin

* remove 'distraction-free' and map to 'inline'

* remove container overrides for 'distraction-free'
2022-11-15 09:13:14 +01:00
Warren BuckleyandGitHub 35355ce828 Merge pull request #13398 from umbraco/v11/feature/codespace-prebuilds-take-two
Trying Codespace prebuilds to use updateContentCommand that the docs refer to
2022-11-14 15:14:52 +00:00
Warren Buckley a4f8a51c57 Trying Codespace prebuilds to use updateContentCommand that the docs refer to 2022-11-14 15:11:15 +00:00
Jacob OvergaardandGitHub 3a8024c0c6 v11: Rich text editor - remove distraction-free mode and optimise inline mode (#13394)
* combine 'inline' and 'distraction-free' modes with the quickbars plugin

* remove 'distraction-free' and map to 'inline'

* remove container overrides for 'distraction-free'
2022-11-14 16:01:01 +01:00
Warren BuckleyandGitHub f5ff3e87d2 Merge pull request #13396 from umbraco/warrenbuckley-patch-1
Adds Open in GitHub Codespaces to main readme
2022-11-14 14:37:02 +00:00
Warren BuckleyandGitHub cf96aefb86 Adds Open in GitHub Codespaces to main readme
Adds Open in GitHub Codespaces to main readme next to other badges we have at the top of the readme
2022-11-14 14:36:26 +00:00
Warren BuckleyandGitHub dd895b1736 Merge pull request #13395 from umbraco/v11/feature/codespaces-prebuild-dotnetbuild
Adds dotnet build command for onCreateCommand to use in Prebuilds of CodeSpaces
2022-11-14 14:31:56 +00:00
Warren Buckley 3c709cfa24 Adds dotnet build command for onCreateCommand to use in Prebuilds of CodeSpaces 2022-11-14 14:10:52 +00:00
Nikolaj d03e0443b1 Merge branch 'release/11.0' into v11/dev
# Conflicts:
#	version.json
2022-11-14 14:41:44 +01:00
Nikolaj 0356aade30 Bump version 2022-11-14 12:44:26 +01:00
Nikolai Emil DammandNikolaj c2047d1d6e Remove nullability from AdditionalData on ContentItemDisplay (#13380)
@Zeegaan We have a use case where we need to set a value in the AdditionalData dictionary in a NotificationHandler, but as it can be null, it requires reflection to make sure that is not the case. As such, it would be nice if the following change could be implemented to ensure it is never null.
2022-11-14 12:42:43 +01:00
Bjarke BergandNikolaj 13308c3610 Obsolete old migrations and exif code (#13382)
* Obsoleted and deleted internal migrations + Enabled breaking changes checks agains v11.0.0-rc1

* Obsoleted and deleted internal exif stuff

* Added CompatibilitySuppressions.xml

* Change GenerateCompatibilitySuppressionFile
2022-11-14 12:40:22 +01:00
Bjarke BergandGitHub 616d092577 Obsolete old migrations and exif code (#13382)
* Obsoleted and deleted internal migrations + Enabled breaking changes checks agains v11.0.0-rc1

* Obsoleted and deleted internal exif stuff

* Added CompatibilitySuppressions.xml

* Change GenerateCompatibilitySuppressionFile
2022-11-14 12:40:06 +01:00
Warren BuckleyandGitHub 888488e7e4 Merge pull request #13392 from umbraco/v11/feature/codespace-gh-cli-ssh-support
Adds the SSH feature to allow the GitHub CLI SSH command to work
2022-11-14 11:34:27 +00:00
Mole 233c9df1d6 V11: InMemory - only add models assembly as runtime view reference if it exists (#13390)
* Only add models assembly as runtime view reference if it exists

* Add in memory metadata reference properly

compilations are readonly
2022-11-14 12:19:35 +01:00
Niels LyngsøandNikolaj e321982f44 remove console log 2022-11-14 12:19:31 +01:00
Niels LyngsøandNikolaj 27ec62016d Block Grid Editor Improvements (#13282) 2022-11-14 12:19:24 +01:00
Niels LyngsøandNikolaj 0e1095061e remove console log 2022-11-14 12:17:12 +01:00
Niels LyngsøandNikolaj 1bd03374dc Block Grid Editor Improvements (#13282) 2022-11-14 12:17:03 +01:00
MoleandGitHub a9e605d532 V11: InMemory - only add models assembly as runtime view reference if it exists (#13390)
* Only add models assembly as runtime view reference if it exists

* Add in memory metadata reference properly

compilations are readonly
2022-11-14 11:37:55 +01:00
Warren Buckley bd4553d8a4 Adds the SSH feature to allow the GitHub CLI SSH command to work 2022-11-14 10:01:34 +00:00
Matthew CareandGitHub 77859719f2 Batch media upload (#12947)
* Allow simultaneous uploads

Upload files in batches for faster uploading

* Fix concurrency issue

Many requests to add files coming at the same time can cause duplicate folders to be created.
In some cases, SQL exceptions can throw, and cause the application to hang.
Add Semaphore to process files on a single thread.

* Replace Semaphore with a Scope Provider

As suggested in the PR comments, replaced Semaphore with ICoreScopeProvider

* Revert "Replace Semaphore with a Scope Provider"

This reverts commit 228e1010c6.

* Add comment to make configurable

Out of scope of the PR, but this should be configurable in appsettings

* Apply PR 13345

Apply PR 13345 to resolve "freezing" issue caused by unhandled errors

* Account for currently processing items

If you drag files into the dropzone whilst other files are uploading then the "total" count is incorrect.
2022-11-14 07:49:18 +01:00
Andreas ZerbstandGitHub bee6adfe27 V11: Add new blocklist acceptance tests (#13299)
* Created test for block list editor

* Added a couple of test for the block list editor

* Changed parts of builder

* Split the test into two files instead of one

* Updated and added test for blockListEditor

* Updated version

* Fixed so it now targets the correct selector

* Removed unnecessary login in the afterEach

* Fixed up the test so they are now using constants and the correct helpers

* Bumped version

* Updated the package-lock

* Added local function to battle code reuse!

* Updated the path of the image for the test 'can edit a block list editor'

* Placed an expect before the button so it waits to click the button till it's visible

* Yet another fix for the imagePath and a missing "
2022-11-14 07:01:33 +01:00
Warren BuckleyandGitHub efa069f1ed Merge pull request #13387 from umbraco/v11/codespaces
Adds in .NET 7 SDK to GitHub CodeSpaces
2022-11-11 19:38:17 +00:00
Warren Buckley 4d1a1ba413 Adds in .NET SDK using the Feature approach in devcontainer.json until NET7 image is live 2022-11-11 19:01:54 +00:00
Nikolai Emil DammandGitHub ad0582a5aa Remove nullability from AdditionalData on ContentItemDisplay (#13380)
@Zeegaan We have a use case where we need to set a value in the AdditionalData dictionary in a NotificationHandler, but as it can be null, it requires reflection to make sure that is not the case. As such, it would be nice if the following change could be implemented to ensure it is never null.
2022-11-10 14:13:10 +01:00
Kenn JacobsenandNikolaj 69c6eae7a2 Move block grid single area rendering to its own dedicated view (#13359) 2022-11-09 09:52:46 +01:00
Kenn JacobsenandNikolaj d11ed8acff Move block grid single area rendering to its own dedicated view (#13359) 2022-11-09 09:51:11 +01:00
Bjarke BergandNikolaj 84240d90b6 Updated to aspnetcore 7.0.0 (#13372) 2022-11-09 09:33:22 +01:00
Bjarke BergandGitHub 73afd29b55 Updated to aspnetcore 7.0.0 (#13372) 2022-11-09 09:30:07 +01:00
c1e9775f29 Merge new backoffice changes to release branch (#13368)
* New backoffice: Cleanup management API routes (#13296)

* Rename ModelsBuilderDashboard folder to ModelsBuilder

* Fix modelsbuilder paths and related naming

* Rename analytics route to telemetry

* Fix controller bases - routes and tags

* Fix items route

* Fix more controllerbase routes

* Fix route

* Fix OpenApi file

* Merging DictionaryItem and Dictionary

* Fix TrackedReferences naming

* Update OpenApi file

* Rename Analytics* related types to Telemetry*

* New Backoffice: Return AnalyticsLevelViewModel from Telemetry/ (#13298)

* Return TelemetryLevelViewModel instead of TelemetryLevel

* Fix schema

* Change telemetry/current to telemetry/level

(cherry picked from commit f2b8494c669cbbf04b623753abbf1be211973aa9)

* Add contants for tree and recycle-bin subpaths

(cherry picked from commit 4449f56bc00832ea6d357a3854b454791c80e0e2)

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

* OpenId Connect authentication for new management API (#13318)

* First attempt at OpenIddict

* Making headway and more TODOs

* Redo current policies for multiple schemas + clean up auth controller

* Fix bad merge

* Clean up some more test code

* Fix spacing

* Include AddAuthentication() in OpenIddict addition

* A little more clean-up

* Move application creation to its own implementation + prepare for middleware to handle valid callback URL

* Enable refresh token flow

* Fix bad merge from v11/dev

* Support auth for Swagger and Postman in non-production environments + use default login screen for back-office logins

* Add workaround to client side login handling so the OAuth return URL is not corrupted before redirection

* Add temporary configuration handling for new backoffice

* Restructure the code somewhat, move singular responsibility from management API project

* Add recurring task for cleaning up old tokens in the DB

* Fix bad merge + make auth controller align with the new management API structure

* Explicitly handle the new management API path as a backoffice path (NOTE: this is potentially behaviorally breaking!)

* Redo handle the new management API requests as backoffice requests, this time in a non-breaking way

* Add/update TODOs

* Revert duplication of current auth policies for OpenIddict (as it breaks everything for V11 without the new management APIs) and introduce a dedicated PoC policy setup for OpenIddict.

* Fix failing unit tests

* Update src/Umbraco.Cms.ManagementApi/Security/BackOfficeApplicationManager.cs

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

* Update src/Umbraco.Cms.ManagementApi/Security/BackOfficeApplicationManager.cs

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

* Update src/Umbraco.Cms.ManagementApi/Security/BackOfficeApplicationManager.cs

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

* Update src/Umbraco.Core/Routing/UmbracoRequestPaths.cs

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

* Use Swashbuckle instead of NSwag (#13350)

* First attempt at OpenIddict

* Making headway and more TODOs

* Redo current policies for multiple schemas + clean up auth controller

* Fix bad merge

* Clean up some more test code

* Fix spacing

* Include AddAuthentication() in OpenIddict addition

* A little more clean-up

* Move application creation to its own implementation + prepare for middleware to handle valid callback URL

* Enable refresh token flow

* Fix bad merge from v11/dev

* Support auth for Swagger and Postman in non-production environments + use default login screen for back-office logins

* Add workaround to client side login handling so the OAuth return URL is not corrupted before redirection

* Add temporary configuration handling for new backoffice

* Restructure the code somewhat, move singular responsibility from management API project

* Add recurring task for cleaning up old tokens in the DB

* Fix bad merge + make auth controller align with the new management API structure

* Explicitly handle the new management API path as a backoffice path (NOTE: this is potentially behaviorally breaking!)

* Redo handle the new management API requests as backoffice requests, this time in a non-breaking way

* Add/update TODOs

* Replace NSwag with Swashbuckle and clean up unnecessary client secret workaround

* Revert duplication of current auth policies for OpenIddict (as it breaks everything for V11 without the new management APIs) and introduce a dedicated PoC policy setup for OpenIddict.

* Fix failing unit tests

* A little niceness + export new OpenApi.json and fix path in contract unit test

* Redo after merge with v11/dev + filter out unwanted mime types

* Remove CreatedResult and NotFoundObjectResult where possible

* Custom schema IDs - no more "ViewModel" postfix and make generic lists look less clunky too

* A little more explanation for generic schema ID generation

* Force Swashbuckle to use enum string names

* Update OpenApi.json to match new enum string values

* Add clarifying comment about weird looking construct

Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com>
Co-authored-by: Kenn Jacobsen <kja@umbraco.dk>
Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
2022-11-08 12:48:46 +01:00
MoleandGitHub 54131605be V12: Replace ntext with nvarchar(max) in database (#13351)
* Update UnPublishedContentPropertyCacheCompressionOptions to also accept Nvarchar

* Update DTOs to use nvarchar(max)

* Add Migration

* Simplify migration a bit

* Refactor column migration for reuse

* Add remaning column migrations

* Support non-nullable column

* Make it idempotent

* Skip SQLite

* Revert "Update UnPublishedContentPropertyCacheCompressionOptions to also accept Nvarchar"

This reverts commit d432d165de.

* Obsolete NTEXT

* Ignore case when checking column type
2022-11-08 12:26:40 +01:00
Nathan Woulfeandnikolajlauridsen 65803e2645 add workflow to schema (#13349)
* add workflow to schema

* add licenses to CMSDefinition - intentionally only adding to schema, not registered as options
2022-11-08 11:07:30 +01:00
+1 64e7933d57 V11: Merge dev to contrib (#13363)
* Bump version

* Add IContextCache to deploy connectors (#13287)

* Add IContextCache and implementations

* Update connector interfaces to use IContextCache

* Minor cleanup

* Move DeployContextCache prefix to constant

* Move default implementations to obsolete methods

* Remove DeployContextCache and DictionaryCache

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

* Add IContextCache to deploy connectors (#13287)

* Add IContextCache and implementations

* Update connector interfaces to use IContextCache

* Minor cleanup

* Move DeployContextCache prefix to constant

* Move default implementations to obsolete methods

* Remove DeployContextCache and DictionaryCache

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

* Parse lockId as invariant (#13284)

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

* Fix Sqlite database locking issue (#13246)

* Add locking for creating scope

* Lock the repository instead

* Add scope in action instead of locking in service

* Fix up post-merge

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

* Bump version to next minor

* Fix for UseExceptionHandler no longer working since v10.3 RC (#13218)

* Fix for UseExceptionHandler no longer working since v10.3 RC

* Update the management api path to match the new one

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

* New backoffice: Cleanup management API routes (#13296)

* Rename ModelsBuilderDashboard folder to ModelsBuilder

* Fix modelsbuilder paths and related naming

* Rename analytics route to telemetry

* Fix controller bases - routes and tags

* Fix items route

* Fix more controllerbase routes

* Fix route

* Fix OpenApi file

* Merging DictionaryItem and Dictionary

* Fix TrackedReferences naming

* Update OpenApi file

* Rename Analytics* related types to Telemetry*

* New Backoffice: Return AnalyticsLevelViewModel from Telemetry/ (#13298)

* Return TelemetryLevelViewModel instead of TelemetryLevel

* Fix schema

* Change telemetry/current to telemetry/level

(cherry picked from commit f2b8494c669cbbf04b623753abbf1be211973aa9)

* Add contants for tree and recycle-bin subpaths

(cherry picked from commit 4449f56bc00832ea6d357a3854b454791c80e0e2)

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

* Updated Smidge, Npoco and MailKit (#13310)

* Updated Smidge, Npoco and MailKit

* Added missing command (after breaking interface in npoco)

* OpenId Connect authentication for new management API (#13318)

* First attempt at OpenIddict

* Making headway and more TODOs

* Redo current policies for multiple schemas + clean up auth controller

* Fix bad merge

* Clean up some more test code

* Fix spacing

* Include AddAuthentication() in OpenIddict addition

* A little more clean-up

* Move application creation to its own implementation + prepare for middleware to handle valid callback URL

* Enable refresh token flow

* Fix bad merge from v11/dev

* Support auth for Swagger and Postman in non-production environments + use default login screen for back-office logins

* Add workaround to client side login handling so the OAuth return URL is not corrupted before redirection

* Add temporary configuration handling for new backoffice

* Restructure the code somewhat, move singular responsibility from management API project

* Add recurring task for cleaning up old tokens in the DB

* Fix bad merge + make auth controller align with the new management API structure

* Explicitly handle the new management API path as a backoffice path (NOTE: this is potentially behaviorally breaking!)

* Redo handle the new management API requests as backoffice requests, this time in a non-breaking way

* Add/update TODOs

* Revert duplication of current auth policies for OpenIddict (as it breaks everything for V11 without the new management APIs) and introduce a dedicated PoC policy setup for OpenIddict.

* Fix failing unit tests

* Update src/Umbraco.Cms.ManagementApi/Security/BackOfficeApplicationManager.cs

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

* Update src/Umbraco.Cms.ManagementApi/Security/BackOfficeApplicationManager.cs

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

* Update src/Umbraco.Cms.ManagementApi/Security/BackOfficeApplicationManager.cs

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

* Update src/Umbraco.Core/Routing/UmbracoRequestPaths.cs

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

* V11: Using IFileProvider to access assets added from packages (#13141)

* Creating a FileProviderFactory for getting the package.manifest and grid.editors.config.js files through a file provider

* Collecting the package.manifest-s from different sources

* Searching different sources for grid.editors.config.js

* Using an IFileProvider to collect all tours

* Refactoring IconService.cs

* Typo

* Optimizations when looping through the file system

* Moving WebRootFileProviderFactory to Umbraco.Web.Common proj

* Removes double registering

* pluginLangFileSources includes the localPluginFileSources

* Comments

* Remove linq from foreach

* Change workflow for grid.editors.config.js so we check first physical file, then RCL, then Embedded

* Clean up

* Check if config dir exists

* Discover nested package.manifest files

* Fix IFileInfo.PhysicalPath check

* Revert 712810e1fd as that way files in content root are preferred over those in web root

* Adding comments

* Refactoring

* Remove PhysicalPath check

* Fix registration of WebRootFileProviderFactory

* Use Swashbuckle instead of NSwag (#13350)

* First attempt at OpenIddict

* Making headway and more TODOs

* Redo current policies for multiple schemas + clean up auth controller

* Fix bad merge

* Clean up some more test code

* Fix spacing

* Include AddAuthentication() in OpenIddict addition

* A little more clean-up

* Move application creation to its own implementation + prepare for middleware to handle valid callback URL

* Enable refresh token flow

* Fix bad merge from v11/dev

* Support auth for Swagger and Postman in non-production environments + use default login screen for back-office logins

* Add workaround to client side login handling so the OAuth return URL is not corrupted before redirection

* Add temporary configuration handling for new backoffice

* Restructure the code somewhat, move singular responsibility from management API project

* Add recurring task for cleaning up old tokens in the DB

* Fix bad merge + make auth controller align with the new management API structure

* Explicitly handle the new management API path as a backoffice path (NOTE: this is potentially behaviorally breaking!)

* Redo handle the new management API requests as backoffice requests, this time in a non-breaking way

* Add/update TODOs

* Replace NSwag with Swashbuckle and clean up unnecessary client secret workaround

* Revert duplication of current auth policies for OpenIddict (as it breaks everything for V11 without the new management APIs) and introduce a dedicated PoC policy setup for OpenIddict.

* Fix failing unit tests

* A little niceness + export new OpenApi.json and fix path in contract unit test

* Redo after merge with v11/dev + filter out unwanted mime types

* Remove CreatedResult and NotFoundObjectResult where possible

* Custom schema IDs - no more "ViewModel" postfix and make generic lists look less clunky too

* A little more explanation for generic schema ID generation

* Force Swashbuckle to use enum string names

* Update OpenApi.json to match new enum string values

* Add clarifying comment about weird looking construct

* add workflow to schema (#13349)

* add workflow to schema

* add licenses to CMSDefinition - intentionally only adding to schema, not registered as options

Co-authored-by: Nikolaj <nikolajlauridsen@protonmail.ch>
Co-authored-by: Ronald Barendse <ronald@barend.se>
Co-authored-by: Andy Butland <abutland73@gmail.com>
Co-authored-by: Zeegaan <nge@umbraco.dk>
Co-authored-by: Justin Neville <67802060+justin-nevitech@users.noreply.github.com>
Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com>
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
Co-authored-by: Kenn Jacobsen <kja@umbraco.dk>
Co-authored-by: Nathan Woulfe <nathan@nathanw.com.au>
2022-11-08 08:21:55 +01:00
Nathan WoulfeandGitHub 8074c3fb62 add workflow to schema (#13349)
* add workflow to schema

* add licenses to CMSDefinition - intentionally only adding to schema, not registered as options
2022-11-07 16:01:11 +01:00
Kenn JacobsenandGitHub 2a5c70a28b Use Swashbuckle instead of NSwag (#13350)
* First attempt at OpenIddict

* Making headway and more TODOs

* Redo current policies for multiple schemas + clean up auth controller

* Fix bad merge

* Clean up some more test code

* Fix spacing

* Include AddAuthentication() in OpenIddict addition

* A little more clean-up

* Move application creation to its own implementation + prepare for middleware to handle valid callback URL

* Enable refresh token flow

* Fix bad merge from v11/dev

* Support auth for Swagger and Postman in non-production environments + use default login screen for back-office logins

* Add workaround to client side login handling so the OAuth return URL is not corrupted before redirection

* Add temporary configuration handling for new backoffice

* Restructure the code somewhat, move singular responsibility from management API project

* Add recurring task for cleaning up old tokens in the DB

* Fix bad merge + make auth controller align with the new management API structure

* Explicitly handle the new management API path as a backoffice path (NOTE: this is potentially behaviorally breaking!)

* Redo handle the new management API requests as backoffice requests, this time in a non-breaking way

* Add/update TODOs

* Replace NSwag with Swashbuckle and clean up unnecessary client secret workaround

* Revert duplication of current auth policies for OpenIddict (as it breaks everything for V11 without the new management APIs) and introduce a dedicated PoC policy setup for OpenIddict.

* Fix failing unit tests

* A little niceness + export new OpenApi.json and fix path in contract unit test

* Redo after merge with v11/dev + filter out unwanted mime types

* Remove CreatedResult and NotFoundObjectResult where possible

* Custom schema IDs - no more "ViewModel" postfix and make generic lists look less clunky too

* A little more explanation for generic schema ID generation

* Force Swashbuckle to use enum string names

* Update OpenApi.json to match new enum string values

* Add clarifying comment about weird looking construct
2022-11-04 14:46:35 +01:00
nikolajlauridsen 0ed3121eaa Bump version 2022-11-03 09:38:33 +01:00
Elitsa Marinovskaandnikolajlauridsen f4eac20eaf V11: Using IFileProvider to access assets added from packages (#13141)
* Creating a FileProviderFactory for getting the package.manifest and grid.editors.config.js files through a file provider

* Collecting the package.manifest-s from different sources

* Searching different sources for grid.editors.config.js

* Using an IFileProvider to collect all tours

* Refactoring IconService.cs

* Typo

* Optimizations when looping through the file system

* Moving WebRootFileProviderFactory to Umbraco.Web.Common proj

* Removes double registering

* pluginLangFileSources includes the localPluginFileSources

* Comments

* Remove linq from foreach

* Change workflow for grid.editors.config.js so we check first physical file, then RCL, then Embedded

* Clean up

* Check if config dir exists

* Discover nested package.manifest files

* Fix IFileInfo.PhysicalPath check

* Revert 712810e1fd as that way files in content root are preferred over those in web root

* Adding comments

* Refactoring

* Remove PhysicalPath check

* Fix registration of WebRootFileProviderFactory
2022-11-03 09:17:42 +01:00
Elitsa MarinovskaandGitHub 897cf4ca19 V11: Using IFileProvider to access assets added from packages (#13141)
* Creating a FileProviderFactory for getting the package.manifest and grid.editors.config.js files through a file provider

* Collecting the package.manifest-s from different sources

* Searching different sources for grid.editors.config.js

* Using an IFileProvider to collect all tours

* Refactoring IconService.cs

* Typo

* Optimizations when looping through the file system

* Moving WebRootFileProviderFactory to Umbraco.Web.Common proj

* Removes double registering

* pluginLangFileSources includes the localPluginFileSources

* Comments

* Remove linq from foreach

* Change workflow for grid.editors.config.js so we check first physical file, then RCL, then Embedded

* Clean up

* Check if config dir exists

* Discover nested package.manifest files

* Fix IFileInfo.PhysicalPath check

* Revert 712810e1fd as that way files in content root are preferred over those in web root

* Adding comments

* Refactoring

* Remove PhysicalPath check

* Fix registration of WebRootFileProviderFactory
2022-11-02 15:26:07 +01:00
Nikolaj GeisleandNikolaj 8243a66dee Add guard statement (#13340) 2022-11-02 13:12:55 +01:00
dc9d4155a3 OpenId Connect authentication for new management API (#13318)
* First attempt at OpenIddict

* Making headway and more TODOs

* Redo current policies for multiple schemas + clean up auth controller

* Fix bad merge

* Clean up some more test code

* Fix spacing

* Include AddAuthentication() in OpenIddict addition

* A little more clean-up

* Move application creation to its own implementation + prepare for middleware to handle valid callback URL

* Enable refresh token flow

* Fix bad merge from v11/dev

* Support auth for Swagger and Postman in non-production environments + use default login screen for back-office logins

* Add workaround to client side login handling so the OAuth return URL is not corrupted before redirection

* Add temporary configuration handling for new backoffice

* Restructure the code somewhat, move singular responsibility from management API project

* Add recurring task for cleaning up old tokens in the DB

* Fix bad merge + make auth controller align with the new management API structure

* Explicitly handle the new management API path as a backoffice path (NOTE: this is potentially behaviorally breaking!)

* Redo handle the new management API requests as backoffice requests, this time in a non-breaking way

* Add/update TODOs

* Revert duplication of current auth policies for OpenIddict (as it breaks everything for V11 without the new management APIs) and introduce a dedicated PoC policy setup for OpenIddict.

* Fix failing unit tests

* Update src/Umbraco.Cms.ManagementApi/Security/BackOfficeApplicationManager.cs

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

* Update src/Umbraco.Cms.ManagementApi/Security/BackOfficeApplicationManager.cs

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

* Update src/Umbraco.Cms.ManagementApi/Security/BackOfficeApplicationManager.cs

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

* Update src/Umbraco.Core/Routing/UmbracoRequestPaths.cs

Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
2022-11-01 11:15:31 +01:00
MoleandGitHub 174874eb11 Fix casing in fileSystemBasePath (#13306) 2022-11-01 08:41:50 +01:00
Bjarke BergandNikolaj 68676db082 Updated Smidge, Npoco and MailKit (#13310)
* Updated Smidge, Npoco and MailKit

* Added missing command (after breaking interface in npoco)
2022-10-31 08:28:59 +01:00
Bjarke BergandGitHub 746ab4bb23 Updated Smidge, Npoco and MailKit (#13310)
* Updated Smidge, Npoco and MailKit

* Added missing command (after breaking interface in npoco)
2022-10-31 08:25:06 +01:00
Jason ElkinandMichael Latouche 6cb53fd703 Swap HSTS healthcheck status on localhost 2022-10-30 00:51:36 +02:00
TiffanyandMichael Latouche 96da638236 Added h2 for the package details heading 2022-10-29 01:13:39 +02:00
SimonJansson2andMichael Latouche 2071224d1f Adding swedish backoffice translations 2022-10-27 09:32:53 +02:00
6ff4d27d47 New backoffice: Cleanup management API routes (#13296)
* Rename ModelsBuilderDashboard folder to ModelsBuilder

* Fix modelsbuilder paths and related naming

* Rename analytics route to telemetry

* Fix controller bases - routes and tags

* Fix items route

* Fix more controllerbase routes

* Fix route

* Fix OpenApi file

* Merging DictionaryItem and Dictionary

* Fix TrackedReferences naming

* Update OpenApi file

* Rename Analytics* related types to Telemetry*

* New Backoffice: Return AnalyticsLevelViewModel from Telemetry/ (#13298)

* Return TelemetryLevelViewModel instead of TelemetryLevel

* Fix schema

* Change telemetry/current to telemetry/level

(cherry picked from commit f2b8494c669cbbf04b623753abbf1be211973aa9)

* Add contants for tree and recycle-bin subpaths

(cherry picked from commit 4449f56bc00832ea6d357a3854b454791c80e0e2)

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>
2022-10-27 08:46:21 +02:00
Justin NevilleandNikolaj 86d9e51039 Fix for UseExceptionHandler no longer working since v10.3 RC (#13218)
* Fix for UseExceptionHandler no longer working since v10.3 RC

* Update the management api path to match the new one

Co-authored-by: Nikolaj <nikolajlauridsen@protonmail.ch>
2022-10-26 13:57:37 +02:00
f5aba340e4 Fix for UseExceptionHandler no longer working since v10.3 RC (#13218)
* Fix for UseExceptionHandler no longer working since v10.3 RC

* Update the management api path to match the new one

Co-authored-by: Nikolaj <nikolajlauridsen@protonmail.ch>
2022-10-26 13:56:09 +02:00
Nikolaj 054f5db6bb Bump version to next minor 2022-10-26 10:17:40 +02:00
Nikolaj 276be1ac8e Merge branch 'release/11.0' into v11/dev 2022-10-26 10:16:02 +02:00
bacc81d01a Fix Sqlite database locking issue (#13246)
* Add locking for creating scope

* Lock the repository instead

* Add scope in action instead of locking in service

* Fix up post-merge

Co-authored-by: Zeegaan <nge@umbraco.dk>
2022-10-26 08:47:04 +02:00
2cb926cada Parse lockId as invariant (#13284)
Co-authored-by: Zeegaan <nge@umbraco.dk>
2022-10-26 08:45:51 +02:00
10d03f0b58 Add IContextCache to deploy connectors (#13287)
* Add IContextCache and implementations

* Update connector interfaces to use IContextCache

* Minor cleanup

* Move DeployContextCache prefix to constant

* Move default implementations to obsolete methods

* Remove DeployContextCache and DictionaryCache

Co-authored-by: Andy Butland <abutland73@gmail.com>
2022-10-26 08:42:55 +02:00
1560e84f14 Add IContextCache to deploy connectors (#13287)
* Add IContextCache and implementations

* Update connector interfaces to use IContextCache

* Minor cleanup

* Move DeployContextCache prefix to constant

* Move default implementations to obsolete methods

* Remove DeployContextCache and DictionaryCache

Co-authored-by: Andy Butland <abutland73@gmail.com>
2022-10-25 18:40:11 +02:00
Sebastiaan Janssen 2f57e84aba Merge branch 'v11/dev' into v11/contrib 2022-10-25 16:42:18 +02:00
MoleandGitHub fc187596e3 V11: Use SqLiteException instead of SqlException in SqliteDistributedLockingMechanism & fix E2E tests (#13293) 2022-10-25 16:40:36 +02:00
BatJanandSebastiaan Janssen 8fe699f26b Change prevalue order 2022-10-25 15:47:45 +02:00
Matthew WiseandSebastiaan Janssen 5040bbc1b2 Added asserts to TagsCanBecomeInvariantByPropertyTypeAndBackToVariant 2022-10-25 15:44:50 +02:00
Matthew WiseandSebastiaan Janssen 036580248b Remove xml docs warnings using .editorconfig 2022-10-25 15:41:48 +02:00
Rachel BreezeandSebastiaan Janssen d32b93349d A11Y added missing iframe title to installer and preview controller. 2022-10-25 15:40:14 +02:00
CyberReiterandSebastiaan Janssen ce60e72452 adding some german translations 2022-10-25 15:38:30 +02:00
MoleandGitHub dc9085bd1d Remove references to build.ps1 in build docs (#13252) 2022-10-25 14:52:10 +02:00
Sebastiaan Janssen 46414f2c64 Merge branch 'v11/dev' into v11/contrib 2022-10-25 14:27:14 +02:00
Sebastiaan Janssen 9e3178034e Merge branch 'v10/dev' into v11/dev 2022-10-25 14:26:01 +02:00
CarlandGitHub 2ab0fa514d Added constants for getTreeItem in 2 stes of tests (#13276) 2022-10-24 07:49:36 +02:00
4367e45b73 Const adding for content tests (#13271)
* Constant replacing string

SaveNode const created to replace string for saveNew action

* Hardcoded string for content replaced for const

* Const created for default alias

* Refactoring dupe constants

* Using constanthelper to refactor further

* Dupe consts for strings amalgamated

Cleaning up the few strings I have missed and duplicate constants with different name

Co-authored-by: emma burstow <emaburst@gmail.com>
2022-10-24 07:45:06 +02:00
CarlandGitHub 220600319c Feature/git ignore to exclude test results from git (#13275)
* Additional info for running individual tests

* Ignore playwright test results from git

* Update README.md

These changes belong in a different PR #13274
2022-10-24 07:41:37 +02:00
CarlandGitHub aada595d60 Additional info for running individual tests (#13274) 2022-10-24 07:40:14 +02:00
Carole Rennie LoganandSebastiaan Janssen cdb42799dd updating to reference v11/contrib, not 10 2022-10-22 13:07:59 +02:00
Carole Rennie LoganandGitHub e780beadd7 update to link to youtube tutorials (#13266) 2022-10-22 13:06:17 +02:00
TiffanyandSebastiaan Janssen 5209840597 Fixed user invited badge color 2022-10-22 12:37:07 +02:00
emma-hqandGitHub 5fe165421c Adding discord server info (#13264)
* Adding discord server info

Discord server added to the Join our community section

* Update .github/README.md
2022-10-21 22:13:59 +01:00
Michael LatoucheandJoe Glombek 92ac072559 Update datepicker.controller.js
Don't set dirty if date actually not changed
2022-10-21 21:14:29 +01:00
6cad4013e4 Renames Installer form from "myForm" to "installerForm" (#12806)
Co-authored-by: Joe Glombek <joe@glombek.com>
2022-10-21 20:21:21 +01:00
Sebastiaan JanssenandMichael Latouche 7d9ee69fbc Changed Logo button behavior to be more consistent with the rest of the header 2022-10-21 18:16:58 +02:00
Anders BjernerandMichael Latouche 4922144528 Added shortcut="esc" to RTE HTML editor close button 2022-10-21 16:58:26 +02:00
Nikolaj 96ea387a6c Bump version 2022-10-21 10:31:39 +02:00
Mole 38712dce16 Add PrivateAssets="all" to mangement api project reference (#13249) 2022-10-21 09:17:38 +02:00
MoleandGitHub e57e910ca6 Merge pull request #13244 from umbraco/v11/merge_dev_into_release
Merge v11/dev into release/11.0.0
2022-10-20 11:43:12 +02:00
nikolajlauridsen 40200d077e Merge branch 'v11/dev' into v11/merge_dev_into_release 2022-10-20 10:18:09 +02:00
MoleandGitHub 7ddea288f9 Merge pull request #13243 from umbraco/v11/merge_v10
V11/merge v10
2022-10-20 10:16:47 +02:00
b3f11b9c16 New backoffice: Change management API base path (#13232)
* Change management api base path to  /umbraco/management/api/

* Update OpenApi schema

* Fixing some more paths

Co-authored-by: Elitsa Marinovska <elm@umbraco.dk>
2022-10-20 09:50:54 +02:00
nikolajlauridsen 8bdfcad469 Fix comment in Umbracoplan 2022-10-20 09:44:23 +02:00
nikolajlauridsen fec7b680ce Merge remote-tracking branch 'origin/v10/dev' into v11/merge_v10
# Conflicts:
#	src/Umbraco.Core/Services/LocalizedTextServiceSupplementaryFileSource.cs
#	tests/Umbraco.Tests.AcceptanceTest/package-lock.json
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/macro.spec.ts
2022-10-20 09:37:14 +02:00
Nikolaj d9286fd4f8 Re-add push to nuget step 2022-10-19 14:32:05 +02:00
Nikolaj 5315f4df1b Remove broken duplicate nuget push command 2022-10-19 14:09:01 +02:00
Nikolaj 1c5e7956f9 Fix publish to MyGet 2022-10-19 12:51:26 +02:00
Nikolaj a73eced29c Add UseDotNet to Integration Tests SQL Server 2022-10-19 10:46:32 +02:00
df19d4fc6d Fixes: Consistency for Nullable reference types in LINQ extensions methods #12692 (#12703)
* Ensure Name and Children can never return null.

* Name should be empty not null

* Ensure Name and Children type queries never return null

Co-authored-by: Sebastiaan Janssen <sebastiaan@umbraco.com>
2022-10-19 10:32:09 +02:00
+1 27e129a6b4 V11: Merge v10 (#13235)
* Fix broken selectable state for list view items (#13148)

* Add sync rendering extensions for block grid and async ones for block list (#13168)

* Re-add IsPackable to Umbraco.Tests.Integration

* Fix for potential race condition in packages search (#13153)

* search on input allowing to wait for copy/paste etc

* invoke resourcePromise() with correct parameters

* return the xhrStatus allowing the caller to check if the request was aborted

* fix: send in canceler.promise to allow the timeout to work

* catch any errors and ignore aborts if they happen

* move the logic to handle cancellations outside Angulars $scope.$apply

* remove file accidentally committed

* Fix for potential race condition in packages search (#13153)

* search on input allowing to wait for copy/paste etc

* invoke resourcePromise() with correct parameters

* return the xhrStatus allowing the caller to check if the request was aborted

* fix: send in canceler.promise to allow the timeout to work

* catch any errors and ignore aborts if they happen

* move the logic to handle cancellations outside Angulars $scope.$apply

* remove file accidentally committed

(cherry picked from commit 4a412bb432)

* V10: Fix request accessor memory leak (#13152)

* Dispose OnChange event registration when disposing the notification handler

* Ensure that the ApplicationUrl is only initialized once

Since notifications handlers are transient,_hasAppUrl and _isInit defaults to false on every request causing it to always be called.

* Make notification handler and EnsureApplicationUrl internal

* Add missing ForceLeft and ForceRight (#13190)

* V10: Fix request accessor memory leak (#13152)

* Dispose OnChange event registration when disposing the notification handler

* Ensure that the ApplicationUrl is only initialized once

Since notifications handlers are transient,_hasAppUrl and _isInit defaults to false on every request causing it to always be called.

* Make notification handler and EnsureApplicationUrl internal

* Add missing ForceLeft and ForceRight (#13190)

* Pass the node property to umb-property & umb-property-editor (#13151)

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

* V10: 13099 fix validation error (#13170)

* Add validation error message to Viewpicker

* Add help-inline class to make validation-text red

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

* move clear:both; to the flexbox example (#13194)

* remove pointer-events from Image, to make drag n' drop work on firefox. (#13193)

* area permission min-max inputs width increase (#13195)

* Fix tags with CSV storage type (#13188)

* Fixing null check as default(NRT) is null => default(configuration?.Delimiter) is also null and we were counting on it being the same as default(char)

* Adding tests to check cases with multiple tags (or tag made of comma separated values)

* Fix tags with CSV storage type (#13188)

* Fixing null check as default(NRT) is null => default(configuration?.Delimiter) is also null and we were counting on it being the same as default(char)

* Adding tests to check cases with multiple tags (or tag made of comma separated values)

* Add documentation for default block grid partial views in the rendering extension methods (#13184)

* Add data-element to umb property so we can find it (#13199)

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

* Add data-element to umb property so we can find it (#13199)

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

* V10/bugfix/create simple package test (#13162)

* Fixed assert to hopefully find the package each time so it isnt flaky anymore

* Updated so it retries 5 times instead of 2

* Dont submit html-report

* Dont have output defined in npm run

* Copy over playwright trace.zip files before publishing

* Updated assert so it looks after the package in the table

* updated so we get the first fail as the trace file

* Bumped version for testhelpers

* Updated so the test checks if the package actually exists. Added a wait that checks if the created packages button is visible

* Updated package lock

* Fixed so it now calls the correct testhelper

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

* Merge BjarneF fix into 10.3 (#13220)

Co-authored-by: Bjarne Fyrstenborg <bjarne_fyrstenborg@hotmail.com>

* make Area fit within block row (#13221)

* 10.3.0-RC: Change grid area input to number + change generic label (#13203)

Co-authored-by: Bjarne Fyrstenborg <bjarne_fyrstenborg@hotmail.com>

* move below center, to make room (#13222)

* highlight areas in dragging-mode for modern browsers (#13224)

* Collect new .xml language files from different sources (#13212)

* Collecting new language files from different sources

* Apply suggestions from review

* Adding TODO for merging the language files locations to one when packages are not concerned

* Collect new .xml language files from different sources (#13212)

* Collecting new language files from different sources

* Apply suggestions from review

* Adding TODO for merging the language files locations to one when packages are not concerned

* Resync editors if content model changed (#13230)

* Disable BlockGridEditor (#13229)

* Disable BlockGridEditor

* Fix typeloader test

* Update src/Umbraco.Core/Models/Blocks/BlockGridItem.cs

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

* Apply suggestions from code review

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

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

* V10.4: Re-enable block grid editor (#13231)

* Revert "Disable BlockGridEditor (#13229)"

This reverts commit 4e9aa8dac2.

* Re-do xml comments fix

* Fix nullable reference error

* Fix acceptance test package.json and package-lock.json

* Re-add wait-on

Co-authored-by: Kenn Jacobsen <kja@umbraco.dk>
Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>
Co-authored-by: Zeegaan <nge@umbraco.dk>
Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
Co-authored-by: Niels Lyngsø <niels.lyngso@gmail.com>
Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com>
Co-authored-by: Andreas Zerbst <73799582+andr317c@users.noreply.github.com>
Co-authored-by: Bjarne Fyrstenborg <bjarne_fyrstenborg@hotmail.com>
Co-authored-by: Matt Darby <matt@darby.digital>
2022-10-19 10:24:43 +02:00
Andreas ZerbstandGitHub b69afe81f3 Merge pull request #13228 from umbraco/v11/bugfix/Add-proper-assert-for-relationtype-test
Added proper save assert instead of checking on the route
2022-10-18 12:38:16 +02:00
Zeegaan 21e6cf36e7 Added proper save assert instead of checking on the route 2022-10-18 11:18:05 +02:00
2903d58ab3 V10: 13125 don't return "null" (#13163)
* Add null check

* Fix for potential race condition in packages search (#13153)

* search on input allowing to wait for copy/paste etc

* invoke resourcePromise() with correct parameters

* return the xhrStatus allowing the caller to check if the request was aborted

* fix: send in canceler.promise to allow the timeout to work

* catch any errors and ignore aborts if they happen

* move the logic to handle cancellations outside Angulars $scope.$apply

* remove file accidentally committed

* V10: Fix request accessor memory leak (#13152)

* Dispose OnChange event registration when disposing the notification handler

* Ensure that the ApplicationUrl is only initialized once

Since notifications handlers are transient,_hasAppUrl and _isInit defaults to false on every request causing it to always be called.

* Make notification handler and EnsureApplicationUrl internal

* Add missing ForceLeft and ForceRight (#13190)

* Fix tags with CSV storage type (#13188)

* Fixing null check as default(NRT) is null => default(configuration?.Delimiter) is also null and we were counting on it being the same as default(char)

* Adding tests to check cases with multiple tags (or tag made of comma separated values)

* Add data-element to umb property so we can find it (#13199)

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

* V10/bugfix/create simple package test (#13162)

* Fixed assert to hopefully find the package each time so it isnt flaky anymore

* Updated so it retries 5 times instead of 2

* Dont submit html-report

* Dont have output defined in npm run

* Copy over playwright trace.zip files before publishing

* Updated assert so it looks after the package in the table

* updated so we get the first fail as the trace file

* Bumped version for testhelpers

* Updated so the test checks if the package actually exists. Added a wait that checks if the created packages button is visible

* Updated package lock

* Fixed so it now calls the correct testhelper

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

* Update src/Umbraco.Core/PropertyEditors/DataValueEditor.cs

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

Co-authored-by: Zeegaan <nge@umbraco.dk>
Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>
Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>
Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com>
Co-authored-by: Andreas Zerbst <73799582+andr317c@users.noreply.github.com>
Co-authored-by: Elitsa Marinovska <elm@umbraco.dk>
2022-10-18 10:56:09 +02:00
Andreas ZerbstandGitHub b1cbc92e8c Merge pull request #13209 from umbraco/v11/bugfix/fix-more-unstable-acceptance-tests
V11: fix more unstable acceptance tests
2022-10-18 09:00:52 +02:00
Nikolaj GeisleandGitHub b84dcf87dd Update tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/ModelsBuilder/modelsbuilder.spec.ts 2022-10-18 08:19:23 +02:00
Kenn JacobsenandGitHub 000324aaba Make Examine API more REST-ish (#13198)
* Make Examine API more REST-ish

* Undo bad renaming

* Move search endpoint under "searchers" route

* Update schema to match new API definition

* Update OpenAPI schema after merge

* Remove "examine" prefixes and change API route from "examine" to "search"

* Update OpenAPI json schema
2022-10-17 17:15:06 +02:00
Nikolaj Geisle d090b89848 Merge remote-tracking branch 'origin/v11/dev' into v11/bugfix/fix-more-unstable-acceptance-tests 2022-10-17 15:52:49 +02:00
Bjarke Berg e006f7cd7d Fixed issue when no models mode was specified in app settings 2022-10-17 15:43:17 +02:00
Nikolaj Geisle 9b6902d9ba Bumb playwright-testhelper version 2022-10-17 15:42:00 +02:00
Nikolaj Geisle c42e6d616c Reset maximum timeout to 30s 2022-10-17 15:27:26 +02:00
Nikolaj Geisle 3a196382f9 Update maximum test time-out 2022-10-17 14:53:41 +02:00
Nikolaj Geisle 8440f57de8 Bumb testhelpers package 2022-10-17 14:29:03 +02:00
Nikolaj Geisle 166791f3da Merge remote-tracking branch 'origin/v11/dev' into v11/bugfix/fix-more-unstable-acceptance-tests 2022-10-17 14:03:09 +02:00
Nikolaj Geisle 2ff3f270ab Remove whitespace from response 2022-10-17 13:01:54 +02:00
Nikolaj Geisle d8b7733ee7 Bumb testhelpers version 2022-10-17 12:17:31 +02:00
Nikolaj Geisle 4a28001740 Update test-helpers version 2022-10-17 12:13:55 +02:00
Nikolaj Geisle a28c2f2f9a Dont remove whitespace 2022-10-17 11:10:05 +02:00
Nikolaj Geisle a50b0de0bb Update playwright-testhelpers version 2022-10-17 10:37:40 +02:00
Bjarke Berg f0866d3ea0 Merge remote-tracking branch 'origin/v11/dev' into v11/dev 2022-10-17 08:21:26 +02:00
Bjarke Berg 773262c8ce Updated templates to say .net 7 2022-10-17 08:21:16 +02:00
Nikolaj Geisle 13b6eb3a48 Assert that the item is loaded before trying to click rollback 2022-10-14 23:58:47 +02:00
MoleandGitHub f7a26f5b58 Only replace the MS services when the site is actually set to InMemoryAuto (#13201) 2022-10-14 20:04:19 +02:00
Nikolaj Geisle fbfeef1b9a Merge branch 'v11/dev' into v11/bugfix/fix-more-unstable-acceptance-tests 2022-10-14 19:21:51 +02:00
Bjarke Berg b4166028bf Merge remote-tracking branch 'origin/v11/dev' into v11/dev 2022-10-14 15:09:04 +02:00
Bjarke Berg 1ea9009feb Added code to avoid unneccessary breaking changes 2022-10-14 15:08:56 +02:00
Ronald Barendse 3dc103e8a6 Add wait-on dev dependency 2022-10-14 11:10:29 +02:00
Nikolaj Geisle 31b76c3705 Close success notification 2022-10-14 10:28:21 +02:00
Nikolaj Geisle 4d4999b078 Add proper expect to download button 2022-10-14 09:51:45 +02:00
Nikolaj Geisle a20a44c0c2 Update testhelpers version 2022-10-14 09:51:33 +02:00
Nikolaj Geisle 6f12eb158a Dont commit playwright.config.ts 2022-10-14 09:09:49 +02:00
Nikolaj Geisle d7ca610f6d Update tests to close success notifications 2022-10-14 09:06:12 +02:00
Nikolaj Geisle e6b0b65ddd Close success notifications after they pop up 2022-10-14 08:48:20 +02:00
Kenn JacobsenandGitHub 9ce83e8f55 Fix pipeline errors for V11 (#13208)
* Correct exec parameter list for json schema generation during build

* Update OpenAPI schema
2022-10-14 08:37:14 +02:00
8e3e4d7ba6 V11: fix failing acceptance tests (#13204)
* Fix macro in RTE test

* Update test-helper version

Co-authored-by: Zeegaan <nge@umbraco.dk>
2022-10-13 19:29:00 +02:00
ea84b863af V11: v10 to v11 (#13205)
* Fix for potential race condition in packages search (#13153)

* search on input allowing to wait for copy/paste etc

* invoke resourcePromise() with correct parameters

* return the xhrStatus allowing the caller to check if the request was aborted

* fix: send in canceler.promise to allow the timeout to work

* catch any errors and ignore aborts if they happen

* move the logic to handle cancellations outside Angulars $scope.$apply

* remove file accidentally committed

* V10: Fix request accessor memory leak (#13152)

* Dispose OnChange event registration when disposing the notification handler

* Ensure that the ApplicationUrl is only initialized once

Since notifications handlers are transient,_hasAppUrl and _isInit defaults to false on every request causing it to always be called.

* Make notification handler and EnsureApplicationUrl internal

* Add missing ForceLeft and ForceRight (#13190)

* Fix tags with CSV storage type (#13188)

* Fixing null check as default(NRT) is null => default(configuration?.Delimiter) is also null and we were counting on it being the same as default(char)

* Adding tests to check cases with multiple tags (or tag made of comma separated values)

* Add data-element to umb property so we can find it (#13199)

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

* V10/bugfix/create simple package test (#13162)

* Fixed assert to hopefully find the package each time so it isnt flaky anymore

* Updated so it retries 5 times instead of 2

* Dont submit html-report

* Dont have output defined in npm run

* Copy over playwright trace.zip files before publishing

* Updated assert so it looks after the package in the table

* updated so we get the first fail as the trace file

* Bumped version for testhelpers

* Updated so the test checks if the package actually exists. Added a wait that checks if the created packages button is visible

* Updated package lock

* Fixed so it now calls the correct testhelper

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

Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>
Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>
Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com>
Co-authored-by: Zeegaan <nge@umbraco.dk>
Co-authored-by: Andreas Zerbst <73799582+andr317c@users.noreply.github.com>
2022-10-13 15:29:38 +02:00
f4280fff0e V11: merge v10 to v11 (#13200)
* Fix for potential race condition in packages search (#13153)

* search on input allowing to wait for copy/paste etc

* invoke resourcePromise() with correct parameters

* return the xhrStatus allowing the caller to check if the request was aborted

* fix: send in canceler.promise to allow the timeout to work

* catch any errors and ignore aborts if they happen

* move the logic to handle cancellations outside Angulars $scope.$apply

* remove file accidentally committed

* V10: Fix request accessor memory leak (#13152)

* Dispose OnChange event registration when disposing the notification handler

* Ensure that the ApplicationUrl is only initialized once

Since notifications handlers are transient,_hasAppUrl and _isInit defaults to false on every request causing it to always be called.

* Make notification handler and EnsureApplicationUrl internal

* Add missing ForceLeft and ForceRight (#13190)

* Fix tags with CSV storage type (#13188)

* Fixing null check as default(NRT) is null => default(configuration?.Delimiter) is also null and we were counting on it being the same as default(char)

* Adding tests to check cases with multiple tags (or tag made of comma separated values)

* Add data-element to umb property so we can find it (#13199)

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

Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>
Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>
Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com>
Co-authored-by: Zeegaan <nge@umbraco.dk>
2022-10-13 11:08:32 +02:00
Nikolaj GeisleandGitHub 442342e388 Make parameters nullable (#13185) 2022-10-13 09:21:27 +02:00
Bjarke Berg ed9a26be3a Post merge fix 2022-10-12 11:20:46 +02:00
Ronald Barendse 3599dd4178 Remove duplicate package references 2022-10-12 11:14:35 +02:00
Bjarke Berg 4712e9e08e Added CompatibilitySuppressions.xml 2022-10-12 11:06:26 +02:00
Bjarke Berg 8ebeb32469 Merge remote-tracking branch 'origin/v11/dev' into v11/dev
# Conflicts:
#	.gitignore
2022-10-12 10:48:40 +02:00
Bjarke Berg 5bd796d73f Merge remote-tracking branch 'origin/v10/dev' into v11/dev
# Conflicts:
#	build/azure-pipelines.yml
#	tests/Umbraco.Tests.AcceptanceTest/misc/umbraco-linux.docker
2022-10-12 10:47:49 +02:00
Ronald Barendse 30e016afb3 Fix ManagementApi dependency and update JSON schema file names 2022-10-12 10:47:10 +02:00
Bjarke Berg 909a14b53a Merge remote-tracking branch 'origin/v11/dev' into v11/dev 2022-10-12 10:45:49 +02:00
Bjarke Berg 5bbd669776 Updated nuget packages to latest version. Incl asp.net core to 7rc2 2022-10-12 10:45:42 +02:00
Ronald Barendse d73ab7c9ca Add compatibility suppressions 2022-10-11 23:54:20 +02:00
Ronald BarendseandGitHub 535d07486f Re-add --no-build to dotnet pack
Should be fixed in .NET SDK 7: https://github.com/dotnet/aspnetcore/issues/43062
2022-10-11 23:42:32 +02:00
94774113f6 V11: Fix InMemoryAuto modelsbuilder mode (#13107)
* POC of a solution that works

* Add razor reference manager

* Ensure the compilation options are correct

* Move InMemory classes to its own namespace

These are all internal, so it should be fine.

* Throw proper exceptions when compilation fails

* Add CheckSumValidator

* Clear the ViewCompiler cache when models changed

This means we no longer need the RefreshingRazorViewEngine \o/

* Remove unused constructor injection

* Make UmbracoAssemblyLoadContext non internal

* Add WIP

* Clear the RazorViewEngine cache when generating new models

This uses reflection, which isn't super nice, however, the alternative is to clone'n'own the entire RazorViewEngine, which is arguably worse

* Fix circular dependency

* Remove ModelsChanged event

This is no longer necessary

* Fix precompiled views path

We need to normalize these paths to ensure they matches with the keys in _precompiledViews

* Clean

* Fix content tests

* Add logging

* Update the comment in UmbracoBuilderDependencyInjectionExtensions to reflect changes

* Remove RefreshingRazorViewEngine as its no longer needed

* Remove unused ViewEngine hack from DI

* Fix langversion

This is required since dotnet 7 is still in preview

* Add modelsbuilder tests

* Add more tests

* fixed comment

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2022-10-07 10:42:32 +02:00
Bjarke Berg b2ed235870 Merge remote-tracking branch 'origin/v10/dev' into v11/dev 2022-10-07 10:04:11 +02:00
Bjarke Berg e6074968fe Updated dependencies 2022-10-05 21:26:05 +02:00
Bjarke Berg 9df07de52e Merge remote-tracking branch 'origin/v10/dev' into v11/dev
# Conflicts:
#	version.json
2022-10-05 21:18:36 +02:00
Bjarke BergandGitHub 018e1e9265 Merge pull request #13129 from umbraco/v11/merge/merge-v10-to-v11
merge v10 into v11
2022-10-05 21:17:55 +02:00
Bjarke Berg 4e48c975b7 Fix contract 2022-10-05 20:55:20 +02:00
Bjarke Berg 90e5f8538d Merge remote-tracking branch 'origin/v11/merge/merge-v10-to-v11' into v11/merge/merge-v10-to-v11 2022-10-05 16:05:06 +02:00
Bjarke Berg 44e768de4d fix pack issue 2022-10-05 16:04:26 +02:00
Nikolaj Geisle 23f2e73d72 Remove unused dependencies 2022-10-05 15:51:38 +02:00
Nikolaj Geisle 0e7baa1626 Update langversion 2022-10-05 15:51:28 +02:00
Zeegaan b797350d00 Post-merge 2022-10-05 15:16:43 +02:00
Zeegaan 9243c59ce9 Merge branch 'v10/dev' into v11/merge/merge-v10-to-v11
# Conflicts:
#	.github/workflows/codeql-analysis.yml
#	.gitignore
#	Directory.Build.props
#	build/azure-pipelines.yml
#	src/JsonSchema/Options.cs
#	src/JsonSchema/UmbracoJsonSchemaGenerator.cs
#	src/Umbraco.Cms.ManagementApi/DependencyInjection/FactoryBuilderExtensions.cs
#	src/Umbraco.Cms.ManagementApi/ManagementApiComposer.cs
#	src/Umbraco.Cms.ManagementApi/OpenApi.json
#	src/Umbraco.Core/Models/Mapping/DictionaryMapDefinition.cs
#	src/Umbraco.Infrastructure/Security/UmbracoUserManager.cs
#	tests/Directory.Build.props
#	tests/Umbraco.Tests.AcceptanceTest/package-lock.json
#	tests/Umbraco.Tests.AcceptanceTest/package.json
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Packages/packages.spec.ts
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Tabs/tabs.spec.ts
#	tests/Umbraco.Tests.Integration/TestServerTest/UmbracoTestServerTestBase.cs
2022-10-05 14:29:41 +02:00
Bjarke BergandGitHub 46da0b07a8 Ship two json schema files.. One that reference others, and a CMS one (#13123)
* Ship two json schema files.. One that reference others, and a CMS one

* git ignore

* Build schema files sepearately
2022-10-05 12:42:21 +02:00
+12 6dc874147f v11: Merge v10/feature/project-cleanup into v11/dev (#13112)
* New backoffice/add system text json configuration attribute (#12998)

* Add SystemTextJsonConfigurationAttribute

* Fix up formatting

* Rename classes for clearer purpose

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

* UmbracoPath should no longer be configurable (#13032)

* UmbracoPath should no longer be configurable

* Remove UmbracoPath configuration from all tests

* Only contain style instead of full layout (#13033)

* Only contain style instead of full layout (#13033)

* Fix CodeQL duplicate "permissions"  node and reformat

* add an extra check to ensure the pips exist before adding a class to them

* improve pip classList add/remove with no intermediary variable

* Only contain style instead of full layout (#13033)

* Ensure consistent margin on headings in tree root (#12992)

* Ensure consistent margin on headings in tree root (#12992)

(cherry picked from commit 88bfef9e0d)

* Bump version to 10.2.1

* Translate "User permissions for languages" feature to dutch (#12971)

* Translate 'sectionsHelp' to Dutch

* Translate 'selectLanguages' to Dutch

* Transkate 'allowAccessToAllLanguages' to Dutch

* Translate "User permissions for languages" feature to español (#12975)

* Translate 'selectLanguages' to Español

* Translate 'languagesHelp' to español

* Translate 'allowAccessToAllLanguages' to spanish

* Updated project references for Forms and Deploy in the JsonSchema project. (#13047)

* Updated project references for Forms and Deploy in the JsonSchema project. (#13047)

* UmbracoPath has been removed from the official schema store, remove temporary workaround from our schema generator as well (#13043)

* add an extra check to ensure the pips exist before adding a class to them

* improve pip classList add/remove with no intermediary variable

* pass in parameters needed to member service (#13020)

* Missing methods from IMemberService (#13022)

* Add back methods to interface

* Add default implementations to avoid breaking changes

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

* New endpoint for web profiling dashboard (#13038)

* Endpoint for web profiling dashboard

* Add profiling API contract

* New Backoffice: Published cache controller (#13034)

* Add published cache controller (endpoints for the Published Status dashboard)

* Update OpenAPI contract for published cache endpoints

* Fix OpenApi spec

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

* Bug fix for datepicker with offset time (#12847)

* https://github.com/umbraco/Umbraco-CMS/issues/12844

* remove "X" from ng-attr

Doing the test I killed the ng-if attr. But forgot it was there doing the commit

Co-authored-by: Lucas Bach Bisgaard <lom@novicell.dk>

* Make sure swagger tags and operations are sorted alphabetically (#13055)

* Add spellcheck false to password inputs (#13059)

* Add null check for variants in Grid Layout (#13060)

This fixes a regression from 10.2.0 where the `variants` property was removed.

* Add null check for variants in Grid Layout (#13060)

This fixes a regression from 10.2.0 where the `variants` property was removed.

* Fixes #12972 for validating legacy member passwords (#12973)

* Fixes #12972 for validating legacy member passwords

* Removed unused variable

* removed unused variable

* Fix issue toggling boolean between true/false after Save without refreshing

* New backoffice: examine management controller (#12981)

* Add ExamineManagementControllerBase

* Add ExamineIndexModelFactory

* Add IndexesExamineManagementController

* Add proper attributes

* Implement ExamineIndexViewModel.cs

* formatting

* Add comment about it working in .NET 7

* Add SearchersExamineManagementController.cs

* Update comments about why it might throw errors

* Add SearchResultViewModel

* Add SearchExamineManagementController

* Add ExamineSearcherValidationService

* Rename ExamineSearcherValidationService.cs to ExamineSearcherFinderService.cs

* Rename interface aswell

* Add SearchExamineManagementController

* Refactor ExamineSearcherFinderService

* Add HasIndexRebuiltExamineManagementController.cs

* Fix up formatting

* Async actions

* Add RebuildIndexExamineManagementController.cs

* Rename IExamineIndexModelFactory to IExamineIndexViewModelFactory

* Refactor HasIndexRebuilt endpoint to Index endpoint

* Remove unused usings

* Fix up DetailsExplanation

* Create dedicated SearchersViewModel

* Rename action

* Rename RebuildIndex to Rebuild

* Dont have changes in ExamineIndexModel

* Make values strongly typed instead of generic lists of strings

* Rename to non-plural

* Rename to non-plural

* Rename controller

* Introduce ITemporaryIndexingService

* Introduce ITemporaryIndexingService

* Add SearcherName to view model

* Move to new ExamineManagementControllerBase.cs

* Refactor ExamineManagerService

* Use init instead of setters

* Make properties explicitly on models

* Add DI

* Apply suggestions from code review

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

* Rename to IndexExamineManagementController

* Return ViewModel instead of exception

* Make view models non-nullable

* Add examine management extension point

* Rename to IndexingRebuilderService

* Move rebuild logic to service

* Fix up usages in IIndexingRebuilderService

* Fix up DI

* Fix OpenApi contract

* Implement CanRebuild on IIndexingRebuilderService.cs

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

* Update build script

* Add BuildProjectReferences=false to dotnet pack

* Internalize Umbraco.Cms.ManagementApi references

* Make Searchers endpoint return ActionResult (#13068)

* New backoffice - trees design (#12963)

* Refactor: Add default versioned back office route attribute

* Tree controller bases and first draft implementations for document, media and doctype

* Move tree item view models to appropriate location

* Fix missing parent

* Refactor user entity access for testability

* A bit of clean-up + handle user start nodes for items endpoint

* Implement foldersOnly for folder tree

* Items endpoint for document type tree

* Strongly typed action results

* Content + media recycle bin

* Correct return type for swagger

* Member type tree

* Rename user start node handling to make a little more sense

* Revert to faked admin start nodes in document tree

* Media type tree

* Data type tree

* Relation type tree

* Remove unused dependency from member type tree

* Correct documentation for member type tree endpoint response types

* Use icon constants

* Add templates tree

* Member group tree

* Document blueprint tree

* Partial views, scripts and stylesheets trees

* Static files tree

* Clarify "folders only" state

* Comments and improved readability

* Rename TreeControllerBase and TreeItemViewModel

* Move recycle bin controller base to its own namespace

* Moved tree base controllers to their own namespace

* Common base class for tree view models

* Remove ProblemDetails response type declaration from all actions

* Add OpenApiTag

* Various review comments

* Dictionary item tree

* Renamed all tree controllers to follow action/feature naming convention

* Handle client culture state for document tree

* Support "ignore user start nodes" for content and media + refactor how tree states work to make things more explicit

* Fix or postpone a few TODOs

* Make entity service able to paginate trashed children

* Handle sorting explicitly

* Re-apply VersionedApiBackOfficeRoute to install and upgrade controllers after merge

* Use PagedViewModel instead of PagedResult for all trees

* Explain the usage of UmbracoObjectTypes.Unknown

* Introduce and apply GetMany pattern for dictionary items

* Add a note about relation type caching

* Fix broken test build + add unit tests for new localization service methods

* Use new management API controller base

* Entity repository should build document entities for document blueprints when getting paged entities (same as it does when getting specific entities)

* Use Media type for Media recycle bin

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

* Move shared relation service to concrete implementations

* Use inclusive language

* Add 401 response type documentation to applicable trees

* Refactor entity load for folder tree controller base + ensure that folders are only included in the first result page

* Add (in-memory) pagination to dictionary tree

* Make file system controller honor paging parameters

* Support pagination in relation type tree

* Clarify method name a bit for detecting tree root path requests

* Update Open API schema to match new trees

* Move from page number and page size to skip/take (with temporary workaround for lack of property skip/take pagination in current DB implementation)

* Update OpenAPI schema to match skip/take

* Update OpenAPI schema

* Don't return paginated view models from "items" endpoints

* Update OpenApi schema

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

* Use pattern matching to check if items is not `JArray`

* Bump Smidge up to v4.1.1

* Removing X-XSS-Protection healthcheck

* Redirect to a return URL if one is present on the querystring when logging into the back office

* Fix issue 13023 - Cannot read properties of undefined (reading 'allowedActions')

* Implement playwright acceptance tests instead of cypress (#13069)

* fix up dependencies in package.json

* Change configs to playwright

* update types

* remove cypress

* add playwright

* Fix up imports

* Move up test files

* Fix up scripts

* Update user import

* Remove allowEditInvariantFromNonDefault=True.spec.ts

* Update docker container

* Run playwright on pipelines

* Install playwright

* change urls

* change to run playwright

* Update reporter

* create .env file when installing

* update pipelines

* Remove @in yml

* Update Yaml script to use New-Item

* Pipe object to Value

* Update yaml to use "" not {}

* Update localhost to proper port

* Push package-lock.json

* include dotenv in package.json

* Add back umbraco.config.ts

* Dont change launchSettings.json

* Fix up pipelines

* Change working directory

* Add logging

* Actually name the file

* Remove .env from path

* Add working directory

* Add working directory to script

* check env content

* Update more working dir

* Try making newline in YAML

* add quotes

* Try multiline infront of script

* Move top statement

* use https

* Update to localhost 44331

* ignore https in config

* Change linux to https

* add timeouts for tests

* Fix up url for linux

* Update docker to use port 44331 -> 5000

* increase timeout

* Update yaml

* Remove Cypress references and fix URL/port mapping

* Update umbraco-linux.docker

* Generate ASP.NET HTTPS development certificate

* Enable HTTPS development certificate in Docker

* Dont run failing tests

* Update HTTPS development certificate generation

* Copy nuget.config to correct location in Docker file

* do not run flaky test

* update outputdir

* Remove flaky tests

* Update to dot reporter

* Update to json-models-builders package

* Check if results folder exists

* Remove logging

* Use bash to find folder

* Dont use junit to report

* only publish if folder exists

* Add 5 retries for CI

* search correct folder

* Remove unused json file

* Use line reporter

* Remove umbraco.config.ts

* Remove more flaky test

* Add waits so we dont bombard SQLite

* Add page as parameter

* add page as parameter

* Remove flaky macro test

Co-authored-by: Zeegaan <nge@umbraco.dk>
Co-authored-by: Ronald Barendse <ronald@barend.se>

* Fix comment of view property in `ConfigurationFieldAttribute` (#13077)

* Fix comment of view property in `ConfigurationFieldAttribute`

* Update description of key property as well

* Use char instead of string for DetectJson (#13019)

* Use char instead of string for DetectJson

* Use faster method

* Change DetectIsJon method

* Update acceptance test readme & scripts (#13078)

* Update readme to reflect the change to playwright

* Update test scripts

* update README

* update pipelines to run new script

* update package.json scripts

* dont include demo test in package.json

* Add creation of blueprint test

* Implement create test script

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

* Refactor event handler away from keyup to ng-change

* Don't use legacy icon for action delete

* Added nullability attribute to IsNullOrWhitespace

* Fixes umbraco/Umbraco-CMS.Accessibility.Issues #63 and #61

* Revert "Removing X-XSS-Protection healthcheck" (#13096)

This reverts commit 696475ebf2.

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

* New backoffice: New Api controllers (#12983)

* Create migrate Language controller to Umbraco.Cms:ManagementApi

* Add proper language mapping

* Update mapping to handle if language name is null

* Uncomment code

* Add new language view model

* Add LanguageViewModelMapping

* Add mapper registration

* Fix up AddMappers extension method

* Implement mapping IEnumerable of languages

* Change action signatures to ViewModel instead of model

* Seperate logic from controller into service

* Move LanguageService.cs

* Register service

* Fix up mapping

* Add null check to mapping instead of controller

* Map to ILanguage instead of implementation

* Fix up null check

* Implement ProblemDetailsBuilder.cs

* Rename duplicate method

* Use builder in actions

* Implement new Paged models

* Create language controller base

* Use pagedModel for GetAllLanguages

* Create GetAllLanguagesPaged method

* Split language controller into single APIs

* Fix up controllers with API versions

* Map Total property

* Fix up route and naming for GetLanguageController.cs

* Fix up naming for language controllers

* New folder structure

* Add culture controllers

* Map CultureInfos to paged CultureViewModel

* Remove wierd include in csproj

* Refactor controller to return pagedViewModel instead of dictionary

* Fix up mapping to map single and enumerable

* Register mapping

* Add apiversion to controller

* Add inheritdoc

* Create DictionaryControllerBase.cs

* Add delete controller

* Only use HttpDelete for deletes

* Check also if language exists in service

* Split Save action into Create & Update actions

* Update Http attributes on Create and update controllers

* Proper routing for delete controller

* Add api version

* Make action async

* Implement CreateDictionaryController

* Create DictionaryViewModel.cs

* Use viewmodel instead of values

* Create get by int DictionaryController

* Add view models

* Rename controller

* Rename DictionaryViewModel to DictionaryItemViewModel

* use created instead of ID

* Apply DataContract/Datamember to view model

* change to guid instead of Guid

* Use proper responses instead of return models when creating/updating

* Implement new IDictionaryService

* Implement new MoveController

* Use new service in mapper

* Remove unused method

* Add DictionaryViewModelMapDefinition

* Create MoveOrCopyViewModel

* Proper Http action

* Create UpdateDictionary controller

* Map IDictionaryItem to DictionaryViewModel

* Add JsonPatching

* Add UpdateDictionaryController.cs

* Map DictionaryTranslationsDisplays properly

* ParentId should be nullable

* Add new DictionaryTranslationViewModel.cs

* Remove translationViewModel

* Add Id and Key to DictionaryTranslationDisplay.cs

* Implement IDictionaryFactory.cs

* Create DictionaryViewModels and do not use IEntity

* Map to new view models instead of displays

* Register the factiories in the service container

* Remove newtonsoft

* Add serializing to and from PatchDocs

* Use JsonPatchViewModel instead of object type

* Add JsonPatch.Net to csproj

* Implement JsonPatchService.cs

* Register JsonPatchService

* Make model non-nullable

* Update controllers to use new attributes

* Rename MoveViewModel.cs

* Remove NameIsDirty as that is legacy from how we used to handle updating

* Add GetAllDictionaryController

* Add todo to DictionaryControllerBase

* Add ExportDictionaryController

* Add ImportDictionaryController

* Remove unused umbraco mapper

* Add upload dictionary controller

* Create Dictionary import view models

* Update UploadDictionaryController with view models

* Remove unused using

* Implement pagedviewmodel for GetAllDictionaryController.cs

* Add dictionary overview viewmodels

* Add mapping for DictionaryOverViewModel

* Update Dictionary controller to use new viewmodel

* Fix up attributes for UploadDictionaryController

* Make actions async

* Make controller bases abstract

* Fix after merge

* New backoffice: Analytics controller (#12957)

* Add AnalyticsControllerBase

* Add AnalyticsViewModel

* Add GetAnalyticsController

* Update ViewModel to use System.Text.Json

* Add SetAnalyticsController

* Add AnalyticsLevelViewModel

* Add GetAllAnalyticsController

* Add viewmodel factory

* Register factory for DI

* Use factory for creation of ViewModel

* Fix up AnalyticsLevelViewModel.cs

* Use analyticsLevelViewModel

* Add Enum validation to controller

* Add OpenApi attributes

* Add routing to GetAllAnalyticsController

* Rename IPagedViewModelFactory

* use new renamed PagedViewModelFactory

* Make actions async

* Make controller base abstract

* Fix up after merge

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

* New backoffice: Help controller (#12958)

* Add HelpControllerBase

* Add HelpPageViewModel

* Add GetHelpController

* Add viewmodel factory

* Register factory for DI

* Use PagedViewModelFactory for controller

* Update baseurl to be nullable

* Rename IPagedViewModelFactory

* Use new renamed IPagedViewModelFactory

* Dont use httpclient as field

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

* New backoffice: Relation controller (#12961)

* Add relation controller base

* Add commen about auth

* Add GetRelationController

* Use mapping to viewmodel

* Add RelationViewModel

* Add RelationViewModelsMapDefinition.cs

* Add viewmodel factory

* Register factory for DI

* Rename IPagedViewModelFactory

* Add RelationViewModelFactory

* Remove unused service

* Add GetByChildRelationController

* Add relationViewModelFactory to DI

* Add MappingBuilderExtensions

* Add relationViewModelsMapDefinition to DI

* Use PagedViewModel for child relations

* Add CreateMultiple

* Update GetRelationController to use factory instead of direct mapping

* Update GetByChildRelationController to use relationViewModelFactory

* Fix up after merge

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

* New backoffice: Tracked references controller (#12966)

* Add TrackedReferencesControllerBase.cs

* Add GetTrackedReferencesController

* Add relation model

* Add ITrackedReferencesRepository.cs

* Rename relation to RelationModel

* Add RelationMapDefinition.cs

* Add TrackedReferencesSkipTakeRepository

* Rename RelationModelMapDefinition

* Add new services to DI

* Rename RelationModel to RelationItemModel

* Implement TrackedReferencesSkipTakeService

* Formatting

* Add RelationItemViewModel.cs

* Add mapdefition

* Update TrackedReferencesController to use new PagedViewModel

* Add service to DI

* imlement proper routing

* Add async to GetTrackedReferencesController.cs

* Rename action to get

* Add DescendantTrackedReferencesController

* make filterMustBeIsDependency nullable

* Use count instead of capacity

* Rename controller

* Add MultipleTrackedReferencesController.cs

* Refactor TrackedReferencesService to not return pagedViewModel

* Remove TODO untill consensus on convention

* Formatting

* Delete old duplicate controller

* Fix up naming

* Fix up naming and fixed todo

* Fix up mapdefinition registrations

* Rename controllers

* Fix naming

* Fix nullable tree

* Fix up relation controller & action names

* Fix naming

* Fix up multiple to not be post

* Apply suggestions from code review

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

* Remove [ApiVersion] from each individual controller and added to base instead

* Added missing semi-colon

* Update all "non-async async" endpoints to return Task.FromResult

* Fixed up LanguageViewModels namespace

* Return proper status code

* Update xml documentation

* Rename GetAllCultureController

* Change return type attribute to proper Model

* Change return type attribute to correct model

* Add clarifying comment

* Change return type attribute to proper model

* Rename ById to by key

* Update DictionaryOverviewViewModel to use Key instead of ID

* Implement factory method to create viewModel instead of using services in mapper

* Fix up DictionaryItemViewModel to use Parent GUID instead of ID

* Update return type attribute to correct model

* Update key to actual GUID instead of string

* Update route to not include "delete"

* Remove redundant IActionResult specification

* Update responseType attribute to correct models

* Update OpenApiTag for DictionaryControllerBase

* Update ResponseType attribute to correct models

* update variable name to not be "XD"

* Update ResponseType attribute to correct model

* Update route to not include "update" as it is redundant

* Update produces responsetype attributes to correct models

* Use IJsonSerializer abstraction instead of JsonConvert directly

* Remove unused field

* Change ResponseType attribute to correct model

* change TrackedReferencesSkipTakeService to return pagedModels directly

* Remove duplicate DI

* change to better variable names

* Move RelationItemModel to core

* Remove empty folder

* Remove ITrackedReferencesSkipTakeService and add it to TrackedReferencesService

* remove TrackedReferencesSkipTakeRepository and add to TrackedReferencesRepository.cs

* Fix up TrackedReferencesService to not use SkipTake repository

* Remove AddRepositories from ManagementApiComposer

* Transition to ManagementApiBaseController

* Fixes ResponseType attribute to correct model

* Add loading files to service instead of having logic in controller

* Add todo comment

* Fix up routing for delete language

* Use problem details builder

* Add SystemTextJsonSerializer

* Add SystemTextJsonSerializer

* Remove unused usings

* Remove obsolete MoveDictionaryController

* Remove CreateDate and UpdateDate from DictionaryViewModel

* Change response type to correct model

* Remove PagedViewModelFactory.cs

* Add obsolete message

* Fix installer view models

A setter is required for the modelbinder to be able to do its work

* Update src/Umbraco.Cms.ManagementApi/Controllers/Analytics/SetAnalyticsController.cs

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

* Update ResponseType to correct Model

* Update comment

* Add FileUploadService

* Add DictionaryFactory.cs to handle creation of viewmodel

* Remove unused DI

* Rename actions & controllers to reflect eachother

* Update OpenApi.json

* Add dictionary to openapi

* Update in proper alphabetical order

* Add trackedReferences to openapi

* Fix open api doc

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

* Backport project cleanup from #12907

* Remove empty Directory.Build.props

* Fix GenerateAppsettingsSchema target

* Re-add empty Directory.Build.props to prevent inheritance

* Re-add missing JsonPatch.Net dependency

* Fix merge issues (redundant TargetFramework property and appsettings-schema.json generation)

* Fix and improve OpenAPI test assertion

Co-authored-by: Sebastiaan Janssen <sebastiaan@umbraco.com>
Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
Co-authored-by: Zeegaan <nge@umbraco.dk>
Co-authored-by: Kenn Jacobsen <kja@umbraco.dk>
Co-authored-by: Mads Rasmussen <madsr@hey.com>
Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>
Co-authored-by: Bjarne Fyrstenborg <bjarne_fyrstenborg@hotmail.com>
Co-authored-by: Erik-Jan Westendorp <erikjanwestendorp@outlook.com>
Co-authored-by: Andy Butland <abutland73@gmail.com>
Co-authored-by: Sean <29239704+Bakersbakebread@users.noreply.github.com>
Co-authored-by: Lucas Bach Bisgaard <rammi@rammi.dk>
Co-authored-by: Lucas Bach Bisgaard <lom@novicell.dk>
Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>
Co-authored-by: Busra Sengul <aysebusrasengul@gmail.com>
Co-authored-by: Justin Neville <justin@nevitech.co.uk>
Co-authored-by: Jeavon Leopold <jeavon@crumpled-dog.com>
Co-authored-by: Austin Gilbert <AGilbert@rbaconsulting.com>
Co-authored-by: patrickdemooij9 <patrickdemooij98@hotmail.com>
Co-authored-by: bakersbakebread <hello@seanthorne.co.uk>
Co-authored-by: Karl Butler <kbutler@carbonsix.digital>
2022-10-05 12:14:43 +02:00
Ronald BarendseandGitHub c9f6d6059d Add GitVersionBaseDirectory and fix typo 2022-10-03 16:10:22 +02:00
Andy ButlandandGitHub 7963b76d57 Adds additional deploy selector. (#13094) 2022-10-03 13:14:18 +02:00
Ronald BarendseandGitHub 3873a0735c v11: Decouple dependencies (#12907)
* Move core dependencies and MSBuild targets from Umbraco.Cms to Umbraco.Cms.Targets

* Re-add appsettings.Tests.json

* Include appsettings-schema.json

* Use .NET 7.x in CodeQL build

* Fix duplicate Directory.Build.props import

* Decouple ImageSharp/ImageSharp.Web implementations

* Further decouple SqlServer implementation

* Add SupportedImageFileTypes to IImageDimensionExtractor

* Update descriptions

* Update project metadata

* Re-enable package validation

* Add embedded package icon

* Move ContinuousIntegrationBuild to build script

* Move shared properties to root Directory.Build.props

* Fix GetInstallState throwing exception when default provider isn't configured

* Remove redundant PackageRequireLicenseAcceptance and update version to 11.0.0-rc1

* Update build script

* Remove LangVersion preview

* Disable app-local ICU for MacOS integration test

* Disable app-local ICU for all integration tests

* Fix RuntimeState_Run test assertion

* Update projects and build script to require Node.js 16.17 (latest LTS)

* Remove app-local ICU from unit tests

* Add missing project reference

* Generate XML documentation files

* Expose management API in Web.UI project

* Update .NET 7 dependencies to RC1

* Update package-lock.json files

* Downgrade Cypress version
2022-09-27 14:22:34 +02:00
Bjarke Berg d206df0cac Updated dependencies and cleaned up 2022-09-23 14:56:23 +02:00
510d8bf252 V11: Update the rich text editor TinyMCE to v6 (#13013)
* update 'tinymce' from v4 to v6

* add/remove plugin & file changes

* remove unsupported plugins

* update changes to tinymce api

* bump tinymce to 6.2.0

* reinstate fastdev task

* update rte prevalues

* fix styling of tinymce inline mode

* document new files

* update builtin allowed elements, plugins and styles

* update upload_image_handler to new format

* set correct startup plugins and config

* remove old config for "Paste from Word" which is no longer supported

* update naming in default toolbar

* replace fire() with dispatch()

* support resizing of other elements besides objects, e.g. tables

* replace fire() with dispatch()

* change classes for fullscreen styling

* handle special parsing of AngularJS json response

* remove deprecated tinymce options

* use EditorOptions API to get settings

* send in correct toolbar config

* update icons to use tinymce's new icon pack

* remove unused functions

* configure custom styles

* update docs

* add initial toolbars to grid rte

* change htmlId selector to support html id's with numbers

* remove pintoolbar as it is not compatible with tiny 6

* register custom option maxImageSize through the OptionsManager

* remove custom option

* Revert "register custom option maxImageSize through the OptionsManager"

This reverts commit 342354d6cd.

* register custom option maxImageSize and fetch through EditorOptions

* add rounding to forced image size

* remove fullscreen plugin as it is not available in prod build anyway and it does not work

* update API for uploadImages() function

* update string extensions IsFullPath to support more filepaths with new built-in Path.IsPathFullyQualified

* resolve TODO to switch to Path.IsPathFullyQualified supported from .NET Standard 2.1

* ensure that files are copied from the TEMP folder in the web root

* add dragstart event to drag-events series

* optimise isMediaPickerEnabled function with newer array function 'includes'

* add TEMP folder to gitignore (fx fileuploads)

* update selector for "Insert Macro" button in rte test

* remove old documentation

* Use content root instead of web root for uploaded images

* test IsFullPath without tricky UNC paths that are not useful

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2022-09-20 15:20:20 +02:00
Sebastiaan Janssen 084153157b Fix merge conflict 2022-09-20 13:30:26 +02:00
Sebastiaan Janssen 42c32e76f2 Merge branch 'v10/dev' into v11/dev
# Conflicts:
#	src/Umbraco.Cms.ManagementApi/ManagementApiComposer.cs
2022-09-20 10:56:01 +02:00
Bjarke BergandSebastiaan Janssen d139f4acc0 Updated dependencies and fixed new NRT issues
(cherry picked from commit 803c044b60)
(cherry picked from commit b2b2903a6e)
2022-09-20 10:48:29 +02:00
Sebastiaan Janssen 40035aa629 Merge branch 'v10/dev' into v11/dev 2022-09-20 09:13:22 +02:00
Sebastiaan Janssen db5d05d641 Revert files that shouldn't change back in v11 2022-09-19 16:37:24 +02:00
Sebastiaan Janssen 85147fb5e8 Merge branch 'v10/dev' into v11/dev 2022-09-19 16:25:44 +02:00
Bjarke Berg 1ddfcba686 Updated more dependencies 2022-09-19 12:50:56 +02:00
1854 changed files with 34419 additions and 55714 deletions
-4
View File
@@ -22,7 +22,3 @@ RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/
# https://docs.npmjs.com/cli/v6/using-npm/config#unsafe-perm
# Default: false if running as root, true otherwise (we are ROOT)
#RUN npm -g config set user vscode && npm -g config set unsafe-perm
# Generate and trust a local developer certificate for Kestrel
# This is needed for Kestrel to bind on https
RUN dotnet dev-certs https --trust
+52 -2
View File
@@ -6,6 +6,7 @@
"service": "app",
"workspaceFolder": "/workspace",
// Set *default* container specific settings.json values on container create.
"settings": {
"omnisharp.defaultLaunchSolution": "umbraco.sln",
@@ -13,13 +14,62 @@
"omnisharp.enableRoslynAnalyzers": true
},
"features": {
// Workaround until the image is updated to include the latest version of .NET Core - .NET7
// https://github.com/devcontainers/templates/issues/38#issuecomment-1310803259
"ghcr.io/devcontainers/features/dotnet:1": {
"version": "7"
},
// Adds SSH support to the container
// Allowing the Github CLI `gh codespace ssh` to work
"ghcr.io/devcontainers/features/sshd:1": {
"version": "latest"
},
// Adds SQLite feature from apt install
// Also adds the SQLite VSCode extension
"ghcr.io/warrenbuckley/codespace-features/sqlite:1": {}
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-dotnettools.csharp"
],
// This is used in the prebuilds - so dotnet build (nuget restore and node stuff) is done
"updateContentCommand": "dotnet build umbraco.sln && dotnet dev-certs https --trust",
// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [9000, 5000, 25]
// Use 'forwardPorts' to make a list of ports inside the container available locallAdd "forwardPorts": [9000, 5000, 25],
// Port needed to help discover SMTP4Dev
"forwardPorts": [
5000
],
"portsAttributes": {
"5000": {
"label": "SMTP4Dev",
"protocol": "http",
"onAutoForward": "notify"
},
"9000": {
"label": "Umbraco HTTP",
"protocol": "http",
"onAutoForward": "notify"
},
"44331": {
"label": "Umbraco HTTPS",
"protocol": "https",
"onAutoForward": "notify"
}
},
"customizations": {
"codespaces": {
"openFiles": [
".github/codespaces-readme.md"
]
}
}
// [Optional] To reuse of your local HTTPS dev cert:
//
+1
View File
@@ -248,6 +248,7 @@ csharp_preserve_single_line_blocks = true
##########################################
[*.{cs,csx,cake,vb,vbx}]
dotnet_diagnostic.CS1591.severity = suggestion
##########################################
# Styles
+18 -149
View File
@@ -1,4 +1,4 @@
# Umbraco CMS Build
# Umbraco CMS Build
## Are you sure?
@@ -27,7 +27,7 @@ If you want to run a build without debugging, see [Building from source](#buildi
In order to build the Umbraco source code locally with Visual Studio Code, first make sure you have the following installed.
* [Visual Studio Code](https://code.visualstudio.com/)
* [dotnet SDK v6.0.2+](https://dotnet.microsoft.com/en-us/download)
* [dotnet SDK v7+](https://dotnet.microsoft.com/en-us/download)
* [Node.js v14+](https://nodejs.org/en/download/)
* npm v7+ (installed with Node.js)
* [Git command line](https://git-scm.com/download/)
@@ -72,7 +72,7 @@ When the page eventually loads in your web browser, you can follow the installer
In order to build the Umbraco source code locally with Visual Studio, first make sure you have the following installed.
* [Visual Studio 2019 v16.8+ with .NET 6.0.2+](https://visualstudio.microsoft.com/vs/) ([the community edition is free](https://www.visualstudio.com/thank-you-downloading-visual-studio/?sku=Community&rel=15) for you to use to contribute to Open Source projects)
* [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 v14+](https://nodejs.org/en/download/)
* npm v7+ (installed with Node.js)
* [Git command line](https://git-scm.com/download/)
@@ -99,111 +99,33 @@ When the page eventually loads in your web browser, you can follow the installer
Did you read ["Are you sure"](#are-you-sure)?
### Quick!
Do note that this is only required if you want to test out your custom changes in a separate site (not the one in the Umbraco.Web.UI), if you just want to test your changes you can run the included test site using: `dotnet run` from `src/Umbraco.Web.UI/`
To build Umbraco, fire up PowerShell and move to Umbraco's repository root (the directory that contains `src`, `build`, `LICENSE.md`...). There, trigger the build with the following command:
You may want to build a set of NuGet packages with your changes, this can be done using the dotnet pack command.
build/build.ps1
First enter the root of the project in a command line environment, and then use the following command to build the NuGet packages:
If you only see a build.bat-file, you're probably on the wrong branch. If you switch to the correct branch (v8/contrib) the file will appear and you can build it.
`dotnet pack -c Release -o Build.Out`
You might run into [Powershell quirks](#powershell-quirks).
This will restore and build the project using the release configuration, and put all the outputted files in a folder called `Build.Out`
If it runs without errors; Hooray! Now you can continue with [the next step](CONTRIBUTING.md#how-do-i-begin) and open the solution and build it.
You can then add these as a local NuGet feed using the following command:
`dotnet nuget add source <Path to Build.Out folder> -n MyLocalFeed`
### Build Infrastructure
The Umbraco Build infrastructure relies on a PowerShell object. The object can be retrieved with:
$ubuild = build/build.ps1 -get
The object exposes various properties and methods that can be used to fine-grain build Umbraco. Some, but not all, of them are detailed below.
#### Properties
The object exposes the following properties:
* `SolutionRoot`: the absolute path to the solution root
* `VisualStudio`: a Visual Studio object (see below)
* `NuGet`: the absolute path to the NuGet executable
* `Zip`: the absolute path to the 7Zip executable
* `VsWhere`: the absolute path to the VsWhere executable
* `NodePath`: the absolute path to the Node install
* `NpmPath`: the absolute path to the Npm install
The Visual Studio object is `null` when Visual Studio has not been detected (eg on VSTS). When not null, the object exposes the following properties:
* `Path`: Visual Studio installation path (eg some place under `Program Files`)
* `Major`: Visual Studio major version (eg `15` for VS 2017)
* `Minor`: Visual Studio minor version
* `MsBuild`: the absolute path to the MsBuild executable
#### GetUmbracoVersion
Gets an object representing the current Umbraco version. Example:
$v = $ubuild.GetUmbracoVersion()
Write-Host $v.Semver
The object exposes the following properties:
* `Semver`: the semver object representing the version
* `Release`: the main part of the version (eg `7.6.33`)
* `Comment`: the pre release part of the version (eg `alpha02`)
* `Build`: the build number part of the version (eg `1234`)
#### SetUmbracoVersion
Modifies Umbraco files with the new version.
>This entirely replaces the legacy `UmbracoVersion.txt` file. Do *not* edit version infos in files.
The version must be a valid semver version. It can include a *pre release* part (eg `alpha02`) and/or a *build number* (eg `1234`). Examples:
$ubuild.SetUmbracoVersion("7.6.33")
$ubuild.SetUmbracoVersion("7.6.33-alpha.2")
$ubuild.SetUmbracoVersion("7.6.33+1234")
$ubuild.SetUmbracoVersion("7.6.33-beta.5+5678")
#### Build
Builds Umbraco. Temporary files are generated in `build.tmp` while the actual artifacts (zip files, NuGet packages...) are produced in `build.out`. Example:
$ubuild.Build()
Some log files, such as MsBuild logs, are produced in `build.tmp` too. The `build` directory should remain clean during a build.
**Note: web.config**
Building Umbraco requires a clean `web.config` file in the `Umbraco.Web.UI` project. If a `web.config` file already exists, the `pre-build` task (see below) will save it as `web.config.temp-build` and replace it with a clean copy of `web.Template.config`. The original file is replaced once it is safe to do so, by the `pre-packages` task.
#### Build-UmbracoDocs
Builds umbraco documentation. Temporary files are generated in `build.tmp` while the actual artifacts (docs...) are produced in `build.out`. Example:
Build-UmbracoDocs
Some log files, such as MsBuild logs, are produced in `build.tmp` too. The `build` directory should remain clean during a build.
#### Verify-NuGet
Verifies that projects all require the same version of their dependencies, and that NuSpec files require versions that are consistent with projects. Example:
Verify-NuGet
This will add a local nuget feed with the name "MyLocalFeed" and you'll now be able to use your custom built NuGet packages.
### Cleaning up
Once the solution has been used to run a site, one may want to "reset" the solution in order to run a fresh new site again.
At the very minimum, you want
The easiest way to do this by deleting the following files and folders:
* src/Umbraco.Web.UI/appsettings.json
* src/Umbraco.Web.UI/umbraco/Data
git clean -Xdf src/Umbraco.Web.UI/App_Data
rm src/Umbraco.Web.UI/web.config
You only have to remove the connection strings from the appsettings, but removing the data folder ensures that the sqlite database gets deleted too.
Then, a simple 'Rebuild All' in Visual Studio will recreate a fresh `web.config` but should be quite fast (since it does not really need to rebuild anything).
The `clean` Git command force (`-f`) removes (`-X`, note the capital X) all files and directories (`-d`) that are ignored by Git.
Next time you run a build the `appsettings.json` file will be re-created in its default state.
This will leave media files and views around, but in most cases, it will be enough.
@@ -219,65 +141,12 @@ For git documentation see:
## Azure DevOps
Umbraco uses Azure DevOps for continuous integration, nightly builds and release builds. The Umbraco CMS project on DevOps [is available for anonymous users](https://umbraco.visualstudio.com/Umbraco%20Cms).
Umbraco uses Azure DevOps for continuous integration, nightly builds and release builds. The Umbraco CMS project on DevOps [is available for anonymous users](https://umbraco.visualstudio.com/Umbraco%20Cms)..
DevOps uses the `Build-Umbraco` command several times, each time passing a different *target* parameter. The supported targets are:
* `pre-build`: prepares the build
* `compile-belle`: compiles Belle
* `compile-umbraco`: compiles Umbraco
* `pre-tests`: prepares the tests
* `compile-tests`: compiles the tests
* `pre-packages`: prepares the packages
* `pkg-zip`: creates the zip files
* `pre-nuget`: prepares NuGet packages
* `pkg-nuget`: creates NuGet packages
All these targets are executed when `Build-Umbraco` is invoked without a parameter (or with the `all` parameter). On VSTS, compilations (of Umbraco and tests) are performed by dedicated DevOps tasks. Similarly, creating the NuGet packages is also performed by dedicated DevOps tasks.
Finally, the produced artifacts are published in two containers that can be downloaded from DevOps: `zips` contains the zip files while `nuget` contains the NuGet packages.
>During a DevOps build, some environment `UMBRACO_*` variables are exported by the `pre-build` target and can be reused in other targets *and* in DevOps tasks. The `UMBRACO_TMP` environment variable is used in `Umbraco.Tests` to disable some tests that have issues with DevOps at the moment.
The produced artifacts are published in a container that can be downloaded from DevOps called "nupkg" which contains all the NuGet packages that got built.
## Quirks
### PowerShell Quirks
There is a good chance that running `build.ps1` ends up in error, with messages such as
>The file ...\build.ps1 is not digitally signed. You cannot run this script on the current system. For more information about running scripts and setting execution policy, see about_Execution_Policies.
PowerShell has *Execution Policies* that may prevent the script from running. You can check the current policies with:
PS> Get-ExecutionPolicy -List
Scope ExecutionPolicy
----- ---------------
MachinePolicy Undefined
UserPolicy Undefined
Process Undefined
CurrentUser Undefined
LocalMachine RemoteSigned
Policies can be `Restricted`, `AllSigned`, `RemoteSigned`, `Unrestricted` and `Bypass`. Scopes can be `MachinePolicy`, `UserPolicy`, `Process`, `CurrentUser`, `LocalMachine`. You need the current policy to be `RemoteSigned`&mdash;as long as it is `Undefined`, the script cannot run. You can change the current user policy with:
PS> Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned
Alternatively, you can do it at machine level, from within an elevated PowerShell session:
PS> Set-ExecutionPolicy -Scope LocalMachine -ExecutionPolicy RemoteSigned
And *then* the script should run. It *might* however still complain about executing scripts, with messages such as:
>Security warning - Run only scripts that you trust. While scripts from the internet can be useful, this script can potentially harm your computer. If you trust this script, use the Unblock-File cmdlet to allow the script to run without this warning message. Do you want to run ...\build.ps1?
[D] Do not run [R] Run once [S] Suspend [?] Help (default is "D"):
This is usually caused by the scripts being *blocked*. And that usually happens when the source code has been downloaded as a Zip file. When Windows downloads Zip files, they are marked as *blocked* (technically, they have a Zone.Identifier alternate data stream, with a value of "3" to indicate that they were downloaded from the Internet). And when such a Zip file is un-zipped, each and every single file is also marked as blocked.
The best solution is to unblock the Zip file before un-zipping: right-click the files, open *Properties*, and there should be a *Unblock* checkbox at the bottom of the dialog. If, however, the Zip file has already been un-zipped, it is possible to recursively unblock all files from PowerShell with:
PS> Get-ChildItem -Recurse *.* | Unblock-File
### Git Quirks
Git might have issues dealing with long file paths during build. You may want/need to enable `core.longpaths` support (see [this page](https://github.com/msysgit/msysgit/wiki/Git-cannot-create-a-file-or-directory-with-a-long-path) for details).
+19 -15
View File
@@ -103,7 +103,7 @@ Great question! The short version goes like this:
1. **Switch to the correct branch**
Switch to the `v10/contrib` branch
Switch to the `contrib` branch
1. **Build**
@@ -111,7 +111,7 @@ Great question! The short version goes like this:
1. **Branch**
Create a new branch now and name it after the issue you're fixing, we usually follow the format: `temp-12345`. This means it's a temporary branch for the particular issue you're working on, in this case issue number `12345`. Don't commit to `v10/contrib`, create a new branch first.
Create a new branch now and name it after the issue you're fixing, we usually follow the format: `temp-12345`. This means it's a temporary branch for the particular issue you're working on, in this case issue number `12345`. Don't commit to `contrib`, create a new branch first.
1. **Change**
@@ -121,7 +121,7 @@ Great question! The short version goes like this:
Done? Yay! 🎉
Remember to commit to your new `temp` branch, and don't commit to `v10/contrib`. Then you can push the changes up to your fork on GitHub.
Remember to commit to your new `temp` branch, and don't commit to `contrib`. Then you can push the changes up to your fork on GitHub.
#### Keeping your Umbraco fork in sync with the main repository
[sync fork]: #keeping-your-umbraco-fork-in-sync-with-the-main-repository
@@ -138,10 +138,10 @@ Then when you want to get the changes from the main repository:
```
git fetch upstream
git rebase upstream/v10/contrib
git rebase upstream/contrib
```
In this command we're syncing with the `v10/contrib` branch, but you can of course choose another one if needed.
In this command we're syncing with the `contrib` branch, but you can of course choose another one if needed.
[More information on how this works can be found on the thoughtbot blog.][sync fork ext]
@@ -169,7 +169,7 @@ We recommend you to [sync with our repository][sync fork] before you submit your
GitHub will have picked up on the new branch you've pushed and will offer to create a Pull Request. Click that green button and away you go.
![Create a pull request](img/createpullrequest.png)
We like to use [git flow][git flow] as much as possible, but don't worry if you are not familiar with it. The most important thing you need to know is that when you fork the Umbraco repository, the default branch is set to something, usually `v10/contrib`. If you are working on v9, this is the branch you should be targeting.
We like to use [git flow][git flow] as much as possible, but don't worry if you are not familiar with it. The most important thing you need to know is that when you fork the Umbraco repository, the default branch is set to `contrib`. This is the branch you should be targeting.
Please note: we are no longer accepting features for v8 and below but will continue to merge security fixes as and when they arise.
@@ -208,11 +208,13 @@ There will be times that we really like your proposed changes and well finish
The Core Contributors team consists of one member of Umbraco HQ, [Sebastiaan][Sebastiaan], who gets assistance from the following community members who have committed to volunteering their free time:
- [Nathan Woulfe][Nathan Woulfe]
- [Joe Glombek][Joe Glombek]
- [Laura Weatherhead][Laura Weatherhead]
- [Busra Sengul][Busra Sengul]
- [Emma Garland][Emma Garland]
- [George Bidder][George Bidder]
- [Jason Elkin][Jason Elkin]
- [Laura Neto][Laura Neto]
- [Michael Latouche][Michael Latouche]
- [Owain Williams][Owain Williams]
- [Sebastiaan][Sebastiaan]
These wonderful people aim to provide you with a reply to your PR, review and test out your changes and on occasions, they might ask more questions. If they are happy with your work, they'll let Umbraco HQ know by approving the PR. HQ will have final sign-off and will check the work again before it is merged.
@@ -227,12 +229,14 @@ These wonderful people aim to provide you with a reply to your PR, review and te
<!-- External -->
[Nathan Woulfe]: https://github.com/nathanwoulfe "Nathan's GitHub profile"
[Joe Glombek]: https://github.com/glombek "Joe's GitHub profile"
[Laura Weatherhead]: https://github.com/lssweatherhead "Laura's GitHub profile"
[Busra Sengul]: https://github.com/busrasengul "Busra's GitHub profile"
[Emma Garland]: https://github.com/emmagarland "Emma's GitHub profile"
[George Bidder]: https://github.com/georgebid "George's GitHub profile"
[Jason Elkin]: https://github.com/jasonelkin "Jason's GitHub profile"
[Kyle Eck]: https://github.com/teckspeed "Kyle's GitHub profile"
[Laura Neto]: https://github.com/lauraneto "Laura's GitHub profile"
[Michael Latouche]: https://github.com/mikecp "Michael's GitHub profile"
[Owain Williams]: https://github.com/OwainWilliams "Owain's GitHub profile"
[Sebastiaan]: https://github.com/nul800sebastiaan "Senastiaan's GitHub profile"
[Sebastiaan]: https://github.com/nul800sebastiaan "Sebastiaan's GitHub profile"
[ Umbrabot ]: https://github.com/umbrabot
[git flow]: https://jeffkreeftmeijer.com/git-flow/ "An explanation of git flow"
[sync fork ext]: http://robots.thoughtbot.com/post/5133345960/keeping-a-git-fork-updated "Details on keeping a git fork updated"
+3 -2
View File
@@ -1,4 +1,4 @@
# [Umbraco CMS](https://umbraco.com) &middot; [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](../LICENSE.md) [![Build status](https://umbraco.visualstudio.com/Umbraco%20Cms/_apis/build/status/Cms%208%20Continuous?branchName=v8/contrib)](https://umbraco.visualstudio.com/Umbraco%20Cms/_build?definitionId=75) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md) [![Twitter](https://img.shields.io/twitter/follow/umbraco.svg?style=social&label=Follow)](https://twitter.com/intent/follow?screen_name=umbraco) [![Discord](https://img.shields.io/discord/869656431308189746)](https://discord.gg/umbraco)
# [Umbraco CMS](https://umbraco.com) &middot; [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](../LICENSE.md) [![Build status](https://umbraco.visualstudio.com/Umbraco%20Cms/_apis/build/status/Cms%208%20Continuous?branchName=v8/contrib)](https://umbraco.visualstudio.com/Umbraco%20Cms/_build?definitionId=75) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md) [![Twitter](https://img.shields.io/twitter/follow/umbraco.svg?style=social&label=Follow)](https://twitter.com/intent/follow?screen_name=umbraco) [![Discord](https://img.shields.io/discord/869656431308189746)](https://discord.gg/umbraco) [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/codespaces/new?hide_repo_select=true&ref=v11%2Fcontrib&repo=10601208&machine=basicLinux32gb&devcontainer_path=.devcontainer%2Fdevcontainer.json&location=WestEurope)
Umbraco is the friendliest, most flexible and fastest growing ASP.NET CMS, and used by more than 500,000 websites worldwide. Our mission is to help you deliver delightful digital experiences by making Umbraco friendly, simpler and social.
@@ -31,7 +31,8 @@ The documentation for Umbraco CMS can be found [on Our Umbraco](https://docs.umb
Our friendly community is available 24/7 at the community hub, we call ["Our Umbraco"](https://our.umbraco.com/). Our Umbraco features forums for questions and answers, documentation, downloadable plugins for Umbraco, and a rich collection of community resources.
Besides "Our", we all support each other also via Twitter: [Umbraco HQ](https://twitter.com/umbraco), [Release Updates](https://twitter.com/umbracoproject), [#umbraco](https://twitter.com/hashtag/umbraco)
Besides "Our", we all support each other in our [Community Discord Server](https://discord.gg/umbraco) and on Twitter: [Umbraco HQ](https://twitter.com/umbraco), [Release Updates](https://twitter.com/umbracoproject), [#umbraco](https://twitter.com/hashtag/umbraco)
## Contributing
+21
View File
@@ -0,0 +1,21 @@
# GitHub CodeSpaces
Umbraco source code can be edited inside the browser with VSCode and CodeSpaces.
This development environment comes with all the tools you need to build Umbraco source code.
## Debugging and Running
From VSCode browse to the Run and Debug section and then click the green button. This will build the Umbraco source code and attach a debugger and launch the site.
## Default Umbraco credentials
Username: test@umbraco.com
Password: password1234
## Test Email Server
A SMTP4Dev instance for testing email is available on port 5000.
## SQLite Database
The SQLite extension is preinstalled and allows you to open, query, edit the data inside the Umbraco SQLite database for ease of use.
+2 -2
View File
@@ -15,8 +15,8 @@ permissions:
contents: read
env:
dotnetVersion: 6.x
dotnetIncludePreviewVersions: false
dotnetVersion: 7.x
dotnetIncludePreviewVersions: true
solution: umbraco.sln
buildConfiguration: SkipTests
DOTNET_NOLOGO: true
@@ -18,8 +18,6 @@ jobs:
uses: actions/github-script@v6
with:
script: |
const fetch = require('node-fetch')
const response = await fetch('https://collaboratorsv2.euwest01.umbraco.io/umbraco/api/comments/PostComment', {
method: 'post',
body: JSON.stringify({
+5 -2
View File
@@ -11,6 +11,9 @@ jobs:
issues: write
pull-requests: write
steps:
- name: Install dependencies
run: |
npm install node-fetch@2
- name: Fetch random comment 🗣️ and add it to the PR
uses: actions/github-script@v6
with:
@@ -41,13 +44,13 @@ jobs:
});
} else {
console.log("Returned data not indicate success.");
if(response.status !== 200) {
console.log("Status code:", response.status)
}
console.log("Returned data:", data);
if(data === '') {
console.log("An empty response usually indicates that either no comment was found or the actor user was not eligible for getting an automated response (HQ users are not getting auto-responses).")
}
@@ -20,7 +20,6 @@ jobs:
uses: actions/github-script@v6
with:
script: |
const fetch = require('node-fetch');
const response = await fetch('https://collaboratorsv2.euwest01.umbraco.io/umbraco/api/comments/PostComment', {
method: 'post',
body: JSON.stringify({
+7 -1
View File
@@ -101,6 +101,12 @@ preserve.belle
/tests/Umbraco.Tests.UnitTests/[Uu]mbraco/[Dd]ata/TEMP/
# Ignore auto-generated schema
/src/Umbraco.Cms/appsettings-schema.json
/src/Umbraco.Cms.Targets/tasks/
/src/Umbraco.Cms.Targets/appsettings-schema.*.json
/src/Umbraco.Web.UI/appsettings-schema.json
/src/Umbraco.Web.UI/appsettings-schema.*.json
/tests/Umbraco.Tests.Integration/appsettings-schema.json
/tests/Umbraco.Tests.Integration/appsettings-schema.*.json
/src/Umbraco.Cms/appsettings-schema.json
playwright-report
trace.zip
-1
View File
@@ -8,7 +8,6 @@
"name": ".NET Core Launch (web)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "Dotnet build",
"program": "dotnet",
"args": ["run"],
"cwd": "${workspaceFolder}/src/Umbraco.Web.UI",
+5 -4
View File
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<LangVersion>latest</LangVersion>
<Company>Umbraco HQ</Company>
<Authors>Umbraco</Authors>
<Copyright>Copyright © Umbraco $([System.DateTime]::Today.ToString('yyyy'))</Copyright>
@@ -28,8 +29,9 @@
<!-- Package Validation -->
<PropertyGroup>
<GenerateCompatibilitySuppressionFile>false</GenerateCompatibilitySuppressionFile>
<EnablePackageValidation>true</EnablePackageValidation>
<PackageValidationBaselineVersion>10.0.0</PackageValidationBaselineVersion>
<PackageValidationBaselineVersion>11.0.0</PackageValidationBaselineVersion>
<EnableStrictModeForCompatibleFrameworksInPackage>true</EnableStrictModeForCompatibleFrameworksInPackage>
<EnableStrictModeForCompatibleTfms>true</EnableStrictModeForCompatibleTfms>
</PropertyGroup>
@@ -39,7 +41,7 @@
<PackageReference Include="Nerdbank.GitVersioning" Version="3.5.113" PrivateAssets="all" IsImplicitlyDefined="true" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.406" PrivateAssets="all" IsImplicitlyDefined="true" />
<PackageReference Include="Umbraco.Code" Version="2.0.0" PrivateAssets="all" IsImplicitlyDefined="true" />
<PackageReference Include="Umbraco.GitVersioning.Extensions" Version="0.1.1" PrivateAssets="all" IsImplicitlyDefined="true" />
<PackageReference Include="Umbraco.GitVersioning.Extensions" Version="0.2.0" PrivateAssets="all" IsImplicitlyDefined="true" />
</ItemGroup>
<ItemGroup>
@@ -49,5 +51,4 @@
<PropertyGroup>
<GitVersionBaseDirectory>$(MSBuildThisFileDirectory)</GitVersionBaseDirectory>
</PropertyGroup>
</Project>
+41 -101
View File
@@ -21,35 +21,11 @@ parameters:
displayName: Upload API docs
type: boolean
default: false
- name: forceReleaseTestFilter
displayName: Force to use the release test filters
type: boolean
default: false
- name: integrationNonReleaseTestFilter
displayName: TestFilter used for non-release type builds
type: string
default: '--filter TestCategory!=LongRunning&TestCategory!=NonCritical'
- name: integrationReleaseTestFilter
displayName: TestFilter used for release type builds
type: string
default: ' '
- name: nonWindowsIntegrationNonReleaseTestFilter
displayName: TestFilter used for non-release type builds on non windows agents
type: string
default: '--filter TestCategory!=LongRunning&TestCategory!=NonCritical'
- name: nonWindowsIntegrationReleaseTestFilter
displayName: TestFilter used for release type builds on non windows agents
type: string
default: ' '
- name: isNightly
displayName: 'Is nightly build (used for MyGet feed)'
type: boolean
default: false
variables:
nodeVersion: 20
dotnetVersion: 6.x
dotnetIncludePreviewVersions: false
nodeVersion: 18.16.0
dotnetVersion: 7.x
dotnetIncludePreviewVersions: true
solution: umbraco.sln
buildConfiguration: Release
UMBRACO__CMS__GLOBAL__ID: 00000000-0000-0000-0000-000000000042
@@ -73,7 +49,6 @@ stages:
steps:
- task: NodeTool@0
displayName: Use Node.js $(nodeVersion)
retryCountOnTaskFailure: 3
inputs:
versionSpec: $(nodeVersion)
- task: Cache@2
@@ -86,9 +61,9 @@ stages:
path: $(npm_config_cache)
- script: npm ci --no-fund --no-audit --prefer-offline
workingDirectory: src/Umbraco.Web.UI.Client
displayName: Run npm ci (Backoffice)
displayName: Run npm ci
- task: gulp@0
displayName: Run gulp build (Backoffice)
displayName: Run gulp build
inputs:
gulpFile: src/Umbraco.Web.UI.Client/gulpfile.js
targets: coreBuild
@@ -97,7 +72,6 @@ stages:
displayName: Use .NET $(dotnetVersion)
inputs:
version: $(dotnetVersion)
performMultiLevelLookup: true
includePreviewVersions: $(dotnetIncludePreviewVersions)
- task: DotNetCoreCLI@2
displayName: Run dotnet restore
@@ -105,12 +79,29 @@ stages:
command: restore
projects: $(solution)
- task: DotNetCoreCLI@2
name: build
displayName: Run dotnet build and generate NuGet packages
displayName: Run dotnet build
inputs:
command: build
projects: $(solution)
arguments: '--configuration $(buildConfiguration) --no-restore --property:ContinuousIntegrationBuild=true --property:GeneratePackageOnBuild=true --property:PackageOutputPath=$(Build.ArtifactStagingDirectory)/nupkg'
arguments: '--configuration $(buildConfiguration) --no-restore -p:ContinuousIntegrationBuild=true'
- script: |
version="$(Build.BuildNumber)"
echo "Version: $version"
major="$(echo $version | cut -d '.' -f 1)"
echo "Major version: $major"
echo "##vso[task.setvariable variable=majorVersion;isOutput=true]$major"
displayName: Set major version
name: determineMajorVersion
- script: dotnet pack $(solution) --configuration $(buildConfiguration) --no-build --property:PackageOutputPath=$(Build.ArtifactStagingDirectory)/nupkg
displayName: Run dotnet pack
- script: |
sha="$(Build.SourceVersion)"
sha=${sha:0:7}
buildnumber="$(Build.BuildNumber)_$(Build.BuildId)_$sha"
echo "##vso[build.updatebuildnumber]$buildnumber"
displayName: Update build number
- task: PublishPipelineArtifact@1
displayName: Publish nupkg
inputs:
@@ -123,11 +114,11 @@ stages:
artifactName: build_output
- stage: Build_Docs
condition: and(succeeded(), or(eq(dependencies.Build.outputs['A.build.NBGV_PublicRelease'], 'True'), ${{parameters.buildApiDocs}}))
condition: and(succeeded(), or(startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'), ${{parameters.buildApiDocs}}))
displayName: Prepare API Documentation
dependsOn: Build
variables:
umbracoMajorVersion: $[ stageDependencies.Build.A.outputs['build.NBGV_VersionMajor'] ]
umbracoMajorVersion: $[ stageDependencies.Build.A.outputs['determineMajorVersion.majorVersion'] ]
jobs:
# C# API Reference
- job:
@@ -181,10 +172,9 @@ stages:
vmImage: 'ubuntu-latest'
steps:
- task: NodeTool@0
displayName: Use Node.js 10.15.x
retryCountOnTaskFailure: 3
displayName: Use Node.js 10.15.0
inputs:
versionSpec: 10.15.x # Won't work with higher versions
versionSpec: 10.15.0 # Won't work with higher versions
- script: |
npm ci --no-fund --no-audit --prefer-offline
npx gulp docs
@@ -240,7 +230,6 @@ stages:
displayName: Use .NET $(dotnetVersion)
inputs:
version: $(dotnetVersion)
performMultiLevelLookup: true
includePreviewVersions: $(dotnetIncludePreviewVersions)
- task: DotNetCoreCLI@2
displayName: Run dotnet test
@@ -253,8 +242,6 @@ stages:
- stage: Integration
displayName: Integration Tests
dependsOn: Build
variables:
releaseTestFilter: eq(dependencies.Build.outputs['A.build.NBGV_PublicRelease'], 'True')
jobs:
# Integration Tests (SQLite)
- job:
@@ -279,33 +266,14 @@ stages:
displayName: Use .NET $(dotnetVersion)
inputs:
version: $(dotnetVersion)
performMultiLevelLookup: true
includePreviewVersions: $(dotnetIncludePreviewVersions)
- task: DotNetCoreCLI@2
displayName: Run dotnet test Windows
condition: eq(variables['Agent.OS'],'Windows_NT')
displayName: Run dotnet test
inputs:
command: test
projects: '**/*.Tests.Integration.csproj'
arguments: '--configuration $(buildConfiguration) --no-build'
testRunTitle: Integration Tests SQLite - $(Agent.OS)
${{ if or(variables.releaseTestFilter, parameters.forceReleaseTestFilter) }}:
arguments: '--configuration $(buildConfiguration) --no-build ${{parameters.integrationReleaseTestFilter}}'
${{ else }}:
arguments: '--configuration $(buildConfiguration) ${{parameters.integrationNonReleaseTestFilter}}'
env:
Tests__Database__DatabaseType: 'Sqlite'
Umbraco__CMS__Global__MainDomLock: 'FileSystemMainDomLock'
- task: DotNetCoreCLI@2
displayName: Run dotnet test Non Windows
condition: ne(variables['Agent.OS'],'Windows_NT')
inputs:
command: test
projects: '**/*.Tests.Integration.csproj'
testRunTitle: Integration Tests SQLite - $(Agent.OS)
${{ if or(variables.releaseTestFilter, parameters.forceReleaseTestFilter) }}:
arguments: '--configuration $(buildConfiguration) --no-build ${{parameters.nonWindowsIntegrationReleaseTestFilter}}'
${{ else }}:
arguments: '--configuration $(buildConfiguration) ${{parameters.nonWindowsIntegrationNonReleaseTestFilter}}'
env:
Tests__Database__DatabaseType: 'Sqlite'
Umbraco__CMS__Global__MainDomLock: 'FileSystemMainDomLock'
@@ -313,7 +281,7 @@ stages:
# Integration Tests (SQL Server)
- job:
timeoutInMinutes: 120
condition: or(eq(stageDependencies.Build.A.outputs['build.NBGV_PublicRelease'], 'True'), ${{parameters.sqlServerIntegrationTests}})
condition: or(startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'), ${{parameters.sqlServerIntegrationTests}})
displayName: Integration Tests (SQL Server)
strategy:
matrix:
@@ -347,31 +315,12 @@ stages:
displayName: Start SQL Server (Linux only)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
- task: DotNetCoreCLI@2
displayName: Run dotnet test Windows
condition: eq(variables['Agent.OS'],'Windows_NT')
displayName: Run dotnet test
inputs:
command: test
projects: '**/*.Tests.Integration.csproj'
arguments: '--configuration $(buildConfiguration) --no-build'
testRunTitle: Integration Tests SQL Server - $(Agent.OS)
${{ if or(variables.releaseTestFilter, parameters.forceReleaseTestFilter) }}:
arguments: '--configuration $(buildConfiguration) --no-build ${{parameters.integrationReleaseTestFilter}}'
${{ else }}:
arguments: '--configuration $(buildConfiguration) --no-build ${{parameters.integrationNonReleaseTestFilter}}'
env:
Tests__Database__DatabaseType: $(testDb)
Tests__Database__SQLServerMasterConnectionString: $(connectionString)
Umbraco__CMS__Global__MainDomLock: 'SqlMainDomLock'
- task: DotNetCoreCLI@2
displayName: Run dotnet test NonWindows
condition: ne(variables['Agent.OS'],'Windows_NT')
inputs:
command: test
projects: '**/*.Tests.Integration.csproj'
testRunTitle: Integration Tests SQL Server - $(Agent.OS)
${{ if or(variables.releaseTestFilter, parameters.forceReleaseTestFilter) }}:
arguments: '--configuration $(buildConfiguration) --no-build ${{parameters.nonWindowsIntegrationReleaseTestFilter}}'
${{ else }}:
arguments: '--configuration $(buildConfiguration) --no-build ${{parameters.nonWindowsIntegrationNonReleaseTestFilter}}'
env:
Tests__Database__DatabaseType: $(testDb)
Tests__Database__SQLServerMasterConnectionString: $(connectionString)
@@ -407,7 +356,7 @@ stages:
Umbraco__CMS__Unattended__InstallUnattended: true
Umbraco__CMS__Global__InstallMissingDatabase: true
UmbracoDatabaseServer: (LocalDB)\MSSQLLocalDB
UmbracoDatabaseName: AcceptanceTestDB
UmbracoDatabaseName: Playwright
ConnectionStrings__umbracoDbDSN: Server=$(UmbracoDatabaseServer);Database=$(UmbracoDatabaseName);Integrated Security=true;
# Custom Umbraco settings
Umbraco__CMS__Global__VersionCheckPeriod: 0
@@ -424,7 +373,6 @@ stages:
path: $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/misc/nupkg
- task: NodeTool@0
displayName: Use Node.js $(nodeVersion)
retryCountOnTaskFailure: 3
inputs:
versionSpec: $(nodeVersion)
- task: Cache@2
@@ -454,7 +402,6 @@ stages:
displayName: Use .NET $(dotnetVersion)
inputs:
version: $(dotnetVersion)
performMultiLevelLookup: true
includePreviewVersions: $(dotnetIncludePreviewVersions)
- pwsh: |
$sha = 'g$(Build.SourceVersion)'.substring(0, 8)
@@ -469,7 +416,7 @@ stages:
workingDirectory: tests/Umbraco.Tests.AcceptanceTest/misc
- pwsh: |
dotnet new --install ./nupkg/Umbraco.Templates.*.nupkg
dotnet new umbraco --name AcceptanceTestProject --no-restore --output .
dotnet new umbraco --name Playwright --no-restore --output .
dotnet restore --configfile ./nuget.config
dotnet build --configuration $(buildConfiguration) --no-restore
dotnet dev-certs https
@@ -530,11 +477,9 @@ stages:
- Unit
- Integration
# - E2E # TODO: Enable when stable.
condition: and(succeeded(), or(eq(dependencies.Build.outputs['A.build.NBGV_PublicRelease'], 'True'), ${{parameters.myGetDeploy}}))
condition: and(succeeded(), or(startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'), ${{parameters.myGetDeploy}}))
jobs:
- job:
pool:
vmImage: "windows-latest" # NuGetCommand@2 is no longer supported on Ubuntu 24.04 so we'll use windows until an alternative is available.
displayName: Push to pre-release feed
steps:
- checkout: none
@@ -549,20 +494,15 @@ stages:
command: 'push'
packagesToPush: $(Build.ArtifactStagingDirectory)/**/*.nupkg
nuGetFeedType: 'external'
${{ if eq(parameters.isNightly, true) }}:
publishFeedCredentials: 'MyGet - Umbraco Nightly'
${{ else }}:
publishFeedCredentials: 'MyGet - Pre-releases'
publishFeedCredentials: 'MyGet - Pre-releases'
- stage: Deploy_NuGet
displayName: NuGet release
dependsOn:
- Deploy_MyGet
- Build_Docs
condition: and(succeeded(), or(eq(dependencies.Build.outputs['A.build.NBGV_PublicRelease'], 'True'), ${{parameters.nuGetDeploy}}))
condition: and(succeeded(), or(startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'), ${{parameters.nuGetDeploy}}))
jobs:
- job:
pool:
vmImage: "windows-latest" # NuGetCommand@2 is no longer supported on Ubuntu 24.04 so we'll use windows until an alternative is available.
displayName: Push to NuGet
steps:
- checkout: none
@@ -583,12 +523,12 @@ stages:
pool:
vmImage: 'windows-latest' # Apparently AzureFileCopy is windows only :(
variables:
umbracoMajorVersion: $[ stageDependencies.Build.A.outputs['build.NBGV_VersionMajor'] ]
umbracoMajorVersion: $[ stageDependencies.Build.A.outputs['determineMajorVersion.majorVersion'] ]
displayName: Upload API Documention
dependsOn:
- Build
- Deploy_NuGet
condition: and(succeeded(), or(eq(dependencies.Build.outputs['A.build.NBGV_PublicRelease'], 'True'), ${{parameters.uploadApiDocs}}))
condition: and(succeeded(), or(startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'), ${{parameters.uploadApiDocs}}))
jobs:
- job:
displayName: Upload C# Docs
-35
View File
@@ -1,35 +0,0 @@
name: Nightly_$(TeamProject)_$(Build.DefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r)
pr: none
trigger: none
schedules:
- cron: '0 0 * * *'
displayName: Daily midnight build
branches:
include:
- v10/dev
- v12/dev
- v13/dev
- v14/dev
steps:
- checkout: none
- task: TriggerBuild@4
inputs:
definitionIsInCurrentTeamProject: true
buildDefinition: '301'
queueBuildForUserThatTriggeredBuild: true
ignoreSslCertificateErrors: false
useSameSourceVersion: false
useCustomSourceVersion: false
useSameBranch: true
waitForQueuedBuildsToFinish: false
storeInEnvironmentVariable: false
templateParameters: 'sqlServerIntegrationTests: true, forceReleaseTestFilter: true, myGetDeploy: true, isNightly: true'
authenticationMethod: 'OAuth Token'
enableBuildInQueueCondition: false
dependentOnSuccessfulBuildCondition: false
dependentOnFailedBuildCondition: false
checkbuildsoncurrentbranch: false
failTaskIfConditionsAreNotFulfilled: false
-6
View File
@@ -1,6 +0,0 @@
{
"sdk": {
"version": "6.0.300",
"rollForward": "latestFeature"
}
}
-53
View File
@@ -1,53 +0,0 @@
name: issue-first-response
on:
issues:
types: [opened]
jobs:
send-response:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- name: Install dependencies
run: |
npm install node-fetch@2
- name: Fetch random comment 🗣️ and add it to the issue
uses: actions/github-script@v6
with:
script: |
const fetch = require('node-fetch')
const response = await fetch('https://collaboratorsv2.euwest01.umbraco.io/umbraco/api/comments/PostComment', {
method: 'post',
body: JSON.stringify({
repo: '${{ github.repository }}',
number: '${{ github.event.number }}',
actor: '${{ github.actor }}',
commentType: 'opened-issue-first-comment'
}),
headers: {
'Authorization': 'Bearer ${{ secrets.OUR_BOT_API_TOKEN }}',
'Content-Type': 'application/json'
}
});
try {
const data = await response.text();
if(response.status === 200 && data !== '') {
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: data
});
} else {
console.log("Status code did not indicate success:", response.status);
console.log("Returned data:", data);
}
} catch(error) {
console.log(error);
}
-67
View File
@@ -1,67 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<NoWarn>NU1507</NoWarn>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="Dazinator.Extensions.FileProviders" Version="2.0.0" />
<PackageVersion Include="Examine" Version="3.0.1" />
<PackageVersion Include="Examine.Core" Version="3.0.1" />
<PackageVersion Include="HtmlAgilityPack" Version="1.11.54" />
<PackageVersion Include="IPNetwork2" Version="2.6.618" />
<PackageVersion Include="K4os.Compression.LZ4" Version="1.3.6" />
<PackageVersion Include="MailKit" Version="3.2.0" />
<PackageVersion Include="Markdown" Version="2.2.1" />
<PackageVersion Include="MessagePack" Version="2.5.187" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.24" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="6.0.24" />
<PackageVersion Include="Microsoft.Data.Sqlite" Version="6.0.24" />
<PackageVersion Include="Microsoft.CSharp" Version="4.7.0" />
<PackageVersion Include="Microsoft.Extensions.FileProviders.Embedded" Version="6.0.24" />
<PackageVersion Include="Microsoft.Extensions.FileProviders.Physical" Version="6.0.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="6.0.0" />
<PackageVersion Include="Microsoft.Extensions.Identity.Core" Version="6.0.24" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="6.0.0" />
<PackageVersion Include="Microsoft.Extensions.Options" Version="6.0.0" />
<PackageVersion Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="6.0.0" />
<PackageVersion Include="Microsoft.Extensions.Options.DataAnnotations" Version="6.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="6.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="6.0.1" />
<PackageVersion Include="Microsoft.Extensions.Http" Version="6.0.0" />
<PackageVersion Include="Microsoft.Extensions.Identity.Stores" Version="6.0.24" />
<PackageVersion Include="MiniProfiler.AspNetCore.Mvc" Version="4.2.22" />
<PackageVersion Include="MiniProfiler.Shared" Version="4.2.22" />
<PackageVersion Include="ncrontab" Version="3.3.3" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
<PackageVersion Include="NPoco.SqlServer" Version="5.3.2" />
<PackageVersion Include="Serilog" Version="2.12.0" />
<PackageVersion Include="Serilog.AspNetCore" Version="5.0.0" />
<PackageVersion Include="Serilog.Enrichers.Process" Version="2.0.2" />
<PackageVersion Include="Serilog.Enrichers.Thread" Version="3.1.0" />
<PackageVersion Include="Serilog.Expressions" Version="3.4.1" />
<PackageVersion Include="Serilog.Extensions.Hosting" Version="4.2.0" />
<PackageVersion Include="Serilog.Formatting.Compact" Version="1.1.0" />
<PackageVersion Include="Serilog.Formatting.Compact.Reader" Version="1.0.5" />
<PackageVersion Include="Serilog.Settings.Configuration" Version="3.4.0" />
<PackageVersion Include="Serilog.Sinks.Async" Version="1.5.0" />
<PackageVersion Include="Serilog.Sinks.File" Version="5.0.0" />
<PackageVersion Include="Serilog.Sinks.Map" Version="1.0.2" />
<PackageVersion Include="SixLabors.ImageSharp" Version="2.1.10" />
<PackageVersion Include="SixLabors.ImageSharp.Web" Version="2.0.2" />
<PackageVersion Include="Smidge.InMemory" Version="4.3.0" />
<PackageVersion Include="Smidge.Nuglify" Version="4.2.1" />
<PackageVersion Include="System.IO.FileSystem.AccessControl" Version="5.0.0" />
<PackageVersion Include="System.Security.Cryptography.Pkcs" Version="6.0.4" />
<PackageVersion Include="System.Threading.Tasks.Dataflow" Version="6.0.0" />
<PackageVersion Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageVersion Include="System.Reflection.Emit.Lightweight" Version="4.7.0" />
<PackageVersion Include="System.Runtime.Caching" Version="6.0.0" />
<PackageVersion Include="Umbraco.CSharpTest.Net.Collections" Version="14.906.1403.1085" />
<!-- Add dependencies that we force an update to, even that we do not use them explicitly and they seems to be taken from the framework instead of from Nuget -->
<PackageVersion Include="System.Net.Http" Version="4.3.4" />
<PackageVersion Include="System.Security.Cryptography.Xml" Version="6.0.1" />
<PackageVersion Include="System.Text.RegularExpressions" Version="4.3.1" />
</ItemGroup>
</Project>
-152
View File
@@ -1,152 +0,0 @@
// Copyright (c) Umbraco.
// See LICENSE for more details.
using Umbraco.Cms.Core.Configuration;
using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Deploy.Core.Configuration.DebugConfiguration;
using Umbraco.Deploy.Core.Configuration.DeployConfiguration;
using Umbraco.Deploy.Core.Configuration.DeployProjectConfiguration;
using Umbraco.Forms.Core.Configuration;
using SecuritySettings = Umbraco.Cms.Core.Configuration.Models.SecuritySettings;
namespace JsonSchema
{
internal class AppSettings
{
/// <summary>
/// Gets or sets the Umbraco
/// </summary>
public UmbracoDefinition? Umbraco { get; set; }
/// <summary>
/// Configuration of Umbraco CMS and packages
/// </summary>
internal class UmbracoDefinition
{
// ReSharper disable once InconsistentNaming
public CmsDefinition? CMS { get; set; }
public FormsDefinition? Forms { get; set; }
public DeployDefinition? Deploy { get; set; }
/// <summary>
/// Configurations for the Umbraco CMS
/// </summary>
public class CmsDefinition
{
public ContentSettings? Content { get; set; }
public CoreDebugSettings? Debug { get; set; }
public ExceptionFilterSettings? ExceptionFilter { get; set; }
public ModelsBuilderSettings? ModelsBuilder { get; set; }
public GlobalSettings? Global { get; set; }
public HealthChecksSettings? HealthChecks { get; set; }
public HostingSettings? Hosting { get; set; }
public ImagingSettings? Imaging { get; set; }
public IndexCreatorSettings? Examine { get; set; }
public IndexingSettings? Indexing { get; set; }
public KeepAliveSettings? KeepAlive { get; set; }
public LoggingSettings? Logging { get; set; }
public NuCacheSettings? NuCache { get; set; }
public RequestHandlerSettings? RequestHandler { get; set; }
public RuntimeSettings? Runtime { get; set; }
public SecuritySettings? Security { get; set; }
public TourSettings? Tours { get; set; }
public TypeFinderSettings? TypeFinder { get; set; }
public WebRoutingSettings? WebRouting { get; set; }
public UmbracoPluginSettings? Plugins { get; set; }
public UnattendedSettings? Unattended { get; set; }
public RichTextEditorSettings? RichTextEditor { get; set; }
public RuntimeMinificationSettings? RuntimeMinification { get; set; }
public BasicAuthSettings? BasicAuth { get; set; }
public PackageMigrationSettings? PackageMigration { get; set; }
public LegacyPasswordMigrationSettings? LegacyPasswordMigration { get; set; }
public ContentDashboardSettings? ContentDashboard { get; set; }
public HelpPageSettings? HelpPage { get; set; }
public InstallDefaultData? InstallDefaultData { get; set; }
public DataTypesSettings? DataTypes { get; set; }
public MarketplaceSettings? Marketplace { get; set; }
}
/// <summary>
/// Configurations for the Umbraco CMS InstallDefaultData configuration.
/// </summary>
public class InstallDefaultData
{
public InstallDefaultDataSettings? Languages { get; set; }
public InstallDefaultDataSettings? DataTypes { get; set; }
public InstallDefaultDataSettings? MediaTypes { get; set; }
public InstallDefaultDataSettings? MemberTypes { get; set; }
}
/// <summary>
/// Configurations for the Umbraco Forms package to Umbraco CMS
/// </summary>
public class FormsDefinition
{
public FormDesignSettings? FormDesign { get; set; }
public PackageOptionSettings? Options { get; set; }
public Umbraco.Forms.Core.Configuration.SecuritySettings? Security { get; set; }
public FieldTypesDefinition? FieldTypes { get; set; }
/// <summary>
/// Configurations for the Umbraco Forms Field Types
/// </summary>
public class FieldTypesDefinition
{
public DatePickerSettings? DatePicker { get; set; }
public Recaptcha2Settings? Recaptcha2 { get; set; }
public Recaptcha3Settings? Recaptcha3 { get; set; }
}
}
/// <summary>
/// Configurations for the Umbraco Deploy package to Umbraco CMS
/// </summary>
public class DeployDefinition
{
public DeploySettings? Settings { get; set; }
public DeployProjectConfig? Project { get; set; }
public DebugSettings? Debug { get; set; }
}
}
}
}
@@ -1,13 +0,0 @@
// Copyright (c) Umbraco.
// See LICENSE for more details.
using System;
using NJsonSchema.Generation;
namespace JsonSchema
{
internal class NamespacePrefixedSchemaNameGenerator : DefaultSchemaNameGenerator
{
public override string Generate(Type type) => type.Namespace?.Replace(".", string.Empty) + base.Generate(type);
}
}
-13
View File
@@ -1,13 +0,0 @@
// Copyright (c) Umbraco.
// See LICENSE for more details.
using CommandLine;
namespace JsonSchema
{
internal class Options
{
[Option('o', "outputFile", Required = false, HelpText = "Set path of the output file.", Default = "appsettings-schema.json")]
public string OutputFile { get; set; } = null!;
}
}
-41
View File
@@ -1,41 +0,0 @@
// Copyright (c) Umbraco.
// See LICENSE for more details.
using System;
using System.IO;
using System.Threading.Tasks;
using CommandLine;
namespace JsonSchema
{
internal class Program
{
public static async Task Main(string[] args)
{
try
{
await Parser.Default.ParseArguments<Options>(args)
.WithParsedAsync(Execute);
}
catch (Exception e)
{
Console.WriteLine(e);
throw;
}
}
private static async Task Execute(Options options)
{
var generator = new UmbracoJsonSchemaGenerator();
var schema = await generator.Generate();
var path = Path.GetFullPath(Path.Combine(Environment.CurrentDirectory, options.OutputFile));
Console.WriteLine("Path to use {0}", path);
Directory.CreateDirectory(Path.GetDirectoryName(path)!);
Console.WriteLine("Ensured directory exists");
await File.WriteAllTextAsync(path, schema);
Console.WriteLine("File written at {0}", path);
}
}
}
@@ -1,58 +0,0 @@
// Copyright (c) Umbraco.
// See LICENSE for more details.
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using NJsonSchema.Generation;
using Umbraco.Cms.Core.Configuration.Models;
namespace JsonSchema
{
/// <summary>
/// Generator of the JsonSchema for AppSettings.json including A specific Umbraco version.
/// </summary>
public class UmbracoJsonSchemaGenerator
{
private static readonly HttpClient s_client = new ();
private readonly JsonSchemaGenerator _innerGenerator;
/// <summary>
/// Initializes a new instance of the <see cref="UmbracoJsonSchemaGenerator" /> class.
/// </summary>
public UmbracoJsonSchemaGenerator()
=> _innerGenerator = new JsonSchemaGenerator(new UmbracoJsonSchemaGeneratorSettings());
/// <summary>
/// Generates a json representing the JsonSchema for AppSettings.json including A specific Umbraco version..
/// </summary>
public async Task<string> Generate()
{
JObject umbracoSchema = GenerateUmbracoSchema();
JObject officialSchema = await GetOfficialAppSettingsSchema();
officialSchema.Merge(umbracoSchema);
return officialSchema.ToString();
}
private async Task<JObject> GetOfficialAppSettingsSchema()
{
HttpResponseMessage response = await s_client.GetAsync("https://json.schemastore.org/appsettings.json")
.ConfigureAwait(false);
var result = await response.Content.ReadAsStringAsync();
return JsonConvert.DeserializeObject<JObject>(result)!;
}
private JObject GenerateUmbracoSchema()
{
NJsonSchema.JsonSchema schema = _innerGenerator.Generate(typeof(AppSettings));
// TODO: when the "UmbracoPath" setter is removed from "GlobalSettings" (scheduled for V12), remove this line as well
schema.Definitions["UmbracoCmsCoreConfigurationModelsGlobalSettings"]?.Properties?.Remove(nameof(GlobalSettings.UmbracoPath));
return JsonConvert.DeserializeObject<JObject>(schema.ToJson())!;
}
}
}
@@ -1,43 +0,0 @@
// Copyright (c) Umbraco.
// See LICENSE for more details.
using System;
using System.Collections.Generic;
using System.Linq;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Serialization;
using NJsonSchema.Generation;
namespace JsonSchema
{
/// <inheritdoc />
public class UmbracoJsonSchemaGeneratorSettings : JsonSchemaGeneratorSettings
{
/// <summary>
/// Initializes a new instance of the <see cref="UmbracoJsonSchemaGeneratorSettings"/> class.
/// </summary>
public UmbracoJsonSchemaGeneratorSettings()
{
AlwaysAllowAdditionalObjectProperties = true;
SerializerSettings = new JsonSerializerSettings()
{
ContractResolver = new WritablePropertiesOnlyResolver()
};
DefaultReferenceTypeNullHandling = ReferenceTypeNullHandling.NotNull;
SchemaNameGenerator = new NamespacePrefixedSchemaNameGenerator();
SerializerSettings.Converters.Add(new StringEnumConverter());
IgnoreObsoleteProperties = true;
GenerateExamples = true;
}
private class WritablePropertiesOnlyResolver : DefaultContractResolver
{
protected override IList<JsonProperty> CreateProperties(Type type, MemberSerialization memberSerialization)
{
IList<JsonProperty> props = base.CreateProperties(type, memberSerialization);
return props.Where(p => p.Writable).ToList();
}
}
}
}
@@ -0,0 +1,9 @@
namespace Umbraco.Cms.Api.Common.Attributes;
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
public class MapToApiAttribute : Attribute
{
public MapToApiAttribute(string apiName) => ApiName = apiName;
public string ApiName { get; }
}
@@ -1,13 +1,12 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
namespace Umbraco.Cms.ManagementApi.Builders;
namespace Umbraco.Cms.Api.Common.Builders;
public class ProblemDetailsBuilder
{
private string? _title;
private string? _detail;
private int _status = StatusCodes.Status400BadRequest;
private string? _type;
public ProblemDetailsBuilder WithTitle(string title)
@@ -22,12 +21,6 @@ public class ProblemDetailsBuilder
return this;
}
public ProblemDetailsBuilder WithStatus(int status)
{
_status = status;
return this;
}
public ProblemDetailsBuilder WithType(string type)
{
_type = type;
@@ -39,7 +32,6 @@ public class ProblemDetailsBuilder
{
Title = _title,
Detail = _detail,
Status = _status,
Type = _type ?? "Error",
};
}
@@ -0,0 +1,12 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
namespace Umbraco.Cms.Api.Common.Configuration;
public class ConfigureApiBehaviorOptions : IConfigureOptions<ApiBehaviorOptions>
{
public void Configure(ApiBehaviorOptions options) =>
// disable ProblemDetails as default result type for every non-success response (i.e. 404)
// - see https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.apibehavioroptions.suppressmapclienterrors
options.SuppressMapClientErrors = true;
}
@@ -0,0 +1,31 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Umbraco.Cms.Api.Common.Json;
namespace Umbraco.Cms.Api.Common.Configuration;
public class ConfigureMvcJsonOptions : IConfigureOptions<MvcOptions>
{
private readonly string _jsonOptionsName;
private readonly IOptionsMonitor<JsonOptions> _jsonOptions;
private readonly ILoggerFactory _loggerFactory;
public ConfigureMvcJsonOptions(
string jsonOptionsName,
IOptionsMonitor<JsonOptions> jsonOptions,
ILoggerFactory loggerFactory)
{
_jsonOptionsName = jsonOptionsName;
_jsonOptions = jsonOptions;
_loggerFactory = loggerFactory;
}
public void Configure(MvcOptions options)
{
JsonOptions jsonOptions = _jsonOptions.Get(_jsonOptionsName);
ILogger<NamedSystemTextJsonInputFormatter> logger = _loggerFactory.CreateLogger<NamedSystemTextJsonInputFormatter>();
options.InputFormatters.Insert(0, new NamedSystemTextJsonInputFormatter(_jsonOptionsName, jsonOptions, logger));
options.OutputFormatters.Insert(0, new NamedSystemTextJsonOutputFormatter(_jsonOptionsName, jsonOptions.JsonSerializerOptions));
}
}
@@ -0,0 +1,65 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Mvc.ApiExplorer;
using Microsoft.AspNetCore.Mvc.Controllers;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.SwaggerGen;
using Umbraco.Cms.Api.Common.OpenApi;
using Umbraco.Extensions;
namespace Umbraco.Cms.Api.Common.Configuration;
public class ConfigureUmbracoSwaggerGenOptions : IConfigureOptions<SwaggerGenOptions>
{
private readonly IOptions<ApiVersioningOptions> _apiVersioningOptions;
private readonly IOperationIdSelector _operationIdSelector;
private readonly ISchemaIdSelector _schemaIdSelector;
public ConfigureUmbracoSwaggerGenOptions(
IOptions<ApiVersioningOptions> apiVersioningOptions,
IOperationIdSelector operationIdSelector,
ISchemaIdSelector schemaIdSelector)
{
_apiVersioningOptions = apiVersioningOptions;
_operationIdSelector = operationIdSelector;
_schemaIdSelector = schemaIdSelector;
}
public void Configure(SwaggerGenOptions swaggerGenOptions)
{
swaggerGenOptions.SwaggerDoc(
DefaultApiConfiguration.ApiName,
new OpenApiInfo
{
Title = "Default API",
Version = "Latest",
Description = "All endpoints not defined under specific APIs"
});
swaggerGenOptions.CustomOperationIds(description => _operationIdSelector.OperationId(description, _apiVersioningOptions.Value));
swaggerGenOptions.DocInclusionPredicate((name, api) =>
{
if (string.IsNullOrWhiteSpace(api.GroupName))
{
return false;
}
if (api.ActionDescriptor is ControllerActionDescriptor controllerActionDescriptor)
{
return controllerActionDescriptor.MethodInfo.HasMapToApiAttribute(name);
}
return false;
});
swaggerGenOptions.TagActionsBy(api => new[] { api.GroupName });
swaggerGenOptions.OrderActionsBy(ActionOrderBy);
swaggerGenOptions.SchemaFilter<EnumSchemaFilter>();
swaggerGenOptions.CustomSchemaIds(_schemaIdSelector.SchemaId);
swaggerGenOptions.SupportNonNullableReferenceTypes();
}
// see https://github.com/domaindrivendev/Swashbuckle.AspNetCore#change-operation-sort-order-eg-for-ui-sorting
private static string ActionOrderBy(ApiDescription apiDesc)
=> $"{apiDesc.GroupName}_{apiDesc.ActionDescriptor.AttributeRouteInfo?.Template ?? apiDesc.ActionDescriptor.RouteValues["controller"]}_{apiDesc.ActionDescriptor.RouteValues["action"]}_{apiDesc.HttpMethod}";
}
@@ -0,0 +1,6 @@
namespace Umbraco.Cms.Api.Common.Configuration;
internal static class DefaultApiConfiguration
{
public const string ApiName = "default";
}
@@ -0,0 +1,22 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Umbraco.Cms.Api.Common.Configuration;
namespace Umbraco.Cms.Api.Common.DependencyInjection;
public static class MvcBuilderExtensions
{
public static IMvcBuilder AddJsonOptions(this IMvcBuilder builder, string settingsName, Action<JsonOptions> configure)
{
builder.Services.Configure(settingsName, configure);
builder.Services.AddSingleton<IConfigureOptions<MvcOptions>>(provider =>
{
IOptionsMonitor<JsonOptions> options = provider.GetRequiredService<IOptionsMonitor<JsonOptions>>();
ILoggerFactory loggerFactory = provider.GetRequiredService<ILoggerFactory>();
return new ConfigureMvcJsonOptions(settingsName, options, loggerFactory);
});
return builder;
}
}
@@ -0,0 +1,23 @@
using Microsoft.Extensions.DependencyInjection;
using Umbraco.Cms.Api.Common.Configuration;
using Umbraco.Cms.Api.Common.OpenApi;
using Umbraco.Cms.Api.Common.Serialization;
using Umbraco.Cms.Core.DependencyInjection;
using Umbraco.Cms.Web.Common.ApplicationBuilder;
namespace Umbraco.Cms.Api.Common.DependencyInjection;
public static class UmbracoBuilderApiExtensions
{
public static IUmbracoBuilder AddUmbracoApiOpenApiUI(this IUmbracoBuilder builder)
{
builder.Services.AddSwaggerGen();
builder.Services.ConfigureOptions<ConfigureUmbracoSwaggerGenOptions>();
builder.Services.AddSingleton<IUmbracoJsonTypeInfoResolver, UmbracoJsonTypeInfoResolver>();
builder.Services.AddSingleton<IOperationIdSelector, OperationIdSelector>();
builder.Services.AddSingleton<ISchemaIdSelector, SchemaIdSelector>();
builder.Services.Configure<UmbracoPipelineOptions>(options => options.AddFilter(new SwaggerRouteTemplatePipelineFilter("UmbracoApiCommon")));
return builder;
}
}
@@ -0,0 +1,32 @@
using System.Reflection;
using Asp.Versioning;
using Umbraco.Cms.Api.Common.Attributes;
using Umbraco.Cms.Api.Common.Configuration;
namespace Umbraco.Extensions;
public static class MethodInfoApiCommonExtensions
{
public static string? GetMapToApiVersionAttributeValue(this MethodInfo methodInfo)
{
MapToApiVersionAttribute[] mapToApis = methodInfo.GetCustomAttributes(typeof(MapToApiVersionAttribute), inherit: true).Cast<MapToApiVersionAttribute>().ToArray();
return string.Join("|", mapToApis.SelectMany(x=>x.Versions));
}
public static string? GetMapToApiAttributeValue(this MethodInfo methodInfo)
{
MapToApiAttribute[] mapToApis = (methodInfo.DeclaringType?.GetCustomAttributes(typeof(MapToApiAttribute), inherit: true) ?? Array.Empty<object>()).Cast<MapToApiAttribute>().ToArray();
return mapToApis.SingleOrDefault()?.ApiName;
}
public static bool HasMapToApiAttribute(this MethodInfo methodInfo, string apiName)
{
var value = methodInfo.GetMapToApiAttributeValue();
return value == apiName
|| (value is null && apiName == DefaultApiConfiguration.ApiName);
}
}
@@ -0,0 +1,9 @@
namespace Umbraco.Cms.Api.Common.Filters;
[AttributeUsage(AttributeTargets.Class)]
public class JsonOptionsNameAttribute : Attribute
{
public JsonOptionsNameAttribute(string jsonOptionsName) => JsonOptionsName = jsonOptionsName;
public string JsonOptionsName { get; }
}
@@ -0,0 +1,10 @@
using Microsoft.AspNetCore.Http;
using Umbraco.Cms.Api.Common.Filters;
namespace Umbraco.Cms.Api.Common.Json;
public static class HttpContextJsonExtensions
{
public static string? CurrentJsonOptionsName(this HttpContext context)
=> context.GetEndpoint()?.Metadata.GetMetadata<JsonOptionsNameAttribute>()?.JsonOptionsName;
}
@@ -0,0 +1,31 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Formatters;
using Microsoft.Extensions.Logging;
namespace Umbraco.Cms.Api.Common.Json;
internal class NamedSystemTextJsonInputFormatter : SystemTextJsonInputFormatter
{
private readonly string _jsonOptionsName;
public NamedSystemTextJsonInputFormatter(string jsonOptionsName, JsonOptions options, ILogger<NamedSystemTextJsonInputFormatter> logger)
: base(options, logger) =>
_jsonOptionsName = jsonOptionsName;
public override bool CanRead(InputFormatterContext context)
=> context.HttpContext.CurrentJsonOptionsName() == _jsonOptionsName && base.CanRead(context);
public override async Task<InputFormatterResult> ReadAsync(InputFormatterContext context)
{
try
{
return await base.ReadAsync(context);
}
catch (NotSupportedException exception)
{
// This happens when trying to deserialize to an interface, without sending the $type as part of the request
context.ModelState.TryAddModelException(string.Empty, new InputFormatterException(exception.Message, exception));
return await InputFormatterResult.FailureAsync();
}
}
}
@@ -0,0 +1,18 @@
using System.Text.Json;
using Microsoft.AspNetCore.Mvc.Formatters;
namespace Umbraco.Cms.Api.Common.Json;
internal class NamedSystemTextJsonOutputFormatter : SystemTextJsonOutputFormatter
{
private readonly string _jsonOptionsName;
public NamedSystemTextJsonOutputFormatter(string jsonOptionsName, JsonSerializerOptions jsonSerializerOptions) : base(jsonSerializerOptions)
{
_jsonOptionsName = jsonOptionsName;
}
public override bool CanWriteResult(OutputFormatterCanWriteContext context)
=> context.HttpContext.CurrentJsonOptionsName() == _jsonOptionsName && base.CanWriteResult(context);
}
@@ -0,0 +1,23 @@
using System.Reflection;
using System.Runtime.Serialization;
using Microsoft.OpenApi.Any;
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.SwaggerGen;
namespace Umbraco.Cms.Api.Common.OpenApi;
public class EnumSchemaFilter : ISchemaFilter
{
public void Apply(OpenApiSchema model, SchemaFilterContext context)
{
if (context.Type.IsEnum)
{
model.Enum.Clear();
foreach (var name in Enum.GetNames(context.Type))
{
var actualName = context.Type.GetField(name)?.GetCustomAttribute<EnumMemberAttribute>()?.Value ?? name;
model.Enum.Add(new OpenApiString(actualName));
}
}
}
}
@@ -0,0 +1,9 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Mvc.ApiExplorer;
namespace Umbraco.Cms.Api.Common.OpenApi;
public interface IOperationIdSelector
{
string? OperationId(ApiDescription apiDescription, ApiVersioningOptions apiVersioningOptions);
}
@@ -0,0 +1,6 @@
namespace Umbraco.Cms.Api.Common.OpenApi;
public interface ISchemaIdSelector
{
string SchemaId(Type type);
}
@@ -0,0 +1,48 @@
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.SwaggerGen;
using Umbraco.Extensions;
namespace Umbraco.Cms.Api.Common.OpenApi;
/// <summary>
/// This filter explicitly removes all other mime types than application/json from a named OpenAPI document when application/json is accepted.
/// </summary>
public class MimeTypeDocumentFilter : IDocumentFilter
{
private readonly string _documentName;
public MimeTypeDocumentFilter(string documentName) => _documentName = documentName;
public void Apply(OpenApiDocument swaggerDoc, DocumentFilterContext context)
{
if (context.DocumentName != _documentName)
{
return;
}
OpenApiOperation[] operations = swaggerDoc.Paths
.SelectMany(path => path.Value.Operations.Values)
.ToArray();
void RemoveUnwantedMimeTypes(IDictionary<string, OpenApiMediaType> content)
{
if (content.ContainsKey("application/json"))
{
content.RemoveAll(r => r.Key != "application/json");
}
}
OpenApiRequestBody[] requestBodies = operations.Select(operation => operation.RequestBody).WhereNotNull().ToArray();
foreach (OpenApiRequestBody requestBody in requestBodies)
{
RemoveUnwantedMimeTypes(requestBody.Content);
}
OpenApiResponse[] responses = operations.SelectMany(operation => operation.Responses.Values).WhereNotNull().ToArray();
foreach (OpenApiResponse response in responses)
{
RemoveUnwantedMimeTypes(response.Content);
}
}
}
@@ -0,0 +1,21 @@
using System.Text.RegularExpressions;
namespace Umbraco.Cms.Api.Common.OpenApi;
/// <summary>
/// This is the regexes used to generate the operation IDs, the benefit of this being partial with GeneratedRegex
/// source generators is that it will be pre-compiled at startup
/// See: https://devblogs.microsoft.com/dotnet/regular-expression-improvements-in-dotnet-7/#source-generation for more info.
/// </summary>
internal static partial class OperationIdRegexes
{
// Your IDE may be showing errors here, this is because it's a new dotnet 7 feature (it's fixed in the EAP of Rider)
[GeneratedRegex(".*?\\/v[1-9]+/")]
public static partial Regex VersionPrefixRegex();
[GeneratedRegex("\\{(.*?)\\:?\\}")]
public static partial Regex TemplatePlaceholdersRegex();
[GeneratedRegex("[\\/\\-](\\w{1})")]
public static partial Regex ToCamelCaseRegex();
}
@@ -0,0 +1,79 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Mvc.ApiExplorer;
using Microsoft.AspNetCore.Mvc.Controllers;
using Umbraco.Extensions;
namespace Umbraco.Cms.Api.Common.OpenApi;
public class OperationIdSelector : IOperationIdSelector
{
public virtual string? OperationId(ApiDescription apiDescription, ApiVersioningOptions apiVersioningOptions)
{
if (apiDescription.ActionDescriptor is not ControllerActionDescriptor controllerActionDescriptor
|| controllerActionDescriptor.ControllerTypeInfo.Namespace?.StartsWith("Umbraco.Cms.Api") is not true)
{
return null;
}
return UmbracoOperationId(apiDescription, apiVersioningOptions);
}
protected string? UmbracoOperationId(ApiDescription apiDescription, ApiVersioningOptions apiVersioningOptions)
{
if (apiDescription.ActionDescriptor is not ControllerActionDescriptor controllerActionDescriptor)
{
return null;
}
ApiVersion defaultVersion = apiVersioningOptions.DefaultApiVersion;
var httpMethod = apiDescription.HttpMethod?.ToLower().ToFirstUpper() ?? "Get";
// if the route info "Name" is supplied we'll use this explicitly as the operation ID
// - usage example: [HttpGet("my-api/route}", Name = "MyCustomRoute")]
if (string.IsNullOrWhiteSpace(apiDescription.ActionDescriptor.AttributeRouteInfo?.Name) == false)
{
var explicitOperationId = apiDescription.ActionDescriptor.AttributeRouteInfo!.Name;
return explicitOperationId.InvariantStartsWith(httpMethod)
? explicitOperationId
: $"{httpMethod}{explicitOperationId}";
}
var relativePath = apiDescription.RelativePath;
if (string.IsNullOrWhiteSpace(relativePath))
{
throw new Exception(
$"There is no relative path for controller action {apiDescription.ActionDescriptor.RouteValues["controller"]}");
}
// Remove the prefixed base path with version, e.g. /umbraco/management/api/v1/tracked-reference/{id} => tracked-reference/{id}
var unprefixedRelativePath = OperationIdRegexes
.VersionPrefixRegex()
.Replace(relativePath, string.Empty);
// Remove template placeholders, e.g. tracked-reference/{id} => tracked-reference/Id
var formattedOperationId = OperationIdRegexes
.TemplatePlaceholdersRegex()
.Replace(unprefixedRelativePath, m => $"By{m.Groups[1].Value.ToFirstUpper()}");
// Remove dashes (-) and slashes (/) and convert the following letter to uppercase with
// the word "By" in front, e.g. tracked-reference/Id => TrackedReferenceById
formattedOperationId = OperationIdRegexes
.ToCamelCaseRegex()
.Replace(formattedOperationId, m => m.Groups[1].Value.ToUpper());
//Get map to version attribute
string? version = null;
var versionAttributeValue = controllerActionDescriptor.MethodInfo.GetMapToApiVersionAttributeValue();
// We only wanna add a version, if it is not the default one.
if (string.Equals(versionAttributeValue, defaultVersion.ToString()) == false)
{
version = versionAttributeValue;
}
// Return the operation ID with the formatted http method verb in front, e.g. GetTrackedReferenceById
return $"{httpMethod}{formattedOperationId.ToFirstUpper()}{version}";
}
}
@@ -0,0 +1,36 @@
using System.Text.RegularExpressions;
using Umbraco.Extensions;
namespace Umbraco.Cms.Api.Common.OpenApi;
public class SchemaIdSelector : ISchemaIdSelector
{
public virtual string SchemaId(Type type)
=> type.Namespace?.StartsWith("Umbraco.Cms") is true ? UmbracoSchemaId(type) : type.Name;
protected string UmbracoSchemaId(Type type)
{
string SanitizedTypeName(Type t) => t.Name
// first grab the "non generic" part of any generic type name (i.e. "PagedViewModel`1" becomes "PagedViewModel")
.Split('`').First()
// then remove the "ViewModel" postfix from type names
.TrimEnd("ViewModel");
var name = SanitizedTypeName(type);
if (type.IsGenericType)
{
// append the generic type names, ultimately turning i.e. "PagedViewModel<RelationItemViewModel>" into "PagedRelationItem"
name = $"{name}{string.Join(string.Empty, type.GenericTypeArguments.Select(SanitizedTypeName))}";
}
if (name.EndsWith("Model") == false)
{
// because some models names clash with common classes in TypeScript (i.e. Document),
// we need to add a "Model" postfix to all models
name = $"{name}Model";
}
// make absolutely sure we don't pass any invalid named by removing all non-word chars
return Regex.Replace(name, @"[^\w]", string.Empty);
}
}
@@ -0,0 +1,67 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Options;
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.SwaggerGen;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Cms.Web.Common.ApplicationBuilder;
using Umbraco.Extensions;
using IHostingEnvironment = Umbraco.Cms.Core.Hosting.IHostingEnvironment;
namespace Umbraco.Cms.Api.Common.OpenApi;
public class SwaggerRouteTemplatePipelineFilter : UmbracoPipelineFilter
{
public SwaggerRouteTemplatePipelineFilter(string name)
: base(name)
=> PostPipeline = PostPipelineAction;
private void PostPipelineAction(IApplicationBuilder applicationBuilder)
{
if (SwaggerIsEnabled(applicationBuilder) is false)
{
return;
}
IOptions<SwaggerGenOptions> swaggerGenOptions = applicationBuilder.ApplicationServices.GetRequiredService<IOptions<SwaggerGenOptions>>();
applicationBuilder.UseSwagger(swaggerOptions =>
{
swaggerOptions.RouteTemplate = SwaggerRouteTemplate(applicationBuilder);
});
applicationBuilder.UseSwaggerUI(
swaggerUiOptions =>
{
swaggerUiOptions.RoutePrefix = SwaggerUiRoutePrefix(applicationBuilder);
foreach ((var name, OpenApiInfo? apiInfo) in swaggerGenOptions.Value.SwaggerGeneratorOptions.SwaggerDocs
.OrderBy(x => x.Value.Title))
{
swaggerUiOptions.SwaggerEndpoint($"{name}/swagger.json", $"{apiInfo.Title}");
}
});
}
protected virtual bool SwaggerIsEnabled(IApplicationBuilder applicationBuilder)
{
IWebHostEnvironment webHostEnvironment = applicationBuilder.ApplicationServices.GetRequiredService<IWebHostEnvironment>();
return webHostEnvironment.IsProduction() is false;
}
protected virtual string SwaggerRouteTemplate(IApplicationBuilder applicationBuilder)
=> $"{GetUmbracoPath(applicationBuilder).TrimStart(Constants.CharArrays.ForwardSlash)}/swagger/{{documentName}}/swagger.json";
protected virtual string SwaggerUiRoutePrefix(IApplicationBuilder applicationBuilder)
=> $"{GetUmbracoPath(applicationBuilder).TrimStart(Constants.CharArrays.ForwardSlash)}/swagger";
private string GetUmbracoPath(IApplicationBuilder applicationBuilder)
{
GlobalSettings settings = applicationBuilder.ApplicationServices.GetRequiredService<IOptions<GlobalSettings>>().Value;
IHostingEnvironment hostingEnvironment = applicationBuilder.ApplicationServices.GetRequiredService<IHostingEnvironment>();
return settings.GetBackOfficePath(hostingEnvironment);
}
}
@@ -0,0 +1,8 @@
using System.Text.Json.Serialization.Metadata;
namespace Umbraco.Cms.Api.Common.Serialization;
public interface IUmbracoJsonTypeInfoResolver : IJsonTypeInfoResolver
{
IEnumerable<Type> FindSubTypes(Type type);
}
@@ -0,0 +1,86 @@
using System.Collections.Concurrent;
using System.Text.Json;
using System.Text.Json.Serialization.Metadata;
using Umbraco.Cms.Core.Composing;
namespace Umbraco.Cms.Api.Common.Serialization;
public sealed class UmbracoJsonTypeInfoResolver : DefaultJsonTypeInfoResolver, IUmbracoJsonTypeInfoResolver
{
private readonly ITypeFinder _typeFinder;
private readonly ConcurrentDictionary<Type, ISet<Type>> _subTypesCache = new ConcurrentDictionary<Type, ISet<Type>>();
public UmbracoJsonTypeInfoResolver(ITypeFinder typeFinder)
{
_typeFinder = typeFinder;
}
public IEnumerable<Type> FindSubTypes(Type type)
{
if (_subTypesCache.TryGetValue(type, out ISet<Type>? cachedResult))
{
return cachedResult;
}
var result = _typeFinder.FindClassesOfType(type).ToHashSet();
_subTypesCache.TryAdd(type, result);
return result;
}
public override JsonTypeInfo GetTypeInfo(Type type, JsonSerializerOptions options)
{
JsonTypeInfo result = base.GetTypeInfo(type, options);
if (type.IsInterface)
{
return GetTypeInfoForInterface(result, type, options);
}
else
{
return GetTypeInfoForClass(result, type, options);
}
}
private JsonTypeInfo GetTypeInfoForClass(JsonTypeInfo result, Type type, JsonSerializerOptions options)
{
if (result.Kind != JsonTypeInfoKind.Object || !type.GetInterfaces().Any())
{
return result;
}
JsonPolymorphismOptions jsonPolymorphismOptions = result.PolymorphismOptions ?? new JsonPolymorphismOptions();
jsonPolymorphismOptions.DerivedTypes.Add(new JsonDerivedType(type, type.Name));
result.PolymorphismOptions = jsonPolymorphismOptions;
return result;
}
private JsonTypeInfo GetTypeInfoForInterface(JsonTypeInfo result, Type type, JsonSerializerOptions options)
{
IEnumerable<Type> subTypes = FindSubTypes(type);
if (!subTypes.Any())
{
return result;
}
JsonPolymorphismOptions jsonPolymorphismOptions = result.PolymorphismOptions ?? new JsonPolymorphismOptions();
IEnumerable<Type> knownSubTypes = jsonPolymorphismOptions.DerivedTypes.Select(x => x.DerivedType);
IEnumerable<Type> subTypesToAdd = subTypes.Except(knownSubTypes);
foreach (Type subType in subTypesToAdd)
{
jsonPolymorphismOptions.DerivedTypes.Add(new JsonDerivedType(
subType,
subType.Name ?? string.Empty));
}
result.PolymorphismOptions = jsonPolymorphismOptions;
return result;
}
}
@@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Title>Umbraco CMS - API Common</Title>
<Description>Contains the bits and pieces that are shared between the Umbraco CMS APIs.</Description>
<IsPackable>true</IsPackable>
<EnablePackageValidation>false</EnablePackageValidation>
<AssemblyName>Umbraco.Cms.Api.Common</AssemblyName>
<RootNamespace>Umbraco.Cms.Api.Common</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.2.8" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
<PackageReference Include="OpenIddict.Abstractions" Version="4.5.0" />
<PackageReference Include="OpenIddict.AspNetCore" Version="4.5.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Umbraco.Core\Umbraco.Core.csproj" />
<ProjectReference Include="..\Umbraco.Web.Common\Umbraco.Web.Common.csproj" />
</ItemGroup>
</Project>
@@ -1,9 +1,13 @@
namespace Umbraco.Cms.ManagementApi.ViewModels.Pagination;
using System.ComponentModel.DataAnnotations;
namespace Umbraco.Cms.Api.Common.ViewModels.Pagination;
public class PagedViewModel<T>
{
[Required]
public long Total { get; set; }
[Required]
public IEnumerable<T> Items { get; set; } = Enumerable.Empty<T>();
public static PagedViewModel<T> Empty() => new();
@@ -0,0 +1,12 @@
using Microsoft.AspNetCore.Http;
using Umbraco.Cms.Core.DeliveryApi;
namespace Umbraco.Cms.Api.Delivery.Accessors;
internal sealed class RequestContextOutputExpansionStrategyAccessor : RequestContextServiceAccessorBase<IOutputExpansionStrategy>, IOutputExpansionStrategyAccessor
{
public RequestContextOutputExpansionStrategyAccessor(IHttpContextAccessor httpContextAccessor)
: base(httpContextAccessor)
{
}
}
@@ -0,0 +1,12 @@
using Microsoft.AspNetCore.Http;
using Umbraco.Cms.Core.DeliveryApi;
namespace Umbraco.Cms.Api.Delivery.Accessors;
internal sealed class RequestContextRequestStartItemProviderAccessor : RequestContextServiceAccessorBase<IRequestStartItemProvider>, IRequestStartItemProviderAccessor
{
public RequestContextRequestStartItemProviderAccessor(IHttpContextAccessor httpContextAccessor)
: base(httpContextAccessor)
{
}
}
@@ -0,0 +1,20 @@
using System.Diagnostics.CodeAnalysis;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
namespace Umbraco.Cms.Api.Delivery.Accessors;
public abstract class RequestContextServiceAccessorBase<T>
where T : class
{
private readonly IHttpContextAccessor _httpContextAccessor;
protected RequestContextServiceAccessorBase(IHttpContextAccessor httpContextAccessor)
=> _httpContextAccessor = httpContextAccessor;
public bool TryGetValue([NotNullWhen(true)] out T? requestStartNodeService)
{
requestStartNodeService = _httpContextAccessor.HttpContext?.RequestServices.GetService<T>();
return requestStartNodeService is not null;
}
}
@@ -0,0 +1,28 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.SwaggerGen;
using Umbraco.Cms.Api.Common.OpenApi;
using Umbraco.Cms.Api.Delivery.Filters;
namespace Umbraco.Cms.Api.Delivery.Configuration;
public class ConfigureUmbracoDeliveryApiSwaggerGenOptions: IConfigureOptions<SwaggerGenOptions>
{
public void Configure(SwaggerGenOptions swaggerGenOptions)
{
swaggerGenOptions.SwaggerDoc(
DeliveryApiConfiguration.ApiName,
new OpenApiInfo
{
Title = DeliveryApiConfiguration.ApiTitle,
Version = "Latest",
Description = $"You can find out more about the {DeliveryApiConfiguration.ApiTitle} in [the documentation]({DeliveryApiConfiguration.ApiDocumentationArticleLink})."
});
swaggerGenOptions.DocumentFilter<MimeTypeDocumentFilter>(DeliveryApiConfiguration.ApiName);
swaggerGenOptions.OperationFilter<SwaggerDocumentationFilter>();
swaggerGenOptions.ParameterFilter<SwaggerDocumentationFilter>();
}
}
@@ -0,0 +1,10 @@
namespace Umbraco.Cms.Api.Delivery.Configuration;
internal static class DeliveryApiConfiguration
{
internal const string ApiTitle = "Umbraco Delivery API";
internal const string ApiName = "delivery";
internal const string ApiDocumentationArticleLink = "https://docs.umbraco.com/umbraco-cms/v/12.latest/reference/content-delivery-api";
}
@@ -0,0 +1,54 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Cms.Core.Models.DeliveryApi;
using Umbraco.Cms.Core.Models.PublishedContent;
using Umbraco.Cms.Core.Services;
namespace Umbraco.Cms.Api.Delivery.Controllers;
[ApiVersion("1.0")]
public class ByIdContentApiController : ContentApiItemControllerBase
{
public ByIdContentApiController(
IApiPublishedContentCache apiPublishedContentCache,
IApiContentResponseBuilder apiContentResponseBuilder,
IPublicAccessService publicAccessService)
: base(apiPublishedContentCache, apiContentResponseBuilder, publicAccessService)
{
}
/// <summary>
/// Gets a content item by id.
/// </summary>
/// <param name="id">The unique identifier of the content item.</param>
/// <returns>The content item or not found result.</returns>
[HttpGet("item/{id:guid}")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(IApiContentResponse), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
public async Task<IActionResult> ById(Guid id)
{
IPublishedContent? contentItem = ApiPublishedContentCache.GetById(id);
if (contentItem is null)
{
return NotFound();
}
if (IsProtected(contentItem))
{
return Unauthorized();
}
IApiContentResponse? apiContentResponse = ApiContentResponseBuilder.Build(contentItem);
if (apiContentResponse is null)
{
return NotFound();
}
return await Task.FromResult(Ok(apiContentResponse));
}
}
@@ -0,0 +1,116 @@
using System.Net;
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Cms.Core.Models.DeliveryApi;
using Umbraco.Cms.Core.Models.PublishedContent;
using Umbraco.Cms.Core.Services;
using Umbraco.Extensions;
namespace Umbraco.Cms.Api.Delivery.Controllers;
[ApiVersion("1.0")]
public class ByRouteContentApiController : ContentApiItemControllerBase
{
private readonly IRequestRoutingService _requestRoutingService;
private readonly IRequestRedirectService _requestRedirectService;
private readonly IRequestPreviewService _requestPreviewService;
public ByRouteContentApiController(
IApiPublishedContentCache apiPublishedContentCache,
IApiContentResponseBuilder apiContentResponseBuilder,
IPublicAccessService publicAccessService,
IRequestRoutingService requestRoutingService,
IRequestRedirectService requestRedirectService,
IRequestPreviewService requestPreviewService)
: base(apiPublishedContentCache, apiContentResponseBuilder, publicAccessService)
{
_requestRoutingService = requestRoutingService;
_requestRedirectService = requestRedirectService;
_requestPreviewService = requestPreviewService;
}
/// <summary>
/// Gets a content item by route.
/// </summary>
/// <param name="path">The path to the content item.</param>
/// <remarks>
/// Optional URL segment for the root content item
/// can be added through the "start-item" header.
/// </remarks>
/// <returns>The content item or not found result.</returns>
[HttpGet("item/{*path}")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(IApiContentResponse), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
public async Task<IActionResult> ByRoute(string path = "")
{
// OpenAPI does not allow reserved chars as "in:path" parameters, so clients based on the Swagger JSON will URL
// encode the path. Normally, ASP.NET Core handles that encoding with an automatic decoding - apparently just not
// for forward slashes, for whatever reason... so we need to deal with those. Hopefully this will be addressed in
// an upcoming version of ASP.NET Core.
// See also https://github.com/dotnet/aspnetcore/issues/11544
if (path.Contains("%2F", StringComparison.OrdinalIgnoreCase))
{
path = WebUtility.UrlDecode(path);
}
path = path.TrimStart("/");
path = path.Length == 0 ? "/" : path;
IPublishedContent? contentItem = GetContent(path);
if (contentItem is not null)
{
if (IsProtected(contentItem))
{
return Unauthorized();
}
return await Task.FromResult(Ok(ApiContentResponseBuilder.Build(contentItem)));
}
IApiContentRoute? redirectRoute = _requestRedirectService.GetRedirectRoute(path);
return redirectRoute != null
? RedirectTo(redirectRoute)
: NotFound();
}
private IPublishedContent? GetContent(string path)
=> path.StartsWith(Constants.DeliveryApi.Routing.PreviewContentPathPrefix)
? GetPreviewContent(path)
: GetPublishedContent(path);
private IPublishedContent? GetPublishedContent(string path)
{
var contentRoute = _requestRoutingService.GetContentRoute(path);
IPublishedContent? contentItem = ApiPublishedContentCache.GetByRoute(contentRoute);
return contentItem;
}
private IPublishedContent? GetPreviewContent(string path)
{
if (_requestPreviewService.IsPreview() is false)
{
return null;
}
if (Guid.TryParse(path.AsSpan(Constants.DeliveryApi.Routing.PreviewContentPathPrefix.Length).TrimEnd("/"), out Guid contentId) is false)
{
return null;
}
IPublishedContent? contentItem = ApiPublishedContentCache.GetById(contentId);
return contentItem;
}
private IActionResult RedirectTo(IApiContentRoute redirectRoute)
{
Response.Headers.Add("Location-Start-Item-Path", redirectRoute.StartItem.Path);
Response.Headers.Add("Location-Start-Item-Id", redirectRoute.StartItem.Id.ToString("D"));
return RedirectPermanent(redirectRoute.Path);
}
}
@@ -0,0 +1,43 @@
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Common.Builders;
using Umbraco.Cms.Api.Delivery.Filters;
using Umbraco.Cms.Api.Delivery.Routing;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Cms.Core.Services.OperationStatus;
namespace Umbraco.Cms.Api.Delivery.Controllers;
[VersionedDeliveryApiRoute("content")]
[ApiExplorerSettings(GroupName = "Content")]
[LocalizeFromAcceptLanguageHeader]
[ValidateStartItem]
public abstract class ContentApiControllerBase : DeliveryApiControllerBase
{
protected IApiPublishedContentCache ApiPublishedContentCache { get; }
protected IApiContentResponseBuilder ApiContentResponseBuilder { get; }
protected ContentApiControllerBase(IApiPublishedContentCache apiPublishedContentCache, IApiContentResponseBuilder apiContentResponseBuilder)
{
ApiPublishedContentCache = apiPublishedContentCache;
ApiContentResponseBuilder = apiContentResponseBuilder;
}
protected IActionResult ApiContentQueryOperationStatusResult(ApiContentQueryOperationStatus status) =>
status switch
{
ApiContentQueryOperationStatus.FilterOptionNotFound => BadRequest(new ProblemDetailsBuilder()
.WithTitle("Filter option not found")
.WithDetail("One of the attempted 'filter' options does not exist")
.Build()),
ApiContentQueryOperationStatus.SelectorOptionNotFound => BadRequest(new ProblemDetailsBuilder()
.WithTitle("Selector option not found")
.WithDetail("The attempted 'fetch' option does not exist")
.Build()),
ApiContentQueryOperationStatus.SortOptionNotFound => BadRequest(new ProblemDetailsBuilder()
.WithTitle("Sort option not found")
.WithDetail("One of the attempted 'sort' options does not exist")
.Build()),
};
}
@@ -0,0 +1,22 @@
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Cms.Core.Models.PublishedContent;
using Umbraco.Cms.Core.Services;
namespace Umbraco.Cms.Api.Delivery.Controllers;
public abstract class ContentApiItemControllerBase : ContentApiControllerBase
{
private readonly IPublicAccessService _publicAccessService;
protected ContentApiItemControllerBase(
IApiPublishedContentCache apiPublishedContentCache,
IApiContentResponseBuilder apiContentResponseBuilder,
IPublicAccessService publicAccessService)
: base(apiPublishedContentCache, apiContentResponseBuilder)
=> _publicAccessService = publicAccessService;
// NOTE: we're going to test for protected content at item endpoint level, because the check has already been
// performed at content index time for the query endpoint and we don't want that extra overhead when
// returning multiple items.
protected bool IsProtected(IPublishedContent content) => _publicAccessService.IsProtected(content.Path);
}
@@ -0,0 +1,17 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Common.Attributes;
using Umbraco.Cms.Api.Common.Filters;
using Umbraco.Cms.Api.Delivery.Configuration;
using Umbraco.Cms.Api.Delivery.Filters;
using Umbraco.Cms.Core;
namespace Umbraco.Cms.Api.Delivery.Controllers;
[ApiController]
[DeliveryApiAccess]
[JsonOptionsName(Constants.JsonOptionsNames.DeliveryApi)]
[MapToApi(DeliveryApiConfiguration.ApiName)]
public abstract class DeliveryApiControllerBase : Controller
{
}
@@ -0,0 +1,67 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Common.ViewModels.Pagination;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Models.DeliveryApi;
using Umbraco.Cms.Core.Models.PublishedContent;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Extensions;
namespace Umbraco.Cms.Api.Delivery.Controllers;
[ApiVersion("1.0")]
public class QueryContentApiController : ContentApiControllerBase
{
private readonly IApiContentQueryService _apiContentQueryService;
public QueryContentApiController(
IApiPublishedContentCache apiPublishedContentCache,
IApiContentResponseBuilder apiContentResponseBuilderBuilder,
IApiContentQueryService apiContentQueryService)
: base(apiPublishedContentCache, apiContentResponseBuilderBuilder)
=> _apiContentQueryService = apiContentQueryService;
/// <summary>
/// Gets a paginated list of content item(s) from query.
/// </summary>
/// <param name="fetch">Optional fetch query parameter value.</param>
/// <param name="filter">Optional filter query parameters values.</param>
/// <param name="sort">Optional sort query parameters values.</param>
/// <param name="skip">The amount of items to skip.</param>
/// <param name="take">The amount of items to take.</param>
/// <returns>The paged result of the content item(s).</returns>
[HttpGet]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(PagedViewModel<IApiContentResponse>), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
public async Task<IActionResult> Query(
string? fetch,
[FromQuery] string[] filter,
[FromQuery] string[] sort,
int skip = 0,
int take = 10)
{
Attempt<PagedModel<Guid>, ApiContentQueryOperationStatus> queryAttempt = _apiContentQueryService.ExecuteQuery(fetch, filter, sort, skip, take);
if (queryAttempt.Success is false)
{
return ApiContentQueryOperationStatusResult(queryAttempt.Status);
}
PagedModel<Guid> pagedResult = queryAttempt.Result;
IEnumerable<IPublishedContent> contentItems = ApiPublishedContentCache.GetByIds(pagedResult.Items);
IApiContentResponse[] apiContentItems = contentItems.Select(ApiContentResponseBuilder.Build).WhereNotNull().ToArray();
var model = new PagedViewModel<IApiContentResponse>
{
Total = pagedResult.Total,
Items = apiContentItems
};
return await Task.FromResult(Ok(model));
}
}
@@ -0,0 +1,49 @@
using System.Text.Json;
using System.Text.Json.Serialization;
using Microsoft.Extensions.DependencyInjection;
using Umbraco.Cms.Api.Common.Configuration;
using Umbraco.Cms.Api.Common.DependencyInjection;
using Umbraco.Cms.Api.Delivery.Accessors;
using Umbraco.Cms.Api.Delivery.Configuration;
using Umbraco.Cms.Api.Delivery.Json;
using Umbraco.Cms.Api.Delivery.Rendering;
using Umbraco.Cms.Api.Delivery.Services;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Cms.Core.DependencyInjection;
namespace Umbraco.Extensions;
public static class UmbracoBuilderExtensions
{
public static IUmbracoBuilder AddDeliveryApi(this IUmbracoBuilder builder)
{
builder.Services.AddScoped<IRequestStartItemProvider, RequestStartItemProvider>();
builder.Services.AddScoped<IOutputExpansionStrategy, RequestContextOutputExpansionStrategy>();
builder.Services.AddSingleton<IRequestCultureService, RequestCultureService>();
builder.Services.AddSingleton<IRequestRoutingService, RequestRoutingService>();
builder.Services.AddSingleton<IRequestRedirectService, RequestRedirectService>();
builder.Services.AddSingleton<IRequestPreviewService, RequestPreviewService>();
builder.Services.AddSingleton<IOutputExpansionStrategyAccessor, RequestContextOutputExpansionStrategyAccessor>();
builder.Services.AddSingleton<IRequestStartItemProviderAccessor, RequestContextRequestStartItemProviderAccessor>();
builder.Services.AddSingleton<IApiAccessService, ApiAccessService>();
builder.Services.AddSingleton<IApiContentQueryService, ApiContentQueryService>();
builder.Services.AddSingleton<IApiContentQueryProvider, ApiContentQueryProvider>();
builder.Services.ConfigureOptions<ConfigureUmbracoDeliveryApiSwaggerGenOptions>();
builder.AddUmbracoApiOpenApiUI();
builder
.Services
.AddControllers()
.AddJsonOptions(Constants.JsonOptionsNames.DeliveryApi, options =>
{
// all Delivery API specific JSON options go here
options.JsonSerializerOptions.PropertyNamingPolicy = JsonNamingPolicy.CamelCase;
options.JsonSerializerOptions.TypeInfoResolver = new DeliveryApiJsonTypeResolver();
options.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter());
});
return builder;
}
}
@@ -0,0 +1,43 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
using Umbraco.Cms.Core.DeliveryApi;
namespace Umbraco.Cms.Api.Delivery.Filters;
internal sealed class DeliveryApiAccessAttribute : TypeFilterAttribute
{
public DeliveryApiAccessAttribute()
: base(typeof(DeliveryApiAccessFilter))
{
}
private class DeliveryApiAccessFilter : IActionFilter
{
private readonly IApiAccessService _apiAccessService;
private readonly IRequestPreviewService _requestPreviewService;
public DeliveryApiAccessFilter(IApiAccessService apiAccessService, IRequestPreviewService requestPreviewService)
{
_apiAccessService = apiAccessService;
_requestPreviewService = requestPreviewService;
}
public void OnActionExecuting(ActionExecutingContext context)
{
var hasAccess = _requestPreviewService.IsPreview()
? _apiAccessService.HasPreviewAccess()
: _apiAccessService.HasPublicAccess();
if (hasAccess)
{
return;
}
context.Result = new UnauthorizedResult();
}
public void OnActionExecuted(ActionExecutedContext context)
{
}
}
}
@@ -0,0 +1,37 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Extensions;
namespace Umbraco.Cms.Api.Delivery.Filters;
internal sealed class LocalizeFromAcceptLanguageHeaderAttribute : TypeFilterAttribute
{
public LocalizeFromAcceptLanguageHeaderAttribute()
: base(typeof(LocalizeFromAcceptLanguageHeaderAttributeFilter))
{
}
private class LocalizeFromAcceptLanguageHeaderAttributeFilter : IActionFilter
{
private readonly IRequestCultureService _requestCultureService;
public LocalizeFromAcceptLanguageHeaderAttributeFilter(IRequestCultureService requestCultureService)
=> _requestCultureService = requestCultureService;
public void OnActionExecuting(ActionExecutingContext context)
{
var requestedCulture = _requestCultureService.GetRequestedCulture();
if (requestedCulture.IsNullOrWhiteSpace())
{
return;
}
_requestCultureService.SetRequestCulture(requestedCulture);
}
public void OnActionExecuted(ActionExecutedContext context)
{
}
}
}
@@ -0,0 +1,217 @@
using Microsoft.OpenApi.Any;
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.SwaggerGen;
using Umbraco.Cms.Api.Delivery.Configuration;
using Umbraco.Extensions;
namespace Umbraco.Cms.Api.Delivery.Filters;
public class SwaggerDocumentationFilter : IOperationFilter, IParameterFilter
{
public void Apply(OpenApiOperation operation, OperationFilterContext context)
{
if (context.MethodInfo.HasMapToApiAttribute(DeliveryApiConfiguration.ApiName) == false)
{
return;
}
operation.Parameters ??= new List<OpenApiParameter>();
operation.Parameters.Add(new OpenApiParameter
{
Name = "expand",
In = ParameterLocation.Query,
Required = false,
Description = QueryParameterDescription("Defines the properties that should be expanded in the response"),
Schema = new OpenApiSchema { Type = "string" },
Examples = new Dictionary<string, OpenApiExample>
{
{ "Expand none", new OpenApiExample { Value = new OpenApiString("") } },
{ "Expand all", new OpenApiExample { Value = new OpenApiString("all") } },
{
"Expand specific property",
new OpenApiExample { Value = new OpenApiString("property:alias1") }
},
{
"Expand specific properties",
new OpenApiExample { Value = new OpenApiString("property:alias1,alias2") }
}
}
});
operation.Parameters.Add(new OpenApiParameter
{
Name = "Accept-Language",
In = ParameterLocation.Header,
Required = false,
Description = "Defines the language to return. Use this when querying language variant content items.",
Schema = new OpenApiSchema { Type = "string" },
Examples = new Dictionary<string, OpenApiExample>
{
{ "Default", new OpenApiExample { Value = new OpenApiString("") } },
{ "English culture", new OpenApiExample { Value = new OpenApiString("en-us") } }
}
});
operation.Parameters.Add(new OpenApiParameter
{
Name = "Api-Key",
In = ParameterLocation.Header,
Required = false,
Description = "API key specified through configuration to authorize access to the API.",
Schema = new OpenApiSchema { Type = "string" }
});
operation.Parameters.Add(new OpenApiParameter
{
Name = "Preview",
In = ParameterLocation.Header,
Required = false,
Description = "Whether to request draft content.",
Schema = new OpenApiSchema { Type = "boolean" }
});
operation.Parameters.Add(new OpenApiParameter
{
Name = "Start-Item",
In = ParameterLocation.Header,
Required = false,
Description = "URL segment or GUID of a root content item.",
Schema = new OpenApiSchema { Type = "string" }
});
}
public void Apply(OpenApiParameter parameter, ParameterFilterContext context)
{
if (context.DocumentName != DeliveryApiConfiguration.ApiName)
{
return;
}
switch (parameter.Name)
{
case "fetch":
AddQueryParameterDocumentation(parameter, FetchQueryParameterExamples(), "Specifies the content items to fetch");
break;
case "filter":
AddQueryParameterDocumentation(parameter, FilterQueryParameterExamples(), "Defines how to filter the fetched content items");
break;
case "sort":
AddQueryParameterDocumentation(parameter, SortQueryParameterExamples(), "Defines how to sort the found content items");
break;
case "skip":
parameter.Description = PaginationDescription(true);
break;
case "take":
parameter.Description = PaginationDescription(false);
break;
default:
return;
}
}
private string QueryParameterDescription(string description)
=> $"{description}. Refer to [the documentation]({DeliveryApiConfiguration.ApiDocumentationArticleLink}#query-parameters) for more details on this.";
private string PaginationDescription(bool skip) => $"Specifies the number of found content items to {(skip ? "skip" : "take")}. Use this to control pagination of the response.";
private void AddQueryParameterDocumentation(OpenApiParameter parameter, Dictionary<string, OpenApiExample> examples, string description)
{
parameter.Description = QueryParameterDescription(description);
parameter.Examples = examples;
}
private Dictionary<string, OpenApiExample> FetchQueryParameterExamples() =>
new()
{
{ "Select all", new OpenApiExample { Value = new OpenApiString("") } },
{
"Select all ancestors of a node by id",
new OpenApiExample { Value = new OpenApiString("ancestors:id") }
},
{
"Select all ancestors of a node by path",
new OpenApiExample { Value = new OpenApiString("ancestors:path") }
},
{
"Select all children of a node by id",
new OpenApiExample { Value = new OpenApiString("children:id") }
},
{
"Select all children of a node by path",
new OpenApiExample { Value = new OpenApiString("children:path") }
},
{
"Select all descendants of a node by id",
new OpenApiExample { Value = new OpenApiString("descendants:id") }
},
{
"Select all descendants of a node by path",
new OpenApiExample { Value = new OpenApiString("descendants:path") }
}
};
private Dictionary<string, OpenApiExample> FilterQueryParameterExamples() =>
new()
{
{ "Default filter", new OpenApiExample { Value = new OpenApiString("") } },
{
"Filter by content type",
new OpenApiExample { Value = new OpenApiArray { new OpenApiString("contentType:alias1") } }
},
{
"Filter by name",
new OpenApiExample { Value = new OpenApiArray { new OpenApiString("name:nodeName") } }
}
};
private Dictionary<string, OpenApiExample> SortQueryParameterExamples() =>
new()
{
{ "Default sort", new OpenApiExample { Value = new OpenApiString("") } },
{
"Sort by create date",
new OpenApiExample
{
Value = new OpenApiArray
{
new OpenApiString("createDate:asc"), new OpenApiString("createDate:desc")
}
}
},
{
"Sort by level",
new OpenApiExample
{
Value = new OpenApiArray { new OpenApiString("level:asc"), new OpenApiString("level:desc") }
}
},
{
"Sort by name",
new OpenApiExample
{
Value = new OpenApiArray { new OpenApiString("name:asc"), new OpenApiString("name:desc") }
}
},
{
"Sort by sort order",
new OpenApiExample
{
Value = new OpenApiArray
{
new OpenApiString("sortOrder:asc"), new OpenApiString("sortOrder:desc")
}
}
},
{
"Sort by update date",
new OpenApiExample
{
Value = new OpenApiArray
{
new OpenApiString("updateDate:asc"), new OpenApiString("updateDate:desc")
}
}
}
};
}
@@ -0,0 +1,42 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Cms.Core.Models.PublishedContent;
namespace Umbraco.Cms.Api.Delivery.Filters;
internal sealed class ValidateStartItemAttribute : TypeFilterAttribute
{
public ValidateStartItemAttribute()
: base(typeof(ValidateStartItemFilter))
{
}
private class ValidateStartItemFilter : IActionFilter
{
private readonly IRequestStartItemProviderAccessor _requestStartItemProviderAccessor;
public ValidateStartItemFilter(IRequestStartItemProviderAccessor requestStartItemProviderAccessor)
=> _requestStartItemProviderAccessor = requestStartItemProviderAccessor;
public void OnActionExecuting(ActionExecutingContext context)
{
if (_requestStartItemProviderAccessor.TryGetValue(out IRequestStartItemProvider? requestStartItemProvider) is false
|| requestStartItemProvider.RequestedStartItem() is null)
{
return;
}
IPublishedContent? startItem = requestStartItemProvider.GetStartItem();
if (startItem is null)
{
context.Result = new NotFoundObjectResult("The Start-Item could not be found");
}
}
public void OnActionExecuted(ActionExecutedContext context)
{
}
}
}
@@ -0,0 +1,15 @@
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Cms.Core.Models;
namespace Umbraco.Cms.Api.Delivery.Indexing.Filters;
public sealed class ContentTypeFilterIndexer : IContentIndexHandler
{
internal const string FieldName = "contentType";
public IEnumerable<IndexFieldValue> GetFieldValues(IContent content, string? culture)
=> new[] { new IndexFieldValue { FieldName = FieldName, Values = new object[] { content.ContentType.Alias } } };
public IEnumerable<IndexField> GetFields()
=> new[] { new IndexField { FieldName = FieldName, FieldType = FieldType.StringRaw, VariesByCulture = false } };
}
@@ -0,0 +1,15 @@
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Cms.Core.Models;
namespace Umbraco.Cms.Api.Delivery.Indexing.Filters;
public sealed class NameFilterIndexer : IContentIndexHandler
{
internal const string FieldName = "name";
public IEnumerable<IndexFieldValue> GetFieldValues(IContent content, string? culture)
=> new[] { new IndexFieldValue { FieldName = FieldName, Values = new object[] { content.GetCultureName(culture) ?? string.Empty } } };
public IEnumerable<IndexField> GetFields()
=> new[] { new IndexField { FieldName = FieldName, FieldType = FieldType.StringAnalyzed, VariesByCulture = true } };
}
@@ -0,0 +1,17 @@
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Cms.Core.Models;
namespace Umbraco.Cms.Api.Delivery.Indexing.Selectors;
public sealed class AncestorsSelectorIndexer : IContentIndexHandler
{
// NOTE: "id" is a reserved field name
internal const string FieldName = "itemId";
public IEnumerable<IndexFieldValue> GetFieldValues(IContent content, string? culture)
=> new[] { new IndexFieldValue { FieldName = FieldName, Values = new object[] { content.Key } } };
public IEnumerable<IndexField> GetFields()
=> new[] { new IndexField { FieldName = FieldName, FieldType = FieldType.StringRaw, VariesByCulture = false } };
}
@@ -0,0 +1,35 @@
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Services;
namespace Umbraco.Cms.Api.Delivery.Indexing.Selectors;
public sealed class ChildrenSelectorIndexer : IContentIndexHandler
{
private readonly IEntityService _entityService;
public ChildrenSelectorIndexer(IEntityService entityService)
=> _entityService = entityService;
internal const string FieldName = "parentId";
public IEnumerable<IndexFieldValue> GetFieldValues(IContent content, string? culture)
{
Guid parentKey = Guid.Empty;
if (content.ParentId > 0)
{
Attempt<Guid> getKeyAttempt = _entityService.GetKey(content.ParentId, UmbracoObjectTypes.Document);
parentKey = getKeyAttempt.Success ? getKeyAttempt.Result : parentKey;
}
yield return new IndexFieldValue
{
FieldName = FieldName,
Values = new object[] { parentKey }
};
}
public IEnumerable<IndexField> GetFields()
=> new[] { new IndexField { FieldName = FieldName, FieldType = FieldType.StringRaw, VariesByCulture = false } };
}
@@ -0,0 +1,36 @@
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Services;
using Umbraco.Extensions;
namespace Umbraco.Cms.Api.Delivery.Indexing.Selectors;
public sealed class DescendantsSelectorIndexer : IContentIndexHandler
{
internal const string FieldName = "ancestorIds";
private readonly IEntityService _entityService;
public DescendantsSelectorIndexer(IEntityService entityService)
=> _entityService = entityService;
public IEnumerable<IndexFieldValue> GetFieldValues(IContent content, string? culture)
{
var ancestorKeys = content.GetAncestorIds()?.Select(id =>
{
Attempt<Guid> getKeyAttempt = _entityService.GetKey(id, UmbracoObjectTypes.Document);
return getKeyAttempt.Success ? getKeyAttempt.Result : (object)Guid.Empty;
}).ToArray() ?? Array.Empty<object>();
yield return new IndexFieldValue
{
FieldName = FieldName,
Values = ancestorKeys
};
}
public IEnumerable<IndexField> GetFields()
=> new[] { new IndexField { FieldName = FieldName, FieldType = FieldType.StringRaw, VariesByCulture = false } };
}
@@ -0,0 +1,15 @@
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Cms.Core.Models;
namespace Umbraco.Cms.Api.Delivery.Indexing.Sorts;
public sealed class CreateDateSortIndexer : IContentIndexHandler
{
internal const string FieldName = "createDate";
public IEnumerable<IndexFieldValue> GetFieldValues(IContent content, string? culture)
=> new[] { new IndexFieldValue { FieldName = FieldName, Values = new object[] { content.CreateDate } } };
public IEnumerable<IndexField> GetFields()
=> new[] { new IndexField { FieldName = FieldName, FieldType = FieldType.Date, VariesByCulture = false } };
}
@@ -0,0 +1,15 @@
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Cms.Core.Models;
namespace Umbraco.Cms.Api.Delivery.Indexing.Sorts;
public sealed class LevelSortIndexer : IContentIndexHandler
{
internal const string FieldName = "level";
public IEnumerable<IndexFieldValue> GetFieldValues(IContent content, string? culture)
=> new[] { new IndexFieldValue { FieldName = FieldName, Values = new object[] { content.Level } } };
public IEnumerable<IndexField> GetFields()
=> new[] { new IndexField { FieldName = FieldName, FieldType = FieldType.Number, VariesByCulture = false } };
}
@@ -0,0 +1,15 @@
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Cms.Core.Models;
namespace Umbraco.Cms.Api.Delivery.Indexing.Sorts;
public sealed class NameSortIndexer : IContentIndexHandler
{
internal const string FieldName = "sortName";
public IEnumerable<IndexFieldValue> GetFieldValues(IContent content, string? culture)
=> new[] { new IndexFieldValue { FieldName = FieldName, Values = new object[] { content.GetCultureName(culture) ?? string.Empty } } };
public IEnumerable<IndexField> GetFields()
=> new[] { new IndexField { FieldName = FieldName, FieldType = FieldType.StringSortable, VariesByCulture = true } };
}
@@ -0,0 +1,15 @@
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Cms.Core.Models;
namespace Umbraco.Cms.Api.Delivery.Indexing.Sorts;
public sealed class SortOrderSortIndexer : IContentIndexHandler
{
internal const string FieldName = "sortOrder";
public IEnumerable<IndexFieldValue> GetFieldValues(IContent content, string? culture)
=> new[] { new IndexFieldValue { FieldName = FieldName, Values = new object[] { content.SortOrder } } };
public IEnumerable<IndexField> GetFields()
=> new[] { new IndexField { FieldName = FieldName, FieldType = FieldType.Number, VariesByCulture = false } };
}
@@ -0,0 +1,22 @@
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Cms.Core.Models;
namespace Umbraco.Cms.Api.Delivery.Indexing.Sorts;
public sealed class UpdateDateSortIndexer : IContentIndexHandler
{
internal const string FieldName = "updateDate";
public IEnumerable<IndexFieldValue> GetFieldValues(IContent content, string? culture)
=> new[]
{
new IndexFieldValue
{
FieldName = FieldName,
Values = new object[] { (culture is not null ? content.GetUpdateDate(culture) : null) ?? content.UpdateDate }
}
};
public IEnumerable<IndexField> GetFields()
=> new[] { new IndexField { FieldName = FieldName, FieldType = FieldType.Date, VariesByCulture = true } };
}
@@ -0,0 +1,43 @@
using System.Text.Json;
using System.Text.Json.Serialization;
using System.Text.Json.Serialization.Metadata;
using Umbraco.Cms.Core.Models.DeliveryApi;
namespace Umbraco.Cms.Api.Delivery.Json;
// see https://learn.microsoft.com/en-us/dotnet/standard/serialization/system-text-json/polymorphism?pivots=dotnet-7-0
public class DeliveryApiJsonTypeResolver : DefaultJsonTypeInfoResolver
{
public override JsonTypeInfo GetTypeInfo(Type type, JsonSerializerOptions options)
{
JsonTypeInfo jsonTypeInfo = base.GetTypeInfo(type, options);
if (jsonTypeInfo.Type == typeof(IApiContent))
{
ConfigureJsonPolymorphismOptions(jsonTypeInfo, typeof(ApiContent));
}
else if (jsonTypeInfo.Type == typeof(IApiContentResponse))
{
ConfigureJsonPolymorphismOptions(jsonTypeInfo, typeof(ApiContentResponse));
}
else if (jsonTypeInfo.Type == typeof(IRichTextElement))
{
ConfigureJsonPolymorphismOptions(jsonTypeInfo, typeof(RichTextGenericElement), typeof(RichTextTextElement));
}
return jsonTypeInfo;
}
private void ConfigureJsonPolymorphismOptions(JsonTypeInfo jsonTypeInfo, params Type[] derivedTypes)
{
jsonTypeInfo.PolymorphismOptions = new JsonPolymorphismOptions
{
UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FailSerialization,
};
foreach (Type derivedType in derivedTypes)
{
jsonTypeInfo.PolymorphismOptions.DerivedTypes.Add(new JsonDerivedType(derivedType));
}
}
}
@@ -0,0 +1,31 @@
using Umbraco.Cms.Api.Delivery.Indexing.Filters;
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Extensions;
namespace Umbraco.Cms.Api.Delivery.Querying.Filters;
public sealed class ContentTypeFilter : IFilterHandler
{
private const string ContentTypeSpecifier = "contentType:";
/// <inheritdoc />
public bool CanHandle(string query)
=> query.StartsWith(ContentTypeSpecifier, StringComparison.OrdinalIgnoreCase);
/// <inheritdoc/>
public FilterOption BuildFilterOption(string filter)
{
var alias = filter.Substring(ContentTypeSpecifier.Length);
return new FilterOption
{
FieldName = ContentTypeFilterIndexer.FieldName,
Values = alias.IsNullOrWhiteSpace() == false
? new[] { alias.TrimStart('!') }
: Array.Empty<string>(),
Operator = alias.StartsWith('!')
? FilterOperation.IsNot
: FilterOperation.Is
};
}
}
@@ -0,0 +1,31 @@
using Umbraco.Cms.Api.Delivery.Indexing.Filters;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.DeliveryApi;
namespace Umbraco.Cms.Api.Delivery.Querying.Filters;
public sealed class NameFilter : IFilterHandler
{
private const string NameSpecifier = "name:";
/// <inheritdoc />
public bool CanHandle(string query)
=> query.StartsWith(NameSpecifier, StringComparison.OrdinalIgnoreCase);
/// <inheritdoc/>
public FilterOption BuildFilterOption(string filter)
{
var value = filter.Substring(NameSpecifier.Length);
var negate = value.StartsWith('!');
var values = value.TrimStart('!').Split(Constants.CharArrays.Comma);
return new FilterOption
{
FieldName = NameFilterIndexer.FieldName,
Values = values,
Operator = negate
? FilterOperation.DoesNotContain
: FilterOperation.Contains
};
}
}
@@ -0,0 +1,40 @@
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Cms.Core.Models.PublishedContent;
using Umbraco.Cms.Core.PublishedCache;
using Umbraco.Extensions;
namespace Umbraco.Cms.Api.Delivery.Querying;
public abstract class QueryOptionBase
{
private readonly IPublishedSnapshotAccessor _publishedSnapshotAccessor;
private readonly IRequestRoutingService _requestRoutingService;
public QueryOptionBase(IPublishedSnapshotAccessor publishedSnapshotAccessor,
IRequestRoutingService requestRoutingService)
{
_publishedSnapshotAccessor = publishedSnapshotAccessor;
_requestRoutingService = requestRoutingService;
}
protected Guid? GetGuidFromQuery(string queryStringValue)
{
if (queryStringValue.IsNullOrWhiteSpace())
{
return null;
}
if (Guid.TryParse(queryStringValue, out Guid id))
{
return id;
}
IPublishedSnapshot publishedSnapshot = _publishedSnapshotAccessor.GetRequiredPublishedSnapshot();
// Check if the passed value is a path of a content item
var contentRoute = _requestRoutingService.GetContentRoute(queryStringValue);
IPublishedContent? contentItem = publishedSnapshot.Content?.GetByRoute(contentRoute);
return contentItem?.Key;
}
}
@@ -0,0 +1,53 @@
using Umbraco.Cms.Api.Delivery.Indexing.Selectors;
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Cms.Core.Models.PublishedContent;
using Umbraco.Cms.Core.PublishedCache;
using Umbraco.Extensions;
namespace Umbraco.Cms.Api.Delivery.Querying.Selectors;
public sealed class AncestorsSelector : QueryOptionBase, ISelectorHandler
{
private const string AncestorsSpecifier = "ancestors:";
private readonly IPublishedSnapshotAccessor _publishedSnapshotAccessor;
public AncestorsSelector(IPublishedSnapshotAccessor publishedSnapshotAccessor, IRequestRoutingService requestRoutingService)
: base(publishedSnapshotAccessor, requestRoutingService) =>
_publishedSnapshotAccessor = publishedSnapshotAccessor;
/// <inheritdoc />
public bool CanHandle(string query)
=> query.StartsWith(AncestorsSpecifier, StringComparison.OrdinalIgnoreCase);
/// <inheritdoc/>
public SelectorOption BuildSelectorOption(string selector)
{
var fieldValue = selector[AncestorsSpecifier.Length..];
Guid? id = GetGuidFromQuery(fieldValue);
if (id is null)
{
// Setting the Value to "" since that would yield no results.
// It won't be appropriate to return null here since if we reached this,
// it means that CanHandle() returned true, meaning that this Selector should be able to handle the selector value
return new SelectorOption
{
FieldName = AncestorsSelectorIndexer.FieldName,
Values = Array.Empty<string>()
};
}
IPublishedSnapshot publishedSnapshot = _publishedSnapshotAccessor.GetRequiredPublishedSnapshot();
IPublishedContent contentItem = publishedSnapshot.Content?.GetById((Guid)id)
?? throw new InvalidOperationException("Could not obtain the content cache");
var ancestorKeys = contentItem.Ancestors().Select(a => a.Key.ToString("D")).ToArray();
return new SelectorOption
{
FieldName = AncestorsSelectorIndexer.FieldName,
Values = ancestorKeys
};
}
}
@@ -0,0 +1,35 @@
using Umbraco.Cms.Api.Delivery.Indexing.Selectors;
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Cms.Core.PublishedCache;
using Umbraco.Extensions;
namespace Umbraco.Cms.Api.Delivery.Querying.Selectors;
public sealed class ChildrenSelector : QueryOptionBase, ISelectorHandler
{
private const string ChildrenSpecifier = "children:";
public ChildrenSelector(IPublishedSnapshotAccessor publishedSnapshotAccessor, IRequestRoutingService requestRoutingService)
: base(publishedSnapshotAccessor, requestRoutingService)
{
}
/// <inheritdoc />
public bool CanHandle(string query)
=> query.StartsWith(ChildrenSpecifier, StringComparison.OrdinalIgnoreCase);
/// <inheritdoc/>
public SelectorOption BuildSelectorOption(string selector)
{
var fieldValue = selector[ChildrenSpecifier.Length..];
var id = GetGuidFromQuery(fieldValue)?.ToString("D");
return new SelectorOption
{
FieldName = ChildrenSelectorIndexer.FieldName,
Values = id.IsNullOrWhiteSpace() == false
? new[] { id }
: Array.Empty<string>()
};
}
}
@@ -0,0 +1,35 @@
using Umbraco.Cms.Api.Delivery.Indexing.Selectors;
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Cms.Core.PublishedCache;
using Umbraco.Extensions;
namespace Umbraco.Cms.Api.Delivery.Querying.Selectors;
public sealed class DescendantsSelector : QueryOptionBase, ISelectorHandler
{
private const string DescendantsSpecifier = "descendants:";
public DescendantsSelector(IPublishedSnapshotAccessor publishedSnapshotAccessor, IRequestRoutingService requestRoutingService)
: base(publishedSnapshotAccessor, requestRoutingService)
{
}
/// <inheritdoc />
public bool CanHandle(string query)
=> query.StartsWith(DescendantsSpecifier, StringComparison.OrdinalIgnoreCase);
/// <inheritdoc/>
public SelectorOption BuildSelectorOption(string selector)
{
var fieldValue = selector[DescendantsSpecifier.Length..];
var id = GetGuidFromQuery(fieldValue)?.ToString("D");
return new SelectorOption
{
FieldName = DescendantsSelectorIndexer.FieldName,
Values = id.IsNullOrWhiteSpace() == false
? new[] { id }
: Array.Empty<string>()
};
}
}
@@ -0,0 +1,26 @@
using Umbraco.Cms.Api.Delivery.Indexing.Sorts;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.DeliveryApi;
namespace Umbraco.Cms.Api.Delivery.Querying.Sorts;
public sealed class CreateDateSort : ISortHandler
{
private const string SortOptionSpecifier = "createDate:";
/// <inheritdoc />
public bool CanHandle(string query)
=> query.StartsWith(SortOptionSpecifier, StringComparison.OrdinalIgnoreCase);
/// <inheritdoc/>
public SortOption BuildSortOption(string sort)
{
var sortDirection = sort.Substring(SortOptionSpecifier.Length);
return new SortOption
{
FieldName = CreateDateSortIndexer.FieldName,
Direction = sortDirection.StartsWith("asc") ? Direction.Ascending : Direction.Descending
};
}
}
@@ -0,0 +1,26 @@
using Umbraco.Cms.Api.Delivery.Indexing.Sorts;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.DeliveryApi;
namespace Umbraco.Cms.Api.Delivery.Querying.Sorts;
public sealed class LevelSort : ISortHandler
{
private const string SortOptionSpecifier = "level:";
/// <inheritdoc />
public bool CanHandle(string query)
=> query.StartsWith(SortOptionSpecifier, StringComparison.OrdinalIgnoreCase);
/// <inheritdoc/>
public SortOption BuildSortOption(string sort)
{
var sortDirection = sort.Substring(SortOptionSpecifier.Length);
return new SortOption
{
FieldName = LevelSortIndexer.FieldName,
Direction = sortDirection.StartsWith("asc") ? Direction.Ascending : Direction.Descending
};
}
}
@@ -0,0 +1,26 @@
using Umbraco.Cms.Api.Delivery.Indexing.Sorts;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.DeliveryApi;
namespace Umbraco.Cms.Api.Delivery.Querying.Sorts;
public sealed class NameSort : ISortHandler
{
private const string SortOptionSpecifier = "name:";
/// <inheritdoc />
public bool CanHandle(string query)
=> query.StartsWith(SortOptionSpecifier, StringComparison.OrdinalIgnoreCase);
/// <inheritdoc/>
public SortOption BuildSortOption(string sort)
{
var sortDirection = sort.Substring(SortOptionSpecifier.Length);
return new SortOption
{
FieldName = NameSortIndexer.FieldName,
Direction = sortDirection.StartsWith("asc") ? Direction.Ascending : Direction.Descending
};
}
}
@@ -0,0 +1,26 @@
using Umbraco.Cms.Api.Delivery.Indexing.Sorts;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.DeliveryApi;
namespace Umbraco.Cms.Api.Delivery.Querying.Sorts;
public sealed class SortOrderSort : ISortHandler
{
private const string SortOptionSpecifier = "sortOrder:";
/// <inheritdoc />
public bool CanHandle(string query)
=> query.StartsWith(SortOptionSpecifier, StringComparison.OrdinalIgnoreCase);
/// <inheritdoc/>
public SortOption BuildSortOption(string sort)
{
var sortDirection = sort.Substring(SortOptionSpecifier.Length);
return new SortOption
{
FieldName = SortOrderSortIndexer.FieldName,
Direction = sortDirection.StartsWith("asc") ? Direction.Ascending : Direction.Descending
};
}
}
@@ -0,0 +1,26 @@
using Umbraco.Cms.Api.Delivery.Indexing.Sorts;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.DeliveryApi;
namespace Umbraco.Cms.Api.Delivery.Querying.Sorts;
public sealed class UpdateDateSort : ISortHandler
{
private const string SortOptionSpecifier = "updateDate:";
/// <inheritdoc />
public bool CanHandle(string query)
=> query.StartsWith(SortOptionSpecifier, StringComparison.OrdinalIgnoreCase);
/// <inheritdoc/>
public SortOption BuildSortOption(string sort)
{
var sortDirection = sort.Substring(SortOptionSpecifier.Length);
return new SortOption
{
FieldName = UpdateDateSortIndexer.FieldName,
Direction = sortDirection.StartsWith("asc") ? Direction.Ascending : Direction.Descending
};
}
}
@@ -0,0 +1,123 @@
using Microsoft.AspNetCore.Http;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Cms.Core.Models.PublishedContent;
using Umbraco.Extensions;
namespace Umbraco.Cms.Api.Delivery.Rendering;
internal sealed class RequestContextOutputExpansionStrategy : IOutputExpansionStrategy
{
private readonly IApiPropertyRenderer _propertyRenderer;
private readonly bool _expandAll;
private readonly string[] _expandAliases;
private ExpansionState _state;
public RequestContextOutputExpansionStrategy(IHttpContextAccessor httpContextAccessor, IApiPropertyRenderer propertyRenderer)
{
_propertyRenderer = propertyRenderer;
(bool ExpandAll, string[] ExpanedAliases) initialState = InitialRequestState(httpContextAccessor);
_expandAll = initialState.ExpandAll;
_expandAliases = initialState.ExpanedAliases;
_state = ExpansionState.Initial;
}
public IDictionary<string, object?> MapElementProperties(IPublishedElement element)
=> element.Properties.ToDictionary(
p => p.Alias,
p => GetPropertyValue(p, _state == ExpansionState.Expanding));
public IDictionary<string, object?> MapContentProperties(IPublishedContent content)
=> content.ItemType == PublishedItemType.Content
? MapProperties(content.Properties)
: throw new ArgumentException($"Invalid item type. This method can only be used with item type {nameof(PublishedItemType.Content)}, got: {content.ItemType}");
public IDictionary<string, object?> MapMediaProperties(IPublishedContent media, bool skipUmbracoProperties = true)
{
if (media.ItemType != PublishedItemType.Media)
{
throw new ArgumentException($"Invalid item type. This method can only be used with item type {PublishedItemType.Media}, got: {media.ItemType}");
}
IPublishedProperty[] properties = media
.Properties
.Where(p => skipUmbracoProperties is false || p.Alias.StartsWith("umbraco") is false)
.ToArray();
return properties.Any()
? MapProperties(properties)
: new Dictionary<string, object?>();
}
private IDictionary<string, object?> MapProperties(IEnumerable<IPublishedProperty> properties)
{
// in the initial state, content properties should always be rendered (expanded if the requests dictates it).
// this corresponds to the root level of a content item, i.e. when the initial content rendering starts.
if (_state == ExpansionState.Initial)
{
// update state to pending so we don't end up here the next time around
_state = ExpansionState.Pending;
var rendered = properties.ToDictionary(
property => property.Alias,
property =>
{
// update state to expanding if the property should be expanded (needed for nested elements)
if (_expandAll || _expandAliases.Contains(property.Alias))
{
_state = ExpansionState.Expanding;
}
var value = GetPropertyValue(property, _state == ExpansionState.Expanding);
// always revert to pending after rendering the property value
_state = ExpansionState.Pending;
return value;
});
_state = ExpansionState.Initial;
return rendered;
}
// in an expanding state, properties should always be rendered as collapsed.
// this corresponds to properties of a content based property placed directly below a root level property that is being expanded
// (i.e. properties for picked content for an expanded content picker at root level).
if (_state == ExpansionState.Expanding)
{
_state = ExpansionState.Expanded;
var rendered = properties.ToDictionary(
property => property.Alias,
property => GetPropertyValue(property, false));
_state = ExpansionState.Expanding;
return rendered;
}
return new Dictionary<string, object?>();
}
private (bool ExpandAll, string[] ExpanedAliases) InitialRequestState(IHttpContextAccessor httpContextAccessor)
{
string? toExpand = httpContextAccessor.HttpContext?.Request.Query["expand"];
if (toExpand.IsNullOrWhiteSpace())
{
return new(false, Array.Empty<string>());
}
const string propertySpecifier = "property:";
return new(
toExpand == "all",
toExpand.StartsWith(propertySpecifier)
? toExpand.Substring(propertySpecifier.Length).Split(Constants.CharArrays.Comma)
: Array.Empty<string>());
}
private object? GetPropertyValue(IPublishedProperty property, bool expanding)
=> _propertyRenderer.GetPropertyValue(property, expanding);
private enum ExpansionState
{
Initial,
Pending,
Expanding,
Expanded
}
}
@@ -0,0 +1,11 @@
using Umbraco.Cms.Web.Common.Routing;
namespace Umbraco.Cms.Api.Delivery.Routing;
internal sealed class VersionedDeliveryApiRouteAttribute : BackOfficeRouteAttribute
{
public VersionedDeliveryApiRouteAttribute(string template)
: base($"delivery/api/v{{version:apiVersion}}/{template.TrimStart('/')}")
{
}
}
@@ -0,0 +1,30 @@
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Options;
using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Extensions;
namespace Umbraco.Cms.Api.Delivery.Services;
internal sealed class ApiAccessService : RequestHeaderHandler, IApiAccessService
{
private DeliveryApiSettings _deliveryApiSettings;
public ApiAccessService(IHttpContextAccessor httpContextAccessor, IOptionsMonitor<DeliveryApiSettings> deliveryApiSettings)
: base(httpContextAccessor)
{
_deliveryApiSettings = deliveryApiSettings.CurrentValue;
deliveryApiSettings.OnChange(settings => _deliveryApiSettings = settings);
}
/// <inheritdoc />
public bool HasPublicAccess() => IfEnabled(() => _deliveryApiSettings.PublicAccess || HasValidApiKey());
/// <inheritdoc />
public bool HasPreviewAccess() => IfEnabled(HasValidApiKey);
private bool IfEnabled(Func<bool> condition) => _deliveryApiSettings.Enabled && condition();
private bool HasValidApiKey() => _deliveryApiSettings.ApiKey.IsNullOrWhiteSpace() == false
&& _deliveryApiSettings.ApiKey.Equals(GetHeaderValue("Api-Key"));
}
@@ -0,0 +1,194 @@
using Examine;
using Examine.Lucene.Providers;
using Examine.Lucene.Search;
using Examine.Search;
using Microsoft.Extensions.Logging;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Infrastructure.Examine;
using Umbraco.Extensions;
namespace Umbraco.Cms.Api.Delivery.Services;
/// <summary>
/// This is the Examine implementation of content querying for the Delivery API.
/// </summary>
internal sealed class ApiContentQueryProvider : IApiContentQueryProvider
{
private const string ItemIdFieldName = "itemId";
private readonly IExamineManager _examineManager;
private readonly ILogger<ApiContentQueryProvider> _logger;
private readonly string _fallbackGuidValue;
private readonly Dictionary<string, FieldType> _fieldTypes;
public ApiContentQueryProvider(
IExamineManager examineManager,
ContentIndexHandlerCollection indexHandlers,
ILogger<ApiContentQueryProvider> logger)
{
_examineManager = examineManager;
_logger = logger;
// A fallback value is needed for Examine queries in case we don't have a value - we can't pass null or empty string
// It is set to a random guid since this would be highly unlikely to yield any results
_fallbackGuidValue = Guid.NewGuid().ToString("D");
// build a look-up dictionary of field types by field name
_fieldTypes = indexHandlers
.SelectMany(handler => handler.GetFields())
.DistinctBy(field => field.FieldName)
.ToDictionary(field => field.FieldName, field => field.FieldType, StringComparer.InvariantCultureIgnoreCase);
}
public PagedModel<Guid> ExecuteQuery(SelectorOption selectorOption, IList<FilterOption> filterOptions, IList<SortOption> sortOptions, string culture, bool preview, int skip, int take)
{
if (!_examineManager.TryGetIndex(Constants.UmbracoIndexes.DeliveryApiContentIndexName, out IIndex? index))
{
_logger.LogError("Could not find the index {IndexName} when attempting to execute a query.", Constants.UmbracoIndexes.DeliveryApiContentIndexName);
return new PagedModel<Guid>();
}
IBooleanOperation queryOperation = BuildSelectorOperation(selectorOption, index, culture, preview);
ApplyFiltering(filterOptions, queryOperation);
ApplySorting(sortOptions, queryOperation);
ISearchResults? results = queryOperation
.SelectField(ItemIdFieldName)
.Execute(QueryOptions.SkipTake(skip, take));
if (results is null)
{
// The query yield no results
return new PagedModel<Guid>();
}
Guid[] items = results
.Where(r => r.Values.ContainsKey(ItemIdFieldName))
.Select(r => Guid.Parse(r.Values[ItemIdFieldName]))
.ToArray();
return new PagedModel<Guid>(results.TotalItemCount, items);
}
public SelectorOption AllContentSelectorOption() => new()
{
FieldName = UmbracoExamineFieldNames.CategoryFieldName, Values = new[] { "content" }
};
private IBooleanOperation BuildSelectorOperation(SelectorOption selectorOption, IIndex index, string culture, bool preview)
{
// Needed for enabling leading wildcards searches
BaseLuceneSearcher searcher = index.Searcher as BaseLuceneSearcher ?? throw new InvalidOperationException($"Index searcher must be of type {nameof(BaseLuceneSearcher)}.");
IQuery query = searcher.CreateQuery(
IndexTypes.Content,
BooleanOperation.And,
searcher.LuceneAnalyzer,
new LuceneSearchOptions { AllowLeadingWildcard = true });
IBooleanOperation selectorOperation = selectorOption.Values.Length == 1
? query.Field(selectorOption.FieldName, selectorOption.Values.First())
: query.GroupedOr(new[] { selectorOption.FieldName }, selectorOption.Values);
// Item culture must be either the requested culture or "none"
selectorOperation.And().GroupedOr(new[] { UmbracoExamineFieldNames.DeliveryApiContentIndex.Culture }, culture.ToLowerInvariant().IfNullOrWhiteSpace(_fallbackGuidValue), "none");
// when not fetching for preview, make sure the "published" field is "y"
if (preview is false)
{
selectorOperation.And().Field(UmbracoExamineFieldNames.DeliveryApiContentIndex.Published, "y");
}
return selectorOperation;
}
private void ApplyFiltering(IList<FilterOption> filterOptions, IBooleanOperation queryOperation)
{
void HandleExact(IQuery query, string fieldName, string[] values)
{
if (values.Length == 1)
{
query.Field(fieldName, values[0]);
}
else
{
query.GroupedOr(new[] { fieldName }, values);
}
}
void HandleContains(IQuery query, string fieldName, string[] values)
{
if (values.Length == 1)
{
// The trailing wildcard is added automatically
query.Field(fieldName, (IExamineValue)new ExamineValue(Examineness.ComplexWildcard, $"*{values[0]}"));
}
else
{
// The trailing wildcard is added automatically
IExamineValue[] examineValues = values
.Select(value => (IExamineValue)new ExamineValue(Examineness.ComplexWildcard, $"*{value}"))
.ToArray();
query.GroupedOr(new[] { fieldName }, examineValues);
}
}
foreach (FilterOption filterOption in filterOptions)
{
var values = filterOption.Values.Any()
? filterOption.Values
: new[] { _fallbackGuidValue };
switch (filterOption.Operator)
{
case FilterOperation.Is:
HandleExact(queryOperation.And(), filterOption.FieldName, values);
break;
case FilterOperation.IsNot:
HandleExact(queryOperation.Not(), filterOption.FieldName, values);
break;
case FilterOperation.Contains:
HandleContains(queryOperation.And(), filterOption.FieldName, values);
break;
case FilterOperation.DoesNotContain:
HandleContains(queryOperation.Not(), filterOption.FieldName, values);
break;
default:
continue;
}
}
}
private void ApplySorting(IList<SortOption> sortOptions, IOrdering ordering)
{
foreach (SortOption sort in sortOptions)
{
if (_fieldTypes.TryGetValue(sort.FieldName, out FieldType fieldType) is false)
{
_logger.LogWarning(
"Sort implementation for field name {FieldName} does not match an index handler implementation, cannot resolve field type.",
sort.FieldName);
continue;
}
SortType sortType = fieldType switch
{
FieldType.Number => SortType.Int,
FieldType.Date => SortType.Long,
FieldType.StringRaw => SortType.String,
FieldType.StringAnalyzed => SortType.String,
FieldType.StringSortable => SortType.String,
_ => throw new ArgumentOutOfRangeException(nameof(fieldType))
};
ordering = sort.Direction switch
{
Direction.Ascending => ordering.OrderBy(new SortableField(sort.FieldName, sortType)),
Direction.Descending => ordering.OrderByDescending(new SortableField(sort.FieldName, sortType)),
_ => ordering
};
}
}
}
@@ -0,0 +1,119 @@
using Umbraco.Cms.Api.Delivery.Indexing.Selectors;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Models.PublishedContent;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Extensions;
namespace Umbraco.Cms.Api.Delivery.Services;
internal sealed class ApiContentQueryService : IApiContentQueryService
{
private readonly IRequestStartItemProviderAccessor _requestStartItemProviderAccessor;
private readonly SelectorHandlerCollection _selectorHandlers;
private readonly FilterHandlerCollection _filterHandlers;
private readonly SortHandlerCollection _sortHandlers;
private readonly IVariationContextAccessor _variationContextAccessor;
private readonly IApiContentQueryProvider _apiContentQueryProvider;
private readonly IRequestPreviewService _requestPreviewService;
public ApiContentQueryService(
IRequestStartItemProviderAccessor requestStartItemProviderAccessor,
SelectorHandlerCollection selectorHandlers,
FilterHandlerCollection filterHandlers,
SortHandlerCollection sortHandlers,
IVariationContextAccessor variationContextAccessor,
IApiContentQueryProvider apiContentQueryProvider,
IRequestPreviewService requestPreviewService)
{
_requestStartItemProviderAccessor = requestStartItemProviderAccessor;
_selectorHandlers = selectorHandlers;
_filterHandlers = filterHandlers;
_sortHandlers = sortHandlers;
_variationContextAccessor = variationContextAccessor;
_apiContentQueryProvider = apiContentQueryProvider;
_requestPreviewService = requestPreviewService;
}
/// <inheritdoc/>
public Attempt<PagedModel<Guid>, ApiContentQueryOperationStatus> ExecuteQuery(string? fetch, IEnumerable<string> filters, IEnumerable<string> sorts, int skip, int take)
{
var emptyResult = new PagedModel<Guid>();
SelectorOption? selectorOption = GetSelectorOption(fetch);
if (selectorOption is null)
{
// If no Selector could be found, we return no results
return Attempt.FailWithStatus(ApiContentQueryOperationStatus.SelectorOptionNotFound, emptyResult);
}
var filterOptions = new List<FilterOption>();
foreach (var filter in filters.Where(filter => filter.IsNullOrWhiteSpace() is false))
{
FilterOption? filterOption = GetFilterOption(filter);
if (filterOption is null)
{
// If there is an invalid Filter option, we return no results
return Attempt.FailWithStatus(ApiContentQueryOperationStatus.FilterOptionNotFound, emptyResult);
}
filterOptions.Add(filterOption);
}
var sortOptions = new List<SortOption>();
foreach (var sort in sorts.Where(sort => sort.IsNullOrWhiteSpace() is false))
{
SortOption? sortOption = GetSortOption(sort);
if (sortOption is null)
{
// If there is an invalid Sort option, we return no results
return Attempt.FailWithStatus(ApiContentQueryOperationStatus.SortOptionNotFound, emptyResult);
}
sortOptions.Add(sortOption);
}
var culture = _variationContextAccessor.VariationContext?.Culture ?? string.Empty;
var isPreview = _requestPreviewService.IsPreview();
PagedModel<Guid> result = _apiContentQueryProvider.ExecuteQuery(selectorOption, filterOptions, sortOptions, culture, isPreview, skip, take);
return Attempt.SucceedWithStatus(ApiContentQueryOperationStatus.Success, result);
}
private SelectorOption? GetSelectorOption(string? fetch)
{
if (fetch is not null)
{
ISelectorHandler? selectorHandler = _selectorHandlers.FirstOrDefault(h => h.CanHandle(fetch));
return selectorHandler?.BuildSelectorOption(fetch);
}
if (_requestStartItemProviderAccessor.TryGetValue(out IRequestStartItemProvider? requestStartItemProvider))
{
IPublishedContent? startItem = requestStartItemProvider.GetStartItem();
if (startItem is not null)
{
// Reusing the boolean operation of the "Descendants" selector, as we want to get all the nodes from the given starting point
return new SelectorOption
{
FieldName = DescendantsSelectorIndexer.FieldName, Values = new[] { startItem.Key.ToString() }
};
}
}
return _apiContentQueryProvider.AllContentSelectorOption();
}
private FilterOption? GetFilterOption(string filter)
{
IFilterHandler? filterHandler = _filterHandlers.FirstOrDefault(h => h.CanHandle(filter));
return filterHandler?.BuildFilterOption(filter);
}
private SortOption? GetSortOption(string sort)
{
ISortHandler? sortHandler = _sortHandlers.FirstOrDefault(h => h.CanHandle(sort));
return sortHandler?.BuildSortOption(sort);
}
}
@@ -0,0 +1,39 @@
using System.Text.RegularExpressions;
using Microsoft.AspNetCore.Http;
using Microsoft.Net.Http.Headers;
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Cms.Core.Models.PublishedContent;
namespace Umbraco.Cms.Api.Delivery.Services;
internal sealed partial class RequestCultureService : RequestHeaderHandler, IRequestCultureService
{
private readonly IVariationContextAccessor _variationContextAccessor;
public RequestCultureService(IHttpContextAccessor httpContextAccessor, IVariationContextAccessor variationContextAccessor)
: base(httpContextAccessor) =>
_variationContextAccessor = variationContextAccessor;
/// <inheritdoc />
public string? GetRequestedCulture()
{
var acceptLanguage = GetHeaderValue(HeaderNames.AcceptLanguage) ?? string.Empty;
return ValidLanguageHeaderRegex().IsMatch(acceptLanguage) ? acceptLanguage : null;
}
/// <inheritdoc />
public void SetRequestCulture(string culture)
{
if (_variationContextAccessor.VariationContext?.Culture == culture)
{
return;
}
_variationContextAccessor.VariationContext = new VariationContext(culture);
}
// at the time of writing we're introducing this to get rid of accept-language header values like "en-GB,en-US;q=0.9,en;q=0.8",
// so we don't want to be too restrictive in this regex - keep it simple for now.
[GeneratedRegex(@"^[\w-]*$")]
private static partial Regex ValidLanguageHeaderRegex();
}
@@ -0,0 +1,18 @@
using Microsoft.AspNetCore.Http;
namespace Umbraco.Cms.Api.Delivery.Services;
internal abstract class RequestHeaderHandler
{
private readonly IHttpContextAccessor _httpContextAccessor;
protected RequestHeaderHandler(IHttpContextAccessor httpContextAccessor) => _httpContextAccessor = httpContextAccessor;
protected string? GetHeaderValue(string headerName)
{
HttpContext httpContext = _httpContextAccessor.HttpContext ??
throw new InvalidOperationException("Could not obtain an HTTP context");
return httpContext.Request.Headers[headerName];
}
}
@@ -0,0 +1,15 @@
using Microsoft.AspNetCore.Http;
using Umbraco.Cms.Core.DeliveryApi;
namespace Umbraco.Cms.Api.Delivery.Services;
internal sealed class RequestPreviewService : RequestHeaderHandler, IRequestPreviewService
{
public RequestPreviewService(IHttpContextAccessor httpContextAccessor)
: base(httpContextAccessor)
{
}
/// <inheritdoc />
public bool IsPreview() => GetHeaderValue("Preview") == "true";
}
@@ -0,0 +1,78 @@
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Options;
using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Models.DeliveryApi;
using Umbraco.Cms.Core.Models.PublishedContent;
using Umbraco.Cms.Core.PublishedCache;
using Umbraco.Cms.Core.Routing;
using Umbraco.Cms.Core.Services;
using Umbraco.Extensions;
namespace Umbraco.Cms.Api.Delivery.Services;
internal sealed class RequestRedirectService : RoutingServiceBase, IRequestRedirectService
{
private readonly IRequestCultureService _requestCultureService;
private readonly IRedirectUrlService _redirectUrlService;
private readonly IApiPublishedContentCache _apiPublishedContentCache;
private readonly IApiContentRouteBuilder _apiContentRouteBuilder;
private readonly GlobalSettings _globalSettings;
public RequestRedirectService(
IPublishedSnapshotAccessor publishedSnapshotAccessor,
IHttpContextAccessor httpContextAccessor,
IRequestStartItemProviderAccessor requestStartItemProviderAccessor,
IRequestCultureService requestCultureService,
IRedirectUrlService redirectUrlService,
IApiPublishedContentCache apiPublishedContentCache,
IApiContentRouteBuilder apiContentRouteBuilder,
IOptions<GlobalSettings> globalSettings)
: base(publishedSnapshotAccessor, httpContextAccessor, requestStartItemProviderAccessor)
{
_requestCultureService = requestCultureService;
_redirectUrlService = redirectUrlService;
_apiPublishedContentCache = apiPublishedContentCache;
_apiContentRouteBuilder = apiContentRouteBuilder;
_globalSettings = globalSettings.Value;
}
public IApiContentRoute? GetRedirectRoute(string requestedPath)
{
requestedPath = requestedPath.EnsureStartsWith("/");
// 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)
{
IPublishedContent? startItem = GetStartItem();
if (startItem?.UrlSegment != null)
{
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)
{
requestedPath = GetContentRoute(domainAndUri, contentRoute);
culture ??= domainAndUri.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;
return content != null
? _apiContentRouteBuilder.Build(content)
: null;
}
}
@@ -0,0 +1,61 @@
using Microsoft.AspNetCore.Http;
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Cms.Core.Models.PublishedContent;
using Umbraco.Cms.Core.PublishedCache;
using Umbraco.Cms.Core.Routing;
using Umbraco.Extensions;
namespace Umbraco.Cms.Api.Delivery.Services;
internal sealed class RequestRoutingService : RoutingServiceBase, IRequestRoutingService
{
private readonly IRequestCultureService _requestCultureService;
public RequestRoutingService(
IPublishedSnapshotAccessor publishedSnapshotAccessor,
IHttpContextAccessor httpContextAccessor,
IRequestStartItemProviderAccessor requestStartItemProviderAccessor,
IRequestCultureService requestCultureService)
: base(publishedSnapshotAccessor, httpContextAccessor, requestStartItemProviderAccessor) =>
_requestCultureService = requestCultureService;
/// <inheritdoc />
public string GetContentRoute(string requestedPath)
{
if (requestedPath.IsNullOrWhiteSpace())
{
return string.Empty;
}
requestedPath = requestedPath.EnsureStartsWith("/");
// do we have an explicit start item?
IPublishedContent? startItem = GetStartItem();
if (startItem != null)
{
// the content cache can resolve content by the route "{root ID}/{content path}", which is what we construct here
return $"{startItem.Id}{requestedPath}";
}
// construct the (assumed) absolute URL for the requested content, and use that
// to look for a domain configuration that would match the URL
Uri contentRoute = GetDefaultRequestUri(requestedPath);
DomainAndUri? domainAndUri = GetDomainAndUriForRoute(contentRoute);
if (domainAndUri == null)
{
// no start item was found and no domain could be resolved, we will return the requested path
// as route and hope the content cache can resolve that (it likely can)
return requestedPath;
}
// the Accept-Language header takes precedence over configured domain culture
if (domainAndUri.Culture != null && _requestCultureService.GetRequestedCulture().IsNullOrWhiteSpace())
{
_requestCultureService.SetRequestCulture(domainAndUri.Culture);
}
// when resolving content from a configured domain, the content cache expects the content route
// to be "{domain content ID}/{content path}", which is what we construct here
return GetContentRoute(domainAndUri, contentRoute);
}
}
@@ -0,0 +1,59 @@
using Microsoft.AspNetCore.Http;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Cms.Core.Models.PublishedContent;
using Umbraco.Cms.Core.PublishedCache;
using Umbraco.Extensions;
namespace Umbraco.Cms.Api.Delivery.Services;
internal sealed class RequestStartItemProvider : RequestHeaderHandler, IRequestStartItemProvider
{
private readonly IPublishedSnapshotAccessor _publishedSnapshotAccessor;
private readonly IVariationContextAccessor _variationContextAccessor;
// this provider lifetime is Scope, so we can cache this as a field
private IPublishedContent? _requestedStartContent;
public RequestStartItemProvider(
IHttpContextAccessor httpContextAccessor,
IPublishedSnapshotAccessor publishedSnapshotAccessor,
IVariationContextAccessor variationContextAccessor)
: base(httpContextAccessor)
{
_publishedSnapshotAccessor = publishedSnapshotAccessor;
_variationContextAccessor = variationContextAccessor;
}
/// <inheritdoc/>
public IPublishedContent? GetStartItem()
{
if (_requestedStartContent != null)
{
return _requestedStartContent;
}
var headerValue = RequestedStartItem()?.Trim(Constants.CharArrays.ForwardSlash);
if (headerValue.IsNullOrWhiteSpace())
{
return null;
}
if (_publishedSnapshotAccessor.TryGetPublishedSnapshot(out IPublishedSnapshot? publishedSnapshot) == false ||
publishedSnapshot?.Content == null)
{
return null;
}
IEnumerable<IPublishedContent> rootContent = publishedSnapshot.Content.GetAtRoot();
_requestedStartContent = Guid.TryParse(headerValue, out Guid key)
? rootContent.FirstOrDefault(c => c.Key == key)
: rootContent.FirstOrDefault(c => c.UrlSegment(_variationContextAccessor).InvariantEquals(headerValue));
return _requestedStartContent;
}
/// <inheritdoc/>
public string? RequestedStartItem() => GetHeaderValue("Start-Item");
}
@@ -0,0 +1,63 @@
using Microsoft.AspNetCore.Http;
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Cms.Core.Models.PublishedContent;
using Umbraco.Cms.Core.PublishedCache;
using Umbraco.Cms.Core.Routing;
using Umbraco.Extensions;
namespace Umbraco.Cms.Api.Delivery.Services;
internal abstract class RoutingServiceBase
{
private readonly IPublishedSnapshotAccessor _publishedSnapshotAccessor;
private readonly IHttpContextAccessor _httpContextAccessor;
private readonly IRequestStartItemProviderAccessor _requestStartItemProviderAccessor;
protected RoutingServiceBase(
IPublishedSnapshotAccessor publishedSnapshotAccessor,
IHttpContextAccessor httpContextAccessor,
IRequestStartItemProviderAccessor requestStartItemProviderAccessor)
{
_publishedSnapshotAccessor = publishedSnapshotAccessor;
_httpContextAccessor = httpContextAccessor;
_requestStartItemProviderAccessor = requestStartItemProviderAccessor;
}
protected Uri GetDefaultRequestUri(string requestedPath)
{
HttpRequest? request = _httpContextAccessor.HttpContext?.Request;
if (request == null)
{
throw new InvalidOperationException("Could not obtain an HTTP request context");
}
// construct the (assumed) absolute URL for the requested content
return new Uri($"{request.Scheme}://{request.Host}{requestedPath}", UriKind.Absolute);
}
protected static string GetContentRoute(DomainAndUri domainAndUri, Uri contentRoute)
=> $"{domainAndUri.ContentId}{DomainUtilities.PathRelativeToDomain(domainAndUri.Uri, contentRoute.AbsolutePath)}";
protected DomainAndUri? GetDomainAndUriForRoute(Uri contentUrl)
{
IDomainCache? domainCache = _publishedSnapshotAccessor.GetRequiredPublishedSnapshot().Domains;
if (domainCache == null)
{
throw new InvalidOperationException("Could not obtain the domain cache in the current context");
}
IEnumerable<Domain> domains = domainCache.GetAll(false);
return DomainUtilities.SelectDomain(domains, contentUrl, defaultCulture: domainCache.DefaultCulture);
}
protected IPublishedContent? GetStartItem()
{
if (_requestStartItemProviderAccessor.TryGetValue(out IRequestStartItemProvider? requestStartItemProvider) is false)
{
throw new InvalidOperationException($"Could not obtain an {nameof(IRequestStartItemProvider)} instance");
}
return requestStartItemProvider.GetStartItem();
}
}

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