@newskit-render/my-account 3.22.2 → 3.22.3-alpha.0
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/README.md +430 -531
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
## Getting Started
|
|
4
4
|
|
|
5
|
-
There are two ways to start with
|
|
5
|
+
There are two ways to start with `@newskit-render/my-account`:
|
|
6
6
|
|
|
7
|
-
1
|
|
7
|
+
**1.** If you want to build a project from scratch, that will have everything from Newskit Solutions, you need to run `create-render-app` (See [Newskit-Solutions Getting started](https://github.com/newscorp-ghfb/ncu-newskit-render#getting-started)).
|
|
8
8
|
|
|
9
|
-
2
|
|
9
|
+
**2.** If you already have a next application and you want to include my-account package you just need to run `yarn add @newskit-render/my-account` or `npm install @newskit-render/my-account` based on which package manager you use. Next you need to create an account folder inside your pages folder, and you can add your account pages there:
|
|
10
10
|
|
|
11
11
|
```
|
|
12
12
|
import { PersonalDetails, getProviderProps } from '@newskit-render/my-account'
|
|
@@ -18,22 +18,19 @@ export const getServerSideProps = async (context) =>
|
|
|
18
18
|
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
### **Authentication**
|
|
22
22
|
|
|
23
|
-
If you have already included my account into your application, you will be able to see account pages, but they won't be populated with any data. That's because my-account needs environment variables in order to connect with MAIN.
|
|
24
|
-
|
|
25
|
-
We assume that you already have created CPS (formerly MAIN) tenant for your title (If not, please check [setup new CPS tenant](https://nidigitalsolutions.jira.com/wiki/spaces/DPIAM/pages/3150938434/Setup+Full+New+Tenant)). Please ask a member of your team for the values of the environment variables.
|
|
23
|
+
If you have already included my account into your application, you will be able to see account pages, but they won't be populated with any data. That's because my-account needs the following environment variables in order to connect with CPS (formerly MAIN).
|
|
26
24
|
|
|
27
25
|
```
|
|
28
26
|
MAIN_GRAPHQL_URL=""
|
|
29
27
|
```
|
|
30
28
|
|
|
31
|
-
MAIN_GRAPHQL_URL: This is the main graphql endpoint
|
|
32
|
-
You can see examples of the other environment variables [here](https://
|
|
29
|
+
MAIN_GRAPHQL_URL: This is the main graphql endpoint - you can ask someone from your team, or a member from CPS to provide it for you.
|
|
33
30
|
|
|
34
|
-
If you are interested in my-account -
|
|
31
|
+
If you are interested in my-account - CPS integration and you want some in-depth info about it, you can have a look at our space in [confluence](https://nidigitalsolutions.jira.com/wiki/spaces/NPP/pages/3004694700/PP+My+Account+-+MAIN)
|
|
35
32
|
|
|
36
|
-
|
|
33
|
+
### **Required Environment Variables**
|
|
37
34
|
|
|
38
35
|
In order to run the application,we need the following required environment variables.
|
|
39
36
|
|
|
@@ -42,9 +39,9 @@ PUBLISHER=""
|
|
|
42
39
|
MAIN_GRAPHQL_URL=""
|
|
43
40
|
```
|
|
44
41
|
|
|
45
|
-
|
|
42
|
+
### **Theming**
|
|
46
43
|
|
|
47
|
-
The
|
|
44
|
+
The my-account package appearance can be controlled by a custom theme. The package uses NewsKit's theming system to enable customisation. See [Newskit theming](https://www.newskit.co.uk/theming/overview)
|
|
48
45
|
|
|
49
46
|
To override the My Account base theme you need to pass a new theme as a prop of a page component:
|
|
50
47
|
|
|
@@ -74,13 +71,13 @@ export const getServerSideProps = async (context) =>
|
|
|
74
71
|
getProviderProps({ ...context, provider: 'PersonalDetails' })
|
|
75
72
|
```
|
|
76
73
|
|
|
77
|
-
|
|
74
|
+
Use the `sharedTheme` as the base to any new theme you create. You can see this theme [here](https://github.com/newscorp-ghfb/ncu-newskit-render/tree/master/packages/shared-components/src/theme/sharedTheme)
|
|
78
75
|
|
|
79
|
-
Currently the app created with create-render-app has a dropdown theme selector that you can see by pressing '\`' key. This is also implemented in Account. When you add a custom theme you should remove the `AppContext` and `createThemeDropdownObject` logic.
|
|
76
|
+
Currently the app created with `create-render-app` has a dropdown theme selector that you can see by pressing '\`' key. This is also implemented in Account. When you add a custom theme you should remove the `AppContext` and `createThemeDropdownObject` logic.
|
|
80
77
|
|
|
81
|
-
|
|
78
|
+
### **Page types**
|
|
82
79
|
|
|
83
|
-
Currently provides a number of
|
|
80
|
+
Currently provides a number of default pages, however they are based on 3 page types
|
|
84
81
|
|
|
85
82
|
- Display
|
|
86
83
|
- Edit
|
|
@@ -92,12 +89,14 @@ All Edit pages are currently accessed from `pages/account/edit/[field].tsx` (`Ed
|
|
|
92
89
|
|
|
93
90
|
All Add pages are currenlty accessed from `pages/account/add/[field].tsx` (`AddField` component)`
|
|
94
91
|
|
|
95
|
-
|
|
92
|
+
### **Page overrides**
|
|
96
93
|
|
|
97
|
-
The My Account package has data driven pages using React context. You can override defaults starting on a page
|
|
94
|
+
The My Account package has data driven pages using React context. You can override defaults starting on a page basis.
|
|
98
95
|
|
|
99
96
|
The following examples will override aspects of the Personal Details page:
|
|
100
97
|
|
|
98
|
+
#### **1. Override the page's header description and list items title styles:**
|
|
99
|
+
|
|
101
100
|
```
|
|
102
101
|
import React from 'react'
|
|
103
102
|
import { PersonalDetails, getProviderProps, ContextOptions, personalDetailsContext } from '@newskit-render/my-account'
|
|
@@ -131,14 +130,15 @@ export const getServerSideProps = async (context) =>
|
|
|
131
130
|
getProviderProps({ ...context, provider: 'PersonalDetails' })
|
|
132
131
|
```
|
|
133
132
|
|
|
134
|
-
|
|
133
|
+
#### **2. Override the sections on the page**
|
|
135
134
|
|
|
136
135
|
```
|
|
137
136
|
const overrideContext: ContextOptions = {
|
|
138
137
|
...personalDetailsContext,
|
|
139
138
|
sections: [
|
|
140
139
|
{
|
|
141
|
-
type: '
|
|
140
|
+
type: 'digital',
|
|
141
|
+
componentType: 'list',
|
|
142
142
|
props: {
|
|
143
143
|
introductionProps: {
|
|
144
144
|
title: 'Section added'
|
|
@@ -158,7 +158,7 @@ const overrideContext: ContextOptions = {
|
|
|
158
158
|
}
|
|
159
159
|
```
|
|
160
160
|
|
|
161
|
-
|
|
161
|
+
#### **3. Add onto the existing sections:**
|
|
162
162
|
|
|
163
163
|
```
|
|
164
164
|
const overrideContext: ContextOptions = {
|
|
@@ -166,7 +166,8 @@ const overrideContext: ContextOptions = {
|
|
|
166
166
|
sections: [
|
|
167
167
|
...personalDetailsContext.sections,
|
|
168
168
|
{
|
|
169
|
-
type: '
|
|
169
|
+
type: 'print',
|
|
170
|
+
componentType: 'list',
|
|
170
171
|
props: {
|
|
171
172
|
introductionProps: {
|
|
172
173
|
title: 'Another section added'
|
|
@@ -186,9 +187,9 @@ const overrideContext: ContextOptions = {
|
|
|
186
187
|
}
|
|
187
188
|
```
|
|
188
189
|
|
|
189
|
-
|
|
190
|
+
The following examples will override aspects of Edit pages `pages/account/edit/[field].tsx`.
|
|
190
191
|
|
|
191
|
-
|
|
192
|
+
1. Let's change 3 forms - Password, Name and Address:
|
|
192
193
|
|
|
193
194
|
```
|
|
194
195
|
import React from 'react'
|
|
@@ -327,13 +328,18 @@ export const getServerSideProps = async (context) =>
|
|
|
327
328
|
getProviderProps({ ...context, provider: 'EditField' })
|
|
328
329
|
```
|
|
329
330
|
|
|
330
|
-
|
|
331
|
+
### **Section types**
|
|
332
|
+
|
|
333
|
+
The section displays information based on the type of subscription and the type of component, used for display:
|
|
331
334
|
|
|
332
|
-
|
|
335
|
+
```
|
|
336
|
+
type: 'print' | 'digital' // the type of subscription
|
|
337
|
+
componentType: 'list' // the component, used for displaying the data. Currently we only support `list`
|
|
338
|
+
```
|
|
333
339
|
|
|
334
|
-
Currently
|
|
340
|
+
Each item in this `list` also has a type. Currently the item types are:
|
|
335
341
|
|
|
336
|
-
### Item types
|
|
342
|
+
### **Item types**
|
|
337
343
|
|
|
338
344
|
- 'name'
|
|
339
345
|
- 'dob'
|
|
@@ -355,515 +361,73 @@ Currently only support list
|
|
|
355
361
|
- 'commentingNotifications'
|
|
356
362
|
- 'contactPreferences'
|
|
357
363
|
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
1. data - Do not touch this will be overriden in My Account.
|
|
361
|
-
2. userData - Do not touch this will be overriden in My Account.
|
|
362
|
-
3. head - currently lets you override title tag of page
|
|
363
|
-
|
|
364
|
-
- pageTitle: string
|
|
365
|
-
- siteTitle: string | false
|
|
366
|
-
|
|
367
|
-
4. navigationPrimary - Global property changes nav links in top banner area - Array of nav objects or false to have no nav
|
|
368
|
-
|
|
369
|
-
- nav?:
|
|
370
|
-
- text: string
|
|
371
|
-
- link: string
|
|
372
|
-
- icon: React.ReactElement<NewsKitIconProps>
|
|
373
|
-
- ariaLabel?: string
|
|
374
|
-
- title?: string
|
|
375
|
-
- logoSrc?: string (path to logo.svg)
|
|
376
|
-
- logoWidth?: string (width of logo)
|
|
377
|
-
- titlePosition?: string (uses css top property to ajust title position)
|
|
378
|
-
|
|
379
|
-
5. sideNav - Global property changes sidebar navigation - Array of nav objects
|
|
380
|
-
|
|
381
|
-
- text: string
|
|
382
|
-
- href: string
|
|
383
|
-
- id: string
|
|
384
|
-
|
|
385
|
-
> The sideNav uses NewsKit's MenuItem component with a custom stylePreset: `navigationSecondayHorizontal` that can be found [here](https://github.com/newscorp-ghfb/ncu-newskit-render/blob/master/packages/my-account/src/theme/index.ts) if you need to override in your custom theme
|
|
386
|
-
|
|
387
|
-
6. sideNavSelected : string - The Id of the selected sideNav
|
|
388
|
-
|
|
389
|
-
7. sideNavOverrides
|
|
390
|
-
|
|
391
|
-
- menuItemOverrides
|
|
392
|
-
- stylePreset: MQ<string>
|
|
393
|
-
- typographyPreset: MQ<string>
|
|
394
|
-
- spaceInset: MQ<string>
|
|
395
|
-
- backgroundColor: string
|
|
396
|
-
|
|
397
|
-
8. pastDueBanner - Banner displayed when your subscription is passed due
|
|
398
|
-
|
|
399
|
-
- firstNotice: - Banner when your subscription past due is below first treshold
|
|
400
|
-
- title: string - Banner title
|
|
401
|
-
- text: string - Banner text
|
|
402
|
-
- dismissDays?: number - number of days you want banner dismissed after if not dones so by user
|
|
403
|
-
- button: string - Banner button text
|
|
404
|
-
- secondNotice: - Banner when your subscription past due is bigger than first treshold, but lower that second treshold
|
|
405
|
-
- title: string - Banner title
|
|
406
|
-
- text: string - Banner text
|
|
407
|
-
- dismissDays?: number - number of days you want banner dismissed after if not dones so by user
|
|
408
|
-
- button: string - Banner button text
|
|
409
|
-
- terminated: Banner when your subscription past due is bigger than second treshold
|
|
410
|
-
- title: string - Banner title
|
|
411
|
-
- text: string - Banner text
|
|
412
|
-
- dismissDays?: number - number of days you want banner dismissed after if not dones so by user
|
|
413
|
-
- button: string - Banner button text
|
|
414
|
-
- toBeCancelled: Banner shown when user has cancelled subscription but before end of billing cycle
|
|
415
|
-
- title: string - Banner title
|
|
416
|
-
- text: string - Banner text
|
|
417
|
-
- dismissDays?: number - number of days you want banner dismissed after if not dones so by user
|
|
418
|
-
- button: string - Banner button text
|
|
419
|
-
- cancelled: Banner shown when user has cancelled subscription and is after end of billing cycle
|
|
420
|
-
- title: string - Banner title
|
|
421
|
-
- text: string - Banner text
|
|
422
|
-
- dismissDays?: number - number of days you want banner dismissed after if not dones so by user
|
|
423
|
-
- button: string - Banner button text
|
|
424
|
-
- treshold: - Past due banner tresholds
|
|
425
|
-
- firstNotice: number
|
|
426
|
-
- secondNotice: number
|
|
427
|
-
|
|
428
|
-
> The pastDueBanner uses some custom stylePreset `PastDueFirstNotice PastDueLastNotice UpdatePaymentButton` see [here](https://github.com/newscorp-ghfb/ncu-newskit-render/blob/master/packages/my-account/src/theme/index.ts)
|
|
429
|
-
|
|
430
|
-
9. header - Changes Page header
|
|
431
|
-
|
|
432
|
-
- title: string
|
|
433
|
-
- titleOverrides: TitleOverrides (see below)
|
|
434
|
-
- fullWidthTitle: boolean
|
|
435
|
-
- description: string
|
|
436
|
-
- descriptionOverrides: DescriptionOverrides (see below)
|
|
437
|
-
- backButton:
|
|
438
|
-
- href: string
|
|
439
|
-
- 'aria-label': string
|
|
440
|
-
- text: string
|
|
441
|
-
- backButtonOverrides:
|
|
442
|
-
- stylePreset: MQ<string>
|
|
443
|
-
- typographyPreset: MQ<string>
|
|
444
|
-
- spaceInset: MQ<string>
|
|
445
|
-
- spaceStack: MQ<string>
|
|
446
|
-
- iconSize: MQ<string>
|
|
447
|
-
- size: 'small' | 'medium' | 'large'
|
|
448
|
-
- asLink: boolean (will render as LinkStandalone not Button)
|
|
449
|
-
- image: ImageProps
|
|
450
|
-
- spaceStack: MQ<string>
|
|
451
|
-
- showDivider: boolean
|
|
452
|
-
- imageCell?: CellProps CellProps see NewsKit (can be used to change order of items)
|
|
453
|
-
- introductionCell?: CellProps
|
|
454
|
-
- backButtonCell?: CellProps
|
|
455
|
-
|
|
456
|
-
10. sections - Array of section items
|
|
457
|
-
|
|
458
|
-
- type: string - currently only list
|
|
459
|
-
- props: ContentListViewProps
|
|
460
|
-
|
|
461
|
-
- introductionProps: IntroductionProps
|
|
462
|
-
- title: string
|
|
463
|
-
- titleOverrides: TitleOverrides (see below)
|
|
464
|
-
- description: string
|
|
465
|
-
- descriptionOverrides: DescriptionOverrides (see below)
|
|
466
|
-
- items?: Array<ContentListItem> (see below)
|
|
467
|
-
- ariaLabel?: string
|
|
468
|
-
|
|
469
|
-
- ContentListItem
|
|
470
|
-
- label: string
|
|
471
|
-
- default: string
|
|
472
|
-
- href: string
|
|
473
|
-
- type: - Currently only name see above
|
|
474
|
-
- path?: string
|
|
475
|
-
- ariaLabel?: string
|
|
476
|
-
|
|
477
|
-
> The ContentListItem uses some custom stylePresets `baseInteractivePrimary030 contentListView` see [here](https://github.com/newscorp-ghfb/ncu-newskit-render/blob/master/packages/my-account/src/theme/index.ts)
|
|
478
|
-
|
|
479
|
-
11. sectionsOverrides - currently only for lists
|
|
480
|
-
|
|
481
|
-
- list
|
|
482
|
-
|
|
483
|
-
- titleOverrides: TitleOverrides (see below)
|
|
484
|
-
- descriptionOverrides: DescriptionOverrides (see below)
|
|
485
|
-
|
|
486
|
-
- TitleOverrides
|
|
487
|
-
|
|
488
|
-
- typographyPreset: MQ<string>
|
|
489
|
-
- stylePreset: MQ<string>
|
|
490
|
-
- spaceStack: MQ<string>
|
|
491
|
-
- as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'div' | 'span'
|
|
492
|
-
|
|
493
|
-
- DescriptionOverrides
|
|
494
|
-
- typographyPreset: MQ<string>
|
|
495
|
-
- stylePreset: MQ<string>
|
|
496
|
-
- spaceStack: MQ<string>
|
|
497
|
-
|
|
498
|
-
12. forms
|
|
499
|
-
|
|
500
|
-
- default?: FormContext (see below)
|
|
501
|
-
- password?: PasswordContext (see below)
|
|
502
|
-
- name?: FormContext
|
|
503
|
-
- 'display-name'?: FormContext
|
|
504
|
-
- email?: FormContext
|
|
505
|
-
- landline?: FormContext
|
|
506
|
-
- mobile?: FormContext
|
|
507
|
-
- payment?: FormContext
|
|
508
|
-
- address?: AddressFormContext (see below)
|
|
509
|
-
- 'commenting-notifications'?: CommentingNotificationsContext (see below)
|
|
510
|
-
- 'delivery-instructions'?: DeliveryInstructionsContext (see below)
|
|
511
|
-
- 'holiday-stops'?: HolidayStopContext (see below)
|
|
512
|
-
- FormContext
|
|
513
|
-
|
|
514
|
-
- header?: (see 4. header)
|
|
515
|
-
- props?: FormProps (see below)
|
|
516
|
-
|
|
517
|
-
- PasswordContext
|
|
518
|
-
|
|
519
|
-
- header?: (see 4. header)
|
|
520
|
-
- props?: FormProps (see below) &
|
|
521
|
-
- resendButtonGroupProps?: ButtonGroupProps (see below)
|
|
522
|
-
|
|
523
|
-
- FormProps
|
|
524
|
-
|
|
525
|
-
- text?: string[]
|
|
526
|
-
- textOverriders?:
|
|
527
|
-
- stylePreset?: MQ<string>
|
|
528
|
-
- typographyPreset?: MQ<string>
|
|
529
|
-
- spaceStack?: MQ<string>
|
|
530
|
-
- buttonGroupProps?: ButtonGroupProps (see below)
|
|
531
|
-
- inputText?: InputText (see below)
|
|
532
|
-
- listItems?: Array<ContentListItem> (see above)
|
|
533
|
-
- infoPanel?: InfoPanel (see below)
|
|
534
|
-
|
|
535
|
-
- InputText:
|
|
536
|
-
|
|
537
|
-
- labelProps?: Omit<LabelProps, 'children'> & (see Newskit for LabelProps)
|
|
538
|
-
- text?: string
|
|
539
|
-
- formInputTextFieldProps?: FormInputTextFieldProps (see Newskit for LabelProps)
|
|
540
|
-
- assistiveTextProps?: Omit<AssistiveTextProps, 'children'> &
|
|
541
|
-
- text?: string
|
|
542
|
-
- cells?: MQ<number>
|
|
543
|
-
- spaceStack?: MQ<string>
|
|
544
|
-
- stylePreset?: MQ<string>
|
|
545
|
-
- spaceInset?: MQ<string>
|
|
546
|
-
|
|
547
|
-
- InfoPanel: InlineMessageProps see Newkit &
|
|
548
|
-
|
|
549
|
-
- infoPanelCells?: MQ<number>
|
|
550
|
-
- spaceStack?: MQ<string>
|
|
551
|
-
|
|
552
|
-
- AddressFormContext
|
|
553
|
-
|
|
554
|
-
- header?: HeaderProps
|
|
555
|
-
- props?: FormProps &
|
|
556
|
-
- fullAddressInput?: InputText
|
|
557
|
-
- line1Input?: InputText
|
|
558
|
-
- line2Input?: InputText
|
|
559
|
-
- line3Input?: InputText
|
|
560
|
-
- line4Input?: InputText
|
|
561
|
-
- line5Input?: InputText
|
|
562
|
-
- line6Input?: InputText
|
|
563
|
-
- countryInput?: InputText &
|
|
564
|
-
- maxHight? string
|
|
565
|
-
|
|
566
|
-
- CommentingNotificationsContext
|
|
567
|
-
|
|
568
|
-
- header?: HeaderProps
|
|
569
|
-
- props?: FormProps &
|
|
570
|
-
- listItems?: Array<ContentListItem> (see above)
|
|
571
|
-
- text?: string[]
|
|
572
|
-
- ariaLabel?: string
|
|
573
|
-
|
|
574
|
-
- DeliveryInstructionsContext
|
|
575
|
-
- header?: HeaderProps
|
|
576
|
-
- props?: DeliveryInstructionsProps (see below)
|
|
577
|
-
- DeliveryInstructionsProps extends Omit<RadioFormProps, 'onSubmit'> (see below) &
|
|
578
|
-
|
|
579
|
-
- onSubmitURL?: string
|
|
580
|
-
|
|
581
|
-
- RadioFormProps
|
|
582
|
-
|
|
583
|
-
- onSubmit: (response: RadioFormResponse) => void (see below)
|
|
584
|
-
- introductionProps?: Omit<IntroductionProps, 'title' | 'titleOverrides'> (see above)
|
|
585
|
-
- radioInputList: RadioFormInput[] (see below)
|
|
586
|
-
- radioInputName?: string
|
|
587
|
-
- size?: 'small' | 'medium' | 'large'
|
|
588
|
-
- radioInputListOverrides?:
|
|
589
|
-
- typographyPreset?: MQ<string>
|
|
590
|
-
- spaceStack?: MQ<string>
|
|
591
|
-
- stylePreset?: string
|
|
592
|
-
- errorOverrides?:
|
|
593
|
-
- typographyPreset?:
|
|
594
|
-
- sm: string
|
|
595
|
-
- spaceStack?: MQ<string>
|
|
596
|
-
- stylePreset?: string
|
|
597
|
-
- spaceStack?: MQ<string>
|
|
598
|
-
- buttonGroupProps?: ButtonGroupProps
|
|
599
|
-
- introductionInlineMessage?: string
|
|
600
|
-
- introductionInlineMessageOverrides?: Omit<InlineMessageProps, 'children'> & {
|
|
601
|
-
- spaceStack?: MQ<string>
|
|
602
|
-
- gridProps?:
|
|
603
|
-
- xsMargin: string
|
|
604
|
-
- xsColumnGutter: string
|
|
605
|
-
- xsRowGutter: string
|
|
606
|
-
|
|
607
|
-
- RadioFormInput
|
|
608
|
-
|
|
609
|
-
- id: string
|
|
610
|
-
- text: string
|
|
611
|
-
- hasTextInput: boolean
|
|
612
|
-
- assistiveText?: string
|
|
613
|
-
- isDefaultValue?: boolean
|
|
614
|
-
- defaultTextInput?: string
|
|
615
|
-
|
|
616
|
-
- RadioFormResponse
|
|
617
|
-
|
|
618
|
-
- answer: string
|
|
619
|
-
- other?: string
|
|
620
|
-
|
|
621
|
-
- HolidayStopContext
|
|
622
|
-
|
|
623
|
-
- header?: HeaderProps
|
|
624
|
-
- props?: HolidayStopProps (see below)
|
|
625
|
-
|
|
626
|
-
- HolidayStopProps
|
|
627
|
-
|
|
628
|
-
- ButtonGroupProps: ButtonGroupProps (see below)
|
|
629
|
-
- introductionProps: Omit<IntroductionProps, 'title' | 'titleOverrides'>
|
|
630
|
-
- descriptionProps: Omit<IntroductionProps, 'title' | 'titleOverrides'>
|
|
631
|
-
- contextName: ContextName
|
|
632
|
-
- holidayStopModalProps : holidayStopModalProps (see below)
|
|
633
|
-
|
|
634
|
-
- holidayStopModalProps
|
|
635
|
-
- closePosition: 'left' | 'right' | 'none'
|
|
636
|
-
- open : boolean
|
|
637
|
-
- introduction : IntroductionProps
|
|
638
|
-
- buttonGroup : ButtonGroupProps (see below)
|
|
639
|
-
- overrides:
|
|
640
|
-
- content:
|
|
641
|
-
- spaceInset?: MQ<string>
|
|
642
|
-
- redirectUrl: string
|
|
643
|
-
|
|
644
|
-
12. cancellation
|
|
645
|
-
|
|
646
|
-
- reason: Partial<CancellationContext> (see below)
|
|
647
|
-
- confirm: Partial<CancellationContext>
|
|
648
|
-
|
|
649
|
-
- CancellationContext
|
|
650
|
-
|
|
651
|
-
- header?: HeaderProps
|
|
652
|
-
- props?: CancellationReasonProps | ConfirmCancellationProps (see below)
|
|
653
|
-
|
|
654
|
-
- CancellationReasonProps
|
|
655
|
-
|
|
656
|
-
- cancellationDescription?: Omit<IntroductionProps, 'title' | 'titleOverrides'>
|
|
657
|
-
- cancellationList?: RadioFormInput[] (see above)
|
|
658
|
-
- validation?: DefaultSchemaKeysType | OverrideYupSchemaType (see validation package)
|
|
659
|
-
- cancellationObjectOverrides?:
|
|
660
|
-
- typographyPreset?: MQ<string>
|
|
661
|
-
- spaceStack?: MQ<string>
|
|
662
|
-
- stylePreset?: string
|
|
663
|
-
- cancellationErrorObjectOverrides?:
|
|
664
|
-
- typographyPreset?:
|
|
665
|
-
- sm: string
|
|
666
|
-
- spaceStack?: MQ<string>
|
|
667
|
-
- stylePreset?: string
|
|
668
|
-
}
|
|
669
|
-
- spaceStack?: MQ<string>
|
|
670
|
-
- buttonGroupProps?: Omit<ButtonGroupProps, 'loading'>
|
|
671
|
-
- message?: string
|
|
672
|
-
- messageOverrides?: Omit<InlineMessageProps, 'children'> & {
|
|
673
|
-
- spaceStack?: MQ<string>
|
|
674
|
-
|
|
675
|
-
- ConfirmCancellationProps
|
|
676
|
-
|
|
677
|
-
- listProps?: UnorderedListProps (see Newskit)
|
|
678
|
-
- children?: string[]
|
|
679
|
-
- buttonGroupProps?: ButtonGroupProps (see below) omits hasError
|
|
680
|
-
- listHeader?: string
|
|
681
|
-
- validation?: Record<string, any>
|
|
682
|
-
- confirmationModal?: CancelModalProps (see below)
|
|
683
|
-
|
|
684
|
-
- CancelModalProps
|
|
685
|
-
- title: string
|
|
686
|
-
- href: string
|
|
687
|
-
- text?: string[]
|
|
688
|
-
- expirationDate?: string
|
|
689
|
-
- message?: string
|
|
690
|
-
- buttonText?: string
|
|
691
|
-
- overrides?: {
|
|
692
|
-
- title?: Omit<TextBlockProps, 'children'> &
|
|
693
|
-
- spaceStack?: MQ<string>
|
|
694
|
-
- text?: Omit<TextBlockProps, 'children'> &
|
|
695
|
-
- spaceStack?: MQ<string>
|
|
696
|
-
- message?: Omit<InlineMessageProps, 'children'> &
|
|
697
|
-
- spaceStack?: MQ<string>
|
|
698
|
-
- button?: Omit<ButtonLinkProps, 'children' | 'href'>
|
|
699
|
-
}
|
|
700
|
-
onDismiss?: () => void
|
|
701
|
-
|
|
702
|
-
13. footer: - Global property
|
|
703
|
-
|
|
704
|
-
- menuItemArray - Array of menu items
|
|
705
|
-
- text: string
|
|
706
|
-
- href: string
|
|
707
|
-
- id: string | number
|
|
708
|
-
- legalText: string
|
|
709
|
-
|
|
710
|
-
14. footerOverides: - Global property
|
|
711
|
-
|
|
712
|
-
- ariaLabel: string
|
|
713
|
-
- menuItemHorizontalOverrides: menuItemOverrides (see below)
|
|
714
|
-
- menuItemVerticalOverrides: menuItemOverrides (see below)
|
|
715
|
-
- menuOverrides:
|
|
716
|
-
- spaceStack: MQ<string>
|
|
717
|
-
- backgroundColor: string
|
|
718
|
-
- borderColor: string
|
|
719
|
-
- padding:
|
|
720
|
-
- xs: string
|
|
721
|
-
- md: string
|
|
722
|
-
- legalTextOverrides:
|
|
723
|
-
|
|
724
|
-
- spaceStack?: MQ<string>
|
|
725
|
-
- stylePreset?: MQ<string>
|
|
726
|
-
- typographyPreset: MQ<string>
|
|
727
|
-
- padding:
|
|
728
|
-
- xs: string
|
|
729
|
-
- md: string
|
|
730
|
-
|
|
731
|
-
- menuItemOverrides:
|
|
732
|
-
- stylePreset: MQ<string>
|
|
733
|
-
- typographyPreset: MQ<string>
|
|
734
|
-
- spaceInset: MQ<string>
|
|
735
|
-
|
|
736
|
-
15. baseUrl: string - change if your not sticking to default routing set up in Core. Currently set as `/account` but will need to be changes if you change `pages/account` file structure in Core.
|
|
737
|
-
|
|
738
|
-
16. ButtonGroupProps (override all here or individually by form)
|
|
739
|
-
|
|
740
|
-
- primaryText?: string
|
|
741
|
-
- secondaryText?: string
|
|
742
|
-
- primaryButton?: ButtonProps (see below)
|
|
743
|
-
- secondaryButton?: ButtonProps
|
|
744
|
-
- primaryCell?: CellProps see NewsKit
|
|
745
|
-
- secondaryCell?: CellProps
|
|
746
|
-
- hasError: boolean
|
|
747
|
-
- secureFlag?: SecureFlagProps (see below) &
|
|
748
|
-
- spaceStack?: MQ<string>
|
|
749
|
-
- keepFixed?: boolean
|
|
750
|
-
- stylePreset?: MQ<string>
|
|
751
|
-
- spaceStack?: MQ<string>
|
|
752
|
-
|
|
753
|
-
> The ButtonGroup uses custom stylePresets `buttonGroupXs buttonGroupSm` see [here](https://github.com/newscorp-ghfb/ncu-newskit-render/blob/master/packages/my-account/src/theme/index.ts)
|
|
754
|
-
|
|
755
|
-
- ButtonProps extend Newskit ButtonProps &
|
|
756
|
-
|
|
757
|
-
- ariaLabel?: string
|
|
758
|
-
- href?: string
|
|
759
|
-
- onClick?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void
|
|
760
|
-
|
|
761
|
-
- SecureFlagProps extends Newskit FlagProps &
|
|
762
|
-
|
|
763
|
-
- iconOverrides?:
|
|
764
|
-
- spaceInset?: MQ<string>
|
|
765
|
-
- spaceInline?: MQ<string>
|
|
766
|
-
- size?: MQ<string>
|
|
767
|
-
- stylePreset?: MQ<string>
|
|
768
|
-
- icon?: ReactElement<NewsKitIcon>
|
|
769
|
-
|
|
770
|
-
17. zuoraCustomErrorMessages?: see Payment section
|
|
771
|
-
|
|
772
|
-
18. noSubscription?: NoSubscriptionProps (see below)
|
|
773
|
-
19. previousSubscription?: NoSubscriptionProps
|
|
774
|
-
|
|
775
|
-
- NoSubscriptionProps
|
|
776
|
-
- header?: HeaderProps
|
|
777
|
-
- buttonGroupProps?: ButtonGroupProps
|
|
778
|
-
|
|
779
|
-
20. outsideDeliveryAddressModal? : Modal to be shown when subscription type is either Print or Digi-Print and postcode is outside the delivery area
|
|
780
|
-
|
|
781
|
-
- closePosition:string
|
|
782
|
-
- open:boolean
|
|
783
|
-
- overrides:
|
|
784
|
-
- content?:
|
|
785
|
-
- spaceInset?: MQ<string>
|
|
786
|
-
- panel:
|
|
787
|
-
- width:MQ<string>
|
|
788
|
-
- height:MQ<string>
|
|
789
|
-
- introductionProps: IntroductionProps
|
|
790
|
-
- title: string
|
|
791
|
-
- titleOverrides: TitleOverrides
|
|
792
|
-
- description: string
|
|
793
|
-
- descriptionOverrides: DescriptionOverrides
|
|
794
|
-
- modalLink :
|
|
795
|
-
- links : Array<{
|
|
796
|
-
- href : string
|
|
797
|
-
- type : string
|
|
798
|
-
- text : string
|
|
799
|
-
}>
|
|
800
|
-
- introductionProps: IntroductionProps
|
|
801
|
-
- title: string
|
|
802
|
-
- titleOverrides: TitleOverrides
|
|
803
|
-
- description: string
|
|
804
|
-
- descriptionOverrides: DescriptionOverrides
|
|
805
|
-
- buttonGroupProps: ButtonGroupProps
|
|
806
|
-
- redirectUrl : string - change if your not sticking to default routing set up in Core. Currently set as `/account/subscription-and-billing` but will need to be changes if you change `pages/account/subscription-and-billing` file structure in Core
|
|
807
|
-
|
|
808
|
-
## Address Form - Loqate
|
|
364
|
+
For more details, [see below](#type-descriptions)
|
|
809
365
|
|
|
810
|
-
|
|
366
|
+
### **Properties of ContextOptions**
|
|
811
367
|
|
|
812
|
-
|
|
368
|
+
#### 1. `data` - Do not touch - this will be overriden in my-account.
|
|
813
369
|
|
|
814
|
-
|
|
370
|
+
#### 2. `userData` - Do not touch - this will be overriden in my-account.
|
|
815
371
|
|
|
816
|
-
|
|
372
|
+
#### 3. `head` - currently lets you override the title tag of the page:
|
|
817
373
|
|
|
818
374
|
```
|
|
819
|
-
|
|
820
|
-
|
|
375
|
+
head: {
|
|
376
|
+
pageTitle: string,
|
|
377
|
+
siteTitle: string | false
|
|
378
|
+
}
|
|
379
|
+
```
|
|
821
380
|
|
|
822
|
-
|
|
381
|
+
#### 4. `navigationPrimary` - Global property that changes the nav links in the top-banner area - an Array of nav objects or false to have no nav:
|
|
823
382
|
|
|
824
|
-
export default Page
|
|
825
383
|
```
|
|
384
|
+
navigationPrimary: {
|
|
385
|
+
nav?: {
|
|
386
|
+
text: string
|
|
387
|
+
link: string
|
|
388
|
+
icon: React.ReactElement<NewsKitIconProps>
|
|
389
|
+
ariaLabel?: string
|
|
390
|
+
},
|
|
391
|
+
title?: string,
|
|
392
|
+
logoSrc?: string, // path to logo.svg
|
|
393
|
+
logoWidth?: string, // width of logo
|
|
394
|
+
titlePosition?: string, // uses css top property to ajust title position
|
|
395
|
+
}
|
|
826
396
|
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
In the Password reset page, you can customize the lifetime of the password reset link. The time will be shown in the inline message to the users and will also indicate how long until the inline message is no longer shown.
|
|
397
|
+
```
|
|
830
398
|
|
|
831
|
-
|
|
399
|
+
#### 5. `sideNav` - Global property that changes sidebar navigation - an Array of nav objects:
|
|
832
400
|
|
|
833
401
|
```
|
|
834
|
-
|
|
402
|
+
sideNav: [
|
|
403
|
+
{
|
|
404
|
+
text: string,
|
|
405
|
+
href: string,
|
|
406
|
+
id: string,
|
|
407
|
+
}
|
|
408
|
+
]
|
|
835
409
|
```
|
|
836
410
|
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
## Past Due Banner
|
|
840
|
-
|
|
841
|
-
The Past Due Banner has been move into [@newskit-render/shared-components](https://github.com/newscorp-ghfb/ncu-newskit-render/tree/master/packages/shared-components)
|
|
411
|
+
#### 6. `sideNavSelected : string` - The Id of the selected sideNav
|
|
842
412
|
|
|
843
|
-
|
|
413
|
+
#### 7. `sideNavOverrides` - The styling ovderrides, applied to the sideNav:
|
|
844
414
|
|
|
845
415
|
```
|
|
846
|
-
|
|
416
|
+
sideNavOverrides: {
|
|
417
|
+
menuItemOverrides: {
|
|
418
|
+
stylePreset: MQ<string>,
|
|
419
|
+
typographyPreset: MQ<string>,
|
|
420
|
+
spaceInset: MQ<string>,
|
|
421
|
+
},
|
|
422
|
+
backgroundColor: string,
|
|
423
|
+
}
|
|
847
424
|
|
|
848
|
-
<PastDueBannerExternal
|
|
849
|
-
pastDueBanner={pastDueBanner}
|
|
850
|
-
user={user}
|
|
851
|
-
wrapper={BannerContainer}
|
|
852
|
-
/>
|
|
853
425
|
```
|
|
854
426
|
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
- className?: string
|
|
858
|
-
- pastDueBanner?: PastDueBanner
|
|
859
|
-
- user: UserData
|
|
860
|
-
- wrapper?: React.ComponentType
|
|
861
|
-
- theme?: UncompiledTheme
|
|
862
|
-
|
|
863
|
-
The pastDueBanner props must be in the following format (the default one). If you do not provide context, the following will be used
|
|
427
|
+
#### 8. `pastDueBanner` - Banner displayed when your subscription is passed due. If not provided, the following default will be used:
|
|
864
428
|
|
|
865
429
|
```
|
|
866
|
-
|
|
430
|
+
pastDueBanner: {
|
|
867
431
|
firstNotice: {
|
|
868
432
|
title: "We haven't been able to take payment",
|
|
869
433
|
text:
|
|
@@ -880,8 +444,12 @@ const pastDueBanner = {
|
|
|
880
444
|
title: 'Your subscription has been terminated',
|
|
881
445
|
phoneNumber: 'XXXX-XXX-XXXX',
|
|
882
446
|
text:
|
|
883
|
-
'We didn’t receive payment for your subscription. To reactivate it, please call ##PHONE_NUMBER##.',
|
|
447
|
+
'We didn’t receive payment for your subscription. To reactivate it, please call ##PHONE_NUMBER##. Or click ##LINK##.',
|
|
884
448
|
dismissDays: 7,
|
|
449
|
+
link: {
|
|
450
|
+
linkLocation: 'http://localhost:3000/account',
|
|
451
|
+
linkText: 'here',
|
|
452
|
+
},
|
|
885
453
|
},
|
|
886
454
|
cancelled: {
|
|
887
455
|
title: 'Your subscription has been cancelled.',
|
|
@@ -896,6 +464,13 @@ const pastDueBanner = {
|
|
|
896
464
|
text:
|
|
897
465
|
'You have cancelled your subscription and will lose access to all benefits on ##DATE##. To re-activate your subscription call ##PHONE_NUMBER##.',
|
|
898
466
|
},
|
|
467
|
+
toBeCancelledWithRefund: {
|
|
468
|
+
title: 'Your subscription will end soon.',
|
|
469
|
+
phoneNumber: '0800 xxxx xxxxx',
|
|
470
|
+
text:
|
|
471
|
+
'We have successfully cancelled your subscription and will be processing your refund shortly. If you have any question please call ##PHONE_NUMBER##.',
|
|
472
|
+
dismissDays: 7,
|
|
473
|
+
},
|
|
899
474
|
treshold: {
|
|
900
475
|
firstNotice: 26,
|
|
901
476
|
secondNotice: 30,
|
|
@@ -903,6 +478,289 @@ const pastDueBanner = {
|
|
|
903
478
|
}
|
|
904
479
|
```
|
|
905
480
|
|
|
481
|
+
Banner messages indicate different states of the subscription:
|
|
482
|
+
|
|
483
|
+
- firstNotice: - Banner when the subscription past due is below first threshold
|
|
484
|
+
- secondNotice: - Banner when the subscription past due is above than first threshold, but below that second threshold
|
|
485
|
+
- terminated: Banner when the subscription past due is above the second threshold
|
|
486
|
+
- toBeCancelled: Banner shown when user has cancelled their subscription but before end of billing cycle
|
|
487
|
+
- cancelled: Banner shown when user has cancelled their subscription and is after end of billing cycle
|
|
488
|
+
Banner thresholds are are numbers, representing a number of days since the last payment. They are used to calculate when to show the first and the second banner message.
|
|
489
|
+
|
|
490
|
+
A link to all the banner's defaults and typ[es can be found [here](#type-descriptions)
|
|
491
|
+
|
|
492
|
+
> The pastDueBanner uses some custom stylePreset `PastDueFirstNotice PastDueLastNotice UpdatePaymentButton` see [here](https://github.com/newscorp-ghfb/ncu-newskit-render/blob/master/packages/shared-components/src/theme/sharedTheme/stylePresets.ts)
|
|
493
|
+
|
|
494
|
+
#### 9. header - Changes Page header
|
|
495
|
+
|
|
496
|
+
```
|
|
497
|
+
header: {
|
|
498
|
+
title: string,
|
|
499
|
+
titleOverrides: TitleOverrides,
|
|
500
|
+
fullWidthTitle: boolean,
|
|
501
|
+
description: string,
|
|
502
|
+
descriptionOverrides: DescriptionOverrides,
|
|
503
|
+
backButton: {
|
|
504
|
+
href: string
|
|
505
|
+
'aria-label': string
|
|
506
|
+
text: string
|
|
507
|
+
}
|
|
508
|
+
backButtonOverrides: {
|
|
509
|
+
stylePreset: MQ<string>
|
|
510
|
+
typographyPreset: MQ<string>
|
|
511
|
+
spaceInset: MQ<string>
|
|
512
|
+
spaceStack: MQ<string>
|
|
513
|
+
iconSize: MQ<string>
|
|
514
|
+
size: 'small' | 'medium' | 'large'
|
|
515
|
+
asLink: boolean, // (will render as LinkStandalone not Button)
|
|
516
|
+
},
|
|
517
|
+
|
|
518
|
+
image: ImageProps,
|
|
519
|
+
spaceStack: MQ<string>,
|
|
520
|
+
showDivider: boolean,
|
|
521
|
+
imageCell?: CellProps, //CellProps see NewsKit (can be used to change order of items)
|
|
522
|
+
introductionCell?: CellProps,
|
|
523
|
+
backButtonCell?: CellProps,
|
|
524
|
+
}
|
|
525
|
+
```
|
|
526
|
+
|
|
527
|
+
#### 10. `sections` - an Array of section items:
|
|
528
|
+
|
|
529
|
+
```
|
|
530
|
+
sections: {
|
|
531
|
+
type: SectionType,
|
|
532
|
+
componentType: string, // currently only 'list'
|
|
533
|
+
props: ContentContainerProps
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
```
|
|
537
|
+
|
|
538
|
+
For all the sub-types, see the explanation [here](#type-descriptions)
|
|
539
|
+
|
|
540
|
+
> The ContentListItem uses some custom stylePresets `baseInteractivePrimary030 contentListView` see [here](https://github.com/newscorp-ghfb/ncu-newskit-render/blob/master/packages/shared-components/src/theme/sharedTheme/stylePresets.ts)
|
|
541
|
+
|
|
542
|
+
#### 11. `sectionsOverrides` - currently only for lists:
|
|
543
|
+
|
|
544
|
+
```
|
|
545
|
+
sectionsOverrides?: {
|
|
546
|
+
list: {
|
|
547
|
+
titleOverrides?: TitleOverrides
|
|
548
|
+
descriptionOverrides?: DescriptionOverrides
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
```
|
|
552
|
+
|
|
553
|
+
For all the sub-types, see the explanation [here](#type-descriptions)
|
|
554
|
+
|
|
555
|
+
#### 12. `forms` - we use forms in the edit pages. Contexts differ between forms. Currently we support the following options for forms and their corresponding contexts:
|
|
556
|
+
|
|
557
|
+
```
|
|
558
|
+
form: {
|
|
559
|
+
default?: FormContext,
|
|
560
|
+
password?: PasswordContext,
|
|
561
|
+
name?: FormContext,
|
|
562
|
+
'display-name'?: FormContext,
|
|
563
|
+
email?: FormContext,
|
|
564
|
+
landline?: FormContext,
|
|
565
|
+
mobile?: FormContext,
|
|
566
|
+
payment?: FormContext,
|
|
567
|
+
address?: AddressFormContext,
|
|
568
|
+
'commenting-notifications'?: CommentingNotificationsContext,
|
|
569
|
+
'delivery-instructions'?: DeliveryInstructionsContext,
|
|
570
|
+
'holiday-stops'?: HolidayStopContext,
|
|
571
|
+
}
|
|
572
|
+
```
|
|
573
|
+
|
|
574
|
+
For all the context types, [see below](#type-descriptions)
|
|
575
|
+
|
|
576
|
+
#### 13. `cancellation` - subscription cancellation:
|
|
577
|
+
|
|
578
|
+
```
|
|
579
|
+
cancellation: {
|
|
580
|
+
reason: Partial<CancellationContext>
|
|
581
|
+
confirm: Partial<CancellationContext>
|
|
582
|
+
}
|
|
583
|
+
```
|
|
584
|
+
|
|
585
|
+
For all the context types, [see below](#type-descriptions)
|
|
586
|
+
|
|
587
|
+
#### 14. `footer` - Global property
|
|
588
|
+
|
|
589
|
+
```
|
|
590
|
+
cons footer:FooterContext = {
|
|
591
|
+
menuItemArray: [
|
|
592
|
+
{
|
|
593
|
+
text: string,
|
|
594
|
+
href: string,
|
|
595
|
+
id: string | number,
|
|
596
|
+
}
|
|
597
|
+
],
|
|
598
|
+
legalText: string
|
|
599
|
+
}
|
|
600
|
+
```
|
|
601
|
+
|
|
602
|
+
For more about the FooterContext type, [see below](#type-descriptions)
|
|
603
|
+
|
|
604
|
+
#### 15. footerOverides: - Global property.
|
|
605
|
+
|
|
606
|
+
Used to override the styling of the footer menu items, chat help (if any) and the legal text.
|
|
607
|
+
|
|
608
|
+
```
|
|
609
|
+
footerOverrides: FooterContextOverrides
|
|
610
|
+
```
|
|
611
|
+
|
|
612
|
+
For more details, [see below](#type-descriptions)
|
|
613
|
+
|
|
614
|
+
#### 16. `baseUrl: string` - change if you are not going to stick to the default routing set up in the `core` package. Currently set as `/account` but will need to be changes if you change `pages/account` file structure in `core`.
|
|
615
|
+
|
|
616
|
+
#### 17. `buttonGroupProps` - (override all here or individually by form)
|
|
617
|
+
|
|
618
|
+
```
|
|
619
|
+
buttonGroupProps {
|
|
620
|
+
loading?: boolean
|
|
621
|
+
secureFlag?: boolean
|
|
622
|
+
secureFlagOverrides?: SecureFlagProps
|
|
623
|
+
primaryButton?: ButtonProps
|
|
624
|
+
secondaryButton?: ButtonProps
|
|
625
|
+
stylePreset?: MQ<string>
|
|
626
|
+
keepFixed?: boolean
|
|
627
|
+
breakPoint?: BreakpointKeys
|
|
628
|
+
}
|
|
629
|
+
```
|
|
630
|
+
|
|
631
|
+
For more details about the ButtonGroupProps type, [see below](#type-descriptions)
|
|
632
|
+
|
|
633
|
+
> The ButtonGroup uses custom stylePresets `buttonGroupXs buttonGroupSm` see [here](https://github.com/newscorp-ghfb/ncu-newskit-render/blob/master/packages/shared-components/src/ButtonGroup/presets.ts)
|
|
634
|
+
|
|
635
|
+
#### 18. `zuoraCustomErrorMessages?:` see [Payment section](#payment)
|
|
636
|
+
|
|
637
|
+
#### 19. `noSubscription?:` SubscriptionStatusProps ([see below](#nosubscriptionprops))
|
|
638
|
+
|
|
639
|
+
#### 20. `previousSubscription?:` SubscriptionStatusProps
|
|
640
|
+
|
|
641
|
+
```
|
|
642
|
+
interface SubscriptionStatusProps {
|
|
643
|
+
header?: HeaderProps
|
|
644
|
+
buttonGroupProps?: Partial<ButtonGroupProps>
|
|
645
|
+
}
|
|
646
|
+
```
|
|
647
|
+
|
|
648
|
+
For more on the SubscriptionStatusProps, [see below](#type-descriptions)
|
|
649
|
+
|
|
650
|
+
#### 21. `outsideDeliveryAddressModal`
|
|
651
|
+
|
|
652
|
+
Modal to be shown when subscription type is either Print or Digi-Print and postcode is outside the delivery area.
|
|
653
|
+
Currently it looks like this:
|
|
654
|
+
|
|
655
|
+
```
|
|
656
|
+
outsideDeliveryAddressModal?: {
|
|
657
|
+
closePosition:string
|
|
658
|
+
open:boolean
|
|
659
|
+
overrides:
|
|
660
|
+
content?:
|
|
661
|
+
spaceInset?: MQ<string>
|
|
662
|
+
panel:
|
|
663
|
+
width:MQ<string>
|
|
664
|
+
height:MQ<string>
|
|
665
|
+
introductionProps: IntroductionProps
|
|
666
|
+
title: string
|
|
667
|
+
titleOverrides: TitleOverrides
|
|
668
|
+
description: string
|
|
669
|
+
descriptionOverrides: DescriptionOverrides
|
|
670
|
+
modalLink :
|
|
671
|
+
links : Array<{
|
|
672
|
+
href : string
|
|
673
|
+
type : string
|
|
674
|
+
text : string
|
|
675
|
+
}>
|
|
676
|
+
introductionProps: IntroductionProps
|
|
677
|
+
title: string
|
|
678
|
+
titleOverrides: TitleOverrides
|
|
679
|
+
description: string
|
|
680
|
+
descriptionOverrides: DescriptionOverrides
|
|
681
|
+
buttonGroupProps: ButtonGroupProps
|
|
682
|
+
redirectUrl : string
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
```
|
|
686
|
+
|
|
687
|
+
It is a part of EditFieldContextOptions, which you can [see below](#type-descriptions)
|
|
688
|
+
|
|
689
|
+
Change `redirectUrl` if you are not sticking to the default routing set up in the Core package. Currently set as `/account/subscription-and-billing` but will need to be changes if you change `pages/account/subscription-and-billing` file structure in the Core package.
|
|
690
|
+
|
|
691
|
+
## Address Form - Loqate
|
|
692
|
+
|
|
693
|
+
The Address form uses [Loqate](https://www.loqate.com/en-gb/) to add address lookup functionality. For it to work you need to add LOQACCOUNT_KEY to your CircleCi context.
|
|
694
|
+
|
|
695
|
+
To get the LOQACCOUNT_KEY please speak to the Solutions team.
|
|
696
|
+
|
|
697
|
+
## Update Preference centre link
|
|
698
|
+
|
|
699
|
+
You can update the link to the Preference centre using the context. Example:
|
|
700
|
+
|
|
701
|
+
```
|
|
702
|
+
const overrideContext: ContextOptions = NewslettersAndAlertsContext;
|
|
703
|
+
(overrideContext.sections[0].props as ContentListViewProps).items[2].href = 'https://mypreferences.the-tls.co.uk/login'
|
|
704
|
+
|
|
705
|
+
const Page = (props) => <NewslettersAndAlerts context={overrideContext} {...props} />
|
|
706
|
+
|
|
707
|
+
export default Page
|
|
708
|
+
```
|
|
709
|
+
|
|
710
|
+
## Reset password expiration
|
|
711
|
+
|
|
712
|
+
In the Password reset page, you can customize the lifetime of the password reset link. The time will be shown in the inline message to the users and will also indicate how long until the inline message is no longer shown.
|
|
713
|
+
|
|
714
|
+
To set a time, add the following row to your .env.local. Value is in seconds.
|
|
715
|
+
|
|
716
|
+
```
|
|
717
|
+
PASSWORD_URL_LIFETIME=900
|
|
718
|
+
```
|
|
719
|
+
|
|
720
|
+
If this is not set, the default value will be 900 seconds (15 minutes).
|
|
721
|
+
|
|
722
|
+
## Past Due Banner
|
|
723
|
+
|
|
724
|
+
The Past Due Banner has been moved into [@newskit-render/shared-components](https://github.com/newscorp-ghfb/ncu-newskit-render/tree/master/packages/shared-components)
|
|
725
|
+
|
|
726
|
+
The Past Due Banner is an exported Component, which can be rendered anywhere. Just import the Component and use it in a React application:
|
|
727
|
+
|
|
728
|
+
```
|
|
729
|
+
import { PastDueBannerExternal } from '@newskit-render/shared-components'
|
|
730
|
+
|
|
731
|
+
<PastDueBannerExternal
|
|
732
|
+
pastDueBanner={pastDueBanner}
|
|
733
|
+
user={user}
|
|
734
|
+
wrapper={BannerContainer}
|
|
735
|
+
/>
|
|
736
|
+
|
|
737
|
+
Props: {
|
|
738
|
+
className?: string
|
|
739
|
+
pastDueBanner?: PastDueBannerType
|
|
740
|
+
user: UserData
|
|
741
|
+
wrapper?: React.ComponentType
|
|
742
|
+
theme?: UncompiledTheme
|
|
743
|
+
}
|
|
744
|
+
```
|
|
745
|
+
|
|
746
|
+
The pastDueBanner prop must be in the following format:
|
|
747
|
+
|
|
748
|
+
```
|
|
749
|
+
interface PastDueBannerType {
|
|
750
|
+
firstNotice: Notice
|
|
751
|
+
secondNotice: Notice
|
|
752
|
+
terminated: Notice
|
|
753
|
+
toBeCancelled: Notice
|
|
754
|
+
toBeCancelledWithRefund: Notice
|
|
755
|
+
cancelled: Notice
|
|
756
|
+
treshold: PastDueBannerTreshold
|
|
757
|
+
}
|
|
758
|
+
```
|
|
759
|
+
|
|
760
|
+
For `Notice` and `PastDueBannerTreshold`, [see below](#type-descriptions)
|
|
761
|
+
|
|
762
|
+
> If past due banner context is not provied, the component will use it's [default context](#8-pastduebanner---banner-displayed-when-your-subscription-is-passed-due-if-not-provided-the-following-default-will-be-used)!
|
|
763
|
+
|
|
906
764
|
For the user prop we are expecting information from MAIN API user:
|
|
907
765
|
Example:
|
|
908
766
|
|
|
@@ -958,19 +816,22 @@ ZUORA_RSA_SIGNATURE_URI - Please check (https://knowledgecenter.zuora.com/Billin
|
|
|
958
816
|
|
|
959
817
|
Zoura's validation error messages can be overriden in the context:
|
|
960
818
|
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
819
|
+
```
|
|
820
|
+
zuoraCustomErrorMessages?: {
|
|
821
|
+
creditCardHolderName: string
|
|
822
|
+
creditCardNumber:
|
|
823
|
+
one: string
|
|
824
|
+
two: string
|
|
825
|
+
three: string
|
|
826
|
+
cardSecurityCode:
|
|
827
|
+
one: string
|
|
828
|
+
four: string
|
|
829
|
+
creditCardExpiration: string
|
|
830
|
+
creditCardPostalCode: string
|
|
831
|
+
creditCardCountry: string
|
|
832
|
+
unknownError: string
|
|
833
|
+
}
|
|
834
|
+
```
|
|
974
835
|
|
|
975
836
|
These correspond to Zoura's retured error code:
|
|
976
837
|
001: Required field not completed - detault for single property or one
|
|
@@ -978,8 +839,8 @@ These correspond to Zoura's retured error code:
|
|
|
978
839
|
003: Invalid card type - three
|
|
979
840
|
004: Invalid CVV number - four
|
|
980
841
|
|
|
981
|
-
unknownError: when the error received from Zuora does not have any code or other identifier. Give this field a meaningful value, as it will be shown to the user in some cases.
|
|
982
|
-
|
|
842
|
+
unknownError: when the error received from Zuora does not have any code or other identifier. Give this field a meaningful value, as it will be shown to the user in some cases.
|
|
843
|
+
[Back to](#18-zuoracustomerrormessages-see-payment-section)
|
|
983
844
|
|
|
984
845
|
## Book a Holiday Stop
|
|
985
846
|
|
|
@@ -1116,3 +977,41 @@ export const holidayStopContext: HolidayStopContextOptions = {
|
|
|
1116
977
|
},
|
|
1117
978
|
}
|
|
1118
979
|
```
|
|
980
|
+
|
|
981
|
+
## Type descriptions
|
|
982
|
+
|
|
983
|
+
1. [ContentContainerProps](https://github.com/newscorp-ghfb/ncu-newskit-render/blob/master/packages/my-account/src/Components/Sections/ContentContainer/types.ts) go back to [sections](#10-sections---an-array-of-section-items)
|
|
984
|
+
|
|
985
|
+
2. [Forms' contexts](https://github.com/newscorp-ghfb/ncu-newskit-render/blob/master/packages/my-account/src/context/types.ts) go back to [forms](#12-forms---we-use-forms-in-the-edit-pages-contexts-differ-between-forms-currently-we-support-the-following-options-for-forms-and-their-corresponding-contexts)
|
|
986
|
+
|
|
987
|
+
3. [CancellationReasonProps](https://github.com/newscorp-ghfb/ncu-newskit-render/blob/master/packages/my-account/src/Components/Sections/Form/CancellationReason/types.ts). back to [cancellation](#13-cancellation---subscription-cancellation)
|
|
988
|
+
|
|
989
|
+
4. [ConfirmCancellationProps](https://github.com/newscorp-ghfb/ncu-newskit-render/blob/master/packages/my-account/src/Components/Sections/Form/ConfirmCancellation/types.ts) back to [cancellation](#13-cancellation---subscription-cancellation)
|
|
990
|
+
|
|
991
|
+
5. [SubscriptionStatusProps](https://github.com/newscorp-ghfb/ncu-newskit-render/blob/master/packages/my-account/src/Components/Sections/NoSubscription/types.ts) back to [noSubscription](#19-nosubscription-subscriptionstatusprops-see-below)
|
|
992
|
+
|
|
993
|
+
6. [EditFieldContextOptions](https://github.com/newscorp-ghfb/ncu-newskit-render/blob/master/packages/my-account/src/context/types.ts) go back to [outsideDeliveryAddressModal](#21-outsidedeliveryaddressmodal)
|
|
994
|
+
|
|
995
|
+
7. The full descriptions of all other types mentioned can be found [here](https://github.com/newscorp-ghfb/ncu-newskit-render/blob/master/packages/shared-components/README.md) as they are exported from there.
|
|
996
|
+
|
|
997
|
+
Go back to:</br>
|
|
998
|
+
[Override Page's Header](#1-override-the-pages-header-description-and-list-items-title-styles)</br>
|
|
999
|
+
[Override Page's sections](#2-override-the-sections-on-the-page)</br>
|
|
1000
|
+
[Add on to the existing sections](#3-add-onto-the-existing-sections)</br>
|
|
1001
|
+
[PastDueBanner how to use](#past-due-banner)</br>
|
|
1002
|
+
[Payment how to use](#payment)</br>
|
|
1003
|
+
[Properties of Context Options](#properties-of-contextoptions)</br>
|
|
1004
|
+
|
|
1005
|
+
- [navigationPrimary context option](#4-navigationprimary---global-property-that-changes-the-nav-links-in-the-top-banner-area---an-array-of-nav-objects-or-false-to-have-no-nav)</br>
|
|
1006
|
+
- [sideNav context option](#5-sidenav---global-property-that-changes-sidebar-navigation---an-array-of-nav-objects)</br>
|
|
1007
|
+
- [pastDueBanner context option](#8-pastduebanner---banner-displayed-when-your-subscription-is-passed-due-if-not-provided-the-following-default-will-be-used)</br>
|
|
1008
|
+
- [header context option](#9-header---changes-page-header)</br>
|
|
1009
|
+
- [sections context option](#10-sections---an-array-of-section-items)</br>
|
|
1010
|
+
- [forms context option](#12-forms---we-use-forms-in-the-edit-pages-contexts-differ-between-forms-currently-we-support-the-following-options-for-forms-and-their-corresponding-contexts)</br>
|
|
1011
|
+
- [cancellation context option](#13-cancellation---subscription-cancellation)</br>
|
|
1012
|
+
- [footer context option](#14-footer---global-property)</br>
|
|
1013
|
+
- [baseUrl context option](#16-baseurl-string---change-if-you-are-not-going-to-stick-to-the-default-routing-set-up-in-the-core-package-currently-set-as-account-but-will-need-to-be-changes-if-you-change-pagesaccount-file-structure-in-core)</br>
|
|
1014
|
+
- [buttonGroupProps context option](#17-buttongroupprops---override-all-here-or-individually-by-form)</br>
|
|
1015
|
+
- [zuoraCustomErrorMessages](#18-zuoracustomerrormessages-see-payment-section)</br>
|
|
1016
|
+
- [noSubscription/previousSubscription context options](#19-nosubscription-subscriptionstatusprops-see-below)</br>
|
|
1017
|
+
- [outsideDeliveryAddressModal context option](#21-outsidedeliveryaddressmodal)</br></br>
|