Skip to content

Commit

Permalink
fx<invitation table> fixing invitation table by improving its loading…
Browse files Browse the repository at this point in the history
… state

fx<invitation table> fixing invitation table by improving its loading state

advancing calender functionality (#480)
  • Loading branch information
Ndevu12 committed Oct 4, 2024
1 parent 73792fb commit 2388ab6
Show file tree
Hide file tree
Showing 24 changed files with 1,479 additions and 367 deletions.
5 changes: 4 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
export default {
preset: 'ts-jest',
testEnvironment: 'jsdom',
testEnvironmentOptions: {
customExportConditions: [] // don't load "browser" field
},
verbose: true,
collectCoverage: true,
coverageReporters: ['lcov', 'text'],
Expand All @@ -28,4 +31,4 @@ export default {
statements: 80,
},
},
};
};
97 changes: 44 additions & 53 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@
"@babel/preset-react": "^7.22.5",
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@fullcalendar/core": "^5.11.5",
"@fullcalendar/daygrid": "^5.11.5",
"@fullcalendar/interaction": "^5.11.5",
"@fullcalendar/list": "^5.11.5",
"@fullcalendar/react": "^5.11.5",
"@fullcalendar/timegrid": "^5.11.5",
"@fullcalendar/core": "^6.1.15",
"@fullcalendar/daygrid": "^6.1.15",
"@fullcalendar/interaction": "^6.1.15",
"@fullcalendar/list": "^6.1.15",
"@fullcalendar/react": "^6.1.15",
"@fullcalendar/timegrid": "^6.1.15",
"@headlessui/react": "^1.7.15",
"@heroicons/react": "^1.0.6",
"@iconify/react": "^3.2.2",
Expand Down Expand Up @@ -180,4 +180,4 @@
"*.{js,ts,html,css,md}": "prettier --write \"./**/*.{js,ts,jsx,tsx,json}\""
},
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}
}
2 changes: 2 additions & 0 deletions src/Mutations/User.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@ export const GET_ALL_TTL_USERS = gql`
getAllTTLUsers(orgToken: $orgToken) {
profile {
name
id
}
email
role
team {
name
cohort {
Expand Down
110 changes: 107 additions & 3 deletions src/Mutations/event.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,96 @@ import { gql } from '@apollo/client';
export const GET_EVENTS = gql`
query GetEvents($authToken: String) {
getEvents(authToken: $authToken) {
id
user
end
hostName
start
timeToEnd
timeToStart
title
invitees {
email
}
}
}
`;

export const GET_EVENT = gql`
query GetEvent($eventId: String!, $authToken: String!) {
getEvent(eventId: $eventId,authToken: $authToken) {
id
user
end
hostName
start
timeToEnd
timeToStart
title
invitees {
email
}
}
}
`

export const ADD_EVENT = gql`
mutation CreateEvent(
$title: String!
$end: String!
$timeToStart: String!
$timeToFinish: String!
$timeToEnd: String!
$hostName: String!
$start: String!
$authToken: String
$authToken: String!
$orgToken: String!
$invitees: [String]!
) {
createEvent(
title: $title
end: $end
timeToStart: $timeToStart
timeToEnd: $timeToFinish
timeToEnd: $timeToEnd
hostName: $hostName
start: $start
authToken: $authToken
orgToken: $orgToken
invitees: $invitees
) {
end
hostName
start
timeToEnd
title
timeToStart
}
}
`;

export const EDIT_EVENT = gql`
mutation EditEvent(
$eventId: String!
$title: String!
$end: String!
$timeToStart: String!
$timeToEnd: String!
$hostName: String!
$start: String!
$authToken: String!
$orgToken: String!
$invitees: [String]!
) {
editEvent(
eventId: $eventId
title: $title
end: $end
timeToStart: $timeToStart
timeToEnd: $timeToEnd
hostName: $hostName
start: $start
authToken: $authToken
orgToken: $orgToken
invitees: $invitees
) {
end
hostName
Expand All @@ -41,3 +103,45 @@ export const ADD_EVENT = gql`
}
}
`;

export const CANCEL_EVENT = gql`
mutation CancelEvent(
$eventId: String!
$authToken: String!
) {
cancelEvent(
eventId: $eventId
authToken: $authToken
) {
end
hostName
start
timeToEnd
title
timeToStart
}
}
`

export const RESPOND_TO_EVENT_INVITATION = gql`
mutation RespondToEventInvitation(
$eventToken: String!
$authToken: String!
) {
respondToEventInvitation(
eventToken: $eventToken,
authToken: $authToken
) {
end
hostName
start
timeToEnd
title
timeToStart
invitees {
email,
status
}
}
}
`
24 changes: 22 additions & 2 deletions src/Mutations/manageStudentMutations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,20 @@ export const GET_USERS_QUERY = gql`
}
`;

export const GET_ALL_USERS_QUERY = gql`
query GetUsers($orgToken: String) {
getAllUsers(orgToken: $orgToken) {
id
email
role
profile{
firstName
lastName
}
}
}
`;

export const DROP_TRAINEE = gql`
mutation DropTrainee(
$traineeId: String!
Expand All @@ -21,7 +35,12 @@ export const DROP_TRAINEE = gql`
dropTrainee(traineeId: $traineeId, reason: $reason, date: $date)
}
`;

// Define the mutation
export const UNDROP_TRAINEE = gql`
mutation UndropTrainee($traineeId: String!) {
undropTrainee(traineeId: $traineeId)
}
`;
export const GET_TRAINEES_QUERY = gql`
query GetTrainees($orgToken: String) {
getTrainees(orgToken: $orgToken) {
Expand All @@ -36,6 +55,7 @@ export const GET_TRAINEES_QUERY = gql`
id
user {
id
role
status {
status
date
Expand Down Expand Up @@ -406,4 +426,4 @@ export const GET_TEAM_TRAINEE_QUERY = gql`
}
}
}
`;
`;
Loading

0 comments on commit 2388ab6

Please sign in to comment.