Remove Explorer.isPreferredCassandraAPI (#654)

Co-authored-by: Steve Faulkner <471400+southpolesteve@users.noreply.github.com>
This commit is contained in:
Hardikkumar Nai
2021-04-18 02:24:47 +05:30
committed by GitHub
parent a264ea2275
commit 02ea26da71
30 changed files with 150 additions and 151 deletions

View File

@@ -34,9 +34,7 @@ describe("Collection", () => {
mockContainer.isPreferredApiMongoDB = ko.computed(() => {
return false;
});
mockContainer.isPreferredApiCassandra = ko.computed(() => {
return false;
});
mockContainer.isDatabaseNodeOrNoneSelected = () => {
return false;
};

View File

@@ -374,7 +374,7 @@ export default class Collection implements ViewModels.Collection {
dataExplorerArea: Constants.Areas.ResourceTree,
});
if (this.container.isPreferredApiCassandra() && !this.cassandraKeys) {
if (userContext.apiType === "Cassandra" && !this.cassandraKeys) {
(<CassandraAPIDataClient>this.container.tableDataClient).getTableKeys(this).then((keys: CassandraTableKeys) => {
this.cassandraKeys = keys;
});
@@ -391,7 +391,7 @@ export default class Collection implements ViewModels.Collection {
} else {
this.documentIds([]);
let title = `Entities`;
if (this.container.isPreferredApiCassandra()) {
if (userContext.apiType === "Cassandra") {
title = `Rows`;
}
const startKey: number = TelemetryProcessor.traceStart(Action.Tab, {
@@ -1084,7 +1084,7 @@ export default class Collection implements ViewModels.Collection {
if (this.container.isPreferredApiTable()) {
this.onTableEntitiesClick();
return;
} else if (this.container.isPreferredApiCassandra()) {
} else if (userContext.apiType === "Cassandra") {
this.onTableEntitiesClick();
return;
} else if (this.container.isPreferredApiGraph()) {
@@ -1104,7 +1104,7 @@ export default class Collection implements ViewModels.Collection {
public getLabel(): string {
if (this.container.isPreferredApiTable()) {
return "Entities";
} else if (this.container.isPreferredApiCassandra()) {
} else if (userContext.apiType === "Cassandra") {
return "Rows";
} else if (this.container.isPreferredApiGraph()) {
return "Graph";

View File

@@ -273,7 +273,7 @@ export class ResourceTreeAdapter implements ReactAdapter {
contextMenu: ResourceTreeContextMenuButtonFactory.createCollectionContextMenuButton(this.container, collection),
});
if (!this.container.isPreferredApiCassandra() || !this.container.isServerlessEnabled()) {
if (userContext.apiType !== "Cassandra" || !this.container.isServerlessEnabled()) {
children.push({
label: database.isDatabaseShared() || this.container.isServerlessEnabled() ? "Settings" : "Scale & Settings",
onClick: collection.onSettingsClick.bind(collection),