Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Fetch all facilities by default on main page when vector tile feature is active #771

Merged
merged 1 commit into from Sep 6, 2019

Conversation

kellyi
Copy link
Contributor

@kellyi kellyi commented Sep 5, 2019

Overview

When the vector tile feature is active, fetch all facilities by default
on the main map and sidebar page. Also make the "Facilities" tab the
initially displayed tab on loading the map page if the vector tile
feature is active.

Add guards to retain prior map behavior when the vector tile feature is
not active.

Connects #765

Demo

Screen Shot 2019-09-05 at 5 59 41 PM

Notes

Making this work while keeping the same functionality as before when the feature flag is off was a little tricky, but I think I came up with a good way to handle it which was to defer rendering any components that need to know the state of feature flags until the feature flags have returned from the API.

Testing Instructions

Using the standard set of fixtures, serve this branch, then...

With the vector_tile switch turned off, use the app and verify that it still works as it did before.

With the vector_tile switch turned on, use the app and verify that the facilities tab populates with data as expected.

In particular: clicking the "reset" button for the vector tiles version will now undertake a new search.

Checklist

  • fixup! commits have been squashed
  • CI passes after rebase
  • CHANGELOG.md updated with summary of features or fixes, following Keep a Changelog guidelines

@jwalgran
Copy link
Contributor

jwalgran commented Sep 6, 2019

Looking at this now.

Copy link
Contributor

@jwalgran jwalgran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works well.

I appreciate the work on our most cumbersome feature flag exercise to date. I like the fact that we are seeing flag use in more complex situations. It prompts me to think about possibly extracting some additional helpers.

@@ -95,15 +103,27 @@ class FilterSidebar extends Component {
</p>
</div>);

const activeTabIndex = filterSidebarTabs
const orderedTabsForSidebar = vectorTileFeatureIsActive
? filterSidebarTabs.slice().reverse()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clever use of reverse here. I think that having "Guide" last makes sense.

makeSearchTabActive,
makeFacilitiesTabActive,
][value];
const changeTabDictionary = vectorTileFeatureIsActive
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider changeTabList to reflect the arrayness.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch -- I'll rename before merging.

@jwalgran jwalgran assigned kellyi and unassigned jwalgran Sep 6, 2019
When the vector tile feature is active, fetch all facilities by default
on the main map and sidebar page. Also make the "Facilities" tab the
initially displayed tab on loading the map page if the vector tile
feature is active.

Add guards to retain prior map behavior when the vector tile feature is
not active.
@kellyi kellyi force-pushed the ki/show-facility-tab-by-default branch from 9e2b0a7 to 6c94a3d Compare September 6, 2019 16:42
@kellyi kellyi merged commit 378b8dc into develop Sep 6, 2019
@kellyi kellyi deleted the ki/show-facility-tab-by-default branch September 6, 2019 16:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants