-
Notifications
You must be signed in to change notification settings - Fork 19
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
Feature/ID-4218 #660
Feature/ID-4218 #660
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
js/components/address.js
Outdated
value = !value; | ||
} | ||
|
||
var fields = this.$parent.fields; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@armine-fliplet, please avoid using var
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dwfliplet Done
js/components/address.js
Outdated
await this.addressField.getAutocompleteSuggestions(input, countryRestrictions) | ||
.then(suggestions => { | ||
if (typeof this.value === 'object') { | ||
this.addressSuggestions = []; | ||
this.suggestionSelected = true; | ||
} else { | ||
this.addressSuggestions = suggestions; | ||
} | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@armine-fliplet, you should never combine await
with then
.
await this.addressField.getAutocompleteSuggestions(input, countryRestrictions) | |
.then(suggestions => { | |
if (typeof this.value === 'object') { | |
this.addressSuggestions = []; | |
this.suggestionSelected = true; | |
} else { | |
this.addressSuggestions = suggestions; | |
} | |
}); | |
const suggestions = await this.addressField.getAutocompleteSuggestions(input, countryRestrictions); | |
if (typeof this.value === 'object') { | |
this.addressSuggestions = []; | |
this.suggestionSelected = true; | |
} else { | |
this.addressSuggestions = suggestions; | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dwfliplet Done
js/libs/core.js
Outdated
var $vm = this; | ||
var countries; | ||
|
||
fetch('https://restcountries.com/v3.1/all').then(function(response) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@armine-fliplet, what's that? Why do we create some third-party dependency here? The list of countries doesn't change that often. Especially since we use only part of the info. Please extract the needed data into a separate file, and store it inside the project.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dwfliplet Are you suggesting we keep the data static, or should we get it from the API and keep in a separate file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@armine-fliplet to keep data static, but it can be kept in separate file, or even fetched from json file but hosted on our side
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
81fb93f
into
projects/ID-4110-address-field
Product areas affected
Form Builder, Address Field
What does this PR do?
Integrates Address field type and settings
JIRA ticket
ID-4218