PublicDataWorks / complaint-manager

Apache License 2.0
5 stars 0 forks source link

Inconsistent initials reflected in in system #552

Open rnair-tw opened 7 months ago

rnair-tw commented 7 months ago

Describe the bug

We had user feedback from Hawaii that initials in the system were not standardized (sometimes first/last name, sometimes first 2 letters of first name). After doing a spike (#534), we determined that the initials are coming from the user's email which we get from Okta. We take the Okta email (called "nickname") and parse out the first two letters of the email and display those as the initials. In order to fix this, we will need to look into Okta dashboard and and set up a method to retrieve first and last name and adjust our Okta API call in the app to retrieve this data.

Steps to reproduce

List any steps to reproduce behavior

  1. Go to all cases page
  2. Look at the assigned to column
  3. You will see a mix of first/last name and first 2 letters of first name reflected in the initials

Expected behavior

The initials should always be first and last name.

Checklist

Additional context Add any other context or screenshots about the feature request here.

faraakhatTW commented 7 months ago

Image

I was able to find list of users that being used as assignees. As we can see there is some names are given only as first name and and some has first and last names. But this might be inconsistent with what we have in CI, therefore need look into CI env and see if they are match, if no. I will be looking into userService.jsin okta folder where we are getting list of users from Okta API. In theory I don't think we need to go to Okta Dashboard and implement new API call, since there is one already in codebase that requests list of all users and with user info.

faraakhatTW commented 6 months ago

I was able to fetch list of users from Okta API, and implement the solution for Hawaii Org. Currently I have failing tests that needs to be fixed and test it after in Hawaii CI after pipeline is green

Image

faraakhatTW commented 6 months ago

Me and @arihu1008 Fixed couple failing tests. Currently have 1 client and 1 pact test to fix. We might need set of eyes to see why caseDashboard.test.js have failing test, since we have no code changes in there.

faraakhatTW commented 6 months ago

CI enviorement for HAWAII ORG is showing initials correct as intended

Image

faraakhatTW commented 6 months ago

After looking into a codebase I find out that we possibly need adjust code on userService.js for Okta in okta folder in complaint manager. Add users middle name from OktaApi call.

Image

thoughtworks-vwong commented 6 months ago

In NOIPM, when a user with an email as their name is assigned, the bubble will only display the first letter of their name in a lowercase.

Expected Result: Assignees names should not be be grabbed from email, but grabbed from FullName properties. In the case if in the list of full names people have no last name (e.g. Fara), it should show capitalized initial F.

Screenshot 2024-05-24 at 11 19 26 AM Screenshot 2024-05-24 at 11 19 20 AM
aparker-tw commented 6 months ago

On the Hawaii env, logging in through Okta, the "Assigned To" user's full name is displayed including middle name/initial if present, and the user's initial bubble only displays their first and last initials regardless of if the user has a middle name:

Image Image

However, on the NO environment, logging in through Auth0, the field that should display the full name of the user in the "Assigned To" field may display only the user's email address. In these cases, the initial bubble displays only the first letter of their email address.

thoughtworks-vwong commented 5 months ago

Verified issue is fixed.

Hawaii

https://github.com/PublicDataWorks/complaint-manager/assets/134408135/e10ffe83-6aae-4ad0-ab3f-a1b1087d330d

NOIPM

https://github.com/PublicDataWorks/complaint-manager/assets/134408135/88d3b7ab-86c1-4b97-a4a3-bb75284eb69e