@capagents/forgeqe 2.6.6 → 2.6.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/forgeqe.js +1336 -1336
- package/dist/web/assets/{Agent-DEt3EWA_.js → Agent-CwOEhl3M.js} +2 -2
- package/dist/web/assets/{ApiTests-DYdaFLNz.js → ApiTests-ebwSDQ5F.js} +2 -2
- package/dist/web/assets/{Chat-CKxzWgEC.js → Chat-fc4s0KBG.js} +1 -1
- package/dist/web/assets/Data-BBSVyXif.js +3 -0
- package/dist/web/assets/Evidence-xQn-8UJ5.js +1 -0
- package/dist/web/assets/{Features-DCT-cbJc.js → Features-DMprjJBi.js} +1 -1
- package/dist/web/assets/{Jobs-DeTQrrks.js → Jobs-C5JjDoQC.js} +2 -2
- package/dist/web/assets/{KindPage-_X13FTTE.js → KindPage-Gf-RWsx6.js} +1 -1
- package/dist/web/assets/{Migration-fmIj_G3z.js → Migration-Cbc7TAP9.js} +1 -1
- package/dist/web/assets/Product-B6SRmrz4.js +1 -0
- package/dist/web/assets/Quality-DfcLg8mD.js +1 -0
- package/dist/web/assets/{Record-BxvtM3w6.js → Record-BDZoXfKO.js} +1 -1
- package/dist/web/assets/{Regression-DMzaMaHl.js → Regression-F1U3vWLw.js} +2 -2
- package/dist/web/assets/{Reports-DcOPRMjx.js → Reports-C2r9-5sZ.js} +1 -1
- package/dist/web/assets/Response-BGXyV_fV.js +4 -0
- package/dist/web/assets/Runs--yZ27eAW.js +2 -0
- package/dist/web/assets/Shell-DFE3OHxz.js +3 -0
- package/dist/web/assets/{TestCases-COdZhCPY.js → TestCases-BE_KAXkn.js} +1 -1
- package/dist/web/assets/{TestData-BorHzvQT.js → TestData-BY-Uy6yE.js} +1 -1
- package/dist/web/assets/{WhatsNew-Bc9JhLJC.js → WhatsNew-CDUGGomx.js} +1 -1
- package/dist/web/assets/{arrow-down-OOnlMKAE.js → arrow-down-DNipP8bN.js} +1 -1
- package/dist/web/assets/{arrow-right-B3tcUlkA.js → arrow-right-3diDdbrG.js} +1 -1
- package/dist/web/assets/circle-2Nb63Bbk.js +1 -0
- package/dist/web/assets/{circle-dashed-kZh6s667.js → circle-dashed-KlSRxdRt.js} +1 -1
- package/dist/web/assets/{circle-dot-B5NyEMK3.js → circle-dot-CyXWfSFI.js} +1 -1
- package/dist/web/assets/{dataParts-C9gI1SAK.js → dataParts-CqEfwqh-.js} +1 -1
- package/dist/web/assets/{index-BxNs3KZC.js → index-j5ulUL9f.js} +4 -4
- package/dist/web/assets/index-tEriRdXB.css +2 -0
- package/dist/web/assets/{keyboard-Chpodklu.js → keyboard-DLO6H_RC.js} +1 -1
- package/dist/web/assets/{pencil-BKPpdCqf.js → pencil-q2eQBct0.js} +1 -1
- package/dist/web/assets/{productParts-RYNeN2sM.js → productParts-CCIZ-xzs.js} +1 -1
- package/dist/web/assets/{qualityParts-BtCR-0Bc.js → qualityParts-Bhq6Zhdf.js} +1 -1
- package/dist/web/assets/thread-DJKWZFQL.js +5 -0
- package/dist/web/assets/{upload-A3zIIPtY.js → upload-OfrEvr0l.js} +1 -1
- package/dist/web/assets/{usePageChat-D-iqArIy.js → usePageChat-BaearoXT.js} +1 -1
- package/dist/web/index.html +3 -3
- package/package.json +1 -1
- package/dist/web/assets/Data-DityccKX.js +0 -3
- package/dist/web/assets/Evidence-B-LwSbo6.js +0 -1
- package/dist/web/assets/Product-D-WBRE7V.js +0 -1
- package/dist/web/assets/Quality-CGVs0dP9.js +0 -1
- package/dist/web/assets/Response-C6MFROng.js +0 -4
- package/dist/web/assets/Runs-Bzt7oS2o.js +0 -2
- package/dist/web/assets/Shell-C-_iUijV.js +0 -3
- package/dist/web/assets/circle-8GDOF-jD.js +0 -1
- package/dist/web/assets/index-o-gUBlx9.css +0 -2
- package/dist/web/assets/thread-BVeiwKSf.js +0 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Bt as e,Di as t,Ht as n,J as r,K as i,Lr as a,Mn as o,Si as s,U as c,Ur as l,W as u,Wt as d,X as f,Zt as p,_r as m,ct as h,et as g,hn as _,n as v,ot as y,vt as b,wi as x,yi as S}from"./Shell-C-_iUijV.js";import{s as C,t as w,z as T}from"./index-BxNs3KZC.js";import{t as E}from"./when-CHnpLdYw.js";var D={name:`list-todo`,size:24,node:[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`rect`,{x:`3`,y:`4`,width:`6`,height:`6`,rx:`1`,key:`cif1o7`}]]};D.node;var O=a(D),k=t(x(),1),A=s(),j=[{id:`azure_devops`,label:`Azure DevOps`},{id:`jira`,label:`Jira`},{id:`testrail`,label:`TestRail`},{id:`zephyr`,label:`Zephyr Scale`},{id:`qtest`,label:`qTest`}],M=e=>j.some(t=>t.id===e),N=e=>e&&C(e)===`web`?e:void 0,P=(e,t)=>`${e} ${t}${e===1?``:`s`}`,F=e=>`${e.kind}:${e.id}`;function I(e){return e.found===`reuse`||e.kind===`link`?`Link`:e.found===`extends`||e.kind===`extend`?`Add ${P((e.insert??[]).reduce((e,t)=>e+t.steps.length,0),`step`)}`:`Update steps`}function L(e,t){let n=`Story ${t} asks for it: ${e.wrote}`,r=e.link?{link:!0}:{};return e.kind===`link`?{kind:`link`,id:e.id}:e.kind===`extend`?{kind:`extend`,id:e.id,insert:e.insert??[],reason:n,...r}:{kind:`update`,id:e.id,steps:e.steps??[],reason:n,...r}}function R(){let[e,t]=(0,k.useState)(j.map(e=>e.id)),[n,r]=(0,k.useState)(``);return(0,k.useEffect)(()=>{l.settings().then(e=>{let n=e.config.sources??{},r=j.map(e=>e.id).filter(e=>n[e]&&typeof n[e]==`object`);r.length&&t(r)},e=>r(`The settings could not be read, so every system is offered: ${e.message}`))},[]),{systems:j.filter(t=>e.includes(t.id)),error:n}}function z({id:e,icon:t,title:r,children:i}){return(0,A.jsxs)(`section`,{"aria-labelledby":e,className:`flex min-w-0 flex-col gap-3`,children:[(0,A.jsxs)(`h2`,{id:e,className:`m-0 flex items-center gap-2 text-lg font-semibold`,children:[(0,A.jsx)(n,{icon:t,size:18,className:`text-accent-fg`}),r]}),i]})}function B({view:t,onApplied:n,onError:a}){let[s,l]=(0,k.useState)([]),[f,h]=(0,k.useState)(null),[g,v]=(0,k.useState)(!1),[y,b]=(0,k.useState)(null),x=t.story.id,C=t.proposals.filter(e=>s.includes(F(e))),w=async()=>{let e=C.map(e=>L(e,x));v(!0);try{let n=await S.preview(t.system,x,e);h({lines:n.lines,changes:e}),a(``)}catch(e){a(e.message)}finally{v(!1)}},D=async()=>{if(f){v(!0);try{let e=await S.apply(t.system,x,f.changes);b({applied:e.applied,failed:e.failed}),h(null),l([]),a(``),n()}catch(e){a(e.message)}finally{v(!1)}}},M=N(t.story.url);return(0,A.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-6`,children:[(0,A.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,A.jsxs)(`p`,{className:`m-0 flex flex-wrap items-center gap-2 text-lg font-semibold [overflow-wrap:anywhere]`,children:[M?(0,A.jsxs)(`a`,{href:M,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1`,children:[x,(0,A.jsx)(T,{size:14,"aria-hidden":`true`})]}):(0,A.jsx)(`span`,{children:x}),t.story.title&&(0,A.jsx)(`span`,{className:`font-normal text-ink-2`,children:t.story.title})]}),t.changed&&(0,A.jsxs)(`p`,{className:`m-0 text-[13px] text-muted`,"data-tip":new Date(t.changed.when).toLocaleString(),children:[`The story's `,t.changed.field,` changed `,E(t.changed.when),`.`]})]}),(0,A.jsx)(z,{id:`cases-h`,icon:o,title:`Linked cases`,children:(0,A.jsx)(c,{label:`Linked cases`,empty:`No test case is linked to this story.`,head:(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`th`,{className:i,children:`Case`}),(0,A.jsx)(`th`,{className:i,children:`Title`}),(0,A.jsx)(`th`,{className:d(i,`text-right`),children:`Steps`}),(0,A.jsx)(`th`,{className:i,children:`State`})]}),children:t.cases.map(e=>{let t=N(e.url);return(0,A.jsxs)(`tr`,{className:r,children:[(0,A.jsx)(`td`,{className:d(u,`whitespace-nowrap`),children:t?(0,A.jsxs)(`a`,{href:t,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1`,children:[e.id,(0,A.jsx)(T,{size:12,"aria-hidden":`true`})]}):e.id}),(0,A.jsx)(`td`,{className:d(u,`[overflow-wrap:anywhere]`),children:e.title}),(0,A.jsx)(`td`,{className:d(u,`text-right tabular-nums`),children:e.steps}),(0,A.jsx)(`td`,{className:d(u,e.stale?`text-warn`:`text-muted`),children:e.stale?(0,A.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,A.jsx)(p,{size:13,"aria-hidden":`true`,className:`flex-none`}),`older than the story's last change`]}):e.changed?(0,A.jsxs)(`span`,{"data-tip":new Date(e.changed).toLocaleString(),children:[`changed `,E(e.changed)]}):`–`})]},e.id)})})}),(0,A.jsx)(z,{id:`criteria-h`,icon:m,title:`Acceptance criteria`,children:(0,A.jsx)(c,{label:`Acceptance criteria`,empty:`No acceptance criteria were read for this story.`,head:(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`th`,{className:i,children:`Criterion`}),(0,A.jsx)(`th`,{className:i,children:`Cases`})]}),children:t.criteria.map((e,t)=>(0,A.jsxs)(`tr`,{className:r,children:[(0,A.jsx)(`td`,{className:d(u,`[overflow-wrap:anywhere]`),children:e.text}),(0,A.jsx)(`td`,{className:d(u,e.cases.length?`text-ink-2`:`text-warn`),children:e.cases.length?e.cases.join(`, `):`no case`})]},t))})}),(0,A.jsxs)(z,{id:`proposals-h`,icon:O,title:`Proposed changes`,children:[(0,A.jsx)(c,{label:`Proposed changes`,empty:`No change is waiting. save_test_cases in a chat proposes them.`,tools:(0,A.jsxs)(e,{size:`sm`,variant:`primary`,disabled:g||!C.length||!!f,onClick:()=>void w(),children:[`Review `,P(C.length,`change`)]}),head:(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`th`,{className:d(i,`w-10`),children:(0,A.jsx)(`span`,{className:`sr-only`,children:`Pick`})}),(0,A.jsx)(`th`,{className:i,children:`Change`}),(0,A.jsx)(`th`,{className:i,children:`Existing case`}),(0,A.jsx)(`th`,{className:i,children:`The agent wrote`})]}),children:t.proposals.map(e=>{let t=F(e);return(0,A.jsxs)(`tr`,{className:r,children:[(0,A.jsx)(`td`,{className:u,children:(0,A.jsx)(`input`,{type:`checkbox`,"aria-label":`${I(e)}: ${e.id} ${e.title}`,checked:s.includes(t),disabled:g||!!f,onChange:e=>l(e.target.checked?[...s,t]:s.filter(e=>e!==t)),className:`size-5 flex-none accent-accent`})}),(0,A.jsxs)(`td`,{className:d(u,`whitespace-nowrap font-medium`),children:[I(e),e.link&&e.kind!==`link`&&(0,A.jsx)(`span`,{className:`block text-[12px] font-normal text-muted`,children:`and link it`})]}),(0,A.jsxs)(`td`,{className:d(u,`[overflow-wrap:anywhere]`),children:[(0,A.jsx)(`span`,{className:`font-mono text-[12px] text-ink-2`,children:e.id}),` `,e.title]}),(0,A.jsx)(`td`,{className:d(u,`text-ink-2 [overflow-wrap:anywhere]`),children:e.wrote})]},t)})}),f&&(0,A.jsxs)(`div`,{role:`alertdialog`,"aria-label":`Apply the changes`,className:`flex flex-col gap-2 rounded-[10px] border border-accent-line bg-accent-soft p-3 text-[13px]`,children:[(0,A.jsxs)(`span`,{className:`font-medium`,children:[`Apply `,P(f.changes.length,`change`),` to `,j.find(e=>e.id===t.system)?.label,`?`]}),(0,A.jsx)(`ul`,{className:`m-0 flex flex-col gap-1 pl-5 text-ink-2`,children:f.lines.map((e,t)=>(0,A.jsx)(`li`,{className:`[overflow-wrap:anywhere]`,children:e},t))}),(0,A.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,A.jsx)(e,{size:`sm`,variant:`primary`,disabled:g,onClick:()=>void D(),children:`Apply`}),(0,A.jsx)(e,{size:`sm`,disabled:g,onClick:()=>h(null),children:`Cancel`})]})]}),y&&y.applied.length>0&&(0,A.jsxs)(`p`,{role:`status`,className:`m-0 text-[13px] text-pass`,children:[`Applied: `,y.applied.join(`, `)]}),y&&y.failed.length>0&&(0,A.jsxs)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-3 py-2 text-[13px] text-fail [overflow-wrap:anywhere]`,children:[`Not applied: `,y.failed.map(e=>`${e.id||`a change`}: ${e.error}`).join(`; `)]})]}),(0,A.jsx)(z,{id:`changes-h`,icon:_,title:`Recent changes`,children:t.changes.length?(0,A.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0 text-[13px] text-ink-2`,children:t.changes.map((e,t)=>(0,A.jsx)(`li`,{className:`[overflow-wrap:anywhere]`,children:e},t))}):(0,A.jsx)(`p`,{className:`m-0 text-[13px] text-muted`,children:`ForgeQE has not changed this story's cases.`})}),t.notes.map((e,t)=>(0,A.jsx)(`p`,{className:`m-0 text-[13px] text-muted [overflow-wrap:anywhere]`,children:e},t))]})}function V({sub:t}){let{systems:r,error:i}=R(),a=t?t.indexOf(`/`):-1,s=a>0?t.slice(0,a):t,c=M(s)?s:void 0,l=c&&a>0?decodeURIComponent(t.slice(a+1)):``,[u,p]=(0,k.useState)(c??`azure_devops`),[m,_]=(0,k.useState)(l),[x,C]=(0,k.useState)(null),[T,E]=(0,k.useState)(``),[D,O]=(0,k.useState)(!1);(0,k.useEffect)(()=>{c&&p(c),_(l)},[c,l]),(0,k.useEffect)(()=>{!c&&r.length&&!r.some(e=>e.id===u)&&p(r[0].id)},[r,u,c]);let j=(0,k.useCallback)(()=>{!c||!l?C(null):(O(!0),S.view(c,l).then(e=>{C(e),E(``),O(!1)},e=>{E(e.message),O(!1)}))},[c,l]);return(0,k.useEffect)(()=>C(null),[c,l]),(0,k.useEffect)(j,[j]),(0,A.jsxs)(`div`,{className:`flex min-h-screen flex-col`,children:[(0,A.jsx)(v,{}),(0,A.jsxs)(`main`,{className:d(w,`@container flex-auto gap-4`),children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,A.jsx)(b,{pixel:y[`test-cases`],size:`lg`}),(0,A.jsx)(`h1`,{className:`m-0 text-[26px] font-semibold tracking-[-0.01em]`,children:`Test cases`})]}),(0,A.jsxs)(`p`,{className:`m-0 max-w-[80ch] text-[13px] leading-relaxed text-muted`,children:[`A story's test cases in your test management system: which are older than the story's last change, which acceptance criteria no case covers, and the changes save_test_cases proposed. Tick the ones to make; nothing is written until you review and apply them. The tests that run them are on `,(0,A.jsx)(`a`,{href:h(`regression`),children:`Regression`}),`; their results on `,(0,A.jsx)(`a`,{href:h(`runs`),children:`Runs`}),`.`]}),(0,A.jsxs)(`form`,{onSubmit:e=>{e.preventDefault();let t=m.trim();if(!t)return;let n=h(`test-cases`,u,encodeURIComponent(t));location.hash===n?j():location.hash=n},className:`flex flex-col gap-3`,children:[(0,A.jsx)(`div`,{role:`group`,"aria-label":`System`,className:`flex flex-wrap gap-1.5`,children:(0,A.jsx)(f,{items:r,value:u,onChange:p})}),(0,A.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3`,children:[(0,A.jsxs)(`label`,{className:`flex min-w-0 flex-[0_1_320px] flex-col gap-1 text-[13px] font-medium`,children:[`Story`,(0,A.jsx)(g,{value:m,maxLength:120,spellCheck:!1,placeholder:u===`azure_devops`?`1234`:u===`qtest`?`5678`:u===`testrail`?`R12`:`SHOP-12`,onChange:e=>_(e.target.value)})]}),(0,A.jsx)(e,{type:`submit`,variant:`primary`,disabled:!m.trim()||D,children:`Open`})]})]}),[i,T].filter(Boolean).map(e=>(0,A.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-3 py-2 text-[13px] text-fail [overflow-wrap:anywhere]`,children:e},e)),D&&(0,A.jsx)(`p`,{role:`status`,className:`m-0 text-[13px] text-muted`,children:`Loading…`}),x&&(0,A.jsx)(B,{view:x,onApplied:j,onError:E},`${x.system}:${x.story.id}`),!l&&!x&&(0,A.jsxs)(`div`,{className:`flex flex-col items-start gap-3 rounded-[14px] border border-dashed border-line p-5`,children:[(0,A.jsx)(n,{icon:o,size:22,className:`text-muted`}),(0,A.jsx)(`p`,{className:`m-0 max-w-[62ch] text-[13.5px] leading-relaxed text-ink-2`,children:`No story opened yet. Pick the system and type a story's id to see its linked test cases, its acceptance criteria and which cases trace to them. When save_test_cases runs in a chat for a story, the changes it proposes to existing cases show here to apply.`})]})]})]})}export{V as TestCases};
|
|
1
|
+
import{Bt as e,Di as t,Ht as n,J as r,K as i,Lr as a,Mn as o,Si as s,U as c,Ur as l,W as u,Wt as d,X as f,Zt as p,_r as m,ct as h,et as g,hn as _,n as v,ot as y,vt as b,wi as x,yi as S}from"./Shell-DFE3OHxz.js";import{s as C,t as w,z as T}from"./index-j5ulUL9f.js";import{t as E}from"./when-CHnpLdYw.js";var D={name:`list-todo`,size:24,node:[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`rect`,{x:`3`,y:`4`,width:`6`,height:`6`,rx:`1`,key:`cif1o7`}]]};D.node;var O=a(D),k=t(x(),1),A=s(),j=[{id:`azure_devops`,label:`Azure DevOps`},{id:`jira`,label:`Jira`},{id:`testrail`,label:`TestRail`},{id:`zephyr`,label:`Zephyr Scale`},{id:`qtest`,label:`qTest`}],M=e=>j.some(t=>t.id===e),N=e=>e&&C(e)===`web`?e:void 0,P=(e,t)=>`${e} ${t}${e===1?``:`s`}`,F=e=>`${e.kind}:${e.id}`;function I(e){return e.found===`reuse`||e.kind===`link`?`Link`:e.found===`extends`||e.kind===`extend`?`Add ${P((e.insert??[]).reduce((e,t)=>e+t.steps.length,0),`step`)}`:`Update steps`}function L(e,t){let n=`Story ${t} asks for it: ${e.wrote}`,r=e.link?{link:!0}:{};return e.kind===`link`?{kind:`link`,id:e.id}:e.kind===`extend`?{kind:`extend`,id:e.id,insert:e.insert??[],reason:n,...r}:{kind:`update`,id:e.id,steps:e.steps??[],reason:n,...r}}function R(){let[e,t]=(0,k.useState)(j.map(e=>e.id)),[n,r]=(0,k.useState)(``);return(0,k.useEffect)(()=>{l.settings().then(e=>{let n=e.config.sources??{},r=j.map(e=>e.id).filter(e=>n[e]&&typeof n[e]==`object`);r.length&&t(r)},e=>r(`The settings could not be read, so every system is offered: ${e.message}`))},[]),{systems:j.filter(t=>e.includes(t.id)),error:n}}function z({id:e,icon:t,title:r,children:i}){return(0,A.jsxs)(`section`,{"aria-labelledby":e,className:`flex min-w-0 flex-col gap-3`,children:[(0,A.jsxs)(`h2`,{id:e,className:`m-0 flex items-center gap-2 text-lg font-semibold`,children:[(0,A.jsx)(n,{icon:t,size:18,className:`text-accent-fg`}),r]}),i]})}function B({view:t,onApplied:n,onError:a}){let[s,l]=(0,k.useState)([]),[f,h]=(0,k.useState)(null),[g,v]=(0,k.useState)(!1),[y,b]=(0,k.useState)(null),x=t.story.id,C=t.proposals.filter(e=>s.includes(F(e))),w=async()=>{let e=C.map(e=>L(e,x));v(!0);try{let n=await S.preview(t.system,x,e);h({lines:n.lines,changes:e}),a(``)}catch(e){a(e.message)}finally{v(!1)}},D=async()=>{if(f){v(!0);try{let e=await S.apply(t.system,x,f.changes);b({applied:e.applied,failed:e.failed}),h(null),l([]),a(``),n()}catch(e){a(e.message)}finally{v(!1)}}},M=N(t.story.url);return(0,A.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-6`,children:[(0,A.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,A.jsxs)(`p`,{className:`m-0 flex flex-wrap items-center gap-2 text-lg font-semibold [overflow-wrap:anywhere]`,children:[M?(0,A.jsxs)(`a`,{href:M,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1`,children:[x,(0,A.jsx)(T,{size:14,"aria-hidden":`true`})]}):(0,A.jsx)(`span`,{children:x}),t.story.title&&(0,A.jsx)(`span`,{className:`font-normal text-ink-2`,children:t.story.title})]}),t.changed&&(0,A.jsxs)(`p`,{className:`m-0 text-[13px] text-muted`,"data-tip":new Date(t.changed.when).toLocaleString(),children:[`The story's `,t.changed.field,` changed `,E(t.changed.when),`.`]})]}),(0,A.jsx)(z,{id:`cases-h`,icon:o,title:`Linked cases`,children:(0,A.jsx)(c,{label:`Linked cases`,empty:`No test case is linked to this story.`,head:(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`th`,{className:i,children:`Case`}),(0,A.jsx)(`th`,{className:i,children:`Title`}),(0,A.jsx)(`th`,{className:d(i,`text-right`),children:`Steps`}),(0,A.jsx)(`th`,{className:i,children:`State`})]}),children:t.cases.map(e=>{let t=N(e.url);return(0,A.jsxs)(`tr`,{className:r,children:[(0,A.jsx)(`td`,{className:d(u,`whitespace-nowrap`),children:t?(0,A.jsxs)(`a`,{href:t,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1`,children:[e.id,(0,A.jsx)(T,{size:12,"aria-hidden":`true`})]}):e.id}),(0,A.jsx)(`td`,{className:d(u,`[overflow-wrap:anywhere]`),children:e.title}),(0,A.jsx)(`td`,{className:d(u,`text-right tabular-nums`),children:e.steps}),(0,A.jsx)(`td`,{className:d(u,e.stale?`text-warn`:`text-muted`),children:e.stale?(0,A.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,A.jsx)(p,{size:13,"aria-hidden":`true`,className:`flex-none`}),`older than the story's last change`]}):e.changed?(0,A.jsxs)(`span`,{"data-tip":new Date(e.changed).toLocaleString(),children:[`changed `,E(e.changed)]}):`–`})]},e.id)})})}),(0,A.jsx)(z,{id:`criteria-h`,icon:m,title:`Acceptance criteria`,children:(0,A.jsx)(c,{label:`Acceptance criteria`,empty:`No acceptance criteria were read for this story.`,head:(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`th`,{className:i,children:`Criterion`}),(0,A.jsx)(`th`,{className:i,children:`Cases`})]}),children:t.criteria.map((e,t)=>(0,A.jsxs)(`tr`,{className:r,children:[(0,A.jsx)(`td`,{className:d(u,`[overflow-wrap:anywhere]`),children:e.text}),(0,A.jsx)(`td`,{className:d(u,e.cases.length?`text-ink-2`:`text-warn`),children:e.cases.length?e.cases.join(`, `):`no case`})]},t))})}),(0,A.jsxs)(z,{id:`proposals-h`,icon:O,title:`Proposed changes`,children:[(0,A.jsx)(c,{label:`Proposed changes`,empty:`No change is waiting. save_test_cases in a chat proposes them.`,tools:(0,A.jsxs)(e,{size:`sm`,variant:`primary`,disabled:g||!C.length||!!f,onClick:()=>void w(),children:[`Review `,P(C.length,`change`)]}),head:(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`th`,{className:d(i,`w-10`),children:(0,A.jsx)(`span`,{className:`sr-only`,children:`Pick`})}),(0,A.jsx)(`th`,{className:i,children:`Change`}),(0,A.jsx)(`th`,{className:i,children:`Existing case`}),(0,A.jsx)(`th`,{className:i,children:`The agent wrote`})]}),children:t.proposals.map(e=>{let t=F(e);return(0,A.jsxs)(`tr`,{className:r,children:[(0,A.jsx)(`td`,{className:u,children:(0,A.jsx)(`input`,{type:`checkbox`,"aria-label":`${I(e)}: ${e.id} ${e.title}`,checked:s.includes(t),disabled:g||!!f,onChange:e=>l(e.target.checked?[...s,t]:s.filter(e=>e!==t)),className:`size-5 flex-none accent-accent`})}),(0,A.jsxs)(`td`,{className:d(u,`whitespace-nowrap font-medium`),children:[I(e),e.link&&e.kind!==`link`&&(0,A.jsx)(`span`,{className:`block text-[12px] font-normal text-muted`,children:`and link it`})]}),(0,A.jsxs)(`td`,{className:d(u,`[overflow-wrap:anywhere]`),children:[(0,A.jsx)(`span`,{className:`font-mono text-[12px] text-ink-2`,children:e.id}),` `,e.title]}),(0,A.jsx)(`td`,{className:d(u,`text-ink-2 [overflow-wrap:anywhere]`),children:e.wrote})]},t)})}),f&&(0,A.jsxs)(`div`,{role:`alertdialog`,"aria-label":`Apply the changes`,className:`flex flex-col gap-2 rounded-[10px] border border-accent-line bg-accent-soft p-3 text-[13px]`,children:[(0,A.jsxs)(`span`,{className:`font-medium`,children:[`Apply `,P(f.changes.length,`change`),` to `,j.find(e=>e.id===t.system)?.label,`?`]}),(0,A.jsx)(`ul`,{className:`m-0 flex flex-col gap-1 pl-5 text-ink-2`,children:f.lines.map((e,t)=>(0,A.jsx)(`li`,{className:`[overflow-wrap:anywhere]`,children:e},t))}),(0,A.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,A.jsx)(e,{size:`sm`,variant:`primary`,disabled:g,onClick:()=>void D(),children:`Apply`}),(0,A.jsx)(e,{size:`sm`,disabled:g,onClick:()=>h(null),children:`Cancel`})]})]}),y&&y.applied.length>0&&(0,A.jsxs)(`p`,{role:`status`,className:`m-0 text-[13px] text-pass`,children:[`Applied: `,y.applied.join(`, `)]}),y&&y.failed.length>0&&(0,A.jsxs)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-3 py-2 text-[13px] text-fail [overflow-wrap:anywhere]`,children:[`Not applied: `,y.failed.map(e=>`${e.id||`a change`}: ${e.error}`).join(`; `)]})]}),(0,A.jsx)(z,{id:`changes-h`,icon:_,title:`Recent changes`,children:t.changes.length?(0,A.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0 text-[13px] text-ink-2`,children:t.changes.map((e,t)=>(0,A.jsx)(`li`,{className:`[overflow-wrap:anywhere]`,children:e},t))}):(0,A.jsx)(`p`,{className:`m-0 text-[13px] text-muted`,children:`ForgeQE has not changed this story's cases.`})}),t.notes.map((e,t)=>(0,A.jsx)(`p`,{className:`m-0 text-[13px] text-muted [overflow-wrap:anywhere]`,children:e},t))]})}function V({sub:t}){let{systems:r,error:i}=R(),a=t?t.indexOf(`/`):-1,s=a>0?t.slice(0,a):t,c=M(s)?s:void 0,l=c&&a>0?decodeURIComponent(t.slice(a+1)):``,[u,p]=(0,k.useState)(c??`azure_devops`),[m,_]=(0,k.useState)(l),[x,C]=(0,k.useState)(null),[T,E]=(0,k.useState)(``),[D,O]=(0,k.useState)(!1);(0,k.useEffect)(()=>{c&&p(c),_(l)},[c,l]),(0,k.useEffect)(()=>{!c&&r.length&&!r.some(e=>e.id===u)&&p(r[0].id)},[r,u,c]);let j=(0,k.useCallback)(()=>{!c||!l?C(null):(O(!0),S.view(c,l).then(e=>{C(e),E(``),O(!1)},e=>{E(e.message),O(!1)}))},[c,l]);return(0,k.useEffect)(()=>C(null),[c,l]),(0,k.useEffect)(j,[j]),(0,A.jsxs)(`div`,{className:`flex min-h-screen flex-col`,children:[(0,A.jsx)(v,{}),(0,A.jsxs)(`main`,{className:d(w,`@container flex-auto gap-4`),children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,A.jsx)(b,{pixel:y[`test-cases`],size:`lg`}),(0,A.jsx)(`h1`,{className:`m-0 text-[26px] font-semibold tracking-[-0.01em]`,children:`Test cases`})]}),(0,A.jsxs)(`p`,{className:`m-0 max-w-[80ch] text-[13px] leading-relaxed text-muted`,children:[`A story's test cases in your test management system: which are older than the story's last change, which acceptance criteria no case covers, and the changes save_test_cases proposed. Tick the ones to make; nothing is written until you review and apply them. The tests that run them are on `,(0,A.jsx)(`a`,{href:h(`regression`),children:`Regression`}),`; their results on `,(0,A.jsx)(`a`,{href:h(`runs`),children:`Runs`}),`.`]}),(0,A.jsxs)(`form`,{onSubmit:e=>{e.preventDefault();let t=m.trim();if(!t)return;let n=h(`test-cases`,u,encodeURIComponent(t));location.hash===n?j():location.hash=n},className:`flex flex-col gap-3`,children:[(0,A.jsx)(`div`,{role:`group`,"aria-label":`System`,className:`flex flex-wrap gap-1.5`,children:(0,A.jsx)(f,{items:r,value:u,onChange:p})}),(0,A.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3`,children:[(0,A.jsxs)(`label`,{className:`flex min-w-0 flex-[0_1_320px] flex-col gap-1 text-[13px] font-medium`,children:[`Story`,(0,A.jsx)(g,{value:m,maxLength:120,spellCheck:!1,placeholder:u===`azure_devops`?`1234`:u===`qtest`?`5678`:u===`testrail`?`R12`:`SHOP-12`,onChange:e=>_(e.target.value)})]}),(0,A.jsx)(e,{type:`submit`,variant:`primary`,disabled:!m.trim()||D,children:`Open`})]})]}),[i,T].filter(Boolean).map(e=>(0,A.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-3 py-2 text-[13px] text-fail [overflow-wrap:anywhere]`,children:e},e)),D&&(0,A.jsx)(`p`,{role:`status`,className:`m-0 text-[13px] text-muted`,children:`Loading…`}),x&&(0,A.jsx)(B,{view:x,onApplied:j,onError:E},`${x.system}:${x.story.id}`),!l&&!x&&(0,A.jsxs)(`div`,{className:`flex flex-col items-start gap-3 rounded-[14px] border border-dashed border-line p-5`,children:[(0,A.jsx)(n,{icon:o,size:22,className:`text-muted`}),(0,A.jsx)(`p`,{className:`m-0 max-w-[62ch] text-[13.5px] leading-relaxed text-ink-2`,children:`No story opened yet. Pick the system and type a story's id to see its linked test cases, its acceptance criteria and which cases trace to them. When save_test_cases runs in a chat for a story, the changes it proposes to existing cases show here to apply.`})]})]})]})}export{V as TestCases};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Bt as e,Di as t,Ei as n,En as r,G as i,Gt as a,Ht as o,K as s,Lr as c,Si as l,U as u,Vt as d,W as f,Wt as p,X as m,Xn as h,Xr as g,Y as _,at as v,ct as y,et as b,n as x,ot as S,q as C,qr as w,tt as T,vt as E,w as D,wi as O,xr as k,yr as A}from"./Shell-
|
|
1
|
+
import{Bt as e,Di as t,Ei as n,En as r,G as i,Gt as a,Ht as o,K as s,Lr as c,Si as l,U as u,Vt as d,W as f,Wt as p,X as m,Xn as h,Xr as g,Y as _,at as v,ct as y,et as b,n as x,ot as S,q as C,qr as w,tt as T,vt as E,w as D,wi as O,xr as k,yr as A}from"./Shell-DFE3OHxz.js";import{a as j,c as M,f as ee,i as N,n as P,o as F,p as I,r as L,s as R,t as z,u as B}from"./dataParts-CqEfwqh-.js";import{M as V,t as H}from"./index-j5ulUL9f.js";import{t as U}from"./when-CHnpLdYw.js";var W={name:`sprout`,size:24,node:[[`path`,{d:`M14 9.536V7a4 4 0 0 1 4-4h1.5a.5.5 0 0 1 .5.5V5a4 4 0 0 1-4 4 4 4 0 0 0-4 4c0 2 1 3 1 5a5 5 0 0 1-1 3`,key:`139s4v`}],[`path`,{d:`M4 9a5 5 0 0 1 8 4 5 5 0 0 1-8-4`,key:`1dlkgp`}],[`path`,{d:`M5 21h14`,key:`11awu3`}]]};W.node;var G=c(W),K=n({Requests:()=>$,TestData:()=>ie}),q=t(O(),1),J=l(),Y=[`requests`,`kept`,`specs`,`batches`],X={fetch:`kept`,request:`requests`,gen:`specs`,files:`specs`,insert:`specs`,batches:`batches`,clean:`batches`},Z=e=>Object.values(e.row_counts||{}).reduce((e,t)=>e+t,0);function Q({e:t,kept:n,busy:r,act:i}){return(0,J.jsxs)(`div`,{className:`flex flex-col gap-4 px-1 py-2`,children:[(0,J.jsxs)(`dl`,{className:`m-0 grid grid-cols-[max-content_1fr] gap-x-4 gap-y-1 text-[13px]`,children:[(0,J.jsx)(`dt`,{className:`text-muted`,children:`Asked for`}),(0,J.jsx)(`dd`,{className:`m-0 [overflow-wrap:anywhere]`,children:t.need}),(0,J.jsx)(`dt`,{className:`text-muted`,children:`When`}),(0,J.jsxs)(`dd`,{className:`m-0`,children:[new Date(t.at).toLocaleString(),t.ms===void 0?``:` · answered in ${(t.ms/1e3).toFixed(1)} s`]}),(0,J.jsx)(`dt`,{className:`text-muted`,children:`How`}),(0,J.jsxs)(`dd`,{className:`m-0`,children:[t.source===`fetch`?`A kept request fetched again, with no model`:`Asked the DB agent for ${t.asked===`existing`?`existing rows`:t.asked===`new`?`new rows`:`either`}`,t.name?(0,J.jsxs)(J.Fragment,{children:[` · `,(0,J.jsx)(`span`,{className:`font-mono text-[12px]`,children:t.name})]}):null]}),t.why&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`dt`,{className:`text-muted`,children:`The answer`}),(0,J.jsx)(`dd`,{className:`m-0`,children:t.why})]})]}),t.error&&(0,J.jsx)(M,{text:t.error}),Object.entries(t.sample||{}).map(([e,n])=>(0,J.jsx)(B,{title:e===`result`?`Rows found`:e,rows:n,total:t.row_counts?.[e]??n.length},e)),t.sql&&(0,J.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,J.jsx)(`span`,{className:`text-sm font-medium`,children:`The query`}),(0,J.jsx)(P,{label:`SQL`,children:t.sql})]}),t.script_preview?.length?(0,J.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,J.jsx)(`span`,{className:`text-sm font-medium`,children:`INSERT script`}),(0,J.jsx)(P,{label:`INSERT script`,children:t.script_preview.join(`
|
|
2
2
|
`)})]}):null,n&&t.name&&(0,J.jsx)(`div`,{children:(0,J.jsxs)(e,{size:`sm`,disabled:r,onClick:()=>i(`fetch`,{name:t.name}),children:[(0,J.jsx)(I,{size:14,"aria-hidden":`true`}),`Fetch again`]})})]})}function $({view:e,log:t,busy:n,act:r}){let[a,o]=(0,q.useState)(`all`),[c,l]=(0,q.useState)(``),[d,h]=(0,q.useState)(``),[g,b]=(0,q.useState)(``),x=t??[],S=(0,q.useMemo)(()=>[...new Set(x.map(e=>e.requester))].sort(),[t]),w=(0,q.useMemo)(()=>[...new Set(x.map(e=>e.database).filter(Boolean))].sort(),[t]),E=x.filter(e=>!e.ok).length,D=x.filter(e=>(a===`all`||a===`ok`===e.ok)&&(!c||e.requester===c)&&(!d||e.database===d)),O=new Set(e.requests.map(e=>e.name));return t===null?(0,J.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading the requests…`}):x.length?(0,J.jsx)(u,{label:`Requests`,resetKey:`${a}|${c}|${d}`,minWidth:760,fixed:!0,placeholder:`Find a request`,tools:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(m,{value:a,onChange:o,items:[{id:`all`,label:`All`,n:x.length},{id:`ok`,label:`Answered`,n:x.length-E},{id:`failed`,label:`Failed`,n:E,alert:!0}]}),S.length>1&&(0,J.jsxs)(T,{"aria-label":`Who asked`,value:c,onChange:e=>l(e.target.value),className:`h-8 w-[180px] text-[13px]`,children:[(0,J.jsx)(`option`,{value:``,children:`Anyone`}),S.map(e=>(0,J.jsx)(`option`,{children:e},e))]}),w.length>1&&(0,J.jsxs)(T,{"aria-label":`Database`,value:d,onChange:e=>h(e.target.value),className:`h-8 w-[160px] text-[13px]`,children:[(0,J.jsx)(`option`,{value:``,children:`Any database`}),w.map(e=>(0,J.jsx)(`option`,{children:e},e))]})]}),head:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`th`,{className:p(s,`w-9`),children:(0,J.jsx)(`span`,{className:`sr-only`,children:`Open`})}),(0,J.jsx)(`th`,{className:p(s,`w-[110px]`),children:`When`}),(0,J.jsx)(`th`,{className:p(s,`w-[150px]`),children:`Who asked`}),(0,J.jsx)(`th`,{className:s,children:`What for`}),(0,J.jsx)(`th`,{className:p(s,`w-[110px]`),children:`Database`}),(0,J.jsx)(`th`,{className:p(s,`w-[140px]`),children:`Answer`}),(0,J.jsx)(`th`,{className:p(C,`w-[70px]`),children:`Rows`})]}),empty:`No requests match these filters. Pick All and Anyone to see every request.`,children:D.map(e=>{let t=g===e.id;return(0,J.jsxs)(q.Fragment,{children:[(0,J.jsxs)(`tr`,{className:p(_,t&&`bg-surface-muted`),onClick:()=>b(t?``:e.id),children:[(0,J.jsx)(`td`,{className:p(f,`pr-0`),children:(0,J.jsx)(`button`,{type:`button`,"aria-expanded":t,"aria-label":t?`Close the request`:`Open the request`,onClick:n=>(n.stopPropagation(),b(t?``:e.id)),className:`flex cursor-pointer items-center border-0 bg-transparent p-0 text-muted`,children:t?(0,J.jsx)(k,{size:16,"aria-hidden":`true`}):(0,J.jsx)(A,{size:16,"aria-hidden":`true`})})}),(0,J.jsx)(`td`,{className:p(f,`whitespace-nowrap text-muted`),"data-tip":new Date(e.at).toLocaleString(),children:U(e.at)}),(0,J.jsx)(`td`,{className:p(f,`truncate`),"data-tip":e.requester,children:e.requester}),(0,J.jsxs)(`td`,{className:p(f,`truncate`),"data-tip":e.need,children:[e.need,e.source===`fetch`?(0,J.jsx)(`span`,{className:`text-muted`,children:` · fetched again`}):null]}),(0,J.jsx)(`td`,{className:p(f,`truncate`),"data-tip":e.database,children:e.database||(0,J.jsx)(`span`,{className:`text-muted`,children:`—`})}),(0,J.jsx)(`td`,{className:p(f,`whitespace-nowrap`),children:(0,J.jsx)(v,{tone:e.ok?`pass`:`fail`,children:e.ok?F[e.kind||``]||`Answered`:`Failed`})}),(0,J.jsx)(`td`,{className:i,children:e.ok?Z(e):``})]}),t&&(0,J.jsx)(`tr`,{className:`border-t border-line-soft bg-surface-muted/40`,children:(0,J.jsx)(`td`,{colSpan:7,className:`max-w-0 px-4 py-2`,children:(0,J.jsx)(Q,{e,kept:!!e.name&&O.has(e.name),busy:n,act:r})})})]},e.id)})}):(0,J.jsxs)(`p`,{className:`m-0 rounded-[12px] card border px-4 py-3 text-sm text-muted`,children:[`No test data was asked for yet. The agents ask before a test runs, or `,(0,J.jsx)(`a`,{href:y(`data`,`ask`,`test-data`),children:`ask for test data`}),` yourself.`]})}function te({view:t,job:n,busy:r,act:i,onNote:o}){let s=n&&!n.running&&n.kind===`fetch`?n:null,c=s?.result;return(0,J.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,J.jsx)(`p`,{className:`m-0 max-w-[70ch] text-sm leading-relaxed text-muted`,children:`Each request is kept in test-data/requests with its query or INSERT script. Fetch one again to get the same data with no model: a query reads the rows there now, a spec makes the same rows.`}),s&&(0,J.jsxs)(`section`,{"aria-label":`Fetched ${s.target}`,className:`flex flex-col gap-3 rounded-[14px] card border p-4`,children:[(0,J.jsx)(`h2`,{className:`m-0 text-base font-semibold [overflow-wrap:anywhere]`,children:s.target}),c&&!c.ok&&(0,J.jsx)(M,{text:c.error||`It could not fetch the data.`}),c?.ok&&(0,J.jsx)(z,{r:c,onNote:o})]}),t.requests.length===0?(0,J.jsxs)(`p`,{className:`m-0 rounded-[12px] card border px-4 py-3 text-sm text-muted`,children:[`No kept requests yet. Each request the DB agent answers is kept here; `,(0,J.jsx)(`a`,{href:y(`data`,`ask`,`test-data`),children:`ask for test data`}),` to make the first.`]}):(0,J.jsx)(R,{items:t.requests,text:e=>`${e.need} ${e.name} ${e.database} ${e.requester||``}`,label:`Kept requests`,size:15,children:t=>(0,J.jsxs)(`li`,{className:`flex min-h-[52px] flex-wrap items-center gap-3 border-t border-line-soft py-2.5 text-sm first:border-t-0`,children:[(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-[1_1_280px] flex-col gap-0.5`,children:[(0,J.jsx)(`span`,{className:`text-[14px] font-medium [overflow-wrap:anywhere]`,children:t.need}),(0,J.jsxs)(`span`,{className:`text-[12px] text-muted [overflow-wrap:anywhere]`,children:[(0,J.jsx)(`span`,{className:`font-mono`,children:t.name}),` · `,t.database,` · `,F[t.kind],t.rows?` · ${a(t.rows,`row`)}`:``,t.created?` · ${U(t.created)}`:``,t.requester?` · asked by ${t.requester}`:``]})]}),(0,J.jsxs)(e,{size:`sm`,disabled:r,onClick:()=>i(`fetch`,{name:t.name}),children:[(0,J.jsx)(I,{size:14,"aria-hidden":`true`}),`Fetch again`]})]},t.name)})]})}function ne({view:t,job:n,busy:i,act:a,onNote:s}){let[c,l]=(0,q.useState)(t.specs[0]??``),[u,d]=(0,q.useState)(``),[f,p]=(0,q.useState)(``),[m,g]=(0,q.useState)(`csv`),[_,v]=(0,q.useState)(!1),x={spec:c,...u?{db:u}:{},...f?{seed:f}:{}},S=n&&!n.running?n:null,C=S&&[`gen`,`files`,`insert`].includes(S.kind)&&S.target===c?S.result:void 0,E=t.databases.find(e=>e.name===u),D=async()=>{try{let{id:e}=await w.start(`Write a test data spec for this project (a YAML file with tables: under test-data/), from the database's schema. Show me the spec and a preview before you save it.`,{});location.hash=y(`chats`,e)}catch(e){s(e.message)}};return(0,J.jsxs)(`section`,{"aria-labelledby":`spec-h`,className:`flex flex-col gap-4`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-2`,children:[(0,J.jsxs)(`h2`,{id:`spec-h`,className:`m-0 flex flex-1 items-center gap-2 text-lg font-semibold`,children:[(0,J.jsx)(o,{icon:h,size:18,className:`text-accent-fg`}),`Make test data from a spec`]}),(0,J.jsxs)(e,{variant:`ghost`,onClick:()=>void D(),children:[(0,J.jsx)(o,{icon:r,size:16}),`Write a spec in a chat`]})]}),(0,J.jsx)(`p`,{className:`m-0 max-w-[70ch] text-sm leading-relaxed text-muted`,children:`A spec is a YAML file with tables: and what goes in each column. The same spec and seed make the same data again, so a test or a pipeline can rely on it. No model is used.`}),t.specs.length===0?(0,J.jsx)(`p`,{className:`m-0 rounded-[12px] card border px-4 py-3 text-sm text-muted`,children:`No specs in this project yet: a YAML file with tables: in test-data/, data/ or specs/. Write one in a chat, from a database's schema.`}):(0,J.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-[14px] card border p-4`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,J.jsxs)(`label`,{className:`flex min-w-0 flex-[2_1_260px] flex-col gap-1.5 text-sm font-medium`,children:[`Spec`,(0,J.jsx)(T,{value:c,onChange:e=>l(e.target.value),children:t.specs.map(e=>(0,J.jsx)(`option`,{children:e},e))})]}),(0,J.jsxs)(`label`,{className:`flex min-w-0 flex-[1_1_180px] flex-col gap-1.5 text-sm font-medium`,children:[`Database`,(0,J.jsxs)(T,{value:u,onChange:e=>d(e.target.value),children:[(0,J.jsx)(`option`,{value:``,children:`The spec's own`}),t.databases.map(e=>(0,J.jsxs)(`option`,{value:e.name,children:[e.name,e.writable?``:` (read only)`]},e.name))]})]}),(0,J.jsxs)(`label`,{className:`flex w-[120px] flex-col gap-1.5 text-sm font-medium`,children:[`Seed`,(0,J.jsx)(b,{value:f,inputMode:`numeric`,placeholder:`Random`,onChange:e=>p(e.target.value.replace(/\D/g,``).slice(0,9))})]})]}),(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsxs)(e,{variant:_?void 0:`primary`,disabled:i||!c,onClick:()=>a(`gen`,x),children:[(0,J.jsx)(o,{icon:h,size:16}),`Preview`]}),(0,J.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,J.jsx)(e,{disabled:i||!c,onClick:()=>a(`gen`,{...x,mode:`files`,format:m}),children:`Write files`}),(0,J.jsx)(T,{"aria-label":`File format`,value:m,onChange:e=>g(e.target.value),className:`w-[88px]`,children:[`csv`,`json`,`sql`].map(e=>(0,J.jsx)(`option`,{children:e},e))})]}),(0,J.jsxs)(e,{disabled:i||!c||!E?.writable,"data-tip":E?.writable?void 0:`Pick a writable database to insert into`,onClick:()=>v(!0),children:[(0,J.jsx)(G,{size:16,"aria-hidden":`true`}),`Insert into `,E?.writable?E.name:`a database`]})]}),_&&E&&(0,J.jsxs)(`div`,{role:`alertdialog`,"aria-label":`Insert test data`,className:`flex flex-col gap-3 rounded-[12px] border border-warn bg-warn-soft p-4`,children:[(0,J.jsxs)(`span`,{className:`font-medium`,children:[`Insert the rows of `,c,` into `,E.name,`?`]}),(0,J.jsx)(`span`,{className:`text-sm text-ink-2`,children:`They go in as one batch, which you can remove again under Batches. Only on a test database.`}),(0,J.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,J.jsx)(e,{variant:`primary`,onClick:()=>{v(!1),a(`gen`,{...x,mode:`insert`,confirmed:!0})},children:`Insert`}),(0,J.jsx)(e,{onClick:()=>v(!1),children:`Don't insert`})]})]}),C&&!C.ok&&(0,J.jsx)(M,{text:C.error||`It did not make the data.`}),C?.ok&&(0,J.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[C.batch&&(0,J.jsxs)(`p`,{className:`m-0 rounded-[12px] bg-pass-soft px-3 py-2 text-sm text-pass`,children:[`Inserted as batch `,(0,J.jsx)(`span`,{className:`font-mono text-[13px]`,children:C.batch}),`.`]}),C.files?.length?(0,J.jsxs)(`p`,{className:`m-0 flex flex-wrap items-center gap-2 text-sm`,children:[`Wrote`,C.files.map(e=>(0,J.jsx)(L,{file:e,onNote:s},e))]}):null,(0,J.jsx)(N,{r:C})]})]})]})}function re({view:t,job:n,busy:r,act:i}){let a=t.databases.filter(e=>e.writable),[s,c]=(0,q.useState)(a[0]?.name??``),[l,u]=(0,q.useState)(``),d=n&&!n.running?n:null,f=d?.kind===`batches`?(Array.isArray(d.result)?d.result.flatMap(e=>e.batches||[]):d.result?.batches)??[]:null;return(0,J.jsxs)(`section`,{"aria-labelledby":`batch-h`,className:`flex flex-col gap-3`,children:[(0,J.jsxs)(`h2`,{id:`batch-h`,className:`m-0 flex items-center gap-2 text-lg font-semibold`,children:[(0,J.jsx)(o,{icon:G,size:18,className:`text-accent-fg`}),`Inserted batches`]}),(0,J.jsx)(`p`,{className:`m-0 max-w-[70ch] text-sm leading-relaxed text-muted`,children:`Rows inserted from a spec go in as a batch. Remove a batch to take exactly those rows out again, children first.`}),a.length===0?(0,J.jsx)(`p`,{className:`m-0 rounded-[12px] card border px-4 py-3 text-sm text-muted`,children:`No writable database: test data is inserted only into one marked writable in Settings, Databases.`}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsx)(T,{"aria-label":`Database`,value:s,onChange:e=>c(e.target.value),className:`w-[220px]`,children:a.map(e=>(0,J.jsx)(`option`,{children:e.name},e.name))}),(0,J.jsx)(e,{disabled:r||!s,onClick:()=>i(`batches`,{db:s}),children:`List batches`})]}),f&&f.length===0&&(0,J.jsxs)(`p`,{className:`m-0 text-sm text-muted`,children:[`No batches in `,d?.target,`.`]}),f&&f.length>0&&(0,J.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:f.map(t=>(0,J.jsxs)(`li`,{className:`flex min-h-[52px] flex-wrap items-center gap-3 border-t border-line-soft py-2.5 text-sm first:border-t-0`,children:[(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-[1_1_240px] flex-col gap-0.5`,children:[(0,J.jsx)(`span`,{className:`font-mono text-[13px]`,children:t.batch}),(0,J.jsxs)(`span`,{className:`text-[12px] text-muted`,children:[(0,J.jsx)(`span`,{"data-tip":new Date(t.created).toLocaleString(),children:U(t.created)}),t.spec?` · ${t.spec}`:``,` ·`,` `,Object.entries(t.rows).map(([e,t])=>`${e} ${t}`).join(`, `)]})]}),l===t.batch?(0,J.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,J.jsxs)(`span`,{className:`text-[13px] text-warn`,children:[`Remove its rows from `,d?.target,`?`]}),(0,J.jsx)(e,{size:`sm`,className:`border-fail text-fail hover:bg-fail-soft`,onClick:()=>{u(``),i(`clean`,{db:d?.target,batch:t.batch,confirmed:!0})},children:`Remove`}),(0,J.jsx)(e,{size:`sm`,onClick:()=>u(``),children:`Keep`})]}):(0,J.jsxs)(e,{size:`sm`,disabled:r,onClick:()=>u(t.batch),children:[(0,J.jsx)(V,{size:14,"aria-hidden":`true`}),`Remove`]})]},t.batch))}),d?.kind===`clean`&&d.result?.ok&&(0,J.jsxs)(`p`,{className:`m-0 rounded-[12px] bg-pass-soft px-3 py-2 text-sm text-pass`,children:[`Removed:`,` `,Object.entries(d.result.removed||{}).map(([e,t])=>`${e} ${t}`).join(`, `)]})]})]})}function ie({sub:e}){let{view:t,error:n,busy:r,act:i,stop:o,job:s}=ee(),[c,l]=(0,q.useState)(null),[u,f]=(0,q.useState)(``),m=Y.includes(e)?e:`requests`,_=s&&!s.running?s.endedAt:``;(0,q.useEffect)(()=>{g.log().then(l,e=>f(e.message))},[_]);let v=(c||[]).filter(e=>!e.ok).length,b=new Set((c||[]).map(e=>e.requester)).size,C={requests:`Requests${c?` (${c.length})`:``}`,kept:`Kept${t?` (${t.requests.length})`:``}`,specs:`Specs${t?` (${t.specs.length})`:``}`,batches:`Batches`};return(0,J.jsxs)(`div`,{className:`flex min-h-screen flex-col`,children:[(0,J.jsx)(x,{}),(0,J.jsxs)(`main`,{className:p(H,`@container flex-auto gap-4`),children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,J.jsx)(E,{pixel:S[`test-data`],size:`lg`}),(0,J.jsx)(`h1`,{className:`m-0 flex-1 text-[26px] font-semibold tracking-[-0.01em]`,children:`Test data`}),(0,J.jsxs)(`a`,{href:y(`data`,`ask`,`test-data`),className:p(d(),`no-underline`),children:[(0,J.jsx)(h,{size:16,"aria-hidden":`true`}),`Ask for test data`]})]}),(0,J.jsx)(`p`,{className:`m-0 max-w-[74ch] text-sm leading-relaxed text-muted`,children:`Every request for test data: which agent asked, what for, when, and what the DB agent sent back. Kept requests fetch the same data again with no model; specs make data you can insert as batches and remove again.`}),c&&c.length>0&&(0,J.jsxs)(`p`,{className:`m-0 text-sm text-ink-2 tabular-nums`,children:[a(c.length,`request`),` · `,a(b,`asker`),` · `,(0,J.jsxs)(`span`,{className:v?`text-fail`:``,children:[v,` failed`]}),t?` · ${t.requests.length} kept`:``]}),(n||u)&&(0,J.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:n||u}),!t&&!n&&(0,J.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`}),t&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(D,{label:`Test data`,current:m,onPick:e=>location.hash=y(`test-data`,e),tabs:Y.map(e=>({id:e,label:C[e]}))}),s&&(s.running?X[s.kind]!==void 0:X[s.kind]===m)&&(0,J.jsx)(j,{job:s,onStop:o}),(0,J.jsxs)(`div`,{role:`tabpanel`,id:`panel-${m}`,"aria-labelledby":`tab-${m}`,children:[m===`requests`&&(0,J.jsx)($,{view:t,log:c,busy:r,act:i}),m===`kept`&&(0,J.jsx)(te,{view:t,job:s,busy:r,act:i,onNote:f}),m===`specs`&&(0,J.jsx)(ne,{view:t,job:s,busy:r,act:i,onNote:f}),m===`batches`&&(0,J.jsx)(re,{view:t,job:s,busy:r,act:i})]})]})]})]})}export{K as n,$ as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Di as e,Gt as t,Si as n,Wt as r,at as i,n as a,ot as o,vt as s,wi as c,yr as l,yt as u}from"./Shell-
|
|
1
|
+
import{Di as e,Gt as t,Si as n,Wt as r,at as i,n as a,ot as o,vt as s,wi as c,yr as l,yt as u}from"./Shell-DFE3OHxz.js";import{t as d}from"./arrow-right-3diDdbrG.js";import{d as f,f as p,l as m,p as h,t as g,u as _}from"./index-j5ulUL9f.js";var v=e(c(),1),y=n(),b={new:{label:`New`,tone:`running`},improved:{label:`Improved`,tone:`neutral`},fixed:{label:`Fixed`,tone:`pass`}};function x({change:e,id:t,first:n}){let[a,o]=(0,v.useState)(!1),s=f(e);return(0,y.jsxs)(`li`,{className:r(!n&&`border-t border-line-soft`),children:[(0,y.jsxs)(`button`,{type:`button`,"aria-expanded":a,"aria-controls":t,onClick:()=>o(!a),className:`flex min-h-11 w-full cursor-pointer items-center gap-3 border-0 bg-transparent px-3 py-2.5 text-left text-sm text-ink hover:bg-surface-muted`,children:[(0,y.jsx)(i,{tone:b[e.kind].tone,icon:!1,className:`w-[76px] justify-center`,children:b[e.kind].label}),(0,y.jsx)(`span`,{className:`min-w-0 flex-1 font-medium [overflow-wrap:anywhere]`,children:e.title}),(0,y.jsx)(l,{size:16,"aria-hidden":`true`,className:r(`flex-none text-muted transition-transform duration-200`,a&&`rotate-90`)})]}),(0,y.jsx)(u,{open:a,id:t,children:(0,y.jsxs)(`div`,{className:`flex flex-col gap-2 px-3 pt-1 pb-3 sm:pl-[100px]`,children:[(0,y.jsx)(`p`,{className:`m-0 text-sm leading-relaxed text-ink-2`,children:e.detail}),s&&(0,y.jsxs)(`a`,{href:s,className:`inline-flex items-center gap-1 self-start text-[13px] font-medium`,children:[`Open`,(0,y.jsx)(d,{size:13,"aria-hidden":`true`})]})]})})]})}function S({release:e}){let n=e===m;return(0,y.jsxs)(`li`,{className:`relative flex gap-4 pb-8`,children:[(0,y.jsx)(`span`,{"aria-hidden":`true`,className:r(`relative mt-1.5 size-[15px] flex-none rounded-full border-[3px] border-bg`,n?`bg-accent`:`bg-line`)}),(0,y.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3`,children:[(0,y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1`,children:[(0,y.jsxs)(`h3`,{className:`m-0 text-[15px] font-semibold`,children:[`ForgeQE `,e.version]}),n&&(0,y.jsx)(i,{tone:`running`,icon:!1,children:`Latest`}),(0,y.jsxs)(`span`,{className:`text-sm text-muted`,children:[(0,y.jsx)(`time`,{dateTime:e.date,children:h(e.date)}),` · `,t(e.changes.length,`change`)]})]}),(0,y.jsx)(`p`,{className:`m-0 max-w-[70ch] text-sm leading-relaxed text-ink-2`,children:e.summary}),(0,y.jsx)(`ul`,{className:`m-0 flex list-none flex-col overflow-hidden rounded-[12px] card border p-0`,children:e.changes.map((t,n)=>(0,y.jsx)(x,{change:t,first:n===0,id:`change-${e.version}-${n}`},n))})]})]})}function C(){(0,v.useEffect)(p,[]);let e=_();return(0,y.jsxs)(`div`,{className:`flex min-h-screen flex-col`,children:[(0,y.jsx)(a,{}),(0,y.jsxs)(`main`,{className:r(g,`flex-auto gap-5`),children:[(0,y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,y.jsx)(s,{pixel:o[`whats-new`],size:`lg`}),(0,y.jsx)(`h1`,{className:`m-0 flex-1 text-[26px] font-semibold tracking-[-0.01em]`,children:`What's new`})]}),(0,y.jsx)(`p`,{className:`m-0 max-w-[70ch] text-sm leading-relaxed text-muted`,children:`What each release of ForgeQE added, improved and fixed. Pick a change to read more.`}),(0,y.jsxs)(`div`,{className:`relative flex flex-col gap-2`,children:[(0,y.jsx)(`span`,{"aria-hidden":`true`,className:`absolute top-[60px] bottom-10 left-[7px] w-px bg-line`}),e.map(e=>(0,y.jsxs)(`section`,{className:`flex flex-col gap-4`,children:[(0,y.jsx)(`h2`,{className:`m-0 pl-[31px] text-[22px] font-semibold`,children:e.month}),(0,y.jsx)(`ol`,{className:`m-0 flex list-none flex-col p-0`,children:e.releases.map(e=>(0,y.jsx)(S,{release:e},e.version))})]},e.month))]})]})]})}export{b as KIND,C as WhatsNew};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Lr as e}from"./Shell-
|
|
1
|
+
import{Lr as e}from"./Shell-DFE3OHxz.js";var t={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};t.node;var n=e(t);export{n as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Lr as e}from"./Shell-
|
|
1
|
+
import{Lr as e}from"./Shell-DFE3OHxz.js";var t={name:`arrow-right`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]};t.node;var n=e(t);export{n as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Lr as e}from"./Shell-DFE3OHxz.js";var t={name:`circle`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};t.node;var n=e(t);export{n as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Lr as e}from"./Shell-
|
|
1
|
+
import{Lr as e}from"./Shell-DFE3OHxz.js";var t={name:`circle-dashed`,size:24,node:[[`path`,{d:`M10.1 2.182a10 10 0 0 1 3.8 0`,key:`5ilxe3`}],[`path`,{d:`M13.9 21.818a10 10 0 0 1-3.8 0`,key:`11zvb9`}],[`path`,{d:`M17.609 3.721a10 10 0 0 1 2.69 2.7`,key:`1iw5b2`}],[`path`,{d:`M2.182 13.9a10 10 0 0 1 0-3.8`,key:`c0bmvh`}],[`path`,{d:`M20.279 17.609a10 10 0 0 1-2.7 2.69`,key:`1ruxm7`}],[`path`,{d:`M21.818 10.1a10 10 0 0 1 0 3.8`,key:`qkgqxc`}],[`path`,{d:`M3.721 6.391a10 10 0 0 1 2.7-2.69`,key:`1mcia2`}],[`path`,{d:`M6.391 20.279a10 10 0 0 1-2.69-2.7`,key:`1fvljs`}]]};t.node;var n=e(t);export{n as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Lr as e}from"./Shell-
|
|
1
|
+
import{Lr as e}from"./Shell-DFE3OHxz.js";var t={name:`circle-dot`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};t.node;var n=e(t);export{n as t};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{$ as e,Bt as t,Di as n,Gt as r,J as i,K as a,Lr as o,Si as s,U as c,Vt as l,Wt as u,Xr as d,Z as f,at as p,bt as m,q as h,wi as g}from"./Shell-
|
|
1
|
+
import{$ as e,Bt as t,Di as n,Gt as r,J as i,K as a,Lr as o,Si as s,U as c,Vt as l,Wt as u,Xr as d,Z as f,at as p,bt as m,q as h,wi as g}from"./Shell-DFE3OHxz.js";import{N as _}from"./index-j5ulUL9f.js";var v={name:`rotate-cw`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]};v.node;var y=o(v),b=n(g(),1),x=s(),S={test:[`Testing the connection`,`Tested the connection`,`waiting`],tables:[`Reading the tables`,`Read the tables`,`searching`],query:[`Running the query`,`Ran the query`,`working`],gen:[`Making a preview`,`Made a preview`,`writing`],files:[`Writing the files`,`Wrote the files`,`writing`],insert:[`Inserting test data`,`Inserted test data`,`working`],batches:[`Listing the batches`,`Listed the batches`,`searching`],clean:[`Removing a batch`,`Removed a batch`,`working`],request:[`Asking the DB agent for test data`,`Asked the DB agent for test data`,`thinking`],fetch:[`Fetching the request again`,`Fetched the request again`,`searching`],ask:[`Asking the DB agent`,`Asked the DB agent`,`thinking`],checks:[`Running the checks`,`Ran the checks`,`working`],map:[`Reading the schema`,`Read the schema`,`searching`],check:[`Checking the flows`,`Checked the flows`,`working`],trace:[`Following the record`,`Followed the record`,`searching`]};function C(){let[e,t]=(0,b.useState)(null),[n,r]=(0,b.useState)(``),[i,a]=(0,b.useState)(!1),o=(0,b.useCallback)(()=>{d.view().then(e=>{t(e),r(``)},e=>r(e.message))},[]);(0,b.useEffect)(o,[o]);let s=!!e?.job?.running;return(0,b.useEffect)(()=>{if(!s)return;let e=setInterval(o,1e3);return()=>clearInterval(e)},[s,o]),{view:e,error:n,busy:i||s,running:s,act:async(e,t)=>{a(!0),r(``);try{await d.run(e,t),o()}catch(e){r(e.message)}finally{a(!1)}},stop:()=>void d.stop().then(o),load:o,job:e?.job??null}}var w=e=>e==null?`NULL`:typeof e==`object`?JSON.stringify(e):String(e);function T({file:e,onNote:t}){return(0,x.jsx)(`button`,{type:`button`,"data-tip":e,onClick:async()=>t(await m(e)),className:u(l({size:`sm`}),`font-mono text-[12px]`),children:e.split(/[\\/]/).pop()})}function E({children:e,label:t}){return(0,x.jsx)(`pre`,{"aria-label":t,className:`m-0 max-h-[320px] overflow-auto rounded-[12px] bg-surface-muted p-3 font-mono text-[12px] leading-relaxed whitespace-pre text-ink-2`,children:e})}function D({job:e,onStop:n}){let[i,a,o]=S[e.kind]??[`Working`,`Done`,`working`],s=(0,b.useRef)(null);(0,b.useEffect)(()=>{s.current&&(s.current.scrollTop=s.current.scrollHeight)},[e.lines.length]);let c=e.exitCode===0,l=!c&&(e.kind===`check`||e.kind===`trace`)&&e.result!==void 0&&!e.result.error;return(0,x.jsxs)(`section`,{"aria-label":e.running?i:a,className:`flex flex-col gap-2 rounded-[14px] card border p-4`,children:[(0,x.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,x.jsxs)(`span`,{className:`min-w-0 flex-1 font-medium [overflow-wrap:anywhere]`,children:[e.running?i:a,e.target?(0,x.jsxs)(`span`,{className:`font-normal text-muted`,children:[` · `,e.target]}):null]}),(0,x.jsx)(p,{tone:e.running?`running`:c?`pass`:e.exitCode===2||l?`warn`:`fail`,orb:o,children:e.running?`Working`:c?`Done`:l?`Some broken`:e.exitCode===2?`Not done`:`Failed`}),e.running&&(0,x.jsxs)(t,{onClick:n,className:`border-fail text-fail hover:bg-fail-soft`,children:[(0,x.jsx)(_,{size:14,fill:`currentColor`,"aria-hidden":`true`}),`Stop`]})]}),(0,x.jsxs)(`details`,{open:e.running||!c&&!e.result,children:[(0,x.jsxs)(`summary`,{className:`cursor-pointer text-sm text-muted`,children:[`Output (`,r(e.lines.length,`line`),`)`]}),(0,x.jsx)(`code`,{className:`mt-2 block font-mono text-[12px] text-muted [overflow-wrap:anywhere]`,children:e.command}),(0,x.jsx)(`pre`,{ref:s,className:`mt-2 max-h-[240px] overflow-auto rounded-[10px] bg-surface-muted p-3 font-mono text-[12px] leading-relaxed whitespace-pre-wrap text-ink-2`,children:e.lines.join(`
|
|
2
2
|
`)||`Starting…`})]})]})}function O({text:e}){return(0,x.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:e})}function k({columns:e,rows:t}){let n=e.map((e,n)=>t.length>0&&t.every(e=>e[n]===null||e[n]===void 0||typeof e[n]==`number`)&&t.some(e=>typeof e[n]==`number`));return(0,x.jsx)(c,{label:`Rows`,resetKey:t,head:e.map((e,t)=>(0,x.jsx)(`th`,{className:n[t]?h:a,children:e},e)),children:t.map((e,t)=>(0,x.jsx)(`tr`,{className:i,children:e.map((e,t)=>(0,x.jsx)(`td`,{"data-tip":w(e),className:u(`px-3 py-1.5 font-mono text-[12px]`,n[t]?`text-right whitespace-nowrap tabular-nums`:`max-w-[320px] truncate`,e==null&&`text-muted`),children:w(e)},t))},t))})}function A({r:e}){return(0,x.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(e.order||[]).map(t=>{let n=e.preview?.[t],i=n?.sample||[],a=i.length?Object.keys(i[0]):[];return(0,x.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,x.jsxs)(`span`,{className:`text-sm`,children:[(0,x.jsx)(`span`,{className:`font-medium`,children:t}),` · `,r(e.rows?.[t]??0,`row`),n?.database_fills?.length?(0,x.jsxs)(`span`,{className:`text-muted`,children:[` · the database fills `,n.database_fills.join(`, `)]}):null,e.masked?.[t]?.length?(0,x.jsxs)(`span`,{className:`text-muted`,children:[` · masked `,e.masked[t].join(`, `)]}):null]}),a.length>0&&(0,x.jsx)(k,{columns:a,rows:i.slice(0,3).map(e=>a.map(t=>e[t]))})]},t)}),(e.warnings||[]).map((e,t)=>(0,x.jsx)(`p`,{className:`m-0 text-[13px] text-warn`,children:e},t))]})}var j={query:`Existing rows`,generate:`New rows`};function M({r:e,onNote:t}){let n=Object.entries(e.rows||{});return(0,x.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,x.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,x.jsx)(p,{tone:`pass`,children:j[e.kind||``]||`Answered`}),(0,x.jsxs)(`span`,{className:`min-w-0 text-sm text-ink-2 [overflow-wrap:anywhere]`,children:[e.database,e.why?` · ${e.why}`:``]})]}),n.map(([t,n])=>(0,x.jsx)(N,{title:t===`result`?`Rows found`:t,rows:n,total:e.row_counts?.[t]??n.length},t)),e.sql&&(0,x.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,x.jsx)(`span`,{className:`text-sm font-medium`,children:`The query, as the database checked it`}),(0,x.jsx)(E,{label:`SQL`,children:e.sql})]}),e.script_preview&&e.script_preview.length>0&&(0,x.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,x.jsx)(`span`,{className:`text-sm font-medium`,children:`INSERT script for these rows, not run`}),(0,x.jsx)(E,{label:`INSERT script`,children:e.script_preview.join(`
|
|
3
3
|
`)})]}),e.files?.length?(0,x.jsxs)(`p`,{className:`m-0 flex flex-wrap items-center gap-2 text-sm`,children:[`Kept`,e.files.map(e=>(0,x.jsx)(T,{file:e,onNote:t},e))]}):null,e.replay&&(0,x.jsxs)(`p`,{className:`m-0 text-[13px] text-muted`,children:[`Tests and pipelines get the same data with `,(0,x.jsx)(`code`,{className:`font-mono text-[12px] text-ink-2`,children:e.replay}),`, without a model.`]})]})}function N({title:e,rows:t,total:n}){let i=[...new Set(t.flatMap(e=>Object.keys(e)))];return(0,x.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,x.jsxs)(`span`,{className:`text-sm`,children:[(0,x.jsx)(`span`,{className:`font-medium`,children:e}),` · `,r(n,`row`),n>t.length?(0,x.jsxs)(`span`,{className:`text-muted`,children:[` · `,t.length,` shown`]}):null]}),i.length>0?(0,x.jsx)(k,{columns:i,rows:t.map(e=>i.map(t=>e[t]))}):(0,x.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`No rows match.`})]})}function P({items:t,text:n,label:r,size:i=10,children:a}){let[o,s]=(0,b.useState)(``),[c,l]=(0,b.useState)(0),u=o.toLowerCase().split(/\s+/).filter(Boolean),d=u.length?t.filter(e=>u.every(t=>n(e).toLowerCase().includes(t))):t;(0,b.useEffect)(()=>l(0),[o,t.length]);let p=Math.min(c,Math.max(0,Math.ceil(d.length/i)-1));return(0,x.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[t.length>i&&(0,x.jsx)(e,{id:`find-${r.toLowerCase().replace(/\W+/g,`-`)}`,label:`Find in ${r.toLowerCase()}`,value:o,onChange:s,className:`flex-none`}),d.length?(0,x.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:d.slice(p*i,p*i+i).map(a)}):(0,x.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`Nothing matches.`}),d.length>i&&(0,x.jsx)(f,{page:p,size:i,total:d.length,onPage:l,label:`Pages of ${r.toLowerCase()}`})]})}export{D as a,O as c,w as d,C as f,A as i,k as l,E as n,j as o,y as p,T as r,P as s,M as t,N as u};
|