mario-core 2.0.32-release → 2.0.33-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.
Files changed (187) hide show
  1. package/dist/Dashboard-BIhv8car.js +1 -0
  2. package/dist/Dashboard-BY5BVLIW.mjs +206 -0
  3. package/dist/Dashboard-BYXh-LYm.mjs +206 -0
  4. package/dist/Dashboard-Bp0ko4Nx.js +1 -0
  5. package/dist/Dashboard-BxX4EZkL.mjs +206 -0
  6. package/dist/Dashboard-CLvLdCvD.mjs +206 -0
  7. package/dist/Dashboard-CjDPZlwI.js +1 -0
  8. package/dist/Dashboard-D4yeROnn.mjs +206 -0
  9. package/dist/Dashboard-D6igZd4M.js +1 -0
  10. package/dist/Dashboard-D7X8bg8t.mjs +206 -0
  11. package/dist/Dashboard-DRaSlZLc.js +1 -0
  12. package/dist/Dashboard-DbI4E9od.js +1 -0
  13. package/dist/EmailTemplateDetail-B-Kab5TK.mjs +443 -0
  14. package/dist/EmailTemplateDetail-BJGaN7uh.js +1 -0
  15. package/dist/EmailTemplateDetail-BOqn4rkr.mjs +417 -0
  16. package/dist/EmailTemplateDetail-BlhCa_EF.mjs +443 -0
  17. package/dist/EmailTemplateDetail-CW0ymDWF.mjs +443 -0
  18. package/dist/EmailTemplateDetail-CZKvX-_q.js +1 -0
  19. package/dist/EmailTemplateDetail-D4EupjNO.js +1 -0
  20. package/dist/EmailTemplateDetail-DDbJbMWn.js +1 -0
  21. package/dist/EmailTemplateDetail-DP04M6QH.js +1 -0
  22. package/dist/EmailTemplateDetail-DSeAyn-F.mjs +443 -0
  23. package/dist/EmailTemplateDetail-J5R0X631.mjs +443 -0
  24. package/dist/EmailTemplateDetail-c2RcFzG5.js +1 -0
  25. package/dist/EmailTemplateList-BAVOo58z.js +1 -0
  26. package/dist/EmailTemplateList-BMCpm7sf.js +1 -0
  27. package/dist/EmailTemplateList-BQCcXdif.mjs +170 -0
  28. package/dist/EmailTemplateList-BVB1lsW7.mjs +170 -0
  29. package/dist/EmailTemplateList-BVfQCPzA.js +1 -0
  30. package/dist/EmailTemplateList-C-aj1Pl0.mjs +170 -0
  31. package/dist/EmailTemplateList-C5c2T4_M.mjs +170 -0
  32. package/dist/EmailTemplateList-D3G-A7Jo.js +1 -0
  33. package/dist/EmailTemplateList-DPQTaV4-.js +1 -0
  34. package/dist/EmailTemplateList-JRLV6pZW.mjs +170 -0
  35. package/dist/EmailTemplateList-ZTs0DmjS.js +1 -0
  36. package/dist/EmailTemplateList-gwkheOgx.mjs +168 -0
  37. package/dist/GalleryList-BU1m_MP_.js +1 -0
  38. package/dist/GalleryList-BftIdfu8.js +1 -0
  39. package/dist/GalleryList-Bl4FojYJ.mjs +329 -0
  40. package/dist/GalleryList-ByJ1_7Qx.mjs +329 -0
  41. package/dist/GalleryList-CVzc1xGW.js +1 -0
  42. package/dist/GalleryList-D5E7p3kE.mjs +329 -0
  43. package/dist/GalleryList-D5ZydfSV.js +1 -0
  44. package/dist/GalleryList-DHblERzG.js +1 -0
  45. package/dist/GalleryList-DXnU-Aou.mjs +329 -0
  46. package/dist/GalleryList-DpM906eg.mjs +329 -0
  47. package/dist/GalleryList-ZJ_mdpVZ.js +1 -0
  48. package/dist/GalleryList-oJNXivHy.mjs +329 -0
  49. package/dist/Login-A2cXwovI.mjs +1380 -0
  50. package/dist/Login-B69XhtIm.mjs +1380 -0
  51. package/dist/Login-BLyikyni.mjs +1380 -0
  52. package/dist/Login-Bwr0h4GC.js +1 -0
  53. package/dist/Login-C12Whvdx.js +1 -0
  54. package/dist/Login-CIcbHD7-.mjs +1380 -0
  55. package/dist/Login-D7gUoYyV.js +1 -0
  56. package/dist/Login-DEMe7ra6.js +1 -0
  57. package/dist/Login-Dcwb-HaZ.js +1 -0
  58. package/dist/Login-Rwbmk--s.js +1 -0
  59. package/dist/Login-h3o1lUKK.mjs +1380 -0
  60. package/dist/Login-xn2j4Jqq.mjs +1380 -0
  61. package/dist/NotificationList--DZcYUS5.js +2 -0
  62. package/dist/NotificationList-D26jJ6Wc.mjs +3969 -0
  63. package/dist/NotificationList-DZ1epO3L.mjs +3969 -0
  64. package/dist/NotificationList-D_lGCmIS.js +2 -0
  65. package/dist/NotificationList-Da-pWu35.js +2 -0
  66. package/dist/NotificationList-Dogczlgr.mjs +3969 -0
  67. package/dist/NotificationList-Dv0JIP69.js +2 -0
  68. package/dist/NotificationList-DygQSzwE.mjs +3969 -0
  69. package/dist/NotificationList-Ku1m25fI.mjs +3969 -0
  70. package/dist/NotificationList-Ml4QiyAE.mjs +3969 -0
  71. package/dist/NotificationList-_AHdv4bs.js +2 -0
  72. package/dist/NotificationList-rKx7xooX.js +2 -0
  73. package/dist/SkillList-BUDiP8Ba.mjs +386 -0
  74. package/dist/SkillList-Btum0zIE.js +1 -0
  75. package/dist/SkillList-C-dw1122.js +1 -0
  76. package/dist/SkillList-C0ZfIxCl.js +1 -0
  77. package/dist/SkillList-CZTd0oz_.mjs +386 -0
  78. package/dist/SkillList-DPU-l8aA.js +1 -0
  79. package/dist/SkillList-DTxT0Hbn.js +1 -0
  80. package/dist/SkillList-DVXAACsz.mjs +386 -0
  81. package/dist/SkillList-DX530KHp.mjs +386 -0
  82. package/dist/SkillList-DahOq8Os.mjs +386 -0
  83. package/dist/SkillList-DivkFIrP.mjs +386 -0
  84. package/dist/SkillList-yosFFVsc.js +1 -0
  85. package/dist/TeacherSelector-5UVov2Wf.mjs +30 -0
  86. package/dist/TeacherSelector-Bi582rEx.mjs +30 -0
  87. package/dist/TeacherSelector-BmmfQxU8.js +1 -0
  88. package/dist/TeacherSelector-BngXAzRe.mjs +30 -0
  89. package/dist/TeacherSelector-C7-XuXfb.mjs +30 -0
  90. package/dist/TeacherSelector-C9Z5JX-P.js +1 -0
  91. package/dist/TeacherSelector-CZ1DrLUk.js +1 -0
  92. package/dist/TeacherSelector-CbJ1kPyV.js +1 -0
  93. package/dist/TeacherSelector-CkGdl96R.js +1 -0
  94. package/dist/TeacherSelector-CxDiVyno.mjs +30 -0
  95. package/dist/TeacherSelector-DomtJIQi.js +1 -0
  96. package/dist/TeacherSelector-mjBcHGJF.mjs +30 -0
  97. package/dist/TheContent-B42qwDUV.mjs +38 -0
  98. package/dist/TheContent-BW03X6oT.mjs +38 -0
  99. package/dist/TheContent-CayaQR9C.js +1 -0
  100. package/dist/TheContent-CiU0FBTA.mjs +38 -0
  101. package/dist/TheContent-D5Qx4QXe.js +1 -0
  102. package/dist/TheContent-DHWnB8WX.js +1 -0
  103. package/dist/TheContent-DPy5BFuN.js +1 -0
  104. package/dist/TheContent-Dl7_h11H.mjs +38 -0
  105. package/dist/TheContent-DxN9-GIu.mjs +38 -0
  106. package/dist/TheContent-H-Hg7kIq.js +1 -0
  107. package/dist/TheContent-aEfXKW_H.mjs +38 -0
  108. package/dist/TheContent-xUKaH5bl.js +1 -0
  109. package/dist/UserContainer-3dOz3yZF.js +5 -0
  110. package/dist/UserContainer-B-abn6--.js +5 -0
  111. package/dist/UserContainer-BIl8c0yJ.js +5 -0
  112. package/dist/UserContainer-BjYrV0kt.mjs +2783 -0
  113. package/dist/UserContainer-BoJ73Ko9.js +5 -0
  114. package/dist/UserContainer-CFnSfW2A.js +5 -0
  115. package/dist/UserContainer-CGlDCED1.mjs +2771 -0
  116. package/dist/UserContainer-CqTUtCe6.mjs +2770 -0
  117. package/dist/UserContainer-CtYpysOo.mjs +2771 -0
  118. package/dist/UserContainer-Cu6koTiw.mjs +2771 -0
  119. package/dist/UserContainer-Dz991Fto.mjs +2770 -0
  120. package/dist/UserContainer-d3ywqdWh.js +5 -0
  121. package/dist/UserDetail-BCLssfN6.mjs +902 -0
  122. package/dist/UserDetail-BRCOabYu.mjs +902 -0
  123. package/dist/UserDetail-BsWWKLof.js +1 -0
  124. package/dist/UserDetail-CkMU6eej.js +1 -0
  125. package/dist/UserDetail-Cl6y6AtA.js +1 -0
  126. package/dist/UserDetail-CqBaMe5l.mjs +902 -0
  127. package/dist/UserDetail-D36q7Em-.mjs +902 -0
  128. package/dist/UserDetail-DFjYZZOc.js +1 -0
  129. package/dist/UserDetail-DIGlXdot.mjs +914 -0
  130. package/dist/UserDetail-DizNdqsR.mjs +902 -0
  131. package/dist/UserDetail-DwNEJ0kC.js +1 -0
  132. package/dist/UserDetail-Wn1wTs2Z.js +1 -0
  133. package/dist/UserList-4XLAsuI5.mjs +1205 -0
  134. package/dist/UserList-B9_Ok-O-.js +5 -0
  135. package/dist/UserList-BAirPxDM.js +7 -0
  136. package/dist/UserList-BFRsUwHp.js +5 -0
  137. package/dist/UserList-BgtFj_YA.mjs +1171 -0
  138. package/dist/UserList-BjEBqEMi.mjs +1205 -0
  139. package/dist/UserList-C6MCzl4Q.js +7 -0
  140. package/dist/UserList-CLDgmfZl.mjs +1171 -0
  141. package/dist/UserList-CRqA2Kvb.js +7 -0
  142. package/dist/UserList-D-5W9tzb.mjs +1205 -0
  143. package/dist/UserList-D63-z7TV.mjs +1205 -0
  144. package/dist/UserList-DX_DRp8l.js +7 -0
  145. package/dist/constants-1VW88-cg.mjs +320 -0
  146. package/dist/constants-B09dcc2W.js +1 -0
  147. package/dist/constants-BSg1aI4R.js +1 -0
  148. package/dist/constants-BXFDJA-1.js +1 -0
  149. package/dist/constants-BdoFiMvT.mjs +320 -0
  150. package/dist/constants-BrOUFw2c.js +1 -0
  151. package/dist/constants-ClfPwBI0.mjs +320 -0
  152. package/dist/constants-D3RqPPqz.mjs +320 -0
  153. package/dist/constants-D5ZWXomx.js +1 -0
  154. package/dist/constants-DiRwIQ5M.mjs +320 -0
  155. package/dist/constants-bWeajrBe.js +1 -0
  156. package/dist/constants-dgRR32rI.mjs +320 -0
  157. package/dist/containers/EmailTemplate/hooks/useEmailTemplateDetail.d.ts +1 -0
  158. package/dist/containers/User/constants/types.d.ts +1 -0
  159. package/dist/containers/User/hooks/useExportUsersCsv.d.ts +1 -0
  160. package/dist/index-B3Kqv7dj.mjs +17787 -0
  161. package/dist/index-BTWI5jDz.js +15 -0
  162. package/dist/index-C1gw45bw.mjs +17792 -0
  163. package/dist/index-CFAFmJ4F.mjs +17782 -0
  164. package/dist/index-D6pNkzlV.mjs +17787 -0
  165. package/dist/index-DDw_4X4u.js +15 -0
  166. package/dist/index-DVZt7HdB.js +15 -0
  167. package/dist/index-Di2zNE1O.mjs +17792 -0
  168. package/dist/index-DzHydV61.js +15 -0
  169. package/dist/index-Ihdym4EQ.js +15 -0
  170. package/dist/index-UpEZLqQV.js +15 -0
  171. package/dist/index-cuQPyXoT.mjs +17772 -0
  172. package/dist/index.js +1 -1
  173. package/dist/index.modern.js +1 -1
  174. package/dist/mailCategoryService-BbqIjbpT.mjs +11 -0
  175. package/dist/mailCategoryService-C1sorb9h.js +1 -0
  176. package/dist/mailCategoryService-CZ9m51K4.js +1 -0
  177. package/dist/mailCategoryService-C_Lq0Uks.mjs +11 -0
  178. package/dist/mailCategoryService-DcwLjTWD.mjs +11 -0
  179. package/dist/mailCategoryService-DexSxwen.js +1 -0
  180. package/dist/mailCategoryService-DrZXrEp2.js +1 -0
  181. package/dist/mailCategoryService-DyLMoDxP.mjs +11 -0
  182. package/dist/mailCategoryService-LumZqQLL.mjs +11 -0
  183. package/dist/mailCategoryService-MyMGdKSl.mjs +11 -0
  184. package/dist/mailCategoryService-Pl31B1JT.js +1 -0
  185. package/dist/mailCategoryService-lvLdr9b4.js +1 -0
  186. package/dist/mario-core.css +1 -1
  187. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("react"),Q=require("react-router-dom"),t=require("reactstrap"),W=require("formik"),Z=require("react-datepicker"),K=require("date-fns"),f=require("./constants-B09dcc2W.js"),J=require("react-redux"),ee=require("react-i18next"),s=require("./index-UpEZLqQV.js"),se=require("yup"),te=require("./TeacherSelector-CbJ1kPyV.js");function ae(i){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const o in i)if(o!=="default"){const w=Object.getOwnPropertyDescriptor(i,o);Object.defineProperty(n,o,w.get?w:{enumerable:!0,get:()=>i[o]})}}return n.default=i,Object.freeze(n)}const N=ae(se),re={id:"",firstName:"",lastName:"",email:"",dateOfBirth:"",roles:[],isActive:!0,profileImageFileName:"",teacherUserId:[]},Y="/admin/users/user-list",oe="User detail",ne=i=>{const n=J.useDispatch(),o=Q.useNavigate(),[w,D]=d.useState(re),[y,j]=d.useState(!1),[T,F]=d.useState([]),[C,g]=d.useState(null),[k,v]=d.useState(!1),[b,I]=d.useState({isHasAssistantData:!1,isHasCounselorData:!1,isHasEduTeacherData:!1,isHasSecondaryTeacherData:!1,isHasTeacherData:!1}),B=async()=>{localStorage.setItem(window.location.href,"true"),v(!0)},[A,h]=d.useState([]),u=()=>{j(!y)};d.useEffect(()=>{document.title=oe,v(!1),localStorage.getItem(window.location.href)&&localStorage.removeItem(window.location.href)},[]),d.useEffect(()=>{i&&(p(),O()),!i&&U()},[i]);const p=d.useCallback(async()=>{n(s.setLoading(!0));try{const a=await f.userRoleHasData(i);I(a.data)}catch(a){n(s.setAlert({type:"danger",message:a.response?.data?.title||a.message}))}n(s.setLoading(!1))},[i]),O=d.useCallback(async()=>{n(s.setLoading(!0));try{const a=await f.getById(i);D({...a.data,dateOfBirth:K.format(new Date(a.data.dateOfBirth),s.DATE_FORMAT),roles:a.data.roles.map(c=>c!="EduTeacher"?c:s.ROLES.EDUTEACHER)}),h(a?.data?.roles??[]),document.title=a.data?.fullName}catch(a){n(s.setAlert({type:"danger",message:a.response?.data?.title||a.message}))}n(s.setLoading(!1))},[i]),U=async()=>{try{const a=await f.getTeachers({sortBy:"Email"});a.data&&F(a.data.map?.(c=>({label:c.email,value:c.id}))||[])}catch(a){n(s.setAlert({type:"danger",message:a.response?.data?.title||a.message}))}},P=d.useCallback(a=>{o(a&&typeof a=="string"?Y+`?query=${a}`:Y)},[]),_=d.useCallback(async a=>{n(s.setLoading(!0));try{if(C){const S=new FormData,{name:E}=C;S.append("file",C,E);const $=(await s.systemProfileUpload(S))?.data?.key;a.profileImageFileName=$}const c=i?f.update:f.create;!i&&delete a.id,a.dateOfBirth===""&&delete a.dateOfBirth;const m=await c(a);m&&f.getById(m.data.id).then(S=>{P(S.data.fullName)}),i||alert("Password of "+m.data.email+` is "${m.data.password}"`),m.data.id&&await f.changeGradeOfStudents(m.data.id,a.gradeLevel),n(s.setAlert({type:"success",message:`${i?"Update":"Create"} user successfully`}))}catch(c){n(s.setAlert({type:"danger",message:c.response?.data?.title||c.message}))}n(s.setLoading(!1))},[i,C]),R=a=>["Student","Parent","EduTeacher"].includes(a),M=async a=>{n(s.setLoading(!0));try{await f.changePassword(a),n(s.setAlert({type:"success",message:"Change password successfully"}))}catch(c){n(s.setAlert({type:"danger",message:c.response?.data?.title||c.message}))}n(s.setLoading(!1))},x=d.useCallback(async a=>{n(s.setLoading(!0));try{await f.forgotChangePassword(a),n(s.setAlert({type:"success",message:"Send forgot password link successfully"}))}catch(c){n(s.setAlert({type:"danger",message:c.response?.data?.title||c.message||"Error occured"}))}n(s.setLoading(!1))},[]),l=d.useCallback(async a=>{n(s.setLoading(!0));try{const c={userId:a},m=await f.resetPasswordForAdmin(c);if(m.data){const S=`${w.firstName} ${w.lastName}`;alert(`Password of ${S} is ${m.data}`),n(s.setAlert({type:"success",message:"Update user password successfully"}))}}catch(c){n(s.setAlert({type:"danger",message:c.response?.data?.title||c.message}))}n(s.setLoading(!1))},[w]);return{userDetail:w,backToList:P,confirmData:_,file:C,setFile:g,edited:k,setEdited:v,setEditedTrue:B,confirmChangePassword:M,forgotPasswordRequest:x,currentRoles:A,handleDisableRoles:R,handleResetPassword:l,teacherOptions:T,openModel:y,handleToggleModel:u,userHasData:b}},le=N.object({firstName:N.string().required("First name is required"),lastName:N.string().required("Last name is required"),email:N.string().email("Email is invalid").required("Email is required"),roles:N.array().of(N.string()).min(1,"Role is required")}),ie=N.object({oldPassword:N.string().required("Current password is required"),newPassword:N.string().required("New password is required"),confirmedNewPassword:N.string().required("Confirm password is required")}),ce={currentPage:1,pageSize:100},de=(i,n)=>{const[o,w]=d.useState([]),[D,y]=d.useState(!1),[j,T]=d.useState(ce),[F,C]=d.useState(),g=J.useDispatch(),k=d.useCallback(async()=>{y(!0);try{const u=(await f.getRosterUsersApi(j)).data?.items||[];w(b(u))}catch{g(s.setAlert({type:"error",message:"Cannot get roster users"}))}y(!1)},[JSON.stringify(j)]),v=d.useCallback(async()=>{if(!n)return;const h=o.find(u=>u.value===n);if(h){C(h);return}y(!0);try{const p=(await f.getRosterUserBySourcedIdApi(n)).data;C({label:I(p),value:p.sourcedId})}catch(u){console.log("err:",u)}y(!1)},[n]),b=h=>h.map(u=>({label:I(u),value:u.sourcedId})),I=h=>{const u=[],{givenName:p,middleName:O,familyName:U,email:P,role:_}=h,R=[];return p&&R.push(p),O&&R.push(O),U&&R.push(U),R.length&&u.push(R.join(" ")),P&&u.push(P),`${u.join(" - ")}${_?` (${_})`:""}`},B=h=>{T(u=>({...u,searchString:h}))},A=d.useCallback(h=>{T({...j,...h})},[JSON.stringify(j)]);return d.useEffect(()=>{j.roles?.length&&k()},[JSON.stringify(j)]),d.useEffect(()=>{A({roles:i})},[JSON.stringify(i)]),d.useEffect(()=>{v()},[n]),{users:o,isLoading:D,user:F,handleInputChange:B}},ue=({value:i,roles:n,onChange:o})=>{const{users:w,isLoading:D,user:y,handleInputChange:j}=de(n,i);return e.jsx(s.CustomSelector,{options:w,value:y,placeholder:"Select user",onChange:o,isLoading:D,onInputChange:j})},me="create_user",he="edit_user",pe="change_password",ge=()=>{const{id:i}=Q.useParams(),n=J.useSelector(x=>x.common.user),{t:o}=ee.useTranslation(),{userDetail:w,backToList:D,confirmData:y,file:j,setFile:T,edited:F,setEdited:C,setEditedTrue:g,confirmChangePassword:k,forgotPasswordRequest:v,currentRoles:b,handleDisableRoles:I,handleResetPassword:B,teacherOptions:A,openModel:h,handleToggleModel:u,userHasData:p}=ne(i),O={oldPassword:"",newPassword:"",confirmedNewPassword:""},U=o(i?`${he}`:`${me}`),P=o(i?"update":"create"),_=()=>{var x=window.location.origin+"/api/ExportDataUser/"+i;window.open(x)},R=async x=>{var l={email:x};v(l)},M=()=>{if(!i)return;confirm("You want to reset this user's password")==!0&&B(i)};return e.jsx(W.Formik,{initialValues:w,enableReinitialize:!0,validationSchema:le,onSubmit:x=>{y({...x,roles:x.roles.map(l=>l!=s.ROLES.EDUTEACHER?l:"EduTeacher")}),C(!1),localStorage.getItem(window.location.href)&&localStorage.removeItem(window.location.href)},children:x=>{const{values:l,touched:a,errors:c,setFieldValue:m,handleChange:S,handleBlur:E,handleSubmit:G}=x,$=d.useCallback(r=>{if(l.roles.includes(r)){m("roles",l.roles.filter(L=>L!==r));return}if([s.ROLES.STUDENT,s.ROLES.PARENT].includes(r)){m("roles",[r]);return}if(l.roles.includes(s.ROLES.STUDENT)&&s.ROLES.STUDENT!=r){m("roles",[r]);return}m("roles",[...l.roles,r])},[l.roles]);return e.jsxs("div",{className:`animated fadeIn detail-buttons-padding ${s.screenWidth<=767?s.styles["p-0-12"]:""}`,children:[e.jsx(s.QuitPrompt,{when:F}),e.jsx("h5",{className:"mb-2",children:U}),e.jsxs(t.Row,{className:"pt-2",children:[e.jsxs(t.Col,{md:8,children:[e.jsxs(t.Row,{children:[e.jsx(t.Col,{md:6,children:e.jsxs(t.FormGroup,{children:[e.jsx(s.RequiredLabel,{text:o("first_name"),className:"text-capitalize"}),e.jsx(t.Input,{name:"firstName",value:l.firstName,onChange:r=>{S(r),g()},onBlur:E("subject"),placeholder:o("first_name"),className:s.styles["input-name"]}),a.firstName&&c.firstName&&e.jsx(s.ErrorHandler,{text:c.firstName})]})}),e.jsx(t.Col,{md:6,children:e.jsxs(t.FormGroup,{children:[e.jsx(t.Label,{children:o("date_of_birth")}),e.jsx("div",{children:e.jsx(Z,{value:l.dateOfBirth,todayButton:"Today",peekNextMonth:!0,showMonthDropdown:!0,showYearDropdown:!0,dropdownMode:"select",selected:l.dateOfBirth?f.toDate(new Date(l.dateOfBirth)):null,onChange:r=>{x.setFieldValue("dateOfBirth",K.format(r,s.DATE_FORMAT)),g()},placeholderText:o("date_of_birth"),customInput:e.jsx(t.Input,{type:"text",style:{width:"maxContent"},placeholder:o("date_of_birth")})})})]})})]}),e.jsxs(t.Row,{children:[e.jsx(t.Col,{md:6,children:e.jsxs(t.FormGroup,{children:[e.jsx(s.RequiredLabel,{text:o("last_name"),className:"text-capitalize"}),e.jsx(t.Input,{name:"lastName",value:l.lastName,onChange:r=>{S(r),g()},onBlur:E("lastName"),placeholder:o("last_name"),className:s.styles["input-name"]}),a.lastName&&c.lastName&&e.jsx(s.ErrorHandler,{text:c.lastName})]})}),e.jsx(t.Col,{md:6,children:e.jsxs(t.FormGroup,{children:[e.jsx(s.RequiredLabel,{text:o("roles")}),e.jsx(t.Row,{children:e.jsx(t.Col,{md:12,className:"d-flex flex-wrap align-items-center",children:s.USER_ROLES.map(r=>e.jsx("div",{className:"mr-3",children:e.jsx(t.Input,{type:"checkbox",id:`role-checkbox-${r}`,label:r==="SecondaryTeacher"?"SupportTeacher":`${r}`,checked:l.roles.includes(r),onChange:()=>{i&&(p.isHasTeacherData&&r==="Teacher"||p.isHasAssistantData&&r==="Assistant"||p.isHasCounselorData&&r==="Counselor"||p.isHasSecondaryTeacherData&&r==="SecondaryTeacher"||r=="Student"&&(p.isHasAssistantData||p.isHasCounselorData||p.isHasSecondaryTeacherData||p.isHasTeacherData))?alert("Please switch data before removing the role"):($(r),g())},disabled:b.includes("Parent")||b.includes("Student")&&i?b.concat(["Student","Parent"]).includes(r)||b.every(I):["Parent"].includes(r)})},r))})}),a.roles&&c.roles&&e.jsx(s.ErrorHandler,{text:c.roles})]})})]}),e.jsxs(t.Row,{children:[e.jsx(t.Col,{md:6,children:e.jsxs(t.FormGroup,{children:[e.jsx(s.RequiredLabel,{text:o("email")}),e.jsx(t.Input,{name:"email",value:l.email,onChange:r=>{S(r),g()},onBlur:E("email"),placeholder:o("email")}),a.email&&c.email&&e.jsx(s.ErrorHandler,{text:c.email})]})}),e.jsx(t.Col,{md:6,children:e.jsxs(t.FormGroup,{children:[e.jsx(s.RequiredLabel,{text:o("status")}),e.jsxs(t.Row,{children:[e.jsx(t.Col,{md:3,children:e.jsx(t.Input,{id:"role-checkbox-active",type:"radio",name:"active",label:o("active"),checked:!!l&&!!l.isActive,onChange:()=>{m("isActive",!0),g()}})}),e.jsx(t.Col,{md:3,children:e.jsx(t.Input,{id:"role-checkbox-inActive",type:"radio",name:"active",label:o("inactive"),checked:!!l&&!l.isActive,onChange:()=>m("isActive",!1)})})]})]})})]}),l.roles.includes(s.ROLES.STUDENT)&&e.jsx(t.Row,{children:e.jsx(t.Col,{md:6,children:e.jsxs(t.FormGroup,{children:[e.jsx(t.Label,{children:"Grade Level"}),e.jsx(s.CustomSelector,{options:f.gradeOptions,value:f.gradeOptions.find(r=>r.value==l.gradeLevel),placeholder:"Grade Level",onChange:r=>{m("gradeLevel",r.value)}})]})})}),!!i&&e.jsxs(t.Row,{children:[e.jsx(t.Col,{md:6,children:(!l.roles.includes("Admin")||l.roles.length>1)&&!!l.roles.length&&e.jsxs(t.FormGroup,{children:[e.jsx(t.Label,{children:"Map from Roster"}),e.jsx(ue,{roles:l.roles,value:l.sourcedId,onChange:r=>m("sourcedId",r.value)})]})}),e.jsxs(t.Col,{md:6,children:[e.jsx(t.Button,{color:"primary",className:"w-100",onClick:()=>{R(l.email||"")},children:o("send_forgot_password_link")}),e.jsx(t.Button,{color:"primary",className:"w-100 mt-3",onClick:()=>M(),children:o("reset_password")}),e.jsx(t.Button,{color:"success",className:"w-100 mt-3",onClick:()=>{_()},children:o("download_user_data")})]})]})]}),e.jsx(t.Col,{md:4,children:e.jsx(t.Row,{children:e.jsxs(t.Col,{md:8,children:[e.jsx(s.UploadFileButton,{setFile:T,fileName:l.profileImageFileName,onAddImage:g,canDelete:!0,onDelete:()=>{T(null),m("profileImageFileName",""),g()}}),!j&&!l.profileImageFileName&&e.jsx("img",{src:s.DEFAULT_IMAGE_URL,style:{maxWidth:"100%"}})]})})})]}),n.id===i?e.jsxs("div",{children:[e.jsx("h5",{className:"mt-3",children:o(`${pe}`)}),e.jsx(W.Formik,{initialValues:O,enableReinitialize:!0,validationSchema:ie,onSubmit:r=>{k(r)},children:r=>{const{values:L,touched:z,errors:q,handleChange:V,handleSubmit:X}=r;return e.jsxs(t.Row,{className:"pt-2 pb-5",children:[e.jsx(t.Col,{md:7,children:e.jsxs(t.FormGroup,{children:[e.jsx(s.RequiredLabel,{text:o("current_password"),className:"text-capitalize"}),e.jsx(t.Input,{name:"oldPassword",type:"password",value:L.oldPassword,onChange:H=>{V(H),g()},onBlur:E("subject"),placeholder:o("current_password"),className:s.styles["input-name"]}),z.oldPassword&&q.oldPassword&&e.jsx(s.ErrorHandler,{text:q.oldPassword})]})}),e.jsx(t.Col,{md:7,children:e.jsxs(t.FormGroup,{children:[e.jsx(s.RequiredLabel,{text:o("new_password"),className:"text-capitalize"}),e.jsx(t.Input,{name:"newPassword",type:"password",value:L.newPassword,onChange:H=>{V(H),g()},onBlur:E("subject"),placeholder:o("new_password"),className:s.styles["input-name"]}),z.newPassword&&q.newPassword&&e.jsx(s.ErrorHandler,{text:q.newPassword})]})}),e.jsx(t.Col,{md:7,children:e.jsxs(t.FormGroup,{children:[e.jsx(s.RequiredLabel,{text:o("confirm_password"),className:"text-capitalize"}),e.jsx(t.Input,{name:"confirmedNewPassword",type:"password",value:L.confirmedNewPassword,onChange:H=>{V(H),g()},onBlur:E("subject"),placeholder:o("confirm_password"),className:s.styles["input-name"]}),z.confirmedNewPassword&&q.confirmedNewPassword&&e.jsx(s.ErrorHandler,{text:q.confirmedNewPassword})]})}),e.jsx(t.Col,{md:12,children:e.jsx(t.Button,{color:"primary",size:"sm",className:"px-4 pl-1 mr-2 ml-3",onClick:()=>X(),children:o("save")})})]})}})]}):null,e.jsx(s.DetailActionButtons,{confirmText:P,onConfirm:l.roles.includes(s.ROLES.STUDENT)&&!i?u:G,onCancel:D}),e.jsxs(t.Modal,{centered:!0,isOpen:h,toggle:()=>u(),children:[e.jsx(t.ModalHeader,{children:"Assign Teacher"}),e.jsx(t.ModalBody,{children:e.jsx(te.TeacherSelector,{isMulti:!0,value:A.filter(r=>l.teacherUserId?.includes(r.value))||null,options:A,onChange:r=>m("teacherUserId",r.map(L=>L.value)),placeholder:o("select_teacher"),className:"flex-grow-1 mb-3"})}),e.jsxs(t.ModalFooter,{className:"text-right",children:[e.jsx(t.Button,{onClick:()=>u(),children:"Cancel"}),e.jsx(t.Button,{disabled:!l.teacherUserId,color:"primary",onClick:()=>{G()},children:"Assign"})]})]})]})}})};exports.default=ge;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("react"),Q=require("react-router-dom"),t=require("reactstrap"),W=require("formik"),Z=require("react-datepicker"),K=require("date-fns"),f=require("./constants-BXFDJA-1.js"),J=require("react-redux"),ee=require("react-i18next"),s=require("./index-BTWI5jDz.js"),se=require("yup"),te=require("./TeacherSelector-BmmfQxU8.js");function ae(i){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const o in i)if(o!=="default"){const w=Object.getOwnPropertyDescriptor(i,o);Object.defineProperty(n,o,w.get?w:{enumerable:!0,get:()=>i[o]})}}return n.default=i,Object.freeze(n)}const N=ae(se),re={id:"",firstName:"",lastName:"",email:"",dateOfBirth:"",roles:[],isActive:!0,profileImageFileName:"",teacherUserId:[]},Y="/admin/users/user-list",oe="User detail",ne=i=>{const n=J.useDispatch(),o=Q.useNavigate(),[w,D]=d.useState(re),[y,j]=d.useState(!1),[T,F]=d.useState([]),[C,g]=d.useState(null),[k,v]=d.useState(!1),[b,I]=d.useState({isHasAssistantData:!1,isHasCounselorData:!1,isHasEduTeacherData:!1,isHasSecondaryTeacherData:!1,isHasTeacherData:!1}),B=async()=>{localStorage.setItem(window.location.href,"true"),v(!0)},[A,h]=d.useState([]),u=()=>{j(!y)};d.useEffect(()=>{document.title=oe,v(!1),localStorage.getItem(window.location.href)&&localStorage.removeItem(window.location.href)},[]),d.useEffect(()=>{i&&(p(),O()),!i&&U()},[i]);const p=d.useCallback(async()=>{n(s.setLoading(!0));try{const a=await f.userRoleHasData(i);I(a.data)}catch(a){n(s.setAlert({type:"danger",message:a.response?.data?.title||a.message}))}n(s.setLoading(!1))},[i]),O=d.useCallback(async()=>{n(s.setLoading(!0));try{const a=await f.getById(i);D({...a.data,dateOfBirth:K.format(new Date(a.data.dateOfBirth),s.DATE_FORMAT),roles:a.data.roles.map(c=>c!="EduTeacher"?c:s.ROLES.EDUTEACHER)}),h(a?.data?.roles??[]),document.title=a.data?.fullName}catch(a){n(s.setAlert({type:"danger",message:a.response?.data?.title||a.message}))}n(s.setLoading(!1))},[i]),U=async()=>{try{const a=await f.getTeachers({sortBy:"Email"});a.data&&F(a.data.map?.(c=>({label:c.email,value:c.id}))||[])}catch(a){n(s.setAlert({type:"danger",message:a.response?.data?.title||a.message}))}},P=d.useCallback(a=>{o(a&&typeof a=="string"?Y+`?query=${a}`:Y)},[]),_=d.useCallback(async a=>{n(s.setLoading(!0));try{if(C){const S=new FormData,{name:E}=C;S.append("file",C,E);const $=(await s.systemProfileUpload(S))?.data?.key;a.profileImageFileName=$}const c=i?f.update:f.create;!i&&delete a.id,a.dateOfBirth===""&&delete a.dateOfBirth;const m=await c(a);m&&f.getById(m.data.id).then(S=>{P(S.data.fullName)}),i||alert("Password of "+m.data.email+` is "${m.data.password}"`),m.data.id&&await f.changeGradeOfStudents(m.data.id,a.gradeLevel),n(s.setAlert({type:"success",message:`${i?"Update":"Create"} user successfully`}))}catch(c){n(s.setAlert({type:"danger",message:c.response?.data?.title||c.message}))}n(s.setLoading(!1))},[i,C]),R=a=>["Student","Parent","EduTeacher"].includes(a),M=async a=>{n(s.setLoading(!0));try{await f.changePassword(a),n(s.setAlert({type:"success",message:"Change password successfully"}))}catch(c){n(s.setAlert({type:"danger",message:c.response?.data?.title||c.message}))}n(s.setLoading(!1))},x=d.useCallback(async a=>{n(s.setLoading(!0));try{await f.forgotChangePassword(a),n(s.setAlert({type:"success",message:"Send forgot password link successfully"}))}catch(c){n(s.setAlert({type:"danger",message:c.response?.data?.title||c.message||"Error occured"}))}n(s.setLoading(!1))},[]),l=d.useCallback(async a=>{n(s.setLoading(!0));try{const c={userId:a},m=await f.resetPasswordForAdmin(c);if(m.data){const S=`${w.firstName} ${w.lastName}`;alert(`Password of ${S} is ${m.data}`),n(s.setAlert({type:"success",message:"Update user password successfully"}))}}catch(c){n(s.setAlert({type:"danger",message:c.response?.data?.title||c.message}))}n(s.setLoading(!1))},[w]);return{userDetail:w,backToList:P,confirmData:_,file:C,setFile:g,edited:k,setEdited:v,setEditedTrue:B,confirmChangePassword:M,forgotPasswordRequest:x,currentRoles:A,handleDisableRoles:R,handleResetPassword:l,teacherOptions:T,openModel:y,handleToggleModel:u,userHasData:b}},le=N.object({firstName:N.string().required("First name is required"),lastName:N.string().required("Last name is required"),email:N.string().email("Email is invalid").required("Email is required"),roles:N.array().of(N.string()).min(1,"Role is required")}),ie=N.object({oldPassword:N.string().required("Current password is required"),newPassword:N.string().required("New password is required"),confirmedNewPassword:N.string().required("Confirm password is required")}),ce={currentPage:1,pageSize:100},de=(i,n)=>{const[o,w]=d.useState([]),[D,y]=d.useState(!1),[j,T]=d.useState(ce),[F,C]=d.useState(),g=J.useDispatch(),k=d.useCallback(async()=>{y(!0);try{const u=(await f.getRosterUsersApi(j)).data?.items||[];w(b(u))}catch{g(s.setAlert({type:"error",message:"Cannot get roster users"}))}y(!1)},[JSON.stringify(j)]),v=d.useCallback(async()=>{if(!n)return;const h=o.find(u=>u.value===n);if(h){C(h);return}y(!0);try{const p=(await f.getRosterUserBySourcedIdApi(n)).data;C({label:I(p),value:p.sourcedId})}catch(u){console.log("err:",u)}y(!1)},[n]),b=h=>h.map(u=>({label:I(u),value:u.sourcedId})),I=h=>{const u=[],{givenName:p,middleName:O,familyName:U,email:P,role:_}=h,R=[];return p&&R.push(p),O&&R.push(O),U&&R.push(U),R.length&&u.push(R.join(" ")),P&&u.push(P),`${u.join(" - ")}${_?` (${_})`:""}`},B=h=>{T(u=>({...u,searchString:h}))},A=d.useCallback(h=>{T({...j,...h})},[JSON.stringify(j)]);return d.useEffect(()=>{j.roles?.length&&k()},[JSON.stringify(j)]),d.useEffect(()=>{A({roles:i})},[JSON.stringify(i)]),d.useEffect(()=>{v()},[n]),{users:o,isLoading:D,user:F,handleInputChange:B}},ue=({value:i,roles:n,onChange:o})=>{const{users:w,isLoading:D,user:y,handleInputChange:j}=de(n,i);return e.jsx(s.CustomSelector,{options:w,value:y,placeholder:"Select user",onChange:o,isLoading:D,onInputChange:j})},me="create_user",he="edit_user",pe="change_password",ge=()=>{const{id:i}=Q.useParams(),n=J.useSelector(x=>x.common.user),{t:o}=ee.useTranslation(),{userDetail:w,backToList:D,confirmData:y,file:j,setFile:T,edited:F,setEdited:C,setEditedTrue:g,confirmChangePassword:k,forgotPasswordRequest:v,currentRoles:b,handleDisableRoles:I,handleResetPassword:B,teacherOptions:A,openModel:h,handleToggleModel:u,userHasData:p}=ne(i),O={oldPassword:"",newPassword:"",confirmedNewPassword:""},U=o(i?`${he}`:`${me}`),P=o(i?"update":"create"),_=()=>{var x=window.location.origin+"/api/ExportDataUser/"+i;window.open(x)},R=async x=>{var l={email:x};v(l)},M=()=>{if(!i)return;confirm("You want to reset this user's password")==!0&&B(i)};return e.jsx(W.Formik,{initialValues:w,enableReinitialize:!0,validationSchema:le,onSubmit:x=>{y({...x,roles:x.roles.map(l=>l!=s.ROLES.EDUTEACHER?l:"EduTeacher")}),C(!1),localStorage.getItem(window.location.href)&&localStorage.removeItem(window.location.href)},children:x=>{const{values:l,touched:a,errors:c,setFieldValue:m,handleChange:S,handleBlur:E,handleSubmit:G}=x,$=d.useCallback(r=>{if(l.roles.includes(r)){m("roles",l.roles.filter(L=>L!==r));return}if([s.ROLES.STUDENT,s.ROLES.PARENT].includes(r)){m("roles",[r]);return}if(l.roles.includes(s.ROLES.STUDENT)&&s.ROLES.STUDENT!=r){m("roles",[r]);return}m("roles",[...l.roles,r])},[l.roles]);return e.jsxs("div",{className:`animated fadeIn detail-buttons-padding ${s.screenWidth<=767?s.styles["p-0-12"]:""}`,children:[e.jsx(s.QuitPrompt,{when:F}),e.jsx("h5",{className:"mb-2",children:U}),e.jsxs(t.Row,{className:"pt-2",children:[e.jsxs(t.Col,{md:8,children:[e.jsxs(t.Row,{children:[e.jsx(t.Col,{md:6,children:e.jsxs(t.FormGroup,{children:[e.jsx(s.RequiredLabel,{text:o("first_name"),className:"text-capitalize"}),e.jsx(t.Input,{name:"firstName",value:l.firstName,onChange:r=>{S(r),g()},onBlur:E("subject"),placeholder:o("first_name"),className:s.styles["input-name"]}),a.firstName&&c.firstName&&e.jsx(s.ErrorHandler,{text:c.firstName})]})}),e.jsx(t.Col,{md:6,children:e.jsxs(t.FormGroup,{children:[e.jsx(t.Label,{children:o("date_of_birth")}),e.jsx("div",{children:e.jsx(Z,{value:l.dateOfBirth,todayButton:"Today",peekNextMonth:!0,showMonthDropdown:!0,showYearDropdown:!0,dropdownMode:"select",selected:l.dateOfBirth?f.toDate(new Date(l.dateOfBirth)):null,onChange:r=>{x.setFieldValue("dateOfBirth",K.format(r,s.DATE_FORMAT)),g()},placeholderText:o("date_of_birth"),customInput:e.jsx(t.Input,{type:"text",style:{width:"maxContent"},placeholder:o("date_of_birth")})})})]})})]}),e.jsxs(t.Row,{children:[e.jsx(t.Col,{md:6,children:e.jsxs(t.FormGroup,{children:[e.jsx(s.RequiredLabel,{text:o("last_name"),className:"text-capitalize"}),e.jsx(t.Input,{name:"lastName",value:l.lastName,onChange:r=>{S(r),g()},onBlur:E("lastName"),placeholder:o("last_name"),className:s.styles["input-name"]}),a.lastName&&c.lastName&&e.jsx(s.ErrorHandler,{text:c.lastName})]})}),e.jsx(t.Col,{md:6,children:e.jsxs(t.FormGroup,{children:[e.jsx(s.RequiredLabel,{text:o("roles")}),e.jsx(t.Row,{children:e.jsx(t.Col,{md:12,className:"d-flex flex-wrap align-items-center",children:s.USER_ROLES.map(r=>e.jsx("div",{className:"mr-3",children:e.jsx(t.Input,{type:"checkbox",id:`role-checkbox-${r}`,label:r==="SecondaryTeacher"?"SupportTeacher":`${r}`,checked:l.roles.includes(r),onChange:()=>{i&&(p.isHasTeacherData&&r==="Teacher"||p.isHasAssistantData&&r==="Assistant"||p.isHasCounselorData&&r==="Counselor"||p.isHasSecondaryTeacherData&&r==="SecondaryTeacher"||r=="Student"&&(p.isHasAssistantData||p.isHasCounselorData||p.isHasSecondaryTeacherData||p.isHasTeacherData))?alert("Please switch data before removing the role"):($(r),g())},disabled:b.includes("Parent")||b.includes("Student")&&i?b.concat(["Student","Parent"]).includes(r)||b.every(I):["Parent"].includes(r)})},r))})}),a.roles&&c.roles&&e.jsx(s.ErrorHandler,{text:c.roles})]})})]}),e.jsxs(t.Row,{children:[e.jsx(t.Col,{md:6,children:e.jsxs(t.FormGroup,{children:[e.jsx(s.RequiredLabel,{text:o("email")}),e.jsx(t.Input,{name:"email",value:l.email,onChange:r=>{S(r),g()},onBlur:E("email"),placeholder:o("email")}),a.email&&c.email&&e.jsx(s.ErrorHandler,{text:c.email})]})}),e.jsx(t.Col,{md:6,children:e.jsxs(t.FormGroup,{children:[e.jsx(s.RequiredLabel,{text:o("status")}),e.jsxs(t.Row,{children:[e.jsx(t.Col,{md:3,children:e.jsx(t.Input,{id:"role-checkbox-active",type:"radio",name:"active",label:o("active"),checked:!!l&&!!l.isActive,onChange:()=>{m("isActive",!0),g()}})}),e.jsx(t.Col,{md:3,children:e.jsx(t.Input,{id:"role-checkbox-inActive",type:"radio",name:"active",label:o("inactive"),checked:!!l&&!l.isActive,onChange:()=>m("isActive",!1)})})]})]})})]}),l.roles.includes(s.ROLES.STUDENT)&&e.jsx(t.Row,{children:e.jsx(t.Col,{md:6,children:e.jsxs(t.FormGroup,{children:[e.jsx(t.Label,{children:"Grade Level"}),e.jsx(s.CustomSelector,{options:f.gradeOptions,value:f.gradeOptions.find(r=>r.value==l.gradeLevel),placeholder:"Grade Level",onChange:r=>{m("gradeLevel",r.value)}})]})})}),!!i&&e.jsxs(t.Row,{children:[e.jsx(t.Col,{md:6,children:(!l.roles.includes("Admin")||l.roles.length>1)&&!!l.roles.length&&e.jsxs(t.FormGroup,{children:[e.jsx(t.Label,{children:"Map from Roster"}),e.jsx(ue,{roles:l.roles,value:l.sourcedId,onChange:r=>m("sourcedId",r.value)})]})}),e.jsxs(t.Col,{md:6,children:[e.jsx(t.Button,{color:"primary",className:"w-100",onClick:()=>{R(l.email||"")},children:o("send_forgot_password_link")}),e.jsx(t.Button,{color:"primary",className:"w-100 mt-3",onClick:()=>M(),children:o("reset_password")}),e.jsx(t.Button,{color:"success",className:"w-100 mt-3",onClick:()=>{_()},children:o("download_user_data")})]})]})]}),e.jsx(t.Col,{md:4,children:e.jsx(t.Row,{children:e.jsxs(t.Col,{md:8,children:[e.jsx(s.UploadFileButton,{setFile:T,fileName:l.profileImageFileName,onAddImage:g,canDelete:!0,onDelete:()=>{T(null),m("profileImageFileName",""),g()}}),!j&&!l.profileImageFileName&&e.jsx("img",{src:s.DEFAULT_IMAGE_URL,style:{maxWidth:"100%"}})]})})})]}),n.id===i?e.jsxs("div",{children:[e.jsx("h5",{className:"mt-3",children:o(`${pe}`)}),e.jsx(W.Formik,{initialValues:O,enableReinitialize:!0,validationSchema:ie,onSubmit:r=>{k(r)},children:r=>{const{values:L,touched:z,errors:q,handleChange:V,handleSubmit:X}=r;return e.jsxs(t.Row,{className:"pt-2 pb-5",children:[e.jsx(t.Col,{md:7,children:e.jsxs(t.FormGroup,{children:[e.jsx(s.RequiredLabel,{text:o("current_password"),className:"text-capitalize"}),e.jsx(t.Input,{name:"oldPassword",type:"password",value:L.oldPassword,onChange:H=>{V(H),g()},onBlur:E("subject"),placeholder:o("current_password"),className:s.styles["input-name"]}),z.oldPassword&&q.oldPassword&&e.jsx(s.ErrorHandler,{text:q.oldPassword})]})}),e.jsx(t.Col,{md:7,children:e.jsxs(t.FormGroup,{children:[e.jsx(s.RequiredLabel,{text:o("new_password"),className:"text-capitalize"}),e.jsx(t.Input,{name:"newPassword",type:"password",value:L.newPassword,onChange:H=>{V(H),g()},onBlur:E("subject"),placeholder:o("new_password"),className:s.styles["input-name"]}),z.newPassword&&q.newPassword&&e.jsx(s.ErrorHandler,{text:q.newPassword})]})}),e.jsx(t.Col,{md:7,children:e.jsxs(t.FormGroup,{children:[e.jsx(s.RequiredLabel,{text:o("confirm_password"),className:"text-capitalize"}),e.jsx(t.Input,{name:"confirmedNewPassword",type:"password",value:L.confirmedNewPassword,onChange:H=>{V(H),g()},onBlur:E("subject"),placeholder:o("confirm_password"),className:s.styles["input-name"]}),z.confirmedNewPassword&&q.confirmedNewPassword&&e.jsx(s.ErrorHandler,{text:q.confirmedNewPassword})]})}),e.jsx(t.Col,{md:12,children:e.jsx(t.Button,{color:"primary",size:"sm",className:"px-4 pl-1 mr-2 ml-3",onClick:()=>X(),children:o("save")})})]})}})]}):null,e.jsx(s.DetailActionButtons,{confirmText:P,onConfirm:l.roles.includes(s.ROLES.STUDENT)&&!i?u:G,onCancel:D}),e.jsxs(t.Modal,{centered:!0,isOpen:h,toggle:()=>u(),children:[e.jsx(t.ModalHeader,{children:"Assign Teacher"}),e.jsx(t.ModalBody,{children:e.jsx(te.TeacherSelector,{isMulti:!0,value:A.filter(r=>l.teacherUserId?.includes(r.value))||null,options:A,onChange:r=>m("teacherUserId",r.map(L=>L.value)),placeholder:o("select_teacher"),className:"flex-grow-1 mb-3"})}),e.jsxs(t.ModalFooter,{className:"text-right",children:[e.jsx(t.Button,{onClick:()=>u(),children:"Cancel"}),e.jsx(t.Button,{disabled:!l.teacherUserId,color:"primary",onClick:()=>{G()},children:"Assign"})]})]})]})}})};exports.default=ge;