From 44f834b198257ff787287519ab6abac3d40cb17a Mon Sep 17 00:00:00 2001 From: sunghyunkang1111 <114709653+sunghyunkang1111@users.noreply.github.com> Date: Thu, 25 Sep 2025 19:15:58 -0500 Subject: [PATCH] Vnext emulator fix (#2213) * Added feature flags to the components * Remove config.json --- src/ConfigContext.ts | 3 +- .../Controls/Settings/SettingsComponent.tsx | 2 +- .../AddCollectionPanel/AddCollectionPanel.tsx | 154 ++++++++++-------- src/Utils/PlatformFeatureUtils.ts | 3 + 4 files changed, 88 insertions(+), 74 deletions(-) diff --git a/src/ConfigContext.ts b/src/ConfigContext.ts index 718cf0641..1a151567e 100644 --- a/src/ConfigContext.ts +++ b/src/ConfigContext.ts @@ -216,7 +216,7 @@ export async function initializeConfiguration(): Promise { const AAD_ENDPOINT = params.get("aadEndpoint") || ""; updateConfigContext({ AAD_ENDPOINT }); } - if (params.has("platform")) { + if (params.has("platform") && configContext.platform !== Platform.VNextEmulator) { const platform = params.get("platform"); switch (platform) { default: @@ -226,7 +226,6 @@ export async function initializeConfiguration(): Promise { case Platform.Fabric: case Platform.Hosted: case Platform.Emulator: - case Platform.VNextEmulator: updateConfigContext({ platform }); } } diff --git a/src/Explorer/Controls/Settings/SettingsComponent.tsx b/src/Explorer/Controls/Settings/SettingsComponent.tsx index 27ba6254d..fe5f0ac05 100644 --- a/src/Explorer/Controls/Settings/SettingsComponent.tsx +++ b/src/Explorer/Controls/Settings/SettingsComponent.tsx @@ -1336,7 +1336,7 @@ export class SettingsComponent extends React.Component, diff --git a/src/Explorer/Panes/AddCollectionPanel/AddCollectionPanel.tsx b/src/Explorer/Panes/AddCollectionPanel/AddCollectionPanel.tsx index 59a8bc9ff..ed2241eb4 100644 --- a/src/Explorer/Panes/AddCollectionPanel/AddCollectionPanel.tsx +++ b/src/Explorer/Panes/AddCollectionPanel/AddCollectionPanel.tsx @@ -728,7 +728,7 @@ export class AddCollectionPanel extends React.Component )} - {!isFabricNative() && userContext.apiType === "SQL" && ( + {isFeatureSupported(PlatformFeature.UniqueKeys) && !isFabricNative() && userContext.apiType === "SQL" && ( {UniqueKeysHeader()} {this.state.uniqueKeys.map((uniqueKey: string, i: number): JSX.Element => { @@ -901,78 +901,86 @@ export class AddCollectionPanel extends React.Component )} - {!isFabricNative() && userContext.apiType !== "Tables" && ( - { - TelemetryProcessor.traceOpen(Action.ExpandAddCollectionPaneAdvancedSection); - scrollToSection("collapsibleAdvancedSectionContent"); - }} - > - - {isCapabilityEnabled("EnableMongo") && !isCapabilityEnabled("EnableMongo16MBDocumentSupport") && ( - - - - - Indexing - - - - + {isFeatureSupported(PlatformFeature.AdvancedContainerSettings) && + !isFabricNative() && + userContext.apiType !== "Tables" && ( + { + TelemetryProcessor.traceOpen(Action.ExpandAddCollectionPaneAdvancedSection); + scrollToSection("collapsibleAdvancedSectionContent"); + }} + > + + {isCapabilityEnabled("EnableMongo") && !isCapabilityEnabled("EnableMongo16MBDocumentSupport") && ( + + + + + Indexing + + + + + + + , isChecked: boolean) => + this.setState({ createMongoWildCardIndex: isChecked }) + } + /> + )} - , isChecked: boolean) => - this.setState({ createMongoWildCardIndex: isChecked }) - } - /> - - )} - - {userContext.apiType === "SQL" && ( - - , isChecked: boolean) => - this.setState({ useHashV1: isChecked, subPartitionKeys: [] }) - } - /> - - To ensure compatibility with older SDKs, the - created container will use a legacy partitioning scheme that supports partition key values of size - only up to 101 bytes. If this is enabled, you will not be able to use hierarchical partition keys.{" "} - - Learn more - - - - )} - - - )} + {userContext.apiType === "SQL" && ( + + , isChecked: boolean) => + this.setState({ useHashV1: isChecked, subPartitionKeys: [] }) + } + /> + + To ensure compatibility with older SDKs, + the created container will use a legacy partitioning scheme that supports partition key values + of size only up to 101 bytes. If this is enabled, you will not be able to use hierarchical + partition keys.{" "} + + Learn more + + + + )} + + + )} @@ -1135,6 +1143,10 @@ export class AddCollectionPanel extends React.Component