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

Calendar signup form #221

Merged
merged 22 commits into from
Feb 7, 2025
Merged

Calendar signup form #221

merged 22 commits into from
Feb 7, 2025

Conversation

robmoffat
Copy link
Member

@robmoffat robmoffat commented Dec 12, 2024

Creating a first PR to look at event signup workflow.

Implements #154

Copy link

netlify bot commented Dec 12, 2024

Deploy Preview for calendar-gatsby ready!

Name Link
🔨 Latest commit 8aac959
🔍 Latest deploy log https://app.netlify.com/sites/calendar-gatsby/deploys/6798cef3e3718700089ecd20
😎 Deploy Preview https://deploy-preview-221--calendar-gatsby.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@robmoffat robmoffat mentioned this pull request Dec 12, 2024
@robmoffat
Copy link
Member Author

@TheJuanAndOnly99 I need some help with this. I've added a signup form, but I get an error when trying to sign people up:

  Error: Service accounts cannot invite attendees without Domain-Wide Delegation of Authority.
 

... perhaps we can discuss this in the new year when you get back?

Also @mimiflynn fyi, I'm using Gatsby for this, so this incorporates some of your changes, probably out-of-sync.

Let's see if we can work on closing these both out.

@robmoffat
Copy link
Member Author

Hi @psmulovics and @mimiflynn - could you test this preview out?

This basically is a software version of emailing @TheJuanAndOnly99 and getting him to add your email on the event.

Are you able to sign up to FINOS calendar events using the signup form?

If so, I'll work a little more on a few improvements (e.g. email validation)

thanks!

@mimiflynn
Copy link
Member

@robmoffat I got the following error when trying to get an invite to the FDC3 working group:

Error updating calendar: SyntaxError: Unexpected token '<', "
<HE"... is not valid JSON

@robmoffat
Copy link
Member Author

Hi Mimi,

Couple of things:

  1. Is this just for that meeting, or generally?
  2. Can you give me the output from your console? I suspect firewall shenanigans if the answer to 1) is "generally".

@mimiflynn
Copy link
Member

I just noticed that I got a lot of calendar invites to that meeting. Let me try others in different desktop environments.

@mimiflynn
Copy link
Member

I think the issue was something about that FDC3 event. Other event invite signups have flowed to a success message without errors.

@robmoffat
Copy link
Member Author

ok, that's a relief. Let me see if I can recreate your issue

@robmoffat
Copy link
Member Author

Actually, can you tell me which working group it was? We have like 4 for FDC3...

@mimiflynn
Copy link
Member

The 'FDC3 Standard Working Group' is the event that errored. I selected tomorrow's meeting.

Copy link
Member

@mimiflynn mimiflynn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@robmoffat mind pulling latest locally and fixing the conflicts?

@robmoffat
Copy link
Member Author

@mimiflynn there you go. Still looking at the FDC3 meeting... will try and get back to it later today

setIsSubmitted(body)
}).catch(err => {
console.error(`Error updating calendar:`, err)
setIsSubmitted(`Error updating calendar: ${err}`)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove logs

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For fun, I asked AI why it is a best practice to remove logs (a leading question I know):

image

It looks like it got the bulk of that answer from here.

Anyway, logs are for debugging during development, not for production. Their Its not only messy but easily offers information about the way an application works in a production environment where (perhaps not in this case) sensitive information might be revealed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In future work, we should separate the server code from the front with npm workspaces so the front and back end dependencies and applications are independent.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but this Is how Gatsby organises things.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, my mistake, I thought this was a node app, I should have known it was the API call.

<div className="signup form-container"><pre>{isSubmitted}</pre></div>
)
}
} else {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This nested else if else is hard to read. Perhaps move the markup to a functional component or method that is then composed within the if else logic?

@robmoffat
Copy link
Member Author

ok, I've updated this to support three conditions - working, failed and timing out.
It seems like for the FDC3 meeting particularly, the google API takes about 50 seconds to respond. This is consistent with the API and using the Google Calendar App.
Netlify has an edge function timeout of 30 seconds, so after 10 seconds I just return a response to the user and say "it's on its way".
Crucially, I do get added to the event in this scenario

@robmoffat robmoffat requested a review from mimiflynn January 28, 2025 13:28
@mimiflynn
Copy link
Member

I was also able to get the event invite even though it returned an error for the FDC3 meeting.

@robmoffat
Copy link
Member Author

@mimiflynn so are we good then?
@TheJuanAndOnly99 are you happy with this?

@robmoffat
Copy link
Member Author

I was also able to get the event invite even though it returned an error for the FDC3 meeting.

Yeah it seems like it's just this one meeting, and you should get a message like:

Screenshot 2025-01-29 at 12 09 34

right?

@mimiflynn
Copy link
Member

I'll take out the logs later when we know this signup form is working consistently.

@mimiflynn
Copy link
Member

@robmoffat are we waiting for additional approval? I'm excited to get this out!

@robmoffat
Copy link
Member Author

@robmoffat are we waiting for additional approval? I'm excited to get this out!

me too. I used it with the OSR SIG the other day. No one complained. I've also shopped it round for people to try in FINOS. I've got a meeting with @TheJuanAndOnly in a minute we'll discuss merging it then

@TheJuanAndOnly99 TheJuanAndOnly99 merged commit 1f54850 into main Feb 7, 2025
8 checks passed
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 this pull request may close these issues.

3 participants