Skip to content

Commit

Permalink
[FIX] review form button (#186) (#187)
Browse files Browse the repository at this point in the history
* feat: 임시저장 버튼 추가

* fix: 학생 페이지 심사 결과보고서 필드명 수정
  • Loading branch information
hynseok authored Oct 14, 2024
1 parent 1890d93 commit b30e463
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 11 deletions.
26 changes: 22 additions & 4 deletions src/components/pages/review/Review/FinalReview.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { Button, Stack, Text } from "@mantine/core";
"use client";

import { Button, Group, Stack, Text } from "@mantine/core";
import Link from "next/link";
import { UseFormReturnType } from "@mantine/form";
import {
Expand Down Expand Up @@ -35,7 +37,6 @@ export function FinalReview({
setCommentType,
}: FinalReviewProps) {
const { status } = form.values;
const hasPending = status === "PENDING";

return (
<Stack gap={0}>
Expand Down Expand Up @@ -71,17 +72,34 @@ export function FinalReview({
disabled={commentType !== "심사 의견 파일"}
/>
</RowGroup> */}
<Group justify="right" align="center" p={12}>
<Text fz={14} c="gray">
임시저장 시 합격여부는 자동으로 보류로 선택됩니다.
</Text>
</Group>
<RowGroup withBorderBottom={false}>
<ButtonRow
buttons={[
<Button
key="temp_save"
onClick={() => {
form.setValues({ status: "PENDING" });
}}
color="violet"
type="submit"
loading={currentState === "pending"}
disabled={currentState === "submitted"}
>
임시저장
</Button>,
<Button
key="save"
color={hasPending ? "violet" : "blue"}
color="blue"
type="submit"
loading={currentState === "pending"}
disabled={currentState === "submitted"}
>
{hasPending ? "임시저장" : "최종저장"}
최종저장
</Button>,
<Button key="back" variant="outline" component={Link} href="../final">
목록으로
Expand Down
30 changes: 26 additions & 4 deletions src/components/pages/review/Review/ProfessorReview.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"use client";

import Link from "next/link";
import { Button, Stack, Text } from "@mantine/core";
import { Button, Group, Stack, Text } from "@mantine/core";
import { UseFormReturnType } from "@mantine/form";
import {
BasicRow,
Expand Down Expand Up @@ -39,7 +41,6 @@ export function ProfessorReview({
setCommentType,
}: ProfessorReviewProps) {
const { thesis, presentation } = form.values;
const hasPending = thesis === "PENDING" || presentation === "PENDING";

return (
<Stack gap={0}>
Expand Down Expand Up @@ -92,17 +93,38 @@ export function ProfessorReview({
disabled={commentType !== "심사 의견 파일"}
/>
</RowGroup>
<Group justify="right" align="center" p={12}>
<Text fz={14} c="gray">
임시저장 시 합격여부는 자동으로 보류로 선택됩니다.
</Text>
</Group>
<RowGroup withBorderBottom={false}>
<ButtonRow
buttons={[
<Button
key="temp_save"
onClick={() => {
form.setValues(
stage === "MAIN"
? { thesis: "PENDING", presentation: "PENDING" }
: { thesis: "PENDING" }
);
}}
color="violet"
type="submit"
loading={currentState === "pending"}
disabled={currentState === "submitted"}
>
임시저장
</Button>,
<Button
key="save"
color={hasPending ? "violet" : "blue"}
color="blue"
type="submit"
loading={currentState === "pending"}
disabled={currentState === "submitted"}
>
{hasPending ? "임시저장" : "최종저장"}
최종저장
</Button>,
<Button key="back" variant="outline" component={Link} href="../review">
목록으로
Expand Down
4 changes: 2 additions & 2 deletions src/components/pages/review/Review/ReviewList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ export function ReviewList({ title, stage, reviews }: ReviewListProps) {
{ label: "내용 심사 결과", widthPercentage: 10 },
{ label: "구두 심사 결과", widthPercentage: 10 },
{ label: "심사 의견", widthPercentage: 56 },
{ label: "심사 의견 파일" },
{ label: "개별심사 결과보고서" },
]
: [
{ label: "심사위원", widthPercentage: 12 },
{ label: "심사 결과", widthPercentage: 10 },
{ label: "심사 의견", widthPercentage: 62 },
{ label: "심사 의견 파일" },
{ label: "개별심사 결과보고서" },
];
const table =
stage === "REVISION" ? (
Expand Down
2 changes: 1 addition & 1 deletion src/components/pages/review/Review/ReviewResult.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export function StudentReviewResult({ review }: StudentReviewResultProps) {
</BasicRow>
</RowGroup>
<RowGroup>
<BasicRow field="결과보고서 파일">
<BasicRow field="최종판정 결과보고서">
<ApiDownloadButton file={review.file} size="xs" />
</BasicRow>
</RowGroup>
Expand Down

0 comments on commit b30e463

Please sign in to comment.