@spotify/backstage-plugin-soundcheck 0.14.0 → 0.14.2

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.
Files changed (90) hide show
  1. package/CHANGELOG.md +34 -8
  2. package/alpha/package.json +1 -1
  3. package/dist/alpha/apis.esm.js +1 -1
  4. package/dist/alpha/entity-content.esm.js +1 -1
  5. package/dist/alpha/pages.esm.js +1 -1
  6. package/dist/alpha/plugin.esm.js +1 -1
  7. package/dist/alpha/sidebar-item.esm.js +1 -1
  8. package/dist/alpha.d.ts +150 -1
  9. package/dist/api.esm.js +1 -1
  10. package/dist/components/CampaignForm/Steps/CampaignDetailsStep/CampaignOwnerField.esm.js +1 -1
  11. package/dist/components/CampaignsPage/CampaignListPage/CampaignListPage.esm.js +1 -1
  12. package/dist/components/CertificationSidebar/Check.esm.js +1 -1
  13. package/dist/components/CertificationSidebar/CheckResultSummaryList.esm.js +1 -1
  14. package/dist/components/CheckDetails/CheckDetails.esm.js +1 -1
  15. package/dist/components/CheckDetails/CollapseRow.esm.js +2 -0
  16. package/dist/components/CheckDetails/FixMeDialog.esm.js +2 -0
  17. package/dist/components/CheckDetails/OngoingTaskComponent.esm.js +2 -0
  18. package/dist/components/CheckDetails/ResultStateBox.esm.js +1 -1
  19. package/dist/components/CheckDetails/ReviewStateComponent.esm.js +2 -0
  20. package/dist/components/CheckDryRun/CheckDryRunDetails.esm.js +1 -1
  21. package/dist/components/CheckForm/CheckForm.esm.js +1 -1
  22. package/dist/components/CheckForm/FormFields/RuleInput/Expressions/ExpressionTypeToggle.esm.js +1 -1
  23. package/dist/components/CheckForm/FormFields/TeamDetailsInput/TeamDetailsInput.esm.js +1 -1
  24. package/dist/components/CheckPage/CheckEntitiesTable/CheckEntitiesTable.esm.js +1 -1
  25. package/dist/components/CheckPage/CheckInsightsPage.esm.js +1 -1
  26. package/dist/components/CheckPage/CheckStatusHistoryChart.esm.js +1 -1
  27. package/dist/components/CheckPage/FilterBar/FilterBar.esm.js +1 -1
  28. package/dist/components/CheckTemplatesPage/CheckTemplatesPage.esm.js +1 -1
  29. package/dist/components/CheckTemplatesPage/TemplateCategory.esm.js +1 -1
  30. package/dist/components/ChecksPage/CheckListPage/CheckListPage.esm.js +1 -1
  31. package/dist/components/ChecksPage/CheckListPage/CheckSummaryCard.esm.js +1 -1
  32. package/dist/components/CollectorPage/Configurators/Configurator.esm.js +1 -1
  33. package/dist/components/CollectorPage/Configurators/Github/GithubConfigurator.esm.js +1 -1
  34. package/dist/components/CollectorPage/Configurators/Gitlab/GitlabConfigurator.esm.js +2 -0
  35. package/dist/components/CollectorPage/Configurators/Gitlab/utils.esm.js +2 -0
  36. package/dist/components/CollectorPage/Configurators/NewRelic/NewRelicConfigurator.esm.js +2 -0
  37. package/dist/components/CollectorPage/Configurators/NewRelic/utils.esm.js +2 -0
  38. package/dist/components/CollectorsPage/CollectorListPage/CollectorLogo.esm.js +1 -1
  39. package/dist/components/CollectorsPage/CollectorListPage/CollectorSummaryCard.esm.js +1 -1
  40. package/dist/components/EntityContent/EntityContent.esm.js +1 -1
  41. package/dist/components/FactExplorer/FactExplorer.esm.js +1 -1
  42. package/dist/components/FactExplorer/FactExplorerContext.esm.js +1 -1
  43. package/dist/components/FactExplorer/FactExplorerDialog.esm.js +1 -1
  44. package/dist/components/FormControlledAutocomplete/ControlledAutocomplete.esm.js +1 -1
  45. package/dist/components/FormFieldLabel/FormFieldLabel.esm.js +1 -1
  46. package/dist/components/GroupSelector/GroupSelector.esm.js +1 -1
  47. package/dist/components/OverviewPage/CampaignBanner/CampaignArea.esm.js +2 -0
  48. package/dist/components/OverviewPage/OverviewPage.esm.js +1 -1
  49. package/dist/components/OverviewPage/OverviewPageContent.esm.js +1 -1
  50. package/dist/components/OverviewPage/OverviewPageHeader.esm.js +2 -0
  51. package/dist/components/OverviewPage/index.esm.js +1 -1
  52. package/dist/components/OverviewTable/Cell/CheckCellTooltip.esm.js +1 -1
  53. package/dist/components/OverviewTable/Cell/CheckLabelCell.esm.js +2 -0
  54. package/dist/components/OverviewTable/Cell/EntityRefCell.esm.js +1 -1
  55. package/dist/components/OverviewTable/Cell/HighestLevelBadge.esm.js +1 -1
  56. package/dist/components/OverviewTable/Cell/TrackLevelHeaderCell.esm.js +1 -1
  57. package/dist/components/OverviewTable/Cell/cellRenderer.esm.js +1 -1
  58. package/dist/components/OverviewTable/OverviewTable.esm.js +1 -1
  59. package/dist/components/OverviewTable/ResultsTable.esm.js +1 -1
  60. package/dist/components/OverviewTable/ResultsTableRow.esm.js +1 -1
  61. package/dist/components/Router.esm.js +1 -1
  62. package/dist/components/RoutingPage/RoutingPage.esm.js +1 -1
  63. package/dist/components/SoundcheckHeader/SoundcheckHeader.esm.js +1 -1
  64. package/dist/components/SoundcheckHeader/SoundcheckHeaderContext.esm.js +1 -1
  65. package/dist/components/SoundcheckHeader/headerUtil.esm.js +1 -1
  66. package/dist/components/SoundcheckHeader/useHeader.esm.js +1 -1
  67. package/dist/components/TrackForm/Steps/TrackDetailsStep/TrackOwnerSelect/TrackOwnerSelect.esm.js +1 -1
  68. package/dist/components/TrackPage/FilterBar/FilterBar.esm.js +1 -1
  69. package/dist/components/TrackPage/TrackPage.esm.js +1 -1
  70. package/dist/components/TracksPage/TrackListPage/TrackListPage.esm.js +1 -1
  71. package/dist/contexts/UserProvider.esm.js +1 -1
  72. package/dist/graphql/generated/index.esm.js +39 -30
  73. package/dist/hooks/aggregations/useAggregatedTrackPassRateTrend.esm.js +1 -1
  74. package/dist/hooks/catalog/useGetEntityRefs.esm.js +1 -1
  75. package/dist/hooks/certifications/useProgramOverviewForOwner.esm.js +1 -1
  76. package/dist/hooks/checks/useCreateCheck.esm.js +1 -1
  77. package/dist/hooks/checks/useDeleteCheck.esm.js +1 -1
  78. package/dist/hooks/checks/useExecutableChecks.esm.js +2 -0
  79. package/dist/hooks/checks/useGetChecks.esm.js +1 -1
  80. package/dist/hooks/checks/useUpdateCheck.esm.js +1 -1
  81. package/dist/hooks/graphqlKeys.esm.js +1 -1
  82. package/dist/hooks/groups/useGroupOptions.esm.js +2 -0
  83. package/dist/images/new-relic-rgb.svg +1 -0
  84. package/dist/images/new-relic-white.svg +1 -0
  85. package/dist/index.d.ts +4 -4
  86. package/dist/utils/filters.esm.js +1 -1
  87. package/package.json +24 -20
  88. package/dist/components/GroupSelector/useOptions.esm.js +0 -2
  89. package/dist/components/OverviewPage/OverviewTabs.esm.js +0 -2
  90. package/dist/components/OverviewPage/OverviewTabsSkeleton.esm.js +0 -2
@@ -1,2 +1,2 @@
1
- import{useTheme as h}from"@material-ui/core";import k from"@material-ui/lab/Skeleton";import t from"react";import{LineChart as u,CartesianGrid as f,XAxis as E,YAxis as i,Label as s,Line as o}from"recharts";import{useCheckStatusHistory as g}from"../../hooks/aggregations/useCheckStatusHistory.esm.js";import{ChartWrapper as x}from"../Charts/ChartWrapper/ChartWrapper.esm.js";import"../Charts/LineChart/LineChart.esm.js";import"../Charts/ChartTypes.esm.js";import"../Charts/chartUtils.esm.js";import"luxon";import"../TechHealthSummary/SummaryAggregationsProvider.esm.js";import"@backstage/catalog-model";import"../Charts/BarChart/BarChart.esm.js";const I=({checkId:a,trackId:m,checkStatus:r,filter:d,states:c})=>{const e=h(),{data:n,isLoading:p}=g({checkId:a,trackId:m,filter:d,states:c,numberOfDays:30},!!a&&!!r);if(!r||p)return t.createElement(k,{variant:"rect",width:"100%",height:"100%"});const l=n?.history.every(({notReported:y})=>y>=0);return t.createElement(x,{height:"90%"},t.createElement(u,{data:n?.history??[],margin:{top:0,right:0,left:0,bottom:0}},t.createElement(f,{stroke:e.palette.divider,verticalPoints:[]}),t.createElement(E,{dataKey:"name"}),t.createElement(i,{yAxisId:"percentage",orientation:"right",domain:[0,100]},t.createElement(s,{value:"Percentage",position:"center",angle:90})),t.createElement(i,{yAxisId:"count",domain:[0,r?.numberOfEntities??0]},t.createElement(s,{value:"Count",position:"center",angle:270,offset:2})),t.createElement(o,{type:"monotone",dataKey:"passed",stroke:e.palette.success.main,yAxisId:"count",strokeWidth:2,dot:!1}),t.createElement(o,{type:"monotone",dataKey:"failed",stroke:e.palette.error.main,yAxisId:"count",strokeWidth:2,dot:!1}),t.createElement(o,{type:"monotone",dataKey:"warning",stroke:e.palette.warning.main,yAxisId:"count",strokeWidth:2,dot:!1}),t.createElement(o,{type:"monotone",dataKey:"notApplicable",stroke:e.palette.text.disabled,yAxisId:"count",strokeWidth:2,dot:!1}),t.createElement(o,{type:"monotone",dataKey:"error",stroke:e.palette.error.light,yAxisId:"count",strokeWidth:2,dot:!1}),l&&t.createElement(o,{type:"monotone",dataKey:"notReported",stroke:e.palette.info.main,yAxisId:"count",strokeWidth:2,dot:!1})))};export{I as CheckStatusHistoryChart};
1
+ import{useTheme as E}from"@material-ui/core";import g from"@material-ui/lab/Skeleton";import{DateTime as x}from"luxon";import t from"react";import{LineChart as I,CartesianGrid as A,XAxis as C,YAxis as m,Label as s,Line as r}from"recharts";import{useCheckStatusHistory as v}from"../../hooks/aggregations/useCheckStatusHistory.esm.js";import{ChartWrapper as K}from"../Charts/ChartWrapper/ChartWrapper.esm.js";import"../Charts/LineChart/LineChart.esm.js";import"../Charts/ChartTypes.esm.js";import"../Charts/chartUtils.esm.js";import"../TechHealthSummary/SummaryAggregationsProvider.esm.js";import"@backstage/catalog-model";import"../Charts/BarChart/BarChart.esm.js";const W=({checkId:i,trackId:d,checkStatus:a,filter:c,states:l})=>{const e=E(),{data:n,isLoading:p}=v({checkId:i,trackId:d,filter:c,states:l,numberOfDays:30},!!i&&!!a);if(!a||p)return t.createElement(g,{variant:"rect",width:"100%",height:"100%"});const y=n?.history.every(({notReported:o})=>o>=0);return t.createElement(K,{height:"90%"},t.createElement(I,{data:n?.history??[],margin:{top:0,right:0,left:0,bottom:0}},t.createElement(A,{stroke:e.palette.divider,verticalPoints:[]}),t.createElement(C,{dataKey:"date",tickFormatter:o=>x.fromISO(o).toFormat("MMM d"),allowDuplicatedCategory:!1,height:40,tick:({x:o,y:h,fill:f,payload:k,tickFormatter:u})=>t.createElement("g",{transform:`translate(${o},${h})`},t.createElement("text",{x:0,y:0,dy:16,textAnchor:"end",fill:f,transform:"rotate(-20)",fontSize:12},u(k.value)))}),t.createElement(m,{yAxisId:"percentage",orientation:"right",domain:[0,100]},t.createElement(s,{value:"Percentage",position:"center",angle:90})),t.createElement(m,{yAxisId:"count",domain:[0,a?.numberOfEntities??0]},t.createElement(s,{value:"Count",position:"center",angle:270,offset:2})),t.createElement(r,{type:"monotone",dataKey:"passed",stroke:e.palette.success.main,yAxisId:"count",strokeWidth:2,dot:!1}),t.createElement(r,{type:"monotone",dataKey:"failed",stroke:e.palette.error.main,yAxisId:"count",strokeWidth:2,dot:!1}),t.createElement(r,{type:"monotone",dataKey:"warning",stroke:e.palette.warning.main,yAxisId:"count",strokeWidth:2,dot:!1}),t.createElement(r,{type:"monotone",dataKey:"notApplicable",stroke:e.palette.text.disabled,yAxisId:"count",strokeWidth:2,dot:!1}),t.createElement(r,{type:"monotone",dataKey:"error",stroke:e.palette.error.light,yAxisId:"count",strokeWidth:2,dot:!1}),y&&t.createElement(r,{type:"monotone",dataKey:"notReported",stroke:e.palette.info.main,yAxisId:"count",strokeWidth:2,dot:!1})))};export{W as CheckStatusHistoryChart};
2
2
  //# sourceMappingURL=CheckStatusHistoryChart.esm.js.map
@@ -1,2 +1,2 @@
1
- import{parseEntityRef as x}from"@backstage/catalog-model";import{useApi as N,configApiRef as B}from"@backstage/core-plugin-api";import{EntityDisplayName as D}from"@backstage/plugin-catalog-react";import{makeStyles as T,Checkbox as m,Box as P,Typography as j}from"@material-ui/core";import G from"@material-ui/icons/Category";import M from"@material-ui/icons/Class";import U from"@material-ui/icons/Group";import _ from"@material-ui/icons/Loop";import H from"@material-ui/icons/PlaylistAddCheckRounded";import e,{useMemo as J}from"react";import{useGetEntityFacets as o}from"../../../hooks/catalog/useGetEntityFacets.esm.js";import{CheckIcon as K}from"../../CheckIcon/CheckIcon.esm.js";import l from"../../MultiSelectFilter/MultiSelectFilter.esm.js";function Q(t){return t.toLowerCase().split("_").map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join(" ")}const p=(t,{selected:r})=>e.createElement(e.Fragment,null,e.createElement(m,{value:t,checked:r,color:"primary"}),e.createElement(D,{entityRef:t,hideIcon:!0})),W=(t,{selected:r})=>e.createElement(e.Fragment,null,e.createElement(m,{value:t,checked:r,color:"primary"}),e.createElement(K,{result:t}),e.createElement(P,{mr:1}),e.createElement(j,null,Q(t))),q=T(t=>({root:{display:"flex",flexDirection:"row",alignItems:"center",gap:t.spacing(2)}})),z=({filter:t,states:r,setStates:f,owners:d,setOwners:y,lifecycles:E,setLifecycles:u,types:g,setTypes:h,systems:L,setSystems:b})=>{const F=q(),n=N(B).getOptionalStringArray("soundcheck.flags")?.includes("enable-check-insights"),{data:A,isLoading:k}=o("relations.ownedBy",t),{data:s,isLoading:w}=o("spec.lifecycle",t,n),{data:i,isLoading:S}=o("spec.type",t,n),{data:a,isLoading:O}=o("relations.partOf",t,n),c=J(()=>a?.filter(v=>{try{return x(v).kind.toLowerCase()==="system"}catch{return!1}}),[a]),C=(s||[]).length<=1,I=(i||[]).length<=1,R=(c||[]).length<=1;return e.createElement("div",{className:F.root},e.createElement(l,{name:"state",label:"State",icon:e.createElement(H,null),options:["PASSED","FAILED","WARNING","NOT_APPLICABLE"],filters:r,setFilters:f,customRenderOption:W}),n&&e.createElement("div",null,e.createElement(l,{name:"system",label:"System",icon:e.createElement(G,null),filters:L,setFilters:b,options:c??[],disabled:O||R,customRenderOption:p}),e.createElement(l,{name:"owner",label:"Owner",icon:e.createElement(U,null),filters:d,setFilters:y,options:A??[],disabled:k,customRenderOption:p}),e.createElement(l,{name:"type",label:"Type",icon:e.createElement(M,null),filters:g,setFilters:h,options:i??[],disabled:S||I}),e.createElement(l,{name:"lifecycle",label:"Lifecycle",icon:e.createElement(_,null),filters:E,setFilters:u,options:s??[],disabled:w||C})))};export{z as FilterBar};
1
+ import{parseEntityRef as T}from"@backstage/catalog-model";import{useApi as D,configApiRef as B}from"@backstage/core-plugin-api";import{EntityDisplayName as G}from"@backstage/plugin-catalog-react";import{makeStyles as P,Checkbox as f,Box as _,Typography as j}from"@material-ui/core";import q from"@material-ui/icons/Category";import z from"@material-ui/icons/Class";import K from"@material-ui/icons/Group";import M from"@material-ui/icons/Loop";import U from"@material-ui/icons/PlaylistAddCheckRounded";import e,{useMemo as d}from"react";import{useGetEntityFacets as s}from"../../../hooks/catalog/useGetEntityFacets.esm.js";import{useGroupOptions as V}from"../../../hooks/groups/useGroupOptions.esm.js";import{CheckIcon as W}from"../../CheckIcon/CheckIcon.esm.js";import l from"../../MultiSelectFilter/MultiSelectFilter.esm.js";function X(t){return t.toLowerCase().split("_").map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join(" ")}const y=(t,{selected:r})=>e.createElement(e.Fragment,null,e.createElement(f,{value:t,checked:r,color:"primary"}),e.createElement(G,{entityRef:t,hideIcon:!0})),$=(t,{selected:r})=>e.createElement(e.Fragment,null,e.createElement(f,{value:t,checked:r,color:"primary"}),e.createElement(W,{result:t}),e.createElement(_,{mr:1}),e.createElement(j,null,X(t))),H=P(t=>({root:{display:"flex",flexDirection:"row",alignItems:"center",gap:t.spacing(2)}})),J=({filter:t,states:r,setStates:u,owners:E,setOwners:g,lifecycles:h,setLifecycles:L,types:b,setTypes:A,systems:F,setSystems:k})=>{const O=H(),n=D(B).getOptionalStringArray("soundcheck.flags")?.includes("enable-check-insights"),{options:i,isLoading:w}=V(),S=d(()=>i.map(o=>o.ref),[i]),{data:a,isLoading:C}=s("spec.lifecycle",t,n),{data:m,isLoading:R}=s("spec.type",t,n),{data:c,isLoading:x}=s("relations.partOf",t,n),p=d(()=>c?.filter(o=>{try{return T(o).kind.toLowerCase()==="system"}catch{return!1}}),[c]),I=(a||[]).length<=1,N=(m||[]).length<=1,v=(p||[]).length<=1;return e.createElement("div",{className:O.root},e.createElement(l,{name:"state",label:"State",icon:e.createElement(U,null),options:["PASSED","FAILED","WARNING","NOT_APPLICABLE"],filters:r,setFilters:u,customRenderOption:$}),n&&e.createElement("div",null,e.createElement(l,{name:"system",label:"System",icon:e.createElement(q,null),filters:F,setFilters:k,options:p??[],disabled:x||v,customRenderOption:y}),e.createElement(l,{name:"owner",label:"Owner",icon:e.createElement(K,null),filters:E,setFilters:g,options:S??[],disabled:w,customRenderOption:y}),e.createElement(l,{name:"type",label:"Type",icon:e.createElement(z,null),filters:b,setFilters:A,options:m??[],disabled:R||N}),e.createElement(l,{name:"lifecycle",label:"Lifecycle",icon:e.createElement(M,null),filters:h,setFilters:L,options:a??[],disabled:C||I})))};export{J as FilterBar};
2
2
  //# sourceMappingURL=FilterBar.esm.js.map
@@ -1,2 +1,2 @@
1
- import{Content as i,ItemCardGrid as s}from"@backstage/core-components";import{useRouteRef as p}from"@backstage/core-plugin-api";import{Typography as a,Box as n,Card as u,CardContent as d}from"@material-ui/core";import{makeStyles as k}from"@material-ui/core/styles";import f from"lodash";import e,{useMemo as g}from"react";import{Link as h}from"react-router-dom";import{useCheckTemplates as C}from"../../hooks/checks/useCheckTemplates.esm.js";import{checkCreateRouteRef as y}from"../../routes.esm.js";import{LoadingIndicator as E}from"../LoadingIndicator/LoadingIndicator.esm.js";import"../SoundcheckHeader/SoundcheckHeader.esm.js";import"../SoundcheckHeader/SoundcheckHeaderContext.esm.js";import{useHeader as b}from"../SoundcheckHeader/useHeader.esm.js";import{TemplateCategory as x}from"./TemplateCategory.esm.js";const L=k(t=>({content:{display:"flex",flexDirection:"column",gap:t.spacing(2)},grid:{marginLeft:t.spacing(2)},cardContent:{"&:hover":{backgroundColor:t.palette.action.hover}},docsLink:{color:t.palette.text.primary},link:{textDecoration:"none"}})),N=()=>{const t=L(),m=p(y),{data:o,isLoading:l}=C(),c=g(()=>f.groupBy(o??[],"category"),[o]);return b({title:"What would you like to check?",docLink:"https://backstage.spotify.com/docs/plugins/soundcheck/core-concepts/checks"}),e.createElement("div",null,l&&e.createElement(E,null),o&&o.length===0&&e.createElement(a,null,"No check templates."),o&&o.length&&e.createElement(i,{className:t.content},e.createElement(n,{className:t.grid},e.createElement(s,null,e.createElement(h,{to:m(),className:t.link},e.createElement(u,null,e.createElement(d,{className:t.cardContent},e.createElement(n,{mb:1},e.createElement(a,{variant:"h6"},"Custom Check")),e.createElement(a,null,"Create a custom check using the facts collected about your entities.")))))),Object.keys(c).sort().map(r=>e.createElement(x,{name:r,templates:c[r],key:r}))))};export{N as CheckTemplatesPage};
1
+ import{Content as i,ItemCardGrid as s}from"@backstage/core-components";import{useRouteRef as p}from"@backstage/core-plugin-api";import{Typography as a,Box as c,Card as d,CardContent as u}from"@material-ui/core";import{makeStyles as f}from"@material-ui/core/styles";import g from"lodash";import e,{useMemo as k}from"react";import{Link as h}from"react-router-dom";import{useCheckTemplates as y}from"../../hooks/checks/useCheckTemplates.esm.js";import{checkCreateRouteRef as C}from"../../routes.esm.js";import{LoadingIndicator as E}from"../LoadingIndicator/LoadingIndicator.esm.js";import"../SoundcheckHeader/SoundcheckHeader.esm.js";import"../SoundcheckHeader/SoundcheckHeaderContext.esm.js";import{useHeader as b}from"../SoundcheckHeader/useHeader.esm.js";import{TemplateCategory as v}from"./TemplateCategory.esm.js";const x=f(t=>({content:{display:"flex",flexDirection:"column",gap:t.spacing(2)},grid:{marginLeft:t.spacing(2)},cardContent:{"&:hover":{backgroundColor:t.palette.action.hover}},docsLink:{color:t.palette.text.primary},link:{textDecoration:"none"}})),L=()=>{const t=x(),m=p(C),{data:o,isLoading:l}=y(),n=k(()=>g.groupBy(o??[],"category"),[o]);return b({title:"What would you like to check?",docLink:"https://backstage.spotify.com/docs/plugins/soundcheck/core-concepts/checks"}),e.createElement("div",null,l&&e.createElement(E,null),o&&o.length===0&&e.createElement(a,null,"No check templates."),o&&o.length&&e.createElement(i,{className:t.content},e.createElement(c,{className:t.grid},e.createElement(s,null,e.createElement(h,{to:m(),className:t.link},e.createElement(d,null,e.createElement(u,{className:t.cardContent},e.createElement(c,{mb:1},e.createElement(a,{variant:"subtitle1",style:{fontWeight:"bold"},component:"div"},"Custom Check")),e.createElement(a,{variant:"body1"},"Create a custom check using the facts collected about your entities.")))))),Object.keys(n).sort().map(r=>e.createElement(v,{name:r,templates:n[r],key:r}))))};export{L as CheckTemplatesPage};
2
2
  //# sourceMappingURL=CheckTemplatesPage.esm.js.map
@@ -1,2 +1,2 @@
1
- import{ItemCardGrid as c}from"@backstage/core-components";import{useRouteRef as i}from"@backstage/core-plugin-api";import{Typography as m,Box as n,Card as p,CardContent as s}from"@material-ui/core";import{makeStyles as f}from"@material-ui/core/styles";import E from"lodash";import e from"react";import{Link as d}from"react-router-dom";import{checkCreateRouteRef as h}from"../../routes.esm.js";const u=f(t=>({content:{marginLeft:t.spacing(2)},link:{textDecoration:"none"},cardContent:{"&:hover":{backgroundColor:t.palette.action.hover}}})),C=({name:t,templates:o})=>{const a=u(),l=i(h);return e.createElement(e.Fragment,null,e.createElement(m,{variant:"h4"},t),e.createElement(n,{className:a.content},e.createElement(c,null,E.sortBy(o,"title").map(r=>e.createElement(d,{to:`${l()}?template=${r.id}`,className:a.link,key:r.id},e.createElement(p,{style:{height:"100%"}},e.createElement(s,{className:a.cardContent},e.createElement(n,{mb:1},e.createElement(m,{variant:"h6"},r.title)),e.createElement(m,null,r.summary))))))))};export{C as TemplateCategory};
1
+ import{ItemCardGrid as c}from"@backstage/core-components";import{useRouteRef as i}from"@backstage/core-plugin-api";import{Typography as a,Box as n,Card as p,CardContent as s}from"@material-ui/core";import{makeStyles as d}from"@material-ui/core/styles";import f from"lodash";import e from"react";import{Link as y}from"react-router-dom";import{checkCreateRouteRef as E}from"../../routes.esm.js";const g=d(t=>({content:{marginLeft:t.spacing(2)},link:{textDecoration:"none"},cardContent:{"&:hover":{backgroundColor:t.palette.action.hover}}})),u=({name:t,templates:m})=>{const o=g(),l=i(E);return e.createElement(e.Fragment,null,e.createElement(a,{variant:"h6"},t),e.createElement(n,{className:o.content},e.createElement(c,null,f.sortBy(m,"title").map(r=>e.createElement(y,{to:`${l()}?template=${r.id}`,className:o.link,key:r.id},e.createElement(p,{style:{height:"100%"}},e.createElement(s,{className:o.cardContent},e.createElement(n,{mb:1},e.createElement(a,{variant:"subtitle1",style:{fontWeight:"bold"},component:"div"},r.title)),e.createElement(a,{variant:"body1"},r.summary))))))))};export{u as TemplateCategory};
2
2
  //# sourceMappingURL=TemplateCategory.esm.js.map
@@ -1,2 +1,2 @@
1
- import{useApi as W,featureFlagsApiRef as Y,useRouteRef as q}from"@backstage/core-plugin-api";import{usePermission as z}from"@backstage/plugin-permission-react";import{makeStyles as J,Button as E,Grid as o}from"@material-ui/core";import{soundcheckCheckCreatePermission as K}from"@spotify/backstage-plugin-soundcheck-common";import t,{useState as c,useEffect as U}from"react";import{useNavigate as V}from"react-router-dom";import X from"react-use/lib/useDebounce";import"@backstage/catalog-model";import"@tanstack/react-query";import"../../../api.esm.js";import"../../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import{useGetChecks as Z}from"../../../hooks/checks/useGetChecks.esm.js";import"../../../hooks/useSoundcheckAlert.esm.js";import"../../../hooks/useConfirmationModal.esm.js";import{useGetCheckOwners as _}from"../../../hooks/checks/useGetCheckOwners.esm.js";import ee from"../../../images/no-results.svg";import{checkTemplatesRouteRef as te}from"../../../routes.esm.js";import{FilterDefault as v}from"../../../utils/filters.esm.js";import{EmptyState as b}from"../../EmptyState/EmptyState.esm.js";import{Pagination as ae}from"../../Pagination/Pagination.esm.js";import{SearchFilters as re}from"../../SearchFilters/SearchFilters.esm.js";import{ChecksOverviewSkeleton as oe}from"../skeletons/ChecksOverviewSkeleton.esm.js";import{CheckSummaryCard as ce}from"./CheckSummaryCard.esm.js";var N=(e=>(e.title="Create a check",e.description="A check is a comparison between a defined acceptable outcome and the actual outcome of a given process.",e.callToAction="Get started",e))(N||{}),y=(e=>(e.title="No checks found",e.description="No checks matched your search. Consider changing search term and filters.",e))(y||{});const ie=J(e=>({headerButtons:{display:"flex",gap:e.spacing(1),flexWrap:"nowrap",justifyContent:"end",alignItems:"end"},header:{padding:e.spacing(0,0,1)},container:{padding:e.spacing(3),gap:e.spacing(3)},createButton:{lineHeight:"1.25rem",paddingTop:e.spacing(1.5),paddingBottom:e.spacing(1.5)}})),se=({checksPerPage:e,currentCursor:w})=>{const i=ie(),[d,x]=c(w),[n,A]=c(""),[h,S]=c(v.Alpha),[g,B]=c(v.Owner),[I,R]=c(""),{data:F,isLoading:O}=_();X(()=>{R(n)},500,[n]);const{loading:u,allowed:G}=z({permission:K}),{data:r,isLoading:l}=Z({ids:void 0,first:e,after:d,orderAlphabetical:h,searchByOwner:g,searchByName:I}),[m,T]=c(r),p=m?.edges?.map(a=>a.node),[f,L]=c([]),k=W(Y),D=!k.getRegisteredFlags().find(a=>a.name==="soundcheck-enable-check-creation")||k.isActive("soundcheck-enable-check-creation"),C=!G||!D,j=a=>{S(a.target.value)},H=a=>{B(a.target.value)};U(()=>{r&&T(()=>({totalCount:r.totalCount,edges:r.edges,pageInfo:{startCursor:r.pageInfo.startCursor,endCursor:r.pageInfo.endCursor,hasNextPage:r?.pageInfo.hasNextPage??!1,hasPreviousPage:r?.pageInfo.hasPreviousPage??!1}}))},[r]);const $=V(),M=q(te),P=()=>$(M());if(!l&&!p)return t.createElement(b,{title:"Create a check",description:"A check is a comparison between a defined acceptable outcome and the actual outcome of a given process.",imgSrc:ee,action:!u&&t.createElement(E,{disabled:C,variant:"contained",color:"primary",onClick:P},"Get started")});let s;l?s=t.createElement(oe,null):p?.length?s=p?.map(a=>t.createElement(o,{key:a.id,xs:12,sm:12,md:6,lg:4,xl:3,item:!0,role:"listitem","aria-label":`check card ${a.id}`},t.createElement(ce,{check:a}))):s=t.createElement(o,{xs:12,item:!0,role:"listitem","aria-label":"result"},t.createElement(b,{title:"No checks found",description:"No checks matched your search. Consider changing search term and filters."}));const Q=m?.pageInfo.hasNextPage||f?.length>0;return t.createElement(o,{container:!0,direction:"row",className:i.container},t.createElement(o,{container:!0,className:i.header},t.createElement(re,{searchPlaceholder:"Search Available Checks",isLoading:l||O,searchTerm:n,setSearchTerm:A,filterAlpha:h,handleAlphabeticalFilterChange:j,filterOwner:g,handleOwnerFilterChange:H,owners:F}),t.createElement(o,{item:!0,xs:2,className:i.headerButtons},!u&&t.createElement(E,{disabled:C,variant:"contained",color:"primary",onClick:P,className:i.createButton},"Create Check"))),t.createElement(o,{container:!0,spacing:4,role:"list","aria-label":"checks"},s),Q&&t.createElement(o,{item:!0,xs:12},t.createElement(ae,{response:m,listingsPerPage:e,cursor:d,setCursor:x,prevCursors:f,setPrevCursors:L,labelPerPageDropdown:"Checks Per Page:",urlRoute:"checks?checksPerPage="})))};export{N as CheckEmptyState,se as CheckListPage,y as CheckNoResults};
1
+ import{useApi as Z,featureFlagsApiRef as $,useRouteRef as q}from"@backstage/core-plugin-api";import{usePermission as z}from"@backstage/plugin-permission-react";import{makeStyles as J,Button as N,Grid as o}from"@material-ui/core";import{soundcheckCheckCreatePermission as K}from"@spotify/backstage-plugin-soundcheck-common";import t,{useState as c,useEffect as w}from"react";import{useNavigate as U}from"react-router-dom";import V from"react-use/lib/useDebounce";import"@backstage/catalog-model";import"@tanstack/react-query";import"../../../api.esm.js";import"../../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import{useGetChecks as X}from"../../../hooks/checks/useGetChecks.esm.js";import"../../../hooks/useSoundcheckAlert.esm.js";import"../../../hooks/useConfirmationModal.esm.js";import{useGetCheckOwners as _}from"../../../hooks/checks/useGetCheckOwners.esm.js";import ee from"../../../images/no-results.svg";import{checkTemplatesRouteRef as te}from"../../../routes.esm.js";import{FilterDefault as y}from"../../../utils/filters.esm.js";import{EmptyState as x}from"../../EmptyState/EmptyState.esm.js";import{Pagination as ae}from"../../Pagination/Pagination.esm.js";import{SearchFilters as re}from"../../SearchFilters/SearchFilters.esm.js";import{ChecksOverviewSkeleton as oe}from"../skeletons/ChecksOverviewSkeleton.esm.js";import{CheckSummaryCard as ce}from"./CheckSummaryCard.esm.js";var A=(e=>(e.title="Create a check",e.description="A check is a comparison between a defined acceptable outcome and the actual outcome of a given process.",e.callToAction="Get started",e))(A||{}),S=(e=>(e.title="No checks found",e.description="No checks matched your search. Consider changing search term and filters.",e))(S||{});const ie=J(e=>({headerButtons:{display:"flex",gap:e.spacing(1),flexWrap:"nowrap",justifyContent:"end",alignItems:"end"},header:{padding:e.spacing(0,0,1)},container:{padding:e.spacing(3),gap:e.spacing(3)},createButton:{lineHeight:"1.25rem",paddingTop:e.spacing(1.5),paddingBottom:e.spacing(1.5)}})),se=({checksPerPage:e,currentCursor:B})=>{const i=ie(),[d,h]=c(B),[n,I]=c(""),[g,R]=c(y.Alpha),[u,F]=c(y.Owner),[f,O]=c(""),{data:T,isLoading:G}=_();V(()=>{O(n)},500,[n]);const{loading:k,allowed:L}=z({permission:K}),{data:r,isLoading:l}=X({ids:void 0,first:e,after:d,orderAlphabetical:g,searchByOwner:u,searchByName:f}),[m,D]=c(r),p=m?.edges?.map(a=>a.node),[C,P]=c([]);w(()=>{h(void 0),P([])},[f]);const v=Z($),j=!v.getRegisteredFlags().find(a=>a.name==="soundcheck-enable-check-creation")||v.isActive("soundcheck-enable-check-creation"),E=!L||!j,H=a=>{R(a.target.value)},W=a=>{F(a.target.value)};w(()=>{r&&D(()=>({totalCount:r.totalCount,edges:r.edges,pageInfo:{startCursor:r.pageInfo.startCursor,endCursor:r.pageInfo.endCursor,hasNextPage:r?.pageInfo.hasNextPage??!1,hasPreviousPage:r?.pageInfo.hasPreviousPage??!1}}))},[r]);const M=U(),Q=q(te),b=()=>M(Q());if(!l&&!p)return t.createElement(x,{title:"Create a check",description:"A check is a comparison between a defined acceptable outcome and the actual outcome of a given process.",imgSrc:ee,action:!k&&t.createElement(N,{disabled:E,variant:"contained",color:"primary",onClick:b},"Get started")});let s;l?s=t.createElement(oe,null):p?.length?s=p?.map(a=>t.createElement(o,{key:a.id,xs:12,sm:12,md:6,lg:4,xl:3,item:!0,role:"listitem","aria-label":`check card ${a.id}`},t.createElement(ce,{check:a}))):s=t.createElement(o,{xs:12,item:!0,role:"listitem","aria-label":"result"},t.createElement(x,{title:"No checks found",description:"No checks matched your search. Consider changing search term and filters."}));const Y=m?.pageInfo.hasNextPage||C?.length>0;return t.createElement(o,{container:!0,direction:"row",className:i.container},t.createElement(o,{container:!0,className:i.header},t.createElement(re,{searchPlaceholder:"Search Available Checks",isLoading:l||G,searchTerm:n,setSearchTerm:I,filterAlpha:g,handleAlphabeticalFilterChange:H,filterOwner:u,handleOwnerFilterChange:W,owners:T}),t.createElement(o,{item:!0,xs:2,className:i.headerButtons},!k&&t.createElement(N,{disabled:E,variant:"contained",color:"primary",onClick:b,className:i.createButton},"Create Check"))),t.createElement(o,{container:!0,spacing:4,role:"list","aria-label":"checks"},s),Y&&t.createElement(o,{item:!0,xs:12},t.createElement(ae,{response:m,listingsPerPage:e,cursor:d,setCursor:h,prevCursors:C,setPrevCursors:P,labelPerPageDropdown:"Checks Per Page:",urlRoute:"checks?checksPerPage="})))};export{A as CheckEmptyState,se as CheckListPage,S as CheckNoResults};
2
2
  //# sourceMappingURL=CheckListPage.esm.js.map
@@ -1,2 +1,2 @@
1
- import{useRouteRef as d,useApi as A,configApiRef as P}from"@backstage/core-plugin-api";import{usePermission as l}from"@backstage/plugin-permission-react";import{soundcheckCheckUpdatePermission as v,soundcheckCheckDeletePermission as S}from"@spotify/backstage-plugin-soundcheck-common";import p,{useCallback as i}from"react";import{useNavigate as b}from"react-router-dom";import"@backstage/catalog-model";import"@tanstack/react-query";import"../../../api.esm.js";import"../../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"../../../hooks/useSoundcheckAlert.esm.js";import{useConfirmationModal as x}from"../../../hooks/useConfirmationModal.esm.js";import{useDeleteCheck as I}from"../../../hooks/checks/useDeleteCheck.esm.js";import{checkDetailsRouteRef as M,checkEditRouteRef as $}from"../../../routes.esm.js";import{exportCheck as N}from"../../../utils/export.esm.js";import{SummaryCard as O}from"../../SummaryCard/SummaryCard.esm.js";import{CheckMetadata as U}from"./CheckMetadata.esm.js";const V=({check:t})=>{const{id:e,name:r,description:h,isEditable:c,ownerEntityRef:u}=t,o=b(),m=d(M),a=d($),{loading:f,allowed:k}=l({permission:v,resourceRef:e}),{loading:C,allowed:R}=l({permission:S,resourceRef:e}),g=A(P).getOptionalStringArray("soundcheck.flags")?.includes("enable-check-insights"),{showModal:s}=x(),{mutate:n}=I(),y=i(async()=>{await s({title:"Delete Check",message:`Are you sure you want to delete the check '${r??e}'?`})&&n(e)},[s,r,n,e]),w=i(()=>{o(m({checkId:e}))},[m,e,o]),E=i(()=>{o(a({checkId:e}))},[a,e,o]),D=i(()=>{N(t)},[t]);return p.createElement(O,{title:r??e,description:h,children:u&&p.createElement(U,{check:t}),handleView:w,handleEdit:c&&!f&&k?E:void 0,handleDelete:c&&!C&&R?y:void 0,handleExport:D,viewIsPrimaryAction:g})};export{V as CheckSummaryCard};
1
+ import{useRouteRef as d}from"@backstage/core-plugin-api";import{usePermission as l}from"@backstage/plugin-permission-react";import{soundcheckCheckUpdatePermission as g,soundcheckCheckDeletePermission as P}from"@spotify/backstage-plugin-soundcheck-common";import p,{useCallback as r}from"react";import{useNavigate as v}from"react-router-dom";import"@backstage/catalog-model";import"@tanstack/react-query";import"../../../api.esm.js";import"../../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"../../../hooks/useSoundcheckAlert.esm.js";import{useConfirmationModal as x}from"../../../hooks/useConfirmationModal.esm.js";import{useDeleteCheck as I}from"../../../hooks/checks/useDeleteCheck.esm.js";import{checkDetailsRouteRef as M,checkEditRouteRef as S}from"../../../routes.esm.js";import{exportCheck as b}from"../../../utils/export.esm.js";import{SummaryCard as A}from"../../SummaryCard/SummaryCard.esm.js";import{CheckMetadata as $}from"./CheckMetadata.esm.js";const N=({check:o})=>{const{id:e,name:i,description:h,isEditable:m,ownerEntityRef:u}=o,t=v(),c=d(M),a=d(S),{loading:f,allowed:k}=l({permission:g,resourceRef:e}),{loading:C,allowed:R}=l({permission:P,resourceRef:e}),{showModal:s}=x(),{mutate:n}=I(),w=r(async()=>{await s({title:"Delete Check",message:`Are you sure you want to delete the check '${i??e}'?`})&&n(e)},[s,i,n,e]),y=r(()=>{t(c({checkId:e}))},[c,e,t]),E=r(()=>{t(a({checkId:e}))},[a,e,t]),D=r(()=>{b(o)},[o]);return p.createElement(A,{title:i??e,description:h,children:u&&p.createElement($,{check:o}),handleView:y,handleEdit:m&&!f&&k?E:void 0,handleDelete:m&&!C&&R?w:void 0,handleExport:D,viewIsPrimaryAction:!0})};export{N as CheckSummaryCard};
2
2
  //# sourceMappingURL=CheckSummaryCard.esm.js.map
@@ -1,2 +1,2 @@
1
- import t from"react";import{DataDogConfigurator as e}from"./DataDog/DataDogConfigurator.esm.js";import{GithubConfigurator as i}from"./Github/GithubConfigurator.esm.js";import{JiraConfigurator as a}from"./Jira/JiraConfigurator.esm.js";import{KubernetesConfigurator as m}from"./Kubernetes/KubernetesConfigurator.esm.js";import{PagerDutyConfigurator as n}from"./PagerDuty/PagerDutyConfigurator.esm.js";import{ScmConfigurator as u}from"./SCM/ScmConfigurator.esm.js";import{SonarQubeConfigurator as f}from"./SonarQube/SonarQubeConfigurator.esm.js";const g={github:i,scm:u,pagerduty:n,datadog:e,kubernetes:m,jira:a,sonarqube:f},c=({selectedCollector:o})=>{const r=g[o?.id];return t.createElement(r,{selectedCollector:o})};export{c as Configurator};
1
+ import t from"react";import{DataDogConfigurator as e}from"./DataDog/DataDogConfigurator.esm.js";import{GithubConfigurator as i}from"./Github/GithubConfigurator.esm.js";import{GitlabConfigurator as a}from"./Gitlab/GitlabConfigurator.esm.js";import{JiraConfigurator as m}from"./Jira/JiraConfigurator.esm.js";import{KubernetesConfigurator as f}from"./Kubernetes/KubernetesConfigurator.esm.js";import{NewRelicConfigurator as n}from"./NewRelic/NewRelicConfigurator.esm.js";import{PagerDutyConfigurator as u}from"./PagerDuty/PagerDutyConfigurator.esm.js";import{ScmConfigurator as g}from"./SCM/ScmConfigurator.esm.js";import{SonarQubeConfigurator as p}from"./SonarQube/SonarQubeConfigurator.esm.js";const c={github:i,gitlab:a,scm:g,pagerduty:u,datadog:e,kubernetes:f,jira:m,sonarqube:p,newrelic:n},C=({selectedCollector:r})=>{const o=c[r?.id];return t.createElement(o,{selectedCollector:r})};export{C as Configurator};
2
2
  //# sourceMappingURL=Configurator.esm.js.map
@@ -1,2 +1,2 @@
1
- import{makeStyles as b,Paper as h,Divider as m}from"@material-ui/core";import o from"react";import{useForm as y}from"react-hook-form";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"../../../../hooks/useSoundcheckAlert.esm.js";import{useConfirmationModal as E}from"../../../../hooks/useConfirmationModal.esm.js";import{useNavigateBack as S}from"../../../../hooks/useNavigateBack.esm.js";import{useUpdateCollectorConfig as v}from"../../../../hooks/collectors/useUpdateCollectorConfig.esm.js";import{integrationsPageRouteRef as B}from"../../../../routes.esm.js";import{FooterButtons as P}from"../../../FooterButtons/FooterButtons.esm.js";import"../../../SoundcheckHeader/SoundcheckHeader.esm.js";import"../../../SoundcheckHeader/SoundcheckHeaderContext.esm.js";import{useHeader as D}from"../../../SoundcheckHeader/useHeader.esm.js";import{FactCollectionConfig as i}from"../Common/FactCollectionConfig.esm.js";import{collectorHeaderContent as L,confirmationModalContent as w}from"../Common/utils.esm.js";import{mapConfigToGithubCollectorConfig as F,defaultGithubConfig as G,mapGithubCollectorConfigToConfig as R}from"./utils.esm.js";const x=b(e=>({spacer:{height:e.spacing(8),width:"100%"},section:{marginBottom:e.spacing(2)},form:{marginBottom:e.spacing(2)}})),M=({disabled:e,selectedCollector:r})=>{const{control:a,formState:{errors:t},handleSubmit:n}=y({defaultValues:r?F(r.config):G(),mode:"onChange"}),s=x(),c=!!t.branchProtections||!!t.repositoryDetails||!!t.repositoryLanguages,{mutateAsync:p}=v(),[f,g]=S(B),{showModal:u}=E(),l=async d=>{if(!await u(w(r)))return;const C=R(d);await p({collectorId:r.id,config:C})&&g()};return D(L(r)),o.createElement(o.Fragment,null,o.createElement(h,{className:s.form},o.createElement("form",{onSubmit:n(l)},o.createElement(i,{name:"branchProtections",label:"Branch Protections",description:"Collects branch protection information from an entity's repository.",control:a,disabled:e,errors:t.branchProtections}),o.createElement(m,null),o.createElement(i,{name:"repositoryDetails",label:"Repository Details",description:"Collects details about the an entity's repository.",control:a,disabled:e,errors:t.repositoryDetails}),o.createElement(m,null),o.createElement(i,{name:"repositoryLanguages",label:"Repository Languages",description:"Collects details about the languages used in an entity's repository.",control:a,disabled:e,errors:t.repositoryLanguages}))),o.createElement("div",{className:s.section},o.createElement(P,{onCancel:f,saveButtonText:"Save",isLoading:!1,onSave:n(l),disableSave:c})))};export{M as GithubConfigurator};
1
+ import{makeStyles as b,Paper as y,Divider as m}from"@material-ui/core";import o from"react";import{useForm as h}from"react-hook-form";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"../../../../hooks/useSoundcheckAlert.esm.js";import{useConfirmationModal as E}from"../../../../hooks/useConfirmationModal.esm.js";import{useNavigateBack as S}from"../../../../hooks/useNavigateBack.esm.js";import{useUpdateCollectorConfig as v}from"../../../../hooks/collectors/useUpdateCollectorConfig.esm.js";import{integrationsPageRouteRef as B}from"../../../../routes.esm.js";import{FooterButtons as P}from"../../../FooterButtons/FooterButtons.esm.js";import"../../../SoundcheckHeader/SoundcheckHeader.esm.js";import"../../../SoundcheckHeader/SoundcheckHeaderContext.esm.js";import{useHeader as D}from"../../../SoundcheckHeader/useHeader.esm.js";import{FactCollectionConfig as i}from"../Common/FactCollectionConfig.esm.js";import{collectorHeaderContent as L,confirmationModalContent as w}from"../Common/utils.esm.js";import{mapConfigToGithubCollectorConfig as F,defaultGithubConfig as G,mapGithubCollectorConfigToConfig as R}from"./utils.esm.js";const x=b(e=>({spacer:{height:e.spacing(8),width:"100%"},section:{marginBottom:e.spacing(2)},form:{marginBottom:e.spacing(2)}})),M=({disabled:e,selectedCollector:r})=>{const{control:a,formState:{errors:t},handleSubmit:n}=h({defaultValues:r?F(r.config):G(),mode:"onChange"}),s=x(),c=!!t.branchProtections||!!t.repositoryDetails||!!t.repositoryLanguages,{mutateAsync:p}=v(),[f,g]=S(B),{showModal:u}=E(),l=async d=>{if(!await u(w(r)))return;const C=R(d);await p({collectorId:r.id,config:C})&&g()};return D(L(r)),o.createElement(o.Fragment,null,o.createElement(y,{className:s.form},o.createElement("form",{onSubmit:n(l)},o.createElement(i,{name:"branchProtections",label:"Branch Protections",description:"Collects branch protection information from an entity's repository.",control:a,disabled:e,errors:t.branchProtections}),o.createElement(m,null),o.createElement(i,{name:"repositoryDetails",label:"Repository Details",description:"Collects details about an entity's repository.",control:a,disabled:e,errors:t.repositoryDetails}),o.createElement(m,null),o.createElement(i,{name:"repositoryLanguages",label:"Repository Languages",description:"Collects details about the languages used in an entity's repository.",control:a,disabled:e,errors:t.repositoryLanguages}))),o.createElement("div",{className:s.section},o.createElement(P,{onCancel:f,saveButtonText:"Save",isLoading:!1,onSave:n(l),disableSave:c})))};export{M as GithubConfigurator};
2
2
  //# sourceMappingURL=GithubConfigurator.esm.js.map
@@ -0,0 +1,2 @@
1
+ import{makeStyles as b,Paper as h,Divider as m}from"@material-ui/core";import e from"react";import{useForm as j}from"react-hook-form";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"../../../../hooks/useSoundcheckAlert.esm.js";import{useConfirmationModal as E}from"../../../../hooks/useConfirmationModal.esm.js";import{useNavigateBack as P}from"../../../../hooks/useNavigateBack.esm.js";import{useUpdateCollectorConfig as S}from"../../../../hooks/collectors/useUpdateCollectorConfig.esm.js";import{integrationsPageRouteRef as v}from"../../../../routes.esm.js";import{FooterButtons as y}from"../../../FooterButtons/FooterButtons.esm.js";import"../../../SoundcheckHeader/SoundcheckHeader.esm.js";import"../../../SoundcheckHeader/SoundcheckHeaderContext.esm.js";import{useHeader as B}from"../../../SoundcheckHeader/useHeader.esm.js";import{FactCollectionConfig as n}from"../Common/FactCollectionConfig.esm.js";import{collectorHeaderContent as D,confirmationModalContent as L}from"../Common/utils.esm.js";import{mapConfigToGitlabCollectorConfig as w,defaultGitlabConfig as F,mapGitlabCollectorConfigToConfig as G}from"./utils.esm.js";const k=b(o=>({spacer:{height:o.spacing(8),width:"100%"},section:{marginBottom:o.spacing(2)},form:{marginBottom:o.spacing(2)}})),M=({disabled:o,selectedCollector:r})=>{const{control:a,formState:{errors:t},handleSubmit:i}=j({defaultValues:r?w(r.config):F(),mode:"onChange"}),l=k(),s=!!t.branchProtections||!!t.projectDetails||!!t.projectLanguages,{mutateAsync:p}=S(),[f,g]=P(v),{showModal:d}=E(),c=async u=>{if(!await d(L(r)))return;const C=G(u);await p({collectorId:r.id,config:C})&&g()};return B(D(r)),e.createElement(e.Fragment,null,e.createElement(h,{className:l.form},e.createElement("form",{onSubmit:i(c)},e.createElement(n,{name:"branchProtections",label:"Branch Protections",description:"Collects branch protection information from an entity's project.",control:a,disabled:o,errors:t.branchProtections}),e.createElement(m,null),e.createElement(n,{name:"projectDetails",label:"Project Details",description:"Collects details about an entity's project.",control:a,disabled:o,errors:t.projectDetails}),e.createElement(m,null),e.createElement(n,{name:"projectLanguages",label:"Project Languages",description:"Collects details about the languages used in an entity's project.",control:a,disabled:o,errors:t.projectLanguages}))),e.createElement("div",{className:l.section},e.createElement(y,{onCancel:f,saveButtonText:"Save",isLoading:!1,onSave:i(c),disableSave:s})))};export{M as GitlabConfigurator};
2
+ //# sourceMappingURL=GitlabConfigurator.esm.js.map
@@ -0,0 +1,2 @@
1
+ import{asArray as b}from"@spotify/backstage-plugin-soundcheck-common";import{mapToCacheConfig as l,mapCacheConfigToHumanDurationOrBoolean as s}from"../../../CacheConfig/utils.esm.js";import"../../../CacheConfig/CacheConfigComponent.esm.js";import{mapCatalogFilterToFilters as u,mapFiltersToCatalogFilter as p}from"../../../Filter/utils.esm.js";import"../../../Filter/FilterComponent.esm.js";import"../../../Frequency/types.esm.js";import{mapHumanDurationOrCronToFrequency as C,mapFrequencyToHumanDurationOrCron as m}from"../../../Frequency/util.esm.js";import"../../../Frequency/FrequencyComponent.esm.js";import{defaultCollectorOption as h}from"../Common/CollectorOption.esm.js";const g="branch_protections",y="project_details",T="project_languages",q=()=>({branchProtections:h(),projectDetails:h(),projectLanguages:h()});function O(r){const{branchProtections:c,projectDetails:o,projectLanguages:e}=r;if(c.enabled||o.enabled||e.enabled){const n={},f=[];if(n.collects=f,c.enabled){const{cacheConfig:t,frequency:a,filters:i}=c;f.push({type:g,frequency:m(a),filter:p(i),cache:s(t)})}if(o.enabled){const{cacheConfig:t,frequency:a,filters:i}=o;f.push({type:y,frequency:m(a),filter:p(i),cache:s(t)})}if(e.enabled){const{cacheConfig:t,frequency:a,filters:i}=e;f.push({type:T,frequency:m(a),filter:p(i),cache:s(t)})}return n}return{collects:[]}}function d(r){const c=q();if(r){const o=r.collects;if(o)for(const e of b(o)){const n=e.type;n===g&&(c.branchProtections={enabled:!0,frequency:C(e.frequency??r.frequency),filters:u(e.filter??r.filter),cacheConfig:l(e.cache??r.cache)}),n===y&&(c.projectDetails={enabled:!0,frequency:C(e.frequency??r.frequency),filters:u(e.filter??r.filter),cacheConfig:l(e.cache??r.cache)}),n===T&&(c.projectLanguages={enabled:!0,frequency:C(e.frequency??r.frequency),filters:u(e.filter??r.filter),cacheConfig:l(e.cache??r.cache)})}}return c}export{g as BRANCH_PROTECTIONS_COLLECTOR_TYPE,y as PROJECT_DETAILS_COLLECTOR_TYPE,T as PROJECT_LANGUAGES_COLLECTOR_TYPE,q as defaultGitlabConfig,d as mapConfigToGitlabCollectorConfig,O as mapGitlabCollectorConfigToConfig};
2
+ //# sourceMappingURL=utils.esm.js.map
@@ -0,0 +1,2 @@
1
+ import{makeStyles as h,Paper as S,Divider as m}from"@material-ui/core";import e from"react";import{useForm as b}from"react-hook-form";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"../../../../hooks/useSoundcheckAlert.esm.js";import{useConfirmationModal as w}from"../../../../hooks/useConfirmationModal.esm.js";import{useNavigateBack as y}from"../../../../hooks/useNavigateBack.esm.js";import{useUpdateCollectorConfig as E}from"../../../../hooks/collectors/useUpdateCollectorConfig.esm.js";import{integrationsPageRouteRef as N}from"../../../../routes.esm.js";import{FooterButtons as R}from"../../../FooterButtons/FooterButtons.esm.js";import"../../../SoundcheckHeader/SoundcheckHeader.esm.js";import"../../../SoundcheckHeader/SoundcheckHeaderContext.esm.js";import{useHeader as v}from"../../../SoundcheckHeader/useHeader.esm.js";import{FactCollectionConfig as a}from"../Common/FactCollectionConfig.esm.js";import{collectorHeaderContent as B,confirmationModalContent as F}from"../Common/utils.esm.js";import{mapConfigToNewRelicCollectorConfig as M,defaultNewRelicConfig as P,mapNewRelicCollectorConfigToConfig as T}from"./utils.esm.js";const k=h(t=>({spacer:{height:t.spacing(8),width:"100%"},section:{marginBottom:t.spacing(2)},form:{marginBottom:t.spacing(2)}})),x=({disabled:t,selectedCollector:i})=>{const{control:r,formState:{errors:o},handleSubmit:n}=b({defaultValues:i?M(i.config):P(),mode:"onChange"}),l=k(),s=!!o.entity||!!o.entitySearch||!!o.policiesSearch,{mutateAsync:p}=E(),[f,d]=y(N),{showModal:u}=w(),c=async g=>{if(!await u(F(i)))return;const C=T(g);await p({collectorId:i.id,config:C})&&d()};return v(B(i)),e.createElement(e.Fragment,null,e.createElement(S,{className:l.form},e.createElement("form",{onSubmit:n(c)},e.createElement(a,{name:"entity",label:"Entity",description:"Collects details about New Relic entity with a specific id.",control:r,disabled:t,errors:o.entity}),e.createElement(m,null),e.createElement(a,{name:"entitySearch",label:"Entity Search",description:"Collects details about New Relic entities with a specific tag.",control:r,disabled:t,errors:o.entitySearch}),e.createElement(m,null),e.createElement(a,{name:"policiesSearch",label:"Policies Search",description:"Collects details about New Relic policies for a specific account.",control:r,disabled:t,errors:o.policiesSearch}))),e.createElement("div",{className:l.section},e.createElement(R,{onCancel:f,saveButtonText:"Save",isLoading:!1,onSave:n(c),disableSave:s})))};export{x as NewRelicConfigurator};
2
+ //# sourceMappingURL=NewRelicConfigurator.esm.js.map
@@ -0,0 +1,2 @@
1
+ import{asArray as d}from"@spotify/backstage-plugin-soundcheck-common";import{mapToCacheConfig as l,mapCacheConfigToHumanDurationOrBoolean as u}from"../../../CacheConfig/utils.esm.js";import"../../../CacheConfig/CacheConfigComponent.esm.js";import{mapCatalogFilterToFilters as s,mapFiltersToCatalogFilter as C}from"../../../Filter/utils.esm.js";import"../../../Filter/FilterComponent.esm.js";import"../../../Frequency/types.esm.js";import{mapHumanDurationOrCronToFrequency as p,mapFrequencyToHumanDurationOrCron as y}from"../../../Frequency/util.esm.js";import"../../../Frequency/FrequencyComponent.esm.js";import{defaultCollectorOption as h}from"../Common/CollectorOption.esm.js";const m="entity",T="entity-search",q="policies-search",g=()=>({entity:h(),entitySearch:h(),policiesSearch:h()});function E(c){const{entity:r,entitySearch:n,policiesSearch:e}=c;if(r.enabled||n.enabled||e.enabled){const i={},a=[];if(i.collects=a,r.enabled){const{cacheConfig:o,frequency:t,filters:f}=r;a.push({type:m,frequency:y(t),filter:C(f),cache:u(o)})}if(n.enabled){const{cacheConfig:o,frequency:t,filters:f}=n;a.push({type:T,frequency:y(t),filter:C(f),cache:u(o)})}if(e.enabled){const{cacheConfig:o,frequency:t,filters:f}=e;a.push({type:q,frequency:y(t),filter:C(f),cache:u(o)})}return i}return{collects:[]}}function O(c){const r=g();if(c){const n=c.collects;if(n)for(const e of d(n)){const i=e.type;i===m&&(r.entity={enabled:!0,frequency:p(e.frequency??c.frequency),filters:s(e.filter??c.filter),cacheConfig:l(e.cache??c.cache)}),i===T&&(r.entitySearch={enabled:!0,frequency:p(e.frequency??c.frequency),filters:s(e.filter??c.filter),cacheConfig:l(e.cache??c.cache)}),i===q&&(r.policiesSearch={enabled:!0,frequency:p(e.frequency??c.frequency),filters:s(e.filter??c.filter),cacheConfig:l(e.cache??c.cache)})}}return r}export{m as ENTITY_COLLECTOR_TYPE,T as ENTITY_SEARCH_COLLECTOR_TYPE,q as POLICIES_SEARCH_COLLECTOR_TYPE,g as defaultNewRelicConfig,O as mapConfigToNewRelicCollectorConfig,E as mapNewRelicCollectorConfigToConfig};
2
+ //# sourceMappingURL=utils.esm.js.map
@@ -1,2 +1,2 @@
1
- import{makeStyles as p,useTheme as s}from"@material-ui/core";import c from"react";import g from"../../../images/cat-blk.svg";import n from"../../../images/cat-wht.svg";import f from"../../../images/dd_logo_h_rgb.svg";import h from"../../../images/dd_logo_h_white.svg";import l from"../../../images/GitHub_Logo.svg";import u from"../../../images/GitHub_Logo_White.svg";import d from"../../../images/gitlab-rgb.svg";import b from"../../../images/gitlab-white.svg";import k from"../../../images/jira-rgb.svg";import y from"../../../images/jira-white.svg";import j from"../../../images/k8s_blue.svg";import q from"../../../images/k8s_white.svg";import B from"../../../images/pd-black.svg";import w from"../../../images/pd-white.svg";import x from"../../../images/SCM_DARK.svg";import I from"../../../images/SCM_LIGHT.svg";import L from"../../../images/sonarqube-rgb.svg";import S from"../../../images/sonarqube-white.svg";import T from"../../../images/soundcheck-black.svg";import D from"../../../images/soundcheck-white.svg";import E from"../../../images/tech-black.svg";import M from"../../../images/tech-white.svg";import{isDarkTheme as $}from"../../Charts/chartUtils.esm.js";const t={github:l,gitlab:d,datadog:f,scm:I,pagerduty:B,catalog:g,soundcheck:T,techinsights:E,kubernetes:j,jira:k,sonarqube:L},i={github:u,gitlab:b,datadog:h,scm:x,pagerduty:w,catalog:n,soundcheck:D,techinsights:M,kubernetes:q,jira:y,sonarqube:S},C=new Set(["catalog","soundcheck","techinsights","sonarqube"]),F=p(o=>({image:{objectFit:"contain",color:"white",height:o.spacing(5)-4,maxWidth:"100%",marginBottom:o.spacing(1.5)},tallImage:{height:o.spacing(6.5),marginBottom:o.spacing(0)}})),G=o=>!!t[o]&&!!i[o],N=({collectorId:o,noMargin:e})=>{const r=F(),a=s(),m=$(a)?i[o]:t[o];return m?c.createElement("img",{src:m,alt:o,style:e?{marginBottom:0}:{},className:`${r.image} ${C.has(o)?r.tallImage:""}`}):null};export{N as CollectorLogo,G as hasLogo};
1
+ import{makeStyles as p,useTheme as c}from"@material-ui/core";import s from"react";import g from"../../../images/cat-blk.svg";import n from"../../../images/cat-wht.svg";import f from"../../../images/dd_logo_h_rgb.svg";import l from"../../../images/dd_logo_h_white.svg";import h from"../../../images/GitHub_Logo.svg";import u from"../../../images/GitHub_Logo_White.svg";import d from"../../../images/gitlab-rgb.svg";import b from"../../../images/gitlab-white.svg";import k from"../../../images/jira-rgb.svg";import w from"../../../images/jira-white.svg";import y from"../../../images/k8s_blue.svg";import j from"../../../images/k8s_white.svg";import q from"../../../images/new-relic-rgb.svg";import B from"../../../images/new-relic-white.svg";import x from"../../../images/pd-black.svg";import I from"../../../images/pd-white.svg";import L from"../../../images/SCM_DARK.svg";import S from"../../../images/SCM_LIGHT.svg";import T from"../../../images/sonarqube-rgb.svg";import D from"../../../images/sonarqube-white.svg";import E from"../../../images/soundcheck-black.svg";import $ from"../../../images/soundcheck-white.svg";import A from"../../../images/tech-black.svg";import C from"../../../images/tech-white.svg";import{isDarkTheme as F}from"../../Charts/chartUtils.esm.js";const t={github:h,gitlab:d,datadog:f,scm:S,pagerduty:x,catalog:g,soundcheck:E,techinsights:A,kubernetes:y,jira:k,sonarqube:T,newrelic:q},i={github:u,gitlab:b,datadog:l,scm:L,pagerduty:I,catalog:n,soundcheck:$,techinsights:C,kubernetes:j,jira:w,sonarqube:D,newrelic:B},G=new Set(["catalog","soundcheck","techinsights","sonarqube"]),H=p(o=>({image:{objectFit:"contain",color:"white",height:o.spacing(5)-4,maxWidth:"100%",marginBottom:o.spacing(1.5)},tallImage:{height:o.spacing(6.5),marginBottom:o.spacing(0)}})),M=o=>!!t[o]&&!!i[o],N=({collectorId:o,noMargin:e})=>{const r=H(),a=c(),m=F(a)?i[o]:t[o];return m?s.createElement("img",{src:m,alt:o,style:e?{marginBottom:0}:{},className:`${r.image} ${G.has(o)?r.tallImage:""}`}):null};export{N as CollectorLogo,M as hasLogo};
2
2
  //# sourceMappingURL=CollectorLogo.esm.js.map
@@ -1,2 +1,2 @@
1
- import{MarkdownContent as E}from"@backstage/core-components";import{useRouteRef as v}from"@backstage/core-plugin-api";import{usePermission as N}from"@backstage/plugin-permission-react";import{makeStyles as I,CardContent as g,CardHeader as k,Typography as u,Divider as x,CardActions as S,Button as T}from"@material-ui/core";import{soundcheckCollectorUpdatePermission as $}from"@spotify/backstage-plugin-soundcheck-common";import e from"react";import{useNavigate as A}from"react-router-dom";import{integrationDetailsRouteRef as B}from"../../../routes.esm.js";import{useSummaryCardStyles as L,Card as M}from"../../SummaryCard/SummaryCard.esm.js";import{hasLogo as R,CollectorLogo as D}from"./CollectorLogo.esm.js";const H=I(o=>({cardContent:{flex:1,paddingTop:o.spacing(1)},logoHeader:{paddingBottom:0,flex:0},headerContent:{display:"flex",alignItems:"center",height:o.spacing(5),marginBottom:o.spacing(1.5)},headerTypography:{marginBottom:0}})),l=["github","scm","pagerduty","datadog","kubernetes","jira","sonarqube"],P=({collector:o})=>{const{description:p,id:t,isConfigurable:s,isEditable:m,name:f}=o,{loading:c,allowed:d}=N({permission:$}),y=A(),h=v(B),a=L(),n=H(),C=l.includes(t)&&s&&m&&!c&&d,b=()=>{y(h({integrationId:t}))};let r;c||!d?r="You don't have permissions to configure this integration.":s?m?l.includes(t)||(r="Integration can only be configured through YAML"):r="Integration is already configured via YAML and cannot be configured through the UI.":r="Integration is not configurable.";const i=f??t;return e.createElement(M,{"data-testid":t,className:a.card},R(t)?e.createElement(g,{className:n.logoHeader},e.createElement(D,{collectorId:t})):e.createElement(k,{title:i,titleTypographyProps:{className:`${a.summaryName} ${n.headerTypography}`},classes:{content:n.headerContent}}),e.createElement(g,{className:n.cardContent},e.createElement(u,{variant:"body1",component:"div"},e.createElement(E,{className:a.summaryDescription,content:p??""})),e.createElement(u,{color:"textSecondary",variant:"body2"},r)),C&&e.createElement("div",null,e.createElement(x,null),e.createElement(S,{className:a.actionArea},e.createElement(T,{"aria-label":`${i}-edit`,"data-testid":`${i}-button`,size:"medium",role:"link",onClick:b,className:a.button,variant:"outlined"},"Configure"))))};export{P as CollectorSummaryCard,l as ConfigurableCollectorIds};
1
+ import{MarkdownContent as E}from"@backstage/core-components";import{useRouteRef as v}from"@backstage/core-plugin-api";import{usePermission as N}from"@backstage/plugin-permission-react";import{makeStyles as I,CardContent as g,CardHeader as k,Typography as u,Divider as x,CardActions as S,Button as T}from"@material-ui/core";import{soundcheckCollectorUpdatePermission as $}from"@spotify/backstage-plugin-soundcheck-common";import e from"react";import{useNavigate as A}from"react-router-dom";import{integrationDetailsRouteRef as B}from"../../../routes.esm.js";import{useSummaryCardStyles as H,Card as L}from"../../SummaryCard/SummaryCard.esm.js";import{hasLogo as R,CollectorLogo as w}from"./CollectorLogo.esm.js";const D=I(o=>({cardContent:{flex:1,paddingTop:o.spacing(1)},logoHeader:{paddingBottom:0,flex:0},headerContent:{display:"flex",alignItems:"center",height:o.spacing(5),marginBottom:o.spacing(1.5)},headerTypography:{marginBottom:0}})),l=["github","gitlab","scm","pagerduty","datadog","kubernetes","jira","sonarqube","newrelic"],M=({collector:o})=>{const{description:p,id:t,isConfigurable:s,isEditable:m,name:f}=o,{loading:c,allowed:d}=N({permission:$}),y=A(),h=v(B),a=H(),n=D(),C=l.includes(t)&&s&&m&&!c&&d,b=()=>{y(h({integrationId:t}))};let r;c||!d?r="You don't have permissions to configure this integration.":s?m?l.includes(t)||(r="Integration can only be configured through YAML"):r="Integration is already configured via YAML and cannot be configured through the UI.":r="Integration is not configurable.";const i=f??t;return e.createElement(L,{"data-testid":t,className:a.card},R(t)?e.createElement(g,{className:n.logoHeader},e.createElement(w,{collectorId:t})):e.createElement(k,{title:i,titleTypographyProps:{className:`${a.summaryName} ${n.headerTypography}`},classes:{content:n.headerContent}}),e.createElement(g,{className:n.cardContent},e.createElement(u,{variant:"body1",component:"div"},e.createElement(E,{className:a.summaryDescription,content:p??""})),e.createElement(u,{color:"textSecondary",variant:"body2"},r)),C&&e.createElement("div",null,e.createElement(x,null),e.createElement(S,{className:a.actionArea},e.createElement(T,{"aria-label":`${i}-edit`,"data-testid":`${i}-button`,size:"medium",role:"link",onClick:b,className:a.button,variant:"outlined"},"Configure"))))};export{M as CollectorSummaryCard,l as ConfigurableCollectorIds};
2
2
  //# sourceMappingURL=CollectorSummaryCard.esm.js.map
@@ -1,2 +1,2 @@
1
- import{makeStyles as n}from"@material-ui/core";import{SpotifyLicenseBanner as r}from"@spotify/backstage-plugin-core";import e from"react";import{AlertProvider as o}from"../../hooks/useSoundcheckAlert.esm.js";import{soundcheckBackend as i,invalidLicenseMessage as a}from"../../utils/license.esm.js";import{CertificationsPage as m}from"../CertificationsPage/CertificationsPage.esm.js";const c=n(t=>({root:{"&:not(:first-child)":{marginTop:t.spacing(2)}}})),l=()=>{const t=c();return e.createElement(e.Fragment,null,e.createElement(o,null,e.createElement(r,{backend:i,invalidLicenseMessage:a,inline:!0}),e.createElement("div",{className:t.root},e.createElement(m,null))))};export{l as EntityContent};
1
+ import{useApi as r,githubAuthApiRef as l,configApiRef as f}from"@backstage/core-plugin-api";import{identityApiRef as p}from"@backstage/frontend-plugin-api";import{useTemplateSecrets as g}from"@backstage/plugin-scaffolder-react";import{makeStyles as d}from"@material-ui/core";import{SpotifyLicenseBanner as u}from"@spotify/backstage-plugin-core";import e from"react";import E from"react-use/lib/useAsync";import{AlertProvider as A}from"../../hooks/useSoundcheckAlert.esm.js";import{soundcheckBackend as y,invalidLicenseMessage as k}from"../../utils/license.esm.js";import{CertificationsPage as v}from"../CertificationsPage/CertificationsPage.esm.js";const h=d(t=>({root:{"&:not(:first-child)":{marginTop:t.spacing(2)}}})),L=()=>{const t=h(),o=r(l),i=r(p),n=r(f).getOptionalStringArray("soundcheck.flags")?.includes("enable-fix-me"),{setSecrets:a}=g();return E(async()=>{const[m,s,c]=await Promise.all([n?o.getAccessToken(void 0,{optional:!0}):Promise.resolve(""),i.getProfileInfo(),i.getBackstageIdentity()]);a({GHE_LOGIN:c.userEntityRef.replace("default/",""),GHE_EMAIL:s.email,GHE_TOKEN:m})},[o,i]),e.createElement(e.Fragment,null,e.createElement(A,null,e.createElement(u,{backend:y,invalidLicenseMessage:k,inline:!0}),e.createElement("div",{className:t.root},e.createElement(v,null))))};export{L as EntityContent};
2
2
  //# sourceMappingURL=EntityContent.esm.js.map
@@ -1,2 +1,2 @@
1
- import{makeStyles as H,Box as n,Typography as o,Button as L}from"@material-ui/core";import{parseFactRef as z}from"@spotify/backstage-plugin-soundcheck-common";import e,{useMemo as E,useState as f,useEffect as U,useCallback as q}from"react";import{useGetEntityRefs as K}from"../../hooks/catalog/useGetEntityRefs.esm.js";import{useGetCollectors as Q}from"../../hooks/collectors/useGetCollectors.esm.js";import{useGetFactSchema as X}from"../../hooks/collectors/useGetFactSchema.esm.js";import{useGetFact as Y}from"../../hooks/useGetFact.esm.js";import{useGetPathResolvers as Z}from"../../hooks/useGetPathResolvers.esm.js";import{generateJsonPaths as _}from"../CheckForm/utils/checkFormUtils.esm.js";import{hasLogo as ee,CollectorLogo as te}from"../CollectorsPage/CollectorListPage/CollectorLogo.esm.js";import{ExpandableSection as O}from"../ExpandableSection/ExpandableSection.esm.js";import{FormattedPreview as F}from"../FormattedPreview/FormattedPreview.esm.js";import"../FormControlledAutocomplete/FormControlledAutocomplete.esm.js";import{useLabelOptions as ae}from"../FormControlledAutocomplete/useLabelOptions.esm.js";import{ControlledAutocomplete as v}from"../FormControlledAutocomplete/ControlledAutocomplete.esm.js";import{LoadingIndicator as oe}from"../LoadingIndicator/LoadingIndicator.esm.js";import{useFactOptions as ne}from"./useFactOptions.esm.js";const le=800,re=H(t=>({content:{padding:t.spacing(2,3),width:le},section:{margin:t.spacing(2,0)},expandedSection:{borderTop:`1px solid ${t.palette.divider}`,padding:t.spacing(0,2)},loading:{margin:t.spacing(2)},preview:{maxHeight:500,overflow:"auto",border:`1px solid ${t.palette.divider}`},pathSection:{display:"flex",alignItems:"center",margin:t.spacing(1,0)},testPathButton:{margin:t.spacing(1,1,.5,0)},collectorName:{fontSize:24}})),ce=({factRef:t,updateFactRef:N,path:m,updatePath:B,entityRef:p,updateEntityRef:G,pathResolver:i,onSave:x})=>{const a=re(),s=E(()=>{if(t)return z(t)},[t]),[g,R]=f(s?.source??null);U(()=>{s?.source&&R(s.source)},[s?.source]);const[h,W]=f("jsonpath"),[b,C]=f(),[S,k]=f(),{data:P}=Z(),I=E(()=>P?.map(c=>c.id)??[],[P]),{data:d}=X(s?.source,s?.name,!0),V=E(()=>d?_(d.schema):[],[d]),{data:y,isLoading:j}=Q(),M=y?.map(c=>c.id)?.sort()??[],{data:$}=K(),l=E(()=>y?.find(c=>c.id===g),[y,g]),{factOptions:D}=ne({selectedCollector:l}),{options:J,getOptionLabel:w}=ae(D),{data:r,isLoading:u}=Y({factRef:t||"",entityRef:S||"",path:b,pathResolver:i??h??void 0},!!t&&!!S),T=q(()=>{C(m),k(p)},[p,m]),A=E(()=>!!l?.config?.cache,[l]);return e.createElement(n,{className:a.content,"data-testid":"fact-explorer"},e.createElement(n,null,e.createElement(n,null,e.createElement(o,{variant:"subtitle1"},"Select an Integration"),e.createElement(v,{options:M,onChange:c=>{R(c),N("")},value:g,placeholder:"Integration",disabled:j,fullWidth:!0})),!!l&&e.createElement(e.Fragment,null,e.createElement(n,{className:a.section},ee(l.id)?e.createElement(te,{noMargin:!0,collectorId:l.id}):e.createElement(o,{variant:"h5",className:a.collectorName,component:"div"},l.name??l.id," "),!!l.description&&e.createElement(o,{variant:"body2"},l.description),e.createElement(v,{options:J,onChange:N,value:t??null,placeholder:"Select Fact",getOptionLabel:w,noOptionsText:"No Facts",fullWidth:!0}))),!!t&&e.createElement(e.Fragment,null,!!d?.schema&&e.createElement(n,{className:a.section},e.createElement(O,{elevation:1,title:"JSON Schema"},e.createElement("div",{className:a.preview},e.createElement(F,{data:d.schema})))),e.createElement(n,{className:a.section},e.createElement(o,{variant:"subtitle1"},"Path Resolver"),!i&&e.createElement(o,{variant:"caption"},"Defaults to jsonpath"),i?e.createElement(o,{variant:"body1"},i):e.createElement(v,{options:I,onChange:W,value:i??h,placeholder:"Path Resolver (Optional)",getOptionLabel:w,fullWidth:!0,disabled:!!i})),e.createElement(n,{className:a.section},e.createElement(o,{variant:"subtitle1"},"Path"),e.createElement(v,{options:(i??h)==="jsonpath"?V:[],onChange:c=>{b&&C(void 0),B(c)},value:m??null,placeholder:"Path",fullWidth:!0,freeSolo:!0}),e.createElement("div",{className:a.pathSection},!!x&&e.createElement(L,{className:a.testPathButton,variant:"contained",onClick:()=>x({factRef:t,path:m??"",pathResolver:h??i??""}),disabled:!m,color:"primary"},"Save")))),!!t&&e.createElement(O,{elevation:0,title:"Sample Fact and Test Path"},e.createElement(n,{className:a.expandedSection},e.createElement(n,{marginBottom:1},e.createElement(o,{variant:"subtitle1"},"Select an Entity"),e.createElement(o,{variant:"caption"},"Fact will be sampled from this entity."),e.createElement(v,{options:$??[],onChange:G,value:p??null,placeholder:"Entity Selection",fullWidth:!0})),e.createElement(n,null,e.createElement(L,{className:a.testPathButton,variant:"contained",onClick:T,disabled:!p,color:"primary"},"Sample Fact")),e.createElement(e.Fragment,null,!!b&&!u&&e.createElement(n,{className:a.section},e.createElement(o,{variant:"subtitle1"},"Resolved Value"),r?.resolvedValue!==null&&r?.resolvedValue!==void 0?e.createElement(n,{className:a.preview},e.createElement(F,{data:r?.resolvedValue})):e.createElement(o,{color:"textSecondary",variant:"body2"},"Could not resolve path")),!!S&&e.createElement(n,{className:a.section},e.createElement(o,{variant:"subtitle1"},"Fact Data"),A&&e.createElement(o,{variant:"caption"},"Uses cache when available."),!!u&&e.createElement("div",{className:a.loading},e.createElement(oe,null)),!u&&!!r?.fact&&e.createElement(n,{className:a.preview},e.createElement(F,{data:r?.fact?.data})),!u&&!!r?.collectionError&&e.createElement(o,{color:"textSecondary",variant:"body2"},"Failed to collect:"," ",r?.collectionError?.errorMessage),!u&&!r?.fact&&!r?.collectionError&&e.createElement(o,{color:"textSecondary",variant:"body2"},"Fact ",t," unavailable for entity ",p)))))))};export{ce as FactExplorer};
1
+ import{makeStyles as Q,Box as n,Typography as o,Button as w}from"@material-ui/core";import{parseFactRef as U}from"@spotify/backstage-plugin-soundcheck-common";import e,{useMemo as E,useState as g,useEffect as q,useCallback as X}from"react";import{useGetEntityRefs as Y}from"../../hooks/catalog/useGetEntityRefs.esm.js";import{useGetCollectors as Z}from"../../hooks/collectors/useGetCollectors.esm.js";import{useGetFactSchema as _}from"../../hooks/collectors/useGetFactSchema.esm.js";import{useGetFact as ee}from"../../hooks/useGetFact.esm.js";import{useGetPathResolvers as te}from"../../hooks/useGetPathResolvers.esm.js";import{generateJsonPaths as ae}from"../CheckForm/utils/checkFormUtils.esm.js";import{hasLogo as oe,CollectorLogo as ne}from"../CollectorsPage/CollectorListPage/CollectorLogo.esm.js";import{ExpandableSection as O}from"../ExpandableSection/ExpandableSection.esm.js";import{mapFiltersToCatalogFilter as le}from"../Filter/utils.esm.js";import"../Filter/FilterComponent.esm.js";import{emptyFilters as re}from"../Filter/types.esm.js";import{FormattedPreview as N}from"../FormattedPreview/FormattedPreview.esm.js";import"../FormControlledAutocomplete/FormControlledAutocomplete.esm.js";import{useLabelOptions as ie}from"../FormControlledAutocomplete/useLabelOptions.esm.js";import{ControlledAutocomplete as h}from"../FormControlledAutocomplete/ControlledAutocomplete.esm.js";import{LoadingIndicator as ce}from"../LoadingIndicator/LoadingIndicator.esm.js";import{useFactOptions as se}from"./useFactOptions.esm.js";const me=800,de=Q(t=>({content:{padding:t.spacing(2,3),width:me},section:{margin:t.spacing(2,0)},expandedSection:{borderTop:`1px solid ${t.palette.divider}`,padding:t.spacing(0,2)},loading:{margin:t.spacing(2)},preview:{maxHeight:500,overflow:"auto",border:`1px solid ${t.palette.divider}`},pathSection:{display:"flex",alignItems:"center",margin:t.spacing(1,0)},testPathButton:{margin:t.spacing(1,1,.5,0)},collectorName:{fontSize:24}})),k=t=>{const f=!t||Object.values(t).every(s=>!s?.length)?{...re(),selectedKinds:["Component","System"]}:t;return le(f)},pe=({factRef:t,updateFactRef:f,path:s,updatePath:B,entityRef:d,updateEntityRef:G,pathResolver:c,filters:I,onSave:C})=>{const a=de(),m=E(()=>{if(t)return U(t)},[t]),[y,R]=g(m?.source??null);q(()=>{m?.source&&R(m.source)},[m?.source]);const[v,T]=g("jsonpath"),[b,x]=g(),[S,j]=g(),{data:P}=te(),V=E(()=>P?.map(i=>i.id)??[],[P]),{data:p}=_(m?.source,m?.name,!0),W=E(()=>p?ae(p.schema):[],[p]),{data:F,isLoading:M}=Z(),$=F?.map(i=>i.id)?.sort()??[],{data:D,isLoading:J}=Y(k(I),500),l=E(()=>F?.find(i=>i.id===y),[F,y]),{factOptions:z}=se({selectedCollector:l}),{options:A,getOptionLabel:L}=ie(z),{data:r,isLoading:u}=ee({factRef:t||"",entityRef:S||"",path:b,pathResolver:c??v??void 0},!!t&&!!S),H=X(()=>{x(s),j(d)},[d,s]),K=E(()=>!!l?.config?.cache,[l]);return e.createElement(n,{className:a.content,"data-testid":"fact-explorer"},e.createElement(n,null,e.createElement(n,null,e.createElement(o,{variant:"subtitle1"},"Select an Integration"),e.createElement(h,{options:$,onChange:i=>{R(i),f("")},value:y,placeholder:"Integration",disabled:M,fullWidth:!0})),!!l&&e.createElement(e.Fragment,null,e.createElement(n,{className:a.section},oe(l.id)?e.createElement(ne,{noMargin:!0,collectorId:l.id}):e.createElement(o,{variant:"h5",className:a.collectorName,component:"div"},l.name??l.id," "),!!l.description&&e.createElement(o,{variant:"body2"},l.description),e.createElement(h,{options:A,onChange:f,value:t??null,placeholder:"Select Fact",getOptionLabel:L,noOptionsText:"No Facts",fullWidth:!0}))),!!t&&e.createElement(e.Fragment,null,!!p?.schema&&e.createElement(n,{className:a.section},e.createElement(O,{elevation:1,title:"JSON Schema"},e.createElement("div",{className:a.preview},e.createElement(N,{data:p.schema})))),e.createElement(n,{className:a.section},e.createElement(o,{variant:"subtitle1"},"Path Resolver"),!c&&e.createElement(o,{variant:"caption"},"Defaults to jsonpath"),c?e.createElement(o,{variant:"body1"},c):e.createElement(h,{options:V,onChange:T,value:c??v,placeholder:"Path Resolver (Optional)",getOptionLabel:L,fullWidth:!0,disabled:!!c})),e.createElement(n,{className:a.section},e.createElement(o,{variant:"subtitle1"},"Path"),e.createElement(h,{options:(c??v)==="jsonpath"?W:[],onChange:i=>{b&&x(void 0),B(i)},value:s??null,placeholder:"Path",fullWidth:!0,freeSolo:!0}),e.createElement("div",{className:a.pathSection},!!C&&e.createElement(w,{className:a.testPathButton,variant:"contained",onClick:()=>C({factRef:t,path:s??"",pathResolver:v??c??""}),disabled:!s,color:"primary"},"Save")))),!!t&&e.createElement(O,{elevation:0,title:"Sample Fact and Test Path"},e.createElement(n,{className:a.expandedSection},e.createElement(n,{marginBottom:1},e.createElement(o,{variant:"subtitle1"},"Select an Entity"),e.createElement(o,{variant:"caption"},"Fact will be sampled from this entity.",e.createElement("br",null),"If you don't see the entity in the drop-down list, you can type its reference in the format ","<kind>:<namespace>/<name>","."),e.createElement(h,{options:D??[],onChange:G,value:d??null,placeholder:"Entity Selection",isLoading:J,freeSolo:!0,fullWidth:!0})),e.createElement(n,null,e.createElement(w,{className:a.testPathButton,variant:"contained",onClick:H,disabled:!d,color:"primary"},"Sample Fact")),e.createElement(e.Fragment,null,!!b&&!u&&e.createElement(n,{className:a.section},e.createElement(o,{variant:"subtitle1"},"Resolved Value"),r?.resolvedValue!==null&&r?.resolvedValue!==void 0?e.createElement(n,{className:a.preview},e.createElement(N,{data:r?.resolvedValue})):e.createElement(o,{color:"textSecondary",variant:"body2"},"Could not resolve path")),!!S&&e.createElement(n,{className:a.section},e.createElement(o,{variant:"subtitle1"},"Fact Data"),K&&e.createElement(o,{variant:"caption"},"Uses cache when available."),!!u&&e.createElement("div",{className:a.loading},e.createElement(ce,null)),!u&&!!r?.fact&&e.createElement(n,{className:a.preview},e.createElement(N,{data:r?.fact?.data})),!u&&!!r?.collectionError&&e.createElement(o,{color:"textSecondary",variant:"body2"},"Failed to collect:"," ",r?.collectionError?.errorMessage),!u&&!r?.fact&&!r?.collectionError&&e.createElement(o,{color:"textSecondary",variant:"body2"},"Fact ",t," unavailable for entity ",d)))))))};export{pe as FactExplorer,k as toEntityFilterQuery};
2
2
  //# sourceMappingURL=FactExplorer.esm.js.map
@@ -1,2 +1,2 @@
1
- import t,{createContext as E,useState as e}from"react";import{FactExplorerDialog as h}from"./FactExplorerDialog.esm.js";const a=E({open:!1,updateOpen:()=>{},updateOnSave:()=>{},updateFactRef:()=>{},updatePath:()=>{},updateEntityRef:()=>{},updatePathResolver:()=>{}}),s=({children:r})=>{const[p,n]=e(!1),[o,u]=e(),[l,d]=e(),[c,f]=e(),[i,v]=e(),[R,m]=e();return t.createElement(a.Provider,{value:{open:p,updateOpen:n,onSave:o,updateOnSave:u,factRef:l,updateFactRef:d,path:c,updatePath:f,entityRef:i,updateEntityRef:v,pathResolver:R,updatePathResolver:m}},t.createElement(t.Fragment,null,r,t.createElement(h,null)))};export{a as FactExplorerContext,s as FactExplorerProvider};
1
+ import t,{createContext as h,useState as e}from"react";import{useFormContext as E}from"react-hook-form";import{FactExplorerDialog as x}from"./FactExplorerDialog.esm.js";const a=h({open:!1,updateOpen:()=>{},updateOnSave:()=>{},updateFactRef:()=>{},updatePath:()=>{},updateEntityRef:()=>{},updatePathResolver:()=>{}}),F=({children:r})=>{const[p,o]=e(!1),[n,l]=e(),[u,d]=e(),[c,f]=e(),[i,m]=e(),[s,v]=e(),R=E()?.getValues("filtersStep.filter");return t.createElement(a.Provider,{value:{open:p,updateOpen:o,onSave:n,updateOnSave:l,factRef:u,updateFactRef:d,path:c,updatePath:f,entityRef:i,updateEntityRef:m,pathResolver:s,updatePathResolver:v,filters:R}},t.createElement(t.Fragment,null,r,t.createElement(x,null)))};export{a as FactExplorerContext,F as FactExplorerProvider};
2
2
  //# sourceMappingURL=FactExplorerContext.esm.js.map
@@ -1,2 +1,2 @@
1
- import{Button as R}from"@material-ui/core";import E from"@material-ui/icons/Search";import a,{useContext as i}from"react";import{SoundcheckDialog as x}from"../SoundcheckDialog/SoundcheckDialog.esm.js";import{FactExplorer as v}from"./FactExplorer.esm.js";import{FactExplorerContext as m}from"./FactExplorerContext.esm.js";const F=()=>{const{open:e,updateOpen:o,onSave:r,factRef:p,updateFactRef:n,path:c,updatePath:l,entityRef:t,updateEntityRef:f,pathResolver:u}=i(m);return a.createElement(x,{open:e,handleClose:()=>o(!1),title:"Fact Explorer",fullScreen:!1},a.createElement(v,{onSave:r,factRef:p,updateFactRef:n,path:c,updatePath:l,entityRef:t,updateEntityRef:f,pathResolver:u}))},S=({onSave:e,factRef:o,path:r,pathResolver:p,className:n,text:c="Explore Facts",hideIcon:l})=>{const{updateOpen:t,updateOnSave:f,updateFactRef:u,updatePath:d,updatePathResolver:s}=i(m);return a.createElement(R,{onClick:()=>{t(!0),u(o??""),d(r??""),s(p??""),f(()=>h=>{e&&e(h),t(!1)})},className:n,variant:"text",startIcon:l?void 0:a.createElement(E,null)},c)};export{F as FactExplorerDialog,S as FactExplorerDialogButton};
1
+ import{Button as R}from"@material-ui/core";import E from"@material-ui/icons/Search";import a,{useContext as s}from"react";import{SoundcheckDialog as x}from"../SoundcheckDialog/SoundcheckDialog.esm.js";import{FactExplorer as v}from"./FactExplorer.esm.js";import{FactExplorerContext as m}from"./FactExplorerContext.esm.js";const F=()=>{const{open:e,updateOpen:o,onSave:r,factRef:p,updateFactRef:n,path:l,updatePath:c,entityRef:t,updateEntityRef:f,pathResolver:i,filters:u}=s(m);return a.createElement(x,{open:e,handleClose:()=>o(!1),title:"Fact Explorer",fullScreen:!1},a.createElement(v,{onSave:r,factRef:p,updateFactRef:n,path:l,updatePath:c,entityRef:t,updateEntityRef:f,pathResolver:i,filters:u}))},S=({onSave:e,factRef:o,path:r,pathResolver:p,className:n,text:l="Explore Facts",hideIcon:c})=>{const{updateOpen:t,updateOnSave:f,updateFactRef:i,updatePath:u,updatePathResolver:d}=s(m);return a.createElement(R,{onClick:()=>{t(!0),i(o??""),u(r??""),d(p??""),f(()=>h=>{e&&e(h),t(!1)})},className:n,variant:"text",startIcon:c?void 0:a.createElement(E,null)},l)};export{F as FactExplorerDialog,S as FactExplorerDialogButton};
2
2
  //# sourceMappingURL=FactExplorerDialog.esm.js.map
@@ -1,2 +1,2 @@
1
- import{TextField as f}from"@material-ui/core";import{Autocomplete as g}from"@material-ui/lab";import n,{useState as h}from"react";import{ListboxVirtualized as b}from"../ListboxVirtualized/ListboxVirtualized.esm.js";const x=({options:l,onChange:i,value:e,placeholder:r,getOptionLabel:a,disabled:p,fullWidth:u,noOptionsText:m,freeSolo:d=!1})=>{const[s,c]=h(e??"");return n.createElement(g,{options:l,inputValue:s,onInputChange:(o,t)=>c(t),onChange:(o,t)=>i(t),value:e===""?null:e,getOptionLabel:a,ListboxComponent:b,disabled:p,fullWidth:u,noOptionsText:m,freeSolo:d,autoSelect:!0,renderInput:o=>n.createElement(f,{...o,placeholder:r,variant:"outlined",margin:"dense"})})};export{x as ControlledAutocomplete};
1
+ import{TextField as g}from"@material-ui/core";import{Autocomplete as b}from"@material-ui/lab";import n,{useState as h}from"react";import{ListboxVirtualized as x}from"../ListboxVirtualized/ListboxVirtualized.esm.js";const C=({options:l,onChange:i,value:e,placeholder:r,getOptionLabel:a,disabled:p,fullWidth:d,noOptionsText:u,freeSolo:m=!1,isLoading:s=!1})=>{const[c,f]=h(e??"");return n.createElement(b,{options:l,inputValue:c,onInputChange:(t,o)=>f(o),onChange:(t,o)=>i(o),value:e===""?null:e,getOptionLabel:a,ListboxComponent:x,disabled:p,fullWidth:d,noOptionsText:u,freeSolo:m,loading:s,autoSelect:!0,renderInput:t=>n.createElement(g,{...t,placeholder:r,variant:"outlined",margin:"dense"})})};export{C as ControlledAutocomplete};
2
2
  //# sourceMappingURL=ControlledAutocomplete.esm.js.map
@@ -1,2 +1,2 @@
1
- import{makeStyles as l,Typography as m,Link as a}from"@material-ui/core";import i from"@material-ui/icons/InfoOutlined";import e from"react";const o=l(()=>({centerAlignment:{display:"flex",alignItems:"center"}})),c=({title:n,docLink:t})=>{const r=o();return e.createElement(m,{variant:"subtitle2",className:r.centerAlignment},n,t&&e.createElement(a,{className:r.centerAlignment,target:"_blank",rel:"noopener noreferrer",href:t},e.createElement(i,{style:{marginLeft:4},fontSize:"inherit"})))};export{c as FormFieldLabel};
1
+ import{makeStyles as l,Typography as m,Link as i}from"@material-ui/core";import a from"@material-ui/icons/InfoOutlined";import e from"react";const o=l(()=>({centerAlignment:{display:"flex",alignItems:"center"}})),c=({title:n,docLink:t})=>{const r=o();return e.createElement(m,{variant:"subtitle2",className:r.centerAlignment},n,t&&e.createElement(i,{className:r.centerAlignment,target:"_blank",rel:"noopener noreferrer",href:t},e.createElement(a,{style:{marginLeft:4},fontSize:"inherit"})))};export{c as FormFieldLabel};
2
2
  //# sourceMappingURL=FormFieldLabel.esm.js.map
@@ -1,2 +1,2 @@
1
- import{useApi as S,configApiRef as v}from"@backstage/core-plugin-api";import{makeStyles as E,alpha as b,TextField as O,CircularProgress as k}from"@material-ui/core";import y from"@material-ui/lab/Autocomplete";import u,{useMemo as F,useCallback as C,useEffect as g}from"react";import{useSearchParams as P}from"react-router-dom";import w from"react-use/lib/useLocalStorage";import{useOptions as x}from"./useOptions.esm.js";const A=E(r=>({root:{width:"100%",minWidth:250},textField:{"& $notchedOutline":{borderColor:b(r.page.fontColor,.25)},"&:hover $notchedOutline":{borderColor:r.page.fontColor}},input:{backgroundColor:"transparent",color:r.page.fontColor},clearIndicator:{color:r.page.fontColor},popupIndicator:{color:r.page.fontColor},notchedOutline:{}}),{name:"SoundcheckGroupSelector"}),G=({setError:r})=>{const{options:o,isLoading:a,isError:s}=x(),t=A(),[i,f]=P(),[n,h]=w("soundcheck.overview.groupRef",null),p=i.get("group"),d=S(v).getOptionalString("soundcheck.overview.defaultSelectedGroupType"),m=F(()=>{if(!a&&o.length){if(p||n){const e=p??n;return o.find(c=>c.ref===e)??o[0]}else if(d)return o.find(e=>e.type===d)??o[0];return o[0]}return null},[d,a,o,p,n]),l=C((e,c)=>{e&&i.get("group")!==e&&(i.set("group",e),f(i,{replace:c}),h(e))},[i,h,f]),I=C((e,c)=>{l?.(c?.ref)},[l]);return g(()=>{n&&!p&&l(n,!0)},[n,p,l]),g(()=>{l(m?.ref,!0)},[l,m]),g(()=>{r?.(s?new Error("Error loading groups"):void 0)},[s,r]),s?null:u.createElement(y,{"aria-label":"Current group",className:t.root,classes:{clearIndicator:t.clearIndicator,popupIndicator:t.popupIndicator},disableClearable:!0,options:o??[],loading:a,groupBy:e=>e.key,value:m,freeSolo:!1,onChange:I,getOptionLabel:e=>e.name,renderInput:e=>u.createElement(O,{...e,variant:"outlined",placeholder:a?"Loading":"Select a group",className:t.textField,InputProps:{...e.InputProps,className:t.input,classes:{notchedOutline:t.notchedOutline},endAdornment:u.createElement(u.Fragment,null,a?u.createElement(k,{color:"inherit",size:20}):null,e.InputProps.endAdornment)}})})};export{G as GroupSelector};
1
+ import{useApi as E,configApiRef as v}from"@backstage/core-plugin-api";import{makeStyles as O,alpha as k,TextField as w,CircularProgress as y}from"@material-ui/core";import P from"@material-ui/lab/Autocomplete";import s,{useMemo as x,useCallback as I,useEffect as f}from"react";import{useSearchParams as A}from"react-router-dom";import F from"react-use/lib/useLocalStorage";import{useGroupOptions as G}from"../../hooks/groups/useGroupOptions.esm.js";const L=O(r=>({root:{width:"100%",minWidth:250},textField:{"& $notchedOutline":{borderColor:k(r.page.fontColor,.25)},"&:hover $notchedOutline":{borderColor:r.page.fontColor}},input:{backgroundColor:"transparent",color:r.page.fontColor},clearIndicator:{color:r.page.fontColor},popupIndicator:{color:r.page.fontColor},notchedOutline:{}}),{name:"SoundcheckGroupSelector"}),N=({setError:r,margin:S,baseClass:a})=>{const{options:o,isLoading:p,isError:d}=G(),t=L(),[i,h]=A(),[n,C]=F("soundcheck.overview.groupRef",null),u=i.get("group"),m=E(v).getOptionalString("soundcheck.overview.defaultSelectedGroupType"),g=x(()=>{if(!p&&o.length){if(u||n){const e=u??n;return o.find(c=>c.ref===e)??o[0]}else if(m)return o.find(e=>e.type===m)??o[0];return o[0]}return null},[m,p,o,u,n]),l=I((e,c)=>{e&&i.get("group")!==e&&(i.set("group",e),h(i,{replace:c}),C(e))},[i,C,h]),b=I((e,c)=>{l?.(c?.ref)},[l]);return f(()=>{n&&!u&&l(n,!0)},[n,u,l]),f(()=>{l(g?.ref,!0)},[l,g]),f(()=>{r?.(d?new Error("Error loading groups"):void 0)},[d,r]),d?null:s.createElement(P,{"aria-label":"Current group",className:a?"":t.root,classes:{clearIndicator:a?"":t.clearIndicator,popupIndicator:a?"":t.popupIndicator},disableClearable:!0,options:o??[],loading:p,groupBy:e=>e.key,value:g,freeSolo:!1,onChange:b,getOptionLabel:e=>e.name,renderInput:e=>s.createElement(w,{...e,variant:"outlined",placeholder:p?"Loading":"Select a group",className:t.textField,margin:S,InputProps:{...e.InputProps,className:a?"":t.input,classes:{notchedOutline:a?"":t.notchedOutline},endAdornment:s.createElement(s.Fragment,null,p?s.createElement(y,{color:"inherit",size:20}):null,e.InputProps.endAdornment)}})})};export{N as GroupSelector};
2
2
  //# sourceMappingURL=GroupSelector.esm.js.map
@@ -0,0 +1,2 @@
1
+ import{useRouteRef as c}from"@backstage/core-plugin-api";import{makeStyles as s,Grid as l,Accordion as g,AccordionSummary as d,Typography as f,AccordionDetails as E}from"@material-ui/core";import u from"@material-ui/icons/ExpandMore";import e from"react";import{Link as y}from"react-router-dom";import"@backstage/catalog-model";import"@tanstack/react-query";import"../../../api.esm.js";import"../../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"../../../hooks/useSoundcheckAlert.esm.js";import{useGetCampaigns as h}from"../../../hooks/campaigns/useGetCampaigns.esm.js";import"../../../hooks/useConfirmationModal.esm.js";import{campaignsPageRouteRef as x}from"../../../routes.esm.js";import{OVERVIEW_CAMPAIGNS_COUNT as m}from"../OverviewPageContent.esm.js";import{CampaignBanner as C}from"./CampaignBanner.esm.js";const A=s(a=>({campaignsGrid:{margin:`0 0 ${a.spacing(3)}px`,border:`1px solid ${a.palette.divider}`},campaignsCard:{display:"flex",width:"100%",flexDirection:"column",padding:a.spacing(2),gap:a.spacing(2)},campaignsLink:{textAlign:"center",margin:`${a.spacing(1)}rem 0 ${a.spacing(1)}`}})),R=({ownerEntityRef:a})=>{const i=A(),n=c(x),{data:o}=h({orderAlphabetical:"default",searchByOwner:a,searchByStatus:"active"},!!a),t=o?.edges.map(r=>r.node),p=t?.slice(0,m);return e.createElement(e.Fragment,null,t&&t.length>0&&e.createElement(l,{item:!0,xs:12,className:i.campaignsGrid},e.createElement(g,{style:{boxShadow:"none"}},e.createElement(d,{expandIcon:e.createElement(u,null)},e.createElement(f,{variant:"h6"},"Campaigns")),e.createElement(E,null,e.createElement("div",{className:i.campaignsCard},p?.map(r=>e.createElement("div",{key:r.id},e.createElement(C,{campaign:r})))),t.length>m&&e.createElement(y,{to:n(),className:i.campaignsLink},"More Campaigns")))))};export{R as CampaignArea};
2
+ //# sourceMappingURL=CampaignArea.esm.js.map
@@ -1,2 +1,2 @@
1
- import{Page as m,Header as a}from"@backstage/core-components";import{makeStyles as c}from"@material-ui/core";import{SpotifyLicenseBanner as l}from"@spotify/backstage-plugin-core";import e,{useState as s}from"react";import{UserProvider as p}from"../../contexts/UserProvider.esm.js";import d from"../../hooks/useConfirmationModal.esm.js";import{soundcheckBackend as v,invalidLicenseMessage as f}from"../../utils/license.esm.js";import{GroupSelector as u}from"../GroupSelector/GroupSelector.esm.js";import{SoundcheckQueryClientProvider as E}from"../SoundcheckQueryClientProvider/SoundcheckQueryClientProvider.esm.js";import{OverviewPageContent as g}from"./OverviewPageContent.esm.js";const S=c(r=>({overviewContainer:{padding:r.spacing(1,3)}})),k=r=>{const{title:t="Soundcheck"}=r,o=S(),[n,i]=s(void 0);return e.createElement(E,null,e.createElement(p,null,e.createElement(d,null,e.createElement(m,{themeId:"website"},e.createElement(l,{backend:v,invalidLicenseMessage:f}),e.createElement(a,{title:t},e.createElement(u,{setError:i})),e.createElement("div",{className:o.overviewContainer},e.createElement(g,{groupSelectorError:n}))))))};export{k as OverviewPage};
1
+ import{Page as o,Header as i}from"@backstage/core-components";import{makeStyles as m}from"@material-ui/core";import{SpotifyLicenseBanner as a}from"@spotify/backstage-plugin-core";import e from"react";import{UserProvider as c}from"../../contexts/UserProvider.esm.js";import l from"../../hooks/useConfirmationModal.esm.js";import{soundcheckBackend as s,invalidLicenseMessage as d}from"../../utils/license.esm.js";import{SoundcheckQueryClientProvider as p}from"../SoundcheckQueryClientProvider/SoundcheckQueryClientProvider.esm.js";import{OverviewPageContent as v}from"./OverviewPageContent.esm.js";const f=m(r=>({overviewContainer:{padding:r.spacing(1,3)}})),u=r=>{const{title:t="Soundcheck"}=r,n=f();return e.createElement(p,null,e.createElement(c,null,e.createElement(l,null,e.createElement(o,{themeId:"website"},e.createElement(a,{backend:s,invalidLicenseMessage:d}),e.createElement(i,{title:t}),e.createElement("div",{className:n.overviewContainer},e.createElement(v,null))))))};export{u as OverviewPage};
2
2
  //# sourceMappingURL=OverviewPage.esm.js.map
@@ -1,2 +1,2 @@
1
- import{Link as N}from"@backstage/core-components";import{useRouteRef as A}from"@backstage/core-plugin-api";import{makeStyles as G,Grid as p,Accordion as L,AccordionSummary as R,Typography as P,AccordionDetails as T}from"@material-ui/core";import F from"@material-ui/icons/ExpandMore";import e,{useState as k,useEffect as B,useCallback as I}from"react";import{useSearchParams as $}from"react-router-dom";import{useGetCampaigns as D}from"../../hooks/campaigns/useGetCampaigns.esm.js";import{useFacetsForOwner as H}from"../../hooks/facets/useFacetsForOwner.esm.js";import{campaignsPageRouteRef as M}from"../../routes.esm.js";import{LoadingIndicator as V}from"../LoadingIndicator/LoadingIndicator.esm.js";import{OverviewTable as _}from"../OverviewTable/OverviewTable.esm.js";import{RowHeights as j}from"../OverviewTable/resultsTableUtils.esm.js";import"../SoundcheckHeader/SoundcheckHeader.esm.js";import"../SoundcheckHeader/SoundcheckHeaderContext.esm.js";import{useSetHeaderDefault as z}from"../SoundcheckHeader/useHeader.esm.js";import{CampaignBanner as J}from"./CampaignBanner/CampaignBanner.esm.js";import{OverviewTabs as U}from"./OverviewTabs.esm.js";import{OverviewTabsSkeleton as W}from"./OverviewTabsSkeleton.esm.js";const q=G(a=>({tableContainer:{padding:0,backgroundColor:"transparent",paddingBottom:j.paginationControl},campaignsGrid:{margin:`0 0 ${a.spacing(3)}px`,border:`1px solid ${a.palette.divider}`},campaignsCard:{display:"flex",width:"100%",flexDirection:"column",padding:a.spacing(2),gap:a.spacing(2)},campaignsLink:{textAlign:"center",margin:`${a.spacing(1)}rem 0 ${a.spacing(1)}`},tableLoading:{backgroundColor:a.palette.background.paper,padding:a.spacing(6)},noPadding:{padding:0},accordion:{boxShadow:"none"}})),l=3,K=({groupSelectorError:a,isFixedGroup:y=!1})=>{const[n,g]=$(),{group:o,kind:s,type:c}=Object.fromEntries(n.entries());z();const C=A(M),[r,f]=k(void 0),[b,v]=k(void 0);B(()=>{(r?.kind!==s||r?.type!==c)&&f({kind:s,type:c})},[s,c,r]);const{data:u,isLoading:E}=H(o),{data:x}=D({orderAlphabetical:"default",searchByOwner:o,searchByStatus:"active"},!!o),m=x?.edges.map(t=>t.node),h=m?.slice(0,l),w=b||a,S=I((t,d,O)=>{t&&(f({kind:t,type:d}),d?(n.set("kind",t),n.set("type",d)):(n.delete("type"),n.set("kind",t)),g(n,{replace:O}))},[n,g]),i=q();return e.createElement(p,{container:!0,spacing:0},m&&m.length>0&&e.createElement(p,{item:!0,xs:12,className:i.campaignsGrid},e.createElement(L,{style:{boxShadow:"none"}},e.createElement(R,{expandIcon:e.createElement(F,null)},e.createElement(P,{variant:"h6"},"Campaigns")),e.createElement(T,null,e.createElement("div",{className:i.campaignsCard},h?.map(t=>e.createElement("div",{key:t.id},e.createElement(J,{campaign:t})))),m.length>l&&e.createElement(N,{to:C(),className:i.campaignsLink},"More Campaigns")))),e.createElement(p,{item:!0,xs:12,className:i.noPadding},E?e.createElement(W,null):e.createElement(U,{unfilteredFacets:u,kind:r?.kind,type:r?.type,onChange:S})),e.createElement(p,{item:!0,xs:12,className:i.tableContainer},E?e.createElement("div",{className:i.tableLoading},e.createElement(V,{size:80})):e.createElement(_,{facets:u,kind:r?.kind,type:r?.type,setError:v,hasError:w,ownerEntityRef:o,isFixedGroup:y})))};export{l as OVERVIEW_CAMPAIGNS_COUNT,K as OverviewPageContent};
1
+ import{makeStyles as L,Grid as l}from"@material-ui/core";import t,{createContext as N,useState as i,useEffect as A,useCallback as D}from"react";import{useSearchParams as R}from"react-router-dom";import H from"react-use/lib/useDebounce";import{useFacetsForOwner as I}from"../../hooks/facets/useFacetsForOwner.esm.js";import{LoadingIndicator as $}from"../LoadingIndicator/LoadingIndicator.esm.js";import{OverviewTable as M}from"../OverviewTable/OverviewTable.esm.js";import{RowHeights as T}from"../OverviewTable/resultsTableUtils.esm.js";import"../SoundcheckHeader/SoundcheckHeader.esm.js";import"../SoundcheckHeader/SoundcheckHeaderContext.esm.js";import{useSetHeaderDefault as _}from"../SoundcheckHeader/useHeader.esm.js";import"@backstage/core-plugin-api";import"@backstage/plugin-catalog-react";import"@material-ui/icons/ArrowDropDown";import"@material-ui/icons/ArrowDropUp";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import"../../routes.esm.js";import"../CampaignDetailsPage/CampaignDetails.esm.js";import"../TechHealth/Loading/Loading.esm.js";import"./CampaignBanner/useCampaignBannerStyles.esm.js";import{CampaignArea as j}from"./CampaignBanner/CampaignArea.esm.js";import{OverviewPageHeader as z}from"./OverviewPageHeader.esm.js";const B=L(e=>({tableContainer:{padding:0,backgroundColor:"transparent",paddingBottom:T.paginationControl},campaignsGrid:{margin:`0 0 ${e.spacing(3)}px`,border:`1px solid ${e.palette.divider}`},campaignsCard:{display:"flex",width:"100%",flexDirection:"column",padding:e.spacing(2),gap:e.spacing(2)},campaignsLink:{textAlign:"center",margin:`${e.spacing(1)}rem 0 ${e.spacing(1)}`},tableLoading:{backgroundColor:e.palette.background.paper,padding:e.spacing(6)},noPadding:{padding:0},accordion:{boxShadow:"none"}})),b=N({searchValue:"",updateSearchValue:e=>{},debouncedSearchValue:"",updateDebouncedSearchValue:e=>{},pivot:!1,updatePivot:e=>{}}),U=3,W=({isFixedGroup:e=!1,campaignsEnabled:k})=>{const[a,g]=R(),{group:n,kind:p,type:d}=Object.fromEntries(a.entries());_();const[r,u]=i(void 0),[h,x]=i(void 0),[y,C]=i(),[m,S]=i(""),[w,f]=i(""),[P,V]=i(!1);H(()=>{f(m)},800,[m]),A(()=>{(r?.kind!==p||r?.type!==d)&&u({kind:p,type:d})},[p,d,r]);const{data:E,isLoading:v}=I(n),O=h||y,F=D((o,s,G)=>{o&&(u({kind:o,type:s}),s?(a.set("kind",o),a.set("type",s)):(a.delete("type"),a.set("kind",o)),g(a,{replace:G}))},[a,g]),c=B();return t.createElement(b.Provider,{value:{searchValue:m,updateSearchValue:S,debouncedSearchValue:w,updateDebouncedSearchValue:f,pivot:P,updatePivot:V}},t.createElement(l,{container:!0,spacing:0},k&&t.createElement(j,{ownerEntityRef:n}),t.createElement(l,{item:!0,xs:12,className:c.noPadding},t.createElement(z,{unfilteredFacets:E,kind:r?.kind,type:r?.type,onChange:F,setError:C,isLoading:v,isFixedGroup:e})),t.createElement(l,{item:!0,xs:12,className:c.tableContainer},v?t.createElement("div",{className:c.tableLoading},t.createElement($,{size:80})):t.createElement(M,{facets:E,kind:r?.kind,type:r?.type,setError:x,hasError:O,ownerEntityRef:n,isFixedGroup:e}))))};export{U as OVERVIEW_CAMPAIGNS_COUNT,W as OverviewPageContent,b as OverviewPageContext};
2
2
  //# sourceMappingURL=OverviewPageContent.esm.js.map
@@ -0,0 +1,2 @@
1
+ import{makeStyles as S,Typography as s,TextField as y,CircularProgress as T,Switch as w}from"@material-ui/core";import i from"@material-ui/core/Box";import I from"@material-ui/icons/Search";import{Autocomplete as L}from"@material-ui/lab";import t,{useContext as F,useEffect as W}from"react";import{GroupSelector as $}from"../GroupSelector/GroupSelector.esm.js";import{OverviewPageContext as A}from"./OverviewPageContent.esm.js";const B=S(r=>({wrapper:{background:r.palette.background.default,paddingTop:r.spacing(0),paddingBottom:r.spacing(2),paddingRight:r.spacing(3),display:"flex",gap:r.spacing(3)},switchLabel:{marginLeft:r.spacing(1.5)}})),G=({setError:r,unfilteredFacets:f,kind:l,type:o,onChange:m,isLoading:h,isFixedGroup:E})=>{const v=B(),a={types:f?.types.filter(({count:e})=>e>0)??[]},{searchValue:b,updateSearchValue:x,pivot:d,updatePivot:k}=F(A);W(()=>{const e=a?.types&&a.types.length>=0,n=!l&&e,p=l&&e&&!a?.types.find(({kind:c,type:g})=>l===c&&(!o&&!g||o===g));(n||p)&&m(a?.types[0]?.kind??"",a?.types[0]?.type,!0)},[l,o,a?.types,m]);const u=a?.types.map(({kind:e,type:n,count:p})=>{const c=`${e}|${n??""}`;return{facetKind:e,facetType:n,key:c,label:`${n??e} (${p>50?"50+":p})`,id:c}}).sort((e,n)=>e.key.localeCompare(n.key))??[],P=u.find(e=>e.key===`${l}|${o??""}`)??null,C=a&&(a.types?.length??0)>0;return t.createElement(i,{className:v.wrapper},!E&&t.createElement(i,{flex:1,maxWidth:364},t.createElement(s,{variant:"subtitle2",component:"div"},"Group"),t.createElement($,{baseClass:!0,margin:"dense",setError:r})),C&&t.createElement(t.Fragment,null,t.createElement(i,{flex:1,maxWidth:500},t.createElement(s,{variant:"subtitle2",component:"div"},"Entity Type"),t.createElement(L,{"aria-label":"Entity Type Selection",disableClearable:!0,options:u??[],freeSolo:!1,groupBy:e=>e.facetKind,getOptionLabel:e=>e.label,value:P,onChange:(e,n)=>m(n.facetKind,n.facetType,!0),renderInput:e=>t.createElement(y,{...e,variant:"outlined",placeholder:"Select entity type",margin:"dense",fullWidth:!0,InputProps:{...e.InputProps,endAdornment:t.createElement(t.Fragment,null,h?t.createElement(T,{color:"inherit",size:20}):null,e.InputProps.endAdornment)}})})),t.createElement(i,{maxWidth:580,flex:1},t.createElement(s,{variant:"subtitle2",component:"div"},"Search Entities"),t.createElement(y,{margin:"dense",placeholder:"Search entities",variant:"outlined",fullWidth:!0,value:b,onChange:e=>x(e.currentTarget.value),InputProps:{startAdornment:t.createElement(i,{marginRight:.75,display:"flex",alignItems:"center"},t.createElement(I,{color:"inherit"}))}})),t.createElement(i,{display:"flex",flexDirection:"column"},t.createElement(s,{style:{marginLeft:10},variant:"subtitle2",component:"div"},"Pivot"),t.createElement(i,{flex:1,display:"flex",alignItems:"center"},t.createElement(w,{checked:d,onChange:()=>k(!d),inputProps:{"aria-label":"pivot overview table"}})))))};export{G as OverviewPageHeader};
2
+ //# sourceMappingURL=OverviewPageHeader.esm.js.map
@@ -1,2 +1,2 @@
1
- import{OverviewPage as o}from"./OverviewPage.esm.js";import{FixedGroupOverviewPage as i}from"./FixedGroupOverviewPage.esm.js";export{i as FixedGroupOverviewPage,o as OverviewPage};
1
+ import{OverviewPage as o}from"./OverviewPage.esm.js";import{FixedGroupOverviewPage as t}from"./FixedGroupOverviewPage.esm.js";import{OverviewPageContext as i}from"./OverviewPageContent.esm.js";export{t as FixedGroupOverviewPage,o as OverviewPage,i as OverviewPageContext};
2
2
  //# sourceMappingURL=index.esm.js.map
@@ -1,2 +1,2 @@
1
- import{parseEntityRef as l}from"@backstage/catalog-model";import{MarkdownContent as s}from"@backstage/core-components";import{humanizeEntityRef as f}from"@backstage/plugin-catalog-react";import{makeStyles as d,Grid as o,Typography as p}from"@material-ui/core";import e from"react";import{StyledTooltip as y}from"../../StyledTooltip/StyledTooltip.esm.js";const m=d(t=>({headerWrapper:{marginTop:t.spacing(.5)},entityRefName:{fontWeight:"bold"},iconWrapper:{padding:t.spacing(1.5,.5),display:"flex",alignItems:"center",justifyContent:"center"}})),h=({check:{name:t,description:n},icon:r,entityRef:a})=>{const i=m(),c=l(a);return e.createElement(o,{spacing:1},e.createElement(o,{container:!0,direction:"row",spacing:1,wrap:"nowrap"},e.createElement("div",{className:i.iconWrapper},r),e.createElement(p,{variant:"h6",className:i.headerWrapper,noWrap:!0},t)),e.createElement(o,{item:!0,wrap:"nowrap"},e.createElement(p,{variant:"subtitle2",className:i.entityRefName},f(c,{defaultKind:c.kind}))),e.createElement(s,{content:n}))},E=({children:t,check:n,icon:r,entityRef:a})=>e.createElement(y,{arrow:!0,title:e.createElement(h,{check:n,icon:r,entityRef:a}),enterDelay:150,placement:"top"},t);export{E as CheckCellTooltip,m as useStyles};
1
+ import{parseEntityRef as p}from"@backstage/catalog-model";import{MarkdownContent as s}from"@backstage/core-components";import{humanizeEntityRef as f}from"@backstage/plugin-catalog-react";import{makeStyles as d,Grid as o,Typography as m}from"@material-ui/core";import e from"react";import{StyledTooltip as y}from"../../StyledTooltip/StyledTooltip.esm.js";const l=d(t=>({headerWrapper:{marginTop:t.spacing(.5)},entityRefName:{fontWeight:"bold"},iconWrapper:{padding:t.spacing(1,.5),display:"flex",alignItems:"center",justifyContent:"center"}})),h=({check:{name:t,description:n},icon:r,entityRef:a})=>{const i=l(),c=p(a);return e.createElement(o,null,e.createElement(o,{container:!0,direction:"row",spacing:1,wrap:"nowrap"},e.createElement("div",{className:i.iconWrapper},r),e.createElement(m,{variant:"h6",className:i.headerWrapper,noWrap:!0},t)),e.createElement(o,{item:!0},e.createElement(m,{variant:"subtitle2",className:i.entityRefName},f(c,{defaultKind:c.kind}))),e.createElement(s,{content:n}))},E=({children:t,check:n,icon:r,entityRef:a})=>e.createElement(y,{arrow:!0,title:e.createElement(h,{check:n,icon:r,entityRef:a}),enterDelay:150,placement:"top"},t);export{E as CheckCellTooltip,l as useStyles};
2
2
  //# sourceMappingURL=CheckCellTooltip.esm.js.map
@@ -0,0 +1,2 @@
1
+ import{MarkdownContent as i}from"@backstage/core-components";import{makeStyles as m,Typography as p}from"@material-ui/core";import l from"react";import{StyledTooltip as s}from"../../StyledTooltip/StyledTooltip.esm.js";import{CellWidths as k}from"../resultsTableUtils.esm.js";const d=m(e=>({cellWrapper:{display:"flex",alignItems:"flex-end",height:"100%"},cellText:{textOrientation:"mixed",transform:`translateX(${k.checkResult*.4}px) rotate(-55deg)`,transformOrigin:"center left",wordBreak:"keep-all",fontWeight:"bold","&:hover":{cursor:"default"}},cellLink:{overflow:"hidden",textOverflow:"ellipsis",width:"125px",display:"inline-block"},trackCell:{fontSize:e.typography.subtitle1.fontSize},levelCell:{fontSize:e.typography.subtitle2.fontSize},checkCell:{fontWeight:"normal"}}));var n=(e=>(e.track="track",e.level="level",e.check="check",e))(n||{});const f=({label:e,description:r,cellType:a})=>{const t=d(),c={track:t.trackCell,level:t.levelCell,check:t.checkCell},o=e?l.createElement(s,{title:l.createElement(l.Fragment,null,l.createElement(p,{variant:"subtitle1",component:"div"},e),r&&l.createElement(i,{content:r})),arrow:!0,placement:"left-end"},l.createElement("div",{className:`${t.cellLink} ${a?c[a]:""}`},e)):l.createElement(l.Fragment,null);return l.createElement("div",{className:t.cellWrapper},l.createElement("div",{className:t.cellText},o))};export{f as CheckLabelCell,n as CheckLabelCellType};
2
+ //# sourceMappingURL=CheckLabelCell.esm.js.map
@@ -1,2 +1,2 @@
1
- import{parseEntityRef as m}from"@backstage/catalog-model";import{Link as d}from"@backstage/core-components";import{useRouteRef as f}from"@backstage/core-plugin-api";import{entityRouteRef as p,humanizeEntityRef as r}from"@backstage/plugin-catalog-react";import{makeStyles as s}from"@material-ui/core";import t from"react";import{useEntityByRef as c}from"../../../hooks/catalog/useEntityByRef.esm.js";import{StyledTooltip as y}from"../../StyledTooltip/StyledTooltip.esm.js";import{CellWidths as k}from"../resultsTableUtils.esm.js";const u=s(()=>({cellWrapper:{display:"flex",alignItems:"flex-end",height:"100%"},cellText:{textOrientation:"mixed",transform:`translateX(${k.checkResult*.4}px) rotate(-55deg)`,transformOrigin:"center left",wordBreak:"keep-all",fontWeight:"bold"},cellLink:{overflow:"hidden",textOverflow:"ellipsis",width:"125px",display:"inline-block"}})),x=({entityRef:i})=>{const{data:l}=c(i),n=f(p),a=u(),e=i?m(i):void 0,o=e?t.createElement(y,{title:l?.metadata.title?l.metadata.title:r(e,{defaultKind:e.kind}),arrow:!0,placement:"left-end"},t.createElement(d,{className:a.cellLink,"aria-label":`entity link to ${e.name}`,to:n(e)},l?.metadata.title?l.metadata.title:r(e,{defaultKind:e.kind}))):t.createElement(t.Fragment,null);return t.createElement("div",{className:a.cellWrapper},t.createElement("div",{className:a.cellText},o))};export{x as EntityRefCell};
1
+ import{parseEntityRef as p}from"@backstage/catalog-model";import{Link as m}from"@backstage/core-components";import{useRouteRef as k}from"@backstage/core-plugin-api";import{entityRouteRef as h,humanizeEntityRef as r}from"@backstage/plugin-catalog-react";import{makeStyles as x,Box as n}from"@material-ui/core";import t from"react";import{useEntityByRef as y}from"../../../hooks/catalog/useEntityByRef.esm.js";import{StyledTooltip as d}from"../../StyledTooltip/StyledTooltip.esm.js";import{CellWidths as f,RowHeights as E}from"../resultsTableUtils.esm.js";const u=x(a=>({cellWrapper:{display:"flex",alignItems:"flex-end",height:"100%"},cellText:{textOrientation:"mixed",transform:`translateX(${f.checkResult*.4}px) rotate(-55deg)`,transformOrigin:"center left",wordBreak:"keep-all",fontWeight:"bold"},cellLink:{overflow:"hidden",textOverflow:"ellipsis",width:"125px",display:"inline-block"},cellNotTransformed:{display:"flex",alignItems:"center",border:`1px solid ${a.palette.divider}`,borderTop:"none"}})),g=({entityRef:a,noTransform:c})=>{const{data:l}=y(a),o=k(h),i=u(),e=a?p(a):void 0,s=e?t.createElement(d,{title:l?.metadata.title?l.metadata.title:r(e,{defaultKind:e.kind}),arrow:!0,placement:"left-end"},t.createElement(m,{className:i.cellLink,"aria-label":`entity link to ${e.name}`,to:o(e)},l?.metadata.title?l.metadata.title:r(e,{defaultKind:e.kind}))):t.createElement(t.Fragment,null);return c&&e?t.createElement(n,{className:i.cellNotTransformed,height:E.check},t.createElement(n,{paddingLeft:2},t.createElement(d,{title:l?.metadata.title?l.metadata.title:r(e,{defaultKind:e.kind}),arrow:!0,placement:"top-start"},t.createElement(n,{textOverflow:"ellipsis",width:f.trackTitle-50,overflow:"hidden"},t.createElement(m,{"aria-label":`entity link to ${e.name}`,to:o(e)},l?.metadata.title?l.metadata.title:r(e,{defaultKind:e.kind})))))):t.createElement("div",{className:i.cellWrapper},t.createElement("div",{className:i.cellText},s))};export{g as EntityRefCell};
2
2
  //# sourceMappingURL=EntityRefCell.esm.js.map
@@ -1,2 +1,2 @@
1
- import{makeStyles as i}from"@material-ui/core";import t from"react";import{LevelBadge as m}from"../../Badges/LevelBadge.esm.js";import{NoLevelBadge as o}from"../../Badges/NoLevelBadge.esm.js";import{CampaignBadge as n}from"../../Badges/CampaignBadge.esm.js";import{RowHeights as g,NO_LEVEL_BADGE_NAME as d}from"../resultsTableUtils.esm.js";const s=i(e=>({badgeCell:{borderRight:`1px solid ${e.palette.divider}`,height:`${g.trackTitle}px`,display:"flex",justifyContent:"center",alignItems:"center"}})),c=({highestLevel:e,trackType:r})=>{const a=s();if(!e?.badge)return t.createElement("div",{className:a.badgeCell},"\xA0");let l=e.name!==d?t.createElement(m,{badge:e.badge}):t.createElement(o,{showTooltip:!0});return r==="campaign"&&(l=t.createElement(n,null)),t.createElement("div",{className:a.badgeCell},l)};export{c as HighestLevelBadgeCell};
1
+ import{makeStyles as o}from"@material-ui/core";import t from"react";import{LevelBadge as d}from"../../Badges/LevelBadge.esm.js";import{NoLevelBadge as s}from"../../Badges/NoLevelBadge.esm.js";import{CampaignBadge as g}from"../../Badges/CampaignBadge.esm.js";import{RowHeights as r,NO_LEVEL_BADGE_NAME as n}from"../resultsTableUtils.esm.js";const p=o(e=>({badgeCell:{borderRight:`1px solid ${e.palette.divider}`,height:`${r.trackTitle}px`,display:"flex",justifyContent:"center",alignItems:"center"},small:{height:`${r.check}px`,borderBottom:`1px solid ${e.palette.divider}`}})),c=({highestLevel:e,trackType:i,small:m})=>{const l=p();if(!e?.badge)return t.createElement("div",{className:l.badgeCell},"\xA0");let a=e.name!==n?t.createElement(d,{badge:e.badge}):t.createElement(s,{showTooltip:!0});return i==="campaign"&&(a=t.createElement(g,null)),t.createElement("div",{className:`${l.badgeCell} ${m?l.small:""}`},a)};export{c as HighestLevelBadgeCell};
2
2
  //# sourceMappingURL=HighestLevelBadge.esm.js.map
@@ -1,2 +1,2 @@
1
- import{makeStyles as o,Typography as a}from"@material-ui/core";import r from"react";import{RowHeights as i}from"../resultsTableUtils.esm.js";const t=o(e=>{const l=e.palette.action.hover;return{root:{color:e.palette.text.primary,backgroundColor:l},levelTypography:{overflow:"hidden",textOverflow:"ellipsis"},levelHeaderCell:{padding:`${e.spacing(.5)}px ${e.spacing(2)}px`,borderRight:`1px solid ${e.palette.divider}`,height:`${i.levelTitle}px`}}}),p=({name:e})=>{const l=t();return r.createElement("div",{className:`${l.levelHeaderCell} ${l.root}`,"aria-label":`${e}`},r.createElement(a,{variant:"subtitle2",component:"p",className:l.levelTypography},e))},n=()=>{const e=t();return r.createElement("div",{className:`${e.levelHeaderCell} ${e.root}`},"\xA0")};export{p as TrackLevelHeaderCell,n as TrackLevelHeaderFill};
1
+ import{makeStyles as a,Typography as i}from"@material-ui/core";import t from"react";import{RowHeights as r}from"../resultsTableUtils.esm.js";const o=a(e=>{const l=e.palette.action.hover;return{root:{color:e.palette.text.primary,backgroundColor:l},levelTypography:{overflow:"hidden",textOverflow:"ellipsis"},levelHeaderCell:{padding:`${e.spacing(.5)}px ${e.spacing(2)}px`,borderRight:`1px solid ${e.palette.divider}`,height:`${r.levelTitle}px`},pivot:{height:r.check}}}),p=({name:e})=>{const l=o();return t.createElement("div",{className:`${l.levelHeaderCell} ${l.root}`,"aria-label":`${e}`},t.createElement(i,{variant:"subtitle2",component:"p",className:l.levelTypography},e))},c=({pivot:e})=>{const l=o();return t.createElement("div",{className:`${l.levelHeaderCell} ${l.root} ${e?l.pivot:""}`},"\xA0")};export{p as TrackLevelHeaderCell,c as TrackLevelHeaderFill};
2
2
  //# sourceMappingURL=TrackLevelHeaderCell.esm.js.map
@@ -1,2 +1,2 @@
1
- import r from"react";import{CheckCell as a}from"./CheckCell.esm.js";import{CheckNameCell as m}from"./CheckNameCell.esm.js";import{EntityRefCell as o}from"./EntityRefCell.esm.js";import{HighestLevelBadgeCell as i}from"./HighestLevelBadge.esm.js";import{TrackLevelHeaderCell as d,TrackLevelHeaderFill as s}from"./TrackLevelHeaderCell.esm.js";import{TrackTitleCell as y}from"./TrackTitleCell.esm.js";const k=e=>({type:"TrackHeader",render:()=>r.createElement(y,{name:e})}),C=e=>({type:"LevelHeader",render:()=>e?r.createElement(d,{name:e}):r.createElement(s,null)}),p=(e,t)=>r.createElement(m,{name:e,progress:t}),u=(e,t)=>({type:"CheckTitle",render:()=>p(e,t)}),f=({trackId:e,check:t,entityRef:l,result:n,entityRoute:c})=>r.createElement(a,{check:t,entityRef:l,entityRoute:c,trackId:e,result:n,isVirtualized:!0}),h=(e,t,l,n,c)=>({type:"CheckResult",render:()=>r.createElement(f,{trackId:e,check:t,entityRef:l,result:n,entityRoute:c})}),E=e=>r.createElement(o,{entityRef:e}),R=e=>({type:"EntityHeader",render:()=>E(e)}),v=(e,t)=>({type:"LevelBadge",render:()=>r.createElement(i,{highestLevel:e,trackType:t})}),H=e=>t=>{const l=e[t.rowIndex].cells[t.columnIndex];return l?r.createElement("div",{style:t.style},l.render()):r.createElement("div",{style:t.style})};export{H as cellRenderer,h as checkResultCell,u as checkTitleCell,R as entityHeaderCell,v as levelBadgeCell,C as levelHeaderCell,k as trackHeaderCell};
1
+ import l from"react";import{CheckCell as a}from"./CheckCell.esm.js";import{CheckNameCell as m}from"./CheckNameCell.esm.js";import{EntityRefCell as o}from"./EntityRefCell.esm.js";import{HighestLevelBadgeCell as i}from"./HighestLevelBadge.esm.js";import{TrackLevelHeaderCell as d,TrackLevelHeaderFill as s}from"./TrackLevelHeaderCell.esm.js";import{TrackTitleCell as y}from"./TrackTitleCell.esm.js";const k=e=>({type:"TrackHeader",render:()=>l.createElement(y,{name:e})}),C=e=>({type:"LevelHeader",render:()=>e?l.createElement(d,{name:e}):l.createElement(s,null)}),p=(e,t)=>l.createElement(m,{name:e,progress:t}),f=(e,t)=>({type:"CheckTitle",render:()=>p(e,t)}),u=({trackId:e,check:t,entityRef:r,result:n,entityRoute:c})=>l.createElement(a,{check:t,entityRef:r,entityRoute:c,trackId:e,result:n,isVirtualized:!0}),h=(e,t,r,n,c)=>({type:"CheckResult",render:()=>l.createElement(u,{trackId:e,check:t,entityRef:r,result:n,entityRoute:c})}),E=(e,t)=>l.createElement(o,{entityRef:e,noTransform:t}),R=(e,t)=>({type:"EntityHeader",render:()=>E(e,t)}),v=(e,t,r)=>({type:"LevelBadge",render:()=>l.createElement(i,{small:r,highestLevel:e,trackType:t})}),H=e=>t=>{const r=e[t.rowIndex].cells[t.columnIndex];return r?l.createElement("div",{style:t.style},r.render()):l.createElement("div",{style:t.style})};export{H as cellRenderer,h as checkResultCell,f as checkTitleCell,R as entityHeaderCell,v as levelBadgeCell,C as levelHeaderCell,k as trackHeaderCell};
2
2
  //# sourceMappingURL=cellRenderer.esm.js.map
@@ -1,2 +1,2 @@
1
- import{makeStyles as m}from"@material-ui/core";import e from"react";import{AlertPanel as f}from"../AlertPanel/AlertPanel.esm.js";import{NoCertifications as E,NoEntities as d}from"../EmptyState/EmptyState.esm.js";import{OverviewTableContent as y}from"./OverviewTableContent.esm.js";const h=m(()=>({scrollContainer:{overflow:"auto",paddingBottom:0,width:"100%"}})),u=({facets:t,ownerEntityRef:r,hasError:o,kind:i,type:s,setError:a,isFixedGroup:l})=>{const p=h();if(o)return e.createElement(f,{severity:"error",title:o.message});const n="Use the groups drop-down list at the top-right of the page to select another group.";return t&&(t.types?.length??0)>0?t.types?.find(c=>c.count>0)?e.createElement("div",{className:p.scrollContainer},e.createElement(y,{facets:t,kind:i,type:s,setError:a,ownerEntityRef:r,hasError:o})):e.createElement(E,{ownerEntityRef:r,selectGroupHint:n}):e.createElement(d,{ownerEntityRef:r,selectGroupHint:l?void 0:n})};export{u as OverviewTable};
1
+ import{makeStyles as p}from"@material-ui/core";import e from"react";import{AlertPanel as f}from"../AlertPanel/AlertPanel.esm.js";import{NoCertifications as E,NoEntities as d}from"../EmptyState/EmptyState.esm.js";import{OverviewTableContent as y}from"./OverviewTableContent.esm.js";const u=p(()=>({scrollContainer:{overflow:"auto",paddingBottom:0,width:"100%"}})),w=({facets:t,ownerEntityRef:r,hasError:o,kind:i,type:s,setError:a,isFixedGroup:l})=>{const c=u();if(o)return e.createElement(f,{severity:"error",title:o.message});const n="Use the groups drop-down list to select another group.";return t&&(t.types?.length??0)>0?t.types?.find(m=>m.count>0)?e.createElement("div",{className:c.scrollContainer},e.createElement(y,{facets:t,kind:i,type:s,setError:a,ownerEntityRef:r,hasError:o})):e.createElement(E,{ownerEntityRef:r,selectGroupHint:n}):e.createElement(d,{ownerEntityRef:r,selectGroupHint:l?void 0:n})};export{w as OverviewTable};
2
2
  //# sourceMappingURL=OverviewTable.esm.js.map
@@ -1,2 +1,2 @@
1
- import{useRouteRef as z}from"@backstage/core-plugin-api";import{entityRouteRef as H}from"@backstage/plugin-catalog-react";import{makeStyles as x,Grid as O}from"@material-ui/core";import e,{useEffect as A,useState as F,useRef as G,useLayoutEffect as L}from"react";import{VariableSizeGrid as N}from"react-window";import"@backstage/catalog-model";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import{useProgramOverviewForOwner as $}from"../../hooks/certifications/useProgramOverviewForOwner.esm.js";import"../../hooks/useSoundcheckAlert.esm.js";import"../../hooks/useConfirmationModal.esm.js";import"react-router-dom";import"../Pagination/Pagination.esm.js";import{useCursorPagination as J,CursorPagination as V}from"../Pagination/CursorPagination.esm.js";import{cellRenderer as j}from"./Cell/cellRenderer.esm.js";import{OverviewTableSkeleton as q}from"./OverviewTableSkeleton.esm.js";import{ResultsTableHeader as B}from"./ResultsTableHeader.esm.js";import{generateRows as D,generateHeaderRow as I}from"./ResultsTableRow.esm.js";import{calculateTableWidth as K,CellWidths as h,RowHeights as M}from"./resultsTableUtils.esm.js";import Q from"./useWindowDimensions.esm.js";const C=25,U=x(r=>({table:{backgroundColor:r.palette.background.paper,borderCollapse:"collapse",whiteSpace:"nowrap",textAlign:"left",overflow:"auto"},tableContainer:{backgroundColor:r.palette.background.paper}})),X=({setError:r,kind:l,type:m,ownerEntityRef:t})=>{const{cursor:b,pageSize:s,...w}=J({defaultPageSize:C,label:"entitiesPerPage"}),{data:o,isLoading:R,isError:c}=$(t,{kind:l,type:m},s,b),g=U(),E=z(H);A(()=>{r?.(c?new Error("Error loading track overview"):void 0)},[c,r]);const[k,v]=F(0),{height:y}=Q(),a=G(null);if(L(()=>{o&&t&&a?.current&&v(a.current.clientWidth-16)},[a,o,t]),R)return e.createElement(q,null);if(!o||!t)return null;const{programs:P,entityRefs:i,totalCount:S,endCursor:T,prevCursor:W}=o,n=i.length>=25?i:[...i,...Array.from({length:25-i.length},()=>{})],u=D(P,n,E),f=I(n),d=K(n.length)+60;return e.createElement("div",{ref:a},e.createElement(O,{"aria-label":`Check results for ${m??l}`,key:`${l}|${m??""}`,item:!0,xs:12,className:g.tableContainer},k>0&&e.createElement(e.Fragment,null,e.createElement(B,{headerRow:f,gridWidth:d}),e.createElement(N,{className:g.table,columnCount:n.length+1,columnWidth:p=>p===0?h.trackTitle:h.checkResult,rowCount:u.length,rowHeight:p=>u[p].height,height:y*.7-M.paginationControl-f.height,width:d},j(u)))),e.createElement(V,{...w,totalCount:S,defaultPageSize:C,endCursor:T,prevCursor:W,pageSize:s,labelRowsPerPage:"Entities per page:"}))};export{X as ResultsTable};
1
+ import{useRouteRef as j}from"@backstage/core-plugin-api";import{entityRouteRef as q}from"@backstage/plugin-catalog-react";import{makeStyles as B,Grid as D}from"@material-ui/core";import e,{useContext as I,useEffect as k,useState as J,useRef as K,useLayoutEffect as Q,useMemo as U}from"react";import{VariableSizeGrid as X}from"react-window";import"@backstage/catalog-model";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import{useProgramOverviewForOwner as Y}from"../../hooks/certifications/useProgramOverviewForOwner.esm.js";import"../../hooks/useSoundcheckAlert.esm.js";import"../../hooks/useConfirmationModal.esm.js";import"react-router-dom";import{EmptyState as Z}from"../EmptyState/EmptyState.esm.js";import"../OverviewPage/OverviewPage.esm.js";import"@spotify/backstage-plugin-core";import"../SoundcheckQueryClientProvider/SoundcheckQueryClientProvider.esm.js";import{OverviewPageContext as _}from"../OverviewPage/OverviewPageContent.esm.js";import"../Pagination/Pagination.esm.js";import{useCursorPagination as $,CursorPagination as ee}from"../Pagination/CursorPagination.esm.js";import{cellRenderer as te}from"./Cell/cellRenderer.esm.js";import{OverviewTableSkeleton as re}from"./OverviewTableSkeleton.esm.js";import{ResultsTableHeader as oe}from"./ResultsTableHeader.esm.js";import{generateRowsPivoted as ie,generateRows as ne,generateHeaderRowPivoted as ae,generateHeaderRow as le}from"./ResultsTableRow.esm.js";import{RowHeights as P,CellWidths as y,calculateTableWidth as me}from"./resultsTableUtils.esm.js";import se from"./useWindowDimensions.esm.js";const S=25,ue=B(i=>({table:{backgroundColor:i.palette.background.paper,borderCollapse:"collapse",whiteSpace:"nowrap",textAlign:"left",overflow:"auto"},tableContainer:{backgroundColor:i.palette.background.paper}})),ce=({setError:i,kind:u,type:c,ownerEntityRef:r})=>{const{cursor:W,pageSize:R,...p}=$({defaultPageSize:S,label:"entitiesPerPage"}),{debouncedSearchValue:l,pivot:m}=I(_),{data:t,isLoading:g,isError:b}=Y(r,{kind:u,type:c},R,W,l);k(()=>{p.setCursor(""),p.setCurrentPage(0)},[l]);const E=ue(),d=j(q);k(()=>{i?.(b?new Error("Error loading track overview"):void 0)},[b,i]);const[H,x]=J(0),{height:z}=se(),n=K(null);Q(()=>{t&&r&&n?.current&&x(n.current.clientWidth?n.current.clientWidth-16:100)},[n,t,r]);const{rows:h,headerRow:f,tableWidth:w,entityRefsWithPadding:T,getRowHeight:N,columnCount:O}=U(()=>{if(g||!t||!r)return{};const{programs:a,entityRefs:o}=t;if(!o)return{};const s=o.length>=25?o:[...o,...Array.from({length:25-o.length},()=>{})],C=m?ie(a,o,d):ne(a,s,d),v=C[0]?.cells?.length??s.length+1,G=m?ae(a):le(s),L=me(v-1)+60;return{rows:C,headerRow:G,tableWidth:L,entityRefsWithPadding:s,getRowHeight:M=>C[M]?.height??P.check,columnCount:v}},[t,d,g,r,m]);if(g)return e.createElement(re,null);if(!t||!r)return null;const{totalCount:V,endCursor:A,prevCursor:F}=t;return!f||!w||!T||!h?.length?l?e.createElement(Z,{title:"No Entities Found",description:`No entities found with name containing: '${l}'`}):null:e.createElement("div",{ref:n},e.createElement(D,{"aria-label":`Check results for ${c??u}`,key:`${u}|${c??""}`,item:!0,xs:12,className:E.tableContainer},H>0&&e.createElement(e.Fragment,null,e.createElement(oe,{headerRow:f,gridWidth:w}),e.createElement(X,{className:E.table,columnCount:O,columnWidth:a=>a===0?y.trackTitle:y.checkResult,rowCount:h.length,rowHeight:N,height:z*.7-P.paginationControl-f.height,width:w,key:m?"entityView":"checkView"},te(h)))),e.createElement(ee,{...p,totalCount:V,defaultPageSize:S,endCursor:A,prevCursor:F,pageSize:R,labelRowsPerPage:"Entities per page:"}))};export{ce as ResultsTable};
2
2
  //# sourceMappingURL=ResultsTable.esm.js.map
@@ -1,2 +1,2 @@
1
- import{ResultState as v}from"../../graphql/generated/index.esm.js";import{entityHeaderCell as g,trackHeaderCell as k,levelBadgeCell as C,levelHeaderCell as p,checkTitleCell as H,checkResultCell as E}from"./Cell/cellRenderer.esm.js";import{findLongestRefTitle as T,calculateHeightForRefTitle as y,RowHeights as h,generateNoLevelBadge as L}from"./resultsTableUtils.esm.js";const w=o=>{const t=T(o??[]);return{height:Math.min(y(t.length??1)-10,125),cells:[g(""),...o.map(a=>g(a||""))]}},A=(o,t,a)=>{const r=[];return o.forEach(({program:c,levels:m,highestLevels:f})=>{r.push({height:h.trackTitle,cells:[k(c.name),...t.map(e=>{const l=e?f.find(i=>i.entityRef===e)||L(e):void 0;return C(l,c.type??void 0)})]}),m.forEach(e=>{r.push({height:h.levelTitle,cells:[p(e.name),...t.map(l=>p(""))]}),e.checks.forEach(({check:l,results:i,totalCount:d,totalPassing:n})=>{const u={PASSED:n,FAILED:d-n};r.push({height:h.check,cells:[H(l.name,u),...t.map(s=>E(c.id,l,s,i.find(R=>R.entityRef===s)?.result??v.NotApplicable,a))]})})})}),r};export{w as generateHeaderRow,A as generateRows};
1
+ import u from"react";import{ResultState as y}from"../../graphql/generated/index.esm.js";import{entityHeaderCell as k,trackHeaderCell as b,levelBadgeCell as C,levelHeaderCell as R,checkTitleCell as w,checkResultCell as H}from"./Cell/cellRenderer.esm.js";import{CheckLabelCellType as v,CheckLabelCell as T}from"./Cell/CheckLabelCell.esm.js";import{TrackLevelHeaderFill as M}from"./Cell/TrackLevelHeaderCell.esm.js";import{findLongestRefTitle as A,calculateHeightForRefTitle as F,RowHeights as m,generateNoLevelBadge as E}from"./resultsTableUtils.esm.js";const P=i=>{const r=A(i??[]);return{height:Math.min(F(r.length??1)-10,125),cells:[k(""),...i.map(t=>k(t||""))]}},N=(i,r,t)=>{const e=[];return i.forEach(({program:n,levels:p,highestLevels:o})=>{e.push({height:m.trackTitle,cells:[b(n.name),...r.map(l=>{const a=l?o.find(c=>c.entityRef===l)||E(l):void 0;return C(a,n.type??void 0)})]}),p.forEach(l=>{e.push({height:m.levelTitle,cells:[R(l.name),...r.map(a=>R(""))]}),l.checks.forEach(({check:a,results:c,totalCount:d,totalPassing:s})=>{const f={PASSED:s,FAILED:d-s};e.push({height:m.check,cells:[w(a.name,f),...r.map(h=>H(n.id,a,h,c.find(g=>g.entityRef===h)?.result??y.NotApplicable,t))]})})})}),e},S=i=>{const r=i.flatMap(({program:t,levels:e})=>{const n={label:t.name??t.id,description:t.description??"",cellType:v.track},p=e.flatMap(o=>{const l={label:o.name??`level ${o.ordinal}`,cellType:v.level},a=o.checks.map(({check:c})=>({label:c.name??c.id,description:c.description??"",cellType:v.check}));return[l,...a]});return[n,...p]});return{height:125,cells:[{type:"CheckHeader",render:()=>u.createElement(T,null)},...r.map(t=>({render:()=>u.createElement(T,{...t}),type:"CheckHeader"}))]}},B=(i,r,t)=>r.map(e=>{const n=k(e,!0),p=i.flatMap(({highestLevels:o,program:l,levels:a})=>{const c=e?o.find(s=>s.entityRef===e)||E(e):void 0,d=a.flatMap(s=>{const f=s.checks.map(({check:h,results:g})=>H(l.id,h,e,g.find(L=>L.entityRef===e)?.result??y.NotApplicable,t));return[{type:"Filler",render:()=>u.createElement(M,{pivot:!0})},...f]});return[C(c,l.type??void 0,!0),...d]});return[n,...p]}).map(e=>({height:m.check,cells:e}));export{P as generateHeaderRow,S as generateHeaderRowPivoted,N as generateRows,B as generateRowsPivoted};
2
2
  //# sourceMappingURL=ResultsTableRow.esm.js.map
@@ -1,2 +1,2 @@
1
- import{useRouteRef as m,useRouteRefParams as d}from"@backstage/core-plugin-api";import{useEntity as s}from"@backstage/plugin-catalog-react";import e from"react";import{Routes as $,Route as i,Navigate as u}from"react-router-dom";import{useAllCertifications as v}from"../hooks/certifications/useAllCertifications.esm.js";import"@tanstack/react-query";import"../api.esm.js";import"../hooks/graphqlKeys.esm.js";import{useCertificationDetailsForTrack as R}from"../hooks/certifications/useCertificationDetailsForTrack.esm.js";import"@backstage/catalog-model";import"../hooks/useSoundcheckAlert.esm.js";import"../hooks/useConfirmationModal.esm.js";import{usePlaylists as y}from"../hooks/playlists/usePlaylists.esm.js";import{certificationPlaylistTrackCheckRouteRef as I,certificationPlaylistTrackRouteRef as E,certificationPlaylistRouteRef as f,certificationTrackRouteRef as k,certificationRouteRef as g}from"../routes.esm.js";import{EntityContent as o}from"./EntityContent/EntityContent.esm.js";const x=()=>{const{entity:r}=s(),t=m(f),a=m(k),{isLoading:c,data:l}=y(r),{isLoading:n,data:P}=v(r);if(c||n)return null;const p=l?.[0]?.id,h=P?.[0]?.program.id;return!p&&!h?null:e.createElement(u,{to:p?t({playlistId:p}):a({trackId:h}),replace:!0})},T=()=>{const{entity:r}=s(),{playlistId:t}=d(f),a=m(E),{data:c}=y(r),l=c?.find(n=>n.id===t)?.trackIds[0];return l?e.createElement(u,{to:a({playlistId:t,trackId:l}),replace:!0}):null},F=()=>{const{entity:r}=s(),{playlistId:t,trackId:a}=d(E),{data:c}=R(r,a),l=m(I),n=c?.levels[0]?.checks[0]?.id;return n?e.createElement(u,{to:l({playlistId:t,trackId:a,checkId:n}),replace:!0}):null},C=()=>{const{entity:r}=s(),{trackId:t}=d(k),a=m(g),{data:c}=R(r,t),l=c?.levels?.find(n=>n.checks.length>0)?.checks[0].id;return l?e.createElement(u,{to:a({trackId:t,checkId:l}),replace:!0}):null},L=()=>e.createElement($,null,e.createElement(i,{path:I.path,element:e.createElement(o,null)}),e.createElement(i,{path:E.path,element:e.createElement(e.Fragment,null,e.createElement(o,null),e.createElement(F,null))}),e.createElement(i,{path:f.path,element:e.createElement(e.Fragment,null,e.createElement(o,null),e.createElement(T,null))}),e.createElement(i,{path:k.path,element:e.createElement(e.Fragment,null,e.createElement(o,null),e.createElement(C,null))}),e.createElement(i,{path:g.path,element:e.createElement(o,null)}),e.createElement(i,{path:"/",element:e.createElement(e.Fragment,null,e.createElement(o,null),e.createElement(x,null))}));export{C as RedirectToFirstCheck,T as RedirectToFirstPlaylistTrack,F as RedirectToFirstPlaylistTrackCheck,L as Router};
1
+ import{useRouteRef as m,useRouteRefParams as d}from"@backstage/core-plugin-api";import{useEntity as s}from"@backstage/plugin-catalog-react";import{SecretsContextProvider as v}from"@backstage/plugin-scaffolder-react";import e from"react";import{Routes as $,Route as i,Navigate as u}from"react-router-dom";import{useAllCertifications as L}from"../hooks/certifications/useAllCertifications.esm.js";import"@tanstack/react-query";import"../api.esm.js";import"../hooks/graphqlKeys.esm.js";import{useCertificationDetailsForTrack as R}from"../hooks/certifications/useCertificationDetailsForTrack.esm.js";import"@backstage/catalog-model";import"../hooks/useSoundcheckAlert.esm.js";import"../hooks/useConfirmationModal.esm.js";import{usePlaylists as y}from"../hooks/playlists/usePlaylists.esm.js";import{certificationPlaylistTrackCheckRouteRef as I,certificationPlaylistTrackRouteRef as E,certificationPlaylistRouteRef as f,certificationTrackRouteRef as k,certificationRouteRef as g}from"../routes.esm.js";import{EntityContent as o}from"./EntityContent/EntityContent.esm.js";const x=()=>{const{entity:l}=s(),t=m(f),a=m(k),{isLoading:c,data:r}=y(l),{isLoading:n,data:C}=L(l);if(c||n)return null;const p=r?.[0]?.id,h=C?.[0]?.program.id;return!p&&!h?null:e.createElement(u,{to:p?t({playlistId:p}):a({trackId:h}),replace:!0})},T=()=>{const{entity:l}=s(),{playlistId:t}=d(f),a=m(E),{data:c}=y(l),r=c?.find(n=>n.id===t)?.trackIds[0];return r?e.createElement(u,{to:a({playlistId:t,trackId:r}),replace:!0}):null},F=()=>{const{entity:l}=s(),{playlistId:t,trackId:a}=d(E),{data:c}=R(l,a),r=m(I),n=c?.levels[0]?.checks[0]?.id;return n?e.createElement(u,{to:r({playlistId:t,trackId:a,checkId:n}),replace:!0}):null},P=()=>{const{entity:l}=s(),{trackId:t}=d(k),a=m(g),{data:c}=R(l,t),r=c?.levels?.find(n=>n.checks.length>0)?.checks[0].id;return r?e.createElement(u,{to:a({trackId:t,checkId:r}),replace:!0}):null},A=()=>e.createElement(v,null,e.createElement($,null,e.createElement(i,{path:I.path,element:e.createElement(o,null)}),e.createElement(i,{path:E.path,element:e.createElement(e.Fragment,null,e.createElement(o,null),e.createElement(F,null))}),e.createElement(i,{path:f.path,element:e.createElement(e.Fragment,null,e.createElement(o,null),e.createElement(T,null))}),e.createElement(i,{path:k.path,element:e.createElement(e.Fragment,null,e.createElement(o,null),e.createElement(P,null))}),e.createElement(i,{path:g.path,element:e.createElement(o,null)}),e.createElement(i,{path:"/",element:e.createElement(e.Fragment,null,e.createElement(o,null),e.createElement(x,null))})));export{P as RedirectToFirstCheck,T as RedirectToFirstPlaylistTrack,F as RedirectToFirstPlaylistTrackCheck,A as Router};
2
2
  //# sourceMappingURL=Router.esm.js.map