Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#537 Improving table loading state PR #547

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions 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 Down
99 changes: 45 additions & 54 deletions package-lock.json

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

12 changes: 6 additions & 6 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
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
}
}
}
`
22 changes: 21 additions & 1 deletion 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
Loading
Loading