diff --git a/README.md b/README.md index 2b3ca4a..821b2d9 100755 --- a/README.md +++ b/README.md @@ -114,4 +114,11 @@ npm i -D react-error-overlay@6.0.9 "//": "See https://github.com/facebook/create-react-app/issues/11773", "react-error-overlay": "6.0.9" } -``` \ No newline at end of file +``` +### prettier 가 자동으로 고치는 코드 skip 하려면 + -> material-ui Alert component의 severity 속성(error | warning | info | success) + -> "" double-quote 사용해야만 하는데 +```js +// prettier-ignore +severity: "error" +``` diff --git a/src/views/biz/board/Board.jsx b/src/views/biz/board/Board.jsx index 61f10b9..479a213 100644 --- a/src/views/biz/board/Board.jsx +++ b/src/views/biz/board/Board.jsx @@ -10,7 +10,7 @@ import { IconSearch } from '@tabler/icons'; import MainCard from 'ui-component/cards/MainCard'; // project imports -import MuiDataGrid from 'views/form/MuiDataGrid'; +import MuiDataGrid from 'views/cmm/MuiDataGrid'; import { findBoars } from '../../../apis/board'; const Board = () => { diff --git a/src/views/biz/board/PublicBoard.jsx b/src/views/biz/board/PublicBoard.jsx index bbf516a..9e0062e 100644 --- a/src/views/biz/board/PublicBoard.jsx +++ b/src/views/biz/board/PublicBoard.jsx @@ -10,8 +10,8 @@ import { IconFileText } from '@tabler/icons'; import MainCard from 'ui-component/cards/MainCard'; // project imports -import MuiDataGrid from 'views/form/MuiDataGrid'; -import CmmModal from 'views/form/Modal/CmmModal'; +import MuiDataGrid from 'views/cmm/MuiDataGrid'; +import CmmModal from 'views/cmm/CmmModal'; import PublicBoardForm from './PublicBoardForm'; import { deletePublicBoard, findPublicBoards, modifyPublicBoardHitCount, savePublicBoard } from 'apis/public'; diff --git a/src/views/biz/board/PublicBoardForm.jsx b/src/views/biz/board/PublicBoardForm.jsx index 289bbfc..0459654 100644 --- a/src/views/biz/board/PublicBoardForm.jsx +++ b/src/views/biz/board/PublicBoardForm.jsx @@ -15,7 +15,7 @@ import InputLabel from 'ui-component/extended/Form/InputLabel'; import { Delete, List, Save } from '@mui/icons-material'; import { fileDownload } from '../../../apis/common'; -import FileForm from 'views/form/FileForm'; +import FileForm from 'views/cmm/FileForm'; const PublicBoardForm = (props) => { // eslint-disable-next-line react/prop-types diff --git a/src/views/biz/judge/JudgeDataReview.jsx b/src/views/biz/judge/JudgeDataReview.jsx index ed1dfd6..4ad68ad 100644 --- a/src/views/biz/judge/JudgeDataReview.jsx +++ b/src/views/biz/judge/JudgeDataReview.jsx @@ -6,8 +6,8 @@ import { Button, Divider, Grid, Link } from '@mui/material'; import MainCard from 'ui-component/cards/MainCard'; // project imports -import MuiDataGrid from 'views/form/MuiDataGrid'; -import CmmModal from 'views/form/Modal/CmmModal'; +import MuiDataGrid from 'views/cmm/MuiDataGrid'; +import CmmModal from 'views/cmm/CmmModal'; import { findJudge, findJudgeDatas, saveJudgeData } from 'apis/judge'; import NewJudgeDataForm from 'views/biz/judge/NewJudgeDataForm'; import ModifyJudgeDataForm from 'views/biz/judge/ModifyJudgeDataForm'; diff --git a/src/views/biz/judge/JudgeRegistReview.jsx b/src/views/biz/judge/JudgeRegistReview.jsx index 47e3fb4..a26431d 100644 --- a/src/views/biz/judge/JudgeRegistReview.jsx +++ b/src/views/biz/judge/JudgeRegistReview.jsx @@ -11,13 +11,13 @@ import PersonAddTwoToneIcon from '@mui/icons-material/PersonAddTwoTone'; import MainCard from 'ui-component/cards/MainCard'; // project imports -import MuiDataGrid from 'views/form/MuiDataGrid'; +import MuiDataGrid from 'views/cmm/MuiDataGrid'; import xitCmm from 'commons/XitCmm'; -import CmmModal from 'views/form/Modal/CmmModal'; +import CmmModal from 'views/cmm/CmmModal'; import SaveJudgeTargetForm from 'views/biz/judge/SaveJudgeTargetForm'; import NumberFormat from 'react-number-format'; -import ExcelDownload from 'views/form/ExcelDownload'; +import ExcelDownload from 'views/cmm/ExcelDownload'; import { findJudgeTargets, saveJudgeTargets } from 'apis/judge'; import PropTypes from 'prop-types'; diff --git a/src/views/biz/judge/JudgeReview.jsx b/src/views/biz/judge/JudgeReview.jsx index 5b840f6..c9f78c5 100644 --- a/src/views/biz/judge/JudgeReview.jsx +++ b/src/views/biz/judge/JudgeReview.jsx @@ -13,11 +13,11 @@ import { IconSearch } from '@tabler/icons'; import MainCard from 'ui-component/cards/MainCard'; // project imports -import MuiDataGrid from 'views/form/MuiDataGrid'; +import MuiDataGrid from 'views/cmm/MuiDataGrid'; import xitCmm from 'commons/XitCmm'; import InputLabel from 'ui-component/extended/Form/InputLabel'; import { findJudgeResults, findJudges } from 'apis/judge'; -import CmmModal from 'views/form/Modal/CmmModal'; +import CmmModal from 'views/cmm/CmmModal'; import ModalJudgeResult from './ModalJudgeResult'; import PropTypes from 'prop-types'; diff --git a/src/views/biz/judge/ModalJudgeResult.jsx b/src/views/biz/judge/ModalJudgeResult.jsx index 1adee22..9b09594 100644 --- a/src/views/biz/judge/ModalJudgeResult.jsx +++ b/src/views/biz/judge/ModalJudgeResult.jsx @@ -14,7 +14,7 @@ import { useState } from 'react'; import Button from '@mui/material/Button'; import { IconSearch } from '@tabler/icons'; import { findJudgeResults } from 'apis/judge'; -import { useAlert } from 'react-alert'; +import MuiAlert from 'views/cmm/MuiAlert'; const StyledTableCell = styled(TableCell)(({ theme }) => ({ [`&.${tableCellClasses.head}`]: { @@ -37,13 +37,20 @@ const StyledTableRow = styled(TableRow)(({ theme }) => ({ })); const ModalJudgeResult = ({ totJudgeUserData, judgeData, simsaUser, selectedRow, judgeTeam }) => { - const alert = useAlert(); const [judgeResult, setJudgeResult] = useState({ totJudgeUserData, judgeData, simsaUser }); const [msuTeam, setMsuTeam] = useState(judgeTeam); + const [alertOpen, setAlertOpen] = useState(false); + const [alertState, setAlertState] = useState({ + // prettier-ignore + severity: "warning", + title: '', + message: '' + }); + const totLabel = ['부과', '서손', '미부과', '계']; console.log(totJudgeUserData, judgeData, simsaUser, selectedRow, judgeTeam); const onSearch = async () => { @@ -65,16 +72,21 @@ const ModalJudgeResult = ({ totJudgeUserData, judgeData, simsaUser, selectedRow, judgeData: [], simsaUser: [] }); - alert.show('조회된 데이타가 없습니다.'); - return; + // alert.show('조회된 데이타가 없습니다.'); + setAlertState({ + ...alertState, + message: '조회된 데이타가 없습니다.' + }); + setAlertOpen(true); + // descriptionAlertsDescriptionAlerts(); + } else { + setJudgeResult({ + ...judgeResult, + totJudgeUserData: res.totJudgeUserData, + judgeData: res.judgeData, + simsaUser: res.simsaUser + }); } - - setJudgeResult({ - ...judgeResult, - totJudgeUserData: res.totJudgeUserData, - judgeData: res.judgeData, - simsaUser: res.simsaUser - }); // totJudgeUserData = res.totJudgeUserData; // judgeData = res.judgeData; // simsaUser = res.simsaUser; @@ -187,6 +199,7 @@ const ModalJudgeResult = ({ totJudgeUserData, judgeData, simsaUser, selectedRow, + ); }; diff --git a/src/views/biz/judge/ModifyJudgeDataForm.jsx b/src/views/biz/judge/ModifyJudgeDataForm.jsx index 3e7eade..bfba597 100644 --- a/src/views/biz/judge/ModifyJudgeDataForm.jsx +++ b/src/views/biz/judge/ModifyJudgeDataForm.jsx @@ -10,7 +10,7 @@ import Button from '@mui/material/Button'; import { IconSearch } from '@tabler/icons'; import { getComboCodeList } from 'apis/common'; -import FileInputForms from 'views/form/FileInputForms'; +import FileInputForms from 'views/cmm/FileInputForms'; // const toDate = new Date(); diff --git a/src/views/biz/judge/NewJudgeDataForm.jsx b/src/views/biz/judge/NewJudgeDataForm.jsx index 9123475..e62006f 100644 --- a/src/views/biz/judge/NewJudgeDataForm.jsx +++ b/src/views/biz/judge/NewJudgeDataForm.jsx @@ -10,7 +10,7 @@ import Button from '@mui/material/Button'; import { IconSearch } from '@tabler/icons'; import { getComboCodeList } from 'apis/common'; -import FileInputForms from 'views/form/FileInputForms'; +import FileInputForms from 'views/cmm/FileInputForms'; const toDate = new Date(); diff --git a/src/views/biz/parking/ParkingRegister.jsx b/src/views/biz/parking/ParkingRegister.jsx index 3f0cf07..7ee71c7 100644 --- a/src/views/biz/parking/ParkingRegister.jsx +++ b/src/views/biz/parking/ParkingRegister.jsx @@ -11,13 +11,13 @@ import PersonAddTwoToneIcon from '@mui/icons-material/PersonAddTwoTone'; import MainCard from 'ui-component/cards/MainCard'; // project imports -import MuiDataGrid from 'views/form/MuiDataGrid'; +import MuiDataGrid from 'views/cmm/MuiDataGrid'; import xitCmm from 'commons/XitCmm'; -import CmmModal from 'views/form/Modal/CmmModal'; +import CmmModal from 'views/cmm/CmmModal'; import SaveParkingTargetForm from './SaveParkingTargetForm'; import NumberFormat from 'react-number-format'; -import ExcelDownload from 'views/form/ExcelDownload'; +import ExcelDownload from 'views/cmm/ExcelDownload'; import { findParkingJudgeTargets, saveParkingJudgeTargets } from 'apis/parking'; const ParkingRegister = () => { diff --git a/src/views/biz/parking/ParkingReview.jsx b/src/views/biz/parking/ParkingReview.jsx index aa8da37..ed07d8b 100644 --- a/src/views/biz/parking/ParkingReview.jsx +++ b/src/views/biz/parking/ParkingReview.jsx @@ -15,13 +15,13 @@ import { IconSearch } from '@tabler/icons'; import MainCard from 'ui-component/cards/MainCard'; // project imports -import MuiDataGrid from 'views/form/MuiDataGrid'; +import MuiDataGrid from 'views/cmm/MuiDataGrid'; import xitCmm from 'commons/XitCmm'; import { findParkings } from 'apis/parking'; import { findJudgeResults } from 'apis/judge'; import InputLabel from '../../../ui-component/extended/Form/InputLabel'; import ModalJudgeResult from 'views/biz/judge/ModalJudgeResult'; -import CmmModal from 'views/form/Modal/CmmModal'; +import CmmModal from 'views/cmm/CmmModal'; const ParkingReview = () => { const isInit = useRef(true); diff --git a/src/views/biz/user/Juror.jsx b/src/views/biz/user/Juror.jsx index 377e611..9c81ad4 100644 --- a/src/views/biz/user/Juror.jsx +++ b/src/views/biz/user/Juror.jsx @@ -10,9 +10,9 @@ import { IconSearch } from '@tabler/icons'; import MainCard from 'ui-component/cards/MainCard'; // project imports -import MuiDataGrid from 'views/form/MuiDataGrid'; +import MuiDataGrid from 'views/cmm/MuiDataGrid'; import { getBoardList } from '../../../apis/user'; -import CmmModal from '../../form/Modal/CmmModal'; +import CmmModal from '../../cmm/CmmModal'; import UserManagerForm from './UserManagerForm'; import { deletePublicBoard, savePublicBoard } from '../../../apis/public'; diff --git a/src/views/biz/user/JurorForm.jsx b/src/views/biz/user/JurorForm.jsx index f307bb7..c80ebcc 100644 --- a/src/views/biz/user/JurorForm.jsx +++ b/src/views/biz/user/JurorForm.jsx @@ -15,7 +15,7 @@ import InputLabel from 'ui-component/extended/Form/InputLabel'; import { Delete, List, Save } from '@mui/icons-material'; import { fileDownload } from '../../../apis/common'; -import FileForm from 'views/form/FileForm'; +import FileForm from 'views/cmm/FileForm'; const PublicBoardForm = (props) => { // eslint-disable-next-line react/prop-types diff --git a/src/views/biz/user/UserManager.jsx b/src/views/biz/user/UserManager.jsx index e52a1a1..989c2ac 100644 --- a/src/views/biz/user/UserManager.jsx +++ b/src/views/biz/user/UserManager.jsx @@ -10,8 +10,8 @@ import { IconSearch } from '@tabler/icons'; import MainCard from 'ui-component/cards/MainCard'; // project imports -import MuiDataGrid from 'views/form/MuiDataGrid'; -import CmmModal from '../../form/Modal/CmmModal'; +import MuiDataGrid from 'views/cmm/MuiDataGrid'; +import CmmModal from '../../cmm/CmmModal'; import UserManagerForm from './UserManagerForm'; import { deletePublicBoard, findPublicBoards, modifyPublicBoardHitCount, savePublicBoard } from 'apis/public'; diff --git a/src/views/form/Modal/CmmModal.jsx b/src/views/cmm/CmmModal.jsx similarity index 96% rename from src/views/form/Modal/CmmModal.jsx rename to src/views/cmm/CmmModal.jsx index b449734..5d70997 100644 --- a/src/views/form/Modal/CmmModal.jsx +++ b/src/views/cmm/CmmModal.jsx @@ -11,7 +11,7 @@ const style = { left: '50%', transform: 'translate(-50%, -50%)', width: 1050, - maxheight: 700, + minHeight: 500, bgcolor: 'background.paper', border: '2px solid #000', boxShadow: 24, @@ -31,7 +31,7 @@ const CmmModal = ({ isBackdrop = false, open, setOpen, title, children, callback diff --git a/src/views/form/CustomPagination.js b/src/views/cmm/CustomPagination.js similarity index 100% rename from src/views/form/CustomPagination.js rename to src/views/cmm/CustomPagination.js diff --git a/src/views/form/DataGridPaging.js b/src/views/cmm/DataGridPaging.js similarity index 100% rename from src/views/form/DataGridPaging.js rename to src/views/cmm/DataGridPaging.js diff --git a/src/views/form/ExcelDownload.jsx b/src/views/cmm/ExcelDownload.jsx similarity index 100% rename from src/views/form/ExcelDownload.jsx rename to src/views/cmm/ExcelDownload.jsx diff --git a/src/views/form/FileForm.jsx b/src/views/cmm/FileForm.jsx similarity index 100% rename from src/views/form/FileForm.jsx rename to src/views/cmm/FileForm.jsx diff --git a/src/views/form/FileInputForm.jsx b/src/views/cmm/FileInputForm.jsx similarity index 100% rename from src/views/form/FileInputForm.jsx rename to src/views/cmm/FileInputForm.jsx diff --git a/src/views/form/FileInputForms.jsx b/src/views/cmm/FileInputForms.jsx similarity index 100% rename from src/views/form/FileInputForms.jsx rename to src/views/cmm/FileInputForms.jsx diff --git a/src/views/cmm/MuiAlert.jsx b/src/views/cmm/MuiAlert.jsx new file mode 100644 index 0000000..d4e94ea --- /dev/null +++ b/src/views/cmm/MuiAlert.jsx @@ -0,0 +1,47 @@ +import Box from '@mui/material/Box'; +import Alert from '@mui/material/Alert'; +import IconButton from '@mui/material/IconButton'; +import Collapse from '@mui/material/Collapse'; +import CloseIcon from '@mui/icons-material/Close'; +import AlertTitle from '@mui/material/AlertTitle'; +import PropTypes from 'prop-types'; + +// severity는 double-quote를 써야만 한다 - prettier-ignore 설정 +// prettier-ignore +export default function MuiAlert({ severity = "info", title = '', message, open, setOpen }) { + console.log(severity); + return ( + + + { + setOpen(false); + }} + > + + + } + sx={{ mb: 2 }} + > + {title && {title}} + {message} + + + + ); +} + +MuiAlert.propTypes = { + severity: PropTypes.string, + title: PropTypes.string, + message: PropTypes.string.isRequired, + open: PropTypes.bool.isRequired, + setOpen: PropTypes.func.isRequired +}; diff --git a/src/views/form/MuiDataGrid.jsx b/src/views/cmm/MuiDataGrid.jsx similarity index 100% rename from src/views/form/MuiDataGrid.jsx rename to src/views/cmm/MuiDataGrid.jsx diff --git a/src/views/form/MuiDatePicker.jsx b/src/views/cmm/MuiDatePicker.jsx similarity index 100% rename from src/views/form/MuiDatePicker.jsx rename to src/views/cmm/MuiDatePicker.jsx diff --git a/src/views/form/defaultDataGridLocale.js b/src/views/cmm/defaultDataGridLocale.js similarity index 100% rename from src/views/form/defaultDataGridLocale.js rename to src/views/cmm/defaultDataGridLocale.js diff --git a/src/views/form/Modal/index.js b/src/views/form/Modal/index.js index 1ddad7a..1de4d10 100644 --- a/src/views/form/Modal/index.js +++ b/src/views/form/Modal/index.js @@ -4,7 +4,7 @@ import MainCard from 'ui-component/cards/MainCard'; import SecondaryAction from 'ui-component/cards/CardSecondaryAction'; import NestedModal from './NestedModal'; import BasicModal from './BasicModal'; -import UseGridSelector from '../DataGridPaging'; +import UseGridSelector from '../../cmm/DataGridPaging'; // ==============================|| MODAL PAGE ||============================== // diff --git a/src/views/form/Popup/Popup.js b/src/views/form/Popup/Popup.js deleted file mode 100644 index 3be2d9f..0000000 --- a/src/views/form/Popup/Popup.js +++ /dev/null @@ -1,42 +0,0 @@ -import React from 'react'; -import { Dialog, DialogTitle, DialogContent, makeStyles, Typography } from '@mui/material'; -import Controls from './controls/Controls'; -// import CloseIcon from '@mui/icons-material'; -import { IconSquareX } from '@tabler/icons'; - -const useStyles = makeStyles((theme) => ({ - dialogWrapper: { - padding: theme.spacing(2), - position: 'absolute', - top: theme.spacing(5) - }, - dialogTitle: { - paddingRight: '0px' - } -})); - -export default function Popup(props) { - const { title, children, openPopup, setOpenPopup } = props; - const classes = useStyles(); - - return ( - - -
- - {title} - - { - setOpenPopup(false); - }} - > - - -
-
- {children} -
- ); -} diff --git a/src/views/form/Popup/controls/ActionButton.js b/src/views/form/Popup/controls/ActionButton.js deleted file mode 100644 index d112356..0000000 --- a/src/views/form/Popup/controls/ActionButton.js +++ /dev/null @@ -1,32 +0,0 @@ -import React from 'react'; -import { Button, makeStyles } from '@mui/material'; - -const useStyles = makeStyles((theme) => ({ - root: { - minWidth: 0, - margin: theme.spacing(0.5) - }, - secondary: { - backgroundColor: theme.palette.secondary.light, - '& .MuiButton-label': { - color: theme.palette.secondary.main - } - }, - primary: { - backgroundColor: theme.palette.primary.light, - '& .MuiButton-label': { - color: theme.palette.primary.main - } - } -})); - -export default function ActionButton(props) { - const { color, children, onClick } = props; - const classes = useStyles(); - - return ( - - ); -} diff --git a/src/views/form/Popup/controls/Button.js b/src/views/form/Popup/controls/Button.js deleted file mode 100644 index 78af930..0000000 --- a/src/views/form/Popup/controls/Button.js +++ /dev/null @@ -1,29 +0,0 @@ -import React from 'react'; -import { Button as MuiButton, makeStyles } from '@mui/material'; - -const useStyles = makeStyles((theme) => ({ - root: { - margin: theme.spacing(0.5) - }, - label: { - textTransform: 'none' - } -})); - -export default function Button(props) { - const { text, size, color, variant, onClick, ...other } = props; - const classes = useStyles(); - - return ( - - {text} - - ); -} diff --git a/src/views/form/Popup/controls/Checkbox.js b/src/views/form/Popup/controls/Checkbox.js deleted file mode 100644 index 12605ed..0000000 --- a/src/views/form/Popup/controls/Checkbox.js +++ /dev/null @@ -1,29 +0,0 @@ -import React from 'react'; -import { FormControl, FormControlLabel, Checkbox as MuiCheckbox } from '@mui/material'; - -export default function Checkbox(props) { - const { name, label, value, onChange } = props; - - const convertToDefEventPara = (name, value) => ({ - target: { - name, - value - } - }); - - return ( - - onChange(convertToDefEventPara(name, e.target.checked))} - /> - } - label={label} - /> - - ); -} diff --git a/src/views/form/Popup/controls/Controls.js b/src/views/form/Popup/controls/Controls.js deleted file mode 100644 index f5f8996..0000000 --- a/src/views/form/Popup/controls/Controls.js +++ /dev/null @@ -1,17 +0,0 @@ -import Input from './Input'; -import RadioGroup from './RadioGroup'; -import Select from './Select'; -import Checkbox from './Checkbox'; -import Button from './Button'; -import ActionButton from './ActionButton'; - -const Controls = { - Input, - RadioGroup, - Select, - Checkbox, - Button, - ActionButton -}; - -export default Controls; diff --git a/src/views/form/Popup/controls/Input.js b/src/views/form/Popup/controls/Input.js deleted file mode 100644 index 93c79f1..0000000 --- a/src/views/form/Popup/controls/Input.js +++ /dev/null @@ -1,17 +0,0 @@ -import React from 'react'; -import { TextField } from '@mui/material'; - -export default function Input(props) { - const { name, label, value, error = null, onChange, ...other } = props; - return ( - - ); -} diff --git a/src/views/form/Popup/controls/RadioGroup.js b/src/views/form/Popup/controls/RadioGroup.js deleted file mode 100644 index b067755..0000000 --- a/src/views/form/Popup/controls/RadioGroup.js +++ /dev/null @@ -1,17 +0,0 @@ -import React from 'react'; -import { FormControl, FormLabel, RadioGroup as MuiRadioGroup, FormControlLabel, Radio } from '@mui/material'; - -export default function RadioGroup(props) { - const { name, label, value, onChange, items } = props; - - return ( - - {label} - - {items.map((item) => ( - } label={item.title} /> - ))} - - - ); -} diff --git a/src/views/form/Popup/controls/Select.js b/src/views/form/Popup/controls/Select.js deleted file mode 100644 index 2c89f2c..0000000 --- a/src/views/form/Popup/controls/Select.js +++ /dev/null @@ -1,21 +0,0 @@ -import React from 'react'; -import { FormControl, InputLabel, Select as MuiSelect, MenuItem, FormHelperText } from '@mui/material'; - -export default function Select(props) { - const { name, label, value, error = null, onChange, options } = props; - - return ( - - {label} - - None - {options.map((item) => ( - - {item.title} - - ))} - - {error && {error}} - - ); -}