* Adding migration to update the default GUID value of created packages
* Updating the GUID if it is the default value when a package is saved
* Adding PackageDefinitionViewModel for representing a package
* Adding a mapping for package representation
* Adding PackageControllerBase, GetAllCreated and GetEmpty endpoints
* Adding GetCreatedByKey endpoint
* Adding GetByKey implementation for created packages
* Include MapAll comment
* Adding Download package endpoint
* Saving created package endpoint
* Adding a factory to create a PackageDefinition from view model
* Cleanup
* Fix error message
* Check for duplicate package name
* Remove commented out DuplicateNameException
* Moving created packages to /created folder/base
* Implement delete endpoint
* Update OpenApi.json
* Fix package route
* Fix OpenApi.json
* Add Ok() around the result
* Create PackageBuilderExtensions
* Adding suppression changes
* Cleanup
* Use ProblemDetailsBuilder
* Extract collecting installed packages from package migration plans into its own method
* Use GetInstalledPackagesFromMigrationPlans to return all migration statuses
* Add Status to DictionaryControllerBase ProblemDetails
* Implement RunMigrationPackageController
* Adding more information to the log message
* Update OpenApi.json
* Change param name
* Fix OpenApi.json
* Fix response type for Log viewer endpoint
* Remove EmptyPackageController
* Rename to RunPendingPackageMigrations
* Introduce new PackageOperationStatus
* Making methods async and introducing new Create, Update and Delete methods
* Fix async calls
* Fix Mapper - multiple enumeration and cleanup
* Creating special action models
* Fixing the factory with new models changes
* Service implementation changes
* Removing SaveCreatedPackageController as the functionality is split between Create and UpdateCreatedPackageController
* Utilize the new DeleteCreatedPackageAsync
* Refactor DownloadCreatedPackageController as some responsibility is moved to the service
* Refactor PackagingService to use auditService
* Refactor PackagingService to use skip/take
* Refactor services to return pagedmodel
* Refactor controller to use new return value
* update OpenApi.json
---------
Co-authored-by: Zeegaan <nge@umbraco.dk>
* Implement AuditLogByTypeViewModel
* Add GetLogs endpoint
* Implement AuditLogViewModelFactory and use it
* Remove mapping and do that in ViewModelFactory
* Add Skip take pagination to AuditService.cs
* Get entity key from repository
* Only create filter if sincedate has value
* Refactor to handle enitity not being found
* Add by type route
* Rename AuditLogViewModel.cs
* Add CreateAuditLogWithUsernameViewModel method to factory
* Rename method in factory
* Fix up controllers to use async service
* Refactor to use pagedModel
* Update sincedate query
* Add FIXME
* Move entity call in scope
* Rename methods to async
* Update src/Umbraco.Core/PaginationHelper.cs
* Refactor to use IActionResult
* Audit log in two words
* Fix up by key
* Fix routing
* Fix ByType
* Update ByType routing
* Refactor to also pass DateStamp
* Add Key to WithUserNameViewModel
* Refactor extension method to call new GetAsync method
* use new GetAsync method
* Rename models and implement base class
* Update OpenApi.json
---------
Co-authored-by: Zeegaan <nge@umbraco.dk>
Co-authored-by: Nikolaj <nikolajlauridsen@protonmail.ch>
* Add MSSQL migration
* Make upgrade possible when user doesn't have a key yet
* Migrate SQLite
* Migrate the external login column
* Fix logging in after migration
* Handle fake GUID correctly
* Make GetByKey async
* Resolve external logins by key instead of id
* Remove usage of naive UserIdToInt
* Dont use ToGuid for property type defaults
* Use constant GUID for user groups
* Ensure that the same GUID is used to create the root user.
* Add migration for two factor logins
* Add default implementations
* Fix unit test
* Remove TODO
* Fix integration tests
* Add default implementation instead of throwing
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
* Make SQLServer migration idempotent
* Add comment about SQLite
* Fix typo
---------
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
* Add key to UserGroupDto
* Fix renaming table in sqlite
The SqliteSyntaxProvider needed an overload to use the correct query
* Start work on user group GUID migration
* Add key index to UserGroupDto
* Copy over data when migrating sqlite
* Make sqlite column migration work
* 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
* Use unscoped migration for adding GUID to user group
* Make sqlite migration work
It's really not pretty, square peg, round hole.
* Don't re-enable foreign keys
This will happen automatically next time a connection is started.
* Scope database when using SQLServer
* Don't call complete transaction
* Tidy up a couple of comment
* Only allow scoping the database from UnscopedMigrationBase
* Fix comment
* Remove remark in UnscopedMigrationBase as it's no longer true
* Add keys when creating default user groups
* Map database value from DTO to entity
* Fix migration
Rename also renamed the foreign keys, making it not work
* Make migration idempotent
* Fix unit test
* Update CompatibilitySuppressions.xml
* Add GetUserGroupByKey to UserService
* Add ByKey endpoint
* Add UniqueId to AppendGroupBy
Otherwise MSSQL grenades
* Ensure that languages are returned by PerformGetByQuery
* add POC displaying model
* Clean up by key controller
* Add GetAllEndpoint
* Add delete endpoint
* Use GetKey to get GUID from id
Instead of pulling up the entire entity.
* Add UserGroup2Permission table
* Fetch the new permissions when getting user groups
* Dont ToString int to parse it to a short
I'm pretty sure this is some way old migration type code that doesn't make any sense anymore
* Add new relation to GetDeleteClauses
* Persist the permissions
* Split UserGroupViewModel into multiple models
This is to make it possible to make endpoints more rest-ish
* Bootstrap create and update endpoints
* Make GetAllUserGroupController paged
* Add method to create IUserGroup from UserGroupSaveModel
* Add sanity check version of endpoint
* Fix persisting permissions
* Map section aliases to the name the frontend expects
This is a temporary fix till we find out how we really want to handle this
* Fix up post merge
* Make naming more consistent
* Implement initial update endpoint
* Fix media start node
* Clean name for XSS when mapping to IUserGroup
* Use a set instead of a list for permission names
We don't want dupes
* Make permission column nvarchar max
* Add UserGroupOperationStatuses
* Add IUserGroupAuthorizationService
* Add specific user group creation method to user service
* Move validating and authorizing into its own methods
* Add operation result to action result mapping
* Update create controller to use the create method
* Fix create end point
* Comment out getting current user untill we have auth
* Add usergroup service
* Obsolete usergroup things from IUserService
* Add update to UserGroupService interface
* User IUserGroupService in controllers
* User async notifications overloads
* Move authorize user group creation into its own service
* Add AuthorizeUserGroupUpdate method
* Make new service implementations internal and sealed
* Add update user
* Add GetAll to usergroup service
* Remove or obsolete usages of GetAllUserGroups
* Add usergroup service to DI
* Remove usage of GetGroupsByAlias
* Remove usages of GetUserGroupByAlias
* Remove usage of GetUserGroupById
* Add new table when creating a new database
* Implement Delete
* Add skip and take to getall
* Move skip take into the service
* Fixup suggestions in user group service
* Fixup unit tests
* Allow admins to change user groups they're not a part of
* Add CompatibilitySuppressions
* Update openapi
* Uppdate OpenApi.json
again
* Add missing compatibility suppression
* Added missing type info in ProducesResponseTypeAttribute
* Added INamedEntityViewModel and added on the relevant view models
* Fixed bug, resulting in serialization not being the same as swagger reported. Now all types objects implementing an interface, is serialized with the $type property
* updated OpenApi.json
* Added missing title in notfound response
* Typo
* .Result to .GetAwaiter().GetResult()
* Update comment to mention it should be implemented on CurrentUserController
* Validate that start nodes actually exists
* Handle not found consistently
* Use iso codes instead of ids
* Update OpenAPI
* Automatically infer statuscode in problemdetails
* Ensure that the language exists
* Fix usergroup 2 permission index
* Validate that group name and alias is not too long
* Only return status from validation
We're just returning the same usergroups, and this is less boilerplate code
* Handle empty and null group names
* Remove group prefix from statuses
* Add some basic validation tests
* Don't allow updating a usergroup to having a duplicate alias
---------
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
* 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>
* Added missing PropertyIndexValueFactories, for Block Grid, Block List, Nested Content, Tags and added No-op for image picker, image cropper etc, where the content dont make any sense anyway.
Made it replace for block grid/list, nested content and tags
* Fixed tests
* Ensure raw-fields are the prefix
* Code clean up
* build fix
* Minor cleanup
* Fixed issue with published values / external index
---------
Co-authored-by: nikolajlauridsen <nikolajlauridsen@protonmail.ch>
* 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>
* 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>
* Add key to UserGroupDto
* Fix renaming table in sqlite
The SqliteSyntaxProvider needed an overload to use the correct query
* Start work on user group GUID migration
* Add key index to UserGroupDto
* Copy over data when migrating sqlite
* Make sqlite column migration work
* 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
* Use unscoped migration for adding GUID to user group
* Make sqlite migration work
It's really not pretty, square peg, round hole.
* Don't re-enable foreign keys
This will happen automatically next time a connection is started.
* Scope database when using SQLServer
* Don't call complete transaction
* Tidy up a couple of comment
* Only allow scoping the database from UnscopedMigrationBase
* Fix comment
* Remove remark in UnscopedMigrationBase as it's no longer true
* Add keys when creating default user groups
* Map database value from DTO to entity
* Fix migration
Rename also renamed the foreign keys, making it not work
* Make migration idempotent
* Fix unit test
* Update CompatibilitySuppressions.xml
* Add UniqueId to AppendGroupBy
Otherwise MSSQL grenades
* Cleanup
* Update CompatibilitySuppressions
* Rename UniqueId to Key
* Cleanup
---------
Co-authored-by: Elitsa Marinovska <elm@umbraco.dk>
* Use language ISO code for language fallback instead of language ID
* Remove language and language ID from dictionary item and dictionary item translation
* ADd unit test for dictionary item translation value extension
* Make the internal service implementations sealed
* Rename translation ISO code to be more explicit in its origin (Language)
* Add breaking changes suppression
* Handle save of invalid fallback iso code
* Fixed test
* Only allow non-UserCustomCulture's
* Fixed and added tests
* Rename ISO code validation method
* Fix language telemetry test (create Swedish with the correct ISO code)
---------
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
* Fixes#13715 issue with simple logviewer searches
* Update Logviewer test - to ensure MessageLike and simple equivalent returns same result count to help catch
* Fixing a few nullable reference types for log viewer (#13634)
(cherry picked from commit b4ca2a6636)
* Adding LogControllerBase
* Migrating GetLogLevels()
* Migrating GetNumberOfErrors()
* Migrating GetLogLevelCounts()
* Migrating GetCanViewLogs()
* Migrating GetMessageTemplates()
* Migrating GetLogs()
* Migrating GetSavedSearches()
* Migrating PostSavedSearch()
* Migrating DeleteSavedSearch()
* Adding LoggerViewModel
* Adding LogViewModelMapDefinition
* Update OpenApi.json
* Cleanup
* 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
(cherry picked from commit 5e06f5a8a0)
* Updates based on nullability fix
* Adding GetSavedSearchByName
* Implementing ByName endpoint
* Refactoring Delete endpoint based on GetSavedSearchByName
* Refactoring Create endpoint to return the item's location
* Suppress new GetSavedSearchByName in ILogViewer interfaces
* Update OpenApi.json
* Adding github initials to FIXME
* Renaming
* Moving files to Core proj
* Adding GetLogs with skip and take
* Introducing ILogViewerService
* Supressing xml for ILogViewer.GetLogsAsPagedModel()
* Changing to our own Enum representation of LogLevel
* Creating ILogEntry needed for GetPagedLogs()
* Refactoring controllers to use the new logViewerService
* Removing base class methods since those have been moved to the new service
* Removing ErrorCountLogViewerController since the result can be calculated from another endpoint
* Refactoring the MapDefinition because of the new return types from the service
* Update OpenApi.json
* Obsoleting old methods in favor of the ILogViewerService
* Cleanup
* Fixing enum representation as strings for Swagger
* Adding documentation
* Changing enum representation to string in OpenApi.OpenApi.json
* Fix FIXME (use CreatedAtAction)
* Removing JsonStringEnumConverter as there should be another way to fix enum representation for Swagger
* Removing MappingBuilderExtensions and making specific LogViewerBuilderExtensions
* Changes to the .sln file
* Take only the result in the response
* Register the LogViewer extensions
* Update OpenApi.json
* Fix the supressions.xml
* Add inheritdoc
* Remove GetSavedSearchByName as it isn't necessary to introduce it anymore
* Obsolete interfaces
* Rename ViewPermission controller to ValidateLogFileSize
* Make rest of the methods async
* Route name change
* Remove methods obsoletion
* Introduce the "attempt" pattern
* Refactoring of ILogViewerService
* Refactoring controllers
* Another OpenApi.json update
* Adding fixme
* Re-add new client project
Co-authored-by: nikolajlauridsen <nikolajlauridsen@protonmail.ch>