@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.
- package/CHANGELOG.md +150 -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 +8 -4
- 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 +2 -2
- package/package.json +11 -11
- package/pages/[section]/index.tsx +18 -7
- package/pages/_error.tsx +18 -2
- package/public/MyAccount/pending-activation.svg +16 -0
- package/queries/getPage.ts +1 -1
- package/temp/header.tsx +8 -4
- package/app-context/__snapshots__/AppContext.test.tsx.snap +0 -3
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
describe('Account Subscription & Cancellation', () => {
|
|
2
|
+
it('Should show no subscription view', () => {
|
|
3
|
+
cy.GetAcsSession('noSub')
|
|
4
|
+
cy.mockConsentAndVisit('/account/subscription-and-billing')
|
|
5
|
+
cy.contains('You don’t have a subscription')
|
|
6
|
+
cy.contains('Start a subscription and get access to all benefits.')
|
|
7
|
+
cy.get('[data-testid="primary-button"]')
|
|
8
|
+
.should('have.attr', 'href', '/title-storefrount')
|
|
9
|
+
.contains('View subscription options')
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
it('Should show Pending Activation view', () => {
|
|
13
|
+
cy.GetAcsSession('expiredSub')
|
|
14
|
+
cy.mockConsent()
|
|
15
|
+
cy.visit('/account/subscription-and-billing', {
|
|
16
|
+
onBeforeLoad: (win) => {
|
|
17
|
+
let nextData
|
|
18
|
+
|
|
19
|
+
Object.defineProperty(win, '__NEXT_DATA__', {
|
|
20
|
+
set(o) {
|
|
21
|
+
// eslint-disable-next-line no-param-reassign
|
|
22
|
+
o.props.pageProps.user.subscriptions[0].status =
|
|
23
|
+
'Pending Activation'
|
|
24
|
+
nextData = o
|
|
25
|
+
},
|
|
26
|
+
get() {
|
|
27
|
+
return nextData
|
|
28
|
+
},
|
|
29
|
+
})
|
|
30
|
+
},
|
|
31
|
+
})
|
|
32
|
+
cy.contains('Your subscription is being activated')
|
|
33
|
+
cy.contains(
|
|
34
|
+
'Your membership is being set up at the moment, so you can’t access your subscription and billing details yet.'
|
|
35
|
+
)
|
|
36
|
+
cy.contains(
|
|
37
|
+
'Setting up your account can take a couple of hours, so please come back and try again later.'
|
|
38
|
+
)
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
it('Should show expired subscription view', () => {
|
|
42
|
+
cy.GetAcsSession('expiredSub')
|
|
43
|
+
cy.mockConsent()
|
|
44
|
+
const date = new Date(Date.now() - 24 * 35 * 3600 * 1000)
|
|
45
|
+
cy.visit('/account/subscription-and-billing', {
|
|
46
|
+
onBeforeLoad: (win) => {
|
|
47
|
+
let nextData
|
|
48
|
+
|
|
49
|
+
Object.defineProperty(win, '__NEXT_DATA__', {
|
|
50
|
+
set(o) {
|
|
51
|
+
// eslint-disable-next-line no-param-reassign
|
|
52
|
+
o.props.pageProps.user.subscriptions[0].serviceCancellationDate = date.toISOString()
|
|
53
|
+
nextData = o
|
|
54
|
+
},
|
|
55
|
+
get() {
|
|
56
|
+
return nextData
|
|
57
|
+
},
|
|
58
|
+
})
|
|
59
|
+
},
|
|
60
|
+
})
|
|
61
|
+
|
|
62
|
+
cy.contains('You’ve previously had a subscription that has now expired')
|
|
63
|
+
|
|
64
|
+
cy.contains(
|
|
65
|
+
`On ${date.toLocaleDateString(
|
|
66
|
+
'en-GB'
|
|
67
|
+
)} your Digital subscription expired. You can can re-subscribe by confirming a few details or view other packages that are available.`
|
|
68
|
+
)
|
|
69
|
+
cy.get('[data-testid="primary-button"]')
|
|
70
|
+
.should('have.attr', 'href', '/title-re-subscribe')
|
|
71
|
+
.contains('Re-subscribe')
|
|
72
|
+
cy.get('[data-testid="secondary-button"]')
|
|
73
|
+
.should('have.attr', 'href', '/title-subscription-options')
|
|
74
|
+
.contains('View subscription options')
|
|
75
|
+
})
|
|
76
|
+
|
|
77
|
+
it('should got through cancellation workflow', () => {
|
|
78
|
+
cy.GetAcsSession('withSub')
|
|
79
|
+
cy.mockConsentAndVisit('/account/subscription-and-billing')
|
|
80
|
+
cy.contains('h1', 'Subscription & Billing')
|
|
81
|
+
cy.contains(
|
|
82
|
+
'All your subscription details, including payment info and transactions.'
|
|
83
|
+
)
|
|
84
|
+
cy.contains('4AAA038742030')
|
|
85
|
+
cy.contains('************1111')
|
|
86
|
+
cy.contains('expiry date 01/31')
|
|
87
|
+
|
|
88
|
+
cy.get('a[href="/account/cancellation"]').should('be.visible').click()
|
|
89
|
+
|
|
90
|
+
cy.get('[type="radio"]').first().check()
|
|
91
|
+
cy.get('[data-testid="primary-button"]').scrollIntoView().click()
|
|
92
|
+
cy.contains('Are you sure you want to cancel your subscription?')
|
|
93
|
+
cy.contains(
|
|
94
|
+
'You will lose unlimited access to exclusive content and benefits.'
|
|
95
|
+
)
|
|
96
|
+
cy.contains(
|
|
97
|
+
'Your subscription full access will be revoked by the end of your current bill cycle.'
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
// mock sussesful cancellation
|
|
101
|
+
cy.intercept('POST', '/api/account/mutate', {
|
|
102
|
+
statusCode: 200,
|
|
103
|
+
body: { data: { cancelSubscription: { success: true } } },
|
|
104
|
+
})
|
|
105
|
+
cy.get('[data-testid="primary-button"]').scrollIntoView().click()
|
|
106
|
+
cy.get('[data-testid="dialog-content"]').should('be.visible')
|
|
107
|
+
// go back to subscription and billing
|
|
108
|
+
cy.contains('Back to account').click()
|
|
109
|
+
cy.intercept('/account/subscription-and-billing')
|
|
110
|
+
// reload with correct mock data to show past banner
|
|
111
|
+
const date = new Date(Date.now() + 20 * 30 * 3600 * 1000)
|
|
112
|
+
cy.visit('/account/subscription-and-billing', {
|
|
113
|
+
onBeforeLoad: (win) => {
|
|
114
|
+
let nextData
|
|
115
|
+
|
|
116
|
+
Object.defineProperty(win, '__NEXT_DATA__', {
|
|
117
|
+
set(o) {
|
|
118
|
+
// eslint-disable-next-line no-param-reassign
|
|
119
|
+
o.props.pageProps.user.subscriptions[0].serviceCancellationDate = date.toISOString()
|
|
120
|
+
nextData = o
|
|
121
|
+
},
|
|
122
|
+
get() {
|
|
123
|
+
return nextData
|
|
124
|
+
},
|
|
125
|
+
})
|
|
126
|
+
},
|
|
127
|
+
})
|
|
128
|
+
cy.get('[data-testid="banner-container"]').should('be.visible')
|
|
129
|
+
cy.contains('Your subscription will end soon.')
|
|
130
|
+
cy.contains(
|
|
131
|
+
`You have cancelled your subscription and will lose access to all benefits on ${date.getDate()}/${
|
|
132
|
+
date.getMonth() + 1
|
|
133
|
+
}/${date.getFullYear()}. To re-activate your subscription call XXXX-XXX-XXXX.`
|
|
134
|
+
)
|
|
135
|
+
cy.contains(
|
|
136
|
+
'If you change your mind or cancelled by mistake, speak to one of our advisors on XXXX-XXX-XXXX'
|
|
137
|
+
)
|
|
138
|
+
})
|
|
139
|
+
|
|
140
|
+
it('Should show warning when you dont give a cancellation reason', () => {
|
|
141
|
+
cy.GetAcsSession('withSub')
|
|
142
|
+
cy.mockConsentAndVisit('/account/cancellation')
|
|
143
|
+
cy.contains('Please tell us why you want to cancel')
|
|
144
|
+
cy.contains(
|
|
145
|
+
'We value your opinion and this information will help us understand how we can improve our product and the services we provide.'
|
|
146
|
+
)
|
|
147
|
+
cy.get('[data-testid="primary-button"]').click()
|
|
148
|
+
cy.contains('Please, select one option')
|
|
149
|
+
})
|
|
150
|
+
|
|
151
|
+
it('Should display textfield for other', () => {
|
|
152
|
+
cy.GetAcsSession('withSub')
|
|
153
|
+
cy.mockConsentAndVisit('/account/cancellation')
|
|
154
|
+
cy.contains('Please tell us why you want to cancel')
|
|
155
|
+
cy.get('[type="radio"]').check('Other')
|
|
156
|
+
cy.get('input[name="extra"]').clear().type('Thanks my buisness')
|
|
157
|
+
cy.get('[data-testid="primary-button"]').scrollIntoView().click()
|
|
158
|
+
cy.contains('Are you sure you want to cancel your subscription?')
|
|
159
|
+
})
|
|
160
|
+
|
|
161
|
+
it('Should not show banner once it has been dismissed', () => {
|
|
162
|
+
cy.GetAcsSession('withSub')
|
|
163
|
+
cy.mockConsent()
|
|
164
|
+
const date = new Date(Date.now() + 20 * 30 * 3600 * 1000)
|
|
165
|
+
cy.visit('/account/subscription-and-billing', {
|
|
166
|
+
onBeforeLoad: (win) => {
|
|
167
|
+
let nextData
|
|
168
|
+
|
|
169
|
+
Object.defineProperty(win, '__NEXT_DATA__', {
|
|
170
|
+
set(o) {
|
|
171
|
+
// eslint-disable-next-line no-param-reassign
|
|
172
|
+
o.props.pageProps.user.subscriptions[0].serviceCancellationDate = date.toISOString()
|
|
173
|
+
nextData = o
|
|
174
|
+
},
|
|
175
|
+
get() {
|
|
176
|
+
return nextData
|
|
177
|
+
},
|
|
178
|
+
})
|
|
179
|
+
},
|
|
180
|
+
})
|
|
181
|
+
cy.get('[data-testid="banner-container"]').should('be.visible')
|
|
182
|
+
cy.contains('Your subscription will end soon.')
|
|
183
|
+
cy.get('[data-testid="close-banner"]').click({
|
|
184
|
+
force: true,
|
|
185
|
+
multiple: true,
|
|
186
|
+
})
|
|
187
|
+
cy.reload()
|
|
188
|
+
cy.get('[data-testid="banner-container"]').should('not.exist')
|
|
189
|
+
})
|
|
190
|
+
|
|
191
|
+
it('Should not display banner if set date is passed current date', () => {
|
|
192
|
+
cy.GetAcsSession('withSub')
|
|
193
|
+
cy.mockConsent()
|
|
194
|
+
const date = new Date(Date.now() - 24 * 35 * 3600 * 1000)
|
|
195
|
+
cy.visit('/account/subscription-and-billing', {
|
|
196
|
+
onBeforeLoad: (win) => {
|
|
197
|
+
let nextData
|
|
198
|
+
|
|
199
|
+
Object.defineProperty(win, '__NEXT_DATA__', {
|
|
200
|
+
set(o) {
|
|
201
|
+
// eslint-disable-next-line no-param-reassign
|
|
202
|
+
o.props.pageProps.user.subscriptions[0].serviceCancellationDate = date.toISOString()
|
|
203
|
+
nextData = o
|
|
204
|
+
},
|
|
205
|
+
get() {
|
|
206
|
+
return nextData
|
|
207
|
+
},
|
|
208
|
+
})
|
|
209
|
+
},
|
|
210
|
+
})
|
|
211
|
+
cy.get('[data-testid="banner-container"]').should('be.visible')
|
|
212
|
+
cy.contains('Your subscription has been cancelled.').then(() => {
|
|
213
|
+
window.localStorage.setItem(
|
|
214
|
+
'cancelledBanner',
|
|
215
|
+
new Date(new Date().setDate(new Date().getDate() - 7)).toDateString()
|
|
216
|
+
)
|
|
217
|
+
})
|
|
218
|
+
cy.reload()
|
|
219
|
+
cy.get('[data-testid="banner-container"]').should('not.exist')
|
|
220
|
+
cy.clearLocalStorage()
|
|
221
|
+
})
|
|
222
|
+
})
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
describe('Payment Failer', () => {
|
|
2
|
+
it('Should show first notice', () => {
|
|
3
|
+
cy.GetAcsSession('withSub')
|
|
4
|
+
cy.mockConsent()
|
|
5
|
+
cy.visit('/account', {
|
|
6
|
+
onBeforeLoad: (win) => {
|
|
7
|
+
let nextData
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(win, '__NEXT_DATA__', {
|
|
10
|
+
set(o) {
|
|
11
|
+
// eslint-disable-next-line no-param-reassign
|
|
12
|
+
o.props.pageProps.user.paymentFailure = {
|
|
13
|
+
active: true,
|
|
14
|
+
startDate: new Date(Date.now() - 24 * 3600 * 1000).toISOString(),
|
|
15
|
+
}
|
|
16
|
+
nextData = o
|
|
17
|
+
},
|
|
18
|
+
get() {
|
|
19
|
+
return nextData
|
|
20
|
+
},
|
|
21
|
+
})
|
|
22
|
+
},
|
|
23
|
+
})
|
|
24
|
+
cy.get('[data-testid="banner-container"]').should('be.visible')
|
|
25
|
+
cy.contains("We haven't been able to take payment")
|
|
26
|
+
cy.contains(
|
|
27
|
+
'You may need to update your payment details to keep your subscription.'
|
|
28
|
+
)
|
|
29
|
+
cy.get('[data-testid="buttonLink"]').should('be.visible')
|
|
30
|
+
cy.contains('Update payment details')
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
it('Should show second notice', () => {
|
|
34
|
+
cy.GetAcsSession('withSub')
|
|
35
|
+
cy.mockConsent()
|
|
36
|
+
cy.visit('/account', {
|
|
37
|
+
onBeforeLoad: (win) => {
|
|
38
|
+
let nextData
|
|
39
|
+
|
|
40
|
+
Object.defineProperty(win, '__NEXT_DATA__', {
|
|
41
|
+
set(o) {
|
|
42
|
+
// eslint-disable-next-line no-param-reassign
|
|
43
|
+
o.props.pageProps.user.paymentFailure = {
|
|
44
|
+
active: true,
|
|
45
|
+
startDate: new Date(
|
|
46
|
+
Date.now() - 24 * 27 * 3600 * 1000
|
|
47
|
+
).toISOString(),
|
|
48
|
+
}
|
|
49
|
+
nextData = o
|
|
50
|
+
},
|
|
51
|
+
get() {
|
|
52
|
+
return nextData
|
|
53
|
+
},
|
|
54
|
+
})
|
|
55
|
+
},
|
|
56
|
+
})
|
|
57
|
+
cy.get('[data-testid="banner-container"]').should('be.visible')
|
|
58
|
+
cy.contains('Act now to keep your subscription')
|
|
59
|
+
cy.contains(
|
|
60
|
+
'We’ve tried several times, but haven’t been able to take payment. Please update your payment details to keep your subscription.'
|
|
61
|
+
)
|
|
62
|
+
cy.get('[data-testid="buttonLink"]').should('be.visible')
|
|
63
|
+
cy.contains('Update payment details')
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
it('Should show terminated notice', () => {
|
|
67
|
+
cy.GetAcsSession('withSub')
|
|
68
|
+
cy.mockConsent()
|
|
69
|
+
cy.visit('/account', {
|
|
70
|
+
onBeforeLoad: (win) => {
|
|
71
|
+
let nextData
|
|
72
|
+
|
|
73
|
+
Object.defineProperty(win, '__NEXT_DATA__', {
|
|
74
|
+
set(o) {
|
|
75
|
+
// eslint-disable-next-line no-param-reassign
|
|
76
|
+
o.props.pageProps.user.paymentFailure = {
|
|
77
|
+
active: true,
|
|
78
|
+
startDate: new Date(
|
|
79
|
+
Date.now() - 24 * 35 * 3600 * 1000
|
|
80
|
+
).toISOString(),
|
|
81
|
+
}
|
|
82
|
+
nextData = o
|
|
83
|
+
},
|
|
84
|
+
get() {
|
|
85
|
+
return nextData
|
|
86
|
+
},
|
|
87
|
+
})
|
|
88
|
+
},
|
|
89
|
+
})
|
|
90
|
+
cy.get('[data-testid="banner-container"]').should('be.visible')
|
|
91
|
+
cy.contains('Your subscription has been terminated')
|
|
92
|
+
cy.contains(
|
|
93
|
+
'We didn’t receive payment for your subscription. To reactivate it, please call XXXX-XXX-XXXX.'
|
|
94
|
+
)
|
|
95
|
+
})
|
|
96
|
+
|
|
97
|
+
it('Should show expired subscription view with terminated notice', () => {
|
|
98
|
+
cy.GetAcsSession('expiredSub')
|
|
99
|
+
cy.mockConsent()
|
|
100
|
+
const date = new Date(Date.now() - 24 * 35 * 3600 * 1000)
|
|
101
|
+
cy.visit('/account/subscription-and-billing', {
|
|
102
|
+
onBeforeLoad: (win) => {
|
|
103
|
+
let nextData
|
|
104
|
+
|
|
105
|
+
Object.defineProperty(win, '__NEXT_DATA__', {
|
|
106
|
+
set(o) {
|
|
107
|
+
// eslint-disable-next-line no-param-reassign
|
|
108
|
+
o.props.pageProps.user.paymentFailure = {
|
|
109
|
+
active: true,
|
|
110
|
+
startDate: date.toISOString(),
|
|
111
|
+
}
|
|
112
|
+
// eslint-disable-next-line no-param-reassign
|
|
113
|
+
o.props.pageProps.user.subscriptions[0].serviceCancellationDate = date.toISOString()
|
|
114
|
+
nextData = o
|
|
115
|
+
},
|
|
116
|
+
get() {
|
|
117
|
+
return nextData
|
|
118
|
+
},
|
|
119
|
+
})
|
|
120
|
+
},
|
|
121
|
+
})
|
|
122
|
+
|
|
123
|
+
cy.contains('You’ve previously had a subscription that has now expired')
|
|
124
|
+
|
|
125
|
+
cy.contains(
|
|
126
|
+
`On ${date.toLocaleDateString(
|
|
127
|
+
'en-GB'
|
|
128
|
+
)} your Digital subscription expired. You can can re-subscribe by confirming a few details or view other packages that are available.`
|
|
129
|
+
)
|
|
130
|
+
cy.get('[data-testid="primary-button"]')
|
|
131
|
+
.should('have.attr', 'href', '/title-re-subscribe')
|
|
132
|
+
.contains('Re-subscribe')
|
|
133
|
+
cy.get('[data-testid="secondary-button"]')
|
|
134
|
+
.should('have.attr', 'href', '/title-subscription-options')
|
|
135
|
+
.contains('View subscription options')
|
|
136
|
+
})
|
|
137
|
+
})
|
|
@@ -4,7 +4,32 @@ Cypress.Commands.add('mockConsentAndVisit', (url) => {
|
|
|
4
4
|
cy.visit(url)
|
|
5
5
|
})
|
|
6
6
|
|
|
7
|
-
Cypress.Commands.add('
|
|
7
|
+
Cypress.Commands.add('mockConsent', () => {
|
|
8
|
+
cy.setCookie('nukt_sp_consent', 'JABCDEFGHI')
|
|
9
|
+
cy.setCookie('consentUUID', '28cfcd1e-6916-4488-9d84-54f2618eaa14')
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
const userMap = {
|
|
13
|
+
default: {
|
|
14
|
+
username: 'temp.account@tempaccount.com',
|
|
15
|
+
password: 'asdasd1A',
|
|
16
|
+
},
|
|
17
|
+
noSub: {
|
|
18
|
+
username: 'render.e2e.no-sub@yopmail.com',
|
|
19
|
+
password: 'Ad45p0-swq151@',
|
|
20
|
+
},
|
|
21
|
+
expiredSub: {
|
|
22
|
+
username: 'tim.newsuk3@yopmail.com',
|
|
23
|
+
password: 'Ad45p0-swq151@',
|
|
24
|
+
},
|
|
25
|
+
withSub: {
|
|
26
|
+
username: 'render.e2e.sub@yopmail.com',
|
|
27
|
+
password: 'Ad45p0-swq151@',
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
Cypress.Commands.add('GetAcsSession', (user = 'default') => {
|
|
32
|
+
const { username, password } = userMap[user]
|
|
8
33
|
cy.request({
|
|
9
34
|
method: 'POST',
|
|
10
35
|
url: 'https://login.staging-thesun.co.uk/services/session',
|
|
@@ -16,8 +41,8 @@ Cypress.Commands.add('GetAcsSession', () => {
|
|
|
16
41
|
gotoUrl: 'https://login.staging-thesun.co.uk/',
|
|
17
42
|
sso: false,
|
|
18
43
|
authCredentials: {
|
|
19
|
-
username
|
|
20
|
-
password
|
|
44
|
+
username,
|
|
45
|
+
password,
|
|
21
46
|
},
|
|
22
47
|
},
|
|
23
48
|
}).then((response) => {
|
package/helpers/global-types.ts
CHANGED
|
@@ -13,7 +13,7 @@ const data = {
|
|
|
13
13
|
},
|
|
14
14
|
children: [
|
|
15
15
|
{
|
|
16
|
-
name: '
|
|
16
|
+
name: 'SUPPLEMENT_LEAD_AND_4_STACK',
|
|
17
17
|
type: 'slice',
|
|
18
18
|
children: [
|
|
19
19
|
{
|
|
@@ -80,10 +80,13 @@ const data = {
|
|
|
80
80
|
],
|
|
81
81
|
},
|
|
82
82
|
media: {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
83
|
+
crops: [
|
|
84
|
+
{
|
|
85
|
+
url:
|
|
86
|
+
'https://www.thesun.co.uk/wp-content/uploads/2022/03/SPORT-PREVIEW-Amadou-Onana-to-WHU.jpg?strip=all&w=620&h=413&crop=1',
|
|
87
|
+
alt: 'image alt',
|
|
88
|
+
},
|
|
89
|
+
],
|
|
87
90
|
},
|
|
88
91
|
},
|
|
89
92
|
},
|
|
@@ -106,10 +109,13 @@ const data = {
|
|
|
106
109
|
],
|
|
107
110
|
},
|
|
108
111
|
media: {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
112
|
+
crops: [
|
|
113
|
+
{
|
|
114
|
+
url:
|
|
115
|
+
'https://www.thesun.co.uk/wp-content/uploads/2022/03/SPORT-PREVIEW-Amadou-Onana-to-WHU.jpg?strip=all&w=620&h=413&crop=1',
|
|
116
|
+
alt: 'image alt 2',
|
|
117
|
+
},
|
|
118
|
+
],
|
|
113
119
|
},
|
|
114
120
|
},
|
|
115
121
|
},
|
|
@@ -131,12 +137,15 @@ const data = {
|
|
|
131
137
|
},
|
|
132
138
|
],
|
|
133
139
|
},
|
|
134
|
-
media:
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
140
|
+
media: [
|
|
141
|
+
{
|
|
142
|
+
crops: {
|
|
143
|
+
url:
|
|
144
|
+
'https://www.thesun.co.uk/wp-content/uploads/2022/03/SPORT-PREVIEW-Amadou-Onana-to-WHU.jpg?strip=all&w=620&h=413&crop=1',
|
|
145
|
+
alt: 'image alt 3',
|
|
146
|
+
},
|
|
138
147
|
},
|
|
139
|
-
|
|
148
|
+
],
|
|
140
149
|
},
|
|
141
150
|
},
|
|
142
151
|
{
|
|
@@ -158,10 +167,13 @@ const data = {
|
|
|
158
167
|
],
|
|
159
168
|
},
|
|
160
169
|
media: {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
170
|
+
crops: [
|
|
171
|
+
{
|
|
172
|
+
url:
|
|
173
|
+
'https://www.thesun.co.uk/wp-content/uploads/2022/03/SPORT-PREVIEW-Amadou-Onana-to-WHU.jpg?strip=all&w=620&h=413&crop=1',
|
|
174
|
+
alt: 'image alt 3',
|
|
175
|
+
},
|
|
176
|
+
],
|
|
165
177
|
},
|
|
166
178
|
},
|
|
167
179
|
},
|
|
@@ -245,7 +257,7 @@ const data = {
|
|
|
245
257
|
],
|
|
246
258
|
},
|
|
247
259
|
{
|
|
248
|
-
name: '
|
|
260
|
+
name: 'SUPPLEMENT_LEAD_AND_4_STACK',
|
|
249
261
|
type: 'slice',
|
|
250
262
|
children: [
|
|
251
263
|
{
|
|
@@ -312,10 +324,13 @@ const data = {
|
|
|
312
324
|
],
|
|
313
325
|
},
|
|
314
326
|
media: {
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
327
|
+
crops: [
|
|
328
|
+
{
|
|
329
|
+
url:
|
|
330
|
+
'https://www.thesun.co.uk/wp-content/uploads/2022/03/SPORT-PREVIEW-Amadou-Onana-to-WHU.jpg?strip=all&w=620&h=413&crop=1',
|
|
331
|
+
alt: 'image alt',
|
|
332
|
+
},
|
|
333
|
+
],
|
|
319
334
|
},
|
|
320
335
|
},
|
|
321
336
|
},
|
|
@@ -338,10 +353,13 @@ const data = {
|
|
|
338
353
|
],
|
|
339
354
|
},
|
|
340
355
|
media: {
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
356
|
+
crops: [
|
|
357
|
+
{
|
|
358
|
+
url:
|
|
359
|
+
'https://www.thesun.co.uk/wp-content/uploads/2022/03/SPORT-PREVIEW-Amadou-Onana-to-WHU.jpg?strip=all&w=620&h=413&crop=1',
|
|
360
|
+
alt: 'image alt 2',
|
|
361
|
+
},
|
|
362
|
+
],
|
|
345
363
|
},
|
|
346
364
|
},
|
|
347
365
|
},
|
|
@@ -364,10 +382,13 @@ const data = {
|
|
|
364
382
|
],
|
|
365
383
|
},
|
|
366
384
|
media: {
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
385
|
+
crops: [
|
|
386
|
+
{
|
|
387
|
+
url:
|
|
388
|
+
'https://www.thesun.co.uk/wp-content/uploads/2022/03/SPORT-PREVIEW-Amadou-Onana-to-WHU.jpg?strip=all&w=620&h=413&crop=1',
|
|
389
|
+
alt: 'image alt 3',
|
|
390
|
+
},
|
|
391
|
+
],
|
|
371
392
|
},
|
|
372
393
|
},
|
|
373
394
|
},
|
|
@@ -390,10 +411,13 @@ const data = {
|
|
|
390
411
|
],
|
|
391
412
|
},
|
|
392
413
|
media: {
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
414
|
+
crops: [
|
|
415
|
+
{
|
|
416
|
+
url:
|
|
417
|
+
'https://www.thesun.co.uk/wp-content/uploads/2022/03/SPORT-PREVIEW-Amadou-Onana-to-WHU.jpg?strip=all&w=620&h=413&crop=1',
|
|
418
|
+
alt: 'image alt 3',
|
|
419
|
+
},
|
|
420
|
+
],
|
|
397
421
|
},
|
|
398
422
|
},
|
|
399
423
|
},
|
|
@@ -645,7 +645,7 @@ orbs:
|
|
|
645
645
|
source $BASH_ENV
|
|
646
646
|
CURRENT_VERSION=$(jq -r .version ./package.json)
|
|
647
647
|
|
|
648
|
-
npm install --no-save release-documentation-cli@5.2.
|
|
648
|
+
npm install --no-save release-documentation-cli@5.2.4
|
|
649
649
|
|
|
650
650
|
# If your tags are prefixed (i.e. lerna) check the --tagFilter parameter
|
|
651
651
|
echo "Creating a release request for $CURRENT_VERSION to be deployed to production."
|
|
@@ -670,7 +670,7 @@ orbs:
|
|
|
670
670
|
export CURRENT_VERSION=$(jq -r .version ./package.json)
|
|
671
671
|
echo "export CURRENT_VERSION=$CURRENT_VERSION" >> $BASH_ENV
|
|
672
672
|
|
|
673
|
-
npm install --no-save release-documentation-cli@5.2.
|
|
673
|
+
npm install --no-save release-documentation-cli@5.2.4
|
|
674
674
|
|
|
675
675
|
# If your tags are prefixed (i.e. lerna) check the --tagFilter parameter
|
|
676
676
|
$(npm bin)/release promote
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@newskit-render/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.42.1",
|
|
4
4
|
"description": "Newskit Render - Core package",
|
|
5
5
|
"author": "",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -33,19 +33,19 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@apollo/client": "3.4.16",
|
|
36
|
-
"@newskit-render/api": "^0.
|
|
37
|
-
"@newskit-render/auth": "^0.
|
|
38
|
-
"@newskit-render/checkout": "^0.
|
|
39
|
-
"@newskit-render/feature-flags": "^0.
|
|
40
|
-
"@newskit-render/feed": "^0.
|
|
41
|
-
"@newskit-render/my-account": "^0.
|
|
42
|
-
"@newskit-render/shared-components": "^0.
|
|
43
|
-
"@newskit-render/validation": "^0.
|
|
36
|
+
"@newskit-render/api": "^0.18.0",
|
|
37
|
+
"@newskit-render/auth": "^0.31.1",
|
|
38
|
+
"@newskit-render/checkout": "^0.26.0",
|
|
39
|
+
"@newskit-render/feature-flags": "^0.12.0",
|
|
40
|
+
"@newskit-render/feed": "^0.5.1",
|
|
41
|
+
"@newskit-render/my-account": "^0.151.0",
|
|
42
|
+
"@newskit-render/shared-components": "^0.43.0",
|
|
43
|
+
"@newskit-render/validation": "^0.39.1",
|
|
44
44
|
"cross-fetch": "3.1.5",
|
|
45
45
|
"graphql": "15.6.0",
|
|
46
46
|
"newrelic": "7.1.0",
|
|
47
47
|
"newskit": "5.1.1",
|
|
48
|
-
"next": "12.0
|
|
48
|
+
"next": "12.1.0",
|
|
49
49
|
"react": "17.0.2",
|
|
50
50
|
"react-dom": "17.0.2",
|
|
51
51
|
"react-helmet": "6.1.0",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"jest-junit": "12.0.0",
|
|
87
87
|
"jest-watch-typeahead": "0.6.3",
|
|
88
88
|
"lint-staged": "12.1.7",
|
|
89
|
-
"next-transpile-modules": "
|
|
89
|
+
"next-transpile-modules": "9.0.0",
|
|
90
90
|
"prettier": "2.0.5",
|
|
91
91
|
"prettier-eslint": "11.0.0",
|
|
92
92
|
"prettier-eslint-cli": "5.0.0",
|
|
@@ -22,13 +22,24 @@ export async function getServerSideProps(context) {
|
|
|
22
22
|
: ''
|
|
23
23
|
|
|
24
24
|
newrelic.setTransactionName(`Section: ${section}`)
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
|
|
26
|
+
let data
|
|
27
|
+
let user
|
|
28
|
+
try {
|
|
29
|
+
const [{ data: pageData }, pageUser] = await Promise.all([
|
|
30
|
+
apolloClient.query({
|
|
31
|
+
query: GET_PAGE,
|
|
32
|
+
variables: { channel: section, publisher: 'DEMO' },
|
|
33
|
+
}),
|
|
34
|
+
await fetchUser(acsCookie, ACCOUNT_QUERY_URL),
|
|
35
|
+
])
|
|
36
|
+
data = pageData
|
|
37
|
+
user = pageUser
|
|
38
|
+
} catch (e) {
|
|
39
|
+
return {
|
|
40
|
+
notFound: true,
|
|
41
|
+
}
|
|
42
|
+
}
|
|
32
43
|
|
|
33
44
|
addCacheHeaders(context.res)
|
|
34
45
|
return {
|