@edifice.io/collect-frontend 0.2.2-develop-pedago.3.20260505103631 → 0.2.2-develop-pedago.3.20260505122017
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/components/AppActionHeader.d.ts +1 -0
- package/lib/components/AppHeaderCollection.d.ts +12 -0
- package/lib/components/CollectApp/CollectApp.d.ts +26 -0
- package/lib/components/CollectApp/CollectAppContext.d.ts +13 -0
- package/lib/components/InstructionCard.d.ts +5 -0
- package/lib/components/SearchBarCollect.d.ts +3 -0
- package/lib/components/SubmissionCard.d.ts +7 -0
- package/lib/config/constants.d.ts +6 -0
- package/lib/features/collect-form/components/CollectForm.d.ts +23 -0
- package/lib/features/collect-form/components/index.d.ts +3 -0
- package/lib/features/collect-form/hooks/index.d.ts +2 -0
- package/lib/features/collect-form/hooks/useCreateCollectionForm.d.ts +20 -0
- package/lib/features/collect-form/index.d.ts +2 -0
- package/lib/features/collection-actions/components/CollectionActions.d.ts +4 -0
- package/lib/features/collection-list/components/CollectionListTable.d.ts +1 -0
- package/lib/features/collection-list/components/CollectionListTableBody.d.ts +4 -0
- package/lib/features/collection-list/components/CollectionListTableFooter.d.ts +12 -0
- package/lib/features/collection-list/components/CollectionListTableHead.d.ts +1 -0
- package/lib/features/collection-list/hooks/useCollectionListTableBody.d.ts +7 -0
- package/lib/features/collection-list/hooks/useCollectionListTableHead.d.ts +12 -0
- package/lib/features/collection-list/hooks/useCollectionPagination.d.ts +11 -0
- package/lib/features/collection-list/store/collectionListStore.d.ts +23 -0
- package/lib/features/collection-submissions-list/components/CollectionSubmissionsList.d.ts +4 -0
- package/lib/features/collection-submissions-list/components/CollectionSubmissionsListMobile.d.ts +4 -0
- package/lib/features/collection-submissions-list/components/CollectionSubmissionsListTr.d.ts +4 -0
- package/lib/features/collection-submissions-list/components/CollectionSubmissionsListView.d.ts +4 -0
- package/lib/features/collection-submissions-list/components/CollectionSubmissionsRender.d.ts +3 -0
- package/lib/features/collection-submissions-list/hooks/useCollectionSubmissionsList.d.ts +10 -0
- package/lib/features/collection-submissions-list/store/collectionSubmissionListStore.d.ts +16 -0
- package/lib/features/creation-wizard/CreationWizard.d.ts +2 -0
- package/lib/features/creation-wizard/components/FormCreate.d.ts +7 -0
- package/lib/features/creation-wizard/components/Members.d.ts +9 -0
- package/lib/features/creation-wizard/components/WizardContext.d.ts +8 -0
- package/lib/features/creation-wizard/components/WizardHeader.d.ts +3 -0
- package/lib/features/creation-wizard/components/WizardLayout.d.ts +3 -0
- package/lib/features/creation-wizard/hooks/useAddMember.d.ts +15 -0
- package/lib/features/creation-wizard/sharing.utils.d.ts +6 -0
- package/lib/features/creation-wizard/store/wizardStore.d.ts +15 -0
- package/lib/features/dropdown-actions/components/DropdownActionTable.d.ts +7 -0
- package/lib/features/dropdown-actions/hooks/useDropdownActionTable.d.ts +13 -0
- package/lib/features/menu/components/CollectMenu.d.ts +5 -0
- package/lib/features/menu/components/DesktopMenu.d.ts +1 -0
- package/lib/features/menu/components/MenuContext.d.ts +13 -0
- package/lib/features/menu/components/MobileMenu.d.ts +1 -0
- package/lib/features/menu/store/menuStore.d.ts +20 -0
- package/lib/features/modal/components/DeleteCollectionModal.d.ts +3 -0
- package/lib/features/modal/components/InstructionModal.d.ts +4 -0
- package/lib/features/modal/components/UpdateSubmissionModal.d.ts +9 -0
- package/lib/features/modal/hooks/useDeleteCollectionModal.d.ts +5 -0
- package/lib/features/submission/components/SubmissionEdit.d.ts +4 -0
- package/lib/features/submission/components/SubmissionView.d.ts +5 -0
- package/lib/features/submission-actions/components/SubmissionActions.d.ts +6 -0
- package/lib/features/submission-list/components/SubmissionFilter.d.ts +1 -0
- package/lib/features/submission-list/components/SubmissionsListView.d.ts +1 -0
- package/lib/features/submission-list/hooks/useSubmissionPagination.d.ts +7 -0
- package/lib/features/submission-list/store/submissionListStore.d.ts +22 -0
- package/lib/hooks/useGetStatusSubmission.d.ts +12 -0
- package/lib/hooks/useSearch.d.ts +18 -0
- package/lib/hooks/useStepNavigations.d.ts +5 -0
- package/lib/hooks/useSubmissionForm.d.ts +12 -0
- package/lib/hooks/useWizard.d.ts +13 -0
- package/lib/i18n.d.ts +2 -0
- package/lib/index.d.ts +10 -1
- package/lib/main.d.ts +0 -0
- package/lib/models/collect.d.ts +12 -0
- package/lib/models/menu.d.ts +5 -0
- package/lib/pages/Collection.d.ts +4 -0
- package/lib/pages/CollectionsLayout.d.ts +2 -0
- package/lib/pages/CollectionsList.d.ts +3 -0
- package/lib/pages/FormEdit.d.ts +4 -0
- package/lib/pages/MembersEdit.d.ts +4 -0
- package/lib/pages/NotFound.d.ts +1 -0
- package/lib/pages/PageError.d.ts +1 -0
- package/lib/pages/Root.d.ts +2 -0
- package/lib/pages/Submission.d.ts +4 -0
- package/lib/pages/SubmissionList.d.ts +3 -0
- package/lib/providers/index.d.ts +6 -0
- package/lib/routes/wizard/wizard.d.ts +2 -0
- package/lib/services/api/collection.service.d.ts +11 -0
- package/lib/services/api/submission.services.d.ts +8 -0
- package/lib/services/api/user.service.d.ts +77 -0
- package/lib/services/queries/collection.queries.d.ts +51 -0
- package/lib/services/queries/submission.queries.d.ts +36 -0
- package/lib/services/queries/user.queries.d.ts +68 -0
- package/lib/store/collectionActionStore.d.ts +29 -0
- package/lib/store/createSelectors.d.ts +10 -0
- package/lib/store/submissionActionStore.d.ts +32 -0
- package/lib/store/userActionStore.d.ts +26 -0
- package/package.json +3 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function AppActionHeader(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CollectionDto, ContribSubmissionStatus } from '@edifice.io/collect-client-rest';
|
|
2
|
+
import { CollectionContext } from '../models/collect';
|
|
3
|
+
interface AppHeaderCollectProps {
|
|
4
|
+
collection: CollectionDto;
|
|
5
|
+
context: CollectionContext.COLLECTION | CollectionContext.SUBMISSION;
|
|
6
|
+
onClickBack: () => void;
|
|
7
|
+
handleUpdateSubmission?: ({ status, }: {
|
|
8
|
+
status: ContribSubmissionStatus;
|
|
9
|
+
}) => Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
export declare const AppHeaderCollection: ({ collection, onClickBack, context, handleUpdateSubmission, }: AppHeaderCollectProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface CollectAppProps {
|
|
3
|
+
/**
|
|
4
|
+
* When true, displays the top app header.
|
|
5
|
+
* When false, runs in headless mode (for embedding in other apps).
|
|
6
|
+
* @default true
|
|
7
|
+
*/
|
|
8
|
+
header?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* When true, displays the left/mobile navigation menu.
|
|
11
|
+
* @default true
|
|
12
|
+
*/
|
|
13
|
+
showMenu?: boolean;
|
|
14
|
+
/** Additional CSS class name for the container. */
|
|
15
|
+
className?: string;
|
|
16
|
+
currentPath?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* CollectApp - Main component for the Collect application.
|
|
20
|
+
* Can be used standalone or embedded in another application.
|
|
21
|
+
*
|
|
22
|
+
* When embedded (e.g., in rack), pass header={false} and/or showMenu={false}
|
|
23
|
+
* to control Collect layout visibility.
|
|
24
|
+
*/
|
|
25
|
+
declare const CollectApp: React.FC<CollectAppProps>;
|
|
26
|
+
export default CollectApp;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
interface CollectAppContextType {
|
|
3
|
+
header: boolean;
|
|
4
|
+
showMenu: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare const CollectAppContext: import('react').Context<CollectAppContextType>;
|
|
7
|
+
export declare function CollectAppProvider({ header, showMenu, children, }: {
|
|
8
|
+
header?: boolean;
|
|
9
|
+
showMenu?: boolean;
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare const useCollectAppContext: () => CollectAppContextType;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CollectionSubmissionDto } from '@edifice.io/collect-client-rest';
|
|
2
|
+
type SubmissionCardProps = {
|
|
3
|
+
collectionToSubmit: CollectionSubmissionDto;
|
|
4
|
+
onClick: (event: React.MouseEvent<HTMLDivElement>) => void;
|
|
5
|
+
};
|
|
6
|
+
export declare const SubmissionCard: ({ collectionToSubmit, onClick, }: SubmissionCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const COLLECTIONS_LIST_MAX_RESULTS_BY_PAGES = 100;
|
|
2
|
+
export declare const SUBMISSIONS_LIST_MAX_RESULTS_BY_PAGES = 100;
|
|
3
|
+
export declare const COLLECTION_TABLE_PAGE_SIZE = 100;
|
|
4
|
+
export declare const MAX_COLLECTION_NAME_LENGTH = 80;
|
|
5
|
+
export declare const WIZARD_STORAGE_KEY = "collect-wizard-data";
|
|
6
|
+
export declare const WIZARD_STEPS: string[];
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { CollectionDto } from '@edifice.io/collect-client-rest';
|
|
2
|
+
import { WizardData } from '../../../models/collect';
|
|
3
|
+
/**
|
|
4
|
+
* Reusable collection creation form component.
|
|
5
|
+
* This component can be used by other applications (e.g., community) to embed a collection creation form
|
|
6
|
+
* within their own modals or pages. It handles form state internally and exposes data changes via callbacks.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* <CollectForm
|
|
11
|
+
* onDataChange={(data) => console.log(data)}
|
|
12
|
+
* onValidityChange={(isValid) => setIsValid(isValid)}
|
|
13
|
+
* />
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export interface CollectFormProps {
|
|
17
|
+
initialData?: Partial<WizardData>;
|
|
18
|
+
collection?: CollectionDto;
|
|
19
|
+
onDataChange?: (data: WizardData) => void;
|
|
20
|
+
onValidityChange?: (isValid: boolean) => void;
|
|
21
|
+
}
|
|
22
|
+
declare const CollectForm: React.FC<CollectFormProps>;
|
|
23
|
+
export default CollectForm;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { CollectionDto } from '@edifice.io/collect-client-rest';
|
|
2
|
+
import { WizardData } from '../../../models/collect';
|
|
3
|
+
export interface UseCreateCollectionFormReturn {
|
|
4
|
+
formData: WizardData;
|
|
5
|
+
updateFormData: (updates: Partial<WizardData>) => void;
|
|
6
|
+
resetFormData: () => void;
|
|
7
|
+
isDirty: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const useCreateCollectionForm: () => UseCreateCollectionFormReturn;
|
|
10
|
+
export interface UseCreateCollectionProps {
|
|
11
|
+
onSuccess?: (collection: CollectionDto) => void;
|
|
12
|
+
onError?: (error: Error) => void;
|
|
13
|
+
}
|
|
14
|
+
export interface UseCreateCollectionReturn {
|
|
15
|
+
createCollection: (data: WizardData) => Promise<CollectionDto>;
|
|
16
|
+
isPending: boolean;
|
|
17
|
+
isError: boolean;
|
|
18
|
+
error: Error | null;
|
|
19
|
+
}
|
|
20
|
+
export declare const useCreateCollection: ({ onSuccess, onError, }: UseCreateCollectionProps) => UseCreateCollectionReturn;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const CollectionListTable: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type CollectionListTableFooterProps = {
|
|
2
|
+
page: number;
|
|
3
|
+
totalPages: number;
|
|
4
|
+
canGoPrevious: boolean;
|
|
5
|
+
canGoNext: boolean;
|
|
6
|
+
isLoading?: boolean;
|
|
7
|
+
isFetchingNextPage?: boolean;
|
|
8
|
+
onPagePrevious: () => void;
|
|
9
|
+
onPageNext: () => void;
|
|
10
|
+
};
|
|
11
|
+
export declare const CollectionListTableFooter: ({ page, totalPages, canGoPrevious, canGoNext, isLoading, isFetchingNextPage, onPagePrevious, onPageNext, }: CollectionListTableFooterProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const CollectionListTableHead: () => import("react/jsx-runtime").JSX.Element[];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CollectionDto } from '@edifice.io/collect-client-rest';
|
|
2
|
+
export declare const useCollectionListTableBody: () => {
|
|
3
|
+
isHovered: (collection: CollectionDto) => boolean;
|
|
4
|
+
setHoveredCollectionId: import('react').Dispatch<import('react').SetStateAction<number | null>>;
|
|
5
|
+
getBgColor: (collection: CollectionDto) => string;
|
|
6
|
+
getColorByPercentage: (current: number, total: number) => "success" | "warning" | "danger" | "info";
|
|
7
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CollectionSortField } from '@edifice.io/collect-client-rest';
|
|
2
|
+
interface CollectionTableHeader {
|
|
3
|
+
label: string;
|
|
4
|
+
sortField?: CollectionSortField;
|
|
5
|
+
}
|
|
6
|
+
export declare const useCollectionListTableHead: () => {
|
|
7
|
+
listHeads: CollectionTableHeader[];
|
|
8
|
+
getSortIcon: (tableHead: CollectionTableHeader) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
handleSort: (sortField: CollectionSortField) => void;
|
|
10
|
+
isSortActive: (tableHead: CollectionTableHeader) => boolean | undefined;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const useCollectionPagination: () => {
|
|
2
|
+
items: import('@edifice.io/collect-client-rest').CollectionDto[];
|
|
3
|
+
page: number;
|
|
4
|
+
totalPages: number;
|
|
5
|
+
isLoading: boolean;
|
|
6
|
+
isFetchingNextPage: boolean;
|
|
7
|
+
handlePagePrevious: () => void;
|
|
8
|
+
handlePageNext: () => Promise<void>;
|
|
9
|
+
canGoPrevious: boolean;
|
|
10
|
+
canGoNext: boolean;
|
|
11
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { CollectionSortField, SearchCollectionDto, SortDirection } from '@edifice.io/collect-client-rest';
|
|
2
|
+
interface CollectionListState extends SearchCollectionDto {
|
|
3
|
+
setSearch: (search: string) => void;
|
|
4
|
+
setFilters: (filters: Partial<SearchCollectionDto>) => void;
|
|
5
|
+
setSortCollectionList: (field: CollectionSortField, direction: SortDirection) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const useCollectionListStore: {
|
|
8
|
+
(): CollectionListState;
|
|
9
|
+
<U>(selector: (state: CollectionListState) => U): U;
|
|
10
|
+
<U>(selector: (state: CollectionListState) => U, equalityFn: (a: U, b: U) => boolean): U;
|
|
11
|
+
} & import('zustand').StoreApi<CollectionListState> & {
|
|
12
|
+
use: {
|
|
13
|
+
setSearch: () => (search: string) => void;
|
|
14
|
+
setFilters: () => (filters: Partial<SearchCollectionDto>) => void;
|
|
15
|
+
setSortCollectionList: () => (field: CollectionSortField, direction: SortDirection) => void;
|
|
16
|
+
search?: (() => string | undefined) | undefined;
|
|
17
|
+
sortBy?: (() => CollectionSortField | undefined) | undefined;
|
|
18
|
+
sortDirection?: (() => SortDirection | undefined) | undefined;
|
|
19
|
+
page?: (() => number | undefined) | undefined;
|
|
20
|
+
size?: (() => number | undefined) | undefined;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CollectionDto, SubmissionDto } from '@edifice.io/collect-client-rest';
|
|
2
|
+
export declare const useCollectionSubmissionsList: (collection: CollectionDto) => {
|
|
3
|
+
submissions: SubmissionDto[];
|
|
4
|
+
isLoading: boolean;
|
|
5
|
+
hasNextPage: boolean;
|
|
6
|
+
isHovered: (submission: SubmissionDto) => boolean;
|
|
7
|
+
setHoveredSubmissionId: import('react').Dispatch<import('react').SetStateAction<number | null>>;
|
|
8
|
+
getBgColor: (submission: SubmissionDto) => string;
|
|
9
|
+
fetchNextPage: (options?: import('@tanstack/react-query').FetchNextPageOptions) => Promise<import('@tanstack/react-query').InfiniteQueryObserverResult<import('@tanstack/react-query').InfiniteData<import('@edifice.io/collect-client-rest').SearchSubmissionResponseDto, unknown>, Error>>;
|
|
10
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { SubmissionDto } from '@edifice.io/collect-client-rest';
|
|
2
|
+
interface CollectionSubmissionListState {
|
|
3
|
+
selectedSubmissionListMenu: SubmissionDto | null;
|
|
4
|
+
setSelectedSubmissionListMenu: (submission: SubmissionDto | null) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare const useCollectionSubmissionListStore: {
|
|
7
|
+
(): CollectionSubmissionListState;
|
|
8
|
+
<U>(selector: (state: CollectionSubmissionListState) => U): U;
|
|
9
|
+
<U>(selector: (state: CollectionSubmissionListState) => U, equalityFn: (a: U, b: U) => boolean): U;
|
|
10
|
+
} & import('zustand').StoreApi<CollectionSubmissionListState> & {
|
|
11
|
+
use: {
|
|
12
|
+
selectedSubmissionListMenu: () => SubmissionDto | null;
|
|
13
|
+
setSelectedSubmissionListMenu: () => (submission: SubmissionDto | null) => void;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CollectionDto } from '@edifice.io/collect-client-rest';
|
|
2
|
+
import { WizardData } from '../../../models/collect';
|
|
3
|
+
export declare const FormCreate: ({ wizardData, updateWizardData, collection, }: {
|
|
4
|
+
wizardData?: WizardData;
|
|
5
|
+
updateWizardData?: (data: WizardData) => void;
|
|
6
|
+
collection?: CollectionDto;
|
|
7
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CollectionDto } from '@edifice.io/collect-client-rest';
|
|
2
|
+
import { SharingItem } from '@edifice.io/react';
|
|
3
|
+
import { WizardData } from '../../../models/collect';
|
|
4
|
+
export default function Members({ wizardData, updateWizardData, collection, onSharingsChange, }: {
|
|
5
|
+
wizardData?: WizardData;
|
|
6
|
+
updateWizardData?: (updates: Partial<WizardData>) => void;
|
|
7
|
+
collection?: CollectionDto;
|
|
8
|
+
onSharingsChange?: (sharings: SharingItem[]) => void;
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { useWizardProps } from '../../../hooks/useWizard';
|
|
2
|
+
type OmittedProps = Omit<useWizardProps, "triggerRef" | "menuRef">;
|
|
3
|
+
export interface WizardContextProps extends OmittedProps {
|
|
4
|
+
block?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare const WizardContext: import('react').Context<WizardContextProps | null>;
|
|
7
|
+
export declare const useWizardContext: () => WizardContextProps;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BookmarkInput, SharingItem } from '@edifice.io/react';
|
|
2
|
+
export declare const useAddMember: ({ handleSearchSubmit, initialSharings, onSharingsChange, }: {
|
|
3
|
+
handleSearchSubmit: (model: Array<string | number>) => Promise<SharingItem[] | BookmarkInput[]>;
|
|
4
|
+
initialSharings?: SharingItem[];
|
|
5
|
+
onSharingsChange?: (sharings: SharingItem[]) => void;
|
|
6
|
+
}) => {
|
|
7
|
+
handleAddItems: (items: SharingItem[]) => void;
|
|
8
|
+
handleDeleteItems: (items: SharingItem[]) => void;
|
|
9
|
+
handleUpdateItems: (items: SharingItem[]) => void;
|
|
10
|
+
handleSearchResultsChange: (model: Array<string | number>) => Promise<void>;
|
|
11
|
+
setUsersCollection: (usersCollection: SharingItem[]) => void;
|
|
12
|
+
addUsersToAdd: (items: SharingItem[]) => void;
|
|
13
|
+
addUsersToDelete: (items: SharingItem[]) => void;
|
|
14
|
+
userRightsListRef: import('react').RefObject<import('@edifice.io/react').UserRightsListRef>;
|
|
15
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CreateSharingDto, DeleteSharingDto, SharingDto, UpdateCollectionSharingDto } from '@edifice.io/collect-client-rest';
|
|
2
|
+
import { SharingItem } from '@edifice.io/react';
|
|
3
|
+
export declare const mapCollectionSharingToSharingItem: (sharing: SharingDto) => SharingItem;
|
|
4
|
+
export declare const mapSharingItemToCreateSharingDto: (sharing: SharingItem) => CreateSharingDto;
|
|
5
|
+
export declare const mapSharingItemToDeleteSharingDto: (sharing: SharingItem) => DeleteSharingDto;
|
|
6
|
+
export declare const buildUpdateCollectionSharingDto: (deleteSharings: SharingItem[], newSharings: SharingItem[]) => UpdateCollectionSharingDto;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
interface WizardState {
|
|
2
|
+
isFormValid: boolean;
|
|
3
|
+
setIsFormValid: (isValid: boolean) => void;
|
|
4
|
+
}
|
|
5
|
+
export declare const useWizardStore: {
|
|
6
|
+
(): WizardState;
|
|
7
|
+
<U>(selector: (state: WizardState) => U): U;
|
|
8
|
+
<U>(selector: (state: WizardState) => U, equalityFn: (a: U, b: U) => boolean): U;
|
|
9
|
+
} & import('zustand').StoreApi<WizardState> & {
|
|
10
|
+
use: {
|
|
11
|
+
isFormValid: () => boolean;
|
|
12
|
+
setIsFormValid: () => (isValid: boolean) => void;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IconButtonProps } from '@edifice.io/react';
|
|
2
|
+
import { RefAttributes } from 'react';
|
|
3
|
+
export declare const DropdownActionTable: ({ collectionId, isCollection, children, }: {
|
|
4
|
+
collectionId: number;
|
|
5
|
+
isCollection?: boolean;
|
|
6
|
+
children: (triggerProps: JSX.IntrinsicAttributes & Omit<IconButtonProps, "ref"> & RefAttributes<HTMLButtonElement>) => React.ReactNode;
|
|
7
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
interface TableDropdownMenuOptions {
|
|
3
|
+
label: string;
|
|
4
|
+
action: () => void;
|
|
5
|
+
icon: ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
hidden?: boolean;
|
|
8
|
+
dataTestId?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const useDropdownActionTable: (collectionId: number, isCollection: boolean) => {
|
|
11
|
+
dropdownOptions: TableDropdownMenuOptions[];
|
|
12
|
+
};
|
|
13
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const DesktopMenu: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
interface MenuContextType {
|
|
3
|
+
showMenu: boolean;
|
|
4
|
+
basePath: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const MenuContext: import('react').Context<MenuContextType>;
|
|
7
|
+
export declare function MenuProvider({ showMenu, basePath, children, }: {
|
|
8
|
+
showMenu?: boolean;
|
|
9
|
+
basePath?: string;
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare const useMenuContext: () => MenuContextType;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MobileMenu: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { MenuFilter } from '../../../models/menu';
|
|
2
|
+
interface MenuState {
|
|
3
|
+
mobileMenuOpen: boolean;
|
|
4
|
+
setMobileMenuOpen: (open: boolean) => void;
|
|
5
|
+
selectedMenu: MenuFilter;
|
|
6
|
+
setSelectedMenu: (filter: MenuFilter) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const useMenuStore: {
|
|
9
|
+
(): MenuState;
|
|
10
|
+
<U>(selector: (state: MenuState) => U): U;
|
|
11
|
+
<U>(selector: (state: MenuState) => U, equalityFn: (a: U, b: U) => boolean): U;
|
|
12
|
+
} & import('zustand').StoreApi<MenuState> & {
|
|
13
|
+
use: {
|
|
14
|
+
mobileMenuOpen: () => boolean;
|
|
15
|
+
setMobileMenuOpen: () => (open: boolean) => void;
|
|
16
|
+
selectedMenu: () => MenuFilter;
|
|
17
|
+
setSelectedMenu: () => (filter: MenuFilter) => void;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ContribSubmissionStatus } from '@edifice.io/collect-client-rest';
|
|
2
|
+
export declare const UpdateSubmissionModal: ({ onClose, isOpen, handleUpdateSubmission, }: {
|
|
3
|
+
onClose: () => void;
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
handleUpdateSubmission: ({ status, isRedirect, }: {
|
|
6
|
+
status: ContribSubmissionStatus;
|
|
7
|
+
isRedirect?: boolean;
|
|
8
|
+
}) => Promise<void>;
|
|
9
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ContribSubmissionStatus } from '@edifice.io/collect-client-rest';
|
|
2
|
+
export declare const SubmissionActions: ({ handleUpdateSubmission, }: {
|
|
3
|
+
handleUpdateSubmission?: ({ status, }: {
|
|
4
|
+
status: ContribSubmissionStatus;
|
|
5
|
+
}) => Promise<void>;
|
|
6
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SubmissionFilter: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SubmissionsListView: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const useSubmissionPagination: () => {
|
|
2
|
+
collectionsToSubmit: import('@edifice.io/collect-client-rest').CollectionSubmissionDto[];
|
|
3
|
+
isLoading: boolean;
|
|
4
|
+
hasMoreResources: boolean;
|
|
5
|
+
hasData: boolean;
|
|
6
|
+
fetchNextPage: (options?: import('@tanstack/react-query').FetchNextPageOptions) => Promise<import('@tanstack/react-query').InfiniteQueryObserverResult<import('@tanstack/react-query').InfiniteData<import('@edifice.io/collect-client-rest').SearchCollectionStudentViewDto, unknown>, Error>>;
|
|
7
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { CollectionStatus, SearchCollectionToSubmitDto } from '@edifice.io/collect-client-rest';
|
|
2
|
+
interface SubmissionListState extends SearchCollectionToSubmitDto {
|
|
3
|
+
setSearchSubmission: (search: string) => void;
|
|
4
|
+
setFilter: (filter: CollectionStatus | undefined) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare const useSubmissionListStore: {
|
|
7
|
+
(): SubmissionListState;
|
|
8
|
+
<U>(selector: (state: SubmissionListState) => U): U;
|
|
9
|
+
<U>(selector: (state: SubmissionListState) => U, equalityFn: (a: U, b: U) => boolean): U;
|
|
10
|
+
} & import('zustand').StoreApi<SubmissionListState> & {
|
|
11
|
+
use: {
|
|
12
|
+
setSearchSubmission: () => (search: string) => void;
|
|
13
|
+
setFilter: () => (filter: CollectionStatus | undefined) => void;
|
|
14
|
+
filter?: (() => CollectionStatus | undefined) | undefined;
|
|
15
|
+
search?: (() => string | undefined) | undefined;
|
|
16
|
+
sortBy?: (() => import('@edifice.io/collect-client-rest').CollectionSortField | undefined) | undefined;
|
|
17
|
+
sortDirection?: (() => import('@edifice.io/collect-client-rest').SortDirection | undefined) | undefined;
|
|
18
|
+
page?: (() => number | undefined) | undefined;
|
|
19
|
+
size?: (() => number | undefined) | undefined;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SubmissionStatus } from '@edifice.io/collect-client-rest';
|
|
2
|
+
import { BadgeVariants } from '@edifice.io/react';
|
|
3
|
+
export default function useGetSubmissionStatus(): {
|
|
4
|
+
getSubmissionStatus: ({ status, isPastDeadline, isSubmissionCard, }: {
|
|
5
|
+
status: SubmissionStatus;
|
|
6
|
+
isPastDeadline: boolean;
|
|
7
|
+
isSubmissionCard?: boolean;
|
|
8
|
+
}) => {
|
|
9
|
+
text: string;
|
|
10
|
+
variant: BadgeVariants;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ChangeEvent } from 'react';
|
|
2
|
+
import { BookmarkInput, OptionListItemType, SharingItem } from '@edifice.io/react';
|
|
3
|
+
import { Visible } from '../services/queries/user.queries';
|
|
4
|
+
export declare const useSearch: () => {
|
|
5
|
+
state: {
|
|
6
|
+
searchInputValue: string;
|
|
7
|
+
searchResults: OptionListItemType[];
|
|
8
|
+
searchAPIResults: Visible[];
|
|
9
|
+
isSearching: boolean;
|
|
10
|
+
isAddingMembers: boolean;
|
|
11
|
+
};
|
|
12
|
+
searchMinLength: number;
|
|
13
|
+
isSearchLoading: boolean;
|
|
14
|
+
isAddingMembers: boolean;
|
|
15
|
+
hasSearchNoResults: boolean;
|
|
16
|
+
handleSearchInputChange: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
17
|
+
handleSearchSubmit: (model: Array<string | number>) => Promise<SharingItem[] | BookmarkInput[]>;
|
|
18
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CollectionDto, ContribSubmissionStatus, SubmissionDto } from '@edifice.io/collect-client-rest';
|
|
2
|
+
export declare const useSubmissionForm: ({ collection, submission, }: {
|
|
3
|
+
collection: CollectionDto;
|
|
4
|
+
submission: SubmissionDto;
|
|
5
|
+
}) => {
|
|
6
|
+
isOpen: boolean;
|
|
7
|
+
onClose: () => void;
|
|
8
|
+
handleUpdateSubmission: ({ status, isRedirect, }: {
|
|
9
|
+
status: ContribSubmissionStatus;
|
|
10
|
+
isRedirect?: boolean;
|
|
11
|
+
}) => Promise<void>;
|
|
12
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { WizardData } from '../models/collect';
|
|
2
|
+
export interface useWizardProps {
|
|
3
|
+
wizardData: WizardData;
|
|
4
|
+
updateWizardData: (updates: Partial<WizardData>) => void;
|
|
5
|
+
resetWizardData: () => void;
|
|
6
|
+
}
|
|
7
|
+
declare const useWizard: () => {
|
|
8
|
+
wizardData: WizardData;
|
|
9
|
+
setWizardData: import('react').Dispatch<import('react').SetStateAction<WizardData>>;
|
|
10
|
+
updateWizardData: (updates: Partial<WizardData>) => void;
|
|
11
|
+
resetWizardData: () => void;
|
|
12
|
+
};
|
|
13
|
+
export default useWizard;
|
package/lib/i18n.d.ts
ADDED
package/lib/index.d.ts
CHANGED
|
@@ -1 +1,10 @@
|
|
|
1
|
-
export {}
|
|
1
|
+
export { default as CollectApp } from './components/CollectApp/CollectApp';
|
|
2
|
+
export type { CollectAppProps } from './components/CollectApp/CollectApp';
|
|
3
|
+
export { CollectMenu } from './features/menu/components/CollectMenu';
|
|
4
|
+
export { MenuProvider, MenuContext, useMenuContext, } from './features/menu/components/MenuContext';
|
|
5
|
+
export { router } from './routes';
|
|
6
|
+
export { basename } from './routes';
|
|
7
|
+
export { queryClient } from './providers';
|
|
8
|
+
export { Providers } from './providers';
|
|
9
|
+
export * from './features/collect-form';
|
|
10
|
+
export * from '@edifice.io/collect-client-rest';
|
package/lib/main.d.ts
ADDED
|
File without changes
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SharingItem, SingleAttachmentType } from '@edifice.io/react';
|
|
2
|
+
export interface WizardData {
|
|
3
|
+
title: string;
|
|
4
|
+
description: string;
|
|
5
|
+
deadline?: Date;
|
|
6
|
+
attachments: SingleAttachmentType[];
|
|
7
|
+
sharings: SharingItem[];
|
|
8
|
+
}
|
|
9
|
+
export declare enum CollectionContext {
|
|
10
|
+
COLLECTION = "COLLECTION",
|
|
11
|
+
SUBMISSION = "SUBMISSION"
|
|
12
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { QueryClient } from '@tanstack/react-query';
|
|
2
|
+
import { LoaderFunctionArgs } from 'react-router-dom';
|
|
3
|
+
export declare const loader: (queryClient: QueryClient) => ({ params }: LoaderFunctionArgs) => Promise<null>;
|
|
4
|
+
export declare const Collection: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { QueryClient } from '@tanstack/react-query';
|
|
2
|
+
import { LoaderFunctionArgs } from 'react-router-dom';
|
|
3
|
+
export declare const loader: (queryClient: QueryClient) => ({ params }: LoaderFunctionArgs) => Promise<null>;
|
|
4
|
+
export declare const FormEdit: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { QueryClient } from '@tanstack/react-query';
|
|
2
|
+
import { LoaderFunctionArgs } from 'react-router-dom';
|
|
3
|
+
export declare const loader: (queryClient: QueryClient) => ({ params }: LoaderFunctionArgs) => Promise<null>;
|
|
4
|
+
export declare const MembersEdit: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const NotFound: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const PageError: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { QueryClient } from '@tanstack/react-query';
|
|
2
|
+
import { LoaderFunctionArgs } from 'react-router-dom';
|
|
3
|
+
export declare const loader: (queryClient: QueryClient) => ({ params }: LoaderFunctionArgs) => Promise<null>;
|
|
4
|
+
export declare const Submission: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CreateCollectionDto, SearchCollectionDto, SearchCollectionToSubmitDto, UpdateCollectionDto, UpdateCollectionSharingDto } from '@edifice.io/collect-client-rest';
|
|
2
|
+
export declare const baseURL = "/collect/api";
|
|
3
|
+
export declare const collectionService: {
|
|
4
|
+
getCollections: (query?: SearchCollectionDto) => Promise<import('@edifice.io/collect-client-rest').SearchCollectionResponseDto>;
|
|
5
|
+
getCollectionsToSubmit: (query?: SearchCollectionToSubmitDto) => Promise<import('@edifice.io/collect-client-rest').SearchCollectionStudentViewDto>;
|
|
6
|
+
getCollection: (id: number) => Promise<import('@edifice.io/collect-client-rest').CollectionDto>;
|
|
7
|
+
createCollection: (data: CreateCollectionDto) => Promise<import('@edifice.io/collect-client-rest').CollectionDto>;
|
|
8
|
+
updateCollection: (id: number, data: UpdateCollectionDto) => Promise<import('@edifice.io/collect-client-rest').CollectionDto>;
|
|
9
|
+
deleteCollection: (id: number) => Promise<boolean>;
|
|
10
|
+
updateSharingCollection: (id: number, data: UpdateCollectionSharingDto) => Promise<import('@edifice.io/collect-client-rest').CollectionDto>;
|
|
11
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CreateSubmissionDto, SearchSubmissionDto, UpdateSubmissionStatusDto } from '@edifice.io/collect-client-rest';
|
|
2
|
+
export declare const baseURL = "/collect/api";
|
|
3
|
+
export declare const submissionService: {
|
|
4
|
+
getSubmissions: (collectionId: number, query?: SearchSubmissionDto) => Promise<import('@edifice.io/collect-client-rest').SearchSubmissionResponseDto>;
|
|
5
|
+
getSubmission: (collectionId: number, submissionId: number) => Promise<import('@edifice.io/collect-client-rest').SubmissionDto | null>;
|
|
6
|
+
updateSubmission: (collectionId: number, submissionId: number, data: CreateSubmissionDto) => Promise<import('@edifice.io/collect-client-rest').SubmissionDto>;
|
|
7
|
+
updateSubmissionStatus: (collectionId: number, submissionId: number, data: UpdateSubmissionStatusDto) => Promise<import('@edifice.io/collect-client-rest').SubmissionDto>;
|
|
8
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Flag to disable broadcast groups in user search.
|
|
3
|
+
* Set to true to disable broadcast groups.
|
|
4
|
+
*/
|
|
5
|
+
export declare const DISABLE_BROADCASTGROUP_IN_SEARCH = true;
|
|
6
|
+
export declare enum VisibleType {
|
|
7
|
+
USER = "User",
|
|
8
|
+
GROUP = "Group",
|
|
9
|
+
BROADCAST_GROUP = "BroadcastGroup",
|
|
10
|
+
SHAREBOOKMARK = "ShareBookmark"
|
|
11
|
+
}
|
|
12
|
+
export interface VisibleUser {
|
|
13
|
+
id: string;
|
|
14
|
+
displayName: string;
|
|
15
|
+
structureName: string;
|
|
16
|
+
profile: string;
|
|
17
|
+
children: [];
|
|
18
|
+
relatives: Array<{
|
|
19
|
+
displayName: string;
|
|
20
|
+
id: string;
|
|
21
|
+
}>;
|
|
22
|
+
type: VisibleType.USER;
|
|
23
|
+
usedIn: string[];
|
|
24
|
+
}
|
|
25
|
+
export interface VisibleGroup {
|
|
26
|
+
id: string;
|
|
27
|
+
displayName: string;
|
|
28
|
+
structureName: string;
|
|
29
|
+
nbUsers: number;
|
|
30
|
+
groupType: string;
|
|
31
|
+
profile: string;
|
|
32
|
+
type: VisibleType.GROUP | VisibleType.BROADCAST_GROUP;
|
|
33
|
+
usedIn: string[];
|
|
34
|
+
}
|
|
35
|
+
export interface VisibleBookmark {
|
|
36
|
+
id: string;
|
|
37
|
+
displayName: string;
|
|
38
|
+
type: VisibleType.SHAREBOOKMARK;
|
|
39
|
+
usedIn: string[];
|
|
40
|
+
}
|
|
41
|
+
export type SearchVisiblesResponse = Array<VisibleUser | VisibleGroup | VisibleBookmark>;
|
|
42
|
+
export type UserForGroup = {
|
|
43
|
+
type: string;
|
|
44
|
+
id: string;
|
|
45
|
+
displayName: string;
|
|
46
|
+
login: string;
|
|
47
|
+
};
|
|
48
|
+
export type Sharebookmark = {
|
|
49
|
+
id: string;
|
|
50
|
+
name: string;
|
|
51
|
+
};
|
|
52
|
+
export type FetchSharebookmarkResponse = {
|
|
53
|
+
id: string;
|
|
54
|
+
name: string;
|
|
55
|
+
users: UserForSharebookmark[];
|
|
56
|
+
groups: GroupForSharebookmark[];
|
|
57
|
+
};
|
|
58
|
+
export type UserForSharebookmark = {
|
|
59
|
+
id: string;
|
|
60
|
+
displayName: string;
|
|
61
|
+
profile: string;
|
|
62
|
+
activationCode: boolean;
|
|
63
|
+
};
|
|
64
|
+
export type GroupForSharebookmark = {
|
|
65
|
+
id: string;
|
|
66
|
+
name: string;
|
|
67
|
+
groupType: string;
|
|
68
|
+
nbUsers: number;
|
|
69
|
+
activationCode: boolean;
|
|
70
|
+
profile: string;
|
|
71
|
+
sortName: string;
|
|
72
|
+
};
|
|
73
|
+
export declare const createUserService: () => {
|
|
74
|
+
searchVisibles(search?: string): Promise<SearchVisiblesResponse>;
|
|
75
|
+
fetchUsersByGroup(groupId: string): Promise<UserForGroup[]>;
|
|
76
|
+
fetchSharebookmark(sharebookmarkId: string): Promise<FetchSharebookmarkResponse>;
|
|
77
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { CreateCollectionDto, SearchCollectionDto, SearchCollectionToSubmitDto, UpdateCollectionDto, UpdateCollectionSharingDto } from '@edifice.io/collect-client-rest';
|
|
2
|
+
export declare const collectionsQueryOptions: {
|
|
3
|
+
base: readonly ["collections"];
|
|
4
|
+
};
|
|
5
|
+
export declare const collectionsInfiniteQueryOptions: (query?: SearchCollectionDto) => {
|
|
6
|
+
queryKey: (string | SearchCollectionDto | undefined)[];
|
|
7
|
+
queryFn: ({ pageParam }: {
|
|
8
|
+
pageParam?: number | undefined;
|
|
9
|
+
}) => Promise<import('@edifice.io/collect-client-rest').SearchCollectionResponseDto>;
|
|
10
|
+
staleTime: number;
|
|
11
|
+
initialPageParam: number;
|
|
12
|
+
refetchOnMount: boolean;
|
|
13
|
+
getNextPageParam: (lastPage: {
|
|
14
|
+
meta?: {
|
|
15
|
+
currentPage?: number;
|
|
16
|
+
totalPages?: number;
|
|
17
|
+
};
|
|
18
|
+
}) => number | undefined;
|
|
19
|
+
};
|
|
20
|
+
export declare const useCollectionsInfiniteQueryOptions: (query?: SearchCollectionDto) => import('@tanstack/react-query').UseInfiniteQueryResult<import('@tanstack/react-query').InfiniteData<import('@edifice.io/collect-client-rest').SearchCollectionResponseDto, unknown>, Error>;
|
|
21
|
+
export declare const collectionsToSubmitInfiniteQueryOptions: (query?: SearchCollectionToSubmitDto) => {
|
|
22
|
+
queryKey: (string | SearchCollectionToSubmitDto | undefined)[];
|
|
23
|
+
queryFn: ({ pageParam }: {
|
|
24
|
+
pageParam?: number | undefined;
|
|
25
|
+
}) => Promise<import('@edifice.io/collect-client-rest').SearchCollectionStudentViewDto>;
|
|
26
|
+
staleTime: number;
|
|
27
|
+
initialPageParam: number;
|
|
28
|
+
refetchOnMount: boolean;
|
|
29
|
+
getNextPageParam: (lastPage: {
|
|
30
|
+
meta?: {
|
|
31
|
+
currentPage?: number;
|
|
32
|
+
totalPages?: number;
|
|
33
|
+
};
|
|
34
|
+
}) => number | undefined;
|
|
35
|
+
};
|
|
36
|
+
export declare const useLoadNextPageCollectionToSubmit: (query?: SearchCollectionToSubmitDto) => import('@tanstack/react-query').UseInfiniteQueryResult<import('@tanstack/react-query').InfiniteData<import('@edifice.io/collect-client-rest').SearchCollectionStudentViewDto, unknown>, Error>;
|
|
37
|
+
export declare const collectionQueryOptions: (id: number) => {
|
|
38
|
+
queryKey: (string | number)[];
|
|
39
|
+
queryFn: () => Promise<import('@edifice.io/collect-client-rest').CollectionDto>;
|
|
40
|
+
};
|
|
41
|
+
export declare const useCollection: (id: number) => import('@tanstack/react-query').UseQueryResult<import('@edifice.io/collect-client-rest').CollectionDto, Error>;
|
|
42
|
+
export declare const useCreateCollection: () => import('@tanstack/react-query').UseMutationResult<import('@edifice.io/collect-client-rest').CollectionDto, Error, CreateCollectionDto, unknown>;
|
|
43
|
+
export declare const useUpdateCollection: () => import('@tanstack/react-query').UseMutationResult<import('@edifice.io/collect-client-rest').CollectionDto, Error, {
|
|
44
|
+
id: number;
|
|
45
|
+
data: UpdateCollectionDto;
|
|
46
|
+
}, unknown>;
|
|
47
|
+
export declare const useDeleteCollection: () => import('@tanstack/react-query').UseMutationResult<boolean, Error, number, unknown>;
|
|
48
|
+
export declare const useUpdateSharingCollection: () => import('@tanstack/react-query').UseMutationResult<import('@edifice.io/collect-client-rest').CollectionDto, Error, {
|
|
49
|
+
id: number;
|
|
50
|
+
data: UpdateCollectionSharingDto;
|
|
51
|
+
}, unknown>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { CreateSubmissionDto, SearchSubmissionDto, UpdateSubmissionStatusDto } from '@edifice.io/collect-client-rest';
|
|
2
|
+
export declare const submissionsQueryOptions: {
|
|
3
|
+
base: readonly ["submissions"];
|
|
4
|
+
};
|
|
5
|
+
export declare const submissionsInfiniteQueryOptions: (collectionId: number, query?: SearchSubmissionDto) => {
|
|
6
|
+
queryKey: (number | SearchSubmissionDto | "submissions" | undefined)[];
|
|
7
|
+
queryFn: ({ pageParam }: {
|
|
8
|
+
pageParam?: number | undefined;
|
|
9
|
+
}) => Promise<import('@edifice.io/collect-client-rest').SearchSubmissionResponseDto>;
|
|
10
|
+
staleTime: number;
|
|
11
|
+
initialPageParam: number;
|
|
12
|
+
refetchOnMount: boolean;
|
|
13
|
+
getNextPageParam: (lastPage: {
|
|
14
|
+
meta?: {
|
|
15
|
+
currentPage?: number;
|
|
16
|
+
totalPages?: number;
|
|
17
|
+
};
|
|
18
|
+
}) => number | undefined;
|
|
19
|
+
};
|
|
20
|
+
export declare const useSubmissionsInfiniteQueryOptions: (collectionId: number, query?: SearchSubmissionDto) => import('@tanstack/react-query').UseInfiniteQueryResult<import('@tanstack/react-query').InfiniteData<import('@edifice.io/collect-client-rest').SearchSubmissionResponseDto, unknown>, Error>;
|
|
21
|
+
export declare const submissionQueryOptions: (collectionId: number, submissionId: number) => {
|
|
22
|
+
queryKey: (string | number)[];
|
|
23
|
+
queryFn: () => Promise<import('@edifice.io/collect-client-rest').SubmissionDto | null>;
|
|
24
|
+
staleTime: number;
|
|
25
|
+
};
|
|
26
|
+
export declare const useSubmission: (collectionId: number, submissionId: number) => import('@tanstack/react-query').UseQueryResult<import('@edifice.io/collect-client-rest').SubmissionDto | null, Error>;
|
|
27
|
+
export declare const useUpdateSubmission: () => import('@tanstack/react-query').UseMutationResult<import('@edifice.io/collect-client-rest').SubmissionDto, Error, {
|
|
28
|
+
collectionId: number;
|
|
29
|
+
submissionId: number;
|
|
30
|
+
data: CreateSubmissionDto;
|
|
31
|
+
}, unknown>;
|
|
32
|
+
export declare const useUpdateSubmissionStatus: () => import('@tanstack/react-query').UseMutationResult<import('@edifice.io/collect-client-rest').SubmissionDto, Error, {
|
|
33
|
+
collectionId: number;
|
|
34
|
+
submissionId: number;
|
|
35
|
+
data: UpdateSubmissionStatusDto;
|
|
36
|
+
}, unknown>;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { VisibleBookmark, VisibleGroup, VisibleUser } from '../api/user.service';
|
|
2
|
+
export type Visible = VisibleUser | VisibleGroup | VisibleBookmark;
|
|
3
|
+
export interface Config {
|
|
4
|
+
maxDepth: number;
|
|
5
|
+
recallDelayMinutes: number;
|
|
6
|
+
getVisibleStrategy: "all-at-once" | "filtered";
|
|
7
|
+
}
|
|
8
|
+
export declare const userQueryOptions: {
|
|
9
|
+
base: readonly ["user"];
|
|
10
|
+
/**
|
|
11
|
+
* Get a filtered list of visible users. Filtering is done by the *backend*.
|
|
12
|
+
* @param search The search string to filter the users
|
|
13
|
+
* @returns The query options for the search visible users
|
|
14
|
+
*/
|
|
15
|
+
searchVisibles(search?: string): import('@tanstack/react-query').OmitKeyof<import('@tanstack/react-query').UseQueryOptions<import('../api/user.service').SearchVisiblesResponse, Error, import('../api/user.service').SearchVisiblesResponse, readonly ["user", "search", {
|
|
16
|
+
search: string;
|
|
17
|
+
} | undefined]>, "queryFn"> & {
|
|
18
|
+
queryFn?: import('@tanstack/react-query').QueryFunction<import('../api/user.service').SearchVisiblesResponse, readonly ["user", "search", {
|
|
19
|
+
search: string;
|
|
20
|
+
} | undefined], never> | undefined;
|
|
21
|
+
} & {
|
|
22
|
+
queryKey: readonly ["user", "search", {
|
|
23
|
+
search: string;
|
|
24
|
+
} | undefined] & {
|
|
25
|
+
[dataTagSymbol]: import('../api/user.service').SearchVisiblesResponse;
|
|
26
|
+
[dataTagErrorSymbol]: Error;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Get users belonging to a specific group
|
|
31
|
+
* @param groupId The ID of the group to fetch users from
|
|
32
|
+
* @returns The query options for fetching users by group
|
|
33
|
+
*/
|
|
34
|
+
fetchUsersByGroup(groupId: string): import('@tanstack/react-query').OmitKeyof<import('@tanstack/react-query').UseQueryOptions<import('../api/user.service').UserForGroup[], Error, import('../api/user.service').UserForGroup[], readonly ["user", "group", string]>, "queryFn"> & {
|
|
35
|
+
queryFn?: import('@tanstack/react-query').QueryFunction<import('../api/user.service').UserForGroup[], readonly ["user", "group", string], never> | undefined;
|
|
36
|
+
} & {
|
|
37
|
+
queryKey: readonly ["user", "group", string] & {
|
|
38
|
+
[dataTagSymbol]: import('../api/user.service').UserForGroup[];
|
|
39
|
+
[dataTagErrorSymbol]: Error;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
fetchSharebookmark(sharebookmarkId: string): import('@tanstack/react-query').OmitKeyof<import('@tanstack/react-query').UseQueryOptions<import('../api/user.service').FetchSharebookmarkResponse, Error, import('../api/user.service').FetchSharebookmarkResponse, readonly ["user", "sharebookmark", string]>, "queryFn"> & {
|
|
43
|
+
queryFn?: import('@tanstack/react-query').QueryFunction<import('../api/user.service').FetchSharebookmarkResponse, readonly ["user", "sharebookmark", string], never> | undefined;
|
|
44
|
+
} & {
|
|
45
|
+
queryKey: readonly ["user", "sharebookmark", string] & {
|
|
46
|
+
[dataTagSymbol]: import('../api/user.service').FetchSharebookmarkResponse;
|
|
47
|
+
[dataTagErrorSymbol]: Error;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Hook to get the list of visible users
|
|
53
|
+
* @param search The search string to filter the users
|
|
54
|
+
* @returns list of visible users
|
|
55
|
+
*/
|
|
56
|
+
export declare const useSearchVisible: () => {
|
|
57
|
+
searchVisible: (search: string) => Promise<import('../api/user.service').SearchVisiblesResponse>;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Hook to fetch users belonging to a specific group
|
|
61
|
+
* @param groupId The ID of the group to fetch users from
|
|
62
|
+
* @returns Query result with users and groups in the specified group
|
|
63
|
+
*/
|
|
64
|
+
export declare const useFetchUsersByGroup: (groupId: string) => {
|
|
65
|
+
users: VisibleUser[];
|
|
66
|
+
isLoading: boolean;
|
|
67
|
+
error: Error | null;
|
|
68
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
interface CollectionActionState {
|
|
2
|
+
isDeleteModalOpen: boolean;
|
|
3
|
+
deleteCollectionId: number | null;
|
|
4
|
+
isInstructionModalOpen: boolean;
|
|
5
|
+
isPastDeadline: boolean;
|
|
6
|
+
onOpenDeleteModal: (id: number) => void;
|
|
7
|
+
onCloseDeleteModal: () => void;
|
|
8
|
+
onOpenInstructionModal: () => void;
|
|
9
|
+
onCloseInstructionModal: () => void;
|
|
10
|
+
setIsPastDeadline: (isPast: boolean) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare const useCollectionActionStore: {
|
|
13
|
+
(): CollectionActionState;
|
|
14
|
+
<U>(selector: (state: CollectionActionState) => U): U;
|
|
15
|
+
<U>(selector: (state: CollectionActionState) => U, equalityFn: (a: U, b: U) => boolean): U;
|
|
16
|
+
} & import('zustand').StoreApi<CollectionActionState> & {
|
|
17
|
+
use: {
|
|
18
|
+
isDeleteModalOpen: () => boolean;
|
|
19
|
+
deleteCollectionId: () => number | null;
|
|
20
|
+
isInstructionModalOpen: () => boolean;
|
|
21
|
+
isPastDeadline: () => boolean;
|
|
22
|
+
onOpenDeleteModal: () => (id: number) => void;
|
|
23
|
+
onCloseDeleteModal: () => () => void;
|
|
24
|
+
onOpenInstructionModal: () => () => void;
|
|
25
|
+
onCloseInstructionModal: () => () => void;
|
|
26
|
+
setIsPastDeadline: () => (isPast: boolean) => void;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { StoreApi, UseBoundStore } from 'zustand';
|
|
2
|
+
type WithSelectors<S> = S extends {
|
|
3
|
+
getState: () => infer T;
|
|
4
|
+
} ? S & {
|
|
5
|
+
use: {
|
|
6
|
+
[K in keyof T]: () => T[K];
|
|
7
|
+
};
|
|
8
|
+
} : never;
|
|
9
|
+
export declare const createSelectors: <S extends UseBoundStore<StoreApi<object>>>(_store: S) => WithSelectors<S>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
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 {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { SharingItem } from '@edifice.io/react';
|
|
2
|
+
interface UsersCollectionActionState {
|
|
3
|
+
usersCollection: SharingItem[];
|
|
4
|
+
usersToAdd: SharingItem[];
|
|
5
|
+
usersToDelete: SharingItem[];
|
|
6
|
+
setUsersCollection: (usersCollection: SharingItem[]) => void;
|
|
7
|
+
addUsersToAdd: (items: SharingItem[]) => void;
|
|
8
|
+
addUsersToDelete: (items: SharingItem[]) => void;
|
|
9
|
+
resetUsersDiff: () => void;
|
|
10
|
+
}
|
|
11
|
+
export declare const useUsersCollectionActionStore: {
|
|
12
|
+
(): UsersCollectionActionState;
|
|
13
|
+
<U>(selector: (state: UsersCollectionActionState) => U): U;
|
|
14
|
+
<U>(selector: (state: UsersCollectionActionState) => U, equalityFn: (a: U, b: U) => boolean): U;
|
|
15
|
+
} & import('zustand').StoreApi<UsersCollectionActionState> & {
|
|
16
|
+
use: {
|
|
17
|
+
usersCollection: () => SharingItem[];
|
|
18
|
+
usersToAdd: () => SharingItem[];
|
|
19
|
+
usersToDelete: () => SharingItem[];
|
|
20
|
+
setUsersCollection: () => (usersCollection: SharingItem[]) => void;
|
|
21
|
+
addUsersToAdd: () => (items: SharingItem[]) => void;
|
|
22
|
+
addUsersToDelete: () => (items: SharingItem[]) => void;
|
|
23
|
+
resetUsersDiff: () => () => void;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edifice.io/collect-frontend",
|
|
3
|
-
"version": "0.2.2-develop-pedago.3.
|
|
3
|
+
"version": "0.2.2-develop-pedago.3.20260505122017",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
6
|
"author": "Edifice",
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
"scripts": {
|
|
9
9
|
"build": "pnpm run typecheck && vite build && vite build --mode lib",
|
|
10
10
|
"build:lib": "vite build --mode lib",
|
|
11
|
-
"build:prod": "
|
|
11
|
+
"build:prod:lib": "vite build --mode lib --debug",
|
|
12
|
+
"build:prod": "NODE_ENV=production pnpm run typecheck && vite build && pnpm run build:prod:lib",
|
|
12
13
|
"clean": "rm -rf dist lib node_modules",
|
|
13
14
|
"dev": "vite",
|
|
14
15
|
"format": "prettier --write .",
|