Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refresh proposal rubric answers when evaluation id changes #5150

Merged
merged 1 commit into from
Jan 9, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,13 @@
const rubricCriteria = evaluation?.rubricCriteria;
const myRubricAnswers = useMemo(
() => evaluation?.rubricAnswers.filter((answer) => answer.userId === user?.id) || [],
[user?.id, !!evaluation?.rubricAnswers]
// watch the evaluation id in case more than one evaluation has answers
[user?.id, evaluation.id, !!evaluation?.rubricAnswers]

Check warning on line 31 in components/proposals/ProposalPage/components/ProposalEvaluations/components/Review/components/RubricEvaluation/RubricEvaluation.tsx

View workflow job for this annotation

GitHub Actions / Test apps

React Hook useMemo has a missing dependency: 'evaluation?.rubricAnswers'. Either include it or remove the dependency array

Check warning on line 31 in components/proposals/ProposalPage/components/ProposalEvaluations/components/Review/components/RubricEvaluation/RubricEvaluation.tsx

View workflow job for this annotation

GitHub Actions / Test apps

React Hook useMemo has a complex expression in the dependency array. Extract it to a separate variable so it can be statically checked

Check warning on line 31 in components/proposals/ProposalPage/components/ProposalEvaluations/components/Review/components/RubricEvaluation/RubricEvaluation.tsx

View workflow job for this annotation

GitHub Actions / Validate code

React Hook useMemo has a missing dependency: 'evaluation?.rubricAnswers'. Either include it or remove the dependency array

Check warning on line 31 in components/proposals/ProposalPage/components/ProposalEvaluations/components/Review/components/RubricEvaluation/RubricEvaluation.tsx

View workflow job for this annotation

GitHub Actions / Validate code

React Hook useMemo has a complex expression in the dependency array. Extract it to a separate variable so it can be statically checked
);
const myDraftRubricAnswers = useMemo(
() => evaluation?.draftRubricAnswers.filter((answer) => answer.userId === user?.id),
// watch the size of draft answers so they refresh when the user deletes them
[user?.id, !!evaluation?.draftRubricAnswers?.length]
[user?.id, evaluation.id, !!evaluation?.draftRubricAnswers?.length]

Check warning on line 36 in components/proposals/ProposalPage/components/ProposalEvaluations/components/Review/components/RubricEvaluation/RubricEvaluation.tsx

View workflow job for this annotation

GitHub Actions / Test apps

React Hook useMemo has a missing dependency: 'evaluation?.draftRubricAnswers'. Either include it or remove the dependency array

Check warning on line 36 in components/proposals/ProposalPage/components/ProposalEvaluations/components/Review/components/RubricEvaluation/RubricEvaluation.tsx

View workflow job for this annotation

GitHub Actions / Test apps

React Hook useMemo has a complex expression in the dependency array. Extract it to a separate variable so it can be statically checked

Check warning on line 36 in components/proposals/ProposalPage/components/ProposalEvaluations/components/Review/components/RubricEvaluation/RubricEvaluation.tsx

View workflow job for this annotation

GitHub Actions / Validate code

React Hook useMemo has a missing dependency: 'evaluation?.draftRubricAnswers'. Either include it or remove the dependency array

Check warning on line 36 in components/proposals/ProposalPage/components/ProposalEvaluations/components/Review/components/RubricEvaluation/RubricEvaluation.tsx

View workflow job for this annotation

GitHub Actions / Validate code

React Hook useMemo has a complex expression in the dependency array. Extract it to a separate variable so it can be statically checked
);

const isAuthor = proposal.authors.some((a) => a.userId === user?.id);
Expand Down
Loading