Kusuma04-dev commented on code in PR #2912:
URL:
https://github.com/apache/incubator-kie-tools/pull/2912#discussion_r1974876529
##########
packages/boxed-expression-component/src/expressions/DecisionTableExpression/DecisionTableExpression.tsx:
##########
@@ -416,35 +416,60 @@ export function DecisionTableExpression({
widths,
]);
- const beeTableRows = useMemo(
- () =>
- (decisionTableExpression.rule ?? []).map((rule) => {
- const ruleRow = [
- ...(rule.inputEntry ?? []),
- ...(rule.outputEntry ?? new
Array(decisionTableExpression.output.length)),
- ...(rule.annotationEntry ?? []),
- ];
-
- return getColumnsAtLastLevel(beeTableColumns).reduce(
- (tableRow: ROWTYPE, column, columnIndex) => {
- tableRow[column.accessor] = {
- id: (ruleRow[columnIndex] as DMN15__tUnaryTests &
DMN15__tLiteralExpression)?.["@_id"] ?? "",
- content: ruleRow[columnIndex]?.text?.__$$text ?? "",
- };
- return tableRow;
- },
- { id: rule["@_id"] }
- );
- }),
- [beeTableColumns, decisionTableExpression.output.length,
decisionTableExpression.rule]
- );
+ const createDefaultRule = () => {
+ const defaultRowToAdd: Normalized<DMN15__tDecisionRule> = {
+ "@_id": generateUuid(),
+ inputEntry: [
+ {
+ "@_id": generateUuid(),
+ text: { __$$text: DECISION_TABLE_INPUT_DEFAULT_VALUE },
+ },
+ ],
+ outputEntry: [
+ {
+ "@_id": generateUuid(),
+ text: { __$$text: DECISION_TABLE_OUTPUT_DEFAULT_VALUE },
+ },
+ ],
+ annotationEntry: [{ text: { __$$text: "// Your annotations here" } }],
+ };
+ return defaultRowToAdd;
+ };
Review Comment:
Thanks Tiago for pointing out , Will do.
--
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]