@spotify/backstage-plugin-soundcheck 0.12.2 → 0.12.4
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 +57 -0
- package/README.md +2 -510
- package/alpha/package.json +1 -1
- package/config.d.ts +0 -4
- package/dist/alpha.esm.js +1 -1
- package/dist/esm/Card-Dj5kNp2Q.esm.js +2 -0
- package/dist/esm/CertificationSidebar-CVyVchB8.esm.js +2 -0
- package/dist/esm/EmptyState-CFyDYjmm.esm.js +2 -0
- package/dist/esm/EntitySoundcheckContent-Dm1OGOA5.esm.js +2 -0
- package/dist/esm/OverviewPageContent-DW92KphH.esm.js +2 -0
- package/dist/esm/{RefetchingIndicator-b4961e02.esm.js → RefetchingIndicator-CdGa4YBG.esm.js} +2 -2
- package/dist/esm/chartUtils-CDPSRCm-.esm.js +2 -0
- package/dist/esm/{index-f4bdaf5c.esm.js → index-ChMeGQBh.esm.js} +2 -2
- package/dist/esm/index-DNAl7tKw.esm.js +2 -0
- package/dist/esm/index-e9SWucyI.esm.js +2 -0
- package/dist/esm/{license-e9e73904.esm.js → license-CQErZDIh.esm.js} +1 -1
- package/dist/esm/routes-DcGwdXHX.esm.js +699 -0
- package/dist/images/git-dark.svg +1 -0
- package/dist/images/github-dark.svg +1 -0
- package/dist/images/github-light.svg +1 -0
- package/dist/images/pagerduty-dark.png +0 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.esm.js +1 -1
- package/package.json +20 -19
- package/dist/esm/Card-2862fdca.esm.js +0 -2
- package/dist/esm/CertificationSidebar-5e4230a7.esm.js +0 -2
- package/dist/esm/EmptyState-6a402254.esm.js +0 -2
- package/dist/esm/EntitySoundcheckContent-bc7bdbe2.esm.js +0 -2
- package/dist/esm/OverviewPageContent-d5467d2c.esm.js +0 -2
- package/dist/esm/chartUtils-080232d7.esm.js +0 -2
- package/dist/esm/index-5610fc82.esm.js +0 -2
- package/dist/esm/index-99d39b7d.esm.js +0 -2
- package/dist/esm/routes-93cd1496.esm.js +0 -599
- package/dist/images/octocat.svg +0 -17
- package/dist/images/settings.svg +0 -90
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{useApi as A,errorApiRef as F}from"@backstage/core-plugin-api";import{QueryClient as M,QueryClientProvider as D}from"@tanstack/react-query";import{memoize as H}from"lodash";import a,{createContext as y,useState as m,useCallback as l,useContext as v,useRef as L,useEffect as U}from"react";import{makeStyles as c,Modal as W,Box as Q,Typography as u,Button as E,withStyles as d,Fade as K,Card as j}from"@material-ui/core";import{Alert as q,AlertTitle as J}from"@material-ui/lab";import V from"@material-ui/icons/Check";import X from"@material-ui/icons/Close";import Y from"@material-ui/icons/HelpOutline";import Z from"@material-ui/icons/RemoveCircleOutline";import _ from"@material-ui/icons/ReportProblemOutlined";import{R as n}from"./routes-DcGwdXHX.esm.js";import p from"classnames";import{parseEntityRef as b}from"@backstage/catalog-model";import{humanizeEntityRef as R}from"@backstage/plugin-catalog-react";import ee from"../images/empty-state.svg";const te=H(e=>new M({defaultOptions:{queries:{refetchInterval:6e4,refetchIntervalInBackground:!1,refetchOnWindowFocus:"always",retry:2,retryDelay:t=>{const r=450+Math.ceil(Math.random()*100);return Math.min(r*2**t,3e4)},onError:t=>e.post(t)}}})),ae=e=>{const t=A(F),r=te(t);return a.createElement(D,{client:r},e.children)};var P=(e=>(e.GetAllPrograms="soundcheck/programs",e.GetChecks="soundcheck/checks",e.GetCollectors="soundcheck/collectors",e.GetFactSchema="soundcheck/collectors/schema",e.GetEntityFacets="soundcheck/catalog/facets",e.GetSoftwareEntityRefsForUser="soundcheck/entities/softwareEntityRefsForUser",e.GetCampaigns="soundcheck/campaigns",e.GetCampaignProgress="soundcheck/campaigns/getCampaignProgress",e.GetOverallCheckPassRateSnapshots="soundcheck/charts/overallCheckPassRateSnapshots",e.GetOverallCheckPassRateTrends="soundcheck/charts/overallCheckPassRateTrends",e.GetIndividualCheckPassRateSnapshots="soundcheck/charts/getIndividualCheckPassRateSnapshots",e.GetIndividualCheckPassRateTrends="soundcheck/charts/getIndividualCheckPassRateTrends",e.GetOverallTrackPassRateSnapshots="soundcheck/charts/overallTrackPassRateSnapshots",e.GetOverallTrackPassRateTrends="soundcheck/charts/overallTrackPassRateTrends",e.GetIndividualTrackPassRateSnapshots="soundcheck/charts/individualTrackPassRateSnapshots",e.GetIndividualTrackPassRateTrends="soundcheck/charts/individualTrackPassRateTrends",e.GetOverallEntityPassRateTrends="soundcheck/charts/overallEntityPassRateTrends",e.GetIndividualEntityPassRateSnapshots="soundcheck/charts/individualEntityPassRateSnapshots",e.GetIndividualEntityPassRateTrends="soundcheck/charts/individualEntityPassRateTrends",e.GetOverallGroupPassRateTrends="soundcheck/charts/overallGroupPassRateTrends",e.GetIndividualGroupPassRateSnapshots="soundcheck/charts/individualGroupPassRateSnapshots",e.GetIndividualGroupPassRateTrends="soundcheck/charts/individualGroupPassRateTrends",e.EntityByRef="soundcheck/catalog/entityByRef",e.EntitiesByRefs="soundcheck/catalog/entitiesByRef",e.TrackEntities="soundcheck/tracks/entities",e.CertificationStatus="soundcheck/certificationStatus",e.CertificationStatusHistory="soundcheck/certificationStatusHistory",e.CheckStatus="soundcheck/checkStatus",e.CheckStatusHistory="soundcheck/checkStatusHistory",e.Certifications="soundcheck/certifications",e.CertificationDetails="soundcheck/certificationDetails",e.GetCheckOwners="soundcheck/checks/getOwners",e.GetTrackOwners="soundcheck/tracks/getOwners",e.GetCampaignOwners="soundcheck/campaigns/getOwners",e))(P||{}),T=(e=>(e.DeleteCheck="soundcheck/deleteCheck",e.CreateCheck="soundcheck/createCheck",e.UpdateCheck="soundcheck/updateCheck",e.DeleteProgram="soundcheck/deleteProgram",e.CreateProgram="soundcheck/createProgram",e.UpdateProgram="soundcheck/updateProgram",e.UpdateCollectorConfig="soundcheck/updateCollectorConfig",e.CreateCampaign="soundcheck/createCampaign",e.UpdateCampaign="soundcheck/updateCampaign",e.DeleteCampaign="soundcheck/deleteCampaign",e.ArchiveCampaign="soundcheck/archiveCampaign",e))(T||{});const re=c(e=>({root:{alignItems:"flex-start",padding:e.spacing(2)},alertTitle:{marginBottom:0}})),x=e=>{const t=re();return a.createElement(q,{severity:e.severity,elevation:1,classes:{...t},onClose:e.onClose,variant:"filled"},a.createElement(J,{className:t.alertTitle},e.title),e.children)},S=y({}),se=e=>{const[t,r]=m(),o=l(k=>{r(k)},[]),s=l(()=>{r(null)},[]);return a.createElement(S.Provider,{value:{showAlert:o,clearAlert:s}},t&&a.createElement(x,{severity:t.severity,title:t.title,onClose:s},t.message),e.children)},oe=()=>v(S),ne=c(e=>({modalContent:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",backgroundColor:e.palette.background.paper},modalButtons:{display:"flex",justifyContent:"flex-end","& button":{width:"40%",maxWidth:"185px"},padding:e.spacing(2,3),borderTop:`1px solid ${e.palette.divider}`},modalMessage:{margin:"15px 0 35px"},modalText:{padding:e.spacing(2,3,0,3)},cancelButton:{color:e.palette.text.primary}})),G=y({}),ce=e=>{const t=ne(),[r,o]=m(!1),[s,k]=m(),i=L(),w=l(({title:B,message:$,error:z})=>(k({title:B,message:$,error:z}),o(!0),new Promise(O=>{i.current=O})),[]),I=l(()=>{i.current&&i.current(!0),o(!1)},[]),C=l(()=>{i.current&&i.current(!1),o(!1)},[]);return a.createElement(G.Provider,{value:{showModal:w}},e.children,s&&a.createElement(W,{open:r,onClose:C,"aria-labelledby":"confirmation-modal-title","aria-describedby":"confirmation-modal-description"},a.createElement(Q,{className:t.modalContent},a.createElement("div",{className:t.modalText},a.createElement(u,{id:"confirmation-modal-title",variant:"h6"},s.title),a.createElement(u,{className:t.modalMessage,id:"confirmation-modal-description",variant:"body1"},s.message)),a.createElement("div",{className:t.modalButtons},!s.error&&a.createElement(E,{onClick:C,variant:"text","aria-label":"cancel",className:t.cancelButton},"Cancel"),a.createElement(E,{color:"primary",onClick:I,variant:"contained","aria-label":"confirm"},s.error?"Ok":"Confirm")))))},ie=()=>v(G),le=e=>({[n.Passed]:"Check passed",[n.NotReported]:"Check not reported",[n.Failed]:"Check failed",[n.Warning]:"Check produced warning(s)",[n.NotApplicable]:"Check not applicable"})[e],de=d(e=>({root:{color:e.palette.success.main}}))(V),me=d(e=>({root:{color:e.palette.error.main}}))(X),ue=d(e=>({root:{color:e.palette.warning.main}}))(_),pe=d(e=>({root:{color:e.palette.info.main}}))(Y),he=d(e=>({root:{color:e.palette.text.disabled}}))(Z),ke=({result:e,className:t})=>{const r={className:t,"aria-label":le(e),"aria-hidden":!1};return e===n.Passed?a.createElement(de,{...r}):e===n.NotReported?a.createElement(pe,{...r}):e===n.Failed?a.createElement(me,{...r}):e===n.Warning?a.createElement(ue,{...r}):e===n.NotApplicable?a.createElement(he,{...r}):null},N=24,ge=11,g=e=>e==="small"?1:2,fe=c({root:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:"50%",borderWidth:"2px",fontWeight:700,width:({size:e})=>`${N*g(e)}px`,height:({size:e})=>`${N*g(e)}px`,fontSize:({size:e})=>`${ge*g(e)}px`}}),h=({className:e,label:t,size:r="small"})=>{const o=fe({size:r});return a.createElement("span",{className:p(e,o.root),role:"img","aria-label":`${t} badge`},t)},Ce=c(e=>({root:{background:({color:t})=>t,color:e.palette.common.black,borderColor:e.palette.common.black,borderStyle:"solid","&::after":{position:"absolute",display:"block",content:'""',top:0,left:0,width:"100%",height:"100%",borderRadius:"50%",boxShadow:["inset 0 -0.18em 0 0 rgba(0, 0, 0, 0.25)","inset 0px 0.18em 0px 0px rgba(255, 255, 255, 0.5)","inset 0px 1.3em 0px -0.5em rgba(255, 255, 255, 0.2)"].join(",")}}})),ye=({className:e,badge:t,size:r="small"})=>{const o=Ce({color:t.options.color,size:r});return a.createElement(h,{className:p(e,o.root),size:r,label:`L${t.options.level}`})},ve=c({root:{borderColor:"currentColor",borderStyle:"dashed"}}),Ee=({className:e,size:t="small"})=>{const r=ve();return a.createElement(h,{className:p(e,r.root),size:t,label:"NL"})},be=c({root:{borderColor:"currentColor",borderStyle:"solid"}}),Re=({className:e,size:t="small"})=>{const r=be();return a.createElement(h,{className:p(e,r.root),size:t,label:"C"})},Pe=({children:e})=>{const[t,r]=m(!1);return U(()=>{const o=setTimeout(()=>{r(!0)},250);return()=>clearTimeout(o)},[]),a.createElement(K,{in:t,timeout:250},e)},Te=c(e=>({card:{backgroundColor:e.palette.background.paper,border:`1px solid ${e.palette.divider}`,borderRadius:e.shape.borderRadius,display:"flex",padding:e.spacing(5)},container:{margin:"0 auto",display:"flex",flexDirection:"row",alignItems:"center",gap:e.spacing(5)},content:{width:"20rem",display:"flex",flexDirection:"column",gap:e.spacing(2)},header:{display:"flex",flexDirection:"column",gap:e.spacing(2)},action:{display:"inline-block"},img:{maxHeight:400}})),f=({title:e,description:t,imgSrc:r,action:o})=>{const s=Te();return a.createElement(j,{className:s.card},a.createElement("div",{className:s.container},a.createElement("div",{className:s.content},a.createElement("header",{className:s.header},a.createElement(u,{variant:"h5"},e),a.createElement(u,{color:"textSecondary",variant:"body1"},t)),o&&a.createElement("div",{className:s.action},o)),a.createElement("div",null,a.createElement("img",{src:r!=null?r:ee,className:s.img,alt:e}))))},xe="No certifications available",Se=({ownerEntityRef:e,selectGroupHint:t})=>{let r="There are no tracks configured that apply to this entity.";return e&&(r=`Looks like the group '${R(b(e),{defaultKind:"Group"})}' doesn't own any entities that have any applicable tracks configured. ${t}`),a.createElement(f,{title:xe,description:r})},Ge="Missing entities",Ne=({ownerEntityRef:e,selectGroupHint:t})=>{if(!e)return null;const r=R(b(e),{defaultKind:"Group"});return a.createElement(f,{title:Ge,description:`The group '${r}' doesn't own any entities. ${t!=null?t:""}`})};export{x as A,h as B,ke as C,f as E,Pe as F,ye as L,T as M,Ee as N,P as Q,ae as S,Se as a,Re as b,ie as c,se as d,Ne as e,oe as u,ce as w};
|
|
2
|
+
//# sourceMappingURL=EmptyState-CFyDYjmm.esm.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import e,{useState as te,useEffect as ae,useRef as re,createContext as ne,useContext as ie,useMemo as le}from"react";import{useApi as W,useRouteRef as y,useRouteRefParams as S}from"@backstage/core-plugin-api";import{useEntity as f}from"@backstage/plugin-catalog-react";import{Link as z,useParams as M,Routes as oe,Route as v,Navigate as R}from"react-router-dom";import{R as ce,u as C,C as se,a as L,b as N,c as de,d as me,e as pe,f as ue}from"./CertificationSidebar-CVyVchB8.esm.js";import{useQuery as U}from"@tanstack/react-query";import{s as Q,R as u,a as x,b as w,d as O,f as B,c as j}from"./routes-DcGwdXHX.esm.js";import{Q as ge,A as I,F as G,B as fe,L as Ee,N as he,a as ye,S as ve}from"./EmptyState-CFyDYjmm.esm.js";import{stringifyEntityRef as H}from"@backstage/catalog-model";import{makeStyles as g,Typography as k,Box as K,Tab as $,Tabs as V,styled as A,Accordion as ke,AccordionSummary as be,AccordionDetails as Ce,useTheme as Ie,Paper as Re,Divider as Ne}from"@material-ui/core";import{SpotifyLicenseBanner as xe}from"@spotify/backstage-plugin-core";import{s as we,i as Te}from"./license-CQErZDIh.esm.js";import{Skeleton as E}from"@material-ui/lab";import{i as Pe}from"./chartUtils-CDPSRCm-.esm.js";import{MarkdownContent as T,LinearGauge as Se,Link as Le}from"@backstage/core-components";import Be from"react-confetti";import $e from"react-use/lib/useMeasure";import Y from"react-use/lib/usePrevious";import{R as Ae}from"./RefetchingIndicator-CdGa4YBG.esm.js";import Fe from"classnames";import De from"@material-ui/icons/ExpandMore";import P from"lodash";import"@material-ui/icons/Schedule";import"luxon";import"graphql-request";import"graphql-tag";import"@backstage/core-compat-api";import"@material-ui/icons/Check";import"@material-ui/icons/Close";import"@material-ui/icons/HelpOutline";import"@material-ui/icons/RemoveCircleOutline";import"@material-ui/icons/ReportProblemOutlined";import"../images/empty-state.svg";import"react-use/lib/useDebounce";import"react-use/lib/useUnmount";function We(t){const a=W(Q);return U([ge.CertificationDetails,t],async()=>a.getCertificationDetails(t))}function ze(t,a,r){const i=W(Q),n=H(t);return U(["soundcheck/check-details",n,a,r],async()=>i.getCheckResultDetails(n,a,r),{enabled:!!a&&!!r})}const Me=g({markdownContent:{"& :last-child":{marginBottom:0}}}),Ue=({state:t,notes:a})=>{const r=Me(),i={[u.Passed]:"success",[u.Failed]:"error",[u.Warning]:"warning",[u.NotReported]:"info",[u.NotApplicable]:"info"}[t],n={[u.Passed]:"Check passed",[u.Failed]:"Check did not pass",[u.Warning]:"Check produced warning(s)",[u.NotReported]:"Check not reported",[u.NotApplicable]:"Check not applicable"}[t];return e.createElement(I,{severity:i,title:n},a?e.createElement(T,{className:r.markdownContent,content:a}):null)},Qe=()=>{const t=q();return e.createElement(G,null,e.createElement("div",{className:t.root,"data-testid":"check-details-view"},e.createElement("div",{className:t.topBar},e.createElement(k,{variant:"h2",className:t.title},e.createElement(E,{width:300,height:32})),e.createElement(E,{width:100,height:32})),e.createElement(E,{variant:"rect",height:120}),e.createElement("div",{"data-testid":"soundcheck-check-details-description"},e.createElement(k,{variant:"h3"},e.createElement(E,null)),e.createElement(E,null),e.createElement(E,null),e.createElement(E,null))))},q=g(t=>({root:{padding:`${t.spacing(3)}px ${t.spacing(5)}px`},title:{fontWeight:"normal",fontSize:t.typography.h5.fontSize},description:{padding:`${t.spacing(3)}px 0`},subtitle:{fontWeight:"normal",fontSize:t.typography.h6.fontSize},topBar:{display:"flex",justifyContent:"space-between",marginBottom:t.spacing(2)}})),J=({programId:t,checkId:a})=>{const r=q(),{entity:i}=f(),{data:n,isLoading:l,isError:o}=ze(i,t,a);if(o)return e.createElement(K,{padding:2},e.createElement(I,{severity:"error",title:"Error loading check details"}));if(l||!t||!a)return e.createElement(Qe,null);if(!n)return null;const{name:c,description:m,result:d,timestamp:s,notes:p}=n;return e.createElement("div",{className:r.root,"data-testid":"check-details-view"},e.createElement("div",{className:r.topBar},e.createElement(k,{variant:"h2",className:r.title},c),s?e.createElement(ce,{timestamp:s,description:"Last updated"}):null),e.createElement(Ue,{state:d,notes:p}),e.createElement("div",{className:r.description,"data-testid":"soundcheck-check-details-description"},e.createElement(k,{variant:"h3",className:r.subtitle},"Description"),e.createElement(T,{content:m})))},Oe=g(()=>({root:{position:"absolute",width:"100%",height:"100%"}})),je=({programId:t})=>{var a,r;const i=Oe(),{entity:n}=f(),{data:l,isLoading:o}=C(n,t),[c,{width:m,height:d}]=$e(),s=o?void 0:(r=(a=l==null?void 0:l.highestLevel)==null?void 0:a.ordinal)!=null?r:-1,p=Y(s),h=Y(t),[ee,D]=te(!1);return ae(()=>{typeof p!="undefined"&&typeof s!="undefined"&&t===h&&s>p&&D(!0)},[s,p,t,h]),ee?e.createElement("div",{ref:c,className:i.root},e.createElement(Be,{width:m,height:d,numberOfPieces:1e3,gravity:1,initialVelocityY:20,recycle:!1,onConfettiComplete:()=>D(!1)})):null},X=g(t=>({root:{maxWidth:"80ch",textTransform:"uppercase",paddingTop:t.spacing(2),paddingBottom:t.spacing(2)},wrapper:{display:"inline-block",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},badge:{marginRight:t.spacing(1)}})),Ge=({id:t,name:a,badge:r,href:i,selected:n=!1})=>{const l=X(),{entity:o}=f(),{data:c}=C(o,t);return e.createElement($,{className:l.root,classes:{wrapper:l.wrapper},value:t,label:e.createElement(e.Fragment,null,e.createElement(se,{badge:r,trackType:c==null?void 0:c.program.type,className:l.badge}),a),component:z,to:i,selected:n})},He=g({root:{borderColor:"currentColor",borderStyle:"solid"}}),Ke=({className:t,size:a="small"})=>{const r=He();return e.createElement(fe,{className:Fe(t,r.root),size:a,label:"\u25BA"})},Ve=g(t=>({root:{maxWidth:"80ch",textTransform:"uppercase",paddingTop:t.spacing(2),paddingBottom:t.spacing(2)},wrapper:{display:"inline-block",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},badge:{marginRight:t.spacing(1)}})),Ye=({id:t,name:a,href:r,selected:i=!1})=>{const n=Ve();return e.createElement($,{className:n.root,classes:{wrapper:n.wrapper},value:t,label:e.createElement(e.Fragment,null,e.createElement(Ke,{className:n.badge}),a),component:z,to:r,selected:i})},F=()=>{const t=X();return e.createElement($,{className:t.root,classes:{wrapper:t.wrapper},label:e.createElement(E,{width:180})})},qe=()=>e.createElement(G,null,e.createElement(V,{value:!1,indicatorColor:"primary"},e.createElement(F,null),e.createElement(F,null),e.createElement(F,null)));function Je(t=[],a=[],r,i){if(r){const l=t.findIndex(o=>o.id===r);return l<0?!1:l}const n=a.findIndex(l=>l.program.id===i);return n<0?!1:n+t.length}const Xe=({playlistId:t,trackId:a})=>{const{entity:r}=f(),{isLoading:i,data:n}=L(r),{isLoading:l,data:o}=N(r),c=y(x),m=y(w);if(l||i||!a)return e.createElement(qe,null);const d=Je(o,n,t,a);return e.createElement(V,{value:d,indicatorColor:"primary","aria-label":"Certifications",variant:"scrollable"},(o==null?void 0:o.length)&&o.map(({id:s,name:p})=>e.createElement(Ye,{key:s,id:s,name:p,selected:s===a,href:c({playlistId:s})})),n&&n.filter(({program:{type:s}})=>s!=="playlist").map(({program:{id:s,name:p},highestLevel:h})=>e.createElement(Ge,{key:s,id:s,name:p,badge:h==null?void 0:h.badge,selected:s===a,href:m({trackId:s})})))},Ze=A(ke)(({theme:t})=>({margin:"0",border:`1px solid ${t.palette.divider}`,borderRadius:0,"&.Mui-expanded":{borderRadius:0},"&:first-child":{borderTopLeftRadius:0,borderTopRightRadius:0},"&:last-child":{borderBottomLeftRadius:0,borderBottomRightRadius:0},"&:not(:first-child)":{borderTop:`1px solid ${t.palette.divider}`},"&:not(:last-child)":{marginBottom:t.spacing(1)}})),_e=A(({...t})=>e.createElement(be,{classes:{content:"content",expanded:"expanded"},...t}))(({theme:t})=>({borderRadius:0,paddingTop:0,paddingLeft:0,paddingRight:t.spacing(1),"& > .content":{margin:"0 !important",padding:"0 !important"},"& > .content.expanded":{margin:"0 !important",padding:"0 !important"}})),et=A(Ce)(()=>({margin:"0 !important",borderRadius:0,padding:0})),tt=g(()=>({sidebar:{width:"100%"}})),at=({playlistId:t,trackId:a,checkId:r})=>{var i;const n=tt(),{entity:l}=f(),o=re(null),{data:c,isLoading:m,isError:d}=C(l,a);if(d)return e.createElement("div",null,e.createElement(K,{padding:2},e.createElement(I,{severity:"error",title:"Error loading certification"})));if(m||!a)return e.createElement(de,null);if(!c)return null;const s=c.program.type==="campaign";return e.createElement(Ze,{ref:o,defaultExpanded:!0,elevation:0},e.createElement(_e,{expandIcon:e.createElement(De,null),"aria-controls":"certification-content",id:"certification-summary"},e.createElement(me,{name:c.program.name,badge:(i=c.highestLevel)==null?void 0:i.badge,description:c.program.description,documentationUrl:c.program.documentationURL,trackType:c.program.type})),e.createElement(et,null,e.createElement("div",{className:n.sidebar},c==null?void 0:c.levels.map(p=>e.createElement(pe,{key:p.ordinal,level:p,checkId:r,trackId:a,playlistId:t,isCampaign:s})))))},Z=ne(void 0),rt=()=>{const t=ie(Z);if(!t)throw new Error("useAPlaylistCertificationContext must be used within an PlaylistCertificationProvider");return t},nt=t=>{const{children:a,entityRef:r}=t,i=We(r);return e.createElement(Z.Provider,{value:i},a)},it=(t,a)=>{if(a)return a.filter(r=>t.trackIds.includes(r.program.id)).map(r=>{const i=P.sumBy(r.levels,o=>P.filter(o.checks,{result:u.Passed}).length),n=P.sumBy(r.levels,o=>P.reject(o.checks,{result:u.NotApplicable}).length),l=n===0?0:i/n;return{id:r.program.id,name:r.program.name,checkPassRate:l}})},lt=g(()=>({root:{margin:0,width:"250px"},trackItem:{display:"flex",flexDirection:"column",alignItems:"flex-start"},badgeAndName:{display:"flex",flexDirection:"row",alignItems:"center"},trackName:{marginLeft:"8px"}})),ot=({playlist:t})=>{const a=lt(),{data:r}=rt(),i=Ie(),n=le(()=>it(t,r),[r,t]);return e.createElement("div",{className:a.root},n&&n.map(l=>{var o,c;const m=(c=(o=r==null?void 0:r.find(d=>d.program.id===l.id))==null?void 0:o.highestLevel)==null?void 0:c.badge;return e.createElement("div",{className:a.trackItem,key:l.id},e.createElement("div",{className:a.badgeAndName},m?e.createElement(Ee,{badge:m}):e.createElement(he,null),e.createElement(k,{variant:"caption",color:"textSecondary",className:a.trackName},l.name)),e.createElement("div",{style:{width:"100%",marginBottom:"8px"}},e.createElement(Se,{value:l.checkPassRate,getColor:()=>i.palette.status.ok})))}))},_=g(t=>({description:{padding:0,margin:0,display:"block","& p":{margin:0}},root:{padding:t.spacing(2),margin:0,display:"grid",gridTemplateColumns:"min-content auto",gridGap:t.spacing(2)},title:{fontSize:t.typography.pxToRem(18),fontWeight:700,lineHeight:1.235,marginBottom:"6px"},level:{textTransform:"uppercase",color:t.palette.text.secondary,fontWeight:700,letterSpacing:"1px"}}));function ct({description:t,documentationUrl:a}){const r=_();return a?e.createElement("div",{className:r.description},e.createElement(T,{content:t}),e.createElement(Le,{to:a},"Learn more")):e.createElement("div",{className:r.description},e.createElement(T,{content:t}))}const st=({playlist:t})=>{const a=_(),{name:r,description:i}=t;return e.createElement("div",{className:a.root},e.createElement(ot,{playlist:t}),e.createElement("div",null,e.createElement(k,{className:a.title},r),i&&e.createElement(ct,{description:i,documentationUrl:void 0})))},dt=g(t=>({root:{margin:0,display:"grid",gridTemplateColumns:"1fr",backgroundColor:t.palette.background.default},header:{backgroundColor:t.palette.background.paper,borderBottom:`1px solid ${t.palette.divider}`},section:{backgroundColor:t.palette.background.paper,border:`1px solid ${t.palette.divider}`,padding:0,marginTop:t.spacing(1),marginBottom:t.spacing(1),marginLeft:0,marginRight:t.spacing(1)},twoColumns:{display:"grid",gridTemplateColumns:"1fr 2fr"},sidebar:{display:"grid",gridTemplateColumns:"1fr",margin:t.spacing(1)}})),mt=({playlist:t,entityRef:a})=>{const r=dt(),{trackId:i,checkId:n}=M();return e.createElement("div",{className:r.root},e.createElement(nt,{entityRef:a},e.createElement("div",{className:r.header},e.createElement(st,{playlist:t,entityRef:a})),e.createElement("div",{className:r.twoColumns},e.createElement("div",{className:r.sidebar},t.trackIds.map(l=>e.createElement(at,{key:l,playlistId:t.id,trackId:l,checkId:n}))),e.createElement("div",{className:r.section},e.createElement(J,{programId:i,checkId:n})))))},pt=g(t=>({paper:{overflow:"hidden",position:"relative",border:Pe(t)?`1px solid ${t.palette.divider}`:void 0},view:{display:"grid",gridTemplateColumns:"1fr 2fr"},sidebar:{borderRight:`1px solid ${t.palette.divider}`}})),ut=()=>{const{playlistId:t,trackId:a,checkId:r}=M(),i=pt(),{entity:n}=f(),{isError:l,isFetched:o,data:c}=L(n),{isError:m,data:d}=N(n);if(l||m)return e.createElement(I,{severity:"error",title:"Error loading certifications"});const s=t&&(d==null?void 0:d.find(h=>h.id===t));if(t&&!s)return e.createElement(I,{severity:"error",title:"Playlist ${playlistId} not found."});if(o&&!(c!=null&&c.length))return e.createElement(ye,null);const p=n?H(n):void 0;return e.createElement(Re,{className:i.paper},e.createElement(Ae,null),e.createElement(Xe,{playlistId:t,trackId:a}),e.createElement(Ne,null),s&&e.createElement(mt,{playlist:s,entityRef:p}),!s&&a&&e.createElement("div",{"data-testid":"soundcheck-certification-view",className:i.view},e.createElement("div",{className:i.sidebar},e.createElement(ue,{trackId:a,checkId:r})),e.createElement(J,{programId:a,checkId:r}),e.createElement(je,{programId:a})))},gt=g(t=>({root:{"&:not(:first-child)":{marginTop:t.spacing(2)}}})),b=()=>{const t=gt();return e.createElement(e.Fragment,null,e.createElement(xe,{backend:we,invalidLicenseMessage:Te,inline:!0}),e.createElement("div",{className:t.root},e.createElement(ut,null)))},ft=()=>{var t,a;const{entity:r}=f(),i=y(x),n=y(w),{isLoading:l,data:o}=N(r),{isLoading:c,data:m}=L(r);if(l||c)return null;const d=(t=o==null?void 0:o[0])==null?void 0:t.id,s=(a=m==null?void 0:m[0])==null?void 0:a.program.id;return!d&&!s?null:e.createElement(R,{to:d?i({playlistId:d}):n({trackId:s}),replace:!0})},Et=()=>{var t;const{entity:a}=f(),{playlistId:r}=S(x),i=y(B),{data:n}=N(a),l=(t=n==null?void 0:n.find(o=>o.id===r))==null?void 0:t.trackIds[0];return l?e.createElement(R,{to:i({playlistId:r,trackId:l}),replace:!0}):null},ht=()=>{var t,a;const{entity:r}=f(),{playlistId:i,trackId:n}=S(B),{data:l}=C(r,n),o=y(O),c=(a=(t=l==null?void 0:l.levels[0])==null?void 0:t.checks[0])==null?void 0:a.id;return c?e.createElement(R,{to:o({playlistId:i,trackId:n,checkId:c}),replace:!0}):null},yt=()=>{var t,a;const{entity:r}=f(),{trackId:i}=S(w),n=y(j),{data:l}=C(r,i),o=(a=(t=l==null?void 0:l.levels[0])==null?void 0:t.checks[0])==null?void 0:a.id;return o?e.createElement(R,{to:n({trackId:i,checkId:o}),replace:!0}):null},vt=()=>e.createElement(oe,null,e.createElement(v,{path:O.path,element:e.createElement(b,null)}),e.createElement(v,{path:B.path,element:e.createElement(e.Fragment,null,e.createElement(b,null),e.createElement(ht,null))}),e.createElement(v,{path:x.path,element:e.createElement(e.Fragment,null,e.createElement(b,null),e.createElement(Et,null))}),e.createElement(v,{path:w.path,element:e.createElement(e.Fragment,null,e.createElement(b,null),e.createElement(yt,null))}),e.createElement(v,{path:j.path,element:e.createElement(b,null)}),e.createElement(v,{path:"/",element:e.createElement(e.Fragment,null,e.createElement(b,null),e.createElement(ft,null))})),kt=()=>e.createElement(ve,null,e.createElement(vt,null));export{kt as EntitySoundcheckContent};
|
|
2
|
+
//# sourceMappingURL=EntitySoundcheckContent-Dm1OGOA5.esm.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{stringifyEntityRef as K,parseEntityRef as G}from"@backstage/catalog-model";import{useApi as x,identityApiRef as te,configApiRef as _e,useRouteRef as D}from"@backstage/core-plugin-api";import{catalogApiRef as M,EntityRefLink as ae,humanizeEntityRef as Q,entityRouteRef as ne}from"@backstage/plugin-catalog-react";import t,{createContext as Ke,useState as $,useEffect as T,useContext as Qe,useMemo as F,useCallback as S,memo as A,useRef as Je,useLayoutEffect as qe}from"react";import Xe from"react-use/lib/useAsync";import{makeStyles as E,alpha as re,TextField as Ye,CircularProgress as le,Grid as N,Typography as g,Button as Ze,Menu as et,MenuItem as oe,Tabs as tt,Tab as at,TablePagination as ie,withStyles as nt,Tooltip as se,LinearProgress as rt,Accordion as lt,AccordionSummary as ot,AccordionDetails as it}from"@material-ui/core";import st from"@material-ui/lab/Autocomplete";import{useSearchParams as J,useNavigate as ct}from"react-router-dom";import dt from"react-use/lib/useLocalStorage";import{useQuery as I}from"@tanstack/react-query";import{s as H,h as pt,i as mt,R as L,B as ut,j as gt}from"./routes-DcGwdXHX.esm.js";import{Q as q,C as ft,L as ce,N as de,b as pe,A as vt,a as ht,e as yt}from"./EmptyState-CFyDYjmm.esm.js";import{HeaderTabs as Et,MarkdownContent as Ct,Link as X}from"@backstage/core-components";import kt from"@material-ui/icons/ExpandMore";import bt from"@material-ui/icons/ArrowDropDown";import wt from"@material-ui/icons/ArrowDropUp";import{makeStyles as me}from"@material-ui/core/styles";import{motion as ue}from"framer-motion";import{R as Nt}from"./RefetchingIndicator-CdGa4YBG.esm.js";import{VariableSizeGrid as xt}from"react-window";import{Skeleton as j}from"@material-ui/lab";import{countBy as ge}from"lodash";function Rt(e,a,n,r){const l=x(H);return I(["soundcheck/track-overview-for-owner",e,a,n,r],async()=>l.getProgramOverviewForOwner(e,a,n,r),{enabled:!!e&&!!(a!=null&&a.kind),staleTime:5*60*1e3,refetchInterval:!1,refetchOnWindowFocus:!1})}function fe(){const e=x(M);return I(["soundcheck/all-groups"],async()=>{const{items:a}=await e.getEntities({filter:{kind:"Group"},fields:["spec.profile.displayName","metadata.title","metadata.name","metadata.namespace","kind"]});return a.filter(n=>(n==null?void 0:n.kind)==="Group").map(n=>{var r,l,s,i;return{name:(i=(s=(l=(r=n.spec)==null?void 0:r.profile)==null?void 0:l.displayName)!=null?s:n.metadata.title)!=null?i:n.metadata.name,ref:K(n)}})},{staleTime:5*60*1e3,refetchInterval:!1,refetchOnWindowFocus:!1})}function Pt(){const e=x(te),a=x(M);return I(["soundcheck/user-groups-claims"],async()=>{const{ownershipEntityRefs:n}=await e.getBackstageIdentity();return(await a.getEntitiesByRefs({entityRefs:n})).items.filter(r=>(r==null?void 0:r.kind)==="Group").map(r=>{var l,s,i,c,o;return{name:(c=(i=(s=(l=r.spec)==null?void 0:l.profile)==null?void 0:s.displayName)!=null?i:r.metadata.title)!=null?c:r.metadata.name,ref:K(r),type:(o=r.spec)==null?void 0:o.type}})})}function ve(e){const a=x(H);return I([q.GetCampaigns,JSON.stringify(e)],async()=>a.getCampaigns(e),{staleTime:5*60*1e3,refetchInterval:!1,refetchOnWindowFocus:!1})}function $t(e){const a=x(H);return I(["soundcheck/facets-for-owner",e],async()=>a.getFacetsForOwner(e),{enabled:!!e,staleTime:5*60*1e3,refetchInterval:!1,refetchOnWindowFocus:!1})}const he=e=>{const a=x(H);return I([q.GetIndividualEntityPassRateSnapshots,{...e,filter:{...e==null?void 0:e.filter,numberOfDays:0}}],async()=>a.getIndividualEntityPassRates({...e,filter:{...e==null?void 0:e.filter,numberOfDays:0}}),{staleTime:5*60*1e3,refetchInterval:!1,refetchOnWindowFocus:!1})},ye={loading:!0},Ee=Ke(ye),Tt=()=>Qe(Ee),St=({children:e})=>{const[a,n]=$(ye),r=x(M),l=x(te),{value:s,loading:i,error:c}=Xe(async()=>{const[{token:o},d]=await Promise.all([l.getCredentials(),l.getBackstageIdentity()]);return o?await r.getEntityByRef(d.userEntityRef):null},[r,l]);return T(()=>{if(s){const o=K(s);n({user:s,userEntityRef:o,loading:i,error:c})}else n({loading:i,error:c})},[s,i,c]),t.createElement(Ee.Provider,{value:a},e)},Ce=()=>{const{data:e,isLoading:a,isError:n}=Pt(),{data:r,isLoading:l,isError:s}=fe();return{options:F(()=>{const i=new Map;return e&&e.forEach(({name:c,ref:o,type:d})=>{i.set(`${o}`,{name:c,ref:o,type:d,key:"My Groups"})}),r&&r.forEach(({name:c,ref:o})=>{i.has(`${o}`)||i.set(`${o}`,{name:c,ref:o,key:"All Groups"})}),[...i.values()]},[e,r]),isLoading:a||l,isError:n||s}},It=E(e=>({root:{width:"100%",minWidth:250},textField:{"& $notchedOutline":{borderColor:re(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:{}}),{name:"SoundcheckGroupSelector"}),Lt=({setError:e})=>{const{options:a,isLoading:n,isError:r}=Ce(),l=It(),[s,i]=J(),[c,o]=dt("soundcheck.overview.groupRef",null),d=s.get("group"),m=x(_e).getOptionalString("soundcheck.overview.defaultSelectedGroupType"),f=F(()=>{var u,h;if(!n&&a.length){if(d||c){const y=d!=null?d:c;return(u=a.find(C=>C.ref===y))!=null?u:a[0]}else if(m)return(h=a.find(y=>y.type===m))!=null?h:a[0];return a[0]}return null},[m,n,a,d,c]),p=S((u,h)=>{u&&s.get("group")!==u&&(s.set("group",u),i(s,{replace:h}),o(u))},[s,o,i]),v=S((u,h)=>{p==null||p(h==null?void 0:h.ref)},[p]);return T(()=>{c&&!d&&p(c,!0)},[c,d,p]),T(()=>{p(f==null?void 0:f.ref,!0)},[p,f]),T(()=>{e==null||e(r?new Error("Error loading groups"):void 0)},[r,e]),r?null:t.createElement(st,{"aria-label":"Current group",className:l.root,classes:{clearIndicator:l.clearIndicator,popupIndicator:l.popupIndicator},disableClearable:!0,options:a!=null?a:[],loading:n,groupBy:u=>u.key,value:f,freeSolo:!1,onChange:v,getOptionLabel:u=>u.name,renderInput:u=>t.createElement(Ye,{...u,variant:"outlined",placeholder:n?"Loading":"Select a group",className:l.textField,InputProps:{...u.InputProps,className:l.input,classes:{notchedOutline:l.notchedOutline},endAdornment:t.createElement(t.Fragment,null,n?t.createElement(le,{color:"inherit",size:20}):null,u.InputProps.endAdornment)}})})},Ot=E(e=>({loadingContainer:{marginTop:e.spacing(1),display:"flex",justifyContent:"center",alignItems:"center",height:"100%"}})),ke=({size:e})=>{const a=Ot();return t.createElement(N,{container:!0,className:a.loadingContainer},t.createElement(le,{size:e}))},Ft=me(e=>({detailRow:{marginBottom:e.spacing(1)},label:{fontWeight:"bold",color:e.palette.text.primary},value:{marginLeft:e.spacing(1)}})),O=({label:e,value:a})=>{const n=Ft();return t.createElement(N,{item:!0,xs:12,container:!0,className:n.detailRow,alignItems:"center"},t.createElement(g,{variant:"subtitle1",className:n.label},e,":"),t.createElement(g,{variant:"body1",display:"inline",className:n.value},a))},At=me(e=>({innerContainer:{padding:e.spacing(0,1)},sectionLabel:{fontWeight:700,margin:e.spacing(2,0),color:e.palette.primary.main}})),V=e=>new Date(e).toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"}),zt=({campaign:e})=>{const a=At(),{name:n,description:r,ownerEntityRef:l,startDate:s,targetCompletionDate:i,supportChannel:c}=e;return t.createElement(t.Fragment,null,t.createElement(g,{variant:"h6",className:a.sectionLabel},"Campaign details"),t.createElement(N,{container:!0,className:a.innerContainer,spacing:2},t.createElement(N,{item:!0,container:!0,xs:12,spacing:0},t.createElement(O,{label:"Name",value:n}),t.createElement(O,{label:"Description",value:r}),t.createElement(O,{label:"Owner",value:t.createElement(ae,{entityRef:l})}),c&&t.createElement(O,{label:"Support channel",value:c}),t.createElement(O,{label:"Start date",value:V(s)}),t.createElement(O,{label:"Target completion date",value:V(i)}))))};function Bt({angle:e,arc:a,direction:n,dist:r,emoji:l,delay:s,fontSize:i,speed:c}){return t.createElement(ue.div,{style:{position:"absolute",fontSize:i},initial:{top:0,left:"50%",x:"-50%",y:"-100%",rotate:0,originX:`${a*n}px`,originY:`${a}px`},animate:{opacity:[0,1,0,0,0,0],y:`${-r}px`,rotate:e*n},transition:{delay:s,duration:c,ease:[.2,.83,.46,.63],repeat:1/0}},l)}const Dt=["\u{1F4C8}","\u{1F4CA}","\u{1F4C9}","\u{1F680}","\u2B50\uFE0F"],Wt=E(()=>({container:{position:"relative"}}));function Gt({angle:e=125,density:a=20,emojis:n=Dt,fontSizeMin:r=6,fontSizeMax:l=24,size:s=300,speed:i=4}){const c=Wt(),o=F(()=>Array.from({length:a*n.length}).map((d,m)=>({emoji:n[Math.floor(Math.random()*n.length)],arc:Math.random()*s*.5,delay:Math.random()*i,dist:Math.random()*s,direction:m%2?1:-1,fontSize:Math.random()*(l-r)+r,angle:e,speed:i})),[a,n,i,s,e,l,r]);return t.createElement("div",{className:c.container},t.createElement(g,{variant:"h1"},"\u{1F469}\u200D\u{1F4BB}"),o.map((d,m)=>t.createElement(Bt,{key:`${d.emoji}-${m}`,...d})))}const Mt=E(()=>({container:{position:"relative",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",flex:1,height:"100%"},textContainer:{position:"relative",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"}}));function be({title:e,subtitle:a}){const n=Mt();return t.createElement("div",{className:n.container},t.createElement("div",{className:n.textContainer},t.createElement(Gt,null),t.createElement(ue.div,{animate:{y:0,opacity:1},initial:{y:100,opacity:0}},e&&t.createElement(g,{align:"center",variant:"h6"},e),a&&t.createElement(g,{align:"center",variant:"subtitle2"},a))))}const Ht=E(e=>({campaignCards:{display:"flex",flexDirection:"column"},campaignCard:{display:"flex",flexDirection:"column",border:`1px solid ${e.palette.divider}`,padding:e.spacing(2),gap:e.spacing(5),borderRadius:e.shape.borderRadius},actions:{display:"flex",alignItems:"center",gap:e.spacing(1)},actionsText:{textTransform:"lowercase","&:first-letter":{textTransform:"uppercase"}},flexRow:{display:"flex",gap:e.spacing(1)},campaignDescription:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},progress:{display:"flex",alignItems:"center",gap:e.spacing(1),width:"90%"},flexColumn:{width:"100%",display:"flex",flexDirection:"column",gap:e.spacing(1)},detailSection:{display:"flex",flexDirection:"row",justifyContent:"space-between",gap:e.spacing(.5)},label:{fontWeight:"bold",color:e.palette.text.primary},value:{marginTop:"2px"},description:{maxWidth:"90%"},menuList:{backgroundColor:e.palette.background.paper},ownerLink:{"& span":{"&:hover":{textDecoration:"underline"}}}})),jt=e=>{var a;let n=0;return e==null||e.edges.forEach(({node:r})=>{n+=r.snapshotPassRate}),Math.round(n/((a=e==null?void 0:e.edges.length)!=null?a:1))},Vt=e=>e==null?void 0:e.edges.filter(({node:a})=>a.snapshotPassRate===100).length,Ut=e=>{if(e!=null&&e.edges.length){const a=Vt(e);return t.createElement(g,{variant:"body2"},a,"/",e.edges.length)}return t.createElement(g,{variant:"body2"},"No progress found.")},_t=({campaign:e})=>{var a;const n=Ht(),r=D(pt),l=D(mt),s=ct(),[i,c]=$(null),o=150,d=e.track.levels.flatMap(({checks:_})=>_.map(({id:Ue})=>Ue)),{data:m,isLoading:f,isError:p}=he({filter:{tracks:[{trackId:e.track.id}],checkIds:{included:d}}}),v=(a=m==null?void 0:m.individualEntityPassRates)!=null?a:{totalCount:0,edges:[],pageInfo:{hasNextPage:!1,hasPreviousPage:!1}},u=_=>{c(_.currentTarget)},h=()=>{c(null)},y=()=>{s(l({campaignId:e.id}))},C=()=>{s(r({campaignId:e.id}))};if(f)return t.createElement("div",{"data-testid":"loading-indicator"},t.createElement(be,null));if(p)return t.createElement(g,{color:"error"},"Failed to load campaigns progress.");const R=v.edges.length?jt(v):0,k=Ut(v),{name:b,description:w,ownerEntityRef:z,targetCompletionDate:B,startDate:Ve,supportChannel:ee}=e;return t.createElement("div",{className:n.campaignCards},t.createElement("div",{className:n.campaignCard},t.createElement("div",{className:n.flexRow,style:{justifyContent:"space-between"}},t.createElement("div",{className:n.flexColumn},t.createElement(g,{variant:"h5"},b),t.createElement(g,{variant:"body1",className:n.description},w.length>o?`${w.substring(0,o)}...`:w)),t.createElement("div",null,t.createElement(Ze,{variant:"text","aria-controls":"menu","aria-haspopup":"true",onClick:u},t.createElement("div",{className:n.actions},t.createElement("div",{className:n.actionsText},"Actions"),t.createElement("div",{className:n.flexRow},i?t.createElement(wt,{fontSize:"small"}):t.createElement(bt,{fontSize:"small"})))),t.createElement(et,{id:"campaign-menu",anchorEl:i,keepMounted:!0,open:!!i,onClose:h,classes:{list:n.menuList}},t.createElement(oe,{onClick:C},"View"),t.createElement(oe,{onClick:y},"Edit")))),t.createElement("div",{className:n.detailSection},t.createElement("div",{className:n.flexColumn},t.createElement("div",{className:n.flexRow},t.createElement(g,{variant:"subtitle1",className:n.label},"Owner:"),t.createElement(g,{variant:"body1",display:"inline",className:n.value},t.createElement(ae,{className:n.ownerLink,entityRef:z}))),ee&&t.createElement("div",{className:n.flexRow},t.createElement(g,{variant:"subtitle1",className:n.label},"Support Channel:"),t.createElement(g,{variant:"body1",display:"inline",className:n.value},ee))),t.createElement("div",{className:n.flexColumn},t.createElement("div",{className:n.flexRow},t.createElement(g,{variant:"subtitle1",className:n.label},"Start Date:"),t.createElement(g,{variant:"body1",display:"inline",className:n.value},V(Ve))),t.createElement("div",{className:n.flexRow},t.createElement(g,{variant:"subtitle1",className:n.label},"Target Completion Date:"),t.createElement(g,{variant:"body1",display:"inline",className:n.value},V(B)))),t.createElement("div",{className:n.flexRow,style:{minWidth:"300px"}},t.createElement("div",{className:n.flexColumn},t.createElement(g,{variant:"subtitle1",className:n.label},"Checks Passing"),t.createElement(g,{variant:"body2"},R,"%")),t.createElement("div",{className:n.flexColumn},t.createElement(g,{variant:"subtitle1",className:n.label},"Entities Complete"),k)))))},Kt=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)}})),Qt=({unfilteredFacets:e,onChange:a,kind:n,type:r})=>{var l,s,i;const c=Kt(),o={types:(l=e==null?void 0:e.types.filter(({count:p})=>p>0))!=null?l:[]},d=S((p,v)=>{var u;a((u=o==null?void 0:o.types[v].kind)!=null?u:"",o==null?void 0:o.types[v].type)},[o==null?void 0:o.types,a]);T(()=>{var p,v,u;const h=(o==null?void 0:o.types)&&o.types.length>=0,y=!n&&h,C=n&&h&&!(o!=null&&o.types.find(({kind:R,type:k})=>n===R&&(!r&&!k||r===k)));(y||C)&&a((v=(p=o==null?void 0:o.types[0])==null?void 0:p.kind)!=null?v:"",(u=o==null?void 0:o.types[0])==null?void 0:u.type,!0)},[n,r,o==null?void 0:o.types,a]);const m=(s=o==null?void 0:o.types.map(({kind:p,type:v,count:u})=>{const h=`${p}|${v!=null?v:""}`;return{key:h,label:`${v!=null?v:p} (${u>50?"50+":u})`,id:h,className:c.tab}}))!=null?s:[];if(!m.length)return null;const f=(i=o==null?void 0:o.types.findIndex(p=>p.kind===n&&(!p.type&&!r||p.type===r)))!=null?i:-1;return t.createElement(t.Fragment,null,t.createElement(Nt,null),t.createElement(tt,{onChange:d,indicatorColor:"primary",variant:"scrollable",value:f>-1?f:void 0},m.map(p=>t.createElement(at,{...p}))))},Jt=e=>({key:`skeleton${e}`,label:"",id:`skeleton${e}`}),qt=()=>{const e=Array.from({length:4},(a,n)=>Jt(n));return t.createElement(Et,{tabs:e})};var we=(e=>(e.Alpha="default",e.Owner="all",e.Status="all",e))(we||{});const U=12,Xt=E(e=>({pagination:{width:"-webkit-fill-available",display:"flex",justifyContent:"center",position:"fixed",bottom:"0",backgroundColor:e.palette.background.paper,borderTop:`1px solid ${e.palette.divider}`,marginRight:"40px"}})),Yt=({response:e,listingsPerPage:a,cursor:n,setCursor:r,prevCursors:l,setPrevCursors:s,labelPerPageDropdown:i,urlRoute:c})=>{var o;const d=Xt(),m=e!=null&&e.edges?e==null?void 0:e.edges[(e==null?void 0:e.edges.length)-1]:{cursor:""},[f,p]=$(0),v=()=>{s(C=>[...C,n]),r(m==null?void 0:m.cursor)},u=()=>{r(l[l.length-1]),s(C=>C.slice(0,-1))},h=(C,R)=>{p(k=>(R>k?v():u(),R))},y=C=>{window.open(`/soundcheck/${c!=null?c:"tracks?tracksPerPage="}${C.target.value}`,"_self")};return t.createElement(ie,{className:d.pagination,component:"div",count:(o=e==null?void 0:e.totalCount)!=null?o:-1,rowsPerPage:a!=null?a:10,onPageChange:h,page:f,onRowsPerPageChange:y,labelRowsPerPage:i!=null?i:"Listings per page:",rowsPerPageOptions:[U,U*2,U*4]})},Zt=E(e=>({pagination:{width:"-webkit-fill-available",display:"flex",justifyContent:"center",position:"fixed",bottom:"0",left:"0",backgroundColor:e.palette.background.paper,borderTop:`1px solid ${e.palette.divider}`,zIndex:1e3}})),Ne=({defaultPageSize:e,label:a})=>{const[n,r]=$(),[l,s]=J(),i=l.get(a),c=i?parseInt(i,10):e,[o,d]=$(0),m=S(f=>{var p;l.set("entitiesPerPage",(p=f.target.value)!=null?p:e),s(l,{replace:!0}),d(0),r(void 0)},[e,l,s]);return{cursor:n,setCursor:r,pageSize:c,currentPage:o,setCurrentPage:d,onRowsPerPageChange:m}},xe=({totalCount:e,setCursor:a,endCursor:n,prevCursor:r,defaultPageSize:l,currentPage:s,setCurrentPage:i,onRowsPerPageChange:c,pageSize:o,labelRowsPerPage:d,rowsPerPageOptions:m})=>{const f=Zt(),p=S(()=>{n&&a(n)},[n,a]),v=S(()=>{r&&a(r)},[r,a]),u=(h,y)=>{i(C=>(y>C?p():y<C&&v(),y))};return t.createElement(ie,{className:f.pagination,component:"div",count:e,page:s,onPageChange:u,rowsPerPage:o!=null?o:l,onRowsPerPageChange:c,labelRowsPerPage:d,rowsPerPageOptions:m!=null?m:[l,l*2,l*4]})},ea=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]}})),Re=({entityCount:e=25,levelCount:a=3,checkCount:n=5})=>{const r=ea(),l=new Array(e).fill(void 0),s=new Array(n).fill(void 0),i=new Array(a).fill(void 0);return t.createElement("table",{className:r.table},t.createElement("tbody",null,t.createElement("tr",null,t.createElement("td",{className:r.programTitle},t.createElement(j,{width:180,height:40})),l.map((c,o)=>t.createElement("td",{key:o}))),i.map((c,o)=>t.createElement(t.Fragment,{key:o},t.createElement("tr",{className:r.header},t.createElement("td",{className:r.title},t.createElement(j,{width:180})),l.map((d,m)=>t.createElement("td",{key:m}))),s.map((d,m)=>t.createElement("tr",{key:m},t.createElement("td",{className:r.title},t.createElement(j,{width:240})),l.map((f,p)=>t.createElement("td",{key:p,className:r.checkResult},t.createElement(j,{width:18,height:18,variant:"rect"})))))))))},Pe=nt(e=>{const a=e.palette.type==="dark"?e.palette.common.black:e.palette.grey[300];return{tooltip:{backgroundColor:a,color:e.palette.text.primary,maxWidth:"400px"},arrow:{color:a}}})(se),ta=E(e=>({headerWrapper:{marginTop:e.spacing(.5)},entityRefName:{fontWeight:"bold"},iconWrapper:{padding:e.spacing(1.5,.5),display:"flex",alignItems:"center",justifyContent:"center"}})),aa=({check:{name:e,description:a},icon:n,entityRef:r})=>{const l=ta(),s=G(r);return t.createElement(N,{spacing:1},t.createElement(N,{container:!0,direction:"row",spacing:1,wrap:"nowrap"},t.createElement("div",{className:l.iconWrapper},n),t.createElement(g,{variant:"h6",className:l.headerWrapper,noWrap:!0},e)),t.createElement(N,{item:!0,wrap:"nowrap"},t.createElement(g,{variant:"subtitle2",className:l.entityRefName},Q(s,{defaultKind:s.kind}))),t.createElement(Ct,{content:a}))},na=({children:e,check:a,icon:n,entityRef:r})=>t.createElement(Pe,{arrow:!0,title:t.createElement(aa,{check:a,icon:n,entityRef:r}),enterDelay:150,placement:"top"},e),ra=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.action.hover}},icon:{width:"17px",height:"17px"},virtualized:{borderBottom:`1px solid ${e.palette.divider}`,borderRight:`1px solid ${e.palette.divider}`}})),$e=A(({programId:e,check:a,entityRef:n,result:r,entityRoute:l,isVirtualized:s})=>{const i=ra();if(typeof n!="string"){const m=t.createElement("div",{className:i.iconWrapper},t.createElement("div",{className:i.icon}));return s?t.createElement("div",{className:`${i.root} ${i.virtualized}`,"aria-hidden":!0},m):t.createElement("td",{className:i.root,"aria-hidden":!0},m)}const c=t.createElement(ft,{className:i.icon,result:r!=null?r:L.NotReported}),o=t.createElement("div",{className:i.iconWrapper},c),d=r&&r===L.NotApplicable?o:t.createElement(X,{className:i.link,to:`${l(G(n))}/soundcheck/tracks/${e}/checks/${a.id}`},o);return s?t.createElement("div",{className:`${i.root} ${i.virtualized}`},t.createElement(na,{check:a,icon:c,entityRef:n},d)):t.createElement("td",{className:`${i.root}`},d)}),Te=8,la=16,P={programTitle:70,levelTitle:30,check:42,entityRefFooter:100,paginationControl:50},W={programTitle:350+la*2,checkResult:42},Se=e=>e.reduce((a,n)=>a+n.height,0),oa=e=>e*W.checkResult+W.programTitle,Ie=e=>e.filter(a=>a!==void 0).map(a=>{const n=G(a);return Q(n,{defaultKind:n.kind})}).reduce((a,n)=>a.length>n.length?a:n,""),Le=e=>Te*e+Te,Oe="NoLevel",ia=e=>({name:Oe,badge:{options:{level:0,color:""},variant:ut.Medal},entityRef:e,ordinal:0}),sa=E(e=>({virtualized:{borderRight:`1px solid ${e.palette.divider}`,height:`${P.programTitle}px`,display:"flex",justifyContent:"center",alignItems:"center"}})),ca=A(({entityRef:e,highestLevels:a,trackType:n})=>{const r=a.find(s=>s.entityRef===e);let l=r!=null&&r.badge?t.createElement(ce,{badge:r.badge}):t.createElement(de,null);return n==="campaign"&&(l=t.createElement(pe,null)),l}),da=({highestLevel:e,trackType:a})=>{const n=sa();if(!(e!=null&&e.badge))return t.createElement("div",{className:n.virtualized},"\xA0");let r=e.name!==Oe?t.createElement(ce,{badge:e.badge}):t.createElement(de,null);return a==="campaign"&&(r=t.createElement(pe,null)),t.createElement("div",{className:n.virtualized},r)},pa=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"}})),Fe=e=>{var a,n;const r=pa(e),l=F(()=>Object.entries(e.progress).reduce((i,[,c])=>i+c,0),[e.progress]);if(l===0)return null;const s=(a=e.progress[L.Passed])!=null?a:0;return t.createElement(se,{arrow:!0,title:`Check passing for ${s} of ${l} ${l===1?"entity":"entities"}`,enterDelay:0,placement:"top"},t.createElement(rt,{variant:"determinate",value:((n=e.progress[L.Passed])!=null?n:0)/l*100,classes:{root:r.root,bar:r.bar}}))},Ae=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:`${P.check}px`,lineHeight:`${P.check}px`,borderBottom:`1px solid ${e.palette.divider}`,borderRight:`1px solid ${e.palette.divider}`}}));A(({programId:e,programName:a,check:n,entityRefs:r,results:l,entityRoute:s})=>{const i=Ae(),c=F(()=>ge(l.filter(({result:d})=>d!==L.NotApplicable),"result"),[l]),o=new Map(l.map(d=>[d.entityRef,d.result]));return t.createElement("tr",{"data-testid":"track-check-row"},t.createElement("th",{scope:"row",className:i.checkNameCell,"aria-label":`${n.name} check for ${a} track`},t.createElement("div",{className:i.checkNameContent},t.createElement(g,{className:i.checkNameTypography,variant:"subtitle2",component:"p"},n.name),t.createElement(Fe,{className:i.checkIndicator,progress:c}))),r.map((d,m)=>t.createElement($e,{key:m,programId:e,check:n,entityRef:d,result:typeof d=="string"?o.get(d):void 0,entityRoute:s})))});const ma=({name:e,progress:a})=>{const n=Ae();return t.createElement("div",{className:n.checkNameCell,"aria-label":`${e} check`},t.createElement("div",{className:`${n.checkNameContent} ${n.checkNameCellVirtualized}`},t.createElement(g,{variant:"subtitle2",component:"p",className:n.checkNameTypography},e),t.createElement(Fe,{className:n.checkIndicator,progress:a})))},Y=E(e=>{const a=e.palette.type==="dark"?e.palette.grey[700]:e.palette.grey[100];return{root:{color:re(e.palette.getContrastText(a),.8),backgroundColor:a},levelContent:{padding:`${e.spacing(.5)}px ${e.spacing(2)}px`,backgroundColor:a},levelTypography:{overflow:"hidden",textOverflow:"ellipsis"},levelHeaderCell:{padding:`${e.spacing(.5)}px ${e.spacing(2)}px`,borderRight:`1px solid ${e.palette.divider}`,height:`${P.levelTitle}px`}}});A(({level:e,entityRefs:a,programName:n})=>{const r=Y();return t.createElement("tr",{className:r.root,"data-testid":"track-level-row"},t.createElement("th",{scope:"row",className:r.root},t.createElement("div",{className:r.levelContent},t.createElement(g,{className:r.levelTypography,variant:"subtitle2",component:"p","aria-label":`${e.name} for ${n} track`},e.name))),a.map((l,s)=>t.createElement("td",{key:s,className:r.root,"aria-hidden":!0})))});const ua=({name:e})=>{const a=Y();return t.createElement("div",{className:`${a.levelHeaderCell} ${a.root}`,"aria-label":`${e}`},t.createElement(g,{variant:"subtitle2",component:"p",className:a.levelTypography},e))},ga=()=>{const e=Y();return t.createElement("div",{className:`${e.levelHeaderCell} ${e.root}`},"\xA0")},ze=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}`}}));A(({program:e,entityRefs:a,highestLevels:n})=>{const r=ze();return t.createElement("tr",{"data-testid":"track-title-row"},t.createElement("th",{scope:"row",className:r.programNameCell},t.createElement("div",{className:r.programNameContent},t.createElement(g,{className:r.programNameTypography,variant:"h5",component:"p"},e.name))),a.map((l,s)=>{var i;return typeof l!="string"?t.createElement("td",{key:s,"aria-hidden":!0}):t.createElement("td",{key:s,"data-testid":"track-certification-cell"},t.createElement("div",{className:r.badgeCellContent},t.createElement(ca,{entityRef:l,highestLevels:n,trackType:(i=e.type)!=null?i:void 0})))}))});const fa=A(({name:e})=>{const a=ze();return t.createElement("div",{className:`${a.programNameCell} ${a.programNameCellVirtualized}`},t.createElement("div",{className:a.programNameContent},t.createElement(g,{className:a.programNameTypography,variant:"h5",component:"p"},e)))}),Be=e=>{const a=x(M);return I([q.EntityByRef,e],async()=>a.getEntityByRef(e),{onError:()=>{},enabled:!!e})},va=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)"}})),ha=({entityRef:e})=>{const{data:a}=Be(e),n=D(ne),r=va(),l=e?G(e):void 0,s=l?t.createElement(X,{to:n(l)},a!=null&&a.metadata.title?a.metadata.title:Q(l,{defaultKind:l.kind})):t.createElement(t.Fragment,null);return t.createElement("div",{className:r.cell},t.createElement("div",{className:r.cellInner},s))},ya=e=>t.createElement(fa,{name:e}),Ea=e=>({type:"ProgramHeader",render:()=>ya(e)}),Ca=e=>e?t.createElement(ua,{name:e}):t.createElement(ga,null),De=e=>({type:"LevelHeader",render:()=>Ca(e)}),ka=(e,a)=>t.createElement(ma,{name:e,progress:a}),We=(e,a)=>({type:"CheckTitle",render:()=>ka(e,a)}),ba=(e,a,n,r,l)=>t.createElement($e,{check:a,entityRef:n,entityRoute:l,programId:e,result:r,isVirtualized:!0}),Ge=(e,a,n,r,l)=>({type:"CheckResult",render:()=>ba(e,a,n,r,l)}),wa=e=>t.createElement(ha,{entityRef:e}),Z=e=>({type:"EntityHeader",render:()=>wa(e)}),Na=(e,a)=>t.createElement(da,{highestLevel:e,trackType:a}),xa=(e,a)=>({type:"LevelBadge",render:()=>Na(e,a)}),Me=e=>a=>{const n=e[a.rowIndex].cells[a.columnIndex];return n?t.createElement("div",{style:a.style},n.render()):t.createElement("div",{style:a.style})},Ra=(e,a,n)=>{var r;const l=[];for(const{program:i,levels:c,highestLevels:o}of e){l.push({height:P.programTitle,cells:[Ea(i.name),...a.map(d=>{var m;const f=d?o.find(p=>p.entityRef===d)||ia(d):void 0;return xa(f,(m=i.type)!=null?m:void 0)})]});for(const d of c){l.push({height:P.levelTitle,cells:[De(d.name),...a.map(m=>De(""))]});for(const{check:m,results:f}of d.checks)l.push({height:P.check,cells:[We(m.name,ge(f.filter(({result:p})=>p!==L.NotApplicable),"result")),...a.map(p=>{var v,u;return Ge(i.id,m,p,(u=(v=f.find(h=>h.entityRef===p))==null?void 0:v.result)!=null?u:L.NotApplicable,n)})]})}}const s=Ie(a!=null?a:[]);return l.push({height:Le((r=s.length)!=null?r:1),cells:[Z(""),...a.map(i=>Z(i||""))]}),l},He=25,Pa=E(e=>({table:{backgroundColor:e.palette.background.paper,borderCollapse:"collapse",whiteSpace:"nowrap",textAlign:"left",overflow:"auto"}})),$a=({setError:e,kind:a,type:n,ownerEntityRef:r})=>{const{cursor:l,pageSize:s,...i}=Ne({defaultPageSize:He,label:"entitiesPerPage"}),{data:c,isLoading:o,isError:d}=Rt(r,{kind:a,type:n},s,l),m=Pa(),f=D(ne);T(()=>{e==null||e(d?new Error("Error loading program overview"):void 0)},[d,e]);const[p,v]=$(0),u=Je(null);if(qe(()=>{c&&r&&u!=null&&u.current&&v(u.current.clientWidth)},[u,c,r]),o)return t.createElement(Re,null);if(!c||!r)return null;const{programs:h,entityRefs:y,totalCount:C,endCursor:R,prevCursor:k}=c,b=y.length>=25?y:[...y,...Array.from({length:25-y.length},()=>{})],w=Ra(h,b,f),z=Me(w);return t.createElement("div",{ref:u},t.createElement(N,{"aria-label":`Check results for ${n!=null?n:a}`,key:`${a}|${n!=null?n:""}`,item:!0,xs:12},p>0&&t.createElement(xt,{className:m.table,columnCount:b.length+1,columnWidth:B=>B===0?W.programTitle:W.checkResult,rowCount:w.length,rowHeight:B=>w[B].height,height:Se(w)+P.paginationControl,width:p},z)),t.createElement(xe,{...i,totalCount:C,defaultPageSize:He,endCursor:R,prevCursor:k,pageSize:s,labelRowsPerPage:"Entities per page:"}))},Ta=({facets:e,ownerEntityRef:a,kind:n,type:r,setError:l})=>{const s=F(()=>{const i=new Map;return e.types.forEach(({kind:c,type:o})=>{const d=`${c}|${o!=null?o:""}`;i.set(d,t.createElement($a,{key:d,ownerEntityRef:a,kind:c,type:o,setError:l}))}),i},[e,a,l]);return t.createElement("div",null,s.get(`${n}|${r!=null?r:""}`))},Sa=E(()=>({scrollContainer:{overflow:"auto"}})),Ia=({facets:e,ownerEntityRef:a,hasError:n,kind:r,type:l,setError:s,isFixedGroup:i})=>{var c,o,d;const m=Sa();if(n)return t.createElement(vt,{severity:"error",title:n.message});const f="Use the groups drop-down list at the top-right of the page to select another group.";return e&&((o=(c=e.types)==null?void 0:c.length)!=null?o:0)>0?(d=e.types)!=null&&d.find(p=>p.count>0)?t.createElement("div",{className:m.scrollContainer},t.createElement(Ta,{facets:e,kind:r,type:l,setError:s,ownerEntityRef:a,hasError:n})):t.createElement(ht,{ownerEntityRef:a,selectGroupHint:f}):t.createElement(yt,{ownerEntityRef:a,selectGroupHint:i?void 0:f})},La=E(e=>({tableContainer:{padding:0,backgroundColor:"transparent"},campaignsGrid:{margin:`0 0 ${e.spacing(3)}px`,border:`1px solid ${e.palette.divider}`},campaignsCard:{display:"flex",width:"100%",flexDirection:"column",padding:e.spacing(2),gap:e.spacing(2)},campaignsLink:{textAlign:"center",margin:`${e.spacing(1)}rem 0 ${e.spacing(1)}`},tableLoading:{backgroundColor:e.palette.background.paper,padding:e.spacing(6)},noPadding:{padding:0},accordion:{boxShadow:"none"}})),je=3,Oa=({groupSelectorError:e,isFixedGroup:a=!1})=>{const[n,r]=J(),{group:l,kind:s,type:i}=Object.fromEntries(n.entries()),c=D(gt),[o,d]=$(void 0),[m,f]=$(void 0);T(()=>{((o==null?void 0:o.kind)!==s||(o==null?void 0:o.type)!==i)&&d({kind:s,type:i})},[s,i,o]);const{data:p,isLoading:v}=$t(l),{data:u}=ve({orderAlphabetical:"default",searchByOwner:l,searchByStatus:"active"}),h=u==null?void 0:u.edges.map(b=>b.node),y=h==null?void 0:h.slice(0,je),C=m||e,R=S((b,w,z)=>{b&&(d({kind:b,type:w}),w?(n.set("kind",b),n.set("type",w)):(n.delete("type"),n.set("kind",b)),r(n,{replace:z}))},[n,r]),k=La();return t.createElement(N,{container:!0,spacing:0},h&&h.length>0&&t.createElement(N,{item:!0,xs:12,className:k.campaignsGrid},t.createElement(lt,{style:{boxShadow:"none"}},t.createElement(ot,{expandIcon:t.createElement(kt,null)},t.createElement(g,{variant:"h6"},"Campaigns")),t.createElement(it,null,t.createElement("div",{className:k.campaignsCard},y==null?void 0:y.map(b=>t.createElement("div",{key:b.id},t.createElement(_t,{campaign:b})))),h.length>je&&t.createElement(X,{to:c(),className:k.campaignsLink},"More Campaigns")))),t.createElement(N,{item:!0,xs:12,className:k.noPadding},v?t.createElement(qt,null):t.createElement(Qt,{unfilteredFacets:p,kind:o==null?void 0:o.kind,type:o==null?void 0:o.type,onChange:R})),t.createElement(N,{item:!0,xs:12,className:k.tableContainer},v?t.createElement("div",{className:k.tableLoading},t.createElement(ke,{size:80})):t.createElement(Ia,{facets:p,kind:o==null?void 0:o.kind,type:o==null?void 0:o.type,setError:f,hasError:C,ownerEntityRef:l,isFixedGroup:a})))};export{O as C,we as F,Lt as G,ke as L,Oa as O,Yt as P,U as R,Pe as S,St as U,Tt as a,Ce as b,W as c,Se as d,oa as e,P as f,We as g,Ge as h,Ie as i,Le as j,Z as k,Me as l,Ne as m,Re as n,xe as o,be as p,zt as q,fe as r,Be as s,he as t,ve as u};
|
|
2
|
+
//# sourceMappingURL=OverviewPageContent-DW92KphH.esm.js.map
|
package/dist/esm/{RefetchingIndicator-b4961e02.esm.js → RefetchingIndicator-CdGa4YBG.esm.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{makeStyles as m,LinearProgress as a}from"@material-ui/core";import e,{useState as s}from"react";import p from"react-use/lib/useDebounce";import c from"react-use/lib/useUnmount";import"@backstage/catalog-model";import"@backstage/core-plugin-api";import{useIsFetching as d}from"@tanstack/react-query";import"./routes-
|
|
2
|
-
//# sourceMappingURL=RefetchingIndicator-
|
|
1
|
+
import{makeStyles as m,LinearProgress as a}from"@material-ui/core";import e,{useState as s}from"react";import p from"react-use/lib/useDebounce";import c from"react-use/lib/useUnmount";import"@backstage/catalog-model";import"@backstage/core-plugin-api";import{useIsFetching as d}from"@tanstack/react-query";import"./routes-DcGwdXHX.esm.js";import{F as l}from"./EmptyState-CFyDYjmm.esm.js";import"@backstage/plugin-catalog-react";import"react-router-dom";const f=m(t=>({indicator:{position:"absolute",width:"100%",zIndex:t.zIndex.speedDial}})),u=()=>{const t=d(),r=f(),[i,o]=s(!!t),[I,n]=p(()=>{o(!!t)},250,[t]);return c(n),i?e.createElement(l,null,e.createElement("div",{className:r.indicator},e.createElement(a,{variant:"indeterminate","data-testid":"refetching-indicator"}))):null};export{u as R};
|
|
2
|
+
//# sourceMappingURL=RefetchingIndicator-CdGa4YBG.esm.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const o=["#0D72EA","#A833FF","#BC5900","#088569","#F036A4"],n=["#82A1C0","#8E65A9","#D0913F","#5EAC96","#EF77A1"];var a=(e=>(e.RED="red",e.GREEN="green",e))(a||{});const s={red:"#E91429",green:"#13873C"},C={red:"#D33F4E",green:"#5CCE77"},E=e=>e?e.palette.type:"",t=e=>E(e).toLowerCase()==="dark",g=e=>t(e)?e.palette.grey[200]:e.palette.grey[800],d=e=>t(e)?n:o;function F(e,r){return(r?e.minus({days:r}):e).toFormat("MMM dd")}const l=(e,r)=>t(e)?C[r]:s[r];export{a as T,d as a,l as b,F as f,g,t as i};
|
|
2
|
+
//# sourceMappingURL=chartUtils-CDPSRCm-.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import t from"react";import{S as o}from"./EmptyState-
|
|
2
|
-
//# sourceMappingURL=index-
|
|
1
|
+
import t from"react";import{S as o}from"./EmptyState-CFyDYjmm.esm.js";import{C as i}from"./Card-Dj5kNp2Q.esm.js";import"@backstage/core-plugin-api";import"@tanstack/react-query";import"lodash";import"@material-ui/core";import"@material-ui/lab";import"@material-ui/icons/Check";import"@material-ui/icons/Close";import"@material-ui/icons/HelpOutline";import"@material-ui/icons/RemoveCircleOutline";import"@material-ui/icons/ReportProblemOutlined";import"./routes-DcGwdXHX.esm.js";import"graphql-request";import"graphql-tag";import"@backstage/core-compat-api";import"classnames";import"@backstage/catalog-model";import"@backstage/plugin-catalog-react";import"../images/empty-state.svg";import"@backstage/core-components";import"@material-ui/core/styles/makeStyles";import"@spotify/backstage-plugin-core";import"./CertificationSidebar-CVyVchB8.esm.js";import"react-router-dom";import"@material-ui/icons/Schedule";import"luxon";import"./license-CQErZDIh.esm.js";const m=({title:r})=>t.createElement(o,null,t.createElement(i,{title:r}));export{m as EntitySoundcheckCard};
|
|
2
|
+
//# sourceMappingURL=index-ChMeGQBh.esm.js.map
|