1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9616],{91821:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/candidate-roles",function(){return t(1977)}])},66339:function(e,n,t){"use strict";t.d(n,{H:function(){return a},f:function(){return i}});var r=t(94076),o=t(61378),i=function(){return r.Z.get(o.k8)},a=function(e){return r.Z.patch("".concat(o.k8,"/default/").concat(e))}},40488:function(e,n,t){"use strict";var r=t(14251),o=t(44747),i=t(85893),a=t(70547),l=t(95854),s=t(68409);n.Z=function(e){var n=e.onChange,t=e.height,l=e.width,d=(0,o.Z)(e,["onChange","height","width"]),u=d.label;return(0,i.jsxs)(s.ZC,{children:[(0,i.jsx)(a.Z,{variant:"text-sm",isBold:!0,children:u}),(0,i.jsx)(c,(0,r.Z)({css:{height:t,width:l},variant:"textarea",type:"textarea",onChange:function(e){n(e.target.value)}},d))]})};var c=(0,l.zo)("textarea",{fontFamily:"$sans",border:"1px solid $neutral200",borderRadius:"$1",boxSizing:"border-box",color:"$neutral800",fontSize:"$3",fontWeight:"$1",lineHeight:"$2",padding:"$3",width:"100%","&:hover":{border:"1px solid $neutral700"},resize:"vertical",variants:{isFullWidth:{true:{"&&":{width:"100%"}}}}})},56270:function(e,n,t){"use strict";var r=t(85893),o=t(13065),i=t(68298);n.Z=function(e){var n=e.isOpen,t=void 0!==n&&n,a=e.onClose,l=e.onAction,s=e.description,c=e.title,d=void 0===c?"Confirm Delete":c,u=e.primaryBtnText,f=void 0===u?"Delete":u;return(0,r.jsxs)(i.Dialog,{isOpen:t,onClose:a,children:[(0,r.jsx)(i.DialogHeader,{title:d,description:s}),(0,r.jsxs)(i.DialogActions,{children:[(0,r.jsx)(o.Z,{variant:"text",onClick:a,children:"Cancel"}),(0,r.jsx)(o.Z,{variant:"primary",onClick:function(){l(),a()},children:f})]})]})}},1977:function(e,n,t){"use strict";t.r(n),t.d(n,{__N_SSP:function(){return P},default:function(){return U}});var r=t(67573),o=t(14251),i=t(52875),a=t(69779),l=t(85893),s=t(95854),c=t(70547),d=t(76047),u=t(87710),f=t(13065),h=t(67294),p=t(94076),x=t(61378),v=t(40488),m=t(50342),g=t(29646),w=t(9403),j=t(50537),Z=t(68409),C=t(44644),k=t(21379),y=t(27920),b=(0,s.zo)(C.Z,{color:"$neutral400"}),S=(0,s.zo)(k.Z,{color:"$neutral400"});var E=function(e){var n=e.roles,t=void 0===n?{}:n,r=e.orderedRoleIds,o=void 0===r?[]:r,i=e.onUpdate,a=e.onDelete,s=e.workflows,d=void 0===s?{}:s,f=e.orderedWorkflowIds,h=void 0===f?[]:f,p=e.handleWorkflowChange,x=(0,y.Ip)(d,h);return(0,l.jsx)(Z.ZC,{children:o.length?(0,l.jsx)(Z.ZC,{children:(0,l.jsxs)(m.Z,{"aria-label":"Candidate Roles",children:[(0,l.jsxs)(g.xD,{children:[(0,l.jsx)(g.sg,{children:"Candidate Role"}),(0,l.jsx)(g.sg,{children:"Workflow mapped"}),(0,l.jsx)(g.sg,{children:"Actions"})]}),(0,l.jsx)(g.RM,{children:o.map((function(e){var n=t[e],r=n.name,o=n.workflowId;return(0,l.jsxs)(g.X2,{children:[(0,l.jsx)(g.bL,{children:r}),(0,l.jsx)(g.bL,{children:(0,l.jsx)(Z.ZC,{css:{width:"220px"},children:(0,l.jsx)(w.Z,{isFullWidth:!0,options:x,onChange:function(n){var t=n.value;return p(e,t)},value:x.find((function(e){return e.value===o})),"aria-label":"Workflow Assigned"})})}),(0,l.jsx)(g.bL,{children:(0,l.jsxs)(u.Z,{css:{gap:"$1"},children:[(0,l.jsx)(j.Z,{variant:"text","aria-label":"Edit Role",onClick:function(){return i(e,r)},children:(0,l.jsx)(S,{})}),(0,l.jsx)(j.Z,{variant:"text","aria-label":"delete role",onClick:function(){return a(e)},children:(0,l.jsx)(b,{})})]})})]},e)}))})]})}):(0,l.jsx)(c.Z,{variant:"text",children:"There are no Roles added."})})},R=t(56270),A=t(69377),D=t(68298);var N=function(e){var n=e.isOpen,t=void 0!==n&&n,r=e.onClose,o=e.roleName,i=void 0===o?"":o,a=e.handleUpdate,s=(0,h.useState)(i),c=s[0],d=s[1],u=(0,h.useState)(""),p=u[0],x=u[1];return(0,h.useEffect)((function(){i&&d(i)}),[i]),(0,l.jsx)(D.Dialog,{isOpen:t,onClose:r,children:(0,l.jsxs)("form",{onSubmit:function(e){e.preventDefault(),p||a(c)},children:[(0,l.jsx)(D.DialogHeader,{title:"Update Role",description:"Rename the current role."}),(0,l.jsx)(D.DialogBody,{children:(0,l.jsx)(Z.ZC,{css:{width:"100%"},children:(0,l.jsx)(A.Z,{variant:"text","aria-label":"Add Role",placeholder:"Software Engineer 1 (SDE 1)",onChange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";p&&x(""),e.trim().length||x("Role name is empty."),d(e)}
1,value:c,errorMessage:p,validationState:p?"invalid":"valid",shouldAutoFocus:!0,isFullWidth:!0})})}),(0,l.jsxs)(D.DialogActions,{children:[(0,l.jsx)(f.Z,{variant:"text",onClick:r,children:"Cancel"}),(0,l.jsx)(f.Z,{isDisabled:""===c,variant:"primary",type:"submit",children:"Update"})]})]})})},W=t(49681),_=t(24990),$=t(88767),I=t(66339);var T=t(18542),z=["SDE Intern","Software Engineer 1","Software Engineer 2","Senior Software Engineer","Member of Technical Staff","VP of Engineering","Software Architect","Engineering Lead","Principal Software Engineer"],O=t(98758),B=t(32471),F=(0,s.zo)("a",{cursor:"pointer",fontSize:"14px"});var P=!0,U=function(){var e,n,t=(0,h.useState)({}),s=t[0],m=t[1],g=(0,h.useState)(""),w=g[0],j=g[1],C=(0,h.useState)([]),k=C[0],y=C[1],b=(0,h.useState)(!0),S=b[0],A=b[1],D=(0,h.useState)(null),P=D[0],U=D[1],L=(0,h.useState)(null),H=L[0],K=L[1],M=(0,$.useQuery)("myWorkflows",I.f,{select:function(e){return e.data.data}}).data||{},V=M.orderedWorkflowIds,X=M.workflows,q=(0,_.V6)(),G=q.showSuccessToast,J=q.showErrorToast;(0,h.useEffect)((function(){p.Z.get(x.lN).then((function(e){var n=e.data.data,t=void 0===n?{}:n;m(t.roles),y(t.orderedRoleIds),A(!1)}))}),[]);var Q="",Y=!!P;Y&&(Q=null===(e=s[P])||void 0===e?void 0:e.name);var ee=!!H;return ee&&(Q=null===(n=s[H])||void 0===n?void 0:n.name),(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(N,{isOpen:Y,onClose:function(){return U(null)},roleName:Q,handleUpdate:function(e){p.Z.patch("".concat(x.lN,"/").concat(P),{newName:e}).then((function(n){(0,T.AK)(n,G),U(null),m((function(n){var t=(0,o.Z)({},n);return t[P].name=e,t}))})).catch((function(e){return(0,T.bo)(e,J)}))}}),(0,l.jsx)(R.Z,{isOpen:ee,onClose:function(){return K(null)},onAction:function(){p.Z.delete("".concat(x.lN,"/").concat(H)).then((function(e){(0,T.AK)(e,G),y((function(e){return e.filter((function(e){return e!==H}))})),K(null)})).catch((function(e){return(0,T.bo)(e,J)}))},description:"Are you sure want to delete this role ".concat(Q,"? Deleting this role will remove all the candidates that are mapped to this role.")}),(0,l.jsxs)(B.dU,{pageId:"candidate-roles",pageName:"Candidate Roles",description:"Create job roles you commonly use at your company, and map workflows to them.",children:[(0,l.jsxs)(c.Z,{variant:"text-l",children:["Create Roles",(0,l.jsx)(d.Z,{placement:"top",content:"Get a starting template which you can edit.",children:(0,l.jsx)(F,{css:{marginLeft:"10px"},onClick:function(){j(z.join("\n"))},children:"(Autofill)"})})]}),(0,l.jsx)(u.Z,{css:{gap:"$4",marginTop:"20px"},children:(0,l.jsx)(v.Z,{value:w,onChange:function(e){j(e)},placeholder:"Enter each role in new line. For eg:\n\nSoftware Engineer\nSenior Software Engineer\nVP of Engineering\n",width:"350px",height:"160px",label:"Enter Job Role *"})}),(0,l.jsx)(f.Z,{sx:{marginTop:"10px"},variant:"primary",onClick:function(){var e=w.split("\n").map((function(e){return e.trim()})).filter((function(e){return Boolean(e)}));e.length?p.Z.post(x.lN,{candidateRoles:e}).then((function(e){var n=e.data.data,t=n.candidateRoleIds,r=n.candidateRoles;y((function(e){return(0,a.Z)(e).concat((0,a.Z)(t))})),m((function(e){return(0,o.Z)({},e,r)})),j("")})).catch((function(e){return(0,T.bo)(e,J)})):J({message:O.W.error.role.empty})},children:"Add Roles"}),(0,l.jsxs)(Z.ZC,{css:{my:"$5"},children:[(0,l.jsx)(c.Z,{variant:"text-l",isBold:!0,sx:{marginBottom:"$3"},children:"List of available roles in this company."}),S?(0,l.jsx)(W.Z,{}):(0,l.jsx)(E,{roles:s,orderedRoleIds:k,onDelete:function(e){K(e)},onUpdate:function(e){U(e)},workflows:X,orderedWorkflowIds:V,handleWorkflowChange:function(e,n){(function(e,n){return p.Z.patch("/company/candidate-role/".concat(e,"/workflow/").concat(n))})(e,n).then((function(t){(0,T.AK)(t,G),m((function(t){return(0,i.Z)((0,o.Z)({},t),(0,r.Z)({},e,(0,i.Z)((0,o.Z)({},t[e]),{workflowId:n})))}))})).catch((function(e){return(0,T.bo)(e,J)}))}})]})]})]})}},98758:function(e,n,t){"use strict";t.d(n,{W:function(){return r}});var r={success:{addActionTemplate:"Action Template added successfully.",emailBuilder:{img:"Image uploaded"}},error:{role:{empty:"Role name should not be empty."}}}},27920:function(e,n,t){"use strict";t.d(n,{Ip:function(){return a},Pq:function(){return r},_x:function(){return o},oq:function(){return i}});var r=[{displayName:"Company Workflows",id:"my-workflows"},{displayName:"Workflow templates",id:"workflow-templates"}],o=[{displayName:"Company Workflows",id:"my-workflows"}],i="my-workflows",a=function(e,n){return n.map((function(n){return{label:e[n].name,value:n}}))}}},function(e){e.O(0,[6047,342,5277,3112,9383,2471,9774,2888,179],(function(){return n=91821,e(e.s=n);var n}));var n=e.O();_N_E=n}]);
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.