@@ -31,13 +31,11 @@ const accountBillingRoute = createRoute({
3131 getParentRoute : ( ) => accountTabsRoute ,
3232 path : 'billing' ,
3333 validateSearch : ( search : AccountBillingSearch ) => search ,
34- beforeLoad : ( { context, params } ) => {
35- if ( context ?. flags ?. iamRbacPrimaryNavChanges ) {
36- throw redirect ( {
37- to : `/billing` ,
38- replace : true ,
39- } ) ;
40- }
34+ beforeLoad : ( ) => {
35+ throw redirect ( {
36+ to : `/billing` ,
37+ replace : true ,
38+ } ) ;
4139 } ,
4240} ) . lazy ( ( ) =>
4341 import ( 'src/features/Billing/billingDetailLazyRoute' ) . then (
@@ -58,10 +56,6 @@ const accountUsersRoute = createRoute({
5856 if ( isIAMEnabled ) {
5957 throw redirect ( { to : '/iam/users' } ) ;
6058 }
61-
62- if ( context ?. flags ?. iamRbacPrimaryNavChanges && ! isIAMEnabled ) {
63- throw redirect ( { to : '/users' } ) ;
64- }
6559 } ,
6660} ) . lazy ( ( ) =>
6761 import ( 'src/features/Users/usersLandingLazyRoute' ) . then (
@@ -72,13 +66,11 @@ const accountUsersRoute = createRoute({
7266const accountQuotasRoute = createRoute ( {
7367 getParentRoute : ( ) => accountTabsRoute ,
7468 path : '/quotas' ,
75- beforeLoad : ( { context } ) => {
76- if ( context ?. flags ?. iamRbacPrimaryNavChanges ) {
77- throw redirect ( {
78- to : `/quotas` ,
79- replace : true ,
80- } ) ;
81- }
69+ beforeLoad : ( ) => {
70+ throw redirect ( {
71+ to : `/quotas` ,
72+ replace : true ,
73+ } ) ;
8274 } ,
8375} ) . lazy ( ( ) =>
8476 import ( 'src/features/Account/Quotas/quotasLazyRoute' ) . then (
@@ -90,12 +82,10 @@ const accountLoginHistoryRoute = createRoute({
9082 getParentRoute : ( ) => accountTabsRoute ,
9183 path : '/login-history' ,
9284 beforeLoad : ( { context } ) => {
93- if ( context ?. flags ?. iamRbacPrimaryNavChanges ) {
94- throw redirect ( {
95- to : `/login-history` ,
96- replace : true ,
97- } ) ;
98- }
85+ throw redirect ( {
86+ to : `/login-history` ,
87+ replace : true ,
88+ } ) ;
9989 } ,
10090} ) . lazy ( ( ) =>
10191 import ( 'src/features/Account/accountLoginsLazyRoute' ) . then (
@@ -106,13 +96,11 @@ const accountLoginHistoryRoute = createRoute({
10696const accountServiceTransfersRoute = createRoute ( {
10797 getParentRoute : ( ) => accountTabsRoute ,
10898 path : '/service-transfers' ,
109- beforeLoad : ( { context } ) => {
110- if ( context ?. flags ?. iamRbacPrimaryNavChanges ) {
111- throw redirect ( {
112- to : `/service-transfers` ,
113- replace : true ,
114- } ) ;
115- }
99+ beforeLoad : ( ) => {
100+ throw redirect ( {
101+ to : `/service-transfers` ,
102+ replace : true ,
103+ } ) ;
116104 } ,
117105} ) . lazy ( ( ) =>
118106 import (
@@ -123,13 +111,11 @@ const accountServiceTransfersRoute = createRoute({
123111const accountMaintenanceRoute = createRoute ( {
124112 getParentRoute : ( ) => accountTabsRoute ,
125113 path : '/maintenance' ,
126- beforeLoad : ( { context } ) => {
127- if ( context ?. flags ?. iamRbacPrimaryNavChanges ) {
128- throw redirect ( {
129- to : `/maintenance` ,
130- replace : true ,
131- } ) ;
132- }
114+ beforeLoad : ( ) => {
115+ throw redirect ( {
116+ to : `/maintenance` ,
117+ replace : true ,
118+ } ) ;
133119 } ,
134120} ) . lazy ( ( ) =>
135121 import ( 'src/features/Account/Maintenance/maintenanceLandingLazyRoute' ) . then (
@@ -140,13 +126,11 @@ const accountMaintenanceRoute = createRoute({
140126const accountSettingsRoute = createRoute ( {
141127 getParentRoute : ( ) => accountTabsRoute ,
142128 path : '/settings' ,
143- beforeLoad : ( { context } ) => {
144- if ( context ?. flags ?. iamRbacPrimaryNavChanges ) {
145- throw redirect ( {
146- to : `/account-settings` ,
147- replace : true ,
148- } ) ;
149- }
129+ beforeLoad : ( ) => {
130+ throw redirect ( {
131+ to : `/account-settings` ,
132+ replace : true ,
133+ } ) ;
150134 } ,
151135} ) . lazy ( ( ) =>
152136 import ( 'src/features/Account/globalSettingsLazyRoute' ) . then (
@@ -182,18 +166,16 @@ const accountUsersUsernameRoute = createRoute({
182166 } ) ;
183167 }
184168
185- if ( context ?. flags ?. iamRbacPrimaryNavChanges && ! isIAMEnabled ) {
186- const url = location . pathname . endsWith ( '/profile' )
187- ? '/users/$username/profile'
188- : location . pathname . endsWith ( '/permissions' )
189- ? '/users/$username/permissions'
190- : '/users/$username' ;
191- throw redirect ( {
192- to : url ,
193- params : { username } ,
194- replace : true ,
195- } ) ;
196- }
169+ const url = location . pathname . endsWith ( '/profile' )
170+ ? '/users/$username/profile'
171+ : location . pathname . endsWith ( '/permissions' )
172+ ? '/users/$username/permissions'
173+ : '/users/$username' ;
174+ throw redirect ( {
175+ to : url ,
176+ params : { username } ,
177+ replace : true ,
178+ } ) ;
197179 } ,
198180} ) . lazy ( ( ) =>
199181 import ( 'src/features/Users/userDetailLazyRoute' ) . then (
@@ -225,14 +207,12 @@ const accountInvoiceDetailsRoute = createRoute({
225207 invoiceId : Number ( params . invoiceId ) ,
226208 } ) ,
227209 path : 'billing/invoices/$invoiceId' ,
228- beforeLoad : ( { context, params } ) => {
229- if ( context ?. flags ?. iamRbacPrimaryNavChanges ) {
230- throw redirect ( {
231- to : `/billing/invoices/$invoiceId` ,
232- params : { invoiceId : params . invoiceId } ,
233- replace : true ,
234- } ) ;
235- }
210+ beforeLoad : ( { params } ) => {
211+ throw redirect ( {
212+ to : `/billing/invoices/$invoiceId` ,
213+ params : { invoiceId : params . invoiceId } ,
214+ replace : true ,
215+ } ) ;
236216 } ,
237217} ) . lazy ( ( ) =>
238218 import ( 'src/features/Billing/InvoiceDetail/InvoiceDetail' ) . then (
@@ -243,13 +223,11 @@ const accountInvoiceDetailsRoute = createRoute({
243223const accountEntityTransfersCreateRoute = createRoute ( {
244224 getParentRoute : ( ) => accountRoute ,
245225 path : 'service-transfers/create' ,
246- beforeLoad : ( { context } ) => {
247- if ( context ?. flags ?. iamRbacPrimaryNavChanges ) {
248- throw redirect ( {
249- to : `/service-transfers/create` ,
250- replace : true ,
251- } ) ;
252- }
226+ beforeLoad : ( ) => {
227+ throw redirect ( {
228+ to : `/service-transfers/create` ,
229+ replace : true ,
230+ } ) ;
253231 } ,
254232} ) . lazy ( ( ) =>
255233 import (
0 commit comments