2017-02-13 14:51:31 -08:00
|
|
|
import Ember from 'ember';
|
2017-04-25 10:50:02 -07:00
|
|
|
import isTrackingHeaderField from 'wherehows-web/utils/validators/tracking-headers';
|
2017-02-13 14:51:31 -08:00
|
|
|
|
2017-05-01 09:57:17 -07:00
|
|
|
const { Component, computed, set, get, isBlank, setProperties, getWithDefault, String: { htmlSafe } } = Ember;
|
2017-03-24 20:27:43 -07:00
|
|
|
|
2017-04-02 15:40:43 -07:00
|
|
|
// TODO: DSS-6671 Extract to constants module
|
2017-05-01 09:57:17 -07:00
|
|
|
const missingTypes = 'Looks like some fields may contain privacy data but do not have a specified `Field Format`?';
|
2017-04-02 15:40:43 -07:00
|
|
|
const successUpdating = 'Your changes have been successfully saved!';
|
|
|
|
const failedUpdating = 'Oops! We are having trouble updating this dataset at the moment.';
|
2017-04-18 15:02:45 -07:00
|
|
|
const hiddenTrackingFieldsMsg = htmlSafe(
|
|
|
|
'<p>Hey! Just a heads up that some fields in this dataset have been hidden from the table(s) below. ' +
|
2017-05-01 09:57:17 -07:00
|
|
|
"These are tracking fields for which we've been able to predetermine the compliance classification.</p>" +
|
|
|
|
'<p>For example: <code>header.memberId</code>, <code>requestHeader</code>. ' +
|
|
|
|
'Hopefully, this saves you some scrolling!</p>'
|
2017-04-18 15:02:45 -07:00
|
|
|
);
|
2017-04-02 15:40:43 -07:00
|
|
|
|
2017-03-24 20:27:43 -07:00
|
|
|
const complianceListKey = 'privacyCompliancePolicy.compliancePurgeEntities';
|
2017-03-30 15:24:01 -07:00
|
|
|
// TODO: DSS-6671 Extract to constants module
|
|
|
|
const logicalTypes = ['ID', 'URN', 'REVERSED_URN', 'COMPOSITE_URN'];
|
2017-03-30 15:08:12 -07:00
|
|
|
/**
|
|
|
|
* Duplicate check using every to short-circuit iteration
|
|
|
|
* @param {Array} names = [] the list to check for dupes
|
|
|
|
* @return {Boolean} true is unique, false otherwise
|
|
|
|
*/
|
2017-05-01 09:57:17 -07:00
|
|
|
const fieldNamesAreUnique = (names = []) => names.every((name, index) => names.indexOf(name) === index);
|
2017-03-24 20:27:43 -07:00
|
|
|
|
|
|
|
/**
|
2017-03-27 18:26:09 -07:00
|
|
|
* Returns a computed macro based on a provided type will return a list of
|
|
|
|
* Compliance fields that are of that identifierType or have no type
|
|
|
|
* @param {String} type string to match against identifierType
|
2017-03-24 20:27:43 -07:00
|
|
|
*/
|
2017-03-31 08:41:50 -07:00
|
|
|
const complianceEntitiesMatchingType = type =>
|
2017-05-01 09:57:17 -07:00
|
|
|
computed('complianceDataFieldsSansHiddenTracking.[]', function() {
|
2017-03-27 18:26:09 -07:00
|
|
|
const fieldRegex = new RegExp(`${type}`, 'i');
|
2017-03-24 20:27:43 -07:00
|
|
|
|
2017-04-18 15:02:45 -07:00
|
|
|
return get(this, 'complianceDataFieldsSansHiddenTracking').filter(({ identifierType }) => {
|
2017-03-27 18:26:09 -07:00
|
|
|
return fieldRegex.test(identifierType) || isBlank(identifierType);
|
|
|
|
});
|
2017-03-24 20:27:43 -07:00
|
|
|
});
|
|
|
|
|
|
|
|
export default Component.extend({
|
2017-03-27 20:12:09 -07:00
|
|
|
sortColumnWithName: 'identifierField',
|
2017-03-27 18:26:09 -07:00
|
|
|
filterBy: 'identifierField',
|
2017-03-24 20:27:43 -07:00
|
|
|
sortDirection: 'asc',
|
2017-02-13 14:51:31 -08:00
|
|
|
searchTerm: '',
|
2017-04-18 15:02:45 -07:00
|
|
|
hiddenTrackingFields: hiddenTrackingFieldsMsg,
|
2017-03-24 20:27:43 -07:00
|
|
|
|
2017-03-27 18:26:09 -07:00
|
|
|
/**
|
|
|
|
* Map of radio Group state values
|
|
|
|
* Each initially has an indeterminate state, as the user
|
|
|
|
* progresses through the prompts
|
|
|
|
* @type {Object.<Boolean, null>}
|
|
|
|
*/
|
|
|
|
userIndicatesDatasetHas: {
|
|
|
|
member: null,
|
|
|
|
org: null,
|
|
|
|
group: null
|
2017-02-13 14:51:31 -08:00
|
|
|
},
|
|
|
|
|
2017-03-30 15:08:12 -07:00
|
|
|
didReceiveAttrs() {
|
|
|
|
this._super(...arguments);
|
|
|
|
// Perform validation step on the received component attributes
|
|
|
|
this.validateAttrs();
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Ensure that props received from on this component
|
|
|
|
* are valid, otherwise flag
|
|
|
|
*/
|
|
|
|
validateAttrs() {
|
2017-05-01 09:57:17 -07:00
|
|
|
const fieldNames = getWithDefault(this, 'schemaFieldNamesMappedToDataTypes', []).mapBy('fieldName');
|
2017-03-30 15:08:12 -07:00
|
|
|
|
|
|
|
if (fieldNamesAreUnique(fieldNames.sort())) {
|
2017-03-31 17:30:21 -07:00
|
|
|
return set(this, '_hasBadData', false);
|
2017-03-30 15:08:12 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
// Flag this component's data as problematic
|
|
|
|
set(this, '_hasBadData', true);
|
|
|
|
},
|
|
|
|
|
2017-03-27 18:26:09 -07:00
|
|
|
// Map logicalTypes to options consumable by ui
|
|
|
|
logicalTypes: ['', ...logicalTypes].map(value => ({
|
|
|
|
value,
|
2017-03-30 15:24:01 -07:00
|
|
|
label: value ? value.replace('_', ' ').toLowerCase().capitalize() : 'Please Select'
|
2017-03-24 20:27:43 -07:00
|
|
|
})),
|
|
|
|
|
2017-04-18 15:02:45 -07:00
|
|
|
/**
|
|
|
|
* @type {Boolean} cached boolean flag indicating that fields do contain a `kafka type`
|
|
|
|
* tracking header.
|
|
|
|
* Used to indicate to viewer that these fields are hidden.
|
|
|
|
*/
|
2017-05-01 09:57:17 -07:00
|
|
|
containsHiddenTrackingFields: computed('complianceDataFieldsSansHiddenTracking.length', function() {
|
|
|
|
// If their is a diff in complianceDataFields and complianceDataFieldsSansHiddenTracking,
|
|
|
|
// then we have hidden tracking fields
|
|
|
|
return get(this, 'complianceDataFieldsSansHiddenTracking.length') !== get(this, 'complianceDataFields.length');
|
|
|
|
}),
|
2017-04-18 15:02:45 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @type {Array.<Object>} Filters the mapped compliance data fields without `kafka type`
|
|
|
|
* tracking headers
|
|
|
|
*/
|
2017-05-01 09:57:17 -07:00
|
|
|
complianceDataFieldsSansHiddenTracking: computed('complianceDataFields.[]', function() {
|
|
|
|
return get(this, 'complianceDataFields').filter(({ identifierField }) => !isTrackingHeaderField(identifierField));
|
2017-04-18 15:02:45 -07:00
|
|
|
}),
|
|
|
|
|
2017-03-27 18:26:09 -07:00
|
|
|
/**
|
|
|
|
* Lists all dataset fields found in the `columns` performs an intersection
|
|
|
|
* of fields with the currently persisted and/or updated
|
|
|
|
* privacyCompliancePolicy.compliancePurgeEntities.
|
|
|
|
* The returned list is a map of fields with current or default privacy properties
|
|
|
|
*/
|
|
|
|
complianceDataFields: computed(
|
|
|
|
`${complianceListKey}.@each.identifierType`,
|
|
|
|
`${complianceListKey}.[]`,
|
|
|
|
'schemaFieldNamesMappedToDataTypes',
|
|
|
|
function() {
|
|
|
|
const sourceEntities = getWithDefault(this, complianceListKey, []);
|
|
|
|
const complianceFieldNames = sourceEntities.mapBy('identifierField');
|
|
|
|
|
|
|
|
const getAttributeOnField = (attribute, fieldName) => {
|
|
|
|
const sourceField = getWithDefault(this, complianceListKey, []).find(
|
|
|
|
({ identifierField }) => identifierField === fieldName
|
|
|
|
);
|
|
|
|
return sourceField ? sourceField[attribute] : null;
|
|
|
|
};
|
|
|
|
|
2017-03-30 15:08:12 -07:00
|
|
|
/**
|
|
|
|
* Get value for a list of attributes
|
|
|
|
* @param {Array} attributes list of attribute keys to pull from
|
|
|
|
* sourceField
|
|
|
|
* @param {String} fieldName name of the field to lookup
|
|
|
|
* @return {Array} list of attribute values
|
|
|
|
*/
|
|
|
|
const getAttributesOnField = (attributes = [], fieldName) =>
|
2017-05-01 09:57:17 -07:00
|
|
|
attributes.map(attr => getAttributeOnField(attr, fieldName));
|
2017-03-30 15:08:12 -07:00
|
|
|
|
2017-03-27 18:26:09 -07:00
|
|
|
// Set default or if already in policy, retrieve current values from
|
|
|
|
// privacyCompliancePolicy.compliancePurgeEntities
|
2017-05-01 09:57:17 -07:00
|
|
|
return getWithDefault(
|
|
|
|
this,
|
|
|
|
'schemaFieldNamesMappedToDataTypes',
|
|
|
|
[]
|
|
|
|
).map(({ fieldName: identifierField, dataType }) => {
|
|
|
|
const hasPrivacyData = complianceFieldNames.includes(identifierField);
|
|
|
|
const [identifierType, isSubject, logicalType] = getAttributesOnField(
|
|
|
|
['identifierType', 'isSubject', 'logicalType'],
|
|
|
|
identifierField
|
|
|
|
);
|
|
|
|
|
|
|
|
return {
|
|
|
|
dataType,
|
|
|
|
identifierField,
|
|
|
|
identifierType,
|
|
|
|
isSubject,
|
|
|
|
logicalType,
|
|
|
|
hasPrivacyData
|
|
|
|
};
|
|
|
|
});
|
2017-03-27 18:26:09 -07:00
|
|
|
}
|
|
|
|
),
|
|
|
|
|
|
|
|
// Compliance entities filtered for each identifierType
|
|
|
|
memberComplianceEntities: complianceEntitiesMatchingType('member'),
|
|
|
|
orgComplianceEntities: complianceEntitiesMatchingType('organization'),
|
|
|
|
groupComplianceEntities: complianceEntitiesMatchingType('group'),
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Changes the logicalType on a field.
|
|
|
|
* Ensures that the logicalType / format is applicable to the specified field
|
|
|
|
* @param {String} fieldName the fieldName identifying the field to be updated
|
|
|
|
* @param {String} format logicalType or format te field is in
|
|
|
|
* @return {String| void}
|
|
|
|
*/
|
|
|
|
changeFieldLogicalType(fieldName, format) {
|
2017-05-01 09:57:17 -07:00
|
|
|
const sourceField = get(this, complianceListKey).findBy('identifierField', fieldName);
|
2017-03-27 18:26:09 -07:00
|
|
|
|
|
|
|
if (sourceField && logicalTypes.includes(format)) {
|
|
|
|
return set(sourceField, 'logicalType', String(format).toUpperCase());
|
|
|
|
}
|
2017-02-13 14:51:31 -08:00
|
|
|
},
|
|
|
|
|
2017-03-27 18:26:09 -07:00
|
|
|
/**
|
|
|
|
* Adds or removes a field onto the
|
|
|
|
* privacyCompliancePolicy.compliancePurgeEntities list.
|
|
|
|
* @param {Object} props initial props for the field to be added
|
2017-03-30 15:08:12 -07:00
|
|
|
* @prop {String} props.identifierField
|
|
|
|
* @prop {String} props.dataType
|
2017-03-27 18:26:09 -07:00
|
|
|
* @param {String} identifierType the type of the field to toggle
|
|
|
|
* @param {('add'|'remove')} toggle operation to perform, can either be
|
|
|
|
* add or remove
|
|
|
|
* @return {Ember.Array|*}
|
|
|
|
*/
|
|
|
|
toggleFieldOnComplianceList(props, identifierType, toggle) {
|
2017-04-02 15:40:43 -07:00
|
|
|
const { identifierField, logicalType } = props;
|
2017-03-27 18:26:09 -07:00
|
|
|
const sourceEntities = get(this, complianceListKey);
|
|
|
|
|
|
|
|
if (!['add', 'remove'].includes(toggle)) {
|
|
|
|
throw new Error(`Unsupported toggle operation ${toggle}`);
|
2017-02-13 14:51:31 -08:00
|
|
|
}
|
|
|
|
|
2017-03-27 18:26:09 -07:00
|
|
|
return {
|
2017-03-24 20:27:43 -07:00
|
|
|
add() {
|
2017-03-27 18:26:09 -07:00
|
|
|
// Ensure that we don't currently have this field present on the
|
|
|
|
// privacyCompliancePolicy.compliancePurgeEntities list
|
|
|
|
if (!sourceEntities.findBy('identifierField', identifierField)) {
|
2017-04-02 15:40:43 -07:00
|
|
|
const addPurgeEntity = {
|
|
|
|
identifierType,
|
|
|
|
identifierField,
|
|
|
|
logicalType
|
|
|
|
};
|
2017-03-27 18:26:09 -07:00
|
|
|
|
|
|
|
return sourceEntities.setObjects([addPurgeEntity, ...sourceEntities]);
|
2017-02-13 14:51:31 -08:00
|
|
|
}
|
2017-03-24 20:27:43 -07:00
|
|
|
},
|
|
|
|
|
2017-03-30 15:08:12 -07:00
|
|
|
remove() {
|
2017-03-27 18:26:09 -07:00
|
|
|
// Remove the identifierType since we are removing it from the
|
|
|
|
// privacyCompliancePolicy.compliancePurgeEntities in case it
|
|
|
|
// is added back during the session
|
|
|
|
set(props, 'identifierType', null);
|
2017-05-01 09:57:17 -07:00
|
|
|
return sourceEntities.setObjects(sourceEntities.filter(item => item.identifierField !== identifierField));
|
2017-03-27 18:26:09 -07:00
|
|
|
}
|
2017-03-27 18:50:55 -07:00
|
|
|
}[toggle]();
|
2017-02-13 14:51:31 -08:00
|
|
|
},
|
|
|
|
|
2017-03-27 18:50:55 -07:00
|
|
|
/**
|
|
|
|
* Checks that each privacyCompliancePolicy.compliancePurgeEntities has
|
|
|
|
* a valid identifierType
|
|
|
|
* @param {Ember.Array} sourceEntities compliancePurgeEntities
|
|
|
|
* @return {Boolean} has or does not
|
|
|
|
*/
|
|
|
|
ensureTypeContainsFormat: sourceEntities =>
|
2017-05-01 09:57:17 -07:00
|
|
|
sourceEntities.every(entity => ['member', 'organization', 'group'].includes(get(entity, 'identifierType'))),
|
2017-03-27 18:50:55 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Checks that each privacyCompliancePolicy.compliancePurgeEntities has
|
|
|
|
* a valid logicalType
|
|
|
|
* @param {Ember.Array}sourceEntities compliancePurgeEntities
|
|
|
|
* @return {Boolean|*} Contains or does not
|
|
|
|
*/
|
|
|
|
ensureTypeContainsLogicalType: sourceEntities => {
|
2017-03-29 18:51:26 -07:00
|
|
|
const logicalTypesInUppercase = logicalTypes.map(type => type.toUpperCase());
|
2017-03-27 18:50:55 -07:00
|
|
|
|
2017-05-01 09:57:17 -07:00
|
|
|
return sourceEntities.every(entity => logicalTypesInUppercase.includes(get(entity, 'logicalType')));
|
2017-03-27 18:50:55 -07:00
|
|
|
},
|
2017-03-24 20:27:43 -07:00
|
|
|
|
2017-04-02 15:40:43 -07:00
|
|
|
/**
|
|
|
|
* TODO:DSS-6719 refactor into mixin
|
|
|
|
* Clears recently shown user messages
|
|
|
|
*/
|
|
|
|
clearMessages() {
|
|
|
|
return setProperties(this, {
|
|
|
|
_message: '',
|
|
|
|
_alertType: ''
|
|
|
|
});
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* TODO: DSS-6672 Extract to notifications service
|
|
|
|
* Helper method to update user when an async server update to the
|
|
|
|
* security specification is handled.
|
|
|
|
* @param {XMLHttpRequest|Promise|jqXHR|*} request the server request
|
|
|
|
* @param {String} [successMessage] optional _message for successful response
|
|
|
|
*/
|
|
|
|
whenRequestCompletes(request, { successMessage } = {}) {
|
|
|
|
Promise.resolve(request)
|
2017-04-11 16:02:41 -07:00
|
|
|
.then(({ status = 'error' }) => {
|
2017-04-02 15:40:43 -07:00
|
|
|
// The server api currently responds with an object containing
|
2017-04-11 16:02:41 -07:00
|
|
|
// a status when complete
|
2017-05-01 09:57:17 -07:00
|
|
|
return status === 'ok'
|
|
|
|
? setProperties(this, {
|
|
|
|
_message: successMessage || successUpdating,
|
|
|
|
_alertType: 'success'
|
|
|
|
})
|
|
|
|
: Promise.reject(new Error(`Reason code for this is ${status}`));
|
2017-04-02 15:40:43 -07:00
|
|
|
})
|
2017-04-11 16:02:41 -07:00
|
|
|
.catch(err => {
|
2017-04-02 15:40:43 -07:00
|
|
|
let _message = `${failedUpdating} \n ${err}`;
|
|
|
|
let _alertType = 'danger';
|
|
|
|
|
2017-04-11 16:02:41 -07:00
|
|
|
if (get(this, 'isNewPrivacyCompliancePolicy')) {
|
2017-05-01 09:57:17 -07:00
|
|
|
_message = 'This dataset does not have any previously saved fields with a identifying information.';
|
2017-04-02 15:40:43 -07:00
|
|
|
_alertType = 'info';
|
|
|
|
}
|
|
|
|
|
|
|
|
setProperties(this, {
|
|
|
|
_message,
|
|
|
|
_alertType
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
|
2017-02-13 14:51:31 -08:00
|
|
|
actions: {
|
2017-03-27 18:26:09 -07:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @param {String} identifierField id for the field to update
|
|
|
|
* @param {String} logicalType updated format to apply to the field
|
|
|
|
* @return {*|String|void} logicalType or void
|
|
|
|
*/
|
|
|
|
onFieldFormatChange({ identifierField }, { value: logicalType }) {
|
2017-04-02 15:40:43 -07:00
|
|
|
// TODO:DSS-6719 refactor into mixin
|
|
|
|
this.clearMessages();
|
2017-03-27 18:26:09 -07:00
|
|
|
return this.changeFieldLogicalType(identifierField, logicalType);
|
2017-02-13 14:51:31 -08:00
|
|
|
},
|
|
|
|
|
2017-03-27 18:26:09 -07:00
|
|
|
/**
|
|
|
|
* Toggles a field on / off the compliance list
|
|
|
|
* @param {String} identifierType the type of the field to be toggled on
|
|
|
|
* the privacyCompliancePolicy.compliancePurgeEntities list
|
|
|
|
* @param {Object|Ember.Object} props containing the props to be added
|
2017-03-30 15:08:12 -07:00
|
|
|
* @prop {Boolean} props.hasPrivacyData checked or not checked
|
2017-03-27 18:26:09 -07:00
|
|
|
* @return {*}
|
|
|
|
*/
|
|
|
|
onFieldPrivacyChange(identifierType, props) {
|
|
|
|
// If checked, add, otherwise remove
|
|
|
|
const { hasPrivacyData } = props;
|
2017-03-24 20:27:43 -07:00
|
|
|
const toggle = !hasPrivacyData ? 'add' : 'remove';
|
2017-02-13 14:51:31 -08:00
|
|
|
|
2017-04-02 15:40:43 -07:00
|
|
|
// TODO:DSS-6719 refactor into mixin
|
|
|
|
this.clearMessages();
|
|
|
|
|
2017-03-27 18:26:09 -07:00
|
|
|
return this.toggleFieldOnComplianceList(props, identifierType, toggle);
|
2017-02-13 14:51:31 -08:00
|
|
|
},
|
|
|
|
|
2017-03-27 00:08:08 -07:00
|
|
|
/**
|
|
|
|
* Toggles the isSubject property of a member identifiable field
|
2017-03-27 18:26:09 -07:00
|
|
|
* @param {Object} props the props on the member field to update
|
|
|
|
* @prop {Boolean} isSubject flag indicating this field as a subject owner
|
|
|
|
* when true
|
|
|
|
* @prop {String} identifierField unique field to update isSubject property
|
2017-03-27 00:08:08 -07:00
|
|
|
*/
|
2017-03-27 18:26:09 -07:00
|
|
|
onMemberFieldSubjectChange(props) {
|
|
|
|
const { isSubject, identifierField: name } = props;
|
|
|
|
|
2017-04-02 15:40:43 -07:00
|
|
|
// TODO:DSS-6719 refactor into mixin
|
|
|
|
this.clearMessages();
|
|
|
|
|
2017-03-27 18:26:09 -07:00
|
|
|
// Ensure that a flag isSubject is present on the props
|
|
|
|
if (props && 'isSubject' in props) {
|
2017-05-01 09:57:17 -07:00
|
|
|
const sourceField = get(this, complianceListKey).find(({ identifierField }) => identifierField === name);
|
2017-03-27 00:08:08 -07:00
|
|
|
|
2017-03-27 18:26:09 -07:00
|
|
|
set(sourceField, 'isSubject', !isSubject);
|
2017-03-27 00:08:08 -07:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2017-03-27 18:30:44 -07:00
|
|
|
/**
|
|
|
|
* Updates the state flags that transition the prompts from one to the next
|
|
|
|
* @param {String} sectionName name of the section that was changed
|
|
|
|
* @param {Boolean} isPrivacyIdentifiable flag indicating that a section has
|
|
|
|
* or does not have privacy identifier
|
|
|
|
*/
|
|
|
|
didChangePrivacyIdentifiable(sectionName, isPrivacyIdentifiable) {
|
|
|
|
const section = {
|
|
|
|
'has-group': 'group',
|
|
|
|
'has-org': 'org',
|
|
|
|
'has-member': 'member'
|
|
|
|
}[sectionName];
|
|
|
|
|
2017-05-01 09:57:17 -07:00
|
|
|
return set(this, `userIndicatesDatasetHas.${section}`, isPrivacyIdentifiable);
|
2017-02-13 14:51:31 -08:00
|
|
|
},
|
|
|
|
|
2017-03-27 18:50:55 -07:00
|
|
|
/**
|
|
|
|
* If all validity checks are passed, invoke onSave action on controller
|
|
|
|
*/
|
|
|
|
saveCompliance() {
|
2017-04-02 15:40:43 -07:00
|
|
|
const complianceList = get(this, complianceListKey);
|
2017-05-01 09:57:17 -07:00
|
|
|
const allEntitiesHaveValidFormat = this.ensureTypeContainsFormat(complianceList);
|
|
|
|
const allEntitiesHaveValidLogicalType = this.ensureTypeContainsLogicalType(complianceList);
|
2017-03-27 18:50:55 -07:00
|
|
|
|
|
|
|
if (allEntitiesHaveValidFormat && allEntitiesHaveValidLogicalType) {
|
2017-04-02 15:40:43 -07:00
|
|
|
return this.whenRequestCompletes(this.get('onSave')());
|
|
|
|
} else {
|
|
|
|
setProperties(this, {
|
|
|
|
_message: missingTypes,
|
|
|
|
_alertType: 'danger'
|
|
|
|
});
|
2017-03-27 18:50:55 -07:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2017-02-13 14:51:31 -08:00
|
|
|
// Rolls back changes made to the compliance spec to current
|
|
|
|
// server state
|
2017-03-27 18:26:09 -07:00
|
|
|
resetCompliance() {
|
2017-04-02 15:40:43 -07:00
|
|
|
const options = {
|
|
|
|
successMessage: 'Field classification has been reset to the previously saved state.'
|
|
|
|
};
|
|
|
|
this.whenRequestCompletes(get(this, 'onReset')(), options);
|
2017-02-13 14:51:31 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|