mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-19 17:01:13 +00:00
Remove explorer.is preferred api graph (#655)
Co-authored-by: Steve Faulkner <southpolesteve@gmail.com>
This commit is contained in:
@@ -14,7 +14,6 @@ describe("ContainerSampleGenerator", () => {
|
||||
const createExplorerStub = (database: ViewModels.Database): Explorer => {
|
||||
const explorerStub = {} as Explorer;
|
||||
explorerStub.databases = ko.observableArray<ViewModels.Database>([database]);
|
||||
explorerStub.isPreferredApiGraph = ko.computed<boolean>(() => false);
|
||||
explorerStub.isPreferredApiMongoDB = ko.computed<boolean>(() => false);
|
||||
explorerStub.isPreferredApiTable = ko.computed<boolean>(() => false);
|
||||
explorerStub.canExceedMaximumValue = ko.computed<boolean>(() => false);
|
||||
@@ -115,7 +114,13 @@ describe("ContainerSampleGenerator", () => {
|
||||
collection.databaseId = database.id();
|
||||
|
||||
const explorerStub = createExplorerStub(database);
|
||||
explorerStub.isPreferredApiGraph = ko.computed<boolean>(() => true);
|
||||
updateUserContext({
|
||||
databaseAccount: {
|
||||
properties: {
|
||||
capabilities: [{ name: "EnableGremlin" }],
|
||||
},
|
||||
} as DatabaseAccount,
|
||||
});
|
||||
|
||||
const generator = await ContainerSampleGenerator.createSampleGeneratorAsync(explorerStub);
|
||||
generator.setData(sampleData);
|
||||
|
||||
@@ -73,7 +73,7 @@ export class ContainerSampleGenerator {
|
||||
}
|
||||
const promises: Q.Promise<any>[] = [];
|
||||
|
||||
if (this.container.isPreferredApiGraph()) {
|
||||
if (userContext.apiType === "Gremlin") {
|
||||
// For Gremlin, all queries are executed sequentially, because some queries might be dependent on other queries
|
||||
// (e.g. adding edge requires vertices to be present)
|
||||
const queries: string[] = this.sampleDataFile.data;
|
||||
|
||||
@@ -57,6 +57,6 @@ export class DataSamplesUtil {
|
||||
}
|
||||
|
||||
public isSampleContainerCreationSupported(): boolean {
|
||||
return userContext.apiType === "SQL" || this.container.isPreferredApiGraph();
|
||||
return userContext.apiType === "SQL" || userContext.apiType === "Gremlin";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user