From 887618e77e54f5f1b083df2cb5166114e5b7fdae Mon Sep 17 00:00:00 2001 From: t-tarabhatia <84812001+t-tarabhatia@users.noreply.github.com> Date: Wed, 14 Jul 2021 12:10:45 -0700 Subject: [PATCH] UX Changes for Default Partition Key A/B Experiment (#928) --- src/Common/Constants.ts | 1 + src/Explorer/Panes/AddCollectionPanel.tsx | 21 ++++++++++++++++++++- src/Platform/Hosted/extractFeatures.ts | 2 ++ src/hooks/useKnockoutExplorer.ts | 3 +++ 4 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/Common/Constants.ts b/src/Common/Constants.ts index 57b65c43e..da1871ffe 100644 --- a/src/Common/Constants.ts +++ b/src/Common/Constants.ts @@ -95,6 +95,7 @@ export class Flights { public static readonly MongoIndexing = "mongoindexing"; public static readonly AutoscaleTest = "autoscaletest"; public static readonly SchemaAnalyzer = "schemaanalyzer"; + public static readonly PartitionKeyTest = "partitionkeytest"; } export class AfecFeatures { diff --git a/src/Explorer/Panes/AddCollectionPanel.tsx b/src/Explorer/Panes/AddCollectionPanel.tsx index a946c1091..f0ce4f4d1 100644 --- a/src/Explorer/Panes/AddCollectionPanel.tsx +++ b/src/Explorer/Panes/AddCollectionPanel.tsx @@ -113,7 +113,11 @@ export class AddCollectionPanel extends React.Component + + {this.getPartitionKeySubtext()} + + diff --git a/src/Platform/Hosted/extractFeatures.ts b/src/Platform/Hosted/extractFeatures.ts index 95e3695df..da2c6d917 100644 --- a/src/Platform/Hosted/extractFeatures.ts +++ b/src/Platform/Hosted/extractFeatures.ts @@ -10,6 +10,7 @@ export type Features = { readonly enableSchema: boolean; enableSchemaAnalyzer: boolean; autoscaleDefault: boolean; + partitionKeyDefault: boolean; readonly enableSDKoperations: boolean; readonly enableSpark: boolean; readonly enableTtl: boolean; @@ -70,5 +71,6 @@ export function extractFeatures(given = new URLSearchParams(window.location.sear showMinRUSurvey: "true" === get("showminrusurvey"), ttl90Days: "true" === get("ttl90days"), autoscaleDefault: "true" === get("autoscaledefault"), + partitionKeyDefault: "true" === get("partitionkeytest"), }; } diff --git a/src/hooks/useKnockoutExplorer.ts b/src/hooks/useKnockoutExplorer.ts index e0729bc80..87deee4e2 100644 --- a/src/hooks/useKnockoutExplorer.ts +++ b/src/hooks/useKnockoutExplorer.ts @@ -331,6 +331,9 @@ function updateContextsFromPortalMessage(inputs: DataExplorerInputsFrame) { if (inputs.flights.indexOf(Flights.SchemaAnalyzer) !== -1) { userContext.features.enableSchemaAnalyzer = true; } + if (inputs.flights.indexOf(Flights.PartitionKeyTest) !== -1) { + userContext.features.partitionKeyDefault = true; + } } }