Skip to content

Commit

Permalink
LandScape gets assessments from selection
Browse files Browse the repository at this point in the history
Signed-off-by: Gilles Dubreuil <[email protected]>
  • Loading branch information
gildub committed Sep 19, 2023
1 parent 41d2651 commit b3e8e4a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { ConditionalRender } from "@app/components/ConditionalRender";
import { StateError } from "@app/components/StateError";

import { RISK_LIST } from "@app/Constants";
import { AssessmentRisk, Ref } from "@app/api/models";
import { Assessment, AssessmentRisk } from "@app/api/models";

import { ApplicationSelectionContext } from "../../application-selection-context";
import { NoApplicationSelectedEmptyState } from "../no-application-selected-empty-state";
Expand Down Expand Up @@ -49,10 +49,10 @@ const extractLandscapeData = (
};

interface ILandscapeProps {
questionnaire?: Ref;
assessments: Assessment[];
}

export const Landscape: React.FC<ILandscapeProps> = ({ questionnaire }) => {
export const Landscape: React.FC<ILandscapeProps> = ({ assessments }) => {
const { t } = useTranslation();

// Context
Expand Down
13 changes: 7 additions & 6 deletions client/src/app/pages/reports/reports.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,14 @@ export const Reports: React.FC = () => {
<CardBody>
<Bullseye>
<Landscape
questionnaire={
selectedQuestionnaire !== "All questionnaires"
? questionnaires.find(
(questionnaire) =>
questionnaire.name === selectedQuestionnaire
assessments={
selectedQuestionnaire === "All questionnaires"
? assessments
: assessments.filter(
(assessment) =>
assessment.questionnaire.name ===
selectedQuestionnaire
)
: undefined
}
/>
</Bullseye>
Expand Down

0 comments on commit b3e8e4a

Please sign in to comment.