-
Notifications
You must be signed in to change notification settings - Fork 201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
kie-issue#1149: DMN Editor produces invalid typeRef attributes #2316
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@danielzhe Thanks for this change! I've added some comments inline
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>"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"<Undefined>"
is value used in a few places. Maybe extract to a variable? WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. I'm going to use the DmnBuiltInDataType.Undefined
for this.
@@ -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>") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The dataType
parameter of getDefaultExpressionDefinition
accepts an undefined
value, why fallback to "<Undefined>"
? Maybe should we fallback inside the method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because this is to the GWT layer and since it will be removed in the future I think we should avoid spending time on it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not for display only, though, right? I mean, this is getting into the XML.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we talked in pvt, I changed it to the proposed change by @ljmotta :)
e54aca6
to
be097a1
Compare
be097a1
to
ed612b6
Compare
Changes applied! Ready for your review @ljmotta @tiagobento |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually... Just checked an there are a lot of references to DmnBuiltInDataType.Undefined
in the stunner-editors-dmn-loader
component. Those are used in the beeToGwt
function, and certainly are leaking to the XML. Please check that too...
Closes: apache/incubator-kie-issues#1149
Some places related to the user interface are using "".
The places where the data is marshaled are using
undefined
.The "" value is still present in
DmnBuiltInDataType
because it is still a "valid value".