Skip to content

Commit 433783b

Browse files
“kebean”aimedivin
authored andcommitted
implement attendance
1 parent 1b58a2a commit 433783b

20 files changed

+1400
-924
lines changed

index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@
4040
href="https://fonts.googleapis.com/css2?family=Inria+Serif:ital@1&family=Lexend+Deca:wght@600&family=Open+Sans:wght@300;400;600;700;800&display=swap"
4141
rel="stylesheet"
4242
/> -->
43+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.6.0/css/all.min.css"
44+
integrity="sha512-Kc323vGBEqzTmouAECnVceyQqyqdsSiqLQISBL29aUW4U/M7pSPA/gEUZQqv1cwx4OnYxTxve5UMg5GT6L4JJg=="
45+
crossorigin="anonymous" referrerpolicy="no-referrer" />
4346

4447
<link
4548
href="https://fonts.googleapis.com/css2?family=PT+Serif:wght@400;700&display=swap"

package-lock.json

Lines changed: 9 additions & 212 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
"istanbul": "^0.4.5",
7777
"jsonwebtoken": "^9.0.1",
7878
"jwt-decode": "^3.1.2",
79+
"lucide-react": "^0.445.0",
7980
"moment": "^2.29.4",
8081
"pnpm": "^8.6.11",
8182
"react-apexcharts": "^1.4.1",

src/Mutations/Attendance.tsx

Lines changed: 120 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,42 @@
11
import { gql } from '@apollo/client';
22

3-
export const GET_ATTENDANCE = gql`
4-
query ExampleQuery {
5-
getTraineeAttendance {
3+
export const GET_TEAM_ATTENDANCE = gql`
4+
query GetTeamAttendance($team: String!, $orgToken: String) {
5+
getTeamAttendance(team: $team, orgToken: $orgToken) {
66
id
7-
trainees {
8-
traineeId
9-
traineeEmail
10-
status {
11-
days
12-
value
7+
week
8+
phase {
9+
id
10+
name
11+
}
12+
cohort {
13+
id
14+
name
15+
}
16+
teams {
17+
team {
18+
id
19+
name
20+
}
21+
trainees {
22+
trainee {
23+
id
24+
email
25+
profile {
26+
id
27+
name
28+
}
29+
}
30+
status {
31+
day
32+
date
33+
score
34+
}
1335
}
1436
}
15-
week
1637
}
1738
}
1839
`;
19-
2040
export const GET_ATTENDANCE_BY_ID = gql`
2141
query GetAttendance($id: ID!) {
2242
getTraineeAttendanceByID(id: $id) {
@@ -33,7 +53,6 @@ export const GET_ATTENDANCE_BY_ID = gql`
3353
}
3454
}
3555
`;
36-
3756
export const GET_WEEKLY_ATTENDANCE = gql`
3857
query GetTraineeAttendanceByID($traineeEmail: String!) {
3958
getTraineeAttendanceByID(traineeEmail: $traineeEmail) {
@@ -46,27 +65,106 @@ export const GET_WEEKLY_ATTENDANCE = gql`
4665
}
4766
`;
4867

49-
export const UPDATE_ATTENDANCE = gql`
68+
export const RECORD_ATTENDANCE = gql`
5069
mutation RecordAttendance(
51-
$week: String!
52-
$days: String!
70+
$week: Int!
71+
$team: String!
5372
$trainees: [TraineeInput!]!
54-
$recordAttendanceOrgToken2: String!
73+
$orgToken: String!
5574
) {
5675
recordAttendance(
5776
week: $week
58-
days: $days
77+
team: $team
5978
trainees: $trainees
60-
orgToken: $recordAttendanceOrgToken2
79+
orgToken: $orgToken
80+
) {
81+
team {
82+
id
83+
name
84+
cohort {
85+
name
86+
}
87+
}
88+
trainees {
89+
trainee {
90+
profile {
91+
name
92+
}
93+
}
94+
status {
95+
day
96+
score
97+
}
98+
}
99+
}
100+
}
101+
`;
102+
103+
export const UPDATE_ATTENDANCE = gql`
104+
mutation UpdateAttendance(
105+
$week: Int!
106+
$team: String!
107+
$trainees: [TraineeInput!]!
108+
$orgToken: String!
109+
) {
110+
updateAttendance(
111+
week: $week
112+
team: $team
113+
trainees: $trainees
114+
orgToken: $orgToken
61115
) {
62116
id
63117
week
118+
phase {
119+
id
120+
name
121+
}
122+
cohort {
123+
id
124+
name
125+
}
126+
teams {
127+
team {
128+
id
129+
name
130+
}
131+
trainees {
132+
trainee {
133+
id
134+
email
135+
profile {
136+
id
137+
name
138+
}
139+
}
140+
status {
141+
day
142+
date
143+
score
144+
}
145+
}
146+
}
147+
}
148+
}
149+
`;
150+
151+
152+
export const DELETE_ATTENDANCE = gql`
153+
mutation DeleteAttendance($week: String!, $team: String!, $day: String!) {
154+
deleteAttendance(week: $week, team: $team, day: $day) {
155+
team {
156+
name
157+
}
64158
trainees {
65-
traineeId
66-
traineeEmail
159+
trainee {
160+
email
161+
profile {
162+
name
163+
}
164+
}
67165
status {
68-
days
69-
value
166+
day
167+
score
70168
}
71169
}
72170
}

src/Mutations/manageStudentMutations.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ export const GET_TRAINEES_QUERY = gql`
5858
}
5959
team {
6060
name
61+
id
6162
cohort {
6263
id
6364
startDate
@@ -373,6 +374,7 @@ export const ADD_MEMBER_TO_TEAM = gql`
373374
export const GET_TEAM_TRAINEE_QUERY = gql`
374375
query GetTeamTrainees($orgToken: String, $team: String) {
375376
getTeamTrainees(orgToken: $orgToken, team: $team) {
377+
id
376378
profile {
377379
firstName
378380
lastName

src/Mutations/teamMutation.tsx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,25 @@ export const GET_TEAMS = gql`
1010
`;
1111
export default GET_TEAMS;
1212

13+
export const GET_ALL_TEAMS = gql`
14+
query Query($orgToken: String) {
15+
getAllTeams(orgToken: $orgToken) {
16+
id
17+
name
18+
cohort {
19+
name
20+
phase {
21+
id
22+
name
23+
}
24+
coordinator {
25+
id
26+
}
27+
}
28+
}
29+
}
30+
`;
31+
1332
export const ADD_TEAMS = gql`
1433
mutation Mutation(
1534
$name: String!

src/assets/cancel_mark.svg

Lines changed: 4 additions & 0 deletions
Loading

src/assets/check-mark.svg

Lines changed: 18 additions & 0 deletions
Loading

src/assets/check_mark.svg

Lines changed: 11 additions & 0 deletions
Loading

src/assets/tilde.svg

Lines changed: 4 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)