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
value
=
{
project
}
name
=
{
'project'
}
variant
=
{
'outlined'
}
renderValue
=
{(
project
)
=>
project
?.
title
}
onChange
=
{(
e
)
=>
{
onChangeCurrentTaskHandler
(
e
)
}}
label
=
{
'Проект'
}
id
=
{
'project'
}
...
...
planner-front/src/components/MyTasksCompoments/MyTasksTableToolbar/MyTasksTableToolbar.js
View file @
d0304198
...
...
@@ -4,7 +4,7 @@ import MultipleSelect from "../../UI/MultipleSelect/MultipleSelect";
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
(()
=>
{
if
(
Array
.
isArray
(
projects
))
{
...
...
@@ -31,7 +31,7 @@ function MyTasksTableToolbar({ addFormStatus, createTaskFromButtonHandler, proje
Мои
задачи
<
/Typography
>
<
FormControlLabel
control
=
{
<
Switch
color
=
'error'
checked
=
{
activeTasks
On
}
onChange
=
{()
=>
{
setActiveTasksOn
(
prevState
=>!
prevState
)
}}
/>
}
control
=
{
<
Switch
color
=
'error'
checked
=
{
activeTasks
Status
}
onChange
=
{()
=>
{
setActiveTasksStatus
(
prevState
=>!
prevState
)
}}
/>
}
label
=
"Активные задачи"
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
{
memo
}
from
"react"
;
import
FormElement
from
"../../UI/Form/FormElement/FormElement"
import
{
isValidate
}
from
"./helpers"
;
...
...
@@ -9,18 +8,21 @@ const NewProjectModalContent = ({ inputChangeHandler, projectTitle, createNewPro
return
<>
<
FormElement
onChange
=
{(
e
)
=>
{
inputChangeHandler
(
e
)
}}
<
TextField
onChange
=
{(
e
)
=>
{
inputChangeHandler
(
e
)
}}
name
=
{
"title"
}
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
type
=
"submit"
color
=
"primary"
variant
=
"outlined"
onClick
=
{()
=>
{
createNewProjectHandler
()
}}
onClick
=
{()
=>
{
createNewProjectHandler
()
}}
disabled
=
{
!
isValidate
(
projectTitle
)}
>
Создать
...
...
@@ -29,7 +31,7 @@ const NewProjectModalContent = ({ inputChangeHandler, projectTitle, createNewPro
type
=
"submit"
color
=
"primary"
variant
=
"outlined"
onClick
=
{()
=>
{
handleClose
()
}}
onClick
=
{()
=>
{
handleClose
()
}}
>
Отмена
<
/Button
>
...
...
planner-front/src/components/UsersTasksCompoments/UsersTasksTableToolbar/UsersTasksTableToolbar.js
View file @
d0304198
...
...
@@ -4,7 +4,7 @@ import MultipleSelect from "../../UI/MultipleSelect/MultipleSelect";
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
(()
=>
{
if
(
Array
.
isArray
(
projects
))
{
...
...
@@ -31,7 +31,7 @@ return (
Задачи
сотрудников
<
/Typography
>
<
FormControlLabel
control
=
{
<
Switch
color
=
'error'
checked
=
{
activeTasks
On
}
onChange
=
{()
=>
{
setActiveTasksOn
(
prevState
=>!
prevState
)
}}
/>
}
control
=
{
<
Switch
color
=
'error'
checked
=
{
activeTasks
Status
}
onChange
=
{()
=>
{
setActiveTasksStatus
(
prevState
=>!
prevState
)
}}
/>
}
label
=
"Активные задачи"
labelPlacement
=
"end"
/>
...
...
planner-front/src/containers/MonthCalendar/MonthCalendar.js
View file @
d0304198
...
...
@@ -149,7 +149,7 @@ function MonthCalendar() {
endHour
:
hourDue
,
startDay
:
dayNumber
},
project
:
allUserProjects
[
0
]
.
id
project
:
allUserProjects
[
0
]
}
setCurrentTask
((
newTask
))
},
[
dateNow
.
month
,
dateNow
.
year
,
hourFormat
,
allUserProjects
])
...
...
planner-front/src/containers/MyTasks/MyTasks.js
View file @
d0304198
...
...
@@ -39,7 +39,7 @@ export default function MyTasks() {
const
[
rowsPerPage
,
setRowsPerPage
]
=
useState
(
10
);
const
[
addFormStatus
,
setAddFormStatus
]
=
useState
(
false
);
const
[
projectIdListForTaskSelect
,
setProjectIdListForTaskSelect
]
=
useState
([]);
const
[
activeTasks
On
,
setActiveTasksOn
]
=
useState
(
false
)
const
[
activeTasks
Status
,
setActiveTasksStatus
]
=
useState
(
false
)
useEffect
(()
=>
{
dispatch
(
fetchAllTasks
());
...
...
@@ -48,8 +48,8 @@ export default function MyTasks() {
},
[
dispatch
]);
useEffect
(()
=>
{
dispatch
(
sortTaskByProjects
(
projectIdListForTaskSelect
,
activeTasks
On
))
},
[
dispatch
,
projectIdListForTaskSelect
,
activeTasks
On
,
tasks
]);
dispatch
(
sortTaskByProjects
(
projectIdListForTaskSelect
,
activeTasks
Status
))
},
[
dispatch
,
projectIdListForTaskSelect
,
activeTasks
Status
,
tasks
]);
const
onChangeNewTaskHandler
=
useCallback
((
e
)
=>
{
...
...
@@ -184,8 +184,8 @@ export default function MyTasks() {
projectIdListForTaskSelect
=
{
projectIdListForTaskSelect
}
setProjectIdListForTaskSelect
=
{
setProjectIdListForTaskSelect
}
projects
=
{
projects
.
projects
}
activeTasks
On
=
{
activeTasksOn
}
setActiveTasks
On
=
{
setActiveTasksOn
}
activeTasks
Status
=
{
activeTasksStatus
}
setActiveTasks
Status
=
{
setActiveTasksStatus
}
/
>
<
MyTasksTableContainer
order
=
{
order
}
...
...
planner-front/src/containers/Projects/Projects.js
View file @
d0304198
...
...
@@ -4,7 +4,6 @@ import { useDispatch, useSelector } from "react-redux";
import
{
createProject
,
deleteProject
,
fetchProjects
}
from
"../../store/actions/projectsActions"
;
import
FullProject
from
"../FullProject/FullProject"
;
import
ProjectsWrapper
from
"../../components/ProjectsComponents/ProjectsWrapper/ProjectsWrapper"
;
import
{
useNavigate
}
from
"react-router-dom"
;
import
DefaultModal
from
"../../components/UI/DefaultModal/DefaultModal"
;
import
NewProjectModalContent
from
"../../components/ProjectsComponents/NewProjectModalContent/NewProjectModalContent"
;
...
...
@@ -13,7 +12,6 @@ const Projects = () => {
const
{
user
}
=
useSelector
(
state
=>
state
.
users
)
const
dispatch
=
useDispatch
();
const
navigate
=
useNavigate
()
const
[
currentProject
,
setCurrentProject
]
=
useState
(
null
)
const
[
projectTitle
,
setProjectTitle
]
=
useState
(
''
);
...
...
@@ -47,11 +45,10 @@ const Projects = () => {
const
handleClose
=
useCallback
(()
=>
{
setModal
(
false
)
setProjectTitle
(
''
)
},
[])
console
.
log
(
currentProject
)
return
<>
<
Grid
container
justifyContent
=
'space-between'
>
...
...
planner-front/src/containers/UsersTasks/UsersTasks.js
View file @
d0304198
...
...
@@ -40,7 +40,7 @@ export default function UsersTasks() {
const
[
rowsPerPage
,
setRowsPerPage
]
=
useState
(
10
);
const
[
addFormStatus
,
setAddFormStatus
]
=
useState
(
false
);
const
[
projectIdListForTaskSelect
,
setProjectIdListForTaskSelect
]
=
useState
([]);
const
[
activeTasks
On
,
setActiveTasksOn
]
=
useState
(
false
)
const
[
activeTasks
Status
,
setActiveTasksStatus
]
=
useState
(
false
)
useEffect
(()
=>
{
dispatch
(
fetchAllTasksByMembership
());
...
...
@@ -49,8 +49,8 @@ export default function UsersTasks() {
},
[
dispatch
]);
useEffect
(()
=>
{
dispatch
(
sortTaskByProjects
(
projectIdListForTaskSelect
,
activeTasks
On
))
},
[
dispatch
,
projectIdListForTaskSelect
,
activeTasks
On
,
tasks
]);
dispatch
(
sortTaskByProjects
(
projectIdListForTaskSelect
,
activeTasks
Status
))
},
[
dispatch
,
projectIdListForTaskSelect
,
activeTasks
Status
,
tasks
]);
const
onChangeNewTaskHandler
=
useCallback
((
e
)
=>
{
...
...
@@ -195,8 +195,8 @@ export default function UsersTasks() {
projectIdListForTaskSelect
=
{
projectIdListForTaskSelect
}
setProjectIdListForTaskSelect
=
{
setProjectIdListForTaskSelect
}
projects
=
{
projects
.
projects
}
activeTasks
On
=
{
activeTasksOn
}
setActiveTasks
On
=
{
setActiveTasksOn
}
activeTasks
Status
=
{
activeTasksStatus
}
setActiveTasks
Status
=
{
setActiveTasksStatus
}
/
>
<
UsersTasksTableContainer
order
=
{
order
}
...
...
planner-front/src/containers/WeekCalendar/WeekCalendar.js
View file @
d0304198
...
...
@@ -87,7 +87,7 @@ function WeekCalendar() {
},
[])
const
onChangeProjectHandler
=
useCallback
((
e
,
value
)
=>
{
setWorkerInfo
((
prevState
)
=>
{
return
{
...
prevState
,
project
:
value
.
id
}
});
setWorkerInfo
((
prevState
)
=>
{
return
{
...
prevState
,
project
:
value
}
});
},
[]);
const
onChangeWorkerHandler
=
useCallback
((
e
,
value
)
=>
{
...
...
@@ -148,7 +148,7 @@ function WeekCalendar() {
month
:
month
,
startYear
:
year
,
},
project
:
allUserProjects
[
0
]
?.
id
project
:
allUserProjects
[
0
]
}
setCurrentTask
((
newTask
))
},
[
hourFormat
,
allUserProjects
])
...
...
planner-front/src/store/actions/tasksActions.js
View file @
d0304198
...
...
@@ -135,7 +135,7 @@ export const addTask = (task) => {
return
async
(
dispatch
)
=>
{
dispatch
(
addTaskRequest
());
try
{
const
response
=
await
axios
.
post
(
"/tasks"
,
task
);
await
axios
.
post
(
"/tasks"
,
task
);
dispatch
(
addTaskSuccess
())
dispatch
(
fetchAllTasks
())
}
catch
(
error
)
{
...
...
planner-front/src/store/reducers/tasksReducer.js
View file @
d0304198
...
...
@@ -48,7 +48,7 @@ const tasksReduсer = (state = initialState, action) => {
for
(
let
copy
of
task
.
dateTimeTasks
)
{
newTasksWithoutInfoForCell
.
push
({
...
copy
,
project
:
task
?.
project
?.
id
,
project
:
task
?.
project
,
mainTaskId
:
task
.
id
,
executor
:
task
.
executor
,
author
:
task
.
author
,
...
...
planner-front/src/store/reducers/usersReducer.js
View file @
d0304198
...
...
@@ -15,15 +15,12 @@ const usersReducer = (state = initialState, action) => {
case
REGISTER_USER_REQUEST
:
return
{...
state
,
loading
:
true
};
case
REGISTER_USER_SUCCESS
:
console
.
log
(
"register.user "
,
action
)
return
{...
state
,
loading
:
false
};
case
REGISTER_USER_FAILURE
:
return
{...
state
,
loading
:
false
,
registerError
:
action
.
error
};
case
LOGIN_USER_SUCCESS
:
console
.
log
(
"action.user "
,
action
)
return
{...
state
,
user
:
action
.
user
};
case
LOGIN_USER_FAILURE
:
console
.
log
(
"action.error"
,
action
.
error
)
return
{...
state
,
loginError
:
action
.
error
};
case
LOGOUT_USER_SUCCESS
:
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