Skip to content

Commit

Permalink
chore: some minor refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
9sneha-n committed Oct 1, 2024
1 parent 3552466 commit 7650388
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/data/repositories/RiskAssessmentD2Repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ export const riskAssessmentGradingIds = {

export const riskAssessmentSummaryIds = {
riskAssessmentDate: "bSmNYOatIZr",
// riskGrade: "RTSL_ZEB_DET_RAG", //TO DO SNEHA : Do we need this?
riskAssessor1: "H5MbxkSRf6c",
addAnotherRiskAssessor1: "CM51mmM6dGs",
riskAssessor2: "GVB68P2yMs6",
Expand Down
24 changes: 24 additions & 0 deletions src/data/repositories/test/RiskAssessmentTestRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { Future } from "../../../domain/entities/generic/Future";
import { Id } from "../../../domain/entities/Ref";
import { RiskAssessment } from "../../../domain/entities/risk-assessment/RiskAssessment";
import { RiskAssessmentGrading } from "../../../domain/entities/risk-assessment/RiskAssessmentGrading";
import { RiskAssessmentQuestionnaire } from "../../../domain/entities/risk-assessment/RiskAssessmentQuestionnaire";
import { RiskAssessmentSummary } from "../../../domain/entities/risk-assessment/RiskAssessmentSummary";
import { RiskAssessmentRepository } from "../../../domain/repositories/RiskAssessmentRepository";
import { Maybe } from "../../../utils/ts-utils";
Expand Down Expand Up @@ -58,6 +59,29 @@ export class RiskAssessmentTestRepository implements RiskAssessmentRepository {
overallConfidenceGlobal: { id: "1", name: "Low" },
riskId: "1",
}),
questionnaire: new RiskAssessmentQuestionnaire({
id: "1",
potentialRiskForHumanHealth: {
likelihood: { id: "1", name: "likelihood1" },
consequences: { id: "1", name: "consequences1" },
risk: { id: "1", name: "risk1" },
rational: "rational1",
},
riskOfEventSpreading: {
likelihood: { id: "1", name: "likelihood1" },
consequences: { id: "1", name: "consequences1" },
risk: { id: "1", name: "risk1" },
rational: "rational1",
},
riskOfInsufficientCapacities: {
likelihood: { id: "1", name: "likelihood1" },
consequences: { id: "1", name: "consequences1" },
risk: { id: "1", name: "risk1" },
rational: "rational1",
},
//custom questions added by user
additionalQuestions: [],
}),
})
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/domain/entities/risk-assessment/RiskAssessment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { RiskAssessmentSummary } from "./RiskAssessmentSummary";
interface RiskAssessmentAttrs {
grading: RiskAssessmentGrading[];
summary: Maybe<RiskAssessmentSummary>;
questionnaire?: RiskAssessmentQuestionnaire;
questionnaire: Maybe<RiskAssessmentQuestionnaire>;
}

export class RiskAssessment extends Struct<RiskAssessmentAttrs>() {}
1 change: 0 additions & 1 deletion src/webapp/contexts/CurrentEventTrackerProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { Maybe } from "../../utils/ts-utils";
export const CurrentEventTrackerContextProvider: React.FC<PropsWithChildren> = ({ children }) => {
const [currentEventTracker, setCurrentEventTracker] = useState<DiseaseOutbreakEvent>();

//PPS Module functions.
const changeCurrentEventTracker = (EventTrackerDetails: DiseaseOutbreakEvent) => {
setCurrentEventTracker(EventTrackerDetails);
localStorage.setItem("currentEventTracker", JSON.stringify(EventTrackerDetails));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,8 @@ function validateFormState(
entityValidationErrors = DiseaseOutbreakEvent.validate(configurableForm.entity);
break;
}

case "risk-assessment-grading":
break;

case "risk-assessment-summary":
break;
case "risk-assessment-questionnaire":
Expand Down

0 comments on commit 7650388

Please sign in to comment.