Skip to content

Commit

Permalink
allow admins to save evaluation steps even if invalid (#4874)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattcasey authored Oct 23, 2024
1 parent 3efea91 commit 8def357
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,7 @@ export function EvaluationsReview({
{evaluationInput && (
<EvaluationStepSettingsModal
close={closeSettings}
isAdmin={isAdmin}
evaluationInput={evaluationInput}
templateId={templateId}
saveEvaluation={saveEvaluation}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ export function EvaluationStepSettingsModal({
evaluationInput,
templateId,
saveEvaluation,
updateEvaluation
updateEvaluation,
isAdmin
}: {
close: VoidFunction;
evaluationInput: ProposalEvaluationValues;
templateId?: string | null;
saveEvaluation: (evaluation: ProposalEvaluationValues) => void;
updateEvaluation: (evaluation: Partial<ProposalEvaluationValues>) => void;
isAdmin: boolean;
}) {
const { data: proposalTemplate } = useGetProposalTemplate(templateId);
const evaluationInputError = evaluationInput && getEvaluationFormError(evaluationInput as ProposalEvaluationInput);
Expand All @@ -42,7 +44,7 @@ export function EvaluationStepSettingsModal({
Cancel
</Button>
<Button
disabled={evaluationInputError}
disabled={!isAdmin && evaluationInputError}
disabledTooltip={evaluationInputError}
onClick={() => saveEvaluation(evaluationInput)}
>
Expand Down

0 comments on commit 8def357

Please sign in to comment.