Browse Source

Added Hiden-Show button for razor - tenant

pull/14648/head
malik masis 4 years ago
parent
commit
391b8b7bf6
  1. 4
      modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/TenantConsts.cs
  2. 22
      modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/Create.js
  3. 11
      modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/CreateModal.cshtml
  4. 4
      modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/CreateModal.cshtml.cs
  5. 3
      modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/Index.cshtml

4
modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/TenantConsts.cs

@ -6,4 +6,8 @@ public static class TenantConsts
/// Default value: 64 /// Default value: 64
/// </summary> /// </summary>
public static int MaxNameLength { get; set; } = 64; public static int MaxNameLength { get; set; } = 64;
public const int MaxPasswordLength = 128;
public const int AdminEmailAddress = 256;
} }

22
modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/Create.js

@ -0,0 +1,22 @@
$(document).ready(function () {
$(document).on('click', '#PasswordVisibilityButton', function () {
let button = $(this);
let passwordInput = button.parent().find("input");
if (!passwordInput) {
return;
}
if (passwordInput.attr("type") === "password") {
passwordInput.attr("type", "text");
}
else {
passwordInput.attr("type", "password");
}
let icon = button.find("i");
if (icon) {
icon.toggleClass("fa-eye-slash").toggleClass("fa-eye");
}
})
});

11
modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/CreateModal.cshtml

@ -7,6 +7,7 @@
@using Volo.Abp.TenantManagement.Localization @using Volo.Abp.TenantManagement.Localization
@using Volo.Abp.TenantManagement.Web.Pages.TenantManagement.Tenants @using Volo.Abp.TenantManagement.Web.Pages.TenantManagement.Tenants
@using Volo.Abp.Data @using Volo.Abp.Data
@using Volo.Abp.TenantManagement;
@model CreateModalModel @model CreateModalModel
@inject IHtmlLocalizer<AbpTenantManagementResource> L @inject IHtmlLocalizer<AbpTenantManagementResource> L
@inject IStringLocalizerFactory StringLocalizerFactory @inject IStringLocalizerFactory StringLocalizerFactory
@ -21,7 +22,15 @@
<abp-input asp-for="Tenant.AdminEmailAddress" /> <abp-input asp-for="Tenant.AdminEmailAddress" />
<abp-input asp-for="Tenant.AdminPassword" /> <div class="mb-3">
<div class="input-group">
<input type="password" class="form-control" maxlength="@TenantConsts.MaxPasswordLength" asp-for="Tenant.AdminPassword" />
<button class="btn btn-secondary" type="button" id="PasswordVisibilityButton">
<i class="fa fa-eye-slash" aria-hidden="true"></i>
</button>
</div>
<span asp-validation-for="Tenant.AdminPassword"></span>
</div>
@foreach (var propertyInfo in ObjectExtensionManager.Instance.GetProperties<CreateModalModel.TenantInfoModel>()) @foreach (var propertyInfo in ObjectExtensionManager.Instance.GetProperties<CreateModalModel.TenantInfoModel>())
{ {

4
modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/CreateModal.cshtml.cs

@ -43,12 +43,12 @@ public class CreateModalModel : TenantManagementPageModel
[Required] [Required]
[EmailAddress] [EmailAddress]
[MaxLength(256)] [MaxLength(TenantConsts.AdminEmailAddress)]
public string AdminEmailAddress { get; set; } public string AdminEmailAddress { get; set; }
[Required] [Required]
[DataType(DataType.Password)] [DataType(DataType.Password)]
[MaxLength(128)] [MaxLength(TenantConsts.MaxPasswordLength)]
public string AdminPassword { get; set; } public string AdminPassword { get; set; }
} }
} }

3
modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/Index.cshtml

@ -21,7 +21,8 @@
<abp-script-bundle name="@typeof(IndexModel).FullName"> <abp-script-bundle name="@typeof(IndexModel).FullName">
<abp-script src="/client-proxies/multi-tenancy-proxy.js" /> <abp-script src="/client-proxies/multi-tenancy-proxy.js" />
<abp-script src="/Pages/FeatureManagement/feature-management-modal.js"/> <abp-script src="/Pages/FeatureManagement/feature-management-modal.js"/>
<abp-script src="/Pages/TenantManagement/Tenants/Index.js"/> <abp-script src="/Pages/TenantManagement/Tenants/Index.js" />
<abp-script src="/Pages/TenantManagement/Tenants/Create.js" />
</abp-script-bundle> </abp-script-bundle>
} }
@section content_toolbar { @section content_toolbar {

Loading…
Cancel
Save