ljmotta commented on code in PR #2316:
URL:
https://github.com/apache/incubator-kie-tools/pull/2316#discussion_r1598362448
##########
packages/dmn-editor/src/boxedExpressions/getDefaultBoxedExpression.tsx:
##########
@@ -68,13 +65,13 @@ export function getDefaultBoxedExpression({
getDefaultColumnWidth,
}: {
logicType: BoxedExpression["__$$element"] | undefined;
- typeRef: string;
+ typeRef: string | undefined;
allTopLevelDataTypesByFeelName: DataTypeIndex;
getInputs?: () => { name: string; typeRef: string | undefined }[] |
undefined;
getDefaultColumnWidth?: (args: { name: string; typeRef: string | undefined
}) => number | undefined;
widthsById: Map<string, number[]>;
}): BoxedExpression {
- const dataType = allTopLevelDataTypesByFeelName.get(typeRef);
+ const dataType = allTopLevelDataTypesByFeelName.get(typeRef ??
"<Undefined>");
Review Comment:
`"<Undefined>"` is value used in a few places. Maybe extract to a variable?
WDYT?
##########
packages/stunner-editors-dmn-loader/src/index.tsx:
##########
@@ -98,7 +98,7 @@ const BoxedExpressionEditorWrapper:
React.FunctionComponent<BoxedExpressionEdito
const beeGwtService: BeeGwtService = {
getDefaultExpressionDefinition(logicType, dataType, isRoot) {
const defaultExpression = gwtExpressionToDmnExpression(
-
window.beeApiWrapper?.getDefaultExpressionDefinition(gwtLogicType(logicType),
dataType)
+
window.beeApiWrapper?.getDefaultExpressionDefinition(gwtLogicType(logicType),
dataType ?? "<Undefined>")
Review Comment:
The `dataType` parameter of `getDefaultExpressionDefinition` accepts an
`undefined` value, why fallback to `"<Undefined>"`? Maybe should we fallback
inside the method?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]