Remove Explorer.isPreferredApiTable (#656)

Co-authored-by: Steve Faulkner <southpolesteve@gmail.com>
This commit is contained in:
Hardikkumar Nai
2021-04-22 03:11:08 +05:30
committed by GitHub
parent ff58eb3724
commit 9d411c57b0
15 changed files with 50 additions and 39 deletions

View File

@@ -331,7 +331,7 @@ export default class AddCollectionPane extends ContextualPaneBase {
if (currentCollections >= maxCollections) {
let typeOfContainer = "collection";
if (userContext.apiType === "Gremlin" || this.container.isPreferredApiTable()) {
if (userContext.apiType === "Gremlin" || userContext.apiType === "Tables") {
typeOfContainer = "container";
}
@@ -392,7 +392,7 @@ export default class AddCollectionPane extends ContextualPaneBase {
});
this.partitionKeyVisible = ko.computed<boolean>(() => {
if (this.container == null || !!this.container.isPreferredApiTable()) {
if (this.container == null || userContext.apiType === "Tables") {
return false;
}
@@ -757,7 +757,7 @@ export default class AddCollectionPane extends ContextualPaneBase {
return;
}
if (!!this.container.isPreferredApiTable()) {
if (userContext.apiType === "Tables") {
// Table require fixed Database: TablesDB, and fixed Partition Key: /'$pk'
this.databaseId(SharedConstants.CollectionCreation.TablesAPIDefaultDatabase);
this.partitionKey("/'$pk'");
@@ -954,7 +954,7 @@ export default class AddCollectionPane extends ContextualPaneBase {
}
public isNonTableApi = (): boolean => {
return !this.container.isPreferredApiTable();
return userContext.apiType !== "Tables";
};
public isUnlimitedStorageSelected = (): boolean => {
@@ -1028,7 +1028,7 @@ export default class AddCollectionPane extends ContextualPaneBase {
private _setFocus() {
// Autofocus is enabled on AddCollectionPane based on the preferred API
if (this.container.isPreferredApiTable()) {
if (userContext.apiType === "Tables") {
const focusTableId = document.getElementById("containerId");
focusTableId && focusTableId.focus();
return;