mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-02-16 17:25:58 +00:00
Remove Explorer.isPreferredApiTable (#656)
Co-authored-by: Steve Faulkner <southpolesteve@gmail.com>
This commit is contained in:
parent
ff58eb3724
commit
9d411c57b0
@ -321,7 +321,7 @@ export class SubSettingsComponent extends React.Component<SubSettingsComponentPr
|
|||||||
public getPartitionKeyVisible = (): boolean => {
|
public getPartitionKeyVisible = (): boolean => {
|
||||||
if (
|
if (
|
||||||
userContext.apiType === "Cassandra" ||
|
userContext.apiType === "Cassandra" ||
|
||||||
this.props.container.isPreferredApiTable() ||
|
userContext.apiType === "Tables" ||
|
||||||
!this.props.collection.partitionKeyProperty ||
|
!this.props.collection.partitionKeyProperty ||
|
||||||
(this.props.container.isPreferredApiMongoDB() && this.props.collection.partitionKey.systemKey)
|
(this.props.container.isPreferredApiMongoDB() && this.props.collection.partitionKey.systemKey)
|
||||||
) {
|
) {
|
||||||
|
@ -561,7 +561,6 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
"isNotebookEnabled": [Function],
|
"isNotebookEnabled": [Function],
|
||||||
"isNotebooksEnabledForAccount": [Function],
|
"isNotebooksEnabledForAccount": [Function],
|
||||||
"isPreferredApiMongoDB": [Function],
|
"isPreferredApiMongoDB": [Function],
|
||||||
"isPreferredApiTable": [Function],
|
|
||||||
"isPublishNotebookPaneEnabled": [Function],
|
"isPublishNotebookPaneEnabled": [Function],
|
||||||
"isResourceTokenCollectionNodeSelected": [Function],
|
"isResourceTokenCollectionNodeSelected": [Function],
|
||||||
"isRightPanelV2Enabled": [Function],
|
"isRightPanelV2Enabled": [Function],
|
||||||
@ -1222,7 +1221,6 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
"isNotebookEnabled": [Function],
|
"isNotebookEnabled": [Function],
|
||||||
"isNotebooksEnabledForAccount": [Function],
|
"isNotebooksEnabledForAccount": [Function],
|
||||||
"isPreferredApiMongoDB": [Function],
|
"isPreferredApiMongoDB": [Function],
|
||||||
"isPreferredApiTable": [Function],
|
|
||||||
"isPublishNotebookPaneEnabled": [Function],
|
"isPublishNotebookPaneEnabled": [Function],
|
||||||
"isResourceTokenCollectionNodeSelected": [Function],
|
"isResourceTokenCollectionNodeSelected": [Function],
|
||||||
"isRightPanelV2Enabled": [Function],
|
"isRightPanelV2Enabled": [Function],
|
||||||
@ -1896,7 +1894,6 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
"isNotebookEnabled": [Function],
|
"isNotebookEnabled": [Function],
|
||||||
"isNotebooksEnabledForAccount": [Function],
|
"isNotebooksEnabledForAccount": [Function],
|
||||||
"isPreferredApiMongoDB": [Function],
|
"isPreferredApiMongoDB": [Function],
|
||||||
"isPreferredApiTable": [Function],
|
|
||||||
"isPublishNotebookPaneEnabled": [Function],
|
"isPublishNotebookPaneEnabled": [Function],
|
||||||
"isResourceTokenCollectionNodeSelected": [Function],
|
"isResourceTokenCollectionNodeSelected": [Function],
|
||||||
"isRightPanelV2Enabled": [Function],
|
"isRightPanelV2Enabled": [Function],
|
||||||
@ -2557,7 +2554,6 @@ exports[`SettingsComponent renders 1`] = `
|
|||||||
"isNotebookEnabled": [Function],
|
"isNotebookEnabled": [Function],
|
||||||
"isNotebooksEnabledForAccount": [Function],
|
"isNotebooksEnabledForAccount": [Function],
|
||||||
"isPreferredApiMongoDB": [Function],
|
"isPreferredApiMongoDB": [Function],
|
||||||
"isPreferredApiTable": [Function],
|
|
||||||
"isPublishNotebookPaneEnabled": [Function],
|
"isPublishNotebookPaneEnabled": [Function],
|
||||||
"isResourceTokenCollectionNodeSelected": [Function],
|
"isResourceTokenCollectionNodeSelected": [Function],
|
||||||
"isRightPanelV2Enabled": [Function],
|
"isRightPanelV2Enabled": [Function],
|
||||||
|
@ -15,7 +15,6 @@ describe("ContainerSampleGenerator", () => {
|
|||||||
const explorerStub = {} as Explorer;
|
const explorerStub = {} as Explorer;
|
||||||
explorerStub.databases = ko.observableArray<ViewModels.Database>([database]);
|
explorerStub.databases = ko.observableArray<ViewModels.Database>([database]);
|
||||||
explorerStub.isPreferredApiMongoDB = ko.computed<boolean>(() => false);
|
explorerStub.isPreferredApiMongoDB = ko.computed<boolean>(() => false);
|
||||||
explorerStub.isPreferredApiTable = ko.computed<boolean>(() => false);
|
|
||||||
explorerStub.canExceedMaximumValue = ko.computed<boolean>(() => false);
|
explorerStub.canExceedMaximumValue = ko.computed<boolean>(() => false);
|
||||||
explorerStub.findDatabaseWithId = () => database;
|
explorerStub.findDatabaseWithId = () => database;
|
||||||
explorerStub.refreshAllDatabases = () => Q.resolve();
|
explorerStub.refreshAllDatabases = () => Q.resolve();
|
||||||
|
@ -124,12 +124,6 @@ export default class Explorer {
|
|||||||
* Compare a string with userContext.apiType instead: userContext.apiType === "Mongo"
|
* Compare a string with userContext.apiType instead: userContext.apiType === "Mongo"
|
||||||
* */
|
* */
|
||||||
public isPreferredApiMongoDB: ko.Computed<boolean>;
|
public isPreferredApiMongoDB: ko.Computed<boolean>;
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated
|
|
||||||
* Compare a string with userContext.apiType instead: userContext.apiType === "Tables"
|
|
||||||
* */
|
|
||||||
public isPreferredApiTable: ko.Computed<boolean>;
|
|
||||||
public isFixedCollectionWithSharedThroughputSupported: ko.Computed<boolean>;
|
public isFixedCollectionWithSharedThroughputSupported: ko.Computed<boolean>;
|
||||||
/**
|
/**
|
||||||
* @deprecated
|
* @deprecated
|
||||||
@ -402,11 +396,6 @@ export default class Explorer {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
this.isPreferredApiTable = ko.computed(() => {
|
|
||||||
const defaultExperience = (this.defaultExperience && this.defaultExperience()) || "";
|
|
||||||
return defaultExperience.toLowerCase() === Constants.DefaultAccountExperience.Table.toLowerCase();
|
|
||||||
});
|
|
||||||
|
|
||||||
this.isFixedCollectionWithSharedThroughputSupported = ko.computed(() => {
|
this.isFixedCollectionWithSharedThroughputSupported = ko.computed(() => {
|
||||||
if (userContext.features.enableFixedCollectionWithSharedThroughput) {
|
if (userContext.features.enableFixedCollectionWithSharedThroughput) {
|
||||||
return true;
|
return true;
|
||||||
@ -499,7 +488,7 @@ export default class Explorer {
|
|||||||
});
|
});
|
||||||
|
|
||||||
this.addCollectionPane = new AddCollectionPane({
|
this.addCollectionPane = new AddCollectionPane({
|
||||||
isPreferredApiTable: ko.computed(() => this.isPreferredApiTable()),
|
isPreferredApiTable: ko.computed(() => userContext.apiType === "Tables"),
|
||||||
id: "addcollectionpane",
|
id: "addcollectionpane",
|
||||||
visible: ko.observable<boolean>(false),
|
visible: ko.observable<boolean>(false),
|
||||||
|
|
||||||
|
@ -29,7 +29,6 @@ export class CommandBarComponentAdapter implements ReactAdapter {
|
|||||||
|
|
||||||
// These are the parameters watched by the react binding that will trigger a renderComponent() if one of the ko mutates
|
// These are the parameters watched by the react binding that will trigger a renderComponent() if one of the ko mutates
|
||||||
const toWatch = [
|
const toWatch = [
|
||||||
container.isPreferredApiTable,
|
|
||||||
container.isPreferredApiMongoDB,
|
container.isPreferredApiMongoDB,
|
||||||
container.deleteCollectionText,
|
container.deleteCollectionText,
|
||||||
container.deleteDatabaseText,
|
container.deleteDatabaseText,
|
||||||
|
@ -16,7 +16,13 @@ describe("CommandBarComponentButtonFactory tests", () => {
|
|||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
mockExplorer = {} as Explorer;
|
mockExplorer = {} as Explorer;
|
||||||
mockExplorer.addCollectionText = ko.observable("mockText");
|
mockExplorer.addCollectionText = ko.observable("mockText");
|
||||||
mockExplorer.isPreferredApiTable = ko.computed(() => true);
|
updateUserContext({
|
||||||
|
databaseAccount: {
|
||||||
|
properties: {
|
||||||
|
capabilities: [{ name: "EnableTable" }],
|
||||||
|
},
|
||||||
|
} as DatabaseAccount,
|
||||||
|
});
|
||||||
mockExplorer.isPreferredApiMongoDB = ko.computed<boolean>(() => false);
|
mockExplorer.isPreferredApiMongoDB = ko.computed<boolean>(() => false);
|
||||||
mockExplorer.isSparkEnabled = ko.observable(true);
|
mockExplorer.isSparkEnabled = ko.observable(true);
|
||||||
mockExplorer.isSynapseLinkUpdating = ko.observable(false);
|
mockExplorer.isSynapseLinkUpdating = ko.observable(false);
|
||||||
@ -54,7 +60,13 @@ describe("CommandBarComponentButtonFactory tests", () => {
|
|||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
mockExplorer = {} as Explorer;
|
mockExplorer = {} as Explorer;
|
||||||
mockExplorer.addCollectionText = ko.observable("mockText");
|
mockExplorer.addCollectionText = ko.observable("mockText");
|
||||||
mockExplorer.isPreferredApiTable = ko.computed(() => true);
|
updateUserContext({
|
||||||
|
databaseAccount: {
|
||||||
|
properties: {
|
||||||
|
capabilities: [{ name: "EnableTable" }],
|
||||||
|
},
|
||||||
|
} as DatabaseAccount,
|
||||||
|
});
|
||||||
mockExplorer.isPreferredApiMongoDB = ko.computed<boolean>(() => false);
|
mockExplorer.isPreferredApiMongoDB = ko.computed<boolean>(() => false);
|
||||||
mockExplorer.isSynapseLinkUpdating = ko.observable(false);
|
mockExplorer.isSynapseLinkUpdating = ko.observable(false);
|
||||||
mockExplorer.isSparkEnabled = ko.observable(true);
|
mockExplorer.isSparkEnabled = ko.observable(true);
|
||||||
@ -117,7 +129,13 @@ describe("CommandBarComponentButtonFactory tests", () => {
|
|||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
mockExplorer = {} as Explorer;
|
mockExplorer = {} as Explorer;
|
||||||
mockExplorer.addCollectionText = ko.observable("mockText");
|
mockExplorer.addCollectionText = ko.observable("mockText");
|
||||||
mockExplorer.isPreferredApiTable = ko.computed(() => true);
|
updateUserContext({
|
||||||
|
databaseAccount: {
|
||||||
|
properties: {
|
||||||
|
capabilities: [{ name: "EnableTable" }],
|
||||||
|
},
|
||||||
|
} as DatabaseAccount,
|
||||||
|
});
|
||||||
mockExplorer.isSparkEnabled = ko.observable(true);
|
mockExplorer.isSparkEnabled = ko.observable(true);
|
||||||
mockExplorer.isSynapseLinkUpdating = ko.observable(false);
|
mockExplorer.isSynapseLinkUpdating = ko.observable(false);
|
||||||
|
|
||||||
@ -195,8 +213,15 @@ describe("CommandBarComponentButtonFactory tests", () => {
|
|||||||
|
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
mockExplorer = {} as Explorer;
|
mockExplorer = {} as Explorer;
|
||||||
|
mockExplorer.addDatabaseText = ko.observable("mockText");
|
||||||
mockExplorer.addCollectionText = ko.observable("mockText");
|
mockExplorer.addCollectionText = ko.observable("mockText");
|
||||||
mockExplorer.isPreferredApiTable = ko.computed(() => true);
|
updateUserContext({
|
||||||
|
databaseAccount: {
|
||||||
|
properties: {
|
||||||
|
capabilities: [{ name: "EnableTable" }],
|
||||||
|
},
|
||||||
|
} as DatabaseAccount,
|
||||||
|
});
|
||||||
mockExplorer.isPreferredApiMongoDB = ko.computed<boolean>(() => false);
|
mockExplorer.isPreferredApiMongoDB = ko.computed<boolean>(() => false);
|
||||||
mockExplorer.isSynapseLinkUpdating = ko.observable(false);
|
mockExplorer.isSynapseLinkUpdating = ko.observable(false);
|
||||||
mockExplorer.isSparkEnabled = ko.observable(true);
|
mockExplorer.isSparkEnabled = ko.observable(true);
|
||||||
@ -226,6 +251,7 @@ describe("CommandBarComponentButtonFactory tests", () => {
|
|||||||
},
|
},
|
||||||
} as DatabaseAccount,
|
} as DatabaseAccount,
|
||||||
});
|
});
|
||||||
|
console.log(mockExplorer);
|
||||||
const buttons = CommandBarComponentButtonFactory.createStaticCommandBarButtons(mockExplorer);
|
const buttons = CommandBarComponentButtonFactory.createStaticCommandBarButtons(mockExplorer);
|
||||||
const openCassandraShellBtn = buttons.find((button) => button.commandButtonLabel === openCassandraShellBtnLabel);
|
const openCassandraShellBtn = buttons.find((button) => button.commandButtonLabel === openCassandraShellBtnLabel);
|
||||||
expect(openCassandraShellBtn).toBeUndefined();
|
expect(openCassandraShellBtn).toBeUndefined();
|
||||||
@ -288,7 +314,13 @@ describe("CommandBarComponentButtonFactory tests", () => {
|
|||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
mockExplorer = {} as Explorer;
|
mockExplorer = {} as Explorer;
|
||||||
mockExplorer.addCollectionText = ko.observable("mockText");
|
mockExplorer.addCollectionText = ko.observable("mockText");
|
||||||
mockExplorer.isPreferredApiTable = ko.computed(() => true);
|
updateUserContext({
|
||||||
|
databaseAccount: {
|
||||||
|
properties: {
|
||||||
|
capabilities: [{ name: "EnableTable" }],
|
||||||
|
},
|
||||||
|
} as DatabaseAccount,
|
||||||
|
});
|
||||||
mockExplorer.isPreferredApiMongoDB = ko.computed<boolean>(() => false);
|
mockExplorer.isPreferredApiMongoDB = ko.computed<boolean>(() => false);
|
||||||
|
|
||||||
mockExplorer.isSynapseLinkUpdating = ko.observable(false);
|
mockExplorer.isSynapseLinkUpdating = ko.observable(false);
|
||||||
|
@ -47,7 +47,7 @@ export function createStaticCommandBarButtons(container: Explorer): CommandButto
|
|||||||
buttons.push(addSynapseLink);
|
buttons.push(addSynapseLink);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!container.isPreferredApiTable()) {
|
if (userContext.apiType !== "Tables") {
|
||||||
newCollectionBtn.children = [createNewCollectionGroup(container)];
|
newCollectionBtn.children = [createNewCollectionGroup(container)];
|
||||||
const newDatabaseBtn = createNewDatabase(container);
|
const newDatabaseBtn = createNewDatabase(container);
|
||||||
newCollectionBtn.children.push(newDatabaseBtn);
|
newCollectionBtn.children.push(newDatabaseBtn);
|
||||||
|
@ -331,7 +331,7 @@ export default class AddCollectionPane extends ContextualPaneBase {
|
|||||||
|
|
||||||
if (currentCollections >= maxCollections) {
|
if (currentCollections >= maxCollections) {
|
||||||
let typeOfContainer = "collection";
|
let typeOfContainer = "collection";
|
||||||
if (userContext.apiType === "Gremlin" || this.container.isPreferredApiTable()) {
|
if (userContext.apiType === "Gremlin" || userContext.apiType === "Tables") {
|
||||||
typeOfContainer = "container";
|
typeOfContainer = "container";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -392,7 +392,7 @@ export default class AddCollectionPane extends ContextualPaneBase {
|
|||||||
});
|
});
|
||||||
|
|
||||||
this.partitionKeyVisible = ko.computed<boolean>(() => {
|
this.partitionKeyVisible = ko.computed<boolean>(() => {
|
||||||
if (this.container == null || !!this.container.isPreferredApiTable()) {
|
if (this.container == null || userContext.apiType === "Tables") {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -757,7 +757,7 @@ export default class AddCollectionPane extends ContextualPaneBase {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!!this.container.isPreferredApiTable()) {
|
if (userContext.apiType === "Tables") {
|
||||||
// Table require fixed Database: TablesDB, and fixed Partition Key: /'$pk'
|
// Table require fixed Database: TablesDB, and fixed Partition Key: /'$pk'
|
||||||
this.databaseId(SharedConstants.CollectionCreation.TablesAPIDefaultDatabase);
|
this.databaseId(SharedConstants.CollectionCreation.TablesAPIDefaultDatabase);
|
||||||
this.partitionKey("/'$pk'");
|
this.partitionKey("/'$pk'");
|
||||||
@ -954,7 +954,7 @@ export default class AddCollectionPane extends ContextualPaneBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public isNonTableApi = (): boolean => {
|
public isNonTableApi = (): boolean => {
|
||||||
return !this.container.isPreferredApiTable();
|
return userContext.apiType !== "Tables";
|
||||||
};
|
};
|
||||||
|
|
||||||
public isUnlimitedStorageSelected = (): boolean => {
|
public isUnlimitedStorageSelected = (): boolean => {
|
||||||
@ -1028,7 +1028,7 @@ export default class AddCollectionPane extends ContextualPaneBase {
|
|||||||
|
|
||||||
private _setFocus() {
|
private _setFocus() {
|
||||||
// Autofocus is enabled on AddCollectionPane based on the preferred API
|
// Autofocus is enabled on AddCollectionPane based on the preferred API
|
||||||
if (this.container.isPreferredApiTable()) {
|
if (userContext.apiType === "Tables") {
|
||||||
const focusTableId = document.getElementById("containerId");
|
const focusTableId = document.getElementById("containerId");
|
||||||
focusTableId && focusTableId.focus();
|
focusTableId && focusTableId.focus();
|
||||||
return;
|
return;
|
||||||
|
@ -537,7 +537,6 @@ exports[`Settings Pane should render Default properly 1`] = `
|
|||||||
"isNotebookEnabled": [Function],
|
"isNotebookEnabled": [Function],
|
||||||
"isNotebooksEnabledForAccount": [Function],
|
"isNotebooksEnabledForAccount": [Function],
|
||||||
"isPreferredApiMongoDB": [Function],
|
"isPreferredApiMongoDB": [Function],
|
||||||
"isPreferredApiTable": [Function],
|
|
||||||
"isPublishNotebookPaneEnabled": [Function],
|
"isPublishNotebookPaneEnabled": [Function],
|
||||||
"isResourceTokenCollectionNodeSelected": [Function],
|
"isResourceTokenCollectionNodeSelected": [Function],
|
||||||
"isRightPanelV2Enabled": [Function],
|
"isRightPanelV2Enabled": [Function],
|
||||||
@ -1321,7 +1320,6 @@ exports[`Settings Pane should render Gremlin properly 1`] = `
|
|||||||
"isNotebookEnabled": [Function],
|
"isNotebookEnabled": [Function],
|
||||||
"isNotebooksEnabledForAccount": [Function],
|
"isNotebooksEnabledForAccount": [Function],
|
||||||
"isPreferredApiMongoDB": [Function],
|
"isPreferredApiMongoDB": [Function],
|
||||||
"isPreferredApiTable": [Function],
|
|
||||||
"isPublishNotebookPaneEnabled": [Function],
|
"isPublishNotebookPaneEnabled": [Function],
|
||||||
"isResourceTokenCollectionNodeSelected": [Function],
|
"isResourceTokenCollectionNodeSelected": [Function],
|
||||||
"isRightPanelV2Enabled": [Function],
|
"isRightPanelV2Enabled": [Function],
|
||||||
|
@ -69,7 +69,7 @@ export default class EditTableEntityPane extends TableEntityPane {
|
|||||||
|
|
||||||
public open() {
|
public open() {
|
||||||
this.displayedAttributes(this.constructDisplayedAttributes(this.originEntity));
|
this.displayedAttributes(this.constructDisplayedAttributes(this.originEntity));
|
||||||
if (this.container.isPreferredApiTable()) {
|
if (userContext.apiType === "Tables") {
|
||||||
this.originalDocument = TableEntityProcessor.convertEntitiesToDocuments(
|
this.originalDocument = TableEntityProcessor.convertEntitiesToDocuments(
|
||||||
[<Entities.ITableEntityForTablesAPI>this.originEntity],
|
[<Entities.ITableEntityForTablesAPI>this.originEntity],
|
||||||
this.tableViewModel.queryTablesTab.collection
|
this.tableViewModel.queryTablesTab.collection
|
||||||
|
@ -537,7 +537,6 @@ exports[`Upload Items Pane should render Default properly 1`] = `
|
|||||||
"isNotebookEnabled": [Function],
|
"isNotebookEnabled": [Function],
|
||||||
"isNotebooksEnabledForAccount": [Function],
|
"isNotebooksEnabledForAccount": [Function],
|
||||||
"isPreferredApiMongoDB": [Function],
|
"isPreferredApiMongoDB": [Function],
|
||||||
"isPreferredApiTable": [Function],
|
|
||||||
"isPublishNotebookPaneEnabled": [Function],
|
"isPublishNotebookPaneEnabled": [Function],
|
||||||
"isResourceTokenCollectionNodeSelected": [Function],
|
"isResourceTokenCollectionNodeSelected": [Function],
|
||||||
"isRightPanelV2Enabled": [Function],
|
"isRightPanelV2Enabled": [Function],
|
||||||
|
@ -540,7 +540,6 @@ exports[`Delete Database Confirmation Pane submit() Should call delete database
|
|||||||
"isNotebookEnabled": [Function],
|
"isNotebookEnabled": [Function],
|
||||||
"isNotebooksEnabledForAccount": [Function],
|
"isNotebooksEnabledForAccount": [Function],
|
||||||
"isPreferredApiMongoDB": [Function],
|
"isPreferredApiMongoDB": [Function],
|
||||||
"isPreferredApiTable": [Function],
|
|
||||||
"isPublishNotebookPaneEnabled": [Function],
|
"isPublishNotebookPaneEnabled": [Function],
|
||||||
"isResourceTokenCollectionNodeSelected": [Function],
|
"isResourceTokenCollectionNodeSelected": [Function],
|
||||||
"isRightPanelV2Enabled": [Function],
|
"isRightPanelV2Enabled": [Function],
|
||||||
|
@ -47,7 +47,7 @@ export default class QueryTablesTab extends TabsBase {
|
|||||||
this.tableEntityListViewModel().queryTablesTab = this;
|
this.tableEntityListViewModel().queryTablesTab = this;
|
||||||
this.queryViewModel(new QueryViewModel(this));
|
this.queryViewModel(new QueryViewModel(this));
|
||||||
const sampleQuerySubscription = this.tableEntityListViewModel().items.subscribe(() => {
|
const sampleQuerySubscription = this.tableEntityListViewModel().items.subscribe(() => {
|
||||||
if (this.tableEntityListViewModel().items().length > 0 && this.container.isPreferredApiTable()) {
|
if (this.tableEntityListViewModel().items().length > 0 && userContext.apiType === "Tables") {
|
||||||
this.queryViewModel().queryBuilderViewModel().setExample();
|
this.queryViewModel().queryBuilderViewModel().setExample();
|
||||||
}
|
}
|
||||||
sampleQuerySubscription.dispose();
|
sampleQuerySubscription.dispose();
|
||||||
|
@ -1069,7 +1069,7 @@ export default class Collection implements ViewModels.Collection {
|
|||||||
* Top-level method that will open the correct tab type depending on account API
|
* Top-level method that will open the correct tab type depending on account API
|
||||||
*/
|
*/
|
||||||
public openTab(): void {
|
public openTab(): void {
|
||||||
if (this.container.isPreferredApiTable()) {
|
if (userContext.apiType === "Tables") {
|
||||||
this.onTableEntitiesClick();
|
this.onTableEntitiesClick();
|
||||||
return;
|
return;
|
||||||
} else if (userContext.apiType === "Cassandra") {
|
} else if (userContext.apiType === "Cassandra") {
|
||||||
@ -1090,7 +1090,7 @@ export default class Collection implements ViewModels.Collection {
|
|||||||
* Get correct collection label depending on account API
|
* Get correct collection label depending on account API
|
||||||
*/
|
*/
|
||||||
public getLabel(): string {
|
public getLabel(): string {
|
||||||
if (this.container.isPreferredApiTable()) {
|
if (userContext.apiType === "Tables") {
|
||||||
return "Entities";
|
return "Entities";
|
||||||
} else if (userContext.apiType === "Cassandra") {
|
} else if (userContext.apiType === "Cassandra") {
|
||||||
return "Rows";
|
return "Rows";
|
||||||
|
@ -147,7 +147,7 @@ export class TabRouteHandler {
|
|||||||
);
|
);
|
||||||
collection &&
|
collection &&
|
||||||
collection.container &&
|
collection.container &&
|
||||||
(collection.container.isPreferredApiTable() || userContext.apiType === "Cassandra") &&
|
(userContext.apiType === "Tables" || userContext.apiType === "Cassandra") &&
|
||||||
collection.onTableEntitiesClick();
|
collection.onTableEntitiesClick();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user