Skip to content

Commit

Permalink
🐛 Fix issue causing all non-required assessments to show as archived (#…
Browse files Browse the repository at this point in the history
…1580)

- Missed this in the first pass. Need to filter the archived
questionnaires passed when rendering the archived table.
https://issues.redhat.com/browse/MTA-1722

Signed-off-by: ibolton336 <ibolton@redhat.com>
  • Loading branch information
ibolton336 authored Dec 4, 2023
1 parent 86c4640 commit 17369d3
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ const AssessmentActionsTable: React.FC<AssessmentActionsTableProps> = ({
nonRequiredQuestionnaireIds.includes(assessment.questionnaire.id) &&
relevantAssessmentIds.includes(assessment.id)
);
const filteredArchivedQuestionnaires = archivedQuestionnaires.filter(
(questionnaire) =>
filteredArchivedAssessments.some(
(assessment) => assessment.questionnaire.id === questionnaire.id
)
);

return (
<>
Expand All @@ -56,7 +62,7 @@ const AssessmentActionsTable: React.FC<AssessmentActionsTableProps> = ({
application={application}
archetype={archetype}
isReadonly
questionnaires={archivedQuestionnaires}
questionnaires={filteredArchivedQuestionnaires}
assessments={filteredArchivedAssessments}
isFetching={isFetchingQuestionnaires || isFetchingAssessmentsById}
tableName="Archived questionnaires"
Expand Down

0 comments on commit 17369d3

Please sign in to comment.