@newskit-render/core 0.0.0-d55b7d88 → 0.0.0-d95e48a4a
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 +456 -0
- package/__tests__/pages/__snapshots__/home.test.tsx.snap +1 -4
- package/components/article/__tests__/__snapshots__/index.test.tsx.snap +1 -4
- package/cypress/e2e/account/newsletters-page.cy.js +25 -3
- package/cypress/e2e/account/personal-details.cy.js +57 -39
- package/cypress/e2e/account/subscription-and-billing.cy.js +6 -5
- package/cypress/support/blaizeJwtValues.js +3 -0
- package/cypress/support/commands.js +8 -3
- package/cypress/support/users.js +7 -7
- package/helpers/getProviderPropsUtil.ts +17 -0
- package/package.json +10 -10
- package/pages/account/add/[field].tsx +11 -2
- package/pages/account/cancellation/index.tsx +5 -4
- package/pages/account/delete/confirm/index.tsx +3 -5
- package/pages/account/delete/error/index.tsx +3 -5
- package/pages/account/delete/index.tsx +3 -5
- package/pages/account/delete/success/index.tsx +3 -5
- package/pages/account/dream-team/index.tsx +5 -4
- package/pages/account/edit/[field].tsx +4 -4
- package/pages/account/family/index.tsx +9 -5
- package/pages/account/holiday-stop/index.tsx +5 -4
- package/pages/account/holiday-stop/previous-holiday-stops.tsx +3 -2
- package/pages/account/holiday-stop/upcoming-holiday-stops.tsx +3 -2
- package/pages/account/index.tsx +5 -6
- package/pages/account/newsletters/index.tsx +5 -4
- package/pages/account/newsletters-and-alerts/index.tsx +5 -7
- package/pages/account/payment/[paymentMethod].tsx +4 -4
- package/pages/account/payment/index.tsx +5 -4
- package/pages/account/payment-methods/index.tsx +5 -4
- package/pages/account/subscription-and-billing/index.tsx +5 -7
- package/pages/account/user-hub/index.tsx +20 -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="
|
|
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="
|
|
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,8 +134,8 @@ 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('************
|
|
138
|
-
cy.contains('expiry date
|
|
137
|
+
cy.contains('************4242')
|
|
138
|
+
cy.contains('expiry date 02/27')
|
|
139
139
|
})
|
|
140
140
|
|
|
141
141
|
it('Should display Invoice history section', () => {
|
|
@@ -213,7 +213,7 @@ describe('Subscription and billing details for Print user', () => {
|
|
|
213
213
|
it('Should display Your deliveries section', () => {
|
|
214
214
|
cy.contains('[data-testid="ContentListIntroduction"]', 'Your deliveries')
|
|
215
215
|
cy.contains('Address')
|
|
216
|
-
cy.contains('Buckingham Palace, London, SW1A
|
|
216
|
+
cy.contains('Buckingham Palace, London, SW1A')
|
|
217
217
|
cy.contains('Delivery instructions')
|
|
218
218
|
cy.contains('On my doorstep')
|
|
219
219
|
cy.contains('Holiday Stops')
|
|
@@ -254,7 +254,7 @@ describe('Subscription and billing details for Print user', () => {
|
|
|
254
254
|
'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
255
|
)
|
|
256
256
|
cy.contains('Voucher booklet start date')
|
|
257
|
-
cy.contains('
|
|
257
|
+
cy.contains('20/09/2022')
|
|
258
258
|
cy.contains(
|
|
259
259
|
'Your contact address will be used for any of your deliveries. This can be managed via Personal details'
|
|
260
260
|
)
|
|
@@ -307,7 +307,8 @@ describe('Subscription and billing details for Paypal user', () => {
|
|
|
307
307
|
cy.get('a[href="/account/payment"]').should('be.visible').click()
|
|
308
308
|
cy.contains(
|
|
309
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.'
|
|
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
|
+
{ timeout: 15000 }
|
|
311
312
|
)
|
|
312
313
|
})
|
|
313
314
|
})
|
|
@@ -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
|
|
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.
|
|
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.
|
|
74
|
+
gotoUrl: 'https://login.staging-thetimes.com/',
|
|
70
75
|
sso: false,
|
|
71
76
|
authCredentials: {
|
|
72
77
|
username,
|
package/cypress/support/users.js
CHANGED
|
@@ -22,37 +22,37 @@ export const userMap = {
|
|
|
22
22
|
},
|
|
23
23
|
tnl: {
|
|
24
24
|
username: 'cmp1aug2022printstag@yopmail.com', //Print user
|
|
25
|
-
password: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
45
|
+
password: 'Password123Testing123$',
|
|
46
46
|
},
|
|
47
47
|
digiprint: {
|
|
48
48
|
//dtc=true
|
|
49
49
|
username: 'digi-print.dtc.test@yopmail.com',
|
|
50
|
-
password: '
|
|
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: '
|
|
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-
|
|
3
|
+
"version": "0.0.0-d95e48a4a",
|
|
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.
|
|
46
|
-
"@newskit-render/auth": "^1.8.
|
|
47
|
-
"@newskit-render/checkout": "^3.
|
|
48
|
-
"@newskit-render/feature-flags": "^1.
|
|
49
|
-
"@newskit-render/feed": "^1.8.
|
|
50
|
-
"@newskit-render/my-account": "^7.
|
|
51
|
-
"@newskit-render/shared-components": "^4.
|
|
52
|
-
"@newskit-render/standalone-components": "^3.
|
|
53
|
-
"@newskit-render/validation": "^1.
|
|
45
|
+
"@newskit-render/api": "^1.14.0",
|
|
46
|
+
"@newskit-render/auth": "^1.8.1",
|
|
47
|
+
"@newskit-render/checkout": "^3.10.19",
|
|
48
|
+
"@newskit-render/feature-flags": "^1.10.0",
|
|
49
|
+
"@newskit-render/feed": "^1.8.13",
|
|
50
|
+
"@newskit-render/my-account": "^7.80.0",
|
|
51
|
+
"@newskit-render/shared-components": "^4.34.0",
|
|
52
|
+
"@newskit-render/standalone-components": "^3.23.2",
|
|
53
|
+
"@newskit-render/validation": "^1.18.0",
|
|
54
54
|
"cross-fetch": "3.1.5",
|
|
55
55
|
"graphql": "16.6.0",
|
|
56
56
|
"lodash.get": "4.4.2",
|
|
@@ -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
|
-
|
|
32
|
-
|
|
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
|
|
2
|
+
import { Cancellation } from '@newskit-render/my-account'
|
|
3
3
|
import { replaceConsoleAndSetTransactionName } from '../../../helpers/logger'
|
|
4
|
-
import {
|
|
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
|
|
17
|
+
const featureFlags = await getAllFeatureFlags()
|
|
17
18
|
/* end cra-effected */
|
|
18
|
-
return
|
|
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
|
|
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
|
|
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
|
|
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
|
|
13
|
+
return getProviderPropsUtil({ ...context })
|
|
16
14
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { DreamTeam
|
|
2
|
+
import { DreamTeam } from '@newskit-render/my-account'
|
|
3
3
|
import { replaceConsoleAndSetTransactionName } from '../../../helpers/logger'
|
|
4
|
-
import {
|
|
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
|
|
14
|
+
const featureFlags = await getAllFeatureFlags()
|
|
14
15
|
/* end cra-effected */
|
|
15
|
-
return
|
|
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 {
|
|
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
|
|
38
|
+
const featureFlags = await getAllFeatureFlags()
|
|
39
39
|
/* end cra-effected */
|
|
40
40
|
|
|
41
|
-
return
|
|
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
|
|
2
|
+
import { Family } from '@newskit-render/my-account'
|
|
3
3
|
import { replaceConsoleAndSetTransactionName } from '../../../helpers/logger'
|
|
4
|
-
import {
|
|
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,13 @@ export default AccountFamily
|
|
|
10
11
|
export const getServerSideProps = async (context) => {
|
|
11
12
|
replaceConsoleAndSetTransactionName('Account: Family')
|
|
12
13
|
/* start cra-effected */
|
|
13
|
-
const featureFlags = await
|
|
14
|
+
const featureFlags = await getAllFeatureFlags()
|
|
14
15
|
/* end cra-effected */
|
|
15
|
-
return
|
|
16
|
-
{
|
|
16
|
+
return getProviderPropsUtil(
|
|
17
|
+
{
|
|
18
|
+
...context,
|
|
19
|
+
provider: 'GroupAccounts',
|
|
20
|
+
},
|
|
17
21
|
{ featureFlags } /* cra-effected */
|
|
18
22
|
)
|
|
19
23
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import {
|
|
2
|
+
import { HolidayStop } from '@newskit-render/my-account'
|
|
3
3
|
import { replaceConsoleAndSetTransactionName } from '../../../helpers/logger'
|
|
4
|
-
import {
|
|
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
|
|
14
|
+
const featureFlags = await getAllFeatureFlags()
|
|
14
15
|
/* end cra-effected */
|
|
15
|
-
return
|
|
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 {
|
|
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
|
|
19
|
+
return getProviderPropsUtil({ ...context, provider: 'HolidayStop' })
|
|
19
20
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import {
|
|
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
|
|
19
|
+
return getProviderPropsUtil({ ...context, provider: 'HolidayStop' })
|
|
19
20
|
}
|
package/pages/account/index.tsx
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { PersonalDetails
|
|
3
|
-
import {
|
|
2
|
+
import { PersonalDetails } from '@newskit-render/my-account'
|
|
3
|
+
import { getAllFeatureFlags } from '@newskit-render/feature-flags' /* cra-effected */
|
|
4
4
|
import { AccountDropdown } from '../../components/AccountDropdown' /* cra-disabled */
|
|
5
5
|
import { replaceConsoleAndSetTransactionName } from '../../helpers/logger'
|
|
6
|
-
import {
|
|
6
|
+
import { getProviderPropsUtil } from '../../helpers/getProviderPropsUtil'
|
|
7
7
|
|
|
8
8
|
const AccountPersonalDetails = (props) => {
|
|
9
9
|
return (
|
|
@@ -23,10 +23,9 @@ export default AccountPersonalDetails
|
|
|
23
23
|
export const getServerSideProps = async (context) => {
|
|
24
24
|
replaceConsoleAndSetTransactionName('Account: Personal details')
|
|
25
25
|
|
|
26
|
-
const featureFlags = await
|
|
27
|
-
await closeFlagsInstance()
|
|
26
|
+
const featureFlags = await getAllFeatureFlags()
|
|
28
27
|
|
|
29
|
-
return
|
|
28
|
+
return getProviderPropsUtil(
|
|
30
29
|
{ ...context, provider: 'PersonalDetails' },
|
|
31
30
|
{ featureFlags } /* cra-effected */
|
|
32
31
|
)
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { Newsletters
|
|
2
|
+
import { Newsletters } from '@newskit-render/my-account'
|
|
3
3
|
import { replaceConsoleAndSetTransactionName } from '../../../helpers/logger'
|
|
4
|
-
import {
|
|
4
|
+
import { getAllFeatureFlags } from '@newskit-render/feature-flags' /* cra-effected */
|
|
5
|
+
import { getProviderPropsUtil } from '../../../helpers/getProviderPropsUtil'
|
|
5
6
|
|
|
6
7
|
const AccountNewsletters = (props) => <Newsletters {...props} />
|
|
7
8
|
|
|
@@ -10,9 +11,9 @@ export default AccountNewsletters
|
|
|
10
11
|
export const getServerSideProps = async (context) => {
|
|
11
12
|
replaceConsoleAndSetTransactionName('Account: Newsletters')
|
|
12
13
|
/* start cra-effected */
|
|
13
|
-
const featureFlags = await
|
|
14
|
+
const featureFlags = await getAllFeatureFlags()
|
|
14
15
|
/* end cra-effected */
|
|
15
|
-
return
|
|
16
|
+
return getProviderPropsUtil(
|
|
16
17
|
{ ...context, provider: 'Newsletters' },
|
|
17
18
|
{ featureFlags } /* cra-effected */
|
|
18
19
|
)
|