Skip to content

Commit

Permalink
Merge pull request #6090 from entur/debug-ui-wheelchair-accessible
Browse files Browse the repository at this point in the history
Add wheelchair accessible checkbox to Debug UI
  • Loading branch information
leonardehrenfried authored Sep 30, 2024
2 parents 8cf6db5 + 25194e2 commit f285066
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 0 deletions.
6 changes: 6 additions & 0 deletions client/src/components/SearchBar/SearchBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { ServerInfoTooltip } from './ServerInfoTooltip.tsx';
import { useRef, useState } from 'react';
import logo from '../../static/img/otp-logo.svg';
import GraphiQLRouteButton from './GraphiQLRouteButton.tsx';
import WheelchairAccessibleCheckBox from './WheelchairAccessibleCheckBox.tsx';

type SearchBarProps = {
onRoute: () => void;
Expand Down Expand Up @@ -50,6 +51,11 @@ export function SearchBar({ onRoute, tripQueryVariables, setTripQueryVariables,
tripQueryVariables={tripQueryVariables}
setTripQueryVariables={setTripQueryVariables}
/>
<WheelchairAccessibleCheckBox
tripQueryVariables={tripQueryVariables}
setTripQueryVariables={setTripQueryVariables}
/>

<div className="search-bar-route-button-wrapper">
<Button variant="primary" onClick={() => onRoute()} disabled={loading}>
{loading && (
Expand Down
35 changes: 35 additions & 0 deletions client/src/components/SearchBar/WheelchairAccessibleCheckBox.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { Form } from 'react-bootstrap';
import wheelchairIcon from '../../static/img/wheelchair.svg';
import { TripQueryVariables } from '../../gql/graphql.ts';

export default function WheelchairAccessibleCheckBox({
tripQueryVariables,
setTripQueryVariables,
}: {
tripQueryVariables: TripQueryVariables;
setTripQueryVariables: (tripQueryVariables: TripQueryVariables) => void;
}) {
return (
<Form.Group>
<Form.Label column="sm" htmlFor="wheelchairAccessibleCheck">
<img
alt="Wheelchair Accessible Trip"
title="Wheelchair Accessible Trip"
src={wheelchairIcon}
width="20"
height="20"
className="d-inline-block align-middle"
/>
</Form.Label>
<Form.Check
id="wheelchairAccessible"
onChange={(e) => {
setTripQueryVariables({
...tripQueryVariables,
wheelchairAccessible: e.target.checked,
});
}}
></Form.Check>
</Form.Group>
);
}
6 changes: 6 additions & 0 deletions client/src/static/img/wheelchair.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions client/src/static/query/tripQuery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export const query = graphql(`
$searchWindow: Int
$modes: Modes
$itineraryFiltersDebug: ItineraryFilterDebugProfile
$wheelchairAccessible: Boolean
$pageCursor: String
) {
trip(
Expand All @@ -22,6 +23,7 @@ export const query = graphql(`
searchWindow: $searchWindow
modes: $modes
itineraryFilters: { debug: $itineraryFiltersDebug }
wheelchairAccessible: $wheelchairAccessible
pageCursor: $pageCursor
) {
previousPageCursor
Expand Down

0 comments on commit f285066

Please sign in to comment.