Skip to content

Commit

Permalink
- Lazy load components in router
Browse files Browse the repository at this point in the history
- Change https to http. This will be ignored in SonarCloud
  • Loading branch information
Ronaldo Macapobre committed Dec 5, 2024
1 parent 9ac0539 commit 412c36c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 19 deletions.
31 changes: 13 additions & 18 deletions web/src/router/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
import CivilCaseDetails from '@/components/civil/CivilCaseDetails.vue';
import CivilFileSearchResultsView from '@/components/civil/CivilFileSearchResultsView.vue';
import CourtFileSearchView from '@/components/courtfilesearch/CourtFileSearchView.vue';
import CourtList from '@/components/courtlist/CourtList.vue';
import CriminalCaseDetails from '@/components/criminal/CriminalCaseDetails.vue';
import CriminalFileSearchResultsView from '@/components/criminal/CriminalFileSearchResultsView.vue';
import Dashboard from '@/components/dashboard/Dashboard.vue';
import { SessionManager } from '@/utils/utils';
import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router';

Expand All @@ -15,62 +8,64 @@ async function authGuard(to: any, from: any, next: any) {
}
}

const HomeView = () => import('../components/Home.vue');

const routes: RouteRecordRaw[] = [
{
path: '/',
name: 'HomeView',
component: HomeView,
component: () => import('@/components/Home.vue'),
},
{
path: '/court-list',
name: 'CourtList',
component: CourtList,
component: () => import('@/components/courtlist/CourtList.vue'),
props: true,
children: [
{
path: 'location/:location/room/:room/date/:date',
name: 'CourtListResult',
component: CourtList,
component: () => import('@/components/courtlist/CourtList.vue'),
props: true,
},
],
},
{
path: '/civil-file/:fileNumber/:section?',
name: 'CivilCaseDetails',
component: CivilCaseDetails,
component: () => import('@/components/civil/CivilCaseDetails.vue'),
props: true,
},
{
path: '/criminal-file/:fileNumber',
name: 'CriminalCaseDetails',
component: CriminalCaseDetails,
component: () => import('@/components/criminal/CriminalCaseDetails.vue'),
props: true,
},
{
path: '/civil-file-search',
name: 'CivilFileSearchResultsView',
component: CivilFileSearchResultsView,
component: () =>
import('@/components/civil/CivilFileSearchResultsView.vue'),
props: true,
},
{
path: '/criminal-file-search',
name: 'CriminalFileSearchResultsView',
component: CriminalFileSearchResultsView,
component: import(
'@/components/criminal/CriminalFileSearchResultsView.vue'
),
props: true,
},
{
path: '/dashboard',
name: 'DashboardView',
component: Dashboard,
component: () => import('@/components/dashboard/Dashboard.vue'),
props: true,
},
{
path: '/court-file-search',
name: 'CourtFileSearchView',
component: CourtFileSearchView,
component: () =>
import('@/components/courtfilesearch/CourtFileSearchView.vue'),
},
];

Expand Down
2 changes: 1 addition & 1 deletion web/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default defineConfig({
https: true,
proxy: {
'^/api': {
target: 'https://api:5000',
target: 'http://api:5000',
changeOrigin: true,
headers: {
Connection: 'keep-alive',
Expand Down

0 comments on commit 412c36c

Please sign in to comment.