diff --git a/apps/schools/domains/circle/components/circleList/index.tsx b/apps/schools/domains/circle/components/circleList/index.tsx
index 00118a0f..83b7faaf 100644
--- a/apps/schools/domains/circle/components/circleList/index.tsx
+++ b/apps/schools/domains/circle/components/circleList/index.tsx
@@ -13,6 +13,7 @@ import EmptyWrapper from '@domains/common/components/containers/EmptyWrapper'
import { mapReturnedData } from '@domains/common/redux/utils'
import { HighlightText } from '@domains/common/components/table/forming'
import { getVarsForAddressColumn } from '@domains/common/utils/geo'
+import { AppRoutes, RoutePath } from '@domains/common/constants/routerEnums'
export function CircleList() {
const [searchRequestText, setSearchRequestText] = useState('')
@@ -37,7 +38,7 @@ export function CircleList() {
pageTitle={'Кружки'}
data={circles}
isLoading={isFetching}
- handleRunTask={() => router.push('/circle/create')}
+ handleRunTask={() => router.push(RoutePath[AppRoutes.CIRCLE_CREATE])}
searchTrigger={searchRequestText}
>
@@ -46,7 +47,7 @@ export function CircleList() {
type='schoolDefault'
block
className={styles.button}
- onClick={() => router.push('/circle/create')}
+ onClick={() => router.push(RoutePath[AppRoutes.CIRCLE_CREATE])}
>
Добавить кружок
@@ -59,7 +60,7 @@ export function CircleList() {
]}
data={reformattedData}
isLoading={isFetching}
- mainRoute={'/circle'}
+ mainRoute={RoutePath[AppRoutes.CIRCLE_LIST]}
searchFields={['name', 'address']}
customFields={{
address: ({ text, searchText }) => {
diff --git a/apps/schools/domains/circle/components/currentCircle/index.tsx b/apps/schools/domains/circle/components/currentCircle/index.tsx
index 331b71f1..445718e9 100644
--- a/apps/schools/domains/circle/components/currentCircle/index.tsx
+++ b/apps/schools/domains/circle/components/currentCircle/index.tsx
@@ -25,6 +25,7 @@ import styles from './styles/styles.module.scss'
import { getVarsForAddressColumn } from '@domains/common/utils/geo'
import { QueryStatuses } from '@domains/common/constants/Enums'
import { ErrorType } from '@store/commonApi'
+import { AppRoutes, RoutePath } from '@domains/common/constants/routerEnums'
const CurrentCircle = () => {
const [isModalVisible, setIsModalVisible] = useState(false)
@@ -64,12 +65,12 @@ const CurrentCircle = () => {
useEffect(() => {
if (circleError && (circleError as ErrorType).status == 404) {
- router.push('/circle')
+ router.push(RoutePath[AppRoutes.CIRCLE_LIST])
}
}, [circleError])
if (isDeleteFinished.isSuccess) return null
- if (uuid.length === 0) router.push('/404')
+ if (uuid.length === 0) router.push(RoutePath[AppRoutes.NOT_FOUND])
return (
<>
@@ -138,7 +139,7 @@ const CurrentCircle = () => {
['Телефон родителя', 'parent_phones'],
]}
data={reformattedData}
- mainRoute={'/student'}
+ mainRoute={RoutePath[AppRoutes.STUDENT_LIST]}
isLoading={isLoading}
needNumbering={true}
searchFields={['student_name', 'student_phone', 'parent_names', 'parent_phones']}
@@ -151,7 +152,7 @@ const CurrentCircle = () => {
actions={[
,
@@ -174,7 +175,7 @@ const CurrentCircle = () => {
setIsModalVisible={setIsModalVisible}
titleText={'Удалить кружок?'}
buttonText={'Удалить кружок'}
- urlAfterDelete={'/circle'}
+ urlAfterDelete={RoutePath[AppRoutes.CIRCLE_LIST]}
dataField={'circle_id'}
/>
>
diff --git a/apps/schools/domains/circle/components/map/confirmMap/index.tsx b/apps/schools/domains/circle/components/map/confirmMap/index.tsx
index 979286fd..b39651b2 100644
--- a/apps/schools/domains/circle/components/map/confirmMap/index.tsx
+++ b/apps/schools/domains/circle/components/map/confirmMap/index.tsx
@@ -17,6 +17,7 @@ import { getUuidFromUrl } from '@domains/common/utils/getUuidFromUrl'
import { mapSteps } from '@domains/circle/interfaces/mapStepsType'
import { FormMapSteps } from '@domains/circle/constants/Enums'
import router from 'next/router'
+import { AppRoutes, RoutePath } from '@domains/common/constants/routerEnums'
interface MapComponentProps {
mode: 'Change' | 'Create'
@@ -175,11 +176,11 @@ const ConfirmMap = (props: MapComponentProps) => {
onClick={() => {
if (mode === 'Create') {
handleSubmitCreateForm(organizationId, mainForm, mutation).then((isSucceed) => {
- if (isSucceed) router.push('/circle')
+ if (isSucceed) router.push(RoutePath[AppRoutes.CIRCLE_LIST])
})
} else if (mode === 'Change') {
handleSubmitUpdateForm(circleId, mainForm, mutation).then((isSucceed) => {
- if (isSucceed) router.push(`/circle/${circleId}`)
+ if (isSucceed) router.push(`${RoutePath[AppRoutes.CIRCLE_LIST]}/${circleId}`)
})
}
}}
diff --git a/apps/schools/domains/common/components/containers/ErrorLayout/index.tsx b/apps/schools/domains/common/components/containers/ErrorLayout/index.tsx
index 0df534bf..8743fc3e 100644
--- a/apps/schools/domains/common/components/containers/ErrorLayout/index.tsx
+++ b/apps/schools/domains/common/components/containers/ErrorLayout/index.tsx
@@ -4,6 +4,7 @@ import Link from 'next/link'
import { Row } from 'antd'
import { CustomLogo } from '@domains/common/components/Logo'
import getConfig from 'next/config'
+import { AppRoutes, RoutePath } from '@domains/common/constants/routerEnums'
const {
publicRuntimeConfig: {
@@ -16,7 +17,7 @@ export const EmptyLayout: React.FC
= (props) => {
return (
-
+
diff --git a/apps/schools/domains/common/constants/routerEnums.ts b/apps/schools/domains/common/constants/routerEnums.ts
new file mode 100644
index 00000000..8f14da78
--- /dev/null
+++ b/apps/schools/domains/common/constants/routerEnums.ts
@@ -0,0 +1,37 @@
+export const enum AppRoutes {
+ AUTH = 'auth',
+ AUTH_SIGN_IN = 'auth_signin',
+ AUTH_REGISTER = 'auth_register',
+ AUTH_FORGOT = 'auth_forgot',
+ CIRCLE_LIST = 'circle',
+ CIRCLE_CREATE = 'circle_create',
+ EMPLOYEE_LIST = 'employee_list',
+ EMPLOYEE_CREATE = 'employee_create',
+ MAIN = 'main',
+ MOBILE_RECAPTCHA = 'mobile_recaptcha',
+ NOT_FOUND = 'not_found',
+ QUERY_LIST = 'query_list',
+ STUDENT_LIST = 'student_list',
+ STUDENT_CREATE = 'student_create',
+ USER_LIST = 'user_list',
+ USER_EDIT = 'user_edit',
+}
+
+export const RoutePath: Record
= {
+ [AppRoutes.AUTH]: '/auth',
+ [AppRoutes.AUTH_SIGN_IN]: '/auth/signin',
+ [AppRoutes.AUTH_REGISTER]: '/auth/register',
+ [AppRoutes.AUTH_FORGOT]: '/auth/forgot',
+ [AppRoutes.CIRCLE_LIST]: '/circle',
+ [AppRoutes.CIRCLE_CREATE]: '/circle/create',
+ [AppRoutes.EMPLOYEE_LIST]: '/employee',
+ [AppRoutes.EMPLOYEE_CREATE]: '/employee/create',
+ [AppRoutes.MAIN]: '/',
+ [AppRoutes.MOBILE_RECAPTCHA]: '/mobile-recaptcha',
+ [AppRoutes.NOT_FOUND]: '/404',
+ [AppRoutes.QUERY_LIST]: '/query',
+ [AppRoutes.STUDENT_LIST]: '/student',
+ [AppRoutes.STUDENT_CREATE]: '/student/create',
+ [AppRoutes.USER_LIST]: '/user',
+ [AppRoutes.USER_EDIT]: '/user/edit',
+}
diff --git a/apps/schools/domains/employee/components/changeEmployeeForm/index.tsx b/apps/schools/domains/employee/components/changeEmployeeForm/index.tsx
index c1d63fdb..03b1bbd3 100644
--- a/apps/schools/domains/employee/components/changeEmployeeForm/index.tsx
+++ b/apps/schools/domains/employee/components/changeEmployeeForm/index.tsx
@@ -16,6 +16,7 @@ import { useGetEmployeeQuery, useUpdateEmployeeByIdMutation } from '@domains/emp
import { useChangeEmployeeFormValidators } from '@domains/employee/components/changeEmployeeForm/hooks'
import { EMPLOYEE_NAME, EMPLOYEE_POSITION } from '@domains/employee/components/changeEmployeeForm/constants'
import { handleSubmitForm } from '@domains/employee/handlers/employeePatch'
+import { AppRoutes, RoutePath } from '@domains/common/constants/routerEnums'
export function ChangeEmployeeForm() {
const uuid = getUuidFromUrl()
@@ -32,11 +33,11 @@ export function ChangeEmployeeForm() {
useEffect(() => {
if (employeeError && (employeeError as ErrorType).status == 404) {
- router.push('/employee')
+ router.push(RoutePath[AppRoutes.EMPLOYEE_LIST])
}
}, [employeeError])
- if (uuid.length === 0) router.push('/404')
+ if (uuid.length === 0) router.push(RoutePath[AppRoutes.NOT_FOUND])
const validationCheck = () => {
setIsFormValid(isValidFormCheck(form, [], initialValues))
@@ -59,7 +60,7 @@ export function ChangeEmployeeForm() {
onValuesChange={validationCheck}
onFinish={() => {
handleSubmitForm(uuid[0], form, mutation).then((isSuccess) => {
- if (isSuccess) router.push(`/employee/${uuid[0]}`)
+ if (isSuccess) router.push(`${RoutePath[AppRoutes.EMPLOYEE_LIST]}/${uuid[0]}`)
})
}}
layout='vertical'
@@ -95,7 +96,7 @@ export function ChangeEmployeeForm() {
type='schoolDefaultAuto'
antdType={'default'}
block
- onClick={() => router.push(`/employee/${uuid[0]}`)}
+ onClick={() => router.push(`${RoutePath[AppRoutes.EMPLOYEE_LIST]}/${uuid[0]}`)}
>
Отменить
diff --git a/apps/schools/domains/employee/components/createEmployeeForm/index.tsx b/apps/schools/domains/employee/components/createEmployeeForm/index.tsx
index a4766017..01834f6a 100644
--- a/apps/schools/domains/employee/components/createEmployeeForm/index.tsx
+++ b/apps/schools/domains/employee/components/createEmployeeForm/index.tsx
@@ -7,7 +7,7 @@ import { useCreateEmployeeFormValidators } from './hooks'
import { useInviteEmployeeMutation } from '@domains/organization/redux/organizationApi'
import { useOrganization } from '@domains/organization/providers/organizationProvider'
import { handleSubmitForm } from '@domains/employee/handlers/employeeCreate'
-import { useRouter } from 'next/router'
+import router, { useRouter } from 'next/router'
import { WithTooltip } from '@domains/common/components/tooltip/withTooltip'
import { TOOLTIP_MARGIN } from '@domains/employee/components/createEmployeeForm/styles/styles'
import { isValidFormCheck } from '@domains/common/utils/form'
@@ -17,6 +17,7 @@ import {
EMPLOYEE_PHONE,
EMPLOYEE_POSITION,
} from '@domains/employee/components/createEmployeeForm/constants'
+import { AppRoutes, RoutePath } from '@domains/common/constants/routerEnums'
export const CreateEmployeeForm = () => {
const validators = useCreateEmployeeFormValidators()
@@ -39,7 +40,7 @@ export const CreateEmployeeForm = () => {
onValuesChange={validationCheck}
onFinish={() => {
handleSubmitForm(organizationId, form, mutation).then((isSucceed) => {
- if (isSucceed) router.push('/employee')
+ if (isSucceed) router.push(RoutePath[AppRoutes.EMPLOYEE_LIST])
})
}}
layout='vertical'
diff --git a/apps/schools/domains/employee/components/currentEmployee/index.tsx b/apps/schools/domains/employee/components/currentEmployee/index.tsx
index 9dd3d2f6..6426be7c 100644
--- a/apps/schools/domains/employee/components/currentEmployee/index.tsx
+++ b/apps/schools/domains/employee/components/currentEmployee/index.tsx
@@ -13,6 +13,7 @@ import { Field } from '@domains/common/components/field'
import { ActionBar } from '@domains/common/components/stickyBlock/actionBar'
import DeleteModal from '@domains/common/components/deleteModal'
import { useDeleteEmployeeByIdMutation, useGetEmployeeQuery } from '@domains/employee/redux/employeeApi'
+import { AppRoutes, RoutePath } from '@domains/common/constants/routerEnums'
const CurrentEmployee = () => {
const [isModalVisible, setIsModalVisible] = useState(false)
@@ -29,12 +30,12 @@ const CurrentEmployee = () => {
useEffect(() => {
if (employeeError && (employeeError as ErrorType).status == 404) {
- router.push('/employee')
+ router.push(RoutePath[AppRoutes.EMPLOYEE_LIST])
}
}, [employeeError])
if (isDeleteFinished.isSuccess) return null
- if (uuid.length === 0) router.push('/404')
+ if (uuid.length === 0) router.push(RoutePath[AppRoutes.NOT_FOUND])
return isLoading ? (
@@ -70,7 +71,9 @@ const CurrentEmployee = () => {
,
@@ -95,7 +98,7 @@ const CurrentEmployee = () => {
setIsModalVisible={setIsModalVisible}
titleText={'Удалить сотрудника?'}
buttonText={'Удалить сотрудника'}
- urlAfterDelete={'/employee'}
+ urlAfterDelete={RoutePath[AppRoutes.EMPLOYEE_LIST]}
dataField={'employee_id'}
/>
>
diff --git a/apps/schools/domains/employee/components/employeeList/index.tsx b/apps/schools/domains/employee/components/employeeList/index.tsx
index 1bbffab1..9aaccc0e 100644
--- a/apps/schools/domains/employee/components/employeeList/index.tsx
+++ b/apps/schools/domains/employee/components/employeeList/index.tsx
@@ -10,6 +10,7 @@ import { createSearchTextForRequest } from '@domains/common/utils/searchText'
import { GetListEmployee } from '@domains/employee/redux/interfaces'
import { RowType } from '@domains/employee/components/employeeList/interfaces'
import { searchColumns } from '@domains/employee/components/employeeList/constants'
+import { AppRoutes, RoutePath } from '@domains/common/constants/routerEnums'
export function EmployeeList() {
const [searchRequestText, setSearchRequestText] = useState('')
@@ -29,7 +30,7 @@ export function EmployeeList() {
block
style={{ width: '14%' }}
className={styles.button}
- onClick={() => router.push('/employee/create')}
+ onClick={() => router.push(RoutePath[AppRoutes.EMPLOYEE_CREATE])}
>
Добавить сотрудника
@@ -42,7 +43,7 @@ export function EmployeeList() {
]}
data={data}
isLoading={isLoading}
- mainRoute={'/employee'}
+ mainRoute={RoutePath[AppRoutes.EMPLOYEE_LIST]}
searchFields={searchColumns}
searchRequestText={searchRequestText}
setSearchRequestText={setSearchRequestText}
diff --git a/apps/schools/domains/organization/providers/organizationProvider.tsx b/apps/schools/domains/organization/providers/organizationProvider.tsx
index 36e0ca46..afc87eb2 100644
--- a/apps/schools/domains/organization/providers/organizationProvider.tsx
+++ b/apps/schools/domains/organization/providers/organizationProvider.tsx
@@ -3,6 +3,7 @@ import { useRouter } from 'next/router'
import { useGetAllOrganizationsQuery } from '../redux/organizationApi'
import { OrganizationInfo } from '../interfaces/organizationProvider'
import { EventKey, useEventBus } from '@domains/common/providers/eventBusProvider'
+import { AppRoutes, RoutePath } from '@domains/common/constants/routerEnums'
export const UUID_REGEXP = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/i
@@ -65,7 +66,11 @@ export const OrganizationProvider: React.FC = ({ chil
}
if (data.count === 0) {
- if (!router.asPath.endsWith('/user') && !router.asPath.includes('/auth/')) router.push('/user')
+ if (
+ !router.asPath.endsWith(RoutePath[AppRoutes.USER_LIST]) &&
+ !router.asPath.includes(`${RoutePath[AppRoutes.AUTH]}/`)
+ )
+ router.push(RoutePath[AppRoutes.USER_LIST])
} else {
const firstOrganization = data?.results[0]
if (organizationId === '' && firstOrganization && firstOrganization.id) {
diff --git a/apps/schools/domains/query/components/queryList/index.tsx b/apps/schools/domains/query/components/queryList/index.tsx
index 9492609f..87e2df4d 100644
--- a/apps/schools/domains/query/components/queryList/index.tsx
+++ b/apps/schools/domains/query/components/queryList/index.tsx
@@ -21,6 +21,7 @@ import { BubbleFilter } from '@domains/common/components/bubbleFilter'
import { BubbleFilterListItem } from '@domains/common/components/bubbleFilter/interface'
import { useQueryState } from 'next-usequerystate'
import { parseAsArrayOf, parseAsString } from 'next-usequerystate'
+import { AppRoutes, RoutePath } from '@domains/common/constants/routerEnums'
export function QueryList() {
const [searchRequestText, setSearchRequestText] = useState('')
@@ -144,7 +145,7 @@ export function QueryList() {
]}
data={reformattedData}
isLoading={isQueriesLoading}
- mainRoute={'/query'}
+ mainRoute={RoutePath[AppRoutes.QUERY_LIST]}
searchFields={[
'created_at',
'student_name',
diff --git a/apps/schools/domains/student/components/changeStudentForm/index.tsx b/apps/schools/domains/student/components/changeStudentForm/index.tsx
index 393c480a..92ff5801 100644
--- a/apps/schools/domains/student/components/changeStudentForm/index.tsx
+++ b/apps/schools/domains/student/components/changeStudentForm/index.tsx
@@ -16,6 +16,7 @@ import { handleSubmitForm } from '@domains/student/handlers/studentPatch'
import { useUpdateStudentByIdMutation } from '@domains/student/redux/studentApi'
import { useChangeStudentFormValidators } from '@domains/student/components/changeStudentForm/hooks'
import { ErrorType } from '@store/commonApi'
+import { AppRoutes, RoutePath } from '@domains/common/constants/routerEnums'
export function ChangeStudentForm() {
const uuid = getUuidFromUrl()
@@ -31,11 +32,11 @@ export function ChangeStudentForm() {
useEffect(() => {
if (studentError && (studentError as ErrorType).status == 404) {
- router.push('/student')
+ router.push(RoutePath[AppRoutes.STUDENT_LIST])
}
}, [studentError])
- if (uuid.length === 0) router.push('/404')
+ if (uuid.length === 0) router.push(RoutePath[AppRoutes.NOT_FOUND])
const validationCheck = () => {
setIsFormValid(isValidFormCheck(form, [], initialValues))
@@ -58,7 +59,7 @@ export function ChangeStudentForm() {
onValuesChange={validationCheck}
onFinish={() => {
handleSubmitForm(uuid[0], form, mutation).then((isSuccess) => {
- if (isSuccess) router.push(`/student/${uuid[0]}`)
+ if (isSuccess) router.push(`${RoutePath[AppRoutes.STUDENT_LIST]}/${uuid[0]}`)
})
}}
layout='vertical'
@@ -83,7 +84,7 @@ export function ChangeStudentForm() {
type='schoolDefaultAuto'
antdType={'default'}
block
- onClick={() => router.push(`/student/${uuid[0]}`)}
+ onClick={() => router.push(`${RoutePath[AppRoutes.STUDENT_LIST]}/${uuid[0]}`)}
>
Отменить
diff --git a/apps/schools/domains/student/components/createStudentForm/index.tsx b/apps/schools/domains/student/components/createStudentForm/index.tsx
index cfdb61e5..37c8a23e 100644
--- a/apps/schools/domains/student/components/createStudentForm/index.tsx
+++ b/apps/schools/domains/student/components/createStudentForm/index.tsx
@@ -21,6 +21,7 @@ import { TOOLTIP_MARGIN_TOP } from '@domains/student/components/createStudentFor
import { Select } from '@domains/common/components/select'
import router from 'next/router'
import { DROPDOWN_STYLE } from '@domains/common/components/containers/BaseLayoutComponents/OrganizationSelect/styles/styles'
+import { AppRoutes, RoutePath } from '@domains/common/constants/routerEnums'
export const CreateStudentForm = () => {
const validators = useCreateStudentFormValidators()
@@ -56,7 +57,7 @@ export const CreateStudentForm = () => {
localStorage.removeItem(PARENT_PHONE)
localStorage.removeItem(PARENT_EMAIL)
localStorage.removeItem(STUDENT_PHONE)
- router.push('/student')
+ router.push(RoutePath[AppRoutes.STUDENT_LIST])
}
})
}}
@@ -168,7 +169,7 @@ export const CreateStudentForm = () => {
type='schoolDefault'
block
className={styles.button}
- onClick={() => router.push('/circle/create')}
+ onClick={() => router.push(RoutePath[AppRoutes.CIRCLE_CREATE])}
>
Добавить кружок
diff --git a/apps/schools/domains/student/components/currentStudent/index.tsx b/apps/schools/domains/student/components/currentStudent/index.tsx
index 921f201b..f58e3c18 100644
--- a/apps/schools/domains/student/components/currentStudent/index.tsx
+++ b/apps/schools/domains/student/components/currentStudent/index.tsx
@@ -19,6 +19,7 @@ import { GetStudent } from '@domains/common/redux/serializers'
import { useOrganization } from '@domains/organization/providers/organizationProvider'
import parentAcceptedPhone from '@public/icons/parentAcceptedMobile.svg'
import parentDeclinedPhone from '@public/icons/parentDeclinedMobile.svg'
+import { AppRoutes, RoutePath } from '@domains/common/constants/routerEnums'
const CurrentStudent = () => {
const [isModalVisible, setIsModalVisible] = useState(false)
@@ -34,7 +35,7 @@ const CurrentStudent = () => {
useEffect(() => {
if (studentError && ((studentError as ErrorType).status == 404 || (studentError as ErrorType).status == 403)) {
- router.push('/student')
+ router.push(RoutePath[AppRoutes.STUDENT_LIST])
}
}, [studentError])
@@ -65,7 +66,7 @@ const CurrentStudent = () => {
}, [studentInfoAdditional])
if (isDeleteFinished.isSuccess) return null
- if (uuid.length === 0) router.push('/404')
+ if (uuid.length === 0) router.push(RoutePath[AppRoutes.NOT_FOUND])
return (
{
,
@@ -161,7 +166,7 @@ const CurrentStudent = () => {
setIsModalVisible={setIsModalVisible}
titleText={'Удалить обучающегося?'}
buttonText={'Удалить обучающегося'}
- urlAfterDelete={'/student'}
+ urlAfterDelete={RoutePath[AppRoutes.STUDENT_LIST]}
dataField={'student_id'}
/>
>
diff --git a/apps/schools/domains/student/components/studentList/index.tsx b/apps/schools/domains/student/components/studentList/index.tsx
index cf76e1a4..e491ed46 100644
--- a/apps/schools/domains/student/components/studentList/index.tsx
+++ b/apps/schools/domains/student/components/studentList/index.tsx
@@ -11,6 +11,7 @@ import { searchInvitesColumns, searchStudentsColumns } from './constants'
import { useGetAllStudentInvitationsQuery, useGetAllStudentsQuery } from '@domains/organization/redux/organizationApi'
import { QueryStatuses } from '@domains/common/constants/Enums'
import EmptyWrapper from '@domains/common/components/containers/EmptyWrapper'
+import { AppRoutes, RoutePath } from '@domains/common/constants/routerEnums'
export function StudentList() {
const [searchRequestText, setSearchRequestText] = useState('')
@@ -64,7 +65,7 @@ export function StudentList() {
pageTitle={'Обучающиеся'}
data={data}
isLoading={isLoadingStudents || isLoadingInvites}
- handleRunTask={() => router.push('/student/create')}
+ handleRunTask={() => router.push(RoutePath[AppRoutes.STUDENT_CREATE])}
searchTrigger={searchRequestText}
>
@@ -74,7 +75,7 @@ export function StudentList() {
block
style={{ width: '14%' }}
className={styles.button}
- onClick={() => router.push('/student/create')}
+ onClick={() => router.push(RoutePath[AppRoutes.STUDENT_CREATE])}
>
Добавить обучающегося
@@ -89,7 +90,7 @@ export function StudentList() {
filterFields={['circle_name']}
data={data}
isLoading={isLoadingInvites || isLoadingStudents}
- mainRoute={'/student'}
+ mainRoute={RoutePath[AppRoutes.STUDENT_LIST]}
searchFields={['student_name', 'student_phone', 'parent_phone', 'circle_name']}
searchRequestText={searchRequestText}
setSearchRequestText={setSearchRequestText}
diff --git a/apps/schools/domains/user/components/auth/headerActions/index.tsx b/apps/schools/domains/user/components/auth/headerActions/index.tsx
index 3b8bda7a..d8258f24 100644
--- a/apps/schools/domains/user/components/auth/headerActions/index.tsx
+++ b/apps/schools/domains/user/components/auth/headerActions/index.tsx
@@ -4,6 +4,7 @@ import React from 'react'
import styles from './styles/styles.module.scss'
import { ITabsActionsProps } from './interfaces'
+import { AppRoutes, RoutePath } from '@domains/common/constants/routerEnums'
export const TabsAuthAction: React.FC
= (props) => {
const { currentActiveKey, title } = props
@@ -26,8 +27,8 @@ export const TabsAuthAction: React.FC = (props) => {
>
) : (
<>
-
-
+
+
>
)}
diff --git a/apps/schools/domains/user/components/auth/sharedForms/ValidatePhoneForm.tsx b/apps/schools/domains/user/components/auth/sharedForms/ValidatePhoneForm.tsx
index b11b654b..84fbacc1 100644
--- a/apps/schools/domains/user/components/auth/sharedForms/ValidatePhoneForm.tsx
+++ b/apps/schools/domains/user/components/auth/sharedForms/ValidatePhoneForm.tsx
@@ -26,7 +26,7 @@ export const ValidatePhoneForm: React.FC = ({ onFinish,
const [smsCode, setSmsCode] = useState('')
const [isPhoneVisible, setIsPhoneVisible] = useState(false)
const [phoneValidateError, setPhoneValidateError] = useState(null)
- const PhoneToggleLabel = isPhoneVisible ? 'Показать' : 'Скрыть'
+ const PhoneToggleLabel = isPhoneVisible ? 'Скрыть' : 'Показать'
const SMS_VALIDATOR = useCallback(
() => ({
diff --git a/apps/schools/domains/user/components/auth/signInForm/index.tsx b/apps/schools/domains/user/components/auth/signInForm/index.tsx
index 9bc01c47..97c71bcb 100644
--- a/apps/schools/domains/user/components/auth/signInForm/index.tsx
+++ b/apps/schools/domains/user/components/auth/signInForm/index.tsx
@@ -8,6 +8,7 @@ import { Button } from '@domains/common/components/button'
import { loginHandler } from '@domains/user/handlers/auth/signin'
import { useLoginMutation } from '@domains/user/redux/authenticationApi'
import { useSignInFormValidators } from './hooks'
+import { AppRoutes, RoutePath } from '@domains/common/constants/routerEnums'
export const SignInForm = (): React.ReactElement => {
const validators = useSignInFormValidators()
@@ -61,7 +62,7 @@ export const SignInForm = (): React.ReactElement => {
Забыли пароль?
- Router.push('/auth/forgot')}>
+ Router.push(RoutePath[AppRoutes.AUTH_REGISTER])}>
{'Сбросить'}
diff --git a/apps/schools/domains/user/components/profile/profileEdit/index.tsx b/apps/schools/domains/user/components/profile/profileEdit/index.tsx
index f5301e83..0b6ec5aa 100644
--- a/apps/schools/domains/user/components/profile/profileEdit/index.tsx
+++ b/apps/schools/domains/user/components/profile/profileEdit/index.tsx
@@ -14,6 +14,7 @@ import { useChangeUserProfileFormValidators } from '@domains/user/components/pro
import { useUpdateEmployeeProfileByIdMutation } from '@domains/employee/redux/employeeApi'
import { handleSubmitForm } from '@domains/user/handlers/profile/profileEdit'
import { EventKey, useEventBus } from '@domains/common/providers/eventBusProvider'
+import { AppRoutes, RoutePath } from '@domains/common/constants/routerEnums'
export function ProfileEdit() {
const { emit } = useEventBus()
@@ -52,7 +53,7 @@ export function ProfileEdit() {
handleSubmitForm(user.employee_profile?.id ?? '', form, mutation).then((isSuccess) => {
if (isSuccess) {
emit(EventKey.RefetchProfileQuery)
- router.push('/user')
+ router.push(RoutePath[AppRoutes.USER_LIST])
}
})
}}
@@ -81,7 +82,7 @@ export function ProfileEdit() {
- Сбросить пароль
+ Сбросить пароль
@@ -93,7 +94,7 @@ export function ProfileEdit() {
type='schoolDefaultAuto'
antdType={'default'}
block
- onClick={() => router.push('/user')}
+ onClick={() => router.push(RoutePath[AppRoutes.USER_LIST])}
>
Отменить
diff --git a/apps/schools/domains/user/components/profile/profileInfo/index.tsx b/apps/schools/domains/user/components/profile/profileInfo/index.tsx
index ae2bfb6e..090a8fc4 100644
--- a/apps/schools/domains/user/components/profile/profileInfo/index.tsx
+++ b/apps/schools/domains/user/components/profile/profileInfo/index.tsx
@@ -8,6 +8,7 @@ import duckEmptyPage from '@public/image/duckEmptyPage.svg'
import { useUserProfile } from '@domains/user/providers/authProvider'
import { useLazyGetAllEmployeesQuery } from '@domains/employee/redux/employeeApi'
import { Field } from '@domains/common/components/field'
+import { AppRoutes, RoutePath } from '@domains/common/constants/routerEnums'
export function ProfileInfo() {
const { user } = useUserProfile()
@@ -54,7 +55,7 @@ export function ProfileInfo() {
))
)}
-