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
7f55d5c6
Commit
7f55d5c6
authored
Jan 12, 2023
by
Ermolaev Timur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#149
Начал проектировку с самого начала, начал разделять дефолтную таблицу на компоненты
parent
e5558375
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
259 additions
and
1310 deletions
+259
-1310
CustomTableCell.js
...nt/src/components/UsersTasksCompoments/CustomTableCell.js
+0
-68
DateTimePicker.js
...nts/UsersTasksCompoments/DateTimePicker/DateTimePicker.js
+0
-31
NewTaskForm.js
...-front/src/components/UsersTasksCompoments/NewTaskForm.js
+0
-264
TableRowTask.js
...ponents/UsersTasksCompoments/TableRowTask/TableRowTask.js
+0
-454
TaskModal.css
...c/components/UsersTasksCompoments/TaskModal/TaskModal.css
+0
-20
TaskModal.js
...rc/components/UsersTasksCompoments/TaskModal/TaskModal.js
+0
-104
UsersTaskToolBar.js
...t/src/components/UsersTasksCompoments/UsersTaskToolBar.js
+0
-63
UsersTasksTableContainer.js
...ents/UsersTasksTableContainer/UsersTasksTableContainer.js
+84
-0
UsersTasksTableHead.js
...asksCompoments/UsersTasksTableHead/UsersTasksTableHead.js
+72
-0
UsersTasksTablePagination.js
...ts/UsersTasksTablePagination/UsersTasksTablePagination.js
+20
-0
UsersTasksTableToolbar.js
...mpoments/UsersTasksTableToolbar/UsersTasksTableToolbar.js
+21
-0
UsersTasks.js
planner-front/src/containers/UsersTasks/UsersTasks.js
+62
-306
No files found.
planner-front/src/components/UsersTasksCompoments/CustomTableCell.js
deleted
100644 → 0
View file @
e5558375
import
*
as
React
from
"react"
;
import
TableCell
from
"@mui/material/TableCell"
;
import
Input
from
"@mui/material/Input"
;
import
moment
from
"moment"
;
const
CustomTableCell
=
({
task
,
name
,
value
,
value2
,
onChange
,
onModalOpen
,
placeholder
,
user
,
colSpan
})
=>
{
const
styles
=
placeholder
?
{
width
:
"100%"
}
:
{
width
:
"auto"
};
const
divStyle
=
{
display
:
"flex"
,
justifyContent
:
"space-between"
,
flexDirection
:
"column"
,
fontSize
:
"12px"
,
};
const
duration
=
moment
.
duration
(
moment
(
task
?.
dateTimeTasks
[
0
]?.
dateTimeDue
).
diff
(
moment
(
task
?.
dateTimeTasks
[
0
]?.
dateTimeStart
)
)
);
const
hours
=
Math
.
round
(
duration
.
asHours
());
if
(
task
)
{
return
(
<>
<
TableCell
colSpan
=
{
colSpan
}
onClick
=
{(
e
)
=>
(
onModalOpen
?
onModalOpen
(
e
,
task
)
:
null
)}
align
=
"left"
// style={styles}
>
{(
task
.
isEditMode
&&
onChange
&&
name
!==
"author"
&&
task
.
author
?.
id
===
user
?.
id
)
||
placeholder
?
(
<
Input
placeholder
=
{
placeholder
}
value
=
{
value
}
name
=
{
name
}
onChange
=
{(
e
)
=>
onChange
(
e
,
task
)}
style
=
{
styles
}
/
>
)
:
name
!==
"dateTimeStart"
?
(
<
span
>
{
value
}
<
/span
>
)
:
(
<
div
style
=
{
divStyle
}
>
<
span
>
{
value
}
<
/span
>
<
span
>
{
value2
}
<
/span
>
<
span
>
часы
:{
hours
}
<
/span
>
<
/div
>
)}
<
/TableCell
>
<
/
>
);
}
};
export
default
CustomTableCell
;
planner-front/src/components/UsersTasksCompoments/DateTimePicker/DateTimePicker.js
deleted
100644 → 0
View file @
e5558375
import
*
as
React
from
"react"
;
import
TextField
from
"@mui/material/TextField"
;
import
{
LocalizationProvider
}
from
"@mui/x-date-pickers/LocalizationProvider"
;
import
{
DateTimePicker
}
from
"@mui/x-date-pickers/DateTimePicker"
;
import
{
AdapterMoment
}
from
"@mui/x-date-pickers/AdapterMoment"
;
export
default
function
MaterialUIPickers
(
props
)
{
return
(
<
LocalizationProvider
dateAdapter
=
{
AdapterMoment
}
sx
=
{{
width
:
"100%"
,
fontSize
:
5
,
fontWeight
:
"200"
}}
>
<
DateTimePicker
inputFormat
=
"DD-MM-YY kk:mm A"
disabled
=
{
props
.
task
.
readOnly
}
renderInput
=
{(
params
)
=>
(
<
TextField
{...
params
}
sx
=
{{
width
:
"auto"
,
fontWeight
:
"200"
,
fontSize
:
5
}}
name
=
{
props
.
name
}
/
>
)}
value
=
{
props
.
task
[
props
.
name
]}
onChange
=
{(
newValue
)
=>
{
props
.
onChange
(
props
.
task
.
id
,
newValue
,
props
.
name
);
}}
/
>
<
/LocalizationProvider
>
);
}
planner-front/src/components/UsersTasksCompoments/NewTaskForm.js
deleted
100644 → 0
View file @
e5558375
import
*
as
React
from
"react"
;
import
{
Table
,
TableBody
,
TableCell
,
TableContainer
,
TableRow
,
TableHead
,
IconButton
,
Tooltip
,
Typography
,
Divider
,
}
from
"@mui/material"
;
import
{
useState
}
from
"react"
;
import
{
useDispatch
,
useSelector
}
from
"react-redux"
;
import
{
AddBox
}
from
"@mui/icons-material"
;
import
moment
from
"moment"
;
import
CustomTableCell
from
"./CustomTableCell"
;
import
MaterialUIPickers
from
"./DateTimePicker/DateTimePicker"
;
import
BasicSelect
from
"../UI/Select/Select"
;
import
{
addTaskToUserTasksTable
}
from
"../../store/actions/tasksActions"
;
import
TaskModal
from
"./TaskModal/TaskModal"
;
export
default
function
NewTaskForm
({
projects
,
currentProject
,
setCurrentProject
,
setAddTaskForm
,
})
{
const
dispatch
=
useDispatch
();
const
user
=
useSelector
((
state
)
=>
state
.
users
.
user
);
const
currentDateTime
=
new
Date
();
const
dateTime
=
moment
(
currentDateTime
).
utc
().
format
();
const
[
task
,
setTask
]
=
useState
({
id
:
0
,
title
:
""
,
description
:
""
,
createdAt
:
dateTime
,
dateTimeStart
:
null
,
dateTimeDeadLine
:
null
,
dateTimeTasks
:
[],
dateTimeDue
:
null
,
project
:
projects
?
projects
.
find
(
project
=>
project
.
title
===
"Не определено"
):
null
,
accomplish
:
"opened"
,
priority
:
"B"
,
author
:
{
id
:
user
.
id
},
authorDisplayName
:
user
.
displayName
,
executor
:
null
,
isEditMode
:
true
,
});
const
[
modal
,
setModal
]
=
useState
(
false
);
const
onModalOpen
=
(
event
,
task
)
=>
{
event
.
stopPropagation
();
setModal
(
true
);
};
const
handleClose
=
()
=>
{
setModal
(
false
);
};
const
onChange
=
(
e
,
task
)
=>
{
const
value
=
e
.
target
.
value
;
const
name
=
e
.
target
.
name
;
const
newTask
=
{
...
task
,
[
name
]:
value
};
setTask
(
newTask
);
};
const
onProjectChange
=
(
e
,
task
)
=>
{
const
value
=
e
.
target
.
value
;
const
project
=
projects
.
find
((
project
)
=>
project
.
id
===
value
);
setCurrentProject
(
project
)
const
newTask
=
{
...
task
};
newTask
.
project
=
project
;
setTask
(
newTask
);
};
const
onExecutorChange
=
(
e
,
task
)
=>
{
const
{
value
,
name
}
=
e
.
target
.
value
;
let
executorMember
=
null
const
newTask
=
{
...
task
};
if
(
name
===
'executor'
&&
value
!==
null
)
{
executorMember
=
currentProject
.
find
((
member
)
=>
member
.
user
.
id
===
value
);
newTask
.
executor
=
executorMember
?.
user
;
}
setTask
(
newTask
);
};
const
onDateChange
=
(
id
,
value
,
property
)
=>
{
const
newTask
=
{
...
task
,
[
property
]:
moment
.
parseZone
(
value
,
"DD/MM/YYYY"
,
true
).
format
(),
};
setTask
(
newTask
);
};
const
handleAddTask
=
()
=>
{
dispatch
(
addTaskToUserTasksTable
(
task
));
setAddTaskForm
();
};
return
(
<>
<
Divider
>
<
Typography
variant
=
"overline"
>
Добавить
новую
задачу
<
/Typography
>
<
/Divider
>
<
TableContainer
style
=
{{
backgroundColor
:
"#E8E8E8"
,
marginBottom
:
"2em"
,
}}
>
<
Table
sx
=
{{
minWidth
:
600
}}
aria
-
labelledby
=
"tableTitle"
>
<
TableHead
>
<
TableRow
>
{
header
.
map
((
headCell
)
=>
(
<
TableCell
key
=
{
headCell
.
id
}
align
=
"center"
padding
=
{
headCell
.
disablePadding
?
"none"
:
"normal"
}
colSpan
=
{
headCell
.
colSpan
}
>
{
headCell
.
label
}
<
/TableCell
>
))}
<
/TableRow
>
<
/TableHead
>
<
TableBody
>
<
TableRow
hover
key
=
{
task
.
id
}
>
<
TableCell
component
=
"th"
scope
=
"row"
padding
=
"none"
><
/TableCell
>
<
TableCell
>
<
BasicSelect
items
=
{[
{
value
:
"A"
,
title
:
"A"
},
{
value
:
"B"
,
title
:
"B"
},
{
value
:
"C"
,
title
:
"C"
},
]}
task
=
{
task
}
value
=
{
task
.
priority
}
onChange
=
{
onChange
}
name
=
"priority"
/>
<
/TableCell
>
<
CustomTableCell
colSpan
=
{
3
}
{...{
task
,
name
:
"title"
,
value
:
task
.
title
,
onModalOpen
,
user
:
user
,
placeholder
:
"Кликните для ввода информации по задаче"
}}
/
>
<
TableCell
>
<
BasicSelect
items
=
{
projects
?.
map
((
project
)
=>
({
value
:
project
?.
id
,
title
:
project
?.
title
,
}))}
task
=
{
task
}
onChange
=
{
onProjectChange
}
name
=
"project"
value
=
{
task
.
project
?.
id
}
/
>
<
/TableCell
>
<
TableCell
>
<
BasicSelect
items
=
{
currentProject
?
currentProject
?.
members
.
map
((
member
)
=>
({
value
:
member
?.
user
?.
id
,
title
:
member
?.
user
?.
displayName
,
})):
null
}
task
=
{
task
}
onChange
=
{
onExecutorChange
}
name
=
"executor"
value
=
{
task
?.
executor
?.
id
}
defaultValue
=
{
user
.
id
}
/
>
<
/TableCell
>
<
TableCell
>
<
MaterialUIPickers
task
=
{
task
}
name
=
"dateTimeDeadLine"
onChange
=
{
onDateChange
}
/
>
<
/TableCell
>
<
TableCell
>
<
Tooltip
title
=
"Добавить"
>
<
IconButton
size
=
"large"
onClick
=
{
handleAddTask
}
>
<
AddBox
fontSize
=
"large"
/>
<
/IconButton
>
<
/Tooltip
>
<
/TableCell
>
<
/TableRow
>
<
/TableBody
>
<
/Table
>
<
TaskModal
task
=
{
task
}
open
=
{
modal
}
handleClose
=
{
handleClose
}
onChange
=
{
onChange
}
user
=
{
user
}
/
>
<
/TableContainer
>
<
Divider
/>
<
/
>
);
}
export
const
header
=
[
{
id
:
"id"
,
numeric
:
true
,
disablePadding
:
true
,
label
:
""
,
},
{
id
:
"priority"
,
numeric
:
false
,
disablePadding
:
true
,
label
:
"Приоритет"
,
},
{
id
:
"title"
,
numeric
:
false
,
disablePadding
:
false
,
label
:
"Заголовок"
,
colSpan
:
3
},
{
id
:
"projectName"
,
numeric
:
true
,
disablePadding
:
false
,
label
:
"Проект"
,
},
{
id
:
"executorName"
,
numeric
:
false
,
disablePadding
:
false
,
label
:
"Исполнитель"
,
},
{
id
:
"dateTimeDeadLine"
,
numeric
:
true
,
disablePadding
:
false
,
label
:
"Дедлайн"
,
},
{
id
:
"add"
,
numeric
:
false
,
disablePadding
:
false
,
label
:
""
,
},
];
planner-front/src/components/UsersTasksCompoments/TableRowTask/TableRowTask.js
deleted
100644 → 0
View file @
e5558375
This diff is collapsed.
Click to expand it.
planner-front/src/components/UsersTasksCompoments/TaskModal/TaskModal.css
deleted
100644 → 0
View file @
e5558375
.modal
{
display
:
flex
;
flex-direction
:
column
;
padding
:
10px
;
align-items
:
center
;
position
:
absolute
;
top
:
200px
;
left
:
200px
;
width
:
300px
;
height
:
300px
;
background-color
:
white
;
border
:
2px
solid
#000
;
box-shadow
:
24px
;
border-radius
:
5px
}
.modalBox
{
display
:
flex
;
justify-content
:
space-around
;
flex-direction
:
column
;
}
\ No newline at end of file
planner-front/src/components/UsersTasksCompoments/TaskModal/TaskModal.js
deleted
100644 → 0
View file @
e5558375
import
{
Modal
,
IconButton
}
from
"@mui/material"
;
import
"./TaskModal.css"
;
import
{
Done
}
from
"@mui/icons-material"
;
import
Input
from
"@mui/material/Input"
;
import
TextField
from
"@mui/material/Input"
;
const
TaskModal
=
({
handleClose
,
open
,
task
,
onChange
,
user
})
=>
{
return
(
<
Modal
aria
-
labelledby
=
"modal-modal-title"
aria
-
describedby
=
"modal-modal-description"
BackdropProps
=
{{
style
:
{
backgroundColor
:
'rgba(255,255,255, 0)'
}
}}
closeAfterTransition
onClose
=
{
handleClose
}
open
=
{
open
}
>
{
task
?.
isEditMode
&&
task
.
author
.
id
===
user
.
id
?
(
<
div
className
=
"modal"
>
<
Input
label
=
"название"
color
=
"secondary"
value
=
{
task
.
title
}
name
=
"title"
onChange
=
{(
e
)
=>
onChange
(
e
,
task
)}
style
=
{{
width
:
"auto"
,
fontWeight
:
"600"
,
height
:
"40px"
,
fontWeight
:
"600"
,
width
:
"280px"
,
margin
:
"10px"
,
padding
:
"5px"
,
border
:
'2px solid #D3D3D3'
,
borderRadius
:
"5px"
}}
/
>
<
TextField
label
=
"описание"
value
=
{
task
.
description
}
name
=
"description"
onChange
=
{(
e
)
=>
onChange
(
e
,
task
)}
multiline
=
{
true
}
sx
=
{{
fontWeight
:
"400"
,
width
:
"280px"
,
margin
:
"10px"
,
padding
:
"5px"
,
border
:
'2px solid #D3D3D3'
,
borderRadius
:
"5px"
,
height
:
"300px"
,
whiteSpace
:
"normal"
}}
/
>
<
IconButton
aria
-
label
=
"done"
onClick
=
{
handleClose
}
sx
=
{{
margingBottom
:
"5px"
,
marginTop
:
"auto"
}}
>
<
Done
/>
<
/IconButton
>
<
/div
>
)
:
(
<
div
className
=
"modal"
>
{
task
&&
task
.
title
&&
(
<
div
style
=
{{
height
:
"40px"
,
fontWeight
:
"600"
,
width
:
"280px"
,
margin
:
"10px"
,
padding
:
"5px"
,
border
:
'2px solid #D3D3D3'
,
borderRadius
:
"5px"
}}
>
{
task
.
title
}
<
/div
>
)}
{
task
&&
task
.
description
&&
(
<
div
style
=
{{
margin
:
"10px"
,
border
:
'2px solid #D3D3D3'
,
borderRadius
:
"5px"
,
width
:
"280px"
,
height
:
"200px"
,
margin
:
"10px"
,
padding
:
"5px"
,
}}
>
{
task
.
description
}
<
/div
>
)}
<
IconButton
aria
-
label
=
"close"
onClick
=
{
handleClose
}
sx
=
{{
margingBottom
:
"5px"
,
marginTop
:
"auto"
}}
>
X
<
/IconButton
>
<
/div
>
)}
<
/Modal
>
);
};
export
default
TaskModal
;
planner-front/src/components/UsersTasksCompoments/UsersTaskToolBar.js
deleted
100644 → 0
View file @
e5558375
import
*
as
React
from
'react'
;
import
AppBar
from
'@mui/material/AppBar'
;
import
Box
from
'@mui/material/Box'
;
import
Toolbar
from
'@mui/material/Toolbar'
;
import
Typography
from
'@mui/material/Typography'
;
import
Button
from
'@mui/material/Button'
;
import
MultipleSelect
from
'../UI/MultipleSelect/MultipleSelect'
;
import
Add
from
"@mui/icons-material/Add"
;
import
Close
from
"@mui/icons-material/Close"
;
export
default
function
UsersTaskToolBar
({
projects
,
onClose
,
projectIdListForTaskSelect
,
setProjectIdListForTaskSelect
,
formStatus
,
onClick
})
{
let
projectsFilter
=
<><
/
>
if
(
Array
.
isArray
(
projects
))
{
projectsFilter
=
<
MultipleSelect
projects
=
{
projects
}
onClose
=
{
onClose
}
projectName
=
{
projectIdListForTaskSelect
}
setProjectName
=
{
setProjectIdListForTaskSelect
}
/
>
}
return
(
<
Box
sx
=
{{
flexGrow
:
1
}}
>
<
AppBar
position
=
"static"
>
<
Toolbar
>
<
Typography
variant
=
"h6"
component
=
"div"
sx
=
{{
flexGrow
:
1
}}
>
Задачи
сотрудников
<
/Typography
>
{
projectsFilter
}
<
Button
color
=
{
formStatus
===
true
?
"info"
:
"inherit"
}
style
=
{{
backgroundColor
:
formStatus
===
true
?
"white"
:
"inherit"
,
}}
onClick
=
{
onClick
}
>
{
formStatus
===
true
?
(
<>
<
Close
/>
<
span
style
=
{{
lineHeight
:
"16px"
}}
>
Скрыть
задачу
<
/span
>
<
/
>
)
:
(
<>
<
Add
/>
<
span
style
=
{{
lineHeight
:
"16px"
}}
>
Добавить
задачу
<
/span
>
<
/
>
)}
<
/Button
>
<
/Toolbar
>
<
/AppBar
>
<
/Box
>
);
}
planner-front/src/components/UsersTasksCompoments/UsersTasksTableContainer/UsersTasksTableContainer.js
0 → 100644
View file @
7f55d5c6
import
{
Table
,
TableBody
,
TableCell
,
TableContainer
,
TableRow
}
from
"@mui/material"
;
import
{
memo
}
from
"react"
;
import
UsersTasksTableHead
from
"../UsersTasksTableHead/UsersTasksTableHead"
;
function
getComparator
(
order
,
orderBy
)
{
return
order
===
'desc'
?
(
a
,
b
)
=>
descendingComparator
(
a
,
b
,
orderBy
)
:
(
a
,
b
)
=>
-
descendingComparator
(
a
,
b
,
orderBy
);
}
function
stableSort
(
array
,
comparator
)
{
const
stabilizedThis
=
array
.
map
((
el
,
index
)
=>
[
el
,
index
]);
stabilizedThis
.
sort
((
a
,
b
)
=>
{
const
order
=
comparator
(
a
[
0
],
b
[
0
]);
if
(
order
!==
0
)
{
return
order
;
}
return
a
[
1
]
-
b
[
1
];
});
return
stabilizedThis
.
map
((
el
)
=>
el
[
0
]);
}
function
descendingComparator
(
a
,
b
,
orderBy
)
{
if
(
b
[
orderBy
]
<
a
[
orderBy
])
{
return
-
1
;
}
if
(
b
[
orderBy
]
>
a
[
orderBy
])
{
return
1
;
}
return
0
;
}
function
UsersTasksTableContainer
({
order
,
orderBy
,
handleRequestSort
,
rows
,
page
,
rowsPerPage
})
{
const
emptyRows
=
page
>
0
?
Math
.
max
(
0
,
(
1
+
page
)
*
rowsPerPage
-
rows
.
length
)
:
0
;
return
(
<
TableContainer
>
<
Table
sx
=
{{
minWidth
:
750
}}
aria
-
labelledby
=
"tableTitle"
>
<
UsersTasksTableHead
order
=
{
order
}
orderBy
=
{
orderBy
}
onRequestSort
=
{
handleRequestSort
}
/
>
<
TableBody
>
{
stableSort
(
rows
,
getComparator
(
order
,
orderBy
))
.
slice
(
page
*
rowsPerPage
,
page
*
rowsPerPage
+
rowsPerPage
)
.
map
((
row
,
index
)
=>
{
return
(
<
TableRow
hover
tabIndex
=
{
-
1
}
key
=
{
row
.
name
}
>
<
TableCell
component
=
"th"
scope
=
"row"
padding
=
"none"
>
{
row
.
name
}
<
/TableCell
>
<
TableCell
align
=
"right"
>
{
row
.
calories
}
<
/TableCell
>
<
TableCell
align
=
"right"
>
{
row
.
fat
}
<
/TableCell
>
<
TableCell
align
=
"right"
>
{
row
.
carbs
}
<
/TableCell
>
<
TableCell
align
=
"right"
>
{
row
.
protein
}
<
/TableCell
>
<
/TableRow
>
);
})}
{
emptyRows
>
0
&&
(
<
TableRow
>
<
TableCell
colSpan
=
{
6
}
/
>
<
/TableRow
>
)}
<
/TableBody
>
<
/Table
>
<
/TableContainer
>
);
}
export
default
memo
(
UsersTasksTableContainer
)
\ No newline at end of file
planner-front/src/co
ntainers/UsersTasks/UsersTasksHeader/UsersTasksHeader
.js
→
planner-front/src/co
mponents/UsersTasksCompoments/UsersTasksTableHead/UsersTasksTableHead
.js
View file @
7f55d5c6
import
*
as
React
from
"react"
;
import
{
Box
,
TableCell
,
TableHead
,
TableRow
,
TableSortLabel
}
from
"@mui/material"
;
import
PropTypes
from
"prop-types"
;
import
{
visuallyHidden
}
from
'@mui/utils'
;
import
Box
from
"@mui/material/Box"
;
import
{
memo
}
from
"react"
;
import
TableCell
from
"@mui/material/TableCell"
;
import
TableHead
from
"@mui/material/TableHead"
;
import
TableRow
from
"@mui/material/TableRow"
;
import
TableSortLabel
from
"@mui/material/TableSortLabel"
;
import
{
visuallyHidden
}
from
"@mui/utils"
;
const
headCells
=
[
const
headCells
=
[
{
{
id
:
"id"
,
id
:
'name'
,
numeric
:
true
,
disablePadding
:
true
,
label
:
""
,
},
{
id
:
"priority"
,
numeric
:
false
,
numeric
:
false
,
disablePadding
:
true
,
disablePadding
:
true
,
label
:
"Приоритет"
,
label
:
'Dessert (100g serving)'
,
},
{
id
:
"createdAt"
,
numeric
:
true
,
disablePadding
:
false
,
label
:
"Дата создания"
,
},
{
id
:
"title"
,
numeric
:
true
,
disablePadding
:
false
,
label
:
"Заголовок"
,
},
{
id
:
"projectName"
,
numeric
:
true
,
disablePadding
:
false
,
label
:
"Проект"
,
},
{
id
:
"executorDisplayName"
,
numeric
:
true
,
disablePadding
:
false
,
label
:
"Исполнитель"
,
},
},
{
{
id
:
"authorDisplayName"
,
id
:
'calories'
,
numeric
:
true
,
numeric
:
true
,
disablePadding
:
false
,
disablePadding
:
false
,
label
:
"Автор"
,
label
:
'Calories'
,
},
},
{
{
id
:
"dateTimeStart"
,
id
:
'fat'
,
numeric
:
true
,
numeric
:
true
,
disablePadding
:
false
,
disablePadding
:
false
,
label
:
"Дата и время выполнения"
,
label
:
'Fat (g)'
,
},
},
{
{
id
:
"dateTimeDue"
,
id
:
'carbs'
,
numeric
:
true
,
numeric
:
true
,
disablePadding
:
false
,
disablePadding
:
false
,
label
:
"Дедлайн"
,
label
:
'Carbs (g)'
,
},
},
{
{
id
:
"accomplish"
,
id
:
'protein'
,
numeric
:
true
,
numeric
:
true
,
disablePadding
:
false
,
disablePadding
:
false
,
label
:
"Статус"
,
label
:
'Protein (g)'
,
},
{
id
:
"change"
,
numeric
:
false
,
disablePadding
:
false
,
label
:
""
,
},
{
id
:
"delete"
,
numeric
:
false
,
disablePadding
:
false
,
label
:
""
,
},
},
];
];
export
default
function
UsersTasksHeader
({
order
,
orderBy
,
rowCount
,
onRequestSort
})
{
function
UsersTasksTableHead
({
order
,
orderBy
,
onRequestSort
})
{
const
createSortHandler
=
(
property
)
=>
(
event
)
=>
{
const
createSortHandler
=
(
property
)
=>
(
event
)
=>
{
onRequestSort
(
event
,
property
);
onRequestSort
(
event
,
property
);
};
};
...
@@ -95,19 +46,19 @@ export default function UsersTasksHeader({ order, orderBy, rowCount, onRequestSo
...
@@ -95,19 +46,19 @@ export default function UsersTasksHeader({ order, orderBy, rowCount, onRequestSo
{
headCells
.
map
((
headCell
)
=>
(
{
headCells
.
map
((
headCell
)
=>
(
<
TableCell
<
TableCell
key
=
{
headCell
.
id
}
key
=
{
headCell
.
id
}
align
=
{
"center"
}
align
=
{
headCell
.
numeric
?
'right'
:
'left'
}
padding
=
{
headCell
.
disablePadding
?
"none"
:
"normal"
}
padding
=
{
headCell
.
disablePadding
?
'none'
:
'normal'
}
sortDirection
=
{
orderBy
===
headCell
.
id
?
order
:
false
}
sortDirection
=
{
orderBy
===
headCell
.
id
?
order
:
false
}
>
>
<
TableSortLabel
<
TableSortLabel
active
=
{
orderBy
===
headCell
.
id
}
active
=
{
orderBy
===
headCell
.
id
}
direction
=
{
orderBy
===
headCell
.
id
?
order
:
"asc"
}
direction
=
{
orderBy
===
headCell
.
id
?
order
:
'asc'
}
onClick
=
{
createSortHandler
(
headCell
.
id
)}
onClick
=
{
createSortHandler
(
headCell
.
id
)}
>
>
{
headCell
.
label
}
{
headCell
.
label
}
{
orderBy
===
headCell
.
id
?
(
{
orderBy
===
headCell
.
id
?
(
<
Box
component
=
"span"
sx
=
{
visuallyHidden
}
>
<
Box
component
=
"span"
sx
=
{
visuallyHidden
}
>
{
order
===
"desc"
?
"sorted descending"
:
"sorted ascending"
}
{
order
===
'desc'
?
'sorted descending'
:
'sorted ascending'
}
<
/Box
>
<
/Box
>
)
:
null
}
)
:
null
}
<
/TableSortLabel
>
<
/TableSortLabel
>
...
@@ -118,9 +69,4 @@ export default function UsersTasksHeader({ order, orderBy, rowCount, onRequestSo
...
@@ -118,9 +69,4 @@ export default function UsersTasksHeader({ order, orderBy, rowCount, onRequestSo
);
);
}
}
UsersTasksHeader
.
propTypes
=
{
export
default
memo
(
UsersTasksTableHead
)
onRequestSort
:
PropTypes
.
func
.
isRequired
,
\ No newline at end of file
order
:
PropTypes
.
oneOf
([
"asc"
,
"desc"
]).
isRequired
,
orderBy
:
PropTypes
.
string
.
isRequired
,
rowCount
:
PropTypes
.
number
.
isRequired
,
};
planner-front/src/components/UsersTasksCompoments/UsersTasksTablePagination/UsersTasksTablePagination.js
0 → 100644
View file @
7f55d5c6
import
{
TablePagination
}
from
"@mui/material"
;
import
{
memo
}
from
"react"
;
function
UsersTasksTablePagination
({
count
,
rowsPerPage
,
page
,
handleChangePage
,
handleChangeRowsPerPage
})
{
return
(
<
TablePagination
rowsPerPageOptions
=
{[
5
,
10
,
25
]}
component
=
"div"
count
=
{
count
}
rowsPerPage
=
{
rowsPerPage
}
page
=
{
page
}
onPageChange
=
{
handleChangePage
}
onRowsPerPageChange
=
{
handleChangeRowsPerPage
}
/
>
);
}
export
default
memo
(
UsersTasksTablePagination
)
\ No newline at end of file
planner-front/src/components/UsersTasksCompoments/UsersTasksTableToolbar/UsersTasksTableToolbar.js
0 → 100644
View file @
7f55d5c6
import
{
Toolbar
,
Typography
}
from
"@mui/material"
;
import
{
memo
}
from
"react"
;
function
UsersTasksTableToolbar
()
{
return
(
<
Toolbar
>
<
Typography
sx
=
{{
flex
:
'1 1 100%'
}}
variant
=
"h6"
id
=
"tableTitle"
component
=
"div"
>
Nutrition
<
/Typography
>
<
/Toolbar
>
);
}
export
default
memo
(
UsersTasksTableToolbar
)
\ No newline at end of file
planner-front/src/containers/UsersTasks/UsersTasks.js
View file @
7f55d5c6
This diff is collapsed.
Click to expand it.
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