diff --git a/public/locales/en/common.json b/public/locales/en/common.json
index 240dc115f61..3968b850d7b 100644
--- a/public/locales/en/common.json
+++ b/public/locales/en/common.json
@@ -82,6 +82,7 @@
"updatedSuccessfully": "{{item}} updated Successfully",
"removedSuccessfully": "{{item}} removed Successfully",
"successfullyUpdated": "Successfully Updated",
+ "confirm": "Confirm",
"sessionWarning": "Your session will expire soon due to inactivity. Please interact with the page to extend your session.",
"sessionLogOut": "Your session has expired due to inactivity. Please log in again to continue.",
"sort": "Sort"
diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json
index cba39a3b721..d84646d7884 100644
--- a/public/locales/en/translation.json
+++ b/public/locales/en/translation.json
@@ -213,7 +213,8 @@
"roleUpdated": "Role Updated.",
"joinNow": "Join Now",
"visit": "Visit",
- "withdraw": "Widthdraw",
+ "leave": "Leave",
+ "withdraw": "Withdraw",
"removeUserFrom": "Remove User from {{org}}",
"removeConfirmation": "Are you sure you want to remove '{{name}}' from organization '{{org}}'?",
"searchByName": "searchByName",
@@ -982,6 +983,7 @@
"logout": "Logout",
"settings": "Settings",
"chat": "Chat",
+ "leave": "Leave Organization",
"menu": "menu"
},
"organizationSidebar": {
@@ -1205,7 +1207,8 @@
"deleteCategory": "Delete Category",
"deleteCategoryMsg": "Are you sure you want to delete this Action Item Category?",
"createButton": "createButton",
- "editButton": "editButton"
+ "editButton": "editButton",
+ "categoryDetails": "categoryDetails"
},
"organizationVenues": {
"title": "Venues",
@@ -1319,5 +1322,12 @@
},
"userPledges": {
"title": "My Pledges"
+ },
+ "orgLeave": {
+ "confirmation": "Are you sure you want to leave the organization? ",
+ "heading": "Leaving organization ?",
+ "description": "Are you sure you want to leave the organization? This action cannot be undone. If the organization requires approval, you will not be able to rejoin without it. Any related data or permissions may also be lost.",
+ "errorOccured": "An error occurred. Please try again later.",
+ "orgLeft": "You have left the organization."
}
}
diff --git a/public/locales/fr/common.json b/public/locales/fr/common.json
index cba04cea96d..6ffcc802b9b 100644
--- a/public/locales/fr/common.json
+++ b/public/locales/fr/common.json
@@ -83,6 +83,7 @@
"updatedSuccessfully": "{{item}} mis à jour avec succès",
"removedSuccessfully": "{{item}} supprimé avec succès",
"successfullyUpdated": "Mis à jour avec succès",
+ "confirm": "Confirmer",
"sessionWarning": "Votre session expirera bientôt en raison de l'inactivité. Veuillez interagir avec la page pour prolonger votre session.",
"sessionLogOut": "Votre session a expiré en raison de l'inactivité. Veuillez vous reconnecter pour continuer."
}
diff --git a/public/locales/fr/translation.json b/public/locales/fr/translation.json
index 525a3dba793..4ef408ba3f2 100644
--- a/public/locales/fr/translation.json
+++ b/public/locales/fr/translation.json
@@ -213,6 +213,7 @@
"roleUpdated": "Rôle mis à jour.",
"joinNow": "Adhérer maintenant",
"visit": "Visite",
+ "leave": "partir",
"withdraw": "Largeur de tirage",
"removeUserFrom": "Supprimer l'Utilisateur de {{org}}",
"removeConfirmation": "Êtes-vous sûr de vouloir supprimer '{{name}}' de l'organisation '{{org}}' ?",
@@ -977,6 +978,7 @@
"talawaUserPortal": "Portail utilisateur Talawa",
"my organizations": "Mes organisations",
"communityProfile": "Profil de la communauté",
+ "leave": "Quitter l'organisation",
"users": "utilisateurs",
"requests": "demandes",
"logout": "se déconnecter",
@@ -1205,7 +1207,8 @@
"deleteCategory": "Supprimer la catégorie",
"deleteCategoryMsg": "Êtes-vous sûr de vouloir supprimer cette catégorie d'élément d'action ?",
"createButton": "Créer",
- "editButton": "Modifier"
+ "editButton": "Modifier",
+ "categoryDetails": "Détails de la catégorie"
},
"organizationVenues": {
"title": "Lieux",
@@ -1319,5 +1322,12 @@
},
"userPledges": {
"title": "Mes Promesses"
+ },
+ "orgLeave": {
+ "confirmation": "Etes-vous sûr de vouloir quitter l'organisation ? ",
+ "heading": "Quitter l'organisation ?",
+ "description": "Etes-vous sûr de vouloir quitter l'organisation ? Cette action ne peut pas être annulée. Si l'organisation nécessite une approbation, vous ne pourrez pas la rejoindre sans cette approbation. Toutes les données ou autorisations associées peuvent également être perdues.",
+ "errorOccured": "Une erreur s'est produite. Veuillez réessayer plus tard.",
+ "orgLeft": "Vous avez quitté l'organisation."
}
}
diff --git a/public/locales/hi/common.json b/public/locales/hi/common.json
index d8843bc5001..07d89e5890e 100644
--- a/public/locales/hi/common.json
+++ b/public/locales/hi/common.json
@@ -83,6 +83,7 @@
"updatedSuccessfully": "{{item}} सफलतापूर्वक अपडेट किया गया",
"removedSuccessfully": "{{item}} सफलतापूर्वक हटाया गया",
"successfullyUpdated": "सफलतापूर्वक अपडेट किया गया",
+ "confirm": "पुष्टि करें",
"sessionWarning": "आपका सत्र निष्क्रियता के कारण जल्द ही समाप्त हो जाएगा। कृपया अपने सत्र को बढ़ाने के लिए पृष्ठ के साथ बातचीत करें।",
"sessionLogOut": "निष्क्रियता के कारण आपका सत्र समाप्त हो गया है। कृपया जारी रखने के लिए पुनः लॉगिन करें।"
}
diff --git a/public/locales/hi/translation.json b/public/locales/hi/translation.json
index e827608c562..c54ca89c4e2 100644
--- a/public/locales/hi/translation.json
+++ b/public/locales/hi/translation.json
@@ -216,6 +216,7 @@
"withdraw": "वापस लें",
"removeUserFrom": "{{org}} से उपयोगकर्ता को हटाएं",
"removeConfirmation": "क्या आप वाकई '{{name}}' को संगठन '{{org}}' से हटाना चाहते हैं?",
+ "leave": "छोड़ो",
"searchByName": "नाम से खोजें",
"users": "उपयोगकर्ता",
"name": "नाम",
@@ -977,6 +978,7 @@
"talawaUserPortal": "तलावा उपयोगकर्ता पोर्टल",
"my organizations": "मेरे संगठन",
"communityProfile": "सामुदायिक प्रोफ़ाइल",
+ "leave": "संगठन छोड़ें",
"users": "उपयोगकर्ता",
"requests": "अनुरोध",
"logout": "लॉग आउट",
@@ -1205,7 +1207,8 @@
"deleteCategory": "श्रेणी हटाएं",
"deleteCategoryMsg": "क्या आप वाकई इस कार्रवाई आइटम श्रेणी को हटाना चाहते हैं?",
"createButton": "बटन बनाएं",
- "editButton": "संपादित बटन"
+ "editButton": "संपादित बटन",
+ "categoryDetails": "श्रेणी विवरण"
},
"organizationVenues": {
"title": "स्थानों",
@@ -1319,5 +1322,12 @@
},
"userPledges": {
"title": "मेरी प्रतिज्ञाएँ"
+ },
+ "orgLeave": {
+ "confirmation": "क्या आप वाकई संगठन छोड़ना चाहते हैं?",
+ "heading": "संगठन छोड़ रहे हैं?",
+ "description": "क्या आप वाकई संगठन छोड़ना चाहते हैं? इस एक्शन को वापस नहीं किया जा सकता। यदि संगठन को अनुमोदन की आवश्यकता है, तो आप इसके बिना पुनः शामिल नहीं हो पाएंगे। कोई भी संबंधित डेटा या अनुमतियाँ भी खो सकती हैं।",
+ "errorOccured": "एक त्रुटि पाई गई। कृपया बाद में पुन: प्रयास करें।",
+ "orgLeft": "आपने संगठन छोड़ दिया है."
}
}
diff --git a/public/locales/sp/common.json b/public/locales/sp/common.json
index 39ec00f1d1a..33af23d9f94 100644
--- a/public/locales/sp/common.json
+++ b/public/locales/sp/common.json
@@ -83,6 +83,7 @@
"updatedSuccessfully": "{{item}} actualizado con éxito",
"removedSuccessfully": "{{item}} eliminado con éxito",
"successfullyUpdated": "Actualizado con éxito",
+ "confirm": "Confirmar",
"sessionWarning": "Su sesión expirará pronto debido a la inactividad. Por favor, interactúe con la página para extender su sesión.",
"sessionLogOut": "Su sesión ha expirado debido a la inactividad. Por favor, inicie sesión nuevamente para continuar."
}
diff --git a/public/locales/sp/translation.json b/public/locales/sp/translation.json
index f417edffff8..5b9ae133952 100644
--- a/public/locales/sp/translation.json
+++ b/public/locales/sp/translation.json
@@ -233,6 +233,7 @@
"errorOccured": "Se produjo un error. Por favor, inténtalo de nuevo más tarde.",
"removeUserFrom": "Eliminar Usuario de {{org}}",
"removeConfirmation": "¿Está seguro de que desea eliminar a '{{name}}' de la organización '{{org}}'?",
+ "leave": "Dejar",
"noOrgError": "Error sin organización"
},
"communityProfile": {
@@ -760,13 +761,13 @@
},
"orgSettings": {
"title": "Configuración Talawa",
- "pageName": "Configuración",
"general": "General",
"actionItemCategories": "Categorías de elementos de acción",
- "updateYourDetails": "Actualiza tus datos",
- "updateYourPassword": "Actualice su contraseña",
"updateOrganization": "Actualizar Organización",
"seeRequest": "Ver Solicitud",
+ "pageName": "Configuración",
+ "updateYourDetails": "Actualiza tus datos",
+ "updateYourPassword": "Actualice su contraseña",
"settings": "Ajustes",
"noData": "Sin datos",
"otherSettings": "Otras Configuraciones",
@@ -983,6 +984,7 @@
"communityProfile": "Perfil de la comunidad",
"logout": "Cerrar sesión",
"settings": "Ajustes",
+ "leave": "Dejar la organización",
"chat": "Chat"
},
"organizationSidebar": {
@@ -1090,8 +1092,8 @@
"donate": "Donar",
"nothingToShow": "Nada que mostrar aquí.",
"success": "Donación exitosa",
- "invalidAmount": "Ingrese un valor numérico para el monto de la donación.",
- "donationAmountDescription": "Ingrese el valor numérico del monto de la donación.",
+ "invalidAmount": "Por favor, ingrese un valor numérico para el monto de la donación.",
+ "donationAmountDescription": "Por favor, ingrese el valor numérico para el monto de la donación.",
"donationOutOfRange": "El monto de la donación debe estar entre {{min}} y {{max}}."
},
"userEvents": {
@@ -1202,11 +1204,12 @@
"sameNameConflict": "Cambie el nombre para realizar una actualización",
"categoryEnabled": "Categoría de elemento de acción habilitada",
"categoryDisabled": "Categoría de elemento de acción deshabilitada",
- "noActionItemCategories": "No hay categorías de elementos de acción",
+ "noActionItemCategories": "No hay Categorías del Ítem de Acción",
"status": "Estado",
- "categoryDeleted": "Categoría de elemento de acción eliminada",
- "deleteCategory": "Eliminar categoría",
- "deleteCategoryMsg": "¿Está seguro de que desea eliminar esta categoría de elemento de acción?"
+ "categoryDeleted": "Categoría del Ítem de Acción eliminada con éxito",
+ "deleteCategory": "Eliminar Categoría",
+ "deleteCategoryMsg": "¿Está seguro de que desea eliminar esta Categoría del Ítem de Acción?",
+ "categoryDetails": "Detalles de la categoría"
},
"organizationVenues": {
"title": "Lugares",
@@ -1320,5 +1323,12 @@
},
"userPledges": {
"title": "Mis Promesas"
+ },
+ "orgLeave": {
+ "confirmation": "¿Estás segura de que quieres dejar la organización?",
+ "heading": "¿Dejar la organización?",
+ "description": "¿Estás seguro de que quieres dejar la organización? Esta acción no se puede deshacer. Si la organización requiere aprobación, no podrás volver a unirte sin ella. También se pueden perder todos los datos o permisos relacionados.",
+ "errorOccured": "Se produjo un error. Inténtelo de nuevo más tarde.",
+ "orgLeft": "Has abandonado la organización."
}
}
diff --git a/public/locales/zh/common.json b/public/locales/zh/common.json
index 1e0c619d395..32b761494d6 100644
--- a/public/locales/zh/common.json
+++ b/public/locales/zh/common.json
@@ -83,6 +83,7 @@
"updatedSuccessfully": "{{item}} 更新成功",
"removedSuccessfully": "{{item}} 删除成功",
"successfullyUpdated": "更新成功",
+ "confirm": "确认",
"sessionWarning": "由于不活动,您的会话即将过期。请与页面互动以延长您的会话。",
"sessionLogOut": "由于不活动,您的会话已过期。请重新登录以继续。"
}
diff --git a/public/locales/zh/translation.json b/public/locales/zh/translation.json
index e672d44e4ef..55d316c7ab7 100644
--- a/public/locales/zh/translation.json
+++ b/public/locales/zh/translation.json
@@ -233,7 +233,8 @@
"orgJoined": "已加入组织",
"MembershipRequestSent": "会员请求已发送",
"AlreadyJoined": "已加入",
- "errorOccured": "发生错误"
+ "errorOccured": "发生错误",
+ "leave": "离开"
},
"communityProfile": {
"title": "社区简介",
@@ -407,7 +408,7 @@
"assignmentDate": "分配日期",
"active": "积极的",
"clearFilters": "清除过滤器",
- "completed": "完全的",
+ "completed": "已完成",
"completionDate": "完成日期",
"createActionItem": "创建操作项",
"deleteActionItem": "删除操作项",
@@ -982,7 +983,8 @@
"logout": "登出",
"settings": "设置",
"chat": "聊天",
- "menu": "菜单"
+ "menu": "菜单",
+ "leave": "离开"
},
"organizationSidebar": {
"viewAll": "查看全部",
@@ -1205,7 +1207,8 @@
"deleteCategory": "删除类别",
"deleteCategoryMsg": "您确定要删除此操作项目类别吗?",
"createButton": "创建按钮",
- "editButton": "编辑按钮"
+ "editButton": "编辑按钮",
+ "categoryDetails": "类别详情"
},
"organizationVenues": {
"title": "场地",
@@ -1319,5 +1322,12 @@
},
"userPledges": {
"title": "我的承诺"
+ },
+ "orgLeave": {
+ "confirmation": "您确定要离开该组织吗?",
+ "heading": "离开组织?",
+ "description": "您确定要离开该组织吗?此操作无法撤销。如果该组织需要批准,您将无法在没有批准的情况下重新加入。任何相关的数据或权限可能也会丢失。",
+ "errorOccured": "发生错误。请稍后再试。",
+ "orgLeft": "您已离开该组织。"
}
}
diff --git a/src/GraphQl/Mutations/OrganizationMutations.ts b/src/GraphQl/Mutations/OrganizationMutations.ts
index b61d70607b6..7f5345658c3 100644
--- a/src/GraphQl/Mutations/OrganizationMutations.ts
+++ b/src/GraphQl/Mutations/OrganizationMutations.ts
@@ -283,6 +283,14 @@ export const JOIN_PUBLIC_ORGANIZATION = gql`
}
`;
+export const LEAVE_ORGANIZATION = gql`
+ mutation ($organizationId: ID!) {
+ leaveOrganization(organizationId: $organizationId) {
+ _id
+ }
+ }
+`;
+
export const CANCEL_MEMBERSHIP_REQUEST = gql`
mutation ($membershipRequestId: ID!) {
cancelMembershipRequest(membershipRequestId: $membershipRequestId) {
diff --git a/src/GraphQl/Mutations/mutations.ts b/src/GraphQl/Mutations/mutations.ts
index daeef2e3bc9..055701e7f7b 100644
--- a/src/GraphQl/Mutations/mutations.ts
+++ b/src/GraphQl/Mutations/mutations.ts
@@ -728,6 +728,7 @@ export {
CREATE_DIRECT_CHAT,
CREATE_SAMPLE_ORGANIZATION_MUTATION,
JOIN_PUBLIC_ORGANIZATION,
+ LEAVE_ORGANIZATION,
PLUGIN_SUBSCRIPTION,
REMOVE_CUSTOM_FIELD,
REMOVE_SAMPLE_ORGANIZATION_MUTATION,
diff --git a/src/components/UserPortal/OrganizationCard/OrganizationCard.module.css b/src/components/UserPortal/OrganizationCard/OrganizationCard.module.css
index 15634f7ad0e..3173536b8a2 100644
--- a/src/components/UserPortal/OrganizationCard/OrganizationCard.module.css
+++ b/src/components/UserPortal/OrganizationCard/OrganizationCard.module.css
@@ -58,6 +58,13 @@
width: 8rem;
}
+.leaveBtn {
+ display: flex;
+ justify-content: space-around;
+ width: 8rem; /* You can adjust the width based on your needs */
+ margin-right: 9rem;
+}
+
.orgName {
text-overflow: ellipsis;
white-space: nowrap;
@@ -139,9 +146,17 @@
margin-left: auto;
display: block;
}
+
+ .orgCard .btnContainer {
+ display: flex;
+ flex-direction: column;
+ gap: 0.5rem;
+ }
+
.joinBtn,
.joinedBtn,
- .withdrawBtn {
+ .withdrawBtn,
+ .leaveBtn {
display: flex;
justify-content: space-around;
width: 100%;
diff --git a/src/components/UserPortal/OrganizationCard/OrganizationCard.test.tsx b/src/components/UserPortal/OrganizationCard/OrganizationCard.test.tsx
index ba13fe346d7..56f7b215add 100644
--- a/src/components/UserPortal/OrganizationCard/OrganizationCard.test.tsx
+++ b/src/components/UserPortal/OrganizationCard/OrganizationCard.test.tsx
@@ -204,6 +204,52 @@ describe('Testing OrganizationCard Component [User Portal]', () => {
await wait();
});
+ test('should navigate to organization page and open leave confirmation modal', async () => {
+ const cardProps = {
+ ...props,
+ membershipRequestStatus: 'accepted', // Set status to accepted
+ };
+
+ render(
+
{t('description')}
+