@newskit-render/core 1.2.3 → 1.5.2
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 +140 -0
- package/__tests__/pages/[articleSlug].test.tsx +0 -9
- package/__tests__/pages/__snapshots__/home.test.tsx.snap +738 -250
- package/__tests__/pages/home.test.tsx +0 -9
- package/components/article/__tests__/__snapshots__/index.test.tsx.snap +383 -97
- package/components/article/__tests__/index.test.tsx +0 -9
- package/components/footer/__snapshots__/index.test.tsx.snap +144 -9
- package/components/footer/index.test.tsx +0 -9
- package/components/header/index.test.tsx +0 -9
- package/components/header/index.tsx +1 -1
- package/components/section/__tests__/ArticleSlice.test.tsx +2 -10
- package/components/section/layouts/__tests__/SectionRow.test.tsx +0 -9
- package/components/section/layouts/__tests__/__snapshots__/SectionRow.test.tsx.snap +854 -506
- package/next.config.js +0 -13
- package/package.json +16 -14
- package/pages/account/payment/index.tsx +18 -0
- package/pages/checkout/index.tsx +7 -0
- package/temp/header.tsx +76 -76
- package/pages/api/account/zuora/generate-rsa.ts +0 -5
package/next.config.js
CHANGED
|
@@ -4,11 +4,8 @@ const withTM = require('next-transpile-modules')([
|
|
|
4
4
|
'@newskit-render/auth',
|
|
5
5
|
'@newskit-render/my-account',
|
|
6
6
|
'@newskit-render/validation',
|
|
7
|
-
'@newskit-render/shared-components',
|
|
8
7
|
])
|
|
9
8
|
|
|
10
|
-
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer')
|
|
11
|
-
|
|
12
9
|
module.exports = withTM({
|
|
13
10
|
webpack: (config, options) => {
|
|
14
11
|
if (options.isServer) {
|
|
@@ -28,16 +25,6 @@ module.exports = withTM({
|
|
|
28
25
|
'react'
|
|
29
26
|
)
|
|
30
27
|
|
|
31
|
-
if (process.env.ANALYZE) {
|
|
32
|
-
config.plugins.push(
|
|
33
|
-
new BundleAnalyzerPlugin({
|
|
34
|
-
analyzerMode: 'server',
|
|
35
|
-
analyzerPort: options.isServer ? 8888 : 8889,
|
|
36
|
-
openAnalyzer: true,
|
|
37
|
-
})
|
|
38
|
-
)
|
|
39
|
-
}
|
|
40
|
-
|
|
41
28
|
return config
|
|
42
29
|
},
|
|
43
30
|
async rewrites() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@newskit-render/core",
|
|
3
|
-
"version": "1.2
|
|
3
|
+
"version": "1.5.2",
|
|
4
4
|
"description": "Newskit Render - Core package",
|
|
5
5
|
"author": "",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -24,26 +24,26 @@
|
|
|
24
24
|
"pact:test": "NEWSKIT_API_ENV_URL='http://localhost:4343' jest --config=jest.config.pact.js",
|
|
25
25
|
"pact:publish": "pact-broker publish ./__pacts__/pacts --consumer-app-version=$(git describe --match '*core*' --abbrev=0) --tag='dev' --broker-base-url=$PACT_BROKER_URL --broker-token=$PACT_BROKER_TOKEN",
|
|
26
26
|
"lint": "eslint --ext .js,.jsx,.ts,.tsx . --color && prettier --check './**/*.{js,jsx,ts,tsx,json}'",
|
|
27
|
-
"lint:fix": "eslint --ext .js,.jsx,.ts,.tsx . --color --fix && prettier --write './**/*.{js,jsx,ts,tsx,json}'"
|
|
28
|
-
"analyze": "ANALYZE=true yarn build"
|
|
27
|
+
"lint:fix": "eslint --ext .js,.jsx,.ts,.tsx . --color --fix && prettier --write './**/*.{js,jsx,ts,tsx,json}'"
|
|
29
28
|
},
|
|
30
29
|
"dependencies": {
|
|
31
30
|
"@apollo/client": "^3.4.16",
|
|
32
|
-
"@newskit-render/api": "^0.
|
|
33
|
-
"@newskit-render/auth": "^0.
|
|
34
|
-
"@newskit-render/checkout": "^0.
|
|
35
|
-
"@newskit-render/my-account": "^0.
|
|
36
|
-
"@newskit-render/shared-components": "^0.
|
|
37
|
-
"@newskit-render/sitemap": "^0.
|
|
38
|
-
"@newskit-render/validation": "^0.
|
|
31
|
+
"@newskit-render/api": "^0.4.1",
|
|
32
|
+
"@newskit-render/auth": "^0.22.1",
|
|
33
|
+
"@newskit-render/checkout": "^0.6.2",
|
|
34
|
+
"@newskit-render/my-account": "^0.110.2",
|
|
35
|
+
"@newskit-render/shared-components": "^0.14.0",
|
|
36
|
+
"@newskit-render/sitemap": "^0.25.1",
|
|
37
|
+
"@newskit-render/validation": "^0.26.1",
|
|
39
38
|
"cross-fetch": "^3.1.4",
|
|
40
39
|
"graphql": "^15.6.0",
|
|
41
40
|
"newrelic": "^7.1.0",
|
|
42
|
-
"newskit": "
|
|
41
|
+
"newskit": "4.0.1",
|
|
43
42
|
"next": "^12.0.2",
|
|
44
43
|
"react": "^17.0.1",
|
|
45
44
|
"react-dom": "^17.0.2",
|
|
46
45
|
"react-helmet": "^6.1.0",
|
|
46
|
+
"react-hook-form": "7.8.4",
|
|
47
47
|
"striptags": "^3.1.1"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"@typescript-eslint/eslint-plugin": "^3.7.1",
|
|
59
59
|
"@typescript-eslint/parser": "^3.7.1",
|
|
60
60
|
"babel-jest": "^26.3.0",
|
|
61
|
-
"cypress": "
|
|
61
|
+
"cypress": "9.0.0",
|
|
62
62
|
"eslint": "^6.6.0",
|
|
63
63
|
"eslint-config-airbnb": "^18.2.0",
|
|
64
64
|
"eslint-config-airbnb-typescript": "^9.0.0",
|
|
@@ -82,10 +82,12 @@
|
|
|
82
82
|
"prettier-eslint-cli": "^5.0.0",
|
|
83
83
|
"ts-jest": "^27.0.5",
|
|
84
84
|
"typescript": "^4.4.3",
|
|
85
|
-
"wait-on": "^5.3.0"
|
|
86
|
-
"webpack-bundle-analyzer": "^4.5.0"
|
|
85
|
+
"wait-on": "^5.3.0"
|
|
87
86
|
},
|
|
88
87
|
"publishConfig": {
|
|
89
88
|
"access": "public"
|
|
89
|
+
},
|
|
90
|
+
"resolutions": {
|
|
91
|
+
"newskit/react-hook-form": "7.8.4"
|
|
90
92
|
}
|
|
91
93
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import newrelic from 'newrelic'
|
|
2
|
+
import {
|
|
3
|
+
Payment,
|
|
4
|
+
getProviderProps,
|
|
5
|
+
PaymentProvider,
|
|
6
|
+
} from '@newskit-render/my-account'
|
|
7
|
+
|
|
8
|
+
export default Payment
|
|
9
|
+
|
|
10
|
+
export const getServerSideProps = async (context) => {
|
|
11
|
+
newrelic.setTransactionName('Edit Payment method')
|
|
12
|
+
|
|
13
|
+
return getProviderProps({
|
|
14
|
+
...context,
|
|
15
|
+
provider: 'Payment',
|
|
16
|
+
paymentProvider: PaymentProvider.Zuora,
|
|
17
|
+
})
|
|
18
|
+
}
|
package/temp/header.tsx
CHANGED
|
@@ -103,7 +103,7 @@ const pastDueBanner = {
|
|
|
103
103
|
},
|
|
104
104
|
cancelled: {
|
|
105
105
|
title: 'Your subscription has been cancelled.',
|
|
106
|
-
text: 'You
|
|
106
|
+
text: 'You’ll no longer have access to subscription benefits. To re-activate call 0800 555 1234.',
|
|
107
107
|
},
|
|
108
108
|
treshold: {
|
|
109
109
|
firstNotice: 26,
|
|
@@ -152,87 +152,87 @@ const Header: React.FC<{ user: UserData }> = ({ user }) => {
|
|
|
152
152
|
|
|
153
153
|
return (
|
|
154
154
|
<>
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
<Stack
|
|
159
|
-
flow="horizontal-center"
|
|
160
|
-
stackDistribution="space-between"
|
|
161
|
-
wrap="nowrap"
|
|
162
|
-
>
|
|
163
|
-
<NextLink
|
|
164
|
-
type="standalone"
|
|
165
|
-
overrides={{ stylePreset: 'linkStandaloneInverse' }}
|
|
166
|
-
href="/"
|
|
167
|
-
aria-label="Logo Link"
|
|
168
|
-
>
|
|
169
|
-
<Visible md lg xl>
|
|
170
|
-
<NewsKitLogoFull color="white" size="sizing120" />
|
|
171
|
-
</Visible>
|
|
172
|
-
<Visible xs sm>
|
|
173
|
-
<NewsKitLogoShort color="white" size="sizing120" />
|
|
174
|
-
</Visible>
|
|
175
|
-
</NextLink>
|
|
155
|
+
<StyledHeader aria-label="StyledHeader">
|
|
156
|
+
<MainGrid>
|
|
157
|
+
<Cell xs={12}>
|
|
176
158
|
<Stack
|
|
177
159
|
flow="horizontal-center"
|
|
178
|
-
stackDistribution="
|
|
160
|
+
stackDistribution="space-between"
|
|
179
161
|
wrap="nowrap"
|
|
180
162
|
>
|
|
181
|
-
<
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
163
|
+
<NextLink
|
|
164
|
+
type="standalone"
|
|
165
|
+
overrides={{ stylePreset: 'linkStandaloneInverse' }}
|
|
166
|
+
href="/"
|
|
167
|
+
aria-label="Logo Link"
|
|
168
|
+
>
|
|
169
|
+
<Visible md lg xl>
|
|
170
|
+
<NewsKitLogoFull color="white" size="sizing120" />
|
|
171
|
+
</Visible>
|
|
172
|
+
<Visible xs sm>
|
|
173
|
+
<NewsKitLogoShort color="white" size="sizing120" />
|
|
174
|
+
</Visible>
|
|
175
|
+
</NextLink>
|
|
176
|
+
<Stack
|
|
177
|
+
flow="horizontal-center"
|
|
178
|
+
stackDistribution="flex-end"
|
|
179
|
+
wrap="nowrap"
|
|
180
|
+
>
|
|
181
|
+
<NavigationContainer show={showMenu}>
|
|
182
|
+
<Navigation>
|
|
183
|
+
{showMenu && (
|
|
184
|
+
<Block
|
|
185
|
+
spaceStack="space050"
|
|
186
|
+
data-testid="mobile-block-space"
|
|
187
|
+
/>
|
|
188
|
+
)}
|
|
189
|
+
<NavButton
|
|
190
|
+
buttonText="Section One"
|
|
191
|
+
href="/section-one"
|
|
192
|
+
isMobile={showMenu}
|
|
193
|
+
ariaLabel="Section One Link"
|
|
194
|
+
/>
|
|
195
|
+
<NavButton
|
|
196
|
+
buttonText="Section Two"
|
|
197
|
+
href="/section-two"
|
|
198
|
+
isMobile={showMenu}
|
|
199
|
+
ariaLabel="Section Two Link"
|
|
200
|
+
/>
|
|
201
|
+
<NavButton
|
|
202
|
+
buttonText="Section Three"
|
|
203
|
+
href="/section-three"
|
|
204
|
+
isMobile={showMenu}
|
|
205
|
+
ariaLabel="Section Three Link"
|
|
206
|
+
/>
|
|
207
|
+
</Navigation>
|
|
208
|
+
</NavigationContainer>
|
|
209
|
+
<Visible xs sm>
|
|
210
|
+
<Block spaceInline="space050">
|
|
211
|
+
<IconFilledMenu
|
|
212
|
+
overrides={{
|
|
213
|
+
size: 'iconSize030',
|
|
214
|
+
stylePreset: 'linkStandaloneInverse',
|
|
215
|
+
}}
|
|
216
|
+
onClick={mobileMenuControl}
|
|
217
|
+
onKeyDown={handleEnterKeyPress(mobileMenuControl)}
|
|
218
|
+
role="button"
|
|
219
|
+
tabIndex={0}
|
|
220
|
+
aria-label="Mobile Menu Button"
|
|
221
|
+
data-testid="mobile-menu-btn"
|
|
187
222
|
/>
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
href="/section-one"
|
|
192
|
-
isMobile={showMenu}
|
|
193
|
-
ariaLabel="Section One Link"
|
|
194
|
-
/>
|
|
195
|
-
<NavButton
|
|
196
|
-
buttonText="Section Two"
|
|
197
|
-
href="/section-two"
|
|
198
|
-
isMobile={showMenu}
|
|
199
|
-
ariaLabel="Section Two Link"
|
|
200
|
-
/>
|
|
201
|
-
<NavButton
|
|
202
|
-
buttonText="Section Three"
|
|
203
|
-
href="/section-three"
|
|
204
|
-
isMobile={showMenu}
|
|
205
|
-
ariaLabel="Section Three Link"
|
|
206
|
-
/>
|
|
207
|
-
</Navigation>
|
|
208
|
-
</NavigationContainer>
|
|
209
|
-
<Visible xs sm>
|
|
210
|
-
<Block spaceInline="space050">
|
|
211
|
-
<IconFilledMenu
|
|
212
|
-
overrides={{
|
|
213
|
-
size: 'iconSize030',
|
|
214
|
-
stylePreset: 'linkStandaloneInverse',
|
|
215
|
-
}}
|
|
216
|
-
onClick={mobileMenuControl}
|
|
217
|
-
onKeyDown={handleEnterKeyPress(mobileMenuControl)}
|
|
218
|
-
role="button"
|
|
219
|
-
tabIndex={0}
|
|
220
|
-
aria-label="Mobile Menu Button"
|
|
221
|
-
data-testid="mobile-menu-btn"
|
|
222
|
-
/>
|
|
223
|
-
</Block>
|
|
224
|
-
</Visible>
|
|
223
|
+
</Block>
|
|
224
|
+
</Visible>
|
|
225
|
+
</Stack>
|
|
225
226
|
</Stack>
|
|
226
|
-
</
|
|
227
|
-
</
|
|
228
|
-
</
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
</>
|
|
227
|
+
</Cell>
|
|
228
|
+
</MainGrid>
|
|
229
|
+
</StyledHeader>
|
|
230
|
+
<PastDueBannerExternal
|
|
231
|
+
pastDueBanner={pastDueBanner}
|
|
232
|
+
vxInstances={user?.vxInstances}
|
|
233
|
+
wrapper={BannerContainer}
|
|
234
|
+
/>
|
|
235
|
+
</>
|
|
236
236
|
)
|
|
237
237
|
}
|
|
238
238
|
|