[ST] - refactor: 전남광주통합특별시 본청 데이터 관련 저장&제출 alert 추가
This commit is contained in:
@@ -42,8 +42,10 @@ import type {
|
||||
import {
|
||||
filterBySelectedAdmdstCd,
|
||||
isGugunOkForToolbar,
|
||||
isJeonnamGwangjuSidoAllSearch,
|
||||
isJeonnamGwangjuSidoAllToolbarException,
|
||||
isSubmitOkForToolbar,
|
||||
JEONNAM_GWANGJU_SIDO_ALL_SAVE_SUBMIT_MESSAGE,
|
||||
resolveNoApplicableForRequest,
|
||||
toInputSearchRegion,
|
||||
} from "@/entities/statistics";
|
||||
@@ -1340,7 +1342,12 @@ const SewageExcretaRelatedInp = () => {
|
||||
return;
|
||||
}
|
||||
|
||||
if (await confirm("제출 하시겠습니까?")) {
|
||||
const submitConfirmMessage =
|
||||
ARTICLE_EDIT_TAB_KEYS.has(tabKey) &&
|
||||
isJeonnamGwangjuSidoAllSearch(sidoListRef.current, lastSearchedValues)
|
||||
? JEONNAM_GWANGJU_SIDO_ALL_SAVE_SUBMIT_MESSAGE
|
||||
: "제출 하시겠습니까?";
|
||||
if (await confirm(submitConfirmMessage)) {
|
||||
setShowSubmitDialog(true);
|
||||
}
|
||||
})();
|
||||
@@ -1622,7 +1629,12 @@ const SewageExcretaRelatedInp = () => {
|
||||
alert("해당 탭은 저장 기능이 준비되지 않았습니다.");
|
||||
return;
|
||||
}
|
||||
if (!(await confirm("저장 하시겠습니까?"))) return;
|
||||
const saveConfirmMessage =
|
||||
ARTICLE_EDIT_TAB_KEYS.has(tabKey) &&
|
||||
isJeonnamGwangjuSidoAllSearch(sidoListRef.current, lastSearchedValues)
|
||||
? JEONNAM_GWANGJU_SIDO_ALL_SAVE_SUBMIT_MESSAGE
|
||||
: "저장 하시겠습니까?";
|
||||
if (!(await confirm(saveConfirmMessage))) return;
|
||||
|
||||
commitActiveGrid();
|
||||
|
||||
|
||||
@@ -41,8 +41,10 @@ import type {
|
||||
import {
|
||||
filterBySelectedAdmdstCd,
|
||||
isGugunOkForToolbar,
|
||||
isJeonnamGwangjuSidoAllSearch,
|
||||
isJeonnamGwangjuSidoAllToolbarException,
|
||||
isSubmitOkForToolbar,
|
||||
JEONNAM_GWANGJU_SIDO_ALL_SAVE_SUBMIT_MESSAGE,
|
||||
toInputSearchRegion,
|
||||
} from "@/entities/statistics";
|
||||
|
||||
@@ -846,7 +848,13 @@ const SewerageFinanceInp = () => {
|
||||
alert("제출할 데이터가 없습니다.");
|
||||
return;
|
||||
}
|
||||
if (await confirm("제출 하시겠습니까?")) {
|
||||
const submitConfirmMessage = isJeonnamGwangjuSidoAllSearch(
|
||||
sidoListRef.current,
|
||||
lastSearchedValues,
|
||||
)
|
||||
? JEONNAM_GWANGJU_SIDO_ALL_SAVE_SUBMIT_MESSAGE
|
||||
: "제출 하시겠습니까?";
|
||||
if (await confirm(submitConfirmMessage)) {
|
||||
setShowSubmitDialog(true);
|
||||
}
|
||||
})();
|
||||
@@ -1043,7 +1051,13 @@ const SewerageFinanceInp = () => {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(await confirm("저장 하시겠습니까?"))) return;
|
||||
const saveConfirmMessage = isJeonnamGwangjuSidoAllSearch(
|
||||
sidoListRef.current,
|
||||
lastSearchedValues,
|
||||
)
|
||||
? JEONNAM_GWANGJU_SIDO_ALL_SAVE_SUBMIT_MESSAGE
|
||||
: "저장 하시겠습니까?";
|
||||
if (!(await confirm(saveConfirmMessage))) return;
|
||||
|
||||
const currentData = getTabGridRows(tabKey);
|
||||
if (!currentData.length) {
|
||||
|
||||
@@ -11,6 +11,8 @@ export { useScheduleInfo } from "./api/dashboard/schedule-info-queries";
|
||||
export { scheduleInfoApi } from "./api/dashboard/schedule-info-service";
|
||||
export { imrApi } from "./api/imr-api";
|
||||
export {
|
||||
JEONNAM_GWANGJU_SIDO_ALL_SAVE_SUBMIT_MESSAGE,
|
||||
isJeonnamGwangjuSidoAllSearch,
|
||||
isJeonnamGwangjuSidoAllToolbarException,
|
||||
} from "./lib/jeonnam-gwangju-sido-all-toolbar";
|
||||
export {
|
||||
|
||||
@@ -23,6 +23,16 @@ function isJeonnamGwangjuUnifiedSido(
|
||||
return (values.sido ?? "").trim() === "전남광주통합특별시";
|
||||
}
|
||||
|
||||
export const JEONNAM_GWANGJU_SIDO_ALL_SAVE_SUBMIT_MESSAGE =
|
||||
"전남광주통합특별시는 시군구를 선택하지 않고 저장 및 제출 시 본청 데이터만 반영됩니다.\n각 시군구의 데이터는 선택 후 새로 조회하여 작성해주세요.";
|
||||
|
||||
export function isJeonnamGwangjuSidoAllSearch(
|
||||
sidoList: readonly Sido[] | undefined,
|
||||
values: SidoGugunLookup | null | undefined,
|
||||
): boolean {
|
||||
return isJeonnamGwangjuUnifiedSido(sidoList, values) && isEmptyOrAllGugun(values);
|
||||
}
|
||||
|
||||
export function isJeonnamGwangjuSidoAllToolbarException(
|
||||
sidoList: readonly Sido[] | undefined,
|
||||
values: SidoGugunLookup | null | undefined,
|
||||
@@ -31,5 +41,5 @@ export function isJeonnamGwangjuSidoAllToolbarException(
|
||||
if (!SIDO_ALL_TOOLBAR_USER_IDS.has((userId ?? "").trim().toUpperCase())) {
|
||||
return false;
|
||||
}
|
||||
return isJeonnamGwangjuUnifiedSido(sidoList, values) && isEmptyOrAllGugun(values);
|
||||
return isJeonnamGwangjuSidoAllSearch(sidoList, values);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user