Skip to content

Commit 6812f5f

Browse files
“kebean”aimedivin
authored andcommitted
implement attendance
1 parent 48e9136 commit 6812f5f

40 files changed

+3266
-1739
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: 3 additions & 2 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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
"zod": "^3.23.8"
116116
},
117117
"devDependencies": {
118-
"@apollo/client": "^3.8.7",
118+
"@apollo/client": "^3.11.8",
119119
"@babel/core": "^7.22.9",
120120
"@babel/preset-env": "^7.22.9",
121121
"@heroicons/react": "^1.0.6",

src/Mutations/Attendance.tsx

Lines changed: 143 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,42 @@
1-
import { gql } from '@apollo/client';
1+
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,126 @@ 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!
72+
$date: String!
5373
$trainees: [TraineeInput!]!
54-
$recordAttendanceOrgToken2: String!
74+
$orgToken: String!
5575
) {
5676
recordAttendance(
5777
week: $week
58-
days: $days
78+
team: $team
79+
date: $date
5980
trainees: $trainees
60-
orgToken: $recordAttendanceOrgToken2
81+
orgToken: $orgToken
6182
) {
62-
id
63-
week
83+
team {
84+
id
85+
name
86+
cohort {
87+
name
88+
}
89+
}
6490
trainees {
65-
traineeId
66-
traineeEmail
91+
trainee {
92+
profile {
93+
name
94+
}
95+
}
6796
status {
68-
days
69-
value
97+
day
98+
date
99+
score
100+
}
101+
}
102+
}
103+
}
104+
`;
105+
106+
export const UPDATE_ATTENDANCE = gql`
107+
mutation UpdateAttendance(
108+
$week: Int!
109+
$team: String!
110+
$phase: String!
111+
$trainees: [TraineeInput!]!
112+
$orgToken: String!
113+
) {
114+
updateAttendance(
115+
week: $week
116+
team: $team
117+
phase: $phase
118+
trainees: $trainees
119+
orgToken: $orgToken
120+
) {
121+
id
122+
week
123+
phase {
124+
id
125+
name
126+
}
127+
cohort {
128+
id
129+
name
130+
}
131+
teams {
132+
team {
133+
id
134+
name
135+
}
136+
trainees {
137+
trainee {
138+
id
139+
email
140+
profile {
141+
id
142+
name
143+
}
144+
}
145+
status {
146+
day
147+
date
148+
score
149+
}
150+
}
151+
}
152+
}
153+
}
154+
`;
155+
156+
export const DELETE_ATTENDANCE = gql`
157+
mutation DeleteAttendance($week: String!, $team: String!, $day: String!) {
158+
deleteAttendance(week: $week, team: $team, day: $day) {
159+
id
160+
week
161+
phase {
162+
id
163+
name
164+
}
165+
cohort {
166+
id
167+
name
168+
}
169+
teams {
170+
team {
171+
id
172+
name
173+
}
174+
trainees {
175+
trainee {
176+
id
177+
email
178+
profile {
179+
id
180+
name
181+
}
182+
}
183+
status {
184+
day
185+
date
186+
score
187+
}
70188
}
71189
}
72190
}

src/Mutations/manageStudentMutations.tsx

Lines changed: 7 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,12 @@ 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
378+
status {
379+
date
380+
reason
381+
status
382+
}
376383
profile {
377384
firstName
378385
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)