cal.com icon indicating copy to clipboard operation
cal.com copied to clipboard

feat: Locations Autocompletion on Event Settings

Open stylessh opened this issue 1 year ago • 13 comments

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 avatar Dec 07 '23 02:12 stylessh

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

A member of the Team first needs to authorize it.

vercel[bot] avatar Dec 07 '23 02:12 vercel[bot]

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Dec 07 '23 02:12 CLAassistant

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

github-actions[bot] avatar Dec 07 '23 02:12 github-actions[bot]

Regarding the failing PR check-types test, I receive types in local and everything works. 🤔

Screenshot 2023-12-06 at 23 04 22

stylessh avatar Dec 07 '23 03:12 stylessh

@stylessh type check is failing

Udit-takkar avatar Dec 07 '23 19:12 Udit-takkar

@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.

Screenshot 2023-12-07 at 15 43 40

stylessh avatar Dec 07 '23 19:12 stylessh

@Udit-takkar should be fine now

stylessh avatar Dec 07 '23 19:12 stylessh

📦 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 "+/-

github-actions[bot] avatar Dec 07 '23 19:12 github-actions[bot]

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 avatar Dec 14 '23 08:12 ciaranha

@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 :)

stylessh avatar Dec 14 '23 17:12 stylessh

This PR is being marked as stale due to inactivity.

github-actions[bot] avatar Dec 29 '23 00:12 github-actions[bot]

This PR is being closed due to inactivity. Please reopen if work is intended to be continued.

github-actions[bot] avatar Jan 05 '24 00:01 github-actions[bot]

Added locations autocomplete on Location Edit Modal as well.

https://github.com/calcom/cal.com/assets/45767683/82ca15fa-caec-4713-9254-5812a1eedf8b

stylessh avatar Jan 05 '24 18:01 stylessh

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.

joeauyeung avatar Jan 19 '24 17:01 joeauyeung