feat: add Google Place Autocomplete for address fields (#13450)
resolve #13253 This PR enables the use of Google Place Autocomplete and Place Details APIs in the backend. It allows users to automatically fill in address fields by typing into the address1 input. The input is debounced, then the Autocomplete API is called. Once the user selects an address, the Place Details API is used to parse and fill in the individual address fields. https://github.com/user-attachments/assets/e04b8474-25b8-48f5-83d0-2074f8d5fc94 --------- Co-authored-by: Félix Malfait <felix.malfait@gmail.com> Co-authored-by: Félix Malfait <felix@twenty.com>
This commit is contained in:
@@ -175,6 +175,12 @@ export type AuthorizeApp = {
|
||||
redirectUrl: Scalars['String'];
|
||||
};
|
||||
|
||||
export type AutocompleteResultDto = {
|
||||
__typename?: 'AutocompleteResultDto';
|
||||
placeId: Scalars['String'];
|
||||
text: Scalars['String'];
|
||||
};
|
||||
|
||||
export type AvailableWorkspace = {
|
||||
__typename?: 'AvailableWorkspace';
|
||||
displayName?: Maybe<Scalars['String']>;
|
||||
@@ -1039,6 +1045,12 @@ export type LinksMetadata = {
|
||||
secondaryLinks?: Maybe<Array<LinkMetadata>>;
|
||||
};
|
||||
|
||||
export type LocationDto = {
|
||||
__typename?: 'LocationDto';
|
||||
lat?: Maybe<Scalars['Float']>;
|
||||
lng?: Maybe<Scalars['Float']>;
|
||||
};
|
||||
|
||||
export type LoginToken = {
|
||||
__typename?: 'LoginToken';
|
||||
loginToken: AuthToken;
|
||||
@@ -1816,6 +1828,15 @@ export enum PermissionsOnAllObjectRecords {
|
||||
UPDATE_ALL_OBJECT_RECORDS = 'UPDATE_ALL_OBJECT_RECORDS'
|
||||
}
|
||||
|
||||
export type PlaceDetailsResultDto = {
|
||||
__typename?: 'PlaceDetailsResultDto';
|
||||
city?: Maybe<Scalars['String']>;
|
||||
country?: Maybe<Scalars['String']>;
|
||||
location?: Maybe<LocationDto>;
|
||||
postcode?: Maybe<Scalars['String']>;
|
||||
state?: Maybe<Scalars['String']>;
|
||||
};
|
||||
|
||||
export type PostgresCredentials = {
|
||||
__typename?: 'PostgresCredentials';
|
||||
id: Scalars['UUID'];
|
||||
@@ -1870,7 +1891,9 @@ export type Query = {
|
||||
findOneServerlessFunction: ServerlessFunction;
|
||||
findWorkspaceFromInviteHash: Workspace;
|
||||
findWorkspaceInvitations: Array<WorkspaceInvitation>;
|
||||
getAddressDetails: PlaceDetailsResultDto;
|
||||
getApprovedAccessDomains: Array<ApprovedAccessDomain>;
|
||||
getAutoCompleteAddress: Array<AutocompleteResultDto>;
|
||||
getAvailablePackages: Scalars['JSON'];
|
||||
getConfigVariablesGrouped: ConfigVariablesOutput;
|
||||
getConnectedImapSmtpCaldavAccount: ConnectedImapSmtpCaldavAccount;
|
||||
@@ -1952,6 +1975,20 @@ export type QueryFindWorkspaceFromInviteHashArgs = {
|
||||
};
|
||||
|
||||
|
||||
export type QueryGetAddressDetailsArgs = {
|
||||
placeId: Scalars['String'];
|
||||
token: Scalars['String'];
|
||||
};
|
||||
|
||||
|
||||
export type QueryGetAutoCompleteAddressArgs = {
|
||||
address: Scalars['String'];
|
||||
country?: InputMaybe<Scalars['String']>;
|
||||
isFieldCity?: InputMaybe<Scalars['Boolean']>;
|
||||
token: Scalars['String'];
|
||||
};
|
||||
|
||||
|
||||
export type QueryGetAvailablePackagesArgs = {
|
||||
input: ServerlessFunctionIdInput;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user