@spotify/backstage-plugin-soundcheck 0.19.8 → 0.19.9

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 (237) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/alpha/entity-content.esm.js +1 -1
  3. package/dist/alpha.d.ts +3 -116
  4. package/dist/blueprints/IntegrationPageBlueprint.esm.js +1 -1
  5. package/dist/components/AreaChart/AreaChart.esm.js +1 -1
  6. package/dist/components/CampaignCreatePage/CampaignCreatePage.esm.js +1 -1
  7. package/dist/components/CampaignForm/CampaignForm.esm.js +1 -1
  8. package/dist/components/CampaignForm/Steps/CampaignMilestonesStep.esm.js +1 -1
  9. package/dist/components/CampaignForm/hooks/utils.esm.js +1 -1
  10. package/dist/components/CampaignForm/utils/campaignFormUtils.esm.js +2 -2
  11. package/dist/components/CampaignPage/CampaignPage.esm.js +1 -1
  12. package/dist/components/CampaignPage/CampaignPageBUI.esm.js +1 -1
  13. package/dist/components/CampaignPage/CampaignStatusBarBUI.esm.js +2 -0
  14. package/dist/components/CampaignPage/CampaignStatusCard.esm.js +2 -0
  15. package/dist/components/CampaignPage/CampaignStatusTableBUI.esm.js +2 -0
  16. package/dist/components/CampaignsPage/CampaignListPageBUI.esm.js +1 -1
  17. package/dist/components/CampaignsPage/CampaignsPage.esm.js +1 -1
  18. package/dist/components/CampaignsPage/EditCampaignView.esm.js +1 -1
  19. package/dist/components/Cards/HistoricalCheckStatusCard/HistoricalCheckStatusCard.esm.js +1 -1
  20. package/dist/components/Cards/TrackStatusCard/TrackStatusCard.esm.js +1 -1
  21. package/dist/components/CategoryBar/CategoryBar.esm.js +1 -1
  22. package/dist/components/Charts/chartUtils.esm.js +1 -1
  23. package/dist/components/CheckCreatePage/CheckCreatePage.esm.js +1 -1
  24. package/dist/components/CheckForm/CheckForm.esm.js +1 -1
  25. package/dist/components/CheckForm/FormFields/RuleInput/Conditions/RuleConditionInput.esm.js +1 -1
  26. package/dist/components/CheckForm/Steps/CheckApplicabilityStep.esm.js +1 -1
  27. package/dist/components/CheckForm/Steps/CheckReviewStep.esm.js +1 -1
  28. package/dist/components/CheckForm/utils/checkFormUtils.esm.js +2 -2
  29. package/dist/components/CheckForm/utils/validation.esm.js +1 -1
  30. package/dist/components/CheckPage/CheckEditPage.esm.js +1 -1
  31. package/dist/components/CheckPage/CheckEntitiesTable/CheckEntitiesTableBUI.esm.js +1 -1
  32. package/dist/components/CheckPage/CheckPage.esm.js +1 -1
  33. package/dist/components/CheckPage/CheckPageBUI.esm.js +1 -1
  34. package/dist/components/CheckPage/CheckStatusHistoryChartBUI.esm.js +1 -1
  35. package/dist/components/CheckPage/CheckStatusTableBUI.esm.js +1 -1
  36. package/dist/components/CheckPage/ExemptionsTableBUI.esm.js +1 -1
  37. package/dist/components/CheckPage/utils.esm.js +1 -1
  38. package/dist/components/CheckSelection/CheckSelection.esm.js +1 -1
  39. package/dist/components/CheckStatusBar/CheckStatusBar.esm.js +1 -1
  40. package/dist/components/CheckTemplatesPage/CheckTemplatesPage.esm.js +1 -1
  41. package/dist/components/CheckTemplatesPage/CheckTemplatesPageDeprecated.esm.js +1 -1
  42. package/dist/components/CheckTemplatesPage/TemplateCategory.esm.js +1 -1
  43. package/dist/components/ChecksPage/ChecksListPageBUI.esm.js +1 -1
  44. package/dist/components/ChecksPage/ChecksPage.esm.js +1 -1
  45. package/dist/components/ChecksTab/ChecksTab.esm.js +1 -1
  46. package/dist/components/ChecksTable/ChecksTable.esm.js +1 -1
  47. package/dist/components/CollectorPage/CollectorDetailsPage.esm.js +1 -1
  48. package/dist/components/CollectorPage/CollectorDetailsPageBUI.esm.js +1 -1
  49. package/dist/components/CollectorPage/CollectorDetailsPageDeprecated.esm.js +1 -1
  50. package/dist/components/CollectorPage/CollectorFactTable.esm.js +1 -1
  51. package/dist/components/CollectorPage/CollectorFactTableBUI.esm.js +1 -1
  52. package/dist/components/CollectorPage/CollectorPage.esm.js +1 -1
  53. package/dist/components/CollectorPage/Configurators/AzureDevOps/NumberOfWorkItemsComponent.esm.js +1 -1
  54. package/dist/components/CollectorPage/Configurators/BigQuery/QueryFactDetailsComponent.esm.js +1 -1
  55. package/dist/components/CollectorPage/Configurators/Common/CollectorOption.esm.js +1 -1
  56. package/dist/components/CollectorPage/Configurators/Common/FactCollectionConfig.esm.js +1 -1
  57. package/dist/components/CollectorPage/Configurators/Common/utils.esm.js +1 -1
  58. package/dist/components/CollectorPage/Configurators/HTTP/HttpRequestComponent.esm.js +1 -1
  59. package/dist/components/CollectorPage/Configurators/SCM/JsonFactDetailsComponent.esm.js +1 -1
  60. package/dist/components/CollectorPage/Configurators/SCM/RegexFactDetailsComponent.esm.js +1 -1
  61. package/dist/components/CollectorsPage/CollectorListPage/CollectorListPageDeprecated.esm.js +1 -1
  62. package/dist/components/CollectorsPage/CollectorListPage/CollectorSummaryCard.esm.js +1 -1
  63. package/dist/components/CollectorsPage/CollectorsPage.esm.js +1 -1
  64. package/dist/components/CollectorsPage/IntegrationsListPageBUI.esm.js +1 -1
  65. package/dist/components/FactExplorer/FactExplorer.esm.js +1 -1
  66. package/dist/components/FactExplorer/FactExplorerContext.esm.js +1 -1
  67. package/dist/components/FactExplorer/FactExplorerDialogBUI.esm.js +1 -1
  68. package/dist/components/Filter/FilterComponent.esm.js +1 -1
  69. package/dist/components/Filter/FilterPreviewTable/FilterPreviewTable.esm.js +1 -1
  70. package/dist/components/Filter/KeyValueInputDialog.esm.js +1 -1
  71. package/dist/components/Filter/types.esm.js +1 -1
  72. package/dist/components/Filter/utils.esm.js +1 -1
  73. package/dist/components/FilterSidebar/FilterSidebar.esm.js +1 -1
  74. package/dist/components/FilterSidebar/StateFilter.esm.js +1 -1
  75. package/dist/components/FormControlledAutocomplete/ControlledAutocomplete.esm.js +1 -1
  76. package/dist/components/FormFilterSection/FormFilterSection.esm.js +1 -1
  77. package/dist/components/FormStepper/FormStepper.esm.js +1 -1
  78. package/dist/components/HierarchicalTechInsightsPage/visualizations/LoadingOverlay.esm.js +1 -1
  79. package/dist/components/HierarchicalTechInsightsPage/visualizations/NivoCirclePacking.esm.js +1 -1
  80. package/dist/components/HierarchicalTechInsightsPage/visualizations/NivoIcicle.esm.js +1 -1
  81. package/dist/components/HierarchicalTechInsightsPage/visualizations/NivoSunburst.esm.js +1 -1
  82. package/dist/components/HierarchicalTechInsightsPage/visualizations/NivoTreemap.esm.js +1 -1
  83. package/dist/components/HierarchicalTechInsightsPage/visualizations/VisualizationBreadcrumb.esm.js +1 -1
  84. package/dist/components/ImportExportPanel/ImportExportPanelBUI.esm.js +1 -1
  85. package/dist/components/ImportExportPanel/ImportExportPanelDeprecated.esm.js +1 -1
  86. package/dist/components/OverviewPage/OverviewPageContent.esm.js +1 -1
  87. package/dist/components/OverviewPage/OverviewPageHeader.esm.js +1 -1
  88. package/dist/components/Pagination/Pagination.esm.js +1 -1
  89. package/dist/components/PassRateGrid/PassRateMetadata.esm.js +1 -1
  90. package/dist/components/RoutingPage/RoutingPage.esm.js +1 -1
  91. package/dist/components/RoutingPage/RoutingPageWrapper.esm.js +1 -1
  92. package/dist/components/SoundcheckHeader/Breadcrumbs.esm.js +1 -1
  93. package/dist/components/SoundcheckHeader/SoundcheckHeader.esm.js +1 -1
  94. package/dist/components/SoundcheckHeader/SoundcheckHeaderBUI.esm.js +1 -1
  95. package/dist/components/SoundcheckHeader/useHeader.esm.js +1 -1
  96. package/dist/components/SummaryCard/SummaryCardActionsMenu.esm.js +1 -1
  97. package/dist/components/TableRowWithOwner/TableRowWithOwner.esm.js +1 -1
  98. package/dist/components/TechHealth/TechHealth.esm.js +1 -1
  99. package/dist/components/TechHealthTabs/PassRateTabHeader.esm.js +1 -1
  100. package/dist/components/TechInsights/TechInsightsPage.esm.js +1 -1
  101. package/dist/components/TechInsights/TechInsightsPageBUI.esm.js +1 -1
  102. package/dist/components/TechInsights/TechInsightsTableBUI.esm.js +1 -1
  103. package/dist/components/TechInsightsExplorerTable/TechInsightsExplorerTable.esm.js +1 -1
  104. package/dist/components/TechInsightsGroupSelector/TechInsightsGroupSelector.esm.js +1 -1
  105. package/dist/components/TopFailingChecksTable/TopFailingChecksTableBUI.esm.js +1 -1
  106. package/dist/components/TrackCreatePage/TrackCreatePage.esm.js +1 -1
  107. package/dist/components/TrackEditPage/TrackEditPage.esm.js +1 -1
  108. package/dist/components/TrackForm/Steps/LevelsStep/LevelsStepNew.esm.js +1 -1
  109. package/dist/components/TrackForm/TrackForm.esm.js +1 -1
  110. package/dist/components/TrackForm/utils/useTrackForm.esm.js +1 -1
  111. package/dist/components/TrackPage/TrackEntitiesTable/TrackEntitiesTableBUI.esm.js +1 -1
  112. package/dist/components/TrackPage/TrackEntitiesTable/utils.esm.js +1 -1
  113. package/dist/components/TrackPage/TrackPage.esm.js +1 -1
  114. package/dist/components/TrackPage/TrackPageBUI.esm.js +1 -1
  115. package/dist/components/TrackPage/TrackStatusTableBUI.esm.js +1 -1
  116. package/dist/components/TracksPage/TracksListPageBUI.esm.js +1 -1
  117. package/dist/components/TracksPage/TracksPage.esm.js +1 -1
  118. package/dist/components/TracksTab/TracksTab.esm.js +1 -1
  119. package/dist/hooks/aggregations/useAggregatedCheckPassRateTrend.esm.js +1 -1
  120. package/dist/hooks/aggregations/useAggregatedEntityPassRateTrend.esm.js +1 -1
  121. package/dist/hooks/aggregations/useAggregatedGroupPassRateTrend.esm.js +1 -1
  122. package/dist/hooks/aggregations/useAggregatedTrackPassRateTrend.esm.js +1 -1
  123. package/dist/hooks/aggregations/useCertificationStatus.esm.js +1 -1
  124. package/dist/hooks/aggregations/useCertificationStatusHistory.esm.js +1 -1
  125. package/dist/hooks/aggregations/useCheckPassRateTrend.esm.js +1 -1
  126. package/dist/hooks/aggregations/useCheckStatus.esm.js +1 -1
  127. package/dist/hooks/aggregations/useCheckStatusHistory.esm.js +1 -1
  128. package/dist/hooks/aggregations/useCheckStatuses.esm.js +1 -1
  129. package/dist/hooks/aggregations/useEntityPassRateTrend.esm.js +1 -1
  130. package/dist/hooks/aggregations/useGroupPassRateTrend.esm.js +1 -1
  131. package/dist/hooks/aggregations/useTrackPassRateTrend.esm.js +1 -1
  132. package/dist/hooks/cache/useEntityCountCached.esm.js +1 -1
  133. package/dist/hooks/cache/useTrackCountCached.esm.js +1 -1
  134. package/dist/hooks/campaigns/useGetCampaign.esm.js +1 -1
  135. package/dist/hooks/catalog/useGetEntityCount.esm.js +1 -1
  136. package/dist/hooks/checks/useCheck.esm.js +1 -1
  137. package/dist/hooks/checks/useExecutableChecks.esm.js +1 -1
  138. package/dist/hooks/checks/useGetChecks.esm.js +1 -1
  139. package/dist/hooks/collectors/useGetCollectors.esm.js +1 -1
  140. package/dist/hooks/collectors/useGetFactSchema.esm.js +1 -1
  141. package/dist/hooks/collectors/useUpdateCollectorConfig.esm.js +1 -1
  142. package/dist/hooks/entities/useEntityRefsForUser.esm.js +1 -1
  143. package/dist/hooks/exemptions/useExemptions.esm.js +1 -1
  144. package/dist/hooks/facets/useFacetsForOwner.esm.js +1 -1
  145. package/dist/hooks/filters/useFilters.esm.js +1 -1
  146. package/dist/hooks/groups/useAllGroups.esm.js +1 -1
  147. package/dist/hooks/tracks/useGetTracksApplicableEntityCount.esm.js +1 -1
  148. package/dist/hooks/tracks/useTrack.esm.js +1 -1
  149. package/dist/hooks/useSortSearchParams.esm.js +2 -0
  150. package/dist/index.d.ts +11 -11
  151. package/dist/routes.esm.js +1 -1
  152. package/dist/utils/filters.esm.js +1 -1
  153. package/dist/utils/formStyles.esm.js +1 -1
  154. package/dist/utils/helpers.esm.js +1 -1
  155. package/dist/utils/json.esm.js +2 -0
  156. package/dist/utils/validation.esm.js +1 -1
  157. package/package.json +19 -19
  158. package/dist/components/CampaignPage/CampaignPageDeprecated.esm.js +0 -2
  159. package/dist/components/CampaignPage/CampaignStatusHistoryTile.esm.js +0 -2
  160. package/dist/components/CampaignPage/CampaignStatusTile.esm.js +0 -2
  161. package/dist/components/CampaignPage/DaysRemainingTile.esm.js +0 -2
  162. package/dist/components/CampaignsPage/CampaignListPage/CampaignListPageDeprecated.esm.js +0 -2
  163. package/dist/components/CampaignsPage/CampaignListPage/CampaignMetadata.esm.js +0 -2
  164. package/dist/components/CampaignsPage/CampaignListPage/CampaignSummaryCard.esm.js +0 -2
  165. package/dist/components/CampaignsPage/CampaignListPage/CampaignTypes.esm.js +0 -2
  166. package/dist/components/CampaignsPage/CampaignListPage/CampaignsOverviewSkeleton.esm.js +0 -2
  167. package/dist/components/Charts/LoadingChart.esm.js +0 -2
  168. package/dist/components/CheckPage/CheckEntitiesTable/CheckEntitiesTable.esm.js +0 -2
  169. package/dist/components/CheckPage/CheckEntitiesTable/columns.esm.js +0 -2
  170. package/dist/components/CheckPage/CheckPageDeprecated.esm.js +0 -2
  171. package/dist/components/CheckPage/CheckStatusHistoryChart.esm.js +0 -2
  172. package/dist/components/CheckPage/CheckStatusTable.esm.js +0 -2
  173. package/dist/components/CheckPage/ExemptionsTable.esm.js +0 -2
  174. package/dist/components/ChecksPage/CheckListPage/CheckListPageDeprecated.esm.js +0 -2
  175. package/dist/components/ChecksPage/CheckListPage/CheckMetadata.esm.js +0 -2
  176. package/dist/components/ChecksPage/CheckListPage/CheckSummaryCard.esm.js +0 -2
  177. package/dist/components/ChecksPage/skeletons/ChecksOverviewSkeleton.esm.js +0 -2
  178. package/dist/components/CollectorsPage/CollectorListPage/CollectorListSkeleton.esm.js +0 -2
  179. package/dist/components/ColorChip/ColorChip.esm.js +0 -2
  180. package/dist/components/GroupHierarchySelector/GroupHierarchyCategorySelection.esm.js +0 -2
  181. package/dist/components/GroupHierarchySelector/GroupHierarchyChip.esm.js +0 -2
  182. package/dist/components/GroupHierarchySelector/GroupHierarchyGroupInfo.esm.js +0 -2
  183. package/dist/components/GroupHierarchySelector/GroupHierarchySelector.esm.js +0 -2
  184. package/dist/components/GroupHierarchySelector/GroupHierarchySelectorDialog.esm.js +0 -2
  185. package/dist/components/HierarchicalTechInsightsPage/ColorLegend.esm.js +0 -2
  186. package/dist/components/HierarchicalTechInsightsPage/HierarchicalTechInsightsPage.esm.js +0 -2
  187. package/dist/components/HierarchicalTechInsightsPage/HierarchyTable.esm.js +0 -2
  188. package/dist/components/HierarchicalTechInsightsPage/LowestPerformingTeams.esm.js +0 -2
  189. package/dist/components/HierarchicalTechInsightsPage/SelectedNodeSidebar.esm.js +0 -2
  190. package/dist/components/HierarchicalTechInsightsPage/TeamPerformanceCard.esm.js +0 -2
  191. package/dist/components/HierarchicalTechInsightsPage/TeamPerformanceListCard.esm.js +0 -2
  192. package/dist/components/HierarchicalTechInsightsPage/TopPerformingTeams.esm.js +0 -2
  193. package/dist/components/HierarchicalTechInsightsPage/visualizations/findNodePath.esm.js +0 -2
  194. package/dist/components/LevelsTable/CheckRowContent.esm.js +0 -2
  195. package/dist/components/LevelsTable/LevelsTable.esm.js +0 -2
  196. package/dist/components/PassingPercentProgressbar/PassPercentageProgressbar.esm.js +0 -2
  197. package/dist/components/QuickstartPage/HowDoIListItem.esm.js +0 -2
  198. package/dist/components/QuickstartPage/QuickstartCardBase.esm.js +0 -2
  199. package/dist/components/QuickstartPage/QuickstartPage.esm.js +0 -3
  200. package/dist/components/QuickstartPage/WelcomeHelpSection.esm.js +0 -7
  201. package/dist/components/QuickstartPage/styles.esm.js +0 -2
  202. package/dist/components/RichTooltip/RichTooltip.esm.js +0 -2
  203. package/dist/components/RoutingPage/NewFeatureTab.esm.js +0 -2
  204. package/dist/components/RoutingPage/RoutingPageDeprecated.esm.js +0 -2
  205. package/dist/components/RoutingPage/RoutingPageWrapperDeprecated.esm.js +0 -2
  206. package/dist/components/SearchFilters/SearchFilters.esm.js +0 -2
  207. package/dist/components/SendCampaignNotificationDialog/SendCampaignNotificationDialog.esm.js +0 -2
  208. package/dist/components/SoundcheckEntityLink/SoundcheckEntityLink.esm.js +0 -2
  209. package/dist/components/SoundcheckHeader/headerUtil.esm.js +0 -2
  210. package/dist/components/TeamStatusBar/TeamStatusBar.esm.js +0 -2
  211. package/dist/components/TechInsights/FilterControls.esm.js +0 -2
  212. package/dist/components/TechInsights/SummaryTiles.esm.js +0 -2
  213. package/dist/components/TechInsights/TechInsightsPageDeprecated.esm.js +0 -2
  214. package/dist/components/TechInsights/TechInsightsTableView.esm.js +0 -2
  215. package/dist/components/TimePeriodBar/TimePeriodBar.esm.js +0 -2
  216. package/dist/components/TopFailingChecksTable/TopFailingChecksTable.esm.js +0 -2
  217. package/dist/components/TrackPage/TrackEntitiesTable/TrackEntitiesTable.esm.js +0 -2
  218. package/dist/components/TrackPage/TrackEntitiesTable/TrackStatusChip.esm.js +0 -2
  219. package/dist/components/TrackPage/TrackEntitiesTable/columns.esm.js +0 -2
  220. package/dist/components/TrackPage/TrackHistoryChart.esm.js +0 -2
  221. package/dist/components/TrackPage/TrackPageDeprecated.esm.js +0 -2
  222. package/dist/components/TrackPage/TrackProgressCard.esm.js +0 -2
  223. package/dist/components/TrackPage/TrackStatus.esm.js +0 -2
  224. package/dist/components/TrackPage/TrackStatusBar.esm.js +0 -2
  225. package/dist/components/TrackPage/TrackStatusTable.esm.js +0 -2
  226. package/dist/components/TrackPage/utils.esm.js +0 -2
  227. package/dist/components/TrackSelection/TrackSelection.esm.js +0 -2
  228. package/dist/components/TracksPage/TrackListPage/TrackEmptyState.esm.js +0 -2
  229. package/dist/components/TracksPage/TrackListPage/TrackListPageDeprecated.esm.js +0 -2
  230. package/dist/components/TracksPage/TrackListPage/TrackMetadata.esm.js +0 -2
  231. package/dist/components/TracksPage/TrackListPage/TrackSummaryCard.esm.js +0 -2
  232. package/dist/components/TracksPage/TrackListPage/TracksOverviewSkeleton.esm.js +0 -2
  233. package/dist/hooks/campaigns/useGetCampaignOwners.esm.js +0 -2
  234. package/dist/hooks/checks/useGetCheckOwners.esm.js +0 -2
  235. package/dist/hooks/heirarchy/useGroupTypeHierarchy.esm.js +0 -2
  236. package/dist/hooks/tracks/useGetTrackOwners.esm.js +0 -2
  237. package/dist/utils/colors.esm.js +0 -2
@@ -1,2 +1,2 @@
1
- import{useApi as s}from"@backstage/core-plugin-api";import{useQuery as a}from"@tanstack/react-query";import{useState as f}from"react";import{soundcheckApiRef as u}from"../../api.esm.js";import{QueryKeys as l}from"../graphqlKeys.esm.js";function m(e){const t=s(u),[o,i]=f(null),n=async()=>(await t.getEntityRefsForTechHealthFilter(e)).entityRefsForTechHealthFilter,r=a([l.GetSoftwareEntityRefsForUser,e],n,{retry:!1,onError:i,enabled:e!==null,staleTime:5*60*1e3,refetchInterval:!1,refetchOnWindowFocus:!1});return{data:r.data??[],isLoading:r.isLoading,error:o}}export{m as useEntityRefsForUser};
1
+ import{useApi as s}from"@backstage/core-plugin-api";import{useQuery as a}from"@tanstack/react-query";import{useState as f}from"react";import{soundcheckApiRef as u}from"../../api.esm.js";import{QueryKeys as l}from"../graphqlKeys.esm.js";function m(e){const t=s(u),[o,i]=f(null),n=async()=>(await t.getEntityRefsForTechHealthFilter(e)).entityRefsForTechHealthFilter,r=a([l.GetSoftwareEntityRefsForUser,e],n,{retry:!1,onError:i,enabled:e!==null,staleTime:300*1e3,refetchInterval:!1,refetchOnWindowFocus:!1});return{data:r.data??[],isLoading:r.isLoading,error:o}}export{m as useEntityRefsForUser};
2
2
  //# sourceMappingURL=useEntityRefsForUser.esm.js.map
@@ -1,2 +1,2 @@
1
- import{useApi as n}from"@backstage/core-plugin-api";import{useQuery as p}from"@tanstack/react-query";import{soundcheckApiRef as f}from"../../api.esm.js";import{QueryKeys as u}from"../graphqlKeys.esm.js";function a(e,s){const m=n(f),{first:t=10,after:o,last:r,before:i}=s||{};return p([u.GetExemptions,e,t,o,r,i],async()=>(await m.getExemptions(e,t,o,r,i)).exemptions,{enabled:!!e})}export{a as useExemptions};
1
+ import{useApi as m}from"@backstage/core-plugin-api";import{useQuery as n}from"@tanstack/react-query";import{soundcheckApiRef as p}from"../../api.esm.js";import{QueryKeys as f}from"../graphqlKeys.esm.js";function u(e,a){const s=m(p),{first:t=10,after:o,last:r,before:i}={};return n([f.GetExemptions,e,t,o,r,i],async()=>(await s.getExemptions(e,t,o,r,i)).exemptions,{enabled:!!e})}export{u as useExemptions};
2
2
  //# sourceMappingURL=useExemptions.esm.js.map
@@ -1,2 +1,2 @@
1
- import{useApi as o}from"@backstage/core-plugin-api";import{useQuery as t}from"@tanstack/react-query";import{soundcheckApiRef as n}from"../../api.esm.js";import{QueryKeys as s}from"../graphqlKeys.esm.js";function c(e){const r=o(n);return t([s.GetFacetsForOwner,e],async()=>r.getFacetsForOwner(e),{enabled:!!e,staleTime:5*60*1e3,refetchInterval:!1,refetchOnWindowFocus:!1})}export{c as useFacetsForOwner};
1
+ import{useApi as o}from"@backstage/core-plugin-api";import{useQuery as t}from"@tanstack/react-query";import{soundcheckApiRef as n}from"../../api.esm.js";import{QueryKeys as s}from"../graphqlKeys.esm.js";function c(e){const r=o(n);return t([s.GetFacetsForOwner,e],async()=>r.getFacetsForOwner(e),{enabled:!!e,staleTime:300*1e3,refetchInterval:!1,refetchOnWindowFocus:!1})}export{c as useFacetsForOwner};
2
2
  //# sourceMappingURL=useFacetsForOwner.esm.js.map
@@ -1,2 +1,2 @@
1
- import{stringifyEntityRef as I,parseEntityRef as b}from"@backstage/catalog-model";import{useApi as G,configApiRef as M}from"@backstage/core-plugin-api";import{combineEntityFilterQueries as N,getGroupFilterFromConfig as j}from"@spotify/backstage-plugin-soundcheck-common";import l from"lodash/startCase";import{useMemo as w,useCallback as B}from"react";import{useSearchParams as Q}from"react-router-dom";import{CheckState as r}from"../../components/CheckPage/utils.esm.js";import{useGetEntityFacets as f}from"../catalog/useGetEntityFacets.esm.js";import{useGetEntityRefs as _}from"../catalog/useGetEntityRefs.esm.js";function x({entityFilterQuery:m,hasStatusFilters:E=!1,hasCertificationStatusFilters:d=!1}){const R=G(M),[o,u]=Q(),A=N({kind:["group"]},j(R)),{data:y}=_(A),g=w(()=>y?.items.map(e=>({label:e.metadata.title??e.metadata.name,value:I(e)}))??[],[y]),{data:h}=f("spec.lifecycle",m),F=h?.map(e=>({label:e,value:e}))??[],{data:L}=f("spec.type",m),$=L?.map(e=>({label:e,value:e}))??[],{data:k}=f("relations.partOf",m),C=k?.map(e=>({label:b(e).name,value:e}))??[],P=[r.PASSED,r.FAILED,r.WARNING,r.EXEMPT,r.NOT_APPLICABLE,r.ERROR].map(e=>({label:l(e.toLowerCase()),value:e})),O=[r.PASSED,r.FAILED,r.NOT_REPORTED].map(e=>{const t=l(e.toLowerCase());return{label:t,value:t}}),v=(e,t)=>{const s=["owners","systems"];if(e==="certificationStatuses")return`statuses: ${l(t.toLowerCase())}`;const a=e.replace(/s$/,"");return s.includes(e)?`${a}: ${b(t).name}`:e==="states"?`${a}: ${l(t.toLowerCase())}`:`${a}: ${t}`},p=w(()=>{const e=["numberOfDays","search","page","perPage"],t={owners:new Set,lifecycles:new Set,types:new Set,systems:new Set,states:new Set,certificationStatuses:new Set};for(const[s,a]of o.entries())if(!e.includes(s)){const i=a.split(",").map(n=>n.trim()).filter(Boolean);t[s]=new Set(i)}return t},[o]),S=B((e,t)=>{const s=new URLSearchParams(o),a=Array.from(t);a.length>0?s.set(e,a.join(",")):s.delete(e),u(s,{replace:!0})},[o,u]),T=Object.entries(p).flatMap(([e,t])=>Array.from(t).map(s=>({label:v(e,s),value:`${e}:${s}`}))),D=e=>{e.forEach(t=>{if(typeof t!="string")return;const[s,a]=t.split(/:(.+)/),i=p[s];if(!i)return;const n=new Set(i);n.delete(a),S(s,n)})},c=[{key:"owners",label:"Owner",options:g},{key:"lifecycles",label:"Lifecycle",options:F},{key:"types",label:"Type",options:$},{key:"systems",label:"System",options:C}];return E&&c.push({key:"states",label:"States",options:P}),d&&c.push({key:"certificationStatuses",label:"Status",options:O}),{filters:c,selected:p,setSelected:S,selectedTags:T,onRemoveTag:D}}export{x as useFilters};
1
+ import{stringifyEntityRef as I,parseEntityRef as b}from"@backstage/catalog-model";import{useApi as G,configApiRef as M}from"@backstage/core-plugin-api";import{combineEntityFilterQueries as N,getGroupFilterFromConfig as j}from"@spotify/backstage-plugin-soundcheck-common";import l from"lodash/startCase";import{useMemo as w,useCallback as B}from"react";import{useSearchParams as Q}from"react-router-dom";import{CheckState as r}from"../../components/CheckPage/utils.esm.js";import{useGetEntityFacets as f}from"../catalog/useGetEntityFacets.esm.js";import{useGetEntityRefs as _}from"../catalog/useGetEntityRefs.esm.js";function x({entityFilterQuery:c,hasStatusFilters:E=!1,hasCertificationStatusFilters:d=!1}){const R=G(M),[o,u]=Q(),A=N({kind:["group"]},j(R)),{data:y}=_(A),g=w(()=>y?.items.map(e=>({label:e.metadata.title??e.metadata.name,value:I(e)}))??[],[y]),{data:h}=f("spec.lifecycle",c),F=h?.map(e=>({label:e,value:e}))??[],{data:L}=f("spec.type",c),$=L?.map(e=>({label:e,value:e}))??[],{data:k}=f("relations.partOf",c),v=k?.map(e=>({label:b(e).name,value:e}))??[],C=[r.PASSED,r.FAILED,r.WARNING,r.EXEMPT,r.NOT_APPLICABLE,r.ERROR].map(e=>({label:l(e.toLowerCase()),value:e})),P=[r.PASSED,r.FAILED,r.NOT_REPORTED].map(e=>{const t=l(e.toLowerCase());return{label:t,value:t}}),O=(e,t)=>{const s=["owners","systems"];if(e==="certificationStatuses")return`statuses: ${l(t.toLowerCase())}`;const a=e.replace(/s$/,"");return s.includes(e)?`${a}: ${b(t).name}`:e==="states"?`${a}: ${l(t.toLowerCase())}`:`${a}: ${t}`},m=w(()=>{const e=["numberOfDays","search","page","perPage","sort","sortDirection","level"],t={owners:new Set,lifecycles:new Set,types:new Set,systems:new Set,states:new Set,certificationStatuses:new Set};for(const[s,a]of o.entries())if(!e.includes(s)){const i=a.split(",").map(n=>n.trim()).filter(Boolean);t[s]=new Set(i)}return t},[o]),S=B((e,t)=>{const s=new URLSearchParams(o),a=Array.from(t);a.length>0?s.set(e,a.join(",")):s.delete(e),u(s,{replace:!0})},[o,u]),D=Object.entries(m).flatMap(([e,t])=>Array.from(t).map(s=>({label:O(e,s),value:`${e}:${s}`}))),T=e=>{e.forEach(t=>{if(typeof t!="string")return;const[s,a]=t.split(/:(.+)/),i=m[s];if(!i)return;const n=new Set(i);n.delete(a),S(s,n)})},p=[{key:"owners",label:"Owner",options:g},{key:"lifecycles",label:"Lifecycle",options:F},{key:"types",label:"Type",options:$},{key:"systems",label:"System",options:v}];return E&&p.push({key:"states",label:"States",options:C}),d&&p.push({key:"certificationStatuses",label:"Status",options:P}),{filters:p,selected:m,setSelected:S,selectedTags:D,onRemoveTag:T}}export{x as useFilters};
2
2
  //# sourceMappingURL=useFilters.esm.js.map
@@ -1,2 +1,2 @@
1
- import{stringifyEntityRef as m}from"@backstage/catalog-model";import{useApi as t,configApiRef as n}from"@backstage/core-plugin-api";import{catalogApiRef as s}from"@backstage/plugin-catalog-react";import{getGroupFilterFromConfig as c,combineEntityFilterQueries as f}from"@spotify/backstage-plugin-soundcheck-common";import{useQuery as d}from"@tanstack/react-query";function l(){const i=t(s),a=t(n);return d(["soundcheck/all-groups"],async()=>{const r=c(a),o=f({kind:"Group"},r),{items:p}=await i.getEntities({filter:o,fields:["spec.profile.displayName","metadata.title","metadata.name","metadata.description","metadata.namespace","kind","spec.type"]});return p.filter(e=>e?.kind==="Group").map(e=>({name:e.spec?.profile?.displayName??e.metadata.title??e.metadata.name,description:e.metadata.description,ref:m(e),type:e.spec?.type}))},{staleTime:5*60*1e3,refetchInterval:!1,refetchOnWindowFocus:!1})}export{l as useAllGroups};
1
+ import{stringifyEntityRef as m}from"@backstage/catalog-model";import{useApi as t,configApiRef as n}from"@backstage/core-plugin-api";import{catalogApiRef as s}from"@backstage/plugin-catalog-react";import{getGroupFilterFromConfig as c,combineEntityFilterQueries as f}from"@spotify/backstage-plugin-soundcheck-common";import{useQuery as d}from"@tanstack/react-query";function l(){const i=t(s),a=t(n);return d(["soundcheck/all-groups"],async()=>{const r=c(a),o=f({kind:"Group"},r),{items:p}=await i.getEntities({filter:o,fields:["spec.profile.displayName","metadata.title","metadata.name","metadata.description","metadata.namespace","kind","spec.type"]});return p.filter(e=>e?.kind==="Group").map(e=>({name:e.spec?.profile?.displayName??e.metadata.title??e.metadata.name,description:e.metadata.description,ref:m(e),type:e.spec?.type}))},{staleTime:300*1e3,refetchInterval:!1,refetchOnWindowFocus:!1})}export{l as useAllGroups};
2
2
  //# sourceMappingURL=useAllGroups.esm.js.map
@@ -1,2 +1,2 @@
1
- import{useApi as o}from"@backstage/core-plugin-api";import{useQuery as i}from"@tanstack/react-query";import{soundcheckApiRef as c}from"../../api.esm.js";import{QueryKeys as u}from"../graphqlKeys.esm.js";function p(e,t={},r){const n=o(c);return i({queryKey:[u.GetTracksApplicableEntityCount,t,e],queryFn:async()=>n.getTracksApplicableEntityCount(t,e??""),staleTime:5*60*1e3,refetchInterval:!1,refetchOnWindowFocus:!1,enabled:!!e&&(r?.enabled??!0)})}export{p as useGetTracksApplicableEntityCount};
1
+ import{useApi as o}from"@backstage/core-plugin-api";import{useQuery as i}from"@tanstack/react-query";import{soundcheckApiRef as c}from"../../api.esm.js";import{QueryKeys as u}from"../graphqlKeys.esm.js";function p(e,t={},r){const n=o(c);return i({queryKey:[u.GetTracksApplicableEntityCount,t,e],queryFn:async()=>n.getTracksApplicableEntityCount(t,e??""),staleTime:300*1e3,refetchInterval:!1,refetchOnWindowFocus:!1,enabled:!!e&&(r?.enabled??!0)})}export{p as useGetTracksApplicableEntityCount};
2
2
  //# sourceMappingURL=useGetTracksApplicableEntityCount.esm.js.map
@@ -1,2 +1,2 @@
1
- import{useApi as o}from"@backstage/core-plugin-api";import{useQuery as t}from"@tanstack/react-query";import{soundcheckApiRef as c}from"../../api.esm.js";import{QueryKeys as n}from"../graphqlKeys.esm.js";function i(e){const r=o(c);return t([n.GetTrack,e],async()=>r.getTrack(e),{staleTime:5*60*1e3,refetchInterval:!1,refetchOnWindowFocus:!1,enabled:!!e})}export{i as useTrack};
1
+ import{useApi as o}from"@backstage/core-plugin-api";import{useQuery as t}from"@tanstack/react-query";import{soundcheckApiRef as c}from"../../api.esm.js";import{QueryKeys as n}from"../graphqlKeys.esm.js";function i(e){const r=o(c);return t([n.GetTrack,e],async()=>r.getTrack(e),{staleTime:300*1e3,refetchInterval:!1,refetchOnWindowFocus:!1,enabled:!!e})}export{i as useTrack};
2
2
  //# sourceMappingURL=useTrack.esm.js.map
@@ -0,0 +1,2 @@
1
+ import{useCallback as s}from"react";import{useSearchParams as o}from"react-router-dom";const c=()=>{const[t,a]=o();return{updateSortParams:s(r=>{const e=new URLSearchParams(t.toString());e.set("sort",r.sort),e.set("sortDirection",r.sortDirection),r.level!==void 0?e.set("level",String(r.level)):e.delete("level"),a(e,{replace:!0})},[t,a]),searchParams:t,setSearchParams:a}};export{c as useSortSearchParams};
2
+ //# sourceMappingURL=useSortSearchParams.esm.js.map
package/dist/index.d.ts CHANGED
@@ -6,17 +6,6 @@ import { RouteRef } from '@backstage/frontend-plugin-api';
6
6
  import * as _tanstack_react_query from '@tanstack/react-query';
7
7
  import { JsonObject } from '@backstage/types';
8
8
 
9
- /**
10
- * Props for the EntitySoundcheckCard.
11
- * @public
12
- */
13
- interface EntitySoundcheckCardProps {
14
- /**
15
- * The title of the entity card. Defaults to 'SoundCheck'.
16
- */
17
- title?: string;
18
- }
19
-
20
9
  /**
21
10
  * Props for the OverviewPageProps.
22
11
  * @public
@@ -72,6 +61,17 @@ declare const SoundcheckOverviewPage: (props: OverviewPageProps) => JSX.Element;
72
61
  */
73
62
  declare const SoundcheckRoutingPage: (props: OverviewPageProps) => JSX.Element;
74
63
 
64
+ /**
65
+ * Props for the EntitySoundcheckCard.
66
+ * @public
67
+ */
68
+ interface EntitySoundcheckCardProps {
69
+ /**
70
+ * The title of the entity card. Defaults to 'SoundCheck'.
71
+ */
72
+ title?: string;
73
+ }
74
+
75
75
  /**
76
76
  * Create Soundcheck integration extensions that are routable React page components.
77
77
  *
@@ -1,2 +1,2 @@
1
- import{createRouteRef as a,createSubRouteRef as e}from"@backstage/core-plugin-api";const c=a({id:"soundcheck-entity"}),i=a({id:"soundcheck-group"}),r=e({id:"soundcheck-entity-certification-track-redirect",parent:c,path:"/tracks/:trackId"}),n=e({id:"soundcheck-entity-certification",parent:c,path:"/tracks/:trackId/checks/:checkId"}),s=e({id:"soundcheck-entity-playlist-redirect",parent:c,path:"/playlists/:playlistId"}),o=e({id:"soundcheck-entity-playlist-track-redirect",parent:c,path:"/playlists/:playlistId/tracks/:trackId"}),d=e({id:"soundcheck-entity-playlist-track-redirect",parent:c,path:"/playlists/:playlistId/tracks/:trackId/checks/:checkId"}),t=a({id:"soundcheck"}),h=e({id:"soundcheck-quickstart",parent:t,path:"/quickstart"}),p=e({id:"soundcheck-checks",parent:t,path:"/checks"}),k=e({id:"soundcheck-check-details",parent:t,path:"/checks/:checkId"}),u=e({id:"soundcheck-check-edit",parent:t,path:"/checks/:checkId/edit"}),R=e({id:"soundcheck-check-create",parent:t,path:"/checks/create"}),g=e({id:"soundcheck-check-templates",parent:t,path:"/checks/templates"}),l=e({id:"soundcheck-tracks",parent:t,path:"/tracks"}),f=e({id:"soundcheck-track-details",parent:t,path:"/tracks/:trackId"}),m=e({id:"soundcheck-track-edit",parent:t,path:"/tracks/:trackId/edit"}),I=e({id:"soundcheck-track-create",parent:t,path:"/tracks/create"}),y=e({id:"soundcheck-track-check-details",parent:t,path:"/tracks/:trackId/checks/:checkId"}),v=e({id:"soundcheck-campaigns",parent:t,path:"/campaigns"}),w=e({id:"soundcheck-campaign-details",parent:t,path:"/campaigns/:campaignId"}),P=e({id:"soundcheck-campaign-edit",parent:t,path:"/campaigns/:campaignId/edit"}),x=e({id:"soundcheck-campaign-create",parent:t,path:"/campaigns/create"}),E=e({id:"soundcheck-tech-health",parent:t,path:"/tech-health"}),C=e({id:"soundcheck-tech-insights",parent:t,path:"/tech-insights"}),D=e({id:"soundcheck-integrations-page",parent:t,path:"/integrations"}),T=e({id:"soundcheck-integration-details",parent:t,path:"/integrations/:integrationId"}),q=e({id:"soundcheck-integration-edit",parent:t,path:"/integrations/:integrationId/edit"}),O=e({id:"soundcheck-tech-insights-track",parent:t,path:"/tech-insights/track"}),b=e({id:"soundcheck-track-overview",parent:t,path:"/tracks/:trackId/overview"}),H=e({id:"soundcheck-track-explorer",parent:t,path:"/tracks/:trackId/explorer"}),S=e({id:"soundcheck-campaign-overview",parent:t,path:"/campaigns/:campaignId/overview"}),j=e({id:"soundcheck-campaign-explorer",parent:t,path:"/campaigns/:campaignId/explorer"}),z=e({id:"soundcheck-overview",parent:t,path:"/overview"});export{x as campaignCreateRouteRef,w as campaignDetailsRouteRef,P as campaignEditRouteRef,j as campaignExplorerRouteRef,S as campaignOverviewRouteRef,v as campaignsPageRouteRef,s as certificationPlaylistRouteRef,d as certificationPlaylistTrackCheckRouteRef,o as certificationPlaylistTrackRouteRef,n as certificationRouteRef,r as certificationTrackRouteRef,R as checkCreateRouteRef,k as checkDetailsRouteRef,u as checkEditRouteRef,g as checkTemplatesRouteRef,p as checksPageRouteRef,c as entityRootRouteRef,i as groupRootRouteRef,T as integrationDetailsRouteRef,q as integrationEditRouteRef,D as integrationsPageRouteRef,z as overviewRouteRef,h as quickstartRouteRef,t as rootRouteRef,E as techHealthRouteRef,C as techInsightsPageRouteRef,O as techInsightsTrackRouteRef,y as trackCheckDetailsRouteRef,I as trackCreateRouteRef,f as trackDetailsRouteRef,m as trackEditRouteRef,H as trackExplorerRouteRef,b as trackOverviewRouteRef,l as tracksPageRouteRef};
1
+ import{createRouteRef as a,createSubRouteRef as e}from"@backstage/core-plugin-api";const c=a({id:"soundcheck-entity"}),i=a({id:"soundcheck-group"}),r=e({id:"soundcheck-entity-certification-track-redirect",parent:c,path:"/tracks/:trackId"}),n=e({id:"soundcheck-entity-certification",parent:c,path:"/tracks/:trackId/checks/:checkId"}),o=e({id:"soundcheck-entity-playlist-redirect",parent:c,path:"/playlists/:playlistId"}),s=e({id:"soundcheck-entity-playlist-track-redirect",parent:c,path:"/playlists/:playlistId/tracks/:trackId"}),d=e({id:"soundcheck-entity-playlist-track-redirect",parent:c,path:"/playlists/:playlistId/tracks/:trackId/checks/:checkId"}),t=a({id:"soundcheck"});e({id:"soundcheck-quickstart",parent:t,path:"/quickstart"});const h=e({id:"soundcheck-checks",parent:t,path:"/checks"}),p=e({id:"soundcheck-check-details",parent:t,path:"/checks/:checkId"}),k=e({id:"soundcheck-check-edit",parent:t,path:"/checks/:checkId/edit"}),u=e({id:"soundcheck-check-create",parent:t,path:"/checks/create"}),R=e({id:"soundcheck-check-templates",parent:t,path:"/checks/templates"}),g=e({id:"soundcheck-tracks",parent:t,path:"/tracks"}),l=e({id:"soundcheck-track-details",parent:t,path:"/tracks/:trackId"}),f=e({id:"soundcheck-track-edit",parent:t,path:"/tracks/:trackId/edit"}),m=e({id:"soundcheck-track-create",parent:t,path:"/tracks/create"}),I=e({id:"soundcheck-track-check-details",parent:t,path:"/tracks/:trackId/checks/:checkId"}),y=e({id:"soundcheck-campaigns",parent:t,path:"/campaigns"}),v=e({id:"soundcheck-campaign-details",parent:t,path:"/campaigns/:campaignId"}),w=e({id:"soundcheck-campaign-edit",parent:t,path:"/campaigns/:campaignId/edit"}),P=e({id:"soundcheck-campaign-create",parent:t,path:"/campaigns/create"}),x=e({id:"soundcheck-tech-health",parent:t,path:"/tech-health"}),E=e({id:"soundcheck-tech-insights",parent:t,path:"/tech-insights"}),C=e({id:"soundcheck-integrations-page",parent:t,path:"/integrations"}),D=e({id:"soundcheck-integration-details",parent:t,path:"/integrations/:integrationId"}),T=e({id:"soundcheck-integration-edit",parent:t,path:"/integrations/:integrationId/edit"});e({id:"soundcheck-tech-insights-track",parent:t,path:"/tech-insights/track"});const q=e({id:"soundcheck-track-overview",parent:t,path:"/tracks/:trackId/overview"}),O=e({id:"soundcheck-track-explorer",parent:t,path:"/tracks/:trackId/explorer"}),b=e({id:"soundcheck-campaign-overview",parent:t,path:"/campaigns/:campaignId/overview"}),H=e({id:"soundcheck-campaign-explorer",parent:t,path:"/campaigns/:campaignId/explorer"}),S=e({id:"soundcheck-overview",parent:t,path:"/overview"});export{P as campaignCreateRouteRef,v as campaignDetailsRouteRef,w as campaignEditRouteRef,H as campaignExplorerRouteRef,b as campaignOverviewRouteRef,y as campaignsPageRouteRef,o as certificationPlaylistRouteRef,d as certificationPlaylistTrackCheckRouteRef,s as certificationPlaylistTrackRouteRef,n as certificationRouteRef,r as certificationTrackRouteRef,u as checkCreateRouteRef,p as checkDetailsRouteRef,k as checkEditRouteRef,R as checkTemplatesRouteRef,h as checksPageRouteRef,c as entityRootRouteRef,i as groupRootRouteRef,D as integrationDetailsRouteRef,T as integrationEditRouteRef,C as integrationsPageRouteRef,S as overviewRouteRef,t as rootRouteRef,x as techHealthRouteRef,E as techInsightsPageRouteRef,I as trackCheckDetailsRouteRef,m as trackCreateRouteRef,l as trackDetailsRouteRef,f as trackEditRouteRef,O as trackExplorerRouteRef,q as trackOverviewRouteRef,g as tracksPageRouteRef};
2
2
  //# sourceMappingURL=routes.esm.js.map
@@ -1,2 +1,2 @@
1
- var t=(a=>(a.Alpha="ascending",a.Owner="all",a.Status="active",a))(t||{});const e=12;export{t as FilterDefault,e as RESULTS_PER_PAGE};
1
+ var e=(a=>(a.Alpha="ascending",a.Owner="all",a.Status="active",a))(e||{});export{e as FilterDefault};
2
2
  //# sourceMappingURL=filters.esm.js.map
@@ -1,2 +1,2 @@
1
- import{makeStyles as t}from"@material-ui/core/styles";const i=t(a=>({root:{overflow:"hidden",display:"flex"},card:{padding:a.spacing(3),display:"flex",gap:a.spacing(2.5)},buttonChoices:{margin:"20px 0","& button":{marginRight:"10px"}},backButton:{color:a.palette.text.primary},filters:{display:"flex",gap:a.spacing(1),flexDirection:"column"},stepLabel:{cursor:"pointer !important"},stepper:{width:"100%"},formWrapper:{paddingTop:a.spacing(2),maxWidth:1920},formWrapperBUI:{padding:"0 var(--bui-space-4)",maxWidth:1920}}));export{i as formStyles};
1
+ import{makeStyles as a}from"@material-ui/core/styles";const e=a(t=>({root:{overflow:"hidden",display:"flex"},card:{padding:t.spacing(3),display:"flex",gap:t.spacing(2.5)},buttonChoices:{margin:"20px 0","& button":{marginRight:"10px"}},backButton:{color:t.palette.text.primary},filters:{display:"flex",gap:t.spacing(1),flexDirection:"column"},stepLabel:{cursor:"pointer !important"},stepper:{width:"100%"},formWrapper:{padding:"0 var(--bui-space-4)",maxWidth:1920}}));export{e as formStyles};
2
2
  //# sourceMappingURL=formStyles.esm.js.map
@@ -1,2 +1,2 @@
1
- const k=e=>{const{lifecycles:t,owners:s,types:c,systems:i}=e,n=t?.length?{"spec.lifecycle":t}:void 0,o=s?.length?{"relations.ownedBy":s}:void 0,l=c?.length?{"spec.type":c}:void 0,r=i?.length?{"relations.partOf":i}:void 0;if(n||o||l||r)return{...n,...o,...l,...r}},g=e=>e<1e4?"<10k":e<1e5?"[10k-100k)":e<1e6?"[100k-1M)":">=1M",p=e=>e<5?"<5":e<10?"[5-10)":e<50?"[10-50)":">=50",y=e=>e<10?"<10":e<50?"[10-50)":e<100?"[50-100)":">=100";export{y as getChecksBucket,g as getEntitiesBucket,p as getTracksBucket,k as toFilter};
1
+ const k=t=>t<1e4?"<10k":t<1e5?"[10k-100k)":t<1e6?"[100k-1M)":">=1M",c=t=>t<5?"<5":t<10?"[5-10)":t<50?"[10-50)":">=50",e=t=>t<10?"<10":t<50?"[10-50)":t<100?"[50-100)":">=100";export{e as getChecksBucket,k as getEntitiesBucket,c as getTracksBucket};
2
2
  //# sourceMappingURL=helpers.esm.js.map
@@ -0,0 +1,2 @@
1
+ const $=(p,e)=>{const r=a=>/^[A-Za-z_][A-Za-z0-9_]*$/.test(a),t=a=>a.replace(/\\/g,"\\\\").replace(/'/g,"\\'");return r(e)?`${p}.${e}`:`${p}['${t(e)}']`};export{$ as appendToJSONPath};
2
+ //# sourceMappingURL=json.esm.js.map
@@ -1,2 +1,2 @@
1
- import F from"lodash";import{z as e}from"zod";import{filterPresent as n}from"../components/Filter/utils.esm.js";import"../components/Filter/FilterComponent.esm.js";import{TimeUnit as h}from"../components/Frequency/types.esm.js";import"../components/Frequency/util.esm.js";import"../components/Frequency/FrequencyComponent.esm.js";import{validateCacheConfig as l}from"./collectors.esm.js";import{validateFrequency as o}from"./frequency.esm.js";const b="At least one check is required",v="This field is required",s=e.nativeEnum(h),S=e.strictObject({enabled:e.boolean(),hasDuration:e.boolean(),unit:s.optional(),value:e.number().min(1,"Value must be greater than 0.").optional()}).refine(t=>l(t)===!0,t=>({message:l(t)})),k=e.strictObject({type:e.enum(["HumanDuration","cron"]),unit:s.optional(),value:e.number().min(1,"Value must be greater than 0.").optional(),cron:e.string().optional()}).refine(t=>o(t)===!0,t=>({message:o(t)})),r=e.strictObject({selectedKinds:e.string().array(),selectedTypes:e.string().array(),selectedLifecycles:e.string().array(),selectedOwners:e.string().array(),selectedSystems:e.string().array(),selectedTags:e.string().array()}),i=e.strictObject({selectedLabels:e.object({key:e.string(),value:e.string().array().min(1,"Requires at least 1 value for key.")}).array().optional(),selectedAnnotations:e.object({key:e.string(),value:e.string().array().min(1,"Requires at least 1 value for key.")}).array().optional(),selectedOtherFilters:e.object({key:e.string(),value:e.string().array().min(1,"Requires at least 1 value for key.")}).array().optional()}),c=e.strictObject({filter:r.optional(),keyValueFilter:i.optional(),excludeFilter:r.optional(),excludeKeyValueFilter:i.optional()}),u=t=>!(!n(t.filter,t.keyValueFilter)&&n(t.excludeFilter,t.excludeKeyValueFilter)),m="Cannot have an include and exclude filter on the same facet (kind, type, lifecycle, etc.).",f=t=>{if(t.filter&&t.excludeFilter){const y=Object.keys(t.filter),d=Object.keys(t.excludeFilter);for(const a of F.intersection(y,d)){const p=t.filter[a],g=t.excludeFilter[a];if(p.length>0&&g.length>0)return!1}}return!0},C=c.refine(u,"Cannot have an exclude filter without an include filter.").refine(f,m);export{b as CHECK_IS_REQUIRED_MSG,m as CONFLICTING_FILTER_ERROR_MESSAGE,S as CacheConfigSchema,v as FIELD_IS_REQUIRED_MSG,r as FiltersSchema,k as FrequencySchema,i as KeyValueFiltersSchema,c as baseFiltersSchema,f as ensureNoConflictingFilters,C as formFiltersSchema,u as refineFilters};
1
+ import a from"lodash";import{z as e}from"zod";import{filterPresent as s}from"../components/Filter/utils.esm.js";import"../components/Filter/FilterComponent.esm.js";import{TimeUnit as b}from"../components/Frequency/types.esm.js";import"../components/Frequency/util.esm.js";import"../components/Frequency/FrequencyComponent.esm.js";import{validateCacheConfig as c}from"./collectors.esm.js";import{validateFrequency as u}from"./frequency.esm.js";const S="At least one check is required",v="This field is required",m=e.nativeEnum(b),_=e.strictObject({enabled:e.boolean(),hasDuration:e.boolean(),unit:m.optional(),value:e.number().min(1,"Value must be greater than 0.").optional()}).refine(t=>c(t)===!0,t=>({message:c(t)})),C=e.strictObject({type:e.enum(["HumanDuration","cron"]),unit:m.optional(),value:e.number().min(1,"Value must be greater than 0.").optional(),cron:e.string().optional()}).refine(t=>u(t)===!0,t=>({message:u(t)})),o=e.strictObject({selectedKinds:e.string().array(),selectedTypes:e.string().array(),selectedLifecycles:e.string().array(),selectedOwners:e.string().array(),selectedSystems:e.string().array(),selectedTags:e.string().array(),selectedLabels:e.object({key:e.string(),value:e.string().array().min(1,"Requires at least 1 value for key.")}).array().optional(),selectedAnnotations:e.object({key:e.string(),value:e.string().array().min(1,"Requires at least 1 value for key.")}).array().optional(),selectedOtherFilters:e.object({key:e.string(),value:e.string().array().min(1,"Requires at least 1 value for key.")}).array().optional()}),d=e.strictObject({include:o.array().optional(),exclude:o.array().optional()}),y="Cannot have an exclude filter without an include filter.",f=t=>!(!s(t.include)&&s(t.exclude)),p="Cannot have an include and exclude filter on the same facet (kind, type, lifecycle, etc.).",g=t=>{if(t.include?.length&&t.exclude?.length){const i=t.include.map(r=>a.omitBy(r,n=>!n.length)).flatMap(r=>Object.keys(r)),l=t.exclude.map(r=>a.omitBy(r,n=>!n.length)).flatMap(r=>Object.keys(r));if(a.intersection(i,l).length)return!1}return!0},h="Cannot have an empty filter condition if there's more than one OR condition.",E=t=>{const i=l=>l.some(r=>Object.values(r).every(n=>a.isEmpty(n)));return!(t.include?.length>1&&i(t.include)||t.exclude?.length>1&&i(t.exclude))},F=d.refine(f,y).refine(E,h).refine(g,p);export{S as CHECK_IS_REQUIRED_MSG,p as CONFLICTING_FILTER_ERROR_MESSAGE,_ as CacheConfigSchema,h as EMPTY_FILTER_BLOCKS_MESSAGE,y as EXCLUDE_WITHOUT_INCLUDE_FILTERS_MESSAGE,v as FIELD_IS_REQUIRED_MSG,o as FiltersSchema,C as FrequencySchema,d as baseFiltersSchema,g as ensureNoConflictingFilters,E as ensureNoEmptyFilterBlocks,F as formFiltersSchema,f as refineFilters};
2
2
  //# sourceMappingURL=validation.esm.js.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@spotify/backstage-plugin-soundcheck",
3
3
  "description": "Ensure quality, reliability and alignment of software development with codified checks and guidance.",
4
- "version": "0.19.8",
4
+ "version": "0.19.9",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "homepage": "https://backstage.spotify.com",
7
7
  "main": "./dist/index.esm.js",
@@ -61,15 +61,15 @@
61
61
  "@backstage/catalog-client": "^1.12.1",
62
62
  "@backstage/catalog-model": "^1.7.6",
63
63
  "@backstage/config": "^1.3.6",
64
- "@backstage/core-compat-api": "^0.5.4",
65
- "@backstage/core-components": "^0.18.3",
66
- "@backstage/core-plugin-api": "^1.12.0",
67
- "@backstage/frontend-plugin-api": "^0.13.0",
68
- "@backstage/plugin-catalog-react": "^1.21.3",
69
- "@backstage/plugin-permission-react": "^0.4.38",
70
- "@backstage/plugin-scaffolder-react": "^1.19.3",
64
+ "@backstage/core-compat-api": "^0.5.5",
65
+ "@backstage/core-components": "^0.18.4",
66
+ "@backstage/core-plugin-api": "^1.12.1",
67
+ "@backstage/frontend-plugin-api": "^0.13.2",
68
+ "@backstage/plugin-catalog-react": "^1.21.4",
69
+ "@backstage/plugin-permission-react": "^0.4.39",
70
+ "@backstage/plugin-scaffolder-react": "^1.19.4",
71
71
  "@backstage/types": "^1.2.2",
72
- "@backstage/ui": "^0.9.0",
72
+ "@backstage/ui": "^0.10.0",
73
73
  "@date-io/luxon": "^1.0.0",
74
74
  "@hookform/resolvers": "^4.0.0",
75
75
  "@material-ui/core": "^4.12.2",
@@ -84,14 +84,14 @@
84
84
  "@nivo/sunburst": "^0.99.0",
85
85
  "@nivo/treemap": "^0.99.0",
86
86
  "@remixicon/react": "^4.6.0",
87
- "@spotify/backstage-plugin-core": "^0.8.12",
88
- "@spotify/backstage-plugin-soundcheck-common": "^0.19.3",
87
+ "@spotify/backstage-plugin-core": "^0.8.13",
88
+ "@spotify/backstage-plugin-soundcheck-common": "^0.19.4",
89
89
  "@tanstack/react-query": "^4.6.1",
90
90
  "@uiw/react-md-editor": "3.20.10",
91
91
  "classnames": "^2.3.2",
92
92
  "copy-to-clipboard": "^3.3.3",
93
93
  "cron-validate": "^1.4.5",
94
- "cronstrue": "^2.28.0",
94
+ "cronstrue": "^3.0.0",
95
95
  "d3-color": "^3.1.0",
96
96
  "d3-interpolate": "^3.0.1",
97
97
  "d3-scale": "^4.0.2",
@@ -127,21 +127,21 @@
127
127
  "react-router-dom": "6.0.0-beta.0 || ^6.3.0"
128
128
  },
129
129
  "devDependencies": {
130
- "@backstage/cli": "^0.34.5",
131
- "@backstage/core-app-api": "^1.19.2",
132
- "@backstage/dev-utils": "^1.1.17",
130
+ "@backstage/cli": "^0.35.0",
131
+ "@backstage/core-app-api": "^1.19.3",
132
+ "@backstage/dev-utils": "^1.1.18",
133
133
  "@backstage/e2e-test-utils": "^0.1.1",
134
- "@backstage/frontend-test-utils": "^0.4.1",
134
+ "@backstage/frontend-test-utils": "^0.4.2",
135
135
  "@backstage/plugin-permission-common": "^0.9.3",
136
- "@backstage/test-utils": "^1.7.13",
136
+ "@backstage/test-utils": "^1.7.14",
137
137
  "@graphql-codegen/cli": "^5.0.0",
138
138
  "@graphql-codegen/typescript": "^4.0.0",
139
139
  "@graphql-codegen/typescript-graphql-request": "^6.0.0",
140
140
  "@graphql-codegen/typescript-operations": "^4.0.0",
141
141
  "@playwright/test": "^1.32.3",
142
142
  "@sp4b-dev/test-utils": "^0.0.13",
143
- "@spotify/backstage-plugin-core-common": "^0.6.11",
144
- "@spotify/backstage-plugin-soundcheck-node": "^0.10.3",
143
+ "@spotify/backstage-plugin-core-common": "^0.6.12",
144
+ "@spotify/backstage-plugin-soundcheck-node": "^0.10.4",
145
145
  "@testing-library/jest-dom": "^6.0.0",
146
146
  "@testing-library/react": "^14.0.0",
147
147
  "@testing-library/user-event": "^14.0.0",
@@ -1,2 +0,0 @@
1
- import{jsx as i,jsxs as r,Fragment as re}from"react/jsx-runtime";import{useRouteRef as ne,useApi as se,configApiRef as ce}from"@backstage/core-plugin-api";import{EntityRefLink as le}from"@backstage/plugin-catalog-react";import{usePermission as y}from"@backstage/plugin-permission-react";import{makeStyles as me,Button as pe,Box as s,Typography as D,Divider as de,Tabs as ge,Tab as C}from"@material-ui/core";import{soundcheckCampaignReadPermission as fe,soundcheckCampaignUpdatePermission as he,soundcheckCampaignNotificationsCreatePermission as ue,toEntityFilterQuery as ye}from"@spotify/backstage-plugin-soundcheck-common";import{isEmpty as Ce}from"lodash";import{useMemo as d,useState as ke,useCallback as Se,useEffect as be}from"react";import{useParams as Te,useNavigate as we}from"react-router-dom";import{useCheckStatuses as ve}from"../../hooks/aggregations/useCheckStatuses.esm.js";import"@backstage/catalog-model";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import"../../hooks/useSoundcheckAlert.esm.js";import{useGetCampaigns as Fe}from"../../hooks/campaigns/useGetCampaigns.esm.js";import"../../hooks/useConfirmationModal.esm.js";import{useCertificationStatus as xe}from"../../hooks/aggregations/useCertificationStatus.esm.js";import"react-use/lib/useLocalStorage";import{useLCPReporting as Le}from"../../hooks/useLCPReporting.esm.js";import{useLoadTimeReporting as Ne}from"../../hooks/useLoadTimeReporting.esm.js";import{campaignEditRouteRef as Re}from"../../routes.esm.js";import{FilterSidebar as Ae}from"../FilterSidebar/FilterSidebar.esm.js";import"../FilterSidebar/StateFilter.esm.js";import{useTrackFilterSidebar as Be}from"../FilterSidebar/useTrackFilterSidebar.esm.js";import{toFilter as Ee,CERTIFICATION_STATUS_MAP as De}from"../FilterSidebar/util.esm.js";import{LevelsTable as Ie}from"../LevelsTable/LevelsTable.esm.js";import{LoadingIndicator as Pe}from"../LoadingIndicator/LoadingIndicator.esm.js";import{PageWarningMessage as je}from"../PageWarningMessage/PageWarningMessage.esm.js";import{SendCampaignNotificationDialog as Oe}from"../SendCampaignNotificationDialog/SendCampaignNotificationDialog.esm.js";import"../FormControlledAutocomplete/FormControlledAutocomplete.esm.js";import"@material-ui/icons/CheckBox";import"@material-ui/icons/CheckBoxOutlineBlank";import"@material-ui/lab";import"react-hook-form";import"../ListboxVirtualized/ListboxVirtualized.esm.js";import"../FormControlledAutocomplete/ControlledAutocomplete.esm.js";import"../FormFieldLabel/FormFieldLabel.esm.js";import"../SoundcheckDialog/SoundcheckDialog.esm.js";import"../SoundcheckHeader/SoundcheckHeader.esm.js";import"../SoundcheckHeader/SoundcheckHeaderContext.esm.js";import{useHeader as Me}from"../SoundcheckHeader/useHeader.esm.js";import{SoundcheckMarkdownContentDeprecated as ze}from"../SoundcheckMarkdownContent/SoundcheckMarkdownContentDeprecated.esm.js";import"@backstage/core-components";import"react-markdown";import"rehype-raw";import"remark-gfm";import"../SoundcheckMarkdownContent/SoundcheckMarkdownContentBUI.esm.js";import{TopFailingChecksTable as He}from"../TopFailingChecksTable/TopFailingChecksTable.esm.js";import{TrackEntitiesTable as We}from"../TrackPage/TrackEntitiesTable/TrackEntitiesTable.esm.js";import{CampaignStatusHistoryTile as _e}from"./CampaignStatusHistoryTile.esm.js";import{CampaignStatusTile as $e}from"./CampaignStatusTile.esm.js";import{DaysRemainingTile as Ue}from"./DaysRemainingTile.esm.js";const Ve=me(e=>({root:{height:"100%",background:e.palette.background.default,display:"flex",width:"100%",borderTop:`1px solid ${e.palette.divider}`},progressContainer:{flex:1,borderBottom:`1px solid ${e.palette.divider}`,padding:e.spacing(2)},campaignContainerContent:{paddingTop:e.spacing(1),paddingBottom:e.spacing(1),backgroundColor:e.palette.background.paper},editButton:{marginLeft:"auto"},notificationButton:{marginRight:e.spacing(1)},checksContainer:{},entitiesContainer:{marginTop:e.spacing(3)},headerDescription:{fontSize:e.typography.body2.fontSize,margin:e.spacing(.5,0,0),"& p":{margin:0},"& a":{color:"inherit",textDecoration:"underline"}},content:{paddingTop:0,flex:1},ownerLink:{"& span":{color:"inherit","&:hover":{textDecoration:"underline"}}},sectionTitle:{paddingBottom:e.spacing(1)},chartSection:{flex:1,flexBasis:"auto",minWidth:320,display:"flex",flexDirection:"column",height:"100%"},title:{fontWeight:"bold",fontSize:"1.1rem",lineHeight:`${e.typography.h5.fontSize}px`,cursor:"default",marginBottom:e.spacing(2)},divider:{marginTop:e.spacing(1),marginBottom:e.spacing(1)},tabs:{padding:e.spacing(2,2,0,2)},contentArea:{flex:1,padding:e.spacing(0,2)},tableArea:{margin:e.spacing(1,0,2)}})),Ge=()=>{const{owners:e,lifecycles:l,types:m,systems:p,certificationStatuses:k,stagedLifecycles:I,setStagedLifecycles:P,stagedOwners:j,setStagedOwners:O,stagedTypes:M,setStagedTypes:z,stagedSystems:H,setStagedSystems:W,stagedCertificationStatuses:S,setStagedCertificationStatuses:_,hasFilterChanges:$,handleApplyFilters:U,handleClearFilters:V}=Be(),{campaignId:n}=Te(),b=d(()=>({routeName:"soundcheck-campaign-insights",additionalAttributes:{campaignId:n||"",filtersApplied:e.length+l.length+m.length+p.length,ownersFilter:e?.join(",")||"",lifecyclesFilter:l?.join(",")||"",typesFilter:m?.join(",")||"",systemsFilter:p?.join(",")||""}}),[n,e,l,m,p]),{reportContentLoaded:T}=Ne(b),{reporter:G}=Le(b),t=Ve(),f=d(()=>Ee({lifecycles:l,owners:e,types:m,systems:p}),[l,e,m,p]),[h,Q]=ke("checks"),q=Se((c,oe)=>{Q(oe)},[]),{data:J,isLoading:g}=Fe({ids:[n],first:1}),o=J?.edges?.[0]?.node,a=o?.track,{loading:K,allowed:X}=y({permission:fe,resourceRef:n}),{loading:w,allowed:v}=y({permission:he,resourceRef:n}),Y=Array.from(new Set(a?.levels.flatMap(c=>c.checks).map(c=>c.id)??[])),{data:F,isLoading:u}=ve({trackId:a?.id,checkIds:Y,filter:f},!!a),x=we(),L=ne(Re),Z=d(()=>a?.ownerEntityRef?i(le,{color:"inherit",entityRef:a.ownerEntityRef,className:t.ownerLink}):null,[a?.ownerEntityRef,t.ownerLink]),N=se(ce).getOptionalBoolean("soundcheck.notifications.enabled"),{loading:R,allowed:A}=y({permission:ue}),{data:ee,isLoading:B}=xe({trackId:a?.id??"",filter:f},!!o),ie=d(()=>r(re,{children:[N&&!R&&A&&o&&i(Oe,{campaign:o,buttonClass:t.notificationButton}),!w&&v&&a?.isEditable?i(pe,{className:t.editButton,variant:"contained",color:"primary",onClick:()=>{x(L({campaignId:n}))},children:"Edit Campaign"}):null]}),[N,R,A,o,t.notificationButton,t.editButton,w,v,a?.isEditable,x,L,n]),te=d(()=>a?.description?i(ze,{className:t.headerDescription,content:a.description}):null,[t.headerDescription,a?.description]);Me({title:a?.name,description:te,customSubtitle:Z,sectionRight:ie});const ae=d(()=>ye(a?.filter),[a]),E=G?.getLCPValue();return be(()=>{!g&&!u&&!B&&T({lcp:E})},[g,u,B,T,E]),r("div",{children:[i(je,{entityName:"track",entityId:n,showNotFound:!g&&!o,showCannotView:!K&&!X}),g&&i(Pe,{}),a&&r("div",{className:t.root,children:[i(s,{children:i(Ae,{trackFilter:ae,stagedTypes:M,stagedLifecycles:I,stagedOwners:j,stagedSystems:H,stagedCertificationStatus:S?S[0]:"",onTypesChange:z,onLifecyclesChange:P,onOwnersChange:O,onSystemsChange:W,onCertificationStatusChange:c=>_(c?[c]:[]),onApplyFilters:U,onClearFilters:V,hasFilterChanges:$})}),r(s,{className:t.content,children:[i("div",{className:t.progressContainer,children:r(s,{display:"flex",marginTop:2,children:[r(s,{display:"flex",flexDirection:"column",marginRight:3,minWidth:320,children:[i(D,{className:t.title,children:"Current Status"}),i($e,{campaign:o,filter:f}),i(de,{className:t.divider}),i(Ue,{campaign:o})]}),r(s,{className:t.chartSection,children:[i(D,{className:t.title,children:"Historical Status"}),i(_e,{campaign:o,filter:f})]})]})}),i(s,{className:t.tabs,children:r(ge,{value:h,onChange:q,indicatorColor:"primary",textColor:"primary",children:[i(C,{label:"Checks",value:"checks"}),i(C,{label:"Top Failing Checks",value:"topFailingChecks"}),i(C,{label:"Entities",value:"entities"})]})}),r(s,{className:t.contentArea,children:[h==="checks"&&i("div",{className:t.tableArea,children:i(Ie,{track:a,checkStatuses:F,isLoading:g||u,hideLevel:!0})}),h==="entities"&&i(s,{marginTop:1,children:i(We,{track:a,lifecycles:l,owners:e,types:m,systems:p,certificationStatus:Ce(k)?void 0:De[k[0]]})}),h==="topFailingChecks"&&i("div",{className:t.tableArea,children:i(He,{track:a,checkStatuses:F,certificationStatus:ee?.certificationStatus,hideLevel:!0})})]})]})]})]})};export{Ge as CampaignPageDeprecated};
2
- //# sourceMappingURL=CampaignPageDeprecated.esm.js.map
@@ -1,2 +0,0 @@
1
- import{jsx as i}from"react/jsx-runtime";import{useTheme as h,Box as m}from"@material-ui/core";import{makeStyles as f}from"@material-ui/core/styles";import{DateTime as n}from"luxon";import{useMemo as u}from"react";import{ResponsiveContainer as g}from"recharts";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{useCertificationStatusHistory as y}from"../../hooks/aggregations/useCertificationStatusHistory.esm.js";import"react-router-dom";import"react-use/lib/useLocalStorage";import{AreaChart as x}from"../AreaChart/AreaChart.esm.js";import{LineChartPlaceholder as S}from"../Charts/LineChart/LineChartPlaceholder.esm.js";const C=f(t=>({card:{display:"flex",flexDirection:"column",width:"100%",height:290},title:{fontWeight:"bold",fontSize:"1.1rem",lineHeight:`${t.typography.h5.fontSize}px`,cursor:"default"},content:{padding:t.spacing(1,2,1,0),width:"100%",height:"100%"}}));function H({campaign:t,filter:p}){const c=h(),r=C(),d=n.fromISO(t.startDate),l=Math.max(Math.ceil(n.now().diff(d,"days").days),1),{data:o}=y({trackId:t.track.id,filter:p,numberOfDays:l},!!t),e=o?.certificationStatusHistory.numberOfEntities??0,a=u(()=>e>0?o?.certificationStatusHistory.history.map(s=>({date:s.date,Passed:Math.round(s.statusByLevel[0].passed/e*100)})):[],[e,o]);return i(g,{height:290,debounce:1,children:i(m,{className:r.card,children:i(m,{className:r.content,children:a?.length?i(x,{data:a,categories:["Passed"],categoryColors:{Passed:c.palette.success.main},index:"date",minValue:0,maxValue:100,showLegend:!1}):i(S,{height:290,text:e>0?"No Historical Data":"No Applicable Entities"})})})})}export{H as CampaignStatusHistoryTile};
2
- //# sourceMappingURL=CampaignStatusHistoryTile.esm.js.map
@@ -1,2 +0,0 @@
1
- import{jsx as t,jsxs as s}from"react/jsx-runtime";import{useTheme as S,Box as i,Grid as b,Typography as f}from"@material-ui/core";import{makeStyles as B}from"@material-ui/core/styles";import I from"@material-ui/icons/TrendingDown";import k from"@material-ui/icons/TrendingFlat";import R from"@material-ui/icons/TrendingUp";import{DateTime as N}from"luxon";import{useMemo as T}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{useCertificationStatus as w}from"../../hooks/aggregations/useCertificationStatus.esm.js";import{useCertificationStatusHistory as L}from"../../hooks/aggregations/useCertificationStatusHistory.esm.js";import"react-router-dom";import"react-use/lib/useLocalStorage";import{compactNumberFormatter as g}from"../../utils/formatters.esm.js";import{CategoryBar as j}from"../CategoryBar/CategoryBar.esm.js";import{LoadingIndicator as M}from"../LoadingIndicator/LoadingIndicator.esm.js";const C=B(e=>({card:{display:"flex",flexDirection:"column"},content:{padding:0,display:"flex",margin:0,gap:e.spacing(1)},item:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:e.spacing(.5)},legendDash:{width:e.spacing(2),height:e.spacing(1),borderRadius:e.spacing(.375),marginRight:e.spacing(1)},category:{display:"flex",alignItems:"center",flex:1,marginRight:e.spacing(2)}}));function v({label:e,value:l,total:a,color:m,valueFormatter:c}){const p=C();return s(b,{item:!0,xs:12,className:p.item,children:[s(i,{className:p.category,children:[t("span",{className:p.legendDash,style:{backgroundColor:m}}),t(f,{children:e})]}),a&&s(f,{children:[c(l)," of ",c(a)," (",Math.round(l/a*100),"%)"]})]})}function H({campaign:e,filter:l}){const a=S(),m=C(),{data:c,isLoading:p}=w({trackId:e.track.id,filter:l},!0),r=c?.certificationStatus.statusByLevel[0],D=Math.max(Math.ceil(N.now().diff(N.fromISO(e.startDate),"days").days),1),{data:u}=L({trackId:e.track.id,filter:l,numberOfDays:D},!!e),o=c?.certificationStatus.numberOfEntities??0,d=T(()=>{if(o===void 0||u===void 0||r===void 0)return;const x=(u.certificationStatusHistory.history[0]?.statusByLevel[0].passed??0)/o*100;return r.passed/o*100-x},[u,r,o]);let h=k,y="inherit",n;return d&&(n=`${d.toFixed(0)}% since campaign start`,d<=-1?(h=I,n=`-${n}`,y="error"):d>=1&&(h=R,n=`+${n}`,y="primary")),p?t(i,{className:m.card,children:t(M,{})}):t(i,{className:m.card,children:r?t(i,{className:m.content,children:s(i,{width:"100%",children:[t(j,{data:r,valueFormatter:g,categories:["passed","failed","notReported"],categoryFormatter:x=>x.replace(/\b\w/g,F=>F.toUpperCase()),colors:[a.palette.success.main,a.palette.error.main,a.palette.text.disabled]}),t(i,{paddingTop:"12px",children:s(b,{container:!0,spacing:2,children:[t(v,{label:"Passing",value:r.passed,total:o,color:a.palette.success.main,valueFormatter:g}),t(v,{label:"Failing",value:r.failed,total:o,color:a.palette.error.main,valueFormatter:g}),t(v,{label:"Not Reported",value:r.notReported,total:o,color:a.palette.text.disabled,valueFormatter:g}),!!d&&s(i,{display:"flex",alignItems:"center",paddingTop:"12px",children:[t(h,{color:y}),t(f,{style:{marginLeft:a.spacing(1)},children:n})]})]})})]})}):t(i,{margin:"auto",minHeight:125,display:"flex",flexDirection:"column",justifyContent:"center",children:t(f,{style:{marginBottom:8},variant:"subtitle1",children:"No Data"})})})}export{H as CampaignStatusTile};
2
- //# sourceMappingURL=CampaignStatusTile.esm.js.map
@@ -1,2 +0,0 @@
1
- import{jsxs as n,jsx as t}from"react/jsx-runtime";import{Box as d,Typography as i}from"@material-ui/core";import{makeStyles as m}from"@material-ui/core/styles";import{DateTime as r}from"luxon";const p=m(a=>({root:{display:"flex",flexDirection:"column",overflow:"hidden",width:"100%",padding:0,marginTop:a.spacing(.5)},textWrapper:{display:"flex",alignItems:"flex-end",padding:0,marginBottom:a.spacing(.5)},daysRemaining:{margin:0,marginRight:a.spacing(1),lineHeight:"1em"},daysRemainingText:{lineHeight:"1.2em"},divider:{width:"100%"},dateContainer:{display:"flex",flexDirection:"row",justifyContent:"flex-start",width:"100%",flexGrow:0},dateSection:{width:"100%"},dateLabel:{fontSize:a.typography.caption.fontSize,color:a.palette.text.secondary},dateValue:{fontSize:a.typography.subtitle2.fontSize,color:a.palette.text.primary}}));function h({campaign:a}){const e=p(),s=r.fromISO(a.startDate),o=r.fromISO(a.targetCompletionDate),c=r.now(),l=Math.max(Math.ceil(o.diff(c,"days").days),0);return n(d,{className:e.root,children:[n(d,{className:e.textWrapper,children:[t(i,{variant:"h2",className:e.daysRemaining,children:l}),t(i,{variant:"subtitle2",className:e.daysRemainingText,children:l===1?"DAY REMAINING":"DAYS REMAINING"})]}),n("div",{className:e.dateContainer,children:[n("div",{className:e.dateSection,children:[t(i,{variant:"caption",className:e.dateLabel,children:"Start Date"}),t(i,{className:e.dateValue,children:s.toLocaleString({month:"short",day:"numeric"}).toLocaleUpperCase()})]}),n("div",{className:`${e.dateSection}`,children:[t(i,{variant:"caption",className:e.dateLabel,children:"End Date"}),t(i,{className:e.dateValue,children:o.toLocaleString({month:"short",day:"numeric"}).toLocaleUpperCase()})]})]})]})}export{h as DaysRemainingTile};
2
- //# sourceMappingURL=DaysRemainingTile.esm.js.map
@@ -1,2 +0,0 @@
1
- import{jsx as a,jsxs as y}from"react/jsx-runtime";import{useRouteRef as J,useApi as K,featureFlagsApiRef as Q}from"@backstage/core-plugin-api";import{usePermission as U}from"@backstage/plugin-permission-react";import{makeStyles as X,Grid as i,Button as Y}from"@material-ui/core";import{soundcheckCampaignCreatePermission as Z}from"@spotify/backstage-plugin-soundcheck-common";import{useState as t,useMemo as _,useEffect as A}from"react";import{useNavigate as ee}from"react-router-dom";import ae from"react-use/lib/useDebounce";import{useGetCampaignOwners as re}from"../../../hooks/campaigns/useGetCampaignOwners.esm.js";import{useGetCampaigns as ie}from"../../../hooks/campaigns/useGetCampaigns.esm.js";import{useLCPReporting as te}from"../../../hooks/useLCPReporting.esm.js";import{useLoadTimeReporting as ne}from"../../../hooks/useLoadTimeReporting.esm.js";import{campaignCreateRouteRef as oe}from"../../../routes.esm.js";import{FilterDefault as C}from"../../../utils/filters.esm.js";import{EmptyState as se}from"../../EmptyState/EmptyState.esm.js";import"../../EmptyState/EmptyStateBUI.esm.js";import"@remixicon/react";import{Pagination as me}from"../../Pagination/Pagination.esm.js";import{SearchFilters as pe}from"../../SearchFilters/SearchFilters.esm.js";import{EmptyCampaignState as le}from"../CampaignEmptyState.esm.js";import{CampaignsOverviewSkeleton as ce}from"./CampaignsOverviewSkeleton.esm.js";import{CampaignSummaryCard as ge}from"./CampaignSummaryCard.esm.js";import de from"./useArchiveConfirmationModal.esm.js";var B=(e=>(e.title="No campaigns found",e.description="No campaigns matched your search. Consider changing search term and filters.",e))(B||{});const ue=X(e=>({headerButtons:{display:"flex",gap:e.spacing(1),flexWrap:"nowrap",justifyContent:"end",alignItems:"end"},header:{padding:e.spacing(0,0,1)},container:{padding:e.spacing(3),gap:e.spacing(3)},createButton:{lineHeight:"1.25rem",paddingTop:e.spacing(1.5),paddingBottom:e.spacing(1.5)}})),he=({campaignsPerPage:e,currentCursor:F})=>{const[o,P]=t(F),[d,R]=t(""),[s,k]=t(""),[m,L]=t(C.Alpha),[p,O]=t(C.Owner),[l,T]=t(C.Status),v=_(()=>({routeName:"soundcheck-campaigns",additionalAttributes:{campaignsPerPage:e,pageCursor:o||"",sortOrder:m||"",ownerFilter:p||"",statusFilter:l||"",nameSearch:s||""}}),[e,o,m,p,s,l]),{reportContentLoaded:S}=ne(v),{reporter:j}=te(v),c=ue(),{data:D,isLoading:u}=re();ae(()=>{k(d)},500,[d]);const{loading:E,allowed:G}=U({permission:Z}),{data:h,isLoading:n}=ie({ids:void 0,first:e,after:o,orderAlphabetical:m,searchByOwner:p,searchByName:s,searchByStatus:l}),I=ee(),W=J(oe),H=()=>I(W()),f=h?.edges.map(r=>r.node),[N,w]=t([]);A(()=>{P(void 0),w([])},[s]);const b=K(Q),M=!b.getRegisteredFlags().find(r=>r.name==="soundcheck-enable-campaigns")||b.isActive("soundcheck-enable-campaigns"),V=!G||!M,q=r=>{L(r.target.value)},z=r=>{O(r.target.value)},$=r=>{T(r.target.value)},x=j?.getLCPValue();if(A(()=>{!n&&!u&&S({lcp:x})},[n,u,S,x]),!n&&!f)return a(le,{});let g;return n?g=a(ce,{}):f?.length?g=f.map(r=>a(i,{xs:12,sm:12,md:6,lg:4,xl:3,item:!0,role:"listitem","aria-label":"result",children:a(de,{children:a(ge,{campaign:r})})},r.id)):g=a(i,{xs:12,item:!0,role:"listitem","aria-label":"result",children:a(se,{title:"No campaigns found",description:"No campaigns matched your search. Consider changing search term and filters."})}),y(i,{container:!0,direction:"row",className:c.container,children:[y(i,{container:!0,className:c.header,children:[a(pe,{searchPlaceholder:"Search Available Campaigns",isLoading:n||u,searchTerm:d,setSearchTerm:R,filterAlpha:m,handleAlphabeticalFilterChange:q,filterOwner:p,handleOwnerFilterChange:z,filterStatus:l,handleStatusFilterChange:$,owners:D}),a(i,{item:!0,xs:4,className:c.headerButtons,children:!E&&a(Y,{disabled:V,variant:"contained",color:"primary",onClick:H,className:c.createButton,children:"Create Campaign"})})]}),a(i,{container:!0,spacing:4,role:"list","aria-label":"campaigns",children:g}),(h?.pageInfo.hasNextPage||N?.length>0)&&a(i,{item:!0,xs:12,children:a(me,{response:h,listingsPerPage:e,cursor:o,setCursor:P,prevCursors:N,setPrevCursors:w,labelPerPageDropdown:"Campaigns Per Page:",urlRoute:"campaigns?campaignsPerPage="})})]})};export{he as CampaignListPageDeprecated,B as CampaignNoResults};
2
- //# sourceMappingURL=CampaignListPageDeprecated.esm.js.map
@@ -1,2 +0,0 @@
1
- import{jsxs as a,jsx as e}from"react/jsx-runtime";import{EntityRefLink as s}from"@backstage/plugin-catalog-react";import{makeStyles as o,List as l,Typography as c,ListItem as n,Tooltip as m,ListItemIcon as d,ListItemText as g,Badge as r}from"@material-ui/core";import p from"@material-ui/icons/Group";const h=o(i=>({root:{position:"relative",height:"100%"},cardSection:{marginBottom:i.spacing(2)},listItem:{padding:0},listItemText:{margin:0},campaignDetails:{display:"flex",flexDirection:"column",gap:i.spacing(1)},badge:{"& span":{position:"relative",transform:"none",transformOrigin:"unset",backgroundColor:i.palette.action.disabledBackground}},iconContainer:{minWidth:"auto",paddingRight:i.spacing(1)},ownerLink:{"& span":{"&:hover":{textDecoration:"underline"}}}})),f=({campaign:i})=>{const t=h();return a(l,{dense:!0,disablePadding:!0,className:t.cardSection,children:[e(c,{variant:"overline",color:"textSecondary",children:"Campaign Details"}),a("div",{className:t.campaignDetails,children:[i.ownerEntityRef&&a(n,{disableGutters:!0,className:t.listItem,children:[e(m,{title:"Owner",children:e(d,{className:t.iconContainer,children:e(p,{color:"inherit",fontSize:"small"})})}),e(g,{className:t.listItemText,primary:e(s,{entityRef:i.ownerEntityRef,className:t.ownerLink,hideIcon:!0})})]}),i.archived&&e(n,{disableGutters:!0,className:t.listItem,children:e(r,{badgeContent:"Archived",className:t.badge})}),i.track.draft&&e(n,{disableGutters:!0,className:t.listItem,children:e(r,{badgeContent:"Draft",className:t.badge})})]})]})};export{f as CampaignMetadata};
2
- //# sourceMappingURL=CampaignMetadata.esm.js.map
@@ -1,2 +0,0 @@
1
- import{jsx as p}from"react/jsx-runtime";import{useRouteRef as c}from"@backstage/core-plugin-api";import{usePermission as l}from"@backstage/plugin-permission-react";import{soundcheckCampaignUpdatePermission as P,soundcheckCampaignDeletePermission as x}from"@spotify/backstage-plugin-soundcheck-common";import{useCallback as b}from"react";import{useNavigate as I}from"react-router-dom";import{v4 as L}from"uuid";import{BadgeVariant as S}from"../../../graphql/generated/index.esm.js";import"@backstage/catalog-model";import"@tanstack/react-query";import"../../../api.esm.js";import"../../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"../../../hooks/useSoundcheckAlert.esm.js";import{useArchiveCampaign as T}from"../../../hooks/campaigns/useArchiveCampaign.esm.js";import{useDeleteCampaign as U}from"../../../hooks/campaigns/useDeleteCampaign.esm.js";import{useCreateTrack as N}from"../../../hooks/tracks/useCreateTrack.esm.js";import{useConfirmationModal as V}from"../../../hooks/useConfirmationModal.esm.js";import"react-use/lib/useLocalStorage";import{campaignDetailsRouteRef as $,campaignEditRouteRef as j}from"../../../routes.esm.js";import{SummaryCard as B}from"../../SummaryCard/SummaryCard.esm.js";import{CampaignMetadata as q}from"./CampaignMetadata.esm.js";import{useArchiveConfirmationModal as z}from"./useArchiveConfirmationModal.esm.js";const F=({campaign:a})=>{const{id:u,name:f,description:g,ownerEntityRef:v,archived:h}=a,y=c($),C=c(j),r=I(),t=a.archived,{showModal:m}=V(),{showArchiveModal:w}=z(),{mutate:R}=N(),{mutate:n}=U(),{mutate:k}=T(),{loading:A,allowed:D}=l({permission:P,resourceRef:a.id}),{loading:d,allowed:s}=l({permission:x,resourceRef:a.id}),E=b(async()=>{await m({title:"Delete Campaign",message:`Are you sure you want to delete campaign ${a.name}?`})&&n(a.id)},[m,n,a.id,a.name]),M=()=>{const{track:i}=a,o={id:L(),ownerEntityRef:i.ownerEntityRef,description:i.description??"",name:i.name,documentationURL:i.documentationURL,type:"standard",levels:i.levels.map(e=>({checks:e.checks,description:e.description,name:e.name,ordinal:e.ordinal})),filter:i.filter??void 0,exclude:i.exclude??void 0,badgeType:i.badge?.variant===S.Status?"status":"medal",draft:i.draft??!1};R(o)};return p(B,{title:f??u,description:g,viewIsPrimaryAction:!0,children:(v||h)&&p(q,{campaign:a}),handleView:()=>r(y({campaignId:a.id})),handleEdit:!A&&D&&!t?()=>r(C({campaignId:a.id})):void 0,handleDelete:!d&&s?E:void 0,handleArchive:!d&&s&&!t?async()=>{const{saveTrack:i,confirmed:o}=await w({title:"Archive Campaign",message:`Are you sure you want to archive campaign ${a.name}?`});o&&(i&&M(),k(a.id))}:void 0})};export{F as CampaignSummaryCard};
2
- //# sourceMappingURL=CampaignSummaryCard.esm.js.map
@@ -1,2 +0,0 @@
1
- var i=(a=>(a.all="All",a.active="Active",a.archived="Archived",a))(i||{});export{i as CampaignStatus};
2
- //# sourceMappingURL=CampaignTypes.esm.js.map
@@ -1,2 +0,0 @@
1
- import{jsx as e}from"react/jsx-runtime";import{Grid as t}from"@material-ui/core";import{Skeleton as r}from"@material-ui/lab";const o=()=>e(t,{item:!0,container:!0,"data-testid":"campaigns-skeleton",children:Array.from({length:6},(m,i)=>e(t,{xs:12,sm:12,md:6,lg:4,xl:3,item:!0,role:"listitem",children:e(r,{variant:"rect",height:385})},`loading-${i}`))});export{o as CampaignsOverviewSkeleton};
2
- //# sourceMappingURL=CampaignsOverviewSkeleton.esm.js.map
@@ -1,2 +0,0 @@
1
- import{jsx as t,jsxs as o}from"react/jsx-runtime";import{useTheme as v,Typography as h}from"@material-ui/core";import b from"@material-ui/icons/Timer";import{useState as y,useEffect as C}from"react";import{ResponsiveContainer as L,CartesianGrid as $,XAxis as A,YAxis as I,Area as E,Line as W,AreaChart as z,LineChart as O}from"recharts";import{ChartWrapper as S}from"./ChartWrapper/ChartWrapper.esm.js";const j=({type:r="area",numLines:a=3,height:l=250})=>{const e=v(),[m,d]=y([]),[x,f]=y(0);C(()=>{const n=()=>Array.from({length:7},(p,k)=>{const c={name:`Day ${k+1}`,totalEntities:1e3};for(let s=1;s<=a;s++)c[`Line ${s}`]=r==="area"?Math.random()*(100/a):Math.random()*100;return c});d(n());const i=setInterval(()=>{d(n())},1500),u=setInterval(()=>{f(p=>p+1)},1e3);return()=>{clearInterval(i),clearInterval(u)}},[a,r]);const g=r==="area"?z:O;return t(S,{children:o("div",{style:{height:l,width:"100%",position:"relative",borderRadius:"4px"},children:[t("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,boxShadow:`inset 0 0 70px 100px ${e.palette.background.default}`,borderRadius:"4px",pointerEvents:"none",zIndex:1}}),t(L,{height:l,debounce:1,children:o(g,{data:m,margin:{top:0,right:0,bottom:0,left:0},children:[t("defs",{children:Array.from({length:a},(n,i)=>o("linearGradient",{id:`gradient-${i+1}`,x1:"0",y1:"0",x2:"0",y2:"1",children:[t("stop",{offset:"5%",stopColor:e.palette.text.secondary,stopOpacity:.4}),t("stop",{offset:"95%",stopColor:e.palette.text.secondary,stopOpacity:0})]},`gradient-${i+1}`))}),t($,{stroke:e.palette.divider,strokeWidth:1,horizontal:!0,vertical:!1}),t(A,{dataKey:"name",tickLine:!1,axisLine:!1,tick:{fill:e.palette.text.secondary}}),t(I,{tickLine:!1,axisLine:!1,tick:{fill:e.palette.text.secondary}}),Array.from({length:a},(n,i)=>r==="area"?t(E,{type:"monotone",dataKey:`Line ${i+1}`,stackId:"1",stroke:e.palette.text.secondary,strokeWidth:2,strokeOpacity:.3,fill:`url(#gradient-${i+1})`,animationDuration:1200,animationEasing:"ease-in-out",dot:!1},`line-${i+1}`):t(W,{type:"monotone",dataKey:`Line ${i+1}`,stroke:e.palette.text.secondary,strokeWidth:2,strokeOpacity:.3,animationDuration:1200,animationEasing:"ease-in-out",dot:!1},`line-${i+1}`))]})}),o("div",{style:{position:"absolute",top:"16px",left:"50%",transform:"translateX(-50%)",textAlign:"center",width:"100%",padding:"8px 0",zIndex:2},children:[t(h,{variant:"subtitle1",style:{color:e.palette.text.secondary,fontWeight:500,letterSpacing:"0.5px"},children:"Calculating..."}),o(h,{variant:"subtitle1",style:{color:e.palette.text.secondary,opacity:.8,display:"flex",alignItems:"center",justifyContent:"center",gap:"4px"},children:[t(b,{style:{fontSize:16}}),x,"s"]})]})]})})};export{j as LoadingChart};
2
- //# sourceMappingURL=LoadingChart.esm.js.map
@@ -1,2 +0,0 @@
1
- import{jsx as f}from"react/jsx-runtime";import{stringifyEntityRef as v}from"@backstage/catalog-model";import{Table as x}from"@backstage/core-components";import{makeStyles as z}from"@material-ui/core";import L from"lodash";import{useState as B,useEffect as T,useCallback as m}from"react";import{CheckEntityField as r,Direction as g}from"../../../graphql/generated/index.esm.js";import{useEntitiesByRefs as N}from"../../../hooks/catalog/useEntitiesByRefs.esm.js";import{useCheckEntities as D}from"../../../hooks/entities/useCheckEntities.esm.js";import{toResultState as u}from"../utils.esm.js";import{columnFactories as n}from"./columns.esm.js";import{toCheckEntityRow as O}from"./utils.esm.js";const P=10,F=["kind","metadata.name","metadata.namespace","spec.profile.displayName","metadata.title","relations","spec.lifecycle","spec.type"],A=(s,c)=>[n.createStateColumn(),n.createNameColumn({trackId:s,checkId:c}),n.createSystemColumn(),n.createOwnerColumn(),n.createSpecTypeColumn(),n.createSpecLifecycleColumn()],j=[r.State,r.Name,r.System,r.Owner,r.Type,r.Lifecycle],Q=z({tableContainer:{display:"flex",flexDirection:"column",width:"100%",overflowX:"auto","& table":{boxSizing:"border-box","& th:first-child, & td:first-child":{paddingLeft:"6px"},"& th:last-child, & td:last-child":{paddingRight:"6px !important"}}}}),W=({checkId:s,trackId:c,filter:p,states:l})=>{const h=Q(),y=A(c,s),[e,d]=B({orderBy:void 0,filter:p,states:l?.map(u).filter(t=>t!==void 0),pageInfo:{page:0,pageSize:P,direction:"forward",cursor:null}});T(()=>{d(t=>({...t,pageInfo:{...t.pageInfo,page:0,cursor:null},filter:p,states:l?.map(u).filter(i=>i!==void 0)}))},[p,l]);const{data:a,isLoading:I}=D({checkId:s,trackId:c,orderBy:e.orderBy,filter:e.filter,states:e.states?.length?e.states:void 0,[e.pageInfo.direction==="forward"?"first":"last"]:e.pageInfo.pageSize,[e.pageInfo.direction==="forward"?"after":"before"]:e.pageInfo.cursor}),k=m((t,i)=>{let o;t===-1?o=void 0:o={field:j[t],direction:i==="asc"?g.Asc:g.Desc},d({...e,orderBy:o,pageInfo:{...e.pageInfo,page:0,cursor:null}})},[e]),C=m((t,i)=>{const o=t>e.pageInfo.page?"forward":"backward",R=o==="forward"?a?.checkEntities.pageInfo.endCursor??null:a?.checkEntities.pageInfo.startCursor??null;d({...e,pageInfo:{page:t,pageSize:i,direction:o,cursor:R}})},[a,e]),S=a?.checkEntities.edges.map(t=>t.node.entityRef)??[],{data:w,isLoading:b}=N({entityRefs:S,fields:F}),E=L.compact(a?.checkEntities.edges.map(t=>{const i=w?.items.find(o=>!!o&&v(o)===t.node.entityRef);return i?O({checkDetails:t.node,entity:i}):void 0}))??[];return f("div",{className:h.tableContainer,children:f(x,{title:"Entities",style:{width:"100%",border:"none",margin:0},columns:y,data:E,options:{paging:!0,showFirstLastPageButtons:!1,paginationPosition:"bottom",emptyRowsWhenPaging:!0,pageSizeOptions:[10,25,50],pageSize:e.pageInfo.pageSize,search:!1,showTitle:!0,padding:"dense"},onOrderChange:k,onPageChange:C,page:e.pageInfo.page,totalCount:a?.checkEntities.totalCount??0,isLoading:I||b,components:{Toolbar:()=>null}})})};export{W as CheckEntitiesTable};
2
- //# sourceMappingURL=CheckEntitiesTable.esm.js.map
@@ -1,2 +0,0 @@
1
- import{jsx as r,Fragment as o}from"react/jsx-runtime";import{OverflowTooltip as c}from"@backstage/core-components";import{EntityRefLink as m,EntityRefLinks as s}from"@backstage/plugin-catalog-react";import{makeStyles as u,Chip as d}from"@material-ui/core";import{CheckIcon as p}from"../../CheckIcon/CheckIcon.esm.js";import{SoundcheckEntityLink as y}from"../../SoundcheckEntityLink/SoundcheckEntityLink.esm.js";const l=u(()=>({linkHover:{"& span":{"&:hover":{textDecoration:"underline"}}}})),f=Object.freeze({createStateColumn(){return{title:"",field:"state",render:({state:t})=>r(p,{result:t}),width:"auto",align:"center",sorting:!1}},createNameColumn(t){return{title:"Name",field:"resolved.entityRef",highlight:!0,customSort(e,n){return 0},render:({entity:e})=>{const n=l();return t?.checkId||t?.trackId?r(y,{entity:e,trackId:t.trackId,checkId:t.checkId,className:n.linkHover}):r(m,{entityRef:e,defaultKind:t?.defaultKind||"Component",className:n.linkHover})}}},createSystemColumn(){return{title:"System",field:"resolved.partOfSystemRelationTitle",customSort(t,e){return 0},render:({resolved:t})=>{const e=l();return r(s,{entityRefs:t.partOfSystemRelations,defaultKind:"system",className:e.linkHover})}}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",customSort(t,e){return 0},render:({resolved:t})=>{const e=l();return r(s,{entityRefs:t.ownedByRelations,defaultKind:"group",className:e.linkHover})}}},createSpecTypeColumn(){return{title:"Type",field:"entity.spec.type",customSort(t,e){return 0}}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"entity.spec.lifecycle",customSort(t,e){return 0},width:"auto"}},createMetadataDescriptionColumn(){return{title:"Description",field:"entity.metadata.description",customSort(t,e){return 0},render:({entity:t})=>r(c,{text:t.metadata.description,placement:"bottom-start"}),width:"auto"}},createTagsColumn(){return{title:"Tags",field:"entity.metadata.tags",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:t})=>r(o,{children:t.metadata.tags&&t.metadata.tags.map(e=>r(d,{label:e,size:"small",variant:"outlined",style:{marginBottom:"0px"}},e))}),width:"auto",sorting:!1}},createTitleColumn(t){return{title:"Title",field:"entity.metadata.title",customSort(e,n){return 0},hidden:t?.hidden,searchable:!0}},createLabelColumn(t,e){return{title:e?.title||"Label",field:"entity.metadata.labels",customSort(n,a){return 0},cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:n})=>{const a=n.metadata?.labels,i=a&&a[t]||e?.defaultValue;return r(o,{children:i&&r(d,{label:i,size:"small",variant:"outlined"},i)})},width:"auto",sorting:!1}},createNamespaceColumn(){return{title:"Namespace",field:"entity.metadata.namespace",customSort(t,e){return 0},width:"auto"}}});export{f as columnFactories};
2
- //# sourceMappingURL=columns.esm.js.map
@@ -1,2 +0,0 @@
1
- import{jsx as i,jsxs as u}from"react/jsx-runtime";import{useRouteRef as pe}from"@backstage/core-plugin-api";import{EntityRefLink as he}from"@backstage/plugin-catalog-react";import{usePermission as K}from"@backstage/plugin-permission-react";import{makeStyles as fe,useTheme as ue,Button as ge,Typography as X,Tabs as ye,Tab as Y,Box as Z}from"@material-ui/core";import{soundcheckCheckReadPermission as ke,soundcheckCheckUpdatePermission as Ce,toEntityFilterQuery as M,combineEntityFilterQueries as Se}from"@spotify/backstage-plugin-soundcheck-common";import w from"lodash/isEqual";import{useMemo as a,useCallback as W,useState as v,useEffect as ee}from"react";import{useSearchParams as xe,useParams as be,useNavigate as ve}from"react-router-dom";import"@backstage/catalog-model";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import{useCheck as we}from"../../hooks/checks/useCheck.esm.js";import"../../hooks/useSoundcheckAlert.esm.js";import{useTrack as Ee}from"../../hooks/tracks/useTrack.esm.js";import"../../hooks/useConfirmationModal.esm.js";import{useCheckStatus as Ne}from"../../hooks/aggregations/useCheckStatus.esm.js";import"react-use/lib/useLocalStorage";import{useLCPReporting as Le}from"../../hooks/useLCPReporting.esm.js";import{useLoadTimeReporting as Re}from"../../hooks/useLoadTimeReporting.esm.js";import{checkEditRouteRef as Ie}from"../../routes.esm.js";import{toFilter as Te}from"../../utils/helpers.esm.js";import{CheckStatusBar as Fe}from"../CheckStatusBar/CheckStatusBar.esm.js";import"../CheckStatusBar/CheckStatusBarBUI.esm.js";import{FilterSidebar as De}from"../FilterSidebar/FilterSidebar.esm.js";import{StateFilter as Be}from"../FilterSidebar/StateFilter.esm.js";import{LoadingIndicator as Pe}from"../LoadingIndicator/LoadingIndicator.esm.js";import{PageWarningMessage as te}from"../PageWarningMessage/PageWarningMessage.esm.js";import"../SoundcheckHeader/SoundcheckHeader.esm.js";import"../SoundcheckHeader/SoundcheckHeaderContext.esm.js";import{useHeader as Ae}from"../SoundcheckHeader/useHeader.esm.js";import{SoundcheckMarkdownContentDeprecated as je}from"../SoundcheckMarkdownContent/SoundcheckMarkdownContentDeprecated.esm.js";import"@backstage/core-components";import"react-markdown";import"rehype-raw";import"remark-gfm";import"../SoundcheckMarkdownContent/SoundcheckMarkdownContentBUI.esm.js";import"../TechHealth/Filters/types.esm.js";import"../TechHealth/Filters/FacetFilter.esm.js";import"../TechHealth/Filters/FilterProvider.esm.js";import"../TechHealth/Filters/Filters.esm.js";import"../TechHealth/Filters/FiltersHeader.esm.js";import"../TechHealth/Filters/FiltersSection.esm.js";import"lodash";import"../../contexts/TrackFormContext.esm.js";import"../../contexts/CheckFormContext.esm.js";import"../../contexts/CampaignFormContext.esm.js";import"../../contexts/UserProvider.esm.js";import{parseNumberOfDays as Oe}from"../TechHealth/Filters/utils.esm.js";import{CheckEntitiesTable as Me}from"./CheckEntitiesTable/CheckEntitiesTable.esm.js";import{CheckStatusHistoryChart as We}from"./CheckStatusHistoryChart.esm.js";import{CheckStatusTable as ze}from"./CheckStatusTable.esm.js";import{ExemptionsTable as He}from"./ExemptionsTable.esm.js";function $e(t,y){for(const l of t.levels)for(const r of l.checks)if(r.id===y)return r;return null}const Qe=fe(t=>({root:{height:"100%"},pageContent:{display:"flex",minHeight:`calc(100vh - ${t.spacing(15)}px)`,borderTop:`1px solid ${t.palette.divider}`,height:"100%"},mainContentArea:{flex:1,display:"flex",flexDirection:"column",minWidth:0},editButton:{marginLeft:"auto"},statusContainer:{borderBottom:`1px solid ${t.palette.divider}`,padding:t.spacing(3,0,2,3)},statusCards:{display:"flex",gap:t.spacing(2)},currentStatusSection:{width:"325px",minWidth:"325px",flex:0,display:"flex",flexDirection:"column"},historicalStatusSection:{flex:1,flexShrink:1,flexGrow:1,flexBasis:"auto",minWidth:"150px",display:"flex",flexDirection:"column"},statusTitle:{fontWeight:"bold",fontSize:"1.1rem",lineHeight:`${t.typography.h5.fontSize}px`,cursor:"default",marginBottom:t.spacing(2)},headerDescription:{fontSize:t.typography.body2.fontSize,margin:t.spacing(.5,0,0),"& p":{margin:0},"& a":{color:"inherit",textDecoration:"underline"}},entitiesContainer:{padding:t.spacing(2,3,3,3)},ownerLink:{"& span":{color:"inherit","&:hover":{textDecoration:"underline"}}}})),Ue=()=>{const[t,y]=xe(),{trackId:l,checkId:r}=be(),s=a(()=>t.getAll("states"),[t]),c=a(()=>t.getAll("owners"),[t]),d=a(()=>t.getAll("lifecycles"),[t]),m=a(()=>t.getAll("types"),[t]),p=a(()=>t.getAll("systems"),[t]),L=a(()=>Oe(t.get("numberOfDays")),[t]),z=a(()=>({routeName:"soundcheck-check-insights",additionalAttributes:{checkId:r||"",trackId:l||"",filtersApplied:c.length+d.length+m.length+p.length+s.length,ownersFilter:c.join(",")||"",lifecyclesFilter:d.join(",")||"",typesFilter:m.join(",")||"",systemsFilter:p.join(",")||"",statesFilter:s.join(",")||"",numberOfDays:L}}),[r,l,c,d,m,p,s,L]),{reportContentLoaded:H}=Re(z),{reporter:ie}=Le(z),o=Qe(),R=W(()=>c.map(e=>({label:e,value:e})),[c]),[k,I]=v(d),[C,T]=v(R()),[S,F]=v(m),[x,D]=v(p),[b,B]=v(s);ee(()=>{T(R()),I(d),F(m),D(p),B(s)},[c,d,m,p,s,R]);const re=a(()=>{const e={owners:!w(C,c),lifecycles:!w(k,d),types:!w(S,m),systems:!w(x,p),states:!w(b,s)};return Object.values(e).some(Boolean)},[C,c,k,d,S,m,x,p,b,s]),oe=W(()=>{const e=new URLSearchParams(t);e.delete("lifecycles"),e.delete("owners"),e.delete("types"),e.delete("systems"),e.delete("states"),k.length>0&&k.forEach(n=>e.append("lifecycles",n)),C.length>0&&C.forEach(n=>e.append("owners",typeof n=="string"?n:n.value)),S.length>0&&S.forEach(n=>e.append("types",n)),x.length>0&&x.forEach(n=>e.append("systems",n)),b.length>0&&b.forEach(n=>e.append("states",n)),y(e)},[t,k,C,S,x,b,y]),se=W(()=>{I([]),T([]),F([]),D([]),B([]);const e=new URLSearchParams(t);e.delete("lifecycles"),e.delete("owners"),e.delete("types"),e.delete("systems"),e.delete("states"),y(e)},[t,y]),P=Te({lifecycles:d,owners:c,types:m,systems:p}),{data:g,isLoading:E}=Ee(l),{data:h,isLoading:N}=we(r),{loading:$,allowed:A}=K({permission:ke,resourceRef:r}),f=a(()=>h??g?.levels.flatMap(e=>e.checks).find(e=>e.id===r),[h,r,g?.levels]),{loading:Q,allowed:U}=K({permission:Ce,resourceRef:r}),V=ve(),G=pe(Ie),ne=ue();let j;if(r)if(g){const e=M(g.filter),n=M($e(g,r)?.filter);j=Se(e,n)}else f?.filter&&(j=M(f.filter));const{data:q,isLoading:J}=Ne({checkId:r,trackId:l,filter:P,states:s?.length?s:void 0},!!r),ae=a(()=>h?.ownerEntityRef?i(he,{color:"inherit",entityRef:h.ownerEntityRef,className:o.ownerLink}):null,[h?.ownerEntityRef,o.ownerLink]),le=a(()=>!Q&&U&&h?.isEditable?i(ge,{className:o.editButton,variant:"contained",color:"primary",onClick:()=>{V(G({checkId:h.id}))},children:"Edit Check"}):null,[U,h?.id,h?.isEditable,o.editButton,G,Q,V]),ce=a(()=>f?.description?i(je,{className:o.headerDescription,content:f.description}):null,[o.headerDescription,f?.description]);Ae({title:f?.name??r??"Soundcheck",description:ce,customSubtitle:ae,sectionRight:le});const de=a(()=>!!f&&!$&&!A,[A,f,$]),[O,me]=v(0),_=ie?.getLCPValue();return ee(()=>{!N&&!J&&(!l||!E)&&H({lcp:_})},[N,J,E,l,H,_]),u("div",{children:[i(te,{entityName:"track",entityId:l,showNotFound:!!l&&!E&&!g}),i(te,{entityName:"check",entityId:r,showCannotView:de}),(N||!!l&&E)&&i(Pe,{}),!N&&A&&i("div",{className:o.root,children:u("div",{className:o.pageContent,children:[i(De,{trackFilter:j,stagedTypes:S,stagedLifecycles:k,stagedOwners:C,stagedSystems:x,onTypesChange:F,onLifecyclesChange:I,onOwnersChange:T,onSystemsChange:D,onApplyFilters:oe,onClearFilters:se,hasFilterChanges:re,children:i(Be,{states:s,stagedStates:b,onStagedStatesChange:B})}),u("div",{className:o.mainContentArea,children:[i("div",{className:o.statusContainer,children:u("div",{className:o.statusCards,children:[u("div",{className:o.currentStatusSection,children:[i(X,{className:o.statusTitle,children:"Current Status"}),i("div",{style:{width:"100%",height:30,display:"flex",alignItems:"flex-start",marginBottom:ne.spacing(2)},children:i(Fe,{status:q,states:s})}),i("div",{children:i(ze,{checkStatus:q,states:s})})]}),u("div",{className:o.historicalStatusSection,children:[i(X,{className:o.statusTitle,children:"Historical Status"}),i("div",{style:{height:"100%"},children:i(We,{checkId:r,trackId:l,filter:P,states:s,numberOfDays:L})})]})]})}),u("div",{className:o.entitiesContainer,children:[u(ye,{value:O,onChange:(e,n)=>me(n),indicatorColor:"primary",textColor:"primary","aria-label":"Entities and Exemptions Tabs",children:[i(Y,{label:"Entities"}),i(Y,{label:"Exemptions"})]}),i(Z,{hidden:O!==0,children:i(Me,{checkId:r,trackId:g?.id,filter:P,states:s})}),i(Z,{hidden:O!==1,children:i(He,{checkId:r})})]})]})]})})]})};export{Ue as CheckPageDeprecated};
2
- //# sourceMappingURL=CheckPageDeprecated.esm.js.map
@@ -1,2 +0,0 @@
1
- import{jsx as e,jsxs as m}from"react/jsx-runtime";import{useApi as A,configApiRef as v}from"@backstage/core-plugin-api";import{makeStyles as g,useTheme as I}from"@material-ui/core";import{DateTime as b}from"luxon";import{ResponsiveContainer as D,LineChart as L,CartesianGrid as C,XAxis as W,YAxis as c,Tooltip as K,Line as n}from"recharts";import{useCheckStatusHistory as O}from"../../hooks/aggregations/useCheckStatusHistory.esm.js";import{getCheckStatusColor as o}from"../../utils/colors.esm.js";import{compactNumberFormatter as S}from"../../utils/formatters.esm.js";import{LoadingChart as w}from"../Charts/LoadingChart.esm.js";import{TimePeriodBar as F}from"../TimePeriodBar/TimePeriodBar.esm.js";const R=g({root:{height:290,width:"100%",position:"relative",borderRadius:"4px"}}),T=({checkId:d,trackId:p,filter:l,states:k,numberOfDays:h})=>{const t=I(),y=R(),f=A(v).getOptionalNumber("soundcheck.results.history.retentionTimeInDays"),{data:s,isLoading:u}=O({checkId:d,trackId:p,filter:l,states:k,numberOfDays:h},!!d);if(u)return e(w,{type:"line",numLines:3});const r=i=>s?.history.some(x=>x[i]>0)??!1,a={stroke:t.palette.background.paper,strokeWidth:1,r:5};return m("div",{className:y.root,children:[e(F,{maxNumberOfDays:f}),e(D,{height:250,debounce:1,children:m(L,{data:s?.history??[],margin:{top:0,right:0,bottom:0,left:0},children:[e(C,{stroke:t.palette.divider,strokeWidth:1,horizontal:!0,vertical:!1}),e(W,{dataKey:"date",tickFormatter:i=>b.fromISO(i).toFormat("MMM d"),tickLine:!1,axisLine:!1}),e(c,{yAxisId:"percentage",domain:[0,100],axisLine:!1,tickLine:!1,tickFormatter:i=>`${i}%`,ticks:[0,25,50,75,100]}),e(c,{yAxisId:"count",orientation:"right",domain:[0,s?.numberOfEntities??0],axisLine:!1,tickLine:!1,tickFormatter:i=>S(i)}),e(K,{contentStyle:{backgroundColor:t.palette.background.paper,color:t.palette.text.primary,border:`1px solid ${t.palette.divider}`},cursor:{stroke:t.palette.divider,strokeWidth:1}}),r("passed")&&e(n,{type:"monotone",dataKey:"passed",stroke:o(t,"passed"),yAxisId:"count",strokeWidth:2,dot:!1,isAnimationActive:!1,activeDot:{fill:o(t,"passed"),...a}}),r("failed")&&e(n,{type:"monotone",dataKey:"failed",stroke:o(t,"failed"),yAxisId:"count",strokeWidth:2,dot:!1,isAnimationActive:!1,activeDot:{fill:o(t,"failed"),...a}}),r("warning")&&e(n,{type:"monotone",dataKey:"warning",stroke:o(t,"warning"),yAxisId:"count",strokeWidth:2,dot:!1,isAnimationActive:!1,activeDot:{fill:o(t,"warning"),...a}}),r("error")&&e(n,{type:"monotone",dataKey:"error",stroke:o(t,"error"),yAxisId:"count",strokeWidth:2,dot:!1,isAnimationActive:!1,activeDot:{fill:o(t,"error"),...a}}),r("exempt")&&e(n,{type:"monotone",dataKey:"exempt",stroke:o(t,"exempt"),yAxisId:"count",strokeWidth:2,dot:!1,isAnimationActive:!1,activeDot:{fill:o(t,"exempt"),...a}}),r("notReported")&&e(n,{type:"monotone",dataKey:"notReported",stroke:o(t,"not-reported"),yAxisId:"count",strokeWidth:2,dot:!1,isAnimationActive:!1,activeDot:{fill:o(t,"not-reported"),...a}})]})})]})};export{T as CheckStatusHistoryChart};
2
- //# sourceMappingURL=CheckStatusHistoryChart.esm.js.map
@@ -1,2 +0,0 @@
1
- import{jsx as o,jsxs as m}from"react/jsx-runtime";import{useTheme as y,Typography as p}from"@material-ui/core";import{makeStyles as k,createStyles as x}from"@material-ui/core/styles";import{Skeleton as N}from"@material-ui/lab";import{memo as S,useMemo as C,Fragment as v}from"react";import{getCheckStatusColor as n}from"../../utils/colors.esm.js";import{compactNumberFormatter as d}from"../../utils/formatters.esm.js";import{CheckStateCategories as w,CheckState as T}from"./utils.esm.js";const b=k(e=>x({container:{display:"grid",gridTemplateColumns:"3fr 2fr",gap:e.spacing(1),minWidth:0},item:{display:"flex",alignItems:"center",fontSize:"0.875rem",minWidth:0},legendDash:{width:e.spacing(2),height:e.spacing(.75),borderRadius:e.spacing(.375),marginRight:e.spacing(1)},category:{display:"flex",alignItems:"center",fontSize:"0.875rem",minWidth:0,flex:1},categoryText:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",fontSize:"0.875rem",minWidth:0,flex:1},value:{fontSize:"0.875rem",color:e.palette.text.primary},valueCell:{justifyContent:"flex-end",whiteSpace:"nowrap"},percentage:{color:e.palette.text.secondary,marginLeft:e.spacing(1)},skeleton:{backgroundColor:e.palette.action.hover}})),R=S(({checkStatus:e,states:l})=>{const r=y(),t=b(),g=C(()=>[{name:"Passed",key:"passed",color:n(r,"passed")},{name:"Failed",key:"failed",color:n(r,"failed")},{name:"Warning",key:"warning",color:n(r,"warning")},{name:"Exempt",key:"exempt",color:n(r,"exempt")},{name:"Error",key:"error",color:n(r,"error")},{name:"Not Reported",key:"notReported",color:n(r,"not-reported")}],[r]),s=e?e.numberOfEntities-e.notApplicable-e.exempt:-1,h=i=>{let a=!1;return l?.length&&(i===w.NOT_REPORTED?a=l.includes(T.NOT_REPORTED):a=l.includes(i.toUpperCase())),!l?.length||a?Number(e?.[i]??0)??0:0};return o("div",{className:t.container,children:g.map(({name:i,key:a,color:f})=>{const c=h(a),u=s>0?Math.round(c/s*100):0;return m(v,{children:[o("div",{className:t.item,children:m("div",{className:t.category,children:[o("span",{className:t.legendDash,style:{backgroundColor:f}}),o(p,{className:t.categoryText,children:i})]})}),o("div",{className:`${t.item} ${t.valueCell}`,children:e?m(p,{className:t.value,children:[d(c)," of"," ",d(s),m("span",{className:t.percentage,children:["(",u,"%)"]})]}):o(N,{width:120,height:20,className:t.skeleton})})]},a)})})});export{R as CheckStatusTable};
2
- //# sourceMappingURL=CheckStatusTable.esm.js.map
@@ -1,2 +0,0 @@
1
- import{jsx as e,jsxs as l}from"react/jsx-runtime";import{EmptyState as S}from"@backstage/core-components";import{EntityRefLink as w}from"@backstage/plugin-catalog-react";import{makeStyles as j,CircularProgress as W,Typography as B,Table as E,TableHead as I,TableRow as b,TableCell as o,TableBody as R,Tooltip as D,TablePagination as L}from"@material-ui/core";import{useState as d}from"react";import{useExemptions as O}from"../../hooks/exemptions/useExemptions.esm.js";const _=10,F=j(i=>({justificationCell:{maxWidth:600,minWidth:200,flex:2,overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",whiteSpace:"pre-line",wordBreak:"break-word"},emptyStateWrapper:{padding:i.spacing(2)}}));function H(i){if(!i)return"";const a=!isNaN(i)&&!isNaN(parseFloat(i));let r;return a&&String(i).length>=10?r=new Date(Number(i)):r=new Date(i),isNaN(r.getTime())?String(i):r.toLocaleDateString()}const $=({checkId:i})=>{const a=F(),[r,h]=d(0),[f,x]=d(_),[g,c]=d("forward"),[y,p]=d(void 0),{data:m,isLoading:P,error:v}=O(i,{first:g==="forward"?f:void 0,after:g==="forward"?y:void 0}),k=m?.totalCount??0,u=m?.edges??[],n=m?.pageInfo,N=(s,t)=>{t>r?(c("forward"),p(n?.endCursor??void 0)):t<r&&(c("backward"),p(n?.startCursor??void 0)),h(t)},C=s=>{x(parseInt(s.target.value,10)),h(0),p(void 0),c("forward")};return P?e(W,{}):v?e(B,{color:"error",children:"Failed to load exemptions."}):u.length?l("div",{children:[l(E,{children:[e(I,{children:l(b,{children:[e(o,{children:"Entity"}),e(o,{className:a.justificationCell,children:"Justification"}),e(o,{children:"User"}),e(o,{children:"Date"})]})}),e(R,{children:u.map(s=>{const t=s.node,T=H(t.timestamp);return l(b,{children:[e(o,{children:e(w,{entityRef:t.entity_ref})}),e(o,{className:a.justificationCell,children:e(D,{title:t.justification,placement:"top-start",arrow:!0,children:e("span",{children:t.justification})})}),e(o,{children:e(w,{entityRef:t.user_ref})}),e(o,{children:T})]},`${t.entity_ref}-${t.check_id}`)})})]}),e(L,{component:"div",count:k,page:r,onPageChange:N,rowsPerPage:f,onRowsPerPageChange:C,rowsPerPageOptions:[10,25,50],nextIconButtonProps:{disabled:!n?.hasNextPage},backIconButtonProps:{disabled:!n?.hasPreviousPage||r===0}})]}):e("div",{className:a.emptyStateWrapper,children:e(S,{title:"No exemptions found",description:"There are no exemptions for this check.",missing:"data"})})};export{$ as ExemptionsTable};
2
- //# sourceMappingURL=ExemptionsTable.esm.js.map
@@ -1,2 +0,0 @@
1
- import{jsx as t,jsxs as C}from"react/jsx-runtime";import{useApi as I,featureFlagsApiRef as re,useRouteRef as te}from"@backstage/core-plugin-api";import{usePermission as oe}from"@backstage/plugin-permission-react";import{makeStyles as ae,Button as B,Grid as a}from"@material-ui/core";import{soundcheckCheckCreatePermission as ie}from"@spotify/backstage-plugin-soundcheck-common";import{useState as i,useMemo as se,useEffect as P}from"react";import{useNavigate as ce}from"react-router-dom";import ne from"react-use/lib/useDebounce";import{soundcheckApiRef as me}from"../../../api.esm.js";import"@backstage/catalog-model";import"@tanstack/react-query";import"../../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import{useGetChecks as pe}from"../../../hooks/checks/useGetChecks.esm.js";import"../../../hooks/useSoundcheckAlert.esm.js";import"../../../hooks/useConfirmationModal.esm.js";import"react-use/lib/useLocalStorage";import{useGetCheckOwners as le}from"../../../hooks/checks/useGetCheckOwners.esm.js";import{useImportChecks as de}from"../../../hooks/checks/useImportChecks.esm.js";import{useLCPReporting as he}from"../../../hooks/useLCPReporting.esm.js";import{useLoadTimeReporting as ge}from"../../../hooks/useLoadTimeReporting.esm.js";import ue from"../../../images/no-results.svg";import{checkTemplatesRouteRef as fe}from"../../../routes.esm.js";import{exportChecks as ke}from"../../../utils/export.esm.js";import{FilterDefault as L}from"../../../utils/filters.esm.js";import{EmptyState as O}from"../../EmptyState/EmptyState.esm.js";import"../../EmptyState/EmptyStateBUI.esm.js";import"@remixicon/react";import{ImportExportPanelDeprecated as Ce}from"../../ImportExportPanel/ImportExportPanelDeprecated.esm.js";import{Pagination as Pe}from"../../Pagination/Pagination.esm.js";import{SearchFilters as be}from"../../SearchFilters/SearchFilters.esm.js";import{ChecksOverviewSkeleton as ve}from"../skeletons/ChecksOverviewSkeleton.esm.js";import{CheckSummaryCard as xe}from"./CheckSummaryCard.esm.js";var T=(e=>(e.title="Create a check",e.description="A check is a comparison between a defined acceptable outcome and the actual outcome of a given process.",e.callToAction="Get started",e))(T||{}),F=(e=>(e.title="No checks found",e.description="No checks matched your search. Consider changing search term and filters.",e))(F||{});const ye=ae(e=>({headerButtons:{display:"flex",gap:e.spacing(1),flexWrap:"nowrap",justifyContent:"end",alignItems:"end"},header:{padding:e.spacing(0,0,1)},container:{padding:e.spacing(3),gap:e.spacing(3)},createButton:{lineHeight:"1.25rem",paddingTop:e.spacing(1.5),paddingBottom:e.spacing(1.5)}})),Ae=({checksPerPage:e,currentCursor:E})=>{const[m,b]=i(E),[g,G]=i(""),[c,j]=i(L.Alpha),[n,D]=i(L.Owner),[p,H]=i(""),v=se(()=>({routeName:"soundcheck-checks",additionalAttributes:{checksPerPage:e,pageCursor:m||"",sortOrder:c||"",ownerFilter:n||"",nameSearch:p||""}}),[e,m,c,n,p]),{reportContentLoaded:x}=ge(v),{reporter:M}=he(v),l=ye(),{data:V,isLoading:u}=le();ne(()=>{H(g)},500,[g]);const{loading:y,allowed:W}=oe({permission:ie}),{data:o,isLoading:s}=pe({ids:void 0,first:e,after:m,orderAlphabetical:c,searchByOwner:n,searchByName:p}),[f,$]=i(o),d=f?.edges?.map(r=>r.node),[A,w]=i([]);P(()=>{b(void 0),w([])},[p,c,n]);const N=I(re),q=!N.getRegisteredFlags().find(r=>r.name==="soundcheck-enable-check-creation")||N.isActive("soundcheck-enable-check-creation"),k=!W||!q,z=r=>{j(r.target.value)},J=r=>{D(r.target.value)};P(()=>{o&&$(()=>({totalCount:o.totalCount,edges:o.edges,pageInfo:{startCursor:o.pageInfo.startCursor,endCursor:o.pageInfo.endCursor,hasNextPage:o?.pageInfo.hasNextPage??!1,hasPreviousPage:o?.pageInfo.hasPreviousPage??!1}}))},[o]);const K=ce(),Q=te(fe),R=()=>K(Q()),U=I(me),{mutateAsync:X}=de(),Y=async r=>X(r),Z=async()=>{const r=await U.getChecks({orderAlphabetical:"asc"});return ke(r.edges.map(ee=>ee.node))},S=M?.getLCPValue();if(P(()=>{!s&&!u&&x({lcp:S})},[s,u,x,S]),!s&&!d)return t(O,{title:"Create a check",description:"A check is a comparison between a defined acceptable outcome and the actual outcome of a given process.",imgSrc:ue,action:!y&&t(B,{disabled:k,variant:"contained",color:"primary",onClick:R,children:"Get started"})});let h;s?h=t(ve,{}):d?.length?h=d?.map(r=>t(a,{xs:12,sm:12,md:6,lg:4,xl:3,item:!0,role:"listitem","aria-label":`check card ${r.id}`,children:t(xe,{check:r})},r.id)):h=t(a,{xs:12,item:!0,role:"listitem","aria-label":"result",children:t(O,{title:"No checks found",description:"No checks matched your search. Consider changing search term and filters."})});const _=f?.pageInfo.hasNextPage||A?.length>0;return C(a,{container:!0,direction:"row",className:l.container,children:[C(a,{container:!0,className:l.header,children:[t(be,{searchPlaceholder:"Search Available Checks",isLoading:s||u,searchTerm:g,setSearchTerm:G,filterAlpha:c,handleAlphabeticalFilterChange:z,filterOwner:n,handleOwnerFilterChange:J,owners:V}),C(a,{item:!0,xs:4,className:l.headerButtons,children:[t(Ce,{resourceType:"check",disableImport:k,disableExport:s||!d?.length,onImport:Y,onExport:Z}),!y&&t(B,{disabled:k,variant:"contained",color:"primary",onClick:R,className:l.createButton,children:"Create Check"})]})]}),t(a,{container:!0,spacing:4,role:"list","aria-label":"checks",children:h}),_&&t(a,{item:!0,xs:12,children:t(Pe,{response:f,listingsPerPage:e,cursor:m,setCursor:b,prevCursors:A,setPrevCursors:w,labelPerPageDropdown:"Checks Per Page:",urlRoute:"checks?checksPerPage="})})]})};export{T as CheckEmptyState,Ae as CheckListPage,F as CheckNoResults};
2
- //# sourceMappingURL=CheckListPageDeprecated.esm.js.map
@@ -1,2 +0,0 @@
1
- import{jsxs as n,jsx as t}from"react/jsx-runtime";import{EntityRefLink as o}from"@backstage/plugin-catalog-react";import{makeStyles as r,List as a,Typography as s,ListItem as c,Tooltip as l,ListItemIcon as m,ListItemText as d}from"@material-ui/core";import h from"@material-ui/icons/Group";const p=r(i=>({root:{position:"relative",height:"100%"},cardSection:{marginBottom:i.spacing(2)},listItem:{padding:0},listItemText:{margin:0},iconContainer:{minWidth:"auto",paddingRight:i.spacing(1)},ownerLink:{"& span":{"&:hover":{textDecoration:"underline"}}}})),g=({check:i})=>{const e=p();return n(a,{dense:!0,disablePadding:!0,className:e.cardSection,children:[t(s,{variant:"overline",color:"textSecondary",children:"Check Details"}),n(c,{disableGutters:!0,className:e.listItem,children:[t(l,{title:"Owner",children:t(m,{className:e.iconContainer,children:t(h,{color:"inherit",fontSize:"small"})})}),t(d,{className:e.listItemText,primary:t(o,{entityRef:i.ownerEntityRef??"No Owner",hideIcon:!0,className:e.ownerLink})})]})]})};export{g as CheckMetadata};
2
- //# sourceMappingURL=CheckMetadata.esm.js.map
@@ -1,2 +0,0 @@
1
- import{jsx as n}from"react/jsx-runtime";import{useRouteRef as p}from"@backstage/core-plugin-api";import{usePermission as l}from"@backstage/plugin-permission-react";import{soundcheckCheckUpdatePermission as E,soundcheckCheckDeletePermission as P}from"@spotify/backstage-plugin-soundcheck-common";import{useCallback as t}from"react";import{useNavigate as v}from"react-router-dom";import"@backstage/catalog-model";import"@tanstack/react-query";import"../../../api.esm.js";import"../../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"../../../hooks/useSoundcheckAlert.esm.js";import{useConfirmationModal as x}from"../../../hooks/useConfirmationModal.esm.js";import"react-use/lib/useLocalStorage";import{useDeleteCheck as I}from"../../../hooks/checks/useDeleteCheck.esm.js";import{checkDetailsRouteRef as M,checkEditRouteRef as b}from"../../../routes.esm.js";import{exportCheck as A}from"../../../utils/export.esm.js";import{SummaryCard as N}from"../../SummaryCard/SummaryCard.esm.js";import{CheckMetadata as S}from"./CheckMetadata.esm.js";const j=({check:o})=>{const{id:e,name:i,description:h,isEditable:m,ownerEntityRef:u}=o,r=v(),c=p(M),a=p(b),{loading:f,allowed:k}=l({permission:E,resourceRef:e}),{loading:C,allowed:R}=l({permission:P,resourceRef:e}),{showModal:s}=x(),{mutate:d}=I(),w=t(async()=>{await s({title:"Delete Check",message:`Are you sure you want to delete the check '${i??e}'?`})&&d(e)},[s,i,d,e]),y=t(()=>{r(c({checkId:e}))},[c,e,r]),D=t(()=>{r(a({checkId:e}))},[a,e,r]),g=t(()=>{A(o)},[o]);return n(N,{title:i??e,description:h,children:u&&n(S,{check:o}),handleView:y,handleEdit:m&&!f&&k?D:void 0,handleDelete:m&&!C&&R?w:void 0,handleExport:g,viewIsPrimaryAction:!0})};export{j as CheckSummaryCard};
2
- //# sourceMappingURL=CheckSummaryCard.esm.js.map
@@ -1,2 +0,0 @@
1
- import{jsx as e}from"react/jsx-runtime";import{Grid as t}from"@material-ui/core";import{Skeleton as i}from"@material-ui/lab";const o=()=>e(t,{item:!0,container:!0,"data-testid":"checks-skeleton",children:Array.from({length:10},(m,r)=>e(t,{xs:12,sm:12,md:6,lg:4,xl:3,item:!0,role:"listitem",children:e(i,{variant:"rect",height:385})},`loading-${r}`))});export{o as ChecksOverviewSkeleton};
2
- //# sourceMappingURL=ChecksOverviewSkeleton.esm.js.map
@@ -1,2 +0,0 @@
1
- import{jsx as r,Fragment as e}from"react/jsx-runtime";import{Grid as o}from"@material-ui/core";import{Skeleton as i}from"@material-ui/lab";const l=()=>r(e,{children:Array.from({length:6},(m,t)=>r(o,{xs:12,sm:12,md:6,lg:4,xl:3,item:!0,role:"listitem",children:r(i,{variant:"rect",height:385})},`loading-${t}`))});export{l as CollectorListSkeleton};
2
- //# sourceMappingURL=CollectorListSkeleton.esm.js.map
@@ -1,2 +0,0 @@
1
- import{jsx as n}from"react/jsx-runtime";import{Typography as m}from"@material-ui/core";import{getContrastTextColor as p}from"../../utils/colors.esm.js";const s=({value:r,getColor:l,numericValue:o,size:t="medium"})=>{const e=l(o||0),i=p(e);return n(m,{style:{backgroundColor:e,color:i,borderRadius:"4px",textAlign:"center",fontWeight:"bold",fontSize:t==="small"?"0.7rem":"0.9rem",minWidth:t==="small"?"32px":"56px",width:t==="small"?"32px":"56px",height:t==="small"?"15px":"28px",display:"flex",alignItems:"center",justifyContent:"center",padding:t==="small"?"0 4px":"0 8px"},children:r})};export{s as ColorChip};
2
- //# sourceMappingURL=ColorChip.esm.js.map
@@ -1,2 +0,0 @@
1
- import{jsxs as m,jsx as t}from"react/jsx-runtime";import{Box as l,Typography as c}from"@material-ui/core";import{upperFirst as f,isEmpty as g}from"lodash";import{useMemo as i}from"react";import"../FormControlledAutocomplete/FormControlledAutocomplete.esm.js";import"@material-ui/icons/CheckBox";import"@material-ui/icons/CheckBoxOutlineBlank";import"@material-ui/lab";import"react-hook-form";import"../ListboxVirtualized/ListboxVirtualized.esm.js";import{ControlledAutocomplete as G}from"../FormControlledAutocomplete/ControlledAutocomplete.esm.js";import{GroupHierarchyChip as x}from"./GroupHierarchyChip.esm.js";const C=({selectedGroupEntityRef:p,groupType:o,allOptions:a,selectGroup:n,isLoading:u})=>{const e=i(()=>a.filter(r=>r.type===o),[a,o]),d=i(()=>e.map(r=>r.ref),[e]),s=i(()=>e.filter(r=>r.key==="My Groups").map(r=>r.ref),[e]),y=i(()=>e.find(r=>r.ref===p)?.ref||null,[e,p]);return m(l,{maxWidth:480,marginBottom:1,children:[t(c,{variant:"subtitle2",children:f(o)}),t(G,{value:y,options:d,onChange:n,autoSelect:!1,getOptionLabel:r=>e.find(h=>h.ref===r)?.name??r,isLoading:u,placeholder:`Search all ${o}s`}),!g(s)&&m(l,{marginTop:1,children:[m(c,{variant:"subtitle2",children:["My ",f(o),"s"]}),t(l,{marginTop:1,children:s.map(r=>t(x,{selectedGroupRef:p,groupEntityRef:r,setSelectedGroup:n},r))})]})]})};export{C as GroupHierarchyCategorySelection};
2
- //# sourceMappingURL=GroupHierarchyCategorySelection.esm.js.map
@@ -1,2 +0,0 @@
1
- import{jsx as r}from"react/jsx-runtime";import{EntityDisplayName as l}from"@backstage/plugin-catalog-react";import{Chip as p}from"@material-ui/core";const n=({groupEntityRef:o,selectedGroupRef:e,setSelectedGroup:i})=>{if(!o)return null;const t=o===e;return r(p,{onClick:t?void 0:()=>i(o),size:"small",color:t?"secondary":"default",label:r(l,{entityRef:o,disableTooltip:!0}),style:{marginBottom:6}},o)};export{n as GroupHierarchyChip};
2
- //# sourceMappingURL=GroupHierarchyChip.esm.js.map
@@ -1,2 +0,0 @@
1
- import{jsxs as r,jsx as e,Fragment as v}from"react/jsx-runtime";import{useEntityPresentation as R,EntityDisplayName as w}from"@backstage/plugin-catalog-react";import{Box as l,Typography as o}from"@material-ui/core";import{isEmpty as d}from"lodash";import{useMemo as c}from"react";import{useGroupHierarchy as B}from"../../hooks/heirarchy/useGroupHierarchy.esm.js";import{getAllOwnedEntityCount as O}from"../../utils/getAllOwnedEntityCount.esm.js";import"../FormControlledAutocomplete/FormControlledAutocomplete.esm.js";import"@material-ui/icons/CheckBox";import"@material-ui/icons/CheckBoxOutlineBlank";import"@material-ui/lab";import"react-hook-form";import"../ListboxVirtualized/ListboxVirtualized.esm.js";import{ControlledAutocomplete as T}from"../FormControlledAutocomplete/ControlledAutocomplete.esm.js";import{LoadingIndicator as x}from"../LoadingIndicator/LoadingIndicator.esm.js";import{GroupHierarchyChip as C}from"./GroupHierarchyChip.esm.js";const S=({filteredGroupOptions:t,setSelectedGroup:s,selectedGroupRef:m})=>{const a=c(()=>t.map(n=>n.ref),[t]),h=c(()=>t.find(n=>n.ref===m)?.ref||null,[t,m]);return r(v,{children:[!d(t)&&t.length>=20&&e(l,{marginBottom:2,children:e(T,{options:a,onChange:s,value:h,autoSelect:!1,getOptionLabel:n=>t.find(f=>f.ref===n)?.name??n,placeholder:"Search groups"})}),!d(t)&&t.length<20&&t.map(({ref:n})=>e(C,{setSelectedGroup:s,groupEntityRef:n},n))]})},H=({groupEntityRef:t,selectedGroup:s,setSelectedGroup:m,groupOptions:a})=>{const{primaryTitle:h,secondaryTitle:n}=R(t),{isLoading:f,data:b}=B(t,{includeParent:!0}),i=b?.[t],y=c(()=>O(i),[i]),g=c(()=>{const u=i?.children??{};return Object.values(u).map(p=>({ref:p.entityRef,type:p.type}))},[i?.children]),G=c(()=>{if(d(g))return[];const u=new Set(g.map(p=>p.ref));return a.filter(p=>u.has(p.ref))},[g,a]),E=c(()=>{if(d(i?.parents))return[];const u=new Set(i?.parents??[]);return a.filter(p=>u.has(p.ref))},[i?.parents,a]);return r(l,{children:[r(l,{marginBottom:1,children:[e(o,{variant:"h6",children:e(w,{entityRef:t})}),e(o,{variant:"caption",children:n})]}),f&&r(l,{textAlign:"center",marginTop:2,marginBottom:2,children:[e(x,{}),e(l,{marginTop:2,children:e(o,{variant:"caption",children:"Loading Group Hierarchy"})})]}),i?.ownedEntityRefs&&r(l,{marginBottom:2,children:[e(o,{variant:"subtitle2",children:"Entity Ownership"}),r(o,{variant:"body2",children:[r("strong",{children:[h," directly owns:"]})," ",i.ownedEntityRefs.length," ",i.ownedEntityRefs.length===0?"Entity":"Entities"]}),r(o,{variant:"body2",children:[r("strong",{children:[h," and it's subgroups own:"]})," ",y," ",y===0?"Entity":"Entities"]})]}),!f&&r(v,{children:[r(l,{marginBottom:2,children:[e(o,{variant:"subtitle2",children:"Select Child Group"}),d(G)&&e(o,{variant:"body2",children:"No child groups"}),e(S,{filteredGroupOptions:G,setSelectedGroup:m,selectedGroupRef:s})]}),r(l,{marginBottom:2,children:[e(o,{variant:"subtitle2",children:"Select Parent Group"}),d(E)&&e(o,{variant:"body2",children:"No parent groups"}),e(S,{filteredGroupOptions:E,setSelectedGroup:m,selectedGroupRef:s})]})]})]})};export{H as GroupHierarchyGroupInfo};
2
- //# sourceMappingURL=GroupHierarchyGroupInfo.esm.js.map
@@ -1,2 +0,0 @@
1
- import{jsxs as m,Fragment as d,jsx as t}from"react/jsx-runtime";import{Button as G}from"@backstage/ui";import{RiFilter3Line as f}from"@remixicon/react";import{useState as l,useCallback as s}from"react";import{usePreviousSelectedGroups as y}from"../GroupSelectorBUI/usePreviousSelectedGroups.esm.js";import{GroupHierarchySelectorDialog as S}from"./GroupHierarchySelectorDialog.esm.js";const h=({currentSelectedGroup:r,applyGroup:i})=>{const[n,e]=l(!1),[o,p]=l(""),{groupEntityRefs:u}=y(),c=s(()=>{r&&p(r),e(!0)},[r]),a=s(()=>{i(o),e(!1)},[i,o]);return m(d,{children:[t(G,{variant:"secondary",size:"small",iconStart:t(f,{}),onClick:c,children:"Group"}),t(S,{open:n,handleClose:()=>e(!1),handleApply:a,previousGroupEntityRefs:u,selectedGroup:o,setSelectedGroup:p})]})};export{h as GroupHierarchySelector};
2
- //# sourceMappingURL=GroupHierarchySelector.esm.js.map
@@ -1,2 +0,0 @@
1
- import{jsx as e,jsxs as i,Fragment as L}from"react/jsx-runtime";import{makeStyles as k,Slide as A,Dialog as E,DialogTitle as j,Box as o,IconButton as H,DialogContent as I,Typography as n,Switch as O,Divider as z,DialogActions as N,Button as b}from"@material-ui/core";import w from"@material-ui/icons/Close";import{uniq as M,isEmpty as f}from"lodash";import{forwardRef as W,useMemo as y}from"react";import P from"react-use/lib/useLocalStorage";import{useGroupOptions as q}from"../../hooks/groups/useGroupOptions.esm.js";import{useGroupTypeHierarchy as F}from"../../hooks/heirarchy/useGroupTypeHierarchy.esm.js";import"../FormControlledAutocomplete/FormControlledAutocomplete.esm.js";import"@material-ui/icons/CheckBox";import"@material-ui/icons/CheckBoxOutlineBlank";import"@material-ui/lab";import"react-hook-form";import"../ListboxVirtualized/ListboxVirtualized.esm.js";import{ControlledAutocomplete as K}from"../FormControlledAutocomplete/ControlledAutocomplete.esm.js";import{LoadingIndicator as Q}from"../LoadingIndicator/LoadingIndicator.esm.js";import{GroupHierarchyCategorySelection as U}from"./GroupHierarchyCategorySelection.esm.js";import{GroupHierarchyChip as G}from"./GroupHierarchyChip.esm.js";import{GroupHierarchyGroupInfo as $}from"./GroupHierarchyGroupInfo.esm.js";const J=k(l=>({dialogToolbar:{justifyContent:"flex-start"},dialogToolbarButton:{margin:l.spacing(.5,1,.5,0)},divider:{marginTop:l.spacing(2),marginBottom:l.spacing(2)}})),V=W((l,s)=>e(A,{direction:"up",ref:s,...l})),X=({open:l,handleClose:s,handleApply:C,previousGroupEntityRefs:m,selectedGroup:t,setSelectedGroup:c})=>{const u=J(),[p,x]=P("advanced-group-selector",!1),{isLoading:v,options:a}=q(),{isLoading:T,data:g}=F(),B=y(()=>{if(!g)return[];const r=[],d=h=>{r.push(h.type);for(const D of Object.values(h.children))d(D)};for(const h of Object.values(g))d(h);return M(r)},[g]),S=y(()=>a.filter(r=>r.key==="My Groups").map(r=>r.ref),[a]),R=y(()=>a.map(r=>r.ref),[a]);return i(E,{maxWidth:"md",open:l,onClose:(r,d)=>d==="escapeKeyDown"&&s(),TransitionComponent:V,children:[e(j,{children:i(o,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[e(o,{display:"flex",alignItems:"center",children:e(o,{children:"Group Selection"})}),e(o,{children:e(H,{onClick:s,size:"small",children:e(w,{fontSize:"small"})})})]})}),e(I,{dividers:!0,children:i(o,{display:"flex",children:[i(o,{minWidth:320,maxWidth:480,flex:1,children:[i(o,{marginBottom:2,children:[e(n,{variant:"h6",children:"Search All Groups"}),e(n,{variant:"subtitle2",children:"Selected Group"}),e(K,{options:R,isLoading:v,value:t,autoSelect:!1,getOptionLabel:r=>a.find(d=>d.ref===r)?.name??r,onChange:c,placeholder:"No group selected"}),i(o,{marginTop:1,display:"flex",alignItems:"center",children:[e(n,{variant:"caption",component:"div",children:"Advanced Selector"}),e(O,{onClick:()=>x(!p),checked:p,size:"small","aria-label":"toggle advanced"})]})]}),e(z,{className:u.divider}),(!t||!p)&&!f(m)&&i(o,{marginBottom:2,children:[e(n,{variant:"subtitle2",children:"Previously Selected Groups"}),e(o,{marginTop:1,children:m.map(r=>e(G,{groupEntityRef:r,selectedGroupRef:t,setSelectedGroup:c},r))})]}),(!t||!p)&&!f(S)&&i(o,{marginBottom:2,children:[e(n,{variant:"subtitle2",children:"My Groups"}),e(o,{marginTop:1,children:S.map(r=>e(G,{groupEntityRef:r,selectedGroupRef:t,setSelectedGroup:c},r))})]}),p&&t&&e(o,{marginTop:2,children:e($,{groupEntityRef:t,selectedGroup:t,setSelectedGroup:c,groupOptions:a})})]}),p&&i(o,{marginLeft:3,flex:1,children:[t&&!f(m)&&e(L,{children:i(o,{marginBottom:2,children:[e(n,{variant:"subtitle2",children:"Previously Selected Groups"}),e(o,{marginTop:1,children:m.map(r=>e(G,{groupEntityRef:r,selectedGroupRef:t,setSelectedGroup:c},r))})]})}),T&&i(o,{marginTop:4,marginBottom:2,children:[e(Q,{}),e(o,{marginTop:2,marginBottom:2,textAlign:"center",children:e(n,{variant:"caption",children:"Loading Hierarchy Data"})})]}),!T&&i(o,{children:[e(n,{variant:"h6",children:"Search By Group Type"}),B.map(r=>e(U,{groupType:r,selectedGroupEntityRef:t,selectGroup:c,allOptions:a,isLoading:v},r))]})]})]})}),e(N,{className:u.dialogToolbar,children:i(o,{marginLeft:2,children:[e(b,{size:"small",onClick:C,variant:"contained",color:"primary",className:u.dialogToolbarButton,disabled:!t,children:"Apply"}),e(b,{className:u.dialogToolbarButton,size:"small",onClick:s,color:"primary",children:"Cancel"})]})})]})};export{X as GroupHierarchySelectorDialog};
2
- //# sourceMappingURL=GroupHierarchySelectorDialog.esm.js.map
@@ -1,2 +0,0 @@
1
- import{jsxs as l,jsx as e}from"react/jsx-runtime";import{makeStyles as u,useTheme as b,Box as n,Typography as s}from"@material-ui/core";const y=u({container:{display:"flex",flexDirection:"column",alignItems:"center",minHeight:0},gradientBox:{borderRadius:4,margin:0,minHeight:0,width:"100%",flex:1},captionTop:{marginBottom:4},captionBottom:{marginTop:4}}),v=({interpolator:h,minLabel:d="0%",maxLabel:c="100%",width:r="100%",height:p="100%",steps:m=40,orientation:t="vertical",markerValue:o})=>{const i=y(),a=b(),g=Array.from({length:m},(k,f)=>{const z=f/(m-1);return h(z)}),x=t==="horizontal"?`linear-gradient(to right, ${g.join(",")})`:`linear-gradient(to top, ${g.join(",")})`;return l(n,{className:i.container,height:t==="horizontal"?p:void 0,width:t==="horizontal"?r:void 0,style:{flexDirection:t==="horizontal"?"row":"column",width:r,alignItems:t==="horizontal"?"flex-end":"center",position:"relative"},children:[e(s,{variant:"caption",className:i.captionTop,style:{marginRight:t==="horizontal"?8:0,marginBottom:t==="horizontal"?0:4,alignSelf:t==="horizontal"?"flex-end":"center"},children:t==="horizontal"?d:c}),l(n,{style:{position:"relative",width:t==="horizontal"?r:void 0,height:t==="horizontal"?p:void 0,zIndex:1},children:[e(n,{className:i.gradientBox,style:{background:x,width:"100%",height:"100%"}}),t==="horizontal"&&typeof o=="number"&&l(n,{style:{position:"absolute",left:`calc(${o}% - 6px)`,top:0,height:"100%",width:"12px",zIndex:3,pointerEvents:"none",display:"block"},children:[e(n,{style:{position:"absolute",left:"5.5px",top:0,width:"1px",height:"100%",background:a.palette.background.default,margin:0,boxSizing:"border-box",zIndex:1}}),e("svg",{width:"12",height:"12",style:{position:"absolute",left:0,top:"50%",transform:"translateY(-50%)",background:"transparent",pointerEvents:"none",zIndex:2},children:e("circle",{cx:"6",cy:"6",r:"5",fill:h(o/100),stroke:a.palette.background.default,strokeWidth:"1"})}),typeof o=="number"&&e(s,{variant:"caption",style:{position:"absolute",left:"50%",top:"-16px",transform:"translateX(-50%)",color:a.palette.text.secondary,pointerEvents:"none",zIndex:3,fontSize:"0.7rem"},children:`${Math.round(o)}%`})]})]}),e(s,{variant:"caption",className:i.captionBottom,style:{marginLeft:t==="horizontal"?8:0,marginBottom:t==="horizontal"?0:4,alignSelf:t==="horizontal"?"flex-end":"center"},children:t==="horizontal"?c:d})]})};export{v as ColorLegend};
2
- //# sourceMappingURL=ColorLegend.esm.js.map