• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

hasadna / open-bus-map-search / 18658555534

20 Oct 2025 04:31PM UTC coverage: 78.994% (-2.8%) from 81.772%
18658555534

push

github

web-flow
chore(deps-dev): bump eslint-plugin-react-hooks from 5.2.0 to 7.0.0 (#1323)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

655 of 871 branches covered (75.2%)

Branch coverage included in aggregate %.

1120 of 1376 relevant lines covered (81.4%)

39294.01 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

81.08
/src/routes/index.tsx
1
import {
2
  BarChartOutlined,
3
  BugOutlined,
4
  DollarOutlined,
5
  FieldTimeOutlined,
66!
6
  GithubOutlined,
7
  HeatMapOutlined,
8
  HomeOutlined,
9
  InfoCircleOutlined,
10
  LaptopOutlined,
11
  LineChartOutlined,
12
  RadarChartOutlined,
66✔
13
} from '@ant-design/icons'
330!
14
import { AirportShuttle, Psychology } from '@mui/icons-material'
15
import { lazy } from 'react'
16
import { createBrowserRouter, createRoutesFromElements, Navigate, Route } from 'react-router'
17
import { getRouteById } from 'src/api/gtfsService'
18
import { ErrorPage } from 'src/pages/ErrorPage'
19
import VelocityHeatmapPage from 'src/pages/velocityHeatmap'
20
import { MainRoute } from './MainRoute'
21

22
const HomePage = lazy(() => import('../pages/homepage/HomePage'))
66✔
23
const DashboardPage = lazy(() => import('../pages/dashboard/DashboardPage'))
66✔
24
const TimelinePage = lazy(() => import('../pages/historicTimeline'))
66✔
25
const GapsPage = lazy(() => import('../pages/gaps'))
66✔
26
const GapsPatternsPage = lazy(() => import('../pages/gapsPatterns'))
66✔
27
const TimeBasedMapPage = lazy(() => import('../pages/timeBasedMap'))
66✔
28
const SingleLineMapPage = lazy(() => import('../pages/singleLineMap'))
66✔
29
const About = lazy(() => import('../pages/about'))
66✔
30
const Operator = lazy(() => import('../pages/operator'))
66✔
31
const Profile = lazy(() => import('../pages/lineProfile/LineProfile'))
66✔
32
const BugReportForm = lazy(() => import('../pages/BugReportForm '))
66✔
33
const DataResearch = lazy(() =>
66✔
34
  import('../pages/DataResearch/DataResearch').then((m) => ({
×
35
    default: m.DataResearch,
36
  })),
37
)
38
const PublicAppeal = lazy(() => import('../pages/publicAppeal'))
66✔
39

40
export const PAGES = [
66✔
41
  {
42
    label: 'homepage_title',
43
    path: '/',
44
    icon: <HomeOutlined />,
45
    element: <HomePage />,
46
  },
47
  {
48
    label: 'dashboard_page_title',
49
    path: '/dashboard',
50
    icon: <LaptopOutlined />,
51
    element: <DashboardPage />,
52
  },
53
  {
54
    label: 'timeline_page_title',
55
    path: '/timeline',
56
    searchParamsRequired: true,
57
    icon: <FieldTimeOutlined />,
58
    element: <TimelinePage />,
59
  },
60
  {
61
    label: 'gaps_page_title',
62
    path: '/gaps',
63
    searchParamsRequired: true,
64
    icon: <BarChartOutlined />,
65
    element: <GapsPage />,
66
  },
67
  {
68
    label: 'gaps_patterns_page_title',
69
    path: '/gaps_patterns',
70
    icon: <LineChartOutlined />,
71
    element: <GapsPatternsPage />,
72
  },
73
  {
74
    label: 'time_based_map_page_title',
75
    path: '/map',
76
    icon: <HeatMapOutlined />,
77
    element: <TimeBasedMapPage />,
78
  },
79
  {
80
    label: 'velocity_heatmap_page_title',
81
    path: '/velocity-heatmap',
82
    icon: <HeatMapOutlined />,
83
    element: <VelocityHeatmapPage />,
84
  },
85
  {
86
    label: 'singleline_map_page_title',
87
    path: '/single-line-map',
88
    searchParamsRequired: true,
89
    icon: <RadarChartOutlined />,
90
    element: <SingleLineMapPage />,
91
  },
92
  {
93
    label: 'operator_title',
94
    path: '/operator',
95
    searchParamsRequired: true,
96
    icon: <AirportShuttle />,
97
    element: <Operator />,
98
  },
99
  {
100
    label: 'about_title',
101
    path: '/about',
102
    icon: <InfoCircleOutlined />,
103
    element: <About />,
104
  },
105
  {
106
    label: 'donate_title',
107
    path: '/donate',
108
    icon: <DollarOutlined />,
109
    element: null, //DonateModal
110
  },
111
  {
112
    label: 'public_appeal_title',
113
    path: '/public-appeal',
114
    icon: <Psychology />,
115
    element: <PublicAppeal />,
116
  },
117
] as const
118

119
export const HEADER_LINKS = [
66✔
120
  {
121
    label: 'report_a_bug_title',
122
    path: '/report-a-bug',
123
    icon: <BugOutlined />,
124
    element: <BugReportForm />,
125
  },
126
  {
127
    label: 'github_link',
128
    path: 'https://github.com/hasadna/open-bus-map-search',
129
    icon: <GithubOutlined />,
130
    element: null,
131
  },
132
] as const
133

134
const HIDDEN_PAGES = [
66✔
135
  {
136
    label: 'data-research',
137
    path: '/data-research',
138
    icon: <InfoCircleOutlined />,
139
    element: <DataResearch />,
140
  },
141
] as const
142

143
const routesList = [...PAGES, ...HIDDEN_PAGES, ...HEADER_LINKS].filter((r) => r.element)
990✔
144
const RedirectToHomepage = <Navigate to={routesList[0].path} replace />
66✔
145

146
export const getRoutesList = () => {
147
  return (
66✔
148
    <Route element={<MainRoute />}>
149
      {routesList.map(({ path, element }) => (
150
        <Route key={path} path={path} element={element} ErrorBoundary={ErrorPage} />
858✔
151
      ))}
152
      <Route
153
        path="/profile/:gtfsRideGtfsRouteId"
154
        element={<Profile />}
155
        ErrorBoundary={ErrorPage}
156
        loader={async ({ params }) => {
157
          try {
158
            const route = await getRouteById(params?.gtfsRideGtfsRouteId)
×
159
            return { route }
×
160
          } catch (error) {
161
            return {
×
162
              route: null,
163
              message: (error as Error).message,
164
            }
165
          }
166
        }}
167
      />
168
      <Route path="*" element={RedirectToHomepage} key="back" />
169
    </Route>
170
  )
171
}
172

173
window.addEventListener('vite:preloadError', () => {
66✔
174
  window.location.reload() // in case new version is released, we will need to refresh the page. see https://vitejs.dev/guide/build#load-error-handling
×
175
})
176

177
const routes = createRoutesFromElements(getRoutesList())
66✔
178

179
const router = createBrowserRouter(routes)
66✔
180

181
export default router
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc