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

Generalised hub that can be used by Tipping Point UK as well #109

Merged
merged 10 commits into from
Jun 21, 2024

Conversation

janbaykara
Copy link
Member

@janbaykara janbaykara commented Jun 20, 2024

This PR does just enough to make the map page reusable by other orgs; in this case Tipping Point UK.

  • Move map state from pathname to query params, so that /hub/render/tippingpointuk.org/map can be iframed without needing a custom domain and middleware-based URL rewriting
  • Hide non-TCC branding, copy and features on the /map page
  • Hubs can specify their own primary and secondary colours, which will apply to hub UI.
  • Hubs can define map icons for their data layers, which correspond to sprites uploaded to Mapbox. In future we can provide some kind of dictionary of these options

Motivation and Context

https://linear.app/commonknowledge/issue/MAP-397/mvp-tipping-point-map-embed

"Put it on a map" is a common refrain. This PR helps us get there as quickly as possible.

Up next, we can use Puck or something else to allow organisers to customise the UI.

How Can It Be Tested?

  1. Ensure you have some EVENT-type data source installed
  2. Create a hub locally, for example with the hostname tippingpointuk.localhost
  3. Optionally add primary/secondary colours
  4. Add the following in your data tab of the hub, replacing the source ID:
[
  {
    "id": "aa48ffbe-27c2-47c1-a782-1451c84804de",
    "name": "Test data",
    "source": "aa48ffbe-27c2-47c1-a782-1451c84804de",
    "icon_image": "triangle"
  }
]
  1. Visit http://localhost:3000/hub/render/tippingpointuk.localhost/map/ to see the map!

How Will This Be Deployed?

We'll make a site and do the config, then iframe it onto Tipping Point's site.

Screenshots (if appropriate):

Screenshot 2024-06-20 at 18 09 40 Screenshot 2024-06-20 at 18 09 43

Types of changes

  • New feature (non-breaking change which adds functionality)

@janbaykara
Copy link
Member Author

Merging so we can deploy this to TP. Welcome a post-hoc code review though @joaquimds.

@janbaykara janbaykara merged commit 5d9b1d6 into main Jun 21, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant