1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7953],{51229:function(e,l,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/tenant/projects/update-project",function(){return a(79391)}])},79391:function(e,l,a){"use strict";a.r(l),a.d(l,{default:function(){return j}});var s=a(85893),t=a(67294),i=a(51635),r=a(89583),n=a(11163),o=a(87536),d=a(47533),c=a(47793),u=a(23157),m=a(9473),x=a(28276),p=a(55678);a(25935),a(58514);var f=a(5152),h=a.n(f);let v=h()(Promise.all([a.e(2937),a.e(8764),a.e(1167)]).then(a.t.bind(a,71167,23)),{loadableGenerated:{webpack:()=>[71167]},ssr:!1,loading:()=>(0,s.jsx)("p",{children:"Loading ..."})}),b={toolbar:[[{header:"1"},{header:"2"},{header:"3"},{font:[]}],[{size:[]}],["bold","italic","underline","strike","blockquote"],[{list:"ordered"},{list:"bullet"},{indent:"-1"},{indent:"+1"}],["link","image","video"],["clean"]],clipboard:{matchVisual:!1}};function j(){let e=(0,n.useRouter)(),{projId:l}=e.query,{register:a,handleSubmit:f,control:h,formState:{errors:j},setValue:y,reset:g}=(0,o.cI)({resolver:(0,d.X)(c.K)});console.log(j,"errors");let N=(0,m.I0)(),k=e=>{if(e.passMarks>e.marks){p.Am.error("Pass marks should be less than or equal to total marks");return}let l=window.location.hostname,a=l.split(".")[0];console.log(a,"tenant------"),e.tenant=a,e.skill=e.skill.map(e=>e.value),console.log(e,"data33"),N((0,x.Vs)(e)).then(e=>{if(200===e.payload.data.status_code)p.Am.success(e.payload.data.data);else{var l,a,s;p.Am.warning(null==e?void 0:null===(l=e.payload)||void 0===l?void 0:null===(a=l.data)||void 0===a?void 0:null===(s=a.detail)||void 0===s?void 0:s.message)}}),console.log(e)},[w,C]=(0,t.useState)([]);(0,t.useEffect)(()=>{N((0,x.q6)({})).then(e=>{if(console.log(e,"res111"),200===e.payload.data.status_code){var l,a;let s=null===(l=e.payload)||void 0===l?void 0:null===(a=l.data)||void 0===a?void 0:a.data.map(e=>({value:e.task,label:e.task+(e.difficulty?" - (".concat(e.difficulty,")"):""),description:e.description,difficulty:e.difficulty}));C(s)}else p.Am.error(e.payload.data.message)})},[]),(0,t.useEffect)(()=>{if(e.isReady){let e=window.location.hostname,a=e.split(".")[0];console.log(a,"tenant------"),N((0,x.wj)({tenant:a,id:l})).then(e=>{if(200===e.payload.data.status_code){var l;let{data:a}=e.payload.data;console.log(w,"item");let s=[];a.task.map(e=>{console.log(e,"item"),s.push(w.find(l=>l.value===e.value))}),console.log(s,"item"),console.log(a,"updatedata"),g({id:a._id,projectName:a.projectName,platform:a.platform,skill:null==a?void 0:null===(l=a.skill)||void 0===l?void 0:l.map(e=>({value:e,label:e})),duration:a.duration,difficulty:a.difficulty,marks:null==a?void 0:a.marks,passMarks:null==a?void 0:a.passMarks,description:a.description,instructions:a.instructions,task:a.task}),D(null==a?void 0:a.marks)}else p.Am.error(e.payload.data.message)})}},[e.isReady]);let[S,D]=(0,t.useState)(0),M=e=>{let l=0;e.forEach(e=>{(null==e?void 0:e.difficulty)==="easy"||(null==e?void 0:e.difficulty)==="eassy"?l+=10:(null==e?void 0:e.difficulty)==="medium"?l+=20:(null==e?void 0:e.difficulty)==="hard"&&(l+=50)}),D(l),y("marks",l)};return(0,s.jsxs)(i.Z,{children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"flex flex-col space-y-2 md:space-y-0 md:flex-row items-center justify-between py-5 lg:py-6 border-b border-blue-500/30 mb-12",children:(0,s.jsxs)("div",{className:"group flex items-center justify-between w-full space-x-1",children:[(0,s.jsx)("h1",{className:"text-xl font-bold text-black line-clamp-1",children:"Update Project"}),(0,s.jsxs)("button",{onClick:()=>{e.push("/tenant/projects")},className:"bg-defaultBg text-white font-[400] px-3 py-2 rounded flex items-center",children:[(0,s.jsx)(r.x_l,{className:"inline-block mr-2"}),"Back"]})]})}),(0,s.jsx)("div",{className:"shadow bg-white flex rounded-lg p-8",children:(0,s.jsxs)("form",{onSubmit:f(k),className:"flex w-full",children:[(0,s.jsxs)("div",{className:"w-[50%] border-r border-gray-300 px-12",children:[(0,s.jsx)("p",{className:"text-xl text-black",children:"Project Details"}),(0,s.jsxs)("div",{className:"py-3 flex flex-col",children:[(0,s.jsx)("label",{className:"text text-gray-500",children:"Project Title"}),(0,s.jsxs)("div",{className:"w-full",children:[(0,s.jsx)("input",{className:"rounded-lg w-full border-gray-300",type:"text",placeholder:"Project Name",...a("projectName")}
1),j.projectName&&(0,s.jsx)("p",{className:"text-red-500",children:j.projectName.message})]})]}),(0,s.jsxs)("div",{className:"py-3 flex flex-col",children:[(0,s.jsx)("label",{className:"text",children:"Platform"}),(0,s.jsxs)("div",{className:"w-full",children:[(0,s.jsxs)("select",{disabled:!0,className:"rounded-lg border-gray-300 w-full p-2 blur-[2px]",...a("platform"),children:[(0,s.jsx)("option",{value:"",children:"Select Platform"}),(0,s.jsx)("option",{value:"aws",children:"AWS"}),(0,s.jsx)("option",{value:"azure",children:"Azure"}),(0,s.jsx)("option",{value:"gcp",children:"GCP"}),(0,s.jsx)("option",{value:"salesforce",children:"Salesforce"})]}),j.platform&&(0,s.jsx)("p",{className:"text-red-500",children:j.platform.message})]})]}),(0,s.jsxs)("div",{className:"py-3 flex flex-col",children:[(0,s.jsx)("label",{className:"text text-gray-500",children:"Skills"}),(0,s.jsxs)("div",{className:"w-full blur-[2px]",children:[(0,s.jsx)(o.Qr,{name:"skill",control:h,defaultValue:"",render:e=>{let{field:{onChange:l,value:a}}=e;return(0,s.jsx)(u.ZP,{isDisabled:!0,components:{IndicatorSeparator:()=>null},isMulti:!0,onChange:e=>{l(e.map(e=>e))},options:[{value:"EC2",label:"EC2"},{value:"IAM",label:"IAM"},{value:"S3",label:"S3"},{value:"Computer",label:"Computer"},{value:"Networking",label:"Networking"},{value:"Security",label:"Security"},{value:"Databases on AWS",label:"Databases on AWS"},{value:"Devops on AWS",label:"Devops on AWS"},{value:"Monitoring and Observability",label:"Monitoring and Observability"},{value:"Business Acumen",label:"Business Acumen"},{value:"Monitoring in the cloud",label:"Monitoring in the cloud"},{value:"Security in the Cloud",label:"Security in the Cloud"},{value:"Threat Detection and Incident Response",label:"Threat Detection and Incident Response"},{value:"Configuration and optimization",label:"Configuration and optimization"},{value:"Infrastructure Automation",label:"Infrastructure Automation"},{value:"Containers",label:"Containers"},{value:"DevOps",label:"DevOps"},{value:"CI/CD",label:"CI/CD"},{value:"IAC",label:"IAC"},{value:"Cloud Infra Deployment",label:"Cloud Infra Deployment"},{value:"Monitoring in the cloud",label:"Monitoring in the cloud"},{value:"Security in the Cloud",label:"Security in the Cloud"}],value:a})}}),j.skill&&(0,s.jsx)("p",{className:"text-red-500",children:j.skill.message})]})]}),(0,s.jsxs)("div",{className:"py-3 flex flex-col",children:[(0,s.jsx)("label",{className:"text text-gray-500",children:"Duration"}),(0,s.jsxs)("div",{className:"w-full",children:[(0,s.jsx)("input",{disabled:!0,type:"number",className:"rounded-lg border-gray-300 w-full blur-[2px]",placeholder:"Duration",...a("duration")}),j.duration&&(0,s.jsx)("p",{className:"text-red-500",children:j.duration.message})]})]}),(0,s.jsxs)("div",{className:"py-3 flex flex-col",children:[(0,s.jsx)("label",{className:"text text-gray-500",children:"Difficulty"}),(0,s.jsxs)("div",{className:"w-full",children:[(0,s.jsxs)("select",{disabled:!0,className:"rounded-lg border-gray-300 w-full p-2 blur-[2px]",...a("difficulty"),children:[(0,s.jsx)("option",{value:"",children:"Select Difficulty"}),(0,s.jsx)("option",{value:"easy",children:"Easy"}),(0,s.jsx)("option",{value:"medium",children:"Medium"}),(0,s.jsx)("option",{value:"hard",children:"Hard"})]}),j.difficulty&&(0,s.jsx)("p",{className:"text-red-500",children:j.difficulty.message})]})]}),(0,s.jsxs)("div",{className:"py-3 flex flex-col",children:[(0,s.jsx)("label",{className:"text",children:"Marks"}),(0,s.jsxs)("div",{className:"w-full",children:[(0,s.jsx)("input",{disabled:!0,className:"rounded-lg border-gray-300 w-full blur-[2px]",type:"number",placeholder:"Marks",value:S,...a("marks")}),j.marks&&(0,s.jsx)("p",{className:"text-red-500",children:j.marks.message})]})]}),(0,s.jsxs)("div",{className:"",children:[(0,s.jsx)("label",{className:"text",children:"Pass Marks"}),(0,s.jsxs)("div",{className:"w-full",children:[(0,s.jsx)("input",{disabled:!0,className:"rounded-lg border-gray-300 w-full blur-[2px]",type:"number",placeholder:"Marks",...a("passMarks",{onChange:e=>{e.target.value>=S&&(e.target.value=S)}})}),j.passMarks&&(0,s.jsx)("p",{className:"text-red-500",children:j.passMarks.message})]})]})]}),(0,s.jsxs)("div",{className:"w-[50%] p-5",children:[(0,s.jsxs)("div",{className:"py-3 flex flex-col",children:[(0,s.jsx)("label",{className:"text text-gray-500",children:"Overview"}),(0,s.jsxs)("div",{className:"w-full blur-[2px]",children:[(0,s.jsx)(o.Qr,{name:"description",control:h,defaultValue:"",render:e=>
1{let{field:{onChange:l,value:a}}=e;return(0,s.jsx)(v,{isDisabled:!0,modules:b,theme:"snow",onChange:e=>{l(e)},value:a})}}),j.description&&(0,s.jsx)("p",{className:"text-red-500",children:j.description.message})]})]}),(0,s.jsxs)("div",{className:"py-3 flex flex-col",children:[(0,s.jsx)("label",{className:"text text-gray-500",children:"Instructions"}),(0,s.jsxs)("div",{className:"w-full blur-[2px]",children:[(0,s.jsx)(o.Qr,{name:"instructions",control:h,defaultValue:"",render:e=>{let{field:{onChange:l,value:a}}=e;return(0,s.jsx)(v,{isDisabled:!0,modules:b,theme:"snow",onChange:e=>{l(e)},value:a})}}),j.instructions&&(0,s.jsx)("p",{className:"text-red-500",children:j.instructions.message})]})]}),(0,s.jsx)("div",{className:"flex justify-between items-center",children:(0,s.jsx)("p",{className:"text text-gray-500",children:"Project Task"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)(o.Qr,{className:" ",name:"task",control:h,render:e=>{let{field:{onChange:l,value:a}}=e;return(0,s.jsx)(u.ZP,{className:"blur-[2px]",isDisabled:!0,options:w,onChange:e=>{l(e.map(e=>e)),M(e.map(e=>e))},components:{IndicatorSeparator:()=>null},isMulti:!0,styles:{menu:e=>({...e,maxHeight:"400px",overflowY:"auto"})},value:a})}}),(0,s.jsxs)("div",{className:"flex w-full items-center justify-end py-8 space-x-4",children:[(0,s.jsxs)("div",{onClick:()=>{e.push("/tenant/projects")},className:"border border-gray-400 rounded-full px-4 py-2 text-gray-400 font-semibold hover:cursor-pointer",children:[" ","Cancel"]}),(0,s.jsx)("input",{className:"border border-blue-500 rounded-full px-4 py-2 text-white font-semibold hover:cursor-pointer bg-blue-500",type:"submit",value:"Update"})]})]})]})]})})]}),(0,s.jsx)(p.Ix,{})]})}}},function(e){e.O(0,[5445,4617,2013,955,3874,1778,260,6556,7627,1664,9961,8749,7536,2554,3157,2405,9389,5935,4528,1635,6859,9774,2888,179],function(){return e(e.s=51229)}),_N_E=e.O()}]);
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.