Skip to content

Commit

Permalink
Merge branch 'develop' into Rahul-539
Browse files Browse the repository at this point in the history
  • Loading branch information
ishvindersethi22 authored May 31, 2024
2 parents b50cfb9 + 23de764 commit 63eb0c2
Show file tree
Hide file tree
Showing 8 changed files with 1,101 additions and 33 deletions.
5 changes: 3 additions & 2 deletions src/ui/Layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const Layout= (props) => {
const [popUp, setPopup] = useState(true);
const apiStatus = useSelector((state) => state.apiStatus);
const location = useLocation();
const projectType = useSelector((state) => state.getProjectDetails.data?.project_type);

const classes = GlobalStyles();
// const history = useHistory();
Expand Down Expand Up @@ -93,7 +94,7 @@ const Layout= (props) => {
return (
<ThemeProvider theme={themeDefault}>
<div
className={location.pathname.includes("AudioTranscriptionLandingPage") ? classes.Audioroot : classes.root}
className={location.pathname.includes("AudioTranscriptionLandingPage") || projectType==="StandardizedTranscriptionEditing" ? classes.Audioroot : classes.root}
>
<Suspense fallback={<div>Loading....</div>}>
<Header
Expand All @@ -103,7 +104,7 @@ const Layout= (props) => {
/>
</Suspense>
<div
className={location.pathname.includes("AudioTranscriptionLandingPage") ? classes.Audiocontainer : classes.container}
className={location.pathname.includes("AudioTranscriptionLandingPage") || projectType=="StandardizedTranscriptionEditing" ? classes.Audiocontainer : classes.container}
>
{/* {renderSpinner()}
{renderError()} */}
Expand Down
18 changes: 18 additions & 0 deletions src/ui/pages/component/common/InviteUsersDialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,14 @@ const InviteUsersDialog = ({
placeholder="Email ids"
defaultValue=" "
value={selectedEmails.join(",")}
sx={{
'& .MuiInputLabel-root': {
fontSize: '0.93rem',
},
minWidth: "350px",
maxWidth: "450px"

}}
/>
)
}
Expand Down Expand Up @@ -152,6 +160,16 @@ const InviteUsersDialog = ({
variant="outlined"
label="Enter email ids of users to invite"
placeholder="Email ids"
sx={{
'& .MuiInputLabel-root': {
fontSize: '0.93rem',
zIndex: 100,
},
minWidth: "350px",
maxWidth: "450px"

}}


/>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import ArrowRightIcon from "@mui/icons-material/ArrowRight";
import ArrowBackIcon from "@mui/icons-material/ArrowBack";
import getTaskAssignedUsers from '../../../../utils/getTaskAssignedUsers';
import LightTooltip from "../../component/common/Tooltip";
import StandarisedisedTranscriptionEditing from './StandardizedTranscription';

const AllAudioTranscriptionLandingPage = () => {
const classes = AudioTranscriptionLandingStyle();
Expand Down Expand Up @@ -123,16 +124,16 @@ const AllAudioTranscriptionLandingPage = () => {
};

useEffect(() => {
let standardisedTranscription = "";
let standardizedTranscription = "";

const sub = annotations[0]?.result.filter((item) => {
if ("standardised_transcription" in item) {
standardisedTranscription = item.standardised_transcription;
if ("standardized_transcription" in item) {
standardizedTranscription = item.standardized_transcription;
return false;
} else return true;
}).map((item) => new Sub(item));

setStdTranscription(standardisedTranscription);
setStdTranscription(standardizedTranscription);
dispatch(setSubtitles(sub, C.SUBTITLES));
}, [annotations]);

Expand Down Expand Up @@ -539,7 +540,7 @@ const AllAudioTranscriptionLandingPage = () => {
setShowNotes(false);
}}
>
Standardised Transcription
Standardized Transcription
</Button>
</Grid>}
</Grid>
Expand Down Expand Up @@ -682,6 +683,26 @@ const AllAudioTranscriptionLandingPage = () => {
</Grid>

<Grid md={6} xs={12} sx={{ width: "100%" }}>

{ProjectDetails && ProjectDetails?.data?.project_type === "StandardizedTranscriptionEditing" ?
<>
<StandarisedisedTranscriptionEditing
currentIndex={currentIndex}
AnnotationsTaskDetails={AnnotationsTaskDetails}
player={player}
ProjectDetails={ProjectDetails}
TaskDetails={taskData}
// stage={2}
handleStdTranscriptionSettings={setStdTranscriptionSettings}
advancedWaveformSettings={advancedWaveformSettings}
setAdvancedWaveformSettings={setAdvancedWaveformSettings}
waveSurfer={waveSurfer}
setWaveSurfer={setWaveSurfer}
annotationId={annotations[0]?.id}
/>
</>
:
<>
<TranscriptionRightPanel
currentIndex={currentIndex}
AnnotationsTaskDetails={AnnotationsTaskDetails}
Expand All @@ -696,6 +717,9 @@ const AllAudioTranscriptionLandingPage = () => {
setWaveSurfer={setWaveSurfer}
annotationId={annotations[0]?.id}
/>
</>
}

</Grid>
</Grid>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import LSF from "../Label-Studio/LSF";
import AudioTranscriptionLandingPage from "./AudioTranscriptionLandingPage";
import { useSelector } from "react-redux";
import { useEffect } from "react";
import { useParams } from "react-router-dom";
import GetProjectDetailsAPI from "../../../../redux/actions/api/ProjectDetails/GetProjectDetails";
import APITransport from "../../../../redux/actions/apitransport/apitransport";
import { useDispatch } from "react-redux";
import { Padding } from "@mui/icons-material";

const AnnotationTranscription = () => {
const ProjectDetails = useSelector((state) => state.getProjectDetails.data);
const { projectId, taskId } = useParams();
const dispatch = useDispatch();

const getProjectDetails = () => {
const projectObj = new GetProjectDetailsAPI(projectId);
dispatch(APITransport(projectObj));
};
useEffect(() => {
getProjectDetails();
}, []);

if (ProjectDetails) {
console.log("project", ProjectDetails);
}
return (
<div style={{ margin: 0, padding: 0 }}>
{ProjectDetails?.project_type === "StandardizedTranscriptionEditing" ? (
<AudioTranscriptionLandingPage />
) : (
<LSF />
)}
</div>
);
};

export default AnnotationTranscription;
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ import ArrowRightIcon from "@mui/icons-material/ArrowRight";
import ArrowBackIcon from "@mui/icons-material/ArrowBack";
import getTaskAssignedUsers from '../../../../utils/getTaskAssignedUsers';
import LightTooltip from "../../component/common/Tooltip"
import StandarisedisedTranscriptionEditing from './StandardizedTranscription';
import { Tab, Tabs } from "@mui/material";
import FormControl from "@mui/material/FormControl";


const ReviewAudioTranscriptionLandingPage = () => {
const classes = AudioTranscriptionLandingStyle();
Expand Down Expand Up @@ -116,7 +120,6 @@ const ReviewAudioTranscriptionLandingPage = () => {
const [autoSave, setAutoSave] = useState(true);
const [waveSurfer, setWaveSurfer] = useState(true);
const [autoSaveTrigger, setAutoSaveTrigger] = useState(false);

// useEffect(() => {
// let intervalId;

Expand Down Expand Up @@ -282,6 +285,12 @@ const ReviewAudioTranscriptionLandingPage = () => {
setShowNotes(!showNotes);
};

const [tabValue, setTabValue] = useState(0);
const handleTabChange = (e, v) => {
e.preventDefault()
setTabValue(v);
}

const getTaskData = async (id) => {
setLoading(true);
const ProjectObj = new GetTaskDetailsAPI(id);
Expand Down Expand Up @@ -327,7 +336,7 @@ const ReviewAudioTranscriptionLandingPage = () => {
auto_save: true,
lead_time:
(new Date() - loadtime) / 1000 + Number(currentAnnotation?.lead_time ?? 0),
result: (stdTranscriptionSettings.enable ? [...result, { standardised_transcription: stdTranscription }] : result),
result: (stdTranscriptionSettings.enable ? [...result, { standardized_transcription: stdTranscription }] : result),
};
if(result.length && taskDetails?.review_user === user.id) {
try{
Expand Down Expand Up @@ -473,17 +482,17 @@ const ReviewAudioTranscriptionLandingPage = () => {

useEffect(() => {

let standardisedTranscription = "";
let standardizedTranscription = "";

const sub = annotations[0]?.result?.filter((item) => {
if ("standardised_transcription" in item) {
standardisedTranscription = item.standardised_transcription;
if ("standardized_transcription" in item) {
standardizedTranscription = item.standardized_transcription;
return false;
} else return true;
}).map((item) => new Sub(item));
dispatch(setSubtitles(sub, C.SUBTITLES));

setStdTranscription(standardisedTranscription);
setStdTranscription(standardizedTranscription);

// const newSub = cloneDeep(sub);

Expand Down Expand Up @@ -627,7 +636,7 @@ const ReviewAudioTranscriptionLandingPage = () => {
review_notes: JSON.stringify(reviewNotesRef.current.getEditor().getContents()),
lead_time:
(new Date() - loadtime) / 1000 + Number(lead_time?.lead_time ?? 0),
result: (stdTranscriptionSettings.enable ? [...result, { standardised_transcription: stdTranscription }] : result),
result: (stdTranscriptionSettings.enable ? [...result, { standardized_transcription: stdTranscription }] : result),
...((value === "to_be_revised" || value === "accepted" ||
value === "accepted_with_minor_changes" ||
value === "accepted_with_major_changes") && {
Expand Down Expand Up @@ -1255,7 +1264,7 @@ useEffect(() => {
}}
// style={{ marginBottom: "20px" }}
>
Standardised Transcription
Standardized Transcription
</Button>
</Grid>}
</Grid>
Expand Down Expand Up @@ -1409,20 +1418,29 @@ useEffect(() => {
</Grid>

<Grid md={6} xs={12} sx={{ width: "100%" }}>
<TranscriptionRightPanel
currentIndex={currentIndex}
AnnotationsTaskDetails={AnnotationsTaskDetails}
player={player}
ProjectDetails={ProjectDetails}
TaskDetails={taskDetailList}
stage={2}
handleStdTranscriptionSettings={setStdTranscriptionSettings}
advancedWaveformSettings={advancedWaveformSettings}
setAdvancedWaveformSettings={setAdvancedWaveformSettings}
waveSurfer={waveSurfer}
setWaveSurfer={setWaveSurfer}
annotationId={annotations[0]?.id}
/>
<FormControl>
<Box sx={{mb:2,}} >
<Tabs value={tabValue} onChange={handleTabChange} aria-label="user-tabs">
<Tab label="L1 & L2 Transcription" sx={{ fontSize: 17, fontWeight: '700', marginRight: '28px !important' }} />
<Tab label="L3 Transcription" sx={{ fontSize: 17, fontWeight: '700' }} />
</Tabs>
</Box>
</FormControl>

<StandarisedisedTranscriptionEditing
currentIndex={currentIndex}
AnnotationsTaskDetails={AnnotationsTaskDetails}
player={player}
ProjectDetails={ProjectDetails}
TaskDetails={taskDetailList}
stage={tabValue+2}
handleStdTranscriptionSettings={setStdTranscriptionSettings}
advancedWaveformSettings={advancedWaveformSettings}
setAdvancedWaveformSettings={setAdvancedWaveformSettings}
waveSurfer={waveSurfer}
setWaveSurfer={setWaveSurfer}
annotationId={annotations[0]?.id}
/>
</Grid>
</Grid>

Expand Down
Loading

0 comments on commit 63eb0c2

Please sign in to comment.