nextcloud / contacts

📇 Contacts app for Nextcloud
https://apps.nextcloud.com/apps/contacts
GNU Affero General Public License v3.0
571 stars 172 forks source link

Address Field Order - Postcode #833

Open brianWreaves opened 5 years ago

brianWreaves commented 5 years ago

Describe the bug

Within the Address section of each contact, the field order doesn't render the "postcode" field after the "State or Province" but before "Country" field but instead between "Address" and "City" fields (See attached screenshot).

To Reproduce Simply view a contact with an address entered.

Expected behavior "Postcode" field should render after "State or province" but before "Country" field.

Actual behavior "Postcode" field renders between "Address" and "City" fields.

Screenshots Attached below with annotations.

nc14_contacts_app_address_field_order_02

Operating system: High Sierra & Android

Web server: Apache

Database: MySQL

PHP version: 7.1

Nextcloud version: 14.0.4

Contacts version: 2.1.8

Updated from an older Nextcloud or fresh install: Updated from older

Client configuration

Browser: FF64+

Operating system: High Sierra or Android 8+

CardDAV-clients: High Sierra interface

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/68342500-address-field-order-postcode?utm_campaign=plugin&utm_content=tracker%2F46751899&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F46751899&utm_medium=issues&utm_source=github).
nextcloud-bot commented 5 years ago

GitMate.io thinks possibly related issues are https://github.com/nextcloud/contacts/issues/302 (Missing Fields), https://github.com/nextcloud/contacts/issues/803 (two address fields are connected after adding a phone number), https://github.com/nextcloud/contacts/issues/72 (Handle line-breaks in address field), https://github.com/nextcloud/contacts/issues/109 (Suggestion : XMPP field), and https://github.com/nextcloud/contacts/issues/57 (Address field escaped characters not showing).

skjnldsv commented 5 years ago

Hum, in Europe this is how we format the addresses: https://www.bitboost.com/ref/international-address-formats.html

It seems that it's also the case in a lot of various area. The postal code goes before the city :)

brianWreaves commented 5 years ago

Given such a diversity, the user needs an option to select format.

skjnldsv commented 5 years ago

@jancborchardt opinion? :)

jancborchardt commented 5 years ago

This could automatically be sorted based on the region format from the user settings. People shouldn’t need to manually select an additional option.

skjnldsv commented 5 years ago

@jancborchardt I mean, I don't see myself maintaining a list of every country and the address layout ^^

brianWreaves commented 5 years ago

@jancborchardt which "region format from the user settings" are you referring:

Fair point, @skjnldsv! I reckon you could lean on a resource/API from another entity such as Maps or Contacts from Google.

Another option would be to allow users to drag & drop fields into the order they prefer within NC, in the Contacts app to create a default.

Then there are the suggestions in #309 which appears to be scheduled for v3.1.0.

jancborchardt commented 5 years ago

I mean, I don't see myself maintaining a list of every country and the address layout ^^

Sure, with my remark I just meant that’s the solution we should go for if we do anything about this. The other solution is to leave it as it is.

Another option would be to allow users to drag & drop fields into the order they prefer within NC, in the Contacts app to create a default.

No, as this would be a lot to implement for a minor issue and would need to be tested to ensure it works.

@brianWreaves I am referring to:

NC's Settings > Personal > Personal Info > Locale field

Also thanks for referring https://github.com/nextcloud/contacts/issues/309 – this seems to be a duplicate of that.

brianWreaves commented 5 years ago

The other solution is to leave it as it is.

That's not a solution at all, that's ignoring the issue.

...seems to be a duplicate of that.

Certainly has similar aspects to this post but is stating the opposite in that the contact format is labelled as "US-centric" by the poster. In-fact it's European as mentioned above. As well, it goes a bit further than this post with additional suggestions which I would be keen on e.g. Moving PO Box to drop-down selection.

skjnldsv commented 5 years ago

From @olantrust

There are several issues caused by the current address layout:

Currently

  1. It is US-centric and doesn't reflect the many varied address layouts globally, making it hard for most of the world to use.
  2. The Post Office Box section is almost redundant in most of the world, and takes up unnecessary space.

Solution A simple and graceful but powerful improvement would make the app look and work better for users around the globe: To relieve problematic issues with users having to distort address layouts, and postal printing, etc... dependant upon their country:

  1. Have a back-end of address layouts stored in the code, per country (Universal Postal Union has this listed, we're happy to do the work to put them in a file and upload).
  2. Provide an Option to set which address layout to use by default for each Administrator/User.
  3. If User changes the 'Country' field in a contact's address, change the address layout for that address to the appropriate style for that country.
  4. Remove Post Office Box from the standard layouts. When adding address, allow the user to choose from 'Home', 'Work', 'Other', and 'POBox' in case they need to use that format of address.
stephengraf commented 5 years ago

Could the locale field from the user settings be used to trigger the correct layout? Canada and the USA have the same format and I think most of Europe has a common format. Just a handful of layouts might be required, with a default.

skjnldsv commented 5 years ago

Could the locale field from the user settings be used to trigger the correct layout

We do that for other stuff on contacts, so yes, it definitely could. But the locale settings in nextcloud does not include data for address layout :)

skjnldsv commented 5 years ago

We could use a library, I found two:

  1. https://github.com/arcreative/node-address-format
  2. https://github.com/Shopify/quilt

The first one is completely dead. I'll see what we can do with the latest.