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

Restore "remove shuttle map flag"" #191

Merged
merged 1 commit into from
Sep 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 5 additions & 8 deletions assets/src/components/app.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React, { ReactElement, useContext } from "react"
import { BrowserRouter, Route as BrowserRoute } from "react-router-dom"
import { StateDispatchContext } from "../contexts/stateDispatchContext"
import featureIsEnabled from "../laboratoryFeatures"
import AboutPage from "./aboutPage"
import LadderPage from "./ladderPage"
import SettingsPage from "./settingsPage"
Expand All @@ -16,13 +15,11 @@ const App = (): ReactElement<HTMLDivElement> => {
<div className="m-app">
<TabBar pickerContainerIsVisible={pickerContainerIsVisible} />
<BrowserRoute exact={true} path="/" component={LadderPage} />
{featureIsEnabled("shuttle_map") && (
<BrowserRoute
exact={true}
path="/shuttle-map"
component={ShuttleMapPage}
/>
)}
<BrowserRoute
exact={true}
path="/shuttle-map"
component={ShuttleMapPage}
/>
<BrowserRoute exact={true} path="/settings" component={SettingsPage} />
<BrowserRoute path="/about" component={AboutPage} />
</div>
Expand Down
25 changes: 11 additions & 14 deletions assets/src/components/tabBar.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { ReactElement } from "react"
import { NavLink } from "react-router-dom"
import featureIsEnabled from "../laboratoryFeatures"

interface Props {
pickerContainerIsVisible: boolean
Expand All @@ -25,19 +24,17 @@ const TabBar = ({
{ladderIcon}
</NavLink>
</li>
{featureIsEnabled("shuttle_map") && (
<li>
<NavLink
activeClassName="m-tab-bar__link--active"
className="m-tab-bar__link"
exact={true}
title="Shuttle Map"
to="/shuttle-map"
>
{mapIcon}
</NavLink>
</li>
)}
<li>
<NavLink
activeClassName="m-tab-bar__link--active"
className="m-tab-bar__link"
exact={true}
title="Shuttle Map"
to="/shuttle-map"
>
{mapIcon}
</NavLink>
</li>

<li>
<NavLink
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,27 @@ exports[`renders 1`] = `
</svg>
</a>
</li>
<li>
<a
aria-current={null}
className="m-tab-bar__link"
href="/shuttle-map"
onClick={[Function]}
title="Shuttle Map"
>
<svg
height="22"
viewBox="0 0 24 22"
width="24"
xmlns="http://www.w3.org/2000/svg"
>
<path
className="m-tab-bar__icon"
d="M23,0 C23.5522847,0 24,0.44771525 24,1 L24,21 C24,21.5522847 23.5522847,22 23,22 L1,22 C0.44771525,22 0,21.5522847 0,21 L0,1 C0,0.44771525 0.44771525,0 1,0 L23,0 Z M1,1.029 L1,21 L2.235,21 L8.54273969,3.6527516 L1,1.029 Z M9.37373969,13.0727516 L6.491,21 L23,21 L23,18.71 L9.37373969,13.0727516 Z M23,2.589 L18.6237397,13.6527516 L23,15.463 L23,2.589 Z M22.756,1 L13.764,1 L12.6627397,4.0277516 L12.6642603,4.0277516 L12.3357397,4.9722484 L12.3207397,4.9667516 L10.3997397,10.2507516 L17.8737397,13.3427516 L22.756,1 Z M9.507,1 L3.962,1 L8.88473969,2.7127516 L9.507,1 Z"
/>
</svg>
</a>
</li>
<li>
<a
aria-current={null}
Expand Down
16 changes: 16 additions & 0 deletions assets/tests/components/tabBar.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { mount } from "enzyme"
import React from "react"
import { BrowserRouter } from "react-router-dom"
import TabBar from "../../src/components/tabBar"

describe("tabBar", () => {
it("sets class to hidden when picker is hidden", () => {
const wrapper = mount(
<BrowserRouter>
<TabBar pickerContainerIsVisible={false} />
</BrowserRouter>
)
expect(wrapper.find(".m-tab-bar").hasClass("hidden")).toBe(true)
expect(wrapper.find(".m-tab-bar").hasClass("visible")).toBe(false)
})
})
1 change: 0 additions & 1 deletion config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ config :laboratory,
features: [
{:headway_ladder_colors, "Headway Route Ladder Colors",
"Turns on colored headway spacing lines on key route route ladders showing when service is bunched or gapped."},
{:shuttle_map, "Shuttle Map", ""},
{:ghost_buses, "Ghost Buses", "Displays ghost buses on route ladders"}
],
cookie: [
Expand Down