@edifice.io/collect-frontend 1.0.3 → 1.0.4-develop.1.20260713150108
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/lib/config/constants.d.ts +1 -1
- package/lib/features/creation-wizard/components/FormCreate.d.ts +2 -1
- package/lib/index.js +3737 -3423
- package/lib/services/api/collection.service.d.ts +5 -0
- package/lib/services/api/submission.services.d.ts +5 -0
- package/lib/services/queries/collection.queries.d.ts +9 -0
- package/lib/services/queries/submission.queries.d.ts +11 -0
- package/lib/utils/attachment.d.ts +7 -0
- package/package.json +5 -5
- package/lib/store/submissionActionStore.d.ts +0 -32
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { CreateCollectionDto, SearchCollectionDto, SearchCollectionToSubmitDto, UpdateCollectionDto, UpdateCollectionSharingDto } from '@edifice.io/collect-client-rest';
|
|
2
2
|
export declare const baseURL = "/collect/api";
|
|
3
|
+
export type CollectionAttachmentUploadDto = {
|
|
4
|
+
files: File[];
|
|
5
|
+
};
|
|
3
6
|
export declare const collectionService: {
|
|
4
7
|
getCollections: (query?: SearchCollectionDto) => Promise<import('@edifice.io/collect-client-rest').SearchCollectionResponseDto>;
|
|
5
8
|
getCollectionsToSubmit: (query?: SearchCollectionToSubmitDto) => Promise<import('@edifice.io/collect-client-rest').SearchCollectionStudentViewDto>;
|
|
@@ -11,4 +14,6 @@ export declare const collectionService: {
|
|
|
11
14
|
getCollectionsToSubmitByIds: (ids: number[], query?: SearchCollectionToSubmitDto) => Promise<import('@edifice.io/collect-client-rest').SearchCollectionStudentViewDto>;
|
|
12
15
|
getCollectionsCount: (query?: SearchCollectionDto) => Promise<import('@edifice.io/collect-client-rest').CountCollectionsByStatusDto>;
|
|
13
16
|
getCollectionsToSubmitCount: (query?: SearchCollectionToSubmitDto) => Promise<import('@edifice.io/collect-client-rest').CountStudentSubmissionsByStatusDto>;
|
|
17
|
+
addAttachments: (id: number, files: CollectionAttachmentUploadDto) => Promise<any>;
|
|
18
|
+
deleteAttachment: (collectionId: number, attachmentId: number[]) => Promise<import('@edifice.io/collect-client-rest').CollectionDto>;
|
|
14
19
|
};
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { CreateSubmissionDto, SearchSubmissionDto, UpdateSubmissionStatusDto } from '@edifice.io/collect-client-rest';
|
|
2
2
|
export declare const baseURL = "/collect/api";
|
|
3
|
+
export type SubmissionAttachmentUploadDto = {
|
|
4
|
+
files: File[];
|
|
5
|
+
};
|
|
3
6
|
export declare const submissionService: {
|
|
4
7
|
getSubmissions: (collectionId: number, query?: SearchSubmissionDto) => Promise<import('@edifice.io/collect-client-rest').SearchSubmissionResponseDto>;
|
|
5
8
|
getSubmission: (collectionId: number, submissionId: number) => Promise<import('@edifice.io/collect-client-rest').SubmissionDto | null>;
|
|
6
9
|
updateSubmission: (collectionId: number, submissionId: number, data: CreateSubmissionDto) => Promise<import('@edifice.io/collect-client-rest').SubmissionDto>;
|
|
10
|
+
addAttachments: (collectionId: number, submissionId: number, files: SubmissionAttachmentUploadDto) => Promise<any>;
|
|
7
11
|
updateSubmissionStatus: (collectionId: number, submissionId: number, data: UpdateSubmissionStatusDto) => Promise<import('@edifice.io/collect-client-rest').SubmissionDto>;
|
|
12
|
+
deleteAttachment: (collectionId: number, submissionId: number, attachmentId: number[]) => Promise<import('@edifice.io/collect-client-rest').SubmissionDto>;
|
|
8
13
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CreateCollectionDto, SearchCollectionDto, SearchCollectionToSubmitDto, UpdateCollectionDto, UpdateCollectionSharingDto } from '@edifice.io/collect-client-rest';
|
|
2
|
+
import { CollectionAttachmentUploadDto } from '../api/collection.service';
|
|
2
3
|
export declare const collectionsQueryOptions: {
|
|
3
4
|
base: readonly ["collections"];
|
|
4
5
|
baseToSubmit: readonly ["collectionsToSubmit"];
|
|
@@ -74,3 +75,11 @@ export declare const collectionsToSubmitCountByIdsQueryOptions: (query?: SearchC
|
|
|
74
75
|
enabled: boolean;
|
|
75
76
|
};
|
|
76
77
|
export declare const useCollectionsToSubmitCountByIds: (query?: SearchCollectionToSubmitDto) => import('@tanstack/react-query').UseQueryResult<import('@edifice.io/collect-client-rest').CountStudentSubmissionsByStatusDto, Error>;
|
|
78
|
+
export declare const useAddAttachments: () => import('@tanstack/react-query').UseMutationResult<any, Error, {
|
|
79
|
+
id: number;
|
|
80
|
+
files: CollectionAttachmentUploadDto;
|
|
81
|
+
}, unknown>;
|
|
82
|
+
export declare const useDeleteCollectionAttachment: () => import('@tanstack/react-query').UseMutationResult<import('@edifice.io/collect-client-rest').CollectionDto, Error, {
|
|
83
|
+
collectionId: number;
|
|
84
|
+
attachmentId: number[];
|
|
85
|
+
}, unknown>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CreateSubmissionDto, SearchSubmissionDto, UpdateSubmissionStatusDto } from '@edifice.io/collect-client-rest';
|
|
2
|
+
import { SubmissionAttachmentUploadDto } from '../api/submission.services';
|
|
2
3
|
export declare const submissionsQueryOptions: {
|
|
3
4
|
base: readonly ["submissions"];
|
|
4
5
|
};
|
|
@@ -34,3 +35,13 @@ export declare const useUpdateSubmissionStatus: () => import('@tanstack/react-qu
|
|
|
34
35
|
submissionId: number;
|
|
35
36
|
data: UpdateSubmissionStatusDto;
|
|
36
37
|
}, unknown>;
|
|
38
|
+
export declare const useAddAttachmentsSubmission: () => import('@tanstack/react-query').UseMutationResult<any, Error, {
|
|
39
|
+
collectionId: number;
|
|
40
|
+
submissionId: number;
|
|
41
|
+
files: SubmissionAttachmentUploadDto;
|
|
42
|
+
}, unknown>;
|
|
43
|
+
export declare const useDeleteSubmissionAttachment: () => import('@tanstack/react-query').UseMutationResult<import('@edifice.io/collect-client-rest').SubmissionDto, Error, {
|
|
44
|
+
collectionId: number;
|
|
45
|
+
submissionId: number;
|
|
46
|
+
attachmentId: number[];
|
|
47
|
+
}, unknown>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AttachmentDto } from '@edifice.io/collect-client-rest';
|
|
2
|
+
import { SingleAttachmentType } from '@edifice.io/react';
|
|
3
|
+
export declare const parseAttachmentSize: (size?: string) => number;
|
|
4
|
+
export declare const mapAttachmentDtoToUiAttachment: (attachment: AttachmentDto) => SingleAttachmentType;
|
|
5
|
+
export declare const mapAttachmentDtosToUiAttachments: (attachments?: AttachmentDto[]) => SingleAttachmentType[];
|
|
6
|
+
export declare const buildCollectionAttachmentDownloadUrl: (collectionId: number, attachmentId: string) => string;
|
|
7
|
+
export declare const buildSubmissionAttachmentDownloadUrl: (collectionId: number, submissionId: number, attachmentId: string) => string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edifice.io/collect-frontend",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4-develop.1.20260713150108",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
6
|
"author": "Edifice",
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@edifice.io/collect-client-rest": "workspace:*",
|
|
30
|
-
"@edifice.io/bootstrap": "
|
|
31
|
-
"@edifice.io/client": "
|
|
32
|
-
"@edifice.io/react": "
|
|
30
|
+
"@edifice.io/bootstrap": "develop",
|
|
31
|
+
"@edifice.io/client": "develop",
|
|
32
|
+
"@edifice.io/react": "develop",
|
|
33
33
|
"@react-spring/web": "9.7.5",
|
|
34
34
|
"@tanstack/react-query": "5.81.5",
|
|
35
35
|
"@uidotdev/usehooks": "2.4.1",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"clsx": "2.1.1",
|
|
38
38
|
"i18next": "23.8.1",
|
|
39
39
|
"i18next-http-backend": "2.4.2",
|
|
40
|
-
"ode-explorer": "
|
|
40
|
+
"ode-explorer": "develop",
|
|
41
41
|
"pdfjs-dist": "5.4.394",
|
|
42
42
|
"react": "18.3.1",
|
|
43
43
|
"react-dom": "18.3.1",
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { SubmissionDto } from '@edifice.io/collect-client-rest';
|
|
2
|
-
interface SubmissionActionState {
|
|
3
|
-
submissionId: number | null;
|
|
4
|
-
submissionContent: string;
|
|
5
|
-
isUpdateSubmissionModalOpen: boolean;
|
|
6
|
-
submissionHasContent: boolean;
|
|
7
|
-
submissionIsLoading: boolean;
|
|
8
|
-
onOpenUpdateSubmissionModal: () => void;
|
|
9
|
-
onCloseUpdateSubmissionModal: () => void;
|
|
10
|
-
setSubmissionData: (content: string, hasContent: boolean) => void;
|
|
11
|
-
setSubmissionIsLoading: (isLoading: boolean) => void;
|
|
12
|
-
hydrateSubmissionContent: (submission: SubmissionDto) => void;
|
|
13
|
-
}
|
|
14
|
-
export declare const useSubmissionActionStore: {
|
|
15
|
-
(): SubmissionActionState;
|
|
16
|
-
<U>(selector: (state: SubmissionActionState) => U): U;
|
|
17
|
-
<U>(selector: (state: SubmissionActionState) => U, equalityFn: (a: U, b: U) => boolean): U;
|
|
18
|
-
} & import('zustand').StoreApi<SubmissionActionState> & {
|
|
19
|
-
use: {
|
|
20
|
-
submissionId: () => number | null;
|
|
21
|
-
submissionContent: () => string;
|
|
22
|
-
isUpdateSubmissionModalOpen: () => boolean;
|
|
23
|
-
submissionHasContent: () => boolean;
|
|
24
|
-
submissionIsLoading: () => boolean;
|
|
25
|
-
onOpenUpdateSubmissionModal: () => () => void;
|
|
26
|
-
onCloseUpdateSubmissionModal: () => () => void;
|
|
27
|
-
setSubmissionData: () => (content: string, hasContent: boolean) => void;
|
|
28
|
-
setSubmissionIsLoading: () => (isLoading: boolean) => void;
|
|
29
|
-
hydrateSubmissionContent: () => (submission: SubmissionDto) => void;
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
export {};
|