-
Notifications
You must be signed in to change notification settings - Fork 3.9k
feat: add video conferencing option (Google Meet) to Google Calendar integration #17851
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
Conversation
0e248c4
to
9769dd1
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## develop #17851 +/- ##
===========================================
- Coverage 62.63% 61.16% -1.48%
===========================================
Files 744 748 +4
Lines 67243 72755 +5512
Branches 5962 5992 +30
===========================================
+ Hits 42120 44503 +2383
- Misses 21601 24767 +3166
+ Partials 3522 3485 -37
Flags with carried forward coverage won't be shown. Click here to find out more. |
…h google calendar
updated response API Response comment with conference details show google calendar section if pulled from google calendar
…bled remove google meet link from event needs both conferenceData as null and conferenceDataVersion 1
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.
Hey, sorry for the delay. I've tested this out for a bit and broadly seems to work fine. have a few doubts though.
Thanks!!
) | ||
|
||
# if add_video_conferencing enabled or disabled during update, overwrite | ||
frappe.db.set_value("Event", doc.name, {"google_meet_link": event.get("hangoutLink")}) |
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.
can we put update_modified=False
over here?
frappe.msgprint( | ||
_("Google Calendar - User / Email field not found, did not add attendee for {0} {1}").format( | ||
participant.reference_doctype, participant.reference_docname | ||
), | ||
alert=True, | ||
indicator="red", | ||
) |
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 should ideally be taken out of the for loop ..as it will show a lot of messages.
We could maintain a dict
where we keep all the attendees whose emails we found and not found.
{
"participant_email_found": set(),
"participant_email_not_found": set()
}
if len(doc.event_participants): | ||
event.update({"attendees": get_attendees(doc)}) |
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.
if we remove all event participants, they still show up in the google calendar event
if len(doc.event_participants): | ||
10000 event.update({"attendees": get_attendees(doc)}) | ||
|
||
conference_data_version = 0 |
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.
we don't really need this variable over here right? we can just say if doc.add_video_conferencing is there, we need a meet link.
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 i guess we should go with the variable as it wouldn't be so obvious if we use the add_video_conferencing flag to be passed as the version?
frappe/desk/doctype/event/event.js
Outdated
const [ends_on_date] = frm.doc.ends_on.split(" "); | ||
if (frm.doc.google_meet_link && frappe.datetime.now_date() <= ends_on_date) { |
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.
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 only considering date?
if I had a meet from 4pm-6pm then I would get this header for the whole day (?)
yes, headline will be shown until end date. Google Calendar doesn't remove the "Join" option for past events too, and even after the meeting is completed, do you feel we'll keep it that way?
Also, I'm getting errors if
ends_on
is empty.
this escaped, fixing this by using starts_on
if ends_on
is blank
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.
yes, headline will be shown until end date. Google Calendar doesn't remove the "Join" option for past events too, and even after the meeting is completed, do you feel we'll keep it that way?
seems okay now that I think about it - not a huge thing 👍
if participant_doc.meta.has_field("user") and participant_doc.user: | ||
attendees.append({"email": participant_doc.user}) | ||
elif participant_doc.meta.has_field("user_id") and participant_doc.user_id: | ||
attendees.append({"email": participant_doc.user_id}) | ||
elif participant_doc.meta.has_field("email") and participant_doc.email: | ||
attendees.append({"email": participant_doc.email}) |
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 crazy - what all doctypes are we currently supporting using this?
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.
yeah, this even i was doubtful.. it would be better we allow user to select email field in the participants table - will add this
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.
discussed this with @ankush, maybe just do this when someone has linked contact document(s) ?
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.
Yes, Contact document implements linking contact info with arbitrary documents.
Lets add another column and fetch primary email from the linked contract instead of user directly? 😄
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.
thanks! let me try and add that
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.
Hi @phot0n I've made the suggested changes. as you get the time, please take a look and let me know?
Thanks for taking this up, will come back on your review |
show add_video_conferencing for events of all categories Co-authored-by: Ritwik Puri <ritwikpuri5678@gmail.com>
show add_video_conferencing for events of all categories Co-authored-by: Ritwik Puri <ritwikpuri5678@gmail.com>
Co-authored-by: Ritwik Puri <ritwikpuri5678@gmail.com>
Co-authored-by: Ritwik Puri <ritwikpuri5678@gmail.com>
set email from linked contact google calendar event to use event participant email as attendees
…om before_save hook
Will merge upon successful CI run. Thanks for this & sorry for the delay 😅 |
…integration (#17851) * feat: add video conferencing (via google meet) for events syncing with google calendar * fix: unset add_video_conferencing if sync_with_google_calendar not enabled * fix: remove conference data if add_video_conferencing disabled during update * fix: restrict add conferencing if event_category in Event, Meeting and Other * fix: save meet link while pulling from calendar updated response API Response comment with conference details show google calendar section if pulled from google calendar * feat: show link to join video conference with google meet * fix(style): linter errors * fix(style): linter errors * fix: set conferenceDataVersion 1 only if google meet conferencing enabled remove google meet link from event needs both conferenceData as null and conferenceDataVersion 1 * Update frappe/desk/doctype/event/event.py show add_video_conferencing for events of all categories Co-authored-by: Ritwik Puri <ritwikpuri5678@gmail.com> * Update frappe/desk/doctype/event/event.json show add_video_conferencing for events of all categories Co-authored-by: Ritwik Puri <ritwikpuri5678@gmail.com> * fix: handle empty ends_on, use starts_on Co-authored-by: Ritwik Puri <ritwikpuri5678@gmail.com> * fix: do not update Event modified time on db set meet link Co-authored-by: Ritwik Puri <ritwikpuri5678@gmail.com> * fix: add email field event participants table set email from linked contact google calendar event to use event participant email as attendees * fix: attendees not cleared from google calendar event * fix(style): linter suggestions * fix: make email field non-read only, called set_participants_email from before_save hook * test: update new no of fields in event doctype in test_fetch_to_customize Co-authored-by: Ritwik Puri <ritwikpuri5678@gmail.com> (cherry picked from commit c44e278) # Conflicts: # frappe/desk/doctype/event_participants/event_participants.json
…integration (backport #17851) (#18456) * feat: add video conferencing option (Google Meet) to Google Calendar integration (#17851) * feat: add video conferencing (via google meet) for events syncing with google calendar * fix: unset add_video_conferencing if sync_with_google_calendar not enabled * fix: remove conference data if add_video_conferencing disabled during update * fix: restrict add conferencing if event_category in Event, Meeting and Other * fix: save meet link while pulling from calendar updated response API Response comment with conference details show google calendar section if pulled from google calendar * feat: show link to join video conference with google meet * fix(style): linter errors * fix(style): linter errors * fix: set conferenceDataVersion 1 only if google meet conferencing enabled remove google meet link from event needs both conferenceData as null and conferenceDataVersion 1 * Update frappe/desk/doctype/event/event.py show add_video_conferencing for events of all categories Co-authored-by: Ritwik Puri <ritwikpuri5678@gmail.com> * Update frappe/desk/doctype/event/event.json show add_video_conferencing for events of all categories Co-authored-by: Ritwik Puri <ritwikpuri5678@gmail.com> * fix: handle empty ends_on, use starts_on Co-authored-by: Ritwik Puri <ritwikpuri5678@gmail.com> * fix: do not update Event modified time on db set meet link Co-authored-by: Ritwik Puri <ritwikpuri5678@gmail.com> * fix: add email field event participants table set email from linked contact google calendar event to use event participant email as attendees * fix: attendees not cleared from google calendar event * fix(style): linter suggestions * fix: make email field non-read only, called set_participants_email from before_save hook * test: update new no of fields in event doctype in test_fetch_to_customize Co-authored-by: Ritwik Puri <ritwikpuri5678@gmail.com> (cherry picked from commit c44e278) # Conflicts: # frappe/desk/doctype/event_participants/event_participants.json * chore: resolve conflict * fix: consider reference docname when reference doctype in contact when setting participant emails in event doctype Co-authored-by: Anoop <anoop@earthianslive.com> Co-authored-by: phot0n <ritwikpuri5678@gmail.com>
# [14.14.0](v14.13.0...v14.14.0) (2022-11- 10000 01) ### Bug Fixes * correct stacklevel for warnings ([#18633](#18633)) ([#18634](#18634)) ([17821f1](17821f1)) * **formatting:** use snake case for variable names ([32851ce](32851ce)) * handle exceptions thrown in post_schema_updates ([#18648](#18648)) ([#18663](#18663)) ([29a659a](29a659a)) * **insert_many:** list instead of set to maintain order ([#18641](#18641)) ([4c521b8](4c521b8)) * make module def custom checkbox readonly in prod mode ([#18698](#18698)) ([18fa732](18fa732)) * **router-js:** handle case when link is not of same host ([1b70ec4](1b70ec4)) * set proper cache key for singles when name is passed as `None` ([#18667](#18667)) ([#18668](#18668)) ([e32ba96](e32ba96)) * Signature form ([#18477](#18477)) ([8e4711b](8e4711b)) * Signature form (backport [#18477](#18477)) ([#18690](#18690)) ([34c1611](34c1611)) * support symlinked /files directory ([#18702](#18702)) ([7b8cbd0](7b8cbd0)) * use `async...await` when parsing route ([9c09c65](9c09c65)) * use `is_file_path_valid` instead of `is_safe_path` ([#18316](#18316)) ([#18642](#18642)) ([537966c](537966c)) * **UX:** Info message on workspace for better UX (backport [#18701](#18701)) ([#18703](#18703)) ([5ba85ec](5ba85ec)) * **UX:** session expiry explanation and defaults ([#18680](#18680)) ([#18685](#18685)) ([515f6c2](515f6c2)) * **UX:** warn about Etc/* timezones behaviour ([#18587](#18587)) ([#18588](#18588)) ([c8728f5](c8728f5)) * webform validation script not working ([ab2b8df](ab2b8df)) ### Features * add video conferencing option (Google Meet) to Google Calendar integration (backport [#17851](#17851)) ([#18456](#18456)) ([b04a54c](b04a54c)) * support list view for "show titles instead of name" ([#18060](#18060)) ([#18681](#18681)) ([64c2555](64c2555)) ### Performance Improvements * ensure cache works for `non_standard_user_types` when empty ([#18665](#18665)) ([#18669](#18669)) ([5f7928b](5f7928b)) ### Reverts * Revert "fix: use `is_file_path_valid` instead of `is_safe_path` (#18316) (#18642)" (#18696) ([a08c029](a08c029)), closes [#18316](#18316) [#18642](#18642) [#18696](#18696)
conferenceDataVersion=1
API ReferenceconferenceData
as part of Google Calendar APIattendees
based on Participants added to Event (adding attendees even if conferencing is not enabled, unlike the current implementation)Creating an Event with Video Conferencing enabled -

Google Meet link saved after inserting Event

Show join link on dashboard

Docs, Google Calendar Integration Draft