mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-10-13 23:38:45 +01:00
renamed sqlx->example and added invalid type
This commit is contained in:
parent
8cb8d10bc3
commit
f770bb193e
@ -517,7 +517,7 @@ export class SmartUiComponent extends React.Component<SmartUiComponentProps, Sma
|
|||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
) : (
|
) : (
|
||||||
<Spinner size={SpinnerSize.large} />
|
<Spinner size={SpinnerSize.large} styles={{root: {textAlign: "center", justifyContent: "center", width: "100%", height: "100%"}}}/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1864,7 +1864,8 @@ export default class Explorer {
|
|||||||
public setSelfServeType(inputs: ViewModels.DataExplorerInputsFrame): void {
|
public setSelfServeType(inputs: ViewModels.DataExplorerInputsFrame): void {
|
||||||
const selfServeTypeForTest = inputs.features[Constants.Features.selfServeTypeForTest]
|
const selfServeTypeForTest = inputs.features[Constants.Features.selfServeTypeForTest]
|
||||||
if (selfServeTypeForTest) {
|
if (selfServeTypeForTest) {
|
||||||
this.selfServeType(SelfServeTypes[selfServeTypeForTest?.toLowerCase() as keyof typeof SelfServeTypes])
|
const selfServeType = SelfServeTypes[selfServeTypeForTest?.toLowerCase() as keyof typeof SelfServeTypes]
|
||||||
|
this.selfServeType(selfServeType ? selfServeType : SelfServeTypes.invalid)
|
||||||
} else if (inputs.selfServeType) {
|
} else if (inputs.selfServeType) {
|
||||||
this.selfServeType(inputs.selfServeType)
|
this.selfServeType(inputs.selfServeType)
|
||||||
} else {
|
} else {
|
||||||
|
@ -126,7 +126,7 @@ const App: React.FunctionComponent = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flexContainer">
|
<div className="flexContainer">
|
||||||
<div id="divSelfServe" data-bind="visible: selfServeType() && selfServeType() !== 'none', react: selfServeComponentAdapter">
|
<div id="divSelfServe" className="flexContainer" data-bind="visible: selfServeType() && selfServeType() !== 'none', react: selfServeComponentAdapter">
|
||||||
</div>
|
</div>
|
||||||
<div id="divExplorer" className="flexContainer hideOverflows" style={{ display: "none" }}>
|
<div id="divExplorer" className="flexContainer hideOverflows" style={{ display: "none" }}>
|
||||||
{/* Main Command Bar - Start */}
|
{/* Main Command Bar - Start */}
|
||||||
@ -375,7 +375,7 @@ const App: React.FunctionComponent = () => {
|
|||||||
{/* Global loader - Start */}
|
{/* Global loader - Start */}
|
||||||
<div className="splashLoaderContainer" data-bind="visible: isRefreshingExplorer">
|
<div className="splashLoaderContainer" data-bind="visible: isRefreshingExplorer">
|
||||||
<div className="splashLoaderContentContainer">
|
<div className="splashLoaderContentContainer">
|
||||||
<div className="splashLoaderTitle" data-bind="visible: selfServeType() === undefined, react: selfServeLoadingComponentAdapter">
|
<div data-bind="visible: selfServeType() === undefined, react: selfServeLoadingComponentAdapter">
|
||||||
</div>
|
</div>
|
||||||
<p className="connectExplorerContent" id="explorerConnectingImage" data-bind="visible: selfServeType() === 'none'">
|
<p className="connectExplorerContent" id="explorerConnectingImage" data-bind="visible: selfServeType() === 'none'">
|
||||||
</p>
|
</p>
|
||||||
|
@ -13,26 +13,26 @@ import {
|
|||||||
import { SmartUi, ClassInfo, OnSubmit, Initialize } from "../ClassDescriptors";
|
import { SmartUi, ClassInfo, OnSubmit, Initialize } from "../ClassDescriptors";
|
||||||
import {
|
import {
|
||||||
getPromise,
|
getPromise,
|
||||||
initializeSqlX,
|
initializeSelfServeExample,
|
||||||
instanceSizeInfo,
|
instanceSizeInfo,
|
||||||
instanceSizeOptions,
|
instanceSizeOptions,
|
||||||
onInstanceCountChange,
|
onInstanceCountChange,
|
||||||
onSubmit,
|
onSubmit,
|
||||||
renderText,
|
renderText,
|
||||||
Sizes,
|
Sizes,
|
||||||
sqlXInfo
|
selfServeExampleInfo
|
||||||
} from "./SqlXApis";
|
} from "./ExampleApis";
|
||||||
import { SelfServeBase } from "../SelfServeUtils";
|
import { SelfServeBase } from "../SelfServeUtils";
|
||||||
import { ChoiceItem } from "../../Explorer/Controls/SmartUi/SmartUiComponent";
|
import { ChoiceItem } from "../../Explorer/Controls/SmartUi/SmartUiComponent";
|
||||||
|
|
||||||
@SmartUi()
|
@SmartUi()
|
||||||
@ClassInfo(getPromise(sqlXInfo))
|
@ClassInfo(getPromise(selfServeExampleInfo))
|
||||||
@Initialize(initializeSqlX)
|
@Initialize(initializeSelfServeExample)
|
||||||
@OnSubmit(onSubmit)
|
@OnSubmit(onSubmit)
|
||||||
export class SqlX extends SelfServeBase {
|
export class SelfServeExample extends SelfServeBase {
|
||||||
|
|
||||||
@Label(getPromise("Description"))
|
@Label(getPromise("Description"))
|
||||||
@CustomElement(renderText("This is the description part of SqlX"))
|
@CustomElement(renderText("This is the description."))
|
||||||
static description: string;
|
static description: string;
|
||||||
|
|
||||||
@Label(getPromise("Instance Size"))
|
@Label(getPromise("Instance Size"))
|
||||||
@ -42,7 +42,7 @@ export class SqlX extends SelfServeBase {
|
|||||||
static instanceSize: ChoiceItem;
|
static instanceSize: ChoiceItem;
|
||||||
|
|
||||||
@Label(getPromise("About"))
|
@Label(getPromise("About"))
|
||||||
@CustomElement(renderText("This is the about part of SqlX"))
|
@CustomElement(renderText("This is the about ."))
|
||||||
static about: string;
|
static about: string;
|
||||||
|
|
||||||
@Label("Feature Allowed")
|
@Label("Feature Allowed")
|
@ -1,7 +1,6 @@
|
|||||||
import { Text } from "office-ui-fabric-react";
|
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { ChoiceItem, Info, InputType } from "../../Explorer/Controls/SmartUi/SmartUiComponent";
|
import { ChoiceItem, Info, InputType } from "../../Explorer/Controls/SmartUi/SmartUiComponent";
|
||||||
import { TextComponent } from "./TextComponent";
|
import { TextComponent } from "./CustomComponent";
|
||||||
import {SessionStorageUtility} from "../../Shared/StorageUtility"
|
import {SessionStorageUtility} from "../../Shared/StorageUtility"
|
||||||
|
|
||||||
export enum Sizes {
|
export enum Sizes {
|
||||||
@ -16,8 +15,8 @@ export const instanceSizeOptions: ChoiceItem[] = [
|
|||||||
{ label: Sizes.FourCore16Gb, key: Sizes.FourCore16Gb, value: Sizes.FourCore16Gb }
|
{ label: Sizes.FourCore16Gb, key: Sizes.FourCore16Gb, value: Sizes.FourCore16Gb }
|
||||||
];
|
];
|
||||||
|
|
||||||
export const sqlXInfo: Info = {
|
export const selfServeExampleInfo: Info = {
|
||||||
message: "SqlX is a self serve class"
|
message: "This is a self serve class"
|
||||||
};
|
};
|
||||||
|
|
||||||
export const instanceSizeInfo: Info = {
|
export const instanceSizeInfo: Info = {
|
||||||
@ -53,7 +52,7 @@ export const onSubmit = async (currentValues: Map<string, InputType>): Promise<v
|
|||||||
SessionStorageUtility.setEntry("isAllowed", currentValues.get("isAllowed")?.toString())
|
SessionStorageUtility.setEntry("isAllowed", currentValues.get("isAllowed")?.toString())
|
||||||
};
|
};
|
||||||
|
|
||||||
export const initializeSqlX = async () : Promise<Map<string, InputType>> => {
|
export const initializeSelfServeExample = async () : Promise<Map<string, InputType>> => {
|
||||||
let defaults = new Map<string, InputType>()
|
let defaults = new Map<string, InputType>()
|
||||||
defaults.set("instanceCount", parseInt(SessionStorageUtility.getEntry("instanceCount")))
|
defaults.set("instanceCount", parseInt(SessionStorageUtility.getEntry("instanceCount")))
|
||||||
defaults.set("instanceSize", SessionStorageUtility.getEntry("instanceSize"))
|
defaults.set("instanceSize", SessionStorageUtility.getEntry("instanceSize"))
|
@ -9,7 +9,7 @@ import { ReactAdapter } from "../Bindings/ReactBindingHandler";
|
|||||||
import Explorer from "../Explorer/Explorer";
|
import Explorer from "../Explorer/Explorer";
|
||||||
import { Descriptor, SmartUiComponent } from "../Explorer/Controls/SmartUi/SmartUiComponent";
|
import { Descriptor, SmartUiComponent } from "../Explorer/Controls/SmartUi/SmartUiComponent";
|
||||||
import { SelfServeTypes } from "./SelfServeUtils";
|
import { SelfServeTypes } from "./SelfServeUtils";
|
||||||
import { SqlX } from "./SqlX/SqlX";
|
import { SelfServeExample } from "./Example/Example";
|
||||||
|
|
||||||
export class SelfServeComponentAdapter implements ReactAdapter {
|
export class SelfServeComponentAdapter implements ReactAdapter {
|
||||||
public parameters: ko.Observable<number>;
|
public parameters: ko.Observable<number>;
|
||||||
@ -23,8 +23,8 @@ export class SelfServeComponentAdapter implements ReactAdapter {
|
|||||||
|
|
||||||
private getDescriptor = (selfServeType : SelfServeTypes) : Descriptor => {
|
private getDescriptor = (selfServeType : SelfServeTypes) : Descriptor => {
|
||||||
switch (selfServeType) {
|
switch (selfServeType) {
|
||||||
case SelfServeTypes.sqlx:
|
case SelfServeTypes.example:
|
||||||
return SqlX.toSmartUiDescriptor()
|
return SelfServeExample.toSmartUiDescriptor()
|
||||||
default:
|
default:
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
@ -39,7 +39,6 @@ export class SelfServeComponentAdapter implements ReactAdapter {
|
|||||||
<SmartUiComponent descriptor={smartUiDescriptor} /> :
|
<SmartUiComponent descriptor={smartUiDescriptor} /> :
|
||||||
<h1>Invalid self serve type!</h1>
|
<h1>Invalid self serve type!</h1>
|
||||||
|
|
||||||
|
|
||||||
return element
|
return element
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -198,7 +198,8 @@ const getInput = (value: CommonInputTypes): AnyInput => {
|
|||||||
|
|
||||||
export enum SelfServeTypes {
|
export enum SelfServeTypes {
|
||||||
none="none",
|
none="none",
|
||||||
sqlx="sqlx"
|
invalid="invalid",
|
||||||
|
example="example"
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getSelfServeType = (search: string): SelfServeTypes => {
|
export const getSelfServeType = (search: string): SelfServeTypes => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user