@tumaet/prompt-shared-state 1.0.13 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/env.js +71 -0
- package/dist/env.js.map +1 -0
- package/dist/hooks/index.js +9 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/useFileUpload.js +33 -0
- package/dist/hooks/useFileUpload.js.map +1 -0
- package/dist/hooks/useGetCoursePhase.js +11 -0
- package/dist/hooks/useGetCoursePhase.js.map +1 -0
- package/dist/hooks/useGetCoursePhaseParticipants.js +12 -0
- package/dist/hooks/useGetCoursePhaseParticipants.js.map +1 -0
- package/dist/hooks/useGetMailingIsConfigured.js +19 -0
- package/dist/hooks/useGetMailingIsConfigured.js.map +1 -0
- package/dist/hooks/useModifyCoursePhase.js +20 -0
- package/dist/hooks/useModifyCoursePhase.js.map +1 -0
- package/dist/hooks/useUpdateCoursePhaseMetaData.js +47 -0
- package/dist/hooks/useUpdateCoursePhaseMetaData.js.map +1 -0
- package/dist/hooks/useUpdateCoursePhaseParticipation.js +61 -0
- package/dist/hooks/useUpdateCoursePhaseParticipation.js.map +1 -0
- package/dist/hooks/useUpdateCoursePhaseParticipationBatch.js +17 -0
- package/dist/hooks/useUpdateCoursePhaseParticipationBatch.js.map +1 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/interfaces/index.js +1 -0
- package/dist/interfaces/index.js.map +1 -1
- package/dist/interfaces/routing/extendedRouteObject.js +2 -0
- package/dist/interfaces/routing/extendedRouteObject.js.map +1 -0
- package/dist/interfaces/routing/index.js +4 -0
- package/dist/interfaces/routing/index.js.map +1 -0
- package/dist/interfaces/routing/sidebar.js +2 -0
- package/dist/interfaces/routing/sidebar.js.map +1 -0
- package/dist/interfaces/routing/studentDetail.js +2 -0
- package/dist/interfaces/routing/studentDetail.js.map +1 -0
- package/dist/lib/formatFileSize.js +9 -0
- package/dist/lib/formatFileSize.js.map +1 -0
- package/dist/lib/getCountries.js +15 -0
- package/dist/lib/getCountries.js.map +1 -0
- package/dist/lib/getGravatarUrl.js +7 -0
- package/dist/lib/getGravatarUrl.js.map +1 -0
- package/dist/lib/getStatusColor.js +13 -0
- package/dist/lib/getStatusColor.js.map +1 -0
- package/dist/lib/index.js +7 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/openFileDownload.js +17 -0
- package/dist/lib/openFileDownload.js.map +1 -0
- package/dist/lib/translations.json +18 -0
- package/dist/network/configService.js +23 -0
- package/dist/network/configService.js.map +1 -0
- package/dist/network/index.js +12 -0
- package/dist/network/index.js.map +1 -0
- package/dist/network/logNetworkError.js +21 -0
- package/dist/network/logNetworkError.js.map +1 -0
- package/dist/network/mutations/deleteApplicationFile.js +11 -0
- package/dist/network/mutations/deleteApplicationFile.js.map +1 -0
- package/dist/network/mutations/sendStatusMail.js +16 -0
- package/dist/network/mutations/sendStatusMail.js.map +1 -0
- package/dist/network/mutations/updateCoursePhase.js +16 -0
- package/dist/network/mutations/updateCoursePhase.js.map +1 -0
- package/dist/network/mutations/updateCoursePhaseParticipationBatch.js +16 -0
- package/dist/network/mutations/updateCoursePhaseParticipationBatch.js.map +1 -0
- package/dist/network/mutations/updateCoursePhaseParticipationMetaData.js +16 -0
- package/dist/network/mutations/updateCoursePhaseParticipationMetaData.js.map +1 -0
- package/dist/network/mutations/uploadFile.js +40 -0
- package/dist/network/mutations/uploadFile.js.map +1 -0
- package/dist/network/queries/getCoursePhase.js +12 -0
- package/dist/network/queries/getCoursePhase.js.map +1 -0
- package/dist/network/queries/getCoursePhaseParticipationStatusCounts.js +13 -0
- package/dist/network/queries/getCoursePhaseParticipationStatusCounts.js.map +1 -0
- package/dist/network/queries/getCoursePhaseParticipations.js +12 -0
- package/dist/network/queries/getCoursePhaseParticipations.js.map +1 -0
- package/dist/network/queries/getOwnCoursePhaseParticipation.js +12 -0
- package/dist/network/queries/getOwnCoursePhaseParticipation.js.map +1 -0
- package/dist/types/env.d.ts +28 -0
- package/dist/types/hooks/index.d.ts +8 -0
- package/dist/types/hooks/useFileUpload.d.ts +13 -0
- package/dist/types/hooks/useGetCoursePhase.d.ts +2 -0
- package/dist/types/hooks/useGetCoursePhaseParticipants.d.ts +2 -0
- package/dist/types/hooks/useGetMailingIsConfigured.d.ts +1 -0
- package/dist/types/hooks/useModifyCoursePhase.d.ts +2 -0
- package/dist/types/hooks/useUpdateCoursePhaseMetaData.d.ts +7 -0
- package/dist/types/hooks/useUpdateCoursePhaseParticipation.d.ts +7 -0
- package/dist/types/hooks/useUpdateCoursePhaseParticipationBatch.d.ts +3 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/interfaces/index.d.ts +1 -0
- package/dist/types/interfaces/routing/extendedRouteObject.d.ts +5 -0
- package/dist/types/interfaces/routing/index.d.ts +3 -0
- package/dist/types/interfaces/routing/sidebar.d.ts +13 -0
- package/dist/types/interfaces/routing/studentDetail.d.ts +6 -0
- package/dist/types/lib/formatFileSize.d.ts +1 -0
- package/dist/types/lib/getCountries.d.ts +5 -0
- package/dist/types/lib/getGravatarUrl.d.ts +1 -0
- package/dist/types/lib/getStatusColor.d.ts +2 -0
- package/dist/types/lib/index.d.ts +6 -0
- package/dist/types/lib/openFileDownload.d.ts +6 -0
- package/dist/types/network/configService.d.ts +8 -0
- package/dist/types/network/index.d.ts +11 -0
- package/dist/types/network/logNetworkError.d.ts +1 -0
- package/dist/types/network/mutations/deleteApplicationFile.d.ts +1 -0
- package/dist/types/network/mutations/sendStatusMail.d.ts +2 -0
- package/dist/types/network/mutations/updateCoursePhase.d.ts +2 -0
- package/dist/types/network/mutations/updateCoursePhaseParticipationBatch.d.ts +2 -0
- package/dist/types/network/mutations/updateCoursePhaseParticipationMetaData.d.ts +2 -0
- package/dist/types/network/mutations/uploadFile.d.ts +25 -0
- package/dist/types/network/queries/getCoursePhase.d.ts +2 -0
- package/dist/types/network/queries/getCoursePhaseParticipationStatusCounts.d.ts +4 -0
- package/dist/types/network/queries/getCoursePhaseParticipations.d.ts +2 -0
- package/dist/types/network/queries/getOwnCoursePhaseParticipation.d.ts +2 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/utils/parseURL.d.ts +1 -0
- package/dist/utils/index.js +2 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/parseURL.js +15 -0
- package/dist/utils/parseURL.js.map +1 -0
- package/package.json +19 -4
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { axiosInstance } from '../configService';
|
|
2
|
+
export const deleteApplicationFile = async (coursePhaseId, fileId) => {
|
|
3
|
+
if (!coursePhaseId) {
|
|
4
|
+
throw new Error('coursePhaseId is required to delete a file');
|
|
5
|
+
}
|
|
6
|
+
if (!fileId) {
|
|
7
|
+
throw new Error('fileId is required to delete a file');
|
|
8
|
+
}
|
|
9
|
+
await axiosInstance.delete(`/api/apply/authenticated/${coursePhaseId}/files/${fileId}`);
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=deleteApplicationFile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deleteApplicationFile.js","sourceRoot":"","sources":["../../../src/network/mutations/deleteApplicationFile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAEhD,MAAM,CAAC,MAAM,qBAAqB,GAAG,KAAK,EACxC,aAAqB,EACrB,MAAc,EACC,EAAE;IACjB,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAA;IAC/D,CAAC;IACD,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAA;IACxD,CAAC;IAED,MAAM,aAAa,CAAC,MAAM,CAAC,4BAA4B,aAAa,UAAU,MAAM,EAAE,CAAC,CAAA;AACzF,CAAC,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { axiosInstance } from '../configService';
|
|
2
|
+
import { logNetworkError } from '../logNetworkError';
|
|
3
|
+
export const sendStatusMail = async (coursePhaseID, status) => {
|
|
4
|
+
try {
|
|
5
|
+
return (await axiosInstance.put(`/api/mailing/${coursePhaseID}`, status, {
|
|
6
|
+
headers: {
|
|
7
|
+
'Content-Type': 'application/json',
|
|
8
|
+
},
|
|
9
|
+
})).data;
|
|
10
|
+
}
|
|
11
|
+
catch (err) {
|
|
12
|
+
logNetworkError('Error sending status mail', err);
|
|
13
|
+
throw err;
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=sendStatusMail.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sendStatusMail.js","sourceRoot":"","sources":["../../../src/network/mutations/sendStatusMail.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAEhD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAEpD,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,EACjC,aAAqB,EACrB,MAAsB,EACE,EAAE;IAC1B,IAAI,CAAC;QACH,OAAO,CACL,MAAM,aAAa,CAAC,GAAG,CAAC,gBAAgB,aAAa,EAAE,EAAE,MAAM,EAAE;YAC/D,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;aACnC;SACF,CAAC,CACH,CAAC,IAAI,CAAA;IACR,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,eAAe,CAAC,2BAA2B,EAAE,GAAG,CAAC,CAAA;QACjD,MAAM,GAAG,CAAA;IACX,CAAC;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { axiosInstance } from '../configService';
|
|
2
|
+
import { logNetworkError } from '../logNetworkError';
|
|
3
|
+
export const updateCoursePhase = async (coursePhase) => {
|
|
4
|
+
try {
|
|
5
|
+
return (await axiosInstance.put(`/api/course_phases/${coursePhase.id}`, coursePhase, {
|
|
6
|
+
headers: {
|
|
7
|
+
'Content-Type': 'application/json',
|
|
8
|
+
},
|
|
9
|
+
})).data.id; // try to get the id of the created course
|
|
10
|
+
}
|
|
11
|
+
catch (err) {
|
|
12
|
+
logNetworkError('Error updating course phase', err);
|
|
13
|
+
throw err;
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=updateCoursePhase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"updateCoursePhase.js","sourceRoot":"","sources":["../../../src/network/mutations/updateCoursePhase.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAEpD,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,EACpC,WAA8B,EACD,EAAE;IAC/B,IAAI,CAAC;QACH,OAAO,CACL,MAAM,aAAa,CAAC,GAAG,CAAC,sBAAsB,WAAW,CAAC,EAAE,EAAE,EAAE,WAAW,EAAE;YAC3E,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;aACnC;SACF,CAAC,CACH,CAAC,IAAI,CAAC,EAAE,CAAA,CAAC,0CAA0C;IACtD,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,eAAe,CAAC,6BAA6B,EAAE,GAAG,CAAC,CAAA;QACnD,MAAM,GAAG,CAAA;IACX,CAAC;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { axiosInstance } from '../configService';
|
|
2
|
+
import { logNetworkError } from '../logNetworkError';
|
|
3
|
+
export const updateCoursePhaseParticipationBatch = async (coursePhaseID, updateParticipations) => {
|
|
4
|
+
try {
|
|
5
|
+
await axiosInstance.put(`/api/course_phases/${coursePhaseID}/participations`, updateParticipations, {
|
|
6
|
+
headers: {
|
|
7
|
+
'Content-Type': 'application/json',
|
|
8
|
+
},
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
catch (err) {
|
|
12
|
+
logNetworkError('Error updating course phase participation batch', err);
|
|
13
|
+
throw err;
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=updateCoursePhaseParticipationBatch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"updateCoursePhaseParticipationBatch.js","sourceRoot":"","sources":["../../../src/network/mutations/updateCoursePhaseParticipationBatch.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAGpD,MAAM,CAAC,MAAM,mCAAmC,GAAG,KAAK,EACtD,aAAqB,EACrB,oBAAsD,EACvC,EAAE;IACjB,IAAI,CAAC;QACH,MAAM,aAAa,CAAC,GAAG,CACrB,sBAAsB,aAAa,iBAAiB,EACpD,oBAAoB,EACpB;YACE,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;aACnC;SACF,CACF,CAAA;IACH,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,eAAe,CAAC,iDAAiD,EAAE,GAAG,CAAC,CAAA;QACvE,MAAM,GAAG,CAAA;IACX,CAAC;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { axiosInstance } from '../configService';
|
|
2
|
+
import { logNetworkError } from '../logNetworkError';
|
|
3
|
+
export const updateCoursePhaseParticipation = async (participation) => {
|
|
4
|
+
try {
|
|
5
|
+
return (await axiosInstance.put(`/api/course_phases/${participation.coursePhaseID}/participations/${participation.courseParticipationID}`, participation, {
|
|
6
|
+
headers: {
|
|
7
|
+
'Content-Type': 'application/json',
|
|
8
|
+
},
|
|
9
|
+
})).data.id; // try to get the id of the updated participation
|
|
10
|
+
}
|
|
11
|
+
catch (err) {
|
|
12
|
+
logNetworkError('Error updating course phase participation metadata', err);
|
|
13
|
+
throw err;
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=updateCoursePhaseParticipationMetaData.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"updateCoursePhaseParticipationMetaData.js","sourceRoot":"","sources":["../../../src/network/mutations/updateCoursePhaseParticipationMetaData.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAGpD,MAAM,CAAC,MAAM,8BAA8B,GAAG,KAAK,EACjD,aAA6C,EAChB,EAAE;IAC/B,IAAI,CAAC;QACH,OAAO,CACL,MAAM,aAAa,CAAC,GAAG,CACrB,sBAAsB,aAAa,CAAC,aAAa,mBAAmB,aAAa,CAAC,qBAAqB,EAAE,EACzG,aAAa,EACb;YACE,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;aACnC;SACF,CACF,CACF,CAAC,IAAI,CAAC,EAAE,CAAA,CAAC,iDAAiD;IAC7D,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,eAAe,CAAC,oDAAoD,EAAE,GAAG,CAAC,CAAA;QAC1E,MAAM,GAAG,CAAA;IACX,CAAC;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import axios from 'axios';
|
|
2
|
+
import { axiosInstance } from '../configService';
|
|
3
|
+
export const uploadFile = async (params) => {
|
|
4
|
+
const contentType = params.file.type || 'application/octet-stream';
|
|
5
|
+
try {
|
|
6
|
+
if (!params.coursePhaseId) {
|
|
7
|
+
throw new Error('coursePhaseId is required for file uploads');
|
|
8
|
+
}
|
|
9
|
+
const isAuthenticated = !!localStorage.getItem('jwt_token');
|
|
10
|
+
const basePath = isAuthenticated
|
|
11
|
+
? `/api/apply/authenticated/${params.coursePhaseId}`
|
|
12
|
+
: `/api/apply/${params.coursePhaseId}`;
|
|
13
|
+
const presignResponse = await axiosInstance.post(`${basePath}/files/presign`, {
|
|
14
|
+
filename: params.file.name,
|
|
15
|
+
contentType,
|
|
16
|
+
description: params.description,
|
|
17
|
+
tags: params.tags,
|
|
18
|
+
});
|
|
19
|
+
const { uploadUrl, storageKey } = presignResponse.data;
|
|
20
|
+
await axios.put(uploadUrl, params.file, {
|
|
21
|
+
headers: {
|
|
22
|
+
'Content-Type': contentType,
|
|
23
|
+
},
|
|
24
|
+
onUploadProgress: params.onUploadProgress,
|
|
25
|
+
});
|
|
26
|
+
const completeResponse = await axiosInstance.post(`${basePath}/files/complete`, {
|
|
27
|
+
storageKey,
|
|
28
|
+
originalFilename: params.file.name,
|
|
29
|
+
contentType,
|
|
30
|
+
description: params.description,
|
|
31
|
+
tags: params.tags,
|
|
32
|
+
});
|
|
33
|
+
return completeResponse.data;
|
|
34
|
+
}
|
|
35
|
+
catch (err) {
|
|
36
|
+
console.error('File upload failed:', err);
|
|
37
|
+
throw err;
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=uploadFile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uploadFile.js","sourceRoot":"","sources":["../../../src/network/mutations/uploadFile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AA4BhD,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,EAAE,MAAwB,EAAyB,EAAE;IAClF,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,IAAI,0BAA0B,CAAA;IAElE,IAAI,CAAC;QACH,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,CAAC;YAC1B,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAA;QAC/D,CAAC;QAED,MAAM,eAAe,GAAG,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,WAAW,CAAC,CAAA;QAC3D,MAAM,QAAQ,GAAG,eAAe;YAC9B,CAAC,CAAC,4BAA4B,MAAM,CAAC,aAAa,EAAE;YACpD,CAAC,CAAC,cAAc,MAAM,CAAC,aAAa,EAAE,CAAA;QAExC,MAAM,eAAe,GAAG,MAAM,aAAa,CAAC,IAAI,CAAC,GAAG,QAAQ,gBAAgB,EAAE;YAC5E,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI;YAC1B,WAAW;YACX,WAAW,EAAE,MAAM,CAAC,WAAW;YAC/B,IAAI,EAAE,MAAM,CAAC,IAAI;SAClB,CAAC,CAAA;QAEF,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,eAAe,CAAC,IAAI,CAAA;QAEtD,MAAM,KAAK,CAAC,GAAG,CAAC,SAAS,EAAE,MAAM,CAAC,IAAI,EAAE;YACtC,OAAO,EAAE;gBACP,cAAc,EAAE,WAAW;aAC5B;YACD,gBAAgB,EAAE,MAAM,CAAC,gBAAgB;SAC1C,CAAC,CAAA;QAEF,MAAM,gBAAgB,GAAG,MAAM,aAAa,CAAC,IAAI,CAAC,GAAG,QAAQ,iBAAiB,EAAE;YAC9E,UAAU;YACV,gBAAgB,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI;YAClC,WAAW;YACX,WAAW,EAAE,MAAM,CAAC,WAAW;YAC/B,IAAI,EAAE,MAAM,CAAC,IAAI;SAClB,CAAC,CAAA;QAEF,OAAO,gBAAgB,CAAC,IAAI,CAAA;IAC9B,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,CAAC,KAAK,CAAC,qBAAqB,EAAE,GAAG,CAAC,CAAA;QACzC,MAAM,GAAG,CAAA;IACX,CAAC;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { axiosInstance } from '../configService';
|
|
2
|
+
import { logNetworkError } from '../logNetworkError';
|
|
3
|
+
export const getCoursePhase = async (coursePhaseID) => {
|
|
4
|
+
try {
|
|
5
|
+
return (await axiosInstance.get(`/api/course_phases/${coursePhaseID}`)).data;
|
|
6
|
+
}
|
|
7
|
+
catch (err) {
|
|
8
|
+
logNetworkError('Error fetching course phase', err);
|
|
9
|
+
throw err;
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=getCoursePhase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getCoursePhase.js","sourceRoot":"","sources":["../../../src/network/queries/getCoursePhase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAGpD,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,EAAE,aAAqB,EAAoC,EAAE;IAC9F,IAAI,CAAC;QACH,OAAO,CAAC,MAAM,aAAa,CAAC,GAAG,CAAC,sBAAsB,aAAa,EAAE,CAAC,CAAC,CAAC,IAAI,CAAA;IAC9E,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,eAAe,CAAC,6BAA6B,EAAE,GAAG,CAAC,CAAA;QACnD,MAAM,GAAG,CAAA;IACX,CAAC;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { axiosInstance } from '../configService';
|
|
2
|
+
import { logNetworkError } from '../logNetworkError';
|
|
3
|
+
export const getCoursePhaseParticipationStatusCounts = async (phaseId) => {
|
|
4
|
+
try {
|
|
5
|
+
const data = (await axiosInstance.get(`/api/course_phases/${phaseId}/participation_status_counts`)).data;
|
|
6
|
+
return data;
|
|
7
|
+
}
|
|
8
|
+
catch (err) {
|
|
9
|
+
logNetworkError('Error fetching course phase participation status counts', err);
|
|
10
|
+
throw err;
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=getCoursePhaseParticipationStatusCounts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getCoursePhaseParticipationStatusCounts.js","sourceRoot":"","sources":["../../../src/network/queries/getCoursePhaseParticipationStatusCounts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAMpD,MAAM,CAAC,MAAM,uCAAuC,GAAG,KAAK,EAC1D,OAAe,EACgC,EAAE;IACjD,IAAI,CAAC;QACH,MAAM,IAAI,GAAyC,CACjD,MAAM,aAAa,CAAC,GAAG,CAAC,sBAAsB,OAAO,8BAA8B,CAAC,CACrF,CAAC,IAAI,CAAA;QACN,OAAO,IAAI,CAAA;IACb,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,eAAe,CAAC,yDAAyD,EAAE,GAAG,CAAC,CAAA;QAC/E,MAAM,GAAG,CAAA;IACX,CAAC;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { axiosInstance } from '../configService';
|
|
2
|
+
import { logNetworkError } from '../logNetworkError';
|
|
3
|
+
export const getCoursePhaseParticipations = async (coursePhaseID) => {
|
|
4
|
+
try {
|
|
5
|
+
return (await axiosInstance.get(`/api/course_phases/${coursePhaseID}/participations`)).data;
|
|
6
|
+
}
|
|
7
|
+
catch (err) {
|
|
8
|
+
logNetworkError('Error fetching course phase participations', err);
|
|
9
|
+
throw err;
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=getCoursePhaseParticipations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getCoursePhaseParticipations.js","sourceRoot":"","sources":["../../../src/network/queries/getCoursePhaseParticipations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAGpD,MAAM,CAAC,MAAM,4BAA4B,GAAG,KAAK,EAC/C,aAAqB,EAC6B,EAAE;IACpD,IAAI,CAAC;QACH,OAAO,CAAC,MAAM,aAAa,CAAC,GAAG,CAAC,sBAAsB,aAAa,iBAAiB,CAAC,CAAC,CAAC,IAAI,CAAA;IAC7F,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,eAAe,CAAC,4CAA4C,EAAE,GAAG,CAAC,CAAA;QAClE,MAAM,GAAG,CAAA;IACX,CAAC;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { axiosInstance } from '../configService';
|
|
2
|
+
import { logNetworkError } from '../logNetworkError';
|
|
3
|
+
export const getOwnCoursePhaseParticipation = async (coursePhaseID) => {
|
|
4
|
+
try {
|
|
5
|
+
return (await axiosInstance.get(`/api/course_phases/${coursePhaseID}/participations/self`)).data;
|
|
6
|
+
}
|
|
7
|
+
catch (err) {
|
|
8
|
+
logNetworkError('Error fetching own course phase participation', err);
|
|
9
|
+
throw err;
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=getOwnCoursePhaseParticipation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getOwnCoursePhaseParticipation.js","sourceRoot":"","sources":["../../../src/network/queries/getOwnCoursePhaseParticipation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAGpD,MAAM,CAAC,MAAM,8BAA8B,GAAG,KAAK,EACjD,aAAqB,EACyB,EAAE;IAChD,IAAI,CAAC;QACH,OAAO,CAAC,MAAM,aAAa,CAAC,GAAG,CAAC,sBAAsB,aAAa,sBAAsB,CAAC,CAAC,CAAC,IAAI,CAAA;IAClG,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,eAAe,CAAC,+CAA+C,EAAE,GAAG,CAAC,CAAA;QACrE,MAAM,GAAG,CAAA;IACX,CAAC;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
type Environment = 'development' | 'staging' | 'production';
|
|
2
|
+
type EnvType = {
|
|
3
|
+
ENVIRONMENT: Environment;
|
|
4
|
+
CORE_HOST: string;
|
|
5
|
+
INTRO_COURSE_HOST: string;
|
|
6
|
+
TEAM_ALLOCATION_HOST: string;
|
|
7
|
+
ASSESSMENT_HOST: string;
|
|
8
|
+
DEVOPS_CHALLENGE_HOST: string;
|
|
9
|
+
INTERVIEW_HOST: string;
|
|
10
|
+
KEYCLOAK_HOST: string;
|
|
11
|
+
KEYCLOAK_REALM_NAME: string;
|
|
12
|
+
CHAIR_NAME_LONG: string;
|
|
13
|
+
CHAIR_NAME_SHORT: string;
|
|
14
|
+
GITHUB_SHA: string;
|
|
15
|
+
GITHUB_REF: string;
|
|
16
|
+
SERVER_IMAGE_TAG: string;
|
|
17
|
+
SELF_TEAM_ALLOCATION_HOST: string;
|
|
18
|
+
TEMPLATE_HOST: string;
|
|
19
|
+
CERTIFICATE_HOST: string;
|
|
20
|
+
SENTRY_DSN_CLIENT: string;
|
|
21
|
+
};
|
|
22
|
+
declare global {
|
|
23
|
+
interface Window {
|
|
24
|
+
env: Partial<EnvType>;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export declare const env: EnvType;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './useFileUpload';
|
|
2
|
+
export * from './useGetCoursePhase';
|
|
3
|
+
export * from './useGetCoursePhaseParticipants';
|
|
4
|
+
export * from './useGetMailingIsConfigured';
|
|
5
|
+
export * from './useModifyCoursePhase';
|
|
6
|
+
export * from './useUpdateCoursePhaseMetaData';
|
|
7
|
+
export * from './useUpdateCoursePhaseParticipation';
|
|
8
|
+
export * from './useUpdateCoursePhaseParticipationBatch';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { UseMutationResult } from '@tanstack/react-query';
|
|
2
|
+
import { FileUploadParams, FileResponse } from '../network/mutations/uploadFile';
|
|
3
|
+
interface UseFileUploadOptions {
|
|
4
|
+
onSuccess?: (data: FileResponse) => void;
|
|
5
|
+
onError?: (error: Error) => void;
|
|
6
|
+
}
|
|
7
|
+
interface UseFileUploadReturn {
|
|
8
|
+
upload: UseMutationResult<FileResponse, Error, FileUploadParams, unknown>;
|
|
9
|
+
uploadProgress: number;
|
|
10
|
+
isUploading: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare const useFileUpload: (options?: UseFileUploadOptions) => UseFileUploadReturn;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useGetMailingIsConfigured: () => boolean;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { UseMutationResult } from '@tanstack/react-query';
|
|
2
|
+
import { UpdateCoursePhase, CoursePhaseWithMetaData } from '../interfaces';
|
|
3
|
+
interface MutationContext {
|
|
4
|
+
previousCoursePhase?: CoursePhaseWithMetaData;
|
|
5
|
+
}
|
|
6
|
+
export declare const useUpdateCoursePhaseMetaData: () => UseMutationResult<string | undefined, Error, UpdateCoursePhase, MutationContext>;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { UseMutationResult } from '@tanstack/react-query';
|
|
2
|
+
import { UpdateCoursePhaseParticipation, CoursePhaseParticipationWithStudent, CoursePhaseParticipationsWithResolution } from '../interfaces';
|
|
3
|
+
interface MutationContext {
|
|
4
|
+
previousParticipants?: CoursePhaseParticipationsWithResolution | CoursePhaseParticipationWithStudent[];
|
|
5
|
+
}
|
|
6
|
+
export declare const useUpdateCoursePhaseParticipation: () => UseMutationResult<string | undefined, Error, UpdateCoursePhaseParticipation, MutationContext>;
|
|
7
|
+
export {};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Role } from '..';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
export interface SidebarMenuItemProps {
|
|
4
|
+
goToPath: string;
|
|
5
|
+
icon: ReactNode;
|
|
6
|
+
title: string;
|
|
7
|
+
requiredPermissions?: Role[];
|
|
8
|
+
subitems?: {
|
|
9
|
+
goToPath: string;
|
|
10
|
+
title: string;
|
|
11
|
+
requiredPermissions?: Role[];
|
|
12
|
+
}[];
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const formatFileSize: (bytes: number) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getGravatarUrl: (email: string, size?: number) => string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface Patch {
|
|
2
|
+
op: 'replace' | 'add' | 'remove' | 'copy';
|
|
3
|
+
path: string;
|
|
4
|
+
value: string;
|
|
5
|
+
}
|
|
6
|
+
declare const authenticatedAxiosInstance: import("axios").AxiosInstance;
|
|
7
|
+
declare const notAuthenticatedAxiosInstance: import("axios").AxiosInstance;
|
|
8
|
+
export { authenticatedAxiosInstance as axiosInstance, notAuthenticatedAxiosInstance };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from './configService';
|
|
2
|
+
export * from './mutations/deleteApplicationFile';
|
|
3
|
+
export * from './mutations/sendStatusMail';
|
|
4
|
+
export * from './mutations/updateCoursePhase';
|
|
5
|
+
export * from './mutations/updateCoursePhaseParticipationBatch';
|
|
6
|
+
export * from './mutations/updateCoursePhaseParticipationMetaData';
|
|
7
|
+
export * from './mutations/uploadFile';
|
|
8
|
+
export * from './queries/getCoursePhase';
|
|
9
|
+
export * from './queries/getCoursePhaseParticipationStatusCounts';
|
|
10
|
+
export * from './queries/getCoursePhaseParticipations';
|
|
11
|
+
export * from './queries/getOwnCoursePhaseParticipation';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const logNetworkError: (message: string, err: unknown) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const deleteApplicationFile: (coursePhaseId: string, fileId: string) => Promise<void>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface FileUploadParams {
|
|
2
|
+
file: File;
|
|
3
|
+
coursePhaseId?: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
tags?: string;
|
|
6
|
+
onUploadProgress?: (progressEvent: any) => void;
|
|
7
|
+
}
|
|
8
|
+
export interface FileResponse {
|
|
9
|
+
id: string;
|
|
10
|
+
filename: string;
|
|
11
|
+
originalFilename: string;
|
|
12
|
+
contentType: string;
|
|
13
|
+
sizeBytes: number;
|
|
14
|
+
storageKey: string;
|
|
15
|
+
downloadUrl: string;
|
|
16
|
+
uploadedByUserId: string;
|
|
17
|
+
uploadedByEmail?: string;
|
|
18
|
+
applicationId?: string;
|
|
19
|
+
coursePhaseId?: string;
|
|
20
|
+
description?: string;
|
|
21
|
+
tags?: string[];
|
|
22
|
+
createdAt: string;
|
|
23
|
+
updatedAt: string;
|
|
24
|
+
}
|
|
25
|
+
export declare const uploadFile: (params: FileUploadParams) => Promise<FileResponse>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './parseURL';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const parseURL: (envURL: string) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export const parseURL = (envURL) => {
|
|
2
|
+
if (envURL === '') {
|
|
3
|
+
if (typeof window !== 'undefined') {
|
|
4
|
+
return window.location.origin; // defaults to location
|
|
5
|
+
}
|
|
6
|
+
return '';
|
|
7
|
+
}
|
|
8
|
+
else if (envURL.startsWith('http')) {
|
|
9
|
+
return envURL; // absolute URL
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
return `https://${envURL}`; // relative URL
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=parseURL.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseURL.js","sourceRoot":"","sources":["../../src/utils/parseURL.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,MAAc,EAAU,EAAE;IACjD,IAAI,MAAM,KAAK,EAAE,EAAE,CAAC;QAClB,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;YAClC,OAAO,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAA,CAAC,uBAAuB;QACvD,CAAC;QAED,OAAO,EAAE,CAAA;IACX,CAAC;SAAM,IAAI,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;QACrC,OAAO,MAAM,CAAA,CAAC,eAAe;IAC/B,CAAC;SAAM,CAAC;QACN,OAAO,WAAW,MAAM,EAAE,CAAA,CAAC,eAAe;IAC5C,CAAC;AACH,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tumaet/prompt-shared-state",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/prompt-edu/prompt-shared-state.git"
|
|
@@ -10,7 +10,10 @@
|
|
|
10
10
|
"types": "./dist/types/index.d.ts",
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"exports": {
|
|
13
|
-
".":
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./dist/types/index.d.ts",
|
|
15
|
+
"default": "./dist/index.js"
|
|
16
|
+
},
|
|
14
17
|
"./*": "./dist/*"
|
|
15
18
|
},
|
|
16
19
|
"files": [
|
|
@@ -23,17 +26,29 @@
|
|
|
23
26
|
},
|
|
24
27
|
"packageManager": "yarn@4.14.1",
|
|
25
28
|
"dependencies": {
|
|
29
|
+
"axios": "^1.15.2",
|
|
30
|
+
"i18n-iso-countries": "^7.14.0",
|
|
31
|
+
"js-sha256": "^0.11.1",
|
|
26
32
|
"typescript": "^5.9.3",
|
|
27
33
|
"zustand": "^5.0.12"
|
|
28
34
|
},
|
|
35
|
+
"peerDependencies": {
|
|
36
|
+
"@tanstack/react-query": "^5.99.2",
|
|
37
|
+
"react": "^19.2.5",
|
|
38
|
+
"react-router-dom": "^7.14.1"
|
|
39
|
+
},
|
|
29
40
|
"devDependencies": {
|
|
41
|
+
"@tanstack/react-query": "^5.99.2",
|
|
42
|
+
"@types/react": "^19.2.14",
|
|
30
43
|
"@typescript-eslint/eslint-plugin": "^8.59.0",
|
|
31
44
|
"@typescript-eslint/parser": "^8.59.0",
|
|
32
|
-
"eslint": "^
|
|
45
|
+
"eslint": "^9.39.4",
|
|
33
46
|
"eslint-plugin-prettier": "^5.5.5",
|
|
34
47
|
"eslint-plugin-react": "^7.37.5",
|
|
35
48
|
"eslint-plugin-react-hooks": "^7.1.1",
|
|
36
49
|
"globals": "^17.5.0",
|
|
37
|
-
"prettier": "^3.8.3"
|
|
50
|
+
"prettier": "^3.8.3",
|
|
51
|
+
"react": "^19.2.5",
|
|
52
|
+
"react-router-dom": "^7.14.1"
|
|
38
53
|
}
|
|
39
54
|
}
|