jomarko commented on code in PR #2681:
URL: 
https://github.com/apache/incubator-kie-tools/pull/2681#discussion_r1878034506


##########
packages/boxed-expression-component/src/table/BeeTable/BeeTableBody.tsx:
##########
@@ -72,15 +77,29 @@ export function BeeTableBody<R extends object>({
   lastColumnMinWidth,
   rowWrapper,
   isReadOnly,
+  evaluationHitsCountColumnIndex,
+  getEvaluationHitsCountSupportedByRow,
 }: BeeTableBodyProps<R>) {
+  const { evaluationHitsCountPerId } = useBoxedExpressionEditor();
+
   const renderRow = useCallback(
     (row: ReactTable.Row<R>, rowIndex: number) => {
       reactTableInstance.prepareRow(row);
 
+      const rowKey = getRowKey(row);
+      const isEvalationHitsCountSupportedByRow: boolean = 
getEvaluationHitsCountSupportedByRow?.(row) ?? false;
+      const rowEvaluationHitsCount = evaluationHitsCountPerId ? 
evaluationHitsCountPerId?.get(rowKey) ?? 0 : undefined;
+      const canDisplayEvaluationHitsCountRowOverlay =
+        rowEvaluationHitsCount !== undefined && 
isEvalationHitsCountSupportedByRow === true;
+      const rowClassName = canDisplayEvaluationHitsCountRowOverlay
+        ? rowKey + (rowEvaluationHitsCount > 0 ? " 
evaluation-hits-count-row-overlay" : "")
+        : rowKey;

Review Comment:
   the ternary operator is tricky
   
   there is an eslint rule, that would force what you propose:
   ```
   https://eslint.style/rules/js/multiline-ternary
   ```
   
   However once I used it in project and formatted ternary operators as 
multiple lines, the current prettier configuration, the pre-commit hook for 
formatting we have reverted those changes, or adapted them in a way, that 
caused eslint again complaining..
   
   So we have currently a prettier configuration that is not compatible with 
this eslint rule.



-- 
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: commits-unsubscr...@kie.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@kie.apache.org
For additional commands, e-mail: commits-h...@kie.apache.org

Reply via email to