mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-06-13 07:57:26 +01:00
reviewd
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import { IPivotItemProps, IPivotProps, Pivot, PivotItem } from "@fluentui/react";
|
import { IPivotItemProps, IPivotProps, Pivot, PivotItem } from "@fluentui/react";
|
||||||
|
import { readCollection } from "Common/dataAccess/readCollection";
|
||||||
import {
|
import {
|
||||||
ComputedPropertiesComponent,
|
ComputedPropertiesComponent,
|
||||||
ComputedPropertiesComponentProps,
|
ComputedPropertiesComponentProps,
|
||||||
@@ -934,23 +935,12 @@ export class SettingsComponent extends React.Component<SettingsComponentProps, S
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
private refreshCollectionData = async (): Promise<void> => {
|
private refreshCollectionData = async (): Promise<void> => {
|
||||||
const storePolicy = useIndexingPolicyStore.getState().indexingPolicy;
|
const latestCollection = await readCollection(this.collection.databaseId, this.collection.id());
|
||||||
if (!storePolicy) {
|
this.collection.rawDataModel = latestCollection;
|
||||||
console.warn("No indexing policy found in store.");
|
this.collection.indexingPolicy(latestCollection.indexingPolicy);
|
||||||
return;
|
|
||||||
}
|
|
||||||
const indexingPolicy: DataModels.IndexingPolicy = {
|
|
||||||
...storePolicy,
|
|
||||||
automatic: storePolicy.automatic ?? true,
|
|
||||||
indexingMode: storePolicy.indexingMode ?? "consistent",
|
|
||||||
includedPaths: storePolicy.includedPaths ?? [],
|
|
||||||
excludedPaths: storePolicy.excludedPaths ?? [],
|
|
||||||
};
|
|
||||||
|
|
||||||
this.collection.indexingPolicy(indexingPolicy);
|
|
||||||
this.setState({
|
this.setState({
|
||||||
indexingPolicyContent: indexingPolicy,
|
indexingPolicyContent: latestCollection.indexingPolicy,
|
||||||
indexingPolicyContentBaseline: indexingPolicy,
|
indexingPolicyContentBaseline: latestCollection.indexingPolicy,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user