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
d0b9e49f
Commit
d0b9e49f
authored
Feb 16, 2023
by
Евгений Положенцев
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added lazy and suspense to all containers of the main page
parent
9b7cbd9d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
54 additions
and
15 deletions
+54
-15
MonthCalendar.js
planner-front/src/containers/MonthCalendar/MonthCalendar.js
+12
-4
MyTasks.js
planner-front/src/containers/MyTasks/MyTasks.js
+10
-3
Projects.js
planner-front/src/containers/Projects/Projects.js
+9
-3
UsersTasks.js
planner-front/src/containers/UsersTasks/UsersTasks.js
+6
-0
WeekCalendar.js
planner-front/src/containers/WeekCalendar/WeekCalendar.js
+17
-5
No files found.
planner-front/src/containers/MonthCalendar/MonthCalendar.js
View file @
d0b9e49f
import
{
useEffect
,
useCallback
,
useState
,
useMemo
}
from
'react'
;
import
{
useDispatch
,
useSelector
}
from
'react-redux'
;
import
CalendarModalWorkerContent
from
'../../components/Calendars/UI/CalendarModalWorkerContent/CalendarModalWorkerContent'
;
import
MonthCalendarBody
from
'../../components/Calendars/MonthCalendar/MonthCalendarBody/MonthCalendarBody'
;
import
MonthCalendarHeader
from
'../../components/Calendars/MonthCalendar/MonthCalendarHeader/MonthCalendarHeader'
;
import
DefaultModal
from
'../../components/UI/DefaultModal/DefaultModal'
;
//
import CalendarModalWorkerContent from '../../components/Calendars/UI/CalendarModalWorkerContent/CalendarModalWorkerContent';
//
import MonthCalendarBody from '../../components/Calendars/MonthCalendar/MonthCalendarBody/MonthCalendarBody';
//
import MonthCalendarHeader from '../../components/Calendars/MonthCalendar/MonthCalendarHeader/MonthCalendarHeader';
//
import DefaultModal from '../../components/UI/DefaultModal/DefaultModal';
import
{
dateToISOLikeButLocal
,
getCurrentMonthString
,
getDaysInMonth
}
from
'../../helpers/CalendarHelpers'
;
import
{
fetchAllUserProjects
,
fetchProject
}
from
'../../store/actions/projectsActions'
;
import
{
addCalendarTask
,
addCopyCalendarTask
,
deleteCalendarTask
,
editCalendarTask
,
fetchCalendarTasks
}
from
'../../store/actions/tasksActions'
;
import
{
fetchCurrentCalendarDisplayName
}
from
'../../store/actions/usersActions'
;
import
{
AllHoursOneHourFormat
,
AllHoursTwoHourFormat
}
from
'../../constants'
;
// make components mentioned above in lazy import
import
{
lazy
,
Suspense
}
from
'react'
;
const
CalendarModalWorkerContent
=
lazy
(()
=>
import
(
'../../components/Calendars/UI/CalendarModalWorkerContent/CalendarModalWorkerContent'
));
const
MonthCalendarBody
=
lazy
(()
=>
import
(
'../../components/Calendars/MonthCalendar/MonthCalendarBody/MonthCalendarBody'
));
const
MonthCalendarHeader
=
lazy
(()
=>
import
(
'../../components/Calendars/MonthCalendar/MonthCalendarHeader/MonthCalendarHeader'
));
const
DefaultModal
=
lazy
(()
=>
import
(
'../../components/UI/DefaultModal/DefaultModal'
));
function
MonthCalendar
()
{
const
dispatch
=
useDispatch
();
...
...
planner-front/src/containers/MyTasks/MyTasks.js
View file @
d0b9e49f
import
Paper
from
'@mui/material/Paper'
;
import
MyTasksTableToolbar
from
'../../components/MyTasksCompoments/MyTasksTableToolbar/MyTasksTableToolbar'
;
import
MyTasksTablePagination
from
'../../components/MyTasksCompoments/MyTasksTablePagination/MyTasksTablePagination'
;
import
MyTasksTableContainer
from
'../../components/MyTasksCompoments/MyTasksTableContainer/MyTasksTableContainer'
;
//
import MyTasksTableToolbar from '../../components/MyTasksCompoments/MyTasksTableToolbar/MyTasksTableToolbar';
//
import MyTasksTablePagination from '../../components/MyTasksCompoments/MyTasksTablePagination/MyTasksTablePagination';
//
import MyTasksTableContainer from '../../components/MyTasksCompoments/MyTasksTableContainer/MyTasksTableContainer';
import
{
activateCreateCopyTasksMode
,
fetchAllTasks
,
sortTaskByProjects
,
addTask
,
deleteTask
,
deleteDateTimeTask
,
editTask
}
from
'../../store/actions/tasksActions'
;
import
{
shallowEqual
,
useDispatch
,
useSelector
}
from
'react-redux'
;
import
{
useCallback
,
useEffect
,
useState
}
from
'react'
;
...
...
@@ -9,6 +9,13 @@ import { fetchAllUserProjects, fetchProjects } from '../../store/actions/project
import
moment
from
'moment'
;
import
{
useNavigate
}
from
'react-router-dom'
;
// make components mentioned above in lazy import
import
{
lazy
,
Suspense
}
from
"react"
;
const
MyTasksTableToolbar
=
lazy
(()
=>
import
(
"../../components/MyTasksCompoments/MyTasksTableToolbar/MyTasksTableToolbar"
));
const
MyTasksTablePagination
=
lazy
(()
=>
import
(
"../../components/MyTasksCompoments/MyTasksTablePagination/MyTasksTablePagination"
));
const
MyTasksTableContainer
=
lazy
(()
=>
import
(
"../../components/MyTasksCompoments/MyTasksTableContainer/MyTasksTableContainer"
));
export
default
function
MyTasks
()
{
const
dispatch
=
useDispatch
();
const
navigate
=
useNavigate
()
...
...
planner-front/src/containers/Projects/Projects.js
View file @
d0b9e49f
...
...
@@ -2,11 +2,17 @@ import { Grid } from "@mui/material";
import
{
useCallback
,
useEffect
,
useState
}
from
"react"
;
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
DefaultModal
from
"../../components/UI/DefaultModal/DefaultModal"
;
//
import FullProject from "../FullProject/FullProject";
//
import ProjectsWrapper from "../../components/ProjectsComponents/ProjectsWrapper/ProjectsWrapper";
//
import DefaultModal from "../../components/UI/DefaultModal/DefaultModal";
import
NewProjectModalContent
from
"../../components/ProjectsComponents/NewProjectModalContent/NewProjectModalContent"
;
// make components mentioned above in lazy import
import
{
lazy
,
Suspense
}
from
"react"
;
const
FullProject
=
lazy
(()
=>
import
(
"../FullProject/FullProject"
));
const
ProjectsWrapper
=
lazy
(()
=>
import
(
"../../components/ProjectsComponents/ProjectsWrapper/ProjectsWrapper"
));
const
DefaultModal
=
lazy
(()
=>
import
(
"../../components/UI/DefaultModal/DefaultModal"
));
const
Projects
=
()
=>
{
const
{
projects
}
=
useSelector
(
state
=>
state
.
projects
.
projects
);
const
{
user
}
=
useSelector
(
state
=>
state
.
users
)
...
...
planner-front/src/containers/UsersTasks/UsersTasks.js
View file @
d0b9e49f
...
...
@@ -9,6 +9,12 @@ import { fetchAllUserProjects, fetchProjects } from '../../store/actions/project
import
moment
from
'moment'
;
import
{
useNavigate
}
from
'react-router-dom'
;
import
{
lazy
}
from
"react"
;
// const UsersTasksTableToolbar = lazy(() => import("../../components/UsersTasksCompoments/UsersTasksTableToolbar/UsersTasksTableToolbar"));
// const UsersTasksTablePagination = lazy(() => import("../../components/UsersTasksCompoments/UsersTasksTablePagination/UsersTasksTablePagination"));
// const UsersTasksTableContainer = lazy(() => import("../../components/UsersTasksCompoments/UsersTasksTableContainer/UsersTasksTableContainer"));
export
default
function
UsersTasks
()
{
const
dispatch
=
useDispatch
();
const
navigate
=
useNavigate
()
...
...
planner-front/src/containers/WeekCalendar/WeekCalendar.js
View file @
d0b9e49f
...
...
@@ -3,17 +3,29 @@ import { useEffect, useState, useMemo, useCallback } from 'react';
import
{
useDispatch
,
useSelector
}
from
'react-redux'
;
import
{
useNavigate
}
from
'react-router-dom'
;
import
CreateCopyTasksModeBlock
from
'../../components/Calendars/CreateCopyTasksModeBlock/CreateCopyTasksModeBlock'
;
import
CalendarModalWorkerContent
from
'../../components/Calendars/UI/CalendarModalWorkerContent/CalendarModalWorkerContent'
;
import
WeekCalendarBody
from
'../../components/Calendars/WeekCalendar/WeekCalendarBody/WeekCalendarBody'
;
import
WeekCalendarHeader
from
'../../components/Calendars/WeekCalendar/WeekCalendarHeader/WeekCalendarHeader'
;
import
DefaultModal
from
'../../components/UI/DefaultModal/DefaultModal'
;
//
import CreateCopyTasksModeBlock from '../../components/Calendars/CreateCopyTasksModeBlock/CreateCopyTasksModeBlock';
//
import CalendarModalWorkerContent from '../../components/Calendars/UI/CalendarModalWorkerContent/CalendarModalWorkerContent';
//
import WeekCalendarBody from '../../components/Calendars/WeekCalendar/WeekCalendarBody/WeekCalendarBody';
//
import WeekCalendarHeader from '../../components/Calendars/WeekCalendar/WeekCalendarHeader/WeekCalendarHeader';
//
import DefaultModal from '../../components/UI/DefaultModal/DefaultModal';
import
{
AllHoursOneHourFormat
,
AllHoursTwoHourFormat
}
from
'../../constants'
;
import
{
getWeekInfoString
,
getWeekFromCurrentDate
,
dateToISOLikeButLocal
}
from
'../../helpers/CalendarHelpers'
;
import
{
fetchAllUserProjects
}
from
'../../store/actions/projectsActions'
;
import
{
addCalendarTask
,
addCopyCalendarTask
,
deactivateCreateCopyTasksMode
,
deleteCalendarTask
,
editCalendarTask
,
fetchCalendarTasks
}
from
'../../store/actions/tasksActions'
;
import
{
fetchCurrentCalendarDisplayName
}
from
'../../store/actions/usersActions'
;
// make components mentioned above in lazy import
import
{
lazy
,
Suspense
}
from
'react'
;
const
WeekCalendarBody
=
lazy
(()
=>
import
(
'../../components/Calendars/WeekCalendar/WeekCalendarBody/WeekCalendarBody'
));
const
WeekCalendarHeader
=
lazy
(()
=>
import
(
'../../components/Calendars/WeekCalendar/WeekCalendarHeader/WeekCalendarHeader'
));
const
CreateCopyTasksModeBlock
=
lazy
(()
=>
import
(
'../../components/Calendars/CreateCopyTasksModeBlock/CreateCopyTasksModeBlock'
));
const
CalendarModalWorkerContent
=
lazy
(()
=>
import
(
'../../components/Calendars/UI/CalendarModalWorkerContent/CalendarModalWorkerContent'
));
const
DefaultModal
=
lazy
(()
=>
import
(
'../../components/UI/DefaultModal/DefaultModal'
));
function
WeekCalendar
()
{
const
dispatch
=
useDispatch
();
const
navigate
=
useNavigate
()
...
...
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