"use strict";(self.webpackChunkkns_reports=self.webpackChunkkns_reports||[]).push([[55320],{24659:(e,s,a)=>{a.d(s,{A:()=>c});a(65043);var t=a(67784),r=a(4701),n=a(17392),o=a(10155),l=a(70579);const i=(0,r.A)({}),d=e=>{let{onClick:s}=e;return(0,l.jsx)(n.A,{onClick:s,children:(0,l.jsx)(o.A,{})})},c=e=>{const s=i();return(0,l.jsx)(t.A,{InputProps:{...s,endAdornment:(0,l.jsxs)(l.Fragment,{children:[" ",e.iscross&&(0,l.jsx)(d,{onClick:null!==e&&void 0!==e&&e.textclear?e.textclear:""})]})},...e})}},55320:(e,s,a)=>{a.r(s),a.d(s,{default:()=>k});var t=a(65043),r=a(68903),n=a(11906),o=a(38624),l=a(96446),i=a(63516),d=a(24659),c=a(73216),u=a(66675),m=a(96801),v=a(11852),h=a(14556),j=a(73033),p=a(70579);const y={processCategoryName:"",bdProjectTask:""},g=j.Ik().shape({processCategoryName:j.Yj("Enter Process Category Name").required("Process Category Name is required")}),x=[],b=(0,m.Gq)("enuseloc"),A=b&&Object.keys(b).length>0?b.user_id:null;const k=function(e){const s=t.useRef(null),[a,m]=(0,t.useState)(y),j=(0,h.d4)((e=>e.bd.getProjectTask)),b=(0,c.Zp)(),k=(0,h.wA)(),[C,f]=(0,t.useState)([]),N=(0,h.d4)((e=>{var s;return null===(s=e.bd.getFunctionalityPermissionDetail)||void 0===s?void 0:s.data})),P=(0,t.useRef)("NO"),T=(0,t.useRef)("NO");return(0,t.useEffect)((()=>{const e={userID:A,functionalityID:102,functionalityItemIDs:x};return k((0,v.P8M)(e)),()=>{k((0,v.qo7)())}}),[]),(0,t.useEffect)((()=>(N&&102===(null===N||void 0===N?void 0:N.functionalityID)&&(f(N),P.current=null===N||void 0===N?void 0:N.permission_report,T.current=null===N||void 0===N?void 0:N.permission_admin),()=>{f([]),P.current="NO",T.current="NO"})),[N]),(0,t.useEffect)((()=>{k((0,v.cUq)({userID:"143620071466608200",taskCategoryID:"",taskStatus:"",taskOwnerID:"",generalSearch:"",sortOrder:"",iDisplayStart:0,iDisplayLength:"-1"}))}),[]),(0,p.jsxs)("div",{className:"component-list",children:[(0,p.jsx)(r.Ay,{container:!0,className:"d-flex justify-content-between align-items-center",py:1,children:(0,p.jsxs)(r.Ay,{item:!0,className:"common-header-label",children:[(0,p.jsx)(n.A,{onClick:()=>{b(-1)},children:(0,p.jsx)(u.A,{})}),"Add Process Category"]})}),C&&Object.keys(C).length>0&&102===(null===C||void 0===C?void 0:C.functionalityID)&&("YES"===(null===C||void 0===C?void 0:C.permission_admin)||"YES"===(null===C||void 0===C?void 0:C.AddLegalTask))?(0,p.jsx)(i.l1,{enableReinitialize:!0,innerRef:s,initialValues:a,validationSchema:g,onSubmit:async(e,s)=>{var a,t;console.log(e,"values");const r={processCategoryName:null!==e&&void 0!==e&&e.processCategoryName?null===e||void 0===e?void 0:e.processCategoryName:"",bdProjectTask:null!==e&&void 0!==e&&null!==(a=e.bdProjectTask)&&void 0!==a&&a.id?null===e||void 0===e||null===(t=e.bdProjectTask)||void 0===t?void 0:t.id:""};console.log("finalpayload:: ",r),s.setSubmitting(!0),await k((0,v.MWX)(r)),s.resetForm({}),b("/bd-masters/LiaisonProcessCategory")},children:e=>{let{errors:s,handleSubmit:a,handleChange:t,setFieldValue:c,handleBlur:u,isSubmitting:m,isValid:v,touched:h,values:y}=e;return(0,p.jsx)(i.lV,{onSubmit:a,children:(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(r.Ay,{container:!0,className:"component-form",children:(0,p.jsxs)(r.Ay,{container:!0,children:[(0,p.jsx)(r.Ay,{xs:12,sm:12,md:12,lg:12,p:1,children:(0,p.jsx)(d.A,{name:"processCategoryName",fullWidth:!0,onBlur:u,onChange:t,value:y.processCategoryName,error:s.processCategoryName&&Boolean(s.processCategoryName),helperText:s.processCategoryName&&s.processCategoryName,id:"processCategoryName",size:"small",label:"Category Name*",variant:"outlined"})}),(0,p.jsx)(r.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,p.jsx)(o.A,{size:"small",onBlur:u,value:y.bdProjectTask,options:null!==j&&void 0!==j&&j.data?null===j||void 0===j?void 0:j.data:[],getOptionLabel:e=>e.task_name||"",onChange:(e,s)=>{c("bdProjectTask",s)},renderInput:e=>(0,p.jsx)(d.A,{...e,fullWidth:!0,label:"Project Task*",name:"bdProjectTask",variant:"outlined",size:"small",helperText:s.bdProjectTask&&s.bdProjectTask,error:s.bdProjectTask&&Boolean(s.bdProjectTask)})})})]})}),(0,p.jsxs)(r.Ay,{className:"d-flex justify-content-end",p:2,children:[(0,p.jsxs)(l.A,{mx:2,children:[" ",(0,p.jsx)(n.A,{text:"CANCEL",variant:"contained",color:"secondary",size:"medium",type:"reset",children:"RESET"})]}),(0,p.jsx)(l.A,{children:(0,p.jsx)(n.A,{type:"submit",text:"SAVE",variant:"contained",size:"medium",disabled:m,children:"SAVE"})})]})]})})}}):(0,p.jsx)("div",{className:"common-header-label-bold",children:"You don't have permission to access this page!"})]})}},10155:(e,s,a)=>{var t=a(24994);s.A=void 0;var r=t(a(40039)),n=a(70579);s.A=(0,r.default)((0,n.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Clear")},66675:(e,s,a)=>{var t=a(24994);s.A=void 0;var r=t(a(40039)),n=a(70579);s.A=(0,r.default)((0,n.jsx)("path",{d:"M3 18h13v-2H3zm0-5h10v-2H3zm0-7v2h13V6zm18 9.59L17.42 12 21 8.41 19.59 7l-5 5 5 5z"}),"MenuOpen")}}]);
//# sourceMappingURL=55320.0bcd5c5c.chunk.js.map