Fix feature flags in Portal (#659)
This commit is contained in:
parent
f449328f26
commit
d90a065e63
|
@ -390,6 +390,9 @@ export interface DataExplorerInputsFrame {
|
||||||
dataExplorerVersion?: string;
|
dataExplorerVersion?: string;
|
||||||
defaultCollectionThroughput?: CollectionCreationDefaults;
|
defaultCollectionThroughput?: CollectionCreationDefaults;
|
||||||
flights?: readonly string[];
|
flights?: readonly string[];
|
||||||
|
features?: {
|
||||||
|
[key: string]: string;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface SelfServeFrameInputs {
|
export interface SelfServeFrameInputs {
|
||||||
|
|
|
@ -18,6 +18,7 @@ import {
|
||||||
ResourceToken,
|
ResourceToken,
|
||||||
} from "../HostedExplorerChildFrame";
|
} from "../HostedExplorerChildFrame";
|
||||||
import { emulatorAccount } from "../Platform/Emulator/emulatorAccount";
|
import { emulatorAccount } from "../Platform/Emulator/emulatorAccount";
|
||||||
|
import { extractFeatures } from "../Platform/Hosted/extractFeatures";
|
||||||
import { parseResourceTokenConnectionString } from "../Platform/Hosted/Helpers/ResourceTokenUtils";
|
import { parseResourceTokenConnectionString } from "../Platform/Hosted/Helpers/ResourceTokenUtils";
|
||||||
import {
|
import {
|
||||||
getDatabaseAccountKindFromExperience,
|
getDatabaseAccountKindFromExperience,
|
||||||
|
@ -25,7 +26,7 @@ import {
|
||||||
} from "../Platform/Hosted/HostedUtils";
|
} from "../Platform/Hosted/HostedUtils";
|
||||||
import { CollectionCreation } from "../Shared/Constants";
|
import { CollectionCreation } from "../Shared/Constants";
|
||||||
import { DefaultExperienceUtility } from "../Shared/DefaultExperienceUtility";
|
import { DefaultExperienceUtility } from "../Shared/DefaultExperienceUtility";
|
||||||
import { PortalEnv, updateUserContext } from "../UserContext";
|
import { PortalEnv, updateUserContext, userContext } from "../UserContext";
|
||||||
import { listKeys } from "../Utils/arm/generatedClients/2020-04-01/databaseAccounts";
|
import { listKeys } from "../Utils/arm/generatedClients/2020-04-01/databaseAccounts";
|
||||||
import { isInvalidParentFrameOrigin } from "../Utils/MessageValidation";
|
import { isInvalidParentFrameOrigin } from "../Utils/MessageValidation";
|
||||||
|
|
||||||
|
@ -308,6 +309,9 @@ function updateContextsFromPortalMessage(inputs: DataExplorerInputsFrame) {
|
||||||
hasWriteAccess: inputs.hasWriteAccess ?? true,
|
hasWriteAccess: inputs.hasWriteAccess ?? true,
|
||||||
addCollectionFlight: inputs.addCollectionDefaultFlight || CollectionCreation.DefaultAddCollectionDefaultFlight,
|
addCollectionFlight: inputs.addCollectionDefaultFlight || CollectionCreation.DefaultAddCollectionDefaultFlight,
|
||||||
});
|
});
|
||||||
|
if (inputs.features) {
|
||||||
|
Object.assign(userContext.features, extractFeatures(new URLSearchParams(inputs.features)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
interface PortalMessage {
|
interface PortalMessage {
|
||||||
|
|
Loading…
Reference in New Issue