@spotify/backstage-plugin-soundcheck 0.16.2 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/dist/alpha/integrations.esm.js +2 -0
  3. package/dist/alpha/pages.esm.js +1 -1
  4. package/dist/alpha/plugin.esm.js +1 -1
  5. package/dist/alpha.d.ts +252 -17
  6. package/dist/api.esm.js +1 -1
  7. package/dist/blueprints/IntegrationPageBlueprint.esm.js +2 -0
  8. package/dist/components/Badges/LevelBadge.esm.js +1 -1
  9. package/dist/components/CampaignForm/hooks/utils.esm.js +1 -1
  10. package/dist/components/CampaignInsightsPage/CampaignStatusHistoryTile.esm.js +1 -1
  11. package/dist/components/CertificationSidebar/ExemptionJustificationDialog.esm.js +1 -1
  12. package/dist/components/CertificationsPage/CertificationTab.esm.js +1 -1
  13. package/dist/components/CertificationsPage/CertificationTabs.esm.js +1 -1
  14. package/dist/components/CheckDetails/CheckResultDetails.esm.js +1 -1
  15. package/dist/components/CheckDetails/ResultStateBox.esm.js +1 -1
  16. package/dist/components/CheckDryRun/CheckDryRunDetails.esm.js +1 -1
  17. package/dist/components/CheckForm/FormFields/RuleInput/Conditions/ConditionList.esm.js +1 -1
  18. package/dist/components/CheckForm/FormFields/RuleInput/Conditions/FactValueDisplay.esm.js +1 -1
  19. package/dist/components/CheckForm/FormFields/RuleInput/Conditions/RuleConditionInput.esm.js +1 -1
  20. package/dist/components/CheckForm/FormFields/RuleInput/Expressions/ExpressionBox.esm.js +1 -1
  21. package/dist/components/CheckForm/FormFields/RuleInput/RuleInputBox.esm.js +1 -1
  22. package/dist/components/CheckForm/Steps/CheckApplicabilityStep.esm.js +1 -1
  23. package/dist/components/CheckForm/utils/checkFormUtils.esm.js +2 -2
  24. package/dist/components/CheckForm/utils/validation.esm.js +1 -1
  25. package/dist/components/CheckIcon/CheckIcon.esm.js +1 -1
  26. package/dist/components/CheckPage/CheckEntitiesTable/CheckEntitiesTable.esm.js +1 -1
  27. package/dist/components/CheckPage/CheckInsightsPage.esm.js +1 -1
  28. package/dist/components/CheckPage/ExemptionsTable.esm.js +2 -0
  29. package/dist/components/CollectorPage/CollectorPage.esm.js +1 -1
  30. package/dist/components/CollectorPage/Configurators/Common/FactCollectionConfig.esm.js +1 -1
  31. package/dist/components/CollectorPage/Configurators/HTTP/HttpStatusesInput.esm.js +1 -1
  32. package/dist/components/CollectorPage/Configurators/PagerDuty/PagerDutyConfigurator.esm.js +1 -1
  33. package/dist/components/CollectorPage/Configurators/PagerDuty/utils.esm.js +1 -1
  34. package/dist/components/CollectorsPage/CollectorListPage/CollectorListPage.esm.js +1 -1
  35. package/dist/components/CollectorsPage/CollectorListPage/CollectorSummaryCard.esm.js +1 -1
  36. package/dist/components/CollectorsPage/CollectorsPage.esm.js +1 -1
  37. package/dist/components/EntitiesAutocompletePicker/EntitiesAutocompletePicker.esm.js +1 -1
  38. package/dist/components/FactExplorer/FactExplorer.esm.js +1 -1
  39. package/dist/components/FactExplorer/FactExplorerDialog.esm.js +1 -1
  40. package/dist/components/FactExplorer/useFactOptions.esm.js +1 -1
  41. package/dist/components/Filter/EntityAutocompletePicker.esm.js +1 -1
  42. package/dist/components/Filter/FilterComponent.esm.js +1 -1
  43. package/dist/components/FilterSidebar/StateFilter.esm.js +1 -1
  44. package/dist/components/FormControlledAutocomplete/FormControlledMultipleAutocomplete.esm.js +1 -1
  45. package/dist/components/GroupSelector/GroupSelector.esm.js +1 -1
  46. package/dist/components/LevelsTable/CheckRowContent.esm.js +1 -1
  47. package/dist/components/OrgInsights/OrgInsightsPage.esm.js +2 -0
  48. package/dist/components/OrgInsights/OrgInsightsSidebar.esm.js +2 -0
  49. package/dist/components/OrgInsights/OrgInsightsViewSelector.esm.js +2 -0
  50. package/dist/components/OrgInsights/TrackCardGrid.esm.js +2 -0
  51. package/dist/components/OrgInsights/TrackComparison.esm.js +2 -0
  52. package/dist/components/OrgInsights/TrackStatusTile.esm.js +2 -0
  53. package/dist/components/OrgInsights/styles.esm.js +2 -0
  54. package/dist/components/OverviewPage/OverviewPageHeader.esm.js +1 -1
  55. package/dist/components/OverviewTable/Cell/CheckNameCell.esm.js +1 -1
  56. package/dist/components/OverviewTable/Cell/TrackCheckStatusCount.esm.js +2 -0
  57. package/dist/components/OverviewTable/Cell/cellRenderer.esm.js +1 -1
  58. package/dist/components/OverviewTable/OverviewTableContent.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/RoutingPage/index.esm.js +1 -1
  64. package/dist/components/SoundcheckHeader/SoundcheckHeader.esm.js +1 -1
  65. package/dist/components/SummaryCard/SummaryCard.esm.js +1 -1
  66. package/dist/components/TechHealth/Filters/FacetFilter.esm.js +1 -1
  67. package/dist/components/TopFailingChecksTable/TopFailingChecksTable.esm.js +1 -1
  68. package/dist/components/TrackPage/TrackEntitiesTable/columns.esm.js +1 -1
  69. package/dist/components/TrackPage/TrackEntitiesTable/utils.esm.js +1 -1
  70. package/dist/components/TrackPage/TrackHistoryChart.esm.js +1 -1
  71. package/dist/components/TrackPage/TrackPage.esm.js +1 -1
  72. package/dist/components/TrackPage/TrackStatusBar.esm.js +1 -1
  73. package/dist/components/TrackPage/TrackStatusTable.esm.js +1 -1
  74. package/dist/contexts/UserProvider.esm.js +1 -1
  75. package/dist/graphql/generated/index.esm.js +56 -22
  76. package/dist/hooks/aggregations/useCheckStatus.esm.js +1 -1
  77. package/dist/hooks/campaigns/useCreateCampaign.esm.js +1 -1
  78. package/dist/hooks/campaigns/useUpdateCampaign.esm.js +1 -1
  79. package/dist/hooks/certifications/useTrackOverviewForOwner.esm.js +1 -1
  80. package/dist/hooks/checks/useCreateCheck.esm.js +1 -1
  81. package/dist/hooks/checks/useSetManualResult.esm.js +1 -1
  82. package/dist/hooks/checks/useUpdateCheck.esm.js +1 -1
  83. package/dist/hooks/collectors/useUpdateCollectorConfig.esm.js +1 -1
  84. package/dist/hooks/exemptions/useDeleteExemption.esm.js +1 -1
  85. package/dist/hooks/exemptions/useExemptCheckIds.esm.js +1 -1
  86. package/dist/hooks/exemptions/useExemptions.esm.js +2 -0
  87. package/dist/hooks/exemptions/useGetExemption.esm.js +1 -1
  88. package/dist/hooks/exemptions/useSetEntityExempt.esm.js +1 -1
  89. package/dist/hooks/graphqlKeys.esm.js +1 -1
  90. package/dist/hooks/tracks/useCreateTrack.esm.js +1 -1
  91. package/dist/hooks/tracks/useUpdateTrack.esm.js +1 -1
  92. package/dist/index.d.ts +85 -1
  93. package/dist/index.esm.js +1 -1
  94. package/dist/utils/validation.esm.js +1 -1
  95. package/package.json +18 -18
  96. package/dist/components/CheckForm/FormFields/RuleInput/useRuleInputHandlers.esm.js +0 -2
  97. package/dist/components/OrgHealth/OrgHealthPage.esm.js +0 -2
  98. package/dist/components/OverviewTable/Cell/TrackCheckIndicator.esm.js +0 -2
@@ -1,2 +1,2 @@
1
- import{jsx as t,jsxs as L}from"react/jsx-runtime";import{makeStyles as z,FormControlLabel as A,Checkbox as I,Typography as N,Box as j,TextField as B}from"@material-ui/core";import E from"@material-ui/icons/CheckBox";import G from"@material-ui/icons/CheckBoxOutlineBlank";import U from"@material-ui/icons/ExpandMore";import{Autocomplete as V}from"@material-ui/lab";import{useState as D,useMemo as s,useCallback as d}from"react";import{useGetEntityFacets as H}from"../../hooks/catalog/useGetEntityFacets.esm.js";import{FormFieldLabel as M}from"../FormFieldLabel/FormFieldLabel.esm.js";import{ListboxVirtualized as P}from"../ListboxVirtualized/ListboxVirtualized.esm.js";const $=z({container:{padding:0},formControl:{flexGrow:1},label:{lineHeight:"1em"}}),q=({facet:f,label:b,values:l,onChange:n,disabled:g,filter:x,renderOption:u,renderTags:k,facetFilter:h})=>{const i=$(),[y,c]=D(!1),{data:r,isLoading:C,error:S}=H(f,x),o=s(()=>r?.filter(h??(()=>!0)).map(e=>e.toLocaleLowerCase("en-US")),[r,h]),m=s(()=>l?.map(e=>e.toLocaleLowerCase("en-US"))??[],[l]),F=d((e,a)=>{n(a),o&&o.every(p=>a.includes(p))&&c(!1)},[o,n]),v=d(()=>{n(l?.length?l:void 0)},[l,n]),O=d((e,a)=>u?.(e,a)??t(A,{onClick:p=>p.preventDefault(),control:t(I,{icon:t(G,{fontSize:"small"}),checkedIcon:t(E,{fontSize:"small"}),checked:a.selected}),label:e,classes:{label:i.label}}),[u,i.label]),T=s(()=>g||C||!l?.length&&(!r?.length||!o?.length),[g,C,l?.length,r?.length,o?.length]),w=s(()=>Array.from(new Set([...o??[],...m])),[o,m]);return S?L(N,{color:"error",children:["Failed to load facet: ",f]}):L(j,{pb:1,pt:1,className:i.container,children:[t(M,{title:b,docLink:"https://backstage.spotify.com/docs/plugins/soundcheck/core-concepts/filters"}),t(V,{open:y,onOpen:()=>c(!0),onClose:()=>c(!1),className:i.formControl,multiple:!0,limitTags:4,disableCloseOnSelect:!0,"aria-label":b,options:w,value:m,getOptionLabel:e=>r&&o?r[o.indexOf(e)]??e:e,onChange:F,onBlur:v,disabled:T,ListboxComponent:P,renderOption:O,renderTags:k,size:"small",popupIcon:t(U,{"data-testid":"selected-facets-expand"}),renderInput:e=>t(B,{...e,variant:"outlined"})})]})};export{q as EntityAutocompletePicker};
1
+ import{jsx as t,jsxs as L}from"react/jsx-runtime";import{makeStyles as z,FormControlLabel as A,Checkbox as I,Typography as j,Box as B,TextField as E}from"@material-ui/core";import G from"@material-ui/icons/CheckBox";import N from"@material-ui/icons/CheckBoxOutlineBlank";import U from"@material-ui/icons/ExpandMore";import{Autocomplete as V}from"@material-ui/lab";import{useState as D,useMemo as s,useCallback as d}from"react";import{useGetEntityFacets as H}from"../../hooks/catalog/useGetEntityFacets.esm.js";import{FormFieldLabel as M}from"../FormFieldLabel/FormFieldLabel.esm.js";import{ListboxVirtualized as P}from"../ListboxVirtualized/ListboxVirtualized.esm.js";const $=z({container:{padding:0},formControl:{flexGrow:1},label:{lineHeight:"1em"}}),q=({facet:f,label:b,values:l,onChange:n,disabled:g,filter:x,renderOption:u,renderTags:k,facetFilter:h})=>{const i=$(),[y,c]=D(!1),{data:r,isLoading:C,error:S}=H(f,x),o=s(()=>r?.filter(h??(()=>!0)).map(e=>e.toLocaleLowerCase("en-US")),[r,h]),m=s(()=>l?.map(e=>e.toLocaleLowerCase("en-US"))??[],[l]),F=d((e,a)=>{n(a),o&&o.every(p=>a.includes(p))&&c(!1)},[o,n]),v=d(()=>{n(l?.length?l:void 0)},[l,n]),O=d((e,a)=>u?.(e,a)??t(A,{onClick:p=>p.preventDefault(),control:t(I,{icon:t(N,{fontSize:"small"}),checkedIcon:t(G,{fontSize:"small"}),checked:a.selected}),label:e,classes:{label:i.label}}),[u,i.label]),T=s(()=>g||C||!l?.length&&(!r?.length||!o?.length),[g,C,l?.length,r?.length,o?.length]),w=s(()=>Array.from(new Set([...o??[],...m])),[o,m]);return S?L(j,{color:"error",children:["Failed to load facet: ",f]}):L(B,{pb:1,pt:1,className:i.container,children:[t(M,{title:b,docLink:"https://backstage.spotify.com/docs/plugins/soundcheck/core-concepts/filters"}),t(V,{open:y,onOpen:()=>c(!0),onClose:()=>c(!1),className:i.formControl,multiple:!0,limitTags:4,disableCloseOnSelect:!0,"aria-label":b,options:w,value:m,getOptionLabel:e=>r&&o?r[o.indexOf(e)]??e:e,onChange:F,onBlur:v,disabled:T,ListboxComponent:P,renderOption:O,renderTags:k,size:"small",popupIcon:t(U,{"data-testid":"selected-facets-expand"}),renderInput:e=>t(E,{...e,variant:"outlined"})})]})};export{q as EntityAutocompletePicker};
2
2
  //# sourceMappingURL=EntityAutocompletePicker.esm.js.map
@@ -1,2 +1,2 @@
1
- import{jsxs as i,Fragment as $,jsx as e}from"react/jsx-runtime";import{makeStyles as j,Divider as z,Box as p,Tabs as X,Tab as O,Grid as d,Paper as Y,Typography as w,Chip as P,Switch as G,FormHelperText as H}from"@material-ui/core";import{isEmpty as I}from"lodash";import{useState as M,useMemo as K}from"react";import{useFormContext as _}from"react-hook-form";import q from"react-use/lib/useLocalStorage";import{FormFieldLabel as V}from"../FormFieldLabel/FormFieldLabel.esm.js";import{EntityAutocompletePicker as J}from"./EntityAutocompletePicker.esm.js";import{FilterKeyValueInput as L}from"./FilterKeyValueInput.esm.js";import{FilterPreviewTable as Q}from"./FilterPreviewTable/FilterPreviewTable.esm.js";import{FILTER_OPTIONS as E,emptyFilters as U}from"./types.esm.js";import{filterPresent as A,isValidOtherFilterKey as Z}from"./utils.esm.js";const ee=j(l=>({title:{fontWeight:700},filterContainer:{display:"flex",flexWrap:"wrap"},selectionTabs:{marginBottom:l.spacing(2)},divider:{marginTop:l.spacing(2)},filterDisplayBox:{padding:l.spacing(2),paddingLeft:l.spacing(4),border:`1px solid ${l.palette.divider}`,marginBottom:l.spacing(0),display:"flex",alignItems:"center",flex:1},error:{borderColor:l.palette.error.main}})),f=l=>I(l)?"":`${l.length>1?`[${l.join(", ")}]`:l[0]}`,le=({filterValue:l,excludeFilter:h,keyValueFilter:m,excludeKeyValueFilter:o})=>{const s=(a=U())=>E.map(t=>I(a[t.key])?"":`${t.facet}: ${f(a[t.key])}`).filter(t=>!!t),n=a=>[a?.selectedLabels?.map(t=>`metadata.labels.${t.key}: ${f(t.value)}`),a?.selectedAnnotations?.map(t=>`metadata.annotations.${t.key}: ${f(t.value)}`),a?.selectedOtherFilters?.map(t=>`${t.key}: ${f(t.value)}`)].flat(),y=[...s(l),...n(m)],c=[...s(h),...n(o)];return{includeFilterDisplay:y,excludeFilterDisplay:c}},te=({filterName:l,disabled:h,keyValueFilterName:m,excludeFilterName:o,excludeKeyValueFilterName:s})=>{const n=ee(),{setValue:y,watch:c}=_(),[a,t]=M(0),[g,W]=q("soundcheck-show-preview",!0),B=K(()=>a===0?l:o,[o,l,a]),u=K(()=>a===0?m:s,[s,m,a]),C=c(B??l),R=r=>k=>{y(B??l,{...C,[r]:k??[]})},x=c(l),F=o?c(o):void 0,b=m?c(m):void 0,v=s?c(s):void 0,{includeFilterDisplay:S,excludeFilterDisplay:T}=le({filterValue:x,excludeFilter:F,keyValueFilter:b,excludeKeyValueFilter:v}),N=A(x,b),D=A(F,v);return i($,{children:[o&&i($,{children:[e(z,{className:n.divider}),e(p,{className:n.selectionTabs,children:i(X,{value:a,onChange:(r,k)=>t(k),children:[e(O,{label:"Include Filters","aria-label":"include filters"}),e(O,{label:"Exclude Filters","aria-label":"exclude filters"})]})})]}),i(d,{container:!0,spacing:6,children:[i(d,{item:!0,container:!0,className:n.filterContainer,spacing:2,children:[E.map(r=>e(d,{item:!0,xs:12,sm:6,md:4,children:e(J,{...r,values:C?.[r.key],onChange:R(r.key),disabled:h})},r.key)),u&&i($,{children:[i(d,{item:!0,xs:12,sm:6,md:4,children:[e(V,{title:"Label",docLink:"https://backstage.spotify.com/docs/plugins/soundcheck/core-concepts/filters"}),e(L,{name:`${u}.selectedLabels`,title:"Label Filter"})]}),i(d,{item:!0,xs:12,sm:6,md:4,children:[e(V,{title:"Annotation",docLink:"https://backstage.spotify.com/docs/plugins/soundcheck/core-concepts/filters"}),e(L,{name:`${u}.selectedAnnotations`,title:"Annotation Filter"})]}),i(d,{item:!0,xs:12,sm:6,md:4,children:[e(V,{title:"Other",docLink:"https://backstage.spotify.com/docs/plugins/soundcheck/core-concepts/filters"}),e(L,{name:`${u}.selectedOtherFilters`,title:"Other Catalog Filter",validateKey:Z})]})]})]}),i(d,{item:!0,xs:12,children:[i(Y,{className:`${n.filterDisplayBox} ${!N&&D?n.error:""}`,elevation:0,children:[i(p,{flex:1,overflow:"auto",children:[i(p,{display:"flex",flexWrap:"wrap",alignItems:"center",style:{overflowX:"auto",overflowY:"hidden"},children:[e(w,{style:{marginRight:4,marginBottom:4},variant:"subtitle2",component:"span",children:"Filter:"}),S.map(r=>e(P,{size:"small",label:r,style:{marginBottom:4}},r))]}),T.length>0&&i(p,{display:"flex",flexWrap:"wrap",alignItems:"center",style:{overflowX:"auto",overflowY:"hidden"},children:[e(w,{style:{marginRight:4,marginBottom:4},variant:"subtitle2",component:"span",children:"Exclude:"}),T.map(r=>e(P,{size:"small",label:r,style:{marginBottom:4}},r))]})]}),e(w,{style:{marginLeft:10},variant:"subtitle2",component:"div",children:"Preview"}),e(p,{children:e(G,{checked:g,onChange:()=>{W(!g)},inputProps:{"aria-label":"toggle entity preview"}})})]}),e(p,{marginBottom:2,children:!N&&D&&e(H,{error:!0,children:"Exclude filter cannot be used alone. Please add an include filter."})}),g&&e(Q,{filter:x,keyValueFilter:b,excludeFilter:F,excludeKeyValueFilter:v})]})]})]})};export{te as FilterComponent};
1
+ import{jsxs as i,Fragment as k,jsx as e}from"react/jsx-runtime";import{makeStyles as z,Typography as f,Divider as X,Box as d,Tabs as Y,Tab as P,Grid as c,Paper as _,Chip as D,Switch as G,FormHelperText as H}from"@material-ui/core";import M,{isEmpty as I}from"lodash";import{useState as q,useMemo as K}from"react";import{useFormContext as J}from"react-hook-form";import Q from"react-use/lib/useLocalStorage";import{FormFieldLabel as w}from"../FormFieldLabel/FormFieldLabel.esm.js";import{EntityAutocompletePicker as U}from"./EntityAutocompletePicker.esm.js";import{FilterKeyValueInput as $}from"./FilterKeyValueInput.esm.js";import{FilterPreviewTable as Z}from"./FilterPreviewTable/FilterPreviewTable.esm.js";import{FILTER_OPTIONS as S,emptyFilters as ee}from"./types.esm.js";import{isValidOtherFilterKey as le}from"./utils.esm.js";const te=z(l=>({title:{fontWeight:700},filterContainer:{display:"flex",flexWrap:"wrap"},selectionTabs:{marginBottom:l.spacing(2)},divider:{marginTop:l.spacing(2)},filterDisplayBox:{padding:l.spacing(2),paddingLeft:l.spacing(4),border:`1px solid ${l.palette.divider}`,marginBottom:l.spacing(0),display:"flex",alignItems:"center",flex:1},error:{borderColor:l.palette.error.main}})),h=l=>I(l)?"":`${l.length>1?`[${l.join(", ")}]`:l[0]}`,ie=({filterValue:l,excludeFilter:g,keyValueFilter:y,excludeKeyValueFilter:m})=>{const o=(a=ee())=>S.map(t=>I(a[t.key])?"":`${t.facet}: ${h(a[t.key])}`).filter(t=>!!t),n=a=>[a?.selectedLabels?.map(t=>`metadata.labels.${t.key}: ${h(t.value)}`),a?.selectedAnnotations?.map(t=>`metadata.annotations.${t.key}: ${h(t.value)}`),a?.selectedOtherFilters?.map(t=>`${t.key}: ${h(t.value)}`)].flat(),s=[...o(l),...n(y)],x=[...o(g),...n(m)];return{includeFilterDisplay:s,excludeFilterDisplay:x}},re=({filterName:l,errorPath:g="filtersStep",disabled:y,keyValueFilterName:m,excludeFilterName:o,excludeKeyValueFilterName:n})=>{const s=te(),{setValue:x,watch:a,formState:t,trigger:A}=J(),[p,E]=q(0),[F,W]=Q("soundcheck-show-preview",!0),V=K(()=>p===0?l:o,[o,l,p]),u=K(()=>p===0?m:n,[n,m,p]),L=a(V??l),R=r=>v=>{x(V??l,{...L,[r]:v??[]}),A()},B=a(l),C=o?a(o):void 0,N=m?a(m):void 0,T=n?a(n):void 0,{includeFilterDisplay:j,excludeFilterDisplay:O}=ie({filterValue:B,excludeFilter:C,keyValueFilter:N,excludeKeyValueFilter:T}),b=M.get(t.errors,g,void 0);return i(k,{children:[i(f,{variant:"body2",children:[e("strong",{children:"Note:"})," For performance reasons, filter facets selected for inclusion cannot be used for exclusion and vice versa."]}),o&&i(k,{children:[e(X,{className:s.divider}),e(d,{className:s.selectionTabs,children:i(Y,{value:p,onChange:(r,v)=>E(v),children:[e(P,{label:"Include Filters","aria-label":"include filters"}),e(P,{label:"Exclude Filters","aria-label":"exclude filters"})]})})]}),i(c,{container:!0,spacing:6,children:[i(c,{item:!0,container:!0,className:s.filterContainer,spacing:2,children:[S.map(r=>e(c,{item:!0,xs:12,sm:6,md:4,children:e(U,{...r,values:L?.[r.key],onChange:R(r.key),disabled:y})},r.key)),u&&i(k,{children:[i(c,{item:!0,xs:12,sm:6,md:4,children:[e(w,{title:"Label",docLink:"https://backstage.spotify.com/docs/plugins/soundcheck/core-concepts/filters"}),e($,{name:`${u}.selectedLabels`,title:"Label Filter"})]}),i(c,{item:!0,xs:12,sm:6,md:4,children:[e(w,{title:"Annotation",docLink:"https://backstage.spotify.com/docs/plugins/soundcheck/core-concepts/filters"}),e($,{name:`${u}.selectedAnnotations`,title:"Annotation Filter"})]}),i(c,{item:!0,xs:12,sm:6,md:4,children:[e(w,{title:"Other",docLink:"https://backstage.spotify.com/docs/plugins/soundcheck/core-concepts/filters"}),e($,{name:`${u}.selectedOtherFilters`,title:"Other Catalog Filter",validateKey:le})]})]})]}),i(c,{item:!0,xs:12,children:[i(_,{className:`${s.filterDisplayBox} ${b?.message?s.error:""}`,elevation:0,children:[i(d,{flex:1,overflow:"auto",children:[i(d,{display:"flex",flexWrap:"wrap",alignItems:"center",style:{overflowX:"auto",overflowY:"hidden"},children:[e(f,{style:{marginRight:4,marginBottom:4},variant:"subtitle2",component:"span",children:"Filter:"}),j.map(r=>e(D,{size:"small",label:r,style:{marginBottom:4}},r))]}),O.length>0&&i(d,{display:"flex",flexWrap:"wrap",alignItems:"center",style:{overflowX:"auto",overflowY:"hidden"},children:[e(f,{style:{marginRight:4,marginBottom:4},variant:"subtitle2",component:"span",children:"Exclude:"}),O.map(r=>e(D,{size:"small",label:r,style:{marginBottom:4}},r))]})]}),e(f,{style:{marginLeft:10},variant:"subtitle2",component:"div",children:"Preview"}),e(d,{children:e(G,{checked:F,onChange:()=>{W(!F)},inputProps:{"aria-label":"toggle entity preview"}})})]}),e(d,{marginBottom:2,children:b?.message&&e(H,{error:!0,children:b?.message})}),F&&e(Z,{filter:B,keyValueFilter:N,excludeFilter:C,excludeKeyValueFilter:T})]})]})]})};export{re as FilterComponent};
2
2
  //# sourceMappingURL=FilterComponent.esm.js.map
@@ -1,2 +1,2 @@
1
- import{jsxs as s,jsx as e}from"react/jsx-runtime";import{makeStyles as h,Box as l,TextField as C,FormControlLabel as S,Checkbox as b,Typography as g}from"@material-ui/core";import x from"@material-ui/icons/CheckBox";import k from"@material-ui/icons/CheckBoxOutlineBlank";import L from"@material-ui/icons/ExpandMore";import{Autocomplete as I}from"@material-ui/lab";import{useState as A,useEffect as F,useCallback as c}from"react";import{CheckIcon as N}from"../CheckIcon/CheckIcon.esm.js";import{FormFieldLabel as T}from"../FormFieldLabel/FormFieldLabel.esm.js";import{ListboxVirtualized as y}from"../ListboxVirtualized/ListboxVirtualized.esm.js";const O=h({container:{padding:0},formControl:{flexGrow:1},label:{lineHeight:"1em"}});function m(r){return r.toLowerCase().split("_").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}const v=(r,{selected:t})=>e(S,{onClick:o=>o.preventDefault(),control:e(b,{icon:e(k,{fontSize:"small"}),checkedIcon:e(x,{fontSize:"small"}),checked:t}),label:s(l,{display:"flex",alignItems:"center",children:[e(N,{result:r}),e(l,{mr:1}),e(g,{children:m(r)})]})}),z=({states:r,stagedStates:t,onStagedStatesChange:o})=>{const n=O(),[p,a]=A(!1);F(()=>{o(r)},[r,o]);const d=c((i,u)=>{o(u)},[o]),f=c(()=>{o(t?.length?t:[])},[t,o]);return s(l,{pb:1,pt:1,className:n.container,children:[e(T,{title:"State",docLink:"https://backstage.spotify.com/docs/plugins/soundcheck/core-concepts/filters"}),e(I,{open:p,onOpen:()=>a(!0),onClose:()=>a(!1),className:n.formControl,multiple:!0,limitTags:4,disableCloseOnSelect:!0,"aria-label":"State",options:["PASSED","FAILED","WARNING","NOT_APPLICABLE"],value:t,getOptionLabel:m,onChange:d,onBlur:f,ListboxComponent:y,renderOption:v,size:"small",popupIcon:e(L,{"data-testid":"selected-facets-expand"}),renderInput:i=>e(C,{...i,variant:"outlined"})})]})};export{z as StateFilter};
1
+ import{jsxs as s,jsx as e}from"react/jsx-runtime";import{makeStyles as h,Box as r,TextField as C,FormControlLabel as S,Checkbox as b,Typography as g}from"@material-ui/core";import x from"@material-ui/icons/CheckBox";import k from"@material-ui/icons/CheckBoxOutlineBlank";import L from"@material-ui/icons/ExpandMore";import{Autocomplete as I}from"@material-ui/lab";import{useState as A,useEffect as F,useCallback as c}from"react";import{CheckIcon as E}from"../CheckIcon/CheckIcon.esm.js";import{FormFieldLabel as T}from"../FormFieldLabel/FormFieldLabel.esm.js";import{ListboxVirtualized as y}from"../ListboxVirtualized/ListboxVirtualized.esm.js";const N=["PASSED","FAILED","WARNING","NOT_APPLICABLE","EXEMPT"],O=h({container:{padding:0},formControl:{flexGrow:1},label:{lineHeight:"1em"}}),m=l=>l.toLowerCase().split("_").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" "),P=(l,{selected:t})=>e(S,{onClick:o=>o.preventDefault(),control:e(b,{icon:e(k,{fontSize:"small"}),checkedIcon:e(x,{fontSize:"small"}),checked:t}),label:s(r,{display:"flex",alignItems:"center",children:[e(E,{result:l}),e(r,{mr:1}),e(g,{children:m(l)})]})}),j=({states:l,stagedStates:t,onStagedStatesChange:o})=>{const a=O(),[p,n]=A(!1);F(()=>{o(l)},[l,o]);const d=c((i,u)=>{o(u)},[o]),f=c(()=>{o(t?.length?t:[])},[t,o]);return s(r,{pb:1,pt:1,className:a.container,children:[e(T,{title:"State",docLink:"https://backstage.spotify.com/docs/plugins/soundcheck/core-concepts/filters"}),e(I,{open:p,onOpen:()=>n(!0),onClose:()=>n(!1),className:a.formControl,multiple:!0,limitTags:4,disableCloseOnSelect:!0,"aria-label":"State",options:N,value:t,getOptionLabel:m,onChange:d,onBlur:f,ListboxComponent:y,renderOption:P,size:"small",popupIcon:e(L,{"data-testid":"selected-facets-expand"}),renderInput:i=>e(C,{...i,variant:"outlined"})})]})};export{j as StateFilter};
2
2
  //# sourceMappingURL=StateFilter.esm.js.map
@@ -1,2 +1,2 @@
1
- import{jsx as e}from"react/jsx-runtime";import{TextField as L,FormControlLabel as k,Checkbox as z}from"@material-ui/core";import F from"@material-ui/icons/CheckBox";import I from"@material-ui/icons/CheckBoxOutlineBlank";import{Autocomplete as O}from"@material-ui/lab";import{Controller as N}from"react-hook-form";import{ListboxVirtualized as W}from"../ListboxVirtualized/ListboxVirtualized.esm.js";import{useStyles as w}from"./FormControlledAutocomplete.esm.js";const y=({name:i,rules:p,label:c,control:u,options:f,getOptionLabel:h,getOptionValue:m,onChange:b,disabled:C,placeholder:g,freeSolo:x=!0,width:s,helperText:v,disableClearable:S,fullWidth:d})=>{const a=w();return e(N,{name:i,control:u,rules:p,render:({field:l,fieldState:n})=>e(O,{...l,value:l.value,freeSolo:x,autoSelect:!0,"data-testid":`${i}-autocomplete`,style:s?{width:s}:{minWidth:d?void 0:250},disabled:C,options:f,getOptionLabel:h,classes:{clearIndicator:a.clearIndicator},disableClearable:S,fullWidth:d,multiple:!0,size:"small",renderInput:o=>e(L,{...o,variant:"outlined",label:c,error:n.invalid,placeholder:l.value?.length?"":g,FormHelperTextProps:{className:a.helperText},margin:"dense",className:a.noMargin,helperText:v??(n.error?n.error.message:null)}),renderOption:(o,{selected:t})=>e(k,{onClick:r=>r.preventDefault(),control:e(z,{icon:e(I,{fontSize:"small"}),checkedIcon:e(F,{fontSize:"small"}),checked:t}),label:o}),onChange:(o,t)=>{const r=m?t.map(T=>m(T)):t;b?.(r),l.onChange(r)},ListboxComponent:W})})};export{y as FormControlledMultipleAutocomplete};
1
+ import{jsx as e}from"react/jsx-runtime";import{TextField as L,FormControlLabel as k,Checkbox as z}from"@material-ui/core";import F from"@material-ui/icons/CheckBox";import I from"@material-ui/icons/CheckBoxOutlineBlank";import{Autocomplete as O}from"@material-ui/lab";import{Controller as W}from"react-hook-form";import{ListboxVirtualized as j}from"../ListboxVirtualized/ListboxVirtualized.esm.js";import{useStyles as w}from"./FormControlledAutocomplete.esm.js";const y=({name:i,rules:p,label:c,control:u,options:f,getOptionLabel:h,getOptionValue:m,onChange:b,disabled:C,placeholder:g,freeSolo:x=!0,width:s,helperText:v,disableClearable:S,fullWidth:d})=>{const a=w();return e(W,{name:i,control:u,rules:p,render:({field:l,fieldState:n})=>e(O,{...l,value:l.value,freeSolo:x,autoSelect:!0,"data-testid":`${i}-autocomplete`,style:s?{width:s}:{minWidth:d?void 0:250},disabled:C,options:f,getOptionLabel:h,classes:{clearIndicator:a.clearIndicator},disableClearable:S,fullWidth:d,multiple:!0,size:"small",renderInput:o=>e(L,{...o,variant:"outlined",label:c,error:n.invalid,placeholder:l.value?.length?"":g,FormHelperTextProps:{className:a.helperText},margin:"dense",className:a.noMargin,helperText:v??(n.error?n.error.message:null)}),renderOption:(o,{selected:t})=>e(k,{onClick:r=>r.preventDefault(),control:e(z,{icon:e(I,{fontSize:"small"}),checkedIcon:e(F,{fontSize:"small"}),checked:t}),label:o}),onChange:(o,t)=>{const r=m?t.map(T=>m(T)):t;b?.(r),l.onChange(r)},ListboxComponent:j})})};export{y as FormControlledMultipleAutocomplete};
2
2
  //# sourceMappingURL=FormControlledMultipleAutocomplete.esm.js.map
@@ -1,2 +1,2 @@
1
- import{jsx as m,jsxs as v}from"react/jsx-runtime";import{useApi as O,configApiRef as k}from"@backstage/core-plugin-api";import{makeStyles as x,alpha as y,TextField as E,CircularProgress as P}from"@material-ui/core";import w from"@material-ui/lab/Autocomplete";import{useMemo as A,useCallback as I,useEffect as f,Fragment as F}from"react";import{useSearchParams as G}from"react-router-dom";import L from"react-use/lib/useLocalStorage";import{useGroupOptions as N}from"../../hooks/groups/useGroupOptions.esm.js";const R=x(o=>({root:{width:"100%",minWidth:250},textField:{"& $notchedOutline":{borderColor:y(o.page.fontColor,.25)},"&:hover $notchedOutline":{borderColor:o.page.fontColor}},input:{backgroundColor:"transparent",color:o.page.fontColor},clearIndicator:{color:o.page.fontColor},popupIndicator:{color:o.page.fontColor},notchedOutline:{}}),{name:"SoundcheckGroupSelector"}),j=({setError:o,margin:b,baseClass:a})=>{const{options:e,isLoading:p,isError:c}=N(),t=R(),[i,h]=G(),[n,C]=L("soundcheck.overview.groupRef",null),u=i.get("group"),d=O(k).getOptionalString("soundcheck.overview.defaultSelectedGroupType"),g=A(()=>{if(!p&&e.length){if(u||n){const r=u??n;return e.find(s=>s.ref===r)??e[0]}else if(d)return e.find(r=>r.type===d)??e[0];return e[0]}return null},[d,p,e,u,n]),l=I((r,s)=>{r&&i.get("group")!==r&&(i.set("group",r),h(i,{replace:s}),C(r))},[i,C,h]),S=I((r,s)=>{l?.(s?.ref)},[l]);return f(()=>{n&&!u&&l(n,!0)},[n,u,l]),f(()=>{l(g?.ref,!0)},[l,g]),f(()=>{o?.(c?new Error("Error loading groups"):void 0)},[c,o]),c?null:m(w,{"aria-label":"Current group",className:a?"":t.root,classes:{clearIndicator:a?"":t.clearIndicator,popupIndicator:a?"":t.popupIndicator},disableClearable:!0,options:e??[],loading:p,groupBy:r=>r.key,value:g,freeSolo:!1,onChange:S,getOptionLabel:r=>r.name,renderInput:r=>m(E,{...r,variant:"outlined",placeholder:p?"Loading":"Select a group",className:t.textField,margin:b,InputProps:{...r.InputProps,className:a?"":t.input,classes:{notchedOutline:a?"":t.notchedOutline},endAdornment:v(F,{children:[p?m(P,{color:"inherit",size:20}):null,r.InputProps.endAdornment]})}})})};export{j as GroupSelector};
1
+ import{jsx as g,jsxs as v}from"react/jsx-runtime";import{useApi as O,configApiRef as x}from"@backstage/core-plugin-api";import{makeStyles as P,alpha as w,TextField as y,CircularProgress as E}from"@material-ui/core";import A from"@material-ui/lab/Autocomplete";import{useMemo as F,useCallback as I,useEffect as h,Fragment as G}from"react";import{useSearchParams as L}from"react-router-dom";import N from"react-use/lib/useLocalStorage";import{useGroupOptions as j}from"../../hooks/groups/useGroupOptions.esm.js";const R=P(o=>({root:{width:"100%",minWidth:250},textField:{"& $notchedOutline":{borderColor:w(o.page.fontColor,.25)},"&:hover $notchedOutline":{borderColor:o.page.fontColor}},input:{backgroundColor:"transparent",color:o.page.fontColor},clearIndicator:{color:o.page.fontColor},popupIndicator:{color:o.page.fontColor},notchedOutline:{}}),{name:"SoundcheckGroupSelector"}),T=({setError:o,margin:S,baseClass:a,searchParam:c="group"})=>{const{options:e,isLoading:i,isError:d}=j(),t=R(),[p,C]=L(),[n,b]=N("soundcheck.overview.groupRef",null),s=p.get(c),m=O(x).getOptionalString("soundcheck.overview.defaultSelectedGroupType"),f=F(()=>{if(!i&&e.length){if(s||n){const r=s??n;return e.find(u=>u.ref===r)??e[0]}else if(m)return e.find(r=>r.type===m)??e[0];return e[0]}return null},[m,i,e,s,n]),l=I((r,u)=>{r&&p.get(c)!==r&&(p.set(c,r),C(p,{replace:u}),b(r))},[c,p,b,C]),k=I((r,u)=>{l?.(u?.ref)},[l]);return h(()=>{n&&!s&&l(n,!0)},[n,s,l]),h(()=>{l(f?.ref,!0)},[l,f]),h(()=>{o?.(d?new Error("Error loading groups"):void 0)},[d,o]),d?null:g(A,{"aria-label":"Current group",className:a?"":t.root,classes:{clearIndicator:a?"":t.clearIndicator,popupIndicator:a?"":t.popupIndicator},disableClearable:!0,options:e??[],loading:i,groupBy:r=>r.key,value:f,freeSolo:!1,onChange:k,getOptionLabel:r=>r.name,renderInput:r=>g(y,{...r,variant:"outlined",placeholder:i?"Loading":"Select a group",className:t.textField,margin:S,InputProps:{...r.InputProps,className:a?"":t.input,classes:{notchedOutline:a?"":t.notchedOutline},endAdornment:v(G,{children:[i?g(E,{color:"inherit",size:20}):null,r.InputProps.endAdornment]})}})})};export{T as GroupSelector};
2
2
  //# sourceMappingURL=GroupSelector.esm.js.map
@@ -1,2 +1,2 @@
1
- import{jsxs as a,Fragment as c,jsx as e}from"react/jsx-runtime";import{useRouteRef as u}from"@backstage/core-plugin-api";import{TableCell as d,Box as r,Typography as h,Link as N}from"@material-ui/core";import{makeStyles as w}from"@material-ui/core/styles";import{Skeleton as s}from"@material-ui/lab";import{CircularProgressbar as C,buildStyles as S}from"react-circular-progressbar";import"react-circular-progressbar/dist/styles.css";import{useSearchParams as R}from"react-router-dom";import{trackCheckDetailsRouteRef as B}from"../../routes.esm.js";import{getPercentageColor as g}from"../../utils/colors.esm.js";import{compactNumberFormatter as f}from"../../utils/formatters.esm.js";import{CheckStatusBar as v}from"../CheckStatusBar/CheckStatusBar.esm.js";const b=w(i=>({checkContent:{display:"flex",alignItems:"center",gap:i.spacing(2),width:"100%",paddingTop:i.spacing(1),paddingBottom:i.spacing(1)},checkStatus:{display:"flex",alignItems:"center",gap:i.spacing(1),minWidth:"fit-content"},checkName:{display:"flex",alignItems:"center"},checkNameLink:{color:"inherit",textDecoration:"none","&:hover":{textDecoration:"none"}},progressCircle:{width:"24px !important",height:"24px !important"},passPercentage:{fontWeight:"bold",fontSize:"1.25em",minWidth:"50px"},passingText:{color:i.palette.text.secondary,display:"flex",flexDirection:"column",alignItems:"flex-end",lineHeight:1.2,minWidth:"40px"},categoryBarSection:{display:"flex",flexDirection:"column",alignItems:"flex-end",width:"100%",justifyContent:"flex-end"},categoryBar:{"& .MuiBox-root > div":{height:"8px"},width:"100%"},skeleton:{backgroundColor:i.palette.action.hover},passingTextCell:{width:"100px",paddingRight:0,paddingTop:i.spacing(1),paddingBottom:i.spacing(1)}})),I=({check:i,status:n,theme:o,trackId:x})=>{const t=b(),k=u(B),[m]=R(),p=n?n.numberOfEntities-n.notApplicable-n.exempt:0,l=p>0?Math.round((n?.passed??0)/p*100):0,y=`${k({trackId:x,checkId:i.id})}${m.toString()?`?${m.toString()}`:""}`;return a(c,{children:[e(d,{style:{width:"120px",paddingRight:0},children:e(r,{className:t.checkStatus,children:n?a(c,{children:[e(r,{className:t.progressCircle,children:e(C,{value:l,strokeWidth:12,styles:S({strokeLinecap:"round",pathColor:g(o,l),trailColor:o.palette.divider})})}),a(h,{className:t.passPercentage,style:{color:g(o,l)},children:[l,"%"]})]}):a(c,{children:[e(s,{variant:"circle",width:24,height:24,className:t.skeleton}),e(s,{width:45,height:24,className:t.skeleton})]})})}),e(d,{style:{width:"300px",paddingRight:0},children:e(r,{className:t.checkName,children:e(N,{href:y,className:t.checkNameLink,children:e(h,{children:i.name})})})}),e(d,{style:{width:"250px",paddingRight:0},children:e(r,{className:t.categoryBarSection,children:n?e(r,{style:{width:"100%",display:"flex",justifyContent:"flex-end"},children:e(v,{status:n,className:t.categoryBar})}):e(s,{variant:"rect",width:250,height:8,className:t.skeleton})})}),e(d,{style:{width:"100px",paddingRight:0,paddingTop:o.spacing(1),paddingBottom:o.spacing(1)},children:e(r,{className:t.passingText,children:n?a(c,{children:[a(h,{variant:"caption",children:[f(n.passed)," of"," ",f(p)]}),e(h,{variant:"caption",children:"passing"})]}):a(c,{children:[e(s,{width:60,height:16,className:t.skeleton}),e(s,{width:40,height:16,className:t.skeleton})]})})})]})};export{I as CheckRowContent};
1
+ import{jsxs as a,Fragment as s,jsx as e}from"react/jsx-runtime";import{Link as u}from"@backstage/core-components";import{useRouteRef as N}from"@backstage/core-plugin-api";import{TableCell as d,Box as r,Typography as h}from"@material-ui/core";import{makeStyles as w}from"@material-ui/core/styles";import{Skeleton as o}from"@material-ui/lab";import{CircularProgressbar as C,buildStyles as S}from"react-circular-progressbar";import"react-circular-progressbar/dist/styles.css";import{useSearchParams as R}from"react-router-dom";import{trackCheckDetailsRouteRef as B}from"../../routes.esm.js";import{getPercentageColor as g}from"../../utils/colors.esm.js";import{compactNumberFormatter as f}from"../../utils/formatters.esm.js";import{CheckStatusBar as v}from"../CheckStatusBar/CheckStatusBar.esm.js";const b=w(i=>({checkContent:{display:"flex",alignItems:"center",gap:i.spacing(2),width:"100%",paddingTop:i.spacing(1),paddingBottom:i.spacing(1)},checkStatus:{display:"flex",alignItems:"center",gap:i.spacing(1),minWidth:"fit-content"},checkName:{display:"flex",alignItems:"center"},checkNameLink:{color:"inherit",textDecoration:"none","&:hover":{textDecoration:"none"}},progressCircle:{width:"24px !important",height:"24px !important"},passPercentage:{fontWeight:"bold",fontSize:"1.25em",minWidth:"50px"},passingText:{color:i.palette.text.secondary,display:"flex",flexDirection:"column",alignItems:"flex-end",lineHeight:1.2,minWidth:"40px"},categoryBarSection:{display:"flex",flexDirection:"column",alignItems:"flex-end",width:"100%",justifyContent:"flex-end"},categoryBar:{"& .MuiBox-root > div":{height:"8px"},width:"100%"},skeleton:{backgroundColor:i.palette.action.hover},passingTextCell:{width:"100px",paddingRight:0,paddingTop:i.spacing(1),paddingBottom:i.spacing(1)}})),I=({check:i,status:n,theme:c,trackId:x})=>{const t=b(),k=N(B),[m]=R(),p=n?n.numberOfEntities-n.notApplicable-n.exempt:0,l=p>0?Math.round((n?.passed??0)/p*100):0,y=`${k({trackId:x,checkId:i.id})}${m.toString()?`?${m.toString()}`:""}`;return a(s,{children:[e(d,{style:{width:"120px",paddingRight:0},children:e(r,{className:t.checkStatus,children:n?a(s,{children:[e(r,{className:t.progressCircle,children:e(C,{value:l,strokeWidth:12,styles:S({strokeLinecap:"round",pathColor:g(c,l),trailColor:c.palette.divider})})}),a(h,{className:t.passPercentage,style:{color:g(c,l)},children:[l,"%"]})]}):a(s,{children:[e(o,{variant:"circle",width:24,height:24,className:t.skeleton}),e(o,{width:45,height:24,className:t.skeleton})]})})}),e(d,{style:{width:"300px",paddingRight:0},children:e(r,{className:t.checkName,children:e(u,{to:y,className:t.checkNameLink,children:e(h,{children:i.name})})})}),e(d,{style:{width:"250px",paddingRight:0},children:e(r,{className:t.categoryBarSection,children:n?e(r,{style:{width:"100%",display:"flex",justifyContent:"flex-end"},children:e(v,{status:n,className:t.categoryBar})}):e(o,{variant:"rect",width:250,height:8,className:t.skeleton})})}),e(d,{style:{width:"100px",paddingRight:0,paddingTop:c.spacing(1),paddingBottom:c.spacing(1)},children:e(r,{className:t.passingText,children:n?a(s,{children:[a(h,{variant:"caption",children:[f(n.passed)," of"," ",f(p)]}),e(h,{variant:"caption",children:"passing"})]}):a(s,{children:[e(o,{width:60,height:16,className:t.skeleton}),e(o,{width:40,height:16,className:t.skeleton})]})})})]})};export{I as CheckRowContent};
2
2
  //# sourceMappingURL=CheckRowContent.esm.js.map
@@ -0,0 +1,2 @@
1
+ import{jsx as r,jsxs as t}from"react/jsx-runtime";import{Box as c,Grid as i,Typography as o}from"@material-ui/core";import{useSearchParams as n}from"react-router-dom";import"../TechHealth/Filters/types.esm.js";import"../TechHealth/Filters/FacetFilter.esm.js";import{FilterProvider as a}from"../TechHealth/Filters/FilterProvider.esm.js";import"../TechHealth/Filters/Filters.esm.js";import"../TechHealth/Filters/FiltersHeader.esm.js";import"../TechHealth/Filters/FiltersSection.esm.js";import"@backstage/catalog-model";import"lodash";import"react";import"../../contexts/TrackFormContext.esm.js";import"../../contexts/CheckFormContext.esm.js";import"../../contexts/CampaignFormContext.esm.js";import"../../contexts/UserProvider.esm.js";import"@backstage/core-plugin-api";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"@spotify/backstage-plugin-soundcheck-common";import"../../hooks/useSoundcheckAlert.esm.js";import"../../hooks/useConfirmationModal.esm.js";import{OrgInsightsSidebar as d}from"./OrgInsightsSidebar.esm.js";import{OrgInsightsViewSelector as p}from"./OrgInsightsViewSelector.esm.js";import{useOrgInsightsStyles as l}from"./styles.esm.js";import{TrackComparison as h}from"./TrackComparison.esm.js";const u=({selectedView:e})=>{switch(e){case"Track Focus":return r("div",{children:"Entity View"});case"Teams":return r("div",{children:"Group View"});case"Team Focus":return r("div",{children:"Group Focus View"});default:return r(h,{})}},g=({selectedView:e})=>{switch(e){case"Track Focus":return r("div",{children:"Track Focus View"});case"Teams":return r("div",{children:"Teams View"});case"Team Focus":return r("div",{children:"Team Focus View"});default:return r(d,{})}},w=({classes:e})=>t(i,{item:!0,className:e.sidebar,children:[r(o,{variant:"body1",children:"Choose a view to explore:"}),r(p,{})]}),v=()=>{const e=l(),[m]=n(),s=m.get("view");return r(a,{children:r(c,{className:e.root,children:t(i,{container:!0,direction:"column",spacing:2,children:[r(i,{item:!0,children:t(c,{className:e.content,children:[r(o,{variant:"h1",children:"Org Insights"}),r(o,{variant:"body1",children:"Explore the insights of your organization."})]})}),t(i,{item:!0,container:!0,direction:"row",children:[t(i,{item:!0,xs:3,children:[r(w,{classes:e}),r(g,{selectedView:s})]}),r(i,{item:!0,xs:9,children:r(u,{selectedView:s})})]})]})})})};export{v as OrgInsightsPage};
2
+ //# sourceMappingURL=OrgInsightsPage.esm.js.map
@@ -0,0 +1,2 @@
1
+ import{jsxs as t,jsx as r}from"react/jsx-runtime";import{Typography as i}from"@material-ui/core";import{GroupSelector as m}from"../GroupSelector/GroupSelector.esm.js";import{Facet as p}from"../TechHealth/Filters/types.esm.js";import{FacetFilter as e}from"../TechHealth/Filters/FacetFilter.esm.js";import"../TechHealth/Filters/FilterProvider.esm.js";import"../TechHealth/Filters/Filters.esm.js";import"../TechHealth/Filters/FiltersHeader.esm.js";import"../TechHealth/Filters/FiltersSection.esm.js";import"@backstage/catalog-model";import"lodash";import"react";import"../../contexts/TrackFormContext.esm.js";import"../../contexts/CheckFormContext.esm.js";import"../../contexts/CampaignFormContext.esm.js";import"../../contexts/UserProvider.esm.js";import"@backstage/core-plugin-api";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"@spotify/backstage-plugin-soundcheck-common";import"../../hooks/useSoundcheckAlert.esm.js";import"../../hooks/useConfirmationModal.esm.js";import"react-router-dom";import{useOrgInsightsStyles as a}from"./styles.esm.js";const s=()=>{const o=a();return t("div",{className:o.sidebar,children:[r(i,{variant:"caption",color:"textSecondary",children:"Group"}),r(m,{margin:"dense",searchParam:"owners"}),r(e,{facet:p.Track})]})};export{s as OrgInsightsSidebar};
2
+ //# sourceMappingURL=OrgInsightsSidebar.esm.js.map
@@ -0,0 +1,2 @@
1
+ import{jsxs as m,jsx as r}from"react/jsx-runtime";import{makeStyles as p,alpha as u,FormControl as g,InputLabel as C,Select as f,MenuItem as b}from"@material-ui/core";import{useSearchParams as I}from"react-router-dom";import w from"react-use/lib/useLocalStorage";const v=p(e=>({root:{width:"100%",minWidth:250},textField:{"& $notchedOutline":{borderColor:u(e.page.fontColor,.25)},"&:hover $notchedOutline":{borderColor:e.page.fontColor}},input:{backgroundColor:"transparent",color:e.page.fontColor},clearIndicator:{color:e.page.fontColor},popupIndicator:{color:e.page.fontColor},notchedOutline:{}}),{name:"SoundcheckLeadershipInsightsViewSelector"}),S=({margin:e,baseClass:a,searchParam:n="view"})=>{const l=v(),[k,c]=I(),[s,i]=w("soundcheck.leadershipInsights.selectedView",null),d=["Tracks","Track Focus","Teams","Team Focus"],h=o=>{const t=o.target.value;i(t),c({[n]:t})};return m(g,{className:l.formControl,style:{margin:e},fullWidth:!0,children:[r(C,{id:"view-selector-label",children:"Select View"}),r(f,{labelId:"view-selector-label",value:s||"",onChange:h,className:`${l.select} ${a}`,children:d.map(o=>r(b,{value:o,children:o},o))})]})};export{S as OrgInsightsViewSelector};
2
+ //# sourceMappingURL=OrgInsightsViewSelector.esm.js.map
@@ -0,0 +1,2 @@
1
+ import{jsxs as p,jsx as r}from"react/jsx-runtime";import{Typography as d,Grid as o}from"@material-ui/core";import{Skeleton as l}from"@material-ui/lab";import{useMemo as h}from"react";import"@backstage/catalog-model";import"@backstage/core-plugin-api";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"@spotify/backstage-plugin-soundcheck-common";import"../../hooks/useSoundcheckAlert.esm.js";import{useGetAllTracks as g}from"../../hooks/tracks/useGetAllTracks.esm.js";import"../../hooks/useConfirmationModal.esm.js";import"react-router-dom";import{GroupSelector as f}from"../GroupSelector/GroupSelector.esm.js";import{Facet as u}from"../TechHealth/Filters/types.esm.js";import"../TechHealth/Filters/FacetFilter.esm.js";import{useFilterContext as k}from"../TechHealth/Filters/FilterProvider.esm.js";import"../TechHealth/Filters/Filters.esm.js";import"../TechHealth/Filters/FiltersHeader.esm.js";import"../TechHealth/Filters/FiltersSection.esm.js";import"lodash";import"../../contexts/TrackFormContext.esm.js";import"../../contexts/CheckFormContext.esm.js";import"../../contexts/CampaignFormContext.esm.js";import"../../contexts/UserProvider.esm.js";import{useOrgInsightsStyles as v}from"./styles.esm.js";import{TrackStatusTile as y}from"./TrackStatusTile.esm.js";const G=({selectedGroup:e})=>{const t=v(),{data:c,isLoading:s}=g({}),{getSelectedFacetValues:m}=k(),a=h(()=>m(u.Track),[m]);return s?p("div",{className:t.root,children:[p("div",{className:t.sidebar,children:[r(d,{variant:"caption",color:"textSecondary",children:"Group"}),r(f,{margin:"dense",searchParam:"owners"})]}),r("div",{className:t.content,children:r(o,{container:!0,spacing:2,children:[...Array(12)].map((i,n)=>r(o,{item:!0,className:t.gridItem,children:r(l,{variant:"rect",height:200})},n))})})]}):r(o,{container:!0,spacing:2,children:c?.edges.filter(({node:i})=>a.length===0?!0:a.includes(i.id)).map(({node:i})=>r(o,{item:!0,className:t.gridItem,children:r(y,{track:i,filter:e?{"relations.ownedBy":e}:void 0})},i.id))})};export{G as TrackCardGrid};
2
+ //# sourceMappingURL=TrackCardGrid.esm.js.map
@@ -0,0 +1,2 @@
1
+ import{jsx as r}from"react/jsx-runtime";import{Box as t}from"@material-ui/core";import{useSearchParams as m}from"react-router-dom";import{useOrgInsightsStyles as a}from"./styles.esm.js";import{TrackCardGrid as c}from"./TrackCardGrid.esm.js";const i=()=>{const o=a(),[e]=m(),s=e.get("owners");return r(t,{className:o.content,children:r(c,{selectedGroup:s})})};export{i as TrackComparison};
2
+ //# sourceMappingURL=TrackComparison.esm.js.map
@@ -0,0 +1,2 @@
1
+ import{jsxs as t,jsx as a}from"react/jsx-runtime";import{useRouteRef as R}from"@backstage/core-plugin-api";import{useTheme as N,Paper as b,Typography as i,Box as c,Grid as v}from"@material-ui/core";import{makeStyles as w}from"@material-ui/core/styles";import{interpolateRgb as B}from"d3-interpolate";import{scaleLinear as D}from"d3-scale";import{useCallback as F}from"react";import{useNavigate as I,useSearchParams as L}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"@spotify/backstage-plugin-soundcheck-common";import"../../hooks/useSoundcheckAlert.esm.js";import"../../hooks/useConfirmationModal.esm.js";import{useCertificationStatus as T}from"../../hooks/aggregations/useCertificationStatus.esm.js";import{trackDetailsRouteRef as $}from"../../routes.esm.js";import{CategoryBar as M}from"../CategoryBar/CategoryBar.esm.js";import{LoadingIndicator as j}from"../LoadingIndicator/LoadingIndicator.esm.js";const P=(e,l)=>D().domain([0,50,100]).range([e.palette.error.main,e.palette.warning.main,e.palette.success.main]).interpolate(B.gamma(2.2))(l),x=w(e=>({card:{display:"flex",flexDirection:"column",border:`1px solid ${e.palette.divider}`,height:"100%",padding:e.spacing(2),cursor:"pointer","&:hover":{backgroundColor:e.palette.action.hover}},content:{display:"flex"},item:{display:"flex",justifyContent:"space-between",alignItems:"center"},legendDash:{width:e.spacing(2),height:e.spacing(1),borderRadius:e.spacing(.375),marginRight:e.spacing(1)},category:{display:"flex",alignItems:"center",flex:1,marginRight:e.spacing(2)},categoryBarContainer:{width:"100%",height:e.spacing(1),marginBottom:e.spacing(1)}})),p=e=>e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toString(),g=({label:e,value:l,total:r,color:s})=>{const n=x();return t(v,{item:!0,xs:12,className:n.item,children:[t(c,{className:n.category,children:[a("span",{className:n.legendDash,style:{backgroundColor:s}}),a(i,{variant:"body2",children:e})]}),r&&t(i,{variant:"body2",children:[p(l)," of ",p(r)," (",Math.round(l/r*100),"%)"]})]})},G=({track:e,filter:l})=>{const r=N(),s=I(),n=R($),[h]=L(),{data:f,isLoading:k}=T({trackId:e.id,filter:l},!0),o=f?.certificationStatus.statusByLevel[0],d=f?.certificationStatus.numberOfEntities??0,u=o?o.passed/d*100:0,m=x(),y=F(()=>{s(`${n({trackId:e.id})}?${h.toString()}`)},[s,e.id,n,h]);return k?t(b,{className:m.card,onClick:y,children:[a(i,{variant:"h6",children:e.name}),a(j,{})]}):t(b,{className:m.card,onClick:y,children:[a(i,{variant:"h6",children:e.name}),o?a(c,{className:m.content,children:t(c,{width:"100%",children:[t(c,{mb:2,children:[a(i,{variant:"caption",color:"textSecondary",display:"block",align:"left",children:"Current"}),t(i,{variant:"h1",style:{color:P(r,Math.floor(u))},children:[Math.floor(u),"%"]})]}),a(i,{variant:"caption",color:"textSecondary",display:"block",align:"left",children:"Check Summary"}),a(c,{className:m.categoryBarContainer,children:a(M,{data:o,valueFormatter:p,categories:["passed","failed","notReported"],categoryFormatter:C=>C.replace(/\b\w/g,S=>S.toUpperCase()),colors:[r.palette.success.main,r.palette.error.main,r.palette.text.disabled]})}),t(v,{container:!0,spacing:0,children:[a(g,{label:"Passing",value:o.passed,total:d,color:r.palette.success.main}),a(g,{label:"Failing",value:o.failed,total:d,color:r.palette.error.main}),a(g,{label:"Not Reported",value:o.notReported,total:d,color:r.palette.text.disabled})]})]})}):a(c,{margin:"auto",children:a(i,{variant:"body2",children:"No Data"})})]})};export{G as TrackStatusTile};
2
+ //# sourceMappingURL=TrackStatusTile.esm.js.map
@@ -0,0 +1,2 @@
1
+ import{makeStyles as d}from"@material-ui/core";const e=d(t=>({root:{display:"flex",height:"100%"},header:{backgroundColor:t.palette.background.default,padding:t.spacing(2),borderBottom:`1px solid ${t.palette.divider}`},sidebar:{width:"300px",padding:t.spacing(2)},content:{flexGrow:1,padding:t.spacing(2),overflow:"auto"},gridItem:{padding:t.spacing(1),width:"100%",[t.breakpoints.up("sm")]:{width:"50%"},[t.breakpoints.up("md")]:{width:"33.33%"},[t.breakpoints.up("lg")]:{width:"25%"},[t.breakpoints.up(1920)]:{width:"20%"}}}));export{e as useOrgInsightsStyles};
2
+ //# sourceMappingURL=styles.esm.js.map
@@ -1,2 +1,2 @@
1
- import{jsxs as a,jsx as t,Fragment as v}from"react/jsx-runtime";import{makeStyles as A,Typography as m,TextField as x,CircularProgress as L,Switch as W}from"@material-ui/core";import o from"@material-ui/core/Box";import F from"@material-ui/icons/Search";import{Autocomplete as B}from"@material-ui/lab";import{useContext as G,useEffect as b}from"react";import K from"react-use/lib/useLocalStorage";import{GroupSelector as O}from"../GroupSelector/GroupSelector.esm.js";import{OverviewPageContext as j}from"./OverviewPageContent.esm.js";const N=A(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)}})),R=({setError:r,unfilteredFacets:k,kind:l,type:p,onChange:u,isLoading:C,isFixedGroup:P})=>{const w=N(),n={types:k?.types.filter(({count:e})=>e>0)??[]},[h,S]=K("soundcheck-overview-pivot-status",!1),{searchValue:T,updateSearchValue:I,pivot:s,updatePivot:f}=G(j);b(()=>{h!==s&&f(!!h)},[]),b(()=>{const e=n?.types&&n.types.length>=0,i=!l&&e,d=l&&e&&!n?.types.find(({kind:c,type:g})=>l===c&&(!p&&!g||p===g));(i||d)&&u(n?.types[0]?.kind??"",n?.types[0]?.type,!0)},[l,p,n?.types,u]);const y=n?.types.map(({kind:e,type:i,count:d})=>{const c=`${e}|${i??""}`;return{facetKind:e,facetType:i,key:c,label:`${i??e} (${d>50?"50+":d})`,id:c}}).sort((e,i)=>e.key.localeCompare(i.key))??[],E=y.find(e=>e.key===`${l}|${p??""}`)??null,$=n&&(n.types?.length??0)>0;return a(o,{className:w.wrapper,children:[!P&&a(o,{flex:1,maxWidth:364,children:[t(m,{variant:"subtitle2",component:"div",children:"Group"}),t(O,{baseClass:!0,margin:"dense",setError:r})]}),$&&a(v,{children:[a(o,{flex:1,maxWidth:500,children:[t(m,{variant:"subtitle2",component:"div",children:"Entity Type"}),t(B,{"aria-label":"Entity Type Selection",disableClearable:!0,options:y??[],freeSolo:!1,groupBy:e=>e.facetKind,getOptionLabel:e=>e.label,value:E,onChange:(e,i)=>u(i.facetKind,i.facetType,!0),renderInput:e=>t(x,{...e,variant:"outlined",placeholder:"Select entity type",margin:"dense",fullWidth:!0,InputProps:{...e.InputProps,endAdornment:a(v,{children:[C?t(L,{color:"inherit",size:20}):null,e.InputProps.endAdornment]})}})})]}),a(o,{maxWidth:580,flex:1,children:[t(m,{variant:"subtitle2",component:"div",children:"Search Entities"}),t(x,{margin:"dense",placeholder:"Search entities",variant:"outlined",fullWidth:!0,value:T,onChange:e=>I(e.currentTarget.value),InputProps:{startAdornment:t(o,{marginRight:.75,display:"flex",alignItems:"center",children:t(F,{color:"inherit"})})}})]}),a(o,{display:"flex",flexDirection:"column",children:[t(m,{style:{marginLeft:10},variant:"subtitle2",component:"div",children:"Pivot"}),t(o,{flex:1,display:"flex",alignItems:"center",children:t(W,{checked:s,onChange:()=>{S(!s),f(!s)},inputProps:{"aria-label":"pivot overview table"}})})]})]})]})};export{R as OverviewPageHeader};
1
+ import{jsxs as p,jsx as n,Fragment as S}from"react/jsx-runtime";import{makeStyles as j,Typography as g,TextField as w,CircularProgress as R,Switch as V}from"@material-ui/core";import c from"@material-ui/core/Box";import z from"@material-ui/icons/Search";import{Autocomplete as D}from"@material-ui/lab";import{groupBy as H,sortBy as M,maxBy as N}from"lodash";import{useContext as X,useEffect as $,useMemo as v}from"react";import{useSearchParams as q}from"react-router-dom";import J from"react-use/lib/useLocalStorage";import{GroupSelector as Q}from"../GroupSelector/GroupSelector.esm.js";import{OverviewPageContext as U}from"./OverviewPageContent.esm.js";const Y=j(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)}})),Z=({setError:r,unfilteredFacets:I,kind:h,type:d,onChange:x,isLoading:y,isFixedGroup:E})=>{const L=Y(),o={types:I?.types.filter(({count:e})=>e>0)??[]},[b,B]=J("soundcheck-overview-pivot-status",!1),[k]=q(),P=k.get("kind"),W=k.get("type"),{searchValue:A,updateSearchValue:F,pivot:m,updatePivot:T}=X(U);$(()=>{b!==m&&T(!!b)},[]);const s=v(()=>o?.types.map(({kind:e,type:t,count:a})=>{const i=`${e}|${t??""}`;return{facetKind:e,facetType:t,key:i,label:`${t??e} (${a>50?"50+":a})`,id:i,count:a}}).sort((e,t)=>e.key.localeCompare(t.key))??[],[o?.types]),C=v(()=>{const e=H(s,t=>t.facetKind);return Object.values(e).map(t=>t.reduce((a,i)=>{const u=a.count+i.count,l=`${i.facetKind}|all`;return{facetKind:i.facetKind,facetType:"all",count:u,key:l,id:l,label:`all ${i.facetKind.toLowerCase()}s (${u>50?"50+":u})`}},{count:0,facetType:"all",facetKind:"",key:"",label:"",id:""}))},[s]),K=v(()=>M([...s,...C],"facetKind"),[C,s]);$(()=>{if(y)return;const e=h??P,t=d??W,a=o?.types&&o.types.length>=0,i=!e&&a,u=!!e&&t!=="all"&&a&&!o?.types.find(({kind:l,type:f})=>e===l&&(!d&&!f||d===f));if(i||u){const l=N(s,f=>f.count);x(l?.facetKind??"",l?.facetType??"",!0)}},[h,P,d,y]);const G=K.find(e=>e.key===`${h}|${d??""}`)??null,O=o&&(o.types?.length??0)>0;return p(c,{className:L.wrapper,children:[!E&&p(c,{flex:1,maxWidth:364,children:[n(g,{variant:"subtitle2",component:"div",children:"Group"}),n(Q,{baseClass:!0,margin:"dense",setError:r})]}),O&&p(S,{children:[p(c,{flex:1,maxWidth:500,children:[n(g,{variant:"subtitle2",component:"div",children:"Entity Type"}),n(D,{"aria-label":"Entity Type Selection",disableClearable:!0,options:K??[],freeSolo:!1,groupBy:e=>e.facetKind,getOptionLabel:e=>e.label,value:G,onChange:(e,t)=>x(t.facetKind,t.facetType,!0),renderInput:e=>n(w,{...e,variant:"outlined",placeholder:"Select entity type",margin:"dense",fullWidth:!0,InputProps:{...e.InputProps,endAdornment:p(S,{children:[y?n(R,{color:"inherit",size:20}):null,e.InputProps.endAdornment]})}})})]}),p(c,{maxWidth:580,flex:1,children:[n(g,{variant:"subtitle2",component:"div",children:"Search Entities"}),n(w,{margin:"dense",placeholder:"Search entities",variant:"outlined",fullWidth:!0,value:A,onChange:e=>F(e.currentTarget.value),InputProps:{startAdornment:n(c,{marginRight:.75,display:"flex",alignItems:"center",children:n(z,{color:"inherit"})})}})]}),p(c,{display:"flex",flexDirection:"column",children:[n(g,{style:{marginLeft:10},variant:"subtitle2",component:"div",children:"Pivot"}),n(c,{flex:1,display:"flex",alignItems:"center",children:n(V,{checked:m,onChange:()=>{B(!m),T(!m)},inputProps:{"aria-label":"pivot overview table"}})})]})]})]})};export{Z as OverviewPageHeader};
2
2
  //# sourceMappingURL=OverviewPageHeader.esm.js.map
@@ -1,2 +1,2 @@
1
- import{jsx as c,jsxs as o}from"react/jsx-runtime";import{makeStyles as r,Typography as l}from"@material-ui/core";import{RowHeights as t}from"../resultsTableUtils.esm.js";import{TrackCheckIndicator as p}from"./TrackCheckIndicator.esm.js";const s=r(e=>({checkNameCell:{padding:0,backgroundColor:e.palette.background.paper},checkNameContent:{padding:`0 ${e.spacing(2)}px`,display:"flex",justifyContent:"space-between",alignItems:"center"},checkNameTypography:{overflow:"hidden",textOverflow:"ellipsis",fontWeight:e.typography.body1.fontWeight},checkIndicator:{flexBasis:e.spacing(8)},checkNameCellVirtualized:{height:`${t.check}px`,lineHeight:`${t.check}px`,borderBottom:`1px solid ${e.palette.divider}`,borderRight:`1px solid ${e.palette.divider}`}})),n=({name:e,progress:i})=>{const a=s();return c("div",{className:a.checkNameCell,"aria-label":`${e} check`,children:o("div",{className:`${a.checkNameContent} ${a.checkNameCellVirtualized}`,children:[c(l,{variant:"subtitle2",component:"p",className:a.checkNameTypography,children:e}),c(p,{className:a.checkIndicator,progress:i})]})})};export{n as CheckNameCell};
1
+ import{jsx as c,jsxs as r}from"react/jsx-runtime";import{makeStyles as l,Typography as p}from"@material-ui/core";import{RowHeights as a}from"../resultsTableUtils.esm.js";import{TrackCheckStatusCount as n}from"./TrackCheckStatusCount.esm.js";const s=l(e=>({checkNameCell:{padding:0,backgroundColor:e.palette.background.paper},checkNameContent:{padding:`0 ${e.spacing(2)}px`,display:"flex",justifyContent:"space-between",alignItems:"center"},checkNameTypography:{overflow:"hidden",textOverflow:"ellipsis",fontWeight:e.typography.body1.fontWeight},checkIndicator:{flexBasis:e.spacing(8)},checkNameCellVirtualized:{height:`${a.check}px`,lineHeight:`${a.check}px`,borderBottom:`1px solid ${e.palette.divider}`,borderRight:`1px solid ${e.palette.divider}`}})),h=({name:e,progress:o,checkId:i})=>{const t=s();return c("div",{className:t.checkNameCell,"aria-label":`${e} check`,children:r("div",{className:`${t.checkNameContent} ${t.checkNameCellVirtualized}`,children:[c(p,{variant:"subtitle2",component:"p",className:t.checkNameTypography,children:e}),c(n,{progress:o,checkId:i})]})})};export{h as CheckNameCell};
2
2
  //# sourceMappingURL=CheckNameCell.esm.js.map
@@ -0,0 +1,2 @@
1
+ import{jsx as r,jsxs as o,Fragment as d}from"react/jsx-runtime";import{useRouteRef as u}from"@backstage/core-plugin-api";import{makeStyles as k,Tooltip as g,Box as t}from"@material-ui/core";import{useCallback as S}from"react";import{useSearchParams as x,useNavigate as D}from"react-router-dom";import{ResultState as p}from"../../../graphql/generated/index.esm.js";import{checkDetailsRouteRef as I}from"../../../routes.esm.js";import{CheckIcon as h}from"../../CheckIcon/CheckIcon.esm.js";const y=k(()=>({icon:{fontSize:"inherit"},wrapper:{"&:hover":{cursor:"pointer"}}})),A=({checkId:c,progress:e})=>{const s=y(),[l]=x(),n=l.get("group"),i=l.get("type"),a=D(),m=u(I),f=S(()=>{a(`${m({checkId:c})}?owners=${n}${i&&i!=="all"?`&types=${i}`:""}`)},[c,m,i,a,n]);return r(g,{title:o(d,{children:[o(t,{children:[e.PASSED," ",e.PASSED===1?"entity":"entities"," ","passing check."]}),o(t,{children:[e.FAILED," ",e.FAILED===1?"entity":"entities"," ","failing check."]}),r(t,{children:"Click for more details."})]}),children:o(t,{onClick:f,className:s.wrapper,display:"flex",alignItems:"center",children:[r(h,{tooltip:!1,className:s.icon,result:p.Passed}),r(t,{marginRight:"4px",children:e.PASSED}),r(h,{tooltip:!1,className:s.icon,result:p.Failed}),r(t,{children:e.FAILED})]})})};export{A as TrackCheckStatusCount};
2
+ //# sourceMappingURL=TrackCheckStatusCount.esm.js.map
@@ -1,2 +1,2 @@
1
- import{jsx as r}from"react/jsx-runtime";import{CheckCell as a}from"./CheckCell.esm.js";import{CheckNameCell as o}from"./CheckNameCell.esm.js";import{EntityRefCell as d}from"./EntityRefCell.esm.js";import{TrackBadgeCell as i}from"./TrackBadgeCell.esm.js";import{TrackLevelHeaderCell as s,TrackLevelHeaderFill as y}from"./TrackLevelHeaderCell.esm.js";import{TrackTitleCell as k}from"./TrackTitleCell.esm.js";const m=e=>({type:"TrackHeader",render:()=>r(k,{name:e})}),C=e=>({type:"LevelHeader",render:()=>e?r(s,{name:e}):r(y,{})}),p=(e,t)=>r(o,{name:e,progress:t}),f=(e,t)=>({type:"CheckTitle",render:()=>p(e,t)}),u=({trackId:e,check:t,entityRef:l,result:c,entityRoute:n})=>r(a,{check:t,entityRef:l,entityRoute:n,trackId:e,result:c,isVirtualized:!0}),R=(e,t,l,c,n)=>({type:"CheckResult",render:()=>r(u,{trackId:e,check:t,entityRef:l,result:c,entityRoute:n})}),h=(e,t)=>r(d,{entityRef:e,noTransform:t}),T=(e,t)=>({type:"EntityHeader",render:()=>h(e,t)}),H=(e,t,l)=>({type:"LevelBadge",render:()=>r(i,{small:l,trackStatus:e,trackType:t})}),v=e=>t=>{const l=e[t.rowIndex].cells[t.columnIndex];return l?r("div",{style:t.style,children:l.render()}):r("div",{style:t.style})};export{v as cellRenderer,R as checkResultCell,f as checkTitleCell,T as entityHeaderCell,C as levelHeaderCell,H as trackBadgeCell,m as trackHeaderCell};
1
+ import{jsx as l}from"react/jsx-runtime";import{CheckCell as a}from"./CheckCell.esm.js";import{CheckNameCell as o}from"./CheckNameCell.esm.js";import{EntityRefCell as d}from"./EntityRefCell.esm.js";import{TrackBadgeCell as i}from"./TrackBadgeCell.esm.js";import{TrackLevelHeaderCell as s,TrackLevelHeaderFill as k}from"./TrackLevelHeaderCell.esm.js";import{TrackTitleCell as y}from"./TrackTitleCell.esm.js";const m=e=>({type:"TrackHeader",render:()=>l(y,{name:e})}),C=e=>({type:"LevelHeader",render:()=>e?l(s,{name:e}):l(k,{})}),p=(e,t,r)=>l(o,{name:e,progress:t,checkId:r}),f=(e,t,r)=>({type:"CheckTitle",render:()=>p(e,t,r)}),u=({trackId:e,check:t,entityRef:r,result:c,entityRoute:n})=>l(a,{check:t,entityRef:r,entityRoute:n,trackId:e,result:c,isVirtualized:!0}),h=(e,t,r,c,n)=>({type:"CheckResult",render:()=>l(u,{trackId:e,check:t,entityRef:r,result:c,entityRoute:n})}),R=(e,t)=>l(d,{entityRef:e,noTransform:t}),T=(e,t)=>({type:"EntityHeader",render:()=>R(e,t)}),H=(e,t,r)=>({type:"LevelBadge",render:()=>l(i,{small:r,trackStatus:e,trackType:t})}),v=e=>t=>{const r=e[t.rowIndex].cells[t.columnIndex];return r?l("div",{style:t.style,children:r.render()}):l("div",{style:t.style})};export{v as cellRenderer,h as checkResultCell,f as checkTitleCell,T as entityHeaderCell,C as levelHeaderCell,H as trackBadgeCell,m as trackHeaderCell};
2
2
  //# sourceMappingURL=cellRenderer.esm.js.map
@@ -1,2 +1,2 @@
1
- import{jsx as p}from"react/jsx-runtime";import{useMemo as y}from"react";import{ResultsTable as a}from"./ResultsTable.esm.js";const d=({facets:e,ownerEntityRef:t,kind:c,type:f,setError:r})=>{const m=y(()=>{const o=new Map;return e.types.forEach(({kind:n,type:s})=>{const i=`${n}|${s??""}`;o.set(i,p(a,{ownerEntityRef:t,kind:n,type:s,setError:r},i))}),o},[e,t,r]);return p("div",{children:m.get(`${c}|${f??""}`)})};export{d as OverviewTableContent};
1
+ import{jsx as i}from"react/jsx-runtime";import{uniq as y}from"lodash";import{useMemo as l}from"react";import{ResultsTable as f}from"./ResultsTable.esm.js";const d=({facets:r,ownerEntityRef:o,kind:m,type:a,setError:n})=>{const c=l(()=>{const s=new Map;r.types.forEach(({kind:e,type:t})=>{const p=`${e}|${t??""}`;s.set(p,i(f,{ownerEntityRef:o,kind:e,type:t,setError:n},p))});for(const e of y(r.types.map(t=>t.kind))){const t=`${e}|all`;s.set(t,i(f,{ownerEntityRef:o,kind:e,type:"all",setError:n},t))}return s},[r,o,n]);return i("div",{children:c.get(`${m}|${a??""}`)})};export{d as OverviewTableContent};
2
2
  //# sourceMappingURL=OverviewTableContent.esm.js.map
@@ -1,2 +1,2 @@
1
- import{jsx as o,jsxs as P,Fragment as D}from"react/jsx-runtime";import{useRouteRef as M}from"@backstage/core-plugin-api";import{entityRouteRef as q}from"@backstage/plugin-catalog-react";import{makeStyles as B,Grid as I}from"@material-ui/core";import{useContext as J,useEffect as y,useState as K,useRef as Q,useLayoutEffect as U,useMemo as X}from"react";import{VariableSizeGrid as Y}from"react-window";import"@backstage/catalog-model";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import{useTrackOverviewForOwner as Z}from"../../hooks/certifications/useTrackOverviewForOwner.esm.js";import"@spotify/backstage-plugin-soundcheck-common";import"../../hooks/useSoundcheckAlert.esm.js";import"../../hooks/useConfirmationModal.esm.js";import"react-router-dom";import{EmptyState as _}from"../EmptyState/EmptyState.esm.js";import"../OverviewPage/OverviewPage.esm.js";import"@spotify/backstage-plugin-core";import"../SoundcheckQueryClientProvider/SoundcheckQueryClientProvider.esm.js";import{OverviewPageContext as ee}from"../OverviewPage/OverviewPageContent.esm.js";import"../Pagination/Pagination.esm.js";import{useCursorPagination as te,CursorPagination as re}from"../Pagination/CursorPagination.esm.js";import{cellRenderer as oe}from"./Cell/cellRenderer.esm.js";import{OverviewTableSkeleton as ie}from"./OverviewTableSkeleton.esm.js";import{ResultsTableHeader as ne}from"./ResultsTableHeader.esm.js";import{generateRowsPivoted as ae,generateRows as le,generateHeaderRowPivoted as se,generateHeaderRow as ue}from"./ResultsTableRow.esm.js";import{RowHeights as E,CellWidths as S,calculateTableWidth as me}from"./resultsTableUtils.esm.js";import pe from"./useWindowDimensions.esm.js";const W=25,ce=B(i=>({table:{backgroundColor:i.palette.background.paper,borderCollapse:"collapse",whiteSpace:"nowrap",textAlign:"left",overflow:"auto"},tableContainer:{backgroundColor:i.palette.background.paper}})),de=({setError:i,kind:m,type:p,ownerEntityRef:t})=>{const{cursor:x,pageSize:R,...c}=te({defaultPageSize:W,label:"entitiesPerPage"}),{debouncedSearchValue:l,pivot:s}=J(ee),{data:e,isLoading:d,isError:b}=Z(t,{kind:m,type:p},R,x,l);y(()=>{c.setCursor(""),c.setCurrentPage(0)},[l]);const k=ce(),g=M(q);y(()=>{i?.(b?new Error("Error loading track overview"):void 0)},[b,i]);const[H,z]=K(0),{height:T}=pe(),n=Q(null);U(()=>{e&&t&&n?.current&&z(n.current.clientWidth?n.current.clientWidth-16:100)},[n,e,t]);const{rows:h,headerRow:f,tableWidth:w,entityRefsWithPadding:N,getRowHeight:O,columnCount:V}=X(()=>{if(d||!e||!t)return{};const{tracks:a,entityRefs:r}=e;if(!r)return{};const u=r.length>=25?r:[...r,...Array.from({length:25-r.length},()=>{})],C=s?ae(a,r,g):le(a,u,g),v=C[0]?.cells?.length??u.length+1,G=s?se(a):ue(u),L=me(v-1)+60;return{rows:C,headerRow:G,tableWidth:L,entityRefsWithPadding:u,getRowHeight:j=>C[j]?.height??E.check,columnCount:v}},[e,g,d,t,s]);if(d)return o(ie,{});if(!e||!t)return null;const{totalCount:$,endCursor:A,prevCursor:F}=e;return!f||!w||!N||!h?.length?l?o(_,{title:"No Entities Found",description:`No entities found with name containing: '${l}'`}):null:P("div",{ref:n,children:[o(I,{"aria-label":`Check results for ${p??m}`,item:!0,xs:12,className:k.tableContainer,children:H>0&&P(D,{children:[o(ne,{headerRow:f,gridWidth:w}),o(Y,{className:k.table,columnCount:V,columnWidth:a=>a===0?S.trackTitle:S.checkResult,rowCount:h.length,rowHeight:O,height:T*.7-E.paginationControl-f.height,width:w,children:oe(h)},s?"entityView":"checkView")]})},`${m}|${p??""}`),o(re,{...c,totalCount:$,defaultPageSize:W,endCursor:A,prevCursor:F,pageSize:R,labelRowsPerPage:"Entities per page:"})]})};export{de as ResultsTable};
1
+ import{jsx as o,jsxs as P,Fragment as D}from"react/jsx-runtime";import{useRouteRef as M}from"@backstage/core-plugin-api";import{entityRouteRef as q}from"@backstage/plugin-catalog-react";import{makeStyles as B,Grid as I}from"@material-ui/core";import{useContext as J,useEffect as y,useState as K,useRef as Q,useLayoutEffect as U,useMemo as X}from"react";import{VariableSizeGrid as Y}from"react-window";import"@backstage/catalog-model";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import{useTrackOverviewForOwner as Z}from"../../hooks/certifications/useTrackOverviewForOwner.esm.js";import"@spotify/backstage-plugin-soundcheck-common";import"../../hooks/useSoundcheckAlert.esm.js";import"../../hooks/useConfirmationModal.esm.js";import"react-router-dom";import{EmptyState as _}from"../EmptyState/EmptyState.esm.js";import"../OverviewPage/OverviewPage.esm.js";import"@spotify/backstage-plugin-core";import"../SoundcheckQueryClientProvider/SoundcheckQueryClientProvider.esm.js";import{OverviewPageContext as ee}from"../OverviewPage/OverviewPageContent.esm.js";import"../Pagination/Pagination.esm.js";import{useCursorPagination as te,CursorPagination as re}from"../Pagination/CursorPagination.esm.js";import{cellRenderer as oe}from"./Cell/cellRenderer.esm.js";import{OverviewTableSkeleton as ie}from"./OverviewTableSkeleton.esm.js";import{ResultsTableHeader as ne}from"./ResultsTableHeader.esm.js";import{generateRowsPivoted as ae,generateRows as le,generateHeaderRowPivoted as se,generateHeaderRow as ue}from"./ResultsTableRow.esm.js";import{RowHeights as E,CellWidths as S,calculateTableWidth as me}from"./resultsTableUtils.esm.js";import ce from"./useWindowDimensions.esm.js";const W=25,pe=B(i=>({table:{backgroundColor:i.palette.background.paper,borderCollapse:"collapse",whiteSpace:"nowrap",textAlign:"left",overflow:"auto"},tableContainer:{backgroundColor:i.palette.background.paper}})),de=({setError:i,kind:c,type:l,ownerEntityRef:t})=>{const{cursor:x,pageSize:R,...p}=te({defaultPageSize:W,label:"entitiesPerPage"}),{debouncedSearchValue:s,pivot:u}=J(ee),{data:e,isLoading:d,isError:b}=Z(t,{kind:c,type:l==="all"?null:l},R,x,s);y(()=>{p.setCursor(""),p.setCurrentPage(0)},[s]);const k=pe(),g=M(q);y(()=>{i?.(b?new Error("Error loading track overview"):void 0)},[b,i]);const[H,z]=K(0),{height:T}=ce(),n=Q(null);U(()=>{e&&t&&n?.current&&z(n.current.clientWidth?n.current.clientWidth-16:100)},[n,e,t]);const{rows:h,headerRow:f,tableWidth:w,entityRefsWithPadding:N,getRowHeight:O,columnCount:V}=X(()=>{if(d||!e||!t)return{};const{tracks:a,entityRefs:r}=e;if(!r)return{};const m=r.length>=25?r:[...r,...Array.from({length:25-r.length},()=>{})],C=u?ae(a,r,g):le(a,m,g),v=C[0]?.cells?.length??m.length+1,G=u?se(a):ue(m),L=me(v-1)+60;return{rows:C,headerRow:G,tableWidth:L,entityRefsWithPadding:m,getRowHeight:j=>C[j]?.height??E.check,columnCount:v}},[e,g,d,t,u]);if(d)return o(ie,{});if(!e||!t)return null;const{totalCount:$,endCursor:A,prevCursor:F}=e;return!f||!w||!N||!h?.length?s?o(_,{title:"No Entities Found",description:`No entities found with name containing: '${s}'`}):null:P("div",{ref:n,children:[o(I,{"aria-label":`Check results for ${l??c}`,item:!0,xs:12,className:k.tableContainer,children:H>0&&P(D,{children:[o(ne,{headerRow:f,gridWidth:w}),o(Y,{className:k.table,columnCount:V,columnWidth:a=>a===0?S.trackTitle:S.checkResult,rowCount:h.length,rowHeight:O,height:T*.7-E.paginationControl-f.height,width:w,children:oe(h)},u?"entityView":"checkView")]})},`${c}|${l??""}`),o(re,{...p,totalCount:$,defaultPageSize:W,endCursor:A,prevCursor:F,pageSize:R,labelRowsPerPage:"Entities per page:"})]})};export{de as ResultsTable};
2
2
  //# sourceMappingURL=ResultsTable.esm.js.map
@@ -1,2 +1,2 @@
1
- import{jsx as u}from"react/jsx-runtime";import{ResultState as y}from"../../graphql/generated/index.esm.js";import{entityHeaderCell as g,trackHeaderCell as w,trackBadgeCell as C,levelHeaderCell as R,checkTitleCell as E,checkResultCell as H}from"./Cell/cellRenderer.esm.js";import{CheckLabelCellType as v,CheckLabelCell as T}from"./Cell/CheckLabelCell.esm.js";import{TrackLevelHeaderFill as L}from"./Cell/TrackLevelHeaderCell.esm.js";import{findLongestRefTitle as M,calculateHeightForRefTitle as S,RowHeights as d}from"./resultsTableUtils.esm.js";const A=i=>{const l=M(i??[]);return{height:Math.min(S(l.length??1)-10,125),cells:[g(""),...i.map(t=>g(t||""))]}},F=(i,l,t)=>{const e=[];return i.forEach(({track:o,levels:p,trackStatuses:n})=>{e.push({height:d.trackTitle,cells:[w(o.name),...l.map(r=>{const a=r?n.find(c=>c.entityRef===r):void 0;return C(a,o.type??void 0)})]}),p.forEach(r=>{e.push({height:d.levelTitle,cells:[R(r.name),...l.map(a=>R(""))]}),r.checks.forEach(({check:a,results:c,totalCount:m,totalPassing:s})=>{const k={PASSED:s,FAILED:m-s};e.push({height:d.check,cells:[E(a.name,k),...l.map(h=>H(o.id,a,h,c.find(f=>f.entityRef===h)?.result??y.NotApplicable,t))]})})})}),e},P=i=>{const l=i.flatMap(({track:t,levels:e})=>{const o={label:t.name??t.id,description:t.description??"",cellType:v.track},p=e.flatMap(n=>{const r={label:n.name??`level ${n.ordinal}`,cellType:v.level},a=n.checks.map(({check:c})=>({label:c.name??c.id,description:c.description??"",cellType:v.check}));return[r,...a]});return[o,...p]});return{height:125,cells:[{type:"CheckHeader",render:()=>u(T,{})},...l.map(t=>({render:()=>u(T,{...t}),type:"CheckHeader"}))]}},x=(i,l,t)=>l.map(e=>{const o=g(e,!0),p=i.flatMap(({track:n,levels:r,trackStatuses:a})=>{const c=e?a.find(s=>s.entityRef===e):void 0,m=r.flatMap(s=>{const k=s.checks.map(({check:h,results:f})=>H(n.id,h,e,f.find(b=>b.entityRef===e)?.result??y.NotApplicable,t));return[{type:"Filler",render:()=>u(L,{pivot:!0})},...k]});return[C(c,n.type??void 0,!0),...m]});return[o,...p]}).map(e=>({height:d.check,cells:e}));export{A as generateHeaderRow,P as generateHeaderRowPivoted,F as generateRows,x as generateRowsPivoted};
1
+ import{jsx as u}from"react/jsx-runtime";import{ResultState as y}from"../../graphql/generated/index.esm.js";import{entityHeaderCell as g,trackHeaderCell as w,trackBadgeCell as R,levelHeaderCell as C,checkTitleCell as E,checkResultCell as H}from"./Cell/cellRenderer.esm.js";import{CheckLabelCellType as v,CheckLabelCell as T}from"./Cell/CheckLabelCell.esm.js";import{TrackLevelHeaderFill as F}from"./Cell/TrackLevelHeaderCell.esm.js";import{findLongestRefTitle as L,calculateHeightForRefTitle as M,RowHeights as d}from"./resultsTableUtils.esm.js";const S=i=>{const r=L(i??[]);return{height:Math.min(M(r.length??1)-10,125),cells:[g(""),...i.map(t=>g(t||""))]}},A=(i,r,t)=>{const e=[];return i.forEach(({track:o,levels:s,trackStatuses:n})=>{e.push({height:d.trackTitle,cells:[w(o.name),...r.map(c=>{const l=c?n.find(a=>a.entityRef===c):void 0;return R(l,o.type??void 0)})]}),s.forEach(c=>{e.push({height:d.levelTitle,cells:[C(c.name),...r.map(l=>C(""))]}),c.checks.forEach(({check:l,results:a,totalPassing:m,totalFailing:p})=>{const k={PASSED:m,FAILED:p};e.push({height:d.check,cells:[E(l.name,k,l.id),...r.map(h=>H(o.id,l,h,a.find(f=>f.entityRef===h)?.result??y.NotApplicable,t))]})})})}),e},P=i=>{const r=i.flatMap(({track:t,levels:e})=>{const o={label:t.name??t.id,description:t.description??"",cellType:v.track},s=e.flatMap(n=>{const c={label:n.name??`level ${n.ordinal}`,cellType:v.level},l=n.checks.map(({check:a})=>({label:a.name??a.id,description:a.description??"",cellType:v.check}));return[c,...l]});return[o,...s]});return{height:125,cells:[{type:"CheckHeader",render:()=>u(T,{})},...r.map(t=>({render:()=>u(T,{...t}),type:"CheckHeader"}))]}},x=(i,r,t)=>r.map(e=>{const o=g(e,!0),s=i.flatMap(({track:n,levels:c,trackStatuses:l})=>{const a=e?l.find(p=>p.entityRef===e):void 0,m=c.flatMap(p=>{const k=p.checks.map(({check:h,results:f})=>H(n.id,h,e,f.find(b=>b.entityRef===e)?.result??y.NotApplicable,t));return[{type:"Filler",render:()=>u(F,{pivot:!0})},...k]});return[R(a,n.type??void 0,!0),...m]});return[o,...s]}).map(e=>({height:d.check,cells:e}));export{S as generateHeaderRow,P as generateHeaderRowPivoted,A as generateRows,x as generateRowsPivoted};
2
2
  //# sourceMappingURL=ResultsTableRow.esm.js.map
@@ -1,2 +1,2 @@
1
- import{jsx as t,jsxs as s,Fragment as d}from"react/jsx-runtime";import{useRouteRef as p,useRouteRefParams as u}from"@backstage/core-plugin-api";import{useEntity as m}from"@backstage/plugin-catalog-react";import{SecretsContextProvider as j}from"@backstage/plugin-scaffolder-react";import{Routes as L,Route as l,Navigate as f}from"react-router-dom";import{useAllCertifications as A}from"../hooks/certifications/useAllCertifications.esm.js";import"@tanstack/react-query";import"../api.esm.js";import"../hooks/graphqlKeys.esm.js";import{useCertificationDetailsForTrack as T}from"../hooks/certifications/useCertificationDetailsForTrack.esm.js";import"@backstage/catalog-model";import"@spotify/backstage-plugin-soundcheck-common";import"react";import"../hooks/useSoundcheckAlert.esm.js";import"../hooks/useConfirmationModal.esm.js";import{usePlaylists as P}from"../hooks/playlists/usePlaylists.esm.js";import{certificationPlaylistTrackCheckRouteRef as C,certificationPlaylistTrackRouteRef as k,certificationPlaylistRouteRef as R,certificationTrackRouteRef as y,certificationRouteRef as g}from"../routes.esm.js";import{EntityContent as n}from"./EntityContent/EntityContent.esm.js";const D=()=>{const{entity:r}=m(),e=p(R),o=p(y),{isLoading:c,data:i}=P(r),{isLoading:a,data:E}=A(r);if(c||a)return null;const h=i?.[0]?.id,I=E?.[0]?.track.id;return!h&&!I?null:t(f,{to:h?e({playlistId:h}):o({trackId:I}),replace:!0})},v=()=>{const{entity:r}=m(),{playlistId:e}=u(R),o=p(k),{data:c}=P(r),i=c?.find(a=>a.id===e)?.trackIds[0];return i?t(f,{to:o({playlistId:e,trackId:i}),replace:!0}):null},F=()=>{const{entity:r}=m(),{playlistId:e,trackId:o}=u(k),{data:c}=T(r,o),i=p(C),a=c?.levels[0]?.checks[0]?.id;return a?t(f,{to:i({playlistId:e,trackId:o,checkId:a}),replace:!0}):null},x=()=>{const{entity:r}=m(),{trackId:e}=u(y),o=p(g),{data:c}=T(r,e),i=c?.levels?.find(a=>a.checks.length>0)?.checks[0].id;return i?t(f,{to:o({trackId:e,checkId:i}),replace:!0}):null},N=()=>t(j,{children:s(L,{children:[t(l,{path:C.path,element:t(n,{})}),t(l,{path:k.path,element:s(d,{children:[t(n,{}),t(F,{})]})}),t(l,{path:R.path,element:s(d,{children:[t(n,{}),t(v,{})]})}),t(l,{path:y.path,element:s(d,{children:[t(n,{}),t(x,{})]})}),t(l,{path:g.path,element:t(n,{})}),t(l,{path:"/",element:s(d,{children:[t(n,{}),t(D,{})]})})]})});export{x as RedirectToFirstCheck,v as RedirectToFirstPlaylistTrack,F as RedirectToFirstPlaylistTrackCheck,N as Router};
1
+ import{jsx as t,jsxs as s,Fragment as d}from"react/jsx-runtime";import{useRouteRef as p,useRouteRefParams as h}from"@backstage/core-plugin-api";import{useEntity as m}from"@backstage/plugin-catalog-react";import{SecretsContextProvider as L}from"@backstage/plugin-scaffolder-react";import{Routes as N,Route as l,Navigate as f}from"react-router-dom";import{ResultState as T}from"../graphql/generated/index.esm.js";import{useAllCertifications as S}from"../hooks/certifications/useAllCertifications.esm.js";import"@tanstack/react-query";import"../api.esm.js";import"../hooks/graphqlKeys.esm.js";import{useCertificationDetailsForTrack as P}from"../hooks/certifications/useCertificationDetailsForTrack.esm.js";import"@backstage/catalog-model";import"@spotify/backstage-plugin-soundcheck-common";import"react";import"../hooks/useSoundcheckAlert.esm.js";import"../hooks/useConfirmationModal.esm.js";import{usePlaylists as C}from"../hooks/playlists/usePlaylists.esm.js";import{certificationPlaylistTrackCheckRouteRef as x,certificationPlaylistTrackRouteRef as k,certificationPlaylistRouteRef as R,certificationTrackRouteRef as y,certificationRouteRef as g}from"../routes.esm.js";import{EntityContent as n}from"./EntityContent/EntityContent.esm.js";const b=()=>{const{entity:i}=m(),e=p(R),a=p(y),{isLoading:r,data:o}=C(i),{isLoading:c,data:A}=S(i);if(r||c)return null;const u=o?.[0]?.id,I=A?.[0]?.track.id;return!u&&!I?null:t(f,{to:u?e({playlistId:u}):a({trackId:I}),replace:!0})},v=()=>{const{entity:i}=m(),{playlistId:e}=h(R),a=p(k),{data:r}=C(i),o=r?.find(c=>c.id===e)?.trackIds[0];return o?t(f,{to:a({playlistId:e,trackId:o}),replace:!0}):null},F=i=>(i?.levels?.flatMap(e=>e.checks??[])??[]).filter(e=>e.result!==T.Exempt&&e.result!==T.NotApplicable)[0],E=()=>{const{entity:i}=m(),{playlistId:e,trackId:a}=h(k),{data:r}=P(i,a),o=p(x),c=F(r)?.id??r?.levels[0]?.checks[0]?.id;return c?t(f,{to:o({playlistId:e,trackId:a,checkId:c}),replace:!0}):null},j=()=>{const{entity:i}=m(),{trackId:e}=h(y),a=p(g),{data:r}=P(i,e),o=F(r)?.id??r?.levels?.find(c=>c.checks.length>0)?.checks[0].id;return o?t(f,{to:a({trackId:e,checkId:o}),replace:!0}):null},D=()=>t(L,{children:s(N,{children:[t(l,{path:x.path,element:t(n,{})}),t(l,{path:k.path,element:s(d,{children:[t(n,{}),t(E,{})]})}),t(l,{path:R.path,element:s(d,{children:[t(n,{}),t(v,{})]})}),t(l,{path:y.path,element:s(d,{children:[t(n,{}),t(j,{})]})}),t(l,{path:g.path,element:t(n,{})}),t(l,{path:"/",element:s(d,{children:[t(n,{}),t(b,{})]})})]})});export{j as RedirectToFirstCheck,v as RedirectToFirstPlaylistTrack,E as RedirectToFirstPlaylistTrackCheck,D as Router};
2
2
  //# sourceMappingURL=Router.esm.js.map
@@ -1,2 +1,2 @@
1
- import{jsx as e,jsxs as o,Fragment as d}from"react/jsx-runtime";import{Page as B,TabbedLayout as r}from"@backstage/core-components";import{useApi as p,featureFlagsApiRef as O,configApiRef as j}from"@backstage/core-plugin-api";import{usePermission as l}from"@backstage/plugin-permission-react";import{makeStyles as G,Box as s}from"@material-ui/core";import{SpotifyLicenseBanner as Q}from"@spotify/backstage-plugin-core";import{soundcheckCampaignCreatePermission as $,soundcheckCollectorReadPermission as q,soundcheckCheckCreatePermission as M,soundcheckTrackCreatePermission as U}from"@spotify/backstage-plugin-soundcheck-common";import{Routes as V,Route as t}from"react-router-dom";import"../../contexts/TrackFormContext.esm.js";import"../../contexts/CheckFormContext.esm.js";import"../../contexts/CampaignFormContext.esm.js";import"react";import{UserProvider as W}from"../../contexts/UserProvider.esm.js";import z from"../../hooks/useConfirmationModal.esm.js";import{AlertProvider as J}from"../../hooks/useSoundcheckAlert.esm.js";import{CampaignInsightsPage as K}from"../CampaignInsightsPage/CampaignInsightsPage.esm.js";import{CampaignsPage as X}from"../CampaignsPage/CampaignsPage.esm.js";import{CampaignCreatePage as Y}from"../CampaignCreatePage/CampaignCreatePage.esm.js";import{EditCampaignView as Z}from"../CampaignsPage/EditCampaignView.esm.js";import{CheckCreatePage as _}from"../CheckCreatePage/CheckCreatePage.esm.js";import{CheckEditPage as ee}from"../CheckPage/CheckEditPage.esm.js";import{CheckInsightsPage as g}from"../CheckPage/CheckInsightsPage.esm.js";import{ChecksTab as te}from"../ChecksTab/ChecksTab.esm.js";import{CheckTemplatesPage as ie}from"../CheckTemplatesPage/CheckTemplatesPage.esm.js";import{CollectorPage as ae}from"../CollectorPage/CollectorPage.esm.js";import{CollectorsPage as re}from"../CollectorsPage/CollectorsPage.esm.js";import oe from"../OrgHealth/OrgHealthPage.esm.js";import{OverviewPageContent as ce}from"../OverviewPage/OverviewPageContent.esm.js";import{QuickstartPage as ne}from"../QuickstartPage/QuickstartPage.esm.js";import{SoundcheckHeader as le}from"../SoundcheckHeader/SoundcheckHeader.esm.js";import{SoundcheckHeaderProvider as se}from"../SoundcheckHeader/SoundcheckHeaderContext.esm.js";import{SoundcheckQueryClientProvider as me}from"../SoundcheckQueryClientProvider/SoundcheckQueryClientProvider.esm.js";import{TechHealth as he}from"../TechHealth/TechHealth.esm.js";import{TrackCreatePage as de}from"../TrackCreatePage/TrackCreatePage.esm.js";import{TrackEditPage as pe}from"../TrackEditPage/TrackEditPage.esm.js";import{TrackPage as ge}from"../TrackPage/TrackPage.esm.js";import{TracksTab as ke}from"../TracksTab/TracksTab.esm.js";const fe=G(c=>({tabContent:{margin:0,padding:0},root:{"& > *":{display:"flex",flexDirection:"column",flexGrow:1}},pageContent:{display:"flex",flexDirection:"row",flexGrow:1},pageLayout:{display:"flex",flexDirection:"column",flex:"1 1 0%",maxWidth:"100%","& > article":{display:"flex",flexDirection:"column",flex:"1 1 auto",padding:`${c.spacing(3)}px !important`}}})),ue=({title:c="Soundcheck"})=>{const n=fe(),i=p(O),m=p(j).getOptionalStringArray("soundcheck.flags"),k=(()=>{const a=i.getRegisteredFlags().some(N=>N.name==="soundcheck-enable-org-health"),D=i.isActive("soundcheck-enable-org-health"),E=m?.includes("enable-org-health");return(!a||D)&&E})(),f=(!i.getRegisteredFlags().find(a=>a.name==="soundcheck-enable-tech-health")||i.isActive("soundcheck-enable-tech-health"))&&!m?.includes("soundcheck-disable-tech-health"),u=!i.getRegisteredFlags().find(a=>a.name==="soundcheck-enable-collectors")||i.isActive("soundcheck-enable-collectors"),h=!i.getRegisteredFlags().find(a=>a.name==="soundcheck-enable-campaigns")||i.isActive("soundcheck-enable-campaigns"),{loading:C,allowed:b}=l({permission:$}),P=!C&&b,{loading:v,allowed:x}=l({permission:q}),{loading:R,allowed:w}=l({permission:M}),T=!i.getRegisteredFlags().find(a=>a.name==="soundcheck-enable-check-creation")||i.isActive("soundcheck-enable-check-creation"),I=!R&&w&&T,{loading:y,allowed:A}=l({permission:U}),S=!i.getRegisteredFlags().find(a=>a.name==="soundcheck-enable-track-creation")||i.isActive("soundcheck-enable-track-creation"),F=!y&&A&&S,L=u&&!v&&x,H=f;return e(J,{children:e(W,{children:e(me,{children:e(se,{defaultTitle:c,children:e(z,{children:e(s,{className:n.root,children:o(B,{themeId:"website",children:[e(Q,{backend:"soundcheck",invalidLicenseMessage:"Submitted facts and check results will still be stored, but it will not be possible to view certifications or individual results until a valid license is present."}),e(le,{documentTitle:c}),e(s,{className:n.pageContent,children:o(s,{className:n.pageLayout,children:[o(V,{children:[k&&e(t,{path:"/org-health",element:e(oe,{})}),h&&o(d,{children:[e(t,{path:"/campaigns/:campaignId/edit",element:e(Z,{})}),e(t,{path:"/campaigns/:campaignId",element:e(K,{})}),P&&e(t,{path:"/campaigns/create",element:e(Y,{})})]}),e(t,{path:"/quickstart",element:e(ne,{})}),e(t,{path:"/tracks/:trackId/edit",element:e(pe,{})}),F&&e(t,{path:"/tracks/create",element:e(de,{})}),e(t,{path:"/tracks/:trackId",element:e(ge,{})}),e(t,{path:"/tracks/:trackId/checks/:checkId",element:e(g,{})}),e(t,{path:"/checks/:checkId",element:e(g,{})}),e(t,{path:"/checks/:checkId/edit",element:e(ee,{})}),I&&o(d,{children:[e(t,{path:"/checks/create",element:e(_,{})}),e(t,{path:"/checks/templates",element:e(ie,{})})]}),e(t,{path:"/integrations/:integrationId",element:e(ae,{})}),e(t,{path:"/*",element:o(r,{children:[e(r.Route,{title:"Overview",path:"/",children:e("div",{className:n.tabContent,children:e(ce,{})})}),H&&e(r.Route,{title:"Tech Health",path:"/tech-health",children:e(he,{})}),e(r.Route,{title:"Checks",path:"/checks",children:e(te,{})}),e(r.Route,{title:"Tracks",path:"/tracks",children:e(ke,{})}),h&&e(r.Route,{title:"Campaigns",path:"/campaigns",children:e(X,{})}),L&&e(r.Route,{title:"Integrations",path:"/integrations",children:e(re,{})})]})})]})," "]})})]})})})})})})})};export{ue as RoutingPage};
1
+ import{jsx as e,jsxs as c,Fragment as g}from"react/jsx-runtime";import{Page as Q,TabbedLayout as a}from"@backstage/core-components";import{useApi as k,featureFlagsApiRef as W,configApiRef as q}from"@backstage/core-plugin-api";import{usePermission as l}from"@backstage/plugin-permission-react";import{makeStyles as M,Box as h}from"@material-ui/core";import{SpotifyLicenseBanner as U}from"@spotify/backstage-plugin-core";import{soundcheckCampaignCreatePermission as V,soundcheckCollectorReadPermission as $,soundcheckCheckCreatePermission as z,soundcheckTrackCreatePermission as J}from"@spotify/backstage-plugin-soundcheck-common";import{Routes as K,Route as t}from"react-router-dom";import"../../contexts/TrackFormContext.esm.js";import"../../contexts/CheckFormContext.esm.js";import"../../contexts/CampaignFormContext.esm.js";import"react";import{UserProvider as X}from"../../contexts/UserProvider.esm.js";import Y from"../../hooks/useConfirmationModal.esm.js";import{AlertProvider as Z}from"../../hooks/useSoundcheckAlert.esm.js";import{CampaignInsightsPage as _}from"../CampaignInsightsPage/CampaignInsightsPage.esm.js";import{CampaignsPage as ee}from"../CampaignsPage/CampaignsPage.esm.js";import{CampaignCreatePage as te}from"../CampaignCreatePage/CampaignCreatePage.esm.js";import{EditCampaignView as ie}from"../CampaignsPage/EditCampaignView.esm.js";import{CheckCreatePage as re}from"../CheckCreatePage/CheckCreatePage.esm.js";import{CheckEditPage as ae}from"../CheckPage/CheckEditPage.esm.js";import{CheckInsightsPage as u}from"../CheckPage/CheckInsightsPage.esm.js";import{ChecksTab as oe}from"../ChecksTab/ChecksTab.esm.js";import{CheckTemplatesPage as ne}from"../CheckTemplatesPage/CheckTemplatesPage.esm.js";import{CollectorPage as ce}from"../CollectorPage/CollectorPage.esm.js";import{CollectorsPage as se}from"../CollectorsPage/CollectorsPage.esm.js";import{OrgInsightsPage as le}from"../OrgInsights/OrgInsightsPage.esm.js";import{OverviewPageContent as me}from"../OverviewPage/OverviewPageContent.esm.js";import{QuickstartPage as he}from"../QuickstartPage/QuickstartPage.esm.js";import{SoundcheckHeader as de}from"../SoundcheckHeader/SoundcheckHeader.esm.js";import{SoundcheckHeaderProvider as pe}from"../SoundcheckHeader/SoundcheckHeaderContext.esm.js";import{SoundcheckQueryClientProvider as ge}from"../SoundcheckQueryClientProvider/SoundcheckQueryClientProvider.esm.js";import{TechHealth as ke}from"../TechHealth/TechHealth.esm.js";import{TrackCreatePage as ue}from"../TrackCreatePage/TrackCreatePage.esm.js";import{TrackEditPage as fe}from"../TrackEditPage/TrackEditPage.esm.js";import{TrackPage as Ce}from"../TrackPage/TrackPage.esm.js";import{TracksTab as be}from"../TracksTab/TracksTab.esm.js";const f=M(o=>({tabContent:{margin:0,padding:0},root:{"& > *":{display:"flex",flexDirection:"column",flexGrow:1}},pageContent:{display:"flex",flexDirection:"row",flexGrow:1},pageLayout:{display:"flex",flexDirection:"column",flex:"1 1 0%",maxWidth:"100%","& > article":{display:"flex",flexDirection:"column",flex:"1 1 auto",padding:`${o.spacing(3)}px !important`}}})),C=({title:o="Soundcheck",children:m})=>{const s=f();return e(Z,{children:e(X,{children:e(ge,{children:e(pe,{defaultTitle:o,children:e(Y,{children:e(h,{className:s.root,children:c(Q,{themeId:"website",children:[e(U,{backend:"soundcheck",invalidLicenseMessage:"Submitted facts and check results will still be stored, but it will not be possible to view certifications or individual results until a valid license is present."}),e(de,{documentTitle:o}),e(h,{className:s.pageContent,children:e(h,{className:s.pageLayout,children:m})})]})})})})})})})},Pe=({title:o="Soundcheck",integrations:m})=>{const s=f(),r=k(W),d=k(q).getOptionalStringArray("soundcheck.flags"),n=r.getRegisteredFlags(),b=(()=>{const i=n.some(G=>G.name==="soundcheck-enable-org-insights"),B=r.isActive("soundcheck-enable-org-insights"),j=d?.includes("enable-org-insights");return(!i||B)&&j})(),P=(!n.find(i=>i.name==="soundcheck-enable-tech-health")||r.isActive("soundcheck-enable-tech-health"))&&!d?.includes("soundcheck-disable-tech-health"),v=!n.find(i=>i.name==="soundcheck-enable-collectors")||r.isActive("soundcheck-enable-collectors"),p=!n.find(i=>i.name==="soundcheck-enable-campaigns")||r.isActive("soundcheck-enable-campaigns"),{loading:x,allowed:w}=l({permission:V}),I=!x&&w,{loading:R,allowed:T}=l({permission:$}),{loading:y,allowed:A}=l({permission:z}),S=!n.find(i=>i.name==="soundcheck-enable-check-creation")||r.isActive("soundcheck-enable-check-creation"),L=!y&&A&&S,{loading:D,allowed:H}=l({permission:J}),N=!n.find(i=>i.name==="soundcheck-enable-track-creation")||r.isActive("soundcheck-enable-track-creation"),O=!D&&H&&N,E=v&&!R&&T,F=P;return c(C,{title:o,children:[c(K,{children:[b&&e(t,{path:"/org-insights",element:e(le,{})}),p&&c(g,{children:[e(t,{path:"/campaigns/:campaignId/edit",element:e(ie,{})}),e(t,{path:"/campaigns/:campaignId",element:e(_,{})}),I&&e(t,{path:"/campaigns/create",element:e(te,{})})]}),e(t,{path:"/quickstart",element:e(he,{})}),e(t,{path:"/tracks/:trackId/edit",element:e(fe,{})}),O&&e(t,{path:"/tracks/create",element:e(ue,{})}),e(t,{path:"/tracks/:trackId",element:e(Ce,{})}),e(t,{path:"/tracks/:trackId/checks/:checkId",element:e(u,{})}),e(t,{path:"/checks/:checkId",element:e(u,{})}),e(t,{path:"/checks/:checkId/edit",element:e(ae,{})}),L&&c(g,{children:[e(t,{path:"/checks/create",element:e(re,{})}),e(t,{path:"/checks/templates",element:e(ne,{})})]}),e(t,{path:"/integrations/:integrationId",element:e(ce,{})}),e(t,{path:"/*",element:c(a,{children:[e(a.Route,{title:"Overview",path:"/",children:e("div",{className:s.tabContent,children:e(me,{})})}),F&&e(a.Route,{title:"Tech Health",path:"/tech-health",children:e(ke,{})}),e(a.Route,{title:"Checks",path:"/checks",children:e(oe,{})}),e(a.Route,{title:"Tracks",path:"/tracks",children:e(be,{})}),p&&e(a.Route,{title:"Campaigns",path:"/campaigns",children:e(ee,{})}),E&&e(a.Route,{title:"Integrations",path:"/integrations",children:e(se,{integrations:m})})]})})]})," "]})};export{Pe as RoutingPage,C as RoutingPageWrapper};
2
2
  //# sourceMappingURL=RoutingPage.esm.js.map
@@ -1,2 +1,2 @@
1
- import{RoutingPage as g}from"./RoutingPage.esm.js";export{g as RoutingPage};
1
+ import{RoutingPage as o,RoutingPageWrapper as r}from"./RoutingPage.esm.js";export{o as RoutingPage,r as RoutingPageWrapper};
2
2
  //# sourceMappingURL=index.esm.js.map
@@ -1,2 +1,2 @@
1
- import{jsxs as o,jsx as i,Fragment as k}from"react/jsx-runtime";import{Header as N}from"@backstage/core-components";import{useRouteRef as l}from"@backstage/core-plugin-api";import{makeStyles as S,Link as v,Typography as p,Button as R}from"@material-ui/core";import y from"@material-ui/icons/InfoOutlined";import x from"@material-ui/icons/MenuBook";import{useContext as C}from"react";import{useLocation as T,useNavigate as L}from"react-router-dom";import{rootRouteRef as z,quickstartRouteRef as B}from"../../routes.esm.js";import{Breadcrumbs as H}from"./Breadcrumbs.esm.js";import{generateBreadcrumbs as w}from"./headerUtil.esm.js";import{SoundcheckHeaderContext as I}from"./SoundcheckHeaderContext.esm.js";const j=S(e=>({subtitle:{maxWidth:"75%",marginTop:e.spacing(.5),whiteSpace:"pre-line"},docLink:{display:"flex",alignItems:"center",marginTop:e.spacing(.5),marginBottom:e.spacing(0),width:"fit-content",fontSize:e.typography.body2.fontSize,color:"inherit"},descriptionIcon:{marginRight:e.spacing(.25)},headerContent:{color:e.page.fontColor},link:{},button:{textTransform:"none",marginRight:e.spacing(2),color:e.page.fontColor},icon:{paddingRight:e.spacing(1)},title:{},breadcrumbs:{}}),{name:"SoundcheckHeader"}),q=({documentTitle:e})=>{const{title:n,description:r,docLink:a,customSubtitle:c,sectionRight:s}=C(I),t=j(),m=T().pathname?.replace(/\/+$/,"")??"",h=w(m),g=l(z),d=m===g(),u=l(B),f=L(),b=u();return o(N,{pageTitleOverride:e,title:i(k,{children:d?i("div",{className:t.title,children:n}):o("div",{className:t.title,children:[i(H,{className:t.breadcrumbs,pages:h}),n]})}),subtitle:o("div",{className:t.headerContent,children:[a&&o(v,{target:"_blank",href:a,className:t.docLink,children:[i(y,{className:t.descriptionIcon,fontSize:"inherit"}),"Documentation"]}),!!c&&i("div",{children:c}),typeof r=="string"?i(p,{className:t.subtitle,variant:"body2",color:"inherit",children:r}):i("div",{children:r})]}),children:[d&&o(R,{className:t.button,onClick:()=>f(b),color:"inherit",variant:"outlined",children:[i(x,{className:t.icon}),i(p,{children:"Get Started with Soundcheck"})]}),!!s&&i("div",{children:s})]})};export{q as SoundcheckHeader};
1
+ import{jsxs as o,jsx as i,Fragment as k}from"react/jsx-runtime";import{Header as N}from"@backstage/core-components";import{useRouteRef as l}from"@backstage/core-plugin-api";import{makeStyles as R,Link as S,Typography as p,Button as v}from"@material-ui/core";import y from"@material-ui/icons/InfoOutlined";import x from"@material-ui/icons/MenuBook";import{useContext as C}from"react";import{useLocation as T,useNavigate as L}from"react-router-dom";import{rootRouteRef as z,quickstartRouteRef as B}from"../../routes.esm.js";import{Breadcrumbs as H}from"./Breadcrumbs.esm.js";import{generateBreadcrumbs as w}from"./headerUtil.esm.js";import{SoundcheckHeaderContext as I}from"./SoundcheckHeaderContext.esm.js";const j=R(e=>({subtitle:{maxWidth:"75%",marginTop:e.spacing(.5),whiteSpace:"pre-line"},docLink:{display:"flex",alignItems:"center",marginTop:e.spacing(.5),marginBottom:e.spacing(0),width:"fit-content",fontSize:e.typography.body2.fontSize,color:"inherit"},descriptionIcon:{marginRight:e.spacing(.25)},headerContent:{color:e.page.fontColor},link:{},button:{textTransform:"none",marginRight:e.spacing(2),color:e.page.fontColor},icon:{paddingRight:e.spacing(1)},title:{},breadcrumbs:{}}),{name:"SoundcheckHeader"}),q=({documentTitle:e})=>{const{title:n,description:r,docLink:a,customSubtitle:c,sectionRight:s}=C(I),t=j(),m=T().pathname?.replace(/\/+$/,"")??"",h=w(m),g=l(z),d=m===g(),u=l(B),f=L(),b=u();return o(N,{pageTitleOverride:e,title:i(k,{children:d?i("div",{className:t.title,children:n}):o("div",{className:t.title,children:[i(H,{className:t.breadcrumbs,pages:h}),n]})}),subtitle:o("div",{className:t.headerContent,children:[a&&o(S,{target:"_blank",href:a,className:t.docLink,children:[i(y,{className:t.descriptionIcon,fontSize:"inherit"}),"Documentation"]}),!!c&&i("div",{children:c}),typeof r=="string"?i(p,{className:t.subtitle,variant:"body2",color:"inherit",children:r}):i("div",{children:r})]}),children:[d&&o(v,{className:t.button,onClick:()=>f(b),color:"inherit",variant:"outlined",children:[i(x,{className:t.icon}),i(p,{children:"Get Started with Soundcheck"})]}),!!s&&i("div",{children:s})]})};export{q as SoundcheckHeader};
2
2
  //# sourceMappingURL=SoundcheckHeader.esm.js.map
@@ -1,2 +1,2 @@
1
- import{jsxs as d,jsx as t,Fragment as g}from"react/jsx-runtime";import{withStyles as u,Card as w,makeStyles as C,CardHeader as k,CardContent as v,Divider as f,CardActions as S,Button as N}from"@material-ui/core";import{createStyles as A}from"@material-ui/core/styles";import{SoundcheckMarkdownContent as B}from"../SoundcheckMarkdownContent/SoundcheckMarkdownContent.esm.js";import"@backstage/core-components";import"react";import"react-markdown";import"rehype-raw";import"remark-gfm";import{SummaryCardActionsMenu as D}from"./SummaryCardActionsMenu.esm.js";const c=u(e=>A({root:{width:"100%",height:"100%",minHeight:"385px",display:"flex",flexDirection:"column",padding:e.spacing(2),position:"relative",justifyContent:"start"}}))(w),h=C(e=>({root:{position:"relative",height:"100%"},summaryName:{fontSize:e.typography.pxToRem(24),color:e.palette.text.primary,maxHeight:"250px",overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:5,WebkitBoxOrient:"vertical","-webkit-line-clamp":5,"-webkit-box-orient":"vertical",wordBreak:"break-word"},summaryDescription:{color:e.palette.text.primary,padding:0,maxHeight:"175px",overflow:"auto",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:5,WebkitBoxOrient:"vertical",wordBreak:"break-word"},card:{paddingTop:e.spacing(1),paddingBottom:0,paddingLeft:e.spacing(1),paddingRight:e.spacing(1),borderColor:e.palette.divider},cardContent:{height:"100%",paddingTop:0},actionArea:{padding:e.spacing(1.5,2,1.5,4)},button:{minWidth:0,color:e.palette.text.primary,"&:disabled":{color:e.palette.text.disabled,opacity:1}}})),E=({title:e,description:x,viewLabel:n="View",editLabel:l="Edit",children:y,handleDelete:p,handleArchive:m,handleEdit:i,handleView:r,handleExport:s,viewIsPrimaryAction:b})=>{const a=h(),o=!b&&!!i;return d(c,{className:a.card,"data-testid":e,children:[t(k,{title:e,titleTypographyProps:{className:a.summaryName},action:(!!p||!!m||!!i||!!s)&&t(D,{handleView:r,handleDelete:p,handleArchive:m,handleEdit:i,handleExport:s})}),t(v,{className:a.cardContent,children:d(g,{children:[t(B,{className:a.summaryDescription,content:x??""}),y]})}),(r||i)&&d("div",{children:[t(f,{}),t(S,{className:a.actionArea,children:t(N,{"aria-label":o?l:n,"data-testid":`${e}-button`,size:"medium",role:"link",onClick:o?i:r,disabled:!r&&!i,className:a.button,variant:"outlined",children:o?l:n})})]})]})};export{c as Card,E as SummaryCard,h as useSummaryCardStyles};
1
+ import{jsxs as d,jsx as i,Fragment as b}from"react/jsx-runtime";import{withStyles as u,Card as w,makeStyles as v,CardHeader as C,CardContent as k,Divider as f,CardActions as S,Button as N}from"@material-ui/core";import{createStyles as A}from"@material-ui/core/styles";import{SoundcheckMarkdownContent as B}from"../SoundcheckMarkdownContent/SoundcheckMarkdownContent.esm.js";import"@backstage/core-components";import"react";import"react-markdown";import"rehype-raw";import"remark-gfm";import{SummaryCardActionsMenu as D}from"./SummaryCardActionsMenu.esm.js";const c=u(e=>A({root:{width:"100%",height:"100%",minHeight:"385px",display:"flex",flexDirection:"column",padding:e.spacing(2),position:"relative",justifyContent:"start"}}))(w),h=v(e=>({root:{position:"relative",height:"100%"},summaryName:{fontSize:e.typography.pxToRem(24),color:e.palette.text.primary,maxHeight:"250px",overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitBoxOrient:"vertical","-webkit-box-orient":"vertical",wordBreak:"break-word"},summaryDescription:{color:e.palette.text.primary,padding:0,maxHeight:"175px",overflow:"auto",textOverflow:"ellipsis",display:"-webkit-box",WebkitBoxOrient:"vertical","-webkit-box-orient":"vertical",wordBreak:"break-word"},card:{paddingTop:e.spacing(1),paddingBottom:0,paddingLeft:e.spacing(1),paddingRight:e.spacing(1),borderColor:e.palette.divider},cardContent:{height:"100%",paddingTop:0},actionArea:{padding:e.spacing(1.5,2,1.5,4)},button:{minWidth:0,color:e.palette.text.primary,"&:disabled":{color:e.palette.text.disabled,opacity:1}}})),E=({title:e,description:x,viewLabel:n="View",editLabel:l="Edit",children:y,handleDelete:p,handleArchive:s,handleEdit:t,handleView:a,handleExport:m,viewIsPrimaryAction:g})=>{const r=h(),o=!g&&!!t;return d(c,{className:r.card,"data-testid":e,children:[i(C,{title:e,titleTypographyProps:{className:r.summaryName},action:(!!p||!!s||!!t||!!m)&&i(D,{handleView:a,handleDelete:p,handleArchive:s,handleEdit:t,handleExport:m})}),i(k,{className:r.cardContent,children:d(b,{children:[i(B,{className:r.summaryDescription,content:x??""}),y]})}),(a||t)&&d("div",{children:[i(f,{}),i(S,{className:r.actionArea,children:i(N,{"aria-label":o?l:n,"data-testid":`${e}-button`,size:"medium",role:"link",onClick:o?t:a,disabled:!a&&!t,className:r.button,variant:"outlined",children:o?l:n})})]})]})};export{c as Card,E as SummaryCard,h as useSummaryCardStyles};
2
2
  //# sourceMappingURL=SummaryCard.esm.js.map
@@ -1,2 +1,2 @@
1
- import{jsxs as a,jsx as o}from"react/jsx-runtime";import{makeStyles as z,alpha as L,Box as c,Typography as N,Tooltip as T,Icon as O,IconButton as j,Chip as D,TextField as E,FormControlLabel as V,Checkbox as $}from"@material-ui/core";import B from"@material-ui/icons/ArrowDropDown";import K from"@material-ui/icons/ArrowDropUp";import A from"@material-ui/icons/CheckBox";import H from"@material-ui/icons/CheckBoxOutlineBlank";import W from"@material-ui/icons/HelpOutline";import{Autocomplete as q}from"@material-ui/lab";import{remove as J}from"lodash";import{useState as d,useEffect as M,useCallback as C,useMemo as P}from"react";import G from"../../Expand/Expand.esm.js";import{ListboxVirtualized as Q}from"../../ListboxVirtualized/ListboxVirtualized.esm.js";import{useFilterContext as R}from"./FilterProvider.esm.js";import{Facet as v,facetTooltips as k}from"./types.esm.js";const U=z(({palette:t,spacing:l})=>({header:{display:"flex",alignItems:"left",flexDirection:"row",cursor:"pointer",justifyContent:"space-between"},label:{display:"flex",alignItems:"center"},tooltipIcon:{display:"flex",alignItems:"center",justifyContent:"center",color:t.text.primary},chip:{maxWidth:"45%",textOverflow:"ellipsis",margin:l(.5,.5,.5,0),overflow:"hidden","& svg":{color:L(t.common.white,.7),"&:hover":{color:t.common.white}},backgroundColor:t.action.disabledBackground},autoCompleteInput:{"&& input":{margin:l(1,0,0,0),padding:`${l(0,1,1,1)} !important`,width:"100%",display:"flex",alignItems:"center",justifyContent:"center"},"&& button":{"&:hover":{backgroundColor:"transparent"}}},autoComplete:{margin:l(.5,0,1,0)},selectionLabel:{lineHeight:"1em"}})),X=({facet:t})=>{const l=U(),{getFacetOptions:I,getFacetOptionLabel:s,getSelectedFacetValues:n,setSelectedFacetValues:u}=R(),[f,h]=d(!1),[S,b]=d(!1),[F,g]=d("");M(()=>{h(!!n(t)?.length)},[n,t]);const x=()=>{h(e=>!e)},y=e=>{(e.key==="Enter"||e.key===" ")&&x()},m=C(e=>{if(t===v.Entity&&e[e.length-1]){const i=e[e.length-1];if(!i.includes(":")||!i.includes("/")){b(!0),g("Custom entities require a valid kind and namespace such as: component:default/entity");return}}b(!1),g(""),u(t,e)},[t,u]),r=P(()=>n(t),[t,n]),w=C(e=>{const i=[...r];J(i,p=>p===e),m(i)},[r,m]);return a(c,{children:[a("div",{className:l.header,onClick:x,onKeyDown:y,role:"button",tabIndex:0,children:[a("div",{className:l.label,children:[o(c,{children:o(N,{variant:"subtitle2",children:t})}),k[t]&&o(T,{title:k[t],className:l.tooltipIcon,children:o(O,{children:o(W,{style:{fontSize:16,verticalAlign:"text-top"}})})})]}),o(c,{children:o(j,{size:"small",onKeyDown:y,children:f?o(K,{fontSize:"small"}):o(B,{fontSize:"small"})})})]}),a(G,{visible:f,children:[o(c,{children:r.map(e=>o(D,{label:s(t,e),size:"small",className:l.chip,onDelete:()=>w(e),clickable:!1},e))}),o(q,{className:l.autoComplete,disableCloseOnSelect:!0,fullWidth:!0,multiple:!0,freeSolo:t===v.Entity,popupIcon:null,renderTags:()=>null,options:I(t),getOptionLabel:e=>s(t,e),value:r,onChange:(e,i)=>m(i),ListboxComponent:Q,ListboxProps:{itemHeight:50},renderInput:e=>o(E,{...e,className:l.autoCompleteInput,placeholder:`Search for ${t}`,error:S,helperText:F}),renderOption:(e,{selected:i})=>o(V,{onClick:p=>p.preventDefault(),control:o($,{icon:o(H,{fontSize:"small"}),checkedIcon:o(A,{fontSize:"small"}),checked:i}),classes:{label:l.selectionLabel},label:s(t,e)})})]})]})};export{X as FacetFilter};
1
+ import{jsxs as a,jsx as o}from"react/jsx-runtime";import{makeStyles as z,alpha as L,Box as c,Typography as T,Tooltip as j,Icon as N,IconButton as O,Chip as D,TextField as E,FormControlLabel as V,Checkbox as B}from"@material-ui/core";import K from"@material-ui/icons/ArrowDropDown";import $ from"@material-ui/icons/ArrowDropUp";import A from"@material-ui/icons/CheckBox";import H from"@material-ui/icons/CheckBoxOutlineBlank";import W from"@material-ui/icons/HelpOutline";import{Autocomplete as q}from"@material-ui/lab";import{remove as J}from"lodash";import{useState as d,useEffect as M,useCallback as C,useMemo as P}from"react";import G from"../../Expand/Expand.esm.js";import{ListboxVirtualized as Q}from"../../ListboxVirtualized/ListboxVirtualized.esm.js";import{useFilterContext as R}from"./FilterProvider.esm.js";import{Facet as v,facetTooltips as k}from"./types.esm.js";const U=z(({palette:t,spacing:l})=>({header:{display:"flex",alignItems:"left",flexDirection:"row",cursor:"pointer",justifyContent:"space-between"},label:{display:"flex",alignItems:"center"},tooltipIcon:{display:"flex",alignItems:"center",justifyContent:"center",color:t.text.primary},chip:{maxWidth:"45%",textOverflow:"ellipsis",margin:l(.5,.5,.5,0),overflow:"hidden","& svg":{color:L(t.common.white,.7),"&:hover":{color:t.common.white}},backgroundColor:t.action.disabledBackground},autoCompleteInput:{"&& input":{margin:l(1,0,0,0),padding:`${l(0,1,1,1)} !important`,width:"100%",display:"flex",alignItems:"center",justifyContent:"center"},"&& button":{"&:hover":{backgroundColor:"transparent"}}},autoComplete:{margin:l(.5,0,1,0)},selectionLabel:{lineHeight:"1em"}})),X=({facet:t})=>{const l=U(),{getFacetOptions:I,getFacetOptionLabel:s,getSelectedFacetValues:n,setSelectedFacetValues:u}=R(),[f,h]=d(!1),[S,b]=d(!1),[F,g]=d("");M(()=>{h(!!n(t)?.length)},[n,t]);const x=()=>{h(e=>!e)},y=e=>{(e.key==="Enter"||e.key===" ")&&x()},m=C(e=>{if(t===v.Entity&&e[e.length-1]){const i=e[e.length-1];if(!i.includes(":")||!i.includes("/")){b(!0),g("Custom entities require a valid kind and namespace such as: component:default/entity");return}}b(!1),g(""),u(t,e)},[t,u]),r=P(()=>n(t),[t,n]),w=C(e=>{const i=[...r];J(i,p=>p===e),m(i)},[r,m]);return a(c,{children:[a("div",{className:l.header,onClick:x,onKeyDown:y,role:"button",tabIndex:0,children:[a("div",{className:l.label,children:[o(c,{children:o(T,{variant:"subtitle2",children:t})}),k[t]&&o(j,{title:k[t],className:l.tooltipIcon,children:o(N,{children:o(W,{style:{fontSize:16,verticalAlign:"text-top"}})})})]}),o(c,{children:o(O,{size:"small",onKeyDown:y,children:f?o($,{fontSize:"small"}):o(K,{fontSize:"small"})})})]}),a(G,{visible:f,children:[o(c,{children:r.map(e=>o(D,{label:s(t,e),size:"small",className:l.chip,onDelete:()=>w(e),clickable:!1},e))}),o(q,{className:l.autoComplete,disableCloseOnSelect:!0,fullWidth:!0,multiple:!0,freeSolo:t===v.Entity,popupIcon:null,renderTags:()=>null,options:I(t),getOptionLabel:e=>s(t,e),value:r,onChange:(e,i)=>m(i),ListboxComponent:Q,ListboxProps:{itemHeight:50},renderInput:e=>o(E,{...e,className:l.autoCompleteInput,placeholder:`Search for ${t}`,error:S,helperText:F}),renderOption:(e,{selected:i})=>o(V,{onClick:p=>p.preventDefault(),control:o(B,{icon:o(H,{fontSize:"small"}),checkedIcon:o(A,{fontSize:"small"}),checked:i}),classes:{label:l.selectionLabel},label:s(t,e)})})]})]})};export{X as FacetFilter};
2
2
  //# sourceMappingURL=FacetFilter.esm.js.map
@@ -1,2 +1,2 @@
1
- import{jsxs as n,jsx as e}from"react/jsx-runtime";import{useRouteRef as N}from"@backstage/core-plugin-api";import{useTheme as x,TableContainer as T,Table as v,TableHead as w,TableRow as o,TableCell as t,TableBody as y,Link as z,Typography as p,Box as A}from"@material-ui/core";import{makeStyles as S}from"@material-ui/core/styles";import{Skeleton as s}from"@material-ui/lab";import{useMemo as f}from"react";import{trackCheckDetailsRouteRef as R}from"../../routes.esm.js";import{getCheckStatusColor as $}from"../../utils/colors.esm.js";const F=S(r=>({root:{width:"100%",height:"100%",display:"flex",flexDirection:"column"},checkNameLink:{color:"inherit",textDecoration:"none"},bar:{height:8,display:"block"},barContainer:{width:"100%",display:"block"},cell:{padding:r.spacing(1),width:"auto"},barCell:{width:150,padding:"4px 8px"},rightAlignedCell:{textAlign:"right"}})),D=({track:r,checkStatuses:c,certificationStatus:d})=>{const l=F(),u=x(),g=N(R),h=f(()=>r.levels?.flatMap(i=>i.checks)??[],[r.levels]),m=f(()=>h.map(i=>{const a=c?.find(C=>C.id===i.id),b=a?a.numberOfEntities-a.notApplicable-a.exempt:0,k=a?.failed??0;return{check:i,failedCount:k,applicableCount:b}}).filter(({failedCount:i})=>i>0).sort((i,a)=>(a.failedCount??0)-(i.failedCount??0)),[h,c]);return r.levels?.length?n("div",{className:l.root,children:[e(T,{children:n(v,{padding:"none",children:[e(w,{children:n(o,{children:[e(t,{className:l.barCell}),e(t,{size:"medium",className:l.cell,children:"Name"}),e(t,{size:"small",className:l.cell,children:"Failing"})]})}),e(y,{children:c===void 0||d===void 0?Array.from({length:10}).map((i,a)=>n(o,{children:[e(t,{className:l.barCell,children:e(s,{variant:"rect",width:30,height:8})}),e(t,{size:"medium",className:l.cell,children:e(s,{variant:"rect",width:140,height:8})}),e(t,{size:"small",className:l.cell,children:e(s,{variant:"rect",width:100,height:8})})]},`skeleton-${a}`)):m.map(({check:i,failedCount:a})=>n(o,{children:[e(t,{className:l.barCell,children:e("div",{className:l.barContainer,children:e("span",{className:l.bar,style:{width:`${(a??0)/d.numberOfEntities*100}%`,backgroundColor:$(u,"failed")}})})}),e(t,{size:"medium",className:l.cell,children:e(z,{className:l.checkNameLink,href:g({trackId:r.id,checkId:i.id}),children:e(p,{children:i.name})})}),e(t,{size:"small",className:`${l.cell} ${l.rightAlignedCell}`,children:e(p,{children:`${new Intl.NumberFormat().format(a??0)}`})})]},i.id))})]})}),c&&d&&m.length===0&&e(A,{textAlign:"center",padding:4,children:"No Failing Checks"})]}):null};export{D as TopFailingChecksTable};
1
+ import{jsxs as r,jsx as e}from"react/jsx-runtime";import{Link as N}from"@backstage/core-components";import{useRouteRef as x}from"@backstage/core-plugin-api";import{useTheme as T,TableContainer as v,Table as w,TableHead as y,TableRow as o,TableCell as t,TableBody as $,Typography as p,Box as A}from"@material-ui/core";import{makeStyles as z}from"@material-ui/core/styles";import{Skeleton as s}from"@material-ui/lab";import{useMemo as g}from"react";import{trackCheckDetailsRouteRef as R}from"../../routes.esm.js";import{getCheckStatusColor as S}from"../../utils/colors.esm.js";const F=z(n=>({root:{width:"100%",height:"100%",display:"flex",flexDirection:"column"},checkNameLink:{color:"inherit",textDecoration:"none"},bar:{height:8,display:"block"},barContainer:{width:"100%",display:"block"},cell:{padding:n.spacing(1),width:"auto"},barCell:{width:150,padding:"4px 8px"},rightAlignedCell:{textAlign:"right",paddingRight:`${n.spacing(2)}px !important`}})),L=({track:n,checkStatuses:c,certificationStatus:d})=>{const l=F(),f=T(),u=x(R),h=g(()=>n.levels?.flatMap(i=>i.checks)??[],[n.levels]),m=g(()=>h.map(i=>{const a=c?.find(k=>k.id===i.id),C=a?a.numberOfEntities-a.notApplicable-a.exempt:0,b=a?.failed??0;return{check:i,failedCount:b,applicableCount:C}}).filter(({failedCount:i})=>i>0).sort((i,a)=>(a.failedCount??0)-(i.failedCount??0)),[h,c]);return n.levels?.length?r("div",{className:l.root,children:[e(v,{children:r(w,{padding:"none",children:[e(y,{children:r(o,{children:[e(t,{className:l.barCell}),e(t,{size:"medium",className:l.cell,children:"Name"}),e(t,{size:"small",className:`${l.cell} ${l.rightAlignedCell}`,children:"Failing"})]})}),e($,{children:c===void 0||d===void 0?Array.from({length:10}).map((i,a)=>r(o,{children:[e(t,{className:l.barCell,children:e(s,{variant:"rect",width:30,height:8})}),e(t,{size:"medium",className:l.cell,children:e(s,{variant:"rect",width:140,height:8})}),e(t,{size:"small",className:l.cell,children:e(s,{variant:"rect",width:100,height:8})})]},`skeleton-${a}`)):m.map(({check:i,failedCount:a})=>r(o,{children:[e(t,{className:l.barCell,children:e("div",{className:l.barContainer,children:e("span",{className:l.bar,style:{width:`${(a??0)/d.numberOfEntities*100}%`,backgroundColor:S(f,"failed")}})})}),e(t,{size:"medium",className:l.cell,children:e(N,{className:l.checkNameLink,to:u({trackId:n.id,checkId:i.id}),children:e(p,{children:i.name})})}),e(t,{size:"small",className:`${l.cell} ${l.rightAlignedCell}`,children:e(p,{children:`${new Intl.NumberFormat().format(a??0)}`})})]},i.id))})]})}),c&&d&&m.length===0&&e(A,{textAlign:"center",padding:4,children:"No Failing Checks"})]}):null};export{L as TopFailingChecksTable};
2
2
  //# sourceMappingURL=TopFailingChecksTable.esm.js.map
@@ -1,2 +1,2 @@
1
- import{jsx as r,Fragment as o}from"react/jsx-runtime";import{OverflowTooltip as m}from"@backstage/core-components";import{EntityRefLink as u,EntityRefLinks as s}from"@backstage/plugin-catalog-react";import{makeStyles as c,withStyles as p,Chip as d}from"@material-ui/core";import f from"@material-ui/icons/RemoveCircleOutline";import{LevelBadge as y}from"../../Badges/LevelBadge.esm.js";import{NoLevelBadge as g}from"../../Badges/NoLevelBadge.esm.js";import"../../Badges/CampaignBadge.esm.js";import{TrackStatusChip as h}from"./TrackStatusChip.esm.js";import{getApplicableCheckCount as S}from"./utils.esm.js";const l=c(()=>({linkHover:{"& span":{"&:hover":{textDecoration:"underline"}}}})),C=p(e=>({root:{color:e.palette.text.disabled}}))(f),b=Object.freeze({createBadgeColumn(){return{title:"",field:"badge",render:e=>S(e.status)===0?r(C,{}):e.badge?r(y,{badge:e.badge}):r(g,{}),width:"auto",align:"center",sorting:!1}},createStatusColumn(){return{title:"Checks",field:"status",render:e=>e.status&&r(h,{track:e.track,status:e.status}),width:"auto",align:"center",sorting:!1}},createNameColumn(e){return{title:"Name",field:"resolved.entityRef",highlight:!0,customSort(t,a){return 0},render:({entity:t})=>{const a=l();return r(u,{entityRef:t,defaultKind:e?.defaultKind||"Component",className:a.linkHover})}}},createSystemColumn(){return{title:"System",field:"resolved.partOfSystemRelationTitle",customSort(e,t){return 0},render:({resolved:e})=>{const t=l();return r(s,{entityRefs:e.partOfSystemRelations,defaultKind:"system",className:t.linkHover})}}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",customSort(e,t){return 0},render:({resolved:e})=>{const t=l();return r(s,{entityRefs:e.ownedByRelations,defaultKind:"group",className:t.linkHover})}}},createSpecTypeColumn(){return{title:"Type",field:"entity.spec.type",customSort(e,t){return 0}}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"entity.spec.lifecycle",customSort(e,t){return 0},width:"auto"}},createMetadataDescriptionColumn(){return{title:"Description",field:"entity.metadata.description",customSort(e,t){return 0},render:({entity:e})=>r(m,{text:e.metadata.description,placement:"bottom-start"}),width:"auto"}},createTagsColumn(){return{title:"Tags",field:"entity.metadata.tags",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:e})=>r(o,{children:e.metadata.tags&&e.metadata.tags.map(t=>r(d,{label:t,size:"small",variant:"outlined",style:{marginBottom:"0px"}},t))}),width:"auto",sorting:!1}},createTitleColumn(e){return{title:"Title",field:"entity.metadata.title",customSort(t,a){return 0},hidden:e?.hidden,searchable:!0}},createLabelColumn(e,t){return{title:t?.title||"Label",field:"entity.metadata.labels",customSort(a,n){return 0},cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:a})=>{const n=a.metadata?.labels,i=n&&n[e]||t?.defaultValue;return r(o,{children:i&&r(d,{label:i,size:"small",variant:"outlined"},i)})},width:"auto",sorting:!1}},createNamespaceColumn(){return{title:"Namespace",field:"entity.metadata.namespace",customSort(e,t){return 0},width:"auto"}}});export{b as columnFactories};
1
+ import{jsx as r,Fragment as o}from"react/jsx-runtime";import{OverflowTooltip as m}from"@backstage/core-components";import{EntityRefLink as u,EntityRefLinks as s}from"@backstage/plugin-catalog-react";import{makeStyles as c,withStyles as p,Chip as d}from"@material-ui/core";import f from"@material-ui/icons/RemoveCircleOutline";import{LevelBadge as y}from"../../Badges/LevelBadge.esm.js";import{NoLevelBadge as g}from"../../Badges/NoLevelBadge.esm.js";import{CampaignBadge as h}from"../../Badges/CampaignBadge.esm.js";import{TrackStatusChip as S}from"./TrackStatusChip.esm.js";import{getApplicableCheckCount as C}from"./utils.esm.js";const l=c(()=>({linkHover:{"& span":{"&:hover":{textDecoration:"underline"}}}})),b=p(e=>({root:{color:e.palette.text.disabled}}))(f),v=Object.freeze({createBadgeColumn(){return{title:"",field:"badge",render:e=>C(e.status)===0?r(b,{}):e.track.type==="campaign"?r(h,{}):e.badge?r(y,{badge:e.badge}):r(g,{}),width:"auto",align:"center",sorting:!1}},createStatusColumn(){return{title:"Checks",field:"status",render:e=>e.status&&r(S,{track:e.track,status:e.status}),width:"auto",align:"center",sorting:!1}},createNameColumn(e){return{title:"Name",field:"resolved.entityRef",highlight:!0,customSort(t,a){return 0},render:({entity:t})=>{const a=l();return r(u,{entityRef:t,defaultKind:e?.defaultKind||"Component",className:a.linkHover})}}},createSystemColumn(){return{title:"System",field:"resolved.partOfSystemRelationTitle",customSort(e,t){return 0},render:({resolved:e})=>{const t=l();return r(s,{entityRefs:e.partOfSystemRelations,defaultKind:"system",className:t.linkHover})}}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",customSort(e,t){return 0},render:({resolved:e})=>{const t=l();return r(s,{entityRefs:e.ownedByRelations,defaultKind:"group",className:t.linkHover})}}},createSpecTypeColumn(){return{title:"Type",field:"entity.spec.type",customSort(e,t){return 0}}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"entity.spec.lifecycle",customSort(e,t){return 0},width:"auto"}},createMetadataDescriptionColumn(){return{title:"Description",field:"entity.metadata.description",customSort(e,t){return 0},render:({entity:e})=>r(m,{text:e.metadata.description,placement:"bottom-start"}),width:"auto"}},createTagsColumn(){return{title:"Tags",field:"entity.metadata.tags",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:e})=>r(o,{children:e.metadata.tags&&e.metadata.tags.map(t=>r(d,{label:t,size:"small",variant:"outlined",style:{marginBottom:"0px"}},t))}),width:"auto",sorting:!1}},createTitleColumn(e){return{title:"Title",field:"entity.metadata.title",customSort(t,a){return 0},hidden:e?.hidden,searchable:!0}},createLabelColumn(e,t){return{title:t?.title||"Label",field:"entity.metadata.labels",customSort(a,n){return 0},cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:a})=>{const n=a.metadata?.labels,i=n&&n[e]||t?.defaultValue;return r(o,{children:i&&r(d,{label:i,size:"small",variant:"outlined"},i)})},width:"auto",sorting:!1}},createNamespaceColumn(){return{title:"Namespace",field:"entity.metadata.namespace",customSort(e,t){return 0},width:"auto"}}});export{v as columnFactories};
2
2
  //# sourceMappingURL=columns.esm.js.map
@@ -1,2 +1,2 @@
1
- import{RELATION_PART_OF as f,RELATION_OWNED_BY as p,stringifyEntityRef as u}from"@backstage/catalog-model";import{getEntityRelations as m,humanizeEntityRef as a}from"@backstage/plugin-catalog-react";import d from"lodash";function y(e){return Object.keys(e).filter(t=>!["allPassPercentage","notApplicable","numberOfEntities","ordinal","exempt"].includes(t)&&typeof d.get(e,t,0)=="number").reduce((t,i)=>t+d.get(e,i,0),0)}function c(e){const{trackDetails:t,track:i,entity:n}=e,r=m(n,f,{kind:"system"}),s=m(n,p),l=u(n);return{id:l,entity:n,badge:t.badge??void 0,track:i,status:t.status,resolved:{name:a(n,{defaultKind:"Component"}),entityRef:l,ownedByRelationsTitle:s.map(o=>a(o,{defaultKind:"group"})).join(", "),ownedByRelations:s,partOfSystemRelationTitle:r.map(o=>a(o,{defaultKind:"system"})).join(", "),partOfSystemRelations:r}}}export{y as getApplicableCheckCount,c as toTrackEntityRow};
1
+ import{RELATION_PART_OF as f,RELATION_OWNED_BY as p,stringifyEntityRef as c}from"@backstage/catalog-model";import{getEntityRelations as m,humanizeEntityRef as a}from"@backstage/plugin-catalog-react";import d from"lodash";function u(e){return Object.keys(e).filter(t=>!["allPassPercentage","notApplicable","numberOfEntities","ordinal","exempt","passPercentage"].includes(t)&&typeof d.get(e,t,0)=="number").reduce((t,i)=>t+d.get(e,i,0),0)}function y(e){const{trackDetails:t,track:i,entity:n}=e,r=m(n,f,{kind:"system"}),s=m(n,p),l=c(n);return{id:l,entity:n,badge:t.badge??void 0,track:i,status:t.status,resolved:{name:a(n,{defaultKind:"Component"}),entityRef:l,ownedByRelationsTitle:s.map(o=>a(o,{defaultKind:"group"})).join(", "),ownedByRelations:s,partOfSystemRelationTitle:r.map(o=>a(o,{defaultKind:"system"})).join(", "),partOfSystemRelations:r}}}export{u as getApplicableCheckCount,y as toTrackEntityRow};
2
2
  //# sourceMappingURL=utils.esm.js.map
@@ -1,2 +1,2 @@
1
- import{jsx as e,jsxs as p}from"react/jsx-runtime";import{useTheme as f,Typography as u}from"@material-ui/core";import y from"lodash";import{DateTime as k}from"luxon";import{ResponsiveContainer as g,AreaChart as v,CartesianGrid as x,XAxis as L,YAxis as m,Tooltip as C,Area as b}from"recharts";import{compactNumberFormatter as A}from"../../utils/formatters.esm.js";import{getChartColors as $,formatDate as E}from"../Charts/chartUtils.esm.js";import{LoadingChart as T}from"../Charts/LoadingChart.esm.js";const h=a=>{const n=a?.certificationStatusHistory.history??[],s=a?.certificationStatusHistory.numberOfEntities,i=k.utc();return y.map(n,(l,r)=>{let t={name:E(i,n.length-r-1),totalEntities:s??0};const o=[];for(const d of l.statusByLevel){const c=d.cumulativelyPassed;o.push(s?Math.round(c/s*100):0)}return l.statusByLevel.forEach((d,c)=>{t={...t,[`Level ${d.ordinal}`]:o[c]}}),t})},D=({track:a,data:n,isError:s})=>{const i=f();if(s)return e(u,{color:"error",children:"Failed to load track data."});if(!a||!n)return e(T,{type:"area",numLines:3});const l=h(n),r=$(i);return e("div",{style:{height:250,width:"100%",position:"relative",borderRadius:"4px"},children:e(g,{height:250,debounce:1,children:p(v,{data:l,margin:{top:0,right:0,bottom:0,left:0},children:[e("defs",{children:a?.levels.map((t,o)=>p("linearGradient",{id:`gradient-${t.ordinal}`,x1:"0",y1:"0",x2:"0",y2:"1",children:[e("stop",{offset:"5%",stopColor:r[o%r.length],stopOpacity:.4}),e("stop",{offset:"95%",stopColor:r[o%r.length],stopOpacity:0})]},`gradient-${t.ordinal}`))}),e(x,{stroke:i.palette.divider,strokeWidth:1,horizontal:!0,vertical:!1}),e(L,{dataKey:"name",tickLine:!1,axisLine:!1}),e(m,{yAxisId:"left",domain:[0,100],axisLine:!1,tickLine:!1,tickFormatter:t=>`${t}%`,ticks:[0,25,50,75,100]}),e(m,{yAxisId:"right",orientation:"right",dataKey:"totalEntities",axisLine:!1,tickLine:!1,tickFormatter:t=>A(t)}),e(C,{contentStyle:{backgroundColor:i.palette.background.paper,color:i.palette.text.primary,border:`1px solid ${i.palette.divider}`},cursor:{stroke:i.palette.divider,strokeWidth:1}}),a?.levels.map((t,o)=>e(b,{type:"monotone",dataKey:`Level ${t.ordinal}`,name:`Level ${t.ordinal}`,stackId:"1",yAxisId:"left",stroke:r[o%r.length],strokeWidth:2,fill:`url(#gradient-${t.ordinal})`,isAnimationActive:!1,activeDot:{fill:r[o%r.length],stroke:i.palette.background.paper,strokeWidth:1,r:5}},`Level ${t.ordinal}`))]})})})};export{D as TrackHistoryChart,h as formatLineChartData};
1
+ import{jsx as e,jsxs as p}from"react/jsx-runtime";import{useTheme as f,Typography as u}from"@material-ui/core";import y from"lodash";import{DateTime as k}from"luxon";import{ResponsiveContainer as g,AreaChart as v,CartesianGrid as x,XAxis as L,YAxis as m,Tooltip as C,Area as b}from"recharts";import{compactNumberFormatter as A}from"../../utils/formatters.esm.js";import{getChartColors as $,formatDate as E}from"../Charts/chartUtils.esm.js";import{LoadingChart as T}from"../Charts/LoadingChart.esm.js";const h=o=>{const a=o?.certificationStatusHistory.history??[],n=o?.certificationStatusHistory.numberOfEntities,i=k.utc();return y.map(a,(l,r)=>{let t={name:E(i,a.length-r-1),totalEntities:n??0};const s=[];for(const d of l.statusByLevel){const c=d.cumulativelyPassed;s.push(n?Math.round(c/n*100):0)}return l.statusByLevel.forEach((d,c)=>{t={...t,[`Level ${d.ordinal}`]:s[c]}}),t})},D=({track:o,data:a,isError:n})=>{const i=f();if(n)return e(u,{color:"error",children:"Failed to load track data."});if(!o||!a)return e(T,{type:"area",numLines:3});const l=h(a),r=$(i);return e("div",{style:{height:250,width:"100%",position:"relative",borderRadius:"4px"},children:e(g,{height:250,debounce:1,children:p(v,{data:l,margin:{top:0,right:0,bottom:0,left:0},children:[e("defs",{children:o?.levels.map((t,s)=>p("linearGradient",{id:`gradient-${t.ordinal}`,x1:"0",y1:"0",x2:"0",y2:"1",children:[e("stop",{offset:"5%",stopColor:r[s%r.length],stopOpacity:.4}),e("stop",{offset:"95%",stopColor:r[s%r.length],stopOpacity:0})]},`gradient-${t.ordinal}`))}),e(x,{stroke:i.palette.divider,strokeWidth:1,horizontal:!0,vertical:!1}),e(L,{dataKey:"name",tickLine:!1,axisLine:!1}),e(m,{yAxisId:"left",domain:[0,100],axisLine:!1,tickLine:!1,tickFormatter:t=>`${t}%`,ticks:[0,25,50,75,100]}),e(m,{yAxisId:"right",orientation:"right",dataKey:"totalEntities",axisLine:!1,tickLine:!1,tickFormatter:t=>A(t)}),e(C,{contentStyle:{backgroundColor:i.palette.background.paper,color:i.palette.text.primary,border:`1px solid ${i.palette.divider}`},cursor:{stroke:i.palette.divider,strokeWidth:1}}),[...o?.levels??[]].reverse().map(t=>e(b,{type:"monotone",dataKey:`Level ${t.ordinal}`,name:`Level ${t.ordinal}`,stackId:"1",yAxisId:"left",stroke:r[t.ordinal%r.length],strokeWidth:2,fill:`url(#gradient-${t.ordinal})`,isAnimationActive:!1,activeDot:{fill:r[t.ordinal%r.length],stroke:i.palette.background.paper,strokeWidth:1,r:5}},`Level ${t.ordinal}`))]})})})};export{D as TrackHistoryChart,h as formatLineChartData};
2
2
  //# sourceMappingURL=TrackHistoryChart.esm.js.map
@@ -1,2 +1,2 @@
1
- import{jsx as r,jsxs as g,Fragment as Z}from"react/jsx-runtime";import{useRouteRef as ee}from"@backstage/core-plugin-api";import{EntityRefLink as te}from"@backstage/plugin-catalog-react";import{usePermission as M}from"@backstage/plugin-permission-react";import{makeStyles as re,Button as ie,Box as ae,Tabs as oe,Tab as x}from"@material-ui/core";import{soundcheckTrackReadPermission as se,soundcheckTrackUpdatePermission as ne,toEntityFilterQuery as ce}from"@spotify/backstage-plugin-soundcheck-common";import v from"lodash/isEqual";import{useState as u,useEffect as le,useMemo as f,useCallback as N}from"react";import{useNavigate as me,useSearchParams as de,useParams as pe}from"react-router-dom";import"@backstage/catalog-model";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import"../../hooks/useSoundcheckAlert.esm.js";import{useTrack as he}from"../../hooks/tracks/useTrack.esm.js";import"../../hooks/useConfirmationModal.esm.js";import{useCertificationStatus as fe}from"../../hooks/aggregations/useCertificationStatus.esm.js";import{useCertificationStatusHistory as ge}from"../../hooks/aggregations/useCertificationStatusHistory.esm.js";import{useCheckStatuses as ue}from"../../hooks/aggregations/useCheckStatuses.esm.js";import{useSearchParam as w}from"../../hooks/useSearchParam.esm.js";import{trackEditRouteRef as ke}from"../../routes.esm.js";import{FilterSidebar as ye}from"../FilterSidebar/FilterSidebar.esm.js";import{LevelsTable as Ce}from"../LevelsTable/LevelsTable.esm.js";import{LoadingIndicator as ve}from"../LoadingIndicator/LoadingIndicator.esm.js";import{PageWarningMessage as we}from"../PageWarningMessage/PageWarningMessage.esm.js";import"../SoundcheckHeader/SoundcheckHeader.esm.js";import"../SoundcheckHeader/SoundcheckHeaderContext.esm.js";import{useHeader as be}from"../SoundcheckHeader/useHeader.esm.js";import{SoundcheckMarkdownContent as Ee}from"../SoundcheckMarkdownContent/SoundcheckMarkdownContent.esm.js";import"@backstage/core-components";import"react-markdown";import"rehype-raw";import"remark-gfm";import{TopFailingChecksTable as Le}from"../TopFailingChecksTable/TopFailingChecksTable.esm.js";import{toFilter as Se}from"./FilterBar/util.esm.js";import{TrackEntitiesTable as Te}from"./TrackEntitiesTable/TrackEntitiesTable.esm.js";import{TrackProgressCard as xe}from"./TrackProgressCard.esm.js";const Ne=re(e=>({root:{height:"100%",background:e.palette.background.default},pageContent:{display:"flex",minHeight:`calc(100vh - ${e.spacing(15)}px)`,borderTop:`1px solid ${e.palette.divider}`,height:"100%"},mainContentArea:{flex:1,display:"flex",flexDirection:"column",minWidth:0},trackProgressContainer:{padding:e.spacing(2,0,2,2),borderBottom:`1px solid ${e.palette.divider}`},levelCard:{margin:e.spacing(1,0,2)},editButton:{marginLeft:"auto"},contentArea:{flex:1,padding:e.spacing(0,2)},trackEntitiesContainer:{marginTop:e.spacing(1)},headerDescription:{fontSize:e.typography.body2.fontSize,margin:e.spacing(.5,0,0),"& p":{margin:0},"& a":{color:"inherit",textDecoration:"underline"}},ownerLink:{"& span":{color:"inherit","&:hover":{textDecoration:"underline"}}},tabs:{padding:e.spacing(2,2,0,2)}})),Re=()=>{const e=Ne(),[k,O]=u("checksByLevel"),R=me(),P=ee(ke),[Pe,y]=de(),[s]=w("lifecycles"),[n]=w("owners"),[c]=w("systems"),[l]=w("types"),[m,b]=u(s??[]),[d,E]=u(n??[]),[p,L]=u(l??[]),[h,S]=u(c??[]);le(()=>{E(n??[]),b(s??[]),L(l??[]),S(c??[])},[n,s,l,c]);const $=f(()=>{const i={owners:!v(d,n??[]),lifecycles:!v(m,s??[]),types:!v(p,l??[]),systems:!v(h,c??[])};return Object.values(i).some(Boolean)},[d,n,m,s,p,l,h,c]),j=N(()=>{const i=new URLSearchParams;m.length>0&&m.forEach(o=>i.append("lifecycles",o)),d.length>0&&d.forEach(o=>i.append("owners",o)),p.length>0&&p.forEach(o=>i.append("types",o)),h.length>0&&h.forEach(o=>i.append("systems",o)),y(i)},[m,d,p,h,y]),H=N(()=>{b([]),E([]),L([]),S([]),y(new URLSearchParams)},[y]),U=N((i,o)=>{O(o)},[]),{trackId:a}=pe(),T=f(()=>Se({lifecycles:s,owners:n,types:l,systems:c}),[s,n,l,c]),{data:t,isLoading:C,isError:z}=he(a),{data:F,isLoading:B,isError:W}=fe({trackId:a,filter:T},!!a),{data:Q,isError:q}=ge({trackId:a,filter:T,numberOfDays:30},!!a),{loading:G,allowed:J}=M({permission:se,resourceRef:a}),{loading:I,allowed:D}=M({permission:ne,resourceRef:a}),K=f(()=>t?.ownerEntityRef?r(te,{color:"inherit",entityRef:t.ownerEntityRef,className:e.ownerLink}):null,[t?.ownerEntityRef,e.ownerLink]),V=f(()=>!I&&D&&t?.isEditable?r(ie,{className:e.editButton,variant:"contained",color:"primary",onClick:()=>{R(P({trackId:t.id}))},children:"Edit Track"}):null,[D,e.editButton,P,I,R,t]),X=f(()=>t?.description?r(Ee,{className:e.headerDescription,content:t.description}):null,[e.headerDescription,t?.description]);be({title:t?.name,description:X,customSubtitle:K,sectionRight:V});const Y=t?.levels?.flatMap(i=>i.checks)??[],{data:A}=ue({trackId:a,checkIds:Y.map(i=>i.id),filter:T},!!t),_=f(()=>ce(t?.filter),[t]);return g(Z,{children:[r(we,{entityName:"track",entityId:a,showNotFound:!C&&!t,showCannotView:!G&&!J}),C&&r(ve,{}),t&&r("div",{className:e.root,children:g("div",{className:e.pageContent,children:[r(ye,{trackFilter:_,stagedTypes:p,stagedLifecycles:m,stagedOwners:d,stagedSystems:h,onTypesChange:L,onLifecyclesChange:b,onOwnersChange:E,onSystemsChange:S,onApplyFilters:j,onClearFilters:H,hasFilterChanges:$}),g("div",{className:e.mainContentArea,children:[r("div",{className:e.trackProgressContainer,children:r(xe,{track:t,status:F,history:Q,isError:z||W||q})}),r(ae,{className:e.tabs,children:g(oe,{value:k,onChange:U,indicatorColor:"primary",textColor:"primary",children:[r(x,{label:"Checks By Level",value:"checksByLevel"}),r(x,{label:"Top Failing Checks",value:"topFailingChecks"}),r(x,{label:"Entities",value:"entities"})]})}),g("div",{className:e.contentArea,children:[k==="checksByLevel"&&r("div",{className:e.levelCard,children:r(Ce,{track:t,checkStatuses:A,isLoading:C||B})}),k==="entities"&&r("div",{className:e.trackEntitiesContainer,children:r(Te,{track:t,lifecycles:s,owners:n,types:l,systems:c})}),k==="topFailingChecks"&&r("div",{className:e.levelCard,children:r(Le,{track:t,checkStatuses:A,certificationStatus:F?.certificationStatus,isLoading:C||B})})]})]})]})})]})};export{Re as TrackPage};
1
+ import{jsx as r,jsxs as g,Fragment as Z}from"react/jsx-runtime";import{useRouteRef as ee}from"@backstage/core-plugin-api";import{EntityRefLink as te}from"@backstage/plugin-catalog-react";import{usePermission as A}from"@backstage/plugin-permission-react";import{makeStyles as re,Button as ie,Box as ae,Tabs as oe,Tab as x}from"@material-ui/core";import{soundcheckTrackReadPermission as se,soundcheckTrackUpdatePermission as ne,toEntityFilterQuery as ce}from"@spotify/backstage-plugin-soundcheck-common";import C from"lodash/isEqual";import{useState as u,useEffect as le,useMemo as f,useCallback as N}from"react";import{useNavigate as me,useSearchParams as de,useParams as pe}from"react-router-dom";import"@backstage/catalog-model";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import"../../hooks/useSoundcheckAlert.esm.js";import{useTrack as he}from"../../hooks/tracks/useTrack.esm.js";import"../../hooks/useConfirmationModal.esm.js";import{useCertificationStatus as fe}from"../../hooks/aggregations/useCertificationStatus.esm.js";import{useCertificationStatusHistory as ge}from"../../hooks/aggregations/useCertificationStatusHistory.esm.js";import{useCheckStatuses as ue}from"../../hooks/aggregations/useCheckStatuses.esm.js";import{useSearchParam as v}from"../../hooks/useSearchParam.esm.js";import{trackEditRouteRef as ke}from"../../routes.esm.js";import{FilterSidebar as ye}from"../FilterSidebar/FilterSidebar.esm.js";import{LevelsTable as Ce}from"../LevelsTable/LevelsTable.esm.js";import{LoadingIndicator as ve}from"../LoadingIndicator/LoadingIndicator.esm.js";import{PageWarningMessage as be}from"../PageWarningMessage/PageWarningMessage.esm.js";import"../SoundcheckHeader/SoundcheckHeader.esm.js";import"../SoundcheckHeader/SoundcheckHeaderContext.esm.js";import{useHeader as we}from"../SoundcheckHeader/useHeader.esm.js";import{SoundcheckMarkdownContent as Ee}from"../SoundcheckMarkdownContent/SoundcheckMarkdownContent.esm.js";import"@backstage/core-components";import"react-markdown";import"rehype-raw";import"remark-gfm";import{TopFailingChecksTable as Se}from"../TopFailingChecksTable/TopFailingChecksTable.esm.js";import{toFilter as Le}from"./FilterBar/util.esm.js";import{TrackEntitiesTable as Te}from"./TrackEntitiesTable/TrackEntitiesTable.esm.js";import{TrackProgressCard as xe}from"./TrackProgressCard.esm.js";const Ne=re(e=>({root:{height:"100%",background:e.palette.background.default},pageContent:{display:"flex",minHeight:`calc(100vh - ${e.spacing(15)}px)`,borderTop:`1px solid ${e.palette.divider}`,height:"100%"},mainContentArea:{flex:1,display:"flex",flexDirection:"column",minWidth:0},trackProgressContainer:{padding:e.spacing(2,0,2,2),borderBottom:`1px solid ${e.palette.divider}`},levelCard:{margin:e.spacing(1,0,2)},editButton:{marginLeft:"auto"},contentArea:{flex:1,padding:e.spacing(0,2)},trackEntitiesContainer:{marginTop:e.spacing(1)},headerDescription:{fontSize:e.typography.body2.fontSize,margin:e.spacing(.5,0,0),"& p":{margin:0},"& a":{color:"inherit",textDecoration:"underline"}},ownerLink:{"& span":{color:"inherit","&:hover":{textDecoration:"underline"}}},tabs:{padding:e.spacing(2,2,0,2)}})),Re=()=>{const e=Ne(),[k,M]=u("checksByLevel"),R=me(),P=ee(ke),[Pe,y]=de(),[s]=v("lifecycles"),[n]=v("owners"),[c]=v("systems"),[l]=v("types"),[m,b]=u(s??[]),[d,w]=u(n??[]),[p,E]=u(l??[]),[h,S]=u(c??[]);le(()=>{w(n??[]),b(s??[]),E(l??[]),S(c??[])},[n,s,l,c]);const O=f(()=>{const i={owners:!C(d,n??[]),lifecycles:!C(m,s??[]),types:!C(p,l??[]),systems:!C(h,c??[])};return Object.values(i).some(Boolean)},[d,n,m,s,p,l,h,c]),$=N(()=>{const i=new URLSearchParams;m.length>0&&m.forEach(o=>i.append("lifecycles",o)),d.length>0&&d.forEach(o=>i.append("owners",o)),p.length>0&&p.forEach(o=>i.append("types",o)),h.length>0&&h.forEach(o=>i.append("systems",o)),y(i)},[m,d,p,h,y]),j=N(()=>{b([]),w([]),E([]),S([]),y(new URLSearchParams)},[y]),H=N((i,o)=>{M(o)},[]),{trackId:a}=pe(),L=f(()=>Le({lifecycles:s,owners:n,types:l,systems:c}),[s,n,l,c]),{data:t,isLoading:T,isError:U}=he(a),{data:F,isLoading:z,isError:W}=fe({trackId:a,filter:L},!!a),{data:Q,isError:V}=ge({trackId:a,filter:L,numberOfDays:30},!!a),{loading:q,allowed:G}=A({permission:se,resourceRef:a}),{loading:B,allowed:I}=A({permission:ne,resourceRef:a}),J=f(()=>t?.ownerEntityRef?r(te,{color:"inherit",entityRef:t.ownerEntityRef,className:e.ownerLink}):null,[t?.ownerEntityRef,e.ownerLink]),K=f(()=>!B&&I&&t?.isEditable?r(ie,{className:e.editButton,variant:"contained",color:"primary",onClick:()=>{R(P({trackId:t.id}))},children:"Edit Track"}):null,[I,e.editButton,P,B,R,t]),X=f(()=>t?.description?r(Ee,{className:e.headerDescription,content:t.description}):null,[e.headerDescription,t?.description]);we({title:t?.name,description:X,customSubtitle:J,sectionRight:K});const Y=t?.levels?.flatMap(i=>i.checks)??[],{data:D}=ue({trackId:a,checkIds:Y.map(i=>i.id),filter:L},!!t),_=f(()=>ce(t?.filter),[t]);return g(Z,{children:[r(be,{entityName:"track",entityId:a,showNotFound:!T&&!t,showCannotView:!q&&!G}),T&&r(ve,{}),t&&r("div",{className:e.root,children:g("div",{className:e.pageContent,children:[r(ye,{trackFilter:_,stagedTypes:p,stagedLifecycles:m,stagedOwners:d,stagedSystems:h,onTypesChange:E,onLifecyclesChange:b,onOwnersChange:w,onSystemsChange:S,onApplyFilters:$,onClearFilters:j,hasFilterChanges:O}),g("div",{className:e.mainContentArea,children:[r("div",{className:e.trackProgressContainer,children:r(xe,{track:t,status:F,history:Q,isError:U||W||V})}),r(ae,{className:e.tabs,children:g(oe,{value:k,onChange:H,indicatorColor:"primary",textColor:"primary",children:[r(x,{label:"Checks By Level",value:"checksByLevel"}),r(x,{label:"Top Failing Checks",value:"topFailingChecks"}),r(x,{label:"Entities",value:"entities"})]})}),g("div",{className:e.contentArea,children:[k==="checksByLevel"&&r("div",{className:e.levelCard,children:r(Ce,{track:t,checkStatuses:D,isLoading:T||z})}),k==="entities"&&r("div",{className:e.trackEntitiesContainer,children:r(Te,{track:t,lifecycles:s,owners:n,types:l,systems:c})}),k==="topFailingChecks"&&r("div",{className:e.levelCard,children:r(Se,{track:t,checkStatuses:D,certificationStatus:F?.certificationStatus})})]})]})]})})]})};export{Re as TrackPage};
2
2
  //# sourceMappingURL=TrackPage.esm.js.map
@@ -1,2 +1,2 @@
1
- import{jsx as n}from"react/jsx-runtime";import{useTheme as h,Box as v}from"@material-ui/core";import{makeStyles as y}from"@material-ui/core/styles";import{Skeleton as B}from"@material-ui/lab";import{useMemo as d}from"react";import{CategoryBar as k}from"../CategoryBar/CategoryBar.esm.js";import{getChartColors as x}from"../Charts/chartUtils.esm.js";const L=y(t=>({categoryBar:{"& .MuiBox-root > div":{height:"8px"}},skeleton:{height:"8px",width:"100%",margin:0,padding:0,display:"block"}})),$=({track:t,status:r,className:i})=>{const m=L(),c=h(),u=d(()=>{if(!r||!t)return{};const e={};return r.statusByLevel.forEach(({ordinal:o,cumulativelyPassed:a})=>{const s=t.levels.find(l=>l.ordinal===o)?.name??`Level ${o}`;e[s]=a}),e},[r,t]),f=d(()=>{if(!r||!t)return{};const e=x(c),o={};return r.statusByLevel.forEach(({ordinal:a},s)=>{const l=t.levels.find(g=>g.ordinal===a)?.name??`Level ${a}`;o[l]=e[s%e.length]}),o},[c,r,t]);if(!t||!r)return n(B,{className:`${m.skeleton} ${i}`});const p=e=>e;return n(v,{className:i,style:{width:"100%"},children:n(k,{className:m.categoryBar,data:u,categories:r.statusByLevel.map(({ordinal:e})=>t.levels.find(o=>o.ordinal===e)?.name??`Level ${e}`),categoryColors:f,showTooltip:!1,valueFormatter:e=>e.toString(),categoryFormatter:p})})};export{$ as TrackStatusBar};
1
+ import{jsx as n}from"react/jsx-runtime";import{useTheme as y,Box as v}from"@material-ui/core";import{makeStyles as B}from"@material-ui/core/styles";import{Skeleton as k}from"@material-ui/lab";import{useMemo as f}from"react";import{CategoryBar as C}from"../CategoryBar/CategoryBar.esm.js";import{getChartColors as N}from"../Charts/chartUtils.esm.js";const x=B(t=>({categoryBar:{"& .MuiBox-root > div":{height:"8px"}},skeleton:{height:"8px",width:"100%",margin:0,padding:0,display:"block"}})),L=({track:t,status:o,className:m})=>{const c=x(),l=y(),u=f(()=>{if(!o||!t)return{};const e={};let r=0;return o.statusByLevel.forEach(({ordinal:a,cumulativelyPassed:s})=>{const i=t.levels.find(h=>h.ordinal===a)?.name??`Level ${a}`;e[i]=s,r+=s}),e["Not Certified"]=o.numberOfEntities-r,e},[o,t]),p=f(()=>{if(!o||!t)return{};const e=N(l),r={};return o.statusByLevel.forEach(({ordinal:a})=>{const s=t.levels.find(i=>i.ordinal===a)?.name??`Level ${a}`;r[s]=e[a%e.length]}),r["Not Certified"]=l.palette.grey[700],r},[l,o,t]);if(!t||!o)return n(k,{className:`${c.skeleton} ${m}`});const g=e=>e,d=o.statusByLevel.map(({ordinal:e})=>t.levels.find(r=>r.ordinal===e)?.name??`Level ${e}`);return d.push("Not Certified"),n(v,{className:m,style:{width:"100%"},children:n(C,{className:c.categoryBar,data:u,categories:d,categoryColors:p,showTooltip:!1,valueFormatter:e=>e.toString(),categoryFormatter:g})})};export{L as TrackStatusBar};
2
2
  //# sourceMappingURL=TrackStatusBar.esm.js.map