Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
scratch-www
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
scratch-www
Commits
70d81b85
Commit
70d81b85
authored
Nov 05, 2019
by
Ben Wheeler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
made separate functions for country options with name, code
parent
2182853d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
src/lib/country-data.js
src/lib/country-data.js
+5
-2
No files found.
src/lib/country-data.js
View file @
70d81b85
...
...
@@ -1059,7 +1059,7 @@ const dupeCommonCountries = module.exports.dupeCommonCountries = (startingCountr
};
/*
* registrationCountryOptions is the result of taking the standard countryInfo,
* registrationCountry
Name
Options is the result of taking the standard countryInfo,
* setting a 'value' key and a 'label' key both to the country data's 'name' value,
* but using the 'display' value for 'label' instead of 'name' if 'display' exists;
* then duplicating 'United States of America' and 'United Kingdom' at the top of the list.
...
...
@@ -1077,8 +1077,11 @@ const dupeCommonCountries = module.exports.dupeCommonCountries = (startingCountr
* {value: 'Zimbabwe', label: 'Zimbabwe'}
* ]
*/
module
.
exports
.
registrationCountryOptions
=
module
.
exports
.
registrationCountry
Name
Options
=
countryOptions
(
dupeCommonCountries
(
countryInfo
,
[
'
us
'
,
'
gb
'
]),
'
name
'
);
// use country code for value, instead of country name:
module
.
exports
.
registrationCountryCodeOptions
=
countryOptions
(
dupeCommonCountries
(
countryInfo
,
[
'
us
'
,
'
gb
'
]),
'
code
'
);
/* subdivisionOptions uses iso-3166 data to produce an array like:
* [
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment