Skip to content

feat: Add Zoho Bigin app to appstore#8158

Merged
kodiakhq[bot] merged 23 commits intocalcom:mainfrom
ShaneMaglangit:feat/zoho-bigin
May 4, 2023
Merged

feat: Add Zoho Bigin app to appstore#8158
kodiakhq[bot] merged 23 commits intocalcom:mainfrom
ShaneMaglangit:feat/zoho-bigin

Conversation

@ShaneMaglangit
Copy link
Copy Markdown
Contributor

@ShaneMaglangit ShaneMaglangit commented Apr 9, 2023

What does this PR do?

Creates a new Zoho Bigin app under the App Store for direct integration. New bookings automatically creates a corresponding "Contact" and "Event" records on the Zoho Bigin platform.

Fixes #5450

https://www.loom.com/share/cb2dcb487753468f87844d57f137eb8b

Environment: Staging(main branch)

Type of change

  • New feature (non-breaking change which adds functionality)

How should this be tested?

  • Install Zoho Bigin from the playstore.
  • Book a new meeting: New Contacts and Activities > Event should be added on Bigin.
  • Deleting a meeting from Cal.com should also reflect on the Event page.

/claim #5450

@ShaneMaglangit ShaneMaglangit requested a review from a team April 9, 2023 07:17
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 9, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 3, 2023 2:27pm

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 9, 2023

@ShaneMaglangit is attempting to deploy a commit to the cal Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 9, 2023

📦 Next.js Bundle Analysis for @calcom/web

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 9, 2023

📦 Next.js Bundle Analysis for @calcom/web

This analysis was generated by the Next.js Bundle Analysis action. 🤖

Four Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load % of Budget (350 KB)
/[user]/book 183.52 KB 416.64 KB 119.04% (🟡 +0.20%)
/auth/setup 79.98 KB 313.09 KB 89.46% (🟢 -0.19%)
/d/[link]/book 183.17 KB 416.29 KB 118.94% (🟡 +0.20%)
/team/[slug]/book 183.17 KB 416.29 KB 118.94% (🟡 +0.20%)
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

The "Budget %" column shows what percentage of your performance budget the First Load total takes up. For example, if your budget was 100kb, and a given page's first load size was 10kb, it would be 10% of your budget. You can also see how much this has increased or decreased compared to the base branch of your PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this. If you see "+/- <0.01%" it means that there was a change in bundle size, but it is a trivial enough amount that it can be ignored.

@PeerRich PeerRich requested a review from hariombalhara April 19, 2023 14:26
@PeerRich
Copy link
Copy Markdown
Member

hey @ShaneMaglangit we will test this this week!

@hariombalhara
Copy link
Copy Markdown
Member

I have started testing it. Facing some issues locally, debugging them and will get back.

I have fixed a few things that are in terms of calendar app creation in general. As there is no calendar app creation app-store template, this is needed. Once we create a calendar template, those changes won't be needed.

@hariombalhara
Copy link
Copy Markdown
Member

Screenshot 2023-04-25 at 2 53 06 PM

Yeah it's enabled.

@ShaneMaglangit
Copy link
Copy Markdown
Contributor Author

@hariombalhara I might have found the issue. The refresh_token API does not return itself. Yet, the previous code was not storing the existing refresh_token.

You would need to uninstall/reinstall the app. Start with a fresh database (or at least without the old credentials). To be sure, try creating an event again after an hour (default expiration) to make sure the refresh stuffs work properly.

Please let me know if this still doesn't resolve this so I can book a meeting with you.

@hariombalhara
Copy link
Copy Markdown
Member

I have already tried disconnecting and reconnecting the app, and even tried deleting the credentials directly from DB. I would give it a go one more time.
I would like you to still book cal.com/hariom to sort it out. If it works for me then we can skip the meeting.

@ShaneMaglangit
Copy link
Copy Markdown
Contributor Author

I have already tried disconnecting and reconnecting the app, and even tried deleting the credentials directly from DB. I would give it a go one more time. I would like you to still book cal.com/hariom to sort it out. If it works for me then we can skip the meeting.

@hariombalhara booked a meeting under the name Shane. This might be silly but if you are yet to test this one again, please make sure you pulled the most recent commit.

@ShaneMaglangit
Copy link
Copy Markdown
Contributor Author

@hariombalhara pushed some stuffs for the solution we found earlier.

Note: we might have to fix the Zoho CRM app. A large part of this PR was derived off that and its likely to have the same bug with the api domain.

calError = error.calError;
}
log.error("createEvent failed", error, calEvent);
log.error("createEvent failed", JSON.stringify(error), calEvent);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Makes it print the error in the same line and thus easy to debug in axiom as well as locally.

id: meetingEvent.data[0].details.id,
//FIXME: `externalCalendarId` is required by the `updateAllCalendarEvents` method, but is not used by zoho-bigin App. Not setting this property actually skips calling updateEvent..
// Here the value doesn't matter. We just need to set it to something.
externalCalendarId: "NO_CALENDAR_ID_NEEDED",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This was causing reschedule to not update the Bigin Event. This might be a problem with other CRM apps as well.

Copy link
Copy Markdown
Member

@hariombalhara hariombalhara left a comment

Choose a reason for hiding this comment

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

Looks good to me now. Thank you so much for the contribution @ShaneMaglangit 🙏

There was one generic issue regarding updating the Event in Bigin. I have fixed it here
https://github.com/calcom/cal.com/pull/8158/files#diff-34b0f03542e82d428c6a8862165903827d1615fb622597f5637dd65a987dcbc9R197

Tests Ran:

  • Creation of Event and Contacts in Bigin works
  • Deletion of Booking deletes event in Zoho Bigin, but not the contact. This is fine as I think we are planning to not delete events from our DB as well
  • Updation of Event updates the timeslot to new times.

@hariombalhara
Copy link
Copy Markdown
Member

@ShaneMaglangit Looks like I am not able to connect the application with other accounts.
I created the Server Based App in Account-1(A Cal.com account) then I am trying to install Zoho Bigin App with my personal account(Account-2). It always gives this error.
Screenshot 2023-05-24 at 9 30 48 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge ❗️ .env changes contains changes to env variables

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Integration with Zoho Bigin

3 participants