Browse Source

공통모달 param 수정

master
junh_eee(이준희) 7 months ago
parent
commit
fd911dce8b
  1. 37
      src/components/account/find/AccountFindPassword.js
  2. 35
      src/components/account/find/AccountFindUserId.js
  3. 10
      src/components/account/login/AccountLogin.js
  4. 8
      src/components/account/mypage/AccountMypagePwForm.js
  5. 24
      src/components/account/register/AccountRegisterForm.js
  6. 37
      src/containers/account/mypage/AccountMypageContainer.js
  7. 8
      src/containers/analysis/history/AnalysisHistoryContainer.js
  8. 22
      src/containers/basis/dron/BasisIdntfContainer.js

37
src/components/account/find/AccountFindPassword.js

@ -22,7 +22,7 @@ import {
updateUserPw
} from '@src/_redux/features/account/find/findThunk';
import { openModal } from '@src/_redux/features/comn/message/messageSlice';
import { MODAL_CRTFYHP, MODAL_DESC, MODAL_TITLE } from '@src/configs/msgConst';
import { MODAL_CRTFYHP, MODAL_BODY, MODAL_HEADER } from '@src/configs/msgConst';
export const AccountFindPassword = props => {
const dispatch = useDispatch();
@ -73,22 +73,28 @@ export const AccountFindPassword = props => {
const handlerSend = async () => {
if (!inputId) {
handlerOpenModal(MODAL_TITLE.crtfyhp, '아이디를' + MODAL_DESC.valid);
handlerOpenModal(MODAL_HEADER.crtfyhp, '아이디를' + MODAL_BODY.valid);
return;
}
if (!inputHpno) {
handlerOpenModal(MODAL_TITLE.crtfyhp, '휴대폰 번호를' + MODAL_DESC.valid);
handlerOpenModal(
MODAL_HEADER.crtfyhp,
'휴대폰 번호를' + MODAL_BODY.valid
);
return;
}
if (inputHpno.length < 11) {
handlerOpenModal(MODAL_TITLE.crtfyhp, '올바른 번호를' + MODAL_DESC.valid);
handlerOpenModal(
MODAL_HEADER.crtfyhp,
'올바른 번호를' + MODAL_BODY.valid
);
return;
}
if (sendCount >= 3) {
handlerOpenModal(MODAL_TITLE.crtfyhp, MODAL_CRTFYHP.count);
handlerOpenModal(MODAL_HEADER.crtfyhp, MODAL_CRTFYHP.count);
return;
}
@ -98,11 +104,11 @@ export const AccountFindPassword = props => {
if (data.code === -1) {
handlerOpenModal(
MODAL_TITLE.crtfyhp,
MODAL_HEADER.crtfyhp,
'가입되지 않은 회원정보입니다. 다시 확인해주세요.'
);
} else if (data.code === 0) {
handlerOpenModal(MODAL_TITLE.crtfyhp, MODAL_CRTFYHP.send);
handlerOpenModal(MODAL_HEADER.crtfyhp, MODAL_CRTFYHP.send);
timeStart();
}
};
@ -137,7 +143,7 @@ export const AccountFindPassword = props => {
setIsRunning(false);
// setValue('crtfyNo', '');
// setCrtfyNo('');
handlerOpenModal(MODAL_TITLE.crtfyhp, MODAL_CRTFYHP.expire);
handlerOpenModal(MODAL_HEADER.crtfyhp, MODAL_CRTFYHP.expire);
}
}, 1000);
@ -154,17 +160,20 @@ export const AccountFindPassword = props => {
confirm: '인증번호 인증'
};
if (!inputId) {
handlerOpenModal(MODAL_TITLE.crtfyhp, '아이디를' + MODAL_DESC.valid);
handlerOpenModal(MODAL_HEADER.crtfyhp, '아이디를' + MODAL_BODY.valid);
return;
}
if (!inputHpno) {
handlerOpenModal(MODAL_TITLE.crtfyhp, '휴대폰 번호를' + MODAL_DESC.valid);
handlerOpenModal(
MODAL_HEADER.crtfyhp,
'휴대폰 번호를' + MODAL_BODY.valid
);
return;
}
if (!inputCrtfy) {
handlerOpenModal(MODAL_TITLE.crtfyhp, MODAL_CRTFYHP.valid);
handlerOpenModal(MODAL_HEADER.crtfyhp, MODAL_CRTFYHP.valid);
return;
}
@ -174,10 +183,10 @@ export const AccountFindPassword = props => {
);
if (!data.result) {
handlerOpenModal(MODAL_TITLE.crtfyhp, MODAL_CRTFYHP.failed);
handlerOpenModal(MODAL_HEADER.crtfyhp, MODAL_CRTFYHP.failed);
return;
} else {
handlerOpenModal(MODAL_TITLE.crtfyhp, MODAL_CRTFYHP.confirm);
handlerOpenModal(MODAL_HEADER.crtfyhp, MODAL_CRTFYHP.confirm);
setIsCrtfy(true);
setIsRunning(false);
}
@ -186,7 +195,7 @@ export const AccountFindPassword = props => {
const handlerUpdatePw = async () => {
const modalHeader = '비밀번호 변경';
if (!inputNewPw || !inputNewPwCk) {
handlerOpenModal(modalHeader, '비밀번호를' + MODAL_DESC.valid);
handlerOpenModal(modalHeader, '비밀번호를' + MODAL_BODY.valid);
return;
}

35
src/components/account/find/AccountFindUserId.js

@ -22,7 +22,7 @@ import {
sendCrtfyhpForId
} from '@src/_redux/features/account/find/findThunk';
import { openModal } from '@src/_redux/features/comn/message/messageSlice';
import { MODAL_CRTFYHP, MODAL_DESC, MODAL_TITLE } from '@src/configs/msgConst';
import { MODAL_CRTFYHP, MODAL_BODY, MODAL_HEADER } from '@src/configs/msgConst';
export const AccountFindUserId = props => {
const dispatch = useDispatch();
@ -75,22 +75,28 @@ export const AccountFindUserId = props => {
// 인증번호 발송 헨들러
const handlerSend = async () => {
if (!inputName) {
handlerOpenModal(MODAL_TITLE.crtfyhp, '이름을' + MODAL_DESC.valid);
handlerOpenModal(MODAL_HEADER.crtfyhp, '이름을' + MODAL_BODY.valid);
return;
}
if (!inputHpno) {
handlerOpenModal(MODAL_TITLE.crtfyhp, '휴대폰 번호를' + MODAL_DESC.valid);
handlerOpenModal(
MODAL_HEADER.crtfyhp,
'휴대폰 번호를' + MODAL_BODY.valid
);
return;
}
if (inputHpno.length < 11) {
handlerOpenModal(MODAL_TITLE.crtfyhp, '올바른 번호를' + MODAL_DESC.valid);
handlerOpenModal(
MODAL_HEADER.crtfyhp,
'올바른 번호를' + MODAL_BODY.valid
);
return;
}
if (sendCount >= 3) {
handlerOpenModal(MODAL_TITLE.crtfyhp, MODAL_CRTFYHP.count);
handlerOpenModal(MODAL_HEADER.crtfyhp, MODAL_CRTFYHP.count);
return;
}
@ -102,11 +108,11 @@ export const AccountFindUserId = props => {
);
if (data.code === -1) {
handlerOpenModal(
MODAL_TITLE.crtfyhp,
MODAL_HEADER.crtfyhp,
'가입되지 않은 회원정보입니다. 다시 확인해주세요.'
);
} else if (data.code === 0) {
handlerOpenModal(MODAL_TITLE.crtfyhp, MODAL_CRTFYHP.send);
handlerOpenModal(MODAL_HEADER.crtfyhp, MODAL_CRTFYHP.send);
timeStart();
}
};
@ -143,7 +149,7 @@ export const AccountFindUserId = props => {
setIsRunning(false);
// setValue('crtfyNo', '');
// setCrtfyNo('');
handlerOpenModal(MODAL_TITLE.crtfyhp, MODAL_CRTFYHP.expire);
handlerOpenModal(MODAL_HEADER.crtfyhp, MODAL_CRTFYHP.expire);
}
}, 1000);
@ -156,17 +162,20 @@ export const AccountFindUserId = props => {
const handlerConfirm = async () => {
if (!inputHpno) {
handlerOpenModal(MODAL_TITLE.crtfyhp, '휴대폰 번호를' + MODAL_DESC.valid);
handlerOpenModal(
MODAL_HEADER.crtfyhp,
'휴대폰 번호를' + MODAL_BODY.valid
);
return;
}
if (!inputName) {
handlerOpenModal(MODAL_TITLE.crtfyhp, '이름을' + MODAL_DESC.valid);
handlerOpenModal(MODAL_HEADER.crtfyhp, '이름을' + MODAL_BODY.valid);
return;
}
if (!inputCrtfy) {
handlerOpenModal(MODAL_TITLE.crtfyhp, MODAL_CRTFYHP.valid);
handlerOpenModal(MODAL_HEADER.crtfyhp, MODAL_CRTFYHP.valid);
return;
}
@ -175,10 +184,10 @@ export const AccountFindUserId = props => {
);
if (!data.result) {
handlerOpenModal(MODAL_TITLE.crtfyhp, MODAL_CRTFYHP.failed);
handlerOpenModal(MODAL_HEADER.crtfyhp, MODAL_CRTFYHP.failed);
return;
} else {
handlerOpenModal(MODAL_TITLE.crtfyhp, MODAL_CRTFYHP.confirm);
handlerOpenModal(MODAL_HEADER.crtfyhp, MODAL_CRTFYHP.confirm);
setIsCrtfy(true);
setIsRunning(false);
}

10
src/components/account/login/AccountLogin.js

@ -14,7 +14,7 @@ import { useEffect, useState } from 'react';
import kacLogo from '../../../assets/images/logo/kac_logo.svg';
import { setLogin } from '@src/_redux/features/account/auth/authThunk';
import { openModal } from '@src/_redux/features/comn/message/messageSlice';
import { MODAL_TITLE, MODAL_DESC } from '@src/configs/msgConst';
import { MODAL_HEADER, MODAL_BODY } from '@src/configs/msgConst';
export const AccountLogin = ({ history }) => {
const dispatch = useDispatch();
@ -46,16 +46,16 @@ export const AccountLogin = ({ history }) => {
if (!loginForm.userId) {
dispatch(
openModal({
header: MODAL_TITLE.valid,
body: '아이디를' + MODAL_DESC.valid
header: MODAL_HEADER.valid,
body: '아이디를' + MODAL_BODY.valid
})
);
return;
} else if (!loginForm.userPswd) {
dispatch(
openModal({
header: MODAL_TITLE.valid,
body: '비밀번호를' + MODAL_DESC.valid
header: MODAL_HEADER.valid,
body: '비밀번호를' + MODAL_BODY.valid
})
);
return;

8
src/components/account/mypage/AccountMypagePwForm.js

@ -18,7 +18,7 @@ import {
updateUserPw
} from '@src/_redux/features/account/auth/authThunk';
import { openModal } from '@src/_redux/features/comn/message/messageSlice';
import { MODAL_TITLE } from '@src/configs/msgConst';
import { MODAL_HEADER } from '@src/configs/msgConst';
const AccountMypagePwForm = ({ activeTab }) => {
const dispatch = useDispatch();
@ -99,11 +99,11 @@ const AccountMypagePwForm = ({ activeTab }) => {
/^(?=.*[A-Za-z])(?=.*[0-9])(?=.*[@$!%*#?&])[A-Za-z0-9@$!%*#?&]{8,20}$/;
if (!reg_pw.test(inputs.newPswd && inputs.newPswdConfirm)) {
handlerOpenModal(
MODAL_TITLE.valid,
MODAL_HEADER.valid,
'8 자 이상, 20 자 미만 영문자/숫자/특수문자(@$!%*#?&) 조합하여 입력해주세요.'
);
} else if (inputs.newPswd != inputs.newPswdConfirm) {
handlerOpenModal(MODAL_TITLE.valid, '비밀번호가 일치하지 않습니다.');
handlerOpenModal(MODAL_HEADER.valid, '비밀번호가 일치하지 않습니다.');
} else {
dispatch(updateUserPw(inputs));
}
@ -112,7 +112,7 @@ const AccountMypagePwForm = ({ activeTab }) => {
// 비밀번호 확인
const pwok = () => {
if (!userPswd) {
handlerOpenModal(MODAL_TITLE.valid, '기존 비밀번호를 입력해주세요.');
handlerOpenModal(MODAL_HEADER.valid, '기존 비밀번호를 입력해주세요.');
} else {
dispatch(checkUserPw(userPswd));
}

24
src/components/account/register/AccountRegisterForm.js

@ -20,7 +20,7 @@ import {
sendCrtfyhp
} from '@src/_redux/features/account/register/registerThunk';
import { openModal } from '@src/_redux/features/comn/message/messageSlice';
import { MODAL_CRTFYHP, MODAL_DESC, MODAL_TITLE } from '@src/configs/msgConst';
import { MODAL_CRTFYHP, MODAL_BODY, MODAL_HEADER } from '@src/configs/msgConst';
export const AccountRegisterForm = ({
stepper,
@ -104,19 +104,22 @@ export const AccountRegisterForm = ({
if (!vData.clncd || !vData.hpno) {
handlerOpenModal(
MODAL_TITLE.crtfyhp,
MODAL_HEADER.crtfyhp,
'휴대폰 번호를' + MODAL_CRTFYHP.valid
);
return;
}
if (vData.hpno.length < 11) {
handlerOpenModal(MODAL_TITLE.crtfyhp, '올바른 번호를' + MODAL_DESC.valid);
handlerOpenModal(
MODAL_HEADER.crtfyhp,
'올바른 번호를' + MODAL_BODY.valid
);
return;
}
if (sendCount >= 3) {
handlerOpenModal(MODAL_TITLE.crtfyhp, MODAL_CRTFYHP.count);
handlerOpenModal(MODAL_HEADER.crtfyhp, MODAL_CRTFYHP.count);
return;
}
@ -124,11 +127,11 @@ export const AccountRegisterForm = ({
if (!data.result) {
if (data.code === -1) {
handlerOpenModal(
MODAL_TITLE.crtfyhp,
MODAL_HEADER.crtfyhp,
'이미 가입된 휴대폰입니다. 비밀번호 찾기를 이용해주세요.'
);
} else {
handlerOpenModal(MODAL_TITLE.crtfyhp, MODAL_CRTFYHP.failed);
handlerOpenModal(MODAL_HEADER.crtfyhp, MODAL_CRTFYHP.failed);
}
return;
@ -245,12 +248,15 @@ export const AccountRegisterForm = ({
const vData = getValues();
if (!vData.clncd || !vData.hpno) {
handlerOpenModal(MODAL_TITLE.crtfyhp, '휴대폰 번호를' + MODAL_DESC.valid);
handlerOpenModal(
MODAL_HEADER.crtfyhp,
'휴대폰 번호를' + MODAL_BODY.valid
);
return false;
}
if (!vData.crtfyNo) {
handlerOpenModal(MODAL_TITLE.crtfyhp, MODAL_CRTFYHP.valid);
handlerOpenModal(MODAL_HEADER.crtfyhp, MODAL_CRTFYHP.valid);
return false;
}
@ -258,7 +264,7 @@ export const AccountRegisterForm = ({
confirmCrtfyhp({ hpno: vData.hpno, crtfyNo: vData.crtfyNo })
);
if (!data.result) {
handlerOpenModal(MODAL_TITLE.crtfyhp, MODAL_CRTFYHP.failed);
handlerOpenModal(MODAL_HEADER.crtfyhp, MODAL_CRTFYHP.failed);
return;
}
setIsRunning(true);

37
src/containers/account/mypage/AccountMypageContainer.js

@ -18,7 +18,7 @@ import {
deleteUser
} from '@src/_redux/features/account/auth/authThunk';
import { openModal } from '@src/_redux/features/comn/message/messageSlice';
import { MODAL_CRTFYHP, MODAL_TITLE, MODAL_DESC } from '@src/configs/msgConst';
import { MODAL_CRTFYHP, MODAL_HEADER, MODAL_BODY } from '@src/configs/msgConst';
// ** Function to toggle tabs
const AccountMypageContainer = () => {
@ -130,7 +130,7 @@ const AccountMypageContainer = () => {
setInputCrtfy('crtfyhpNo', '');
// setCrtfyNo('');
handlerOpenModal(MODAL_TITLE.crtfyhp, MODAL_CRTFYHP.expire);
handlerOpenModal(MODAL_HEADER.crtfyhp, MODAL_CRTFYHP.expire);
}
}, 1000);
@ -147,18 +147,24 @@ const AccountMypageContainer = () => {
// const vData = getValues();
if (!inputHpno) {
handlerOpenModal(MODAL_TITLE.crtfyhp, '휴대폰 번호를' + MODAL_DESC.valid);
handlerOpenModal(
MODAL_HEADER.crtfyhp,
'휴대폰 번호를' + MODAL_BODY.valid
);
return;
}
if (sendCount >= 3) {
handlerOpenModal(
MODAL_TITLE.crtfyhp,
MODAL_HEADER.crtfyhp,
'인증번호 발송은 3회까지만 가능합니다.'
);
return;
}
if (inputHpno.length < 11) {
handlerOpenModal(MODAL_TITLE.crtfyhp, '올바른 번호를' + MODAL_DESC.valid);
handlerOpenModal(
MODAL_HEADER.crtfyhp,
'올바른 번호를' + MODAL_BODY.valid
);
return;
}
@ -166,13 +172,13 @@ const AccountMypageContainer = () => {
const { payload: data } = await dispatch(sendCrtfyhp(inputHpno));
if (!data.result) {
if (data.code === -1) {
handlerOpenModal(MODAL_TITLE.crtfyhp, '이미 가입된 휴대폰입니다.');
handlerOpenModal(MODAL_HEADER.crtfyhp, '이미 가입된 휴대폰입니다.');
} else {
handlerOpenModal(MODAL_TITLE.crtfyhp, MODAL_CRTFYHP.failed);
handlerOpenModal(MODAL_HEADER.crtfyhp, MODAL_CRTFYHP.failed);
}
return;
} else {
handlerOpenModal(MODAL_TITLE.crtfyhp, MODAL_CRTFYHP.send);
handlerOpenModal(MODAL_HEADER.crtfyhp, MODAL_CRTFYHP.send);
}
if (isRunning) {
@ -190,12 +196,15 @@ const AccountMypageContainer = () => {
//const vData = getValues();
if (!inputHpno) {
handlerOpenModal(MODAL_TITLE.crtfyhp, '휴대폰 번호를' + MODAL_DESC.valid);
handlerOpenModal(
MODAL_HEADER.crtfyhp,
'휴대폰 번호를' + MODAL_BODY.valid
);
return false;
}
if (!inputCrtfy) {
handlerOpenModal(MODAL_TITLE.crtfyhp, MODAL_CRTFYHP.valid);
handlerOpenModal(MODAL_HEADER.crtfyhp, MODAL_CRTFYHP.valid);
return false;
}
@ -205,11 +214,11 @@ const AccountMypageContainer = () => {
);
if (!data.result) {
handlerOpenModal(MODAL_TITLE.crtfyhp, MODAL_CRTFYHP.failed);
handlerOpenModal(MODAL_HEADER.crtfyhp, MODAL_CRTFYHP.failed);
} else if (data.code === 0) {
handlerOpenModal(MODAL_TITLE.crtfyhp, MODAL_CRTFYHP.send);
handlerOpenModal(MODAL_HEADER.crtfyhp, MODAL_CRTFYHP.send);
} else {
handlerOpenModal(MODAL_TITLE.crtfyhp, MODAL_CRTFYHP.confirm);
handlerOpenModal(MODAL_HEADER.crtfyhp, MODAL_CRTFYHP.confirm);
setOkinput(!okinput);
}
setIsRunning(true);
@ -263,7 +272,7 @@ const AccountMypageContainer = () => {
hpno: okcheck
};
if (!reg_email.test(param.email)) {
handlerOpenModal(MODAL_TITLE.valid, '이메일 형식을 다시 확인해주세요.');
handlerOpenModal(MODAL_HEADER.valid, '이메일 형식을 다시 확인해주세요.');
} else {
dispatch(updateUser(param));
}

8
src/containers/analysis/history/AnalysisHistoryContainer.js

@ -17,7 +17,7 @@ import {
getJoinGroupList
} from '@src/_redux/features/basis/group/groupThunk';
import { openModal } from '@src/_redux/features/comn/message/messageSlice';
import { MODAL_DESC, MODAL_TITLE } from '@src/configs/msgConst';
import { MODAL_BODY, MODAL_HEADER } from '@src/configs/msgConst';
export const AnalysisHistoryContainer = props => {
const dispatch = useDispatch();
@ -192,14 +192,14 @@ export const AnalysisHistoryContainer = props => {
if (!params.stDate || !params.endDate) {
dispatch(
openModal({
header: MODAL_TITLE.valid,
body: '올바른 일자를' + MODAL_DESC.valid
header: MODAL_HEADER.valid,
body: '올바른 일자를' + MODAL_BODY.valid
})
);
} else if (!params.groupId) {
dispatch(
openModal({
header: MODAL_TITLE.valid,
header: MODAL_HEADER.valid,
body: '그룹을 선택해주세요.'
})
);

22
src/containers/basis/dron/BasisIdntfContainer.js

@ -8,7 +8,7 @@ import {
getIdntfList
} from '@src/_redux/features/basis/drone/droneThunk';
import { openModal } from '@src/_redux/features/comn/message/messageSlice';
import { MODAL_DESC, MODAL_TITLE } from '@src/configs/msgConst';
import { MODAL_BODY, MODAL_HEADER } from '@src/configs/msgConst';
export const BasisIdntfContainer = props => {
const dispatch = useDispatch();
@ -103,24 +103,24 @@ export const BasisIdntfContainer = props => {
/^[가-힣a-zA-Z0-9][^!@#$%^&*()+\=\[\]{};':"\\|,.<>\/?\s]*$/;
if (idntf.idntfNum.length < 1) {
handlerOpenModal(MODAL_TITLE.valid, '식별번호를' + MODAL_DESC.valid);
handlerOpenModal(MODAL_HEADER.valid, '식별번호를' + MODAL_BODY.valid);
checking = false;
return false;
}
if (!idntf.ownerNm && idntf.ownerNm === '') {
handlerOpenModal(MODAL_TITLE.valid, '소유자명을' + MODAL_DESC.valid);
handlerOpenModal(MODAL_HEADER.valid, '소유자명을' + MODAL_BODY.valid);
checking = false;
return false;
}
if (!idntf.hpno && idntf.hpno === '') {
handlerOpenModal(MODAL_TITLE.valid, '연락처를' + MODAL_DESC.valid);
handlerOpenModal(MODAL_HEADER.valid, '연락처를' + MODAL_BODY.valid);
checking = false;
return false;
}
if (!check_kor.test(idntf.idntfNum)) {
handlerOpenModal(
MODAL_TITLE.valid,
MODAL_HEADER.valid,
'식별번호에 지원되지 않는 특수문자입니다.'
);
checking = false;
@ -129,14 +129,17 @@ export const BasisIdntfContainer = props => {
if (!check_kor.test(idntf.ownerNm)) {
handlerOpenModal(
MODAL_TITLE.valid,
MODAL_HEADER.valid,
'소유자명에 지원되지 않는 특수문자입니다.'
);
checking = false;
return false;
}
if (!check_num.test(idntf.hpno)) {
handlerOpenModal(MODAL_TITLE.valid, '형식에 맞지 않는 연락처입니다.');
handlerOpenModal(
MODAL_HEADER.valid,
'형식에 맞지 않는 연락처입니다.'
);
checking = false;
return false;
}
@ -164,7 +167,10 @@ export const BasisIdntfContainer = props => {
})
);
} else {
handlerOpenModal(MODAL_TITLE.valid, '식별장치 정보를' + MODAL_DESC.valid);
handlerOpenModal(
MODAL_HEADER.valid,
'식별장치 정보를' + MODAL_BODY.valid
);
return false;
}
};

Loading…
Cancel
Save