@newskit-render/core 0.0.0-e16014a0 → 0.0.0-e314136b0
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 +1008 -0
- package/Dockerfile.withNewRelic +1 -2
- 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/holiday-stops.cy.js +4 -4
- package/cypress/e2e/account/newsletters-page.cy.js +29 -9
- package/cypress/e2e/account/personal-details.cy.js +16 -2
- package/cypress/e2e/account/subscription-and-billing.cy.js +12 -42
- package/cypress/support/commands.js +3 -3
- package/cypress/support/users.js +13 -9
- package/helpers/getProviderPropsUtil.ts +20 -0
- package/next.config.js +55 -57
- package/package.json +12 -13
- package/pages/account/add/[field].tsx +11 -2
- package/pages/account/bonus-accounts/index.tsx +24 -0
- 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 +19 -6
- 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 +15 -7
- package/pages/account/user-hub/index.tsx +20 -0
- package/temp/_document.tsx +1 -0
- package/pages/account/family/index.tsx +0 -19
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { Family } from '@newskit-render/my-account'
|
|
3
|
+
import { replaceConsoleAndSetTransactionName } from '../../../helpers/logger'
|
|
4
|
+
import { getAllFeatureFlags } from '@newskit-render/feature-flags' /* cra-effected */
|
|
5
|
+
import { getProviderPropsUtil } from '../../../helpers/getProviderPropsUtil'
|
|
6
|
+
|
|
7
|
+
const AccountFamily = (props) => <Family {...props} />
|
|
8
|
+
|
|
9
|
+
export default AccountFamily
|
|
10
|
+
|
|
11
|
+
export const getServerSideProps = async (context) => {
|
|
12
|
+
replaceConsoleAndSetTransactionName('Account: Bonus Accounts')
|
|
13
|
+
/* start cra-effected */
|
|
14
|
+
const featureFlags = await getAllFeatureFlags()
|
|
15
|
+
|
|
16
|
+
/* end cra-effected */
|
|
17
|
+
return getProviderPropsUtil(
|
|
18
|
+
{
|
|
19
|
+
...context,
|
|
20
|
+
provider: 'GroupAccountsV2',
|
|
21
|
+
},
|
|
22
|
+
{ featureFlags } /* cra-effected */
|
|
23
|
+
)
|
|
24
|
+
}
|
|
@@ -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,16 +2,20 @@ import React from 'react'
|
|
|
2
2
|
import { replaceConsoleAndSetTransactionName } from '../../../helpers/logger'
|
|
3
3
|
import {
|
|
4
4
|
EditField,
|
|
5
|
-
getProviderProps,
|
|
6
5
|
editComponentMap,
|
|
6
|
+
broadcastingOnlyEditComponentMap,
|
|
7
7
|
DynamicPage,
|
|
8
8
|
} from '@newskit-render/my-account'
|
|
9
|
-
import {
|
|
9
|
+
import { getAllFeatureFlags } from '@newskit-render/feature-flags' /* cra-effected */
|
|
10
10
|
import validation from '../../../validation'
|
|
11
|
+
import { getProviderPropsUtil } from '../../../helpers/getProviderPropsUtil'
|
|
12
|
+
import { publisher } from '../../../config'
|
|
13
|
+
import { Publisher } from '@newskit-render/api'
|
|
11
14
|
|
|
12
15
|
const AccountEditField = (props) => (
|
|
13
16
|
<DynamicPage
|
|
14
17
|
objectMap={editComponentMap}
|
|
18
|
+
isPageRestricted={props.isPageRestricted}
|
|
15
19
|
pageName={props.data.type}
|
|
16
20
|
Component={EditField}
|
|
17
21
|
componentProps={props}
|
|
@@ -27,19 +31,28 @@ export const getServerSideProps = async (context) => {
|
|
|
27
31
|
} = context
|
|
28
32
|
const doesEditPageExist = Object.keys(editComponentMap).includes(field)
|
|
29
33
|
|
|
34
|
+
const isBroadcasting = publisher === Publisher.BROADCASTING
|
|
35
|
+
const broadcastingOnlyPages = Object.keys(broadcastingOnlyEditComponentMap)
|
|
36
|
+
|
|
37
|
+
const isPageRestricted =
|
|
38
|
+
!isBroadcasting && broadcastingOnlyPages.includes(field)
|
|
39
|
+
|
|
30
40
|
replaceConsoleAndSetTransactionName(`Account: edit ${field}`)
|
|
31
41
|
|
|
32
|
-
if (!doesEditPageExist) {
|
|
42
|
+
if (!doesEditPageExist || isPageRestricted) {
|
|
33
43
|
context.res.statusCode = 404
|
|
34
44
|
// Logging the error for being captured by New Relic
|
|
35
45
|
console.error(`An error ${context.res.statusCode} occurred on server`)
|
|
36
46
|
}
|
|
37
47
|
/* start cra-effected */
|
|
38
|
-
const featureFlags = await
|
|
48
|
+
const featureFlags = await getAllFeatureFlags()
|
|
39
49
|
/* end cra-effected */
|
|
40
50
|
|
|
41
|
-
return
|
|
51
|
+
return getProviderPropsUtil(
|
|
42
52
|
{ ...context, provider: 'EditField' },
|
|
43
|
-
{
|
|
53
|
+
{
|
|
54
|
+
featureFlags,
|
|
55
|
+
isPageRestricted,
|
|
56
|
+
} /* cra-effected */
|
|
44
57
|
)
|
|
45
58
|
}
|
|
@@ -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
|
)
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import {
|
|
3
|
-
NewslettersAndAlerts,
|
|
4
|
-
getProviderProps,
|
|
5
|
-
} from '@newskit-render/my-account'
|
|
2
|
+
import { NewslettersAndAlerts } from '@newskit-render/my-account'
|
|
6
3
|
import { replaceConsoleAndSetTransactionName } from '../../../helpers/logger'
|
|
7
|
-
import {
|
|
4
|
+
import { getAllFeatureFlags } from '@newskit-render/feature-flags' /* cra-effected */
|
|
5
|
+
import { getProviderPropsUtil } from '../../../helpers/getProviderPropsUtil'
|
|
8
6
|
|
|
9
7
|
const AccountNewslettersAndAlerts = (props) => (
|
|
10
8
|
<NewslettersAndAlerts {...props} />
|
|
@@ -15,9 +13,9 @@ export default AccountNewslettersAndAlerts
|
|
|
15
13
|
export const getServerSideProps = async (context) => {
|
|
16
14
|
replaceConsoleAndSetTransactionName('Account: Newsletters and Alerts')
|
|
17
15
|
/* start cra-effected */
|
|
18
|
-
const featureFlags = await
|
|
16
|
+
const featureFlags = await getAllFeatureFlags()
|
|
19
17
|
/* end cra-effected */
|
|
20
|
-
return
|
|
18
|
+
return getProviderPropsUtil(
|
|
21
19
|
{ ...context, provider: 'NewslettersAndAlerts' },
|
|
22
20
|
{ featureFlags } /* cra-effected */
|
|
23
21
|
)
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { replaceConsoleAndSetTransactionName } from '../../../helpers/logger'
|
|
3
3
|
import {
|
|
4
|
-
getProviderProps,
|
|
5
4
|
Payment,
|
|
6
5
|
paymentMethodsMap,
|
|
7
6
|
DynamicPage,
|
|
8
7
|
} from '@newskit-render/my-account'
|
|
9
|
-
import {
|
|
8
|
+
import { getAllFeatureFlags } from '@newskit-render/feature-flags' /* cra-effected */
|
|
9
|
+
import { getProviderPropsUtil } from '../../../helpers/getProviderPropsUtil'
|
|
10
10
|
|
|
11
11
|
const PaymentPage = (props) => {
|
|
12
12
|
return (
|
|
@@ -24,10 +24,10 @@ export default PaymentPage
|
|
|
24
24
|
export const getServerSideProps = async (context) => {
|
|
25
25
|
replaceConsoleAndSetTransactionName('Payment method')
|
|
26
26
|
/* start cra-effected */
|
|
27
|
-
const featureFlags = await
|
|
27
|
+
const featureFlags = await getAllFeatureFlags()
|
|
28
28
|
/* end cra-effected */
|
|
29
29
|
|
|
30
|
-
return
|
|
30
|
+
return getProviderPropsUtil(
|
|
31
31
|
{
|
|
32
32
|
...context,
|
|
33
33
|
provider: 'Payment',
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { replaceConsoleAndSetTransactionName } from '../../../helpers/logger'
|
|
3
|
-
import { Payment
|
|
4
|
-
import {
|
|
3
|
+
import { Payment } from '@newskit-render/my-account'
|
|
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
|
|
|
@@ -10,10 +11,10 @@ export default AccountPayment
|
|
|
10
11
|
export const getServerSideProps = async (context) => {
|
|
11
12
|
replaceConsoleAndSetTransactionName('Edit Payment method')
|
|
12
13
|
/* start cra-effected */
|
|
13
|
-
const featureFlags = await
|
|
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',
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { PaymentMethods } from '@newskit-render/my-account'
|
|
3
|
+
import { getAllFeatureFlags } from '@newskit-render/feature-flags' // create-render-app effected
|
|
4
4
|
import { paymentMethodContext } from '../../../context/app-context/paymentMethodContext'
|
|
5
5
|
import { replaceConsoleAndSetTransactionName } from '../../../helpers/logger'
|
|
6
|
+
import { getProviderPropsUtil } from '../../../helpers/getProviderPropsUtil'
|
|
6
7
|
|
|
7
8
|
const AccountPaymentMethods = (props) => (
|
|
8
9
|
<PaymentMethods {...props} context={paymentMethodContext} />
|
|
@@ -12,9 +13,9 @@ export default AccountPaymentMethods
|
|
|
12
13
|
|
|
13
14
|
export const getServerSideProps = async (context) => {
|
|
14
15
|
replaceConsoleAndSetTransactionName('Account: Payment Methods')
|
|
15
|
-
const featureFlags = await
|
|
16
|
+
const featureFlags = await getAllFeatureFlags()
|
|
16
17
|
// create-render-app effected
|
|
17
|
-
return
|
|
18
|
+
return getProviderPropsUtil(
|
|
18
19
|
{ ...context, provider: 'PaymentMethods' },
|
|
19
20
|
{ featureFlags } // create-render-app effected
|
|
20
21
|
)
|
|
@@ -1,23 +1,31 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import {
|
|
3
3
|
SubscriptionAndBilling,
|
|
4
|
-
|
|
4
|
+
subscriptionAndBillingContextSun,
|
|
5
|
+
subscriptionAndBillingContext,
|
|
5
6
|
} from '@newskit-render/my-account'
|
|
6
|
-
import {
|
|
7
|
+
import { getAllFeatureFlags } from '@newskit-render/feature-flags' /* cra-effected */
|
|
7
8
|
import { replaceConsoleAndSetTransactionName } from '../../../helpers/logger'
|
|
9
|
+
import { getProviderPropsUtil } from '../../../helpers/getProviderPropsUtil'
|
|
10
|
+
import { Publisher } from '@newskit-render/api'
|
|
8
11
|
|
|
9
|
-
const AccountSubscriptionAndBilling = (props) =>
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
const AccountSubscriptionAndBilling = (props) => {
|
|
13
|
+
const context =
|
|
14
|
+
props.env.PUBLISHER === Publisher.SUN_UK
|
|
15
|
+
? subscriptionAndBillingContextSun
|
|
16
|
+
: subscriptionAndBillingContext
|
|
17
|
+
|
|
18
|
+
return <SubscriptionAndBilling {...props} context={context} />
|
|
19
|
+
}
|
|
12
20
|
|
|
13
21
|
export default AccountSubscriptionAndBilling
|
|
14
22
|
|
|
15
23
|
export const getServerSideProps = async (context) => {
|
|
16
24
|
replaceConsoleAndSetTransactionName('Account: Subscription and Billing')
|
|
17
25
|
/* start cra-effected */
|
|
18
|
-
const featureFlags = await
|
|
26
|
+
const featureFlags = await getAllFeatureFlags()
|
|
19
27
|
/* end cra-effected */
|
|
20
|
-
const result = await
|
|
28
|
+
const result = await getProviderPropsUtil(
|
|
21
29
|
{
|
|
22
30
|
...context,
|
|
23
31
|
provider: 'SubscriptionAndBilling',
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { UserHub as UserHubPage } from '@newskit-render/my-account'
|
|
3
|
+
import { replaceConsoleAndSetTransactionName } from '../../../helpers/logger'
|
|
4
|
+
import { getAllFeatureFlags } from '@newskit-render/feature-flags' /* cra-effected */
|
|
5
|
+
import { getProviderPropsUtil } from '../../../helpers/getProviderPropsUtil'
|
|
6
|
+
|
|
7
|
+
const UserHub = (props) => <UserHubPage {...props} />
|
|
8
|
+
|
|
9
|
+
export default UserHub
|
|
10
|
+
|
|
11
|
+
export const getServerSideProps = async (context) => {
|
|
12
|
+
replaceConsoleAndSetTransactionName('Account: UserHub')
|
|
13
|
+
/* start cra-effected */
|
|
14
|
+
const featureFlags = await getAllFeatureFlags()
|
|
15
|
+
/* end cra-effected */
|
|
16
|
+
return getProviderPropsUtil(
|
|
17
|
+
{ ...context, provider: 'UserHub' },
|
|
18
|
+
{ featureFlags } /* cra-effected */
|
|
19
|
+
)
|
|
20
|
+
}
|
package/temp/_document.tsx
CHANGED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { Family, getProviderProps } from '@newskit-render/my-account'
|
|
3
|
-
import { replaceConsoleAndSetTransactionName } from '../../../helpers/logger'
|
|
4
|
-
import { getFlagsAll } from '@newskit-render/feature-flags' /* cra-effected */
|
|
5
|
-
|
|
6
|
-
const AccountFamily = (props) => <Family {...props} />
|
|
7
|
-
|
|
8
|
-
export default AccountFamily
|
|
9
|
-
|
|
10
|
-
export const getServerSideProps = async (context) => {
|
|
11
|
-
replaceConsoleAndSetTransactionName('Account: Family')
|
|
12
|
-
/* start cra-effected */
|
|
13
|
-
const featureFlags = await getFlagsAll()
|
|
14
|
-
/* end cra-effected */
|
|
15
|
-
return getProviderProps(
|
|
16
|
-
{ ...context, provider: 'GroupAccounts' },
|
|
17
|
-
{ featureFlags } /* cra-effected */
|
|
18
|
-
)
|
|
19
|
-
}
|