diff --git a/services/app/apps/codebattle/assets/js/widgets/formik/index.js b/services/app/apps/codebattle/assets/js/widgets/formik/index.js index f81f4d4f7..16fe9f2c3 100644 --- a/services/app/apps/codebattle/assets/js/widgets/formik/index.js +++ b/services/app/apps/codebattle/assets/js/widgets/formik/index.js @@ -49,41 +49,41 @@ const schemas = { password: Yup.string().required('Password required'), }, signUp: { - name: Yup - .string() - .test( - 'start-or-end-with-empty-symbols', - 'Can\'t start or end with empty symbols', - value => { - if (!value) { - return true; - } - const invalidSymbolIndex = invalidSymbols.findIndex(invalidSymbol => ( - value.startsWith(invalidSymbol) || value.endsWith(invalidSymbol) - )); + name: Yup + .string() + .test( + 'start-or-end-with-empty-symbols', + 'Can\'t start or end with empty symbols', + value => { + if (!value) { + return true; + } + const invalidSymbolIndex = invalidSymbols.findIndex(invalidSymbol => ( + value.startsWith(invalidSymbol) || value.endsWith(invalidSymbol) + )); - return invalidSymbolIndex === -1; - }, - ) - .min(3, 'Should be from 3 to 16 characters') - .max(16, 'Should be from 3 to 16 characters') - .matches( - /^[a-zA-Z]+[a-zA-Z0-9_-\s{1}][a-zA-Z0-9_]+$/i, - 'Must consist of Latin letters, numbers and underscores. Only begin with latin letter', - ) - .required('Nickname required'), - email: emailSchema, - password: Yup - .string() - .matches(/^\S*$/, 'Can\'t contain empty symbols') - .min(6, 'Should be from 6 to 16 characters') - .max(16, 'Should be from 6 to 16 characters') - .matches(/[!@#$%^&*(),.?":{}|<>]/, 'Should contain at least one special character') - .required('Password required'), - passwordConfirmation: Yup - .string() - .required('Confirmation required') - .oneOf([Yup.ref('password')], 'Passwords must match'), + return invalidSymbolIndex === -1; + }, + ) + .min(3, 'Should be from 3 to 16 characters') + .max(16, 'Should be from 3 to 16 characters') + .matches( + /^[a-zA-Z]+[a-zA-Z0-9_-\s{1}][a-zA-Z0-9_]+$/i, + 'Must consist of Latin letters, numbers and underscores. Only begin with latin letter', + ) + .required('Nickname required'), + email: emailSchema, + password: Yup + .string() + .matches(/^\S*$/, 'Can\'t contain empty symbols') + .min(6, 'Should be from 6 to 16 characters') + .max(16, 'Should be from 6 to 16 characters') + .matches(/[!@#$%^&*(),.?":{}|<>/\\]/, 'Should contain at least one special character') + .required('Password required'), + passwordConfirmation: Yup + .string() + .required('Confirmation required') + .oneOf([Yup.ref('password')], 'Passwords must match'), }, }; diff --git a/services/app/apps/codebattle/assets/js/widgets/pages/game/InfoPanel.jsx b/services/app/apps/codebattle/assets/js/widgets/pages/game/InfoPanel.jsx index 8b065df0f..02df10dd4 100644 --- a/services/app/apps/codebattle/assets/js/widgets/pages/game/InfoPanel.jsx +++ b/services/app/apps/codebattle/assets/js/widgets/pages/game/InfoPanel.jsx @@ -1,7 +1,7 @@ import React, { useContext } from 'react'; -import { useSelector } from 'react-redux'; import i18next from 'i18next'; +import { useSelector } from 'react-redux'; import RoomContext from '../../components/RoomContext'; import { @@ -10,12 +10,12 @@ import { import * as selectors from '../../selectors'; import useMachineStateSelector from '../../utils/useMachineStateSelector'; -import TournamentCurrentPlayerRankingPanel from './TournamentCurrentPlayerRankingPanel'; import ChatWidget from './ChatWidget'; import Output from './Output'; import OutputTab from './OutputTab'; import TaskAssignment from './TaskAssignment'; import TimerContainer from './TimerContainer'; +import TournamentCurrentPlayerRankingPanel from './TournamentCurrentPlayerRankingPanel'; const InfoPanel = ({ idOutput = 'leftOutput', diff --git a/services/app/apps/codebattle/assets/js/widgets/pages/game/TournamentCurrentPlayerRankingPanel.jsx b/services/app/apps/codebattle/assets/js/widgets/pages/game/TournamentCurrentPlayerRankingPanel.jsx index 786ea0f52..c5c98bcd1 100644 --- a/services/app/apps/codebattle/assets/js/widgets/pages/game/TournamentCurrentPlayerRankingPanel.jsx +++ b/services/app/apps/codebattle/assets/js/widgets/pages/game/TournamentCurrentPlayerRankingPanel.jsx @@ -1,23 +1,21 @@ import React, { memo } from 'react'; -import TournamentRankingTable from './TournamentRankingTable'; import Notifications from './Notifications'; +import TournamentRankingTable from './TournamentRankingTable'; -const TournamentCurrentPlayerRankingPanel = () => { - return ( -