Files
Umbraco-CMS/src/Umbraco.Core/Models/ContentEditing/MemberDisplay.cs
Mole 7df4f84247 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>
2022-04-21 14:47:27 +02:00

52 lines
1.9 KiB
C#

using System.Collections.Generic;
using System.Runtime.Serialization;
namespace Umbraco.Cms.Core.Models.ContentEditing
{
/// <summary>
/// A model representing a member to be displayed in the back office
/// </summary>
[DataContract(Name = "content", Namespace = "")]
public class MemberDisplay : ListViewAwareContentItemDisplayBase<ContentPropertyDisplay>
{
public MemberDisplay()
{
// MemberProviderFieldMapping = new Dictionary<string, string>();
ContentApps = new List<ContentApp>();
}
[DataMember(Name = "contentType")]
public ContentTypeBasic ContentType { get; set; }
[DataMember(Name = "username")]
public string Username { get; set; }
[DataMember(Name = "email")]
public string Email { get; set; }
[DataMember(Name = "isLockedOut")]
public bool IsLockedOut { get; set; }
[DataMember(Name = "isApproved")]
public bool IsApproved { get; set; }
//[DataMember(Name = "membershipScenario")]
//public MembershipScenario MembershipScenario { get; set; }
// /// <summary>
// /// This is used to indicate how to map the membership provider properties to the save model, this mapping
// /// will change if a developer has opted to have custom member property aliases specified in their membership provider config,
// /// or if we are editing a member that is not an Umbraco member (custom provider)
// /// </summary>
// [DataMember(Name = "fieldConfig")]
// public IDictionary<string, string> MemberProviderFieldMapping { get; set; }
[DataMember(Name = "apps")]
public IEnumerable<ContentApp> ContentApps { get; set; }
[DataMember(Name = "membershipProperties")]
public IEnumerable<ContentPropertyDisplay> MembershipProperties { get; set; }
}
}