Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion src/core/components/profile/stepCard.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -371,9 +371,29 @@ const StepCard: React.FC<StepCardProps> = ({ step, status, isApproved }) => {
</div>
{step === 5 && application.payment.updatedAt && (
<Typography variant="subtitle2" className={`${classes.text} ${classes.content}`}>
Last uploaded at: {(new Date(application.payment.updatedAt)).toLocaleString()}
Last uploaded at: {new Date(application.payment.updatedAt).toLocaleString()}
</Typography>
)}
{step === 6 && application.state === "PASSED_THE_CAMP" && (
<>
{application.certificateDownloadLink && (
<a
href={`${application.certificateDownloadLink}`}
target="_blank"
rel="noopener noreferrer"
className={`no-underline ${classes.linkButton}`}>
<Button variant={"contained"} disableElevation className={`${classes.button} ${classes.solid}`} onClick={() => {}}>
ดาวน์โหลดเกียรติบัตร
</Button>
</a>
)}
{!application.certificateDownloadLink && (
<Typography variant="subtitle2" className={`${classes.text} ${classes.content}`} style={{ fontWeight: 500, color: "#941014" }}>
ขอแสดงความเสียใจ น้องไม่ได้รับเกียรติบัตรในการเข้าร่วมค่ายลานเกียร์ครั้งนี้
</Typography>
)}
</>
)}
</>
)}
</div>
Expand Down
8 changes: 8 additions & 0 deletions src/core/components/profile/stepCardList.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@ const StepCardList: React.FC<StepCardListProps> = ({ status, lgCode, firstname,
props[5] = { step: 5, status: "complete", isApproved: "true" }
props[6] = { step: 6, status: "inProgress", isApproved: "true" }
break
case ProfileStatus.passedTheCamp:
props[1] = { step: 1, status: "complete", isApproved: "true" }
props[2] = { step: 2, status: "complete", isApproved: "true" }
props[3] = { step: 3, status: "complete", isApproved: "true" }
props[4] = { step: 4, status: "complete", isApproved: "true" }
props[5] = { step: 5, status: "complete", isApproved: "true" }
props[6] = { step: 6, status: "complete", isApproved: "true" }
break
case ProfileStatus.paymentFailed:
props[1] = { step: 1, status: "complete", isApproved: "true" }
props[2] = { step: 2, status: "complete", isApproved: "true" }
Expand Down
1 change: 1 addition & 0 deletions src/core/models/dto/application.dto.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export type ApplicationState =
| "REJECTED_FAILED_THE_INTERVIEW"
| "PAYMENT_ACCEPTED"
| "REJECTED_FAIL_TO_PAY"
| "PASSED_THE_CAMP"

export type FileStatus = "EMPTY" | "UPLOADED" | "CHANGE_REQUIRED" | "PASSED"

Expand Down
2 changes: 2 additions & 0 deletions src/core/models/dto/profile.dto.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ interface ProfileDTO {
interviewAvailability: string
unavailableReason: string | null
interviewRoom?: string
certificatePreviewLink?: string
certificateDownloadLink?: string
}

export default ProfileDTO
3 changes: 2 additions & 1 deletion src/core/models/profileStatus.model.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ export enum ProfileStatus {
passedInterview = "passedInterview",
failedInterview = "failedInterview",
paymentAccepted = "paymentAccepted",
paymentFailed = "paymentFailed"
paymentFailed = "paymentFailed",
passedTheCamp = "passedTheCamp"
}
3 changes: 2 additions & 1 deletion src/modules/profile.module.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ const ProfileModule = () => {
PASSED_INTERVIEW: ProfileStatus.passedInterview,
REJECTED_FAILED_THE_INTERVIEW: ProfileStatus.failedInterview,
PAYMENT_ACCEPTED: ProfileStatus.paymentAccepted,
REJECTED_FAIL_TO_PAY: ProfileStatus.paymentFailed
REJECTED_FAIL_TO_PAY: ProfileStatus.paymentFailed,
PASSED_THE_CAMP: ProfileStatus.passedTheCamp
}

const profileStatus = applicationState === "SUBMITTED" ? profileStatusMap[applicationState][fileStatus] : profileStatusMap[applicationState]
Expand Down
Loading