From 67b5ab53e89bf08cf262f3b4d36bd387ac105cd1 Mon Sep 17 00:00:00 2001 From: Seyi Adebajo Date: Tue, 31 Jul 2018 13:50:20 -0700 Subject: [PATCH] replaces the purgeNote on an IDatasetRetention object if the policy is not exempt --- wherehows-web/app/utils/datasets/retention.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wherehows-web/app/utils/datasets/retention.ts b/wherehows-web/app/utils/datasets/retention.ts index 972f72a1a8..e8f458c893 100644 --- a/wherehows-web/app/utils/datasets/retention.ts +++ b/wherehows-web/app/utils/datasets/retention.ts @@ -1,6 +1,7 @@ import { IComplianceInfo } from 'wherehows-web/typings/api/datasets/compliance'; import { IDatasetRetention } from 'wherehows-web/typings/api/datasets/retention'; 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 @@ -8,14 +9,14 @@ import { pick } from 'wherehows-web/utils/object'; * @returns {IDatasetRetention} */ const extractRetentionFromComplianceInfo = (complianceInfo: IComplianceInfo): IDatasetRetention => { - const { datasetUrn, compliancePurgeNote, complianceType } = pick(complianceInfo, [ + let { datasetUrn, compliancePurgeNote, complianceType } = pick(complianceInfo, [ 'complianceType', 'compliancePurgeNote', 'datasetUrn' ]); return { - purgeNote: compliancePurgeNote, + purgeNote: complianceType && isExempt(complianceType) ? compliancePurgeNote : '', purgeType: complianceType, datasetUrn: datasetUrn! };