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

region wide alerts #78

Closed
2 tasks done
aaronbrethorst opened this issue Oct 29, 2024 · 1 comment · Fixed by #83
Closed
2 tasks done

region wide alerts #78

aaronbrethorst opened this issue Oct 29, 2024 · 1 comment · Fixed by #83
Assignees

Comments

@aaronbrethorst
Copy link
Member

aaronbrethorst commented Oct 29, 2024

This is very similar to the work that just landed in Android: OneBusAway/onebusaway-android#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

  • 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
  • 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)
image

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>

(Hopefully) Helpful notes

@aaronbrethorst aaronbrethorst changed the title System-wide alerts region wide alerts Oct 29, 2024
@Ahmedhossamdev Ahmedhossamdev self-assigned this Oct 29, 2024
@Ahmedhossamdev
Copy link
Member

Ahmedhossamdev commented Oct 30, 2024

Hi @aaronbrethorst

I found also Js SDK for GTFS-realtime language bindings, they use also the ProtoBuf.js for buffer support.

https://gtfs.org/documentation/realtime/language-bindings/nodejs/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants