From 9c34f0a0b50ada5693a7ebb36a1e62da915cec21 Mon Sep 17 00:00:00 2001 From: sagarika-padmanaban Date: Fri, 8 Sep 2023 20:56:38 +0530 Subject: [PATCH 01/10] resolved notes button colour issue --- .../AudioTranscriptionLandingPage.jsx | 12 ++++--- .../ReviewAudioTranscriptionLandingPage.jsx | 31 +++++++++++++------ ...erCheckerAudioTranscriptionLandingPage.jsx | 21 ++++++++++--- src/ui/pages/container/Label-Studio/LSF.jsx | 19 +++++++++--- .../container/Label-Studio/ReviewLSF.jsx | 27 ++++++++-------- .../Label-Studio/SuperCheckerLSF.jsx | 15 ++++++--- 6 files changed, 86 insertions(+), 39 deletions(-) diff --git a/src/ui/pages/container/CL-Transcription/AudioTranscriptionLandingPage.jsx b/src/ui/pages/container/CL-Transcription/AudioTranscriptionLandingPage.jsx index 95cae41c1..af5223c5b 100644 --- a/src/ui/pages/container/CL-Transcription/AudioTranscriptionLandingPage.jsx +++ b/src/ui/pages/container/CL-Transcription/AudioTranscriptionLandingPage.jsx @@ -67,6 +67,8 @@ const AudioTranscriptionLandingPage = () => { const [filterMessage, setFilterMessage] = useState(null); const [disableBtns, setDisableBtns] = useState(false); const [disableUpdataButton, setDisableUpdataButton] = useState(false); + const [annotationtext,setannotationtext] = useState('') + const [reviewtext,setreviewtext] = useState('') const[taskData,setTaskData] = useState("") const [snackbar, setSnackbarInfo] = useState({ open: false, @@ -568,13 +570,15 @@ const AudioTranscriptionLandingPage = () => { const newDelta1 = reviewNotesRef.current.value != "" ? JSON.parse(reviewNotesRef.current.value) : ""; annotationNotesRef.current.getEditor().setContents(newDelta2); reviewNotesRef.current.getEditor().setContents(newDelta1); + setannotationtext(annotationNotesRef.current.getEditor().getText()) + setreviewtext(reviewNotesRef.current.getEditor().getText()) } }, [AnnotationsTaskDetails]); const resetNotes = () => { setShowNotes(false); - annotationNotesRef.current.value = ""; - reviewNotesRef.current.value = ""; + annotationNotesRef.current.getEditor().setContents([]); + reviewNotesRef.current.getEditor().setContents([]); }; useEffect(() => { @@ -659,12 +663,12 @@ const AudioTranscriptionLandingPage = () => { endIcon={showNotes ? : } variant="contained" color={ - reviewNotesRef.current?.value !== "" ? "success" : "primary" + reviewtext.trim().length === 0 ? "primary" : "success" } onClick={handleCollapseClick} // style={{ marginBottom: "20px" }} > - Notes {reviewNotesRef.current?.value !== "" && "*"} + Notes {reviewtext.trim().length === 0 ? "" : "*"} diff --git a/src/ui/pages/container/CL-Transcription/ReviewAudioTranscriptionLandingPage.jsx b/src/ui/pages/container/CL-Transcription/ReviewAudioTranscriptionLandingPage.jsx index 8eff1bec0..8d2d0e1aa 100644 --- a/src/ui/pages/container/CL-Transcription/ReviewAudioTranscriptionLandingPage.jsx +++ b/src/ui/pages/container/CL-Transcription/ReviewAudioTranscriptionLandingPage.jsx @@ -90,7 +90,9 @@ const ReviewAudioTranscriptionLandingPage = () => { const annotationNotesRef = useRef(null); const reviewNotesRef = useRef(null); const superCheckerNotesRef = useRef(null); - + const [annotationtext,setannotationtext] = useState('') + const [reviewtext,setreviewtext] = useState('') + const [supercheckertext,setsupercheckertext] = useState('') // useEffect(() => { @@ -629,6 +631,9 @@ const ReviewAudioTranscriptionLandingPage = () => { annotationNotesRef.current.getEditor().setContents(newDelta2); reviewNotesRef.current.getEditor().setContents(newDelta1); superCheckerNotesRef.current.getEditor().setContents(newDelta3); + setannotationtext(annotationNotesRef.current.getEditor().getText()) + setreviewtext(reviewNotesRef.current.getEditor().getText()) + setsupercheckertext(superCheckerNotesRef.current.getEditor().getText()) } else { let reviewerAnnotations = annotations.filter( (annotation) => annotation.annotation_type === 2 @@ -653,6 +658,9 @@ const ReviewAudioTranscriptionLandingPage = () => { const newDelta3 = superCheckerNotesRef.current.value != "" ? JSON.parse(superCheckerNotesRef.current.value) : ""; annotationNotesRef.current.getEditor().setContents(newDelta2); superCheckerNotesRef.current.getEditor().setContents(newDelta3); + setannotationtext(annotationNotesRef.current.getEditor().getText()) + setreviewtext(reviewNotesRef.current.getEditor().getText()) + setsupercheckertext(superCheckerNotesRef.current.getEditor().getText()) } else { reviewNotesRef.current.value = reviewerAnnotations[0].review_notes ?? ""; @@ -672,6 +680,9 @@ const ReviewAudioTranscriptionLandingPage = () => { annotationNotesRef.current.getEditor().setContents(newDelta2); reviewNotesRef.current.getEditor().setContents(newDelta1); superCheckerNotesRef.current.getEditor().setContents(newDelta3); + setannotationtext(annotationNotesRef.current.getEditor().getText()) + setreviewtext(reviewNotesRef.current.getEditor().getText()) + setsupercheckertext(superCheckerNotesRef.current.getEditor().getText()) } } else { let normalAnnotation = annotations.find( @@ -688,6 +699,9 @@ const ReviewAudioTranscriptionLandingPage = () => { annotationNotesRef.current.getEditor().setContents(newDelta2); reviewNotesRef.current.getEditor().setContents(newDelta1); superCheckerNotesRef.current.getEditor().setContents(newDelta3); + setannotationtext(annotationNotesRef.current.getEditor().getText()) + setreviewtext(reviewNotesRef.current.getEditor().getText()) + setsupercheckertext(superCheckerNotesRef.current.getEditor().getText()) } } } @@ -700,7 +714,7 @@ const ReviewAudioTranscriptionLandingPage = () => { const resetNotes = () => { setShowNotes(false); - reviewNotesRef.current.value = ""; + reviewNotesRef.current.getEditor().setContents([]); }; @@ -784,16 +798,15 @@ const ReviewAudioTranscriptionLandingPage = () => { endIcon={showNotes ? : } variant="contained" color={ - annotationNotesRef.current?.value !== "" || - superCheckerNotesRef.current?.value !== "" - ? "success" - : "primary" + annotationtext.trim().length === 0 || supercheckertext.trim().length === 0 ? + + "primary" + : "success" } onClick={handleCollapseClick} > - Notes{" "} - {annotationNotesRef.current?.value !== "" || - (superCheckerNotesRef.current?.value !== "" && "*")} + Notes { annotationtext.trim().length === 0 || + (supercheckertext.trim().length === 0 ? "" : "*")}
{ const [showNotes, setShowNotes] = useState(false); const [annotations, setAnnotations] = useState([]); const [disableSkip, setdisableSkip] = useState(false); + const [reviewtext,setreviewtext] = useState(''); + const [supercheckertext,setsupercheckertext] = useState(''); const[taskDetailList,setTaskDetailList] = useState("") const [snackbar, setSnackbarInfo] = useState({ open: false, @@ -85,6 +87,7 @@ const SuperCheckerAudioTranscriptionLandingPage = () => { const timeSpentIntervalRef = useRef(null); const reviewNotesRef = useRef(null); const superCheckerNotesRef = useRef(null); + // useEffect(() => { @@ -539,6 +542,8 @@ const SuperCheckerAudioTranscriptionLandingPage = () => { const newDelta1 = reviewNotesRef.current.value != "" ? JSON.parse(reviewNotesRef.current.value) : ""; reviewNotesRef.current.getEditor().setContents(newDelta1); superCheckerNotesRef.current.getEditor().setContents(newDelta3); + setreviewtext(reviewNotesRef.current.getEditor().getText()) + setsupercheckertext(superCheckerNotesRef.current.getEditor().getText()) } else { let reviewerAnnotations = annotations.filter( (value) => value?.annotation_type === 2 @@ -560,6 +565,10 @@ const SuperCheckerAudioTranscriptionLandingPage = () => { const newDelta1 = reviewNotesRef.current.value != "" ? JSON.parse(reviewNotesRef.current.value) : ""; reviewNotesRef.current.getEditor().setContents(newDelta1); superCheckerNotesRef.current.getEditor().setContents(newDelta3); + setreviewtext(reviewNotesRef.current.getEditor().getText()) + setsupercheckertext(superCheckerNotesRef.current.getEditor().getText()) + + } else { let superCheckerAnnotation = annotations.find( (annotation) => @@ -573,6 +582,9 @@ const SuperCheckerAudioTranscriptionLandingPage = () => { const newDelta1 = reviewNotesRef.current.value != "" ? JSON.parse(reviewNotesRef.current.value) : ""; reviewNotesRef.current.getEditor().setContents(newDelta1); superCheckerNotesRef.current.getEditor().setContents(newDelta3); + setreviewtext(reviewNotesRef.current.getEditor().getText()) + setsupercheckertext(superCheckerNotesRef.current.getEditor().getText()) + } } } @@ -586,8 +598,9 @@ const SuperCheckerAudioTranscriptionLandingPage = () => { const resetNotes = () => { setShowNotes(false); - superCheckerNotesRef.current.value = ""; - reviewNotesRef.current.value = ""; + superCheckerNotesRef.current.getEditor().setContents([]); + reviewNotesRef.current.getEditor().setContents([]); + }; const modules = { toolbar: [ @@ -669,11 +682,11 @@ const SuperCheckerAudioTranscriptionLandingPage = () => { endIcon={showNotes ? : } variant="contained" color={ - reviewNotesRef.current?.value !== "" ? "success" : "primary" + reviewtext.trim().length === 0 ? "primary" : "success" } onClick={handleCollapseClick} > - Notes {reviewNotesRef.current?.value !== "" && "*"} + Notes { reviewtext.trim().length === 0 ? "" : "*"}
{ setShowNotes(false); - annotationNotesRef.current.value = ""; - reviewNotesRef.current.value = ""; + annotationNotesRef.current.getEditor().setContents([]); + reviewNotesRef.current.getEditor().setContents([]); }; useEffect(() => { @@ -1048,12 +1059,12 @@ export default function LSF() { endIcon={showNotes ? : } variant="contained" color={ - reviewNotesRef.current?.value !== "" ? "success" : "primary" + reviewtext.trim().length === 0 ? "primary" : "success" } onClick={handleCollapseClick} // style={{ marginBottom: "20px" }} > - Notes {reviewNotesRef.current?.value !== "" && "*"} + Notes{reviewtext.trim().length === 0 ? "" : "*"} )} diff --git a/src/ui/pages/container/Label-Studio/ReviewLSF.jsx b/src/ui/pages/container/Label-Studio/ReviewLSF.jsx index 6c4244bb3..2b162e646 100644 --- a/src/ui/pages/container/Label-Studio/ReviewLSF.jsx +++ b/src/ui/pages/container/Label-Studio/ReviewLSF.jsx @@ -686,11 +686,6 @@ const LabelStudioWrapper = ({ let normalAnnotation = annotations.find( (annotation) => annotation.annotation_type === 1 ); - // annotationNotesRef.current.value = - // normalAnnotation.annotation_notes ?? ""; - // reviewNotesRef.current.value = normalAnnotation.review_notes ?? ""; - // superCheckerNotesRef.current.value = - // normalAnnotation.supercheck_notes ?? ""; annotationNotesRef.current.value = normalAnnotation.annotation_notes ?? ""; superCheckerNotesRef.current.value = normalAnnotation.supercheck_notes ?? ""; reviewNotesRef.current.value = normalAnnotation.review_notes ?? ""; @@ -1145,6 +1140,9 @@ export default function LSF() { const annotationNotesRef = useRef(null); const reviewNotesRef = useRef(null); const superCheckerNotesRef = useRef(null); + const [annotationtext,setannotationtext] = useState('') + const [reviewtext,setreviewtext] = useState('') + const [supercheckertext,setsupercheckertext] = useState('') const { taskId } = useParams(); const [showTagsInput, setShowTagsInput] = useState(false); const [selectedTag, setSelectedTag] = useState(""); @@ -1175,7 +1173,6 @@ export default function LSF() { 'color', 'script'] - const [value, setvalue] = useState(); const handleTagChange = (event, value, reason) => { if (reason === "selectOption") { @@ -1204,13 +1201,15 @@ export default function LSF() { const handleCollapseClick = () => { setShowNotes(!showNotes); }; - +useEffect(()=>{setannotationtext(annotationNotesRef.current.getEditor().getText()) + setreviewtext(reviewNotesRef.current.getEditor().getText()) + setsupercheckertext(reviewNotesRef.current.getEditor().getText())},[]) const resetNotes = () => { setShowNotes(false); - reviewNotesRef.current.value = ""; + reviewNotesRef.current.getEditor().setContents([]); }; @@ -1262,16 +1261,16 @@ export default function LSF() { endIcon={showNotes ? : } variant="contained" color={ - annotationNotesRef.current?.value !== "" || - superCheckerNotesRef.current?.value !== "" - ? "success" - : "primary" + annotationtext.trim().length === 0 || + supercheckertext.trim().length === 0 + ? "primary" + : "success" } onClick={handleCollapseClick} > Notes{" "} - {annotationNotesRef.current?.value !== "" || - (superCheckerNotesRef.current?.value !== "" && "*")} + {annotationtext.trim().length === 0 || + (supercheckertext.trim().length === 0 ? "" : "*")} )}
{ + setreviewtext(reviewNotesRef.current.getEditor().getText()) + setsupercheckertext(reviewNotesRef.current.getEditor().getText())},[]) + + const navigate = useNavigate(); @@ -984,8 +991,8 @@ export default function LSF() { const resetNotes = () => { setShowNotes(false); - superCheckerNotesRef.current.value = ""; - reviewNotesRef.current.value = ""; + superCheckerNotesRef.current.getEditor().setContents([]); + reviewNotesRef.current.getEditor().setContents([]); }; useEffect(() => { @@ -1036,11 +1043,11 @@ export default function LSF() { endIcon={showNotes ? : } variant="contained" color={ - reviewNotesRef.current?.value !== "" ? "success" : "primary" + reviewtext.trim().length === 0 ? "primary" : "success" } onClick={handleCollapseClick} > - Notes {reviewNotesRef.current?.value !== "" && "*"} + Notes {reviewtext.trim().length === 0 ? "" : "*"} )}
Date: Mon, 11 Sep 2023 15:52:43 +0530 Subject: [PATCH 02/10] resolved bugs --- .../AudioTranscriptionLandingPage.jsx | 82 +++++++++++-------- 1 file changed, 46 insertions(+), 36 deletions(-) diff --git a/src/ui/pages/container/CL-Transcription/AudioTranscriptionLandingPage.jsx b/src/ui/pages/container/CL-Transcription/AudioTranscriptionLandingPage.jsx index d8f753b15..a05e53f0f 100644 --- a/src/ui/pages/container/CL-Transcription/AudioTranscriptionLandingPage.jsx +++ b/src/ui/pages/container/CL-Transcription/AudioTranscriptionLandingPage.jsx @@ -78,6 +78,8 @@ const AudioTranscriptionLandingPage = () => { const [filterMessage, setFilterMessage] = useState(null); const [disableBtns, setDisableBtns] = useState(false); const [disableUpdataButton, setDisableUpdataButton] = useState(false); + const [annotationtext,setannotationtext] = useState('') + const [reviewtext,setreviewtext] = useState('') const [taskData, setTaskData] = useState() const [snackbar, setSnackbarInfo] = useState({ open: false, @@ -278,35 +280,34 @@ const AudioTranscriptionLandingPage = () => { setLoading(false); }; - const handleAutosave = async () => { - const reqBody = { - task_id: taskId, - annotation_status: AnnotationsTaskDetails[0]?.annotation_status, - auto_save: true, - lead_time: - (new Date() - loadtime) / 1000 + Number(AnnotationsTaskDetails[0]?.lead_time?.lead_time ?? 0), - result: (stdTranscriptionSettings.enable ? [...result, { standardised_transcription: stdTranscription }] : result), - }; - if (result.length > 0 && taskDetails?.annotation_users?.some((users) => users === user.id)) { - const obj = new SaveTranscriptAPI(AnnotationsTaskDetails[0]?.id, reqBody); - // dispatch(APITransport(obj)); - const res = await fetch(obj.apiEndPoint(), { - method: "PATCH", - body: JSON.stringify(obj.getBody()), - headers: obj.getHeaders().headers, - }); - const resp = await res.json(); - if (!res.ok) { - setSnackbarInfo({ - open: true, - message: "Error in autosaving annotation", - variant: "error", + useEffect(() => { + const handleAutosave = async () => { + const reqBody = { + task_id: taskId, + annotation_status: AnnotationsTaskDetails[0]?.annotation_status, + auto_save: true, + lead_time: + (new Date() - loadtime) / 1000 + Number(AnnotationsTaskDetails[0]?.lead_time?.lead_time ?? 0), + result: (stdTranscriptionSettings.enable ? [...result, { standardised_transcription: stdTranscription }] : result), + }; + if (result.length > 0 && taskDetails?.annotation_users?.some((users) => users === user.id)) { + const obj = new SaveTranscriptAPI(AnnotationsTaskDetails[0]?.id, reqBody); + // dispatch(APITransport(obj)); + const res = await fetch(obj.apiEndPoint(), { + method: "PATCH", + body: JSON.stringify(obj.getBody()), + headers: obj.getHeaders().headers, }); + const resp = await res.json(); + if (!res.ok) { + setSnackbarInfo({ + open: true, + message: "Error in autosaving annotation", + variant: "error", + }); + } } - } - }; - - useEffect(() => { + }; const handleUpdateTimeSpent = (time = 60) => { // const apiObj = new UpdateTimeSpentPerTask(taskId, time); // dispatch(APITransport(apiObj)); @@ -438,6 +439,7 @@ const AudioTranscriptionLandingPage = () => { getAnnotationsTaskData(taskId); getProjectDetails(); getTaskData(taskId); + localStorage.setItem("enableChitrlekhaUI", true); }, []); const getProjectDetails = () => { @@ -451,13 +453,6 @@ const AudioTranscriptionLandingPage = () => { } }, [AnnotationsTaskDetails]); - useEffect(() => { - if(Object.keys(user).includes("prefer_cl_ui") && !(user.prefer_cl_ui) && ProjectDetails?.project_type.includes("AudioTranscription")) { - handleAutosave(); - navigate(`/projects/${projectId}/task/${taskId}`) - } - }, [user]); - const tasksComplete = (id) => { if (id) { // resetNotes(); @@ -588,13 +583,15 @@ const AudioTranscriptionLandingPage = () => { const newDelta1 = reviewNotesRef.current.value != "" ? JSON.parse(reviewNotesRef.current.value) : ""; annotationNotesRef.current.getEditor().setContents(newDelta2); reviewNotesRef.current.getEditor().setContents(newDelta1); + setannotationtext(annotationNotesRef.current.getEditor().getText()) + setreviewtext(reviewNotesRef.current.getEditor().getText()) } }, [AnnotationsTaskDetails]); const resetNotes = () => { setShowNotes(false); - annotationNotesRef.current.value = ""; - reviewNotesRef.current.value = ""; + annotationNotesRef.current.getEditor().setContents([]); + reviewNotesRef.current.getEditor().setContents([]); }; useEffect(() => { @@ -673,6 +670,19 @@ const AudioTranscriptionLandingPage = () => { AnnotationsTaskDetails={AnnotationsTaskDetails} taskData={taskData} /> + + + @@ -861,4 +848,4 @@ const AudioTranscriptionLandingPage = () => { ); }; -export default AudioTranscriptionLandingPage; +export default AudioTranscriptionLandingPage; \ No newline at end of file diff --git a/src/ui/pages/container/CL-Transcription/ReviewAudioTranscriptionLandingPage.jsx b/src/ui/pages/container/CL-Transcription/ReviewAudioTranscriptionLandingPage.jsx index 05725e42d..7f1ffcfe3 100644 --- a/src/ui/pages/container/CL-Transcription/ReviewAudioTranscriptionLandingPage.jsx +++ b/src/ui/pages/container/CL-Transcription/ReviewAudioTranscriptionLandingPage.jsx @@ -101,6 +101,9 @@ const ReviewAudioTranscriptionLandingPage = () => { const annotationNotesRef = useRef(null); const reviewNotesRef = useRef(null); const superCheckerNotesRef = useRef(null); + const [annotationtext,setannotationtext] = useState('') + const [reviewtext,setreviewtext] = useState('') + const [supercheckertext,setsupercheckertext] = useState('') @@ -654,6 +657,10 @@ const ReviewAudioTranscriptionLandingPage = () => { annotationNotesRef.current.getEditor().setContents(newDelta2); reviewNotesRef.current.getEditor().setContents(newDelta1); superCheckerNotesRef.current.getEditor().setContents(newDelta3); + setannotationtext(annotationNotesRef.current.getEditor().getText()) + setreviewtext(reviewNotesRef.current.getEditor().getText()) + setsupercheckertext(superCheckerNotesRef.current.getEditor().getText()) + } else { let reviewerAnnotations = annotations.filter( (annotation) => annotation.annotation_type === 2 @@ -678,6 +685,10 @@ const ReviewAudioTranscriptionLandingPage = () => { const newDelta3 = superCheckerNotesRef.current.value != "" ? JSON.parse(superCheckerNotesRef.current.value) : ""; annotationNotesRef.current.getEditor().setContents(newDelta2); superCheckerNotesRef.current.getEditor().setContents(newDelta3); + setannotationtext(annotationNotesRef.current.getEditor().getText()) + setreviewtext(reviewNotesRef.current.getEditor().getText()) + setsupercheckertext(superCheckerNotesRef.current.getEditor().getText()) + } else { reviewNotesRef.current.value = reviewerAnnotations[0].review_notes ?? ""; @@ -697,6 +708,10 @@ const ReviewAudioTranscriptionLandingPage = () => { annotationNotesRef.current.getEditor().setContents(newDelta2); reviewNotesRef.current.getEditor().setContents(newDelta1); superCheckerNotesRef.current.getEditor().setContents(newDelta3); + setannotationtext(annotationNotesRef.current.getEditor().getText()) + setreviewtext(reviewNotesRef.current.getEditor().getText()) + setsupercheckertext(superCheckerNotesRef.current.getEditor().getText()) + } } else { let normalAnnotation = annotations.find( @@ -713,6 +728,10 @@ const ReviewAudioTranscriptionLandingPage = () => { annotationNotesRef.current.getEditor().setContents(newDelta2); reviewNotesRef.current.getEditor().setContents(newDelta1); superCheckerNotesRef.current.getEditor().setContents(newDelta3); + setannotationtext(annotationNotesRef.current.getEditor().getText()) + setreviewtext(reviewNotesRef.current.getEditor().getText()) + setsupercheckertext(superCheckerNotesRef.current.getEditor().getText()) + } } } @@ -725,7 +744,7 @@ const ReviewAudioTranscriptionLandingPage = () => { const resetNotes = () => { setShowNotes(false); - reviewNotesRef.current.value = ""; + reviewNotesRef.current.getEditor().setContents([]); }; @@ -810,16 +829,15 @@ const ReviewAudioTranscriptionLandingPage = () => { endIcon={showNotes ? : } variant="contained" color={ - annotationNotesRef.current?.value !== "" || - superCheckerNotesRef.current?.value !== "" - ? "success" - : "primary" + annotationtext.trim().length === 0 || supercheckertext.trim().length === 0 ? + + "primary" + : "success" } onClick={handleCollapseClick} > - Notes{" "} - {annotationNotesRef.current?.value !== "" || - (superCheckerNotesRef.current?.value !== "" && "*")} + Notes{ annotationtext.trim().length === 0 || + (supercheckertext.trim().length === 0 ? "" : "*")} {/* diff --git a/src/ui/pages/container/CL-Transcription/SuperCheckerAudioTranscriptionLandingPage.jsx b/src/ui/pages/container/CL-Transcription/SuperCheckerAudioTranscriptionLandingPage.jsx index 729bf4561..8ca4525a7 100644 --- a/src/ui/pages/container/CL-Transcription/SuperCheckerAudioTranscriptionLandingPage.jsx +++ b/src/ui/pages/container/CL-Transcription/SuperCheckerAudioTranscriptionLandingPage.jsx @@ -565,6 +565,9 @@ const SuperCheckerAudioTranscriptionLandingPage = () => { const newDelta1 = reviewNotesRef.current.value != "" ? JSON.parse(reviewNotesRef.current.value) : ""; reviewNotesRef.current.getEditor().setContents(newDelta1); superCheckerNotesRef.current.getEditor().setContents(newDelta3); + setreviewtext(reviewNotesRef.current.getEditor().getText()) + setsupercheckertext(superCheckerNotesRef.current.getEditor().getText()) + } else { let reviewerAnnotations = annotations.filter( (value) => value?.annotation_type === 2 @@ -586,6 +589,9 @@ const SuperCheckerAudioTranscriptionLandingPage = () => { const newDelta1 = reviewNotesRef.current.value != "" ? JSON.parse(reviewNotesRef.current.value) : ""; reviewNotesRef.current.getEditor().setContents(newDelta1); superCheckerNotesRef.current.getEditor().setContents(newDelta3); + setreviewtext(reviewNotesRef.current.getEditor().getText()) + setsupercheckertext(superCheckerNotesRef.current.getEditor().getText()) + } else { let superCheckerAnnotation = annotations.find( (annotation) => @@ -599,6 +605,10 @@ const SuperCheckerAudioTranscriptionLandingPage = () => { const newDelta1 = reviewNotesRef.current.value != "" ? JSON.parse(reviewNotesRef.current.value) : ""; reviewNotesRef.current.getEditor().setContents(newDelta1); superCheckerNotesRef.current.getEditor().setContents(newDelta3); + setreviewtext(reviewNotesRef.current.getEditor().getText()) + setsupercheckertext(superCheckerNotesRef.current.getEditor().getText()) + + } } } @@ -612,9 +622,8 @@ const SuperCheckerAudioTranscriptionLandingPage = () => { const resetNotes = () => { setShowNotes(false); - superCheckerNotesRef.current.value = ""; - reviewNotesRef.current.value = ""; - }; + superCheckerNotesRef.current.getEditor().setContents([]); + reviewNotesRef.current.getEditor().setContents([]); }; const modules = { toolbar: [ @@ -696,11 +705,11 @@ const SuperCheckerAudioTranscriptionLandingPage = () => { endIcon={showNotes ? : } variant="contained" color={ - reviewNotesRef.current?.value !== "" ? "success" : "primary" + reviewtext.trim().length === 0 ? "primary" : "success" } onClick={handleCollapseClick} > - Notes {reviewNotesRef.current?.value !== "" && "*"} + Notes {reviewtext.trim().length === 0 ? "" : "*"} From 8b38ce33c6e81b9c1c5dfcd12fc962dc345f40e3 Mon Sep 17 00:00:00 2001 From: sagarika-padmanaban Date: Mon, 11 Sep 2023 19:27:52 +0530 Subject: [PATCH 04/10] resolved bugs --- .../CL-Transcription/AudioTranscriptionLandingPage.jsx | 2 +- .../CL-Transcription/ReviewAudioTranscriptionLandingPage.jsx | 2 +- .../SuperCheckerAudioTranscriptionLandingPage.jsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ui/pages/container/CL-Transcription/AudioTranscriptionLandingPage.jsx b/src/ui/pages/container/CL-Transcription/AudioTranscriptionLandingPage.jsx index e64919d69..5cfab6c9c 100644 --- a/src/ui/pages/container/CL-Transcription/AudioTranscriptionLandingPage.jsx +++ b/src/ui/pages/container/CL-Transcription/AudioTranscriptionLandingPage.jsx @@ -751,7 +751,7 @@ const AudioTranscriptionLandingPage = () => { display: showNotes ? "block" : "none", paddingBottom: "16px", overflow: "auto", - height: "max-content" + height: "178px" }} > { style={{ display: showNotes ? "block" : "none", paddingBottom: "16px", - height: "max-content", overflow: "auto" + height: "100px", overflow: "auto" }} > { display: showNotes ? "block" : "none", paddingBottom: "16px", overflow:"auto", - height:"max-content" + height:"178px" }} > {/* From 36bddc36a6cd231a5bf5e715b294395c96a84c2d Mon Sep 17 00:00:00 2001 From: sagarika-padmanaban Date: Mon, 11 Sep 2023 19:52:56 +0530 Subject: [PATCH 05/10] resolved bugs --- .../AudioTranscriptionLandingPage.jsx | 406 +++++++++--------- .../ReviewAudioTranscriptionLandingPage.jsx | 2 +- ...erCheckerAudioTranscriptionLandingPage.jsx | 26 +- 3 files changed, 200 insertions(+), 234 deletions(-) diff --git a/src/ui/pages/container/CL-Transcription/AudioTranscriptionLandingPage.jsx b/src/ui/pages/container/CL-Transcription/AudioTranscriptionLandingPage.jsx index a1a408f8a..d3f19cd00 100644 --- a/src/ui/pages/container/CL-Transcription/AudioTranscriptionLandingPage.jsx +++ b/src/ui/pages/container/CL-Transcription/AudioTranscriptionLandingPage.jsx @@ -78,13 +78,9 @@ const AudioTranscriptionLandingPage = () => { const [filterMessage, setFilterMessage] = useState(null); const [disableBtns, setDisableBtns] = useState(false); const [disableUpdataButton, setDisableUpdataButton] = useState(false); -<<<<<<< HEAD const [annotationtext,setannotationtext] = useState('') const [reviewtext,setreviewtext] = useState('') const[taskData,setTaskData] = useState("") -======= - const [taskData, setTaskData] = useState() ->>>>>>> develop const [snackbar, setSnackbarInfo] = useState({ open: false, message: "", @@ -633,50 +629,49 @@ const AudioTranscriptionLandingPage = () => { return ( <> - {loading && } - {renderSnackBar()} - - - - - - -<<<<<<< HEAD - - + {loading && } + {renderSnackBar()} + + + + + + + + -======= - + + + {/*
+ setNotesValue(event.target.value)} + inputRef={annotationNotesRef} + rows={1} + maxRows={3} + inputProps={{ + style: { fontSize: "1rem" }, + }} + style={{ width: "99%" }} + // ref={quillRef} + /> */} + + {/* setNotesValue(event.target.value)} + inputRef={reviewNotesRef} + rows={1} + maxRows={3} + inputProps={{ + style: { fontSize: "1rem" }, + readOnly: true, + }} + style={{ width: "99%", marginTop: "1%" }} + // ref={quillRef} + /> + +
*/} +
+ {stdTranscriptionSettings.enable && ->>>>>>> develop - - - {/*
- setNotesValue(event.target.value)} - inputRef={annotationNotesRef} - rows={1} - maxRows={3} - inputProps={{ - style: { fontSize: "1rem" }, + } + +
+ + +
+
+ {stdTranscriptionSettings.enableTransliteration ? ( + { + setStdTranscription(e.target.value); }} - style={{ width: "99%" }} - // ref={quillRef} - /> */} - - {/* setNotesValue(event.target.value)} - inputRef={reviewNotesRef} - rows={1} - maxRows={3} - inputProps={{ - style: { fontSize: "1rem" }, - readOnly: true, + onChangeText={() => { }} + enabled={stdTranscriptionSettings.enableTransliterationSuggestion} + containerStyles={{ + width: "100%", }} - style={{ width: "99%", marginTop: "1%" }} - // ref={quillRef} - /> - -
*/} - - {stdTranscriptionSettings.enable && - - - } - -
- - -
-
- {stdTranscriptionSettings.enableTransliteration ? ( - ( +
+