mirror of
https://github.com/datahub-project/datahub.git
synced 2025-11-24 08:45:43 +00:00
replaces the purgeNote on an IDatasetRetention object if the policy is not exempt
This commit is contained in:
parent
acef146bfd
commit
67b5ab53e8
@ -1,6 +1,7 @@
|
|||||||
import { IComplianceInfo } from 'wherehows-web/typings/api/datasets/compliance';
|
import { IComplianceInfo } from 'wherehows-web/typings/api/datasets/compliance';
|
||||||
import { IDatasetRetention } from 'wherehows-web/typings/api/datasets/retention';
|
import { IDatasetRetention } from 'wherehows-web/typings/api/datasets/retention';
|
||||||
import { pick } from 'wherehows-web/utils/object';
|
import { pick } from 'wherehows-web/utils/object';
|
||||||
|
import { isExempt } from 'wherehows-web/constants';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extracts values from an IComplianceInfo instance to create an instance of IDatasetRetention
|
* Extracts values from an IComplianceInfo instance to create an instance of IDatasetRetention
|
||||||
@ -8,14 +9,14 @@ import { pick } from 'wherehows-web/utils/object';
|
|||||||
* @returns {IDatasetRetention}
|
* @returns {IDatasetRetention}
|
||||||
*/
|
*/
|
||||||
const extractRetentionFromComplianceInfo = (complianceInfo: IComplianceInfo): IDatasetRetention => {
|
const extractRetentionFromComplianceInfo = (complianceInfo: IComplianceInfo): IDatasetRetention => {
|
||||||
const { datasetUrn, compliancePurgeNote, complianceType } = pick(complianceInfo, [
|
let { datasetUrn, compliancePurgeNote, complianceType } = pick(complianceInfo, [
|
||||||
'complianceType',
|
'complianceType',
|
||||||
'compliancePurgeNote',
|
'compliancePurgeNote',
|
||||||
'datasetUrn'
|
'datasetUrn'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
purgeNote: compliancePurgeNote,
|
purgeNote: complianceType && isExempt(complianceType) ? compliancePurgeNote : '',
|
||||||
purgeType: complianceType,
|
purgeType: complianceType,
|
||||||
datasetUrn: datasetUrn!
|
datasetUrn: datasetUrn!
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user