mirror of
https://github.com/datahub-project/datahub.git
synced 2025-09-25 09:00:50 +00:00
Moves fe check for compliance purge policy to retentionPolicy instead of complianceInfo
This commit is contained in:
parent
34bcbfc56d
commit
d88a3cf442
@ -1188,6 +1188,10 @@ export default class DatasetCompliance extends Component {
|
||||
*/
|
||||
onCancel(this: DatasetCompliance): void {
|
||||
this.toggleEditing(false, <any>undefined);
|
||||
|
||||
// Note: [REFACTOR-COMPLIANCE] This should no longer be necessary once we separate the items into
|
||||
// their own components
|
||||
this.onReset();
|
||||
},
|
||||
|
||||
/**
|
||||
@ -1401,13 +1405,13 @@ export default class DatasetCompliance extends Component {
|
||||
* @returns {(Promise<void>)}
|
||||
*/
|
||||
didEditPurgePolicy(this: DatasetCompliance): Promise<void> {
|
||||
const { complianceType = null } = get(this, 'complianceInfo') || {};
|
||||
const retentionPolicy = get(this, 'retentionPolicy');
|
||||
|
||||
if (!complianceType) {
|
||||
if (!retentionPolicy || !retentionPolicy.purgeType) {
|
||||
return this.needsPurgePolicyType();
|
||||
}
|
||||
|
||||
if (isExempt(complianceType)) {
|
||||
if (isExempt(<PurgePolicy>retentionPolicy.purgeType)) {
|
||||
return this.showPurgeExemptionWarning();
|
||||
}
|
||||
|
||||
|
@ -45,6 +45,7 @@ import { saveDatasetRetentionByUrn, readDatasetRetentionByUrn } from 'wherehows-
|
||||
import { IDatasetRetention, IGetDatasetRetentionResponse } from 'wherehows-web/typings/api/datasets/retention';
|
||||
import { readUpstreamDatasetsByUrn } from 'wherehows-web/utils/api/datasets/lineage';
|
||||
import { LineageList } from 'wherehows-web/typings/api/datasets/relationships';
|
||||
import { retentionObjectFactory } from 'wherehows-web/constants/datasets/retention';
|
||||
|
||||
/**
|
||||
* Type alias for the response when container data items are batched
|
||||
@ -240,7 +241,7 @@ export default class DatasetComplianceContainer extends Component {
|
||||
schemaless,
|
||||
exportPolicy,
|
||||
upstreams,
|
||||
retentionPolicy: retentionResponse && retentionResponse.retentionPolicy
|
||||
retentionPolicy: (retentionResponse && retentionResponse.retentionPolicy) || retentionObjectFactory(urn)
|
||||
});
|
||||
}
|
||||
|
||||
@ -277,10 +278,11 @@ export default class DatasetComplianceContainer extends Component {
|
||||
getRetentionPolicyTask = task(function*(
|
||||
this: DatasetComplianceContainer
|
||||
): IterableIterator<Promise<IGetDatasetRetentionResponse | null>> {
|
||||
const retentionResponse = yield readDatasetRetentionByUrn(get(this, 'urn'));
|
||||
const urn = get(this, 'urn');
|
||||
const retentionResponse = yield readDatasetRetentionByUrn(urn);
|
||||
|
||||
const retentionPolicy = retentionResponse && retentionResponse.retentionPolicy;
|
||||
set(this, 'retentionPolicy', retentionPolicy);
|
||||
set(this, 'retentionPolicy', retentionPolicy || retentionObjectFactory(urn));
|
||||
}).restartable();
|
||||
|
||||
/**
|
||||
|
@ -157,7 +157,7 @@
|
||||
platform=platform
|
||||
missingPolicyText="This dataset does not have a current compliance purge policy."
|
||||
supportedPurgePolicies=supportedPurgePolicies
|
||||
purgeNote=complianceInfo.compliancePurgeNote
|
||||
purgeNote=retentionPolicy.purgeNote
|
||||
purgePolicy=(readonly retentionPolicy.purgeType)
|
||||
onPolicyChange=(action "onDatasetPurgePolicyChange")
|
||||
}}
|
||||
|
Loading…
x
Reference in New Issue
Block a user