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

  1. Create MR based on proposed solution
  2. Write Test
  3. Review the changes.

Issue fork webform-3280274

Command icon 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

Shriaas created an issue. See original summary.

shriaas’s picture

Issue summary: View changes

shriaas’s picture

Issue summary: View changes
Status: Active » Needs review
cilefen’s picture

Version: 6.1.3 » 6.1.x-dev
Status: Needs review » Needs work
shriaas’s picture

Status: Needs work » Needs review
paulocs’s picture

Working on the review of this issue.

paulocs’s picture

I 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.

Johnny Santos’s picture

Assigned: Unassigned » Johnny Santos

Going for the review.

Johnny Santos’s picture

Assigned: Johnny Santos » Unassigned
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new21.42 KB
new31.66 KB

Reviewed and Its works as intended by the reporter.
Adding screenshots

jrockowitz’s picture

jrockowitz’s picture

Status: Reviewed & tested by the community » Needs work
lucasbaralm’s picture

Assigned: Unassigned » lucasbaralm

I will work on this.

jrockowitz’s picture

Status: Needs work » Closed (won't fix)

I am inclined to suggest this improvement be implemented using custom code or a dedicated contributed module.