Skip to content

Commit

Permalink
Merge branch 'main' of github.com:hasadna/open-bus-map-search into Ro…
Browse files Browse the repository at this point in the history
…ni750/main
  • Loading branch information
NoamGaash committed Dec 18, 2023
2 parents c8ce833 + ac59b13 commit b77b97c
Show file tree
Hide file tree
Showing 26 changed files with 491 additions and 61 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/lint-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: 'Lint PR'

on:
pull_request_target:
types:
- opened
- edited
- synchronize

permissions:
pull-requests: read

jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
106 changes: 106 additions & 0 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: Preview
on:
pull_request:

env:
ASSET_URL: https://s3.amazonaws.com/noam-gaash.co.il/${{ github.run_id }}/open-bus/${{ github.sha }}
should_run: ${{ secrets.AWS_SECRET_ACCESS_KEY}}
jobs:
should_run:
runs-on: ubuntu-latest
outputs:
should_run: ${{ steps.set_should_run.outputs.should_run }}
steps:
- name: Set should_run
id: set_should_run
if: env.should_run
run: echo "::set-output name=should_run::true"

build:
runs-on: ubuntu-latest
needs: [should_run]
if: ${{ needs.should_run.outputs.should_run == 'true' }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
- name: Run install
uses: borales/actions-yarn@v4
with:
cmd: install
- name: Build
run: yarn build
- name: upload artifact
uses: actions/upload-artifact@v2
with:
name: dist
path: dist
build-storybook:
runs-on: ubuntu-latest
needs: [should_run]
if: ${{ needs.should_run.outputs.should_run == 'true' }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
- name: Run install
uses: borales/actions-yarn@v4
with:
cmd: install
- name: Build Storybook
run: yarn build-storybook -o dist/storybook
- name: upload artifact
uses: actions/upload-artifact@v2
with:
name: dist
path: dist
deploy-to-s3:
needs: [build, build-storybook]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: dist
path: dist
- uses: shallwefootball/s3-upload-action@master
name: Upload trace to S3
if: always()
id: s3-trace
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: dist
destination_dir: ${{ github.run_id }}/open-bus/${{ github.sha }}
- name: find comment
uses: peter-evans/find-comment@v1
if: github.event_name == 'pull_request'
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: 'Preview'
- name: update comment
uses: peter-evans/create-or-update-comment@v1
if: steps.fc.outputs.comment-id
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
edit-mode: replace
body: |
Preview: https://s3.amazonaws.com/noam-gaash.co.il/${{ github.run_id }}/open-bus/${{ github.sha }}/index.html
Preview Storybook: https://s3.amazonaws.com/noam-gaash.co.il/${{ github.run_id }}/open-bus/${{ github.sha }}/storybook/index.html
- name: create comment
uses: peter-evans/create-or-update-comment@v1
if: steps.fc.outputs.comment-id == ''
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
Preview: https://s3.amazonaws.com/noam-gaash.co.il/${{ github.run_id }}/open-bus/${{ github.sha }}/index.html
Preview Storybook: https://s3.amazonaws.com/noam-gaash.co.il/${{ github.run_id }}/open-bus/${{ github.sha }}/storybook/index.html
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ We've hidden a couple of fun surprises in our web app, just for you. Discovering
Watch the magic unfold as you type "storybook" on your keyboard. You might just stumble upon our Storybook, a treasure trove of UI components showcasing the beauty and functionality of our app.
- **Type "english":**
Feel like switching up the language? Type "english" and see the language toggle in action. Our app is multilingual, and you can experience it by triggering this secret command.
- **Type "geek":**
To get some experimental charts with some additional data and aggregation


## deployments
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"@mui/x-date-pickers": "^6.12.1",
"@types/leaflet.markercluster": "^1.5.2",
"@vitejs/plugin-react-swc": "^3.4.0",
"antd": "^4.22.5",
"antd": "^5.12.2",
"axios": "^1.6.0",
"classnames": "^2.3.2",
"dayjs": "^1.11.9",
Expand Down
1 change: 0 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'antd/dist/antd.min.css'
import './App.scss'
import 'leaflet/dist/leaflet.css'
import 'moment/locale/he'
Expand Down
7 changes: 6 additions & 1 deletion src/layout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import MainHeader from './header/Header'
import SideBar from './sidebar/SideBar'
import styled from 'styled-components'
import LayoutContext from './LayoutContext'
import { Outlet } from 'react-router-dom'
import { Link, Outlet } from 'react-router-dom'
import { Suspense } from 'react'
import Preloader from 'src/shared/Preloader'
import { EasterEgg } from 'src/pages/EasterEgg/EasterEgg'
Expand Down Expand Up @@ -39,6 +39,11 @@ export function MainLayout() {
<Envelope />
</a>
</EasterEgg>
<EasterEgg code="geek">
<Link to="/data-research">
<Envelope />
</Link>
</EasterEgg>
</Suspense>
</StyledBody>
</StyledContent>
Expand Down
15 changes: 11 additions & 4 deletions src/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,13 @@
"from_date": "dated",
"to_date": "Until",
"watch_locations_in_range": "View bus locations within a range of",
"minutes": "דקות",
"minutes_5": "5 דקות",
"minutes": "minutes",
"minutes_5": "5 minutes",
"show_x_bus_locations": "Bus locations",
"from_time_x_to_time_y": "From XXX to YYY",
"choose_start_time": "Select a start time",
"group_by_hour_tooltip_content": "Kibbutz by hour",
"loading_times_tooltip_content": "Loading bus times. Current times available to use",
"group_by_hour_tooltip_content": "Group by hour",
"start": "start",
"end": "end",
"about_title": "About",
Expand Down Expand Up @@ -109,5 +110,11 @@
"bearing": "bearing",
"coords": "coords",
"hide_document": "hide document",
"show_document": "show document"
"show_document": "show document",
"dashboard_page_graph_title_hour": "Percentage of rides out, by hour",
"dashboard_page_graph_title_day": "Percentage of rides out, by day",
"group_by_day_tooltip_content": "Group by day",
"order_by_hour": "by hour",
"order_by_severity": "by severity",
"choose_dates": "Dates"
}
15 changes: 14 additions & 1 deletion src/locale/he.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"show_x_bus_locations": "מיקומי אוטובוסים",
"from_time_x_to_time_y": "משעה XXX עד שעה YYY",
"choose_start_time": "בחירת שעת התחלה",
"loading_times_tooltip_content": "שעות נוספות בטעינה. ניתן להשתמש בשעות הזמינות כבר עכשיו",
"group_by_hour_tooltip_content": "קיבוץ לפי שעה",
"start": "התחלה",
"end": "סיום",
Expand Down Expand Up @@ -114,5 +115,17 @@
"lineProfile": {
"title": "פרופיל קו",
"notFound":"לא הצלחנו למצוא את הקו שחיפשת :("
}
},
"errorPage": {
"title": "אופס, משהו השתבש",
"text": "אנא נסה שוב מאוחר יותר",
"text2": "אם הבעיה נמשכת, אנא פנה אלינו בכתובת:",
"button": "חזרה לדף הבית"
},
"dashboard_page_graph_title_hour": "אחוזי יציאה מסך הנסיעות לפי שעה",
"dashboard_page_graph_title_day": "אחוזי יציאה מסך הנסיעות לפי יום",
"group_by_day_tooltip_content": "קיבוץ לפי יום",
"order_by_hour": "לפי שעה",
"order_by_severity": "לפי חומרה",
"choose_dates": "תאריכים"
}
2 changes: 2 additions & 0 deletions src/locale/utils.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
const PLACEHOLDER = 'XXX'
export const formatted = (text: string, value: string) => text.replace(PLACEHOLDER, value)
3 changes: 3 additions & 0 deletions src/pages/DataResearch/DataResearch.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.recharts-tooltip-wrapper {
z-index: 1;
}
Loading

0 comments on commit b77b97c

Please sign in to comment.