From 3481e76b7c11a89c954e073f011970da10c49897 Mon Sep 17 00:00:00 2001 From: PotapovaA Date: Thu, 20 Aug 2026 17:56:25 +0300 Subject: [PATCH] add constants for projet types --- web/src/constants/constants.jsx | 2 ++ web/src/constants/projectConfig.jsx | 4 +++- web/src/pages/FormPage.jsx | 3 ++- web/src/pages/ProjectPages/components/EditModal/EditModal.jsx | 3 ++- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/web/src/constants/constants.jsx b/web/src/constants/constants.jsx index c4ff25a..093d1d6 100644 --- a/web/src/constants/constants.jsx +++ b/web/src/constants/constants.jsx @@ -44,6 +44,8 @@ export const FORM_TYPE_TRANSLATE = { }; export const DIRECTION_TRANSLATE = { Support: 'Поддержка', Development: 'Развитие' }; +export const PROJECT_TYPES = ['Открытие ВСП', 'Закрытие ВСП', 'Переезд ВСП', 'Реновация РФ', 'Открытие УРМ']; + export const ORG_UNIT_TYPE_OPTIONS = [ { value: 'ssp', label: 'ССП' }, { value: 'rf', label: 'Региональный филиал' }, diff --git a/web/src/constants/projectConfig.jsx b/web/src/constants/projectConfig.jsx index 4c083cf..34ef8d1 100644 --- a/web/src/constants/projectConfig.jsx +++ b/web/src/constants/projectConfig.jsx @@ -1,3 +1,5 @@ +import { PROJECT_TYPES } from './constants'; + export const DEFAULT_PROJECT_CONFIG = { 'ССП/РФ': { type: 'multiselect', @@ -16,7 +18,7 @@ export const DEFAULT_PROJECT_CONFIG = { }, 'Тип проекта развития': { type: 'multiselect', - options: ['Открытие ВСП', 'Закрытие ВСП', 'Переезд ВСП', 'Реновация РФ', 'Открытие УРМ'], + options: PROJECT_TYPES, placeholder: 'Выберите тип проекта', defaultValue: null, required_field: true, diff --git a/web/src/pages/FormPage.jsx b/web/src/pages/FormPage.jsx index c226003..647971a 100644 --- a/web/src/pages/FormPage.jsx +++ b/web/src/pages/FormPage.jsx @@ -15,6 +15,7 @@ import { NameTask, TaskInfoContainer } from '../components/common/SwitchFormTask import TableList from '../components/common/TableList/TableList'; import { TableIcon } from '../components/common/icons/icons'; import { Chip } from '../components/styles/StyledChip'; +import { PROJECT_TYPES } from '../constants/constants'; const FormInfo = ({ form }) => { const portalContent = ( @@ -123,7 +124,7 @@ export default function FormPage() { add_projects_data: { 'Тип проекта развития': { type: 'multiselect', - options: ['Открытие ВСП', 'Закрытие ВСП', 'Переезд ВСП', 'Реновация РФ', 'Открытие УРМ'], + options: PROJECT_TYPES, placeholder: '', defaultValue: null, }, diff --git a/web/src/pages/ProjectPages/components/EditModal/EditModal.jsx b/web/src/pages/ProjectPages/components/EditModal/EditModal.jsx index ec2948c..ba16c16 100644 --- a/web/src/pages/ProjectPages/components/EditModal/EditModal.jsx +++ b/web/src/pages/ProjectPages/components/EditModal/EditModal.jsx @@ -3,6 +3,7 @@ import { Box, Dialog, DialogActions, DialogContent, DialogTitle, IconButton, Men import React from 'react'; import { useAuth } from '../../../../app/context/AuthProvider'; import { DangerOutlinedButton, PrimaryButton } from '../../../../components/common/Buttons/Buttons'; +import { PROJECT_TYPES } from '../../../../constants/constants'; import { DEVELOMENT_BLOCK, FUNDING_BY_DECISION } from '../../constants'; import { canEditFirstTableField, hasReserveValuesInChildSmetas, isFirstTableFieldDependencySatisfied } from '../../constants/fieldAccess'; @@ -56,7 +57,7 @@ const EditModal = ({ open, onClose, rowData, onSave, isSaving = false, orgUnitNa { key: 'status', label: 'Статус', options: [['created', 'Создан'], ['agreed', 'Согласован'], ['archived', 'В архиве']] }, { key: 'technical_number', label: 'Технический номер проекта' }, { key: 'org_unit_id', label: 'ССП/РФ', valueType: 'number', options: Object.entries(orgUnitNames).map(([id, title]) => [Number(id), title]) }, - { key: 'project_type', label: 'Тип проекта', options: ['Открытие ВСП', 'Закрытие ВСП', 'Переезд ВСП', 'Реновация РФ', 'Открытие УРМ'] }, + { key: 'project_type', label: 'Тип проекта', options: PROJECT_TYPES }, { key: 'vsp_format', label: 'Формат ВСП', options: ['Флагманский', 'Типовой', 'Розничный', 'МСБ', 'Лёгкий', 'Мини', 'Розничный-киоск', 'МБО', 'Офис самообслуживания', 'Другое'] }, { key: 'placement_type', label: 'Размещение', options: ['Собственность', 'Аренда', 'Субаренда'] }, { key: 'staff_count', label: 'Количество сотрудников', type: 'number', valueType: 'number', min: 0 },