Убираю варнинги при сборке, прохожусь притером, сокращаю код
This commit is contained in:
parent
c4d44e3855
commit
1234427b12
@ -3,12 +3,18 @@ export function createMarkup(text) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function transformHtml(text) {
|
export function transformHtml(text) {
|
||||||
let startHtml = {__html: text.split('<h2>').join('<br><h2>').split('<br>')}
|
let startHtml = {__html: text.split('<h2>').join('<br><h2>').split('<br>')};
|
||||||
startHtml = startHtml.__html.filter((el)=> {
|
startHtml = startHtml.__html.filter((el) =>
|
||||||
return (el != null && el != "" || el === 0)
|
el !== null && el !== "" || el === 0
|
||||||
})
|
);
|
||||||
const finalHtml = startHtml.map((item) => {
|
const finalHtml = startHtml.map((item) =>
|
||||||
return `<div class='experience__block'><div class="summary__sections__head"><h3>Описание опыта работы</h3><button>Редактировать раздел</button></div><div class="experience__content">${item.split('<h3>')[0]}</div></div>`
|
`<div class='experience__block'>
|
||||||
})
|
<div class="summary__sections__head">
|
||||||
|
<h3>Описание опыта работы</h3>
|
||||||
|
<button>Редактировать раздел</button>
|
||||||
|
</div>
|
||||||
|
<div class="experience__content">${item.split('<h3>')[0]}</div>
|
||||||
|
</div>`
|
||||||
|
);
|
||||||
return {__html: finalHtml.join('')}
|
return {__html: finalHtml.join('')}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import React, { useState } from 'react'
|
import React from 'react'
|
||||||
import { useDispatch, useSelector } from 'react-redux'
|
import { useDispatch, useSelector } from 'react-redux'
|
||||||
import { useHistory, useParams, Link } from 'react-router-dom'
|
import { useHistory, useParams } from 'react-router-dom'
|
||||||
import {
|
import {
|
||||||
currentCandidate,
|
currentCandidate,
|
||||||
selectCurrentCandidate,
|
selectCurrentCandidate,
|
||||||
@ -22,14 +22,14 @@ import { getRole } from '../redux/roleSlice'
|
|||||||
|
|
||||||
const goBack = (history) => {
|
const goBack = (history) => {
|
||||||
history.goBack()
|
history.goBack()
|
||||||
}
|
};
|
||||||
|
|
||||||
const FormPage = () => {
|
const FormPage = () => {
|
||||||
const params = useParams()
|
const params = useParams();
|
||||||
const history = useHistory()
|
const history = useHistory();
|
||||||
const dispatch = useDispatch()
|
const dispatch = useDispatch();
|
||||||
const candidate = useSelector(selectCurrentCandidate)
|
const candidate = useSelector(selectCurrentCandidate);
|
||||||
const role = useSelector(getRole)
|
const role = useSelector(getRole);
|
||||||
|
|
||||||
if (!candidate.id) {
|
if (!candidate.id) {
|
||||||
fetchGet({
|
fetchGet({
|
||||||
@ -56,7 +56,7 @@ const FormPage = () => {
|
|||||||
</div>
|
</div>
|
||||||
<div className='form-page__candidate'>
|
<div className='form-page__candidate'>
|
||||||
<div className='form-page__avatar'>
|
<div className='form-page__avatar'>
|
||||||
<img src={candidate.photo} />
|
<img src={candidate.photo} alt='candidate avatar'/>
|
||||||
</div>
|
</div>
|
||||||
<div className='form-page__candidate-info'>
|
<div className='form-page__candidate-info'>
|
||||||
<div className='form-page__position'>
|
<div className='form-page__position'>
|
||||||
@ -66,7 +66,7 @@ const FormPage = () => {
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div className='form-page__selected'>
|
<div className='form-page__selected'>
|
||||||
<img src={rectangle} />
|
<img src={rectangle} alt='rectangle'/>
|
||||||
<span>Выбранный кандидат</span>
|
<span>Выбранный кандидат</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -84,7 +84,7 @@ const FormPage = () => {
|
|||||||
Заявка на собеседование через телеграм
|
Заявка на собеседование через телеграм
|
||||||
</div>
|
</div>
|
||||||
<div className='form-page__telegram-icon'>
|
<div className='form-page__telegram-icon'>
|
||||||
<a href='https://t.me/st0kir' target='_blank'>
|
<a href='https://t.me/st0kir' target='_blank' rel="noreferrer">
|
||||||
<SVG src={telegramIcon} />
|
<SVG src={telegramIcon} />
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@ -94,6 +94,6 @@ const FormPage = () => {
|
|||||||
</div>
|
</div>
|
||||||
</WithLogout>
|
</WithLogout>
|
||||||
)
|
)
|
||||||
}
|
};
|
||||||
|
|
||||||
export default FormPage
|
export default FormPage
|
||||||
|
@ -22,7 +22,7 @@ const tasks = [
|
|||||||
text: 'Задача «83 – Навигационная система – Поиск по почтовому индексу – Добавить экран поиска по почтовому индексу» не может быть завершена, т.к. работа над задачей «82 – Навигационная система – Разработать модуль поиска по почтовому индексу» ещё не начата',
|
text: 'Задача «83 – Навигационная система – Поиск по почтовому индексу – Добавить экран поиска по почтовому индексу» не может быть завершена, т.к. работа над задачей «82 – Навигационная система – Разработать модуль поиска по почтовому индексу» ещё не начата',
|
||||||
hours: 3
|
hours: 3
|
||||||
}
|
}
|
||||||
]
|
];
|
||||||
|
|
||||||
const SingleReportPage = () => {
|
const SingleReportPage = () => {
|
||||||
return (
|
return (
|
||||||
@ -30,7 +30,7 @@ const SingleReportPage = () => {
|
|||||||
<div className='single-report-page'>
|
<div className='single-report-page'>
|
||||||
<div className='single-report-page__back'>
|
<div className='single-report-page__back'>
|
||||||
<div className='single-report-page__back-arrow'>
|
<div className='single-report-page__back-arrow'>
|
||||||
<img src={arrowLeft} />
|
<img src={arrowLeft} alt='arrowLeft'/>
|
||||||
</div>
|
</div>
|
||||||
<div className='single-report-page__back-text'>
|
<div className='single-report-page__back-text'>
|
||||||
Вернуться к списку
|
Вернуться к списку
|
||||||
@ -103,6 +103,6 @@ const SingleReportPage = () => {
|
|||||||
</div>
|
</div>
|
||||||
</WithLogout>
|
</WithLogout>
|
||||||
)
|
)
|
||||||
}
|
};
|
||||||
|
|
||||||
export default SingleReportPage
|
export default SingleReportPage
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import React, {useEffect, useState} from 'react';
|
import React, {useEffect, useState} from 'react';
|
||||||
import { ProfileHeader } from "../components/Profile/ProfileHeader";
|
import {ProfileHeader} from "../components/Profile/ProfileHeader";
|
||||||
import {getProfileInfo} from "../redux/outstaffingSlice";
|
import {getProfileInfo} from "../redux/outstaffingSlice";
|
||||||
import { useSelector } from "react-redux";
|
import {useSelector} from "react-redux";
|
||||||
import {transformHtml} from "../helper";
|
import {transformHtml} from "../helper";
|
||||||
import { Footer } from '../components/Footer/Footer'
|
import {Footer} from '../components/Footer/Footer'
|
||||||
|
|
||||||
import arrow from "../images/right-arrow.png";
|
import arrow from "../images/right-arrow.png";
|
||||||
import rightArrow from "../images/arrowRight.png"
|
import rightArrow from "../images/arrowRight.png"
|
||||||
@ -13,16 +13,16 @@ import '../components/Profile/summary.scss'
|
|||||||
import {fetchGet} from "../server/server";
|
import {fetchGet} from "../server/server";
|
||||||
|
|
||||||
export const Summary = () => {
|
export const Summary = () => {
|
||||||
const profileInfo = useSelector(getProfileInfo)
|
const profileInfo = useSelector(getProfileInfo);
|
||||||
const [openGit, setOpenGit] = useState(false);
|
const [openGit, setOpenGit] = useState(false);
|
||||||
const [gitInfo, setGitInfo] = useState([])
|
const [gitInfo, setGitInfo] = useState([]);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
fetchGet({
|
fetchGet({
|
||||||
link: `${process.env.REACT_APP_API_URL}/api/profile/portfolio-projects?card_id=${localStorage.getItem('cardId')}`,
|
link: `${process.env.REACT_APP_API_URL}/api/profile/portfolio-projects?card_id=${localStorage.getItem('cardId')}`,
|
||||||
}).then((responseGit) => {
|
}).then((responseGit) => {
|
||||||
setGitInfo(responseGit)
|
setGitInfo(responseGit)
|
||||||
})
|
})
|
||||||
}, [])
|
}, []);
|
||||||
return(
|
return(
|
||||||
<div className='summary'>
|
<div className='summary'>
|
||||||
<ProfileHeader/>
|
<ProfileHeader/>
|
||||||
@ -35,7 +35,7 @@ export const Summary = () => {
|
|||||||
</div>}
|
</div>}
|
||||||
<div className='summary__info'>
|
<div className='summary__info'>
|
||||||
<div className='summary__person'>
|
<div className='summary__person'>
|
||||||
<img src={profileInfo.photo} className='summary__avatar' />
|
<img src={profileInfo.photo} className='summary__avatar' alt='avatar'/>
|
||||||
<p className='summary__name'>{profileInfo.fio} {profileInfo.specification}</p>
|
<p className='summary__name'>{profileInfo.fio} {profileInfo.specification}</p>
|
||||||
</div>
|
</div>
|
||||||
{!openGit &&
|
{!openGit &&
|
||||||
@ -80,11 +80,11 @@ export const Summary = () => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className='gitItem__info__specification'>
|
<div className='gitItem__info__specification'>
|
||||||
<span></span>
|
<span className='gitItem__lineSkill'/>
|
||||||
<p>{itemGit.main_stack}</p>
|
<p>{itemGit.main_stack}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<a className='gitItem__link' href={itemGit.link} target="_blank">
|
<a className='gitItem__link' href={itemGit.link} target="_blank" rel="noreferrer">
|
||||||
<img src={rightArrow} alt='arrowRight' />
|
<img src={rightArrow} alt='arrowRight' />
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@ -97,5 +97,5 @@ export const Summary = () => {
|
|||||||
<Footer/>
|
<Footer/>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
};
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import {Link, Redirect} from 'react-router-dom'
|
import {Redirect} from 'react-router-dom'
|
||||||
import {HeaderPageTestsQuiz} from '../../components/features/quiz/HeaderPageTests'
|
import {HeaderPageTestsQuiz} from '../../components/features/quiz/HeaderPageTests'
|
||||||
import {Progressbar} from '../../components/features/quiz/ProgressbarQuiz'
|
|
||||||
import {TaskQuiz} from '../../components/features/quiz/Task'
|
import {TaskQuiz} from '../../components/features/quiz/Task'
|
||||||
import {useSelector} from "react-redux";
|
import {useSelector} from "react-redux";
|
||||||
import {selectedTest} from "../../redux/quizSlice";
|
import {selectedTest} from "../../redux/quizSlice";
|
||||||
@ -19,4 +18,4 @@ export const QuizTestPage = () => {
|
|||||||
<TaskQuiz/>
|
<TaskQuiz/>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
};
|
@ -1,4 +1,4 @@
|
|||||||
import {Link, Redirect} from "react-router-dom"
|
import {Redirect} from "react-router-dom"
|
||||||
import {HeaderPageTestsQuiz} from "../../components/features/quiz/HeaderPageTests"
|
import {HeaderPageTestsQuiz} from "../../components/features/quiz/HeaderPageTests"
|
||||||
import {Results} from "../../components/features/quiz/Results";
|
import {Results} from "../../components/features/quiz/Results";
|
||||||
import {useSelector} from "react-redux";
|
import {useSelector} from "react-redux";
|
||||||
@ -20,4 +20,4 @@ export const ResultPage = () => {
|
|||||||
<Results/>
|
<Results/>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
};
|
@ -1,5 +1,5 @@
|
|||||||
import {createAsyncThunk, createSlice} from '@reduxjs/toolkit';
|
import {createAsyncThunk, createSlice} from '@reduxjs/toolkit';
|
||||||
import {fetchGet, fetchPost} from './../server/server'
|
import {fetchGet} from './../server/server'
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
|
|
||||||
|
|
||||||
@ -17,17 +17,16 @@ export const setUserInfo = createAsyncThunk(
|
|||||||
'userInfo',
|
'userInfo',
|
||||||
async (id) => {
|
async (id) => {
|
||||||
try{
|
try{
|
||||||
const response = await fetchGet({
|
return await fetchGet({
|
||||||
link: `${process.env.REACT_APP_API_URL}/api/profile/get-main-data?user_id=${id}`,
|
link: `${process.env.REACT_APP_API_URL}/api/profile/get-main-data?user_id=${id}`,
|
||||||
Origin: `${process.env.REACT_APP_BASE_URL}`,
|
Origin: `${process.env.REACT_APP_BASE_URL}`,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
return response
|
|
||||||
}catch (e) {
|
}catch (e) {
|
||||||
console.log(e)
|
console.log(e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
);
|
||||||
|
|
||||||
export const fetchUserAnswersMany = createAsyncThunk(
|
export const fetchUserAnswersMany = createAsyncThunk(
|
||||||
'answersUserMany',
|
'answersUserMany',
|
||||||
@ -38,13 +37,13 @@ export const fetchUserAnswersMany = createAsyncThunk(
|
|||||||
headers: {
|
headers: {
|
||||||
Authorization: `Bearer ${localStorage.getItem('auth_token')}`,
|
Authorization: `Bearer ${localStorage.getItem('auth_token')}`,
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
return response.data
|
return response.data
|
||||||
}catch (e) {
|
}catch (e) {
|
||||||
console.log(e)
|
console.log(e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
);
|
||||||
export const fetchUserAnswerOne = createAsyncThunk(
|
export const fetchUserAnswerOne = createAsyncThunk(
|
||||||
'answersUserOne',
|
'answersUserOne',
|
||||||
async (checkedValues) => {
|
async (checkedValues) => {
|
||||||
@ -54,24 +53,23 @@ export const fetchUserAnswerOne = createAsyncThunk(
|
|||||||
headers: {
|
headers: {
|
||||||
Authorization: `Bearer ${localStorage.getItem('auth_token')}`,
|
Authorization: `Bearer ${localStorage.getItem('auth_token')}`,
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
return response.data
|
return response.data
|
||||||
}catch (e) {
|
}catch (e) {
|
||||||
console.log(e)
|
console.log(e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
);
|
||||||
export const fetchGetAnswers = createAsyncThunk(
|
export const fetchGetAnswers = createAsyncThunk(
|
||||||
'answers',
|
'answers',
|
||||||
async (question_id) => {
|
async (question_id) => {
|
||||||
const resp = await fetchGet({
|
return await fetchGet({
|
||||||
link: `${process.env.REACT_APP_API_URL}/api/answer/get-answers?question_id=${question_id}`,
|
link: `${process.env.REACT_APP_API_URL}/api/answer/get-answers?question_id=${question_id}`,
|
||||||
Origin: `${process.env.REACT_APP_BASE_URL}`,
|
Origin: `${process.env.REACT_APP_BASE_URL}`,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
return resp
|
|
||||||
}
|
}
|
||||||
)
|
);
|
||||||
// export const fetchGetQuestion = createAsyncThunk(
|
// export const fetchGetQuestion = createAsyncThunk(
|
||||||
// 'questions',
|
// 'questions',
|
||||||
// async (uuid) => {
|
// async (uuid) => {
|
||||||
@ -86,22 +84,21 @@ export const fetchGetAnswers = createAsyncThunk(
|
|||||||
export const fetchResultTest = createAsyncThunk(
|
export const fetchResultTest = createAsyncThunk(
|
||||||
'result',
|
'result',
|
||||||
async (uuid) => {
|
async (uuid) => {
|
||||||
const resp = await fetchGet({
|
return await fetchGet({
|
||||||
link: `${process.env.REACT_APP_API_URL}/api/user-questionnaire/questionnaire-completed?user_questionnaire_uuid=${uuid}`,
|
link: `${process.env.REACT_APP_API_URL}/api/user-questionnaire/questionnaire-completed?user_questionnaire_uuid=${uuid}`,
|
||||||
Origin: `${process.env.REACT_APP_BASE_URL}`,
|
Origin: `${process.env.REACT_APP_BASE_URL}`,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
return resp
|
|
||||||
|
|
||||||
}
|
}
|
||||||
)
|
);
|
||||||
|
|
||||||
export const quizSlice = createSlice({
|
export const quizSlice = createSlice({
|
||||||
name: 'quiz',
|
name: 'quiz',
|
||||||
initialState,
|
initialState,
|
||||||
reducers: {
|
reducers: {
|
||||||
setQuestionnairesList: (state, action) => {
|
setQuestionnairesList: (state, action) => {
|
||||||
state.dataQuestionnairesOfUser = action.payload
|
state.dataQuestionnairesOfUser = action.payload;
|
||||||
state.passedTests = action.payload.filter(item=>item.status === 2)
|
state.passedTests = action.payload.filter(item=>item.status === 2)
|
||||||
},
|
},
|
||||||
setSelectedTest: (state, action) => {
|
setSelectedTest: (state, action) => {
|
||||||
@ -123,11 +120,10 @@ export const quizSlice = createSlice({
|
|||||||
|
|
||||||
export const {setQuestionnairesList, setSelectedTest} = quizSlice.actions;
|
export const {setQuestionnairesList, setSelectedTest} = quizSlice.actions;
|
||||||
|
|
||||||
// export const selectQuestions = (state) => state.quiz.questions;
|
|
||||||
export const selectAnswer = (state) => state.quiz.answer;
|
export const selectAnswer = (state) => state.quiz.answer;
|
||||||
export const selectQuestionnairesOfUser = (state) => state.quiz.dataQuestionnairesOfUser;
|
export const selectQuestionnairesOfUser = (state) => state.quiz.dataQuestionnairesOfUser;
|
||||||
export const selectResult = (state) => state.quiz.result;
|
export const selectResult = (state) => state.quiz.result;
|
||||||
export const selectIsLoading = (state) => state.quiz.isLoading;
|
|
||||||
export const selectedTest = (state) => state.quiz.selectedTest;
|
export const selectedTest = (state) => state.quiz.selectedTest;
|
||||||
export const selectPassedTests = (state) => state.quiz.passedTests;
|
export const selectPassedTests = (state) => state.quiz.passedTests;
|
||||||
export const selectUserInfo = (state) => state.quiz.userInfo;
|
export const selectUserInfo = (state) => state.quiz.userInfo;
|
||||||
|
Loading…
Reference in New Issue
Block a user