MSP-3423 fix prettier
This commit is contained in:
1 parent
7307827078
commit
eff4590fbc
56 files changed
+803
-733
No files matched your search
@@ -1,33 +1,31 @@
|
||||
import { Button } from 'antd'
|
||||
import { Dispatch, FC, SetStateAction } from 'react'
|
||||
import { useParams } from 'react-router-dom'
|
||||
|
||||
import Modal from '@widgets/Modal'
|
||||
import { ModalPropsType } from '@widgets/Modal/modal.type.ts'
|
||||
import { Dispatch, FC, SetStateAction } from 'react'
|
||||
|
||||
import { ConfigType } from '@pages/ModulesPage/module.type.ts'
|
||||
import { useParams } from 'react-router-dom'
|
||||
|
||||
import configServiceApi from '@services/configService.ts'
|
||||
|
||||
|
||||
interface ConfirmModalProps
|
||||
extends Omit<ModalPropsType, 'title' | 'children'> {
|
||||
interface ConfirmModalProps extends Omit<ModalPropsType, 'title' | 'children'> {
|
||||
handleSaveClick: (upVersion?: number, unsafe?: boolean) => void
|
||||
setBufConfig: Dispatch<SetStateAction<ConfigType | undefined>>
|
||||
currentConfig: ConfigType | undefined
|
||||
}
|
||||
|
||||
const ConfirmConfigModal: FC<ConfirmModalProps> = ({
|
||||
currentConfig,
|
||||
setBufConfig,
|
||||
handleSaveClick,
|
||||
onClose = () => null,
|
||||
open
|
||||
}) => {
|
||||
currentConfig,
|
||||
setBufConfig,
|
||||
handleSaveClick,
|
||||
onClose = () => null,
|
||||
open
|
||||
}) => {
|
||||
const { id = '' } = useParams()
|
||||
const isNew = id === 'new' ? '' : id
|
||||
|
||||
const {
|
||||
data
|
||||
} = configServiceApi.useGetConfigByIdQuery(isNew)
|
||||
|
||||
const { data } = configServiceApi.useGetConfigByIdQuery(isNew)
|
||||
|
||||
const onConfirmHandler = () => {
|
||||
setBufConfig(currentConfig)
|
||||
@@ -35,14 +33,26 @@ const ConfirmConfigModal: FC<ConfirmModalProps> = ({
|
||||
}
|
||||
|
||||
return (
|
||||
<Modal title="Версия конфигурации была кем-то изменена" open={open}
|
||||
onClose={onClose}>
|
||||
<Button className="confirm-btn danger" type="primary" danger onClick={() => {
|
||||
handleSaveClick(data && data.version)
|
||||
onClose()
|
||||
}}>Сохранить принудительно</Button>
|
||||
<Button className="confirm-btn" type="primary" onClick={onConfirmHandler}>Принять изменения</Button>
|
||||
<Modal
|
||||
title="Версия конфигурации была кем-то изменена"
|
||||
open={open}
|
||||
onClose={onClose}
|
||||
>
|
||||
<Button
|
||||
className="confirm-btn danger"
|
||||
type="primary"
|
||||
danger
|
||||
onClick={() => {
|
||||
handleSaveClick(data && data.version)
|
||||
onClose()
|
||||
}}
|
||||
>
|
||||
Сохранить принудительно
|
||||
</Button>
|
||||
<Button className="confirm-btn" type="primary" onClick={onConfirmHandler}>
|
||||
Принять изменения
|
||||
</Button>
|
||||
</Modal>
|
||||
)
|
||||
}
|
||||
export default ConfirmConfigModal
|
||||
export default ConfirmConfigModal
|
||||
Reference in new issue
Block a user