Skip to content

Commit 57e35b2

Browse files
authored
Merge pull request #1423 from it-at-m/feature-zmskvr-526-buttons-after-confirming-the-appointment
feat(ZMSKVR-526): restart-button after confirming the appointment
2 parents 045cc0e + 21081f7 commit 57e35b2

File tree

4 files changed

+80
-0
lines changed

4 files changed

+80
-0
lines changed

zmscitizenview/src/components/Appointment/AppointmentView.vue

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,25 @@
160160
t("appointmentSuccessfullyBookedHeader")
161161
}}</template>
162162
</muc-callout>
163+
<div
164+
v-if="confirmAppointmentSuccess"
165+
class="m-button-group"
166+
>
167+
<!-- Nachfolgender Button kommt mit Ticket ZMSKVR-97. Styling sollte bereits passen.
168+
<muc-button
169+
icon="download"
170+
@click="downloadIcsAppointment"
171+
>
172+
{{ t("downloadAppointment") }}
173+
</muc-button>
174+
bis hierhin. -->
175+
<muc-button
176+
@click="redirectToAppointmentStart"
177+
variant="secondary"
178+
>
179+
{{ t("bookAnotherAppointment") }}
180+
</muc-button>
181+
</div>
163182
<muc-callout
164183
v-if="hasConfirmAppointmentError"
165184
:type="toCalloutType(apiErrorTranslation.errorType)"
@@ -901,3 +920,31 @@ onMounted(() => {
901920
}
902921
});
903922
</script>
923+
<style lang="scss" scoped>
924+
@use "@/styles/breakpoints.scss" as *;
925+
926+
.m-button-group {
927+
display: flex;
928+
flex-direction: row;
929+
margin-top: 1rem;
930+
}
931+
932+
.button-item {
933+
margin-bottom: 0;
934+
margin-right: 1rem;
935+
}
936+
937+
@include xs-down {
938+
.m-button-group {
939+
flex-direction: column;
940+
align-items: flex-start;
941+
}
942+
943+
.button-item {
944+
margin-right: 0;
945+
margin-bottom: 1rem;
946+
width: auto;
947+
flex: none;
948+
}
949+
}
950+
</style>

zmscitizenview/src/utils/de-DE.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@
153153
"arrangeAppointment": "Termin vereinbaren",
154154
"availableTimes": "Verfügbare Termine",
155155
"back": "Zurück",
156+
"bookAnotherAppointment": "Weiteren Termin vereinbaren",
156157
"bookAppointment": "Termin reservieren",
157158
"bookAppointmentStart": "Termin vereinbaren",
158159
"buttonBackToOverview": "Zurück zur Übersicht",
@@ -169,6 +170,7 @@
169170
"contact": "Kontakt",
170171
"contactDetails": "Kontaktdaten",
171172
"detailTimeHint": "Kommen Sie bitte pünktlich zu Ihrem Termin. In seltenen Fällen kann es vorkommen, dass Sie trotz Termin kurz warten müssen. Bitte haben Sie dafür Verständnis.",
173+
"downloadAppointment": "Termin herunterladen (ics)",
172174
"earlier": "Früher",
173175
"errorMessageCustomTextfield": "Bitte geben Sie die notwendigen Informationen ein.",
174176
"errorMessageCustomTextfield2": "Bitte geben Sie die notwendigen Informationen ein.",

zmscitizenview/src/utils/en-US.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@
148148
"appointmentSuccessfullyCanceledText": "Thank you for cancelling your appointment in favor of others.",
149149
"availableTimes": "Available dates",
150150
"back": "Back",
151+
"bookAnotherAppointment": "Book another appointment",
151152
"bookAppointment": "Book appointment",
152153
"bookAppointmentStart": "Book appointment",
153154
"calendarView": "Calendar view",
@@ -162,6 +163,7 @@
162163
"confirmAppointmentText": "In the next minutes you will receive an e-mail with an activation link. Click on the link to finalise the booking. If you do not activate the appointment within {activationMinutes} minutes, your reservation will expire.",
163164
"contact": "Contact us",
164165
"contactDetails": "Contact details",
166+
"downloadAppointment": "Download Appointment (ics)",
165167
"earlier": "Earlier",
166168
"errorMessageCustomTextfield": "Please enter the required information.",
167169
"errorMessageCustomTextfield2": "Please enter the required information.",

zmscitizenview/tests/unit/AppointmentView.spec.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1241,4 +1241,33 @@ describe("AppointmentView", () => {
12411241
expect(errorCallout.text()).toContain(de.apiErrorGenericFallbackHeader);
12421242
});
12431243
});
1244+
describe("Book another appointment button", () => {
1245+
it("renders with correct label and redirects to start when clicked", async () => {
1246+
const originalLocation = window.location as any;
1247+
delete (window as any).location;
1248+
(window as any).location = {
1249+
...originalLocation,
1250+
href: "http://localhost:8082/#/services/000000000000/locations/000000000000",
1251+
origin: "http://localhost:8082",
1252+
pathname: "/",
1253+
};
1254+
1255+
const wrapper = createWrapper({ appointmentHash: undefined });
1256+
wrapper.vm.confirmAppointmentSuccess = true;
1257+
await nextTick();
1258+
1259+
const button = wrapper.find(".m-button-group button");
1260+
expect(button.exists()).toBe(true);
1261+
1262+
const expectedLabel =
1263+
(de as any).bookAnotherAppointment ?? "bookAnotherAppointment";
1264+
expect(button.text()).toContain(expectedLabel);
1265+
expect(button.attributes("variant")).toBe("secondary");
1266+
1267+
await button.trigger("click");
1268+
expect(window.location.href).toBe("http://localhost:8082/");
1269+
1270+
(window as any).location = originalLocation;
1271+
});
1272+
});
12441273
});

0 commit comments

Comments
 (0)