Commit Graph

561 Commits

Author SHA1 Message Date
Bjarke Berg
1f83e9ab19 Merge remote-tracking branch 'origin/v12/dev' into v13/dev 2023-03-29 11:08:53 +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
Mole
9b626d02c8 New backoffice: User controller (#13947)
* Add UserResponseModel

* Add factory to created UserResponseModel

* Add GetByKey controller

* Add GetAllUsers endpoint

* User proper response model

* Make naming consistent

* Order by username in GetAll

* Add user filter endpoint

* Fix includer user states

* Remove gravatar from the backend

* Send user avatars in response

* Add create user model

* start working on create

* Validate the create model

* Add authorization to create

* Use UserRepository instead of UserService to ValidateSessíonId

* Create IBackofficeUserStore interface

This is essentially a core-friendly version of the BackOfficeUserStore, additionally it contains basic methods for managing users, I.E. Get users, save users, create users, etc.

* Remove more usages of user service

* Remove usages of IUserService in BackofficeUserStore

* Add documentation

* Fix tests and DI

* add IBackOfficeUserStoreAccessor to resolve it in singleton services

* Resolve circular dependency

* Remove obsolete constructor

* Add core friendly user manager

* Finish createasync in user service

* Add WIP create endpoint

* Save newly creates users user groups

* Use service scope for user service

* Remove now unnecessary accessors

* Add response types

* Add update user endpoint

* Add EmailUserInviteSender

* Add technology free way of creating confirmation token

* Add invite uri provider

* Add invite user to user service

* Add invite user controller

* Add delete endpoint

* Add operation status responses

* Add operation status responses

* Added temporary file uploads including a repository implementation using local temp folder.

* Add Disable users endpoint

* missing files

* Fixed copy paste error

* Fix create users return type

* Updated OpenApi.json

* Updated OpenApi.json

* Handle if created failed in identity

* Add enable user

* Make users plural in enable/disable

We're doing the operation on multiple entities

* Added file extension check

* Add unlock user endpoint

* Clean up. Removed old TemporaryFileService and UploadFileService and updated dictionary items to use this new items

* Clean up

* Add reset password

* Add UpdateUserGroupsOnUsers method

* Add UpdateUserGroups

* Get rid of stream directly on TemporaryFileModel, and use delegate to open stream instead.

* Fix post merge

* Use keys instead of IDs

* Add ClearAvatar endpoint

* Review changes

* Moved models to their own files

* Reverted launch settings

* Move enlist extension to its own namespace

* Create set avatar endpoint

* Add reponse types

* Remove infrastructure extension after merge

* Add Cmapatibility suppressions

* Add test suppression

* Add integration tests

* Fix issue found in tests

* Add invited user to UserInvitationResult

* Add more tests

* Add update tests

* Hide different tests under parent

* Return DuplicatUserName user operation status if username matches an email

* Add update tests

* Change sorted set to HashSet

It doesn't work if it's not IComparable

* Change ID to Key when checking super

* Add get tests

* Add more GetAllTests

* Move tests to the right namespace

* Add filter test

* Fix including disabled users bug found by test

* Add test to ensure invited user state

* Add test case for UserState.All

* Add more filter tests

* Add enable disable tests

* Add resolver for keys and ids

* Replace usages of IUserService with IUserIdKeyResolver

* Add CompatibilitySuppressions

* Add UserIdKeyResolverTests

* Fix UserIdKeyResolver

* Add missing user operation results

* Updates from review

* ID not key

* Post instead of patch

* Use set instead of params for enable/disable

* Don't call to array

* Use sets for usergroup keys and user keys instead

* LanguageIsoCode instead of Language

* Update CompatibilitySuppressions after changin enumerable to set

---------

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
Co-authored-by: kjac <kja@umbraco.dk>
2023-03-29 08:14:47 +02:00
Sebastiaan Janssen
6bc999bca4 Unit tests need updating now that the WriterId is properly being set after merging #12843
(cherry picked from commit a88d0c0ec9)
2023-03-28 10:28:33 +02:00
patrickdemooij9
5f8ba2e864 Memory improvements to ShortStringHelper (#13089)
(cherry picked from commit b17d9004fd)
2023-03-28 10:19:43 +02:00
patrickdemooij9
eee6207f19 Performance improvement for ReplaceFirst function (#13018)
* Some benchmarks for replacefirst & span method

(cherry picked from commit e550a4ce3a)
2023-03-28 10:14:42 +02:00
Bjarke Berg
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
Nikolaj Geisle
93da4371e3 V13: Rework attempt pattern to use userkey (#13964)
* Add default super user key to migrations

* Start refactoring all interfaces signatures with ids

* Refactor datatype service to use userKey pattern instead

* Refactor ContentEditingService to use userkeys

* Refactor services to userKey

* Refactor more services to use userkey instead of id

* Refactor RelationService to use userKeys

* Refactor template service to use keys instead of ids

* Refactor fileservice to use keys instead of ids

* Refactor LocalizationService to use keys instead of ids

* Refactor PackagingService to use keys instead of ids

* Refactor TemplateController to use current user keys

* Refactor DataTypeContainerService.cs

* Refactor DataTypeService to use keys instead of ids

* Fix up tests

* Fix up media editing service to use userkey instead of ID

* Update service ctor to avoid ambigious ctors

* refactor DataTypeService

* Refactor DataTypeService to not have a default value for parentKey

* Apply suggestions from code review

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

* Update comment

* Add suppression file

* Add backoffice CompatibilitySuppressions

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com>
2023-03-21 12:41:20 +01:00
Bjarke Berg
ec9b873fac Added CompatibilitySuppressions files 2023-03-20 09:55:40 +01:00
Bjarke Berg
27103355a5 Post merge fixes 2023-03-20 09:37:11 +01:00
Bjarke Berg
8a99222e26 Merge remote-tracking branch 'origin/v12/dev' into v13/dev
# Conflicts:
#	src/Umbraco.Core/CompatibilitySuppressions.xml
#	src/Umbraco.Core/Routing/UmbracoRequestPaths.cs
#	src/Umbraco.Infrastructure/CompatibilitySuppressions.xml
#	src/Umbraco.Web.BackOffice/Controllers/ContentController.cs
#	tests/Umbraco.Tests.UnitTests/Umbraco.Web.BackOffice/Controllers/ContentControllerTests.cs
2023-03-20 08:49:27 +01:00
Bjarke Berg
298890436a Merge remote-tracking branch 'origin/v11/dev' into v12/dev 2023-03-20 08:41:29 +01:00
Erik-Jan Westendorp
010ea5a2aa 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

(cherry picked from commit 9771e77243)
2023-03-17 08:21:21 +01:00
Sebastiaan Janssen
86247b4578 Revert "Add DefaultLanguage fallback policy for published values (#13814)"
This reverts commit ef4c9c508d.
2023-03-16 11:32:35 +01:00
Ronald Barendse
ef4c9c508d Add DefaultLanguage fallback policy for published values (#13814)
* Add DefaultLanguage fallback

* Implement DefaultLanguage fallback

* Add DefaultLanguage fallback test

(cherry picked from commit 7348171c01)
2023-03-16 11:31:30 +01:00
Warren Buckley
06b89963e4 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

(cherry picked from commit d38fabea4a)
2023-03-16 10:57:52 +01:00
Sebastiaan Janssen
28ce2c5787 Merge branch 'v11/dev' into contrib 2023-03-16 08:07:25 +01:00
Kenn Jacobsen
4fb011e0fc Domains and hosts API (#13963)
* API for domains and hostnames incl. unit tests

* Update Open API json

* Update other unit tests to use new domain service methods where applicable

* Fix merge + update models to new naming scheme

* Handle attempts to add the same domain twice + unit tests for duplicate domain handling

* Review fixes
2023-03-15 10:28:23 +01:00
Mole
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
Andreas Zerbst
4d6e1e9531 Removed test file because the test are broken (#13924)
* Removed test file because the test are broken

* Removed outdated failing tests
2023-03-08 14:04:59 +01:00
Kenn Jacobsen
1b8ce54e49 Remove Json.NET dependencies for more property editors (#13912)
* Make the Tags property editor JSON serialization agnostic

* Make the Multiple Value editor JSON serializer agnostic

* Make Media Picker 3 value converter work with System.Text.Json instead of Json.NET

* Make Image Cropper value converter work with System.Text.Json instead of Json.NET

* Remove Json.NET dependencies from ImageCropperTemplateExtensions

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

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

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

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

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

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

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

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

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

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

* Update src/Umbraco.Infrastructure/PropertyEditors/TagsPropertyEditor.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-07 14:31:27 +01:00
Erik-Jan Westendorp
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
d53ecc16dd Merge remote-tracking branch 'origin/v12/dev' into v13/dev
# Conflicts:
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Media/mediaSection.spec.ts
2023-03-02 08:50:05 +01:00
Bjarke Berg
ef7db1dec9 Merge remote-tracking branch 'origin/v11/dev' into v12/dev 2023-03-02 08:47:38 +01:00
Andreas Zerbst
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
Nikolaj Geisle
27ca36db53 V13: relation type controller (#13856)
* Create RelationTypeControllerBase.cs

* Implement ByKey endpoint

* Move controllers

* Implement ByRelationTypeKeyRelationController

* Refactor relation service to use skip/take in interface

* change httpget

* Implement object types endpoint

* Add ObjectTypeViewModelFactory.cs

* Change signature to IActionResult

* Implement CreateRelationTypeController.cs

* Implement CreateRelationTypeController.cs

* Add optional key parameter to RelationType

* Add optional key to RelationTypeSavingViewModel

* Update ProducsResponseType

* Implement UpdateRelationTypeController

* Update routes

* Implement DeleteRelationTypeController

* Remove key from UpdatingViewmoDel

* Implement UpdatingViewModel factory method

* Update relationType factory

* Fix paging for object types

* Implement CreateAsync

* Update create action to use CreateAsync

* Implement update async

* Add default implementations to avoid breaking changes

* actually use userIds

* Add ProducesResponseType status 400 to endpoints

* Implement new DeleteAsync method

* Update OpenApi.json

* Add mapping to DI

* Update 404 to return proper HTTP status

* Add not found to ByKey action

* Rename viewmodels to request/response

* Update OpenApi.json

* All RelationServiceTests.cs

* Add allowed object types test

* Fix grouping

* Implement AllowedRelationObjectTypesService.cs

* Refactor view model factory to use new service

* Implement non-happy path tests

* Implement allowed child/parent object types

* refactor test to return proper relationTypeOperationStatus

* Add can create relation type with key

* Add Id test

* formatting

* Refactor service to have validation logic in save method

* move object types endpoint to own silo

* Delete unused using

* Update OpenApi.json

* Update OpenApi.json

* Update tests to user proper child/parent

* Implement RelationTypeBaseModel

* Update OpenApi.json

* Use array instead of enumerable

* Rename view model factory to presentation factory

* Rename GetPagedByRelationTypeKey

* Rename IRelationViewModelFactory

* Rename IRelationTypeViewModelFactory

* Update error description

* Update OpenApi.json

* Update OpenApi.json

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
Co-authored-by: Nikolaj <nikolajlauridsen@protonmail.ch>
2023-03-01 08:51:17 +01:00
Bjarke Berg
a00421602e Merge pull request #13891 from umbraco/v13/feature/content-create-update-delete
Create/update/delete API for Document
2023-02-28 16:00:48 +01:00
Bjarke Berg
1d8941cf28 Merge pull request #13884 from umbraco/v13/feature/extension-model
Add extension model for new backoffice
2023-02-28 10:26:26 +01:00
kjac
0f95dbbfa6 Review changes and fixes 2023-02-28 08:36:48 +01:00
Andreas Zerbst
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 Zerbst
610a519045 Added test for testing the content editor with a block grid editor (#13887) 2023-02-28 08:06:43 +01:00
kjac
7d15e6d5ea Merge branch 'v13/dev' into v13/feature/content-create-update-delete 2023-02-27 08:42:13 +01:00
Nikolaj Geisle
5e90fa26c1 V13: Add parentkey to notifications (#13832)
* Add parent key to CopyingNotification

* Use parentkey on notifications

* Implement ParentKeys for Copying notification

* Obsolete parentId

* Implement MoveToEventInfoBase

* Refactor MovingToRecycleBinNotification to use the new MoveEVentInfoBase

* Refactor MediaMovingToRecycleBinNotification

* Refactor MovedToRecycleBinNotification to use new MoveEventInfo

* Refactor ContentMovedToRecycleBinNotification to use new MoveEventInfo

* Start implementing parent key in moveinfo

* Add FIXME's to move methods

* Refactor Move to get parentKey for descendants

* Add FIXME for move method

* Use MoveToRecycleBinEventInfo in RelateOnTrashNotificationHandler

* Add fixme's to DataTypeRepository

* Add obsolete messages

* Revert changes in ContentTypeServiceBaseOfTRepositoryTItemTService.cs

* Fix bad indentation

* Pass the recursive variable

* Revert changes in ContentService.cs

* Refactor MoveEventInfo to not duplicate equals method

* Refactor Equals to not duplicate code

* Add UnitTests of Equals

* make equals public and add non-happy path tests

* Remvoe duplicate call to base

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-02-27 08:40:17 +01:00
kjac
9e8a0645cd Merge branch 'v13/dev' into v13/feature/content-create-update-delete 2023-02-23 16:50:19 +01:00
kjac
5d2a90f974 Merge branch 'v13/dev' into v13/feature/extension-model
# Conflicts:
#	src/Umbraco.Cms.Api.Management/Controllers/Package/PackageControllerBase.cs
#	src/Umbraco.Cms.Api.Management/DependencyInjection/PackageBuilderExtensions.cs
#	src/Umbraco.Cms.Api.Management/ManagementApiComposer.cs
#	src/Umbraco.Core/CompatibilitySuppressions.xml
#	src/Umbraco.Infrastructure/CompatibilitySuppressions.xml
#	src/Umbraco.Infrastructure/Serialization/ContextualJsonSerializer.cs
#	src/Umbraco.Web.BackOffice/CompatibilitySuppressions.xml
2023-02-23 15:28:44 +01:00
Andreas Zerbst
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 Zerbst
e3f5bf8cdf Added test for the settings section (#13878) 2023-02-23 14:30:29 +01:00
kjac
93149160a7 Make various value editors handle their respective data as concrete types rather than strings or otherwise strange legacy data formats 2023-02-23 09:12:10 +01:00
Andreas Zerbst
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
kjac
767e3cd9eb Add tests for content editing service 2023-02-23 07:31:05 +01:00
Bjarke Berg
37ac85ee96 Merge remote-tracking branch 'origin/v12/dev' into v13/dev 2023-02-23 07:18:25 +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
4be6e5b71c Merge remote-tracking branch 'origin/v10/dev' into v11/dev 2023-02-23 07:16:50 +01:00
jomehmet
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
Mole
46cc9d6a97 V13: Add Guids to Users (#13868)
* 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>
2023-02-22 12:33:41 +01:00
Bjarke Berg
f734f1fc6a Merge pull request #13861 from umbraco/v13/bugfix/fixed_profiling_endpoints
Fixed profiling status endpoints and added an update endpoint
2023-02-22 07:27:52 +01:00
Kenn Jacobsen
2eebd0558c Document and document type read API (#13853)
* Basic structure for document and document type read API

* Handle unpublished, non-variant content

* Expose content type key on ContentTypeSort

* Add the remaining properties to document type (minus list view info, still pending)

* Obsolete more ILocalizationService usage

* Add URLs and template data to document view model

* Clean up + add proprety type appearance

* update submodule commit

* front-end commit

* latest front-end commit

* latest commit

* latest front-end commit

* Rename content property to content value in view model layer

* Add contextual JSON serialization as default JSON serializer

* Add FIXME to content type sort + rearrange constructor parameters

* Fix broken remark tag

* Whitelist breakage for ContentTypeSort

* Add variance info to property type output

* Update src/Umbraco.Cms.Api.Management/Controllers/Document/ByKeyDocumentController.cs

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

* Update src/Umbraco.Cms.Api.Management/Controllers/DocumentType/ByKeyDocumentTypeController.cs

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

* Update src/Umbraco.Cms.Api.Management/Factories/ContentUrlFactory.cs

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

* Add a few FIXME comments about async entity retrieval

---------

Co-authored-by: Niels Lyngsø <niels.lyngso@gmail.com>
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2023-02-21 13:40:41 +01:00