Skip to content

Commit b614c04

Browse files
committed
routing added for direct approval modal
1 parent 1c08133 commit b614c04

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/App.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import {
1717
ToastBody,
1818
ToastBody3 as UpdateToast,
1919
ErrorBoundary,
20+
importComponentFromFELibrary,
2021
} from './components/common'
2122
import { showError, BreadcrumbStore, Reload, DevtronProgressing } from '@devtron-labs/devtron-fe-common-lib'
2223
import * as serviceWorker from './serviceWorker'
@@ -25,6 +26,7 @@ import { validateToken } from './services/service'
2526

2627
const NavigationRoutes = lazy(() => import('./components/common/navigation/NavigationRoutes'))
2728
const Login = lazy(() => import('./components/login/Login'))
29+
const ApprovedModal = importComponentFromFELibrary('ApprovedModal')
2830

2931
toast.configure({
3032
autoClose: 3000,
@@ -87,6 +89,9 @@ export default function App() {
8789
useEffect(() => {
8890
async function validation() {
8991
try {
92+
if (location.pathname.includes('approval')) {
93+
return
94+
}
9095
await validateToken()
9196
defaultRedirection()
9297
} catch (err: any) {
@@ -106,7 +111,7 @@ export default function App() {
106111
}
107112
}
108113
// If not K8S_CLIENT then validateToken otherwise directly redirect
109-
if (!window._env_.K8S_CLIENT) {
114+
if (!window._env_.K8S_CLIENT) {
110115
validation()
111116
} else {
112117
setValidating(false)
@@ -207,7 +212,7 @@ export default function App() {
207212
<Suspense fallback={null}>
208213
{validating ? (
209214
<div className="full-height-width">
210-
<DevtronProgressing parentClasses="h-100 flex bcn-0" classes="icon-dim-80"/>
215+
<DevtronProgressing parentClasses="h-100 flex bcn-0" classes="icon-dim-80" />
211216
</div>
212217
) : (
213218
<>
@@ -220,6 +225,7 @@ export default function App() {
220225
<BreadcrumbStore>
221226
<Switch>
222227
{!window._env_.K8S_CLIENT && <Route path={`/login`} component={Login} />}
228+
<Route path={`/approval`} component={ApprovedModal} />
223229
<Route path="/" render={() => <NavigationRoutes />} />
224230
<Redirect
225231
to={window._env_.K8S_CLIENT ? '/' : `${URLS.LOGIN_SSO}${location.search}`}

0 commit comments

Comments
 (0)