Skip to content
This repository has been archived by the owner on Jan 20, 2025. It is now read-only.

Add notifyStudent flag to thesis application assessment #198

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
18 changes: 9 additions & 9 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
},
"dependencies": {
"@formkit/auto-animate": "^0.8.1",
"@mantine/core": "^7.2.2",
"@mantine/dates": "^7.2.2",
"@mantine/dropzone": "^7.2.2",
"@mantine/form": "^7.2.2",
"@mantine/hooks": "^7.2.2",
"@mantine/notifications": "^7.2.2",
"@mantine/tiptap": "^7.2.2",
"@mantine/core": "^7.3.0",
"@mantine/dates": "^7.3.0",
"@mantine/dropzone": "^7.3.0",
"@mantine/form": "^7.3.0",
"@mantine/hooks": "^7.3.0",
"@mantine/notifications": "^7.3.0",
"@mantine/tiptap": "^7.3.0",
"@reduxjs/toolkit": "^1.9.7",
"@tabler/icons-react": "^2.40.0",
"@tiptap/core": "^2.1.12",
Expand All @@ -39,8 +39,8 @@
"i18n-iso-countries": "^7.7.0",
"jwt-decode": "^4.0.0",
"keycloak-js": "^22.0.5",
"mantine-contextmenu": "^7.1.11",
"mantine-datatable": "^7.1.5",
"mantine-contextmenu": "^7.1.12",
"mantine-datatable": "^7.1.7",
"moment": "^2.29.4",
"papaparse": "^5.4.1",
"react": "^18.2.0",
Expand Down
20 changes: 18 additions & 2 deletions client/src/forms/ThesisApplicationForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ export const ThesisApplicationForm = ({
const [thesisAdvisorId, setThesisAdvisorId] = useState<string | null>(
application?.thesisAdvisor?.id ?? null,
)
const [notifyStudent, setNotifyStudent] = useState(false)

useEffect(() => {
setThesisAdvisorId(application?.thesisAdvisor?.id ?? null)
Expand Down Expand Up @@ -857,7 +858,12 @@ export const ThesisApplicationForm = ({
disabled={thesisAppliccationsSliceState === 'pending'}
onClick={() => {
if (application) {
void dispatch(rejectThesisApplication(application.id))
void dispatch(
rejectThesisApplication({
thesisApplicationId: application.id,
notifyStudent,
}),
)
}
}}
>
Expand All @@ -871,12 +877,22 @@ export const ThesisApplicationForm = ({
}
onClick={() => {
if (application) {
void dispatch(acceptThesisApplication(application.id))
void dispatch(
acceptThesisApplication({
thesisApplicationId: application.id,
notifyStudent,
}),
)
}
}}
>
{thesisAppliccationsSliceState === 'pending' ? <Loader /> : 'Accept'}
</Button>
<Checkbox
label='Notify student'
checked={notifyStudent}
onChange={(event) => setNotifyStudent(event.currentTarget.checked)}
/>
</Group>
</>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@ import { notifications } from '@mantine/notifications'
export const acceptThesisApplication = createAsyncThunk(
'thesisApplications/acceptThesisApplication',

async (thesisApplicationId: string, { rejectWithValue }) => {
async (
{ thesisApplicationId, notifyStudent }: { thesisApplicationId: string; notifyStudent: boolean },
{ rejectWithValue },
) => {
try {
const response = await axiosInstance.post(
`/api/thesis-applications/${thesisApplicationId}/accept`,
`/api/thesis-applications/${thesisApplicationId}/accept?notifyStudent=${notifyStudent}`,
{},
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@ import { notifications } from '@mantine/notifications'
export const rejectThesisApplication = createAsyncThunk(
'thesisApplications/rejectThesisApplication',

async (thesisApplicationId: string, { rejectWithValue }) => {
async (
{ thesisApplicationId, notifyStudent }: { thesisApplicationId: string; notifyStudent: boolean },
{ rejectWithValue },
) => {
try {
const response = await axiosInstance.post(
`/api/thesis-applications/${thesisApplicationId}/reject`,
`/api/thesis-applications/${thesisApplicationId}/reject?notifyStudent=${notifyStudent}`,
{},
)

Expand Down
138 changes: 69 additions & 69 deletions client/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -246,110 +246,110 @@ __metadata:
languageName: node
linkType: hard

"@mantine/core@npm:^7.2.2":
version: 7.2.2
resolution: "@mantine/core@npm:7.2.2"
"@mantine/core@npm:^7.3.0":
version: 7.3.0
resolution: "@mantine/core@npm:7.3.0"
dependencies:
"@floating-ui/react": "npm:^0.24.8"
clsx: "npm:2.0.0"
react-number-format: "npm:^5.2.2"
react-remove-scroll: "npm:^2.5.6"
react-number-format: "npm:^5.3.1"
react-remove-scroll: "npm:^2.5.7"
react-textarea-autosize: "npm:8.5.3"
type-fest: "npm:^3.13.1"
peerDependencies:
"@mantine/hooks": 7.2.2
"@mantine/hooks": 7.3.0
react: ^18.2.0
react-dom: ^18.2.0
checksum: dc71d65dca0b4517eb75c053a51570bf5f6511b68e0c65631379878b575839719a7b5610c61d5bf5f268796c43123b4b627cce075f814ffc26f97153b43fd53e
checksum: b3722513c72df181510fccf8e8a96aa9456d99a80ae3995e6a0db1f55be31e49f2d97ff729147e80f08305aa3fc49ad0a32fa7e29eb5065ce42eb092551daf86
languageName: node
linkType: hard

"@mantine/dates@npm:^7.2.2":
version: 7.2.2
resolution: "@mantine/dates@npm:7.2.2"
"@mantine/dates@npm:^7.3.0":
version: 7.3.0
resolution: "@mantine/dates@npm:7.3.0"
dependencies:
clsx: "npm:2.0.0"
peerDependencies:
"@mantine/core": 7.2.2
"@mantine/hooks": 7.2.2
dayjs: ^1.10.5
"@mantine/core": 7.3.0
"@mantine/hooks": 7.3.0
dayjs: ">=1.0.0"
react: ^18.2.0
react-dom: ^18.2.0
checksum: 2e8549e5640a0ec0a37f1dff34c4eaad52f919b29881787434dfcd9a3c9ef7bd0c92d80458bc5c4311d82bda641a8ce68e582083651afe93805d2df018a11814
checksum: 145005204c8ac33f00c2b9ed6aea5656ee5e35a0232cc13c9eee672525401a4639e5ff8575d4e63a383aab7c038da7cde046253cbeca549a2e0ac0ed10e676ed
languageName: node
linkType: hard

"@mantine/dropzone@npm:^7.2.2":
version: 7.2.2
resolution: "@mantine/dropzone@npm:7.2.2"
"@mantine/dropzone@npm:^7.3.0":
version: 7.3.0
resolution: "@mantine/dropzone@npm:7.3.0"
dependencies:
react-dropzone-esm: "npm:15.0.1"
peerDependencies:
"@mantine/core": 7.2.2
"@mantine/hooks": 7.2.2
"@mantine/core": 7.3.0
"@mantine/hooks": 7.3.0
react: ^18.2.0
react-dom: ^18.2.0
checksum: 289432bac132586e602d2156acb9969dc4932fc505869f8f87db1fa5196634ffb66cb5ff3804fa8134a09a548cb30bde70be0a1c073bbab1c2bf9fc07ced7ecd
checksum: ecf633230631a16e1e4324d104fe65eb89ac6ce354d362229e21902458785cf8635ccca5721fdabb53e4f09c0a35eeb00d728efe4559eaaa75a0a013c08ccbfb
languageName: node
linkType: hard

"@mantine/form@npm:^7.2.2":
version: 7.2.2
resolution: "@mantine/form@npm:7.2.2"
"@mantine/form@npm:^7.3.0":
version: 7.3.0
resolution: "@mantine/form@npm:7.3.0"
dependencies:
fast-deep-equal: "npm:^3.1.3"
klona: "npm:^2.0.5"
klona: "npm:^2.0.6"
peerDependencies:
react: ^18.2.0
checksum: 2fca2378c995c240894a7cbc01f7d23cc494575f9d77142656ea4d838a4e159557fe3a3ed0f862e7f4cd277c2addfff19679a3313b3b7ff347b380b0c33704c6
checksum: 1f104d2c474413b14a454784d053b2ec3c7645b8399c8ac6b7402e2382d2df8289f7bc42c041f343910202ccf1631d4e89c27554bd9e63a3caa39f16348927d6
languageName: node
linkType: hard

"@mantine/hooks@npm:^7.2.2":
version: 7.2.2
resolution: "@mantine/hooks@npm:7.2.2"
"@mantine/hooks@npm:^7.3.0":
version: 7.3.0
resolution: "@mantine/hooks@npm:7.3.0"
peerDependencies:
react: ^18.2.0
checksum: b119152b7af7a1888f5e07ba50f4d167a96e3d7824761c37ec7c16ee78e7c7b99496a4509c47f062f66a543eae1bb9d9265d2d152b11c06561f2c2b7ea06a2fc
checksum: 3de186ab186a566eaeda26601db4cc0052280bf7ae23d517ba8ba7e8f2386533de8c9bf230692a2a8caea4d83c457225f25de94271fe1d1d7601ce9206fca631
languageName: node
linkType: hard

"@mantine/notifications@npm:^7.2.2":
version: 7.2.2
resolution: "@mantine/notifications@npm:7.2.2"
"@mantine/notifications@npm:^7.3.0":
version: 7.3.0
resolution: "@mantine/notifications@npm:7.3.0"
dependencies:
"@mantine/store": "npm:7.2.2"
"@mantine/store": "npm:7.3.0"
react-transition-group: "npm:4.4.5"
peerDependencies:
"@mantine/core": 7.2.2
"@mantine/hooks": 7.2.2
"@mantine/core": 7.3.0
"@mantine/hooks": 7.3.0
react: ^18.2.0
react-dom: ^18.2.0
checksum: 6b9c771b9b5d3faf7726b290c98f79c602ac9f1a6b31e82b9c365af0a381eac6013a16b41a0d348d41107b1ff97ec0b354089e1e5fd1105e9f12652332775d69
checksum: beaa267f7f51be818da5c22e6d2bb1d57c85bc0469ea06b7fe6b88977534e8edbfb17f1572b095212abf7da00ecf10b0594c08932bb8e54940f3f09b06bc151b
languageName: node
linkType: hard

"@mantine/store@npm:7.2.2":
version: 7.2.2
resolution: "@mantine/store@npm:7.2.2"
"@mantine/store@npm:7.3.0":
version: 7.3.0
resolution: "@mantine/store@npm:7.3.0"
peerDependencies:
react: ^18.2.0
checksum: 71ec7eaf6cbede9b32bfeda5a389f7629ca8221ce53d080953ab0306e31fe80fb37965ae0eb9a0e46dccfe89ba24473c9fea3e8c27336273ffaab3c5590ae33f
checksum: fac506a588e83a053065765f95575b780947aa4b07f09543c26faa807d2cb29ccbdcc6a5abfabc0cc56998c6d9808d61e49e69620e9d647ede337e3577e1f6e2
languageName: node
linkType: hard

"@mantine/tiptap@npm:^7.2.2":
version: 7.2.2
resolution: "@mantine/tiptap@npm:7.2.2"
"@mantine/tiptap@npm:^7.3.0":
version: 7.3.0
resolution: "@mantine/tiptap@npm:7.3.0"
peerDependencies:
"@mantine/core": 7.2.2
"@mantine/hooks": 7.2.2
"@tabler/icons-react": ^2.29.0
"@tiptap/extension-link": ^2.0.4
"@tiptap/react": ^2.0.4
"@mantine/core": 7.3.0
"@mantine/hooks": 7.3.0
"@tabler/icons-react": ">=2.0.0"
"@tiptap/extension-link": ^2.1.12
"@tiptap/react": ^2.1.12
react: ^18.2.0
react-dom: ^18.2.0
checksum: 39f62c24dbaec0cb0e1a6ea6b90297396d9e5901427e428ea606e997e3886c935d5d6ce056c73b3ee7b6b6a1a6edbc5d080d67e1c8c8910b2f70517798c35aba
checksum: 76e4d9711796080587573a12076450a5f3d8031729b73e66d5962cd89e4435779abab0131b26fbb2f213c9eff35a46641b0a423999fbd8fe3815aa6149a23f00
languageName: node
linkType: hard

Expand Down Expand Up @@ -2259,13 +2259,13 @@ __metadata:
resolution: "client@workspace:."
dependencies:
"@formkit/auto-animate": "npm:^0.8.1"
"@mantine/core": "npm:^7.2.2"
"@mantine/dates": "npm:^7.2.2"
"@mantine/dropzone": "npm:^7.2.2"
"@mantine/form": "npm:^7.2.2"
"@mantine/hooks": "npm:^7.2.2"
"@mantine/notifications": "npm:^7.2.2"
"@mantine/tiptap": "npm:^7.2.2"
"@mantine/core": "npm:^7.3.0"
"@mantine/dates": "npm:^7.3.0"
"@mantine/dropzone": "npm:^7.3.0"
"@mantine/form": "npm:^7.3.0"
"@mantine/hooks": "npm:^7.3.0"
"@mantine/notifications": "npm:^7.3.0"
"@mantine/tiptap": "npm:^7.3.0"
"@reduxjs/toolkit": "npm:^1.9.7"
"@tabler/icons-react": "npm:^2.40.0"
"@tiptap/core": "npm:^2.1.12"
Expand Down Expand Up @@ -2307,8 +2307,8 @@ __metadata:
i18n-iso-countries: "npm:^7.7.0"
jwt-decode: "npm:^4.0.0"
keycloak-js: "npm:^22.0.5"
mantine-contextmenu: "npm:^7.1.11"
mantine-datatable: "npm:^7.1.5"
mantine-contextmenu: "npm:^7.1.12"
mantine-datatable: "npm:^7.1.7"
moment: "npm:^2.29.4"
papaparse: "npm:^5.4.1"
prettier: "npm:^3.0.3"
Expand Down Expand Up @@ -4897,7 +4897,7 @@ __metadata:
languageName: node
linkType: hard

"klona@npm:^2.0.5":
"klona@npm:^2.0.6":
version: 2.0.6
resolution: "klona@npm:2.0.6"
checksum: 94eed2c6c2ce99f409df9186a96340558897b3e62a85afdc1ee39103954d2ebe1c1c4e9fe2b0952771771fa96d70055ede8b27962a7021406374fdb695fd4d01
Expand Down Expand Up @@ -5052,27 +5052,27 @@ __metadata:
languageName: node
linkType: hard

"mantine-contextmenu@npm:^7.1.11":
version: 7.1.11
resolution: "mantine-contextmenu@npm:7.1.11"
"mantine-contextmenu@npm:^7.1.12":
version: 7.1.12
resolution: "mantine-contextmenu@npm:7.1.12"
peerDependencies:
"@mantine/core": ">=7"
"@mantine/hooks": ">=7"
clsx: ">=2"
react: ">=18.2"
checksum: 84e6139f9137767922d3e101ad4da74a47770dd0d888692a51c296d71c9fb1f3ba9c352c191bdd8e05b155b553fafddd7a9bb961a97ba93e09a614f0c23b5497
checksum: 0f91ab80ce1cbecfdeb600dc89630c65a81a648fd0231931343da3254b6ca6f3a78a066277f40010bcadc5ca231dc89e82161dc3f7d3d5aee932f26b91b20415
languageName: node
linkType: hard

"mantine-datatable@npm:^7.1.5":
version: 7.1.5
resolution: "mantine-datatable@npm:7.1.5"
"mantine-datatable@npm:^7.1.7":
version: 7.1.7
resolution: "mantine-datatable@npm:7.1.7"
peerDependencies:
"@mantine/core": ">=7"
"@mantine/hooks": ">=7"
clsx: ">=2"
react: ">=18.2"
checksum: c9c8de604e72d8baaae4391acf7d4e646637aedf479106bd38c88b7d0697b8c509c10a0c862a7709633ac00a1956fc7eaa910c7bec6a6dd2a27b8159b595a387
checksum: f3dc893b747a758bc533d34cd44bda01864af38d2fe1de8ca024134c6476642f2b64996024febc2cea76b710fdac06915241e0c58064147319463a70597d701e
languageName: node
linkType: hard

Expand Down Expand Up @@ -6349,7 +6349,7 @@ __metadata:
languageName: node
linkType: hard

"react-number-format@npm:^5.2.2":
"react-number-format@npm:^5.3.1":
version: 5.3.1
resolution: "react-number-format@npm:5.3.1"
dependencies:
Expand Down Expand Up @@ -6430,7 +6430,7 @@ __metadata:
languageName: node
linkType: hard

"react-remove-scroll@npm:^2.5.6":
"react-remove-scroll@npm:^2.5.7":
version: 2.5.7
resolution: "react-remove-scroll@npm:2.5.7"
dependencies:
Expand Down
Loading