Commit Graph

78 Commits

Author SHA1 Message Date
Jacob Overgaard
07b7c26fd9 Feature: Build static assets conditionally for Backoffice and Login (#17527)
* feat: conditionally install and build the 'login' and 'backoffice' targets depending on source files

* feat: remove the preconditions target, because we are now compiling a file list to check if we need to build

* feat: remove the 'clean' targets, because the project will be cleaned if any of the compiled file lists do not exist

* feat: remove the preserve.* files as they are no longer needed

* Enable default content items again

* Remove package.json from restore target inputs

* Include generated files as static assets after build

* Clean up project files

* Exclude CS0618 warning as error and fix CA2264

* Exclude CS0612 warning as error

* Suppress removal of test fixture

* Use separate property/item groups for backoffice and login project

---------

Co-authored-by: Ronald Barendse <ronald@barend.se>
2024-11-19 13:29:39 +01:00
Sebastiaan Janssen
4090829fe8 Ignore warnings about using obsolete members in Umbraco.Tests.UnitTests.csproj and Umbraco.Core.csproj
LocalFileSystemTemporaryFileRepository: Don't pass null to a method that doesn't accept nullable argument - https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2264
Fix remaining warning marked as error
2024-10-02 14:37:37 +02:00
Emma L Garland
ac575662ac Resolved more warnings, and marked more warning types as errors (#16991)
* Fix warnings SA1111, SA1028, SA1500, IDE1270  in Umbraco.Web.Website, and updated rules.

* Remove warnings: IDE0270: Null check can be simplified

* More SqlServer project warnings resolved

* CS0105 namespace appeared already

* Suppress warning until implementation:

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

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

Down to 3479 warnings

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

Specific warnings for Umbraco.Tests.Benchmarks

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

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

Fixed:

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

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

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

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

- Umbraco.Tests.UnitTests

Typo in `Umbraco.Web.Website` project

* Reverted test change

* Now 1556 warnings.

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

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

Comment formatting in project files for consistency.

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

* Type not var, and more warning exceptions

* Tweaked merge issue, readded comment about rollback

* Readded comment re rollback.

* Readded comments

* Comment tweak

* Comment tweak
2024-09-24 12:56:28 +01:00
Emma L Garland
98e9a300bc Treat warnings as errors for initial projects (#15019)
* Treat warnings as errors for Umbraco.Cms, Umbraco.Cms.Api.Common and Umbraco.Cms.Api.Delivery projects.

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

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

* Treat warnings as errors for Umbraco.Cms.Targets

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

* More projects with warnings as errors.

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

* Remove unwanted tag

* Removed warnings as errors on TestData project

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

* Reverted spaces

* Revert "Reverted spaces"

This reverts commit 3734c45e2270c3324768b33e459aefcc6a8c4739.

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

* Ignore PathToLongErrors for now in static assets

---------

Co-authored-by: Emma Garland <emma.garland@rocksolidknowledge.com>
Co-authored-by: Sven Geusens <sge@umbraco.dk>
2024-08-27 18:56:09 +02:00
Sven Geusens
742307dc32 [v14] backoffice user login providers endpoint (#16141)
* Added endpoint and backing service for backoffice login providers and the status per user.

* Improve link login redirect forming and error handling

* Add responseModel and mapping instead of returning core model

* Moved unlink endpoint logic into a service

* Refactored ExternalLinkLoginCallback logic into BackofficeExternalLoginService method

* typo and minor code style improvements

* async method name alignment

* Add BackOfficeExternalLoginService tests

* Remove helper method that makes less sense that thought.

* Minor formatting, clean-up and conventions

* Replaced cookie authentication in link-login with a short lived secret

Applied PR feedback

* Update openapi

* Changed link login to a form endpoint

* fix broken comment link

* Do not store claimsprinciple in secret + comments

* update redirect paths

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
Co-authored-by: kjac <kja@umbraco.dk>
Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>
2024-05-14 15:55:32 +02:00
Nikolaj Geisle
595ee242aa V14: Remove old backoffice project. (#15752)
* Move magical route to management api

* Move auth around

* Remove "New" cookies, as they are no longer needed

* Move all installer related

* Remove BackOfficeServerVariables.cs and trees

* Move webhooks to management api

* Remove remainting controllers

* Remove last services

* Move preview to management api

* Remove mroe extensions

* Remove tours

* Remove old Auth handlers

* Remove server variables entirely

* Remove old backoffice controller

* Remove controllers namespace entirely

* Move rest of preview

* move last services

* Move language file extension

* Remove old backoffice entirely (Backoffice and Web.UI projects)

* Clean up unused security classes

* Fix up installer route

* Remove obsolete tests

* Fix up DI in integration test

* Add missing property mapping

* Move core mapping into core

* Add composers to integration test

* remove identity

* Fix up DI

* Outcomment failing test :)

* Fix up remaining test

* Update mapper

* Remove the actual project files

* Remove backoffice cs proj

* Remove old backoffice from yml

* Run belissima before login

* Remove caching

* Refactor file paths

* Remove belle from static assets

* Dont refer to old project in templates

* update gitignore

* Add missing files

* Remove install view as its no longer used

* Fix up failing test

* Remove outcommented code

* Update submodule to latest

* fix build

---------

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2024-02-27 12:40:30 +01:00
Kenn Jacobsen
cc082e191c Clean up datatype configurations for V14 (#15718)
* Clean up datatype configurations for V14

* Fix merge

* Remove ParameterEditorCollection + revert accidental changes to core project file
2024-02-15 12:36:23 +01:00
Bjarke Berg
ddf9f05a8f Merge remote-tracking branch 'origin/v13/dev' into v14/dev
# Conflicts:
#	src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs
#	tests/Umbraco.Tests.AcceptanceTest/package-lock.json
#	version.json
2023-11-28 15:18:24 +01:00
Bjarke Berg
1f527fefd8 Merge remote-tracking branch 'origin/v12/dev' into v13/dev
# Conflicts:
#	build/azure-pipelines.yml
#	src/Umbraco.New.Cms.Infrastructure/Umbraco.New.Cms.Infrastructure.csproj
#	src/Umbraco.Web.UI.Client/package-lock.json
#	src/Umbraco.Web.UI.Client/package.json
#	tests/Umbraco.Tests.Integration/CompatibilitySuppressions.xml
2023-11-28 11:20:02 +01:00
Bjarke Berg
280518c9d6 Merge remote-tracking branch 'origin/v11/dev' into v12/dev
# Conflicts:
#	build/azure-pipelines.yml
#	src/Umbraco.Cms.ManagementApi/Umbraco.Cms.ManagementApi.csproj
#	src/Umbraco.Infrastructure/Logging/Viewer/LogViewerConfig.cs
#	src/Umbraco.Web.UI.Client/.nvmrc
#	src/Umbraco.Web.UI.Client/package-lock.json
#	src/Umbraco.Web.UI.Client/package.json
2023-11-28 09:39:31 +01:00
Bjarke Berg
ab781560bc Merge remote-tracking branch 'origin/v10/dev' into v11/dev
# Conflicts:
#	build/azure-pipelines.yml
#	src/Umbraco.Web.BackOffice/Controllers/ContentController.cs
#	src/Umbraco.Web.UI.Client/package-lock.json
#	src/Umbraco.Web.UI.Client/package.json
#	tests/Umbraco.Tests.AcceptanceTest/package-lock.json
2023-11-27 19:47:24 +01:00
Bjarke Berg
bf8af4588e Centralised NuGet packages (#15293)
* Moved to centralized nuget packages

* Handle JsonSchema

* Change PackageReference to PackageVersion

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

* ManagePackageVersionsCentrally = false

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

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

* change working directory

* workingDirectory

* Force the template to use local nuget packages

* Force the template to use local nuget packages

* clean up

* added wait on

* added wait on
2023-11-27 15:18:00 +01:00
Ronald Barendse
a77b77d98a Remove AngleSharp package reference 2023-11-21 10:51:02 +01:00
Bjarke Berg
5b3e9c580a Merge remote-tracking branch 'origin/v13/dev' into v14/dev
# Conflicts:
#	version.json
2023-11-16 09:12:01 +01:00
Bjarke Berg
65b7967fed Updated to .NET 8 final (#15204) 2023-11-15 09:29:50 +01:00
Bjarke Berg
fb55e1b244 Merge remote-tracking branch 'origin/v13/dev' into v14/dev
# Conflicts:
#	src/Umbraco.Core/DependencyInjection/UmbracoBuilder.cs
#	src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.Repositories.cs
#	src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs
#	src/Umbraco.Infrastructure/PropertyEditors/MultiUrlPickerValueEditor.cs
2023-11-14 13:22:10 +01:00
Bjarke Berg
80631e77c9 Post merge fixes with versions and updated nuget packages 2023-11-14 12:49:02 +01:00
Bjarke Berg
162a6a0085 Post merge 2023-11-14 09:39:39 +01:00
Bjarke Berg
cea6c3f20e Merge remote-tracking branch 'origin/v12/dev' into v13/dev 2023-11-14 09:31:25 +01:00
Bjarke Berg
fee9bf12c0 Updated nuget packages 2023-11-13 18:56:57 +01:00
Bjarke Berg
633f649be9 Merge remote-tracking branch 'origin/v11/dev' into v12/dev
# Conflicts:
#	src/Umbraco.Cms.ManagementApi/Umbraco.Cms.ManagementApi.csproj
#	src/Umbraco.Infrastructure/Cache/DistributedCacheBinder_Handlers.cs
2023-11-13 18:40:11 +01:00
Bjarke Berg
74cfd9c9a0 Updated nuget packages 2023-11-13 18:38:15 +01:00
Bjarke Berg
d6751e2832 Merge remote-tracking branch 'origin/v10/dev' into v11/dev
# Conflicts:
#	version.json
2023-11-13 18:30:50 +01:00
Bjarke Berg
e5de8bf56b Updated nuget packages (#15192) 2023-11-13 14:59:52 +01:00
Bjarke Berg
e147c93cf9 Merge remote-tracking branch 'origin/v13/dev' into v14/dev
# Conflicts:
#	Directory.Build.props
#	build/azure-pipelines.yml
#	src/Umbraco.Cms.Api.Common/DependencyInjection/UmbracoBuilderAuthExtensions.cs
#	src/Umbraco.Cms.Api.Common/OpenApi/SwaggerRouteTemplatePipelineFilter.cs
#	src/Umbraco.Cms.Api.Common/Security/Paths.cs
#	src/Umbraco.Cms.Api.Delivery/Controllers/Security/MemberController.cs
#	src/Umbraco.Cms.Api.Delivery/DependencyInjection/UmbracoBuilderExtensions.cs
#	src/Umbraco.Cms.Api.Delivery/Handlers/InitializeMemberApplicationNotificationHandler.cs
#	src/Umbraco.Cms.Api.Delivery/Handlers/RevokeMemberAuthenticationTokensNotificationHandler.cs
#	src/Umbraco.Cms.Api.Delivery/Security/MemberApplicationManager.cs
#	src/Umbraco.Cms.Api.Delivery/Services/RequestMemberAccessService.cs
#	src/Umbraco.Cms.StaticAssets/umbraco/UmbracoBackOffice/Default.cshtml
#	src/Umbraco.Cms.StaticAssets/umbraco/UmbracoLogin/Index.cshtml
#	src/Umbraco.Core/Constants-OAuthClaims.cs
#	src/Umbraco.Core/Constants-OAuthClientIds.cs
#	src/Umbraco.Core/DeliveryApi/IApiContentQueryProvider.cs
#	src/Umbraco.Core/DeliveryApi/IApiContentQueryService.cs
#	src/Umbraco.Core/DeliveryApi/IRequestMemberAccessService.cs
#	src/Umbraco.Core/DeliveryApi/NoopRequestMemberAccessService.cs
#	src/Umbraco.Core/Models/DeliveryApi/ProtectedAccess.cs
#	src/Umbraco.Core/Services/ITagService.cs
#	src/Umbraco.Core/Services/UserService.cs
#	src/Umbraco.Infrastructure/Security/IMemberApplicationManager.cs
#	src/Umbraco.Infrastructure/Security/OpenIdDictApplicationManagerBase.cs
#	src/Umbraco.Web.BackOffice/Controllers/BackOfficeController.cs
#	src/Umbraco.Web.BackOffice/Controllers/MediaController.cs
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/HelpPanel/systemInformation.spec.ts
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Login/login.spec.ts
#	version.json
2023-10-26 09:48:05 +02:00
Nikolaj Geisle
8dff55fced Update nuget packages (#15039)
* Update nuget packages

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

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

* dont add private/include assets

* Remove duplicate serilog reference

* Revert Moq update

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

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2023-10-26 09:01:29 +02:00
Bjarke Berg
ac8663ea13 Merge remote-tracking branch 'origin/v13/dev' into v14/dev 2023-09-19 13:02:53 +02:00
Bjarke Berg
989759fa20 Updated NuGet Dependencies (#14795)
* Updated nuget packages and fixed breaking changes in ImageSharp

* Update to .net8 rc1
2023-09-19 11:23:20 +02:00
Bjarke Berg
ffa664f217 Merge remote-tracking branch 'origin/v13/dev' into v14/dev 2023-09-04 10:45:50 +02:00
Bjarke Berg
134ec4ece9 Merge remote-tracking branch 'origin/v12/dev' into v13/dev 2023-09-04 10:30:56 +02:00
Nikolaj Brask-Nielsen
fdb0bed960 test: Simplify test project references 2023-08-28 11:08:06 +02:00
Bjarke Berg
fb3ead87b8 Post merge fixes 2023-08-15 11:18:10 +02:00
Bjarke Berg
822d57135e Merge remote-tracking branch 'origin/v13/dev' into v14/dev
# Conflicts:
#	src/Umbraco.Cms.Persistence.EFCore/Composition/UmbracoEFCoreComposer.cs
#	src/Umbraco.Infrastructure/PropertyEditors/BlockEditorValues.cs
#	src/Umbraco.Web.UI.Docs/gulpfile.js
2023-08-15 11:14:00 +02:00
Bjarke Berg
843d41e564 Update .net 8 to preview 7 2023-08-09 15:53:31 +02:00
Bjarke Berg
d9f528f3ae Post merge fixes 2023-08-08 12:19:29 +02:00
Bjarke Berg
2839131033 Merge remote-tracking branch 'origin/v13/dev' into v14/dev 2023-08-08 12:10:18 +02:00
Bjarke Berg
dce320839c Updated .net 8 to preview 6 2023-08-08 12:05:53 +02:00
nikolajlauridsen
28dae0387f Merge remote-tracking branch 'origin/v12/dev' into v13/dev
# Conflicts:
#	Directory.Build.props
2023-07-21 10:20:08 +02:00
Bjarke Berg
47d5ef88c4 Post merge fixes - Including temp workaround for .net8 efcore breaking change (Should be fixed again in preview 7) 2023-07-07 10:55:29 +02:00
Bjarke Berg
41805af0d9 Updated the package validation baseline version to 12.0.0 (#14389)
* Updated the package validation baseline version to 12 RC1

* Update PackageValidationBaselineVersion to 12.0.0 and remove CompatibilitySuppressions.xml files

* Clean up project files

---------

Co-authored-by: Ronald Barendse <ronald@barend.se>
2023-07-06 07:51:49 +02:00
Bjarke Berg
0ad0f86e6e Update to dotnet 8 preview 5 (#14492)
* Update to .net 8 preview 1

* Update npoco to 5.7.0

* Update pipeline to use .net 8

* Revert "Update npoco to 5.7.0"

This reverts commit f7795afa77a41ef2719f639405f73d9c21e4b12e.

* Fix tests and updated OpenApi.json

* use dotnet 8 in linux container

* Updated templates and docker image to dotnet 8

* Bugfix

* R
Updated docker images to 8.0 preview 1

* linux docker images updated

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

* Do not use C# 8 :)

* Update to preview 2

* CompatibilitySuppressions

* updated templates

* Disable package validation

* Update to .net8 preview 4

* change EnableStrictModeForCompatibleFrameworksInPackage to false

* Package validation

* Added CompatibilitySuppressions.xml

* Fix up IP networks

* Updated to preview 5

* Update docker images

* Post merge fixes

* Try to update dotnet version of codeql

* Delete empty suppression files

* Remove dependency

* Cleanup

---------

Co-authored-by: Elitsa <elm@umbraco.dk>
2023-07-05 14:13:52 +03:00
Bjarke Berg
54479c9538 Updated nuget packages to latest versions (#14419) 2023-06-20 12:21:16 +02:00
Nikolaj Geisle
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
Bjarke Berg
0f1c2f7022 Ensure no management api for v12 (#14197)
* Remove management api

* Remove actual files
2023-05-04 13:32:41 +02:00
Bjarke Berg
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 78e1f748e55383baecd123d06457111e18f13365.

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

This reverts commit a0292ae5350362dd6c1c5bc9763deda928c78a75.

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

This reverts commit 6b7c37a5bf7871bee93a2b2640bbc6ef591f14db.

* 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 78e1f748e55383baecd123d06457111e18f13365.

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

This reverts commit a0292ae5350362dd6c1c5bc9763deda928c78a75.

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

This reverts commit 6b7c37a5bf7871bee93a2b2640bbc6ef591f14db.

* 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
Bjarke Berg
be2887683b Merge remote-tracking branch 'origin/v11/dev' into v12/dev 2023-04-04 09:18:03 +02:00
Bjarke Berg
ce47281c04 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:44:56 +02:00
Bjarke Berg
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
Bjarke Berg
317891e8cf Merge remote-tracking branch 'origin/v11/dev' into v12/dev 2023-02-08 12:28:32 +01:00
Bjarke Berg
e3135bd97e Updated nuget dependencies (#13787) 2023-02-06 14:58:48 +01:00