Skip to content

Commit bbb72a6

Browse files
VIA-629 SB Add NBS booking section to Covid page when campaign active. (URL needs to be calculated.)
1 parent cd3ae69 commit bbb72a6

File tree

2 files changed

+26
-7
lines changed

2 files changed

+26
-7
lines changed

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

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,17 @@ describe("buildFilteredContentForCovid19Vaccine", () => {
6161

6262
const expected = {
6363
actions: [
64+
{
65+
type: ActionDisplayType.buttonWithCard,
66+
content: "## If this applies to you\n\n### Book an appointment online at a pharmacy" as Content,
67+
button: { label: "Continue to booking" as Label, url: new URL("https://example.com") as ButtonUrl },
68+
delineator: true,
69+
},
6470
{
6571
type: ActionDisplayType.actionLinkWithInfo,
66-
content: [
67-
"## Get vaccinated without an appointment",
68-
"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.",
69-
].join("\n\n") as Content,
72+
content: ("## Get vaccinated without an appointment\n\n" +
73+
"You can find a walk-in COVID-19 vaccination site to get a vaccination without an appointment. " +
74+
"You do not need to be registered with a GP.") as Content,
7075
button: {
7176
label: "Find a walk-in COVID-19 vaccination site" as Label,
7277
url: new URL(

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

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
import { VaccineType } from "@src/models/vaccine";
22
import { buildFilteredContentForStandardVaccine } from "@src/services/content-api/parsers/content-filter-service";
33
import { HeadingWithContent, HeadingWithTypedContent, VaccinePageContent } from "@src/services/content-api/types";
4-
import { Action, ActionDisplayType, ButtonUrl, Content, Label } from "@src/services/eligibility-api/types";
4+
import {
5+
Action,
6+
ActionDisplayType,
7+
ActionWithButton,
8+
ButtonUrl,
9+
Content,
10+
Label,
11+
} from "@src/services/eligibility-api/types";
512
import config from "@src/utils/config";
613
import { logger } from "@src/utils/logger";
714
import { Logger } from "pino";
@@ -18,7 +25,13 @@ export const buildFilteredContentForCovid19Vaccine = async (apiContent: string):
1825
if (campaigns.isActive(VaccineType.COVID_19)) {
1926
log.info("Campaign active");
2027
callout = undefined;
21-
actions.push({
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 = {
2235
type: ActionDisplayType.actionLinkWithInfo,
2336
content: [
2437
"## Get vaccinated without an appointment",
@@ -31,7 +44,8 @@ export const buildFilteredContentForCovid19Vaccine = async (apiContent: string):
3144
) as ButtonUrl,
3245
},
3346
delineator: false,
34-
});
47+
};
48+
actions.push(nbsBooking, walkIn);
3549
} else {
3650
log.info("No campaign active");
3751
callout = {

0 commit comments

Comments
 (0)