-
Couldn't load subscription status.
- Fork 158
Access events widget #4726
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
base: master
Are you sure you want to change the base?
Access events widget #4726
Conversation
first pass at nsf access events widget. Note this has a data file as a hack becuase the API currently has no CORS headers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few suggestions here, one direction that will be interesting to explore (not sure if it is feasible for 4.1) would be updating the cache in the background instead of expiring it all at once, so that events would only have to load once even if they are posted a month in advance. There may be better cache approaches we can take but the load time is the biggest drawback at the moment IMO, even if that only happens once a week.
| <%= javascript_include_tag('nsf_access_events', nonce: true) %> | ||
|
|
||
| <div id="nsf_access_events"> | ||
| Loading... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if this is a good place for that shared spinner component mentioned in #4354.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those are full page spinners, but yea, we could have a small spinner here in the HTML.
|
|
||
| function widgetHeader(){ | ||
| const header = document.createElement('div'); | ||
| header.textContent = 'NSF ACESS Events'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a typo probably? I imagine some centers, where being part of ACCESS is more front and center, might want the title to be 'Upcoming Events' or something similar. Do we have any widgets that accept arguments from the YAML?
It also seems to me like the title should be part of the partial instead anyway so that you know what it is as it loads and can decide whether to wait or not. I could go either way on that though as I imagine the ambiguity would fade after seeing it a few times.
Finally, we may want to left-align the title to stay consistent with other widgets. Just looking at how it meshes with my current MOTD, though if we have no convention for widget alignment it isn't a big deal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a typo probably?
Yes it is.
I imagine some centers, where being part of ACCESS is more front and center, might want the title to be 'Upcoming Events' or something similar. Do we have any widgets that accept arguments from the YAML?
We can probably use a localization. As a first pass, it's easier to just reset the entire innerHTML than append children, but I can take a crack at it.
Finally, we may want to left-align the title to stay consistent with other widgets.
I can do that, sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a first pass, it's easier to just reset the entire innerHTML than append children, but I can take a crack at it.
That absolutely makes sense, and I guess I just wanted to start the conversation about how we might go about it. For example even appending has its issues, as you may have to strategically place where you append it to stay in chronological order. I think the most important aspect is just that we refresh the cache invisibly, so that you are never waiting on the API, it just happens in the background and might change (or fully update) the list.
Here's a first pass at the events widgets - #4632.
Things to note are: