kibana/packages/shared-ux/avatar
Christos Nasikas 72050720b2
[Cases] Fix bug where the Cases users API will thrown an error when imageUrl is set to null (#158815)
## Summary

As part of the Serverless work in
https://github.com/elastic/kibana/issues/153726, we validate all of our
responses returned by the Cases APIs. The GET case users internal API
validates the schema of the `avatar` persisted in the `data` of the user
profile. It may be possible to set the `imageUrl` to `null` from within
the user profile page. This PR fixes this bug. It also updates the type
of the `imageUrl` in `UserProfileAvatarData`.

## Testing

1. Go to your user profile and press save
2. Go to a case
3. You should see an error toaster. The fix in this RP should eliminate
the error toaster and the Case view page should be shown properly
4. Go to your user profile and change the initials the color and set a
profile image. Go again to a case and verify that the avatar is shown as
expected


### Checklist

Delete any items that are not applicable to this PR.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

### For maintainers

- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
2023-06-02 01:09:16 -07:00
..
solution [codeowners] rename global experience to @elastic/appex-sharedux 2023-01-18 10:02:49 -07:00
user_profile/impl [Cases] Fix bug where the Cases users API will thrown an error when imageUrl is set to null (#158815) 2023-06-02 01:09:16 -07:00