mario-core 2.9.224-release → 2.9.225-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.
@@ -7,5 +7,8 @@ declare const useAssignStudent: (teacherSelected?: object | undefined, assistant
7
7
  handleChangeStaffBulk: (name: string, id: string) => void;
8
8
  staffBulkAssign: IStaffAssign;
9
9
  handleAssignStaffToStudents: (listUserIds: string[]) => void;
10
+ handleToggleInactiveModal: (listUserIds?: string[] | undefined) => void;
11
+ openInactiveModal: boolean;
12
+ handleInactiveStudents: (listStudentIds: string[], callback: () => void) => Promise<void>;
10
13
  };
11
14
  export default useAssignStudent;
package/dist/index.js CHANGED
@@ -32,6 +32,7 @@ var bi = require('react-icons/bi');
32
32
  var hi = require('react-icons/hi');
33
33
  var ai = require('react-icons/ai');
34
34
  var CreatableSelect = _interopDefault(require('react-select/creatable'));
35
+ var io = require('react-icons/io');
35
36
  var DatePicker = _interopDefault(require('react-datepicker'));
36
37
  var toDate = _interopDefault(require('date-fns/toDate'));
37
38
  var md = require('react-icons/md');
@@ -1847,6 +1848,8 @@ var my_learning_progress = "My Learning Progress";
1847
1848
  var responses_and_response_rates_per_question = "Responses and Response Rates Per Question";
1848
1849
  var responses_comparisons = "Responses Comparisons";
1849
1850
  var dropdown_and_verbal_questions_responses = "Dropdown and Verbal Questions Responses";
1851
+ var weekly_quests = "Weekly quests";
1852
+ var inactive_students = "Inactive Students";
1850
1853
  var lang_us = {
1851
1854
  dashboard: dashboard,
1852
1855
  user: user,
@@ -3674,7 +3677,9 @@ var lang_us = {
3674
3677
  "this_is_a_brand_new_beta_version_for_your_personal_learning_journey._you_can_think_about_what_you_want_like_to_do_and_how_you_like_to_learn._we_advise_you_to_do_it_gradually_per_section_and_visit_it_once_a_month.": "This is a brand new beta version for your personal learning journey. You can think about what you want like to do and how you like to learn. We advise you to do it gradually per section and visit it once a month.",
3675
3678
  responses_and_response_rates_per_question: responses_and_response_rates_per_question,
3676
3679
  responses_comparisons: responses_comparisons,
3677
- dropdown_and_verbal_questions_responses: dropdown_and_verbal_questions_responses
3680
+ dropdown_and_verbal_questions_responses: dropdown_and_verbal_questions_responses,
3681
+ weekly_quests: weekly_quests,
3682
+ inactive_students: inactive_students
3678
3683
  };
3679
3684
 
3680
3685
  var dashboard$1 = "Dashboard";
@@ -5485,6 +5490,7 @@ var print_my_accommodations$1 = "Print my accommodations";
5485
5490
  var my_learning_progress$1 = "My Learning Progress";
5486
5491
  var responses_comparisons$1 = "Responses Comparisons";
5487
5492
  var dropdown_and_verbal_questions_responses$1 = "Dropdown and Verbal Questions Responses";
5493
+ var inactive_students$1 = "Inactive Students";
5488
5494
  var lang_uk = {
5489
5495
  dashboard: dashboard$1,
5490
5496
  user: user$1,
@@ -7313,7 +7319,8 @@ var lang_uk = {
7313
7319
  "here_your_teacher_can_edit_or_add_your_accommodation_details._please_note_that_you_can_view_the_information,_but_for_any_edits_or_additions,_kindly_contact_your_teacher_directly.": "Here your teacher can edit or add your accommodation details. Please note that you can view the information, but for any edits or additions, kindly contact your teacher directly.",
7314
7320
  "this_is_a_brand_new_beta_version_for_your_personal_learning_journey._you_can_think_about_what_you_want_like_to_do_and_how_you_like_to_learn._we_advise_you_to_do_it_gradually_per_section_and_visit_it_once_a_month.": "This is a brand new beta version for your personal learning journey. You can think about what you want like to do and how you like to learn. We advise you to do it gradually per section and visit it once a month.",
7315
7321
  responses_comparisons: responses_comparisons$1,
7316
- dropdown_and_verbal_questions_responses: dropdown_and_verbal_questions_responses$1
7322
+ dropdown_and_verbal_questions_responses: dropdown_and_verbal_questions_responses$1,
7323
+ inactive_students: inactive_students$1
7317
7324
  };
7318
7325
 
7319
7326
  var dashboard$2 = "لوحة المعلومات";
@@ -9116,6 +9123,7 @@ var my_learning_progress$2 = "My Learning Progress";
9116
9123
  var responses_and_response_rates_per_question$2 = "الردود ومعدلات الاستجابة لكل سؤال";
9117
9124
  var responses_comparisons$2 = "مقارنات الردود";
9118
9125
  var dropdown_and_verbal_questions_responses$2 = "القائمة المنسدلة والأسئلة اللفظية الردود";
9126
+ var inactive_students$2 = "الطلاب غير النشطين";
9119
9127
  var lang_ar = {
9120
9128
  dashboard: dashboard$2,
9121
9129
  user: user$2,
@@ -10933,7 +10941,8 @@ var lang_ar = {
10933
10941
  "this_is_a_brand_new_beta_version_for_your_personal_learning_journey._you_can_think_about_what_you_want_like_to_do_and_how_you_like_to_learn._we_advise_you_to_do_it_gradually_per_section_and_visit_it_once_a_month.": "This is a brand new beta version for your personal learning journey. You can think about what you want like to do and how you like to learn. We advise you to do it gradually per section and visit it once a month.",
10934
10942
  responses_and_response_rates_per_question: responses_and_response_rates_per_question$2,
10935
10943
  responses_comparisons: responses_comparisons$2,
10936
- dropdown_and_verbal_questions_responses: dropdown_and_verbal_questions_responses$2
10944
+ dropdown_and_verbal_questions_responses: dropdown_and_verbal_questions_responses$2,
10945
+ inactive_students: inactive_students$2
10937
10946
  };
10938
10947
 
10939
10948
  var dashboard$3 = "Panel de Control";
@@ -11667,6 +11676,7 @@ var my_learning_plan_beta$3 = "My Learning Plan (Beta)";
11667
11676
  var responses_and_response_rates_per_question$3 = "Respuestas y tasas de respuesta por pregunta";
11668
11677
  var responses_comparisons$3 = "Comparaciones de respuestas";
11669
11678
  var dropdown_and_verbal_questions_responses$3 = "Preguntas desplegables y verbales Respuestas";
11679
+ var inactive_students$3 = "Estudiantes inactivos";
11670
11680
  var lang_es = {
11671
11681
  dashboard: dashboard$3,
11672
11682
  user: user$3,
@@ -12408,7 +12418,8 @@ var lang_es = {
12408
12418
  "this_is_a_brand_new_beta_version_for_your_personal_learning_journey._you_can_think_about_what_you_want_like_to_do_and_how_you_like_to_learn._we_advise_you_to_do_it_gradually_per_section_and_visit_it_once_a_month.": "This is a brand new beta version for your personal learning journey. You can think about what you want like to do and how you like to learn. We advise you to do it gradually per section and visit it once a month.",
12409
12419
  responses_and_response_rates_per_question: responses_and_response_rates_per_question$3,
12410
12420
  responses_comparisons: responses_comparisons$3,
12411
- dropdown_and_verbal_questions_responses: dropdown_and_verbal_questions_responses$3
12421
+ dropdown_and_verbal_questions_responses: dropdown_and_verbal_questions_responses$3,
12422
+ inactive_students: inactive_students$3
12412
12423
  };
12413
12424
 
12414
12425
  var TINY_MCE_API_KEY = "htqausuofrnali3nh9ivmlpq6v415o0tv2qikpg39bqf4pnk";
@@ -34717,6 +34728,9 @@ var create$7 = function create(data) {
34717
34728
  var update$7 = function update(data) {
34718
34729
  return api.put(USER_URL$1 + "/" + data.id, data);
34719
34730
  };
34731
+ var updateStatusAll = function updateStatusAll(ids) {
34732
+ return api.put(USER_URL$1 + "/update-status-all", ids);
34733
+ };
34720
34734
  var remove$3 = function remove(id) {
34721
34735
  return api["delete"](EDU_USER_URL + "/delete-item-user/" + id);
34722
34736
  };
@@ -36535,11 +36549,27 @@ var useAssignStudent = function useAssignStudent(teacherSelected, assistantSelec
36535
36549
  staffBulkAssign = _useState2[0],
36536
36550
  setStaffBulkAssign = _useState2[1];
36537
36551
 
36552
+ var _useState3 = React.useState(false),
36553
+ openInactiveModal = _useState3[0],
36554
+ setOpenInactiveModal = _useState3[1];
36555
+
36538
36556
  var handleToggleModel = function handleToggleModel() {
36539
36557
  setOpenModelBulk(!openModelBulk);
36540
36558
  setStaffBulkAssign(_extends({}, initialStaffBulk));
36541
36559
  };
36542
36560
 
36561
+ var handleToggleInactiveModal = function handleToggleInactiveModal(listUserIds) {
36562
+ if (listUserIds && listUserIds.length === 0) {
36563
+ dispatch(setAlert({
36564
+ type: "danger",
36565
+ message: "Please select students!"
36566
+ }));
36567
+ return;
36568
+ }
36569
+
36570
+ setOpenInactiveModal(!openInactiveModal);
36571
+ };
36572
+
36543
36573
  var handleChangeStaffBulk = function handleChangeStaffBulk(name, id) {
36544
36574
  var _extends2;
36545
36575
 
@@ -36701,6 +36731,41 @@ var useAssignStudent = function useAssignStudent(teacherSelected, assistantSelec
36701
36731
  handleToggleModel();
36702
36732
  assignStudents([].concat(users));
36703
36733
  }, [JSON.stringify(staffBulkAssign)]);
36734
+
36735
+ var handleInactiveStudents = function handleInactiveStudents(listStudentIds, callback) {
36736
+ try {
36737
+ var _temp7 = function _temp7() {
36738
+ setOpenInactiveModal(!openInactiveModal);
36739
+ dispatch(setLoading(false));
36740
+ };
36741
+
36742
+ dispatch(setLoading(true));
36743
+
36744
+ var _temp8 = _catch(function () {
36745
+ return Promise.resolve(updateStatusAll(listStudentIds)).then(function (res) {
36746
+ if (res.status == 200) {
36747
+ dispatch(setAlert({
36748
+ type: "success",
36749
+ message: "Inactive " + listStudentIds.length + " Students successfully"
36750
+ }));
36751
+ callback();
36752
+ }
36753
+ });
36754
+ }, function (error) {
36755
+ var _error$response, _error$response$data;
36756
+
36757
+ dispatch(setAlert({
36758
+ type: "danger",
36759
+ message: ((_error$response = error.response) === null || _error$response === void 0 ? void 0 : (_error$response$data = _error$response.data) === null || _error$response$data === void 0 ? void 0 : _error$response$data.title) || error.message
36760
+ }));
36761
+ });
36762
+
36763
+ return Promise.resolve(_temp8 && _temp8.then ? _temp8.then(_temp7) : _temp7(_temp8));
36764
+ } catch (e) {
36765
+ return Promise.reject(e);
36766
+ }
36767
+ };
36768
+
36704
36769
  return {
36705
36770
  handleAssignSingleStudent: handleAssignSingleStudent,
36706
36771
  handleAssignMultiStudent: handleAssignMultiStudent,
@@ -36708,7 +36773,10 @@ var useAssignStudent = function useAssignStudent(teacherSelected, assistantSelec
36708
36773
  handleToggleModel: handleToggleModel,
36709
36774
  handleChangeStaffBulk: handleChangeStaffBulk,
36710
36775
  staffBulkAssign: staffBulkAssign,
36711
- handleAssignStaffToStudents: handleAssignStaffToStudents
36776
+ handleAssignStaffToStudents: handleAssignStaffToStudents,
36777
+ handleToggleInactiveModal: handleToggleInactiveModal,
36778
+ openInactiveModal: openInactiveModal,
36779
+ handleInactiveStudents: handleInactiveStudents
36712
36780
  };
36713
36781
  };
36714
36782
 
@@ -36771,7 +36839,10 @@ var AssignStudentList = function AssignStudentList() {
36771
36839
  handleToggleModel = _useAssignStudent.handleToggleModel,
36772
36840
  staffBulkAssign = _useAssignStudent.staffBulkAssign,
36773
36841
  handleChangeStaffBulk = _useAssignStudent.handleChangeStaffBulk,
36774
- handleAssignStaffToStudents = _useAssignStudent.handleAssignStaffToStudents;
36842
+ handleAssignStaffToStudents = _useAssignStudent.handleAssignStaffToStudents,
36843
+ handleToggleInactiveModal = _useAssignStudent.handleToggleInactiveModal,
36844
+ openInactiveModal = _useAssignStudent.openInactiveModal,
36845
+ handleInactiveStudents = _useAssignStudent.handleInactiveStudents;
36775
36846
 
36776
36847
  var AssignStudentColumns = [{
36777
36848
  name: "",
@@ -36846,12 +36917,18 @@ var AssignStudentList = function AssignStudentList() {
36846
36917
  },
36847
36918
  color: "primary"
36848
36919
  }, t("assign_for_selected_students")), React__default.createElement(reactstrap.Button, {
36849
- className: "mx-2",
36920
+ className: "ml-2",
36850
36921
  onClick: function onClick() {
36851
36922
  return handleToggleModel();
36852
36923
  },
36853
36924
  color: "primary"
36854
- }, t("assign_bulk")))), React__default.createElement(reactstrap.Modal, {
36925
+ }, t("assign_bulk")), React__default.createElement(reactstrap.Button, {
36926
+ className: "ml-2",
36927
+ onClick: function onClick() {
36928
+ return handleToggleInactiveModal(isCheck);
36929
+ },
36930
+ color: "primary"
36931
+ }, t("inactive_students")))), React__default.createElement(reactstrap.Modal, {
36855
36932
  centered: true,
36856
36933
  isOpen: openModelBulk,
36857
36934
  toggle: function toggle() {
@@ -36924,7 +37001,39 @@ var AssignStudentList = function AssignStudentList() {
36924
37001
  onClick: function onClick() {
36925
37002
  return handleAssignStaffToStudents(isCheck);
36926
37003
  }
36927
- }, t("assign")))), React__default.createElement(reactstrap.Row, {
37004
+ }, t("assign")))), React__default.createElement(reactstrap.Modal, {
37005
+ centered: true,
37006
+ isOpen: openInactiveModal,
37007
+ toggle: function toggle() {
37008
+ return handleToggleInactiveModal();
37009
+ }
37010
+ }, React__default.createElement(reactstrap.ModalHeader, null, t("inactive_students")), React__default.createElement(reactstrap.ModalBody, {
37011
+ style: {
37012
+ display: 'flex',
37013
+ gap: 12
37014
+ }
37015
+ }, React__default.createElement(io.IoIosWarning, {
37016
+ color: "red",
37017
+ size: 30
37018
+ }), React__default.createElement(reactstrap.CardText, {
37019
+ style: {
37020
+ fontSize: 20,
37021
+ margin: 0,
37022
+ display: 'flex',
37023
+ alignItems: 'center'
37024
+ }
37025
+ }, "Are you sure you want to inactive " + isCheck.length + " students?")), React__default.createElement(reactstrap.ModalFooter, {
37026
+ className: "text-right"
37027
+ }, React__default.createElement(reactstrap.Button, {
37028
+ onClick: function onClick() {
37029
+ return handleToggleInactiveModal();
37030
+ }
37031
+ }, t("cancel")), React__default.createElement(reactstrap.Button, {
37032
+ color: "primary",
37033
+ onClick: function onClick() {
37034
+ return handleInactiveStudents(isCheck, handleResetData);
37035
+ }
37036
+ }, t("confirm")))), React__default.createElement(reactstrap.Row, {
36928
37037
  className: "mb-2"
36929
37038
  }, React__default.createElement(reactstrap.Col, {
36930
37039
  md: 12