Compare commits

..

12 Commits

Author SHA1 Message Date
Mikola
1fd6a73652 active links in nav, delete report, loaders in report, changes routes 2024-02-07 18:54:55 +03:00
Mikola
b75b846335 active links in nav, delete report, loaders in report, changes routes 2024-02-07 18:54:21 +03:00
Victor Batischev
455be87e26 fix adaptive tracker tabs 2024-02-06 19:57:27 +03:00
Victor Batischev
8c68366152 add user by email 2024-02-06 18:59:08 +03:00
Victor Batischev
ef8a0813b3 small fix 2024-02-06 18:22:06 +03:00
Victor Batischev
e9235884dd fix layout min height 2024-02-05 17:32:18 +03:00
Victor Batischev
7a3a70ccd3 fix active nav link state 2024-02-05 17:14:30 +03:00
Victor Batischev
3cc306bbc3 fix adaptive layout in project list 2024-02-05 16:44:03 +03:00
4a81441d35 Merge pull request 'trackerTask' (#15) from trackerTask into main
Reviewed-on: #15
2024-02-02 18:46:03 +03:00
cdba3b4112 Merge pull request 'fix' (#14) from trackerTask into main
Reviewed-on: #14
2024-02-01 23:47:43 +03:00
d4f7b287d3 Merge pull request 'trackerTask' (#13) from trackerTask into main
Reviewed-on: #13
2024-02-01 23:32:46 +03:00
06f5cda1e8 Merge pull request 'trackerTask' (#12) from trackerTask into main
Reviewed-on: #12
2024-02-01 23:15:28 +03:00
38 changed files with 272 additions and 380 deletions

View File

@ -106,22 +106,15 @@ const App = () => {
<Route exact path="/candidate/:id/form" element={<FormPage />} />
<Route path="/:userId/calendar" element={<Calendar />} />
<Route exact path="/report" element={<ReportForm />} />
<Route path="/report/:id" element={<SingleReportPage />} />
<Route exact path="quiz">
<Route index element={<QuizPage />} />
<Route exact path="test/:uuid" element={<PassingTests />} />
<Route exact path="report/:uuid" element={<QuizReportPage />} />
</Route>
<Route exact path="profile">
<Route index element={<Profile />} />
<Route exact path="catalog" element={<Home />} />
<Route exact path="calendar" element={<ProfileCalendar />} />
<Route exact path="calendar/view/" element={<ProfileCalendar />} />
<Route exact path="calendar/report" element={<ReportForm />} />
<Route exact path="calendar/view/:date/:id" element={<ViewReport />} />
<Route exact path="summary" element={<Summary />} />
<Route exact path="view/:date/:id" element={<ViewReport />} />
<Route exact path="tracker" element={<Tracker />} />
<Route exact path="statistics/:id" element={<Statistics/>}/>
<Route exact path="payouts" element={<Payouts />} />
@ -133,6 +126,11 @@ const App = () => {
<Route exact path="employees" element={<PartnerCategories />} />
<Route exact path="employees/report/:uuid" element={<PartnerEmployeeReport />} />
<Route exact path="treaties" element={<PartnerTreaties />} />
<Route exact path="quiz">
<Route index element={<QuizPage />} />
<Route exact path="test/:uuid" element={<PassingTests />} />
<Route exact path="report/:uuid" element={<QuizReportPage />} />
</Route>
<Route
exact

View File

@ -24,9 +24,13 @@ const ArchiveTableTracker = ({ filterCompleteTasks, loader }) => {
);
})
) : (
<tr>
<td>
<div className="archive__noItem">
<p>В данном месяце у вас не было задач</p>
</div>
</td>
</tr>
)}
</>
)}

View File

@ -167,12 +167,8 @@
top: -20px;
@media (max-width: 900px) {
order: 1;
position: inherit;
right: inherit;
top: inherit;
top: 100px;
max-width: 115px;
margin-bottom: 35px;
}
}
}

View File

@ -60,7 +60,7 @@ const Calendar = () => {
<img className="calendar__title-img" src={rectangle} alt="img" />
</div>
<div>
<Link to="/report">
<Link to="/profile/calendar/report">
<button className="calendar__btn">Заполнить отчет</button>
</Link>
</div>

View File

@ -1,6 +1,6 @@
.calendar-component {
position: relative;
margin: 30px 0;
margin: 10px 0;
background-color: #f9f9f9;
padding: 20px 30px;
font-family: "LabGrotesque", sans-serif;
@ -94,7 +94,7 @@
}
&__rectangle {
margin: 20px 0;
margin: 10px 0;
img {
width: 100%;

View File

@ -48,7 +48,7 @@
text-decoration: none;
}
a:focus {
a:focus, a.active {
color: #000000;
}

View File

@ -133,9 +133,9 @@
.edit-project,
.add-worker,
.edit-column {
background: linear-gradient(180deg, #fff 0%, #ebebeb 37.29%);
// background: linear-gradient(180deg, #fff 0%, #ebebeb 37.29%);
.title-project {
margin-top: 20px;
margin-top: 8px;
}
.button-add {
margin-top: 8px;

View File

@ -1,8 +1,8 @@
.error-login {
position: relative;
padding: 54px 76px;
padding: 30px;
background: linear-gradient(180deg, #ffffff 0%, #ebebeb 100%);
border-radius: 40px;
border-radius: 20px;
display: flex;
flex-direction: column;
align-items: center;
@ -15,9 +15,7 @@
}
p {
font-size: 12px;
line-height: 14px;
width: 176px;
font-size: 15px;
text-align: center;
font-weight: 300;
margin-bottom: 30px;

View File

@ -616,7 +616,7 @@ export const TicketFullScreen = () => {
<div className="tracker__tabs__head">
<Link
to="/profile/tracker"
className="tab active-tab projectsTab"
className="tab active-tab"
onClick={() => toggleTabs(1)}
>
<img src={project} alt="img" />
@ -624,7 +624,7 @@ export const TicketFullScreen = () => {
</Link>
<Link
to="/profile/tracker"
className="tab tasksTab"
className="tab"
onClick={() => toggleTabs(2)}
>
<img src={tasks} alt="img" />
@ -632,7 +632,7 @@ export const TicketFullScreen = () => {
</Link>
<Link
to="/profile/tracker"
className="tab archiveTab"
className="tab"
onClick={() => toggleTabs(3)}
>
<img src={archive} alt="img" />
@ -972,7 +972,7 @@ export const TicketFullScreen = () => {
</div>
<div className="time">
<img src={watch}></img>
<span>Длительность : </span>
<span>Длительность: </span>
<p>
{correctTimerTime(currentTimerCount.hours)}:
{correctTimerTime(currentTimerCount.minute)}:

View File

@ -70,6 +70,7 @@ export const TrackerModal = ({
const [workers, setWorkers] = useState([]);
const [selectWorkersOpen, setSelectWorkersOpen] = useState(false);
const [selectedWorker, setSelectedWorker] = useState(null);
const [emailWorker, setEmailWorker] = useState("");
const [selectColumnPriority, setSelectColumnPriority] = useState(
"Выберите приоритет колонки"
);
@ -305,6 +306,19 @@ export const TrackerModal = ({
});
}
function inviteUserByEmail() {
apiRequest("/project/add-user-by-email", {
method: "POST",
data: {
email: emailWorker,
project_id: projectBoard.id
}
}).then((el) => {
setActive(false);
setEmailWorker("");
});
}
useEffect(() => {
modalType === "add-worker"
? apiRequest("/project/my-employee").then((el) => {
@ -386,26 +400,12 @@ export const TrackerModal = ({
};
return (
<ModalLayout
active={active}
setActive={setActive}
type={modalType}
// onClick={() => {
// setSelectWorkersOpen(false);
// }}
>
<ModalLayout active={active} setActive={setActive} type={modalType}>
{modalType === "add-worker" && (
<>
<div className="select__person">
<div className="title-project select-person">
<h4>Добавьте участника</h4>
{/*<div className="input-container">*/}
{/* <input*/}
{/* className="name-project"*/}
{/* value={emailWorker}*/}
{/* onChange={(e) => setEmailWorker(e.target.value)}*/}
{/* />*/}
{/*</div>*/}
<p className="select-person__info">
Выберите пользователя в проекте или добавьте по e-mail
</p>
@ -468,9 +468,14 @@ export const TrackerModal = ({
className="name-project"
placeholder="e-mail"
type="email"
value={emailWorker}
onChange={(e) => setEmailWorker(e.target.value)}
/>
</div>
<BaseButton styles={"button-add invite-person-block__btn"}>
<BaseButton
styles={"button-add invite-person-block__btn"}
onClick={inviteUserByEmail}
>
Отправить приглашение
</BaseButton>
</div>
@ -494,11 +499,6 @@ export const TrackerModal = ({
alt="avatar"
/>
</div>
{/*<span>Этап</span>*/}
{/*<div className="createTaskHead__selectColumn">*/}
{/* <span>Backlog</span>*/}
{/* <img src={arrowCreateTask} alt="arrow" />*/}
{/*</div>*/}
</div>
<div className="createTaskBody">
<div className="createTaskBody__left">
@ -793,7 +793,8 @@ export const TrackerModal = ({
{modalType === "edit-column" && (
<div>
<div className="title-project">
<h4>Введите новое название</h4>
<div>
<h4>Название колонки</h4>
<div className="input-container">
<input
className="name-project"
@ -801,6 +802,8 @@ export const TrackerModal = ({
onChange={(e) => dispatch(setColumnName(e.target.value))}
/>
</div>
</div>
<div>
<h4>Приоритет колонки</h4>
<div
className={
@ -832,16 +835,7 @@ export const TrackerModal = ({
</div>
)}
</div>
{/*<div className="input-container">*/}
{/* <input*/}
{/* className="name-project"*/}
{/* placeholder="Приоритет колонки"*/}
{/* type="number"*/}
{/* step="1"*/}
{/* value={columnPriority}*/}
{/* onChange={(e) => dispatch(setColumnPriority(e.target.value))}*/}
{/* />*/}
{/*</div>*/}
</div>
</div>
<BaseButton styles={"button-add"} onClick={changeColumnParams}>
Сохранить

View File

@ -30,13 +30,12 @@
display: flex;
align-items: center;
flex-direction: column;
row-gap: 8px;
padding-bottom: 10px;
row-gap: 12px;
padding-bottom: 15px;
.select-priority {
background-color: white;
width: 100%;
margin: 12px 0;
padding: 10px 8px;
border-radius: 8px;
font-size: 14px;

View File

@ -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: "Тесты"
},
{
@ -71,32 +70,17 @@ export const Navigation = () => {
]
});
useEffect(() => {
if (localStorage.getItem("role_status") === "18") {
return;
}
// if (Object.keys(profileInfo).length) {
// return;
// }
// apiRequest(`/user/me`).then((profileInfo) =>
// dispatch(
// setProfileInfo(
// profileInfo.userCard ? profileInfo.userCard : profileInfo
// )
// )
// );
}, []);
return (
<div className="profileHeader__info">
<div className="profileHeader__container">
<nav className="profileHeader__nav">
<div className="profile-header__info">
<div className="profile-header__container">
<nav className="profile-header__nav">
{navInfo[user].map((link, index) => {
return (
<NavLink
key={index}
end
to={link.path === "/Quiz" ? link.path : `/profile${link.path}`}
className={currentPath.includes(link.path) ? "active" : ""}
>
{link.name}
</NavLink>
@ -104,8 +88,8 @@ export const Navigation = () => {
})}
</nav>
<div className="profileHeader__personalInfo">
<h3 className="profileHeader__personalInfoName">
<div className="profile-header__personalInfo">
<h3 className="profile-header__personalInfoName">
{profileInfo?.fio ? profileInfo?.fio : profileInfo?.username}
</h3>
<NavLink end to={"/profile"}>
@ -113,7 +97,7 @@ export const Navigation = () => {
src={
profileInfo?.photo ? urlForLocal(profileInfo.photo) : avatarMok
}
className="profileHeader__personalInfoAvatar"
className="profile-header__personalInfoAvatar"
alt="avatar"
/>
</NavLink>

View File

@ -98,7 +98,7 @@ export const ProfileCalendar = () => {
{profileInfo.specification} разработчик
</p>
</div>
<Link to="/report">
<Link to="/profile/calendar/report">
<button
className="calendar__btn"
onClick={() => dispatch(setReportDate(""))}

View File

@ -96,9 +96,11 @@ export const ProfileCalendarComponent = React.memo(
)}-${correctDay(new Date(day).getDate())}` === date.created_at
) {
if (userId) {
return `../view/${date.created_at}/${userId}`;
return `/profile/calendar/view/${date.created_at}/${userId}`;
}
return `../view/${date.created_at}/${localStorage.getItem("id")}`;
return `/profile/calendar/view/${
date.created_at
}/${localStorage.getItem("id")}`;
}
}
@ -106,7 +108,7 @@ export const ProfileCalendarComponent = React.memo(
return "#";
}
return "../../report";
return "/profile/calendar/report";
}
const prevMonth = () => value.clone().subtract(1, "month");

View File

@ -33,7 +33,6 @@
}
.calendar__wrapper {
min-height: 719px;
@media (max-width: 1000px) {
min-height: auto;

View File

@ -20,19 +20,6 @@ export const ProfileHeader = () => {
const [isLoggingOut, setIsLoggingOut] = useState(false);
// useEffect(() => {
// if (Object.keys(profileInfo).length) {
// return;
// }
// apiRequest(`/user/me`).then((profileInfo) => {
// dispatch(
// setProfileInfo(
// profileInfo.userCard ? profileInfo.userCard : profileInfo
// )
// );
// });
// }, [dispatch]);
useEffect(() => {
if (!Object.keys(profileInfo).length)
apiRequest(`/user/me`).then((profileInfo) => {
@ -54,16 +41,16 @@ export const ProfileHeader = () => {
};
return (
<header className="profileHeader">
<div className="profileHeader__head">
<div className="profileHeader__container">
<NavLink to={"/profile"} className="profileHeader__title">
<header className="profile-header">
<div className="profile-header__head">
<div className="profile-header__container">
<NavLink to={"/profile"} className="profile-header__title">
itguild.
<span>
{user === "developer" ? "для разработчиков" : "для партнеров"}
</span>
</NavLink>
<button onClick={handler} className="profileHeader__logout">
<button onClick={handler} className="profile-header__logout">
{isLoggingOut ? <Loader /> : "Выйти"}
</button>
</div>

View File

@ -1,4 +1,4 @@
.profileHeader {
.profile-header {
width: 100%;
display: flex;
flex-direction: column;
@ -53,24 +53,24 @@
flex-wrap: wrap;
column-gap: 30px;
.active {
color: #000000 !important;
}
a {
text-decoration: none !important;
text-decoration: none;
cursor: pointer;
font-weight: 700;
font-size: 18px;
line-height: 32px;
color: #807777 !important;
color: #807777;
transition: all 0.3s ease;
&:hover {
color: #261a1a !important;
color: #261a1a;
}
}
a.active {
color: #000000;
}
@media (max-width: 800px) {
column-gap: 15px;

View File

@ -75,8 +75,6 @@ export const ProjectTicket = ({ project, index }) => {
setModalDelete(false);
}
function linkProject() {}
return (
<div className={`project project-${project.id}`} key={index}>
<Link

View File

@ -2,13 +2,11 @@
display: flex;
flex-direction: column;
position: relative;
width: 322px;
width: 300px;
background: #f1f1f1;
border-radius: 12px;
cursor: pointer;
max-width: 440px;
transition: 0.4s;
&:hover {
@ -26,15 +24,12 @@
&__link {
font-weight: 700;
width: 194px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-size: 18px;
line-height: 32px;
color: #111112;
margin-bottom: 22px;
max-width: 380px;
margin-bottom: 10px;
&:hover {
color: black;
@ -45,7 +40,7 @@
display: flex;
align-items: center;
position: relative;
margin-bottom: 45px;
margin-bottom: 30px;
p {
color: #6f6f6f;
@ -53,7 +48,6 @@
font-size: 12px;
font-weight: 500;
line-height: 17px;
width: 60px;
}
.count {
@ -97,13 +91,13 @@
}
&__open-tracker {
padding: 17px 26px 16px;
padding: 10px 15px;
}
&__statistics {
position: absolute;
bottom: 18px;
left: 26px;
bottom: 13px;
left: 15px;
color: #0042b4;
text-decoration: underline;
font-size: 14px;

View File

@ -87,10 +87,12 @@ const ReportForm = () => {
};
const handler = () => {
setIsFetching(true);
for (let input of inputs) {
if (!input.task || !input.hours_spent) {
setReportSuccess("Заполните задачи");
setTimeout(() => setReportSuccess(""), 2000);
setIsFetching(false);
return;
}
}
@ -292,12 +294,16 @@ const ReportForm = () => {
<div className="row">
<div className="col-12">
<div className="report-form__footer">
{isFetching ? (
<Loader style={"green"} />
) : (
<button
className="report-form__footer-btn"
onClick={() => handler()}
>
{isFetching ? <Loader /> : "Отправить"}
Отпаравить
</button>
)}
<p className="report-form__footer-text">
Всего за день:{" "}
<span>

View File

@ -80,7 +80,9 @@ export const ShortReport = () => {
<h2 className="viewReport__title">
Ваши отчеты - <span>просмотр отчета за день</span>
</h2>
<Link to={`../view/${dateCreate}`}>Посмотреть подробный отчет</Link>
<Link to={`/profile/calendar/view/${dateCreate}`}>
Посмотреть подробный отчет
</Link>
</div>
<div className="viewReport__bar">

View File

@ -9,7 +9,11 @@ export const CardAvailableTest = ({ title, description, path, status }) => {
return (
<div className="card-available-test">
<Link
to={status === 2 ? `/quiz/report/${path}` : `/quiz/test/${path}`}
to={
status === 2
? `/profile/quiz/report/${path}`
: `/profile/quiz/test/${path}`
}
aria-disabled={true}
className="card-available-test__container"
style={
@ -33,7 +37,7 @@ export const CardAvailableTest = ({ title, description, path, status }) => {
{status === 2 && (
<div className="card-available-test__finished">
<p>Получить отчет по тестированию</p>
<Link to={`/quiz/report/${path}`}>Отчет по тесту</Link>
<Link to={`/profile/quiz/report/${path}`}>Отчет по тесту</Link>
</div>
)}
</div>

View File

@ -25,13 +25,13 @@ export const QuizReport = ({ info }) => {
<div className="report__value">
{Boolean(correctAnswers()) ? correctAnswers() : 0}
</div>
<div className="report__text">Правильных ответов</div>
<div className="report__text">правильных ответов</div>
</div>
<div className="report__column">
<div className="report__value report__value_false">
{Boolean(correctWrongAnswers()) ? correctWrongAnswers() : 0}
</div>
<div className="report__text">Не правильных ответов</div>
<div className="report__text">неправильных ответов</div>
</div>
<div className="report__column">
<div className="report__status-text">Статус:</div>

View File

@ -505,12 +505,10 @@ $maxWidthContainer: 1123;
}
&__finished {
background: white;
mix-blend-mode: normal;
border: 3px solid #52b709;
border-radius: 12px;
padding: 13px 16px;
position: absolute;
bottom: 4px;
bottom: 20px;
left: 0;
display: flex;
align-items: center;

View File

@ -1,14 +0,0 @@
import React from "react";
import { ActContent } from "@components/features/bookkeeping/ActContent/ActContent";
import { BookkeepingTemplete } from "@components/features/bookkeeping/BookkeepingTemplete/BookkeepingTemplete";
export const ActPage = () => {
return (
<div>
<BookkeepingTemplete showBreadcrumps nameBreeadcrumps="Создание акта">
<ActContent></ActContent>
</BookkeepingTemplete>
</div>
);
};

View File

@ -15,7 +15,7 @@
&__about {
display: flex;
align-items: center;
margin-bottom: 30px;
margin: 30px 0;
@media (max-width: 600px) {
flex-wrap: wrap;
row-gap: 25px;

View File

@ -92,7 +92,7 @@ export const PartnerSettings = () => {
]}
/>
<div className="partner-settings">
<h2 className="infoPersonal__title">Настройки профиля</h2>
<h2 className="info-personal__title">Настройки профиля</h2>
<div className="partner-settings__body">
<div className="partner-settings__login">
<h3 className="settings__title">Вход в систему</h3>

View File

@ -4,7 +4,7 @@
min-height: 100vh;
font-family: "LabGrotesque", sans-serif;
.infoPersonal__title {
.info-personal__title {
color: #000000;
font-weight: 700;
font-size: 22px;
@ -12,6 +12,7 @@
}
&__page {
min-height: 750px;
max-width: 1160px !important;
margin-top: 23px;
}
@ -134,7 +135,7 @@
display: flex;
flex-direction: row;
justify-content: space-around;
margin-top: 27px;
margin-top: 50px;
}
&__report,

View File

@ -397,15 +397,8 @@ export const ProjectTracker = () => {
div.classList.contains("tags__list"))
)
) {
setTags({
open: false,
add: false,
edit: false
});
setTagInfo({
description: "",
name: ""
});
setTags({ open: false, add: false, edit: false });
setTagInfo({ description: "", name: "" });
setColor("#aabbcc");
}
@ -451,7 +444,7 @@ export const ProjectTracker = () => {
<div className="tracker__tabs__head">
<Link
to="/profile/tracker"
className="tab active-tab tab projectsTab"
className="tab active-tab tab"
onClick={() => dispatch(setToggleTab(1))}
>
<img src={project} alt="img" />
@ -459,7 +452,7 @@ export const ProjectTracker = () => {
</Link>
<Link
to="/profile/tracker"
className="tab tasksTab"
className="tab"
onClick={() => dispatch(setToggleTab(2))}
>
<img src={tasks} alt="img" />
@ -467,7 +460,7 @@ export const ProjectTracker = () => {
</Link>
<Link
to="/profile/tracker"
className="tab archiveTab"
className="tab"
onClick={() => dispatch(setToggleTab(3))}
>
<img src={archive} alt="img" />
@ -962,20 +955,11 @@ export const ProjectTracker = () => {
src={commentsBoard}
alt="commentsImg"
/>
<span>
{task.comment_count}{" "}
{/* {caseOfNum(
task.comment_count,
"comments"
)} */}
</span>
<span>{task.comment_count}</span>
</div>
<div className="tasks__board__item__info__more">
<img src={filesBoard} alt="filesImg" />
<span>
{task.file_count ? task.file_count : 0}{" "}
{/* {caseOfNum(0, "files")} */}
</span>
<span>{task.file_count}</span>
</div>
</div>
<TrackerSelectColumn

View File

@ -120,12 +120,12 @@ export const PassingTests = () => {
))}
</div>
)}
{!startTest && (
<div className="passing-tests-page__block-text block-text">
ИЛИ <Link to={""}>выполните тестовое задание</Link>, без
прохождения тестов
</div>
)}
{/*{!startTest && (*/}
{/* <div className="passing-tests-page__block-text block-text">*/}
{/* ИЛИ <Link to={""}>выполните тестовое задание</Link>, без*/}
{/* прохождения тестов*/}
{/* </div>*/}
{/*)}*/}
</>
)}
{completedTest && (

View File

@ -144,10 +144,10 @@ export const QuizPage = () => {
<h1>Анкет нет</h1>
)}
</div>
<div className="block-text">
ИЛИ <Link to={""}>выполните тестовое задание</Link>, без
прохождения тестов
</div>
{/*<div className="block-text">*/}
{/* ИЛИ <Link to={""}>выполните тестовое задание</Link>, без*/}
{/* прохождения тестов*/}
{/*</div>*/}
</>
)}
{selectedCategory && (

View File

@ -42,8 +42,8 @@ export const QuizReportPage = () => {
<ProfileBreadcrumbs
links={[
{ name: "Главная", link: "/profile-candidate" },
{ name: "Тестирование", link: "/Quiz" },
{ name: "Отчет по тестированию", link: "/Quiz/report" }
{ name: "Тестирование", link: "/profile/quiz" },
{ name: "Отчет по тестированию", link: "/profile/quiz" }
]}
/>
<div className="quiz-report-page__title main-title">

View File

@ -76,7 +76,7 @@ const Statistics = () => {
<div className="tracker__tabs__head">
<Link
to="/profile/tracker"
className="tab active-tab projectsTab"
className="tab active-tab"
onClick={() => toggleTabs(1)}
>
<img src={project} alt="img" />
@ -84,7 +84,7 @@ const Statistics = () => {
</Link>
<Link
to="/profile/tracker"
className="tab tasksTab"
className="tab"
onClick={() => toggleTabs(2)}
>
<img src={tasks} alt="img" />
@ -92,7 +92,7 @@ const Statistics = () => {
</Link>
<Link
to="/profile/tracker"
className="tab archiveTab"
className="tab"
onClick={() => toggleTabs(3)}
>
<img src={archive} alt="img" />

View File

@ -51,7 +51,6 @@ export const Tracker = () => {
const [allCompletedTasks, setAllCompletedTasks] = useState([]);
const [modalCreateProject, setModalCreateProject] = useState(false);
const tabs = ["projectsTab", "tasksTab", "archiveTab"];
useEffect(() => {
setLoader(true);
@ -143,32 +142,28 @@ export const Tracker = () => {
<div className="tracker__tabs">
<div className="tracker__tabs__head">
<div
className={
tab === 1 ? "tab active-tab projectsTab" : "tab projectsTab"
}
className={tab === 1 ? "tab active-tab" : "tab"}
onClick={() => toggleTabs(1)}
>
<img src={project} alt="img" />
<p>Проекты </p>
</div>
<div
className={tab === 2 ? "tab active-tab tasksTab" : "tab tasksTab"}
className={tab === 2 ? "tab active-tab" : "tab"}
onClick={() => toggleTabs(2)}
>
<img src={tasks} alt="img" />
<p>Все мои задачи</p>
</div>
<div
className={
tab === 3 ? "tab active-tab archiveTab" : "tab archiveTab"
}
className={tab === 3 ? "tab active-tab" : "tab"}
onClick={() => toggleTabs(3)}
>
<img src={archive} alt="img" />
<p>Архив</p>
</div>
</div>
<div className={`tracker__tabs__content ${tabs[tab - 1]}`}>
<div className={`tracker__tabs__content`}>
<div
className={
tab === 1
@ -201,7 +196,7 @@ export const Tracker = () => {
)) &&
!loader && (
<div className="no-projects">
<div className="no-projects__createNew">
<div className="no-projects__create-new">
<div>
<img src={noProjects} alt="noProjectImg" />
<p>Создайте свой первый проект</p>
@ -251,7 +246,7 @@ export const Tracker = () => {
<p>
{25} - {35}
</p>
<h2>Сентября,</h2>
<h3>Сентября,</h3>
<h3>2023</h3>
</div>

View File

@ -34,6 +34,7 @@
}
&__tabs {
min-height: 600px;
display: flex;
flex-direction: column;
@ -48,11 +49,9 @@
height: 60px;
@media (max-width: 650px) {
background: none;
justify-content: space-between;
position: relative;
top: 15px;
height: auto;
}
}
@ -89,22 +88,19 @@
}
@media (max-width: 650px) {
border-radius: 10px;
flex-direction: column;
padding: 20px;
align-items: start;
row-gap: 20px;
height: auto !important;
border-radius: 10px 10px 0 0;
padding: 10px;
align-items: center;
p {
margin-left: 0;
margin-left: 5px;
}
}
}
.active-tab {
background: white;
border-radius: 12px 12px 5px 5px;
border-radius: 12px 12px 0px 0px;
position: relative;
height: 73px;
display: flex;
@ -121,17 +117,15 @@
}
@media (max-width: 650px) {
border-radius: 10px;
align-items: start;
top: 0;
padding: 10px 20px;
}
}
&__content {
width: 100%;
background: #ffffff;
padding: 15px 0;
margin-bottom: 50px;
padding: 30px 0;
margin-bottom: 10px;
&__wrapper {
max-width: 1160px;
@ -145,10 +139,10 @@
row-gap: 30px;
display: none;
align-items: center;
justify-content: center;
@media (max-width: 785px) {
row-gap: 25px;
justify-content: center;
padding: 0 15px 20px;
}
@ -158,7 +152,7 @@
padding: 20px;
width: 100%;
&__createNew {
&__create-new {
display: flex;
div {
display: flex;
@ -177,14 +171,11 @@
}
.create-project-btn {
max-width: 322px;
width: 322px;
height: 166px;
width: 300px;
height: 113px;
border-radius: 12px;
background: #ecf8e5;
color: #000000;
font-weight: 400;
font-size: 15px;
display: flex;
align-items: center;
justify-content: center;
@ -192,10 +183,9 @@
&__text {
text-align: left;
font-size: 14px;
font-weight: 250;
width: 190px;
margin-left: 25px;
font-weight: 400;
font-size: 18px;
margin-left: 15px;
}
&:hover {
@ -203,10 +193,13 @@
box-shadow: 4px 4px 8px 0px rgba(34, 60, 80, 0.11);
}
@media (max-width: 650px) {
height: 40px;
font-size: 12px;
height: 166px;
@media (max-width: 1068px) {
width: 47%;
}
@media (max-width: 785px) {
max-width: 394px;
width: 100%;
}
}
}
@ -231,10 +224,6 @@
padding: 0 15px 15px;
}
@media (max-width: 650px) {
background-color: #dff1ff;
}
&__wrapper {
display: flex;
max-width: 1400px;
@ -1913,25 +1902,12 @@
@media (max-width: 650px) {
&__content {
padding: 28px 0 0;
background-color: #dff1ff;
.project {
background-color: white;
background-color: #eeeeee;
max-width: 394px;
}
}
.projectsTab {
background-color: #dff1ff;
}
.tasksTab {
background-color: #e8ffeb;
}
.archiveTab {
background-color: #ffecef;
}
}
}
}

View File

@ -94,13 +94,8 @@
top: -100px;
right: 58px;
@media (max-width: 1000px) {
position: inherit;
order: 1;
top: inherit;
right: inherit;
max-width: 115px;
margin-bottom: 25px;
@media (max-width: 900px) {
display: none;
}
}
}

View File

@ -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 = () => {
<img src={arrow} alt="#" />
<p>Вернуться</p>
</Link>
{/* <div className="viewReport__bar">
<h3 className="viewReport__bar__date">
{getCorrectDate(dateReport.id)}
</h3>
<p className="viewReport__bar__hours">
Вами потрачено на работу:{" "}
<span>
{totalHours} {hourOfNum(totalHours)}
</span>
</p>
</div> */}
{localStorage.getItem("role_status") !== "18" && (
<div className="viewReport__bar">
<button className="viewReport__bar__edit">Редактировать</button>
{deleteLoader ? (
<Loader style={"green"} />
) : (
<button
onClick={deleteReport}
className={
taskText.length
? "viewReport__bar__delete"
: "viewReport__bar__delete disable"
}
>
Удалить отчет
</button>
)}
</div>
)}
</div>
<div className="viewReport__switch-date">
<div onClick={() => previousDay()}>
<Link
to={`../view/${getCreatedDate(previousReportDay)}/${params.id}`}
to={`/profile/calendar/view/${getCreatedDate(
previousReportDay
)}/${params.id}`}
>
<div className="viewReport__switch-date__prev switch-date">
<img src={arrowSwitchDate} alt="arrow" />
@ -141,7 +166,11 @@ export const ViewReport = () => {
getCreatedDate(currentDay) === params.date ? "disable" : ""
}`}
>
<Link to={`../view/${getCreatedDate(nextReportDay)}/${params.id}`}>
<Link
to={`/profile/calendar/view/${getCreatedDate(nextReportDay)}/${
params.id
}`}
>
<div className={`viewReport__switch-date__next switch-date`}>
<img src={arrowSwitchDate} alt="arrow" />
</div>

View File

@ -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;
padding: 8px 24px;
}
span {
color: #52B709;
font-weight: 700;
}
&__edit {
background: #E1FCCF;
border-radius: 44px;
border: none;
}
&__progressBar {
max-width: 390px;
width: 100%;
background: #F1F1F1;
&__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 {