diff --git a/eslint.config.js b/eslint.config.js index a97aa501..6119a8ee 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -59,6 +59,7 @@ module.exports = [ '@typescript-eslint/no-base-to-string': 'off', '@typescript-eslint/no-unsafe-assignment': 'off', 'import/no-unused-modules': 'error', + 'import/order': 'error', 'prettier/prettier': [ 'error', { diff --git a/package-lock.json b/package-lock.json index 8319ec3d..de826802 100644 --- a/package-lock.json +++ b/package-lock.json @@ -92,6 +92,7 @@ "cross-env": "^7.0.3", "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", + "eslint-import-resolver-typescript": "^3.6.1", "eslint-plugin-import": "^2.29.1", "eslint-plugin-prettier": "^5.1.3", "eslint-plugin-react": "^7.33.2", @@ -14904,6 +14905,31 @@ "ms": "^2.1.1" } }, + "node_modules/eslint-import-resolver-typescript": { + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-3.6.1.tgz", + "integrity": "sha512-xgdptdoi5W3niYeuQxKmzVDTATvLYqhpwmykwsh7f6HIOStGWEIL9iqZgQDF9u9OEzrRwR8no5q2VT+bjAujTg==", + "dev": true, + "dependencies": { + "debug": "^4.3.4", + "enhanced-resolve": "^5.12.0", + "eslint-module-utils": "^2.7.4", + "fast-glob": "^3.3.1", + "get-tsconfig": "^4.5.0", + "is-core-module": "^2.11.0", + "is-glob": "^4.0.3" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts/projects/eslint-import-resolver-ts" + }, + "peerDependencies": { + "eslint": "*", + "eslint-plugin-import": "*" + } + }, "node_modules/eslint-module-utils": { "version": "2.8.0", "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.8.0.tgz", @@ -16490,6 +16516,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/get-tsconfig": { + "version": "4.7.5", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.5.tgz", + "integrity": "sha512-ZCuZCnlqNzjb4QprAzXKdpp/gh6KTxSJuw3IBsPnV/7fV4NxC9ckB+vPTt8w7fJA0TaSD7c55BR47JD6MEDyDw==", + "dev": true, + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, "node_modules/giget": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/giget/-/giget-1.2.3.tgz", @@ -23144,6 +23182,15 @@ "node": ">=8" } }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, "node_modules/resolve.exports": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", diff --git a/package.json b/package.json index e280176b..be53a4e9 100644 --- a/package.json +++ b/package.json @@ -118,6 +118,7 @@ "cross-env": "^7.0.3", "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", + "eslint-import-resolver-typescript": "^3.6.1", "eslint-plugin-import": "^2.29.1", "eslint-plugin-prettier": "^5.1.3", "eslint-plugin-react": "^7.33.2", diff --git a/src/App.tsx b/src/App.tsx index dfae4b77..30abf20d 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,11 +1,11 @@ import './App.scss' import 'leaflet/dist/leaflet.css' import 'moment/locale/he' -import router from './routes' import { RouterProvider } from 'react-router-dom' import { Suspense } from 'react' -import Preloader from './shared/Preloader' import moment from 'moment-timezone' +import Preloader from './shared/Preloader' +import router from './routes' import 'moment/dist/locale/he' moment.tz.setDefault('Asia/Jerusalem') diff --git a/src/api/gapsService.ts b/src/api/gapsService.ts index c9d891c4..f83df52b 100644 --- a/src/api/gapsService.ts +++ b/src/api/gapsService.ts @@ -1,6 +1,6 @@ import moment, { Moment } from 'moment-timezone' -import { GapsList } from '../model/gaps' import axios, { CancelTokenSource } from 'axios' +import { GapsList } from '../model/gaps' import { BASE_PATH } from './apiConfig' type RawGapsList = { diff --git a/src/api/groupByService.ts b/src/api/groupByService.ts index eefe7db7..578901ad 100644 --- a/src/api/groupByService.ts +++ b/src/api/groupByService.ts @@ -1,7 +1,7 @@ -import { BASE_PATH } from './apiConfig' import agencyList from 'open-bus-stride-client/agencies/agencyList' import { Moment } from 'moment' import { useQuery } from '@tanstack/react-query' +import { BASE_PATH } from './apiConfig' type groupByField = | 'gtfs_route_date' diff --git a/src/api/siriService.ts b/src/api/siriService.ts index 69f38fba..4e7915da 100644 --- a/src/api/siriService.ts +++ b/src/api/siriService.ts @@ -1,11 +1,11 @@ import { SiriApi, SiriVehicleLocationWithRelatedPydanticModel } from 'open-bus-stride-client' +import moment, { Moment } from 'moment' +import { SiriRideWithRelatedPydanticModel } from 'open-bus-stride-client/openapi/models/SiriRideWithRelatedPydanticModel' import { API_CONFIG, MAX_HITS_COUNT } from 'src/api/apiConfig' import { BusStop } from 'src/model/busStop' -import moment, { Moment } from 'moment' import { geoLocationBoundary, nearestLocation } from 'src/api/geoService' import { Coordinates } from 'src/model/location' import { BusRoute } from 'src/model/busRoute' -import { SiriRideWithRelatedPydanticModel } from 'open-bus-stride-client/openapi/models/SiriRideWithRelatedPydanticModel' const SIRI_API = new SiriApi(API_CONFIG) const LOCATION_DELTA_METERS = 500 diff --git a/src/index.tsx b/src/index.tsx index 348cbefe..92bbf1f0 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1,12 +1,12 @@ import React from 'react' import ReactDOM from 'react-dom/client' import './index.css' -import App from './App' import ReactGA from 'react-ga4' import './locale/allTranslations' import { QueryClient } from '@tanstack/react-query' import { PersistQueryClientProvider } from '@tanstack/react-query-persist-client' import { createSyncStoragePersister } from '@tanstack/query-sync-storage-persister' +import App from './App' const persister = createSyncStoragePersister({ storage: window.localStorage, diff --git a/src/layout/header/Header.tsx b/src/layout/header/Header.tsx index d65cc98e..9cf13630 100644 --- a/src/layout/header/Header.tsx +++ b/src/layout/header/Header.tsx @@ -1,10 +1,10 @@ import { Layout } from 'antd' import { useContext } from 'react' +import { MenuOutlined } from '@ant-design/icons' +import cn from 'classnames' import { LayoutContextInterface, LayoutCtx } from '../LayoutContext' import { useTheme } from '../ThemeContext' -import { MenuOutlined } from '@ant-design/icons' import './Header.css' -import cn from 'classnames' import ToggleThemeButton from './ToggleThemeButton' import { DonationButton } from './DonationButton' import HeaderLinks from './HeaderLinks/HeaderLinks' diff --git a/src/layout/index.tsx b/src/layout/index.tsx index bae4a28c..15aa74c0 100644 --- a/src/layout/index.tsx +++ b/src/layout/index.tsx @@ -1,10 +1,10 @@ import { Layout } from 'antd' -import MainHeader from './header/Header' -import SideBar from './sidebar/SideBar' import styled from 'styled-components' -import LayoutContext from './LayoutContext' import { Link, Outlet } from 'react-router-dom' import { Suspense } from 'react' +import MainHeader from './header/Header' +import SideBar from './sidebar/SideBar' +import LayoutContext from './LayoutContext' import Preloader from 'src/shared/Preloader' import { EasterEgg } from 'src/pages/EasterEgg/EasterEgg' import { Envelope } from 'src/pages/EasterEgg/Envelope' diff --git a/src/layout/sidebar/SideBar.tsx b/src/layout/sidebar/SideBar.tsx index ce9de6e2..79747a20 100644 --- a/src/layout/sidebar/SideBar.tsx +++ b/src/layout/sidebar/SideBar.tsx @@ -1,11 +1,11 @@ -import Menu from './menu/Menu' import './sidebar.scss' import { Drawer, Layout } from 'antd' import { useContext, useState } from 'react' -import { LayoutContextInterface, LayoutCtx } from '../LayoutContext' import { Link } from 'react-router-dom' -import { PAGES } from 'src/routes' +import { LayoutContextInterface, LayoutCtx } from '../LayoutContext' +import Menu from './menu/Menu' import { Logo } from './logo' +import { PAGES } from 'src/routes' const { Sider } = Layout const CollapsedLogo = () =>

🚌

diff --git a/src/layout/sidebar/logo.tsx b/src/layout/sidebar/logo.tsx index b74e0ea5..14ffad9e 100644 --- a/src/layout/sidebar/logo.tsx +++ b/src/layout/sidebar/logo.tsx @@ -1,6 +1,6 @@ import { useTranslation } from 'react-i18next' -import { useTheme } from '../ThemeContext' import cn from 'classnames' +import { useTheme } from '../ThemeContext' export function Logo() { const { isDarkTheme } = useTheme() diff --git a/src/layout/sidebar/menu/Menu.tsx b/src/layout/sidebar/menu/Menu.tsx index 9ec1f68d..7ac200a7 100644 --- a/src/layout/sidebar/menu/Menu.tsx +++ b/src/layout/sidebar/menu/Menu.tsx @@ -2,10 +2,10 @@ import React, { useEffect, useState, useContext } from 'react' import { Link, useLocation } from 'react-router-dom' import './menu.scss' import { useTranslation } from 'react-i18next' -import { PAGES } from 'src/routes' import type { MenuProps } from 'antd' import { Menu } from 'antd' +import { PAGES } from 'src/routes' import { LayoutContextInterface, LayoutCtx } from 'src/layout/LayoutContext' type MenuItem = Required['items'][number] function getItem( diff --git a/src/model/pageState.ts b/src/model/pageState.ts index d73fa8f2..caf7804b 100644 --- a/src/model/pageState.ts +++ b/src/model/pageState.ts @@ -1,11 +1,11 @@ -import { BusRoute } from './busRoute' -import { BusStop } from './busStop' import { createContext, Dispatch } from 'react' import moment from 'moment' import { GtfsRideStopPydanticModel, SiriVehicleLocationWithRelatedPydanticModel, } from 'open-bus-stride-client' +import { BusStop } from './busStop' +import { BusRoute } from './busRoute' import { Coordinates } from './location' export type PageSearchState = { diff --git a/src/pages/DataResearch/DataResearch.tsx b/src/pages/DataResearch/DataResearch.tsx index 285d783b..b9f2d122 100644 --- a/src/pages/DataResearch/DataResearch.tsx +++ b/src/pages/DataResearch/DataResearch.tsx @@ -1,10 +1,6 @@ import React, { useMemo, useState } from 'react' -import { useGroupBy } from 'src/api/groupByService' -import Widget from 'src/shared/Widget' -import { useDate } from '../components/DateTimePicker' import moment from 'moment' import { Grid } from '@mui/material' -import { DateSelector } from '../components/DateSelector' import { useTranslation } from 'react-i18next' import { Skeleton } from 'antd' import { @@ -16,10 +12,14 @@ import { XAxis, YAxis, } from 'recharts' +import { DateSelector } from '../components/DateSelector' +import { useDate } from '../components/DateTimePicker' import { PageContainer } from '../components/PageContainer' import { getColorName } from '../dashboard/AllLineschart/OperatorHbarChart/OperatorHbarChart' import './DataResearch.scss' import OperatorSelector from '../components/OperatorSelector' +import { useGroupBy } from 'src/api/groupByService' +import Widget from 'src/shared/Widget' const now = moment() const unique: (value: string, index: number, self: string[]) => boolean = (value, index, self) => diff --git a/src/pages/about/index.tsx b/src/pages/about/index.tsx index 207877a2..fbaaa484 100644 --- a/src/pages/about/index.tsx +++ b/src/pages/about/index.tsx @@ -1,11 +1,11 @@ import styled from 'styled-components' -import SlackIcon from '../../resources/slack-icon.svg' import { Trans, useTranslation } from 'react-i18next' -import Widget from 'src/shared/Widget' import Typography from '@mui/material/Typography' import Stack from '@mui/material/Stack' import './About.scss' import { useQuery } from '@tanstack/react-query' +import SlackIcon from '../../resources/slack-icon.svg' +import Widget from 'src/shared/Widget' const pageName = 'aboutPage' const About = () => { diff --git a/src/pages/components/DateSelector.tsx b/src/pages/components/DateSelector.tsx index eab76186..67efd972 100644 --- a/src/pages/components/DateSelector.tsx +++ b/src/pages/components/DateSelector.tsx @@ -1,8 +1,8 @@ import { useState, useMemo } from 'react' import { DatePicker } from '@mui/x-date-pickers/DatePicker' import { useTranslation } from 'react-i18next' -import { DataAndTimeSelectorProps } from './utils/dateAndTime' import { DateValidationError } from '@mui/x-date-pickers' +import { DataAndTimeSelectorProps } from './utils/dateAndTime' export function DateSelector({ time, onChange, customLabel, minDate }: DataAndTimeSelectorProps) { const [error, setError] = useState(null) diff --git a/src/pages/components/LineSelector.tsx b/src/pages/components/LineSelector.tsx index c246f978..340fb8bd 100644 --- a/src/pages/components/LineSelector.tsx +++ b/src/pages/components/LineSelector.tsx @@ -2,9 +2,9 @@ import { useCallback, useLayoutEffect, useState } from 'react' import { useTranslation } from 'react-i18next' import debounce from 'lodash.debounce' import { TextField } from '@mui/material' +import classNames from 'classnames' import ClearButton from './ClearButton' import './Selector.scss' -import classNames from 'classnames' type LineSelectorProps = { lineNumber: string | undefined diff --git a/src/pages/components/MinuteSelector.tsx b/src/pages/components/MinuteSelector.tsx index db1fc29b..87bd4e8d 100644 --- a/src/pages/components/MinuteSelector.tsx +++ b/src/pages/components/MinuteSelector.tsx @@ -1,8 +1,8 @@ import { useTranslation } from 'react-i18next' import { TextField } from '@mui/material' +import classNames from 'classnames' import ClearButton from './ClearButton' import './Selector.scss' -import classNames from 'classnames' type MinuteSelectorProps = { num: number diff --git a/src/pages/components/OperatorSelector.stories.tsx b/src/pages/components/OperatorSelector.stories.tsx index 5f292a2f..67935eab 100644 --- a/src/pages/components/OperatorSelector.stories.tsx +++ b/src/pages/components/OperatorSelector.stories.tsx @@ -1,7 +1,7 @@ import type { Meta, StoryObj } from '@storybook/react' import '../../shared/shared.css' -import OperatorSelector from './OperatorSelector' import { useState } from 'react' +import OperatorSelector from './OperatorSelector' import { MAJOR_OPERATORS } from 'src/model/operator' const OperatorSelectorStory = () => { diff --git a/src/pages/components/OperatorSelector.tsx b/src/pages/components/OperatorSelector.tsx index faa31a71..4aaa7c3e 100644 --- a/src/pages/components/OperatorSelector.tsx +++ b/src/pages/components/OperatorSelector.tsx @@ -1,7 +1,7 @@ import { useEffect, useState } from 'react' import { useTranslation } from 'react-i18next' -import { Operator, getOperators } from 'src/model/operator' import { Autocomplete, TextField } from '@mui/material' +import { Operator, getOperators } from 'src/model/operator' type OperatorSelectorProps = { operatorId?: string diff --git a/src/pages/components/RouteSelector.tsx b/src/pages/components/RouteSelector.tsx index 258c97ab..6bbdffed 100644 --- a/src/pages/components/RouteSelector.tsx +++ b/src/pages/components/RouteSelector.tsx @@ -1,9 +1,9 @@ -import { formatted } from 'src/locale/utils' -import { BusRoute } from 'src/model/busRoute' import { Autocomplete, TextField } from '@mui/material' import { useEffect } from 'react' import { useTranslation } from 'react-i18next' import { TFunction } from 'i18next' +import { BusRoute } from 'src/model/busRoute' +import { formatted } from 'src/locale/utils' type RouteSelectorProps = { routes: BusRoute[] diff --git a/src/pages/components/StopSelector.tsx b/src/pages/components/StopSelector.tsx index af89ec16..f11f6688 100644 --- a/src/pages/components/StopSelector.tsx +++ b/src/pages/components/StopSelector.tsx @@ -1,7 +1,7 @@ -import { formatted } from 'src/locale/utils' -import { BusStop } from 'src/model/busStop' import { Autocomplete, TextField } from '@mui/material' import { useTranslation } from 'react-i18next' +import { formatted } from 'src/locale/utils' +import { BusStop } from 'src/model/busStop' type StopSelectorProps = { stops: BusStop[] diff --git a/src/pages/components/map-related/MapContent.tsx b/src/pages/components/map-related/MapContent.tsx index 4d1f4a8d..67e42d33 100644 --- a/src/pages/components/map-related/MapContent.tsx +++ b/src/pages/components/map-related/MapContent.tsx @@ -1,15 +1,15 @@ +import { t } from 'i18next' import { useRef } from 'react' import { Marker, Polyline, Popup, TileLayer, useMap } from 'react-leaflet' import { Icon, IconOptions, Marker as LeafletMarker } from 'leaflet' -import { useAgencyList } from 'src/api/agencyList' import { busIcon, busIconPath } from '../utils/BusIcon' import { BusToolTip } from './MapLayers/BusToolTip' -import { t } from 'i18next' import '../../Map.scss' import { MapProps } from './map-types' import { useRecenterOnDataChange } from './useRecenterOnDataChange' import { MapIndex } from './MapIndex' import MapFooterButtons from './MapFooterButtons/MapFooterButtons' +import { useAgencyList } from 'src/api/agencyList' export function MapContent({ positions, plannedRouteStops, showNavigationButtons }: MapProps) { useRecenterOnDataChange({ positions, plannedRouteStops }) diff --git a/src/pages/components/map-related/MapLayers/BusToolTip.stories.tsx b/src/pages/components/map-related/MapLayers/BusToolTip.stories.tsx index 5f328431..bab16309 100644 --- a/src/pages/components/map-related/MapLayers/BusToolTip.stories.tsx +++ b/src/pages/components/map-related/MapLayers/BusToolTip.stories.tsx @@ -1,6 +1,6 @@ import type { Meta, StoryObj } from '@storybook/react' -import { BusToolTip, BusToolTipProps } from './BusToolTip' import { BrowserRouter } from 'react-router-dom' +import { BusToolTip, BusToolTipProps } from './BusToolTip' const meta = { title: 'Components/MapLayers/BusToolTip', diff --git a/src/pages/components/map-related/MapLayers/BusToolTip.tsx b/src/pages/components/map-related/MapLayers/BusToolTip.tsx index 85dfb8bc..c964c6b7 100644 --- a/src/pages/components/map-related/MapLayers/BusToolTip.tsx +++ b/src/pages/components/map-related/MapLayers/BusToolTip.tsx @@ -1,15 +1,15 @@ import { ReactNode, useEffect, useState } from 'react' import { Link } from 'react-router-dom' -import { Point } from 'src/pages/timeBasedMap' import { Button } from '@mui/material' import moment from 'moment-timezone' import './BusToolTip.scss' -import { getSiriRideWithRelated } from 'src/api/siriService' import { SiriRideWithRelatedPydanticModel } from 'open-bus-stride-client/openapi/models/SiriRideWithRelatedPydanticModel' import { useTranslation } from 'react-i18next' import CircularProgress from '@mui/material/CircularProgress' import cn from 'classnames' import CustomTreeView from '../../CustomTreeView' +import { getSiriRideWithRelated } from 'src/api/siriService' +import { Point } from 'src/pages/timeBasedMap' export type BusToolTipProps = { position: Point; icon: string; children?: ReactNode } diff --git a/src/pages/components/map-related/MapWithLocationsAndPath.tsx b/src/pages/components/map-related/MapWithLocationsAndPath.tsx index 3cf92c4e..42673b18 100644 --- a/src/pages/components/map-related/MapWithLocationsAndPath.tsx +++ b/src/pages/components/map-related/MapWithLocationsAndPath.tsx @@ -1,11 +1,11 @@ import { MapContainer } from 'react-leaflet' -import { Point } from 'src/pages/timeBasedMap' +import { useCallback, useState } from 'react' import IconButton from '@mui/material/IconButton' import OpenInFullRoundedIcon from '@mui/icons-material/OpenInFullRounded' import { MapProps } from './map-types' -import { useCallback, useState } from 'react' import '../../Map.scss' import { MapContent } from './MapContent' +import { Point } from 'src/pages/timeBasedMap' const position: Point = { loc: [32.3057988, 34.85478613], // arbitrary default value... Netanya - best city to live & die in diff --git a/src/pages/components/timeline/HorizontalLine.tsx b/src/pages/components/timeline/HorizontalLine.tsx index da9fe4ba..5e605b8d 100644 --- a/src/pages/components/timeline/HorizontalLine.tsx +++ b/src/pages/components/timeline/HorizontalLine.tsx @@ -1,7 +1,7 @@ import styled, { css } from 'styled-components' -import { NEUTRAL_COLOR } from 'src/pages/components/timeline/TimelinePoint' import { useRef } from 'react' import { useHover } from 'usehooks-ts' +import { NEUTRAL_COLOR } from 'src/pages/components/timeline/TimelinePoint' type HorizontalLineProps = { top: number diff --git a/src/pages/components/timeline/Timeline.tsx b/src/pages/components/timeline/Timeline.tsx index 9981538b..61440604 100644 --- a/src/pages/components/timeline/Timeline.tsx +++ b/src/pages/components/timeline/Timeline.tsx @@ -1,5 +1,10 @@ import moment, { Moment } from 'moment' import styled from 'styled-components' +import { + GtfsRideStopPydanticModel, + SiriVehicleLocationWithRelatedPydanticModel, +} from 'open-bus-stride-client' +import { useTranslation } from 'react-i18next' import { LabeledPoint, NEUTRAL_COLOR, @@ -10,12 +15,7 @@ import { pointTypeToDescription, } from 'src/pages/components/timeline/TimelinePoint' import { PADDING } from 'src/pages/components/timeline/TimelineBoard' -import { - GtfsRideStopPydanticModel, - SiriVehicleLocationWithRelatedPydanticModel, -} from 'open-bus-stride-client' import { Coordinates } from 'src/model/location' -import { useTranslation } from 'react-i18next' const Line = styled.div<{ totalHeight: number }>` height: ${({ totalHeight }) => totalHeight + PADDING * 3}px; diff --git a/src/pages/components/timeline/TimelineBoard.tsx b/src/pages/components/timeline/TimelineBoard.tsx index 44194e2e..b294f239 100644 --- a/src/pages/components/timeline/TimelineBoard.tsx +++ b/src/pages/components/timeline/TimelineBoard.tsx @@ -1,16 +1,16 @@ import { useCallback } from 'react' import moment, { Moment } from 'moment' -import { MAX_HITS_COUNT } from 'src/api/apiConfig' import styled from 'styled-components' -import { Timeline } from 'src/pages/components/timeline/Timeline' -import { PointType } from 'src/pages/components/timeline/TimelinePoint' -import { HorizontalLine } from 'src/pages/components/timeline/HorizontalLine' import { GtfsRideStopPydanticModel, SiriVehicleLocationWithRelatedPydanticModel, } from 'open-bus-stride-client' -import { Coordinates } from 'src/model/location' import { useTranslation } from 'react-i18next' +import { MAX_HITS_COUNT } from 'src/api/apiConfig' +import { Timeline } from 'src/pages/components/timeline/Timeline' +import { PointType } from 'src/pages/components/timeline/TimelinePoint' +import { HorizontalLine } from 'src/pages/components/timeline/HorizontalLine' +import { Coordinates } from 'src/model/location' const COLUMN_WIDTH = 140 export const PADDING = 10 diff --git a/src/pages/components/utils/index.test.ts b/src/pages/components/utils/index.test.ts index f2efaee4..bbbf5402 100644 --- a/src/pages/components/utils/index.test.ts +++ b/src/pages/components/utils/index.test.ts @@ -1,5 +1,5 @@ -import { parseTime } from 'src/api/gapsService' import { HourlyData, sortByMode } from '.' +import { parseTime } from 'src/api/gapsService' import { GapsList } from 'src/model/gaps' import { convertGapsToHourlyStruct as processData } from 'src/pages/gapsPatterns/useGapsList' diff --git a/src/pages/dashboard/AllLineschart/AllLinesChart.tsx b/src/pages/dashboard/AllLineschart/AllLinesChart.tsx index 4a7a1476..621f4ca4 100644 --- a/src/pages/dashboard/AllLineschart/AllLinesChart.tsx +++ b/src/pages/dashboard/AllLineschart/AllLinesChart.tsx @@ -2,12 +2,12 @@ import { Tooltip } from '@mui/material' import { Skeleton } from 'antd' import { Fragment } from 'react' import { useTranslation } from 'react-i18next' -import OperatorHbarChart from './OperatorHbarChart/OperatorHbarChart' -import { GroupByRes, useGroupBy } from 'src/api/groupByService' import { FC } from 'react' import { Moment } from 'moment/moment' -import Widget from 'src/shared/Widget' import { InfoCircleOutlined } from '@ant-design/icons' +import OperatorHbarChart from './OperatorHbarChart/OperatorHbarChart' +import { GroupByRes, useGroupBy } from 'src/api/groupByService' +import Widget from 'src/shared/Widget' const convertToChartCompatibleStruct = (arr: GroupByRes[]) => { return arr.map((item: GroupByRes) => ({ diff --git a/src/pages/dashboard/AllLineschart/OperatorHbarChart/OperatorHbarChart.tsx b/src/pages/dashboard/AllLineschart/OperatorHbarChart/OperatorHbarChart.tsx index 06f93ef3..9582fa79 100644 --- a/src/pages/dashboard/AllLineschart/OperatorHbarChart/OperatorHbarChart.tsx +++ b/src/pages/dashboard/AllLineschart/OperatorHbarChart/OperatorHbarChart.tsx @@ -1,6 +1,6 @@ import './operatorsHbarChart.scss' -import { getColorByHashString } from './utils' import { HbarChart } from '../../WorstLinesChart/LineHbarChart/HbarChart/HbarChart' +import { getColorByHashString } from './utils' const colorsByCompannies: { [index: string]: string } = { 'אגד תעבורה': '#2f9250', diff --git a/src/pages/dashboard/ArrivalByTimeChart/ArrivalByTimeChart.test.tsx b/src/pages/dashboard/ArrivalByTimeChart/ArrivalByTimeChart.test.tsx index ba050a6e..4bca440d 100644 --- a/src/pages/dashboard/ArrivalByTimeChart/ArrivalByTimeChart.test.tsx +++ b/src/pages/dashboard/ArrivalByTimeChart/ArrivalByTimeChart.test.tsx @@ -1,6 +1,6 @@ import { type RenderResult, render, screen } from '@testing-library/react' -import ArrivalByTimeChart from './ArrivalByTimeChart' import type { ReactElement } from 'react' +import ArrivalByTimeChart from './ArrivalByTimeChart' import testBusData from './testdata/data.json' jest.mock('recharts', () => { diff --git a/src/pages/dashboard/ArrivalByTimeChart/DayTimeChart.tsx b/src/pages/dashboard/ArrivalByTimeChart/DayTimeChart.tsx index 113db152..d62a12e2 100644 --- a/src/pages/dashboard/ArrivalByTimeChart/DayTimeChart.tsx +++ b/src/pages/dashboard/ArrivalByTimeChart/DayTimeChart.tsx @@ -1,9 +1,9 @@ import React, { FC, useMemo } from 'react' import { useTranslation } from 'react-i18next' import { Skeleton, Radio, RadioChangeEvent } from 'antd' +import { Moment } from 'moment/moment' import ArrivalByTimeChart from './ArrivalByTimeChart' import { GroupByRes, useGroupBy } from 'src/api/groupByService' -import { Moment } from 'moment/moment' import Widget from 'src/shared/Widget' const convertToGraphCompatibleStruct = (arr: GroupByRes[]) => { diff --git a/src/pages/dashboard/DashboardPage.tsx b/src/pages/dashboard/DashboardPage.tsx index 8586637b..791da100 100644 --- a/src/pages/dashboard/DashboardPage.tsx +++ b/src/pages/dashboard/DashboardPage.tsx @@ -1,25 +1,24 @@ import { useState } from 'react' // Services and libraries -import { DateSelector } from '../components/DateSelector' -import { useDate } from '../components/DateTimePicker' import moment from 'moment' - // Styling import './DashboardPage.scss' import 'src/App.scss' -import { PageContainer } from '../components/PageContainer' import { useTranslation } from 'react-i18next' import Typography from '@mui/material/Typography' import Alert from '@mui/material/Alert' import Grid from '@mui/material/Unstable_Grid2' // Grid version 2 +import { useDate } from '../components/DateTimePicker' +import { DateSelector } from '../components/DateSelector' +import { PageContainer } from '../components/PageContainer' // Components -import OperatorSelector from 'src/pages/components/OperatorSelector' +import InfoYoutubeModal from '../components/YoutubeModal' import DayTimeChart from './ArrivalByTimeChart/DayTimeChart' import AllLinesChart from './AllLineschart/AllLinesChart' import WorstLinesChart from './WorstLinesChart/WorstLinesChart' -import InfoYoutubeModal from '../components/YoutubeModal' +import OperatorSelector from 'src/pages/components/OperatorSelector' // Declarations const now = moment() diff --git a/src/pages/dashboard/WorstLinesChart/LineHbarChart/LinesHbarChart.tsx b/src/pages/dashboard/WorstLinesChart/LineHbarChart/LinesHbarChart.tsx index af8d363d..70e54ab1 100644 --- a/src/pages/dashboard/WorstLinesChart/LineHbarChart/LinesHbarChart.tsx +++ b/src/pages/dashboard/WorstLinesChart/LineHbarChart/LinesHbarChart.tsx @@ -1,5 +1,5 @@ -import { HbarChart } from './HbarChart/HbarChart' import { getColorName } from '../../AllLineschart/OperatorHbarChart/OperatorHbarChart' +import { HbarChart } from './HbarChart/HbarChart' function LinesHbarChart({ lines, diff --git a/src/pages/dashboard/WorstLinesChart/WorstLinesChart.tsx b/src/pages/dashboard/WorstLinesChart/WorstLinesChart.tsx index 853b5894..7ec4c43b 100644 --- a/src/pages/dashboard/WorstLinesChart/WorstLinesChart.tsx +++ b/src/pages/dashboard/WorstLinesChart/WorstLinesChart.tsx @@ -1,8 +1,8 @@ import { Skeleton } from 'antd' -import { GroupByRes, useGroupBy } from 'src/api/groupByService' -import LinesHbarChart from './LineHbarChart/LinesHbarChart' import { useTranslation } from 'react-i18next' import { Moment } from 'moment/moment' +import LinesHbarChart from './LineHbarChart/LinesHbarChart' +import { GroupByRes, useGroupBy } from 'src/api/groupByService' import Widget from 'src/shared/Widget' import { MAJOR_OPERATORS } from 'src/model/operator' diff --git a/src/pages/gaps/index.tsx b/src/pages/gaps/index.tsx index 76217f97..574d27b7 100644 --- a/src/pages/gaps/index.tsx +++ b/src/pages/gaps/index.tsx @@ -1,28 +1,28 @@ import { useContext, useEffect, useState } from 'react' +import { useTranslation } from 'react-i18next' +import moment, { Moment } from 'moment' +import styled from 'styled-components' +import { useSessionStorage } from 'usehooks-ts' +import { FormControlLabel, Switch } from '@mui/material' +import Grid from '@mui/material/Unstable_Grid2' // Grid version 2 +import CircularProgress from '@mui/material/CircularProgress' +import axios from 'axios' +import Typography from '@mui/material/Typography' +import Alert from '@mui/material/Alert' import { PageContainer } from '../components/PageContainer' import { Row } from '../components/Row' import { Label } from '../components/Label' -import { useTranslation } from 'react-i18next' import OperatorSelector from '../components/OperatorSelector' import LineNumberSelector from '../components/LineSelector' import { SearchContext } from '../../model/pageState' import { Gap, GapsList } from '../../model/gaps' import { getGapsAsync } from '../../api/gapsService' -import CircularProgress from '@mui/material/CircularProgress' import RouteSelector from '../components/RouteSelector' import { NotFound } from '../components/NotFound' import { getRoutesAsync } from '../../api/gtfsService' -import moment, { Moment } from 'moment' -import styled from 'styled-components' -import { useSessionStorage } from 'usehooks-ts' import { DateSelector } from '../components/DateSelector' -import { FormControlLabel, Switch } from '@mui/material' -import Grid from '@mui/material/Unstable_Grid2' // Grid version 2 -import { INPUT_SIZE } from 'src/resources/sizes' import DisplayGapsPercentage from '../components/DisplayGapsPercentage' -import axios from 'axios' -import Typography from '@mui/material/Typography' -import Alert from '@mui/material/Alert' +import { INPUT_SIZE } from 'src/resources/sizes' const Cell = styled.div` width: 120px; diff --git a/src/pages/gapsPatterns/GapsPatternsPage.tsx b/src/pages/gapsPatterns/GapsPatternsPage.tsx index 8016bf74..ce2ac8b4 100644 --- a/src/pages/gapsPatterns/GapsPatternsPage.tsx +++ b/src/pages/gapsPatterns/GapsPatternsPage.tsx @@ -4,16 +4,6 @@ import { Moment } from 'moment' import { Skeleton, Radio, RadioChangeEvent, Space } from 'antd' import CircularProgress from '@mui/material/CircularProgress' import moment from 'moment/moment' -import { useDate } from '../components/DateTimePicker' -import { PageContainer } from '../components/PageContainer' -import { Row } from '../components/Row' -import { Label } from '../components/Label' -import OperatorSelector from '../components/OperatorSelector' -import LineNumberSelector from '../components/LineSelector' -import { NotFound } from '../components/NotFound' -import RouteSelector from '../components/RouteSelector' -import { SearchContext } from '../../model/pageState' -import { getRoutesAsync } from '../../api/gtfsService' import Grid from '@mui/material/Unstable_Grid2' // Grid version 2 import Typography from '@mui/material/Typography' import Alert from '@mui/material/Alert' @@ -29,13 +19,24 @@ import { TooltipProps, ResponsiveContainer, } from 'recharts' +import { useTranslation } from 'react-i18next' +import { useDate } from '../components/DateTimePicker' +import { PageContainer } from '../components/PageContainer' +import { Row } from '../components/Row' +import { Label } from '../components/Label' +import OperatorSelector from '../components/OperatorSelector' +import LineNumberSelector from '../components/LineSelector' +import { NotFound } from '../components/NotFound' +import RouteSelector from '../components/RouteSelector' +import { SearchContext } from '../../model/pageState' +import { getRoutesAsync } from '../../api/gtfsService' + import { mapColorByExecution } from '../components/utils' -import { useGapsList } from './useGapsList' import { DateSelector } from '../components/DateSelector' +import InfoYoutubeModal from '../components/YoutubeModal' +import { useGapsList } from './useGapsList' import { INPUT_SIZE } from 'src/resources/sizes' -import { useTranslation } from 'react-i18next' import Widget from 'src/shared/Widget' -import InfoYoutubeModal from '../components/YoutubeModal' // Define prop types for the component interface BusLineStatisticsProps { lineRef: number diff --git a/src/pages/gapsPatterns/useGapsList.ts b/src/pages/gapsPatterns/useGapsList.ts index 20c405cb..d68b5a7a 100644 --- a/src/pages/gapsPatterns/useGapsList.ts +++ b/src/pages/gapsPatterns/useGapsList.ts @@ -1,10 +1,10 @@ import { useEffect, useState } from 'react' import { Moment } from 'moment' +import axios from 'axios' import { getGapsAsync } from '../../api/gapsService' import { sortByMode, HourlyData } from '../components/utils' import { GapsList } from 'src/model/gaps' -import axios from 'axios' type HourlyDataList = HourlyData[] // Convert gapsList into HourlyDataList structure diff --git a/src/pages/historicTimeline/index.tsx b/src/pages/historicTimeline/index.tsx index 9fcf86d7..ade6be8d 100644 --- a/src/pages/historicTimeline/index.tsx +++ b/src/pages/historicTimeline/index.tsx @@ -1,9 +1,19 @@ import { useCallback, useContext, useEffect, useMemo, useState } from 'react' +import styled from 'styled-components' +import { useTranslation } from 'react-i18next' +import moment from 'moment' +import Grid from '@mui/material/Unstable_Grid2' // Grid version 2 +import Typography from '@mui/material/Typography' +import Alert from '@mui/material/Alert' +import CircularProgress from '@mui/material/CircularProgress' +import { PageContainer } from '../components/PageContainer' +import { SearchContext, TimelinePageState } from '../../model/pageState' +import { NotFound } from '../components/NotFound' +import { DateSelector } from '../components/DateSelector' import LineNumberSelector from 'src/pages/components/LineSelector' import OperatorSelector from 'src/pages/components/OperatorSelector' import { Row } from 'src/pages/components/Row' import { INPUT_SIZE, MARGIN_MEDIUM } from 'src/resources/sizes' -import styled from 'styled-components' import 'src/App.scss' import { @@ -13,19 +23,9 @@ import { } from 'src/api/gtfsService' import RouteSelector from 'src/pages/components/RouteSelector' import { Label } from 'src/pages/components/Label' -import { useTranslation } from 'react-i18next' import StopSelector from 'src/pages/components/StopSelector' -import Typography from '@mui/material/Typography' -import Alert from '@mui/material/Alert' -import CircularProgress from '@mui/material/CircularProgress' import { getSiriStopHitTimesAsync } from 'src/api/siriService' import { TimelineBoard } from 'src/pages/components/timeline/TimelineBoard' -import { PageContainer } from '../components/PageContainer' -import { SearchContext, TimelinePageState } from '../../model/pageState' -import { NotFound } from '../components/NotFound' -import moment from 'moment' -import { DateSelector } from '../components/DateSelector' -import Grid from '@mui/material/Unstable_Grid2' // Grid version 2 const StyledTimelineBoard = styled(TimelineBoard)` margin-top: ${MARGIN_MEDIUM * 3}px; diff --git a/src/pages/homepage/HomePage.tsx b/src/pages/homepage/HomePage.tsx index 241cd3d1..11325c10 100644 --- a/src/pages/homepage/HomePage.tsx +++ b/src/pages/homepage/HomePage.tsx @@ -1,5 +1,4 @@ import { NavLink, To } from 'react-router-dom' -import busImage from '../../img/busImg.png' import './HomePage.scss' import { useTranslation } from 'react-i18next' import { @@ -9,6 +8,7 @@ import { ViewKanbanOutlined, } from '@mui/icons-material' import { SvgIconProps } from '@mui/material' +import busImage from '../../img/busImg.png' export const HomePage = () => { const { t } = useTranslation() diff --git a/src/pages/lineProfile/LineProfile.tsx b/src/pages/lineProfile/LineProfile.tsx index 2fd3877c..cfc8da05 100644 --- a/src/pages/lineProfile/LineProfile.tsx +++ b/src/pages/lineProfile/LineProfile.tsx @@ -1,24 +1,24 @@ import Grid from '@mui/material/Unstable_Grid2' -import { NotFound } from '../components/NotFound' -import { PageContainer } from '../components/PageContainer' import { useTranslation } from 'react-i18next' -import Widget from 'src/shared/Widget' import { useLoaderData } from 'react-router-dom' +import { useContext, useEffect, useState } from 'react' +import moment from 'moment' +import { Tooltip } from 'antd' +import CircularProgress from '@mui/material/CircularProgress' +import { NotFound } from '../components/NotFound' +import { PageContainer } from '../components/PageContainer' import { MapWithLocationsAndPath } from '../components/map-related/MapWithLocationsAndPath' +import { DateSelector } from '../components/DateSelector' +import RouteSelector from '../components/RouteSelector' +import { FilterPositionsByStartTimeSelector } from '../components/FilterPositionsByStartTimeSelector' import LineProfileHeader from './LineProfileHeader' import { LineProfileDetails } from './LineProfileDetails' import { Route } from './Route.interface' -import { DateSelector } from '../components/DateSelector' +import Widget from 'src/shared/Widget' import { SearchContext } from 'src/model/pageState' -import { useContext, useEffect, useState } from 'react' -import moment from 'moment' -import RouteSelector from '../components/RouteSelector' import { getRoutesAsync } from 'src/api/gtfsService' import { BusRoute } from 'src/model/busRoute' import { useSingleLineData } from 'src/hooks/useSingleLineData' -import { FilterPositionsByStartTimeSelector } from '../components/FilterPositionsByStartTimeSelector' -import { Tooltip } from 'antd' -import CircularProgress from '@mui/material/CircularProgress' import './LineProfile.scss' const LineProfileWrapper = () => ( diff --git a/src/pages/lineProfile/LineProfileDetails.tsx b/src/pages/lineProfile/LineProfileDetails.tsx index 0895a2f8..ea5b402f 100644 --- a/src/pages/lineProfile/LineProfileDetails.tsx +++ b/src/pages/lineProfile/LineProfileDetails.tsx @@ -1,7 +1,7 @@ import React from 'react' import './LineProfileDetails.scss' -import { Route } from './Route.interface' import { useTranslation } from 'react-i18next' +import { Route } from './Route.interface' type Props = Route diff --git a/src/pages/publicAppeal/index.tsx b/src/pages/publicAppeal/index.tsx index cce744c0..bd3b29bd 100644 --- a/src/pages/publicAppeal/index.tsx +++ b/src/pages/publicAppeal/index.tsx @@ -1,7 +1,7 @@ import styled from 'styled-components' import { useTranslation } from 'react-i18next' -import Widget from 'src/shared/Widget' import { Space, Typography } from 'antd' +import Widget from 'src/shared/Widget' import './PublicAppeal.scss' const { Title } = Typography diff --git a/src/pages/singleLineMap/index.tsx b/src/pages/singleLineMap/index.tsx index 6c8fa569..86d0af7a 100644 --- a/src/pages/singleLineMap/index.tsx +++ b/src/pages/singleLineMap/index.tsx @@ -1,22 +1,22 @@ import moment from 'moment' import { useContext, useEffect, useMemo } from 'react' -import { getRoutesAsync } from 'src/api/gtfsService' -import LineNumberSelector from 'src/pages/components/LineSelector' -import OperatorSelector from 'src/pages/components/OperatorSelector' -import RouteSelector from 'src/pages/components/RouteSelector' -import { INPUT_SIZE } from 'src/resources/sizes' import { useTranslation } from 'react-i18next' +import Grid from '@mui/material/Unstable_Grid2' +import { CircularProgress, Tooltip } from '@mui/material' +import Typography from '@mui/material/Typography' import { SearchContext } from '../../model/pageState' import { NotFound } from '../components/NotFound' -import Grid from '@mui/material/Unstable_Grid2' import '../Map.scss' import { DateSelector } from '../components/DateSelector' -import { CircularProgress, Tooltip } from '@mui/material' import { FilterPositionsByStartTimeSelector } from '../components/FilterPositionsByStartTimeSelector' import { PageContainer } from '../components/PageContainer' import { MapWithLocationsAndPath } from '../components/map-related/MapWithLocationsAndPath' -import Typography from '@mui/material/Typography' import InfoYoutubeModal from '../components/YoutubeModal' +import { INPUT_SIZE } from 'src/resources/sizes' +import RouteSelector from 'src/pages/components/RouteSelector' +import OperatorSelector from 'src/pages/components/OperatorSelector' +import LineNumberSelector from 'src/pages/components/LineSelector' +import { getRoutesAsync } from 'src/api/gtfsService' import { useSingleLineData } from 'src/hooks/useSingleLineData' const SingleLineMapPage = () => { diff --git a/src/pages/timeBasedMap/index.tsx b/src/pages/timeBasedMap/index.tsx index 3b952583..b2e66622 100644 --- a/src/pages/timeBasedMap/index.tsx +++ b/src/pages/timeBasedMap/index.tsx @@ -8,22 +8,22 @@ import CircularProgress from '@mui/material/CircularProgress' import IconButton from '@mui/material/IconButton' import OpenInFullRoundedIcon from '@mui/icons-material/OpenInFullRounded' import moment from 'moment' -import getAgencyList, { Agency } from 'src/api/agencyList' -import useVehicleLocations from 'src/api/useVehicleLocations' -import { VehicleLocation } from 'src/model/vehicleLocation' import '../Map.scss' -import { DateSelector } from '../components/DateSelector' -import MinuteSelector from '../components/MinuteSelector' import Grid from '@mui/material/Unstable_Grid2' // Grid version 2 +import MinuteSelector from '../components/MinuteSelector' +import { DateSelector } from '../components/DateSelector' import { PageContainer } from '../components/PageContainer' -import { INPUT_SIZE } from 'src/resources/sizes' import { Label } from '../components/Label' import { getColorByHashString } from '../dashboard/AllLineschart/OperatorHbarChart/utils' import createClusterCustomIcon from '../components/utils/customCluster/customCluster' import { TimeSelector } from '../components/TimeSelector' import { busIcon, busIconPath } from '../components/utils/BusIcon' -import { BusToolTip } from 'src/pages/components/map-related/MapLayers/BusToolTip' import InfoYoutubeModal from '../components/YoutubeModal' +import { BusToolTip } from 'src/pages/components/map-related/MapLayers/BusToolTip' +import { INPUT_SIZE } from 'src/resources/sizes' +import { VehicleLocation } from 'src/model/vehicleLocation' +import useVehicleLocations from 'src/api/useVehicleLocations' +import getAgencyList, { Agency } from 'src/api/agencyList' export interface Point { loc: [number, number] diff --git a/src/routes/MainRoute.tsx b/src/routes/MainRoute.tsx index 8901e76f..7eeb2e0f 100644 --- a/src/routes/MainRoute.tsx +++ b/src/routes/MainRoute.tsx @@ -1,7 +1,6 @@ import { useCallback, useEffect } from 'react' import 'leaflet/dist/leaflet.css' import { useSearchParams } from 'react-router-dom' -import { PageSearchState, SearchContext } from '../model/pageState' import moment from 'moment' import { useSessionStorage } from 'usehooks-ts' import { useLocation } from 'react-router-dom' @@ -12,6 +11,7 @@ import rtlPlugin from 'stylis-plugin-rtl' import 'moment/locale/he' import { AdapterMoment } from '@mui/x-date-pickers/AdapterMoment' import { LocalizationProvider } from '@mui/x-date-pickers' +import { PageSearchState, SearchContext } from '../model/pageState' import { ThemeProvider } from '../layout/ThemeContext' import { PAGES } from '../routes' import { MainLayout } from '../layout' diff --git a/src/routes/index.tsx b/src/routes/index.tsx index dcabb28b..f0596ea3 100644 --- a/src/routes/index.tsx +++ b/src/routes/index.tsx @@ -31,9 +31,9 @@ import { LineChartOutlined, GithubOutlined, } from '@ant-design/icons' +import PsychologyIcon from '@mui/icons-material/Psychology' import { MainRoute } from './MainRoute' import { ErrorPage } from 'src/pages/ErrorPage' -import PsychologyIcon from '@mui/icons-material/Psychology' export const PAGES = [ { diff --git a/tests/clearButton.spec.ts b/tests/clearButton.spec.ts index c1a96ea2..cf957d1c 100644 --- a/tests/clearButton.spec.ts +++ b/tests/clearButton.spec.ts @@ -1,7 +1,7 @@ -import { test, expect, urlMatcher, setBrowserTime, getPastDate } from './utils' import type { Locator, Page } from '@playwright/test' import i18next from 'i18next' import Backend from 'i18next-fs-backend' +import { test, expect, urlMatcher, setBrowserTime, getPastDate } from './utils' import Selectors from './SelectorsModel' diff --git a/tests/singlelineTest.spec.ts b/tests/singlelineTest.spec.ts index 186e69b0..1279be56 100644 --- a/tests/singlelineTest.spec.ts +++ b/tests/singlelineTest.spec.ts @@ -1,5 +1,5 @@ -import { getPastDate, test, urlMatcher } from './utils' import SinglelinePage from '../src/test_pages/SinglelinePage' +import { getPastDate, test, urlMatcher } from './utils' test.describe('Single line page tests', () => { let singleLinePage: SinglelinePage diff --git a/tests/timeline.spec.ts b/tests/timeline.spec.ts index 85997673..69a9bf8e 100644 --- a/tests/timeline.spec.ts +++ b/tests/timeline.spec.ts @@ -1,7 +1,7 @@ -import TimelinePage from '../src/test_pages/TimelinePage' -import { getPastDate, test, urlMatcher } from './utils' import i18next from 'i18next' import Backend from 'i18next-fs-backend' +import TimelinePage from '../src/test_pages/TimelinePage' +import { getPastDate, test, urlMatcher } from './utils' test.describe('Timeline Page Tests', () => { let timelinePage: TimelinePage diff --git a/tests/utils.ts b/tests/utils.ts index 841843bc..6810ffc8 100644 --- a/tests/utils.ts +++ b/tests/utils.ts @@ -2,9 +2,9 @@ import * as fs from 'fs' import * as path from 'path' import * as crypto from 'crypto' +import { exec } from 'child_process' import { Matcher, test as baseTest, customMatcher } from 'playwright-advanced-har' import { BrowserContext, Page } from '@playwright/test' -import { exec } from 'child_process' const istanbulCLIOutput = path.join(process.cwd(), '.nyc_output') diff --git a/tests/visual.spec.ts b/tests/visual.spec.ts index 8fdd5108..f4d99dfe 100644 --- a/tests/visual.spec.ts +++ b/tests/visual.spec.ts @@ -1,6 +1,6 @@ -import { getBranch, test } from './utils' import { Eyes, Target } from '@applitools/eyes-playwright' import username from 'git-username' +import { getBranch, test } from './utils' test.describe('Visual Tests', () => { const eyes = new Eyes()