Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix debug info on single-line-map page #27

Closed
wants to merge 50 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
29d89a9
fix debug info on single-line-map page
moshe742 Aug 15, 2023
ef86e01
Merge branch 'main' of github.com:hasadna/open-bus-map-search
moshe742 Aug 28, 2023
2aee4ff
fix RTL and support Hebrew
aviv1620 Sep 13, 2023
8966dd3
fix bug app crash when user enter sate manual.
aviv1620 Sep 14, 2023
0916be0
fix:debounce bug
ArkadiK94 Sep 16, 2023
ecdc121
Update README.md
ArkadiK94 Sep 16, 2023
35636ca
Merge branch 'main' into main
NoamGaash Sep 17, 2023
94689b0
test: fix
NoamGaash Sep 17, 2023
d7cb164
test: add retry in CI
NoamGaash Sep 17, 2023
a1a313a
Added about page.
Mordechai1323 Sep 17, 2023
91a86b1
test: add reports uploading
NoamGaash Sep 17, 2023
ecf9e4b
Added buttons for about, donate, and report a bug
Mordechai1323 Sep 17, 2023
a2365b9
fix: print to summary
NoamGaash Sep 17, 2023
3446792
ci: bucket name is not a secret
NoamGaash Sep 17, 2023
5ca67be
Added slack icon
Mordechai1323 Sep 17, 2023
49f7295
ci: allways get traces
NoamGaash Sep 17, 2023
53bb56c
ci: lint
NoamGaash Sep 17, 2023
4f25597
fix: lint issues
NoamGaash Sep 17, 2023
287e1bb
chore: upgrade eslint
NoamGaash Sep 17, 2023
75be0ff
test: increase timeout
NoamGaash Sep 17, 2023
79c0601
fix: svg typescript problem
NoamGaash Sep 17, 2023
4c02a39
Merge pull request #45 from hasadna/test/fix-playwright
NoamGaash Sep 17, 2023
52b56b1
Merge branch 'main' into ci/lint
NoamGaash Sep 17, 2023
7e1feb0
Merge branch 'main' into readme/edit
NoamGaash Sep 17, 2023
2a97da6
Merge branch 'main' into fix/bug
NoamGaash Sep 17, 2023
42a0395
fix: no s3 upload failing on forks
NoamGaash Sep 17, 2023
f49d609
fix: build
NoamGaash Sep 17, 2023
f4f9ee5
Merge pull request #48 from hasadna/ci/lint
NoamGaash Sep 17, 2023
f2b5115
Merge branch 'main' into fix/no-s3-upload-failing-on-forks
NoamGaash Sep 17, 2023
cf83539
Merge pull request #49 from hasadna/fix/no-s3-upload-failing-on-forks
NoamGaash Sep 17, 2023
e1fd594
Merge branch 'main' into fix/bug
NoamGaash Sep 17, 2023
fbefd8b
Merge branch 'main' into readme/edit
NoamGaash Sep 17, 2023
6bd4874
ci: add build job
NoamGaash Sep 17, 2023
c408f73
Merge pull request #42 from ArkadiK94/fix/bug
NoamGaash Sep 17, 2023
17cc8a6
Merge branch 'main' into add-repo-hasadna-refs
NoamGaash Sep 17, 2023
df83b34
limit ci to main pushes
NoamGaash Sep 17, 2023
e34e9cf
Merge branch 'main' into ci/add-build-job
NoamGaash Sep 17, 2023
5a75730
Merge branch 'main' into readme/edit
NoamGaash Sep 17, 2023
d70185d
Merge pull request #47 from Mordechai1323/add-repo-hasadna-refs
NoamGaash Sep 17, 2023
4ed1a41
Merge branch 'main' into readme/edit
NoamGaash Sep 17, 2023
b7c5794
Merge branch 'main' into ci/add-build-job
NoamGaash Sep 17, 2023
df5605b
Merge pull request #43 from ArkadiK94/readme/edit
NoamGaash Sep 17, 2023
e65622c
Merge pull request #50 from hasadna/ci/add-build-job
NoamGaash Sep 18, 2023
630be20
to prevent conflict I refactor the app in another PR
aviv1620 Sep 18, 2023
9dbf0ea
Merge remote-tracking branch 'upstream/main' into fix-inputs-design
aviv1620 Sep 18, 2023
91b96af
add the about page
aviv1620 Sep 18, 2023
b026483
temporary solution Navigate component not work
aviv1620 Sep 18, 2023
ba0529d
Merge pull request #53 from aviv1620/fix-inputs-design
NoamGaash Sep 18, 2023
a3ab037
feat: add filter on worst buses
moshe742 Sep 18, 2023
1adde73
Merge branch 'main' of github.com:moshe742/open-bus-map-search
moshe742 Sep 18, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
"browser": true,
"es2021": true
},
"settings": {
"react": {
"version": "detect"
}
},
"extends": [
"eslint:recommended",
"plugin:react/recommended",
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
ci:
runs-on: ubuntu-20.04
Expand Down
40 changes: 39 additions & 1 deletion .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,42 @@ jobs:
with:
name: playwright-report
path: playwright-report/
retention-days: 30
retention-days: 30\
- uses: shallwefootball/s3-upload-action@master
name: Upload report to S3
if: always()
id: s3-report
continue-on-error: true
with:
aws_key_id: ${{ secrets.AWS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY}}
aws_bucket: noam-gaash.co.il
source_dir: playwright-report
destination_dir: ${{ github.run_id }}/open-bus/playwright-report
- name: output link to report to the summary
if: always() && steps.s3-report.outcome == 'success'
run: echo "link to report - https://s3.amazonaws.com/noam-gaash.co.il/$GITHUB_RUN_ID/open-bus/playwright-report/index.html" >> $GITHUB_STEP_SUMMARY

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Install dependencies
run: yarn
- name: Run lint
run: yarn lint

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Install dependencies
run: yarn
- name: Build
run: yarn build
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ This app is created by the volunteers of [Public Knowledge Workshop](https://www

### Running the project:

- fork the repo
- clone the repo
- `yarn install`
- `yarn start`
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"recharts": "^2.4.3",
"sass": "^1.58.3",
"styled-components": "^5.3.5",
"stylis-plugin-rtl": "^2.1.1",
"typescript": "^4.7.4",
"underscore.string": "^3.3.6",
"usehooks-ts": "^2.9.1",
Expand Down Expand Up @@ -70,10 +71,10 @@
"@types/underscore.string": "^0.0.38",
"@typescript-eslint/eslint-plugin": "^5.35.1",
"@typescript-eslint/parser": "^5.35.1",
"eslint": "8.22.0",
"eslint": "^8.49.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.31.1",
"eslint-plugin-react": "^7.33.2",
"openapi-typescript-codegen": "^0.23.0",
"prettier": "^2.7.1"
},
Expand Down
11 changes: 6 additions & 5 deletions playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ export default defineConfig({
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,
/* Retry on CI only */
retries: process.env.CI ? 2 : 0,
/* Retry twice on CI. */
retries: process.env.CI ? 2 : 1,
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: 'html',
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
// baseURL: 'http://127.0.0.1:3000',
baseURL: 'http://127.0.0.1:3000',

/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'on-first-retry',
trace: process.env.CI ? 'on' : 'on-all-retries',
},

/* Configure projects for major browsers */
Expand Down Expand Up @@ -71,7 +71,8 @@ export default defineConfig({
/* Run your local dev server before starting the tests */
webServer: {
command: 'yarn start',
url: 'http://localhost:3000',
reuseExistingServer: !process.env.CI,
timeout: 120 * 1000,
port: 3000,
},
})
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="en">
<html lang="he" dir="rtl">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
Expand Down
101 changes: 70 additions & 31 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,15 @@ import RealtimeMapPage from './pages/RealtimeMapPage'
import SingleLineMapPage from './pages/SingleLineMapPage'
import { useLocation } from 'react-router-dom'
import ReactGA from 'react-ga4'
import { LocalizationProvider } from '@mui/x-date-pickers'
import { AdapterMoment } from '@mui/x-date-pickers/AdapterMoment'
import { CacheProvider } from '@emotion/react'
import createCache from '@emotion/cache'
import rtlPlugin from 'stylis-plugin-rtl'
import 'moment/locale/he'
import { heIL as heILmui } from '@mui/x-date-pickers/locales'
import { ThemeProvider, createTheme } from '@mui/material'
import { AdapterMoment } from '@mui/x-date-pickers/AdapterMoment'
import { LocalizationProvider } from '@mui/x-date-pickers'
import About from './pages/About'

const { Content } = Layout

Expand Down Expand Up @@ -58,14 +64,36 @@ const PAGES = [
label: TEXTS.singleline_map_page_title,
key: '/single-line-map',
},
{
label: TEXTS.about_title,
key: '/about',
},
{
label: TEXTS.report_a_bug_title,
key: 'https://github.com/hasadna/open-bus-map-search/issues',
},
{
label: TEXTS.donate_title,
key: 'https://www.jgive.com/new/he/ils/donation-targets/3268#donation-modal',
},
]

const theme = createTheme({
palette: {
primary: {
main: '#5f5bff',
const theme = createTheme(
{
direction: 'rtl',
palette: {
primary: {
main: '#5f5bff',
},
},
},
heILmui,
)

// Create rtl cache
const cacheRtl = createCache({
key: 'muirtl',
stylisPlugins: [rtlPlugin],
})

const App = () => {
Expand Down Expand Up @@ -105,31 +133,42 @@ const App = () => {
}, [])

return (
<ThemeProvider theme={theme}>
<LocalizationProvider dateAdapter={AdapterMoment}>
<SearchContext.Provider value={{ search, setSearch: safeSetSearch }}>
<ConfigProvider direction="rtl" locale={heIL}>
<StyledLayout className="main">
<Header pages={PAGES} />
<Layout>
<StyledContent>
<StyledBody>
<Routes>
<Route path={PAGES[0].key} element={<DashboardPage />} />
<Route path={PAGES[1].key} element={<TimelinePage />} />
<Route path={PAGES[2].key} element={<GapsPage />} />
<Route path={PAGES[3].key} element={<RealtimeMapPage />} />
<Route path={PAGES[4].key} element={<SingleLineMapPage />} />
<Route path="*" element={<Navigate to={PAGES[0].key} replace />} />
</Routes>
</StyledBody>
</StyledContent>
</Layout>
</StyledLayout>
</ConfigProvider>
</SearchContext.Provider>
</LocalizationProvider>
</ThemeProvider>
<SearchContext.Provider value={{ search, setSearch: safeSetSearch }}>
<CacheProvider value={cacheRtl}>
<ThemeProvider theme={theme}>
<LocalizationProvider dateAdapter={AdapterMoment} adapterLocale="he">
<ConfigProvider direction="rtl" locale={heIL}>
<StyledLayout className="main">
<Header pages={PAGES} />
<Layout>
<StyledContent>
<StyledBody>
<Routes>
<Route path={PAGES[0].key} element={<DashboardPage />} />
<Route path={PAGES[1].key} element={<TimelinePage />} />
<Route path={PAGES[2].key} element={<GapsPage />} />
<Route path={PAGES[3].key} element={<RealtimeMapPage />} />
<Route path={PAGES[4].key} element={<SingleLineMapPage />} />
<Route path={PAGES[5].key} element={<About />} />
<Route
path="*"
element={
<div>
<a href={PAGES[0].key}>click to navigate to dashboard.</a>
<Navigate to={PAGES[0].key} replace />
</div>
}
/>
</Routes>
</StyledBody>
</StyledContent>
</Layout>
</StyledLayout>
</ConfigProvider>
</LocalizationProvider>
</ThemeProvider>
</CacheProvider>
</SearchContext.Provider>
)
}

Expand Down
2 changes: 1 addition & 1 deletion src/api/searchLocationService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export async function searchLocationByQueryAsync(query: string): Promise<LatLngT
'https://nominatim.openstreetmap.org/search?countrycodes=il&format=json&q=' +
encodeURIComponent(query),
)
const data = result.data as any[]
const data = result.data
if (data.length === 0) {
return null
}
Expand Down
Loading
Loading