Skip to content

Commit

Permalink
Merge branch 'main' into Mobile-support
Browse files Browse the repository at this point in the history
  • Loading branch information
moshefortgang committed Nov 30, 2023
2 parents e28ab65 + 7e8c160 commit f2546ef
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 63 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/ci.yml → .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
name: CI
name: CD
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
ci:
cd:
environment: production
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- env:
DOCKER_APP_IMAGE_NAME: "ghcr.io/hasadna/open-bus-map-search/open-bus-map-search"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HASADNA_K8S_DEPLOY_KEY: ${{ secrets.HASADNA_K8S_DEPLOY_KEY }}
if: env.HASADNA_K8S_DEPLOY_KEY && env.GITHUB_TOKEN
run: |
echo "${GITHUB_TOKEN}" | docker login ghcr.io -u hasadna --password-stdin &&\
if docker pull "${DOCKER_APP_IMAGE_NAME}:latest"; then
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/docker_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: test docker
on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
docker-build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: check the dockerfile
run: |
docker build .
38 changes: 4 additions & 34 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import { useCallback, useEffect } from 'react'
import 'antd/dist/antd.min.css'
import './App.scss'
import { ConfigProvider, Layout } from 'antd'
import { ConfigProvider } from 'antd'
import 'leaflet/dist/leaflet.css'
import styled from 'styled-components'
import heIL from 'antd/es/locale/he_IL'
import { BrowserRouter as Router, 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'
import ReactGA from 'react-ga4'
import { CacheProvider } from '@emotion/react'
Expand All @@ -21,25 +19,9 @@ import { ThemeProvider, createTheme } from '@mui/material'
import { AdapterMoment } from '@mui/x-date-pickers/AdapterMoment'
import { LocalizationProvider } from '@mui/x-date-pickers'

import RoutesList, { PAGES } from './routes'
import MainHeader from './layout/header/Header'
import SideBar from './layout/sidebar/SideBar'
import LayoutContext from './layout/LayoutContext'
import { PAGES } from './routes'
import { EasterEgg } from './pages/EasterEgg/EasterEgg'
const { Content } = Layout

const StyledLayout = styled(Layout)`
height: 100vh;
`
const StyledContent = styled(Content)`
margin: 24px 16px 0;
overflow: auto;
`

const StyledBody = styled.div`
padding: 24px;
min-height: 360px;
`
import MainLayout from './layout'

const theme = createTheme(
{
Expand Down Expand Up @@ -110,19 +92,7 @@ const App = () => {
<ThemeProvider theme={theme}>
<LocalizationProvider dateAdapter={AdapterMoment} adapterLocale="he">
<ConfigProvider direction="rtl" locale={heIL}>
<StyledLayout className="main">
<LayoutContext>
<SideBar />
<Layout>
<MainHeader />
<StyledContent>
<StyledBody>
<RoutesList />
</StyledBody>
</StyledContent>
</Layout>
</LayoutContext>
</StyledLayout>
<MainLayout />
</ConfigProvider>
</LocalizationProvider>
</ThemeProvider>
Expand Down
40 changes: 40 additions & 0 deletions src/layout/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { Layout } from 'antd'
import MainHeader from './header/Header'
import SideBar from './sidebar/SideBar'
import styled from 'styled-components'
import LayoutContext from './LayoutContext'
import RoutesList from '../routes'

const { Content } = Layout

const StyledLayout = styled(Layout)`
height: 100vh;
`
const StyledContent = styled(Content)`
margin: 24px 16px 0;
overflow: auto;
`
const StyledBody = styled.div`
padding: 24px;
min-height: 360px;
`

function MainLayout() {
return (
<StyledLayout className="main">
<LayoutContext>
<SideBar />
<Layout>
<MainHeader />
<StyledContent>
<StyledBody>
<RoutesList />
</StyledBody>
</StyledContent>
</Layout>
</LayoutContext>
</StyledLayout>
)
}

export default MainLayout
6 changes: 2 additions & 4 deletions src/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,6 @@
"bug_type":"Type of request",
"bug_type_message":"Please enter the type of request",
"bug_type_bug":"Bug",
"bug_type_feature":"Feature Request"



"bug_type_feature":"Feature Request",
"funding_paragraph": "The Databus project is developed by the Hasadna for public knowledge, by the contributions of volunteers, and based upon"
}
3 changes: 2 additions & 1 deletion src/locale/he.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,5 +93,6 @@
"bug_type":"סוג הבקשה",
"bug_type_message":"אנא הזן סוג בקשה!",
"bug_type_bug":"באג",
"bug_type_feature":"בקשה לפיתוח"
"bug_type_feature":"בקשה לפיתוח",
"funding_paragraph": "דאטאבוס פותח בסדנא לידע ציבורי, בעבודת מתנדבים, ומבוסס על"
}
35 changes: 18 additions & 17 deletions src/pages/About.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import styled from 'styled-components'
import { TEXT_KEYS } from 'src/resources/texts'
import SlackIcon from '../resources/slack-icon.svg'
import { useTranslation } from 'react-i18next'

Expand All @@ -23,11 +22,11 @@ const WhatIsWebsite = () => {

return (
<ParagraphStyle>
<h2>{t(TEXT_KEYS.what_is_website)}</h2>
<p>{t(TEXT_KEYS.what_is_website_paragraph)}</p>
<h2>{t('what_is_website')}</h2>
<p>{t('what_is_website_paragraph')}</p>
<ul style={{ listStyle: 'disc', paddingRight: '40px' }}>
<li>{t(TEXT_KEYS.planning_information)}</li>
<li>{t(TEXT_KEYS.performance_information)}</li>
<li>{t('planning_information')}</li>
<li>{t('performance_information')}</li>
</ul>
</ParagraphStyle>
)
Expand All @@ -38,8 +37,8 @@ const DiscoveredMistake = () => {

return (
<ParagraphStyle>
<h2>{t(TEXT_KEYS.discovered_mistake)}</h2>
<p>{t(TEXT_KEYS.discovered_mistake_paragraph)}</p>
<h2>{t('discovered_mistake')}</h2>
<p>{t('discovered_mistake_paragraph')}</p>
</ParagraphStyle>
)
}
Expand All @@ -49,7 +48,7 @@ const Privacy = () => {

return (
<ParagraphStyle>
<h2>{t(TEXT_KEYS.privacy)}</h2>
<h2>{t('privacy')}</h2>
<p>
באתר מוטמע שירות{' '}
<a href="https://marketingplatform.google.com/about/analytics/">Google Analytics </a>
Expand All @@ -67,7 +66,7 @@ const License = () => {

return (
<ParagraphStyle>
<h2>{t(TEXT_KEYS.license)}</h2>
<h2>{t('license')}</h2>
<p>
כל המידע המוצג באתר מבוסס על נתונים המפורסמים במקורות המידע הממשלתיים. השימוש במידע כפוף ל
<a href="https://creativecommons.org/licenses/by-sa/4.0/">רישיון CC BY-SA 4.0 </a>
Expand All @@ -83,7 +82,7 @@ const Questions = () => {

return (
<ParagraphStyle>
<h2>{t(TEXT_KEYS.questions)}</h2>
<h2>{t('questions')}</h2>
<ul>
<li>
<a href="https://www.hasadna.org.il/%D7%A6%D7%95%D7%A8-%D7%A7%D7%A9%D7%A8/">
Expand Down Expand Up @@ -111,15 +110,18 @@ const Funding = () => {

return (
<ParagraphStyle>
<h2>{t(TEXT_KEYS.funding)}</h2>
<p>{t(TEXT_KEYS.funding_paragraph)}</p>
<h2>{t('funding')}</h2>
<div>
<p>{t('funding_paragraph')}</p>
<a href="https://open-bus-stride-api.hasadna.org.il/docs">Open API</a>
</div>
<ul>
<li>{t(TEXT_KEYS.mr_meir)}</li>
<li>{t(TEXT_KEYS.innovation_authority)}</li>
<li>{t(TEXT_KEYS.migdal_company)}</li>
<li>{t('mr_meir')}</li>
<li>{t('innovation_authority')}</li>
<li>{t('migdal_company')}</li>
<li>
<a href="https://www.jgive.com/new/he/ils/donation-targets/3268#donation-modal">
{t(TEXT_KEYS.and_smaller_donors)}
{t('and_smaller_donors')}
</a>
</li>
</ul>
Expand Down Expand Up @@ -147,7 +149,6 @@ const ParagraphStyle = styled.div`
& p {
font-size: 1.15em;
}
& ul {
list-style: none;
padding: 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default function ArrivalByTimeChart({
.map((group) => (
<div key={group[0].name}>
<h3 className="title">{group[0].name}</h3>
<ResponsiveContainer width="100%" height={300}>
<ResponsiveContainer debounce={1000} width="100%" height={300}>
<LineChart
data={group
.sort((a, b) => (a.gtfs_route_date < b.gtfs_route_date ? 1 : -1))
Expand Down

0 comments on commit f2546ef

Please sign in to comment.