PageSourceSearch

https://schoolhouse.world/_next/static/chunks/pages/admin/certifications/peer-reviews/[id]-a4920fc82f727796.js

js schoolhouse.world collected 2026-09-24 09:10:38 UTC 8,771 bytes, 7 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[642],{15369:(e,r,i)=>{"use strict";i.d(r,{A:()=>t});class n extends Error{name="PageError";statusCode=400}class t extends n{name="PageNotFoundError";statusCode=404;constructor(e="Oh no! This page does not exist."){super(e)}}},29484:(e,r,i)=>{"use strict";i.r(r),i.d(r,{__N_SSP:()=>z,default:()=>O});var n=i(18153),t=i(42720),l=i(89099),o=i.n(l),s=i(61110),a=i(39955),d=i(59803),c=i(82736),u=i(91921),h=i(76032),p=i(38890),m=i(14232),b=i(76221),A=i(34722),f=i(13792),g=i(2715),w=i(97390),Y=i(76135),x=i(4724),v=i(54443),D=i(15369),y=i(9496),_=i(46304),R=i(46860),F=i(23538),C=i(41130),k=i(46862),E=i(94990),S=i(65956),j=i(68359),N=i(45514);let $="Good job!";function I({id:e}){let r=(0,v.I)(),i=(0,C._)(),t=(0,x.U)(),l=r.one(b.A.where({id:e})),s=l(b.A.id),q=l(b.A.approved_at),T=l(b.A.rejected_at),z=l(b.A.review_reason)??"",O=l(b.A.type),P=l.one(b.A.getUser()),U=l.one(b.A.getReviewer()),V=U(A.A.id),B=U(A.A.username),K=U(A.A.display_name),M=null==V?null:(0,n.FD)(n.FK,{children:[" ","by"," ",(0,n.Y)(R.A,{href:(0,_.dEd)({userId:V,username:B}),children:K})]}),X=l.one(b.A.getTopic()),J=X.one(Y.A.getCourse()),L=l.many(b.A.getReviews()),[W,G]=m.useState(!1),[H,Q]=m.useState(!1),Z=m.useMemo(()=>[{label:"Please try to explain to the person why their submission is being rejected",type:"textarea",name:"reason",placeholder:"Your message here will be sent to the user via email, along with their rejection. Remember to be nice :)",required:!0,size:6}],[]),ee=m.useMemo(()=>[{label:"What comments would you like to share with the tutor?",type:"textarea",name:"reason",placeholder:`These comments will be shared in the approval email with the tutor. If left blank, a "${$}" message will be the default.`,required:!1,size:6}],[]),er=m.useCallback(async e=>{let r=null!=e.reason&&e.reason.length>0?e.reason:$;await y.Ay.admin_approveCertificationRequest({id:s,reason:r}),i({title:`Approved Certification#${s}`,status:"success"}),await o().push("/admin/certifications/peer-reviews/")},[i,s]),ei=m.useCallback(async e=>{await y.Ay.admin_rejectCertificationRequest({id:s,reason:e.reason}),i({title:`Rejected Certification#${s}`,status:"success"}),await o().push("/admin/certifications/peer-reviews/")},[i,s]);if(!t.dryRun&&null==s)throw new D.A("Oh no! This certification request does not exist.");if(!t.dryRun&&O!==w._$j.Video)return(0,n.Y)(a.a,{children:"This isn't a video certification, no action required!"});let en=l(b.A.recording_url);return(0,n.FD)(n.FK,{children:[(0,n.Y)(S.A,{title:"Reject Certification Request",size:"xl",open:W,onClose:()=>G(!1),backgroundColor:"bg.error",body:()=>(0,n.Y)(k.A,{name:"CertificationPeerReviewDetail",blocks:Z,onSubmit:ei})}),(0,n.Y)(S.A,{title:"Approve Certification Request",size:"xl",open:H,onClose:()=>Q(!1),backgroundColor:"bg.info",body:()=>(0,n.Y)(k.A,{name:"CertificationPeerReviewDetail",blocks:ee,onSubmit:er})}),(0,n.FD)(d.s,{flexDir:"row",justifyContent:"space-between",children:[(0,n.FD)(c.D,{size:"3xl",as:"h1",children:["Certification Request #",s]}),null!=T?(0,n.Y)(u.E,{alignItems:"center",color:"fg.error",children:"This certification was rejected!"}):null,null!=q?(0,n.Y)(u.E,{alignItems:"center",color:"fg.success",children:"This certification was approved"}):null]}),(0,n.FD)(d.s,{flexDir:"column",children:[(0,n.FD)(d.s,{flexDir:"column",pt:1,pb:1,borderTop:"1px solid",borderColor:"border",children:[(0,n.FD)(a.a,{children:["Submitted ",(0,n.Y)(j.A,{time:l(b.A.created_at)})]}),(0,n.FD)(a.a,{children:["By ",(0,n.Y)(R.A,{href:`/admin/user/${P(A.A.id)}`,children:P(A.A.display_name)})," in"," ",(0,n.Y)(R.A,{href:`/topic/${X(Y.A.id)}`,children:X(Y.A.name)??""})," /"," ",J(g.A.name)??""]})]}),(0,n.Y)(d.s,{children:(0,n.Y)(a.a,{maxWidth:"768px",my:4,children:(0,n.Y)("video",{src:en??void 0,controls:!0,width:"100%",height:"100%"})})}),null!=T?(0,n.FD)(n.FK,{children:[(0,n.Y)(c.D,{size:"xl",as:"h3",children:"Rejection Details"}),(0,n.FD)(u.E,{alignItems:"center",color:"fg.error",children:["Reason: ",z]}),(0,n.FD)(a.a,{children:["Rejected",M," at ",(0,n.Y)(j.A,{time:T})]})]}):null,null!=q?(0,n.FD)(n.FK,{children:[(0,n.Y)(c.D,{size:"xl",as:"h3",children:"Approval Details"}),(0,n.FD)(u.E,{alignItems:"center",color:"fg.success",children:["Message: ",z]}),(0,n.FD)(a.a,{children:["Approved",M," at ",(0,n.Y)(j.A,{time:q})]})]}):null,(0,n.Y)(N.A,{title:"Peer Reviews",body:()=>(0,n.FD)(a.a,{children:[0===L.length?(0,n.Y)(d.s,{flexDir:"column",pt:1,pb:1,borderTop:"1px solid",borderColor:"border",children:(0,n.Y)(u.E,{children:"No certifications reviews found"})}):null,(0,n.Y)(h.B,{direction:"column",spacing:"12px",children:L.map(e=>{let r=e(f.A.id),i=e(f.A.reviewed_at),t=e(f.A.review_notes),l=e(f.A.review_notes_old),o=e.one(f.A.getReviewer()),s=o(A.A.i
1d)??0,c=o(A.A.username),u=o(A.A.display_name);return(0,n.FD)(d.s,{flexDir:"column",pt:1,pb:1,bg:"bg.subtle",p:"12px",children:[(0,n.Y)(d.s,{flexDir:"column",children:null==i?(0,n.Y)("i",{children:"Review not yet submitted"}):null!=t?(0,n.Y)(E.A,{object:{"Unchecked Items":t.uncheckedItems,"User Feedback":t.userFeedback,"Reported Score":`${Math.round(1e4*t.reportedScore)/100}%`},nullMessage:"No notes",emptyMessage:"No notes",indentValues:!0}):(0,n.Y)(F.A,{text:l??"",maxLines:15})}),(0,n.FD)(a.a,{mt:2,children:["Review By"," ",(0,n.Y)(R.A,{href:(0,_.dEd)({userId:s,username:c}),children:u}),null==i?null:(0,n.FD)(n.FK,{children:[" ","submitted ",(0,n.Y)(j.A,{time:i})]})]})]},r??0)})})]})}),null==q&&null==T?(0,n.FD)(d.s,{flexDir:"row",pt:1,pb:1,mt:"24px",children:[(0,n.Y)(d.s,{flexDir:"row",children:(0,n.Y)(p.$,{onClick:()=>Q(!0),children:"Approve"})}),(0,n.Y)(d.s,{flexDir:"row",ml:1,children:(0,n.Y)(p.$,{bgColor:"error.solid",onClick:()=>G(!0),children:"Reject"})})]}):null]})]})}var q=i(49783);let T=(0,s.A)(function(){let e=(0,l.useRouter)();return(0,n.Y)(q.A,{title:`Certification#${e.query.id}`,children:(0,n.Y)(t.m,{children:(0,n.Y)(I,{id:Number.parseInt(`${e.query.id}`,10)})})})},{authScopes:["admin:certifications:manage"]});var z=!0;let O=T},34722:(e,r,i)=>{"use strict";i.d(r,{A:()=>n});let n={...i(55720).Ay}},45514:(e,r,i)=>{"use strict";i.d(r,{A:()=>u});var n=i(18153),t=i(39955),l=i(82736),o=i(76032),s=i(86623),a=i(44517),d=i(97460),c=i(14232);function u({title:e,body:r,collapsible:i=!1,closeCollapsible:h=!1,asSubsection:p=!1,...m}){let[b,A]=c.useState(!h);return i?(0,n.FD)(t.a,{...m,children:[(0,n.FD)(o.B,{direction:"row",cursor:"pointer",align:"center",onClick:()=>A(e=>!e),spacing:"8px",mt:p?void 0:"48px",children:[(0,n.Y)(l.D,{size:p?"md":"xl",children:e}),(0,n.Y)(d.g,{icon:b?a.Jt$:a.XkK})]}),(0,n.Y)(s.S,{in:b,children:(0,n.Y)(t.a,{mt:"16px",children:r()})})]}):(0,n.FD)(t.a,{...m,children:[(0,n.Y)(l.D,{size:p?"md":"xl",mt:p?void 0:"48px",mb:"16px",children:e}),(0,n.Y)(t.a,{children:r()})]})}},61110:(e,r,i)=>{"use strict";i.d(r,{A:()=>t});var n=i(16425);function t(e,r){return null!=r.userRoles&&r.userRoles.forEach(e=>{if(!e.startsWith("admin:"))throw Error("Cannot expose admin page to non-admins!")}),(0,n.A)(e,{authScopes:r.authScopes,userRoles:r.userRoles,onboardingUsers:"disallowed"})}},76221:(e,r,i)=>{"use strict";i.d(r,{A:()=>s});var n=i(78919),t=i(6869),l=i(13792);let o={...t.Ay,whereUnapprovedRecordings:()=>(0,n.Xs)`
2        ${o.where({reviewed:"unreviewed"})} AND
3        ${o.recording_approved_at} IS NULL
4    `,getReviews:()=>(0,n.Xs)`
5        ${l.A.where({certificationRequestId:o.id})}
6    `},s=o},79452:(e,r,i)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/certifications/peer-reviews/[id]",function(){return i(29484)}])},94990:(e,r,i)=>{"use strict";i.d(r,{A:()=>a});
6var n=i(18153),t=i(76032),l=i(39955),o=i(91921),s=i(23538);function a({object:e,nullMessage:r="No JSON",emptyMessage:i="Empty JSON",indentValues:d=!1}){let c=Object.keys(e||{});return(0,n.Y)(l.a,{children:null==e?(0,n.Y)(o.E,{children:r}):0===c.length?(0,n.Y)(o.E,{children:i}):function e(r,i){return Array.isArray(r)?(0,n.Y)(t.B,{direction:"column",spacing:2,children:r.map(t=>(0,n.Y)(l.a,{p:4,borderRadius:"8px",bg:r.length<=1?"auto":"bg.muted",children:e(t,{border:!0,indentValues:i.indentValues})},`${t}`))}):r instanceof Object?(0,n.Y)(t.B,{spacing:"12px",border:i.border?"2px solid":"none",borderColor:"border.emphasized",children:Object.entries(r).map(([r,t])=>(0,n.FD)(l.a,{children:[(0,n.Y)(l.a,{fontWeight:"bold",mb:"4px",children:r}),(0,n.Y)(l.a,{pl:i.indentValues?"12px":0,children:e(t,{border:!0,indentValues:i.indentValues})})]},r))}):"string"==typeof r?(0,n.Y)(l.a,{children:(0,n.Y)(s.A,{text:r,enableLinks:!0})}):"number"==typeof r?(0,n.Y)(l.a,{children:r}):(0,n.Y)(l.a,{children:JSON.stringify(r)})}(e,{border:!1,indentValues:d})})}}},e=>{e.O(0,[6425,636,6593,8792],()=>e(e.s=79452)),_N_E=e.O()}]);
7//# sourceMappingURL=[id]-a4920fc82f727796.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.