adds missing purge policy notification in compliance policy update wizard flow

This commit is contained in:
Seyi Adebajo 2017-12-14 18:05:01 -08:00
parent 788ce80172
commit fe1acff599
2 changed files with 19 additions and 3 deletions

View File

@ -44,7 +44,8 @@ const {
failedUpdating, failedUpdating,
helpText, helpText,
successUploading, successUploading,
invalidPolicyData invalidPolicyData,
missingPurgePolicy
} = compliancePolicyStrings; } = compliancePolicyStrings;
/** /**
@ -774,6 +775,14 @@ export default Component.extend({
}); });
}, },
/**
* Notifies the user to provide a missing purge policy
* @return {Promise<never>}
*/
needsPurgePolicyType() {
return Promise.reject(get(this, 'notifications').notify('error', { content: missingPurgePolicy }));
},
/** /**
* Updates the currently active step in the edit sequence * Updates the currently active step in the edit sequence
* @param {number} step * @param {number} step
@ -889,7 +898,13 @@ export default Component.extend({
* @return {void|Promise.<void>} * @return {void|Promise.<void>}
*/ */
didEditPurgePolicy() { didEditPurgePolicy() {
if (isExempt(get(this, 'complianceInfo.complianceType'))) { const { complianceType } = get(this, 'complianceInfo');
if (!complianceType) {
return this.needsPurgePolicyType();
}
if (isExempt(complianceType)) {
return this.showPurgeExemptionWarning(); return this.showPurgeExemptionWarning();
} }
}, },

View File

@ -54,7 +54,8 @@ const compliancePolicyStrings = {
classification: classification:
'This security classification is from go/dht and should be good enough in most cases. ' + 'This security classification is from go/dht and should be good enough in most cases. ' +
'You can optionally override it if required by house security.' 'You can optionally override it if required by house security.'
} },
missingPurgePolicy: 'Please specify a Compliance Purge Policy'
}; };
/** /**