Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
planner-team-one
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
21
Issues
21
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Евгений Положенцев
planner-team-one
Commits
8d4ab7da
Commit
8d4ab7da
authored
Dec 05, 2022
by
Евгений Положенцев
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'task-89-fix/DE_and_cosmetic_fix' into 'development'
Task 89 fix/de and cosmetic fix See merge request
!61
parents
d02f5e73
7aab4e6b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
86 additions
and
18 deletions
+86
-18
copyTasks.ts
planner-api/src/routers/copyTasks.ts
+5
-4
TableRowTask.js
...components/MyTasksCompoments/TableRowTask/TableRowTask.js
+69
-14
MyTasks.js
planner-front/src/containers/MyTasks/MyTasks.js
+12
-0
No files found.
planner-api/src/routers/copyTasks.ts
View file @
8d4ab7da
...
...
@@ -63,15 +63,16 @@ router.put("/change-copy", authAuthorOrExecutorOfTask, async(req:Request, res: R
})
/**delete copyTask by dateTimeTaskId */
router
.
delete
(
'/:id'
,
authAuthorOrExecutorOfTask
,
async
(
req
:
Request
,
res
:
Response
):
Promise
<
Response
>=>
{
const
{
id
}
=
req
.
params
router
.
delete
(
'/:dateTimeTaskId'
,
async
(
req
:
Request
,
res
:
Response
):
Promise
<
Response
>=>
{
// router.delete('/:dateTimeTaskId', authAuthorOrExecutorOfTask, async(req:Request, res:Response):Promise<Response>=>{
const
{
dateTimeTaskId
}
=
req
.
params
await
myDataSource
.
createQueryBuilder
()
.
delete
()
.
from
(
DateTimeTask
)
.
where
(
"id = :
id"
,
{
i
d
})
.
where
(
"id = :
dateTimeTaskId"
,
{
dateTimeTaskI
d
})
.
execute
()
return
res
.
send
({
message
:
"delete succesfully"
})
return
res
.
send
({
message
:
"
copyTask
delete succesfully"
})
}
)
...
...
planner-front/src/components/MyTasksCompoments/TableRowTask/TableRowTask.js
View file @
8d4ab7da
...
...
@@ -13,6 +13,7 @@ import {
}
from
"@mui/material"
;
import
{
Done
,
Edit
}
from
"@mui/icons-material"
;
import
RemoveIcon
from
'@mui/icons-material/Remove'
;
import
DeleteIcon
from
"@mui/icons-material/Delete"
;
import
moment
from
"moment"
;
import
CustomTableCell
from
"../CustomTableCell"
;
...
...
@@ -22,13 +23,15 @@ import CalendarMonthIcon from '@mui/icons-material/CalendarMonth';
import
KeyboardArrowDownIcon
from
'@mui/icons-material/KeyboardArrowDown'
;
import
KeyboardArrowUpIcon
from
'@mui/icons-material/KeyboardArrowUp'
;
const
weekDays
=
[
"Вс"
,
"Пн"
,
"Вт"
,
"Ср"
,
"Чт"
,
"Пт"
,
"Сб"
];
const
TableRowTask
=
({
user
,
task
,
deleteHandle
,
handleEditTask
,
deleteDateTimeTask
,
handleEditDateTimeTask
,
onChange
,
onModalOpen
,
onProjectChange
,
...
...
@@ -40,16 +43,21 @@ const TableRowTask= ({
})
=>
{
const
[
open
,
setOpen
]
=
React
.
useState
(
false
);
const
dateTimeTransform
=
(
dateIso
)
=>
{
const
event
=
new
Date
(
dateIso
);
return
event
.
toLocaleString
(
'ru-KZ'
,
{
timeZone
:
'UTC'
})
}
const
dateTransform
=
(
dateIso
)
=>
{
let
date
=
new
Date
(
dateIso
);
return
date
.
getDate
()
+
'-'
+
(
date
.
getMonth
()
+
1
)
+
'-'
+
date
.
getFullYear
().
toString
().
slice
(
-
2
);
const
roudHourUp
=
(
dateIso
)
=>
{
let
m
=
moment
(
dateIso
);
let
roundUp
=
m
.
minute
()
||
m
.
second
()
||
m
.
millisecond
()
?
m
.
add
(
1
,
'hour'
).
startOf
(
'hour'
)
:
m
.
startOf
(
'hour'
);
return
roundUp
}
const
timeTransform
=
(
dateIso
)
=>
{
return
moment
.
utc
(
dateIso
).
format
(
"HH:"
+
"00"
);
const
exp
=
roudHourUp
(
moment
.
utc
(
dateIso
)).
format
(
"HH:"
+
"00"
)
return
exp
;
}
const
getDayOfWeek
=
(
dateIso
)
=>
{
const
date
=
moment
.
utc
(
dateIso
);
return
weekDays
[
date
.
day
()];
}
return
(
...
...
@@ -298,23 +306,30 @@ const TableRowTask= ({
<
Typography
variant
=
"h6"
gutterBottom
component
=
"div"
>
Расписание
<
/Typography
>
<
Table
size
=
"small"
aria
-
label
=
"purchases"
>
<
Table
size
=
"small"
aria
-
label
=
"purchases"
sx
=
{{
backgroundColor
:
"#ebebeb"
}}
>
<
TableHead
>
<
TableRow
>
<
TableCell
colSpan
=
{
10
}
>
Дата
создания
события
<
/TableCell
>
<
TableCell
align
=
"right"
>
дд
-
мм
-
гг
<
/TableCell
>
<
TableCell
colSpan
=
{
10
}
>
Дата
создания
<
/TableCell
>
<
TableCell
align
=
"right"
>
День
недели
<
/TableCell
>
<
TableCell
align
=
"right"
>
Начало
<
/TableCell
>
<
TableCell
align
=
"center"
colSpan
=
{
1
}
>
Окончание
<
/TableCell
>
<
TableCell
align
=
"center"
><
/TableCell
>
<
TableCell
align
=
"center"
><
/TableCell
>
<
/TableRow
>
<
/TableHead
>
<
TableBody
>
{
task
.
dateTimeTasks
.
map
((
dateTimeTask
,
index
)
=>
(
<
TableRow
key
=
{
index
}
>
<
TableCell
component
=
"th"
scope
=
"row"
colSpan
=
{
10
}
>
{
dateTimeTransform
(
dateTimeTask
.
createdAt
)}
{
moment
(
task
.
createdAt
)
.
utc
()
.
format
(
"DD/MM"
)}
<
/TableCell
>
<
TableCell
align
=
"right"
>
{
dateTransform
(
dateTimeTask
.
dateTimeStart
)}
{
getDayOfWeek
(
dateTimeTask
.
dateTimeStart
)},
{
moment
(
dateTimeTask
.
dateTimeStart
)
.
utc
()
.
format
(
"DD/MM"
)}
<
/TableCell
>
<
TableCell
align
=
"right"
>
{
timeTransform
(
dateTimeTask
.
dateTimeStart
)}
...
...
@@ -322,6 +337,46 @@ const TableRowTask= ({
<
TableCell
align
=
"center"
colSpan
=
{
1
}
>
{
timeTransform
(
dateTimeTask
.
dateTimeDue
)}
<
/TableCell
>
{
/* Edit option datetimeTask */
}
<
TableCell
style
=
{{
width
:
'0%'
}}
>
<
Tooltip
title
=
"Редактировать Копию"
>
{
task
.
isEditMode
?
(
<
IconButton
aria
-
label
=
"done"
onClick
=
{()
=>
{
onToggleEditModeDone
(
dateTimeTask
.
id
);
handleEditDateTimeTask
(
dateTimeTask
);
}}
>
<
Done
/>
<
/IconButton
>
)
:
(
<
IconButton
aria
-
label
=
"edit"
onClick
=
{()
=>
onToggleEditMode
(
dateTimeTask
.
id
)}
>
<
Edit
/>
<
/IconButton
>
)}
<
/Tooltip
>
<
/TableCell
>
{
/* delete option datetimeTask */
}
{
task
.
author
.
id
===
user
.
id
?
(
<
TableCell
style
=
{{
width
:
'0%'
}}
>
<
Tooltip
title
=
"Удалить Копию"
>
<
IconButton
onClick
=
{(
id
)
=>
{
deleteDateTimeTask
(
dateTimeTask
.
id
);
}}
>
<
RemoveIcon
/>
<
/IconButton
>
<
/Tooltip
>
<
/TableCell>
)
:null
}
<
/TableRow
>
))}
<
/TableBody
>
...
...
planner-front/src/containers/MyTasks/MyTasks.js
View file @
8d4ab7da
...
...
@@ -162,6 +162,16 @@ useEffect(() => {
dispatch
(
deleteTask
(
id
));
};
const
deleteDateTimeTask
=
(
dateTImeTaskId
)
=>
{
console
.
log
(
'delete by dateTImeTaskId'
)
// dispatch(deleteDateTimeTask(dateTImeTaskId))
}
const
handleEditDateTimeTask
=
(
dateTimeTask
)
=>
{
console
.
log
(
'edit by dateTImeTask'
)
// dispatch(handleEditDateTimeTask(dateTimeTask))
}
const
onModalOpen
=
(
event
,
task
)
=>
{
event
.
stopPropagation
();
...
...
@@ -261,6 +271,8 @@ console.log('tasks', tasks)
task
=
{
task
}
deleteHandle
=
{
deleteHandle
}
handleEditTask
=
{
handleEditTask
}
handleEditDateTimeTask
=
{
handleEditDateTimeTask
}
deleteDateTimeTask
=
{
deleteDateTimeTask
}
onChange
=
{
onChange
}
onModalOpen
=
{
onModalOpen
}
onProjectChange
=
{
onProjectChange
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment