Tradeshift / tradeshift-ui

The Tradeshift UI Library & Framework
https://ui.tradeshift.com
Other
33 stars 45 forks source link

[UserImage] UserImage shows the wrong initial letters #231

Closed gogozby closed 7 years ago

gogozby commented 7 years ago

Bug report

bug description: When using UserImage, if the first name and the last name contain more than one part, for instance, full name is "First Name(first name) Last Name(last name)", the initial letters shown on the image icon would be "FN", which is expected to be "FL".

Tradeshift UI version affected

v7.1.0

Expected Behavior

The initial letters are FL.

Actual Behavior

The initial letters are FN.

Steps to reproduce

Use the full name "First Name(first name) Last Name(last name)"

Screenshots (optional)

screen shot 2017-03-16 at 14 56 12

It seems the proper way to tackle this is to change the params passed in with two part, first name and last name, instead of accepting the full name. Here is the related code line: https://github.com/Tradeshift/tradeshift-ui/blob/master/src/runtime/js/ts.ui/core/core-gui@tradeshift.com/spirits/images/ts.ui.ImageSpirit.js#L68

Thanks a lot.

sampi commented 7 years ago

This could be solved by us getting the first name and last name separately. Although that will raise the question that who should decide the order of the names, so we'd probably have to maintain the database / country or language to flip the names or not. Another solution would be to just ask what we should display in there and what we should have as the alt tag. We'll figure out what to do soon.