8000 feat: add video conferencing option (Google Meet) to Google Calendar integration by akurungadam · Pull Request #17851 · frappe/frappe · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

Merged
merged 18 commits into from
Oct 18, 2022

Conversation

akurungadam
Copy link
Contributor
@akurungadam akurungadam commented Aug 17, 2022
  • Option to "Add Video Conferencing" in Event doctype
  • Extend Google Calendar integration to add Google Meet link to calendar events
    • insert and update APIs of Google Calendar now invoked with conferenceDataVersion=1 API Reference
    • Add conferenceData as part of Google Calendar API
    • Add attendees based on Participants added to Event (adding attendees even if conferencing is not enabled, unlike the current implementation)
    • Event update (Add / Remove conferencing after syncing the event)
    • Show link to join video conference in Event document

Creating an Event with Video Conferencing enabled -
Screen Shot 2022-08-11 at 2 03 34 PM

Google Meet link saved after inserting Event
Screen Shot 2022-08-11 at 5 32 59 PM

Show join link on dashboard
2022-08-17 09 25 18

Docs, Google Calendar Integration Draft

@akurungadam akurungadam requested review from a team and surajshetty3416 and removed request for a team August 17, 2022 04:07
@github-actions github-actions bot added the add-test-cases Add test case to validate fix or enhancement label Aug 17, 2022
@akurungadam akurungadam force-pushed the google_meet branch 3 times, most recently from 0e248c4 to 9769dd1 Compare August 20, 2022 08:26
@akurungadam akurungadam changed the title feat: add video conferencing option (via Google Meet) to Google Calendar integration feat: add video conferencing option (Google Meet) to Google Calendar integration Aug 20, 2022
@codecov
Copy link
codecov bot commented Aug 23, 2022

Codecov Report

Merging #17851 (ad796f0) into develop (b974bed) will decrease coverage by 1.47%.
The diff coverage is 16.36%.

❗ Current head ad796f0 differs from pull request most recent head 44c5bdf. Consider uploading reports for the commit 44c5bdf to get more accurate results

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     
Flag Coverage Δ
server-ui 31.18% <7.31%> (+1.35%) ⬆️
ui-tests 50.09% <ø> (+0.53%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

@phot0n phot0n self-assigned this Aug 29, 2022
Copy link
Contributor
@phot0n phot0n left a 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")})
Copy link
Contributor

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?

Comment on lines 760 to 755
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",
)
Copy link
Contributor

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()
}

Comment on lines 498 to 499
if len(doc.event_participants):
event.update({"attendees": get_attendees(doc)})
Copy link
Contributor

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
Copy link
Contributor

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.

Copy link
Contributor Author

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?

Comment on lines 45 to 49
const [ends_on_date] = frm.doc.ends_on.split(" ");
if (frm.doc.google_meet_link && frappe.datetime.now_date() <= ends_on_date) {
Copy link
Contributor

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 (?)

Also, I'm getting errors if ends_on is empty.

Screenshot 2022-09-15 at 8 28 54 PM

Copy link
Contributor Author

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

Copy link
Contributor

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 👍

Comment on lines 753 to 758
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})
Copy link
Contributor
@phot0n phot0n Sep 15, 2022

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?

Copy link
Contributor Author

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

Copy link
Contributor

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) ?

Copy link
Member

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? 😄

Copy link
Contributor Author

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

Copy link
Contributor Author

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?

@phot0n phot0n removed the add-test-cases Add test case to validate fix or enhancement label Sep 15, 2022
@akurungadam
Copy link
Contributor Author
akurungadam commented Sep 15, 2022

Thanks for taking this up, will come back on your review

@stale stale bot added the inactive label Oct 8, 2022
@frappe frappe deleted a comment from stale bot Oct 9, 2022
@stale stale bot removed the inactive label Oct 9, 2022
@phot0n phot0n requested a review from shariquerik as a code owner October 18, 2022 12:44
akurungadam and others added 4 commits October 18, 2022 18:26
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>
@phot0n
Copy link
Contributor
phot0n commented Oct 18, 2022

Will merge upon successful CI run. Thanks for this & sorry for the delay 😅

@phot0n phot0n added the squash label Oct 18, 2022
@phot0n phot0n added the Skip CI Doesn't run Ci for this PR. label Oct 18, 2022
@phot0n phot0n merged commit c44e278 into frappe:develop Oct 18, 2022
@ankush ankush added the backport version-14-hotfix backport to version 14 label Oct 18, 2022
mergify bot pushed a commit that referenced this pull request Oct 18, 2022
…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
phot0n added a commit that referenced this pull request Nov 1, 2022
…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>
frappe-pr-bot pushed a commit that referenced this pull request Nov 1, 2022
# [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)
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 2, 2022
@akurungadam akurungadam deleted the google_meet branch March 26, 2024 07:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport version-14-hotfix backport to version 14 Skip CI Doesn't run Ci for this PR. squash
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0