mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-20 17:30:46 +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;
|
||||
|
||||
Reference in New Issue
Block a user