Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to select a default country for the Address and Phone fields #8081

Open
123remodeling opened this issue Oct 25, 2024 · 11 comments · May be fixed by #8614
Open

Add ability to select a default country for the Address and Phone fields #8081

123remodeling opened this issue Oct 25, 2024 · 11 comments · May be fixed by #8614
Assignees
Labels
-PR: wip good first issue Good for newcomers scope: back+front Issues requiring full-stack knowledge

Comments

@123remodeling
Copy link

123remodeling commented Oct 25, 2024

Scope & Context

All our opportunities, employees and other contacts are in the US and I would like to make Address field to use the United States as a default country. It's tiresome to change it manually all the time.

Current behavior

Currently, the Country in the Address field defaults to null (but shows Ascention Island for some reason, which is confusing).

Expected behavior

Ability to select the default country on the field level for Address field. I think it would be also useful to add an ability to use a default State for companies that operate only in a single State.

@FelixMalfait
Copy link
Member

FelixMalfait commented Oct 28, 2024

Good point. We already have a similar capabilty for currency (default unit) so whoever implements this can take inspiration from it.

We should also consider adding it for phones (but for phone we should be able to leave it as blank / with no default country, like today)

@FelixMalfait FelixMalfait added the scope: back+front Issues requiring full-stack knowledge label Oct 28, 2024
@Bonapara
Copy link
Member

Bonapara commented Oct 28, 2024

image

https://www.figma.com/design/xt8O9mFeLl46C5InWwoMrN/Twenty?node-id=34845-128087&node-type=frame&t=WdI3ZY5Lsc7ylyqB-11

@123remodeling
Copy link
Author

@Bonapara looks good!

@FelixMalfait FelixMalfait added the good first issue Good for newcomers label Oct 29, 2024
@sreyas-b-anand
Copy link

Can you assign this to me?

@Bonapara
Copy link
Member

Sure @sreyas-b-anand, thanks for contributing!

@sreyas-b-anand sreyas-b-anand removed their assignment Oct 30, 2024
@sri-c9
Copy link

sri-c9 commented Oct 30, 2024

I see that the previous contributor was removed, would you be able to assign this to me? @Bonapara

@Bonapara
Copy link
Member

Sure @sri-c9 , thanks for contributing!

@sri-c9
Copy link

sri-c9 commented Oct 30, 2024

sorry i thought this was nextjs not nestjs

@sri-c9 sri-c9 removed their assignment Oct 30, 2024
@FelixMalfait FelixMalfait changed the title Add ability to select a default country for the Address field Add ability to select a default country for the Address and Phone fields Nov 12, 2024
@guillim
Copy link
Contributor

guillim commented Nov 19, 2024

Question to @Bonapara :

  • I cannot remove a country today. It should be an option for the users ?

Image

  • If I start from an empty address, and I click only to open the INPUT without filling anything. If we prefill the country by default, should it save automatically when I click outside ? or not ?
Screen.Recording.2024-11-19.at.18.33.40.mov

ping @FelixMalfait @charlesBochet

@Bonapara
Copy link
Member

@FelixMalfait
Copy link
Member

@guillim I checked after our conversation and the default currency is actually set on the frontend when editing a currency field. Which means it's set to null by default but if you open/close the input then it'll be set to your default value. We don't really feel it on the currency field because there's also an additional condition so that we shouldn't display anything unless the amount is not null.
I think that behavior is fine and we could have the same behavior on phone numbers (also hiding the number if only the country has been recorded).

For the address field type it's slightly more annoying because if we open/close the address field and it has a default value, then the country will become visible in read-only mode because we don't require setting an address to display it.
I don't think it's a big issue because:

  • the user can always set the value back to null manually since you'll introduce that option
  • in the future, we will likely introduce additional settings on the address field later to allow the user adjust the address display format.
  • in the future, there will be other evolutions to the address field which could impact the decision (e.g. add Google Maps auto-complete)

Overall I don't think it's worth overthinking this feature. We should go with whatever makes more sense for you.

@guillim guillim linked a pull request Nov 20, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-PR: wip good first issue Good for newcomers scope: back+front Issues requiring full-stack knowledge
Projects
Status: 🆕 New
Development

Successfully merging a pull request may close this issue.

6 participants