placementt-core 1.400.1112 → 1.400.1114
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/callables/index.d.ts +1 -0
- package/lib/callables/index.js +1 -0
- package/lib/callables/index.js.map +1 -1
- package/lib/callables/registry.d.ts +46 -0
- package/lib/callables/registry.js +3 -1
- package/lib/callables/registry.js.map +1 -1
- package/lib/callables/wonde.d.ts +35 -0
- package/lib/callables/wonde.js +27 -0
- package/lib/callables/wonde.js.map +1 -0
- package/lib/hooks.d.ts +1 -1
- package/lib/hooks.js +11 -9
- package/lib/hooks.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/studentData.d.ts +55 -0
- package/lib/studentData.js +66 -0
- package/lib/studentData.js.map +1 -0
- package/lib/studentData.test.d.ts +1 -0
- package/lib/studentData.test.js +50 -0
- package/lib/studentData.test.js.map +1 -0
- package/lib/tasksAndTips.js +2 -2
- package/lib/tasksAndTips.js.map +1 -1
- package/lib/typeDefinitions.d.ts +14 -3
- package/lib/typeDefinitions.js.map +1 -1
- package/package.json +1 -1
- package/src/callables/index.ts +1 -0
- package/src/callables/registry.ts +3 -1
- package/src/callables/wonde.ts +25 -0
- package/src/hooks.tsx +12 -11
- package/src/index.ts +1 -0
- package/src/studentData.test.ts +67 -0
- package/src/studentData.ts +69 -0
- package/src/tasksAndTips.ts +2 -2
- package/src/typeDefinitions.ts +16 -3
package/lib/callables/index.d.ts
CHANGED
package/lib/callables/index.js
CHANGED
|
@@ -26,4 +26,5 @@ __exportStar(require("./studentLaunches"), exports);
|
|
|
26
26
|
__exportStar(require("./billing"), exports);
|
|
27
27
|
__exportStar(require("./hubImpactReport"), exports);
|
|
28
28
|
__exportStar(require("./e2e"), exports);
|
|
29
|
+
__exportStar(require("./wonde"), exports);
|
|
29
30
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/callables/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,6CAA2B;AAC3B,uDAAqC;AACrC,8CAA4B;AAC5B,2CAAyB;AACzB,6CAA2B;AAC3B,oDAAkC;AAClC,uCAAqB;AACrB,oDAAkC;AAClC,4CAA0B;AAC1B,oDAAkC;AAClC,wCAAsB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/callables/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,6CAA2B;AAC3B,uDAAqC;AACrC,8CAA4B;AAC5B,2CAAyB;AACzB,6CAA2B;AAC3B,oDAAkC;AAClC,uCAAqB;AACrB,oDAAkC;AAClC,4CAA0B;AAC1B,oDAAkC;AAClC,wCAAsB;AACtB,0CAAwB"}
|
|
@@ -11,6 +11,28 @@ import { z } from "zod";
|
|
|
11
11
|
* equals the sum of the group key counts.
|
|
12
12
|
*/
|
|
13
13
|
export declare const allCallables: {
|
|
14
|
+
"wonde-requestConnection": {
|
|
15
|
+
request: z.ZodObject<{
|
|
16
|
+
oId: z.ZodString;
|
|
17
|
+
itManagerName: z.ZodString;
|
|
18
|
+
itManagerEmail: z.ZodString;
|
|
19
|
+
}, "strip", z.ZodTypeAny, {
|
|
20
|
+
oId: string;
|
|
21
|
+
itManagerName: string;
|
|
22
|
+
itManagerEmail: string;
|
|
23
|
+
}, {
|
|
24
|
+
oId: string;
|
|
25
|
+
itManagerName: string;
|
|
26
|
+
itManagerEmail: string;
|
|
27
|
+
}>;
|
|
28
|
+
response: z.ZodObject<{
|
|
29
|
+
taskId: z.ZodString;
|
|
30
|
+
}, "strip", z.ZodTypeAny, {
|
|
31
|
+
taskId: string;
|
|
32
|
+
}, {
|
|
33
|
+
taskId: string;
|
|
34
|
+
}>;
|
|
35
|
+
};
|
|
14
36
|
"e2e-redeemSignInLink": {
|
|
15
37
|
request: z.ZodObject<{
|
|
16
38
|
token: z.ZodString;
|
|
@@ -2555,4 +2577,28 @@ export declare const callableGroups: {
|
|
|
2555
2577
|
}>;
|
|
2556
2578
|
};
|
|
2557
2579
|
};
|
|
2580
|
+
wondeCallables: {
|
|
2581
|
+
"wonde-requestConnection": {
|
|
2582
|
+
request: z.ZodObject<{
|
|
2583
|
+
oId: z.ZodString;
|
|
2584
|
+
itManagerName: z.ZodString;
|
|
2585
|
+
itManagerEmail: z.ZodString;
|
|
2586
|
+
}, "strip", z.ZodTypeAny, {
|
|
2587
|
+
oId: string;
|
|
2588
|
+
itManagerName: string;
|
|
2589
|
+
itManagerEmail: string;
|
|
2590
|
+
}, {
|
|
2591
|
+
oId: string;
|
|
2592
|
+
itManagerName: string;
|
|
2593
|
+
itManagerEmail: string;
|
|
2594
|
+
}>;
|
|
2595
|
+
response: z.ZodObject<{
|
|
2596
|
+
taskId: z.ZodString;
|
|
2597
|
+
}, "strip", z.ZodTypeAny, {
|
|
2598
|
+
taskId: string;
|
|
2599
|
+
}, {
|
|
2600
|
+
taskId: string;
|
|
2601
|
+
}>;
|
|
2602
|
+
};
|
|
2603
|
+
};
|
|
2558
2604
|
};
|
|
@@ -14,6 +14,7 @@ const billing_1 = require("./billing");
|
|
|
14
14
|
const jobRoles_1 = require("./jobRoles");
|
|
15
15
|
const hubImpactReport_1 = require("./hubImpactReport");
|
|
16
16
|
const e2e_1 = require("./e2e");
|
|
17
|
+
const wonde_1 = require("./wonde");
|
|
17
18
|
/**
|
|
18
19
|
* The single source of truth for every typed callable. Add a feature group's
|
|
19
20
|
* spread here and its callables are automatically covered by:
|
|
@@ -39,7 +40,8 @@ exports.allCallables = {
|
|
|
39
40
|
...jobRoles_1.jobRolesCallables,
|
|
40
41
|
...hubImpactReport_1.hubImpactReportCallables,
|
|
41
42
|
...e2e_1.e2eCallables,
|
|
43
|
+
...wonde_1.wondeCallables,
|
|
42
44
|
};
|
|
43
45
|
/** The per-group maps, exported so tests can assert no key collisions. */
|
|
44
|
-
exports.callableGroups = { destinationsConfigCallables: destinationsConfig_1.destinationsConfigCallables, placementCallables: placement_1.placementCallables, eventsCallables: events_1.eventsCallables, surveyCallables: surveys_1.surveyCallables, checksCallables: checks_1.checksCallables, benchmarksCallables: benchmarks_1.benchmarksCallables, apprenticeshipsCallables: apprenticeships_1.apprenticeshipsCallables, heCallables: he_1.heCallables, studentLaunchCallables: studentLaunches_1.studentLaunchCallables, billingCallables: billing_1.billingCallables, jobRolesCallables: jobRoles_1.jobRolesCallables, hubImpactReportCallables: hubImpactReport_1.hubImpactReportCallables, e2eCallables: e2e_1.e2eCallables };
|
|
46
|
+
exports.callableGroups = { destinationsConfigCallables: destinationsConfig_1.destinationsConfigCallables, placementCallables: placement_1.placementCallables, eventsCallables: events_1.eventsCallables, surveyCallables: surveys_1.surveyCallables, checksCallables: checks_1.checksCallables, benchmarksCallables: benchmarks_1.benchmarksCallables, apprenticeshipsCallables: apprenticeships_1.apprenticeshipsCallables, heCallables: he_1.heCallables, studentLaunchCallables: studentLaunches_1.studentLaunchCallables, billingCallables: billing_1.billingCallables, jobRolesCallables: jobRoles_1.jobRolesCallables, hubImpactReportCallables: hubImpactReport_1.hubImpactReportCallables, e2eCallables: e2e_1.e2eCallables, wondeCallables: wonde_1.wondeCallables };
|
|
45
47
|
//# sourceMappingURL=registry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/callables/registry.ts"],"names":[],"mappings":";;;AAEA,6DAAiE;AACjE,2CAA+C;AAC/C,qCAAyC;AACzC,uCAA0C;AAC1C,qCAAyC;AACzC,6CAAiD;AACjD,uDAA2D;AAC3D,6BAAiC;AACjC,uDAAyD;AACzD,uCAA2C;AAC3C,yCAA6C;AAC7C,uDAA2D;AAC3D,+BAAmC;
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/callables/registry.ts"],"names":[],"mappings":";;;AAEA,6DAAiE;AACjE,2CAA+C;AAC/C,qCAAyC;AACzC,uCAA0C;AAC1C,qCAAyC;AACzC,6CAAiD;AACjD,uDAA2D;AAC3D,6BAAiC;AACjC,uDAAyD;AACzD,uCAA2C;AAC3C,yCAA6C;AAC7C,uDAA2D;AAC3D,+BAAmC;AACnC,mCAAuC;AAEvC;;;;;;;;;;GAUG;AACU,QAAA,YAAY,GAAG;IACxB,GAAG,gDAA2B;IAC9B,GAAG,8BAAkB;IACrB,GAAG,wBAAe;IAClB,GAAG,yBAAe;IAClB,GAAG,wBAAe;IAClB,GAAG,gCAAmB;IACtB,GAAG,0CAAwB;IAC3B,GAAG,gBAAW;IACd,GAAG,wCAAsB;IACzB,GAAG,0BAAgB;IACnB,GAAG,4BAAiB;IACpB,GAAG,0CAAwB;IAC3B,GAAG,kBAAY;IACf,GAAG,sBAAc;CACI,CAAC;AAiB1B,0EAA0E;AAC7D,QAAA,cAAc,GAAG,EAAC,2BAA2B,EAA3B,gDAA2B,EAAE,kBAAkB,EAAlB,8BAAkB,EAAE,eAAe,EAAf,wBAAe,EAAE,eAAe,EAAf,yBAAe,EAAE,eAAe,EAAf,wBAAe,EAAE,mBAAmB,EAAnB,gCAAmB,EAAE,wBAAwB,EAAxB,0CAAwB,EAAE,WAAW,EAAX,gBAAW,EAAE,sBAAsB,EAAtB,wCAAsB,EAAE,gBAAgB,EAAhB,0BAAgB,EAAE,iBAAiB,EAAjB,4BAAiB,EAAE,wBAAwB,EAAxB,0CAAwB,EAAE,YAAY,EAAZ,kBAAY,EAAE,cAAc,EAAd,sBAAc,EAAC,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Contracts for the Wonde connection request
|
|
4
|
+
* (`Placementt-Backend/functions/src/wonde.ts`).
|
|
5
|
+
*
|
|
6
|
+
* Wonde only approves a connection once the school's IT manager signs it off, so
|
|
7
|
+
* the school gives us their details and we raise the request with Wonde. Nothing
|
|
8
|
+
* is emailed from the platform: the request lands as a support task.
|
|
9
|
+
*/
|
|
10
|
+
export declare const wondeCallables: {
|
|
11
|
+
"wonde-requestConnection": {
|
|
12
|
+
request: z.ZodObject<{
|
|
13
|
+
/** The school the connection is for. */
|
|
14
|
+
oId: z.ZodString;
|
|
15
|
+
itManagerName: z.ZodString;
|
|
16
|
+
itManagerEmail: z.ZodString;
|
|
17
|
+
}, "strip", z.ZodTypeAny, {
|
|
18
|
+
oId: string;
|
|
19
|
+
itManagerName: string;
|
|
20
|
+
itManagerEmail: string;
|
|
21
|
+
}, {
|
|
22
|
+
oId: string;
|
|
23
|
+
itManagerName: string;
|
|
24
|
+
itManagerEmail: string;
|
|
25
|
+
}>;
|
|
26
|
+
response: z.ZodObject<{
|
|
27
|
+
/** supportTasks/{id} raised, or the open one it updated. */
|
|
28
|
+
taskId: z.ZodString;
|
|
29
|
+
}, "strip", z.ZodTypeAny, {
|
|
30
|
+
taskId: string;
|
|
31
|
+
}, {
|
|
32
|
+
taskId: string;
|
|
33
|
+
}>;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.wondeCallables = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
/**
|
|
6
|
+
* Contracts for the Wonde connection request
|
|
7
|
+
* (`Placementt-Backend/functions/src/wonde.ts`).
|
|
8
|
+
*
|
|
9
|
+
* Wonde only approves a connection once the school's IT manager signs it off, so
|
|
10
|
+
* the school gives us their details and we raise the request with Wonde. Nothing
|
|
11
|
+
* is emailed from the platform: the request lands as a support task.
|
|
12
|
+
*/
|
|
13
|
+
exports.wondeCallables = {
|
|
14
|
+
"wonde-requestConnection": {
|
|
15
|
+
request: zod_1.z.object({
|
|
16
|
+
/** The school the connection is for. */
|
|
17
|
+
oId: zod_1.z.string().min(1),
|
|
18
|
+
itManagerName: zod_1.z.string().trim().min(1).max(200),
|
|
19
|
+
itManagerEmail: zod_1.z.string().trim().email().max(320),
|
|
20
|
+
}),
|
|
21
|
+
response: zod_1.z.object({
|
|
22
|
+
/** supportTasks/{id} raised, or the open one it updated. */
|
|
23
|
+
taskId: zod_1.z.string(),
|
|
24
|
+
}),
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=wonde.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wonde.js","sourceRoot":"","sources":["../../src/callables/wonde.ts"],"names":[],"mappings":";;;AAAA,6BAAsB;AAGtB;;;;;;;GAOG;AACU,QAAA,cAAc,GAAG;IAC1B,yBAAyB,EAAE;QACvB,OAAO,EAAE,OAAC,CAAC,MAAM,CAAC;YACd,wCAAwC;YACxC,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;YACtB,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;YAChD,cAAc,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC;SACrD,CAAC;QACF,QAAQ,EAAE,OAAC,CAAC,MAAM,CAAC;YACf,4DAA4D;YAC5D,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE;SACrB,CAAC;KACL;CACoB,CAAC"}
|
package/lib/hooks.d.ts
CHANGED
|
@@ -245,7 +245,7 @@ type NewUserPaginatorParams = {
|
|
|
245
245
|
view: "list" | "table";
|
|
246
246
|
filters?: FilterObject;
|
|
247
247
|
institute: InstituteData;
|
|
248
|
-
userType: "Staff" | "Students";
|
|
248
|
+
userType: "Staff" | "Students" | "Leavers";
|
|
249
249
|
initialSort?: string;
|
|
250
250
|
trustSchoolsIDs?: string[];
|
|
251
251
|
};
|
package/lib/hooks.js
CHANGED
|
@@ -2235,7 +2235,10 @@ function useUserUploadHandler({ product, oId, event, eventId, userType, user, on
|
|
|
2235
2235
|
const [emptyCellsWarning, setEmptyCellsWarning] = (0, react_1.useState)(false);
|
|
2236
2236
|
const [alert, setAlert] = (0, react_1.useState)();
|
|
2237
2237
|
const { execute } = (0, firebase_1.useExecuteCallableJob)({ user: user });
|
|
2238
|
-
|
|
2238
|
+
// Students also need a year group: Destinations, Development and the careers
|
|
2239
|
+
// calendar are all set up per year group, and a CSV is the only way a school
|
|
2240
|
+
// without Wonde gets one onto its students.
|
|
2241
|
+
const requiredFields = ["forename", "surname", "email", ...(userType === "Students" ? [constants_1.STUDENT_YEAR_FIELD] : [])];
|
|
2239
2242
|
const checkData = (userData) => {
|
|
2240
2243
|
setAlert(undefined);
|
|
2241
2244
|
userData = userData.filter((u) => Object.entries(u).some(([, v]) => v));
|
|
@@ -2268,15 +2271,14 @@ function useUserUploadHandler({ product, oId, event, eventId, userType, user, on
|
|
|
2268
2271
|
setAlert({ msg: "Data cannot be uploaded in unnamed columns.", severity: "error" });
|
|
2269
2272
|
return false;
|
|
2270
2273
|
}
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
}
|
|
2277
|
-
emptyOptionalCell = true;
|
|
2278
|
-
}
|
|
2274
|
+
// Checked against the list rather than the row's keys, so a required
|
|
2275
|
+
// column missing from the upload altogether fails too.
|
|
2276
|
+
if (requiredFields.some((field) => !user[field])) {
|
|
2277
|
+
setAlert({ msg: "All users must contain " + requiredFields.map((f) => f === constants_1.STUDENT_YEAR_FIELD ? "year group" : f).join(", "), severity: "error" });
|
|
2278
|
+
emptyRequiredCell = true;
|
|
2279
2279
|
}
|
|
2280
|
+
if (Object.values(user).some((v) => !v))
|
|
2281
|
+
emptyOptionalCell = true;
|
|
2280
2282
|
// Add more test cases
|
|
2281
2283
|
}
|
|
2282
2284
|
if (emptyRequiredCell) {
|