Skip to content

Commit

Permalink
Merge pull request #687 from AI4Bharat/SN-826
Browse files Browse the repository at this point in the history
SN-826: acoustic_text population changes
  • Loading branch information
ishvindersethi22 authored Sep 6, 2023
2 parents e912af1 + e5e7674 commit c5706ee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ const TranscriptionRightPanel = ({
const startIndex = (page - 1) * itemsPerPage;
const endIndex = startIndex + itemsPerPage;
const currentPageData = subtitles?.slice(startIndex, endIndex);
const showAcousticText = ProjectDetails?.project_type === "AcousticNormalisedTranscription" && ProjectDetails?.metadata_json?.acoustic_enabled_stage >= stage;
const showAcousticText = ProjectDetails?.project_type === "AcousticNormalisedTranscription" && ProjectDetails?.metadata_json?.acoustic_enabled_stage <= stage;
const [snackbar, setSnackbarInfo] = useState({
open: false,
message: "",
Expand Down Expand Up @@ -567,7 +567,6 @@ const TranscriptionRightPanel = ({
setTimeout(() => {
setShowPopOver(false);
}, 200);
showAcousticText && populateAcoustic(index);
}}
renderComponent={(props) => (
<div className={classes.relative} style={{ width: "100%" }}>
Expand All @@ -581,7 +580,6 @@ const TranscriptionRightPanel = ({
setTimeout(() => {
setShowPopOver(false);
}, 200);
showAcousticText && populateAcoustic(index);
}}
style={{ fontSize: fontSize, height: "120px" }}
{...props}
Expand Down Expand Up @@ -613,7 +611,6 @@ const TranscriptionRightPanel = ({
setTimeout(() => {
setShowPopOver(false);
}, 200);
showAcousticText && populateAcoustic(index);
}}
/>
{/* <span id="charNum" className={classes.wordCount}>
Expand Down Expand Up @@ -642,6 +639,7 @@ const TranscriptionRightPanel = ({
}`}
dir={enableRTL_Typing ? "rtl" : "ltr"}
rows={4}
onFocus={() => showAcousticText && populateAcoustic(index)}
style={{ fontSize: fontSize, height: "120px" }}
{...props}
/>
Expand All @@ -654,7 +652,7 @@ const TranscriptionRightPanel = ({
onChange={(event) => {
changeTranscriptHandler(event, index, true);
}}

onFocus={() => showAcousticText && populateAcoustic(index)}
value={item.acoustic_normalised_text}
dir={enableRTL_Typing ? "rtl" : "ltr"}
className={`${classes.customTextarea} ${currentIndex === index ? classes.boxHighlight : ""
Expand Down
2 changes: 1 addition & 1 deletion src/utils/SubTitlesUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ export const onSubtitleChange = (text, index, updateAcoustic, populateAcoustic)
if (updateAcoustic)
sub.acoustic_normalised_text = text;
else if (populateAcoustic) {
sub.acoustic_normalised_text = sub.text;
if (!sub.acoustic_normalised_text) sub.acoustic_normalised_text = sub.text;
}
else sub.text = text;

Expand Down

0 comments on commit c5706ee

Please sign in to comment.