diff --git a/wherehows-web/app/components/dataset-compliance.ts b/wherehows-web/app/components/dataset-compliance.ts index 3a71b99189..064f140dfb 100644 --- a/wherehows-web/app/components/dataset-compliance.ts +++ b/wherehows-web/app/components/dataset-compliance.ts @@ -1173,7 +1173,16 @@ export default class DatasetCompliance extends Component { }); } - const policy = Object.assign({}, getProperties(currentPolicy, ['datasetClassification', 'complianceEntities'])); + const policy = Object.assign( + {}, + getProperties(currentPolicy, [ + 'datasetClassification', + 'complianceEntities', + 'compliancePurgeNote', + 'complianceType', + 'confidentiality' + ]) + ); const href = `data:text/json;charset=utf-8,${encodeURIComponent(JSON.stringify(policy))}`; const download = `${get(this, 'datasetName')}_policy.json`; const anchor = document.createElement('a'); diff --git a/wherehows-web/app/utils/datasets/compliance/metadata-schema.ts b/wherehows-web/app/utils/datasets/compliance/metadata-schema.ts index 1d7e754d81..ad57ec5024 100644 --- a/wherehows-web/app/utils/datasets/compliance/metadata-schema.ts +++ b/wherehows-web/app/utils/datasets/compliance/metadata-schema.ts @@ -33,7 +33,7 @@ const datasetClassificationPropType = (prop: string): IMetadataType => ({ /** * Defines the shape of the dataset compliance metadata json object using the IMetadataType interface - * @type {({'@type': string; '@name': string; '@props': Array} | {'@type': string; '@name': string; '@props': ({'@name': string; '@type': string} | {'@name': string; '@type': string[]} | {'@name': string; '@type': string[]; '@symbols': any[]} | {'@type': string[]; '@name': string})[]})[]} + * @type {Array} */ const complianceMetadataTaxonomy: Array = [ { @@ -71,6 +71,18 @@ const complianceMetadataTaxonomy: Array = [ '@type': ['string', 'null'] } ] + }, + { + '@type': ['string', 'null'], + '@name': 'compliancePurgeNote' + }, + { + '@type': 'string', + '@name': 'complianceType' + }, + { + '@type': ['string', 'null'], + '@name': 'confidentiality' } ]; @@ -104,11 +116,13 @@ const keyValueHasMatch = (object: IObject) => (metadataType: IMetadataType) const innerType = metadataType['@props']; if (type.includes('object') && isObject(value)) { + // recurse on object properties return rootValueEquiv && keysEquiv(value, innerType!); } if (type.includes('array') && Array.isArray(value)) { return ( + // recursively reduce on array elements rootValueEquiv && arrayReduce((isEquiv: boolean, value: any) => isEquiv && keysEquiv(value, innerType!), rootValueEquiv)(value) );