PageSourceSearch

https://thinkproedge.com/_next/static/chunks/pages/admin/job-roles/[jobRoleId]-834c9d229dee997b.js

js thinkproedge.com collected 2026-10-02 01:48:14 UTC 6,800 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[986],{50178:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/job-roles/[jobRoleId]",function(){return n(51262)}])},51262:function(e,t,n){"use strict";n.r(t),n.d(t,{__N_SSP:function(){return y}});var i=n(47568),a=n(29815),r=n(10092),u=n(85893),o=n(67294),s=n(70978),c=n(11163),d=n.n(c),g=n(7194),l=n(64790),f=n(53850),h=n(48017),_=n(64115),p=n(24003),w=n(44448),v=n(45754),q=n(85105),x=n(79887),b=n(17289),m=n(59483),y=(n(96486),!0);t.default=function(){var e=(0,o.useState)(!1),t=e[0],n=e[1],c=(0,o.useState)(""),y=c[0],S=c[1],j=(0,o.useState)([]),Z=j[0],I=j[1],k=(0,o.useState)([]),E=k[0],N=k[1],R=(0,o.useState)(null),C=R[0],z=R[1],O=(0,o.useState)(!1),P=O[0],W=O[1],T=(0,o.useState)(0),U=T[0],A=T[1],J=(0,o.useState)(0),X=J[0],$=J[1],B=(0,o.useState)(0),H=B[0],K=B[1],V=(0,o.useState)([]),D=V[0],F=(V[1],(0,o.useState)([])),G=F[0],L=(F[1],(0,o.useState)([])),M=L[0],Q=(L[1],(0,o.useState)(!1)),Y=Q[0],ee=Q[1],te=(0,o.useState)(!1),ne=te[0],ie=te[1],ae=(0,o.useState)(!1),re=ae[0],ue=ae[1];(0,o.useEffect)((function(){if(!(0,s.jl)("admin"))return d().push("/login");n(!0),oe();var e=d().query.jobRoleId;z(e)}),[]);var oe=function(){var e=(0,i.Z)((function(){var e,t;return(0,r.__generator)(this,(function(n){switch(n.label){case 0:return W(!0),[4,(0,b.ZSA)()];case 1:return e=n.sent(),t=d().query.jobRoleId,se(t,e.data),W(!1),[2]}}))}));return function(){return e.apply(this,arguments)}}(),se=function(){var e=(0,i.Z)((function(e,t){var n;return(0,r.__generator)(this,(function(i){switch(i.label){case 0:return W(!0),[4,(0,b.ApK)(e)];case 1:return n=i.sent(),console.log("response",n),S(n.data.title),ce(n.data.role,t),W(!1),[2]}}))}));return function(t,n){return e.apply(this,arguments)}}(),ce=function(e,t){var n=function(){var n=function(n){var u=r.question_tags[n];t[a].question_tags[n].score=e.find((function(e){return e.question_tag_id==u.id}))?e.find((function(e){return e.question_tag_id==u.id})).score:0,t[a].question_tags[n].weightage=e.find((function(e){return e.question_tag_id==u.id}))?e.find((function(e){return e.question_tag_id==u.id})).weightage:0;var o={id:u.id,parent_id:u.parent_id,display_name:u.display_name,tag_code:u.tag_code,type:u.type,score:e.find((function(e){return e.question_tag_id==u.id}))?e.find((function(e){return e.question_tag_id==u.id})).score:0,weightage:e.find((function(e){return e.question_tag_id==u.id}))?e.find((function(e){return e.question_tag_id==u.id})).weightage:0};i[a].question_tags.push(o)},r=t[a];t[a].score=e.find((function(e){return e.question_tag_id==r.id}))?e.find((function(e){return e.question_tag_id==r.id})).score:0,t[a].weightage=e.find((function(e){return e.question_tag_id==r.id}))?e.find((function(e){return e.question_tag_id==r.id})).weightage:0;var u={id:r.id,parent_id:r.parent_id,display_name:r.display_name,tag_code:r.tag_code,type:r.type,weightage:de(e,r),score:e.find((function(e){return e.question_tag_id==r.id}))?e.find((function(e){return e.question_tag_id==r.id})).score:0,question_tags:[]};i.push(u);for(var o=0;o<r.question_tags.length;o++)n(o)};W(!0);for(var i=[],a=0;a<t.length;a++)n();I(i),N(e),W(!1),A(7==i[0].id?i[0].weightage:25),$(8==i[1].id?i[1].weightage:50),K(9==i[2].id?i[2].weightage:25)},de=function(e,t){var n=e.find((function(e){return e.question_tag_id==t.id}));return n.weightage?n.weightage:0},ge=function(e,t,n,i,r){if(1==n){if(1==r)(u=(0,a.Z)(Z))[e].score=t/10,I(u);if(2==r)(u=(0,a.Z)(Z))[e].weightage=t,I(u),0==e?A(t):1==e?$(t):2==e&&K(t)}if(2==n){var u;if(1==r)(u=(0,a.Z)(Z))[e].question_tags[i].score=t/10,I(u);if(2==r)(u=(0,a.Z)(Z))[e].question_tags[i].weightage=t,I(u)}},le=function(){var e=(0,i.Z)((function(){var e,t,n;return(0,r.__generator)(this,(function(i){switch(i.label){case 0:return t=[],Z.map((function(e,n){e.weightage=0==n?U:1==n?X:2==n?H:0,t.push(e)})),(e=t).push.apply(e,(0,a.Z)(D).concat((0,a.Z)(G),(0,a.Z)(M))),t=t.map((function(e,t){return{question_tag_id:e.id,score:e.score?e.score:0,weightage:e.weightage?e.weightage:0}})),console.log("Submit",t),n={title:y,role:t},[4,(0,b.hB$)(C,{role_config:n}).then((function(e){var t=e.data;W(!1),console.log(t),swal("Success!","Job Role Updated Successfully!","success").then((function(e){e&&d().push("/admin/job-roles")}))}
1)).catch((function(e){W(!1),swal("Error!",e.response.data,"error")}))];case 1:return i.sent(),[2]}}))}));return function(){return e.apply(this,arguments)}}(),fe=function(e,t){var n=(0,a.Z)(Z);n[e].question_tags.map((function(e){e.score=t.find((function(t){return t.id==e.id})).val/10})),I(n)},he=function(e,t){var n=(0,a.Z)(Z);n[e].weightage=t,I(n)},_e=function(e,t,n){if(0==n&&ee(100!=e),1==n&&ie(100!=e),2==n&&ue(100!=e),13==Object.keys(t).length){var i,r=t.map((function(e){return{id:e.id,score:e.val/10,weightage:e.weightage}}));(i=D).splice.apply(i,[0,13].concat((0,a.Z)(r)))}if(2==Object.keys(t).length){var u,o=t.map((function(e){return{id:e.id,score:e.val/10,weightage:e.weightage}}));(u=G).splice.apply(u,[0,2].concat((0,a.Z)(o)))}if(21==Object.keys(t).length){var s,c=t.map((function(e){return{id:e.id,score:e.val/10,weightage:e.weightage}}));(s=M).splice.apply(s,[0,21].concat((0,a.Z)(c)))}};return t&&(0,u.jsx)(g.Z,{children:(0,u.jsx)(l.Z,{children:(0,u.jsx)(f.W,{bg:"gray.100",minWidth:"full",minHeight:"full",p:[2,10,10],children:P?(0,u.jsx)(v.$,{size:"xl",style:{justifySelf:"center"}}):(0,u.jsxs)(h.xu,{bg:"white",p:"7",border:"1px",borderColor:"gray.200",borderRadius:"5",children:[(0,u.jsx)(_.x,{fontSize:"2xl",children:"Update Job Role"}),(0,u.jsx)(p.i,{my:"4"}),(0,u.jsx)(_.x,{className:"mt-3 mb-2 ",children:"Role Title"}),(0,u.jsxs)(w.Ug,{children:[(0,u.jsx)(x.I,{value:y,placeholder:"Enter Title",onChange:function(e){return S(e.target.value)},variant:"outline"}),(0,u.jsxs)(q.z,{colorScheme:"orange",onClick:le,disabled:parseInt(U)+parseInt(X)+parseInt(H)!=100||0==y.length||Y||ne||re,children:[" ","Update"]})]}),(0,u.jsx)(h.xu,{children:parseInt(U)+parseInt(X)+parseInt(H)!=100?(0,u.jsx)(_.x,{fontSize:"14px",color:"#d9534f",children:"Sum of all the weightages should always be equal to 100%"}):Y||ne||re?(0,u.jsx)(_.x,{fontSize:"14px",color:"#d9534f",children:"Sum of all the sub weightages should always be equal to 100%"}):""}),(0,u.jsx)(h.xu,{bg:"white",borderRadius:"25px",className:"p-3 col-lg-12 mt-4",children:Z.length>0&&Z.map((function(e,t){return(0,u.jsx)(m.Z,{parameter:e.display_name,parameterVal:e.score?10*e.score:0,weightage:e.weightage?e.weightage:0,tags:e.question_tags,setWeightage:ge,index:t,defaultConfig:E,updateParent:fe,setParentWeightage:he,onChangehandleSubWeightage:_e},e.id)}))})]})})})})}}},function(e){e.O(0,[3662,5844,9676,7612,5543,9667,9697,2328,4005,9015,1641,6737,9690,299,8552,2933,4790,3571,9774,2888,179],(function(){return t=50178,e(e.s=t);var t}));var t=e.O();_N_E=t}]);

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.