mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-10-13 23:38:45 +01:00
Vnext emulator fix (#2213)
* Added feature flags to the components * Remove config.json
This commit is contained in:
parent
59190f2376
commit
44f834b198
@ -216,7 +216,7 @@ export async function initializeConfiguration(): Promise<ConfigContext> {
|
|||||||
const AAD_ENDPOINT = params.get("aadEndpoint") || "";
|
const AAD_ENDPOINT = params.get("aadEndpoint") || "";
|
||||||
updateConfigContext({ AAD_ENDPOINT });
|
updateConfigContext({ AAD_ENDPOINT });
|
||||||
}
|
}
|
||||||
if (params.has("platform")) {
|
if (params.has("platform") && configContext.platform !== Platform.VNextEmulator) {
|
||||||
const platform = params.get("platform");
|
const platform = params.get("platform");
|
||||||
switch (platform) {
|
switch (platform) {
|
||||||
default:
|
default:
|
||||||
@ -226,7 +226,6 @@ export async function initializeConfiguration(): Promise<ConfigContext> {
|
|||||||
case Platform.Fabric:
|
case Platform.Fabric:
|
||||||
case Platform.Hosted:
|
case Platform.Hosted:
|
||||||
case Platform.Emulator:
|
case Platform.Emulator:
|
||||||
case Platform.VNextEmulator:
|
|
||||||
updateConfigContext({ platform });
|
updateConfigContext({ platform });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1336,7 +1336,7 @@ export class SettingsComponent extends React.Component<SettingsComponentProps, S
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.shouldShowComputedPropertiesEditor) {
|
if (isFeatureSupported(PlatformFeature.ComputedProperties) && this.shouldShowComputedPropertiesEditor) {
|
||||||
tabs.push({
|
tabs.push({
|
||||||
tab: SettingsV2TabTypes.ComputedPropertiesTab,
|
tab: SettingsV2TabTypes.ComputedPropertiesTab,
|
||||||
content: <ComputedPropertiesComponent {...computedPropertiesComponentProps} />,
|
content: <ComputedPropertiesComponent {...computedPropertiesComponentProps} />,
|
||||||
|
@ -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 }}>
|
<Stack style={{ marginTop: -2, marginBottom: -4 }}>
|
||||||
{UniqueKeysHeader()}
|
{UniqueKeysHeader()}
|
||||||
{this.state.uniqueKeys.map((uniqueKey: string, i: number): JSX.Element => {
|
{this.state.uniqueKeys.map((uniqueKey: string, i: number): JSX.Element => {
|
||||||
@ -901,7 +901,9 @@ export class AddCollectionPanel extends React.Component<AddCollectionPanelProps,
|
|||||||
</CollapsibleSectionComponent>
|
</CollapsibleSectionComponent>
|
||||||
</Stack>
|
</Stack>
|
||||||
)}
|
)}
|
||||||
{!isFabricNative() && userContext.apiType !== "Tables" && (
|
{isFeatureSupported(PlatformFeature.AdvancedContainerSettings) &&
|
||||||
|
!isFabricNative() &&
|
||||||
|
userContext.apiType !== "Tables" && (
|
||||||
<CollapsibleSectionComponent
|
<CollapsibleSectionComponent
|
||||||
title="Advanced"
|
title="Advanced"
|
||||||
isExpandedByDefault={false}
|
isExpandedByDefault={false}
|
||||||
@ -954,16 +956,22 @@ export class AddCollectionPanel extends React.Component<AddCollectionPanelProps,
|
|||||||
styles={{
|
styles={{
|
||||||
text: { fontSize: 12 },
|
text: { fontSize: 12 },
|
||||||
checkbox: { width: 12, height: 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) =>
|
onChange={(ev: React.FormEvent<HTMLElement>, isChecked: boolean) =>
|
||||||
this.setState({ useHashV1: isChecked, subPartitionKeys: [] })
|
this.setState({ useHashV1: isChecked, subPartitionKeys: [] })
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<Text variant="small">
|
<Text variant="small">
|
||||||
<Icon iconName="InfoSolid" className="removeIcon" /> To ensure compatibility with older SDKs, the
|
<Icon iconName="InfoSolid" className="removeIcon" /> To ensure compatibility with older SDKs,
|
||||||
created container will use a legacy partitioning scheme that supports partition key values of size
|
the created container will use a legacy partitioning scheme that supports partition key values
|
||||||
only up to 101 bytes. If this is enabled, you will not be able to use hierarchical partition keys.{" "}
|
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">
|
<Link href="https://aka.ms/cosmos-large-pk" target="_blank">
|
||||||
Learn more
|
Learn more
|
||||||
</Link>
|
</Link>
|
||||||
@ -1135,6 +1143,10 @@ export class AddCollectionPanel extends React.Component<AddCollectionPanelProps,
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
private shouldShowCollectionThroughputInput(): boolean {
|
private shouldShowCollectionThroughputInput(): boolean {
|
||||||
|
if (!isFeatureSupported(PlatformFeature.ContainerThroughput)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (isServerlessAccount()) {
|
if (isServerlessAccount()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -29,6 +29,9 @@ export enum PlatformFeature {
|
|||||||
ThroughputBucketing = "ThroughputBucketing",
|
ThroughputBucketing = "ThroughputBucketing",
|
||||||
ComputedProperties = "ComputedProperties",
|
ComputedProperties = "ComputedProperties",
|
||||||
AnalyticalStore = "AnalyticalStore",
|
AnalyticalStore = "AnalyticalStore",
|
||||||
|
UniqueKeys = "UniqueKeys",
|
||||||
|
ContainerThroughput = "ContainerThroughput",
|
||||||
|
AdvancedContainerSettings = "AdvancedContainerSettings",
|
||||||
|
|
||||||
// CRUD Operations - Database
|
// CRUD Operations - Database
|
||||||
CreateDatabase = "CreateDatabase",
|
CreateDatabase = "CreateDatabase",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user