[as] feat: RAG 인덱싱 상태일 때 검토자 지정 버튼 분기 처리
This commit is contained in:
@@ -40,6 +40,7 @@ export type {
|
||||
FnrsCnsltnSplmntDmndItem,
|
||||
FnrsCnsltnSplmntDmndResponseDto,
|
||||
FnrsSharItem,
|
||||
RagIndexingInfoDto,
|
||||
} from "./model/fnrs-cnsltn-interface";
|
||||
export type {
|
||||
EnvoActnReviewReqDto,
|
||||
|
||||
@@ -151,6 +151,14 @@ export type FnrsCnsltnSplmntDmndResponseDto = FnrsCnsltnSplmntDmndItem &
|
||||
fnrsCnsltnDocNo?: string;
|
||||
};
|
||||
|
||||
/** 백엔드 RagIndexingInfoDto */
|
||||
export interface RagIndexingInfoDto {
|
||||
isInProgress: boolean;
|
||||
elapsedSeconds?: number;
|
||||
estimatedRemainingSeconds?: number;
|
||||
message?: string;
|
||||
}
|
||||
|
||||
/** 백엔드 FnrsCnsltnMngDetResponseDto */
|
||||
export type FnrsCnsltnMngDetResponseDto = PbadmsMngDetResponseBase<
|
||||
FnrsCnsltnMngResponseDto,
|
||||
@@ -159,6 +167,7 @@ export type FnrsCnsltnMngDetResponseDto = PbadmsMngDetResponseBase<
|
||||
> & {
|
||||
fnrsSharList?: FnrsSharBizCstTreeDto[];
|
||||
sharAtchFileList?: AtflMngClientResponseDto[];
|
||||
ragIndexingInfo?: RagIndexingInfoDto | null;
|
||||
};
|
||||
|
||||
/** 백엔드 FnrsCnsltnApplySaveRequestDto */
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import type { RagIndexingInfoDto } from "@/entities/fnrs-cnsltn";
|
||||
|
||||
const AI_PENDING_STATUS_CODES = ["FV", "AC", "AV"] as const;
|
||||
|
||||
type AiPendingStatusCode = (typeof AI_PENDING_STATUS_CODES)[number];
|
||||
@@ -17,5 +19,17 @@ function getAiPendingMessage(prgrsSttsComCd: string): string {
|
||||
return AI_PENDING_MESSAGES[prgrsSttsComCd as AiPendingStatusCode];
|
||||
}
|
||||
|
||||
export { AI_PENDING_STATUS_CODES, getAiPendingMessage, isAiPendingStatus };
|
||||
function isRagIndexingInProgress(
|
||||
prgrsSttsComCd: string,
|
||||
ragIndexingInfo?: RagIndexingInfoDto | null,
|
||||
): boolean {
|
||||
return prgrsSttsComCd === "ER" && ragIndexingInfo?.isInProgress === true;
|
||||
}
|
||||
|
||||
export {
|
||||
AI_PENDING_STATUS_CODES,
|
||||
getAiPendingMessage,
|
||||
isAiPendingStatus,
|
||||
isRagIndexingInProgress,
|
||||
};
|
||||
export type { AiPendingStatusCode };
|
||||
|
||||
@@ -41,6 +41,7 @@ import {
|
||||
import { SplmntDmndDialog, type SplmntDmndDialogConfirmPayload } from "@/widgets/pbadms-sprt";
|
||||
import { Button } from "@common/components";
|
||||
|
||||
import { isRagIndexingInProgress } from "../../lib/ai-pending-utils";
|
||||
import {
|
||||
FNRS_CNSLTN_VIEW_BUTTON_ACTION,
|
||||
type FnrsCnsltnViewButtonAction,
|
||||
@@ -627,16 +628,17 @@ function FloatingActionButtons({
|
||||
파일 보완 요청
|
||||
</Button>
|
||||
)}
|
||||
{shouldShowButton(FNRS_CNSLTN_VIEW_BUTTON_ACTION.dsgntRvwr) && (
|
||||
<Button
|
||||
onClick={() =>
|
||||
setActiveDialog(prgrsSttsComCd === "EV" ? "elaprDocPrgrs" : "elaprTmplt")
|
||||
}
|
||||
disabled={isProcessing}
|
||||
>
|
||||
검토자 지정
|
||||
</Button>
|
||||
)}
|
||||
{shouldShowButton(FNRS_CNSLTN_VIEW_BUTTON_ACTION.dsgntRvwr) &&
|
||||
!isRagIndexingInProgress(prgrsSttsComCd, data.ragIndexingInfo) && (
|
||||
<Button
|
||||
onClick={() =>
|
||||
setActiveDialog(prgrsSttsComCd === "EV" ? "elaprDocPrgrs" : "elaprTmplt")
|
||||
}
|
||||
disabled={isProcessing}
|
||||
>
|
||||
검토자 지정
|
||||
</Button>
|
||||
)}
|
||||
{shouldShowButton(FNRS_CNSLTN_VIEW_BUTTON_ACTION.actnCmptn) && (
|
||||
<Button color="green" onClick={handleActnCmptnClick} disabled={isProcessing}>
|
||||
조치 완료
|
||||
|
||||
@@ -14,7 +14,7 @@ import {
|
||||
} from "@/widgets/pbadms-sprt";
|
||||
import { Skeleton } from "@common/components";
|
||||
|
||||
import { getAiPendingMessage, isAiPendingStatus } from "../lib/ai-pending-utils";
|
||||
import { getAiPendingMessage, isAiPendingStatus, isRagIndexingInProgress } from "../lib/ai-pending-utils";
|
||||
import { needsRoleUser01AtrzResolve } from "../lib/button-config";
|
||||
import { getEditableReviewStep } from "../lib/review-step-utils";
|
||||
import { EMPTY_CKLST_RESULT_LIST, useChecklistFormState } from "../lib/use-checklist-form-state";
|
||||
@@ -95,20 +95,25 @@ function FnrsViewPage({ id }: FnrsViewPageProps) {
|
||||
detDto.prgrsSttsComCd || "",
|
||||
);
|
||||
const isAiPending = isAiPendingStatus(detDto.prgrsSttsComCd || "");
|
||||
const isRagIndexing = isRagIndexingInProgress(detDto.prgrsSttsComCd || "", data.ragIndexingInfo);
|
||||
const showPendingBanner = isAiPending || isRagIndexing;
|
||||
const pendingMessage = isRagIndexing
|
||||
? (data.ragIndexingInfo?.message ?? "")
|
||||
: getAiPendingMessage(detDto.prgrsSttsComCd || "");
|
||||
|
||||
return (
|
||||
<div className="mt-4">
|
||||
<SectionCollapsibleGroup>
|
||||
<div className="sticky top-[6rem] z-30 flex items-center gap-4 bg-container px-4 py-2">
|
||||
<SectionCollapsibleToggle />
|
||||
{isAiPending && (
|
||||
{showPendingBanner && (
|
||||
<div className="flex items-center gap-2">
|
||||
<span className="relative flex size-3">
|
||||
<span className="absolute inline-flex h-full w-full animate-ping rounded-full bg-primary opacity-75"></span>
|
||||
<span className="relative inline-flex size-3 rounded-full bg-primary"></span>
|
||||
</span>
|
||||
<TextShimmer active className="text-xl">
|
||||
{getAiPendingMessage(detDto.prgrsSttsComCd || "")}
|
||||
{pendingMessage}
|
||||
</TextShimmer>
|
||||
</div>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user