mirror of
https://github.com/datahub-project/datahub.git
synced 2026-01-01 12:24:53 +00:00
* Releases updated version of datahub-web client UI code * Fix typo in yarn lock * Change yarn lock to match yarn registry directories * Previous commit missed some paths * Even more changes to yarnlock missing in previous commit * Include codegen file for typings * Add files to get parity for datahub-web and current OS datahub-midtier * Add in typo fix from previous commit - change to proper license * Implement proper OS fix for person entity picture url * Workarounds for open source DH issues * Fixes institutional memory api and removes unopensourced tabs for datasets * Fixes search dataset deprecation and user search issue as a result of changes * Remove internal only options in the avatar menu
18 lines
999 B
TypeScript
18 lines
999 B
TypeScript
import { IComplianceDataType } from '@datahub/metadata-types/types/entity/dataset/compliance-data-types';
|
|
import DatasetComplianceAnnotation from '@datahub/data-models/entity/dataset/modules/compliance-annotation';
|
|
|
|
/**
|
|
* Retrieves the default security classification for an identifier type, or null if it does not exist
|
|
* @param {Array<IComplianceDataType>} [complianceDataTypes=[]] the list of compliance data types
|
|
* @param {ComplianceFieldIdValue} identifierType the compliance data type id string
|
|
* @returns {(IComplianceDataType['defaultSecurityClassification'] | null)}
|
|
*/
|
|
export const getDefaultSecurityClassification = (
|
|
complianceDataTypes: Array<IComplianceDataType> = [],
|
|
identifierType: DatasetComplianceAnnotation['identifierType']
|
|
): IComplianceDataType['defaultSecurityClassification'] | null => {
|
|
const complianceDataType = complianceDataTypes.findBy('id', identifierType || '');
|
|
|
|
return complianceDataType ? complianceDataType.defaultSecurityClassification : null;
|
|
};
|