fix issue where Mongo indexing checkbox stops adding wildcard index (#384)

This commit is contained in:
Tim Sander 2021-01-12 16:38:16 -08:00 committed by GitHub
parent 9d20a13dd4
commit babda4d9cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -92,7 +92,7 @@ export default class AddCollectionPane extends ContextualPaneBase {
public freeTierExceedThroughputTooltip: ko.Computed<string>;
public canConfigureThroughput: ko.PureComputed<boolean>;
public showUpsellMessage: ko.PureComputed<boolean>;
public shouldCreateMongoWildcardIndex: ko.Computed<boolean>;
public shouldCreateMongoWildcardIndex: ko.Observable<boolean>;
private _isSynapseLinkEnabled: ko.Computed<boolean>;
@ -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);