platformplatform / PlatformPlatform

Alpha state. A platform designed for building enterprise-grade, multi-tenant products using Azure, .NET, React, TypeScript, Infrastructure as Code, etc.
https://platformplatform.github.io
MIT License
253 stars 26 forks source link

Add support for changing and uploading avatars #617

Closed tjementum closed 2 weeks ago

tjementum commented 2 weeks ago

Summary & Motivation

Introduce functionality allowing users to change their avatars, with an option to upload a new avatar when saving their User Profile. Supported formats include JPEG, PNG, GIF, and WebP, providing users with flexibility in avatar choices.

Address several issues with Gravatar handling: users without Gravatars now correctly avoid default Gravatar images, and the system gracefully handles timeouts when fetching Gravatars, returning a Not Found status if an image is missing. Additionally, the user profile no longer displays a broken image for users without an avatar.

The recently introduced GravatarClient has been decoupled from the Users feature, enabling more modular use across the application.

To streamline avatar uploads, a strongly-typed api.uploadFile method has been implemented, enhancing type safety and usability.

Lastly, an issue in RepositoryBase.Update has been fixed to prevent unnecessary entity fetching during updates, improving efficiency.

Checklist

linear[bot] commented 2 weeks ago

PP-238 Enable avatar change on user profile

sonarcloud[bot] commented 2 weeks ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
1 Accepted issue

Measures
0 Security Hotspots
11.8% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

raix commented 3 days ago

@tjementum any reason for not using a regular multipart form?

raix commented 3 days ago

Example: https://github.com/tinytek-io/PlatformPlatform/blob/typescript/application/account-management/WebApp/shared/components/userModals/UserProfileModal.tsx#L45