-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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: OOO webhook and zapier #15434
base: main
Are you sure you want to change the base?
feat: OOO webhook and zapier #15434
Conversation
@alannnc is attempting to deploy a commit to the cal Team on Vercel. A member of the Team first needs to authorize it. |
💵 To receive payouts, sign up on Algora, link your Github account and connect with Stripe/Alipay. |
Hey there and thank you for opening this pull request! 👋🏼 We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted. Details:
|
Graphite Automations"Add community label" took an action on this PR • (06/14/24)1 label was added to this PR based on Keith Williams's automation. "Add consumer team as reviewer" took an action on this PR • (06/14/24)1 reviewer was added to this PR based on Keith Williams's automation. |
@@ -367,7 +367,7 @@ const OutOfOfficePage = () => { | |||
const { t } = useLocale(); | |||
|
|||
const params = useSearchParams(); | |||
const openModalOnStart = !!params?.get("om"); | |||
const openModalOnStart = !!params?.get("open"); |
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.
Better name
### Set ZAPIER_INVITE_LINK | ||
|
||
The invite link can be found under under Manage → Sharing. | ||
The invite link can be found under Manage → Sharing. |
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.
double under
@@ -67,5 +87,5 @@ Localhost urls can not be used as the base URL for api endpoints | |||
Possible solution: using [https://ngrok.com/](https://ngrok.com/) | |||
|
|||
1. Create Account | |||
2. [Download](https://ngrok.com/download) gnork and start a tunnel to your running localhost | |||
2. [Download](https://ngrok.com/download) ngrok and start a tunnel to your running localhost |
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.
typo
icon: "googleCalendar.svg", | ||
app: "Google Calendar", | ||
text: "Add new calendar event when a team member is out of office", | ||
link: "https://zapier.com/app/editor/template/ToBeDefined", |
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.
Once you got created this template in your app update ID here
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.
lets follow up with this in a different PR so we can merge this one
@@ -92,7 +93,6 @@ const WebhookForm = (props: { | |||
const [newSecret, setNewSecret] = useState(""); | |||
const [changeSecret, setChangeSecret] = useState<boolean>(false); | |||
const hasSecretKey = !!props?.webhook?.secret; | |||
// const currentSecret = props?.webhook?.secret; |
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.
Cleaning
@@ -282,7 +282,7 @@ const WebhookForm = (props: { | |||
<Button | |||
type="submit" | |||
disabled={!formMethods.formState.isDirty && !changeSecret} | |||
loading={formMethods.formState.isSubmitting || formMethods.formState.isSubmitted}> | |||
loading={formMethods.formState.isSubmitting}> |
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.
isSubmitted is bad here because after you submit and error happened you still will be seeing the loading.
@@ -451,3 +451,89 @@ export async function updateTriggerForExistingBookings( | |||
); | |||
await Promise.all(promise); | |||
} | |||
|
|||
export async function listOOOEntries( |
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.
Functions that helps zapier fetch and look data fields as example for Zap.
EventTypeInfo & { | ||
metadata?: { [key: string]: string | number | boolean | null }; | ||
export type WebhookDataType = Partial<CalendarEvent> & | ||
Partial<EventTypeInfo> & { |
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.
Partial as open a new path for webhooks that can include different set of data and not just bookings
@@ -17,33 +18,29 @@ type CreateOptions = { | |||
}; | |||
|
|||
export const createHandler = async ({ ctx, input }: CreateOptions) => { | |||
const { user } = ctx; |
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.
Cleaning since original file had a lot of redundancy
}); | ||
} catch (error) { | ||
// Avoid printing raw prisma error on frontend |
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.
No more prisma raw error on website
What does this PR do?
Loom Video: https://www.loom.com/share/b1a4d42ec78944d49248501e2d805c56
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
Checklist
/claim #15430