diff --git a/addons/core/translations/resources/en-us.yaml b/addons/core/translations/resources/en-us.yaml index d79c5958f..8b37a1135 100644 --- a/addons/core/translations/resources/en-us.yaml +++ b/addons/core/translations/resources/en-us.yaml @@ -949,6 +949,10 @@ policy: label: Custom do_not_protect: label: Do not protect, allow deletion any time + hippa: + label: HIPPA (6 years) + soc: + label: SOC 2 (7 years) deletion_policy_options: do_not_delete: label: Do not delete diff --git a/ui/admin/app/components/form/policy/index.js b/ui/admin/app/components/form/policy/index.js index d1841e7a4..deb87acfe 100644 --- a/ui/admin/app/components/form/policy/index.js +++ b/ui/admin/app/components/form/policy/index.js @@ -9,6 +9,8 @@ const RETENTION_POLICY = { forever: -1, custom: 1, do_not_protect: 0, + soc: 2555, + hippa: 2190, }; const DELETION_POLICY = { do_not_delete: 0, custom: 1 }; @@ -44,13 +46,10 @@ export default class FormPolicyComponent extends Component { * @type {string} */ get selectRetentionPolicyType() { - if (this.args.model.retain_for?.days < 0) { - return 'forever'; - } else if (this.args.model.retain_for?.days >= 1) { - return 'custom'; - } else { - return 'do_not_protect'; - } + const val = Object.keys(RETENTION_POLICY).find( + (i) => RETENTION_POLICY[i] === this.args.model.retain_for?.days, + ); + return val || 'custom'; } /** diff --git a/ui/admin/app/components/form/policy/policy-selection/index.js b/ui/admin/app/components/form/policy/policy-selection/index.js index e0f898a72..3c57274c4 100644 --- a/ui/admin/app/components/form/policy/policy-selection/index.js +++ b/ui/admin/app/components/form/policy/policy-selection/index.js @@ -25,7 +25,9 @@ export default class FormPolicySelectionComponent extends Component { * @type {boolean} */ get isCustomRetentionSelected() { - return this.args.model.retain_for?.days > 0; + //no need to show custom input for the below days + const arr = [-1, 0, 2555, 2190]; + return arr.includes(this.args.model.retain_for?.days) ? false : true; } /** diff --git a/ui/admin/app/templates/scopes/scope/policies/policy/index.hbs b/ui/admin/app/templates/scopes/scope/policies/policy/index.hbs index 93ba16f46..a0885e036 100644 --- a/ui/admin/app/templates/scopes/scope/policies/policy/index.hbs +++ b/ui/admin/app/templates/scopes/scope/policies/policy/index.hbs @@ -9,16 +9,11 @@ -

+ {{t 'resources.policy.title'}} -

- - {{@model.id}} - + + +