mario-education 2.4.566-feedback → 2.4.567-feedback

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.
@@ -2,8 +2,7 @@ import 'react-phone-number-input/style.css';
2
2
  interface IProps {
3
3
  dataProfile: any;
4
4
  updateProfile: any;
5
- currentUser: any;
6
5
  goBack: any;
7
6
  }
8
- declare const Profile: ({ dataProfile, updateProfile, currentUser, goBack }: IProps) => JSX.Element;
7
+ declare const Profile: ({ dataProfile, updateProfile, goBack }: IProps) => JSX.Element;
9
8
  export default Profile;
package/dist/index.js CHANGED
@@ -76235,7 +76235,10 @@ var HeaderSideBar = function HeaderSideBar(_ref) {
76235
76235
  className: classes.menuItem
76236
76236
  }, React__default.createElement(LanguageDropdown, null)), !isReadOnly && React__default.createElement(core$1.MenuItem, {
76237
76237
  className: classes.menuItem,
76238
- onClick: openProfile
76238
+ onClick: function onClick() {
76239
+ openProfile();
76240
+ handleClose();
76241
+ }
76239
76242
  }, React__default.createElement("img", {
76240
76243
  className: classes.menuIcon,
76241
76244
  src: "/images/profile-icon.png"
@@ -80522,9 +80525,6 @@ var UPLOAD_FILE_URL = marioCore.BASE_URL + "/api/file";
80522
80525
  var SYSTEM_PROFILE = UPLOAD_FILE_URL + "/system/profile";
80523
80526
  var CHANGE_PASSWORD = marioCore.BASE_URL + "/api/Account/changePassword";
80524
80527
  var USER = marioCore.BASE_URL + "/api/User";
80525
- var getProfileTeacher = function getProfileTeacher() {
80526
- return marioCore.api.get(TEACHER_PROFILE + "/current");
80527
- };
80528
80528
  var updateProfileTeacher = function updateProfileTeacher(data) {
80529
80529
  return marioCore.api.put(TEACHER_PROFILE + "/current", data);
80530
80530
  };
@@ -80583,6 +80583,34 @@ var InitialData = {
80583
80583
  address: ''
80584
80584
  };
80585
80585
 
80586
+ var USER_URL$5 = marioCore.BASE_URL + "/api/user";
80587
+ var USER_EDU_URL$1 = marioCore.BASE_URL + "/api/User";
80588
+ var CHANGE_PASSWORD$1 = marioCore.BASE_URL + "/api/Account/changePassword";
80589
+ var ACCOUNT_URL$1 = marioCore.BASE_URL + "/api/account";
80590
+ var getById$q = function getById(id) {
80591
+ return marioCore.api.get(USER_URL$5 + "/" + id);
80592
+ };
80593
+ var getByIdUser = function getByIdUser(id) {
80594
+ return marioCore.api.get(USER_EDU_URL$1 + "/detail-user/" + id);
80595
+ };
80596
+ var create$o = function create(data) {
80597
+ return marioCore.api.post("" + USER_URL$5, data);
80598
+ };
80599
+ var update$q = function update(data) {
80600
+ return marioCore.api.put(USER_URL$5 + "/" + data.id, data);
80601
+ };
80602
+ var changePassword = function changePassword(formData) {
80603
+ return marioCore.api.post(CHANGE_PASSWORD$1, formData);
80604
+ };
80605
+ var forgotChangePassword = function forgotChangePassword(data) {
80606
+ return marioCore.api.post(ACCOUNT_URL$1 + "/forgotchangepassword", data);
80607
+ };
80608
+ var getTeachers = function getTeachers(filters) {
80609
+ return marioCore.api.get(USER_URL$5 + "/all/teacher", {
80610
+ params: filters
80611
+ });
80612
+ };
80613
+
80586
80614
  var useProfile = function useProfile() {
80587
80615
  var _useTranslation = marioCore.useTranslation(),
80588
80616
  t = _useTranslation.t;
@@ -80614,7 +80642,7 @@ var useProfile = function useProfile() {
80614
80642
  dispatch(marioCore.setLoading(true));
80615
80643
 
80616
80644
  var _temp4 = _catch(function () {
80617
- return Promise.resolve(getProfileTeacher()).then(function (res) {
80645
+ return Promise.resolve(getByIdUser(currentUser === null || currentUser === void 0 ? void 0 : currentUser.id)).then(function (res) {
80618
80646
  var _res$data;
80619
80647
 
80620
80648
  setDataProfile(res.data);
@@ -80798,7 +80826,6 @@ var DoneCheckInIcon = function DoneCheckInIcon(_ref) {
80798
80826
  var Profile = function Profile(_ref) {
80799
80827
  var dataProfile = _ref.dataProfile,
80800
80828
  updateProfile = _ref.updateProfile,
80801
- currentUser = _ref.currentUser,
80802
80829
  goBack = _ref.goBack;
80803
80830
 
80804
80831
  var _useTranslation = marioCore.useTranslation(),
@@ -80816,8 +80843,6 @@ var Profile = function Profile(_ref) {
80816
80843
  },
80817
80844
  validationSchema: schema$l
80818
80845
  }, function (formikProps) {
80819
- var _currentUser$userRole;
80820
-
80821
80846
  var values = formikProps.values,
80822
80847
  setFieldValue = formikProps.setFieldValue,
80823
80848
  handleSubmit = formikProps.handleSubmit,
@@ -80899,18 +80924,18 @@ var Profile = function Profile(_ref) {
80899
80924
  }))), React__default.createElement("div", {
80900
80925
  className: myProfile['edit-profile-container__form--field'] + " " + myProfile['edit-profile-container__form--width-70']
80901
80926
  }, React__default.createElement("p", null, " ", t("role")), React__default.createElement(core$1.Select, {
80927
+ multiple: true,
80928
+ disabled: true,
80929
+ name: "roles",
80902
80930
  variant: "outlined",
80903
- value: !!(values !== null && values !== void 0 && values.teacherRole) && (values === null || values === void 0 ? void 0 : values.teacherRole),
80904
- onChange: function onChange(e) {
80905
- return setFieldValue("teacherRole", e.target.value);
80931
+ value: (values === null || values === void 0 ? void 0 : values.roles) || [],
80932
+ renderValue: function renderValue(selected) {
80933
+ return selected.map(function (r) {
80934
+ return r;
80935
+ }).join(', ');
80906
80936
  },
80907
80937
  className: "" + myProfile["profile-value"]
80908
- }, currentUser === null || currentUser === void 0 ? void 0 : (_currentUser$userRole = currentUser.userRoles) === null || _currentUser$userRole === void 0 ? void 0 : _currentUser$userRole.map(function (role) {
80909
- return React__default.createElement(core$1.MenuItem, {
80910
- key: role,
80911
- value: role
80912
- }, role);
80913
- })))), React__default.createElement("div", {
80938
+ }))), React__default.createElement("div", {
80914
80939
  className: myProfile['edit-profile-container__form--row']
80915
80940
  }, React__default.createElement("div", {
80916
80941
  className: myProfile['edit-profile-container__form--field'] + " " + myProfile['edit-profile-container__form--width-50']
@@ -81213,7 +81238,6 @@ var MyProfile = function MyProfile() {
81213
81238
  var componentByControl = [{
81214
81239
  value: TypeControl.Info,
81215
81240
  component: React__default.createElement(Profile, {
81216
- currentUser: currentUser,
81217
81241
  dataProfile: dataProfile,
81218
81242
  updateProfile: updateProfile,
81219
81243
  goBack: goBack
@@ -81747,34 +81771,6 @@ var ChangePassword$1 = function ChangePassword(_ref) {
81747
81771
  }));
81748
81772
  };
81749
81773
 
81750
- var USER_URL$5 = marioCore.BASE_URL + "/api/user";
81751
- var USER_EDU_URL$1 = marioCore.BASE_URL + "/api/User";
81752
- var CHANGE_PASSWORD$1 = marioCore.BASE_URL + "/api/Account/changePassword";
81753
- var ACCOUNT_URL$1 = marioCore.BASE_URL + "/api/account";
81754
- var getById$q = function getById(id) {
81755
- return marioCore.api.get(USER_URL$5 + "/" + id);
81756
- };
81757
- var getByIdUser = function getByIdUser(id) {
81758
- return marioCore.api.get(USER_EDU_URL$1 + "/detail-user/" + id);
81759
- };
81760
- var create$o = function create(data) {
81761
- return marioCore.api.post("" + USER_URL$5, data);
81762
- };
81763
- var update$q = function update(data) {
81764
- return marioCore.api.put(USER_URL$5 + "/" + data.id, data);
81765
- };
81766
- var changePassword = function changePassword(formData) {
81767
- return marioCore.api.post(CHANGE_PASSWORD$1, formData);
81768
- };
81769
- var forgotChangePassword = function forgotChangePassword(data) {
81770
- return marioCore.api.post(ACCOUNT_URL$1 + "/forgotchangepassword", data);
81771
- };
81772
- var getTeachers = function getTeachers(filters) {
81773
- return marioCore.api.get(USER_URL$5 + "/all/teacher", {
81774
- params: filters
81775
- });
81776
- };
81777
-
81778
81774
  var initValue$v = {
81779
81775
  id: "",
81780
81776
  firstName: "",