Add support for pseudo enum flags

This commit is contained in:
artrejo
2021-07-20 13:22:48 -07:00
parent 8a3929775b
commit e4e602a81e
2 changed files with 15 additions and 1 deletions

View File

@@ -26,6 +26,8 @@ export type Features = {
readonly pr?: string;
readonly showMinRUSurvey: boolean;
readonly ttl90Days: boolean;
readonly mongoProxyEndpoint: string;
readonly mongoProxyFeatures: string;
};
export function extractFeatures(given = new URLSearchParams(window.location.search)): Features {
@@ -58,6 +60,8 @@ export function extractFeatures(given = new URLSearchParams(window.location.sear
enableTtl: "true" === get("enablettl"),
executeSproc: "true" === get("dataexplorerexecutesproc"),
hostedDataExplorer: "true" === get("hosteddataexplorerenabled"),
mongoProxyEndpoint: get("mongoProxyEndpoint"),
mongoProxyFeatures: get("mongoProxyFeatures"),
junoEndpoint: get("junoendpoint"),
livyEndpoint: get("livyendpoint"),
notebookBasePath: get("notebookbasepath"),
@@ -72,3 +76,7 @@ export function extractFeatures(given = new URLSearchParams(window.location.sear
partitionKeyDefault: "true" === get("partitionkeytest"),
};
}
export function hasFlag(value: string, flag: string): boolean {
return true;
}