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

Events improved error handling#88 #96

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

rjfuhrman42
Copy link
Contributor

Description of Changes

  • Added new logic for error handling with events data.
  1. Checks for the status of the promise which is returned from the pingEvents function.
  2. If, after 5 seconds, the status is still ok but the events list is empty, then we timeout and set the status of the events to error
  • Added react-spinners library and added a loading spinner, so that users get a visual cue during events loading.
  • Re-added the connect-logo-container class which centers the connect logo with the main content. This can be removed if it causes issues, however I have yet to find any.
  • Changed the way we determine if an event is online or in-person because one of the most recent events was displayed incorrectly.

How can I test this?

  1. Clone the files from github onto your local workspace.
  2. Run npm install to install needed dependencies.
  3. Once finished, test to make sure the Netlify CLI is installed by typing netlify in your console. If not type npm install netlify-cli -g in the console to install it.
  4. Once confirmed, in index.js uncomment 'http://localhost:8888/.netlify/functions/pingEvents' to access the Netlify function.
  5. Then type in netlify dev to start the development server.
  6. Then you are ready to test!
  7. Go to localhost:8000 to see the spinner and error timeout occur.

…le and markup.

- Handled error when the URL that is fetched fails and the Promise is not resolved properly
- Handled error where the fetch returns an empty promise and the events are empty
- Added loading spinner
- Changed the style of the events section, so that grid layout is not applied to loading and error elements
- Added a state (in index.js) to track the status of the promise returned from pingEvents.js
- changed how comments are placed
- added back in the Connect logo container, so that the Connect logo is aligned with the main content on the site. If this is an issue it can be removed, but my build has had no issues with this.
- changed how we determine online vs in-person events. Checks against commonly used strings to determine if the event is in-person.
@Hellrungj Hellrungj added the enhancement New feature or request label Oct 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants