Skip to content

Commit 84a9b9e

Browse files
committed
EES-4996 add api info to data set page
1 parent 7195075 commit 84a9b9e

File tree

26 files changed

+1232
-291
lines changed

26 files changed

+1232
-291
lines changed

src/explore-education-statistics-admin/src/pages/methodology/edit-methodology/status/MethodologyStatusPage.tsx

+5-6
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,11 @@ const MethodologyStatusPage = () => {
9393
The <strong>public methodology</strong> will be accessible at:
9494
</p>
9595

96-
<p>
97-
<UrlContainer
98-
data-testid="public-methodology-url"
99-
url={`${publicAppUrl}/methodology/${currentMethodology.slug}`}
100-
/>
101-
</p>
96+
<UrlContainer
97+
className="govuk-!-margin-bottom-4"
98+
testId="public-methodology-url"
99+
url={`${publicAppUrl}/methodology/${currentMethodology.slug}`}
100+
/>
102101

103102
<SummaryList>
104103
<SummaryListItem term="Status">

src/explore-education-statistics-admin/src/pages/publication/components/PublicationUpdateConfirmModal.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ export default function PublicationUpdateConfirmModal({
4848
<>
4949
<p>The URL for this publication will change from</p>
5050
<UrlContainer
51-
data-testid="before-url"
51+
testId="before-url"
5252
url={`${publicAppUrl}/find-statistics/${initialPublicationSlug}`}
5353
/>{' '}
5454
to{' '}
5555
<UrlContainer
56-
data-testid="after-url"
56+
testId="after-url"
5757
url={`${publicAppUrl}/find-statistics/${newPublicationSlug}`}
5858
/>
5959
</>

src/explore-education-statistics-admin/src/pages/release/ReleaseStatusPage.tsx

+5-6
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,11 @@ const ReleaseStatusPage = () => {
9494
The <strong>public release</strong> will be accessible at:
9595
</p>
9696

97-
<p>
98-
<UrlContainer
99-
data-testid="public-release-url"
100-
url={`${publicAppUrl}/find-statistics/${release.publicationSlug}/${release.slug}`}
101-
/>
102-
</p>
97+
<UrlContainer
98+
className="govuk-!-margin-bottom-4"
99+
testId="public-release-url"
100+
url={`${publicAppUrl}/find-statistics/${release.publicationSlug}/${release.slug}`}
101+
/>
103102

104103
<SummaryList>
105104
<SummaryListItem term="Current status">

src/explore-education-statistics-admin/src/pages/release/pre-release/ReleasePreReleaseAccessPage.tsx

+13-14
Original file line numberDiff line numberDiff line change
@@ -73,20 +73,19 @@ const ReleasePreReleaseAccessPage = () => {
7373
The <strong>pre-release</strong> will be accessible at:
7474
</p>
7575

76-
<p>
77-
<UrlContainer
78-
data-testid="prerelease-url"
79-
url={`${
80-
window.location.origin
81-
}${generatePath<ReleaseRouteParams>(
82-
preReleaseContentRoute.path,
83-
{
84-
publicationId: release.publicationId,
85-
releaseId: release.id,
86-
},
87-
)}`}
88-
/>
89-
</p>
76+
<UrlContainer
77+
className="govuk-!-margin-bottom-4"
78+
testId="prerelease-url"
79+
url={`${
80+
window.location.origin
81+
}${generatePath<ReleaseRouteParams>(
82+
preReleaseContentRoute.path,
83+
{
84+
publicationId: release.publicationId,
85+
releaseId: release.id,
86+
},
87+
)}`}
88+
/>
9089
</>
9190
)}
9291

src/explore-education-statistics-common/src/components/UrlContainer.tsx

+25-11
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,49 @@
1+
import styles from '@common/components/UrlContainer.module.scss';
12
import classNames from 'classnames';
2-
import React from 'react';
3-
import styles from './UrlContainer.module.scss';
3+
import React, { ReactNode } from 'react';
44

55
interface Props {
6-
'data-testid'?: string;
76
className?: string;
7+
label?: string | ReactNode;
8+
labelHidden?: boolean;
9+
testId?: string;
810
url: string;
911
}
1012

1113
const UrlContainer = ({
12-
'data-testid': dataTestId = 'url',
1314
className,
15+
label = 'Url',
16+
labelHidden = true,
17+
testId = 'url',
1418
url,
1519
}: Props) => {
1620
const handleFocus = (event: React.FocusEvent<HTMLInputElement>) =>
1721
event.target.select();
1822
return (
19-
<>
20-
<label htmlFor={dataTestId} className="govuk-visually-hidden">
21-
Url
23+
<div
24+
className={classNames(className, {
25+
'dfe-flex dfe-align-items--center': !labelHidden,
26+
})}
27+
>
28+
<label
29+
htmlFor={testId}
30+
className={classNames({
31+
'govuk-visually-hidden': labelHidden,
32+
'govuk-!-margin-right-2': !labelHidden,
33+
})}
34+
>
35+
{label}
2236
</label>
2337
<input
2438
type="text"
2539
value={url}
26-
id={dataTestId}
27-
className={classNames(styles.url, className)}
28-
data-testid={dataTestId}
40+
id={testId}
41+
className={styles.url}
42+
data-testid={testId}
2943
onFocus={handleFocus}
3044
readOnly
3145
/>
32-
</>
46+
</div>
3347
);
3448
};
3549

src/explore-education-statistics-common/src/services/api/index.ts

+6
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,9 @@ export const dataApi = new Client({
1515
requestInterceptors: [networkActivityRequestInterceptor],
1616
responseInterceptors: [networkActivityResponseInterceptor],
1717
});
18+
19+
export const publicApi = new Client({
20+
baseURL: `${process.env.PUBLIC_API_BASE_URL}/v${process.env.PUBLIC_API_VERSION}`,
21+
requestInterceptors: [networkActivityRequestInterceptor],
22+
responseInterceptors: [networkActivityResponseInterceptor],
23+
});

src/explore-education-statistics-frontend/.env

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
CONTENT_API_BASE_URL=http://localhost:5010/api
22
DATA_API_BASE_URL=http://localhost:5000/api
3+
PUBLIC_API_BASE_URL=https://localhost:5031/api
4+
PUBLIC_API_VERSION=1.0
5+
PUBLIC_API_DOCUMENTATION_URL=TODO-GUIDANCE-URL
36
NOTIFICATION_API_BASE_URL=http://localhost:7073/api
47
GA_TRACKING_ID=
58
PUBLIC_URL=http://localhost:3000/

src/explore-education-statistics-frontend/next.config.js

+3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ const nextConfig = {
1616
APP_ENV: process.env.APP_ENV,
1717
CONTENT_API_BASE_URL: process.env.CONTENT_API_BASE_URL,
1818
DATA_API_BASE_URL: process.env.DATA_API_BASE_URL,
19+
PUBLIC_API_BASE_URL: process.env.PUBLIC_API_BASE_URL,
20+
PUBLIC_API_VERSION: process.env.PUBLIC_API_VERSION,
21+
PUBLIC_API_DOCUMENTATION_URL: process.env.PUBLIC_API_DOCUMENTATION_URL,
1922
NOTIFICATION_API_BASE_URL: process.env.NOTIFICATION_API_BASE_URL,
2023
APPINSIGHTS_INSTRUMENTATIONKEY: process.env.APPINSIGHTS_INSTRUMENTATIONKEY,
2124
GA_TRACKING_ID: process.env.GA_TRACKING_ID,

0 commit comments

Comments
 (0)