Added className to SelfServeBaseClass (#627)

* Added className to SelfServeBaseClass

* addressed PR comments

* addressed PR comments

* fixed lint errors
This commit is contained in:
Srinath Narayanan
2021-04-07 11:17:15 -07:00
committed by GitHub
parent 4f22d308b3
commit d2423f28dc
5 changed files with 13 additions and 13 deletions

View File

@@ -112,21 +112,18 @@ export const updateContextWithDecorator = <T extends keyof DecoratorProperties,
export const buildSmartUiDescriptor = (className: string, target: unknown): void => {
const context = Reflect.getMetadata(className, target) as Map<string, DecoratorProperties>;
const smartUiDescriptor = mapToSmartUiDescriptor(className, context);
const smartUiDescriptor = mapToSmartUiDescriptor(context);
Reflect.defineMetadata(className, smartUiDescriptor, target);
};
export const mapToSmartUiDescriptor = (
className: string,
context: Map<string, DecoratorProperties>
): SelfServeDescriptor => {
export const mapToSmartUiDescriptor = (context: Map<string, DecoratorProperties>): SelfServeDescriptor => {
const inputNames: string[] = [];
const root = context.get("root");
context.delete("root");
const smartUiDescriptor: SelfServeDescriptor = {
root: {
id: className,
id: undefined,
info: undefined,
children: [],
},