mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-05-03 15:04:04 +01:00
explicitly set className instead of inferring from constructor
This commit is contained in:
parent
63d4b4f4ef
commit
4708722d1a
@ -1,3 +1,4 @@
|
|||||||
|
import { SelfServeType } from "SelfServe/SelfServeUtils";
|
||||||
import { IsDisplayable, OnChange, PropertyInfo, RefreshOptions, Values } from "../Decorators";
|
import { IsDisplayable, OnChange, PropertyInfo, RefreshOptions, Values } from "../Decorators";
|
||||||
import { selfServeTraceStart, selfServeTraceSuccess } from "../SelfServeTelemetryProcessor";
|
import { selfServeTraceStart, selfServeTraceSuccess } from "../SelfServeTelemetryProcessor";
|
||||||
import {
|
import {
|
||||||
@ -168,6 +169,10 @@ export default class SelfServeExample extends SelfServeBaseClass {
|
|||||||
return defaults;
|
return defaults;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
public getSelfServeType = (): SelfServeType => {
|
||||||
|
return SelfServeType.example;
|
||||||
|
}
|
||||||
|
|
||||||
@Values({
|
@Values({
|
||||||
labelTKey: "DescriptionLabel",
|
labelTKey: "DescriptionLabel",
|
||||||
description: {
|
description: {
|
||||||
|
@ -14,7 +14,7 @@ import {
|
|||||||
|
|
||||||
import type { ChoiceItem } from "../SelfServeTypes";
|
import type { ChoiceItem } from "../SelfServeTypes";
|
||||||
|
|
||||||
import { BladeType, generateBladeLink } from "../SelfServeUtils";
|
import { BladeType, generateBladeLink, SelfServeType } from "../SelfServeUtils";
|
||||||
import {
|
import {
|
||||||
deleteComputeResource,
|
deleteComputeResource,
|
||||||
getCurrentProvisioningState,
|
getCurrentProvisioningState,
|
||||||
@ -360,6 +360,10 @@ export default class GraphAPICompute extends SelfServeBaseClass {
|
|||||||
return defaults;
|
return defaults;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
public getSelfServeType = (): SelfServeType => {
|
||||||
|
return SelfServeType.graphapicompute;
|
||||||
|
}
|
||||||
|
|
||||||
@Values({
|
@Values({
|
||||||
isDynamicDescription: true,
|
isDynamicDescription: true,
|
||||||
})
|
})
|
||||||
|
@ -19,7 +19,7 @@ import {
|
|||||||
|
|
||||||
import type { ChoiceItem } from "../SelfServeTypes";
|
import type { ChoiceItem } from "../SelfServeTypes";
|
||||||
|
|
||||||
import { BladeType, generateBladeLink } from "../SelfServeUtils";
|
import { BladeType, generateBladeLink, SelfServeType } from "../SelfServeUtils";
|
||||||
import {
|
import {
|
||||||
deleteMaterializedViewsBuilderResource,
|
deleteMaterializedViewsBuilderResource,
|
||||||
getCurrentProvisioningState,
|
getCurrentProvisioningState,
|
||||||
@ -359,6 +359,10 @@ export default class MaterializedViewsBuilder extends SelfServeBaseClass {
|
|||||||
return defaults;
|
return defaults;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
public getSelfServeType = (): SelfServeType => {
|
||||||
|
return SelfServeType.materializedviewsbuilder;
|
||||||
|
}
|
||||||
|
|
||||||
@Values({
|
@Values({
|
||||||
isDynamicDescription: true,
|
isDynamicDescription: true,
|
||||||
})
|
})
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
* @module SelfServe/SelfServeTypes
|
* @module SelfServe/SelfServeTypes
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import { SelfServeType } from "SelfServe/SelfServeUtils";
|
||||||
import { TelemetryData } from "../Shared/Telemetry/TelemetryProcessor";
|
import { TelemetryData } from "../Shared/Telemetry/TelemetryProcessor";
|
||||||
|
|
||||||
interface BaseInput {
|
interface BaseInput {
|
||||||
@ -120,9 +121,11 @@ export abstract class SelfServeBaseClass {
|
|||||||
*/
|
*/
|
||||||
public abstract onRefresh: () => Promise<RefreshResult>;
|
public abstract onRefresh: () => Promise<RefreshResult>;
|
||||||
|
|
||||||
|
public abstract getSelfServeType: () => SelfServeType;
|
||||||
|
test: string = "hello"
|
||||||
/**@internal */
|
/**@internal */
|
||||||
public toSelfServeDescriptor(): SelfServeDescriptor {
|
public toSelfServeDescriptor(): SelfServeDescriptor {
|
||||||
const className = this.constructor.name;
|
const className: string = this.getSelfServeType();
|
||||||
const selfServeDescriptor = Reflect.getMetadata(className, this) as SelfServeDescriptor;
|
const selfServeDescriptor = Reflect.getMetadata(className, this) as SelfServeDescriptor;
|
||||||
|
|
||||||
if (!this.initialize) {
|
if (!this.initialize) {
|
||||||
|
@ -20,7 +20,7 @@ import {
|
|||||||
|
|
||||||
import type { ChoiceItem } from "../SelfServeTypes";
|
import type { ChoiceItem } from "../SelfServeTypes";
|
||||||
|
|
||||||
import { BladeType, generateBladeLink } from "../SelfServeUtils";
|
import { BladeType, generateBladeLink, SelfServeType } from "../SelfServeUtils";
|
||||||
import {
|
import {
|
||||||
deleteDedicatedGatewayResource,
|
deleteDedicatedGatewayResource,
|
||||||
getCurrentProvisioningState,
|
getCurrentProvisioningState,
|
||||||
@ -396,6 +396,10 @@ export default class SqlX extends SelfServeBaseClass {
|
|||||||
return defaults;
|
return defaults;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
public getSelfServeType = (): SelfServeType => {
|
||||||
|
return SelfServeType.sqlx;
|
||||||
|
}
|
||||||
|
|
||||||
@Values({
|
@Values({
|
||||||
isDynamicDescription: true,
|
isDynamicDescription: true,
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user