@newskit-render/core 0.0.0-d55b7d88 → 0.0.0-d5e6fac23

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 (32) hide show
  1. package/CHANGELOG.md +496 -0
  2. package/__tests__/pages/__snapshots__/home.test.tsx.snap +1 -4
  3. package/components/article/__tests__/__snapshots__/index.test.tsx.snap +1 -4
  4. package/cypress/e2e/account/newsletters-page.cy.js +21 -2
  5. package/cypress/e2e/account/personal-details.cy.js +57 -39
  6. package/cypress/e2e/account/subscription-and-billing.cy.js +10 -14
  7. package/cypress/support/blaizeJwtValues.js +3 -0
  8. package/cypress/support/commands.js +8 -3
  9. package/cypress/support/users.js +7 -7
  10. package/helpers/getProviderPropsUtil.ts +17 -0
  11. package/package.json +11 -11
  12. package/pages/account/add/[field].tsx +11 -2
  13. package/pages/account/cancellation/index.tsx +5 -4
  14. package/pages/account/delete/confirm/index.tsx +3 -5
  15. package/pages/account/delete/error/index.tsx +3 -5
  16. package/pages/account/delete/index.tsx +3 -5
  17. package/pages/account/delete/success/index.tsx +3 -5
  18. package/pages/account/dream-team/index.tsx +5 -4
  19. package/pages/account/edit/[field].tsx +4 -4
  20. package/pages/account/family/index.tsx +13 -5
  21. package/pages/account/holiday-stop/index.tsx +5 -4
  22. package/pages/account/holiday-stop/previous-holiday-stops.tsx +3 -2
  23. package/pages/account/holiday-stop/upcoming-holiday-stops.tsx +3 -2
  24. package/pages/account/index.tsx +5 -6
  25. package/pages/account/newsletters/index.tsx +5 -4
  26. package/pages/account/newsletters-and-alerts/index.tsx +5 -7
  27. package/pages/account/payment/[paymentMethod].tsx +4 -4
  28. package/pages/account/payment/index.tsx +5 -4
  29. package/pages/account/payment-methods/index.tsx +5 -4
  30. package/pages/account/subscription-and-billing/index.tsx +5 -7
  31. package/pages/account/user-hub/index.tsx +20 -0
  32. package/temp/_document.tsx +1 -0
@@ -317,44 +317,7 @@ describe('Personal detail edit pages', () => {
317
317
  expect(loc.pathname).to.eq('/account')
318
318
  })
319
319
  })
320
- it('Should change user email', () => {
321
- const currentEmail = 'cmp-digi-card-20-09-22@yopmail.com'
322
- const notRegistredEmail = 'not-registered-email@yopmail.com'
323
-
324
- cy.get('a[href="/account/edit/email"]').should('be.visible').click()
325
-
326
- cy.get('[name="email"]').clear()
327
- cy.get('[name="email"]').type(notRegistredEmail)
328
- cy.get('[data-testid="primary-button"]').click()
329
-
330
- cy.contains('[data-testid="toast-container"]', 'Updating your email...')
331
-
332
- // Redirects to Personal details page
333
- cy.location().should((loc) => {
334
- expect(loc.pathname).to.eq('/account')
335
- })
336
- cy.contains(notRegistredEmail).should('have.length', 1)
337
- cy.contains(
338
- '[data-testid="toast-container"]',
339
- 'Your email address was successfully updated'
340
- )
341
-
342
- // Back to edit email page
343
320
 
344
- cy.get('a[href="/account/edit/email"]')
345
- .should('be.visible')
346
- .click({ force: true })
347
-
348
- // Check the message for verification link
349
- cy.contains(
350
- `Email sent to ${notRegistredEmail} with a verification link. If you haven't received it yet, check again later or contact customer services on xxxx-xxx-xxxx`
351
- )
352
-
353
- // Change email back to the previous email
354
- cy.get('[name="email"]').clear()
355
- cy.get('[name="email"]').type(currentEmail)
356
- cy.get('[data-testid="primary-button"]').click()
357
- })
358
321
  it('Should NOT change user email if input value is already registered mail', () => {
359
322
  const alreadyRegistredEmail = 'cmp-digi-direct-20-09-22@yopmail.com'
360
323
 
@@ -370,6 +333,7 @@ describe('Personal detail edit pages', () => {
370
333
  'This email address is already in use. Try a different one or contact customer support at 1234-1234'
371
334
  )
372
335
  })
336
+
373
337
  it('Should show input validation error messages when user tries to add invalid email', () => {
374
338
  cy.get('a[href="/account/edit/email"]').should('be.visible').click()
375
339
 
@@ -391,6 +355,7 @@ describe('Personal detail edit pages', () => {
391
355
  'Updating your email...'
392
356
  ).should('not.exist')
393
357
  })
358
+
394
359
  it('Should show error toast when updating email if internal server error occures', () => {
395
360
  cy.intercept('POST', '/api/account/mutate', { statusCode: 500 })
396
361
 
@@ -406,6 +371,45 @@ describe('Personal detail edit pages', () => {
406
371
  "Sorry, we're unable to save your email right now. Please try again or come back later."
407
372
  )
408
373
  })
374
+
375
+ it('Should change user email', () => {
376
+ const currentEmail = 'cmp-digi-card-20-09-22@yopmail.com'
377
+ const notRegistredEmail = 'not-registered-email@yopmail.com'
378
+
379
+ cy.get('a[href="/account/edit/email"]').should('be.visible').click()
380
+
381
+ cy.get('[name="email"]').clear()
382
+ cy.get('[name="email"]').type(notRegistredEmail)
383
+ cy.get('[data-testid="primary-button"]').click()
384
+
385
+ cy.contains('[data-testid="toast-container"]', 'Updating your email...')
386
+
387
+ // Redirects to Personal details page
388
+ cy.location().should((loc) => {
389
+ expect(loc.pathname).to.eq('/account')
390
+ })
391
+ cy.contains(notRegistredEmail).should('have.length', 1)
392
+ cy.contains(
393
+ '[data-testid="toast-container"]',
394
+ 'Your email address was successfully updated'
395
+ )
396
+
397
+ // Back to edit email page
398
+
399
+ cy.get('a[href="/account/edit/email"]')
400
+ .should('be.visible')
401
+ .click({ force: true })
402
+
403
+ // Check the message for verification link
404
+ cy.contains(
405
+ `Email sent to ${notRegistredEmail} with a verification link. If you haven't received it yet, check again later or contact customer services on xxxx-xxx-xxxx`
406
+ )
407
+
408
+ // Change email back to the previous email
409
+ cy.get('[name="email"]').clear()
410
+ cy.get('[name="email"]').type(currentEmail)
411
+ cy.get('[data-testid="primary-button"]').click()
412
+ })
409
413
  })
410
414
 
411
415
  describe('Edit password', () => {
@@ -864,7 +868,9 @@ describe('Personal detail edit pages', () => {
864
868
  cy.get('[data-testid="select-country"]').click()
865
869
  cy.get('[data-testid="United Kingdom"]').should('be.visible')
866
870
 
867
- cy.get('[data-testid="United States of America"]').click()
871
+ cy.get('[data-testid="select-panel"]').within(() => {
872
+ cy.get('[data-testid="United States of America"]').click()
873
+ })
868
874
 
869
875
  cy.contains('Save').click()
870
876
 
@@ -977,7 +983,9 @@ describe('Personal detail edit pages', () => {
977
983
  cy.get('[data-testid="select-country"]').click()
978
984
  cy.get('[data-testid="United Kingdom"]').should('be.visible')
979
985
 
980
- cy.get('[data-testid="United States of America"]').click()
986
+ cy.get('[data-testid="select-panel"]').within(() => {
987
+ cy.get('[data-testid="United States of America"]').click()
988
+ })
981
989
 
982
990
  cy.contains('Save').click()
983
991
 
@@ -1018,6 +1026,12 @@ describe('Personal detail edit pages', () => {
1018
1026
  cy.get('input[name="county"]').type('North Yorkshire')
1019
1027
  cy.get('input[name="postcode"]').clear()
1020
1028
  cy.get('input[name="postcode"]').type('YO1 6DJ')
1029
+ cy.get('[data-testid="select-country"]').click()
1030
+ cy.get('[data-testid="United Kingdom"]').should('be.visible')
1031
+
1032
+ cy.get('[data-testid="select-panel"]').within(() => {
1033
+ cy.get('[data-testid="United Kingdom"]').click()
1034
+ })
1021
1035
 
1022
1036
  cy.contains('Save').click()
1023
1037
 
@@ -1055,6 +1069,10 @@ describe('Personal detail edit pages', () => {
1055
1069
  cy.get('input[name="city"]').type('London')
1056
1070
  cy.get('input[name="postcode"]').clear()
1057
1071
  cy.get('input[name="postcode"]').type('SE1')
1072
+ cy.get('[data-testid="select-country"]').click()
1073
+ cy.get('[data-testid="select-panel"]').within(() => {
1074
+ cy.get('[data-testid="United Kingdom"]').click()
1075
+ })
1058
1076
 
1059
1077
  cy.contains('Save').click()
1060
1078
 
@@ -134,11 +134,12 @@ describe('Subscription and billing details for Digital user', () => {
134
134
  cy.contains('[data-testid="ContentListIntroduction"]', 'Billing details')
135
135
  cy.contains('Payment method')
136
136
  cy.get('[data-testid="visa-icon"]').should('exist')
137
- cy.contains('************1111')
138
- cy.contains('expiry date 03/30')
137
+ cy.contains('************4242')
138
+ cy.contains('expiry date 02/27')
139
139
  })
140
140
 
141
- it('Should display Invoice history section', () => {
141
+ // Skipped due to graphql changes. To be fixed with TMR-1959
142
+ it.skip('Should display Invoice history section', () => {
142
143
  cy.contains('[data-testid="ContentListIntroduction"]', 'Invoice history')
143
144
  cy.contains('Digital pack')
144
145
  cy.contains('20 Sept 2022')
@@ -213,7 +214,7 @@ describe('Subscription and billing details for Print user', () => {
213
214
  it('Should display Your deliveries section', () => {
214
215
  cy.contains('[data-testid="ContentListIntroduction"]', 'Your deliveries')
215
216
  cy.contains('Address')
216
- cy.contains('Buckingham Palace, London, SW1A 1AA')
217
+ cy.contains('Buckingham Palace, London, SW1A')
217
218
  cy.contains('Delivery instructions')
218
219
  cy.contains('On my doorstep')
219
220
  cy.contains('Holiday Stops')
@@ -226,7 +227,8 @@ describe('Subscription and billing details for Print user', () => {
226
227
  )
227
228
  })
228
229
 
229
- it('Should display Invoice history section', () => {
230
+ // Skipped due to graphql changes. To be fixed with TMR-1959
231
+ it.skip('Should display Invoice history section', () => {
230
232
  cy.contains('[data-testid="ContentListIntroduction"]', 'Invoice history')
231
233
  cy.contains('Print pack')
232
234
  cy.contains('24 Apr 2023')
@@ -254,7 +256,7 @@ describe('Subscription and billing details for Print user', () => {
254
256
  'If your voucher booklet hasn’t arrived within three days of your booklet start date, or you have any issues regarding your vouchers, please contact us.'
255
257
  )
256
258
  cy.contains('Voucher booklet start date')
257
- cy.contains('16/06/24')
259
+ cy.contains('20/09/2022')
258
260
  cy.contains(
259
261
  'Your contact address will be used for any of your deliveries. This can be managed via Personal details'
260
262
  )
@@ -278,6 +280,8 @@ describe('Subscription and billing details for Digi-Print user', () => {
278
280
  //...rest is same as Print user
279
281
  })
280
282
 
283
+ // This test is going to fail on 13.11.2024 due to graphql changes.
284
+ // To be fixed with TMR-1959
281
285
  it('Should display Invoice history section', () => {
282
286
  cy.contains('[data-testid="ContentListIntroduction"]', 'Invoice history')
283
287
  cy.contains('Digi-Print pack')
@@ -302,14 +306,6 @@ describe('Subscription and billing details for Paypal user', () => {
302
306
  cy.get('[data-testid="paypal-icon"]').should('exist')
303
307
  cy.contains('cmp.paypal.user.verified.test@news.co.uk')
304
308
  })
305
-
306
- it('Should show inline banner for Paypal subscription', () => {
307
- cy.get('a[href="/account/payment"]').should('be.visible').click()
308
- cy.contains(
309
- '[data-testid="Zuora-inline"]',
310
- 'To update your Paypal credentials, please speak to one of our advisors on xxxx-xxx-xxxx or add a new payment method via credit/debit card using the form below.'
311
- )
312
- })
313
309
  })
314
310
 
315
311
  describe('Subscription and billing edit pages', () => {
@@ -0,0 +1,3 @@
1
+ export const subscription_blaize_jwt = 'eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ7XCJjcG5cIjpcIkFBQUEwMjU1OTcwNDVcIixcInByb2R1Y3RzXCI6W1wiVGhlIFRpbWVzIFNpdGUgUHJvZHVjdFwiLFwiVGltZXMgU3BvcnRzIEFwcFwiLFwiVGhlIFRpbWVzIEVQTCBWaWRlbyBQcm9kdWN0XCIsXCJUaGUgU3VuZGF5IFRpbWVzIGlQaG9uZSBhcHAgcHJvZHVjdFwiLFwiRW1haWwgQnVsbGV0aW5zIFByb2R1Y3RcIixcIlRoZSBTdW5kYXkgVGltZXMgTW9iaSBQcm9kdWN0XCIsXCJUaGUgU3VuZGF5IFRpbWVzIGlQYWQgYXBwIHByb2R1Y3RcIixcImUtcGFwZXIgUHJvZHVjdFwiLFwiRGFpbHkgQ3Jvc3N3b3JkIFByb2R1Y3RcIixcIlRoZSBTdW5kYXkgVGltZXMgU2l0ZSBQcm9kdWN0XCIsXCJUaGUgVGltZXMgTW9iaSBQcm9kdWN0XCIsXCJUaGUgVGltZXMgaVBhZCBhcHAgUHJvZHVjdFwiLFwiRGlnaXRhbCBTdWJzY3JpcHRpb24gUHJvZHVjdFwiLFwiVGhlIFRpbWVzIGlQaG9uZSBhcHAgcHJvZHVjdFwiLFwiVGltZXMrIG1lbWJlcnNoaXAgYmVuZWZpdHMgUHJvZHVjdFwiXX0iLCJodHRwczpcL1wvdGhldGltZXMuY28udWtcL2NwbiI6IkFBQUEwMjU1OTcwNDUiLCJodHRwczpcL1wvdGhldGltZXMuY28udWtcL3N1YnNjcmlwdGlvbiI6IlNVQi0wMDEwOTcyNjQ0IiwiaXNzIjoiLnRoZXRpbWVzLmNvbSIsImh0dHBzOlwvXC90aGV0aW1lcy5jby51a1wvcHJvZHVjdHMiOlsiVGhlIFRpbWVzIFNpdGUgUHJvZHVjdCIsIlRpbWVzIFNwb3J0cyBBcHAiLCJUaGUgVGltZXMgRVBMIFZpZGVvIFByb2R1Y3QiLCJUaGUgU3VuZGF5IFRpbWVzIGlQaG9uZSBhcHAgcHJvZHVjdCIsIkVtYWlsIEJ1bGxldGlucyBQcm9kdWN0IiwiVGhlIFN1bmRheSBUaW1lcyBNb2JpIFByb2R1Y3QiLCJUaGUgU3VuZGF5IFRpbWVzIGlQYWQgYXBwIHByb2R1Y3QiLCJlLXBhcGVyIFByb2R1Y3QiLCJEYWlseSBDcm9zc3dvcmQgUHJvZHVjdCIsIlRoZSBTdW5kYXkgVGltZXMgU2l0ZSBQcm9kdWN0IiwiVGhlIFRpbWVzIE1vYmkgUHJvZHVjdCIsIlRoZSBUaW1lcyBpUGFkIGFwcCBQcm9kdWN0IiwiRGlnaXRhbCBTdWJzY3JpcHRpb24gUHJvZHVjdCIsIlRoZSBUaW1lcyBpUGhvbmUgYXBwIHByb2R1Y3QiLCJUaW1lcysgbWVtYmVyc2hpcCBiZW5lZml0cyBQcm9kdWN0Il0sImV4cCI6MTcxNjk4ODc3OSwiaWF0IjoxNzE2MzgzOTc5fQ.JTqe7UJo985At-2JkuMrH-6H__qzwZwBGRnEJXl4CSM'
2
+
3
+ export const registration_blaize_jwt = 'eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ7XCJjcG5cIjpcIkNQTi1YNlpOWFBRUlFcIixcInByb2R1Y3RzXCI6W119IiwiaHR0cHM6XC9cL3RoZXRpbWVzLmNvLnVrXC9jcG4iOiJDUE4tWDZaTlhQUVJRIiwiaHR0cHM6XC9cL3RoZXRpbWVzLmNvLnVrXC9zdWJzY3JpcHRpb24iOiJFR0FDQy1DUzAwMDAxMzQ0NjI4IiwiaXNzIjoiLnRoZXRpbWVzLmNvLnVrIiwiaHR0cHM6XC9cL3RoZXRpbWVzLmNvLnVrXC9wcm9kdWN0cyI6W10sImV4cCI6MTcyNTQ1NDgwNCwiaWF0IjoxNzI0ODUwMDA0fQ.XGTv2XooQ8VELZsc7bl35D0A9FlOvEWpexNlYpCCK1Q'
@@ -1,4 +1,4 @@
1
- //Note: Check periodically if these consent cookie values exprire
1
+ //Note: Check periodically if these consent cookie values expire
2
2
  import _ from 'lodash'
3
3
  import {
4
4
  consentUUIDValue,
@@ -31,6 +31,11 @@ Cypress.Commands.add('mockConsent', () => {
31
31
  setConsentLocalStorage()
32
32
  })
33
33
 
34
+ Cypress.Commands.add('mockBlaizeJwtAndVisit', (jwtValue, url) => {
35
+ cy.setCookie('blaize_jwt', jwtValue)
36
+ cy.visit(url)
37
+ })
38
+
34
39
  Cypress.Commands.add('GetAcsSession', (user = 'default') => {
35
40
  const { username, password } = userMap[user]
36
41
 
@@ -60,13 +65,13 @@ Cypress.Commands.add('GetTnlAcsSession', (user = 'tnl') => {
60
65
 
61
66
  cy.request({
62
67
  method: 'POST',
63
- url: 'https://login.staging-thetimes.co.uk/services/session',
68
+ url: 'https://login.staging-thetimes.com/services/session',
64
69
  headers: {
65
70
  'Content-Type': 'application/vnd.newsuk.acs.createsession-v1+json',
66
71
  },
67
72
  body: {
68
73
  rememberMe: false,
69
- gotoUrl: 'https://login.staging-thetimes.co.uk/',
74
+ gotoUrl: 'https://login.staging-thetimes.com/',
70
75
  sso: false,
71
76
  authCredentials: {
72
77
  username,
@@ -22,37 +22,37 @@ export const userMap = {
22
22
  },
23
23
  tnl: {
24
24
  username: 'cmp1aug2022printstag@yopmail.com', //Print user
25
- password: 'Password123',
25
+ password: 'Password123Testing123$',
26
26
  },
27
27
  digitalCard: {
28
28
  //dtc=false
29
29
  username: 'cmp-digi-card-20-09-22@yopmail.com',
30
- password: 'Password123',
30
+ password: 'Password123Testing123$',
31
31
  },
32
32
  digitalDirectDebit: {
33
33
  //dtc=false
34
34
  username: 'cmp-digi-direct-20-09-22@yopmail.com',
35
- password: 'Password123',
35
+ password: 'Password123Testing123$',
36
36
  },
37
37
  print: {
38
38
  //dtc=true
39
39
  username: 'cmp-dtc-card-20-09-22@yopmail.com',
40
- password: 'Password123',
40
+ password: 'Password123Testing123$',
41
41
  },
42
42
  printVouchers: {
43
43
  //dtc=false
44
44
  username: 'cmp-test-direct-20-09-22@yopmail.com',
45
- password: 'Password123',
45
+ password: 'Password123Testing123$',
46
46
  },
47
47
  digiprint: {
48
48
  //dtc=true
49
49
  username: 'digi-print.dtc.test@yopmail.com',
50
- password: 'Password123',
50
+ password: 'Password123Testing123$',
51
51
  },
52
52
  digiprintVouchers: {
53
53
  //dtc=false
54
54
  username: 'digi-print-card-15-11-22@yopmail.com',
55
- password: 'Password123',
55
+ password: 'Password123Testing123$',
56
56
  },
57
57
  }
58
58
 
@@ -0,0 +1,17 @@
1
+ import {
2
+ getProviderProps,
3
+ getProviderPropsTimes,
4
+ } from '@newskit-render/my-account'
5
+ import { publisher } from '../config'
6
+
7
+ export const getProviderPropsUtil = (context, options?) => {
8
+ if (process.env.NODE_ENV === 'development' && publisher === 'TIMES') {
9
+ return getProviderPropsTimes(context, {
10
+ ...options,
11
+ })
12
+ }
13
+
14
+ return getProviderProps(context, {
15
+ ...options,
16
+ })
17
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@newskit-render/core",
3
- "version": "0.0.0-d55b7d88",
3
+ "version": "0.0.0-d5e6fac23",
4
4
  "description": "Newskit Render - Core package",
5
5
  "author": "",
6
6
  "license": "UNLICENSED",
@@ -42,15 +42,15 @@
42
42
  "@emotion/styled": "11.9.3",
43
43
  "@newrelic/next": "0.5.2",
44
44
  "@newrelic/winston-enricher": "4.0.1",
45
- "@newskit-render/api": "^1.12.1",
46
- "@newskit-render/auth": "^1.8.0",
47
- "@newskit-render/checkout": "^3.9.34-alpha.0",
48
- "@newskit-render/feature-flags": "^1.8.1-alpha.1",
49
- "@newskit-render/feed": "^1.8.9",
50
- "@newskit-render/my-account": "^7.54.0-alpha.1",
51
- "@newskit-render/shared-components": "^4.28.0-alpha.0",
52
- "@newskit-render/standalone-components": "^3.20.27-alpha.0",
53
- "@newskit-render/validation": "^1.17.0",
45
+ "@newskit-render/api": "^1.14.1",
46
+ "@newskit-render/auth": "^1.8.2",
47
+ "@newskit-render/checkout": "^3.10.21",
48
+ "@newskit-render/feature-flags": "^1.11.1",
49
+ "@newskit-render/feed": "^1.8.14",
50
+ "@newskit-render/my-account": "^7.83.0-alpha.0",
51
+ "@newskit-render/shared-components": "^4.35.1",
52
+ "@newskit-render/standalone-components": "^3.23.4",
53
+ "@newskit-render/validation": "^1.18.1",
54
54
  "cross-fetch": "3.1.5",
55
55
  "graphql": "16.6.0",
56
56
  "lodash.get": "4.4.2",
@@ -104,7 +104,7 @@
104
104
  "prettier": "2.8.3",
105
105
  "prettier-eslint": "15.0.1",
106
106
  "prettier-eslint-cli": "7.1.0",
107
- "typescript": "4.9.4",
107
+ "typescript": "5.6.3",
108
108
  "wait-on": "7.0.1"
109
109
  },
110
110
  "precommit": [
@@ -3,6 +3,8 @@ import { replaceConsoleAndSetTransactionName } from '../../../helpers/logger'
3
3
  import { AddField, addComponentMap } from '@newskit-render/my-account'
4
4
  import validation from '../../../validation'
5
5
  import { DynamicPage } from '@newskit-render/my-account'
6
+ import { getAllFeatureFlags } from '@newskit-render/feature-flags' /* cra-effected */
7
+ import { getProviderPropsUtil } from '../../../helpers/getProviderPropsUtil'
6
8
 
7
9
  const AccountAddField = (props) => (
8
10
  <DynamicPage
@@ -28,7 +30,14 @@ export const getServerSideProps = async (context) => {
28
30
  console.error(`An error ${context.res.statusCode} occurred on server`)
29
31
  }
30
32
 
31
- return {
32
- props: { data: { type: field } },
33
+ const featureFlags = await getAllFeatureFlags()
34
+ const providerProps = (await getProviderPropsUtil(
35
+ { ...context, provider: 'AddField' },
36
+ { featureFlags } /* cra-effected */
37
+ )) as unknown as { props: { data: { type: string } } }
38
+
39
+ if (providerProps?.props) {
40
+ providerProps.props = { ...providerProps.props, data: { type: field } }
33
41
  }
42
+ return providerProps
34
43
  }
@@ -1,8 +1,9 @@
1
1
  import React from 'react'
2
- import { Cancellation, getProviderProps } from '@newskit-render/my-account'
2
+ import { Cancellation } from '@newskit-render/my-account'
3
3
  import { replaceConsoleAndSetTransactionName } from '../../../helpers/logger'
4
- import { getFlagsAll } from '@newskit-render/feature-flags' /* cra-effected */
4
+ import { getAllFeatureFlags } from '@newskit-render/feature-flags' /* cra-effected */
5
5
  import validation from '../../../validation'
6
+ import { getProviderPropsUtil } from '../../../helpers/getProviderPropsUtil'
6
7
 
7
8
  const AccountCancellation = (props) => (
8
9
  <Cancellation {...props} validation={validation} />
@@ -13,9 +14,9 @@ export default AccountCancellation
13
14
  export const getServerSideProps = async (context) => {
14
15
  replaceConsoleAndSetTransactionName('Account: Cancellation')
15
16
  /* start cra-effected */
16
- const featureFlags = await getFlagsAll()
17
+ const featureFlags = await getAllFeatureFlags()
17
18
  /* end cra-effected */
18
- return getProviderProps(
19
+ return getProviderPropsUtil(
19
20
  { ...context, provider: 'Cancellation' },
20
21
  { featureFlags } /* cra-effected */
21
22
  )
@@ -1,9 +1,7 @@
1
1
  import React from 'react'
2
- import {
3
- ConfirmAccountDeletion,
4
- getProviderProps,
5
- } from '@newskit-render/my-account'
2
+ import { ConfirmAccountDeletion } from '@newskit-render/my-account'
6
3
  import { replaceConsoleAndSetTransactionName } from '../../../../helpers/logger'
4
+ import { getProviderPropsUtil } from '../../../../helpers/getProviderPropsUtil'
7
5
 
8
6
  const ConfirmDeletion = (props) => <ConfirmAccountDeletion {...props} />
9
7
 
@@ -12,5 +10,5 @@ export default ConfirmDeletion
12
10
  export const getServerSideProps = async (context) => {
13
11
  replaceConsoleAndSetTransactionName('Account: Deletion - Confirmation')
14
12
 
15
- return getProviderProps({ ...context })
13
+ return getProviderPropsUtil({ ...context })
16
14
  }
@@ -1,9 +1,7 @@
1
1
  import React from 'react'
2
- import {
3
- AccountDeletionError,
4
- getProviderProps,
5
- } from '@newskit-render/my-account'
2
+ import { AccountDeletionError } from '@newskit-render/my-account'
6
3
  import { replaceConsoleAndSetTransactionName } from '../../../../helpers/logger'
4
+ import { getProviderPropsUtil } from '../../../../helpers/getProviderPropsUtil'
7
5
 
8
6
  const Error = (props) => <AccountDeletionError {...props} />
9
7
 
@@ -12,5 +10,5 @@ export default Error
12
10
  export const getServerSideProps = async (context) => {
13
11
  replaceConsoleAndSetTransactionName('Account: Deletion - Error')
14
12
 
15
- return getProviderProps({ ...context })
13
+ return getProviderPropsUtil({ ...context })
16
14
  }
@@ -1,9 +1,7 @@
1
1
  import React from 'react'
2
- import {
3
- InitiateAccountDeletion,
4
- getProviderProps,
5
- } from '@newskit-render/my-account'
2
+ import { InitiateAccountDeletion } from '@newskit-render/my-account'
6
3
  import { replaceConsoleAndSetTransactionName } from '../../../helpers/logger'
4
+ import { getProviderPropsUtil } from '../../../helpers/getProviderPropsUtil'
7
5
 
8
6
  const AccountDeletion = (props) => <InitiateAccountDeletion {...props} />
9
7
 
@@ -12,5 +10,5 @@ export default AccountDeletion
12
10
  export const getServerSideProps = async (context) => {
13
11
  replaceConsoleAndSetTransactionName('Account: Deletion')
14
12
 
15
- return getProviderProps({ ...context })
13
+ return getProviderPropsUtil({ ...context })
16
14
  }
@@ -1,9 +1,7 @@
1
1
  import React from 'react'
2
- import {
3
- AccountDeletionSuccess,
4
- getProviderProps,
5
- } from '@newskit-render/my-account'
2
+ import { AccountDeletionSuccess } from '@newskit-render/my-account'
6
3
  import { replaceConsoleAndSetTransactionName } from '../../../../helpers/logger'
4
+ import { getProviderPropsUtil } from '../../../../helpers/getProviderPropsUtil'
7
5
 
8
6
  const Success = (props) => <AccountDeletionSuccess {...props} />
9
7
 
@@ -12,5 +10,5 @@ export default Success
12
10
  export const getServerSideProps = async (context) => {
13
11
  replaceConsoleAndSetTransactionName('Account: Deletion - Success')
14
12
 
15
- return getProviderProps({ ...context })
13
+ return getProviderPropsUtil({ ...context })
16
14
  }
@@ -1,7 +1,8 @@
1
1
  import React from 'react'
2
- import { DreamTeam, getProviderProps } from '@newskit-render/my-account'
2
+ import { DreamTeam } from '@newskit-render/my-account'
3
3
  import { replaceConsoleAndSetTransactionName } from '../../../helpers/logger'
4
- import { getFlagsAll } from '@newskit-render/feature-flags' /* cra-effected */
4
+ import { getAllFeatureFlags } from '@newskit-render/feature-flags' /* cra-effected */
5
+ import { getProviderPropsUtil } from '../../../helpers/getProviderPropsUtil'
5
6
 
6
7
  const AccountNewslettersAndAlerts = (props) => <DreamTeam {...props} />
7
8
 
@@ -10,9 +11,9 @@ export default AccountNewslettersAndAlerts
10
11
  export const getServerSideProps = async (context) => {
11
12
  replaceConsoleAndSetTransactionName('Account: Dream Team')
12
13
  /* start cra-effected */
13
- const featureFlags = await getFlagsAll()
14
+ const featureFlags = await getAllFeatureFlags()
14
15
  /* end cra-effected */
15
- return getProviderProps(
16
+ return getProviderPropsUtil(
16
17
  { ...context, provider: 'DreamTeam' },
17
18
  { featureFlags } /* cra-effected */
18
19
  )
@@ -2,12 +2,12 @@ import React from 'react'
2
2
  import { replaceConsoleAndSetTransactionName } from '../../../helpers/logger'
3
3
  import {
4
4
  EditField,
5
- getProviderProps,
6
5
  editComponentMap,
7
6
  DynamicPage,
8
7
  } from '@newskit-render/my-account'
9
- import { getFlagsAll } from '@newskit-render/feature-flags' /* cra-effected */
8
+ import { getAllFeatureFlags } from '@newskit-render/feature-flags' /* cra-effected */
10
9
  import validation from '../../../validation'
10
+ import { getProviderPropsUtil } from '../../../helpers/getProviderPropsUtil'
11
11
 
12
12
  const AccountEditField = (props) => (
13
13
  <DynamicPage
@@ -35,10 +35,10 @@ export const getServerSideProps = async (context) => {
35
35
  console.error(`An error ${context.res.statusCode} occurred on server`)
36
36
  }
37
37
  /* start cra-effected */
38
- const featureFlags = await getFlagsAll()
38
+ const featureFlags = await getAllFeatureFlags()
39
39
  /* end cra-effected */
40
40
 
41
- return getProviderProps(
41
+ return getProviderPropsUtil(
42
42
  { ...context, provider: 'EditField' },
43
43
  { featureFlags } /* cra-effected */
44
44
  )
@@ -1,7 +1,8 @@
1
1
  import React from 'react'
2
- import { Family, getProviderProps } from '@newskit-render/my-account'
2
+ import { Family } from '@newskit-render/my-account'
3
3
  import { replaceConsoleAndSetTransactionName } from '../../../helpers/logger'
4
- import { getFlagsAll } from '@newskit-render/feature-flags' /* cra-effected */
4
+ import { getAllFeatureFlags } from '@newskit-render/feature-flags' /* cra-effected */
5
+ import { getProviderPropsUtil } from '../../../helpers/getProviderPropsUtil'
5
6
 
6
7
  const AccountFamily = (props) => <Family {...props} />
7
8
 
@@ -10,10 +11,17 @@ export default AccountFamily
10
11
  export const getServerSideProps = async (context) => {
11
12
  replaceConsoleAndSetTransactionName('Account: Family')
12
13
  /* start cra-effected */
13
- const featureFlags = await getFlagsAll()
14
+ const featureFlags = await getAllFeatureFlags()
15
+
16
+ const provider = featureFlags?.enable_invite_family_v2_query
17
+ ? 'GroupAccountsV2'
18
+ : 'GroupAccounts'
14
19
  /* end cra-effected */
15
- return getProviderProps(
16
- { ...context, provider: 'GroupAccounts' },
20
+ return getProviderPropsUtil(
21
+ {
22
+ ...context,
23
+ provider,
24
+ },
17
25
  { featureFlags } /* cra-effected */
18
26
  )
19
27
  }
@@ -1,7 +1,8 @@
1
1
  import React from 'react'
2
- import { getProviderProps, HolidayStop } from '@newskit-render/my-account'
2
+ import { HolidayStop } from '@newskit-render/my-account'
3
3
  import { replaceConsoleAndSetTransactionName } from '../../../helpers/logger'
4
- import { getFlagsAll } from '@newskit-render/feature-flags' /* cra-effected */
4
+ import { getAllFeatureFlags } from '@newskit-render/feature-flags' /* cra-effected */
5
+ import { getProviderPropsUtil } from '../../../helpers/getProviderPropsUtil'
5
6
 
6
7
  const AccountHolidayStop = (props) => <HolidayStop {...props} />
7
8
 
@@ -10,9 +11,9 @@ export default AccountHolidayStop
10
11
  export const getServerSideProps = async (context) => {
11
12
  replaceConsoleAndSetTransactionName('Account: Book a Holiday Stop')
12
13
  /* start cra-effected */
13
- const featureFlags = await getFlagsAll()
14
+ const featureFlags = await getAllFeatureFlags()
14
15
  /* end cra-effected */
15
- return getProviderProps(
16
+ return getProviderPropsUtil(
16
17
  { ...context, provider: 'HolidayStop' },
17
18
  { featureFlags } /* cra-effected */
18
19
  )
@@ -1,7 +1,8 @@
1
1
  import React from 'react'
2
- import { getProviderProps, HolidayStopList } from '@newskit-render/my-account'
2
+ import { HolidayStopList } from '@newskit-render/my-account'
3
3
  import { replaceConsoleAndSetTransactionName } from '../../../helpers/logger'
4
4
  import { holidayStopListContextOverrides } from '../../../context/app-context/holidayStopListContextOverrides'
5
+ import { getProviderPropsUtil } from '../../../helpers/getProviderPropsUtil'
5
6
 
6
7
  const AccountPreviousHolidayStops = (props) => (
7
8
  <HolidayStopList
@@ -15,5 +16,5 @@ export default AccountPreviousHolidayStops
15
16
 
16
17
  export const getServerSideProps = async (context) => {
17
18
  replaceConsoleAndSetTransactionName('Account: Previous Holiday Stops')
18
- return getProviderProps({ ...context, provider: 'HolidayStop' })
19
+ return getProviderPropsUtil({ ...context, provider: 'HolidayStop' })
19
20
  }
@@ -1,7 +1,8 @@
1
1
  import React from 'react'
2
- import { getProviderProps, HolidayStopList } from '@newskit-render/my-account'
2
+ import { HolidayStopList } from '@newskit-render/my-account'
3
3
  import { replaceConsoleAndSetTransactionName } from '../../../helpers/logger'
4
4
  import { holidayStopListContextOverrides } from '../../../context/app-context/holidayStopListContextOverrides'
5
+ import { getProviderPropsUtil } from '../../../helpers/getProviderPropsUtil'
5
6
 
6
7
  const AccountUpcomingHolidayStops = (props) => (
7
8
  <HolidayStopList
@@ -15,5 +16,5 @@ export default AccountUpcomingHolidayStops
15
16
 
16
17
  export const getServerSideProps = async (context) => {
17
18
  replaceConsoleAndSetTransactionName('Account: Upcoming Holiday Stops')
18
- return getProviderProps({ ...context, provider: 'HolidayStop' })
19
+ return getProviderPropsUtil({ ...context, provider: 'HolidayStop' })
19
20
  }