diff --git a/src/Common/Constants.ts b/src/Common/Constants.ts index 2142a530e..0aeb6bb60 100644 --- a/src/Common/Constants.ts +++ b/src/Common/Constants.ts @@ -128,6 +128,7 @@ export class Features { public static readonly enableSchema = "enableschema"; public static readonly enableSDKoperations = "enablesdkoperations"; public static readonly showMinRUSurvey = "showminrusurvey"; + public static readonly selfServeTypeForTest = "selfservetypefortest"; } // flight names returned from the portal are always lowercase diff --git a/src/Explorer/Controls/FeaturePanel/FeaturePanelComponent.tsx b/src/Explorer/Controls/FeaturePanel/FeaturePanelComponent.tsx index b0f1733f7..8b4866de1 100644 --- a/src/Explorer/Controls/FeaturePanel/FeaturePanelComponent.tsx +++ b/src/Explorer/Controls/FeaturePanel/FeaturePanelComponent.tsx @@ -50,6 +50,7 @@ export const FeaturePanelComponent: React.FunctionComponent = () => { { key: "feature.enablettl", label: "Enable TTL", value: "true" }, { key: "feature.enablegallerypublish", label: "Enable Notebook Gallery Publishing", value: "true" }, { key: "feature.enablecodeofconduct", label: "Enable Code Of Conduct Acknowledgement", value: "true" }, + { key: "feature.selfServeTypeForTest", label: "self serve type passed on for testing", value: "sample" }, { key: "feature.enableLinkInjection", label: "Enable Injecting Notebook Viewer Link into the first cell", diff --git a/src/Explorer/Explorer.ts b/src/Explorer/Explorer.ts index 3e35c1c4a..9b12e6ac8 100644 --- a/src/Explorer/Explorer.ts +++ b/src/Explorer/Explorer.ts @@ -1861,14 +1861,21 @@ export default class Explorer { return false; } - public initDataExplorerWithFrameInputs(inputs: ViewModels.DataExplorerInputsFrame): Q.Promise { - if (inputs != null) { - inputs.selfServeType - ? this.selfServeType(inputs.selfServeType) - : this.selfServeType(SelfServeTypes.none); + public setSelfServeType(inputs: ViewModels.DataExplorerInputsFrame): void { + const selfServeTypeForTest = inputs.features[Constants.Features.selfServeTypeForTest] + if (selfServeTypeForTest) { + this.selfServeType(SelfServeTypes[selfServeTypeForTest?.toLowerCase() as keyof typeof SelfServeTypes]) + } else if (inputs.selfServeType) { + this.selfServeType(inputs.selfServeType) + } else { + this.selfServeType(SelfServeTypes.none) this._setLoadingStatusText("Connecting...", "Welcome to Azure Cosmos DB") this._setConnectingImage() - + } + } + + public initDataExplorerWithFrameInputs(inputs: ViewModels.DataExplorerInputsFrame): Q.Promise { + if (inputs != null) { const authorizationToken = inputs.authorizationToken || ""; const masterKey = inputs.masterKey || ""; const databaseAccount = inputs.databaseAccount || null; @@ -1886,6 +1893,7 @@ export default class Explorer { this.isTryCosmosDBSubscription(inputs.isTryCosmosDBSubscription); this.isAuthWithResourceToken(inputs.isAuthWithresourceToken); this.setFeatureFlagsFromFlights(inputs.flights); + this.setSelfServeType(inputs) if (!!inputs.dataExplorerVersion) { this.parentFrameDataExplorerVersion(inputs.dataExplorerVersion); diff --git a/src/SelfServe/SelfServeComponentAdapter.tsx b/src/SelfServe/SelfServeComponentAdapter.tsx index 92831de26..767840f25 100644 --- a/src/SelfServe/SelfServeComponentAdapter.tsx +++ b/src/SelfServe/SelfServeComponentAdapter.tsx @@ -32,7 +32,6 @@ export class SelfServeComponentAdapter implements ReactAdapter { public renderComponent(): JSX.Element { const selfServeType = this.container.selfServeType() - console.log("type:" + selfServeType) const smartUiDescriptor = this.getDescriptor(selfServeType)