#123 setup filter from not defined title projects

parent 1ac76af3
...@@ -216,7 +216,6 @@ router.get('/my',auth, async (req: Request, res: Response):Promise<Response>=>{ ...@@ -216,7 +216,6 @@ router.get('/my',auth, async (req: Request, res: Response):Promise<Response>=>{
) )
const projectsList= projectsRawId.map(project=> {return project.id}) const projectsList= projectsRawId.map(project=> {return project.id})
const tasks = await dataSource const tasks = await dataSource
.getRepository(Task) .getRepository(Task)
.find( .find(
...@@ -229,6 +228,9 @@ router.get('/my',auth, async (req: Request, res: Response):Promise<Response>=>{ ...@@ -229,6 +228,9 @@ router.get('/my',auth, async (req: Request, res: Response):Promise<Response>=>{
executor:{ executor:{
id:user.id id:user.id
}, },
project:{
id:In(projectsList)
}
} }
} }
) )
......
...@@ -25,6 +25,15 @@ const CustomTableCell = ({ ...@@ -25,6 +25,15 @@ const CustomTableCell = ({
flexDirection: "column", flexDirection: "column",
fontSize: "12px", fontSize: "12px",
}; };
if (name==='dateTimeDeadLine'){
console.log('dateTimeDeadLine ', name, ' ', value)
}
const divTwoStyle = {
display: "flex",
flexDirection: "row",
fontSize: "12px",
};
const duration = moment.duration( const duration = moment.duration(
moment(task?.dateTimeTasks[0]?.dateTimeDue).diff( moment(task?.dateTimeTasks[0]?.dateTimeDue).diff(
...@@ -55,10 +64,17 @@ const CustomTableCell = ({ ...@@ -55,10 +64,17 @@ const CustomTableCell = ({
/> />
) : name !== "dateTimeStart" ? ( ) : name !== "dateTimeStart" ? (
<span>{value}</span> <span>{value}</span>
) : ( ) :name === "dateTimeDeadLine"&& value==='Invalid date' ?
<span>''</span>
:(
<div style={divStyle}> <div style={divStyle}>
<span>{value}</span> <div style={divTwoStyle}>
<span>{value2}</span> <span title={
moment(task.dateTimeTasks[0]?.dateTimeStart)
.utc()
.format("DD/MM/YY")}
>{value}</span> <span> &nbsp;</span>
<span>({value2})</span></div>
<span>часы:{hours}</span> <span>часы:{hours}</span>
</div> </div>
)} )}
......
...@@ -13,7 +13,7 @@ import { ...@@ -13,7 +13,7 @@ import {
} from "@mui/material"; } from "@mui/material";
import { useState } from "react"; import { useState } from "react";
import { useDispatch, useSelector } from "react-redux"; import { useDispatch, useSelector } from "react-redux";
import { AddBox } from "@mui/icons-material"; import { AddBox, Luggage } from "@mui/icons-material";
import moment from "moment"; import moment from "moment";
import CustomTableCell from "./CustomTableCell"; import CustomTableCell from "./CustomTableCell";
import MaterialUIPickers from "./DateTimePicker/DateTimePicker"; import MaterialUIPickers from "./DateTimePicker/DateTimePicker";
...@@ -39,8 +39,8 @@ export default function NewTaskForm({ projects, setAddTaskForm }) { ...@@ -39,8 +39,8 @@ export default function NewTaskForm({ projects, setAddTaskForm }) {
accomplish: "opened", accomplish: "opened",
priority: "B", priority: "B",
author: { id: user.id }, author: { id: user.id },
authorDisplayName: user.displayName, // authorDisplayName: user.displayName,
executors: [], executor:null,
isEditMode: true, isEditMode: true,
}); });
...@@ -71,6 +71,7 @@ export default function NewTaskForm({ projects, setAddTaskForm }) { ...@@ -71,6 +71,7 @@ export default function NewTaskForm({ projects, setAddTaskForm }) {
}; };
const onDateChange = (id, value, property) => { const onDateChange = (id, value, property) => {
console.log('value ', value, 'property ', property)
const newTask = { const newTask = {
...task, ...task,
[property]: moment.parseZone(value, "DD/MM/YYYY", true).format(), [property]: moment.parseZone(value, "DD/MM/YYYY", true).format(),
......
...@@ -197,13 +197,13 @@ const TableRowTask= ({ ...@@ -197,13 +197,13 @@ const TableRowTask= ({
name: "dateTimeStart", name: "dateTimeStart",
value: moment(task.dateTimeTasks[0]?.dateTimeStart) value: moment(task.dateTimeTasks[0]?.dateTimeStart)
.utc() .utc()
.format("DD-MM-YY "), .format("DD/MM "),
value2:moment(task.dateTimeTasks[0]?.dateTimeStart) value2:moment(task.dateTimeTasks[0]?.dateTimeStart)
.utc() .utc()
.format("kk:mm")+" - "+ .format("kk:00")+" - "+
moment(task.dateTimeTasks[0]?.dateTimeDue) moment(task.dateTimeTasks[0]?.dateTimeDue)
.utc() .utc()
.format("kk:mm"), .format("kk:00"),
user:user user:user
}}> }}>
</CustomTableCell> </CustomTableCell>
...@@ -228,7 +228,7 @@ const TableRowTask= ({ ...@@ -228,7 +228,7 @@ const TableRowTask= ({
value: moment(task.dateTimeDeadLine value: moment(task.dateTimeDeadLine
) )
.utc() .utc()
.format("DD-MM-YY kk:mm"), .format("DD/MM kk:mm"),
user:user user:user
}} }}
/> />
......
...@@ -211,7 +211,7 @@ export default function EnhancedTable() { ...@@ -211,7 +211,7 @@ export default function EnhancedTable() {
) : null} ) : null}
<TableContainer> <TableContainer>
<Table sx={{ minWidth: 600 }} aria-labelledby="tableTitle"> <Table sx={{ minWidth: 600 }} aria-labelledby="tableTitle" size='small'>
<EnhancedTableHead <EnhancedTableHead
order={order} order={order}
orderBy={orderBy} orderBy={orderBy}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment