From d275d2385af645a38e0b718a63ecd55899ba04dc Mon Sep 17 00:00:00 2001 From: Ayush Panwar Date: Wed, 13 Sep 2023 13:43:46 +0530 Subject: [PATCH] empty acoustic_text validation --- .../CL-Transcription/AudioTranscriptionLandingPage.jsx | 3 ++- .../ReviewAudioTranscriptionLandingPage.jsx | 3 ++- .../SuperCheckerAudioTranscriptionLandingPage.jsx | 3 ++- .../CL-Transcription/TranscriptionRightPanel.jsx | 9 +++++---- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/ui/pages/container/CL-Transcription/AudioTranscriptionLandingPage.jsx b/src/ui/pages/container/CL-Transcription/AudioTranscriptionLandingPage.jsx index 6a80e7dc0..ce42ada3b 100644 --- a/src/ui/pages/container/CL-Transcription/AudioTranscriptionLandingPage.jsx +++ b/src/ui/pages/container/CL-Transcription/AudioTranscriptionLandingPage.jsx @@ -68,6 +68,7 @@ const AudioTranscriptionLandingPage = () => { const [showStdTranscript, setShowStdTranscript] = useState(false); const [stdTranscriptionSettings, setStdTranscriptionSettings] = useState({ enable: false, + showAcoustic: false, rtl: false, enableTransliteration: false, enableTransliterationSuggestion: false, @@ -243,7 +244,7 @@ const AudioTranscriptionLandingPage = () => { useEffect(() => { - const hasEmptyText = result?.some((element) => element.text?.trim() === ""); + const hasEmptyText = result?.some((element) => element.text?.trim() === "") || (stdTranscriptionSettings.showAcoustic && result?.some((element) => element.acoustic_normalised_text?.trim() === "")) const hasEmptySpeaker = result?.some( (element) => element.speaker_id?.trim() === "" ); diff --git a/src/ui/pages/container/CL-Transcription/ReviewAudioTranscriptionLandingPage.jsx b/src/ui/pages/container/CL-Transcription/ReviewAudioTranscriptionLandingPage.jsx index 998fa6883..239058fba 100644 --- a/src/ui/pages/container/CL-Transcription/ReviewAudioTranscriptionLandingPage.jsx +++ b/src/ui/pages/container/CL-Transcription/ReviewAudioTranscriptionLandingPage.jsx @@ -70,6 +70,7 @@ const ReviewAudioTranscriptionLandingPage = () => { const [showStdTranscript, setShowStdTranscript] = useState(false); const [stdTranscriptionSettings, setStdTranscriptionSettings] = useState({ enable: false, + showAcoustic: false, rtl: false, enableTransliteration: false, enableTransliterationSuggestion: false, @@ -257,7 +258,7 @@ const ReviewAudioTranscriptionLandingPage = () => { }, [AnnotationsTaskDetails, user, taskDetailList]); useEffect(() => { - const hasEmptyText = result?.some((element) => element.text?.trim() === ""); + const hasEmptyText = result?.some((element) => element.text?.trim() === "") || (stdTranscriptionSettings.showAcoustic && result?.some((element) => element.acoustic_normalised_text?.trim() === "")) const hasEmptySpeaker = result?.some( (element) => element.speaker_id?.trim() === "" ); diff --git a/src/ui/pages/container/CL-Transcription/SuperCheckerAudioTranscriptionLandingPage.jsx b/src/ui/pages/container/CL-Transcription/SuperCheckerAudioTranscriptionLandingPage.jsx index 3886b3ae4..4be081ed3 100644 --- a/src/ui/pages/container/CL-Transcription/SuperCheckerAudioTranscriptionLandingPage.jsx +++ b/src/ui/pages/container/CL-Transcription/SuperCheckerAudioTranscriptionLandingPage.jsx @@ -64,6 +64,7 @@ const SuperCheckerAudioTranscriptionLandingPage = () => { const [showStdTranscript, setShowStdTranscript] = useState(false); const [stdTranscriptionSettings, setStdTranscriptionSettings] = useState({ enable: false, + showAcoustic: false, rtl: false, enableTransliteration: false, enableTransliterationSuggestion: false, @@ -176,7 +177,7 @@ const SuperCheckerAudioTranscriptionLandingPage = () => { useEffect(() => { - const hasEmptyText = result?.some((element) => element.text?.trim() === ""); + const hasEmptyText = result?.some((element) => element.text?.trim() === "") || (stdTranscriptionSettings.showAcoustic && result?.some((element) => element.acoustic_normalised_text?.trim() === "")) const hasEmptySpeaker = result?.some( (element) => element.speaker_id?.trim() === "" ); diff --git a/src/ui/pages/container/CL-Transcription/TranscriptionRightPanel.jsx b/src/ui/pages/container/CL-Transcription/TranscriptionRightPanel.jsx index 793026be1..9f9946618 100644 --- a/src/ui/pages/container/CL-Transcription/TranscriptionRightPanel.jsx +++ b/src/ui/pages/container/CL-Transcription/TranscriptionRightPanel.jsx @@ -179,11 +179,12 @@ const TranscriptionRightPanel = ({ } }, [currentIndex]); - //Uncomment this block to enable standardised_transcription in future - /* useEffect(() => { + useEffect(() => { if(showAcousticText) { handleStdTranscriptionSettings({ - enable: true, + //set enable:true to enable standardised_transcription + enable: false, + showAcoustic: true, rtl: enableRTL_Typing, enableTransliteration: ProjectDetails?.tgt_language !== "en" && enableTransliteration, enableTransliterationSuggestion, @@ -192,7 +193,7 @@ const TranscriptionRightPanel = ({ }); } }, [showAcousticText, ProjectDetails, enableRTL_Typing, enableTransliteration, enableTransliterationSuggestion, targetlang, fontSize]); - */ + const getPayload = (offset = currentOffset, lim = limit) => { const payloadObj = new GetAnnotationsTaskAPI(