Add feature flags to test Legacy Mongo Shell (#1421)

Add feature flags to test Legacy Mongo Shell
This commit is contained in:
Armando Trejo Oliver 2023-04-04 10:28:42 -07:00 committed by GitHub
parent c7c894d6d9
commit 9d2d0e4754
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 0 deletions

View File

@ -78,6 +78,22 @@ export default class MongoShellTabComponent extends Component<
baseUrl = "/content/mongoshell/";
}
if (userContext.features.enableLegacyMongoShellV1 === true) {
return "/mongoshell/index.html";
}
if (userContext.features.enableLegacyMongoShellV1Dist === true) {
return "/mongoshell/dist/index.html";
}
if (userContext.features.enableLegacyMongoShellV2 === true) {
return "/mongoshell/indexv2.html";
}
if (userContext.features.enableLegacyMongoShellV2Dist === true) {
return "/mongoshell/dist/indexv2.html";
}
return `${extensionEndpoint}${baseUrl}index.html?resourceId=${resourceId}&accountName=${accountName}&mongoEndpoint=${mongoEndpoint}`;
}

View File

@ -30,6 +30,10 @@ export type Features = {
readonly mongoProxyAPIs?: string;
readonly enableThroughputCap: boolean;
readonly enableHierarchicalKeys: boolean;
readonly enableLegacyMongoShellV1: boolean;
readonly enableLegacyMongoShellV1Dist: boolean;
readonly enableLegacyMongoShellV2: boolean;
readonly enableLegacyMongoShellV2Dist: boolean;
// can be set via both flight and feature flag
autoscaleDefault: boolean;
@ -92,6 +96,10 @@ export function extractFeatures(given = new URLSearchParams(window.location.sear
notebooksDownBanner: "true" === get("notebooksDownBanner"),
enableThroughputCap: "true" === get("enablethroughputcap"),
enableHierarchicalKeys: "true" === get("enablehierarchicalkeys"),
enableLegacyMongoShellV1: "true" === get("enablelegacymongoshellv1"),
enableLegacyMongoShellV1Dist: "true" === get("enablelegacymongoshellv1dist"),
enableLegacyMongoShellV2: "true" === get("enablelegacymongoshellv2"),
enableLegacyMongoShellV2Dist: "true" === get("enablelegacymongoshellv2dist"),
};
}