pebble icon indicating copy to clipboard operation
pebble copied to clipboard

passing country as prop instead of countryCode as it is not unique

Open appy9 opened this issue 3 years ago • 3 comments

country code is not a unique key that can be passed, so updating the component to pass country

Issue Usecase: UK vs Jersey

 {
    id: 121,
    name: "United Kingdom",
    url_name: "gb",
    country_code: "+44",
    operational: true,
    zones: ["Europe/London"]
 },
 {
    id: 57,
    name: "Jersey",
    url_name: "je",
    country_code: "+44",
    operational: false,
    zones: ["Europe/London"]
 }

https://deploy-preview-403--pensive-johnson-e2d194.netlify.app/?path=/story/components-phonenumberinput--material

appy9 avatar Jan 30 '22 06:01 appy9

✔️ Deploy Preview for pensive-johnson-e2d194 ready!

🔨 Explore the source changes: 74506c0c4779adb2bad4e2f6a4b71a4519b81d37

🔍 Inspect the deploy log: https://app.netlify.com/sites/pensive-johnson-e2d194/deploys/61f6325779334700078a5de1

😎 Browse the preview: https://deploy-preview-403--pensive-johnson-e2d194.netlify.app

netlify[bot] avatar Jan 30 '22 06:01 netlify[bot]

Codecov Report

Merging #403 (74506c0) into master (6662ecf) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #403   +/-   ##
=======================================
  Coverage   83.25%   83.25%           
=======================================
  Files          84       84           
  Lines        1362     1362           
  Branches      270      263    -7     
=======================================
  Hits         1134     1134           
- Misses        193      194    +1     
+ Partials       35       34    -1     
Impacted Files Coverage Δ
...ges/pebble-web/src/components/PhoneNumberInput.tsx 95.00% <100.00%> (ø)
packages/pebble-web/src/components/Toast.tsx 91.66% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 6662ecf...74506c0. Read the comment docs.

codecov[bot] avatar Jan 30 '22 06:01 codecov[bot]

this change wont be backwards compatible and require massive rewrites in consumer code

without this change we are not able to identify UK numbers from Jersey. Also, we can't correctly validate UK numbers because Jersey gets selected. The original component is actually wrong in returning just the country code.

appy9 avatar Jan 30 '22 06:01 appy9