PageSourceSearch

https://schoolhouse.world/_next/static/chunks/pages/admin/templates/session-template/[id]-aa35a9ab2c58ca1e.js

js schoolhouse.world collected 2026-09-24 09:12:13 UTC 7,771 bytes, 2 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4279],{6396:(e,i,n)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/templates/session-template/[id]",function(){return n(11548)}])},11548:(e,i,n)=>{"use strict";n.r(i),n.d(i,{__N_SSP:()=>z,default:()=>B});var t=n(18153),r=n(42720),l=n(82736),s=n(76032),d=n(38890),a=n(87365),o=n(99407),c=n(43043),u=n(2665),h=n(64435),p=n(38993),m=n(52276),T=n(89099),Y=n(14232),A=n(61372),D=n(4724),w=n(54443),S=n(96237),b=n(78919),_=n(61110),x=n(46304),F=n(45514),g=n(27242),I=n(91921),N=n(74175),$=n(9496),f=n(65956);function C({sessionTemplate:e}){let i=(0,T.useRouter)(),[n,r]=(0,Y.useState)(!1),{id:l,seriesTemplate:a}=e,[o,c]=(0,N.A)(async()=>{await $.Ay.admin_deleteSessionTemplate({sessionTemplateId:l}),null!=a?await i.push((0,x.hTK)(`/templates/series-template/${a.id}`)):await i.push((0,x.hTK)("/templates"))},[l,a,i],"Delete Session Template");return(0,t.FD)(t.FK,{children:[(0,t.Y)(d.$,{variant:"danger",onClick:()=>r(!0),children:"Delete Template"}),(0,t.Y)(f.A,{title:"Delete Session Template",open:n,onClose:()=>r(!1),rightFooterContent:()=>(0,t.FD)(s.B,{direction:"row",spacing:"4px",align:"center",children:[(0,t.Y)(d.$,{onClick:()=>r(!1),variant:"outline",children:"Cancel"}),(0,t.Y)(d.$,{variant:"danger",isLoading:c,onClick:async()=>{await o(),r(!1)},children:"Delete"})]}),body:()=>(0,t.Y)(I.E,{children:"Are you sure you want to delete this session template?"})})]})}var E=n(49783),v=n(46860),y=n(82899),k=n(83532),P=n(90799),q=n(97501);let L=(0,_.A)(function(){let e=(0,T.useRouter)(),i=(0,w.I)(),{dryRun:n}=(0,D.U)(),_=Number.parseInt(`${e.query.id}`,10),[I,N]=(0,Y.useState)(!1),$=i.one(A.A.where({id:_,include:[{association:"World",required:!1},{association:"User",required:!0},{association:"SeriesTemplate",required:!1},{association:"Topic",required:!0}]},(0,b.Xs)`${A.A.series_template_id} IS NULL`)),L=(0,q.x7)({sessionTemplate:$}),{title:z,allowCohosts:B,description:K,maxLearners:R,user:U,world:X,curriculum:M,externalDescription:O,startDate:Q,durationMinutes:W,active:V,topic:G,isBreakoutEnabled:H}=L;if(null==$(A.A.id)&&!n)throw new S.L("Session template not found.");return(0,t.Y)(E.A,{title:"Edit Session Templates",children:(0,t.FD)(r.m,{children:[(0,t.FD)(l.D,{size:"2xl",mb:"24px",children:["Session Template: ",z]}),(0,t.Y)(f.A,{size:"3xl",title:"Edit Template",open:I,onClose:()=>N(!1),body:()=>(0,t.Y)(g.A,{sessionTemplate:L,seriesTemplate:L.seriesTemplate,onSubmit:()=>N(!1)})}),(0,t.FD)(s.B,{direction:"row",align:"center",spacing:"8px",children:[(0,t.Y)(v.A,{href:(0,x.hTK)("templates"),children:(0,t.Y)(d.$,{variant:"ghost",leftIcon:(0,t.Y)(y.A,{size:"md",faIcon:m.Wzs}),children:"Templates"})}),(0,t.Y)(a.h,{}),(0,t.Y)(C,{sessionTemplate:L}),(0,t.Y)(d.$,{onClick:()=>N(!0),children:"Edit Template"})]}),(0,t.Y)(F.A,{title:"About Template",body:()=>(0,t.Y)(o.X,{css:(0,p.AH)("td:nth-child(1),td:nth-child(3){font-weight:600;}"),children:(0,t.FD)(c.N,{children:[(0,t.FD)(u.Tr,{children:[(0,t.Y)(h.Td,{children:"Title"}),(0,t.Y)(h.Td,{children:z})]}),(0,t.FD)(u.Tr,{children:[(0,t.Y)(h.Td,{children:"Active?"}),(0,t.Y)(h.Td,{children:V?"Yes":"No"})]}),(0,t.FD)(u.Tr,{children:[(0,t.Y)(h.Td,{children:"Cohosts?"}),(0,t.Y)(h.Td,{children:B?"Yes":"No"})]}),(0,t.FD)(u.Tr,{children:[(0,t.Y)(h.Td,{children:"User"}),(0,t.Y)(h.Td,{children:(0,t.Y)(v.A,{href:(0,x.hTK)(`user/${U.id}`),children:U.displayName})})]}),(0,t.FD)(u.Tr,{children:[(0,t.Y)(h.Td,{children:"Topic"}),(0,t.Y)(h.Td,{children:G?.name??"N/A"})]}),(0,t.FD)(u.Tr,{children:[(0,t.Y)(h.Td,{children:"Max Learners"}),(0,t.Y)(h.Td,{children:R})]}),(0,t.FD)(u.Tr,{children:[(0,t.Y)(h.Td,{children:"Subworld"}),(0,t.Y)(h.Td,{children:X?.title??"N/A"})]}),(0,t.FD)(u.Tr,{children:[(0,t.Y)(h.Td,{children:"Start Date"}),(0,t.Y)(h.Td,{children:(0,t.Y)(P.A,{time:Q?.toISO()??null})})]}),(0,t.FD)(u.Tr,{children:[(0,t.Y)(h.Td,{children:"Duration"}),(0,t.Y)(h.Td,{children:W})]}),(0,t.FD)(u.Tr,{children:[(0,t.Y)(h.Td,{children:"External Description"}),(0,t.Y)(h.Td,{children:null==O?"N/A":(0,t.Y)(k.A,{content:O})})]}),(0,t.FD)(u.Tr,{children:[(0,t.Y)(h.Td,{children:"Description"}),(0,t.Y)(h.Td,{children:(0,t.Y)(k.A,{content:K})})]}),(0,t.FD)(u.Tr,{children:[(0,t.Y)(h.Td,{children:"Curriculum"}),(0,t.Y)(h.Td,{children:null==M?"N/A":(0,t.Y)(k.A,{content:M})})]}),(0,t.FD)(u.Tr,{children:[(0,t.Y)(h.Td,{children:"Breakouts Enabled?"}),(0,t.Y)(h.Td,{children:H?"Yes":"No"})]})]})})})]})})},{authScopes:["admin:templates:manage"]});var z=!0;let B=L},15369:(e,i,n)=>{"use strict";n.d(i,{A:()=>r});
1class t extends Error{name="PageError";statusCode=400}class r extends t{name="PageNotFoundError";statusCode=404;constructor(e="Oh no! This page does not exist."){super(e)}}},27242:(e,i,n)=>{"use strict";n.d(i,{A:()=>T});var t=n(18153),r=n(14232),l=n(19515),s=n(2715),d=n(56294),a=n(85562),o=n(54443),c=n(9496),u=n(20646),h=n(84141),p=n(62887),m=n(46862);function T({sessionTemplate:e,seriesTemplate:i,onSubmit:n=l.fZ}){let Y=(0,o.I)(),A=Y.many(s.A.getCoursesAndTopicsSelectInputs({})).map(e=>({domain:e(s.A.input__domain)??"",label:e(s.A.input__label)??"",options:e(s.A.input__options)??[]})),D=Y.many(a.A.where({order:[[a.A.position,"asc"]]})).map(e=>({label:e(a.A.title)??"",value:`${e(a.A.id)}`})),w=(0,r.useMemo)(()=>(0,u.qG)({sessionTemplate:e,topicOptions:A,worldOptions:D,seriesTemplate:i}),[e,A,i,D]),S=(0,r.useCallback)(async t=>{let r=String(t.attendancePolicy),l=(0,d.q)(r)?r:"optional",s={seriesTemplateId:i?.id??null,title:`${t.title}`,description:t.description,externalDescription:null==t.externalDescription||0===`${t.externalDescription}`.length?null:t.externalDescription,curriculum:null==t.curriculum||0===`${t.curriculum}`.length?null:t.curriculum,questionnaire:(0,p.Q)(null==t.welcomeQuestion?null:`${t.welcomeQuestion}`),startDate:null!=t.date&&null!=t.time?(0,h.iX)({date:`${t.date}`,duration:`${t.durationMinutes}`,time:`${t.time}`}).start:null,durationMinutes:Number.parseInt(`${t.durationMinutes}`,10),topicId:null==t.topicId||""===t.topicId?null:Number.parseInt(`${t.topicId}`,10),allowCohosts:"yes"===t.allowCohosts,active:"yes"===t.active,worldId:""===t.worldId?null:Number.parseInt(`${t.worldId}`,10),maxLearners:Number.parseInt(`${t.maxLearners}`,10),seriesPosition:null==t.seriesPosition?null:Number.parseInt(`${t.seriesPosition}`,10),attendancePolicy:l,isBreakoutEnabled:"yes"===t.isBreakoutEnabled};null==e||null==e.id?await c.Vf.admin_createSessionTemplate(s):await c.Vf.admin_editSessionTemplate({sessionTemplateId:e.id,...s}),n()},[e,i,n]);return(0,t.Y)(m.A,{name:"CreateOrUpdateSessionTemplate",blocks:w,onSubmit:S})}},45514:(e,i,n)=>{"use strict";n.d(i,{A:()=>u});var t=n(18153),r=n(39955),l=n(82736),s=n(76032),d=n(86623),a=n(44517),o=n(97460),c=n(14232);function u({title:e,body:i,collapsible:n=!1,closeCollapsible:h=!1,asSubsection:p=!1,...m}){let[T,Y]=c.useState(!h);return n?(0,t.FD)(r.a,{...m,children:[(0,t.FD)(s.B,{direction:"row",cursor:"pointer",align:"center",onClick:()=>Y(e=>!e),spacing:"8px",mt:p?void 0:"48px",children:[(0,t.Y)(l.D,{size:p?"md":"xl",children:e}),(0,t.Y)(o.g,{icon:T?a.Jt$:a.XkK})]}),(0,t.Y)(d.S,{in:T,children:(0,t.Y)(r.a,{mt:"16px",children:i()})})]}):(0,t.FD)(r.a,{...m,children:[(0,t.Y)(l.D,{size:p?"md":"xl",mt:p?void 0:"48px",mb:"16px",children:e}),(0,t.Y)(r.a,{children:i()})]})}},61110:(e,i,n)=>{"use strict";n.d(i,{A:()=>r});var t=n(16425);function r(e,i){return null!=i.userRoles&&i.userRoles.forEach(e=>{if(!e.startsWith("admin:"))throw Error("Cannot expose admin page to non-admins!")}),(0,t.A)(e,{authScopes:i.authScopes,userRoles:i.userRoles,onboardingUsers:"disallowed"})}},96237:(e,i,n)=>{"use strict";n.d(i,{L:()=>t.A});var t=n(15369)}},e=>{e.O(0,[6425,636,6593,8792],()=>e(e.s=6396)),_N_E=e.O()}]);
2//# sourceMappingURL=[id]-aa35a9ab2c58ca1e.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.