diff --git a/frontend/src/components/Modals/EditProfile.vue b/frontend/src/components/Modals/EditProfile.vue index e1c993b9..d38ad699 100644 --- a/frontend/src/components/Modals/EditProfile.vue +++ b/frontend/src/components/Modals/EditProfile.vue @@ -37,10 +37,12 @@ @@ -141,7 +143,25 @@ const updateProfile = createResource({ }, }) +const validateMandatoryFields = () => { + let missingFields = [] + if (!profile.first_name) missingFields.push(__('First Name')) + if (!profile.last_name) missingFields.push(__('Last Name')) + if (!profile.image) missingFields.push(__('Profile Image')) + if (missingFields.length) { + toast.error( + __('Please fill the mandatory fields: {0}').format( + missingFields.join(', ') + ) + ) + console.error('Missing mandatory fields:', missingFields) + } + return missingFields.length +} + const saveProfile = () => { + let missingMandatoryFields = validateMandatoryFields() + if (missingMandatoryFields) return profile.bio = sanitizeHTML(profile.bio) updateProfile.submit( {}, diff --git a/frontend/src/components/Sidebar/AppSidebar.vue b/frontend/src/components/Sidebar/AppSidebar.vue index 6b103138..85aa547c 100644 --- a/frontend/src/components/Sidebar/AppSidebar.vue +++ b/frontend/src/components/Sidebar/AppSidebar.vue @@ -40,7 +40,7 @@ class="flex items-center text-sm text-ink-gray-5 my-1" > - @@ -90,6 +90,36 @@ ) }} +
+
+
+ +
+ {{ __('Complete your profile') }} +
+
+
+ {{ __('Highlight what makes you unique and show your skills.') }} +
+
+ + + +