@spotify/backstage-plugin-soundcheck 0.19.9 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/dist/api.esm.js +1 -1
- package/dist/blueprints/IntegrationPageBlueprint.esm.js +1 -1
- package/dist/components/Alert/Alert.esm.js +2 -0
- package/dist/components/Badge/Badge.esm.js +2 -0
- package/dist/components/CampaignPage/CampaignPageBUI.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/Charts/chartUtils.esm.js +1 -1
- package/dist/components/CheckForm/FormFields/RuleInput/AddMenuButton.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/CheckPage/ExemptionsTableBUI.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/CollectorFactTableBUI.esm.js +1 -1
- package/dist/components/CollectorPage/Configurators/Common/FactCollectionConfig.esm.js +1 -1
- package/dist/components/CollectorPage/Configurators/SCM/ScmConfigurator.esm.js +1 -1
- package/dist/components/CollectorsPage/IntegrationsListPageBUI.esm.js +1 -1
- package/dist/components/ExpandableSection/ExpandableSection.esm.js +1 -1
- package/dist/components/Loading/Loading.esm.js +2 -0
- package/dist/components/RoutingPage/RoutingPageBUI.esm.js +1 -1
- package/dist/components/SoundcheckHeader/SoundcheckHeaderBUI.esm.js +1 -1
- package/dist/components/Stepper/Stepper.esm.js +2 -0
- package/dist/components/SummaryCard/SummaryCard.esm.js +1 -1
- package/dist/components/SummaryCard/SummaryCardActionsMenu.esm.js +1 -1
- package/dist/components/TechInsights/TechInsightsTableBUI.esm.js +1 -1
- package/dist/components/TechInsightsExplorerTable/TechInsightsExplorerTable.esm.js +1 -1
- package/dist/components/TimePeriodBar/TimePeriodBarBUI.esm.js +1 -1
- package/dist/components/TopFailingChecksTable/TopFailingChecksTableBUI.esm.js +1 -1
- package/dist/components/TrackBuilderPage/RunFirstCheckStep.esm.js +2 -0
- package/dist/components/TrackBuilderPage/SelectTracksStep.esm.js +2 -0
- package/dist/components/TrackBuilderPage/TrackBuilderPage.esm.js +2 -0
- package/dist/components/TrackBuilderPage/mockData.esm.js +2 -0
- package/dist/components/TrackPage/TrackEntitiesTable/TrackEntitiesTableBUI.esm.js +1 -1
- package/dist/components/TrackPage/TrackPageBUI.esm.js +1 -1
- package/dist/components/TracksPage/TracksListPageBUI.esm.js +1 -1
- package/dist/graphql/generated/index.esm.js +42 -46
- package/dist/hooks/filters/useFilters.esm.js +1 -1
- package/dist/routes.esm.js +1 -1
- package/dist/utils/charts.esm.js +1 -1
- package/dist/utils/facetFilters/types.esm.js +2 -0
- package/dist/utils/facetFilters/utils.esm.js +2 -0
- package/package.json +16 -16
- package/dist/components/Charts/BarChart/BarChart.esm.js +0 -2
- package/dist/components/Charts/BarChart/BarChartPlaceholder.esm.js +0 -2
- package/dist/components/Charts/BarChart/GroupPassRateHistoryBarChart.esm.js +0 -2
- package/dist/components/Charts/BarChart/TrackSummaryBarChart.esm.js +0 -2
- package/dist/components/Charts/ChartTypes.esm.js +0 -2
- package/dist/components/Charts/ChartWrapper/ChartWrapper.esm.js +0 -2
- package/dist/components/Charts/LineChart/EntityPassRateHistoryLineChart.esm.js +0 -2
- package/dist/components/Charts/LineChart/LineChart.esm.js +0 -2
- package/dist/components/Charts/LineChart/LineChartPlaceholder.esm.js +0 -2
- package/dist/components/Charts/LineChart/PassRateHistoryLineChart.esm.js +0 -2
- package/dist/components/Charts/LineChart/TableLineChart.esm.js +0 -2
- package/dist/components/Charts/LineChart/TrackPassRateHistoryLineChart.esm.js +0 -2
- package/dist/components/CheckHistoryChartCard/CheckHistoryChartCard.esm.js +0 -2
- package/dist/components/CollapsablePanel/CollapsablePanel.esm.js +0 -2
- package/dist/components/EntityPassRateCard/EntityPassRateCard.esm.js +0 -2
- package/dist/components/Expand/Expand.esm.js +0 -2
- package/dist/components/GroupPassRateCard/GroupPassRateCard.esm.js +0 -2
- package/dist/components/OverviewChartCard/OverviewChartCard.esm.js +0 -2
- package/dist/components/OverviewChartCard/OverviewChartCardStyles.esm.js +0 -2
- package/dist/components/PassRateGrid/PassRateGrid.esm.js +0 -2
- package/dist/components/PassRateGrid/PassRateMetadata.esm.js +0 -2
- package/dist/components/PassRateGrid/types.esm.js +0 -2
- package/dist/components/PassRateTable/NewPassRateTable.esm.js +0 -2
- package/dist/components/PassRateTable/PassRateTable.esm.js +0 -4
- package/dist/components/PassRateTable/types.esm.js +0 -2
- package/dist/components/SearchBar/SearchBar.esm.js +0 -2
- package/dist/components/TechHealth/Filters/FacetFilter.esm.js +0 -2
- package/dist/components/TechHealth/Filters/FilterProvider.esm.js +0 -2
- package/dist/components/TechHealth/Filters/Filters.esm.js +0 -2
- package/dist/components/TechHealth/Filters/FiltersHeader.esm.js +0 -2
- package/dist/components/TechHealth/Filters/FiltersSection.esm.js +0 -2
- package/dist/components/TechHealth/Filters/NumberOfDaysFilter.esm.js +0 -2
- package/dist/components/TechHealth/Filters/types.esm.js +0 -2
- package/dist/components/TechHealth/Filters/useFacetOptions.esm.js +0 -2
- package/dist/components/TechHealth/Filters/utils.esm.js +0 -2
- package/dist/components/TechHealth/Loading/Loading.esm.js +0 -2
- package/dist/components/TechHealth/Loading/TechHealthLoading.esm.js +0 -2
- package/dist/components/TechHealth/TechHealth.esm.js +0 -2
- package/dist/components/TechHealthSummary/SummaryAggregationsProvider.esm.js +0 -2
- package/dist/components/TechHealthSummary/TechHealthSummary.esm.js +0 -2
- package/dist/components/TechHealthTabs/ActionColumn.esm.js +0 -2
- package/dist/components/TechHealthTabs/CampaignResultsTab/CampaignResultsTab.esm.js +0 -2
- package/dist/components/TechHealthTabs/CheckResultsTab/CheckResultsTab.esm.js +0 -2
- package/dist/components/TechHealthTabs/CheckResultsTab/CheckTrendColumn.esm.js +0 -2
- package/dist/components/TechHealthTabs/EntityResultsTab/EntityResultsTab.esm.js +0 -2
- package/dist/components/TechHealthTabs/EntityResultsTab/EntityTrendColumn.esm.js +0 -2
- package/dist/components/TechHealthTabs/GroupResultsTab/GroupResultsTab.esm.js +0 -2
- package/dist/components/TechHealthTabs/GroupResultsTab/GroupTrendColumn.esm.js +0 -2
- package/dist/components/TechHealthTabs/MostRecentColumn.esm.js +0 -2
- package/dist/components/TechHealthTabs/NameColumn.esm.js +0 -2
- package/dist/components/TechHealthTabs/OwnerColumn.esm.js +0 -2
- package/dist/components/TechHealthTabs/PassRateTabHeader.esm.js +0 -2
- package/dist/components/TechHealthTabs/PassRateTabStyles.esm.js +0 -2
- package/dist/components/TechHealthTabs/TechHealthExportFunctions.esm.js +0 -2
- package/dist/components/TechHealthTabs/TrackResultsTab/TrackLevelTrendColumn.esm.js +0 -2
- package/dist/components/TechHealthTabs/TrackResultsTab/TrackResultsTab.esm.js +0 -2
- package/dist/components/TechHealthTabs/techHealthTabUtils.esm.js +0 -2
- package/dist/components/TrackHistoryChartCard/TrackHistoryChartCard.esm.js +0 -2
- package/dist/hooks/aggregations/useAggregatedCheckPassRateTrend.esm.js +0 -2
- package/dist/hooks/aggregations/useAggregatedEntityPassRateTrend.esm.js +0 -2
- package/dist/hooks/aggregations/useAggregatedGroupPassRateTrend.esm.js +0 -2
- package/dist/hooks/aggregations/useAggregatedTrackPassRateTrend.esm.js +0 -2
- package/dist/hooks/aggregations/useCheckPassRateTrend.esm.js +0 -2
- package/dist/hooks/aggregations/useEntityPassRateTrend.esm.js +0 -2
- package/dist/hooks/aggregations/useGroupPassRateTrend.esm.js +0 -2
- package/dist/hooks/aggregations/useTrackPassRateTrend.esm.js +0 -2
- package/dist/hooks/cache/useEntityCountCached.esm.js +0 -2
- package/dist/hooks/cache/useTrackCountCached.esm.js +0 -2
- package/dist/hooks/catalog/useGetEntityCount.esm.js +0 -2
- package/dist/hooks/entities/useEntityRefsForUser.esm.js +0 -2
- package/dist/hooks/facets/useFacetFilters.esm.js +0 -2
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsxs as o,jsx as t}from"react/jsx-runtime";import{Typography as n}from"@material-ui/core";import{makeStyles as s}from"@material-ui/core/styles";import{LineChart as c,CartesianGrid as d,XAxis as h,YAxis as p,Line as l}from"recharts";import{CARTESIAN_GRID_OPACITY as m,AXIS_DOMAIN as x}from"../ChartTypes.esm.js";import{ChartWrapper as y}from"../ChartWrapper/ChartWrapper.esm.js";const g=s(e=>({container:{position:"relative"},chartMessage:{position:"absolute",top:"50%",left:"50%",fontWeight:"bold",transform:"translate(-50%, -50%)",backgroundColor:e.palette.background.default,padding:e.spacing(1),borderRadius:"5px",textAlign:"center",width:"50%",zIndex:2}})),f=({height:e,text:a})=>{const i=[{x:"A",y:0},{x:"B",y:50},{x:"C",y:100}],r=g();return o("div",{className:r.container,children:[t(y,{height:e,children:o(c,{data:i,children:[t(d,{strokeDasharray:"3 3",vertical:!1,opacity:m}),t(h,{dataKey:"x",stroke:"#ccc",hide:!0}),t(p,{domain:x,stroke:"#ccc",hide:!0}),t(l,{type:"monotone",dataKey:"y",stroke:"#ccc",dot:!1})]})}),t(n,{className:r.chartMessage,children:a??"No Data"})]})};export{f as LineChartPlaceholder};
|
|
2
|
-
//# sourceMappingURL=LineChartPlaceholder.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsx as r}from"react/jsx-runtime";import{LineChart as s}from"./LineChart.esm.js";import{TableLineChart as o}from"./TableLineChart.esm.js";const i=({chartData:t,tableChart:e})=>{const a=[{dataKey:"passRate",name:"Pass rate"}];return e?r(o,{data:t,lines:a}):r(s,{data:t,lines:a})};export{i as PassRateHistoryLineChart};
|
|
2
|
-
//# sourceMappingURL=PassRateHistoryLineChart.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsx as t,jsxs as m}from"react/jsx-runtime";import{useTheme as d}from"@material-ui/core";import{ResponsiveContainer as s,LineChart as h,XAxis as p,YAxis as A,Line as C}from"recharts";import{CHART_DATA_KEY as l,AXIS_DOMAIN as T,LINE_CHART_TYPE as f}from"../ChartTypes.esm.js";import{getChartColors as x}from"../chartUtils.esm.js";const y=({data:i,lines:r})=>{const o=d(),a=x(o);return t(s,{height:50,width:100,children:m(h,{data:i,children:[t(p,{hide:!0,dataKey:l}),t(A,{width:0,domain:T}),r.map((e,n)=>t(C,{dataKey:e.dataKey,stroke:a[n%a.length],strokeWidth:2,dot:!1,name:e.name,type:f},e.dataKey))]})})};export{y as TableLineChart};
|
|
2
|
-
//# sourceMappingURL=TableLineChart.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsx as i}from"react/jsx-runtime";import{Typography as p}from"@material-ui/core";import{DateTime as f}from"luxon";import{useSummaryAggregationsContext as u}from"../../TechHealthSummary/SummaryAggregationsProvider.esm.js";import{formatDate as v}from"../chartUtils.esm.js";import{LineChart as h}from"./LineChart.esm.js";const l=e=>{const t=e?.overallTrackPassRate||[];if(!t.length)return[];const a=f.utc();return t.reduce((o,{trendPassRates:r,levelOrdinal:c},d)=>{const m=r?.map((n,s)=>({name:v(a,r.length-s-1),[`Level${c}`]:n}))??[];return d===0?m:o.map((n,s)=>({...n,...m[s]}))},[])},g=()=>{const{trackPassRateOverviewTrend:{data:e,isError:t}}=u();if(t)return i(p,{color:"error",children:"Failed to load track data."});const a=l(e),o=e?.overallTrackPassRate?.map(({levelOrdinal:r})=>({dataKey:`Level${r}`,name:`Level ${r}`}))??[];return i(h,{data:a,lines:o})};export{g as TrackPassRateHistoryLineChart,l as formatLineChartData};
|
|
2
|
-
//# sourceMappingURL=TrackPassRateHistoryLineChart.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsxs as C,jsx as o}from"react/jsx-runtime";import{makeStyles as g,useTheme as y,Box as x,Typography as v}from"@material-ui/core";import{CircularProgressbar as d,buildStyles as f}from"react-circular-progressbar";import{checkPassRatesSummaryCsvFilename as u}from"../../utils/charts.esm.js";import"recharts";import{convertPassRateToDataPoints as R}from"../Charts/ChartTypes.esm.js";import"../Charts/LineChart/LineChart.esm.js";import{getChartFontColor as m,getChartColors as k}from"../Charts/chartUtils.esm.js";import{PassRateHistoryLineChart as P}from"../Charts/LineChart/PassRateHistoryLineChart.esm.js";import"luxon";import{useSummaryAggregationsContext as T}from"../TechHealthSummary/SummaryAggregationsProvider.esm.js";import"@backstage/catalog-model";import"../Charts/BarChart/BarChart.esm.js";import{OverviewChartCard as S}from"../OverviewChartCard/OverviewChartCard.esm.js";import"../OverviewChartCard/OverviewChartCardStyles.esm.js";import"react-circular-progressbar/dist/styles.css";import{overallCheckPassRateToCsv as D}from"../TechHealthTabs/TechHealthExportFunctions.esm.js";const b=g(e=>({chartHeader:{marginBottom:e.spacing(2)},overallSummaryBox:{display:"flex",flexDirection:"column",height:"100%",color:m(e),textAlign:"center",gap:e.spacing(2)},percentage:{fontSize:e.typography.pxToRem(65),lineHeight:`${e.typography.pxToRem(88)}px`,fontWeight:"bold"},summaryText:{fontSize:e.typography.pxToRem(14),lineHeight:`${e.typography.pxToRem(14)}px`}})),H=()=>{const e=y(),i=b(),{checkPassRateTrend:{data:t,isLoading:l,isError:p}}=T(),r=t?.overallCheckPassRates?.length??0,c=R(t?.overallCheckPassRates??[]),a=r?t?.overallCheckPassRates?.[r-1]:void 0;let s;a?s=`${a}%`:s="No Data";const n=C(x,{className:i.overallSummaryBox,children:[o(d,{value:a??0,text:s,styles:f({textColor:m(e),pathColor:k(e)[0],trailColor:e.palette.divider,textSize:r?void 0:8})}),o(v,{className:i.summaryText,children:"Current check pass rate"})]}),h=!t?.overallCheckPassRates||!r||l||p;return o(S,{title:"Check pass rate",subtitle:"Aggregate pass rate for checks",summaryCardContent:n,chartSectionContent:o(P,{chartData:c}),disableDataExport:h,csvFilename:u,csvData:D(t)})};export{H as CheckHistoryChartCard};
|
|
2
|
-
//# sourceMappingURL=CheckHistoryChartCard.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsxs as o,jsx as e}from"react/jsx-runtime";import{makeStyles as f,Box as i,Typography as h,Tooltip as x,Icon as y,IconButton as I}from"@material-ui/core";import b from"@material-ui/icons/ArrowDropDown";import u from"@material-ui/icons/ArrowDropUp";import g from"@material-ui/icons/HelpOutline";import v from"../Expand/Expand.esm.js";const D=f(({palette:l})=>({header:{display:"flex",alignItems:"left",flexDirection:"row",cursor:"pointer",justifyContent:"space-between"},label:{display:"flex",alignItems:"center"},tooltipIcon:{display:"flex",alignItems:"center",justifyContent:"center",color:l.text.primary}})),E=({label:l,tooltip:r,isExpanded:a,setIsExpanded:p,children:d,onExpandDone:m=()=>{}})=>{const n=D(),s=()=>{p(t=>!t)},c=t=>{(t.key==="Enter"||t.key===" ")&&s()};return o(i,{children:[o("div",{className:n.header,onClick:s,onKeyDown:c,role:"button",tabIndex:0,children:[o("div",{className:n.label,children:[e(i,{children:e(h,{variant:"subtitle2",children:l})}),r&&e(x,{title:r,className:n.tooltipIcon,children:e(y,{children:e(g,{style:{fontSize:16,verticalAlign:"text-top"}})})})]}),e(i,{children:e(I,{size:"small",onKeyDown:c,children:a?e(u,{fontSize:"small"}):e(b,{fontSize:"small"})})})]}),e(v,{visible:a,onExpandDone:m,children:d})]})};export{E as CollapsablePanel};
|
|
2
|
-
//# sourceMappingURL=CollapsablePanel.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{entityPassRatesSummaryCsvFilename as o}from"../../utils/charts.esm.js";import"recharts";import"../Charts/ChartTypes.esm.js";import"../Charts/LineChart/LineChart.esm.js";import"@material-ui/core";import"../Charts/chartUtils.esm.js";import"luxon";import{useSummaryAggregationsContext as m}from"../TechHealthSummary/SummaryAggregationsProvider.esm.js";import{EntityPassRateHistoryLineChart as n}from"../Charts/LineChart/EntityPassRateHistoryLineChart.esm.js";import"../Charts/BarChart/BarChart.esm.js";import"@backstage/catalog-model";import{OverviewChartCard as p}from"../OverviewChartCard/OverviewChartCard.esm.js";import"../OverviewChartCard/OverviewChartCardStyles.esm.js";import{overallEntityPassRatesToCsv as l}from"../TechHealthTabs/TechHealthExportFunctions.esm.js";const y=()=>{const{entityPassRatesOverviewTrends:{data:t,isLoading:r,isError:s}}=m(),a=t?.overallEntityPassRates?.length,i=!t?.overallEntityPassRates||!a||r||s;return e(p,{title:"Entity pass rate",subtitle:"By default, this chart shows the top 5 entities by pass rate for all teams with which you are associated. To see a different set of entities, use the filters.",chartSectionContent:e(n,{}),disableDataExport:i,csvFilename:o,csvData:l(t)})};export{y as EntityPassRateCard};
|
|
2
|
-
//# sourceMappingURL=EntityPassRateCard.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";import{motion as a}from"framer-motion";const d={hidden:{height:0,opacity:0,overflow:"hidden"},visible:{height:"auto",opacity:1,overflow:"visible"}};function r({visible:o,onExpandDone:i,...e}){return t(a.div,{...e,animate:o?"visible":"hidden",initial:"hidden",variants:d,onAnimationComplete:n=>{n==="visible"&&i&&i()}})}export{r as default};
|
|
2
|
-
//# sourceMappingURL=Expand.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";import{groupPassRatesSummaryCsvFilename as m}from"../../utils/charts.esm.js";import"recharts";import"../Charts/ChartTypes.esm.js";import"../Charts/LineChart/LineChart.esm.js";import"@material-ui/core";import"../Charts/chartUtils.esm.js";import"luxon";import{useSummaryAggregationsContext as i}from"../TechHealthSummary/SummaryAggregationsProvider.esm.js";import"@backstage/catalog-model";import"../Charts/BarChart/BarChart.esm.js";import{GroupPassRateHistoryBarChart as p}from"../Charts/BarChart/GroupPassRateHistoryBarChart.esm.js";import{OverviewChartCard as g}from"../OverviewChartCard/OverviewChartCard.esm.js";import"../OverviewChartCard/OverviewChartCardStyles.esm.js";import{overallGroupPassRatesToCsv as n}from"../TechHealthTabs/TechHealthExportFunctions.esm.js";const u=()=>{const{groupPassRatesOverviewTrends:{data:r,isLoading:a,isError:o}}=i(),s=r?.groupPassRates?.edges.length,e=!r?.groupPassRates||!s||a||o;return t(g,{title:"Team pass rate",subtitle:"Compare the aggregate pass rate for teams",chartSectionContent:t(p,{}),disableDataExport:e,csvFilename:m,csvData:n(r)})};export{u as GroupPassRateCard};
|
|
2
|
-
//# sourceMappingURL=GroupPassRateCard.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsxs as t,jsx as e}from"react/jsx-runtime";import{Card as h,Box as r,Typography as n,Tooltip as p,Button as C}from"@material-ui/core";import N from"@material-ui/icons/GetApp";import{CSVLink as S}from"react-csv";import{useOverviewChartCardStyles as f}from"./OverviewChartCardStyles.esm.js";const v=({title:l,subtitle:o,summaryCardContent:i,chartSectionContent:s,disableDataExport:c,csvData:d,csvFilename:m})=>{const a=f();return t(h,{className:a.card,children:[t(r,{className:a.headerRow,children:[t(r,{className:a.headerSection,children:[e(n,{className:a.title,children:l}),e(n,{variant:"caption",children:o})]}),e(r,{className:a.headerExportSection,children:e(S,{data:d,filename:m,onClick:()=>!c,children:e(p,{title:"Export to CSV",children:e("span",{children:e(C,{disabled:c,children:e(N,{})})})})})})]}),t(r,{className:a.contentRow,children:[i&&e(r,{className:a.leftSection,children:e(r,{className:a.summaryCard,children:i})}),e(r,{className:a.chartSection,children:s})]})]})};export{v as OverviewChartCard};
|
|
2
|
-
//# sourceMappingURL=OverviewChartCard.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{makeStyles as t}from"@material-ui/core/styles";const i=t(e=>({card:{display:"flex",flexDirection:"column",gap:e.spacing(1),border:`1px solid ${e.palette.divider}`,boxShadow:"none",width:"99%"},title:{fontWeight:"bold",fontSize:e.typography.h5.fontSize,lineHeight:`${e.typography.h3.fontSize}px`},subtitle:{fontSize:e.typography.pxToRem(14),lineHeight:`${e.typography.h6.fontSize}px`,color:e.palette.grey[800]},headerRow:{display:"flex",padding:e.spacing(1,2),borderBottom:`1px solid ${e.palette.divider}`,gap:e.spacing(2)},headerSection:{display:"flex",flexDirection:"column",gap:e.spacing(.5)},headerExportSection:{display:"flex",alignItems:"center",marginLeft:"auto",marginRight:0},contentRow:{padding:e.spacing(2.5,2),display:"flex",gap:e.spacing(2)},leftSection:{width:"200px"},summaryCard:{height:"100%",display:"flex",flexDirection:"column",justifyContent:"space-between"},chartSection:{flex:1,width:"100%",minWidth:"200px"},chartDisplaySummary:{flex:1,display:"flex",flexDirection:"row",gap:e.spacing(1),alignItems:"center",justifyContent:"end"}}));export{i as useOverviewChartCardStyles};
|
|
2
|
-
//# sourceMappingURL=OverviewChartCardStyles.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsxs as i,jsx as e}from"react/jsx-runtime";import{Box as r,Grid as n,TablePagination as P}from"@material-ui/core";import{makeStyles as f}from"@material-ui/core/styles";import{useNavigate as C}from"react-router-dom";import"recharts";import"../Charts/ChartTypes.esm.js";import{LineChart as x}from"../Charts/LineChart/LineChart.esm.js";import"../Charts/chartUtils.esm.js";import"luxon";import"../TechHealthSummary/SummaryAggregationsProvider.esm.js";import"@backstage/catalog-model";import"../Charts/BarChart/BarChart.esm.js";import{SummaryCard as w}from"../SummaryCard/SummaryCard.esm.js";import{PassRateMetadata as u}from"./PassRateMetadata.esm.js";const R=f(t=>({root:{display:"flex",flexDirection:"column",width:"100%"},gridContainer:{flexGrow:1},cardContent:{display:"flex",flexDirection:"column",gap:t.spacing(1),height:"100%"},footer:{display:"flex",flexDirection:"column",gap:t.spacing(1),justifyContent:"end",marginTop:"auto"}})),y=({data:t,totalCount:s,rowsPerPage:m,page:l,onPageChange:p,onRowsPerPageChange:d})=>{const o=R(),g=C(),c=[{dataKey:"passRate",name:"Pass rate"}];return i(r,{className:o.root,children:[e(n,{container:!0,spacing:2,className:o.gridContainer,children:t.map((a,h)=>e(n,{item:!0,xs:12,sm:12,md:6,lg:4,xl:3,children:e(w,{title:a.name??a.id,description:a.description,children:e(r,{className:o.cardContent,children:i(r,{className:o.footer,children:[e(u,{ownerEntityRef:a.owner,passRates:a.lineChart.snapshotPassRates}),e(x,{data:a.lineChart.trendPassRates,lines:a.lineChart.lineConfigs??c,height:150})]})}),handleView:()=>a.navigateTo?g(a.navigateTo):void 0})},h))}),e(P,{rowsPerPageOptions:[10,25,50],component:"div",count:s,rowsPerPage:m,page:l,onPageChange:p,onRowsPerPageChange:d,labelRowsPerPage:"Items per page:"})]})};export{y as PassRateGrid};
|
|
2
|
-
//# sourceMappingURL=PassRateGrid.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsxs as i,jsx as t}from"react/jsx-runtime";import{EntityRefLink as f}from"@backstage/plugin-catalog-react";import{makeStyles as y,List as N,Typography as o,ListItem as a,Tooltip as l,ListItemIcon as m,ListItemText as c}from"@material-ui/core";import x from"@material-ui/icons/Group";import L from"@material-ui/icons/TrendingDown";import g from"@material-ui/icons/TrendingFlat";import T from"@material-ui/icons/TrendingUp";import{Trend as s}from"./types.esm.js";const R=y(r=>({cardSection:{marginBottom:r.spacing(2)},listItem:{padding:0},listItemText:{margin:0},listItemIcon:{marginRight:r.spacing(1),minWidth:0},ownerLink:{"& span":{"&:hover":{textDecoration:"underline"}}}})),S=({ownerEntityRef:r,passRates:d})=>{const e=R();return i(N,{dense:!0,disablePadding:!0,className:e.cardSection,children:[t(o,{variant:"overline",color:"textSecondary",children:"Details"}),r&&i(a,{disableGutters:!0,className:e.listItem,children:[t(l,{title:"Owner",children:t(m,{className:e.listItemIcon,children:t(x,{color:"inherit",fontSize:"small"})})}),t(c,{className:e.listItemText,primary:t(f,{className:e.ownerLink,entityRef:r??"No Owner",hideIcon:!0})})]}),d.map(({name:h,value:p,trend:n},I)=>i(a,{disableGutters:!0,className:e.listItem,children:[t(l,{title:"The most recent pass rate.",children:i(m,{className:e.listItemIcon,children:[n===s.UP&&t(T,{color:"inherit",fontSize:"small"}),n===s.DOWN&&t(L,{color:"inherit",fontSize:"small"}),n===s.FLAT&&t(g,{color:"inherit",fontSize:"small"})]})}),t(c,{className:e.listItemText,primary:i(o,{variant:"body2",color:"textPrimary",children:[h??"Latest Pass Rate",": ",i("b",{children:[Math.round(p),"%"]})]})})]},I))]})};export{S as PassRateMetadata};
|
|
2
|
-
//# sourceMappingURL=PassRateMetadata.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsxs as d,jsx as e}from"react/jsx-runtime";import{Paper as g,Table as m,TableHead as P,TableRow as i,TableCell as s,TableBody as C,TablePagination as w}from"@material-ui/core";import{makeStyles as T}from"@material-ui/core/styles";const u=T(r=>({paper:{width:"100%",boxShadow:"none",border:`1px solid ${r.palette.divider}`,borderRadius:r.shape.borderRadius},tableHeaderCell:{fontWeight:"bold"}})),R=({data:r,totalCount:t,columns:o,rowsPerPage:p,page:c,onPageChange:h,onRowsPerPageChange:b})=>{const n=u();return d(g,{className:n.paper,children:[d(m,{size:"small",children:[e(P,{children:e(i,{children:o.map(a=>e(s,{className:n.tableHeaderCell,children:a.label},`header-${a.id}`))})}),e(C,{children:r.map(a=>e(i,{children:o.map(l=>e(s,{children:l.renderCell?l.renderCell(a):a[l.id]},`cell-${l.id}`))},a.id))})]}),e(w,{rowsPerPageOptions:[10,25,50],count:t,component:"div",rowsPerPage:p,page:c,onPageChange:h,onRowsPerPageChange:b})]})};export{R as NewPassRateTable};
|
|
2
|
-
//# sourceMappingURL=NewPassRateTable.esm.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{jsx as r,jsxs as p}from"react/jsx-runtime";import{Paper as y,Table as R,TableHead as S,TableRow as h,TableCell as u,TableBody as $,TablePagination as H}from"@material-ui/core";import{makeStyles as N}from"@material-ui/core/styles";import{useState as b,useEffect as j}from"react";import"@backstage/catalog-model";import"@backstage/core-plugin-api";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{useGetChecks as L}from"../../hooks/checks/useGetChecks.esm.js";import"../../hooks/useSoundcheckAlert.esm.js";import"../../hooks/useConfirmationModal.esm.js";import"react-router-dom";import"react-use/lib/useLocalStorage";import{Loading as z}from"../TechHealth/Loading/Loading.esm.js";const B=N(o=>({paper:{width:"100%",boxShadow:"none",border:`1px solid ${o.palette.divider}`,borderRadius:o.shape.borderRadius},tableHeaderCell:{fontWeight:"bold"}})),D=({data:o,columns:d,showsCheckData:n})=>{const l=B(),[s,a]=b(0),[t,f]=b(10),{data:g,isLoading:C}=L({ids:n?o.map(e=>e.id):[]});if(j(()=>{a(0)},[o.length]),C)return r(z,{});const w=(e,i)=>{a(i)},P=e=>{f(+e.target.value),a(0)},m=s*t,T=m+t,k=e=>`Cannot view detail: Check exists in results data only. That is, a check
|
|
2
|
-
with the id '${e}' is not defined in any yaml files nor was such a
|
|
3
|
-
check created through Soundcheck's UI.`,v=(e,i)=>{if(!e.renderCell)return i[e.id];if(e.id==="action"&&n){const c=g?.edges.find(x=>x.node.id===i.id)!==void 0;return e.renderCell(i,!c,c?void 0:k(i.id))}return e.renderCell(i)};return p(y,{className:l.paper,children:[p(R,{size:"small",children:[r(S,{children:r(h,{children:d.map(e=>r(u,{className:l.tableHeaderCell,children:e.label},`header-${e.id}`))})}),r($,{children:o.slice(m,T).map(e=>r(h,{children:d.map(i=>r(u,{children:v(i,e)},`cell-${i.id}`))},e.id))})]}),r(H,{rowsPerPageOptions:[10,25,50],component:"div",count:o.length,rowsPerPage:t,page:s,onPageChange:w,onRowsPerPageChange:P})]})};export{D as PassRateTable};
|
|
4
|
-
//# sourceMappingURL=PassRateTable.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{makeStyles as h,TextField as u,InputAdornment as c,IconButton as f}from"@material-ui/core";import g from"@material-ui/icons/Close";import x from"@material-ui/icons/Search";import{useRef as B,useEffect as I}from"react";const y=h(r=>({searchIcon:{opacity:".5"},clearButton:{height:"36px",width:"36px"},searchBar:{color:r.palette.text.primary,paddingLeft:r.spacing(1)},iconWrapper:{marginLeft:0}})),N=({searchTerm:r,setSearchTerm:o,showClear:s=!0,placeholder:i="Search...",disabled:a,...l})=>{const t=y(),n=B(null);I(()=>{!a&&n.current&&n.current.focus()},[a]);const p=m=>{o(m.target.value)},d=()=>{o("")};return e(u,{...l,disabled:a,inputRef:n,fullWidth:!0,placeholder:i,value:r,onChange:p,InputProps:{className:t.searchBar,startAdornment:e(c,{className:t.iconWrapper,position:"start",children:e(x,{className:t.searchIcon,"data-testid":"search-icon"})}),endAdornment:s&&r?e(c,{position:"end",children:e(f,{edge:"end",onClick:d,className:t.clearButton,children:e(g,{})})}):null}})};export{N as SearchBar};
|
|
2
|
-
//# sourceMappingURL=SearchBar.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsx as n,jsxs as S}from"react/jsx-runtime";import{makeStyles as L,alpha as y,Box as h,Chip as I,TextField as O,FormControlLabel as w,Checkbox as z}from"@material-ui/core";import E from"@material-ui/icons/CheckBox";import T from"@material-ui/icons/CheckBoxOutlineBlank";import{Autocomplete as j}from"@material-ui/lab";import{remove as N}from"lodash";import{useState as m,useEffect as V,useCallback as g,useMemo as W}from"react";import{CollapsablePanel as B}from"../../CollapsablePanel/CollapsablePanel.esm.js";import{ListboxVirtualized as D}from"../../ListboxVirtualized/ListboxVirtualized.esm.js";import{useFilterContext as H}from"./FilterProvider.esm.js";import{Facet as b,facetTooltips as P}from"./types.esm.js";const $=L(({palette:e,spacing:o})=>({chip:{maxWidth:"45%",textOverflow:"ellipsis",margin:o(.5,.5,.5,0),overflow:"hidden","& svg":{color:y(e.common.white,.7),"&:hover":{color:e.common.white}},backgroundColor:e.action.disabledBackground},autoCompleteInput:{"&& input":{margin:o(1,0,0,0),padding:`${o(0,1,1,1)} !important`,width:"100%",display:"flex",alignItems:"center",justifyContent:"center"},"&& button":{"&:hover":{backgroundColor:"transparent"}}},autoComplete:{margin:o(.5,0,1,0)},selectionLabel:{lineHeight:"1em"}})),q=({facet:e})=>{const o=$(),{getFacetOptions:C,getFacetOptionLabel:r,getSelectedFacetValues:i,setSelectedFacetValues:p}=H(),[x,d]=m(!1),[k,u]=m(!1),[F,f]=m("");V(()=>{d(!!i(e)?.length)},[i,e]);const s=g(t=>{if(e===b.Entity&&t[t.length-1]){const l=t[t.length-1];if(!l.includes(":")||!l.includes("/")){u(!0),f("Custom entities require a valid kind and namespace such as: component:default/entity");return}}u(!1),f(""),p(e,t)},[e,p]),a=W(()=>i(e),[e,i]),v=g(t=>{const l=[...a];N(l,c=>c===t),s(l)},[a,s]);return n(B,{label:e,tooltip:P[e],isExpanded:x,setIsExpanded:d,children:S(h,{children:[n(h,{children:a.map(t=>n(I,{label:r(e,t),size:"small",className:o.chip,onDelete:()=>v(t),clickable:!1},t))}),n(j,{className:o.autoComplete,disableCloseOnSelect:!0,fullWidth:!0,multiple:!0,freeSolo:e===b.Entity,popupIcon:null,renderTags:()=>null,options:C(e),getOptionLabel:t=>r(e,t),value:a,onChange:(t,l)=>s(l),ListboxComponent:D,ListboxProps:{itemHeight:50},renderInput:t=>n(O,{...t,className:o.autoCompleteInput,placeholder:`Search for ${e}`,error:k,helperText:F}),renderOption:(t,{selected:l})=>n(w,{onClick:c=>c.preventDefault(),control:n(z,{icon:n(T,{fontSize:"small"}),checkedIcon:n(E,{fontSize:"small"}),checked:l}),classes:{label:o.selectionLabel},label:r(e,t)})})]})})};export{q as FacetFilter};
|
|
2
|
-
//# sourceMappingURL=FacetFilter.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsx as F}from"react/jsx-runtime";import{parseEntityRef as L}from"@backstage/catalog-model";import{humanizeEntityRef as S}from"@backstage/plugin-catalog-react";import{createFilterOptions as U}from"@material-ui/lab/Autocomplete";import{createContext as V,useCallback as h,useMemo as E,useContext as M}from"react";import R from"react-use/lib/useLocalStorage";import{useLoggedInUser as T}from"../../../contexts/UserProvider.esm.js";import{useFacetFilters as k}from"../../../hooks/facets/useFacetFilters.esm.js";import{TechHealthLoading as A}from"../Loading/TechHealthLoading.esm.js";import{useFacetOptions as C}from"./useFacetOptions.esm.js";import{emptyFacetFilters as N,DEFAULT_NUMBER_OF_DAYS as w,mapFacetFiltersToFilter as I}from"./utils.esm.js";const m=V({facetOptionsLoading:!1,getFacetOptions:()=>[],getFacetOptionLabel:()=>"",facetFilters:N(),clearAllFilters:()=>{},getSelectedFacetValues:()=>[],setSelectedFacetValues:()=>{},setManySelectedFacetValues:()=>{},numberOfDays:w,setNumberOfDays:()=>{},filter:{},loggedInUser:"Unknown"}),_=()=>M(m),f=l=>{const{userEntityRef:c,loading:u}=T(),{isLoading:n,facetOptions:r}=C(),[p]=R("soundcheck.overview.groupRef",null),{facetFilters:a,numberOfDays:o,setFacetFilter:d,setManyFacetFilters:g,getFacetFilter:O,clearFacetFilters:y,setNumberOfDays:b}=k(r,p??void 0),v=h(e=>r[e].map(({value:t})=>t),[r]),x=E(()=>I(r,a,o,c),[a,r,o,c]),D={facetOptionsLoading:n,getFacetOptions:v,getFacetOptionLabel:(e,t)=>{let s=r[e].find(i=>i.value===t)?.label;if(!s)try{const i=L(t);s=S(i)}catch{}return U(),s??t},facetFilters:a,clearAllFilters:y,getSelectedFacetValues:e=>O(e),setSelectedFacetValues:(e,t)=>{d(e,t)},setManySelectedFacetValues:(e,t)=>{g(e,t)},numberOfDays:o,setNumberOfDays:b,filter:x??{},loggedInUser:"Unknown"};return n||u?F(A,{loadingText:l.loadingText}):F(m.Provider,{...l,value:D})};export{f as FilterProvider,f as default,_ as useFilterContext};
|
|
2
|
-
//# sourceMappingURL=FilterProvider.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsxs as l,jsx as e}from"react/jsx-runtime";import{makeStyles as c,Box as n}from"@material-ui/core";import{useLocation as p}from"react-router-dom";import{FacetFilter as f}from"./FacetFilter.esm.js";import{FiltersHeader as d}from"./FiltersHeader.esm.js";import{FiltersSection as o}from"./FiltersSection.esm.js";import{NumberOfDaysFilter as u}from"./NumberOfDaysFilter.esm.js";import{Facet as a}from"./types.esm.js";const h=c(t=>({filters:{maxWidth:"300px",width:"100%",backgroundColor:t.palette.background.paper}})),F=()=>{const t=h(),m=p().pathname.includes("campaigns");let i=Object.values(a);if(m){const r=[a.Track,a.Level];i=i.filter(s=>!r.includes(s))}return l(n,{className:t.filters,children:[e(o,{isHeader:!0,children:e(d,{})}),e(o,{children:e(u,{})}),i.map(r=>e(o,{size:"small",children:e(f,{facet:r})},r))]})};export{F as Filters};
|
|
2
|
-
//# sourceMappingURL=Filters.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsxs as c,jsx as t}from"react/jsx-runtime";import{makeStyles as m,Box as i,Typography as p,Button as d}from"@material-ui/core";import{useFilterContext as h}from"./FilterProvider.esm.js";import{Facet as r}from"./types.esm.js";import{DEFAULT_NUMBER_OF_DAYS as g}from"./utils.esm.js";const f=m(e=>({root:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},clearButton:{lineHeight:e.typography.caption.lineHeight,fontSize:e.typography.caption.fontSize,padding:e.spacing(1),margin:e.spacing(2),marginBottom:e.spacing(2)-1},hidden:{visibility:"hidden"},headerText:{marginLeft:e.spacing(3)}}));function y(){const e=f(),{numberOfDays:n,facetFilters:a,clearAllFilters:o}=h(),l=Object.keys(r).some(s=>a[r[s]].length)||n!==g;return c(i,{className:e.root,children:[t(i,{className:e.headerText,children:t(p,{variant:"h6",children:"Filters"})}),t(i,{children:t(d,{className:l?e.clearButton:`${e.clearButton} ${e.hidden}`,onClick:o,size:"small",variant:"outlined",color:"primary",children:"Clear all"})})]})}export{y as FiltersHeader};
|
|
2
|
-
//# sourceMappingURL=FiltersHeader.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsx as s}from"react/jsx-runtime";import{makeStyles as t,Box as d}from"@material-ui/core";const a=t(({palette:i,spacing:e})=>({root:{padding:({size:r,isHeader:o})=>o?0:r==="small"?e(1.5,2):e(2),borderBottom:`1px solid ${i.divider}`}}));function l({children:i,size:e,isHeader:r}){const o=a({size:e,isHeader:r});return s(d,{className:o.root,children:i})}export{l as FiltersSection};
|
|
2
|
-
//# sourceMappingURL=FiltersSection.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsxs as v,jsx as n}from"react/jsx-runtime";import{makeStyles as $,Box as m,Chip as N,TextField as B}from"@material-ui/core";import{useState as d}from"react";import{useFilterContext as D}from"./FilterProvider.esm.js";import{MIN_NUMBER_OF_DAYS as r,MAX_NUMBER_OF_DAYS as l}from"./utils.esm.js";const M=$(t=>({select:{width:"100%",margin:t.spacing(1,0)},chipPadding:{marginBottom:t.spacing(1)},chipSelected:{border:`1px solid ${t.palette.text.primary}`}})),u=[7,30,90].map(t=>({value:t,label:`Last ${t} days`}));function S(){const t=M(),{numberOfDays:s,setNumberOfDays:p}=D(),c=[...u];u.map(e=>e.value).includes(s)||c.push({value:s,label:`Last ${s} days`});const[f,h]=d(c),[i,o]=d(""),y=()=>{if(i.length){const e=parseInt(i,10);return!isNaN(e)&&(e<r||e>l)}return!1},b=()=>{const e=parseInt(i,10);if(e<r)return`Minimum of ${r} days`;if(e>l)return`Maximum of ${l} days`},x=e=>{if(e.key==="Enter"){const a=parseInt(i,10);a>=r&&a<=l?(u.map(g=>g.value).includes(a)||h([...u,{value:a,label:`Last ${a} days`}]),p(a),o("")):a<r?o(`${r}`):o(`${l}`)}};return v(m,{children:[n(m,{marginBottom:1,children:n(m,{children:f.sort((e,a)=>e.value-a.value).map(({label:e,value:a})=>n(N,{label:e,className:`${t.chipPadding} ${s===a?t.chipSelected:""}`,size:"small",onClick:()=>p(a)},a))})}),n(m,{children:n(B,{fullWidth:!0,placeholder:"Number of days",inputProps:{min:r,max:l},onKeyDown:x,helperText:b(),value:i,type:"number",error:y(),onChange:e=>o(e.target.value)})})]})}export{S as NumberOfDaysFilter};
|
|
2
|
-
//# sourceMappingURL=NumberOfDaysFilter.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var t=(e=>(e.Entity="Entity",e.Kind="Entity Kind",e.Type="Entity Type",e.EntityOwner="Entity Owner",e.Lifecycle="Entity Lifecycle",e.System="System",e.Track="Track",e.Level="Track Level",e.Check="Check",e.CheckOwner="Check Owner",e))(t||{});const i={Entity:"Entities are software components, like a system, service, or library. They are the entities/components that Soundcheck runs checks against. Choosing entities will filter the results to only show those that are associated with the selected entity/entities.","Entity Kind":"The 'kind' of the Entity as defined by Catalog, e.g. Component, System, User, Group, etc. This will filter results to only show those for Entities with the selected kind(s).","Entity Type":"The type of Entity as defined by Catalog, e.g. Database, Team, Service, Website, etc. This will filter results to only show those related to Entities with the selected type(s).","Entity Owner":"The owner of the Entity, typically a team or and individual. This will filter results to only those Entities that are owned by the selected owner(s).","Entity Lifecycle":"The lifecycle of the entity: e.g. experimental, production, etc. This will filter results to only show those related to Entities with the selected lifecycle(s).",System:"This System filter will filter results to only show those for Entities that are part of the selected System(s).",Track:"This Track filter will filter results to only show those related to the selected Track(s).","Track Level":"This Track level filter will filter results to only show those related to the selected Track level(s).",Check:"This Check filter will filter results to only show those related to the selected Check(s).","Check Owner":"The owner of the Check, typically a team or an individual. This will limit results to only be results from Checks that are owned by the selected owner(s)."};export{t as Facet,i as facetTooltips};
|
|
2
|
-
//# sourceMappingURL=types.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{parseEntityRef as T}from"@backstage/catalog-model";import C from"lodash";import{useState as $,useMemo as l,useEffect as A}from"react";import"../../../contexts/TrackFormContext.esm.js";import"../../../contexts/CheckFormContext.esm.js";import"../../../contexts/CampaignFormContext.esm.js";import"react/jsx-runtime";import{useLoggedInUser as S}from"../../../contexts/UserProvider.esm.js";import"@backstage/core-plugin-api";import"@tanstack/react-query";import"../../../api.esm.js";import"../../../hooks/graphqlKeys.esm.js";import{useAllGroups as x}from"../../../hooks/groups/useAllGroups.esm.js";import"@backstage/plugin-catalog-react";import"@spotify/backstage-plugin-soundcheck-common";import{useGetChecks as U}from"../../../hooks/checks/useGetChecks.esm.js";import"../../../hooks/useSoundcheckAlert.esm.js";import{useGetAllTracks as q}from"../../../hooks/tracks/useGetAllTracks.esm.js";import"../../../hooks/useConfirmationModal.esm.js";import"react-router-dom";import"react-use/lib/useLocalStorage";import{useGetEntityFacets as f}from"../../../hooks/catalog/useGetEntityFacets.esm.js";import{useEntityRefsForUser as B}from"../../../hooks/entities/useEntityRefsForUser.esm.js";import{Facet as s}from"./types.esm.js";const I=(i,o)=>{const a=[];for(const r of i)a.push({label:r.name??r.id,value:r.id});const e=i.map(r=>r.id);for(const r of o)for(const m of r.levels??[])for(const n of m.checks??[])e.includes(n.id)||(e.push(n.id),a.push({label:n.name??n.id,value:n.id}));return a},K=i=>{const o=[];for(const a of i??[])for(const e of a.levels??[])o.includes(e.ordinal)||o.push(e.ordinal);return o.sort().map(a=>({label:`Level ${a}`,value:`${a}`}))},M=(i,o)=>{const a=new Set(i.filter(e=>e.ownerEntityRef).map(e=>e.ownerEntityRef));return Array.from(a).map(e=>({label:o[e]??e,value:e}))},d=i=>(i??[]).map(o=>({label:o,value:o})),V=()=>{const[i,o]=$(!1),{userEntityRef:a}=S(),{data:e,isLoading:r}=B(a),{data:m,isLoading:n}=x(),u=l(()=>C.mapValues(C.keyBy(m??[],"ref"),t=>t.name),[m]),{data:y,isLoading:g}=q({first:100}),p=l(()=>y?.edges.map(t=>t.node)??[],[y]),{data:L,isLoading:v}=U({first:100}),c=l(()=>L?.edges.map(t=>t.node)??[],[L]),{data:E,isLoading:b}=f("kind"),{data:h,isLoading:k}=f("spec.lifecycle"),{data:R,isLoading:w}=f("spec.type"),{data:F,isLoading:O}=f("spec.system"),G=l(()=>({[s.Kind]:d(E),[s.Lifecycle]:d(h),[s.Type]:d(R),[s.System]:d(F),[s.Entity]:e.map(t=>({label:T(t).name,value:t})),[s.EntityOwner]:m?.map(t=>({label:t.name,value:t.ref}))??[],[s.Track]:p.map(t=>({label:t.name,value:t.id})),[s.Level]:K(p),[s.Check]:I(c,p),[s.CheckOwner]:M(c,u)}),[E,h,R,e,m,u,p,c,F]);return A(()=>{o(b||k||w||r||n||g||v||O)},[b,k,w,r,n,g,v,O]),{facetOptions:G,isLoading:i}};export{V as useFacetOptions};
|
|
2
|
-
//# sourceMappingURL=useFacetOptions.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Facet as t}from"./types.esm.js";const a=30,l=2,y=90,o=r=>{if(r?.length){const e=parseInt(r,10);if(!isNaN(e)&&e>=l&&e<=y)return e}return a},p=r=>Object.fromEntries(Object.values(t).map(e=>r&&e===t.EntityOwner?[e,[r]]:[e,[]])),m=(r,e,s)=>{if(e.length)return e.map(c=>({trackId:c,levels:s.length?s.map(n=>parseInt(n,10)):void 0}));if(s.length)return r.map(c=>({trackId:c.value,levels:s.map(n=>parseInt(n,10))}))},O=(r,e,s,c)=>{const n=i=>e[i]?.length?{included:e[i]}:void 0;return{checkIds:n(t.Check),checkOwners:n(t.CheckOwner),entityOwners:n(t.EntityOwner),entityRefs:n(t.Entity),tracks:m(r[t.Track],e[t.Track],e[t.Level]),numberOfDays:s??a,context:c?{loggedInUser:c}:void 0,entityTypes:n(t.Type),entityKinds:n(t.Kind),entityLifecycles:n(t.Lifecycle),systems:n(t.System)}};export{a as DEFAULT_NUMBER_OF_DAYS,y as MAX_NUMBER_OF_DAYS,l as MIN_NUMBER_OF_DAYS,p as emptyFacetFilters,O as mapFacetFiltersToFilter,o as parseNumberOfDays};
|
|
2
|
-
//# sourceMappingURL=utils.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsx as t,jsxs as o}from"react/jsx-runtime";import{makeStyles as l,Typography as r}from"@material-ui/core";import{motion as c}from"framer-motion";import{LoadingIndicator as m}from"../../LoadingIndicator/LoadingIndicator.esm.js";const s=l(()=>({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 d({title:i,subtitle:e,children:a}){const n=s();return t("div",{className:n.container,children:o("div",{className:n.textContainer,children:[t(m,{}),t("div",{style:{marginBottom:"1.1rem"}}),a??"Loading...",o(c.div,{animate:{y:0,opacity:1},initial:{y:100,opacity:0},children:[i&&t(r,{align:"center",variant:"h6",children:i}),e&&t(r,{align:"center",variant:"subtitle2",children:e})]})]})})}export{d as Loading};
|
|
2
|
-
//# sourceMappingURL=Loading.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsxs as i,jsx as o}from"react/jsx-runtime";import{makeStyles as a,Typography as l}from"@material-ui/core";import{useEntityCountCached as c}from"../../../hooks/cache/useEntityCountCached.esm.js";import{useTrackCountCached as d}from"../../../hooks/cache/useTrackCountCached.esm.js";import{Loading as s}from"./Loading.esm.js";const u=a(e=>({container:{display:"flex",margin:"-24px",backgroundColor:e.palette.background.paper,borderTop:`1px solid ${e.palette.border}`,flex:1},fixedColumn:{width:"300px",flex:"none",borderRight:`1px solid ${e.palette.border}`},flexibleColumn:{display:"flex",flexDirection:"column",flex:1,backgroundColor:e.palette.background.default,height:"100%",maxWidth:"100%"},tabsPlaceholder:{height:"36.5px",backgroundColor:e.palette.background.paper}})),p=({text:e,entityCount:r,trackCount:n})=>{const t=[];return t.push(o(l,{style:{fontSize:"1.1rem"},children:e??"Loading..."},"text")),r!==null&&(t.push(o("div",{},"spacer-entity")),t.push(i(l,{style:{fontSize:"1.1rem"},children:["Processing ",r," entities..."]},"entityCount"))),n!==null&&(t.push(o("div",{},"spacer-track")),t.push(i(l,{style:{fontSize:"1.1rem"},children:["Processing ",n," tracks..."]},"trackCount"))),o("div",{children:t})},h=({loadingText:e})=>{const r=u(),{entityCount:n}=c(),{trackCount:t}=d();return i("div",{className:r.container,children:[o("div",{className:r.fixedColumn}),i("div",{className:r.flexibleColumn,children:[o("div",{className:r.tabsPlaceholder}),o(s,{children:o(p,{text:e,entityCount:n,trackCount:t})})]})]})};export{h as TechHealthLoading};
|
|
2
|
-
//# sourceMappingURL=TechHealthLoading.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsxs as r,jsx as e}from"react/jsx-runtime";import{DismissableBanner as p,TabbedLayout as i}from"@backstage/core-components";import{useApi as m,featureFlagsApiRef as n}from"@backstage/core-plugin-api";import{makeStyles as s,Typography as c,Box as d}from"@material-ui/core";import{Routes as h,Route as u}from"react-router-dom";import{useLCPReporting as f}from"../../hooks/useLCPReporting.esm.js";import{TechHealthSummary as g}from"../TechHealthSummary/TechHealthSummary.esm.js";import"../SoundcheckMarkdownContent/SoundcheckMarkdownContentDeprecated.esm.js";import"react";import"react-markdown";import"rehype-raw";import"remark-gfm";import"../SoundcheckMarkdownContent/SoundcheckMarkdownContentBUI.esm.js";import"../TechHealthTabs/PassRateTabStyles.esm.js";import"../StyledTooltip/StyledTooltip.esm.js";import"../TechHealthTabs/OwnerColumn.esm.js";import{TrackResultsTab as b}from"../TechHealthTabs/TrackResultsTab/TrackResultsTab.esm.js";import{EntityResultsTab as x}from"../TechHealthTabs/EntityResultsTab/EntityResultsTab.esm.js";import{GroupResultsTab as R}from"../TechHealthTabs/GroupResultsTab/GroupResultsTab.esm.js";import{CampaignResultsTab as T}from"../TechHealthTabs/CampaignResultsTab/CampaignResultsTab.esm.js";import{CheckResultsTab as k}from"../TechHealthTabs/CheckResultsTab/CheckResultsTab.esm.js";import"./Filters/types.esm.js";import"./Filters/FacetFilter.esm.js";import{FilterProvider as y}from"./Filters/FilterProvider.esm.js";import{Filters as C}from"./Filters/Filters.esm.js";import"./Filters/FiltersHeader.esm.js";import"./Filters/FiltersSection.esm.js";import"@backstage/catalog-model";import"lodash";import"../../contexts/TrackFormContext.esm.js";import"../../contexts/CheckFormContext.esm.js";import"../../contexts/CampaignFormContext.esm.js";import"../../contexts/UserProvider.esm.js";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"react-use/lib/useLocalStorage";const v=s(t=>({container:{display:"flex",margin:"-24px",backgroundColor:t.palette.background.paper,borderTop:`1px solid ${t.palette.border}`,flex:1},fixedColumn:{width:"300px",flex:"none",borderRight:`1px solid ${t.palette.divider}`},flexibleColumn:{display:"flex",flexDirection:"column",flex:1,backgroundColor:t.palette.background.paper,height:"100%",maxWidth:"100%"},pageLayout:{display:"flex",flexDirection:"column",flex:"1 1 0%",backgroundColor:t.palette.background.default,"& > article":{display:"flex",flexDirection:"column",flex:"1 1 auto",borderTop:`1px solid ${t.palette.border}`,padding:`${t.spacing(3)}px !important`}},warning:{margin:"0 -24px"}})),w=()=>{const t=v(),o=m(n),a=!o.getRegisteredFlags().find(l=>l.name==="soundcheck-enable-campaigns")||o.isActive("soundcheck-enable-campaigns");return f({routeName:"soundcheck-tech-health",additionalAttributes:{campaignsEnabled:a.toString()}}),r(y,{children:[e("div",{className:t.warning,children:e(p,{id:"sunset-tech-health-banner",variant:"warning",message:e(c,{variant:"body2",children:"The Tech Health page will be retired in an upcoming release. Please use the new Tech Insights page for continued visibility into health data."})})}),r("div",{className:t.container,children:[e("div",{className:t.fixedColumn,children:e(C,{})}),e("div",{className:t.flexibleColumn,children:e(d,{className:t.pageLayout,"aria-label":"tech health tabs",children:e(h,{children:e(u,{path:"/*",element:r(i,{children:[e(i.Route,{title:"Summary",path:"/",children:e(g,{})}),a&&e(i.Route,{title:"Campaigns",path:"/campaigns",children:e(T,{})}),e(i.Route,{title:"Checks",path:"/checks",children:e(k,{})}),e(i.Route,{title:"Tracks",path:"/tracks",children:e(b,{})}),e(i.Route,{title:"Entities",path:"/entities",children:e(x,{})}),e(i.Route,{title:"Teams",path:"/teams",children:e(R,{})})]})})})})})]})]})};export{w as TechHealth};
|
|
2
|
-
//# sourceMappingURL=TechHealth.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsx as s}from"react/jsx-runtime";import{createContext as n,useMemo as p,useContext as g}from"react";import"@backstage/catalog-model";import"@backstage/core-plugin-api";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{useAggregatedCheckPassRateTrend as v}from"../../hooks/aggregations/useAggregatedCheckPassRateTrend.esm.js";import{useAggregatedTrackPassRateTrend as u}from"../../hooks/aggregations/useAggregatedTrackPassRateTrend.esm.js";import{useAggregatedEntityPassRateTrend as P}from"../../hooks/aggregations/useAggregatedEntityPassRateTrend.esm.js";import{useAggregatedGroupPassRateTrend as T}from"../../hooks/aggregations/useAggregatedGroupPassRateTrend.esm.js";import"react-router-dom";import"react-use/lib/useLocalStorage";import"../TechHealth/Filters/types.esm.js";import"../TechHealth/Filters/FacetFilter.esm.js";import{useFilterContext as c}from"../TechHealth/Filters/FilterProvider.esm.js";import"../TechHealth/Filters/Filters.esm.js";import"../TechHealth/Filters/FiltersHeader.esm.js";import"../TechHealth/Filters/FiltersSection.esm.js";import"lodash";import"../../contexts/TrackFormContext.esm.js";import"../../contexts/CheckFormContext.esm.js";import"../../contexts/CampaignFormContext.esm.js";import"../../contexts/UserProvider.esm.js";import{Loading as R}from"../TechHealth/Loading/Loading.esm.js";const a=n({checkPassRateTrend:{data:void 0,isLoading:!0,isError:!1},trackPassRateOverviewTrend:{data:void 0,isLoading:!0,isError:!1},entityPassRatesOverviewTrends:{data:void 0,isLoading:!0,isError:!1},groupPassRatesOverviewTrends:{data:void 0,isLoading:!0,isError:!1}}),f=()=>g(a),L=m=>{const{filter:r}=c(),t=v(r),e=u(r),i=P(r),o=T({filter:r,first:5}),d=p(()=>({checkPassRateTrend:t,trackPassRateOverviewTrend:e,entityPassRatesOverviewTrends:i,groupPassRatesOverviewTrends:o}),[t,e,i,o]);return t.isLoading||e.isLoading||i.isLoading||o.isLoading?s(R,{}):s(a.Provider,{...m,value:d})};export{L as SummaryAggregationsProvider,f as useSummaryAggregationsContext};
|
|
2
|
-
//# sourceMappingURL=SummaryAggregationsProvider.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsx as r,jsxs as t}from"react/jsx-runtime";import{Box as a}from"@material-ui/core";import{makeStyles as m}from"@material-ui/core/styles";import{CheckHistoryChartCard as e}from"../CheckHistoryChartCard/CheckHistoryChartCard.esm.js";import{EntityPassRateCard as i}from"../EntityPassRateCard/EntityPassRateCard.esm.js";import{GroupPassRateCard as s}from"../GroupPassRateCard/GroupPassRateCard.esm.js";import{TrackHistoryChartCard as c}from"../TrackHistoryChartCard/TrackHistoryChartCard.esm.js";import{SummaryAggregationsProvider as p}from"./SummaryAggregationsProvider.esm.js";const n=m(o=>({root:{display:"flex",flexDirection:"column",gap:o.spacing(2),flex:1,background:o.palette.background.default}})),f=()=>{const o=n();return r(a,{className:o.root,children:t(p,{children:[r(e,{}),r(c,{}),r(i,{}),r(s,{})]})})};export{f as TechHealthSummary};
|
|
2
|
-
//# sourceMappingURL=TechHealthSummary.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsx as t,Fragment as s}from"react/jsx-runtime";import{Button as r,Typography as n}from"@material-ui/core";import{useNavigate as c}from"react-router-dom";import{StyledTooltip as d}from"../StyledTooltip/StyledTooltip.esm.js";import{usePassRateTabStyles as m}from"./PassRateTabStyles.esm.js";const h=({navigateTo:o,disabled:e,toolTipText:a})=>{const i=m(),l=c();return o?a?t(d,{title:a,children:t("span",{children:t(r,{variant:"text",className:i.detailButton,onClick:()=>l(o),disabled:e,children:t(n,{style:e?{textDecoration:"line-through"}:{},className:i.ownerText,children:"View detail"})})})}):t(r,{variant:"text",className:i.detailButton,disabled:e,children:t(n,{style:e?{textDecoration:"line-through"}:{},className:i.ownerText,onClick:()=>l(o),children:"View detail"})}):t(s,{})};export{h as ActionColumn};
|
|
2
|
-
//# sourceMappingURL=ActionColumn.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsx as a,jsxs as G}from"react/jsx-runtime";import{useRouteRef as I}from"@backstage/core-plugin-api";import{Typography as T,Box as M,Grid as S}from"@material-ui/core";import{useState as i,useEffect as A,useMemo as B}from"react";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{useGetCampaigns as D}from"../../../hooks/campaigns/useGetCampaigns.esm.js";import"../../../hooks/useConfirmationModal.esm.js";import{useTrackPassRateTrend as F}from"../../../hooks/aggregations/useTrackPassRateTrend.esm.js";import"react-router-dom";import"react-use/lib/useLocalStorage";import{campaignDetailsRouteRef as N}from"../../../routes.esm.js";import{campaignTrackPassRatesCsvFilename as j}from"../../../utils/charts.esm.js";import{PassRateGrid as V}from"../../PassRateGrid/PassRateGrid.esm.js";import"../../PassRateGrid/types.esm.js";import{PassRateTable as H}from"../../PassRateTable/PassRateTable.esm.js";import"../../PassRateTable/types.esm.js";import"../../TechHealth/Filters/types.esm.js";import"../../TechHealth/Filters/FacetFilter.esm.js";import{useFilterContext as q}from"../../TechHealth/Filters/FilterProvider.esm.js";import"../../TechHealth/Filters/Filters.esm.js";import"../../TechHealth/Filters/FiltersHeader.esm.js";import"../../TechHealth/Filters/FiltersSection.esm.js";import"lodash";import"../../../contexts/TrackFormContext.esm.js";import"../../../contexts/CheckFormContext.esm.js";import"../../../contexts/CampaignFormContext.esm.js";import"../../../contexts/UserProvider.esm.js";import{Loading as z}from"../../TechHealth/Loading/Loading.esm.js";import{PassRateTabHeader as J}from"../PassRateTabHeader.esm.js";import{usePassRateTabStyles as K}from"../PassRateTabStyles.esm.js";import{trackPassRatesToCsv as O}from"../TechHealthExportFunctions.esm.js";import{ViewMode as u,generateTrackPassRateGridData as Q}from"../techHealthTabUtils.esm.js";import{generateColumns as U}from"../TrackResultsTab/TrackResultsTab.esm.js";const W=()=>{const h=K(),{filter:g}=q(),m=I(N),{data:k}=D({orderAlphabetical:"default",searchByStatus:"active"}),t=k?.edges.map(r=>r.node)?.map(({id:r,track:f})=>({campaignId:r,trackId:f.id})),P=t?.map(({trackId:r})=>({trackId:r})),{data:s,isLoading:R,isError:v}=F({...g,tracks:P,trackTypes:{included:["campaign"]}}),[p,C]=i(u.TABLE),[e,w]=i(""),[c,n]=i(0),[d,b]=i(10);A(()=>{n(0)},[g,e]);const L=B(()=>U(s?.individualTrackPassRate??[],void 0,m,t),[s?.individualTrackPassRate,m,t]);if(R)return a(z,{});if(v)return a(T,{color:"error",children:"Failed to load campaign tracks"});const{individualTrackPassRate:l}=s;if(!l)return a(T,{color:"error",children:"No available campaign tracks"});const o=e.length?l.filter(({trackName:r})=>r?.toLowerCase()?.includes(e.toLowerCase())):l,y=async()=>O(o,t),x=(r,f)=>{n(()=>f)},E=r=>{b(+r.target.value),n(0)};return a(M,{className:h.root,children:G(S,{container:!0,direction:"row",children:[a(J,{viewMode:p,setViewMode:C,isLoading:R,searchTerm:e,setSearchTerm:w,searchPlaceholder:"Search Available Campaigns",fetchCsvData:y,csvFilename:j}),p===u.TABLE&&a(H,{data:o,columns:L}),p===u.GRID&&a(V,{data:Q(o.slice(c*d,(c+1)*d),void 0,m,t),totalCount:o?.length??0,page:c,rowsPerPage:d,onPageChange:x,onRowsPerPageChange:E})]})})};export{W as CampaignResultsTab};
|
|
2
|
-
//# sourceMappingURL=CampaignResultsTab.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsx as r,jsxs as L}from"react/jsx-runtime";import{useRouteRef as N}from"@backstage/core-plugin-api";import{Typography as R,Box as E,Grid as A}from"@material-ui/core";import{useState as m,useEffect as D}from"react";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{useCheckPassRateTrend as x}from"../../../hooks/aggregations/useCheckPassRateTrend.esm.js";import"react-router-dom";import"react-use/lib/useLocalStorage";import{checkDetailsRouteRef as y}from"../../../routes.esm.js";import{checkPassRatesCsvFilename as M}from"../../../utils/charts.esm.js";import{PassRateGrid as O}from"../../PassRateGrid/PassRateGrid.esm.js";import"../../PassRateGrid/types.esm.js";import{PassRateTable as S}from"../../PassRateTable/PassRateTable.esm.js";import"../../PassRateTable/types.esm.js";import"../../TechHealth/Filters/types.esm.js";import"../../TechHealth/Filters/FacetFilter.esm.js";import{useFilterContext as F}from"../../TechHealth/Filters/FilterProvider.esm.js";import"../../TechHealth/Filters/Filters.esm.js";import"../../TechHealth/Filters/FiltersHeader.esm.js";import"../../TechHealth/Filters/FiltersSection.esm.js";import"lodash";import"../../../contexts/TrackFormContext.esm.js";import"../../../contexts/CheckFormContext.esm.js";import"../../../contexts/CampaignFormContext.esm.js";import"../../../contexts/UserProvider.esm.js";import{Loading as G}from"../../TechHealth/Loading/Loading.esm.js";import{NameColumn as B}from"../NameColumn.esm.js";import{ActionColumn as I}from"../ActionColumn.esm.js";import{OwnerColumn as j}from"../OwnerColumn.esm.js";import{checkPassRatesToCsv as V}from"../TechHealthExportFunctions.esm.js";import{PassRateTabHeader as H}from"../PassRateTabHeader.esm.js";import{usePassRateTabStyles as J}from"../PassRateTabStyles.esm.js";import{ViewMode as C,generateCheckPassRateGridData as W}from"../techHealthTabUtils.esm.js";import"recharts";import"../../Charts/ChartTypes.esm.js";import"../../Charts/LineChart/LineChart.esm.js";import"../../Charts/chartUtils.esm.js";import"luxon";import"../../TechHealthSummary/SummaryAggregationsProvider.esm.js";import"../../Charts/BarChart/BarChart.esm.js";import"../../PassRateTable/NewPassRateTable.esm.js";import{MostRecentColumn as q}from"../MostRecentColumn.esm.js";import{CheckTrendColumn as z}from"./CheckTrendColumn.esm.js";function K(s){return[{label:"NAME",id:"checkName",renderCell:e=>r(B,{name:e.checkName??e.id,description:e.checkDescription})},{label:"LATEST",id:"snapshotPassRate",renderCell:e=>r(q,{snapshot:e.snapshotPassRate})},{label:"TREND",id:"trendPassRate",renderCell:e=>r(z,{row:e})},{label:"OWNER",id:"checkOwner",renderCell:e=>r(j,{ownerEntityRef:e.checkOwnerRef??void 0})},{label:"ACTION",id:"action",renderCell:(e,t,n)=>r(I,{navigateTo:s({checkId:e.id}),disabled:t,toolTipText:n})}]}const Q=()=>{const s=J(),{filter:e}=F(),t=N(y),{data:n,isLoading:u,isError:k}=x(e),[c,P]=m(C.TABLE),[o,T]=m(""),[l,p]=m(0),[d,w]=m(10);if(D(()=>{p(0)},[e,o]),u)return r(G,{});if(k)return r(R,{color:"error",children:"Failed to load checks"});const{individualCheckPassRates:h}=n;if(!h)return r(R,{color:"error",children:"No available checks"});const i=o.length?h.filter(({id:a,checkName:f})=>f?.toLowerCase()?.includes(o.toLowerCase())||a.toLowerCase().includes(o.toLowerCase())):h,g=async()=>V(i),b=(a,f)=>{p(()=>f)},v=a=>{w(+a.target.value),p(0)};return r(E,{className:s.root,children:L(A,{container:!0,direction:"row",children:[r(H,{viewMode:c,setViewMode:P,isLoading:u,searchTerm:o,setSearchTerm:T,searchPlaceholder:"Search for Available Checks",fetchCsvData:g,csvFilename:M}),c===C.TABLE&&r(S,{data:i,columns:K(t),showsCheckData:!0}),c===C.GRID&&r(O,{data:W(i.slice(l*d,(l+1)*d),t),totalCount:i?.length??0,page:l,rowsPerPage:d,onPageChange:b,onRowsPerPageChange:v})]})})};export{Q as CheckResultsTab};
|
|
2
|
-
//# sourceMappingURL=CheckResultsTab.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";import{Box as a}from"@material-ui/core";import"recharts";import{convertPassRateToDataPoints as s}from"../../Charts/ChartTypes.esm.js";import"../../Charts/LineChart/LineChart.esm.js";import"../../Charts/chartUtils.esm.js";import{PassRateHistoryLineChart as e}from"../../Charts/LineChart/PassRateHistoryLineChart.esm.js";import"luxon";import"../../TechHealthSummary/SummaryAggregationsProvider.esm.js";import"@backstage/catalog-model";import"../../Charts/BarChart/BarChart.esm.js";import{usePassRateTabStyles as i}from"../PassRateTabStyles.esm.js";const p=({row:o})=>{const r=i(),m=s(o.trendPassRates??[]);return t(a,{className:r.flexColumn,children:t(e,{chartData:m,tableChart:!0})})};export{p as CheckTrendColumn};
|
|
2
|
-
//# sourceMappingURL=CheckTrendColumn.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsx as t,jsxs as j}from"react/jsx-runtime";import{parseEntityRef as N}from"@backstage/catalog-model";import{useApi as V,useRouteRef as H}from"@backstage/core-plugin-api";import{entityRouteRef as W}from"@backstage/plugin-catalog-react";import{Typography as L,Box as $,Grid as q}from"@material-ui/core";import{useState as a,useEffect as A}from"react";import{soundcheckApiRef as z}from"../../../api.esm.js";import"@tanstack/react-query";import"../../../hooks/graphqlKeys.esm.js";import"@spotify/backstage-plugin-soundcheck-common";import"../../../hooks/useSoundcheckAlert.esm.js";import"../../../hooks/useConfirmationModal.esm.js";import{useEntityPassRateTrend as J}from"../../../hooks/aggregations/useEntityPassRateTrend.esm.js";import"react-router-dom";import"react-use/lib/useLocalStorage";import{entityPassRatesCsvFilename as K}from"../../../utils/charts.esm.js";import{PassRateGrid as Q}from"../../PassRateGrid/PassRateGrid.esm.js";import"../../PassRateGrid/types.esm.js";import{NewPassRateTable as U}from"../../PassRateTable/NewPassRateTable.esm.js";import"../../TechHealth/Filters/types.esm.js";import"../../TechHealth/Filters/FacetFilter.esm.js";import{useFilterContext as X}from"../../TechHealth/Filters/FilterProvider.esm.js";import"../../TechHealth/Filters/Filters.esm.js";import"../../TechHealth/Filters/FiltersHeader.esm.js";import"../../TechHealth/Filters/FiltersSection.esm.js";import"lodash";import"../../../contexts/TrackFormContext.esm.js";import"../../../contexts/CheckFormContext.esm.js";import"../../../contexts/CampaignFormContext.esm.js";import"../../../contexts/UserProvider.esm.js";import{Loading as Y}from"../../TechHealth/Loading/Loading.esm.js";import{ActionColumn as Z}from"../ActionColumn.esm.js";import{MostRecentColumn as _}from"../MostRecentColumn.esm.js";import{NameColumn as ee}from"../NameColumn.esm.js";import{OwnerColumn as te}from"../OwnerColumn.esm.js";import{PassRateTabHeader as oe}from"../PassRateTabHeader.esm.js";import{usePassRateTabStyles as re}from"../PassRateTabStyles.esm.js";import{entityPassRatesToCsv as ie}from"../TechHealthExportFunctions.esm.js";import{ViewMode as g,generateEntityPassRateGridData as ae}from"../techHealthTabUtils.esm.js";import{EntityTrendColumn as se}from"./EntityTrendColumn.esm.js";function ne(l){return[{label:"NAME",id:"entityName",renderCell:({id:o,entityDescription:s})=>t(ee,{name:N(o).name,description:s})},{label:"LATEST",id:"latest",renderCell:o=>t(_,{snapshot:o.snapshotPassRate})},{label:"TREND",id:"trend",renderCell:o=>t(se,{row:o})},{label:"OWNER",id:"entityOwnerRef",renderCell:({entityOwnerRef:o})=>t(te,{ownerEntityRef:o??void 0})},{label:"ACTION",id:"action",renderCell:({id:o})=>t(Z,{navigateTo:`${l(N(o))}/soundcheck`})}]}const de=()=>{const l=re(),o=V(z),{filter:s}=X(),c=H(W),[P,R]=a([]),[C,n]=a(void 0),[h,p]=a(0),[u,x]=a(10),{data:r,isLoading:y,isError:I}=J({filter:s,first:u,after:C}),[i,D]=a(r?.individualEntityPassRates),S=i?.edges?i?.edges[i?.edges.length-1]:{cursor:""};A(()=>{r&&D(()=>({totalCount:r.individualEntityPassRates.totalCount,edges:r.individualEntityPassRates.edges,pageInfo:{endCursor:r.individualEntityPassRates.pageInfo.endCursor,hasNextPage:r.individualEntityPassRates.pageInfo.hasNextPage??!1,hasPreviousPage:r.individualEntityPassRates.pageInfo.hasPreviousPage??!1}}))},[r]);const[f,F]=a(g.TABLE),[d,G]=a("");if(A(()=>{p(0),n("")},[s]),y)return t(Y,{});if(I)return t(L,{color:"error",children:"Failed to load entities"});if(!i?.edges?.length)return t(L,{color:"error",children:"No available entities"});const v=d.length?{...i,edges:i.edges.filter(({node:e})=>e.id.toLowerCase().includes(d.toLowerCase())),totalCount:i.edges.filter(({node:e})=>e.id.toLowerCase().includes(d.toLowerCase())).length}:i,E=v?.edges.map(({node:e})=>e)??[],w=v?.totalCount??0,M=async()=>{const{individualEntityPassRates:e}=await o.getIndividualEntityPassRates({filter:s});return ie(e.edges.map(({node:m})=>m))},O=()=>{R(e=>[...e,C]),n(S?.cursor)},B=()=>{n(P[P.length-1]),R(e=>e.slice(0,-1))},T=(e,m)=>{p(k=>(m>k?O():B(),m))},b=e=>{n(void 0),x(+e.target.value),p(0)};return t($,{className:l.root,children:j(q,{container:!0,direction:"row",children:[t(oe,{viewMode:f,setViewMode:F,isLoading:y,searchTerm:d,setSearchTerm:G,searchPlaceholder:"Search available entities",fetchCsvData:M,csvFilename:K}),f===g.TABLE&&t(U,{data:E,totalCount:w,page:h,rowsPerPage:u,columns:ne(c),onPageChange:T,onRowsPerPageChange:b}),f===g.GRID&&t(Q,{data:ae(E,c),totalCount:w,page:h,rowsPerPage:u,onPageChange:T,onRowsPerPageChange:b})]})})};export{de as EntityResultsTab};
|
|
2
|
-
//# sourceMappingURL=EntityResultsTab.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";import{Box as m}from"@material-ui/core";import"recharts";import{convertPassRateToDataPoints as s}from"../../Charts/ChartTypes.esm.js";import"../../Charts/LineChart/LineChart.esm.js";import"../../Charts/chartUtils.esm.js";import{PassRateHistoryLineChart as e}from"../../Charts/LineChart/PassRateHistoryLineChart.esm.js";import"luxon";import"../../TechHealthSummary/SummaryAggregationsProvider.esm.js";import"@backstage/catalog-model";import"../../Charts/BarChart/BarChart.esm.js";import{usePassRateTabStyles as i}from"../PassRateTabStyles.esm.js";const p=({row:{trendPassRates:r}})=>{const o=i(),a=s(r??[]);return t(m,{className:o.flexColumn,children:t(e,{chartData:a,tableChart:!0})})};export{p as EntityTrendColumn};
|
|
2
|
-
//# sourceMappingURL=EntityTrendColumn.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsx as o,jsxs as k}from"react/jsx-runtime";import{parseEntityRef as L}from"@backstage/catalog-model";import{useApi as H,useRouteRef as O}from"@backstage/core-plugin-api";import{entityRouteRef as q}from"@backstage/plugin-catalog-react";import{Typography as x,Box as z,Grid as J}from"@material-ui/core";import{useState as s,useEffect as A}from"react";import{soundcheckApiRef as K}from"../../../api.esm.js";import"@tanstack/react-query";import"../../../hooks/graphqlKeys.esm.js";import"@spotify/backstage-plugin-soundcheck-common";import"../../../hooks/useSoundcheckAlert.esm.js";import"../../../hooks/useConfirmationModal.esm.js";import{useGroupPassRateTrend as Q}from"../../../hooks/aggregations/useGroupPassRateTrend.esm.js";import"react-router-dom";import"react-use/lib/useLocalStorage";import{groupPassRatesCsvFilename as U}from"../../../utils/charts.esm.js";import{PassRateGrid as W}from"../../PassRateGrid/PassRateGrid.esm.js";import"../../PassRateGrid/types.esm.js";import{NewPassRateTable as X}from"../../PassRateTable/NewPassRateTable.esm.js";import"../../TechHealth/Filters/types.esm.js";import"../../TechHealth/Filters/FacetFilter.esm.js";import{useFilterContext as Y}from"../../TechHealth/Filters/FilterProvider.esm.js";import"../../TechHealth/Filters/Filters.esm.js";import"../../TechHealth/Filters/FiltersHeader.esm.js";import"../../TechHealth/Filters/FiltersSection.esm.js";import"lodash";import"../../../contexts/TrackFormContext.esm.js";import"../../../contexts/CheckFormContext.esm.js";import"../../../contexts/CampaignFormContext.esm.js";import"../../../contexts/UserProvider.esm.js";import{Loading as Z}from"../../TechHealth/Loading/Loading.esm.js";import{ActionColumn as _}from"../ActionColumn.esm.js";import{MostRecentColumn as $}from"../MostRecentColumn.esm.js";import{NameColumn as ee}from"../NameColumn.esm.js";import{PassRateTabHeader as oe}from"../PassRateTabHeader.esm.js";import{usePassRateTabStyles as re}from"../PassRateTabStyles.esm.js";import{groupPassRatesToCsv as te}from"../TechHealthExportFunctions.esm.js";import{ViewMode as f,generateGroupPassRateGridData as ae}from"../techHealthTabUtils.esm.js";import{GroupTrendColumn as se}from"./GroupTrendColumn.esm.js";function ie(l){return[{label:"NAME",id:"groupName",renderCell:({groupTitle:r,id:i})=>o(ee,{name:r??L(i).name})},{label:"LATEST",id:"latest",renderCell:r=>o($,{snapshot:r.snapshotPassRate})},{label:"TREND",id:"trend",renderCell:r=>o(se,{row:r})},{label:"ACTION",id:"action",renderCell:({id:r})=>o(_,{navigateTo:l(L(r))})}]}const ne=()=>{const l=re(),r=H(K),{filter:i}=Y();i.context=void 0;const c=O(q),[P,R]=s([]),[C,n]=s(void 0),[h,d]=s(0),[u,E]=s(10),{data:t,isLoading:T,isError:I}=Q({filter:i,first:u,after:C}),[a,y]=s(t?.groupPassRates),S=a?.edges?a?.edges[a?.edges.length-1]:{cursor:""};A(()=>{t&&y(()=>({totalCount:t.groupPassRates.totalCount,edges:t.groupPassRates.edges,pageInfo:{endCursor:t.groupPassRates.pageInfo.endCursor,hasNextPage:t.groupPassRates.pageInfo.hasNextPage??!1,hasPreviousPage:t.groupPassRates.pageInfo.hasPreviousPage??!1}}))},[t]);const[g,D]=s(f.TABLE),[m,F]=s("");if(A(()=>{d(0),n("")},[i]),T)return o(Z,{});if(I)return o(x,{color:"error",children:"Failed to load groups"});if(!a?.edges?.length)return o(x,{color:"error",children:"No available groups"});const v=m.length?{...a,edges:a.edges.filter(({node:e})=>e.groupTitle?.toLowerCase()?.includes(m.toLowerCase())||e.id.toLowerCase().includes(m.toLowerCase()))}:a,w=v?.edges.map(({node:e})=>e)??[],b=v?.totalCount??0,M=async()=>{const{groupPassRates:e}=await r.getIndividualGroupPassRates({filter:i});return te(e.edges.map(({node:p})=>p))},B=()=>{R(e=>[...e,C]),n(S?.cursor)},V=()=>{n(P[P.length-1]),R(e=>e.slice(0,-1))},N=(e,p)=>{d(j=>(p>j?B():V(),p))},G=e=>{n(void 0),E(+e.target.value),d(0)};return o(z,{className:l.root,children:k(J,{container:!0,direction:"row",children:[o(oe,{viewMode:g,setViewMode:D,isLoading:T,searchTerm:m,setSearchTerm:F,searchPlaceholder:"Search available teams",csvFilename:U,fetchCsvData:M}),g===f.TABLE&&o(X,{data:w,totalCount:b,page:h,rowsPerPage:u,columns:ie(c),onPageChange:N,onRowsPerPageChange:G}),g===f.GRID&&o(W,{data:ae(w,c),totalCount:b,page:h,rowsPerPage:u,onPageChange:N,onRowsPerPageChange:G})]})})};export{ne as GroupResultsTab};
|
|
2
|
-
//# sourceMappingURL=GroupResultsTab.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsx as r}from"react/jsx-runtime";import{Box as a,Typography as e}from"@material-ui/core";import"recharts";import{convertPassRateToDataPoints as s}from"../../Charts/ChartTypes.esm.js";import"../../Charts/LineChart/LineChart.esm.js";import"../../Charts/chartUtils.esm.js";import{PassRateHistoryLineChart as i}from"../../Charts/LineChart/PassRateHistoryLineChart.esm.js";import"luxon";import"../../TechHealthSummary/SummaryAggregationsProvider.esm.js";import"@backstage/catalog-model";import"../../Charts/BarChart/BarChart.esm.js";import{usePassRateTabStyles as p}from"../PassRateTabStyles.esm.js";const n=({row:{trendPassRates:m}})=>{const t=p(),o=s(m??[]);return o.length?r(a,{className:t.flexColumn,children:r(i,{chartData:o,tableChart:!0})}):r(a,{className:t.flexColumn,children:r(e,{children:"No data"})})};export{n as GroupTrendColumn};
|
|
2
|
-
//# sourceMappingURL=GroupTrendColumn.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsx as r,jsxs as t}from"react/jsx-runtime";import{Box as e,Typography as n}from"@material-ui/core";import{usePassRateTabStyles as m}from"./PassRateTabStyles.esm.js";const a=({snapshot:o})=>{const s=m();return r(e,{className:s.flexColumn,children:t(n,{children:[Math.round(o),"%"]})})};export{a as MostRecentColumn};
|
|
2
|
-
//# sourceMappingURL=MostRecentColumn.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsxs as m,jsx as t}from"react/jsx-runtime";import{Box as s,Typography as i}from"@material-ui/core";import{SoundcheckMarkdownContentDeprecated as n}from"../SoundcheckMarkdownContent/SoundcheckMarkdownContentDeprecated.esm.js";import"@backstage/core-components";import"react";import"react-markdown";import"rehype-raw";import"remark-gfm";import"../SoundcheckMarkdownContent/SoundcheckMarkdownContentBUI.esm.js";import{usePassRateTabStyles as p}from"./PassRateTabStyles.esm.js";const a=({name:r="",description:e=""})=>{const o=p();return m(s,{className:o.flexColumn,children:[t(i,{className:o.boldText,children:r}),t(n,{className:o.descriptionText,content:e??""})]})};export{a as NameColumn};
|
|
2
|
-
//# sourceMappingURL=NameColumn.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsx as n}from"react/jsx-runtime";import{stringifyEntityRef as a,parseEntityRef as l}from"@backstage/catalog-model";import{EntityRefLink as f}from"@backstage/plugin-catalog-react";import{makeStyles as m,Tooltip as p,Typography as y}from"@material-ui/core";import{useEntityByRef as s}from"../../hooks/catalog/useEntityByRef.esm.js";const d=e=>e?.kind==="Group",c=e=>e?.kind==="User",u=m(e=>({ownerLink:{"& span":{"&:hover":{textDecoration:"underline"}},fontSize:e.typography.body1.fontSize}})),h=({ownerEntityRef:e})=>{const{data:t,error:o}=s(e??void 0),i=u();if(t){let r;return d(t)||c(t)?r=t.metadata.title??t.spec.profile?.displayName:r=t.metadata.name,n(f,{entityRef:a(t),title:r,className:i.ownerLink})}else if(o&&e)return n(p,{title:"Unable to pull owner reference from Catalog API",children:n(y,{style:{color:"red"},variant:"body2",children:(()=>{try{return l(e).name}catch{return e}})()})});return null};export{h as OwnerColumn};
|
|
2
|
-
//# sourceMappingURL=OwnerColumn.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsxs as o,jsx as e}from"react/jsx-runtime";import{Grid as s,Button as I,Menu as w,MenuItem as z,ListItemIcon as M,ListItemText as N}from"@material-ui/core";import{makeStyles as E}from"@material-ui/core/styles";import G from"@material-ui/icons/Apps";import P from"@material-ui/icons/GridOn";import V from"@material-ui/icons/KeyboardArrowDown";import j from"@material-ui/icons/Reorder";import{ToggleButtonGroup as R,ToggleButton as h}from"@material-ui/lab";import{useRef as A,useState as u,useEffect as D}from"react";import{CSVLink as O}from"react-csv";import{SearchBar as W}from"../SearchBar/SearchBar.esm.js";import{ViewMode as g}from"./techHealthTabUtils.esm.js";const _=E(r=>({header:{padding:r.spacing(0,0,1),display:"flex"},headerButtons:{display:"flex",gap:r.spacing(1),flexWrap:"nowrap",justifyContent:"end",alignItems:"end"},exportButton:{height:"40px",width:"112px"},csvLink:{display:"none"},menuIconSize:{minWidth:r.spacing(4),color:r.palette.text.primary},menuList:{backgroundColor:r.palette.background.paper,color:r.palette.text.primary}})),F=({viewMode:r,setViewMode:f,isLoading:c,searchTerm:x,setSearchTerm:v,searchPlaceholder:b,fetchCsvData:S,csvFilename:k})=>{const t=_(),m=A(),B=(i,p)=>{p!==null&&f(p)},[d,n]=u(null),[a,C]=u([]),l=!!d,L=i=>{n(i.currentTarget)},T=()=>{n(null)},y=async()=>{n(null);const i=await S();C(i)};return D(()=>{a.length&&m?.current?.link.click()},[a]),o(s,{container:!0,spacing:2,className:t.header,children:[e(s,{item:!0,xs:6,children:e(W,{searchTerm:x,setSearchTerm:v,disabled:c,placeholder:b||"Search",variant:"outlined",size:"small"})}),o(s,{item:!0,xs:6,className:t.headerButtons,children:[e(I,{id:"export-button",className:t.exportButton,disabled:c,variant:"contained",color:"primary","aria-controls":l?"export-menu":void 0,"aria-haspopup":"true","aria-expanded":l?"true":void 0,onClick:L,endIcon:e(V,{}),children:"Export"}),e(O,{data:a,filename:k,className:t.csvLink,ref:m,target:"_blank"}),e(w,{id:"export-menu",anchorEl:d,getContentAnchorEl:null,open:l,onClose:T,MenuListProps:{"aria-labelledby":"export-button",disablePadding:!0,className:t.menuList},anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:o(z,{onClick:y,children:[e(M,{color:"inherit",className:t.menuIconSize,children:e(P,{fontSize:"small"})}),e(N,{children:"CSV"})]})}),o(R,{size:"small",value:r,exclusive:!0,onChange:B,children:[e(h,{value:g.TABLE,title:"Table view",children:e(j,{color:"inherit"})}),e(h,{value:g.GRID,title:"Grid view",children:e(G,{color:"inherit"})})]})]})]})};export{F as PassRateTabHeader};
|
|
2
|
-
//# sourceMappingURL=PassRateTabHeader.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{makeStyles as t}from"@material-ui/core/styles";const o=t(e=>({root:{display:"flex",flexDirection:"column",flex:1,background:e.palette.background.default},ownerText:{fontWeight:500,color:e.palette.text.primary},flexColumn:{display:"flex",flexDirection:"column",gap:e.spacing(.5)},boldText:{fontWeight:"bold"},descriptionText:{maxWidth:400,color:e.palette.text.primary,fontSize:e.typography.subtitle2.fontSize,lineHeight:e.typography.subtitle1.fontSize},detailButton:{textTransform:"none",backgroundColor:"transparent",padding:0,textAlign:"left","&:hover":{textDecoration:"underline",transform:"scale(1)"}}}));export{o as usePassRateTabStyles};
|
|
2
|
-
//# sourceMappingURL=PassRateTabStyles.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{parseEntityRef as c}from"@backstage/catalog-model";import{DateTime as h}from"luxon";function s(a,t){const e=a;if(t){const n=h.utc();for(let o=t-1;o>=0;o--)e.push(n.minus({day:o}).toISODate())}return e}function r(a){if(!a)return 0;const t=a.map(e=>e.trendPassRates?.length??1);return Math.max(1,...t)}function u(a){const t=[];return t.push(s(["check_id","check_name","check_owner_ref"],r(a))),a?.length&&a.map(e=>{t.push([e.id,e.checkName,e.checkOwnerRef,...e.trendPassRates??[e.snapshotPassRate]])}),t}function p(a){const t=[];if(t.push(s(["entity_ref","entity_name","entity_owner_ref"],r(a))),a?.length)for(const e of a){const n=e.trendPassRates?.length?e.trendPassRates:[e.snapshotPassRate];t.push([e.id,c(e.id).name,e.entityOwnerRef??"",...n])}return t}function m(a){const t=[];return t.push(s(["team_ref","team_name"],r(a))),a?.length&&a.map(e=>{t.push([e.id,e.groupTitle??c(e.id).name,...e.trendPassRates??[e.snapshotPassRate]])}),t}function R(a,t,e){return e?[e.find(({trackId:n})=>n===a.id)?.campaignId??"",a.trackName,a.trackOwnerRef]:[a.id,a.trackName,a.trackOwnerRef,t.levelOrdinal,t.levelName??`Level ${t.levelOrdinal}`,...t.trendPassRates??[t.snapshotPassRate]]}function d(a,t){const e=[],n=a?.length?Math.max(...a.map(l=>r(l.levels))):0,o=t?["campaign_id","campaign_name","campaign_owner"]:["track_id","track_name","track_owner_ref","level_ordinal","level_name"];return e.push(s(o,n)),a?.length&&a.map(l=>{l.levels?.map(i=>{e.push(R(l,i,t))})}),e}function v(a){const t=[];return t.push(s(["name"],a?.overallCheckPassRates?.length??0)),a?.overallCheckPassRates?.length&&t.push(["Check Pass Rate",...a.overallCheckPassRates]),t}function P(a){const t=[];return t.push(s(["level_ordinal","level_name"],r(a?.overallTrackPassRate))),a?.overallTrackPassRate?.length&&a.overallTrackPassRate.map(e=>{t.push([e.levelOrdinal,`Level ${e.levelOrdinal}`,...e.trendPassRates??[e.snapshotPassRate]])}),t}function f(a){const t=[];return t.push(s(["entity_ref","entity_name"],r(a?.overallEntityPassRates))),a?.overallEntityPassRates?.length&&a.overallEntityPassRates.map(e=>{t.push([e.id,c(e.id).name,...e.trendPassRates??[0]])}),t}function g(a){const t=[];return t.push(s(["team_ref","team_name"],1)),a?.groupPassRates?.edges.length&&a?.groupPassRates?.edges.map(({node:e})=>{t.push([e.id,e.groupTitle??c(e.id).name,e.snapshotPassRate])}),t}export{u as checkPassRatesToCsv,p as entityPassRatesToCsv,s as getHeaderRowWithDates,r as getHistoryLength,m as groupPassRatesToCsv,v as overallCheckPassRateToCsv,f as overallEntityPassRatesToCsv,g as overallGroupPassRatesToCsv,P as overallTrackPassRatesToCsv,d as trackPassRatesToCsv};
|
|
2
|
-
//# sourceMappingURL=TechHealthExportFunctions.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsxs as t,jsx as m}from"react/jsx-runtime";import{Box as e,Typography as i}from"@material-ui/core";import"recharts";import{convertPassRateToDataPoints as p}from"../../Charts/ChartTypes.esm.js";import"../../Charts/LineChart/LineChart.esm.js";import"../../Charts/chartUtils.esm.js";import{PassRateHistoryLineChart as n}from"../../Charts/LineChart/PassRateHistoryLineChart.esm.js";import"luxon";import"../../TechHealthSummary/SummaryAggregationsProvider.esm.js";import"@backstage/catalog-model";import"../../Charts/BarChart/BarChart.esm.js";import{usePassRateTabStyles as c}from"../PassRateTabStyles.esm.js";const h=({row:{trendPassRates:r,snapshotPassRate:o}})=>{const a=c(),s=p(r??[]);return t(e,{className:a.flexColumn,children:[t(i,{children:[Math.round(o),"%"]}),m(n,{chartData:s,tableChart:!0})]})};export{h as TrackTrendColumn};
|
|
2
|
-
//# sourceMappingURL=TrackLevelTrendColumn.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsx as e,jsxs as N,Fragment as O}from"react/jsx-runtime";import{useRouteRef as A}from"@backstage/core-plugin-api";import{Typography as k,Box as x,Grid as y}from"@material-ui/core";import{useState as d,useEffect as D,useMemo as S}from"react";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{useTrackPassRateTrend as F}from"../../../hooks/aggregations/useTrackPassRateTrend.esm.js";import"react-router-dom";import"react-use/lib/useLocalStorage";import{trackDetailsRouteRef as G}from"../../../routes.esm.js";import{trackPassRatesCsvFilename as B}from"../../../utils/charts.esm.js";import{PassRateGrid as V}from"../../PassRateGrid/PassRateGrid.esm.js";import"../../PassRateGrid/types.esm.js";import{PassRateTable as j}from"../../PassRateTable/PassRateTable.esm.js";import"../../PassRateTable/types.esm.js";import"../../TechHealth/Filters/types.esm.js";import"../../TechHealth/Filters/FacetFilter.esm.js";import{useFilterContext as I}from"../../TechHealth/Filters/FilterProvider.esm.js";import"../../TechHealth/Filters/Filters.esm.js";import"../../TechHealth/Filters/FiltersHeader.esm.js";import"../../TechHealth/Filters/FiltersSection.esm.js";import"lodash";import"../../../contexts/TrackFormContext.esm.js";import"../../../contexts/CheckFormContext.esm.js";import"../../../contexts/CampaignFormContext.esm.js";import"../../../contexts/UserProvider.esm.js";import{Loading as $}from"../../TechHealth/Loading/Loading.esm.js";import{trackPassRatesToCsv as H}from"../TechHealthExportFunctions.esm.js";import{ActionColumn as W}from"../ActionColumn.esm.js";import{NameColumn as q}from"../NameColumn.esm.js";import{OwnerColumn as z}from"../OwnerColumn.esm.js";import{PassRateTabHeader as J}from"../PassRateTabHeader.esm.js";import{usePassRateTabStyles as K}from"../PassRateTabStyles.esm.js";import{ViewMode as h,generateTrackPassRateGridData as Q,getDetailsRoute as U}from"../techHealthTabUtils.esm.js";import{TrackTrendColumn as X}from"./TrackLevelTrendColumn.esm.js";const v=(m,s,o)=>{const i=Math.min(5,s-m+1);return Array.from({length:i}).map((n,l)=>{const a=m+l;return{label:o?"PROGRESS":`LEVEL ${a}`,id:`levels-${l}`,renderCell:r=>{const t=r.levels?.find(({levelOrdinal:f})=>f===a);return t?e(X,{row:t}):e(O,{})}}})},P=(m,s,o,i)=>{const n=m.flatMap(r=>r.levels?.map(t=>t.levelOrdinal)||[]),l=Math.min(...n),a=Math.max(...n);return[{label:"NAME",id:"trackName",renderCell:r=>e(q,{name:r.trackName??r.id,description:r.trackDescription})},...v(l,a,!!o),{label:"OWNER",id:"trackOwnerRef",renderCell:r=>e(z,{ownerEntityRef:r.trackOwnerRef??void 0})},{label:"ACTION",id:"action",renderCell:({id:r})=>e(W,{navigateTo:U(r,s,o,i)})}]},Y=()=>{const m=K(),{filter:s}=I(),o=A(G),{data:i,isLoading:n,isError:l}=F(s),[a,r]=d(h.TABLE),[t,f]=d(""),[u,R]=d(0),[T,w]=d(10);D(()=>{R(0)},[s,t]);const b=S(()=>P(i?.individualTrackPassRate??[],o),[i?.individualTrackPassRate,o]);if(n)return e($,{});if(l)return e(k,{color:"error",children:"Failed to load tracks"});const{individualTrackPassRate:C}=i;if(!C)return e(k,{color:"error",children:"No available tracks"});const c=t.length?C.filter(({id:p,trackName:g})=>g?.toLowerCase()?.includes(t.toLowerCase())||p.toLowerCase().includes(t.toLowerCase())):C,E=async()=>H(c),L=(p,g)=>{R(()=>g)},M=p=>{w(+p.target.value),R(0)};return e(x,{className:m.root,children:N(y,{container:!0,direction:"row",children:[e(J,{viewMode:a,setViewMode:r,isLoading:n,searchTerm:t,setSearchTerm:f,searchPlaceholder:"Search Available Tracks",fetchCsvData:E,csvFilename:B}),a===h.TABLE&&e(j,{data:c,columns:b}),a===h.GRID&&e(V,{data:Q(c.slice(u*T,(u+1)*T),o),totalCount:c?.length??0,page:u,rowsPerPage:T,onPageChange:L,onRowsPerPageChange:M})]})})};export{Y as TrackResultsTab,P as generateColumns,v as generateTrendColumns};
|
|
2
|
-
//# sourceMappingURL=TrackResultsTab.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{parseEntityRef as p}from"@backstage/catalog-model";import"react/jsx-runtime";import"recharts";import{convertPassRateToDataPoints as l}from"../Charts/ChartTypes.esm.js";import"../Charts/LineChart/LineChart.esm.js";import"@material-ui/core";import"../Charts/chartUtils.esm.js";import{formatLineChartData as P}from"../Charts/LineChart/TrackPassRateHistoryLineChart.esm.js";import"luxon";import"../TechHealthSummary/SummaryAggregationsProvider.esm.js";import"../Charts/BarChart/BarChart.esm.js";import"../PassRateGrid/PassRateGrid.esm.js";import{Trend as n}from"../PassRateGrid/types.esm.js";var m=(e=>(e[e.TABLE=0]="TABLE",e[e.GRID=1]="GRID",e))(m||{});function i(e){if(!e||!e.length)return n.FLAT;if(e.length===1)return e[0]>0?n.UP:n.FLAT;const t=e[e.length-1]-e[0];return t<0?n.DOWN:t>0?n.UP:n.FLAT}function u(e,t){return e.map(a=>({id:a.id,name:a.checkName??a.id,description:a.checkDescription??void 0,lineChart:{snapshotPassRates:[{value:a.snapshotPassRate,trend:i(a.trendPassRates??[])}],trendPassRates:l(a.trendPassRates??[])},owner:a.checkOwnerRef??void 0,navigateTo:t({checkId:a.id})}))}function h(e,t){return e.map(a=>({id:a.id,name:p(a.id).name,description:a.entityDescription??void 0,lineChart:{snapshotPassRates:[{value:a.snapshotPassRate,trend:i(a.trendPassRates??[])}],trendPassRates:l(a.trendPassRates??[])},owner:a.entityOwnerRef??void 0,navigateTo:`${t(p(a.id))}/soundcheck`}))}function f(e,t){return e.map(a=>({id:a.id,name:a.groupTitle??p(a.id).name,lineChart:{snapshotPassRates:[{value:a.snapshotPassRate,trend:i(a.trendPassRates??[])}],trendPassRates:l(a.trendPassRates??[])},navigateTo:t(p(a.id))}))}const c=(e,t,a,o)=>{if(t)return t({trackId:e});if(a&&o){const s=o.find(({trackId:r})=>r===e)?.campaignId;if(s)return a({campaignId:s})}};function g(e,t,a,o){return e.map(s=>({id:s.id,name:s.trackName??s.id,description:s.trackDescription??void 0,lineChart:{snapshotPassRates:s.levels?.map(({levelOrdinal:r,levelName:d,snapshotPassRate:R,trendPassRates:v})=>({name:d?`Level ${r} (${d})`:`Level ${r}`,value:R,trend:i(v??[])}))??[],trendPassRates:P({overallTrackPassRate:s.levels}),lineConfigs:s.levels?.map(({levelOrdinal:r,levelName:d})=>({dataKey:`Level${r}`,name:d??`Level ${r}`}))??[]},owner:s.trackOwnerRef??void 0,navigateTo:c(s.id,t,a,o)}))}export{m as ViewMode,i as calculateTrend,u as generateCheckPassRateGridData,h as generateEntityPassRateGridData,f as generateGroupPassRateGridData,g as generateTrackPassRateGridData,c as getDetailsRoute};
|
|
2
|
-
//# sourceMappingURL=techHealthTabUtils.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";import{trackPassRatesSummaryCsvFilename as m}from"../../utils/charts.esm.js";import"recharts";import"../Charts/ChartTypes.esm.js";import"../Charts/LineChart/LineChart.esm.js";import"@material-ui/core";import"../Charts/chartUtils.esm.js";import{TrackPassRateHistoryLineChart as i}from"../Charts/LineChart/TrackPassRateHistoryLineChart.esm.js";import"@backstage/catalog-model";import"luxon";import{useSummaryAggregationsContext as p}from"../TechHealthSummary/SummaryAggregationsProvider.esm.js";import"../Charts/BarChart/BarChart.esm.js";import{TrackSummaryBarChart as c}from"../Charts/BarChart/TrackSummaryBarChart.esm.js";import{OverviewChartCard as n}from"../OverviewChartCard/OverviewChartCard.esm.js";import"../OverviewChartCard/OverviewChartCardStyles.esm.js";import{overallTrackPassRatesToCsv as l}from"../TechHealthTabs/TechHealthExportFunctions.esm.js";const C=()=>{const{trackPassRateOverviewTrend:{data:r,isLoading:a,isError:o}}=p(),e=r?.overallTrackPassRate?.length,s=!r?.overallTrackPassRate||!e||a||o;return t(n,{title:"Track pass rate",subtitle:"Aggregate pass rate for tracks",summaryCardContent:t(c,{}),chartSectionContent:t(i,{}),disableDataExport:s,csvFilename:m,csvData:l(r)})};export{C as TrackHistoryChartCard};
|
|
2
|
-
//# sourceMappingURL=TrackHistoryChartCard.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{useApi as s}from"@backstage/core-plugin-api";import{useQuery as t}from"@tanstack/react-query";import{soundcheckApiRef as o}from"../../api.esm.js";import{QueryKeys as a}from"../graphqlKeys.esm.js";const c=e=>{const r=s(o);return t([a.GetOverallCheckPassRateTrends,e],async()=>r.getOverallCheckPassRates(e),{staleTime:720*60*1e3,refetchInterval:!1,refetchOnWindowFocus:!1})};export{c as useAggregatedCheckPassRateTrend};
|
|
2
|
-
//# sourceMappingURL=useAggregatedCheckPassRateTrend.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{useApi as r}from"@backstage/core-plugin-api";import{useQuery as s}from"@tanstack/react-query";import{soundcheckApiRef as o}from"../../api.esm.js";import{QueryKeys as n}from"../graphqlKeys.esm.js";const a=e=>{const t=r(o);return s([n.GetOverallEntityPassRateTrends,e],async()=>t.getOverallEntityPassRates(e),{staleTime:720*60*1e3,refetchInterval:!1,refetchOnWindowFocus:!1})};export{a as useAggregatedEntityPassRateTrend};
|
|
2
|
-
//# sourceMappingURL=useAggregatedEntityPassRateTrend.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{useApi as s}from"@backstage/core-plugin-api";import{useQuery as t}from"@tanstack/react-query";import{soundcheckApiRef as o}from"../../api.esm.js";import{QueryKeys as a}from"../graphqlKeys.esm.js";const u=e=>{const r=s(o);return t([a.GetOverallGroupPassRateTrends,e],async()=>r.getOverallGroupPassRates(e),{staleTime:720*60*1e3,refetchInterval:!1,refetchOnWindowFocus:!1})};export{u as useAggregatedGroupPassRateTrend};
|
|
2
|
-
//# sourceMappingURL=useAggregatedGroupPassRateTrend.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{useApi as t}from"@backstage/core-plugin-api";import{useQuery as s}from"@tanstack/react-query";import{soundcheckApiRef as a}from"../../api.esm.js";import{QueryKeys as o}from"../graphqlKeys.esm.js";const c=(e,n)=>{const r=t(a);return s([o.GetOverallTrackPassRateTrends,e],async()=>r.getOverallTrackPassRate(e),{staleTime:720*60*1e3,refetchInterval:!1,refetchOnWindowFocus:!1,enabled:!0})};export{c as useAggregatedTrackPassRateTrend};
|
|
2
|
-
//# sourceMappingURL=useAggregatedTrackPassRateTrend.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{useApi as s}from"@backstage/core-plugin-api";import{useQuery as t}from"@tanstack/react-query";import{soundcheckApiRef as o}from"../../api.esm.js";import{QueryKeys as i}from"../graphqlKeys.esm.js";const n=e=>{const r=s(o);return t([i.GetIndividualCheckPassRateTrends,e],async()=>r.getIndividualCheckPassRates(e),{staleTime:720*60*1e3,refetchInterval:!1,refetchOnWindowFocus:!1})};export{n as useCheckPassRateTrend};
|
|
2
|
-
//# sourceMappingURL=useCheckPassRateTrend.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{useApi as s}from"@backstage/core-plugin-api";import{useQuery as r}from"@tanstack/react-query";import{soundcheckApiRef as i}from"../../api.esm.js";import{QueryKeys as n}from"../graphqlKeys.esm.js";const o=e=>{const t=s(i);return r([n.GetIndividualEntityPassRateTrends,e],async()=>t.getIndividualEntityPassRates(e),{staleTime:720*60*1e3,refetchInterval:!1,refetchOnWindowFocus:!1})};export{o as useEntityPassRateTrend};
|
|
2
|
-
//# sourceMappingURL=useEntityPassRateTrend.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{useApi as s}from"@backstage/core-plugin-api";import{useQuery as o}from"@tanstack/react-query";import{soundcheckApiRef as t}from"../../api.esm.js";import{QueryKeys as u}from"../graphqlKeys.esm.js";const i=e=>{const r=s(t);return o([u.GetIndividualGroupPassRateTrends,e],async()=>r.getIndividualGroupPassRates(e),{staleTime:720*60*1e3,refetchInterval:!1,refetchOnWindowFocus:!1})};export{i as useGroupPassRateTrend};
|
|
2
|
-
//# sourceMappingURL=useGroupPassRateTrend.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{useApi as s}from"@backstage/core-plugin-api";import{useQuery as t}from"@tanstack/react-query";import{soundcheckApiRef as a}from"../../api.esm.js";import{QueryKeys as o}from"../graphqlKeys.esm.js";const i=e=>{const r=s(a);return t([o.GetIndividualTrackPassRateTrends,e],async()=>r.getIndividualTrackPassRate(e),{staleTime:720*60*1e3,refetchInterval:!1,refetchOnWindowFocus:!1})};export{i as useTrackPassRateTrend};
|
|
2
|
-
//# sourceMappingURL=useTrackPassRateTrend.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{useState as a,useEffect as r}from"react";import{useGetEntityCount as s}from"../catalog/useGetEntityCount.esm.js";let t=null,o=null;const d=900*1e3;function c(){const[i,l]=a(t===null),e=t===null||(o?Date.now()-o>d:!0),{data:n,isLoading:u}=s(e);return r(()=>{!u&&n!==void 0&&(t=n,o=Date.now()),l(!1)},[n,u,e]),{entityCount:t,loading:i}}export{c as useEntityCountCached};
|
|
2
|
-
//# sourceMappingURL=useEntityCountCached.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{useState as r,useEffect as s}from"react";import{useGetAllTracks as c}from"../tracks/useGetAllTracks.esm.js";let t=null,o=null;const i=900*1e3;function d(){const[a,u]=r(t===null),e=t===null||(o?Date.now()-o>i:!0),{data:n,isLoading:l}=c({},{enabled:e});return s(()=>{!l&&n!==void 0&&(t=n.totalCount,o=Date.now()),u(!1)},[n,l,e]),{trackCount:t,loading:a}}export{d as useTrackCountCached};
|
|
2
|
-
//# sourceMappingURL=useTrackCountCached.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{useApi as i}from"@backstage/core-plugin-api";import{catalogApiRef as s}from"@backstage/plugin-catalog-react";import{useQuery as m}from"@tanstack/react-query";import{useState as u}from"react";const a=(t=!1)=>{const r=i(s),[o,n]=u(0);return m(["GetEntityCount"],async()=>{if(!t)return o;const e=await r.queryEntities({limit:0});return n(e.totalItems),e.totalItems},{enabled:t,refetchOnWindowFocus:!1,refetchInterval:!1,staleTime:900*1e3})};export{a as useGetEntityCount};
|
|
2
|
-
//# sourceMappingURL=useGetEntityCount.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{useApi as s}from"@backstage/core-plugin-api";import{useQuery as a}from"@tanstack/react-query";import{useState as f}from"react";import{soundcheckApiRef as u}from"../../api.esm.js";import{QueryKeys as l}from"../graphqlKeys.esm.js";function m(e){const t=s(u),[o,i]=f(null),n=async()=>(await t.getEntityRefsForTechHealthFilter(e)).entityRefsForTechHealthFilter,r=a([l.GetSoftwareEntityRefsForUser,e],n,{retry:!1,onError:i,enabled:e!==null,staleTime:300*1e3,refetchInterval:!1,refetchOnWindowFocus:!1});return{data:r.data??[],isLoading:r.isLoading,error:o}}export{m as useEntityRefsForUser};
|
|
2
|
-
//# sourceMappingURL=useEntityRefsForUser.esm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{camelCase as p}from"lodash";import{useCallback as E,useEffect as y,useLayoutEffect as M}from"react";import{useSearchParams as v,useLocation as A,useNavigate as $}from"react-router-dom";import O from"react-use/lib/useLocalStorage";import{Facet as l}from"../../components/TechHealth/Filters/types.esm.js";import"../../components/TechHealth/Filters/FacetFilter.esm.js";import"../../components/TechHealth/Filters/FilterProvider.esm.js";import"../../components/TechHealth/Filters/Filters.esm.js";import"../../components/TechHealth/Filters/FiltersHeader.esm.js";import"../../components/TechHealth/Filters/FiltersSection.esm.js";import"@backstage/catalog-model";import"../../contexts/TrackFormContext.esm.js";import"../../contexts/CheckFormContext.esm.js";import"../../contexts/CampaignFormContext.esm.js";import"react/jsx-runtime";import"../../contexts/UserProvider.esm.js";import"@backstage/core-plugin-api";import"@tanstack/react-query";import"../../api.esm.js";import"../graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"@spotify/backstage-plugin-soundcheck-common";import"../useSoundcheckAlert.esm.js";import"../useConfirmationModal.esm.js";import{emptyFacetFilters as h,DEFAULT_NUMBER_OF_DAYS as f,MIN_NUMBER_OF_DAYS as U,MAX_NUMBER_OF_DAYS as k}from"../../components/TechHealth/Filters/utils.esm.js";const B=(d,_)=>{const[a]=v(),c=A(),i=$(),g=_??d[l.EntityOwner][0]?.value,[r=h(g),n]=O("soundcheck.techHealth.facetFilters",h(g));r&&Object.values(l).forEach(t=>{r[t]||(r[t]=[])});const[m=f,u]=O("soundcheck.techHealth.numberOfDays",f),b=t=>!isNaN(t)&&t>=U&&t<=k,N=E((t,e)=>{const o={...r??h()};o[t]=e,n(o)},[r,n]);y(()=>{const t=a.get("days");if(t&&t!==m.toString()){const e=parseInt(t,10);u(b(e)?e:f)}},[]),y(()=>{const t=a.get("days");(!t||t!==m.toString())&&(a.set("days",m.toString()),i({pathname:c.pathname,search:`?${a.toString()}`}))},[m,a,c,i]),M(()=>{let t=!0;const e=r;Object.values(l).forEach(o=>{const s=a.get(p(o));s?(t=!1,e[o]=s.split(",")):e[o]=[]}),t||n(e)},[]),y(()=>{Object.values(l).forEach(t=>{const e=r[t].join(","),o=p(t);e.length&&a.get(o)!==e&&(a.set(o,e),i({pathname:c.pathname,search:`?${a.toString()}`}))})},[r,a,c,i,g]);const D=(t,e)=>{N(t,e);const o=p(t);if(e.length){const s=e.join(",");a.get(o)!==s&&a.set(o,s)}else a.delete(o);i({pathname:c.pathname,search:`?${a.toString()}`})},j=E((t,e)=>{const o={...r??h()};for(let s=0;s<t.length;s++)o[t[s]]=e[s];n(o)},[r,n]);return{setFacetFilter:D,setManyFacetFilters:(t,e)=>{j(t,e);for(let o=0;o<t.length;o++){const s=t[o],F=p(s);if(e[o].length){const S=e[o].join(",");a.get(F)!==S&&a.set(F,S)}else a.delete(F)}i({pathname:c.pathname,search:`?${a.toString()}`})},getFacetFilter:t=>r?r[t]:[],clearFacetFilters:()=>{u(f),n(h()),a.delete("days"),Object.values(l).forEach(t=>{a.delete(p(t))}),i({pathname:c.pathname,search:`?${a.toString()}`})},facetFilters:r,numberOfDays:m,setNumberOfDays:u}};export{B as useFacetFilters};
|
|
2
|
-
//# sourceMappingURL=useFacetFilters.esm.js.map
|