From babda4d9cb122a586f84bb61a952af5f40f5224f Mon Sep 17 00:00:00 2001 From: Tim Sander Date: Tue, 12 Jan 2021 16:38:16 -0800 Subject: [PATCH] fix issue where Mongo indexing checkbox stops adding wildcard index (#384) --- src/Explorer/Panes/AddCollectionPane.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Explorer/Panes/AddCollectionPane.ts b/src/Explorer/Panes/AddCollectionPane.ts index 3a8cefb63..9f705551e 100644 --- a/src/Explorer/Panes/AddCollectionPane.ts +++ b/src/Explorer/Panes/AddCollectionPane.ts @@ -92,7 +92,7 @@ export default class AddCollectionPane extends ContextualPaneBase { public freeTierExceedThroughputTooltip: ko.Computed; public canConfigureThroughput: ko.PureComputed; public showUpsellMessage: ko.PureComputed; - public shouldCreateMongoWildcardIndex: ko.Computed; + public shouldCreateMongoWildcardIndex: ko.Observable; private _isSynapseLinkEnabled: ko.Computed; @@ -654,9 +654,7 @@ export default class AddCollectionPane extends ContextualPaneBase { }); }); - this.shouldCreateMongoWildcardIndex = ko.computed(function() { - return this.container.isMongoIndexingEnabled(); - }, this); + this.shouldCreateMongoWildcardIndex = ko.observable(this.container.isMongoIndexingEnabled()); } public getSharedThroughputDefault(): boolean { @@ -681,6 +679,7 @@ export default class AddCollectionPane extends ContextualPaneBase { // TODO: Figure out if a database level partition split is about to happen once shared throughput read is available this.formWarnings(""); this.databaseCreateNewShared(this.getSharedThroughputDefault()); + this.shouldCreateMongoWildcardIndex(this.container.isMongoIndexingEnabled()); if (this.isPreferredApiTable() && !databaseId) { databaseId = SharedConstants.CollectionCreation.TablesAPIDefaultDatabase; } @@ -935,6 +934,8 @@ export default class AddCollectionPane extends ContextualPaneBase { this.autoPilotThroughput(AutoPilotUtils.minAutoPilotThroughput); this.sharedAutoPilotThroughput(AutoPilotUtils.minAutoPilotThroughput); + this.shouldCreateMongoWildcardIndex = ko.observable(this.container.isMongoIndexingEnabled()); + this.uniqueKeys([]); this.useIndexingForSharedThroughput(true);