@spotify/backstage-plugin-soundcheck 0.14.4 → 0.14.5

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 (87) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/config.d.ts +14 -0
  3. package/dist/components/CampaignCreatePage/CampaignCreatePage.esm.js +1 -1
  4. package/dist/components/CampaignForm/hooks/useCampaignForm.esm.js +1 -1
  5. package/dist/components/CampaignInsightsPage/CampaignStatusHistoryTile.esm.js +1 -1
  6. package/dist/components/CampaignInsightsPage/CampaignStatusTile.esm.js +1 -1
  7. package/dist/components/CampaignsPage/EditCampaignView.esm.js +1 -1
  8. package/dist/components/CertificationAccordion/CertificationAccordion.esm.js +1 -1
  9. package/dist/components/CertificationSidebar/CertificationSidebar.esm.js +1 -1
  10. package/dist/components/CertificationSidebar/Check.esm.js +1 -1
  11. package/dist/components/CertificationsPage/CertificationTab.esm.js +1 -1
  12. package/dist/components/CertificationsPage/CertificationTabs.esm.js +1 -1
  13. package/dist/components/CertificationsPage/CertificationsPage.esm.js +1 -1
  14. package/dist/components/CertificationsPage/Playlist/PlaylistContext.esm.js +1 -1
  15. package/dist/components/CheckCreatePage/CheckCreatePage.esm.js +1 -1
  16. package/dist/components/CheckDetails/CheckDetails.esm.js +1 -1
  17. package/dist/components/CheckForm/FormFields/RuleInput/Expressions/ExpressionTypeToggle.esm.js +1 -1
  18. package/dist/components/CheckForm/useCheckForm.esm.js +1 -1
  19. package/dist/components/CheckForm/utils/checkFormUtils.esm.js +1 -1
  20. package/dist/components/CheckPage/CheckDetailsView.esm.js +1 -1
  21. package/dist/components/CheckPage/CheckEditView.esm.js +1 -1
  22. package/dist/components/CheckPage/CheckEntitiesTable/CheckEntitiesTable.esm.js +1 -1
  23. package/dist/components/CollectorPage/Configurators/Common/CollectorOption.esm.js +1 -1
  24. package/dist/components/CollectorPage/Configurators/Common/CollectorSchedulingOptions.esm.js +2 -0
  25. package/dist/components/CollectorPage/Configurators/Common/FactCollectionConfig.esm.js +1 -1
  26. package/dist/components/CollectorPage/Configurators/Common/utils.esm.js +1 -1
  27. package/dist/components/CollectorPage/Configurators/DataDog/DataDogConfigurator.esm.js +1 -1
  28. package/dist/components/CollectorPage/Configurators/DataDog/utils.esm.js +1 -1
  29. package/dist/components/CollectorPage/Configurators/Github/GithubConfigurator.esm.js +1 -1
  30. package/dist/components/CollectorPage/Configurators/Github/utils.esm.js +1 -1
  31. package/dist/components/CollectorPage/Configurators/Gitlab/GitlabConfigurator.esm.js +1 -1
  32. package/dist/components/CollectorPage/Configurators/Gitlab/utils.esm.js +1 -1
  33. package/dist/components/CollectorPage/Configurators/Jira/JiraConfigurator.esm.js +1 -1
  34. package/dist/components/CollectorPage/Configurators/Jira/utils.esm.js +1 -1
  35. package/dist/components/CollectorPage/Configurators/Kubernetes/KubernetesConfigurator.esm.js +1 -1
  36. package/dist/components/CollectorPage/Configurators/Kubernetes/utils.esm.js +1 -1
  37. package/dist/components/CollectorPage/Configurators/NewRelic/NewRelicConfigurator.esm.js +1 -1
  38. package/dist/components/CollectorPage/Configurators/NewRelic/utils.esm.js +1 -1
  39. package/dist/components/CollectorPage/Configurators/PagerDuty/PagerDutyConfigurator.esm.js +1 -1
  40. package/dist/components/CollectorPage/Configurators/PagerDuty/utils.esm.js +1 -1
  41. package/dist/components/CollectorPage/Configurators/SCM/FactCollectionConfig.esm.js +1 -1
  42. package/dist/components/CollectorPage/Configurators/SCM/ScmConfigurator.esm.js +1 -1
  43. package/dist/components/CollectorPage/Configurators/SCM/utils.esm.js +1 -1
  44. package/dist/components/CollectorPage/Configurators/SCM/validation.esm.js +1 -1
  45. package/dist/components/CollectorPage/Configurators/SonarQube/SonarQubeConfigurator.esm.js +1 -1
  46. package/dist/components/CollectorPage/Configurators/SonarQube/utils.esm.js +1 -1
  47. package/dist/components/EntitySoundcheckCard/Card.esm.js +1 -1
  48. package/dist/components/LevelUpParty/LevelUpParty.esm.js +1 -1
  49. package/dist/components/OverviewPage/OverviewPageContent.esm.js +1 -1
  50. package/dist/components/OverviewPage/OverviewPageHeader.esm.js +1 -1
  51. package/dist/components/OverviewTable/ResultsTable.esm.js +1 -1
  52. package/dist/components/PassRateTable/PassRateTable.esm.js +2 -2
  53. package/dist/components/RefetchingIndicator/RefetchingIndicator.esm.js +1 -1
  54. package/dist/components/Router.esm.js +1 -1
  55. package/dist/components/RoutingPage/RoutingPage.esm.js +1 -1
  56. package/dist/components/TechHealth/Filters/FacetFilter.esm.js +1 -1
  57. package/dist/components/TechHealth/Filters/useFacetOptions.esm.js +1 -1
  58. package/dist/components/TechHealth/TechHealth.esm.js +1 -1
  59. package/dist/components/TechHealthSummary/SummaryAggregationsProvider.esm.js +1 -1
  60. package/dist/components/TechHealthTabs/CampaignResultsTab/CampaignResultsTab.esm.js +1 -1
  61. package/dist/components/TechHealthTabs/CheckResultsTab/CheckResultsTab.esm.js +1 -1
  62. package/dist/components/TechHealthTabs/EntityResultsTab/EntityResultsTab.esm.js +1 -1
  63. package/dist/components/TechHealthTabs/GroupResultsTab/GroupResultsTab.esm.js +1 -1
  64. package/dist/components/TechHealthTabs/TrackResultsTab/TrackResultsTab.esm.js +1 -1
  65. package/dist/components/TrackCreatePage/TrackCreatePage.esm.js +1 -1
  66. package/dist/components/TrackEditPage/TrackEditView.esm.js +1 -1
  67. package/dist/components/TrackForm/utils/useTrackForm.esm.js +1 -1
  68. package/dist/components/TrackPage/TrackEntitiesTable/TrackEntitiesTable.esm.js +1 -1
  69. package/dist/hooks/certifications/useProgramOverviewForOwner.esm.js +1 -1
  70. package/dist/hooks/checks/useUpdateCheck.esm.js +1 -1
  71. package/dist/hooks/facets/useFacetFilters.esm.js +1 -1
  72. package/dist/hooks/facets/useFacetsForOwner.esm.js +1 -1
  73. package/dist/hooks/graphqlKeys.esm.js +1 -1
  74. package/dist/hooks/groups/useAllGroups.esm.js +1 -1
  75. package/dist/hooks/groups/useUsersGroupClaims.esm.js +1 -1
  76. package/dist/hooks/tracks/useCreateTrack.esm.js +1 -1
  77. package/dist/hooks/tracks/useDeleteTrack.esm.js +1 -1
  78. package/dist/hooks/tracks/useUpdateTrack.esm.js +1 -1
  79. package/dist/utils/export.esm.js +3 -3
  80. package/dist/utils/getGroupFilterFromConfig.esm.js +2 -0
  81. package/package.json +21 -20
  82. package/dist/components/CampaignDetailsPage/CampaignDetailRow.esm.js +0 -2
  83. package/dist/components/CampaignDetailsPage/CampaignDetails.esm.js +0 -2
  84. package/dist/components/OverviewPage/CampaignBanner/CampaignArea.esm.js +0 -2
  85. package/dist/components/OverviewPage/CampaignBanner/CampaignBanner.esm.js +0 -2
  86. package/dist/components/OverviewPage/CampaignBanner/useCampaignBannerStyles.esm.js +0 -2
  87. package/dist/components/OverviewPage/CampaignBanner/utils.esm.js +0 -2
@@ -1,2 +1,2 @@
1
- import{asArray as f}from"@spotify/backstage-plugin-soundcheck-common";import{mapToCacheConfig as s,mapCacheConfigToHumanDurationOrBoolean as m}from"../../../CacheConfig/utils.esm.js";import"../../../CacheConfig/CacheConfigComponent.esm.js";import{mapCatalogFilterToFilters as u,mapFiltersToCatalogFilter as p}from"../../../Filter/utils.esm.js";import"../../../Filter/FilterComponent.esm.js";import"../../../Frequency/types.esm.js";import{mapHumanDurationOrCronToFrequency as C,mapFrequencyToHumanDurationOrCron as h}from"../../../Frequency/util.esm.js";import"../../../Frequency/FrequencyComponent.esm.js";import{defaultBaseCollectorOption as g}from"../Common/CollectorOption.esm.js";const c="issues-search",q={factDetails:{factName:{name:"Fact Name",helperText:"Fact name must be unique",placeholder:"Fact Name"},jql:{name:"Jira Query Language (JQL)",helperText:"Optional, the value will be concatenated with JQL from 'atlassian.net/jql' annotation.",placeholder:'Example: status = "To Do" AND created >= -30d'}}},i=(a,t)=>({...g(),factDetails:{factName:a??"",jql:t}}),n=()=>({issuesSearch:{enabled:!1,collectors:[i(c)]}});function T(a){const{issuesSearch:t}=a;if(t.enabled){const o={},r=[];return o.collects=r,t.collectors.forEach(e=>{const l=e.factDetails.jql?.trim();r.push({factName:e.factDetails.factName,type:c,jql:l?.length?l:void 0,frequency:h(e.frequency),filter:p(e.filters),cache:m(e.cacheConfig)})}),o}return{collects:[]}}function d(a){const t=n();if(a){const o=a.collects;if(o){const r=f(o).filter(e=>e.type===c);r.length&&(t.issuesSearch={enabled:!0,collectors:r.map(e=>({factDetails:{factName:e.factName??c,jql:e.jql},frequency:C(e.frequency??a.frequency),filters:u(e.filter??a.filter),cacheConfig:s(e.cache??a.cache)}))})}}return t}export{c as ISSUES_SEARCH_COLLECTOR_TYPE,q as JIRA_COLLECTOR_FIELDS,n as defaultJiraConfig,i as issueSearchCollectorConfig,d as mapConfigToJiraCollectorConfig,T as mapJiraCollectorConfigToConfig};
1
+ import{asArray as s}from"@spotify/backstage-plugin-soundcheck-common";import{defaultBaseCollectorOption as f}from"../Common/CollectorOption.esm.js";import{mapBackendConfigToFormIntegrationConfig as m,mapFormIntegrationConfigToBackendConfig as p}from"../Common/utils.esm.js";const c="issues-search",C={factDetails:{factName:{name:"Fact Name",helperText:"Fact name must be unique",placeholder:"Fact Name"},jql:{name:"Jira Query Language (JQL)",helperText:"Optional, the value will be concatenated with JQL from 'atlassian.net/jql' annotation.",placeholder:'Example: status = "To Do" AND created >= -30d'}}},i=(a,t)=>({...f(),factDetails:{factName:a??"",jql:t}}),r=()=>({issuesSearch:{enabled:!1,collectors:[i(c)]}});function u(a){const{issuesSearch:t}=a;if(t.enabled){const o={},n=[];return o.collects=n,t.collectors.forEach(e=>{const l=e.factDetails.jql?.trim();n.push(p({factType:c,configOption:e,additionalParams:{factName:e.factDetails.factName,jql:l?.length?l:void 0}}))}),o}return{collects:[]}}function g(a){const t=r();if(a){const o=a.collects;if(o){const n=s(o).filter(e=>e.type===c);n.length&&(t.issuesSearch={enabled:!0,collectors:n.map(e=>({...m({parentConfig:a,factTypeConfig:e}),factDetails:{factName:e.factName??c,jql:e.jql}}))})}}return t}export{c as ISSUES_SEARCH_COLLECTOR_TYPE,C as JIRA_COLLECTOR_FIELDS,r as defaultJiraConfig,i as issueSearchCollectorConfig,g as mapConfigToJiraCollectorConfig,u as mapJiraCollectorConfigToConfig};
2
2
  //# sourceMappingURL=utils.esm.js.map
@@ -1,2 +1,2 @@
1
- import{zodResolver as g}from"@hookform/resolvers/zod";import{makeStyles as b,Paper as E,Divider as S}from"@material-ui/core";import e from"react";import{useForm as v,FormProvider as h}from"react-hook-form";import"@backstage/catalog-model";import"@backstage/core-plugin-api";import"@tanstack/react-query";import"../../../../api.esm.js";import"../../../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"../../../../hooks/useSoundcheckAlert.esm.js";import{useConfirmationModal as F}from"../../../../hooks/useConfirmationModal.esm.js";import{useNavigateBack as R}from"../../../../hooks/useNavigateBack.esm.js";import{useUpdateCollectorConfig as K}from"../../../../hooks/collectors/useUpdateCollectorConfig.esm.js";import{integrationsPageRouteRef as w}from"../../../../routes.esm.js";import{FooterButtons as y}from"../../../FooterButtons/FooterButtons.esm.js";import"../../../SoundcheckHeader/SoundcheckHeader.esm.js";import"../../../SoundcheckHeader/SoundcheckHeaderContext.esm.js";import{useHeader as k}from"../../../SoundcheckHeader/useHeader.esm.js";import{FactCollectionConfig as s}from"../Common/FactCollectionConfig.esm.js";import{defaultCollectorOption as B}from"../Common/CollectorOption.esm.js";import{collectorHeaderContent as D,confirmationModalContent as L}from"../Common/utils.esm.js";import{KubernetesFactDetails as O}from"./KubernetesFactDetails.esm.js";import{mapConfigToKubernetesCollectorConfig as T,defaultKubernetesConfig as H,K8S_COLLECTOR_FIELDS as M,mapKubernetesCollectorConfigToConfig as N}from"./utils.esm.js";import{customResourceFormSchema as P}from"./validation.esm.js";const x=b(o=>({spacer:{height:o.spacing(8),width:"100%"},section:{marginBottom:o.spacing(2)}})),I=({disabled:o,selectedCollector:t})=>{const r=v({defaultValues:t?T(t.config):H(),mode:"onChange",resolver:g(P)}),m=x(),{mutateAsync:c}=K(),[p,f]=R(w),{isValid:u}=r.formState,{showModal:d}=F(),n=async a=>{if(!await d(L(t)))return;const i=N(a);await c({collectorId:t.id,config:i})&&f()};return k(D(t)),e.createElement(e.Fragment,null,e.createElement(E,{className:m.section},e.createElement(h,{...r},e.createElement("form",{onSubmit:r.handleSubmit(n)},Object.entries(M).map(([a,i],l,C)=>e.createElement("div",{key:l},e.createElement(s,{name:a,label:i.label,description:i.description,disabled:o}),l<C.length-1&&e.createElement(S,null))),e.createElement(s,{name:"customResources",label:"Custom Resources",description:"Collect facts from a kubernetes custom resource associated with an entity.",disabled:o,FactDetailsComponent:O,multipleCollectors:{enable:!0,defaultConfig:B()}})))),e.createElement("div",{className:m.section},e.createElement(y,{onCancel:p,saveButtonText:"Save",isLoading:!1,onSave:r.handleSubmit(n),disableSave:!u})))};export{I as KubernetesConfigurator};
1
+ import{zodResolver as g}from"@hookform/resolvers/zod";import{makeStyles as b,Paper as E,Divider as S}from"@material-ui/core";import e from"react";import{useForm as v,FormProvider as h}from"react-hook-form";import"@backstage/catalog-model";import"@backstage/core-plugin-api";import"@tanstack/react-query";import"../../../../api.esm.js";import"../../../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"@spotify/backstage-plugin-soundcheck-common";import"../../../../hooks/useSoundcheckAlert.esm.js";import{useConfirmationModal as F}from"../../../../hooks/useConfirmationModal.esm.js";import{useNavigateBack as R}from"../../../../hooks/useNavigateBack.esm.js";import{useUpdateCollectorConfig as K}from"../../../../hooks/collectors/useUpdateCollectorConfig.esm.js";import{integrationsPageRouteRef as w}from"../../../../routes.esm.js";import{FooterButtons as y}from"../../../FooterButtons/FooterButtons.esm.js";import"../../../SoundcheckHeader/SoundcheckHeader.esm.js";import"../../../SoundcheckHeader/SoundcheckHeaderContext.esm.js";import{useHeader as k}from"../../../SoundcheckHeader/useHeader.esm.js";import{FactCollectionConfig as s}from"../Common/FactCollectionConfig.esm.js";import{defaultCollectorOption as B}from"../Common/CollectorOption.esm.js";import{collectorHeaderContent as D,confirmationModalContent as L}from"../Common/utils.esm.js";import{KubernetesFactDetails as O}from"./KubernetesFactDetails.esm.js";import{mapConfigToKubernetesCollectorConfig as T,defaultKubernetesConfig as H,K8S_COLLECTOR_FIELDS as M,mapKubernetesCollectorConfigToConfig as N}from"./utils.esm.js";import{customResourceFormSchema as P}from"./validation.esm.js";const x=b(o=>({spacer:{height:o.spacing(8),width:"100%"},section:{marginBottom:o.spacing(2)}})),I=({disabled:o,selectedCollector:t})=>{const r=v({defaultValues:t?T(t.config):H(),mode:"onChange",resolver:g(P)}),a=x(),{mutateAsync:c}=K(),[p,f]=R(w),{isValid:u}=r.formState,{showModal:d}=F(),n=async m=>{if(!await d(L(t)))return;const i=N(m);await c({collectorId:t.id,config:i})&&f()};return k(D(t)),e.createElement(e.Fragment,null,e.createElement(E,{className:a.section},e.createElement(h,{...r},e.createElement("form",{onSubmit:r.handleSubmit(n)},Object.entries(M).map(([m,i],l,C)=>e.createElement("div",{key:l},e.createElement(s,{name:m,label:i.label,description:i.description,disabled:o}),l<C.length-1&&e.createElement(S,null))),e.createElement(s,{name:"customResources",label:"Custom Resources",description:"Collect facts from a kubernetes custom resource associated with an entity.",disabled:o,FactDetailsComponent:O,multipleCollectors:{enable:!0,defaultConfig:B()}})))),e.createElement("div",{className:a.section},e.createElement(y,{onCancel:p,saveButtonText:"Save",isLoading:!1,onSave:r.handleSubmit(n),disableSave:!u})))};export{I as KubernetesConfigurator};
2
2
  //# sourceMappingURL=KubernetesConfigurator.esm.js.map
@@ -1,2 +1,2 @@
1
- import{asArray as _}from"@spotify/backstage-plugin-soundcheck-common";import{mapToCacheConfig as p,mapCacheConfigToHumanDurationOrBoolean as f}from"../../../CacheConfig/utils.esm.js";import"../../../CacheConfig/CacheConfigComponent.esm.js";import{mapCatalogFilterToFilters as d,mapFiltersToCatalogFilter as m}from"../../../Filter/utils.esm.js";import"../../../Filter/FilterComponent.esm.js";import"../../../Frequency/types.esm.js";import{mapHumanDurationOrCronToFrequency as y,mapFrequencyToHumanDurationOrCron as b}from"../../../Frequency/util.esm.js";import"../../../Frequency/FrequencyComponent.esm.js";import{defaultCollectorOption as c}from"../Common/CollectorOption.esm.js";import{K8S_CUSTOM_RESOURCE as C}from"./types.esm.js";const l={pods:{type:"k8s_pods",label:"Pods",description:"Collects details about kubernetes pods associated with an entity."},services:{type:"k8s_services",label:"Services",description:"Collects details about kubernetes services associated with an entity."},deployments:{type:"k8s_deployments",label:"Deployments",description:"Collects details about kubernetes deployments associated with an entity."},hpas:{type:"k8s_hpas",label:"Horizontal Pod Autoscalers",description:"Collects details about kubernetes horizontal pod autoscalers associated with an entity."},statefulSets:{type:"k8s_stateful_sets",label:"Stateful Sets",description:"Collects details about kubernetes stateful sets associated with an entity."},podDisruptionBudgets:{type:"k8s_pod_disruption_budgets",label:"Pod Disruption Budgets",description:"Collects details about kubernetes pod disruption budgets associated with an entity."},ingresses:{type:"k8s_ingresses",label:"Ingresses",description:"Collects details about kubernetes ingresses associated with an entity."}},u={...c(),factDetails:{factName:"custom-resource",customResource:{group:"",plural:"",apiVersion:""}}},h=()=>({pods:c(),services:c(),deployments:c(),hpas:c(),statefulSets:c(),podDisruptionBudgets:c(),ingresses:c(),customResources:{enabled:!1,collectors:[u]}});function O(t){if(Object.values(t).some(o=>o.enabled)){const o={},a=[];return o.collects=a,Object.entries(t).forEach(([r,i])=>{if(r==="customResources"&&i.enabled){const e=i.collectors?.map(s=>({type:C,factName:s.factDetails.factName,customResource:s.factDetails.customResource,frequency:b(s.frequency),filter:m(s.filters),cache:f(s.cacheConfig)}))??[];a.push(...e)}else if(i.enabled){const{cacheConfig:e,frequency:s,filters:n}=i;a.push({type:l[r].type,frequency:b(s),filter:m(n),cache:f(e)})}}),o}return{collects:[]}}function k(t){const o=h();if(t){const a=[],r=t.collects;if(r){for(const e of _(r)){const s=e.type;if(e.type===C){const n={enabled:!0,frequency:y(e.frequency??t.frequency),filters:d(e.filter??t.filter),cacheConfig:p(e.cache??t.cache),factDetails:{factName:e.factName,customResource:e.customResource}};a.push(n);continue}Object.entries(l).map(([n,g])=>{s===g.type&&(o[n]={enabled:!0,frequency:y(e.frequency??t.frequency),filters:d(e.filter??t.filter),cacheConfig:p(e.cache??t.cache)})})}const i=a.length>0;o.customResources={enabled:i,collectors:i?a:[u]}}}return o}export{u as DEFAULT_CUSTOM_RESOURCE_OPTION,l as K8S_COLLECTOR_FIELDS,h as defaultKubernetesConfig,k as mapConfigToKubernetesCollectorConfig,O as mapKubernetesCollectorConfigToConfig};
1
+ import{asArray as g}from"@spotify/backstage-plugin-soundcheck-common";import{defaultCollectorOption as s}from"../Common/CollectorOption.esm.js";import{mapBackendConfigToFormIntegrationConfig as u,mapFormIntegrationConfigToBackendConfig as d}from"../Common/utils.esm.js";import{K8S_CUSTOM_RESOURCE as f}from"./types.esm.js";const r={pods:{type:"k8s_pods",label:"Pods",description:"Collects details about kubernetes pods associated with an entity."},services:{type:"k8s_services",label:"Services",description:"Collects details about kubernetes services associated with an entity."},deployments:{type:"k8s_deployments",label:"Deployments",description:"Collects details about kubernetes deployments associated with an entity."},hpas:{type:"k8s_hpas",label:"Horizontal Pod Autoscalers",description:"Collects details about kubernetes horizontal pod autoscalers associated with an entity."},statefulSets:{type:"k8s_stateful_sets",label:"Stateful Sets",description:"Collects details about kubernetes stateful sets associated with an entity."},podDisruptionBudgets:{type:"k8s_pod_disruption_budgets",label:"Pod Disruption Budgets",description:"Collects details about kubernetes pod disruption budgets associated with an entity."},ingresses:{type:"k8s_ingresses",label:"Ingresses",description:"Collects details about kubernetes ingresses associated with an entity."}},p={...s(),factDetails:{factName:"custom-resource",customResource:{group:"",plural:"",apiVersion:""}}},m=()=>({pods:s(),services:s(),deployments:s(),hpas:s(),statefulSets:s(),podDisruptionBudgets:s(),ingresses:s(),customResources:{enabled:!1,collectors:[p]}});function C(o){if(Object.values(o).some(e=>e.enabled)){const e={},a=[];return e.collects=a,Object.entries(o).forEach(([i,n])=>{if(i==="customResources"&&n.enabled){const t=n.collectors?.map(c=>d({factType:f,configOption:c,additionalParams:{factName:c.factDetails.factName,customResource:c.factDetails.customResource}}))??[];a.push(...t)}else n.enabled&&a.push(d({factType:r[i].type,configOption:n}))}),e}return{collects:[]}}function y(o){const e=m();if(o){const a=[],i=o.collects;if(i){for(const t of g(i)){const c=t.type;if(t.type===f){const l={...u({parentConfig:o,factTypeConfig:t}),factDetails:{factName:t.factName,customResource:t.customResource},enabled:!0};a.push(l);continue}Object.entries(r).map(([l,b])=>{c===b.type&&(e[l]={...u({parentConfig:o,factTypeConfig:t}),enabled:!0})})}const n=a.length>0;e.customResources={enabled:n,collectors:n?a:[p]}}}return e}export{p as DEFAULT_CUSTOM_RESOURCE_OPTION,r as K8S_COLLECTOR_FIELDS,m as defaultKubernetesConfig,y as mapConfigToKubernetesCollectorConfig,C as mapKubernetesCollectorConfigToConfig};
2
2
  //# sourceMappingURL=utils.esm.js.map
@@ -1,2 +1,2 @@
1
- import{makeStyles as h,Paper as S,Divider as m}from"@material-ui/core";import e from"react";import{useForm as b,FormProvider as w}from"react-hook-form";import"@backstage/catalog-model";import"@backstage/core-plugin-api";import"@tanstack/react-query";import"../../../../api.esm.js";import"../../../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"../../../../hooks/useSoundcheckAlert.esm.js";import{useConfirmationModal as E}from"../../../../hooks/useConfirmationModal.esm.js";import{useNavigateBack as y}from"../../../../hooks/useNavigateBack.esm.js";import{useUpdateCollectorConfig as N}from"../../../../hooks/collectors/useUpdateCollectorConfig.esm.js";import{integrationsPageRouteRef as R}from"../../../../routes.esm.js";import{FooterButtons as v}from"../../../FooterButtons/FooterButtons.esm.js";import"../../../SoundcheckHeader/SoundcheckHeader.esm.js";import"../../../SoundcheckHeader/SoundcheckHeaderContext.esm.js";import{useHeader as B}from"../../../SoundcheckHeader/useHeader.esm.js";import{FactCollectionConfig as r}from"../Common/FactCollectionConfig.esm.js";import{collectorHeaderContent as F,confirmationModalContent as P}from"../Common/utils.esm.js";import{mapConfigToNewRelicCollectorConfig as T,defaultNewRelicConfig as M,mapNewRelicCollectorConfigToConfig as k}from"./utils.esm.js";const x=h(t=>({spacer:{height:t.spacing(8),width:"100%"},section:{marginBottom:t.spacing(2)},form:{marginBottom:t.spacing(2)}})),H=({disabled:t,selectedCollector:o})=>{const a=b({defaultValues:o?T(o.config):M(),mode:"onChange"}),{formState:{errors:i},handleSubmit:n}=a,l=x(),s=!!i.entity||!!i.entitySearch||!!i.policiesSearch,{mutateAsync:p}=N(),[f,d]=y(R),{showModal:u}=E(),c=async g=>{if(!await u(P(o)))return;const C=k(g);await p({collectorId:o.id,config:C})&&d()};return B(F(o)),e.createElement(e.Fragment,null,e.createElement(S,{className:l.form},e.createElement(w,{...a},e.createElement("form",{onSubmit:n(c)},e.createElement(r,{name:"entity",label:"Entity",description:"Collects details about New Relic entity with a specific id.",disabled:t}),e.createElement(m,null),e.createElement(r,{name:"entitySearch",label:"Entity Search",description:"Collects details about New Relic entities with a specific tag.",disabled:t}),e.createElement(m,null),e.createElement(r,{name:"policiesSearch",label:"Policies Search",description:"Collects details about New Relic policies for a specific account.",disabled:t})))),e.createElement("div",{className:l.section},e.createElement(v,{onCancel:f,saveButtonText:"Save",isLoading:!1,onSave:n(c),disableSave:s})))};export{H as NewRelicConfigurator};
1
+ import{makeStyles as h,Paper as S,Divider as m}from"@material-ui/core";import e from"react";import{useForm as b,FormProvider as w}from"react-hook-form";import"@backstage/catalog-model";import"@backstage/core-plugin-api";import"@tanstack/react-query";import"../../../../api.esm.js";import"../../../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"@spotify/backstage-plugin-soundcheck-common";import"../../../../hooks/useSoundcheckAlert.esm.js";import{useConfirmationModal as E}from"../../../../hooks/useConfirmationModal.esm.js";import{useNavigateBack as y}from"../../../../hooks/useNavigateBack.esm.js";import{useUpdateCollectorConfig as N}from"../../../../hooks/collectors/useUpdateCollectorConfig.esm.js";import{integrationsPageRouteRef as R}from"../../../../routes.esm.js";import{FooterButtons as v}from"../../../FooterButtons/FooterButtons.esm.js";import"../../../SoundcheckHeader/SoundcheckHeader.esm.js";import"../../../SoundcheckHeader/SoundcheckHeaderContext.esm.js";import{useHeader as B}from"../../../SoundcheckHeader/useHeader.esm.js";import{FactCollectionConfig as r}from"../Common/FactCollectionConfig.esm.js";import{collectorHeaderContent as F,confirmationModalContent as P}from"../Common/utils.esm.js";import{mapConfigToNewRelicCollectorConfig as T,defaultNewRelicConfig as M,mapNewRelicCollectorConfigToConfig as k}from"./utils.esm.js";const x=h(t=>({spacer:{height:t.spacing(8),width:"100%"},section:{marginBottom:t.spacing(2)},form:{marginBottom:t.spacing(2)}})),H=({disabled:t,selectedCollector:o})=>{const a=b({defaultValues:o?T(o.config):M(),mode:"onChange"}),{formState:{errors:i},handleSubmit:n}=a,l=x(),s=!!i.entity||!!i.entitySearch||!!i.policiesSearch,{mutateAsync:p}=N(),[f,d]=y(R),{showModal:u}=E(),c=async g=>{if(!await u(P(o)))return;const C=k(g);await p({collectorId:o.id,config:C})&&d()};return B(F(o)),e.createElement(e.Fragment,null,e.createElement(S,{className:l.form},e.createElement(w,{...a},e.createElement("form",{onSubmit:n(c)},e.createElement(r,{name:"entity",label:"Entity",description:"Collects details about New Relic entity with a specific id.",disabled:t}),e.createElement(m,null),e.createElement(r,{name:"entitySearch",label:"Entity Search",description:"Collects details about New Relic entities with a specific tag.",disabled:t}),e.createElement(m,null),e.createElement(r,{name:"policiesSearch",label:"Policies Search",description:"Collects details about New Relic policies for a specific account.",disabled:t})))),e.createElement("div",{className:l.section},e.createElement(v,{onCancel:f,saveButtonText:"Save",isLoading:!1,onSave:n(c),disableSave:s})))};export{H as NewRelicConfigurator};
2
2
  //# sourceMappingURL=NewRelicConfigurator.esm.js.map
@@ -1,2 +1,2 @@
1
- import{asArray as d}from"@spotify/backstage-plugin-soundcheck-common";import{mapToCacheConfig as l,mapCacheConfigToHumanDurationOrBoolean as u}from"../../../CacheConfig/utils.esm.js";import"../../../CacheConfig/CacheConfigComponent.esm.js";import{mapCatalogFilterToFilters as s,mapFiltersToCatalogFilter as C}from"../../../Filter/utils.esm.js";import"../../../Filter/FilterComponent.esm.js";import"../../../Frequency/types.esm.js";import{mapHumanDurationOrCronToFrequency as p,mapFrequencyToHumanDurationOrCron as y}from"../../../Frequency/util.esm.js";import"../../../Frequency/FrequencyComponent.esm.js";import{defaultCollectorOption as h}from"../Common/CollectorOption.esm.js";const m="entity",T="entity-search",q="policies-search",g=()=>({entity:h(),entitySearch:h(),policiesSearch:h()});function E(c){const{entity:r,entitySearch:n,policiesSearch:e}=c;if(r.enabled||n.enabled||e.enabled){const i={},a=[];if(i.collects=a,r.enabled){const{cacheConfig:o,frequency:t,filters:f}=r;a.push({type:m,frequency:y(t),filter:C(f),cache:u(o)})}if(n.enabled){const{cacheConfig:o,frequency:t,filters:f}=n;a.push({type:T,frequency:y(t),filter:C(f),cache:u(o)})}if(e.enabled){const{cacheConfig:o,frequency:t,filters:f}=e;a.push({type:q,frequency:y(t),filter:C(f),cache:u(o)})}return i}return{collects:[]}}function O(c){const r=g();if(c){const n=c.collects;if(n)for(const e of d(n)){const i=e.type;i===m&&(r.entity={enabled:!0,frequency:p(e.frequency??c.frequency),filters:s(e.filter??c.filter),cacheConfig:l(e.cache??c.cache)}),i===T&&(r.entitySearch={enabled:!0,frequency:p(e.frequency??c.frequency),filters:s(e.filter??c.filter),cacheConfig:l(e.cache??c.cache)}),i===q&&(r.policiesSearch={enabled:!0,frequency:p(e.frequency??c.frequency),filters:s(e.filter??c.filter),cacheConfig:l(e.cache??c.cache)})}}return r}export{m as ENTITY_COLLECTOR_TYPE,T as ENTITY_SEARCH_COLLECTOR_TYPE,q as POLICIES_SEARCH_COLLECTOR_TYPE,g as defaultNewRelicConfig,O as mapConfigToNewRelicCollectorConfig,E as mapNewRelicCollectorConfigToConfig};
1
+ import{asArray as s}from"@spotify/backstage-plugin-soundcheck-common";import{defaultCollectorOption as a}from"../Common/CollectorOption.esm.js";import{mapBackendConfigToFormIntegrationConfig as T,mapFormIntegrationConfigToBackendConfig as r}from"../Common/utils.esm.js";const f="entity",l="entity-search",p="policies-search",C=()=>({entity:a(),entitySearch:a(),policiesSearch:a()});function g(c){const{entity:e,entitySearch:n,policiesSearch:t}=c;if(e.enabled||n.enabled||t.enabled){const i={},o=[];return i.collects=o,e.enabled&&o.push(r({factType:f,configOption:e})),n.enabled&&o.push(r({factType:l,configOption:n})),t.enabled&&o.push(r({factType:p,configOption:t})),i}return{collects:[]}}function y(c){const e=C();if(c){const n=c.collects;if(n)for(const t of s(n)){const i=t.type,o={...T({parentConfig:c,factTypeConfig:t}),enabled:!0};i===f&&(e.entity=o),i===l&&(e.entitySearch=o),i===p&&(e.policiesSearch=o)}}return e}export{f as ENTITY_COLLECTOR_TYPE,l as ENTITY_SEARCH_COLLECTOR_TYPE,p as POLICIES_SEARCH_COLLECTOR_TYPE,C as defaultNewRelicConfig,y as mapConfigToNewRelicCollectorConfig,g as mapNewRelicCollectorConfigToConfig};
2
2
  //# sourceMappingURL=utils.esm.js.map
@@ -1,2 +1,2 @@
1
- import{zodResolver as E}from"@hookform/resolvers/zod";import{makeStyles as v,Paper as S,Divider as s}from"@material-ui/core";import e from"react";import{useForm as b,FormProvider as y}from"react-hook-form";import"@backstage/catalog-model";import"@backstage/core-plugin-api";import"@tanstack/react-query";import"../../../../api.esm.js";import"../../../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"../../../../hooks/useSoundcheckAlert.esm.js";import{useConfirmationModal as D}from"../../../../hooks/useConfirmationModal.esm.js";import{useNavigateBack as P}from"../../../../hooks/useNavigateBack.esm.js";import{useUpdateCollectorConfig as T}from"../../../../hooks/collectors/useUpdateCollectorConfig.esm.js";import{integrationsPageRouteRef as L}from"../../../../routes.esm.js";import{FooterButtons as h}from"../../../FooterButtons/FooterButtons.esm.js";import"../../../SoundcheckHeader/SoundcheckHeader.esm.js";import"../../../SoundcheckHeader/SoundcheckHeaderContext.esm.js";import{useHeader as w}from"../../../SoundcheckHeader/useHeader.esm.js";import{FactCollectionConfig as a}from"../Common/FactCollectionConfig.esm.js";import{collectorHeaderContent as F,confirmationModalContent as R}from"../Common/utils.esm.js";import{IncidentsFactDetailsComponent as I}from"./IncidentsFactDetailsComponent.esm.js";import{mapConfigToPagerDutyCollectorConfig as N,defaultPagerDutyConfig as O,SERVICE_COLLECTOR_TYPE as _,STANDARDS_COLLECTOR_TYPE as k,INCIDENTS_COLLECTOR_TYPE as B,incidentsCollectorConfig as A,mapPagerDutyCollectorConfigToConfig as M}from"./utils.esm.js";import{pagerDutyCollectorFormSchema as Y}from"./validation.esm.js";const x=v(t=>({spacer:{height:t.spacing(8),width:"100%"},section:{marginBottom:t.spacing(2)}})),H=({disabled:t,selectedCollector:o})=>{const i=b({defaultValues:o?N(o.config):O(),mode:"onChange",resolver:E(Y)}),{formState:{errors:r},handleSubmit:n}=i,l=x(),c=!!r.service||!!r.standards||!!r.incidents,{mutateAsync:d}=T(),[p,C]=P(L),{showModal:f}=D(),m=async u=>{if(!await f(R(o)))return;const g=M(u);await d({collectorId:o.id,config:g})&&C()};return w(F(o)),e.createElement(e.Fragment,null,e.createElement(S,{className:l.section},e.createElement(y,{...i},e.createElement("form",{onSubmit:n(m)},e.createElement(a,{name:_.toLowerCase(),label:"Service",description:"Collects details about PagerDuty service linked to an entity.",disabled:t}),e.createElement(s,null),e.createElement(a,{name:k.toLowerCase(),label:"Standards",description:"Collects details about standards applied to a PagerDuty service linked to an entity.",disabled:t}),e.createElement(s,null),e.createElement(a,{name:B.toLowerCase(),label:"Incidents",description:"Collects details about incidents associated with a PagerDuty service linked to an entity.",disabled:t,FactDetailsComponent:I,multipleCollectors:{enable:!0,defaultConfig:A()}})))),e.createElement("div",{className:l.section},e.createElement(h,{onCancel:p,saveButtonText:"Save",isLoading:!1,onSave:n(m),disableSave:c})))};export{H as PagerDutyConfigurator};
1
+ import{zodResolver as E}from"@hookform/resolvers/zod";import{makeStyles as v,Paper as S,Divider as s}from"@material-ui/core";import e from"react";import{useForm as b,FormProvider as y}from"react-hook-form";import"@backstage/catalog-model";import"@backstage/core-plugin-api";import"@tanstack/react-query";import"../../../../api.esm.js";import"../../../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"@spotify/backstage-plugin-soundcheck-common";import"../../../../hooks/useSoundcheckAlert.esm.js";import{useConfirmationModal as D}from"../../../../hooks/useConfirmationModal.esm.js";import{useNavigateBack as P}from"../../../../hooks/useNavigateBack.esm.js";import{useUpdateCollectorConfig as T}from"../../../../hooks/collectors/useUpdateCollectorConfig.esm.js";import{integrationsPageRouteRef as L}from"../../../../routes.esm.js";import{FooterButtons as h}from"../../../FooterButtons/FooterButtons.esm.js";import"../../../SoundcheckHeader/SoundcheckHeader.esm.js";import"../../../SoundcheckHeader/SoundcheckHeaderContext.esm.js";import{useHeader as w}from"../../../SoundcheckHeader/useHeader.esm.js";import{FactCollectionConfig as a}from"../Common/FactCollectionConfig.esm.js";import{collectorHeaderContent as F,confirmationModalContent as R}from"../Common/utils.esm.js";import{IncidentsFactDetailsComponent as I}from"./IncidentsFactDetailsComponent.esm.js";import{mapConfigToPagerDutyCollectorConfig as N,defaultPagerDutyConfig as O,SERVICE_COLLECTOR_TYPE as _,STANDARDS_COLLECTOR_TYPE as k,INCIDENTS_COLLECTOR_TYPE as B,incidentsCollectorConfig as A,mapPagerDutyCollectorConfigToConfig as M}from"./utils.esm.js";import{pagerDutyCollectorFormSchema as Y}from"./validation.esm.js";const x=v(t=>({spacer:{height:t.spacing(8),width:"100%"},section:{marginBottom:t.spacing(2)}})),H=({disabled:t,selectedCollector:o})=>{const i=b({defaultValues:o?N(o.config):O(),mode:"onChange",resolver:E(Y)}),{formState:{errors:r},handleSubmit:n}=i,l=x(),c=!!r.service||!!r.standards||!!r.incidents,{mutateAsync:d}=T(),[p,C]=P(L),{showModal:f}=D(),m=async u=>{if(!await f(R(o)))return;const g=M(u);await d({collectorId:o.id,config:g})&&C()};return w(F(o)),e.createElement(e.Fragment,null,e.createElement(S,{className:l.section},e.createElement(y,{...i},e.createElement("form",{onSubmit:n(m)},e.createElement(a,{name:_.toLowerCase(),label:"Service",description:"Collects details about PagerDuty service linked to an entity.",disabled:t}),e.createElement(s,null),e.createElement(a,{name:k.toLowerCase(),label:"Standards",description:"Collects details about standards applied to a PagerDuty service linked to an entity.",disabled:t}),e.createElement(s,null),e.createElement(a,{name:B.toLowerCase(),label:"Incidents",description:"Collects details about incidents associated with a PagerDuty service linked to an entity.",disabled:t,FactDetailsComponent:I,multipleCollectors:{enable:!0,defaultConfig:A()}})))),e.createElement("div",{className:l.section},e.createElement(h,{onCancel:p,saveButtonText:"Save",isLoading:!1,onSave:n(m),disableSave:c})))};export{H as PagerDutyConfigurator};
2
2
  //# sourceMappingURL=PagerDutyConfigurator.esm.js.map
@@ -1,2 +1,2 @@
1
- import{asArray as E}from"@spotify/backstage-plugin-soundcheck-common";import{mapToCacheConfig as f,mapCacheConfigToHumanDurationOrBoolean as u}from"../../../CacheConfig/utils.esm.js";import"../../../CacheConfig/CacheConfigComponent.esm.js";import{mapCatalogFilterToFilters as d,mapFiltersToCatalogFilter as g}from"../../../Filter/utils.esm.js";import"../../../Filter/FilterComponent.esm.js";import"../../../Frequency/types.esm.js";import{mapHumanDurationOrCronToFrequency as m,mapFrequencyToHumanDurationOrCron as C}from"../../../Frequency/util.esm.js";import"../../../Frequency/FrequencyComponent.esm.js";import{defaultBaseCollectorOption as O,defaultCollectorOption as y}from"../Common/CollectorOption.esm.js";const p="Service",h="Standards",l="Incidents",T={triggered:!0,acknowledged:!0,resolved:!0},N={factDetails:{factName:{name:"Fact Name",helperText:"Fact name must be unique",placeholder:"Fact Name"},statuses:{name:"Statuses",description:"Return only incidents with the given statuses",helperText:"Select at least one status"}}},q=(t,a)=>({...O(),factDetails:{factName:t??"",statuses:{triggered:a?.triggered??!1,acknowledged:a?.acknowledged??!1,resolved:a?.resolved??!1}}}),D=()=>({service:y(),standards:y(),incidents:{enabled:!1,collectors:[q(l.toLowerCase(),T)]}});function b(t){const{service:a,standards:o,incidents:n}=t;if(a.enabled||o.enabled||n.enabled){const s={},r=[];if(s.collects=r,a.enabled){const{cacheConfig:c,frequency:e,filters:i}=a;r.push({type:p,frequency:C(e),filter:g(i),cache:u(c)})}if(o.enabled){const{cacheConfig:c,frequency:e,filters:i}=o;r.push({type:h,frequency:C(e),filter:g(i),cache:u(c)})}return n.enabled&&n.collectors.forEach(c=>{r.push({factName:c.factDetails.factName,type:l,statuses:Object.entries(c.factDetails.statuses).filter(([e,i])=>i).map(([e,i])=>e),frequency:C(c.frequency),filter:g(c.filters),cache:u(c.cacheConfig)})}),s}return{collects:[]}}function S(t){const a=D();if(t){const o=t.collects;if(o){const n=E(o),s=n.find(e=>e.type===p);s&&(a.service={enabled:!0,frequency:m(s.frequency??t.frequency),filters:d(s.filter??t.filter),cacheConfig:f(s.cache??t.cache)});const r=n.find(e=>e.type===h);r&&(a.standards={enabled:!0,frequency:m(r.frequency??t.frequency),filters:d(r.filter??t.filter),cacheConfig:f(r.cache??t.cache)});const c=n.filter(e=>e.type===l);c.length&&(a.incidents={enabled:!0,collectors:c.map(e=>({factDetails:{factName:e.factName??l,statuses:{triggered:e.statuses?.length?e.statuses.includes("triggered"):!0,acknowledged:e.statuses?.length?e.statuses.includes("acknowledged"):!0,resolved:e.statuses?.length?e.statuses.includes("resolved"):!0}},frequency:m(e.frequency??t.frequency),filters:d(e.filter??t.filter),cacheConfig:f(e.cache??t.cache)}))})}}return a}export{T as DEFAULT_INCIDENT_STATUSES,l as INCIDENTS_COLLECTOR_TYPE,N as PAGERDUTY_COLLECTOR_FIELDS,p as SERVICE_COLLECTOR_TYPE,h as STANDARDS_COLLECTOR_TYPE,D as defaultPagerDutyConfig,q as incidentsCollectorConfig,S as mapConfigToPagerDutyCollectorConfig,b as mapPagerDutyCollectorConfigToConfig};
1
+ import{asArray as E}from"@spotify/backstage-plugin-soundcheck-common";import{defaultBaseCollectorOption as D,defaultCollectorOption as p}from"../Common/CollectorOption.esm.js";import{mapBackendConfigToFormIntegrationConfig as r,mapFormIntegrationConfigToBackendConfig as d}from"../Common/utils.esm.js";const f="Service",g="Standards",l="Incidents",C={triggered:!0,acknowledged:!0,resolved:!0},y={factDetails:{factName:{name:"Fact Name",helperText:"Fact name must be unique",placeholder:"Fact Name"},statuses:{name:"Statuses",description:"Return only incidents with the given statuses",helperText:"Select at least one status"}}},m=(a,t)=>({...D(),factDetails:{factName:a??"",statuses:{triggered:t?.triggered??!1,acknowledged:t?.acknowledged??!1,resolved:t?.resolved??!1}}}),T=()=>({service:p(),standards:p(),incidents:{enabled:!1,collectors:[m(l.toLowerCase(),C)]}});function O(a){const{service:t,standards:o,incidents:s}=a;if(t.enabled||o.enabled||s.enabled){const c={},n=[];return c.collects=n,t.enabled&&n.push(d({factType:f,configOption:t})),o.enabled&&n.push(d({factType:g,configOption:o})),s.enabled&&s.collectors.forEach(i=>{n.push(d({factType:l,configOption:i,additionalParams:{factName:i.factDetails.factName,statuses:Object.entries(i.factDetails.statuses).filter(([e,u])=>u).map(([e,u])=>e)}}))}),c}return{collects:[]}}function h(a){const t=T();if(a){const o=a.collects;if(o){const s=E(o),c=s.find(e=>e.type===f);c&&(t.service={...r({parentConfig:a,factTypeConfig:c}),enabled:!0});const n=s.find(e=>e.type===g);n&&(t.standards={...r({parentConfig:a,factTypeConfig:n}),enabled:!0});const i=s.filter(e=>e.type===l);i.length&&(t.incidents={enabled:!0,collectors:i.map(e=>({...r({parentConfig:a,factTypeConfig:e}),factDetails:{factName:e.factName??l,statuses:{triggered:e.statuses?.length?e.statuses.includes("triggered"):!0,acknowledged:e.statuses?.length?e.statuses.includes("acknowledged"):!0,resolved:e.statuses?.length?e.statuses.includes("resolved"):!0}}}))})}}return t}export{C as DEFAULT_INCIDENT_STATUSES,l as INCIDENTS_COLLECTOR_TYPE,y as PAGERDUTY_COLLECTOR_FIELDS,f as SERVICE_COLLECTOR_TYPE,g as STANDARDS_COLLECTOR_TYPE,T as defaultPagerDutyConfig,m as incidentsCollectorConfig,h as mapConfigToPagerDutyCollectorConfig,O as mapPagerDutyCollectorConfigToConfig};
2
2
  //# sourceMappingURL=utils.esm.js.map
@@ -1,2 +1,2 @@
1
- import{makeStyles as T,Box as $,Typography as u,Divider as B,Grid as s,Tabs as L,Tab as d,Button as C}from"@material-ui/core";import v from"@material-ui/icons/Add";import O from"@material-ui/icons/Remove";import e,{useState as R}from"react";import{useFieldArray as S,Controller as f}from"react-hook-form";import"lodash";import"../../../Frequency/types.esm.js";import"../../../Frequency/util.esm.js";import{FrequencyComponent as _}from"../../../Frequency/FrequencyComponent.esm.js";import{CacheConfigComponent as k}from"../../../CacheConfig/CacheConfigComponent.esm.js";import"@spotify/backstage-plugin-soundcheck-common";import{FilterComponent as A}from"../../../Filter/FilterComponent.esm.js";import{ExistsFactDetailsComponent as I}from"./ExistsFactDetailsComponent.esm.js";import{JsonFactDetailsComponent as q}from"./JsonFactDetailsComponent.esm.js";import{RegexFactDetailsComponent as z}from"./RegexFactDetailsComponent.esm.js";import{EXISTS_COLLECTOR_TYPE as P,REGEX_COLLECTOR_TYPE as Y,JSON_COLLECTOR_TYPE as G,defaultCollectorConfig as J}from"./utils.esm.js";const X=T(a=>({root:{padding:a.spacing(1,3)},collectorDivider:{marginTop:a.spacing(1)},collectorContainer:{display:"flex",alignItems:"flex-start",paddingBottom:a.spacing(2)},tabsContainer:{marginRight:16},tab:{height:"64px",textAlign:"left"},tabsContentContainer:{width:"100%",padding:a.spacing(1,1,2,1)},addCollectorButton:{margin:a.spacing(2,0)},collectorButtons:{paddingLeft:a.spacing(1)}})),j=({name:a,label:g,description:h,control:i,disabled:c,errors:m})=>{const n=X(),{fields:p,insert:y,remove:D}=S({control:i,name:`${a}.collectors`}),[o,E]=R(Array(p.length).fill(0)),x=(r,t,l)=>{E([...o.slice(0,l),t,...o.slice(l+1)])},b=r=>{y(r+1,J(a)),E([...o.slice(0,r+1),0,...o.slice(r+1)])},F=r=>{D(r),E([...o.slice(0,r),...o.slice(r+1)])};return e.createElement("div",{className:n.root},e.createElement($,{display:"flex",flexDirection:"column"},e.createElement(u,{variant:"body1",component:"span"},e.createElement("b",null,`${g}`)),e.createElement(u,{variant:"caption",color:"textSecondary",component:"p"},`${h}`)),e.createElement(e.Fragment,null,p.map((r,t)=>e.createElement("div",{key:r.id},t!==0&&e.createElement(B,{className:n.collectorDivider}),e.createElement(s,{container:!0,spacing:0,direction:"column",className:n.collectorContainer},e.createElement(s,{item:!0},e.createElement(L,{orientation:"horizontal",variant:"scrollable",value:o[t],onChange:(l,N)=>x(l,N,t),className:n.tabsContainer},e.createElement(d,{label:"Fact Details",className:n.tab}),e.createElement(d,{label:"Frequency",className:n.tab}),e.createElement(d,{label:"Filters",className:n.tab}),e.createElement(d,{label:"Caching",className:n.tab})),e.createElement("div",{className:n.tabsContentContainer},o[t]===0&&a===P&&e.createElement(I,{name:`${a}.collectors.${t}.factDetails`,control:i,disabled:c,errors:m?.collectors?.[t]?.factDetails}),o[t]===0&&a===Y&&e.createElement(z,{name:`${a}.collectors.${t}.factDetails`,control:i,disabled:c,errors:m?.collectors?.[t]?.factDetails}),o[t]===0&&a===G&&e.createElement(q,{name:`${a}.collectors.${t}.factDetails`,control:i,disabled:c,errors:m?.collectors?.[t]?.factDetails}),o[t]===1&&e.createElement(f,{name:`${a}.collectors.${t}.frequency`,control:i,render:({field:l})=>e.createElement(_,{disabled:c,value:l.value,onChange:l.onChange,errors:m?.collectors?.[t]?.frequency})}),o[t]===2&&e.createElement(f,{name:`${a}.collectors.${t}.filters`,control:i,render:({field:l})=>e.createElement(A,{disabled:c,value:l.value,onChange:l.onChange})}),o[t]===3&&e.createElement(f,{name:`${a}.collectors.${t}.cacheConfig`,control:i,render:({field:l})=>e.createElement(k,{disabled:c,value:l.value,onChange:l.onChange,errors:m?.collectors?.[t]?.cacheConfig})}))),e.createElement(s,{item:!0,container:!0,spacing:1,className:n.collectorButtons},e.createElement(s,{item:!0},e.createElement(C,{startIcon:e.createElement(O,null),onClick:()=>F(t),disabled:c,variant:"outlined",size:"small",color:"secondary"},"Remove")),e.createElement(s,{item:!0},e.createElement(C,{startIcon:e.createElement(v,null),onClick:()=>b(t),disabled:c,variant:"outlined",size:"small",color:"primary"},"Add ",g))))))),p.length===0&&e.createElement(C,{startIcon:e.createElement(v,null),onClick:()=>b(0),disabled:c,variant:"outlined",size:"small",color:"primary","data-testid":`${a}-add-first`,className:n.addCollectorButton},"Add"))};export{j as FactCollectionConfig};
1
+ import{makeStyles as T,Box as $,Typography as b,Divider as O,Grid as s,Tabs as B,Tab as d,Button as C}from"@material-ui/core";import v from"@material-ui/icons/Add";import L from"@material-ui/icons/Remove";import e,{useState as R}from"react";import{useFieldArray as S,Controller as f}from"react-hook-form";import"lodash";import"../../../Frequency/types.esm.js";import"../../../Frequency/util.esm.js";import{FrequencyComponent as _}from"../../../Frequency/FrequencyComponent.esm.js";import{CacheConfigComponent as k}from"../../../CacheConfig/CacheConfigComponent.esm.js";import"@spotify/backstage-plugin-soundcheck-common";import{FilterComponent as A}from"../../../Filter/FilterComponent.esm.js";import{CollectorSchedulingOptions as I}from"../Common/CollectorSchedulingOptions.esm.js";import{ExistsFactDetailsComponent as q}from"./ExistsFactDetailsComponent.esm.js";import{JsonFactDetailsComponent as z}from"./JsonFactDetailsComponent.esm.js";import{RegexFactDetailsComponent as P}from"./RegexFactDetailsComponent.esm.js";import{EXISTS_COLLECTOR_TYPE as Y,REGEX_COLLECTOR_TYPE as G,JSON_COLLECTOR_TYPE as J,defaultCollectorConfig as X}from"./utils.esm.js";const w=T(a=>({root:{padding:a.spacing(1,3)},collectorDivider:{marginTop:a.spacing(1)},collectorContainer:{display:"flex",alignItems:"flex-start",paddingBottom:a.spacing(2)},tabsContainer:{marginRight:16},tab:{height:"64px",textAlign:"left"},tabsContentContainer:{width:"100%",padding:a.spacing(1,1,2,1)},addCollectorButton:{margin:a.spacing(2,0)},collectorButtons:{paddingLeft:a.spacing(1)}})),H=({name:a,label:g,description:h,control:i,disabled:c,errors:m})=>{const n=w(),{fields:p,insert:y,remove:D}=S({control:i,name:`${a}.collectors`}),[o,E]=R(Array(p.length).fill(0)),F=(r,t,l)=>{E([...o.slice(0,l),t,...o.slice(l+1)])},u=r=>{y(r+1,X(a)),E([...o.slice(0,r+1),0,...o.slice(r+1)])},x=r=>{D(r),E([...o.slice(0,r),...o.slice(r+1)])};return e.createElement("div",{className:n.root},e.createElement($,{display:"flex",flexDirection:"column"},e.createElement(b,{variant:"body1",component:"span"},e.createElement("b",null,`${g}`)),e.createElement(b,{variant:"caption",color:"textSecondary",component:"p"},`${h}`)),e.createElement(e.Fragment,null,p.map((r,t)=>e.createElement("div",{key:r.id},t!==0&&e.createElement(O,{className:n.collectorDivider}),e.createElement(s,{container:!0,spacing:0,direction:"column",className:n.collectorContainer},e.createElement(s,{item:!0},e.createElement(B,{orientation:"horizontal",variant:"scrollable",value:o[t],onChange:(l,N)=>F(l,N,t),className:n.tabsContainer},e.createElement(d,{label:"Fact Details",className:n.tab}),e.createElement(d,{label:"Frequency",className:n.tab}),e.createElement(d,{label:"Filters",className:n.tab}),e.createElement(d,{label:"Caching",className:n.tab})),e.createElement("div",{className:n.tabsContentContainer},o[t]===0&&a===Y&&e.createElement(q,{name:`${a}.collectors.${t}.factDetails`,control:i,disabled:c,errors:m?.collectors?.[t]?.factDetails}),o[t]===0&&a===G&&e.createElement(P,{name:`${a}.collectors.${t}.factDetails`,control:i,disabled:c,errors:m?.collectors?.[t]?.factDetails}),o[t]===0&&a===J&&e.createElement(z,{name:`${a}.collectors.${t}.factDetails`,control:i,disabled:c,errors:m?.collectors?.[t]?.factDetails}),o[t]===1&&e.createElement(e.Fragment,null,e.createElement(f,{name:`${a}.collectors.${t}.frequency`,control:i,render:({field:l})=>e.createElement(_,{disabled:c,value:l.value,onChange:l.onChange,errors:m?.collectors?.[t]?.frequency})}),e.createElement(I,{name:`${a}.collectors.${t}`})),o[t]===2&&e.createElement(f,{name:`${a}.collectors.${t}.filters`,control:i,render:({field:l})=>e.createElement(A,{disabled:c,value:l.value,onChange:l.onChange})}),o[t]===3&&e.createElement(f,{name:`${a}.collectors.${t}.cacheConfig`,control:i,render:({field:l})=>e.createElement(k,{disabled:c,value:l.value,onChange:l.onChange,errors:m?.collectors?.[t]?.cacheConfig})}))),e.createElement(s,{item:!0,container:!0,spacing:1,className:n.collectorButtons},e.createElement(s,{item:!0},e.createElement(C,{startIcon:e.createElement(L,null),onClick:()=>x(t),disabled:c,variant:"outlined",size:"small",color:"secondary"},"Remove")),e.createElement(s,{item:!0},e.createElement(C,{startIcon:e.createElement(v,null),onClick:()=>u(t),disabled:c,variant:"outlined",size:"small",color:"primary"},"Add ",g))))))),p.length===0&&e.createElement(C,{startIcon:e.createElement(v,null),onClick:()=>u(0),disabled:c,variant:"outlined",size:"small",color:"primary","data-testid":`${a}-add-first`,className:n.addCollectorButton},"Add"))};export{H as FactCollectionConfig};
2
2
  //# sourceMappingURL=FactCollectionConfig.esm.js.map
@@ -1,2 +1,2 @@
1
- import{zodResolver as S}from"@hookform/resolvers/zod";import{makeStyles as O,Paper as L,Divider as c}from"@material-ui/core";import e from"react";import{useForm as T,FormProvider as x}from"react-hook-form";import"@backstage/catalog-model";import"@backstage/core-plugin-api";import"@tanstack/react-query";import"../../../../api.esm.js";import"../../../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"../../../../hooks/useSoundcheckAlert.esm.js";import{useConfirmationModal as b}from"../../../../hooks/useConfirmationModal.esm.js";import{useNavigateBack as h}from"../../../../hooks/useNavigateBack.esm.js";import{useUpdateCollectorConfig as v}from"../../../../hooks/collectors/useUpdateCollectorConfig.esm.js";import{integrationsPageRouteRef as y}from"../../../../routes.esm.js";import{FooterButtons as R}from"../../../FooterButtons/FooterButtons.esm.js";import"../../../SoundcheckHeader/SoundcheckHeader.esm.js";import"../../../SoundcheckHeader/SoundcheckHeaderContext.esm.js";import{useHeader as _}from"../../../SoundcheckHeader/useHeader.esm.js";import{collectorHeaderContent as F,confirmationModalContent as N}from"../Common/utils.esm.js";import{FactCollectionConfig as n}from"./FactCollectionConfig.esm.js";import{mapConfigToScmCollectorConfig as M,DEFAULT_SCM_COLLECTOR_CONFIG as P,EXISTS_COLLECTOR_TYPE as w,REGEX_COLLECTOR_TYPE as J,JSON_COLLECTOR_TYPE as Y,mapScmCollectorConfigToConfig as A}from"./utils.esm.js";import{scmCollectorFormSchema as B}from"./validation.esm.js";const I=O(o=>({spacer:{height:o.spacing(8),width:"100%"},section:{marginBottom:o.spacing(2)}})),j=({disabled:o,selectedCollector:r})=>{const a=T({defaultValues:r?M(r.config):P,mode:"onChange",resolver:S(B)}),{control:i,formState:{errors:t},handleSubmit:m}=a,s=I(),p=!!t.exists||!!t.regex||!!t.json,{mutateAsync:f}=v(),[d,C]=h(y),{showModal:g}=b(),l=async E=>{if(!await g(N(r)))return;const u=A(E);await f({collectorId:r.id,config:u})&&C()};return _(F(r)),e.createElement(e.Fragment,null,e.createElement(L,{className:s.section},e.createElement(x,{...a},e.createElement("form",{onSubmit:m(l)},e.createElement(n,{name:w,label:"Exists",description:"Collects information on the existence of files within an entity's repository.",control:i,disabled:o,errors:t.exists}),e.createElement(c,null),e.createElement(n,{name:J,label:"Regex",description:"Executes regular expressions against a specified file in an entity's repository and collects its capture groups.",control:i,disabled:o,errors:t.regex}),e.createElement(c,null),e.createElement(n,{name:Y,label:"JSON / YAML",description:"Collects data from a JSON/YAML file at specified JSON paths in an entity's repository.",control:i,disabled:o,errors:t.json})))),e.createElement("div",{className:s.section},e.createElement(R,{onCancel:d,saveButtonText:"Save",isLoading:!1,onSave:m(l),disableSave:p,noMargin:!0})))};export{j as ScmConfigurator};
1
+ import{zodResolver as S}from"@hookform/resolvers/zod";import{makeStyles as O,Paper as L,Divider as c}from"@material-ui/core";import e from"react";import{useForm as T,FormProvider as x}from"react-hook-form";import"@backstage/catalog-model";import"@backstage/core-plugin-api";import"@tanstack/react-query";import"../../../../api.esm.js";import"../../../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"@spotify/backstage-plugin-soundcheck-common";import"../../../../hooks/useSoundcheckAlert.esm.js";import{useConfirmationModal as b}from"../../../../hooks/useConfirmationModal.esm.js";import{useNavigateBack as h}from"../../../../hooks/useNavigateBack.esm.js";import{useUpdateCollectorConfig as v}from"../../../../hooks/collectors/useUpdateCollectorConfig.esm.js";import{integrationsPageRouteRef as y}from"../../../../routes.esm.js";import{FooterButtons as R}from"../../../FooterButtons/FooterButtons.esm.js";import"../../../SoundcheckHeader/SoundcheckHeader.esm.js";import"../../../SoundcheckHeader/SoundcheckHeaderContext.esm.js";import{useHeader as _}from"../../../SoundcheckHeader/useHeader.esm.js";import{collectorHeaderContent as F,confirmationModalContent as N}from"../Common/utils.esm.js";import{FactCollectionConfig as n}from"./FactCollectionConfig.esm.js";import{mapConfigToScmCollectorConfig as M,DEFAULT_SCM_COLLECTOR_CONFIG as P,EXISTS_COLLECTOR_TYPE as w,REGEX_COLLECTOR_TYPE as J,JSON_COLLECTOR_TYPE as Y,mapScmCollectorConfigToConfig as A}from"./utils.esm.js";import{scmCollectorFormSchema as B}from"./validation.esm.js";const I=O(o=>({spacer:{height:o.spacing(8),width:"100%"},section:{marginBottom:o.spacing(2)}})),j=({disabled:o,selectedCollector:r})=>{const a=T({defaultValues:r?M(r.config):P,mode:"onChange",resolver:S(B)}),{control:i,formState:{errors:t},handleSubmit:m}=a,s=I(),p=!!t.exists||!!t.regex||!!t.json,{mutateAsync:f}=v(),[d,C]=h(y),{showModal:g}=b(),l=async E=>{if(!await g(N(r)))return;const u=A(E);await f({collectorId:r.id,config:u})&&C()};return _(F(r)),e.createElement(e.Fragment,null,e.createElement(L,{className:s.section},e.createElement(x,{...a},e.createElement("form",{onSubmit:m(l)},e.createElement(n,{name:w,label:"Exists",description:"Collects information on the existence of files within an entity's repository.",control:i,disabled:o,errors:t.exists}),e.createElement(c,null),e.createElement(n,{name:J,label:"Regex",description:"Executes regular expressions against a specified file in an entity's repository and collects its capture groups.",control:i,disabled:o,errors:t.regex}),e.createElement(c,null),e.createElement(n,{name:Y,label:"JSON / YAML",description:"Collects data from a JSON/YAML file at specified JSON paths in an entity's repository.",control:i,disabled:o,errors:t.json})))),e.createElement("div",{className:s.section},e.createElement(R,{onCancel:d,saveButtonText:"Save",isLoading:!1,onSave:m(l),disableSave:p,noMargin:!0})))};export{j as ScmConfigurator};
2
2
  //# sourceMappingURL=ScmConfigurator.esm.js.map
@@ -1,2 +1,2 @@
1
- import{asArray as D}from"@spotify/backstage-plugin-soundcheck-common";import{mapToCacheConfig as h,mapCacheConfigToHumanDurationOrBoolean as p,defaultCacheConfig as F}from"../../../CacheConfig/utils.esm.js";import"../../../CacheConfig/CacheConfigComponent.esm.js";import{mapCatalogFilterToFilters as m,mapFiltersToCatalogFilter as u}from"../../../Filter/utils.esm.js";import"../../../Filter/FilterComponent.esm.js";import{emptyFilters as N}from"../../../Filter/types.esm.js";import"../../../Frequency/types.esm.js";import{mapHumanDurationOrCronToFrequency as d,mapFrequencyToHumanDurationOrCron as g,defaultFrequency as _}from"../../../Frequency/util.esm.js";import"../../../Frequency/FrequencyComponent.esm.js";const y={exists:{collectors:[]},regex:{collectors:[]},json:{collectors:[]}},C={name:"",path:""},L={name:"",type:"string"},E={name:"",jsonPath:"",type:"string"},q={factName:"",data:[C]},O={factName:"",path:"",regex:"",data:[]},A={factName:"",path:"",data:[E]},S={factDetails:{factName:{name:"Fact Name",helperText:"Fact name must be unique",placeholder:"Fact Name"},branch:{name:"Custom Branch:",helperText:"If omitted collects data from default branch",placeholder:"Example: develop"},filePath:{name:"File Path",helperText:"Path to the file whose content will be searched",placeholder:"Example: /catalog-info.yaml"},label:{name:"Label",placeholder:"Label"},type:{name:"Type",placeholder:"Type"},exists:{filesSection:{name:"Files",description:"List the files whose existence will be checked"}},regex:{regex:{name:"RegEx",helperText:"Regex to match",placeholder:"Example: ^apiVersion: backstage.io/(.+)"},trueFalseMode:{label:"True / False Mode",description:"True / False Mode uses a RegEx to search for a match in the given file."},captureGroupsMode:{label:"Capture Groups Mode",description:"RegEx Capture Groups Mode allows the collector to associate capture groups within a RegEx to named values."},captureGroupsSection:{name:"Capture Groups",description:"Each element must correspond to a capture group in the given RegEx"}},json:{jsonPath:{name:"Json Path",placeholder:"Example: metadata.tags"},jsonElementsSection:{name:"JSON / YAML Elements",description:"List json / yaml paths from which to pull data from the given file"}}}},i="exists",s="regex",f="json",T=["string","number","integer","boolean","object"],x=T.map(b),P=t=>{let c;switch(t){case i:c=q;break;case s:c=O;break;case f:c=A;break;default:throw Error(`Unsupported fact type ${t}`)}return{factDetails:c,filters:{...N(),selectedKinds:["Component"]},frequency:_(),cacheConfig:F()}};function R(t){const{exists:c,regex:o,json:e}=t;if(c.collectors.length||o.collectors.length||e.collectors.length){const r={},n=[];return r.collects=n,c.collectors.forEach(a=>{n.push({type:i,factName:a.factDetails.factName,branch:a.factDetails.branch?.length?a.factDetails.branch:void 0,data:a.factDetails.data,frequency:g(a.frequency),filter:u(a.filters),cache:p(a.cacheConfig)})}),o.collectors.forEach(a=>{n.push({type:s,factName:a.factDetails.factName,branch:a.factDetails.branch?.length?a.factDetails.branch:void 0,path:a.factDetails.path,regex:a.factDetails.regex,data:a.factDetails.data.length?a.factDetails.data:void 0,frequency:g(a.frequency),filter:u(a.filters),cache:p(a.cacheConfig)})}),e.collectors.forEach(a=>{n.push({type:f,factName:a.factDetails.factName,branch:a.factDetails.branch?.length?a.factDetails.branch:void 0,path:a.factDetails.path,data:a.factDetails.data.map(l=>x.includes(l.type)?{name:l.name,jsonPath:l.jsonPath,type:"array",items:{type:M(l.type)}}:l),frequency:g(a.frequency),filter:u(a.filters),cache:p(a.cacheConfig)})}),r}return[]}function j(t){const c=t?.collects;if(c){const o=D(c);return{exists:{collectors:o.filter(e=>e.type===i).map(e=>({factDetails:{factName:e.factName,branch:e.branch,data:e.data},frequency:d(e.frequency??t.frequency),filters:m(e.filter??t.filter),cacheConfig:h(e.cache)}))},regex:{collectors:o.filter(e=>e.type===s).map(e=>({factDetails:{factName:e.factName,branch:e.branch,path:e.path,regex:e.regex,data:e.data},frequency:d(e.frequency??t.frequency),filters:m(e.filter??t.filter),cacheConfig:h(e.cache)}))},json:{collectors:o.filter(e=>e.type===f).map(e=>({factDetails:{factName:e.factName,branch:e.branch,path:e.path,data:e.data.map(r=>r.type==="array"?{name:r.name,jsonPath:r.jsonPath,type:b(r.items?.type)}:r)},frequency:d(e.frequency??t.frequency),filters:m(e.filter??t.filter),cacheConfig:h(e.cache)}))}}}return y}function b(t){return`array[${t}]`}function M(t){const c="array[";return t.substring(t.indexOf(c)+c.length,t.lastIndexOf("]"))}export{x as ARRAY_ELEMENT_TYPES,C as DEFAULT_EXISTS_FACT_DATA,E as DEFAULT_JSON_FACT_DATA,L as DEFAULT_REGEX_FACT_DATA,y as DEFAULT_SCM_COLLECTOR_CONFIG,T as ELEMENT_TYPES,i as EXISTS_COLLECTOR_TYPE,f as JSON_COLLECTOR_TYPE,s as REGEX_COLLECTOR_TYPE,S as SCM_COLLECTOR_FIELDS,P as defaultCollectorConfig,j as mapConfigToScmCollectorConfig,R as mapScmCollectorConfigToConfig};
1
+ import{asArray as x}from"@spotify/backstage-plugin-soundcheck-common";import{mapCacheConfigToHumanDurationOrBoolean as m,defaultCacheConfig as b}from"../../../CacheConfig/utils.esm.js";import"../../../CacheConfig/CacheConfigComponent.esm.js";import{mapFiltersToCatalogFilter as h}from"../../../Filter/utils.esm.js";import"../../../Filter/FilterComponent.esm.js";import{emptyFilters as D}from"../../../Filter/types.esm.js";import"../../../Frequency/types.esm.js";import{mapFrequencyToHumanDurationOrCron as d,defaultFrequency as F}from"../../../Frequency/util.esm.js";import"../../../Frequency/FrequencyComponent.esm.js";import{mapBackendConfigToFormIntegrationConfig as p,mapFormIntegrationConfigToBackendConfig as N}from"../Common/utils.esm.js";const g={exists:{collectors:[]},regex:{collectors:[]},json:{collectors:[]}},u={name:"",path:""},_={name:"",type:"string"},C={name:"",jsonPath:"",type:"string"},L={factName:"",data:[u]},O={factName:"",path:"",regex:"",data:[]},A={factName:"",path:"",data:[C]},S={factDetails:{factName:{name:"Fact Name",helperText:"Fact name must be unique",placeholder:"Fact Name"},branch:{name:"Custom Branch:",helperText:"If omitted collects data from default branch",placeholder:"Example: develop"},filePath:{name:"File Path",helperText:"Path to the file whose content will be searched",placeholder:"Example: /catalog-info.yaml"},label:{name:"Label",placeholder:"Label"},type:{name:"Type",placeholder:"Type"},exists:{filesSection:{name:"Files",description:"List the files whose existence will be checked"}},regex:{regex:{name:"RegEx",helperText:"Regex to match",placeholder:"Example: ^apiVersion: backstage.io/(.+)"},trueFalseMode:{label:"True / False Mode",description:"True / False Mode uses a RegEx to search for a match in the given file."},captureGroupsMode:{label:"Capture Groups Mode",description:"RegEx Capture Groups Mode allows the collector to associate capture groups within a RegEx to named values."},captureGroupsSection:{name:"Capture Groups",description:"Each element must correspond to a capture group in the given RegEx"}},json:{jsonPath:{name:"Json Path",placeholder:"Example: metadata.tags"},jsonElementsSection:{name:"JSON / YAML Elements",description:"List json / yaml paths from which to pull data from the given file"}}}},i="exists",s="regex",f="json",E=["string","number","integer","boolean","object"],T=E.map(y),P=t=>{let o;switch(t){case i:o=L;break;case s:o=O;break;case f:o=A;break;default:throw Error(`Unsupported fact type ${t}`)}return{factDetails:o,filters:{...D(),selectedKinds:["Component"]},frequency:F(),cacheConfig:b()}};function R(t){const{exists:o,regex:c,json:e}=t;if(o.collectors.length||c.collectors.length||e.collectors.length){const r={},l=[];return r.collects=l,o.collectors.forEach(a=>{l.push(N({factType:i,configOption:a,additionalParams:{factName:a.factDetails.factName,branch:a.factDetails.branch?.length?a.factDetails.branch:void 0,data:a.factDetails.data}}))}),c.collectors.forEach(a=>{l.push({type:s,factName:a.factDetails.factName,branch:a.factDetails.branch?.length?a.factDetails.branch:void 0,path:a.factDetails.path,regex:a.factDetails.regex,data:a.factDetails.data.length?a.factDetails.data:void 0,frequency:d(a.frequency),filter:h(a.filters),cache:m(a.cacheConfig)})}),e.collectors.forEach(a=>{l.push({type:f,factName:a.factDetails.factName,branch:a.factDetails.branch?.length?a.factDetails.branch:void 0,path:a.factDetails.path,data:a.factDetails.data.map(n=>T.includes(n.type)?{name:n.name,jsonPath:n.jsonPath,type:"array",items:{type:M(n.type)}}:n),frequency:d(a.frequency),filter:h(a.filters),cache:m(a.cacheConfig)})}),r}return{collects:[]}}function j(t){const o=t?.collects;if(o){const c=x(o);return{exists:{collectors:c.filter(e=>e.type===i).map(e=>({...p({factTypeConfig:e,parentConfig:t}),factDetails:{factName:e.factName,branch:e.branch,data:e.data}}))},regex:{collectors:c.filter(e=>e.type===s).map(e=>({...p({factTypeConfig:e,parentConfig:t}),factDetails:{factName:e.factName,branch:e.branch,path:e.path,regex:e.regex,data:e.data}}))},json:{collectors:c.filter(e=>e.type===f).map(e=>({...p({factTypeConfig:e,parentConfig:t}),factDetails:{factName:e.factName,branch:e.branch,path:e.path,data:e.data.map(r=>r.type==="array"?{name:r.name,jsonPath:r.jsonPath,type:y(r.items?.type)}:r)}}))}}}return g}function y(t){return`array[${t}]`}function M(t){const o="array[";return t.substring(t.indexOf(o)+o.length,t.lastIndexOf("]"))}export{T as ARRAY_ELEMENT_TYPES,u as DEFAULT_EXISTS_FACT_DATA,C as DEFAULT_JSON_FACT_DATA,_ as DEFAULT_REGEX_FACT_DATA,g as DEFAULT_SCM_COLLECTOR_CONFIG,E as ELEMENT_TYPES,i as EXISTS_COLLECTOR_TYPE,f as JSON_COLLECTOR_TYPE,s as REGEX_COLLECTOR_TYPE,S as SCM_COLLECTOR_FIELDS,P as defaultCollectorConfig,j as mapConfigToScmCollectorConfig,R as mapScmCollectorConfigToConfig};
2
2
  //# sourceMappingURL=utils.esm.js.map
@@ -1,2 +1,2 @@
1
- import{validNameRegex as o}from"@spotify/backstage-plugin-soundcheck-common";import{z as e}from"zod";import{FIELD_IS_REQUIRED_MSG as a,FrequencySchema as h,FiltersSchema as p,CacheConfigSchema as u}from"../../../../utils/validation.esm.js";const n="Fact name is not unique",r="The field contains forbidden characters",i="Max 100 characters",x="Max 1000 characters",f=e.object({factName:e.string().min(1,a).max(100,i).regex(o,r),branch:e.string().optional()}),_=f.merge(e.object({data:e.array(e.strictObject({name:e.string().min(1,a).max(100,i).regex(o,r),path:e.string().min(1,a).max(1e3,x)}))})).strict(),j=f.merge(e.object({path:e.string().min(1,a),regex:e.string().min(1,a),data:e.array(e.strictObject({name:e.string().min(1,a).max(100,i).regex(o,r),type:e.string().min(1,a).max(100,i).regex(o,r).optional()})).optional()})).strict(),N=f.merge(e.object({path:e.string().min(1,a),data:e.array(e.strictObject({name:e.string().min(1,a).regex(o,r),jsonPath:e.string().min(1,a),type:e.string().min(1,a)}))})).strict(),g=s=>e.strictObject({collectors:e.array(e.strictObject({factDetails:s,frequency:h,filters:p,cacheConfig:u}))}),C=e.strictObject({exists:g(_),regex:g(j),json:g(N)}).superRefine((s,l)=>{const d=[...s.exists.collectors.map(t=>t.factDetails.factName),...s.regex.collectors.map(t=>t.factDetails.factName),...s.json.collectors.map(t=>t.factDetails.factName)],m=d.filter((t,c)=>d.indexOf(t)!==c);m.length&&(s.exists.collectors.forEach((t,c)=>{m.includes(t.factDetails.factName)&&l.addIssue({code:e.ZodIssueCode.custom,message:n,path:["exists","collectors",c,"factDetails","factName"]})}),s.regex.collectors.forEach((t,c)=>{m.includes(t.factDetails.factName)&&l.addIssue({code:e.ZodIssueCode.custom,message:n,path:["regex","collectors",c,"factDetails","factName"]})}),s.json.collectors.forEach((t,c)=>{m.includes(t.factDetails.factName)&&l.addIssue({code:e.ZodIssueCode.custom,message:n,path:["json","collectors",c,"factDetails","factName"]})}))});export{n as FACT_NAME_IS_NOT_UNIQUE_MSG,r as INVALID_CHARACTERS_MSG,x as MAX_1000_CHARACTERS_MSG,i as MAX_100_CHARACTERS_MSG,C as scmCollectorFormSchema};
1
+ import{validNameRegex as o}from"@spotify/backstage-plugin-soundcheck-common";import{z as e}from"zod";import{FIELD_IS_REQUIRED_MSG as a,FrequencySchema as x,FiltersSchema as p,CacheConfigSchema as u}from"../../../../utils/validation.esm.js";const m="Fact name is not unique",r="The field contains forbidden characters",i="Max 100 characters",h="Max 1000 characters",f=e.object({factName:e.string().min(1,a).max(100,i).regex(o,r),branch:e.string().optional()}),b=f.merge(e.object({data:e.array(e.strictObject({name:e.string().min(1,a).max(100,i).regex(o,r),path:e.string().min(1,a).max(1e3,h)}))})).strict(),_=f.merge(e.object({path:e.string().min(1,a),regex:e.string().min(1,a),data:e.array(e.strictObject({name:e.string().min(1,a).max(100,i).regex(o,r),type:e.string().min(1,a).max(100,i).regex(o,r).optional()})).optional()})).strict(),j=f.merge(e.object({path:e.string().min(1,a),data:e.array(e.strictObject({name:e.string().min(1,a).regex(o,r),jsonPath:e.string().min(1,a),type:e.string().min(1,a)}))})).strict(),g=s=>e.strictObject({collectors:e.array(e.strictObject({factDetails:s,frequency:x,filters:p,cacheConfig:u,batchSize:e.number().min(1,"Batch size should be at least 1").optional().nullable()}))}),N=e.strictObject({exists:g(b),regex:g(_),json:g(j)}).superRefine((s,l)=>{const d=[...s.exists.collectors.map(t=>t.factDetails.factName),...s.regex.collectors.map(t=>t.factDetails.factName),...s.json.collectors.map(t=>t.factDetails.factName)],n=d.filter((t,c)=>d.indexOf(t)!==c);n.length&&(s.exists.collectors.forEach((t,c)=>{n.includes(t.factDetails.factName)&&l.addIssue({code:e.ZodIssueCode.custom,message:m,path:["exists","collectors",c,"factDetails","factName"]})}),s.regex.collectors.forEach((t,c)=>{n.includes(t.factDetails.factName)&&l.addIssue({code:e.ZodIssueCode.custom,message:m,path:["regex","collectors",c,"factDetails","factName"]})}),s.json.collectors.forEach((t,c)=>{n.includes(t.factDetails.factName)&&l.addIssue({code:e.ZodIssueCode.custom,message:m,path:["json","collectors",c,"factDetails","factName"]})}))});export{m as FACT_NAME_IS_NOT_UNIQUE_MSG,r as INVALID_CHARACTERS_MSG,h as MAX_1000_CHARACTERS_MSG,i as MAX_100_CHARACTERS_MSG,N as scmCollectorFormSchema};
2
2
  //# sourceMappingURL=validation.esm.js.map
@@ -1,2 +1,2 @@
1
- import{zodResolver as b}from"@hookform/resolvers/zod";import{makeStyles as S,Paper as E,Divider as i}from"@material-ui/core";import e from"react";import{useForm as j,FormProvider as v}from"react-hook-form";import"@backstage/catalog-model";import"@backstage/core-plugin-api";import"@tanstack/react-query";import"../../../../api.esm.js";import"../../../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"../../../../hooks/useSoundcheckAlert.esm.js";import{useConfirmationModal as h}from"../../../../hooks/useConfirmationModal.esm.js";import{useNavigateBack as Q}from"../../../../hooks/useNavigateBack.esm.js";import{useUpdateCollectorConfig as F}from"../../../../hooks/collectors/useUpdateCollectorConfig.esm.js";import{integrationsPageRouteRef as y}from"../../../../routes.esm.js";import{FooterButtons as k}from"../../../FooterButtons/FooterButtons.esm.js";import"../../../SoundcheckHeader/SoundcheckHeader.esm.js";import"../../../SoundcheckHeader/SoundcheckHeaderContext.esm.js";import{useHeader as w}from"../../../SoundcheckHeader/useHeader.esm.js";import{FactCollectionConfig as a}from"../Common/FactCollectionConfig.esm.js";import{collectorHeaderContent as T,confirmationModalContent as M}from"../Common/utils.esm.js";import{MeasuresFactDetailsInput as P}from"./MeasuresFactDetailsInput.esm.js";import{mapConfigToSonarQubeCollectorConfig as B,defaultSonarQubeConfig as D,measuresCollectorConfig as H,mapSonarQubeCollectorConfigToConfig as I}from"./utils.esm.js";import{sonarQubeCollectorFormSchema as N}from"./validation.esm.js";const R=S(o=>({spacer:{height:o.spacing(8),width:"100%"},section:{marginBottom:o.spacing(2)}})),x=({disabled:o,selectedCollector:t})=>{const n=j({defaultValues:t?B(t.config):D(),mode:"onChange",resolver:b(N)}),{formState:{errors:r},handleSubmit:l}=n,s=R(),c=!!r.projects||!!r.projectTags||!!r.issues||!!r.measures,{mutateAsync:p}=F(),[u,d]=Q(y),{showModal:f}=h(),m=async C=>{if(!await f(M(t)))return;const g=I(C);await p({collectorId:t.id,config:g})&&d()};return w(T(t)),e.createElement(e.Fragment,null,e.createElement(E,{className:s.section},e.createElement(v,{...n},e.createElement("form",{onSubmit:l(m)},e.createElement(a,{name:"projects",label:"Projects",description:"Collects details about SonarQube project linked to an entity.",disabled:o}),e.createElement(i,null),e.createElement(a,{name:"projectTags",label:"Project Tags",description:"Collects details about tags set on a SonarQube project linked to an entity.",disabled:o}),e.createElement(i,null),e.createElement(a,{name:"issues",label:"Issues",description:"Collects details about issues associated with a SonarQube project linked to an entity.",disabled:o}),e.createElement(i,null),e.createElement(a,{name:"measures",label:"Measures",description:"Collects details about measures associated with a SonarQube project linked to an entity.",disabled:o,FactDetailsComponent:P,multipleCollectors:{enable:!0,defaultConfig:H()}})))),e.createElement("div",{className:s.section},e.createElement(k,{onCancel:u,saveButtonText:"Save",isLoading:!1,onSave:l(m),disableSave:c})))};export{x as SonarQubeConfigurator};
1
+ import{zodResolver as b}from"@hookform/resolvers/zod";import{makeStyles as S,Paper as E,Divider as i}from"@material-ui/core";import e from"react";import{useForm as j,FormProvider as v}from"react-hook-form";import"@backstage/catalog-model";import"@backstage/core-plugin-api";import"@tanstack/react-query";import"../../../../api.esm.js";import"../../../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"@spotify/backstage-plugin-soundcheck-common";import"../../../../hooks/useSoundcheckAlert.esm.js";import{useConfirmationModal as h}from"../../../../hooks/useConfirmationModal.esm.js";import{useNavigateBack as Q}from"../../../../hooks/useNavigateBack.esm.js";import{useUpdateCollectorConfig as F}from"../../../../hooks/collectors/useUpdateCollectorConfig.esm.js";import{integrationsPageRouteRef as y}from"../../../../routes.esm.js";import{FooterButtons as k}from"../../../FooterButtons/FooterButtons.esm.js";import"../../../SoundcheckHeader/SoundcheckHeader.esm.js";import"../../../SoundcheckHeader/SoundcheckHeaderContext.esm.js";import{useHeader as w}from"../../../SoundcheckHeader/useHeader.esm.js";import{FactCollectionConfig as a}from"../Common/FactCollectionConfig.esm.js";import{collectorHeaderContent as T,confirmationModalContent as M}from"../Common/utils.esm.js";import{MeasuresFactDetailsInput as P}from"./MeasuresFactDetailsInput.esm.js";import{mapConfigToSonarQubeCollectorConfig as B,defaultSonarQubeConfig as D,measuresCollectorConfig as H,mapSonarQubeCollectorConfigToConfig as I}from"./utils.esm.js";import{sonarQubeCollectorFormSchema as N}from"./validation.esm.js";const R=S(o=>({spacer:{height:o.spacing(8),width:"100%"},section:{marginBottom:o.spacing(2)}})),x=({disabled:o,selectedCollector:t})=>{const n=j({defaultValues:t?B(t.config):D(),mode:"onChange",resolver:b(N)}),{formState:{errors:r},handleSubmit:l}=n,s=R(),c=!!r.projects||!!r.projectTags||!!r.issues||!!r.measures,{mutateAsync:p}=F(),[u,d]=Q(y),{showModal:f}=h(),m=async C=>{if(!await f(M(t)))return;const g=I(C);await p({collectorId:t.id,config:g})&&d()};return w(T(t)),e.createElement(e.Fragment,null,e.createElement(E,{className:s.section},e.createElement(v,{...n},e.createElement("form",{onSubmit:l(m)},e.createElement(a,{name:"projects",label:"Projects",description:"Collects details about SonarQube project linked to an entity.",disabled:o}),e.createElement(i,null),e.createElement(a,{name:"projectTags",label:"Project Tags",description:"Collects details about tags set on a SonarQube project linked to an entity.",disabled:o}),e.createElement(i,null),e.createElement(a,{name:"issues",label:"Issues",description:"Collects details about issues associated with a SonarQube project linked to an entity.",disabled:o}),e.createElement(i,null),e.createElement(a,{name:"measures",label:"Measures",description:"Collects details about measures associated with a SonarQube project linked to an entity.",disabled:o,FactDetailsComponent:P,multipleCollectors:{enable:!0,defaultConfig:H()}})))),e.createElement("div",{className:s.section},e.createElement(k,{onCancel:u,saveButtonText:"Save",isLoading:!1,onSave:l(m),disableSave:c})))};export{x as SonarQubeConfigurator};
2
2
  //# sourceMappingURL=SonarQubeConfigurator.esm.js.map
@@ -1,2 +1,2 @@
1
- import{asArray as E}from"@spotify/backstage-plugin-soundcheck-common";import{mapToCacheConfig as u,mapCacheConfigToHumanDurationOrBoolean as m}from"../../../CacheConfig/utils.esm.js";import"../../../CacheConfig/CacheConfigComponent.esm.js";import{mapCatalogFilterToFilters as p,mapFiltersToCatalogFilter as C}from"../../../Filter/utils.esm.js";import"../../../Filter/FilterComponent.esm.js";import"../../../Frequency/types.esm.js";import{mapHumanDurationOrCronToFrequency as h,mapFrequencyToHumanDurationOrCron as y}from"../../../Frequency/util.esm.js";import"../../../Frequency/FrequencyComponent.esm.js";import{defaultBaseCollectorOption as S,defaultCollectorOption as T}from"../Common/CollectorOption.esm.js";const d="projects",g="project-tags",q="issues",s="measures",O=["ncloc","complexity","violations","open_issues"],L={factDetails:{factName:{name:"Fact Name",helperText:"Fact name must be unique",placeholder:"Fact Name"},metrics:{name:"Metrics",helperText:"Add more metrics to collect",placeholder:"Example: code_smells"}}},b=(c,t)=>({...S(),factDetails:{factName:c??"",metrics:t??O}}),_=()=>({projects:T(),projectTags:T(),issues:T(),measures:{enabled:!1,collectors:[b(s)]}});function F(c){const{projects:t,projectTags:f,issues:a,measures:n}=c;if(t.enabled||f.enabled||a.enabled||n.enabled){const i={},o=[];if(i.collects=o,t.enabled){const{cacheConfig:r,frequency:e,filters:l}=t;o.push({type:d,frequency:y(e),filter:C(l),cache:m(r)})}if(f.enabled){const{cacheConfig:r,frequency:e,filters:l}=f;o.push({type:g,frequency:y(e),filter:C(l),cache:m(r)})}if(a.enabled){const{cacheConfig:r,frequency:e,filters:l}=a;o.push({type:q,frequency:y(e),filter:C(l),cache:m(r)})}return n.enabled&&n.collectors.forEach(r=>{o.push({factName:r.factDetails.factName,type:s,metrics:r.factDetails.metrics,frequency:y(r.frequency),filter:C(r.filters),cache:m(r.cacheConfig)})}),i}return{collects:[]}}function D(c){const t=_();if(c){const f=E(c).flatMap(a=>a.collects);if(f){const a=E(f),n=a.find(e=>e.type===d);n&&(t.projects={enabled:!0,frequency:h(n.frequency??c.frequency),filters:p(n.filter??c.filter),cacheConfig:u(n.cache??c.cache)});const i=a.find(e=>e.type===g);i&&(t.projectTags={enabled:!0,frequency:h(i.frequency??c.frequency),filters:p(i.filter??c.filter),cacheConfig:u(i.cache??c.cache)});const o=a.find(e=>e.type===q);o&&(t.issues={enabled:!0,frequency:h(o.frequency??c.frequency),filters:p(o.filter??c.filter),cacheConfig:u(o.cache??c.cache)});const r=a.filter(e=>e.type===s);r.length&&(t.measures={enabled:!0,collectors:r.map(e=>({factDetails:{factName:e.factName??s,metrics:e.metrics},frequency:h(e.frequency??c.frequency),filters:p(e.filter??c.filter),cacheConfig:u(e.cache??c.cache)}))})}}return t}export{O as DEFAULT_METRICS,q as ISSUES_COLLECTOR_TYPE,s as MEASURES_COLLECTOR_TYPE,d as PROJECTS_COLLECTOR_TYPE,g as PROJECT_TAGS_COLLECTOR_TYPE,L as SONARQUBE_COLLECTOR_FIELDS,_ as defaultSonarQubeConfig,D as mapConfigToSonarQubeCollectorConfig,F as mapSonarQubeCollectorConfigToConfig,b as measuresCollectorConfig};
1
+ import{asArray as d}from"@spotify/backstage-plugin-soundcheck-common";import{defaultBaseCollectorOption as b,defaultCollectorOption as m}from"../Common/CollectorOption.esm.js";import{mapBackendConfigToFormIntegrationConfig as f,mapFormIntegrationConfigToBackendConfig as p}from"../Common/utils.esm.js";const C="projects",T="project-tags",g="issues",l="measures",u=["ncloc","complexity","violations","open_issues"],y={factDetails:{factName:{name:"Fact Name",helperText:"Fact name must be unique",placeholder:"Fact Name"},metrics:{name:"Metrics",helperText:"Add more metrics to collect",placeholder:"Example: code_smells"}}},E=(a,e)=>({...b(),factDetails:{factName:a??"",metrics:e??u}}),O=()=>({projects:m(),projectTags:m(),issues:m(),measures:{enabled:!1,collectors:[E(l)]}});function _(a){const{projects:e,projectTags:c,issues:o,measures:s}=a;if(e.enabled||c.enabled||o.enabled||s.enabled){const r={},n=[];return r.collects=n,e.enabled&&n.push(p({factType:C,configOption:e})),c.enabled&&n.push(p({factType:T,configOption:c})),o.enabled&&n.push(p({factType:g,configOption:o})),s.enabled&&s.collectors.forEach(i=>{n.push(p({factType:l,configOption:i,additionalParams:{factName:i.factDetails.factName,metrics:i.factDetails.metrics}}))}),r}return{collects:[]}}function S(a){const e=O();if(a){const c=d(a).flatMap(o=>o.collects);if(c){const o=d(c),s=o.find(t=>t.type===C);s&&(e.projects={...f({parentConfig:a,factTypeConfig:s}),enabled:!0});const r=o.find(t=>t.type===T);r&&(e.projectTags={...f({parentConfig:a,factTypeConfig:r}),enabled:!0});const n=o.find(t=>t.type===g);n&&(e.issues={...f({parentConfig:a,factTypeConfig:n}),enabled:!0});const i=o.filter(t=>t.type===l);i.length&&(e.measures={enabled:!0,collectors:i.map(t=>({...f({parentConfig:a,factTypeConfig:t}),factDetails:{factName:t.factName??l,metrics:t.metrics}}))})}}return e}export{u as DEFAULT_METRICS,g as ISSUES_COLLECTOR_TYPE,l as MEASURES_COLLECTOR_TYPE,C as PROJECTS_COLLECTOR_TYPE,T as PROJECT_TAGS_COLLECTOR_TYPE,y as SONARQUBE_COLLECTOR_FIELDS,O as defaultSonarQubeConfig,S as mapConfigToSonarQubeCollectorConfig,_ as mapSonarQubeCollectorConfigToConfig,E as measuresCollectorConfig};
2
2
  //# sourceMappingURL=utils.esm.js.map
@@ -1,2 +1,2 @@
1
- import{Link as u,InfoCard as k}from"@backstage/core-components";import{useRouteRef as c}from"@backstage/core-plugin-api";import{useEntity as h}from"@backstage/plugin-catalog-react";import{Divider as v}from"@material-ui/core";import C from"@material-ui/core/styles/makeStyles";import{SpotifyLicenseBanner as L}from"@spotify/backstage-plugin-core";import e,{Fragment as R}from"react";import{useAllCertifications as S}from"../../hooks/certifications/useAllCertifications.esm.js";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import"@backstage/catalog-model";import"../../hooks/useSoundcheckAlert.esm.js";import"../../hooks/useConfirmationModal.esm.js";import"react-router-dom";import{usePlaylists as I}from"../../hooks/playlists/usePlaylists.esm.js";import{certificationTrackRouteRef as w,certificationPlaylistTrackRouteRef as b}from"../../routes.esm.js";import{soundcheckBackend as N,invalidLicenseMessage as A}from"../../utils/license.esm.js";import{AlertPanel as P}from"../AlertPanel/AlertPanel.esm.js";import"../CertificationSidebar/CertificationSidebar.esm.js";import{CertificationSummary as T}from"../CertificationSidebar/CertificationSummary.esm.js";import"@material-ui/lab";import"../CertificationSidebar/Check.esm.js";import"../CertificationSidebar/LevelSummary.esm.js";import{NoCertifications as x}from"../EmptyState/EmptyState.esm.js";import{CardSkeleton as B}from"./skeletons/CardSkeleton.esm.js";const n=C(t=>({certificationWrapper:{display:"flex",justifyContent:"space-between",alignItems:"center"},infoCard:{display:"grid",gridRowGap:t.spacing(2)},emptyState:{overflow:"hidden"}})),m=({children:t,title:i})=>{const a=n();return e.createElement(k,{title:i},e.createElement("div",{className:a.infoCard},e.createElement(L,{inline:!0,backend:N,invalidLicenseMessage:A}),t))},D=(t,i)=>t.find(a=>a.trackIds.some(o=>o===i))?.id??"",M=({title:t="Soundcheck"})=>{const{entity:i}=h(),a=n(),{data:o,isError:p,isLoading:s}=S(i),{data:l,isError:d,isLoading:f}=I(i),g=c(w),y=c(b);return p||d?e.createElement(m,{title:t},e.createElement(P,{severity:"error",title:"Error loading certifications"})):s||f||!o||!l?e.createElement(m,{title:t},e.createElement(B,null)):o.length?e.createElement(m,{title:t},o.map((r,E)=>e.createElement(R,{key:r.program.name},e.createElement("div",{className:a.certificationWrapper,"data-testid":"soundcheck-track-row"},e.createElement(T,{key:r.program.id,name:r.program.name,badge:r.highestLevel?.badge,trackType:r.program?.type}),e.createElement(u,{to:r.program.type==="playlist"?y({playlistId:D(l,r.program.id),trackId:r.program.id}):g({trackId:r.program.id})},"View Details")),E<o.length-1?e.createElement(v,null):null))):e.createElement(m,{title:t},e.createElement("div",{className:a.emptyState},e.createElement(x,null)))};export{M as Card,n as useStyles};
1
+ import{Link as u,InfoCard as k}from"@backstage/core-components";import{useRouteRef as c}from"@backstage/core-plugin-api";import{useEntity as h}from"@backstage/plugin-catalog-react";import{Divider as v}from"@material-ui/core";import C from"@material-ui/core/styles/makeStyles";import{SpotifyLicenseBanner as L}from"@spotify/backstage-plugin-core";import e,{Fragment as R}from"react";import{useAllCertifications as S}from"../../hooks/certifications/useAllCertifications.esm.js";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import"@backstage/catalog-model";import"@spotify/backstage-plugin-soundcheck-common";import"../../hooks/useSoundcheckAlert.esm.js";import"../../hooks/useConfirmationModal.esm.js";import"react-router-dom";import{usePlaylists as I}from"../../hooks/playlists/usePlaylists.esm.js";import{certificationTrackRouteRef as w,certificationPlaylistTrackRouteRef as b}from"../../routes.esm.js";import{soundcheckBackend as N,invalidLicenseMessage as A}from"../../utils/license.esm.js";import{AlertPanel as P}from"../AlertPanel/AlertPanel.esm.js";import"../CertificationSidebar/CertificationSidebar.esm.js";import{CertificationSummary as T}from"../CertificationSidebar/CertificationSummary.esm.js";import"@material-ui/lab";import"../CertificationSidebar/Check.esm.js";import"../CertificationSidebar/LevelSummary.esm.js";import{NoCertifications as x}from"../EmptyState/EmptyState.esm.js";import{CardSkeleton as B}from"./skeletons/CardSkeleton.esm.js";const n=C(t=>({certificationWrapper:{display:"flex",justifyContent:"space-between",alignItems:"center"},infoCard:{display:"grid",gridRowGap:t.spacing(2)},emptyState:{overflow:"hidden"}})),m=({children:t,title:i})=>{const o=n();return e.createElement(k,{title:i},e.createElement("div",{className:o.infoCard},e.createElement(L,{inline:!0,backend:N,invalidLicenseMessage:A}),t))},D=(t,i)=>t.find(o=>o.trackIds.some(a=>a===i))?.id??"",M=({title:t="Soundcheck"})=>{const{entity:i}=h(),o=n(),{data:a,isError:p,isLoading:s}=S(i),{data:l,isError:d,isLoading:f}=I(i),g=c(w),y=c(b);return p||d?e.createElement(m,{title:t},e.createElement(P,{severity:"error",title:"Error loading certifications"})):s||f||!a||!l?e.createElement(m,{title:t},e.createElement(B,null)):a.length?e.createElement(m,{title:t},a.map((r,E)=>e.createElement(R,{key:r.program.name},e.createElement("div",{className:o.certificationWrapper,"data-testid":"soundcheck-track-row"},e.createElement(T,{key:r.program.id,name:r.program.name,badge:r.highestLevel?.badge,trackType:r.program?.type}),e.createElement(u,{to:r.program.type==="playlist"?y({playlistId:D(l,r.program.id),trackId:r.program.id}):g({trackId:r.program.id})},"View Details")),E<a.length-1?e.createElement(v,null):null))):e.createElement(m,{title:t},e.createElement("div",{className:o.emptyState},e.createElement(x,null)))};export{M as Card,n as useStyles};
2
2
  //# sourceMappingURL=Card.esm.js.map
@@ -1,2 +1,2 @@
1
- import{useEntity as d}from"@backstage/plugin-catalog-react";import{makeStyles as y}from"@material-ui/core";import m,{useState as g,useEffect as v}from"react";import C from"react-confetti";import E from"react-use/lib/useMeasure";import p from"react-use/lib/usePrevious";import"@backstage/catalog-model";import"@backstage/core-plugin-api";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import{useCertificationDetailsForTrack as L}from"../../hooks/certifications/useCertificationDetailsForTrack.esm.js";import"../../hooks/useSoundcheckAlert.esm.js";import"../../hooks/useConfirmationModal.esm.js";import"react-router-dom";const w=y(()=>({root:{position:"absolute",width:"100%",height:"100%"}})),P=({programId:t})=>{const a=w(),{entity:n}=d(),{data:s,isLoading:f}=L(n,t),[l,{width:c,height:h}]=E(),o=f?void 0:s?.highestLevel?.ordinal??-1,i=p(o),e=p(t),[u,r]=g(!1);return v(()=>{typeof i<"u"&&typeof o<"u"&&t===e&&o>i&&r(!0)},[o,i,t,e]),u?m.createElement("div",{ref:l,className:a.root},m.createElement(C,{width:c,height:h,numberOfPieces:1e3,gravity:1,initialVelocityY:20,recycle:!1,onConfettiComplete:()=>r(!1)})):null};export{P as LevelUpParty};
1
+ import{useEntity as d}from"@backstage/plugin-catalog-react";import{makeStyles as y}from"@material-ui/core";import m,{useState as g,useEffect as v}from"react";import C from"react-confetti";import E from"react-use/lib/useMeasure";import p from"react-use/lib/usePrevious";import"@backstage/catalog-model";import"@backstage/core-plugin-api";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import{useCertificationDetailsForTrack as L}from"../../hooks/certifications/useCertificationDetailsForTrack.esm.js";import"@spotify/backstage-plugin-soundcheck-common";import"../../hooks/useSoundcheckAlert.esm.js";import"../../hooks/useConfirmationModal.esm.js";import"react-router-dom";const w=y(()=>({root:{position:"absolute",width:"100%",height:"100%"}})),P=({programId:t})=>{const a=w(),{entity:n}=d(),{data:s,isLoading:f}=L(n,t),[l,{width:c,height:h}]=E(),o=f?void 0:s?.highestLevel?.ordinal??-1,i=p(o),e=p(t),[u,r]=g(!1);return v(()=>{typeof i<"u"&&typeof o<"u"&&t===e&&o>i&&r(!0)},[o,i,t,e]),u?m.createElement("div",{ref:l,className:a.root},m.createElement(C,{width:c,height:h,numberOfPieces:1e3,gravity:1,initialVelocityY:20,recycle:!1,onConfettiComplete:()=>r(!1)})):null};export{P as LevelUpParty};
2
2
  //# sourceMappingURL=LevelUpParty.esm.js.map
@@ -1,2 +1,2 @@
1
- import{makeStyles as L,Grid as l}from"@material-ui/core";import t,{createContext as N,useState as i,useEffect as A,useCallback as D}from"react";import{useSearchParams as R}from"react-router-dom";import H from"react-use/lib/useDebounce";import{useFacetsForOwner as I}from"../../hooks/facets/useFacetsForOwner.esm.js";import{LoadingIndicator as $}from"../LoadingIndicator/LoadingIndicator.esm.js";import{OverviewTable as M}from"../OverviewTable/OverviewTable.esm.js";import{RowHeights as T}from"../OverviewTable/resultsTableUtils.esm.js";import"../SoundcheckHeader/SoundcheckHeader.esm.js";import"../SoundcheckHeader/SoundcheckHeaderContext.esm.js";import{useSetHeaderDefault as _}from"../SoundcheckHeader/useHeader.esm.js";import"@backstage/core-plugin-api";import"@backstage/plugin-catalog-react";import"@material-ui/icons/ArrowDropDown";import"@material-ui/icons/ArrowDropUp";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import"../../routes.esm.js";import"../CampaignDetailsPage/CampaignDetails.esm.js";import"../TechHealth/Loading/Loading.esm.js";import"./CampaignBanner/useCampaignBannerStyles.esm.js";import{CampaignArea as j}from"./CampaignBanner/CampaignArea.esm.js";import{OverviewPageHeader as z}from"./OverviewPageHeader.esm.js";const B=L(e=>({tableContainer:{padding:0,backgroundColor:"transparent",paddingBottom:T.paginationControl},campaignsGrid:{margin:`0 0 ${e.spacing(3)}px`,border:`1px solid ${e.palette.divider}`},campaignsCard:{display:"flex",width:"100%",flexDirection:"column",padding:e.spacing(2),gap:e.spacing(2)},campaignsLink:{textAlign:"center",margin:`${e.spacing(1)}rem 0 ${e.spacing(1)}`},tableLoading:{backgroundColor:e.palette.background.paper,padding:e.spacing(6)},noPadding:{padding:0},accordion:{boxShadow:"none"}})),b=N({searchValue:"",updateSearchValue:e=>{},debouncedSearchValue:"",updateDebouncedSearchValue:e=>{},pivot:!1,updatePivot:e=>{}}),U=3,W=({isFixedGroup:e=!1,campaignsEnabled:k})=>{const[a,g]=R(),{group:n,kind:p,type:d}=Object.fromEntries(a.entries());_();const[r,u]=i(void 0),[h,x]=i(void 0),[y,C]=i(),[m,S]=i(""),[w,f]=i(""),[P,V]=i(!1);H(()=>{f(m)},800,[m]),A(()=>{(r?.kind!==p||r?.type!==d)&&u({kind:p,type:d})},[p,d,r]);const{data:E,isLoading:v}=I(n),O=h||y,F=D((o,s,G)=>{o&&(u({kind:o,type:s}),s?(a.set("kind",o),a.set("type",s)):(a.delete("type"),a.set("kind",o)),g(a,{replace:G}))},[a,g]),c=B();return t.createElement(b.Provider,{value:{searchValue:m,updateSearchValue:S,debouncedSearchValue:w,updateDebouncedSearchValue:f,pivot:P,updatePivot:V}},t.createElement(l,{container:!0,spacing:0},k&&t.createElement(j,{ownerEntityRef:n}),t.createElement(l,{item:!0,xs:12,className:c.noPadding},t.createElement(z,{unfilteredFacets:E,kind:r?.kind,type:r?.type,onChange:F,setError:C,isLoading:v,isFixedGroup:e})),t.createElement(l,{item:!0,xs:12,className:c.tableContainer},v?t.createElement("div",{className:c.tableLoading},t.createElement($,{size:80})):t.createElement(M,{facets:E,kind:r?.kind,type:r?.type,setError:x,hasError:O,ownerEntityRef:n,isFixedGroup:e}))))};export{U as OVERVIEW_CAMPAIGNS_COUNT,W as OverviewPageContent,b as OverviewPageContext};
1
+ import{makeStyles as L,Grid as m}from"@material-ui/core";import a,{createContext as G,useState as i,useEffect as D,useCallback as H}from"react";import{useSearchParams as N}from"react-router-dom";import $ from"react-use/lib/useDebounce";import{useFacetsForOwner as B}from"../../hooks/facets/useFacetsForOwner.esm.js";import{LoadingIndicator as R}from"../LoadingIndicator/LoadingIndicator.esm.js";import{OverviewTable as j}from"../OverviewTable/OverviewTable.esm.js";import{RowHeights as z}from"../OverviewTable/resultsTableUtils.esm.js";import"../SoundcheckHeader/SoundcheckHeader.esm.js";import"../SoundcheckHeader/SoundcheckHeaderContext.esm.js";import{useSetHeaderDefault as A}from"../SoundcheckHeader/useHeader.esm.js";import{OverviewPageHeader as I}from"./OverviewPageHeader.esm.js";const T=L(e=>({tableContainer:{padding:0,backgroundColor:"transparent",paddingBottom:z.paginationControl},campaignsGrid:{margin:`0 0 ${e.spacing(3)}px`,border:`1px solid ${e.palette.divider}`},campaignsCard:{display:"flex",width:"100%",flexDirection:"column",padding:e.spacing(2),gap:e.spacing(2)},campaignsLink:{textAlign:"center",margin:`${e.spacing(1)}rem 0 ${e.spacing(1)}`},tableLoading:{backgroundColor:e.palette.background.paper,padding:e.spacing(6)},noPadding:{padding:0},accordion:{boxShadow:"none"}})),k=G({searchValue:"",updateSearchValue:e=>{},debouncedSearchValue:"",updateDebouncedSearchValue:e=>{},pivot:!1,updatePivot:e=>{}}),Y=({isFixedGroup:e=!1})=>{const[t,l]=N(),{group:g,kind:o,type:d}=Object.fromEntries(t.entries());A();const[r,u]=i(void 0),[h,x]=i(void 0),[E,y]=i(),[p,C]=i(""),[S,f]=i(""),[w,P]=i(!1);$(()=>{f(p)},800,[p]),D(()=>{(r?.kind!==o||r?.type!==d)&&u({kind:o,type:d})},[o,d,r]);const{data:v,isLoading:b}=B(g),V=h||E,O=H((n,s,F)=>{n&&(u({kind:n,type:s}),s?(t.set("kind",n),t.set("type",s)):(t.delete("type"),t.set("kind",n)),l(t,{replace:F}))},[t,l]),c=T();return a.createElement(k.Provider,{value:{searchValue:p,updateSearchValue:C,debouncedSearchValue:S,updateDebouncedSearchValue:f,pivot:w,updatePivot:P}},a.createElement(m,{container:!0,spacing:0},a.createElement(m,{item:!0,xs:12,className:c.noPadding},a.createElement(I,{unfilteredFacets:v,kind:r?.kind,type:r?.type,onChange:O,setError:y,isLoading:b,isFixedGroup:e})),a.createElement(m,{item:!0,xs:12,className:c.tableContainer},b?a.createElement("div",{className:c.tableLoading},a.createElement(R,{size:80})):a.createElement(j,{facets:v,kind:r?.kind,type:r?.type,setError:x,hasError:V,ownerEntityRef:g,isFixedGroup:e}))))};export{Y as OverviewPageContent,k as OverviewPageContext};
2
2
  //# sourceMappingURL=OverviewPageContent.esm.js.map
@@ -1,2 +1,2 @@
1
- import{makeStyles as S,Typography as s,TextField as y,CircularProgress as T,Switch as w}from"@material-ui/core";import i from"@material-ui/core/Box";import I from"@material-ui/icons/Search";import{Autocomplete as L}from"@material-ui/lab";import t,{useContext as F,useEffect as W}from"react";import{GroupSelector as $}from"../GroupSelector/GroupSelector.esm.js";import{OverviewPageContext as A}from"./OverviewPageContent.esm.js";const B=S(r=>({wrapper:{background:r.palette.background.default,paddingTop:r.spacing(0),paddingBottom:r.spacing(2),paddingRight:r.spacing(3),display:"flex",gap:r.spacing(3)},switchLabel:{marginLeft:r.spacing(1.5)}})),G=({setError:r,unfilteredFacets:f,kind:l,type:o,onChange:m,isLoading:h,isFixedGroup:E})=>{const v=B(),a={types:f?.types.filter(({count:e})=>e>0)??[]},{searchValue:b,updateSearchValue:x,pivot:d,updatePivot:k}=F(A);W(()=>{const e=a?.types&&a.types.length>=0,n=!l&&e,p=l&&e&&!a?.types.find(({kind:c,type:g})=>l===c&&(!o&&!g||o===g));(n||p)&&m(a?.types[0]?.kind??"",a?.types[0]?.type,!0)},[l,o,a?.types,m]);const u=a?.types.map(({kind:e,type:n,count:p})=>{const c=`${e}|${n??""}`;return{facetKind:e,facetType:n,key:c,label:`${n??e} (${p>50?"50+":p})`,id:c}}).sort((e,n)=>e.key.localeCompare(n.key))??[],P=u.find(e=>e.key===`${l}|${o??""}`)??null,C=a&&(a.types?.length??0)>0;return t.createElement(i,{className:v.wrapper},!E&&t.createElement(i,{flex:1,maxWidth:364},t.createElement(s,{variant:"subtitle2",component:"div"},"Group"),t.createElement($,{baseClass:!0,margin:"dense",setError:r})),C&&t.createElement(t.Fragment,null,t.createElement(i,{flex:1,maxWidth:500},t.createElement(s,{variant:"subtitle2",component:"div"},"Entity Type"),t.createElement(L,{"aria-label":"Entity Type Selection",disableClearable:!0,options:u??[],freeSolo:!1,groupBy:e=>e.facetKind,getOptionLabel:e=>e.label,value:P,onChange:(e,n)=>m(n.facetKind,n.facetType,!0),renderInput:e=>t.createElement(y,{...e,variant:"outlined",placeholder:"Select entity type",margin:"dense",fullWidth:!0,InputProps:{...e.InputProps,endAdornment:t.createElement(t.Fragment,null,h?t.createElement(T,{color:"inherit",size:20}):null,e.InputProps.endAdornment)}})})),t.createElement(i,{maxWidth:580,flex:1},t.createElement(s,{variant:"subtitle2",component:"div"},"Search Entities"),t.createElement(y,{margin:"dense",placeholder:"Search entities",variant:"outlined",fullWidth:!0,value:b,onChange:e=>x(e.currentTarget.value),InputProps:{startAdornment:t.createElement(i,{marginRight:.75,display:"flex",alignItems:"center"},t.createElement(I,{color:"inherit"}))}})),t.createElement(i,{display:"flex",flexDirection:"column"},t.createElement(s,{style:{marginLeft:10},variant:"subtitle2",component:"div"},"Pivot"),t.createElement(i,{flex:1,display:"flex",alignItems:"center"},t.createElement(w,{checked:d,onChange:()=>k(!d),inputProps:{"aria-label":"pivot overview table"}})))))};export{G as OverviewPageHeader};
1
+ import{makeStyles as T,Typography as m,TextField as h,CircularProgress as F,Switch as L}from"@material-ui/core";import i from"@material-ui/core/Box";import W from"@material-ui/icons/Search";import{Autocomplete as A}from"@material-ui/lab";import t,{useContext as B,useEffect as v}from"react";import G from"react-use/lib/useLocalStorage";import{GroupSelector as K}from"../GroupSelector/GroupSelector.esm.js";import{OverviewPageContext as O}from"./OverviewPageContent.esm.js";const H=T(a=>({wrapper:{background:a.palette.background.default,paddingTop:a.spacing(0),paddingBottom:a.spacing(2),paddingRight:a.spacing(3),display:"flex",gap:a.spacing(3)},switchLabel:{marginLeft:a.spacing(1.5)}})),R=({setError:a,unfilteredFacets:E,kind:l,type:o,onChange:d,isLoading:x,isFixedGroup:b})=>{const k=H(),r={types:E?.types.filter(({count:e})=>e>0)??[]},[u,C]=G("soundcheck-overview-pivot-status",!1),{searchValue:P,updateSearchValue:S,pivot:p,updatePivot:g}=B(O);v(()=>{u!==p&&g(!!u)},[]),v(()=>{const e=r?.types&&r.types.length>=0,n=!l&&e,c=l&&e&&!r?.types.find(({kind:s,type:f})=>l===s&&(!o&&!f||o===f));(n||c)&&d(r?.types[0]?.kind??"",r?.types[0]?.type,!0)},[l,o,r?.types,d]);const y=r?.types.map(({kind:e,type:n,count:c})=>{const s=`${e}|${n??""}`;return{facetKind:e,facetType:n,key:s,label:`${n??e} (${c>50?"50+":c})`,id:s}}).sort((e,n)=>e.key.localeCompare(n.key))??[],w=y.find(e=>e.key===`${l}|${o??""}`)??null,I=r&&(r.types?.length??0)>0;return t.createElement(i,{className:k.wrapper},!b&&t.createElement(i,{flex:1,maxWidth:364},t.createElement(m,{variant:"subtitle2",component:"div"},"Group"),t.createElement(K,{baseClass:!0,margin:"dense",setError:a})),I&&t.createElement(t.Fragment,null,t.createElement(i,{flex:1,maxWidth:500},t.createElement(m,{variant:"subtitle2",component:"div"},"Entity Type"),t.createElement(A,{"aria-label":"Entity Type Selection",disableClearable:!0,options:y??[],freeSolo:!1,groupBy:e=>e.facetKind,getOptionLabel:e=>e.label,value:w,onChange:(e,n)=>d(n.facetKind,n.facetType,!0),renderInput:e=>t.createElement(h,{...e,variant:"outlined",placeholder:"Select entity type",margin:"dense",fullWidth:!0,InputProps:{...e.InputProps,endAdornment:t.createElement(t.Fragment,null,x?t.createElement(F,{color:"inherit",size:20}):null,e.InputProps.endAdornment)}})})),t.createElement(i,{maxWidth:580,flex:1},t.createElement(m,{variant:"subtitle2",component:"div"},"Search Entities"),t.createElement(h,{margin:"dense",placeholder:"Search entities",variant:"outlined",fullWidth:!0,value:P,onChange:e=>S(e.currentTarget.value),InputProps:{startAdornment:t.createElement(i,{marginRight:.75,display:"flex",alignItems:"center"},t.createElement(W,{color:"inherit"}))}})),t.createElement(i,{display:"flex",flexDirection:"column"},t.createElement(m,{style:{marginLeft:10},variant:"subtitle2",component:"div"},"Pivot"),t.createElement(i,{flex:1,display:"flex",alignItems:"center"},t.createElement(L,{checked:p,onChange:()=>{C(!p),g(!p)},inputProps:{"aria-label":"pivot overview table"}})))))};export{R as OverviewPageHeader};
2
2
  //# sourceMappingURL=OverviewPageHeader.esm.js.map
@@ -1,2 +1,2 @@
1
- import{useRouteRef as j}from"@backstage/core-plugin-api";import{entityRouteRef as q}from"@backstage/plugin-catalog-react";import{makeStyles as B,Grid as D}from"@material-ui/core";import e,{useContext as I,useEffect as k,useState as J,useRef as K,useLayoutEffect as Q,useMemo as U}from"react";import{VariableSizeGrid as X}from"react-window";import"@backstage/catalog-model";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import{useProgramOverviewForOwner as Y}from"../../hooks/certifications/useProgramOverviewForOwner.esm.js";import"../../hooks/useSoundcheckAlert.esm.js";import"../../hooks/useConfirmationModal.esm.js";import"react-router-dom";import{EmptyState as Z}from"../EmptyState/EmptyState.esm.js";import"../OverviewPage/OverviewPage.esm.js";import"@spotify/backstage-plugin-core";import"../SoundcheckQueryClientProvider/SoundcheckQueryClientProvider.esm.js";import{OverviewPageContext as _}from"../OverviewPage/OverviewPageContent.esm.js";import"../Pagination/Pagination.esm.js";import{useCursorPagination as $,CursorPagination as ee}from"../Pagination/CursorPagination.esm.js";import{cellRenderer as te}from"./Cell/cellRenderer.esm.js";import{OverviewTableSkeleton as re}from"./OverviewTableSkeleton.esm.js";import{ResultsTableHeader as oe}from"./ResultsTableHeader.esm.js";import{generateRowsPivoted as ie,generateRows as ne,generateHeaderRowPivoted as ae,generateHeaderRow as le}from"./ResultsTableRow.esm.js";import{RowHeights as P,CellWidths as y,calculateTableWidth as me}from"./resultsTableUtils.esm.js";import se from"./useWindowDimensions.esm.js";const S=25,ue=B(i=>({table:{backgroundColor:i.palette.background.paper,borderCollapse:"collapse",whiteSpace:"nowrap",textAlign:"left",overflow:"auto"},tableContainer:{backgroundColor:i.palette.background.paper}})),ce=({setError:i,kind:u,type:c,ownerEntityRef:r})=>{const{cursor:W,pageSize:R,...p}=$({defaultPageSize:S,label:"entitiesPerPage"}),{debouncedSearchValue:l,pivot:m}=I(_),{data:t,isLoading:g,isError:b}=Y(r,{kind:u,type:c},R,W,l);k(()=>{p.setCursor(""),p.setCurrentPage(0)},[l]);const E=ue(),d=j(q);k(()=>{i?.(b?new Error("Error loading track overview"):void 0)},[b,i]);const[H,x]=J(0),{height:z}=se(),n=K(null);Q(()=>{t&&r&&n?.current&&x(n.current.clientWidth?n.current.clientWidth-16:100)},[n,t,r]);const{rows:h,headerRow:f,tableWidth:w,entityRefsWithPadding:T,getRowHeight:N,columnCount:O}=U(()=>{if(g||!t||!r)return{};const{programs:a,entityRefs:o}=t;if(!o)return{};const s=o.length>=25?o:[...o,...Array.from({length:25-o.length},()=>{})],C=m?ie(a,o,d):ne(a,s,d),v=C[0]?.cells?.length??s.length+1,G=m?ae(a):le(s),L=me(v-1)+60;return{rows:C,headerRow:G,tableWidth:L,entityRefsWithPadding:s,getRowHeight:M=>C[M]?.height??P.check,columnCount:v}},[t,d,g,r,m]);if(g)return e.createElement(re,null);if(!t||!r)return null;const{totalCount:V,endCursor:A,prevCursor:F}=t;return!f||!w||!T||!h?.length?l?e.createElement(Z,{title:"No Entities Found",description:`No entities found with name containing: '${l}'`}):null:e.createElement("div",{ref:n},e.createElement(D,{"aria-label":`Check results for ${c??u}`,key:`${u}|${c??""}`,item:!0,xs:12,className:E.tableContainer},H>0&&e.createElement(e.Fragment,null,e.createElement(oe,{headerRow:f,gridWidth:w}),e.createElement(X,{className:E.table,columnCount:O,columnWidth:a=>a===0?y.trackTitle:y.checkResult,rowCount:h.length,rowHeight:N,height:z*.7-P.paginationControl-f.height,width:w,key:m?"entityView":"checkView"},te(h)))),e.createElement(ee,{...p,totalCount:V,defaultPageSize:S,endCursor:A,prevCursor:F,pageSize:R,labelRowsPerPage:"Entities per page:"}))};export{ce as ResultsTable};
1
+ import{useRouteRef as j}from"@backstage/core-plugin-api";import{entityRouteRef as q}from"@backstage/plugin-catalog-react";import{makeStyles as B,Grid as D}from"@material-ui/core";import e,{useContext as I,useEffect as k,useState as J,useRef as K,useLayoutEffect as Q,useMemo as U}from"react";import{VariableSizeGrid as X}from"react-window";import"@backstage/catalog-model";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import{useProgramOverviewForOwner as Y}from"../../hooks/certifications/useProgramOverviewForOwner.esm.js";import"@spotify/backstage-plugin-soundcheck-common";import"../../hooks/useSoundcheckAlert.esm.js";import"../../hooks/useConfirmationModal.esm.js";import"react-router-dom";import{EmptyState as Z}from"../EmptyState/EmptyState.esm.js";import"../OverviewPage/OverviewPage.esm.js";import"@spotify/backstage-plugin-core";import"../SoundcheckQueryClientProvider/SoundcheckQueryClientProvider.esm.js";import{OverviewPageContext as _}from"../OverviewPage/OverviewPageContent.esm.js";import"../Pagination/Pagination.esm.js";import{useCursorPagination as $,CursorPagination as ee}from"../Pagination/CursorPagination.esm.js";import{cellRenderer as te}from"./Cell/cellRenderer.esm.js";import{OverviewTableSkeleton as re}from"./OverviewTableSkeleton.esm.js";import{ResultsTableHeader as oe}from"./ResultsTableHeader.esm.js";import{generateRowsPivoted as ie,generateRows as ne,generateHeaderRowPivoted as ae,generateHeaderRow as le}from"./ResultsTableRow.esm.js";import{RowHeights as P,CellWidths as y,calculateTableWidth as me}from"./resultsTableUtils.esm.js";import se from"./useWindowDimensions.esm.js";const S=25,ue=B(i=>({table:{backgroundColor:i.palette.background.paper,borderCollapse:"collapse",whiteSpace:"nowrap",textAlign:"left",overflow:"auto"},tableContainer:{backgroundColor:i.palette.background.paper}})),ce=({setError:i,kind:u,type:c,ownerEntityRef:r})=>{const{cursor:W,pageSize:R,...p}=$({defaultPageSize:S,label:"entitiesPerPage"}),{debouncedSearchValue:l,pivot:m}=I(_),{data:t,isLoading:g,isError:b}=Y(r,{kind:u,type:c},R,W,l);k(()=>{p.setCursor(""),p.setCurrentPage(0)},[l]);const E=ue(),d=j(q);k(()=>{i?.(b?new Error("Error loading track overview"):void 0)},[b,i]);const[H,x]=J(0),{height:z}=se(),n=K(null);Q(()=>{t&&r&&n?.current&&x(n.current.clientWidth?n.current.clientWidth-16:100)},[n,t,r]);const{rows:h,headerRow:f,tableWidth:w,entityRefsWithPadding:T,getRowHeight:N,columnCount:O}=U(()=>{if(g||!t||!r)return{};const{programs:a,entityRefs:o}=t;if(!o)return{};const s=o.length>=25?o:[...o,...Array.from({length:25-o.length},()=>{})],C=m?ie(a,o,d):ne(a,s,d),v=C[0]?.cells?.length??s.length+1,G=m?ae(a):le(s),L=me(v-1)+60;return{rows:C,headerRow:G,tableWidth:L,entityRefsWithPadding:s,getRowHeight:M=>C[M]?.height??P.check,columnCount:v}},[t,d,g,r,m]);if(g)return e.createElement(re,null);if(!t||!r)return null;const{totalCount:V,endCursor:A,prevCursor:F}=t;return!f||!w||!T||!h?.length?l?e.createElement(Z,{title:"No Entities Found",description:`No entities found with name containing: '${l}'`}):null:e.createElement("div",{ref:n},e.createElement(D,{"aria-label":`Check results for ${c??u}`,key:`${u}|${c??""}`,item:!0,xs:12,className:E.tableContainer},H>0&&e.createElement(e.Fragment,null,e.createElement(oe,{headerRow:f,gridWidth:w}),e.createElement(X,{className:E.table,columnCount:O,columnWidth:a=>a===0?y.trackTitle:y.checkResult,rowCount:h.length,rowHeight:N,height:z*.7-P.paginationControl-f.height,width:w,key:m?"entityView":"checkView"},te(h)))),e.createElement(ee,{...p,totalCount:V,defaultPageSize:S,endCursor:A,prevCursor:F,pageSize:R,labelRowsPerPage:"Entities per page:"}))};export{ce as ResultsTable};
2
2
  //# sourceMappingURL=ResultsTable.esm.js.map
@@ -1,4 +1,4 @@
1
- import{Paper as T,Table as v,TableHead as R,TableRow as p,TableCell as h,TableBody as x,TablePagination as S}from"@material-ui/core";import{makeStyles as H}from"@material-ui/core/styles";import a,{useState as u,useEffect as B}from"react";import"@backstage/catalog-model";import"@backstage/core-plugin-api";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import{useGetChecks as L}from"../../hooks/checks/useGetChecks.esm.js";import"../../hooks/useSoundcheckAlert.esm.js";import"../../hooks/useConfirmationModal.esm.js";import"react-router-dom";import{Loading as N}from"../TechHealth/Loading/Loading.esm.js";const $=H(r=>({paper:{width:"100%",boxShadow:"none",border:`1px solid ${r.palette.divider}`,borderRadius:r.shape.borderRadius},tableHeaderCell:{fontWeight:"bold"}})),z=({data:r,columns:i,showsCheckData:n})=>{const d=$(),[s,o]=u(0),[l,b]=u(10),{data:g,isLoading:f}=L({ids:n?r.map(e=>e.id):[]});if(B(()=>{o(0)},[r.length]),f)return a.createElement(N,null);const C=(e,t)=>{o(t)},E=e=>{b(+e.target.value),o(0)},m=s*l,P=m+l,k=e=>`Cannot view detail: Check exists in results data only. That is, a check
1
+ import{Paper as T,Table as v,TableHead as R,TableRow as p,TableCell as h,TableBody as x,TablePagination as S}from"@material-ui/core";import{makeStyles as H}from"@material-ui/core/styles";import a,{useState as u,useEffect as B}from"react";import"@backstage/catalog-model";import"@backstage/core-plugin-api";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"@spotify/backstage-plugin-soundcheck-common";import{useGetChecks as L}from"../../hooks/checks/useGetChecks.esm.js";import"../../hooks/useSoundcheckAlert.esm.js";import"../../hooks/useConfirmationModal.esm.js";import"react-router-dom";import{Loading as N}from"../TechHealth/Loading/Loading.esm.js";const $=H(r=>({paper:{width:"100%",boxShadow:"none",border:`1px solid ${r.palette.divider}`,borderRadius:r.shape.borderRadius},tableHeaderCell:{fontWeight:"bold"}})),z=({data:r,columns:l,showsCheckData:n})=>{const d=$(),[s,o]=u(0),[i,b]=u(10),{data:g,isLoading:f}=L({ids:n?r.map(e=>e.id):[]});if(B(()=>{o(0)},[r.length]),f)return a.createElement(N,null);const C=(e,t)=>{o(t)},E=e=>{b(+e.target.value),o(0)},m=s*i,P=m+i,k=e=>`Cannot view detail: Check exists in results data only. That is, a check
2
2
  with the id '${e}' is not defined in any yaml files nor was such a
3
- check created through Soundcheck's UI.`,w=(e,t)=>{if(!e.renderCell)return t[e.id];if(e.id==="action"&&n){const c=g?.edges.find(y=>y.node.id===t.id)!==void 0;return e.renderCell(t,!c,c?void 0:k(t.id))}return e.renderCell(t)};return a.createElement(T,{className:d.paper},a.createElement(v,{size:"small"},a.createElement(R,null,a.createElement(p,null,i.map(e=>a.createElement(h,{key:`header-${e.id}`,className:d.tableHeaderCell},e.label)))),a.createElement(x,null,r.slice(m,P).map(e=>a.createElement(p,{key:e.id},i.map(t=>a.createElement(h,{key:`cell-${t.id}`},w(t,e))))))),a.createElement(S,{rowsPerPageOptions:[10,25,50],component:"div",count:r.length,rowsPerPage:l,page:s,onPageChange:C,onRowsPerPageChange:E}))};export{z as PassRateTable};
3
+ check created through Soundcheck's UI.`,w=(e,t)=>{if(!e.renderCell)return t[e.id];if(e.id==="action"&&n){const c=g?.edges.find(y=>y.node.id===t.id)!==void 0;return e.renderCell(t,!c,c?void 0:k(t.id))}return e.renderCell(t)};return a.createElement(T,{className:d.paper},a.createElement(v,{size:"small"},a.createElement(R,null,a.createElement(p,null,l.map(e=>a.createElement(h,{key:`header-${e.id}`,className:d.tableHeaderCell},e.label)))),a.createElement(x,null,r.slice(m,P).map(e=>a.createElement(p,{key:e.id},l.map(t=>a.createElement(h,{key:`cell-${t.id}`},w(t,e))))))),a.createElement(S,{rowsPerPageOptions:[10,25,50],component:"div",count:r.length,rowsPerPage:i,page:s,onPageChange:C,onRowsPerPageChange:E}))};export{z as PassRateTable};
4
4
  //# sourceMappingURL=PassRateTable.esm.js.map
@@ -1,2 +1,2 @@
1
- import{makeStyles as n,LinearProgress as a}from"@material-ui/core";import e,{useState as p}from"react";import s from"react-use/lib/useDebounce";import c from"react-use/lib/useUnmount";import"@backstage/catalog-model";import"@backstage/core-plugin-api";import{useIsFetching as d}from"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"../../hooks/useSoundcheckAlert.esm.js";import"../../hooks/useConfirmationModal.esm.js";import"react-router-dom";import{FadeIn as l}from"../FadeIn/FadeIn.esm.js";const f=n(t=>({indicator:{position:"absolute",width:"100%",zIndex:t.zIndex.speedDial}})),u=()=>{const t=d(),r=f(),[i,o]=p(!!t),[I,m]=s(()=>{o(!!t)},250,[t]);return c(m),i?e.createElement(l,null,e.createElement("div",{className:r.indicator},e.createElement(a,{variant:"indeterminate","data-testid":"refetching-indicator"}))):null};export{u as RefetchingIndicator};
1
+ import{makeStyles as n,LinearProgress as a}from"@material-ui/core";import e,{useState as p}from"react";import s from"react-use/lib/useDebounce";import c from"react-use/lib/useUnmount";import"@backstage/catalog-model";import"@backstage/core-plugin-api";import{useIsFetching as d}from"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"@spotify/backstage-plugin-soundcheck-common";import"../../hooks/useSoundcheckAlert.esm.js";import"../../hooks/useConfirmationModal.esm.js";import"react-router-dom";import{FadeIn as l}from"../FadeIn/FadeIn.esm.js";const f=n(t=>({indicator:{position:"absolute",width:"100%",zIndex:t.zIndex.speedDial}})),u=()=>{const t=d(),r=f(),[i,o]=p(!!t),[I,m]=s(()=>{o(!!t)},250,[t]);return c(m),i?e.createElement(l,null,e.createElement("div",{className:r.indicator},e.createElement(a,{variant:"indeterminate","data-testid":"refetching-indicator"}))):null};export{u as RefetchingIndicator};
2
2
  //# sourceMappingURL=RefetchingIndicator.esm.js.map
@@ -1,2 +1,2 @@
1
- import{useRouteRef as m,useRouteRefParams as d}from"@backstage/core-plugin-api";import{useEntity as s}from"@backstage/plugin-catalog-react";import{SecretsContextProvider as v}from"@backstage/plugin-scaffolder-react";import e from"react";import{Routes as $,Route as i,Navigate as u}from"react-router-dom";import{useAllCertifications as L}from"../hooks/certifications/useAllCertifications.esm.js";import"@tanstack/react-query";import"../api.esm.js";import"../hooks/graphqlKeys.esm.js";import{useCertificationDetailsForTrack as R}from"../hooks/certifications/useCertificationDetailsForTrack.esm.js";import"@backstage/catalog-model";import"../hooks/useSoundcheckAlert.esm.js";import"../hooks/useConfirmationModal.esm.js";import{usePlaylists as y}from"../hooks/playlists/usePlaylists.esm.js";import{certificationPlaylistTrackCheckRouteRef as I,certificationPlaylistTrackRouteRef as E,certificationPlaylistRouteRef as f,certificationTrackRouteRef as k,certificationRouteRef as g}from"../routes.esm.js";import{EntityContent as o}from"./EntityContent/EntityContent.esm.js";const x=()=>{const{entity:l}=s(),t=m(f),a=m(k),{isLoading:c,data:r}=y(l),{isLoading:n,data:C}=L(l);if(c||n)return null;const p=r?.[0]?.id,h=C?.[0]?.program.id;return!p&&!h?null:e.createElement(u,{to:p?t({playlistId:p}):a({trackId:h}),replace:!0})},T=()=>{const{entity:l}=s(),{playlistId:t}=d(f),a=m(E),{data:c}=y(l),r=c?.find(n=>n.id===t)?.trackIds[0];return r?e.createElement(u,{to:a({playlistId:t,trackId:r}),replace:!0}):null},F=()=>{const{entity:l}=s(),{playlistId:t,trackId:a}=d(E),{data:c}=R(l,a),r=m(I),n=c?.levels[0]?.checks[0]?.id;return n?e.createElement(u,{to:r({playlistId:t,trackId:a,checkId:n}),replace:!0}):null},P=()=>{const{entity:l}=s(),{trackId:t}=d(k),a=m(g),{data:c}=R(l,t),r=c?.levels?.find(n=>n.checks.length>0)?.checks[0].id;return r?e.createElement(u,{to:a({trackId:t,checkId:r}),replace:!0}):null},A=()=>e.createElement(v,null,e.createElement($,null,e.createElement(i,{path:I.path,element:e.createElement(o,null)}),e.createElement(i,{path:E.path,element:e.createElement(e.Fragment,null,e.createElement(o,null),e.createElement(F,null))}),e.createElement(i,{path:f.path,element:e.createElement(e.Fragment,null,e.createElement(o,null),e.createElement(T,null))}),e.createElement(i,{path:k.path,element:e.createElement(e.Fragment,null,e.createElement(o,null),e.createElement(P,null))}),e.createElement(i,{path:g.path,element:e.createElement(o,null)}),e.createElement(i,{path:"/",element:e.createElement(e.Fragment,null,e.createElement(o,null),e.createElement(x,null))})));export{P as RedirectToFirstCheck,T as RedirectToFirstPlaylistTrack,F as RedirectToFirstPlaylistTrackCheck,A as Router};
1
+ import{useRouteRef as m,useRouteRefParams as d}from"@backstage/core-plugin-api";import{useEntity as s}from"@backstage/plugin-catalog-react";import{SecretsContextProvider as v}from"@backstage/plugin-scaffolder-react";import e from"react";import{Routes as $,Route as c,Navigate as u}from"react-router-dom";import{useAllCertifications as L}from"../hooks/certifications/useAllCertifications.esm.js";import"@tanstack/react-query";import"../api.esm.js";import"../hooks/graphqlKeys.esm.js";import{useCertificationDetailsForTrack as R}from"../hooks/certifications/useCertificationDetailsForTrack.esm.js";import"@backstage/catalog-model";import"@spotify/backstage-plugin-soundcheck-common";import"../hooks/useSoundcheckAlert.esm.js";import"../hooks/useConfirmationModal.esm.js";import{usePlaylists as y}from"../hooks/playlists/usePlaylists.esm.js";import{certificationPlaylistTrackCheckRouteRef as I,certificationPlaylistTrackRouteRef as E,certificationPlaylistRouteRef as f,certificationTrackRouteRef as k,certificationRouteRef as g}from"../routes.esm.js";import{EntityContent as o}from"./EntityContent/EntityContent.esm.js";const x=()=>{const{entity:l}=s(),t=m(f),a=m(k),{isLoading:i,data:r}=y(l),{isLoading:n,data:C}=L(l);if(i||n)return null;const p=r?.[0]?.id,h=C?.[0]?.program.id;return!p&&!h?null:e.createElement(u,{to:p?t({playlistId:p}):a({trackId:h}),replace:!0})},T=()=>{const{entity:l}=s(),{playlistId:t}=d(f),a=m(E),{data:i}=y(l),r=i?.find(n=>n.id===t)?.trackIds[0];return r?e.createElement(u,{to:a({playlistId:t,trackId:r}),replace:!0}):null},F=()=>{const{entity:l}=s(),{playlistId:t,trackId:a}=d(E),{data:i}=R(l,a),r=m(I),n=i?.levels[0]?.checks[0]?.id;return n?e.createElement(u,{to:r({playlistId:t,trackId:a,checkId:n}),replace:!0}):null},P=()=>{const{entity:l}=s(),{trackId:t}=d(k),a=m(g),{data:i}=R(l,t),r=i?.levels?.find(n=>n.checks.length>0)?.checks[0].id;return r?e.createElement(u,{to:a({trackId:t,checkId:r}),replace:!0}):null},A=()=>e.createElement(v,null,e.createElement($,null,e.createElement(c,{path:I.path,element:e.createElement(o,null)}),e.createElement(c,{path:E.path,element:e.createElement(e.Fragment,null,e.createElement(o,null),e.createElement(F,null))}),e.createElement(c,{path:f.path,element:e.createElement(e.Fragment,null,e.createElement(o,null),e.createElement(T,null))}),e.createElement(c,{path:k.path,element:e.createElement(e.Fragment,null,e.createElement(o,null),e.createElement(P,null))}),e.createElement(c,{path:g.path,element:e.createElement(o,null)}),e.createElement(c,{path:"/",element:e.createElement(e.Fragment,null,e.createElement(o,null),e.createElement(x,null))})));export{P as RedirectToFirstCheck,T as RedirectToFirstPlaylistTrack,F as RedirectToFirstPlaylistTrackCheck,A as Router};
2
2
  //# sourceMappingURL=Router.esm.js.map
@@ -1,2 +1,2 @@
1
- import{Page as F,TabbedLayout as l}from"@backstage/core-components";import{useApi as s,featureFlagsApiRef as S,configApiRef as L}from"@backstage/core-plugin-api";import{usePermission as m}from"@backstage/plugin-permission-react";import{makeStyles as D,Box as i}from"@material-ui/core";import{SpotifyLicenseBanner as H}from"@spotify/backstage-plugin-core";import{soundcheckCampaignCreatePermission as N,soundcheckCollectorReadPermission as O,soundcheckCheckCreatePermission as B,soundcheckTrackCreatePermission as G}from"@spotify/backstage-plugin-soundcheck-common";import e from"react";import{Routes as Q,Route as t}from"react-router-dom";import"../../contexts/TrackFormContext.esm.js";import"../../contexts/CheckFormContext.esm.js";import"../../contexts/CampaignFormContext.esm.js";import{UserProvider as $}from"../../contexts/UserProvider.esm.js";import q from"../../hooks/useConfirmationModal.esm.js";import{AlertProvider as M}from"../../hooks/useSoundcheckAlert.esm.js";import{CampaignInsightsPage as U}from"../CampaignInsightsPage/CampaignInsightsPage.esm.js";import{CampaignsPage as V}from"../CampaignsPage/CampaignsPage.esm.js";import{CampaignCreatePage as W}from"../CampaignCreatePage/CampaignCreatePage.esm.js";import{EditCampaignView as j}from"../CampaignsPage/EditCampaignView.esm.js";import{CheckCreatePage as z}from"../CheckCreatePage/CheckCreatePage.esm.js";import{CheckPage as J}from"../CheckPage/CheckPage.esm.js";import{CheckInsightsPage as p}from"../CheckPage/CheckInsightsPage.esm.js";import{ChecksTab as K}from"../ChecksTab/ChecksTab.esm.js";import{CheckTemplatesPage as X}from"../CheckTemplatesPage/CheckTemplatesPage.esm.js";import{CollectorPage as Y}from"../CollectorPage/CollectorPage.esm.js";import{CollectorsPage as Z}from"../CollectorsPage/CollectorsPage.esm.js";import{OverviewPageContent as _}from"../OverviewPage/OverviewPageContent.esm.js";import{QuickstartPage as ee}from"../QuickstartPage/QuickstartPage.esm.js";import{SoundcheckHeader as te}from"../SoundcheckHeader/SoundcheckHeader.esm.js";import{SoundcheckHeaderProvider as ae}from"../SoundcheckHeader/SoundcheckHeaderContext.esm.js";import{SoundcheckQueryClientProvider as ne}from"../SoundcheckQueryClientProvider/SoundcheckQueryClientProvider.esm.js";import{TechHealth as le}from"../TechHealth/TechHealth.esm.js";import{TrackCreatePage as re}from"../TrackCreatePage/TrackCreatePage.esm.js";import{TrackEditPage as ce}from"../TrackEditPage/TrackEditPage.esm.js";import{TrackPage as me}from"../TrackPage/TrackPage.esm.js";import{TracksTab as ie}from"../TracksTab/TracksTab.esm.js";const oe=D(r=>({tabContent:{margin:0,padding:0},root:{"& > *":{display:"flex",flexDirection:"column",flexGrow:1}},pageContent:{display:"flex",flexDirection:"row",flexGrow:1},pageLayout:{display:"flex",flexDirection:"column",flex:"1 1 0%",maxWidth:"100%","& > article":{display:"flex",flexDirection:"column",flex:"1 1 auto",padding:`${r.spacing(3)}px !important`}}})),se=({title:r="Soundcheck"})=>{const c=oe(),a=s(S),d=s(L).getOptionalStringArray("soundcheck.flags"),h=(!a.getRegisteredFlags().find(n=>n.name==="soundcheck-enable-tech-health")||a.isActive("soundcheck-enable-tech-health"))&&!d?.includes("soundcheck-disable-tech-health"),u=!a.getRegisteredFlags().find(n=>n.name==="soundcheck-enable-collectors")||a.isActive("soundcheck-enable-collectors"),o=!a.getRegisteredFlags().find(n=>n.name==="soundcheck-enable-campaigns")||a.isActive("soundcheck-enable-campaigns"),{loading:g,allowed:k}=m({permission:N}),f=!g&&k,{loading:E,allowed:C}=m({permission:O}),{loading:b,allowed:P}=m({permission:B}),v=!a.getRegisteredFlags().find(n=>n.name==="soundcheck-enable-check-creation")||a.isActive("soundcheck-enable-check-creation"),x=!b&&P&&v,{loading:R,allowed:w}=m({permission:G}),T=!a.getRegisteredFlags().find(n=>n.name==="soundcheck-enable-track-creation")||a.isActive("soundcheck-enable-track-creation"),I=!R&&w&&T,y=u&&!E&&C,A=h;return e.createElement(M,null,e.createElement($,null,e.createElement(ne,null,e.createElement(ae,{defaultTitle:r},e.createElement(q,null,e.createElement(i,{className:c.root},e.createElement(F,{themeId:"website"},e.createElement(H,{backend:"soundcheck",invalidLicenseMessage:"Submitted facts and check results will still be stored, but it will not be possible to view certifications or individual results until a valid license is present."}),e.createElement(te,{documentTitle:r}),e.createElement(i,{className:c.pageContent},e.createElement(i,{className:c.pageLayout},e.createElement(Q,null,o&&e.createElement(e.Fragment,null,e.createElement(t,{path:"/campaigns/:campaignId/edit",element:e.createElement(j,null)}),e.createElement(t,{path:"/campaigns/:campaignId",element:e.createElement(U,null)}),f&&e.createElement(t,{path:"/campaigns/create",element:e.createElement(W,null)})),e.createElement(t,{path:"/quickstart",element:e.createElement(ee,null)}),e.createElement(t,{path:"/tracks/:trackId/edit",element:e.createElement(ce,null)}),I&&e.createElement(t,{path:"/tracks/create",element:e.createElement(re,null)}),e.createElement(t,{path:"/tracks/:trackId",element:e.createElement(me,null)}),e.createElement(t,{path:"/tracks/:trackId/checks/:checkId",element:e.createElement(p,null)}),e.createElement(t,{path:"/checks/:checkId",element:e.createElement(p,null)}),e.createElement(t,{path:"/checks/:checkId/edit",element:e.createElement(J,null)}),x&&e.createElement(e.Fragment,null,e.createElement(t,{path:"/checks/create",element:e.createElement(z,null)}),e.createElement(t,{path:"/checks/templates",element:e.createElement(X,null)})),e.createElement(t,{path:"/integrations/:integrationId",element:e.createElement(Y,null)}),e.createElement(t,{path:"/*",element:e.createElement(l,null,e.createElement(l.Route,{title:"Overview",path:"/"},e.createElement("div",{className:c.tabContent},e.createElement(_,{campaignsEnabled:!0}))),A&&e.createElement(l.Route,{title:"Tech Health",path:"/tech-health"},e.createElement(le,null)),e.createElement(l.Route,{title:"Checks",path:"/checks"},e.createElement(K,null)),e.createElement(l.Route,{title:"Tracks",path:"/tracks"},e.createElement(ie,null)),o&&e.createElement(l.Route,{title:"Campaigns",path:"/campaigns"},e.createElement(V,null)),y&&e.createElement(l.Route,{title:"Integrations",path:"/integrations"},e.createElement(Z,null)))}))," ")))))))))};export{se as RoutingPage};
1
+ import{Page as F,TabbedLayout as l}from"@backstage/core-components";import{useApi as s,featureFlagsApiRef as S,configApiRef as L}from"@backstage/core-plugin-api";import{usePermission as m}from"@backstage/plugin-permission-react";import{makeStyles as D,Box as i}from"@material-ui/core";import{SpotifyLicenseBanner as H}from"@spotify/backstage-plugin-core";import{soundcheckCampaignCreatePermission as N,soundcheckCollectorReadPermission as O,soundcheckCheckCreatePermission as B,soundcheckTrackCreatePermission as G}from"@spotify/backstage-plugin-soundcheck-common";import e from"react";import{Routes as Q,Route as t}from"react-router-dom";import"../../contexts/TrackFormContext.esm.js";import"../../contexts/CheckFormContext.esm.js";import"../../contexts/CampaignFormContext.esm.js";import{UserProvider as $}from"../../contexts/UserProvider.esm.js";import q from"../../hooks/useConfirmationModal.esm.js";import{AlertProvider as M}from"../../hooks/useSoundcheckAlert.esm.js";import{CampaignInsightsPage as U}from"../CampaignInsightsPage/CampaignInsightsPage.esm.js";import{CampaignsPage as V}from"../CampaignsPage/CampaignsPage.esm.js";import{CampaignCreatePage as W}from"../CampaignCreatePage/CampaignCreatePage.esm.js";import{EditCampaignView as j}from"../CampaignsPage/EditCampaignView.esm.js";import{CheckCreatePage as z}from"../CheckCreatePage/CheckCreatePage.esm.js";import{CheckPage as J}from"../CheckPage/CheckPage.esm.js";import{CheckInsightsPage as p}from"../CheckPage/CheckInsightsPage.esm.js";import{ChecksTab as K}from"../ChecksTab/ChecksTab.esm.js";import{CheckTemplatesPage as X}from"../CheckTemplatesPage/CheckTemplatesPage.esm.js";import{CollectorPage as Y}from"../CollectorPage/CollectorPage.esm.js";import{CollectorsPage as Z}from"../CollectorsPage/CollectorsPage.esm.js";import{OverviewPageContent as _}from"../OverviewPage/OverviewPageContent.esm.js";import{QuickstartPage as ee}from"../QuickstartPage/QuickstartPage.esm.js";import{SoundcheckHeader as te}from"../SoundcheckHeader/SoundcheckHeader.esm.js";import{SoundcheckHeaderProvider as ae}from"../SoundcheckHeader/SoundcheckHeaderContext.esm.js";import{SoundcheckQueryClientProvider as ne}from"../SoundcheckQueryClientProvider/SoundcheckQueryClientProvider.esm.js";import{TechHealth as le}from"../TechHealth/TechHealth.esm.js";import{TrackCreatePage as re}from"../TrackCreatePage/TrackCreatePage.esm.js";import{TrackEditPage as ce}from"../TrackEditPage/TrackEditPage.esm.js";import{TrackPage as me}from"../TrackPage/TrackPage.esm.js";import{TracksTab as ie}from"../TracksTab/TracksTab.esm.js";const oe=D(r=>({tabContent:{margin:0,padding:0},root:{"& > *":{display:"flex",flexDirection:"column",flexGrow:1}},pageContent:{display:"flex",flexDirection:"row",flexGrow:1},pageLayout:{display:"flex",flexDirection:"column",flex:"1 1 0%",maxWidth:"100%","& > article":{display:"flex",flexDirection:"column",flex:"1 1 auto",padding:`${r.spacing(3)}px !important`}}})),se=({title:r="Soundcheck"})=>{const c=oe(),a=s(S),d=s(L).getOptionalStringArray("soundcheck.flags"),h=(!a.getRegisteredFlags().find(n=>n.name==="soundcheck-enable-tech-health")||a.isActive("soundcheck-enable-tech-health"))&&!d?.includes("soundcheck-disable-tech-health"),u=!a.getRegisteredFlags().find(n=>n.name==="soundcheck-enable-collectors")||a.isActive("soundcheck-enable-collectors"),o=!a.getRegisteredFlags().find(n=>n.name==="soundcheck-enable-campaigns")||a.isActive("soundcheck-enable-campaigns"),{loading:g,allowed:k}=m({permission:N}),f=!g&&k,{loading:E,allowed:C}=m({permission:O}),{loading:P,allowed:b}=m({permission:B}),v=!a.getRegisteredFlags().find(n=>n.name==="soundcheck-enable-check-creation")||a.isActive("soundcheck-enable-check-creation"),x=!P&&b&&v,{loading:R,allowed:w}=m({permission:G}),T=!a.getRegisteredFlags().find(n=>n.name==="soundcheck-enable-track-creation")||a.isActive("soundcheck-enable-track-creation"),I=!R&&w&&T,y=u&&!E&&C,A=h;return e.createElement(M,null,e.createElement($,null,e.createElement(ne,null,e.createElement(ae,{defaultTitle:r},e.createElement(q,null,e.createElement(i,{className:c.root},e.createElement(F,{themeId:"website"},e.createElement(H,{backend:"soundcheck",invalidLicenseMessage:"Submitted facts and check results will still be stored, but it will not be possible to view certifications or individual results until a valid license is present."}),e.createElement(te,{documentTitle:r}),e.createElement(i,{className:c.pageContent},e.createElement(i,{className:c.pageLayout},e.createElement(Q,null,o&&e.createElement(e.Fragment,null,e.createElement(t,{path:"/campaigns/:campaignId/edit",element:e.createElement(j,null)}),e.createElement(t,{path:"/campaigns/:campaignId",element:e.createElement(U,null)}),f&&e.createElement(t,{path:"/campaigns/create",element:e.createElement(W,null)})),e.createElement(t,{path:"/quickstart",element:e.createElement(ee,null)}),e.createElement(t,{path:"/tracks/:trackId/edit",element:e.createElement(ce,null)}),I&&e.createElement(t,{path:"/tracks/create",element:e.createElement(re,null)}),e.createElement(t,{path:"/tracks/:trackId",element:e.createElement(me,null)}),e.createElement(t,{path:"/tracks/:trackId/checks/:checkId",element:e.createElement(p,null)}),e.createElement(t,{path:"/checks/:checkId",element:e.createElement(p,null)}),e.createElement(t,{path:"/checks/:checkId/edit",element:e.createElement(J,null)}),x&&e.createElement(e.Fragment,null,e.createElement(t,{path:"/checks/create",element:e.createElement(z,null)}),e.createElement(t,{path:"/checks/templates",element:e.createElement(X,null)})),e.createElement(t,{path:"/integrations/:integrationId",element:e.createElement(Y,null)}),e.createElement(t,{path:"/*",element:e.createElement(l,null,e.createElement(l.Route,{title:"Overview",path:"/"},e.createElement("div",{className:c.tabContent},e.createElement(_,null))),A&&e.createElement(l.Route,{title:"Tech Health",path:"/tech-health"},e.createElement(le,null)),e.createElement(l.Route,{title:"Checks",path:"/checks"},e.createElement(K,null)),e.createElement(l.Route,{title:"Tracks",path:"/tracks"},e.createElement(ie,null)),o&&e.createElement(l.Route,{title:"Campaigns",path:"/campaigns"},e.createElement(V,null)),y&&e.createElement(l.Route,{title:"Integrations",path:"/integrations"},e.createElement(Z,null)))}))," ")))))))))};export{se as RoutingPage};
2
2
  //# sourceMappingURL=RoutingPage.esm.js.map
@@ -1,2 +1,2 @@
1
- import{makeStyles as F,alpha as w,Box as i,Typography as z,Tooltip as L,Icon as N,IconButton as O,Chip as T,TextField as D,FormControlLabel as j,Checkbox as B}from"@material-ui/core";import V from"@material-ui/icons/ArrowDropDown";import $ from"@material-ui/icons/ArrowDropUp";import A from"@material-ui/icons/CheckBox";import H from"@material-ui/icons/CheckBoxOutlineBlank";import K from"@material-ui/icons/HelpOutline";import{Autocomplete as W}from"@material-ui/lab";import{remove as q}from"lodash";import l,{useState as p,useEffect as J,useCallback as y,useMemo as M}from"react";import P from"../../Expand/Expand.esm.js";import{ListboxVirtualized as Q}from"../../ListboxVirtualized/ListboxVirtualized.esm.js";import{useFilterContext as G}from"./FilterProvider.esm.js";import{Facet as x,facetTooltips as C}from"./types.esm.js";const R=F(({palette:t,spacing:n})=>({header:{display:"flex",alignItems:"left",flexDirection:"row",cursor:"pointer",justifyContent:"space-between"},label:{display:"flex",alignItems:"center"},tooltipIcon:{display:"flex",alignItems:"center",justifyContent:"center",color:t.text.primary},chip:{maxWidth:"45%",textOverflow:"ellipsis",margin:n(.5,.5,.5,0),overflow:"hidden","& svg":{color:w(t.common.white,.7),"&:hover":{color:t.common.white}},backgroundColor:t.action.disabledBackground},autoCompleteInput:{"&& input":{margin:n(1,0,0,0),padding:`${n(0,1,1,1)} !important`,width:"100%",display:"flex",alignItems:"center",justifyContent:"center"},"&& button":{"&:hover":{backgroundColor:"transparent"}}},autoComplete:{margin:n(.5,0,1,0)},selectionLabel:{lineHeight:"1em"}})),U=({facet:t})=>{const n=R(),{getFacetOptions:k,getFacetOptionLabel:c,getSelectedFacetValues:a,setSelectedFacetValues:u}=G(),[f,d]=p(!1),[v,h]=p(!1),[I,b]=p("");J(()=>{d(!!a(t)?.length)},[a,t]);const E=()=>{d(e=>!e)},g=e=>{(e.key==="Enter"||e.key===" ")&&E()},m=y(e=>{if(t===x.Entity&&e[e.length-1]){const o=e[e.length-1];if(!o.includes(":")||!o.includes("/")){h(!0),b("Custom entities require a valid kind and namespace such as: component:default/entity");return}}h(!1),b(""),u(t,e)},[t,u]),r=M(()=>a(t),[t,a]),S=y(e=>{const o=[...r];q(o,s=>s===e),m(o)},[r,m]);return l.createElement(i,null,l.createElement("div",{className:n.header,onClick:E,onKeyDown:g,role:"button",tabIndex:0},l.createElement("div",{className:n.label},l.createElement(i,null,l.createElement(z,{variant:"subtitle2"},t)),C[t]&&l.createElement(L,{title:C[t],className:n.tooltipIcon},l.createElement(N,null,l.createElement(K,{style:{fontSize:16,verticalAlign:"text-top"}})))),l.createElement(i,null,l.createElement(O,{size:"small",onKeyDown:g},f?l.createElement($,{fontSize:"small"}):l.createElement(V,{fontSize:"small"})))),l.createElement(P,{visible:f},l.createElement(i,null,r.map(e=>l.createElement(T,{key:e,label:c(t,e),size:"small",className:n.chip,onDelete:()=>S(e),clickable:!1}))),l.createElement(W,{className:n.autoComplete,disableCloseOnSelect:!0,fullWidth:!0,multiple:!0,freeSolo:t===x.Entity,popupIcon:null,renderTags:()=>null,options:k(t),getOptionLabel:e=>c(t,e),value:r,onChange:(e,o)=>m(o),ListboxComponent:Q,ListboxProps:{itemHeight:50},renderInput:e=>l.createElement(D,{...e,className:n.autoCompleteInput,placeholder:`Search for ${t}`,error:v,helperText:I}),renderOption:(e,{selected:o})=>l.createElement(j,{onClick:s=>s.preventDefault(),control:l.createElement(B,{icon:l.createElement(H,{fontSize:"small"}),checkedIcon:l.createElement(A,{fontSize:"small"}),checked:o}),classes:{label:n.selectionLabel},label:c(t,e)})})))};export{U as FacetFilter};
1
+ import{makeStyles as F,alpha as w,Box as i,Typography as z,Tooltip as L,Icon as N,IconButton as O,Chip as T,TextField as D,FormControlLabel as V,Checkbox as j}from"@material-ui/core";import B from"@material-ui/icons/ArrowDropDown";import $ from"@material-ui/icons/ArrowDropUp";import A from"@material-ui/icons/CheckBox";import H from"@material-ui/icons/CheckBoxOutlineBlank";import K from"@material-ui/icons/HelpOutline";import{Autocomplete as W}from"@material-ui/lab";import{remove as q}from"lodash";import l,{useState as p,useEffect as J,useCallback as y,useMemo as M}from"react";import P from"../../Expand/Expand.esm.js";import{ListboxVirtualized as G}from"../../ListboxVirtualized/ListboxVirtualized.esm.js";import{useFilterContext as Q}from"./FilterProvider.esm.js";import{Facet as x,facetTooltips as C}from"./types.esm.js";const R=F(({palette:t,spacing:n})=>({header:{display:"flex",alignItems:"left",flexDirection:"row",cursor:"pointer",justifyContent:"space-between"},label:{display:"flex",alignItems:"center"},tooltipIcon:{display:"flex",alignItems:"center",justifyContent:"center",color:t.text.primary},chip:{maxWidth:"45%",textOverflow:"ellipsis",margin:n(.5,.5,.5,0),overflow:"hidden","& svg":{color:w(t.common.white,.7),"&:hover":{color:t.common.white}},backgroundColor:t.action.disabledBackground},autoCompleteInput:{"&& input":{margin:n(1,0,0,0),padding:`${n(0,1,1,1)} !important`,width:"100%",display:"flex",alignItems:"center",justifyContent:"center"},"&& button":{"&:hover":{backgroundColor:"transparent"}}},autoComplete:{margin:n(.5,0,1,0)},selectionLabel:{lineHeight:"1em"}})),U=({facet:t})=>{const n=R(),{getFacetOptions:k,getFacetOptionLabel:c,getSelectedFacetValues:a,setSelectedFacetValues:u}=Q(),[f,d]=p(!1),[v,h]=p(!1),[I,b]=p("");J(()=>{d(!!a(t)?.length)},[a,t]);const E=()=>{d(e=>!e)},g=e=>{(e.key==="Enter"||e.key===" ")&&E()},m=y(e=>{if(t===x.Entity&&e[e.length-1]){const o=e[e.length-1];if(!o.includes(":")||!o.includes("/")){h(!0),b("Custom entities require a valid kind and namespace such as: component:default/entity");return}}h(!1),b(""),u(t,e)},[t,u]),r=M(()=>a(t),[t,a]),S=y(e=>{const o=[...r];q(o,s=>s===e),m(o)},[r,m]);return l.createElement(i,null,l.createElement("div",{className:n.header,onClick:E,onKeyDown:g,role:"button",tabIndex:0},l.createElement("div",{className:n.label},l.createElement(i,null,l.createElement(z,{variant:"subtitle2"},t)),C[t]&&l.createElement(L,{title:C[t],className:n.tooltipIcon},l.createElement(N,null,l.createElement(K,{style:{fontSize:16,verticalAlign:"text-top"}})))),l.createElement(i,null,l.createElement(O,{size:"small",onKeyDown:g},f?l.createElement($,{fontSize:"small"}):l.createElement(B,{fontSize:"small"})))),l.createElement(P,{visible:f},l.createElement(i,null,r.map(e=>l.createElement(T,{key:e,label:c(t,e),size:"small",className:n.chip,onDelete:()=>S(e),clickable:!1}))),l.createElement(W,{className:n.autoComplete,disableCloseOnSelect:!0,fullWidth:!0,multiple:!0,freeSolo:t===x.Entity,popupIcon:null,renderTags:()=>null,options:k(t),getOptionLabel:e=>c(t,e),value:r,onChange:(e,o)=>m(o),ListboxComponent:G,ListboxProps:{itemHeight:50},renderInput:e=>l.createElement(D,{...e,className:n.autoCompleteInput,placeholder:`Search for ${t}`,error:v,helperText:I}),renderOption:(e,{selected:o})=>l.createElement(V,{onClick:s=>s.preventDefault(),control:l.createElement(j,{icon:l.createElement(H,{fontSize:"small"}),checkedIcon:l.createElement(A,{fontSize:"small"}),checked:o}),classes:{label:n.selectionLabel},label:c(t,e)})})))};export{U as FacetFilter};
2
2
  //# sourceMappingURL=FacetFilter.esm.js.map
@@ -1,2 +1,2 @@
1
- import{parseEntityRef as T}from"@backstage/catalog-model";import C from"lodash";import{useState as $,useMemo as l,useEffect as A}from"react";import"../../../contexts/TrackFormContext.esm.js";import"../../../contexts/CheckFormContext.esm.js";import"../../../contexts/CampaignFormContext.esm.js";import{useLoggedInUser as S}from"../../../contexts/UserProvider.esm.js";import"@backstage/core-plugin-api";import"@tanstack/react-query";import"../../../api.esm.js";import"../../../hooks/graphqlKeys.esm.js";import{useAllGroups as x}from"../../../hooks/groups/useAllGroups.esm.js";import"@backstage/plugin-catalog-react";import{useGetChecks as U}from"../../../hooks/checks/useGetChecks.esm.js";import"../../../hooks/useSoundcheckAlert.esm.js";import{useGetAllTracks as q}from"../../../hooks/tracks/useGetAllTracks.esm.js";import"../../../hooks/useConfirmationModal.esm.js";import"react-router-dom";import{useGetEntityFacets as f}from"../../../hooks/catalog/useGetEntityFacets.esm.js";import{useEntityRefsForUser as B}from"../../../hooks/entities/useEntityRefsForUser.esm.js";import{Facet as s}from"./types.esm.js";const I=(i,o)=>{const a=[];for(const r of i)a.push({label:r.name??r.id,value:r.id});const e=i.map(r=>r.id);for(const r of o)for(const m of r.levels??[])for(const n of m.checks??[])e.includes(n.id)||(e.push(n.id),a.push({label:n.name??n.id,value:n.id}));return a},K=i=>{const o=[];for(const a of i??[])for(const e of a.levels??[])o.includes(e.ordinal)||o.push(e.ordinal);return o.sort().map(a=>({label:`Level ${a}`,value:`${a}`}))},M=(i,o)=>{const a=new Set(i.filter(e=>e.ownerEntityRef).map(e=>e.ownerEntityRef));return Array.from(a).map(e=>({label:o[e]??e,value:e}))},d=i=>(i??[]).map(o=>({label:o,value:o})),V=()=>{const[i,o]=$(!1),{userEntityRef:a}=S(),{data:e,isLoading:r}=B(a),{data:m,isLoading:n}=x(),u=l(()=>C.mapValues(C.keyBy(m??[],"ref"),t=>t.name),[m]),{data:y,isLoading:g}=q({first:100}),p=l(()=>y?.edges.map(t=>t.node)??[],[y]),{data:L,isLoading:v}=U({first:100}),c=l(()=>L?.edges.map(t=>t.node)??[],[L]),{data:E,isLoading:b}=f("kind"),{data:h,isLoading:k}=f("spec.lifecycle"),{data:R,isLoading:w}=f("spec.type"),{data:F,isLoading:O}=f("spec.system"),G=l(()=>({[s.Kind]:d(E),[s.Lifecycle]:d(h),[s.Type]:d(R),[s.System]:d(F),[s.Entity]:e.map(t=>({label:T(t).name,value:t})),[s.EntityOwner]:m?.map(t=>({label:t.name,value:t.ref}))??[],[s.Track]:p.map(t=>({label:t.name,value:t.id})),[s.Level]:K(p),[s.Check]:I(c,p),[s.CheckOwner]:M(c,u)}),[E,h,R,e,m,u,p,c,F]);return A(()=>{o(b||k||w||r||n||g||v||O)},[b,k,w,r,n,g,v,O]),{facetOptions:G,isLoading:i}};export{V as useFacetOptions};
1
+ import{parseEntityRef as T}from"@backstage/catalog-model";import C from"lodash";import{useState as $,useMemo as l,useEffect as A}from"react";import"../../../contexts/TrackFormContext.esm.js";import"../../../contexts/CheckFormContext.esm.js";import"../../../contexts/CampaignFormContext.esm.js";import{useLoggedInUser as S}from"../../../contexts/UserProvider.esm.js";import"@backstage/core-plugin-api";import"@tanstack/react-query";import"../../../api.esm.js";import"../../../hooks/graphqlKeys.esm.js";import{useAllGroups as x}from"../../../hooks/groups/useAllGroups.esm.js";import"@backstage/plugin-catalog-react";import"@spotify/backstage-plugin-soundcheck-common";import{useGetChecks as U}from"../../../hooks/checks/useGetChecks.esm.js";import"../../../hooks/useSoundcheckAlert.esm.js";import{useGetAllTracks as q}from"../../../hooks/tracks/useGetAllTracks.esm.js";import"../../../hooks/useConfirmationModal.esm.js";import"react-router-dom";import{useGetEntityFacets as f}from"../../../hooks/catalog/useGetEntityFacets.esm.js";import{useEntityRefsForUser as B}from"../../../hooks/entities/useEntityRefsForUser.esm.js";import{Facet as s}from"./types.esm.js";const I=(i,o)=>{const a=[];for(const r of i)a.push({label:r.name??r.id,value:r.id});const e=i.map(r=>r.id);for(const r of o)for(const m of r.levels??[])for(const n of m.checks??[])e.includes(n.id)||(e.push(n.id),a.push({label:n.name??n.id,value:n.id}));return a},K=i=>{const o=[];for(const a of i??[])for(const e of a.levels??[])o.includes(e.ordinal)||o.push(e.ordinal);return o.sort().map(a=>({label:`Level ${a}`,value:`${a}`}))},M=(i,o)=>{const a=new Set(i.filter(e=>e.ownerEntityRef).map(e=>e.ownerEntityRef));return Array.from(a).map(e=>({label:o[e]??e,value:e}))},d=i=>(i??[]).map(o=>({label:o,value:o})),V=()=>{const[i,o]=$(!1),{userEntityRef:a}=S(),{data:e,isLoading:r}=B(a),{data:m,isLoading:n}=x(),u=l(()=>C.mapValues(C.keyBy(m??[],"ref"),t=>t.name),[m]),{data:y,isLoading:g}=q({first:100}),p=l(()=>y?.edges.map(t=>t.node)??[],[y]),{data:L,isLoading:v}=U({first:100}),c=l(()=>L?.edges.map(t=>t.node)??[],[L]),{data:E,isLoading:b}=f("kind"),{data:h,isLoading:k}=f("spec.lifecycle"),{data:R,isLoading:w}=f("spec.type"),{data:F,isLoading:O}=f("spec.system"),G=l(()=>({[s.Kind]:d(E),[s.Lifecycle]:d(h),[s.Type]:d(R),[s.System]:d(F),[s.Entity]:e.map(t=>({label:T(t).name,value:t})),[s.EntityOwner]:m?.map(t=>({label:t.name,value:t.ref}))??[],[s.Track]:p.map(t=>({label:t.name,value:t.id})),[s.Level]:K(p),[s.Check]:I(c,p),[s.CheckOwner]:M(c,u)}),[E,h,R,e,m,u,p,c,F]);return A(()=>{o(b||k||w||r||n||g||v||O)},[b,k,w,r,n,g,v,O]),{facetOptions:G,isLoading:i}};export{V as useFacetOptions};
2
2
  //# sourceMappingURL=useFacetOptions.esm.js.map
@@ -1,2 +1,2 @@
1
- import{TabbedLayout as r}from"@backstage/core-components";import{useApi as m,featureFlagsApiRef as i}from"@backstage/core-plugin-api";import{makeStyles as p,Box as n}from"@material-ui/core";import e from"react";import{Routes as c,Route as s}from"react-router-dom";import"../SoundcheckHeader/SoundcheckHeader.esm.js";import"../SoundcheckHeader/SoundcheckHeaderContext.esm.js";import{useSetHeaderDefault as u}from"../SoundcheckHeader/useHeader.esm.js";import{TechHealthSummary as d}from"../TechHealthSummary/TechHealthSummary.esm.js";import"../TechHealthTabs/PassRateTabStyles.esm.js";import"../StyledTooltip/StyledTooltip.esm.js";import"../TechHealthTabs/OwnerColumn.esm.js";import{TrackResultsTab as f}from"../TechHealthTabs/TrackResultsTab/TrackResultsTab.esm.js";import{EntityResultsTab as x}from"../TechHealthTabs/EntityResultsTab/EntityResultsTab.esm.js";import{GroupResultsTab as b}from"../TechHealthTabs/GroupResultsTab/GroupResultsTab.esm.js";import{CampaignResultsTab as h}from"../TechHealthTabs/CampaignResultsTab/CampaignResultsTab.esm.js";import{CheckResultsTab as E}from"../TechHealthTabs/CheckResultsTab/CheckResultsTab.esm.js";import"./Filters/types.esm.js";import"./Filters/FacetFilter.esm.js";import{FilterProvider as g}from"./Filters/FilterProvider.esm.js";import{Filters as k}from"./Filters/Filters.esm.js";import"./Filters/FiltersHeader.esm.js";import"./Filters/FiltersSection.esm.js";import"@backstage/catalog-model";import"lodash";import"../../contexts/TrackFormContext.esm.js";import"../../contexts/CheckFormContext.esm.js";import"../../contexts/CampaignFormContext.esm.js";import"../../contexts/UserProvider.esm.js";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"../../hooks/useSoundcheckAlert.esm.js";import"../../hooks/useConfirmationModal.esm.js";const R=p(t=>({container:{display:"flex",margin:"-24px",backgroundColor:t.palette.background.paper,borderTop:`1px solid ${t.palette.border}`,flex:1},fixedColumn:{width:"300px",flex:"none",borderRight:`1px solid ${t.palette.divider}`},flexibleColumn:{display:"flex",flexDirection:"column",flex:1,backgroundColor:t.palette.background.paper,height:"100%",maxWidth:"100%"},pageLayout:{display:"flex",flexDirection:"column",flex:"1 1 0%",backgroundColor:t.palette.background.default,"& > article":{display:"flex",flexDirection:"column",flex:"1 1 auto",borderTop:`1px solid ${t.palette.border}`,padding:`${t.spacing(3)}px !important`}}})),T=()=>{u();const t=R(),l=m(i),a=!l.getRegisteredFlags().find(o=>o.name==="soundcheck-enable-campaigns")||l.isActive("soundcheck-enable-campaigns");return e.createElement(g,null,e.createElement("div",{className:t.container},e.createElement("div",{className:t.fixedColumn},e.createElement(k,null)),e.createElement("div",{className:t.flexibleColumn},e.createElement(n,{className:t.pageLayout,"aria-label":"tech health tabs"},e.createElement(c,null,e.createElement(s,{path:"/*",element:e.createElement(r,null,e.createElement(r.Route,{title:"Summary",path:"/"},e.createElement(d,null)),a&&e.createElement(r.Route,{title:"Campaigns",path:"/campaigns"},e.createElement(h,null)),e.createElement(r.Route,{title:"Checks",path:"/checks"},e.createElement(E,null)),e.createElement(r.Route,{title:"Tracks",path:"/tracks"},e.createElement(f,null)),e.createElement(r.Route,{title:"Entities",path:"/entities"},e.createElement(x,null)),e.createElement(r.Route,{title:"Teams",path:"/teams"},e.createElement(b,null)))}))))))};export{T as TechHealth};
1
+ import{TabbedLayout as r}from"@backstage/core-components";import{useApi as m,featureFlagsApiRef as i}from"@backstage/core-plugin-api";import{makeStyles as p,Box as n}from"@material-ui/core";import e from"react";import{Routes as c,Route as s}from"react-router-dom";import"../SoundcheckHeader/SoundcheckHeader.esm.js";import"../SoundcheckHeader/SoundcheckHeaderContext.esm.js";import{useSetHeaderDefault as u}from"../SoundcheckHeader/useHeader.esm.js";import{TechHealthSummary as d}from"../TechHealthSummary/TechHealthSummary.esm.js";import"../TechHealthTabs/PassRateTabStyles.esm.js";import"../StyledTooltip/StyledTooltip.esm.js";import"../TechHealthTabs/OwnerColumn.esm.js";import{TrackResultsTab as f}from"../TechHealthTabs/TrackResultsTab/TrackResultsTab.esm.js";import{EntityResultsTab as x}from"../TechHealthTabs/EntityResultsTab/EntityResultsTab.esm.js";import{GroupResultsTab as b}from"../TechHealthTabs/GroupResultsTab/GroupResultsTab.esm.js";import{CampaignResultsTab as h}from"../TechHealthTabs/CampaignResultsTab/CampaignResultsTab.esm.js";import{CheckResultsTab as E}from"../TechHealthTabs/CheckResultsTab/CheckResultsTab.esm.js";import"./Filters/types.esm.js";import"./Filters/FacetFilter.esm.js";import{FilterProvider as g}from"./Filters/FilterProvider.esm.js";import{Filters as k}from"./Filters/Filters.esm.js";import"./Filters/FiltersHeader.esm.js";import"./Filters/FiltersSection.esm.js";import"@backstage/catalog-model";import"lodash";import"../../contexts/TrackFormContext.esm.js";import"../../contexts/CheckFormContext.esm.js";import"../../contexts/CampaignFormContext.esm.js";import"../../contexts/UserProvider.esm.js";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"@spotify/backstage-plugin-soundcheck-common";import"../../hooks/useSoundcheckAlert.esm.js";import"../../hooks/useConfirmationModal.esm.js";const R=p(t=>({container:{display:"flex",margin:"-24px",backgroundColor:t.palette.background.paper,borderTop:`1px solid ${t.palette.border}`,flex:1},fixedColumn:{width:"300px",flex:"none",borderRight:`1px solid ${t.palette.divider}`},flexibleColumn:{display:"flex",flexDirection:"column",flex:1,backgroundColor:t.palette.background.paper,height:"100%",maxWidth:"100%"},pageLayout:{display:"flex",flexDirection:"column",flex:"1 1 0%",backgroundColor:t.palette.background.default,"& > article":{display:"flex",flexDirection:"column",flex:"1 1 auto",borderTop:`1px solid ${t.palette.border}`,padding:`${t.spacing(3)}px !important`}}})),T=()=>{u();const t=R(),l=m(i),a=!l.getRegisteredFlags().find(o=>o.name==="soundcheck-enable-campaigns")||l.isActive("soundcheck-enable-campaigns");return e.createElement(g,null,e.createElement("div",{className:t.container},e.createElement("div",{className:t.fixedColumn},e.createElement(k,null)),e.createElement("div",{className:t.flexibleColumn},e.createElement(n,{className:t.pageLayout,"aria-label":"tech health tabs"},e.createElement(c,null,e.createElement(s,{path:"/*",element:e.createElement(r,null,e.createElement(r.Route,{title:"Summary",path:"/"},e.createElement(d,null)),a&&e.createElement(r.Route,{title:"Campaigns",path:"/campaigns"},e.createElement(h,null)),e.createElement(r.Route,{title:"Checks",path:"/checks"},e.createElement(E,null)),e.createElement(r.Route,{title:"Tracks",path:"/tracks"},e.createElement(f,null)),e.createElement(r.Route,{title:"Entities",path:"/entities"},e.createElement(x,null)),e.createElement(r.Route,{title:"Teams",path:"/teams"},e.createElement(b,null)))}))))))};export{T as TechHealth};
2
2
  //# sourceMappingURL=TechHealth.esm.js.map
@@ -1,2 +1,2 @@
1
- import s,{createContext as d,useMemo as p,useContext as g}from"react";import"@backstage/catalog-model";import"@backstage/core-plugin-api";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"../../hooks/useSoundcheckAlert.esm.js";import"../../hooks/useConfirmationModal.esm.js";import{useAggregatedCheckPassRateTrend as v}from"../../hooks/aggregations/useAggregatedCheckPassRateTrend.esm.js";import{useAggregatedTrackPassRateTrend as u}from"../../hooks/aggregations/useAggregatedTrackPassRateTrend.esm.js";import{useAggregatedEntityPassRateTrend as c}from"../../hooks/aggregations/useAggregatedEntityPassRateTrend.esm.js";import{useAggregatedGroupPassRateTrend as P}from"../../hooks/aggregations/useAggregatedGroupPassRateTrend.esm.js";import"react-router-dom";import"../TechHealth/Filters/types.esm.js";import"../TechHealth/Filters/FacetFilter.esm.js";import{useFilterContext as T}from"../TechHealth/Filters/FilterProvider.esm.js";import"../TechHealth/Filters/Filters.esm.js";import"../TechHealth/Filters/FiltersHeader.esm.js";import"../TechHealth/Filters/FiltersSection.esm.js";import"lodash";import"../../contexts/TrackFormContext.esm.js";import"../../contexts/CheckFormContext.esm.js";import"../../contexts/CampaignFormContext.esm.js";import"../../contexts/UserProvider.esm.js";import{Loading as R}from"../TechHealth/Loading/Loading.esm.js";const a=d({checkPassRateTrend:{data:void 0,isLoading:!0,isError:!1},trackPassRateOverviewTrend:{data:void 0,isLoading:!0,isError:!1},entityPassRatesOverviewTrends:{data:void 0,isLoading:!0,isError:!1},groupPassRatesOverviewTrends:{data:void 0,isLoading:!0,isError:!1}}),f=()=>g(a),L=m=>{const{filter:r}=T(),e=v(r),t=u(r),i=c(r),o=P({filter:r,first:5}),n=p(()=>({checkPassRateTrend:e,trackPassRateOverviewTrend:t,entityPassRatesOverviewTrends:i,groupPassRatesOverviewTrends:o}),[e,t,i,o]);return e.isLoading||t.isLoading||i.isLoading||o.isLoading?s.createElement(R,null):s.createElement(a.Provider,{...m,value:n})};export{L as SummaryAggregationsProvider,f as useSummaryAggregationsContext};
1
+ import s,{createContext as d,useMemo as p,useContext as g}from"react";import"@backstage/catalog-model";import"@backstage/core-plugin-api";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"@spotify/backstage-plugin-soundcheck-common";import"../../hooks/useSoundcheckAlert.esm.js";import"../../hooks/useConfirmationModal.esm.js";import{useAggregatedCheckPassRateTrend as v}from"../../hooks/aggregations/useAggregatedCheckPassRateTrend.esm.js";import{useAggregatedTrackPassRateTrend as u}from"../../hooks/aggregations/useAggregatedTrackPassRateTrend.esm.js";import{useAggregatedEntityPassRateTrend as c}from"../../hooks/aggregations/useAggregatedEntityPassRateTrend.esm.js";import{useAggregatedGroupPassRateTrend as P}from"../../hooks/aggregations/useAggregatedGroupPassRateTrend.esm.js";import"react-router-dom";import"../TechHealth/Filters/types.esm.js";import"../TechHealth/Filters/FacetFilter.esm.js";import{useFilterContext as T}from"../TechHealth/Filters/FilterProvider.esm.js";import"../TechHealth/Filters/Filters.esm.js";import"../TechHealth/Filters/FiltersHeader.esm.js";import"../TechHealth/Filters/FiltersSection.esm.js";import"lodash";import"../../contexts/TrackFormContext.esm.js";import"../../contexts/CheckFormContext.esm.js";import"../../contexts/CampaignFormContext.esm.js";import"../../contexts/UserProvider.esm.js";import{Loading as R}from"../TechHealth/Loading/Loading.esm.js";const a=d({checkPassRateTrend:{data:void 0,isLoading:!0,isError:!1},trackPassRateOverviewTrend:{data:void 0,isLoading:!0,isError:!1},entityPassRatesOverviewTrends:{data:void 0,isLoading:!0,isError:!1},groupPassRatesOverviewTrends:{data:void 0,isLoading:!0,isError:!1}}),f=()=>g(a),L=m=>{const{filter:r}=T(),e=v(r),t=u(r),i=c(r),o=P({filter:r,first:5}),n=p(()=>({checkPassRateTrend:e,trackPassRateOverviewTrend:t,entityPassRatesOverviewTrends:i,groupPassRatesOverviewTrends:o}),[e,t,i,o]);return e.isLoading||t.isLoading||i.isLoading||o.isLoading?s.createElement(R,null):s.createElement(a.Provider,{...m,value:n})};export{L as SummaryAggregationsProvider,f as useSummaryAggregationsContext};
2
2
  //# sourceMappingURL=SummaryAggregationsProvider.esm.js.map