From 934e921e5205a6a566860ee123bfd7385528573d Mon Sep 17 00:00:00 2001 From: eugenejahn Date: Fri, 8 Jul 2022 11:39:15 -0700 Subject: [PATCH] fix: update type label Signed-off-by: eugenejahn --- .../console/src/components/Launch/LaunchForm/constants.ts | 2 +- .../zapp/console/src/components/Launch/LaunchForm/utils.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/zapp/console/src/components/Launch/LaunchForm/constants.ts b/packages/zapp/console/src/components/Launch/LaunchForm/constants.ts index 9b44cd7e3..5b5081b04 100644 --- a/packages/zapp/console/src/components/Launch/LaunchForm/constants.ts +++ b/packages/zapp/console/src/components/Launch/LaunchForm/constants.ts @@ -45,7 +45,7 @@ export const typeLabels: { [k in InputType]: string } = { [InputType.Schema]: 'schema - uri', [InputType.String]: 'string', [InputType.Struct]: 'struct', - [InputType.Union]: '', + [InputType.Union]: 'union', [InputType.Unknown]: 'unknown', }; diff --git a/packages/zapp/console/src/components/Launch/LaunchForm/utils.ts b/packages/zapp/console/src/components/Launch/LaunchForm/utils.ts index 2e8312303..2b508f65a 100644 --- a/packages/zapp/console/src/components/Launch/LaunchForm/utils.ts +++ b/packages/zapp/console/src/components/Launch/LaunchForm/utils.ts @@ -83,11 +83,11 @@ export function formatType({ type, subtype, listOfSubTypes }: InputTypeDefinitio return subtype ? `map` : 'map'; } if (type === InputType.Union) { - if (!listOfSubTypes) return 'union'; + if (!listOfSubTypes) return typeLabels[type]; const concatListOfSubTypes = listOfSubTypes.map((subtype) => formatType(subtype)).join(' | '); - return `union [${concatListOfSubTypes}]`; + return `${typeLabels[type]} [${concatListOfSubTypes}]`; } return typeLabels[type]; }