File tree Expand file tree Collapse file tree 1 file changed +26
-4
lines changed Expand file tree Collapse file tree 1 file changed +26
-4
lines changed Original file line number Diff line number Diff line change @@ -230,6 +230,27 @@ export default function App() {
230
230
}
231
231
} , [ bgUpdated ] )
232
232
233
+ const renderFirstNavigatedPage = ( ) => {
234
+ if ( location . pathname && location . pathname . includes ( 'approve' ) ) {
235
+ return (
236
+ < Route
237
+ exact
238
+ path = { `${ approvalType ?. toLocaleLowerCase ( ) } /approve?token=${ approvalToken } ` }
239
+ render = { ( ) => GenericDirectApprovalModal && < GenericDirectApprovalModal approvalType = { approvalType } /> }
240
+ />
241
+ )
242
+ } else {
243
+ return (
244
+ < >
245
+ < Route path = "/" render = { ( ) => < NavigationRoutes /> } />
246
+ < Redirect
247
+ to = { window . _env_ . K8S_CLIENT ? '/' : `${ URLS . LOGIN_SSO } ${ location . search } ` }
248
+ />
249
+ </ >
250
+ )
251
+ }
252
+ }
253
+
233
254
return (
234
255
< Suspense fallback = { null } >
235
256
{ validating ? (
@@ -247,19 +268,20 @@ export default function App() {
247
268
< BreadcrumbStore >
248
269
< Switch >
249
270
{ ! window . _env_ . K8S_CLIENT && < Route path = { `/login` } component = { Login } /> }
250
- < Route exact path = "/" render = { ( ) => < NavigationRoutes /> } />
251
- < Route
271
+ { /* <Route
252
272
exact
253
273
path={`${approvalType?.toLocaleLowerCase()}/approve?token=${approvalToken}` }
254
274
render={() =>
255
275
GenericDirectApprovalModal && (
256
276
<GenericDirectApprovalModal approvalType={approvalType} />
257
277
)
258
278
}
259
- />
279
+ /> */ }
280
+ { /* <Route path="/" render={() => <NavigationRoutes />} />
260
281
<Redirect
261
282
to={window._env_.K8S_CLIENT ? '/' : `${URLS.LOGIN_SSO}${location.search}`}
262
- />
283
+ /> */ }
284
+ { renderFirstNavigatedPage ( ) }
263
285
</ Switch >
264
286
< div id = "full-screen-modal" > </ div >
265
287
< div id = "visible-modal" > </ div >
You can’t perform that action at this time.
0 commit comments