@spotify/backstage-plugin-soundcheck 0.4.2 → 0.6.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.
- package/CHANGELOG.md +45 -0
- package/README.md +97 -7
- package/config.d.ts +0 -4
- package/dist/esm/EntitySoundcheckContent-b20f0ec8.esm.js +2 -0
- package/dist/esm/OverviewPageContent-b39812fb.esm.js +2 -0
- package/dist/esm/{RefetchingIndicator-4f009bca.esm.js → RefetchingIndicator-026bd666.esm.js} +2 -2
- package/dist/esm/index-5913b2d3.esm.js +306 -0
- package/dist/esm/index-5ffaa13b.esm.js +2 -0
- package/dist/esm/{index-7b7b98c2.esm.js → index-95047e64.esm.js} +2 -2
- package/dist/esm/index-e398f5c6.esm.js +2 -0
- package/dist/index.d.ts +17 -3
- package/dist/index.esm.js +1 -1
- package/package.json +25 -22
- package/dist/esm/EntitySoundcheckContent-ec837784.esm.js +0 -2
- package/dist/esm/index-ab8d0702.esm.js +0 -217
- package/dist/esm/index-b2b00eb3.esm.js +0 -2
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import t,{useState as k,useEffect as R,useCallback as C,useMemo as I,createContext as He,useContext as Fe,useReducer as Ve,memo as S,Fragment as ze}from"react";import{useSearchParams as qe,Routes as Me,Route as B}from"react-router-dom";import{ContentHeader as X,HeaderTabs as Z,Link as O,EmptyState as We,Page as je,Header as Ge,Content as Ke}from"@backstage/core-components";import{useApi as N,identityApiRef as _e,useRouteRef as H,configApiRef as ee}from"@backstage/core-plugin-api";import{SpotifyLicenseBanner as Ue}from"@spotify/backstage-plugin-core";import{stringifyEntityRef as te,parseEntityRef as x}from"@backstage/catalog-model";import{useQuery as T,useQueryClient as re,useMutation as ne}from"@tanstack/react-query";import{s as P,Q as F,A as ae,M as oe,k as G,B as le,R as m,g as Je,L as ie,N as se,h as Qe,S as Ye,i as Xe}from"./index-ab8d0702.esm.js";import{catalogApiRef as ce,humanizeEntityRef as A,entityRouteRef as V}from"@backstage/plugin-catalog-react";import{makeStyles as E,alpha as de,TextField as K,CircularProgress as me,IconButton as pe,Menu as Ze,MenuItem as z,ListItemIcon as q,ListItemText as M,styled as _,Accordion as et,AccordionSummary as tt,AccordionDetails as rt,Grid as u,Typography as w,Button as L,Chip as ue,InputAdornment as nt,Card as at,CardContent as ot,Tooltip as he,LinearProgress as lt,withStyles as it}from"@material-ui/core";import st from"@material-ui/lab/Autocomplete";import ct from"@material-ui/icons/ArrowDropDown";import dt from"@material-ui/icons/MoreVert";import mt from"@material-ui/icons/ControlPointDuplicate";import pt from"@material-ui/icons/Delete";import ut from"@material-ui/icons/Edit";import ge from"@material-ui/icons/Visibility";import{DateTime as fe}from"luxon";import{createStyles as ht}from"@material-ui/core/styles";import ye from"@material-ui/icons/Add";import{useDrag as gt,useDrop as ft,DndProvider as yt}from"react-dnd";import Ee from"@material-ui/icons/DragIndicator";import Et from"@material-ui/icons/Close";import vt from"@material-ui/icons/Remove";import{HTML5Backend as wt}from"react-dnd-html5-backend";import{R as kt}from"./RefetchingIndicator-4f009bca.esm.js";import{countBy as ve}from"lodash";import{Skeleton as W}from"@material-ui/lab";import{VariableSizeGrid as bt}from"react-window";import"graphql-request";import"graphql-tag";import"@material-ui/core/styles/makeStyles";import"classnames";import"@material-ui/icons/Schedule";import"@material-ui/icons/Check";import"@material-ui/icons/RemoveCircleOutline";import"@material-ui/icons/HelpOutline";import"react-use/lib/useDebounce";function Ct(){const e=N(ce);return T(["soundcheck/all-groups"],async()=>{const{items:r}=await e.getEntities({filter:{kind:"Group"}});return r.filter(n=>(n==null?void 0:n.kind)==="Group").map(n=>{var a,o,i,l;return{name:(l=(i=(o=(a=n.spec)==null?void 0:a.profile)==null?void 0:o.displayName)!=null?i:n.metadata.title)!=null?l:n.metadata.name,ref:te(n)}})})}function Nt(e){const r=N(P);return T(["soundcheck/facets-for-owner",e],async()=>r.getFacetsForOwner(e),{enabled:!!e})}function Rt(e){const r=N(P);return T([F.GetAllPrograms,e],async()=>r.getAllPrograms(e))}function we(e,r){const n=N(P);return T(["soundcheck/program-overview-for-owner",e,r],async()=>n.getProgramOverviewForOwner(e,r),{enabled:!!e&&!!(r!=null&&r.type)})}function xt(){const e=N(_e),r=N(ce);return T(["soundcheck/user-groups-claims"],async()=>{const{ownershipEntityRefs:n}=await e.getBackstageIdentity();return(await r.getEntitiesByRefs({entityRefs:n})).items.filter(a=>(a==null?void 0:a.kind)==="Group").map(a=>{var o,i,l,s;return{name:(s=(l=(i=(o=a.spec)==null?void 0:o.profile)==null?void 0:i.displayName)!=null?l:a.metadata.title)!=null?s:a.metadata.name,ref:te(a)}})})}function ke(e){const r=N(P);return T([F.GetCheckers,e],async()=>r.getCheckers(e))}const St=e=>{const[r,n]=k(void 0),[a,o]=k([[]]),[i,l]=k([!1]);R(()=>{r===void 0&&e!=null&&e.length&&n(e)},[e,r]);const s=C((h,y)=>{o(f=>{const v=[...f];return v[y]=[...v[y],h],v}),n(f=>f==null?void 0:f.filter(v=>v.id!==h.id)),l(f=>{if(f[y]){const v=[...f];return v[y]=!1,v}return f})},[]),d=C((h,y)=>{o(f=>{const v=[...f];return v[y]=v[y].filter(b=>b.id!==h.id),v}),n(f=>[...f!=null?f:[],h])},[]),c=C(()=>{o(h=>[...h,[]]),l(h=>[...h,!1])},[]),g=C(h=>{a.length>1&&o(y=>{const f=[...y],v=f.splice(h,1)[0];return n(b=>[...b!=null?b:[],...v]),f})},[a]),p=C(()=>{const h=a.map(y=>y.length===0);return l(h),!h.some(y=>y)},[a]);return{chips:r,inputChipsList:a,handleDrop:s,handleDelete:d,addInput:c,removeInput:g,inputErrors:i,setInputErrors:l,areInputsValid:p}},$t=()=>{const[e,r]=qe(),n=Object.fromEntries(e.entries()),[a,o]=k(n);return R(()=>{r(a,{replace:!0})},[a]),[a,o]},Tt=()=>{const{data:e,isLoading:r,isError:n}=xt(),{data:a,isLoading:o,isError:i}=Ct();return{options:I(()=>{const l=[];return e&&l.push(...e.map(({name:s,ref:d})=>({name:s,ref:d,key:"My Groups"}))),a&&l.push(...a.map(({name:s,ref:d})=>({name:s,ref:d,key:"All Groups"}))),l},[e,a]),isLoading:r||o,isError:n||i}},Pt=E(e=>({root:{width:"100%",minWidth:250},textField:{"& $notchedOutline":{borderColor:de(e.page.fontColor,.25)},"&:hover $notchedOutline":{borderColor:e.page.fontColor}},input:{backgroundColor:"transparent",color:e.page.fontColor},clearIndicator:{color:e.page.fontColor},popupIndicator:{color:e.page.fontColor},notchedOutline:{}})),It=e=>{const{onChange:r,initialValue:n,setError:a}=e,{options:o,isLoading:i,isError:l}=Tt(),s=Pt(),[d,c]=k(null);R(()=>{if(!i&&o!=null&&o.length&&!d){const p=n?o.find(h=>h.ref===n):o[0];p&&(c(p),r==null||r(p.ref))}},[i,o,d,r,n]);const g=C((p,h)=>{c(h),r==null||r(h==null?void 0:h.ref)},[r,c]);return R(()=>{a==null||a(l?new Error("Error loading groups"):void 0)},[l,a]),l?null:t.createElement(st,{"aria-label":"Current group",className:s.root,classes:{clearIndicator:s.clearIndicator,popupIndicator:s.popupIndicator},disableClearable:!0,options:o!=null?o:[],loading:i,groupBy:p=>p.key,value:d,freeSolo:!1,onChange:g,getOptionLabel:p=>p.name,renderInput:p=>t.createElement(K,{...p,variant:"outlined",placeholder:i?"Loading":"Select a group",className:s.textField,InputProps:{...p.InputProps,className:s.input,classes:{notchedOutline:s.notchedOutline},endAdornment:t.createElement(t.Fragment,null,i?t.createElement(me,{color:"inherit",size:20}):null,p.InputProps.endAdornment)}})})},At="#DFE0F4",Lt="#4275CA",Dt=({handleEdit:e,handleDuplicate:r,handleDelete:n,handleView:a})=>{const[o,i]=k(null),l=!!o,s=c=>{i(c.currentTarget)},d=()=>{i(null)};return t.createElement(t.Fragment,null,t.createElement(pe,{"aria-label":"summary-accordion-actions",id:"summary-accordion-action-menu-button","aria-controls":l?"summary-accordion-action-menu":void 0,"aria-expanded":l?"true":void 0,"aria-haspopup":"true",onClick:s},t.createElement(dt,null)),t.createElement(Ze,{id:"summary-accordion-action-menu",anchorEl:o,open:l,onClose:d,getContentAnchorEl:null,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},MenuListProps:{"aria-labelledby":"summary-accordion-action-menu-button"}},t.createElement(z,{onClick:c=>{a(c),d()}},t.createElement(q,null,t.createElement(ge,{fontSize:"small"})),t.createElement(M,null,"View")),e&&t.createElement(z,{onClick:c=>{e(c),d()}},t.createElement(q,null,t.createElement(ut,{fontSize:"small"})),t.createElement(M,null,"Edit")),t.createElement(z,{onClick:c=>{r(c),d()}},t.createElement(q,null,t.createElement(mt,{fontSize:"small"})),t.createElement(M,null,"Duplicate")),n&&t.createElement(z,{onClick:c=>{n(c),d()}},t.createElement(q,null,t.createElement(pt,{fontSize:"small"})),t.createElement(M,null,"Delete"))))},Bt=_(e=>t.createElement(et,{...e}))(({theme:e})=>({border:`1px solid ${e.palette.divider}`,"&:not(:last-child)":{borderBottom:0},"&:before":{display:"none"}})),Ot=_(e=>t.createElement(tt,{expandIcon:t.createElement(ct,null),...e}))(()=>({flexDirection:"row-reverse",backgroundColor:At})),Ht=_(rt)(({theme:e})=>({padding:e.spacing(2)})),be=({title:e,description:r,metadata:n,handleDuplicate:a,handleDelete:o,handleEdit:i,handleView:l,children:s})=>{const[d,c]=k(!1),g=()=>{c(p=>!p)};return t.createElement(Bt,{expanded:d},t.createElement(Ot,{"aria-controls":`${e}-panel-content`,id:`${e}-summary-accordion`,IconButtonProps:{onClick:g}},t.createElement(u,{container:!0,spacing:0},t.createElement(u,{item:!0,xs:12,sm:!0,container:!0,direction:"column",spacing:0,onClick:g},t.createElement(w,null,e),t.createElement(w,null,r),t.createElement(u,{container:!0,direction:"row",spacing:2},n==null?void 0:n.map(p=>t.createElement(u,{item:!0,key:p.title},t.createElement(w,null,p.title,": ",p.data))))),t.createElement(u,{item:!0},t.createElement(Dt,{handleDelete:o,handleEdit:i,handleDuplicate:a,handleView:l})))),t.createElement(Ht,null,s))},Ce=He({}),Ft=e=>{const[r,n]=k(),a=C(i=>{n(i)},[]),o=C(()=>{n(null)},[]);return t.createElement(Ce.Provider,{value:{showAlert:a,clearAlert:o}},r&&t.createElement(ae,{severity:r.severity,title:r.title,onClose:o},r.message),e.children)},U=()=>Fe(Ce),Vt="Error Deleting Check";function zt(){const e=N(P),r=re(),{showAlert:n}=U(),a=async o=>{const i=await e.deleteChecker(o);if(!i)throw new Error(`Failed to delete check ${o}`);return i};return ne([oe.DeleteChecker],a,{onSuccess:()=>{r.invalidateQueries({queryKey:[F.GetCheckers]})},onError:(o,i)=>{let l=`Failed to delete check ${i}`;o instanceof Error&&(l=o.message),n({severity:"error",title:Vt,message:l})}})}const qt=({checker:{id:e,ownerEntityRef:r,name:n,description:a,isEditable:o},children:i})=>{const{showModal:l}=G(),{mutate:s}=zt(),d=C(async()=>{await l({title:"Delete Check",message:`Are you sure you want to delete the check '${n}'?`})&&s(e)},[l,n,s,e]);return t.createElement(be,{title:n!=null?n:e,description:a,metadata:[{title:"ID",data:e},{title:"Owner",data:r!=null?r:""}],children:i,handleView:()=>{},handleEdit:o?()=>{}:void 0,handleDuplicate:()=>{},handleDelete:d})},Mt=E(e=>({headerButtons:{display:"flex",gap:e.spacing(1),flexWrap:"nowrap"}})),Wt=({setShowAddCheckView:e,checkers:r})=>{const n=Mt();return t.createElement(u,{container:!0,direction:"row"},t.createElement(X,{title:"Checks"},t.createElement("div",{className:n.headerButtons},t.createElement(L,{variant:"contained",color:"primary",onClick:()=>e(!0)},"Add New Check"))),t.createElement(u,{container:!0,item:!0,direction:"column",spacing:2,xs:9},r.map(a=>t.createElement(u,{item:!0,key:a.id},t.createElement(qt,{checker:a},t.createElement(u,{container:!0,direction:"row"}))))))},Ne=({setShowAddView:e,saveButtonText:r,onSave:n,isLoading:a})=>t.createElement(u,{item:!0,container:!0,spacing:0},t.createElement(u,{container:!0,item:!0,xs:11,spacing:0},t.createElement(L,{variant:"contained",color:"primary",disabled:a,onClick:()=>{n()}},r)),t.createElement(u,{item:!0,xs:1},t.createElement(L,{variant:"contained",color:"primary",onClick:()=>e(!1)},"Cancel"))),jt=[{factRef:"test1:default/fact1",entityRef:"component:default/test-entity-1",data:{value:"test"},timestamp:fe.now().toString()},{factRef:"test1:default/fact1",entityRef:"component:default/test-entity-2",data:{value:"foo"},timestamp:fe.now().toString()}];le.Medal,m.Passed,m.NotReported,m.Passed,m.NotReported,m.Passed,m.NotReported,m.Passed,m.NotReported,m.Passed,m.NotReported,m.Failed,m.NotReported,m.Passed,m.NotReported,m.Passed,m.NotReported,m.Failed,m.NotReported,m.Passed,m.NotReported,m.Passed,m.NotReported,m.Passed,m.NotReported,m.Passed,m.NotReported,m.Failed,m.NotReported,m.Passed,m.NotReported,m.Passed,m.NotReported,m.Passed,m.NotReported,m.Passed,m.NotReported,m.Passed,m.NotReported,m.Passed,m.NotReported,m.Passed,m.NotReported,m.Passed,m.NotReported,m.Passed,m.NotReported,m.Passed,m.NotReported;var Gt=(e=>(e[e.SelectFacts=0]="SelectFacts",e[e.DefineRule=1]="DefineRule",e))(Gt||{});const Kt=({setShowAddCheckView:e})=>{const[r,n]=k(0);return t.createElement(u,{container:!0,spacing:6},t.createElement(Ne,{setShowAddView:e,saveButtonText:"Save new check",isLoading:!1,onSave:()=>{}}),t.createElement(u,{item:!0,container:!0,direction:"row",xs:12},t.createElement(u,{container:!0,item:!0,direction:"column",xs:6},t.createElement(w,null,"Title"),t.createElement(w,null,"Id?"),t.createElement(w,null,"Description?"),t.createElement(w,null,"Facts this check is based on (AKA the rule definition portion)"),t.createElement(w,{onClick:()=>n(0)},"+ Add Fact")),t.createElement(u,{item:!0,direction:"column",xs:6},r===0&&t.createElement(w,null,JSON.stringify(jt,null,2)),r===1&&t.createElement(w,null,"Define rule window"))))},_t=E(e=>({checksPageContainer:{padding:e.spacing(3)}})),Ut=()=>{const e=_t(),{data:r}=ke(),[n,a]=k(!1);return t.createElement("div",{className:e.checksPageContainer},n?t.createElement(Kt,{setShowAddCheckView:a}):t.createElement(Wt,{setShowAddCheckView:a,checkers:r!=null?r:[]}))};E(()=>ht({boldText:{fontWeight:"bold"}}));const Jt="Error Deleting Program";function Qt(){const e=N(P),r=re(),{showAlert:n}=U(),a=async o=>{const i=await e.deleteProgram(o);if(!i)throw new Error(`Failed to delete program ${o}`);return i};return ne([oe.DeleteProgram],a,{onSuccess:()=>{r.invalidateQueries({queryKey:[F.GetAllPrograms]})},onError:(o,i)=>{let l=`Failed to delete program ${i}`;o instanceof Error&&(l=o.message),n({severity:"error",title:Jt,message:l})}})}const Yt=({summary:{name:e,id:r,ownerEntityRef:n,description:a},children:o})=>{const{showModal:i}=G(),{mutate:l}=Qt(),{showAlert:s}=U(),d=C(async()=>{await i({title:"Delete Program",message:`Are you sure you want to delete program with id: ${r}?`})&&l(r)},[i,r,l]);return t.createElement(be,{title:e,description:a,metadata:[{title:"ID",data:r},{title:"Owner",data:n}],children:o,handleView:()=>s({title:"Alert Title",message:"Alert message",severity:"error"}),handleEdit:()=>{},handleDuplicate:()=>{},handleDelete:d})},Xt=E(e=>({headerButtons:{display:"flex",gap:e.spacing(1),flexWrap:"nowrap"}})),Zt=({setShowAddProgramView:e})=>{const r=Xt(),{data:n}=Rt();return t.createElement(u,{container:!0,direction:"row"},t.createElement(X,{title:"Programs"},t.createElement("div",{className:r.headerButtons},t.createElement(L,{variant:"contained",color:"primary",onClick:()=>e(!0)},"Add new program"))),t.createElement(u,{container:!0,item:!0,direction:"column",spacing:2,xs:9},n==null?void 0:n.map(a=>t.createElement(u,{item:!0,key:a.id},t.createElement(Yt,{summary:a},t.createElement(u,{container:!0,direction:"row"}))))),t.createElement(u,{item:!0,container:!0,direction:"column",xs:3},"Filters go here"))},er=E(e=>({titleInput:{marginBottom:e.spacing(3)},inputBase:{fontSize:e.typography.h4.fontSize,fontWeight:700}})),tr=({programName:e,programNameError:r,handleProgramNameChange:n})=>{const a=er();return t.createElement(K,{fullWidth:!0,placeholder:"Untitled program",value:e,onChange:n,className:a.titleInput,InputProps:{disableUnderline:!0,classes:{input:a.inputBase}},error:r,helperText:r?"Program name must be at least 1 character and less than 100 characters":""})},rr=E(e=>({button:{border:"none",fontWeight:700,fontSize:e.typography.subtitle2.fontSize,lineHeight:"19px",color:Lt,textTransform:"none"}})),J=({label:e,...r})=>{const n=rr();return t.createElement(L,{className:n.button,...r},e)},nr=E(e=>({chip:{width:"100%",justifyContent:"space-between",background:e.palette.common.white,border:`1px solid ${e.palette.grey[300]}`,borderRadius:4}})),ar=({label:e,id:r})=>{const[n,a]=gt(()=>({type:"chip",item:{id:r,label:e},collect:i=>({isDragging:i.isDragging()})})),o=nr();return t.createElement(ue,{ref:a,label:e,className:o.chip,icon:t.createElement(Ee,{"data-testid":"drag-indicator-icon"}),onDelete:()=>{},deleteIcon:t.createElement(ge,{"data-testid":"visibility-icon"})})},or=({searchTerm:e,setSearchTerm:r,showClear:n=!0,placeholder:a="Search...",...o})=>t.createElement(K,{...o,fullWidth:!0,placeholder:a,value:e,onChange:i=>{r(i.target.value)},InputProps:{endAdornment:n&&e?t.createElement(nt,{position:"end"},t.createElement(pe,{edge:"end",onClick:()=>{r("")}},t.createElement(Et,null))):null}}),Re=E(e=>({columnHeader:{display:"flex",justifyContent:"space-between",alignItems:"center"},subtitle:{fontSize:e.typography.h6.fontSize},chipContainer:{display:"flex",flexDirection:"column",alignItems:"flex-start",padding:e.spacing(1),gap:e.spacing(1)},loadingContainer:{marginTop:e.spacing(1),display:"flex",justifyContent:"center",alignItems:"center",height:"100%"}})),lr=()=>{const e=Re();return t.createElement(u,{container:!0,className:e.loadingContainer},t.createElement(me,null))},ir=({chips:e})=>t.createElement(t.Fragment,null,e.map(r=>t.createElement(ar,{key:r.id,id:r.id,label:r.label}))),sr=()=>t.createElement(w,{variant:"body1",color:"textSecondary"},"There are no matches."),cr=({chips:e=[],isLoading:r})=>{const n=Re(),[a,o]=k(""),i=I(()=>e.filter(d=>d.label.toLowerCase().includes(a.toLowerCase())),[e,a]),l=e.length>0||a,s=()=>{if(r)return t.createElement(lr,null);if(i.length>0)return t.createElement(ir,{chips:i});if(l)return t.createElement(sr,null)};return t.createElement(u,{container:!0},t.createElement(u,{item:!0,xs:12,className:n.columnHeader},t.createElement(w,{variant:"subtitle1",className:n.subtitle},"Checks"),t.createElement(J,{label:"Add Check",startIcon:t.createElement(ye,null)})),t.createElement(u,{item:!0,xs:12},t.createElement(or,{searchTerm:a,disabled:r,setSearchTerm:o,placeholder:"Search checks...",variant:"outlined",size:"small"})),t.createElement(u,{item:!0,className:n.chipContainer,xs:12},s()))},dr=E(e=>({input:{background:e.palette.common.white,border:`1px solid ${e.palette.grey[600]}`,borderRadius:4,padding:e.spacing(1),minHeight:80},error:{border:"1px solid red"},chip:{width:"100%",justifyContent:"space-between",background:e.palette.common.white,border:`1px solid ${e.palette.grey[300]}`,borderRadius:4},chipContainer:{display:"flex",flexDirection:"column"}})),mr=({chips:e,onDelete:r,onDrop:n,error:a=!1})=>{const[{isOver:o},i]=ft(()=>({accept:"chip",drop:s=>{n(s)},collect:s=>({isOver:s.isOver()})})),l=dr();return t.createElement("div",{ref:i,style:{backgroundColor:o?"white":"#f0f0f0"},className:`${l.input} ${a?l.error:""}`,"data-testid":"droppable-input"},t.createElement("div",{className:l.chipContainer},e.map(s=>t.createElement(ue,{key:s.id,label:s.label,className:l.chip,icon:t.createElement(Ee,null),onDelete:()=>r(s)}))))},pr=E(e=>({columnHeader:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:e.spacing(2)},subtitle:{fontSize:e.typography.h6.fontSize},levelHeader:{display:"flex",justifyContent:"space-between",alignItems:"center"}})),ur=({inputChipsList:e,handleDelete:r,handleDrop:n,addInput:a,removeInput:o,levelsErrors:i})=>{const l=pr();return t.createElement(u,{container:!0},t.createElement(u,{item:!0,xs:12,className:l.columnHeader},t.createElement(w,{variant:"subtitle1",className:l.subtitle},"Levels"),t.createElement(J,{label:"Add Level",startIcon:t.createElement(ye,null),onClick:a})),e.map((s,d)=>t.createElement(u,{container:!0,item:!0,xs:12,key:d,spacing:1},t.createElement(u,{item:!0,xs:12,className:l.levelHeader},t.createElement(w,{variant:"subtitle1"},"Level ",d+1),e.length>1&&t.createElement(J,{label:"Remove Level",startIcon:t.createElement(vt,null),onClick:()=>o(d)})),t.createElement(u,{item:!0,xs:12},t.createElement(mr,{chips:s,onDelete:c=>r(c,d),onDrop:c=>n(c,d),error:i[d]})))))};var hr=(e=>(e.SetProgramNameError="VALIDATE_NAME",e.SetName="SET_NAME",e))(hr||{});const gr={programName:"",programNameError:!1},fr=(e,r)=>{switch(r.type){case"SET_NAME":return{...e,programName:r.value};case"VALIDATE_NAME":return{...e,programNameError:r.value};default:return e}},yr=(e="")=>{const[r,n]=Ve(fr,{...gr,programName:e}),a=()=>{const i=r.programName.trim().length,l=i>0&&i<=100;return n({type:"VALIDATE_NAME",value:!l}),l},o=i=>{n({type:"SET_NAME",value:i.target.value}),r.programNameError&&a()};return{programName:r.programName,programNameError:r.programNameError,handleProgramNameChange:o,isProgramNameValid:a}},Er=E(e=>({description:{fontSize:e.typography.subtitle1.fontSize},cardContent:{"& *":{fontWeight:700}}})),vr=({setShowAddProgramView:e})=>{const{programName:r,programNameError:n,handleProgramNameChange:a,isProgramNameValid:o}=yr(),{showModal:i}=G(),{data:l,isLoading:s}=ke(),d=(l!=null?l:[]).filter(D=>!!D).map(D=>({id:D.id,label:D.name})),{chips:c,inputChipsList:g,handleDrop:p,handleDelete:h,addInput:y,removeInput:f,inputErrors:v,areInputsValid:b}=St(d),Oe=async()=>{o()&&b()&&await i({title:"Save Program",message:`Are you sure you want to save program: ${r}?`})&&JSON.stringify({programName:r,checks:[...g]},null,2)},Y=Er();return t.createElement(u,{container:!0,spacing:3},t.createElement(Ne,{setShowAddView:e,saveButtonText:"Save new program",isLoading:s,onSave:Oe}),t.createElement(u,{item:!0,xs:12},t.createElement(tr,{programName:r,programNameError:n,handleProgramNameChange:a})),t.createElement(u,{item:!0,xs:12},t.createElement(at,null,t.createElement(ot,{className:Y.cardContent},t.createElement(u,{container:!0,spacing:8},t.createElement(u,{item:!0,xs:12},t.createElement(w,{className:Y.description},"Add the checks that apply to each level. You can preview the checks to see the rules that apply to each check.")),t.createElement(u,{item:!0,xs:4},t.createElement(ur,{inputChipsList:g,handleDelete:h,handleDrop:p,addInput:y,removeInput:f,levelsErrors:v})),t.createElement(u,{item:!0,xs:4},t.createElement(cr,{chips:c,isLoading:s})),t.createElement(u,{item:!0,xs:4}))))))},wr=E(e=>({programsPageContainer:{padding:e.spacing(3)},headerButtons:{display:"flex",gap:e.spacing(1),flexWrap:"nowrap"}})),kr=({})=>{const e=wr(),[r,n]=k(!1);return t.createElement("div",{className:e.programsPageContainer},r?t.createElement(yt,{backend:wt},t.createElement(vr,{setShowAddProgramView:n})):t.createElement(Zt,{setShowAddProgramView:n}))},br=()=>t.createElement(t.Fragment,null,"Fact Collectors Page"),Cr=e=>({key:`skeleton${e}`,label:"",id:`skeleton${e}`}),Nr=()=>{const e=Array.from({length:4},(r,n)=>Cr(n));return t.createElement(Z,{tabs:e})},Rr=E(e=>({root:{borderTop:`1px solid ${e.palette.divider}`,borderBottom:`1px solid ${e.palette.divider}`},tab:{textTransform:"uppercase",paddingTop:e.spacing(2),paddingBottom:e.spacing(2)}})),xr=({unfilteredFacets:e,onChange:r,type:n})=>{var a,o,i;const l=Rr(),s={types:(a=e==null?void 0:e.types.filter(({count:p})=>p>0))!=null?a:[]},d=C(p=>{var h;r((h=s==null?void 0:s.types[p].value)!=null?h:"")},[s==null?void 0:s.types,r]);R(()=>{var p,h;const y=(s==null?void 0:s.types)&&s.types.length>=0,f=!n&&y,v=n&&y&&!(s!=null&&s.types.find(({value:b})=>b===n));(f||v)&&r((h=(p=s==null?void 0:s.types[0])==null?void 0:p.value)!=null?h:"")},[n,s==null?void 0:s.types,r]);const c=(o=s==null?void 0:s.types.map(({value:p,count:h})=>({key:p,label:`${p} (${h>50?"50+":h})`,id:p,tabProps:{className:l.tab}})))!=null?o:[];if(!c.length)return null;const g=(i=s==null?void 0:s.types.findIndex(p=>p.value===n))!=null?i:-1;return t.createElement(t.Fragment,null,t.createElement(kt,null),t.createElement(Z,{onChange:d,tabs:c,selectedIndex:g>-1?g:void 0}))},Sr=E(e=>({root:{height:"8px",minWidth:"64px",marginLeft:e.spacing(2),borderRadius:"100vh",backgroundColor:e.palette.background.default},bar:{backgroundColor:e.palette.success.main,transition:"none"}})),xe=e=>{var r,n;const a=Sr(e),o=I(()=>Object.entries(e.progress).reduce((l,[,s])=>l+s,0),[e.progress]);if(o===0)return null;const i=(r=e.progress[m.Passed])!=null?r:0;return t.createElement(he,{arrow:!0,title:`Check passing for ${i} of ${o} ${o===1?"entity":"entities"}`,enterDelay:0,placement:"top"},t.createElement(lt,{variant:"determinate",value:((n=e.progress[m.Passed])!=null?n:0)/o*100,classes:{root:a.root,bar:a.bar}}))},$r=E(e=>({headerWrapper:{marginTop:e.spacing(.5)},entityRefName:{fontWeight:"bold"},iconWrapper:{padding:e.spacing(1.5,.5),display:"flex",alignItems:"center",justifyContent:"center"}})),Tr=({check:{name:e,description:r},icon:n,entityRef:a})=>{const o=$r();return t.createElement(u,{spacing:1},t.createElement(u,{container:!0,direction:"row",spacing:1,wrap:"nowrap"},t.createElement("div",{className:o.iconWrapper},n),t.createElement(w,{variant:"h6",className:o.headerWrapper,noWrap:!0},e)),t.createElement(u,{item:!0,wrap:"nowrap"},t.createElement(w,{variant:"subtitle2",className:o.entityRefName},A(x(a),{defaultKind:"component"}))),t.createElement(w,{variant:"caption"},r))},Pr=it(e=>{const r=e.palette.type==="dark"?e.palette.common.black:e.palette.grey[300];return{tooltip:{backgroundColor:r,color:e.palette.type==="dark"?e.palette.common.white:e.palette.grey[700]},arrow:{color:r}}})(he),Ir=({children:e,check:r,icon:n,entityRef:a})=>t.createElement(Pr,{arrow:!0,title:t.createElement(Tr,{check:r,icon:n,entityRef:a}),enterDelay:150,placement:"top"},e),Ar=E(e=>({root:{padding:0},iconWrapper:{padding:e.spacing(1.5),display:"flex",alignItems:"center",justifyContent:"center"},link:{"&:hover $iconWrapper, &:active $iconWrapper, &:focus $iconWrapper":{backgroundColor:e.palette.infoBackground}},icon:{width:"17px",height:"17px"},virtualized:{borderBottom:`1px solid ${e.palette.divider}`,borderRight:`1px solid ${e.palette.divider}`}})),Se=S(({programId:e,check:r,entityRef:n,result:a,entityRoute:o,isVirtualized:i})=>{const l=Ar();if(typeof n!="string"){const g=t.createElement("div",{className:l.iconWrapper},t.createElement("div",{className:l.icon}));return i?t.createElement("div",{className:`${l.root} ${l.virtualized}`,"aria-hidden":!0},g):t.createElement("td",{className:l.root,"aria-hidden":!0},g)}const s=t.createElement(Je,{className:l.icon,result:a!=null?a:m.NotReported}),d=t.createElement("div",{className:l.iconWrapper},s),c=a&&a===m.NotApplicable?d:t.createElement(O,{className:l.link,to:`${o(x(n))}/soundcheck/${e}/${r.id}`},d);return i?t.createElement("div",{className:`${l.root} ${l.virtualized}`},t.createElement(Ir,{check:r,icon:s,entityRef:n},c)):t.createElement("td",{className:`${l.root}`},c)}),$e=8,Lr=16,$={programTitle:70,levelTitle:30,check:42,entityRefFooter:100},j={programTitle:350+Lr*2,checkResult:42},Dr=e=>e.reduce((r,n)=>r+n.height,0),Br=e=>e*j.checkResult+j.programTitle,Or=e=>e.filter(r=>r!==void 0).map(r=>A(x(r),{defaultKind:"component"})).reduce((r,n)=>r.length>n.length?r:n,""),Hr=e=>$e*e+$e,Te="NoLevel",Fr=e=>({name:Te,badge:{options:{level:0,color:""},variant:le.Medal},entityRef:e,ordinal:0}),Pe=E(e=>({checkNameCell:{padding:0,backgroundColor:e.palette.background.paper},checkNameContent:{padding:`0 ${e.spacing(2)}px`,display:"flex",justifyContent:"space-between",alignItems:"center"},checkNameTypography:{overflow:"hidden",textOverflow:"ellipsis"},checkIndicator:{flexBasis:e.spacing(8)},checkNameCellVirtualized:{height:`${$.check}px`,lineHeight:`${$.check}px`,borderBottom:`1px solid ${e.palette.divider}`,borderRight:`1px solid ${e.palette.divider}`}})),Vr=S(({programId:e,programName:r,check:n,entityRefs:a,results:o,entityRoute:i})=>{const l=Pe(),s=I(()=>ve(o.filter(({result:c})=>c!==m.NotApplicable),"result"),[o]),d=new Map(o.map(c=>[c.entityRef,c.result]));return t.createElement("tr",{"data-testid":"program-check-row"},t.createElement("th",{scope:"row",className:l.checkNameCell,"aria-label":`${n.name} check for ${r} program`},t.createElement("div",{className:l.checkNameContent},t.createElement(w,{className:l.checkNameTypography,variant:"subtitle2",component:"p"},n.name),t.createElement(xe,{className:l.checkIndicator,progress:s}))),a.map((c,g)=>t.createElement(Se,{key:g,programId:e,check:n,entityRef:c,result:typeof c=="string"?d.get(c):void 0,entityRoute:i})))}),zr=({name:e,progress:r})=>{const n=Pe();return t.createElement("div",{className:n.checkNameCell,"aria-label":`${e} check`},t.createElement("div",{className:`${n.checkNameContent} ${n.checkNameCellVirtualized}`},t.createElement(w,{variant:"subtitle2",component:"p",className:n.checkNameTypography},e),t.createElement(xe,{className:n.checkIndicator,progress:r})))},qr=E(e=>({virtualized:{borderRight:`1px solid ${e.palette.divider}`,height:`${$.programTitle}px`,display:"flex",justifyContent:"center",alignItems:"center"}})),Mr=S(({entityRef:e,highestLevels:r})=>{const n=r.find(a=>a.entityRef===e);return t.createElement(t.Fragment,null,n!=null&&n.badge?t.createElement(ie,{badge:n.badge}):t.createElement(se,null))}),Wr=({highestLevel:e})=>{const r=qr();if(!(e!=null&&e.badge))return t.createElement("div",{className:r.virtualized},"\xA0");const n=e.name!==Te;return t.createElement("div",{className:r.virtualized},n?t.createElement(ie,{badge:e.badge}):t.createElement(se,null))},Ie=E(e=>({programNameCell:{padding:0,position:"sticky",backgroundColor:e.palette.background.paper},programNameContent:{padding:e.spacing(2)},programNameTypography:{overflow:"hidden",textOverflow:"ellipsis"},badgeCellContent:{display:"flex",justifyContent:"center",alignItems:"center"},programNameCellVirtualized:{borderRight:`1px solid ${e.palette.divider}`}})),jr=S(({program:e,entityRefs:r,highestLevels:n})=>{const a=Ie();return t.createElement("tr",{"data-testid":"program-title-row"},t.createElement("th",{scope:"row",className:a.programNameCell},t.createElement("div",{className:a.programNameContent},t.createElement(w,{className:a.programNameTypography,variant:"h5",component:"p"},e.name))),r.map((o,i)=>typeof o!="string"?t.createElement("td",{key:i,"aria-hidden":!0}):t.createElement("td",{key:i,"data-testid":"program-certification-cell"},t.createElement("div",{className:a.badgeCellContent},t.createElement(Mr,{entityRef:o,highestLevels:n})))))}),Gr=S(({name:e})=>{const r=Ie();return t.createElement("div",{className:`${r.programNameCell} ${r.programNameCellVirtualized}`},t.createElement("div",{className:r.programNameContent},t.createElement(w,{className:r.programNameTypography,variant:"h5",component:"p"},e)))}),Q=E(e=>{const r=e.palette.type==="dark"?e.palette.grey[700]:e.palette.grey[100];return{root:{color:de(e.palette.getContrastText(r),.8),backgroundColor:r},levelContent:{padding:`${e.spacing(.5)}px ${e.spacing(2)}px`,backgroundColor:r},levelTypography:{overflow:"hidden",textOverflow:"ellipsis"},levelHeaderCell:{padding:`${e.spacing(.5)}px ${e.spacing(2)}px`,borderRight:`1px solid ${e.palette.divider}`,height:`${$.levelTitle}px`}}}),Kr=S(({level:e,entityRefs:r,programName:n})=>{const a=Q();return t.createElement("tr",{className:a.root,"data-testid":"program-level-row"},t.createElement("th",{scope:"row",className:a.root},t.createElement("div",{className:a.levelContent},t.createElement(w,{className:a.levelTypography,variant:"subtitle2",component:"p","aria-label":`${e.name} for ${n} program`},e.name))),r.map((o,i)=>t.createElement("td",{key:i,className:a.root,"aria-hidden":!0})))}),_r=({name:e})=>{const r=Q();return t.createElement("div",{className:`${r.levelHeaderCell} ${r.root}`,"aria-label":`${e}`},t.createElement(w,{variant:"subtitle2",component:"p",className:r.levelTypography},e))},Ur=()=>{const e=Q();return t.createElement("div",{className:`${e.levelHeaderCell} ${e.root}`},"\xA0")},Jr=({program:e,highestLevels:r,levels:n,entityRefs:a,entityRoute:o})=>t.createElement("tbody",null,t.createElement(jr,{program:e,entityRefs:a,highestLevels:r}),n.map((i,l)=>t.createElement(ze,{key:l},t.createElement(Kr,{entityRefs:a,level:i,programName:e.name}),i.checks.map(({check:s,results:d},c)=>t.createElement(Vr,{key:c,check:s,programId:e.id,programName:e.name,entityRefs:a,results:d,entityRoute:o}))))),Ae=E(e=>({root:{position:"sticky",bottom:"-1px",backgroundColor:e.palette.background.default,boxShadow:`0 -1px ${e.palette.divider}`,"& td$cell, & th$cell":{border:0,padding:e.spacing(1)},"& td$cell":{backgroundColor:e.palette.background.default}},row:{boxShadow:`1px 0 ${e.palette.background.default}, -1px 0 ${e.palette.background.default}`},cell:{verticalAlign:"top"},cellInner:{textOrientation:"mixed",writingMode:"vertical-lr",transform:"rotate(-20deg)",transformOrigin:`100% ${e.spacing(1)}px`,wordBreak:"keep-all",fontWeight:"bold",overflow:"hidden",textOverflow:"ellipsis",maxHeight:"max(15vh, 175px)"}})),Qr=({entityRefs:e})=>{const r=H(V),n=Ae();return t.createElement("tfoot",{className:n.root,"data-testid":"results-table-footer"},t.createElement("tr",{className:n.row},t.createElement("td",{className:n.cell}),e.map((a,o)=>typeof a!="string"?t.createElement("th",{key:o,className:n.cell,"aria-hidden":!0}):t.createElement("th",{scope:"col",key:o,className:n.cell},t.createElement("div",{className:n.cellInner},t.createElement(O,{to:r(x(a))},A(x(a),{defaultKind:"component"})))))))},Yr=({entityRef:e})=>{const r=H(V),n=Ae(),a=e?t.createElement(O,{to:r(x(e))},A(x(e),{defaultKind:"component"})):t.createElement(t.Fragment,null);return t.createElement("div",{className:n.cell},t.createElement("div",{className:n.cellInner},a))},Xr=E(e=>({table:{backgroundColor:e.palette.background.paper,borderCollapse:"collapse",whiteSpace:"nowrap","& th, & td":{border:`1px solid ${e.palette.divider}`,borderCollapse:"collapse"},paddingBottom:e.spacing(2)},programTitle:{padding:e.spacing(2)},checkResult:{padding:e.spacing(1.5)},title:{padding:`${e.spacing(1)}px ${e.spacing(2)}px`},header:{backgroundColor:e.palette.type==="dark"?e.palette.grey[700]:e.palette.grey[100]}})),Le=()=>{const e=Xr(),r=new Array(25).fill(void 0),n=new Array(5).fill(void 0),a=new Array(3).fill(void 0);return t.createElement("table",{className:e.table},t.createElement("tbody",null,t.createElement("tr",null,t.createElement("td",{className:e.programTitle},t.createElement(W,{width:180,height:40})),r.map((o,i)=>t.createElement("td",{key:i}))),a.map((o,i)=>t.createElement(t.Fragment,{key:i},t.createElement("tr",{className:e.header},t.createElement("td",{className:e.title},t.createElement(W,{width:180})),r.map((l,s)=>t.createElement("td",{key:s}))),n.map((l,s)=>t.createElement("tr",{key:s},t.createElement("td",{className:e.title},t.createElement(W,{width:240})),r.map((d,c)=>t.createElement("td",{key:c,className:e.checkResult},t.createElement(W,{width:18,height:18,variant:"rect"})))))))))},Zr=E(e=>({root:{width:"100%"},table:{overflow:"auto",backgroundColor:e.palette.background.paper,borderCollapse:"collapse",whiteSpace:"nowrap",textAlign:"left","& th, & td":{border:`1px solid ${e.palette.divider}`,borderCollapse:"collapse"},"& th:first-of-type":{position:"sticky",left:0,zIndex:1,maxWidth:"60ch"},"& tfoot":{bottom:0,zIndex:1e3},"& tbody td:first-of-type":{border:`1px solid ${e.palette.divider}`,boxShadow:`1px 0 ${e.palette.background.default}, -1px 0 ${e.palette.background.default}`}}})),en=S(e=>{const{setError:r,type:n,ownerEntityRef:a}=e,o=Zr(),i=H(V),{data:l,isLoading:s,isError:d}=we(a,{type:n});if(R(()=>{r==null||r(d?new Error("Error loading program overview"):void 0)},[d,r]),s)return t.createElement(Le,null);if(!l||!a)return null;const{programs:c,entityRefs:g}=l;if(!s&&!c.length)return t.createElement(We,{missing:"data",title:"Missing programs",description:t.createElement(t.Fragment,null,"Looks like the group"," ",A(x(a),{defaultKind:"Group"})," ","doesn't own any ",n," components that have Soundcheck programs set up.",t.createElement("br",null),t.createElement("br",null),"If you're an administrator, you can learn more about configuring and filtering programs in the"," ",t.createElement(O,{to:"https://www.npmjs.com/package/@spotify/backstage-plugin-soundcheck-backend#entity-filter"},"docs"),".")});if(d)return null;const p=g.length>=25?g:[...g,...Array.from({length:25-g.length},()=>{})];return t.createElement("div",{className:o.root},t.createElement("table",{className:o.table,"aria-label":"Check results"},c.map(({program:h,levels:y,highestLevels:f},v)=>t.createElement(Jr,{key:v,program:h,entityRefs:p,levels:y,highestLevels:f,entityRoute:i})),t.createElement(Qr,{entityRefs:p})))}),tn=e=>t.createElement(Gr,{name:e}),rn=e=>({type:"ProgramHeader",render:()=>tn(e)}),nn=e=>e?t.createElement(_r,{name:e}):t.createElement(Ur,null),De=e=>({type:"LevelHeader",render:()=>nn(e)}),an=(e,r)=>t.createElement(zr,{name:e,progress:r}),on=(e,r)=>({type:"CheckTitle",render:()=>an(e,r)}),ln=(e,r,n,a,o)=>t.createElement(Se,{check:r,entityRef:n,entityRoute:o,programId:e,result:a,isVirtualized:!0}),sn=(e,r,n,a,o)=>({type:"CheckResult",render:()=>ln(e,r,n,a,o)}),cn=e=>t.createElement(Yr,{entityRef:e}),Be=e=>({type:"EntityHeader",render:()=>cn(e)}),dn=e=>t.createElement(Wr,{highestLevel:e}),mn=e=>({type:"LevelBadge",render:()=>dn(e)}),pn=e=>r=>{const n=e[r.rowIndex].cells[r.columnIndex];return n?t.createElement("div",{style:r.style},n.render()):t.createElement("div",{style:r.style})},un=(e,r,n)=>{var a;const o=[];for(const{program:l,levels:s,highestLevels:d}of e){o.push({height:$.programTitle,cells:[rn(l.name),...r.map(c=>{const g=c?d.find(p=>p.entityRef===c)||Fr(c):void 0;return mn(g)})]});for(const c of s){o.push({height:$.levelTitle,cells:[De(c.name),...r.map(g=>De(""))]});for(const{check:g,results:p}of c.checks)o.push({height:$.check,cells:[on(g.name,ve(p.filter(({result:h})=>h!==m.NotApplicable),"result")),...r.map(h=>{var y,f;return sn(l.id,g,h,(f=(y=p.find(v=>v.entityRef===h))==null?void 0:y.result)!=null?f:m.NotApplicable,n)})]})}}const i=Or(r!=null?r:[]);return o.push({height:Hr((a=i.length)!=null?a:1),cells:[Be(""),...r.map(l=>Be(l||""))]}),o},hn=E(e=>({table:{backgroundColor:e.palette.background.paper,borderCollapse:"collapse",whiteSpace:"nowrap",textAlign:"left",overflow:"auto"}})),gn=e=>{const{setError:r,type:n,ownerEntityRef:a}=e,o=hn(),i=H(V),{data:l,isLoading:s,isError:d}=we(a,{type:n});if(R(()=>{r==null||r(d?new Error("Error loading program overview"):void 0)},[d,r]),s)return t.createElement(Le,null);if(!l||!a)return null;const{programs:c,entityRefs:g}=l,p=g.length>=25?g:[...g,...Array.from({length:25-g.length},()=>{})],h=un(c,p,i),y=pn(h);return t.createElement(u,{"aria-label":`Check results for ${n}`,key:n,item:!0,xs:12},t.createElement(bt,{className:o.table,columnCount:p.length+1,columnWidth:f=>f===0?j.programTitle:j.checkResult,rowCount:h.length,rowHeight:f=>h[f].height,height:Dr(h),width:Br(p.length)},y))},fn=({facets:e,ownerEntityRef:r,type:n,setError:a})=>{const o=I(()=>{const i=new Map;return e.types.forEach(({value:l})=>{i.set(l,t.createElement(gn,{key:l,ownerEntityRef:r,type:l,setError:a}))}),i},[e,r,a]);return t.createElement("div",null,o.get(n))},yn=E(()=>({scrollContainer:{overflow:"auto"}})),En=({facets:e,ownerEntityRef:r,hasError:n,type:a,setError:o,useVirtualizedResultsTable:i})=>{var l,s;const d=yn();return n?t.createElement(ae,{severity:"error",title:n.message}):e&&((s=(l=e.types)==null?void 0:l.length)!=null?s:0)>0?t.createElement("div",{className:d.scrollContainer},i?t.createElement(fn,{facets:e,type:a,setError:o,ownerEntityRef:r,hasError:n}):t.createElement(en,{ownerEntityRef:r,type:a,setError:o})):t.createElement(Qe,{ownerEntityRef:r})},vn=E(e=>({tableContainer:{padding:e.spacing(3),backgroundColor:"transparent"}})),wn=({groupSelectorError:e,searchParams:r,setSearchParams:n})=>{var a;const{group:o,type:i}=r,[l,s]=k(void 0),[d,c]=k(void 0);R(()=>{l!==i&&s(i)},[i,l]);const{data:g,isLoading:p}=Nt(o),h=(a=N(ee).getOptionalBoolean("soundcheck.virtualizeOverviewPage"))!=null?a:!1,y=d||e,f=b=>{b&&(s(b),n({...r,type:b}))},v=vn();return t.createElement(u,{container:!0,spacing:0},t.createElement(u,{item:!0,xs:12},p?t.createElement(Nr,null):t.createElement(xr,{unfilteredFacets:g,type:l,onChange:f})),t.createElement(u,{item:!0,xs:12,className:v.tableContainer},!p&&t.createElement(En,{facets:g,type:l,setError:c,hasError:y,ownerEntityRef:o,useVirtualizedResultsTable:h})))},kn=e=>{var r;const{title:n="Soundcheck"}=e,[a,o]=$t(),{group:i}=a,[l,s]=k(void 0),d=(r=N(ee).getOptionalBoolean("soundcheck.noCodeUI"))!=null?r:!1;return t.createElement(Ye,null,t.createElement(Xe,null,t.createElement(je,{themeId:"website"},t.createElement(Ue,{backend:"soundcheck",invalidLicenseMessage:"Submitted check results will still be stored, but it will not be possible to view certifications or individual results until a valid license is present."}),t.createElement(Ge,{title:n},t.createElement(It,{onChange:c=>{c&&o({...a,group:c})},initialValue:i,setError:s})),t.createElement(Ke,{noPadding:!0,stretch:!0},t.createElement(Ft,null,t.createElement(Me,null,t.createElement(B,{path:"/*",element:t.createElement(wn,{groupSelectorError:l,searchParams:a,setSearchParams:o})}),d&&t.createElement(t.Fragment,null,t.createElement(B,{path:"/checks",element:t.createElement(Ut,null)}),t.createElement(B,{path:"/programs",element:t.createElement(kr,{ownerEntityRef:i})}),t.createElement(B,{path:"/fact-collectors",element:t.createElement(br,null)}))))))))};export{kn as OverviewPage};
|
|
2
|
-
//# sourceMappingURL=index-b2b00eb3.esm.js.map
|