update: validation for toggle flag on assessment index lazy
This commit is contained in:
parent
5267fb0937
commit
3dcbd2810a
|
|
@ -387,13 +387,18 @@ export default function AssessmentPage() {
|
||||||
}));
|
}));
|
||||||
toggleFlagMutation.mutate(questionId);
|
toggleFlagMutation.mutate(questionId);
|
||||||
}}
|
}}
|
||||||
title="Tandai"
|
title={
|
||||||
|
!answers[question.questionId]
|
||||||
|
? "Pilih jawaban terlebih dahulu"
|
||||||
|
: "Tandai"
|
||||||
|
}
|
||||||
color={flaggedQuestions[questionId] ? "red" : "white"}
|
color={flaggedQuestions[questionId] ? "red" : "white"}
|
||||||
style={{
|
style={{
|
||||||
border: "1px gray solid ",
|
border: "1px gray solid",
|
||||||
borderRadius: "4px",
|
borderRadius: "4px",
|
||||||
backgroundColor: flaggedQuestions[questionId] ? "red" : "white",
|
backgroundColor: flaggedQuestions[questionId] ? "red" : "white",
|
||||||
}}
|
}}
|
||||||
|
disabled={!answers[question.questionId]}
|
||||||
>
|
>
|
||||||
<TbFlagFilled
|
<TbFlagFilled
|
||||||
size={20}
|
size={20}
|
||||||
|
|
@ -434,7 +439,10 @@ export default function AssessmentPage() {
|
||||||
<Text color="red">Tidak ada opsi untuk pertanyaan ini.</Text>
|
<Text color="red">Tidak ada opsi untuk pertanyaan ini.</Text>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<Textarea placeholder="Berikan keterangan terkait jawaban di atas" />
|
<Textarea
|
||||||
|
placeholder="Berikan keterangan terkait jawaban di atas"
|
||||||
|
disabled={!answers[question.questionId]}
|
||||||
|
/>
|
||||||
|
|
||||||
{/* File Upload */}
|
{/* File Upload */}
|
||||||
{question.needFile === true && (
|
{question.needFile === true && (
|
||||||
|
|
@ -466,6 +474,7 @@ export default function AssessmentPage() {
|
||||||
onChange={handleFileChange}
|
onChange={handleFileChange}
|
||||||
style={{ display: "none" }}
|
style={{ display: "none" }}
|
||||||
accept="image/png, image/jpeg, application/pdf"
|
accept="image/png, image/jpeg, application/pdf"
|
||||||
|
disabled={!answers[question.questionId]}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user