phx-react 1.3.1680 → 1.3.1681
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/dist/cjs/assets/icons/index.js +2 -0
- package/dist/cjs/assets/icons/index.js.map +1 -1
- package/dist/cjs/assets/icons/index.ts +2 -0
- package/dist/cjs/assets/icons/paper-clip.svg +3 -0
- package/dist/cjs/components/FormTarget/components/modal-delete/modal-delete.d.ts +13 -0
- package/dist/cjs/components/FormTarget/components/modal-delete/modal-delete.js +19 -0
- package/dist/cjs/components/FormTarget/components/modal-delete/modal-delete.js.map +1 -0
- package/dist/cjs/components/FormTarget/components/modal-import/confirm-upload.d.ts +7 -0
- package/dist/cjs/components/FormTarget/components/modal-import/confirm-upload.js +25 -0
- package/dist/cjs/components/FormTarget/components/modal-import/confirm-upload.js.map +1 -0
- package/dist/cjs/components/FormTarget/components/modal-import/modal-import-user.d.ts +10 -0
- package/dist/cjs/components/FormTarget/components/modal-import/modal-import-user.js +177 -0
- package/dist/cjs/components/FormTarget/components/modal-import/modal-import-user.js.map +1 -0
- package/dist/cjs/components/FormTarget/components/modal-import/preview-user.d.ts +10 -0
- package/dist/cjs/components/FormTarget/components/modal-import/preview-user.js +22 -0
- package/dist/cjs/components/FormTarget/components/modal-import/preview-user.js.map +1 -0
- package/dist/cjs/components/FormTarget/components/modal-import/table-custom-user.d.ts +11 -0
- package/dist/cjs/components/FormTarget/components/modal-import/table-custom-user.js +56 -0
- package/dist/cjs/components/FormTarget/components/modal-import/table-custom-user.js.map +1 -0
- package/dist/cjs/components/FormTarget/components/table-custom-list.js +51 -47
- package/dist/cjs/components/FormTarget/components/table-custom-list.js.map +1 -1
- package/dist/cjs/components/FormTarget/constant.d.ts +13 -0
- package/dist/cjs/components/FormTarget/constant.js +15 -1
- package/dist/cjs/components/FormTarget/constant.js.map +1 -1
- package/dist/cjs/components/FormTarget/graphql/query.d.ts +5 -0
- package/dist/cjs/components/FormTarget/graphql/query.js +162 -1
- package/dist/cjs/components/FormTarget/graphql/query.js.map +1 -1
- package/dist/cjs/components/FormTarget/hooks/use-import-user.d.ts +5 -0
- package/dist/cjs/components/FormTarget/hooks/use-import-user.js +168 -0
- package/dist/cjs/components/FormTarget/hooks/use-import-user.js.map +1 -0
- package/dist/cjs/components/FormTarget/type/target.d.ts +5 -0
- package/dist/cjs/components/FormTarget/type/user.d.ts +77 -0
- package/dist/cjs/components/FormTarget/type/user.js +3 -0
- package/dist/cjs/components/FormTarget/type/user.js.map +1 -0
- package/dist/cjs/components/UploadFile/ButtonUpload.d.ts +1 -1
- package/dist/cjs/components/UploadFile/FormUpload.d.ts +24 -1
- package/dist/cjs/components/UploadFile/FormUpload.js +29 -18
- package/dist/cjs/components/UploadFile/FormUpload.js.map +1 -1
- package/dist/cjs/components/UploadFile/PHXUploadFile.d.ts +50 -0
- package/dist/cjs/components/UploadFile/PHXUploadFile.js +24 -0
- package/dist/cjs/components/UploadFile/PHXUploadFile.js.map +1 -0
- package/dist/cjs/components/UploadFile/UploadFile.d.ts +1 -1
- package/dist/cjs/components/UploadFile/UploadFile.js +5 -5
- package/dist/cjs/components/UploadFile/UploadFile.js.map +1 -1
- package/dist/cjs/components/UploadFile/index.d.ts +1 -1
- package/dist/cjs/components/UploadFile/index.js +1 -1
- package/dist/cjs/components/UploadFile/index.js.map +1 -1
- package/dist/esm/assets/icons/index.js +2 -0
- package/dist/esm/assets/icons/index.js.map +1 -1
- package/dist/esm/assets/icons/index.ts +2 -0
- package/dist/esm/assets/icons/paper-clip.svg +3 -0
- package/dist/esm/components/FormTarget/components/modal-delete/modal-delete.d.ts +13 -0
- package/dist/esm/components/FormTarget/components/modal-delete/modal-delete.js +14 -0
- package/dist/esm/components/FormTarget/components/modal-delete/modal-delete.js.map +1 -0
- package/dist/esm/components/FormTarget/components/modal-import/confirm-upload.d.ts +7 -0
- package/dist/esm/components/FormTarget/components/modal-import/confirm-upload.js +20 -0
- package/dist/esm/components/FormTarget/components/modal-import/confirm-upload.js.map +1 -0
- package/dist/esm/components/FormTarget/components/modal-import/modal-import-user.d.ts +10 -0
- package/dist/esm/components/FormTarget/components/modal-import/modal-import-user.js +173 -0
- package/dist/esm/components/FormTarget/components/modal-import/modal-import-user.js.map +1 -0
- package/dist/esm/components/FormTarget/components/modal-import/preview-user.d.ts +10 -0
- package/dist/esm/components/FormTarget/components/modal-import/preview-user.js +17 -0
- package/dist/esm/components/FormTarget/components/modal-import/preview-user.js.map +1 -0
- package/dist/esm/components/FormTarget/components/modal-import/table-custom-user.d.ts +11 -0
- package/dist/esm/components/FormTarget/components/modal-import/table-custom-user.js +51 -0
- package/dist/esm/components/FormTarget/components/modal-import/table-custom-user.js.map +1 -0
- package/dist/esm/components/FormTarget/components/table-custom-list.js +51 -47
- package/dist/esm/components/FormTarget/components/table-custom-list.js.map +1 -1
- package/dist/esm/components/FormTarget/constant.d.ts +13 -0
- package/dist/esm/components/FormTarget/constant.js +14 -0
- package/dist/esm/components/FormTarget/constant.js.map +1 -1
- package/dist/esm/components/FormTarget/graphql/query.d.ts +5 -0
- package/dist/esm/components/FormTarget/graphql/query.js +161 -0
- package/dist/esm/components/FormTarget/graphql/query.js.map +1 -1
- package/dist/esm/components/FormTarget/hooks/use-import-user.d.ts +5 -0
- package/dist/esm/components/FormTarget/hooks/use-import-user.js +163 -0
- package/dist/esm/components/FormTarget/hooks/use-import-user.js.map +1 -0
- package/dist/esm/components/FormTarget/type/target.d.ts +5 -0
- package/dist/esm/components/FormTarget/type/user.d.ts +77 -0
- package/dist/esm/components/FormTarget/type/user.js +2 -0
- package/dist/esm/components/FormTarget/type/user.js.map +1 -0
- package/dist/esm/components/UploadFile/ButtonUpload.d.ts +1 -1
- package/dist/esm/components/UploadFile/FormUpload.d.ts +24 -1
- package/dist/esm/components/UploadFile/FormUpload.js +29 -18
- package/dist/esm/components/UploadFile/FormUpload.js.map +1 -1
- package/dist/esm/components/UploadFile/PHXUploadFile.d.ts +50 -0
- package/dist/esm/components/UploadFile/PHXUploadFile.js +19 -0
- package/dist/esm/components/UploadFile/PHXUploadFile.js.map +1 -0
- package/dist/esm/components/UploadFile/UploadFile.d.ts +1 -1
- package/dist/esm/components/UploadFile/UploadFile.js +3 -3
- package/dist/esm/components/UploadFile/UploadFile.js.map +1 -1
- package/dist/esm/components/UploadFile/index.d.ts +1 -1
- package/dist/esm/components/UploadFile/index.js +1 -1
- package/dist/esm/components/UploadFile/index.js.map +1 -1
- package/package.json +2 -1
|
@@ -28,6 +28,14 @@ export declare const FILTER_BY: {
|
|
|
28
28
|
readonly DEPARTMENT: "DEPARTMENT";
|
|
29
29
|
readonly CUSTOM_LIST: "CUSTOM_LIST";
|
|
30
30
|
};
|
|
31
|
+
export declare enum ECoreSchemaGroup {
|
|
32
|
+
CORE_SHARED = "core-shared",
|
|
33
|
+
CORE_ACADEMIC = "core-academic",
|
|
34
|
+
CORE_STUDENT = "core-student",
|
|
35
|
+
CORE_FINANCE = "core-finance",
|
|
36
|
+
CORE_ADMIN = "core-admin",
|
|
37
|
+
CORE_LAB = "core-lab"
|
|
38
|
+
}
|
|
31
39
|
export declare const VALIDATE_REQUIRED_INPUT = "Tr\u01B0\u1EDDng n\u00E0y kh\u00F4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng";
|
|
32
40
|
export declare const DEFAULT_NOTIFY_WITH_BY_TARGET: {
|
|
33
41
|
SV: ENotifyWith;
|
|
@@ -37,3 +45,8 @@ export declare const DEFAULT_NOTIFY_WITH_BY_TARGET: {
|
|
|
37
45
|
PH: ENotifyWith;
|
|
38
46
|
};
|
|
39
47
|
export declare const TEXT_UNDEFINED = "--";
|
|
48
|
+
export declare const SAMPLE_FILE_URL: {
|
|
49
|
+
url: string;
|
|
50
|
+
fileName: string;
|
|
51
|
+
};
|
|
52
|
+
export declare const ERROR_MESSAGE_UPLOAD_FILE = "File t\u1EA3i l\u00EAn kh\u00F4ng t\u1ED3n t\u1EA1i ho\u1EB7c ch\u01B0a \u0111\u1ECBnh d\u1EA1ng \u0111\u00FAng. Vui l\u00F2ng t\u1EA3i l\u1EA1i file";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TEXT_UNDEFINED = exports.DEFAULT_NOTIFY_WITH_BY_TARGET = exports.VALIDATE_REQUIRED_INPUT = exports.FILTER_BY = exports.EObjectType = exports.ERoleCode = exports.OPTION_FILTER_ALL = exports.ENotifyWith = void 0;
|
|
3
|
+
exports.ERROR_MESSAGE_UPLOAD_FILE = exports.SAMPLE_FILE_URL = exports.TEXT_UNDEFINED = exports.DEFAULT_NOTIFY_WITH_BY_TARGET = exports.VALIDATE_REQUIRED_INPUT = exports.ECoreSchemaGroup = exports.FILTER_BY = exports.EObjectType = exports.ERoleCode = exports.OPTION_FILTER_ALL = exports.ENotifyWith = void 0;
|
|
4
4
|
var ENotifyWith;
|
|
5
5
|
(function (ENotifyWith) {
|
|
6
6
|
ENotifyWith["GVCN"] = "GVCN";
|
|
@@ -34,6 +34,15 @@ exports.FILTER_BY = {
|
|
|
34
34
|
DEPARTMENT: 'DEPARTMENT',
|
|
35
35
|
CUSTOM_LIST: 'CUSTOM_LIST',
|
|
36
36
|
};
|
|
37
|
+
var ECoreSchemaGroup;
|
|
38
|
+
(function (ECoreSchemaGroup) {
|
|
39
|
+
ECoreSchemaGroup["CORE_SHARED"] = "core-shared";
|
|
40
|
+
ECoreSchemaGroup["CORE_ACADEMIC"] = "core-academic";
|
|
41
|
+
ECoreSchemaGroup["CORE_STUDENT"] = "core-student";
|
|
42
|
+
ECoreSchemaGroup["CORE_FINANCE"] = "core-finance";
|
|
43
|
+
ECoreSchemaGroup["CORE_ADMIN"] = "core-admin";
|
|
44
|
+
ECoreSchemaGroup["CORE_LAB"] = "core-lab";
|
|
45
|
+
})(ECoreSchemaGroup || (exports.ECoreSchemaGroup = ECoreSchemaGroup = {}));
|
|
37
46
|
exports.VALIDATE_REQUIRED_INPUT = 'Trường này không được để trống';
|
|
38
47
|
exports.DEFAULT_NOTIFY_WITH_BY_TARGET = {
|
|
39
48
|
[ERoleCode.STUDENT]: ENotifyWith.GVCN,
|
|
@@ -43,4 +52,9 @@ exports.DEFAULT_NOTIFY_WITH_BY_TARGET = {
|
|
|
43
52
|
[ERoleCode.PARENT]: ENotifyWith.GVCN,
|
|
44
53
|
};
|
|
45
54
|
exports.TEXT_UNDEFINED = '--';
|
|
55
|
+
exports.SAMPLE_FILE_URL = {
|
|
56
|
+
url: 'https://cdn-s3.phx.asia/library/book-title/14-04-2026/2f62d1d4-335a-4197-bd44-efb706b64106-tep-doi-tuong.xlsx',
|
|
57
|
+
fileName: 'tep-doi-tuong.xlsx',
|
|
58
|
+
};
|
|
59
|
+
exports.ERROR_MESSAGE_UPLOAD_FILE = 'File tải lên không tồn tại hoặc chưa định dạng đúng. Vui lòng tải lại file';
|
|
46
60
|
//# sourceMappingURL=constant.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constant.js","sourceRoot":"","sources":["../../../../src/components/FormTarget/constant.ts"],"names":[],"mappings":";;;AAAA,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,4BAAa,CAAA;IACb,4BAAa,CAAA;AACf,CAAC,EAHW,WAAW,2BAAX,WAAW,QAGtB;AAEY,QAAA,iBAAiB,GAAG;IAC/B,EAAE,EAAE,CAAC;IACL,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,KAAK;CACZ,CAAA;AAED,IAAY,SAMX;AAND,WAAY,SAAS;IACnB,2BAAc,CAAA;IACd,2BAAc,CAAA;IACd,yBAAY,CAAA;IACZ,sCAAyB,CAAA;IACzB,0BAAa,CAAA;AACf,CAAC,EANW,SAAS,yBAAT,SAAS,QAMpB;AACD,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,kCAAmB,CAAA;IACnB,kCAAmB,CAAA;IACnB,8BAAe,CAAA;IACf,wCAAyB,CAAA;AAC3B,CAAC,EALW,WAAW,2BAAX,WAAW,QAKtB;AAEY,QAAA,SAAS,GAAG;IACvB,GAAG,EAAE,KAAK;IACV,iBAAiB,EAAE,mBAAmB;IACtC,KAAK,EAAE,OAAO;IACd,SAAS,EAAE,WAAW;IACtB,UAAU,EAAE,YAAY;IACxB,WAAW,EAAE,aAAa;CAClB,CAAA;
|
|
1
|
+
{"version":3,"file":"constant.js","sourceRoot":"","sources":["../../../../src/components/FormTarget/constant.ts"],"names":[],"mappings":";;;AAAA,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,4BAAa,CAAA;IACb,4BAAa,CAAA;AACf,CAAC,EAHW,WAAW,2BAAX,WAAW,QAGtB;AAEY,QAAA,iBAAiB,GAAG;IAC/B,EAAE,EAAE,CAAC;IACL,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,KAAK;CACZ,CAAA;AAED,IAAY,SAMX;AAND,WAAY,SAAS;IACnB,2BAAc,CAAA;IACd,2BAAc,CAAA;IACd,yBAAY,CAAA;IACZ,sCAAyB,CAAA;IACzB,0BAAa,CAAA;AACf,CAAC,EANW,SAAS,yBAAT,SAAS,QAMpB;AACD,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,kCAAmB,CAAA;IACnB,kCAAmB,CAAA;IACnB,8BAAe,CAAA;IACf,wCAAyB,CAAA;AAC3B,CAAC,EALW,WAAW,2BAAX,WAAW,QAKtB;AAEY,QAAA,SAAS,GAAG;IACvB,GAAG,EAAE,KAAK;IACV,iBAAiB,EAAE,mBAAmB;IACtC,KAAK,EAAE,OAAO;IACd,SAAS,EAAE,WAAW;IACtB,UAAU,EAAE,YAAY;IACxB,WAAW,EAAE,aAAa;CAClB,CAAA;AAEV,IAAY,gBAOX;AAPD,WAAY,gBAAgB;IAC1B,+CAA2B,CAAA;IAC3B,mDAA+B,CAAA;IAC/B,iDAA6B,CAAA;IAC7B,iDAA6B,CAAA;IAC7B,6CAAyB,CAAA;IACzB,yCAAqB,CAAA;AACvB,CAAC,EAPW,gBAAgB,gCAAhB,gBAAgB,QAO3B;AAEY,QAAA,uBAAuB,GAAG,gCAAgC,CAAA;AAC1D,QAAA,6BAA6B,GAAG;IAC3C,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,WAAW,CAAC,IAAI;IACrC,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,SAAS;IAC9B,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,SAAS;IAC5B,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE,SAAS;IACjC,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC,IAAI;CACrC,CAAA;AACY,QAAA,cAAc,GAAG,IAAI,CAAA;AAErB,QAAA,eAAe,GAAG;IAC7B,GAAG,EAAE,+GAA+G;IACpH,QAAQ,EAAE,oBAAoB;CAC/B,CAAA;AAEY,QAAA,yBAAyB,GAAG,4EAA4E,CAAA"}
|
|
@@ -5,3 +5,8 @@ export declare const getTargetByIdQuery = "\n query getTargetByIdQuery($id: uui
|
|
|
5
5
|
export declare const GET_TARGET_BY_ROLE_QUERY = "\n query getTargetByRoleQuery($id: uuid!) {\n user_segment_target_by_pk(id: $id) {\n school_year_id\n target_by_roles(where: {deleted_at: {_is_null: true}}) {\n role {\n role_code\n }\n is_all\n notify_with\n target_educational_levels {\n educational_level {\n id\n name\n code\n }\n }\n target_grades {\n grade {\n id\n name\n code\n }\n }\n target_classrooms {\n classroom {\n id\n name\n code\n }\n }\n target_departments {\n department {\n id\n name\n }\n }\n target_users {\n user {\n id\n name: full_name\n phone: phone_number\n email\n profile_student {\n user_code\n grade {\n id\n name\n }\n program_map_educational_level {\n educational_level {\n code\n name\n id\n }\n }\n }\n\n profile_teacher {\n user_code\n }\n profile_staff {\n user_code\n }\n relationshipUsersByStudentId(\n order_by: {created_at: desc}\n where: {\n deleted_at: {_is_null: true}\n user: {deleted_at: {_is_null: true}}\n userByStudentId: {deleted_at: {_is_null: true}}\n }\n ) {\n parent_id\n relationship_code\n user {\n gender\n full_name\n phone_number\n }\n }\n }\n }\n }\n }\n }\n";
|
|
6
6
|
export declare const GET_LIST_ROLE_QUERY = "\n query getListRoleQuery($schoolId: Int!) {\n role(where: {deleted_at: {_is_null: true}, school_id: {_eq: $schoolId}}) {\n id\n role_code\n }\n }\n";
|
|
7
7
|
export declare const GET_CLASSROOM_BY_USER_IDS = "\n query getClassroomByUserIds($schoolYearId: Int!, $userIds: [Int!]!) {\n classroom_student(\n where: {\n deleted_at: { _is_null: true }\n user:{id:{_in:$userIds}}\n classroom: {\n deleted_at: { _is_null: true }\n school_year_id: { _eq: $schoolYearId }\n }\n }\n ) {\n user{\n id\n }\n classroom {\n id\n name\n grade_id\n grade {\n id\n educational_level_id\n }\n program_id\n school_year_id\n program {\n name\n }\n }\n }\n}\n";
|
|
8
|
+
export declare const FIND_STUDENT_BY_USER_CODE = "\nquery FindStudentByUserCodes($userCodes: [String!]!, $schoolId: Int!) {\n allCoreStudentPublicProfileStudents(\n filter: {\n deletedAt: { isNull: true }\n userCode: { in: $userCodes }\n schoolId: { equalTo: $schoolId }\n }\n ) {\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n nodes {\n userCode\n gradeId\n studentId\n coreStudentPublicGradeByGradeIdAndSchoolId {\n name\n id: rowId\n }\n coreStudentPublicUserByStudentIdAndSchoolId {\n coreStudentPublicRelationshipUsersByStudentIdAndSchoolId(\n filter: {\n deletedAt: { isNull: true }\n schoolId: { equalTo: $schoolId }\n }\n ) {\n nodes {\n parentId\n relationshipCode\n rowId\n }\n }\n }\n coreStudentPublicProgramMapEducationalLevelByProgramEducationalIdAndSchoolId {\n coreStudentPublicEducationalLevelByEducationalLevelIdAndSchoolId {\n code\n name\n id: rowId\n }\n }\n }\n }\n}\n\n";
|
|
9
|
+
export declare const FIND_STAFF_BY_USER_CODE = "\nquery FindStaffByUserCodes($userCodes: [String!]!, $schoolId: Int!) {\n allCoreAdminPublicUsers(\n filter: {\n deletedAt: { isNull: true }\n schoolId: { equalTo: $schoolId }\n coreAdminPublicProfileStaffByStaffIdAndSchoolId: {\n userCode: { in: $userCodes }\n deletedAt: { isNull: true }\n schoolId: { equalTo: $schoolId }\n }\n }\n ) {\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n nodes {\n id: rowId\n fullName\n phoneNumber\n emailSecondary\n email\n isUseEmailSecondary\n coreAdminPublicProfileStaffByStaffIdAndSchoolId {\n userCode\n }\n }\n }\n}\n";
|
|
10
|
+
export declare const FIND_TEACHER_BY_USER_CODE = "\nquery FindTeacherByUserCodes($userCodes: [String!]!, $schoolId: Int!) {\n allCoreAdminPublicProfileTeachers(\n filter: {\n deletedAt: { isNull: true }\n userCode: { in: $userCodes }\n schoolId: { equalTo: $schoolId }\n }\n ) {\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n nodes {\n userCode\n coreAdminPublicEducationalLevelGroupByEducationalLevelGroupIdAndSchoolId {\n id: rowId\n name\n schoolId\n }\n coreAdminPublicUserByTeacherIdAndSchoolId {\n email\n emailSecondary\n fullName\n id: rowId\n phoneNumber\n isUseEmailSecondary\n isEmailValid\n isEmailSecondaryValid\n }\n }\n }\n}\n ";
|
|
11
|
+
export declare const FIND_USER_INFO = "\n query findUserInfo($ids: [Int!]!, $schoolId: Int!) {\n allCoreAdminPublicUsers(\n filter: {\n rowId: {in: $ids}\n deletedAt: {isNull: true}\n schoolId: {equalTo: $schoolId}\n }\n ) {\n nodes {\n email\n fullName\n isEmailValid\n isEmailSecondaryValid\n isUseEmailSecondary\n id: rowId\n }\n }\n }\n";
|
|
12
|
+
export declare const FIND_CLASSROOM_BY_USER_IDS = "\n query FindClassroomByUserIds($userIds: [Int!]!, $schoolYearId: Int!, $schoolId: Int!) {\n allCoreAcademicPublicClassroomStudents(\n filter: {\n deletedAt: {isNull: true}\n coreAcademicPublicClassroomByClassroomIdAndSchoolId: {\n schoolYearId: {equalTo: $schoolYearId}\n }\n studentId: { in: $userIds }\n schoolId: { equalTo: $schoolId }\n }\n ) {\n nodes {\n coreAcademicPublicClassroomByClassroomIdAndSchoolId {\n name\n rowId\n }\n studentId\n }\n }\n }\n";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GET_CLASSROOM_BY_USER_IDS = exports.GET_LIST_ROLE_QUERY = exports.GET_TARGET_BY_ROLE_QUERY = exports.getTargetByIdQuery = exports.queryListUserBuilder = exports.GET_SELECT_QUERY = void 0;
|
|
3
|
+
exports.FIND_CLASSROOM_BY_USER_IDS = exports.FIND_USER_INFO = exports.FIND_TEACHER_BY_USER_CODE = exports.FIND_STAFF_BY_USER_CODE = exports.FIND_STUDENT_BY_USER_CODE = exports.GET_CLASSROOM_BY_USER_IDS = exports.GET_LIST_ROLE_QUERY = exports.GET_TARGET_BY_ROLE_QUERY = exports.getTargetByIdQuery = exports.queryListUserBuilder = exports.GET_SELECT_QUERY = void 0;
|
|
4
4
|
const constant_1 = require("../constant");
|
|
5
5
|
const target_1 = require("../type/target");
|
|
6
6
|
exports.GET_SELECT_QUERY = `
|
|
@@ -370,4 +370,165 @@ exports.GET_CLASSROOM_BY_USER_IDS = `
|
|
|
370
370
|
}
|
|
371
371
|
}
|
|
372
372
|
`;
|
|
373
|
+
exports.FIND_STUDENT_BY_USER_CODE = `
|
|
374
|
+
query FindStudentByUserCodes($userCodes: [String!]!, $schoolId: Int!) {
|
|
375
|
+
allCoreStudentPublicProfileStudents(
|
|
376
|
+
filter: {
|
|
377
|
+
deletedAt: { isNull: true }
|
|
378
|
+
userCode: { in: $userCodes }
|
|
379
|
+
schoolId: { equalTo: $schoolId }
|
|
380
|
+
}
|
|
381
|
+
) {
|
|
382
|
+
pageInfo {
|
|
383
|
+
endCursor
|
|
384
|
+
hasNextPage
|
|
385
|
+
hasPreviousPage
|
|
386
|
+
startCursor
|
|
387
|
+
}
|
|
388
|
+
nodes {
|
|
389
|
+
userCode
|
|
390
|
+
gradeId
|
|
391
|
+
studentId
|
|
392
|
+
coreStudentPublicGradeByGradeIdAndSchoolId {
|
|
393
|
+
name
|
|
394
|
+
id: rowId
|
|
395
|
+
}
|
|
396
|
+
coreStudentPublicUserByStudentIdAndSchoolId {
|
|
397
|
+
coreStudentPublicRelationshipUsersByStudentIdAndSchoolId(
|
|
398
|
+
filter: {
|
|
399
|
+
deletedAt: { isNull: true }
|
|
400
|
+
schoolId: { equalTo: $schoolId }
|
|
401
|
+
}
|
|
402
|
+
) {
|
|
403
|
+
nodes {
|
|
404
|
+
parentId
|
|
405
|
+
relationshipCode
|
|
406
|
+
rowId
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
coreStudentPublicProgramMapEducationalLevelByProgramEducationalIdAndSchoolId {
|
|
411
|
+
coreStudentPublicEducationalLevelByEducationalLevelIdAndSchoolId {
|
|
412
|
+
code
|
|
413
|
+
name
|
|
414
|
+
id: rowId
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
`;
|
|
422
|
+
// TODO: filter isQuitJob
|
|
423
|
+
exports.FIND_STAFF_BY_USER_CODE = `
|
|
424
|
+
query FindStaffByUserCodes($userCodes: [String!]!, $schoolId: Int!) {
|
|
425
|
+
allCoreAdminPublicUsers(
|
|
426
|
+
filter: {
|
|
427
|
+
deletedAt: { isNull: true }
|
|
428
|
+
schoolId: { equalTo: $schoolId }
|
|
429
|
+
coreAdminPublicProfileStaffByStaffIdAndSchoolId: {
|
|
430
|
+
userCode: { in: $userCodes }
|
|
431
|
+
deletedAt: { isNull: true }
|
|
432
|
+
schoolId: { equalTo: $schoolId }
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
) {
|
|
436
|
+
pageInfo {
|
|
437
|
+
endCursor
|
|
438
|
+
hasNextPage
|
|
439
|
+
hasPreviousPage
|
|
440
|
+
startCursor
|
|
441
|
+
}
|
|
442
|
+
nodes {
|
|
443
|
+
id: rowId
|
|
444
|
+
fullName
|
|
445
|
+
phoneNumber
|
|
446
|
+
emailSecondary
|
|
447
|
+
email
|
|
448
|
+
isUseEmailSecondary
|
|
449
|
+
coreAdminPublicProfileStaffByStaffIdAndSchoolId {
|
|
450
|
+
userCode
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
`;
|
|
456
|
+
exports.FIND_TEACHER_BY_USER_CODE = `
|
|
457
|
+
query FindTeacherByUserCodes($userCodes: [String!]!, $schoolId: Int!) {
|
|
458
|
+
allCoreAdminPublicProfileTeachers(
|
|
459
|
+
filter: {
|
|
460
|
+
deletedAt: { isNull: true }
|
|
461
|
+
userCode: { in: $userCodes }
|
|
462
|
+
schoolId: { equalTo: $schoolId }
|
|
463
|
+
}
|
|
464
|
+
) {
|
|
465
|
+
pageInfo {
|
|
466
|
+
endCursor
|
|
467
|
+
hasNextPage
|
|
468
|
+
hasPreviousPage
|
|
469
|
+
startCursor
|
|
470
|
+
}
|
|
471
|
+
nodes {
|
|
472
|
+
userCode
|
|
473
|
+
coreAdminPublicEducationalLevelGroupByEducationalLevelGroupIdAndSchoolId {
|
|
474
|
+
id: rowId
|
|
475
|
+
name
|
|
476
|
+
schoolId
|
|
477
|
+
}
|
|
478
|
+
coreAdminPublicUserByTeacherIdAndSchoolId {
|
|
479
|
+
email
|
|
480
|
+
emailSecondary
|
|
481
|
+
fullName
|
|
482
|
+
id: rowId
|
|
483
|
+
phoneNumber
|
|
484
|
+
isUseEmailSecondary
|
|
485
|
+
isEmailValid
|
|
486
|
+
isEmailSecondaryValid
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
`;
|
|
492
|
+
exports.FIND_USER_INFO = `
|
|
493
|
+
query findUserInfo($ids: [Int!]!, $schoolId: Int!) {
|
|
494
|
+
allCoreAdminPublicUsers(
|
|
495
|
+
filter: {
|
|
496
|
+
rowId: {in: $ids}
|
|
497
|
+
deletedAt: {isNull: true}
|
|
498
|
+
schoolId: {equalTo: $schoolId}
|
|
499
|
+
}
|
|
500
|
+
) {
|
|
501
|
+
nodes {
|
|
502
|
+
email
|
|
503
|
+
fullName
|
|
504
|
+
isEmailValid
|
|
505
|
+
isEmailSecondaryValid
|
|
506
|
+
isUseEmailSecondary
|
|
507
|
+
id: rowId
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
`;
|
|
512
|
+
exports.FIND_CLASSROOM_BY_USER_IDS = `
|
|
513
|
+
query FindClassroomByUserIds($userIds: [Int!]!, $schoolYearId: Int!, $schoolId: Int!) {
|
|
514
|
+
allCoreAcademicPublicClassroomStudents(
|
|
515
|
+
filter: {
|
|
516
|
+
deletedAt: {isNull: true}
|
|
517
|
+
coreAcademicPublicClassroomByClassroomIdAndSchoolId: {
|
|
518
|
+
schoolYearId: {equalTo: $schoolYearId}
|
|
519
|
+
}
|
|
520
|
+
studentId: { in: $userIds }
|
|
521
|
+
schoolId: { equalTo: $schoolId }
|
|
522
|
+
}
|
|
523
|
+
) {
|
|
524
|
+
nodes {
|
|
525
|
+
coreAcademicPublicClassroomByClassroomIdAndSchoolId {
|
|
526
|
+
name
|
|
527
|
+
rowId
|
|
528
|
+
}
|
|
529
|
+
studentId
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
`;
|
|
373
534
|
//# sourceMappingURL=query.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.js","sourceRoot":"","sources":["../../../../../src/components/FormTarget/graphql/query.ts"],"names":[],"mappings":";;;AAAA,0CAAuC;AACvC,2CAAmE;AAEtD,QAAA,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2C/B,CAAA;AAED,MAAM,gBAAgB,GAAG,CAAC,MAAiB,EAAE,YAAoB,EAAE,QAAgB,EAAE,EA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AAEY,QAAA,0BAA0B,GAAG;;;;;;;;;;;;;;;;;;;;;CAqBzC,CAAA"}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useImportUser = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const getLoginInfo_1 = tslib_1.__importDefault(require("../../Func/getLoginInfo"));
|
|
6
|
+
const PHXGrpcClientV6_1 = require("../../Func/GRPC/PHXGrpcClientV6");
|
|
7
|
+
const getSchoolYearV3_1 = tslib_1.__importDefault(require("../../Func/SchoolYearV3/getSchoolYearV3"));
|
|
8
|
+
const constant_1 = require("../constant");
|
|
9
|
+
const query_1 = require("../graphql/query");
|
|
10
|
+
const useImportUser = () => {
|
|
11
|
+
var _a, _b;
|
|
12
|
+
const userInfo = (0, getLoginInfo_1.default)();
|
|
13
|
+
const schoolId = userInfo === null || userInfo === void 0 ? void 0 : userInfo.school_id;
|
|
14
|
+
const schoolYear = (0, getSchoolYearV3_1.default)();
|
|
15
|
+
const schoolYearId = (_b = (_a = schoolYear === null || schoolYear === void 0 ? void 0 : schoolYear.current_school_year) === null || _a === void 0 ? void 0 : _a.schoolYear) === null || _b === void 0 ? void 0 : _b.id;
|
|
16
|
+
const formatStaffData = (data) => data.map((item) => ({
|
|
17
|
+
id: item.id,
|
|
18
|
+
code: item.coreAdminPublicProfileStaffByStaffIdAndSchoolId.userCode,
|
|
19
|
+
phone: item.phoneNumber,
|
|
20
|
+
email: item.email,
|
|
21
|
+
name: item.fullName,
|
|
22
|
+
emailSecondary: item.emailSecondary,
|
|
23
|
+
isUseEmailSecondary: item.isUseEmailSecondary,
|
|
24
|
+
full_name: item.fullName,
|
|
25
|
+
}));
|
|
26
|
+
const formatTeacherData = (data) => data.map((item) => ({
|
|
27
|
+
id: item.coreAdminPublicUserByTeacherIdAndSchoolId.id,
|
|
28
|
+
code: item.userCode,
|
|
29
|
+
phone: item.coreAdminPublicUserByTeacherIdAndSchoolId.phoneNumber,
|
|
30
|
+
email: item.coreAdminPublicUserByTeacherIdAndSchoolId.email,
|
|
31
|
+
name: item.coreAdminPublicUserByTeacherIdAndSchoolId.fullName,
|
|
32
|
+
emailSecondary: item.coreAdminPublicUserByTeacherIdAndSchoolId.emailSecondary,
|
|
33
|
+
isUseEmailSecondary: item.coreAdminPublicUserByTeacherIdAndSchoolId.isUseEmailSecondary,
|
|
34
|
+
full_name: item.coreAdminPublicUserByTeacherIdAndSchoolId.fullName,
|
|
35
|
+
}));
|
|
36
|
+
const formatStudentData = (data, userInfoMap = {}) => data.map((item) => {
|
|
37
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
38
|
+
const parents = (_c = (_b = (_a = item.coreStudentPublicUserByStudentIdAndSchoolId) === null || _a === void 0 ? void 0 : _a.coreStudentPublicRelationshipUsersByStudentIdAndSchoolId) === null || _b === void 0 ? void 0 : _b.nodes) === null || _c === void 0 ? void 0 : _c.map((node) => {
|
|
39
|
+
var _a;
|
|
40
|
+
return ({
|
|
41
|
+
id: node.parentId,
|
|
42
|
+
relationship_code: node.relationshipCode || '',
|
|
43
|
+
full_name: ((_a = userInfoMap[node.parentId]) === null || _a === void 0 ? void 0 : _a.fullName) || '',
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
return {
|
|
47
|
+
id: Number(item.studentId),
|
|
48
|
+
code: item.userCode,
|
|
49
|
+
name: item.fullName || '',
|
|
50
|
+
full_name: item.fullName || '',
|
|
51
|
+
educational_level: (_e = (_d = item.coreStudentPublicProgramMapEducationalLevelByProgramEducationalIdAndSchoolId) === null || _d === void 0 ? void 0 : _d.coreStudentPublicEducationalLevelByEducationalLevelIdAndSchoolId) === null || _e === void 0 ? void 0 : _e.name,
|
|
52
|
+
grade: (_f = item.coreStudentPublicGradeByGradeIdAndSchoolId) === null || _f === void 0 ? void 0 : _f.name,
|
|
53
|
+
classroom: (_g = item.classroom) === null || _g === void 0 ? void 0 : _g.name,
|
|
54
|
+
parents: parents || [],
|
|
55
|
+
};
|
|
56
|
+
});
|
|
57
|
+
const findUserInFo = async (ids) => {
|
|
58
|
+
const { data } = await (0, PHXGrpcClientV6_1.PHXClientQueryV6)({
|
|
59
|
+
schemaGroup: constant_1.ECoreSchemaGroup.CORE_ADMIN,
|
|
60
|
+
variables: {
|
|
61
|
+
ids,
|
|
62
|
+
schoolId,
|
|
63
|
+
},
|
|
64
|
+
query: query_1.FIND_USER_INFO,
|
|
65
|
+
});
|
|
66
|
+
return data.allCoreAdminPublicUsers.nodes;
|
|
67
|
+
};
|
|
68
|
+
const findClassroomByUserIds = async (userIds, querySchoolYearId, querySchoolId) => {
|
|
69
|
+
const { data } = await (0, PHXGrpcClientV6_1.PHXClientQueryV6)({
|
|
70
|
+
schemaGroup: constant_1.ECoreSchemaGroup.CORE_ACADEMIC,
|
|
71
|
+
variables: {
|
|
72
|
+
userIds,
|
|
73
|
+
schoolYearId: querySchoolYearId,
|
|
74
|
+
schoolId: querySchoolId,
|
|
75
|
+
},
|
|
76
|
+
query: query_1.FIND_CLASSROOM_BY_USER_IDS,
|
|
77
|
+
});
|
|
78
|
+
return data.allCoreAcademicPublicClassroomStudents.nodes;
|
|
79
|
+
};
|
|
80
|
+
const findStudentByUserCodes = async (userCodes) => {
|
|
81
|
+
const { data } = await (0, PHXGrpcClientV6_1.PHXClientQueryV6)({
|
|
82
|
+
schemaGroup: constant_1.ECoreSchemaGroup.CORE_STUDENT,
|
|
83
|
+
variables: {
|
|
84
|
+
userCodes,
|
|
85
|
+
schoolId,
|
|
86
|
+
},
|
|
87
|
+
query: query_1.FIND_STUDENT_BY_USER_CODE,
|
|
88
|
+
});
|
|
89
|
+
const result = data.allCoreStudentPublicProfileStudents.nodes;
|
|
90
|
+
const userIds = new Set();
|
|
91
|
+
result.forEach((item) => {
|
|
92
|
+
var _a, _b;
|
|
93
|
+
userIds.add(item.studentId);
|
|
94
|
+
const parentNodes = (_b = (_a = item.coreStudentPublicUserByStudentIdAndSchoolId) === null || _a === void 0 ? void 0 : _a.coreStudentPublicRelationshipUsersByStudentIdAndSchoolId) === null || _b === void 0 ? void 0 : _b.nodes;
|
|
95
|
+
parentNodes === null || parentNodes === void 0 ? void 0 : parentNodes.forEach((node) => {
|
|
96
|
+
if (node.parentId) {
|
|
97
|
+
userIds.add(node.parentId);
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
const studentInfo = await findUserInFo(Array.from(userIds));
|
|
102
|
+
const userInfoMap = {};
|
|
103
|
+
studentInfo.forEach((user) => {
|
|
104
|
+
userInfoMap[user.id] = user;
|
|
105
|
+
});
|
|
106
|
+
const classroomData = await findClassroomByUserIds(Array.from(new Set(result.map((item) => item.studentId))), schoolYearId, schoolId);
|
|
107
|
+
const classroomMap = {};
|
|
108
|
+
classroomData.forEach((item) => {
|
|
109
|
+
classroomMap[item.studentId] = item.coreAcademicPublicClassroomByClassroomIdAndSchoolId;
|
|
110
|
+
});
|
|
111
|
+
const mergeData = result.map((item) => {
|
|
112
|
+
const userDetail = userInfoMap[item.studentId];
|
|
113
|
+
const classroom = classroomMap[item.studentId];
|
|
114
|
+
return {
|
|
115
|
+
...item,
|
|
116
|
+
fullName: userDetail === null || userDetail === void 0 ? void 0 : userDetail.fullName,
|
|
117
|
+
classroom: classroom
|
|
118
|
+
? {
|
|
119
|
+
id: classroom.rowId,
|
|
120
|
+
name: classroom.name,
|
|
121
|
+
}
|
|
122
|
+
: undefined,
|
|
123
|
+
};
|
|
124
|
+
});
|
|
125
|
+
return formatStudentData(mergeData, userInfoMap);
|
|
126
|
+
};
|
|
127
|
+
const findStaffByUserCodes = async (userCodes) => {
|
|
128
|
+
const { data } = await (0, PHXGrpcClientV6_1.PHXClientQueryV6)({
|
|
129
|
+
schemaGroup: constant_1.ECoreSchemaGroup.CORE_ADMIN,
|
|
130
|
+
variables: {
|
|
131
|
+
userCodes,
|
|
132
|
+
schoolId,
|
|
133
|
+
},
|
|
134
|
+
query: query_1.FIND_STAFF_BY_USER_CODE,
|
|
135
|
+
});
|
|
136
|
+
const result = data.allCoreAdminPublicUsers.nodes;
|
|
137
|
+
return formatStaffData(result);
|
|
138
|
+
};
|
|
139
|
+
const findTeacherByUserCodes = async (userCodes) => {
|
|
140
|
+
const { data } = await (0, PHXGrpcClientV6_1.PHXClientQueryV6)({
|
|
141
|
+
schemaGroup: constant_1.ECoreSchemaGroup.CORE_ADMIN,
|
|
142
|
+
variables: {
|
|
143
|
+
userCodes,
|
|
144
|
+
schoolId,
|
|
145
|
+
},
|
|
146
|
+
query: query_1.FIND_TEACHER_BY_USER_CODE,
|
|
147
|
+
});
|
|
148
|
+
const result = data.allCoreAdminPublicProfileTeachers.nodes;
|
|
149
|
+
return formatTeacherData(result);
|
|
150
|
+
};
|
|
151
|
+
const findUserByUserCodes = async (target, userCodes) => {
|
|
152
|
+
switch (target) {
|
|
153
|
+
case constant_1.ERoleCode.STUDENT:
|
|
154
|
+
return findStudentByUserCodes(userCodes);
|
|
155
|
+
case constant_1.ERoleCode.STAFF:
|
|
156
|
+
return findStaffByUserCodes(userCodes);
|
|
157
|
+
case constant_1.ERoleCode.TEACHER:
|
|
158
|
+
return findTeacherByUserCodes(userCodes);
|
|
159
|
+
default:
|
|
160
|
+
return [];
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
return {
|
|
164
|
+
findUserByUserCodes,
|
|
165
|
+
};
|
|
166
|
+
};
|
|
167
|
+
exports.useImportUser = useImportUser;
|
|
168
|
+
//# sourceMappingURL=use-import-user.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-import-user.js","sourceRoot":"","sources":["../../../../../src/components/FormTarget/hooks/use-import-user.ts"],"names":[],"mappings":";;;;AAAA,mFAA0D;AAC1D,qEAAkE;AAClE,sGAAiF;AACjF,0CAAyD;AACzD,4CAMyB;AAIlB,MAAM,aAAa,GAAG,GAAG,EAAE;;IAChC,MAAM,QAAQ,GAAG,IAAA,sB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;KACpB,CAAA;AACH,CAAC,CAAA;AApLY,QAAA,aAAa,iBAoLzB"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
export interface IStaffData {
|
|
2
|
+
id: number;
|
|
3
|
+
fullName: string;
|
|
4
|
+
phoneNumber: string;
|
|
5
|
+
emailSecondary?: string;
|
|
6
|
+
email?: string;
|
|
7
|
+
isUseEmailSecondary?: boolean;
|
|
8
|
+
coreAdminPublicProfileStaffByStaffIdAndSchoolId: {
|
|
9
|
+
userCode: string;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export interface IStudentDataV5 {
|
|
13
|
+
userCode: string;
|
|
14
|
+
studentId: number;
|
|
15
|
+
coreStudentPublicGradeByGradeIdAndSchoolId: {
|
|
16
|
+
name: string;
|
|
17
|
+
id: number;
|
|
18
|
+
};
|
|
19
|
+
coreStudentPublicUserByStudentIdAndSchoolId: {
|
|
20
|
+
coreStudentPublicRelationshipUsersByStudentIdAndSchoolId?: {
|
|
21
|
+
nodes: Array<{
|
|
22
|
+
parentId: number;
|
|
23
|
+
relationshipCode: string;
|
|
24
|
+
id: number;
|
|
25
|
+
}>;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
coreStudentPublicProgramMapEducationalLevelByProgramEducationalIdAndSchoolId: {
|
|
29
|
+
coreStudentPublicEducationalLevelByEducationalLevelIdAndSchoolId: {
|
|
30
|
+
code: string;
|
|
31
|
+
name: string;
|
|
32
|
+
id: number;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
export interface IStudentMergeData extends IStudentDataV5 {
|
|
37
|
+
fullName?: string;
|
|
38
|
+
phoneNumber?: string;
|
|
39
|
+
email?: string;
|
|
40
|
+
emailSecondary?: string;
|
|
41
|
+
isUseEmailSecondary?: boolean;
|
|
42
|
+
isEmailValid?: boolean;
|
|
43
|
+
isEmailSecondaryValid?: boolean;
|
|
44
|
+
classroom?: {
|
|
45
|
+
id: number;
|
|
46
|
+
name: string;
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
export interface ITeacherDataV5 {
|
|
50
|
+
userCode: string;
|
|
51
|
+
coreAdminPublicEducationalLevelGroupByEducationalLevelGroupIdAndSchoolId: {
|
|
52
|
+
id: number;
|
|
53
|
+
name?: string;
|
|
54
|
+
schoolId?: number;
|
|
55
|
+
};
|
|
56
|
+
id: number;
|
|
57
|
+
coreAdminPublicUserByTeacherIdAndSchoolId: {
|
|
58
|
+
email: string;
|
|
59
|
+
emailSecondary?: string;
|
|
60
|
+
fullName: string;
|
|
61
|
+
id: number;
|
|
62
|
+
phoneNumber?: string;
|
|
63
|
+
isUseEmailSecondary?: boolean;
|
|
64
|
+
isEmailValid?: boolean;
|
|
65
|
+
isEmailSecondaryValid?: boolean;
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
export interface IUserInfoV5 {
|
|
69
|
+
id: number;
|
|
70
|
+
fullName: string;
|
|
71
|
+
phoneNumber: string;
|
|
72
|
+
emailSecondary?: string;
|
|
73
|
+
email?: string;
|
|
74
|
+
isUseEmailSecondary?: boolean;
|
|
75
|
+
isEmailValid?: boolean;
|
|
76
|
+
isEmailSecondaryValid?: boolean;
|
|
77
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user.js","sourceRoot":"","sources":["../../../../../src/components/FormTarget/type/user.ts"],"names":[],"mappings":""}
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
export declare function ButtonUpload({ fileType, handleUploadClick, helpText, loading, disabled, }: {
|
|
3
3
|
fileType: string;
|
|
4
4
|
handleUploadClick(): void;
|
|
5
|
-
helpText
|
|
5
|
+
helpText?: string;
|
|
6
6
|
loading?: boolean;
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
}): React.JSX.Element;
|
|
@@ -1,2 +1,25 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export
|
|
2
|
+
export interface IFormUploadProps {
|
|
3
|
+
actionTextDelete?: boolean;
|
|
4
|
+
customNextImage?: {
|
|
5
|
+
height?: number;
|
|
6
|
+
width?: number;
|
|
7
|
+
};
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
fileName?: string;
|
|
10
|
+
fileType?: 'excel' | 'image' | 'file' | 'pdf';
|
|
11
|
+
handleCheckboxChange?(index: number): void;
|
|
12
|
+
handleFileChange(event: React.ChangeEvent<HTMLInputElement>): void | Promise<void>;
|
|
13
|
+
helpText?: string;
|
|
14
|
+
isHorizontalLayout?: boolean;
|
|
15
|
+
isImage?: boolean;
|
|
16
|
+
label?: string;
|
|
17
|
+
length?: number;
|
|
18
|
+
link?: Array<string>;
|
|
19
|
+
oneImg?: boolean;
|
|
20
|
+
selectedImages?: Array<number>;
|
|
21
|
+
setIsModalOpen?(isOpen: boolean): void;
|
|
22
|
+
showImage?: boolean;
|
|
23
|
+
twoColumn?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export declare function FormUpload({ actionTextDelete, customNextImage, disabled, fileName, fileType, handleCheckboxChange, handleFileChange, helpText, isHorizontalLayout, isImage, label, length, link, oneImg, selectedImages, setIsModalOpen, showImage, twoColumn, }: IFormUploadProps): React.JSX.Element;
|