mario-core 2.0.107-release → 2.0.108-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/Dashboard-BoYmBZNH.js +1 -0
- package/dist/Dashboard-BohWITqY.mjs +206 -0
- package/dist/Dashboard-CNeLkxKn.mjs +206 -0
- package/dist/Dashboard-CdE8azYL.mjs +206 -0
- package/dist/Dashboard-J2_aB4nr.js +1 -0
- package/dist/Dashboard-UaTWEdw7.js +1 -0
- package/dist/EmailTemplateDetail-BUXh0rmo.mjs +443 -0
- package/dist/EmailTemplateDetail-BVvZIx3m.js +1 -0
- package/dist/EmailTemplateDetail-B__EDhB8.mjs +443 -0
- package/dist/EmailTemplateDetail-CCjCTnSu.js +1 -0
- package/dist/EmailTemplateDetail-CxZ-vu_-.js +1 -0
- package/dist/EmailTemplateDetail-Qhx-osUA.mjs +443 -0
- package/dist/EmailTemplateList-B8f6wVB3.js +1 -0
- package/dist/EmailTemplateList-CUCMBqBJ.js +1 -0
- package/dist/EmailTemplateList-CzfA-3kQ.mjs +170 -0
- package/dist/EmailTemplateList-DBKq5mG7.mjs +170 -0
- package/dist/EmailTemplateList-DEmHB3bi.mjs +170 -0
- package/dist/EmailTemplateList-uuxfqcEO.js +1 -0
- package/dist/GalleryList-Bgwjxzce.js +1 -0
- package/dist/GalleryList-Bi89gGR2.mjs +329 -0
- package/dist/GalleryList-Dlc2e9PL.mjs +329 -0
- package/dist/GalleryList-DnhQAwOw.js +1 -0
- package/dist/GalleryList-P4_Es_iv.mjs +329 -0
- package/dist/GalleryList-w-ECfc3W.js +1 -0
- package/dist/Login-BNjTZptP.js +1 -0
- package/dist/Login-BtTGTO_G.js +1 -0
- package/dist/Login-CPYV_-gQ.mjs +1697 -0
- package/dist/Login-CSmQdSBL.js +1 -0
- package/dist/Login-CbC6Q-Yk.mjs +1697 -0
- package/dist/Login-Dx5u6cvm.mjs +1697 -0
- package/dist/NotificationList-BChmo09j.js +2 -0
- package/dist/NotificationList-BOytZRAN.mjs +3982 -0
- package/dist/NotificationList-BafFtIAD.js +2 -0
- package/dist/NotificationList-Bvy5c_o1.mjs +3982 -0
- package/dist/NotificationList-CubwqBsm.mjs +3982 -0
- package/dist/NotificationList-KmXVzoAr.js +2 -0
- package/dist/SkillList-CFZ22qQ9.mjs +386 -0
- package/dist/SkillList-C_1JfxfB.js +1 -0
- package/dist/SkillList-DKcDkv94.js +1 -0
- package/dist/SkillList-DmC__72S.mjs +386 -0
- package/dist/SkillList-IVVDVSZy.js +1 -0
- package/dist/SkillList-jK0IHAIH.mjs +386 -0
- package/dist/TeacherSelector-BpES1FKj.js +1 -0
- package/dist/TeacherSelector-BuhI-rGs.mjs +30 -0
- package/dist/TeacherSelector-De6mBvx2.mjs +30 -0
- package/dist/TeacherSelector-HTemy-Ez.js +1 -0
- package/dist/TeacherSelector-fEPchTjh.js +1 -0
- package/dist/TeacherSelector-lR6Ch-At.mjs +30 -0
- package/dist/TheContent-BHBSuj40.mjs +38 -0
- package/dist/TheContent-C-xV_3xT.js +1 -0
- package/dist/TheContent-DEgi129y.js +1 -0
- package/dist/TheContent-Di5D7Gbr.mjs +38 -0
- package/dist/TheContent-GAKUlCji.mjs +38 -0
- package/dist/TheContent-ZKcVU5qk.js +1 -0
- package/dist/UserContainer--xRA0JQU.js +5 -0
- package/dist/UserContainer-B6yMu-I3.js +5 -0
- package/dist/UserContainer-CkZ53kH4.mjs +2902 -0
- package/dist/UserContainer-D3Xz2HUW.mjs +2902 -0
- package/dist/UserContainer-DSQ-U3F0.js +5 -0
- package/dist/UserContainer-Dyn6ibh1.mjs +2902 -0
- package/dist/UserDetail-7FH_HSWR.mjs +903 -0
- package/dist/UserDetail-BKnlgUEz.js +1 -0
- package/dist/UserDetail-DBpzl5fo.mjs +903 -0
- package/dist/UserDetail-DQOnt-wM.js +1 -0
- package/dist/UserDetail-fUJTkzDg.mjs +903 -0
- package/dist/UserDetail-oF6NNexq.js +1 -0
- package/dist/UserList-B50qyfjL.mjs +1261 -0
- package/dist/UserList-C2Aaq5z8.js +7 -0
- package/dist/UserList-Cenxl6uR.mjs +1261 -0
- package/dist/UserList-DhIaXh_s.mjs +1261 -0
- package/dist/UserList-EX5eXQba.js +7 -0
- package/dist/UserList-EcYGduyj.js +7 -0
- package/dist/constants--_acGsaz.js +1 -0
- package/dist/constants-B9hWa6_R.mjs +286 -0
- package/dist/constants-BjESNXd6.mjs +286 -0
- package/dist/constants-C5BtfcR2.js +1 -0
- package/dist/constants-C5WkZZdL.mjs +286 -0
- package/dist/constants-DsRvQ2-W.js +1 -0
- package/dist/index-BGTGhZlt.js +15 -0
- package/dist/index-CO_pMkbk.mjs +19148 -0
- package/dist/index-CVKal53K.mjs +19158 -0
- package/dist/index-D0HO9-Jy.js +15 -0
- package/dist/index-DaEyv-Te.mjs +19158 -0
- package/dist/index-txMWO23Z.js +15 -0
- package/dist/index.js +1 -1
- package/dist/index.modern.js +1 -1
- package/dist/mailCategoryService-B2QTjf12.js +1 -0
- package/dist/mailCategoryService-BFfwPcnM.mjs +11 -0
- package/dist/mailCategoryService-Bnr7gh_G.js +1 -0
- package/dist/mailCategoryService-D00fI25v.js +1 -0
- package/dist/mailCategoryService-DprdWJcz.mjs +11 -0
- package/dist/mailCategoryService-RFcp_8SH.mjs +11 -0
- package/dist/userService-B50oEL_l.mjs +56 -0
- package/dist/userService-B_lNnb--.js +1 -0
- package/dist/userService-C4d9YEpa.js +1 -0
- package/dist/userService-CiQiZh4G.mjs +56 -0
- package/dist/userService-DTLWpqzW.js +1 -0
- package/dist/userService-fA4Xahnz.mjs +56 -0
- 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"),K=require("react-router-dom"),t=require("reactstrap"),W=require("formik"),ee=require("react-datepicker"),X=require("date-fns"),w=require("./userService-B_lNnb--.js"),J=require("react-redux"),se=require("react-i18next"),s=require("./index-BGTGhZlt.js"),te=require("yup"),ae=require("./TeacherSelector-fEPchTjh.js"),Y=require("./constants-C5BtfcR2.js");function re(i){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const o in i)if(o!=="default"){const x=Object.getOwnPropertyDescriptor(i,o);Object.defineProperty(n,o,x.get?x:{enumerable:!0,get:()=>i[o]})}}return n.default=i,Object.freeze(n)}const N=re(te),oe={id:"",firstName:"",lastName:"",email:"",dateOfBirth:"",roles:[],isActive:!0,profileImageFileName:"",teacherUserId:[]},Q="/admin/users/user-list",ne="User detail",le=i=>{const n=J.useDispatch(),o=K.useNavigate(),[x,D]=d.useState(oe),[y,j]=d.useState(!1),[T,F]=d.useState([]),[S,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=ne,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 w.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 w.getById(i);D({...a.data,dateOfBirth:X.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 w.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"?Q+`?query=${a}`:Q)},[]),_=d.useCallback(async a=>{n(s.setLoading(!0));try{if(S){const C=new FormData,{name:E}=S;C.append("file",S,E);const $=(await s.systemProfileUpload(C))?.data?.key;a.profileImageFileName=$}const c=i?w.update:w.create;!i&&delete a.id,a.dateOfBirth===""&&delete a.dateOfBirth;const m=await c(a);m&&w.getById(m.data.id).then(C=>{P(C.data.fullName)}),i||alert("Password of "+m.data.email+` is "${m.data.password}"`),m.data.id&&await w.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,S]),R=a=>["Student","Parent","EduTeacher"].includes(a),M=async a=>{n(s.setLoading(!0));try{await w.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))},f=d.useCallback(async a=>{n(s.setLoading(!0));try{await w.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 w.resetPasswordForAdmin(c);if(m.data){const C=`${x.firstName} ${x.lastName}`;alert(`Password of ${C} 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))},[x]);return{userDetail:x,backToList:P,confirmData:_,file:S,setFile:g,edited:k,setEdited:v,setEditedTrue:B,confirmChangePassword:M,forgotPasswordRequest:f,currentRoles:A,handleDisableRoles:R,handleResetPassword:l,teacherOptions:T,openModel:y,handleToggleModel:u,userHasData:b}},ie=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")}),ce=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")}),de={currentPage:1,pageSize:100},ue=(i,n)=>{const[o,x]=d.useState([]),[D,y]=d.useState(!1),[j,T]=d.useState(de),[F,S]=d.useState(),g=J.useDispatch(),k=d.useCallback(async()=>{y(!0);try{const u=(await w.getRosterUsersApi(j)).data?.items||[];x(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){S(h);return}y(!0);try{const p=(await w.getRosterUserBySourcedIdApi(n)).data;S({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}},me=({value:i,roles:n,onChange:o})=>{const{users:x,isLoading:D,user:y,handleInputChange:j}=ue(n,i);return e.jsx(s.CustomSelector,{options:x,value:y,placeholder:"Select user",onChange:o,isLoading:D,onInputChange:j})},he="create_user",pe="edit_user",ge="change_password",fe=()=>{const{id:i}=K.useParams(),n=J.useSelector(f=>f.common.user),{t:o}=se.useTranslation(),{userDetail:x,backToList:D,confirmData:y,file:j,setFile:T,edited:F,setEdited:S,setEditedTrue:g,confirmChangePassword:k,forgotPasswordRequest:v,currentRoles:b,handleDisableRoles:I,handleResetPassword:B,teacherOptions:A,openModel:h,handleToggleModel:u,userHasData:p}=le(i),O={oldPassword:"",newPassword:"",confirmedNewPassword:""},U=o(i?`${pe}`:`${he}`),P=o(i?"update":"create"),_=()=>{var f=window.location.origin+"/api/ExportDataUser/"+i;window.open(f)},R=async f=>{var l={email:f};v(l)},M=()=>{if(!i)return;confirm("You want to reset this user's password")==!0&&B(i)};return e.jsx(W.Formik,{initialValues:x,enableReinitialize:!0,validationSchema:ie,onSubmit:f=>{y({...f,roles:f.roles.map(l=>l!=s.ROLES.EDUTEACHER?l:"EduTeacher")}),S(!1),localStorage.getItem(window.location.href)&&localStorage.removeItem(window.location.href)},children:f=>{const{values:l,touched:a,errors:c,setFieldValue:m,handleChange:C,handleBlur:E,handleSubmit:G}=f,$=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=>{C(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(ee,{value:l.dateOfBirth,todayButton:"Today",peekNextMonth:!0,showMonthDropdown:!0,showYearDropdown:!0,dropdownMode:"select",selected:l.dateOfBirth?w.toDate(new Date(l.dateOfBirth)):null,onChange:r=>{f.setFieldValue("dateOfBirth",X.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=>{C(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=>{C(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:Y.gradeOptions,value:Y.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(me,{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(`${ge}`)}),e.jsx(W.Formik,{initialValues:O,enableReinitialize:!0,validationSchema:ce,onSubmit:r=>{k(r)},children:r=>{const{values:L,touched:z,errors:q,handleChange:V,handleSubmit:Z}=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:()=>Z(),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(ae.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=fe;
|