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
cae1eab3
Commit
cae1eab3
authored
Jan 13, 2023
by
Ermolaev Timur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#149
Добавил валидации для полей если ты не автор
parent
fe5adeb6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
65 additions
and
56 deletions
+65
-56
EditRow.js
...iner/UsersTasksTableBody/UsersTasksRow/EditRow/EditRow.js
+65
-56
No files found.
planner-front/src/components/UsersTasksCompoments/UsersTasksTableContainer/UsersTasksTableBody/UsersTasksRow/EditRow/EditRow.js
View file @
cae1eab3
...
@@ -14,13 +14,12 @@ const StyledTooltip = styled(({ className, ...props }) => (
...
@@ -14,13 +14,12 @@ const StyledTooltip = styled(({ className, ...props }) => (
}
}
`
;
`
;
function
EditRow
({
buttons
,
dateTimeTasks
,
onChangeCurrentTaskHandler
,
currentTask
,
allUserProjectsForModalTask
,
onDateChangeEditHandler
,
user
})
{
function
EditRow
({
buttons
,
dateTimeTasks
,
onChangeCurrentTaskHandler
,
currentTask
,
allUserProjectsForModalTask
,
onDateChangeEditHandler
,
user
})
{
const
workers
=
useMemo
(()
=>
{
const
workers
=
useMemo
(()
=>
{
if
(
currentTask
?.
project
)
{
if
(
currentTask
?.
project
)
{
currentTask
.
project
=
allUserProjectsForModalTask
.
find
((
project
)
=>
project
?.
value
?.
id
===
currentTask
?.
project
?.
id
)?.
value
currentTask
.
project
=
allUserProjectsForModalTask
.
find
((
project
)
=>
project
?.
value
?.
id
===
currentTask
?.
project
?.
id
)?.
value
const
arrUsers
=
currentTask
?.
project
?.
members
.
map
((
member
)
=>
{
return
{
value
:
member
.
user
,
text
:
member
.
user
.
displayName
}
})
const
arrUsers
=
currentTask
?.
project
?.
members
.
map
((
member
)
=>
{
return
{
value
:
member
.
user
,
text
:
member
.
user
.
displayName
}
})
arrUsers
.
push
({
value
:
null
,
text
:
'Никто'
})
arrUsers
.
push
({
value
:
null
,
text
:
'Никто'
})
return
arrUsers
return
arrUsers
}
else
{
}
else
{
return
[{
value
:
''
,
text
:
'Выберите проект'
}]
return
[{
value
:
''
,
text
:
'Выберите проект'
}]
...
@@ -30,6 +29,7 @@ function EditRow({ buttons, dateTimeTasks, onChangeCurrentTaskHandler, currentTa
...
@@ -30,6 +29,7 @@ function EditRow({ buttons, dateTimeTasks, onChangeCurrentTaskHandler, currentTa
return
(
return
(
<>
<>
<
TableCell
sx
=
{{
width
:
'4%'
}}
>
<
TableCell
sx
=
{{
width
:
'4%'
}}
>
{
user
.
id
===
currentTask
.
author
.
id
?
<
CustomSelect
<
CustomSelect
defaultValue
=
{
priorities
[
0
]?.
value
}
defaultValue
=
{
priorities
[
0
]?.
value
}
value
=
{
currentTask
.
priority
}
value
=
{
currentTask
.
priority
}
...
@@ -40,11 +40,13 @@ function EditRow({ buttons, dateTimeTasks, onChangeCurrentTaskHandler, currentTa
...
@@ -40,11 +40,13 @@ function EditRow({ buttons, dateTimeTasks, onChangeCurrentTaskHandler, currentTa
items
=
{
priorities
}
items
=
{
priorities
}
sx
=
{{
width
:
'100%'
}}
sx
=
{{
width
:
'100%'
}}
/
>
/
>
:
currentTask
.
priority
}
<
/TableCell
>
<
/TableCell
>
<
TableCell
sx
=
{{
width
:
'10%'
}}
>
{
moment
(
currentTask
.
createdAt
).
format
(
'DD.MM.YYYY'
)}
<
/TableCell
>
<
TableCell
sx
=
{{
width
:
'10%'
}}
>
{
moment
(
currentTask
.
createdAt
).
format
(
'DD.MM.YYYY'
)}
<
/TableCell
>
<
Tooltip
title
=
{
currentTask
.
description
}
>
<
Tooltip
title
=
{
currentTask
.
description
}
>
<
TableCell
sx
=
{{
width
:
'25%'
,
overflow
:
'hidden'
,
textOverflow
:
'ellipsis'
}}
>
<
TableCell
sx
=
{{
width
:
'25%'
,
overflow
:
'hidden'
,
textOverflow
:
'ellipsis'
}}
>
{
user
.
id
===
currentTask
.
author
.
id
?
<
StyledTooltip
<
StyledTooltip
title
=
{
<
TextField
title
=
{
<
TextField
id
=
"task-description"
id
=
"task-description"
...
@@ -67,9 +69,11 @@ function EditRow({ buttons, dateTimeTasks, onChangeCurrentTaskHandler, currentTa
...
@@ -67,9 +69,11 @@ function EditRow({ buttons, dateTimeTasks, onChangeCurrentTaskHandler, currentTa
sx
=
{{
width
:
'90%'
}}
sx
=
{{
width
:
'90%'
}}
/
>
/
>
<
/StyledTooltip
>
<
/StyledTooltip
>
:
currentTask
.
title
}
<
/TableCell
>
<
/TableCell
>
<
/Tooltip
>
<
/Tooltip
>
<
TableCell
sx
=
{{
width
:
'10%'
}}
>
<
TableCell
sx
=
{{
width
:
'10%'
}}
>
{
user
.
id
===
currentTask
.
author
.
id
?
<
CustomSelect
<
CustomSelect
value
=
{
currentTask
.
project
}
value
=
{
currentTask
.
project
}
name
=
{
'project'
}
name
=
{
'project'
}
...
@@ -79,8 +83,10 @@ function EditRow({ buttons, dateTimeTasks, onChangeCurrentTaskHandler, currentTa
...
@@ -79,8 +83,10 @@ function EditRow({ buttons, dateTimeTasks, onChangeCurrentTaskHandler, currentTa
items
=
{
allUserProjectsForModalTask
}
items
=
{
allUserProjectsForModalTask
}
sx
=
{{
width
:
'100%'
}}
sx
=
{{
width
:
'100%'
}}
/
>
/
>
:
currentTask
.
projectTitle
}
<
/TableCell
>
<
/TableCell
>
<
TableCell
sx
=
{{
width
:
'8%'
}}
>
<
TableCell
sx
=
{{
width
:
'8%'
}}
>
{
user
.
id
===
currentTask
.
author
.
id
?
<
CustomSelect
<
CustomSelect
value
=
{
currentTask
.
executor
}
value
=
{
currentTask
.
executor
}
name
=
{
'executor'
}
name
=
{
'executor'
}
...
@@ -90,6 +96,7 @@ function EditRow({ buttons, dateTimeTasks, onChangeCurrentTaskHandler, currentTa
...
@@ -90,6 +96,7 @@ function EditRow({ buttons, dateTimeTasks, onChangeCurrentTaskHandler, currentTa
items
=
{
workers
}
items
=
{
workers
}
sx
=
{{
width
:
'100%'
}}
sx
=
{{
width
:
'100%'
}}
/
>
/
>
:
currentTask
.
executorName
}
<
/TableCell
>
<
/TableCell
>
<
TableCell
sx
=
{{
width
:
'8%'
}}
>
{
currentTask
.
authorName
}
<
/TableCell
>
<
TableCell
sx
=
{{
width
:
'8%'
}}
>
{
currentTask
.
authorName
}
<
/TableCell
>
...
@@ -98,11 +105,13 @@ function EditRow({ buttons, dateTimeTasks, onChangeCurrentTaskHandler, currentTa
...
@@ -98,11 +105,13 @@ function EditRow({ buttons, dateTimeTasks, onChangeCurrentTaskHandler, currentTa
<
/TableCell
>
<
/TableCell
>
<
TableCell
sx
=
{{
width
:
'10%'
}}
>
<
TableCell
sx
=
{{
width
:
'10%'
}}
>
{
user
.
id
===
currentTask
.
author
.
id
?
<
MaterialUIPickers
<
MaterialUIPickers
task
=
{
currentTask
}
task
=
{
currentTask
}
name
=
"dateTimeDeadLine"
name
=
"dateTimeDeadLine"
onChange
=
{
onDateChangeEditHandler
}
onChange
=
{
onDateChangeEditHandler
}
/
>
/
>
:
currentTask
.
dateTimeDeadLine
?
moment
(
currentTask
.
dateTimeDeadLine
).
utc
().
format
(
'DD.MM.YYYY HH:MM'
)
:
null
}
<
/TableCell
>
<
/TableCell
>
<
TableCell
sx
=
{{
width
:
'7%'
}}
>
<
TableCell
sx
=
{{
width
:
'7%'
}}
>
<
CustomSelect
<
CustomSelect
...
...
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