Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EES-5129 - Hotfix - Add manual confirmation pages to publication (un)subscription #4878

Merged
merged 23 commits into from
May 22, 2024
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
a3ebbaa
Correct api http verbs
sambiramairelogic May 16, 2024
57468ee
Remove unnecessary imports
sambiramairelogic May 16, 2024
d314f73
Clearer comments
sambiramairelogic May 16, 2024
7ceaf89
Refactor publication subscription functions to remove now-unnecessary…
sambiramairelogic May 16, 2024
4aeb0e8
WIP
sambiramairelogic May 20, 2024
57d11d7
Add verification error handling
sambiramairelogic May 20, 2024
f060a46
Add link to publication page on verification error now that we can
sambiramairelogic May 20, 2024
46fdaf0
Add tests for new subscription components
sambiramairelogic May 20, 2024
85a1247
Add tests for new UI pages
sambiramairelogic May 20, 2024
e7e622f
Add robots noindex and nofollow meta properties to all subscriptions …
sambiramairelogic May 21, 2024
9f97f57
Update unsubscribe link sent from ReleaseNotifier
sambiramairelogic May 21, 2024
32a9481
Setup TestContainers integration tests for the SubscriptionManager fu…
sambiramairelogic May 21, 2024
362878a
Replace manual validation with FluentValidation
sambiramairelogic May 21, 2024
b6d85fd
Import FromBody from the correct source
sambiramairelogic May 21, 2024
c1efc40
Add more tests
sambiramairelogic May 21, 2024
a4cbf9f
Add final tests
sambiramairelogic May 21, 2024
e6034e2
More concise assertions for 200 results
sambiramairelogic May 21, 2024
0084c6b
Remove unnecessary usings
sambiramairelogic May 21, 2024
68f5b8d
Remove unused usings
sambiramairelogic May 21, 2024
3667bda
Remove props duplication in publication server props
sambiramairelogic May 21, 2024
a62aded
Adjust tests to match changes
sambiramairelogic May 22, 2024
e9a116e
Revert new subscription form to RHF components because formik-removal…
sambiramairelogic May 22, 2024
a4e9f8f
Restore files accidentally lost in rebase
sambiramairelogic May 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add robots noindex and nofollow meta properties to all subscriptions …
…pages
  • Loading branch information
sambiramairelogic committed May 22, 2024
commit e7e622fdf8f860d2419e58a0296f9fa301ab8d2a
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace GovUk.Education.ExploreEducationStatistics.Notifier.Tests.Functions;

public class SubscriptionManagerTests
{

}
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@ import notificationService, {
import withAxiosHandler from '@frontend/middleware/ssr/withAxiosHandler';
import SubscriptionStatusMessage from '@frontend/modules/subscriptions/components/SubscriptionStatusMessage';
import VerificationErrorMessage from '@frontend/modules/subscriptions/components/VerificationErrorMessage';
import Head from 'next/head';

interface Props {
publicationSlug: string;
@@ -57,6 +58,10 @@ const ConfirmSubscriptionPage: NextPage<Props> = ({
{ name: data.title, link: `/find-statistics/${publicationSlug}` },
]}
>
<Head>
<meta name="robots" content="noindex,nofollow" />
<meta name="googlebot" content="noindex,nofollow" />
</Head>
{confirmedSubscription ? (
<SubscriptionStatusMessage
title={data.title}
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@ import notificationService, {
} from '@frontend/services/notificationService';
import withAxiosHandler from '@frontend/middleware/ssr/withAxiosHandler';
import SubscriptionStatusMessage from '@frontend/modules/subscriptions/components/SubscriptionStatusMessage';
import Head from 'next/head';

interface Props {
publicationSlug: string;
@@ -28,6 +29,8 @@ const ConfirmUnsubscriptionPage: NextPage<Props> = ({
>(undefined);

const onConfirmClicked = async () => {
// TODO: Currently we get a 400 if the token isn't valid, but aren't
// properly handling this like we are for verification errors.
const response = await notificationService.confirmUnsubscription(
data.id,
token,
@@ -46,6 +49,10 @@ const ConfirmUnsubscriptionPage: NextPage<Props> = ({
{ name: data.title, link: `/find-statistics/${publicationSlug}` },
]}
>
<Head>
<meta name="robots" content="noindex,nofollow" />
<meta name="googlebot" content="noindex,nofollow" />
</Head>
{unsubscribedSubscription ? (
<SubscriptionStatusMessage
title={data.title}
Original file line number Diff line number Diff line change
@@ -14,6 +14,7 @@ import Page from '@frontend/components/Page';
import notificationService from '@frontend/services/notificationService';
import withAxiosHandler from '@frontend/middleware/ssr/withAxiosHandler';
import SubscriptionStatusMessage from '@frontend/modules/subscriptions/components/SubscriptionStatusMessage';
import Head from 'next/head';

interface FormValues {
email: string;
@@ -54,6 +55,10 @@ const SubscriptionPage: NextPage<Props> = ({ data, slug }) => {
{ name: data.title, link: `/find-statistics/${slug}` },
]}
>
<Head>
<meta name="robots" content="noindex,nofollow" />
<meta name="googlebot" content="noindex,nofollow" />
</Head>
<FormProvider
enableReinitialize
initialValues={{
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ const notificationService = {
query,
);
},
confirmPendingSubscription(
async confirmPendingSubscription(
id: string,
token: string,
): Promise<Subscription | undefined> {