Skip to content

Commit 35647cb

Browse files
VIA-629 SB Correct display type for NBS booking section.
1 parent bbb72a6 commit 35647cb

File tree

2 files changed

+26
-22
lines changed

2 files changed

+26
-22
lines changed

src/services/content-api/parsers/custom/covid-19.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ describe("buildFilteredContentForCovid19Vaccine", () => {
6262
const expected = {
6363
actions: [
6464
{
65-
type: ActionDisplayType.buttonWithCard,
65+
type: ActionDisplayType.buttonWithInfo,
6666
content: "## If this applies to you\n\n### Book an appointment online at a pharmacy" as Content,
6767
button: { label: "Continue to booking" as Label, url: new URL("https://example.com") as ButtonUrl },
6868
delineator: true,

src/services/content-api/parsers/custom/covid-19.tsx

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -25,27 +25,7 @@ export const buildFilteredContentForCovid19Vaccine = async (apiContent: string):
2525
if (campaigns.isActive(VaccineType.COVID_19)) {
2626
log.info("Campaign active");
2727
callout = undefined;
28-
const nbsBooking: ActionWithButton = {
29-
type: ActionDisplayType.buttonWithCard,
30-
content: ["## If this applies to you", "### Book an appointment online at a pharmacy"].join("\n\n") as Content,
31-
button: { label: "Continue to booking" as Label, url: new URL("https://example.com") as ButtonUrl },
32-
delineator: true,
33-
};
34-
const walkIn: ActionWithButton = {
35-
type: ActionDisplayType.actionLinkWithInfo,
36-
content: [
37-
"## Get vaccinated without an appointment",
38-
"You can find a walk-in COVID-19 vaccination site to get a vaccination without an appointment. You do not need to be registered with a GP.",
39-
].join("\n\n") as Content,
40-
button: {
41-
label: "Find a walk-in COVID-19 vaccination site" as Label,
42-
url: new URL(
43-
"https://www.nhs.uk/nhs-services/vaccination-and-booking-services/find-a-walk-in-covid-19-vaccination-site/",
44-
) as ButtonUrl,
45-
},
46-
delineator: false,
47-
};
48-
actions.push(nbsBooking, walkIn);
28+
actions.push(..._buildActions());
4929
} else {
5030
log.info("No campaign active");
5131
callout = {
@@ -69,3 +49,27 @@ export const buildFilteredContentForCovid19Vaccine = async (apiContent: string):
6949

7050
return { ...standardFilteredContent, callout, recommendation, actions };
7151
};
52+
53+
function _buildActions(): Action[] {
54+
const nbsBooking: ActionWithButton = {
55+
type: ActionDisplayType.buttonWithInfo,
56+
content: ["## If this applies to you", "### Book an appointment online at a pharmacy"].join("\n\n") as Content,
57+
button: { label: "Continue to booking" as Label, url: new URL("https://example.com") as ButtonUrl },
58+
delineator: true,
59+
};
60+
const walkIn: ActionWithButton = {
61+
type: ActionDisplayType.actionLinkWithInfo,
62+
content: [
63+
"## Get vaccinated without an appointment",
64+
"You can find a walk-in COVID-19 vaccination site to get a vaccination without an appointment. You do not need to be registered with a GP.",
65+
].join("\n\n") as Content,
66+
button: {
67+
label: "Find a walk-in COVID-19 vaccination site" as Label,
68+
url: new URL(
69+
"https://www.nhs.uk/nhs-services/vaccination-and-booking-services/find-a-walk-in-covid-19-vaccination-site/",
70+
) as ButtonUrl,
71+
},
72+
delineator: false,
73+
};
74+
return [nbsBooking, walkIn];
75+
}

0 commit comments

Comments
 (0)