1
0
mirror of https://github.com/bitwarden/server.git synced 2025-01-27 22:41:22 +01:00

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

* Initial commit of checkbox description update

* refactored property name
This commit is contained in:
Vincent Salucci 2021-01-12 11:37:33 -06:00 committed by GitHub
parent 63fcdc1418
commit 96cc88aafc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 5 deletions

View File

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

View File

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

View File

@ -67,7 +67,7 @@
<div class="form-group"> <div class="form-group">
<div class="form-check"> <div class="form-check">
<input class="form-check-input" type="checkbox" asp-for="Enabled"> <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>
</div> </div>

View File

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