Git Product home page Git Product logo

shamash's Issues

Support prefers-color-scheme

Today we support light and dark modes which can be toggled with a button in the menu. See pic:
image

We should also support the cool prefers-color-scheme CSS media feature which detects the user's theme preference set in the operating system.

Today's theme preference is saved in localStorage. The logic for setting happens on page load in App.js:

let logo
if (window.localStorage.getItem('theme') === 'dark') {
  require('../css/darktheme.css')
  logo = require('../static/img/entur-white.png')
} else {
  logo = require('../static/img/entur.png')
}

The darktheme.css stylesheet is loaded if "dark theme" is set in localStorage. The button for switching theme simply updates localStorage.

I'm not sure what's the best way of implementing this is, but if you would want to have a go at it, feel free! ๐ŸŽ‰

Tweak dark theme colors

The dark mode is nice, but some colors have too low contrast.

  1. The comma is black and basically invisible
    image
    Do you see the comma between 10 and omitNonBoarding? No? It's there. It should be much lighter.

  2. The curly brackets, colon and parenthesis are too dark
    image

  3. The text in the top menus is too light
    image

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: Failed to decrypt field npmToken. Please re-encrypt and try again.

Setup TypeScript for React project, convert one file

This is a Node.js and React project. Having TypeScript would be very nice.

A pull request would be greatly appreciated, that

  • Sets up a proper TypeScript config (tsconfig.js)
  • Converts at least one file from .js to .ts (or .tsx) in src/ to prove it works

This project does have a Node.js server, but it has no build (transpilation/compilation) step. Therefore it is sufficient to only consider the React frontend part for now.

The React app is based on Create React App, and therefore the react-scripts package is used for building and running it.

Initialize ESLint with recommended rules

We should add ESLint in order to ensure basic code quality and consistency. The ESLint config should extend eslint:recommended and recommended rules for React.

Other rules

  • indent: 4 spaces
  • semicolon: never

Let's also add a script in package.json so we can use npm run lint for running ESLint.

Click outside modal should close the modal

If you click "Search for ID" in the top menu, a wild modal appears. The only way to close this modal is to press the X in the top right of it. It should also be possible to click anywhere outside the modal to close it.

image

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Warning

These dependencies are deprecated:

Datasource Name Replacement PR?
npm babel-eslint Available
npm subscriptions-transport-ws Unavailable

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • fix(deps): update dependency @entur/table from v4.8.7 to v4.8.15
  • fix(deps): update dependency @pmmmwh/react-refresh-webpack-plugin from v0.5.13 to v0.5.15
  • fix(deps): update dependency semver from v7.6.2 to v7.6.3
  • fix(deps): update dependency @apollo/client from v3.10.3 to v3.11.4
  • fix(deps): update dependency @babel/core from v7.24.5 to v7.25.2
  • fix(deps): update dependency eslint-plugin-jsx-a11y from v6.8.0 to v6.9.0
  • fix(deps): update dependency eslint-plugin-react from v7.34.1 to v7.35.0
  • fix(deps): update dependency graphql from v15.8.0 to v15.9.0
  • fix(deps): update dependency eslint-webpack-plugin from v2.7.0 to v4
  • fix(deps): update dependency fs-extra from v9.1.0 to v11
  • fix(deps): update dependency graphiql from v1.11.5 to v3
  • fix(deps): update dependency graphql from v15.8.0 to v16
  • fix(deps): update dependency history from v4.10.1 to v5
  • fix(deps): update dependency html-webpack-plugin from v4.5.2 to v5
  • fix(deps): update dependency husky from v3.1.0 to v9
  • fix(deps): update dependency isomorphic-fetch from v2.2.1 to v3
  • fix(deps): update dependency jest-watch-typeahead from v0.6.5 to v2
  • fix(deps): update dependency lint-staged from v9.5.0 to v15
  • fix(deps): update dependency mini-css-extract-plugin from v0.12.0 to v2
  • fix(deps): update dependency optimize-css-assets-webpack-plugin from v5.0.8 to v6
  • fix(deps): update dependency postcss-flexbugs-fixes from v4.2.1 to v5
  • fix(deps): update dependency postcss-loader from v3.0.0 to v8
  • fix(deps): update dependency postcss-normalize from v8.0.1 to v10
  • fix(deps): update dependency postcss-preset-env from v6.7.2 to v10
  • fix(deps): update dependency postcss-safe-parser from v5.0.2 to v7
  • fix(deps): update dependency query-string from v6.14.1 to v9
  • fix(deps): update dependency react-app-polyfill from v2.0.0 to v3
  • fix(deps): update dependency react-dev-utils from v11.0.4 to v12
  • fix(deps): update dependency react-helmet from v5.2.1 to v6
  • fix(deps): update dependency react-leaflet from v3.2.5 to v4
  • fix(deps): update dependency resolve-url-loader from v3.1.5 to v5
  • fix(deps): update dependency sass-loader from v10.5.2 to v16
  • fix(deps): update dependency style-loader from v1.3.0 to v4
  • fix(deps): update dependency terser-webpack-plugin from v4.2.3 to v5
  • fix(deps): update dependency uuid from v3.4.0 to v10
  • fix(deps): update dependency webpack from v4.47.0 to v5
  • fix(deps): update dependency webpack-dev-server from v3.11.3 to v5
  • fix(deps): update dependency webpack-manifest-plugin from v2.2.0 to v5
  • fix(deps): update dependency workbox-webpack-plugin from v5.1.4 to v7
  • fix(deps): update jest monorepo from v26.6.3 to v29 (major) (babel-jest, jest, jest-circus, jest-resolve)
  • fix(deps): update react monorepo from v16.14.0 to v18 (major) (react, react-dom, react-test-renderer)
  • fix(deps): update testing-library monorepo (major) (@testing-library/jest-dom, @testing-library/react, @testing-library/user-event)
  • fix(deps): update turf monorepo from v6.5.0 to v7 (major) (@turf/bbox, @turf/helpers, @turf/line-to-polygon)
  • fix(deps): update typescript-eslint monorepo from v4.33.0 to v8 (major) (@typescript-eslint/eslint-plugin, @typescript-eslint/parser)
  • ๐Ÿ” Create all rate-limited PRs at once ๐Ÿ”

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/firebase-hosting-merge.yml
  • actions/checkout v3
  • actions/setup-node v3
  • actions/cache v3
  • actions/upload-artifact v3
  • actions/checkout v3
  • actions/download-artifact v3
  • FirebaseExtended/action-hosting-deploy v0
  • actions/checkout v3
  • actions/download-artifact v3
  • FirebaseExtended/action-hosting-deploy v0
  • actions/checkout v3
  • actions/download-artifact v3
  • FirebaseExtended/action-hosting-deploy v0
.github/workflows/firebase-hosting-pull-request.yml
  • actions/checkout v3
  • actions/setup-node v3
  • actions/cache v3
  • actions/upload-artifact v3
  • actions/checkout v3
  • actions/download-artifact v3
  • FirebaseExtended/action-hosting-deploy v0
npm
package.json
  • @apollo/client 3.10.3
  • @babel/core 7.24.5
  • @entur/form 3.4.7
  • @entur/icons 1.20.0
  • @entur/sdk 1.11.1
  • @entur/table 4.8.7
  • @mapbox/polyline 1.2.1
  • @pmmmwh/react-refresh-webpack-plugin 0.5.13
  • @svgr/webpack 5.5.0
  • @testing-library/jest-dom 4.2.4
  • @testing-library/react 9.5.0
  • @testing-library/user-event 7.2.1
  • @turf/bbox 6.5.0
  • @turf/helpers 6.5.0
  • @turf/line-to-polygon 6.5.0
  • @typescript-eslint/eslint-plugin 4.33.0
  • @typescript-eslint/parser 4.33.0
  • babel-eslint 10.1.0
  • babel-jest 26.6.3
  • babel-loader 8.3.0
  • babel-plugin-named-asset-import 0.3.8
  • babel-preset-react-app 10.0.1
  • bfj 7.1.0
  • camelcase 6.3.0
  • case-sensitive-paths-webpack-plugin 2.4.0
  • css-loader 4.3.0
  • dotenv 8.6.0
  • dotenv-expand 5.1.0
  • enzyme 3.11.0
  • enzyme-adapter-react-16 1.15.8
  • eslint 7.32.0
  • eslint-config-react-app 6.0.0
  • eslint-plugin-flowtype 5.10.0
  • eslint-plugin-import 2.29.1
  • eslint-plugin-jest 24.7.0
  • eslint-plugin-jsx-a11y 6.8.0
  • eslint-plugin-react 7.34.1
  • eslint-plugin-react-hooks 4.6.2
  • eslint-plugin-testing-library 3.10.2
  • eslint-webpack-plugin 2.7.0
  • file-loader 6.2.0
  • fs-extra 9.1.0
  • graphiql 1.11.5
  • graphiql-explorer 0.9.0
  • graphql 15.8.0
  • graphql-ws 5.16.0
  • history 4.10.1
  • html-webpack-plugin 4.5.2
  • husky 3.1.0
  • identity-obj-proxy 3.0.0
  • isomorphic-fetch 2.2.1
  • jest 26.6.3
  • jest-circus 26.6.3
  • jest-resolve 26.6.2
  • jest-watch-typeahead 0.6.5
  • leaflet 1.9.4
  • lint-staged 9.5.0
  • lodash.debounce 4.0.8
  • mini-css-extract-plugin 0.12.0
  • optimize-css-assets-webpack-plugin 5.0.8
  • pnp-webpack-plugin 1.7.0
  • postcss-flexbugs-fixes 4.2.1
  • postcss-loader 3.0.0
  • postcss-normalize 8.0.1
  • postcss-preset-env 6.7.2
  • postcss-safe-parser 5.0.2
  • prompts 2.4.2
  • query-string 6.14.1
  • react 16.14.0
  • react-app-polyfill 2.0.0
  • react-dev-utils 11.0.4
  • react-dom 16.14.0
  • react-helmet 5.2.1
  • react-leaflet 3.2.5
  • react-refresh 0.14.2
  • react-test-renderer 16.14.0
  • resolve 1.22.8
  • resolve-url-loader 3.1.5
  • sass-loader 10.5.2
  • semver 7.6.2
  • style-loader 1.3.0
  • subscriptions-transport-ws 0.11.0
  • terser-webpack-plugin 4.2.3
  • ts-pnp 1.2.0
  • url-loader 4.1.1
  • uuid 3.4.0
  • webpack 4.47.0
  • webpack-dev-server 3.11.3
  • webpack-manifest-plugin 2.2.0
  • workbox-webpack-plugin 5.1.4
  • eslint-plugin-prettier 3.4.1
  • prettier 2.8.8

  • Check this box to trigger a request for Renovate to run again on this repository

Mismatch between docs and query response for "transportModes"

I highly doubt this is the exact right repo for this (more likely in the openjourneyplanner or just the underlying docs depending on your perspective), but in the docs in the sidebar in shamash one can read the following :

transportModes: [TransportModes]

The allowed modes for the transit part of the trip. Use an empty list to disallow transit for this search. If the element is not present or null, it will default to all transport modes.

If attempting the following query:

{
  trip(
    from: {
      name: "Bjerkealleen 5A, Skedsmo"
      coordinates: {
        latitude: 59.96050414081307
        longitude:11.040338686322317
      }
    }
    to: {
      place:"NSR:StopPlace:385"
      name:"Alna, Oslo"
    }
    numTripPatterns: 3
    dateTime: "2023-09-25T16:35:26.652807"
    walkSpeed: 1.3
    arriveBy: false
    modes: {
       transportModes: null
    }
  )

#### Requested fields
  {
    tripPatterns {
      expectedStartTime
      duration
      walkDistance
      legs {
        mode
        distance
        line {
          id
          publicCode
        }
      }
    }
  }
}

then i get the following response:

{
  "errors": [
    {
      "message": "Exception while fetching data (/trip) : Cannot invoke \"java.util.List.isEmpty()\" because \"transportModes\" is null",
      "locations": [
        {
          "line": 20,
          "column": 3
        }
      ],
      "path": [
        "trip"
      ],
      "extensions": {
        "classification": "DataFetchingException"
      }
    }
  ],
  "data": null
}

Add dark theme colors for modal

If you click "Search for ID" a modal opens. This modal has only light theme support. It should also have a dark theme.

The exact colors are not important. We don't follow a strict color palette (yet). Just pick some dark colors for the background and light colors for the foreground. :D

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.