-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Password show hiden feature #14648
Password show hiden feature #14648
Conversation
|
||
public const int MaxPasswordLength = 128; | ||
|
||
public const int AdminEmailAddress = 256; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename to MaxAdminEmailLength
is better. and why here use const
not static
?
or can we reuse AbpUserConsts.MaxEmailLength
?:
abp/modules/users/src/Volo.Abp.Users.Domain.Shared/Volo/Abp/Users/AbpUserConsts.cs
Line 23 in 48c02d7
public static int MaxEmailLength { get; set; } = 256; |
just like:
abp/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/IdentityUserConsts.cs
Line 15 in 48c02d7
public static int MaxEmailLength { get; set; } = AbpUserConsts.MaxEmailLength; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- I need to the const value because it should be changed
- Attributes accept just const value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -127,4 +126,9 @@ protected override ValueTask SetTableColumnsAsync() | |||
|
|||
return base.SetTableColumnsAsync(); | |||
} | |||
|
|||
protected virtual void ShowHidePassword(bool isShowPassword) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need parameter isShowPassword
here.
simple:
protected virtual void ShowHidePassword()
{
IsShowPassword = !IsShowPassword;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's simpler but not a safe behaviour
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry, can you explain what's mean of not a safe behaviour
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yw, to avoid multiple instances
@@ -228,16 +229,21 @@ protected override ValueTask SetToolbarItemsAsync() | |||
return base.SetToolbarItemsAsync(); | |||
} | |||
|
|||
protected virtual void ChangePasswordTextRole(TextRole? textRole) | |||
protected virtual void ChangePasswordTextRole(TextRole? textRole, bool? isShowPassword = null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need isShowPassword
parameter here. Can use IsShowPassword
property directly in this function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's simpler but not a safe behaviour
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems isShowPassword
isn't necessary as a method parameter. That value is already known in the class.
@@ -35,12 +35,13 @@ public partial class UserManagement | |||
protected string CreateModalSelectedTab = DefaultSelectedTab; | |||
|
|||
protected string EditModalSelectedTab = DefaultSelectedTab; | |||
protected bool IsShowPassword { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name of the property is confusing. It can be IsPasswordShown
or ShowPassword
@@ -228,16 +229,21 @@ protected override ValueTask SetToolbarItemsAsync() | |||
return base.SetToolbarItemsAsync(); | |||
} | |||
|
|||
protected virtual void ChangePasswordTextRole(TextRole? textRole) | |||
protected virtual void ChangePasswordTextRole(TextRole? textRole, bool? isShowPassword = null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems isShowPassword
isn't necessary as a method parameter. That value is already known in the class.
closes https://github.com/volosoft/volo/issues/10076