* Adds new functionality to the migrations.
This requires a migration to call Context.SetDone() on the migration context. This happens automatically on scoped migrations before the scope is completed. But migrations inheriting the UnScopedMigrationBase needs to call this manually, inside the scopes or when it is considered done.
Thereby, we minimize the risk (and eliminate it for SqlServer) that a migration is executed but the state is not saved.
If a migration is executed without the SetDone is called, the migration upgrader throws an error, so we do not start executing the next migration
* Updated tests
* Renamed after review suggestion
* Rename in test
* More renaming after review
* Remove public modifier from interface
* Add missing space in exception message
---------
Co-authored-by: nikolajlauridsen <nikolajlauridsen@protonmail.ch>
* Do not add index if it already exists
* Add the JsonObjectConverter by default. This is required by the block editor
* Update test to reflect that fact we have the json object converter applied
* Implement using keymap for member
* Remove current usages of GetUserById
* User userId resolver to resolve user key
* Refactor user repository to use GUID not int
* Add happy path test
* Remove user in cache when user gets updated
* Use await in async method
* Fix up according to review
* Update IMetricsConsentService.cs to have async method
* Fix according to review
* Fix more according to comments
* Revert "Fix up according to review"
This reverts commit a75acaaa
* Get current backoffice user from method
* Update user repository delete functionality
* Fix up more test
* Try to get user by id if key fails
* Add user key as required claim
* Fix tests
* Don't set claim in BackofficeController
* Create constant for the Sub claim
---------
Co-authored-by: kjac <kja@umbraco.dk>
* Update JsonUdiConverter to support Udi, GuidUdi and StringUdi types
* Require boolean (like) value and rename to JsonFuzzyBooleanConverter
* Add read/write only JsonConverters and align naming
* Rename SystemTextJsonSerializer to DefaultJsonSerializer
* Rename SystemTextConfigurationEditorJsonSerializer to DefaultConfigurationEditorJsonSerializer
* Add JsonUdiRangeConverter
* Rename JsonFuzzyBooleanConverter back to JsonBooleanConverter
* Fix value type check in JsonObjectConverter
* Revert class names
* Updated tests
* Post fix after merge.
---------
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
* Align FromArtifact return type with IDataType.ConfigurationData
* Align Alias nullability with interface
* Lazily initialize ArtifactDependency collection when not set
* Remove ShouldSerializeChecksum (not used by STJ)
* Remove obsolete methods and default interface implementations
* Order dependencies once when setting collection
* Update test to include artifact Checksum property
* Move manifests to their own API group and fix access policies
* Update OpenApi.json
* add an endpoint to fetch "private" packages, i.e. AllowPublicAccess=false
* Review comments
* update OpenAPI.json
* update OpenApi.json
* allow /umbraco/logout to be used for PostLogoutRedirectUris when logging out through the management api
* use the Umbraco.Extensions string extensions instead
* add constraints to the BackofficeDefaultController to handle the cases of 'install', 'upgrade', and 'logout'
---------
Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>
* Obsoletions related to Delivery API
* Fix TypeLoader and TypeFinder tests
* Remove obsolete and default implementations of IFileSource and IFileTypeCollection
* More Delivery API related obsoletions
* VariationContextAccessor related
* ValueFactories obsoletion and fix references
* ValueSetBuilders obsoletions
* ValueConverters obsoletions
* Other obsolete ctors and methods
* Forgotten VariationContextAccessor obsoletion
* More obsoletions
* XPath related obsoletions
* Revert XmlHelper changes
* Delete RenamedRootNavigator and its tests
* Fix test
* XmlHelper obsoletion
* Return null instead of GetXPathValue
* Obsolete entire class instead
* Remove XPath obsoletions from IPublishedCache
* Remove XPath-related if-block that is no longer needed
* Change obsolete msg for classes needed for NuCache
* Moving classes to NuCache and making them internal
* Remove more XPath-related obsoletions
* Remove NavigableNavigator and its tests
* Cleanup
* Remove Xpath references from tests
* Revert interface deletion in MediaCache
* Using XOR operation
Co-authored-by: Nuklon <Nuklon@users.noreply.github.com>
---------
Co-authored-by: Nuklon <Nuklon@users.noreply.github.com>
* Rename/Move/duplicate PaginationService to facilitate conversion closer to the data layer
Duplication is because of internal modifier as we don't want to expose these temporary classes
* Move Guid to Int Extensions into core + add unittests
* Added Document version endpoints
Updated used services to use async methods
* Moved PaginationConverter into core so it can be used by the service layer
* Endpoint structure improvements
* Updating OpenApi.json
* Add greedy constructors for contentService tests
* Namespace changes and naming cleanup
* Update openapispec again...
* Refactor injected services
* PR suggestion updates
- Move endpoints into their own structural section as they are also in a different swagger section
- Naming improvements
- Allign PresentationFactories with similar classes
- Cleanup unused assignments
- Cleanup refactoring comments
- Improve obsoletion remarks
* Cleanup
* ResponseModel improvements
* OpenApi spec update
---------
Co-authored-by: Sven Geusens <sge@umbraco.dk>
Co-authored-by: Elitsa <elm@umbraco.dk>
* Remove explicit parent context in API outputs
* Add ancestor endpoints for document and data type (experimental for now)
* Add ancestor endpoints for doctypes, media, mediatypes, partial views, scripts, static files, stylesheets and templates
* Add unit tests for ancestor ID parsing
* Add ancestor endpoint for dictionary items
* Update OpenApi.json
* Fix merge and regenerate OpenApi.json
* Regenerate OpenApi.json
* Rename "folder" to "parent" for consistency
* Fix merge
* Fix merge
* Include "self" in ancestor endpoints
* Handle ancestors for root items correctly
* Remove "type" from recycle bin items
* Tests against fixed values instead of calculated ones.
---------
Co-authored-by: Sven Geusens <sge@umbraco.dk>
* Workaround for failing entity tree children
* Fix typo from original PR
* Expose and actually use GetPagedTrashedChildren on EntityService (the default implementation on the interface is currently used).
* Ensure that ID/Key mapping for recycle bins work
* [WIP] Stop Udi leaking on ConterPicker
* Refined Udi conversion for contentPicker
Cleaned up base construcor usage to move away from the obsoleted one.
* Fixed Udi lieaking in MNTP
* Stopped Udi bleeding for MultiUrlPicker
* Remove unused assignment
* Resolved namespace issue
* Use correct configuration value for MNTP udi parsing
* Turn helper auto props into local helper function to avoid unnecesary serialization
* Remove Newtonsoft.Json from Multi URL picker
* Fixed MNTP configuration serialization
* Changed MNTP editor data from csv guid to EditorEntityReference[]
* Added remarks for the MNTP editor conversion logic
* Reworked MNTPPropertyEditor Unittests
changed intent of one
fixed bug because of 1 rework
* Update OpenApi.json
---------
Co-authored-by: Sven Geusens <sge@umbraco.dk>
Co-authored-by: Elitsa <elm@umbraco.dk>
Co-authored-by: kjac <kja@umbraco.dk>
* add checkboxlist to the list of migrations that should be converted
* Adds string-array type-checking
to the `ValueListUniqueValueValidator`.
As `value?.ToString()` would give you a literal string of the
object-type, e.g. `"System.Collections.Generic.List`1[System.String]"`.
* Clean up and add tests
---------
Co-authored-by: leekelleher <leekelleher@gmail.com>
Co-authored-by: kjac <kja@umbraco.dk>
* Migrate ObjectJsonExtensions
* Use more generic exception to not use Newtonsoft
It should matter if it's a JsonReaderException, if we can't read we can't read
* Remove obsoleted constructors
* Use more generic exception in ContentValueSetBuilder
* Fix constructors
* Remove UdiRangeJsonConverter
* Remove more legacy newtonsoft stuff
* Migrate away from newtonsoft in CacheInstructionService
* Remove unused model binders
* Remove more newtonsoft
* Remove newtonsoft from DatabaseServerMessenger
* Remove now irrelevant benchmark
* Remove the usage of Newtonsoft from ImageCropperTemplateCoreExtensions
The value converter will never return JObject, JsonDocument, or JsonNode
* Remove usages of newtonsoft in ComplexPropertyEditorContentNotificationHandler
JTokens are no longer returned, so we don't need to check for it
* Remove newtonsoft references
* Re-add newtonsoft dependency to Umbraco.Tests.Common
* Fix package references
* move dependency
---------
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
* Removes lots of files used by the old backoffice and that is not needed for the management api
* A little clean-up
---------
Co-authored-by: kjac <kja@umbraco.dk>
* It builds..
* Added granular permissions
* Added granular permissions
* Rename content to document
* Added migration
* Fixed issues causing the migration from v13 was not possible.
* Merged Permissions and Granular Permissions in viewmodel
* Prepared the viewmodel to a future where permissions can be more types.
* OpenApi
* Allow to translate a single char to many strings
* Use frontend friendly values for known permissions
* Validate the documents exist
* Allow setting non-document settings
* Add "$type" when required
* Rename to presentation model and update OpenApi.json
* OpenApi.json
* Fix tests
* OpenAPI
* Fixed issues with upgrades
* Add the discriminator name
* Fixed issues that only happended on SqlServer
* Fixed queries for SqlServer
* Clean up
* More cleanup
* Fix issue when migrating sqlserver
* Split fallback permissions into own concept in view model
* Also split on current user
* Added a extenable pattern for mappers between DTO => Granular Permission => ViewModel and ViewModel => Granular Permission
* Fixed issue with new exists method, that did not take duplicate keys into account.
* Added sections to current user response model
* Formatting fixes
* Move class to its own file
* xml comment
---------
Co-authored-by: Zeegaan <skrivdetud@gmail.com>
* 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>
* Force system text json for IJSonSerializer
* Migrate ColorPickerValueConverter
* Move ColorPickerValueConverter
* Clean up ColorPickerValueConverter
* Remove obsoleted property editors
* Migrate FlexibleDropdownPropertyValueConverter to System.Text.Json
* Use IJsonSerializer instead and move the value converter to Core
* Migrate ImageCropperValueConverter to System.Text.Json
* Inject jsonserializer in test and obsolete old constructor
* Migrate JsonValueConverter to System.Text.Json
* Remove ContextualConfigurationEditorJsonSerializer
* Remove JsonNetSerializer
* Remove obsolete DeserializeSubset from JsonSerializer interface
* Fix FlexibleDropdownPropertyValueConverter
* Update test JSON to be actual valid json
* Update more test json
* Update time format to be valid
* Add JsonPropertyName to models
* Replace all IsContainer mentions with new ListView property
* Map the list view when creating and updating
* Implement list view migration
* Refactor listview to collection
* Do not assign listview if IsContainer is false
* Fix up HasContainerInPath query
* Update OpenApi.json
* fix up according to review
* Refactor duplicate code to use extension method instead
* Dont make new guid, check for null
* Make extension internal
* Fix up after merge
* Use ReferenceById static method instead of extension
* Only use datetimeoffset in API
* Updated publish endpoint to take schedule information
* Fixed test builds
* OpenApi updates
* Update OpenApi schema
* Fixed issues with publishing.
* Added validation before publishing. Had to move a lot of classes to core.
* added missing files
* Added validation info to error
* Typo
* Clean up and adding missing result
* Updating to AvailableCultures instead of PublishedCultures
* Handle time needs to be in the future
* validate only cultures that needs to be published
* Fix typos
* Filter out cultures that we are not trying to publish from the validation errors
* Don't filter out only the available cultures, to accommodate non-created variants
* Only allow publish of existing cultures
* Fixed issues found in test
* fixed build
---------
Co-authored-by: Elitsa <elm@umbraco.dk>
* Introduced IDataTypeConfigurationCache
* Applied IDataTypeConfigurationCache to Property Editors and display mapping
* Invalidate new cache trough DataTypeConfigurationCacheRefresher
* Improve IDatatype service to use cached int path when fetching by guid (using idkeymap)
---------
Co-authored-by: Sven Geusens <sge@umbraco.dk>
Co-authored-by: Ronald Barendse <ronald@barend.se>
* register a new IPackageManifestReader to allow to scan the /umbraco/backoffice path for umbraco packages
* add constant
* add logic to extract the importmap from umbraco package manifests
* add html helper to render an importmap
* replace static importmap with new dynamic importmap
* update tests and be more specific about scopes
* remove recursion from PackageManifestReader.cs
* add extra test to validate the importmap
* combine all string manipulation to produce an importmap into HtmlHelperBackOfficeExtensions.cs
* rename IStaticFileHostGenerator to something reflecting its actual usage, and also fix the file names
* use auto properties where applicable
* add getter for BackOfficeHash and use to simplify BackofficeAssetsPath
* ensure BackOffice is always spelled with capital O
* add a way to replace the cachebuster for assets imported through an importmap and ensure magic strings are encapsulated into business logic or constants
* Review changes
* convert primary constructors to explicit and add comments
* convert primary constructor to explicit
---------
Co-authored-by: kjac <kja@umbraco.dk>
* Create system text serializer
* Assign property names with system text
* Use the new serializer
* Impement AutoInterningStringConverter with System.Text.Json
* Implement TextAutoInterningStringKeyCaseInsensitiveDictionaryConverter
* Make CaseInsensitiveDictionaryConverter
* Force datetimes to be read as UTC
* Remove usages of Newtonsoft.Json
* Remove text prefixes
* Remove unused Newtonsoft converter
* Remove more newtonsoft
* Remove duplicate implementation
* Rmove usage of missing class in tests
* Ignore null values
* Fix tests
* Remove Newtonstoft reference from NuCache
---------
Co-authored-by: Elitsa <elm@umbraco.dk>
* Re-modelling API models (take two)
* Do not use "content" - use "document" and "media" instead.
* Move "item" endpoints to their own silo
* Use "Id", not "Key"
* Regenerate OpenApi.json
* Rename user start node IDs from "content" to "document"
* Regererate OpenApi.json after forward merge
* update importmap
---------
Co-authored-by: Mads Rasmussen <madsr@hey.com>