From 82e9baa0b596e660f61c05e34ddea5bc12e19316 Mon Sep 17 00:00:00 2001 From: Shekhar Patel <90516956+duplixx@users.noreply.github.com> Date: Thu, 7 Nov 2024 21:27:06 +0530 Subject: [PATCH] Added changes --- public/locales/en/translation.json | 3 +- public/locales/fr/translation.json | 3 +- public/locales/hi/translation.json | 3 +- public/locales/sp/translation.json | 3 +- public/locales/zh/translation.json | 3 +- src/GraphQl/Queries/OrganizationQueries.ts | 2 - src/GraphQl/Queries/Queries.ts | 22 ++- .../EventAttendance/EventAttendance.tsx | 168 ++++++++++-------- .../EventAttendance/InterfaceEvents.ts | 1 + 9 files changed, 116 insertions(+), 92 deletions(-) diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json index 1f5e0b1dbe..84d63b992d 100644 --- a/public/locales/en/translation.json +++ b/public/locales/en/translation.json @@ -769,7 +769,8 @@ "Task Assigned": "Task Assigned", "Member": "Member", "Admin": "Admin", - "loading": "Loading..." + "loading": "Loading...", + "noAttendees": "Attendees not Found" }, "onSpotAttendee": { "title": "On-spot Attendee", diff --git a/public/locales/fr/translation.json b/public/locales/fr/translation.json index e9daf575a7..76d72069cc 100644 --- a/public/locales/fr/translation.json +++ b/public/locales/fr/translation.json @@ -1074,7 +1074,8 @@ "Task Assigned": "Tâche assignée", "Member": "Membre", "Admin": "Administrateur", - "loading": "Chargement..." + "loading": "Chargement...", + "noAttendees": "Aucun participant trouvé" }, "onSpotAttendee": { "title": "Participant sur place", diff --git a/public/locales/hi/translation.json b/public/locales/hi/translation.json index 67eb863873..9639f2d1c9 100644 --- a/public/locales/hi/translation.json +++ b/public/locales/hi/translation.json @@ -1074,7 +1074,8 @@ "Task Assigned": "सौंपा गया कार्य", "Member": "सदस्य", "Admin": "व्यवस्थापक", - "loading": "लोड हो रहा है" + "loading": "लोड हो रहा है", + "noAttendees": "कोई प्रतिभागी नहीं मिला" }, "onSpotAttendee": { "title": "ऑन-स्पॉट प्रतिभागी", diff --git a/public/locales/sp/translation.json b/public/locales/sp/translation.json index e764a8b497..8ffc611044 100644 --- a/public/locales/sp/translation.json +++ b/public/locales/sp/translation.json @@ -1076,7 +1076,8 @@ "Task Assigned": "Tarea asignada", "Member": "Miembro", "Admin": "Administrador", - "loading": "Cargando..." + "loading": "Cargando...", + "noAttendees": "No se encontraron asistentes" }, "onSpotAttendee": { "title": "Asistente en el lugar", diff --git a/public/locales/zh/translation.json b/public/locales/zh/translation.json index 0041ce73ef..3367f405c6 100644 --- a/public/locales/zh/translation.json +++ b/public/locales/zh/translation.json @@ -1074,7 +1074,8 @@ "Task Assigned": "分配的任务", "Member": "成员", "Admin": "管理员", - "loading": "加载中..." + "loading": "加载中...", + "noAttendees": "未找到参与者" }, "onSpotAttendee": { "title": "现场参与者", diff --git a/src/GraphQl/Queries/OrganizationQueries.ts b/src/GraphQl/Queries/OrganizationQueries.ts index 4dc7dd7a09..3329390783 100644 --- a/src/GraphQl/Queries/OrganizationQueries.ts +++ b/src/GraphQl/Queries/OrganizationQueries.ts @@ -27,8 +27,6 @@ export const ORGANIZATION_POST_LIST = gql` _id title text - imageUrl - videoUrl creator { _id firstName diff --git a/src/GraphQl/Queries/Queries.ts b/src/GraphQl/Queries/Queries.ts index 263e133aca..490e68d921 100644 --- a/src/GraphQl/Queries/Queries.ts +++ b/src/GraphQl/Queries/Queries.ts @@ -428,7 +428,13 @@ export const ORGANIZATIONS_LIST = gql` // Query to take the Members of a particular organization export const MEMBERS_LIST = gql` - query Organizations($id: ID!) { + query Organizations( + $id: ID! + $after: String + $before: String + $first: Int + $last: Int + ) { organizations(id: $id) { _id members { @@ -439,13 +445,13 @@ export const MEMBERS_LIST = gql` email createdAt gender - organizationsBlockedBy { - _id - } - eventsAttended { - _id - } - tagsAssignedWith(organizationId: $id) { + tagsAssignedWith( + after: $after + before: $before + first: $first + last: $last + organizationId: $id + ) { edges { cursor node { diff --git a/src/components/EventManagement/EventAttendance/EventAttendance.tsx b/src/components/EventManagement/EventAttendance/EventAttendance.tsx index 0d3ee05b0a..83a60c8a7e 100644 --- a/src/components/EventManagement/EventAttendance/EventAttendance.tsx +++ b/src/components/EventManagement/EventAttendance/EventAttendance.tsx @@ -266,86 +266,100 @@ function EventAttendance(): JSX.Element { - {filteredAttendees.map((member: InterfaceMember, index: number) => ( - - - {index + 1} + {filteredAttendees.length === 0 ? ( + + + {t('noAttendees')} - - + ) : ( + filteredAttendees.map( + (member: InterfaceMember, index: number) => ( + - {member.firstName} {member.lastName} - - - - {member.__typename === 'User' ? t('Member') : t('Admin')} - - ( - + {index + 1} + + + + {member.firstName} {member.lastName} + + + + {member.__typename === 'User' ? t('Member') : t('Admin')} + + ( + + ), + )} + > + - ), - )} - > - - - {member.eventsAttended - ? member.eventsAttended.length - : '0'} - - - - - {member.tagsAssignedWith ? ( - member.tagsAssignedWith.edges.map( - (edge: { node: { name: string } }, tagIndex: number) => ( -
{edge.node.name}
- ), - ) - ) : ( -
None
- )} -
-
- ))} + > + + {member.eventsAttended + ? member.eventsAttended.length + : '0'} + + + + + {member.tagsAssignedWith ? ( + member.tagsAssignedWith.edges.map( + ( + edge: { node: { name: string } }, + tagIndex: number, + ) =>
{edge.node.name}
, + ) + ) : ( +
None
+ )} +
+ + ), + ) + )}
diff --git a/src/components/EventManagement/EventAttendance/InterfaceEvents.ts b/src/components/EventManagement/EventAttendance/InterfaceEvents.ts index ff8a371fcf..7fc75ae4af 100644 --- a/src/components/EventManagement/EventAttendance/InterfaceEvents.ts +++ b/src/components/EventManagement/EventAttendance/InterfaceEvents.ts @@ -24,6 +24,7 @@ export interface InterfaceMember { _id: string; tagsAssignedWith: { edges: { + cursor: string; node: { name: string; };