mario-core 2.9.205-release → 2.9.207-release
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/index.js +96 -39
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +96 -39
- package/dist/index.modern.js.map +1 -1
- package/dist/services/accountService.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1543,7 +1543,9 @@ var lang_us = {
|
|
|
1543
1543
|
include_section_you_want_to_appear: include_section_you_want_to_appear,
|
|
1544
1544
|
time_of_day: time_of_day,
|
|
1545
1545
|
last_1_1_conversation: last_1_1_conversation,
|
|
1546
|
-
leave_page: leave_page
|
|
1546
|
+
leave_page: leave_page,
|
|
1547
|
+
"you_can_start_a_1-1_conversation_after_the_results_of_the_student's_check-in._If_the_check-in_is_24_hours_older,_you_can_request_the_new_check-in_or_start_the_conversation_by_viewing_the_results": "You can start a 1-1 conversation after the results of the student's check-in. If the check-in is 24 hours older, you can request the new check-in or start the conversation by viewing the results",
|
|
1548
|
+
"select_a_student_and_start_a_1-1_conversation_from_a_check-in_or_ask_the_student_to_check-in_before": "Select a student and start a 1-1 conversation from a check-in or ask the student to check-in before"
|
|
1547
1549
|
};
|
|
1548
1550
|
|
|
1549
1551
|
var dashboard$1 = "Dashboard";
|
|
@@ -3051,7 +3053,9 @@ var lang_uk = {
|
|
|
3051
3053
|
include_section_you_want_to_appear: include_section_you_want_to_appear$1,
|
|
3052
3054
|
time_of_day: time_of_day$1,
|
|
3053
3055
|
last_1_1_conversation: last_1_1_conversation$1,
|
|
3054
|
-
leave_page: leave_page$1
|
|
3056
|
+
leave_page: leave_page$1,
|
|
3057
|
+
"you_can_start_a_1-1_conversation_after_the_results_of_the_student's_check-in._If_the_check-in_is_24_hours_older,_you_can_request_the_new_check-in_or_start_the_conversation_by_viewing_the_results": "You can start a 1-1 conversation after the results of the student's check-in. If the check-in is 24 hours older, you can request the new check-in or start the conversation by viewing the results",
|
|
3058
|
+
"select_a_student_and_start_a_1-1_conversation_from_a_check-in_or_ask_the_student_to_check-in_before": "Select a student and start a 1-1 conversation from a check-in or ask the student to check-in before"
|
|
3055
3059
|
};
|
|
3056
3060
|
|
|
3057
3061
|
var dashboard$2 = "لوحة المعلومات";
|
|
@@ -4522,7 +4526,9 @@ var lang_ar = {
|
|
|
4522
4526
|
still_in_control_but_starting_to_feel_the_pressure: still_in_control_but_starting_to_feel_the_pressure$2,
|
|
4523
4527
|
too_much_pressure_and_really_struggling_to_manage_my_workload: too_much_pressure_and_really_struggling_to_manage_my_workload$2,
|
|
4524
4528
|
last_1_1_conversation: last_1_1_conversation$2,
|
|
4525
|
-
leave_page: leave_page$2
|
|
4529
|
+
leave_page: leave_page$2,
|
|
4530
|
+
"you_can_start_a_1-1_conversation_after_the_results_of_the_student's_check-in._If_the_check-in_is_24_hours_older,_you_can_request_the_new_check-in_or_start_the_conversation_by_viewing_the_results": "You can start a 1-1 conversation after the results of the student's check-in. If the check-in is 24 hours older, you can request the new check-in or start the conversation by viewing the results",
|
|
4531
|
+
"select_a_student_and_start_a_1-1_conversation_from_a_check-in_or_ask_the_student_to_check-in_before": "Select a student and start a 1-1 conversation from a check-in or ask the student to check-in before"
|
|
4526
4532
|
};
|
|
4527
4533
|
|
|
4528
4534
|
var TINY_MCE_API_KEY = "htqausuofrnali3nh9ivmlpq6v415o0tv2qikpg39bqf4pnk";
|
|
@@ -22183,6 +22189,9 @@ var apiUpload = axios.create({
|
|
|
22183
22189
|
var ACCOUNT_URL = BASE_URL + "/api/account";
|
|
22184
22190
|
var USER_URL = BASE_URL + "/api/user";
|
|
22185
22191
|
var TEACHER_URL = BASE_URL + "/api/teacher";
|
|
22192
|
+
var apiInforUserClassLink = function apiInforUserClassLink(data) {
|
|
22193
|
+
return api.post(BASE_URL + "/api/User/infor-user-classlink", data);
|
|
22194
|
+
};
|
|
22186
22195
|
var logIn = function logIn(data) {
|
|
22187
22196
|
return api.post(ACCOUNT_URL + "/login", data);
|
|
22188
22197
|
};
|
|
@@ -22274,6 +22283,9 @@ var useLogin = function useLogin() {
|
|
|
22274
22283
|
infoUser = _useState5[0],
|
|
22275
22284
|
setInfoUser = _useState5[1];
|
|
22276
22285
|
|
|
22286
|
+
var params = new URLSearchParams(location.search);
|
|
22287
|
+
var loginClassLink = params.get("type") === "classlink";
|
|
22288
|
+
var tokenClassLink = params.get("token");
|
|
22277
22289
|
var toggle = React.useCallback(function () {
|
|
22278
22290
|
setOpenLogin(!openLogin);
|
|
22279
22291
|
}, [openLogin]);
|
|
@@ -22288,8 +22300,13 @@ var useLogin = function useLogin() {
|
|
|
22288
22300
|
if (!!token) history.push("/");
|
|
22289
22301
|
getInfoGoogle();
|
|
22290
22302
|
}, []);
|
|
22291
|
-
|
|
22292
|
-
|
|
22303
|
+
React.useEffect(function () {
|
|
22304
|
+
if (loginClassLink && tokenClassLink != "") {
|
|
22305
|
+
loginAccountClassLink();
|
|
22306
|
+
}
|
|
22307
|
+
}, []);
|
|
22308
|
+
|
|
22309
|
+
var loginAccountClassLink = function loginAccountClassLink() {
|
|
22293
22310
|
try {
|
|
22294
22311
|
var _temp3 = function _temp3() {
|
|
22295
22312
|
dispatch(setLoading(false));
|
|
@@ -22298,21 +22315,61 @@ var useLogin = function useLogin() {
|
|
|
22298
22315
|
dispatch(setLoading(true));
|
|
22299
22316
|
|
|
22300
22317
|
var _temp4 = _catch(function () {
|
|
22318
|
+
var data = {
|
|
22319
|
+
tokenClassLink: tokenClassLink
|
|
22320
|
+
};
|
|
22321
|
+
return Promise.resolve(apiInforUserClassLink(data)).then(function (res) {
|
|
22322
|
+
var _res$data = res.data,
|
|
22323
|
+
email = _res$data.email,
|
|
22324
|
+
token = _res$data.token;
|
|
22325
|
+
var dataUser = {
|
|
22326
|
+
email: email,
|
|
22327
|
+
rememberMe: false,
|
|
22328
|
+
password: "default",
|
|
22329
|
+
accessToken: token
|
|
22330
|
+
};
|
|
22331
|
+
return Promise.resolve(userLogin(dataUser)).then(function () {});
|
|
22332
|
+
});
|
|
22333
|
+
}, function (err) {
|
|
22334
|
+
var _err$response, _err$response$data;
|
|
22335
|
+
|
|
22336
|
+
dispatch(setAlert({
|
|
22337
|
+
type: "danger",
|
|
22338
|
+
message: ((_err$response = err.response) === null || _err$response === void 0 ? void 0 : (_err$response$data = _err$response.data) === null || _err$response$data === void 0 ? void 0 : _err$response$data.title) || err.message
|
|
22339
|
+
}));
|
|
22340
|
+
});
|
|
22341
|
+
|
|
22342
|
+
return Promise.resolve(_temp4 && _temp4.then ? _temp4.then(_temp3) : _temp3(_temp4));
|
|
22343
|
+
} catch (e) {
|
|
22344
|
+
return Promise.reject(e);
|
|
22345
|
+
}
|
|
22346
|
+
};
|
|
22347
|
+
|
|
22348
|
+
var isDistrict = window.location.host.includes("-district");
|
|
22349
|
+
var userLogin = React.useCallback(function (data) {
|
|
22350
|
+
try {
|
|
22351
|
+
var _temp7 = function _temp7() {
|
|
22352
|
+
dispatch(setLoading(false));
|
|
22353
|
+
};
|
|
22354
|
+
|
|
22355
|
+
dispatch(setLoading(true));
|
|
22356
|
+
|
|
22357
|
+
var _temp8 = _catch(function () {
|
|
22301
22358
|
var _data$email, _data$password;
|
|
22302
22359
|
|
|
22303
22360
|
return Promise.resolve(logIn(_extends({}, data, {
|
|
22304
22361
|
email: data === null || data === void 0 ? void 0 : (_data$email = data.email) === null || _data$email === void 0 ? void 0 : _data$email.trim(),
|
|
22305
22362
|
password: data === null || data === void 0 ? void 0 : (_data$password = data.password) === null || _data$password === void 0 ? void 0 : _data$password.trim()
|
|
22306
22363
|
}))).then(function (res) {
|
|
22307
|
-
var _res$
|
|
22308
|
-
token = _res$
|
|
22309
|
-
id = _res$
|
|
22310
|
-
firstName = _res$
|
|
22311
|
-
lastName = _res$
|
|
22312
|
-
roles = _res$
|
|
22313
|
-
email = _res$
|
|
22314
|
-
profileImageFileName = _res$
|
|
22315
|
-
isLoginFirst = _res$
|
|
22364
|
+
var _res$data2 = res.data,
|
|
22365
|
+
token = _res$data2.token,
|
|
22366
|
+
id = _res$data2.id,
|
|
22367
|
+
firstName = _res$data2.firstName,
|
|
22368
|
+
lastName = _res$data2.lastName,
|
|
22369
|
+
roles = _res$data2.roles,
|
|
22370
|
+
email = _res$data2.email,
|
|
22371
|
+
profileImageFileName = _res$data2.profileImageFileName,
|
|
22372
|
+
isLoginFirst = _res$data2.isLoginFirst;
|
|
22316
22373
|
localStorage.setItem(ACCESS_TOKEN, token);
|
|
22317
22374
|
localStorage.removeItem(NOTIFICATION_ALERT_KEY);
|
|
22318
22375
|
dispatch(setUser({
|
|
@@ -22370,16 +22427,16 @@ var useLogin = function useLogin() {
|
|
|
22370
22427
|
}
|
|
22371
22428
|
});
|
|
22372
22429
|
}, function (err) {
|
|
22373
|
-
var _err$
|
|
22430
|
+
var _err$response2, _err$response2$data;
|
|
22374
22431
|
|
|
22375
22432
|
dispatch(setAlert({
|
|
22376
22433
|
type: "danger",
|
|
22377
|
-
message: ((_err$
|
|
22434
|
+
message: ((_err$response2 = err.response) === null || _err$response2 === void 0 ? void 0 : (_err$response2$data = _err$response2.data) === null || _err$response2$data === void 0 ? void 0 : _err$response2$data.title) || err.message || "Login failed"
|
|
22378
22435
|
}));
|
|
22379
22436
|
localStorage.removeItem(ACCESS_TOKEN);
|
|
22380
22437
|
});
|
|
22381
22438
|
|
|
22382
|
-
return Promise.resolve(
|
|
22439
|
+
return Promise.resolve(_temp8 && _temp8.then ? _temp8.then(_temp7) : _temp7(_temp8));
|
|
22383
22440
|
} catch (e) {
|
|
22384
22441
|
return Promise.reject(e);
|
|
22385
22442
|
}
|
|
@@ -22387,21 +22444,21 @@ var useLogin = function useLogin() {
|
|
|
22387
22444
|
|
|
22388
22445
|
var getInfoGoogle = function getInfoGoogle() {
|
|
22389
22446
|
try {
|
|
22390
|
-
var
|
|
22447
|
+
var _temp10 = _catch(function () {
|
|
22391
22448
|
return Promise.resolve(getGoogleClientId()).then(function (res) {
|
|
22392
22449
|
setGoogleClientId(res.data.googleClientId);
|
|
22393
22450
|
setGoogleRecaptchaId(res.data.googleCaptchaId);
|
|
22394
22451
|
});
|
|
22395
22452
|
}, function (err) {
|
|
22396
|
-
var _err$
|
|
22453
|
+
var _err$response3, _err$response3$data;
|
|
22397
22454
|
|
|
22398
22455
|
dispatch(setAlert({
|
|
22399
22456
|
type: "danger",
|
|
22400
|
-
message: ((_err$
|
|
22457
|
+
message: ((_err$response3 = err.response) === null || _err$response3 === void 0 ? void 0 : (_err$response3$data = _err$response3.data) === null || _err$response3$data === void 0 ? void 0 : _err$response3$data.title) || err.message || "Login failed"
|
|
22401
22458
|
}));
|
|
22402
22459
|
});
|
|
22403
22460
|
|
|
22404
|
-
return Promise.resolve(
|
|
22461
|
+
return Promise.resolve(_temp10 && _temp10.then ? _temp10.then(function () {}) : void 0);
|
|
22405
22462
|
} catch (e) {
|
|
22406
22463
|
return Promise.reject(e);
|
|
22407
22464
|
}
|
|
@@ -22409,17 +22466,17 @@ var useLogin = function useLogin() {
|
|
|
22409
22466
|
|
|
22410
22467
|
var fnIsCheckLogin = React.useCallback(function (data, token, clickHandler) {
|
|
22411
22468
|
try {
|
|
22412
|
-
var
|
|
22469
|
+
var _temp14 = function _temp14() {
|
|
22413
22470
|
dispatch(setLoading(false));
|
|
22414
22471
|
};
|
|
22415
22472
|
|
|
22416
22473
|
dispatch(setLoading(true));
|
|
22417
22474
|
|
|
22418
|
-
var
|
|
22475
|
+
var _temp15 = _catch(function () {
|
|
22419
22476
|
return Promise.resolve(checkUserGoogle(data)).then(function (res) {
|
|
22420
22477
|
var checkUser = res.data;
|
|
22421
22478
|
|
|
22422
|
-
var
|
|
22479
|
+
var _temp11 = function () {
|
|
22423
22480
|
if (checkUser) {
|
|
22424
22481
|
return Promise.resolve(clickHandler()).then(function (clickHandlerRes) {
|
|
22425
22482
|
var dataUser = {
|
|
@@ -22439,18 +22496,18 @@ var useLogin = function useLogin() {
|
|
|
22439
22496
|
}
|
|
22440
22497
|
}();
|
|
22441
22498
|
|
|
22442
|
-
if (
|
|
22499
|
+
if (_temp11 && _temp11.then) return _temp11.then(function () {});
|
|
22443
22500
|
});
|
|
22444
22501
|
}, function (err) {
|
|
22445
|
-
var _err$
|
|
22502
|
+
var _err$response4, _err$response4$data;
|
|
22446
22503
|
|
|
22447
22504
|
dispatch(setAlert({
|
|
22448
22505
|
type: "danger",
|
|
22449
|
-
message: ((_err$
|
|
22506
|
+
message: ((_err$response4 = err.response) === null || _err$response4 === void 0 ? void 0 : (_err$response4$data = _err$response4.data) === null || _err$response4$data === void 0 ? void 0 : _err$response4$data.title) || err.message || "Login failed"
|
|
22450
22507
|
}));
|
|
22451
22508
|
});
|
|
22452
22509
|
|
|
22453
|
-
return Promise.resolve(
|
|
22510
|
+
return Promise.resolve(_temp15 && _temp15.then ? _temp15.then(_temp14) : _temp14(_temp15));
|
|
22454
22511
|
} catch (e) {
|
|
22455
22512
|
return Promise.reject(e);
|
|
22456
22513
|
}
|
|
@@ -22458,14 +22515,14 @@ var useLogin = function useLogin() {
|
|
|
22458
22515
|
|
|
22459
22516
|
var submitLogin = function submitLogin(teacherId, clickHandler) {
|
|
22460
22517
|
try {
|
|
22461
|
-
var
|
|
22518
|
+
var _temp19 = function _temp19() {
|
|
22462
22519
|
setIsLoginGoogle(false);
|
|
22463
22520
|
dispatch(setLoading(false));
|
|
22464
22521
|
};
|
|
22465
22522
|
|
|
22466
22523
|
dispatch(setLoading(true));
|
|
22467
22524
|
|
|
22468
|
-
var
|
|
22525
|
+
var _temp20 = _catch(function () {
|
|
22469
22526
|
var data = {
|
|
22470
22527
|
firstName: infoUser.firstName,
|
|
22471
22528
|
lastName: infoUser.lastName,
|
|
@@ -22476,7 +22533,7 @@ var useLogin = function useLogin() {
|
|
|
22476
22533
|
teacherId: teacherId
|
|
22477
22534
|
};
|
|
22478
22535
|
return Promise.resolve(registerUserStudent(data)).then(function (res) {
|
|
22479
|
-
var
|
|
22536
|
+
var _temp16 = function () {
|
|
22480
22537
|
if (res.data) {
|
|
22481
22538
|
return Promise.resolve(clickHandler()).then(function (clickHandlerRes) {
|
|
22482
22539
|
var dataLogin = {
|
|
@@ -22495,18 +22552,18 @@ var useLogin = function useLogin() {
|
|
|
22495
22552
|
}
|
|
22496
22553
|
}();
|
|
22497
22554
|
|
|
22498
|
-
if (
|
|
22555
|
+
if (_temp16 && _temp16.then) return _temp16.then(function () {});
|
|
22499
22556
|
});
|
|
22500
22557
|
}, function (err) {
|
|
22501
|
-
var _err$
|
|
22558
|
+
var _err$response5, _err$response5$data;
|
|
22502
22559
|
|
|
22503
22560
|
dispatch(setAlert({
|
|
22504
22561
|
type: "danger",
|
|
22505
|
-
message: ((_err$
|
|
22562
|
+
message: ((_err$response5 = err.response) === null || _err$response5 === void 0 ? void 0 : (_err$response5$data = _err$response5.data) === null || _err$response5$data === void 0 ? void 0 : _err$response5$data.title) || err.message || "Login failed"
|
|
22506
22563
|
}));
|
|
22507
22564
|
});
|
|
22508
22565
|
|
|
22509
|
-
return Promise.resolve(
|
|
22566
|
+
return Promise.resolve(_temp20 && _temp20.then ? _temp20.then(_temp19) : _temp19(_temp20));
|
|
22510
22567
|
} catch (e) {
|
|
22511
22568
|
return Promise.reject(e);
|
|
22512
22569
|
}
|
|
@@ -22514,7 +22571,7 @@ var useLogin = function useLogin() {
|
|
|
22514
22571
|
|
|
22515
22572
|
var getInformationSetting = function getInformationSetting() {
|
|
22516
22573
|
try {
|
|
22517
|
-
var
|
|
22574
|
+
var _temp22 = _catch(function () {
|
|
22518
22575
|
return Promise.resolve(getSchoolSettings()).then(function (res) {
|
|
22519
22576
|
dispatch(setSandboxMode(res.data.isSandboxMode));
|
|
22520
22577
|
});
|
|
@@ -22522,7 +22579,7 @@ var useLogin = function useLogin() {
|
|
|
22522
22579
|
console.error(err);
|
|
22523
22580
|
});
|
|
22524
22581
|
|
|
22525
|
-
return Promise.resolve(
|
|
22582
|
+
return Promise.resolve(_temp22 && _temp22.then ? _temp22.then(function () {}) : void 0);
|
|
22526
22583
|
} catch (e) {
|
|
22527
22584
|
return Promise.reject(e);
|
|
22528
22585
|
}
|
|
@@ -30416,7 +30473,7 @@ var useCategorySelector = function useCategorySelector() {
|
|
|
30416
30473
|
label: c.name,
|
|
30417
30474
|
value: c.id,
|
|
30418
30475
|
level: 0,
|
|
30419
|
-
isDisabled:
|
|
30476
|
+
isDisabled: false
|
|
30420
30477
|
});
|
|
30421
30478
|
|
|
30422
30479
|
result = result.concat(convertOptions(categories, category, childrenOfCategory));
|
|
@@ -30434,7 +30491,7 @@ var useCategorySelector = function useCategorySelector() {
|
|
|
30434
30491
|
label: c.name,
|
|
30435
30492
|
value: c.id,
|
|
30436
30493
|
level: parent.level ? parent.level + 1 : 1,
|
|
30437
|
-
isDisabled:
|
|
30494
|
+
isDisabled: false
|
|
30438
30495
|
});
|
|
30439
30496
|
|
|
30440
30497
|
result = result.concat(convertOptions(categories, category, childrenOfCategory));
|