Skip to content

Commit

Permalink
qa 배포를 위해 머지합니다. (#137)
Browse files Browse the repository at this point in the history
* fix(pages): QA 오류 수정

* feat(pages): 관리자가 수정지시사항 확인 여부를 수정할 수 있도록 변경

* fix: 무한 요청 오류 수정

* fix: showNotificationSuccess 위치 변경

* fix: (chore) issn 옵셔널로 변경후 undefined여서 생기는 오류 수정

* fix: 학생등록 폼 논문제목/연락처/이메일 옵셔널 변경 및 학과로 필터링 제거

* fix: 교수 등록 폼 수정 및 학생/교수 로그인하기 기능 오류 수정
디벨롭 브랜치와 머지, #118 브랜치에서 이어서 작업 (메인에서 작업해서..ㅠㅠ)

* fix: 본심 전환 모달 오류 수정

* chore: 포맷팅

* fix: 심사결과페이지 심사 중에도 확인 가능하도록 수정

* fix: 논문투고 페이지 예심/본심 뱃지 추가

* fix: 논문투고 페이지 일정 예심/본심에 따라 불러오도록 수정

* fix: 학생 심사 결과 페이지 본심 정보도 불러오도록 수정

* fix: AchievementForm isAdmin 수정

* fix: 논문정보 수정 api 스펠링 변경
저희쪽에서 변경하는게 빠를 것 같아서 수정하였습니다.

* fix: 심사 정보 수정 심사의견 및 파일 업로드가능하도록 수정

* fix: 심사의견/심사의견파일 둘중 하나만 선택하도록 수정

* feat: 교수/학생 일괄 삭제 기능 추가

* feat: main workflow 추가

* chore: 주석달기

* chore: 코드 중복 제거

* fix: 테이블 헤더 수정

* fix: 로그인 안내문구 수정

* chore: 서명 미업로드 설명 추가

---------

Co-authored-by: lhwdev <[email protected]>
  • Loading branch information
hynseok and lhwdev authored Apr 29, 2024
1 parent 75d6fb2 commit 8ba0384
Show file tree
Hide file tree
Showing 37 changed files with 680 additions and 303 deletions.
83 changes: 83 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Docker Image CI

on:
push:
branches: ["main"]
env:
dockerimage_tag: ${{ github.sha }}
dockerimage_name: harbor.k8s.scg.skku.ac.kr/library/ice-gs-thesis-fe
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
steps:
- name: --------------- Code Repo ---------------
run: echo "Code Repo"
- name: Code Repo 불러오기
uses: actions/checkout@v4
- name: Docker 준비(1/4) - 메타데이터 생성
id: meta
uses: docker/[email protected]
with:
images: |
${{ env.dockerimage_name }}
tags: |
${{ env.dockerimage_tag }}
latest
flavor: |
latest=true
- name: Docker 준비(2/4) - QEMU 설정
uses: docker/setup-qemu-action@v3
- name: Docker 준비(3/4) - buildx 설정
uses: docker/setup-buildx-action@v3
- name: Docker 준비(4/4) - 레지스트리 로그인
uses: docker/login-action@v2
with:
registry: ${{ secrets.HARBOR_REGISTRY }}
username: ${{ secrets.HARBOR_USERNAME }}
password: ${{ secrets.HARBOR_PASSWORD }}
- name: env 파일 생성
run: |
echo NEXT_PUBLIC_API_ENDPOINT=${{secrets.API_ENDPOINT_PROD}} >> .env
cat .env
- name: Docker 이미지 빌드+푸시
id: build-and-push
uses: docker/[email protected]
with:
context: .
file: ./Dockerfile
platforms: linux/amd64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
provenance: false
- name: --------------- Config Repo ---------------
run: echo "[Config Repo]"
- name: Config Repo 불러오기
uses: actions/checkout@v4
with:
repository: SystemConsultantGroup/ice-grad-thesis-config
ref: main
token: ${{ secrets.ACTION_TOKEN }}
path: ice-grad-thesis-config
- name: Kustomize 준비
uses: imranismail/[email protected]
- name: Config Repo 이미지 값 업데이트 (Kustomize)
run: |
cd ice-grad-thesis-config/overlays/prod/fe/
kustomize edit set image ${{ env.dockerimage_name }}:${{ env.dockerimage_tag }}
cat kustomization.yaml
- name: Config Repo 변경사항 푸시
run: |
cd ice-grad-thesis-config
git config --global user.email "[email protected]"
git config --global user.name "hynseok"
git commit -am "Update image tag"
git push -u origin main
- name: --------------- Clean Up ---------------
run: echo "Clean Up"
1 change: 0 additions & 1 deletion .github/workflows/qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ jobs:
- name: env 파일 생성
run: |
echo NEXT_PUBLIC_API_ENDPOINT=${{secrets.API_ENDPOINT}} >> .env
echo NEXT_PUBLIC_REVIEW_API_ENDPOINT=${{secrets.REVIEW_API_ENDPOINT}} >> .env
cat .env
- name: Docker 이미지 빌드+푸시
id: build-and-push
Expand Down
2 changes: 1 addition & 1 deletion src/api/_types/reviews.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export interface FinalReviewResponse extends CommonApiResponse {
export interface UpdateReviewRequestBody {
contentStatus: Status;
presentationStatus?: Status | null;
comment: string;
comment?: string;
fileUUID?: string;
}

Expand Down
4 changes: 3 additions & 1 deletion src/api/apiRoute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export const API_ROUTES = {
`/students/${studentId}/headReviewer/${reviewerId}`, // PUT: 학생 심사위원장 배정
deleteReviewer: (studentId: ApiId, reviewerId: ApiId) =>
`/students/${studentId}/reviewers/${reviewerId}`, // PUT: 학생 심사위원 배정 취소
delete: () => "/students", // DELETE: 학생 삭제
},
review: {
// 학생 본인의 논문 조회
Expand Down Expand Up @@ -90,7 +91,8 @@ export const API_ROUTES = {
},
},
thesis: {
put: (thesisId: ApiId) => `/thesis/${thesisId}`,
// 백엔드 api 경로 오타로 theses로 설정
put: (thesisId: ApiId) => `/theses/${thesisId}`,
},
achievement: {
get: (achievementId?: ApiId) => `/achievements/${achievementId ?? ""}`,
Expand Down
93 changes: 74 additions & 19 deletions src/app/admin/results/[thesisId]/AdminReviewContent.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"use client";

import { useState } from "react";
import { useRouter } from "next/navigation";
import { ClientAxios } from "@/api/ClientAxios";
import { Status } from "@/api/_types/common";
import { AdminReviewResponse, ThesisReview, UpdateReviewRequestBody } from "@/api/_types/reviews";
Expand All @@ -8,11 +10,19 @@ import { API_ROUTES } from "@/api/apiRoute";
import { ApiDownloadButton } from "@/components/common/Buttons";
import { showNotificationSuccess } from "@/components/common/Notifications";
import SectionTitle from "@/components/common/SectionTitle";
import { BasicRow, ButtonRow, RowGroup, TitleRow } from "@/components/common/rows";
import {
BasicRow,
ButtonRow,
CommentTypeRow,
FileUploadRow,
RowGroup,
TextAreaRow,
TitleRow,
} from "@/components/common/rows";
import { AdminReviewList } from "@/components/pages/review/Review/ReviewList";
import { StatusButtons } from "@/components/pages/review/Review/StatusButtons";
import { Badge, Button, Modal, Space, Stack } from "@mantine/core";
import { useState } from "react";
import { uploadFile } from "@/api/_utils/uploadFile";

export function AdminReviewListContent({ data }: { data: AdminReviewResponse }) {
const [open, setOpen] = useState<boolean>(false);
Expand All @@ -33,7 +43,7 @@ export function AdminReviewListContent({ data }: { data: AdminReviewResponse })
opened={!!open}
onClose={() => setOpen(false)}
centered
size="lg"
size="xl"
padding="lg"
radius="lg"
withCloseButton={false}
Expand Down Expand Up @@ -107,7 +117,7 @@ export function ReviewReportAdminEditable({
opened={!!open}
onClose={() => setOpen(false)}
centered
size="lg"
size="xl"
padding="lg"
radius="lg"
withCloseButton={false}
Expand All @@ -129,6 +139,15 @@ function ModalContent({ open, setOpen, data, current }: ModalProps) {
const [loading, setLoading] = useState(false);
const [thesis, setThesis] = useState(current.contentStatus);
const [presentation, setPresentation] = useState(current.presentationStatus);
const [comment, setComment] = useState(current.comment);
const [reviewFile, setReviewFile] = useState<File | null>();
const [commentType, setCommentType] = useState<string>();

const handleCommentChange = (event: React.ChangeEvent<HTMLInputElement>) => {
setComment(event.currentTarget.value);
};

const router = useRouter();

return (
<form
Expand All @@ -139,23 +158,37 @@ function ModalContent({ open, setOpen, data, current }: ModalProps) {
setLoading(true);
task.onComplete(() => setLoading(false));

let fileUUID;
if (reviewFile) {
fileUUID = (await uploadFile(reviewFile)).uuid;
} else if (current.file) {
fileUUID = current.file.uuid ?? undefined;
}

await ClientAxios.put(
current.isFinal
? API_ROUTES.review.final.put(current.id)
: API_ROUTES.review.put(current.id),
: data.stage === "REVISION"
? API_ROUTES.review.revision.put(current.id)
: API_ROUTES.review.put(current.id),
{
comment: current.comment,
...(commentType === "심사 의견" ? { comment } : {}),
contentStatus: thesis,
presentationStatus: presentation,
...(current.isFinal ? {} : { presentationStatus: presentation }),
...(commentType === "심사 의견 파일" ? { fileUUID } : {}),
} satisfies UpdateReviewRequestBody,
{ baseURL: process.env.NEXT_PUBLIC_REVIEW_API_ENDPOINT }
);

showNotificationSuccess({
message: current.isFinal
? "최종심사 결과를 수정했습니다."
: `${current.reviewer.name} 교수의 심사를 수정했습니다.`,
? "최종심사 결과를 수정했습니다." // NOTE: 심사위원장은 수정지시사항 확인을 안한다고 가정
: `${current.reviewer.name} 교수의 ${
data.stage === "REVISION" ? "확인여부를" : "심사를"
} 수정했습니다.`,
});
setOpen(false);
router.refresh();
})();
}}
>
Expand All @@ -177,17 +210,21 @@ function ModalContent({ open, setOpen, data, current }: ModalProps) {
<BasicRow.Text>{current.reviewer.name}</BasicRow.Text>
</BasicRow>
</RowGroup>

<RowGroup>
<BasicRow field="내용심사 합격 여부">
<StatusButtons
options={{ pending: true, unexamined: true }}
value={thesis}
setValue={setThesis}
/>
</BasicRow>
{data.stage === "REVISION" ? (
<BasicRow field="수정지시사항 확인 여부">
<StatusButtons options={{}} value={thesis} setValue={setThesis} />
</BasicRow>
) : (
<BasicRow field="내용심사 합격 여부">
<StatusButtons
options={{ pending: true, unexamined: true }}
value={thesis}
setValue={setThesis}
/>
</BasicRow>
)}
</RowGroup>

{!current.isFinal && data.stage === "MAIN" ? (
<RowGroup>
<BasicRow field="구두심사 합격 여부">
Expand All @@ -199,7 +236,25 @@ function ModalContent({ open, setOpen, data, current }: ModalProps) {
</BasicRow>
</RowGroup>
) : null}

{data.stage !== "REVISION" && (
<>
<CommentTypeRow commentType={commentType} setCommentType={setCommentType} />
<TextAreaRow
field="심사 의견"
content={current.comment}
onChange={handleCommentChange}
disabled={commentType !== "심사 의견"}
/>
<RowGroup>
<FileUploadRow
field="심사 의견 파일"
previousFile={current.file}
onChange={(file) => setReviewFile(file)}
disabled={commentType !== "심사 의견 파일"}
/>
</RowGroup>
</>
)}
<Space h="42px" />

<RowGroup withBorderBottom={false}>
Expand Down
Loading

0 comments on commit 8ba0384

Please sign in to comment.