Skip to content

Commit

Permalink
[RELEASE] release 3.0.1 출석상태 polling 기능 추가
Browse files Browse the repository at this point in the history
3.0.1 업데이트를 실시합니다.

### 주요 변경 사항
저번 EEOS 사용자 대상으로 한 설문조사를 바탕으로 업데이트를 실시하였습니다.

아래의 기능이 추가되었습니다.

사용자 출석 상태를 이제 새로고침 없이 바로바로 확인이 가능합니다.
해당 출석 상태 변경 요청은 관리자(회장단)가 주간발표를 생성하고, 출석 상태로 변경시 polling으로 2초마다 요청됩니다.
관리자(회장단)가 지각 상태로 변경시에 해당 polling 요청은 바로 중지되며, 이후 출석 상태는 지각으로 처리됩니다.
아래의 hook들을 수정하였습니다.

useProgramQuery.ts의 useUpdateProgramAttendMode
useMemberQuery.ts의 useUpdateMemberActiveStatus
  • Loading branch information
Klomachenko authored Dec 5, 2024
2 parents 57b9bc9 + 0d8d357 commit d4cf611
Show file tree
Hide file tree
Showing 55 changed files with 1,006 additions and 703 deletions.
3 changes: 2 additions & 1 deletion FE/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,6 @@
"tailwindcss": "latest",
"ts-node": "^10.9.2",
"typescript": "latest"
}
},
"packageManager": "[email protected]+sha1.8adba2d20330c02d3856e18c4eb3819d1d3ca6aa"
}
3 changes: 2 additions & 1 deletion FE/src/apis/__test__/program.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ describe("sendSlackMessage", () => {

// 내부 구현사항
expect(https).toHaveBeenCalledWith({
data: { programUrl: "https://econo.eeos.store/detail/1" },
data: { programUrl: "https://eeos.co.kr/detail/1" },
method: "POST",
url: "/programs/1/slack/notification",
});
Expand Down Expand Up @@ -381,6 +381,7 @@ describe("patchProgram", () => {
},
],
teams: [{ teamId: 1 }],
programGithubUrl: "",
};

const programId = 1;
Expand Down
30 changes: 29 additions & 1 deletion FE/src/apis/__test__/question.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@ describe("postQuestion", () => {
const programId = 1;
const teamId = 1;
const questionContent = "질문 내용";
const isAnonymous = 0;

// act
await postQuestion({ programId, teamId, questionContent });
await postQuestion({ programId, teamId, questionContent, isAnonymous });

// assert
expect(mockHttps).toHaveBeenCalledWith({
Expand All @@ -67,6 +68,30 @@ describe("postQuestion", () => {
data: {
programId,
teamId,
isAnonymous: 0,
content: questionContent,
parentsCommentId: -1,
},
});
});
it("익명 질문을 등록한다", async () => {
// arrange
const programId = 1;
const teamId = 1;
const questionContent = "질문 내용";
const isAnonymous = 1;

// act
await postQuestion({ programId, teamId, questionContent, isAnonymous });

// assert
expect(mockHttps).toHaveBeenCalledWith({
url: "comments",
method: "POST",
data: {
programId,
teamId,
isAnonymous: 1,
content: questionContent,
parentsCommentId: -1,
},
Expand All @@ -78,13 +103,15 @@ describe("postQuestion", () => {
const teamId = 1;
const questionContent = "답변 내용";
const parentsCommentId = 1;
const isAnonymous = 0;

// act
await postQuestion({
programId,
teamId,
questionContent,
parentsCommentId,
isAnonymous,
});

// assert
Expand All @@ -94,6 +121,7 @@ describe("postQuestion", () => {
data: {
programId,
teamId,
isAnonymous: 0,
content: questionContent,
parentsCommentId,
},
Expand Down
14 changes: 13 additions & 1 deletion FE/src/apis/question.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,34 @@ export const getQuestionsByTeam = async (programId: number, teamId: number) => {
return new QuestionListDto(data?.data);
};

/**
* 질문을 등록합니다.
* - isAnonymous : 질문을 등록할 때 체크박스를 체크했는지 여부. 체크가 되었다면 1, 아니라면 0
*/
export interface PostQuestionParams {
programId: number;
teamId: number;
questionContent: string;
parentsCommentId?: number;
commentType: "ANONYMOUS" | "NON_ANONYMOUS";
}
export const postQuestion = async ({
programId,
teamId,
questionContent,
parentsCommentId = -1,
commentType = "NON_ANONYMOUS",
}: PostQuestionParams) => {
return await https({
url: API.QUESTION.CREATE,
method: "POST",
data: { programId, teamId, content: questionContent, parentsCommentId },
data: {
programId,
teamId,
content: questionContent,
parentsCommentId,
commentType,
},
});
};

Expand Down
18 changes: 15 additions & 3 deletions FE/src/app/(admin)/admin/detail/[programId]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import AttendeeInfoContainer from "@/components/programDetail/attendee/AttendeeInfo.container";
import ProgramInfo from "@/components/programDetail/program/ProgramInfo";
import AttendeeInfoContainer from "@/components/feature/detail/attendee/AttendeeInfo.container";
import ProgramHeaderSection from "@/components/feature/detail/program/ProgramHeaderSection";
import ProgramDetailSection from "@/components/feature/detail/program/ProgramDetailSection";
import ProgramattendModeManageSection from "@/components/feature/detail/program/ProgramAttendStatusManageSection";
import ProgramPresentationsSection from "@/components/feature/detail/presentation/ProgramPresentationsSection";
import ProgramDashboardSection from "@/components/feature/detail/Dashboard/ProgramDashboardSection";

interface ProgramDetailPageProps {
params: {
Expand All @@ -12,7 +16,15 @@ const ProgramDetailPage = ({ params }: ProgramDetailPageProps) => {

return (
<div className="mb-16 space-y-16">
<ProgramInfo programId={+programId} accessType="admin" />
<section className="space-y-8">
<ProgramHeaderSection />
<ProgramDetailSection />
<ProgramattendModeManageSection />
<ProgramPresentationsSection />
<div className="mt-12">
<ProgramDashboardSection />
</div>
</section>
<AttendeeInfoContainer programId={+programId} isLoggedIn />
</div>
);
Expand Down
19 changes: 15 additions & 4 deletions FE/src/app/(guest)/guest/detail/[programId]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import AttendeeInfoContainer from "@/components/programDetail/attendee/AttendeeInfo.container";
import ProgramInfo from "@/components/programDetail/program/ProgramInfo";
import UserAttendModalContainer from "@/components/programDetail/userAttendModal/UserAttendModal.container";
import AttendeeInfoContainer from "@/components/feature/detail/attendee/AttendeeInfo.container";
import ProgramHeaderSection from "@/components/feature/detail/program/ProgramHeaderSection";
import ProgramDetailSection from "@/components/feature/detail/program/ProgramDetailSection";
import UserAttendModalContainer from "@/components/feature/detail/userAttendModal/UserAttendModal.container";
import ProgramPresentationsSection from "@/components/feature/detail/presentation/ProgramPresentationsSection";
import BlurDashboard from "@/components/feature/detail/Dashboard/BlurDashboard";

interface ProgramDetailPageProps {
params: {
Expand All @@ -13,10 +16,18 @@ const ProgramDetailPage = ({ params }: ProgramDetailPageProps) => {

return (
<div className="mb-16 space-y-16">
<ProgramInfo programId={+programId} accessType="public" />
<section className="space-y-8">
<ProgramHeaderSection />
<ProgramDetailSection />
<ProgramPresentationsSection />
<div className="mt-12">
<BlurDashboard />
</div>
</section>
<AttendeeInfoContainer programId={+programId} isLoggedIn={false} />
<UserAttendModalContainer programId={+programId} isLoggedIn={false} />
</div>
);
};

export default ProgramDetailPage;
19 changes: 15 additions & 4 deletions FE/src/app/(private)/(program)/detail/[programId]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import AttendeeInfoContainer from "@/components/programDetail/attendee/AttendeeInfo.container";
import ProgramInfo from "@/components/programDetail/program/ProgramInfo";
import UserAttendModalContainer from "@/components/programDetail/userAttendModal/UserAttendModal.container";
import AttendeeInfoContainer from "@/components/feature/detail/attendee/AttendeeInfo.container";
import ProgramHeaderSection from "@/components/feature/detail/program/ProgramHeaderSection";
import ProgramDetailSection from "@/components/feature/detail/program/ProgramDetailSection";
import UserAttendModalContainer from "@/components/feature/detail/userAttendModal/UserAttendModal.container";
import ProgramPresentationsSection from "@/components/feature/detail/presentation/ProgramPresentationsSection";
import ProgramDashboardSection from "@/components/feature/detail/Dashboard/ProgramDashboardSection";

interface ProgramDetailPageProps {
params: {
Expand All @@ -13,10 +16,18 @@ const ProgramDetailPage = ({ params }: ProgramDetailPageProps) => {

return (
<div className="mb-16 space-y-16">
<ProgramInfo programId={+programId} accessType="private" />
<section className="space-y-8">
<ProgramHeaderSection />
<ProgramDetailSection />
<ProgramPresentationsSection />
<div className="mt-12">
<ProgramDashboardSection />
</div>
</section>
<AttendeeInfoContainer programId={+programId} isLoggedIn />
<UserAttendModalContainer programId={+programId} isLoggedIn />
</div>
);
};

export default ProgramDetailPage;
15 changes: 12 additions & 3 deletions FE/src/components/common/CheckBox/CheckBox.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,32 @@
"use client";

import classNames from "classnames";
import Image from "next/image";

interface CheckBoxProps {
checked: boolean;
onClick: () => void;
onClick?: () => void;
disabled?: boolean;
className?: string;
}

const CheckBox = ({ checked, onClick, disabled = false }: CheckBoxProps) => {
const CheckBox = ({
checked,
onClick,
disabled = false,
className,
}: CheckBoxProps) => {
const checkboxClass = classNames(
"flex h-6 w-6 items-center justify-center rounded border-2 transition duration-100",
checked ? "border-blue-500 bg-blue-500" : "border-gray-20 bg-background",
{
"cursor-not-allowed opacity-0": disabled,
},
className,
);

const handleCheckBoxClick = () => {
!disabled && onClick();
!disabled && onClick && onClick();
};

return (
Expand Down
Loading

0 comments on commit d4cf611

Please sign in to comment.