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

Suggestion: Rename WhatsApp number to Alternative number #3184

Merged
merged 7 commits into from
Aug 11, 2022

Conversation

Ashesh3
Copy link
Member

@Ashesh3 Ashesh3 commented Jul 21, 2022

The secondary phone number for a user is referenced as "Alternative number" throughout the code and also in the users filter.

image

<PhoneNumberField
    name="altPhoneNumber"
...
    value={states.form.altPhoneNumber}
    onChange={(value: string) =>
        handleAlternativeNumChange(value, "altPhoneNumber")
    }
    errors={states.errors.altPhoneNumber}
 />

In order to make it more user friendly and consistent, WhatsApp number should be labelled as "Alternative number" instead.
image

@Ashesh3 Ashesh3 requested a review from a team July 21, 2022 21:38
@Ashesh3 Ashesh3 requested a review from a team as a code owner July 21, 2022 21:38
@Ashesh3 Ashesh3 requested a review from giju July 21, 2022 21:38
@netlify
Copy link

netlify bot commented Jul 21, 2022

Deploy Preview for care-egov-staging ready!

Name Link
🔨 Latest commit 7d37469
🔍 Latest deploy log https://app.netlify.com/sites/care-egov-staging/deploys/62efbd6aae07b40009a41821
😎 Deploy Preview https://deploy-preview-3184--care-egov-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@developedBySJ
Copy link
Contributor

@Ashesh3 can you mention the issue?
Alternative numbers and WhatsApp numbers are two different things.

@Ashesh3
Copy link
Member Author

Ashesh3 commented Jul 22, 2022

@Ashesh3 can you mention the issue? Alternative numbers and WhatsApp numbers are two different things.

They appear to be the same thing.

We can set WhatsApp number on the profile page, but in the users page, the filter lists it as "Alternative number" and filtering works displaying it as alt number

image
image

But the profile page shows it as "WhatsApp" number.
image

The frontend is inconsistent with how the data is stored and represented in the backend. Everywhere, the "second number" is referenced by "Alternative number" and not "WhatsApp number".

https://github.com/coronasafe/care/blob/master/care/users/models.py#L216

class User(AbstractUser):
    ...
    alt_phone_number = models.CharField

The filter displays it as "Alternative number" too
image

Updating the said "WhatsApp number" actually sends it as the alternative number:
image

https://github.com/coronasafe/care_fe/blob/develop/src/Components/Users/UserProfile.tsx#L491

<PhoneNumberField
    --> name="altPhoneNumber"
        label="Whatsapp Number"
    --> value={states.form.altPhoneNumber}
        onChange={ (value: string) =>
    -->     handleWhatsappNumChange(value, "altPhoneNumber")
        }
    errors={states.errors.altPhoneNumber}
/>

The UserModel only lists the second number as alt_phone_number, I do not see a distinction between "WhatsApp" and "Alternative" number here, the second number is always mentioned as the Alternative.

https://github.com/coronasafe/care_fe/blob/develop/src/Components/Users/models.tsx#L12

export interface UserModel {
  ...
  phone_number?: string;
  alt_phone_number?: string;
  ...

So, it appears that "WhatsApp number" is actually just the "Alternative number" but mislabeled.

@nihal467
Copy link
Member

@Ashesh3 once work is completed, change the badge

@Ashesh3
Copy link
Member Author

Ashesh3 commented Jul 26, 2022

@coronasafe/care-fe-code-reviewers Need your opinion here.

@Ashesh3
Copy link
Member Author

Ashesh3 commented Jul 28, 2022

Todo: After discussing this with @gigincg , The change would be to rename "Alternative number" on the filter page to "WhatsApp number"

@Ashesh3
Copy link
Member Author

Ashesh3 commented Aug 6, 2022

Renamed Alt phone to WhatsApp phone on the filters page, to maintain consistency.

image

@nihal467
Copy link
Member

nihal467 commented Aug 7, 2022

@Ashesh3
image

the badge still says, it is alternative number , where everywhere else it is WhatsApp no

@sonarcloud
Copy link

sonarcloud bot commented Aug 7, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.5% 0.5% Duplication

@Ashesh3
Copy link
Member Author

Ashesh3 commented Aug 7, 2022

@nihal467 Fixed!

image

@nihal467
Copy link
Member

nihal467 commented Aug 7, 2022

test approved

@khavinshankar khavinshankar merged commit 77360b3 into ohcnetwork:develop Aug 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants