@newskit-render/core 1.33.1 → 1.42.1

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.
Files changed (29) hide show
  1. package/CHANGELOG.md +150 -0
  2. package/__tests__/pages/__snapshots__/home.test.tsx.snap +42 -45
  3. package/app-context/AppContext.test.tsx +0 -12
  4. package/components/{404/404.tsx → ErrorPage/ErrorPage.tsx} +10 -6
  5. package/components/article/__tests__/index.test.tsx +2 -2
  6. package/components/article/index.tsx +5 -3
  7. package/components/header/index.tsx +8 -4
  8. package/components/section/ArticleSlice.tsx +1 -1
  9. package/components/section/__tests__/ArticleSlice.test.tsx +12 -11
  10. package/components/section/__tests__/CollectionBlock.test.tsx +1 -1
  11. package/components/section/__tests__/sectionUtils.test.ts +12 -9
  12. package/components/section/layouts/__tests__/Lead.test.tsx +2 -1
  13. package/components/section/layouts/__tests__/SectionRow.test.tsx +6 -5
  14. package/components/section/layouts/__tests__/__snapshots__/Lead.test.tsx.snap +2 -2
  15. package/components/section/layouts/__tests__/__snapshots__/SectionRow.test.tsx.snap +143 -58
  16. package/components/section/sectionUtils.ts +6 -6
  17. package/cypress/e2e/account/account-subscription.spec.js +222 -0
  18. package/cypress/e2e/account/payment-failer.spec.js +137 -0
  19. package/cypress/support/commands.js +28 -3
  20. package/helpers/global-types.ts +2 -2
  21. package/helpers/mocks/getPageMock.ts +59 -35
  22. package/infrastructure/.circleci/config.yml +2 -2
  23. package/package.json +11 -11
  24. package/pages/[section]/index.tsx +18 -7
  25. package/pages/_error.tsx +18 -2
  26. package/public/MyAccount/pending-activation.svg +16 -0
  27. package/queries/getPage.ts +1 -1
  28. package/temp/header.tsx +8 -4
  29. 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 <FourOhFour />
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