@spotify/backstage-plugin-soundcheck 0.19.6 → 0.19.8

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 (75) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/alpha.d.ts +21 -21
  3. package/dist/components/CampaignPage/CampaignPageBUI.esm.js +1 -1
  4. package/dist/components/CampaignPage/CampaignStatusHistoryChart.esm.js +1 -1
  5. package/dist/components/CampaignPage/CampaignTechInsightsExplorerPage.esm.js +1 -1
  6. package/dist/components/CampaignsPage/CampaignListPageBUI.esm.js +1 -1
  7. package/dist/components/Cards/CheckStatusCard/CheckStatusCard.esm.js +1 -1
  8. package/dist/components/Cards/DescriptionCard/DescriptionCard.esm.js +1 -1
  9. package/dist/components/Cards/HistoricalCheckStatusCard/HistoricalCheckStatusCard.esm.js +1 -1
  10. package/dist/components/Cards/HistoricalTrackStatusCard/HistoricalTrackStatusCard.esm.js +1 -1
  11. package/dist/components/Cards/TrackStatusCard/TrackStatusCard.esm.js +1 -1
  12. package/dist/components/CheckPage/CheckPageBUI.esm.js +1 -1
  13. package/dist/components/CheckPage/CheckStatusHistoryChartBUI.esm.js +1 -1
  14. package/dist/components/ChecksPage/CheckListPage/CheckListPageDeprecated.esm.js +1 -1
  15. package/dist/components/ChecksPage/ChecksListPageBUI.esm.js +1 -1
  16. package/dist/components/CollectorPage/Configurators/SCM/utils.esm.js +1 -1
  17. package/dist/components/CollectorPage/DependantCheckCard.esm.js +1 -1
  18. package/dist/components/CollectorsPage/IntegrationLogoBUI.esm.js +1 -1
  19. package/dist/components/CollectorsPage/IntegrationsListPageBUI.esm.js +1 -1
  20. package/dist/components/DescriptionCell/DescriptionCell.esm.js +1 -1
  21. package/dist/components/GroupSelectorBUI/GroupSelectorBUI.esm.js +1 -1
  22. package/dist/components/ImportExportPanel/ImportExportPanelBUI.esm.js +1 -1
  23. package/dist/components/LoadingTableSkeleton/LoadingTableSkeleton.esm.js +1 -1
  24. package/dist/components/Menus/SimpleMenu.esm.js +1 -1
  25. package/dist/components/OverviewPage/OverviewPageContent.esm.js +1 -1
  26. package/dist/components/RoutingPage/RoutingPageBUI.esm.js +1 -1
  27. package/dist/components/SoundcheckHeader/SoundcheckHeaderBUI.esm.js +1 -1
  28. package/dist/components/TableRowWithOwner/TableRowWithOwner.esm.js +1 -1
  29. package/dist/components/TechInsights/TechInsightsPageBUI.esm.js +1 -1
  30. package/dist/components/TechInsights/TechInsightsPageDeprecated.esm.js +1 -1
  31. package/dist/components/TechInsights/TechInsightsTableBUI.esm.js +1 -1
  32. package/dist/components/TechInsightsExplorerTable/TechInsightsExplorerTable.esm.js +1 -1
  33. package/dist/components/TrackPage/TrackPageBUI.esm.js +1 -1
  34. package/dist/components/TrackPage/TrackTechInsightsExplorerPage.esm.js +1 -1
  35. package/dist/components/TracksPage/TrackListPage/TrackListPageDeprecated.esm.js +1 -1
  36. package/dist/components/TracksPage/TracksListPageBUI.esm.js +1 -1
  37. package/dist/hooks/useLoadTimeReporting.esm.js +1 -1
  38. package/dist/hooks/useSearchNameOwner.esm.js +2 -0
  39. package/dist/images/integrations-bui/azure-rgb.svg +1 -0
  40. package/dist/images/integrations-bui/azure-wht.svg +1 -0
  41. package/dist/images/integrations-bui/bigquery-rgb.svg +1 -0
  42. package/dist/images/integrations-bui/bigquery-wht.svg +1 -0
  43. package/dist/images/integrations-bui/catalog-rgb.svg +1 -0
  44. package/dist/images/integrations-bui/catalog-wht.svg +1 -0
  45. package/dist/images/integrations-bui/data-registry-rgb.svg +1 -0
  46. package/dist/images/integrations-bui/data-registry-wht.svg +1 -0
  47. package/dist/images/integrations-bui/datadog-rgb.svg +1 -0
  48. package/dist/images/integrations-bui/datadog-wht.svg +1 -0
  49. package/dist/images/integrations-bui/default-logo-rgb.svg +1 -0
  50. package/dist/images/integrations-bui/default-logo-wht.svg +1 -0
  51. package/dist/images/integrations-bui/github-rgb.svg +1 -0
  52. package/dist/images/integrations-bui/github-wht.svg +1 -0
  53. package/dist/images/integrations-bui/gitlab-rgb.svg +1 -0
  54. package/dist/images/integrations-bui/gitlab-wht.svg +1 -0
  55. package/dist/images/integrations-bui/http-rgb.svg +1 -0
  56. package/dist/images/integrations-bui/http-wht.svg +1 -0
  57. package/dist/images/integrations-bui/jira-rgb.svg +1 -0
  58. package/dist/images/integrations-bui/jira-wht.svg +1 -0
  59. package/dist/images/integrations-bui/kubernetes-rgb.svg +1 -0
  60. package/dist/images/integrations-bui/kubernetes-wht.svg +1 -0
  61. package/dist/images/integrations-bui/newrelic-rgb.svg +1 -0
  62. package/dist/images/integrations-bui/newrelic-wht.svg +1 -0
  63. package/dist/images/integrations-bui/pagerduty-rgb.svg +1 -0
  64. package/dist/images/integrations-bui/pagerduty-wht.svg +1 -0
  65. package/dist/images/integrations-bui/scm-rgb.svg +1 -0
  66. package/dist/images/integrations-bui/scm-wht.svg +1 -0
  67. package/dist/images/integrations-bui/sonarqube-rgb.svg +1 -0
  68. package/dist/images/integrations-bui/sonarqube-wht.svg +1 -0
  69. package/dist/images/integrations-bui/soundcheck-rgb.svg +1 -0
  70. package/dist/images/integrations-bui/soundcheck-wht.svg +1 -0
  71. package/dist/images/integrations-bui/techinsights-rgb.svg +1 -0
  72. package/dist/images/integrations-bui/techinsights-wht.svg +1 -0
  73. package/dist/utils/lcpReporting.esm.js +1 -1
  74. package/dist/utils/tracks.esm.js +1 -1
  75. package/package.json +22 -22
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @spotify/backstage-plugin-soundcheck
2
2
 
3
+ ## 0.19.8
4
+
5
+ ### Patch Changes
6
+
7
+ - Fixed search on Tech Insights Explorer BUI pages.
8
+
9
+ ## 0.19.7
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependency `backstage` to `1.45.0`.
14
+ - Updated integrations' logos.
15
+ - Fixed an issue when SCM YAML facts were not displayed in the Integration No-Code UI.
16
+ - Fixed an issue where the number of applicable tracks and campaigns displayed on the Tech Insights status tile did not match the actual number shown in the table below in some cases.
17
+ - Fix routing issue preventing Tech Health page tabs from loading in the new backstage-ui design.
18
+ - Updated dependencies
19
+ - Updated dependencies
20
+ - @spotify/backstage-plugin-core@0.8.12
21
+ - @spotify/backstage-plugin-soundcheck-common@0.19.3
22
+
3
23
  ## 0.19.6
4
24
 
5
25
  ### Patch Changes
package/dist/alpha.d.ts CHANGED
@@ -10,7 +10,7 @@ import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
10
10
  * The Soundcheck plugin for use within Backstage´s new frontend system
11
11
  */
12
12
  declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin<{}, {}, {
13
- "api:soundcheck": _backstage_frontend_plugin_api.ExtensionDefinition<{
13
+ "api:soundcheck": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
14
14
  kind: "api";
15
15
  name: undefined;
16
16
  config: {};
@@ -19,7 +19,7 @@ declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin
19
19
  inputs: {};
20
20
  params: <TApi, TImpl extends TApi, TDeps extends { [name in string]: unknown; }>(params: _backstage_core_plugin_api.ApiFactory<TApi, TImpl, TDeps>) => _backstage_frontend_plugin_api.ExtensionBlueprintParams<_backstage_core_plugin_api.AnyApiFactory>;
21
21
  }>;
22
- "entity-card:soundcheck/card": _backstage_frontend_plugin_api.ExtensionDefinition<{
22
+ "entity-card:soundcheck/card": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
23
23
  kind: "entity-card";
24
24
  name: "card";
25
25
  config: {
@@ -44,7 +44,7 @@ declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin
44
44
  type?: _backstage_plugin_catalog_react_alpha.EntityCardType;
45
45
  };
46
46
  }>;
47
- "entity-content:soundcheck/entity": _backstage_frontend_plugin_api.ExtensionDefinition<{
47
+ "entity-content:soundcheck/entity": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
48
48
  kind: "entity-content";
49
49
  name: "entity";
50
50
  config: {
@@ -81,7 +81,7 @@ declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin
81
81
  filter?: string | _backstage_plugin_catalog_react_alpha.EntityPredicate | ((entity: _backstage_catalog_model.Entity) => boolean);
82
82
  };
83
83
  }>;
84
- "entity-content:soundcheck/group": _backstage_frontend_plugin_api.ExtensionDefinition<{
84
+ "entity-content:soundcheck/group": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
85
85
  kind: "entity-content";
86
86
  name: "group";
87
87
  config: {
@@ -118,7 +118,7 @@ declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin
118
118
  filter?: string | _backstage_plugin_catalog_react_alpha.EntityPredicate | ((entity: _backstage_catalog_model.Entity) => boolean);
119
119
  };
120
120
  }>;
121
- "integration:soundcheck/azure": _backstage_frontend_plugin_api.ExtensionDefinition<{
121
+ "integration:soundcheck/azure": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
122
122
  kind: "integration";
123
123
  name: "azure";
124
124
  config: {};
@@ -134,7 +134,7 @@ declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin
134
134
  routeRef?: _backstage_frontend_plugin_api.RouteRef;
135
135
  };
136
136
  }>;
137
- "integration:soundcheck/bigquery": _backstage_frontend_plugin_api.ExtensionDefinition<{
137
+ "integration:soundcheck/bigquery": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
138
138
  kind: "integration";
139
139
  name: "bigquery";
140
140
  config: {};
@@ -150,7 +150,7 @@ declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin
150
150
  routeRef?: _backstage_frontend_plugin_api.RouteRef;
151
151
  };
152
152
  }>;
153
- "integration:soundcheck/catalog": _backstage_frontend_plugin_api.ExtensionDefinition<{
153
+ "integration:soundcheck/catalog": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
154
154
  kind: "integration";
155
155
  name: "catalog";
156
156
  config: {};
@@ -166,7 +166,7 @@ declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin
166
166
  routeRef?: _backstage_frontend_plugin_api.RouteRef;
167
167
  };
168
168
  }>;
169
- "integration:soundcheck/datadog": _backstage_frontend_plugin_api.ExtensionDefinition<{
169
+ "integration:soundcheck/datadog": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
170
170
  kind: "integration";
171
171
  name: "datadog";
172
172
  config: {};
@@ -182,7 +182,7 @@ declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin
182
182
  routeRef?: _backstage_frontend_plugin_api.RouteRef;
183
183
  };
184
184
  }>;
185
- "integration:soundcheck/data-registry": _backstage_frontend_plugin_api.ExtensionDefinition<{
185
+ "integration:soundcheck/data-registry": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
186
186
  kind: "integration";
187
187
  name: "data-registry";
188
188
  config: {};
@@ -198,7 +198,7 @@ declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin
198
198
  routeRef?: _backstage_frontend_plugin_api.RouteRef;
199
199
  };
200
200
  }>;
201
- "integration:soundcheck/github": _backstage_frontend_plugin_api.ExtensionDefinition<{
201
+ "integration:soundcheck/github": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
202
202
  kind: "integration";
203
203
  name: "github";
204
204
  config: {};
@@ -214,7 +214,7 @@ declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin
214
214
  routeRef?: _backstage_frontend_plugin_api.RouteRef;
215
215
  };
216
216
  }>;
217
- "integration:soundcheck/gitlab": _backstage_frontend_plugin_api.ExtensionDefinition<{
217
+ "integration:soundcheck/gitlab": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
218
218
  kind: "integration";
219
219
  name: "gitlab";
220
220
  config: {};
@@ -230,7 +230,7 @@ declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin
230
230
  routeRef?: _backstage_frontend_plugin_api.RouteRef;
231
231
  };
232
232
  }>;
233
- "integration:soundcheck/http": _backstage_frontend_plugin_api.ExtensionDefinition<{
233
+ "integration:soundcheck/http": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
234
234
  kind: "integration";
235
235
  name: "http";
236
236
  config: {};
@@ -246,7 +246,7 @@ declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin
246
246
  routeRef?: _backstage_frontend_plugin_api.RouteRef;
247
247
  };
248
248
  }>;
249
- "integration:soundcheck/jira": _backstage_frontend_plugin_api.ExtensionDefinition<{
249
+ "integration:soundcheck/jira": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
250
250
  kind: "integration";
251
251
  name: "jira";
252
252
  config: {};
@@ -262,7 +262,7 @@ declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin
262
262
  routeRef?: _backstage_frontend_plugin_api.RouteRef;
263
263
  };
264
264
  }>;
265
- "integration:soundcheck/kubernetes": _backstage_frontend_plugin_api.ExtensionDefinition<{
265
+ "integration:soundcheck/kubernetes": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
266
266
  kind: "integration";
267
267
  name: "kubernetes";
268
268
  config: {};
@@ -278,7 +278,7 @@ declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin
278
278
  routeRef?: _backstage_frontend_plugin_api.RouteRef;
279
279
  };
280
280
  }>;
281
- "integration:soundcheck/newrelic": _backstage_frontend_plugin_api.ExtensionDefinition<{
281
+ "integration:soundcheck/newrelic": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
282
282
  kind: "integration";
283
283
  name: "newrelic";
284
284
  config: {};
@@ -294,7 +294,7 @@ declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin
294
294
  routeRef?: _backstage_frontend_plugin_api.RouteRef;
295
295
  };
296
296
  }>;
297
- "integration:soundcheck/pagerduty": _backstage_frontend_plugin_api.ExtensionDefinition<{
297
+ "integration:soundcheck/pagerduty": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
298
298
  kind: "integration";
299
299
  name: "pagerduty";
300
300
  config: {};
@@ -310,7 +310,7 @@ declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin
310
310
  routeRef?: _backstage_frontend_plugin_api.RouteRef;
311
311
  };
312
312
  }>;
313
- "integration:soundcheck/scm": _backstage_frontend_plugin_api.ExtensionDefinition<{
313
+ "integration:soundcheck/scm": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
314
314
  kind: "integration";
315
315
  name: "scm";
316
316
  config: {};
@@ -326,7 +326,7 @@ declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin
326
326
  routeRef?: _backstage_frontend_plugin_api.RouteRef;
327
327
  };
328
328
  }>;
329
- "integration:soundcheck/sonarqube": _backstage_frontend_plugin_api.ExtensionDefinition<{
329
+ "integration:soundcheck/sonarqube": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
330
330
  kind: "integration";
331
331
  name: "sonarqube";
332
332
  config: {};
@@ -342,7 +342,7 @@ declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin
342
342
  routeRef?: _backstage_frontend_plugin_api.RouteRef;
343
343
  };
344
344
  }>;
345
- "nav-item:soundcheck": _backstage_frontend_plugin_api.ExtensionDefinition<{
345
+ "nav-item:soundcheck": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
346
346
  kind: "nav-item";
347
347
  name: undefined;
348
348
  config: {};
@@ -359,7 +359,7 @@ declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin
359
359
  routeRef: _backstage_frontend_plugin_api.RouteRef<undefined>;
360
360
  };
361
361
  }>;
362
- "page:soundcheck/SoundcheckRoutingPage": _backstage_frontend_plugin_api.ExtensionDefinition<{
362
+ "page:soundcheck/SoundcheckRoutingPage": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
363
363
  config: {
364
364
  title: string | undefined;
365
365
  } & {
@@ -390,7 +390,7 @@ declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin
390
390
  routeRef?: _backstage_frontend_plugin_api.RouteRef;
391
391
  };
392
392
  }>;
393
- "page:soundcheck/overview": _backstage_frontend_plugin_api.ExtensionDefinition<{
393
+ "page:soundcheck/overview": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
394
394
  kind: "page";
395
395
  name: "overview";
396
396
  config: {
@@ -1,2 +1,2 @@
1
- import{jsx as e,jsxs as r,Fragment as G}from"react/jsx-runtime";import{parseEntityRef as Se}from"@backstage/catalog-model";import{useRouteRef as w}from"@backstage/core-plugin-api";import{Container as F,HeaderPage as Ce,Box as c,Flex as _,Text as h,Grid as R}from"@backstage/ui";import{makeStyles as ye}from"@material-ui/core";import{toEntityFilterQuery as be}from"@spotify/backstage-plugin-soundcheck-common";import{isEmpty as ve}from"lodash";import{DateTime as C}from"luxon";import{useState as v,useMemo as I,useEffect as q}from"react";import{useParams as Ie,useSearchParams as Te}from"react-router-dom";import ke from"react-use/lib/useDebounce";import Ee from"react-use/lib/useLocalStorage";import{useCheckStatuses as we}from"../../hooks/aggregations/useCheckStatuses.esm.js";import{useFilters as Fe}from"../../hooks/filters/useFilters.esm.js";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"../../hooks/useSoundcheckAlert.esm.js";import{useGetCampaigns as Re}from"../../hooks/campaigns/useGetCampaigns.esm.js";import"../../hooks/useConfirmationModal.esm.js";import{useCertificationStatus as Le}from"../../hooks/aggregations/useCertificationStatus.esm.js";import{useCertificationStatusHistory as Ne}from"../../hooks/aggregations/useCertificationStatusHistory.esm.js";import{useLCPReporting as Pe}from"../../hooks/useLCPReporting.esm.js";import{useLoadTimeReporting as xe}from"../../hooks/useLoadTimeReporting.esm.js";import{campaignsPageRouteRef as Ae,campaignOverviewRouteRef as De,campaignExplorerRouteRef as Oe}from"../../routes.esm.js";import{DescriptionCard as He}from"../Cards/DescriptionCard/DescriptionCard.esm.js";import{HistoricalTrackStatusCard as Me}from"../Cards/HistoricalTrackStatusCard/HistoricalTrackStatusCard.esm.js";import{TrackStatusCard as Ue}from"../Cards/TrackStatusCard/TrackStatusCard.esm.js";import{ChecksTable as Be}from"../ChecksTable/ChecksTable.esm.js";import{ChipSelector as je}from"../ChipSelector/ChipSelector.esm.js";import{EmptyStateBUI as Ke}from"../EmptyState/EmptyStateBUI.esm.js";import"../FilterSidebar/FilterSidebar.esm.js";import"../FilterSidebar/StateFilter.esm.js";import{useTrackFilterSidebar as Ve}from"../FilterSidebar/useTrackFilterSidebar.esm.js";import{toFilter as Ge,CERTIFICATION_STATUS_MAP as _e}from"../FilterSidebar/util.esm.js";import{LoadingTableSkeleton as qe}from"../LoadingTableSkeleton/LoadingTableSkeleton.esm.js";import{SimpleMenu as Qe}from"../Menus/SimpleMenu.esm.js";import{useCampaignActions as We}from"../Menus/useCampaignActions.esm.js";import{PageCustomActions as Ye}from"../PageCustomActions/PageCustomActions.esm.js";import{SendCampaignNotificationDialogBUI as $e}from"../SendCampaignNotificationDialog/SendCampaignNotificationDialogBUI.esm.js";import{TopFailingChecksTableBUI as ze}from"../TopFailingChecksTable/TopFailingChecksTableBUI.esm.js";import{TrackEntitiesTableBUI as Je}from"../TrackPage/TrackEntitiesTable/TrackEntitiesTableBUI.esm.js";const Xe=ye(()=>({container:{marginBottom:"var(--bui-space-12)"},tableContent:{margin:"var(--bui-space-3) 0 0"},tabPanel:{padding:"var(--bui-space-6) 0 0"},tabs:{margin:"0 0 var(--bui-space-12)"},cards:{margin:"0 0 var(--bui-space-12)",display:"flex",gridGap:"var(--bui-space-4)"}})),f={CHECKS:"Checks",TOP_FAILING_CHECKS:"Top Failing Checks",ENTITIES:"Entities"},Ze=()=>{const{owners:m,lifecycles:l,types:d,systems:p,certificationStatuses:L}=Ve(),{campaignId:o}=Ie(),Q=w(Ae),[s,T]=Te(),[n,W]=v(s.get("search")||""),[N,Y]=v(""),[P,$]=v(new Set([f.CHECKS])),y=P.values().next().value??f.CHECKS;ke(()=>{Y(n);const a=new URLSearchParams(s.toString());n?a.set("search",n):a.delete("search"),T(a,{replace:!0})},300,[n]);const x=I(()=>({routeName:"soundcheck-campaign-insights",additionalAttributes:{campaignId:o||"",filtersApplied:m.length+l.length+d.length+p.length,ownersFilter:m?.join(",")||"",lifecyclesFilter:l?.join(",")||"",typesFilter:d?.join(",")||"",systemsFilter:p?.join(",")||"",campaignsSearch:N||""}}),[o,m,l,d,p,N]),{reportContentLoaded:A}=xe(x),{reporter:z}=Pe(x),g=Xe(),k=I(()=>Ge({lifecycles:l,owners:m,types:d,systems:p}),[l,m,d,p]),{data:J,isLoading:u}=Re({ids:[o],first:1}),t=J?.edges?.[0]?.node,{actions:D,showNotificationDialog:O,setShowNotificationDialog:X}=We(t??void 0),i=t?.track,Z=I(()=>i?.levels.flatMap(a=>a.checks),[i?.levels]),ee=Array.from(new Set(i?.levels.flatMap(a=>a.checks).map(a=>a.id)??[])),{data:H,isLoading:te}=we({trackId:i?.id,checkIds:ee,filter:k},!!i),ie=I(()=>be(i?.filter),[i]),{filters:ae,selected:re,setSelected:oe,onRemoveTag:se,selectedTags:ne}=Fe({entityFilterQuery:ie,hasCertificationStatusFilters:!0}),{data:M,isLoading:U}=Le({trackId:i?.id??"",filter:k},!!t),ce=C.fromISO(t?.startDate),me=Math.max(Math.ceil(C.now().diff(ce,"days").days),1),{data:le}=Ne({trackId:i?.id??"",filter:k,numberOfDays:me},!!t),B=z?.getLCPValue();q(()=>{!u&&!U&&A({lcp:B})},[u,U,A,B]);const[b,j]=v(!1),[S,E]=Ee("campaign-overview-search-params","");q(()=>{!b&&s?.toString()?(S!==s.toString()&&E(s.toString()),j(!0)):!b&&S?(T(new URLSearchParams(S)),j(!0)):b&&S!==s.toString()&&E(s.toString())},[s,T,E,S,b]);const de=w(De),pe=w(Oe);if(u)return e(F,{className:g.container,children:e(qe,{})});if(!u&&!t)return e(F,{className:g.container,children:e(Ke,{title:"Campaign not found",body:`There is no campaign with the requested id: ${o}.`})});const K=t?.ownerEntityRef,he=K?Se(K).name:void 0,fe=C.fromISO(t?.startDate),V=C.fromISO(t?.targetCompletionDate),ge=C.now(),ue=Math.max(Math.ceil(V.diff(ge,"days").days),0);return r(G,{children:[e(Ce,{title:t?.name,customActions:e(Qe,{disabled:!D.length,placement:"left top",menuActions:D,label:"Campaign Actions"}),breadcrumbs:[{label:"Campaigns",href:Q()}],tabs:[{id:"overview",label:"Campaign Overview",href:o?de({campaignId:o}):""},{id:"explorer",label:"Tech Insights Explorer",href:o?pe({campaignId:o}):""}]}),r(F,{className:g.container,children:[r(c,{className:g.cards,children:[e(He,{description:t?.description??void 0,owner:he}),e(Ue,{track:i??void 0,status:M,isCampaign:!0,children:r(G,{children:[r(_,{align:"baseline",mt:"3",children:[e(h,{as:"h1",variant:"title-medium",weight:"bold",children:ue}),e(h,{variant:"body-small",children:"Days remaining"})]}),r(R.Root,{children:[r(R.Item,{children:[e(c,{children:e(h,{color:"secondary",variant:"body-small",children:"Start date"})}),e(c,{children:e(h,{variant:"body-small",children:fe.toLocaleString({month:"short",day:"numeric",year:"numeric"})})})]}),r(R.Item,{children:[e(c,{children:e(h,{color:"secondary",variant:"body-small",children:"End date"})}),e(c,{children:e(h,{variant:"body-small",children:V.toLocaleString({month:"short",day:"numeric",year:"numeric"})})})]})]})]})}),e(Me,{track:t?.track,history:le,isCampaign:!0})]}),i&&r(c,{children:[r(_,{justify:"between",children:[e(c,{minWidth:"16rem",children:e(je,{options:["Checks","Top Failing Checks","Entities"],selected:P,ariaLabel:"Sections",onSelectionChange:$})}),e(Ye,{searchValue:n,setSearchValue:a=>W(a),filters:ae,selected:re,setSelected:oe,onRemoveTag:se,selectedTags:ne,showSearch:y!==f.ENTITIES})]}),r(c,{className:g.tableContent,children:[y===f.CHECKS&&e(Be,{trackId:i.id,checks:Z,checkStatuses:H,isLoading:u||te,searchValue:n}),y===f.TOP_FAILING_CHECKS&&e(ze,{track:i,checkStatuses:H,certificationStatus:M?.certificationStatus,searchValue:n}),y===f.ENTITIES&&e(Je,{isCampaign:!0,track:i,lifecycles:l,owners:m,types:d,systems:p,certificationStatus:ve(L)?void 0:_e[L[0]],searchValue:n})]})]}),t&&O&&e($e,{campaign:t,isOpen:O,handleClose:()=>X(!1)})]})]})};export{Ze as CampaignPageBUI};
1
+ import{jsx as e,jsxs as a,Fragment as G}from"react/jsx-runtime";import{parseEntityRef as Ee}from"@backstage/catalog-model";import{useRouteRef as F}from"@backstage/core-plugin-api";import{usePermission as we}from"@backstage/plugin-permission-react";import{Container as v,HeaderPage as Re,Box as c,Flex as $,Text as g,Grid as N}from"@backstage/ui";import{makeStyles as Le}from"@material-ui/core";import{toEntityFilterQuery as Fe,soundcheckCampaignReadPermission as Ne}from"@spotify/backstage-plugin-soundcheck-common";import{isEmpty as Pe}from"lodash";import{DateTime as C}from"luxon";import{useState as I,useMemo as T,useEffect as q}from"react";import{useParams as xe,useSearchParams as Ae}from"react-router-dom";import De from"react-use/lib/useDebounce";import Oe from"react-use/lib/useLocalStorage";import{useCheckStatuses as He}from"../../hooks/aggregations/useCheckStatuses.esm.js";import{useFilters as Me}from"../../hooks/filters/useFilters.esm.js";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"../../hooks/useSoundcheckAlert.esm.js";import{useGetCampaigns as Ue}from"../../hooks/campaigns/useGetCampaigns.esm.js";import"../../hooks/useConfirmationModal.esm.js";import{useCertificationStatus as Be}from"../../hooks/aggregations/useCertificationStatus.esm.js";import{useCertificationStatusHistory as je}from"../../hooks/aggregations/useCertificationStatusHistory.esm.js";import{useLCPReporting as Ke}from"../../hooks/useLCPReporting.esm.js";import{useLoadTimeReporting as Ve}from"../../hooks/useLoadTimeReporting.esm.js";import{campaignsPageRouteRef as _e,campaignOverviewRouteRef as Ge,campaignExplorerRouteRef as $e}from"../../routes.esm.js";import{DescriptionCard as qe}from"../Cards/DescriptionCard/DescriptionCard.esm.js";import{HistoricalTrackStatusCard as Qe}from"../Cards/HistoricalTrackStatusCard/HistoricalTrackStatusCard.esm.js";import{TrackStatusCard as We}from"../Cards/TrackStatusCard/TrackStatusCard.esm.js";import{ChecksTable as ze}from"../ChecksTable/ChecksTable.esm.js";import{ChipSelector as Je}from"../ChipSelector/ChipSelector.esm.js";import{EmptyStateBUI as Q}from"../EmptyState/EmptyStateBUI.esm.js";import"../FilterSidebar/FilterSidebar.esm.js";import"../FilterSidebar/StateFilter.esm.js";import{useTrackFilterSidebar as Xe}from"../FilterSidebar/useTrackFilterSidebar.esm.js";import{toFilter as Ye,CERTIFICATION_STATUS_MAP as Ze}from"../FilterSidebar/util.esm.js";import{LoadingTableSkeleton as ei}from"../LoadingTableSkeleton/LoadingTableSkeleton.esm.js";import{SimpleMenu as ii}from"../Menus/SimpleMenu.esm.js";import{useCampaignActions as ti}from"../Menus/useCampaignActions.esm.js";import{PageCustomActions as ri}from"../PageCustomActions/PageCustomActions.esm.js";import{SendCampaignNotificationDialogBUI as ai}from"../SendCampaignNotificationDialog/SendCampaignNotificationDialogBUI.esm.js";import{TopFailingChecksTableBUI as oi}from"../TopFailingChecksTable/TopFailingChecksTableBUI.esm.js";import{TrackEntitiesTableBUI as si}from"../TrackPage/TrackEntitiesTable/TrackEntitiesTableBUI.esm.js";const ni=Le(()=>({container:{marginBottom:"var(--bui-space-12)"},tableContent:{margin:"var(--bui-space-3) 0 0"},tabPanel:{padding:"var(--bui-space-6) 0 0"},tabs:{margin:"0 0 var(--bui-space-12)"},cards:{margin:"0 0 var(--bui-space-12)",display:"flex",gridGap:"var(--bui-space-4)"}})),u={CHECKS:"Checks",TOP_FAILING_CHECKS:"Top Failing Checks",ENTITIES:"Entities"},ci=()=>{const{owners:m,lifecycles:l,types:d,systems:p,certificationStatuses:P}=Xe(),{campaignId:o}=xe(),W=F(_e),[s,k]=Ae(),[n,z]=I(s.get("search")||""),[x,J]=I(""),[A,X]=I(new Set([u.CHECKS])),y=A.values().next().value??u.CHECKS;De(()=>{J(n);const r=new URLSearchParams(s.toString());n?r.set("search",n):r.delete("search"),k(r,{replace:!0})},300,[n]);const D=T(()=>({routeName:"soundcheck-campaign-insights",additionalAttributes:{campaignId:o||"",filtersApplied:m.length+l.length+d.length+p.length,ownersFilter:m?.join(",")||"",lifecyclesFilter:l?.join(",")||"",typesFilter:d?.join(",")||"",systemsFilter:p?.join(",")||"",campaignsSearch:x||""}}),[o,m,l,d,p,x]),{reportContentLoaded:O}=Ve(D),{reporter:Y}=Ke(D),h=ni(),E=T(()=>Ye({lifecycles:l,owners:m,types:d,systems:p}),[l,m,d,p]),{data:Z,isLoading:f,isError:ee}=Ue({ids:[o],first:1}),i=Z?.edges?.[0]?.node,{actions:H,showNotificationDialog:M,setShowNotificationDialog:ie}=ti(i??void 0),t=i?.track,te=T(()=>t?.levels.flatMap(r=>r.checks),[t?.levels]),re=Array.from(new Set(t?.levels.flatMap(r=>r.checks).map(r=>r.id)??[])),{data:U,isLoading:ae}=He({trackId:t?.id,checkIds:re,filter:E},!!t),oe=T(()=>Fe(t?.filter),[t]),{filters:se,selected:ne,setSelected:ce,onRemoveTag:me,selectedTags:le}=Me({entityFilterQuery:oe,hasCertificationStatusFilters:!0}),{data:B,isLoading:w,isError:de}=Be({trackId:t?.id??"",filter:E},!!i),pe=C.fromISO(i?.startDate),he=Math.max(Math.ceil(C.now().diff(pe,"days").days),1),{data:fe,isLoading:ge,isError:ue}=je({trackId:t?.id??"",filter:E,numberOfDays:he},!!i),R=ee||de||ue,{loading:Se,allowed:Ce}=we({permission:Ne,resourceRef:o}),j=Y?.getLCPValue();q(()=>{!f&&!w&&O({lcp:j})},[f,w,O,j]);const[b,K]=I(!1),[S,L]=Oe("campaign-overview-search-params","");q(()=>{!b&&s?.toString()?(S!==s.toString()&&L(s.toString()),K(!0)):!b&&S?(k(new URLSearchParams(S)),K(!0)):b&&S!==s.toString()&&L(s.toString())},[s,k,L,S,b]);const ye=F(Ge),be=F($e);if(f)return e(v,{className:h.container,children:e(ei,{})});if(!f&&!i)return e(v,{className:h.container,children:e(Q,{title:"Campaign not found",body:`There is no campaign with the requested id: ${o}.`})});if(!Se&&!Ce)return e(v,{className:h.container,children:e(Q,{title:"Cannot view campaign",body:`No permission to view campaign with the requested id: ${o}.`})});const V=i?.ownerEntityRef,ve=V?Ee(V).name:void 0,Ie=C.fromISO(i?.startDate),_=C.fromISO(i?.targetCompletionDate),Te=C.now(),ke=Math.max(Math.ceil(_.diff(Te,"days").days),0);return a(G,{children:[e(Re,{title:i?.name,customActions:e(ii,{disabled:!H.length,placement:"left top",menuActions:H,label:"Campaign Actions"}),breadcrumbs:[{label:"Campaigns",href:W()}],tabs:[{id:"overview",label:"Campaign Overview",href:o?ye({campaignId:o}):""},{id:"explorer",label:"Tech Insights Explorer",href:o?be({campaignId:o}):""}]}),a(v,{className:h.container,children:[a(c,{className:h.cards,children:[e(qe,{description:i?.description??void 0,owner:ve,isError:R,isLoading:f}),e(We,{track:t??void 0,status:B,isError:R,isLoading:w,isCampaign:!0,children:a(G,{children:[a($,{align:"baseline",mt:"3",children:[e(g,{as:"h1",variant:"title-medium",weight:"bold",children:ke}),e(g,{variant:"body-small",children:"Days remaining"})]}),a(N.Root,{children:[a(N.Item,{children:[e(c,{children:e(g,{color:"secondary",variant:"body-small",children:"Start date"})}),e(c,{children:e(g,{variant:"body-small",children:Ie.toLocaleString({month:"short",day:"numeric",year:"numeric"})})})]}),a(N.Item,{children:[e(c,{children:e(g,{color:"secondary",variant:"body-small",children:"End date"})}),e(c,{children:e(g,{variant:"body-small",children:_.toLocaleString({month:"short",day:"numeric",year:"numeric"})})})]})]})]})}),e(Qe,{track:i?.track,history:fe,isCampaign:!0,isError:R,isLoading:ge})]}),t&&a(c,{children:[a($,{justify:"between",children:[e(c,{minWidth:"16rem",children:e(Je,{options:["Checks","Top Failing Checks","Entities"],selected:A,ariaLabel:"Sections",onSelectionChange:X})}),e(ri,{searchValue:n,setSearchValue:r=>z(r),filters:se,selected:ne,setSelected:ce,onRemoveTag:me,selectedTags:le,showSearch:y!==u.ENTITIES})]}),a(c,{className:h.tableContent,children:[y===u.CHECKS&&e(ze,{trackId:t.id,checks:te,checkStatuses:U,isLoading:f||ae,searchValue:n}),y===u.TOP_FAILING_CHECKS&&e(oi,{track:t,checkStatuses:U,certificationStatus:B?.certificationStatus,searchValue:n}),y===u.ENTITIES&&e(si,{isCampaign:!0,track:t,lifecycles:l,owners:m,types:d,systems:p,certificationStatus:Pe(P)?void 0:Ze[P[0]],searchValue:n})]})]}),i&&M&&e(ai,{campaign:i,isOpen:M,handleClose:()=>ie(!1)})]})]})};export{ci as CampaignPageBUI};
2
2
  //# sourceMappingURL=CampaignPageBUI.esm.js.map
@@ -1,2 +1,2 @@
1
- import{jsx as o}from"react/jsx-runtime";import{Box as a}from"@backstage/ui";import{makeStyles as m}from"@material-ui/core/styles";import{useMemo as n}from"react";import{ResponsiveContainer as p}from"recharts";import{AreaChart as c}from"../AreaChart/AreaChart.esm.js";import"../EmptyState/EmptyState.esm.js";import{EmptyStateBUI as d}from"../EmptyState/EmptyStateBUI.esm.js";import"@backstage/core-plugin-api";import"@backstage/plugin-permission-react";import"@remixicon/react";import"@spotify/backstage-plugin-soundcheck-common";import"react-router-dom";import"../../routes.esm.js";const f=m(()=>({container:{height:190,overflow:"hidden"}}));function l({history:r}){const s=f(),i=r?.certificationStatusHistory.numberOfEntities??0,e=n(()=>i>0?r?.certificationStatusHistory.history.map(t=>({date:t.date,Passed:Math.round(t.statusByLevel[0].passed/i*100)})):[],[i,r]);if(!e?.length){const t=i>0?"No Historical Data":"No Applicable Entities";return o(a,{children:o(d,{title:t,body:`${t} for this campaign.`})})}return o(a,{className:s.container,children:o(p,{debounce:1,children:o(c,{data:e,categories:["Passed"],categoryColors:{Passed:"var(--bui-fg-success)"},index:"date",minValue:0,maxValue:100,showLegend:!1})})})}export{l as CampaignStatusHistoryChart};
1
+ import{jsx as o}from"react/jsx-runtime";import{Box as a}from"@backstage/ui";import{makeStyles as m}from"@material-ui/core/styles";import{useMemo as n}from"react";import{ResponsiveContainer as p}from"recharts";import{AreaChart as c}from"../AreaChart/AreaChart.esm.js";import"../EmptyState/EmptyState.esm.js";import{EmptyStateBUI as d}from"../EmptyState/EmptyStateBUI.esm.js";import"@backstage/core-plugin-api";import"@backstage/plugin-permission-react";import"@remixicon/react";import"@spotify/backstage-plugin-soundcheck-common";import"react-router-dom";import"../../routes.esm.js";const f=m(()=>({container:{height:180,overflow:"hidden"}}));function l({history:r}){const s=f(),i=r?.certificationStatusHistory.numberOfEntities??0,e=n(()=>i>0?r?.certificationStatusHistory.history.map(t=>({date:t.date,Passed:Math.round(t.statusByLevel[0].passed/i*100)})):[],[i,r]);if(!e?.length){const t=i>0?"No Historical Data":"No Applicable Entities";return o(a,{children:o(d,{title:t,body:`${t} for this campaign.`})})}return o(a,{className:s.container,children:o(p,{debounce:1,children:o(c,{data:e,categories:["Passed"],categoryColors:{Passed:"var(--bui-fg-success)"},index:"date",minValue:0,maxValue:100,showLegend:!1})})})}export{l as CampaignStatusHistoryChart};
2
2
  //# sourceMappingURL=CampaignStatusHistoryChart.esm.js.map
@@ -1,2 +1,2 @@
1
- import{jsx as e,jsxs as c,Fragment as q}from"react/jsx-runtime";import{useRouteRef as S,useApi as $}from"@backstage/core-plugin-api";import{entityPresentationApiRef as z}from"@backstage/plugin-catalog-react";import{Container as C,HeaderPage as J,Box as I,Flex as K,SearchField as Q}from"@backstage/ui";import{makeStyles as W}from"@material-ui/core";import{useState as F,useMemo as R,useEffect as X}from"react";import{useParams as Y,useSearchParams as Z}from"react-router-dom";import _ from"react-use/lib/useDebounce";import{useGroupHierarchy as ee}from"../../hooks/heirarchy/useGroupHierarchy.esm.js";import{useHierarchicalTrackStatus as ie}from"../../hooks/heirarchy/useHierarchicalTrackStatus.esm.js";import"@backstage/catalog-model";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import"@spotify/backstage-plugin-soundcheck-common";import"../../hooks/useSoundcheckAlert.esm.js";import{useGetCampaigns as re}from"../../hooks/campaigns/useGetCampaigns.esm.js";import{useGetAllTracks as te}from"../../hooks/tracks/useGetAllTracks.esm.js";import"../../hooks/useConfirmationModal.esm.js";import"react-use/lib/useLocalStorage";import{useLCPReporting as ae}from"../../hooks/useLCPReporting.esm.js";import{useLoadTimeReporting as oe}from"../../hooks/useLoadTimeReporting.esm.js";import{campaignsPageRouteRef as ne,campaignOverviewRouteRef as me,campaignExplorerRouteRef as se}from"../../routes.esm.js";import{EmptyStateBUI as pe}from"../EmptyState/EmptyStateBUI.esm.js";import"../FilterSidebar/FilterSidebar.esm.js";import"../FilterSidebar/StateFilter.esm.js";import{useTrackFilterSidebar as ce}from"../FilterSidebar/useTrackFilterSidebar.esm.js";import"../FilterSidebar/util.esm.js";import{hierarchyToNivo as le}from"../HierarchicalTechInsightsPage/visualizations/hierarchyToNivo.esm.js";import{LoadingTableSkeleton as de}from"../LoadingTableSkeleton/LoadingTableSkeleton.esm.js";import{SimpleMenu as ge}from"../Menus/SimpleMenu.esm.js";import{useCampaignActions as fe}from"../Menus/useCampaignActions.esm.js";import{SendCampaignNotificationDialogBUI as he}from"../SendCampaignNotificationDialog/SendCampaignNotificationDialogBUI.esm.js";import{TechInsightsExplorerTable as ue}from"../TechInsightsExplorerTable/TechInsightsExplorerTable.esm.js";import{TechInsightsGroupSelector as be}from"../TechInsightsGroupSelector/TechInsightsGroupSelector.esm.js";import{TopAndBottomPerformingTeams as ve}from"../TopAndBottomPerformingTeams/TopAndBottomPerformingTeams.esm.js";const Se=W(()=>({container:{marginBottom:"var(--bui-space-12)"},teams:{margin:"0 0 var(--bui-space-12)"},tableContent:{margin:"var(--bui-space-3) 0 0"},filters:{width:"25rem",marginLeft:"auto"}})),Ce=()=>{const a=Se(),{owners:l,lifecycles:d,types:g,systems:f}=ce(),{campaignId:i}=Y(),[h,E]=Z(),[n,j]=F(h.get("search")||""),t=h.get("group"),[T,B]=F(""),G=S(ne);_(()=>{B(n);const r=new URLSearchParams(h.toString());n?r.set("search",n):r.delete("search"),E(r,{replace:!0})},300,[n]);const y=R(()=>({routeName:"soundcheck-campaign-insights",additionalAttributes:{campaignId:i||"",filtersApplied:l.length+d.length+g.length+f.length,ownersFilter:l?.join(",")||"",lifecyclesFilter:d?.join(",")||"",typesFilter:g?.join(",")||"",systemsFilter:f?.join(",")||"",campaignsSearch:T||""}}),[i,l,d,g,f,T]),{reportContentLoaded:k}=oe(y),{reporter:D}=ae(y),{data:H,isLoading:s}=re({ids:[i],first:1}),m=H?.edges?.[0]?.node,{actions:w,showNotificationDialog:L,setShowNotificationDialog:O}=fe(m??void 0),o=m?.track,N=$(z),{data:x}=te({}),u=R(()=>x?.edges.find(r=>r.node.id===o?.id)?.node,[x?.edges,o?.id]),{data:A,isLoading:b}=ee(t||void 0,{enabled:!!t&&!!o?.id&&!!u,ownedEntitiesFilter:u?.filter??void 0}),{data:v,isLoading:p}=ie({trackId:o?.id??"",groupRef:t??"",skip:!o?.id}),U=R(()=>{if(!t)return;const r=A?.[t];return r?le(r,v||null,()=>"var(--bui-fg-primary)",N,void 0):void 0},[A,N,t,v]),P=D?.getLCPValue();X(()=>{!s&&!b&&!p&&k({lcp:P})},[s,b,p,k,P]);const M=S(me),V=S(se);return s?e(C,{className:a.container,children:e(de,{})}):!s&&!m?e(C,{className:a.container,children:e(pe,{title:"Campaign not found",body:`There is no campaign with the requested id: ${i}.`})}):c(q,{children:[e(J,{title:o?.name,customActions:e(ge,{disabled:!w.length,placement:"left top",menuActions:w,label:"Campaign Actions"}),breadcrumbs:[{label:"Campaigns",href:G()}],tabs:[{id:"overview",label:"Campaign Overview",href:i?M({campaignId:i}):""},{id:"explorer",label:"Tech Insights Explorer",href:i?V({campaignId:i}):""}]}),c(C,{className:a.container,children:[e(I,{className:a.teams,children:e(ve,{trackStatus:v??void 0,isLoading:p,campaignId:i})}),c(I,{children:[c(K,{align:"center",gap:"3",className:a.filters,children:[e(be,{}),e(Q,{value:n,onChange:j,"aria-label":"Search",placeholder:"Search"})]}),e(I,{className:a.tableContent,children:e(ue,{tableData:U,isLoading:b||p,selectedGroup:t??void 0,trackId:u?.id,campaignId:i})})]}),m&&L&&e(he,{campaign:m,isOpen:L,handleClose:()=>O(!1)})]})]})};export{Ce as CampaignTechInsightsExplorerPage};
1
+ import{jsx as e,jsxs as p,Fragment as j}from"react/jsx-runtime";import{useRouteRef as b,useApi as M}from"@backstage/core-plugin-api";import{entityPresentationApiRef as $}from"@backstage/plugin-catalog-react";import{usePermission as z}from"@backstage/plugin-permission-react";import{Container as d,HeaderPage as J,Box as v,Flex as K,SearchField as Q}from"@backstage/ui";import{makeStyles as W}from"@material-ui/core";import{soundcheckCampaignReadPermission as X}from"@spotify/backstage-plugin-soundcheck-common";import{useState as k,useMemo as C,useEffect as Y}from"react";import{useParams as Z,useSearchParams as _}from"react-router-dom";import ee from"react-use/lib/useDebounce";import{useGroupHierarchy as ie}from"../../hooks/heirarchy/useGroupHierarchy.esm.js";import{useHierarchicalTrackStatus as re}from"../../hooks/heirarchy/useHierarchicalTrackStatus.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 ae}from"../../hooks/campaigns/useGetCampaigns.esm.js";import{useGetAllTracks as oe}from"../../hooks/tracks/useGetAllTracks.esm.js";import"../../hooks/useConfirmationModal.esm.js";import"react-use/lib/useLocalStorage";import{useLCPReporting as te}from"../../hooks/useLCPReporting.esm.js";import{useLoadTimeReporting as ne}from"../../hooks/useLoadTimeReporting.esm.js";import{campaignsPageRouteRef as me,campaignOverviewRouteRef as se,campaignExplorerRouteRef as ce}from"../../routes.esm.js";import{EmptyStateBUI as x}from"../EmptyState/EmptyStateBUI.esm.js";import{hierarchyToNivo as pe}from"../HierarchicalTechInsightsPage/visualizations/hierarchyToNivo.esm.js";import{LoadingTableSkeleton as de}from"../LoadingTableSkeleton/LoadingTableSkeleton.esm.js";import{SimpleMenu as le}from"../Menus/SimpleMenu.esm.js";import{useCampaignActions as ge}from"../Menus/useCampaignActions.esm.js";import{SendCampaignNotificationDialogBUI as fe}from"../SendCampaignNotificationDialog/SendCampaignNotificationDialogBUI.esm.js";import{TechInsightsExplorerTable as ue}from"../TechInsightsExplorerTable/TechInsightsExplorerTable.esm.js";import{TechInsightsGroupSelector as he}from"../TechInsightsGroupSelector/TechInsightsGroupSelector.esm.js";import{TopAndBottomPerformingTeams as be}from"../TopAndBottomPerformingTeams/TopAndBottomPerformingTeams.esm.js";const ve=W(()=>({container:{marginBottom:"var(--bui-space-12)"},teams:{margin:"0 0 var(--bui-space-12)"},tableContent:{margin:"var(--bui-space-3) 0 0"},filters:{width:"25rem",marginLeft:"auto"}})),Ce=()=>{const o=ve(),{campaignId:i}=Z(),[l,A]=_(),[n,y]=k(l.get("search")||""),r=l.get("group"),[g,E]=k(""),B=b(me);ee(()=>{E(n);const a=new URLSearchParams(l.toString());n?a.set("search",n):a.delete("search"),A(a,{replace:!0})},300,[n]);const S=C(()=>({routeName:"soundcheck-tech-insights-explorer",additionalAttributes:{campaignId:i||"",group:r||"",groupsSearch:g||""}}),[i,r,g]),{reportContentLoaded:R}=ne(S),{reporter:G}=te(S),{data:D,isLoading:s}=ae({ids:[i],first:1}),t=D?.edges?.[0]?.node,{actions:w,showNotificationDialog:I,setShowNotificationDialog:F}=ge(t??void 0),m=t?.track,N=M($),{data:T}=oe({}),f=C(()=>T?.edges.find(a=>a.node.id===m?.id)?.node,[T?.edges,m?.id]),{data:L,isLoading:u}=ie(r||void 0,{enabled:!!r&&!!m?.id&&!!f,ownedEntitiesFilter:f?.filter??void 0}),{loading:H,allowed:O}=z({permission:X,resourceRef:i}),{data:h,isLoading:c}=re({trackId:m?.id??"",groupRef:r??"",skip:!m?.id}),U=C(()=>{if(!r)return;const a=L?.[r];return a?pe(a,h||null,()=>"var(--bui-fg-primary)",N,void 0):void 0},[L,N,r,h]),P=G?.getLCPValue();Y(()=>{!s&&!u&&!c&&R({lcp:P})},[s,u,c,R,P]);const q=b(se),V=b(ce);return s?e(d,{className:o.container,children:e(de,{})}):!s&&!t?e(d,{className:o.container,children:e(x,{title:"Campaign not found",body:`There is no campaign with the requested id: ${i}.`})}):!H&&!O?e(d,{className:o.container,children:e(x,{title:"Cannot view campaign",body:`No permission to view campaign with the requested id: ${i}.`})}):p(j,{children:[e(J,{title:t?.name,customActions:e(le,{disabled:!w.length,placement:"left top",menuActions:w,label:"Campaign Actions"}),breadcrumbs:[{label:"Campaigns",href:B()}],tabs:[{id:"overview",label:"Campaign Overview",href:i?q({campaignId:i}):""},{id:"explorer",label:"Tech Insights Explorer",href:i?V({campaignId:i}):""}]}),p(d,{className:o.container,children:[e(v,{className:o.teams,children:e(be,{trackStatus:h??void 0,isLoading:c,campaignId:i})}),p(v,{children:[p(K,{align:"center",gap:"3",className:o.filters,children:[e(he,{}),e(Q,{value:n,onChange:y,"aria-label":"Search",placeholder:"Search"})]}),e(v,{className:o.tableContent,children:e(ue,{tableData:U,isLoading:u||c,selectedGroup:r??void 0,searchValue:g,trackId:f?.id,campaignId:i})})]}),t&&I&&e(fe,{campaign:t,isOpen:I,handleClose:()=>F(!1)})]})]})};export{Ce as CampaignTechInsightsExplorerPage};
2
2
  //# sourceMappingURL=CampaignTechInsightsExplorerPage.esm.js.map
@@ -1,2 +1,2 @@
1
- import{jsx as t,jsxs as c,Fragment as L}from"react/jsx-runtime";import{useApi as j,useRouteRef as k}from"@backstage/core-plugin-api";import{entityPresentationApiRef as G}from"@backstage/plugin-catalog-react";import{usePermission as F}from"@backstage/plugin-permission-react";import{HeaderPage as W,Container as Y,Table as q,TableHeader as J,Column as s,TableBody as K,TablePagination as Q}from"@backstage/ui";import{makeStyles as X}from"@material-ui/core";import{RiCalendarLine as Z}from"@remixicon/react";import{soundcheckCampaignCreatePermission as _}from"@spotify/backstage-plugin-soundcheck-common";import{sortBy as ee,isEmpty as E}from"lodash";import{DateTime as I}from"luxon";import{useState as w,useMemo as l,useEffect as te}from"react";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 ie}from"../../hooks/campaigns/useGetCampaigns.esm.js";import"../../hooks/useConfirmationModal.esm.js";import"react-router-dom";import{useSearchName as re}from"../../hooks/useSearchName.esm.js";import{usePagination as oe}from"../../hooks/usePagination.esm.js";import"react-use/lib/useLocalStorage";import{useProfileImages as ae}from"../../hooks/catalog/useProfileImages.esm.js";import{useLCPReporting as ne}from"../../hooks/useLCPReporting.esm.js";import{useLoadTimeReporting as me}from"../../hooks/useLoadTimeReporting.esm.js";import{campaignCreateRouteRef as se,campaignDetailsRouteRef as pe}from"../../routes.esm.js";import"../EmptyState/EmptyState.esm.js";import{EmptyStateBUI as ce}from"../EmptyState/EmptyStateBUI.esm.js";import{EmptyStateNoCampaigns as le}from"../EmptyState/EmptyStateNoCampaigns.esm.js";import{ListPageCustomActions as de}from"../ListPageCustomActions/ListPageCustomActions.esm.js";import{LoadingTableSkeleton as ge}from"../LoadingTableSkeleton/LoadingTableSkeleton.esm.js";import"../Menus/SimpleMenu.esm.js";import"js-yaml";import"../../contexts/TrackFormContext.esm.js";import"../../contexts/CheckFormContext.esm.js";import"../../contexts/CampaignFormContext.esm.js";import"../../contexts/UserProvider.esm.js";import{useCampaignActions as fe}from"../Menus/useCampaignActions.esm.js";import"@material-ui/icons/AddAlert";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"../LoadingIndicator/LoadingIndicator.esm.js";import"../SoundcheckDialog/SoundcheckDialog.esm.js";import{SendCampaignNotificationDialogBUI as he}from"../SendCampaignNotificationDialog/SendCampaignNotificationDialogBUI.esm.js";import{TableRowWithOwner as ue}from"../TableRowWithOwner/TableRowWithOwner.esm.js";const b=10,A=e=>{const o=I.fromISO(e),m=I.now();return Math.max(Math.ceil(o.diff(m,"days").days),0)},ye=({campaign:e,profileImageMap:o})=>{const m=l(()=>e.archived?0:A(e.targetCompletionDate),[e.archived,e.targetCompletionDate]),p=k(pe),d=l(()=>e.track.levels.reduce((a,h)=>a+(h.checks?.length??0),0),[e.track.levels]),{actions:r,showNotificationDialog:g,setShowNotificationDialog:f}=fe(e);return c(L,{children:[t(ue,{ownerEntityRef:e.ownerEntityRef,href:p({campaignId:e.id}),profileImageSrc:o[e.ownerEntityRef],menuActions:r,name:e.name??"",description:e.description??"",cells:[{title:e.archived?"Archived":"Active"},{title:`${m} day${m===1?"":"s"} remaining`,icon:t(Z,{size:16})},{title:`${d} Check${d===1?"":"s"}`}]}),e&&g&&t(he,{campaign:e,isOpen:g,handleClose:()=>f(!1)})]})},we=X(()=>({container:{marginBottom:"var(--bui-space-12)"}})),Ce=()=>{const e=we(),[o,m]=w(""),[p,d]=w("ascending"),[r,g]=w(""),{data:f,isLoading:a}=ie({}),h=l(()=>f?.edges?.map(i=>i.node)??[],[f?.edges]),{profileImageMap:D}=ae(h.map(i=>i.ownerEntityRef)),u=re({items:h,searchTerm:o}),C=j(G),S=l(()=>{if(!r)return u;const i=ee(u,n=>r==="owner"?C.forEntity(n.ownerEntityRef).snapshot.primaryTitle.toLowerCase():r==="status"?n.archived?"archived":"active":r==="days-remaining"?n.archived?-1:A(n.targetCompletionDate):n.name.toLowerCase());return p==="descending"&&i.reverse(),i},[C,r,p,u]),{paginatedItems:y,reset:N,paginationProps:T}=oe({pageParam:"perPage",defaultPageSize:b,items:S}),{loading:B,allowed:M}=F({permission:_}),H=k(se),R=l(()=>({routeName:"soundcheck-campaigns",additionalAttributes:{}}),[]),{reportContentLoaded:P}=me(R),{reporter:O}=ne(R),v=O?.getLCPValue();te(()=>{a||P({lcp:v})},[a,P,v]);const $=!a&&!E(y),x=S.length>b,U=!a&&E(y),V=a,z=o?t(ce,{title:"No campaigns found",body:"Your current search term did not return any campaigns. Please try a different search term."}):t(le,{});return c(L,{children:[t(W,{customActions:t(de,{searchValue:o,setSearchValue:i=>{N(),m(i)},canCreate:!B&&M,createHref:H()}),title:"Campaigns"}),c(Y,{className:e.container,children:[V&&t(ge,{rowCount:10}),U&&z,$&&c(q,{onSortChange:({direction:i,column:n})=>{g(String(n)),d(i)},sortDescriptor:{direction:p,column:r},children:[c(J,{children:[t(s,{allowsSorting:!0,isRowHeader:!0,id:"name",style:{width:"48%"},children:"Name"}),t(s,{allowsSorting:!0,id:"status",style:{width:"10%"},children:"Status"}),t(s,{allowsSorting:!0,id:"days-remaining",style:{width:"15%"},children:"Days Remaining"}),t(s,{id:"checks",style:{width:"10%"},children:"Checks"}),t(s,{allowsSorting:!0,id:"owner",style:{width:"15%"},children:"Campaign Owner"}),t(s,{style:{width:"2%"}})]}),t(K,{children:y.map(i=>t(ye,{campaign:i,profileImageMap:D??{}},i.id))})]}),x&&t(Q,{...T})]})]})};export{Ce as CampaignListPageBUI};
1
+ import{jsx as r,jsxs as d,Fragment as k}from"react/jsx-runtime";import{useApi as Q,useRouteRef as N}from"@backstage/core-plugin-api";import{entityPresentationApiRef as Y}from"@backstage/plugin-catalog-react";import{usePermission as _}from"@backstage/plugin-permission-react";import{HeaderPage as q,Container as J,Table as X,TableHeader as Z,Column as s,TableBody as ee,TablePagination as te}from"@backstage/ui";import{makeStyles as re}from"@material-ui/core";import{RiCalendarLine as ie}from"@remixicon/react";import{soundcheckCampaignCreatePermission as oe}from"@spotify/backstage-plugin-soundcheck-common";import{sortBy as ae,isEmpty as T}from"lodash";import{DateTime as A}from"luxon";import{useState as P,useMemo as l,useEffect as ne}from"react";import{useSearchParams as me}from"react-router-dom";import se from"react-use/lib/useDebounce";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 pe}from"../../hooks/campaigns/useGetCampaigns.esm.js";import"../../hooks/useConfirmationModal.esm.js";import{usePagination as ce}from"../../hooks/usePagination.esm.js";import"react-use/lib/useLocalStorage";import{useProfileImages as de}from"../../hooks/catalog/useProfileImages.esm.js";import{useLCPReporting as le}from"../../hooks/useLCPReporting.esm.js";import{useLoadTimeReporting as ge}from"../../hooks/useLoadTimeReporting.esm.js";import{useSearchNameOwner as fe}from"../../hooks/useSearchNameOwner.esm.js";import{campaignCreateRouteRef as he,campaignDetailsRouteRef as ue}from"../../routes.esm.js";import"../EmptyState/EmptyState.esm.js";import{EmptyStateBUI as we}from"../EmptyState/EmptyStateBUI.esm.js";import{EmptyStateNoCampaigns as ye}from"../EmptyState/EmptyStateNoCampaigns.esm.js";import{ListPageCustomActions as Ce}from"../ListPageCustomActions/ListPageCustomActions.esm.js";import{LoadingTableSkeleton as Se}from"../LoadingTableSkeleton/LoadingTableSkeleton.esm.js";import"../Menus/SimpleMenu.esm.js";import"js-yaml";import"../../contexts/TrackFormContext.esm.js";import"../../contexts/CheckFormContext.esm.js";import"../../contexts/CampaignFormContext.esm.js";import"../../contexts/UserProvider.esm.js";import{useCampaignActions as Pe}from"../Menus/useCampaignActions.esm.js";import"@material-ui/icons/AddAlert";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"../LoadingIndicator/LoadingIndicator.esm.js";import"../SoundcheckDialog/SoundcheckDialog.esm.js";import{SendCampaignNotificationDialogBUI as Re}from"../SendCampaignNotificationDialog/SendCampaignNotificationDialogBUI.esm.js";import{TableRowWithOwner as Le}from"../TableRowWithOwner/TableRowWithOwner.esm.js";const M=10,ve=["name","status","days-remaining","owner"],B=t=>{const i=A.fromISO(t),n=A.now();return Math.max(Math.ceil(i.diff(n,"days").days),0)},De=({campaign:t,profileImageMap:i})=>{const n=l(()=>t.archived?0:B(t.targetCompletionDate),[t.archived,t.targetCompletionDate]),o=N(ue),g=l(()=>t.track.levels.reduce((w,h)=>w+(h.checks?.length??0),0),[t.track.levels]),{actions:p,showNotificationDialog:f,setShowNotificationDialog:a}=Pe(t);return d(k,{children:[r(Le,{ownerEntityRef:t.ownerEntityRef,href:o({campaignId:t.id}),profileImageSrc:i[t.ownerEntityRef],menuActions:p,name:t.name??"",description:t.description??"",cells:[{title:t.archived?"Archived":"Active"},{title:`${n} day${n===1?"":"s"} remaining`,icon:r(ie,{size:16})},{title:`${g} Check${g===1?"":"s"}`}]}),t&&f&&r(Re,{campaign:t,isOpen:f,handleClose:()=>a(!1)})]})},Ee=re(()=>({container:{marginBottom:"var(--bui-space-12)"}})),be=()=>{const t=Ee(),[i,n]=me(),[o,g]=P(()=>i.get("search")??""),[p,f]=P(()=>i.get("sortDirection")==="descending"?"descending":"ascending"),[a,w]=P(()=>{const e=i.get("sort");return e&&ve.includes(e)?e:""}),{data:h,isLoading:c}=pe({}),R=l(()=>h?.edges?.map(e=>e.node)??[],[h?.edges]),{profileImageMap:O}=de(R.map(e=>e.ownerEntityRef)),L=Q(Y),y=fe(R,o),v=l(()=>{if(!a)return y;const e=ae(y,m=>a==="owner"?L.forEntity(m.ownerEntityRef).snapshot.primaryTitle.toLowerCase():a==="status"?m.archived?"archived":"active":a==="days-remaining"?m.archived?-1:B(m.targetCompletionDate):m.name.toLowerCase());return p==="descending"&&e.reverse(),e},[L,a,p,y]),{paginatedItems:C,reset:D,paginationProps:U}=ce({pageParam:"perPage",defaultPageSize:M,items:v});se(()=>{D();const e=new URLSearchParams(i.toString());o?e.set("search",o):e.delete("search"),n(e,{replace:!0})},300,[o]);const x=({direction:e,column:m})=>{const S=String(m);w(S),f(e),D();const u=new URLSearchParams(i);S?u.set("sort",S):u.delete("sort"),u.set("sortDirection",e),n(u,{replace:!0})},{loading:H,allowed:$}=_({permission:oe}),V=N(he),E=l(()=>({routeName:"soundcheck-campaigns",additionalAttributes:{}}),[]),{reportContentLoaded:b}=ge(E),{reporter:z}=le(E),I=z?.getLCPValue();ne(()=>{c||b({lcp:I})},[c,b,I]);const j=!c&&!T(C),G=v.length>M,W=!c&&T(C),F=c,K=o?r(we,{title:"No campaigns found",body:"Your current search term did not return any campaigns. Please try a different search term."}):r(ye,{});return d(k,{children:[r(q,{customActions:r(Ce,{searchValue:o,setSearchValue:g,canCreate:!H&&$,createHref:V()}),title:"Campaigns"}),d(J,{className:t.container,children:[F&&r(Se,{rowCount:10}),W&&K,j&&d(X,{onSortChange:x,sortDescriptor:{direction:p,column:a},children:[d(Z,{children:[r(s,{allowsSorting:!0,isRowHeader:!0,id:"name",style:{width:"48%"},children:"Name"}),r(s,{allowsSorting:!0,id:"status",style:{width:"10%"},children:"Status"}),r(s,{allowsSorting:!0,id:"days-remaining",style:{width:"15%"},children:"Days Remaining"}),r(s,{id:"checks",style:{width:"10%"},children:"Checks"}),r(s,{allowsSorting:!0,id:"owner",style:{width:"15%"},children:"Campaign Owner"}),r(s,{style:{width:"2%"}})]}),r(ee,{children:C.map(e=>r(De,{campaign:e,profileImageMap:O??{}},e.id))})]}),G&&r(te,{...U})]})]})};export{be as CampaignListPageBUI};
2
2
  //# sourceMappingURL=CampaignListPageBUI.esm.js.map
@@ -1,2 +1,2 @@
1
- import{jsxs as s,jsx as t}from"react/jsx-runtime";import{Card as a,CardHeader as o,Text as c,CardBody as d,Flex as i}from"@backstage/ui";import{CheckStatusTableBUI as m}from"../../CheckPage/CheckStatusTableBUI.esm.js";import"../../CheckStatusBar/CheckStatusBar.esm.js";import{CheckStatusBarBUI as n}from"../../CheckStatusBar/CheckStatusBarBUI.esm.js";const h=({status:r,states:e})=>s(a,{children:[t(o,{children:t(c,{color:"secondary",children:"Current Status"})}),t(d,{children:s(i,{direction:"column",gap:"6",children:[t(n,{status:r,states:e}),t(m,{checkStatus:r,states:e})]})})]});export{h as CheckStatusCard};
1
+ import{jsx as t,jsxs as a}from"react/jsx-runtime";import{Text as s,Flex as n,Card as l,CardHeader as m,CardBody as h}from"@backstage/ui";import{makeStyles as u}from"@material-ui/core";import{CheckStatusTableBUI as p}from"../../CheckPage/CheckStatusTableBUI.esm.js";import"../../CheckStatusBar/CheckStatusBar.esm.js";import{CheckStatusBarBUI as C}from"../../CheckStatusBar/CheckStatusBarBUI.esm.js";import{LoadingTableSkeleton as k}from"../../LoadingTableSkeleton/LoadingTableSkeleton.esm.js";const S=u(()=>({card:{minHeight:"15.1rem"}})),f=({status:e,states:o,isLoading:c,isError:i})=>{const d=S();let r;return c?r=t(k,{rowCount:3}):i?r=t(s,{color:"warning",children:"Failed to load check data."}):r=a(n,{direction:"column",gap:"6",children:[t(C,{status:e,states:o}),t(p,{checkStatus:e,states:o})]}),a(l,{className:d.card,children:[t(m,{children:t(s,{color:"secondary",children:"Current Status"})}),t(h,{children:r})]})};export{f as CheckStatusCard};
2
2
  //# sourceMappingURL=CheckStatusCard.esm.js.map
@@ -1,2 +1,2 @@
1
- import{jsxs as e,Fragment as d,jsx as r}from"react/jsx-runtime";import{Card as l,CardHeader as m,Text as n,CardBody as a,Box as t,CardFooter as s,TagGroup as p,Tag as h}from"@backstage/ui";import{makeStyles as x}from"@material-ui/core";import{RiUserLine as f}from"@remixicon/react";import"../../SoundcheckMarkdownContent/SoundcheckMarkdownContentDeprecated.esm.js";import"@backstage/core-components";import"react";import"react-markdown";import"rehype-raw";import"remark-gfm";import{SoundcheckMarkdownContentBUI as B}from"../../SoundcheckMarkdownContent/SoundcheckMarkdownContentBUI.esm.js";const C=x(()=>({scrollBox:{overflow:"auto"}})),w=({description:i,owner:o})=>{const c=C();return e(l,{children:[i&&e(d,{children:[r(m,{children:r(n,{color:"secondary",children:"Description"})}),r(a,{children:r(t,{className:c.scrollBox,style:{maxHeight:o?"6.3rem":"11rem"},children:r(B,{content:i})})})]}),o&&e(s,{children:[r(t,{mb:"3",children:r(n,{color:"secondary",children:"Owner"})}),r(p,{"aria-label":"Owner",children:r(h,{icon:r(f,{}),children:o})})]})]})};export{w as DescriptionCard};
1
+ import{jsx as r,jsxs as d}from"react/jsx-runtime";import{Text as e,CardFooter as p,Box as c,TagGroup as s,Tag as h,Card as f,CardHeader as w,CardBody as u}from"@backstage/ui";import{makeStyles as x}from"@material-ui/core";import{RiUserLine as g}from"@remixicon/react";import"../../EmptyState/EmptyState.esm.js";import{EmptyStateBUI as y}from"../../EmptyState/EmptyStateBUI.esm.js";import"@backstage/core-plugin-api";import"@backstage/plugin-permission-react";import"@spotify/backstage-plugin-soundcheck-common";import"react-router-dom";import"../../../routes.esm.js";import{LoadingTableSkeleton as C}from"../../LoadingTableSkeleton/LoadingTableSkeleton.esm.js";import"../../SoundcheckMarkdownContent/SoundcheckMarkdownContentDeprecated.esm.js";import"@backstage/core-components";import"react";import"react-markdown";import"rehype-raw";import"remark-gfm";import{SoundcheckMarkdownContentBUI as B}from"../../SoundcheckMarkdownContent/SoundcheckMarkdownContentBUI.esm.js";const l=x(()=>({card:{minHeight:"15.1rem"},scrollBox:{overflow:"auto"}})),n=({children:i,footer:o})=>{const t=l();return d(f,{className:t.card,children:[r(w,{children:r(e,{color:"secondary",children:"Description"})}),r(u,{children:i}),o]})},b=({description:i,owner:o,isError:t,isLoading:m})=>{const a=l();return m?r(n,{children:r(C,{rowCount:3})}):t?r(n,{children:r(e,{color:"warning",children:"Failed to load data."})}):!i&&!o?r(n,{children:r(y,{title:"Description not found",body:"No description and owner were found."})}):r(n,{footer:o?d(p,{children:[r(c,{mb:"3",children:r(e,{color:"secondary",children:"Owner"})}),r(s,{"aria-label":"Owner",children:r(h,{icon:r(g,{}),children:o})})]}):void 0,children:i?r(c,{className:a.scrollBox,style:{maxHeight:o?"6.3rem":"11rem"},children:r(B,{content:i})}):r(e,{children:"No description provided."})})};export{b as DescriptionCard};
2
2
  //# sourceMappingURL=DescriptionCard.esm.js.map
@@ -1,2 +1,2 @@
1
- import{jsxs as e,jsx as r}from"react/jsx-runtime";import{useApi as d,configApiRef as m}from"@backstage/core-plugin-api";import{Card as f,CardHeader as l,Flex as h,Text as p,CardBody as u}from"@backstage/ui";import{makeStyles as y}from"@material-ui/core";import{CheckStatusHistoryChartBUI as k}from"../../CheckPage/CheckStatusHistoryChartBUI.esm.js";import{TimePeriodBarBUI as I}from"../../TimePeriodBar/TimePeriodBarBUI.esm.js";const C=y(()=>({cardBody:{marginTop:"var(--bui-space-1)"}})),b=({checkId:t,trackId:i,filter:a,states:o,numberOfDays:c})=>{const s=C(),n=d(m).getOptionalNumber("soundcheck.certifications.history.retentionTimeInDays");return e(f,{children:[r(l,{children:e(h,{align:"center",justify:"between",children:[r(p,{color:"secondary",children:"Historical Status"}),r(I,{maxNumberOfDays:n})]})}),r(u,{className:s.cardBody,children:r(k,{checkId:t,trackId:i,filter:a,states:o,numberOfDays:c})})]})};export{b as HistoricalCheckStatusCard};
1
+ import{jsxs as t,jsx as r}from"react/jsx-runtime";import{useApi as n,configApiRef as d}from"@backstage/core-plugin-api";import{Card as l,CardHeader as f,Flex as h,Text as p,CardBody as u}from"@backstage/ui";import{makeStyles as y}from"@material-ui/core";import{CheckStatusHistoryChartBUI as k}from"../../CheckPage/CheckStatusHistoryChartBUI.esm.js";import{TimePeriodBarBUI as C}from"../../TimePeriodBar/TimePeriodBarBUI.esm.js";const I=y(()=>({card:{minHeight:"15.1rem"},cardBody:{marginTop:"var(--bui-space-1)"}})),b=({checkId:a,trackId:i,filter:c,states:o,numberOfDays:s})=>{const e=I(),m=n(d).getOptionalNumber("soundcheck.certifications.history.retentionTimeInDays");return t(l,{className:e.card,children:[r(f,{children:t(h,{align:"center",justify:"between",children:[r(p,{color:"secondary",children:"Historical Status"}),r(C,{maxNumberOfDays:m})]})}),r(u,{className:e.cardBody,children:r(k,{checkId:a,trackId:i,filter:c,states:o,numberOfDays:s})})]})};export{b as HistoricalCheckStatusCard};
2
2
  //# sourceMappingURL=HistoricalCheckStatusCard.esm.js.map
@@ -1,2 +1,2 @@
1
- import{jsx as r,jsxs as e}from"react/jsx-runtime";import{useApi as d,configApiRef as l}from"@backstage/core-plugin-api";import{Text as c,Card as p,CardHeader as y,Flex as f,CardBody as h}from"@backstage/ui";import{makeStyles as u}from"@material-ui/core";import{CampaignStatusHistoryChart as g}from"../../CampaignPage/CampaignStatusHistoryChart.esm.js";import{LoadingTableSkeleton as k}from"../../LoadingTableSkeleton/LoadingTableSkeleton.esm.js";import{TimePeriodBarBUI as C}from"../../TimePeriodBar/TimePeriodBarBUI.esm.js";import{TrackHistoryChartBUI as T}from"../../TrackPage/TrackHistoryChartBUI.esm.js";const x=u(()=>({cardBody:{marginTop:"var(--bui-space-1)"}})),B=({track:a,history:o,isError:s,isCampaign:t})=>{const n=x(),m=d(l).getOptionalNumber("soundcheck.certifications.history.retentionTimeInDays");let i=r(T,{track:a,history:o});return t?i=r(g,{history:o}):s&&(i=r(c,{color:"warning",children:"Failed to load track data."})),!a||!o?r(k,{}):e(p,{children:[r(y,{children:e(f,{align:"center",justify:"between",children:[r(c,{color:"secondary",children:"Historical Status"}),!t&&r(C,{maxNumberOfDays:m})]})}),r(h,{className:n.cardBody,children:i})]})};export{B as HistoricalTrackStatusCard};
1
+ import{jsx as r,jsxs as n}from"react/jsx-runtime";import{useApi as l,configApiRef as h}from"@backstage/core-plugin-api";import{Text as c,Card as y,CardHeader as f,Flex as u,CardBody as g}from"@backstage/ui";import{makeStyles as k}from"@material-ui/core";import{CampaignStatusHistoryChart as C}from"../../CampaignPage/CampaignStatusHistoryChart.esm.js";import"../../EmptyState/EmptyState.esm.js";import{EmptyStateBUI as T}from"../../EmptyState/EmptyStateBUI.esm.js";import"@backstage/plugin-permission-react";import"@remixicon/react";import"@spotify/backstage-plugin-soundcheck-common";import"react-router-dom";import"../../../routes.esm.js";import{LoadingTableSkeleton as B}from"../../LoadingTableSkeleton/LoadingTableSkeleton.esm.js";import{TimePeriodBarBUI as b}from"../../TimePeriodBar/TimePeriodBarBUI.esm.js";import{TrackHistoryChartBUI as x}from"../../TrackPage/TrackHistoryChartBUI.esm.js";const H=k(()=>({card:{minHeight:"15.1rem"},cardBody:{marginTop:"var(--bui-space-1)"}})),S=({track:i,history:o,isError:a,isLoading:e,isCampaign:m})=>{const s=H(),d=l(h).getOptionalNumber("soundcheck.certifications.history.retentionTimeInDays");let t;!i||!o?t=r(T,{title:"Track history not found",body:"There is no history for the requested track."}):e?t=r(B,{rowCount:3}):a?t=r(c,{color:"warning",children:"Failed to load track data."}):m?t=r(C,{history:o}):t=r(x,{track:i,history:o});const p=i&&o&&!m&&!a&&!e;return n(y,{className:s.card,children:[r(f,{children:n(u,{align:"center",justify:"between",children:[r(c,{color:"secondary",children:"Historical Status"}),p&&r(b,{maxNumberOfDays:d})]})}),r(g,{className:s.cardBody,children:t})]})};export{S as HistoricalTrackStatusCard};
2
2
  //# sourceMappingURL=HistoricalTrackStatusCard.esm.js.map
@@ -1,2 +1,2 @@
1
- import{jsxs as r,jsx as t}from"react/jsx-runtime";import{Card as o,CardHeader as e,Text as n,CardBody as d,Flex as m}from"@backstage/ui";import{TrackStatusBarBUI as u}from"../../TrackPage/TrackStatusBarBUI.esm.js";import{TrackStatusTableBUI as l}from"../../TrackPage/TrackStatusTableBUI.esm.js";const p=({track:a,status:i,children:c,isCampaign:s})=>r(o,{children:[t(e,{children:t(n,{color:"secondary",children:"Current Status"})}),r(d,{children:[r(m,{direction:"column",gap:"6",children:[t(u,{track:a,status:i?.certificationStatus}),t(l,{track:a,status:i?.certificationStatus,isCampaign:s})]}),c]})]});export{p as TrackStatusCard};
1
+ import{jsx as t,jsxs as i,Fragment as l}from"react/jsx-runtime";import{Text as e,Flex as p,Card as u,CardHeader as f,CardBody as h}from"@backstage/ui";import{makeStyles as k}from"@material-ui/core";import"../../EmptyState/EmptyState.esm.js";import{EmptyStateBUI as g}from"../../EmptyState/EmptyStateBUI.esm.js";import"@backstage/core-plugin-api";import"@backstage/plugin-permission-react";import"@remixicon/react";import"@spotify/backstage-plugin-soundcheck-common";import"react-router-dom";import"../../../routes.esm.js";import{LoadingTableSkeleton as S}from"../../LoadingTableSkeleton/LoadingTableSkeleton.esm.js";import{TrackStatusBarBUI as C}from"../../TrackPage/TrackStatusBarBUI.esm.js";import{TrackStatusTableBUI as T}from"../../TrackPage/TrackStatusTableBUI.esm.js";const x=k(()=>({card:{minHeight:"15.1rem"}})),y=({track:a,status:o,children:c,isLoading:s,isError:n,isCampaign:m})=>{const d=x();let r;return!a||!o?r=t(g,{title:"Track status not found",body:"There is no status for the requested track."}):s?r=t(S,{rowCount:3}):n?r=t(e,{color:"warning",children:"Failed to load track data."}):r=i(l,{children:[i(p,{direction:"column",gap:"6",children:[t(C,{track:a,status:o?.certificationStatus}),t(T,{track:a,status:o?.certificationStatus,isCampaign:m})]}),c]}),i(u,{className:d.card,children:[t(f,{children:t(e,{color:"secondary",children:"Current Status"})}),t(h,{children:r})]})};export{y as TrackStatusCard};
2
2
  //# sourceMappingURL=TrackStatusCard.esm.js.map
@@ -1,2 +1,2 @@
1
- import{jsx as r,jsxs as n,Fragment as ie}from"react/jsx-runtime";import{parseEntityRef as oe}from"@backstage/catalog-model";import{useRouteRef as v}from"@backstage/core-plugin-api";import{usePermission as se}from"@backstage/plugin-permission-react";import{HeaderPage as ae,Container as me,Flex as U,Box as R}from"@backstage/ui";import{makeStyles as ce}from"@material-ui/core";import{toEntityFilterQuery as w,combineEntityFilterQueries as le,soundcheckCheckReadPermission as ne}from"@spotify/backstage-plugin-soundcheck-common";import{useState as N,useMemo as s,useEffect as pe}from"react";import{useSearchParams as de,useParams as fe}from"react-router-dom";import he from"react-use/lib/useDebounce";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import{useCheck as ue}from"../../hooks/checks/useCheck.esm.js";import"../../hooks/useSoundcheckAlert.esm.js";import{useTrack as ke}from"../../hooks/tracks/useTrack.esm.js";import"../../hooks/useConfirmationModal.esm.js";import{useCheckStatus as ge}from"../../hooks/aggregations/useCheckStatus.esm.js";import"react-use/lib/useLocalStorage";import{useFilters as Ie}from"../../hooks/filters/useFilters.esm.js";import{useLCPReporting as Se}from"../../hooks/useLCPReporting.esm.js";import{useLoadTimeReporting as be}from"../../hooks/useLoadTimeReporting.esm.js";import{trackDetailsRouteRef as ye,checksPageRouteRef as Ee,tracksPageRouteRef as Te}from"../../routes.esm.js";import{DescriptionCard as Ce}from"../Cards/DescriptionCard/DescriptionCard.esm.js";import"../Cards/HistoricalTrackStatusCard/HistoricalTrackStatusCard.esm.js";import"../TrackPage/TrackStatusBarBUI.esm.js";import"../TrackPage/TrackStatusTableBUI.esm.js";import{CheckStatusCard as ve}from"../Cards/CheckStatusCard/CheckStatusCard.esm.js";import{HistoricalCheckStatusCard as Re}from"../Cards/HistoricalCheckStatusCard/HistoricalCheckStatusCard.esm.js";import{ChipSelector as we}from"../ChipSelector/ChipSelector.esm.js";import"../EmptyState/EmptyState.esm.js";import{EmptyStateBUI as V}from"../EmptyState/EmptyStateBUI.esm.js";import"@remixicon/react";import"../FilterSidebar/FilterSidebar.esm.js";import"../FilterSidebar/StateFilter.esm.js";import"lodash";import{toFilter as Ne}from"../FilterSidebar/util.esm.js";import{LoadingTableSkeleton as Pe}from"../LoadingTableSkeleton/LoadingTableSkeleton.esm.js";import{SimpleMenu as Fe}from"../Menus/SimpleMenu.esm.js";import{useCheckActions as Ae}from"../Menus/useCheckActions.esm.js";import{PageCustomActions as Le}from"../PageCustomActions/PageCustomActions.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"../../contexts/TrackFormContext.esm.js";import"../../contexts/CheckFormContext.esm.js";import"../../contexts/CampaignFormContext.esm.js";import"../../contexts/UserProvider.esm.js";import{parseNumberOfDays as je}from"../TechHealth/Filters/utils.esm.js";import{CheckEntitiesTableBUI as xe}from"./CheckEntitiesTable/CheckEntitiesTableBUI.esm.js";import{ExemptionsTableBUI as Oe}from"./ExemptionsTableBUI.esm.js";const Be=ce(()=>({container:{marginBottom:"var(--bui-space-12)"},tables:{margin:"var(--bui-space-12) 0 0"},tableContent:{margin:"var(--bui-space-3) 0 0"}})),p={ENTITIES:"Entities",EXEMPTIONS:"Exemptions"},De=(d,e)=>d.levels.flatMap(({checks:f})=>f).find(({id:f})=>f===e)||null,Me=()=>{const d=Be(),[e,f]=de(),{trackId:i,checkId:t}=fe(),{data:a,isLoading:h}=ke(i),{data:u,isLoading:b}=ue(t),P=u?.ownerEntityRef,Q=P?oe(P).name:void 0,F=Ae(u??void 0),H=v(ye),X=v(Ee),$=v(Te),[A,q]=N(new Set([p.ENTITIES])),y=A.values().next().value??p.ENTITIES,[c,W]=N(e.get("search")||""),[L,z]=N(""),m=s(()=>e.getAll("states"),[e]),k=s(()=>e.getAll("owners"),[e]),g=s(()=>e.getAll("lifecycles"),[e]),I=s(()=>e.getAll("types"),[e]),S=s(()=>e.getAll("systems"),[e]),E=s(()=>je(e.get("numberOfDays")),[e]);he(()=>{z(c);const o=new URLSearchParams(e.toString());c?o.set("search",c):o.delete("search"),f(o,{replace:!0})},300,[c]);const j=s(()=>({routeName:"soundcheck-check-insights",additionalAttributes:{checkId:t||"",trackId:i||"",filtersApplied:k.length+g.length+I.length+S.length+m.length,ownersFilter:k.join(",")||"",lifecyclesFilter:g.join(",")||"",typesFilter:I.join(",")||"",systemsFilter:S.join(",")||"",statesFilter:m.join(",")||"",numberOfDays:E,checkSearch:L}}),[t,i,k,g,I,S,m,E,L]),{reportContentLoaded:x}=be(j),{reporter:G}=Se(j),l=s(()=>u??a?.levels.flatMap(o=>o.checks).find(o=>o.id===t),[u,t,a?.levels]),T=Ne({lifecycles:g,owners:k,types:I,systems:S}),{data:J,isLoading:O}=ge({checkId:t,trackId:i,filter:T,states:m?.length?m:void 0},!!t);let C;if(t)if(a){const o=w(a.filter),re=w(De(a,t)?.filter);C=le(o,re)}else l?.filter&&(C=w(l.filter));const{loading:B,allowed:D}=se({permission:ne,resourceRef:t}),K=s(()=>!!l&&!B&&!D,[D,l,B]),{filters:Y,selected:Z,setSelected:_,onRemoveTag:ee,selectedTags:te}=Ie({entityFilterQuery:C,hasStatusFilters:!0}),M=G?.getLCPValue();return pe(()=>{!b&&!O&&(!i||!h)&&x({lcp:M})},[b,O,h,i,x,M]),b||i&&h?r(Pe,{}):K?r(V,{title:"Cannot view check",body:`User does not have permission to view check with id: ${t}.`}):i&&!h&&!a?r(V,{title:"No track found",body:`There is no track with the requested id: ${i}.`}):n(ie,{children:[r(ae,{title:l?.name??"",breadcrumbs:i?[{label:"Tracks",href:$()},{label:a?.name??"Track",href:H({trackId:i})}]:[{label:"Checks",href:X()}],customActions:r(Fe,{disabled:!F.length,placement:"left top",menuActions:F})}),n(me,{className:d.container,children:[n(U,{children:[r(Ce,{description:l?.description??void 0,owner:Q}),r(ve,{states:m,status:J}),r(Re,{checkId:t,trackId:i,filter:T,states:m,numberOfDays:E})]}),n(R,{className:d.tables,children:[n(U,{justify:"between",children:[r(R,{minWidth:"12rem",children:r(we,{options:Object.values(p),selected:A,ariaLabel:"Sections",onSelectionChange:q})}),r(Le,{searchValue:c,setSearchValue:o=>W(o),filters:Y,selected:Z,setSelected:_,onRemoveTag:ee,selectedTags:te,showSearch:y!==p.ENTITIES})]}),n(R,{className:d.tableContent,children:[y===p.ENTITIES&&r(xe,{checkId:t,trackId:a?.id,filter:T,states:m}),y===p.EXEMPTIONS&&r(Oe,{checkId:t,searchValue:c})]})]})]})]})};export{Me as CheckPageBUI};
1
+ import{jsx as r,jsxs as p,Fragment as ce}from"react/jsx-runtime";import{parseEntityRef as le}from"@backstage/catalog-model";import{useRouteRef as R}from"@backstage/core-plugin-api";import{usePermission as ne}from"@backstage/plugin-permission-react";import{Container as V,HeaderPage as pe,Flex as $,Box as w}from"@backstage/ui";import{makeStyles as de}from"@material-ui/core";import{toEntityFilterQuery as N,combineEntityFilterQueries as fe,soundcheckCheckReadPermission as he}from"@spotify/backstage-plugin-soundcheck-common";import{useState as P,useMemo as s,useEffect as ue}from"react";import{useSearchParams as ke,useParams as ge}from"react-router-dom";import be from"react-use/lib/useDebounce";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import{useCheck as Ee}from"../../hooks/checks/useCheck.esm.js";import"../../hooks/useSoundcheckAlert.esm.js";import{useTrack as Ie}from"../../hooks/tracks/useTrack.esm.js";import"../../hooks/useConfirmationModal.esm.js";import{useCheckStatus as Se}from"../../hooks/aggregations/useCheckStatus.esm.js";import"react-use/lib/useLocalStorage";import{useFilters as ye}from"../../hooks/filters/useFilters.esm.js";import{useLCPReporting as Te}from"../../hooks/useLCPReporting.esm.js";import{useLoadTimeReporting as Ce}from"../../hooks/useLoadTimeReporting.esm.js";import{trackDetailsRouteRef as ve,checksPageRouteRef as Re,tracksPageRouteRef as we}from"../../routes.esm.js";import{DescriptionCard as Ne}from"../Cards/DescriptionCard/DescriptionCard.esm.js";import"../Cards/HistoricalTrackStatusCard/HistoricalTrackStatusCard.esm.js";import"../Cards/TrackStatusCard/TrackStatusCard.esm.js";import{CheckStatusCard as Pe}from"../Cards/CheckStatusCard/CheckStatusCard.esm.js";import{HistoricalCheckStatusCard as Ae}from"../Cards/HistoricalCheckStatusCard/HistoricalCheckStatusCard.esm.js";import{ChipSelector as Fe}from"../ChipSelector/ChipSelector.esm.js";import"../EmptyState/EmptyState.esm.js";import{EmptyStateBUI as A}from"../EmptyState/EmptyStateBUI.esm.js";import"@remixicon/react";import"../FilterSidebar/FilterSidebar.esm.js";import"../FilterSidebar/StateFilter.esm.js";import"lodash";import{toFilter as Le}from"../FilterSidebar/util.esm.js";import{LoadingTableSkeleton as je}from"../LoadingTableSkeleton/LoadingTableSkeleton.esm.js";import{SimpleMenu as xe}from"../Menus/SimpleMenu.esm.js";import{useCheckActions as Me}from"../Menus/useCheckActions.esm.js";import{PageCustomActions as Oe}from"../PageCustomActions/PageCustomActions.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"../../contexts/TrackFormContext.esm.js";import"../../contexts/CheckFormContext.esm.js";import"../../contexts/CampaignFormContext.esm.js";import"../../contexts/UserProvider.esm.js";import{parseNumberOfDays as Be}from"../TechHealth/Filters/utils.esm.js";import{CheckEntitiesTableBUI as De}from"./CheckEntitiesTable/CheckEntitiesTableBUI.esm.js";import{ExemptionsTableBUI as Qe}from"./ExemptionsTableBUI.esm.js";const Ue=de(()=>({container:{marginBottom:"var(--bui-space-12)"},tables:{margin:"var(--bui-space-12) 0 0"},tableContent:{margin:"var(--bui-space-3) 0 0"}})),d={ENTITIES:"Entities",EXEMPTIONS:"Exemptions"},Ve=(l,e)=>l.levels.flatMap(({checks:f})=>f).find(({id:f})=>f===e)||null,$e=()=>{const l=Ue(),[e,f]=ke(),{trackId:i,checkId:t}=ge(),{data:a,isLoading:u,isError:q}=Ie(i),{data:k,isLoading:h,isError:H}=Ee(t),F=k?.ownerEntityRef,X=F?le(F).name:void 0,L=Me(k??void 0),W=R(ve),z=R(Re),G=R(we),[j,J]=P(new Set([d.ENTITIES])),S=j.values().next().value??d.ENTITIES,[n,K]=P(e.get("search")||""),[x,Y]=P(""),m=s(()=>e.getAll("states"),[e]),g=s(()=>e.getAll("owners"),[e]),b=s(()=>e.getAll("lifecycles"),[e]),E=s(()=>e.getAll("types"),[e]),I=s(()=>e.getAll("systems"),[e]),y=s(()=>Be(e.get("numberOfDays")),[e]);be(()=>{Y(n);const o=new URLSearchParams(e.toString());n?o.set("search",n):o.delete("search"),f(o,{replace:!0})},300,[n]);const M=s(()=>({routeName:"soundcheck-check-insights",additionalAttributes:{checkId:t||"",trackId:i||"",filtersApplied:g.length+b.length+E.length+I.length+m.length,ownersFilter:g.join(",")||"",lifecyclesFilter:b.join(",")||"",typesFilter:E.join(",")||"",systemsFilter:I.join(",")||"",statesFilter:m.join(",")||"",numberOfDays:y,checkSearch:x}}),[t,i,g,b,E,I,m,y,x]),{reportContentLoaded:O}=Ce(M),{reporter:Z}=Te(M),c=s(()=>k??a?.levels.flatMap(o=>o.checks).find(o=>o.id===t),[k,t,a?.levels]),T=Le({lifecycles:b,owners:g,types:E,systems:I}),{data:_,isLoading:C,isError:ee}=Se({checkId:t,trackId:i,filter:T,states:m?.length?m:void 0},!!t);let v;if(t)if(a){const o=N(a.filter),me=N(Ve(a,t)?.filter);v=fe(o,me)}else c?.filter&&(v=N(c.filter));const{loading:B,allowed:D}=ne({permission:he,resourceRef:t}),te=s(()=>!!c&&!B&&!D,[D,c,B]),{filters:re,selected:ie,setSelected:oe,onRemoveTag:se,selectedTags:ae}=ye({entityFilterQuery:v,hasStatusFilters:!0}),Q=q||H||ee,U=Z?.getLCPValue();return ue(()=>{!h&&!C&&(!i||!u)&&O({lcp:U})},[h,C,u,i,O,U]),h||i&&u?r(je,{}):!h&&!c?r(V,{className:l.container,children:r(A,{title:"Check not found",body:`There is no check with the requested id: ${t}.`})}):te?r(A,{title:"Cannot view check",body:`No permission to view check with the requested id: ${t}.`}):i&&!u&&!a?r(A,{title:"No track found",body:`There is no track with the requested id: ${i}.`}):p(ce,{children:[r(pe,{title:c?.name??"",breadcrumbs:i?[{label:"Tracks",href:G()},{label:a?.name??"Track",href:W({trackId:i})}]:[{label:"Checks",href:z()}],customActions:r(xe,{label:"Check Actions",disabled:!L.length,placement:"left top",menuActions:L})}),p(V,{className:l.container,children:[p($,{children:[r(Ne,{description:c?.description??void 0,owner:X,isError:Q,isLoading:h}),r(Pe,{states:m,status:_,isLoading:C,isError:Q}),r(Ae,{checkId:t,trackId:i,filter:T,states:m,numberOfDays:y})]}),p(w,{className:l.tables,children:[p($,{justify:"between",children:[r(w,{minWidth:"12rem",children:r(Fe,{options:Object.values(d),selected:j,ariaLabel:"Sections",onSelectionChange:J})}),r(Oe,{searchValue:n,setSearchValue:o=>K(o),filters:re,selected:ie,setSelected:oe,onRemoveTag:se,selectedTags:ae,showSearch:S!==d.ENTITIES})]}),p(w,{className:l.tableContent,children:[S===d.ENTITIES&&r(De,{checkId:t,trackId:a?.id,filter:T,states:m}),S===d.EXEMPTIONS&&r(Qe,{checkId:t,searchValue:n})]})]})]})]})};export{$e as CheckPageBUI};
2
2
  //# sourceMappingURL=CheckPageBUI.esm.js.map
@@ -1,2 +1,2 @@
1
- import{jsx as r,jsxs as k}from"react/jsx-runtime";import{Box as p}from"@backstage/ui";import{makeStyles as b}from"@material-ui/core";import{DateTime as y}from"luxon";import{Line as g,ResponsiveContainer as x,LineChart as v,CartesianGrid as C,XAxis as L,YAxis as a,Tooltip as I}from"recharts";import{useCheckStatusHistory as A}from"../../hooks/aggregations/useCheckStatusHistory.esm.js";import{getChartStatusKeys as S,getChartStatusColor as F}from"../../utils/charts.esm.js";import{compactNumberFormatter as D}from"../../utils/formatters.esm.js";import{LoadingChart as O}from"../Charts/LoadingChart.esm.js";const W=b(()=>({container:{height:180,overflow:"hidden"},"@global":{".recharts-default-tooltip li":{margin:"0 !important",padding:"0 !important"}}})),H=({checkId:e,trackId:n,filter:s,states:m,numberOfDays:c})=>{const d=W(),{data:i,isLoading:u}=A({checkId:e,trackId:n,filter:s,states:m,numberOfDays:c},!!e);if(u)return r(O,{type:"line",numLines:3});const l=t=>i?.history.some(o=>o[t]>0)??!1,f={stroke:"var(--bui-fg-secondary)",strokeWidth:1,r:5},h=S().filter(t=>l(t)).map(t=>{const o=F(t);return r(g,{type:"monotone",dataKey:t,stroke:o,yAxisId:"count",strokeWidth:2,dot:!1,isAnimationActive:!1,activeDot:{fill:o,...f}},t)});return r(p,{className:d.container,children:r(x,{debounce:1,children:k(v,{data:i?.history??[],margin:{top:0,right:0,bottom:0,left:0},children:[r(C,{stroke:"var(--bui-border)",strokeWidth:1,horizontal:!0,vertical:!1}),r(L,{dataKey:"date",tickFormatter:t=>y.fromISO(t).toFormat("MMM d"),tickLine:!1,axisLine:!1}),r(a,{yAxisId:"percentage",domain:[0,100],axisLine:!1,tickLine:!1,tickFormatter:t=>`${t}%`,ticks:[0,25,50,75,100]}),r(a,{yAxisId:"count",orientation:"right",domain:[0,i?.numberOfEntities??0],axisLine:!1,tickLine:!1,tickFormatter:t=>D(t)}),r(I,{contentStyle:{backgroundColor:"var(--bui-bg)",color:"var(--bui-fg-secondary)",border:"1px solid var(--bui-border)",borderRadius:"var(--bui-radius-3)"},cursor:{stroke:"var(--bui-fg-secondary)",strokeWidth:1}}),h]})})})};export{H as CheckStatusHistoryChartBUI};
1
+ import{jsx as r,jsxs as p}from"react/jsx-runtime";import{Text as b,Box as y}from"@backstage/ui";import{makeStyles as g}from"@material-ui/core";import{DateTime as x}from"luxon";import{Line as v,ResponsiveContainer as C,LineChart as L,CartesianGrid as I,XAxis as S,YAxis as a,Tooltip as A}from"recharts";import{useCheckStatusHistory as F}from"../../hooks/aggregations/useCheckStatusHistory.esm.js";import{getChartStatusKeys as T,getChartStatusColor as D}from"../../utils/charts.esm.js";import{compactNumberFormatter as O}from"../../utils/formatters.esm.js";import{LoadingTableSkeleton as W}from"../LoadingTableSkeleton/LoadingTableSkeleton.esm.js";const w=g(()=>({container:{height:180,overflow:"hidden"},"@global":{".recharts-default-tooltip li":{margin:"0 !important",padding:"0 !important"}}})),K=({checkId:e,trackId:n,filter:s,states:c,numberOfDays:d})=>{const m=w(),{data:i,isLoading:l,isError:u}=F({checkId:e,trackId:n,filter:s,states:c,numberOfDays:d},!!e);if(l)return r(W,{rowCount:3});if(u)return r(b,{color:"warning",children:"Failed to load check data."});const h=t=>i?.history.some(o=>o[t]>0)??!1,f={stroke:"var(--bui-fg-secondary)",strokeWidth:1,r:5},k=T().filter(t=>h(t)).map(t=>{const o=D(t);return r(v,{type:"monotone",dataKey:t,stroke:o,yAxisId:"count",strokeWidth:2,dot:!1,isAnimationActive:!1,activeDot:{fill:o,...f}},t)});return r(y,{className:m.container,children:r(C,{debounce:1,children:p(L,{data:i?.history??[],margin:{top:0,right:0,bottom:0,left:0},children:[r(I,{stroke:"var(--bui-border)",strokeWidth:1,horizontal:!0,vertical:!1}),r(S,{dataKey:"date",tickFormatter:t=>x.fromISO(t).toFormat("MMM d"),tickLine:!1,axisLine:!1}),r(a,{yAxisId:"percentage",domain:[0,100],axisLine:!1,tickLine:!1,tickFormatter:t=>`${t}%`,ticks:[0,25,50,75,100]}),r(a,{yAxisId:"count",orientation:"right",domain:[0,i?.numberOfEntities??0],axisLine:!1,tickLine:!1,tickFormatter:t=>O(t)}),r(A,{contentStyle:{backgroundColor:"var(--bui-bg)",color:"var(--bui-fg-secondary)",border:"1px solid var(--bui-border)",borderRadius:"var(--bui-radius-3)"},cursor:{stroke:"var(--bui-fg-secondary)",strokeWidth:1}}),k]})})})};export{K as CheckStatusHistoryChartBUI};
2
2
  //# sourceMappingURL=CheckStatusHistoryChartBUI.esm.js.map
@@ -1,2 +1,2 @@
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 ve}from"../../SearchFilters/SearchFilters.esm.js";import{ChecksOverviewSkeleton as be}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,v]=i(E),[g,G]=i(""),[c,j]=i(L.Alpha),[n,D]=i(L.Owner),[p,H]=i(""),b=se(()=>({routeName:"soundcheck-checks",additionalAttributes:{checksPerPage:e,pageCursor:m||"",sortOrder:c||"",ownerFilter:n||"",nameSearch:p||""}}),[e,m,c,n,p]),{reportContentLoaded:x}=ge(b),{reporter:M}=he(b),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(()=>{v(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(be,{}):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(ve,{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:v,prevCursors:A,setPrevCursors:w,labelPerPageDropdown:"Checks Per Page:",urlRoute:"checks?checksPerPage="})})]})};export{T as CheckEmptyState,Ae as CheckListPage,F as CheckNoResults};
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
2
  //# sourceMappingURL=CheckListPageDeprecated.esm.js.map
@@ -1,2 +1,2 @@
1
- import{jsx as t,jsxs as a,Fragment as F}from"react/jsx-runtime";import{useRouteRef as E,useApi as I}from"@backstage/core-plugin-api";import{entityPresentationApiRef as G}from"@backstage/plugin-catalog-react";import{usePermission as O}from"@backstage/plugin-permission-react";import{HeaderPage as z,Flex as W,Container as Y,Table as q,TableHeader as J,Column as f,TableBody as K,TablePagination as Q}from"@backstage/ui";import{makeStyles as X}from"@material-ui/core";import{soundcheckCheckCreatePermission as Z}from"@spotify/backstage-plugin-soundcheck-common";import{sortBy as _,isEmpty as h}from"lodash";import{useState as u,useMemo as S}from"react";import{soundcheckApiRef as $}from"../../api.esm.js";import"@backstage/catalog-model";import"@tanstack/react-query";import"../../hooks/graphqlKeys.esm.js";import{useGetChecks as ee}from"../../hooks/checks/useGetChecks.esm.js";import"../../hooks/useSoundcheckAlert.esm.js";import"../../hooks/useConfirmationModal.esm.js";import"react-router-dom";import{useSearchName as te}from"../../hooks/useSearchName.esm.js";import{usePagination as re}from"../../hooks/usePagination.esm.js";import"react-use/lib/useLocalStorage";import{useProfileImages as oe}from"../../hooks/catalog/useProfileImages.esm.js";import{useImportChecks as ie}from"../../hooks/checks/useImportChecks.esm.js";import{checkTemplatesRouteRef as me,checkDetailsRouteRef as ne}from"../../routes.esm.js";import{exportChecks as ae}from"../../utils/export.esm.js";import"../EmptyState/EmptyState.esm.js";import{EmptyStateBUI as se}from"../EmptyState/EmptyStateBUI.esm.js";import"@remixicon/react";import{EmptyStateNoChecks as pe}from"../EmptyState/EmptyStateNoChecks.esm.js";import{ImportExportPanelBUI as ce}from"../ImportExportPanel/ImportExportPanelBUI.esm.js";import"../ImportExportPanel/ImportExportPanelDeprecated.esm.js";import{ListPageCustomActions as le}from"../ListPageCustomActions/ListPageCustomActions.esm.js";import{LoadingTableSkeleton as de}from"../LoadingTableSkeleton/LoadingTableSkeleton.esm.js";import"../Menus/SimpleMenu.esm.js";import{useCheckActions as fe}from"../Menus/useCheckActions.esm.js";import"../../contexts/TrackFormContext.esm.js";import"../../contexts/CheckFormContext.esm.js";import"../../contexts/CampaignFormContext.esm.js";import"../../contexts/UserProvider.esm.js";import"uuid";import"../CampaignsPage/CampaignListPage/useArchiveConfirmationModal.esm.js";import{TableRowWithOwner as he}from"../TableRowWithOwner/TableRowWithOwner.esm.js";const b=10,ue=({check:o,profileImageMap:i})=>{const p=E(ne),m=fe(o);return t(he,{ownerEntityRef:o.ownerEntityRef??"",href:p({checkId:o.id}),profileImageSrc:i[o.ownerEntityRef??""],menuActions:m,name:o.name??o.id,description:o.description??"",cells:[]})},ge=X(()=>({container:{marginBottom:"var(--bui-space-12)"}})),ye=()=>{const o=ge(),[i,p]=u(""),[m,T]=u("ascending"),[n,A]=u(""),{isLoading:s,data:g}=ee({}),c=S(()=>g?.edges?.map(e=>e.node)??[],[g?.edges]),{loading:y,allowed:w}=O({permission:Z}),x=E(me),{profileImageMap:B}=oe(c.filter(e=>e.ownerEntityRef).map(e=>e.ownerEntityRef)),l=te({items:c,searchTerm:i}),k=I(G),C=S(()=>{if(!n)return l;const e=_(l,r=>n==="owner"?r.ownerEntityRef?k.forEntity(r.ownerEntityRef).snapshot.primaryTitle:-1:n==="type"?r.type?r.type:"default":r?.name?.toLowerCase()??r.id.toLowerCase());return m==="descending"&&e.reverse(),e},[n,l,m,k]),{mutateAsync:L}=ie(),N=async e=>L(e),H=I($),M=async()=>{const e=await H.getChecks({orderAlphabetical:"asc"});return ae(e.edges.map(r=>r.node))},{paginatedItems:d,reset:U,paginationProps:v}=re({pageParam:"perPage",defaultPageSize:b,items:C}),D=s,R=!s&&h(d),V=!s&&!h(d),j=C.length>b;let P=null;return R&&(P=i?t(se,{title:"No checks found",body:"Your current search term did not return any checks. Please try a different search term."}):t(pe,{})),a(F,{children:[t(z,{customActions:a(W,{gap:"2",align:"center",children:[t(ce,{resourceType:"check",disableImport:!y&&!w,disableExport:s||h(c),onImport:N,onExport:M}),t(le,{searchValue:i,setSearchValue:e=>{U(),p(e)},canCreate:!y&&w,createHref:x()})]}),title:"Checks"}),a(Y,{className:o.container,children:[D&&t(de,{rowCount:10}),R&&P,V&&a(q,{onSortChange:({direction:e,column:r})=>{A(String(r)),T(e)},sortDescriptor:{direction:m,column:n},children:[a(J,{children:[t(f,{id:"name",allowsSorting:!0,isRowHeader:!0,style:{width:"83%"},children:"Name"}),t(f,{id:"owner",allowsSorting:!0,style:{width:"15%"},children:"Check Owner"}),t(f,{id:"actions",style:{width:"2%"}})]}),t(K,{children:d.map(e=>t(ue,{check:e,profileImageMap:B??{}},e.id))})]}),j&&t(Q,{...v})]})]})};export{ye as ChecksListPageBUI};
1
+ import{jsx as t,jsxs as m,Fragment as K}from"react/jsx-runtime";import{useRouteRef as x,useApi as A}from"@backstage/core-plugin-api";import{entityPresentationApiRef as W}from"@backstage/plugin-catalog-react";import{usePermission as Y}from"@backstage/plugin-permission-react";import{HeaderPage as _,Flex as q,Container as Q,Table as X,TableHeader as Z,Column as g,TableBody as $,TablePagination as ee}from"@backstage/ui";import{makeStyles as te}from"@material-ui/core";import{soundcheckCheckCreatePermission as re}from"@spotify/backstage-plugin-soundcheck-common";import{sortBy as oe,isEmpty as y}from"lodash";import{useState as w,useMemo as T}from"react";import{useSearchParams as ie}from"react-router-dom";import ne from"react-use/lib/useDebounce";import{soundcheckApiRef as ae}from"../../api.esm.js";import"@backstage/catalog-model";import"@tanstack/react-query";import"../../hooks/graphqlKeys.esm.js";import{useGetChecks as me}from"../../hooks/checks/useGetChecks.esm.js";import"../../hooks/useSoundcheckAlert.esm.js";import"../../hooks/useConfirmationModal.esm.js";import{usePagination as se}from"../../hooks/usePagination.esm.js";import"react-use/lib/useLocalStorage";import{useProfileImages as ce}from"../../hooks/catalog/useProfileImages.esm.js";import{useImportChecks as pe}from"../../hooks/checks/useImportChecks.esm.js";import{useSearchNameOwner as le}from"../../hooks/useSearchNameOwner.esm.js";import{checkTemplatesRouteRef as de,checkDetailsRouteRef as fe}from"../../routes.esm.js";import{exportChecks as he}from"../../utils/export.esm.js";import"../EmptyState/EmptyState.esm.js";import{EmptyStateBUI as ue}from"../EmptyState/EmptyStateBUI.esm.js";import"@remixicon/react";import{EmptyStateNoChecks as ge}from"../EmptyState/EmptyStateNoChecks.esm.js";import{ImportExportPanelBUI as ye}from"../ImportExportPanel/ImportExportPanelBUI.esm.js";import"../ImportExportPanel/ImportExportPanelDeprecated.esm.js";import{ListPageCustomActions as we}from"../ListPageCustomActions/ListPageCustomActions.esm.js";import{LoadingTableSkeleton as ke}from"../LoadingTableSkeleton/LoadingTableSkeleton.esm.js";import"../Menus/SimpleMenu.esm.js";import{useCheckActions as Re}from"../Menus/useCheckActions.esm.js";import"../../contexts/TrackFormContext.esm.js";import"../../contexts/CheckFormContext.esm.js";import"../../contexts/CampaignFormContext.esm.js";import"../../contexts/UserProvider.esm.js";import"uuid";import"../CampaignsPage/CampaignListPage/useArchiveConfirmationModal.esm.js";import{TableRowWithOwner as Pe}from"../TableRowWithOwner/TableRowWithOwner.esm.js";const L=10,Ce=["name","owner"],Se=({check:o,profileImageMap:n})=>{const s=x(fe),i=Re(o);return t(Pe,{ownerEntityRef:o.ownerEntityRef??"",href:s({checkId:o.id}),profileImageSrc:n[o.ownerEntityRef??""],menuActions:i,name:o.name??o.id,description:o.description??"",cells:[]})},Ee=te(()=>({container:{marginBottom:"var(--bui-space-12)"}})),Ie=()=>{const o=Ee(),[n,s]=ie(),[i,B]=w(()=>n.get("search")??""),[l,N]=w(()=>n.get("sortDirection")==="descending"?"descending":"ascending"),[a,U]=w(()=>{const e=n.get("sort");return e&&Ce.includes(e)?e:""}),{isLoading:c,data:k}=me({}),d=T(()=>k?.edges?.map(e=>e.node)??[],[k?.edges]),{loading:R,allowed:P}=Y({permission:re}),D=x(de),{profileImageMap:H}=ce(d.filter(e=>e.ownerEntityRef).map(e=>e.ownerEntityRef)),C=A(W),f=le(d,i),S=T(()=>{if(!a)return f;const e=oe(f,r=>a==="owner"?r.ownerEntityRef?C.forEntity(r.ownerEntityRef).snapshot.primaryTitle:-1:a==="type"?r.type?r.type:"default":r?.name?.toLowerCase()??r.id.toLowerCase());return l==="descending"&&e.reverse(),e},[a,f,l,C]),{mutateAsync:M}=pe(),O=async e=>M(e),v=A(ae),F=async()=>{const e=await v.getChecks({orderAlphabetical:"asc"});return he(e.edges.map(r=>r.node))},{paginatedItems:h,reset:E,paginationProps:V}=se({pageParam:"perPage",defaultPageSize:L,items:S});ne(()=>{E();const e=new URLSearchParams(n.toString());i?e.set("search",i):e.delete("search"),s(e,{replace:!0})},300,[i]);const j=({direction:e,column:r})=>{const u=String(r);U(u),N(e),E();const p=new URLSearchParams(n);u?p.set("sort",u):p.delete("sort"),p.set("sortDirection",e),s(p,{replace:!0})},G=c,I=!c&&y(h),z=!c&&!y(h),J=S.length>L;let b=null;return I&&(b=i?t(ue,{title:"No checks found",body:"Your current search term did not return any checks. Please try a different search term."}):t(ge,{})),m(K,{children:[t(_,{customActions:m(q,{gap:"2",align:"center",children:[t(ye,{resourceType:"check",disableImport:!R&&!P,disableExport:c||y(d),onImport:O,onExport:F}),t(we,{searchValue:i,setSearchValue:B,canCreate:!R&&P,createHref:D()})]}),title:"Checks"}),m(Q,{className:o.container,children:[G&&t(ke,{rowCount:10}),I&&b,z&&m(X,{onSortChange:j,sortDescriptor:{direction:l,column:a},children:[m(Z,{children:[t(g,{id:"name",allowsSorting:!0,isRowHeader:!0,style:{width:"83%"},children:"Name"}),t(g,{id:"owner",allowsSorting:!0,style:{width:"15%"},children:"Check Owner"}),t(g,{id:"actions",style:{width:"2%"}})]}),t($,{children:h.map(e=>t(Se,{check:e,profileImageMap:H??{}},e.id))})]}),J&&t(ee,{...V})]})]})};export{Ie as ChecksListPageBUI};
2
2
  //# sourceMappingURL=ChecksListPageBUI.esm.js.map