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 ( -
- -
-
-
- -
+const TournamentCurrentPlayerRankingPanel = () => ( +
+ +
+
+
+
+
); -}; export default memo(TournamentCurrentPlayerRankingPanel); diff --git a/services/app/apps/codebattle/assets/js/widgets/pages/game/TournamentRankingTable.jsx b/services/app/apps/codebattle/assets/js/widgets/pages/game/TournamentRankingTable.jsx index 1dc2c87ae..0a6c9acbb 100644 --- a/services/app/apps/codebattle/assets/js/widgets/pages/game/TournamentRankingTable.jsx +++ b/services/app/apps/codebattle/assets/js/widgets/pages/game/TournamentRankingTable.jsx @@ -29,7 +29,7 @@ const tableDataCellClassName = cn( const TournamentRankingTable = () => { const currentUserClanId = useSelector(currentUserClanIdSelector); const { ranking } = useSelector(tournamentSelector); - console.log(ranking) + console.log(ranking); return (
{
{item?.name.slice(0, 11) + (item?.name.length > 11 ? '...' : '')}
@@ -88,7 +90,9 @@ const TournamentRankingTable = () => {
{item?.clan?.slice(0, 11) + (item?.clan?.length > 11 ? '...' : '')}
diff --git a/services/app/apps/codebattle/assets/js/widgets/selectors/index.js b/services/app/apps/codebattle/assets/js/widgets/selectors/index.js index d2dc699cd..493230189 100644 --- a/services/app/apps/codebattle/assets/js/widgets/selectors/index.js +++ b/services/app/apps/codebattle/assets/js/widgets/selectors/index.js @@ -23,7 +23,7 @@ export const currentUserIdSelector = state => state.user.currentUserId; export const currentUserClanIdSelector = state => state.user.users[state.user.currentUserId].clanId; export const currentUserIsAdminSelector = state => !!state.user.users[state.user.currentUserId].isAdmin; -export const currentUserIsPremiumSelector = state => state.user.users[state.user.currentUserId].subscriptionType === SubscriptionTypeCodes.premium +export const currentUserIsPremiumSelector = state => state.user.users[state.user.currentUserId].subscriptionType === SubscriptionTypeCodes.premium; export const currentUserIsGuestSelector = state => !!state.user.users[state.user.currentUserId].isGuest;