Content creator - profile picture functionality added #143
Content creator - profile picture functionality added #143RasmusJensen1 wants to merge 115 commits intodevfrom
Conversation
* start * save * fixed * fix
+ more
…w category (#31) * multiselect new entries can now add new entries in multiselects with a popup modal and error messages * translation, button fix, course info multiselect * Fix categories load, category creation. Clean error & loading states * Translation fix * feat: (web) file upload to course (#29) * start * save * fixed * fix --------- Co-authored-by: Alfred <47451379+Alfenstein8@users.noreply.github.com> Co-authored-by: Smidtty <148750415+Smidtty@users.noreply.github.com> Co-authored-by: Albert <148211219+Alb9ert@users.noreply.github.com>
Design changes
* Add useAuth hook, sync with language and preferences for usePaginatedData. * Update web/src/shared/hooks/use-local-storage.ts Co-authored-by: Albert <148211219+Alb9ert@users.noreply.github.com> * Update web/src/shared/hooks/use-isomorphic-layout-effect.tsx Co-authored-by: Albert <148211219+Alb9ert@users.noreply.github.com> * Update web/src/shared/hooks/use-event-callback.tsx Co-authored-by: Albert <148211219+Alb9ert@users.noreply.github.com> --------- Co-authored-by: Alfred <47451379+Alfenstein8@users.noreply.github.com> Co-authored-by: Albert <148211219+Alb9ert@users.noreply.github.com>
Added translation to rest of the english words
Fix(Web): Course editor menu visuals
* start * save * fixed * fix
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 7.1.9 to 7.1.11. - [Release notes](https://github.com/vitejs/vite/releases) - [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md) - [Commits](https://github.com/vitejs/vite/commits/v7.1.11/packages/vite) --- updated-dependencies: - dependency-name: vite dependency-version: 7.1.11 dependency-type: direct:development ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…59) * Turborepo, npm scripts & docker * Docs * Update contributions docs * Forgot to add Web to compose. Fix build errors too. * Add and update docker docs. * Check Workflow fix * Experiment: Summary * Test summary as comment * Error handling * Add permissions to workflow, to post message * Update to reflect PR comment
* Fix npm not installing
* Changed notification dropdown to use shadcn popover * Changed notification toast to use the shadcn toast * Update course-editor-review.tsx * Removed toasts from notifications * Update course-editor-review.tsx * Added translations * Fixed imports --------- Co-authored-by: DandingB <daniel@Daniels-MBP-2.home> Co-authored-by: DandingB <daniel@Daniels-MacBook-Pro-2.local>
Updated the Content Creator schema and related OpenAPI and TypeScript definitions to require the lastName field. This ensures lastName is mandatory for content creator entities and improves validation consistency across the API and documentation.
* Wrote in the controller so that it can populate * update inorder to populate so we can find subscribed courses * Auto enable policies * Removing manual populate * Update documentation * Updated to return pagination on the find * Updated bootstrapi function --------- Co-authored-by: PhilipShaffer <152175307+PhilipShaffer@users.noreply.github.com> Co-authored-by: Jakob Rossander Kristensen <jakobrk@gmail.com> Co-authored-by: Jakob Rossander Kristensen <152175219+Jakobrk@users.noreply.github.com>
* removed hero-icons and react-icons * exchanged lucide icons with mdi
Profile picture for content creator - Upload - Replace - Delete
|
Co contributor: @OliverKjaer |
🔴 Code Quality Report✅ Required ChecksAll required checks passed ✓ - This PR can be merged! 📊 Codebase Quality Metrics (Advisory)🔍 Lint & Format
🔤 Type Check
🧪 Tests
🏗️ Build
💡 Note: These metrics show the entire codebase health and won't block merging. Only changed files are required to pass checks. 📈 Track these numbers over time to see progress on technical debt! |
JessicaTegner
left a comment
There was a problem hiding this comment.
Over all looks good. Clean changes, easy to follow. Added a few comments.
| `http://localhost:8888/api/bucket/${formData.photo}`, | ||
| ); | ||
|
|
||
| // Helper get correct image URL |
There was a problem hiding this comment.
why is this doing what it's doing?
There was a problem hiding this comment.
Im not sure what if you mean why there is a comment or you mean the code
But i have fixed the comment to better explain it:
// Helper function to construct the full image URL from Strapi
// Handles both absolute URLs (starting with http) and relative URLs from Strapi
Please let me know if that explains it or else please reach back and i will fix it ⚡
|
Looks good @RasmusJensen1 . There is however a bunch of image components and utilities pending in #124 which would be nice to reuse in this as well. EDIT2: Added docs Media Docs as also suggested by @HasnainAliprogramming in PR review. EDIT: If you want to use my code, one way to do that would be for you to rebase on top of my branch, and then rebase later on dev. Then you could get access to my shared functions before the PR merges. # Your actions:
git checkout us-0092-update-profile-picture-content-creator
git rebase web/media
# Refactor to use shared functions etc. etc..
# Commit the changes
git add .
git commit -m "Use functions from web/media branch"
git push --force-with-lease # Because we rewrite historyThen, when #124 gets merged, you simply do: # rebase onto the updated dev:
git checkout us-0092-update-profile-picture-content-creator
git fetch origin
git rebase origin/dev
git push --force-with-lease # Because we rewrite historyGit will recognize that the commits from the web/media branch are already in dev and automatically skip them during the rebase. Then your branch should only contain the unique commits on top of dev. Hopefully. |
I think this would make more sense to make a follow op/succesor task for due to time constraints of the merge tomorrow I hope that is ok or else let me know ⚡ |
…or content creator
EmilLykke
left a comment
There was a problem hiding this comment.
When you have merged dev into you branch and resolved merge conflicts then I will approve
…e component - Cleaned up merge conflict markers in course-columns.tsx. - Updated useFileUpload hook to return an array of UploadedFile objects instead of UploadPostResponses. - Enhanced file upload logic to handle both single objects and arrays in useFileUpload. - Modified Profile component to use the updated useFileUpload hook. - Improved buildUpdatePayload function to validate statusValue and handle optional fields. - Added detailed logging for debugging during profile updates and file uploads. - Ensured proper error handling and user feedback for profile picture uploads.
|
| // Disable unified-signatures rule due to crashes in @typescript-eslint/eslint-plugin | ||
| "@typescript-eslint/unified-signatures": "off", | ||
| // Prevents bugs from using "truthy" or "falsy" values in conditions. | ||
| "@typescript-eslint/strict-boolean-expressions": [ |
|
|
||
| // eslint-disable-next-line sonarjs/class-name, @typescript-eslint/naming-convention | ||
| interface useFileUploadReturn { | ||
| uploadFile: (files: FileWithMetadata[]) => Promise<UploadPostResponses[200] | undefined>; |
There was a problem hiding this comment.
This type is driven by the openapi spec. Why define and maintain it manually?
|
|
||
| // Helper function to construct the full image URL from Strapi | ||
| // Handles both absolute URLs (starting with http) and relative URLs from Strapi | ||
| const getImageUrl = (url: string | undefined): string => { |
| return; | ||
| } | ||
|
|
||
| console.log("Form data before submit:", formData); |
| const firstName = nameParts[0] || ""; | ||
| const lastName = nameParts.slice(1).join(" "); | ||
|
|
||
| console.log("Name parts:", { firstName, lastName }); |
| if (error instanceof Error) { | ||
| toast.error(`Erro ao fazer upload da foto de perfil: ${error.message}`); | ||
| } else { | ||
| toast.error("Erro ao fazer upload da foto de perfil"); |
| try { | ||
| const documentId = localStorage.getItem("id"); | ||
| if (!documentId) { | ||
| toast.error("Erro: ID do usuário não encontrado"); |
| const profilePictureId = contentCreatorData?.profilePicture?.id; | ||
| if (!profilePictureId) { | ||
| if (showToast) { | ||
| toast.info("Nenhuma foto de perfil para deletar"); |
| }); | ||
|
|
||
| if (showToast) { | ||
| toast.success("Foto de perfil deletada com sucesso!"); |
| } catch (error) { | ||
| console.error("Error deleting profile picture:", error); | ||
| if (showToast) { | ||
| toast.error("Erro ao deletar foto de perfil"); |




Descrption
Added profile picture upload, update, and delete functionality for content creators.
Summary of Changes
Backend Manual Changes
schema.jsonprofilePictureFrontend Manual Changes
Profile.tsxAdded
handleProfilePictureUpload()Added
handleProfilePictureDelete()Integrated React Query for caching + automatic refetching
Updated API calls to include the profile picture field
PersonalInformation.tsxDisplays profile picture or fallback initials
Added UI actions:
Implemented
getImageUrl()Auto-Generated Files (Strapi)
These files are generated automatically and may include diffs unrelated to functional changes due to it being autogenerated.
strapi-spec.jsoncontentTypes.d.tstypes.gen.tssdk.gen.tszod.gen.tsGenerated by:
npm run generate-strapi-clientIncludes:
Acceptence criteria
Please make sure to test the functionality when reviewing, and if there is any questions that makes more sense to take over a Discord call, don't hesitate to give us a call ⚡
A front-end successor PBI will be made so it matches the Figma.
Co contributor: @OliverKjaer