Skip to content
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

Merged
merged 11 commits into from
Nov 17, 2022
Merged

Password show hiden feature #14648

merged 11 commits into from
Nov 17, 2022

Conversation

malikmasis
Copy link
Contributor


public const int MaxPasswordLength = 128;

public const int AdminEmailAddress = 256;
Copy link
Contributor

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 ?:

public static int MaxEmailLength { get; set; } = 256;

just like:
public static int MaxEmailLength { get; set; } = AbpUserConsts.MaxEmailLength;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. I need to the const value because it should be changed
  2. Attributes accept just const value

Copy link
Contributor

@rqx110 rqx110 Nov 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const value will not allow developer to change outside of module.
use DynamicStringLengthAttibute, see #4496

[DynamicStringLength(typeof(TenantConsts), nameof(TenantConsts.MaxNameLength))]

@@ -127,4 +126,9 @@ protected override ValueTask SetTableColumnsAsync()

return base.SetTableColumnsAsync();
}

protected virtual void ShowHidePassword(bool isShowPassword)
Copy link
Contributor

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;
}

Copy link
Contributor Author

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

Copy link
Contributor

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

Copy link
Contributor Author

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)
Copy link
Contributor

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

Copy link
Contributor Author

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

Copy link
Member

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.

@gizemmutukurt gizemmutukurt modified the milestones: 7.0-final, 7.1-preview Nov 15, 2022
@@ -35,12 +35,13 @@ public partial class UserManagement
protected string CreateModalSelectedTab = DefaultSelectedTab;

protected string EditModalSelectedTab = DefaultSelectedTab;
protected bool IsShowPassword { get; set; }
Copy link
Member

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)
Copy link
Member

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.

@enisn enisn merged commit 19fe260 into rel-7.0 Nov 17, 2022
@EngincanV EngincanV deleted the Password-Show-Hiden-Feature-10076 branch September 28, 2023 05:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants