diff --git a/src/App.js b/src/App.js index 09f15c57..ebacc0f0 100644 --- a/src/App.js +++ b/src/App.js @@ -106,22 +106,15 @@ const App = () => { } /> } /> - } /> } /> - - } /> - } /> - } /> - - } /> } /> } /> - } /> + } /> + } /> } /> - } /> } /> }/> } /> @@ -133,6 +126,11 @@ const App = () => { } /> } /> } /> + + } /> + } /> + } /> + { img
- +
diff --git a/src/components/Navigation/Navigation.jsx b/src/components/Navigation/Navigation.jsx index 3d5758f7..dc48a5dc 100644 --- a/src/components/Navigation/Navigation.jsx +++ b/src/components/Navigation/Navigation.jsx @@ -1,5 +1,5 @@ -import React, { useEffect, useState } from "react"; -import { useDispatch, useSelector } from "react-redux"; +import React, { useState } from "react"; +import { useSelector } from "react-redux"; import { NavLink } from "react-router-dom"; import { getProfileInfo } from "@redux/outstaffingSlice"; @@ -9,9 +9,8 @@ import { urlForLocal } from "@utils/helper"; import avatarMok from "assets/images/avatarMok.png"; export const Navigation = () => { - const dispatch = useDispatch(); - const profileInfo = useSelector(getProfileInfo); + const currentPath = window.location.pathname; const [user] = useState( localStorage.getItem("role_status") === "18" ? "partner" : "developer" ); @@ -35,7 +34,7 @@ export const Navigation = () => { name: "Выплаты" }, { - path: "/Quiz", + path: "/quiz", name: "Тесты" }, { @@ -81,6 +80,7 @@ export const Navigation = () => { key={index} end to={link.path === "/Quiz" ? link.path : `/profile${link.path}`} + className={currentPath.includes(link.path) ? "active" : ""} > {link.name} diff --git a/src/components/ProfileCalendar/ProfileCalendar.jsx b/src/components/ProfileCalendar/ProfileCalendar.jsx index e4077d09..6875cce9 100644 --- a/src/components/ProfileCalendar/ProfileCalendar.jsx +++ b/src/components/ProfileCalendar/ProfileCalendar.jsx @@ -98,7 +98,7 @@ export const ProfileCalendar = () => { {profileInfo.specification} разработчик

- + + {isFetching ? ( + + ) : ( + + )}

Всего за день:{" "} diff --git a/src/components/ShortReport/ShortReport.jsx b/src/components/ShortReport/ShortReport.jsx index 8e76afb4..c4b7238e 100644 --- a/src/components/ShortReport/ShortReport.jsx +++ b/src/components/ShortReport/ShortReport.jsx @@ -80,7 +80,9 @@ export const ShortReport = () => {

Ваши отчеты - просмотр отчета за день

- Посмотреть подробный отчет + + Посмотреть подробный отчет +
diff --git a/src/components/features/quiz/CardAviableTest.jsx b/src/components/features/quiz/CardAviableTest.jsx index 9a807ec3..a1c6d289 100644 --- a/src/components/features/quiz/CardAviableTest.jsx +++ b/src/components/features/quiz/CardAviableTest.jsx @@ -9,7 +9,11 @@ export const CardAvailableTest = ({ title, description, path, status }) => { return (
{ {status === 2 && (

Получить отчет по тестированию

- Отчет по тесту + Отчет по тесту
)}
diff --git a/src/pages/Quiz/PassingTests.js b/src/pages/Quiz/PassingTests.js index 7eeb83bb..bbf8ea2b 100644 --- a/src/pages/Quiz/PassingTests.js +++ b/src/pages/Quiz/PassingTests.js @@ -120,12 +120,12 @@ export const PassingTests = () => { ))}
)} - {!startTest && ( -
- ИЛИ выполните тестовое задание, без - прохождения тестов -
- )} + {/*{!startTest && (*/} + {/*
*/} + {/* ИЛИ выполните тестовое задание, без*/} + {/* прохождения тестов*/} + {/*
*/} + {/*)}*/} )} {completedTest && ( diff --git a/src/pages/Quiz/QuizPage.js b/src/pages/Quiz/QuizPage.js index 56778627..3778f4f8 100644 --- a/src/pages/Quiz/QuizPage.js +++ b/src/pages/Quiz/QuizPage.js @@ -144,10 +144,10 @@ export const QuizPage = () => {

Анкет нет

)} -
- ИЛИ выполните тестовое задание, без - прохождения тестов -
+ {/*
*/} + {/* ИЛИ выполните тестовое задание, без*/} + {/* прохождения тестов*/} + {/*
*/} )} {selectedCategory && ( diff --git a/src/pages/Quiz/QuizReportPage.js b/src/pages/Quiz/QuizReportPage.js index accf14be..7a30b1e8 100644 --- a/src/pages/Quiz/QuizReportPage.js +++ b/src/pages/Quiz/QuizReportPage.js @@ -42,8 +42,8 @@ export const QuizReportPage = () => {
diff --git a/src/pages/ViewReport/ViewReport.jsx b/src/pages/ViewReport/ViewReport.jsx index d9e5ffe6..ff378e6e 100644 --- a/src/pages/ViewReport/ViewReport.jsx +++ b/src/pages/ViewReport/ViewReport.jsx @@ -1,5 +1,5 @@ import React, { useEffect, useState } from "react"; -import { Link, Navigate, useParams } from "react-router-dom"; +import { Link, useParams } from "react-router-dom"; import { apiRequest } from "@api/request"; @@ -27,9 +27,11 @@ export const ViewReport = () => { const [taskText, setTaskText] = useState([]); const [difficulties, setDifficulties] = useState([]); const [tomorrowTask, setTomorrowTask] = useState([]); + const [taskId, setTaskId] = useState(""); const [totalHours, setTotalHours] = useState(0); const [currentDay] = useState(new Date()); const [loader, setLoader] = useState(false); + const [deleteLoader, setDeleteLoader] = useState(false); function getReportFromDate(day) { setLoader(true); @@ -39,6 +41,7 @@ export const ViewReport = () => { apiRequest(`reports/find-by-date?user_id=${params.id}&date=${day}`).then( (res) => { let spendTime = 0; + setTaskId(res[0]?.id); for (const item of res) { if (item.difficulties) { setDifficulties((prevArray) => [...prevArray, item.difficulties]); @@ -65,6 +68,18 @@ export const ViewReport = () => { nextReportDay.setDate(nextReportDay.getDate() + 1); } + function deleteReport() { + setDeleteLoader(true); + apiRequest(`reports/delete?id=${taskId}`, { + method: "DELETE" + }).then((res) => { + setDeleteLoader(false); + if (res) { + window.location.replace("/profile/calendar"); + } + }); + } + function nextDay() { getReportFromDate(getCreatedDate(nextReportDay)); previousReportDay.setDate(previousReportDay.getDate() + 2); @@ -110,22 +125,32 @@ export const ViewReport = () => { #

Вернуться

- {/*
-

- {getCorrectDate(dateReport.id)} -

-

- Вами потрачено на работу:{" "} - - {totalHours} {hourOfNum(totalHours)} - -

-
*/} + {localStorage.getItem("role_status") !== "18" && ( +
+ + {deleteLoader ? ( + + ) : ( + + )} +
+ )}
previousDay()}>
arrow @@ -141,7 +166,11 @@ export const ViewReport = () => { getCreatedDate(currentDay) === params.date ? "disable" : "" }`} > - +
arrow
diff --git a/src/pages/ViewReport/viewReport.scss b/src/pages/ViewReport/viewReport.scss index 87cb5070..8cfdae69 100644 --- a/src/pages/ViewReport/viewReport.scss +++ b/src/pages/ViewReport/viewReport.scss @@ -64,71 +64,34 @@ height: 72px; justify-content: space-between; - @media (max-width: 540px) { - padding: 10px 15px; - height: 60px; - } - - @media (max-width: 500px) { - column-gap: 0; - justify-content: space-between; - } - - &__date { - font-weight: 500; - font-size: 22px; - line-height: 32px; + button { color: #000000; - - @media (max-width: 660px) { - font-size: 16px; - } - - @media (max-width: 490px) { - font-size: 12px; - } - } - - &__hours { - font-weight: 400; font-size: 15px; + font-weight: 500; line-height: 32px; - color: #000000; - - @media (max-width: 660px) { - font-size: 11px; - } - - span { - color: #52B709; - font-weight: 700; - } + padding: 8px 24px; } - &__progressBar { - max-width: 390px; - width: 100%; - background: #F1F1F1; + &__edit { + background: #E1FCCF; + border-radius: 44px; + border: none; + } + + &__delete { + background: white; border-radius: 12px; - height: 8px; - position: relative; - - span { - position: absolute; - height: 100%; - left: 0; - width: 60%; - background: #52B709; - border-radius: 12px; - } + border: 1px dashed #8BCC60; } - &__total { - font-weight: 400; - font-size: 12px; - line-height: 32px; + .disable { + pointer-events: none; + opacity: 0.5; } + .loader { + max-width: 150px; + } } h3 {