@newskit-render/core 1.34.0 → 1.42.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +139 -0
- package/__tests__/pages/__snapshots__/home.test.tsx.snap +42 -45
- package/app-context/AppContext.test.tsx +0 -12
- package/components/{404/404.tsx → ErrorPage/ErrorPage.tsx} +10 -6
- package/components/article/__tests__/index.test.tsx +2 -2
- package/components/article/index.tsx +5 -3
- package/components/header/index.tsx +7 -3
- package/components/section/ArticleSlice.tsx +1 -1
- package/components/section/__tests__/ArticleSlice.test.tsx +12 -11
- package/components/section/__tests__/CollectionBlock.test.tsx +1 -1
- package/components/section/__tests__/sectionUtils.test.ts +12 -9
- package/components/section/layouts/__tests__/Lead.test.tsx +2 -1
- package/components/section/layouts/__tests__/SectionRow.test.tsx +6 -5
- package/components/section/layouts/__tests__/__snapshots__/Lead.test.tsx.snap +2 -2
- package/components/section/layouts/__tests__/__snapshots__/SectionRow.test.tsx.snap +143 -58
- package/components/section/sectionUtils.ts +6 -6
- package/cypress/e2e/account/account-subscription.spec.js +222 -0
- package/cypress/e2e/account/payment-failer.spec.js +137 -0
- package/cypress/support/commands.js +28 -3
- package/helpers/global-types.ts +2 -2
- package/helpers/mocks/getPageMock.ts +59 -35
- package/infrastructure/.circleci/config.yml +3 -2
- package/package.json +9 -9
- package/pages/[section]/index.tsx +18 -7
- package/pages/_error.tsx +18 -2
- package/pages/preview/[articleId]/version/[versionId]/index.tsx +17 -15
- package/public/MyAccount/pending-activation.svg +16 -0
- package/queries/getPage.ts +1 -1
- package/temp/header.tsx +7 -3
- package/app-context/__snapshots__/AppContext.test.tsx.snap +0 -3
package/pages/_error.tsx
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { NotFound, GenericError } from '@newskit-render/my-account'
|
|
3
3
|
import Error from 'next/error'
|
|
4
|
-
import FourOhFour from '../components/404/404'
|
|
5
4
|
import { getCircularReplacer } from '../helpers/getCircularReplacer'
|
|
5
|
+
import ErrorPage from '../components/ErrorPage/ErrorPage'
|
|
6
6
|
|
|
7
7
|
CustomError.getInitialProps = ({ res, err, asPath }) => {
|
|
8
8
|
let statusCode = 404
|
|
@@ -33,8 +33,24 @@ function CustomError({ statusCode, asPath }) {
|
|
|
33
33
|
return <GenericError />
|
|
34
34
|
}
|
|
35
35
|
if (statusCode === 404) {
|
|
36
|
-
return
|
|
36
|
+
return (
|
|
37
|
+
<ErrorPage
|
|
38
|
+
title="Page not found"
|
|
39
|
+
errorMassage={`
|
|
40
|
+
We can't seem to find what you're looking for. If you typed a URL
|
|
41
|
+
into your browser, it might be worth checking and trying again.`}
|
|
42
|
+
/>
|
|
43
|
+
)
|
|
37
44
|
}
|
|
45
|
+
if (statusCode === 500 || statusCode === 502) {
|
|
46
|
+
return (
|
|
47
|
+
<ErrorPage
|
|
48
|
+
title="Server-side error occurred"
|
|
49
|
+
errorMassage="We could not fetch the data from the server"
|
|
50
|
+
/>
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
|
|
38
54
|
return <Error statusCode={statusCode} />
|
|
39
55
|
}
|
|
40
56
|
|
|
@@ -61,21 +61,23 @@ const PreviewArticle = ({
|
|
|
61
61
|
|
|
62
62
|
return (
|
|
63
63
|
<PageWithAuth onDenied={accessDeniedPage} isLoading={showOnLoading}>
|
|
64
|
-
|
|
65
|
-
<
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
64
|
+
<>
|
|
65
|
+
<CookieView>
|
|
66
|
+
<Button size="medium" onClick={() => signOut()}>
|
|
67
|
+
sign out
|
|
68
|
+
</Button>
|
|
69
|
+
</CookieView>
|
|
70
|
+
<ArticlePage
|
|
71
|
+
section={section}
|
|
72
|
+
articleURL={articleURL}
|
|
73
|
+
{...universalArticle}
|
|
74
|
+
siteHost={siteHost}
|
|
75
|
+
gscId={gscId}
|
|
76
|
+
twitterUsername={twitterUsername}
|
|
77
|
+
highlights={highlights}
|
|
78
|
+
relatedArticles={relatedArticles}
|
|
79
|
+
/>
|
|
80
|
+
</>
|
|
79
81
|
</PageWithAuth>
|
|
80
82
|
)
|
|
81
83
|
}
|