1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1621],{89788:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/dashboard/data/import",function(){return n(15439)}])},15439:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return k}});var a=n(52322),r=n(92642),s=n(2784),i=n(5632),o=n(17993),d=n(77533),l=n(35183),c=n(97166),h=n(28535),u=n(29117),p=n(38035),x=n(69251),m=n(30523),j=n(5115),f=n(98078),g=n(73419),b=n(77245),y=n(38904),w=n(39097),S=n.n(w);function k(){let[e,t]=(0,s.useState)("Employee Feedback Data Import"),[n,r]=(0,s.useState)([]),[i,x]=(0,s.useState)(!1);return(0,a.jsx)(g.$0,{icon:b.MDG,crumbs:[{children:"Dashboard",path:"/dashboard"},{children:"Import Data",isCurrentPage:!0}],children:(0,a.jsx)("form",{id:"add-data-form",children:(0,a.jsxs)(g.LI,{children:[(0,a.jsx)(g.Zb,{title:"Step 1: Name Your Import",children:(0,a.jsxs)(o.g,{spacing:4,align:"stretch",children:[(0,a.jsx)(d.x,{color:"gray.600",children:"Give your import a descriptive name to help you identify it later in your data management."}),(0,a.jsxs)(l.NI,{isRequired:!0,children:[(0,a.jsx)(c.l,{children:"Import Name"}),(0,a.jsx)(j.t7,{defaultValue:e,onChange:e=>t(e.target.value),name:"importName",placeholder:"Employee Feedback Data Import"}),(0,a.jsx)(l.Q6,{children:"Please add a descriptive name to your import for your future reference."})]})]})}),(0,a.jsx)(g.Zb,{title:"Step 2: Upload & Configure CSV Data",children:(0,a.jsxs)(o.g,{spacing:6,align:"stretch",children:[!i&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(h.xu,{children:[(0,a.jsx)(d.x,{color:"gray.600",mb:4,children:"Upload a .csv file with your data. The file should be less than 5MB. Upon uploading, you will be able to configure the import settings in the next steps."}),(0,a.jsxs)(o.g,{spacing:2,align:"start",children:[(0,a.jsxs)(u.U,{children:[(0,a.jsx)(p.k,{userSelect:"none",w:4,rounded:"md",bg:"brand.200",fontSize:"xs",justifyContent:"center",children:"1"}),(0,a.jsx)(d.x,{fontSize:"sm",children:"Choose which row contains your questions"})]}),(0,a.jsxs)(u.U,{children:[(0,a.jsx)(p.k,{userSelect:"none",w:4,rounded:"md",bg:"brand.200",fontSize:"xs",justifyContent:"center",children:"2"}),(0,a.jsx)(d.x,{fontSize:"sm",children:"Select the columns with qualitative data"})]}),(0,a.jsxs)(u.U,{children:[(0,a.jsx)(p.k,{userSelect:"none",w:4,rounded:"md",bg:"brand.200",fontSize:"xs",justifyContent:"center",children:"3"}),(0,a.jsx)(d.x,{fontSize:"sm",children:"Review your data before processing"})]})]})]}),(0,a.jsxs)(u.U,{children:[(0,a.jsx)(d.x,{as:"span",children:"If you're still unsure, "}),(0,a.jsx)(S(),{href:"https://firebasestorage.googleapis.com/v0/b/workplacely-com.appspot.com/o/downlodables%2Fothers%2Fimport%20example.csv?alt=media",passHref:!0,children:(0,a.jsx)(d.x,{color:"blue.500",as:"a",target:"_blank",children:"click here to download an example file"})}),(0,a.jsx)(d.x,{as:"span",children:"it contains the required columns for the import."})]})]}),(0,a.jsx)(y.w,{data:n,setData:r,setStartedImport:x})]})}),(0,a.jsx)(C,{data:n,importName:e})]})})})}function C(e){let{data:t,importName:n}=e,[l,c]=(0,s.useState)(!1),{push:h}=(0,i.useRouter)(),{setNotification:u}=(0,f.lm)();return(0,a.jsx)(g.Zb,{title:"Step 3: Submit Your Data",alert:(0,a.jsxs)(a.Fragment,{children:["You are submitting ",t.length.toLocaleString()," row",1===t.length?"":"s"," of data."]}),children:(0,a.jsxs)(o.g,{spacing:4,align:"stretch",children:[(0,a.jsx)(d.x,{color:"gray.600",fontSize:"sm",children:"Review your import settings above. Once you submit, your data will be processed and added to your dashboard."}),(0,a.jsxs)(x.r,{autoFlow:"column",justifyContent:"end",columnGap:3,children:[(0,a.jsx)(m.P,{children:(0,a.jsx)(j.kq,{onClick:()=>h("/dashboard/data"),children:"Cancel"})}),(0,a.jsx)(m.P,{children:(0,a.jsx)(j.KM,{isLoading:l,onClick:async()=>{try{c(!0);let e=await (await fetch("/api/data",{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(Object.assign({},{data:t},{name:n}))})).json();if(!e)throw Error("Bad response");u({type:"success",title:"Data added",description:"Successfully added data",path:"/dashboard/data"})}catch(e){(0,r.Tb)(e),u(f.FB)}c(!1)},isDisabled:0===t.length,children:"Submit Import"})})]})]})})}k.getLayout=e=>(0,a.jsx)(g.cl,{children:e})}},function(e){e.O(0,[4424,8917,5789,6525,2123,8898,2445,1541,8278,4540,2812,5417,9410,6659,8257,9316,7029,9996,8904,9774,2888,179],function(){return e(e.s=89788)}),_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.