mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-19 00:41:31 +00:00
fixed the issue of ddm (#2239)
* fixed the issue of ddm * fixed the ddm issue * updated test and ploicyvaluebtdefault as true * fixed test --------- Co-authored-by: Sakshi Gupta <sakshig@microsoft.com>
This commit is contained in:
@@ -842,7 +842,7 @@ export class SettingsComponent extends React.Component<SettingsComponentProps, S
|
||||
const dataMaskingContent: DataModels.DataMaskingPolicy = {
|
||||
includedPaths: this.collection.dataMaskingPolicy?.()?.includedPaths || [],
|
||||
excludedPaths: this.collection.dataMaskingPolicy?.()?.excludedPaths || [],
|
||||
isPolicyEnabled: this.collection.dataMaskingPolicy?.()?.isPolicyEnabled || false,
|
||||
isPolicyEnabled: this.collection.dataMaskingPolicy?.()?.isPolicyEnabled ?? true,
|
||||
};
|
||||
const conflictResolutionPolicy: DataModels.ConflictResolutionPolicy =
|
||||
this.collection.conflictResolutionPolicy && this.collection.conflictResolutionPolicy();
|
||||
@@ -1072,7 +1072,11 @@ export class SettingsComponent extends React.Component<SettingsComponentProps, S
|
||||
newCollection.vectorEmbeddingPolicy = this.state.vectorEmbeddingPolicy;
|
||||
|
||||
newCollection.fullTextPolicy = this.state.fullTextPolicy;
|
||||
|
||||
// Only send data masking policy if it was modified (dirty)
|
||||
if (this.state.isDataMaskingDirty && isCapabilityEnabled(Constants.CapabilityNames.EnableDynamicDataMasking)) {
|
||||
newCollection.dataMaskingPolicy = this.state.dataMaskingContent;
|
||||
}
|
||||
|
||||
newCollection.indexingPolicy = this.state.indexingPolicyContent;
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ const emptyDataMaskingPolicy: DataModels.DataMaskingPolicy = {
|
||||
},
|
||||
],
|
||||
excludedPaths: [],
|
||||
isPolicyEnabled: false,
|
||||
isPolicyEnabled: true,
|
||||
};
|
||||
|
||||
export class DataMaskingComponent extends React.Component<DataMaskingComponentProps, DataMaskingComponentState> {
|
||||
|
||||
@@ -141,7 +141,7 @@ export default class Collection implements ViewModels.Collection {
|
||||
const defaultDataMaskingPolicy: DataModels.DataMaskingPolicy = {
|
||||
includedPaths: Array<{ path: string; strategy: string; startPosition: number; length: number }>(),
|
||||
excludedPaths: Array<string>(),
|
||||
isPolicyEnabled: false,
|
||||
isPolicyEnabled: true,
|
||||
};
|
||||
const observablePolicy = ko.observable(data.dataMaskingPolicy || defaultDataMaskingPolicy);
|
||||
observablePolicy.subscribe(() => {});
|
||||
|
||||
Reference in New Issue
Block a user