@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.
Files changed (30) hide show
  1. package/CHANGELOG.md +139 -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 +7 -3
  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 +3 -2
  23. package/package.json +9 -9
  24. package/pages/[section]/index.tsx +18 -7
  25. package/pages/_error.tsx +18 -2
  26. package/pages/preview/[articleId]/version/[versionId]/index.tsx +17 -15
  27. package/public/MyAccount/pending-activation.svg +16 -0
  28. package/queries/getPage.ts +1 -1
  29. package/temp/header.tsx +7 -3
  30. 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('GetAcsSession', () => {
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: 'temp.account@tempaccount.com',
20
- password: 'asdasd1A',
44
+ username,
45
+ password,
21
46
  },
22
47
  },
23
48
  }).then((response) => {
@@ -123,8 +123,8 @@ export type Page = {
123
123
  export type Media = Image | Video
124
124
 
125
125
  export type Image = {
126
- crops?: ImageCrop[]
127
- crop: ImageCrop
126
+ crops: ImageCrop[]
127
+ crop?: ImageCrop
128
128
  }
129
129
 
130
130
  export type Video = {
@@ -13,7 +13,7 @@ const data = {
13
13
  },
14
14
  children: [
15
15
  {
16
- name: 'LEAD_1_AND_2',
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
- crop: {
84
- url: 'some-url-to-image',
85
- alt: 'image alt',
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
- crop: {
110
- url: 'some-url-to-image',
111
- alt: 'image alt 2',
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
- crop: {
136
- url: 'some-url-to-image',
137
- alt: 'image alt 3',
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
- crop: {
162
- url: 'some-url-to-image',
163
- alt: 'image alt 3',
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: 'LEAD_1_AND_2',
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
- crop: {
316
- url: 'some-url-to-image',
317
- alt: 'image alt',
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
- crop: {
342
- url: 'some-url-to-image',
343
- alt: 'image alt 2',
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
- crop: {
368
- url: 'some-url-to-image',
369
- alt: 'image alt 3',
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
- crop: {
394
- url: 'some-url-to-image',
395
- alt: 'image alt 3',
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
  },
@@ -255,6 +255,7 @@ orbs:
255
255
  echo 'export HELM_OPT_SET="$HELM_OPT_SET --set secret.items.OKTA_CLIENT_SECRET=${OKTA_CLIENT_SECRET}"' >> $BASH_ENV
256
256
  echo 'export HELM_OPT_SET="$HELM_OPT_SET --set secret.items.OKTA_DOMAIN=${OKTA_DOMAIN}"' >> $BASH_ENV
257
257
  echo 'export HELM_OPT_SET="$HELM_OPT_SET --set secret.items.NEXTAUTH_URL=${NEXTAUTH_URL}"' >> $BASH_ENV
258
+ echo 'export HELM_OPT_SET="$HELM_OPT_SET --set secret.items.NEXTAUTH_SECRET=${NEXTAUTH_SECRET}"' >> $BASH_ENV
258
259
  echo 'export HELM_OPT_SET="$HELM_OPT_SET --set secret.items.SN_PASSWORD=${SN_PASSWORD}"' >> $BASH_ENV
259
260
  echo 'export HELM_OPT_SET="$HELM_OPT_SET --set secret.items.SN_USERNAME=${SN_USERNAME}"' >> $BASH_ENV
260
261
  echo 'export HELM_OPT_SET="$HELM_OPT_SET --set secret.items.SN_ENVIRONMENT=${SN_ENVIRONMENT}"' >> $BASH_ENV
@@ -645,7 +646,7 @@ orbs:
645
646
  source $BASH_ENV
646
647
  CURRENT_VERSION=$(jq -r .version ./package.json)
647
648
 
648
- npm install --no-save release-documentation-cli@5.2.0
649
+ npm install --no-save release-documentation-cli@5.2.4
649
650
 
650
651
  # If your tags are prefixed (i.e. lerna) check the --tagFilter parameter
651
652
  echo "Creating a release request for $CURRENT_VERSION to be deployed to production."
@@ -670,7 +671,7 @@ orbs:
670
671
  export CURRENT_VERSION=$(jq -r .version ./package.json)
671
672
  echo "export CURRENT_VERSION=$CURRENT_VERSION" >> $BASH_ENV
672
673
 
673
- npm install --no-save release-documentation-cli@5.2.0
674
+ npm install --no-save release-documentation-cli@5.2.4
674
675
 
675
676
  # If your tags are prefixed (i.e. lerna) check the --tagFilter parameter
676
677
  $(npm bin)/release promote
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@newskit-render/core",
3
- "version": "1.34.0",
3
+ "version": "1.42.3",
4
4
  "description": "Newskit Render - Core package",
5
5
  "author": "",
6
6
  "license": "UNLICENSED",
@@ -33,14 +33,14 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@apollo/client": "3.4.16",
36
- "@newskit-render/api": "^0.16.0",
37
- "@newskit-render/auth": "^0.30.0",
38
- "@newskit-render/checkout": "^0.25.0",
39
- "@newskit-render/feature-flags": "^0.11.0",
40
- "@newskit-render/feed": "^0.4.0",
41
- "@newskit-render/my-account": "^0.145.0",
42
- "@newskit-render/shared-components": "^0.39.0",
43
- "@newskit-render/validation": "^0.38.0",
36
+ "@newskit-render/api": "^0.18.0",
37
+ "@newskit-render/auth": "^0.31.2",
38
+ "@newskit-render/checkout": "^0.26.1",
39
+ "@newskit-render/feature-flags": "^0.13.0",
40
+ "@newskit-render/feed": "^0.5.1",
41
+ "@newskit-render/my-account": "^0.151.1",
42
+ "@newskit-render/shared-components": "^0.43.1",
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",
@@ -22,13 +22,24 @@ export async function getServerSideProps(context) {
22
22
  : ''
23
23
 
24
24
  newrelic.setTransactionName(`Section: ${section}`)
25
- const [{ data }, user] = await Promise.all([
26
- apolloClient.query({
27
- query: GET_PAGE,
28
- variables: { channel: section, publisher: 'DEMO' },
29
- }),
30
- await fetchUser(acsCookie, ACCOUNT_QUERY_URL),
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 {