mirror of
https://github.com/datahub-project/datahub.git
synced 2025-08-30 20:15:56 +00:00
Merge pull request #1172 from theseyi/custom-input-init
compliance entity value pattern is nullable when idlogicaltype is not…
This commit is contained in:
commit
e59b7dd9e6
@ -164,7 +164,10 @@ export default class DatasetComplianceFieldTag extends Component {
|
||||
* @type {ComputedProperty<boolean>}
|
||||
*/
|
||||
showCustomInput = computed('tag.logicalType', function(this: DatasetComplianceFieldTag): boolean {
|
||||
const { logicalType } = get(this, 'tag');
|
||||
const { logicalType, valuePattern = '' } = get(this, 'tag');
|
||||
|
||||
this.actions.tagValuePatternDidChange.call(this, valuePattern);
|
||||
|
||||
return logicalType === IdLogicalType.Custom;
|
||||
});
|
||||
|
||||
|
@ -63,7 +63,7 @@ import { uniqBy } from 'lodash';
|
||||
import { IColumnFieldProps } from 'wherehows-web/typings/app/dataset-columns';
|
||||
import { isValidCustomValuePattern } from 'wherehows-web/utils/validators/urn';
|
||||
import { emptyRegexSource } from 'wherehows-web/utils/validators/regexp';
|
||||
import { NonIdLogicalType } from 'wherehows-web/constants/datasets/compliance';
|
||||
import { IdLogicalType, NonIdLogicalType } from 'wherehows-web/constants/datasets/compliance';
|
||||
import { pick } from 'lodash';
|
||||
import { trackableEvent, TrackableEventCategory } from 'wherehows-web/constants/analytics/event-tracking';
|
||||
|
||||
@ -957,7 +957,17 @@ export default class DatasetCompliance extends Component {
|
||||
* @param {IComplianceChangeSet.logicalType} logicalType the updated logical type
|
||||
*/
|
||||
tagLogicalTypeChanged(tag: IComplianceChangeSet, logicalType: IComplianceChangeSet['logicalType']): void {
|
||||
setProperties(tag, { logicalType, isDirty: true });
|
||||
let properties: Pick<IComplianceChangeSet, 'logicalType' | 'isDirty' | 'valuePattern'> = {
|
||||
logicalType,
|
||||
isDirty: true
|
||||
};
|
||||
|
||||
// nullifies valuePattern attr if logicalType is not IdLogicalType.Custom
|
||||
if (logicalType === IdLogicalType.Custom) {
|
||||
properties = { ...properties, valuePattern: null };
|
||||
}
|
||||
|
||||
setProperties(tag, properties);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -32,7 +32,7 @@ export interface IComplianceEntity {
|
||||
// field should also be filtered from persisted policy
|
||||
readonly readonly?: boolean;
|
||||
//Optional attribute for the value of a CUSTOM regex. Required for CUSTOM field format
|
||||
valuePattern?: string;
|
||||
valuePattern?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user