Conversation
|
bot/tasks/pennychat.py
Outdated
| start_date = penny_chat_invitation.date.astimezone(utc).strftime('%Y%m%dT%H%M%SZ') | ||
| end_date = (penny_chat_invitation.date.astimezone(utc) + timedelta(hours=1)).strftime('%Y%m%dT%H%M%SZ') | ||
|
|
||
| description = f'{penny_chat_invitation.description} [Video Link]({penny_chat_invitation.video_conference_link})' |
There was a problem hiding this comment.
maybe add a new line? ...description}\n[Video...
There was a problem hiding this comment.
Lol, I totally forgot to revisit this. Adding to todos...
|
Agreed with John on everything here. If we're moving to a .env here, it might also be good to do that for SLACK_API_KEY as well. From a user experience perspective, we might want to include a short blurb on the connection modal detailing what data we access (from what I remember Google's OAuth page for this is very vague) and what benefit they get from connecting Google. ex. Really like the way you structured this in the code, makes it simple to expand on for other integrations. I think the more an app integrates with other existing tools, the more a company or organization is willing to adopt it into that workflow, and starting with this we'll have a lot of room to grow on that idea. |
JnBrymn
left a comment
There was a problem hiding this comment.
I think it looks good so far. The main thing I'm wondering about is the user experience in the various paths through this. Would you mind demoing that again this week? (Especially if anything has changed.)
| date_time_block | ||
| ] | ||
|
|
||
| if penny_chat_invitation.video_conference_link: |
There was a problem hiding this comment.
probably a nit pick, but rather than have 3 sections here, I'd just have a {PREVIEW, INVITE, UPDATE} section with a parenthetical (A video link will be provided shortly before the chat starts) and a REMIND section with the full details.
There was a problem hiding this comment.
So just remove the Video Link header from the invite and add parentheses?
There was a problem hiding this comment.
yup, just like you did - looks good
integrations/google.py
Outdated
| self.calendar_id = calendar_id | ||
|
|
||
| @property | ||
| def events(self): |
There was a problem hiding this comment.
I'm curious, why not just create self.events = self.service.events() in the init? 🤔 I wonder what calling events() each time you want self.events does.
There was a problem hiding this comment.
Good point, I should do that instead.
integrations/views.py
Outdated
| error = request.GET.get('error') | ||
| # TODO: Redirect to frontend page | ||
| if error: | ||
| return HttpResponse(f"<h1/>There was an error authorizing with Google.</h1><p>{request.GET.get('error')}</p>") |
There was a problem hiding this comment.
We should probably log details to sentry here. Probably sentry_sdk.capture_message since this isn't a raised exception.
Yes, this is correct! I didn't mean to originally commit the wording change on the button. I was messing around with having several modals at one point and forgot to change it back before committing.
I actually moved to this in my latest commit before seeing your message! Great minds, yada yada... @deadbender
My intention isn't for everyone to move to a
The message from Google says that it will allow us to "view and edit events" on their calendar. I think that is clear enough. I will definitely add that language you suggested for the benefits though! |
bot/processors/pennychat.py
Outdated
| share_penny_chat_invitation, | ||
| add_google_meet, | ||
| add_google_integration_blocks, | ||
| add_google_integration_blocks, update_google_meet, |
| def update_google_meet(penny_chat_id): | ||
| penny_chat_invitation = PennyChatSlackInvitation.objects.get(id=penny_chat_id) | ||
|
|
||
| calendar = get_user_google_calendar_from_slack_id(penny_chat_invitation.organizer_slack_id) |
There was a problem hiding this comment.
if the user retracts google permissions then calendar will be None here, add an if calendar is None here or we'll error on line 112. In this case I guess we just keep the calendar invite as is? (I presume it will still work)
| date_time_block | ||
| ] | ||
|
|
||
| if penny_chat_invitation.video_conference_link: |
There was a problem hiding this comment.
yup, just like you did - looks good
| if credentials: | ||
| user = credentials.user | ||
| slack_ids = [profile.slack_id for profile in user.social_profiles.all()] | ||
| invites = PennyChatSlackInvitation.objects.filter(organizer_slack_id__in=slack_ids, date__gt=timezone.now()) |
There was a problem hiding this comment.
would there ever be any invites with date__gt=timezone.now() ? is this a bug
There was a problem hiding this comment.
disregard ... hey this box wine is great!
bot/tasks/pennychat.py
Outdated
| f'{urllib.parse.quote(penny_chat_invitation.description)}' | ||
| f'{urllib.parse.quote(penny_chat_invitation.title)}&dates=' \ | ||
| f'{start_date}/{end_date}&details=' \ | ||
| f'{urllib.parse.quote(description)}' |
There was a problem hiding this comment.
this function has grown in complexity, can you pull out the contents of this if statement into it's own helpful func that lives in this file?
|
Before merging todos:
|
|
I have submitted to google for verification... And now we wait. |
Opening a draft PR for now. Includes the work that I demoed on Tuesday. Please comment with any concerns!
Some todos:
related
closes #122 because of addition of lru_cache decorator