@newskit-render/core 0.0.0-caeaa514b → 0.0.0-cd7dda9a6
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 +496 -0
- package/Dockerfile.withNewRelic +1 -2
- package/__tests__/pages/__snapshots__/home.test.tsx.snap +0 -3
- package/components/article/__tests__/__snapshots__/index.test.tsx.snap +0 -3
- package/cypress/e2e/account/newsletters-page.cy.js +29 -9
- package/cypress/e2e/account/subscription-and-billing.cy.js +10 -39
- package/cypress/support/commands.js +1 -1
- package/cypress/support/users.js +6 -2
- package/helpers/getProviderPropsUtil.ts +17 -0
- package/package.json +11 -11
- package/pages/account/add/[field].tsx +13 -56
- package/pages/account/cancellation/index.tsx +3 -2
- 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 +3 -2
- package/pages/account/edit/[field].tsx +17 -5
- package/pages/account/family/index.tsx +11 -3
- package/pages/account/holiday-stop/index.tsx +3 -6
- package/pages/account/holiday-stop/previous-holiday-stops.tsx +3 -6
- package/pages/account/holiday-stop/upcoming-holiday-stops.tsx +3 -6
- package/pages/account/index.tsx +3 -6
- package/pages/account/newsletters/index.tsx +3 -2
- package/pages/account/newsletters-and-alerts/index.tsx +3 -6
- package/pages/account/payment/[paymentMethod].tsx +2 -3
- package/pages/account/payment/index.tsx +3 -2
- package/pages/account/payment-methods/index.tsx +3 -6
- package/pages/account/subscription-and-billing/index.tsx +3 -6
- package/pages/account/user-hub/index.tsx +4 -6
- package/temp/_document.tsx +1 -0
|
@@ -134,18 +134,18 @@ 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
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
cy.
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
141
|
+
// Section no longer displayed when Invoice history is empty due to graphql change
|
|
142
|
+
// Invoices are no longer fetched if older than 1 year
|
|
143
|
+
// This test would periodically fail as it depends on changing user data
|
|
144
|
+
it('Should not display empty Invoice history section', () => {
|
|
145
|
+
cy.get('[data-testid="ContentListIntroduction"]').should(
|
|
146
|
+
'not.contain',
|
|
147
|
+
'Invoice history'
|
|
148
|
+
)
|
|
149
149
|
})
|
|
150
150
|
|
|
151
151
|
it('Should NOT display Your deliveries section', () => {
|
|
@@ -226,16 +226,6 @@ describe('Subscription and billing details for Print user', () => {
|
|
|
226
226
|
)
|
|
227
227
|
})
|
|
228
228
|
|
|
229
|
-
it('Should display Invoice history section', () => {
|
|
230
|
-
cy.contains('[data-testid="ContentListIntroduction"]', 'Invoice history')
|
|
231
|
-
cy.contains('Print pack')
|
|
232
|
-
cy.contains('24 Apr 2023')
|
|
233
|
-
cy.contains('Paid')
|
|
234
|
-
cy.get('a[data-testid="download-button"]')
|
|
235
|
-
.should('have.attr', 'href', '#')
|
|
236
|
-
.contains('View')
|
|
237
|
-
})
|
|
238
|
-
|
|
239
229
|
it('Should display Your deliveries section for users with vouchers', () => {
|
|
240
230
|
cy.GetTnlAcsSession('printVouchers')
|
|
241
231
|
cy.mockConsentAndVisit('/account/subscription-and-billing')
|
|
@@ -277,16 +267,6 @@ describe('Subscription and billing details for Digi-Print user', () => {
|
|
|
277
267
|
cy.contains('Digi-Print')
|
|
278
268
|
//...rest is same as Print user
|
|
279
269
|
})
|
|
280
|
-
|
|
281
|
-
it('Should display Invoice history section', () => {
|
|
282
|
-
cy.contains('[data-testid="ContentListIntroduction"]', 'Invoice history')
|
|
283
|
-
cy.contains('Digi-Print pack')
|
|
284
|
-
cy.contains('12 Nov 2023')
|
|
285
|
-
cy.contains('Paid')
|
|
286
|
-
cy.get('a[data-testid="download-button"]')
|
|
287
|
-
.should('have.attr', 'href', '#')
|
|
288
|
-
.contains('View')
|
|
289
|
-
})
|
|
290
270
|
})
|
|
291
271
|
|
|
292
272
|
describe('Subscription and billing details for Paypal user', () => {
|
|
@@ -302,15 +282,6 @@ describe('Subscription and billing details for Paypal user', () => {
|
|
|
302
282
|
cy.get('[data-testid="paypal-icon"]').should('exist')
|
|
303
283
|
cy.contains('cmp.paypal.user.verified.test@news.co.uk')
|
|
304
284
|
})
|
|
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
|
-
{ timeout: 15000 }
|
|
312
|
-
)
|
|
313
|
-
})
|
|
314
285
|
})
|
|
315
286
|
|
|
316
287
|
describe('Subscription and billing edit pages', () => {
|
package/cypress/support/users.js
CHANGED
|
@@ -54,5 +54,9 @@ export const userMap = {
|
|
|
54
54
|
username: 'digi-print-card-15-11-22@yopmail.com',
|
|
55
55
|
password: 'Password123Testing123$',
|
|
56
56
|
},
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
tnlNoSubscription: {
|
|
58
|
+
//registered user with no subscription, tests the number of newsletters displayed
|
|
59
|
+
username: 'tm-test+staging-registered-user@news.co.uk',
|
|
60
|
+
password: 'Growth123',
|
|
61
|
+
},
|
|
62
|
+
}
|
|
@@ -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-cd7dda9a6",
|
|
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.10.
|
|
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.15.2",
|
|
46
|
+
"@newskit-render/auth": "^1.8.4",
|
|
47
|
+
"@newskit-render/checkout": "^3.10.35",
|
|
48
|
+
"@newskit-render/feature-flags": "^1.11.3",
|
|
49
|
+
"@newskit-render/feed": "^1.8.18",
|
|
50
|
+
"@newskit-render/my-account": "^7.98.4",
|
|
51
|
+
"@newskit-render/shared-components": "^4.44.0",
|
|
52
|
+
"@newskit-render/standalone-components": "^3.25.5",
|
|
53
|
+
"@newskit-render/validation": "^1.18.4",
|
|
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": "
|
|
107
|
+
"typescript": "5.6.3",
|
|
108
108
|
"wait-on": "7.0.1"
|
|
109
109
|
},
|
|
110
110
|
"precommit": [
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { replaceConsoleAndSetTransactionName } from '../../../helpers/logger'
|
|
3
|
-
import {
|
|
4
|
-
AddField,
|
|
5
|
-
addComponentMap,
|
|
6
|
-
getProviderPropsTimes,
|
|
7
|
-
// getProviderProps,
|
|
8
|
-
} from '@newskit-render/my-account'
|
|
3
|
+
import { AddField, addComponentMap } from '@newskit-render/my-account'
|
|
9
4
|
import validation from '../../../validation'
|
|
10
5
|
import { DynamicPage } from '@newskit-render/my-account'
|
|
6
|
+
import { getAllFeatureFlags } from '@newskit-render/feature-flags' /* cra-effected */
|
|
7
|
+
import { getProviderPropsUtil } from '../../../helpers/getProviderPropsUtil'
|
|
11
8
|
|
|
12
9
|
const AccountAddField = (props) => (
|
|
13
10
|
<DynamicPage
|
|
@@ -20,67 +17,27 @@ const AccountAddField = (props) => (
|
|
|
20
17
|
)
|
|
21
18
|
|
|
22
19
|
export default AccountAddField
|
|
23
|
-
// export const getServerSideProps = async (context) => {
|
|
24
|
-
// const {
|
|
25
|
-
// params: { field },
|
|
26
|
-
// } = context
|
|
27
|
-
// const doesAddpageExist = Object.keys(addComponentMap).includes(field)
|
|
28
|
-
// replaceConsoleAndSetTransactionName(`Account: add ${field}`)
|
|
29
|
-
|
|
30
|
-
// if (!doesAddpageExist) {
|
|
31
|
-
// context.res.statusCode = 404
|
|
32
|
-
// // Logging the error for being captured by New Relic
|
|
33
|
-
// console.error(`An error ${context.res.statusCode} occurred on server`)
|
|
34
|
-
// }
|
|
35
|
-
|
|
36
|
-
// return {
|
|
37
|
-
// props: { data: { type: field } },
|
|
38
|
-
// }
|
|
39
|
-
// }
|
|
40
|
-
|
|
41
20
|
export const getServerSideProps = async (context) => {
|
|
42
|
-
// const featureFlags = await getAllFeatureFlags(
|
|
43
|
-
// getUserAttributes(context?.req?.headers)
|
|
44
|
-
// )
|
|
45
|
-
|
|
46
21
|
const {
|
|
47
22
|
params: { field },
|
|
48
23
|
} = context
|
|
49
|
-
const
|
|
50
|
-
|
|
24
|
+
const doesAddpageExist = Object.keys(addComponentMap).includes(field)
|
|
51
25
|
replaceConsoleAndSetTransactionName(`Account: add ${field}`)
|
|
52
26
|
|
|
53
|
-
|
|
54
|
-
props: { data: { type: field }, requestHeaders: context.req.headers },
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
const getProviderPropsResponse = (await getProviderPropsTimes({
|
|
58
|
-
...context,
|
|
59
|
-
provider: 'AddField',
|
|
60
|
-
})) as unknown as { props: unknown }
|
|
61
|
-
console.log('getProviderPropsResponse', getProviderPropsResponse)
|
|
62
|
-
|
|
63
|
-
if (!doesAddPageExist) {
|
|
27
|
+
if (!doesAddpageExist) {
|
|
64
28
|
context.res.statusCode = 404
|
|
65
29
|
// Logging the error for being captured by New Relic
|
|
66
30
|
console.error(`An error ${context.res.statusCode} occurred on server`)
|
|
67
|
-
|
|
68
|
-
// The 404 logic for non-existent [add] components is added in the DynamicPage
|
|
69
|
-
return defaultPageResponse
|
|
70
31
|
}
|
|
71
32
|
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
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 } } }
|
|
75
38
|
|
|
76
|
-
if (
|
|
77
|
-
|
|
78
|
-
redirect: {
|
|
79
|
-
permanent: false,
|
|
80
|
-
destination: '/404',
|
|
81
|
-
},
|
|
82
|
-
}
|
|
39
|
+
if (providerProps?.props) {
|
|
40
|
+
providerProps.props = { ...providerProps.props, data: { type: field } }
|
|
83
41
|
}
|
|
84
|
-
|
|
85
|
-
return defaultPageResponse
|
|
42
|
+
return providerProps
|
|
86
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
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} />
|
|
@@ -15,7 +16,7 @@ export const getServerSideProps = async (context) => {
|
|
|
15
16
|
/* start cra-effected */
|
|
16
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
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
|
|
|
@@ -12,7 +13,7 @@ export const getServerSideProps = async (context) => {
|
|
|
12
13
|
/* start cra-effected */
|
|
13
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,17 +2,20 @@ import React from 'react'
|
|
|
2
2
|
import { replaceConsoleAndSetTransactionName } from '../../../helpers/logger'
|
|
3
3
|
import {
|
|
4
4
|
EditField,
|
|
5
|
-
// getProviderProps,
|
|
6
|
-
getProviderPropsTimes,
|
|
7
5
|
editComponentMap,
|
|
6
|
+
broadcastingOnlyEditComponentMap,
|
|
8
7
|
DynamicPage,
|
|
9
8
|
} from '@newskit-render/my-account'
|
|
10
9
|
import { getAllFeatureFlags } from '@newskit-render/feature-flags' /* cra-effected */
|
|
11
10
|
import validation from '../../../validation'
|
|
11
|
+
import { getProviderPropsUtil } from '../../../helpers/getProviderPropsUtil'
|
|
12
|
+
import { publisher } from '../../../config'
|
|
13
|
+
import { Publisher } from '@newskit-render/api'
|
|
12
14
|
|
|
13
15
|
const AccountEditField = (props) => (
|
|
14
16
|
<DynamicPage
|
|
15
17
|
objectMap={editComponentMap}
|
|
18
|
+
isPageRestricted={props.isPageRestricted}
|
|
16
19
|
pageName={props.data.type}
|
|
17
20
|
Component={EditField}
|
|
18
21
|
componentProps={props}
|
|
@@ -28,9 +31,15 @@ export const getServerSideProps = async (context) => {
|
|
|
28
31
|
} = context
|
|
29
32
|
const doesEditPageExist = Object.keys(editComponentMap).includes(field)
|
|
30
33
|
|
|
34
|
+
const isBroadcasting = publisher === Publisher.BROADCASTING
|
|
35
|
+
const broadcastingOnlyPages = Object.keys(broadcastingOnlyEditComponentMap)
|
|
36
|
+
|
|
37
|
+
const isPageRestricted =
|
|
38
|
+
!isBroadcasting && broadcastingOnlyPages.includes(field)
|
|
39
|
+
|
|
31
40
|
replaceConsoleAndSetTransactionName(`Account: edit ${field}`)
|
|
32
41
|
|
|
33
|
-
if (!doesEditPageExist) {
|
|
42
|
+
if (!doesEditPageExist || isPageRestricted) {
|
|
34
43
|
context.res.statusCode = 404
|
|
35
44
|
// Logging the error for being captured by New Relic
|
|
36
45
|
console.error(`An error ${context.res.statusCode} occurred on server`)
|
|
@@ -39,8 +48,11 @@ export const getServerSideProps = async (context) => {
|
|
|
39
48
|
const featureFlags = await getAllFeatureFlags()
|
|
40
49
|
/* end cra-effected */
|
|
41
50
|
|
|
42
|
-
return
|
|
51
|
+
return getProviderPropsUtil(
|
|
43
52
|
{ ...context, provider: 'EditField' },
|
|
44
|
-
{
|
|
53
|
+
{
|
|
54
|
+
featureFlags,
|
|
55
|
+
isPageRestricted,
|
|
56
|
+
} /* cra-effected */
|
|
45
57
|
)
|
|
46
58
|
}
|
|
@@ -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
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
|
|
|
@@ -11,9 +12,16 @@ export const getServerSideProps = async (context) => {
|
|
|
11
12
|
replaceConsoleAndSetTransactionName('Account: Family')
|
|
12
13
|
/* start cra-effected */
|
|
13
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
|
|
16
|
-
{
|
|
20
|
+
return getProviderPropsUtil(
|
|
21
|
+
{
|
|
22
|
+
...context,
|
|
23
|
+
provider,
|
|
24
|
+
},
|
|
17
25
|
{ featureFlags } /* cra-effected */
|
|
18
26
|
)
|
|
19
27
|
}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import {
|
|
3
|
-
// getProviderProps,
|
|
4
|
-
getProviderPropsTimes,
|
|
5
|
-
HolidayStop,
|
|
6
|
-
} from '@newskit-render/my-account'
|
|
2
|
+
import { HolidayStop } from '@newskit-render/my-account'
|
|
7
3
|
import { replaceConsoleAndSetTransactionName } from '../../../helpers/logger'
|
|
8
4
|
import { getAllFeatureFlags } from '@newskit-render/feature-flags' /* cra-effected */
|
|
5
|
+
import { getProviderPropsUtil } from '../../../helpers/getProviderPropsUtil'
|
|
9
6
|
|
|
10
7
|
const AccountHolidayStop = (props) => <HolidayStop {...props} />
|
|
11
8
|
|
|
@@ -16,7 +13,7 @@ export const getServerSideProps = async (context) => {
|
|
|
16
13
|
/* start cra-effected */
|
|
17
14
|
const featureFlags = await getAllFeatureFlags()
|
|
18
15
|
/* end cra-effected */
|
|
19
|
-
return
|
|
16
|
+
return getProviderPropsUtil(
|
|
20
17
|
{ ...context, provider: 'HolidayStop' },
|
|
21
18
|
{ featureFlags } /* cra-effected */
|
|
22
19
|
)
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import {
|
|
3
|
-
// getProviderProps,
|
|
4
|
-
getProviderPropsTimes,
|
|
5
|
-
HolidayStopList,
|
|
6
|
-
} from '@newskit-render/my-account'
|
|
2
|
+
import { HolidayStopList } from '@newskit-render/my-account'
|
|
7
3
|
import { replaceConsoleAndSetTransactionName } from '../../../helpers/logger'
|
|
8
4
|
import { holidayStopListContextOverrides } from '../../../context/app-context/holidayStopListContextOverrides'
|
|
5
|
+
import { getProviderPropsUtil } from '../../../helpers/getProviderPropsUtil'
|
|
9
6
|
|
|
10
7
|
const AccountPreviousHolidayStops = (props) => (
|
|
11
8
|
<HolidayStopList
|
|
@@ -19,5 +16,5 @@ export default AccountPreviousHolidayStops
|
|
|
19
16
|
|
|
20
17
|
export const getServerSideProps = async (context) => {
|
|
21
18
|
replaceConsoleAndSetTransactionName('Account: Previous Holiday Stops')
|
|
22
|
-
return
|
|
19
|
+
return getProviderPropsUtil({ ...context, provider: 'HolidayStop' })
|
|
23
20
|
}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import {
|
|
3
|
-
// getProviderProps,
|
|
4
|
-
getProviderPropsTimes,
|
|
5
|
-
HolidayStopList,
|
|
6
|
-
} from '@newskit-render/my-account'
|
|
2
|
+
import { HolidayStopList } from '@newskit-render/my-account'
|
|
7
3
|
import { replaceConsoleAndSetTransactionName } from '../../../helpers/logger'
|
|
8
4
|
import { holidayStopListContextOverrides } from '../../../context/app-context/holidayStopListContextOverrides'
|
|
5
|
+
import { getProviderPropsUtil } from '../../../helpers/getProviderPropsUtil'
|
|
9
6
|
|
|
10
7
|
const AccountUpcomingHolidayStops = (props) => (
|
|
11
8
|
<HolidayStopList
|
|
@@ -19,5 +16,5 @@ export default AccountUpcomingHolidayStops
|
|
|
19
16
|
|
|
20
17
|
export const getServerSideProps = async (context) => {
|
|
21
18
|
replaceConsoleAndSetTransactionName('Account: Upcoming Holiday Stops')
|
|
22
|
-
return
|
|
19
|
+
return getProviderPropsUtil({ ...context, provider: 'HolidayStop' })
|
|
23
20
|
}
|
package/pages/account/index.tsx
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import {
|
|
3
|
-
PersonalDetails,
|
|
4
|
-
getProviderPropsTimes,
|
|
5
|
-
// getProviderProps,
|
|
6
|
-
} from '@newskit-render/my-account'
|
|
2
|
+
import { PersonalDetails } from '@newskit-render/my-account'
|
|
7
3
|
import { getAllFeatureFlags } from '@newskit-render/feature-flags' /* cra-effected */
|
|
8
4
|
import { AccountDropdown } from '../../components/AccountDropdown' /* cra-disabled */
|
|
9
5
|
import { replaceConsoleAndSetTransactionName } from '../../helpers/logger'
|
|
6
|
+
import { getProviderPropsUtil } from '../../helpers/getProviderPropsUtil'
|
|
10
7
|
|
|
11
8
|
const AccountPersonalDetails = (props) => {
|
|
12
9
|
return (
|
|
@@ -28,7 +25,7 @@ export const getServerSideProps = async (context) => {
|
|
|
28
25
|
|
|
29
26
|
const featureFlags = await getAllFeatureFlags()
|
|
30
27
|
|
|
31
|
-
return
|
|
28
|
+
return getProviderPropsUtil(
|
|
32
29
|
{ ...context, provider: 'PersonalDetails' },
|
|
33
30
|
{ featureFlags } /* cra-effected */
|
|
34
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
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
|
|
|
@@ -12,7 +13,7 @@ export const getServerSideProps = async (context) => {
|
|
|
12
13
|
/* start cra-effected */
|
|
13
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
|
)
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import {
|
|
3
|
-
NewslettersAndAlerts,
|
|
4
|
-
getProviderPropsTimes,
|
|
5
|
-
// getProviderProps
|
|
6
|
-
} from '@newskit-render/my-account'
|
|
2
|
+
import { NewslettersAndAlerts } from '@newskit-render/my-account'
|
|
7
3
|
import { replaceConsoleAndSetTransactionName } from '../../../helpers/logger'
|
|
8
4
|
import { getAllFeatureFlags } from '@newskit-render/feature-flags' /* cra-effected */
|
|
5
|
+
import { getProviderPropsUtil } from '../../../helpers/getProviderPropsUtil'
|
|
9
6
|
|
|
10
7
|
const AccountNewslettersAndAlerts = (props) => (
|
|
11
8
|
<NewslettersAndAlerts {...props} />
|
|
@@ -18,7 +15,7 @@ export const getServerSideProps = async (context) => {
|
|
|
18
15
|
/* start cra-effected */
|
|
19
16
|
const featureFlags = await getAllFeatureFlags()
|
|
20
17
|
/* end cra-effected */
|
|
21
|
-
return
|
|
18
|
+
return getProviderPropsUtil(
|
|
22
19
|
{ ...context, provider: 'NewslettersAndAlerts' },
|
|
23
20
|
{ featureFlags } /* cra-effected */
|
|
24
21
|
)
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { replaceConsoleAndSetTransactionName } from '../../../helpers/logger'
|
|
3
3
|
import {
|
|
4
|
-
// getProviderProps,
|
|
5
|
-
getProviderPropsTimes,
|
|
6
4
|
Payment,
|
|
7
5
|
paymentMethodsMap,
|
|
8
6
|
DynamicPage,
|
|
9
7
|
} from '@newskit-render/my-account'
|
|
10
8
|
import { getAllFeatureFlags } from '@newskit-render/feature-flags' /* cra-effected */
|
|
9
|
+
import { getProviderPropsUtil } from '../../../helpers/getProviderPropsUtil'
|
|
11
10
|
|
|
12
11
|
const PaymentPage = (props) => {
|
|
13
12
|
return (
|
|
@@ -28,7 +27,7 @@ export const getServerSideProps = async (context) => {
|
|
|
28
27
|
const featureFlags = await getAllFeatureFlags()
|
|
29
28
|
/* end cra-effected */
|
|
30
29
|
|
|
31
|
-
return
|
|
30
|
+
return getProviderPropsUtil(
|
|
32
31
|
{
|
|
33
32
|
...context,
|
|
34
33
|
provider: 'Payment',
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { replaceConsoleAndSetTransactionName } from '../../../helpers/logger'
|
|
3
|
-
import { Payment
|
|
3
|
+
import { Payment } from '@newskit-render/my-account'
|
|
4
4
|
import { getAllFeatureFlags } from '@newskit-render/feature-flags' /* cra-effected */
|
|
5
|
+
import { getProviderPropsUtil } from '../../../helpers/getProviderPropsUtil'
|
|
5
6
|
|
|
6
7
|
const AccountPayment = (props) => <Payment {...props} />
|
|
7
8
|
|
|
@@ -13,7 +14,7 @@ export const getServerSideProps = async (context) => {
|
|
|
13
14
|
const featureFlags = await getAllFeatureFlags()
|
|
14
15
|
/* end cra-effected */
|
|
15
16
|
|
|
16
|
-
return
|
|
17
|
+
return getProviderPropsUtil(
|
|
17
18
|
{
|
|
18
19
|
...context,
|
|
19
20
|
provider: 'Payment',
|