summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorAishwarya Subramanian <asubramanian@gitlab.com>2019-09-11 16:02:11 +0000
committerJames Lopez <james@gitlab.com>2019-09-11 16:02:11 +0000
commit54b51d956e6fd1439f303f233da167d62ce2e50a (patch)
treeb4d3d8f85518da9c780a029b221b9aa2a0aa4391 /config
parent3ffdae92b3575960e21515e7646a6f906e9ac1e0 (diff)
downloadgitlab-ce-54b51d956e6fd1439f303f233da167d62ce2e50a.tar.gz
Back port changes for country list Api
Diffstat (limited to 'config')
-rw-r--r--config/dependency_decisions.yml7
-rw-r--r--config/initializers/countries.rb61
-rw-r--r--config/routes.rb1
3 files changed, 69 insertions, 0 deletions
diff --git a/config/dependency_decisions.yml b/config/dependency_decisions.yml
index 33c90989548..5346bf45473 100644
--- a/config/dependency_decisions.yml
+++ b/config/dependency_decisions.yml
@@ -613,3 +613,10 @@
:why: https://bitbucket.org/atlassian/atlassian-jwt-ruby/src/master/LICENSE.txt
:versions: []
:when: 2019-08-30 05:45:35.317663000 Z
+- - :license
+ - unicode_utils
+ - MIT
+ - :who: Aishwarya Subramanain
+ :why: https://github.com/hexorx/countries/blob/master/LICENSE
+ :versions: []
+ :when: 2019-09-11 13:08:28.431132000 Z
diff --git a/config/initializers/countries.rb b/config/initializers/countries.rb
new file mode 100644
index 00000000000..d65ae19852f
--- /dev/null
+++ b/config/initializers/countries.rb
@@ -0,0 +1,61 @@
+# frozen_string_literal: true
+
+ISO3166.configure do |config|
+ config.locales = [:en]
+end
+
+# GitLab permits users to sign up in Ukraine except the Crimean Region: https://about.gitlab.com/handbook/people-operations/code-of-conduct/#trade-compliance-exportimport-control
+# This overrides the display name for Ukraine to Ukraine (except Crimean Region)
+# To be removed after https://gitlab.com/gitlab-org/gitlab-ee/issues/14784 is implemented
+# Data fetched is based on https://github.com/hexorx/countries/blob/master/lib/countries/data/countries/UA.yaml
+ISO3166::Data.register(
+ continent: "Europe",
+ address_format: "|-
+ {{recipient}}
+ {{street}}
+ {{city}} {{region_short}}
+ {{postalcode}}
+ {{country}}",
+ alpha2: "UA",
+ alpha3: "UKR",
+ country_code: '380',
+ international_prefix: '810',
+ ioc: "UKR",
+ gec: "UP",
+ name: "Ukraine (except Crimean Region)",
+ national_destination_code_lengths: [2],
+ national_number_lengths: [8, 9],
+ national_prefix: '8',
+ number: '804',
+ region: "Europe",
+ subregion: "Eastern Europe",
+ world_region: "EMEA",
+ un_locode: "UA",
+ nationality: "Ukrainian",
+ vat_rates: {
+ standard: 20
+ },
+ reduced: [7],
+ super_reduced: {
+ parking: { postal_code: true }
+ },
+ unofficial_names: %w(Ukraine Ucrania ウクライナ Oekraïne Украина Україна Украіна),
+ languages_official: ["uk"],
+ languages_spoken: ["uk"],
+ geo: {
+ latitude: 48.379433,
+ latitude_dec: '48.92656326293945',
+ longitude: 31.16558,
+ longitude_dec: '31.47578239440918',
+ max_latitude: 52.37958099999999,
+ max_longitude: 40.2285809,
+ min_latitude: 44.2924,
+ min_longitude: 22.137159,
+ bounds: {
+ northeast: { lat: 52.37958099999999, lng: 40.2285809 },
+ southwest: { lat: 44.2924, lng: 22.137159 }
+ }
+ },
+ currency_code: "UAH",
+ start_of_week: "monday"
+)
diff --git a/config/routes.rb b/config/routes.rb
index a622ce268da..7d091576e8f 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -112,6 +112,7 @@ Rails.application.routes.draw do
draw :jira_connect
draw :username
draw :trial_registration
+ draw :country
end
Gitlab.ee do