On web app launch, we'll query ${OBACO_API_BASE_URL}/alerts.pb for new alerts. If a recent, high severity, region-wide alert is found, a modal will be displayed that shows the contents of the alert, and optionally includes a "More Info" button.
Acceptance criteria
[x] Add an optional onebusaway.co API server base URL to the .env (and document in the README). it should include the region ID. e.g. https://onebusaway.co/api/v1/regions/1
[x] Load the contents of ${OBACO_API_BASE_URL}/alerts.pb and show the first recent, high severity, system wide alert in a modal dialog
(note: button color is incorrect — I was just too lazy to change it :P)
Example code
<script>
import { Modal } from 'flowbite-svelte';
let showModal = true;
</script>
<Modal title="All Transit Service Suspended" bind:open={showModal} autoclose>
<p class="text-base leading-relaxed text-gray-500 dark:text-gray-400">
King County Metro shut down all its buses. So did Pierce and Snohomish counties. Seattle-Tacoma International Airport briefly closed all three runways, an "unprecedented" situation. Paine Field closed. So did Highway 2 over Stevens
Pass. Garbage pickup was canceled. Museums, theaters, libraries, the zoo, the aquarium: all closed. Doctor appointments
moved online.
</p>
<svelte:fragment slot="footer">
<div class="text-right flex-1">
<Button color="alternative">Close</Button>
<Button on:click={() => alert('Handle "success"')}>Learn More</Button>
</div>
</svelte:fragment>
</Modal>
This is very similar to the work that just landed in Android: https://github.com/OneBusAway/onebusaway-android/pull/1274
Feature description
On web app launch, we'll query
${OBACO_API_BASE_URL}/alerts.pb
for new alerts. If a recent, high severity, region-wide alert is found, a modal will be displayed that shows the contents of the alert, and optionally includes a "More Info" button.Acceptance criteria
${OBACO_API_BASE_URL}/alerts.pb
and show the first recent, high severity, system wide alert in a modal dialog(note: button color is incorrect — I was just too lazy to change it :P)
Example code
(Hopefully) Helpful notes