@nivora/matrix 0.1.0

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.

Potentially problematic release.


This version of @nivora/matrix might be problematic. Click here for more details.

Files changed (134) hide show
  1. package/.next/BUILD_ID +1 -0
  2. package/.next/app-path-routes-manifest.json +12 -0
  3. package/.next/build-manifest.json +20 -0
  4. package/.next/diagnostics/build-diagnostics.json +6 -0
  5. package/.next/diagnostics/framework.json +1 -0
  6. package/.next/export-marker.json +6 -0
  7. package/.next/images-manifest.json +66 -0
  8. package/.next/next-minimal-server.js.nft.json +1 -0
  9. package/.next/next-server.js.nft.json +1 -0
  10. package/.next/package.json +1 -0
  11. package/.next/prerender-manifest.json +90 -0
  12. package/.next/react-loadable-manifest.json +1 -0
  13. package/.next/required-server-files.js +165 -0
  14. package/.next/required-server-files.json +165 -0
  15. package/.next/routes-manifest.json +109 -0
  16. package/.next/server/app/_global-error/page.js +3 -0
  17. package/.next/server/app/_global-error/page.js.nft.json +1 -0
  18. package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -0
  19. package/.next/server/app/_global-error.html +2 -0
  20. package/.next/server/app/_global-error.meta +16 -0
  21. package/.next/server/app/_global-error.rsc +12 -0
  22. package/.next/server/app/_global-error.segments/_full.segment.rsc +12 -0
  23. package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +5 -0
  24. package/.next/server/app/_global-error.segments/_global-error.segment.rsc +4 -0
  25. package/.next/server/app/_global-error.segments/_head.segment.rsc +5 -0
  26. package/.next/server/app/_global-error.segments/_index.segment.rsc +4 -0
  27. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -0
  28. package/.next/server/app/_not-found/page.js +2 -0
  29. package/.next/server/app/_not-found/page.js.nft.json +1 -0
  30. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -0
  31. package/.next/server/app/_not-found.html +1 -0
  32. package/.next/server/app/_not-found.meta +16 -0
  33. package/.next/server/app/_not-found.rsc +15 -0
  34. package/.next/server/app/_not-found.segments/_full.segment.rsc +15 -0
  35. package/.next/server/app/_not-found.segments/_head.segment.rsc +6 -0
  36. package/.next/server/app/_not-found.segments/_index.segment.rsc +6 -0
  37. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +5 -0
  38. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +4 -0
  39. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -0
  40. package/.next/server/app/builder/page.js +24 -0
  41. package/.next/server/app/builder/page.js.nft.json +1 -0
  42. package/.next/server/app/builder/page_client-reference-manifest.js +1 -0
  43. package/.next/server/app/favicon.ico/route.js +1 -0
  44. package/.next/server/app/favicon.ico/route.js.nft.json +1 -0
  45. package/.next/server/app/favicon.ico.body +0 -0
  46. package/.next/server/app/favicon.ico.meta +1 -0
  47. package/.next/server/app/guide/page.js +2 -0
  48. package/.next/server/app/guide/page.js.nft.json +1 -0
  49. package/.next/server/app/guide/page_client-reference-manifest.js +1 -0
  50. package/.next/server/app/matrix/page.js +2 -0
  51. package/.next/server/app/matrix/page.js.nft.json +1 -0
  52. package/.next/server/app/matrix/page_client-reference-manifest.js +1 -0
  53. package/.next/server/app/page.js +2 -0
  54. package/.next/server/app/page.js.nft.json +1 -0
  55. package/.next/server/app/page_client-reference-manifest.js +1 -0
  56. package/.next/server/app/releases/[id]/page.js +51 -0
  57. package/.next/server/app/releases/[id]/page.js.nft.json +1 -0
  58. package/.next/server/app/releases/[id]/page_client-reference-manifest.js +1 -0
  59. package/.next/server/app/releases/page.js +34 -0
  60. package/.next/server/app/releases/page.js.nft.json +1 -0
  61. package/.next/server/app/releases/page_client-reference-manifest.js +1 -0
  62. package/.next/server/app/specs/[id]/page.js +2 -0
  63. package/.next/server/app/specs/[id]/page.js.nft.json +1 -0
  64. package/.next/server/app/specs/[id]/page_client-reference-manifest.js +1 -0
  65. package/.next/server/app-paths-manifest.json +12 -0
  66. package/.next/server/chunks/13.js +1 -0
  67. package/.next/server/chunks/135.js +34 -0
  68. package/.next/server/chunks/390.js +1 -0
  69. package/.next/server/chunks/445.js +22 -0
  70. package/.next/server/chunks/471.js +13 -0
  71. package/.next/server/chunks/476.js +23 -0
  72. package/.next/server/chunks/530.js +72 -0
  73. package/.next/server/chunks/870.js +1 -0
  74. package/.next/server/functions-config-manifest.json +4 -0
  75. package/.next/server/interception-route-rewrite-manifest.js +1 -0
  76. package/.next/server/middleware-build-manifest.js +1 -0
  77. package/.next/server/middleware-manifest.json +6 -0
  78. package/.next/server/middleware-react-loadable-manifest.js +1 -0
  79. package/.next/server/next-font-manifest.js +1 -0
  80. package/.next/server/next-font-manifest.json +1 -0
  81. package/.next/server/pages/404.html +1 -0
  82. package/.next/server/pages/500.html +2 -0
  83. package/.next/server/pages-manifest.json +4 -0
  84. package/.next/server/server-reference-manifest.js +1 -0
  85. package/.next/server/server-reference-manifest.json +1 -0
  86. package/.next/server/webpack-runtime.js +1 -0
  87. package/.next/static/8ZUFcYHRSRlY1FYWZ33gH/_buildManifest.js +1 -0
  88. package/.next/static/8ZUFcYHRSRlY1FYWZ33gH/_ssgManifest.js +1 -0
  89. package/.next/static/chunks/4bd1b696-67e30520d621c4dd.js +1 -0
  90. package/.next/static/chunks/500-b84d19d842172eba.js +1 -0
  91. package/.next/static/chunks/794-9353bb3ab9a73e90.js +2 -0
  92. package/.next/static/chunks/app/_global-error/page-aba28f88d5781771.js +1 -0
  93. package/.next/static/chunks/app/_not-found/page-90fe62e7982fba87.js +1 -0
  94. package/.next/static/chunks/app/builder/page-e10754eb65a4f784.js +10 -0
  95. package/.next/static/chunks/app/guide/page-9c9dff9c5e3ddefe.js +1 -0
  96. package/.next/static/chunks/app/layout-550e25f5579f1a32.js +1 -0
  97. package/.next/static/chunks/app/matrix/page-b2418abb52a7acd8.js +1 -0
  98. package/.next/static/chunks/app/page-9c9dff9c5e3ddefe.js +1 -0
  99. package/.next/static/chunks/app/releases/[id]/page-d8069a1802686478.js +1 -0
  100. package/.next/static/chunks/app/releases/page-26a520d9789e69f5.js +1 -0
  101. package/.next/static/chunks/app/specs/[id]/page-7065af5d4d103f16.js +1 -0
  102. package/.next/static/chunks/framework-d7de93249215fb06.js +1 -0
  103. package/.next/static/chunks/main-17e3a04cf2f94dca.js +5 -0
  104. package/.next/static/chunks/main-app-6d93e914b4a54c7e.js +1 -0
  105. package/.next/static/chunks/next/dist/client/components/builtin/app-error-aba28f88d5781771.js +1 -0
  106. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-aba28f88d5781771.js +1 -0
  107. package/.next/static/chunks/next/dist/client/components/builtin/global-error-ebbdf863aa6a4349.js +1 -0
  108. package/.next/static/chunks/next/dist/client/components/builtin/not-found-aba28f88d5781771.js +1 -0
  109. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-aba28f88d5781771.js +1 -0
  110. package/.next/static/chunks/polyfills-42372ed130431b0a.js +1 -0
  111. package/.next/static/chunks/webpack-650bc85863e2a9e7.js +1 -0
  112. package/.next/static/css/f29e518c867dffaa.css +1 -0
  113. package/.next/trace-build +1 -0
  114. package/.next/types/app/builder/page.ts +86 -0
  115. package/.next/types/app/guide/page.ts +86 -0
  116. package/.next/types/app/layout.ts +86 -0
  117. package/.next/types/app/matrix/page.ts +86 -0
  118. package/.next/types/app/page.ts +86 -0
  119. package/.next/types/app/releases/[id]/page.ts +86 -0
  120. package/.next/types/app/releases/page.ts +86 -0
  121. package/.next/types/app/specs/[id]/page.ts +86 -0
  122. package/.next/types/package.json +1 -0
  123. package/.next/types/routes.d.ts +63 -0
  124. package/.next/types/validator.ts +115 -0
  125. package/README.md +185 -0
  126. package/bin/cli.js +3650 -0
  127. package/bin/cli.ts +170 -0
  128. package/next.config.ts +11 -0
  129. package/package.json +59 -0
  130. package/public/file.svg +1 -0
  131. package/public/globe.svg +1 -0
  132. package/public/next.svg +1 -0
  133. package/public/vercel.svg +1 -0
  134. package/public/window.svg +1 -0
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[258],{2716:(e,r,s)=>{"use strict";s.d(r,{MatrixClient:()=>p});var t=s(5155),a=s(2115),i=s(8500),n=s.n(i);function o(e,r){return r&&e?e.split(RegExp(`(${r})`,"gi")).map((e,s)=>e.toLowerCase()===r.toLowerCase()?(0,t.jsx)("mark",{style:{background:"var(--warning)",color:"black",padding:"0 2px",borderRadius:"2px"},children:e},s):e):e}function l({row:e,search:r,gridTemplate:s}){let[i,l]=(0,a.useState)(!1);return[...new Map(e.fsItems.flatMap(({risks:e})=>e).map(e=>[e.id,e])).values()],(0,t.jsxs)("div",{style:{borderBottom:"1px solid var(--border)"},children:[(0,t.jsxs)("div",{onClick:()=>l(!i),style:{display:"grid",gridTemplateColumns:`24px ${s}`,gap:"0.5rem",padding:"0.6rem 1rem",cursor:"pointer",alignItems:"center",background:i?"var(--bg-hover)":"transparent",fontSize:"0.8125rem"},children:[(0,t.jsx)("span",{style:{fontSize:"0.7rem",color:"var(--text-secondary)"},children:i?"▼":"▶"}),(0,t.jsx)(n(),{href:`/specs/${e.urs.id}`,onClick:e=>e.stopPropagation(),style:{textDecoration:"none"},children:(0,t.jsx)("code",{style:{fontWeight:600,color:"var(--success)"},children:o(e.urs.id,r)})}),(0,t.jsx)("span",{style:{color:"var(--text-primary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:o(e.urs.title,r)}),(0,t.jsx)("span",{className:`badge ${"approved"===e.urs.status?"badge-success":"badge-warning"}`,style:{fontSize:"0.65rem",padding:"0.15rem 0.4rem"},children:e.urs.status}),(0,t.jsx)("span",{className:"badge",style:{fontSize:"0.65rem",padding:"0.15rem 0.4rem",background:{critical:"#ef4444",high:"#f97316",medium:"#eab308",low:"#22c55e"}[e.urs.priority]||"#6b7280",color:"white"},children:e.urs.priority}),(0,t.jsx)("span",{style:{fontSize:"0.75rem",color:"var(--text-secondary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.urs.category||"-"}),(0,t.jsx)("span",{style:{fontSize:"0.75rem",color:"var(--text-secondary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.urs.owner?.split(" ")[0]||"-"}),(0,t.jsx)("span",{style:{fontSize:"0.7rem",color:"var(--text-secondary)"},children:e.urs.created_at||"-"}),(0,t.jsx)("span",{className:"badge",style:{fontSize:"0.65rem",padding:"0.15rem 0.4rem",background:"rgba(245, 158, 11, 0.15)",color:"var(--warning)",minWidth:"24px",textAlign:"right",display:"inline-block"},children:e.fsItems.length}),(0,t.jsx)("span",{className:"badge badge-success",style:{fontSize:"0.65rem",padding:"0.15rem 0.4rem",minWidth:"28px",textAlign:"right",display:"inline-block"},children:e.coverage.scenarioCount})]}),i&&(0,t.jsx)("div",{style:{padding:"1rem",paddingLeft:"2.5rem",background:"var(--bg-hover)",borderTop:"1px solid var(--border)"},children:e.fsItems.map(({fs:e,risks:s})=>(0,t.jsxs)("div",{style:{marginBottom:"1rem"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem",marginBottom:"0.5rem"},children:[(0,t.jsx)("div",{style:{width:"3px",height:"20px",background:"var(--warning)",borderRadius:"2px"}}),(0,t.jsx)(n(),{href:`/specs/${e.id}`,style:{textDecoration:"none"},children:(0,t.jsx)("code",{style:{fontWeight:600,color:"var(--warning)",fontSize:"0.875rem"},children:e.id})}),(0,t.jsx)("span",{style:{color:"var(--text-secondary)",fontSize:"0.8125rem"},children:e.title}),s.map(e=>(0,t.jsx)(n(),{href:`/specs/${e.id}`,style:{textDecoration:"none"},children:(0,t.jsx)("span",{className:"badge",style:{fontSize:"0.65rem",background:"rgba(249, 115, 22, 0.15)",color:"#f97316"},children:e.id})},e.id))]}),(0,t.jsx)("div",{style:{marginLeft:"0.75rem",display:"grid",gap:"0.25rem"},children:e.scenarios.map((s,a)=>(0,t.jsxs)(n(),{href:`/specs/${e.id}?scenario=${encodeURIComponent(s.name)}`,style:{display:"flex",alignItems:"center",gap:"0.5rem",padding:"0.4rem 0.6rem",borderRadius:"4px",background:"var(--bg-card)",textDecoration:"none",color:"var(--text-primary)",fontSize:"0.8125rem"},children:[(0,t.jsx)("span",{style:{color:"var(--accent)"},children:"\uD83E\uDDEA"}),(0,t.jsx)("span",{children:o(s.name,r)})]},a))})]},e.id))})]})}function d({scenario:e,search:r}){let[s,i]=(0,a.useState)(!1);return(0,t.jsxs)("div",{style:{border:"1px solid var(--border)",borderRadius:"8px",background:"var(--bg-card)",overflow:"hidden"},children:[(0,t.jsxs)("div",{onClick:()=>i(!s),style:{padding:"0.75rem 1rem",cursor:"pointer",display:"flex",alignItems:"center",gap:"0.75rem"},children:[(0,t.jsx)("span",{style:{fontSize:"0.75rem"},children:s?"▼":"▶"}),(0,t.jsx)("span",{style:{color:"var(--accent)"},children:"\uD83E\uDDEA"}),(0,t.jsx)("span",{style:{fontWeight:500},children:o(e.name,r)}),(0,t.jsxs)("div",{style:{marginLeft:"auto",display:"flex",gap:"0.5rem"},children:[(0,t.jsx)(n(),{href:`/specs/${e.fsId}`,onClick:e=>e.stopPropagation(),style:{textDecoration:"none"},children:(0,t.jsx)("span",{className:"badge",style:{background:"rgba(245, 158, 11, 0.15)",color:"var(--warning)"},children:e.fsId})}),e.ursIds.map(e=>(0,t.jsx)(n(),{href:`/specs/${e}`,onClick:e=>e.stopPropagation(),style:{textDecoration:"none"},children:(0,t.jsx)("span",{className:"badge badge-success",children:e})},e)),e.riskIds.map(e=>(0,t.jsx)(n(),{href:`/specs/${e}`,onClick:e=>e.stopPropagation(),style:{textDecoration:"none"},children:(0,t.jsx)("span",{className:"badge",style:{background:"rgba(249, 115, 22, 0.15)",color:"#f97316"},children:e})},e))]})]}),s&&(0,t.jsxs)("div",{style:{padding:"0.75rem 1rem",borderTop:"1px solid var(--border)",background:"var(--bg-hover)"},children:[(0,t.jsx)("div",{style:{fontFamily:"monospace",fontSize:"0.8125rem",lineHeight:1.6},children:e.steps.map((e,s)=>(0,t.jsx)("div",{style:{color:e.startsWith("Given")?"#a78bfa":e.startsWith("When")?"#60a5fa":e.startsWith("Then")?"#34d399":"var(--text-secondary)"},children:o(e,r)},s))}),e.tags.length>0&&(0,t.jsxs)("div",{style:{marginTop:"0.75rem",fontSize:"0.75rem",color:"var(--text-secondary)"},children:["Tags: ",e.tags.join(" ")]})]})]})}let c=[{key:"id",label:"URS",width:"90px"},{key:"title",label:"Title",width:"1fr"},{key:"status",label:"Status",width:"80px"},{key:"priority",label:"Priority",width:"80px"},{key:"category",label:"Category",width:"90px"},{key:"owner",label:"Owner",width:"90px"},{key:"created",label:"Created",width:"90px"},{key:"fs",label:"FS",width:"50px"},{key:"tests",label:"Tests",width:"60px"}];function p({matrix:e,scenarios:r}){let[s,i]=(0,a.useState)(""),[n,o]=(0,a.useState)("matrix"),[p,m]=(0,a.useState)("id"),[g,h]=(0,a.useState)("asc"),x=s.toLowerCase(),u=(0,a.useMemo)(()=>e.filter(e=>!!(!s||e.urs.id.toLowerCase().includes(x)||e.urs.title.toLowerCase().includes(x)||e.urs.status?.toLowerCase().includes(x)||e.urs.category?.toLowerCase().includes(x)||e.urs.owner?.toLowerCase().includes(x)||e.fsItems.some(({fs:e})=>e.id.toLowerCase().includes(x)||e.title.toLowerCase().includes(x))||e.fsItems.some(({risks:e})=>e.some(e=>e.id.toLowerCase().includes(x)))||e.fsItems.some(({fs:e})=>e.scenarios.some(e=>e.name.toLowerCase().includes(x))))),[e,s,x]),y=(0,a.useMemo)(()=>{let e=[...u];return e.sort((e,r)=>{let s="",t="";switch(p){case"id":s=e.urs.id,t=r.urs.id;break;case"title":s=e.urs.title,t=r.urs.title;break;case"status":s=e.urs.status||"",t=r.urs.status||"";break;case"priority":let a={critical:0,high:1,medium:2,low:3};s=a[e.urs.priority]??9,t=a[r.urs.priority]??9;break;case"category":s=e.urs.category||"",t=r.urs.category||"";break;case"owner":s=e.urs.owner||"",t=r.urs.owner||"";break;case"created":s=e.urs.created_at||"",t=r.urs.created_at||"";break;case"fs":s=e.fsItems.length,t=r.fsItems.length;break;case"tests":s=e.coverage.scenarioCount,t=r.coverage.scenarioCount}return"number"==typeof s&&"number"==typeof t?"asc"===g?s-t:t-s:"asc"===g?String(s).localeCompare(String(t)):String(t).localeCompare(String(s))}),e},[u,p,g]),b=r.filter(e=>!s||e.name.toLowerCase().includes(x)||e.fsId.toLowerCase().includes(x)||e.ursIds.some(e=>e.toLowerCase().includes(x))||e.steps.some(e=>e.toLowerCase().includes(x))),v=c.map(e=>e.width).join(" ");return(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"card",style:{marginBottom:"1.5rem"},children:[(0,t.jsxs)("div",{style:{display:"flex",gap:"1rem",alignItems:"center"},children:[(0,t.jsx)("input",{type:"text",value:s,onChange:e=>i(e.target.value),placeholder:"\uD83D\uDD0D Search everything: URS, FS, scenarios, risks...",style:{flex:1,padding:"0.75rem 1rem",background:"var(--bg-hover)",border:"1px solid var(--border)",borderRadius:"8px",color:"var(--text-primary)",fontSize:"1rem"}}),s&&(0,t.jsx)("button",{onClick:()=>i(""),className:"btn",style:{background:"var(--bg-hover)"},children:"Clear"})]}),s&&(0,t.jsxs)("div",{style:{marginTop:"0.75rem",fontSize:"0.875rem",color:"var(--text-secondary)"},children:["Found: ",(0,t.jsx)("strong",{children:y.length})," URS, ",(0,t.jsx)("strong",{children:b.length})," scenarios"]})]}),(0,t.jsxs)("div",{style:{display:"flex",gap:"0.5rem",marginBottom:"1rem"},children:[(0,t.jsxs)("button",{onClick:()=>o("matrix"),className:`btn ${"matrix"===n?"btn-primary":""}`,style:"matrix"!==n?{background:"var(--bg-hover)"}:{},children:["\uD83D\uDCCA Traceability (",y.length,")"]}),(0,t.jsxs)("button",{onClick:()=>o("scenarios"),className:`btn ${"scenarios"===n?"btn-primary":""}`,style:"scenarios"!==n?{background:"var(--bg-hover)"}:{},children:["\uD83E\uDDEA Scenarios (",b.length,")"]})]}),"matrix"===n&&(0,t.jsxs)("div",{className:"card",style:{padding:0,overflow:"hidden"},children:[(0,t.jsxs)("div",{style:{display:"grid",gridTemplateColumns:`24px ${v}`,gap:"0.5rem",padding:"0.75rem 1rem",background:"var(--bg-hover)",borderBottom:"1px solid var(--border)",fontSize:"0.75rem",fontWeight:600,color:"var(--text-secondary)"},children:[(0,t.jsx)("span",{}),c.map(e=>(0,t.jsxs)("button",{onClick:()=>{var r;p===(r=e.key)?h(e=>"asc"===e?"desc":"asc"):(m(r),h("asc"))},style:{background:"none",border:"none",color:p===e.key?"var(--accent)":"var(--text-secondary)",cursor:"pointer",textAlign:"left",padding:0,fontWeight:600,fontSize:"0.75rem",display:"flex",alignItems:"center",gap:"0.25rem"},children:[e.label,p===e.key&&(0,t.jsx)("span",{children:"asc"===g?"↑":"↓"})]},e.key))]}),0===y.length?(0,t.jsx)("div",{style:{textAlign:"center",padding:"2rem",color:"var(--text-secondary)"},children:"No results"}):(0,t.jsx)("div",{children:y.map(e=>(0,t.jsx)(l,{row:e,search:x,gridTemplate:v},e.urs.id))})]}),"scenarios"===n&&(0,t.jsx)("div",{className:"card",children:0===b.length?(0,t.jsx)("div",{style:{textAlign:"center",padding:"2rem",color:"var(--text-secondary)"},children:"No scenarios"}):(0,t.jsx)("div",{style:{display:"grid",gap:"0.75rem"},children:b.map((e,r)=>(0,t.jsx)(d,{scenario:e,search:x},`${e.fsId}-${r}`))})})]})}},9928:(e,r,s)=>{Promise.resolve().then(s.bind(s,2716))}},e=>{e.O(0,[500,441,794,358],()=>e(e.s=9928)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[585,974],{2318:(e,s,_)=>{Promise.resolve().then(_.t.bind(_,8500,23))}},e=>{e.O(0,[500,441,794,358],()=>e(e.s=2318)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[41],{4926:(e,t,r)=>{Promise.resolve().then(r.bind(r,6717))},6717:(e,t,r)=>{"use strict";r.d(t,{ReleaseDetailClient:()=>h});var s=r(5155),i=r(2115),a=r(8500),l=r.n(a),n=r(9339);let o=(0,n.createServerReference)("60b2b1ac09aa309cd62336a9a181a22f6a565110e8",n.callServer,void 0,n.findSourceMapURL,"updateReleaseAction"),d=(0,n.createServerReference)("60a507c03894e522051c1ddbaa648c22f3145f6f7b",n.callServer,void 0,n.findSourceMapURL,"tagFSToReleaseAction"),c=(0,n.createServerReference)("600920c1121365a4e4a2b74f81a2832b96fbcadc12",n.callServer,void 0,n.findSourceMapURL,"untagFSFromReleaseAction"),m=(0,n.createServerReference)("4098c7d1c9ece378d5dbdd69bf4aa352b2d12a9669",n.callServer,void 0,n.findSourceMapURL,"createDefectAction");function h({release:e,taggedFS:t,availableFS:r,testRuns:a,defects:n}){let[h,p]=(0,i.useState)(!1),[g,x]=(0,i.useState)(!1),[v,u]=(0,i.useState)([]),[y,j]=(0,i.useState)(null),[f,b]=(0,i.useState)({isOpen:!1}),[S,N]=(0,i.useState)({title:"",description:"",status:"open"}),[C,k]=(0,i.useState)({titleError:!1,descriptionError:!1}),[R,w]=(0,i.useTransition)(),[B,W]=(0,i.useState)({version:e.version,name:e.name,status:e.status,notes:e.notes||""}),_={planning:{bg:"rgba(168, 85, 247, 0.1)",color:"#a855f7"},testing:{bg:"rgba(59, 130, 246, 0.1)",color:"#3b82f6"},released:{bg:"rgba(34, 197, 94, 0.1)",color:"#22c55e"}}[e.status];return(0,s.jsxs)("div",{style:{maxWidth:"1200px",margin:"0 auto",padding:"2rem"},children:[(0,s.jsx)("div",{style:{marginBottom:"1.5rem"},children:(0,s.jsx)(l(),{href:"/releases",style:{color:"var(--text-secondary)",textDecoration:"none"},children:"← Back to Releases"})}),(0,s.jsxs)("header",{style:{marginBottom:"2rem"},children:[(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"1rem",marginBottom:"0.5rem"},children:[(0,s.jsxs)("code",{style:{fontSize:"1.5rem",fontWeight:700,color:_.color},children:[" ",e.id," "]}),(0,s.jsxs)("span",{style:{fontSize:"1.25rem",fontWeight:600},children:["v",e.version]}),(0,s.jsx)("span",{className:"badge",style:{background:_.bg,color:_.color,padding:"0.5rem 1rem"},children:e.status}),(0,s.jsx)("button",{onClick:()=>p(!h),className:"btn btn-primary",style:{marginLeft:"auto"},children:h?"Cancel":"✏️ Edit"})]}),(0,s.jsx)("h1",{style:{fontSize:"2rem",fontWeight:700},children:e.name}),(0,s.jsxs)("p",{style:{color:"var(--text-secondary)"},children:["Created ",e.created_at,e.released_at&&` • Released ${e.released_at}`]})]}),h&&(0,s.jsxs)("div",{className:"card",style:{marginBottom:"1.5rem"},children:[(0,s.jsx)("h2",{className:"card-title",children:"Edit Release"}),(0,s.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 2fr 1fr",gap:"1rem",marginBottom:"1rem"},children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{style:{display:"block",fontWeight:500,marginBottom:"0.5rem"},children:"Version"}),(0,s.jsx)("input",{type:"text",value:B.version,onChange:e=>W({...B,version:e.target.value}),className:"input"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{style:{display:"block",fontWeight:500,marginBottom:"0.5rem"},children:"Name"}),(0,s.jsx)("input",{type:"text",value:B.name,onChange:e=>W({...B,name:e.target.value}),className:"input"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{style:{display:"block",fontWeight:500,marginBottom:"0.5rem"},children:"Status"}),(0,s.jsxs)("select",{value:B.status,onChange:e=>W({...B,status:e.target.value}),className:"input",children:[(0,s.jsx)("option",{value:"planning",children:"Planning"}),(0,s.jsx)("option",{value:"testing",children:"Testing"}),(0,s.jsx)("option",{value:"released",children:"Released"})]})]})]}),(0,s.jsxs)("div",{style:{marginBottom:"1rem"},children:[(0,s.jsx)("label",{style:{display:"block",fontWeight:500,marginBottom:"0.5rem"},children:"Notes"}),(0,s.jsx)("textarea",{value:B.notes,onChange:e=>W({...B,notes:e.target.value}),rows:3,className:"input",style:{resize:"vertical"}})]}),(0,s.jsx)("button",{onClick:()=>{w(async()=>{await o(e.id,B),p(!1)})},className:"btn btn-primary",disabled:R,children:R?"Saving...":"Save Changes"})]}),e.notes&&!h&&(0,s.jsxs)("div",{className:"card",style:{marginBottom:"1.5rem"},children:[(0,s.jsx)("h2",{className:"card-title",children:"\uD83D\uDCDD Notes"}),(0,s.jsx)("p",{style:{color:"var(--text-secondary)",whiteSpace:"pre-wrap"},children:e.notes})]}),(0,s.jsxs)("div",{className:"card",style:{marginBottom:"1.5rem",borderLeft:"4px solid var(--error)"},children:[(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"1rem"},children:[(0,s.jsxs)("h2",{className:"card-title",children:["\uD83D\uDEA8 Defects & Deviations (",n.length,")"]}),(0,s.jsx)("button",{className:"btn",onClick:()=>{b({isOpen:!0,testResultId:void 0,fsId:void 0,scenarioName:void 0}),N({title:"",description:"",status:"open"})},children:"+ Log Defect"})]}),0===n.length?(0,s.jsx)("p",{style:{color:"var(--text-secondary)"},children:"No defects logged. Any failed tests must be resolved or logged as a defect."}):(0,s.jsx)("div",{style:{display:"grid",gap:"0.75rem"},children:n.map(e=>(0,s.jsxs)("div",{style:{padding:"1rem",background:"var(--bg-hover)",borderRadius:"8px",borderLeft:"open"===e.status?"3px solid red":"3px solid green"},children:[(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"0.5rem"},children:[(0,s.jsxs)("div",{style:{fontWeight:600},children:[e.id,": ",e.title]}),(0,s.jsx)("div",{className:"badge",style:{background:"open"===e.status?"rgba(239, 68, 68, 0.1)":"rgba(34, 197, 94, 0.1)",color:"open"===e.status?"var(--error)":"var(--success)"},children:e.status.toUpperCase()})]}),(0,s.jsx)("div",{style:{fontSize:"0.875rem",color:"var(--text-secondary)",whiteSpace:"pre-wrap"},children:e.description}),e.test_result_id&&(0,s.jsxs)("div",{style:{marginTop:"0.5rem",fontSize:"0.75rem",color:"var(--warning)"},children:["Linked to failed test result #",e.test_result_id]})]},e.id))})]}),(0,s.jsxs)("div",{className:"card",style:{marginBottom:"1.5rem"},children:[(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"1rem"},children:[(0,s.jsxs)("h2",{className:"card-title",style:{margin:0},children:["⚙️ Features (",t.length,")"]}),(0,s.jsx)("button",{onClick:()=>x(!0),className:"btn",disabled:0===r.length,children:"+ Add Features"})]}),g&&(0,s.jsxs)("div",{style:{marginBottom:"1rem",padding:"1rem",background:"var(--bg-hover)",borderRadius:"8px"},children:[(0,s.jsx)("div",{style:{marginBottom:"0.5rem",fontWeight:500},children:"Select features to add:"}),(0,s.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:"0.5rem",marginBottom:"1rem"},children:r.map(e=>(0,s.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:"0.5rem",cursor:"pointer"},children:[(0,s.jsx)("input",{type:"checkbox",checked:v.includes(e.id),onChange:t=>{t.target.checked?u([...v,e.id]):u(v.filter(t=>t!==e.id))}}),(0,s.jsx)("code",{style:{color:"var(--warning)"},children:e.id}),(0,s.jsx)("span",{children:e.title})]},e.id))}),(0,s.jsxs)("div",{style:{display:"flex",gap:"0.5rem"},children:[(0,s.jsx)("button",{onClick:()=>{x(!1),u([])},className:"btn",children:"Cancel"}),(0,s.jsx)("button",{onClick:()=>{0!==v.length&&w(async()=>{await d(e.id,v),x(!1),u([])})},className:"btn btn-primary",disabled:R||0===v.length,children:R?"Adding...":`Add ${v.length} Feature${1!==v.length?"s":""}`})]})]}),0===t.length?(0,s.jsx)("p",{style:{color:"var(--text-secondary)"},children:"No features tagged yet. Add features to track them in this release."}):(0,s.jsx)("div",{style:{display:"grid",gap:"0.5rem"},children:t.map(t=>(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",padding:"0.75rem 1rem",background:"var(--bg-hover)",borderRadius:"8px"},children:[(0,s.jsxs)(l(),{href:`/specs/${t.id}`,style:{flex:1,textDecoration:"none"},children:[(0,s.jsx)("code",{style:{fontWeight:600,color:"var(--warning)",marginRight:"0.75rem"},children:t.id}),(0,s.jsx)("span",{style:{color:"var(--text-primary)"},children:t.title}),(0,s.jsxs)("span",{style:{marginLeft:"0.75rem",color:"var(--text-secondary)",fontSize:"0.875rem"},children:[t.scenario_count," scenarios"]})]}),(0,s.jsx)("button",{onClick:()=>{var r;return r=t.id,void w(async()=>{await c(e.id,r)})},className:"btn",style:{padding:"0.25rem 0.5rem",fontSize:"0.75rem"},disabled:R,children:"\xd7"})]},t.id))})]}),(0,s.jsxs)("div",{className:"card",children:[(0,s.jsxs)("h2",{className:"card-title",children:["\uD83E\uDDEA Test Runs (",a.length,")"]}),0===a.length?(0,s.jsxs)("p",{style:{color:"var(--text-secondary)"},children:["No test runs yet. Import Cucumber results: ",(0,s.jsxs)("code",{children:["machine release import-results results.json -r ",e.id]})]}):(0,s.jsx)("div",{style:{display:"grid",gap:"0.75rem"},children:a.map(e=>{let t=e.total>0?e.passed/e.total*100:0,r=y===e.id;return(0,s.jsxs)("div",{style:{padding:"1rem",background:"var(--bg-hover)",borderRadius:"8px"},children:[(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",cursor:"pointer"},onClick:()=>j(r?null:e.id),children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{style:{fontWeight:600,marginBottom:"0.25rem"},children:[e.failed>0?"❌":"✅"," Run #",e.id," ",r?"\uD83D\uDD3D":"▶"]}),(0,s.jsxs)("div",{style:{fontSize:"0.875rem",color:"var(--text-secondary)"},children:[e.run_date," • ",e.source]})]}),(0,s.jsxs)("div",{style:{display:"flex",gap:"1rem",textAlign:"center"},children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{style:{fontWeight:700,color:"var(--success)"},children:e.passed}),(0,s.jsx)("div",{style:{fontSize:"0.75rem",color:"var(--text-secondary)"},children:"Passed"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{style:{fontWeight:700,color:"var(--error)"},children:e.failed}),(0,s.jsx)("div",{style:{fontSize:"0.75rem",color:"var(--text-secondary)"},children:"Failed"})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{style:{fontWeight:700,color:100===t?"var(--success)":t>=80?"var(--warning)":"var(--error)"},children:[t.toFixed(0),"%"]}),(0,s.jsx)("div",{style:{fontSize:"0.75rem",color:"var(--text-secondary)"},children:"Pass Rate"})]})]})]}),r&&(0,s.jsx)("div",{style:{marginTop:"1rem",paddingTop:"1rem",borderTop:"1px solid var(--border)"},children:(0,s.jsx)("p",{style:{fontStyle:"italic",color:"var(--text-secondary)"},children:"Detailed results view would go here. For now, check the console logs or database for failure details."})})]},e.id)})})]}),f.isOpen&&(0,s.jsx)("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:"rgba(0,0,0,0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:100},children:(0,s.jsxs)("div",{className:"card",style:{width:"500px",maxWidth:"90%"},children:[(0,s.jsx)("h2",{className:"card-title",children:"Log Defect / Deviation"}),(0,s.jsxs)("div",{style:{marginBottom:"1rem"},children:[(0,s.jsxs)("label",{style:{display:"block",marginBottom:"0.5rem"},children:["Title ",(0,s.jsx)("span",{style:{color:"var(--error)"},children:"*"})]}),(0,s.jsx)("input",{className:"input",value:S.title,onChange:e=>{N({...S,title:e.target.value}),e.target.value&&k(e=>({...e,titleError:!1}))},placeholder:"Defect summary",style:C.titleError?{borderColor:"var(--error)",boxShadow:"0 0 0 2px rgba(239, 68, 68, 0.2)"}:{}}),C.titleError&&(0,s.jsx)("div",{style:{color:"var(--error)",fontSize:"0.75rem",marginTop:"0.25rem"},children:"Title is required"})]}),(0,s.jsxs)("div",{style:{marginBottom:"1rem"},children:[(0,s.jsxs)("label",{style:{display:"block",marginBottom:"0.5rem"},children:["Description & Root Cause ",(0,s.jsx)("span",{style:{color:"var(--error)"},children:"*"})]}),(0,s.jsx)("textarea",{className:"input",rows:5,value:S.description,onChange:e=>{N({...S,description:e.target.value}),e.target.value&&k(e=>({...e,descriptionError:!1}))},placeholder:"Describe the failure, root cause, and why it is acceptable (if deviating) or mitigation plan.",style:C.descriptionError?{borderColor:"var(--error)",boxShadow:"0 0 0 2px rgba(239, 68, 68, 0.2)"}:{}}),C.descriptionError&&(0,s.jsx)("div",{style:{color:"var(--error)",fontSize:"0.75rem",marginTop:"0.25rem"},children:"Description is required"})]}),(0,s.jsxs)("div",{style:{marginBottom:"1rem"},children:[(0,s.jsx)("label",{style:{display:"block",marginBottom:"0.5rem"},children:"Status"}),(0,s.jsxs)("select",{className:"input",value:S.status,onChange:e=>N({...S,status:e.target.value}),children:[(0,s.jsx)("option",{value:"open",children:"Open (Needs Fix)"}),(0,s.jsx)("option",{value:"resolved",children:"Resolved (Fixed)"}),(0,s.jsx)("option",{value:"accepted",children:"Accepted (Permanent Deviation)"})]})]}),(0,s.jsxs)("div",{style:{display:"flex",gap:"0.5rem",justifyContent:"flex-end"},children:[(0,s.jsx)("button",{className:"btn",onClick:()=>{b({isOpen:!1}),k({titleError:!1,descriptionError:!1})},children:"Cancel"}),(0,s.jsx)("button",{className:"btn btn-primary",onClick:()=>{let t=!S.title.trim(),r=!S.description.trim();t||r?k({titleError:t,descriptionError:r}):w(async()=>{try{await m({releaseId:e.id,testResultId:f.testResultId,title:S.title,description:S.description,status:S.status}),b({isOpen:!1}),N({title:"",description:"",status:"open"})}catch(e){console.error("Failed to create defect:",e),alert("Failed to create defect. Check console for details.")}})},disabled:R,children:R?"Logging...":"Log Defect"})]})]})})]})}},9339:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s={callServer:function(){return a.callServer},createServerReference:function(){return n.createServerReference},findSourceMapURL:function(){return l.findSourceMapURL}};for(var i in s)Object.defineProperty(t,i,{enumerable:!0,get:s[i]});let a=r(7304),l=r(4060),n=r(7197)}},e=>{e.O(0,[500,441,794,358],()=>e(e.s=4926)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[549],{4815:(e,t,r)=>{"use strict";r.d(t,{ReleasesClient:()=>c});var s=r(5155),a=r(2115),l=r(8500),n=r.n(l),i=r(9339);let o=(0,i.createServerReference)("40d511dc3a76cac7d4c145452256536f04babc742d",i.callServer,void 0,i.findSourceMapURL,"createReleaseAction");function c({releases:e}){let[t,r]=(0,a.useState)(!1),[l,n]=(0,a.useState)(""),[i,c]=(0,a.useState)(""),[m,x]=(0,a.useState)(""),[h,g]=(0,a.useTransition)();return(0,s.jsxs)("div",{style:{maxWidth:"1200px",margin:"0 auto",padding:"2rem"},children:[(0,s.jsx)("header",{style:{marginBottom:"2rem"},children:(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{style:{fontSize:"2rem",fontWeight:700,marginBottom:"0.5rem"},children:"\uD83D\uDCE6 Releases"}),(0,s.jsx)("p",{style:{color:"var(--text-secondary)"},children:"Manage releases, track test execution, and compare changes"})]}),(0,s.jsx)("button",{onClick:()=>r(!0),className:"btn btn-primary",children:"+ New Release"})]})}),t&&(0,s.jsxs)("div",{className:"card",style:{marginBottom:"1.5rem"},children:[(0,s.jsx)("h2",{className:"card-title",children:"Create New Release"}),(0,s.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 2fr",gap:"1rem",marginBottom:"1rem"},children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{style:{display:"block",fontWeight:500,marginBottom:"0.5rem"},children:"Version"}),(0,s.jsx)("input",{type:"text",value:l,onChange:e=>n(e.target.value),placeholder:"1.0.0",className:"input"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{style:{display:"block",fontWeight:500,marginBottom:"0.5rem"},children:"Name"}),(0,s.jsx)("input",{type:"text",value:i,onChange:e=>c(e.target.value),placeholder:"Initial Release",className:"input"})]})]}),(0,s.jsxs)("div",{style:{marginBottom:"1rem"},children:[(0,s.jsx)("label",{style:{display:"block",fontWeight:500,marginBottom:"0.5rem"},children:"Notes (optional)"}),(0,s.jsx)("textarea",{value:m,onChange:e=>x(e.target.value),placeholder:"Release notes...",rows:3,className:"input",style:{resize:"vertical"}})]}),(0,s.jsxs)("div",{style:{display:"flex",gap:"0.5rem"},children:[(0,s.jsx)("button",{onClick:()=>r(!1),className:"btn",disabled:h,children:"Cancel"}),(0,s.jsx)("button",{onClick:()=>{g(async()=>{await o({version:l,name:i,notes:m||void 0}),r(!1),n(""),c(""),x("")})},className:"btn btn-primary",disabled:h||!l||!i,children:h?"Creating...":"Create Release"})]})]}),0===e.length?(0,s.jsxs)("div",{className:"card",style:{textAlign:"center",padding:"3rem"},children:[(0,s.jsx)("p",{style:{fontSize:"3rem",marginBottom:"1rem"},children:"\uD83D\uDCE6"}),(0,s.jsx)("h2",{style:{marginBottom:"0.5rem"},children:"No Releases Yet"}),(0,s.jsx)("p",{style:{color:"var(--text-secondary)",marginBottom:"1rem"},children:"Create your first release to start tracking features and test results."}),(0,s.jsx)("button",{onClick:()=>r(!0),className:"btn btn-primary",children:"Create First Release"})]}):(0,s.jsx)("div",{style:{display:"grid",gap:"1rem"},children:e.map(e=>(0,s.jsx)(d,{release:e},e.id))})]})}function d({release:e}){let t={planning:{bg:"rgba(168, 85, 247, 0.1)",color:"#a855f7"},testing:{bg:"rgba(59, 130, 246, 0.1)",color:"#3b82f6"},released:{bg:"rgba(34, 197, 94, 0.1)",color:"#22c55e"}}[e.status];return(0,s.jsx)(n(),{href:`/releases/${e.id}`,style:{textDecoration:"none"},children:(0,s.jsx)("div",{className:"card",style:{borderLeft:`4px solid ${t.color}`,transition:"transform 0.15s, box-shadow 0.15s",cursor:"pointer"},children:(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start"},children:[(0,s.jsxs)("div",{style:{flex:1},children:[(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem",marginBottom:"0.5rem"},children:[(0,s.jsx)("code",{style:{fontSize:"1.25rem",fontWeight:700,color:t.color},children:e.id}),(0,s.jsxs)("span",{style:{fontSize:"1rem",fontWeight:600,color:"var(--text-primary)"},children:["v",e.version]}),(0,s.jsx)("span",{className:"badge",style:{background:t.bg,color:t.color},children:e.status})]}),(0,s.jsx)("h3",{style:{fontSize:"1.125rem",fontWeight:600,marginBottom:"0.5rem",color:"var(--text-primary)"},children:e.name}),(0,s.jsxs)("p",{style:{fontSize:"0.875rem",color:"var(--text-secondary)"},children:["Created ",e.created_at,e.released_at&&` • Released ${e.released_at}`]})]}),(0,s.jsxs)("div",{style:{display:"flex",gap:"1.5rem",textAlign:"center"},children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{style:{fontSize:"1.5rem",fontWeight:700,color:"var(--warning)"},children:e.fs_count}),(0,s.jsx)("div",{style:{fontSize:"0.75rem",color:"var(--text-secondary)"},children:"Features"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{style:{fontSize:"1.5rem",fontWeight:700,color:"var(--accent)"},children:e.test_runs}),(0,s.jsx)("div",{style:{fontSize:"0.75rem",color:"var(--text-secondary)"},children:"Test Runs"})]}),null!==e.latest_pass_rate&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{style:{fontSize:"1.5rem",fontWeight:700,color:100===e.latest_pass_rate?"var(--success)":e.latest_pass_rate>=80?"var(--warning)":"var(--error)"},children:[e.latest_pass_rate.toFixed(0),"%"]}),(0,s.jsx)("div",{style:{fontSize:"0.75rem",color:"var(--text-secondary)"},children:"Pass Rate"})]})]})]})})})}},5411:(e,t,r)=>{Promise.resolve().then(r.bind(r,4815))},9339:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s={callServer:function(){return l.callServer},createServerReference:function(){return i.createServerReference},findSourceMapURL:function(){return n.findSourceMapURL}};for(var a in s)Object.defineProperty(t,a,{enumerable:!0,get:s[a]});let l=r(7304),n=r(4060),i=r(7197)}},e=>{e.O(0,[500,441,794,358],()=>e(e.s=5411)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[385],{275:(e,t,a)=>{"use strict";a.d(t,{URSDetailClient:()=>d});var r=a(5155),i=a(2115),s=a(8500),l=a.n(s),n=a(9339);let c=(0,n.createServerReference)("603c9bda0fbb0e0ca172cad506bef77f133f0f1640",n.callServer,void 0,n.findSourceMapURL,"updateURSAction");function d({urs:e,linkedFS:t,linkedRisks:a}){let[s,n]=(0,i.useState)(!1),[d,p]=(0,i.useTransition)(),[m,h]=(0,i.useState)({title:e.title,status:e.status,priority:e.priority,owner:e.owner,category:e.category,business_need:e.business_need,intended_use:e.intended_use,acceptance_criteria:e.acceptance_criteria}),u=e.title.includes("(Undefined)"),g=({value:e,onChange:t,multiline:a,placeholder:i})=>s?a?(0,r.jsx)("textarea",{value:e,onChange:e=>t(e.target.value),rows:4,className:"input",style:{width:"100%",resize:"vertical"}}):(0,r.jsx)("input",{type:"text",value:e,onChange:e=>t(e.target.value),className:"input",style:{width:"100%"}}):(0,r.jsx)("span",{style:{whiteSpace:"pre-wrap",color:"var(--text-secondary)",fontStyle:e?"normal":"italic"},children:e||i||"Not defined"}),x=({value:e,onChange:t,options:a})=>s?(0,r.jsx)("select",{value:e,onChange:e=>t(e.target.value),className:"input",children:a.map(e=>(0,r.jsx)("option",{value:e.value,children:e.label},e.value))}):(0,r.jsx)("span",{style:{textTransform:"capitalize"},children:e});return(0,r.jsxs)("div",{children:[(0,r.jsxs)("header",{className:"page-header",children:[(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"1rem",marginBottom:"0.5rem",flexWrap:"wrap"},children:[(0,r.jsx)("code",{style:{fontSize:"1.5rem",fontWeight:700,color:"var(--success)",background:"rgba(16, 185, 129, 0.1)",padding:"0.5rem 1rem",borderRadius:"8px"},children:e.id}),s?(0,r.jsx)(x,{value:m.status,onChange:e=>h({...m,status:e}),options:[{value:"draft",label:"Draft"},{value:"review",label:"Review"},{value:"approved",label:"Approved"}]}):(0,r.jsx)("span",{className:`badge ${"approved"===e.status?"badge-success":"badge-warning"}`,children:m.status}),s?(0,r.jsx)(x,{value:m.priority,onChange:e=>h({...m,priority:e}),options:[{value:"critical",label:"Critical"},{value:"high",label:"High"},{value:"medium",label:"Medium"},{value:"low",label:"Low"}]}):(0,r.jsx)("span",{className:"badge",style:{background:"var(--bg-hover)"},children:m.priority}),u&&!s&&(0,r.jsx)("span",{className:"badge",style:{background:"rgba(239, 68, 68, 0.2)",color:"var(--error)"},children:"Needs Definition"}),(0,r.jsx)("div",{style:{marginLeft:"auto",display:"flex",gap:"0.5rem"},children:s?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{onClick:()=>{h({title:e.title,status:e.status,priority:e.priority,owner:e.owner,category:e.category,business_need:e.business_need,intended_use:e.intended_use,acceptance_criteria:e.acceptance_criteria}),n(!1)},className:"btn",disabled:d,children:"Cancel"}),(0,r.jsx)("button",{onClick:()=>{p(async()=>{await c(e.id,m),n(!1)})},className:"btn btn-primary",disabled:d,children:d?"Saving...":"\uD83D\uDCBE Save"})]}):(0,r.jsx)("button",{onClick:()=>n(!0),className:"btn btn-primary",children:"✏️ Edit"})})]}),s?(0,r.jsx)("input",{type:"text",value:m.title,onChange:e=>h({...m,title:e.target.value}),className:"input",style:{fontSize:"1.5rem",fontWeight:700,width:"100%",marginBottom:"0.5rem"}}):(0,r.jsx)("h1",{className:"page-title",children:m.title}),(0,r.jsxs)("p",{className:"page-subtitle",children:["User Requirement Specification • Owner: ",s?(0,r.jsx)("input",{type:"text",value:m.owner,onChange:e=>h({...m,owner:e.target.value}),className:"input",style:{width:"200px",display:"inline-block"}}):m.owner]})]}),u&&!s&&(0,r.jsx)("div",{className:"card",style:{marginBottom:"1.5rem",background:"rgba(239, 68, 68, 0.1)",borderLeft:"4px solid var(--error)"},children:(0,r.jsxs)("p",{style:{margin:0,color:"var(--error)"},children:["⚠️ This URS was auto-created from FS references. Click ",(0,r.jsx)("strong",{children:"Edit"})," to define its details."]})}),(0,r.jsxs)("div",{className:"card",style:{marginBottom:"1.5rem"},children:[(0,r.jsx)("h2",{className:"card-title",children:"\uD83D\uDD17 Traceability"}),(0,r.jsxs)("div",{style:{display:"flex",gap:"2rem",flexWrap:"wrap"},children:[(0,r.jsx)(o,{label:"Functional Specs",count:t.length,color:"var(--warning)"}),(0,r.jsx)(o,{label:"Test Scenarios",count:t.reduce((e,t)=>e+t.scenarios.length,0),color:"var(--accent)"}),(0,r.jsx)(o,{label:"Risk Assessments",count:a.length,color:"#f97316"})]})]}),(0,r.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"1.5rem"},children:[(0,r.jsxs)("div",{className:"card",children:[(0,r.jsx)("h2",{className:"card-title",children:"\uD83D\uDCCB Business Need"}),(0,r.jsx)("div",{style:{lineHeight:1.7},children:(0,r.jsx)(g,{value:m.business_need,onChange:e=>h({...m,business_need:e}),multiline:!0,placeholder:"Not defined"})})]}),(0,r.jsxs)("div",{className:"card",children:[(0,r.jsx)("h2",{className:"card-title",children:"\uD83C\uDFAF Intended Use"}),(0,r.jsx)("div",{style:{lineHeight:1.7},children:(0,r.jsx)(g,{value:m.intended_use,onChange:e=>h({...m,intended_use:e}),multiline:!0,placeholder:"Not defined"})})]})]}),(0,r.jsxs)("div",{className:"card",style:{marginTop:"1.5rem"},children:[(0,r.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"1rem"},children:[(0,r.jsx)("h2",{className:"card-title",style:{margin:0},children:"✅ Acceptance Criteria"}),s&&(0,r.jsx)("button",{onClick:()=>h({...m,acceptance_criteria:[...m.acceptance_criteria,""]}),className:"btn",style:{padding:"0.25rem 0.75rem"},children:"+ Add"})]}),0===m.acceptance_criteria.length?(0,r.jsx)("p",{style:{color:"var(--text-secondary)",fontStyle:"italic"},children:"No acceptance criteria defined"}):s?(0,r.jsx)("div",{style:{display:"grid",gap:"0.5rem"},children:m.acceptance_criteria.map((e,t)=>(0,r.jsxs)("div",{style:{display:"flex",gap:"0.5rem"},children:[(0,r.jsx)("input",{type:"text",value:e,onChange:e=>{let a=[...m.acceptance_criteria];a[t]=e.target.value,h({...m,acceptance_criteria:a})},className:"input",style:{flex:1},placeholder:`Criterion ${t+1}`}),(0,r.jsx)("button",{onClick:()=>h({...m,acceptance_criteria:m.acceptance_criteria.filter((e,a)=>a!==t)}),className:"btn",style:{padding:"0.5rem"},children:"\xd7"})]},t))}):(0,r.jsx)("ul",{style:{margin:0,paddingLeft:"1.5rem"},children:m.acceptance_criteria.map((e,t)=>(0,r.jsx)("li",{style:{marginBottom:"0.5rem",color:"var(--text-secondary)"},children:e},t))})]}),(0,r.jsxs)("div",{className:"card",style:{marginTop:"1.5rem"},children:[(0,r.jsx)("h2",{className:"card-title",children:"⚙️ Linked Functional Specifications"}),0===t.length?(0,r.jsx)("p",{style:{color:"var(--text-secondary)"},children:"No FS linked yet"}):(0,r.jsx)("div",{style:{display:"grid",gap:"1rem"},children:t.map(e=>(0,r.jsx)(l(),{href:`/specs/${e.id}`,style:{textDecoration:"none"},children:(0,r.jsx)("div",{style:{padding:"1rem",background:"var(--bg-hover)",borderRadius:"8px",borderLeft:"4px solid var(--warning)"},children:(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem"},children:[(0,r.jsx)("code",{style:{fontWeight:600,color:"var(--warning)"},children:e.id}),(0,r.jsx)("span",{style:{color:"var(--text-primary)"},children:e.title}),(0,r.jsxs)("span",{className:"badge badge-success",style:{marginLeft:"auto"},children:[e.scenario_count," tests"]})]})})},e.id))})]})]})}function o({label:e,count:t,color:a}){return(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{style:{fontSize:"0.75rem",color:"var(--text-secondary)",marginBottom:"0.25rem"},children:e}),(0,r.jsx)("div",{style:{fontSize:"1.5rem",fontWeight:700,color:a},children:t})]})}},6164:(e,t,a)=>{Promise.resolve().then(a.t.bind(a,8500,23)),Promise.resolve().then(a.bind(a,8220)),Promise.resolve().then(a.bind(a,8169)),Promise.resolve().then(a.bind(a,275))},8169:(e,t,a)=>{"use strict";a.d(t,{ScenarioList:()=>l});var r=a(5155),i=a(2115);function s({scenario:e,isHighlighted:t}){return(0,r.jsxs)("div",{style:{padding:"1rem",background:t?"rgba(96, 165, 250, 0.1)":"var(--bg-hover)",borderRadius:"8px",border:t?"2px solid var(--accent)":"1px solid var(--border)"},children:[(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem",marginBottom:"0.75rem"},children:[(0,r.jsx)("span",{style:{color:"var(--accent)"},children:"\uD83E\uDDEA"}),(0,r.jsx)("span",{style:{fontWeight:600},children:e.name}),e.tags.length>0&&(0,r.jsx)("span",{style:{marginLeft:"auto",fontSize:"0.75rem",color:"var(--text-secondary)"},children:e.tags.join(" ")})]}),(0,r.jsx)("div",{style:{fontFamily:"monospace",fontSize:"0.8125rem",lineHeight:1.6},children:e.steps.map((e,t)=>{var a;return(0,r.jsx)("div",{style:{color:(a=e).startsWith("Given")?"#a78bfa":a.startsWith("When")?"#60a5fa":a.startsWith("Then")?"#34d399":"var(--text-secondary)"},children:e},t)})})]})}function l({scenarios:e,highlightScenario:t}){let a=(0,i.useRef)(null);return(0,i.useEffect)(()=>{t&&a.current&&setTimeout(()=>{a.current?.scrollIntoView({behavior:"smooth",block:"center"})},100)},[t]),(0,r.jsx)("div",{style:{display:"grid",gap:"0.75rem"},children:e.map((e,i)=>{let l=t===e.name;return(0,r.jsx)("div",{ref:l?a:void 0,children:(0,r.jsx)(s,{scenario:e,isHighlighted:l})},i)})})}a(8500)},8220:(e,t,a)=>{"use strict";a.d(t,{RiskDetailClient:()=>d});var r=a(5155),i=a(2115),s=a(8500),l=a.n(s),n=a(9339);let c=(0,n.createServerReference)("6019bc063222ae2970a4725211376e4841d01aea8b",n.callServer,void 0,n.findSourceMapURL,"updateRiskAction");function d({risk:e,linkedFS:t}){let[a,s]=(0,i.useState)(!1),[n,d]=(0,i.useTransition)(),[m,h]=(0,i.useState)({title:e.title,status:e.status,category:e.category,impact:e.impact,probability:e.probability,risk_level:e.risk_level,residual_risk:e.residual_risk}),u=e.title.includes("(Undefined)");return(0,r.jsxs)("div",{children:[(0,r.jsxs)("header",{className:"page-header",children:[(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"1rem",marginBottom:"0.5rem",flexWrap:"wrap"},children:[(0,r.jsx)("code",{style:{fontSize:"1.5rem",fontWeight:700,color:"#f97316",background:"rgba(249, 115, 22, 0.1)",padding:"0.5rem 1rem",borderRadius:"8px"},children:e.id}),a?(0,r.jsx)(({value:e,onChange:t,options:i})=>a?(0,r.jsx)("select",{value:e,onChange:e=>t(e.target.value),className:"input",children:i.map(e=>(0,r.jsx)("option",{value:e.value,children:e.label},e.value))}):(0,r.jsx)("span",{style:{textTransform:"capitalize"},children:e}),{value:m.status,onChange:e=>h({...m,status:e}),options:[{value:"draft",label:"Draft"},{value:"review",label:"Review"},{value:"approved",label:"Approved"}]}):(0,r.jsx)("span",{className:`badge ${"approved"===e.status?"badge-success":"badge-warning"}`,children:m.status}),(0,r.jsx)(p,{level:m.risk_level}),u&&!a&&(0,r.jsx)("span",{className:"badge",style:{background:"rgba(239, 68, 68, 0.2)",color:"var(--error)"},children:"Needs Definition"}),(0,r.jsx)("div",{style:{marginLeft:"auto",display:"flex",gap:"0.5rem"},children:a?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{onClick:()=>{h({title:e.title,status:e.status,category:e.category,impact:e.impact,probability:e.probability,risk_level:e.risk_level,residual_risk:e.residual_risk}),s(!1)},className:"btn",disabled:n,children:"Cancel"}),(0,r.jsx)("button",{onClick:()=>{d(async()=>{await c(e.id,m),s(!1)})},className:"btn btn-primary",disabled:n,children:n?"Saving...":"\uD83D\uDCBE Save"})]}):(0,r.jsx)("button",{onClick:()=>s(!0),className:"btn btn-primary",children:"✏️ Edit"})})]}),a?(0,r.jsx)("input",{type:"text",value:m.title,onChange:e=>h({...m,title:e.target.value}),className:"input",style:{fontSize:"1.5rem",fontWeight:700,width:"100%",marginBottom:"0.5rem"}}):(0,r.jsx)("h1",{className:"page-title",children:m.title}),(0,r.jsxs)("p",{className:"page-subtitle",children:["Risk Assessment • Category: ",a?(0,r.jsx)("input",{type:"text",value:m.category,onChange:e=>h({...m,category:e.target.value}),className:"input",style:{width:"200px",display:"inline-block"}}):m.category," • GAMP Category ",e.gamp_category]})]}),u&&!a&&(0,r.jsx)("div",{className:"card",style:{marginBottom:"1.5rem",background:"rgba(239, 68, 68, 0.1)",borderLeft:"4px solid var(--error)"},children:(0,r.jsxs)("p",{style:{margin:0,color:"var(--error)"},children:["⚠️ This Risk was auto-created from FS references. Click ",(0,r.jsx)("strong",{children:"Edit"})," to define its details."]})}),(0,r.jsx)("div",{className:"card",style:{marginBottom:"1.5rem"},children:(0,r.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:"1rem"},children:[(0,r.jsx)(o,{label:"Impact",value:m.impact,isEditing:a,onChange:e=>h({...m,impact:e}),options:["low","medium","high","critical"]}),(0,r.jsx)(o,{label:"Probability",value:m.probability,isEditing:a,onChange:e=>h({...m,probability:e}),options:["low","medium","high"]}),(0,r.jsx)(o,{label:"Risk Level",value:m.risk_level,isEditing:a,onChange:e=>h({...m,risk_level:e}),options:["low","medium","high","critical"]}),(0,r.jsx)(o,{label:"Residual Risk",value:m.residual_risk,isEditing:a,onChange:e=>h({...m,residual_risk:e}),options:["acceptable","unacceptable","pending"]})]})}),(0,r.jsxs)("div",{className:"card",style:{marginBottom:"1.5rem"},children:[(0,r.jsx)("h2",{className:"card-title",children:"⚙️ Linked Functional Specifications"}),(0,r.jsx)("div",{style:{display:"flex",gap:"0.5rem",flexWrap:"wrap"},children:t.map(e=>(0,r.jsx)(l(),{href:`/specs/${e.id}`,children:(0,r.jsxs)("span",{className:"badge",style:{background:"rgba(245, 158, 11, 0.15)",color:"var(--warning)",padding:"0.5rem 1rem"},children:[e.id," - ",e.title]})},e.id))})]}),(0,r.jsxs)("div",{className:"card",style:{marginBottom:"1.5rem"},children:[(0,r.jsx)("h2",{className:"card-title",children:"\uD83D\uDD34 Identified Risks"}),0===e.risks.length?(0,r.jsx)("p",{style:{color:"var(--text-secondary)",fontStyle:"italic"},children:"No risks defined yet"}):(0,r.jsx)("div",{style:{display:"grid",gap:"0.5rem"},children:e.risks.map((e,t)=>(0,r.jsxs)("div",{style:{padding:"0.75rem 1rem",background:"var(--bg-hover)",borderRadius:"6px",display:"flex",alignItems:"center",gap:"1rem"},children:[(0,r.jsx)("code",{style:{fontWeight:600,color:"#f97316"},children:e.id}),(0,r.jsx)("span",{style:{flex:1,color:"var(--text-secondary)"},children:e.description}),(0,r.jsx)(p,{level:e.impact,small:!0})]},t))})]}),(0,r.jsxs)("div",{className:"card",children:[(0,r.jsx)("h2",{className:"card-title",children:"\uD83D\uDEE1️ Mitigations"}),0===e.mitigations.length?(0,r.jsx)("p",{style:{color:"var(--text-secondary)",fontStyle:"italic"},children:"No mitigations defined yet"}):(0,r.jsxs)("table",{className:"table",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:"Risk"}),(0,r.jsx)("th",{children:"Control"}),(0,r.jsx)("th",{children:"Test"})]})}),(0,r.jsx)("tbody",{children:e.mitigations.map((e,t)=>(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("code",{children:e.risk_id})}),(0,r.jsx)("td",{children:e.control}),(0,r.jsx)("td",{style:{color:"var(--text-secondary)"},children:e.test})]},t))})]})]})]})}function o({label:e,value:t,isEditing:a,onChange:i,options:s}){let l=m(t);return(0,r.jsxs)("div",{style:{textAlign:"center",padding:"1rem",background:"var(--bg-hover)",borderRadius:"8px"},children:[(0,r.jsx)("div",{style:{fontSize:"0.75rem",color:"var(--text-secondary)",marginBottom:"0.25rem"},children:e}),a?(0,r.jsx)("select",{value:t,onChange:e=>i(e.target.value),className:"input",style:{width:"100%",textAlign:"center"},children:s.map(e=>(0,r.jsx)("option",{value:e,style:{textTransform:"capitalize"},children:e},e))}):(0,r.jsx)("div",{style:{fontSize:"1.25rem",fontWeight:700,color:l,textTransform:"capitalize"},children:t})]})}function p({level:e,small:t}){let a=m(e);return(0,r.jsx)("span",{className:"badge",style:{background:`${a}20`,color:a,padding:t?"0.25rem 0.5rem":"0.5rem 1rem",fontSize:t?"0.75rem":"0.875rem",textTransform:"capitalize"},children:e})}function m(e){switch(e){case"critical":case"unacceptable":return"#dc2626";case"high":return"#f97316";case"medium":case"pending":return"#eab308";case"low":case"acceptable":return"#22c55e";default:return"var(--text-secondary)"}}},9339:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={callServer:function(){return s.callServer},createServerReference:function(){return n.createServerReference},findSourceMapURL:function(){return l.findSourceMapURL}};for(var i in r)Object.defineProperty(t,i,{enumerable:!0,get:r[i]});let s=a(7304),l=a(4060),n=a(7197)}},e=>{e.O(0,[500,441,794,358],()=>e(e.s=6164)),_N_E=e.O()}]);