mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-21 09:51:11 +00:00
Remove Explorer.isPreferredApiTable (#656)
Co-authored-by: Steve Faulkner <southpolesteve@gmail.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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],
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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],
|
||||
|
||||
@@ -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],
|
||||
|
||||
Reference in New Issue
Block a user