placementt-core 1.20.232 → 1.300.4

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 (101) hide show
  1. package/.eslintrc.js +40 -40
  2. package/.gitattributes +2 -2
  3. package/deploy-all.js +75 -0
  4. package/lib/config.d.ts +0 -13
  5. package/lib/config.js +1 -3
  6. package/lib/config.js.map +1 -1
  7. package/lib/constants.d.ts +1 -0
  8. package/lib/constants.js +48 -1
  9. package/lib/constants.js.map +1 -1
  10. package/lib/features/config.d.ts +133 -133
  11. package/lib/features/config.js +35 -35
  12. package/lib/features/contacts/contacts.d.ts +75 -75
  13. package/lib/features/contacts/contacts.js +105 -105
  14. package/lib/features/downtime/useDowntime.d.ts +11 -11
  15. package/lib/features/downtime/useDowntime.js +22 -22
  16. package/lib/features/placements/studentPlacements/activePlacement.js +1 -1
  17. package/lib/features/placements/studentPlacements/activePlacement.js.map +1 -1
  18. package/lib/features/placements/studentPlacements/studentPlacementsSlice.d.ts +63 -63
  19. package/lib/features/placements/studentPlacements/studentPlacementsSlice.js +81 -81
  20. package/lib/features/providerPlacements/providerPlacementsSlice.d.ts +19 -19
  21. package/lib/features/providerPlacements/providerPlacementsSlice.js +24 -24
  22. package/lib/features/studentPlacements/studentPlacementsSlice.d.ts +62 -62
  23. package/lib/features/studentPlacements/studentPlacementsSlice.js +87 -87
  24. package/lib/features/studentPlacements/useStudentPlacements.d.ts +6 -6
  25. package/lib/features/studentPlacements/useStudentPlacements.js +18 -18
  26. package/lib/features/userSlice.d.ts +26 -26
  27. package/lib/features/userSlice.js +23 -23
  28. package/lib/features/users/useUserFunctions.d.ts +25 -25
  29. package/lib/features/users/useUserFunctions.js +124 -124
  30. package/lib/features/users/userSlice.d.ts +46 -46
  31. package/lib/features/users/userSlice.js +48 -48
  32. package/lib/firebase/firebase.d.ts +1 -1
  33. package/lib/firebase/firebase.js +8 -3
  34. package/lib/firebase/firebase.js.map +1 -1
  35. package/lib/firebase/firebaseConfig.js +1 -0
  36. package/lib/firebase/firebaseConfig.js.map +1 -1
  37. package/lib/firebase/readDatabase.js +7 -7
  38. package/lib/firebase/readDatabase.js.map +1 -1
  39. package/lib/hooks.d.ts +85 -192
  40. package/lib/hooks.js +731 -671
  41. package/lib/hooks.js.map +1 -1
  42. package/lib/images/GatsbyBenchmarks.d.ts +1 -2
  43. package/lib/index.d.ts +0 -1
  44. package/lib/index.js +0 -1
  45. package/lib/index.js.map +1 -1
  46. package/lib/reduxHooks.d.ts +9 -41
  47. package/lib/reduxHooks.js +1 -49
  48. package/lib/reduxHooks.js.map +1 -1
  49. package/lib/tasksAndTips.js +368 -418
  50. package/lib/tasksAndTips.js.map +1 -1
  51. package/lib/typeDefinitions.d.ts +162 -83
  52. package/lib/util.d.ts +25 -1
  53. package/lib/util.js +329 -2
  54. package/lib/util.js.map +1 -1
  55. package/package.json +56 -56
  56. package/src/DatabaseDefinitions.ts +18 -18
  57. package/src/apiCalls.ts +128 -128
  58. package/src/config.ts +50 -53
  59. package/src/constants.ts +846 -796
  60. package/src/databaseTypes.ts +42 -42
  61. package/src/features/analytics/useAnalytics.tsx +63 -63
  62. package/src/features/contacts/contactsSlice.ts +147 -147
  63. package/src/features/contacts/useContacts.tsx +73 -73
  64. package/src/features/dropdown/useDropdown.tsx +52 -52
  65. package/src/features/global/downtime/useDowntime.tsx +23 -23
  66. package/src/features/global/users/useUserFunctions.tsx +132 -132
  67. package/src/features/jobs/jobsSlice.ts +71 -71
  68. package/src/features/placements/studentPlacements/activePlacement.ts +68 -68
  69. package/src/features/placements/studentPlacements/completedStudentPlacementsSlice.ts +97 -97
  70. package/src/features/placements/studentPlacements/upcomingStudentPlacementsSlice.ts +108 -108
  71. package/src/features/placements/studentPlacements/useStudentPlacements.tsx +9 -9
  72. package/src/features/placements/types.ts +10 -10
  73. package/src/features/referrals/useReferrals.tsx +56 -56
  74. package/src/features/updates/useUpdates.tsx +38 -38
  75. package/src/firebase/firebase.tsx +158 -153
  76. package/src/firebase/firebaseConfig.tsx +47 -45
  77. package/src/firebase/firebaseQuery.tsx +151 -151
  78. package/src/firebase/persistence.ts +84 -84
  79. package/src/firebase/readDatabase.tsx +236 -236
  80. package/src/firebase/util.tsx +352 -352
  81. package/src/firebase/writeDatabase.tsx +77 -77
  82. package/src/hooks.tsx +4476 -4463
  83. package/src/images/GatsbyBenchmarks.tsx +711 -711
  84. package/src/images/LogFuturePlacement.jsx +64 -64
  85. package/src/images/LogPreviousPlacement.jsx +228 -228
  86. package/src/images/gatsby_benchmarks.svg +466 -466
  87. package/src/images/log_future_placement.svg +114 -114
  88. package/src/images/log_previous_placement.svg +199 -199
  89. package/src/index.ts +34 -35
  90. package/src/readDatabase.tsx +3 -3
  91. package/src/reduxHooks.ts +295 -352
  92. package/src/tasksAndTips.ts +1267 -1267
  93. package/src/tutorialTips.ts +58 -58
  94. package/src/typeDefinitions.ts +1260 -1129
  95. package/src/util.ts +523 -177
  96. package/tsconfig.dev.json +5 -5
  97. package/tsconfig.json +21 -21
  98. package/lib/features/logs/logsSlice.d.ts +0 -93
  99. package/lib/features/logs/logsSlice.js +0 -146
  100. package/lib/features/logs/logsSlice.js.map +0 -1
  101. package/src/features/logs/logsSlice.ts +0 -208
package/lib/hooks.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import { DocumentData, QueryConstraint, QueryDocumentSnapshot, QueryFieldFilterConstraint } from "firebase/firestore";
2
- import { AlumniConvoUser, ApplicantStage, ApplicantWorkflow, Application, ArrowObject, CohortData, CustomFormSchema, FileItem, FlagCodes, InstituteData, OnboardingDocs, PlacementListing, Products, ProviderData, QueryObject, QueryObjectConstraint, SavedPlacement, Sorts, StudentPlacementData, UserData, UserGroupData, WorkflowStage } from "./typeDefinitions";
3
- import { OrganisationAddress } from "placementt-core";
2
+ import { AlumniConvoUser, ApplicantStage, Application, ArrowObject, CohortData, CustomFormSchema, FileItem, FlagCodes, InstituteData, OnboardingDocs, PlacementListing, Products, ProviderData, QueryObject, QueryObjectConstraint, Sorts, StudentPlacementData, UserData, UserGroupData, WorkflowStage } from "./typeDefinitions";
4
3
  type StudentPlacementListParams = {
5
4
  user: UserData;
6
5
  student?: UserData;
@@ -35,6 +34,9 @@ type NewInstitutePlacementParams = {
35
34
  inProgress?: boolean;
36
35
  view: "list" | "table";
37
36
  filters?: FilterObject;
37
+ initialSort?: string;
38
+ initialSearch?: string;
39
+ uid?: string;
38
40
  };
39
41
  export declare function useOldInstitutePlacementList({ id, user, cohort, queryConstraint, ql, inProgress }: InstitutePlacementParams): {
40
42
  placements: {
@@ -49,7 +51,7 @@ export declare function useOldInstitutePlacementList({ id, user, cohort, queryCo
49
51
  reset: () => void;
50
52
  changeQueryConstraints: (e: QueryConstraint[]) => void;
51
53
  };
52
- export declare function useNewInstitutePlacementList({ id, user, filters, view, cohort, queryConstraints, ql, inProgress }: NewInstitutePlacementParams): {
54
+ export declare function useNewInstitutePlacementList({ id, user, uid, filters, initialSort, initialSearch, view, cohort, queryConstraints, ql, inProgress }: NewInstitutePlacementParams): {
53
55
  tableData: {
54
56
  [key: string]: {
55
57
  [key: string]: unknown;
@@ -57,9 +59,9 @@ export declare function useNewInstitutePlacementList({ id, user, filters, view,
57
59
  };
58
60
  page: number;
59
61
  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">>;
62
+ updateSearch: (search: string) => void;
63
+ setFilters: (fFilters?: FilterObject) => void;
64
+ setView: (v: "list" | "table") => void;
63
65
  pageUp: () => void;
64
66
  pageDown: () => void;
65
67
  sorts: {
@@ -68,7 +70,7 @@ export declare function useNewInstitutePlacementList({ id, user, filters, view,
68
70
  direction: "asc" | "desc";
69
71
  };
70
72
  };
71
- updateSort: (sortLabel: string) => void;
73
+ updateSort: (sortLabel?: string) => void;
72
74
  sort: [string, {
73
75
  value: string;
74
76
  direction: "asc" | "desc";
@@ -91,8 +93,8 @@ export declare function useAlumniPaginator({ user, alumniConvoUser, filters, vie
91
93
  };
92
94
  page: number;
93
95
  loading: boolean | "loaded";
94
- setFilters: import("react").Dispatch<import("react").SetStateAction<FilterObject | undefined>>;
95
- setView: import("react").Dispatch<import("react").SetStateAction<"table" | "list">>;
96
+ setFilters: (fFilters?: FilterObject) => void;
97
+ setView: (v: "list" | "table") => void;
96
98
  pageUp: () => void;
97
99
  pageDown: () => void;
98
100
  sorts: {
@@ -133,20 +135,23 @@ export declare function useFilterTablePaginator({ data }: {
133
135
  } | undefined>>;
134
136
  page: number[];
135
137
  };
136
- export declare function usePlacementListingPaginator({ data, user }: {
138
+ export declare function useProviderContactPaginator({ data, user, view, filters }: {
137
139
  data: QueryObject[];
138
140
  user: UserData;
141
+ view: "list" | "table";
142
+ filters?: FilterObject;
139
143
  }): {
140
144
  tableData: {
141
- [key: string]: PlacementListing & {
142
- savedPlacement: SavedPlacement;
145
+ [key: string]: {
146
+ [key: string]: unknown;
143
147
  };
144
148
  };
145
- setPage: import("react").Dispatch<import("react").SetStateAction<number[]>>;
146
- setFilters: import("react").Dispatch<import("react").SetStateAction<{
147
- [key: string]: unknown;
148
- } | undefined>>;
149
- page: number[];
149
+ pageUp: () => void;
150
+ pageDown: () => void;
151
+ setFilters: (fFilters?: FilterObject) => void;
152
+ page: number;
153
+ setView: (v: "list" | "table") => void;
154
+ loading: boolean | "loaded";
150
155
  };
151
156
  type UserPaginatorParams = {
152
157
  user: UserData;
@@ -156,6 +161,42 @@ type UserPaginatorParams = {
156
161
  userType: "Staff" | "Students";
157
162
  sort?: string;
158
163
  };
164
+ type NewUserPaginatorParams = {
165
+ user: UserData;
166
+ cohort?: string;
167
+ queryConstraints?: QueryObjectConstraint;
168
+ ql?: number;
169
+ view: "list" | "table";
170
+ filters?: FilterObject;
171
+ institute: InstituteData;
172
+ userType: "Staff" | "Students";
173
+ initialSort?: string;
174
+ };
175
+ export declare function useNewCohortUserPaginator({ user, institute, initialSort, filters, view, cohort, queryConstraints, ql, userType }: NewUserPaginatorParams): {
176
+ tableData: {
177
+ [key: string]: {
178
+ [key: string]: unknown;
179
+ };
180
+ };
181
+ page: number;
182
+ loading: boolean | "loaded";
183
+ updateSearch: (search: string) => void;
184
+ setFilters: (fFilters?: FilterObject) => void;
185
+ setView: (v: "list" | "table") => void;
186
+ pageUp: () => void;
187
+ pageDown: () => void;
188
+ sorts: {
189
+ [label: string]: {
190
+ value: string;
191
+ direction: "asc" | "desc";
192
+ };
193
+ };
194
+ updateSort: (sortLabel?: string) => void;
195
+ sort: [string, {
196
+ value: string;
197
+ direction: "asc" | "desc";
198
+ }] | undefined;
199
+ };
159
200
  export declare function useCohortUserPaginator({ user, cohort, data, search, userType, sort }: UserPaginatorParams): {
160
201
  tableData: {
161
202
  [key: string]: {
@@ -208,162 +249,6 @@ export declare function useLazyLoadQueryList({ path, constraints, number, onItem
208
249
  loadMoreIcon: boolean;
209
250
  reset: () => void;
210
251
  };
211
- type PublicPlacementListingLoaderParams = {
212
- providerId?: string;
213
- number: number;
214
- };
215
- export declare function usePublicPlacementListingLoader({ providerId, number }: PublicPlacementListingLoaderParams): {
216
- items: {
217
- [key: string]: {
218
- [key: string]: unknown;
219
- };
220
- };
221
- loadMore: () => Promise<void>;
222
- loadMoreIcon: boolean;
223
- reset: () => void;
224
- };
225
- export type ApplicationHookParams = {
226
- successText: {
227
- submitted: {
228
- title: string;
229
- desc: string;
230
- };
231
- draftSaved: {
232
- title: string;
233
- desc: string;
234
- };
235
- stageComplete: {
236
- title: string;
237
- desc: string;
238
- };
239
- outcome: {
240
- title: string;
241
- desc: string;
242
- };
243
- };
244
- setSuccessPopup: import("react").Dispatch<import("react").SetStateAction<"submitted" | "draftSaved" | "stageComplete" | "outcome" | undefined>>;
245
- openSuccessPopup: (type: "submitted" | "draftSaved" | "stageComplete" | "outcome") => void;
246
- setFApplication: import("react").Dispatch<import("react").SetStateAction<Partial<Application>>>;
247
- fApplication: Partial<Application>;
248
- draftSaved: boolean;
249
- profileUrl: string | undefined;
250
- successPopup: "submitted" | "draftSaved" | "stageComplete" | "outcome" | undefined;
251
- fApplicationId: string | undefined;
252
- fListing: PlacementListing | false | undefined;
253
- student: UserData | undefined;
254
- fProvider: {
255
- details?: ProviderData;
256
- profile?: string;
257
- id?: string;
258
- } | undefined;
259
- onFApply: (draft?: boolean) => Promise<void>;
260
- setFormComplete: (formId: string, e: {
261
- [key: string]: unknown;
262
- }) => void;
263
- viewFile: (file: string, onOpen: (url: string) => void) => void;
264
- addFile: (files: string[], fileId: number) => void;
265
- uploadedFiles?: {
266
- [key: string]: FileItem;
267
- };
268
- getCurrentStage: (stage: number) => Promise<{
269
- stage: ApplicantStage;
270
- completedSections: {
271
- submitted?: string | undefined;
272
- filesViewed?: string[] | undefined;
273
- formsCompleted?: {
274
- [key: string]: unknown;
275
- } | undefined;
276
- filesUploaded?: {
277
- [key: number]: string[];
278
- } | undefined;
279
- };
280
- }>;
281
- currentStageComplete?: boolean;
282
- progressStage: (type: number | "accept" | "reject", e?: {
283
- feedback?: string;
284
- }) => Promise<void>;
285
- };
286
- export declare function useCreateApplicationRenderer({ user, listingId, listing, provider, application, applicationId, orgContext }: {
287
- user: UserData;
288
- listingId: string;
289
- applicationId?: string;
290
- listing?: PlacementListing;
291
- application?: Partial<Application>;
292
- orgContext?: {
293
- details: ProviderData;
294
- addresses: {
295
- [key: string]: OrganisationAddress;
296
- };
297
- applicantWorkflows: {
298
- [key: string]: ApplicantWorkflow;
299
- };
300
- };
301
- provider?: {
302
- details?: ProviderData;
303
- profile?: string;
304
- id?: string;
305
- };
306
- }): {
307
- successText: {
308
- submitted: {
309
- title: string;
310
- desc: string;
311
- };
312
- draftSaved: {
313
- title: string;
314
- desc: string;
315
- };
316
- stageComplete: {
317
- title: string;
318
- desc: string;
319
- };
320
- outcome: {
321
- title: string;
322
- desc: string;
323
- };
324
- };
325
- onFApply: (draft?: boolean) => Promise<void>;
326
- progressStage: (type: number | "accept" | "reject", e?: {
327
- feedback?: string;
328
- }) => Promise<void>;
329
- currentStageComplete: boolean | undefined;
330
- uploadedFiles: {
331
- [key: string]: FileItem;
332
- } | undefined;
333
- getCurrentStage: (stage: number) => Promise<{
334
- stage: ApplicantStage;
335
- completedSections: {
336
- submitted?: string | undefined;
337
- filesViewed?: string[] | undefined;
338
- formsCompleted?: {
339
- [key: string]: unknown;
340
- } | undefined;
341
- filesUploaded?: {
342
- [key: number]: string[];
343
- } | undefined;
344
- };
345
- }>;
346
- setFormComplete: (formId: string, e: {
347
- [key: string]: unknown;
348
- }) => void;
349
- viewFile: (file: string, onOpen: (url: string) => void) => void;
350
- addFile: (files: string[], fileId: number) => void;
351
- setSuccessPopup: import("react").Dispatch<import("react").SetStateAction<"submitted" | "draftSaved" | "stageComplete" | "outcome" | undefined>>;
352
- openSuccessPopup: (type: "submitted" | "draftSaved" | "stageComplete" | "outcome") => void;
353
- setFApplication: import("react").Dispatch<import("react").SetStateAction<Partial<Application>>>;
354
- fApplication: Partial<Application>;
355
- draftSaved: boolean;
356
- profileUrl: string | undefined;
357
- successPopup: "submitted" | "draftSaved" | "stageComplete" | "outcome" | undefined;
358
- fApplicationId: string | undefined;
359
- fListing: false | PlacementListing | undefined;
360
- student: UserData | undefined;
361
- fProvider: {
362
- details?: ProviderData;
363
- profile?: string;
364
- id?: string;
365
- } | undefined;
366
- };
367
252
  export declare function useProposePlacementRenderer({ user, orgContext, placement }: {
368
253
  user: UserData;
369
254
  orgContext?: {
@@ -393,7 +278,11 @@ export declare function useProposePlacementRenderer({ user, orgContext, placemen
393
278
  setAddressSectionComplete: import("react").Dispatch<import("react").SetStateAction<boolean>>;
394
279
  setPlacementSectionComplete: import("react").Dispatch<import("react").SetStateAction<boolean>>;
395
280
  proposePlacement: (draft?: boolean) => Promise<{
396
- data: any;
281
+ status: {
282
+ active: boolean;
283
+ inProgress: boolean;
284
+ completed: boolean;
285
+ };
397
286
  }>;
398
287
  deletePlacement: (id: string) => Promise<void>;
399
288
  setStudent: import("react").Dispatch<import("react").SetStateAction<UserData | undefined>>;
@@ -417,7 +306,7 @@ type CreateCohortRendererParams = {
417
306
  product: Products;
418
307
  initialData?: CohortData;
419
308
  };
420
- export type CreateCohortStages = "info" | "name" | "placementType" | "review";
309
+ export type CreateCohortStages = "info" | "name" | "placementType" | "database" | "review";
421
310
  export declare function useCreateCohortRenderer({ oId, product, initialData }: CreateCohortRendererParams): {
422
311
  submitCohort: () => void;
423
312
  submitSection: (e?: {
@@ -552,23 +441,24 @@ export declare function useApplicantWorkflowEditor({ user, initialData, onSubmit
552
441
  setArrows: import("react").Dispatch<import("react").SetStateAction<ArrowObject[]>>;
553
442
  setWorkflowNodes: import("react").Dispatch<import("react").SetStateAction<ApplicantStage[]>>;
554
443
  };
555
- type InstitutePlacementListingUploadParams = {
444
+ type InstituteProviderContactUploadParams = {
556
445
  user: UserData;
557
446
  onComplete?: () => void;
558
447
  };
559
- export type InstitutePlacementListingUpload = {
560
- provider: string;
561
- jobTitle: string;
448
+ export type InstituteProviderContactUpload = {
449
+ business: string;
450
+ forename?: string;
451
+ surname?: string;
562
452
  email: string;
563
453
  phone?: string;
564
- addressOne: string;
565
- addressTwo: string;
566
- city: string;
567
- postcode: string;
568
- country: string;
569
- };
570
- export declare function useInstitutePlacementListingHandler({ user }: InstitutePlacementListingUploadParams): {
571
- uploadPlacements: (placements: InstitutePlacementListingUpload[]) => Promise<boolean>;
454
+ addressOne?: string;
455
+ addressTwo?: string;
456
+ city?: string;
457
+ postcode?: string;
458
+ country?: string;
459
+ };
460
+ export declare function useInstituteProviderContactsHandler({ user }: InstituteProviderContactUploadParams): {
461
+ uploadProviderContacts: (providers: InstituteProviderContactUpload[], schoolId?: string) => Promise<boolean>;
572
462
  alert: {
573
463
  severity: "warning" | "error" | "success" | "info";
574
464
  msg: string;
@@ -863,8 +753,10 @@ export type DataViewerPaginater = {
863
753
  } | QueryObject[];
864
754
  additionalEntryProcessing?: (k: string, v: any) => Promise<any> | any;
865
755
  sorts?: Sorts;
756
+ initialSort?: string;
757
+ initialSearch?: string;
866
758
  };
867
- export declare function useDataViewerPaginator({ view: initialView, sorts, queryLimit, additionalEntryProcessing, formatItems, snapshot, filters: initialFilters, onSearch, data }: DataViewerPaginater): {
759
+ export declare function useDataViewerPaginator({ view: initialView, sorts, queryLimit, additionalEntryProcessing, formatItems, snapshot, filters: initialFilters, initialSort, initialSearch, onSearch, data }: DataViewerPaginater): {
868
760
  tableData: {
869
761
  [key: string]: {
870
762
  [key: string]: unknown;
@@ -872,7 +764,8 @@ export declare function useDataViewerPaginator({ view: initialView, sorts, query
872
764
  };
873
765
  pageUp: () => void;
874
766
  pageDown: () => void;
875
- setFilters: import("react").Dispatch<import("react").SetStateAction<FilterObject | undefined>>;
767
+ search: string | undefined;
768
+ setFilters: (fFilters?: FilterObject) => void;
876
769
  page: number;
877
770
  sorts: Sorts;
878
771
  loading: boolean | "loaded";
@@ -880,8 +773,8 @@ export declare function useDataViewerPaginator({ view: initialView, sorts, query
880
773
  value: string;
881
774
  direction: "asc" | "desc";
882
775
  }] | undefined;
883
- updateSort: (sortLabel: string) => void;
884
- setView: import("react").Dispatch<import("react").SetStateAction<"table" | "list">>;
885
- updateSearch: import("react").Dispatch<import("react").SetStateAction<string | undefined>>;
776
+ updateSort: (sortLabel?: string) => void;
777
+ setView: (v: "list" | "table") => void;
778
+ updateSearch: (search: string) => void;
886
779
  };
887
780
  export {};