Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
sagarika-padmanaban committed Aug 19, 2024
2 parents ca37b05 + 34d6d28 commit 9d3a65f
Show file tree
Hide file tree
Showing 19 changed files with 289 additions and 135 deletions.
11 changes: 8 additions & 3 deletions src/common/AddProjectMembers.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";

import { useSelector } from "react-redux";
//Components
import {
Button,
Expand Down Expand Up @@ -30,8 +30,13 @@ const AddProjectMembers = ({
handleSelectField,
managerNames,
}) => {
const acceptedManagers = managerNames.filter((manager) => manager.has_accepted_invite==true);

const alreadyExistingUsers = useSelector((state)=>state.
getProjectMembers.data);
console.log(alreadyExistingUsers);
const acceptedManagers = managerNames.filter((manager) =>manager.has_accepted_invite === true &&
!alreadyExistingUsers.some((user) => user.id === manager.id)
);
console.log(acceptedManagers)
const filterOptions = (options, state) => {
const newOptions = options.filter((user) => {
const { first_name, last_name, email } = user;
Expand Down
59 changes: 58 additions & 1 deletion src/common/CreateVideoDialog.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { Fragment, useEffect } from "react";
import React, { Fragment, useEffect, useState } from "react";
import { useDispatch, useSelector } from "react-redux";
import { MenuProps } from "utils";

Expand Down Expand Up @@ -78,6 +78,14 @@ const CreateVideoDialog = ({
(state) => state.getSupportedLanguages.transcriptionLanguage
);

const videosInProject = useSelector((state)=>state.getProjectVideoList.data)
const [showPopup, setShowPopup] = useState(false);
useEffect(() => {
if (videosInProject.some((video) => video.url === videoLink)) {
setShowPopup(true);
}
}, [videoLink, videosInProject]);

const handleClear = () => {
setLang("");
setVideoLink("");
Expand Down Expand Up @@ -241,6 +249,55 @@ const CreateVideoDialog = ({
onChange={(event) => setVideoLink(event.target.value)}
sx={{ mt: 3 }}
/>
{showPopup && (
<div
style={{
position: 'fixed',
top: 0,
left: 0,
right: 0,
bottom: 0,
backgroundColor: 'rgba(0,0,0,0.5)',
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
zIndex: 9999,
}}
>
<div
style={{
backgroundColor: 'white',
padding: '20px',
borderRadius: '8px',
textAlign: 'center',
position: 'relative',
minWidth: '300px',
}}
>
<p>This video already exists in the project. Do you want to upload it again?</p>
<Button
style={{ marginRight: "10px" }}
// className={classes.projectButton}
onClick={()=>setShowPopup(false)}
variant="contained"
>
Yes
</Button>

<Button
style={{ marginRight: "10px" }}
// className={classes.projectButton}
onClick={()=>{setShowPopup(false)
setVideoLink("")
}}
variant="contained"
>
No
</Button>
</div>
</div>
)}


<FormControl fullWidth sx={{ mt: 3 }}>
<InputLabel id="select-voice">Voice Selection</InputLabel>
Expand Down
15 changes: 15 additions & 0 deletions src/common/CustomMenuComponent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ const CustomMenuComponent = ({
setShowSubtitles,
showTimeline,
setShowTimeline,
useYtdlp,
setUseYtdlp,
}) => {
const player = useSelector((state) => state.commonReducer.player);

Expand Down Expand Up @@ -109,6 +111,19 @@ const CustomMenuComponent = ({
<input type="checkbox" checked={showTimeline} onChange={() => {setShowTimeline(!showTimeline)}}/>
</div>
</MenuItem>
<MenuItem key="Youtube Player">
<div
style={{
display: "flex",
alignItems: "center",
justifyContent: "space-between",
width: "100%",
}}
>
<span>Youtube Player</span>
<input type="checkbox" checked={!useYtdlp} onChange={() => {setUseYtdlp(!useYtdlp)}}/>
</div>
</MenuItem>
</Menu>

<Menu
Expand Down
6 changes: 3 additions & 3 deletions src/common/ExportDialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const ExportDialog = ({
PaperProps={{ style: { borderRadius: "10px" } }}
>
<DialogTitle variant="h4" display="flex" alignItems={"center"}>
<Typography variant="h4">Export Subtitles</Typography>{" "}
<Typography variant="h4">Export Voiceover</Typography>{" "}
<IconButton
aria-label="close"
onClick={handleClose}
Expand Down Expand Up @@ -172,7 +172,7 @@ const ExportDialog = ({
) : (
<></>
)}

{/*
{currentTaskType?.includes("VOICEOVER") && !isBulkTaskDownload && (
<>
<DialogContentText id="select-speaker-info" sx={{ mt: 2 }}>
Expand All @@ -196,7 +196,7 @@ const ExportDialog = ({
</FormControl>
</DialogActions>
</>
)}
)} */}

<DialogActions>
<Button
Expand Down
10 changes: 5 additions & 5 deletions src/common/TimeBoxes.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import React, { memo } from "react";
import { ProjectStyle } from "styles";
import { TextField } from "@mui/material";

const TimeBoxes = ({ handleTimeChange, time, index, type, readOnly }) => {
const TimeBoxes = ({ handleTimeChange, time, index, type, readOnly, player }) => {
const classes = ProjectStyle();

return (
<div style={{display: "flex", margin:"0"}}>
<TextField
variant="standard"
onChange={(event) =>
handleTimeChange(event.target.value, index, type, "hours")
handleTimeChange(event.target.value, index, type, "hours", player)
}
value={time.split(":")[0]}
onFocus={(event) => event.target.select()}
Expand All @@ -36,7 +36,7 @@ const TimeBoxes = ({ handleTimeChange, time, index, type, readOnly }) => {
onFocus={(event) => event.target.select()}
InputProps={{ inputProps: { min: 0, max: 100 }, readOnly:readOnly }}
onChange={(event) =>
handleTimeChange(event.target.value, index, type, "minutes")
handleTimeChange(event.target.value, index, type, "minutes", player)
}
/>

Expand All @@ -55,7 +55,7 @@ const TimeBoxes = ({ handleTimeChange, time, index, type, readOnly }) => {
InputProps={{ inputProps: { min: 0, max: 100 }, readOnly:readOnly }}
className={classes.timeInputBox}
onChange={(event) =>
handleTimeChange(event.target.value, index, type, "seconds")
handleTimeChange(event.target.value, index, type, "seconds", player)
}
// style={{

Expand All @@ -78,7 +78,7 @@ const TimeBoxes = ({ handleTimeChange, time, index, type, readOnly }) => {
InputProps={{ inputProps: { min: 0, max: 999 }, readOnly:readOnly }}
className={classes.timeInputBox}
onChange={(event) =>
handleTimeChange(event.target.value, index, type, "miliseconds")
handleTimeChange(event.target.value, index, type, "miliseconds", player)
}
/>
</div>
Expand Down
Loading

0 comments on commit 9d3a65f

Please sign in to comment.