Skip to content

Commit 269da4d

Browse files
ivicackresimir-coko
authored andcommitted
2882 client - Simplify route configuration by removing lazy loading for public account pages and consolidating imports
1 parent 1e44753 commit 269da4d

1 file changed

Lines changed: 17 additions & 38 deletions

File tree

client/src/routes.tsx

Lines changed: 17 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
import App from '@/App';
22
import {IntegrationApi} from '@/ee/shared/middleware/embedded/configuration';
33
import {IntegrationKeys} from '@/ee/shared/queries/embedded/integrations.queries';
4+
import AccountErrorPage from '@/pages/account/public/AccountErrorPage';
5+
import Login from '@/pages/account/public/Login';
6+
import PasswordResetEmailSent from '@/pages/account/public/PasswordResetEmailSent';
7+
import PasswordResetFinish from '@/pages/account/public/PasswordResetFinish';
8+
import PasswordResetInit from '@/pages/account/public/PasswordResetInit';
9+
import Register from '@/pages/account/public/Register';
10+
import RegisterSuccess from '@/pages/account/public/RegisterSuccess';
11+
import VerifyEmail from '@/pages/account/public/VerifyEmail';
412
import {Connections} from '@/pages/automation/connections/Connections';
513
import ProjectDeployments from '@/pages/automation/project-deployments/ProjectDeployments';
614
import {environmentStore} from '@/pages/automation/stores/useEnvironmentStore';
@@ -21,7 +29,6 @@ import {QueryClient} from '@tanstack/react-query';
2129
import {lazy} from 'react';
2230
import {createBrowserRouter, redirect} from 'react-router-dom';
2331

24-
const AccountErrorPage = lazy(() => import('@/pages/account/public/AccountErrorPage'));
2532
const AccountProfile = lazy(() => import('@/pages/account/settings/AccountProfile'));
2633
const Appearance = lazy(() => import('@/pages/account/settings/Appearance'));
2734
const ApiKeys = lazy(() => import('@/pages/settings/platform/api-keys/ApiKeys'));
@@ -31,20 +38,14 @@ const AutomationWorkflowExecutions = lazy(() =>
3138
}))
3239
);
3340
const Home = lazy(() => import('@/pages/home/Home'));
34-
const Login = lazy(() => import('@/pages/account/public/Login'));
3541
const McpServers = lazy(() => import('@/pages/automation/mcp-servers/McpServers'));
3642
const Notifications = lazy(() => import('@/pages/settings/platform/notifications/Notifications'));
37-
const PasswordResetEmailSent = lazy(() => import('@/pages/account/public/PasswordResetEmailSent'));
38-
const PasswordResetFinish = lazy(() => import('@/pages/account/public/PasswordResetFinish'));
39-
const PasswordResetInit = lazy(() => import('@/pages/account/public/PasswordResetInit'));
4043
const Project = lazy(() => import('@/pages/automation/project/Project'));
4144
const ProjectTemplate = lazy(() => import('@/pages/automation/template/project-template/ProjectTemplate'));
4245
const ProjectTemplates = lazy(() => import('@/pages/automation/templates/project-templates/ProjectTemplates'));
4346
const Projects = lazy(() => import('@/pages/automation/projects/Projects'));
44-
const Register = lazy(() => import('@/pages/account/public/Register'));
45-
const RegisterSuccess = lazy(() => import('@/pages/account/public/RegisterSuccess'));
47+
4648
const Sessions = lazy(() => import('@/pages/account/settings/Sessions'));
47-
const VerifyEmail = lazy(() => import('@/pages/account/public/VerifyEmail'));
4849
const WorkflowChat = lazy(() => import('@/pages/automation/workflow-chat/WorkflowChat'));
4950
const WorkflowTemplate = lazy(() => import('@/pages/automation/template/workflow-template/WorkflowTemplate'));
5051
const WorkflowTemplates = lazy(() => import('@/pages/automation/templates/workflow-templates/WorkflowTemplates'));
@@ -261,65 +262,45 @@ export const getRouter = (queryClient: QueryClient) =>
261262
// path: '/oauth',
262263
// },
263264
{
264-
element: (
265-
<LazyLoadWrapper>
266-
<Login />
267-
</LazyLoadWrapper>
268-
),
265+
element: <Login />,
269266
path: '/login',
270267
},
271268
{
272-
element: (
273-
<LazyLoadWrapper>
274-
<Register />
275-
</LazyLoadWrapper>
276-
),
269+
element: <Register />,
277270
path: '/register',
278271
},
279272
{
280-
element: (
281-
<LazyLoadWrapper>
282-
<PasswordResetInit />
283-
</LazyLoadWrapper>
284-
),
273+
element: <PasswordResetInit />,
285274
path: '/password-reset/init',
286275
},
287276
{
288277
element: (
289278
<AccessControl requiresFlow requiresKey>
290-
<LazyLoadWrapper>
291-
<RegisterSuccess />
292-
</LazyLoadWrapper>
279+
<RegisterSuccess />
293280
</AccessControl>
294281
),
295282
path: '/activate',
296283
},
297284
{
298285
element: (
299286
<AccessControl requiresKey>
300-
<LazyLoadWrapper>
301-
<PasswordResetFinish />
302-
</LazyLoadWrapper>
287+
<PasswordResetFinish />
303288
</AccessControl>
304289
),
305290
path: '/password-reset/finish',
306291
},
307292
{
308293
element: (
309294
<AccessControl requiresFlow>
310-
<LazyLoadWrapper>
311-
<PasswordResetEmailSent />
312-
</LazyLoadWrapper>
295+
<PasswordResetEmailSent />
313296
</AccessControl>
314297
),
315298
path: '/password-reset/email',
316299
},
317300
{
318301
element: (
319302
<AccessControl requiresFlow>
320-
<LazyLoadWrapper>
321-
<VerifyEmail />
322-
</LazyLoadWrapper>
303+
<VerifyEmail />
323304
</AccessControl>
324305
),
325306
path: '/verify-email',
@@ -382,9 +363,7 @@ export const getRouter = (queryClient: QueryClient) =>
382363
{
383364
element: (
384365
<AccessControl requiresFlow>
385-
<LazyLoadWrapper>
386-
<AccountErrorPage />
387-
</LazyLoadWrapper>
366+
<AccountErrorPage />
388367
</AccessControl>
389368
),
390369
path: '/account-error',

0 commit comments

Comments
 (0)