From 3e2e5f600df73f1cb00c85e0f7c8a09a3e01004b Mon Sep 17 00:00:00 2001 From: Josh Chudy Date: Thu, 22 Aug 2024 12:21:21 -0700 Subject: [PATCH] add mafeSafeIdAttr to id used in a 'tr' in the record main section. fix bug with make test command (#2526) --- Makefile | 2 +- src/components/record/record-main-section.tsx | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index f7e122524..cb9e53b36 100644 --- a/Makefile +++ b/Makefile @@ -66,7 +66,7 @@ E2EDrecordLinks=test/e2e/specs/default-config/record/links.config.ts E2EDrecordset=test/e2e/specs/all-features-confirmation/recordset/presentation.conf.js E2EDrecordsetEdit=test/e2e/specs/default-config/recordset/edit.conf.js E2ErecordsetAdd=test/e2e/specs/default-config/recordset/add.conf.js -E2EDrecordsetIndFacet=test/e2e/specs/delete-prohibited/recordset/ind-facet.config.ts +E2EDrecordsetIndFacet=test/e2e/specs/delete-prohibited/recordset/facet.config.ts E2EDrecordsetHistFacet=test/e2e/specs/delete-prohibited/recordset/histogram-facet.config.ts E2ErecordsetSavedQuery=test/e2e/specs/all-features/recordset/saved-query.config.ts diff --git a/src/components/record/record-main-section.tsx b/src/components/record/record-main-section.tsx index 2d7d1547c..d871d98dd 100644 --- a/src/components/record/record-main-section.tsx +++ b/src/components/record/record-main-section.tsx @@ -36,7 +36,7 @@ const RecordMainSection = (): JSX.Element => { } else if (columnModel.requireSecondaryRequest) { return (showEmptySections || (!!recordValues[columnModel.index] && !!recordValues[columnModel.index].value)); } else { - return (recordValues[columnModel.index] && recordValues[columnModel.index].value != null); + return (recordValues[columnModel.index] && recordValues[columnModel.index].value !== null); } }; @@ -44,11 +44,15 @@ const RecordMainSection = (): JSX.Element => { * Show an error warning if the column is aggregate or inline related table and the data failed to load */ const showError = (cm: RecordColumnModel): boolean => { + // disable !== checking since cm.relatedModel can be `null` OR `undefined` + // eslint-disable-next-line eqeqeq return cm.hasTimeoutError || (cm.relatedModel != null && cm.relatedModel.recordsetState.hasTimeoutError); }; const showLoader = (cm: RecordColumnModel): boolean => { // TODO this is assuming isLoading is also used for the inlines (page.content) + // disable !== checking since cm.relatedModel can be `null` OR `undefined` + // eslint-disable-next-line eqeqeq return cm.isLoading || (cm.relatedModel != null && cm.relatedModel.recordsetState.isLoading); }; @@ -94,7 +98,7 @@ const RecordMainSection = (): JSX.Element => { ); return ( - + {/* --------- entity key ---------- */} {hasTooltip ?