@spotify/backstage-plugin-soundcheck 0.19.4 → 0.19.5
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 +7 -0
- package/dist/alpha/integrations.esm.js +1 -1
- package/dist/api.esm.js +1 -1
- package/dist/blueprints/IntegrationPageBlueprint.esm.js +1 -1
- package/dist/components/CampaignCreatePage/CampaignCreatePage.esm.js +1 -1
- package/dist/components/CampaignPage/CampaignPageBUI.esm.js +1 -1
- package/dist/components/CampaignPage/CampaignPageDeprecated.esm.js +1 -1
- package/dist/components/CampaignPage/CampaignTechInsightsExplorerPage.esm.js +1 -1
- package/dist/components/CampaignsPage/CampaignListPageBUI.esm.js +1 -1
- package/dist/components/CampaignsPage/EditCampaignView.esm.js +1 -1
- package/dist/components/CheckCreatePage/CheckCreatePage.esm.js +1 -1
- package/dist/components/CheckPage/CheckEditPage.esm.js +1 -1
- package/dist/components/CheckPage/CheckEntitiesTable/CheckEntitiesTableBUI.esm.js +1 -1
- package/dist/components/CheckPage/CheckPageBUI.esm.js +1 -1
- package/dist/components/CheckTemplatesPage/CheckTemplatesPageBUI.esm.js +1 -1
- package/dist/components/CheckTemplatesPage/CheckTemplatesPageDeprecated.esm.js +1 -1
- package/dist/components/ChecksPage/CheckListPage/CheckListPageDeprecated.esm.js +1 -1
- package/dist/components/ChecksPage/ChecksListPageBUI.esm.js +1 -1
- package/dist/components/ChecksTable/ChecksTable.esm.js +1 -1
- package/dist/components/CollectorPage/CollectorDetailsPageBUI.esm.js +1 -1
- package/dist/components/CollectorPage/CollectorDetailsPageDeprecated.esm.js +1 -1
- package/dist/components/CollectorPage/CollectorPage.esm.js +1 -1
- package/dist/components/CollectorsPage/IntegrationsListPageBUI.esm.js +1 -1
- package/dist/components/DescriptionCell/DescriptionCell.esm.js +1 -1
- package/dist/components/HierarchicalTechInsightsPage/visualizations/hierarchyToNivo.esm.js +1 -1
- package/dist/components/Menus/SimpleMenu.esm.js +1 -1
- package/dist/components/Menus/useCampaignActions.esm.js +1 -1
- package/dist/components/OverviewPage/OverviewPageContent.esm.js +1 -1
- package/dist/components/PageCustomActions/PageCustomActions.esm.js +1 -1
- package/dist/components/RoutingPage/RoutingPageBUI.esm.js +1 -1
- package/dist/components/SendCampaignNotificationDialog/SendCampaignNotificationDialogBUI.esm.js +2 -0
- package/dist/components/SoundcheckHeader/SoundcheckHeaderBUI.esm.js +1 -1
- package/dist/components/TableRowWithOwner/TableRowWithOwner.esm.js +1 -1
- package/dist/components/TechInsights/SummaryTilesBUI.esm.js +1 -1
- package/dist/components/TechInsights/TechInsightsPageBUI.esm.js +1 -1
- package/dist/components/TechInsights/TechInsightsPageDeprecated.esm.js +1 -1
- package/dist/components/TechInsights/TechInsightsTableBUI.esm.js +1 -1
- package/dist/components/TechInsights/TechInsightsTableView.esm.js +1 -1
- package/dist/components/TopAndBottomPerformingTeams/TopAndBottomPerformingTeams.esm.js +1 -1
- package/dist/components/TopFailingChecksTable/TopFailingChecksTableBUI.esm.js +1 -1
- package/dist/components/TrackCreatePage/TrackCreatePage.esm.js +1 -1
- package/dist/components/TrackEditPage/TrackEditPage.esm.js +1 -1
- package/dist/components/TrackPage/TrackEntitiesTable/TrackEntitiesTableBUI.esm.js +1 -1
- package/dist/components/TrackPage/TrackPageBUI.esm.js +1 -1
- package/dist/components/TrackPage/TrackTechInsightsExplorerPage.esm.js +1 -1
- package/dist/components/TracksPage/TrackListPage/TrackListPageDeprecated.esm.js +1 -1
- package/dist/components/TracksPage/TracksListPageBUI.esm.js +1 -1
- package/dist/hooks/filters/useFilters.esm.js +1 -1
- package/dist/routes.esm.js +1 -1
- package/dist/utils/tracks.esm.js +2 -0
- package/package.json +1 -1
- package/dist/components/RoutingPage/RoutingMainMenu.esm.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as r,jsxs as
|
|
1
|
+
import{jsx as r,jsxs as u,Fragment as A}from"react/jsx-runtime";import{useApi as $}from"@backstage/core-plugin-api";import{entityPresentationApiRef as j}from"@backstage/plugin-catalog-react";import{Table as F,TableHeader as H,Column as g,TableBody as U,Row as q,Cell as P,Flex as D,Box as v,Text as G,CellProfile as O}from"@backstage/ui";import{makeStyles as Y}from"@material-ui/core";import{uniq as Z,isEmpty as N,isNumber as x}from"lodash";import{useMemo as m}from"react";import{useProfileImages as _}from"../../hooks/catalog/useProfileImages.esm.js";import{getPercentage as y}from"../../utils/formatters.esm.js";import{getTrackStatusTotal as z}from"../../utils/tracks.esm.js";import{CustomCell as J}from"../CustomCell/CustomCell.esm.js";import"../EmptyState/EmptyState.esm.js";import{EmptyStateBUI as K}from"../EmptyState/EmptyStateBUI.esm.js";import{EmptyStateNoTracks as B}from"../EmptyState/EmptyStateNoTracks.esm.js";import"@backstage/plugin-permission-react";import"@remixicon/react";import"@spotify/backstage-plugin-soundcheck-common";import"react-router-dom";import"../../routes.esm.js";import{LoadingTableSkeleton as L}from"../LoadingTableSkeleton/LoadingTableSkeleton.esm.js";import{StatusBar as Q}from"../StatusBar/StatusBar.esm.js";const V=Y(()=>({statusPercent:{width:"var(--bui-space-12)"},statusBar:{width:"100%"}})),W=({track:s,trackStatus:e,entitiesCount:h,handleTrackClick:b,profileImageMap:f})=>{const l=V(),c=$(j).forEntity(s.ownerEntityRef),k=m(()=>s.levels.reduce((t,o)=>t+o.checks.length,0),[s.levels]),a=m(()=>(e?.passed??0)+(e?.failed??0)+(e?.warning??0)+(e?.error??0)+(e?.notReported??0)+(e?.exempt??0),[e]),w=m(()=>{let t;return e?.allPassPercentage!==null&&e?.allPassPercentage!==void 0?t=e.allPassPercentage:e&&(t=y(e.passed+e.exempt,a)),t},[e,a]),S=m(()=>y(e?.failed,a),[e,a]),C=m(()=>y(e?.warning,a),[e,a]),p=m(()=>y(e?.notReported,a),[e,a]),T=m(()=>y(e?.error,a),[e,a]),E=f[c.snapshot.entityRef];return u(q,{onAction:()=>{b(s.id)},children:[r(P,{title:s.name??s.id}),r(J,{children:u(D,{align:"center",gap:"2",children:[r(v,{className:l.statusPercent,children:u(G,{children:[w,"%"]})}),r(v,{className:l.statusBar,children:r(Q,{passedPercent:w,failedPercent:S,warningPercent:C,notReportedPercent:p,errorPercent:T})})]})}),r(P,{title:s.type==="campaign"?"Campaign":"Track"}),r(P,{title:x(k)?`${k} Check${k===1?"":"s"}`:"N/A"}),r(P,{title:x(h)?`${h} ${h===1?"Entity":"Entities"}`:"N/A"}),r(O,{name:c.snapshot.primaryTitle,src:E??c.snapshot.primaryTitle})]})},X=({order:s,sortColumn:e,handleSort:h,handleTrackClick:b,tracks:f,trackStatusMap:l,trackCountsMap:c,isSearch:k,isLoading:a,activeTrackCount:w,hasGroupSelected:S})=>{const C=m(()=>[...f].filter(t=>{const o=l.get(t.id)?.status;let d=0;return o&&(d=z(o)),!o||d>0}).sort((t,o)=>{const d=l.get(t.id),M=l.get(o.id);let i,n;switch(e){case"name":i=t.name?.toLowerCase()||"",n=o.name?.toLowerCase()||"";break;case"type":i=t.type||"",n=o.type||"";break;case"owner":i=t.ownerEntityRef?.toLowerCase()||"",n=o.ownerEntityRef?.toLowerCase()||"";break;case"compliance":i=d?.status?.allPassPercentage??null,n=M?.status?.allPassPercentage??null;break;case"checks":i=t.levels.reduce((R,I)=>R+I.checks.length,0),n=o.levels.reduce((R,I)=>R+I.checks.length,0);break;case"entities":i=c.get(t.id)??0,n=c.get(o.id)??0;break;default:return 0}return typeof i=="number"&&typeof n=="number"?s==="asc"?i-n:n-i:typeof i=="number"&&n===null?-1:i===null&&typeof n=="number"?1:typeof i=="string"&&typeof n=="string"?s==="asc"?i.localeCompare(n):n.localeCompare(i):0}),[f,l,e,c,s]),p=m(()=>C.map(t=>{const o=l.get(t.id)?.status,d=c.get(t.id)??0;return{track:t,trackStatus:o,entitiesCount:d}}),[C,c,l]),T=Z(p.map(t=>t.track.ownerEntityRef)),{profileImageMap:E}=_(T);return!a&&N(f)?S?k&&w>0?r(K,{title:"No tracks or campaigns found.",body:"Your current search term did not return any tracks or campaigns. Please try a different search term. "}):r(B,{title:w>0?"No applicable tracks found for the selected group":void 0}):r(B,{title:"Select a group or create a new track"}):u(A,{children:[u(F,{sortDescriptor:{column:e,direction:s==="asc"?"ascending":"descending"},onSortChange:t=>h(t.column),children:[u(H,{children:[r(g,{id:"name",allowsSorting:!0,isRowHeader:!0,style:{width:"43%"},children:"Name"}),r(g,{id:"compliance",allowsSorting:!0,style:{width:"12%"},children:"Compliance"}),r(g,{id:"type",allowsSorting:!0,style:{width:"10%"},children:"Type"}),r(g,{id:"checks",allowsSorting:!0,style:{width:"10%"},children:"Checks"}),r(g,{id:"entities",allowsSorting:!0,style:{width:"10%"},children:"Entities"}),r(g,{id:"owner",allowsSorting:!0,style:{width:"15%"},children:"Track Owner"})]}),r(U,{children:p.map(t=>r(W,{handleTrackClick:b,profileImageMap:E??{},...t},t.track.id))})]}),N(p)&&a&&r(L,{rowCount:10}),!N(p)&&a&&r(L,{rowCount:4})]})};export{X as TechInsightsTableBUI};
|
|
2
2
|
//# sourceMappingURL=TechInsightsTableBUI.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as e,Fragment as N,jsxs as
|
|
1
|
+
import{jsx as e,Fragment as N,jsxs as f}from"react/jsx-runtime";import{useApi as $}from"@backstage/core-plugin-api";import{entityPresentationApiRef as E}from"@backstage/plugin-catalog-react";import{TableContainer as H,Paper as L,Table as z,TableHead as A,TableRow as T,TableCell as c,TableSortLabel as y,TableBody as B,Typography as b,Box as w}from"@material-ui/core";import D from"@material-ui/icons/ArrowDownward";import F from"@material-ui/icons/ArrowUpward";import{useMemo as M}from"react";import{getColorInterpolator as j,getCheckStatusColor as x}from"../../utils/colors.esm.js";import{getTrackStatusTotal as V}from"../../utils/tracks.esm.js";import{CategoryBar as J}from"../CategoryBar/CategoryBar.esm.js";import{CheckStateColors as I}from"../CheckPage/utils.esm.js";import{ColorChip as O}from"../ColorChip/ColorChip.esm.js";const U=({tracks:v,trackStatusMap:m,trackCountsMap:u,orderBy:o,order:d,handleSort:h,handleTrackClick:P,theme:g,classes:n})=>{const S=$(E),R=M(()=>[...v].filter(l=>{const t=m.get(l.id)?.status;let s=0;return t&&(s=V(t)),!t||s>0}).sort((l,t)=>{const s=m.get(l.id),k=m.get(t.id);let a,r;switch(o){case"name":a=l.name?.toLowerCase()||"",r=t.name?.toLowerCase()||"";break;case"type":a=l.type||"",r=t.type||"";break;case"owner":a=l.ownerEntityRef?.toLowerCase()||"",r=t.ownerEntityRef?.toLowerCase()||"";break;case"compliance":a=s?.status?.allPassPercentage??null,r=k?.status?.allPassPercentage??null;break;case"checks":a=l.levels.reduce((i,C)=>i+C.checks.length,0),r=t.levels.reduce((i,C)=>i+C.checks.length,0);break;case"entities":a=u.get(l.id)??0,r=u.get(t.id)??0;break;default:return 0}return typeof a=="number"&&typeof r=="number"?d==="asc"?a-r:r-a:typeof a=="number"&&r===null?-1:a===null&&typeof r=="number"?1:typeof a=="string"&&typeof r=="string"?d==="asc"?a.localeCompare(r):r.localeCompare(a):0}),[d,o,m,u,v]),p=l=>l.direction==="asc"?e(F,{...l,fontSize:"small"}):e(D,{...l,fontSize:"small"});return e(N,{children:e(H,{component:L,children:f(z,{className:n.table,size:"small",children:[e(A,{children:f(T,{children:[e(c,{width:"30%",className:`${n.tableHeaderCell} ${n.headerCell}`,children:e(y,{active:o==="name",direction:o==="name"?d:"desc",onClick:()=>h("name"),IconComponent:p,children:e("div",{className:n.headerContent,children:"Name"})})}),e(c,{width:"10%",className:`${n.tableHeaderCell} ${n.headerCell}`,children:e(y,{active:o==="checks",direction:o==="checks"?d:"desc",onClick:()=>h("checks"),IconComponent:p,children:e("div",{className:n.headerContent,children:"Checks"})})}),e(c,{width:"10%",className:`${n.tableHeaderCell} ${n.headerCell}`,children:e(y,{active:o==="entities",direction:o==="entities"?d:"desc",onClick:()=>h("entities"),IconComponent:p,children:e("div",{className:n.headerContent,children:"Entities"})})}),e(c,{width:"30%",className:`${n.tableHeaderCell} ${n.headerCell}`,children:e(y,{active:o==="compliance",direction:o==="compliance"?d:"desc",onClick:()=>h("compliance"),IconComponent:p,children:e("div",{className:n.headerContent,children:"Compliance"})})}),e(c,{width:"20%",className:`${n.tableHeaderCell} ${n.headerCell}`,children:e(y,{active:o==="owner",direction:o==="owner"?d:"desc",onClick:()=>h("owner"),IconComponent:p,children:e("div",{className:n.headerContent,children:"Track Owner"})})})]})}),e(B,{children:R.map(l=>{const t=m.get(l.id)?.status;let s=0;if(t?.allPassPercentage!==null&&t?.allPassPercentage!==void 0)s=t.allPassPercentage;else if(t){const i=(t.passed??0)+(t.failed??0)+(t.warning??0)+(t.error??0)+(t.notReported??0)+(t.exempt??0);s=i>0?((t.passed??0)+(t.exempt??0))/i*100:0}const k=l.levels.reduce((i,C)=>i+C.checks.length,0),a=u.get(l.id)??0,r=Math.round(s);return f(T,{onClick:()=>P(l.id),className:n.tableRow,style:{cursor:"pointer"},children:[e(c,{className:n.tableCell,children:e(b,{variant:"body2",style:{fontWeight:500},children:l.name})}),e(c,{className:n.tableCell,children:e(b,{variant:"body2",children:k})}),e(c,{className:n.tableCell,children:e(b,{variant:"body2",children:new Intl.NumberFormat("en-US",{notation:"compact",maximumFractionDigits:1}).format(a)})}),e(c,{className:n.tableCell,children:f("div",{style:{display:"flex",alignItems:"center",gap:8},children:[t&&e(O,{value:`${r}%`,getColor:j(g,"default"),numericValue:s/100}),e(w,{flex:1}),e("div",{style:{width:"100%"},children:e(J,{data:{compliant:r,nonCompliant:100-r},categories:["compliant","nonCompliant"],categoryColors:{compliant:x(g,I.PASSED),nonCompliant:x(g,I.FAILED)},showTooltip:!1})})]})}),e(c,{className:n.tableCell,style:{verticalAlign:"middle"},children:l.ownerEntityRef&&e(w,{display:"flex",alignItems:"center",children:(()=>{const i=S.forEntity(l.ownerEntityRef);return f(N,{children:[i.snapshot.Icon&&e(w,{marginRight:1,display:"flex",alignItems:"center",height:"20px",children:e(i.snapshot.Icon,{fontSize:"small"})}),e(b,{variant:"body2",style:{lineHeight:"20px"},children:i.snapshot.primaryTitle||l.ownerEntityRef})]})})()})})]},l.id)})})]})})})};export{U as TechInsightsTableView};
|
|
2
2
|
//# sourceMappingURL=TechInsightsTableView.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as
|
|
1
|
+
import{jsxs as o,jsx as t}from"react/jsx-runtime";import{useMemo as g,useCallback as B,createElement as S}from"react";import{useRouteRef as $,useApi as G}from"@backstage/core-plugin-api";import{entityPresentationApiRef as W}from"@backstage/plugin-catalog-react";import{Flex as b,Card as k,Text as N,Box as v,Avatar as D}from"@backstage/ui";import{makeStyles as U}from"@material-ui/core";import{isEmpty as C}from"lodash";import{useNavigate as q,createSearchParams as J}from"react-router-dom";import{useProfileImages as K}from"../../hooks/catalog/useProfileImages.esm.js";import{trackOverviewRouteRef as Q,campaignOverviewRouteRef as V}from"../../routes.esm.js";import{getPercentage as T}from"../../utils/formatters.esm.js";import"../EmptyState/EmptyState.esm.js";import{EmptyStateBUI as A}from"../EmptyState/EmptyStateBUI.esm.js";import"@backstage/plugin-permission-react";import"@remixicon/react";import"@spotify/backstage-plugin-soundcheck-common";import{getLeafNodes as X}from"../HierarchicalTechInsightsPage/getLeafNodes.esm.js";import{LoadingTableSkeleton as E}from"../LoadingTableSkeleton/LoadingTableSkeleton.esm.js";import{StatusBar as Y}from"../StatusBar/StatusBar.esm.js";const M=U(()=>({topTeamCard:{padding:"var(--bui-space-3) var(--bui-space-5)",minWidth:400},topTeamCardRows:{minHeight:"calc(var(--bui-space-6) * 6.5)",cursor:"pointer"},topTeamCardRow:{display:"flex",flexDirection:"row",gridGap:1,alignItems:"center",width:"100%",padding:"var(--bui-space-2)",marginBottom:"var(--bui-space-2)",backgroundColor:"var(--bui-bg-surface-2)",border:"1px solid var(--bui-bg-surface-2)",borderRadius:"var(--bui-radius-2)"},infoButton:{"&:hover":{backgroundColor:"inherit !important"}},teamName:{width:"75%"},percentBar:{width:"25%"},statusPercent:{width:"var(--bui-space-12)"},statusBar:{width:"100%"}})),H=({groupRef:a,teamName:i,passPercentage:m,failPercentage:c,warningPercentage:u,notReportedPercentage:f,errorPercentage:P,profileImageMap:l,onClick:h})=>{const s=M();return t(k,{className:`${s.topTeamCardRow}`,onClick:h,children:o(b,{align:"center",gap:"1",style:{flex:1},children:[o(b,{align:"center",gap:"2",className:s.teamName,children:[t(D,{name:i,size:"small",src:l[a]?l[a]:i}),t(N,{children:i})]}),o(b,{align:"center",gap:"1",className:s.percentBar,children:[t(v,{className:s.statusPercent,children:o(N,{color:"secondary",children:[m,"%"]})}),t(v,{className:s.statusBar,children:t(Y,{passedPercent:m,failedPercent:c,warningPercent:u,notReportedPercent:f,errorPercent:P})})]})]})})},Z=({trackStatus:a,isLoading:i,campaignId:m})=>{const c=M(),u=$(Q),f=$(V),P=q(),l=80,h=50,s=G(W),y=g(()=>a?X(a):[],[a]),R=g(()=>y.filter(e=>{const{passed:r,failed:n,warning:O,error:j,notReported:z,exempt:F}=e.status;return r+n+O+j+z+F>0&&!e.children?.length}).sort((e,r)=>(e.status.allPassPercentage??0)-(r.status.allPassPercentage??0)),[y]),w=B(e=>{const r=s.forEntity(e.groupRef).snapshot,n=e.status.failed+e.status.passed+e.status.error+e.status.exempt+e.status.warning+e.status.notReported;return{groupRef:e.groupRef,teamName:r.primaryTitle,passPercentage:e.status.allPassPercentage??0,failPercentage:T(e.status.failed,n),warningPercentage:T(e.status.warning,n),notReportedPercentage:T(e.status.notReported,n),errorPercentage:T(e.status.warning,n),teamInfo:r.secondaryTitle}},[s]),p=g(()=>R.filter(e=>(e.status.allPassPercentage??0)<h).slice(0,3).map(w),[R,w]),d=g(()=>{const e=R.filter(r=>(r.status.allPassPercentage??0)>=l);return e.reverse(),e.slice(0,3).map(w)},[R,w]),L=g(()=>[...d.map(e=>e.groupRef),...p.map(e=>e.groupRef)],[p,d]),{profileImageMap:x}=K(L),I=B(e=>{let r;if(m?r=f({campaignId:m}):a?.trackId&&(r=u({trackId:a.trackId})),r){const n=`${r}?${J({owners:[e]})}`;P(n)}},[f,u,P,m,a?.trackId]);return o(b,{children:[o(k,{className:c.topTeamCard,children:[t(N,{variant:"title-x-small",weight:"bold",children:"Teams Needing Attention"}),i&&t(E,{rowCount:3,rowHeight:40}),!i&&o(v,{className:c.topTeamCardRows,children:[!C(p)&&p.map(e=>S(H,{profileImageMap:x??{},...e,key:e.groupRef,onClick:()=>I(e.groupRef)})),C(p)&&t(A,{title:"No teams eligible",body:`None of your teams are performing below ${h}% compliance.`})]})]}),o(k,{className:c.topTeamCard,children:[t(N,{variant:"title-x-small",weight:"bold",children:"Top Performing Teams"}),i&&t(E,{rowCount:3,rowHeight:40}),!i&&o(v,{className:c.topTeamCardRows,children:[!C(d)&&d.map(e=>S(H,{profileImageMap:x??{},...e,key:e.groupRef,onClick:()=>I(e.groupRef)})),C(d)&&t(A,{title:"No teams eligible",body:`None of your teams are performing above ${l}% compliance.`})]})]})]})};export{Z as TopAndBottomPerformingTeams};
|
|
2
2
|
//# sourceMappingURL=TopAndBottomPerformingTeams.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as t,jsxs as s,Fragment as B}from"react/jsx-runtime";import{useRouteRef as x}from"@backstage/core-plugin-api";import{Table as L,TableHeader as O,Column as u,TableBody as $,Row as j,Cell as f,TablePagination as A}from"@backstage/ui";import{makeStyles as D}from"@material-ui/core";import{sortBy as H}from"lodash";import{useState as h,useMemo as g}from"react";import{CircularProgressbar as M}from"react-circular-progressbar";import{useNavigate as U}from"react-router-dom";import{TrackEntityField as q}from"../../graphql/generated/index.esm.js";import"@backstage/catalog-model";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"@spotify/backstage-plugin-soundcheck-common";import"../../hooks/useSoundcheckAlert.esm.js";import"../../hooks/useConfirmationModal.esm.js";import{usePagination as z}from"../../hooks/usePagination.esm.js";import"react-use/lib/useLocalStorage";import{trackCheckDetailsRouteRef as V}from"../../routes.esm.js";import{getPercentage as b}from"../../utils/formatters.esm.js";import"../EmptyState/EmptyState.esm.js";import{EmptyStateBUI as W}from"../EmptyState/EmptyStateBUI.esm.js";import"@backstage/plugin-permission-react";import"@remixicon/react";import{LoadingTableSkeleton as G}from"../LoadingTableSkeleton/LoadingTableSkeleton.esm.js";const J=D(()=>({customCell:{padding:"0 var(--bui-space-3)"},circularProgressBg:{color:"var(--bui-fg-secondary)",opacity:.25},circularProgressOverlay:{position:"absolute",left:0,color:"var(--bui-fg-danger)"},circularProgressbar:{width:"var(--bui-space-7)"}})),k=10;q.Name;const K=({track:o,checkStatuses:a,certificationStatus:l,searchValue:m})=>{const v=J(),[d,C]=h("descending"),[n,y]=h("compliance"),w=x(V),P=U(),c=g(()=>!o.levels||!a?[]:o.levels.flatMap(r=>r.checks.map(e=>{const i=a.find(({id:N})=>N===e.id),E=i?i.numberOfEntities-i.notApplicable-i.exempt:0,F=i?.failed??0;return{check:e,failedCount:F,applicableCount:E}}).filter(({failedCount:e})=>e>0)),[o.levels,a]),p=g(()=>{if(!m?.length)return c;const r=m.toLowerCase();return c.filter(({check:e})=>e.name.toLowerCase().includes(r))},[c,m]),S=g(()=>{const r=H([...p],e=>n==="compliance"?b(e.failedCount,l?.numberOfEntities??0):n==="failures"?e.failedCount:e.check.name.toLowerCase());return d==="descending"&&r.reverse(),r},[p,d,n,l]),{paginatedItems:T,paginationProps:I}=z({pageParam:"perPage",defaultPageSize:k,items:S}),R=o.levels.length>k;return a===void 0||l===void 0?t(G,{}):!c.length||!p.length?t(W,{title:"No failing checks",body:"There are no failing checks found."}):s(B,{children:[s(L,{onSortChange:({direction:r,column:e})=>{y(String(e)),C(r)},sortDescriptor:{direction:d,column:n},children:[s(O,{children:[t(u,{id:"compliance",allowsSorting:!0,style:{width:"5%"},children:"Compliance"}),t(u,{id:"name",allowsSorting:!0,isRowHeader:!0,style:{width:"75%"},children:"Name"}),t(u,{id:"failures",allowsSorting:!0,style:{width:"20%"},children:"Failures"})]}),t($,{children:T.map(({check:r,failedCount:e})=>{const i=b(e,l.numberOfEntities);return s(j,{onAction:()=>P(w({trackId:o.id,checkId:r.id})),children:[t(f,{leadingIcon:t("div",{className:v.circularProgressbar,title:`${i}%`,children:t(M,{value:i,strokeWidth:12,styles:{path:{stroke:"var(--bui-fg-danger)"},trail:{stroke:'rgba(var("--bui-fg-secondary"), 0.25)'}}})}),title:`${i}%`}),t(f,{title:r.name}),t(f,{title:`${new Intl.NumberFormat().format(e??0)} failing`})]},r.id)})})]}),R&&t(A,{...I})]})};export{K as TopFailingChecksTableBUI};
|
|
2
2
|
//# sourceMappingURL=TopFailingChecksTableBUI.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as
|
|
1
|
+
import{jsxs as n,Fragment as u,jsx as t}from"react/jsx-runtime";import{useRouteRef as k}from"@backstage/core-plugin-api";import{HeaderPage as f}from"@backstage/ui";import{useEffect as l}from"react";import{TrackFormProvider as g,useTrackFormContext as d}from"../../contexts/TrackFormContext.esm.js";import"../../contexts/CheckFormContext.esm.js";import"../../contexts/CampaignFormContext.esm.js";import"../../contexts/UserProvider.esm.js";import"@backstage/catalog-model";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"@spotify/backstage-plugin-soundcheck-common";import"../../hooks/useSoundcheckAlert.esm.js";import{useCreateTrack as h}from"../../hooks/tracks/useCreateTrack.esm.js";import"../../hooks/useConfirmationModal.esm.js";import{useNavigateBack as T}from"../../hooks/useNavigateBack.esm.js";import"react-router-dom";import"react-use/lib/useLocalStorage";import{useFeatureFlag as b}from"../../hooks/useFeatureFlag.esm.js";import{tracksPageRouteRef as i}from"../../routes.esm.js";import{DocLinkButton as C}from"../DocLinkButton/DocLinkButton.esm.js";import"../SoundcheckHeader/SoundcheckHeader.esm.js";import"../SoundcheckHeader/SoundcheckHeaderContext.esm.js";import{useHeader as y}from"../SoundcheckHeader/useHeader.esm.js";import{TrackForm as F}from"../TrackForm/TrackForm.esm.js";const a=()=>{const{setIsLoading:r}=d(),{mutateAsync:o,isLoading:e}=h();l(()=>{r(e)},[r,e]);const[c,s]=T(i),m=async p=>{await o(p,{onSuccess:s})};return y({title:"Create Track",description:"Create a new track that aligns with your organization's long-term tech health initiatives by entering the details below.",docLink:"https://backstage.spotify.com/docs/plugins/soundcheck/core-concepts/tracks"}),t(F,{handleClose:c,onSave:m})},w=()=>{const r=b("backstage-ui"),o=k(i);return n(u,{children:[r&&t(f,{title:"Create Track",breadcrumbs:[{label:"All Tracks",href:o()}],customActions:t(C,{href:"https://backstage.spotify.com/docs/plugins/soundcheck/core-concepts/tracks/"})}),t(g,{children:t(a,{})})]})};export{w as TrackCreatePage,a as TrackCreateView};
|
|
2
2
|
//# sourceMappingURL=TrackCreatePage.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as d,Fragment as f,jsx as r}from"react/jsx-runtime";import{useRouteRef as s}from"@backstage/core-plugin-api";import{usePermission as k}from"@backstage/plugin-permission-react";import{
|
|
1
|
+
import{jsxs as d,Fragment as f,jsx as r}from"react/jsx-runtime";import{useRouteRef as s}from"@backstage/core-plugin-api";import{usePermission as k}from"@backstage/plugin-permission-react";import{HeaderPage as u}from"@backstage/ui";import{soundcheckTrackUpdatePermission as l}from"@spotify/backstage-plugin-soundcheck-common";import{useParams as g}from"react-router-dom";import{TrackFormProvider as h}from"../../contexts/TrackFormContext.esm.js";import"../../contexts/CheckFormContext.esm.js";import"../../contexts/CampaignFormContext.esm.js";import"react";import"../../contexts/UserProvider.esm.js";import"@backstage/catalog-model";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"../../hooks/useSoundcheckAlert.esm.js";import{useTrack as P}from"../../hooks/tracks/useTrack.esm.js";import"../../hooks/useConfirmationModal.esm.js";import"react-use/lib/useLocalStorage";import{useFeatureFlag as b}from"../../hooks/useFeatureFlag.esm.js";import{trackDetailsRouteRef as R,tracksPageRouteRef as T}from"../../routes.esm.js";import{DocLinkButton as E}from"../DocLinkButton/DocLinkButton.esm.js";import{LoadingIndicator as F}from"../LoadingIndicator/LoadingIndicator.esm.js";import{PageWarningMessage as w}from"../PageWarningMessage/PageWarningMessage.esm.js";import{TrackEditView as I}from"./TrackEditView.esm.js";const x=()=>{const{trackId:o}=g(),{data:t,isLoading:i}=P(o),{loading:e,allowed:m}=k({permission:l,resourceRef:o}),a=m&&t?.isEditable,c=b("backstage-ui"),p=s(R),n=s(T);return d(f,{children:[c&&r(u,{title:`Edit ${t?.name??o??"Track"}`,breadcrumbs:[{label:"All Tracks",href:n()},{label:"Details",href:p({trackId:o??""})}],customActions:r(E,{href:"https://backstage.spotify.com/docs/plugins/soundcheck/core-concepts/tracks/"})}),r(w,{entityName:"track",entityId:o,showNotFound:!i&&!t,showCannotEdit:!e&&!a}),i||e?r(F,{}):t&&a&&r(h,{children:r(I,{track:t,canEdit:m})})]})};export{x as TrackEditPage};
|
|
2
2
|
//# sourceMappingURL=TrackEditPage.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as t,jsxs as
|
|
1
|
+
import{jsx as t,jsxs as u,Fragment as oe}from"react/jsx-runtime";import{stringifyEntityRef as F,parseEntityRef as se,RELATION_OWNED_BY as le,RELATION_PART_OF as ce}from"@backstage/catalog-model";import{useRouteRef as de}from"@backstage/core-plugin-api";import{entityRouteRef as fe,getEntityRelations as _,humanizeEntityRef as x}from"@backstage/plugin-catalog-react";import{Table as pe,TableHeader as me,Column as d,TableBody as ge,TablePagination as ye,Row as ue,Flex as K,Cell as C,Box as M,Text as he,CellProfile as we}from"@backstage/ui";import{makeStyles as ke}from"@material-ui/core";import{compact as Pe,uniq as Re}from"lodash";import{useState as z,useMemo as l,useEffect as Se,useCallback as q}from"react";import{useNavigate as Ie}from"react-router-dom";import{TrackEntityField as s,Direction as k}from"../../../graphql/generated/index.esm.js";import{useEntitiesByRefs as Ce}from"../../../hooks/catalog/useEntitiesByRefs.esm.js";import{useProfileImages as Te}from"../../../hooks/catalog/useProfileImages.esm.js";import{useTrackEntities as Ee}from"../../../hooks/entities/useTrackEntities.esm.js";import{getPercentage as P}from"../../../utils/formatters.esm.js";import{getTrackStatusTotal as Be}from"../../../utils/tracks.esm.js";import{CertificationBadge as be}from"../../Badges/CertificationBadge.esm.js";import{CustomCell as H}from"../../CustomCell/CustomCell.esm.js";import"../../EmptyState/EmptyState.esm.js";import{EmptyStateBUI as Ne}from"../../EmptyState/EmptyStateBUI.esm.js";import"@backstage/plugin-permission-react";import"@remixicon/react";import"@spotify/backstage-plugin-soundcheck-common";import"../../../routes.esm.js";import{LoadingTableSkeleton as ve}from"../../LoadingTableSkeleton/LoadingTableSkeleton.esm.js";import{StatusBar as xe}from"../../StatusBar/StatusBar.esm.js";import{toTrackEntityRow as ze}from"./utils.esm.js";const U=10,W=f=>{const{lifecycles:p,owners:m,types:g,systems:y}=f,h=p?.length?{"spec.lifecycle":p}:void 0,T=m?.length?{"relations.ownedBy":m}:void 0,R=g?.length?{"spec.type":g}:void 0,S=y?.length?{"relations.partOf":y}:void 0;return{...h,...T,...R,...S}},Le=ke(()=>({tableContainer:{display:"flex",flexDirection:"column",height:"100%"},statusPercent:{width:"var(--bui-space-12)"},statusBar:{width:"100%"}})),De={name:s.Name,owner:s.Owner,certificationLevel:s.CertificationLevel,checkPassRate:s.CheckPassRate,system:s.System,type:s.Type,lifecycle:s.Lifecycle},Oe=({track:f,lifecycles:p,owners:m,types:g,systems:y,certificationStatus:h,isCampaign:T})=>{const R=Le(),S=Ie(),L=de(fe),[E,Y]=z(k.Asc),[I,$]=z(s.Name),[i,B]=z({orderBy:{field:s.CheckPassRate,direction:k.Desc},filter:W({lifecycles:p,owners:m,types:g,systems:y}),pageInfo:{page:0,pageSize:U,direction:"forward",cursor:null}}),{data:c,isLoading:G}=Ee({trackId:f?.id??"",orderBy:i.orderBy,filter:i.filter,[i.pageInfo.direction==="forward"?"first":"last"]:i.pageInfo.pageSize,[i.pageInfo.direction==="forward"?"after":"before"]:i.pageInfo.cursor,certificationStatus:h}),w=l(()=>c?.trackEntities.edges??[],[c]),J=l(()=>c?.trackEntities.totalCount??0,[c])>U,V=w.map(e=>e.node.entityRef)??[],{data:b,isLoading:X}=Ce({entityRefs:V}),D=l(()=>!f||!w?.length||!b?.items?.length?[]:Pe(w.map(e=>{const a=b.items.find(r=>!!r&&F(r)===e.node.entityRef);return a?ze({trackDetails:e.node,track:f,entity:a}):void 0})),[w,b?.items,f]),Z=Re(D.flatMap(e=>e.entity.relations?.filter(({type:a,targetRef:r})=>a==="ownedBy"&&r).map(a=>a.targetRef)||[])),{profileImageMap:Q}=Te(Z);Se(()=>{let e;I?e={field:De[I]??s.Name,direction:E}:e=void 0,B(a=>({...a,pageInfo:{...a.pageInfo,page:0,cursor:null},orderBy:e,filter:W({lifecycles:p,owners:m,types:g,systems:y}),certificationStatus:h}))},[B,I,E,h,p,m,y,g]);const ee=q(e=>{const a=se(F(e)),r=L(a);S(`${r}/soundcheck`)},[S,L]),N=q((e,a)=>{const r=e>i.pageInfo.page?"forward":"backward",v=r==="forward"?c?.trackEntities.pageInfo.endCursor??null:c?.trackEntities.pageInfo.startCursor??null;B({...i,pageInfo:{page:e,pageSize:a,direction:r,cursor:v}})},[c,i]),te=({row:e})=>{const a=_(e.entity,le).map(o=>x(o,{defaultKind:o.kind})).join(", "),r=e.entity.relations?.find(({type:o})=>o==="ownedBy")?.targetRef,v=_(e.entity,ce,{kind:"system"}).map(o=>x(o,{defaultKind:"system"})).join(", ");let O;r&&(O=Q?.[r]);const A=x(e.entity,{defaultKind:e.entity.kind}),n=l(()=>Be(e.status),[e.status]),j=l(()=>{let o;return e.status?.allPassPercentage!==null&&e.status?.allPassPercentage!==void 0?o=e.status.allPassPercentage:e.status&&(o=P(e.status.passed+e.status.exempt,n)),o},[e.status,n]),ie=l(()=>P(e.status?.failed,n),[e.status,n]),ae=l(()=>P(e.status?.warning,n),[e.status,n]),re=l(()=>P(e.status?.notReported,n),[e.status,n]),ne=l(()=>P(e.status?.error,n),[e.status,n]);return u(ue,{onAction:()=>ee(e.entity),children:[t(H,{children:t(K,{children:t(be,{badge:e.badge,trackType:T?"campaign":void 0})})}),t(C,{title:A}),t(H,{children:u(K,{align:"center",gap:"2",children:[t(M,{className:R.statusPercent,children:u(he,{children:[j,"%"]})}),t(M,{className:R.statusBar,children:t(xe,{passedPercent:j,failedPercent:ie,warningPercent:ae,notReportedPercent:re,errorPercent:ne})})]})}),t(C,{title:v}),t(C,{title:e.entity.spec?.type}),t(C,{title:e.entity.spec?.lifecycle}),t(we,{name:a,src:O??A})]},e.id)};return G||X?t(ve,{}):w.length?u(oe,{children:[u(pe,{onSortChange:({direction:e,column:a})=>{$(String(a)),Y(e==="ascending"?k.Desc:k.Asc)},sortDescriptor:{direction:E===k.Asc?"descending":"ascending",column:I},children:[u(me,{children:[t(d,{id:"state",style:{width:"5%"}}),t(d,{id:"name",allowsSorting:!0,isRowHeader:!0,style:{width:"30%"},children:"Name"}),t(d,{id:"checkPassRate",style:{width:"15%"},children:"Checks"}),t(d,{id:"system",allowsSorting:!0,style:{width:"15%"},children:"System"}),t(d,{id:"type",allowsSorting:!0,style:{width:"10%"},children:"Type"}),t(d,{id:"lifecycle",allowsSorting:!0,style:{width:"10%"},children:"Lifecycle"}),t(d,{id:"owner",allowsSorting:!0,style:{width:"15%"},children:"Owner"})]}),t(ge,{children:D.map(e=>t(te,{row:e},e.id))})]}),J&&t(ye,{showPageSizeOptions:!0,tabIndex:i.pageInfo.page,pageSize:i.pageInfo.pageSize,rowCount:c?.trackEntities.totalCount,offset:i.pageInfo.page*i.pageInfo.pageSize,onPreviousPage:()=>{const e=i.pageInfo.page-1;N(e,i.pageInfo.pageSize)},onNextPage:()=>{const e=i.pageInfo.page+1;N(e,i.pageInfo.pageSize)},onPageSizeChange:e=>{N(i.pageInfo.page,e)}})]}):t(Ne,{title:"No track entities found",body:"There are no track entities found."})};export{Oe as TrackEntitiesTableBUI};
|
|
2
2
|
//# sourceMappingURL=TrackEntitiesTableBUI.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as t,jsxs as
|
|
1
|
+
import{jsx as t,jsxs as a,Fragment as ue}from"react/jsx-runtime";import{parseEntityRef as he}from"@backstage/catalog-model";import{useRouteRef as N}from"@backstage/core-plugin-api";import{usePermission as ke}from"@backstage/plugin-permission-react";import{Container as C,HeaderPage as ge,Box as f,Flex as D,Text as K}from"@backstage/ui";import{makeStyles as Se}from"@material-ui/core";import{toEntityFilterQuery as be,soundcheckTrackReadPermission as ve}from"@spotify/backstage-plugin-soundcheck-common";import{useState as E,useMemo as T,useEffect as U}from"react";import{useSearchParams as Ce,useParams as Ee}from"react-router-dom";import Te from"react-use/lib/useDebounce";import ye from"react-use/lib/useLocalStorage";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"../../hooks/useSoundcheckAlert.esm.js";import{useTrack as Le}from"../../hooks/tracks/useTrack.esm.js";import"../../hooks/useConfirmationModal.esm.js";import{useCertificationStatus as Ie}from"../../hooks/aggregations/useCertificationStatus.esm.js";import{useCertificationStatusHistory as we}from"../../hooks/aggregations/useCertificationStatusHistory.esm.js";import{useCheckStatuses as Re}from"../../hooks/aggregations/useCheckStatuses.esm.js";import{useFilters as Ne}from"../../hooks/filters/useFilters.esm.js";import{useLCPReporting as Be}from"../../hooks/useLCPReporting.esm.js";import{useLoadTimeReporting as Fe}from"../../hooks/useLoadTimeReporting.esm.js";import{tracksPageRouteRef as Pe,trackOverviewRouteRef as Oe,trackExplorerRouteRef as _e}from"../../routes.esm.js";import{getEntitiesBucket as He,getChecksBucket as xe}from"../../utils/helpers.esm.js";import{DescriptionCard as Ae}from"../Cards/DescriptionCard/DescriptionCard.esm.js";import{HistoricalTrackStatusCard as Ve}from"../Cards/HistoricalTrackStatusCard/HistoricalTrackStatusCard.esm.js";import{TrackStatusCard as je}from"../Cards/TrackStatusCard/TrackStatusCard.esm.js";import{ChecksTable as De}from"../ChecksTable/ChecksTable.esm.js";import{ChipSelector as Ke}from"../ChipSelector/ChipSelector.esm.js";import"../EmptyState/EmptyState.esm.js";import{EmptyStateBUI as Y}from"../EmptyState/EmptyStateBUI.esm.js";import"@remixicon/react";import"../FilterSidebar/FilterSidebar.esm.js";import"../FilterSidebar/StateFilter.esm.js";import{useTrackFilterSidebar as Ue}from"../FilterSidebar/useTrackFilterSidebar.esm.js";import{toFilter as Ye}from"../FilterSidebar/util.esm.js";import{LoadingTableSkeleton as Ge}from"../LoadingTableSkeleton/LoadingTableSkeleton.esm.js";import{SimpleMenu as Me}from"../Menus/SimpleMenu.esm.js";import"js-yaml";import"lodash";import{useTrackActions as $e}from"../Menus/useTrackActions.esm.js";import"uuid";import"../CampaignsPage/CampaignListPage/useArchiveConfirmationModal.esm.js";import{PageCustomActions as qe}from"../PageCustomActions/PageCustomActions.esm.js";import"../TechHealth/Filters/types.esm.js";import"../TechHealth/Filters/FacetFilter.esm.js";import"../TechHealth/Filters/FilterProvider.esm.js";import"../TechHealth/Filters/Filters.esm.js";import"../TechHealth/Filters/FiltersHeader.esm.js";import"../TechHealth/Filters/FiltersSection.esm.js";import"../../contexts/TrackFormContext.esm.js";import"../../contexts/CheckFormContext.esm.js";import"../../contexts/CampaignFormContext.esm.js";import"../../contexts/UserProvider.esm.js";import{parseNumberOfDays as Qe}from"../TechHealth/Filters/utils.esm.js";import{TopFailingChecksTableBUI as ze}from"../TopFailingChecksTable/TopFailingChecksTableBUI.esm.js";import{TrackEntitiesTableBUI as We}from"./TrackEntitiesTable/TrackEntitiesTableBUI.esm.js";const Je=Se(()=>({container:{marginBottom:"var(--bui-space-12)"},cards:{margin:"0 0 var(--bui-space-12)",display:"flex",gridGap:"var(--bui-space-4)"},tableContent:{margin:"var(--bui-space-3) 0 0"},levelSection:{margin:"0 0 var(--bui-space-6)"},levelHeading:{padding:"var(--bui-space-3)",background:"var(--bui-bg-surface-2)"}})),n={CHECKS_BY_LEVELS:"Checks By Levels",TOP_FAILING_CHECKS:"Top Failing Checks",ENTITIES:"Entities"},Xe=()=>{const s=Je(),[o,y]=Ce(),[B,G]=E(new Set([n.CHECKS_BY_LEVELS])),g=B.values().next().value??n.CHECKS_BY_LEVELS,[c,M]=E(o.get("search")||""),[F,$]=E(""),{trackId:i}=Ee(),{data:r,isLoading:u,isError:q}=Le(i),Q=N(Pe),P=$e(r??void 0),O=r?.ownerEntityRef,z=O?he(O).name:void 0,W=Array.from(new Set(r?.levels.flatMap(e=>e.checks).map(e=>e.id)??[])),{owners:m,lifecycles:l,types:p,systems:d}=Ue(),L=T(()=>Ye({lifecycles:l,owners:m,types:p,systems:d}),[l,m,p,d]),I=T(()=>Qe(o.get("numberOfDays")),[o]),[S,_]=E(!1),[h,w]=ye("track-overview-search-params","");U(()=>{!S&&o?.toString()?(h!==o.toString()&&w(o.toString()),_(!0)):!S&&h?(y(new URLSearchParams(h)),_(!0)):S&&h!==o.toString()&&w(o.toString())},[o,y,w,h,S]),Te(()=>{$(c);const e=new URLSearchParams(o.toString());c?e.set("search",c):e.delete("search"),y(e,{replace:!0})},300,[c]);const H=T(()=>({routeName:"soundcheck-track-insights",additionalAttributes:{trackId:i||"",filtersApplied:m.length+l.length+p.length+d.length,ownersFilter:m.join(",")||"",lifecyclesFilter:l.join(",")||"",typesFilter:p.join(",")||"",systemsFilter:d.join(",")||"",numberOfDays:I,tracksSearch:F||""}}),[i,m,l,p,d,I,F]),{reportContentLoaded:x}=Fe(H),{reporter:J}=Be(H),{data:b,isLoading:A,isError:X}=Ie({trackId:i,filter:L},!!i),{data:Z,isLoading:V,isError:ee}=we({trackId:i,filter:L,numberOfDays:I},!!i),{data:v,isLoading:R}=Re({trackId:i,checkIds:W,filter:L},!!r),te=T(()=>be(r?.filter),[r]),re=q||X||ee,{loading:ie,allowed:oe}=ke({permission:ve,resourceRef:i}),{filters:ae,selected:se,setSelected:ce,onRemoveTag:ne,selectedTags:me}=Ne({entityFilterQuery:te}),le=r?.levels.flatMap(e=>{const k=c?.trim().toLowerCase();return{...e,checks:k?e.checks.filter(({name:fe})=>fe.toLowerCase().includes(k)):e.checks}})??[],j=J?.getLCPValue();U(()=>{if(!u&&!R&&!A&&!V){const e=b?.certificationStatus?.numberOfEntities??0,k=v?.length??0;x({lcp:j,numberOfEntities:e,entitiesBucket:He(e),numberOfChecks:k,checksBucket:xe(k)})}},[u,R,A,V,v,b,x,j]);const pe=N(Oe),de=N(_e);return u?t(C,{className:s.container,children:t(Ge,{})}):!u&&!r?t(C,{className:s.container,children:t(Y,{title:"Track not found",body:`There is no track with the requested id: ${i}.`})}):!ie&&!oe?t(C,{className:s.container,children:t(Y,{title:"Cannot view track",body:`No permission to view track with the requested id: ${i}.`})}):a(ue,{children:[t(ge,{title:r?.name,customActions:t(Me,{label:"Track Actions",disabled:!P.length,placement:"left top",menuActions:P}),breadcrumbs:[{label:"Tracks",href:Q()}],tabs:[{id:"overview",label:"Track Overview",href:i?pe({trackId:i}):""},{id:"explorer",label:"Tech Insights Explorer",href:i?de({trackId:i}):""}]}),a(C,{className:s.container,children:[a(f,{className:s.cards,children:[t(Ae,{description:r?.description??void 0,owner:z}),t(je,{track:r??void 0,status:b}),t(Ve,{track:r??void 0,history:Z,isError:re})]}),r&&a(f,{children:[a(D,{justify:"between",children:[t(f,{minWidth:"18rem",children:t(Ke,{options:Object.values(n),selected:B,ariaLabel:"Sections",onSelectionChange:G})}),t(qe,{searchValue:c,setSearchValue:e=>M(e),filters:ae,selected:se,setSelected:ce,onRemoveTag:ne,selectedTags:me,showSearch:g!==n.ENTITIES})]}),a(f,{className:s.tableContent,children:[g===n.CHECKS_BY_LEVELS&&t(f,{mt:"3",children:le.map(e=>a(f,{className:s.levelSection,children:[a(D,{align:"center",gap:"4",className:s.levelHeading,children:[a(K,{color:"secondary",children:["Level ",e.ordinal]})," ",t(K,{children:e.name})]}),t(De,{trackId:r.id,checks:e.checks,checkStatuses:v,isLoading:u||R})]},e.ordinal))}),g===n.TOP_FAILING_CHECKS&&t(ze,{track:r,checkStatuses:v,certificationStatus:b?.certificationStatus,searchValue:c}),g===n.ENTITIES&&t(We,{track:r,lifecycles:l,owners:m,types:p,systems:d,searchValue:c})]})]})]})]})};export{Xe as TrackPageBUI};
|
|
2
2
|
//# sourceMappingURL=TrackPageBUI.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as r,jsxs as
|
|
1
|
+
import{jsx as r,jsxs as l,Fragment as V}from"react/jsx-runtime";import{useRouteRef as y,useApi as z}from"@backstage/core-plugin-api";import{entityPresentationApiRef as J}from"@backstage/plugin-catalog-react";import{usePermission as K}from"@backstage/plugin-permission-react";import{Container as d,HeaderPage as Q,Box as S,Flex as W,SearchField as X}from"@backstage/ui";import{makeStyles as Y}from"@material-ui/core";import{soundcheckTrackReadPermission as Z}from"@spotify/backstage-plugin-soundcheck-common";import{useState as C,useMemo as f,useEffect as _}from"react";import{useSearchParams as ee,useParams as re}from"react-router-dom";import te from"react-use/lib/useDebounce";import"@backstage/catalog-model";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import"../../hooks/useSoundcheckAlert.esm.js";import{useGetAllTracks as oe}from"../../hooks/tracks/useGetAllTracks.esm.js";import{useTrack as ie}from"../../hooks/tracks/useTrack.esm.js";import"../../hooks/useConfirmationModal.esm.js";import"react-use/lib/useLocalStorage";import{useHierarchicalTrackStatus as ae}from"../../hooks/heirarchy/useHierarchicalTrackStatus.esm.js";import{useGroupHierarchy as me}from"../../hooks/heirarchy/useGroupHierarchy.esm.js";import{useLCPReporting as se}from"../../hooks/useLCPReporting.esm.js";import{useLoadTimeReporting as ne}from"../../hooks/useLoadTimeReporting.esm.js";import{tracksPageRouteRef as ce,trackOverviewRouteRef as pe,trackExplorerRouteRef as le}from"../../routes.esm.js";import{getAllOwnedEntityCount as de}from"../../utils/getAllOwnedEntityCount.esm.js";import{getEntitiesBucket as fe,getTracksBucket as ue}from"../../utils/helpers.esm.js";import"../EmptyState/EmptyState.esm.js";import{EmptyStateBUI as F}from"../EmptyState/EmptyStateBUI.esm.js";import"@remixicon/react";import"../FilterSidebar/FilterSidebar.esm.js";import"../FilterSidebar/StateFilter.esm.js";import{useTrackFilterSidebar as he}from"../FilterSidebar/useTrackFilterSidebar.esm.js";import"../FilterSidebar/util.esm.js";import"../HierarchicalTechInsightsPage/visualizations/NivoCirclePacking.esm.js";import"../HierarchicalTechInsightsPage/visualizations/NivoHeatmap.esm.js";import"../HierarchicalTechInsightsPage/visualizations/NivoIcicle.esm.js";import"../HierarchicalTechInsightsPage/visualizations/NivoSunburst.esm.js";import"../HierarchicalTechInsightsPage/visualizations/NivoTreemap.esm.js";import"../HierarchicalTechInsightsPage/visualizations/VisualizationBreadcrumb.esm.js";import{hierarchyToNivo as ge}from"../HierarchicalTechInsightsPage/visualizations/hierarchyToNivo.esm.js";import{LoadingTableSkeleton as ke}from"../LoadingTableSkeleton/LoadingTableSkeleton.esm.js";import{SimpleMenu as be}from"../Menus/SimpleMenu.esm.js";import"js-yaml";import"lodash";import{useTrackActions as Te}from"../Menus/useTrackActions.esm.js";import"uuid";import"../CampaignsPage/CampaignListPage/useArchiveConfirmationModal.esm.js";import"../TechHealth/Filters/types.esm.js";import"../TechHealth/Filters/FacetFilter.esm.js";import"../TechHealth/Filters/FilterProvider.esm.js";import"../TechHealth/Filters/Filters.esm.js";import"../TechHealth/Filters/FiltersHeader.esm.js";import"../TechHealth/Filters/FiltersSection.esm.js";import"../../contexts/TrackFormContext.esm.js";import"../../contexts/CheckFormContext.esm.js";import"../../contexts/CampaignFormContext.esm.js";import"../../contexts/UserProvider.esm.js";import{parseNumberOfDays as ve}from"../TechHealth/Filters/utils.esm.js";import{TechInsightsExplorerTable as ye}from"../TechInsightsExplorerTable/TechInsightsExplorerTable.esm.js";import{TechInsightsGroupSelector as Se}from"../TechInsightsGroupSelector/TechInsightsGroupSelector.esm.js";import{TopAndBottomPerformingTeams as we}from"../TopAndBottomPerformingTeams/TopAndBottomPerformingTeams.esm.js";const Re=Y(()=>({container:{marginBottom:"var(--bui-space-12)"},teams:{margin:"0 0 var(--bui-space-12)"},tableContent:{margin:"var(--bui-space-3) 0 0"},filters:{width:"25rem",marginLeft:"auto"}})),Le=()=>{const i=Re(),[a,O]=ee(),[m,B]=C(a.get("search")||""),o=a.get("group"),[w,j]=C(""),{trackId:e}=re(),{data:u,isLoading:n}=ie(e),R=Te(u??void 0),{owners:h,lifecycles:g,types:k,systems:b}=he(),D=y(ce),L=f(()=>ve(a.get("numberOfDays")),[a]);te(()=>{j(m);const t=new URLSearchParams(a.toString());m?t.set("search",m):t.delete("search"),O(t,{replace:!0})},300,[m]);const P=f(()=>({routeName:"soundcheck-track-insights",additionalAttributes:{trackId:e||"",filtersApplied:h.length+g.length+k.length+b.length,ownersFilter:h.join(",")||"",lifecyclesFilter:g.join(",")||"",typesFilter:k.join(",")||"",systemsFilter:b.join(",")||"",numberOfDays:L,tracksSearch:w||""}}),[e,h,g,k,b,L,w]),{reportContentLoaded:I}=ne(P),{reporter:G}=se(P),{loading:H,allowed:q}=K({permission:Z,resourceRef:e}),{data:T,isLoading:c}=ae({trackId:e??"",groupRef:o??"",skip:!e}),{data:N}=oe({}),s=f(()=>N?.edges.find(t=>t.node.id===e)?.node,[N?.edges,e]),{data:p,isLoading:v}=me(o||void 0,{enabled:!!o&&!!e&&!!s,ownedEntitiesFilter:s?.filter??void 0}),x=z(J),M=f(()=>{if(!o)return;const t=p?.[o];return t?ge(t,T||null,()=>"var(--bui-fg-primary)",x,void 0):void 0},[p,x,o,T]),A=G?.getLCPValue();_(()=>{if(!n&&!v&&!c){const t=o?de(p?.[o]):0,E=s?1:0;I({lcp:A,numberOfEntities:t,entitiesBucket:fe(t),numberOfTracks:E,tracksBucket:ue(E)})}},[n,I,v,c,p,o,s,A]);const U=y(pe),$=y(le);return n?r(d,{className:i.container,children:r(ke,{})}):!n&&!u?r(d,{className:i.container,children:r(F,{title:"Track not found",body:`There is no track with the requested id: ${e}.`})}):!H&&!q?r(d,{className:i.container,children:r(F,{title:"Cannot view track",body:`No permission to view track with the requested id: ${e}.`})}):l(V,{children:[r(Q,{title:u?.name,customActions:r(be,{label:"Track Actions",disabled:!R.length,placement:"left top",menuActions:R}),breadcrumbs:[{label:"Tracks",href:D()}],tabs:[{id:"overview",label:"Track Overview",href:e?U({trackId:e}):""},{id:"explorer",label:"Tech Insights Explorer",href:e?$({trackId:e}):""}]}),l(d,{className:i.container,children:[r(S,{className:i.teams,children:r(we,{trackStatus:T??void 0,isLoading:c})}),l(S,{children:[l(W,{align:"center",gap:"3",className:i.filters,children:[r(Se,{}),r(X,{value:m,onChange:B,"aria-label":"Search",placeholder:"Search"})]}),r(S,{className:i.tableContent,children:r(ye,{tableData:M,isLoading:v||c,selectedGroup:o??void 0,trackId:s?.id})})]})]})]})};export{Le as TrackTechInsightsExplorerPage};
|
|
2
2
|
//# sourceMappingURL=TrackTechInsightsExplorerPage.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as r,jsxs as k}from"react/jsx-runtime";import{useRouteRef as _,useApi as S,featureFlagsApiRef as ee}from"@backstage/core-plugin-api";import{usePermission as re}from"@backstage/plugin-permission-react";import{makeStyles as te,Button as N,Grid as a}from"@material-ui/core";import{soundcheckTrackCreatePermission as ae}from"@spotify/backstage-plugin-soundcheck-common";import{useState as i,useMemo as oe,useEffect as B}from"react";import{useNavigate as ie}from"react-router-dom";import se from"react-use/lib/useDebounce";import{soundcheckApiRef as ne}from"../../../api.esm.js";import"@backstage/catalog-model";import"@tanstack/react-query";import"../../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"../../../hooks/useSoundcheckAlert.esm.js";import{useGetAllTracks as ce}from"../../../hooks/tracks/useGetAllTracks.esm.js";import"../../../hooks/useConfirmationModal.esm.js";import"react-use/lib/useLocalStorage";import{useGetTrackOwners as me}from"../../../hooks/tracks/useGetTrackOwners.esm.js";import{useImportTracks as le}from"../../../hooks/tracks/useImportTracks.esm.js";import{useLCPReporting as pe}from"../../../hooks/useLCPReporting.esm.js";import{useLoadTimeReporting as de}from"../../../hooks/useLoadTimeReporting.esm.js";import ge from"../../../images/no-results.svg";import{trackCreateRouteRef as ue}from"../../../routes.esm.js";import{exportTracks as fe}from"../../../utils/export.esm.js";import{FilterDefault as L}from"../../../utils/filters.esm.js";import{EmptyState as F}from"../../EmptyState/EmptyState.esm.js";import"../../EmptyState/EmptyStateBUI.esm.js";import"@remixicon/react";import{ImportExportPanelDeprecated as he}from"../../ImportExportPanel/ImportExportPanelDeprecated.esm.js";import{Pagination as ke}from"../../Pagination/Pagination.esm.js";import{SearchFilters as Pe}from"../../SearchFilters/SearchFilters.esm.js";import{TrackEmptyState as P,TrackNoResults as I}from"./TrackEmptyState.esm.js";import{TracksOverviewSkeleton as Te}from"./TracksOverviewSkeleton.esm.js";import{TrackSummaryCard as ye}from"./TrackSummaryCard.esm.js";const Ce=te(t=>({headerButtons:{display:"flex",gap:t.spacing(1),flexWrap:"nowrap",justifyContent:"end",alignItems:"end"},header:{padding:t.spacing(0,0,1)},container:{padding:t.spacing(3),gap:t.spacing(3)},createButton:{lineHeight:"1.25rem",paddingTop:t.spacing(1.5),paddingBottom:t.spacing(1.5)}})),be=({tracksPerPage:t,currentCursor:O})=>{const[s,T]=i(O),[g,E]=i(""),[n,D]=i(L.Alpha),[c,j]=i(L.Owner),[m,G]=i(""),y=oe(()=>({routeName:"soundcheck-tracks",additionalAttributes:{tracksPerPage:t,pageCursor:s||"",sortOrder:n||"",ownerFilter:c||"",nameSearch:m||""}}),[t,s,n,c,m]),{reportContentLoaded:C}=de(y),{reporter:H}=pe(y),l=Ce(),{data:M,isLoading:u}=me();se(()=>{G(g)},500,[g]);const{loading:b,allowed:V}=re({permission:ae}),W=ie(),$=_(ue),
|
|
1
|
+
import{jsx as r,jsxs as k}from"react/jsx-runtime";import{useRouteRef as _,useApi as S,featureFlagsApiRef as ee}from"@backstage/core-plugin-api";import{usePermission as re}from"@backstage/plugin-permission-react";import{makeStyles as te,Button as N,Grid as a}from"@material-ui/core";import{soundcheckTrackCreatePermission as ae}from"@spotify/backstage-plugin-soundcheck-common";import{useState as i,useMemo as oe,useEffect as B}from"react";import{useNavigate as ie}from"react-router-dom";import se from"react-use/lib/useDebounce";import{soundcheckApiRef as ne}from"../../../api.esm.js";import"@backstage/catalog-model";import"@tanstack/react-query";import"../../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"../../../hooks/useSoundcheckAlert.esm.js";import{useGetAllTracks as ce}from"../../../hooks/tracks/useGetAllTracks.esm.js";import"../../../hooks/useConfirmationModal.esm.js";import"react-use/lib/useLocalStorage";import{useGetTrackOwners as me}from"../../../hooks/tracks/useGetTrackOwners.esm.js";import{useImportTracks as le}from"../../../hooks/tracks/useImportTracks.esm.js";import{useLCPReporting as pe}from"../../../hooks/useLCPReporting.esm.js";import{useLoadTimeReporting as de}from"../../../hooks/useLoadTimeReporting.esm.js";import ge from"../../../images/no-results.svg";import{trackCreateRouteRef as ue}from"../../../routes.esm.js";import{exportTracks as fe}from"../../../utils/export.esm.js";import{FilterDefault as L}from"../../../utils/filters.esm.js";import{EmptyState as F}from"../../EmptyState/EmptyState.esm.js";import"../../EmptyState/EmptyStateBUI.esm.js";import"@remixicon/react";import{ImportExportPanelDeprecated as he}from"../../ImportExportPanel/ImportExportPanelDeprecated.esm.js";import{Pagination as ke}from"../../Pagination/Pagination.esm.js";import{SearchFilters as Pe}from"../../SearchFilters/SearchFilters.esm.js";import{TrackEmptyState as P,TrackNoResults as I}from"./TrackEmptyState.esm.js";import{TracksOverviewSkeleton as Te}from"./TracksOverviewSkeleton.esm.js";import{TrackSummaryCard as ye}from"./TrackSummaryCard.esm.js";const Ce=te(t=>({headerButtons:{display:"flex",gap:t.spacing(1),flexWrap:"nowrap",justifyContent:"end",alignItems:"end"},header:{padding:t.spacing(0,0,1)},container:{padding:t.spacing(3),gap:t.spacing(3)},createButton:{lineHeight:"1.25rem",paddingTop:t.spacing(1.5),paddingBottom:t.spacing(1.5)}})),be=({tracksPerPage:t,currentCursor:O})=>{const[s,T]=i(O),[g,E]=i(""),[n,D]=i(L.Alpha),[c,j]=i(L.Owner),[m,G]=i(""),y=oe(()=>({routeName:"soundcheck-tracks",additionalAttributes:{tracksPerPage:t,pageCursor:s||"",sortOrder:n||"",ownerFilter:c||"",nameSearch:m||""}}),[t,s,n,c,m]),{reportContentLoaded:C}=de(y),{reporter:H}=pe(y),l=Ce(),{data:M,isLoading:u}=me();se(()=>{G(g)},500,[g]);const{loading:b,allowed:V}=re({permission:ae}),W=ie(),$=_(ue),v=()=>W($()),{data:f,isLoading:o}=ce({ids:void 0,types:["standard","playlist"],first:t,after:s,orderAlphabetical:n,searchByOwner:c,searchByName:m}),p=f?.edges?.map(e=>e.node),[x,A]=i([]);B(()=>{T(void 0),A([])},[m]);const w=S(ee),q=!w.getRegisteredFlags().find(e=>e.name==="soundcheck-enable-track-creation")||w.isActive("soundcheck-enable-track-creation"),h=!V||!q,z=e=>{D(e.target.value)},J=e=>{j(e.target.value)},K=S(ne),{mutateAsync:Q}=le(),U=async e=>Q(e),X=async()=>{const e=await K.getTracks({orderAlphabetical:"asc"});return fe(e.edges.map(Z=>Z.node))},R=H?.getLCPValue();if(B(()=>{!o&&!u&&C({lcp:R})},[o,u,C,R]),!o&&!p)return r(F,{title:P.title,description:P.description,imgSrc:ge,action:!b&&r(N,{disabled:h,variant:"contained",color:"primary",onClick:v,children:P.callToAction})});let d;o?d=r(Te,{}):p?.length?d=p?.map(e=>r(a,{xs:12,sm:12,md:6,lg:4,xl:3,item:!0,role:"listitem","aria-label":`track card ${e.id}`,children:r(ye,{summary:e})},e.id)):d=r(a,{xs:12,item:!0,role:"listitem","aria-label":"result",children:r(F,{title:I.title,description:I.description})});const Y=f?.pageInfo.hasNextPage||x?.length>0;return k(a,{container:!0,direction:"row",className:l.container,children:[k(a,{container:!0,className:l.header,children:[r(Pe,{searchPlaceholder:"Search Available Tracks",isLoading:o||u,searchTerm:g,setSearchTerm:E,filterAlpha:n,handleAlphabeticalFilterChange:z,filterOwner:c,handleOwnerFilterChange:J,owners:M}),k(a,{item:!0,xs:4,className:l.headerButtons,children:[r(he,{resourceType:"track",disableImport:h,disableExport:o||!p?.length,onImport:U,onExport:X}),!b&&r(N,{disabled:h,variant:"contained",color:"primary",onClick:v,className:l.createButton,children:"Create Track"})]})]}),r(a,{container:!0,spacing:4,role:"list","aria-label":"tracks",children:d}),Y&&r(a,{item:!0,xs:12,children:r(ke,{response:f,listingsPerPage:t,cursor:s,setCursor:T,prevCursors:x,setPrevCursors:A,labelPerPageDropdown:"Tracks Per Page:",urlRoute:"tracks?tracksPerPage="})})]})};export{be as TrackListPageDeprecated};
|
|
2
2
|
//# sourceMappingURL=TrackListPageDeprecated.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as t,jsxs as c,Fragment as z}from"react/jsx-runtime";import{useApi as v,useRouteRef as A}from"@backstage/core-plugin-api";import{entityPresentationApiRef as J}from"@backstage/plugin-catalog-react";import{usePermission as W}from"@backstage/plugin-permission-react";import{HeaderPage as Y,Flex as q,Container as K,Table as Q,TableHeader as X,Column as n,TableBody as Z,TablePagination as _}from"@backstage/ui";import{makeStyles as ee}from"@material-ui/core";import{soundcheckTrackCreatePermission as te}from"@spotify/backstage-plugin-soundcheck-common";import{sortBy as re,isEmpty as k}from"lodash";import{useState as y,useMemo as p,useEffect as oe}from"react";import{soundcheckApiRef as ie}from"../../api.esm.js";import"@backstage/catalog-model";import"@tanstack/react-query";import"../../hooks/graphqlKeys.esm.js";import"../../hooks/useSoundcheckAlert.esm.js";import{useGetAllTracks as ae}from"../../hooks/tracks/useGetAllTracks.esm.js";import"../../hooks/useConfirmationModal.esm.js";import"react-router-dom";import{useSearchName as ne}from"../../hooks/useSearchName.esm.js";import{usePagination as se}from"../../hooks/usePagination.esm.js";import"react-use/lib/useLocalStorage";import{useProfileImages as me}from"../../hooks/catalog/useProfileImages.esm.js";import{useImportTracks as ce}from"../../hooks/tracks/useImportTracks.esm.js";import{useLCPReporting as le}from"../../hooks/useLCPReporting.esm.js";import{useLoadTimeReporting as pe}from"../../hooks/useLoadTimeReporting.esm.js";import{trackCreateRouteRef as de,trackDetailsRouteRef as fe}from"../../routes.esm.js";import{exportTracks as ue}from"../../utils/export.esm.js";import"../EmptyState/EmptyState.esm.js";import{EmptyStateBUI as ge}from"../EmptyState/EmptyStateBUI.esm.js";import{EmptyStateNoTracks as he}from"../EmptyState/EmptyStateNoTracks.esm.js";import"@remixicon/react";import{ImportExportPanelBUI as ke}from"../ImportExportPanel/ImportExportPanelBUI.esm.js";import"../ImportExportPanel/ImportExportPanelDeprecated.esm.js";import{ListPageCustomActions as ye}from"../ListPageCustomActions/ListPageCustomActions.esm.js";import{LoadingTableSkeleton as we}from"../LoadingTableSkeleton/LoadingTableSkeleton.esm.js";import"../Menus/SimpleMenu.esm.js";import{useTrackActions as Re}from"../Menus/useTrackActions.esm.js";import"uuid";import"../CampaignsPage/CampaignListPage/useArchiveConfirmationModal.esm.js";import{TableRowWithOwner as Te}from"../TableRowWithOwner/TableRowWithOwner.esm.js";const x=10,Pe=({track:r,profileImageMap:s})=>{const l=p(()=>r.levels.reduce((m,f)=>m+(f.checks?.length??0),0),[r.levels]),o=A(fe),d=Re(r);return t(Te,{ownerEntityRef:r.ownerEntityRef,href:o({trackId:r.id}),menuActions:d,profileImageSrc:s[r.ownerEntityRef],name:r.name??r.id,description:r.description??"",documentationURL:r.documentationURL??void 0,cells:[{title:r.draft?"Draft":"Active"},{title:`${r.levels.length} Level${r.levels.length===1?"":"s"}`},{title:`${l} Check${l===1?"":"s"}`}]})},Ce=ee(()=>({container:{marginBottom:"var(--bui-space-12)"}})),Se=()=>{const r=Ce(),[s,l]=y("ascending"),[o,d]=y(""),[m,f]=y(""),w=p(()=>({routeName:"soundcheck-tracks"}),[]),{reportContentLoaded:R}=pe(w),{reporter:B}=le(w),{data:T,isLoading:i}=ae({types:["standard","playlist"]}),u=p(()=>T?.edges?.map(e=>e.node)??[],[T?.edges]),{profileImageMap:N}=me(u.map(e=>e.ownerEntityRef)),P=v(J),g=ne({items:u,searchTerm:m}),C=p(()=>{if(!o)return g;const e=re(g,a=>o==="owner"?P.forEntity(a.ownerEntityRef).snapshot.primaryTitle.toLowerCase():o==="status"?a.draft?"draft":"active":a.name.toLowerCase());return s==="descending"&&e.reverse(),e},[P,o,s,g]),{paginatedItems:h,reset:U,paginationProps:H}=se({pageParam:"perPage",defaultPageSize:x,items:C}),S=B?.getLCPValue();oe(()=>{i||R({lcp:S})},[i,R,S]);const M=A(de),{loading:I,allowed:L}=W({permission:te}),$=v(ie),{mutateAsync:D}=ce(),V=async e=>D(e),F=async()=>{const e=await $.getTracks({orderAlphabetical:"asc"});return ue(e.edges.map(a=>a.node))},O=!i&&!k(h),j=C.length>x,E=!i&&k(h),G=i;let b=null;return E&&(b=m?t(ge,{title:"No tracks found",body:"Your current search term did not return any tracks. Please try a different search term."}):t(he,{})),c(z,{children:[t(Y,{title:"Tracks",customActions:c(q,{gap:"2",align:"center",children:[t(ke,{resourceType:"track",disableImport:!I&&!L,disableExport:i||k(u),onImport:V,onExport:F}),t(ye,{searchValue:m,setSearchValue:e=>{U(),f(e)},canCreate:!I&&L,createHref:M()})]})}),c(K,{className:r.container,children:[G&&t(we,{rowCount:10}),E&&b,O&&c(Q,{onSortChange:({direction:e,column:a})=>{d(String(a)),l(e)},sortDescriptor:{direction:s,column:o},children:[c(X,{children:[t(n,{id:"name",allowsSorting:!0,isRowHeader:!0,style:{width:"51%"},children:"Track Name"}),t(n,{allowsSorting:!0,id:"status",style:{width:"10%"},children:"Status"}),t(n,{id:"levels",style:{width:"10%"},children:"Levels"}),t(n,{id:"checks",style:{width:"10%"},children:"Checks"}),t(n,{id:"owner",allowsSorting:!0,style:{width:"15%"},children:"Track Owner"}),t(n,{id:"actions",style:{width:"2%"}})]}),t(Z,{children:!i&&h.map(e=>t(Pe,{track:e,profileImageMap:N??{}},e.id))})]}),j&&t(_,{...H})]})]})};export{Se as TracksListPageBUI};
|
|
2
2
|
//# sourceMappingURL=TracksListPageBUI.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{stringifyEntityRef as I,parseEntityRef as b}from"@backstage/catalog-model";import{useApi as G,configApiRef as M}from"@backstage/core-plugin-api";import{combineEntityFilterQueries as N,getGroupFilterFromConfig as j}from"@spotify/backstage-plugin-soundcheck-common";import l from"lodash/startCase";import{useMemo as w,useCallback as B}from"react";import{useSearchParams as Q}from"react-router-dom";import{CheckState as r}from"../../components/CheckPage/utils.esm.js";import{useGetEntityFacets as f}from"../catalog/useGetEntityFacets.esm.js";import{useGetEntityRefs as _}from"../catalog/useGetEntityRefs.esm.js";function x({entityFilterQuery:m,hasStatusFilters:E=!1,hasCertificationStatusFilters:d=!1}){const R=G(M),[o,u]=Q(),A=N({kind:["group"]},j(R)),{data:y}=_(A),
|
|
1
|
+
import{stringifyEntityRef as I,parseEntityRef as b}from"@backstage/catalog-model";import{useApi as G,configApiRef as M}from"@backstage/core-plugin-api";import{combineEntityFilterQueries as N,getGroupFilterFromConfig as j}from"@spotify/backstage-plugin-soundcheck-common";import l from"lodash/startCase";import{useMemo as w,useCallback as B}from"react";import{useSearchParams as Q}from"react-router-dom";import{CheckState as r}from"../../components/CheckPage/utils.esm.js";import{useGetEntityFacets as f}from"../catalog/useGetEntityFacets.esm.js";import{useGetEntityRefs as _}from"../catalog/useGetEntityRefs.esm.js";function x({entityFilterQuery:m,hasStatusFilters:E=!1,hasCertificationStatusFilters:d=!1}){const R=G(M),[o,u]=Q(),A=N({kind:["group"]},j(R)),{data:y}=_(A),g=w(()=>y?.items.map(e=>({label:e.metadata.title??e.metadata.name,value:I(e)}))??[],[y]),{data:h}=f("spec.lifecycle",m),F=h?.map(e=>({label:e,value:e}))??[],{data:L}=f("spec.type",m),$=L?.map(e=>({label:e,value:e}))??[],{data:k}=f("relations.partOf",m),C=k?.map(e=>({label:b(e).name,value:e}))??[],P=[r.PASSED,r.FAILED,r.WARNING,r.EXEMPT,r.NOT_APPLICABLE,r.ERROR].map(e=>({label:l(e.toLowerCase()),value:e})),O=[r.PASSED,r.FAILED,r.NOT_REPORTED].map(e=>{const t=l(e.toLowerCase());return{label:t,value:t}}),v=(e,t)=>{const s=["owners","systems"];if(e==="certificationStatuses")return`statuses: ${l(t.toLowerCase())}`;const a=e.replace(/s$/,"");return s.includes(e)?`${a}: ${b(t).name}`:e==="states"?`${a}: ${l(t.toLowerCase())}`:`${a}: ${t}`},p=w(()=>{const e=["numberOfDays","search","page","perPage"],t={owners:new Set,lifecycles:new Set,types:new Set,systems:new Set,states:new Set,certificationStatuses:new Set};for(const[s,a]of o.entries())if(!e.includes(s)){const i=a.split(",").map(n=>n.trim()).filter(Boolean);t[s]=new Set(i)}return t},[o]),S=B((e,t)=>{const s=new URLSearchParams(o),a=Array.from(t);a.length>0?s.set(e,a.join(",")):s.delete(e),u(s,{replace:!0})},[o,u]),T=Object.entries(p).flatMap(([e,t])=>Array.from(t).map(s=>({label:v(e,s),value:`${e}:${s}`}))),D=e=>{e.forEach(t=>{if(typeof t!="string")return;const[s,a]=t.split(/:(.+)/),i=p[s];if(!i)return;const n=new Set(i);n.delete(a),S(s,n)})},c=[{key:"owners",label:"Owner",options:g},{key:"lifecycles",label:"Lifecycle",options:F},{key:"types",label:"Type",options:$},{key:"systems",label:"System",options:C}];return E&&c.push({key:"states",label:"States",options:P}),d&&c.push({key:"certificationStatuses",label:"Status",options:O}),{filters:c,selected:p,setSelected:S,selectedTags:T,onRemoveTag:D}}export{x as useFilters};
|
|
2
2
|
//# sourceMappingURL=useFilters.esm.js.map
|
package/dist/routes.esm.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRouteRef as a,createSubRouteRef as e}from"@backstage/core-plugin-api";const c=a({id:"soundcheck-entity"}),i=a({id:"soundcheck-group"}),r=e({id:"soundcheck-entity-certification-track-redirect",parent:c,path:"/tracks/:trackId"}),n=e({id:"soundcheck-entity-certification",parent:c,path:"/tracks/:trackId/checks/:checkId"}),s=e({id:"soundcheck-entity-playlist-redirect",parent:c,path:"/playlists/:playlistId"}),
|
|
1
|
+
import{createRouteRef as a,createSubRouteRef as e}from"@backstage/core-plugin-api";const c=a({id:"soundcheck-entity"}),i=a({id:"soundcheck-group"}),r=e({id:"soundcheck-entity-certification-track-redirect",parent:c,path:"/tracks/:trackId"}),n=e({id:"soundcheck-entity-certification",parent:c,path:"/tracks/:trackId/checks/:checkId"}),s=e({id:"soundcheck-entity-playlist-redirect",parent:c,path:"/playlists/:playlistId"}),o=e({id:"soundcheck-entity-playlist-track-redirect",parent:c,path:"/playlists/:playlistId/tracks/:trackId"}),d=e({id:"soundcheck-entity-playlist-track-redirect",parent:c,path:"/playlists/:playlistId/tracks/:trackId/checks/:checkId"}),t=a({id:"soundcheck"}),h=e({id:"soundcheck-quickstart",parent:t,path:"/quickstart"}),p=e({id:"soundcheck-checks",parent:t,path:"/checks"}),k=e({id:"soundcheck-check-details",parent:t,path:"/checks/:checkId"}),u=e({id:"soundcheck-check-edit",parent:t,path:"/checks/:checkId/edit"}),R=e({id:"soundcheck-check-create",parent:t,path:"/checks/create"}),g=e({id:"soundcheck-check-templates",parent:t,path:"/checks/templates"}),l=e({id:"soundcheck-tracks",parent:t,path:"/tracks"}),f=e({id:"soundcheck-track-details",parent:t,path:"/tracks/:trackId"}),m=e({id:"soundcheck-track-edit",parent:t,path:"/tracks/:trackId/edit"}),I=e({id:"soundcheck-track-create",parent:t,path:"/tracks/create"}),y=e({id:"soundcheck-track-check-details",parent:t,path:"/tracks/:trackId/checks/:checkId"}),v=e({id:"soundcheck-campaigns",parent:t,path:"/campaigns"}),w=e({id:"soundcheck-campaign-details",parent:t,path:"/campaigns/:campaignId"}),P=e({id:"soundcheck-campaign-edit",parent:t,path:"/campaigns/:campaignId/edit"}),x=e({id:"soundcheck-campaign-create",parent:t,path:"/campaigns/create"}),E=e({id:"soundcheck-tech-health",parent:t,path:"/tech-health"}),C=e({id:"soundcheck-tech-insights",parent:t,path:"/tech-insights"}),D=e({id:"soundcheck-integrations-page",parent:t,path:"/integrations"}),T=e({id:"soundcheck-integration-details",parent:t,path:"/integrations/:integrationId"}),q=e({id:"soundcheck-integration-edit",parent:t,path:"/integrations/:integrationId/edit"}),O=e({id:"soundcheck-tech-insights-track",parent:t,path:"/tech-insights/track"}),b=e({id:"soundcheck-track-overview",parent:t,path:"/tracks/:trackId/overview"}),H=e({id:"soundcheck-track-explorer",parent:t,path:"/tracks/:trackId/explorer"}),S=e({id:"soundcheck-campaign-overview",parent:t,path:"/campaigns/:campaignId/overview"}),j=e({id:"soundcheck-campaign-explorer",parent:t,path:"/campaigns/:campaignId/explorer"}),z=e({id:"soundcheck-overview",parent:t,path:"/overview"});export{x as campaignCreateRouteRef,w as campaignDetailsRouteRef,P as campaignEditRouteRef,j as campaignExplorerRouteRef,S as campaignOverviewRouteRef,v as campaignsPageRouteRef,s as certificationPlaylistRouteRef,d as certificationPlaylistTrackCheckRouteRef,o as certificationPlaylistTrackRouteRef,n as certificationRouteRef,r as certificationTrackRouteRef,R as checkCreateRouteRef,k as checkDetailsRouteRef,u as checkEditRouteRef,g as checkTemplatesRouteRef,p as checksPageRouteRef,c as entityRootRouteRef,i as groupRootRouteRef,T as integrationDetailsRouteRef,q as integrationEditRouteRef,D as integrationsPageRouteRef,z as overviewRouteRef,h as quickstartRouteRef,t as rootRouteRef,E as techHealthRouteRef,C as techInsightsPageRouteRef,O as techInsightsTrackRouteRef,y as trackCheckDetailsRouteRef,I as trackCreateRouteRef,f as trackDetailsRouteRef,m as trackEditRouteRef,H as trackExplorerRouteRef,b as trackOverviewRouteRef,l as tracksPageRouteRef};
|
|
2
2
|
//# sourceMappingURL=routes.esm.js.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spotify/backstage-plugin-soundcheck",
|
|
3
3
|
"description": "Ensure quality, reliability and alignment of software development with codified checks and guidance.",
|
|
4
|
-
"version": "0.19.
|
|
4
|
+
"version": "0.19.5",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"homepage": "https://backstage.spotify.com",
|
|
7
7
|
"main": "./dist/index.esm.js",
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsxs as n,Fragment as b,jsx as e}from"react/jsx-runtime";import{useApi as t,featureFlagsApiRef as g,configApiRef as f}from"@backstage/core-plugin-api";import{usePermission as k}from"@backstage/plugin-permission-react";import{Tabs as v,TabList as x,Tab as i}from"@backstage/ui";import{makeStyles as w}from"@material-ui/core";import{soundcheckCollectorReadPermission as y}from"@spotify/backstage-plugin-soundcheck-common";const A=w(()=>({techHealth:{padding:"var(--bui-space-4) var(--bui-space-3) 0 var(--bui-space-4)"},overview:{padding:"var(--bui-space-4) var(--bui-space-3) 0 var(--bui-space-4)"},tabList:{display:"flex",flexDirection:"row","@media (max-width:768px)":{flexDirection:"column"},background:"var(--bui-bg-surface-1)",padding:"0 var(--bui-space-1)",margin:"0 var(--bui-space-2)",borderRadius:"var(--bui-space-1)",boxShadow:"1px 1px 1px var(--bui-bg-surface-2)"},tabs:{"& .bui-TabPanel":{paddingInline:"0 !important"},"@media (max-width:768px)":{"& .bui-TabActive":{display:"none"}}}})),S=({children:h})=>{const r=A(),c=t(g),d=t(f).getOptionalStringArray("soundcheck.flags"),s=c.getRegisteredFlags(),o=(!s.find(a=>a.name==="soundcheck-enable-tech-health")||c.isActive("soundcheck-enable-tech-health"))&&!d?.includes("soundcheck-disable-tech-health"),l=!s.find(a=>a.name==="soundcheck-enable-campaigns")||c.isActive("soundcheck-enable-campaigns"),{loading:p,allowed:u}=k({permission:y}),m=(!s.find(a=>a.name==="soundcheck-enable-collectors")||c.isActive("soundcheck-enable-collectors"))&&!p&&u;return n(b,{children:[e(v,{className:r.tabs,children:n(x,{className:r.tabList,children:[e(i,{id:"tech-insights",href:"/soundcheck/tech-insights",matchStrategy:"prefix",children:"Tech Insights"}),e(i,{id:"checks",href:"/soundcheck/checks",matchStrategy:"prefix",children:"Checks"}),e(i,{id:"tracks",href:"/soundcheck/tracks",matchStrategy:"prefix",children:"Tracks"}),l&&e(i,{id:"campaigns",href:"/soundcheck/campaigns",matchStrategy:"prefix",children:"Campaigns"}),m&&e(i,{id:"integrations",href:"/soundcheck/integrations",matchStrategy:"prefix",children:"Integrations"}),e(i,{id:"overview",href:"/soundcheck/overview",children:"Classic Overview"}),o&&e(i,{id:"tech-health",href:"/soundcheck/tech-health",children:"Tech Health"})]})}),h]})};export{S as RoutingMainMenu};
|
|
2
|
-
//# sourceMappingURL=RoutingMainMenu.esm.js.map
|