From 975c0ebf9436887f4dc24943437f1457ca635ec2 Mon Sep 17 00:00:00 2001 From: AceHunterr Date: Sun, 19 Jan 2025 04:29:44 +0530 Subject: [PATCH] Fixed bugs and suggestions --- public/locales/fr/translation.json | 2 +- public/locales/hi/translation.json | 2 +- public/locales/sp/translation.json | 2 +- public/locales/zh/translation.json | 2 +- .../OrgSettings/General/OrgUpdate/ImagePicker.tsx | 14 ++++++++++---- src/components/ProfileDropdown/ProfileDropdown.tsx | 5 +---- 6 files changed, 15 insertions(+), 12 deletions(-) diff --git a/public/locales/fr/translation.json b/public/locales/fr/translation.json index a3aed39957..8a3db671c7 100644 --- a/public/locales/fr/translation.json +++ b/public/locales/fr/translation.json @@ -812,7 +812,7 @@ "title": "Paramètres", "general": "Général", "actionItemCategories": "Catégories d'éléments d'action", - "updateOrganization": "Mettre à jour l'organisation", + "updateOrganization": "Modifier l'organisation", "seeRequest": "Voir la demande", "noData": "Aucune donnée", "otherSettings": "Autres paramètres", diff --git a/public/locales/hi/translation.json b/public/locales/hi/translation.json index 3ddc482cc7..c041fba093 100644 --- a/public/locales/hi/translation.json +++ b/public/locales/hi/translation.json @@ -812,7 +812,7 @@ "title": "सेटिंग्स", "general": "सामान्य", "actionItemCategories": "कार्य आइटम श्रेणियाँ", - "updateOrganization": "संगठन अपडेट करें", + "updateOrganization": "संगठन संपादित करें", "seeRequest": "अनुरोध देखें", "noData": "कोई डेटा नहीं", "otherSettings": "अन्य सेटिंग्स", diff --git a/public/locales/sp/translation.json b/public/locales/sp/translation.json index e6b8c25519..1eb8d77f33 100644 --- a/public/locales/sp/translation.json +++ b/public/locales/sp/translation.json @@ -813,7 +813,7 @@ "title": "Configuración", "general": "General", "actionItemCategories": "Categorías de elementos de acción", - "updateOrganization": "Actualizar organización", + "updateOrganization": "Editar organización", "seeRequest": "Ver solicitud", "noData": "Sin datos", "otherSettings": "Otras configuraciones", diff --git a/public/locales/zh/translation.json b/public/locales/zh/translation.json index ebc37d5c1b..aa481de7ba 100644 --- a/public/locales/zh/translation.json +++ b/public/locales/zh/translation.json @@ -812,7 +812,7 @@ "title": "设置", "general": "一般的", "actionItemCategories": "行动项目类别", - "updateOrganization": "更新组织", + "updateOrganization": "编辑组织", "seeRequest": "查看请求", "noData": "没有数据", "otherSettings": "其他设置", diff --git a/src/components/OrgSettings/General/OrgUpdate/ImagePicker.tsx b/src/components/OrgSettings/General/OrgUpdate/ImagePicker.tsx index 8c0b9a1c6f..a577189009 100644 --- a/src/components/OrgSettings/General/OrgUpdate/ImagePicker.tsx +++ b/src/components/OrgSettings/General/OrgUpdate/ImagePicker.tsx @@ -9,6 +9,7 @@ import { FaCamera } from 'react-icons/fa'; interface InterfaceImagePickerProps { defaultImage?: string; // The default image to display in the preview. onImageSelect: (base64Image: string) => void; // Callback for when an image is selected. + defaultPlaceholderImage: string; } /** @@ -29,11 +30,16 @@ const ImagePicker: React.FC = ({ const handleImageChange = async ( e: React.ChangeEvent, ): Promise => { - const file = e.target.files && e.target.files[0]; + const file = e.target.files?.[0]; if (file) { - const base64Image = await convertToBase64(file); - setPreviewImage(base64Image); - onImageSelect(base64Image); + try { + // setIsLoading(true); + const base64Image = await convertToBase64(file); + setPreviewImage(base64Image); + onImageSelect(base64Image); + } catch (error) { + console.error('Failed to convert image:', error); + } } }; diff --git a/src/components/ProfileDropdown/ProfileDropdown.tsx b/src/components/ProfileDropdown/ProfileDropdown.tsx index 4f7568717a..98a1f94754 100644 --- a/src/components/ProfileDropdown/ProfileDropdown.tsx +++ b/src/components/ProfileDropdown/ProfileDropdown.tsx @@ -43,7 +43,6 @@ const profileDropdown = (): JSX.Element => { try { await revokeRefreshToken(); } catch (error) { - /*istanbul ignore next*/ console.error('Error revoking refresh token:', error); } localStorage.clear(); @@ -54,8 +53,7 @@ const profileDropdown = (): JSX.Element => { const fullName = `${firstName} ${lastName}`; const displayedName = fullName.length > MAX_NAME_LENGTH - ? /*istanbul ignore next*/ - fullName.substring(0, MAX_NAME_LENGTH - 3) + '...' + ? fullName.substring(0, MAX_NAME_LENGTH - 3) + '...' : fullName; return ( @@ -63,7 +61,6 @@ const profileDropdown = (): JSX.Element => {
{userImage && userImage !== 'null' ? ( - /*istanbul ignore next*/