Add more options retain (#2090)

* chore: 🤖 add more options to rentention policy

* fix: 🐛 log

* fix: 🐛 exclude days
This commit is contained in:
Dharini Jeeva authored and GitHub committed 2024-01-12 14:33:36 -08:00
1 parent eefb9eba4f
commit ee4e19ace7
4 files changed
+17 -17

No files matched your search

@@ -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
+6 -7
View File
@@ -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';
}
/**
@@ -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;
}
/**
@@ -9,16 +9,11 @@
</page.breadcrumbs>
<page.header>
<h2>
<Hds::Text::Display @tag='h2'>
{{t 'resources.policy.title'}}
</h2>
<Copyable
@text={{@model.id}}
@buttonText={{t 'actions.copy-to-clipboard'}}
@acknowledgeText={{t 'states.copied'}}
>
<Hds::Text::Code>{{@model.id}}</Hds::Text::Code>
</Copyable>
</Hds::Text::Display>
<Hds::Copy::Snippet @color='secondary' @textToCopy={{@model.id}} />
</page.header>
<page.navigation>