@appcorp/fusion-storybook 0.2.7 → 0.2.9
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.
|
@@ -34,7 +34,7 @@ export declare const TEACHER_ACTION_TYPES: {
|
|
|
34
34
|
city: string | null;
|
|
35
35
|
country: string | null;
|
|
36
36
|
dateOfBirth: string | null;
|
|
37
|
-
emergencyPhone: string
|
|
37
|
+
emergencyPhone: string;
|
|
38
38
|
enabled: boolean;
|
|
39
39
|
experience: number | null;
|
|
40
40
|
firstName: string;
|
|
@@ -42,7 +42,7 @@ export declare const TEACHER_ACTION_TYPES: {
|
|
|
42
42
|
id: string;
|
|
43
43
|
joiningDate: string;
|
|
44
44
|
lastName: string;
|
|
45
|
-
phone: string
|
|
45
|
+
phone: string;
|
|
46
46
|
postalCode: string | null;
|
|
47
47
|
qualification: string | null;
|
|
48
48
|
schoolId: string;
|
|
@@ -67,7 +67,7 @@ export declare const TEACHER_ACTION_TYPES: {
|
|
|
67
67
|
city: string | null;
|
|
68
68
|
country: string | null;
|
|
69
69
|
dateOfBirth: string | null;
|
|
70
|
-
emergencyPhone: string
|
|
70
|
+
emergencyPhone: string;
|
|
71
71
|
enabled: boolean;
|
|
72
72
|
experience: number | null;
|
|
73
73
|
firstName: string;
|
|
@@ -75,7 +75,7 @@ export declare const TEACHER_ACTION_TYPES: {
|
|
|
75
75
|
id: string;
|
|
76
76
|
joiningDate: string;
|
|
77
77
|
lastName: string;
|
|
78
|
-
phone: string
|
|
78
|
+
phone: string;
|
|
79
79
|
postalCode: string | null;
|
|
80
80
|
qualification: string | null;
|
|
81
81
|
schoolId: string;
|
|
@@ -102,7 +102,7 @@ export declare const TEACHER_ACTION_TYPES: {
|
|
|
102
102
|
city: string | null;
|
|
103
103
|
country: string | null;
|
|
104
104
|
dateOfBirth: string | null;
|
|
105
|
-
emergencyPhone: string
|
|
105
|
+
emergencyPhone: string;
|
|
106
106
|
enabled: boolean;
|
|
107
107
|
experience: number | null;
|
|
108
108
|
firstName: string;
|
|
@@ -110,7 +110,7 @@ export declare const TEACHER_ACTION_TYPES: {
|
|
|
110
110
|
id: string;
|
|
111
111
|
joiningDate: string;
|
|
112
112
|
lastName: string;
|
|
113
|
-
phone: string
|
|
113
|
+
phone: string;
|
|
114
114
|
postalCode: string | null;
|
|
115
115
|
qualification: string | null;
|
|
116
116
|
schoolId: string;
|
|
@@ -135,7 +135,7 @@ export declare const TEACHER_ACTION_TYPES: {
|
|
|
135
135
|
city: string | null;
|
|
136
136
|
country: string | null;
|
|
137
137
|
dateOfBirth: string | null;
|
|
138
|
-
emergencyPhone: string
|
|
138
|
+
emergencyPhone: string;
|
|
139
139
|
enabled: boolean;
|
|
140
140
|
experience: number | null;
|
|
141
141
|
firstName: string;
|
|
@@ -143,7 +143,7 @@ export declare const TEACHER_ACTION_TYPES: {
|
|
|
143
143
|
id: string;
|
|
144
144
|
joiningDate: string;
|
|
145
145
|
lastName: string;
|
|
146
|
-
phone: string
|
|
146
|
+
phone: string;
|
|
147
147
|
postalCode: string | null;
|
|
148
148
|
qualification: string | null;
|
|
149
149
|
schoolId: string;
|
|
@@ -168,7 +168,7 @@ export declare const TEACHER_ACTION_TYPES: {
|
|
|
168
168
|
city: string | null;
|
|
169
169
|
country: string | null;
|
|
170
170
|
dateOfBirth: string | null;
|
|
171
|
-
emergencyPhone: string
|
|
171
|
+
emergencyPhone: string;
|
|
172
172
|
enabled: boolean;
|
|
173
173
|
experience: number | null;
|
|
174
174
|
firstName: string;
|
|
@@ -176,7 +176,7 @@ export declare const TEACHER_ACTION_TYPES: {
|
|
|
176
176
|
id: string;
|
|
177
177
|
joiningDate: string;
|
|
178
178
|
lastName: string;
|
|
179
|
-
phone: string
|
|
179
|
+
phone: string;
|
|
180
180
|
postalCode: string | null;
|
|
181
181
|
qualification: string | null;
|
|
182
182
|
schoolId: string;
|
|
@@ -233,7 +233,7 @@ export declare const useTeacherModule: () => {
|
|
|
233
233
|
city: string | null;
|
|
234
234
|
country: string | null;
|
|
235
235
|
dateOfBirth: string | null;
|
|
236
|
-
emergencyPhone: string
|
|
236
|
+
emergencyPhone: string;
|
|
237
237
|
enabled: boolean;
|
|
238
238
|
experience: number | null;
|
|
239
239
|
firstName: string;
|
|
@@ -241,7 +241,7 @@ export declare const useTeacherModule: () => {
|
|
|
241
241
|
id: string;
|
|
242
242
|
joiningDate: string;
|
|
243
243
|
lastName: string;
|
|
244
|
-
phone: string
|
|
244
|
+
phone: string;
|
|
245
245
|
postalCode: string | null;
|
|
246
246
|
qualification: string | null;
|
|
247
247
|
schoolId: string;
|
|
@@ -67,7 +67,7 @@ const teacherConfig = {
|
|
|
67
67
|
city: null,
|
|
68
68
|
country: null,
|
|
69
69
|
dateOfBirth: null,
|
|
70
|
-
emergencyPhone:
|
|
70
|
+
emergencyPhone: "",
|
|
71
71
|
enabled: true,
|
|
72
72
|
experience: null,
|
|
73
73
|
firstName: "",
|
|
@@ -75,7 +75,7 @@ const teacherConfig = {
|
|
|
75
75
|
id: "",
|
|
76
76
|
joiningDate: new Date().toISOString().split("T")[0],
|
|
77
77
|
lastName: "",
|
|
78
|
-
phone:
|
|
78
|
+
phone: "",
|
|
79
79
|
postalCode: null,
|
|
80
80
|
qualification: null,
|
|
81
81
|
schoolId: "",
|
|
@@ -216,7 +216,9 @@ export const useTeacherModule = () => {
|
|
|
216
216
|
dispatch({
|
|
217
217
|
type: TEACHER_ACTION_TYPES.SET_FORM_DATA,
|
|
218
218
|
payload: {
|
|
219
|
-
form: Object.assign(Object.assign({}, teacher), { phone: formatPhoneDisplay(teacher.phone) || "", emergencyPhone:
|
|
219
|
+
form: Object.assign(Object.assign({}, teacher), { phone: (teacher.phone && formatPhoneDisplay(teacher.phone)) || "", emergencyPhone: (teacher.emergencyPhone &&
|
|
220
|
+
formatPhoneDisplay(teacher.emergencyPhone)) ||
|
|
221
|
+
"", filterEnabled: undefined }),
|
|
220
222
|
},
|
|
221
223
|
});
|
|
222
224
|
}
|
|
@@ -427,7 +429,7 @@ export const useTeacherModule = () => {
|
|
|
427
429
|
payload: { key: "avatarUploading", value: false },
|
|
428
430
|
});
|
|
429
431
|
}
|
|
430
|
-
}, [state.id, dispatch, showToast
|
|
432
|
+
}, [state.id, dispatch, showToast]);
|
|
431
433
|
const applyFilters = useCallback(() => {
|
|
432
434
|
dispatch({
|
|
433
435
|
type: TEACHER_ACTION_TYPES.SET_CURRENT_PAGE,
|
|
@@ -14,39 +14,35 @@ export const teacherFormValidation = z.object({
|
|
|
14
14
|
city: z.string().optional().nullable(),
|
|
15
15
|
country: z.string().optional().nullable(),
|
|
16
16
|
dateOfBirth: z.string().optional().nullable(),
|
|
17
|
-
emergencyPhone: z
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
}),
|
|
17
|
+
emergencyPhone: z.string().nullable().optional(),
|
|
18
|
+
// .superRefine((val, ctx) => {
|
|
19
|
+
// if (!val) return; // null, undefined, or empty string are OK
|
|
20
|
+
// if (
|
|
21
|
+
// !/^([+]?[\s0-9]+)?(\d{3}|[(]?[0-9]+[)]?)?([-]?[\s]?[0-9])+$/.test(val)
|
|
22
|
+
// ) {
|
|
23
|
+
// ctx.addIssue({
|
|
24
|
+
// code: z.ZodIssueCode.custom,
|
|
25
|
+
// message: "Invalid phone number format",
|
|
26
|
+
// });
|
|
27
|
+
// }
|
|
28
|
+
// }),
|
|
31
29
|
experience: z.number().optional().nullable(),
|
|
32
30
|
firstName: z.string().min(1, "First name is required"),
|
|
33
31
|
gender: z.string().optional().nullable(),
|
|
34
32
|
joiningDate: z.string(),
|
|
35
33
|
lastName: z.string().min(1, "Last name is required"),
|
|
36
|
-
phone: z
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
}),
|
|
34
|
+
phone: z.string().nullable().optional(),
|
|
35
|
+
// .superRefine((val, ctx) => {
|
|
36
|
+
// if (!val) return; // null, undefined, or empty string are OK
|
|
37
|
+
// if (
|
|
38
|
+
// !/^([+]?[\s0-9]+)?(\d{3}|[(]?[0-9]+[)]?)?([-]?[\s]?[0-9])+$/.test(val)
|
|
39
|
+
// ) {
|
|
40
|
+
// ctx.addIssue({
|
|
41
|
+
// code: z.ZodIssueCode.custom,
|
|
42
|
+
// message: "Invalid phone number format",
|
|
43
|
+
// });
|
|
44
|
+
// }
|
|
45
|
+
// }),
|
|
50
46
|
postalCode: z.string().optional().nullable(),
|
|
51
47
|
qualification: z.string().optional().nullable(),
|
|
52
48
|
specialization: z.string().optional().nullable(),
|