@adcops/autocore-react 3.3.67 → 3.3.70
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/components/tis/TestDataView.d.ts.map +1 -1
- package/dist/components/tis/TestDataView.js +1 -1
- package/dist/components/tis/TestSetupForm.d.ts +32 -0
- package/dist/components/tis/TestSetupForm.d.ts.map +1 -1
- package/dist/components/tis/TestSetupForm.js +1 -1
- package/dist/components/tis/TisProvider.d.ts +25 -0
- package/dist/components/tis/TisProvider.d.ts.map +1 -1
- package/dist/components/tis/TisProvider.js +1 -1
- package/dist/themes/adc-dark/blue/theme.css +17 -6
- package/dist/themes/adc-dark/blue/theme.css.map +1 -1
- package/package.json +1 -1
- package/src/components/tis/TestDataView.tsx +37 -15
- package/src/components/tis/TestSetupForm.tsx +252 -19
- package/src/components/tis/TisProvider.tsx +50 -1
- package/src/themes/adc-dark/_extensions.scss +18 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TestDataView.d.ts","sourceRoot":"","sources":["../../../src/components/tis/TestDataView.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAwE,MAAM,OAAO,CAAC;AA6B7F,MAAM,WAAW,YAAY;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,SAAS;IAAI,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CAAE;AAChF,MAAM,WAAW,WAAW;IAAG,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,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,cAAc,EAAG,YAAY,EAAE,CAAC;IAChC,aAAa,EAAI,YAAY,EAAE,CAAC;IAChC,YAAY,EAAK,YAAY,EAAE,CAAC;IAChC,cAAc,EAAG,YAAY,EAAE,CAAC;IAChC,QAAQ,CAAC,EAAQ,YAAY,GAAG,IAAI,CAAC;IACrC,KAAK,CAAC,EAAW;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,CAAC;IAC/C,wDAAwD;IACxD,KAAK,CAAC,EAAW,MAAM,CAAC;IACxB,qDAAqD;IACrD,WAAW,CAAC,EAAK,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,iBAAiB;IAC9B,oEAAoE;IACpE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mEAAmE;IACnE,QAAQ,CAAC,EAAG,MAAM,CAAC;IACnB,gEAAgE;IAChE,KAAK,CAAC,EAAM,MAAM,CAAC;IACnB,kEAAkE;IAClE,MAAM,CAAC,EAAK,UAAU,CAAC;IACvB,8EAA8E;IAC9E,UAAU,CAAC,EAAG,MAAM,CAAC;IACrB,wDAAwD;IACxD,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAID,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAkYpD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";import React,{useCallback,useContext,useEffect,useMemo,useRef,useState}from"react";import{Button}from"primereact/button";import{Column}from"primereact/column";import{DataTable}from"primereact/datatable";import{Dialog}from"primereact/dialog";import{Dropdown}from"primereact/dropdown";import{TabView,TabPanel}from"primereact/tabview";import{Chart as ChartJS,CategoryScale,LinearScale,PointElement,LineElement,Title,Tooltip,Legend}from"chart.js";import zoomPlugin from"chartjs-plugin-zoom";import{Line}from"react-chartjs-2";import{EventEmitterContext}from"../../core/EventEmitterContext";import{MessageType}from"../../hub/CommandMessage";import{useTis}from"./TisProvider";ChartJS.register(CategoryScale,LinearScale,PointElement,LineElement,Title,Tooltip,Legend,zoomPlugin);export const TestDataView=e=>{const t=useTis(),r=e.projectId??t.selection.projectId,a=e.methodId??t.selection.methodId,i=e.runId??t.selection.runId,s=e.schema??(a?t.schemas[a]:void 0),{throttleMs:l=100,cycleTableHeight:n="400px"}=e,{invoke:o,subscribe:c,unsubscribe:d}=useContext(EventEmitterContext),[m,u]=useState(null),[p,h]=useState([]),[f,g]=useState({}),[y,_]=useState(!1),[x,b]=useState(!1),[j,v]=useState(null),[w,S]=useState(null),[C,T]=useState(!1),[R,N]=useState(null),[D,I]=useState(null),[L,A]=useState(!1),O=useMemo(()=>{const e=[];for(const[t,r]of Object.entries(s?.views??{}))"cycle_scatter"===r.type&&e.push({name:t,view:r});return e},[s]),[M,E]=useState(O.length>0?O[0].name:null),k=useRef([]),z=useRef(null),F=useRef(null),H=()=>{F.current||(F.current=setTimeout(()=>{if(F.current=null,k.current.length>0){const e=k.current;k.current=[],h(t=>[...e.slice().reverse(),...t])}z.current&&(g(z.current),z.current=null)},l))};useEffect(()=>{if(!r||!a||!i)return u(null),h([]),void g({});let e=!1;return(async()=>{try{const t=await o("tis.read_test",MessageType.Request,{project_id:r,method_id:a,run_id:i});!e&&t?.success&&(u(t.data),g(t.data.results??{}));const s=await o("tis.read_cycles",MessageType.Request,{project_id:r,method_id:a,run_id:i,offset:0,limit:200,order:"desc"});!e&&s?.success&&h(s.data.cycles??[])}catch(e){}})(),()=>{e=!0}},[r,a,i,o]),useEffect(()=>{const e=e=>e?.project_id===r&&e?.method_id===a&&e?.run_id===i,t=c("tis.cycle_added",t=>{e(t)&&t.cycle&&(k.current.push(t.cycle),H())}),s=c("tis.results_updated",t=>{e(t)&&(z.current=t.results??{},H())});return()=>{d(t),d(s),F.current&&(clearTimeout(F.current),F.current=null)}},[r,a,i,l]);const P=useMemo(()=>{if(!M||0===O.length)return null;const e=O.find(e=>e.name===M)?.view;if(!e)return null;const t=e.x.field,r=[...p].reverse();return{labels:r.map(e=>e[t]),datasets:e.y.map((e,t)=>({label:e.label??e.field,data:r.map(t=>t[e.field]),yAxisID:"right"===e.y_axis?"y1":"y",borderColor:palette(t),backgroundColor:palette(t),tension:.1,pointRadius:2}))}},[p,M,O]),V=O.find(e=>e.name===M)?.view,$=V?.y.some(e=>"right"===e.y_axis)??!1,B=useMemo(()=>({responsive:!0,maintainAspectRatio:!1,scales:{x:{title:{display:!!V?.x.label,text:V?.x.label}},y:{position:"left",title:{display:!0,text:leftAxisLabel(V)}},...$?{y1:{position:"right",grid:{drawOnChartArea:!1},title:{display:!0,text:rightAxisLabel(V)}}}:{}},plugins:{legend:{display:!0},zoom:{pan:{enabled:!0,mode:"xy"},zoom:{wheel:{enabled:!0},pinch:{enabled:!0},mode:"xy"}}}}),[V,$]),q=s?.raw_data?.blob_name??"trace",J=useRef(""),G=useCallback(async()=>{if(!r||!a||!i)return;const e=`${r}|${a}|${i}|${q}`;if(J.current!==e){J.current=e,T(!0),S(null),v(null);try{const e=await o("tis.read_raw",MessageType.Request,{project_id:r,method_id:a,run_id:i,name:q});e?.success?v(e.data??{}):S(e?.error_message??"No raw data on disk for this run.")}catch(e){S(String(e?.message??e))}finally{T(!1)}A(!0),I(null),N(null);try{const e=await o("tis.read_filtered",MessageType.Request,{project_id:r,method_id:a,run_id:i,name:q});e?.success?N(e.data??{}):I(e?.error_message??"No filtered data on disk for this run.")}catch(e){I(String(e?.message??e))}finally{A(!1)}}},[r,a,i,q,o]);useEffect(()=>{J.current=""},[r,a,i,q]);return r&&a&&i&&s?_jsxs("div",{className:"vblock",style:{display:"flex",flexDirection:"column",gap:"1rem"},children:[_jsx(Header,{meta:m,config:m?.config,runId:i,projectId:r,methodId:a,canViewRaw:!!s.raw_data,onViewRaw:()=>{_(!0),G()},onShowConfig:()=>b(!0)}),O.length>0&&_jsxs("div",{className:"p-card",style:{padding:"1rem"},children:[_jsxs("div",{className:"flex",style:{gap:"1rem",alignItems:"center",marginBottom:"0.5rem"},children:[_jsx(Dropdown,{value:M,options:O.map(e=>({label:e.view.title??e.name,value:e.name})),onChange:e=>E(e.value),placeholder:"Select a view"}),_jsx("h3",{style:{margin:0},children:V?.title??""})]}),_jsx("div",{style:{height:320},children:P&&_jsx(Line,{data:P,options:B})})]}),_jsxs("div",{className:"p-card",style:{padding:"1rem"},children:[_jsxs("h3",{style:{marginTop:0},children:["Cycle Data (",p.length,")"]}),_jsx(DataTable,{value:p,scrollable:!0,scrollHeight:n,virtualScrollerOptions:{itemSize:38},emptyMessage:"No cycles yet.",children:s.cycle_fields.map(e=>_jsx(Column,{field:e.name,header:e.units?`${e.name} (${e.units})`:e.name,body:t=>formatCell(t[e.name],e.type)},e.name))})]}),_jsxs("div",{className:"p-card",style:{padding:"1rem"},children:[_jsx("h3",{style:{marginTop:0},children:"Results"}),_jsx(ResultsGrid,{schema:s.results_fields,values:f})]}),s.raw_data&&_jsx(Dialog,{visible:y,onHide:()=>_(!1),header:`Run Data — ${i}`,style:{width:"90vw",height:"80vh"},maximizable:!0,children:_jsxs(TabView,{style:{height:"100%"},children:[_jsx(TabPanel,{header:"Raw Data",children:_jsx(DataBlobTable,{blob:j,loading:C,error:w,rawData:s.raw_data})}),_jsx(TabPanel,{header:"Filtered Data",children:_jsx(DataBlobTable,{blob:R,loading:L,error:D,rawData:s.raw_data,emptyMessage:"Filtered data is written by post-processing — none on disk for this run yet."})})]})}),_jsx(Dialog,{visible:x,onHide:()=>b(!1),header:"Test Configuration",style:{width:"min(640px, 90vw)"},modal:!0,children:_jsx(ConfigList,{config:m?.config})})]}):_jsx("div",{className:"p-card",style:{padding:"1rem",color:"var(--text-secondary-color)"},children:"No test selected. Pick a row from the History tab or start a run."})};const Header=({meta:e,config:t,runId:r,projectId:a,methodId:i,canViewRaw:s,onViewRaw:l,onShowConfig:n})=>{const o="string"==typeof e?.sample_id&&e.sample_id||"string"==typeof e?.config?.sample_id&&e.config.sample_id||"",c=t&&"object"==typeof t&&Object.entries(t).some(([e])=>"sample_id"!==e);return _jsx("div",{className:"p-card",style:{padding:"1rem"},children:_jsxs("div",{className:"flex",style:{justifyContent:"space-between",alignItems:"flex-start",gap:"1rem"},children:[_jsxs("div",{children:[_jsxs("h2",{style:{margin:0,display:"flex",alignItems:"center",gap:"0.5rem"},children:[o||r,c&&_jsx(Button,{icon:"pi pi-info-circle",type:"button",rounded:!0,text:!0,onClick:n,tooltip:"Show test configuration",tooltipOptions:{position:"top"},style:{width:"2rem",height:"2rem",padding:0},"aria-label":"Show test configuration"})]}),_jsxs("div",{style:{color:"var(--text-secondary-color)",fontSize:"0.85em"},children:["project: ",a," · method: ",i," · run: ",r,e?.start_time&&_jsxs(_Fragment,{children:[" · started: ",new Date(e.start_time).toLocaleString()]})]})]}),s&&_jsx(Button,{icon:"pi pi-table",label:"View Raw Data",onClick:l,outlined:!0})]})})},ConfigList=({config:e})=>{const t=e&&"object"==typeof e?Object.entries(e).filter(([e])=>"sample_id"!==e):[];return 0===t.length?_jsx("div",{style:{color:"var(--text-secondary-color)"},children:"No configuration recorded for this run."}):_jsx("div",{style:{display:"grid",gridTemplateColumns:"auto 1fr",gap:"0.5rem 1rem",fontSize:"0.95em"},children:t.map(([e,t])=>_jsxs(React.Fragment,{children:[_jsx("div",{style:{color:"var(--text-secondary-color)"},children:e}),_jsx("div",{children:formatCell(t,"string")})]},e))})},DataBlobTable=({blob:e,loading:t,error:r,rawData:a,emptyMessage:i})=>{if(t)return _jsx("div",{style:{padding:"1rem",color:"var(--text-secondary-color)"},children:"Loading…"});if(r)return _jsx("div",{style:{padding:"1rem",color:"var(--text-secondary-color)"},children:i??r});if(!e||"object"!=typeof e)return _jsx("div",{style:{padding:"1rem",color:"var(--text-secondary-color)"},children:"No data."});const s=Object.keys(a.columns??{}),l=Object.keys(e).filter(t=>Array.isArray(e[t])),n=[];for(const t of s)Array.isArray(e[t])&&n.push(t);for(const e of l)n.includes(e)||n.push(e);if(0===n.length)return _jsx("div",{style:{padding:"1rem",color:"var(--text-secondary-color)"},children:i??"No columnar data in this blob."});const o=n.reduce((t,r)=>Math.min(t,e[r].length),Number.POSITIVE_INFINITY),c=Number.isFinite(o)?o:0,d=Array.from({length:c},(t,r)=>{const a={__i:r};for(const t of n)a[t]=e[t][r];return a}),m=e=>{const t=a.units?.[e];return t?`${e} [${t}]`:e};return _jsxs(DataTable,{value:d,scrollable:!0,scrollHeight:"60vh",virtualScrollerOptions:{itemSize:32},emptyMessage:i??"No data.",size:"small",stripedRows:!0,children:[_jsx(Column,{field:"__i",header:"#",style:{width:"5rem",textAlign:"right"},bodyStyle:{fontVariantNumeric:"tabular-nums",textAlign:"right"}}),n.map(e=>_jsx(Column,{field:e,header:m(e),style:{minWidth:"8rem"},bodyStyle:{fontVariantNumeric:"tabular-nums",textAlign:"right"},body:t=>formatNumeric(t[e])},e))]})},formatNumeric=e=>null==e?"":"number"==typeof e&&Number.isFinite(e)?Number.parseFloat(e.toPrecision(6)).toString():String(e),ResultsGrid=({schema:e,values:t})=>t&&0!==Object.keys(t).length?_jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(220px, 1fr))",gap:"0.5rem 1rem"},children:e.map(e=>_jsxs("div",{children:[_jsxs("div",{style:{fontSize:"0.8em",color:"var(--text-secondary-color)"},children:[e.name,e.units?` (${e.units})`:""]}),_jsx("div",{children:formatCell(t[e.name],e.type)})]},e.name))}):_jsx("div",{style:{color:"var(--text-secondary-color)"},children:"No results yet."}),CHART_COLORS=["#4ea8de","#f59e0b","#22c55e","#a855f7","#ef4444","#14b8a6","#eab308","#ec4899"],palette=e=>CHART_COLORS[e%CHART_COLORS.length],leftAxisLabel=e=>e?.y.filter(e=>"right"!==e.y_axis).map(e=>e.label??e.field).join(" / ")??"",rightAxisLabel=e=>e?.y.filter(e=>"right"===e.y_axis).map(e=>e.label??e.field).join(" / ")??"",formatCell=(e,t)=>null==e?"":"f32"===t||"f64"===t?"number"==typeof e?e.toFixed(4):String(e):"object"==typeof e?JSON.stringify(e):String(e);
|
|
1
|
+
import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";import React,{useCallback,useContext,useEffect,useMemo,useRef,useState}from"react";import{Button}from"primereact/button";import{Column}from"primereact/column";import{DataTable}from"primereact/datatable";import{Dialog}from"primereact/dialog";import{Dropdown}from"primereact/dropdown";import{TabView,TabPanel}from"primereact/tabview";import{Chart as ChartJS,CategoryScale,LinearScale,PointElement,LineElement,Title,Tooltip,Legend}from"chart.js";import zoomPlugin from"chartjs-plugin-zoom";import{Line}from"react-chartjs-2";import{EventEmitterContext}from"../../core/EventEmitterContext";import{MessageType}from"../../hub/CommandMessage";import{useTis}from"./TisProvider";ChartJS.register(CategoryScale,LinearScale,PointElement,LineElement,Title,Tooltip,Legend,zoomPlugin);export const TestDataView=e=>{const t=useTis(),r=e.projectId??t.selection.projectId,a=e.methodId??t.selection.methodId,i=e.runId??t.selection.runId,s=e.schema??(a?t.schemas[a]:void 0),{throttleMs:l=100,cycleTableHeight:n="400px"}=e,{invoke:o,subscribe:c,unsubscribe:d}=useContext(EventEmitterContext),[m,u]=useState(null),[p,h]=useState([]),[f,g]=useState({}),[y,_]=useState(!1),[x,b]=useState(!1),[j,v]=useState(null),[w,S]=useState(null),[C,T]=useState(!1),[R,N]=useState(null),[D,I]=useState(null),[L,A]=useState(!1),O=useMemo(()=>{const e=[];for(const[t,r]of Object.entries(s?.views??{}))"cycle_scatter"===r.type&&e.push({name:t,view:r});return e},[s]),[E,M]=useState(O.length>0?O[0].name:null);useEffect(()=>{if(0===O.length)return;null!==E&&O.some(e=>e.name===E)||M(O[0].name)},[O,E]);const k=useRef([]),z=useRef(null),F=useRef(null),H=()=>{F.current||(F.current=setTimeout(()=>{if(F.current=null,k.current.length>0){const e=k.current;k.current=[],h(t=>[...e.slice().reverse(),...t])}z.current&&(g(z.current),z.current=null)},l))};useEffect(()=>{if(!r||!a||!i)return u(null),h([]),void g({});let e=!1;return(async()=>{try{const t=await o("tis.read_test",MessageType.Request,{project_id:r,method_id:a,run_id:i});!e&&t?.success&&(u(t.data),g(t.data.results??{}));const s=await o("tis.read_cycles",MessageType.Request,{project_id:r,method_id:a,run_id:i,offset:0,limit:200,order:"desc"});!e&&s?.success&&h(s.data.cycles??[])}catch(e){}})(),()=>{e=!0}},[r,a,i,o]),useEffect(()=>{const e=e=>e?.project_id===r&&e?.method_id===a&&e?.run_id===i,t=c("tis.cycle_added",t=>{e(t)&&t.cycle&&(k.current.push(t.cycle),H())}),s=c("tis.results_updated",t=>{e(t)&&(z.current=t.results??{},H())});return()=>{d(t),d(s),F.current&&(clearTimeout(F.current),F.current=null)}},[r,a,i,l]);const P=useMemo(()=>{if(!E||0===O.length)return null;const e=O.find(e=>e.name===E)?.view;if(!e)return null;const t=e.x.field,r=[...p].reverse();return{labels:r.map(e=>e[t]),datasets:e.y.map((e,t)=>({label:e.label??e.field,data:r.map(t=>t[e.field]),yAxisID:"right"===e.y_axis?"y1":"y",borderColor:palette(t),backgroundColor:palette(t),tension:.1,pointRadius:2}))}},[p,E,O]),V=O.find(e=>e.name===E)?.view,$=V?.y.some(e=>"right"===e.y_axis)??!1,B=useMemo(()=>({responsive:!0,maintainAspectRatio:!1,scales:{x:{title:{display:!!V?.x.label,text:V?.x.label}},y:{position:"left",title:{display:!0,text:leftAxisLabel(V)}},...$?{y1:{position:"right",grid:{drawOnChartArea:!1},title:{display:!0,text:rightAxisLabel(V)}}}:{}},plugins:{legend:{display:!0},zoom:{pan:{enabled:!0,mode:"xy"},zoom:{wheel:{enabled:!0},pinch:{enabled:!0},mode:"xy"}}}}),[V,$]),q=s?.raw_data?.blob_name??"trace",J=useRef(""),G=useCallback(async()=>{if(!r||!a||!i)return;const e=`${r}|${a}|${i}|${q}`;if(J.current!==e){J.current=e,T(!0),S(null),v(null);try{const e=await o("tis.read_raw",MessageType.Request,{project_id:r,method_id:a,run_id:i,name:q});e?.success?v(e.data??{}):S(e?.error_message??"No raw data on disk for this run.")}catch(e){S(String(e?.message??e))}finally{T(!1)}A(!0),I(null),N(null);try{const e=await o("tis.read_filtered",MessageType.Request,{project_id:r,method_id:a,run_id:i,name:q});e?.success?N(e.data??{}):I(e?.error_message??"No filtered data on disk for this run.")}catch(e){I(String(e?.message??e))}finally{A(!1)}}},[r,a,i,q,o]);useEffect(()=>{J.current=""},[r,a,i,q]);return r&&a&&i&&s?_jsxs("div",{className:"vblock",style:{display:"flex",flexDirection:"column",gap:"1rem"},children:[_jsx(Header,{meta:m,config:m?.config,runId:i,projectId:r,methodId:a,canViewRaw:!!s.raw_data,onViewRaw:()=>{_(!0),G()},onShowConfig:()=>b(!0)}),_jsxs("div",{className:"p-card",style:{padding:"1rem"},children:[_jsxs("div",{className:"flex",style:{gap:"1rem",alignItems:"center",marginBottom:"0.5rem"},children:[_jsx(Dropdown,{value:E,options:O.map(e=>({label:e.view.title??e.name,value:e.name})),onChange:e=>M(e.value),placeholder:0===O.length?"No view defined":"Select a view",disabled:0===O.length}),_jsx("h3",{style:{margin:0},children:V?.title??""})]}),_jsx("div",{style:{height:320},children:P&&_jsx(Line,{data:P,options:B})})]}),_jsxs("div",{className:"p-card",style:{padding:"1rem"},children:[_jsxs("h3",{style:{marginTop:0},children:["Cycle Data (",p.length,")"]}),_jsx(DataTable,{value:p,scrollable:!0,scrollHeight:n,virtualScrollerOptions:{itemSize:38},emptyMessage:"No cycles yet.",children:s.cycle_fields.map(e=>_jsx(Column,{field:e.name,header:e.units?`${e.name} (${e.units})`:e.name,body:t=>formatCell(t[e.name],e.type)},e.name))})]}),_jsxs("div",{className:"p-card",style:{padding:"1rem"},children:[_jsx("h3",{style:{marginTop:0},children:"Results"}),_jsx(ResultsGrid,{schema:s.results_fields,values:f})]}),s.raw_data&&_jsx(Dialog,{visible:y,onHide:()=>_(!1),header:`Run Data — ${i}`,style:{width:"90vw",height:"80vh"},maximizable:!0,children:_jsxs(TabView,{style:{height:"100%"},children:[_jsx(TabPanel,{header:"Raw Data",children:_jsx(DataBlobTable,{blob:j,loading:C,error:w,rawData:s.raw_data})}),_jsx(TabPanel,{header:"Filtered Data",children:_jsx(DataBlobTable,{blob:R,loading:L,error:D,rawData:s.raw_data,emptyMessage:"Filtered data is written by post-processing — none on disk for this run yet."})})]})}),_jsx(Dialog,{visible:x,onHide:()=>b(!1),header:"Test Configuration",style:{width:"min(640px, 90vw)"},modal:!0,children:_jsx(ConfigList,{config:m?.config})})]}):_jsx("div",{className:"p-card",style:{padding:"1rem",color:"var(--text-secondary-color)"},children:"No test selected. Pick a row from the History tab or start a run."})};const Header=({meta:e,config:t,runId:r,projectId:a,methodId:i,canViewRaw:s,onViewRaw:l,onShowConfig:n})=>{const o="string"==typeof e?.sample_id&&e.sample_id||"string"==typeof e?.config?.sample_id&&e.config.sample_id||"",c=t&&"object"==typeof t&&Object.entries(t).some(([e])=>"sample_id"!==e);return _jsx("div",{className:"p-card",style:{padding:"1rem"},children:_jsxs("div",{className:"flex",style:{justifyContent:"space-between",alignItems:"flex-start",gap:"1rem"},children:[_jsxs("div",{children:[_jsxs("h2",{style:{margin:0,display:"flex",alignItems:"center",gap:"0.5rem"},children:[o||r,c&&_jsx(Button,{icon:"pi pi-info-circle",type:"button",rounded:!0,text:!0,onClick:n,tooltip:"Show test configuration",tooltipOptions:{position:"top"},style:{width:"2rem",height:"2rem",padding:0},"aria-label":"Show test configuration"})]}),_jsxs("div",{style:{color:"var(--text-secondary-color)",fontSize:"0.85em"},children:["project: ",a," · method: ",i," · run: ",r,e?.start_time&&_jsxs(_Fragment,{children:[" · started: ",new Date(e.start_time).toLocaleString()]})]})]}),s&&_jsx(Button,{icon:"pi pi-table",label:"View Raw Data",onClick:l,outlined:!0})]})})},ConfigList=({config:e})=>{const t=e&&"object"==typeof e?Object.entries(e).filter(([e])=>"sample_id"!==e):[];return 0===t.length?_jsx("div",{style:{color:"var(--text-secondary-color)"},children:"No configuration recorded for this run."}):_jsx("div",{style:{display:"grid",gridTemplateColumns:"auto 1fr",gap:"0.5rem 1rem",fontSize:"0.95em"},children:t.map(([e,t])=>_jsxs(React.Fragment,{children:[_jsx("div",{style:{color:"var(--text-secondary-color)"},children:e}),_jsx("div",{children:formatCell(t,"string")})]},e))})},DataBlobTable=({blob:e,loading:t,error:r,rawData:a,emptyMessage:i})=>{if(t)return _jsx("div",{style:{padding:"1rem",color:"var(--text-secondary-color)"},children:"Loading…"});if(r)return _jsx("div",{style:{padding:"1rem",color:"var(--text-secondary-color)"},children:i??r});if(!e||"object"!=typeof e)return _jsx("div",{style:{padding:"1rem",color:"var(--text-secondary-color)"},children:"No data."});const s=Object.keys(a.columns??{}),l=Object.keys(e).filter(t=>Array.isArray(e[t])),n=[];for(const t of s)Array.isArray(e[t])&&n.push(t);for(const e of l)n.includes(e)||n.push(e);if(0===n.length)return _jsx("div",{style:{padding:"1rem",color:"var(--text-secondary-color)"},children:i??"No columnar data in this blob."});const o=n.reduce((t,r)=>Math.min(t,e[r].length),Number.POSITIVE_INFINITY),c=Number.isFinite(o)?o:0,d=Array.from({length:c},(t,r)=>{const a={__i:r};for(const t of n)a[t]=e[t][r];return a}),m=e=>{const t=a.units?.[e];return t?`${e} [${t}]`:e};return _jsxs(DataTable,{value:d,scrollable:!0,scrollHeight:"60vh",virtualScrollerOptions:{itemSize:32},emptyMessage:i??"No data.",size:"small",stripedRows:!0,children:[_jsx(Column,{field:"__i",header:"#",style:{width:"5rem",textAlign:"right"},bodyStyle:{fontVariantNumeric:"tabular-nums",textAlign:"right"}}),n.map(e=>_jsx(Column,{field:e,header:m(e),style:{minWidth:"8rem"},bodyStyle:{fontVariantNumeric:"tabular-nums",textAlign:"right"},body:t=>formatNumeric(t[e])},e))]})},formatNumeric=e=>null==e?"":"number"==typeof e&&Number.isFinite(e)?Number.parseFloat(e.toPrecision(6)).toString():String(e),ResultsGrid=({schema:e,values:t})=>t&&0!==Object.keys(t).length?_jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(220px, 1fr))",gap:"0.5rem 1rem"},children:e.map(e=>_jsxs("div",{children:[_jsxs("div",{style:{fontSize:"0.8em",color:"var(--text-secondary-color)"},children:[e.name,e.units?` (${e.units})`:""]}),_jsx("div",{children:formatCell(t[e.name],e.type)})]},e.name))}):_jsx("div",{style:{color:"var(--text-secondary-color)"},children:"No results yet."}),CHART_COLORS=["#4ea8de","#f59e0b","#22c55e","#a855f7","#ef4444","#14b8a6","#eab308","#ec4899"],palette=e=>CHART_COLORS[e%CHART_COLORS.length],leftAxisLabel=e=>e?.y.filter(e=>"right"!==e.y_axis).map(e=>e.label??e.field).join(" / ")??"",rightAxisLabel=e=>e?.y.filter(e=>"right"===e.y_axis).map(e=>e.label??e.field).join(" / ")??"",formatCell=(e,t)=>null==e?"":"f32"===t||"f64"===t?"number"==typeof e?e.toFixed(4):String(e):"object"==typeof e?JSON.stringify(e):String(e);
|
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* One asset_ref declared on a test method. We only consume the subset
|
|
4
|
+
* the form cares about — `field`, `asset_type`, `select`, `from`,
|
|
5
|
+
* `location`. Other fields (calibration_required, label, description)
|
|
6
|
+
* exist on the wire but aren't form-relevant.
|
|
7
|
+
*/
|
|
8
|
+
interface TisAssetRef {
|
|
9
|
+
field: string;
|
|
10
|
+
asset_type: string;
|
|
11
|
+
select: 'by_location' | 'by_id_field';
|
|
12
|
+
from?: string;
|
|
13
|
+
location?: string;
|
|
14
|
+
}
|
|
2
15
|
export interface TestFieldDef {
|
|
3
16
|
/** Canonical key — wire format, generated code, on-disk JSON. */
|
|
4
17
|
name: string;
|
|
@@ -17,12 +30,30 @@ export interface TestMethod {
|
|
|
17
30
|
config_fields: TestFieldDef[];
|
|
18
31
|
cycle_fields: TestFieldDef[];
|
|
19
32
|
results_fields: TestFieldDef[];
|
|
33
|
+
/**
|
|
34
|
+
* AMS asset references resolved at start_test. The form scans these
|
|
35
|
+
* for `select=by_id_field` entries pointing at a config field
|
|
36
|
+
* (`from: "config.<name>"`) and renders that field as a Dropdown of
|
|
37
|
+
* matching AMS assets instead of a free-form text input. No
|
|
38
|
+
* project.json change required — the form derives this from the
|
|
39
|
+
* existing schema.
|
|
40
|
+
*/
|
|
41
|
+
asset_refs?: TisAssetRef[];
|
|
20
42
|
/** Optional pretty label for the Test Method picker. Falls back
|
|
21
43
|
* to the canonical method_id key. */
|
|
22
44
|
label?: string;
|
|
23
45
|
/** Optional long-form description shown in the picker dialog
|
|
24
46
|
* when this method is highlighted. */
|
|
25
47
|
description?: string;
|
|
48
|
+
/** Optional post-cycle analysis dispatch (`{ script, function }`).
|
|
49
|
+
* Consumed server-side by the codegen; the form doesn't render
|
|
50
|
+
* anything based on it but accepts it so generated schema
|
|
51
|
+
* literals from `acctl codegen-tags` typecheck cleanly. */
|
|
52
|
+
analysis?: any;
|
|
53
|
+
/** Free-form view declarations for chart components. Same rationale
|
|
54
|
+
* as `analysis` — the form ignores them; the type just has to
|
|
55
|
+
* accept them so generated schemas typecheck. */
|
|
56
|
+
views?: Record<string, any>;
|
|
26
57
|
}
|
|
27
58
|
/**
|
|
28
59
|
* Test-setup form. Renders Sample ID, Test Method picker, and Test
|
|
@@ -41,4 +72,5 @@ export interface TestSetupFormProps {
|
|
|
41
72
|
onValidationChange?: (isValid: boolean, config: any) => void;
|
|
42
73
|
}
|
|
43
74
|
export declare const TestSetupForm: React.FC<TestSetupFormProps>;
|
|
75
|
+
export {};
|
|
44
76
|
//# sourceMappingURL=TestSetupForm.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TestSetupForm.d.ts","sourceRoot":"","sources":["../../../src/components/tis/TestSetupForm.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"TestSetupForm.d.ts","sourceRoot":"","sources":["../../../src/components/tis/TestSetupForm.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAcxE;;;;;GAKG;AACH,UAAU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AK,IAAI,CAAC;CAChE;AAyED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAobtD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as _jsx,
|
|
1
|
+
import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";import React,{useState,useEffect,useContext,useMemo}from"react";import{Button}from"primereact/button";import{InputText}from"primereact/inputtext";import{Dropdown}from"primereact/dropdown";import{Dialog}from"primereact/dialog";import{EventEmitterContext}from"../../core/EventEmitterContext";import{AutoCoreTagContext}from"../../core/AutoCoreTagContext";import{MessageType}from"../../hub/CommandMessage";import{ValueInput}from"../ValueInput";import{TextInput}from"../TextInput";import{useTis}from"./TisProvider";import{useAmsAssets,useAmsRoles}from"../ams/AmsProvider";import{TestMethodDialog}from"./TestMethodDialog";const labelOf=e=>{const t=e.label&&e.label.length>0?e.label:e.name;return e.units?`${t} [${e.units}]`:t},hasDescription=e=>"string"==typeof e.description&&e.description.length>0,methodLabelOf=(e,t)=>t?.label&&t.label.length>0?t.label:e,AssetIdPicker=({assetType:e,value:t,onChange:s,invalid:i})=>{const a=useAmsAssets(),n=useAmsRoles(),o=useMemo(()=>a.filter(t=>t.asset_type===e&&"active"===t.status).map(e=>{const t=n[e.asset_type]?.find(t=>t.location===e.location)?.label,s=[e.asset_id];return t?s.push(`— ${t}`):e.location&&s.push(`— ${e.location}`),e.serial&&s.push(`(s/n ${e.serial})`),{label:s.join(" "),value:e.asset_id}}),[a,n,e]);return _jsx(Dropdown,{value:t,options:o,onChange:e=>s(e.value??""),placeholder:0===o.length?`No active ${e} assets registered — add one in Settings → Assets`:`Select ${e}…`,className:i?"p-invalid":"",filter:!0,showClear:!0,disabled:0===o.length})};export const TestSetupForm=({schema:e,defaultMethodId:t,onMethodChange:s,onValidationChange:i})=>{const a=useTis(),{invoke:n,write:o}=useContext(EventEmitterContext),{rawValues:r,findTagByFqdn:l}=useContext(AutoCoreTagContext),d=useMemo(()=>Object.keys(a.schemas),[a.schemas]),c=a.selection.projectId,m=""!==c.trim()&&a.projectKnown(c.trim()),[p,u]=useState(a.selection.methodId||t||a.defaultMethodId||""),[h,f]=useState(a.selection.sampleId||""),g=a.stagedConfig,x=e=>{const t="function"==typeof e?e(a.stagedConfig):e;t!==a.stagedConfig&&a.setStagedConfig(t)},_=e??(p?a.schemas[p]:void 0);useEffect(()=>{a.selection.methodId!==p&&p&&a.setSelection({methodId:p}),s&&s(p)},[p]),useEffect(()=>{a.selection.sampleId!==h&&a.setSelection({sampleId:h})},[h]),useEffect(()=>{a.state.stagedSampleId&&a.state.stagedSampleId!==h&&f(a.state.stagedSampleId)},[a.state.stagedSampleId]),useEffect(()=>{a.selection.methodId&&a.selection.methodId!==p&&u(a.selection.methodId)},[a.selection.methodId]);const[j,y]=useState(!1),[v,b]=useState(!1),[I,C]=useState({open:!1,title:"",body:null});useEffect(()=>{_&&x(e=>{let t=e;for(const s of _.config_fields){if("sample_id"===s.name)continue;if(!s.source)continue;const i=l(s.source);if(!i)continue;const a=r[i.tagName];null!=a&&(t[s.name]!==a&&(t===e&&(t={...e}),t[s.name]=a))}return t})},[_,r,l]),useEffect(()=>{if(!_)return void y(!1);let e=!0;m||(e=!1),p.trim()||(e=!1),h.trim()||(e=!1),e&&!a.projectFieldsLoaded&&(e=!1);for(const t of _.config_fields)if("sample_id"!==t.name&&t.required){const s=g[t.name];if(void 0===s||""===s||null===s){e=!1;break}}if(y(e),i&&i(e,g),e){const{sample_id:e,...t}=g??{},s={...a.projectFields,...t};n("tis.stage_test",MessageType.Request,{project_id:c,method_id:p,sample_id:h,config:s}).catch(e=>{})}},[g,_,c,p,h,m,a.projectFields,a.projectFieldsLoaded,i,n]);const S=async(e,t)=>{if(x({...g,[e.name]:t}),e.source)try{await o(e.source,t)}catch(e){}};if(!_)return _jsx("div",{className:"ac-form-grid",style:{padding:"1.25rem"},children:_jsx("h3",{className:"ac-form-section",children:a.schemasLoaded?"No Test Method Selected":"Loading test methods…"})});if(!m)return _jsxs("div",{style:{padding:"1.25rem",maxWidth:"600px"},children:[_jsx("h3",{className:"ac-form-section",children:"No project selected"}),_jsxs("p",{style:{color:"var(--text-secondary-color)",marginTop:"0.5rem"},children:["Pick a project on the ",_jsx("strong",{children:"Project"})," tab first",""!==c.trim()&&` (or click + there to create "${c.trim()}")`,"."]})]});const T=j&&!a.state.lastStartError;return _jsxs("div",{className:"ac-form-grid",style:{padding:"1.25rem",gridTemplateColumns:"auto 1fr 1.75rem 1.75rem"},children:[_jsxs("h3",{className:"ac-form-section",style:{display:"flex",alignItems:"center",gap:"10px"},children:["Test Setup",_jsx(Button,{icon:T?"pi pi-check-circle":"pi pi-exclamation-circle",severity:T?"success":"danger",text:!0,rounded:!0,"aria-label":"Test Setup status",onClick:()=>{const e=(()=>{const e=[];if(m||e.push("No project is selected. Pick or create one on the Project tab."),a.projectFieldsLoaded||e.push("Project fields are still loading."),p.trim()||e.push("No test method selected."),h.trim()||e.push("Sample ID is required."),_)for(const t of _.config_fields){if("sample_id"===t.name)continue;if(!t.required)continue;const s=g[t.name];void 0!==s&&""!==s&&null!==s||e.push(`Required field "${labelOf(t)}" is empty.`)}return e})(),t=a.state.lastStartError?.trim()??"";let s;s=0!==e.length||t?_jsxs("div",{children:[e.length>0&&_jsxs(_Fragment,{children:[_jsx("p",{style:{margin:"0 0 0.5rem 0"},children:"The form is incomplete:"}),_jsx("ul",{style:{margin:"0 0 1rem 1.25rem"},children:e.map((e,t)=>_jsx("li",{children:e},t))})]}),t&&_jsxs(_Fragment,{children:[_jsx("p",{style:{margin:"0 0 0.25rem 0",fontWeight:600},children:"Last start_test error from the server:"}),_jsx("pre",{style:{margin:0,padding:"0.5rem",background:"rgba(0,0,0,0.25)",borderRadius:"4px",whiteSpace:"pre-wrap",fontSize:"0.875rem"},children:t})]})]}):_jsx("p",{style:{margin:0},children:"All required fields are complete. The test is staged and ready to start."}),C({open:!0,title:"Test Setup Status",body:s})}}),_jsxs("span",{style:{fontSize:"0.85em",color:"var(--text-secondary-color)",fontWeight:"normal",marginLeft:"0.25rem"},children:["project: ",_jsx("strong",{children:c})]})]}),_jsx("span",{className:"ac-form-label",children:"Sample ID"}),_jsx(TextInput,{label:void 0,value:h,onValueChanged:e=>{f(e)},className:h.trim()?"":"p-invalid"}),_jsx("span",{"aria-hidden":"true"}),_jsx("span",{style:{color:h.trim()?"var(--green-500)":"var(--red-500)",display:"flex",alignItems:"center"},children:_jsx("i",{className:h.trim()?"pi pi-check":"pi pi-times"})}),d.length>0&&_jsxs(_Fragment,{children:[_jsx("span",{className:"ac-form-label",children:"Test Method"}),_jsxs("div",{className:"p-inputgroup",style:{flex:1},children:[_jsx(InputText,{value:methodLabelOf(p,_),readOnly:!0,style:{flex:1},tabIndex:-1}),_jsx(Button,{icon:"pi pi-pencil",type:"button",onClick:()=>b(!0),tooltip:d.length>1?"Change test method":"View test method details",tooltipOptions:{position:"top"}})]}),_jsx("span",{"aria-hidden":"true"}),_jsx("span",{style:{color:p?"var(--green-500)":"var(--red-500)",display:"flex",alignItems:"center"},children:_jsx("i",{className:p?"pi pi-check":"pi pi-times"})})]}),_jsx("h3",{className:"ac-form-section",style:{marginTop:"1rem"},children:"Test Configuration"}),_.config_fields.map(e=>{if("sample_id"===e.name)return null;const t=(e=>{if(!e.required)return!0;const t=g[e.name];return void 0!==t&&""!==t&&null!==t})(e),s=(e=>{const t=_?.asset_refs??[],s=`config.${e.name}`,i=t.find(e=>"by_id_field"===e.select&&e.from===s);return i?i.asset_type:null})(e),i=!s&&"string"!==e.type&&"bool"!==e.type;return _jsxs(React.Fragment,{children:[_jsx("span",{className:"ac-form-label",children:labelOf(e)}),s?_jsx(AssetIdPicker,{assetType:s,value:null!=g[e.name]?String(g[e.name]):"",onChange:t=>S(e,t),invalid:!t}):i?_jsx(ValueInput,{label:void 0,value:null!=g[e.name]?Number(g[e.name]):null,onValueChanged:t=>S(e,t),className:t?"":"p-invalid"}):_jsx(TextInput,{label:void 0,value:null!=g[e.name]?String(g[e.name]):"",onValueChanged:t=>S(e,t),className:t?"":"p-invalid"}),hasDescription(e)?_jsx(Button,{icon:"pi pi-info-circle",text:!0,rounded:!0,"aria-label":`About ${labelOf(e)}`,onClick:()=>C({open:!0,title:labelOf(e),body:_jsx("p",{style:{margin:0,whiteSpace:"pre-wrap"},children:e.description})})}):_jsx("span",{"aria-hidden":"true"}),_jsx("span",{style:{color:t?"var(--green-500)":"var(--red-500)",display:"flex",alignItems:"center"},children:_jsx("i",{className:t?"pi pi-check":"pi pi-times"})})]},e.name)}),_jsx(TestMethodDialog,{visible:v,onHide:()=>b(!1),currentMethodId:p,onSelected:e=>u(e)}),_jsx(Dialog,{header:I.title,visible:I.open,onHide:()=>C({open:!1,title:"",body:null}),style:{width:"32rem",maxWidth:"90vw"},modal:!0,dismissableMask:!0,children:I.body})]})};
|
|
@@ -19,6 +19,16 @@ export interface TisLiveState {
|
|
|
19
19
|
activeMethodId: string;
|
|
20
20
|
activeSampleId: string;
|
|
21
21
|
activeRunId: string;
|
|
22
|
+
/**
|
|
23
|
+
* Most recent `tis.start_test` failure message broadcast by the
|
|
24
|
+
* server, or empty string when the last start succeeded (or none
|
|
25
|
+
* has been attempted). Used by `<TestSetupForm>` to surface AMS
|
|
26
|
+
* resolution errors and other server-side rejections inline,
|
|
27
|
+
* instead of leaving the operator staring at a non-responsive
|
|
28
|
+
* Start button. Cleared by the server on the next successful
|
|
29
|
+
* start_test.
|
|
30
|
+
*/
|
|
31
|
+
lastStartError: string;
|
|
22
32
|
}
|
|
23
33
|
export interface TisSelection {
|
|
24
34
|
projectId: string;
|
|
@@ -77,6 +87,21 @@ export interface TisContextValue {
|
|
|
77
87
|
/** Stash freshly-known project_fields without a round trip — used
|
|
78
88
|
* by the create / edit dialogs after a successful submit. */
|
|
79
89
|
setProjectFields: (id: string, fields: Record<string, any>) => void;
|
|
90
|
+
/**
|
|
91
|
+
* In-progress test draft — the operator's pending Sample ID and
|
|
92
|
+
* config_field values for the active method. Held on the provider
|
|
93
|
+
* (not in `<TestSetupForm>`'s local React state) so the values
|
|
94
|
+
* survive remount when the operator switches tabs. Wiped via
|
|
95
|
+
* `clearStagedConfig()` after a successful start_test or when the
|
|
96
|
+
* operator cancels the staged record.
|
|
97
|
+
*/
|
|
98
|
+
stagedConfig: Record<string, any>;
|
|
99
|
+
/** Merge a partial patch into `stagedConfig`. Existing fields not
|
|
100
|
+
* mentioned in the patch are preserved. */
|
|
101
|
+
setStagedConfig: (patch: Record<string, any>) => void;
|
|
102
|
+
/** Reset `stagedConfig` to `{}`. Called by the form on a fresh
|
|
103
|
+
* method selection or after a run completes. */
|
|
104
|
+
clearStagedConfig: () => void;
|
|
80
105
|
/** Fetch the run list for a (project, method?) pair. Method may be
|
|
81
106
|
* omitted to aggregate runs across every method in the project —
|
|
82
107
|
* the History tab uses this. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TisProvider.d.ts","sourceRoot":"","sources":["../../../src/components/tis/TisProvider.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,EASV,KAAK,SAAS,EACjB,MAAM,OAAO,CAAC;AAQf;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG,GAAG,CAAC;AAElC,MAAM,MAAM,cAAc,GAAG;IAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,eAAe,CAAA;CAAE,CAAC;AAErE,MAAM,WAAW,YAAY;IACzB,MAAM,EAAE,OAAO,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IAEvB,MAAM,EAAE,OAAO,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"TisProvider.d.ts","sourceRoot":"","sources":["../../../src/components/tis/TisProvider.ts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AE,CAAC,CAAC;IACpE;uEACmE;IACnE,QAAQ,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;IACnG,QAAQ,EAAE;QAAE,CAAC,KAAK,EAAE,MAAM,GAAG,gBAAgB,CAAA;KAAE,CAAC;CACnD;AAgBD,QAAA,MAAM,UAAU,gCAqBd,CAAC;AAqCH,MAAM,WAAW,gBAAgB;IAC7B,QAAQ,EAAE,SAAS,CAAC;IACpB;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAkUlD,CAAC;AAMF,eAAO,MAAM,MAAM,uBAAyC,CAAC;AAC7D,eAAO,MAAM,aAAa,sBAA0C,CAAC;AACrE,eAAO,MAAM,WAAW,oBAA0C,CAAC;AACnE;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,eAAe,wCAjfF,iBAAiB,KAAK,IAAI,CAofnD,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,YAAY,MAAM,EAAE,WAAW,MAAM;;;;CAY/D,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,QAAQ,MAAM;;;;;;;;CAuBvC,CAAC;AAIF,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as _jsx}from"react/jsx-runtime";import React,{createContext,useCallback,useContext,useEffect,useMemo,useReducer,useRef,useState}from"react";import{EventEmitterContext}from"../../core/EventEmitterContext";import{MessageType}from"../../hub/CommandMessage";const EMPTY_STATE={staged:!1,stagedProjectId:"",stagedMethodId:"",stagedSampleId:"",active:!1,activeProjectId:"",activeMethodId:"",activeSampleId:"",activeRunId:""},EMPTY_SELECTION={projectId:"",methodId:"",sampleId:"",runId:""},TisContext=createContext({schemas:{},defaultMethodId:"",schemasLoaded:!1,state:EMPTY_STATE,selection:EMPTY_SELECTION,setSelection:()=>{},existingProjects:[],projectKnown:()=>!1,refreshProjects:async()=>{},markProjectJustCreated:()=>{},projectFields:{},projectFieldsLoaded:!1,loadProjectFields:async()=>null,setProjectFields:()=>{},fetchRuns:async()=>[],fetchRun:async()=>null,runCache:{}});function liveReducer(e,t){switch(t.kind){case"staged":return{...e,staged:t.value};case"staged_project_id":return{...e,stagedProjectId:t.value};case"staged_method_id":return{...e,stagedMethodId:t.value};case"staged_sample_id":return{...e,stagedSampleId:t.value};case"active":return{...e,active:t.value};case"active_project_id":return{...e,activeProjectId:t.value};case"active_method_id":return{...e,activeMethodId:t.value};case"active_sample_id":return{...e,activeSampleId:t.value};case"active_run_id":return{...e,activeRunId:t.value}}}export const TisProvider=({children:e,defaultMethodId:t})=>{const{invoke:s,subscribe:a,unsubscribe:
|
|
1
|
+
import{jsx as _jsx}from"react/jsx-runtime";import React,{createContext,useCallback,useContext,useEffect,useMemo,useReducer,useRef,useState}from"react";import{EventEmitterContext}from"../../core/EventEmitterContext";import{MessageType}from"../../hub/CommandMessage";const EMPTY_STATE={staged:!1,stagedProjectId:"",stagedMethodId:"",stagedSampleId:"",active:!1,activeProjectId:"",activeMethodId:"",activeSampleId:"",activeRunId:"",lastStartError:""},EMPTY_SELECTION={projectId:"",methodId:"",sampleId:"",runId:""},TisContext=createContext({schemas:{},defaultMethodId:"",schemasLoaded:!1,state:EMPTY_STATE,selection:EMPTY_SELECTION,setSelection:()=>{},existingProjects:[],projectKnown:()=>!1,refreshProjects:async()=>{},markProjectJustCreated:()=>{},projectFields:{},projectFieldsLoaded:!1,loadProjectFields:async()=>null,setProjectFields:()=>{},stagedConfig:{},setStagedConfig:()=>{},clearStagedConfig:()=>{},fetchRuns:async()=>[],fetchRun:async()=>null,runCache:{}});function liveReducer(e,t){switch(t.kind){case"staged":return{...e,staged:t.value};case"staged_project_id":return{...e,stagedProjectId:t.value};case"staged_method_id":return{...e,stagedMethodId:t.value};case"staged_sample_id":return{...e,stagedSampleId:t.value};case"active":return{...e,active:t.value};case"active_project_id":return{...e,activeProjectId:t.value};case"active_method_id":return{...e,activeMethodId:t.value};case"active_sample_id":return{...e,activeSampleId:t.value};case"active_run_id":return{...e,activeRunId:t.value};case"last_start_error":return{...e,lastStartError:t.value}}}export const TisProvider=({children:e,defaultMethodId:t})=>{const{invoke:s,subscribe:a,unsubscribe:r}=useContext(EventEmitterContext),[c,d]=useState({}),[n,u]=useState(t??""),[o,i]=useState(!1),[l,_]=useReducer(liveReducer,EMPTY_STATE),[p,m]=useState({projectId:null,methodId:null,sampleId:null,runId:null});useEffect(()=>{let e=!1;return(async()=>{try{const a=await s("tis.list_schemas",MessageType.Request,{});if(e)return;if(a?.success&&a.data){const e=a.data.test_methods??{},s=a.data.default_method_id??"";d(e),!t&&s&&u(s),i(!0)}}catch(e){}})(),()=>{e=!0}},[]),useEffect(()=>{const e=[a("tis.staged",e=>_({kind:"staged",value:!!e})),a("tis.staged_project_id",e=>_({kind:"staged_project_id",value:String(e??"")})),a("tis.staged_method_id",e=>_({kind:"staged_method_id",value:String(e??"")})),a("tis.staged_sample_id",e=>_({kind:"staged_sample_id",value:String(e??"")})),a("tis.active",e=>_({kind:"active",value:!!e})),a("tis.active_project_id",e=>_({kind:"active_project_id",value:String(e??"")})),a("tis.active_method_id",e=>_({kind:"active_method_id",value:String(e??"")})),a("tis.active_sample_id",e=>_({kind:"active_sample_id",value:String(e??"")})),a("tis.active_run_id",e=>_({kind:"active_run_id",value:String(e??"")})),a("tis.last_start_error",e=>_({kind:"last_start_error",value:String(e??"")}))];return()=>{e.forEach(r)}},[a,r]);const I=useRef({}),[f,v]=useState(0),h=useCallback(()=>v(e=>e+1),[]),j=useCallback((e,t)=>{if(!e)return;const s=I.current[e]??{meta:null,cycles:[],results:{},rawData:{}};I.current[e]={...s,cycles:[...s.cycles,t]},h()},[h]),g=useCallback((e,t)=>{if(!e)return;const s=I.current[e]??{meta:null,cycles:[],results:{},rawData:{}};I.current[e]={...s,results:t},h()},[h]);useEffect(()=>{const e=a("tis.cycle_added",e=>{e?.run_id&&e.cycle&&j(e.run_id,e.cycle)}),t=a("tis.results_updated",e=>{e?.run_id&&g(e.run_id,e.results??{})});return()=>{r(e),r(t)}},[a,r,j,g]);const C=useMemo(()=>({projectId:p.projectId??l.activeProjectId,methodId:p.methodId??(l.activeMethodId||n),sampleId:p.sampleId??l.activeSampleId,runId:p.runId??l.activeRunId}),[p,l,n]),S=useCallback(e=>{m(t=>({projectId:void 0===e.projectId?t.projectId:e.projectId,methodId:void 0===e.methodId?t.methodId:e.methodId,sampleId:void 0===e.sampleId?t.sampleId:e.sampleId,runId:void 0===e.runId?t.runId:e.runId}))},[]),y=useRef("");useEffect(()=>{const e=l.activeRunId;e&&e!==y.current&&(y.current=e,m({projectId:null,methodId:null,sampleId:null,runId:null}))},[l.activeRunId]);const x=useCallback(async(e,t)=>{if(!e)return[];const a={project_id:e};t&&(a.method_id=t);try{const e=await s("tis.list_tests",MessageType.Request,a);if(e?.success&&e.data?.tests)return e.data.tests}catch(e){}return[]},[s]),T=useCallback(async(e,t,a)=>{if(!e||!t||!a)return null;try{const r=await s("tis.read_test",MessageType.Request,{project_id:e,method_id:t,run_id:a}),c=await s("tis.read_cycles",MessageType.Request,{project_id:e,method_id:t,run_id:a,offset:0,limit:1e3,order:"asc"});if(!r?.success)return null;const d={meta:r.data??null,cycles:c?.success?c.data?.cycles??[]:[],results:r.data?.results??{},rawData:I.current[a]?.rawData??{}};return I.current[a]=d,h(),d}catch(e){return null}},[s,h]),E=useMemo(()=>({...I.current}),[f]),[k,R]=useState([]),M=useRef(new Set),[P,b]=useState(0),[w,F]=useState({}),q=useCallback(async()=>{try{const e=await s("tis.list_projects",MessageType.Request,{});e?.success&&e.data?.projects&&R(e.data.projects)}catch(e){}},[s]),D=useCallback(e=>{e&&(M.current.has(e)||(M.current.add(e),b(e=>e+1)))},[]),L=useCallback(e=>!!e&&(!!M.current.has(e)||k.includes(e)),[k,P]),Y=useCallback((e,t)=>{e&&F(s=>({...s,[e]:t}))},[]),A=useCallback(async e=>{if(!e)return null;try{const t=await s("tis.read_project",MessageType.Request,{project_id:e});if(t?.success){const s=t.data?.project_fields??{};return F(t=>({...t,[e]:s})),s}}catch(e){}return null},[s]);useEffect(()=>{q()},[q]),useEffect(()=>{const e=a("tis.project_created",()=>{q()}),t=a("tis.project_updated",e=>{const t="string"==typeof e?.project_id?e.project_id:"";t&&A(t)});return()=>{r(e),r(t)}},[a,r,q,A]),useEffect(()=>{const e=C.projectId;e&&L(e)&&void 0===w[e]&&A(e)},[C.projectId,L,w,A]);const J=w[C.projectId]??{},K=void 0!==w[C.projectId],[N,O]=useState({}),z=useCallback(e=>{O(t=>({...t,...e}))},[]),B=useCallback(()=>{O({})},[]),G=useMemo(()=>({schemas:c,defaultMethodId:n,schemasLoaded:o,state:l,selection:C,setSelection:S,existingProjects:k,projectKnown:L,refreshProjects:q,markProjectJustCreated:D,projectFields:J,projectFieldsLoaded:K,loadProjectFields:A,setProjectFields:Y,stagedConfig:N,setStagedConfig:z,clearStagedConfig:B,fetchRuns:x,fetchRun:T,runCache:E}),[c,n,o,l,C,S,k,L,q,D,J,K,A,Y,N,z,B,x,T,E]);return _jsx(TisContext.Provider,{value:G,children:e})};export const useTis=()=>useContext(TisContext);export const useTisSchemas=()=>useContext(TisContext).schemas;export const useTisState=()=>useContext(TisContext).state;export const useTisSelection=()=>{const{selection:e,setSelection:t}=useContext(TisContext);return[e,t]};export const useTisRuns=(e,t)=>{const{fetchRuns:s}=useContext(TisContext),[a,r]=useState([]),[c,d]=useState(!1),n=useCallback(async()=>{if(e){d(!0);try{r(await s(e,t))}finally{d(!1)}}else r([])},[e,t,s]);return useEffect(()=>{n()},[n]),{runs:a,loading:c,refresh:n}};export const useTisRun=e=>{const{selection:t,fetchRun:s,runCache:a}=useContext(TisContext),[r,c]=useState(!1),d=e??t.runId;useEffect(()=>{if(!d)return;if(a[d]?.meta)return;const e=t.projectId,r=t.methodId;e&&r&&(c(!0),s(e,r,d).finally(()=>c(!1)))},[d,t.projectId,t.methodId,s,a]);const n=d?a[d]:null;return{meta:n?.meta??null,cycles:n?.cycles??[],results:n?.results??{},rawData:n?.rawData??{},loading:r}};export{TisContext};
|
|
@@ -7112,8 +7112,8 @@
|
|
|
7112
7112
|
* and prevents baseline drift in non-flex parents.
|
|
7113
7113
|
*/
|
|
7114
7114
|
.ac-toolbar-icon-btn {
|
|
7115
|
-
width:
|
|
7116
|
-
height:
|
|
7115
|
+
width: 19mm;
|
|
7116
|
+
height: 12.7mm;
|
|
7117
7117
|
padding: 0;
|
|
7118
7118
|
display: inline-flex;
|
|
7119
7119
|
align-items: center;
|
|
@@ -7137,8 +7137,8 @@
|
|
|
7137
7137
|
margin: 0;
|
|
7138
7138
|
}
|
|
7139
7139
|
.ac-toolbar-icon-lg {
|
|
7140
|
-
width:
|
|
7141
|
-
height:
|
|
7140
|
+
width: 25.4mm;
|
|
7141
|
+
height: 19mm;
|
|
7142
7142
|
padding: 0;
|
|
7143
7143
|
display: inline-flex;
|
|
7144
7144
|
align-items: center;
|
|
@@ -7162,8 +7162,8 @@
|
|
|
7162
7162
|
margin: 0;
|
|
7163
7163
|
}
|
|
7164
7164
|
.ac-toolbar-icon-panic {
|
|
7165
|
-
width:
|
|
7166
|
-
height:
|
|
7165
|
+
width: 25.4mm;
|
|
7166
|
+
height: 25.4mm;
|
|
7167
7167
|
padding: 0;
|
|
7168
7168
|
display: inline-flex;
|
|
7169
7169
|
align-items: center;
|
|
@@ -7194,6 +7194,17 @@
|
|
|
7194
7194
|
.p-overlaypanel-content {
|
|
7195
7195
|
padding: 2mm;
|
|
7196
7196
|
}
|
|
7197
|
+
/* ---- Dialog: comfortable interior padding ----
|
|
7198
|
+
*
|
|
7199
|
+
* Same problem the OverlayPanel had — PrimeReact's `.p-dialog-content`
|
|
7200
|
+
* lands with near-zero padding so dialog bodies feel squished
|
|
7201
|
+
* against the title bar and side borders. Adding 2mm here gives
|
|
7202
|
+
* dialogs a consistent inner gutter without each consumer having
|
|
7203
|
+
* to wrap their content in their own padded container.
|
|
7204
|
+
*/
|
|
7205
|
+
.p-dialog-content {
|
|
7206
|
+
padding: 2mm;
|
|
7207
|
+
}
|
|
7197
7208
|
.ac-toolbar-group {
|
|
7198
7209
|
display: flex;
|
|
7199
7210
|
flex-direction: row;
|