Skip to content

Commit

Permalink
Runs format script
Browse files Browse the repository at this point in the history
  • Loading branch information
zomars committed Jun 24, 2022
1 parent bc88fd0 commit 7be60b4
Show file tree
Hide file tree
Showing 18 changed files with 180 additions and 80 deletions.
22 changes: 11 additions & 11 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@ diverse, inclusive, and healthy community.
Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
- Focusing on what is best not just for us as individuals, but for the
overall community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or
- The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities
Expand Down Expand Up @@ -106,7 +106,7 @@ Violating these terms may lead to a permanent ban.
### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within
Expand Down
9 changes: 3 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,19 @@ Contributions are what make the open source community such an amazing place to b

### Legend

✅ = has knowledge
✅ = has knowledge

🥇 = is their main priority

⚠️ = is the only one with knowledge
⚠️ = is the only one with knowledge

👀 = has no knowledge but wants to be onboarded
👀 = has no knowledge but wants to be onboarded

<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://dynamic-svgs.vercel.app/image.svg?dark">
<img alt="Areas of expertise table" src="https://dynamic-svgs.vercel.app/image.svg">
</picture>




## Developing

The development branch is `main`. This is the branch that all pull
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ Special thanks to these amazing projects which help power Cal.com:
- [Day.js](https://day.js.org/)
- [Tailwind CSS](https://tailwindcss.com/)
- [Prisma](https://prisma.io/)
<a href="https://jitsu.com/?utm_source=cal.com-gihub"><img height="40px" src="https://jitsu.com/img/powered-by-jitsu.png?gh=true" alt="Jitsu.com"></a>

<a href="https://jitsu.com/?utm_source=cal.com-gihub"><img height="40px" src="https://jitsu.com/img/powered-by-jitsu.png?gh=true" alt="Jitsu.com"></a>

Cal.com is an [open startup](https://cal.com/open) and [Jitsu](https://github.com/jitsucom/jitsu) (an open-source Segment alternative) helps us to track most of the usage metrics.
12 changes: 6 additions & 6 deletions packages/app-store-cli/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

- Create a folder in packages/app-store/{APP_NAME} = {APP}
- Fill it with a sample app
- Modify {APP}/_metadata.ts with the data provided
- Modify {APP}/\_metadata.ts with the data provided

## Approach

- appType is derived from App Name(a slugify operation that makes a string that can be used as a director name, a variable name for imports and a URL path).
- appType is then used to create the app directory. It becomes `config.type` of config.json. config.type is the value used to create an entry in App table and retrieve any apps or credentials. It also becomes App.dirName
- dirnames that don't start with _ are considered apps in packages/app-store and based on those apps .generated.ts* files are created. This allows pre-cli apps to keep on working.
- app directory is populated with app-store/_baseApp with newly updated config.json and package.json
- dirnames that don't start with \_ are considered apps in packages/app-store and based on those apps .generated.ts\* files are created. This allows pre-cli apps to keep on working.
- app directory is populated with app-store/\_baseApp with newly updated config.json and package.json
- `packages/prisma/seed-app-store.config.json` is updated with new app.

NOTE: After app-store-cli is live, Credential.appId and Credential.type would be same for new apps. For old apps they would remain different. Credential.type would be used to identify credentials in integrations call and Credential.appId/App.slug would be used to identify apps.
Expand All @@ -20,20 +20,20 @@ If we rename all existing apps to their slug names, we can remove type and then
- Beta Release
- Show a warning somewhere that app directory must not be renamed manually, edit command must be used.
- edit command should ask for slug and verify if it exists

- Improvements
- Prefill fields in edit command
- Merge app-store:watch and app-store commands, introduce app-store --watch
- Allow inputs in non interactive way as well - That would allow easily copy pasting commands.
- App already exists check. Ask user to run edit/regenerate command
- An app created through CLI should be able to completely skip API validation for testing purposes. Credentials should be created with no API specified specific to the app. It would allow us to test any app end to end not worrying about the corresponding API endpoint.
- Require assets path relative to app dir.
- Require assets path relative to app dir.

## Roadmap

- Avoid delete and edit on apps created outside of cli
- Someone can add wrong directory name(which doesn't satisfy slug requirements) manually. How to handle it.
- Allow editing and updating app from the cal app itself - including assets uploading when developing locally.
- Improvements in shared code across app
- Use baseApp/api/add.ts for all apps with configuration of credentials creation and redirection URL.
- Delete creation side effects if App creation fails - Might make debugging difficult
- This is so that web app doesn't break because of additional app folders or faulty db-seed
- This is so that web app doesn't break because of additional app folders or faulty db-seed
12 changes: 6 additions & 6 deletions packages/app-store/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,13 @@ export function getLocationTypes(): string[] {

export function getLocationLabels(t: TFunction) {
const defaultLocationLabels = defaultLocations.reduce((locations, location) => {
if(location.label === "attendee_phone_number") {
locations[location.value] = t("your_number")
return locations
if (location.label === "attendee_phone_number") {
locations[location.value] = t("your_number");
return locations;
}
if(location.label === "host_phone_number") {
locations[location.value] = `${t("phone_call")} (${t("number_provided")})`
return locations
if (location.label === "host_phone_number") {
locations[location.value] = `${t("phone_call")} (${t("number_provided")})`;
return locations;
}
locations[location.value] = t(location.label);
return locations;
Expand Down
54 changes: 27 additions & 27 deletions packages/app-store/zapier/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,49 +13,49 @@ If you run it on localhost, check out the [additional information](https://githu
2. If not redirected to developer account, go to: [Zapier Developer Account](https://developer.zapier.com)
3. Click **Start a Zapier Integration**
4. Create Integration
- Name: Cal.com
- Description: Cal.com is a scheduling infrastructure for absolutely everyone.
- Intended Audience: Private
- Role: choose whatever is appropriate
- Category: Calendar
- Name: Cal.com
- Description: Cal.com is a scheduling infrastructure for absolutely everyone.
- Intended Audience: Private
- Role: choose whatever is appropriate
- Category: Calendar

## Authentication

1. Go to Authentication, choose Api key and click save
2. Click Add Fields
- Key: apiKey
- Check the box ‘is this field required?’
- Key: apiKey
- Check the box ‘is this field required?’
3. Configure a Test
- Test: GET ```<baseUrl>```/api/integrations/zapier/listBookings
- URL Params
- apiKey: {{bundle.authData.apiKey}}
- Test: GET `<baseUrl>`/api/integrations/zapier/listBookings
- URL Params
- apiKey: {{bundle.authData.apiKey}}
4. Test your authentication —> First you have to install Zapier in the Cal.com App Store and generate an API key, use this API key to test your authentication (only zapier Api key works)

## Triggers

Booking created, Booking rescheduled, Booking cancelled

### Booking created

1. Settings
- Key: booking_created
- Name: Booking created
- Noun: Booking
- Description: Triggers when a new booking is created
- Key: booking_created
- Name: Booking created
- Noun: Booking
- Description: Triggers when a new booking is created
2. API Configuration (apiKey is set automatically, leave it like it is):
- Trigger Type: REST Hook
- Subscribe: POST ```<baseUrl>```/api/integrations/zapier/addSubscription
- Request Body
- subscriberUrl: {{bundle.targetUrl}}
- triggerEvent: BOOKING_CREATED
- Unsubscribe: DELETE ```<baseUrl>```/api/integrations/zapier/deleteSubscription
- URL Params (in addition to apiKey)
- id: {{bundle.subscribeData.id}}
- PerformList: GET ```<baseUrl>```/api/integrations/zapier/listBookings
- Trigger Type: REST Hook
- Subscribe: POST `<baseUrl>`/api/integrations/zapier/addSubscription
- Request Body
- subscriberUrl: {{bundle.targetUrl}}
- triggerEvent: BOOKING_CREATED
- Unsubscribe: DELETE `<baseUrl>`/api/integrations/zapier/deleteSubscription
- URL Params (in addition to apiKey)
- id: {{bundle.subscribeData.id}}
- PerformList: GET `<baseUrl>`/api/integrations/zapier/listBookings
3. Test your API request

Create the other two triggers (booking rescheduled, booking cancelled) exactly like this one, just use the appropriate naming (e.g. booking_rescheduled instead of booking_created)

### Set ZAPIER_INVITE_LINK

The invite link can be found under under Manage → Sharing.
Expand All @@ -68,4 +68,4 @@ 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
- Use forwarding url as your baseUrl for the URL endpoints
- Use forwarding url as your baseUrl for the URL endpoints
11 changes: 6 additions & 5 deletions packages/app-store/zapier/pages/setup/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { Button, Loader, Tooltip } from "@calcom/ui";

/** TODO: Maybe extract this into a package to prevent circular dependencies */
import { trpc } from "@calcom/web/lib/trpc";

export interface IZapierSetupProps {
inviteLink: string;
}
Expand Down Expand Up @@ -46,7 +47,7 @@ export default function ZapierSetup(props: IZapierSetupProps) {

if (integrations.isLoading) {
return (
<div className="absolute z-50 flex items-center w-full h-screen bg-gray-200">
<div className="absolute z-50 flex h-screen w-full items-center bg-gray-200">
<Loader />
</div>
);
Expand All @@ -55,7 +56,7 @@ export default function ZapierSetup(props: IZapierSetupProps) {
return (
<div className="flex h-screen bg-gray-200">
{showContent ? (
<div className="p-10 m-auto bg-white rounded">
<div className="m-auto rounded bg-white p-10">
<div className="flex flex-row">
<div className="mr-5">
<img className="h-11" src="/api/app-store/zapier/icon.svg" alt="Zapier Logo" />
Expand All @@ -72,8 +73,8 @@ export default function ZapierSetup(props: IZapierSetupProps) {
) : (
<>
<div className="mt-1 text-xl">{t("your_unique_api_key")}</div>
<div className="flex my-2 mt-3">
<div className="w-full p-3 pr-5 mr-1 bg-gray-100 rounded">{newApiKey}</div>
<div className="my-2 mt-3 flex">
<div className="mr-1 w-full rounded bg-gray-100 p-3 pr-5">{newApiKey}</div>
<Tooltip content="copy to clipboard">
<Button
onClick={() => {
Expand All @@ -82,7 +83,7 @@ export default function ZapierSetup(props: IZapierSetupProps) {
}}
type="button"
className="px-4 text-base ">
<ClipboardCopyIcon className="w-5 h-5 mr-2 text-neutral-100" />
<ClipboardCopyIcon className="mr-2 h-5 w-5 text-neutral-100" />
{t("copy")}
</Button>
</Tooltip>
Expand Down
2 changes: 1 addition & 1 deletion packages/emails/src/components/Info.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const Info = (props: {
withSpacer?: boolean;
lineThrough?: boolean;
}) => {
if (!props.description || props.description=="") return null;
if (!props.description || props.description === "") return null;
return (
<>
{props.withSpacer && <Spacer />}
Expand Down
1 change: 0 additions & 1 deletion packages/emails/src/components/LocationInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ export function LocationInfo(props: { calEvent: CalendarEvent; t: TFunction }) {
style={{ color: "#3E3E3E" }}
rel="noreferrer">
Google <LinkIcon />

</a>
}
/>
Expand Down
14 changes: 9 additions & 5 deletions packages/emails/src/components/ManageLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@ export function ManageLink(props: { calEvent: CalendarEvent; attendee: Person })
// Only the original attendee can make changes to the event
// Guests cannot
const t = props.attendee.language.translate;
if(props.attendee.email === props.calEvent.attendees[0].email || props.calEvent.organizer.email === props.attendee.email ){
if (
props.attendee.email === props.calEvent.attendees[0].email ||
props.calEvent.organizer.email === props.attendee.email
) {
return (
<div
style={{
fontFamily: "Roboto, Helvetica, sans-serif",
fontSize: "16px", fontWeight: 500,
fontSize: "16px",
fontWeight: 500,
lineHeight: "0px",
textAlign: "left",
color: "#3e3e3e",
Expand All @@ -26,7 +30,7 @@ export function ManageLink(props: { calEvent: CalendarEvent; attendee: Person })
</div>
);
}
// Dont have the rights to the manage link
return null

// Dont have the rights to the manage link
return null;
}
1 change: 0 additions & 1 deletion packages/emails/templates/forgot-password-email.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { TFunction } from "next-i18next";

import { renderEmail } from "../";

import BaseEmail from "./_base-email";

export type PasswordReset = {
Expand Down
2 changes: 1 addition & 1 deletion packages/embeds/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ This folder contains all the various flavours of embeds.
`core` contains the core library written in vanilla JS that manages the embed.
`snippet` contains the Vanilla JS Code Snippet that can be installed on any website and would automatically fetch the `core` library.

Please see the respective folder READMEs for details on them.
Please see the respective folder READMEs for details on them.
Loading

0 comments on commit 7be60b4

Please sign in to comment.