1"use strict";(self.webpackChunkhrms=self.webpackChunkhrms||[]).push([[639],{639:(e,t,s)=>{s.r(t),s.d(t,{default:()=>h});var a=s(65043),d=s(326),o=s(78370),n=s(92522),r=s(91036),i=s(70579);const l=e=>(0,i.jsx)("div",{className:"modal fade",id:"confirmDialogue",tabIndex:"-1",role:"dialog","aria-labelledby":"confirmDialogue","aria-hidden":"true",children:(0,i.jsx)("div",{className:"modal-dialog modal-dialog-centered",role:"document",children:(0,i.jsxs)("div",{className:"modal-content",children:[(0,i.jsxs)("div",{className:"modal-header",children:[(0,i.jsx)("h5",{className:"modal-title",id:"confirmDialogue",children:"Please Confirm"}),(0,i.jsx)("button",{type:"button",className:"close","data-dismiss":"modal","aria-label":"Close",children:(0,i.jsx)("span",{"aria-hidden":"true",children:"\xd7"})})]}),(0,i.jsx)("div",{className:"modal-body",children:(0,i.jsxs)("div",{className:"text-center my-3 mb-3",children:["Are you sure you want to delete"," ",(0,i.jsx)("strong",{children:e.selectedObj&&e.selectedObj.name}),"?"]})}),(0,i.jsxs)("div",{className:"modal-footer d-flex flex-row justify-content-center",children:[(0,i.jsx)("button",{type:"button",className:"btn btn-success btn-wide mr-4","data-testid":"submit","data-dismiss":"modal",onClick:function(){if(e.selectedObj){const t={roleId:e.selectedObj.roleId,roleName:e.selectedObj.roleName,permissions:[{moduleId:1,read:!0,edit:!1,add:!1,delete:!1,visible:!0}]};o.A.deleteRole(t).then((t=>{t.data.error?(0,r.oR)(t.data.message):((0,r.oR)(t.data.message),e.getAllRole())}),(e=>{(0,r.oR)(e.resp.data.message)}))}else if(e.designationObj){const t={id:e.designationObj.id};n.A.deleteDesignation(t).then((e=>{}))}else if(e.userIdObj){const t={userId:e.userIdObj};n.A.deleteEmployeeForPermanent(t).then((t=>{t&&((0,r.oR)(t.data.message),e.getEmployeeList())}),(e=>{e.response.data.message.errors?(0,r.oR)(e.response.data.message.errors[0].msg):(0,r.oR)(e.response.data.message)}))}},children:"Yes"}),(0,i.jsx)("button",{type:"button",className:"btn btn-secondary btn-wide ml-4","data-testid":"reset","data-dismiss":"modal",children:"No"})]})]})})});var c=s(84118),m=s(90127);class u extends a.Component{constructor(e){super(e),this.toggleLoader=()=>{1==this.state.loaderState?this.setState({loaderState:!1}):0==this.state.loaderState&&this.setState({loaderState:!0})},this.getDocumentsTypesList=()=>{c.A.getDocumentsType({pageNumber:1,pageSize:1}).then((e=>{this.setState({key:e.data.records[0].documentId}),this.setState({documentTypelist:e.data.records})}))},this.getDocumentsByUser=()=>{const e={userId:this.state.userId};c.A.getAllDocumentsForUser(e).then((e=>{this.setState({documentByUserArr:e.data.data.records})}))},this.getdocumentlist=()=>{const e={userId:this.state.userId,documentType:this.state.key};c.A.getDocuments(e).then((e=>{this.setState({message:e.data.message}),this.setState({documents:e.data.documents})}))},this.changeHandler=e=>{this.setState({[e.target.name]:e.target.value},(()=>{this.validate()}))},this.changefile=(e,t)=>{this.setState({documentName:t.documentName,documentType:t.documentTypeId}),this.setState({[e.target.name]:e.target.files[0]},(()=>{this.uploadDoc()}))},this.adddocumnet=()=>{this.setState({adddocumnet:!0})},this.uploadDoc=()=>{const e={userId:this.state.userId,documentName:this.state.documentName,documentType:this.state.documentType,file:this.state.file};c.A.addDocument(e).then((e=>{const t=e.data.data.record.data.key,s=t.toString();this.setState((e=>({documentkey:t,filekey:[...e.filekey||[],s]})),(()=>this.handleSubmit()))}),(e=>{e.response.data.message.errors?(0,r.oR)(e.response.data.message.errors[0].msg):(0,r.oR)(e.response.data.message)}))},this.handleSubmit=e=>{this.toggleLoader();const t={userId:this.state.userId,documents:[{documentName:this.state.documentName,documentType:parseInt(this.state.documentType),documentKeys:this.state.filekey,description:"vjndfjv"}]};c.A.submitDoc(t).then((e=>{e&&((0,r.oR)(e.data.message),this.setState({documentName:"",documentType:"",filekey:[],description:"",theInputKey:"remove string"})),this.toggleLoader(),this.getDocumentsByUser()}),(e=>{this.toggleLoader(),e.response.data.message.errors?(0,r.oR)(e.response.data.message.errors[0].msg):(0,r.oR)(e.response.data.message)}))},this.removeDocfile=e=>{for(let t=0;t<this.state.documentByUserArr.length;t++)this.state.documentByUserArr[t].documentTypeId==e&&(this.state.documentByUserArr[t].documentUrl=[]);this.setState({documentByUserArr:[...this.state.documentByUserArr]})},this.getdeleteDocumentById=()=>{const e={userId:this.state.userId,documentType:this.state.documentTypeId,documentId:this.state.documentId};c.A.deleteDoc(e).then((t=>{this.setState({deleteIdresult:e}),this.getDocumentsByUser(),(0,r.oR)(t.data.message)}),(e=>{e.response.data.message.errors?(0,r.oR)(e.response.data.message.errors[0].msg):(0,r.oR)(e.response.data.message)}))},this.getdocumentType=e=>{this.state.userId},this.state={documentUrl:[],pageNumber:1,search:"",searchname:"",documentName:"",documentType:"",file:"",userId:"",errors:[],documentKeys:"",id:"",employeename:"",filekey:[],message:"No Employee Selected",documents:[],key:"",isSectionHide:!1,isSumitFormHide:!1,inputFile:!1,inputFile1:!1,inputFile2:!1,update:!1,documentId:"",documentTypelist:[],documentByUserArr:[],userType:localStorage.getItem("userType")},this.uploadDoc=this.uploadDoc.bind(this),this.deleteDocument=this.deleteDocument.bind(this),this.getdocumentType=this.getdocumentType.bind(this)}componentDidMount(){this.props.employeeId&&this.setState({userId:this.props.employeeId},(()=>this.getDocumentsByUser()))}handleSelect(e){this.setState({key:e},(()=>{const t={userId:this.state.userId,documentType:e};c.A.getDocuments(t).then((e=>{this.setState({message:e.data.message}),this.setState({documents:e.data.data.records})}))}))}deleteDocument(e){this.setState({deleteDocumentId:e.id,documentTypeId:e.documentTypeId,documentId:e.documentId,selectedObj:{name:e.documentName}})}render(){return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:"container-fluid",children:(0,i.jsx)("div",{className:"row",children:(0,i.jsx)("div",{className:"col-sm-12",children:(0,i.jsxs)("div",{className:"card cardmargin",children:[(0,i.jsx)("div",{className:"top_header header",children:(0,i.jsx)("h5",{className:"headingcolor",children:"Employee Documents"})}),(0,i.jsxs)("div",{className:"alert alert-light alert-dismissible fade show alertmsg",role:"alert",children:["View and manage soft copies of all documents of an employee from the Employee Document page.Documents available under the Documents tabs can be Education Documents,Address proof Documents,Previous employment-related documents,etc.Click Add Documents to add new documents.",(0,i.jsx)("button",{type:"button",className:"close","data-dismiss":"alert","aria-label":"Close",children:(0,i.jsx)("span",{"aria-hidden":"true",children:"\xd7"})})]}),(0,i.jsxs)("table",{className:"table table-curved tablemargin",children:[(0,i.jsx)("thead",{children:(0,i.jsxs)("tr",{className:"top_header",children:[(0,i.jsx)("th",{className:"tableheading tablenamemargindoc",scope:"col",children:"Document Type"}),(0,i.jsx)("th",{className:"tableheading",colSpan:"1",scope:"col",children:"Upload"}),"user"===this.state.userType?"":(0,i.jsx)("th",{className:"tableheading tabledeletemargin text-center",colSpan:"4",scope:"col",children:"Action"})]})}),(0,i.jsx)("tbody",{children:this.state.documentByUserArr&&this.state.documentByUserArr.map(((e,t)=>{var s;return(0,i.jsxs)("tr",{className:"tableRow",children:[(0,i.jsx)("td",{children:e.documentName}),(0,i.jsx)("td",{colSpan:"",children:(0,i.jsx)(i.Fragment,{children:null!==(s=e.documentUrl)&&void 0!==s&&s.length||e.isUpdateDoc?(0,i.jsxs)("div",{children:[(0,i.jsx)("a",{href:"user"===this.state.userType&&"admin"===e.uploadedBy?"#":e.documentUrl,target:"user"===this.state.userType&&"admin"===e.uploadedBy?"":"_blank",children:(0,i.jsx)("i",{className:"uploadIcon fas fa-file-alt"})}),"user"===this.state.userType?"":(0,i.jsx)("span",{className:"removeLink ".concat("user"===this.state.userType&&"admin"===e.uploadedBy?"isDisabled":""," "),onClick:t=>{"user"===this.state.userType&&"admin"===e.uploadedBy?t.preventDefault():this.removeDocfile(e.documentTypeId)},title:"Remove",children:"X"})]}):(0,i.jsx)("input",{type:"file",name:"file",onChange:t=>this.changefile(t,e),id:e.documentTypeId,disabled:"user"===this.state.userType&&"admin"===e.uploadedBy})})}),"user"===this.state.userType?"":(0,i.jsx)("td",{className:"text-right",colSpan:"4",children:(0,i.jsxs)(m.A,{children:[(0,i.jsx)(m.A.Toggle,{variant:"transparent",className:"sucessBtn",id:"dropdown-basic",children:(0,i.jsx)("i",{className:"fa fa-ellipsis-v actionicon","aria-hidden":"true"})}),(0,i.jsx)(m.A.Menu,{children:(0,i.jsx)(m.A.Item,{"data-toggle":"modal","data-target":"#designationDialogue",children:(0,i.jsx)("i",{className:"far fa-trash-alt deleteicon","aria-hidden":"true","data-toggle":"modal","data-target":"#deleteDocument",onClick:()=>this.deleteDocument(e),children:(0,i.jsx)("label",{className:"mx-3",children:"Delete"})})})})]})})]},t)}))})]})]})})})}),(0,i.jsx)("div",{className:"modal fade",id:"deleteDocument",tabIndex:"-1",role:"dialog","aria-labelledby":"
1confirmDialogue","aria-hidden":"true",children:(0,i.jsx)("div",{className:"modal-dialog modal-dialog-centered",role:"document",children:(0,i.jsxs)("div",{className:"modal-content",children:[(0,i.jsxs)("div",{className:"modal-header",children:[(0,i.jsx)("h5",{className:"modal-title",id:"confirmDialogue",children:"Please Confirm"}),(0,i.jsx)("i",{className:"fas fa-times-circle crossicon","data-dismiss":"modal"})]}),(0,i.jsx)("div",{className:"modal-body",children:(0,i.jsxs)("div",{className:"text-center my-3 mb-3",children:["Are you sure you want to delete",(0,i.jsx)("strong",{children:this.state.selectedObj&&this.state.selectedObj.name}),"?"]})}),(0,i.jsxs)("div",{className:"modal-footer d-flex flex-row justify-content-center",children:[(0,i.jsx)("button",{type:"button",className:"btn successBtn btn-wide mr-4","data-testid":"submit","data-dismiss":"modal",onClick:()=>this.getdeleteDocumentById(),children:"Yes"}),(0,i.jsx)("button",{type:"button",className:"btn cancelBtn btn-wide ml-4","data-testid":"reset","data-dismiss":"modal",children:"No"})]})]})})}),(0,i.jsx)(l,{}),this.state.loaderState?(0,i.jsx)(d.A,{}):null]})}}const h=u},84118:(e,t,s)=>{s.d(t,{A:()=>o});var a=s(79722);const d=s(99059).c.API_URL;const o=new class{getDocumentsType(e){return a.A.post(d+"/getOrgDocumentType",e)}getAllDocumentsForUser(e){return a.A.post(d+"/getAllDocumentsForUser",e)}getDocuments(e){return a.A.post(d+"/getDocuments",e)}deleteDoc(e){return a.A.delete(d+"/deleteDoc",{data:e})}editDocument(e){return a.A.post(d+"/editDoc",e)}getOrgDocumentType(e){return a.A.post(d+"/getOrgDocumentType",e)}addDocumentType(e){return a.A.post(d+"/addDocumentType",e)}deleteDocumentType(e){return a.A.delete(d+"/deleteDocumentType",{data:e})}EditDocumentType(e){return a.A.put(d+"/editDocumentType",e)}getCustomSection(){return a.A.get(d+"/getCustomSection")}addCustomSection(e){return a.A.post(d+"/addCustomSection",e)}deleteCustomSection(e){return a.A.delete(d+"/deleteCustomSection?sectionId=".concat(e.sectionId))}EditCustomSection(e){return a.A.put(d+"/editCustomSection",e)}AddCustomSectionControllers(e){return a.A.post(d+"/addCustomSectionControllers",e)}getCustomSectionControllers(e){return a.A.post(d+"/getCustomSectionControllers",e)}deleteCustomSectionControllers(e){return a.A.delete(d+"/deleteCustomSectionControllers?sectionControlId=".concat(e.sectionControlId))}editCustomSectionControllers(e){return a.A.put(d+"/editCustomSectionControllers",e)}addDocument(e){const t=new FormData;return t.set("file",e.file),t.set("documentType",e.documentType),t.set("documentName",e.documentName),t.set("userId",e.userId),t.set("folderId",e.folderId),a.A.post(d+"/uploadDoc",t)}submitDoc(e){return a.A.post(d+"/submitDoc",e)}getDocumentTypeFolder(e){return a.A.post(d+"/getDocumentTypeFolder",e)}addAndUpdateDocumentTypeFolder(e){return a.A.post(d+"/addAndUpdateDocumentTypeFolder",e)}deleteDocumentTypeFolder(e){return a.A.delete(d+"/deleteDocumentTypeFolder",{data:e})}getAllDocumentsFolderForUser(e){return a.A.post(d+"/getAllDocumentsFolderForUser",e)}}}}]); 2//# sourceMappingURL=639.2e11ce57.chunk.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.