From 4bdfdd58ece81364f9c7432ee6de825a091e3c1b Mon Sep 17 00:00:00 2001 From: Victor Date: Tue, 31 May 2022 15:14:15 +0300 Subject: [PATCH] refactoring --- .idea/.gitignore | 5 ----- .idea/misc.xml | 6 ------ .idea/modules.xml | 8 -------- .idea/outstaffing-react.iml | 12 ------------ .idea/vcs.xml | 6 ------ package-lock.json | 36 ++++++++++++------------------------ public/index.html | 36 ++++++++++++++++++------------------ src/App.js | 29 ++++++++++++++++------------- src/index.js | 16 +++++++--------- src/server/authRedirect.js | 2 +- src/server/server.js | 7 +++---- 11 files changed, 57 insertions(+), 106 deletions(-) delete mode 100644 .idea/.gitignore delete mode 100644 .idea/misc.xml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/outstaffing-react.iml delete mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index ea7ed093..00000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Editor-based HTTP Client requests -/httpRequests/ diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 24eb271a..00000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index a3ad72bf..00000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/outstaffing-react.iml b/.idea/outstaffing-react.iml deleted file mode 100644 index 24643cc3..00000000 --- a/.idea/outstaffing-react.iml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7f..00000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index c21b2bb0..0a7d71f8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23889,8 +23889,7 @@ "@restart/context": { "version": "2.1.4", "resolved": "https://registry.npmjs.org/@restart/context/-/context-2.1.4.tgz", - "integrity": "sha512-INJYZQJP7g+IoDUh/475NlGiTeMfwTXUEr3tmRneckHIxNolGOW9CTq83S8cxq0CgJwwcMzMJFchxvlwe7Rk8Q==", - "requires": {} + "integrity": "sha512-INJYZQJP7g+IoDUh/475NlGiTeMfwTXUEr3tmRneckHIxNolGOW9CTq83S8cxq0CgJwwcMzMJFchxvlwe7Rk8Q==" }, "@restart/hooks": { "version": "0.3.26", @@ -24836,8 +24835,7 @@ "acorn-jsx": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz", - "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==", - "requires": {} + "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==" }, "acorn-walk": { "version": "7.2.0", @@ -24905,14 +24903,12 @@ "ajv-errors": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/ajv-errors/-/ajv-errors-1.0.1.tgz", - "integrity": "sha512-DCRfO/4nQ+89p/RK43i8Ezd41EqdGIU4ld7nGF8OQ14oc/we5rEntLCUa7+jrn3nn83BosfwZA0wb4pon2o8iQ==", - "requires": {} + "integrity": "sha512-DCRfO/4nQ+89p/RK43i8Ezd41EqdGIU4ld7nGF8OQ14oc/we5rEntLCUa7+jrn3nn83BosfwZA0wb4pon2o8iQ==" }, "ajv-keywords": { "version": "3.5.2", "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", - "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", - "requires": {} + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==" }, "alphanum-sort": { "version": "1.0.2", @@ -25380,8 +25376,7 @@ "babel-plugin-named-asset-import": { "version": "0.3.7", "resolved": "https://registry.npmjs.org/babel-plugin-named-asset-import/-/babel-plugin-named-asset-import-0.3.7.tgz", - "integrity": "sha512-squySRkf+6JGnvjoUtDEjSREJEBirnXi9NqP6rjSYsylxQxqBTz+pkmf395i9E2zsvmYUaI40BHo6SqZUdydlw==", - "requires": {} + "integrity": "sha512-squySRkf+6JGnvjoUtDEjSREJEBirnXi9NqP6rjSYsylxQxqBTz+pkmf395i9E2zsvmYUaI40BHo6SqZUdydlw==" }, "babel-plugin-polyfill-corejs2": { "version": "0.2.1", @@ -25813,8 +25808,7 @@ "bootstrap": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-4.6.0.tgz", - "integrity": "sha512-Io55IuQY3kydzHtbGvQya3H+KorS/M9rSNyfCGCg9WZ4pyT/lCxIlpJgG1GXW/PswzC84Tr2fBYi+7+jFVQQBw==", - "requires": {} + "integrity": "sha512-Io55IuQY3kydzHtbGvQya3H+KorS/M9rSNyfCGCg9WZ4pyT/lCxIlpJgG1GXW/PswzC84Tr2fBYi+7+jFVQQBw==" }, "brace-expansion": { "version": "1.1.11", @@ -28136,8 +28130,7 @@ "eslint-plugin-react-hooks": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.2.0.tgz", - "integrity": "sha512-623WEiZJqxR7VdxFCKLI6d6LLpwJkGPYKODnkH3D7WpOG5KM8yWueBd8TLsNAetEJNF5iJmolaAKO3F8yzyVBQ==", - "requires": {} + "integrity": "sha512-623WEiZJqxR7VdxFCKLI6d6LLpwJkGPYKODnkH3D7WpOG5KM8yWueBd8TLsNAetEJNF5iJmolaAKO3F8yzyVBQ==" }, "eslint-plugin-testing-library": { "version": "3.10.2", @@ -31036,8 +31029,7 @@ "jest-pnp-resolver": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz", - "integrity": "sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w==", - "requires": {} + "integrity": "sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w==" }, "jest-regex-util": { "version": "26.0.0", @@ -34869,8 +34861,7 @@ "react-from-dom": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/react-from-dom/-/react-from-dom-0.6.1.tgz", - "integrity": "sha512-7aAZx7LhRnmR51W5XtmTBYHGFl2n1AdEk1uoXLuzHa1OoGXrxOW/iwLcudvgp6BGX/l4Yh1rtMrIzvhlvbVddg==", - "requires": {} + "integrity": "sha512-7aAZx7LhRnmR51W5XtmTBYHGFl2n1AdEk1uoXLuzHa1OoGXrxOW/iwLcudvgp6BGX/l4Yh1rtMrIzvhlvbVddg==" }, "react-inlinesvg": { "version": "2.3.0", @@ -35051,8 +35042,7 @@ "react-yandex-metrika": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/react-yandex-metrika/-/react-yandex-metrika-2.6.0.tgz", - "integrity": "sha512-8K4wExsNZtY3DTxh1G8a+zWH9Pg8fw23MJcoJ4I/562qrHRnh7L5nteq3lnNL58dnNQbuuHIRoGgMjIo+r1GjA==", - "requires": {} + "integrity": "sha512-8K4wExsNZtY3DTxh1G8a+zWH9Pg8fw23MJcoJ4I/562qrHRnh7L5nteq3lnNL58dnNQbuuHIRoGgMjIo+r1GjA==" }, "read-pkg": { "version": "3.0.0", @@ -35179,8 +35169,7 @@ "redux-devtools-extension": { "version": "2.13.9", "resolved": "https://registry.npmjs.org/redux-devtools-extension/-/redux-devtools-extension-2.13.9.tgz", - "integrity": "sha512-cNJ8Q/EtjhQaZ71c8I9+BPySIBVEKssbPpskBfsXqb8HJ002A3KRVHfeRzwRo6mGPqsm7XuHTqNSNeS1Khig0A==", - "requires": {} + "integrity": "sha512-cNJ8Q/EtjhQaZ71c8I9+BPySIBVEKssbPpskBfsXqb8HJ002A3KRVHfeRzwRo6mGPqsm7XuHTqNSNeS1Khig0A==" }, "redux-thunk": { "version": "2.3.0", @@ -39004,8 +38993,7 @@ "ws": { "version": "7.4.5", "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.5.tgz", - "integrity": "sha512-xzyu3hFvomRfXKH8vOFMU3OguG6oOvhXMo3xsGy3xWExqaM2dxBbVxuD99O7m3ZUFMvvscsZDqxfgMaRr/Nr1g==", - "requires": {} + "integrity": "sha512-xzyu3hFvomRfXKH8vOFMU3OguG6oOvhXMo3xsGy3xWExqaM2dxBbVxuD99O7m3ZUFMvvscsZDqxfgMaRr/Nr1g==" }, "xml-name-validator": { "version": "3.0.0", diff --git a/public/index.html b/public/index.html index 84b7a470..0a18b703 100644 --- a/public/index.html +++ b/public/index.html @@ -1,22 +1,23 @@ + + + + + + - - - - - - + Аутстаффинг IT разработчиков в РФ + + - Аутстаффинг IT разработчиков в РФ - - - - - -
- +
+ - - - \ No newline at end of file + + diff --git a/src/App.js b/src/App.js index dc2ae016..c91f48fc 100644 --- a/src/App.js +++ b/src/App.js @@ -1,13 +1,12 @@ -import React, { Suspense, lazy, useEffect, useState } from 'react' +import React from 'react' import { BrowserRouter as Router, Route, Switch } from 'react-router-dom' -import { useSelector } from 'react-redux' -import { selectAuth } from './redux/outstaffingSlice' +// import { useSelector } from 'react-redux' +// import { selectAuth } from './redux/outstaffingSlice' import 'bootstrap/dist/css/bootstrap.min.css' import './fonts/stylesheet.css' import { ProtectedRoute } from './components/ProtectedRoute/ProtectedRoute' - -import { YMInitializer } from 'react-yandex-metrika' +// import { YMInitializer } from 'react-yandex-metrika' import AuthPageForDevelopers from './pages/AuthPageForDevelopers' import AuthPageForPartners from './pages/AuthPageForPartners' @@ -17,16 +16,16 @@ import CalendarPage from './pages/CalendarPage' import ReportPage from './pages/ReportFormPage.js' import FormPage from './pages/FormPage.js' import SingleReportPage from './pages/SingleReportPage' -import { Highlighter } from './pages/CodeSnippetPage' +// import { Highlighter } from './pages/CodeSnippetPage' import { QuizPage } from './pages/quiz/QuizPage' import { InterjacentPage } from './pages/quiz/InterjacentPage' import { QuizTestPage } from './pages/quiz/QuizTestPage' -import { Instruction } from './components/features/quiz/Instructions' +// import { Instruction } from './components/features/quiz/Instructions' import { InstructionPage } from './pages/quiz/InstructionPage' -import {ResultPage} from "./pages/quiz/ResultPage"; +import { ResultPage } from './pages/quiz/ResultPage' const App = (props) => { - const isAuth = useSelector(selectAuth) + // const isAuth = useSelector(selectAuth) return ( <>

IT Аутстаффинг в России

@@ -53,9 +52,15 @@ const App = (props) => { - + - +
Page not found
} /> @@ -76,5 +81,3 @@ const App = (props) => { } export default App - - diff --git a/src/index.js b/src/index.js index 6c4f1860..f0769642 100644 --- a/src/index.js +++ b/src/index.js @@ -1,16 +1,14 @@ -import React from 'react'; -import ReactDOM from 'react-dom'; -import { store } from './store/store'; -import { Provider } from 'react-redux'; -import App from './App'; +import React from 'react' +import ReactDOM from 'react-dom' +import { store } from './store/store' +import { Provider } from 'react-redux' +import App from './App' -import './index.css'; +import './index.css' ReactDOM.render( - <> - , document.getElementById('root') -); +) diff --git a/src/server/authRedirect.js b/src/server/authRedirect.js index 5c83b1cc..72c6c29b 100644 --- a/src/server/authRedirect.js +++ b/src/server/authRedirect.js @@ -6,7 +6,7 @@ export const withAuthRedirect = : link return actionCall(linkWithParams, body) .then((res) => { - if (res.status && res.status == 401) { + if (res.status && res.status === 401) { localStorage.clear() logout && logout() history.push(role === 'ROLE_DEV' ? '/authdev' : '/auth') diff --git a/src/server/server.js b/src/server/server.js index ff49d1e9..7e46446d 100644 --- a/src/server/server.js +++ b/src/server/server.js @@ -25,7 +25,6 @@ export const fetchAuth = async ({ dispatch, catchError }) => { - const baseURL = process.env.REACT_APP_BASE_URL const apiURL = process.env.REACT_APP_API_URL try { const response = await fetch(`${apiURL}/api/user/login`, { @@ -33,7 +32,7 @@ export const fetchAuth = async ({ mode: 'cors', headers: { 'Access-Control-Request-Headers': 'authorization', - 'Content-Type': 'application/json', + 'Content-Type': 'application/json' // Origin: `http://localhost` }, body: JSON.stringify({ @@ -98,7 +97,7 @@ export const fetchGet = withAuthRedirect(async (link) => { }) export const fetchPost = withAuthRedirect(async (link, body) => { - console.log('i',body) + console.log('i', body) try { const response = await fetch(link, { method: 'POST', @@ -106,7 +105,7 @@ export const fetchPost = withAuthRedirect(async (link, body) => { Authorization: `Bearer ${localStorage.getItem('auth_token')}`, 'Content-Type': 'application/json', //Origin: `http://localhost:3000` - Origin: `${process.env.REACT_APP_BASE_URL}`, + Origin: `${process.env.REACT_APP_BASE_URL}` }, body: JSON.stringify(body) })