Skip to content

Commit a4c8db7

Browse files
authored
APPT-2291 - Updating the change availability button on week / month view (#1639)
# Description Updating the change availability button location and size on week and month views. <img width="895" height="809" alt="image" src="https://github.com/user-attachments/assets/2c019549-f218-49f6-a46e-0284eb8f90a4" /> <img width="902" height="904" alt="image" src="https://github.com/user-attachments/assets/cd71a525-fbd2-4e9d-9367-961950088772" /> Fixes # (issue) # Checklist: - [ ] My work is behind a feature toggle (if appropriate) - [ ] If my work is behind a feature toggle, I've added a full suite of tests for both the ON and OFF state - [x] The ticket number is in the Pull Request title, with format "APPT-XXX: My Title Here" - [x] I have ran npm tsc / lint (in the future these will be ran automatically) - [ ] My code generates no new .NET warnings (in the future these will be treated as errors) - [ ] If I've added a new Function, it is disabled in all but one of the terraform groups (e.g. http_functions) - [ ] If I've added a new Function, it has both unit and integration tests. Any request body validators have unit tests also - [ ] If I've made UI changes, I've added appropriate Playwright and Jest tests - [ ] If I've added/updated an end-point, I've added the appropriate annotations and tested the Swagger documentation reflects the change
1 parent fcf39ec commit a4c8db7

2 files changed

Lines changed: 26 additions & 24 deletions

File tree

  • src/client/src/app/site/[site]/view-availability/(nhs-layout)

src/client/src/app/site/[site]/view-availability/(nhs-layout)/page.tsx

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77
import { ViewAvailabilityPage } from './view-availability-page';
88
import { RFC3339Format, parseToUkDatetime, ukNow } from '@services/timeService';
99
import fromServer from '@server/fromServer';
10-
import Link from 'next/link';
1110
import { Heading, Button } from 'nhsuk-react-components';
1211

1312
type PageProps = {
@@ -45,22 +44,24 @@ const Page = async ({ params, searchParams }: PageProps) => {
4544

4645
return (
4746
<>
48-
<Heading headingLevel="h2">
49-
<span className="nhsuk-caption-l">{site.name}</span>
50-
{`View availability for ${searchMonth.format('MMMM YYYY')}`}
51-
</Heading>
52-
5347
{canChangeAvailability && (
54-
/* Pass the returnUrl to the wizard */
55-
<Link
56-
href={`/site/${siteFromPath}/change-availability?returnUrl=${encodedReturnUrl}`}
57-
>
58-
<Button type="button" secondary>
48+
<ol className="nhsuk-list nhsuk-u-margin-0 nhsuk-button-group-flat flex-row">
49+
<Button
50+
href={`/manage-your-appointments/site/${siteFromPath}/change-availability?returnUrl=${encodedReturnUrl}`}
51+
className="no-print"
52+
small
53+
secondarySolid
54+
>
5955
Change availability
6056
</Button>
61-
</Link>
57+
</ol>
6258
)}
6359

60+
<Heading headingLevel="h2">
61+
<span className="nhsuk-caption-l">{site.name}</span>
62+
{`View availability for ${searchMonth.format('MMMM YYYY')}`}
63+
</Heading>
64+
6465
<ViewAvailabilityPage site={site} searchMonth={searchMonth} />
6566
</>
6667
);

src/client/src/app/site/[site]/view-availability/(nhs-layout)/week/page.tsx

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { ViewWeekAvailabilityPage } from './view-week-availability-page';
88
import { endOfUkWeek, startOfUkWeek } from '@services/timeService';
99
import { notFound } from 'next/navigation';
1010
import fromServer from '@server/fromServer';
11-
import Link from 'next/link';
1211
import { Heading, Button } from 'nhsuk-react-components';
1312

1413
type PageProps = {
@@ -51,22 +50,24 @@ const Page = async ({ searchParams, params }: PageProps) => {
5150

5251
return (
5352
<>
54-
<Heading headingLevel="h2">
55-
<span className="nhsuk-caption-l">{site.name}</span>
56-
{`${ukWeekStart.format('D MMMM')} to ${ukWeekEnd.format('D MMMM')}`}
57-
</Heading>
58-
5953
{canChangeAvailability && (
60-
/* Inject the returnUrl */
61-
<Link
62-
href={`/site/${siteFromPath}/change-availability?returnUrl=${encodedReturnUrl}`}
63-
>
64-
<Button type="button" secondary>
54+
<ol className="nhsuk-list nhsuk-u-margin-0 nhsuk-button-group-flat flex-row">
55+
<Button
56+
href={`/manage-your-appointments/site/${siteFromPath}/change-availability?returnUrl=${encodedReturnUrl}`}
57+
className="no-print"
58+
small
59+
secondarySolid
60+
>
6561
Change availability
6662
</Button>
67-
</Link>
63+
</ol>
6864
)}
6965

66+
<Heading headingLevel="h2">
67+
<span className="nhsuk-caption-l">{site.name}</span>
68+
{`${ukWeekStart.format('D MMMM')} to ${ukWeekEnd.format('D MMMM')}`}
69+
</Heading>
70+
7071
<ViewWeekAvailabilityPage
7172
ukWeekStart={ukWeekStart}
7273
ukWeekEnd={ukWeekEnd}

0 commit comments

Comments
 (0)