Closed srenault-meeds closed 9 months ago
When updating my name, then the avatar is updated accordingly
What if I change my avatar (to not use letter), then change my name ? Can you confirm that my avatar should not change ?
When updating my name, then the avatar is updated accordingly
What if I change my avatar (to not use letter), then change my name ? Can you confirm that my avatar should not change ?
Yes, of course
Go fonc
Ready for tech spec writing
Ready for tech review by DAO members ( eXo : @rdenarie )
Go tech
FYI, we have suggested to use a color palet instead of the colors from the branding. Indeed, using colors from branding means that:
So to avoid this, we will use a unique color palet of 15 colors.
Updated title of this MIP to be more descriptive because in the end, the solution is to generate avatar images using initials of the user or the space name.
PRs and ACCs ready for review ( eXo : @rdenarie )
Ok for me, you can process to merge. Thank you
Rationale
Default avatars used for space and user are outdated. It proposes something like a default icon which is not accurate with what other platform can propose to users.
1. Functional Requirements
Top User Stories
When logging in the first time, my avatar is set as followed: a. round avatar with no border, and background color randomly chosen from a color palet of 15 colors b. initials uppercase (white) and 2 letters max
When updating my name AND the default avatar is still on, then the avatar is updated accordingly
Example:
When creating a space, the avatar is set as followed: a. square avatar with no border, and background color randomly chosen from the same color palet of 15 colors b. initials uppercase (white) and 2 letters max chosen among 2 first words of the space name
When updating the name of the space, then the avatar is updated accordingly
Example:
Impacts
Gamification
Notifications
Analytics
Unified Search
2. Technical Requirements
Expected Volume & Performance
No special change for the stored information. The new avatar should be stored the same way as when a user uploads his own avatar.
Configurability
The branding colors list has to be provided and modifiable using properties.
Upgradability
This shouldn't be applied to old empty avatars, thus no upgrade plugin is necessary.
Feature Flags
No Feature Flag is needed.
3. Software Architecture
Access
Services & processing
In order to make the default avatar generally applied including email notifications, the default avatar should be an image rather than a Vue component which displays initials when the avatar is a default one. To be able to generate images, we will use regular Java AWT package to generate the avatar. The avatar generation has to happen in storage layer to make sure that retrieving the default data is centralized and concurrently secured. Thus, the method
RDBMSIdentityStorageImpl#getAvatarFile
has to be implemented inCachedIdentityStorage#getAvatarFile
using aFutureCache
which returns aFileItem
. The default cache size should be small (500) with a small live time (300 seconds).The business logic of
RDBMSIdentityStorageImpl#getAvatarFile
has to be implemented this way:The default avatar generation process shouldn't trigger the listener of avatars update since it's a placeholder file generation and no action was made by users to attach avatars. Consequently, the gamification and analytics listeners shouldn't be triggered.
When a user or a space is renamed, if the identity has a default avatar, then a new default avatar has to be generated. In order to be able to know whether the attached avatar to a space or a user is a default generated one, a special
FileItem#FileInfo#name
has to be used with nameDEFAULT_AVATAR
. This information has to be added in Profile DTOprivate boolean defaultAvatar
. The avatar update process must not trigger any listener as for default avatar creation since it's a placeholder, thus this update has to operate in Storage layer by simply deleting the associatedFileItem
and let the above described generation flow happens when retrieving the Space/User identity profile.hint: In order to make the renaming detection easy to do, the
SpaceIdentityProvider#populateProfile
has to change in order to mapProfile.FULL_NAME
withSpace#displayName
as made inOrganizationIdentityProvider#populateProfile
, so that we can compare theDisplayName
and detect if we need to update the generated avatar or not (we may need to updateRDBMSSpaceStorageImpl#renameSpace
to add this mapping as well).In term of UI, when the user provides a new name, it should refresh to display the new avatar without requesting to refresh the page.