@@ -4,7 +4,10 @@ import { breakpoints, from, space } from '@guardian/source-foundations';
4
4
import type { ReactNode } from 'react' ;
5
5
import { lazy , Suspense , useEffect , useState } from 'react' ;
6
6
import { BrowserRouter , Navigate , Route , Routes } from 'react-router-dom' ;
7
- import { initFeatureSwitchUrlParamOverride } from '../../../shared/featureSwitches' ;
7
+ import {
8
+ featureSwitches ,
9
+ initFeatureSwitchUrlParamOverride ,
10
+ } from '../../../shared/featureSwitches' ;
8
11
import type {
9
12
ProductType ,
10
13
ProductTypeWithDeliveryRecordsProperties ,
@@ -66,6 +69,11 @@ const ManageProduct = lazy(() =>
66
69
/* webpackChunkName: "ManageProduct" */ './accountoverview/ManageProduct'
67
70
) . then ( ( { ManageProduct } ) => ( { default : ManageProduct } ) ) ,
68
71
) ;
72
+ const ManageProductV2 = lazy ( ( ) =>
73
+ import (
74
+ /* webpackChunkName: "ManageProduct" */ './accountoverview/manageProducts/ManageProductV2'
75
+ ) . then ( ( { ManageProductV2 } ) => ( { default : ManageProductV2 } ) ) ,
76
+ ) ;
69
77
const CancellationContainer = lazy ( ( ) =>
70
78
import (
71
79
/* webpackChunkName: "Cancellation" */ './cancel/CancellationContainer'
@@ -134,7 +142,7 @@ const MembershipSwitch = lazy(() =>
134
142
135
143
const SelectReason = lazy ( ( ) =>
136
144
import (
137
- /* webpackChunkName: "Cancellation" */ './cancel/cancellationSaves/membership/ SelectReason'
145
+ /* webpackChunkName: "Cancellation" */ './cancel/cancellationSaves/SelectReason'
138
146
) . then ( ( { SelectReason } ) => ( {
139
147
default : SelectReason ,
140
148
} ) ) ,
@@ -164,6 +172,30 @@ const SwitchThankYou = lazy(() =>
164
172
} ) ) ,
165
173
) ;
166
174
175
+ const ConfirmDigiSubCancellation = lazy ( ( ) =>
176
+ import (
177
+ /* webpackChunkName: "Cancellation" */ './cancel/cancellationSaves/digipack/ConfirmDigiSubCancellation'
178
+ ) . then ( ( { ConfirmDigiSubCancellation : ConfirmDigiSubCancellation } ) => ( {
179
+ default : ConfirmDigiSubCancellation ,
180
+ } ) ) ,
181
+ ) ;
182
+
183
+ const DigiSubThankYouOffer = lazy ( ( ) =>
184
+ import (
185
+ /* webpackChunkName: "Cancellation" */ './cancel/cancellationSaves/digipack/ThankYouOffer'
186
+ ) . then ( ( { ThankYouOffer : ThankYouOffer } ) => ( {
187
+ default : ThankYouOffer ,
188
+ } ) ) ,
189
+ ) ;
190
+
191
+ const ConfirmDigiSubDiscount = lazy ( ( ) =>
192
+ import (
193
+ /* webpackChunkName: "Cancellation" */ './cancel/cancellationSaves/digipack/DigiSubDiscountConfirm'
194
+ ) . then ( ( { DigiSubDiscountConfirm : DigiSubDiscountConfirm } ) => ( {
195
+ default : DigiSubDiscountConfirm ,
196
+ } ) ) ,
197
+ ) ;
198
+
167
199
const PaymentDetailUpdateContainer = lazy ( ( ) =>
168
200
import (
169
201
/* webpackChunkName: "PaymentDetailUpdate" */ './paymentUpdate/PaymentDetailUpdateContainer'
@@ -475,17 +507,29 @@ const MMARouter = () => {
475
507
</ Route >
476
508
) ) }
477
509
{ Object . values ( PRODUCT_TYPES ) . map (
478
- ( productType : ProductType ) => (
479
- < Route
480
- key = { productType . urlPart }
481
- path = { `/${ productType . urlPart } ` }
482
- element = {
483
- < ManageProduct
484
- productType = { productType }
485
- />
486
- }
487
- />
488
- ) ,
510
+ ( productType : ProductType ) =>
511
+ featureSwitches . digisubSave &&
512
+ productType . productType === 'digipack' ? (
513
+ < Route
514
+ key = { productType . urlPart }
515
+ path = { `/${ productType . urlPart } ` }
516
+ element = {
517
+ < ManageProductV2
518
+ productType = { productType }
519
+ />
520
+ }
521
+ />
522
+ ) : (
523
+ < Route
524
+ key = { productType . urlPart }
525
+ path = { `/${ productType . urlPart } ` }
526
+ element = {
527
+ < ManageProduct
528
+ productType = { productType }
529
+ />
530
+ }
531
+ />
532
+ ) ,
489
533
) }
490
534
{ Object . values ( PRODUCT_TYPES )
491
535
. filter ( hasDeliveryFlow )
@@ -658,6 +702,19 @@ const MMARouter = () => {
658
702
path = "switch-thank-you"
659
703
element = { < SwitchThankYou /> }
660
704
/>
705
+
706
+ < Route
707
+ path = "confirm-cancel"
708
+ element = { < ConfirmDigiSubCancellation /> }
709
+ />
710
+ < Route
711
+ path = "confirm-discount"
712
+ element = { < ConfirmDigiSubDiscount /> }
713
+ />
714
+ < Route
715
+ path = "discount-offer"
716
+ element = { < DigiSubThankYouOffer /> }
717
+ />
661
718
</ Route >
662
719
) ,
663
720
) }
0 commit comments