Vnext emulator fix (#2213)

* Added feature flags to the components

* Remove config.json
This commit is contained in:
sunghyunkang1111 2025-09-25 19:15:58 -05:00 committed by GitHub
parent 59190f2376
commit 44f834b198
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 88 additions and 74 deletions

View File

@ -216,7 +216,7 @@ export async function initializeConfiguration(): Promise<ConfigContext> {
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<ConfigContext> {
case Platform.Fabric:
case Platform.Hosted:
case Platform.Emulator:
case Platform.VNextEmulator:
updateConfigContext({ platform });
}
}

View File

@ -1336,7 +1336,7 @@ export class SettingsComponent extends React.Component<SettingsComponentProps, S
});
}
if (this.shouldShowComputedPropertiesEditor) {
if (isFeatureSupported(PlatformFeature.ComputedProperties) && this.shouldShowComputedPropertiesEditor) {
tabs.push({
tab: SettingsV2TabTypes.ComputedPropertiesTab,
content: <ComputedPropertiesComponent {...computedPropertiesComponentProps} />,

View File

@ -728,7 +728,7 @@ export class AddCollectionPanel extends React.Component<AddCollectionPanelProps,
/>
)}
{!isFabricNative() && userContext.apiType === "SQL" && (
{isFeatureSupported(PlatformFeature.UniqueKeys) && !isFabricNative() && userContext.apiType === "SQL" && (
<Stack style={{ marginTop: -2, marginBottom: -4 }}>
{UniqueKeysHeader()}
{this.state.uniqueKeys.map((uniqueKey: string, i: number): JSX.Element => {
@ -901,7 +901,9 @@ export class AddCollectionPanel extends React.Component<AddCollectionPanelProps,
</CollapsibleSectionComponent>
</Stack>
)}
{!isFabricNative() && userContext.apiType !== "Tables" && (
{isFeatureSupported(PlatformFeature.AdvancedContainerSettings) &&
!isFabricNative() &&
userContext.apiType !== "Tables" && (
<CollapsibleSectionComponent
title="Advanced"
isExpandedByDefault={false}
@ -954,16 +956,22 @@ export class AddCollectionPanel extends React.Component<AddCollectionPanelProps,
styles={{
text: { fontSize: 12 },
checkbox: { width: 12, height: 12 },
label: { padding: 0, alignItems: "center", wordWrap: "break-word", whiteSpace: "break-spaces" },
label: {
padding: 0,
alignItems: "center",
wordWrap: "break-word",
whiteSpace: "break-spaces",
},
}}
onChange={(ev: React.FormEvent<HTMLElement>, isChecked: boolean) =>
this.setState({ useHashV1: isChecked, subPartitionKeys: [] })
}
/>
<Text variant="small">
<Icon iconName="InfoSolid" className="removeIcon" /> 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.{" "}
<Icon iconName="InfoSolid" className="removeIcon" /> 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.{" "}
<Link href="https://aka.ms/cosmos-large-pk" target="_blank">
Learn more
</Link>
@ -1135,6 +1143,10 @@ export class AddCollectionPanel extends React.Component<AddCollectionPanelProps,
// }
private shouldShowCollectionThroughputInput(): boolean {
if (!isFeatureSupported(PlatformFeature.ContainerThroughput)) {
return false;
}
if (isServerlessAccount()) {
return false;
}

View File

@ -29,6 +29,9 @@ export enum PlatformFeature {
ThroughputBucketing = "ThroughputBucketing",
ComputedProperties = "ComputedProperties",
AnalyticalStore = "AnalyticalStore",
UniqueKeys = "UniqueKeys",
ContainerThroughput = "ContainerThroughput",
AdvancedContainerSettings = "AdvancedContainerSettings",
// CRUD Operations - Database
CreateDatabase = "CreateDatabase",