Skip to content

Conversation

@leog
Copy link
Contributor

@leog leog commented Aug 4, 2022

What does this PR do?

Close.com app for the App Store.

Implements #2619

Environment: Staging(main branch) / Production

Type of change

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

How should this be tested?

Go to App Store and select Close.com app from the Other category

@leog leog added the ♻️ autoupdate tells kodiak to keep this branch up-to-date label Aug 4, 2022
@leog leog added this to the v.2.0 milestone Aug 4, 2022
@vercel
Copy link

vercel bot commented Aug 4, 2022

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

Name Status Preview Updated
cal ❌ Failed (Inspect) Aug 15, 2022 at 8:47PM (UTC)
cal-com ❌ Failed (Inspect) Aug 15, 2022 at 8:47PM (UTC)
nightly-cal ❌ Failed (Inspect) Aug 15, 2022 at 8:47PM (UTC)
1 Ignored Deployment
Name Status Preview Updated
swagger ⬜️ Ignored (Inspect) Aug 15, 2022 at 8:47PM (UTC)

@leog leog linked an issue Aug 4, 2022 that may be closed by this pull request
Copy link
Contributor

@zomars zomars left a comment

Choose a reason for hiding this comment

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

Loving the TDD style for far. Great job @leog I'm pressing for some quality improvements we can achieve so we can merge 🙏🏽

setupFiles: ["<rootDir>/test/globals.ts"],
};

export default config;
Copy link
Contributor

Choose a reason for hiding this comment

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

How can we run these tests?

Comment on lines +69 to +82
const res = await fetch("/api/integrations/closecomothercalendar/add", {
method: "POST",
body: JSON.stringify(values),
headers: {
"Content-Type": "application/json",
},
});
const json = await res.json();

if (res.ok) {
router.push(json.url);
} else {
showToast(json.message, "error");
}
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 adopt a similar style as routing forms here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@zomars I guess we could, but to be honest, it feels a bit too much for what needs to be done compared to routing forms. Are we looking to standardize that kind of handling? If so, makes sense to refactor it.

Copy link
Contributor

Choose a reason for hiding this comment

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

We're moving away from api handlers in web app but we'll let it slide for now.

}));

jest.mock("@calcom/lib/crypto", () => ({
symmetricDecrypt: () => `{
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice!


type CloseComCustomActivityCustomField<T extends string> = `custom.${T}`;

const environmentApiKey = process.env.CLOSECOM_API_KEY || "";
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 fetch this from the DB? you can follow this style to achieve 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.

We actually have two different ways to instance CloseCom. With a key that comes from the user, to manipulate their instance of CloseCom or having one for Cal.com for which that will come from an environment variable.

Copy link
Contributor

Choose a reason for hiding this comment

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

Let's sync about this @leog

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure. PTAL at #3814 to know more to what I meant about instancing CloseCom for Cal.com purposes.

client_secret: process.env.HUBSPOT_CLIENT_SECRET,
});
}
// No need to check if environment variable is present, the API Key is set up by the user, not the system
Copy link
Contributor

Choose a reason for hiding this comment

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

WDYM with this? How is the key set by the user? Do we have a UI for this? Is it saved a credential? If not then this is a system key and should be saved in the DB for consistency with every other app.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Exactly, the setup page for the app gets the key from the user, so in terms of validating if the app can show up as installable, there is no need to check here for any environment variable, as the environment variable for the Close.com API Key is just for our own usage.

@leog leog merged commit 4ce6b91 into main Aug 15, 2022
@leog leog deleted the feat/closecom-app branch August 15, 2022 20:45
zomars added a commit that referenced this pull request Aug 23, 2022
* Close.com App (#3709)

* WIP close.com app

* Removing leaked dev key (now invalid)

* Misspelled env variable

* Making progress still WIP

* Progress + tests

* Final touches

* More unit tests

* Finished up tests

* Merge main

* Removing unneeded stuff + submodules

* Removing static props, fields fix

* Removing unneeded stuff p2

* Commenting

* Standarizing APIs

* Zodifying

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: zomars <[email protected]>

* fix: padding of kBarTrigger (#3846)

* fixes issue with variables not working (#3859)

Co-authored-by: CarinaWolli <[email protected]>

* fix: remove redundant AND (#3833)

Co-authored-by: hussamkhatib <[email protected]>

* Hotfix: Embed - Fix issue in accessing sessionStorage in certain scenarios (#3851)

* Fixes issue when sessionStorage is not accessible in privacy focussed modes in various browsers

* Fix eslint errors

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>

* fixed iframe in lark suite, added lark contact info (#3866)

* fixed iframe in lark suite, added lark contact info

* Update _metadata.ts

* Update Railway Template (#3862)

* Update Railway Template

* Update URL

Co-authored-by: Peer Richelsen <[email protected]>

* New Crowdin translations by Github Action (#3857)

Co-authored-by: Crowdin Bot <[email protected]>

* Attempt at redirect to 404 (#3877)

* Attempt at redirect to 404

404 should be able to handle the traffic no problem - better ideas welcome. Just a temp fix I imagine; we're not going to want to keep this nor can we expect the User-Agent to continue identifying the traffic source.

* Update next.config.js

Co-authored-by: zomars <[email protected]>

* hotfix dynamic issue (#3864)

* Hotfix/dos mitigation attempt error configuration (#3879)

* Fixes 'Task timed out after 60.03 seconds'

* DDoS rewrite fixes

Co-authored-by: zomars <[email protected]>

* Fix desktop app link (#3883)

* fixed 404 logo on cal video (#3885)

* Update all Yarn dependencies (2022-07-29) (#3599)

* Update all Yarn dependencies (2022-07-29)

* Adds syncpack config

* Fixes mismatches

* Update yarn.lock

* RRule fixes

* Locking dayjs to fix build

* Type fixes

* Fixes mismatches

* Submodule sync

* Update yarn.lock

* Update event.ts

* Conflict fixes

* Fixes prisma warnings

* Liting

* Upgrade next, zod

* Prevents articfact overwriting

* Yarn fixes

* Jest fixes

* Submodule sync

* Formatting

* Submodule sync

* Adds provider for react-tooltip

* Removed dotenv-cli

* Readds dotenv-cli

* Skips getSchedule tests

Until prisma is mocked properly

* Fixes

* Revert prisma seed script

* E2E fixes

* test

* Removed deprecated req.page in middleware

* Make tests stable

* Unskip getSchedule tests

* fixed 404 logo on cal video (#3885)

* Removed PW aliases as aren't needed anymore

Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
Co-authored-by: zomars <[email protected]>
Co-authored-by: Hariom Balhara <[email protected]>
Co-authored-by: Alex van Andel <[email protected]>
Co-authored-by: Peer Richelsen <[email protected]>

* Submodule sync

* temporally removed missing calendar badge on event-types (#3889)

* New Crowdin translations by Github Action (#3878)

Co-authored-by: Crowdin Bot <[email protected]>

* use default cursor on desktop (#3876)

* New Crowdin translations by Github Action (#3890)

Co-authored-by: Crowdin Bot <[email protected]>
Co-authored-by: Peer Richelsen <[email protected]>

* NEXTAUTH_DOMAIN isn't used

* Sync submodules

* New Crowdin translations by Github Action (#3897)

Co-authored-by: Crowdin Bot <[email protected]>

* adjust react version

* Revert "adjust react version"

This reverts commit 6e161da.

* cancel booking new design added (#3660)

* feat:  cancel booking new design added

* style: add space-y in button

* style: ui fixed for recurring booking

* fix: scroll in recurring event and use translation

* style: text 2xl instead of text-[24px]

* fix: typo, spacing

* fix: replaced multiple h2 tags with div

* fix: padding and Icon name

* Revert " cancel booking new design added" (#3922)

This reverts commit a06c564.

* New Crowdin translations by Github Action (#3909)

Co-authored-by: Crowdin Bot <[email protected]>

* New Crowdin translations by Github Action (#3924)

Co-authored-by: Crowdin Bot <[email protected]>

* New Crowdin translations by Github Action (#3926)

Co-authored-by: Crowdin Bot <[email protected]>

* fix/auto-connect-calendar-3582 (#3891)

* Added alert when there isn't default calendar connected

* Add default calendar externalId to select placeholder

* Fix typos

* Fixes prisma import

Co-authored-by: Peer Richelsen <[email protected]>
Co-authored-by: zomars <[email protected]>

* redesigned cancel page to new design (#3923)

Co-authored-by: Alex van Andel <[email protected]>

* New Crowdin translations by Github Action (#3927)

Co-authored-by: Crowdin Bot <[email protected]>

* New Crowdin translations by Github Action (#3929)

Co-authored-by: Crowdin Bot <[email protected]>

* Design issues on success page in some languages (#3900)

Co-authored-by: gitstart <[email protected]>
Co-authored-by: Nitesh Singh <[email protected]>
Co-authored-by: Júlio Piubello da Silva Cabral <[email protected]>
Co-authored-by: Matheus Muniz <[email protected]>
Co-authored-by: Matheus Benini <[email protected]>
Co-authored-by: Grace Nshokano <[email protected]>
Co-authored-by: Matheus Muniz <[email protected]>
Co-authored-by: gitstart <[email protected]>
Co-authored-by: Murilo Amaral <[email protected]>
Co-authored-by: Peer Richelsen <[email protected]>

* fix: developer docs url (#3914)

* fix: developer docs url added

* chore : remove /

* chore : import url

Co-authored-by: Zach Waterfield <[email protected]>
Co-authored-by: Peer Richelsen <[email protected]>

* Fixes collective availability for teams with overlapping day timezones (#3898)

* WIP

* Fix for team availability with time offsets

* Prevent empty schedule from opening up everything

* When no utcOffset or timeZone's are given, default to 0 utcOffset (UTC)

* timeZone should not be part of getUserAvailability

* Prevents {days:[X],startTime:0,endTime:0} error entry

* Added getAggregateWorkingHours() (#3913)

* Added test for getAggregateWorkingHours

* Timezone isn't used here anymore

* fix: developer docs url (#3914)

* fix: developer docs url added

* chore : remove /

* chore : import url

Co-authored-by: Zach Waterfield <[email protected]>
Co-authored-by: Peer Richelsen <[email protected]>

* Test fixes

* Reinstate prisma (generate only) and few comments

* Test fixes

* Skipping getSchedule again

* Added await to expect() as it involves async logic causing the promise to timeout

* Test cleanup

* Update jest.config.ts

Co-authored-by: Alan <[email protected]>
Co-authored-by: Alex van Andel <[email protected]>
Co-authored-by: Udit Takkar <[email protected]>
Co-authored-by: Zach Waterfield <[email protected]>
Co-authored-by: Peer Richelsen <[email protected]>

* v1.9.1

Co-authored-by: Leo Giovanetti <[email protected]>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: zomars <[email protected]>
Co-authored-by: Udit Takkar <[email protected]>
Co-authored-by: Carina Wollendorfer <[email protected]>
Co-authored-by: CarinaWolli <[email protected]>
Co-authored-by: mohammed hussam <[email protected]>
Co-authored-by: hussamkhatib <[email protected]>
Co-authored-by: Hariom Balhara <[email protected]>
Co-authored-by: Jake Cooper <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Crowdin Bot <[email protected]>
Co-authored-by: Alex van Andel <[email protected]>
Co-authored-by: Syed Ali Shahbaz <[email protected]>
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
Co-authored-by: Julian Benegas <[email protected]>
Co-authored-by: alannnc <[email protected]>
Co-authored-by: GitStart <[email protected]>
Co-authored-by: gitstart <[email protected]>
Co-authored-by: Nitesh Singh <[email protected]>
Co-authored-by: Júlio Piubello da Silva Cabral <[email protected]>
Co-authored-by: Matheus Muniz <[email protected]>
Co-authored-by: Matheus Benini <[email protected]>
Co-authored-by: Grace Nshokano <[email protected]>
Co-authored-by: Matheus Muniz <[email protected]>
Co-authored-by: gitstart <[email protected]>
Co-authored-by: Murilo Amaral <[email protected]>
Co-authored-by: Zach Waterfield <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

♻️ autoupdate tells kodiak to keep this branch up-to-date

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

Close.com App

4 participants