Skip to content

Commit

Permalink
add mafeSafeIdAttr to id used in a 'tr' in the record main section. f…
Browse files Browse the repository at this point in the history
…ix bug with make test command (#2526)
  • Loading branch information
jrchudy authored Aug 22, 2024
1 parent 55571d2 commit 3e2e5f6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 6 additions & 2 deletions src/components/record/record-main-section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,23 @@ 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);
}
};

/**
* 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);
};

Expand Down Expand Up @@ -94,7 +98,7 @@ const RecordMainSection = (): JSX.Element => {
);

return (
<tr key={`col-${index}`} id={`row-${cm.column.name}`} className={rowClassName.join(' ')}>
<tr key={`col-${index}`} id={`row-${makeSafeIdAttr(cm.column.name)}`} className={rowClassName.join(' ')}>
{/* --------- entity key ---------- */}
<td className={entityKeyClassName.join(' ')}>
{hasTooltip ?
Expand Down

0 comments on commit 3e2e5f6

Please sign in to comment.