PageSourceSearch

https://clipo.ai/assets/CourseDeletePage-IrJ9pnhS.js

js clipo.ai collected 2026-10-05 11:56:24 UTC 4,526 bytes, 3 lines download raw bytes

1import{a as v,y as w,w as f,x as i,r as l,b as P,c as S,gw as D,j as e,X as T,k as I,o as $,T as q,P as L,n as p,bG as E,e as H,aN as N,aP as A,t as g,D as M,an as F,fh as Q,h3 as R,N as B}from"./index-aREvobyF.js";import{P as G}from"./PageMetaHeader-6lUw-EYb.js";import{S as K}from"./SimpleTable-DF7EMZw0.js";import{P as x,R as y}from"./RequiredCheckbox-CmovvdTt.js";import"./link-box-DcUyRFYn.js";import"./table-BqH1TAsn.js";try{let t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="506167c3-d66c-463c-a322-51b93a80731c",t._sentryDebugIdIdentifier="sentry-dbid-506167c3-d66c-463c-a322-51b93a80731c")}catch{}const O=t=>{const s=["설계 내용"];return t.homework_file_count>0&&s.push("학생 과제물"),t.scoring_count>0&&s.push("채점 내역"),t.feedback_record_count>0&&s.push("채점 내역"),t.has_course_share_comments&&s.push("공동 평가 내역"),s.join(", ")},V=({courseKey:t})=>{const s=v(),c=w(),{data:r}=f(i.courses.detail({courseKey:t})),{data:n}=f(i.courses.detail({courseKey:t})._ctx.deletingConfirm),[u,b]=l.useState(!1),[d,C]=l.useState(!1),a=P(),{mutate:j,isPending:h}=S({mutationFn:()=>D.appsCoursesApiDeleteCourse({courseKey:t})});if(!r||!n)return e.jsx(e.Fragment,{});const m=n.projects.length>0,_=u&&(!m||d),k=()=>{j(void 0,{onSuccess:()=>{a.onClose(),g.create({title:"수업이 삭제되었습니다.",type:"success"}),c.invalidateQueries({queryKey:i.courses.list().queryKey}),c.invalidateQueries({queryKey:i.users.profile._ctx.teacher.queryKey}),s("/teachers/home")},onError:o=>{g.create({title:M(o),type:"error"})}})};return e.jsxs(T,{w:"full",alignItems:"flex-end",rowGap:6,children:[e.jsxs(I,{bg:"white",p:7,rounded:"xl",boxShadow:"sm",rowGap:7,w:"full","data-testid":"course-delete-confirm-content",children:[e.jsx(x,{title:"1. 삭제할 수업과 함께 사라지는 데이터를 확인해 주세요.",description:"수업을 삭제하면 복구할 수 없습니다. 아래 삭제 범위를 꼭 확인해 주세요.",listItems:[{label:"삭제할 수업",value:`${r.name} (${r.year}학년도 ${r.semester}학기)`},{label:"관찰 기록",value:`${n.member_snippet_count}건`,isHighlighted:!0},{label:"수행평가",value:`${n.projects.length}개`,isHighlighted:!0},{label:"세부능력 및 특기사항 기록",value:`${n.course_record_count}명의 기록`,isHighlighted:!0},...n.course_share_comment_count>0?[{label:"공동 평가",value:`댓글 ${n.course_share_comment_count}개`,isHighlighted:!0}]:[]],children:e.jsx(y,{checked:u,onCheckedChange:b,children:"네, 삭제 범위를 확인했습니다."})}),m&&e.jsxs(e.Fragment,{children:[e.jsx($,{}),e.jsxs(x,{title:"2. 삭제되는 수행평가 내의 평가 데이터를 확인해 주세요.",children:[e.jsx(K,{w:"full",tableLayout:"fixed",scrollable:!1,header:{columns:[{key:"name",children:"수행평가명",textAlign:"center",w:"clamp(128px, 40vw, 420px)"},{key:"data",children:"함께 삭제되는 데이터",textAlign:"center",minWidth:"320px"}]},rows:n.projects.map(o=>({key:o.project_name,cells:[{key:"name",children:e.jsx(q,{lineClamp:1,children:o.project_name}),textAlign:"center"},{key:"data",children:O(o),textAlign:"center"}]}))}),e.jsx(y,{checked:d,onCheckedChange:C,children:"네, 삭제 범위를 확인했습니다."})]})]})]}),e.jsxs(L,{justify:"flex-end",gap:3,children:[e.jsxs(p,{circle:!0,variant:"outline",colorPalette:"gray",onClick:()=>s(-1),children:[e.jsx(E,{}),"이전으로"]}),e.jsxs(p,{circle:!0,colorPalette:"red",disabled:!_,loading:h,onClick:a.onOpen,children:[e.jsx(H,{as:N}),"수업 삭제"]})]}),e.jsx(A,{modalType:"negative",title:`정말 ${r.name} 수업을 삭제할까요?`,description:`삭제하면 수업 내의 데이터들이
2모두 영구 삭제되며, 다시 되돌릴 수 없어요.`,cancelButton:{label:"아니오"},confirmButton:{label:"네, 삭제합니다",onConfirm:k,buttonProps:{loading:h}},trigger:{open:a.open,onOpen:a.onOpen,onClose:a.onClose}})]})},Z=()=>{const{courseKey:t}=F(),s=Q(R);return l.useEffect(()=>(s(!1),()=>{s(!0)}),[s]),t?e.jsxs(e.Fragment,{children:[e.jsx(G,{title:"수업 삭제 안내 및 확인",description:"삭제하면 수업의 모든 평가 데이터가 함께 사라지며 복구할 수 없습니다. 삭제되는 데이터를 확인해 주세요.",backLink:"-1"}),e.jsx(V,{courseKey:t})]}):e.jsx(B,{replace:!0,to:"/teachers/home"})};export{Z as default};
3//# sourceMappingURL=CourseDeletePage-IrJ9pnhS.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.