@newskit-render/core 0.0.0-d55b7d88 → 0.0.0-d75fd5849
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 +1392 -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/components/header/banner-messages.ts +4 -0
- 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 +57 -39
- 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/cancel/index.tsx +14 -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/pages/api/account/track-event/index.ts +16 -0
- package/public/assets/cancellation/another-source.png +0 -0
- package/public/assets/cancellation/cancellation-hero.png +0 -0
- package/public/assets/cancellation/content.png +0 -0
- package/public/assets/cancellation/delivery-problems.png +0 -0
- package/public/assets/cancellation/issues.png +0 -0
- package/public/assets/cancellation/money.png +0 -0
- package/public/assets/cancellation/placeholder.png +0 -0
- package/public/assets/cancellation/thank-you.png +0 -0
- package/public/assets/cancellation/time.png +0 -0
- package/public/assets/sun-placeholder.png +0 -0
- package/temp/_document.tsx +1 -0
- package/pages/account/family/index.tsx +0 -19
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { trackEvent } from '@newskit-render/my-account'
|
|
2
|
+
import { NextApiRequest, NextApiResponse } from 'next'
|
|
3
|
+
|
|
4
|
+
export default function handler(req: NextApiRequest, res: NextApiResponse) {
|
|
5
|
+
if (req.method !== 'POST') {
|
|
6
|
+
return res.status(405).json({ error: 'Method not allowed' })
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
try {
|
|
10
|
+
trackEvent(req)
|
|
11
|
+
res.status(200).end()
|
|
12
|
+
} catch (error) {
|
|
13
|
+
console.error('Error tracking Optimizely event:', error)
|
|
14
|
+
res.status(500).json({ error: 'Internal server error' })
|
|
15
|
+
}
|
|
16
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
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
|
-
}
|