cal.com
cal.com copied to clipboard
feat: Locations Autocompletion on Event Settings
What does this PR do?
This PR adds autocomplete from locations, using Google Places API. Closes #11931 and related
Requirement/Documentation
This feature requires an api key from Google Places API.
# .env
# GOOGLE PLACES API
# Needed for Locations Autocomplete in Event Types
GOOGLE_PLACES_API_KEY=
Type of change
- [X] New feature (non-breaking change which adds functionality)
How should this be tested?
- Are there environment variables that should be set?
A Google Places api key needs to be set.
GOOGLE_PLACES_API_KEY= - What are the minimal test data to have? A string array of places to test the search.
- What is expected (happy path) to have (input and output)? When user writes a location, a dropdown with relevant options should appear to autocomplete.
https://github.com/calcom/cal.com/assets/45767683/c162f6e4-9c6c-4805-8aa9-f50a64c9399c
Mandatory Tasks
- [X] Make sure you have self-reviewed the code. A decent size PR without self-review might be rejected.
@stylessh is attempting to deploy a commit to the cal Team on Vercel.
A member of the Team first needs to authorize it.
Thank you for following the naming conventions! 🙏 Feel free to join our discord and post your PR link.
Regarding the failing PR check-types test, I receive types in local and everything works. 🤔
@stylessh type check is failing
@Udit-takkar yes, on actions import { useOnClickOutside } from "@calcom/lib/hooks/useOnClickOutside"; is not being built, and typescript doesn't recognize the file.
Everything is working great on local, I built, type-checked and linted the application. No errors.
@Udit-takkar should be fine now
📦 Next.js Bundle Analysis for @calcom/web
This analysis was generated by the Next.js Bundle Analysis action. 🤖
One Page Changed Size
The following page changed size from the code in this PR compared to its base branch:
| Page | Size (compressed) | First Load | % of Budget (350 KB) |
|---|---|---|---|
/bookings/[status] |
318.98 KB |
484.67 KB | 138.48% (🟡 +1.13%) |
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 "+/-
Is there a preview URL for testing this that I'm missing anywhere?
Usage looks great in the clip and I really like this, but I would like to also test what happens if...
- I just want to type in "Sky Meeting Room, First floor", "Breakout room, HQ", etc.
- I want to append info that's not in Google maps like a Room #, Floor # etc to an actual address
- It doesn't find my address
@ciaranha authorization is required to deploy, and also the api key needs to be set on vercel. You can checkout the PR and add your own api key to test :)
This PR is being marked as stale due to inactivity.
This PR is being closed due to inactivity. Please reopen if work is intended to be continued.
Added locations autocomplete on Location Edit Modal as well.
https://github.com/calcom/cal.com/assets/45767683/82ca15fa-caec-4713-9254-5812a1eedf8b
Hey @stylessh, after some discussion we're going to close this PR for now. We're not ready yet to add an other dependency but when the time comes we'll revisit this PR. Thanks again for your contribution.