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
d0304198
Commit
d0304198
authored
Jan 17, 2023
by
Ermolaev Timur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#159
пофиксил баги с отображением данных в инпуте, а также с вылетами
parent
fe9eacab
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
31 additions
and
34 deletions
+31
-34
CalendarModalTaskContent.js
...s/UI/CalendarModalTaskContent/CalendarModalTaskContent.js
+1
-0
MyTasksTableToolbar.js
...asksCompoments/MyTasksTableToolbar/MyTasksTableToolbar.js
+2
-2
NewProjectModalContent.js
...mponents/NewProjectModalContent/NewProjectModalContent.js
+10
-8
UsersTasksTableToolbar.js
...mpoments/UsersTasksTableToolbar/UsersTasksTableToolbar.js
+2
-2
MonthCalendar.js
planner-front/src/containers/MonthCalendar/MonthCalendar.js
+1
-1
MyTasks.js
planner-front/src/containers/MyTasks/MyTasks.js
+5
-5
Projects.js
planner-front/src/containers/Projects/Projects.js
+1
-4
UsersTasks.js
planner-front/src/containers/UsersTasks/UsersTasks.js
+5
-5
WeekCalendar.js
planner-front/src/containers/WeekCalendar/WeekCalendar.js
+2
-2
tasksActions.js
planner-front/src/store/actions/tasksActions.js
+1
-1
tasksReducer.js
planner-front/src/store/reducers/tasksReducer.js
+1
-1
usersReducer.js
planner-front/src/store/reducers/usersReducer.js
+0
-3
No files found.
planner-front/src/components/Calendars/UI/CalendarModalTaskContent/CalendarModalTaskContent.js
View file @
d0304198
...
@@ -47,6 +47,7 @@ function CalendarModalTaskContent({ title, onChangeCurrentTaskHandler, descripti
...
@@ -47,6 +47,7 @@ function CalendarModalTaskContent({ title, onChangeCurrentTaskHandler, descripti
value
=
{
project
}
value
=
{
project
}
name
=
{
'project'
}
name
=
{
'project'
}
variant
=
{
'outlined'
}
variant
=
{
'outlined'
}
renderValue
=
{(
project
)
=>
project
?.
title
}
onChange
=
{(
e
)
=>
{
onChangeCurrentTaskHandler
(
e
)
}}
onChange
=
{(
e
)
=>
{
onChangeCurrentTaskHandler
(
e
)
}}
label
=
{
'Проект'
}
label
=
{
'Проект'
}
id
=
{
'project'
}
id
=
{
'project'
}
...
...
planner-front/src/components/MyTasksCompoments/MyTasksTableToolbar/MyTasksTableToolbar.js
View file @
d0304198
...
@@ -4,7 +4,7 @@ import MultipleSelect from "../../UI/MultipleSelect/MultipleSelect";
...
@@ -4,7 +4,7 @@ import MultipleSelect from "../../UI/MultipleSelect/MultipleSelect";
import
CreateTaskFromButton
from
"./CreateTaskFromButton/CreateTaskFromButton"
;
import
CreateTaskFromButton
from
"./CreateTaskFromButton/CreateTaskFromButton"
;
function
MyTasksTableToolbar
({
addFormStatus
,
createTaskFromButtonHandler
,
projects
,
onCloseFilterByProjects
,
projectIdListForTaskSelect
,
setProjectIdListForTaskSelect
,
activeTasks
On
,
setActiveTasksOn
})
{
function
MyTasksTableToolbar
({
addFormStatus
,
createTaskFromButtonHandler
,
projects
,
onCloseFilterByProjects
,
projectIdListForTaskSelect
,
setProjectIdListForTaskSelect
,
activeTasks
Status
,
setActiveTasksStatus
})
{
const
projectsFilter
=
useMemo
(()
=>
{
const
projectsFilter
=
useMemo
(()
=>
{
if
(
Array
.
isArray
(
projects
))
{
if
(
Array
.
isArray
(
projects
))
{
...
@@ -31,7 +31,7 @@ function MyTasksTableToolbar({ addFormStatus, createTaskFromButtonHandler, proje
...
@@ -31,7 +31,7 @@ function MyTasksTableToolbar({ addFormStatus, createTaskFromButtonHandler, proje
Мои
задачи
Мои
задачи
<
/Typography
>
<
/Typography
>
<
FormControlLabel
<
FormControlLabel
control
=
{
<
Switch
color
=
'error'
checked
=
{
activeTasks
On
}
onChange
=
{()
=>
{
setActiveTasksOn
(
prevState
=>!
prevState
)
}}
/>
}
control
=
{
<
Switch
color
=
'error'
checked
=
{
activeTasks
Status
}
onChange
=
{()
=>
{
setActiveTasksStatus
(
prevState
=>!
prevState
)
}}
/>
}
label
=
"Активные задачи"
label
=
"Активные задачи"
labelPlacement
=
"end"
labelPlacement
=
"end"
/>
/>
...
...
planner-front/src/components/ProjectsComponents/NewProjectModalContent/NewProjectModalContent.js
View file @
d0304198
import
{
Button
}
from
"@mui/material"
;
import
{
Button
,
TextField
}
from
"@mui/material"
;
import
{
Box
}
from
"@mui/system"
;
import
{
Box
}
from
"@mui/system"
;
import
{
memo
}
from
"react"
;
import
{
memo
}
from
"react"
;
import
FormElement
from
"../../UI/Form/FormElement/FormElement"
import
{
isValidate
}
from
"./helpers"
;
import
{
isValidate
}
from
"./helpers"
;
...
@@ -9,18 +8,21 @@ const NewProjectModalContent = ({ inputChangeHandler, projectTitle, createNewPro
...
@@ -9,18 +8,21 @@ const NewProjectModalContent = ({ inputChangeHandler, projectTitle, createNewPro
return
<>
return
<>
<
FormElement
<
TextField
onChange
=
{(
e
)
=>
{
inputChangeHandler
(
e
)
}}
onChange
=
{(
e
)
=>
{
inputChangeHandler
(
e
)
}}
name
=
{
"title"
}
name
=
{
"title"
}
label
=
{
"Название"
}
label
=
{
"Название"
}
state
=
{
projectTitle
}
value
=
{
projectTitle
}
id
=
"project-title"
variant
=
"outlined"
sx
=
{{
width
:
'100%'
}}
/
>
/
>
<
Box
sx
=
{{
display
:
'flex'
,
justifyContent
:
'space-between'
,
marginTop
:
'10px'
}}
>
<
Box
sx
=
{{
display
:
'flex'
,
justifyContent
:
'space-between'
,
marginTop
:
'10px'
}}
>
<
Button
<
Button
type
=
"submit"
type
=
"submit"
color
=
"primary"
color
=
"primary"
variant
=
"outlined"
variant
=
"outlined"
onClick
=
{()
=>
{
createNewProjectHandler
()
}}
onClick
=
{()
=>
{
createNewProjectHandler
()
}}
disabled
=
{
!
isValidate
(
projectTitle
)}
disabled
=
{
!
isValidate
(
projectTitle
)}
>
>
Создать
Создать
...
@@ -29,7 +31,7 @@ const NewProjectModalContent = ({ inputChangeHandler, projectTitle, createNewPro
...
@@ -29,7 +31,7 @@ const NewProjectModalContent = ({ inputChangeHandler, projectTitle, createNewPro
type
=
"submit"
type
=
"submit"
color
=
"primary"
color
=
"primary"
variant
=
"outlined"
variant
=
"outlined"
onClick
=
{()
=>
{
handleClose
()
}}
onClick
=
{()
=>
{
handleClose
()
}}
>
>
Отмена
Отмена
<
/Button
>
<
/Button
>
...
...
planner-front/src/components/UsersTasksCompoments/UsersTasksTableToolbar/UsersTasksTableToolbar.js
View file @
d0304198
...
@@ -4,7 +4,7 @@ import MultipleSelect from "../../UI/MultipleSelect/MultipleSelect";
...
@@ -4,7 +4,7 @@ import MultipleSelect from "../../UI/MultipleSelect/MultipleSelect";
import
CreateTaskFromButton
from
"./CreateTaskFromButton/CreateTaskFromButton"
;
import
CreateTaskFromButton
from
"./CreateTaskFromButton/CreateTaskFromButton"
;
function
UsersTasksTableToolbar
({
addFormStatus
,
createTaskFromButtonHandler
,
projects
,
onCloseFilterByProjects
,
projectIdListForTaskSelect
,
setProjectIdListForTaskSelect
,
activeTasks
On
,
setActiveTasksOn
})
{
function
UsersTasksTableToolbar
({
addFormStatus
,
createTaskFromButtonHandler
,
projects
,
onCloseFilterByProjects
,
projectIdListForTaskSelect
,
setProjectIdListForTaskSelect
,
activeTasks
Status
,
setActiveTasksStatus
})
{
const
projectsFilter
=
useMemo
(()
=>
{
const
projectsFilter
=
useMemo
(()
=>
{
if
(
Array
.
isArray
(
projects
))
{
if
(
Array
.
isArray
(
projects
))
{
...
@@ -31,7 +31,7 @@ return (
...
@@ -31,7 +31,7 @@ return (
Задачи
сотрудников
Задачи
сотрудников
<
/Typography
>
<
/Typography
>
<
FormControlLabel
<
FormControlLabel
control
=
{
<
Switch
color
=
'error'
checked
=
{
activeTasks
On
}
onChange
=
{()
=>
{
setActiveTasksOn
(
prevState
=>!
prevState
)
}}
/>
}
control
=
{
<
Switch
color
=
'error'
checked
=
{
activeTasks
Status
}
onChange
=
{()
=>
{
setActiveTasksStatus
(
prevState
=>!
prevState
)
}}
/>
}
label
=
"Активные задачи"
label
=
"Активные задачи"
labelPlacement
=
"end"
labelPlacement
=
"end"
/>
/>
...
...
planner-front/src/containers/MonthCalendar/MonthCalendar.js
View file @
d0304198
...
@@ -149,7 +149,7 @@ function MonthCalendar() {
...
@@ -149,7 +149,7 @@ function MonthCalendar() {
endHour
:
hourDue
,
endHour
:
hourDue
,
startDay
:
dayNumber
startDay
:
dayNumber
},
},
project
:
allUserProjects
[
0
]
.
id
project
:
allUserProjects
[
0
]
}
}
setCurrentTask
((
newTask
))
setCurrentTask
((
newTask
))
},
[
dateNow
.
month
,
dateNow
.
year
,
hourFormat
,
allUserProjects
])
},
[
dateNow
.
month
,
dateNow
.
year
,
hourFormat
,
allUserProjects
])
...
...
planner-front/src/containers/MyTasks/MyTasks.js
View file @
d0304198
...
@@ -39,7 +39,7 @@ export default function MyTasks() {
...
@@ -39,7 +39,7 @@ export default function MyTasks() {
const
[
rowsPerPage
,
setRowsPerPage
]
=
useState
(
10
);
const
[
rowsPerPage
,
setRowsPerPage
]
=
useState
(
10
);
const
[
addFormStatus
,
setAddFormStatus
]
=
useState
(
false
);
const
[
addFormStatus
,
setAddFormStatus
]
=
useState
(
false
);
const
[
projectIdListForTaskSelect
,
setProjectIdListForTaskSelect
]
=
useState
([]);
const
[
projectIdListForTaskSelect
,
setProjectIdListForTaskSelect
]
=
useState
([]);
const
[
activeTasks
On
,
setActiveTasksOn
]
=
useState
(
false
)
const
[
activeTasks
Status
,
setActiveTasksStatus
]
=
useState
(
false
)
useEffect
(()
=>
{
useEffect
(()
=>
{
dispatch
(
fetchAllTasks
());
dispatch
(
fetchAllTasks
());
...
@@ -48,8 +48,8 @@ export default function MyTasks() {
...
@@ -48,8 +48,8 @@ export default function MyTasks() {
},
[
dispatch
]);
},
[
dispatch
]);
useEffect
(()
=>
{
useEffect
(()
=>
{
dispatch
(
sortTaskByProjects
(
projectIdListForTaskSelect
,
activeTasks
On
))
dispatch
(
sortTaskByProjects
(
projectIdListForTaskSelect
,
activeTasks
Status
))
},
[
dispatch
,
projectIdListForTaskSelect
,
activeTasks
On
,
tasks
]);
},
[
dispatch
,
projectIdListForTaskSelect
,
activeTasks
Status
,
tasks
]);
const
onChangeNewTaskHandler
=
useCallback
((
e
)
=>
{
const
onChangeNewTaskHandler
=
useCallback
((
e
)
=>
{
...
@@ -184,8 +184,8 @@ export default function MyTasks() {
...
@@ -184,8 +184,8 @@ export default function MyTasks() {
projectIdListForTaskSelect
=
{
projectIdListForTaskSelect
}
projectIdListForTaskSelect
=
{
projectIdListForTaskSelect
}
setProjectIdListForTaskSelect
=
{
setProjectIdListForTaskSelect
}
setProjectIdListForTaskSelect
=
{
setProjectIdListForTaskSelect
}
projects
=
{
projects
.
projects
}
projects
=
{
projects
.
projects
}
activeTasks
On
=
{
activeTasksOn
}
activeTasks
Status
=
{
activeTasksStatus
}
setActiveTasks
On
=
{
setActiveTasksOn
}
setActiveTasks
Status
=
{
setActiveTasksStatus
}
/
>
/
>
<
MyTasksTableContainer
<
MyTasksTableContainer
order
=
{
order
}
order
=
{
order
}
...
...
planner-front/src/containers/Projects/Projects.js
View file @
d0304198
...
@@ -4,7 +4,6 @@ import { useDispatch, useSelector } from "react-redux";
...
@@ -4,7 +4,6 @@ import { useDispatch, useSelector } from "react-redux";
import
{
createProject
,
deleteProject
,
fetchProjects
}
from
"../../store/actions/projectsActions"
;
import
{
createProject
,
deleteProject
,
fetchProjects
}
from
"../../store/actions/projectsActions"
;
import
FullProject
from
"../FullProject/FullProject"
;
import
FullProject
from
"../FullProject/FullProject"
;
import
ProjectsWrapper
from
"../../components/ProjectsComponents/ProjectsWrapper/ProjectsWrapper"
;
import
ProjectsWrapper
from
"../../components/ProjectsComponents/ProjectsWrapper/ProjectsWrapper"
;
import
{
useNavigate
}
from
"react-router-dom"
;
import
DefaultModal
from
"../../components/UI/DefaultModal/DefaultModal"
;
import
DefaultModal
from
"../../components/UI/DefaultModal/DefaultModal"
;
import
NewProjectModalContent
from
"../../components/ProjectsComponents/NewProjectModalContent/NewProjectModalContent"
;
import
NewProjectModalContent
from
"../../components/ProjectsComponents/NewProjectModalContent/NewProjectModalContent"
;
...
@@ -13,7 +12,6 @@ const Projects = () => {
...
@@ -13,7 +12,6 @@ const Projects = () => {
const
{
user
}
=
useSelector
(
state
=>
state
.
users
)
const
{
user
}
=
useSelector
(
state
=>
state
.
users
)
const
dispatch
=
useDispatch
();
const
dispatch
=
useDispatch
();
const
navigate
=
useNavigate
()
const
[
currentProject
,
setCurrentProject
]
=
useState
(
null
)
const
[
currentProject
,
setCurrentProject
]
=
useState
(
null
)
const
[
projectTitle
,
setProjectTitle
]
=
useState
(
''
);
const
[
projectTitle
,
setProjectTitle
]
=
useState
(
''
);
...
@@ -47,11 +45,10 @@ const Projects = () => {
...
@@ -47,11 +45,10 @@ const Projects = () => {
const
handleClose
=
useCallback
(()
=>
{
const
handleClose
=
useCallback
(()
=>
{
setModal
(
false
)
setModal
(
false
)
setProjectTitle
(
''
)
},
[])
},
[])
console
.
log
(
currentProject
)
return
<>
return
<>
<
Grid
container
justifyContent
=
'space-between'
>
<
Grid
container
justifyContent
=
'space-between'
>
...
...
planner-front/src/containers/UsersTasks/UsersTasks.js
View file @
d0304198
...
@@ -40,7 +40,7 @@ export default function UsersTasks() {
...
@@ -40,7 +40,7 @@ export default function UsersTasks() {
const
[
rowsPerPage
,
setRowsPerPage
]
=
useState
(
10
);
const
[
rowsPerPage
,
setRowsPerPage
]
=
useState
(
10
);
const
[
addFormStatus
,
setAddFormStatus
]
=
useState
(
false
);
const
[
addFormStatus
,
setAddFormStatus
]
=
useState
(
false
);
const
[
projectIdListForTaskSelect
,
setProjectIdListForTaskSelect
]
=
useState
([]);
const
[
projectIdListForTaskSelect
,
setProjectIdListForTaskSelect
]
=
useState
([]);
const
[
activeTasks
On
,
setActiveTasksOn
]
=
useState
(
false
)
const
[
activeTasks
Status
,
setActiveTasksStatus
]
=
useState
(
false
)
useEffect
(()
=>
{
useEffect
(()
=>
{
dispatch
(
fetchAllTasksByMembership
());
dispatch
(
fetchAllTasksByMembership
());
...
@@ -49,8 +49,8 @@ export default function UsersTasks() {
...
@@ -49,8 +49,8 @@ export default function UsersTasks() {
},
[
dispatch
]);
},
[
dispatch
]);
useEffect
(()
=>
{
useEffect
(()
=>
{
dispatch
(
sortTaskByProjects
(
projectIdListForTaskSelect
,
activeTasks
On
))
dispatch
(
sortTaskByProjects
(
projectIdListForTaskSelect
,
activeTasks
Status
))
},
[
dispatch
,
projectIdListForTaskSelect
,
activeTasks
On
,
tasks
]);
},
[
dispatch
,
projectIdListForTaskSelect
,
activeTasks
Status
,
tasks
]);
const
onChangeNewTaskHandler
=
useCallback
((
e
)
=>
{
const
onChangeNewTaskHandler
=
useCallback
((
e
)
=>
{
...
@@ -195,8 +195,8 @@ export default function UsersTasks() {
...
@@ -195,8 +195,8 @@ export default function UsersTasks() {
projectIdListForTaskSelect
=
{
projectIdListForTaskSelect
}
projectIdListForTaskSelect
=
{
projectIdListForTaskSelect
}
setProjectIdListForTaskSelect
=
{
setProjectIdListForTaskSelect
}
setProjectIdListForTaskSelect
=
{
setProjectIdListForTaskSelect
}
projects
=
{
projects
.
projects
}
projects
=
{
projects
.
projects
}
activeTasks
On
=
{
activeTasksOn
}
activeTasks
Status
=
{
activeTasksStatus
}
setActiveTasks
On
=
{
setActiveTasksOn
}
setActiveTasks
Status
=
{
setActiveTasksStatus
}
/
>
/
>
<
UsersTasksTableContainer
<
UsersTasksTableContainer
order
=
{
order
}
order
=
{
order
}
...
...
planner-front/src/containers/WeekCalendar/WeekCalendar.js
View file @
d0304198
...
@@ -87,7 +87,7 @@ function WeekCalendar() {
...
@@ -87,7 +87,7 @@ function WeekCalendar() {
},
[])
},
[])
const
onChangeProjectHandler
=
useCallback
((
e
,
value
)
=>
{
const
onChangeProjectHandler
=
useCallback
((
e
,
value
)
=>
{
setWorkerInfo
((
prevState
)
=>
{
return
{
...
prevState
,
project
:
value
.
id
}
});
setWorkerInfo
((
prevState
)
=>
{
return
{
...
prevState
,
project
:
value
}
});
},
[]);
},
[]);
const
onChangeWorkerHandler
=
useCallback
((
e
,
value
)
=>
{
const
onChangeWorkerHandler
=
useCallback
((
e
,
value
)
=>
{
...
@@ -148,7 +148,7 @@ function WeekCalendar() {
...
@@ -148,7 +148,7 @@ function WeekCalendar() {
month
:
month
,
month
:
month
,
startYear
:
year
,
startYear
:
year
,
},
},
project
:
allUserProjects
[
0
]
?.
id
project
:
allUserProjects
[
0
]
}
}
setCurrentTask
((
newTask
))
setCurrentTask
((
newTask
))
},
[
hourFormat
,
allUserProjects
])
},
[
hourFormat
,
allUserProjects
])
...
...
planner-front/src/store/actions/tasksActions.js
View file @
d0304198
...
@@ -135,7 +135,7 @@ export const addTask = (task) => {
...
@@ -135,7 +135,7 @@ export const addTask = (task) => {
return
async
(
dispatch
)
=>
{
return
async
(
dispatch
)
=>
{
dispatch
(
addTaskRequest
());
dispatch
(
addTaskRequest
());
try
{
try
{
const
response
=
await
axios
.
post
(
"/tasks"
,
task
);
await
axios
.
post
(
"/tasks"
,
task
);
dispatch
(
addTaskSuccess
())
dispatch
(
addTaskSuccess
())
dispatch
(
fetchAllTasks
())
dispatch
(
fetchAllTasks
())
}
catch
(
error
)
{
}
catch
(
error
)
{
...
...
planner-front/src/store/reducers/tasksReducer.js
View file @
d0304198
...
@@ -48,7 +48,7 @@ const tasksReduсer = (state = initialState, action) => {
...
@@ -48,7 +48,7 @@ const tasksReduсer = (state = initialState, action) => {
for
(
let
copy
of
task
.
dateTimeTasks
)
{
for
(
let
copy
of
task
.
dateTimeTasks
)
{
newTasksWithoutInfoForCell
.
push
({
newTasksWithoutInfoForCell
.
push
({
...
copy
,
...
copy
,
project
:
task
?.
project
?.
id
,
project
:
task
?.
project
,
mainTaskId
:
task
.
id
,
mainTaskId
:
task
.
id
,
executor
:
task
.
executor
,
executor
:
task
.
executor
,
author
:
task
.
author
,
author
:
task
.
author
,
...
...
planner-front/src/store/reducers/usersReducer.js
View file @
d0304198
...
@@ -15,15 +15,12 @@ const usersReducer = (state = initialState, action) => {
...
@@ -15,15 +15,12 @@ const usersReducer = (state = initialState, action) => {
case
REGISTER_USER_REQUEST
:
case
REGISTER_USER_REQUEST
:
return
{...
state
,
loading
:
true
};
return
{...
state
,
loading
:
true
};
case
REGISTER_USER_SUCCESS
:
case
REGISTER_USER_SUCCESS
:
console
.
log
(
"register.user "
,
action
)
return
{...
state
,
loading
:
false
};
return
{...
state
,
loading
:
false
};
case
REGISTER_USER_FAILURE
:
case
REGISTER_USER_FAILURE
:
return
{...
state
,
loading
:
false
,
registerError
:
action
.
error
};
return
{...
state
,
loading
:
false
,
registerError
:
action
.
error
};
case
LOGIN_USER_SUCCESS
:
case
LOGIN_USER_SUCCESS
:
console
.
log
(
"action.user "
,
action
)
return
{...
state
,
user
:
action
.
user
};
return
{...
state
,
user
:
action
.
user
};
case
LOGIN_USER_FAILURE
:
case
LOGIN_USER_FAILURE
:
console
.
log
(
"action.error"
,
action
.
error
)
return
{...
state
,
loginError
:
action
.
error
};
return
{...
state
,
loginError
:
action
.
error
};
case
LOGOUT_USER_SUCCESS
:
case
LOGOUT_USER_SUCCESS
:
return
{...
state
,
user
:
null
};
return
{...
state
,
user
:
null
};
...
...
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