Skip to content

Commit

Permalink
if there are errors then display them right away instead of trying to…
Browse files Browse the repository at this point in the history
… put together the other elements
  • Loading branch information
jasquat committed Jan 26, 2024
1 parent 1bff435 commit 3902657
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions spiffworkflow-frontend/src/components/ProcessInstanceListTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,18 @@ export default function ProcessInstanceListTable({
'You must use one or the other.'
);
}
if (errors.length > 0) {
return (
<Grid fullWidth condensed className="megacondensed">
{tableTitleLine()}
<Column sm={{ span: 4 }} md={{ span: 8 }} lg={{ span: 16 }}>
{childrenForErrorObject(
errorForDisplayFromString(errors.join(' ::: '))
)}
</Column>
</Grid>
);
}

let tableElement = null;
if (pagination && (!textToShowIfEmpty || pagination.total > 0)) {
Expand Down Expand Up @@ -560,19 +572,6 @@ export default function ProcessInstanceListTable({
</p>
);
}

if (errors.length > 0) {
return (
<Grid fullWidth condensed className="megacondensed">
{tableTitleLine()}
<Column sm={{ span: 4 }} md={{ span: 8 }} lg={{ span: 16 }}>
{childrenForErrorObject(
errorForDisplayFromString(errors.join(' ::: '))
)}
</Column>
</Grid>
);
}
return (
<Grid fullWidth condensed className="megacondensed">
{tableTitleLine()}
Expand Down

0 comments on commit 3902657

Please sign in to comment.