Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Fix/4235 – Consistent Sorting Of Countries – Alphabetically #1680

Merged
merged 10 commits into from
Dec 15, 2020

Conversation

tcfos
Copy link
Contributor

@tcfos tcfos commented Dec 14, 2020

Description

Fixes the inconsistent sorting of country list.

  • on "Andere warnen", countries are sorted as provided by app config (i.e. unsorted)
  • on "Ihr Einverständnis", countries are sorted alphabetically

Spec: sort alphabetically.

Link to Jira

https://jira-ibs.wbs.net.sap/browse/EXPOSUREAPP-4235

Screenshots

IMG_0133
IMG_0132
IMG_0131

@tcfos tcfos added the bug Something isn't working label Dec 14, 2020
@tcfos tcfos added this to the v1.11.0 milestone Dec 14, 2020
@@ -8,7 +8,7 @@ import UIKit
struct ExposureSubmissionQRInfoViewModel {

init(supportedCountries: [Country]) {
countries = supportedCountries
countries = supportedCountries.sorted { $0.localizedName.localizedCompare($1.localizedName) == .orderedAscending }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we put this in an Extension for [Country] ?

extension Array where Element : Country

Something along those lines.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool idea 👍
Done with 8058e6e

@tcfos tcfos marked this pull request as ready for review December 14, 2020 20:35
@tcfos tcfos requested review from a team and marcussc December 14, 2020 20:35
Copy link
Contributor

@whiskey whiskey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix!

Could you please add a simple unit test? Maybe "Germany, Spain and the Netherlands" ordered in these languages. The ordering should change, based on a quick guesstimation from this list of translated country names.

@tcfos tcfos marked this pull request as draft December 15, 2020 12:32
@tcfos
Copy link
Contributor Author

tcfos commented Dec 15, 2020

Could you please add a simple unit test?

Added a unit test for sorting countries based on localized country names for all supported languages.

@tcfos tcfos marked this pull request as ready for review December 15, 2020 12:58
@tcfos tcfos requested a review from whiskey December 15, 2020 12:59
@whiskey whiskey merged commit 8d7d192 into release/1.11.x Dec 15, 2020
@whiskey whiskey deleted the fix/4235-SortingOfCountriesAlphabetically branch December 15, 2020 23:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants