Skip to content

Commit

Permalink
Merge branch 'hotfix/COT-74_resolve_attendance_not_apply_in_view' int…
Browse files Browse the repository at this point in the history
…o release
  • Loading branch information
WONYOUNG-HC committed Nov 22, 2024
2 parents 3e4ddb4 + 6f72ff0 commit e7f7245
Show file tree
Hide file tree
Showing 10 changed files with 78 additions and 50 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"browserslist": "^4.18.1",
"camelcase": "^6.2.1",
"case-sensitive-paths-webpack-plugin": "^2.4.0",
"cotato-openapi-clients": "2.241116.0-attendance.0",
"cotato-openapi-clients": "2.241122.0",
"craco-alias": "^3.0.1",
"css-loader": "^6.5.1",
"css-minimizer-webpack-plugin": "^3.2.0",
Expand Down
2 changes: 2 additions & 0 deletions src/pages/Attendance/Attend/AttendanceAttend.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ const AttendanceAttend: React.FC = () => {
const { currentGeneration, isGenerationLoading } = useGeneration();
const { latitude, longitude, error: geoLocationError } = useGeolocation(geolocationOptions);

console.log('latitude', latitude, 'longitude', longitude);

const { sessions, isSessionLoading } = useSession({
generationId: currentGeneration?.generationId,
});
Expand Down
2 changes: 2 additions & 0 deletions src/pages/Attendance/Attend/AttendanceAttendResult.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ const AttendanceAttendResult = () => {
const convertStatusToEnum = (status?: string) => {
switch (status) {
case 'present':
case 'offline':
case 'online':
return 'PRESENT';

case 'late':
Expand Down
1 change: 1 addition & 0 deletions src/pages/Attendance/List/AttendanceList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ const Wrapper = styled.div`
justify-content: center;
width: 100%;
min-height: calc(100vh - ${HEADER_HEIGHT});
overflow-x: hidden;
${media.mobile`
min-height: 100vh;
Expand Down
50 changes: 46 additions & 4 deletions src/pages/CS/solving/BgWaiting.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,61 @@
import React from 'react';
import React, { useEffect, useState } from 'react';
import styled from 'styled-components';
import { ReactComponent as Timer } from '@assets/timer.svg';
import background from '@assets/bg_waiting.svg';
import mobile from '@assets/bg_waiting_mobile.svg';

const BgWaiting = () => {
//
//
//

interface BgWaitingProps {
problemNumber?: number | undefined;
}

//
//
//

const QUIZ_END_NUMBER = 10;
const WAITING_MESSAGE = '곧 문제가 시작됩니다. 잠시만 기다려주세요!';
const ENDING_MESSAGE = 'CS 퀴즈가 종료되었습니다. 수고하셨습니다!';

//
//
//

const BgWaiting: React.FC<BgWaitingProps> = ({ problemNumber }) => {
const [message, setMessage] = useState(WAITING_MESSAGE);

/**
*
*/
const handleEndingMessage = () => {
if (problemNumber === QUIZ_END_NUMBER) {
setMessage(ENDING_MESSAGE);
}
};

/**
*
*/
useEffect(() => {
handleEndingMessage();
});

return (
<Wrapper>
<Waiting>
<Timer style={{ width: '68px' }} />
<div>곧 문제가 시작됩니다. &nbsp;잠시만 기다려주세요!</div>
<div>{message}</div>
</Waiting>
</Wrapper>
);
};

export default BgWaiting;
//
//
//

const Wrapper = styled.div`
display: flex;
Expand Down Expand Up @@ -91,3 +131,5 @@ const Waiting = styled.div`
}
}
`;

export default BgWaiting;
8 changes: 2 additions & 6 deletions src/pages/CS/solving/CSProblem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,7 @@ const CSProblem: React.FC<CSProblemProps> = ({
// 다음 문제로 이동
// 아직 다음 문제 안열렸으면 대기 상태로
if (submitAllowed) {
if ((quizData?.number as number) === 10) {
setReturnToWaiting(false);
} else {
setReturnToWaiting(true);
}
setReturnToWaiting(true);
}
};

Expand Down Expand Up @@ -339,7 +335,7 @@ const CSProblem: React.FC<CSProblemProps> = ({
{showCorrect && <BgCorrect />}
{showIncorrect && <BgIncorrect />}
{showKingKing && educationId && <BgKingKing educationId={educationId} />}
{returnToWaiting && <BgWaiting />}
{returnToWaiting && <BgWaiting problemNumber={quizData?.number} />}
</Wrapper>
);
};
Expand Down
17 changes: 11 additions & 6 deletions src/pages/Projects/ProjectDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@ const ProjectDialog = ({ open, onClose, projectId }: ProjectsProps) => {
*/
const renderLeftPart = () => {
return (
<Stack gap="2rem">
<Stack gap="2rem" justifyContent="space-between">
<Stack>
<Stack direction="row" justifyContent="space-between" alignItems="center">
<Title>{project?.name}</Title>
{!isLandScapeOrSmaller ? <Generation>{project?.generationNumber}</Generation> : null}
</Stack>
<Introduction>{project?.introduction}</Introduction>
</Stack>
<Stack direction="row" gap="0.5rem" width="auto" flexWrap="wrap">
<Stack direction={isLandScapeOrSmaller ? 'column' : 'row'} gap="0.5rem" width="auto">
<ProjectsLink
link={project?.projectUrl}
logo={<LinkIcon />}
Expand Down Expand Up @@ -121,7 +121,7 @@ const ProjectDialog = ({ open, onClose, projectId }: ProjectsProps) => {
justifyContent="space-between"
alignItems="center"
height="100%"
gap="1rem"
gap="0.75rem"
>
<Typography variant="body1" fontWeight={700}>
{title}
Expand Down Expand Up @@ -169,8 +169,13 @@ const ProjectDialog = ({ open, onClose, projectId }: ProjectsProps) => {
alt="thumbnail"
/>
)}
<Box padding="2rem">
<Stack direction="row" justifyContent="space-between" flexWrap="wrap" gap="2rem">
<Box padding={isLandScapeOrSmaller ? '1rem' : '2rem'}>
<Stack
direction="row"
justifyContent="space-between"
flexWrap="wrap"
gap={isLandScapeOrSmaller ? '1rem' : '2rem'}
>
{renderLeftPart()}
{renderRightPart()}
</Stack>
Expand Down Expand Up @@ -246,6 +251,6 @@ const Introduction = styled.p`
`}
${media.mobile`
font-size: 0.6rem;
font-size: 0.8rem;
`}
`;
6 changes: 5 additions & 1 deletion src/pages/Projects/ProjectsCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,11 @@ const ProjectsCard = ({
alt={name}
width="100%"
height="100%"
style={{ borderTopLeftRadius: '0.625rem', borderTopRightRadius: '0.625rem' }}
style={{
borderTopLeftRadius: '0.625rem',
borderTopRightRadius: '0.625rem',
objectFit: 'cover',
}}
/>
</Box>
);
Expand Down
1 change: 1 addition & 0 deletions src/pages/Projects/ProjectsServiceLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export default ProjectsLink;

const StyledLink = styled(Link)`
width: auto;
max-width: 8rem;
height: 2rem;
padding: 0.5rem 0.75rem;
display: flex;
Expand Down
39 changes: 7 additions & 32 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4754,10 +4754,10 @@ cosmiconfig@^7, cosmiconfig@^7.0.0, cosmiconfig@^7.0.1:
path-type "^4.0.0"
yaml "^1.10.0"

cotato-openapi-clients@2.241116.0-attendance.0:
version "2.241116.0-attendance.0"
resolved "https://registry.yarnpkg.com/cotato-openapi-clients/-/cotato-openapi-clients-2.241116.0-attendance.0.tgz#538cc81e9caacae707cabae766446ec375c21751"
integrity sha512-txP3Fl6uyZc4xyvZutRE1BGBbdOVb6clFP/Zp1fjBBVcgaQ+/Xej9FVQkAh/U2EtvFBvCjyqS0+rBfOmc4UOJw==
cotato-openapi-clients@2.241122.0:
version "2.241122.0"
resolved "https://registry.yarnpkg.com/cotato-openapi-clients/-/cotato-openapi-clients-2.241122.0.tgz#c6b8432bc547d8bed4ceda88c009818f3ff42fb7"
integrity sha512-utYFmmFjBOIZbVHURrBF/jc9eJ/VzVALwcCC9wXiuZKiXEyUM/Cdu5AIKIBJP4653OdA0lCMDVElTo9xG9rTgw==
dependencies:
"@openapitools/openapi-generator-cli" "^2.13.4"
"@testing-library/jest-dom" "^5.17.0"
Expand Down Expand Up @@ -10665,16 +10665,7 @@ string-natural-compare@^3.0.1:
resolved "https://registry.yarnpkg.com/string-natural-compare/-/string-natural-compare-3.0.1.tgz#7a42d58474454963759e8e8b7ae63d71c1e7fdf4"
integrity sha512-n3sPwynL1nwKi3WJ6AIsClwBMa0zTi54fn2oLU6ndfTSIO05xaznjSf15PcBZU6FNWbmN5Q6cxT4V5hGvB4taw==

"string-width-cjs@npm:string-width@^4.2.0":
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
dependencies:
emoji-regex "^8.0.0"
is-fullwidth-code-point "^3.0.0"
strip-ansi "^6.0.1"

string-width@^4.1.0, string-width@^4.2.0:
"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0:
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
Expand Down Expand Up @@ -10777,14 +10768,7 @@ stringify-object@^3.3.0:
is-obj "^1.0.1"
is-regexp "^1.0.0"

"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
dependencies:
ansi-regex "^5.0.1"

strip-ansi@^6.0.0, strip-ansi@^6.0.1:
"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
Expand Down Expand Up @@ -12018,7 +12002,7 @@ [email protected]:
"@types/trusted-types" "^2.0.2"
workbox-core "6.6.1"

"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
Expand All @@ -12036,15 +12020,6 @@ wrap-ansi@^6.0.1:
string-width "^4.1.0"
strip-ansi "^6.0.0"

wrap-ansi@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
dependencies:
ansi-styles "^4.0.0"
string-width "^4.1.0"
strip-ansi "^6.0.0"

wrap-ansi@^8.1.0:
version "8.1.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"
Expand Down

0 comments on commit e7f7245

Please sign in to comment.