Skip to content

Commit

Permalink
Merge pull request #815 from AI4Bharat/dev3-s
Browse files Browse the repository at this point in the history
fixes
  • Loading branch information
aparna-aa authored Sep 4, 2024
2 parents 0be6af0 + 53e02c9 commit 625826b
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions src/common/CreateTaskDialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,13 @@ const[langLabel,setlabel] =useState("")
const [user, setUser] = useState("");
const [language, setLanguage] = useState("");
const [priority, setPriority] = useState("");
const [membersToShow,setmembersToShow]=useState();
const [date, setDate] = useState(moment().format());
const [allowedTaskType, setAllowedTaskType] = useState("");
const [showAllowedTaskList, setShowAllowedTaskList] = useState(false);
const [showLimitWarning, setShowLimitWarning] = useState(false);
const [showPopup, setShowPopup] = useState(false);

const filteredMembers = projectMembers.filter((member) =>
member.languages.includes(langLabel)
);
Expand All @@ -92,14 +94,18 @@ const[langLabel,setlabel] =useState("")
// eslint-disable-next-line
}, []);
useEffect(() => {
console.log(filteredMembers.length,videoDetails)
console.log(filteredMembers,videoDetails,taskType,langLabel,sourceLangMembers,projectMembers)
if (!taskType.includes("TRANSCRIPTION")&&filteredMembers.length === 0) {
setShowPopup(true);
}
else{
setShowPopup(false)
}
}, [filteredMembers]);
useEffect(()=>{
setmembersToShow(taskType=="TRANSCRIPTION" ? sourceLangMembers : filteredMembers);

},[langLabel,taskType])

useEffect(() => {
if (taskType.length && !taskType.includes("TRANSCRIPTION")) {
Expand Down Expand Up @@ -188,13 +194,13 @@ const[langLabel,setlabel] =useState("")
const selectAllowedTaskHandler = (value) => {
setAllowedTaskType(value);

const obj = new FetchProjectMembersAPI(
projectId,
value,
videoDetails.id,
language
);
dispatch(APITransport(obj));
// const obj = new FetchProjectMembersAPI(
// projectId,
// value,
// videoDetails.id,
// language
// );
// dispatch(APITransport(obj));
};

const disableBtn = () => {
Expand Down Expand Up @@ -387,11 +393,7 @@ const[langLabel,setlabel] =useState("")
inputProps={{ "aria-label": "Without label" }}
disabled={isAssignUserDropdownDisabled()}
>
{langLabel?filteredMembers.map((item, index) => (
<MenuItem key={index} value={item}>
{`${item.first_name} ${item.last_name} (${item.email})`}
</MenuItem>
)):sourceLangMembers.map((item, index) => (
{membersToShow?.map((item, index) => (
<MenuItem key={index} value={item}>
{`${item.first_name} ${item.last_name} (${item.email})`}
</MenuItem>
Expand Down

0 comments on commit 625826b

Please sign in to comment.