mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-23 02:41:39 +00:00
added feature for self serve type
This commit is contained in:
@@ -128,6 +128,7 @@ export class Features {
|
|||||||
public static readonly enableSchema = "enableschema";
|
public static readonly enableSchema = "enableschema";
|
||||||
public static readonly enableSDKoperations = "enablesdkoperations";
|
public static readonly enableSDKoperations = "enablesdkoperations";
|
||||||
public static readonly showMinRUSurvey = "showminrusurvey";
|
public static readonly showMinRUSurvey = "showminrusurvey";
|
||||||
|
public static readonly selfServeTypeForTest = "selfservetypefortest";
|
||||||
}
|
}
|
||||||
|
|
||||||
// flight names returned from the portal are always lowercase
|
// flight names returned from the portal are always lowercase
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ export const FeaturePanelComponent: React.FunctionComponent = () => {
|
|||||||
{ key: "feature.enablettl", label: "Enable TTL", value: "true" },
|
{ key: "feature.enablettl", label: "Enable TTL", value: "true" },
|
||||||
{ key: "feature.enablegallerypublish", label: "Enable Notebook Gallery Publishing", 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.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",
|
key: "feature.enableLinkInjection",
|
||||||
label: "Enable Injecting Notebook Viewer Link into the first cell",
|
label: "Enable Injecting Notebook Viewer Link into the first cell",
|
||||||
|
|||||||
@@ -1861,14 +1861,21 @@ export default class Explorer {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public initDataExplorerWithFrameInputs(inputs: ViewModels.DataExplorerInputsFrame): Q.Promise<void> {
|
public setSelfServeType(inputs: ViewModels.DataExplorerInputsFrame): void {
|
||||||
if (inputs != null) {
|
const selfServeTypeForTest = inputs.features[Constants.Features.selfServeTypeForTest]
|
||||||
inputs.selfServeType
|
if (selfServeTypeForTest) {
|
||||||
? this.selfServeType(inputs.selfServeType)
|
this.selfServeType(SelfServeTypes[selfServeTypeForTest?.toLowerCase() as keyof typeof SelfServeTypes])
|
||||||
: this.selfServeType(SelfServeTypes.none);
|
} else if (inputs.selfServeType) {
|
||||||
|
this.selfServeType(inputs.selfServeType)
|
||||||
|
} else {
|
||||||
|
this.selfServeType(SelfServeTypes.none)
|
||||||
this._setLoadingStatusText("Connecting...", "Welcome to Azure Cosmos DB")
|
this._setLoadingStatusText("Connecting...", "Welcome to Azure Cosmos DB")
|
||||||
this._setConnectingImage()
|
this._setConnectingImage()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public initDataExplorerWithFrameInputs(inputs: ViewModels.DataExplorerInputsFrame): Q.Promise<void> {
|
||||||
|
if (inputs != null) {
|
||||||
const authorizationToken = inputs.authorizationToken || "";
|
const authorizationToken = inputs.authorizationToken || "";
|
||||||
const masterKey = inputs.masterKey || "";
|
const masterKey = inputs.masterKey || "";
|
||||||
const databaseAccount = inputs.databaseAccount || null;
|
const databaseAccount = inputs.databaseAccount || null;
|
||||||
@@ -1886,6 +1893,7 @@ export default class Explorer {
|
|||||||
this.isTryCosmosDBSubscription(inputs.isTryCosmosDBSubscription);
|
this.isTryCosmosDBSubscription(inputs.isTryCosmosDBSubscription);
|
||||||
this.isAuthWithResourceToken(inputs.isAuthWithresourceToken);
|
this.isAuthWithResourceToken(inputs.isAuthWithresourceToken);
|
||||||
this.setFeatureFlagsFromFlights(inputs.flights);
|
this.setFeatureFlagsFromFlights(inputs.flights);
|
||||||
|
this.setSelfServeType(inputs)
|
||||||
|
|
||||||
if (!!inputs.dataExplorerVersion) {
|
if (!!inputs.dataExplorerVersion) {
|
||||||
this.parentFrameDataExplorerVersion(inputs.dataExplorerVersion);
|
this.parentFrameDataExplorerVersion(inputs.dataExplorerVersion);
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ export class SelfServeComponentAdapter implements ReactAdapter {
|
|||||||
|
|
||||||
public renderComponent(): JSX.Element {
|
public renderComponent(): JSX.Element {
|
||||||
const selfServeType = this.container.selfServeType()
|
const selfServeType = this.container.selfServeType()
|
||||||
console.log("type:" + selfServeType)
|
|
||||||
const smartUiDescriptor = this.getDescriptor(selfServeType)
|
const smartUiDescriptor = this.getDescriptor(selfServeType)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user