Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64
Your IP : 18.189.194.225
(window.webpackJsonp=window.webpackJsonp||[]).push([[115],{1115:function(e,t,a){"use strict";a.r(t);var r=a(99),n=a(100),o=a(102),l=a(101),c=a(103),s=a(1),p=a.n(s),u=a(858),i=a(1005),d=a(264),m=a(262),h=a(1139),g=a(337),f=a(1135),E=a(1106),y=a(495),v=a(986),b=a(353),w=a(104),C=a(270),O=a(3),x=a(41),G=a.n(x),k=a(68),j=a(379),S=a.n(j),R=(a(380),a(645)),_=a(989),I=a(309),A=a(1098),T=a(1002),D=a(284),N=a.n(D),M=a(271),F=function(e){function t(){var e,a;Object(r.a)(this,t);for(var n=arguments.length,c=new Array(n),s=0;s<n;s++)c[s]=arguments[s];return(a=Object(o.a)(this,(e=Object(l.a)(t)).call.apply(e,[this].concat(c)))).state={grouphead:{},groupId:"",fmessage:"",attach:!1,fattchpath:"",fattchtype:"",freplyto:"",rows:1},a.getUploadParams=function(e){var t=e.file,r=(e.meta,new FormData);return r.append("filefield",t),r.append("body",JSON.stringify(a.props.user)),{url:M.a+"/upload-message-attachments.php ",body:r}},a.handleChangeStatus=function(e,t){var r=e.meta,n=e.file,o=e.xhr;"done"==t&&(console.log("STATUS",t,r,o.response,n),a.setState({fattchpath:o.response,fattchtype:n.type}))},a.handleSubmit=function(){var e=Object(k.a)(G.a.mark(function e(t,a){return G.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:console.log("SUBMIT",t.map(function(e){return e.meta})),a.forEach(function(e){return e.remove()});case 2:case"end":return e.stop()}},e)}));return function(t,a){return e.apply(this,arguments)}}(),a.showAttach=function(){a.setState({attach:!a.state.attach})},a.validatefile=function(e){e.file,e.meta;return!1},a.sendMessage=function(){console.log(a.state.fmessage);var e=a.state,t=e.fmessage,r=e.attach,n=e.fattchpath,o=e.fattchtype;""!=t.trim()&&(a.props.sendMsg({fmessage:t,attach:r,fattchpath:n,fattchtype:o,fgrpid:a.state.groupId,fmsgfrm:a.props.user.fuserid,fdate:N()().format("DD/MM/YYYY hh:mm A")}),a.setState({fmessage:"",attach:!1,fattchpath:"",fattchtype:""}))},a.handleChange=function(e,t){var r=t.name,n=t.value;a.setState(Object(O.a)({},r,n))},a.handleKeys=function(e){if("Enter"==e.key&&e.shiftKey)return a.setState({rows:2}),!0;"Enter"==e.key&&(a.sendMessage(),a.setState({fmessage:"",attach:!1,fattchpath:"",fattchtype:"",rows:1}),e.preventDefault()),console.log(e.key),console.log(e.charCode),"Backspace"===e.key&&console.log(e.target.value)},a.getAttach=function(e,t){var a,r=M.d+e.substring(0,4)+encodeURIComponent(e.substring(4));switch(t){case"image/png":case"image/jpeg":return p.a.createElement("a",{href:r,target:"_blank"},p.a.createElement("img",{src:r,style:(a={resizeMode:"contain",width:"300px"},Object(O.a)(a,"width","400px"),Object(O.a)(a,"padding","1em"),a)})," ");default:return p.a.createElement(f.a,{as:"h3",style:{margin:"1em"}},p.a.createElement(R.a,{name:"file"}),p.a.createElement(f.a.Content,null,p.a.createElement("a",{href:r,target:"_blank"},e.substring(24))))}},a}return Object(c.a)(t,e),Object(n.a)(t,[{key:"componentDidMount",value:function(){console.log(this.props.match.params.groupId),this.setState({groupId:this.props.match.params.groupId}),this.props.getMessagesForGroup(this.props.match.params.groupId)}},{key:"componentDidUpdate",value:function(e){this.props.match.params.groupId!==this.state.groupId&&(this.setState({groupId:this.props.match.params.groupId}),this.props.getMessagesForGroup(this.props.match.params.groupId))}},{key:"render",value:function(){var e=this,t=this.state.attach?"35.5vh":"56.5vh";return p.a.createElement("div",null,p.a.createElement(h.a,{className:"hide-scroll",fluid:!0,style:{padding:"1em",height:"".concat(Object(C.i)()+50,"px"),overflowY:"scroll"}},p.a.createElement(h.a.Header,{style:{position:"sticky"}},p.a.createElement(f.a,{as:"h2"},p.a.createElement(_.a,{style:{width:"2em",marginRight:"0.5em"},circular:!0,src:"../../../assets/img/group.png"}),p.a.createElement(u.a,{className:"not-a-anchor",to:{pathname:"/utils/message-board/members/".concat(this.state.groupId),query:{groupId:this.state.groupId}}},this.props.head.ftitle),this.props.head.fcreatedby==this.props.user.fuserid?p.a.createElement("div",{style:{float:"right",marginTop:"0.3em"}},p.a.createElement(u.a,{className:"not-a-anchor",to:{pathname:"/utils/message-board/add-members/".concat(this.state.groupId),query:{groupId:this.state.groupId}}},p.a.createElement(R.a,{link:!0,name:"add"})),p.a.createElement(u.a,{className:"not-a-anchor",to:{pathname:"/utils/message-board/edit/".concat(this.state.groupId),query:{groupId:this.state.groupId}}},p.a.createElement(R.a,{link:!0,name:"setting"}))):null)),p.a.createElement(h.a.Content,null,p.a.createElement("div",{className:"msg-content",style:{display:"flex",flexDirection:"column-reverse",height:t,overflowY:"scroll"}},this.props.msgs.map(function(t){var a,r=t.fmsgfrm==e.props.user.fuserid?"flex-end":"flex-start",n=t.fmsgfrm==e.props.user.fuserid?"green":"teal",o=e.props.users.filter(function(e){return e.fregno==t.fmsgfrm})[0],l=void 0!=o?o.fname:"";""!=t.fattchpath&&e.getAttach(t.fattchpath,t.fattchtype);return p.a.createElement("div",{key:t.fmsgid,style:{width:"100%",display:"flex",flexDirection:"column-reverse"}},p.a.createElement(I.a,{key:t.fmsgid,color:n,style:(a={alignSelf:r,maxWidth:"75%",display:"table",minWidth:"40%",margin:"0.75em"},Object(O.a)(a,"display","flex"),Object(O.a)(a,"flexDirection","column"),Object(O.a)(a,"whiteSpace","pre-wrap"),a)},p.a.createElement(I.a.Header,{style:{marginBottom:"0.5em"}},l),t.fmessage,""!=t.fattchpath?e.getAttach(t.fattchpath,t.fattchtype):null,p.a.createElement("span",{style:{position:"absolute",bottom:"0px",right:"2px",fontSize:"smaller"}},t.fdate)))}))),this.state.attach?p.a.createElement("div",{style:{display:"block"}},p.a.createElement(R.a,{name:"cancel",style:{position:"absolute",right:"3em",cursor:"pointer"},onClick:this.showAttach}),p.a.createElement(S.a,{getUploadParams:this.getUploadParams,onChangeStatus:this.handleChangeStatus,multiple:!1,validate:this.validatefile,maxFiles:1,styles:{dropzone:{height:"50%",width:"85%"}}})):null,this.props.head.fcreatedby!=this.props.user.fuserid&&"T"!=this.props.head.ftwoway?null:p.a.createElement(h.a.Content,{extra:!0,className:"send-message",style:{display:"flex",margin:"0 auto",alignItems:"center"}},p.a.createElement(E.a,{icon:"attach",onClick:this.showAttach,style:{height:"fit-content"}}),p.a.createElement(A.a,null,p.a.createElement(T.a,{rows:this.state.rows,id:"message-area",name:"fmessage",onChange:this.handleChange,value:this.state.fmessage,onKeyPress:this.handleKeys,placeholder:"Type Your Message here...",style:{width:"35em",resize:"none",marginRight:"0.2em"}})),p.a.createElement(E.a,{icon:"send",color:"blue",onClick:this.sendMessage,style:{height:"fit-content"}}))))}}]),t}(s.Component),H={getMessagesForGroup:b.f,sendMsg:b.i},U=Object(w.b)(function(e){return{groups:e.msgBoard.groups,head:e.msgBoard.head,msgs:e.msgBoard.msgs,users:e.msgBoard.users,user:e.user}},H)(F),L=a(1101),P=a(266),z=function(e){function t(){var e,a;Object(r.a)(this,t);for(var n=arguments.length,c=new Array(n),s=0;s<n;s++)c[s]=arguments[s];return(a=Object(o.a)(this,(e=Object(l.a)(t)).call.apply(e,[this].concat(c)))).state={new:!1,groupId:""},a}return Object(c.a)(t,e),Object(n.a)(t,[{key:"componentDidMount",value:function(){var e=Object(k.a)(G.a.mark(function e(){return G.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0==this.props.match.params.groupId){e.next=5;break}return e.next=3,this.props.getMessagesForGroup(this.props.match.params.groupId);case 3:return e.next=5,this.props.getUsersForGroup(this.props.match.params.groupId);case 5:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"componentWillUnmount",value:function(){this.props.emptyUsersforGroup()}},{key:"render",value:function(){var e=Object(C.i)();return p.a.createElement("div",{className:"animated fadeIn"},p.a.createElement(h.a,{fluid:!0},p.a.createElement(h.a.Content,{style:{height:"".concat(1.1*e,"px"),overflowY:"auto",padding:"1.3em"}},p.a.createElement(f.a,{as:"h3"},this.props.head.ftitle),p.a.createElement(L.a,{celled:!0,padded:!0,selectable:!0,size:"small",className:"tbl sticky1",unstackable:!0},p.a.createElement(L.a.Header,null,p.a.createElement(L.a.Row,{textAlign:"center"},p.a.createElement(L.a.HeaderCell,null,"Sl.No."),p.a.createElement(L.a.HeaderCell,null,"User Id"),p.a.createElement(L.a.HeaderCell,null,"Name"),p.a.createElement(L.a.HeaderCell,null,"Action"))),p.a.createElement(L.a.Body,null,this.props.members.map(function(e,t){return p.a.createElement(L.a.Row,{textAlign:"center",key:t},p.a.createElement(L.a.Cell,null,t+1),p.a.createElement(L.a.Cell,null,e.fregno),p.a.createElement(L.a.Cell,{textAlign:"left"},e.fname),p.a.createElement(L.a.Cell,null,"Action"))}))))))}}]),t}(s.Component),Y={showError:P.w,getUsersForGroup:b.g,emptyUsersforGroup:b.c,getMessagesForGroup:b.f},B=Object(w.b)(function(e){return{members:e.msgBoard.members,head:e.msgBoard.head}},Y)(z),q=a(998),W=a(273),K=a.n(W),J=function(e){function t(){var e,a;Object(r.a)(this,t);for(var n=arguments.length,c=new Array(n),s=0;s<n;s++)c[s]=arguments[s];return(a=Object(o.a)(this,(e=Object(l.a)(t)).call.apply(e,[this].concat(c)))).state={new:!1,groupId:""},a.handleChange=function(e,t){var r=t.name,n="";"text"==t.type&&(n=t.value),"checkbox"==t.type&&(n=t.checked?"T":"F"),a.props.changeGroupHead(r,n)},a.handleSave=function(){console.log("jhghasdas");var e=a.props.grp.head;if(""!==e.ftitle&&""!==e.fdescpn&&""!==e.fexpdate)a.props.handleSaveGroup();else{a.props.showError({header:"Error",content:"Fill All the values "})}},a}return Object(c.a)(t,e),Object(n.a)(t,[{key:"componentDidMount",value:function(){var e=Object(k.a)(G.a.mark(function e(){return G.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0==this.props.match.params.groupId){e.next=6;break}return e.next=3,this.props.getGroupHeadForEdit(this.props.match.params.groupId);case 3:this.props.changeGroupHead("mode","edit"),e.next=8;break;case 6:this.props.cancelGroupHead(),this.props.changeGroupHead("mode","add");case 8:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"componentWillUnmount",value:function(){this.props.cancelGroupHead()}},{key:"componentDidUpdate",value:function(e){this.props.match.params.groupId!==this.state.groupId&&(this.setState({groupId:this.props.match.params.groupId}),void 0==this.props.match.params.groupId&&(this.props.cancelGroupHead(),this.props.changeGroupHead("mode","add"),console.log(this.props.match.params.groupId)))}},{key:"render",value:function(){var e=this,t=this.props.grp.head,a=Object(C.i)();return p.a.createElement("div",{className:"animated fadeIn"},p.a.createElement(h.a,{fluid:!0},p.a.createElement(h.a.Content,{style:{height:"".concat(1.1*a,"px"),overflowY:"auto",padding:"1.3em"}},p.a.createElement(A.a,{onSubmit:this.handleSave},p.a.createElement(A.a.Group,null,p.a.createElement(A.a.Field,{width:12},p.a.createElement(A.a.Input,{type:"text",placeholder:"Group Title",label:"Group Title",name:"ftitle",value:t.ftitle,onChange:this.handleChange,required:!0}))),p.a.createElement(A.a.Group,null,p.a.createElement(A.a.Field,{width:12},p.a.createElement(A.a.TextArea,{label:"Description",rows:"3",name:"fdescpn",style:{resize:"none"},placeholder:"Describe about this group...",value:t.fdescpn,required:!0,onChange:function(t,a){return e.handleChange(t,{name:a.name,value:a.value,type:"text"})}}))),p.a.createElement(A.a.Group,null,p.a.createElement("div",{className:"four wide field"},p.a.createElement("div",{className:"field"},p.a.createElement("span",{style:{display:"block",margin:"0 0 .28571429rem 0",color:"rgba(0,0,0,.87)",fontSize:".92857143em",fontWeight:"700",textTransform:"none"}},"Expiry Date ",p.a.createElement("span",{style:{color:"red"}},"*")),p.a.createElement(K.a,{type:"text",formatChars:{n:"[0-1]",m:"[0-9]",e:"[0-3]",d:"[0-9]",z:"[1-2]",y:"[0-9]"},mask:"ed/nm/zyyy",name:"fexpdate",value:t.fexpdate,onChange:function(t){return e.handleChange(t,{name:t.target.name,value:t.target.value,type:t.target.type})},placeholder:"dd/mm/yyyy"})))),p.a.createElement(A.a.Group,null,p.a.createElement(A.a.Field,{width:12},p.a.createElement(q.a,{name:"ftwoway",checked:"T"==t.ftwoway,slider:!0,label:"Allow members to send messages",onChange:this.handleChange}))),p.a.createElement(A.a.Group,null,p.a.createElement(A.a.Field,{width:12},p.a.createElement(q.a,{slider:!0,name:"fexit",checked:"T"==t.fexit,label:"Allow Members to exit from the group",onChange:this.handleChange}))),p.a.createElement(A.a.Group,null,p.a.createElement(A.a.Field,{width:12},p.a.createElement(q.a,{name:"fsuspend",checked:"T"==t.fsuspend,slider:!0,label:"Suspend Group",onChange:this.handleChange}))),p.a.createElement(E.a,{type:"submit",primary:!0,onSubmit:this.handleSave},void 0==this.props.match.params.groupId?"Create":"Save")))))}}]),t}(s.Component),V={getMessageGroups:b.e,getGroupHeadForEdit:b.d,changeGroupHead:b.b,handleSaveGroup:b.h,cancelGroupHead:b.a,showError:P.w},Q=Object(w.b)(function(e){return{grp:e.grpEdit}},V)(J),X=a(644),Z=function(e){function t(){var e,a;Object(r.a)(this,t);for(var n=arguments.length,c=new Array(n),s=0;s<n;s++)c[s]=arguments[s];return(a=Object(o.a)(this,(e=Object(l.a)(t)).call.apply(e,[this].concat(c)))).state={new:!1},a}return Object(c.a)(t,e),Object(n.a)(t,[{key:"componentDidMount",value:function(){this.props.getMessageGroups()}},{key:"render",value:function(){var e=this.props.groups,t=Object(C.i)();return p.a.createElement("div",{className:"animated fadeIn"},p.a.createElement(v.BrowserView,null,p.a.createElement(h.a,{fluid:!0},p.a.createElement(h.a.Content,{style:{height:"".concat(1.17*t,"px"),overflowY:"auto",padding:"1.3em"}},this.state.new?null:p.a.createElement("div",{className:"row clearfix"},p.a.createElement("div",{className:"col-md-4",style:{paddingRight:"0px"}},p.a.createElement(g.a,{className:"hide-scroll",size:"small",position:"left",style:{overflowY:"scroll",height:"".concat(1.1*t,"px")}},p.a.createElement(f.a,{as:"h3",dividing:!0,color:"blue",style:{height:"2.2em"}},"Groups",900!=this.props.user.fcurtype?p.a.createElement(u.a,{style:{float:"right"},className:"not-a-anchor",to:{pathname:"/utils/message-board/add-group/"}},p.a.createElement(E.a,{icon:"add",label:"Create",primary:!0})):null),p.a.createElement(y.a.Group,{divided:!0},e.map(function(e,t){return p.a.createElement(y.a,{key:t},p.a.createElement(y.a.Image,{size:"tiny",style:{width:"4em",height:"4em"},src:"../../../assets/img/group.png",rounded:!0,bordered:!0}),p.a.createElement(y.a.Content,{verticalAlign:"middle"},p.a.createElement(y.a.Header,null,p.a.createElement(i.a,{to:{pathname:"/utils/message-board/".concat(e.fgrpid),query:{groupId:e.fgrpid}},className:"group-link"},e.ftitle))))})))),p.a.createElement("div",{className:"col-md-8"},p.a.createElement(d.a,null,p.a.createElement(m.a,{exact:!0,path:"/utils/message-board/add-group/",component:Q}),p.a.createElement(m.a,{exact:!0,path:"/utils/message-board/add-members/:groupId",component:X.default}),p.a.createElement(m.a,{exact:!0,path:"/utils/message-board/edit/:groupId",component:Q}),p.a.createElement(m.a,{exact:!0,path:"/utils/message-board/members/:groupId",component:B}),p.a.createElement(m.a,{path:"/utils/message-board/:groupId",component:U}),p.a.createElement(m.a,{path:"/utils/message-board"},p.a.createElement("h3",null,"Please select a group.")))))))),p.a.createElement(v.MobileView,null,this.state.new?null:p.a.createElement("div",{className:"row clearfix"},"/utils/message-board"==this.props.location.pathname||"/utils/message-board/"==this.props.location.pathname?p.a.createElement("div",{className:"col-sm-12",style:{paddingRight:"0px"}},p.a.createElement(g.a,{className:"hide-scroll",size:"small",position:"left",style:{overflowY:"scroll",height:"".concat(1.1*t,"px")}},p.a.createElement(f.a,{as:"h3",dividing:!0,color:"blue",style:{height:"2.2em"}},"Groups",900!=this.props.user.fcurtype?p.a.createElement(u.a,{style:{float:"right"},className:"not-a-anchor",to:{pathname:"/utils/message-board/add-group/"}},p.a.createElement(E.a,{icon:"add",label:"Create",primary:!0})):null),p.a.createElement(y.a.Group,{divided:!0},e.map(function(e,t){return p.a.createElement(y.a,{key:t},p.a.createElement(y.a.Image,{size:"tiny",style:{width:"4em",height:"4em"},src:"../../../assets/img/group.png",rounded:!0,bordered:!0}),p.a.createElement(y.a.Content,{verticalAlign:"middle"},p.a.createElement(y.a.Header,null,p.a.createElement(i.a,{to:{pathname:"/utils/message-board/".concat(e.fgrpid),query:{groupId:e.fgrpid}},className:"group-link"},e.ftitle))))})))):null,p.a.createElement("div",{className:"col-md-8"},p.a.createElement(d.a,null,p.a.createElement(m.a,{exact:!0,path:"/utils/message-board/add-group/",component:Q}),p.a.createElement(m.a,{exact:!0,path:"/utils/message-board/add-members/:groupId",component:X.default}),p.a.createElement(m.a,{exact:!0,path:"/utils/message-board/edit/:groupId",component:Q}),p.a.createElement(m.a,{path:"/utils/message-board/:groupId",component:U}),p.a.createElement(m.a,{path:"/utils/message-board/members/:groupId",component:B}),p.a.createElement(m.a,{path:"/utils/message-board"}))))))}}]),t}(s.Component),$={getMessageGroups:b.e};t.default=Object(w.b)(function(e){return{groups:e.msgBoard.groups,user:e.user}},$)(Z)},353:function(e,t,a){"use strict";a.d(t,"e",function(){return p}),a.d(t,"f",function(){return u}),a.d(t,"g",function(){return i}),a.d(t,"i",function(){return d}),a.d(t,"b",function(){return m}),a.d(t,"a",function(){return h}),a.d(t,"c",function(){return g}),a.d(t,"h",function(){return f}),a.d(t,"d",function(){return E});var r=a(41),n=a.n(r),o=a(68),l=a(269),c=a(266),s=a(290),p=function(e){return function(){var e=Object(o.a)(n.a.mark(function e(t,a){var r,o,s,p;return n.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=a(),e.next=3,l.a.get("/app.php",{params:{a:"getMessageGroups",univcode:r.univ.funivcode,user:r.user}});case 3:"object"!==typeof(o=e.sent).data?(s={header:"Error",content:"Something went wrong"},t(Object(c.w)(s))):0===o.data.error_code?t({type:"GET_MSG_GROUPS",payload:o.data}):(p={header:"Error",content:o.data.data.msg},t(Object(c.w)(p)));case 5:case"end":return e.stop()}},e)}));return function(t,a){return e.apply(this,arguments)}}()},u=function(e){return function(){var t=Object(o.a)(n.a.mark(function t(a,r){var o,s,p,u;return n.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return o=r(),t.next=3,l.a.get("/app.php",{params:{a:"getMessagesForGroup",univcode:o.univ.funivcode,groupid:e}});case 3:"object"!==typeof(s=t.sent).data?(p={header:"Error",content:"Something went wrong"},a(Object(c.w)(p))):0===s.data.error_code?a({type:"GET_MSGS_FOR_GROUP",payload:s.data}):(u={header:"Error",content:s.data.data.msg},a(Object(c.w)(u)));case 5:case"end":return t.stop()}},t)}));return function(e,a){return t.apply(this,arguments)}}()},i=function(e){return function(){var t=Object(o.a)(n.a.mark(function t(a,r){var o,s,p,u;return n.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return o=r(),a({type:"SET_LOADER"}),t.next=4,l.a.get("/app.php",{params:{a:"getUsersForGroup",univcode:o.univ.funivcode,groupid:e}});case 4:s=t.sent,a({type:"UNSET_LOADER"}),"object"!==typeof s.data?(p={header:"Error",content:"Something went wrong"},a(Object(c.w)(p))):0===s.data.error_code?a({type:"GET_USERS_FOR_GROUP",payload:s.data}):(u={header:"Error",content:s.data.data.msg},a(Object(c.w)(u)));case 7:case"end":return t.stop()}},t)}));return function(e,a){return t.apply(this,arguments)}}()},d=function(e){return function(){var t=Object(o.a)(n.a.mark(function t(a,r){var o,s,p,u;return n.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return o=r(),t.next=3,l.a.post("/app.php?a=sendMessage&univcode="+o.univ.funivcode,{msg:e});case 3:"object"!==typeof(s=t.sent).data?(p={header:"Error",content:"Something went wrong"},a(Object(c.w)(p))):0===s.data.error_code?(console.log(e),a({type:"UPDATE_MESSAGE",payload:e})):(u={header:"Error",content:s.data.data.msg},a(Object(c.w)(u)));case 5:case"end":return t.stop()}},t)}));return function(e,a){return t.apply(this,arguments)}}()},m=function(e,t){return{type:"CHANGE_GROUP_HEAD",payload:{name:e,value:t}}},h=function(){return{type:"CANCEL_GROUP_HEAD"}},g=function(){return{type:"EMPTY_USERS_FOR_GROUP"}},f=function(){return function(){var e=Object(o.a)(n.a.mark(function e(t,a){var r,o,u,i,d;return n.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=a(),e.next=3,l.a.post("/app.php?a=handleSaveGroup&univcode="+r.univ.funivcode,{group:r.grpEdit.head,user:r.user});case 3:"object"!==typeof(o=e.sent).data?(u={header:"Error",content:"Something went wrong"},t(Object(c.w)(u))):0===o.data.error_code?(i={header:"Success",content:o.data.data.msg},t(Object(c.w)(i)),t(h()),s.k.push("/utils/message-board/add-members/"+o.data.data.fgrpid),t(p("sometype"))):(d={header:"Error",content:o.data.data.msg},t(Object(c.w)(d)));case 5:case"end":return e.stop()}},e)}));return function(t,a){return e.apply(this,arguments)}}()},E=function(e){return function(){var t=Object(o.a)(n.a.mark(function t(a,r){var o,s,p,u;return n.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return o=r(),t.next=3,l.a.get("/app.php",{params:{a:"getGroupHeadForEdit",univcode:o.univ.funivcode,groupid:e}});case 3:"object"!==typeof(s=t.sent).data?(p={header:"Error",content:"Something went wrong"},a(Object(c.w)(p))):0===s.data.error_code?a({type:"GET_GROUP_HEAD",payload:s.data}):(u={header:"Error",content:s.data.data.msg},a(Object(c.w)(u)));case 5:case"end":return t.stop()}},t)}));return function(e,a){return t.apply(this,arguments)}}()}},644:function(e,t,a){"use strict";a.r(t);var r=a(41),n=a.n(r),o=a(68),l=a(0),c=a(99),s=a(100),p=a(102),u=a(101),i=a(103),d=a(1),m=a.n(d),h=(a(294),a(1139)),g=a(1106),f=a(1098),E=a(1100),y=a(309),v=a(272),b=a(1101),w=a(104),C=a(266),O=a(269),x=a(290),G=a(353),k=a(270),j=function(e){function t(){var e,a;Object(c.a)(this,t);for(var r=arguments.length,s=new Array(r),i=0;i<r;i++)s[i]=arguments[i];return(a=Object(p.a)(this,(e=Object(u.a)(t)).call.apply(e,[this].concat(s)))).state={frmsubmit:!1},a.handleChange=function(e,t){console.log("check box : ",t.value),a.props.changeGrpCreation(t.name,t.value),"fdeggrp"===t.name&&""!=t.value&&(a.props.getDegree(t.name,t.value),a.props.changeGrpCreation("fdegree",""),a.props.changeGrpCreation("fcollcode","")),"fdegree"===t.name&&""!=t.value&&a.props.getCollGrp(t.name,t.value),"flevel"!==t.name||"Teacher"!=t.value&&"Principal"!=t.value||(console.log("get all colleges for teachers"),a.props.getCollTeachers())},a.handleCheckbox=function(e,t,r){var n=Object(l.a)({},t,{checked:e.target.checked?"T":"F"});a.props.changeGrpData(n,t.fcode)},a.submitFrom=Object(o.a)(n.a.mark(function e(){return n.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.props.submitFromData();case 2:a.setState({frmsubmit:!0});case 3:case"end":return e.stop()}},e)})),a.addMembers=Object(o.a)(n.a.mark(function e(){return n.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.props.addMembersToGroup(a.props.match.params.groupId);case 2:case"end":return e.stop()}},e)})),a}return Object(i.a)(t,e),Object(s.a)(t,[{key:"componentDidMount",value:function(){var e=Object(o.a)(n.a.mark(function e(){return n.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.props.getLevel();case 2:return e.next=4,this.props.getGroupHeadForEdit(this.props.match.params.groupId);case 4:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"componentWillUnmount",value:function(){this.props.cancelGrpCreate()}},{key:"componentWillUnmount",value:function(){this.props.cancelGroup()}},{key:"render",value:function(){var e=this,t=this.props.grpCreation,a=t.level,r=t.flevel,n=t.fdeggrp,o=t.college,l=t.degree,c=t.fcollcode,s=t.fdegree,p=t.fgrptype;console.log("this.props.grpCreation",this.props.grpCreation);var u=this.props.tabledata,i=Object(k.i)(),d=this.props.deggrp;return m.a.createElement("div",null,m.a.createElement(h.a,{fluid:!0},m.a.createElement(h.a.Content,null,m.a.createElement(h.a.Header,{style:{display:"flex"}},m.a.createElement("h4",null,"Add Members to ",m.a.createElement("b",null,this.props.grp.head.ftitle)),m.a.createElement("div",{className:"ml-auto"},m.a.createElement(g.a,{basic:!0,color:"blue",content:"Save",onClick:this.addMembers,icon:"add"}))),m.a.createElement(h.a.Description,{style:{overflowY:"auto",height:"".concat(i-12,"px"),padding:"1.3em"}},m.a.createElement(f.a,null,m.a.createElement("div",null,m.a.createElement("div",null,m.a.createElement(f.a.Group,null,m.a.createElement(f.a.Field,{width:16},m.a.createElement("label",null,"Type of Members"),m.a.createElement(E.a,{placeholder:"Select Level",search:!0,selection:!0,name:"flevel",value:r,options:a.map(function(e,t){return{key:t,value:e.FLELNAME,text:e.FLELNAME}}),onChange:this.handleChange}))),"Student"==r?m.a.createElement(f.a.Group,null,m.a.createElement(f.a.Field,{width:16},m.a.createElement("label",null,"Degree Group"),m.a.createElement(E.a,{placeholder:"Select Degree Group",search:!0,selection:!0,name:"fdeggrp",value:n,options:d.map(function(e,t){return{key:t,value:e.fdeggrp,text:"".concat(e.fdeggrp," - ").concat(e.fdescpn)}}),onChange:this.handleChange}))):null,"Student"==r?m.a.createElement(f.a.Group,null,m.a.createElement(f.a.Field,{width:16},m.a.createElement("label",null,"Select Degree"),m.a.createElement(E.a,{placeholder:"Select Degree Range",search:!0,selection:!0,name:"fdegree",value:s,options:l.map(function(e,t){return{key:t,value:e.fdegree,text:"".concat(e.fdegree," - ").concat(e.fdescpn)}}),onChange:this.handleChange}))):null,"600"==this.props.user.fcurtype||"500"==this.props.user.fcurtype?null:m.a.createElement(f.a.Group,null,m.a.createElement(f.a.Field,{width:16},m.a.createElement("label",null,"Select College"),m.a.createElement(E.a,{placeholder:"Select College Range",search:!0,selection:!0,name:"fcollcode",value:c,options:o.map(function(e,t){return{key:t,value:e.fcollcode,text:"".concat(e.fcollcode," - ").concat(e.college_name)}}),onChange:this.handleChange}))),m.a.createElement(f.a.Group,{inline:!0},m.a.createElement("label",null,"Type Group"),m.a.createElement(f.a.Radio,{label:"All",value:"A",name:"fgrptype",checked:"A"==p,onChange:this.handleChange}),"All"!=c&&"All"!=s||"Student"!=r?m.a.createElement(f.a.Radio,{label:"Custom",value:"C",name:"fgrptype",checked:"C"==p,onChange:this.handleChange}):null),m.a.createElement(y.a,{color:"blue"},m.a.createElement(y.a.List,null,m.a.createElement(y.a.Item,null,"All - All the members who belong to above selected criterion will be added to the group."),m.a.createElement(y.a.Item,null,"Custom - Select the members individually to add to the group."))),"C"==p?m.a.createElement("button",{class:"ui primary button",onClick:this.submitFrom},"Submit"):null),this.state.frmsubmit?m.a.createElement("div",null,m.a.createElement(v.a,null),m.a.createElement(b.a,{celled:!0,padded:!0,selectable:!0,size:"small",color:"olive",className:"tbl sticky1",unstackable:!0},m.a.createElement(b.a.Header,null,m.a.createElement(b.a.Row,{textAlign:"center"},m.a.createElement(b.a.HeaderCell,null,"Sl.No."),m.a.createElement(b.a.HeaderCell,null,"Code"),m.a.createElement(b.a.HeaderCell,null,"College Code"),m.a.createElement(b.a.HeaderCell,null,"Name"),m.a.createElement(b.a.HeaderCell,null,"Select"))),m.a.createElement(b.a.Body,null,u.map(function(t,a){return m.a.createElement(b.a.Row,{key:a,style:{overflow:"hidden"}},m.a.createElement(b.a.Cell,{textAlign:"center"},a+1),m.a.createElement(b.a.Cell,null,t.fcode),m.a.createElement(b.a.Cell,null,t.fcollcode),m.a.createElement(b.a.Cell,null,t.fname),m.a.createElement(b.a.Cell,null,m.a.createElement("div",{className:"ui checkbox"},m.a.createElement("input",{type:"checkbox",name:t.fcode,value:"true",onChange:function(r){return e.handleCheckbox(r,t,a)},checked:"T"==t.checked}),m.a.createElement("label",null," "))))})))):null))))))}}]),t}(d.Component);t.default=Object(w.b)(function(e){return{grpCreation:e.grpCreation,deggrp:e.deggrp,tabledata:e.grpData,grp:e.grpEdit,user:e.user}},{showError:C.w,changeGrpCreation:function(e,t){return{type:"CHANGE_GRPCRE",payload:{name:e,value:t}}},getLevel:function(e){return function(){var t=Object(o.a)(n.a.mark(function t(a,r){var o,l;return n.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return o=r(),t.next=3,O.a.post("app.php?a=getLevel&univcode="+o.univ.funivcode+"&fcurtype="+o.user.fcurtype,{data:e});case 3:"object"!==typeof(l=t.sent).data?a({type:"SET_ERROR",payload:{error_code:-1,data:{msg:"Something went wrong"},status:"failure"}}):0===l.data.error_code?a({type:"getLevel",payload:l.data}):a({type:"SET_ERROR",payload:l});case 5:case"end":return t.stop()}},t)}));return function(e,a){return t.apply(this,arguments)}}()},getDegree:function(e,t){return function(){var e=Object(o.a)(n.a.mark(function e(a,r){var o,l;return n.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=r(),e.next=3,O.a.get("app.php?a=getDegreeGrps&univcode="+o.univ.funivcode+"°grp="+t+"&flevel="+o.grpCreation.flevel+"&fcurtype="+o.user.fcurtype+"&fuserid="+o.user.fuserid+"&fcollcode="+o.user.fcollcode);case 3:"object"!==typeof(l=e.sent).data?a({type:"SET_ERROR",payload:{error_code:-1,data:{msg:"Something went wrong"},status:"failure"}}):0===l.data.error_code?a({type:"GRP_GET_DEGREES",payload:l.data}):a({type:"SET_ERROR",payload:l});case 5:case"end":return e.stop()}},e)}));return function(t,a){return e.apply(this,arguments)}}()},getCollGrp:function(e,t){return function(){var e=Object(o.a)(n.a.mark(function e(a,r){var o,l;return n.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=r(),e.next=3,O.a.post("app.php?a=getDegGrpColl&univcode="+o.univ.funivcode+"°grp="+t,{fdegree:o.grpCreation.fdegree}).catch(function(e){console.log(e);var t={header:"Error",content:e.message};return a(Object(C.w)(t)),!0});case 3:"object"!==typeof(l=e.sent).data?a({type:"SET_ERROR",payload:{error_code:-1,data:{msg:"Something went wrong"},status:"failure"}}):0===l.data.error_code?a({type:"GRP_GET_COLLEGES",payload:l.data}):a({type:"SET_ERROR",payload:l});case 5:case"end":return e.stop()}},e)}));return function(t,a){return e.apply(this,arguments)}}()},submitFromData:function(){return function(){var e=Object(o.a)(n.a.mark(function e(t,a){var r,o,l;return n.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=a(),console.log(r.grpCreation),t({type:"SET_LOADER"}),o="500"==r.user.fcurtype||"600"==r.user.fcurtype?r.user.fcollcode:r.grpCreation.fcollcode,e.next=6,O.a.post("app.php?a=submitFromData&univcode="+r.univ.funivcode,{fdegree:r.grpCreation.fdegree,fcollcode:o,flevel:r.grpCreation.flevel,fgrptype:r.grpCreation.fgrptype,fdeggrp:r.grpCreation.fdeggrp}).catch(function(e){console.log(e)});case 6:l=e.sent,t({type:"UNSET_LOADER"}),"object"!==typeof l.data?t({type:"SET_ERROR",payload:{error_code:-1,data:{msg:"Something went wrong"},status:"failure"}}):0===l.data.error_code?t({type:"GRP_GET_FORMDATA",payload:l.data}):t({type:"SET_ERROR",payload:l});case 9:case"end":return e.stop()}},e)}));return function(t,a){return e.apply(this,arguments)}}()},changeGrpData:function(e,t){return{type:"CHANGE_GRPDATA",payload:{newel:e,fregno:t}}},cancelGroup:function(){return{type:"CANCEL_GRPCRE"}},getGroupHeadForEdit:G.d,addMembersToGroup:function(e){return function(){var t=Object(o.a)(n.a.mark(function t(a,r){var o,l,c,s,p;return n.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return o=r(),l="500"==o.user.fcurtype||"600"==o.user.fcurtype?o.user.fcollcode:o.grpCreation.fcollcode,a({type:"SET_LOADER"}),t.next=5,O.a.post("app.php?a=addMembersToGroup&univcode="+o.univ.funivcode,{fdegree:o.grpCreation.fdegree,fcollcode:l,flevel:o.grpCreation.flevel,fgrptype:o.grpCreation.fgrptype,fdeggrp:o.grpCreation.fdeggrp,groupId:e,members:o.grpData});case 5:c=t.sent,a({type:"UNSET_LOADER"}),"object"!==typeof c.data?a({type:"SET_ERROR",payload:{error_code:-1,data:{msg:"Something went wrong"},status:"failure"}}):0===c.data.error_code?(s={header:"Success",content:c.data.data.msg},a(Object(C.w)(s)),a({type:"CANCEL_GRPCRE"}),x.k.push("/utils/message-board/"+e)):(p={header:"Error",content:c.data.data.msg},a(Object(C.w)(p)));case 8:case"end":return t.stop()}},t)}));return function(e,a){return t.apply(this,arguments)}}()},getCollTeachers:function(){return function(){var e=Object(o.a)(n.a.mark(function e(t,a){var r,o;return n.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:r=a(),o=r.activeCollege.map(function(e){return{fcollcode:e.fcollcode,college_name:"".concat(e.fcollname,", ").concat(e.town)}}),t({type:"GRP_GET_COLLEGES",payload:{data:o}});case 4:case"end":return e.stop()}},e)}));return function(t,a){return e.apply(this,arguments)}}()},cancelGrpCreate:function(){return{type:"CANCEL_GRPCRE"}}})(j)}}]);
//# sourceMappingURL=115.06c374ad.chunk.js.map
|