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;

View File

@@ -537,7 +537,6 @@ exports[`Settings Pane should render Default properly 1`] = `
"isNotebookEnabled": [Function],
"isNotebooksEnabledForAccount": [Function],
"isPreferredApiMongoDB": [Function],
"isPreferredApiTable": [Function],
"isPublishNotebookPaneEnabled": [Function],
"isResourceTokenCollectionNodeSelected": [Function],
"isRightPanelV2Enabled": [Function],
@@ -1321,7 +1320,6 @@ exports[`Settings Pane should render Gremlin properly 1`] = `
"isNotebookEnabled": [Function],
"isNotebooksEnabledForAccount": [Function],
"isPreferredApiMongoDB": [Function],
"isPreferredApiTable": [Function],
"isPublishNotebookPaneEnabled": [Function],
"isResourceTokenCollectionNodeSelected": [Function],
"isRightPanelV2Enabled": [Function],

View File

@@ -69,7 +69,7 @@ export default class EditTableEntityPane extends TableEntityPane {
public open() {
this.displayedAttributes(this.constructDisplayedAttributes(this.originEntity));
if (this.container.isPreferredApiTable()) {
if (userContext.apiType === "Tables") {
this.originalDocument = TableEntityProcessor.convertEntitiesToDocuments(
[<Entities.ITableEntityForTablesAPI>this.originEntity],
this.tableViewModel.queryTablesTab.collection

View File

@@ -537,7 +537,6 @@ exports[`Upload Items Pane should render Default properly 1`] = `
"isNotebookEnabled": [Function],
"isNotebooksEnabledForAccount": [Function],
"isPreferredApiMongoDB": [Function],
"isPreferredApiTable": [Function],
"isPublishNotebookPaneEnabled": [Function],
"isResourceTokenCollectionNodeSelected": [Function],
"isRightPanelV2Enabled": [Function],

View File

@@ -540,7 +540,6 @@ exports[`Delete Database Confirmation Pane submit() Should call delete database
"isNotebookEnabled": [Function],
"isNotebooksEnabledForAccount": [Function],
"isPreferredApiMongoDB": [Function],
"isPreferredApiTable": [Function],
"isPublishNotebookPaneEnabled": [Function],
"isResourceTokenCollectionNodeSelected": [Function],
"isRightPanelV2Enabled": [Function],