merge branch and partnerRequest candidate

This commit is contained in:
Николай Полтщук 2023-04-19 22:42:46 +03:00
parent f4ada281da
commit 37d8ab385d
6 changed files with 99 additions and 137 deletions

View File

@ -1,3 +1,8 @@
footer {
border-top: 1px solid #ebebeb;
padding: 35px 0 50px;
}
.footer { .footer {
&__top { &__top {

View File

@ -3,7 +3,9 @@ import { NavLink } from 'react-router-dom'
import { urlForLocal } from '../../helper' import { urlForLocal } from '../../helper'
import { apiRequest } from '../../api/request'; import { apiRequest } from '../../api/request';
import { useDispatch, useSelector } from 'react-redux'; import { useDispatch, useSelector } from 'react-redux';
import { getProfileInfo } from '../../redux/outstaffingSlice'; import { getProfileInfo, setProfileInfo } from '../../redux/outstaffingSlice';
import avatarMok from "../../pages/PartnerTreaties/Images/avatarMok.png"
export const Navigation = () => { export const Navigation = () => {
const dispatch = useDispatch(); const dispatch = useDispatch();
@ -92,7 +94,7 @@ export const Navigation = () => {
} }
</h3> </h3>
<NavLink end to={'/profile'}> <NavLink end to={'/profile'}>
<img src={profileInfo.photo ? urlForLocal(profileInfo.photo) : ""} className='profileHeader__personalInfoAvatar' alt='avatar' /> <img src={profileInfo.photo ? urlForLocal(profileInfo.photo) : avatarMok} className='profileHeader__personalInfoAvatar' alt='avatar' />
</NavLink> </NavLink>
</div> </div>
</div> </div>

View File

@ -4,13 +4,8 @@ import {useDispatch, useSelector} from "react-redux";
import {Loader} from '../Loader/Loader' import {Loader} from '../Loader/Loader'
import {apiRequest} from "../../api/request"; import {apiRequest} from "../../api/request";
import {auth, getProfileInfo, setProfileInfo} from "../../redux/outstaffingSlice"; import {auth, setProfileInfo} from "../../redux/outstaffingSlice";
import {getRole} from "../../redux/roleSlice"; import {getRole} from "../../redux/roleSlice";
import {urlForLocal} from "../../helper";
import avatarMok from "../../pages/PartnerTreaties/Images/avatarMok.png"
import { Navigation } from '../Navigation/Navigation';
import './profileHeader.scss' import './profileHeader.scss'
@ -21,58 +16,7 @@ export const ProfileHeader = () => {
const userRole = useSelector(getRole); const userRole = useSelector(getRole);
const profileInfo = useSelector(getProfileInfo);
const [user] = useState(localStorage.getItem('role_status') === '18' ? 'partner' : 'developer') const [user] = useState(localStorage.getItem('role_status') === '18' ? 'partner' : 'developer')
const [navInfo] = useState({
developer: [
{
path: '/summary',
name: 'Резюме'
},
{
path: '/calendar',
name: 'Отчетность'
},
{
path: '/tracker',
name: 'Трекер'
},
{
path: '/payouts',
name: 'Выплаты'
},
{
path: '/settings',
name: 'Настройки'
},
],
partner: [
{
path: '/catalog',
name: 'Каталог'
},
{
path: '/requests',
name: 'Запросы'
},
{
path: '/categories',
name: 'Персонал'
},
{
path: '/tracker',
name: 'Трекер'
},
{
path: '/treaties',
name: 'Договора'
},
{
path: '/settings',
name: 'Настройки'
},
]
})
const [isLoggingOut, setIsLoggingOut] = useState(false); const [isLoggingOut, setIsLoggingOut] = useState(false);
@ -112,29 +56,6 @@ export const ProfileHeader = () => {
</button> </button>
</div> </div>
</div> </div>
<div className='profileHeader__info'>
<div className='profileHeader__container'>
<nav className='profileHeader__nav'>
{
navInfo[user].map((link, index) => {
return <NavLink key={index} end to={`/profile${link.path}`}>{link.name}</NavLink>
})
}
</nav>
<div className='profileHeader__personalInfo'>
<h3 className='profileHeader__personalInfoName'>
{user === 'developer' ?
profileInfo?.fio :
''
}
</h3>
<NavLink end to={'/profile'}>
<img src={profileInfo.photo ? urlForLocal(profileInfo.photo) : avatarMok} className='profileHeader__personalInfoAvatar' alt='avatar'/>
</NavLink>
</div>
</div>
</div>
</header> </header>
) )
}; };

View File

@ -1,32 +1,35 @@
import React, {useEffect, useState} from 'react'; import React, {useEffect, useState} from 'react';
import {Link, Navigate} from "react-router-dom"; import {Link, Navigate, useNavigate} from "react-router-dom";
import {useSelector, useDispatch} from 'react-redux' import {useSelector, useDispatch} from 'react-redux'
import {getPartnerRequestId, getPartnerRequests, setPartnerRequestId} from '../../redux/outstaffingSlice' import {getPartnerRequestId, getPartnerRequests, setPartnerRequestId} from '../../redux/outstaffingSlice'
import {ProfileHeader} from "../../components/ProfileHeader/ProfileHeader"; import {ProfileHeader} from "../../components/ProfileHeader/ProfileHeader";
import {ProfileBreadcrumbs} from "../../components/ProfileBreadcrumbs/ProfileBreadcrumbs" import {ProfileBreadcrumbs} from "../../components/ProfileBreadcrumbs/ProfileBreadcrumbs"
import {Footer} from "../../components/Footer/Footer"; import {Footer} from "../../components/Footer/Footer";
import { Navigation } from '../../components/Navigation/Navigation';
import {Loader} from "../../components/Loader/Loader" import {Loader} from "../../components/Loader/Loader"
import {apiRequest} from "../../api/request"; import {apiRequest} from "../../api/request";
import {getCorrectDate} from "../../components/Calendar/calendarHelper"; import {getCorrectDate} from "../../components/Calendar/calendarHelper";
import {urlForLocal} from '../../helper'
import arrowSwitchDate from "../../images/arrowViewReport.png"; import arrowSwitchDate from "../../images/arrowViewReport.png";
import backEndImg from "../../images/QualificationInfo.png"; import backEndImg from "../../images/QualificationInfo.png";
import middle from "../../images/QualificationInfoMiddle.png"; import middle from "../../images/QualificationInfoMiddle.png";
import personImg from "../../images/mokPerson.png"
import deleteBtn from "../../images/deleteBtn.png" import deleteBtn from "../../images/deleteBtn.png"
import './partnerBid.scss' import './partnerBid.scss'
import { Navigation } from '../../components/Navigation/Navigation';
export const PartnerBid = () => { export const PartnerBid = () => {
if(localStorage.getItem('role_status') !== '18') { if(localStorage.getItem('role_status') !== '18') {
return <Navigate to="/profile" replace/> return <Navigate to="/profile" replace/>
} }
const dispatch = useDispatch(); const dispatch = useDispatch();
const requestId = useSelector(getPartnerRequestId); const requestId = useSelector(getPartnerRequestId);
const partnerRequests = useSelector(getPartnerRequests); const partnerRequests = useSelector(getPartnerRequests);
const navigate= useNavigate();
if (!requestId) { if (!requestId) {
return <Navigate to="/profile/requests" replace/> return <Navigate to="/profile/requests" replace/>
@ -40,26 +43,33 @@ export const PartnerBid = () => {
}) })
}, [requestId]); }, [requestId]);
const deleteRequest = () => {
apiRequest('/request/update-request', {
method: 'PUT',
data: {
user_id: localStorage.getItem('id'),
request_id: requestId,
status: 0,
// title: 'bro',
// position_id: 1,
// knowledge_level_id: 2,
// specialist_count: 2,
// descr: 'broooooo',
// skill_ids: [1, 2, 3]
}
}).then((res) => {
navigate('/profile/requests');
})
};
const [requestInfo, setRequestInfo] = useState({}) const [requestInfo, setRequestInfo] = useState({})
const [loader, setLoader] = useState(false) const [loader, setLoader] = useState(false)
const [levels] = useState({
const [mokPersons] = useState([ 1: "Junior",
{ 2: "Middle",
name: 'Дмитрий, PHP Back end - разработчик, Middle', 3: "Middle+",
link: '/candidate/110', 4: "Senior",
img: personImg })
},
{
name: 'Дмитрий, PHP Back end - разработчик, Middle',
link: '/candidate/111',
img: personImg
},
{
name: 'Дмитрий, PHP Back end - разработчик, Middle',
link: '/candidate/112',
img: personImg
}
])
return ( return (
<div className='partnerBid'> <div className='partnerBid'>
<ProfileHeader /> <ProfileHeader />
@ -79,7 +89,7 @@ export const PartnerBid = () => {
<h3>{requestInfo.title}</h3> <h3>{requestInfo.title}</h3>
<div className='partnerBid__qualification__buttons'> <div className='partnerBid__qualification__buttons'>
<button>Редактировать</button> <button>Редактировать</button>
<img src={deleteBtn} alt='delete'/> <img src={deleteBtn} alt='delete' onClick={() => deleteRequest()}/>
</div> </div>
</div> </div>
<div className='partnerBid__switcher'> <div className='partnerBid__switcher'>
@ -102,6 +112,7 @@ export const PartnerBid = () => {
</> </>
} }
{Boolean(Object.keys(requestInfo).length) && !loader && {Boolean(Object.keys(requestInfo).length) && !loader &&
<>
<div className='table__wrapper'> <div className='table__wrapper'>
<table> <table>
<thead> <thead>
@ -150,27 +161,25 @@ export const PartnerBid = () => {
</tbody> </tbody>
</table> </table>
</div> </div>
} <div className='partnerBid__suitable'>
<div className='partnerBid__suitable'> <div className='partnerBid__suitable__title'>
<div className='partnerBid__suitable__title'> <p>Подходящие сотрудники по запросу</p>
<p>Подходящие сотрудники по запросу</p> </div>
</div> <div className='partnerBid__suitable__persons'>
<div className='partnerBid__suitable__persons'> {requestInfo.result_profiles.length && requestInfo.result_profiles.map((person, index) => {
{mokPersons.map((person, index) => { return <div key={index} className='partnerBid__suitable__person'>
return <div key={index} className='partnerBid__suitable__person'> <img src={urlForLocal(person.photo)} alt='avatar' />
<img src={person.img} alt='avatar' /> <p>{person.fio} - {person.position_title}, {levels[person.level]}</p>
<p>{person.name}</p> <Link className='partnerBid__suitable__person__more' to={`/candidate/${person.id}`}>
<Link className='partnerBid__suitable__person__more' to={person.link}> Подробнее
Подробнее </Link>
</Link>
<div className='partnerBid__suitable__person__info'>
</div> </div>
</div> })
}) }
} </div>
</div> </div>
</div> </>
}
</div> </div>
<Footer/> <Footer/>
</div> </div>

View File

@ -59,6 +59,7 @@
width: 44px; width: 44px;
height: 44px; height: 44px;
margin-left: 21px; margin-left: 21px;
cursor: pointer;
} }
} }
} }
@ -339,6 +340,30 @@
row-gap: 18px; row-gap: 18px;
position: relative; position: relative;
top: -15px; top: -15px;
max-height: 420px;
overflow: auto;
&::-webkit-scrollbar {
width: 4px;
background: 0 0;
box-shadow: 0 0 14px rgba(0, 0, 0, 0.04);
border-radius: 20px;
}
&::-webkit-scrollbar {
width: 4px;
border-radius: 20px;
}
&::-webkit-scrollbar-thumb {
background: #8db274;
border-radius: 20px;
}
&::-webkit-scrollbar-track {
background: #c5c0c6;
border-radius: 20px;
}
} }
&__person { &__person {
@ -353,8 +378,9 @@
} }
img { img {
width: 88px; max-width: 88px;
height: 88px; height: 88px;
width: 100%;
} }
p { p {
@ -364,6 +390,7 @@
line-height: 32px; line-height: 32px;
margin-left: 60px; margin-left: 60px;
position: relative; position: relative;
width: 100%;
&:after { &:after {
content: ""; content: "";

View File

@ -5,6 +5,8 @@ import {Link} from "react-router-dom";
import {ProfileHeader} from "../../components/ProfileHeader/ProfileHeader"; import {ProfileHeader} from "../../components/ProfileHeader/ProfileHeader";
import {ProfileBreadcrumbs} from "../../components/ProfileBreadcrumbs/ProfileBreadcrumbs" import {ProfileBreadcrumbs} from "../../components/ProfileBreadcrumbs/ProfileBreadcrumbs"
import {Footer} from "../../components/Footer/Footer"; import {Footer} from "../../components/Footer/Footer";
import { CardControl } from '../../components/CardControl/CardControl';
import { Navigation } from '../../components/Navigation/Navigation';
import {getProfileInfo} from "../../redux/outstaffingSlice"; import {getProfileInfo} from "../../redux/outstaffingSlice";
@ -17,11 +19,7 @@ import paymentIcon from "../../images/paymentIcon.png"
import settingIcon from "../../images/settingIcon.png" import settingIcon from "../../images/settingIcon.png"
import avatarMok from "../PartnerTreaties/Images/avatarMok.png" import avatarMok from "../PartnerTreaties/Images/avatarMok.png"
import rightArrow from "../../images/arrowRight.png"
import './profile.scss' import './profile.scss'
import { CardControl } from '../../components/CardControl/CardControl';
import { Navigation } from '../../components/Navigation/Navigation';
export const Profile = () => { export const Profile = () => {
@ -48,7 +46,7 @@ export const Profile = () => {
description: 'Сколько времени занимает<br/> выполнение задач' description: 'Сколько времени занимает<br/> выполнение задач'
}, },
{ {
path: '/payouts', path: 'profile/payouts',
img: paymentIcon, img: paymentIcon,
title: 'Выплаты', title: 'Выплаты',
description: 'У вас <span>подтвержден</span><br/> статус самозанятого' description: 'У вас <span>подтвержден</span><br/> статус самозанятого'