Skip to content

Commit

Permalink
Added changes
Browse files Browse the repository at this point in the history
  • Loading branch information
duplixx committed Nov 7, 2024
1 parent 9851494 commit 82e9baa
Show file tree
Hide file tree
Showing 9 changed files with 116 additions and 92 deletions.
3 changes: 2 additions & 1 deletion public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion public/locales/fr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion public/locales/hi/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -1074,7 +1074,8 @@
"Task Assigned": "सौंपा गया कार्य",
"Member": "सदस्य",
"Admin": "व्यवस्थापक",
"loading": "लोड हो रहा है"
"loading": "लोड हो रहा है",
"noAttendees": "कोई प्रतिभागी नहीं मिला"
},
"onSpotAttendee": {
"title": "ऑन-स्पॉट प्रतिभागी",
Expand Down
3 changes: 2 additions & 1 deletion public/locales/sp/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion public/locales/zh/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -1074,7 +1074,8 @@
"Task Assigned": "分配的任务",
"Member": "成员",
"Admin": "管理员",
"loading": "加载中..."
"loading": "加载中...",
"noAttendees": "未找到参与者"
},
"onSpotAttendee": {
"title": "现场参与者",
Expand Down
2 changes: 0 additions & 2 deletions src/GraphQl/Queries/OrganizationQueries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ export const ORGANIZATION_POST_LIST = gql`
_id
title
text
imageUrl
videoUrl
creator {
_id
firstName
Expand Down
22 changes: 14 additions & 8 deletions src/GraphQl/Queries/Queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down
168 changes: 91 additions & 77 deletions src/components/EventManagement/EventAttendance/EventAttendance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -266,86 +266,100 @@ function EventAttendance(): JSX.Element {
</TableRow>
</TableHead>
<TableBody>
{filteredAttendees.map((member: InterfaceMember, index: number) => (
<TableRow
key={index}
data-testid={`attendee-row-${index}`}
className="my-6"
>
<TableCell
component="th"
scope="row"
data-testid={`attendee-index-${index}`}
>
{index + 1}
{filteredAttendees.length === 0 ? (
<TableRow>
<TableCell colSpan={5} align="center">
{t('noAttendees')}
</TableCell>
<TableCell align="left" data-testid={`attendee-name-${index}`}>
<Link
to={`/member/${currentUrl}`}
state={{ id: member._id }}
className={styles.membername}
</TableRow>
) : (
filteredAttendees.map(
(member: InterfaceMember, index: number) => (
<TableRow
key={index}
data-testid={`attendee-row-${index}`}
className="my-6"
>
{member.firstName} {member.lastName}
</Link>
</TableCell>
<TableCell
align="left"
data-testid={`attendee-status-${index}`}
>
{member.__typename === 'User' ? t('Member') : t('Admin')}
</TableCell>
<Tooltip
componentsProps={{
tooltip: {
sx: {
backgroundColor: 'white',
fontSize: '2em',
maxHeight: '170px',
overflowY: 'scroll',
scrollbarColor: 'white',
border: '1px solid green',
borderRadius: '6px',
boxShadow: '0 0 5px rgba(0,0,0,0.1)',
},
},
}}
title={member.eventsAttended?.map(
(event: { _id: string }, index: number) => (
<AttendedEventList
key={event._id}
eventId={event._id}
<TableCell
component="th"
scope="row"
data-testid={`attendee-index-${index}`}
>
{index + 1}
</TableCell>
<TableCell
align="left"
data-testid={`attendee-name-${index}`}
>
<Link
to={`/member/${currentUrl}`}
state={{ id: member._id }}
className={styles.membername}
>
{member.firstName} {member.lastName}
</Link>
</TableCell>
<TableCell
align="left"
data-testid={`attendee-status-${index}`}
>
{member.__typename === 'User' ? t('Member') : t('Admin')}
</TableCell>
<Tooltip
componentsProps={{
tooltip: {
sx: {
backgroundColor: 'white',
fontSize: '2em',
maxHeight: '170px',
overflowY: 'scroll',
scrollbarColor: 'white',
border: '1px solid green',
borderRadius: '6px',
boxShadow: '0 0 5px rgba(0,0,0,0.1)',
},
},
}}
title={member.eventsAttended?.map(
(event: { _id: string }, index: number) => (
<AttendedEventList
key={event._id}
eventId={event._id}
data-testid={`attendee-events-attended-${index}`}
/>
),
)}
>
<TableCell
align="left"
data-testid={`attendee-events-attended-${index}`}
/>
),
)}
>
<TableCell
align="left"
data-testid={`attendee-events-attended-${index}`}
>
<span className={styles.eventsAttended}>
{member.eventsAttended
? member.eventsAttended.length
: '0'}
</span>
</TableCell>
</Tooltip>
<TableCell
align="left"
data-testid={`attendee-task-assigned-${index}`}
>
{member.tagsAssignedWith ? (
member.tagsAssignedWith.edges.map(
(edge: { node: { name: string } }, tagIndex: number) => (
<div key={tagIndex}>{edge.node.name}</div>
),
)
) : (
<div>None</div>
)}
</TableCell>
</TableRow>
))}
>
<span className={styles.eventsAttended}>
{member.eventsAttended
? member.eventsAttended.length
: '0'}
</span>
</TableCell>
</Tooltip>
<TableCell
align="left"
data-testid={`attendee-task-assigned-${index}`}
>
{member.tagsAssignedWith ? (
member.tagsAssignedWith.edges.map(
(
edge: { node: { name: string } },
tagIndex: number,
) => <div key={tagIndex}>{edge.node.name}</div>,
)
) : (
<div>None</div>
)}
</TableCell>
</TableRow>
),
)
)}
</TableBody>
</Table>
</TableContainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export interface InterfaceMember {
_id: string;
tagsAssignedWith: {
edges: {
cursor: string;
node: {
name: string;
};
Expand Down

0 comments on commit 82e9baa

Please sign in to comment.