fix: delete submit button at regist, edit form
This commit is contained in:
parent
8001a027ef
commit
df6d5e964c
@ -95,13 +95,13 @@ export default function ButtonForm({ mode, setMode, data }: ButtonFormProps) {
|
||||
}
|
||||
|
||||
/** 저장 로직 */
|
||||
const handleSave = (isTemporary: boolean, isSubmitProcess: boolean) => {
|
||||
const handleSave = (isTemporary: boolean) => {
|
||||
const emptyField = validateSurveyDetail(data.roof)
|
||||
|
||||
if (isTemporary) {
|
||||
tempSaveProcess()
|
||||
} else {
|
||||
saveProcess(emptyField, isSubmitProcess)
|
||||
saveProcess(emptyField)
|
||||
}
|
||||
}
|
||||
|
||||
@ -133,15 +133,11 @@ export default function ButtonForm({ mode, setMode, data }: ButtonFormProps) {
|
||||
}
|
||||
|
||||
/** 저장 로직 */
|
||||
const saveProcess = async (emptyField: string | null, isSubmitProcess?: boolean) => {
|
||||
const saveProcess = async (emptyField: string | null) => {
|
||||
if (emptyField?.trim() === '') {
|
||||
if (!isSubmitProcess) {
|
||||
showConfirm(CONFIRM_MESSAGE.SAVE_CONFIRM, async () => {
|
||||
await handleSuccessfulSave(isSubmitProcess)
|
||||
})
|
||||
} else {
|
||||
await handleSuccessfulSave(isSubmitProcess)
|
||||
}
|
||||
showConfirm(CONFIRM_MESSAGE.SAVE_CONFIRM, async () => {
|
||||
await handleSuccessfulSave()
|
||||
})
|
||||
} else {
|
||||
handleFailedSave(emptyField)
|
||||
}
|
||||
@ -208,10 +204,6 @@ export default function ButtonForm({ mode, setMode, data }: ButtonFormProps) {
|
||||
return
|
||||
}
|
||||
popupController.setSurveySaleSubmitPopup(true)
|
||||
} else {
|
||||
showConfirm(CONFIRM_MESSAGE.SAVE_AND_SUBMIT_CONFIRM, async () => {
|
||||
handleSave(false, true)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@ -254,9 +246,8 @@ export default function ButtonForm({ mode, setMode, data }: ButtonFormProps) {
|
||||
<div className="sale-form-btn-wrap">
|
||||
<div className="btn-flex-wrap">
|
||||
<ListButton />
|
||||
<TempButton handleSave={() => handleSave(true, false)} disabled={buttonDisabled} />
|
||||
<SaveButton handleSave={() => handleSave(false, false)} disabled={buttonDisabled} />
|
||||
{!isSubmit && permissions.isSubmiter && <SubmitButton handleSubmit={handleSubmit} disabled={buttonDisabled} />}
|
||||
<TempButton handleSave={() => handleSave(true)} disabled={buttonDisabled} />
|
||||
<SaveButton handleSave={() => handleSave(false)} disabled={buttonDisabled} />
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@ -102,15 +102,6 @@ export default function DetailForm() {
|
||||
return
|
||||
}, [modeset, id, pathname])
|
||||
|
||||
/** 제출 팝업 처리 - createSurvey 이후 popup 처리 시 노드 삽입 오류로 인해 별도 처리 */
|
||||
useEffect(() => {
|
||||
const show = searchParams.get('show')
|
||||
if (show === 'true' && !isLoadingSurveyDetail) {
|
||||
popupController.setSurveySaleSubmitPopup(true)
|
||||
router.replace(pathname)
|
||||
}
|
||||
}, [searchParams, pathname, isLoadingSurveyDetail])
|
||||
|
||||
/** 세션 데이터가 변경될 때 기본 정보 업데이트 */
|
||||
useEffect(() => {
|
||||
if (!session?.isLoggedIn) return
|
||||
|
||||
@ -37,9 +37,6 @@ export const CONFIRM_MESSAGE = {
|
||||
/** 삭제 확인 - "삭제하시겠습니까?" */
|
||||
DELETE_CONFIRM: '削除しますか?',
|
||||
|
||||
/** 저장 및 제출 확인 - "입력한 정보를 저장하고 보내시겠습니까?" */
|
||||
SAVE_AND_SUBMIT_CONFIRM: '記入した情報を保存して送信しますか?',
|
||||
|
||||
/** 문의 저장 확인 메세지 - "문의를 등록 하시겠습니까? 한화재팬 담당자에게 문의 메일이 발송됩니다." */
|
||||
SAVE_INQUIRY_CONFIRM: 'お問い合わせを登録しますか? Hanwha Japanの担当者にお問い合わせメールが送信されます。',
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user