Browse Source

[Policy] Update Personal Ownership checkbox description (#1076)

* Initial commit of checkbox description update

* refactored property name
pull/1085/head
Vincent Salucci 5 years ago committed by GitHub
parent
commit
96cc88aafc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      bitwarden_license/src/Portal/Models/PolicyEditModel.cs
  2. 1
      bitwarden_license/src/Portal/Models/PolicyModel.cs
  3. 2
      bitwarden_license/src/Portal/Views/Policies/Edit.cshtml
  4. 3
      src/Core/Resources/SharedResources.en.resx

9
bitwarden_license/src/Portal/Models/PolicyEditModel.cs

@ -16,7 +16,7 @@ namespace Bit.Portal.Models @@ -16,7 +16,7 @@ namespace Bit.Portal.Models
: base(type, false)
{
// Inject service and create static lists
BuildLists(i18nService);
TranslateStrings(i18nService);
}
public PolicyEditModel(Policy model, II18nService i18nService)
@ -28,7 +28,7 @@ namespace Bit.Portal.Models @@ -28,7 +28,7 @@ namespace Bit.Portal.Models
}
// Inject service and create static lists
BuildLists(i18nService);
TranslateStrings(i18nService);
if (model.Data != null)
{
@ -55,6 +55,7 @@ namespace Bit.Portal.Models @@ -55,6 +55,7 @@ namespace Bit.Portal.Models
public PasswordGeneratorDataModel PasswordGeneratorDataModel { get; set; }
public List<SelectListItem> Complexities { get; set; }
public List<SelectListItem> DefaultTypes { get; set; }
public string EnableCheckboxText { get; set; }
public Policy ToPolicy(PolicyType type, Guid organizationId)
{
@ -93,7 +94,7 @@ namespace Bit.Portal.Models @@ -93,7 +94,7 @@ namespace Bit.Portal.Models
return existingPolicy;
}
public void BuildLists(II18nService i18nService)
public void TranslateStrings(II18nService i18nService)
{
Complexities = new List<SelectListItem>
{
@ -110,6 +111,8 @@ namespace Bit.Portal.Models @@ -110,6 +111,8 @@ namespace Bit.Portal.Models
new SelectListItem { Value = "password", Text = i18nService.T("Password") },
new SelectListItem { Value = "passphrase", Text = i18nService.T("Passphrase") },
};
EnableCheckboxText = PolicyType == PolicyType.PersonalOwnership
? i18nService.T("PersonalOwnershipCheckboxDesc") : i18nService.T("Enabled");
}
}
}

1
bitwarden_license/src/Portal/Models/PolicyModel.cs

@ -58,7 +58,6 @@ namespace Bit.Portal.Models @@ -58,7 +58,6 @@ namespace Bit.Portal.Models
public string NameKey { get; set; }
public string DescriptionKey { get; set; }
public PolicyType PolicyType { get; set; }
[Display(Name = "Enabled")]
public bool Enabled { get; set; }
}
}

2
bitwarden_license/src/Portal/Views/Policies/Edit.cshtml

@ -67,7 +67,7 @@ @@ -67,7 +67,7 @@
<div class="form-group">
<div class="form-check">
<input class="form-check-input" type="checkbox" asp-for="Enabled">
<label class="form-check-label" asp-for="Enabled"></label>
<label class="form-check-label" asp-for="Enabled">@Model.EnableCheckboxText</label>
</div>
</div>

3
src/Core/Resources/SharedResources.en.resx

@ -581,4 +581,7 @@ @@ -581,4 +581,7 @@
<data name="DisableRequireSsoError" xml:space="preserve">
<value>You must manually disable the Single Sign-On Authentication policy before this policy can be disabled.</value>
</data>
<data name="PersonalOwnershipCheckboxDesc" xml:space="preserve">
<value>Disable personal ownership for organization users</value>
</data>
</root>

Loading…
Cancel
Save