Skip to content

Commit

Permalink
VKT(Backend & Frontend): OPHVKTKEH-215 Stepper näkyy maksulinkin kaut…
Browse files Browse the repository at this point in the history
…ta (#548)

* VKT(Backend & Frontend): OPHVKTKEH-215 stepper fix when using payment link

* VKT(Frontend) OPHVKTKEH-215: show stepper when using payment link

* VKT(Frontend) OPHVKTKEH-215: stepper fix for mobile
  • Loading branch information
jrkkp authored Oct 13, 2023
1 parent 9cdaa97 commit b82c28b
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public record PublicEnrollmentDTO(
String street,
String postalCode,
String town,
String country
String country,
Boolean hasPaymentLink
)
implements EnrollmentDTOCommonFields {}
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ private PublicEnrollmentDTO createEnrollmentDTO(final Enrollment enrollment) {
.postalCode(enrollment.getPostalCode())
.town(enrollment.getTown())
.country(enrollment.getCountry())
.hasPaymentLink(enrollment.getPaymentLinkHash() != null)
.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,10 @@ export const PublicEnrollmentDesktopGrid = ({
: 'public-enrollment__grid__form-container'
}
>
{!isShiftedFromQueue && (
<PublicEnrollmentStepper
activeStep={activeStep}
includePaymentStep={ExamEventUtils.hasOpenings(examEvent)}
/>
)}
<PublicEnrollmentStepper
activeStep={activeStep}
includePaymentStep={ExamEventUtils.hasOpenings(examEvent)}
/>
{reservation && !isPreviewPassed && (
<PublicEnrollmentTimer
reservation={reservation}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ export const PublicEnrollmentGrid = ({
(isAuthenticatePassed && !reservation);

const isShiftedFromQueue =
enrollment.status === EnrollmentStatus.SHIFTED_FROM_QUEUE;
enrollment.status === EnrollmentStatus.SHIFTED_FROM_QUEUE ||
enrollment.hasPaymentLink;

const isPreviewStepActive = activeStep === PublicEnrollmentFormStep.Preview;
const isPreviewPassed = activeStep > PublicEnrollmentFormStep.Preview;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,17 +157,15 @@ export const PublicEnrollmentPhoneGrid = ({
: 'public-enrollment__grid__form-container'
}
>
{!isShiftedFromQueue && (
<div className="columns gapped-xxl">
<PublicEnrollmentStepper
activeStep={activeStep}
includePaymentStep={ExamEventUtils.hasOpenings(examEvent)}
/>
<div className="rows gapped-xs grow">
{getMobileStepperHeading()}
</div>
<div className="columns gapped-xxl">
<PublicEnrollmentStepper
activeStep={activeStep}
includePaymentStep={ExamEventUtils.hasOpenings(examEvent)}
/>
<div className="rows gapped-xs grow">
{getMobileStepperHeading()}
</div>
)}
</div>
{isExamEventDetailsAvailable && (
<div className="margin-top-lg">
<PublicEnrollmentExamEventDetails
Expand Down
1 change: 1 addition & 0 deletions frontend/packages/vkt/src/interfaces/publicEnrollment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export interface PublicEnrollment
privacyStatementConfirmation: boolean;
status?: EnrollmentStatus;
examEventId?: number;
hasPaymentLink?: boolean;
}

export interface PublicEnrollmentResponse
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export const initialState: PublicEnrollmentState = {
privacyStatementConfirmation: false,
status: undefined,
examEventId: undefined,
hasPaymentLink: undefined,
},
examEvent: undefined,
person: undefined,
Expand Down

0 comments on commit b82c28b

Please sign in to comment.