@newskit-render/core 2.35.0-alpha.0 → 2.35.1-alpha.0
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/.eslintrc +3 -2
- package/CHANGELOG.md +8 -0
- package/components/section/sectionUtils.ts +6 -6
- package/cypress/e2e/account/account-subscription.spec.js +0 -1
- package/helpers/mocks/getRadioPostMock.ts +1 -0
- package/helpers/mocks/getUniversalArticleMock.ts +1 -0
- package/package.json +14 -18
- package/pages/_error.tsx +19 -19
package/.eslintrc
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"plugins": ["prettier", "@typescript-eslint", "cypress"],
|
|
3
|
-
"extends": ["airbnb-typescript", "
|
|
3
|
+
"extends": ["airbnb-typescript", "prettier", "plugin:cypress/recommended", "next/core-web-vitals", "next"],
|
|
4
4
|
"parser": "@typescript-eslint/parser",
|
|
5
5
|
"parserOptions": {
|
|
6
6
|
"project": "./tsconfig.json"
|
|
@@ -67,6 +67,7 @@
|
|
|
67
67
|
"react/no-unescaped-entities": "off",
|
|
68
68
|
"react/jsx-one-expression-per-line": "off",
|
|
69
69
|
"react/jsx-wrap-multilines": "off",
|
|
70
|
-
"react/destructuring-assignment": "off"
|
|
70
|
+
"react/destructuring-assignment": "off",
|
|
71
|
+
"react/display-name": "off"
|
|
71
72
|
}
|
|
72
73
|
}
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [2.35.0](https://github.com/newscorp-ghfb/ncu-newskit-render/compare/@newskit-render/core@2.35.0-alpha.0...@newskit-render/core@2.35.0) (2022-12-22)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @newskit-render/core
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
# [2.34.0](https://github.com/newscorp-ghfb/ncu-newskit-render/compare/@newskit-render/core@2.34.0-alpha.0...@newskit-render/core@2.34.0) (2022-12-20)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @newskit-render/core
|
|
@@ -4,6 +4,12 @@ import {
|
|
|
4
4
|
TeaserCategory,
|
|
5
5
|
} from '../../helpers/global-types'
|
|
6
6
|
|
|
7
|
+
export const ratioMap: Record<string, string> = {
|
|
8
|
+
portrait: '2:3',
|
|
9
|
+
landscape: '3:2',
|
|
10
|
+
hero: '16:9',
|
|
11
|
+
}
|
|
12
|
+
|
|
7
13
|
export const getMedia = (media?: Media) => {
|
|
8
14
|
if (!media) {
|
|
9
15
|
return {
|
|
@@ -53,9 +59,3 @@ export const teaserURL = (teaser: ArticleTeaser) => {
|
|
|
53
59
|
? `${catagory}/${id}/${generateArticleSlug(headline)}`
|
|
54
60
|
: catagory
|
|
55
61
|
}
|
|
56
|
-
|
|
57
|
-
export const ratioMap: Record<string, string> = {
|
|
58
|
-
portrait: '2:3',
|
|
59
|
-
landscape: '3:2',
|
|
60
|
-
hero: '16:9',
|
|
61
|
-
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as printSubscriptionPageProps from '../../fixtures/print-subscriptions/print-subscription-response.json'
|
|
2
1
|
import { paymentFailure } from '../../fixtures/paymentFailure'
|
|
3
2
|
// These tests are skiped now, until CPS resolves their issue with subsriptions.
|
|
4
3
|
describe('Account Subscription & Cancellation', () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@newskit-render/core",
|
|
3
|
-
"version": "2.35.
|
|
3
|
+
"version": "2.35.1-alpha.0",
|
|
4
4
|
"description": "Newskit Render - Core package",
|
|
5
5
|
"author": "",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -39,15 +39,15 @@
|
|
|
39
39
|
"@emotion-icons/material-outlined": "3.14.0",
|
|
40
40
|
"@emotion/react": "11.10.4",
|
|
41
41
|
"@emotion/styled": "11.10.4",
|
|
42
|
-
"@newskit-render/api": "^1.5.
|
|
43
|
-
"@newskit-render/auth": "^1.3.
|
|
44
|
-
"@newskit-render/checkout": "^1.9.
|
|
45
|
-
"@newskit-render/feature-flags": "^1.4.
|
|
46
|
-
"@newskit-render/feed": "^1.4.
|
|
47
|
-
"@newskit-render/my-account": "^3.23.
|
|
48
|
-
"@newskit-render/shared-components": "^1.24.
|
|
49
|
-
"@newskit-render/standalone-components": "^1.15.
|
|
50
|
-
"@newskit-render/validation": "^1.5.
|
|
42
|
+
"@newskit-render/api": "^1.5.6-alpha.0",
|
|
43
|
+
"@newskit-render/auth": "^1.3.5-alpha.0",
|
|
44
|
+
"@newskit-render/checkout": "^1.9.4-alpha.0",
|
|
45
|
+
"@newskit-render/feature-flags": "^1.4.6-alpha.0",
|
|
46
|
+
"@newskit-render/feed": "^1.4.8-alpha.0",
|
|
47
|
+
"@newskit-render/my-account": "^3.23.4-alpha.0",
|
|
48
|
+
"@newskit-render/shared-components": "^1.24.3-alpha.0",
|
|
49
|
+
"@newskit-render/standalone-components": "^1.15.4-alpha.0",
|
|
50
|
+
"@newskit-render/validation": "^1.5.7-alpha.0",
|
|
51
51
|
"cross-fetch": "3.1.5",
|
|
52
52
|
"graphql": "16.6.0",
|
|
53
53
|
"lodash.get": "4.4.2",
|
|
@@ -73,26 +73,22 @@
|
|
|
73
73
|
"@types/react": "18.0.26",
|
|
74
74
|
"@types/react-dom": "18.0.9",
|
|
75
75
|
"@types/react-helmet": "6.1.0",
|
|
76
|
-
"@typescript-eslint/eslint-plugin": "5.
|
|
77
|
-
"@typescript-eslint/parser": "5.
|
|
76
|
+
"@typescript-eslint/eslint-plugin": "5.47.0",
|
|
77
|
+
"@typescript-eslint/parser": "5.47.0",
|
|
78
78
|
"axe-core": "4.3.4",
|
|
79
79
|
"babel-jest": "26.3.0",
|
|
80
80
|
"cypress": "9.0.0",
|
|
81
81
|
"cypress-axe": "1.1.0",
|
|
82
|
-
"eslint": "8.
|
|
82
|
+
"eslint": "8.30.0",
|
|
83
83
|
"eslint-config-airbnb": "19.0.4",
|
|
84
84
|
"eslint-config-airbnb-typescript": "17.0.0",
|
|
85
|
+
"eslint-config-next": "13.0.7",
|
|
85
86
|
"eslint-config-prettier": "8.5.0",
|
|
86
|
-
"eslint-config-react-app": "7.0.1",
|
|
87
87
|
"eslint-import-resolver-typescript": "3.5.2",
|
|
88
88
|
"eslint-loader": "4.0.2",
|
|
89
89
|
"eslint-plugin-cypress": "2.12.1",
|
|
90
90
|
"eslint-plugin-flowtype": "8.0.3",
|
|
91
|
-
"eslint-plugin-import": "2.26.0",
|
|
92
|
-
"eslint-plugin-jsx-a11y": "6.6.1",
|
|
93
91
|
"eslint-plugin-prettier": "4.2.1",
|
|
94
|
-
"eslint-plugin-react": "7.31.11",
|
|
95
|
-
"eslint-plugin-react-hooks": "4.6.0",
|
|
96
92
|
"jest": "27.4.7",
|
|
97
93
|
"jest-junit": "12.0.0",
|
|
98
94
|
"jest-watch-typeahead": "0.6.3",
|
package/pages/_error.tsx
CHANGED
|
@@ -4,25 +4,6 @@ import Error from 'next/error'
|
|
|
4
4
|
import { getCircularReplacer } from '../helpers/getCircularReplacer'
|
|
5
5
|
import ErrorPage from '../components/ErrorPage/ErrorPage'
|
|
6
6
|
|
|
7
|
-
CustomError.getInitialProps = ({ res, err, asPath }) => {
|
|
8
|
-
let statusCode = 404
|
|
9
|
-
|
|
10
|
-
if (res) {
|
|
11
|
-
statusCode = res.statusCode
|
|
12
|
-
} else if (err) {
|
|
13
|
-
statusCode = err.statusCode
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
// Logging the error for being captured by New Relic
|
|
17
|
-
console.error(
|
|
18
|
-
`An ${statusCode} error has occurred ${
|
|
19
|
-
err ? `:${JSON.stringify(err, getCircularReplacer())}` : ''
|
|
20
|
-
}`
|
|
21
|
-
)
|
|
22
|
-
|
|
23
|
-
return { statusCode, asPath }
|
|
24
|
-
}
|
|
25
|
-
|
|
26
7
|
function CustomError({ statusCode, asPath }) {
|
|
27
8
|
const isMyAccountApplication = asPath.startsWith('/account')
|
|
28
9
|
|
|
@@ -54,4 +35,23 @@ function CustomError({ statusCode, asPath }) {
|
|
|
54
35
|
return <Error statusCode={statusCode} />
|
|
55
36
|
}
|
|
56
37
|
|
|
38
|
+
CustomError.getInitialProps = ({ res, err, asPath }) => {
|
|
39
|
+
let statusCode = 404
|
|
40
|
+
|
|
41
|
+
if (res) {
|
|
42
|
+
statusCode = res.statusCode
|
|
43
|
+
} else if (err) {
|
|
44
|
+
statusCode = err.statusCode
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Logging the error for being captured by New Relic
|
|
48
|
+
console.error(
|
|
49
|
+
`An ${statusCode} error has occurred ${
|
|
50
|
+
err ? `:${JSON.stringify(err, getCircularReplacer())}` : ''
|
|
51
|
+
}`
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
return { statusCode, asPath }
|
|
55
|
+
}
|
|
56
|
+
|
|
57
57
|
export default CustomError
|