#166 remove of lazy import in week and month calendars , task tables , projects containers

parent 7074af30
...@@ -45,7 +45,6 @@ router.post('/', auth, async(req:Request, res:Response):Promise<Response>=>{ ...@@ -45,7 +45,6 @@ router.post('/', auth, async(req:Request, res:Response):Promise<Response>=>{
newTask.title = title; newTask.title = title;
newTask.description = description; newTask.description = description;
if (project) { if (project) {
const watcherOfProject = await dataSource const watcherOfProject = await dataSource
.getRepository(Project) .getRepository(Project)
.findOne({ .findOne({
......
import { useEffect, useCallback, useState, useMemo } from 'react'; import { useEffect, useCallback, useState, useMemo } from 'react';
import { useDispatch, useSelector } from 'react-redux'; import { useDispatch, useSelector } from 'react-redux';
// import CalendarModalWorkerContent from '../../components/Calendars/UI/CalendarModalWorkerContent/CalendarModalWorkerContent'; import CalendarModalWorkerContent from '../../components/Calendars/UI/CalendarModalWorkerContent/CalendarModalWorkerContent';
// import MonthCalendarBody from '../../components/Calendars/MonthCalendar/MonthCalendarBody/MonthCalendarBody'; import MonthCalendarBody from '../../components/Calendars/MonthCalendar/MonthCalendarBody/MonthCalendarBody';
// import MonthCalendarHeader from '../../components/Calendars/MonthCalendar/MonthCalendarHeader/MonthCalendarHeader'; import MonthCalendarHeader from '../../components/Calendars/MonthCalendar/MonthCalendarHeader/MonthCalendarHeader';
// import DefaultModal from '../../components/UI/DefaultModal/DefaultModal'; import DefaultModal from '../../components/UI/DefaultModal/DefaultModal';
import { dateToISOLikeButLocal, getCurrentMonthString, getDaysInMonth } from '../../helpers/CalendarHelpers'; import { dateToISOLikeButLocal, getCurrentMonthString, getDaysInMonth } from '../../helpers/CalendarHelpers';
import { fetchAllUserProjects, fetchProject } from '../../store/actions/projectsActions'; import { fetchAllUserProjects, fetchProject } from '../../store/actions/projectsActions';
import { addCalendarTask, addCopyCalendarTask, deleteCalendarTask, editCalendarTask, fetchCalendarTasks } from '../../store/actions/tasksActions'; import { addCalendarTask, addCopyCalendarTask, deleteCalendarTask, editCalendarTask, fetchCalendarTasks } from '../../store/actions/tasksActions';
import { fetchCurrentCalendarDisplayName } from '../../store/actions/usersActions'; import { fetchCurrentCalendarDisplayName } from '../../store/actions/usersActions';
import { AllHoursOneHourFormat, AllHoursTwoHourFormat } from '../../constants'; 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() { function MonthCalendar() {
const dispatch = useDispatch(); const dispatch = useDispatch();
......
import Paper from '@mui/material/Paper'; import Paper from '@mui/material/Paper';
// import MyTasksTableToolbar from '../../components/MyTasksCompoments/MyTasksTableToolbar/MyTasksTableToolbar'; import MyTasksTableToolbar from '../../components/MyTasksCompoments/MyTasksTableToolbar/MyTasksTableToolbar';
// import MyTasksTablePagination from '../../components/MyTasksCompoments/MyTasksTablePagination/MyTasksTablePagination'; import MyTasksTablePagination from '../../components/MyTasksCompoments/MyTasksTablePagination/MyTasksTablePagination';
// import MyTasksTableContainer from '../../components/MyTasksCompoments/MyTasksTableContainer/MyTasksTableContainer'; import MyTasksTableContainer from '../../components/MyTasksCompoments/MyTasksTableContainer/MyTasksTableContainer';
import { activateCreateCopyTasksMode, fetchAllTasks, sortTaskByProjects, addTask, deleteTask, deleteDateTimeTask, editTask } from '../../store/actions/tasksActions'; import { activateCreateCopyTasksMode, fetchAllTasks, sortTaskByProjects, addTask, deleteTask, deleteDateTimeTask, editTask } from '../../store/actions/tasksActions';
import { shallowEqual, useDispatch, useSelector } from 'react-redux'; import { shallowEqual, useDispatch, useSelector } from 'react-redux';
import { useCallback, useEffect, useState } from 'react'; import { useCallback, useEffect, useState } from 'react';
...@@ -9,12 +9,6 @@ import { fetchAllUserProjects, fetchProjects } from '../../store/actions/project ...@@ -9,12 +9,6 @@ import { fetchAllUserProjects, fetchProjects } from '../../store/actions/project
import moment from 'moment'; import moment from 'moment';
import { useNavigate } from 'react-router-dom'; 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() { export default function MyTasks() {
const dispatch = useDispatch(); const dispatch = useDispatch();
......
...@@ -2,17 +2,11 @@ import { Grid } from "@mui/material"; ...@@ -2,17 +2,11 @@ import { Grid } from "@mui/material";
import { useCallback, useEffect, useState } from "react"; import { useCallback, useEffect, useState } from "react";
import { useDispatch, useSelector } from "react-redux"; 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 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";
// 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 = () => {
const { projects } = useSelector(state => state.projects.projects); const { projects } = useSelector(state => state.projects.projects);
const { user } = useSelector(state => state.users) const { user } = useSelector(state => state.users)
......
...@@ -3,29 +3,18 @@ import { useEffect, useState, useMemo, useCallback } from 'react'; ...@@ -3,29 +3,18 @@ import { useEffect, useState, useMemo, useCallback } from 'react';
import { useDispatch, useSelector } from 'react-redux'; import { useDispatch, useSelector } from 'react-redux';
import { useNavigate } from 'react-router-dom'; import { useNavigate } from 'react-router-dom';
// import CreateCopyTasksModeBlock from '../../components/Calendars/CreateCopyTasksModeBlock/CreateCopyTasksModeBlock'; import CreateCopyTasksModeBlock from '../../components/Calendars/CreateCopyTasksModeBlock/CreateCopyTasksModeBlock';
// import CalendarModalWorkerContent from '../../components/Calendars/UI/CalendarModalWorkerContent/CalendarModalWorkerContent'; import CalendarModalWorkerContent from '../../components/Calendars/UI/CalendarModalWorkerContent/CalendarModalWorkerContent';
// import WeekCalendarBody from '../../components/Calendars/WeekCalendar/WeekCalendarBody/WeekCalendarBody'; import WeekCalendarBody from '../../components/Calendars/WeekCalendar/WeekCalendarBody/WeekCalendarBody';
// import WeekCalendarHeader from '../../components/Calendars/WeekCalendar/WeekCalendarHeader/WeekCalendarHeader'; import WeekCalendarHeader from '../../components/Calendars/WeekCalendar/WeekCalendarHeader/WeekCalendarHeader';
// import DefaultModal from '../../components/UI/DefaultModal/DefaultModal'; import DefaultModal from '../../components/UI/DefaultModal/DefaultModal';
import { AllHoursOneHourFormat, AllHoursTwoHourFormat } from '../../constants'; import { AllHoursOneHourFormat, AllHoursTwoHourFormat } from '../../constants';
import { getWeekInfoString, getWeekFromCurrentDate, dateToISOLikeButLocal } from '../../helpers/CalendarHelpers'; import { getWeekInfoString, getWeekFromCurrentDate, dateToISOLikeButLocal } from '../../helpers/CalendarHelpers';
import { fetchAllUserProjects } from '../../store/actions/projectsActions'; import { fetchAllUserProjects } from '../../store/actions/projectsActions';
import { addCalendarTask, addCopyCalendarTask, deactivateCreateCopyTasksMode, deleteCalendarTask, editCalendarTask, fetchCalendarTasks } from '../../store/actions/tasksActions'; import { addCalendarTask, addCopyCalendarTask, deactivateCreateCopyTasksMode, deleteCalendarTask, editCalendarTask, fetchCalendarTasks } from '../../store/actions/tasksActions';
import { fetchCurrentCalendarDisplayName } from '../../store/actions/usersActions'; 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() { function WeekCalendar() {
const dispatch = useDispatch(); const dispatch = useDispatch();
const navigate = useNavigate() const navigate = useNavigate()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment