Problem/Motivation
Currently, international mode in Telephone provides support to select preferred countries which will be displayed at the top of list but in many cases the user may need to show just few countries in the list, the JS library already has options excludeCountries
and onlyCountries to support this, just need to add options in UI to configure this.
Steps to reproduce
none
Proposed resolution
Add a field Excluded countries where user can enter which countries to hide, and a checkbox Negate this condition which will negate the exclude condition and only show countries which user has specified in the Excluded countries field.
Remaining tasks
Create MR based on proposed solution- Write Test
- Review the changes.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | viewing.png | 31.66 KB | Johnny Santos |
| #10 | Building preferences.png | 21.42 KB | Johnny Santos |
Issue fork webform-3280274
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
shriaasComment #4
shriaasComment #5
cilefen commentedComment #6
shriaasComment #7
paulocsWorking on the review of this issue.
Comment #8
paulocsI found a bug when accessing the webform when the negate option is never set.
Notice: Undefined index: #negate_exclude in Drupal\webform\Plugin\WebformElement\Telephone->prepare() (line 106 of modules/contrib/webform/src/Plugin/WebformElement/Telephone.php).I update the code to fix the bug, added the new two fields in a field set and fixed an error in a label.
Comment #9
Johnny Santos commentedGoing for the review.
Comment #10
Johnny Santos commentedReviewed and Its works as intended by the reporter.
Adding screenshots
Comment #11
cilefen commentedComment #12
jrockowitz commentedI think this PR should implement #3283192: Use CountryManager::getList() instead of ::getStandardList().
Comment #13
jrockowitz commentedComment #14
lucasbaralmI will work on this.
Comment #15
jrockowitz commentedI am inclined to suggest this improvement be implemented using custom code or a dedicated contributed module.