placementt-core 11.0.533 → 11.0.803

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.
Files changed (76) hide show
  1. package/lib/constants.d.ts +13 -1
  2. package/lib/constants.js +86 -1
  3. package/lib/constants.js.map +1 -1
  4. package/lib/features/analytics/useAnalytics.d.ts +2 -0
  5. package/lib/features/analytics/useAnalytics.js +22 -19
  6. package/lib/features/analytics/useAnalytics.js.map +1 -1
  7. package/lib/features/global/downtime/useDowntime.d.ts +1 -0
  8. package/lib/features/global/downtime/useDowntime.js +9 -7
  9. package/lib/features/global/downtime/useDowntime.js.map +1 -1
  10. package/lib/features/global/users/useUserFunctions.js +1 -1
  11. package/lib/features/global/users/useUserFunctions.js.map +1 -1
  12. package/lib/features/jobs/jobsSlice.d.ts +10 -2
  13. package/lib/features/jobs/jobsSlice.js +5 -2
  14. package/lib/features/jobs/jobsSlice.js.map +1 -1
  15. package/lib/features/placements/studentPlacements/activePlacement.d.ts +5 -1
  16. package/lib/features/placements/studentPlacements/activePlacement.js +7 -3
  17. package/lib/features/placements/studentPlacements/activePlacement.js.map +1 -1
  18. package/lib/features/placements/studentPlacements/completedStudentPlacementsSlice.d.ts +3 -2
  19. package/lib/features/placements/studentPlacements/completedStudentPlacementsSlice.js +4 -1
  20. package/lib/features/placements/studentPlacements/completedStudentPlacementsSlice.js.map +1 -1
  21. package/lib/features/placements/studentPlacements/upcomingStudentPlacementsSlice.d.ts +2 -2
  22. package/lib/features/placements/studentPlacements/upcomingStudentPlacementsSlice.js +1 -1
  23. package/lib/features/placements/studentPlacements/upcomingStudentPlacementsSlice.js.map +1 -1
  24. package/lib/features/placements/studentPlacements/useStudentPlacements.d.ts +2 -12
  25. package/lib/features/placements/studentPlacements/useStudentPlacements.js +1 -26
  26. package/lib/features/placements/studentPlacements/useStudentPlacements.js.map +1 -1
  27. package/lib/features/updates/useUpdates.d.ts +1 -0
  28. package/lib/features/updates/useUpdates.js +13 -12
  29. package/lib/features/updates/useUpdates.js.map +1 -1
  30. package/lib/firebase/firebase.d.ts +5 -3
  31. package/lib/firebase/firebase.js +15 -9
  32. package/lib/firebase/firebase.js.map +1 -1
  33. package/lib/firebase/firebaseConfig.js.map +1 -1
  34. package/lib/firebase/firebaseQuery.d.ts +6 -2
  35. package/lib/firebase/firebaseQuery.js +11 -3
  36. package/lib/firebase/firebaseQuery.js.map +1 -1
  37. package/lib/firebase/readDatabase.d.ts +2 -4
  38. package/lib/firebase/readDatabase.js +30 -5
  39. package/lib/firebase/readDatabase.js.map +1 -1
  40. package/lib/firebase/writeDatabase.d.ts +6 -2
  41. package/lib/firebase/writeDatabase.js +2 -1
  42. package/lib/firebase/writeDatabase.js.map +1 -1
  43. package/lib/hooks.d.ts +226 -16
  44. package/lib/hooks.js +938 -146
  45. package/lib/hooks.js.map +1 -1
  46. package/lib/reduxHooks.d.ts +56 -4
  47. package/lib/reduxHooks.js +63 -19
  48. package/lib/reduxHooks.js.map +1 -1
  49. package/lib/tasksAndTips.d.ts +7 -5
  50. package/lib/tasksAndTips.js +487 -23
  51. package/lib/tasksAndTips.js.map +1 -1
  52. package/lib/typeDefinitions.d.ts +149 -30
  53. package/lib/util.d.ts +7 -2
  54. package/lib/util.js +32 -9
  55. package/lib/util.js.map +1 -1
  56. package/package.json +1 -1
  57. package/src/constants.ts +91 -3
  58. package/src/features/analytics/useAnalytics.tsx +25 -17
  59. package/src/features/global/downtime/useDowntime.tsx +11 -7
  60. package/src/features/global/users/useUserFunctions.tsx +1 -1
  61. package/src/features/jobs/jobsSlice.ts +9 -3
  62. package/src/features/placements/studentPlacements/activePlacement.ts +8 -3
  63. package/src/features/placements/studentPlacements/completedStudentPlacementsSlice.ts +5 -2
  64. package/src/features/placements/studentPlacements/upcomingStudentPlacementsSlice.ts +2 -2
  65. package/src/features/placements/studentPlacements/useStudentPlacements.tsx +4 -28
  66. package/src/features/updates/useUpdates.tsx +14 -12
  67. package/src/firebase/firebase.tsx +19 -12
  68. package/src/firebase/firebaseConfig.tsx +1 -1
  69. package/src/firebase/firebaseQuery.tsx +11 -3
  70. package/src/firebase/readDatabase.tsx +34 -6
  71. package/src/firebase/writeDatabase.tsx +3 -1
  72. package/src/hooks.tsx +1124 -166
  73. package/src/reduxHooks.ts +71 -22
  74. package/src/tasksAndTips.ts +495 -30
  75. package/src/typeDefinitions.ts +140 -35
  76. package/src/util.ts +45 -17
package/lib/hooks.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { DocumentData, QueryConstraint, QueryDocumentSnapshot } from "firebase/firestore";
2
- import { ApplicantStage, ApplicantWorkflow, Application, ArrowObject, CohortData, FileItem, FlagCodes, InstituteData, OnboardingDocs, PlacementListing, Products, ProviderData, QueryObject, SavedPlacement, StudentPlacementData, UserData, UserGroupData, WorkflowStage } from "./typeDefinitions";
1
+ import { DocumentData, QueryConstraint, QueryDocumentSnapshot, QueryFieldFilterConstraint } from "firebase/firestore";
2
+ import { ApplicantStage, ApplicantWorkflow, Application, ArrowObject, CohortData, CustomFormSchema, FileItem, FlagCodes, InstituteData, OnboardingDocs, PlacementListing, Products, ProviderData, QueryObject, QueryObjectConstraint, SavedPlacement, Sorts, StudentPlacementData, UserData, UserGroupData, WorkflowStage } from "./typeDefinitions";
3
3
  import { OrganisationAddress } from "placementt-core";
4
4
  type StudentPlacementListParams = {
5
5
  user: UserData;
@@ -26,7 +26,17 @@ type InstitutePlacementParams = {
26
26
  ql?: number;
27
27
  inProgress?: boolean;
28
28
  };
29
- export declare function useNewInstitutePlacementList({ id, user, cohort, queryConstraint, ql, inProgress }: InstitutePlacementParams): {
29
+ type NewInstitutePlacementParams = {
30
+ id?: string;
31
+ user: UserData;
32
+ cohort?: string;
33
+ queryConstraints?: QueryObjectConstraint;
34
+ ql?: number;
35
+ inProgress?: boolean;
36
+ view: "list" | "table";
37
+ filters?: FilterObject;
38
+ };
39
+ export declare function useOldInstitutePlacementList({ id, user, cohort, queryConstraint, ql, inProgress }: InstitutePlacementParams): {
30
40
  placements: {
31
41
  [key: string]: StudentPlacementData & {
32
42
  student: UserData;
@@ -39,7 +49,32 @@ export declare function useNewInstitutePlacementList({ id, user, cohort, queryCo
39
49
  reset: () => void;
40
50
  changeQueryConstraints: (e: QueryConstraint[]) => void;
41
51
  };
42
- export declare function useOldInstitutePlacementList({ user, cohort, queryConstraint, ql }: InstitutePlacementParams): {
52
+ export declare function useNewInstitutePlacementList({ id, user, filters, view, cohort, queryConstraints, ql, inProgress }: NewInstitutePlacementParams): {
53
+ tableData: {
54
+ [key: string]: {
55
+ [key: string]: unknown;
56
+ };
57
+ };
58
+ page: number;
59
+ loading: boolean | "loaded";
60
+ updateSearch: import("react").Dispatch<import("react").SetStateAction<string | undefined>>;
61
+ setFilters: import("react").Dispatch<import("react").SetStateAction<FilterObject | undefined>>;
62
+ setView: import("react").Dispatch<import("react").SetStateAction<"table" | "list">>;
63
+ pageUp: () => void;
64
+ pageDown: () => void;
65
+ sorts: {
66
+ [label: string]: {
67
+ value: string;
68
+ direction: "asc" | "desc";
69
+ };
70
+ };
71
+ updateSort: (sortLabel: string) => void;
72
+ sort: [string, {
73
+ value: string;
74
+ direction: "asc" | "desc";
75
+ }] | undefined;
76
+ };
77
+ export declare function useVeryOldInstitutePlacementList({ user, cohort, queryConstraint, ql }: InstitutePlacementParams): {
43
78
  placements: {
44
79
  [key: string]: StudentPlacementData & {
45
80
  student: UserData;
@@ -91,8 +126,9 @@ type UserPaginatorParams = {
91
126
  data: QueryObject[];
92
127
  search?: string;
93
128
  userType: "Staff" | "Students";
129
+ sort?: string;
94
130
  };
95
- export declare function useCohortUserPaginator({ user, cohort, data, search, userType }: UserPaginatorParams): {
131
+ export declare function useCohortUserPaginator({ user, cohort, data, search, userType, sort }: UserPaginatorParams): {
96
132
  tableData: {
97
133
  [key: string]: {
98
134
  [key: string]: unknown;
@@ -103,6 +139,9 @@ export declare function useCohortUserPaginator({ user, cohort, data, search, use
103
139
  setFilters: import("react").Dispatch<import("react").SetStateAction<{
104
140
  [key: string]: unknown;
105
141
  } | undefined>>;
142
+ setSort: (s: string) => void;
143
+ sortOptions: string[];
144
+ sortBy: string | undefined;
106
145
  };
107
146
  export declare function useAdmissionsPaginator({ data }: {
108
147
  data: {
@@ -182,7 +221,7 @@ export type ApplicationHookParams = {
182
221
  profileUrl: string | undefined;
183
222
  successPopup: "submitted" | "draftSaved" | "stageComplete" | "outcome" | undefined;
184
223
  fApplicationId: string | undefined;
185
- fListing: PlacementListing | undefined;
224
+ fListing: PlacementListing | false | undefined;
186
225
  student: UserData | undefined;
187
226
  fProvider: {
188
227
  details?: ProviderData;
@@ -289,7 +328,7 @@ export declare function useCreateApplicationRenderer({ user, listingId, listing,
289
328
  profileUrl: string | undefined;
290
329
  successPopup: "submitted" | "draftSaved" | "stageComplete" | "outcome" | undefined;
291
330
  fApplicationId: string | undefined;
292
- fListing: PlacementListing | undefined;
331
+ fListing: false | PlacementListing | undefined;
293
332
  student: UserData | undefined;
294
333
  fProvider: {
295
334
  details?: ProviderData;
@@ -325,7 +364,13 @@ export declare function useProposePlacementRenderer({ user, orgContext, placemen
325
364
  setBusinessSectionComplete: import("react").Dispatch<import("react").SetStateAction<boolean>>;
326
365
  setAddressSectionComplete: import("react").Dispatch<import("react").SetStateAction<boolean>>;
327
366
  setPlacementSectionComplete: import("react").Dispatch<import("react").SetStateAction<boolean>>;
328
- proposePlacement: (draft?: boolean) => Promise<any>;
367
+ proposePlacement: (draft?: boolean) => Promise<{
368
+ status: {
369
+ active: boolean;
370
+ inProgress: boolean;
371
+ completed: boolean;
372
+ };
373
+ }>;
329
374
  deletePlacement: (id: string) => Promise<void>;
330
375
  setStudent: import("react").Dispatch<import("react").SetStateAction<UserData | undefined>>;
331
376
  submitSection: (type: "dates" | "provider" | "address", data: {
@@ -363,7 +408,7 @@ export declare function useCreateCohortRenderer({ oId, product, initialData }: C
363
408
  type UserUploadParams = {
364
409
  userType: "Staff" | "Students";
365
410
  user: UserData;
366
- onComplete?: () => void;
411
+ onComplete?: (e: string) => void;
367
412
  cohortId?: string;
368
413
  userGroupId?: string;
369
414
  shareNameWithReferralLeaderboardConsent?: string;
@@ -433,7 +478,7 @@ export declare function useWorkflowEditor({ user, initialData, onSubmit, cohortI
433
478
  containerRef: import("react").RefObject<HTMLFormElement>;
434
479
  setError: import("react").Dispatch<import("react").SetStateAction<string | undefined>>;
435
480
  setArrows: import("react").Dispatch<import("react").SetStateAction<ArrowObject[]>>;
436
- setWorkflowNodes: import("react").Dispatch<import("react").SetStateAction<ApplicantStage[] | WorkflowStage[]>>;
481
+ setWorkflowNodes: import("react").Dispatch<import("react").SetStateAction<WorkflowStage[] | ApplicantStage[]>>;
437
482
  };
438
483
  type ApplicantWorkflowEditorParams = {
439
484
  user: UserData;
@@ -517,14 +562,25 @@ export declare function useGetIndividualPlacementForPlacementPage({ user, placem
517
562
  };
518
563
  }): {
519
564
  placement: StudentPlacementData | undefined;
520
- wStage: WorkflowStage | undefined;
565
+ wStage: (WorkflowStage & {
566
+ files: {
567
+ [fileId: string]: {
568
+ name: string;
569
+ url: string;
570
+ };
571
+ };
572
+ }) | undefined;
521
573
  student: UserData | undefined;
522
574
  workflow: WorkflowStage[] | undefined;
523
575
  editable: boolean;
524
576
  withdrawFromPlacementPopup: boolean;
577
+ addOnboardingDocsPopup: boolean;
578
+ setAddOnboardingDocsPopup: import("react").Dispatch<import("react").SetStateAction<boolean>>;
579
+ dismissOnboardingPopup: boolean;
580
+ setDismissOnboardingPopup: import("react").Dispatch<import("react").SetStateAction<boolean>>;
525
581
  setWithdrawFromPlacementPopup: import("react").Dispatch<import("react").SetStateAction<boolean>>;
526
582
  withdrawFromPlacement: () => Promise<void>;
527
- onFlagClick: (e: FlagCodes) => Promise<void>;
583
+ onFlagClick: (e: FlagCodes, onClose?: boolean) => Promise<void>;
528
584
  setUploadInsurance: import("react").Dispatch<import("react").SetStateAction<boolean>>;
529
585
  setUploadProviderDocPopup: import("react").Dispatch<import("react").SetStateAction<"insurance" | "riskAssessment" | "DbsCheck" | undefined>>;
530
586
  setUploadRA: import("react").Dispatch<import("react").SetStateAction<boolean>>;
@@ -579,11 +635,14 @@ export declare function useGetIndividualPlacementForPlacementPage({ user, placem
579
635
  }, type: "riskAssessment" | "dbsCheck") => Promise<void>;
580
636
  manuallyConfigureProvider: () => Promise<void>;
581
637
  institute: InstituteData | undefined;
638
+ shareStudentRequestPopup: boolean;
639
+ setShareStudentRequestPopup: import("react").Dispatch<import("react").SetStateAction<boolean>>;
582
640
  };
583
- export declare function useOnboardingPopup({ onboarding, placementId, user, onClose }: {
641
+ export declare function useOnboardingPopup({ onboarding, providerId, placementId, user, onClose }: {
584
642
  onboarding: (OnboardingDocs & {
585
643
  completed: {
586
- submitted: string | false;
644
+ submitted: boolean;
645
+ submittedDate?: string;
587
646
  accepted?: boolean;
588
647
  filesViewed?: string[];
589
648
  formsCompleted?: {
@@ -596,6 +655,7 @@ export declare function useOnboardingPopup({ onboarding, placementId, user, onCl
596
655
  });
597
656
  placementId: string;
598
657
  user: UserData;
658
+ providerId: string;
599
659
  onClose: () => void;
600
660
  }): {
601
661
  addFile: (files: string[]) => void;
@@ -615,7 +675,8 @@ export declare function useOnboardingPopup({ onboarding, placementId, user, onCl
615
675
  } | undefined>>;
616
676
  mOnboarding: OnboardingDocs & {
617
677
  completed: {
618
- submitted: string | false;
678
+ submitted: boolean;
679
+ submittedDate?: string;
619
680
  accepted?: boolean;
620
681
  filesViewed?: string[];
621
682
  formsCompleted?: {
@@ -638,7 +699,8 @@ export declare function useOnboardingPopup({ onboarding, placementId, user, onCl
638
699
  }) => Promise<void>;
639
700
  rejectPopup: boolean;
640
701
  completedSections: {
641
- submitted: string | false;
702
+ submitted: boolean;
703
+ submittedDate?: string;
642
704
  filesViewed?: string[] | undefined;
643
705
  formsCompleted?: {
644
706
  [key: string]: unknown;
@@ -649,5 +711,153 @@ export declare function useOnboardingPopup({ onboarding, placementId, user, onCl
649
711
  } | undefined;
650
712
  fileUploadPopup: number | false;
651
713
  setFileUploadPopup: import("react").Dispatch<import("react").SetStateAction<number | false>>;
714
+ viewableFiles: {
715
+ [key: string]: FileItem;
716
+ } | undefined;
717
+ formDetails: {
718
+ [key: string]: {
719
+ name: string;
720
+ id: string;
721
+ description?: string;
722
+ product: Products;
723
+ oId: string;
724
+ form: CustomFormSchema;
725
+ };
726
+ };
727
+ };
728
+ export declare function useLoadAddresses(user: UserData, limitItems?: number, queryConstraint?: QueryConstraint[], request?: boolean): {
729
+ addresses: {
730
+ [key: string]: import("placementt-core").Address & {
731
+ name?: string;
732
+ savedBy?: string[];
733
+ product: import("placementt-core").Products;
734
+ oId: string;
735
+ stage: import("placementt-core").OrganisationAddressStages;
736
+ additionalQuestions?: {
737
+ bikeStorage?: boolean;
738
+ kitchen?: boolean;
739
+ parking?: boolean;
740
+ disabledAccess?: boolean;
741
+ };
742
+ contacts?: {
743
+ firstAid?: {
744
+ name?: string;
745
+ phone?: string;
746
+ email?: string;
747
+ location?: string;
748
+ }[];
749
+ security?: {
750
+ name?: string;
751
+ phone?: string;
752
+ email?: string;
753
+ location?: string;
754
+ }[];
755
+ reception?: {
756
+ name?: string;
757
+ phone?: string;
758
+ email?: string;
759
+ location?: string;
760
+ }[];
761
+ };
762
+ primaryContactId?: string;
763
+ default?: boolean;
764
+ flags?: ("addressMissing" | "noPrimaryContact")[];
765
+ } & {
766
+ listings: number;
767
+ };
768
+ };
769
+ onScrollBottom: () => void;
770
+ loading: boolean;
771
+ changeQueryConstraints: (e: QueryConstraint[]) => void;
772
+ };
773
+ export declare function useLoadListings(user: UserData, queryConstraint?: QueryConstraint[], request?: boolean): {
774
+ listings: [string, PlacementListing & {
775
+ applicants?: number;
776
+ scheduled?: number;
777
+ active?: number;
778
+ }][];
779
+ onScrollBottom: () => void;
780
+ loading: boolean;
781
+ changeQueryConstraints: (e: QueryConstraint[]) => void;
782
+ };
783
+ export declare function useLoadProviderPlacements(user: UserData, queryConstraint?: QueryConstraint[], placementId?: string): {
784
+ placements: {
785
+ [k: string]: never;
786
+ };
787
+ onScrollBottom: () => void;
788
+ loading: boolean;
789
+ changeQueryConstraints: (e: QueryConstraint[]) => void;
790
+ };
791
+ export declare function useLoadApplications({ user, applicationType, listingId, queryConstraint }: {
792
+ user: UserData;
793
+ applicationType?: "all" | "actionRequired" | "awaitingStudent" | "closed";
794
+ listingId?: string;
795
+ queryConstraint?: QueryConstraint[];
796
+ }): {
797
+ applications: [string, Application][];
798
+ type: "all" | "closed" | "actionRequired" | "awaitingStudent";
799
+ setType: import("react").Dispatch<import("react").SetStateAction<"all" | "closed" | "actionRequired" | "awaitingStudent">>;
800
+ onScrollBottom: () => void;
801
+ loading: boolean;
802
+ changeQueryConstraints: (e: QueryConstraint[]) => void;
803
+ };
804
+ export type FilterObject = {
805
+ [key: string]: {
806
+ label: string;
807
+ value?: unknown;
808
+ values?: {
809
+ [key: string | number]: string | {
810
+ label: string;
811
+ test: QueryFieldFilterConstraint;
812
+ };
813
+ };
814
+ type: "dropdown" | "string" | "number";
815
+ };
816
+ };
817
+ export type DataViewerPaginater = {
818
+ view: "list" | "table";
819
+ queryLimit?: number;
820
+ formatItems?: (key: string, item: any) => Promise<{
821
+ key: string;
822
+ item: any;
823
+ }> | {
824
+ key: string;
825
+ item: any;
826
+ };
827
+ snapshot?: boolean;
828
+ filters?: FilterObject;
829
+ onSearch?: boolean | ((search?: string, sort?: [string, {
830
+ value: string;
831
+ direction: "asc" | "desc";
832
+ }], page?: number, filters?: FilterObject, limit?: number) => Promise<{
833
+ [key: string]: any;
834
+ }>);
835
+ data?: {
836
+ [key: string]: {
837
+ [key: string]: unknown;
838
+ };
839
+ } | QueryObject[];
840
+ additionalEntryProcessing?: (k: string, v: any) => Promise<any> | any;
841
+ sorts?: Sorts;
842
+ };
843
+ export declare function useDataViewerPaginator({ view: initialView, sorts, queryLimit, additionalEntryProcessing, formatItems, snapshot, filters: initialFilters, onSearch, data }: DataViewerPaginater): {
844
+ tableData: {
845
+ [key: string]: {
846
+ [key: string]: unknown;
847
+ };
848
+ };
849
+ pageUp: () => void;
850
+ pageDown: () => void;
851
+ setFilters: import("react").Dispatch<import("react").SetStateAction<FilterObject | undefined>>;
852
+ page: number;
853
+ sorts: Sorts;
854
+ loading: boolean | "loaded";
855
+ sort: [string, {
856
+ value: string;
857
+ direction: "asc" | "desc";
858
+ }] | undefined;
859
+ updateSort: (sortLabel: string) => void;
860
+ setView: import("react").Dispatch<import("react").SetStateAction<"table" | "list">>;
861
+ updateSearch: import("react").Dispatch<import("react").SetStateAction<string | undefined>>;
652
862
  };
653
863
  export {};