V10: Migrate member properties to columns on the member table (#12205)

* Add new columns to the member table

* Add missing IsApproved column

* Add joins with nested query

* Add query for selecting new column values from existing members

* Update the member data from the same query

* Make escapes work for sqlite

* Use GetFieldNameForUpdate instead of GetFieldName

* Left join on memberDto

* Remove the now unused property types and data

* Don't create member columns as properties anymore

* Store old properties in fields on member

Also switch the dates to nullable since they can be null

* Map columns when mapping from DTO to Member object

* Display columns in the member content app

* Fix null exception when creating new user

* Hide value if user doesn't have access to sensitive data

* Remove hardcoded member properties

* Obsolete old member alias constants

* Map and persist member properties

* Correctly update LastLogin when member logs in

* Map IsApproved and IsLockedOut when saving member in backoffice

* Update the query mappers for members

* Fix member service tracks dirty changes test

* Remove no longer existing property types from member type builder

* Fix null error in UpdateMemberProperties

* Fix builder tests

* Fix SetupMemberTestData in MemberControllerUnitTests

* Let LastLoginDate be null and handle check in controller

There's no reason to default a perfectly nullable property to default(DateTime)

* Add translation key for is approved and use that instead of constant

* Obsolete old label constants

* Fix whitespace post merge

* Fix up test comments

* Apply suggestions from code review

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

* Fix member properties always being sensitive

Co-authored-by: Elitsa Marinovska <elm@umbraco.dk>
Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com>
This commit is contained in:
Mole
2022-04-21 14:47:27 +02:00
committed by GitHub
parent 6d0a0fff9c
commit 7df4f84247
36 changed files with 744 additions and 489 deletions

View File

@@ -35,47 +35,11 @@ namespace Umbraco.Cms.Tests.Common.Builders
.WithId(99)
.WithName(Constants.Conventions.Member.StandardPropertiesGroupName)
.AddPropertyType()
.WithPropertyEditorAlias(Constants.PropertyEditors.Aliases.TextArea)
.WithValueStorageType(ValueStorageType.Ntext)
.WithAlias(Constants.Conventions.Member.Comments)
.WithName(Constants.Conventions.Member.CommentsLabel)
.Done()
.AddPropertyType()
.WithPropertyEditorAlias(Constants.PropertyEditors.Aliases.Boolean)
.WithValueStorageType(ValueStorageType.Integer)
.WithAlias(Constants.Conventions.Member.IsApproved)
.WithName(Constants.Conventions.Member.IsApprovedLabel)
.Done()
.AddPropertyType()
.WithPropertyEditorAlias(Constants.PropertyEditors.Aliases.Boolean)
.WithValueStorageType(ValueStorageType.Integer)
.WithAlias(Constants.Conventions.Member.IsLockedOut)
.WithName(Constants.Conventions.Member.IsLockedOutLabel)
.Done()
.AddPropertyType()
.WithPropertyEditorAlias(Constants.PropertyEditors.Aliases.Label)
.WithValueStorageType(ValueStorageType.Date)
.WithAlias(Constants.Conventions.Member.LastLoginDate)
.WithName(Constants.Conventions.Member.LastLoginDateLabel)
.Done()
.AddPropertyType()
.WithPropertyEditorAlias(Constants.PropertyEditors.Aliases.Label)
.WithValueStorageType(ValueStorageType.Date)
.WithAlias(Constants.Conventions.Member.LastPasswordChangeDate)
.WithName(Constants.Conventions.Member.LastPasswordChangeDateLabel)
.Done()
.AddPropertyType()
.WithPropertyEditorAlias(Constants.PropertyEditors.Aliases.Label)
.WithValueStorageType(ValueStorageType.Date)
.WithAlias(Constants.Conventions.Member.LastLockoutDate)
.WithName(Constants.Conventions.Member.LastLockoutDateLabel)
.Done()
.AddPropertyType()
.WithPropertyEditorAlias(Constants.PropertyEditors.Aliases.Label)
.WithValueStorageType(ValueStorageType.Integer)
.WithAlias(Constants.Conventions.Member.FailedPasswordAttempts)
.WithName(Constants.Conventions.Member.FailedPasswordAttemptsLabel)
.Done();
.WithPropertyEditorAlias(Constants.PropertyEditors.Aliases.TextArea)
.WithValueStorageType(ValueStorageType.Ntext)
.WithAlias(Constants.Conventions.Member.Comments)
.WithName(Constants.Conventions.Member.CommentsLabel)
.Done();
_propertyGroupBuilders.Add(builder);
return this;
}