ondemand icon indicating copy to clipboard operation
ondemand copied to clipboard

Notify users when job starts

Open ericfranz opened this issue 3 years ago • 3 comments

This is a two part solution:

  1. Use the Notifications API, which is user opt-in, to notify when a job starts or completes if the browser window/tab is not in focus
  2. Update the <title> of the My Interactive Sessions page with the following format: <most recent job card state, name, id> - <# active sessions> active sessions - My Interactive Sessions and when the state of that job card changes, update the title using JavaScript.

┆Issue is synchronized with this Asana task by Unito

ericfranz avatar Mar 02 '21 01:03 ericfranz

This is related to https://discourse.osc.edu/t/notifications-beyond-an-email/1338

ericfranz avatar Mar 02 '21 01:03 ericfranz

Also, unlike the MDN example, we would need to get permission to use the Notifications API as soon as the user accesses the page, instead of when we go to produce our first notification change.

ericfranz avatar Mar 02 '21 01:03 ericfranz

Example title:

Running VDI (Owens and Pitzer) (12990898) - 3 active sessions - My Interactive Sessions

That would be the title for the page below:

image

  • there are 3 active sessions (the rest are completed)
  • the first one's title and job id display in the title first

And editing the title is easy https://developer.mozilla.org/en-US/docs/Web/API/Document/title

document.title = "Running VDI (Owens and Pitzer) (12990898) - 3 active sessions - My Interactive Sessions"

ericfranz avatar Mar 02 '21 01:03 ericfranz