* 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
* 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>
* Use require modifier instead of setting null-suppressed default values
* Only remove read-only properties when IgnoreReadOnlyProperties is set
* Obsolete UmbracoPath property and remove work-around for obsolete setter
* Updated nuget packages + added migrations for OpenIddict - Currently can only be executed using unatttended installs
* Added new Premigration concept - Migrations that always runs unattended before other migrations
* Apply suggestions from code review
Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
---------
Co-authored-by: Zeegaan <skrivdetud@gmail.com>
Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
* Added UserData and migrated tours data into it
* Remove tourdata from user
* Removed tour definition/manipulation classes
Fixed a userData error typo
* Removed toursettings
* Update openapi spec
* V13: Align database schemas of migrated and new database (#15934)
* Drop default constraint umbracoCacheInstruction table
* Align umbracoContentVersion table
* Update indexes on external login table
* Align node table
* Make relation type index unique
* Remove user-group default constraint
* Re-order methods
* Make webhook url not nullable
* Cleanup
* Cleanup
* Update OpenApi.json
* Update src/Umbraco.Cms.Api.Management/Controllers/UserData/UserDataControllerBase.cs
* Remove tour settings from schema
* Add cancelation tokens
* Dont inject, but take as parameter
* Remove some from injection
* Update schema
---------
Co-authored-by: Sven Geusens <sge@umbraco.dk>
Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>
Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
Co-authored-by: Zeegaan <skrivdetud@gmail.com>
* Use version overrides for ImageSharp 2
* Move Directory.Packages.props to root, use GlobalPackageReference and replace Microsoft.CSharp with Microsoft.CodeAnalysis.CSharp
* Replace NPoco.SqlServer with NPoco and remove unused System dependencies
* Fix package validation and MSBuild warnings
* Add nuget.config and enable package source mapping
* Remove explicitly set C# language version
* Add empty Directory.Packages.props file for acceptance test
* Downgrade SixLabors.ImageSharp back to 3.0.2 because of breaking changes
* Update ImageSharp/ImageSharp.Web to 3.1.0 and use ComputeHMAC
* Create webhook models
* Define interfaces for service and repository
* Create Webhook dto and corresponding factory
* implement WebhookRepository.cs
* Remove entity name from models, as that should be resolved in mapping instead
* Add new table to schema creator
* Register repo for DI
* Remove more mentions of entityname
* Refactor repository to guids
* Implement WebhookService
* Use scopes in service
* Start creating tests for service
* Refactor delete to use Id and not entire entity
* Rework Webhooks to be able to have multiple entity keys
* Implement GetAll functionality
* Implement webhook controller
* Imeplement get all events action
* Add equalityComparer deletegate to Webhook
* Add datacontract attirbutes to properties
* Implement backoffice webhooks tree
* Implement first webhooks menu
* Make WebHookController authorized
* Update to have tabs with webhooks and logs
* Enable create overlay
* Push to entityKeys array
* Fix up pagination
* Implement delete functionality
* remove pagination
* add log view
* Fix create to be able to select more than one content type
* implement type name resolving for content
* Refactor to use less duplication
* Implement update functionality in frontend
* Rename database table
* Make multiple events possible
* create new event picker
* Refactor to actually add new database table with proper name
* Make it possible to select multiple events
* Fix updating current items
* Fix up update functionality after db rework
* Add webhook icon
* Switch to match heartcore icons
* Refactor to use bases instead of Enum
* Refactor to make IWebhookEvent to Collection, so it can be injected instead of using reflection
* Fix up frontend to match new models
* Fix integration tests
* Remove obsolete entity key from webhookdto
* Introduce constants instead of hard coded strings
* Start implementation of firing mechanism
* Add new GetByEventName method
* Add 1 to many list on WebhookDto
* Implement new repository pattern
* Implement GetByEventName
* Fix up repository to use all async
* Refactor events to fire
* Refactor WebhookEvents to be more DRY
* Add custom header
* Start implementing log repository
* Implement GetPaged
* Implement WebhookLogService
* Implement GetLogs
* Add url to webhook log
* Implement log overview
* Formatting
* Implement details view
* Refactor to get actual retry count
* Refactor firing to fire only when Enabled
* Add Status code to detailed view
* Add configuration to disable webhooks entirely
* Implement custom headers frontend
* Implement persistence of custom headers
* Refactor retry service to also retry on non success status codes.
* Refactor registration of Webhooks, to also register as NotificationHandler
* Add webhooks migration
* Add key for adding webhook headers
* Fix up test
* Change event icon to flag
* Remember event, when editing what events you have chosen
* Refactor reflection to check if INotificationAsyncHandler instead
* Formatting
* Refactor webhook model to no longer derive from EntityBase
* Rename entityKeys to content keys
* Rename controller to lowercase H
* Add null check before trying to access selectedEvents
* Add configuration for maximum number of retries
* Add index to date
* Add webhook Key to logs
* Check for SchedulingPublisher before sending webhooks
* rename requestObject to payload
* Refactor event to send appropriate payloads
* Refactor logging to happen for every try.
* Order date by descending
* Add todo
* Change firing service to use String not ByteContent
* Update Headers to Interface instead of concrete implementation
* Dont return if a table exists already
* Rename updateModel to webhook
* Annotate WebhookController.cs with PluginController attribute
* Add danish translations
* Do not check if fail
* Dont filter when selecting custom items
* Remove delay from WebhookFiringService
---------
Co-authored-by: Zeegaan <nge@umbraco.dk>
* 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>