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

feat: Add ICS Feed support #13337

Merged
merged 8 commits into from
Jan 23, 2024
Merged

feat: Add ICS Feed support #13337

merged 8 commits into from
Jan 23, 2024

Conversation

mogery
Copy link
Contributor

@mogery mogery commented Jan 19, 2024

What does this PR do?

Adds an "ICS Feed" app to the app store that allows the linking of ICS Feeds for usage via getAvailability

Fixes #3167
/claim #3167

Type of change

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

How should this be tested?

Criteria:

  • "ICS Feed" can be installed from the App Store
  • Setup screen pops up, ICS feed URLs can be added and saved
  • ICS feed calendars appear in the system and are toggleable to be used for conflict checking
  • ICS feeds are actually used for conflict checking

There's an ICS feed of German holidays in #3167 that I used for testing.

Copy link

vercel bot commented Jan 19, 2024

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

A member of the Team first needs to authorize it.

@CLAassistant
Copy link

CLAassistant commented Jan 19, 2024

CLA assistant check
All committers have signed the CLA.

Copy link

algora-pbc bot commented Jan 19, 2024

💵 To receive payouts, sign up on Algora, link your Github account and connect with Stripe/Alipay.

Copy link
Contributor

github-actions bot commented Jan 19, 2024

Thank you for following the naming conventions! 🙏 Feel free to join our discord and post your PR link.

@github-actions github-actions bot added app-store area: app store, apps, calendar integrations, google calendar, outlook, lark, apple calendar Low priority Created by Linear-GitHub Sync osshack Submission for 2023 OSShack ✨ feature New feature or request 💎 Bounty A bounty on Algora.io 🙋🏻‍♂️help wanted Help from the community is appreciated labels Jan 19, 2024
@mogery
Copy link
Contributor Author

mogery commented Jan 19, 2024

Couldn't revert the yarn.lock change since this updates the workspace structure. Reverted it anyways

@mogery mogery changed the title Add ICS Feed support feat: Add ICS Feed support Jan 19, 2024
Copy link
Contributor

github-actions bot commented Jan 19, 2024

📦 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! 🙌

@PeerRich
Copy link
Member

awesome initiative

this will come handy for many people using ics

Comment on lines +16 to +37
// for Apple's Travel Time feature only (for now)
const getTravelDurationInSeconds = (vevent: ICAL.Component) => {
const travelDuration: ICAL.Duration = vevent.getFirstPropertyValue("x-apple-travel-duration");
if (!travelDuration) return 0;

// we can't rely on this being a valid duration and it's painful to check, so just try and catch if anything throws
try {
const travelSeconds = travelDuration.toSeconds();
// integer validation as we can never be sure with ical.js
if (!Number.isInteger(travelSeconds)) return 0;
return travelSeconds;
} catch (e) {
return 0;
}
};

const applyTravelDuration = (event: ICAL.Event, seconds: number) => {
if (seconds <= 0) return event;
// move event start date back by the specified travel time
event.startDate.second -= seconds;
return event;
};
Copy link
Contributor Author

Choose a reason for hiding this comment

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

not sure how much this is actually needed? it certainly doesn't hurt though

@keithwillcode keithwillcode requested a review from a team January 20, 2024 13:13
@keithwillcode keithwillcode added the community Created by Linear-GitHub Sync label Jan 20, 2024
@keithwillcode keithwillcode added this to the v3.9 milestone Jan 20, 2024
Copy link
Contributor

@emrysal emrysal left a comment

Choose a reason for hiding this comment

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

Tested, code wise this looks really good too; Happy to approve - Thank you!

Copy link

vercel bot commented Jan 23, 2024

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

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
calcom-web-canary ⬜️ Ignored (Inspect) Visit Preview Jan 23, 2024 10:24am

@emrysal emrysal merged commit 0abff9f into calcom:main Jan 23, 2024
32 of 39 checks passed
@keithwillcode keithwillcode modified the milestones: v3.9, v3.8 Jan 23, 2024
@saschafoerster
Copy link
Contributor

So cool! 😎

@mogery mogery deleted the mog/ics-feed branch January 23, 2024 13:25
zomars added a commit to KATT/cal.com that referenced this pull request Jan 23, 2024
* feat: ics-feed proof of concept pt. 1

* feat: ics-feedcalendar fixes

* fix: ics feed i18n and icon issues

* fix: remove debug log

* chore: revert yarn.lock

* fix: remove debug log

---------

Co-authored-by: Omar López <zomars@me.com>
Co-authored-by: Alex van Andel <me@alexvanandel.com>
@shafy
Copy link

shafy commented Feb 12, 2024

Really cool! Is this already live on the cal.com version yet? I can't seem to find it...

@penyuan
Copy link

penyuan commented Feb 15, 2024

@emrysal @mogery Same here, how do I find this feature on cal.com????

@Rubenkl
Copy link

Rubenkl commented Feb 20, 2024

Someone added the labels for milestone v3.9, v3.8. So when 3.9 is out for sure this seems included!

@penyuan
Copy link

penyuan commented Mar 17, 2024

I'm getting the same error as @wivaku as described in issue #3167. I shared an Outlook 365 calendar under my control with full view permissions, with URL in the form of https://outlook.office365.com/owa/calendar/<...>/<...>/calendar.ics, and copied it into the "ICS Feed" app. And I got an error saying:

No handlers found for ics-feed

@mogery @emrysal and other developers: Can you please advise? Thank you!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app-store area: app store, apps, calendar integrations, google calendar, outlook, lark, apple calendar 🙋 Bounty claim 💎 Bounty A bounty on Algora.io community Created by Linear-GitHub Sync ✨ feature New feature or request 🙋🏻‍♂️help wanted Help from the community is appreciated Low priority Created by Linear-GitHub Sync osshack Submission for 2023 OSShack
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CAL-2979] ICS feed support for checking against double bookings
10 participants