Change create wildcard index default value to false for mongo 3.2 (#759)

* Change create wildcard index default value to false for mongo 3.2

* Update snapshots
This commit is contained in:
victor-meng 2021-05-06 19:27:47 -07:00 committed by GitHub
parent 78eafe1aec
commit d62baf327b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 26 additions and 3 deletions

View File

@ -103,6 +103,7 @@ exports[`SettingsComponent renders 1`] = `
"id": "addcollectionpane",
"isAnalyticalStorageOn": [Function],
"isAutoPilotSelected": [Function],
"isEnableMongoCapabilityEnabled": [Function],
"isExecuting": [Function],
"isFixedStorageSelected": [Function],
"isFreeTierAccount": [Function],
@ -253,6 +254,7 @@ exports[`SettingsComponent renders 1`] = `
"id": "addcollectionpane",
"isAnalyticalStorageOn": [Function],
"isAutoPilotSelected": [Function],
"isEnableMongoCapabilityEnabled": [Function],
"isExecuting": [Function],
"isFixedStorageSelected": [Function],
"isFreeTierAccount": [Function],
@ -1379,6 +1381,7 @@ exports[`SettingsComponent renders 1`] = `
"id": "addcollectionpane",
"isAnalyticalStorageOn": [Function],
"isAutoPilotSelected": [Function],
"isEnableMongoCapabilityEnabled": [Function],
"isExecuting": [Function],
"isFixedStorageSelected": [Function],
"isFreeTierAccount": [Function],
@ -1529,6 +1532,7 @@ exports[`SettingsComponent renders 1`] = `
"id": "addcollectionpane",
"isAnalyticalStorageOn": [Function],
"isAutoPilotSelected": [Function],
"isEnableMongoCapabilityEnabled": [Function],
"isExecuting": [Function],
"isFixedStorageSelected": [Function],
"isFreeTierAccount": [Function],
@ -2668,6 +2672,7 @@ exports[`SettingsComponent renders 1`] = `
"id": "addcollectionpane",
"isAnalyticalStorageOn": [Function],
"isAutoPilotSelected": [Function],
"isEnableMongoCapabilityEnabled": [Function],
"isExecuting": [Function],
"isFixedStorageSelected": [Function],
"isFreeTierAccount": [Function],
@ -2818,6 +2823,7 @@ exports[`SettingsComponent renders 1`] = `
"id": "addcollectionpane",
"isAnalyticalStorageOn": [Function],
"isAutoPilotSelected": [Function],
"isEnableMongoCapabilityEnabled": [Function],
"isExecuting": [Function],
"isFixedStorageSelected": [Function],
"isFreeTierAccount": [Function],
@ -3944,6 +3950,7 @@ exports[`SettingsComponent renders 1`] = `
"id": "addcollectionpane",
"isAnalyticalStorageOn": [Function],
"isAutoPilotSelected": [Function],
"isEnableMongoCapabilityEnabled": [Function],
"isExecuting": [Function],
"isFixedStorageSelected": [Function],
"isFreeTierAccount": [Function],
@ -4094,6 +4101,7 @@ exports[`SettingsComponent renders 1`] = `
"id": "addcollectionpane",
"isAnalyticalStorageOn": [Function],
"isAutoPilotSelected": [Function],
"isEnableMongoCapabilityEnabled": [Function],
"isExecuting": [Function],
"isFixedStorageSelected": [Function],
"isFreeTierAccount": [Function],

View File

@ -438,7 +438,7 @@
<!-- Provision collection throughput - end -->
<!-- Custom indexes for mongo checkbox - start -->
<div class="pkPadding" data-bind="visible: container.isEnableMongoCapabilityPresent()">
<div class="pkPadding" data-bind="visible: isEnableMongoCapabilityEnabled()">
<p>
<span class="addCollectionLabel">Indexing</span>
</p>

View File

@ -14,6 +14,7 @@ import { Action, ActionModifiers } from "../../Shared/Telemetry/TelemetryConstan
import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor";
import { userContext } from "../../UserContext";
import * as AutoPilotUtils from "../../Utils/AutoPilotUtils";
import { isCapabilityEnabled } from "../../Utils/CapabilityUtils";
import * as PricingUtils from "../../Utils/PricingUtils";
import { DynamicListItem } from "../Controls/DynamicList/DynamicListComponent";
import { ContextualPaneBase } from "./ContextualPaneBase";
@ -95,6 +96,7 @@ export default class AddCollectionPane extends ContextualPaneBase {
public shouldCreateMongoWildcardIndex: ko.Observable<boolean>;
private _isSynapseLinkEnabled: ko.Computed<boolean>;
private isEnableMongoCapabilityEnabled: ko.Observable<boolean>;
constructor(options: AddCollectionPaneOptions) {
super(options);
@ -634,6 +636,8 @@ export default class AddCollectionPane extends ContextualPaneBase {
});
});
this.isEnableMongoCapabilityEnabled = ko.observable(isCapabilityEnabled("EnableMongo"));
this.shouldCreateMongoWildcardIndex = ko.observable(this.container.isMongoIndexingEnabled());
}

View File

@ -25,6 +25,7 @@ import { Action } from "../../Shared/Telemetry/TelemetryConstants";
import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor";
import { userContext } from "../../UserContext";
import { getCollectionName } from "../../Utils/APITypeUtils";
import { isCapabilityEnabled } from "../../Utils/CapabilityUtils";
import { getUpsellMessage } from "../../Utils/PricingUtils";
import { CollapsibleSectionComponent } from "../Controls/CollapsiblePanel/CollapsibleSectionComponent";
import { ThroughputInput } from "../Controls/ThroughputInput/ThroughputInput";
@ -80,7 +81,7 @@ export class AddCollectionPanel extends React.Component<AddCollectionPanelProps,
isSharded: userContext.apiType !== "Tables",
partitionKey: "",
enableDedicatedThroughput: false,
createMongoWildCardIndex: true,
createMongoWildCardIndex: isCapabilityEnabled("EnableMongo"),
useHashV2: false,
enableAnalyticalStore: false,
uniqueKeys: [],
@ -525,7 +526,7 @@ export class AddCollectionPanel extends React.Component<AddCollectionPanelProps,
}}
>
<Stack className="panelGroupSpacing" id="collapsibleSectionContent">
{userContext.databaseAccount.properties?.capabilities?.find((c) => c.name === "EnableMongo") && (
{isCapabilityEnabled("EnableMongo") && (
<Stack className="panelGroupSpacing">
<Stack horizontal>
<span className="mandatoryStar">*&nbsp;</span>

View File

@ -92,6 +92,7 @@ exports[`GitHub Repos Panel should render Default properly 1`] = `
"id": "addcollectionpane",
"isAnalyticalStorageOn": [Function],
"isAutoPilotSelected": [Function],
"isEnableMongoCapabilityEnabled": [Function],
"isExecuting": [Function],
"isFixedStorageSelected": [Function],
"isFreeTierAccount": [Function],
@ -242,6 +243,7 @@ exports[`GitHub Repos Panel should render Default properly 1`] = `
"id": "addcollectionpane",
"isAnalyticalStorageOn": [Function],
"isAutoPilotSelected": [Function],
"isEnableMongoCapabilityEnabled": [Function],
"isExecuting": [Function],
"isFixedStorageSelected": [Function],
"isFreeTierAccount": [Function],

View File

@ -82,6 +82,7 @@ exports[`StringInput Pane should render Create new directory properly 1`] = `
"id": "addcollectionpane",
"isAnalyticalStorageOn": [Function],
"isAutoPilotSelected": [Function],
"isEnableMongoCapabilityEnabled": [Function],
"isExecuting": [Function],
"isFixedStorageSelected": [Function],
"isFreeTierAccount": [Function],
@ -232,6 +233,7 @@ exports[`StringInput Pane should render Create new directory properly 1`] = `
"id": "addcollectionpane",
"isAnalyticalStorageOn": [Function],
"isAutoPilotSelected": [Function],
"isEnableMongoCapabilityEnabled": [Function],
"isExecuting": [Function],
"isFixedStorageSelected": [Function],
"isFreeTierAccount": [Function],

View File

@ -80,6 +80,7 @@ exports[`Delete Database Confirmation Pane submit() Should call delete database
"id": "addcollectionpane",
"isAnalyticalStorageOn": [Function],
"isAutoPilotSelected": [Function],
"isEnableMongoCapabilityEnabled": [Function],
"isExecuting": [Function],
"isFixedStorageSelected": [Function],
"isFreeTierAccount": [Function],
@ -230,6 +231,7 @@ exports[`Delete Database Confirmation Pane submit() Should call delete database
"id": "addcollectionpane",
"isAnalyticalStorageOn": [Function],
"isAutoPilotSelected": [Function],
"isEnableMongoCapabilityEnabled": [Function],
"isExecuting": [Function],
"isFixedStorageSelected": [Function],
"isFreeTierAccount": [Function],

View File

@ -0,0 +1,4 @@
import { userContext } from "../UserContext";
export const isCapabilityEnabled = (capabilityName: string): boolean =>
userContext.databaseAccount?.properties?.capabilities?.some((capability) => capability.name === capabilityName);