@spotify/backstage-plugin-soundcheck 0.19.3 → 0.19.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (224) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/alpha/integrations.esm.js +1 -1
  3. package/dist/alpha/pages.esm.js +1 -1
  4. package/dist/alpha.d.ts +2 -2
  5. package/dist/api.esm.js +1 -1
  6. package/dist/blueprints/IntegrationPageBlueprint.esm.js +1 -1
  7. package/dist/components/Badges/NoLevelBadge.esm.js +2 -2
  8. package/dist/components/CampaignCreatePage/CampaignCreatePage.esm.js +1 -1
  9. package/dist/components/CampaignForm/CampaignForm.esm.js +1 -1
  10. package/dist/components/CampaignForm/hooks/useCampaignForm.esm.js +1 -1
  11. package/dist/components/CampaignPage/CampaignPageBUI.esm.js +1 -1
  12. package/dist/components/CampaignPage/CampaignPageDeprecated.esm.js +1 -1
  13. package/dist/components/CampaignPage/CampaignStatusHistoryChart.esm.js +2 -0
  14. package/dist/components/CampaignPage/CampaignStatusHistoryTile.esm.js +1 -1
  15. package/dist/components/CampaignPage/CampaignStatusTile.esm.js +1 -1
  16. package/dist/components/CampaignPage/CampaignTechInsightsExplorerPage.esm.js +2 -0
  17. package/dist/components/CampaignsPage/CampaignListPage/CampaignListPageDeprecated.esm.js +1 -1
  18. package/dist/components/CampaignsPage/CampaignListPage/CampaignSummaryCard.esm.js +1 -1
  19. package/dist/components/CampaignsPage/CampaignListPageBUI.esm.js +1 -1
  20. package/dist/components/CampaignsPage/CampaignsPage.esm.js +1 -1
  21. package/dist/components/CampaignsPage/EditCampaignView.esm.js +1 -1
  22. package/dist/components/Cards/CheckStatusCard/CheckStatusCard.esm.js +2 -0
  23. package/dist/components/Cards/DescriptionCard/DescriptionCard.esm.js +1 -1
  24. package/dist/components/Cards/HistoricalCheckStatusCard/HistoricalCheckStatusCard.esm.js +2 -0
  25. package/dist/components/Cards/HistoricalTrackStatusCard/HistoricalTrackStatusCard.esm.js +2 -0
  26. package/dist/components/Cards/TrackStatusCard/TrackStatusCard.esm.js +2 -0
  27. package/dist/components/CertificationAccordion/CertificationAccordion.esm.js +1 -1
  28. package/dist/components/CertificationSidebar/CertificationSidebar.esm.js +1 -1
  29. package/dist/components/CertificationSidebar/CertificationSummary.esm.js +1 -1
  30. package/dist/components/CertificationSidebar/Check.esm.js +1 -1
  31. package/dist/components/CertificationSidebar/ExemptionJustificationDialog.esm.js +1 -1
  32. package/dist/components/CertificationSidebar/LevelSummary.esm.js +1 -1
  33. package/dist/components/CertificationsPage/CertificationTab.esm.js +1 -1
  34. package/dist/components/CertificationsPage/CertificationsPage.esm.js +1 -1
  35. package/dist/components/CertificationsPage/Playlist/PlaylistContext.esm.js +1 -1
  36. package/dist/components/CertificationsPage/Playlist/PlaylistSummary.esm.js +1 -1
  37. package/dist/components/Charts/chartUtils.esm.js +1 -1
  38. package/dist/components/CheckCreatePage/CheckCreatePage.esm.js +1 -1
  39. package/dist/components/CheckDetails/CheckDetails.esm.js +1 -1
  40. package/dist/components/CheckDetails/JustificationDetails.esm.js +1 -1
  41. package/dist/components/CheckDetails/ResultStateBox.esm.js +1 -1
  42. package/dist/components/CheckForm/CheckForm.esm.js +1 -1
  43. package/dist/components/CheckForm/FormFields/RuleInput/AddMenuButton.esm.js +1 -1
  44. package/dist/components/CheckForm/FormFields/RuleInput/Conditions/useRuleOptions.esm.js +1 -1
  45. package/dist/components/CheckForm/FormFields/RuleInput/RuleInputBox.esm.js +1 -1
  46. package/dist/components/CheckForm/Steps/CheckApplicabilityStep.esm.js +1 -1
  47. package/dist/components/CheckForm/Steps/CheckDetailsStep.esm.js +1 -1
  48. package/dist/components/CheckForm/Steps/CheckRulesStep.esm.js +1 -1
  49. package/dist/components/CheckForm/useCheckForm.esm.js +1 -1
  50. package/dist/components/CheckPage/CheckEditPage.esm.js +1 -1
  51. package/dist/components/CheckPage/CheckEditView.esm.js +1 -1
  52. package/dist/components/CheckPage/CheckEntitiesTable/CheckEntitiesTableBUI.esm.js +2 -0
  53. package/dist/components/CheckPage/CheckPage.esm.js +2 -0
  54. package/dist/components/CheckPage/CheckPageBUI.esm.js +2 -0
  55. package/dist/components/CheckPage/CheckPageDeprecated.esm.js +2 -0
  56. package/dist/components/CheckPage/CheckStatusHistoryChartBUI.esm.js +2 -0
  57. package/dist/components/CheckPage/CheckStatusTableBUI.esm.js +2 -0
  58. package/dist/components/CheckPage/ExemptionsTableBUI.esm.js +2 -0
  59. package/dist/components/CheckSelection/CheckPreview.esm.js +1 -1
  60. package/dist/components/CheckSelection/CheckSelection.esm.js +1 -1
  61. package/dist/components/CheckStatusBar/CheckStatusBarBUI.esm.js +1 -1
  62. package/dist/components/CheckTemplatesPage/CheckTemplatesPage.esm.js +1 -1
  63. package/dist/components/CheckTemplatesPage/CheckTemplatesPageBUI.esm.js +2 -0
  64. package/dist/components/CheckTemplatesPage/CheckTemplatesPageDeprecated.esm.js +2 -0
  65. package/dist/components/CheckTemplatesPage/TemplateCategoryBUI.esm.js +2 -0
  66. package/dist/components/ChecksPage/CheckListPage/CheckListPageDeprecated.esm.js +1 -1
  67. package/dist/components/ChecksPage/CheckListPage/CheckSummaryCard.esm.js +1 -1
  68. package/dist/components/ChecksPage/ChecksListPageBUI.esm.js +1 -1
  69. package/dist/components/ChecksTable/ChecksTable.esm.js +1 -1
  70. package/dist/components/CollapsablePanel/CollapsablePanel.esm.js +1 -1
  71. package/dist/components/CollectorPage/CollectorDetailsPage.esm.js +1 -1
  72. package/dist/components/CollectorPage/CollectorDetailsPageBUI.esm.js +2 -0
  73. package/dist/components/CollectorPage/CollectorDetailsPageDeprecated.esm.js +2 -0
  74. package/dist/components/CollectorPage/CollectorFactTableBUI.esm.js +2 -0
  75. package/dist/components/CollectorPage/CollectorPage.esm.js +1 -1
  76. package/dist/components/CollectorPage/Configurators/AzureDevOps/AzureDevOpsConfigurator.esm.js +1 -1
  77. package/dist/components/CollectorPage/Configurators/BigQuery/BigQueryConfigurator.esm.js +1 -1
  78. package/dist/components/CollectorPage/Configurators/Catalog/CatalogConfigurator.esm.js +1 -1
  79. package/dist/components/CollectorPage/Configurators/DataDog/DataDogConfigurator.esm.js +1 -1
  80. package/dist/components/CollectorPage/Configurators/DataRegistry/DataRegistryConfigurator.esm.js +1 -1
  81. package/dist/components/CollectorPage/Configurators/Github/GithubConfigurator.esm.js +1 -1
  82. package/dist/components/CollectorPage/Configurators/Gitlab/GitlabConfigurator.esm.js +1 -1
  83. package/dist/components/CollectorPage/Configurators/HTTP/HttpConfigurator.esm.js +1 -1
  84. package/dist/components/CollectorPage/Configurators/HTTP/HttpStatusesInput.esm.js +1 -1
  85. package/dist/components/CollectorPage/Configurators/Jira/JiraConfigurator.esm.js +1 -1
  86. package/dist/components/CollectorPage/Configurators/Kubernetes/KubernetesConfigurator.esm.js +1 -1
  87. package/dist/components/CollectorPage/Configurators/NewRelic/NewRelicConfigurator.esm.js +1 -1
  88. package/dist/components/CollectorPage/Configurators/PagerDuty/PagerDutyConfigurator.esm.js +1 -1
  89. package/dist/components/CollectorPage/Configurators/SCM/ScmConfigurator.esm.js +1 -1
  90. package/dist/components/CollectorPage/Configurators/SonarQube/SonarQubeConfigurator.esm.js +1 -1
  91. package/dist/components/CollectorPage/DependantCheckCard.esm.js +2 -0
  92. package/dist/components/CollectorsPage/CollectorListPage/{CollectorListPage.esm.js → CollectorListPageDeprecated.esm.js} +2 -2
  93. package/dist/components/CollectorsPage/CollectorListPage/CollectorSummaryCard.esm.js +1 -1
  94. package/dist/components/CollectorsPage/CollectorsPage.esm.js +1 -1
  95. package/dist/components/CollectorsPage/IntegrationLogoBUI.esm.js +2 -0
  96. package/dist/components/CollectorsPage/IntegrationsListPageBUI.esm.js +2 -0
  97. package/dist/components/CustomCell/CustomCell.esm.js +1 -1
  98. package/dist/components/DescriptionCell/DescriptionCell.esm.js +2 -0
  99. package/dist/components/DocLinkButton/DocLinkButton.esm.js +2 -0
  100. package/dist/components/EmptyState/EmptyStateBUI.esm.js +1 -1
  101. package/dist/components/EmptyState/EmptyStateNoCampaigns.esm.js +1 -1
  102. package/dist/components/EmptyState/EmptyStateNoChecks.esm.js +1 -1
  103. package/dist/components/EmptyState/EmptyStateNoTracks.esm.js +1 -1
  104. package/dist/components/EntitiesAutocompletePicker/EntitiesAutocompletePicker.esm.js +1 -1
  105. package/dist/components/EntitySoundcheckCard/Card.esm.js +1 -1
  106. package/dist/components/ExpandableSection/ExpandableSection.esm.js +1 -1
  107. package/dist/components/FactExplorer/FactExplorerDialogBUI.esm.js +2 -0
  108. package/dist/components/FactExplorer/useFactOptions.esm.js +1 -1
  109. package/dist/components/Filter/EntityAutocompletePicker.esm.js +1 -1
  110. package/dist/components/Filter/FilterComponent.esm.js +1 -1
  111. package/dist/components/FilterMenu/FilterMenu.esm.js +2 -0
  112. package/dist/components/FilterSidebar/StateFilter.esm.js +1 -1
  113. package/dist/components/FormControlledAutocomplete/FormControlledAutocomplete.esm.js +1 -1
  114. package/dist/components/FormControlledAutocomplete/FormControlledMultipleAutocomplete.esm.js +1 -1
  115. package/dist/components/FormMarkdownInput/FormMarkdownInput.esm.js +1 -1
  116. package/dist/components/FormattedPreview/FormattedPreview.esm.js +1 -1
  117. package/dist/components/GroupHierarchySelector/GroupHierarchyGroupInfo.esm.js +1 -1
  118. package/dist/components/GroupHierarchySelector/GroupHierarchySelector.esm.js +1 -1
  119. package/dist/components/GroupSelectorBUI/GroupSelectList.esm.js +2 -0
  120. package/dist/components/GroupSelectorBUI/GroupSelectionHistory.esm.js +2 -0
  121. package/dist/components/GroupSelectorBUI/GroupSelectorBUI.esm.js +2 -0
  122. package/dist/components/GroupSelectorBUI/GroupTag.esm.js +2 -0
  123. package/dist/components/GroupSelectorBUI/useGroupHistory.esm.js +2 -0
  124. package/dist/components/GroupSelectorBUI/usePreviousSelectedGroups.esm.js +2 -0
  125. package/dist/components/HierarchicalTechInsightsPage/HierarchicalTechInsightsPage.esm.js +1 -1
  126. package/dist/components/HierarchicalTechInsightsPage/HierarchyTable.esm.js +1 -1
  127. package/dist/components/HierarchicalTechInsightsPage/SelectedNodeSidebar.esm.js +1 -1
  128. package/dist/components/HierarchicalTechInsightsPage/visualizations/hierarchyToNivo.esm.js +1 -1
  129. package/dist/components/ImportExportPanel/ImportExportPanelBUI.esm.js +2 -0
  130. package/dist/components/ImportExportPanel/{ImportExportPanel.esm.js → ImportExportPanelDeprecated.esm.js} +2 -2
  131. package/dist/components/LevelUpParty/LevelUpParty.esm.js +1 -1
  132. package/dist/components/LevelsTable/CheckRowContent.esm.js +1 -1
  133. package/dist/components/ListPageCustomActions/ListPageCustomActions.esm.js +1 -1
  134. package/dist/components/Menus/SimpleMenu.esm.js +2 -0
  135. package/dist/components/Menus/useCampaignActions.esm.js +2 -0
  136. package/dist/components/Menus/useCheckActions.esm.js +2 -0
  137. package/dist/components/Menus/useTrackActions.esm.js +2 -0
  138. package/dist/components/OverviewTable/Cell/CheckCellTooltip.esm.js +1 -1
  139. package/dist/components/OverviewTable/Cell/CheckLabelCell.esm.js +1 -1
  140. package/dist/components/OverviewTable/OverviewTable.esm.js +1 -1
  141. package/dist/components/OverviewTable/ResultsTable.esm.js +1 -1
  142. package/dist/components/PageCustomActions/PageCustomActions.esm.js +1 -1
  143. package/dist/components/PassRateTable/PassRateTable.esm.js +1 -1
  144. package/dist/components/QuickstartPage/QuickstartPage.esm.js +2 -2
  145. package/dist/components/RefetchingIndicator/RefetchingIndicator.esm.js +1 -1
  146. package/dist/components/Router.esm.js +1 -1
  147. package/dist/components/RoutingPage/RoutingMainMenu.esm.js +2 -0
  148. package/dist/components/RoutingPage/RoutingPage.esm.js +1 -1
  149. package/dist/components/RoutingPage/RoutingPageBUI.esm.js +2 -0
  150. package/dist/components/RoutingPage/RoutingPageDeprecated.esm.js +2 -0
  151. package/dist/components/RoutingPage/RoutingPageWrapper.esm.js +2 -0
  152. package/dist/components/RoutingPage/RoutingPageWrapperBUI.esm.js +2 -0
  153. package/dist/components/RoutingPage/RoutingPageWrapperDeprecated.esm.js +2 -0
  154. package/dist/components/RoutingPage/index.esm.js +1 -1
  155. package/dist/components/SendCampaignNotificationDialog/SendCampaignNotificationDialog.esm.js +1 -1
  156. package/dist/components/SoundcheckHeader/SoundcheckHeaderBUI.esm.js +2 -0
  157. package/dist/components/SoundcheckMarkdownContent/ComponentRenders.esm.js +1 -1
  158. package/dist/components/SoundcheckMarkdownContent/SoundcheckMarkdownContentBUI.esm.js +2 -0
  159. package/dist/components/SoundcheckMarkdownContent/SoundcheckMarkdownContentDeprecated.esm.js +2 -0
  160. package/dist/components/StatusBar/StatusBar.esm.js +2 -0
  161. package/dist/components/SummaryCard/SummaryCard.esm.js +1 -1
  162. package/dist/components/TableRowWithOwner/TableRowWithOwner.esm.js +1 -1
  163. package/dist/components/TechHealth/Filters/FacetFilter.esm.js +1 -1
  164. package/dist/components/TechHealth/Filters/useFacetOptions.esm.js +1 -1
  165. package/dist/components/TechHealth/Loading/TechHealthLoading.esm.js +1 -1
  166. package/dist/components/TechHealth/TechHealth.esm.js +1 -1
  167. package/dist/components/TechHealthSummary/SummaryAggregationsProvider.esm.js +1 -1
  168. package/dist/components/TechHealthTabs/CampaignResultsTab/CampaignResultsTab.esm.js +1 -1
  169. package/dist/components/TechHealthTabs/CheckResultsTab/CheckResultsTab.esm.js +1 -1
  170. package/dist/components/TechHealthTabs/EntityResultsTab/EntityResultsTab.esm.js +1 -1
  171. package/dist/components/TechHealthTabs/GroupResultsTab/GroupResultsTab.esm.js +1 -1
  172. package/dist/components/TechHealthTabs/NameColumn.esm.js +1 -1
  173. package/dist/components/TechHealthTabs/TrackResultsTab/TrackResultsTab.esm.js +1 -1
  174. package/dist/components/TechInsights/SummaryTiles.esm.js +1 -1
  175. package/dist/components/TechInsights/SummaryTilesBUI.esm.js +2 -0
  176. package/dist/components/TechInsights/TechInsightsPage.esm.js +1 -1
  177. package/dist/components/TechInsights/TechInsightsPageBUI.esm.js +2 -0
  178. package/dist/components/TechInsights/TechInsightsPageDeprecated.esm.js +2 -0
  179. package/dist/components/TechInsights/TechInsightsTableBUI.esm.js +1 -1
  180. package/dist/components/TechInsights/TechInsightsTableView.esm.js +1 -1
  181. package/dist/components/TechInsightsExplorerTable/TechInsightsExplorerTable.esm.js +2 -0
  182. package/dist/components/TechInsightsGroupSelector/TechInsightsGroupSelector.esm.js +1 -1
  183. package/dist/components/TimePeriodBar/TimePeriodBar.esm.js +1 -1
  184. package/dist/components/TimePeriodBar/TimePeriodBarBUI.esm.js +2 -0
  185. package/dist/components/TopAndBottomPerformingTeams/TopAndBottomPerformingTeams.esm.js +2 -0
  186. package/dist/components/TopFailingChecksTable/TopFailingChecksTableBUI.esm.js +1 -1
  187. package/dist/components/TrackCreatePage/TrackCreatePage.esm.js +1 -1
  188. package/dist/components/TrackEditPage/TrackEditPage.esm.js +1 -1
  189. package/dist/components/TrackEditPage/TrackEditView.esm.js +1 -1
  190. package/dist/components/TrackForm/TrackForm.esm.js +1 -1
  191. package/dist/components/TrackForm/utils/useTrackForm.esm.js +1 -1
  192. package/dist/components/TrackPage/TrackEntitiesTable/TrackEntitiesTableBUI.esm.js +1 -1
  193. package/dist/components/TrackPage/TrackHistoryChartBUI.esm.js +2 -0
  194. package/dist/components/TrackPage/TrackPageBUI.esm.js +1 -1
  195. package/dist/components/TrackPage/TrackPageDeprecated.esm.js +1 -1
  196. package/dist/components/TrackPage/TrackStatusBarBUI.esm.js +2 -0
  197. package/dist/components/TrackPage/TrackStatusTableBUI.esm.js +2 -0
  198. package/dist/components/TrackPage/TrackTechInsightsExplorerPage.esm.js +2 -0
  199. package/dist/components/TrackSelection/TrackSelection.esm.js +1 -1
  200. package/dist/components/TracksPage/TrackListPage/TrackListPageDeprecated.esm.js +1 -1
  201. package/dist/components/TracksPage/TrackListPage/TrackSummaryCard.esm.js +1 -1
  202. package/dist/components/TracksPage/TracksListPageBUI.esm.js +1 -1
  203. package/dist/components/TracksPage/TracksPage.esm.js +1 -1
  204. package/dist/graphql/generated/index.esm.js +1 -0
  205. package/dist/hooks/filters/useFilters.esm.js +2 -0
  206. package/dist/hooks/groups/useGroupOptions.esm.js +1 -1
  207. package/dist/hooks/heirarchy/useGroupHierarchy.esm.js +1 -1
  208. package/dist/hooks/tracks/useTracksApplicableToGroup.esm.js +1 -1
  209. package/dist/hooks/usePagination.esm.js +1 -1
  210. package/dist/hooks/useSortTableLocalStorage.esm.js +2 -0
  211. package/dist/routes.esm.js +1 -1
  212. package/dist/utils/charts.esm.js +1 -1
  213. package/dist/utils/formStyles.esm.js +1 -1
  214. package/dist/utils/time.esm.js +1 -1
  215. package/package.json +21 -20
  216. package/dist/components/Cards/CurrentStatusCard/CurrentStatusCard.esm.js +0 -2
  217. package/dist/components/Cards/CurrentStatusCard/CurrentStatusCardRow.esm.js +0 -2
  218. package/dist/components/CheckPage/CheckInsightsPage.esm.js +0 -2
  219. package/dist/components/CheckStatusBar/CheckStatusBarCell.esm.js +0 -2
  220. package/dist/components/GroupHierarchySelector/usePreviousSelectedGroups.esm.js +0 -2
  221. package/dist/components/SoundcheckMarkdownContent/SoundcheckMarkdownContent.esm.js +0 -2
  222. package/dist/hooks/checks/useCheckStatusTotals.esm.js +0 -2
  223. package/dist/utils/checks.esm.js +0 -2
  224. /package/dist/{components/GroupHierarchySelector → utils}/getAllOwnedEntityCount.esm.js +0 -0
@@ -1,2 +1,2 @@
1
- import{jsx as t,jsxs as d}from"react/jsx-runtime";import{CodeSnippet as f}from"@backstage/core-components";import{Box as m}from"@material-ui/core";import{Children as l}from"react";import h from"react-markdown";import g from"rehype-raw";import u from"remark-gfm";import{ALLOWED_HTML_TAGS as y}from"./SoundcheckMarkdownContent.esm.js";const c=(r,e)=>e?typeof e=="string"?r+e:l.toArray(e.props?.children).reduce(c,r):r,s=r=>typeof r=="object"&&!(Symbol.iterator in Object(r))&&r.type==="summary",a={code:({className:r,children:e,...i})=>{const o=String(e).replace(/\n+$/,""),n=/language-(\w+)/.exec(r||"");return n?t(f,{language:n[1],text:o}):t("code",{className:r,...i,children:e})},details:({className:r,children:e})=>{const i=l.toArray(e),o=i.find(s),n=i.filter(p=>!s(p)).reduce(c,"");return t(m,{display:"flex",children:d("details",{className:r,children:[o??"",t(m,{marginLeft:1.5,children:t(h,{components:a,remarkPlugins:[u],rehypePlugins:[g],allowedElements:y,children:n})})]})})}};export{a as components};
1
+ import{jsx as t,jsxs as d}from"react/jsx-runtime";import{CodeSnippet as f}from"@backstage/core-components";import{Box as m}from"@material-ui/core";import{Children as l}from"react";import h from"react-markdown";import g from"rehype-raw";import u from"remark-gfm";import"./SoundcheckMarkdownContentDeprecated.esm.js";import{ALLOWED_HTML_TAGS as y}from"./SoundcheckMarkdownContentBUI.esm.js";const c=(r,e)=>e?typeof e=="string"?r+e:l.toArray(e.props?.children).reduce(c,r):r,s=r=>typeof r=="object"&&!(Symbol.iterator in Object(r))&&r.type==="summary",a={code:({className:r,children:e,...i})=>{const n=String(e).replace(/\n+$/,""),o=/language-(\w+)/.exec(r||"");return o?t(f,{language:o[1],text:n}):t("code",{className:r,...i,children:e})},details:({className:r,children:e})=>{const i=l.toArray(e),n=i.find(s),o=i.filter(p=>!s(p)).reduce(c,"");return t(m,{display:"flex",children:d("details",{className:r,children:[n??"",t(m,{marginLeft:1.5,children:t(h,{components:a,remarkPlugins:[u],rehypePlugins:[g],allowedElements:y,children:o})})]})})}};export{a as components};
2
2
  //# sourceMappingURL=ComponentRenders.esm.js.map
@@ -0,0 +1,2 @@
1
+ import{jsx as r}from"react/jsx-runtime";import{makeStyles as t}from"@material-ui/core";import n from"react-markdown";import d from"rehype-raw";import m from"remark-gfm";import"./SoundcheckMarkdownContentDeprecated.esm.js";import{components as l}from"./ComponentRenders.esm.js";const o=["h1","h2","h3","h4","h5","h6","p","div","span","a","img","table","th","td","tr","thead","tbody","ol","li","ul","details","summary","br","hr","del","pre","code","strong","em","blockquote","input"],c=t(()=>({markdown:{"& table":{borderCollapse:"collapse",border:"1px solid var(--bui-border)"},"& th, & td":{border:"1px solid var(--bui-border)",padding:"var(--bui-space-2)"},"& td":{wordBreak:"break-word",overflow:"hidden",verticalAlign:"middle",lineHeight:"1",margin:0,padding:"var(--bui-space-3) var(--bui-space-2)",borderBottom:0},"& th":{backgroundColor:"var(--bui-bg-surface-1)"},"& tr":{backgroundColor:"inherit"},"& a":{color:"var(--bui-fg-link)"},"& img":{maxWidth:"100%"},"& ul":{marginTop:"var(--bui-space-2)"},"& ol":{marginTop:"var(--bui-space-2)"},"& pre":{padding:"var(--bui-space-2)",background:"var(--bui-bg-surface-2) !important"},"& details":{width:"100%",marginBottom:"var(--bui-space-2)"},"& h1,h2,h3,h4,h5,h6":{marginBottom:"var(--bui-space-2)"}}}),{name:"SoundcheckMarkdownContent"}),p=({content:a,className:e=""})=>{const i=c();return r("div",{className:`${i.markdown} ${e}`.trim(),children:r(n,{components:l,remarkPlugins:[m],rehypePlugins:[d],allowedElements:o,children:a})})};export{o as ALLOWED_HTML_TAGS,p as SoundcheckMarkdownContentBUI};
2
+ //# sourceMappingURL=SoundcheckMarkdownContentBUI.esm.js.map
@@ -0,0 +1,2 @@
1
+ import{jsx as e}from"react/jsx-runtime";import{makeStyles as a}from"@material-ui/core";import n from"react-markdown";import d from"rehype-raw";import l from"remark-gfm";import{components as i}from"./ComponentRenders.esm.js";import{ALLOWED_HTML_TAGS as p}from"./SoundcheckMarkdownContentBUI.esm.js";const m=a(r=>({markdown:{"& table":{borderCollapse:"collapse",border:`1px solid ${r.palette.border}`},"& th, & td":{border:`1px solid ${r.palette.border}`,padding:r.spacing(1)},"& td":{wordBreak:"break-word",overflow:"hidden",verticalAlign:"middle",lineHeight:"1",margin:0,padding:r.spacing(3,2,3,2.5),borderBottom:0},"& th":{backgroundColor:r.palette.background.paper},"& tr":{backgroundColor:r.palette.background.paper},"& tr:nth-child(odd)":{backgroundColor:r.palette.background.default},"& a":{color:r.palette.link},"& img":{maxWidth:"100%"},"& ul":{marginTop:r.spacing(1)},"& ol":{marginTop:r.spacing(1)},"& pre":{background:`${r.palette.background.default} !important`},"& details":{width:"100%"},"& h1,h2,h3,h4,h5,h6":{marginBottom:r.spacing(1)}}}),{name:"SoundcheckMarkdownContent"}),c=({content:r,className:o=""})=>{const t=m();return e("div",{className:`${t.markdown} ${o}`.trim(),children:e(n,{components:i,remarkPlugins:[l],rehypePlugins:[d],allowedElements:p,children:r})})};export{c as SoundcheckMarkdownContentDeprecated};
2
+ //# sourceMappingURL=SoundcheckMarkdownContentDeprecated.esm.js.map
@@ -0,0 +1,2 @@
1
+ import{jsx as a,jsxs as n}from"react/jsx-runtime";import{Box as e,Flex as l}from"@backstage/ui";import{makeStyles as v}from"@material-ui/core";const g=v(()=>({container:{gap:"var(--bui-space-1)",width:"100%"},passedBar:{height:"var(--bui-space-1_5)",background:"var(--bui-fg-success)",border:"var(--bui-space-0_5) solid var(--bui-fg-success)",borderRadius:"var(--bui-space-1)"},failedBar:{height:"var(--bui-space-1_5)",background:"var(--bui-fg-danger)",border:"var(--bui-space-0_5) solid var(--bui-fg-danger)",borderRadius:"var(--bui-space-1)"},warningBar:{height:"var(--bui-space-1_5)",background:"var(--bui-fg-warning)",border:"var(--bui-space-0_5) solid var(--bui-fg-warning)",borderRadius:"var(--bui-space-1)"},noneBar:{height:"var(--bui-space-1_5)",background:"var(--bui-fg-disabled)",border:"var(--bui-space-0_5) solid var(--bui-fg-disabled)",borderRadius:"var(--bui-space-1)"},notReportedBar:{height:"var(--bui-space-1_5)",background:"var(--bui-fg-disabled)",border:"var(--bui-space-0_5) solid var(--bui-fg-disabled)",borderRadius:"var(--bui-space-1)"},errorBar:{height:"var(--bui-space-1_5)",background:"rgb(246, 104, 94)",border:"var(--bui-space-0_5) solid rgb(246, 104, 94)",borderRadius:"var(--bui-space-1)"}})),p=({passedPercent:s,failedPercent:d,warningPercent:o,errorPercent:b,notReportedPercent:c})=>{const r=g(),u=[s,d,o,b,c].filter(t=>!!t),i=u.length===1;return u.every(t=>t===0)?a(e,{width:"100%",className:r.noneBar}):n(l,{className:r.container,children:[!!s&&a(e,{className:r.passedBar,style:{flexGrow:s,width:i?"100%":void 0}}),!!d&&a(e,{className:r.failedBar,style:{flexGrow:d,width:i?"100%":void 0}}),!!o&&a(e,{className:r.warningBar,style:{flexGrow:o,width:i?"100%":void 0}}),!!c&&a(e,{className:r.notReportedBar,style:{flexGrow:c,width:i?"100%":void 0}}),!!b&&a(e,{className:r.errorBar,style:{flexGrow:b,width:i?"100%":void 0}})]})};export{p as StatusBar};
2
+ //# sourceMappingURL=StatusBar.esm.js.map
@@ -1,2 +1,2 @@
1
- import{jsxs as d,jsx as i,Fragment as u}from"react/jsx-runtime";import{withStyles as w,Card as v,makeStyles as f,CardHeader as C,CardContent as k,Divider as S,CardActions as N,Button as A}from"@material-ui/core";import{createStyles as B}from"@material-ui/core/styles";import{SoundcheckMarkdownContent as D}from"../SoundcheckMarkdownContent/SoundcheckMarkdownContent.esm.js";import"@backstage/core-components";import"react";import"react-markdown";import"rehype-raw";import"remark-gfm";import{SummaryCardActionsMenu as E}from"./SummaryCardActionsMenu.esm.js";const h=w(e=>B({root:{width:"100%",height:"100%",minHeight:"385px",display:"flex",flexDirection:"column",padding:e.spacing(2),position:"relative",justifyContent:"start"}}))(v),y=f(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}}})),H=({title:e,description:x,viewLabel:n="View",editLabel:l="Edit",children:g,handleDelete:p,handleArchive:s,handleEdit:t,handleView:a,handleExport:c,handleRecertify:m,viewIsPrimaryAction:b})=>{const r=y(),o=!b&&!!t;return d(h,{className:r.card,"data-testid":e,children:[i(C,{title:e,titleTypographyProps:{className:r.summaryName},action:(!!p||!!s||!!t||!!c||!!m)&&i(E,{handleView:a,handleDelete:p,handleArchive:s,handleEdit:t,handleExport:c,handleRecertify:m})}),i(k,{className:r.cardContent,children:d(u,{children:[i(D,{className:r.summaryDescription,content:x??""}),g]})}),(a||t)&&d("div",{children:[i(S,{}),i(N,{className:r.actionArea,children:i(A,{"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{h as Card,H as SummaryCard,y as useSummaryCardStyles};
1
+ import{jsxs as d,jsx as t,Fragment as u}from"react/jsx-runtime";import{withStyles as w,Card as v,makeStyles as f,CardHeader as C,CardContent as k,Divider as S,CardActions as N,Button as A}from"@material-ui/core";import{createStyles as D}from"@material-ui/core/styles";import{SoundcheckMarkdownContentDeprecated as B}from"../SoundcheckMarkdownContent/SoundcheckMarkdownContentDeprecated.esm.js";import"@backstage/core-components";import"react";import"react-markdown";import"rehype-raw";import"remark-gfm";import"../SoundcheckMarkdownContent/SoundcheckMarkdownContentBUI.esm.js";import{SummaryCardActionsMenu as E}from"./SummaryCardActionsMenu.esm.js";const h=w(e=>D({root:{width:"100%",height:"100%",minHeight:"385px",display:"flex",flexDirection:"column",padding:e.spacing(2),position:"relative",justifyContent:"start"}}))(v),y=f(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}}})),H=({title:e,description:x,viewLabel:n="View",editLabel:l="Edit",children:g,handleDelete:p,handleArchive:s,handleEdit:i,handleView:a,handleExport:c,handleRecertify:m,viewIsPrimaryAction:b})=>{const r=y(),o=!b&&!!i;return d(h,{className:r.card,"data-testid":e,children:[t(C,{title:e,titleTypographyProps:{className:r.summaryName},action:(!!p||!!s||!!i||!!c||!!m)&&t(E,{handleView:a,handleDelete:p,handleArchive:s,handleEdit:i,handleExport:c,handleRecertify:m})}),t(k,{className:r.cardContent,children:d(u,{children:[t(B,{className:r.summaryDescription,content:x??""}),g]})}),(a||i)&&d("div",{children:[t(S,{}),t(N,{className:r.actionArea,children:t(A,{"aria-label":o?l:n,"data-testid":`${e}-button`,size:"medium",role:"link",onClick:o?i:a,disabled:!a&&!i,className:r.button,variant:"outlined",children:o?l:n})})]})]})};export{h as Card,H as SummaryCard,y as useSummaryCardStyles};
2
2
  //# sourceMappingURL=SummaryCard.esm.js.map
@@ -1,2 +1,2 @@
1
- import{jsxs as g,jsx as i}from"react/jsx-runtime";import{useApi as y}from"@backstage/core-plugin-api";import{entityPresentationApiRef as C}from"@backstage/plugin-catalog-react";import{Row as h,Cell as n,CellProfile as R}from"@backstage/ui";import{RiMore2Line as d}from"@remixicon/react";import{isEmpty as k}from"lodash";import{useNavigate as w}from"react-router-dom";const P=({ownerEntityRef:t,href:r,profileImageSrc:l,cells:m,actions:p})=>{const s=y(C),e=t?s.forEntity(t):void 0,a=w();return g(h,{onAction:()=>r&&a(r),children:[m.map((o,c)=>i(n,{title:o.title,leadingIcon:o.icon,onClick:f=>{o.onClick&&(f.stopPropagation(),o.onClick())}},`cell-${c}`)),i(R,{name:e?.snapshot.primaryTitle,src:l??e?.snapshot.primaryTitle}),!k(p)&&i(n,{title:"",onClick:o=>o.stopPropagation(),leadingIcon:i(d,{size:16})})]})};export{P as TableRowWithOwner};
1
+ import{jsxs as C,jsx as i}from"react/jsx-runtime";import{useApi as h}from"@backstage/core-plugin-api";import{entityPresentationApiRef as g}from"@backstage/plugin-catalog-react";import{Row as R,Cell as y,CellProfile as A}from"@backstage/ui";import{useNavigate as k}from"react-router-dom";import{CustomCell as w}from"../CustomCell/CustomCell.esm.js";import{DescriptionCell as P}from"../DescriptionCell/DescriptionCell.esm.js";import{SimpleMenu as x}from"../Menus/SimpleMenu.esm.js";import"@backstage/plugin-permission-react";import"@remixicon/react";import"@spotify/backstage-plugin-soundcheck-common";import"react";import"@backstage/catalog-model";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import"../../hooks/useSoundcheckAlert.esm.js";import"../../hooks/useConfirmationModal.esm.js";import"react-use/lib/useLocalStorage";import"../../routes.esm.js";import"js-yaml";import"lodash";import"../../contexts/TrackFormContext.esm.js";import"../../contexts/CheckFormContext.esm.js";import"../../contexts/CampaignFormContext.esm.js";import"../../contexts/UserProvider.esm.js";import"uuid";import"../CampaignsPage/CampaignListPage/useArchiveConfirmationModal.esm.js";const T=({ownerEntityRef:t,href:r,profileImageSrc:p,cells:n,menuActions:m,name:l,description:c,documentationURL:s})=>{const a=h(g),e=t?a.forEntity(t):void 0,f=k();return C(R,{onAction:()=>r&&f(r),children:[i(P,{title:l,description:c,documentationURL:s}),n.map((o,d)=>i(y,{title:o.title,leadingIcon:o.icon,onClick:u=>{o.onClick&&(u.stopPropagation(),o.onClick())}},`cell-${d}`)),i(A,{name:e?.snapshot.primaryTitle,src:p??e?.snapshot.primaryTitle}),i(w,{onClick:o=>o.stopPropagation(),children:i(x,{disabled:!m?.length,placement:"left top",menuActions:m??[]})})]})};export{T as TableRowWithOwner};
2
2
  //# sourceMappingURL=TableRowWithOwner.esm.js.map
@@ -1,2 +1,2 @@
1
- import{jsx as n,jsxs as S}from"react/jsx-runtime";import{makeStyles as L,alpha as y,Box as h,Chip as I,TextField as O,FormControlLabel as w,Checkbox as E}from"@material-ui/core";import T from"@material-ui/icons/CheckBox";import z from"@material-ui/icons/CheckBoxOutlineBlank";import{Autocomplete as j}from"@material-ui/lab";import{remove as N}from"lodash";import{useState as m,useEffect as P,useCallback as g,useMemo as V}from"react";import{CollapsablePanel as W}from"../../CollapsablePanel/CollapsablePanel.esm.js";import{ListboxVirtualized as B}from"../../ListboxVirtualized/ListboxVirtualized.esm.js";import{useFilterContext as D}from"./FilterProvider.esm.js";import{Facet as b,facetTooltips as H}from"./types.esm.js";const $=L(({palette:e,spacing:o})=>({chip:{maxWidth:"45%",textOverflow:"ellipsis",margin:o(.5,.5,.5,0),overflow:"hidden","& svg":{color:y(e.common.white,.7),"&:hover":{color:e.common.white}},backgroundColor:e.action.disabledBackground},autoCompleteInput:{"&& input":{margin:o(1,0,0,0),padding:`${o(0,1,1,1)} !important`,width:"100%",display:"flex",alignItems:"center",justifyContent:"center"},"&& button":{"&:hover":{backgroundColor:"transparent"}}},autoComplete:{margin:o(.5,0,1,0)},selectionLabel:{lineHeight:"1em"}})),q=({facet:e})=>{const o=$(),{getFacetOptions:C,getFacetOptionLabel:r,getSelectedFacetValues:i,setSelectedFacetValues:p}=D(),[x,d]=m(!1),[k,u]=m(!1),[F,f]=m("");P(()=>{d(!!i(e)?.length)},[i,e]);const s=g(t=>{if(e===b.Entity&&t[t.length-1]){const l=t[t.length-1];if(!l.includes(":")||!l.includes("/")){u(!0),f("Custom entities require a valid kind and namespace such as: component:default/entity");return}}u(!1),f(""),p(e,t)},[e,p]),a=V(()=>i(e),[e,i]),v=g(t=>{const l=[...a];N(l,c=>c===t),s(l)},[a,s]);return n(W,{label:e,tooltip:H[e],isExpanded:x,setIsExpanded:d,children:S(h,{children:[n(h,{children:a.map(t=>n(I,{label:r(e,t),size:"small",className:o.chip,onDelete:()=>v(t),clickable:!1},t))}),n(j,{className:o.autoComplete,disableCloseOnSelect:!0,fullWidth:!0,multiple:!0,freeSolo:e===b.Entity,popupIcon:null,renderTags:()=>null,options:C(e),getOptionLabel:t=>r(e,t),value:a,onChange:(t,l)=>s(l),ListboxComponent:B,ListboxProps:{itemHeight:50},renderInput:t=>n(O,{...t,className:o.autoCompleteInput,placeholder:`Search for ${e}`,error:k,helperText:F}),renderOption:(t,{selected:l})=>n(w,{onClick:c=>c.preventDefault(),control:n(E,{icon:n(z,{fontSize:"small"}),checkedIcon:n(T,{fontSize:"small"}),checked:l}),classes:{label:o.selectionLabel},label:r(e,t)})})]})})};export{q as FacetFilter};
1
+ import{jsx as n,jsxs as S}from"react/jsx-runtime";import{makeStyles as L,alpha as y,Box as h,Chip as I,TextField as O,FormControlLabel as w,Checkbox as z}from"@material-ui/core";import E from"@material-ui/icons/CheckBox";import T from"@material-ui/icons/CheckBoxOutlineBlank";import{Autocomplete as j}from"@material-ui/lab";import{remove as N}from"lodash";import{useState as m,useEffect as V,useCallback as g,useMemo as W}from"react";import{CollapsablePanel as B}from"../../CollapsablePanel/CollapsablePanel.esm.js";import{ListboxVirtualized as D}from"../../ListboxVirtualized/ListboxVirtualized.esm.js";import{useFilterContext as H}from"./FilterProvider.esm.js";import{Facet as b,facetTooltips as P}from"./types.esm.js";const $=L(({palette:e,spacing:o})=>({chip:{maxWidth:"45%",textOverflow:"ellipsis",margin:o(.5,.5,.5,0),overflow:"hidden","& svg":{color:y(e.common.white,.7),"&:hover":{color:e.common.white}},backgroundColor:e.action.disabledBackground},autoCompleteInput:{"&& input":{margin:o(1,0,0,0),padding:`${o(0,1,1,1)} !important`,width:"100%",display:"flex",alignItems:"center",justifyContent:"center"},"&& button":{"&:hover":{backgroundColor:"transparent"}}},autoComplete:{margin:o(.5,0,1,0)},selectionLabel:{lineHeight:"1em"}})),q=({facet:e})=>{const o=$(),{getFacetOptions:C,getFacetOptionLabel:r,getSelectedFacetValues:i,setSelectedFacetValues:p}=H(),[x,d]=m(!1),[k,u]=m(!1),[F,f]=m("");V(()=>{d(!!i(e)?.length)},[i,e]);const s=g(t=>{if(e===b.Entity&&t[t.length-1]){const l=t[t.length-1];if(!l.includes(":")||!l.includes("/")){u(!0),f("Custom entities require a valid kind and namespace such as: component:default/entity");return}}u(!1),f(""),p(e,t)},[e,p]),a=W(()=>i(e),[e,i]),v=g(t=>{const l=[...a];N(l,c=>c===t),s(l)},[a,s]);return n(B,{label:e,tooltip:P[e],isExpanded:x,setIsExpanded:d,children:S(h,{children:[n(h,{children:a.map(t=>n(I,{label:r(e,t),size:"small",className:o.chip,onDelete:()=>v(t),clickable:!1},t))}),n(j,{className:o.autoComplete,disableCloseOnSelect:!0,fullWidth:!0,multiple:!0,freeSolo:e===b.Entity,popupIcon:null,renderTags:()=>null,options:C(e),getOptionLabel:t=>r(e,t),value:a,onChange:(t,l)=>s(l),ListboxComponent:D,ListboxProps:{itemHeight:50},renderInput:t=>n(O,{...t,className:o.autoCompleteInput,placeholder:`Search for ${e}`,error:k,helperText:F}),renderOption:(t,{selected:l})=>n(w,{onClick:c=>c.preventDefault(),control:n(z,{icon:n(T,{fontSize:"small"}),checkedIcon:n(E,{fontSize:"small"}),checked:l}),classes:{label:o.selectionLabel},label:r(e,t)})})]})})};export{q as FacetFilter};
2
2
  //# sourceMappingURL=FacetFilter.esm.js.map
@@ -1,2 +1,2 @@
1
- import{parseEntityRef as T}from"@backstage/catalog-model";import C from"lodash";import{useState as $,useMemo as l,useEffect as A}from"react";import"../../../contexts/TrackFormContext.esm.js";import"../../../contexts/CheckFormContext.esm.js";import"../../../contexts/CampaignFormContext.esm.js";import"react/jsx-runtime";import{useLoggedInUser as S}from"../../../contexts/UserProvider.esm.js";import"@backstage/core-plugin-api";import"@tanstack/react-query";import"../../../api.esm.js";import"../../../hooks/graphqlKeys.esm.js";import{useAllGroups as x}from"../../../hooks/groups/useAllGroups.esm.js";import"@backstage/plugin-catalog-react";import"@spotify/backstage-plugin-soundcheck-common";import{useGetChecks as U}from"../../../hooks/checks/useGetChecks.esm.js";import"../../../hooks/useSoundcheckAlert.esm.js";import{useGetAllTracks as q}from"../../../hooks/tracks/useGetAllTracks.esm.js";import"../../../hooks/useConfirmationModal.esm.js";import"react-router-dom";import{useGetEntityFacets as f}from"../../../hooks/catalog/useGetEntityFacets.esm.js";import{useEntityRefsForUser as B}from"../../../hooks/entities/useEntityRefsForUser.esm.js";import{Facet as s}from"./types.esm.js";const I=(i,o)=>{const a=[];for(const r of i)a.push({label:r.name??r.id,value:r.id});const e=i.map(r=>r.id);for(const r of o)for(const m of r.levels??[])for(const n of m.checks??[])e.includes(n.id)||(e.push(n.id),a.push({label:n.name??n.id,value:n.id}));return a},K=i=>{const o=[];for(const a of i??[])for(const e of a.levels??[])o.includes(e.ordinal)||o.push(e.ordinal);return o.sort().map(a=>({label:`Level ${a}`,value:`${a}`}))},M=(i,o)=>{const a=new Set(i.filter(e=>e.ownerEntityRef).map(e=>e.ownerEntityRef));return Array.from(a).map(e=>({label:o[e]??e,value:e}))},d=i=>(i??[]).map(o=>({label:o,value:o})),V=()=>{const[i,o]=$(!1),{userEntityRef:a}=S(),{data:e,isLoading:r}=B(a),{data:m,isLoading:n}=x(),u=l(()=>C.mapValues(C.keyBy(m??[],"ref"),t=>t.name),[m]),{data:y,isLoading:g}=q({first:100}),p=l(()=>y?.edges.map(t=>t.node)??[],[y]),{data:L,isLoading:v}=U({first:100}),c=l(()=>L?.edges.map(t=>t.node)??[],[L]),{data:E,isLoading:b}=f("kind"),{data:h,isLoading:k}=f("spec.lifecycle"),{data:R,isLoading:w}=f("spec.type"),{data:F,isLoading:O}=f("spec.system"),G=l(()=>({[s.Kind]:d(E),[s.Lifecycle]:d(h),[s.Type]:d(R),[s.System]:d(F),[s.Entity]:e.map(t=>({label:T(t).name,value:t})),[s.EntityOwner]:m?.map(t=>({label:t.name,value:t.ref}))??[],[s.Track]:p.map(t=>({label:t.name,value:t.id})),[s.Level]:K(p),[s.Check]:I(c,p),[s.CheckOwner]:M(c,u)}),[E,h,R,e,m,u,p,c,F]);return A(()=>{o(b||k||w||r||n||g||v||O)},[b,k,w,r,n,g,v,O]),{facetOptions:G,isLoading:i}};export{V as useFacetOptions};
1
+ import{parseEntityRef as T}from"@backstage/catalog-model";import C from"lodash";import{useState as $,useMemo as l,useEffect as A}from"react";import"../../../contexts/TrackFormContext.esm.js";import"../../../contexts/CheckFormContext.esm.js";import"../../../contexts/CampaignFormContext.esm.js";import"react/jsx-runtime";import{useLoggedInUser as S}from"../../../contexts/UserProvider.esm.js";import"@backstage/core-plugin-api";import"@tanstack/react-query";import"../../../api.esm.js";import"../../../hooks/graphqlKeys.esm.js";import{useAllGroups as x}from"../../../hooks/groups/useAllGroups.esm.js";import"@backstage/plugin-catalog-react";import"@spotify/backstage-plugin-soundcheck-common";import{useGetChecks as U}from"../../../hooks/checks/useGetChecks.esm.js";import"../../../hooks/useSoundcheckAlert.esm.js";import{useGetAllTracks as q}from"../../../hooks/tracks/useGetAllTracks.esm.js";import"../../../hooks/useConfirmationModal.esm.js";import"react-router-dom";import"react-use/lib/useLocalStorage";import{useGetEntityFacets as f}from"../../../hooks/catalog/useGetEntityFacets.esm.js";import{useEntityRefsForUser as B}from"../../../hooks/entities/useEntityRefsForUser.esm.js";import{Facet as s}from"./types.esm.js";const I=(i,o)=>{const a=[];for(const r of i)a.push({label:r.name??r.id,value:r.id});const e=i.map(r=>r.id);for(const r of o)for(const m of r.levels??[])for(const n of m.checks??[])e.includes(n.id)||(e.push(n.id),a.push({label:n.name??n.id,value:n.id}));return a},K=i=>{const o=[];for(const a of i??[])for(const e of a.levels??[])o.includes(e.ordinal)||o.push(e.ordinal);return o.sort().map(a=>({label:`Level ${a}`,value:`${a}`}))},M=(i,o)=>{const a=new Set(i.filter(e=>e.ownerEntityRef).map(e=>e.ownerEntityRef));return Array.from(a).map(e=>({label:o[e]??e,value:e}))},d=i=>(i??[]).map(o=>({label:o,value:o})),V=()=>{const[i,o]=$(!1),{userEntityRef:a}=S(),{data:e,isLoading:r}=B(a),{data:m,isLoading:n}=x(),u=l(()=>C.mapValues(C.keyBy(m??[],"ref"),t=>t.name),[m]),{data:y,isLoading:g}=q({first:100}),p=l(()=>y?.edges.map(t=>t.node)??[],[y]),{data:L,isLoading:v}=U({first:100}),c=l(()=>L?.edges.map(t=>t.node)??[],[L]),{data:E,isLoading:b}=f("kind"),{data:h,isLoading:k}=f("spec.lifecycle"),{data:R,isLoading:w}=f("spec.type"),{data:F,isLoading:O}=f("spec.system"),G=l(()=>({[s.Kind]:d(E),[s.Lifecycle]:d(h),[s.Type]:d(R),[s.System]:d(F),[s.Entity]:e.map(t=>({label:T(t).name,value:t})),[s.EntityOwner]:m?.map(t=>({label:t.name,value:t.ref}))??[],[s.Track]:p.map(t=>({label:t.name,value:t.id})),[s.Level]:K(p),[s.Check]:I(c,p),[s.CheckOwner]:M(c,u)}),[E,h,R,e,m,u,p,c,F]);return A(()=>{o(b||k||w||r||n||g||v||O)},[b,k,w,r,n,g,v,O]),{facetOptions:G,isLoading:i}};export{V as useFacetOptions};
2
2
  //# sourceMappingURL=useFacetOptions.esm.js.map
@@ -1,2 +1,2 @@
1
- import{jsxs as l,jsx as o}from"react/jsx-runtime";import{makeStyles as a,Typography as i}from"@material-ui/core";import{useEntityCountCached as d}from"../../../hooks/cache/useEntityCountCached.esm.js";import{useTrackCountCached as c}from"../../../hooks/cache/useTrackCountCached.esm.js";import{Loading as s}from"./Loading.esm.js";const u=a(e=>({container:{display:"flex",margin:"-24px",backgroundColor:e.palette.background.paper,borderTop:`1px solid ${e.palette.border}`,flex:1},fixedColumn:{width:"300px",flex:"none",borderRight:`1px solid ${e.palette.border}`},flexibleColumn:{display:"flex",flexDirection:"column",flex:1,backgroundColor:e.palette.background.default,height:"100%",maxWidth:"100%"},tabsPlaceholder:{height:"36.5px",backgroundColor:e.palette.background.paper}})),p=({text:e,entityCount:r,trackCount:n})=>{const t=[];return t.push(o(i,{style:{fontSize:"1.1rem"},children:e??"Loading..."})),r!==null&&(t.push(o("div",{})),t.push(l(i,{style:{fontSize:"1.1rem"},children:["Processing ",r," entities..."]}))),n!==null&&(t.push(o("div",{})),t.push(l(i,{style:{fontSize:"1.1rem"},children:["Processing ",n," tracks..."]}))),o("div",{children:t})},h=({loadingText:e})=>{const r=u(),{entityCount:n}=d(),{trackCount:t}=c();return l("div",{className:r.container,children:[o("div",{className:r.fixedColumn}),l("div",{className:r.flexibleColumn,children:[o("div",{className:r.tabsPlaceholder}),o(s,{children:o(p,{text:e,entityCount:n,trackCount:t})})]})]})};export{h as TechHealthLoading};
1
+ import{jsxs as i,jsx as o}from"react/jsx-runtime";import{makeStyles as a,Typography as l}from"@material-ui/core";import{useEntityCountCached as c}from"../../../hooks/cache/useEntityCountCached.esm.js";import{useTrackCountCached as d}from"../../../hooks/cache/useTrackCountCached.esm.js";import{Loading as s}from"./Loading.esm.js";const u=a(e=>({container:{display:"flex",margin:"-24px",backgroundColor:e.palette.background.paper,borderTop:`1px solid ${e.palette.border}`,flex:1},fixedColumn:{width:"300px",flex:"none",borderRight:`1px solid ${e.palette.border}`},flexibleColumn:{display:"flex",flexDirection:"column",flex:1,backgroundColor:e.palette.background.default,height:"100%",maxWidth:"100%"},tabsPlaceholder:{height:"36.5px",backgroundColor:e.palette.background.paper}})),p=({text:e,entityCount:r,trackCount:n})=>{const t=[];return t.push(o(l,{style:{fontSize:"1.1rem"},children:e??"Loading..."},"text")),r!==null&&(t.push(o("div",{},"spacer-entity")),t.push(i(l,{style:{fontSize:"1.1rem"},children:["Processing ",r," entities..."]},"entityCount"))),n!==null&&(t.push(o("div",{},"spacer-track")),t.push(i(l,{style:{fontSize:"1.1rem"},children:["Processing ",n," tracks..."]},"trackCount"))),o("div",{children:t})},h=({loadingText:e})=>{const r=u(),{entityCount:n}=c(),{trackCount:t}=d();return i("div",{className:r.container,children:[o("div",{className:r.fixedColumn}),i("div",{className:r.flexibleColumn,children:[o("div",{className:r.tabsPlaceholder}),o(s,{children:o(p,{text:e,entityCount:n,trackCount:t})})]})]})};export{h as TechHealthLoading};
2
2
  //# sourceMappingURL=TechHealthLoading.esm.js.map
@@ -1,2 +1,2 @@
1
- import{jsx as e,jsxs as a}from"react/jsx-runtime";import{TabbedLayout as i}from"@backstage/core-components";import{useApi as p,featureFlagsApiRef as l}from"@backstage/core-plugin-api";import{makeStyles as n,Box as s}from"@material-ui/core";import{Routes as c,Route as d}from"react-router-dom";import{useLCPReporting as u}from"../../hooks/useLCPReporting.esm.js";import"../SoundcheckHeader/SoundcheckHeader.esm.js";import"../SoundcheckHeader/SoundcheckHeaderContext.esm.js";import{useSetHeaderDefault as h}from"../SoundcheckHeader/useHeader.esm.js";import{TechHealthSummary as f}from"../TechHealthSummary/TechHealthSummary.esm.js";import"../SoundcheckMarkdownContent/SoundcheckMarkdownContent.esm.js";import"react";import"react-markdown";import"rehype-raw";import"remark-gfm";import"../TechHealthTabs/PassRateTabStyles.esm.js";import"../StyledTooltip/StyledTooltip.esm.js";import"../TechHealthTabs/OwnerColumn.esm.js";import{TrackResultsTab as x}from"../TechHealthTabs/TrackResultsTab/TrackResultsTab.esm.js";import{EntityResultsTab as b}from"../TechHealthTabs/EntityResultsTab/EntityResultsTab.esm.js";import{GroupResultsTab as g}from"../TechHealthTabs/GroupResultsTab/GroupResultsTab.esm.js";import{CampaignResultsTab as R}from"../TechHealthTabs/CampaignResultsTab/CampaignResultsTab.esm.js";import{CheckResultsTab as k}from"../TechHealthTabs/CheckResultsTab/CheckResultsTab.esm.js";import"./Filters/types.esm.js";import"./Filters/FacetFilter.esm.js";import{FilterProvider as C}from"./Filters/FilterProvider.esm.js";import{Filters as T}from"./Filters/Filters.esm.js";import"./Filters/FiltersHeader.esm.js";import"./Filters/FiltersSection.esm.js";import"@backstage/catalog-model";import"lodash";import"../../contexts/TrackFormContext.esm.js";import"../../contexts/CheckFormContext.esm.js";import"../../contexts/CampaignFormContext.esm.js";import"../../contexts/UserProvider.esm.js";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"@spotify/backstage-plugin-soundcheck-common";import"../../hooks/useSoundcheckAlert.esm.js";import"../../hooks/useConfirmationModal.esm.js";const y=n(t=>({container:{display:"flex",margin:"-24px",backgroundColor:t.palette.background.paper,borderTop:`1px solid ${t.palette.border}`,flex:1},fixedColumn:{width:"300px",flex:"none",borderRight:`1px solid ${t.palette.divider}`},flexibleColumn:{display:"flex",flexDirection:"column",flex:1,backgroundColor:t.palette.background.paper,height:"100%",maxWidth:"100%"},pageLayout:{display:"flex",flexDirection:"column",flex:"1 1 0%",backgroundColor:t.palette.background.default,"& > article":{display:"flex",flexDirection:"column",flex:"1 1 auto",borderTop:`1px solid ${t.palette.border}`,padding:`${t.spacing(3)}px !important`}}})),v=()=>{h();const t=y(),r=p(l),o=!r.getRegisteredFlags().find(m=>m.name==="soundcheck-enable-campaigns")||r.isActive("soundcheck-enable-campaigns");return u({routeName:"soundcheck-tech-health",additionalAttributes:{campaignsEnabled:o.toString()}}),e(C,{children:a("div",{className:t.container,children:[e("div",{className:t.fixedColumn,children:e(T,{})}),e("div",{className:t.flexibleColumn,children:e(s,{className:t.pageLayout,"aria-label":"tech health tabs",children:e(c,{children:e(d,{path:"/*",element:a(i,{children:[e(i.Route,{title:"Summary",path:"/",children:e(f,{})}),o&&e(i.Route,{title:"Campaigns",path:"/campaigns",children:e(R,{})}),e(i.Route,{title:"Checks",path:"/checks",children:e(k,{})}),e(i.Route,{title:"Tracks",path:"/tracks",children:e(x,{})}),e(i.Route,{title:"Entities",path:"/entities",children:e(b,{})}),e(i.Route,{title:"Teams",path:"/teams",children:e(g,{})})]})})})})})]})})};export{v as TechHealth};
1
+ import{jsxs as r,jsx as e}from"react/jsx-runtime";import{DismissableBanner as p,TabbedLayout as i}from"@backstage/core-components";import{useApi as m,featureFlagsApiRef as n}from"@backstage/core-plugin-api";import{makeStyles as s,Typography as c,Box as d}from"@material-ui/core";import{Routes as h,Route as u}from"react-router-dom";import{useLCPReporting as f}from"../../hooks/useLCPReporting.esm.js";import"../SoundcheckHeader/SoundcheckHeader.esm.js";import"../SoundcheckHeader/SoundcheckHeaderContext.esm.js";import{useSetHeaderDefault as g}from"../SoundcheckHeader/useHeader.esm.js";import{TechHealthSummary as b}from"../TechHealthSummary/TechHealthSummary.esm.js";import"../SoundcheckMarkdownContent/SoundcheckMarkdownContentDeprecated.esm.js";import"react";import"react-markdown";import"rehype-raw";import"remark-gfm";import"../SoundcheckMarkdownContent/SoundcheckMarkdownContentBUI.esm.js";import"../TechHealthTabs/PassRateTabStyles.esm.js";import"../StyledTooltip/StyledTooltip.esm.js";import"../TechHealthTabs/OwnerColumn.esm.js";import{TrackResultsTab as x}from"../TechHealthTabs/TrackResultsTab/TrackResultsTab.esm.js";import{EntityResultsTab as R}from"../TechHealthTabs/EntityResultsTab/EntityResultsTab.esm.js";import{GroupResultsTab as T}from"../TechHealthTabs/GroupResultsTab/GroupResultsTab.esm.js";import{CampaignResultsTab as k}from"../TechHealthTabs/CampaignResultsTab/CampaignResultsTab.esm.js";import{CheckResultsTab as y}from"../TechHealthTabs/CheckResultsTab/CheckResultsTab.esm.js";import"./Filters/types.esm.js";import"./Filters/FacetFilter.esm.js";import{FilterProvider as C}from"./Filters/FilterProvider.esm.js";import{Filters as v}from"./Filters/Filters.esm.js";import"./Filters/FiltersHeader.esm.js";import"./Filters/FiltersSection.esm.js";import"@backstage/catalog-model";import"lodash";import"../../contexts/TrackFormContext.esm.js";import"../../contexts/CheckFormContext.esm.js";import"../../contexts/CampaignFormContext.esm.js";import"../../contexts/UserProvider.esm.js";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"@spotify/backstage-plugin-soundcheck-common";import"../../hooks/useSoundcheckAlert.esm.js";import"../../hooks/useConfirmationModal.esm.js";import"react-use/lib/useLocalStorage";const w=s(t=>({container:{display:"flex",margin:"-24px",backgroundColor:t.palette.background.paper,borderTop:`1px solid ${t.palette.border}`,flex:1},fixedColumn:{width:"300px",flex:"none",borderRight:`1px solid ${t.palette.divider}`},flexibleColumn:{display:"flex",flexDirection:"column",flex:1,backgroundColor:t.palette.background.paper,height:"100%",maxWidth:"100%"},pageLayout:{display:"flex",flexDirection:"column",flex:"1 1 0%",backgroundColor:t.palette.background.default,"& > article":{display:"flex",flexDirection:"column",flex:"1 1 auto",borderTop:`1px solid ${t.palette.border}`,padding:`${t.spacing(3)}px !important`}},warning:{margin:"0 -24px"}})),N=()=>{g();const t=w(),o=m(n),a=!o.getRegisteredFlags().find(l=>l.name==="soundcheck-enable-campaigns")||o.isActive("soundcheck-enable-campaigns");return f({routeName:"soundcheck-tech-health",additionalAttributes:{campaignsEnabled:a.toString()}}),r(C,{children:[e("div",{className:t.warning,children:e(p,{id:"sunset-tech-health-banner",variant:"warning",message:e(c,{variant:"body2",children:"The Tech Health page will be retired in an upcoming release. Please use the new Tech Insights page for continued visibility into health data."})})}),r("div",{className:t.container,children:[e("div",{className:t.fixedColumn,children:e(v,{})}),e("div",{className:t.flexibleColumn,children:e(d,{className:t.pageLayout,"aria-label":"tech health tabs",children:e(h,{children:e(u,{path:"/*",element:r(i,{children:[e(i.Route,{title:"Summary",path:"/",children:e(b,{})}),a&&e(i.Route,{title:"Campaigns",path:"/campaigns",children:e(k,{})}),e(i.Route,{title:"Checks",path:"/checks",children:e(y,{})}),e(i.Route,{title:"Tracks",path:"/tracks",children:e(x,{})}),e(i.Route,{title:"Entities",path:"/entities",children:e(R,{})}),e(i.Route,{title:"Teams",path:"/teams",children:e(T,{})})]})})})})})]})]})};export{N as TechHealth};
2
2
  //# sourceMappingURL=TechHealth.esm.js.map
@@ -1,2 +1,2 @@
1
- import{jsx as s}from"react/jsx-runtime";import{createContext as n,useMemo as p,useContext as g}from"react";import"@backstage/catalog-model";import"@backstage/core-plugin-api";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"@spotify/backstage-plugin-soundcheck-common";import"../../hooks/useSoundcheckAlert.esm.js";import"../../hooks/useConfirmationModal.esm.js";import{useAggregatedCheckPassRateTrend as v}from"../../hooks/aggregations/useAggregatedCheckPassRateTrend.esm.js";import{useAggregatedTrackPassRateTrend as u}from"../../hooks/aggregations/useAggregatedTrackPassRateTrend.esm.js";import{useAggregatedEntityPassRateTrend as P}from"../../hooks/aggregations/useAggregatedEntityPassRateTrend.esm.js";import{useAggregatedGroupPassRateTrend as T}from"../../hooks/aggregations/useAggregatedGroupPassRateTrend.esm.js";import"react-router-dom";import"../TechHealth/Filters/types.esm.js";import"../TechHealth/Filters/FacetFilter.esm.js";import{useFilterContext as c}from"../TechHealth/Filters/FilterProvider.esm.js";import"../TechHealth/Filters/Filters.esm.js";import"../TechHealth/Filters/FiltersHeader.esm.js";import"../TechHealth/Filters/FiltersSection.esm.js";import"lodash";import"../../contexts/TrackFormContext.esm.js";import"../../contexts/CheckFormContext.esm.js";import"../../contexts/CampaignFormContext.esm.js";import"../../contexts/UserProvider.esm.js";import{Loading as R}from"../TechHealth/Loading/Loading.esm.js";const a=n({checkPassRateTrend:{data:void 0,isLoading:!0,isError:!1},trackPassRateOverviewTrend:{data:void 0,isLoading:!0,isError:!1},entityPassRatesOverviewTrends:{data:void 0,isLoading:!0,isError:!1},groupPassRatesOverviewTrends:{data:void 0,isLoading:!0,isError:!1}}),f=()=>g(a),L=m=>{const{filter:r}=c(),t=v(r),e=u(r),i=P(r),o=T({filter:r,first:5}),d=p(()=>({checkPassRateTrend:t,trackPassRateOverviewTrend:e,entityPassRatesOverviewTrends:i,groupPassRatesOverviewTrends:o}),[t,e,i,o]);return t.isLoading||e.isLoading||i.isLoading||o.isLoading?s(R,{}):s(a.Provider,{...m,value:d})};export{L as SummaryAggregationsProvider,f as useSummaryAggregationsContext};
1
+ import{jsx as s}from"react/jsx-runtime";import{createContext as n,useMemo as p,useContext as g}from"react";import"@backstage/catalog-model";import"@backstage/core-plugin-api";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"@spotify/backstage-plugin-soundcheck-common";import"../../hooks/useSoundcheckAlert.esm.js";import"../../hooks/useConfirmationModal.esm.js";import{useAggregatedCheckPassRateTrend as v}from"../../hooks/aggregations/useAggregatedCheckPassRateTrend.esm.js";import{useAggregatedTrackPassRateTrend as u}from"../../hooks/aggregations/useAggregatedTrackPassRateTrend.esm.js";import{useAggregatedEntityPassRateTrend as P}from"../../hooks/aggregations/useAggregatedEntityPassRateTrend.esm.js";import{useAggregatedGroupPassRateTrend as T}from"../../hooks/aggregations/useAggregatedGroupPassRateTrend.esm.js";import"react-router-dom";import"react-use/lib/useLocalStorage";import"../TechHealth/Filters/types.esm.js";import"../TechHealth/Filters/FacetFilter.esm.js";import{useFilterContext as c}from"../TechHealth/Filters/FilterProvider.esm.js";import"../TechHealth/Filters/Filters.esm.js";import"../TechHealth/Filters/FiltersHeader.esm.js";import"../TechHealth/Filters/FiltersSection.esm.js";import"lodash";import"../../contexts/TrackFormContext.esm.js";import"../../contexts/CheckFormContext.esm.js";import"../../contexts/CampaignFormContext.esm.js";import"../../contexts/UserProvider.esm.js";import{Loading as R}from"../TechHealth/Loading/Loading.esm.js";const a=n({checkPassRateTrend:{data:void 0,isLoading:!0,isError:!1},trackPassRateOverviewTrend:{data:void 0,isLoading:!0,isError:!1},entityPassRatesOverviewTrends:{data:void 0,isLoading:!0,isError:!1},groupPassRatesOverviewTrends:{data:void 0,isLoading:!0,isError:!1}}),f=()=>g(a),L=m=>{const{filter:r}=c(),t=v(r),e=u(r),i=P(r),o=T({filter:r,first:5}),d=p(()=>({checkPassRateTrend:t,trackPassRateOverviewTrend:e,entityPassRatesOverviewTrends:i,groupPassRatesOverviewTrends:o}),[t,e,i,o]);return t.isLoading||e.isLoading||i.isLoading||o.isLoading?s(R,{}):s(a.Provider,{...m,value:d})};export{L as SummaryAggregationsProvider,f as useSummaryAggregationsContext};
2
2
  //# sourceMappingURL=SummaryAggregationsProvider.esm.js.map
@@ -1,2 +1,2 @@
1
- import{jsx as a,jsxs as G}from"react/jsx-runtime";import{useRouteRef as I}from"@backstage/core-plugin-api";import{Typography as T,Box as M,Grid as S}from"@material-ui/core";import{useState as i,useEffect as A,useMemo as B}from"react";import"@backstage/catalog-model";import"@tanstack/react-query";import"../../../api.esm.js";import"../../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"@spotify/backstage-plugin-soundcheck-common";import"../../../hooks/useSoundcheckAlert.esm.js";import{useGetCampaigns as D}from"../../../hooks/campaigns/useGetCampaigns.esm.js";import"../../../hooks/useConfirmationModal.esm.js";import{useTrackPassRateTrend as F}from"../../../hooks/aggregations/useTrackPassRateTrend.esm.js";import"react-router-dom";import{campaignDetailsRouteRef as N}from"../../../routes.esm.js";import{campaignTrackPassRatesCsvFilename as j}from"../../../utils/charts.esm.js";import{PassRateGrid as V}from"../../PassRateGrid/PassRateGrid.esm.js";import"../../PassRateGrid/types.esm.js";import{PassRateTable as H}from"../../PassRateTable/PassRateTable.esm.js";import"../../PassRateTable/types.esm.js";import"../../TechHealth/Filters/types.esm.js";import"../../TechHealth/Filters/FacetFilter.esm.js";import{useFilterContext as q}from"../../TechHealth/Filters/FilterProvider.esm.js";import"../../TechHealth/Filters/Filters.esm.js";import"../../TechHealth/Filters/FiltersHeader.esm.js";import"../../TechHealth/Filters/FiltersSection.esm.js";import"lodash";import"../../../contexts/TrackFormContext.esm.js";import"../../../contexts/CheckFormContext.esm.js";import"../../../contexts/CampaignFormContext.esm.js";import"../../../contexts/UserProvider.esm.js";import{Loading as z}from"../../TechHealth/Loading/Loading.esm.js";import{PassRateTabHeader as J}from"../PassRateTabHeader.esm.js";import{usePassRateTabStyles as K}from"../PassRateTabStyles.esm.js";import{trackPassRatesToCsv as O}from"../TechHealthExportFunctions.esm.js";import{ViewMode as u,generateTrackPassRateGridData as Q}from"../techHealthTabUtils.esm.js";import{generateColumns as U}from"../TrackResultsTab/TrackResultsTab.esm.js";const W=()=>{const h=K(),{filter:g}=q(),m=I(N),{data:k}=D({orderAlphabetical:"default",searchByStatus:"active"}),t=k?.edges.map(r=>r.node)?.map(({id:r,track:f})=>({campaignId:r,trackId:f.id})),P=t?.map(({trackId:r})=>({trackId:r})),{data:s,isLoading:R,isError:v}=F({...g,tracks:P,trackTypes:{included:["campaign"]}}),[p,C]=i(u.TABLE),[e,w]=i(""),[c,n]=i(0),[d,b]=i(10);A(()=>{n(0)},[g,e]);const L=B(()=>U(s?.individualTrackPassRate??[],void 0,m,t),[s?.individualTrackPassRate,m,t]);if(R)return a(z,{});if(v)return a(T,{color:"error",children:"Failed to load campaign tracks"});const{individualTrackPassRate:l}=s;if(!l)return a(T,{color:"error",children:"No available campaign tracks"});const o=e.length?l.filter(({trackName:r})=>r?.toLowerCase()?.includes(e.toLowerCase())):l,y=async()=>O(o,t),x=(r,f)=>{n(()=>f)},E=r=>{b(+r.target.value),n(0)};return a(M,{className:h.root,children:G(S,{container:!0,direction:"row",children:[a(J,{viewMode:p,setViewMode:C,isLoading:R,searchTerm:e,setSearchTerm:w,searchPlaceholder:"Search Available Campaigns",fetchCsvData:y,csvFilename:j}),p===u.TABLE&&a(H,{data:o,columns:L}),p===u.GRID&&a(V,{data:Q(o.slice(c*d,(c+1)*d),void 0,m,t),totalCount:o?.length??0,page:c,rowsPerPage:d,onPageChange:x,onRowsPerPageChange:E})]})})};export{W as CampaignResultsTab};
1
+ import{jsx as a,jsxs as G}from"react/jsx-runtime";import{useRouteRef as I}from"@backstage/core-plugin-api";import{Typography as T,Box as M,Grid as S}from"@material-ui/core";import{useState as i,useEffect as A,useMemo as B}from"react";import"@backstage/catalog-model";import"@tanstack/react-query";import"../../../api.esm.js";import"../../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"@spotify/backstage-plugin-soundcheck-common";import"../../../hooks/useSoundcheckAlert.esm.js";import{useGetCampaigns as D}from"../../../hooks/campaigns/useGetCampaigns.esm.js";import"../../../hooks/useConfirmationModal.esm.js";import{useTrackPassRateTrend as F}from"../../../hooks/aggregations/useTrackPassRateTrend.esm.js";import"react-router-dom";import"react-use/lib/useLocalStorage";import{campaignDetailsRouteRef as N}from"../../../routes.esm.js";import{campaignTrackPassRatesCsvFilename as j}from"../../../utils/charts.esm.js";import{PassRateGrid as V}from"../../PassRateGrid/PassRateGrid.esm.js";import"../../PassRateGrid/types.esm.js";import{PassRateTable as H}from"../../PassRateTable/PassRateTable.esm.js";import"../../PassRateTable/types.esm.js";import"../../TechHealth/Filters/types.esm.js";import"../../TechHealth/Filters/FacetFilter.esm.js";import{useFilterContext as q}from"../../TechHealth/Filters/FilterProvider.esm.js";import"../../TechHealth/Filters/Filters.esm.js";import"../../TechHealth/Filters/FiltersHeader.esm.js";import"../../TechHealth/Filters/FiltersSection.esm.js";import"lodash";import"../../../contexts/TrackFormContext.esm.js";import"../../../contexts/CheckFormContext.esm.js";import"../../../contexts/CampaignFormContext.esm.js";import"../../../contexts/UserProvider.esm.js";import{Loading as z}from"../../TechHealth/Loading/Loading.esm.js";import{PassRateTabHeader as J}from"../PassRateTabHeader.esm.js";import{usePassRateTabStyles as K}from"../PassRateTabStyles.esm.js";import{trackPassRatesToCsv as O}from"../TechHealthExportFunctions.esm.js";import{ViewMode as u,generateTrackPassRateGridData as Q}from"../techHealthTabUtils.esm.js";import{generateColumns as U}from"../TrackResultsTab/TrackResultsTab.esm.js";const W=()=>{const h=K(),{filter:g}=q(),m=I(N),{data:k}=D({orderAlphabetical:"default",searchByStatus:"active"}),t=k?.edges.map(r=>r.node)?.map(({id:r,track:f})=>({campaignId:r,trackId:f.id})),P=t?.map(({trackId:r})=>({trackId:r})),{data:s,isLoading:R,isError:v}=F({...g,tracks:P,trackTypes:{included:["campaign"]}}),[p,C]=i(u.TABLE),[e,w]=i(""),[c,n]=i(0),[d,b]=i(10);A(()=>{n(0)},[g,e]);const L=B(()=>U(s?.individualTrackPassRate??[],void 0,m,t),[s?.individualTrackPassRate,m,t]);if(R)return a(z,{});if(v)return a(T,{color:"error",children:"Failed to load campaign tracks"});const{individualTrackPassRate:l}=s;if(!l)return a(T,{color:"error",children:"No available campaign tracks"});const o=e.length?l.filter(({trackName:r})=>r?.toLowerCase()?.includes(e.toLowerCase())):l,y=async()=>O(o,t),x=(r,f)=>{n(()=>f)},E=r=>{b(+r.target.value),n(0)};return a(M,{className:h.root,children:G(S,{container:!0,direction:"row",children:[a(J,{viewMode:p,setViewMode:C,isLoading:R,searchTerm:e,setSearchTerm:w,searchPlaceholder:"Search Available Campaigns",fetchCsvData:y,csvFilename:j}),p===u.TABLE&&a(H,{data:o,columns:L}),p===u.GRID&&a(V,{data:Q(o.slice(c*d,(c+1)*d),void 0,m,t),totalCount:o?.length??0,page:c,rowsPerPage:d,onPageChange:x,onRowsPerPageChange:E})]})})};export{W as CampaignResultsTab};
2
2
  //# sourceMappingURL=CampaignResultsTab.esm.js.map
@@ -1,2 +1,2 @@
1
- import{jsx as r,jsxs as L}from"react/jsx-runtime";import{useRouteRef as N}from"@backstage/core-plugin-api";import{Typography as R,Box as E,Grid as A}from"@material-ui/core";import{useState as m,useEffect as D}from"react";import"@backstage/catalog-model";import"@tanstack/react-query";import"../../../api.esm.js";import"../../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"@spotify/backstage-plugin-soundcheck-common";import"../../../hooks/useSoundcheckAlert.esm.js";import"../../../hooks/useConfirmationModal.esm.js";import{useCheckPassRateTrend as x}from"../../../hooks/aggregations/useCheckPassRateTrend.esm.js";import"react-router-dom";import{checkDetailsRouteRef as y}from"../../../routes.esm.js";import{checkPassRatesCsvFilename as M}from"../../../utils/charts.esm.js";import{PassRateGrid as O}from"../../PassRateGrid/PassRateGrid.esm.js";import"../../PassRateGrid/types.esm.js";import{PassRateTable as S}from"../../PassRateTable/PassRateTable.esm.js";import"../../PassRateTable/types.esm.js";import"../../TechHealth/Filters/types.esm.js";import"../../TechHealth/Filters/FacetFilter.esm.js";import{useFilterContext as F}from"../../TechHealth/Filters/FilterProvider.esm.js";import"../../TechHealth/Filters/Filters.esm.js";import"../../TechHealth/Filters/FiltersHeader.esm.js";import"../../TechHealth/Filters/FiltersSection.esm.js";import"lodash";import"../../../contexts/TrackFormContext.esm.js";import"../../../contexts/CheckFormContext.esm.js";import"../../../contexts/CampaignFormContext.esm.js";import"../../../contexts/UserProvider.esm.js";import{Loading as G}from"../../TechHealth/Loading/Loading.esm.js";import{NameColumn as B}from"../NameColumn.esm.js";import{ActionColumn as I}from"../ActionColumn.esm.js";import{OwnerColumn as j}from"../OwnerColumn.esm.js";import{checkPassRatesToCsv as V}from"../TechHealthExportFunctions.esm.js";import{PassRateTabHeader as H}from"../PassRateTabHeader.esm.js";import{usePassRateTabStyles as J}from"../PassRateTabStyles.esm.js";import{ViewMode as C,generateCheckPassRateGridData as W}from"../techHealthTabUtils.esm.js";import"recharts";import"../../Charts/ChartTypes.esm.js";import"../../Charts/LineChart/LineChart.esm.js";import"../../Charts/chartUtils.esm.js";import"luxon";import"../../TechHealthSummary/SummaryAggregationsProvider.esm.js";import"../../Charts/BarChart/BarChart.esm.js";import"../../PassRateTable/NewPassRateTable.esm.js";import{MostRecentColumn as q}from"../MostRecentColumn.esm.js";import{CheckTrendColumn as z}from"./CheckTrendColumn.esm.js";function K(s){return[{label:"NAME",id:"checkName",renderCell:e=>r(B,{name:e.checkName??e.id,description:e.checkDescription})},{label:"LATEST",id:"snapshotPassRate",renderCell:e=>r(q,{snapshot:e.snapshotPassRate})},{label:"TREND",id:"trendPassRate",renderCell:e=>r(z,{row:e})},{label:"OWNER",id:"checkOwner",renderCell:e=>r(j,{ownerEntityRef:e.checkOwnerRef??void 0})},{label:"ACTION",id:"action",renderCell:(e,t,n)=>r(I,{navigateTo:s({checkId:e.id}),disabled:t,toolTipText:n})}]}const Q=()=>{const s=J(),{filter:e}=F(),t=N(y),{data:n,isLoading:u,isError:k}=x(e),[c,P]=m(C.TABLE),[o,T]=m(""),[l,p]=m(0),[d,w]=m(10);if(D(()=>{p(0)},[e,o]),u)return r(G,{});if(k)return r(R,{color:"error",children:"Failed to load checks"});const{individualCheckPassRates:h}=n;if(!h)return r(R,{color:"error",children:"No available checks"});const i=o.length?h.filter(({id:a,checkName:f})=>f?.toLowerCase()?.includes(o.toLowerCase())||a.toLowerCase().includes(o.toLowerCase())):h,g=async()=>V(i),b=(a,f)=>{p(()=>f)},v=a=>{w(+a.target.value),p(0)};return r(E,{className:s.root,children:L(A,{container:!0,direction:"row",children:[r(H,{viewMode:c,setViewMode:P,isLoading:u,searchTerm:o,setSearchTerm:T,searchPlaceholder:"Search for Available Checks",fetchCsvData:g,csvFilename:M}),c===C.TABLE&&r(S,{data:i,columns:K(t),showsCheckData:!0}),c===C.GRID&&r(O,{data:W(i.slice(l*d,(l+1)*d),t),totalCount:i?.length??0,page:l,rowsPerPage:d,onPageChange:b,onRowsPerPageChange:v})]})})};export{Q as CheckResultsTab};
1
+ import{jsx as r,jsxs as L}from"react/jsx-runtime";import{useRouteRef as N}from"@backstage/core-plugin-api";import{Typography as R,Box as E,Grid as A}from"@material-ui/core";import{useState as m,useEffect as D}from"react";import"@backstage/catalog-model";import"@tanstack/react-query";import"../../../api.esm.js";import"../../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"@spotify/backstage-plugin-soundcheck-common";import"../../../hooks/useSoundcheckAlert.esm.js";import"../../../hooks/useConfirmationModal.esm.js";import{useCheckPassRateTrend as x}from"../../../hooks/aggregations/useCheckPassRateTrend.esm.js";import"react-router-dom";import"react-use/lib/useLocalStorage";import{checkDetailsRouteRef as y}from"../../../routes.esm.js";import{checkPassRatesCsvFilename as M}from"../../../utils/charts.esm.js";import{PassRateGrid as O}from"../../PassRateGrid/PassRateGrid.esm.js";import"../../PassRateGrid/types.esm.js";import{PassRateTable as S}from"../../PassRateTable/PassRateTable.esm.js";import"../../PassRateTable/types.esm.js";import"../../TechHealth/Filters/types.esm.js";import"../../TechHealth/Filters/FacetFilter.esm.js";import{useFilterContext as F}from"../../TechHealth/Filters/FilterProvider.esm.js";import"../../TechHealth/Filters/Filters.esm.js";import"../../TechHealth/Filters/FiltersHeader.esm.js";import"../../TechHealth/Filters/FiltersSection.esm.js";import"lodash";import"../../../contexts/TrackFormContext.esm.js";import"../../../contexts/CheckFormContext.esm.js";import"../../../contexts/CampaignFormContext.esm.js";import"../../../contexts/UserProvider.esm.js";import{Loading as G}from"../../TechHealth/Loading/Loading.esm.js";import{NameColumn as B}from"../NameColumn.esm.js";import{ActionColumn as I}from"../ActionColumn.esm.js";import{OwnerColumn as j}from"../OwnerColumn.esm.js";import{checkPassRatesToCsv as V}from"../TechHealthExportFunctions.esm.js";import{PassRateTabHeader as H}from"../PassRateTabHeader.esm.js";import{usePassRateTabStyles as J}from"../PassRateTabStyles.esm.js";import{ViewMode as C,generateCheckPassRateGridData as W}from"../techHealthTabUtils.esm.js";import"recharts";import"../../Charts/ChartTypes.esm.js";import"../../Charts/LineChart/LineChart.esm.js";import"../../Charts/chartUtils.esm.js";import"luxon";import"../../TechHealthSummary/SummaryAggregationsProvider.esm.js";import"../../Charts/BarChart/BarChart.esm.js";import"../../PassRateTable/NewPassRateTable.esm.js";import{MostRecentColumn as q}from"../MostRecentColumn.esm.js";import{CheckTrendColumn as z}from"./CheckTrendColumn.esm.js";function K(s){return[{label:"NAME",id:"checkName",renderCell:e=>r(B,{name:e.checkName??e.id,description:e.checkDescription})},{label:"LATEST",id:"snapshotPassRate",renderCell:e=>r(q,{snapshot:e.snapshotPassRate})},{label:"TREND",id:"trendPassRate",renderCell:e=>r(z,{row:e})},{label:"OWNER",id:"checkOwner",renderCell:e=>r(j,{ownerEntityRef:e.checkOwnerRef??void 0})},{label:"ACTION",id:"action",renderCell:(e,t,n)=>r(I,{navigateTo:s({checkId:e.id}),disabled:t,toolTipText:n})}]}const Q=()=>{const s=J(),{filter:e}=F(),t=N(y),{data:n,isLoading:u,isError:k}=x(e),[c,P]=m(C.TABLE),[o,T]=m(""),[l,p]=m(0),[d,w]=m(10);if(D(()=>{p(0)},[e,o]),u)return r(G,{});if(k)return r(R,{color:"error",children:"Failed to load checks"});const{individualCheckPassRates:h}=n;if(!h)return r(R,{color:"error",children:"No available checks"});const i=o.length?h.filter(({id:a,checkName:f})=>f?.toLowerCase()?.includes(o.toLowerCase())||a.toLowerCase().includes(o.toLowerCase())):h,g=async()=>V(i),b=(a,f)=>{p(()=>f)},v=a=>{w(+a.target.value),p(0)};return r(E,{className:s.root,children:L(A,{container:!0,direction:"row",children:[r(H,{viewMode:c,setViewMode:P,isLoading:u,searchTerm:o,setSearchTerm:T,searchPlaceholder:"Search for Available Checks",fetchCsvData:g,csvFilename:M}),c===C.TABLE&&r(S,{data:i,columns:K(t),showsCheckData:!0}),c===C.GRID&&r(O,{data:W(i.slice(l*d,(l+1)*d),t),totalCount:i?.length??0,page:l,rowsPerPage:d,onPageChange:b,onRowsPerPageChange:v})]})})};export{Q as CheckResultsTab};
2
2
  //# sourceMappingURL=CheckResultsTab.esm.js.map
@@ -1,2 +1,2 @@
1
- import{jsx as t,jsxs as j}from"react/jsx-runtime";import{parseEntityRef as N}from"@backstage/catalog-model";import{useApi as V,useRouteRef as H}from"@backstage/core-plugin-api";import{entityRouteRef as W}from"@backstage/plugin-catalog-react";import{Typography as L,Box as $,Grid as q}from"@material-ui/core";import{useState as a,useEffect as A}from"react";import{soundcheckApiRef as z}from"../../../api.esm.js";import"@tanstack/react-query";import"../../../hooks/graphqlKeys.esm.js";import"@spotify/backstage-plugin-soundcheck-common";import"../../../hooks/useSoundcheckAlert.esm.js";import"../../../hooks/useConfirmationModal.esm.js";import{useEntityPassRateTrend as J}from"../../../hooks/aggregations/useEntityPassRateTrend.esm.js";import"react-router-dom";import{entityPassRatesCsvFilename as K}from"../../../utils/charts.esm.js";import{PassRateGrid as Q}from"../../PassRateGrid/PassRateGrid.esm.js";import"../../PassRateGrid/types.esm.js";import{NewPassRateTable as U}from"../../PassRateTable/NewPassRateTable.esm.js";import"../../TechHealth/Filters/types.esm.js";import"../../TechHealth/Filters/FacetFilter.esm.js";import{useFilterContext as X}from"../../TechHealth/Filters/FilterProvider.esm.js";import"../../TechHealth/Filters/Filters.esm.js";import"../../TechHealth/Filters/FiltersHeader.esm.js";import"../../TechHealth/Filters/FiltersSection.esm.js";import"lodash";import"../../../contexts/TrackFormContext.esm.js";import"../../../contexts/CheckFormContext.esm.js";import"../../../contexts/CampaignFormContext.esm.js";import"../../../contexts/UserProvider.esm.js";import{Loading as Y}from"../../TechHealth/Loading/Loading.esm.js";import{ActionColumn as Z}from"../ActionColumn.esm.js";import{MostRecentColumn as _}from"../MostRecentColumn.esm.js";import{NameColumn as ee}from"../NameColumn.esm.js";import{OwnerColumn as te}from"../OwnerColumn.esm.js";import{PassRateTabHeader as oe}from"../PassRateTabHeader.esm.js";import{usePassRateTabStyles as re}from"../PassRateTabStyles.esm.js";import{entityPassRatesToCsv as ie}from"../TechHealthExportFunctions.esm.js";import{ViewMode as g,generateEntityPassRateGridData as ae}from"../techHealthTabUtils.esm.js";import{EntityTrendColumn as se}from"./EntityTrendColumn.esm.js";function ne(l){return[{label:"NAME",id:"entityName",renderCell:({id:o,entityDescription:s})=>t(ee,{name:N(o).name,description:s})},{label:"LATEST",id:"latest",renderCell:o=>t(_,{snapshot:o.snapshotPassRate})},{label:"TREND",id:"trend",renderCell:o=>t(se,{row:o})},{label:"OWNER",id:"entityOwnerRef",renderCell:({entityOwnerRef:o})=>t(te,{ownerEntityRef:o??void 0})},{label:"ACTION",id:"action",renderCell:({id:o})=>t(Z,{navigateTo:`${l(N(o))}/soundcheck`})}]}const de=()=>{const l=re(),o=V(z),{filter:s}=X(),c=H(W),[P,R]=a([]),[C,n]=a(void 0),[h,p]=a(0),[u,x]=a(10),{data:r,isLoading:y,isError:I}=J({filter:s,first:u,after:C}),[i,D]=a(r?.individualEntityPassRates),S=i?.edges?i?.edges[i?.edges.length-1]:{cursor:""};A(()=>{r&&D(()=>({totalCount:r.individualEntityPassRates.totalCount,edges:r.individualEntityPassRates.edges,pageInfo:{endCursor:r.individualEntityPassRates.pageInfo.endCursor,hasNextPage:r.individualEntityPassRates.pageInfo.hasNextPage??!1,hasPreviousPage:r.individualEntityPassRates.pageInfo.hasPreviousPage??!1}}))},[r]);const[f,F]=a(g.TABLE),[d,G]=a("");if(A(()=>{p(0),n("")},[s]),y)return t(Y,{});if(I)return t(L,{color:"error",children:"Failed to load entities"});if(!i?.edges?.length)return t(L,{color:"error",children:"No available entities"});const v=d.length?{...i,edges:i.edges.filter(({node:e})=>e.id.toLowerCase().includes(d.toLowerCase())),totalCount:i.edges.filter(({node:e})=>e.id.toLowerCase().includes(d.toLowerCase())).length}:i,E=v?.edges.map(({node:e})=>e)??[],w=v?.totalCount??0,M=async()=>{const{individualEntityPassRates:e}=await o.getIndividualEntityPassRates({filter:s});return ie(e.edges.map(({node:m})=>m))},O=()=>{R(e=>[...e,C]),n(S?.cursor)},B=()=>{n(P[P.length-1]),R(e=>e.slice(0,-1))},T=(e,m)=>{p(k=>(m>k?O():B(),m))},b=e=>{n(void 0),x(+e.target.value),p(0)};return t($,{className:l.root,children:j(q,{container:!0,direction:"row",children:[t(oe,{viewMode:f,setViewMode:F,isLoading:y,searchTerm:d,setSearchTerm:G,searchPlaceholder:"Search available entities",fetchCsvData:M,csvFilename:K}),f===g.TABLE&&t(U,{data:E,totalCount:w,page:h,rowsPerPage:u,columns:ne(c),onPageChange:T,onRowsPerPageChange:b}),f===g.GRID&&t(Q,{data:ae(E,c),totalCount:w,page:h,rowsPerPage:u,onPageChange:T,onRowsPerPageChange:b})]})})};export{de as EntityResultsTab};
1
+ import{jsx as t,jsxs as j}from"react/jsx-runtime";import{parseEntityRef as N}from"@backstage/catalog-model";import{useApi as V,useRouteRef as H}from"@backstage/core-plugin-api";import{entityRouteRef as W}from"@backstage/plugin-catalog-react";import{Typography as L,Box as $,Grid as q}from"@material-ui/core";import{useState as a,useEffect as A}from"react";import{soundcheckApiRef as z}from"../../../api.esm.js";import"@tanstack/react-query";import"../../../hooks/graphqlKeys.esm.js";import"@spotify/backstage-plugin-soundcheck-common";import"../../../hooks/useSoundcheckAlert.esm.js";import"../../../hooks/useConfirmationModal.esm.js";import{useEntityPassRateTrend as J}from"../../../hooks/aggregations/useEntityPassRateTrend.esm.js";import"react-router-dom";import"react-use/lib/useLocalStorage";import{entityPassRatesCsvFilename as K}from"../../../utils/charts.esm.js";import{PassRateGrid as Q}from"../../PassRateGrid/PassRateGrid.esm.js";import"../../PassRateGrid/types.esm.js";import{NewPassRateTable as U}from"../../PassRateTable/NewPassRateTable.esm.js";import"../../TechHealth/Filters/types.esm.js";import"../../TechHealth/Filters/FacetFilter.esm.js";import{useFilterContext as X}from"../../TechHealth/Filters/FilterProvider.esm.js";import"../../TechHealth/Filters/Filters.esm.js";import"../../TechHealth/Filters/FiltersHeader.esm.js";import"../../TechHealth/Filters/FiltersSection.esm.js";import"lodash";import"../../../contexts/TrackFormContext.esm.js";import"../../../contexts/CheckFormContext.esm.js";import"../../../contexts/CampaignFormContext.esm.js";import"../../../contexts/UserProvider.esm.js";import{Loading as Y}from"../../TechHealth/Loading/Loading.esm.js";import{ActionColumn as Z}from"../ActionColumn.esm.js";import{MostRecentColumn as _}from"../MostRecentColumn.esm.js";import{NameColumn as ee}from"../NameColumn.esm.js";import{OwnerColumn as te}from"../OwnerColumn.esm.js";import{PassRateTabHeader as oe}from"../PassRateTabHeader.esm.js";import{usePassRateTabStyles as re}from"../PassRateTabStyles.esm.js";import{entityPassRatesToCsv as ie}from"../TechHealthExportFunctions.esm.js";import{ViewMode as g,generateEntityPassRateGridData as ae}from"../techHealthTabUtils.esm.js";import{EntityTrendColumn as se}from"./EntityTrendColumn.esm.js";function ne(l){return[{label:"NAME",id:"entityName",renderCell:({id:o,entityDescription:s})=>t(ee,{name:N(o).name,description:s})},{label:"LATEST",id:"latest",renderCell:o=>t(_,{snapshot:o.snapshotPassRate})},{label:"TREND",id:"trend",renderCell:o=>t(se,{row:o})},{label:"OWNER",id:"entityOwnerRef",renderCell:({entityOwnerRef:o})=>t(te,{ownerEntityRef:o??void 0})},{label:"ACTION",id:"action",renderCell:({id:o})=>t(Z,{navigateTo:`${l(N(o))}/soundcheck`})}]}const de=()=>{const l=re(),o=V(z),{filter:s}=X(),c=H(W),[P,R]=a([]),[C,n]=a(void 0),[h,p]=a(0),[u,x]=a(10),{data:r,isLoading:y,isError:I}=J({filter:s,first:u,after:C}),[i,D]=a(r?.individualEntityPassRates),S=i?.edges?i?.edges[i?.edges.length-1]:{cursor:""};A(()=>{r&&D(()=>({totalCount:r.individualEntityPassRates.totalCount,edges:r.individualEntityPassRates.edges,pageInfo:{endCursor:r.individualEntityPassRates.pageInfo.endCursor,hasNextPage:r.individualEntityPassRates.pageInfo.hasNextPage??!1,hasPreviousPage:r.individualEntityPassRates.pageInfo.hasPreviousPage??!1}}))},[r]);const[f,F]=a(g.TABLE),[d,G]=a("");if(A(()=>{p(0),n("")},[s]),y)return t(Y,{});if(I)return t(L,{color:"error",children:"Failed to load entities"});if(!i?.edges?.length)return t(L,{color:"error",children:"No available entities"});const v=d.length?{...i,edges:i.edges.filter(({node:e})=>e.id.toLowerCase().includes(d.toLowerCase())),totalCount:i.edges.filter(({node:e})=>e.id.toLowerCase().includes(d.toLowerCase())).length}:i,E=v?.edges.map(({node:e})=>e)??[],w=v?.totalCount??0,M=async()=>{const{individualEntityPassRates:e}=await o.getIndividualEntityPassRates({filter:s});return ie(e.edges.map(({node:m})=>m))},O=()=>{R(e=>[...e,C]),n(S?.cursor)},B=()=>{n(P[P.length-1]),R(e=>e.slice(0,-1))},T=(e,m)=>{p(k=>(m>k?O():B(),m))},b=e=>{n(void 0),x(+e.target.value),p(0)};return t($,{className:l.root,children:j(q,{container:!0,direction:"row",children:[t(oe,{viewMode:f,setViewMode:F,isLoading:y,searchTerm:d,setSearchTerm:G,searchPlaceholder:"Search available entities",fetchCsvData:M,csvFilename:K}),f===g.TABLE&&t(U,{data:E,totalCount:w,page:h,rowsPerPage:u,columns:ne(c),onPageChange:T,onRowsPerPageChange:b}),f===g.GRID&&t(Q,{data:ae(E,c),totalCount:w,page:h,rowsPerPage:u,onPageChange:T,onRowsPerPageChange:b})]})})};export{de as EntityResultsTab};
2
2
  //# sourceMappingURL=EntityResultsTab.esm.js.map
@@ -1,2 +1,2 @@
1
- import{jsx as o,jsxs as k}from"react/jsx-runtime";import{parseEntityRef as L}from"@backstage/catalog-model";import{useApi as H,useRouteRef as O}from"@backstage/core-plugin-api";import{entityRouteRef as q}from"@backstage/plugin-catalog-react";import{Typography as x,Box as z,Grid as J}from"@material-ui/core";import{useState as s,useEffect as A}from"react";import{soundcheckApiRef as K}from"../../../api.esm.js";import"@tanstack/react-query";import"../../../hooks/graphqlKeys.esm.js";import"@spotify/backstage-plugin-soundcheck-common";import"../../../hooks/useSoundcheckAlert.esm.js";import"../../../hooks/useConfirmationModal.esm.js";import{useGroupPassRateTrend as Q}from"../../../hooks/aggregations/useGroupPassRateTrend.esm.js";import"react-router-dom";import{groupPassRatesCsvFilename as U}from"../../../utils/charts.esm.js";import{PassRateGrid as W}from"../../PassRateGrid/PassRateGrid.esm.js";import"../../PassRateGrid/types.esm.js";import{NewPassRateTable as X}from"../../PassRateTable/NewPassRateTable.esm.js";import"../../TechHealth/Filters/types.esm.js";import"../../TechHealth/Filters/FacetFilter.esm.js";import{useFilterContext as Y}from"../../TechHealth/Filters/FilterProvider.esm.js";import"../../TechHealth/Filters/Filters.esm.js";import"../../TechHealth/Filters/FiltersHeader.esm.js";import"../../TechHealth/Filters/FiltersSection.esm.js";import"lodash";import"../../../contexts/TrackFormContext.esm.js";import"../../../contexts/CheckFormContext.esm.js";import"../../../contexts/CampaignFormContext.esm.js";import"../../../contexts/UserProvider.esm.js";import{Loading as Z}from"../../TechHealth/Loading/Loading.esm.js";import{ActionColumn as _}from"../ActionColumn.esm.js";import{MostRecentColumn as $}from"../MostRecentColumn.esm.js";import{NameColumn as ee}from"../NameColumn.esm.js";import{PassRateTabHeader as oe}from"../PassRateTabHeader.esm.js";import{usePassRateTabStyles as re}from"../PassRateTabStyles.esm.js";import{groupPassRatesToCsv as te}from"../TechHealthExportFunctions.esm.js";import{ViewMode as f,generateGroupPassRateGridData as ae}from"../techHealthTabUtils.esm.js";import{GroupTrendColumn as se}from"./GroupTrendColumn.esm.js";function ie(l){return[{label:"NAME",id:"groupName",renderCell:({groupTitle:r,id:i})=>o(ee,{name:r??L(i).name})},{label:"LATEST",id:"latest",renderCell:r=>o($,{snapshot:r.snapshotPassRate})},{label:"TREND",id:"trend",renderCell:r=>o(se,{row:r})},{label:"ACTION",id:"action",renderCell:({id:r})=>o(_,{navigateTo:l(L(r))})}]}const ne=()=>{const l=re(),r=H(K),{filter:i}=Y();i.context=void 0;const c=O(q),[P,R]=s([]),[C,n]=s(void 0),[h,d]=s(0),[u,E]=s(10),{data:t,isLoading:T,isError:I}=Q({filter:i,first:u,after:C}),[a,y]=s(t?.groupPassRates),S=a?.edges?a?.edges[a?.edges.length-1]:{cursor:""};A(()=>{t&&y(()=>({totalCount:t.groupPassRates.totalCount,edges:t.groupPassRates.edges,pageInfo:{endCursor:t.groupPassRates.pageInfo.endCursor,hasNextPage:t.groupPassRates.pageInfo.hasNextPage??!1,hasPreviousPage:t.groupPassRates.pageInfo.hasPreviousPage??!1}}))},[t]);const[g,D]=s(f.TABLE),[m,F]=s("");if(A(()=>{d(0),n("")},[i]),T)return o(Z,{});if(I)return o(x,{color:"error",children:"Failed to load groups"});if(!a?.edges?.length)return o(x,{color:"error",children:"No available groups"});const v=m.length?{...a,edges:a.edges.filter(({node:e})=>e.groupTitle?.toLowerCase()?.includes(m.toLowerCase())||e.id.toLowerCase().includes(m.toLowerCase()))}:a,w=v?.edges.map(({node:e})=>e)??[],b=v?.totalCount??0,M=async()=>{const{groupPassRates:e}=await r.getIndividualGroupPassRates({filter:i});return te(e.edges.map(({node:p})=>p))},B=()=>{R(e=>[...e,C]),n(S?.cursor)},V=()=>{n(P[P.length-1]),R(e=>e.slice(0,-1))},N=(e,p)=>{d(j=>(p>j?B():V(),p))},G=e=>{n(void 0),E(+e.target.value),d(0)};return o(z,{className:l.root,children:k(J,{container:!0,direction:"row",children:[o(oe,{viewMode:g,setViewMode:D,isLoading:T,searchTerm:m,setSearchTerm:F,searchPlaceholder:"Search available teams",csvFilename:U,fetchCsvData:M}),g===f.TABLE&&o(X,{data:w,totalCount:b,page:h,rowsPerPage:u,columns:ie(c),onPageChange:N,onRowsPerPageChange:G}),g===f.GRID&&o(W,{data:ae(w,c),totalCount:b,page:h,rowsPerPage:u,onPageChange:N,onRowsPerPageChange:G})]})})};export{ne as GroupResultsTab};
1
+ import{jsx as o,jsxs as k}from"react/jsx-runtime";import{parseEntityRef as L}from"@backstage/catalog-model";import{useApi as H,useRouteRef as O}from"@backstage/core-plugin-api";import{entityRouteRef as q}from"@backstage/plugin-catalog-react";import{Typography as x,Box as z,Grid as J}from"@material-ui/core";import{useState as s,useEffect as A}from"react";import{soundcheckApiRef as K}from"../../../api.esm.js";import"@tanstack/react-query";import"../../../hooks/graphqlKeys.esm.js";import"@spotify/backstage-plugin-soundcheck-common";import"../../../hooks/useSoundcheckAlert.esm.js";import"../../../hooks/useConfirmationModal.esm.js";import{useGroupPassRateTrend as Q}from"../../../hooks/aggregations/useGroupPassRateTrend.esm.js";import"react-router-dom";import"react-use/lib/useLocalStorage";import{groupPassRatesCsvFilename as U}from"../../../utils/charts.esm.js";import{PassRateGrid as W}from"../../PassRateGrid/PassRateGrid.esm.js";import"../../PassRateGrid/types.esm.js";import{NewPassRateTable as X}from"../../PassRateTable/NewPassRateTable.esm.js";import"../../TechHealth/Filters/types.esm.js";import"../../TechHealth/Filters/FacetFilter.esm.js";import{useFilterContext as Y}from"../../TechHealth/Filters/FilterProvider.esm.js";import"../../TechHealth/Filters/Filters.esm.js";import"../../TechHealth/Filters/FiltersHeader.esm.js";import"../../TechHealth/Filters/FiltersSection.esm.js";import"lodash";import"../../../contexts/TrackFormContext.esm.js";import"../../../contexts/CheckFormContext.esm.js";import"../../../contexts/CampaignFormContext.esm.js";import"../../../contexts/UserProvider.esm.js";import{Loading as Z}from"../../TechHealth/Loading/Loading.esm.js";import{ActionColumn as _}from"../ActionColumn.esm.js";import{MostRecentColumn as $}from"../MostRecentColumn.esm.js";import{NameColumn as ee}from"../NameColumn.esm.js";import{PassRateTabHeader as oe}from"../PassRateTabHeader.esm.js";import{usePassRateTabStyles as re}from"../PassRateTabStyles.esm.js";import{groupPassRatesToCsv as te}from"../TechHealthExportFunctions.esm.js";import{ViewMode as f,generateGroupPassRateGridData as ae}from"../techHealthTabUtils.esm.js";import{GroupTrendColumn as se}from"./GroupTrendColumn.esm.js";function ie(l){return[{label:"NAME",id:"groupName",renderCell:({groupTitle:r,id:i})=>o(ee,{name:r??L(i).name})},{label:"LATEST",id:"latest",renderCell:r=>o($,{snapshot:r.snapshotPassRate})},{label:"TREND",id:"trend",renderCell:r=>o(se,{row:r})},{label:"ACTION",id:"action",renderCell:({id:r})=>o(_,{navigateTo:l(L(r))})}]}const ne=()=>{const l=re(),r=H(K),{filter:i}=Y();i.context=void 0;const c=O(q),[P,R]=s([]),[C,n]=s(void 0),[h,d]=s(0),[u,E]=s(10),{data:t,isLoading:T,isError:I}=Q({filter:i,first:u,after:C}),[a,y]=s(t?.groupPassRates),S=a?.edges?a?.edges[a?.edges.length-1]:{cursor:""};A(()=>{t&&y(()=>({totalCount:t.groupPassRates.totalCount,edges:t.groupPassRates.edges,pageInfo:{endCursor:t.groupPassRates.pageInfo.endCursor,hasNextPage:t.groupPassRates.pageInfo.hasNextPage??!1,hasPreviousPage:t.groupPassRates.pageInfo.hasPreviousPage??!1}}))},[t]);const[g,D]=s(f.TABLE),[m,F]=s("");if(A(()=>{d(0),n("")},[i]),T)return o(Z,{});if(I)return o(x,{color:"error",children:"Failed to load groups"});if(!a?.edges?.length)return o(x,{color:"error",children:"No available groups"});const v=m.length?{...a,edges:a.edges.filter(({node:e})=>e.groupTitle?.toLowerCase()?.includes(m.toLowerCase())||e.id.toLowerCase().includes(m.toLowerCase()))}:a,w=v?.edges.map(({node:e})=>e)??[],b=v?.totalCount??0,M=async()=>{const{groupPassRates:e}=await r.getIndividualGroupPassRates({filter:i});return te(e.edges.map(({node:p})=>p))},B=()=>{R(e=>[...e,C]),n(S?.cursor)},V=()=>{n(P[P.length-1]),R(e=>e.slice(0,-1))},N=(e,p)=>{d(j=>(p>j?B():V(),p))},G=e=>{n(void 0),E(+e.target.value),d(0)};return o(z,{className:l.root,children:k(J,{container:!0,direction:"row",children:[o(oe,{viewMode:g,setViewMode:D,isLoading:T,searchTerm:m,setSearchTerm:F,searchPlaceholder:"Search available teams",csvFilename:U,fetchCsvData:M}),g===f.TABLE&&o(X,{data:w,totalCount:b,page:h,rowsPerPage:u,columns:ie(c),onPageChange:N,onRowsPerPageChange:G}),g===f.GRID&&o(W,{data:ae(w,c),totalCount:b,page:h,rowsPerPage:u,onPageChange:N,onRowsPerPageChange:G})]})})};export{ne as GroupResultsTab};
2
2
  //# sourceMappingURL=GroupResultsTab.esm.js.map
@@ -1,2 +1,2 @@
1
- import{jsxs as m,jsx as t}from"react/jsx-runtime";import{Box as s,Typography as n}from"@material-ui/core";import{SoundcheckMarkdownContent as i}from"../SoundcheckMarkdownContent/SoundcheckMarkdownContent.esm.js";import"@backstage/core-components";import"react";import"react-markdown";import"rehype-raw";import"remark-gfm";import{usePassRateTabStyles as p}from"./PassRateTabStyles.esm.js";const a=({name:r="",description:e=""})=>{const o=p();return m(s,{className:o.flexColumn,children:[t(n,{className:o.boldText,children:r}),t(i,{className:o.descriptionText,content:e??""})]})};export{a as NameColumn};
1
+ import{jsxs as m,jsx as t}from"react/jsx-runtime";import{Box as s,Typography as i}from"@material-ui/core";import{SoundcheckMarkdownContentDeprecated as n}from"../SoundcheckMarkdownContent/SoundcheckMarkdownContentDeprecated.esm.js";import"@backstage/core-components";import"react";import"react-markdown";import"rehype-raw";import"remark-gfm";import"../SoundcheckMarkdownContent/SoundcheckMarkdownContentBUI.esm.js";import{usePassRateTabStyles as p}from"./PassRateTabStyles.esm.js";const a=({name:r="",description:e=""})=>{const o=p();return m(s,{className:o.flexColumn,children:[t(i,{className:o.boldText,children:r}),t(n,{className:o.descriptionText,content:e??""})]})};export{a as NameColumn};
2
2
  //# sourceMappingURL=NameColumn.esm.js.map
@@ -1,2 +1,2 @@
1
- import{jsx as e,jsxs as N,Fragment as O}from"react/jsx-runtime";import{useRouteRef as A}from"@backstage/core-plugin-api";import{Typography as k,Box as x,Grid as y}from"@material-ui/core";import{useState as p,useEffect as D,useMemo as S}from"react";import"@backstage/catalog-model";import"@tanstack/react-query";import"../../../api.esm.js";import"../../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"@spotify/backstage-plugin-soundcheck-common";import"../../../hooks/useSoundcheckAlert.esm.js";import"../../../hooks/useConfirmationModal.esm.js";import{useTrackPassRateTrend as F}from"../../../hooks/aggregations/useTrackPassRateTrend.esm.js";import"react-router-dom";import{trackDetailsRouteRef as G}from"../../../routes.esm.js";import{trackPassRatesCsvFilename as B}from"../../../utils/charts.esm.js";import{PassRateGrid as V}from"../../PassRateGrid/PassRateGrid.esm.js";import"../../PassRateGrid/types.esm.js";import{PassRateTable as j}from"../../PassRateTable/PassRateTable.esm.js";import"../../PassRateTable/types.esm.js";import"../../TechHealth/Filters/types.esm.js";import"../../TechHealth/Filters/FacetFilter.esm.js";import{useFilterContext as I}from"../../TechHealth/Filters/FilterProvider.esm.js";import"../../TechHealth/Filters/Filters.esm.js";import"../../TechHealth/Filters/FiltersHeader.esm.js";import"../../TechHealth/Filters/FiltersSection.esm.js";import"lodash";import"../../../contexts/TrackFormContext.esm.js";import"../../../contexts/CheckFormContext.esm.js";import"../../../contexts/CampaignFormContext.esm.js";import"../../../contexts/UserProvider.esm.js";import{Loading as $}from"../../TechHealth/Loading/Loading.esm.js";import{trackPassRatesToCsv as H}from"../TechHealthExportFunctions.esm.js";import{ActionColumn as W}from"../ActionColumn.esm.js";import{NameColumn as q}from"../NameColumn.esm.js";import{OwnerColumn as z}from"../OwnerColumn.esm.js";import{PassRateTabHeader as J}from"../PassRateTabHeader.esm.js";import{usePassRateTabStyles as K}from"../PassRateTabStyles.esm.js";import{ViewMode as h,generateTrackPassRateGridData as Q,getDetailsRoute as U}from"../techHealthTabUtils.esm.js";import{TrackTrendColumn as X}from"./TrackLevelTrendColumn.esm.js";const v=(m,s,o)=>{const i=Math.min(5,s-m+1);return Array.from({length:i}).map((n,l)=>{const a=m+l;return{label:o?"PROGRESS":`LEVEL ${a}`,id:`levels-${l}`,renderCell:r=>{const t=r.levels?.find(({levelOrdinal:f})=>f===a);return t?e(X,{row:t}):e(O,{})}}})},P=(m,s,o,i)=>{const n=m.flatMap(r=>r.levels?.map(t=>t.levelOrdinal)||[]),l=Math.min(...n),a=Math.max(...n);return[{label:"NAME",id:"trackName",renderCell:r=>e(q,{name:r.trackName??r.id,description:r.trackDescription})},...v(l,a,!!o),{label:"OWNER",id:"trackOwnerRef",renderCell:r=>e(z,{ownerEntityRef:r.trackOwnerRef??void 0})},{label:"ACTION",id:"action",renderCell:({id:r})=>e(W,{navigateTo:U(r,s,o,i)})}]},Y=()=>{const m=K(),{filter:s}=I(),o=A(G),{data:i,isLoading:n,isError:l}=F(s),[a,r]=p(h.TABLE),[t,f]=p(""),[u,R]=p(0),[T,w]=p(10);D(()=>{R(0)},[s,t]);const b=S(()=>P(i?.individualTrackPassRate??[],o),[i?.individualTrackPassRate,o]);if(n)return e($,{});if(l)return e(k,{color:"error",children:"Failed to load tracks"});const{individualTrackPassRate:C}=i;if(!C)return e(k,{color:"error",children:"No available tracks"});const c=t.length?C.filter(({id:d,trackName:g})=>g?.toLowerCase()?.includes(t.toLowerCase())||d.toLowerCase().includes(t.toLowerCase())):C,E=async()=>H(c),L=(d,g)=>{R(()=>g)},M=d=>{w(+d.target.value),R(0)};return e(x,{className:m.root,children:N(y,{container:!0,direction:"row",children:[e(J,{viewMode:a,setViewMode:r,isLoading:n,searchTerm:t,setSearchTerm:f,searchPlaceholder:"Search Available Tracks",fetchCsvData:E,csvFilename:B}),a===h.TABLE&&e(j,{data:c,columns:b}),a===h.GRID&&e(V,{data:Q(c.slice(u*T,(u+1)*T),o),totalCount:c?.length??0,page:u,rowsPerPage:T,onPageChange:L,onRowsPerPageChange:M})]})})};export{Y as TrackResultsTab,P as generateColumns,v as generateTrendColumns};
1
+ import{jsx as e,jsxs as N,Fragment as O}from"react/jsx-runtime";import{useRouteRef as A}from"@backstage/core-plugin-api";import{Typography as k,Box as x,Grid as y}from"@material-ui/core";import{useState as d,useEffect as D,useMemo as S}from"react";import"@backstage/catalog-model";import"@tanstack/react-query";import"../../../api.esm.js";import"../../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"@spotify/backstage-plugin-soundcheck-common";import"../../../hooks/useSoundcheckAlert.esm.js";import"../../../hooks/useConfirmationModal.esm.js";import{useTrackPassRateTrend as F}from"../../../hooks/aggregations/useTrackPassRateTrend.esm.js";import"react-router-dom";import"react-use/lib/useLocalStorage";import{trackDetailsRouteRef as G}from"../../../routes.esm.js";import{trackPassRatesCsvFilename as B}from"../../../utils/charts.esm.js";import{PassRateGrid as V}from"../../PassRateGrid/PassRateGrid.esm.js";import"../../PassRateGrid/types.esm.js";import{PassRateTable as j}from"../../PassRateTable/PassRateTable.esm.js";import"../../PassRateTable/types.esm.js";import"../../TechHealth/Filters/types.esm.js";import"../../TechHealth/Filters/FacetFilter.esm.js";import{useFilterContext as I}from"../../TechHealth/Filters/FilterProvider.esm.js";import"../../TechHealth/Filters/Filters.esm.js";import"../../TechHealth/Filters/FiltersHeader.esm.js";import"../../TechHealth/Filters/FiltersSection.esm.js";import"lodash";import"../../../contexts/TrackFormContext.esm.js";import"../../../contexts/CheckFormContext.esm.js";import"../../../contexts/CampaignFormContext.esm.js";import"../../../contexts/UserProvider.esm.js";import{Loading as $}from"../../TechHealth/Loading/Loading.esm.js";import{trackPassRatesToCsv as H}from"../TechHealthExportFunctions.esm.js";import{ActionColumn as W}from"../ActionColumn.esm.js";import{NameColumn as q}from"../NameColumn.esm.js";import{OwnerColumn as z}from"../OwnerColumn.esm.js";import{PassRateTabHeader as J}from"../PassRateTabHeader.esm.js";import{usePassRateTabStyles as K}from"../PassRateTabStyles.esm.js";import{ViewMode as h,generateTrackPassRateGridData as Q,getDetailsRoute as U}from"../techHealthTabUtils.esm.js";import{TrackTrendColumn as X}from"./TrackLevelTrendColumn.esm.js";const v=(m,s,o)=>{const i=Math.min(5,s-m+1);return Array.from({length:i}).map((n,l)=>{const a=m+l;return{label:o?"PROGRESS":`LEVEL ${a}`,id:`levels-${l}`,renderCell:r=>{const t=r.levels?.find(({levelOrdinal:f})=>f===a);return t?e(X,{row:t}):e(O,{})}}})},P=(m,s,o,i)=>{const n=m.flatMap(r=>r.levels?.map(t=>t.levelOrdinal)||[]),l=Math.min(...n),a=Math.max(...n);return[{label:"NAME",id:"trackName",renderCell:r=>e(q,{name:r.trackName??r.id,description:r.trackDescription})},...v(l,a,!!o),{label:"OWNER",id:"trackOwnerRef",renderCell:r=>e(z,{ownerEntityRef:r.trackOwnerRef??void 0})},{label:"ACTION",id:"action",renderCell:({id:r})=>e(W,{navigateTo:U(r,s,o,i)})}]},Y=()=>{const m=K(),{filter:s}=I(),o=A(G),{data:i,isLoading:n,isError:l}=F(s),[a,r]=d(h.TABLE),[t,f]=d(""),[u,R]=d(0),[T,w]=d(10);D(()=>{R(0)},[s,t]);const b=S(()=>P(i?.individualTrackPassRate??[],o),[i?.individualTrackPassRate,o]);if(n)return e($,{});if(l)return e(k,{color:"error",children:"Failed to load tracks"});const{individualTrackPassRate:C}=i;if(!C)return e(k,{color:"error",children:"No available tracks"});const c=t.length?C.filter(({id:p,trackName:g})=>g?.toLowerCase()?.includes(t.toLowerCase())||p.toLowerCase().includes(t.toLowerCase())):C,E=async()=>H(c),L=(p,g)=>{R(()=>g)},M=p=>{w(+p.target.value),R(0)};return e(x,{className:m.root,children:N(y,{container:!0,direction:"row",children:[e(J,{viewMode:a,setViewMode:r,isLoading:n,searchTerm:t,setSearchTerm:f,searchPlaceholder:"Search Available Tracks",fetchCsvData:E,csvFilename:B}),a===h.TABLE&&e(j,{data:c,columns:b}),a===h.GRID&&e(V,{data:Q(c.slice(u*T,(u+1)*T),o),totalCount:c?.length??0,page:u,rowsPerPage:T,onPageChange:L,onRowsPerPageChange:M})]})})};export{Y as TrackResultsTab,P as generateColumns,v as generateTrendColumns};
2
2
  //# sourceMappingURL=TrackResultsTab.esm.js.map
@@ -1,2 +1,2 @@
1
- import{jsxs as a,jsx as i,Fragment as o}from"react/jsx-runtime";import{Box as t,Card as s,Text as n}from"@backstage/ui";import{makeStyles as h}from"@material-ui/core";import{Skeleton as p}from"@material-ui/lab";const m=h(()=>({summaryTilesContainer:{gap:"var(--bui-space-4)",display:"flex",marginBottom:"var(--bui-space-4)"},summaryTile:{padding:"var(--bui-space-3)"},tile:{minHeight:90,display:"flex",flexDirection:"column",justifyContent:"space-between"}})),c=({title:e,content:l,isLoading:r})=>{const d=m();return a(t,{className:d.tile,children:[i(n,{variant:"body-large",children:e}),r?i(o,{children:i(p,{variant:"text",width:50,height:40})}):i(t,{children:l})]})},g=({summaryStats:e,isLoading:l=!1})=>{const r=m();return a(t,{className:r.summaryTilesContainer,children:[i(s,{className:r.summaryTile,children:i(c,{isLoading:l||e.numTeams===void 0||e.numEntities===void 0,title:"Group Information",content:a(o,{children:[a(t,{children:[i(n,{children:e.numTeams})," ",i(n,{color:"secondary",children:"Groups"})]}),a(t,{children:[i(n,{children:e.numEntities})," ",i(n,{color:"secondary",children:"Entities"})]})]})})}),i(s,{className:r.summaryTile,children:i(c,{isLoading:l||e.totalActiveTracksCampaigns===void 0||e.totalCampaigns===void 0||e.totalTracks===void 0,title:"Tracks & Campaigns",content:a(o,{children:[a(t,{children:[i(n,{children:e.totalActiveTracksCampaigns})," ",i(n,{color:"secondary",children:"Total Tracks & Campaigns"})]}),a(t,{children:[i(n,{children:(e.totalCampaigns??0)+(e.totalTracks??0)})," ",i(n,{color:"secondary",children:"Applicable Tracks & Campaigns"})]})]})})}),i(s,{className:r.summaryTile,children:i(c,{isLoading:l||e.avgCompliance===void 0||e.totalCampaigns===void 0||e.totalTracks===void 0,title:"Average Compliance",content:i(o,{children:i(t,{children:i(n,{variant:"title-medium",children:!e.totalTracks&&!e.totalCampaigns?"-":`${e.avgCompliance}%`})})})})})]})};export{g as SummaryTiles};
1
+ import{jsxs as t,jsx as a,Fragment as d}from"react/jsx-runtime";import{makeStyles as p,Box as l,Card as c,Typography as e}from"@material-ui/core";import{Skeleton as g}from"@material-ui/lab";const s=p(i=>({summaryTilesContainer:{gap:24,display:"flex",marginBottom:32},summaryTile:{flex:1,padding:24,background:i.palette.background.paper},tile:{minHeight:90},container:{margin:"1.5rem 0 0"},box:{display:"flex",alignItems:"center",gap:"0.5rem"},avgCompliance:{fontSize:"2rem"}})),o=({title:i,content:r,isLoading:n})=>{const m=s();return t(l,{className:m.tile,children:[a(e,{children:i}),n?a(d,{children:a(g,{variant:"text",width:50,height:40})}):a(l,{children:r})]})},h=({summaryStats:i,isLoading:r=!1})=>{const n=s();return t(l,{className:n.summaryTilesContainer,children:[a(c,{className:n.summaryTile,children:a(o,{isLoading:r||i.numTeams===void 0||i.numEntities===void 0,title:"Group Information",content:t("div",{className:n.container,children:[t(l,{className:n.box,children:[a(e,{children:i.numTeams})," ",a(e,{color:"textSecondary",children:"Groups"})]}),t(l,{className:n.box,children:[a(e,{children:i.numEntities})," ",a(e,{color:"textSecondary",children:"Entities"})]})]})})}),a(c,{className:n.summaryTile,children:a(o,{isLoading:r||i.totalActiveTracksCampaigns===void 0||i.totalCampaigns===void 0||i.totalTracks===void 0,title:"Tracks & Campaigns",content:t("div",{className:n.container,children:[t(l,{className:n.box,children:[a(e,{children:i.totalActiveTracksCampaigns})," ",a(e,{color:"textSecondary",children:"Total Tracks & Campaigns"})]}),t(l,{className:n.box,children:[a(e,{children:(i.totalCampaigns??0)+(i.totalTracks??0)})," ",a(e,{color:"textSecondary",children:"Applicable Tracks & Campaigns"})]})]})})}),a(c,{className:n.summaryTile,children:a(o,{isLoading:r||i.avgCompliance===void 0||i.totalCampaigns===void 0||i.totalTracks===void 0,title:"Average Compliance",content:a("div",{className:n.container,children:a(l,{children:a(e,{className:n.avgCompliance,children:!i.totalTracks&&!i.totalCampaigns?"-":`${i.avgCompliance}%`})})})})})]})};export{h as SummaryTiles};
2
2
  //# sourceMappingURL=SummaryTiles.esm.js.map
@@ -0,0 +1,2 @@
1
+ import{jsxs as a,jsx as i,Fragment as o}from"react/jsx-runtime";import{Box as t,Card as s,Text as n}from"@backstage/ui";import{makeStyles as h}from"@material-ui/core";import{Skeleton as p}from"@material-ui/lab";const m=h(()=>({summaryTilesContainer:{gap:"var(--bui-space-4)",display:"flex",marginBottom:"var(--bui-space-4)"},summaryTile:{padding:"var(--bui-space-3)"},tile:{minHeight:90,display:"flex",flexDirection:"column",justifyContent:"space-between"}})),c=({title:e,content:l,isLoading:r})=>{const d=m();return a(t,{className:d.tile,children:[i(n,{variant:"body-large",children:e}),r?i(o,{children:i(p,{variant:"text",width:50,height:40})}):i(t,{children:l})]})},g=({summaryStats:e,isLoading:l=!1})=>{const r=m();return a(t,{className:r.summaryTilesContainer,children:[i(s,{className:r.summaryTile,children:i(c,{isLoading:l||e.numTeams===void 0||e.numEntities===void 0,title:"Group Information",content:a(o,{children:[a(t,{children:[i(n,{children:e.numTeams})," ",i(n,{color:"secondary",children:"Groups"})]}),a(t,{children:[i(n,{children:e.numEntities})," ",i(n,{color:"secondary",children:"Entities"})]})]})})}),i(s,{className:r.summaryTile,children:i(c,{isLoading:l||e.totalActiveTracksCampaigns===void 0||e.totalCampaigns===void 0||e.totalTracks===void 0,title:"Tracks & Campaigns",content:a(o,{children:[a(t,{children:[i(n,{children:e.totalActiveTracksCampaigns})," ",i(n,{color:"secondary",children:"Total Tracks & Campaigns"})]}),a(t,{children:[i(n,{children:(e.totalCampaigns??0)+(e.totalTracks??0)})," ",i(n,{color:"secondary",children:"Applicable Tracks & Campaigns"})]})]})})}),i(s,{className:r.summaryTile,children:i(c,{isLoading:l||e.avgCompliance===void 0||e.totalCampaigns===void 0||e.totalTracks===void 0,title:"Average Compliance",content:i(o,{children:i(t,{children:i(n,{variant:"title-medium",children:!e.totalTracks&&!e.totalCampaigns?"-":`${e.avgCompliance}%`})})})})})]})};export{g as SummaryTilesBUI};
2
+ //# sourceMappingURL=SummaryTilesBUI.esm.js.map
@@ -1,2 +1,2 @@
1
- import{jsx as a,jsxs as B,Fragment as Ee}from"react/jsx-runtime";import{useApi as Re,useRouteRef as be}from"@backstage/core-plugin-api";import{entityPresentationApiRef as ve}from"@backstage/plugin-catalog-react";import{Box as Z,HeaderPage as Ie,Flex as Pe,SearchField as Be}from"@backstage/ui";import{makeStyles as xe,Box as x,Typography as le,LinearProgress as Ae}from"@material-ui/core";import{useTheme as Fe}from"@material-ui/core/styles";import{isEmpty as Me}from"lodash";import{useState as K,useMemo as l,useEffect as pe,useCallback as me}from"react";import{useSearchParams as Ne,useNavigate as $e}from"react-router-dom";import je from"react-use/lib/useDebounce";import de from"react-use/lib/useLocalStorage";import"@tanstack/react-query";import"../../api.esm.js";import{useBatchedHierarchicalTrackStatuses as Ue}from"../../hooks/heirarchy/useBatchedHierarchicalTrackStatuses.esm.js";import{useGroupHierarchy as Ge}from"../../hooks/heirarchy/useGroupHierarchy.esm.js";import{useTracksApplicableToGroup as He}from"../../hooks/tracks/useTracksApplicableToGroup.esm.js";import{useFeatureFlag as Oe}from"../../hooks/useFeatureFlag.esm.js";import{useLCPReporting as ze}from"../../hooks/useLCPReporting.esm.js";import{useLoadTimeReporting as De}from"../../hooks/useLoadTimeReporting.esm.js";import{techInsightsTrackRouteRef as Ve}from"../../routes.esm.js";import{getEntitiesBucket as We,getTracksBucket as Ze}from"../../utils/helpers.esm.js";import"../GroupHierarchySelector/GroupHierarchySelectorDialog.esm.js";import"@remixicon/react";import{getAllOwnedEntityCount as Ke}from"../GroupHierarchySelector/getAllOwnedEntityCount.esm.js";import"../SoundcheckHeader/SoundcheckHeader.esm.js";import"../SoundcheckHeader/SoundcheckHeaderContext.esm.js";import{useSetHeaderDefault as Qe}from"../SoundcheckHeader/useHeader.esm.js";import{TechInsightsGroupSelector as ge}from"../TechInsightsGroupSelector/TechInsightsGroupSelector.esm.js";import{FilterControls as Xe}from"./FilterControls.esm.js";import{SummaryTiles as Ye}from"./SummaryTiles.esm.js";import{TechInsightsTableBUI as _e}from"./TechInsightsTableBUI.esm.js";import{TechInsightsTableView as qe}from"./TechInsightsTableView.esm.js";const Je=xe(o=>({container:{padding:o.spacing(3,2),paddingTop:0,position:"relative"},gridContainer:{marginTop:o.spacing(3)},gridItem:{cursor:"pointer","&:hover":{transform:"scale(1.02)",transition:"transform 0.2s ease-in-out"}},emptyState:{textAlign:"center",padding:o.spacing(4)},errorState:{textAlign:"center",padding:o.spacing(4)},headerControls:{display:"flex",alignItems:"center"},progressIndicator:{position:"absolute",top:0,left:0,right:0,zIndex:o.zIndex.speedDial},tableRow:{"&:hover":{backgroundColor:o.palette.action.hover}}})),et=()=>{const o=Oe("backstage-ui"),[n,g]=Ne(),r=n.get("group")||"",[R,A]=de("soundcheck-tech-insights-sort-column"),[b,F]=de("soundcheck-tech-insights-sort-direction"),[m,Q]=K(n.get("search")||""),[v,ue]=K(""),[p,he]=K(n.get("tracks")?.split(",").filter(Boolean)||[]),X=l(()=>({routeName:"soundcheck-tech-insights",additionalAttributes:{group:r||"",tracksFilter:p.join(",")||"",tracksFilterCount:p.length,tracksSearch:v||""}}),[r,v,p]),{reportContentLoaded:Y}=De({...X,enabled:!!r}),{reporter:fe}=ze(X),y=Je(),ke=Fe(),_=$e();Qe();const M=Re(ve),u=n.get("sortBy"),h=n.get("direction"),N=u||"entities",$=h||"desc";pe(()=>{u&&u!==R&&A(u),h&&h!==b&&F(h);const e=new URLSearchParams(n.toString());let t=!1;!u&&R&&(e.set("sortBy",R),t=!0),!h&&b&&(e.set("direction",b),t=!0),t&&g(e,{replace:!0})},[R,b,n,A,F,g,h,u]),je(()=>{ue(m);const e=new URLSearchParams(n.toString());m?e.set("search",m):e.delete("search"),g(e,{replace:!0})},500,[m]);const ye=me(e=>{he(e);const t=new URLSearchParams(n.toString());e.length>0?t.set("tracks",e.join(",")):t.delete("tracks"),g(t,{replace:!0})},[n,g]),q=e=>{const t=N===e&&$==="asc"?"desc":"asc",i=new URLSearchParams(n.toString());i.set("sortBy",e),i.set("direction",t),g(i,{replace:!0}),A(e),F(t)},{tracks:T,counts:j,isLoading:C,error:U,activeTrackCount:G}=He(r,{},{enabled:!!r}),S=T.filter(e=>e.type==="campaign"),w=T.filter(e=>e.type!=="campaign"),Te=l(()=>[...S,...w].map(e=>({id:e.id,name:e.name,type:e.type==="campaign"?"Campaign":"Track"})),[S,w]),f=S.filter(e=>{const t=v.toLowerCase(),i=(e.ownerEntityRef?M.forEntity(e.ownerEntityRef):void 0)?.snapshot.primaryTitle?.toLowerCase()||"",E=t===""||e.name.toLowerCase().includes(t)||e.ownerEntityRef?.toLowerCase().includes(t)||i.includes(t),c=p.length===0||p.includes(e.id);return E&&c}),k=w.filter(e=>{const t=v.toLowerCase(),i=(e.ownerEntityRef?M.forEntity(e.ownerEntityRef):void 0)?.snapshot.primaryTitle?.toLowerCase()||"",E=t===""||e.name.toLowerCase().includes(t)||e.ownerEntityRef?.toLowerCase().includes(t)||i.includes(t),c=p.length===0||p.includes(e.id);return E&&c}),d=l(()=>[...S.map(e=>e.id),...w.map(e=>e.id)],[S,w]),{data:H,isLoading:Ce,error:Se,progress:s}=Ue({trackIds:d,groupRef:r||"",skip:!r||d.length===0}),{data:J,isLoading:I}=Ge(r,{includeParent:!0}),P=l(()=>{const e=new Map;return Array.isArray(H)&&H.forEach(t=>{t&&t.trackId&&e.set(t.trackId,t)}),e},[H]),ee=l(()=>{const e=new Map;return Array.isArray(j)&&j.forEach(t=>{t&&t.id&&e.set(t.id,t.applicableEntityCount)}),e},[j]),O=C&&!U&&!!r,te=U||Se,z=d.length>0&&Ce&&!te&&!!r,re=l(()=>({totalCampaigns:f.length,totalTracks:k.length,totalActiveTracksCampaigns:G}),[G,f.length,k.length]),ae=l(()=>{if(z)return{numTeams:void 0,avgCompliance:void 0};let e=0,t=0;const i=new Set;return[...f,...k].forEach(E=>{const c=P.get(E.id);if(c){c.status&&typeof c.status.allPassPercentage=="number"&&(e+=c.status.allPassPercentage,t++),c.groupRef&&i.add(c.groupRef);const V=[c];for(;V.length>0;){const Le=V.pop();for(const W of Le.children)i.has(W.groupRef)||(i.add(W.groupRef),V.push(W))}}}),{numTeams:i.size,avgCompliance:t>0?Math.round(e/t):0}},[f,k,P,z]),L=l(()=>{if(I)return{numEntities:void 0};const e=J?.[r];return{numEntities:Ke(e)}},[J,I,r]),we=l(()=>({...re,...ae,...L}),[re,ae,L]),oe=be(Ve),ie=me(e=>{if(!r)return;const t=new URLSearchParams;t.set("group",r),t.set("track",e),t.set("node",r),_(`${oe()}?${t.toString()}`)},[r,_,oe]),ne=r?M.forEntity(r).snapshot.primaryTitle:void 0,D=l(()=>!s||s.totalTracks===0?0:s.loadedTracks/s.totalTracks*100,[s]),se=C&&r&&!U||z&&s&&s.totalTracks>0,ce=fe?.getLCPValue();return pe(()=>{if(!I&&!C&&(D===100||d.length===0)){const e=L.numEntities??0,t=d.length;Y({lcp:ce,numberOfEntities:L.numEntities,entitiesBucket:We(e),numberOfTracks:d.length,tracksBucket:Ze(t)})}},[I,C,D,d.length,L.numEntities,Y,ce]),te&&!o?a(x,{className:y.container,children:a(le,{variant:"h4",className:y.errorState,children:"Error loading tech insights data"})}):B(Ee,{children:[o&&a(Z,{children:a(Ie,{title:`${ne?`${ne}'s `:""}Tech Insights`,customActions:B(Pe,{justify:"between",align:"center",gap:"3",children:[a(ge,{hideSelected:!0}),a(Be,{isDisabled:Me(T),value:m,onChange:Q,placeholder:"Search tracks or campaigns",style:{minWidth:250}})]})})}),B(Z,{className:y.container,children:[!o&&B(x,{display:"flex",justifyContent:"space-between",alignItems:"center",gridGap:12,marginBottom:3,children:[a(ge,{}),a(Xe,{searchText:m,onSearchTextChange:Q,selectedTrackIds:p,onSelectedTrackIdsChange:ye,trackOptions:Te,applicableTracks:T,isLoading:O})]}),a(Z,{style:{marginTop:0},children:a(Ye,{summaryStats:we,isLoading:O})}),se&&a(x,{style:{marginBottom:16},children:a(Ae,{variant:s&&s.totalTracks>0?"determinate":"indeterminate",value:s&&s.totalTracks>0?D:void 0,"data-testid":"batch-loading-indicator"})}),o&&a(_e,{tracks:[...f,...k],trackStatusMap:P,trackCountsMap:ee,sortColumn:N,order:$,handleSort:q,handleTrackClick:ie,isLoading:O||!!se,isSearch:!!m,activeTrackCount:G,hasGroupSelected:!!r}),!o&&(T.length===0&&!C?a(x,{className:y.emptyState,children:a(le,{variant:"h6",children:r?"No applicable tracks found for the selected group":"Please select a group to view applicable tracks"})}):a(qe,{tracks:[...f,...k],trackStatusMap:P,trackCountsMap:ee,orderBy:N,order:$,handleSort:q,handleTrackClick:ie,theme:ke,classes:y}))]})]})};export{et as TechInsightsPage};
1
+ import{jsx as e}from"react/jsx-runtime";import{useFeatureFlag as t}from"../../hooks/useFeatureFlag.esm.js";import{TechInsightsPageBUI as r}from"./TechInsightsPageBUI.esm.js";import{TechInsightsPageDeprecated as o}from"./TechInsightsPageDeprecated.esm.js";const s=()=>t("backstage-ui")?e(r,{}):e(o,{});export{s as TechInsightsPage};
2
2
  //# sourceMappingURL=TechInsightsPage.esm.js.map
@@ -0,0 +1,2 @@
1
+ import{jsx as o,jsxs as M,Fragment as de}from"react/jsx-runtime";import{useApi as ue,useRouteRef as X}from"@backstage/core-plugin-api";import{entityPresentationApiRef as ge}from"@backstage/plugin-catalog-react";import{Box as g,HeaderPage as he,Flex as fe,SearchField as ke}from"@backstage/ui";import{makeStyles as ye,LinearProgress as Te}from"@material-ui/core";import{isEmpty as Se}from"lodash";import{useState as _,useMemo as s,useCallback as Ee,useEffect as Ce}from"react";import{useSearchParams as Le,useNavigate as Re}from"react-router-dom";import we from"react-use/lib/useDebounce";import"@backstage/catalog-model";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import"@spotify/backstage-plugin-soundcheck-common";import"../../hooks/useSoundcheckAlert.esm.js";import"../../hooks/useConfirmationModal.esm.js";import{useSortTableLocalStorage as ve}from"../../hooks/useSortTableLocalStorage.esm.js";import{useBatchedHierarchicalTrackStatuses as be}from"../../hooks/heirarchy/useBatchedHierarchicalTrackStatuses.esm.js";import{useGroupHierarchy as Ie}from"../../hooks/heirarchy/useGroupHierarchy.esm.js";import{useTracksApplicableToGroup as Pe}from"../../hooks/tracks/useTracksApplicableToGroup.esm.js";import{useFeatureFlag as Be}from"../../hooks/useFeatureFlag.esm.js";import{useLCPReporting as Ae}from"../../hooks/useLCPReporting.esm.js";import{useLoadTimeReporting as xe}from"../../hooks/useLoadTimeReporting.esm.js";import{trackExplorerRouteRef as Me,campaignExplorerRouteRef as Ue}from"../../routes.esm.js";import{getAllOwnedEntityCount as Fe}from"../../utils/getAllOwnedEntityCount.esm.js";import{getEntitiesBucket as $e,getTracksBucket as De}from"../../utils/helpers.esm.js";import"../EmptyState/EmptyState.esm.js";import{EmptyStateBUI as Ge}from"../EmptyState/EmptyStateBUI.esm.js";import"@backstage/plugin-permission-react";import"@remixicon/react";import"../SoundcheckHeader/SoundcheckHeader.esm.js";import"../SoundcheckHeader/SoundcheckHeaderContext.esm.js";import{useSetHeaderDefault as He}from"../SoundcheckHeader/useHeader.esm.js";import{TechInsightsGroupSelector as Ne}from"../TechInsightsGroupSelector/TechInsightsGroupSelector.esm.js";import{SummaryTiles as Oe}from"./SummaryTiles.esm.js";import{SummaryTilesBUI as je}from"./SummaryTilesBUI.esm.js";import{TechInsightsTableBUI as Ve}from"./TechInsightsTableBUI.esm.js";const ze=ye(()=>({container:{padding:"var(--bui-space-3)",paddingTop:0,position:"relative"}})),We=()=>{const Y=Be("backstage-ui"),[S,Z]=Le(),r=S.get("group")||"",[m,ee]=_(S.get("search")||""),[h,te]=_(""),U=s(()=>({routeName:"soundcheck-tech-insights",additionalAttributes:{group:r||"",tracksSearch:h||""}}),[r,h]),{reportContentLoaded:F}=xe({...U,enabled:!!r}),{reporter:re}=Ae(U),$=ze(),D=Re();He();const E=ue(ge),{order:ae,orderBy:oe,handleSort:ie}=ve({localStoragePrefix:"soundcheck-tech-insights",defaultSortBy:"entities",defaultDirection:"desc"});we(()=>{te(m);const e=new URLSearchParams(S.toString());m?e.set("search",m):e.delete("search"),Z(e,{replace:!0})},500,[m]);const{tracks:C,campaigns:G,counts:L,isLoading:l,error:R,activeTrackCount:w}=Pe(r,{},{enabled:!!r}),p=C.filter(e=>e.type==="campaign"),v=C.filter(e=>e.type!=="campaign"),f=p.filter(e=>{const t=h.toLowerCase(),n=(e.ownerEntityRef?E.forEntity(e.ownerEntityRef):void 0)?.snapshot.primaryTitle?.toLowerCase()||"";return t===""||e.name.toLowerCase().includes(t)||e.ownerEntityRef?.toLowerCase().includes(t)||n.includes(t)}),k=v.filter(e=>{const t=h.toLowerCase(),n=(e.ownerEntityRef?E.forEntity(e.ownerEntityRef):void 0)?.snapshot.primaryTitle?.toLowerCase()||"";return t===""||e.name.toLowerCase().includes(t)||e.ownerEntityRef?.toLowerCase().includes(t)||n.includes(t)}),b=s(()=>[...f,...k],[f,k]),c=s(()=>[...p.map(e=>e.id),...v.map(e=>e.id)],[p,v]),{data:I,isLoading:ne,error:se,progress:i}=be({trackIds:c,groupRef:r||"",skip:!r||c.length===0}),{data:H,isLoading:y}=Ie(r,{includeParent:!0}),P=s(()=>{const e=new Map;return Array.isArray(I)&&I.forEach(t=>{t&&t.trackId&&e.set(t.trackId,t)}),e},[I]),ce=s(()=>{const e=new Map;return Array.isArray(L)&&L.forEach(t=>{t&&t.id&&e.set(t.id,t.applicableEntityCount)}),e},[L]),N=l&&!R&&!!r,O=R||se,B=c.length>0&&ne&&!O&&!!r,j=s(()=>({totalCampaigns:f.length,totalTracks:k.length,totalActiveTracksCampaigns:w}),[w,f.length,k.length]),V=s(()=>{if(B)return{numTeams:void 0,avgCompliance:void 0};let e=0,t=0;const n=new Set;return b.forEach(T=>{const a=P.get(T.id);if(a){a.status&&typeof a.status.allPassPercentage=="number"&&(e+=a.status.allPassPercentage,t++),a.groupRef&&n.add(a.groupRef);const u=[a];for(;u.length>0;){const pe=u.pop();for(const x of pe.children)n.has(x.groupRef)||(n.add(x.groupRef),u.push(x))}}}),{numTeams:n.size,avgCompliance:t>0?Math.round(e/t):0}},[b,P,B]),d=s(()=>{if(y)return{numEntities:void 0};const e=H?.[r];return{numEntities:Fe(e)}},[H,y,r]),z=s(()=>({...j,...V,...d}),[j,V,d]),W=X(Me),q=X(Ue),me=Ee(e=>{if(!r)return;const t=new URLSearchParams;t.set("group",r),t.set("node",r);const n=p.find(({id:a})=>a===e);let T=W({trackId:e});if(n){const a=G?.edges.find(({node:u})=>u.track.id===e)?.node.id;a&&(T=q({campaignId:a}))}D(`${T}?${t.toString()}`)},[r,D,p,G,q,W]),J=r?E.forEntity(r).snapshot.primaryTitle:void 0,A=s(()=>!i||i.totalTracks===0?0:i.loadedTracks/i.totalTracks*100,[i]),K=l&&r&&!R||B&&i&&i.totalTracks>0,Q=re?.getLCPValue();Ce(()=>{if(!y&&!l&&(A===100||c.length===0)){const e=d.numEntities??0,t=c.length;F({lcp:Q,numberOfEntities:d.numEntities,entitiesBucket:$e(e),numberOfTracks:c.length,tracksBucket:De(t)})}},[y,l,A,c.length,d.numEntities,F,Q]);const le=Y?o(je,{summaryStats:z,isLoading:N}):o(Oe,{summaryStats:z,isLoading:l});return O?o(g,{mt:"6",className:$.container,children:o(Ge,{title:"No Tech Insights Data",body:"There was an error loading Tech Insights data."})}):M(de,{children:[o(g,{children:o(he,{title:`${J?`${J}'s `:""}Tech Insights`,customActions:M(fe,{align:"center",gap:"3",children:[o(Ne,{hideSelected:!0}),o(ke,{isDisabled:Se(C),value:m,onChange:ee,placeholder:"Search tracks or campaigns",style:{minWidth:250},"aria-label":"Search"})]})})}),M(g,{className:$.container,children:[o(g,{style:{marginTop:0},children:le}),K&&o(g,{style:{marginBottom:16},children:o(Te,{variant:i&&i.totalTracks>0?"determinate":"indeterminate",value:i&&i.totalTracks>0?A:void 0,"data-testid":"batch-loading-indicator"})}),o(Ve,{tracks:b,trackStatusMap:P,trackCountsMap:ce,sortColumn:oe,order:ae,handleSort:ie,handleTrackClick:me,isLoading:N||!!K,isSearch:!!m,activeTrackCount:w,hasGroupSelected:!!r})]})]})};export{We as TechInsightsPageBUI};
2
+ //# sourceMappingURL=TechInsightsPageBUI.esm.js.map
@@ -0,0 +1,2 @@
1
+ import{jsx as o,Fragment as ge,jsxs as Q}from"react/jsx-runtime";import{useApi as ue,useRouteRef as he}from"@backstage/core-plugin-api";import{entityPresentationApiRef as fe}from"@backstage/plugin-catalog-react";import{makeStyles as ke,Box as d,Typography as W,LinearProgress as ye}from"@material-ui/core";import{useTheme as Te}from"@material-ui/core/styles";import{useState as M,useMemo as s,useCallback as X,useEffect as Ce}from"react";import{useSearchParams as Se,useNavigate as we}from"react-router-dom";import Ee from"react-use/lib/useDebounce";import"@backstage/catalog-model";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import"@spotify/backstage-plugin-soundcheck-common";import"../../hooks/useSoundcheckAlert.esm.js";import"../../hooks/useConfirmationModal.esm.js";import{useSortTableLocalStorage as Le}from"../../hooks/useSortTableLocalStorage.esm.js";import{useBatchedHierarchicalTrackStatuses as Re}from"../../hooks/heirarchy/useBatchedHierarchicalTrackStatuses.esm.js";import{useGroupHierarchy as ve}from"../../hooks/heirarchy/useGroupHierarchy.esm.js";import{useTracksApplicableToGroup as be}from"../../hooks/tracks/useTracksApplicableToGroup.esm.js";import{useLCPReporting as Pe}from"../../hooks/useLCPReporting.esm.js";import{useLoadTimeReporting as Ie}from"../../hooks/useLoadTimeReporting.esm.js";import{techInsightsTrackRouteRef as xe}from"../../routes.esm.js";import{getAllOwnedEntityCount as Ae}from"../../utils/getAllOwnedEntityCount.esm.js";import{getEntitiesBucket as Be,getTracksBucket as Me}from"../../utils/helpers.esm.js";import"../SoundcheckHeader/SoundcheckHeader.esm.js";import"../SoundcheckHeader/SoundcheckHeaderContext.esm.js";import{useSetHeaderDefault as Ne}from"../SoundcheckHeader/useHeader.esm.js";import{TechInsightsGroupSelector as je}from"../TechInsightsGroupSelector/TechInsightsGroupSelector.esm.js";import{FilterControls as Ge}from"./FilterControls.esm.js";import{SummaryTiles as De}from"./SummaryTiles.esm.js";import{TechInsightsTableView as Fe}from"./TechInsightsTableView.esm.js";const Oe=ke(a=>({container:{padding:a.spacing(3,2),paddingTop:0,position:"relative"},gridContainer:{marginTop:a.spacing(3)},gridItem:{cursor:"pointer","&:hover":{transform:"scale(1.02)",transition:"transform 0.2s ease-in-out"}},emptyState:{textAlign:"center",padding:a.spacing(4)},errorState:{textAlign:"center",padding:a.spacing(4)},headerControls:{display:"flex",alignItems:"center"},progressIndicator:{position:"absolute",top:0,left:0,right:0,zIndex:a.zIndex.speedDial},tableRow:{"&:hover":{backgroundColor:a.palette.action.hover}}})),ze=()=>{const[a,L]=Se(),r=a.get("group")||"",[g,Y]=M(a.get("search")||""),[S,Z]=M(""),[c,_]=M(a.get("tracks")?.split(",").filter(Boolean)||[]),N=s(()=>({routeName:"soundcheck-tech-insights",additionalAttributes:{group:r||"",tracksFilter:c.join(",")||"",tracksFilterCount:c.length,tracksSearch:S||""}}),[r,S,c]),{reportContentLoaded:j}=Ie({...N,enabled:!!r}),{reporter:q}=Pe(N),u=Oe(),J=Te(),G=we();Ne();const D=ue(fe),{order:K,orderBy:ee,handleSort:te}=Le({localStoragePrefix:"soundcheck-tech-insights",defaultSortBy:"entities",defaultDirection:"desc"});Ee(()=>{Z(g);const e=new URLSearchParams(a.toString());g?e.set("search",g):e.delete("search"),L(e,{replace:!0})},500,[g]);const re=X(e=>{_(e);const t=new URLSearchParams(a.toString());e.length>0?t.set("tracks",e.join(",")):t.delete("tracks"),L(t,{replace:!0})},[a,L]),{tracks:w,counts:R,isLoading:m,error:v,activeTrackCount:F}=be(r,{},{enabled:!!r}),h=w.filter(e=>e.type==="campaign"),f=w.filter(e=>e.type!=="campaign"),ae=s(()=>[...h,...f].map(e=>({id:e.id,name:e.name,type:e.type==="campaign"?"Campaign":"Track"})),[h,f]),k=h.filter(e=>{const t=S.toLowerCase(),l=(e.ownerEntityRef?D.forEntity(e.ownerEntityRef):void 0)?.snapshot.primaryTitle?.toLowerCase()||"",C=t===""||e.name.toLowerCase().includes(t)||e.ownerEntityRef?.toLowerCase().includes(t)||l.includes(t),i=c.length===0||c.includes(e.id);return C&&i}),y=f.filter(e=>{const t=S.toLowerCase(),l=(e.ownerEntityRef?D.forEntity(e.ownerEntityRef):void 0)?.snapshot.primaryTitle?.toLowerCase()||"",C=t===""||e.name.toLowerCase().includes(t)||e.ownerEntityRef?.toLowerCase().includes(t)||l.includes(t),i=c.length===0||c.includes(e.id);return C&&i}),p=s(()=>[...h.map(e=>e.id),...f.map(e=>e.id)],[h,f]),{data:b,isLoading:oe,error:ne,progress:n}=Re({trackIds:p,groupRef:r||"",skip:!r||p.length===0}),{data:O,isLoading:E}=ve(r,{includeParent:!0}),P=s(()=>{const e=new Map;return Array.isArray(b)&&b.forEach(t=>{t&&t.trackId&&e.set(t.trackId,t)}),e},[b]),ie=s(()=>{const e=new Map;return Array.isArray(R)&&R.forEach(t=>{t&&t.id&&e.set(t.id,t.applicableEntityCount)}),e},[R]),se=m&&!v&&!!r,z=v||ne,I=p.length>0&&oe&&!z&&!!r,H=s(()=>({totalCampaigns:k.length,totalTracks:y.length,totalActiveTracksCampaigns:F}),[F,k.length,y.length]),U=s(()=>{if(I)return{numTeams:void 0,avgCompliance:void 0};let e=0,t=0;const l=new Set;return[...k,...y].forEach(C=>{const i=P.get(C.id);if(i){i.status&&typeof i.status.allPassPercentage=="number"&&(e+=i.status.allPassPercentage,t++),i.groupRef&&l.add(i.groupRef);const A=[i];for(;A.length>0;){const de=A.pop();for(const B of de.children)l.has(B.groupRef)||(l.add(B.groupRef),A.push(B))}}}),{numTeams:l.size,avgCompliance:t>0?Math.round(e/t):0}},[k,y,P,I]),T=s(()=>{if(E)return{numEntities:void 0};const e=O?.[r];return{numEntities:Ae(e)}},[O,E,r]),ce=s(()=>({...H,...U,...T}),[H,U,T]),$=he(xe),le=X(e=>{if(!r)return;const t=new URLSearchParams;t.set("group",r),t.set("track",e),t.set("node",r),G(`${$()}?${t.toString()}`)},[r,G,$]),x=s(()=>!n||n.totalTracks===0?0:n.loadedTracks/n.totalTracks*100,[n]),pe=m&&r&&!v||I&&n&&n.totalTracks>0,V=q?.getLCPValue();Ce(()=>{if(!E&&!m&&(x===100||p.length===0)){const e=T.numEntities??0,t=p.length;j({lcp:V,numberOfEntities:T.numEntities,entitiesBucket:Be(e),numberOfTracks:p.length,tracksBucket:Me(t)})}},[E,m,x,p.length,T.numEntities,j,V]);const me=o(De,{summaryStats:ce,isLoading:m});return z?o(d,{className:u.container,children:o(W,{variant:"h4",className:u.errorState,children:"Error loading tech insights data"})}):o(ge,{children:Q(d,{className:u.container,children:[Q(d,{display:"flex",justifyContent:"space-between",alignItems:"center",gridGap:12,marginBottom:3,children:[o(je,{}),o(Ge,{searchText:g,onSearchTextChange:Y,selectedTrackIds:c,onSelectedTrackIdsChange:re,trackOptions:ae,applicableTracks:w,isLoading:se})]}),o(d,{style:{marginTop:0},children:me}),pe&&o(d,{style:{marginBottom:16},children:o(ye,{variant:n&&n.totalTracks>0?"determinate":"indeterminate",value:n&&n.totalTracks>0?x:void 0,"data-testid":"batch-loading-indicator"})}),w.length===0&&!m?o(d,{className:u.emptyState,children:o(W,{variant:"h6",children:r?"No applicable tracks found for the selected group":"Please select a group to view applicable tracks"})}):o(Fe,{tracks:[...k,...y],trackStatusMap:P,trackCountsMap:ie,orderBy:ee,order:K,handleSort:te,handleTrackClick:le,theme:J,classes:u})]})})};export{ze as TechInsightsPageDeprecated};
2
+ //# sourceMappingURL=TechInsightsPageDeprecated.esm.js.map
@@ -1,2 +1,2 @@
1
- import{jsx as t,jsxs as k,Fragment as M}from"react/jsx-runtime";import{useApi as A}from"@backstage/core-plugin-api";import{entityPresentationApiRef as B}from"@backstage/plugin-catalog-react";import{Table as $,TableHeader as j,Column as m,TableBody as H,Row as U,Cell as y,CellProfile as q}from"@backstage/ui";import{uniq as z,isEmpty as P,isNumber as R}from"lodash";import{useMemo as w}from"react";import{useProfileImages as D}from"../../hooks/catalog/useProfileImages.esm.js";import"../CheckStatusBar/CheckStatusBar.esm.js";import"../CheckStatusBar/CheckStatusBarBUI.esm.js";import{CheckStatusBarCell as F}from"../CheckStatusBar/CheckStatusBarCell.esm.js";import"../EmptyState/EmptyState.esm.js";import{EmptyStateBUI as G}from"../EmptyState/EmptyStateBUI.esm.js";import{EmptyStateNoTracks as N}from"../EmptyState/EmptyStateNoTracks.esm.js";import"@backstage/plugin-permission-react";import"@spotify/backstage-plugin-soundcheck-common";import"react-router-dom";import"../../routes.esm.js";import{LoadingTableSkeleton as v}from"../LoadingTableSkeleton/LoadingTableSkeleton.esm.js";const O=({track:s,trackStatus:r,entitiesCount:d,handleTrackClick:C,profileImageMap:u})=>{const n=A(B).forEntity(s.ownerEntityRef),l=w(()=>s.levels.reduce((c,p)=>c+p.checks.length,0),[s.levels]),S=w(()=>{let c;if(r?.allPassPercentage!==null&&r?.allPassPercentage!==void 0)c=r.allPassPercentage;else if(r){const p=(r.passed??0)+(r.failed??0)+(r.warning??0)+(r.error??0)+(r.notReported??0)+(r.exempt??0);c=p>0?((r.passed??0)+(r.exempt??0))/p*100:0}return c},[r]),g=u[n.snapshot.entityRef];return k(U,{onAction:()=>{C(s.id)},children:[t(y,{title:s.name??s.id}),t(F,{passPercentage:S}),t(y,{title:s.type==="campaign"?"Campaign":"Track"}),t(y,{title:R(l)?`${l} Check${l===1?"":"s"}`:"N/A"}),t(y,{title:R(d)?`${d} ${d===1?"Entity":"Entities"}`:"N/A"}),t(q,{name:n.snapshot.primaryTitle,src:g??n.snapshot.primaryTitle})]})},Y=({order:s,sortColumn:r,handleSort:d,handleTrackClick:C,tracks:u,trackStatusMap:n,trackCountsMap:l,isSearch:S,isLoading:g,activeTrackCount:c,hasGroupSelected:p})=>{const E=w(()=>[...u].filter(e=>{const a=n.get(e.id)?.status,h=(a?.passed??0)+(a?.failed??0)+(a?.warning??0)+(a?.error??0)+(a?.notReported??0)+(a?.exempt??0);return!a||h>0}).sort((e,a)=>{const h=n.get(e.id),L=n.get(a.id);let o,i;switch(r){case"name":o=e.name?.toLowerCase()||"",i=a.name?.toLowerCase()||"";break;case"type":o=e.type||"",i=a.type||"";break;case"owner":o=e.ownerEntityRef?.toLowerCase()||"",i=a.ownerEntityRef?.toLowerCase()||"";break;case"compliance":o=h?.status?.allPassPercentage??null,i=L?.status?.allPassPercentage??null;break;case"checks":o=e.levels.reduce((b,T)=>b+T.checks.length,0),i=a.levels.reduce((b,T)=>b+T.checks.length,0);break;case"entities":o=l.get(e.id)??0,i=l.get(a.id)??0;break;default:return 0}return typeof o=="number"&&typeof i=="number"?s==="asc"?o-i:i-o:typeof o=="number"&&i===null?-1:o===null&&typeof i=="number"?1:typeof o=="string"&&typeof i=="string"?s==="asc"?o.localeCompare(i):i.localeCompare(o):0}),[u,n,r,l,s]),f=w(()=>E.map(e=>{const a=n.get(e.id)?.status,h=l.get(e.id)??0;return{track:e,trackStatus:a,entitiesCount:h}}),[E,l,n]),x=z(f.map(e=>e.track.ownerEntityRef)),{profileImageMap:I}=D(x);return!g&&P(u)?p?S&&c>0?t(G,{title:"No tracks or campaigns found.",body:"Your current search term did not return any tracks or campaigns. Please try a different search term. "}):t(N,{title:c>0?"No applicable tracks found for the selected group":void 0}):t(N,{title:"Select a group or create a new track"}):k(M,{children:[k($,{sortDescriptor:{column:r,direction:s==="asc"?"ascending":"descending"},onSortChange:e=>d(e.column),children:[k(j,{children:[t(m,{id:"name",allowsSorting:!0,isRowHeader:!0,children:"Name"}),t(m,{id:"compliance",allowsSorting:!0,children:"Compliance"}),t(m,{style:{width:130},id:"type",allowsSorting:!0,children:"Type"}),t(m,{style:{width:150},id:"checks",allowsSorting:!0,children:"Checks"}),t(m,{style:{width:150},id:"entities",allowsSorting:!0,children:"Entities"}),t(m,{id:"owner",allowsSorting:!0,children:"Track Owner"})]}),t(H,{children:f.map(e=>t(O,{handleTrackClick:C,profileImageMap:I??{},...e},e.track.id))})]}),P(f)&&g&&t(v,{rowCount:10}),!P(f)&&g&&t(v,{rowCount:4})]})};export{Y as TechInsightsTableBUI};
1
+ import{jsx as r,jsxs as g,Fragment as A}from"react/jsx-runtime";import{useApi as B}from"@backstage/core-plugin-api";import{entityPresentationApiRef as $}from"@backstage/plugin-catalog-react";import{Table as j,TableHeader as D,Column as h,TableBody as F,Row as H,Cell as P,Flex as U,Text as q,CellProfile as G}from"@backstage/ui";import{uniq as O,isEmpty as x,isNumber as v}from"lodash";import{useMemo as p}from"react";import{useProfileImages as W}from"../../hooks/catalog/useProfileImages.esm.js";import{getPercentage as w}from"../../utils/formatters.esm.js";import{CustomCell as Y}from"../CustomCell/CustomCell.esm.js";import"../EmptyState/EmptyState.esm.js";import{EmptyStateBUI as z}from"../EmptyState/EmptyStateBUI.esm.js";import{EmptyStateNoTracks as N}from"../EmptyState/EmptyStateNoTracks.esm.js";import"@backstage/plugin-permission-react";import"@remixicon/react";import"@spotify/backstage-plugin-soundcheck-common";import"react-router-dom";import"../../routes.esm.js";import{LoadingTableSkeleton as L}from"../LoadingTableSkeleton/LoadingTableSkeleton.esm.js";import{StatusBar as J}from"../StatusBar/StatusBar.esm.js";const K=({track:n,trackStatus:e,entitiesCount:f,handleTrackClick:S,profileImageMap:y})=>{const l=B($).forEntity(n.ownerEntityRef),c=p(()=>n.levels.reduce((d,t)=>d+t.checks.length,0),[n.levels]),s=p(()=>(e?.passed??0)+(e?.failed??0)+(e?.warning??0)+(e?.error??0)+(e?.notReported??0)+(e?.exempt??0),[e]),m=p(()=>{let d;return e?.allPassPercentage!==null&&e?.allPassPercentage!==void 0?d=e.allPassPercentage:e&&(d=w(e.passed+e.exempt,s)),d},[e,s]),C=p(()=>w(e?.failed,s),[e,s]),T=p(()=>w(e?.warning,s),[e,s]),b=p(()=>w(e?.notReported,s),[e,s]),u=p(()=>w(e?.error,s),[e,s]),E=y[l.snapshot.entityRef];return g(H,{onAction:()=>{S(n.id)},children:[r(P,{title:n.name??n.id}),r(Y,{children:g(U,{align:"center",gap:"3",children:[g(q,{children:[m,"%"]}),r(J,{passedPercent:m,failedPercent:C,warningPercent:T,notReportedPercent:b,errorPercent:u})]})}),r(P,{title:n.type==="campaign"?"Campaign":"Track"}),r(P,{title:v(c)?`${c} Check${c===1?"":"s"}`:"N/A"}),r(P,{title:v(f)?`${f} ${f===1?"Entity":"Entities"}`:"N/A"}),r(G,{name:l.snapshot.primaryTitle,src:E??l.snapshot.primaryTitle})]})},Q=({order:n,sortColumn:e,handleSort:f,handleTrackClick:S,tracks:y,trackStatusMap:l,trackCountsMap:c,isSearch:s,isLoading:m,activeTrackCount:C,hasGroupSelected:T})=>{const b=p(()=>[...y].filter(t=>{const a=l.get(t.id)?.status,k=(a?.passed??0)+(a?.failed??0)+(a?.warning??0)+(a?.error??0)+(a?.notReported??0)+(a?.exempt??0);return!a||k>0}).sort((t,a)=>{const k=l.get(t.id),M=l.get(a.id);let o,i;switch(e){case"name":o=t.name?.toLowerCase()||"",i=a.name?.toLowerCase()||"";break;case"type":o=t.type||"",i=a.type||"";break;case"owner":o=t.ownerEntityRef?.toLowerCase()||"",i=a.ownerEntityRef?.toLowerCase()||"";break;case"compliance":o=k?.status?.allPassPercentage??null,i=M?.status?.allPassPercentage??null;break;case"checks":o=t.levels.reduce((R,I)=>R+I.checks.length,0),i=a.levels.reduce((R,I)=>R+I.checks.length,0);break;case"entities":o=c.get(t.id)??0,i=c.get(a.id)??0;break;default:return 0}return typeof o=="number"&&typeof i=="number"?n==="asc"?o-i:i-o:typeof o=="number"&&i===null?-1:o===null&&typeof i=="number"?1:typeof o=="string"&&typeof i=="string"?n==="asc"?o.localeCompare(i):i.localeCompare(o):0}),[y,l,e,c,n]),u=p(()=>b.map(t=>{const a=l.get(t.id)?.status,k=c.get(t.id)??0;return{track:t,trackStatus:a,entitiesCount:k}}),[b,c,l]),E=O(u.map(t=>t.track.ownerEntityRef)),{profileImageMap:d}=W(E);return!m&&x(y)?T?s&&C>0?r(z,{title:"No tracks or campaigns found.",body:"Your current search term did not return any tracks or campaigns. Please try a different search term. "}):r(N,{title:C>0?"No applicable tracks found for the selected group":void 0}):r(N,{title:"Select a group or create a new track"}):g(A,{children:[g(j,{sortDescriptor:{column:e,direction:n==="asc"?"ascending":"descending"},onSortChange:t=>f(t.column),children:[g(D,{children:[r(h,{id:"name",allowsSorting:!0,isRowHeader:!0,style:{width:"43%"},children:"Name"}),r(h,{id:"compliance",allowsSorting:!0,style:{width:"12%"},children:"Compliance"}),r(h,{id:"type",allowsSorting:!0,style:{width:"10%"},children:"Type"}),r(h,{id:"checks",allowsSorting:!0,style:{width:"10%"},children:"Checks"}),r(h,{id:"entities",allowsSorting:!0,style:{width:"10%"},children:"Entities"}),r(h,{id:"owner",allowsSorting:!0,style:{width:"15%"},children:"Track Owner"})]}),r(F,{children:u.map(t=>r(K,{handleTrackClick:S,profileImageMap:d??{},...t},t.track.id))})]}),x(u)&&m&&r(L,{rowCount:10}),!x(u)&&m&&r(L,{rowCount:4})]})};export{Q as TechInsightsTableBUI};
2
2
  //# sourceMappingURL=TechInsightsTableBUI.esm.js.map
@@ -1,2 +1,2 @@
1
- import{jsx as e,Fragment as N,jsxs as g}from"react/jsx-runtime";import{useApi as $}from"@backstage/core-plugin-api";import{entityPresentationApiRef as E}from"@backstage/plugin-catalog-react";import{TableContainer as H,Paper as L,Table as A,TableHead as z,TableRow as x,TableCell as c,TableSortLabel as f,TableBody as B,Typography as b,Box as w}from"@material-ui/core";import F from"@material-ui/icons/ArrowDownward";import M from"@material-ui/icons/ArrowUpward";import{useMemo as D}from"react";import{getColorInterpolator as j,getCheckStatusColor as I}from"../../utils/colors.esm.js";import{CategoryBar as V}from"../CategoryBar/CategoryBar.esm.js";import{CheckStateColors as P}from"../CheckPage/utils.esm.js";import{ColorChip as J}from"../ColorChip/ColorChip.esm.js";const O=({tracks:v,trackStatusMap:m,trackCountsMap:y,orderBy:o,order:s,handleSort:h,handleTrackClick:S,theme:u,classes:l})=>{const R=$(E),T=D(()=>[...v].filter(r=>{const t=m.get(r.id)?.status,d=(t?.passed??0)+(t?.failed??0)+(t?.warning??0)+(t?.error??0)+(t?.notReported??0)+(t?.exempt??0);return!t||d>0}).sort((r,t)=>{const d=m.get(r.id),k=m.get(t.id);let n,a;switch(o){case"name":n=r.name?.toLowerCase()||"",a=t.name?.toLowerCase()||"";break;case"type":n=r.type||"",a=t.type||"";break;case"owner":n=r.ownerEntityRef?.toLowerCase()||"",a=t.ownerEntityRef?.toLowerCase()||"";break;case"compliance":n=d?.status?.allPassPercentage??null,a=k?.status?.allPassPercentage??null;break;case"checks":n=r.levels.reduce((i,C)=>i+C.checks.length,0),a=t.levels.reduce((i,C)=>i+C.checks.length,0);break;case"entities":n=y.get(r.id)??0,a=y.get(t.id)??0;break;default:return 0}return typeof n=="number"&&typeof a=="number"?s==="asc"?n-a:a-n:typeof n=="number"&&a===null?-1:n===null&&typeof a=="number"?1:typeof n=="string"&&typeof a=="string"?s==="asc"?n.localeCompare(a):a.localeCompare(n):0}),[s,o,m,y,v]),p=r=>r.direction==="asc"?e(M,{...r,fontSize:"small"}):e(F,{...r,fontSize:"small"});return e(N,{children:e(H,{component:L,children:g(A,{className:l.table,size:"small",children:[e(z,{children:g(x,{children:[e(c,{width:"30%",className:`${l.tableHeaderCell} ${l.headerCell}`,children:e(f,{active:o==="name",direction:o==="name"?s:"desc",onClick:()=>h("name"),IconComponent:p,children:e("div",{className:l.headerContent,children:"Name"})})}),e(c,{width:"10%",className:`${l.tableHeaderCell} ${l.headerCell}`,children:e(f,{active:o==="checks",direction:o==="checks"?s:"desc",onClick:()=>h("checks"),IconComponent:p,children:e("div",{className:l.headerContent,children:"Checks"})})}),e(c,{width:"10%",className:`${l.tableHeaderCell} ${l.headerCell}`,children:e(f,{active:o==="entities",direction:o==="entities"?s:"desc",onClick:()=>h("entities"),IconComponent:p,children:e("div",{className:l.headerContent,children:"Entities"})})}),e(c,{width:"30%",className:`${l.tableHeaderCell} ${l.headerCell}`,children:e(f,{active:o==="compliance",direction:o==="compliance"?s:"desc",onClick:()=>h("compliance"),IconComponent:p,children:e("div",{className:l.headerContent,children:"Compliance"})})}),e(c,{width:"20%",className:`${l.tableHeaderCell} ${l.headerCell}`,children:e(f,{active:o==="owner",direction:o==="owner"?s:"desc",onClick:()=>h("owner"),IconComponent:p,children:e("div",{className:l.headerContent,children:"Track Owner"})})})]})}),e(B,{children:T.map(r=>{const t=m.get(r.id)?.status;let d=0;if(t?.allPassPercentage!==null&&t?.allPassPercentage!==void 0)d=t.allPassPercentage;else if(t){const i=(t.passed??0)+(t.failed??0)+(t.warning??0)+(t.error??0)+(t.notReported??0)+(t.exempt??0);d=i>0?((t.passed??0)+(t.exempt??0))/i*100:0}const k=r.levels.reduce((i,C)=>i+C.checks.length,0),n=y.get(r.id)??0,a=Math.round(d);return g(x,{onClick:()=>S(r.id),className:l.tableRow,style:{cursor:"pointer"},children:[e(c,{className:l.tableCell,children:e(b,{variant:"body2",style:{fontWeight:500},children:r.name})}),e(c,{className:l.tableCell,children:e(b,{variant:"body2",children:k})}),e(c,{className:l.tableCell,children:e(b,{variant:"body2",children:new Intl.NumberFormat("en-US",{notation:"compact",maximumFractionDigits:1}).format(n)})}),e(c,{className:l.tableCell,children:g("div",{style:{display:"flex",alignItems:"center",gap:8},children:[t&&e(J,{value:`${a}%`,getColor:j(u,"default"),numericValue:d/100}),e(w,{flex:1}),e("div",{style:{width:"100%"},children:e(V,{data:{compliant:a,nonCompliant:100-a},categories:["compliant","nonCompliant"],categoryColors:{compliant:I(u,P.PASSED),nonCompliant:I(u,P.FAILED)},showTooltip:!1})})]})}),e(c,{className:l.tableCell,style:{verticalAlign:"middle"},children:r.ownerEntityRef&&e(w,{display:"flex",alignItems:"center",children:(()=>{const i=R.forEntity(r.ownerEntityRef);return g(N,{children:[i.snapshot.Icon&&e(w,{marginRight:1,display:"flex",alignItems:"center",height:"20px",children:e(i.snapshot.Icon,{fontSize:"small"})}),e(b,{variant:"body2",style:{lineHeight:"20px"},children:i.snapshot.primaryTitle||r.ownerEntityRef})]})})()})})]},r.id)})})]})})})};export{O as TechInsightsTableView};
1
+ import{jsx as e,Fragment as N,jsxs as g}from"react/jsx-runtime";import{useApi as $}from"@backstage/core-plugin-api";import{entityPresentationApiRef as E}from"@backstage/plugin-catalog-react";import{TableContainer as H,Paper as L,Table as z,TableHead as A,TableRow as x,TableCell as c,TableSortLabel as f,TableBody as B,Typography as b,Box as w}from"@material-ui/core";import D from"@material-ui/icons/ArrowDownward";import F from"@material-ui/icons/ArrowUpward";import{useMemo as M}from"react";import{getColorInterpolator as j,getCheckStatusColor as I}from"../../utils/colors.esm.js";import{CategoryBar as V}from"../CategoryBar/CategoryBar.esm.js";import{CheckStateColors as P}from"../CheckPage/utils.esm.js";import{ColorChip as J}from"../ColorChip/ColorChip.esm.js";const O=({tracks:v,trackStatusMap:m,trackCountsMap:y,orderBy:o,order:s,handleSort:h,handleTrackClick:S,theme:u,classes:l})=>{const R=$(E),T=M(()=>[...v].filter(r=>{const t=m.get(r.id)?.status,d=(t?.passed??0)+(t?.failed??0)+(t?.warning??0)+(t?.error??0)+(t?.notReported??0)+(t?.exempt??0);return!t||d>0}).sort((r,t)=>{const d=m.get(r.id),k=m.get(t.id);let n,a;switch(o){case"name":n=r.name?.toLowerCase()||"",a=t.name?.toLowerCase()||"";break;case"type":n=r.type||"",a=t.type||"";break;case"owner":n=r.ownerEntityRef?.toLowerCase()||"",a=t.ownerEntityRef?.toLowerCase()||"";break;case"compliance":n=d?.status?.allPassPercentage??null,a=k?.status?.allPassPercentage??null;break;case"checks":n=r.levels.reduce((i,C)=>i+C.checks.length,0),a=t.levels.reduce((i,C)=>i+C.checks.length,0);break;case"entities":n=y.get(r.id)??0,a=y.get(t.id)??0;break;default:return 0}return typeof n=="number"&&typeof a=="number"?s==="asc"?n-a:a-n:typeof n=="number"&&a===null?-1:n===null&&typeof a=="number"?1:typeof n=="string"&&typeof a=="string"?s==="asc"?n.localeCompare(a):a.localeCompare(n):0}),[s,o,m,y,v]),p=r=>r.direction==="asc"?e(F,{...r,fontSize:"small"}):e(D,{...r,fontSize:"small"});return e(N,{children:e(H,{component:L,children:g(z,{className:l.table,size:"small",children:[e(A,{children:g(x,{children:[e(c,{width:"30%",className:`${l.tableHeaderCell} ${l.headerCell}`,children:e(f,{active:o==="name",direction:o==="name"?s:"desc",onClick:()=>h("name"),IconComponent:p,children:e("div",{className:l.headerContent,children:"Name"})})}),e(c,{width:"10%",className:`${l.tableHeaderCell} ${l.headerCell}`,children:e(f,{active:o==="checks",direction:o==="checks"?s:"desc",onClick:()=>h("checks"),IconComponent:p,children:e("div",{className:l.headerContent,children:"Checks"})})}),e(c,{width:"10%",className:`${l.tableHeaderCell} ${l.headerCell}`,children:e(f,{active:o==="entities",direction:o==="entities"?s:"desc",onClick:()=>h("entities"),IconComponent:p,children:e("div",{className:l.headerContent,children:"Entities"})})}),e(c,{width:"30%",className:`${l.tableHeaderCell} ${l.headerCell}`,children:e(f,{active:o==="compliance",direction:o==="compliance"?s:"desc",onClick:()=>h("compliance"),IconComponent:p,children:e("div",{className:l.headerContent,children:"Compliance"})})}),e(c,{width:"20%",className:`${l.tableHeaderCell} ${l.headerCell}`,children:e(f,{active:o==="owner",direction:o==="owner"?s:"desc",onClick:()=>h("owner"),IconComponent:p,children:e("div",{className:l.headerContent,children:"Track Owner"})})})]})}),e(B,{children:T.map(r=>{const t=m.get(r.id)?.status;let d=0;if(t?.allPassPercentage!==null&&t?.allPassPercentage!==void 0)d=t.allPassPercentage;else if(t){const i=(t.passed??0)+(t.failed??0)+(t.warning??0)+(t.error??0)+(t.notReported??0)+(t.exempt??0);d=i>0?((t.passed??0)+(t.exempt??0))/i*100:0}const k=r.levels.reduce((i,C)=>i+C.checks.length,0),n=y.get(r.id)??0,a=Math.round(d);return g(x,{onClick:()=>S(r.id),className:l.tableRow,style:{cursor:"pointer"},children:[e(c,{className:l.tableCell,children:e(b,{variant:"body2",style:{fontWeight:500},children:r.name})}),e(c,{className:l.tableCell,children:e(b,{variant:"body2",children:k})}),e(c,{className:l.tableCell,children:e(b,{variant:"body2",children:new Intl.NumberFormat("en-US",{notation:"compact",maximumFractionDigits:1}).format(n)})}),e(c,{className:l.tableCell,children:g("div",{style:{display:"flex",alignItems:"center",gap:8},children:[t&&e(J,{value:`${a}%`,getColor:j(u,"default"),numericValue:d/100}),e(w,{flex:1}),e("div",{style:{width:"100%"},children:e(V,{data:{compliant:a,nonCompliant:100-a},categories:["compliant","nonCompliant"],categoryColors:{compliant:I(u,P.PASSED),nonCompliant:I(u,P.FAILED)},showTooltip:!1})})]})}),e(c,{className:l.tableCell,style:{verticalAlign:"middle"},children:r.ownerEntityRef&&e(w,{display:"flex",alignItems:"center",children:(()=>{const i=R.forEntity(r.ownerEntityRef);return g(N,{children:[i.snapshot.Icon&&e(w,{marginRight:1,display:"flex",alignItems:"center",height:"20px",children:e(i.snapshot.Icon,{fontSize:"small"})}),e(b,{variant:"body2",style:{lineHeight:"20px"},children:i.snapshot.primaryTitle||r.ownerEntityRef})]})})()})})]},r.id)})})]})})})};export{O as TechInsightsTableView};
2
2
  //# sourceMappingURL=TechInsightsTableView.esm.js.map
@@ -0,0 +1,2 @@
1
+ import{jsx as t,jsxs as m,Fragment as E}from"react/jsx-runtime";import{useRouteRef as P}from"@backstage/core-plugin-api";import{Table as x,TableHeader as C,Column as f,TableBody as k,TablePagination as v,Row as O,CellProfile as B,Cell as N,Flex as M,Text as D}from"@backstage/ui";import{sortBy as L}from"lodash";import{useMemo as u}from"react";import{useNavigate as $,createSearchParams as j}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{useSearchName as F}from"../../hooks/useSearchName.esm.js";import{usePagination as H}from"../../hooks/usePagination.esm.js";import{useSortTableLocalStorage as z}from"../../hooks/useSortTableLocalStorage.esm.js";import{useProfileImages as A}from"../../hooks/catalog/useProfileImages.esm.js";import{trackOverviewRouteRef as G,campaignOverviewRouteRef as J}from"../../routes.esm.js";import{CustomCell as K}from"../CustomCell/CustomCell.esm.js";import"../EmptyState/EmptyState.esm.js";import{EmptyStateBUI as U}from"../EmptyState/EmptyStateBUI.esm.js";import"@backstage/plugin-permission-react";import"@remixicon/react";import{LoadingTableSkeleton as V}from"../LoadingTableSkeleton/LoadingTableSkeleton.esm.js";import{StatusBar as q}from"../StatusBar/StatusBar.esm.js";const w=10,Q=(e,a=[])=>{const o=[],i=r=>{!r.children||r.children.length===0?r.numberOfEntities>0&&o.push(r):(a.includes(r.entityRef)&&r.numberOfEntities>0&&o.push(r),r.children.forEach(s=>i(s)))};return i(e),o},W=({row:e,profileImageMap:a,trackId:o,campaignId:i})=>{const r=P(G),s=P(J),c=$();return m(O,{onAction:()=>{o&&c({pathname:i?s({campaignId:i}):r({trackId:o}),search:`?${j({owners:[e.entityRef]})}`})},children:[t(B,{name:e.name,src:a[e.entityRef]??e.name}),t(N,{title:`${e.numberOfEntities} ${e.numberOfEntities===1?"entity":"entities"}`}),t(K,{children:m(M,{align:"center",gap:"3",children:[m(D,{children:[e.passPercentage,"%"]}),t(q,{passedPercent:e.passPercentage,failedPercent:e.failPercentage,warningPercent:e.warningPercentage,notReportedPercent:e.notReportedPercentage,errorPercent:e.errorPercentage})]})})]})},X=({tableData:e,isLoading:a,trackId:o,selectedGroup:i,searchValue:r,campaignId:s})=>{const{order:c,orderBy:l,handleSort:y}=z({localStoragePrefix:"soundcheck-tech-insights-explorer",defaultSortBy:"entities",defaultDirection:"desc"}),p=u(()=>e?Q(e,i?[i]:[]):[],[i,e]),h=F({items:p,searchTerm:r}),d=u(()=>{const n=L(h??[],g=>l==="name"?g.name:l==="passPercentage"?g.passPercentage:l==="entities"?g.numberOfEntities:0);return c==="desc"&&n.reverse(),n},[h,c,l]),R=u(()=>p.map(n=>n.entityRef),[p]),{paginatedItems:S,paginationProps:b}=H({pageParam:"perPage",defaultPageSize:w,items:d}),I=d.length>w,{profileImageMap:T}=A(R);return a?t(V,{rowCount:10}):!a&&!d.length?t(U,{title:"No groups found",body:"No groups found for the current selection."}):m(E,{children:[m(x,{sortDescriptor:{column:l,direction:c==="asc"?"ascending":"descending"},onSortChange:n=>y(n.column),children:[m(C,{children:[t(f,{allowsSorting:!0,id:"name",isRowHeader:!0,style:{width:"65%"},children:"Name"}),t(f,{allowsSorting:!0,id:"entities",style:{width:"15%"},children:"Entities"}),t(f,{allowsSorting:!0,id:"passPercentage",style:{width:"20%"},children:"Compliance"})]}),t(k,{children:S.map(n=>t(W,{profileImageMap:T??{},row:n,trackId:o,campaignId:s},n.entityRef))})]}),I&&t(v,{...b})]})};export{X as TechInsightsExplorerTable};
2
+ //# sourceMappingURL=TechInsightsExplorerTable.esm.js.map
@@ -1,2 +1,2 @@
1
- import{jsxs as S,jsx as l}from"react/jsx-runtime";import{useApi as y,configApiRef as G}from"@backstage/core-plugin-api";import{EntityDisplayName as x}from"@backstage/plugin-catalog-react";import{Box as g,Chip as v}from"@material-ui/core";import{useMemo as R,useEffect as w,useCallback as L}from"react";import{useSearchParams as P}from"react-router-dom";import b from"react-use/lib/useLocalStorage";import{useGroupOptions as k}from"../../hooks/groups/useGroupOptions.esm.js";import"../GroupHierarchySelector/GroupHierarchySelectorDialog.esm.js";import{GroupHierarchySelector as C}from"../GroupHierarchySelector/GroupHierarchySelector.esm.js";import{usePreviousSelectedGroups as I}from"../GroupHierarchySelector/usePreviousSelectedGroups.esm.js";const T=({onChange:c,hideSelected:d})=>{const{options:o,isLoading:n}=k(),[t,s]=P(),[m,p]=b("soundcheck.overview.groupRef",null),i=t.get("group"),a=y(G).getOptionalString("soundcheck.overview.defaultSelectedGroupType"),{addGroup:u}=I(),r=R(()=>{if(!n&&o.length){if(i||m){const e=i??m;return o.find(f=>f.ref===e)??o[0]}else if(a)return o.find(e=>e.type===a)??o[0];return o[0]}return null},[a,n,o,i,m]);w(()=>{if(!n&&o.length&&!i&&r){const e=new URLSearchParams(t.toString());e.set("group",r.ref),s(e,{replace:!0}),p(r.ref),c?.(r.ref),u(r.ref)}},[n,o,i,r,t,s,p]);const h=L(e=>{const f=new URLSearchParams(t.toString());f.set("group",e),s(f),p(e),c?.(e),u(e)},[u,c,t,p,s]);return S(g,{display:"flex",alignItems:"center",children:[l(C,{currentSelectedGroup:r?.ref,applyGroup:h},r?.ref),!d&&r?.ref&&l(g,{display:"flex",alignItems:"center",marginLeft:1,children:l(v,{size:"small",color:"secondary",style:{marginBottom:4,marginTop:4},label:l(x,{entityRef:r.ref})})})]})};export{T as TechInsightsGroupSelector};
1
+ import{jsx as p,jsxs as G}from"react/jsx-runtime";import{useApi as y,configApiRef as R}from"@backstage/core-plugin-api";import{EntityDisplayName as x}from"@backstage/plugin-catalog-react";import{Box as d,Chip as v}from"@material-ui/core";import{useMemo as b,useEffect as k,useCallback as w}from"react";import{useSearchParams as I}from"react-router-dom";import L from"react-use/lib/useLocalStorage";import{useGroupOptions as P}from"../../hooks/groups/useGroupOptions.esm.js";import{useFeatureFlag as B}from"../../hooks/useFeatureFlag.esm.js";import"../GroupHierarchySelector/GroupHierarchySelectorDialog.esm.js";import{GroupHierarchySelector as C}from"../GroupHierarchySelector/GroupHierarchySelector.esm.js";import{GroupSelectorBUI as T}from"../GroupSelectorBUI/GroupSelectorBUI.esm.js";import{usePreviousSelectedGroups as U}from"../GroupSelectorBUI/usePreviousSelectedGroups.esm.js";const j=({onChange:l,hideSelected:h})=>{const S=B("backstage-ui"),{options:o,isLoading:n}=P(),[t,s]=I(),[m,f]=L("soundcheck.overview.groupRef",null),i=t.get("group"),c=y(R).getOptionalString("soundcheck.overview.defaultSelectedGroupType"),{addGroup:a}=U(),e=b(()=>{if(!n&&o.length){if(i||m){const r=i??m;return o.find(u=>u.ref===r)??o[0]}else if(c)return o.find(r=>r.type===c)??o[0];return o[0]}return null},[c,n,o,i,m]);k(()=>{if(!n&&o.length&&!i&&e){const r=new URLSearchParams(t.toString());r.set("group",e.ref),s(r,{replace:!0}),f(e.ref),l?.(e.ref),a(e.ref)}},[n,o,i,e,t,s,f]);const g=w(r=>{const u=new URLSearchParams(t.toString());u.set("group",r),s(u),f(r),l?.(r),a(r)},[a,l,t,f,s]);return S?p(T,{selectedGroupRef:e?.ref,updateGroupRef:g}):G(d,{display:"flex",alignItems:"center",gridGap:12,children:[p(C,{currentSelectedGroup:e?.ref,applyGroup:g},e?.ref),!h&&e?.ref&&p(d,{display:"flex",alignItems:"center",marginLeft:1,children:p(v,{size:"small",color:"secondary",style:{marginBottom:4,marginTop:4},label:p(x,{entityRef:e.ref})})})]})};export{j as TechInsightsGroupSelector};
2
2
  //# sourceMappingURL=TechInsightsGroupSelector.esm.js.map
@@ -1,2 +1,2 @@
1
- import{jsxs as d,jsx as e}from"react/jsx-runtime";import{Grid as n,Button as f,Menu as M,Box as x,TextField as D}from"@material-ui/core";import{makeStyles as O}from"@material-ui/core/styles";import{useState as h}from"react";import{useSearchParams as B}from"react-router-dom";import"../TechHealth/Filters/types.esm.js";import"../TechHealth/Filters/FacetFilter.esm.js";import"../TechHealth/Filters/FilterProvider.esm.js";import"../TechHealth/Filters/Filters.esm.js";import"../TechHealth/Filters/FiltersHeader.esm.js";import"../TechHealth/Filters/FiltersSection.esm.js";import"@backstage/catalog-model";import"lodash";import"../../contexts/TrackFormContext.esm.js";import"../../contexts/CheckFormContext.esm.js";import"../../contexts/CampaignFormContext.esm.js";import"../../contexts/UserProvider.esm.js";import"@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{MIN_NUMBER_OF_DAYS as l,MAX_NUMBER_OF_DAYS as E}from"../TechHealth/Filters/utils.esm.js";const S=[{label:"7D",value:7},{label:"1M",value:30},{label:"2M",value:60},{label:"3M",value:90}],w=O(o=>({root:{width:"100%",paddingLeft:"60px",paddingBottom:o.spacing(1)},buttons:{paddingTop:"0 !important",paddingBottom:"0 !important"},customNumberOfDaysMenu:{width:"180px",padding:o.spacing(0,1)}})),C=({maxNumberOfDays:o=E})=>{const i=w(),[g,b]=B(),[m,p]=h(null),[a,s]=h(""),v=t=>{p(t.currentTarget)},y=()=>{p(null)},u=t=>{let r;if(typeof t=="string"){if(!t.length)return!0;r=parseInt(t,10)}else r=t;return!isNaN(r)&&r>=l&&r<=o},c=t=>{u(t)&&b(r=>(g.set("numberOfDays",t.toString()),r))},N=t=>{if(t.key==="Enter"){const r=parseInt(a,10);c(r),s("")}};return d(n,{container:!0,spacing:1,direction:"row",wrap:"nowrap",className:i.root,children:[S.filter(({value:t})=>t<=o).map(t=>e(n,{item:!0,className:i.buttons,children:e(f,{size:"small",onClick:()=>c(t.value),children:t.label})},t.value)),d(n,{item:!0,className:i.buttons,children:[e(f,{size:"small","aria-controls":"days-menu","aria-haspopup":"true",onClick:v,children:"Custom"}),e(M,{id:"days-menu",anchorEl:m,getContentAnchorEl:null,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},keepMounted:!0,open:!!m,onClose:y,children:e(x,{className:i.customNumberOfDaysMenu,children:e(D,{fullWidth:!0,variant:"outlined",size:"small",placeholder:"Number of days",helperText:`Enter value from ${l} to ${o}`,inputProps:{min:l,max:o},onKeyDown:N,value:a,type:"number",onChange:t=>s(t.target.value),error:!u(a)})})})]})]})};export{C as TimePeriodBar};
1
+ import{jsxs as d,jsx as e}from"react/jsx-runtime";import{Grid as n,Button as f,Menu as M,Box as x,TextField as D}from"@material-ui/core";import{makeStyles as O}from"@material-ui/core/styles";import{useState as h}from"react";import{useSearchParams as B}from"react-router-dom";import"../TechHealth/Filters/types.esm.js";import"../TechHealth/Filters/FacetFilter.esm.js";import"../TechHealth/Filters/FilterProvider.esm.js";import"../TechHealth/Filters/Filters.esm.js";import"../TechHealth/Filters/FiltersHeader.esm.js";import"../TechHealth/Filters/FiltersSection.esm.js";import"@backstage/catalog-model";import"lodash";import"../../contexts/TrackFormContext.esm.js";import"../../contexts/CheckFormContext.esm.js";import"../../contexts/CampaignFormContext.esm.js";import"../../contexts/UserProvider.esm.js";import"@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-use/lib/useLocalStorage";import{MIN_NUMBER_OF_DAYS as m,MAX_NUMBER_OF_DAYS as E}from"../TechHealth/Filters/utils.esm.js";const S=[{label:"7D",value:7},{label:"1M",value:30},{label:"2M",value:60},{label:"3M",value:90}],w=O(o=>({root:{width:"100%",paddingLeft:"60px",paddingBottom:o.spacing(1)},buttons:{paddingTop:"0 !important",paddingBottom:"0 !important"},customNumberOfDaysMenu:{width:"180px",padding:o.spacing(0,1)}})),C=({maxNumberOfDays:o=E})=>{const i=w(),[g,b]=B(),[l,p]=h(null),[a,s]=h(""),v=t=>{p(t.currentTarget)},y=()=>{p(null)},u=t=>{let r;if(typeof t=="string"){if(!t.length)return!0;r=parseInt(t,10)}else r=t;return!isNaN(r)&&r>=m&&r<=o},c=t=>{u(t)&&b(r=>(g.set("numberOfDays",t.toString()),r))},N=t=>{if(t.key==="Enter"){const r=parseInt(a,10);c(r),s("")}};return d(n,{container:!0,spacing:1,direction:"row",wrap:"nowrap",className:i.root,children:[S.filter(({value:t})=>t<=o).map(t=>e(n,{item:!0,className:i.buttons,children:e(f,{size:"small",onClick:()=>c(t.value),children:t.label})},t.value)),d(n,{item:!0,className:i.buttons,children:[e(f,{size:"small","aria-controls":"days-menu","aria-haspopup":"true",onClick:v,children:"Custom"}),e(M,{id:"days-menu",anchorEl:l,getContentAnchorEl:null,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},keepMounted:!0,open:!!l,onClose:y,children:e(x,{className:i.customNumberOfDaysMenu,children:e(D,{fullWidth:!0,variant:"outlined",size:"small",placeholder:"Number of days",helperText:`Enter value from ${m} to ${o}`,inputProps:{min:m,max:o},onKeyDown:N,value:a,type:"number",onChange:t=>s(t.target.value),error:!u(a)})})})]})]})};export{C as TimePeriodBar};
2
2
  //# sourceMappingURL=TimePeriodBar.esm.js.map
@@ -0,0 +1,2 @@
1
+ import{jsx as r,Fragment as y,jsxs as n}from"react/jsx-runtime";import{Flex as f,Text as h,Button as s,Box as d}from"@backstage/ui";import{makeStyles as z}from"@material-ui/core/styles";import{RiSubtractLine as O,RiAddLine as _}from"@remixicon/react";import{useState as v,useContext as M}from"react";import{DialogTrigger as P,Popover as F,Dialog as R,OverlayTriggerStateContext as C,NumberField as E,Label as U,Group as L,Input as j}from"react-aria-components";import{useSearchParams as k}from"react-router-dom";import"../TechHealth/Filters/types.esm.js";import"../TechHealth/Filters/FacetFilter.esm.js";import"../TechHealth/Filters/FilterProvider.esm.js";import"../TechHealth/Filters/Filters.esm.js";import"../TechHealth/Filters/FiltersHeader.esm.js";import"../TechHealth/Filters/FiltersSection.esm.js";import"@backstage/catalog-model";import"lodash";import"../../contexts/TrackFormContext.esm.js";import"../../contexts/CheckFormContext.esm.js";import"../../contexts/CampaignFormContext.esm.js";import"../../contexts/UserProvider.esm.js";import"@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-use/lib/useLocalStorage";import{MAX_NUMBER_OF_DAYS as N,DEFAULT_NUMBER_OF_DAYS as x,MIN_NUMBER_OF_DAYS as g}from"../TechHealth/Filters/utils.esm.js";const V=[{label:"7D",value:7},{label:"1M",value:x},{label:"2M",value:60},{label:"3M",value:N}],Y=z(()=>({centerText:{textAlign:"center"},group:{display:"flex",alignItems:"center",justifyContent:"center"},inputButton:{display:"flex",alignItems:"center"},dialog:{background:"var(--bui-bg-surface-1)",padding:"var(--bui-space-3)",borderRadius:"var(--bui-radius-3)",border:"1px solid var(--bui-border)"},pointer:{cursor:"pointer"},dialogTriggerButton:{padding:"0 !important",fontWeight:"normal",height:"0 !important",color:"var(--bui-fg-secondary) !important",fontSize:"var(--bui-font-size-2) !important"}})),w=({maxNumberOfDays:l=N})=>{const i=Y(),[m,S]=k(),c=m.get("numberOfDays"),T=c!==null&&!isNaN(Number(c))?Number(c):x,[B,D]=v(T),u=t=>{if(D(t),m.get("numberOfDays")!==String(t)){const o=new URLSearchParams(m);o.set("numberOfDays",String(t)),S(o,{replace:!0})}},I=()=>{const t=M(C),[o,p]=v(String(B)),b=e=>{let a;if(typeof e=="string"){if(!e.length)return!0;a=parseInt(e,10)}else a=e;return!isNaN(a)&&a>=g&&a<=l},A=e=>{if(e.key==="Enter"){const a=parseInt(e.currentTarget.value,10);b(a)&&(u(a),t?.close())}};return n(y,{children:[n(E,{minValue:g,maxValue:l,value:parseInt(o,10),children:[n(d,{mb:"2",children:[r(d,{style:{textAlign:"center"},children:r(U,{className:i.centerText,id:"number-days",children:"Number of days"})}),r(d,{style:{textAlign:"center"},children:n(h,{variant:"body-small",color:"secondary","aria-labelledby":"number-days",children:["Enter a value from ",g," to ",l]})})]}),n(L,{className:i.group,children:[r(s,{slot:"decrement",variant:"tertiary",size:"small",className:i.inputButton,onPress:()=>{p(e=>String(parseInt(e,10)-1))},children:r(O,{size:8})}),r(j,{onKeyDown:A,size:5,className:i.centerText,onChange:e=>p(e.currentTarget.value)}),r(s,{slot:"increment",variant:"tertiary",size:"small",className:i.inputButton,onPress:()=>{p(e=>String(parseInt(e,10)+1))},children:r(_,{size:8})})]})]}),r(f,{align:"center",justify:"center",mt:"2",children:r(s,{style:{height:"auto"},variant:"tertiary",size:"small",onPress:()=>{const e=parseInt(o,10);b(e)&&(u(e),t?.close())},children:"Apply"})})]})};return r(y,{children:n(f,{align:"center",children:[V.filter(({value:t})=>t<=l).map(t=>r(h,{variant:"body-small",color:"secondary",className:i.pointer,onClick:()=>u(t.value),children:t.label},t.value)),n(P,{children:[r(s,{variant:"tertiary",size:"small",className:i.dialogTriggerButton,children:"Custom"}),r(F,{children:r(R,{className:i.dialog,children:r(I,{})})})]})]})})};export{w as TimePeriodBarBUI};
2
+ //# sourceMappingURL=TimePeriodBarBUI.esm.js.map