PageSourceSearch

https://claritycase.ai/assets/OrgReadiness-B1wykZTw.js

js claritycase.ai collected 2026-10-05 04:54:20 UTC 6,455 bytes, 1 lines download raw bytes

1import{s as D,j as e,B as y,a as I,R as M,J as _,n as h,N as F,X as O}from"./index-Cue0MFt4.js";import{r}from"./vendor-charts-DxavT5gT.js";import{A as p}from"./AppPageLayout-BR2WPKZT.js";import{N as x}from"./NoIndex-Ba0R8Ova.js";import{u as P}from"./useOrgAdmin-C5P6bM0h.js";import{C as i,d as l,a as u,b as j,c as f}from"./card-DYYQPyc7.js";import{C as q}from"./checkbox-DAQJzBsC.js";import{S as k}from"./skeleton-82dp_LiS.js";import{A as w,b as C,a as S}from"./alert-BM-v2Qvj.js";import{I as U}from"./info-C2mbUMrC.js";import{M as z}from"./minus-CvJEEIZa.js";import"./vendor-docs-B92Njgx_.js";import"./AppHeader-D3crkVLP.js";import"./index-CYoL9OOK.js";import"./circle-CeJQ5E3_.js";import"./upload-CMCAfVV7.js";import"./shield-CEnIpotW.js";import"./orgTerminology-ZAPr_dxz.js";import"./index-CU2XJOxq.js";const H=[{id:"backup",label:"Backup taken",detail:"A full database backup has been captured and its restore path confirmed."},{id:"secrets",label:"Edge-function secrets set",detail:"Every required secret has been entered in the environment being launched."},{id:"stripe",label:"Stripe live-mode decision made",detail:"The team has decided, in writing, when payments move from test to live mode."},{id:"legal",label:"Legal and privacy review complete",detail:"Terms, privacy policy and professional-use wording have been reviewed and signed off."},{id:"demo",label:"Demo data wiped before production",detail:"The demo organisations, members, files and accounts have been removed."}],J={pass:{label:"Pass",className:"border-primary/40 text-primary",icon:F},fail:{label:"Fail",className:"border-destructive/50 text-destructive",icon:O},skipped:{label:"Skipped",className:"text-muted-foreground",icon:z}};function oe(){const{loading:A,error:T,isOrgAdmin:d,org:g}=P(),[n,b]=r.useState(!1),[a,N]=r.useState(null),[c,v]=r.useState(null),[L,E]=r.useState({}),o=r.useCallback(async()=>{b(!0),v(null);const{data:s,error:t}=await D.functions.invoke("org-readiness");t||!s||s.error?(v(s?.error??"The readiness report could not be generated just now."),N(null)):N(s),b(!1)},[]);if(r.useEffect(()=>{d&&o()},[d,o]),A)return e.jsxs(p,{title:"Loading",width:"xl",children:[e.jsx(x,{title:"Launch readiness | Clarity Case",path:"/org/admin/readiness"}),e.jsx(k,{className:"h-64 w-full"})]});if(!d||!g)return e.jsxs(p,{title:"Readiness unavailable",width:"lg",children:[e.jsx(x,{title:"Launch readiness | Clarity Case",path:"/org/admin/readiness"}),e.jsx(i,{children:e.jsx(l,{className:"py-12 text-center text-sm text-muted-foreground",children:T??"This page is only available to organisation administrators."})})]});const R=a?.checks.filter(s=>s.status==="pass").length??0,B=a?.checks.filter(s=>s.status==="fail").length??0;return e.jsxs(p,{appBarTitle:g.name,title:"Launch readiness",subtitle:"Internal pre-launch checks for the professional workspace. Nothing on this page changes your data.",width:"xl",children:[e.jsx(x,{title:"Launch readiness | Clarity Case",path:"/org/admin/readiness"}),e.jsxs("div",{className:"mb-4 flex flex-wrap items-center gap-3",children:[e.jsx(y,{onClick:()=>void o(),disabled:n,variant:"outline",children:n?e.jsxs(e.Fragment,{children:[e.jsx(I,{className:"mr-2 h-4 w-4 animate-spin"})," Running checks…"]}):e.jsxs(e.Fragment,{children:[e.jsx(M,{className:"mr-2 h-4 w-4"})," Run checks again"]})}),e.jsx(y,{asChild:!0,variant:"ghost",children:e.jsx(_,{to:"/org/admin",children:"Back to the console"})}),a&&e.jsxs("span",{className:"text-sm text-muted-foreground",children:[R," passed · ",B," failed · generated"," ",new Date(a.generated_at).toLocaleString("en-CA")]})]}),c&&e.jsxs(w,{variant:"destructive",className:"mb-4",children:[e.jsx(C,{children:"Checks could not run"}),e.jsx(S,{className:"text-sm",children:c})]}),a&&!a.demo_seeded&&e.jsxs(w,{className:"mb-4",children:[e.jsx(U,{className:"h-4 w-4"}),e.jsx(C,{children:"Demo dataset not detected"}),e.jsx(S,{className:"text-sm",children:"The access-boundary tests need the labelled demo dataset in this environment. Without it, those checks are reported as skipped rather than passed."})]}),e.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[e.jsxs(i,{children:[e.jsxs(u,{className:"pb-3",children:[e.jsx(j,{className:"text-base",children:"Automated checks"}),e.jsx(f,{children:"Access-boundary results come from live test queries run as the demo accounts."})]}),e.jsxs(l,{className:"space-y-3",children:[n&&!a&&e.jsx(k,{className:"h-48 w-full"}),a?.checks.map(s=>{const t=J[s.status],m=t.icon;return e.jsxs("div",{className:"rounded-md border p-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsx("p",{className:"text-sm font-medium leading-snug",children:s.label}),e.jsxs(h,{variant:"outline",className:t.className,children:[e.jsx(m,{className:"mr-1 h-3 w-3"}),t.label]})]}),e.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:s.note})]},s.id)}),!n&&!a&&!c&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"No results yet."})]})]}),e.jsxs("div",{className:"space-y-4",children:[a&&e.jsxs(i,{children:[e.jsxs(u,{className:"pb-3",children:[e.jsx(j,{className:"text-base",children:"Environment"}),e.jsx(f,{children:"Secrets are reported as set or not set. Values are never shown."})]}),e.jsxs(l,{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{children:"Stripe mode"}),e.jsx(h,{variant:"outline",className:"capitalize",children:a.stripe_mode})]}),a.secrets.map(s=>e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"font-mono text-xs",children:s.name}),e.jsx(h,{variant:"outline",className:s.set?"border-primary/40 text-primary":"text-muted-foreground",children:s.set?"Set":"Not set"})]},s.name))]})]}),e.jsxs(i,{children:[e.jsxs(u,{className:"pb-3",children:[e.jsx(j,{className:"text-base",children:"Manual checklist"}),e.jsx(f,{children:"Reminders only. These steps happen outside the app and are not checked automatically."})]}),e.jsx(l,{className:"space-y-3",children:H.map(s=>e.jsxs("label",{className:"flex items-start gap-3 text-sm",children:[e.jsx(q,{checked:!!L[s.id],onCheckedChange:t=>E(m=>({...m,[s.id]:t===!0})),className:"mt-0.5"}),e.jsxs("span",{children:[e.jsx("span",{className:"block font-medium",children:s.label}),e.jsx("span",{className:"block text-xs text-muted-foreground",children:s.detail})]})]},s.id))})]})]})]})]})}export{oe as default};

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.