"use strict";(self.webpackChunkmy_app=self.webpackChunkmy_app||[]).push([[230],{7230:function(e,n,t){t.r(n);var l=t(1413),a=t(74165),r=t(15861),o=t(29439),i=t(72791),s=t(24340),u=t(92438),d=t(27391),c=t(64554),p=t(71672),v=t(61134),m=t(75985),f=t(91432),g=t(75032),h=t(80184),_=(0,p.Pi)((function(e){var n=e.rows,t=(e.jobService,e.control),p=e.setValue,_=e.trigger,b=e.jobIndex,x=e.developers,Z=(0,i.useState)([]),S=(0,o.Z)(Z,2),j=S[0],w=S[1],C={assign_designer:null,assign_design_pc:null},k=(0,i.useState)(C),y=(0,o.Z)(k,2),I=y[0],O=y[1],D={width:"300px"},T=function(){var e=(0,r.Z)((0,a.Z)().mark((function e(n,t,l){return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:try{O({type:t}),j.length>0?(j.forEach((function(e,n){var a="jobs.".concat(b,".templates.").concat(parseInt(e.template_id.slice(-3),10)-1,".").concat(l);if("assign_developer"===l)e.template_status_id<=4&&(p(a,t),_(a))})),m.Am.info("".concat(j.length," records selected!"),f.Z)):(m.Am.warn("Please select at least one template..!",f.Z),O(C))}catch(n){}case 1:case"end":return e.stop()}}),e)})));return function(n,t,l){return e.apply(this,arguments)}}(),P=[{headerCheckboxSelection:!0,checkboxSelection:!0,headerCheckboxSelectionFilteredOnly:!0,headerCheckboxSelectionCurrentPageOnly:!0,width:100},{headerName:"Templates",field:"order_template_id"},{headerName:"Developer",width:300,headerComponent:function(e){return(0,h.jsx)(v.Qr,{name:"assign_developer".concat(b),control:t,render:function(e){var n=e.field,t=e.fieldState;return(0,h.jsx)(u.Z,(0,l.Z)((0,l.Z)({},n),{},{sx:D,id:"assign_developer".concat(b),options:x,isOptionEqualToValue:function(e,n){return e.label===n.label},value:I.assign_developer||null,onChange:function(e,t){T(e,t,"assign_developer"),n.onChange(t)},getOptionLabel:function(e){return e.label||""},renderInput:function(e){var n,a,r;return(0,h.jsx)(d.Z,(0,l.Z)((0,l.Z)({},e),{},{label:"Developer",variant:"outlined",error:t.invalid,helperText:(null===t||void 0===t||null===(n=t.error)||void 0===n?void 0:n.message)||(null===t||void 0===t||null===(a=t.error)||void 0===a||null===(r=a.label)||void 0===r?void 0:r.message)}))}}))}})},field:"assign_developer",sortable:!1,filter:!1,cellRenderer:(0,i.useMemo)((function(){return function(e){return(0,h.jsx)(v.Qr,{name:"jobs.".concat(b,".templates.").concat(parseInt(e.data.order_template_id.slice(-3),10)-1,".assign_developer"),control:t,render:function(n){var t,a,r=n.field,o=n.fieldState;return(0,h.jsx)(u.Z,(0,l.Z)((0,l.Z)({},r),{},{id:"jobs.".concat(b,".templates.").concat(parseInt(e.data.order_template_id.slice(-3),10)-1,".assign_developer_").concat(e.data.id),options:[],isOptionEqualToValue:function(e,n){return e.label===n.label},onChange:function(e,n){r.onChange(n)},readOnly:(null===e||void 0===e||null===(t=e.data)||void 0===t||null===(a=t.template_status)||void 0===a?void 0:a.id)>4,clearIcon:null,getOptionLabel:function(e){return e.label||""},renderInput:function(e){var n,t,a;return(0,h.jsx)(d.Z,(0,l.Z)((0,l.Z)({},e),{},{label:"Developer",variant:"outlined",error:o.invalid,helperText:(null===o||void 0===o||null===(n=o.error)||void 0===n?void 0:n.message)||(null===o||void 0===o||null===(t=o.error)||void 0===t||null===(a=t.label)||void 0===a?void 0:a.message)}))}}))}})}}),[])},{headerName:"Status",field:"template_status",cellRenderer:(0,i.useMemo)((function(){return function(e){var n,t;return(0,h.jsx)(d.Z,{id:"outlined-read-only-input",label:"Status",defaultValue:null===e||void 0===e||null===(n=e.data)||void 0===n||null===(t=n.template_status)||void 0===t?void 0:t.label,InputProps:{readOnly:!0}})}}),[])}];return g.mT,(0,h.jsx)(h.Fragment,{children:(0,h.jsx)(c.Z,{className:"ag-theme-alpine ag-grid-wrapper multiple-templates",sx:{mt:"10px"},children:(0,h.jsx)(s.AgGridReact,{rowData:n,columnDefs:P,rowSelection:"multiple",onSelectionChanged:function(e){var n=e.api.getSelectedRows().map((function(e){var n;return{template_id:e.order_template_id,template_status_id:null===e||void 0===e||null===(n=e.template_status)||void 0===n?void 0:n.id}}));w(n)},suppressRowClickSelection:!0,suppressMovableColumns:!0,suppressDragLeaveHidesColumns:!0,pagination:!0,paginationPageSize:50,rowHeight:75})})})}));n.default=_}}]);
//# sourceMappingURL=230.628b4196.chunk.js.map