Skip to content
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

feat: added country disabling feature #1116

Merged
merged 2 commits into from
Sep 17, 2024
Merged

Conversation

awais-ansari
Copy link
Contributor

@awais-ansari awais-ansari commented Sep 13, 2024

INF-1567

Description

  • Countries in the disabledCountries list will no longer be visible to users in the account settings of other countries, and users will not be able to switch to disabled countries.
  • User with a disabled country selected can change their country to another one. After switching, they cannot select the disabled country again.
  • Implemented frontend validation to verify the country against the disabled countries list to prevent invalid country submissions.

For Example, if Russia is on the disabled countries list.

Other Country Users will not see Russia in the country list as an

Screenshot 2024-09-14 at 2 10 05 PM Screenshot 2024-09-14 at 2 07 52 PM

Russian user will see Russia in the country list but it'll be disabled and they can change their country to another one.

Screenshot 2024-09-14 at 2 09 07 PM Screenshot 2024-09-14 at 2 09 30 PM

Note

  • The disabledCountries list will be fetched from an API in phase 2 implementation.

Copy link

codecov bot commented Sep 13, 2024

Codecov Report

Attention: Patch coverage is 76.47059% with 4 lines in your changes missing coverage. Please review.

Project coverage is 58.70%. Comparing base (752d760) to head (d6a23e1).
Report is 1 commits behind head on 2u-main.

Files with missing lines Patch % Lines
src/account-settings/AccountSettingsPage.jsx 73.33% 4 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           2u-main    #1116      +/-   ##
===========================================
+ Coverage    58.61%   58.70%   +0.09%     
===========================================
  Files          117      117              
  Lines         2317     2332      +15     
  Branches       641      645       +4     
===========================================
+ Hits          1358     1369      +11     
- Misses         898      902       +4     
  Partials        61       61              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

}

return countryList.filter(({ value }) => {
const isDisabled = this.isDisabledCountry(value);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no need to recalculate isDisabled here since we are already receiving disabled as a parameter in the countryList. as countryList.filter(({ value , disabled})

@awais-ansari awais-ansari merged commit ee03931 into 2u-main Sep 17, 2024
11 checks passed
@awais-ansari awais-ansari deleted the aansari/INF-1567 branch September 17, 2024 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants