@spotify/backstage-plugin-soundcheck 0.14.2 → 0.14.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/alpha.d.ts +12 -12
  3. package/dist/components/AreaChart/AreaChart.esm.js +2 -0
  4. package/dist/components/AreaChart/ChartTooltip.esm.js +2 -0
  5. package/dist/components/AreaChart/Legend.esm.js +2 -0
  6. package/dist/components/AreaChart/LegendItem.esm.js +2 -0
  7. package/dist/components/AreaChart/utils.esm.js +2 -0
  8. package/dist/components/CacheConfig/utils.esm.js +1 -1
  9. package/dist/components/CampaignDetailsPage/CampaignDetailRow.esm.js +1 -1
  10. package/dist/components/CampaignDetailsPage/CampaignDetails.esm.js +1 -1
  11. package/dist/components/CampaignInsightsPage/CampaignInsightsPage.esm.js +2 -0
  12. package/dist/components/CampaignInsightsPage/CampaignStatusHistoryTile.esm.js +2 -0
  13. package/dist/components/CampaignInsightsPage/CampaignStatusTile.esm.js +2 -0
  14. package/dist/components/CampaignInsightsPage/DaysRemainingTile.esm.js +2 -0
  15. package/dist/components/CampaignsPage/CampaignListPage/CampaignMetadata.esm.js +1 -1
  16. package/dist/components/CampaignsPage/CampaignListPage/CampaignSummaryCard.esm.js +1 -1
  17. package/dist/components/CategoryBar/CategoryBar.esm.js +2 -0
  18. package/dist/components/CheckCard/CheckCard.esm.js +1 -1
  19. package/dist/components/CheckPage/CheckInsightsPage.esm.js +1 -1
  20. package/dist/components/CheckPage/FilterBar/FilterBar.esm.js +1 -1
  21. package/dist/components/ChecksPage/CheckListPage/CheckMetadata.esm.js +1 -1
  22. package/dist/components/CollectorPage/Configurators/Common/FactCollectionConfig.esm.js +1 -1
  23. package/dist/components/CollectorPage/Configurators/DataDog/DataDogConfigurator.esm.js +1 -1
  24. package/dist/components/CollectorPage/Configurators/Github/GithubConfigurator.esm.js +1 -1
  25. package/dist/components/CollectorPage/Configurators/Gitlab/GitlabConfigurator.esm.js +1 -1
  26. package/dist/components/CollectorPage/Configurators/Jira/IssuesSearchFactDetailsComponent.esm.js +1 -1
  27. package/dist/components/CollectorPage/Configurators/Jira/JiraConfigurator.esm.js +1 -1
  28. package/dist/components/CollectorPage/Configurators/Kubernetes/KubernetesConfigurator.esm.js +1 -1
  29. package/dist/components/CollectorPage/Configurators/Kubernetes/KubernetesFactDetails.esm.js +2 -0
  30. package/dist/components/CollectorPage/Configurators/Kubernetes/types.esm.js +2 -0
  31. package/dist/components/CollectorPage/Configurators/Kubernetes/utils.esm.js +1 -1
  32. package/dist/components/CollectorPage/Configurators/Kubernetes/validation.esm.js +2 -0
  33. package/dist/components/CollectorPage/Configurators/NewRelic/NewRelicConfigurator.esm.js +1 -1
  34. package/dist/components/CollectorPage/Configurators/PagerDuty/IncidentsFactDetailsComponent.esm.js +1 -1
  35. package/dist/components/CollectorPage/Configurators/PagerDuty/PagerDutyConfigurator.esm.js +1 -1
  36. package/dist/components/CollectorPage/Configurators/SCM/ScmConfigurator.esm.js +1 -1
  37. package/dist/components/CollectorPage/Configurators/SCM/utils.esm.js +1 -1
  38. package/dist/components/CollectorPage/Configurators/SonarQube/MeasuresFactDetailsInput.esm.js +1 -1
  39. package/dist/components/CollectorPage/Configurators/SonarQube/MetricsInput.esm.js +1 -1
  40. package/dist/components/CollectorPage/Configurators/SonarQube/SonarQubeConfigurator.esm.js +1 -1
  41. package/dist/components/DroppableInput/DroppableInput.esm.js +1 -1
  42. package/dist/components/Filter/FilterPreviewTable/EntityTableColumns.esm.js +2 -0
  43. package/dist/components/Filter/FilterPreviewTable/FilterPreviewTable.esm.js +1 -1
  44. package/dist/components/FormControlledTextField/FormControlledTextField.esm.js +2 -0
  45. package/dist/components/LevelCard/LevelCard.esm.js +1 -1
  46. package/dist/components/OverviewTable/resultsTableUtils.esm.js +1 -1
  47. package/dist/components/PassRateGrid/PassRateMetadata.esm.js +1 -1
  48. package/dist/components/RoutingPage/RoutingPage.esm.js +1 -1
  49. package/dist/components/TechHealth/Filters/useFacetOptions.esm.js +1 -1
  50. package/dist/components/TrackPage/FilterBar/FilterBar.esm.js +1 -1
  51. package/dist/components/TrackPage/FilterBar/util.esm.js +2 -0
  52. package/dist/components/TrackPage/TrackEntitiesTable/TrackEntitiesTable.esm.js +1 -1
  53. package/dist/components/TrackPage/TrackPage.esm.js +1 -1
  54. package/dist/components/TrackPage/TrackProgressCard.esm.js +1 -1
  55. package/dist/graphql/generated/index.esm.js +1 -0
  56. package/dist/hooks/campaigns/useArchiveCampaign.esm.js +1 -1
  57. package/dist/hooks/campaigns/useCreateCampaign.esm.js +1 -1
  58. package/dist/hooks/campaigns/useDeleteCampaign.esm.js +1 -1
  59. package/dist/hooks/campaigns/useGetCampaign.esm.js +1 -1
  60. package/dist/hooks/checks/useCreateCheck.esm.js +1 -1
  61. package/dist/hooks/checks/useExecuteCheck.esm.js +1 -1
  62. package/dist/hooks/checks/useUpdateCheck.esm.js +1 -1
  63. package/dist/hooks/collectors/useUpdateCollectorConfig.esm.js +1 -1
  64. package/dist/hooks/tracks/useCreateTrack.esm.js +1 -1
  65. package/dist/hooks/tracks/useDeleteTrack.esm.js +1 -1
  66. package/package.json +37 -26
  67. package/alpha/package.json +0 -7
  68. package/dist/components/CampaignDetailsPage/CampaignChecks.esm.js +0 -2
  69. package/dist/components/CampaignDetailsPage/CampaignDetailsPage.esm.js +0 -2
  70. package/dist/components/CampaignDetailsPage/CampaignMilestones.esm.js +0 -2
  71. package/dist/components/CampaignDetailsPage/CampaignProgress.esm.js +0 -2
  72. package/dist/components/CampaignDetailsPage/CampaignResultsTable.esm.js +0 -2
  73. package/dist/hooks/campaigns/useGetCampaignProgress.esm.js +0 -2
@@ -1,2 +1,2 @@
1
- import{asArray as u}from"@spotify/backstage-plugin-soundcheck-common";import{mapToCacheConfig as d,mapCacheConfigToHumanDurationOrBoolean as f}from"../../../CacheConfig/utils.esm.js";import"../../../CacheConfig/CacheConfigComponent.esm.js";import{mapCatalogFilterToFilters as b,mapFiltersToCatalogFilter as m}from"../../../Filter/utils.esm.js";import"../../../Filter/FilterComponent.esm.js";import"../../../Frequency/types.esm.js";import{mapHumanDurationOrCronToFrequency as y,mapFrequencyToHumanDurationOrCron as C}from"../../../Frequency/util.esm.js";import"../../../Frequency/FrequencyComponent.esm.js";import{defaultCollectorOption as s}from"../Common/CollectorOption.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."}},c=()=>({pods:s(),services:s(),deployments:s(),hpas:s(),statefulSets:s(),podDisruptionBudgets:s(),ingresses:s()});function g(e){if(Object.values(e).some(t=>t.enabled)){const t={},i=[];return t.collects=i,Object.entries(e).forEach(([o,n])=>{if(n.enabled){const{cacheConfig:a,frequency:r,filters:p}=n;i.push({type:l[o].type,frequency:C(r),filter:m(p),cache:f(a)})}}),t}return{collects:[]}}function h(e){const t=c();if(e){const i=e.collects;if(i)for(const o of u(i)){const n=o.type;Object.entries(l).map(([a,r])=>{n===r.type&&(t[a]={enabled:!0,frequency:y(o.frequency??e.frequency),filters:b(o.filter??e.filter),cacheConfig:d(o.cache??e.cache)})})}}return t}export{l as K8S_COLLECTOR_FIELDS,c as defaultKubernetesConfig,h as mapConfigToKubernetesCollectorConfig,g as mapKubernetesCollectorConfigToConfig};
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};
2
2
  //# sourceMappingURL=utils.esm.js.map
@@ -0,0 +1,2 @@
1
+ import{validNameRegex as f}from"@spotify/backstage-plugin-soundcheck-common";import{z as e}from"zod";import{FIELD_IS_REQUIRED_MSG as u}from"../../../../utils/validation.esm.js";import{BaseCollectorSchema as d,CollectorOptionSchema as t}from"../Common/CollectorOption.esm.js";const i="Fact name is not unique",n="The field contains forbidden characters",m="Max 100 characters",p=d.extend({enabled:e.boolean(),factDetails:e.strictObject({factName:e.string().min(1,u).max(100,m).regex(f,n),customResource:e.strictObject({group:e.string(),apiVersion:e.string(),plural:e.string()})})}).strict(),_=e.strictObject({enabled:e.boolean(),collectors:e.array(p).superRefine((o,l)=>{const c=o.map(s=>s.factDetails.factName),r=c.filter((s,a)=>c.indexOf(s)!==a);r.length&&o.forEach((s,a)=>{r.includes(s.factDetails.factName)&&l.addIssue({code:e.ZodIssueCode.custom,message:i,path:[a,"factDetails","factName"]})})})}),S=e.strictObject({deployments:t,hpas:t,ingresses:t,podDisruptionBudgets:t,pods:t,services:t,statefulSets:t,customResources:_});export{i as FACT_NAME_IS_NOT_UNIQUE_MSG,n as INVALID_CHARACTERS_MSG,m as MAX_100_CHARACTERS_MSG,S as customResourceFormSchema};
2
+ //# sourceMappingURL=validation.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}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 w}from"../../../../hooks/useConfirmationModal.esm.js";import{useNavigateBack as y}from"../../../../hooks/useNavigateBack.esm.js";import{useUpdateCollectorConfig as E}from"../../../../hooks/collectors/useUpdateCollectorConfig.esm.js";import{integrationsPageRouteRef as N}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 v}from"../../../SoundcheckHeader/useHeader.esm.js";import{FactCollectionConfig as a}from"../Common/FactCollectionConfig.esm.js";import{collectorHeaderContent as B,confirmationModalContent as F}from"../Common/utils.esm.js";import{mapConfigToNewRelicCollectorConfig as M,defaultNewRelicConfig as P,mapNewRelicCollectorConfigToConfig as T}from"./utils.esm.js";const k=h(t=>({spacer:{height:t.spacing(8),width:"100%"},section:{marginBottom:t.spacing(2)},form:{marginBottom:t.spacing(2)}})),x=({disabled:t,selectedCollector:i})=>{const{control:r,formState:{errors:o},handleSubmit:n}=b({defaultValues:i?M(i.config):P(),mode:"onChange"}),l=k(),s=!!o.entity||!!o.entitySearch||!!o.policiesSearch,{mutateAsync:p}=E(),[f,d]=y(N),{showModal:u}=w(),c=async g=>{if(!await u(F(i)))return;const C=T(g);await p({collectorId:i.id,config:C})&&d()};return v(B(i)),e.createElement(e.Fragment,null,e.createElement(S,{className:l.form},e.createElement("form",{onSubmit:n(c)},e.createElement(a,{name:"entity",label:"Entity",description:"Collects details about New Relic entity with a specific id.",control:r,disabled:t,errors:o.entity}),e.createElement(m,null),e.createElement(a,{name:"entitySearch",label:"Entity Search",description:"Collects details about New Relic entities with a specific tag.",control:r,disabled:t,errors:o.entitySearch}),e.createElement(m,null),e.createElement(a,{name:"policiesSearch",label:"Policies Search",description:"Collects details about New Relic policies for a specific account.",control:r,disabled:t,errors:o.policiesSearch}))),e.createElement("div",{className:l.section},e.createElement(R,{onCancel:f,saveButtonText:"Save",isLoading:!1,onSave:n(c),disableSave:s})))};export{x 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"../../../../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{makeStyles as c,Typography as i,TextField as p}from"@material-ui/core";import e from"react";import{Controller as s}from"react-hook-form";import{StatusesComponent as d}from"./StatusesComponent.esm.js";import{PAGERDUTY_COLLECTOR_FIELDS as f}from"./utils.esm.js";const T=c(t=>({root:{paddingTop:t.spacing(1)},textInput:{marginTop:0,width:"255px"},helperText:{marginLeft:0}})),x=({name:t,disabled:l,control:m,errors:r})=>{const n=T(),{factName:o}=f.factDetails;return e.createElement("div",{className:n.root},e.createElement(i,{variant:"subtitle2"},o.name),e.createElement(s,{name:`${t}.factName`,control:m,render:({field:a})=>e.createElement(p,{...a,type:"text",variant:"outlined",margin:"dense",placeholder:o.placeholder,className:n.textInput,disabled:l,error:!!r?.factName,helperText:r?.factName?.message??o.helperText,FormHelperTextProps:{className:n.helperText}})}),e.createElement(s,{name:`${t}.statuses`,control:m,render:({field:a})=>e.createElement(d,{disabled:l,value:a.value,onChange:a.onChange,errors:r?.statuses})}))};export{x as IncidentsFactDetailsComponent};
1
+ import{makeStyles as i,Typography as p,TextField as c}from"@material-ui/core";import e from"react";import{useFormContext as d,Controller as s}from"react-hook-form";import{StatusesComponent as f}from"./StatusesComponent.esm.js";import{PAGERDUTY_COLLECTOR_FIELDS as x}from"./utils.esm.js";const T=i(t=>({root:{paddingTop:t.spacing(1)},textInput:{marginTop:0,width:"255px"},helperText:{marginLeft:0}})),h=({name:t,disabled:l})=>{const o=T(),{control:m}=d(),{factName:n}=x.factDetails;return e.createElement("div",{className:o.root},e.createElement(p,{variant:"subtitle2"},n.name),e.createElement(s,{name:`${t}.factName`,control:m,render:({field:r,fieldState:{error:a}})=>e.createElement(c,{...r,type:"text",variant:"outlined",margin:"dense",placeholder:n.placeholder,className:o.textInput,disabled:l,error:!!a,helperText:a?.message??n.helperText,FormHelperTextProps:{className:o.helperText}})}),e.createElement(s,{name:`${t}.statuses`,control:m,render:({field:r,fieldState:{error:a}})=>e.createElement(f,{disabled:l,value:r.value,onChange:r.onChange,errors:a})}))};export{h as IncidentsFactDetailsComponent};
2
2
  //# sourceMappingURL=IncidentsFactDetailsComponent.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 m}from"@material-ui/core";import e from"react";import{useForm as b}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 y}from"../../../../hooks/useConfirmationModal.esm.js";import{useNavigateBack as D}from"../../../../hooks/useNavigateBack.esm.js";import{useUpdateCollectorConfig as P}from"../../../../hooks/collectors/useUpdateCollectorConfig.esm.js";import{integrationsPageRouteRef as T}from"../../../../routes.esm.js";import{FooterButtons as L}from"../../../FooterButtons/FooterButtons.esm.js";import"../../../SoundcheckHeader/SoundcheckHeader.esm.js";import"../../../SoundcheckHeader/SoundcheckHeaderContext.esm.js";import{useHeader as h}from"../../../SoundcheckHeader/useHeader.esm.js";import{FactCollectionConfig as i}from"../Common/FactCollectionConfig.esm.js";import{collectorHeaderContent as w,confirmationModalContent as R}from"../Common/utils.esm.js";import{IncidentsFactDetailsComponent as F}from"./IncidentsFactDetailsComponent.esm.js";import{mapConfigToPagerDutyCollectorConfig as I,defaultPagerDutyConfig as N,SERVICE_COLLECTOR_TYPE as O,STANDARDS_COLLECTOR_TYPE as _,INCIDENTS_COLLECTOR_TYPE as k,incidentsCollectorConfig as B,mapPagerDutyCollectorConfigToConfig as Y}from"./utils.esm.js";import{pagerDutyCollectorFormSchema as A}from"./validation.esm.js";const M=v(t=>({spacer:{height:t.spacing(8),width:"100%"},section:{marginBottom:t.spacing(2)}})),x=({disabled:t,selectedCollector:r})=>{const{control:a,formState:{errors:o},handleSubmit:n}=b({defaultValues:r?I(r.config):N(),mode:"onChange",resolver:E(A)}),l=M(),c=!!o.service||!!o.standards||!!o.incidents,{mutateAsync:d}=P(),[p,C]=D(T),{showModal:f}=y(),s=async u=>{if(!await f(R(r)))return;const g=Y(u);await d({collectorId:r.id,config:g})&&C()};return h(w(r)),e.createElement(e.Fragment,null,e.createElement(S,{className:l.section},e.createElement("form",{onSubmit:n(s)},e.createElement(i,{name:O.toLowerCase(),label:"Service",description:"Collects details about PagerDuty service linked to an entity.",control:a,disabled:t,errors:o.service}),e.createElement(m,null),e.createElement(i,{name:_.toLowerCase(),label:"Standards",description:"Collects details about standards applied to a PagerDuty service linked to an entity.",control:a,disabled:t,errors:o.standards}),e.createElement(m,null),e.createElement(i,{name:k.toLowerCase(),label:"Incidents",description:"Collects details about incidents associated with a PagerDuty service linked to an entity.",control:a,disabled:t,errors:o.incidents,FactDetailsComponent:F,multipleCollectors:{enable:!0,defaultConfig:B()}}))),e.createElement("div",{className:l.section},e.createElement(L,{onCancel:p,saveButtonText:"Save",isLoading:!1,onSave:n(s),disableSave:c})))};export{x 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"../../../../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{zodResolver as E}from"@hookform/resolvers/zod";import{makeStyles as S,Paper as O,Divider as l}from"@material-ui/core";import e from"react";import{useForm as L}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 T}from"../../../../hooks/useConfirmationModal.esm.js";import{useNavigateBack as x}from"../../../../hooks/useNavigateBack.esm.js";import{useUpdateCollectorConfig as b}from"../../../../hooks/collectors/useUpdateCollectorConfig.esm.js";import{integrationsPageRouteRef as h}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 y}from"../../../SoundcheckHeader/useHeader.esm.js";import{collectorHeaderContent as R,confirmationModalContent as _}from"../Common/utils.esm.js";import{FactCollectionConfig as n}from"./FactCollectionConfig.esm.js";import{mapConfigToScmCollectorConfig as N,DEFAULT_SCM_COLLECTOR_CONFIG as F,EXISTS_COLLECTOR_TYPE as M,REGEX_COLLECTOR_TYPE as w,JSON_COLLECTOR_TYPE as P,mapScmCollectorConfigToConfig as Y}from"./utils.esm.js";import{scmCollectorFormSchema as A}from"./validation.esm.js";const B=S(o=>({spacer:{height:o.spacing(8),width:"100%"},section:{marginBottom:o.spacing(2)}})),J=({disabled:o,selectedCollector:r})=>{const{control:i,formState:{errors:t},handleSubmit:a}=L({defaultValues:r?N(r.config):F,mode:"onChange",resolver:E(A)}),m=B(),c=!!t.exists||!!t.regex||!!t.json,{mutateAsync:p}=b(),[f,d]=x(h),{showModal:C}=T(),s=async g=>{if(!await C(_(r)))return;const u=Y(g);await p({collectorId:r.id,config:u})&&d()};return y(R(r)),e.createElement(e.Fragment,null,e.createElement(O,{className:m.section},e.createElement("form",{onSubmit:a(s)},e.createElement(n,{name:M,label:"Exists",description:"Collects information on the existence of files within an entity's repository.",control:i,disabled:o,errors:t.exists}),e.createElement(l,null),e.createElement(n,{name:w,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(l,null),e.createElement(n,{name:P,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:m.section},e.createElement(v,{onCancel:f,saveButtonText:"Save",isLoading:!1,onSave:a(s),disableSave:c,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"../../../../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 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};
2
2
  //# sourceMappingURL=utils.esm.js.map
@@ -1,2 +1,2 @@
1
- import{makeStyles as c,Typography as i,TextField as p}from"@material-ui/core";import e from"react";import{Controller as s}from"react-hook-form";import{MetricsInput as d}from"./MetricsInput.esm.js";import{SONARQUBE_COLLECTOR_FIELDS as f}from"./utils.esm.js";const h=c(t=>({root:{paddingTop:t.spacing(1)},textInput:{marginTop:0,width:"500px"},helperText:{marginLeft:0}})),x=({name:t,disabled:n,control:m,errors:a})=>{const o=h(),{factName:l}=f.factDetails;return e.createElement("div",{className:o.root},e.createElement(i,{variant:"subtitle2"},l.name),e.createElement(s,{name:`${t}.factName`,control:m,render:({field:r})=>e.createElement(p,{...r,type:"text",variant:"outlined",margin:"dense",placeholder:l.placeholder,className:o.textInput,disabled:n,error:!!a?.factName,helperText:a?.factName?.message??l.helperText,FormHelperTextProps:{className:o.helperText}})}),e.createElement(s,{name:`${t}.metrics`,control:m,render:({field:r})=>e.createElement(d,{disabled:n,value:r.value,onChange:r.onChange,errors:a?.metrics})}))};export{x as MeasuresFactDetailsInput};
1
+ import{makeStyles as p,Typography as s,TextField as c}from"@material-ui/core";import e from"react";import{useFormContext as d,Controller as i}from"react-hook-form";import{MetricsInput as f}from"./MetricsInput.esm.js";import{SONARQUBE_COLLECTOR_FIELDS as x}from"./utils.esm.js";const u=p(t=>({root:{paddingTop:t.spacing(1)},textInput:{marginTop:0,width:"500px"},helperText:{marginLeft:0}})),h=({name:t,disabled:l})=>{const o=u(),{control:m}=d(),{factName:n}=x.factDetails;return e.createElement("div",{className:o.root},e.createElement(s,{variant:"subtitle2"},n.name),e.createElement(i,{name:`${t}.factName`,control:m,render:({field:r,fieldState:{error:a}})=>e.createElement(c,{...r,type:"text",variant:"outlined",margin:"dense",placeholder:n.placeholder,className:o.textInput,disabled:l,error:!!a,helperText:a?.message??n.helperText,FormHelperTextProps:{className:o.helperText}})}),e.createElement(i,{name:`${t}.metrics`,control:m,render:({field:r,fieldState:{error:a}})=>e.createElement(f,{disabled:l,value:r.value,onChange:r.onChange,errors:a})}))};export{h as MeasuresFactDetailsInput};
2
2
  //# sourceMappingURL=MeasuresFactDetailsInput.esm.js.map
@@ -1,2 +1,2 @@
1
- import{makeStyles as x,Typography as T,Grid as o,Chip as v,TextField as y}from"@material-ui/core";import t,{useState as u,useEffect as C}from"react";import{SONARQUBE_COLLECTOR_FIELDS as N}from"./utils.esm.js";const b=x(r=>({caption:{marginTop:r.spacing(2),marginBottom:r.spacing(1)},metricsInput:{width:"500px"},metricChips:{marginBottom:r.spacing(1)},helperText:{marginLeft:0}})),I=({value:r,onChange:l,disabled:p,errors:d})=>{const i=b(),{metrics:n}=N.factDetails,[a,g]=u(r),[m,h]=u("");C(()=>{l&&l(a)},[a,l]);const E=e=>{e.key==="Enter"&&(a.includes(m.trim())||g([...a,m]),h(""))},f=(e,s)=>{g(a.filter(c=>c!==s))};return t.createElement("div",null,t.createElement("div",{className:i.caption},t.createElement(T,{variant:"subtitle2"},n.name)),t.createElement(o,{container:!0,direction:"column",spacing:0,className:i.metricsInput},t.createElement(o,{item:!0},a.map((e,s)=>t.createElement(v,{key:`${e}-${s}`,label:e,disabled:p,size:"small",onDelete:c=>f(c,e),className:i.metricChips}))),t.createElement(o,{item:!0},t.createElement(y,{type:"text",variant:"outlined",margin:"dense",placeholder:n.placeholder,className:i.metricsInput,disabled:p,error:!!d,fullWidth:!0,value:m,onChange:e=>h(e.target.value),onKeyDown:E,helperText:d?.message??n.helperText,FormHelperTextProps:{className:i.helperText}}))))};export{I as MetricsInput};
1
+ import{makeStyles as x,Typography as T,Grid as o,Chip as v,TextField as y}from"@material-ui/core";import t,{useState as u,useEffect as C}from"react";import{SONARQUBE_COLLECTOR_FIELDS as N}from"./utils.esm.js";const b=x(r=>({caption:{marginTop:r.spacing(2),marginBottom:r.spacing(1)},metricsInput:{width:"500px"},metricChips:{marginBottom:r.spacing(1)},helperText:{marginLeft:0}})),I=({value:r,onChange:l,disabled:p,errors:d})=>{const i=b(),{metrics:m}=N.factDetails,[a,g]=u(r),[n,h]=u("");C(()=>{l&&l(a)},[a,l]);const E=e=>{e.key==="Enter"&&(a?.includes(n.trim())||g(a?[...a,n.trim()]:[n.trim()]),h(""))},f=(e,s)=>{g(a?.filter(c=>c!==s))};return t.createElement("div",null,t.createElement("div",{className:i.caption},t.createElement(T,{variant:"subtitle2"},m.name)),t.createElement(o,{container:!0,direction:"column",spacing:0,className:i.metricsInput},t.createElement(o,{item:!0},a?.map((e,s)=>t.createElement(v,{key:`${e}-${s}`,label:e,disabled:p,size:"small",onDelete:c=>f(c,e),className:i.metricChips}))),t.createElement(o,{item:!0},t.createElement(y,{type:"text",variant:"outlined",margin:"dense",placeholder:m.placeholder,className:i.metricsInput,disabled:p,error:!!d,fullWidth:!0,value:n,onChange:e=>h(e.target.value),onKeyDown:E,helperText:d?.message??m.helperText,FormHelperTextProps:{className:i.helperText}}))))};export{I as MetricsInput};
2
2
  //# sourceMappingURL=MetricsInput.esm.js.map
@@ -1,2 +1,2 @@
1
- import{zodResolver as b}from"@hookform/resolvers/zod";import{makeStyles as S,Paper as j,Divider as s}from"@material-ui/core";import e from"react";import{useForm as E}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 v}from"../../../../hooks/useNavigateBack.esm.js";import{useUpdateCollectorConfig as Q}from"../../../../hooks/collectors/useUpdateCollectorConfig.esm.js";import{integrationsPageRouteRef as y}from"../../../../routes.esm.js";import{FooterButtons as F}from"../../../FooterButtons/FooterButtons.esm.js";import"../../../SoundcheckHeader/SoundcheckHeader.esm.js";import"../../../SoundcheckHeader/SoundcheckHeaderContext.esm.js";import{useHeader as T}from"../../../SoundcheckHeader/useHeader.esm.js";import{FactCollectionConfig as n}from"../Common/FactCollectionConfig.esm.js";import{collectorHeaderContent as k,confirmationModalContent as w}from"../Common/utils.esm.js";import{MeasuresFactDetailsInput as M}from"./MeasuresFactDetailsInput.esm.js";import{mapConfigToSonarQubeCollectorConfig as B,defaultSonarQubeConfig as N,measuresCollectorConfig as P,mapSonarQubeCollectorConfigToConfig as D}from"./utils.esm.js";import{sonarQubeCollectorFormSchema as I}from"./validation.esm.js";const R=S(t=>({spacer:{height:t.spacing(8),width:"100%"},section:{marginBottom:t.spacing(2)}})),x=({disabled:t,selectedCollector:r})=>{const{control:a,formState:{errors:o},handleSubmit:i}=E({defaultValues:r?B(r.config):N(),mode:"onChange",resolver:b(I)}),l=R(),c=!!o.projects||!!o.projectTags||!!o.issues||!!o.measures,{mutateAsync:p}=Q(),[u,d]=v(y),{showModal:f}=h(),m=async g=>{if(!await f(w(r)))return;const C=D(g);await p({collectorId:r.id,config:C})&&d()};return T(k(r)),e.createElement(e.Fragment,null,e.createElement(j,{className:l.section},e.createElement("form",{onSubmit:i(m)},e.createElement(n,{name:"projects",label:"Projects",description:"Collects details about SonarQube project linked to an entity.",control:a,disabled:t,errors:o.projects}),e.createElement(s,null),e.createElement(n,{name:"projectTags",label:"Project Tags",description:"Collects details about tags set on a SonarQube project linked to an entity.",control:a,disabled:t,errors:o.projectTags}),e.createElement(s,null),e.createElement(n,{name:"issues",label:"Issues",description:"Collects details about issues associated with a SonarQube project linked to an entity.",control:a,disabled:t,errors:o.issues}),e.createElement(s,null),e.createElement(n,{name:"measures",label:"Measures",description:"Collects details about measures associated with a SonarQube project linked to an entity.",control:a,disabled:t,errors:o.measures,FactDetailsComponent:M,multipleCollectors:{enable:!0,defaultConfig:P()}}))),e.createElement("div",{className:l.section},e.createElement(F,{onCancel:u,saveButtonText:"Save",isLoading:!1,onSave:i(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"../../../../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{makeStyles as y,Chip as M}from"@material-ui/core";import D from"@material-ui/icons/DragIndicator";import r,{useState as E}from"react";import{useDrop as S}from"react-dnd";import{useContextMenu as B}from"../../hooks/useContextMenu.esm.js";import{ContextMenu as N}from"../ContextMenu/ContextMenu.esm.js";import{useChipStyles as O}from"../DraggableChip/chipStyles.esm.js";const z=y(e=>({input:{border:`1px solid ${e.palette.divider}`,borderRadius:4,padding:e.spacing(1),minHeight:80},hoverBackground:{background:e.palette.action.hover},normalBackground:{background:e.palette.background.default},error:{border:"1px solid red"},chipContainer:{display:"flex",flexDirection:"column",fontSize:e.typography.body1.fontSize,color:e.palette.text.primary,gap:e.spacing(.75)}})),I=({chips:e,onDelete:a,onDrop:i,error:c=!1,placeholder:m="",disabled:s})=>{const o=z(),d=O(),[{isOver:u},g]=S(()=>({accept:"chip",drop:t=>{i(t)},collect:t=>({isOver:t.isOver()})}),[i]),h=["Remove check"],{contextMenu:l,onContextMenu:x,onContextMenuClose:C,onContextMenuClick:f}=B(),[p,b]=E(null),k=(t,n)=>{x(t),b(n)},v=()=>{f(),p&&a(p)};return r.createElement("div",{ref:g,className:`${o.input} ${c?o.error:""} ${u?o.hoverBackground:o.normalBackground}`,"data-testid":"droppable-input"},r.createElement("div",{className:o.chipContainer},e?.length?e.map(t=>r.createElement(M,{key:t.id,label:t.name,className:d.chip,icon:r.createElement(D,null),style:{cursor:"pointer"},onDelete:()=>a(t),disabled:s,onContextMenu:n=>k(n,t)})):m),r.createElement(N,{x:l.mouseX,y:l.mouseY,menuItems:h,onClose:C,onClick:v}))};export{I as DroppableInput};
1
+ import{makeStyles as y,Chip as M}from"@material-ui/core";import D from"@material-ui/icons/DragIndicator";import r,{useState as E}from"react";import{useDrop as S}from"react-dnd";import{useContextMenu as B}from"../../hooks/useContextMenu.esm.js";import{ContextMenu as N}from"../ContextMenu/ContextMenu.esm.js";import{useChipStyles as O}from"../DraggableChip/chipStyles.esm.js";const z=y(e=>({input:{border:`1px solid ${e.palette.divider}`,borderRadius:4,padding:e.spacing(1),minHeight:80},hoverBackground:{background:e.palette.action.hover},normalBackground:{background:e.palette.background.default},error:{border:"1px solid red"},chipContainer:{display:"flex",flexDirection:"column",fontSize:e.typography.body1.fontSize,color:e.palette.text.primary,gap:e.spacing(.75)}})),I=({chips:e,onDelete:a,onDrop:i,error:c=!1,placeholder:m="",disabled:s})=>{const o=z(),d=O(),[{isOver:u},h]=S(()=>({accept:"chip",drop:t=>{i(t)},collect:t=>({isOver:t.isOver()})}),[i]),g=["Remove check"],{contextMenu:l,onContextMenu:x,onContextMenuClose:C,onContextMenuClick:f}=B(),[p,b]=E(null),k=(t,n)=>{x(t),b(n)},v=()=>{f(),p&&a(p)};return r.createElement("div",{ref:h,className:`${o.input} ${c?o.error:""} ${u?o.hoverBackground:o.normalBackground}`,"data-testid":"droppable-input"},r.createElement("div",{className:o.chipContainer},e?.length?e.map(t=>r.createElement(M,{key:t.id,label:t.name,className:d.chip,icon:r.createElement(D,null),style:{cursor:"pointer"},onDelete:()=>a(t),disabled:s,onContextMenu:n=>k(n,t)})):m),r.createElement(N,{x:l.mouseX,y:l.mouseY,menuItems:g,onClose:C,onClick:v}))};export{I as DroppableInput};
2
2
  //# sourceMappingURL=DroppableInput.esm.js.map
@@ -0,0 +1,2 @@
1
+ import{RELATION_PART_OF as s,RELATION_OWNED_BY as p}from"@backstage/catalog-model";import{EntityRefLink as f,EntityRefLinks as u,getEntityRelations as y,humanizeEntityRef as g}from"@backstage/plugin-catalog-react";import{Chip as E}from"@material-ui/core";import a from"react";const o=t=>{const{title:i,relation:c,defaultKind:r,filter:d}=t,m=e=>y(e,c,d),n=e=>m(e).map(l=>g(l,{defaultKind:r})).join(", ");return{title:i,customFilterAndSearch(e,l){return n(l).includes(e)},customSort(e,l){return n(e).localeCompare(n(l))},render:e=>a.createElement(u,{entityRefs:m(e),defaultKind:r,target:"_blank"})}},R=()=>({title:"Name",highlight:!0,render:t=>a.createElement(f,{entityRef:t,title:t.metadata?.title,target:"_blank",rel:"noreferrer"})}),C=()=>o({title:"System",relation:s,defaultKind:"system",filter:{kind:"system"}}),T=()=>o({title:"Owner",relation:p,defaultKind:"group"}),x=()=>({title:"Lifecycle",field:"spec.lifecycle"}),S=()=>({title:"Type",field:"spec.type"}),h=()=>({title:"Tags",field:"metadata.tags",cellStyle:{padding:"0px 16px 0px 20px"},render:t=>a.createElement(a.Fragment,null,t.metadata.tags&&t.metadata.tags.map(i=>a.createElement(E,{key:i,label:i,size:"small",variant:"outlined",style:{marginTop:"4px",marginBottom:"4px"}})))});export{R as createEntityRefColumn,T as createOwnerColumn,x as createSpecLifecycleColumn,S as createSpecTypeColumn,C as createSystemColumn,h as createTagsColumn};
2
+ //# sourceMappingURL=EntityTableColumns.esm.js.map
@@ -1,2 +1,2 @@
1
- import{Table as f}from"@backstage/core-components";import{EntityTable as n,useEntityList as E,EntityTypeFilter as w,EntityOwnerFilter as h,EntityLifecycleFilter as b}from"@backstage/plugin-catalog-react";import{makeStyles as S,Chip as v,useTheme as x}from"@material-ui/core";import t,{useEffect as F,useMemo as C}from"react";import{EntityKindsFilter as L}from"./EntityKindsFilter.esm.js";import{EntitySystemsFilter as N}from"./EntitySystemsFilter.esm.js";import{CatalogTableToolbar as z}from"./EntityTableToolbar.esm.js";import{EntityTagFilter as O}from"./EntityTagFilter.esm.js";const R=S(()=>({entityTable:{'& span[class*="CatalogReactEntityDisplayName-root"]':{"&:hover":{textDecoration:"underline"}}}})),r=[n.columns.createEntityRefColumn({}),n.columns.createSystemColumn(),n.columns.createOwnerColumn(),n.columns.createSpecTypeColumn(),n.columns.createSpecLifecycleColumn(),{title:"Tags",field:"metadata.tags",cellStyle:{padding:"0px 16px 0px 20px"},render:e=>t.createElement(t.Fragment,null,e.metadata.tags&&e.metadata.tags.map(l=>t.createElement(v,{key:l,label:l,size:"small",variant:"outlined",style:{marginTop:"4px",marginBottom:"4px"}})))}],A=e=>({kinds:e.selectedKinds.length?new L(e.selectedKinds):void 0,systems:e.selectedSystems.length?new N(e.selectedSystems):void 0,type:e.selectedTypes.length?new w(e.selectedTypes):void 0,owners:e.selectedOwners.length?new h(e.selectedOwners):void 0,lifecycles:e.selectedLifecycles.length?new b(e.selectedLifecycles):void 0,tag:e.selectedTags.length?new O(e.selectedTags):void 0}),D=({filter:e,additionalColumns:l=[],title:m,hideTags:i=!1})=>{const{updateFilters:o,entities:c,pageInfo:a,totalItems:p,loading:d}=E(),g=x(),y=R();F(()=>{const s=A(e);o(s)},[e,o]);const u=C(()=>i?[...r.slice(0,-1),...l]:[...r,...l],[l,i]),T=m||`All (${p||0})`;return t.createElement(t.Fragment,null,t.createElement("div",{className:y.entityTable},t.createElement(f,{title:T,columns:u,data:c,options:{padding:"dense",paging:!!a?.next||!!a?.prev,toolbar:!0,draggable:!1,tableLayout:"fixed",search:!1,showTitle:!0,rowStyle:{fontSize:g.typography.body1.fontSize},showFirstLastPageButtons:!1,emptyRowsWhenPaging:!1,pageSizeOptions:[],loadingType:"linear",showEmptyDataSourceMessage:!d,pageSize:10},onPageChange:s=>{s>0?a?.next?.():a?.prev?.()},components:{Toolbar:z},page:a?.prev?1:0,totalCount:a?.next?Number.MAX_VALUE:Number.MIN_SAFE_INTEGER,localization:{pagination:{labelDisplayedRows:""}}})))};export{D as FilterPreviewTable};
1
+ import{Table as f}from"@backstage/core-components";import{useEntityList as T,EntityTypeFilter as w,EntityOwnerFilter as E,EntityLifecycleFilter as h}from"@backstage/plugin-catalog-react";import{makeStyles as b,useTheme as S}from"@material-ui/core";import l,{useEffect as v,useMemo as C}from"react";import{EntityKindsFilter as F}from"./EntityKindsFilter.esm.js";import{EntitySystemsFilter as L}from"./EntitySystemsFilter.esm.js";import{createEntityRefColumn as x,createSystemColumn as N,createOwnerColumn as z,createSpecTypeColumn as M,createSpecLifecycleColumn as O,createTagsColumn as R}from"./EntityTableColumns.esm.js";import{CatalogTableToolbar as A}from"./EntityTableToolbar.esm.js";import{EntityTagFilter as D}from"./EntityTagFilter.esm.js";const I=b(()=>({entityTable:{'& span[class*="CatalogReactEntityDisplayName-root"]':{"&:hover":{textDecoration:"underline"}}}})),a=[x(),N(),z(),M(),O(),R()],K=e=>({kinds:e.selectedKinds.length?new F(e.selectedKinds):void 0,systems:e.selectedSystems.length?new L(e.selectedSystems):void 0,type:e.selectedTypes.length?new w(e.selectedTypes):void 0,owners:e.selectedOwners.length?new E(e.selectedOwners):void 0,lifecycles:e.selectedLifecycles.length?new h(e.selectedLifecycles):void 0,tag:e.selectedTags.length?new D(e.selectedTags):void 0}),P=({filter:e,additionalColumns:n=[],title:r,hideTags:i=!1})=>{const{updateFilters:s,entities:c,pageInfo:t,totalItems:m,loading:p}=T(),d=S(),y=I();v(()=>{const o=K(e);s(o)},[e,s]);const g=C(()=>i?[...a.slice(0,-1),...n]:[...a,...n],[n,i]),u=r||`All (${m||0})`;return l.createElement(l.Fragment,null,l.createElement("div",{className:y.entityTable},l.createElement(f,{title:u,columns:g,data:c,options:{padding:"dense",paging:!!t?.next||!!t?.prev,toolbar:!0,draggable:!1,tableLayout:"fixed",search:!1,showTitle:!0,rowStyle:{fontSize:d.typography.body1.fontSize},showFirstLastPageButtons:!1,emptyRowsWhenPaging:!1,pageSizeOptions:[],loadingType:"linear",showEmptyDataSourceMessage:!p,pageSize:10},onPageChange:o=>{o>0?t?.next?.():t?.prev?.()},components:{Toolbar:A},page:t?.prev?1:0,totalCount:t?.next?Number.MAX_VALUE:Number.MIN_SAFE_INTEGER,localization:{pagination:{labelDisplayedRows:""}}})))};export{P as FilterPreviewTable};
2
2
  //# sourceMappingURL=FilterPreviewTable.esm.js.map
@@ -0,0 +1,2 @@
1
+ import{TextField as n}from"@material-ui/core";import l from"react";import{Controller as i}from"react-hook-form";const p=({control:o,disabled:t,className:a,helperTextClassName:m,name:s,placeholder:d})=>l.createElement(i,{name:s,control:o,render:({field:e,fieldState:r})=>l.createElement(n,{...e,value:e.value??"",type:"text",variant:"outlined",margin:"dense",placeholder:d,className:a,disabled:t,error:!!r.error,helperText:r.error?.message,FormHelperTextProps:{className:m}})});export{p as FormControlledTextField};
2
+ //# sourceMappingURL=FormControlledTextField.esm.js.map
@@ -1,2 +1,2 @@
1
- import{LinearGauge as E}from"@backstage/core-components";import{useTheme as C,Paper as N,Grid as c,Typography as p,Box as S}from"@material-ui/core";import{makeStyles as b}from"@material-ui/core/styles";import t from"react";import{LevelBadge as L}from"../Badges/LevelBadge.esm.js";import"../Badges/NoLevelBadge.esm.js";import"../Badges/CampaignBadge.esm.js";import{generateBadge as x}from"../Badges/badge.esm.js";import{getChartColors as w}from"../Charts/chartUtils.esm.js";import{CheckCard as B}from"../CheckCard/CheckCard.esm.js";import{LevelTooltip as I}from"./LevelTooltip.esm.js";const u=(e,a)=>{if(!e?.certificationStatus?.numberOfEntities||a===void 0)return;const o=e.certificationStatus.statusByLevel.findIndex(s=>s.ordinal===a);if(o===-1)return;const r=e.certificationStatus.numberOfEntities,n=[];for(const s of e.certificationStatus.statusByLevel){const l=s.cumulativelyPassed;n.push(r?Math.round(l/r*100):100)}return n[o]},f=(e,a)=>{if(!e?.certificationStatus?.numberOfEntities||a===void 0)return;const o=e.certificationStatus.statusByLevel.findIndex(n=>n.ordinal===a);if(o===-1)return 0;const r=[];for(const n of e.certificationStatus.statusByLevel){const s=n.cumulativelyPassed;r.push(s)}for(let n=r.length-2;n>=0;n--)r[n]=Math.min(r[n]+r[n+1],100);return r[o]},k=b(e=>({card:{border:`1px solid ${e.palette.divider}`},title:{fontWeight:"bold",fontSize:"1.1rem",cursor:"default"},header:{borderBottom:`1px solid ${e.palette.divider}`,width:"100%",padding:e.spacing(1,2),margin:0},levelNameContainer:{gridGap:e.spacing(1),width:"fit-content",padding:0},passRate:{fontWeight:"bold",fontSize:e.typography.overline.fontSize,cursor:"default"},gaugeContainer:{width:200,paddingLeft:e.spacing(.75),paddingRight:e.spacing(.75),paddingTop:2},content:{padding:e.spacing(2.5,2),display:"flex",gap:e.spacing(2)},description:{padding:0},gridItem:{padding:0}})),P=({track:e,level:a,index:o,data:r,lifecycles:n,owners:s,types:l,systems:g})=>{const i=k(),v=w(C()),m=u(r,a.ordinal),y=f(r,a.ordinal),h=m!==void 0?`${m}%`:"";return t.createElement(N,{elevation:1,className:i.card},t.createElement(c,{container:!0,alignItems:"center",justifyContent:"space-between",direction:"row",className:i.header},t.createElement(c,{item:!0,container:!0,alignItems:"center",direction:"row",className:i.levelNameContainer},t.createElement(L,{badge:a.badge??x(a.ordinal,e)}),t.createElement(I,{level:a,numerator:y??0,denominator:r?.certificationStatus?.numberOfEntities??0},t.createElement(p,{className:i.title},a.name??`Level ${a.ordinal}`))),t.createElement(c,{item:!0,className:i.gridItem},t.createElement(c,{container:!0,item:!0,className:i.gridItem},t.createElement(p,{variant:"overline",className:i.passRate},h),t.createElement("div",{className:i.gaugeContainer},t.createElement(E,{value:(m??0)/100,getColor:d=>v[o]}))))),t.createElement(S,{className:i.content},t.createElement(c,{container:!0,spacing:1},a.checks.map(d=>t.createElement(c,{item:!0,xs:12,sm:6,md:4,className:i.gridItem,key:d.id},t.createElement(B,{track:e,check:d,lifecycles:n,owners:s,types:l,systems:g}))))))};export{P as LevelCard,u as calculateCumulativePassRate,f as calculateCumulativePassRateNumerator};
1
+ import{LinearGauge as v}from"@backstage/core-components";import{useTheme as h,Paper as E,Grid as c,Typography as d,Box as y}from"@material-ui/core";import{makeStyles as C}from"@material-ui/core/styles";import a from"react";import{LevelBadge as N}from"../Badges/LevelBadge.esm.js";import"../Badges/NoLevelBadge.esm.js";import"../Badges/CampaignBadge.esm.js";import{generateBadge as S}from"../Badges/badge.esm.js";import{getChartColors as b}from"../Charts/chartUtils.esm.js";import{CheckCard as L}from"../CheckCard/CheckCard.esm.js";import{LevelTooltip as x}from"./LevelTooltip.esm.js";const p=(e,i)=>{if(!e?.certificationStatus?.numberOfEntities||i===void 0)return;const o=e.certificationStatus.statusByLevel.findIndex(t=>t.ordinal===i);if(o===-1)return;const n=e.certificationStatus.numberOfEntities,r=[];for(const t of e.certificationStatus.statusByLevel){const s=t.cumulativelyPassed;r.push(n?Math.round(s/n*100):100)}return r[o]},u=(e,i)=>{if(!e?.certificationStatus?.numberOfEntities||i===void 0)return;const o=e.certificationStatus.statusByLevel.findIndex(r=>r.ordinal===i);if(o===-1)return 0;const n=[];for(const r of e.certificationStatus.statusByLevel){const t=r.cumulativelyPassed;n.push(t)}for(let r=n.length-2;r>=0;r--)n[r]=Math.min(n[r]+n[r+1],100);return n[o]},B=C(e=>({card:{border:`1px solid ${e.palette.divider}`},title:{fontWeight:"bold",fontSize:"1.1rem",cursor:"default"},header:{borderBottom:`1px solid ${e.palette.divider}`,width:"100%",padding:e.spacing(1,2),margin:0},levelNameContainer:{gridGap:e.spacing(1),width:"fit-content",padding:0},passRate:{fontWeight:"bold",fontSize:e.typography.overline.fontSize,cursor:"default"},gaugeContainer:{width:200,paddingLeft:e.spacing(.75),paddingRight:e.spacing(.75),paddingTop:2},content:{padding:e.spacing(2.5,2),display:"flex",gap:e.spacing(2)},description:{padding:0},gridItem:{padding:0}})),I=({track:e,level:i,index:o,data:n,filter:r})=>{const t=B(),s=b(h()),l=p(n,i.ordinal),f=u(n,i.ordinal),g=l!==void 0?`${l}%`:"";return a.createElement(E,{elevation:1,className:t.card},a.createElement(c,{container:!0,alignItems:"center",justifyContent:"space-between",direction:"row",className:t.header},a.createElement(c,{item:!0,container:!0,alignItems:"center",direction:"row",className:t.levelNameContainer},a.createElement(N,{badge:i.badge??S(i.ordinal,e)}),a.createElement(x,{level:i,numerator:f??0,denominator:n?.certificationStatus?.numberOfEntities??0},a.createElement(d,{className:t.title},i.name??`Level ${i.ordinal}`))),a.createElement(c,{item:!0,className:t.gridItem},a.createElement(c,{container:!0,item:!0,className:t.gridItem},a.createElement(d,{variant:"overline",className:t.passRate},g),a.createElement("div",{className:t.gaugeContainer},a.createElement(v,{value:(l??0)/100,getColor:m=>s[o]}))))),a.createElement(y,{className:t.content},a.createElement(c,{container:!0,spacing:1},i.checks.map(m=>a.createElement(c,{item:!0,xs:12,sm:6,md:4,className:t.gridItem,key:m.id},a.createElement(L,{track:e,check:m,filter:r}))))))};export{I as LevelCard,p as calculateCumulativePassRate,u as calculateCumulativePassRateNumerator};
2
2
  //# sourceMappingURL=LevelCard.esm.js.map
@@ -1,2 +1,2 @@
1
- import{parseEntityRef as r}from"@backstage/catalog-model";import{humanizeEntityRef as n}from"@backstage/plugin-catalog-react";import{BadgeVariant as c}from"../../graphql/generated/index.esm.js";const a=8,d=16,h={trackTitle:70,levelTitle:30,check:42,entityRefFooter:100,paginationControl:50},i={trackTitle:350+d*2,checkResult:42},f=e=>e.reduce((t,l)=>t+l.height,0),g=e=>e*i.checkResult+i.trackTitle,s=e=>e.filter(t=>t!==void 0).map(t=>{const l=r(t);return n(l,{defaultKind:l.kind})}).reduce((t,l)=>t.length>l.length?t:l,""),u=e=>a*e+a,o="NoLevel",m=e=>({name:o,badge:{options:{level:0,color:""},variant:c.Medal},entityRef:e,ordinal:0});export{i as CellWidths,o as NO_LEVEL_BADGE_NAME,h as RowHeights,u as calculateHeightForRefTitle,f as calculateTableHeight,g as calculateTableWidth,s as findLongestRefTitle,m as generateNoLevelBadge};
1
+ import{parseEntityRef as n}from"@backstage/catalog-model";import{humanizeEntityRef as r}from"@backstage/plugin-catalog-react";import{BadgeVariant as c}from"../../graphql/generated/index.esm.js";const a=8,d=16,f={trackTitle:70,levelTitle:30,check:42,entityRefFooter:100,paginationControl:50},l={trackTitle:350+d*2,checkResult:42},g=e=>e*l.checkResult+l.trackTitle,h=e=>e.filter(t=>t!==void 0).map(t=>{const i=n(t);return r(i,{defaultKind:i.kind})}).reduce((t,i)=>t.length>i.length?t:i,""),s=e=>a*e+a,o="NoLevel",m=e=>({name:o,badge:{options:{level:0,color:""},variant:c.Medal},entityRef:e,ordinal:0});export{l as CellWidths,o as NO_LEVEL_BADGE_NAME,f as RowHeights,s as calculateHeightForRefTitle,g as calculateTableWidth,h as findLongestRefTitle,m as generateNoLevelBadge};
2
2
  //# sourceMappingURL=resultsTableUtils.esm.js.map
@@ -1,2 +1,2 @@
1
- import{EntityRefLink as I}from"@backstage/plugin-catalog-react";import{makeStyles as f,List as h,Typography as m,ListItem as i,Tooltip as l,ListItemIcon as o,ListItemText as s}from"@material-ui/core";import y from"@material-ui/icons/Group";import N from"@material-ui/icons/TrendingDown";import L from"@material-ui/icons/TrendingFlat";import g from"@material-ui/icons/TrendingUp";import e from"react";import{Trend as n}from"./types.esm.js";const T=f(a=>({cardSection:{marginBottom:a.spacing(2)},listItem:{padding:0},listItemText:{margin:0},listItemIcon:{marginRight:a.spacing(1),minWidth:0},ownerLink:{"& span":{"&:hover":{textDecoration:"underline"}}}})),x=({ownerEntityRef:a,passRates:c})=>{const t=T();return e.createElement(h,{dense:!0,disablePadding:!0,className:t.cardSection},e.createElement(m,{variant:"overline",color:"textSecondary"},"Details"),a&&e.createElement(i,{disableGutters:!0,className:t.listItem},e.createElement(l,{title:"Owner"},e.createElement(o,{className:t.listItemIcon},e.createElement(y,{color:"inherit",fontSize:"small"}))),e.createElement(s,{className:t.listItemText,primary:e.createElement(I,{className:t.ownerLink,entityRef:a??"No Owner",hideIcon:!0})})),c.map(({name:p,value:d,trend:r},E)=>e.createElement(i,{disableGutters:!0,className:t.listItem,key:E},e.createElement(l,{title:"The most recent pass rate."},e.createElement(o,{className:t.listItemIcon},r===n.UP&&e.createElement(g,{color:"inherit",fontSize:"small"}),r===n.DOWN&&e.createElement(N,{color:"inherit",fontSize:"small"}),r===n.FLAT&&e.createElement(L,{color:"inherit",fontSize:"small"}))),e.createElement(s,{className:t.listItemText,primary:e.createElement(m,{variant:"body2",color:"textPrimary"},p??"Latest Pass Rate",": ",e.createElement("b",null,Math.round(d),"%"))}))))};export{x as PassRateMetadata};
1
+ import{EntityRefLink as I}from"@backstage/plugin-catalog-react";import{makeStyles as f,List as h,Typography as m,ListItem as i,Tooltip as l,ListItemIcon as o,ListItemText as s}from"@material-ui/core";import y from"@material-ui/icons/Group";import N from"@material-ui/icons/TrendingDown";import g from"@material-ui/icons/TrendingFlat";import L from"@material-ui/icons/TrendingUp";import e from"react";import{Trend as n}from"./types.esm.js";const T=f(a=>({cardSection:{marginBottom:a.spacing(2)},listItem:{padding:0},listItemText:{margin:0},listItemIcon:{marginRight:a.spacing(1),minWidth:0},ownerLink:{"& span":{"&:hover":{textDecoration:"underline"}}}})),x=({ownerEntityRef:a,passRates:c})=>{const t=T();return e.createElement(h,{dense:!0,disablePadding:!0,className:t.cardSection},e.createElement(m,{variant:"overline",color:"textSecondary"},"Details"),a&&e.createElement(i,{disableGutters:!0,className:t.listItem},e.createElement(l,{title:"Owner"},e.createElement(o,{className:t.listItemIcon},e.createElement(y,{color:"inherit",fontSize:"small"}))),e.createElement(s,{className:t.listItemText,primary:e.createElement(I,{className:t.ownerLink,entityRef:a??"No Owner",hideIcon:!0})})),c.map(({name:p,value:d,trend:r},E)=>e.createElement(i,{disableGutters:!0,className:t.listItem,key:E},e.createElement(l,{title:"The most recent pass rate."},e.createElement(o,{className:t.listItemIcon},r===n.UP&&e.createElement(L,{color:"inherit",fontSize:"small"}),r===n.DOWN&&e.createElement(N,{color:"inherit",fontSize:"small"}),r===n.FLAT&&e.createElement(g,{color:"inherit",fontSize:"small"}))),e.createElement(s,{className:t.listItemText,primary:e.createElement(m,{variant:"body2",color:"textPrimary"},p??"Latest Pass Rate",": ",e.createElement("b",null,Math.round(d),"%"))}))))};export{x as PassRateMetadata};
2
2
  //# sourceMappingURL=PassRateMetadata.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{CampaignDetailsPage as U}from"../CampaignDetailsPage/CampaignDetailsPage.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: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};
2
2
  //# sourceMappingURL=RoutingPage.esm.js.map
@@ -1,2 +1,2 @@
1
- import{parseEntityRef as T}from"@backstage/catalog-model";import C from"lodash";import{useState as A,useMemo as l,useEffect as S}from"react";import"../../../contexts/TrackFormContext.esm.js";import"../../../contexts/CheckFormContext.esm.js";import"../../../contexts/CampaignFormContext.esm.js";import{useLoggedInUser as $}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]=A(!1),{userEntityRef:a}=$(),{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 S(()=>{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{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{parseEntityRef as B}from"@backstage/catalog-model";import{EntityDisplayName as C}from"@backstage/plugin-catalog-react";import{makeStyles as D,Typography as G,Checkbox as N}from"@material-ui/core";import $ from"@material-ui/icons/Category";import j from"@material-ui/icons/Class";import q from"@material-ui/icons/Group";import z from"@material-ui/icons/Loop";import{toEntityFilterQuery as M}from"@spotify/backstage-plugin-soundcheck-common";import e,{useMemo as f}from"react";import{useGetEntityFacets as n}from"../../../hooks/catalog/useGetEntityFacets.esm.js";import{useGroupOptions as Q}from"../../../hooks/groups/useGroupOptions.esm.js";import l from"../../MultiSelectFilter/MultiSelectFilter.esm.js";const _=D(t=>({root:{display:"flex",flexDirection:"row",alignItems:"center",gap:t.spacing(2)}})),y=(t,{selected:r})=>e.createElement(e.Fragment,null,e.createElement(N,{value:t,checked:r,color:"primary"}),e.createElement(C,{entityRef:t,hideIcon:!0})),A=({track:t,label:r,owners:d,setOwners:E,lifecycles:u,setLifecycles:g,types:b,setTypes:h,systems:F,setSystems:L})=>{const w=_(),o=M(t.filter),{options:s,isLoading:k}=Q(),O=f(()=>s.map(i=>i.ref),[s]),{data:a,isLoading:x}=n("spec.lifecycle",o),{data:m,isLoading:v}=n("spec.type",o),{data:c,isLoading:R}=n("relations.partOf",o),p=f(()=>c?.filter(i=>{try{return B(i).kind.toLowerCase()==="system"}catch{return!1}}),[c]),S=(a||[]).length<=1,T=(m||[]).length<=1,I=(p||[]).length<=1;return e.createElement("div",{className:w.root},r&&e.createElement(G,{variant:"caption"},`${r}:`),e.createElement(l,{name:"system",label:"System",icon:e.createElement($,null),filters:F,setFilters:L,options:p??[],disabled:R||I,customRenderOption:y}),e.createElement(l,{name:"owner",label:"Owner",icon:e.createElement(q,null),filters:d,setFilters:E,options:O??[],disabled:k,customRenderOption:y}),e.createElement(l,{name:"type",label:"Type",icon:e.createElement(j,null),filters:b,setFilters:h,options:m??[],disabled:v||T}),e.createElement(l,{name:"lifecycle",label:"Lifecycle",icon:e.createElement(z,null),filters:u,setFilters:g,options:a??[],disabled:x||S}))};export{A as FilterBar};
1
+ import{parseEntityRef as B}from"@backstage/catalog-model";import{EntityDisplayName as C}from"@backstage/plugin-catalog-react";import{makeStyles as D,Typography as G,Checkbox as N}from"@material-ui/core";import Q from"@material-ui/icons/Category";import $ from"@material-ui/icons/Class";import z from"@material-ui/icons/Group";import M from"@material-ui/icons/Loop";import{toEntityFilterQuery as P}from"@spotify/backstage-plugin-soundcheck-common";import e,{useMemo as f}from"react";import{useGetEntityFacets as n}from"../../../hooks/catalog/useGetEntityFacets.esm.js";import{useGroupOptions as W}from"../../../hooks/groups/useGroupOptions.esm.js";import l from"../../MultiSelectFilter/MultiSelectFilter.esm.js";const j=D(t=>({root:{display:"flex",flexDirection:"row",alignItems:"center",gap:t.spacing(2)}})),y=(t,{selected:r})=>e.createElement(e.Fragment,null,e.createElement(N,{value:t,checked:r,color:"primary"}),e.createElement(C,{entityRef:t,hideIcon:!0})),q=({track:t,label:r,owners:d,setOwners:E,lifecycles:u,setLifecycles:g,types:b,setTypes:h,systems:F,setSystems:L})=>{const w=j(),o=P(t.filter),{options:s,isLoading:k}=W(),O=f(()=>s.map(i=>i.ref),[s]),{data:a,isLoading:x}=n("spec.lifecycle",o),{data:m,isLoading:v}=n("spec.type",o),{data:c,isLoading:R}=n("relations.partOf",o),p=f(()=>c?.filter(i=>{try{return B(i).kind.toLowerCase()==="system"}catch{return!1}}),[c]),S=(a||[]).length<=1,T=(m||[]).length<=1,I=(p||[]).length<=1;return e.createElement("div",{className:w.root},r&&e.createElement(G,{variant:"caption"},`${r}:`),e.createElement(l,{name:"system",label:"System",icon:e.createElement(Q,null),filters:F,setFilters:L,options:p??[],disabled:R||I,customRenderOption:y}),e.createElement(l,{name:"owner",label:"Owner",icon:e.createElement(z,null),filters:d,setFilters:E,options:O??[],disabled:k,customRenderOption:y}),e.createElement(l,{name:"type",label:"Type",icon:e.createElement($,null),filters:b,setFilters:h,options:m??[],disabled:v||T}),e.createElement(l,{name:"lifecycle",label:"Lifecycle",icon:e.createElement(M,null),filters:u,setFilters:g,options:a??[],disabled:x||S}))};export{q as FilterBar};
2
2
  //# sourceMappingURL=FilterBar.esm.js.map
@@ -0,0 +1,2 @@
1
+ const p=r=>{const{lifecycles:e,owners:t,types:s,systems:l}=r,n=e?.length?{"spec.lifecycle":e}:void 0,o=t?.length?{"relations.ownedBy":t}:void 0,i=s?.length?{"spec.type":s}:void 0,c=l?.length?{"relations.partOf":l}:void 0;if(n||o||i||c)return{...n,...o,...i,...c}};export{p as toFilter};
2
+ //# sourceMappingURL=util.esm.js.map
@@ -1,2 +1,2 @@
1
- import{stringifyEntityRef as v}from"@backstage/catalog-model";import{Table as B}from"@backstage/core-components";import{makeStyles as R}from"@material-ui/core";import L from"lodash";import d,{useState as z,useEffect as O,useCallback as y}from"react";import{TrackEntityField as n,Direction as u}from"../../../graphql/generated/index.esm.js";import{useEntitiesByRefs as P}from"../../../hooks/catalog/useEntitiesByRefs.esm.js";import{useTrackEntities as x}from"../../../hooks/entities/useTrackEntities.esm.js";import{columnFactories as a}from"./columns.esm.js";import{toTrackEntityRow as D}from"./utils.esm.js";const N=[a.createBadgeColumn(),a.createNameColumn(),a.createStatusColumn(),a.createSystemColumn(),a.createOwnerColumn(),a.createSpecTypeColumn(),a.createSpecLifecycleColumn()],F=[n.CertificationLevel,n.Name,n.CheckPassRate,n.System,n.Owner,n.Type,n.Lifecycle],C=g=>{const{lifecycles:i,owners:s,types:c,systems:l}=g,m=i?.length?{"spec.lifecycle":i}:void 0,e=s?.length?{"relations.ownedBy":s}:void 0,f=c?.length?{"spec.type":c}:void 0,r=l?.length?{"relations.partOf":l}:void 0;return{...m,...e,...f,...r}},A=R({tableContainer:{display:"flex",flexDirection:"column",height:"100%"}}),W=({track:g,lifecycles:i,owners:s,types:c,systems:l})=>{const m=A(),[e,f]=z({orderBy:void 0,filter:C({lifecycles:i,owners:s,types:c,systems:l}),pageInfo:{page:0,pageSize:25,direction:"forward",cursor:null}});O(()=>{f(t=>({...t,pageInfo:{...t.pageInfo,page:0,cursor:null},filter:C({lifecycles:i,owners:s,types:c,systems:l})}))},[i,s,c,l]);const{data:r,isLoading:k}=x({trackId:g.id,orderBy:e.orderBy,filter:e.filter,[e.pageInfo.direction==="forward"?"first":"last"]:e.pageInfo.pageSize,[e.pageInfo.direction==="forward"?"after":"before"]:e.pageInfo.cursor}),w=y((t,p)=>{let o;t===-1?o=void 0:o={field:F[t],direction:p==="asc"?u.Asc:u.Desc},f({...e,orderBy:o,pageInfo:{...e.pageInfo,page:0,cursor:null}})},[e]),I=y((t,p)=>{const o=t>e.pageInfo.page?"forward":"backward",b=o==="forward"?r?.trackEntities.pageInfo.endCursor??null:r?.trackEntities.pageInfo.startCursor??null;f({...e,pageInfo:{page:t,pageSize:p,direction:o,cursor:b}})},[r,e]),h=r?.trackEntities.edges.map(t=>t.node.entityRef)??[],{data:E,isLoading:S}=P({entityRefs:h}),T=L.compact(r?.trackEntities.edges.map(t=>{const p=E?.items.find(o=>!!o&&v(o)===t.node.entityRef);return p?D({trackDetails:t.node,track:g,entity:p}):void 0}))??[];return d.createElement("div",{className:m.tableContainer},d.createElement(B,{columns:N,data:T,options:{paging:!0,showFirstLastPageButtons:!1,paginationPosition:"both",emptyRowsWhenPaging:!1,pageSizeOptions:[10,25,50],pageSize:25,search:!1,showTitle:!1,padding:"dense"},onOrderChange:w,onPageChange:I,page:e.pageInfo.page,totalCount:r?.trackEntities.totalCount??0,isLoading:k||S,components:{Toolbar:()=>null}}))};export{W as TrackEntitiesTable};
1
+ import{stringifyEntityRef as B}from"@backstage/catalog-model";import{Table as R}from"@backstage/core-components";import{makeStyles as L}from"@material-ui/core";import z from"lodash";import u,{useState as P,useEffect as O,useCallback as y}from"react";import{TrackEntityField as r,Direction as C}from"../../../graphql/generated/index.esm.js";import{useEntitiesByRefs as x}from"../../../hooks/catalog/useEntitiesByRefs.esm.js";import{useTrackEntities as D}from"../../../hooks/entities/useTrackEntities.esm.js";import{columnFactories as n}from"./columns.esm.js";import{toTrackEntityRow as F}from"./utils.esm.js";const N=[n.createBadgeColumn(),n.createNameColumn(),n.createStatusColumn(),n.createSystemColumn(),n.createOwnerColumn(),n.createSpecTypeColumn(),n.createSpecLifecycleColumn()],q=[r.CertificationLevel,r.Name,r.CheckPassRate,r.System,r.Owner,r.Type,r.Lifecycle],w=g=>{const{lifecycles:p,owners:a,types:i,systems:s}=g,f=p?.length?{"spec.lifecycle":p}:void 0,m=a?.length?{"relations.ownedBy":a}:void 0,e=i?.length?{"spec.type":i}:void 0,d=s?.length?{"relations.partOf":s}:void 0;return{...f,...m,...e,...d}},A=L({tableContainer:{display:"flex",flexDirection:"column",height:"100%"}}),W=({track:g,initialPageSize:p,lifecycles:a,owners:i,types:s,systems:f})=>{const m=A(),[e,d]=P({orderBy:void 0,filter:w({lifecycles:a,owners:i,types:s,systems:f}),pageInfo:{page:0,pageSize:p??10,direction:"forward",cursor:null}});O(()=>{d(t=>({...t,pageInfo:{...t.pageInfo,page:0,cursor:null},filter:w({lifecycles:a,owners:i,types:s,systems:f})}))},[a,i,s,f]);const{data:c,isLoading:k}=D({trackId:g.id,orderBy:e.orderBy,filter:e.filter,[e.pageInfo.direction==="forward"?"first":"last"]:e.pageInfo.pageSize,[e.pageInfo.direction==="forward"?"after":"before"]:e.pageInfo.cursor}),I=y((t,l)=>{let o;t===-1?o=void 0:o={field:q[t],direction:l==="asc"?C.Asc:C.Desc},d({...e,orderBy:o,pageInfo:{...e.pageInfo,page:0,cursor:null}})},[e]),h=y((t,l)=>{const o=t>e.pageInfo.page?"forward":"backward",v=o==="forward"?c?.trackEntities.pageInfo.endCursor??null:c?.trackEntities.pageInfo.startCursor??null;d({...e,pageInfo:{page:t,pageSize:l,direction:o,cursor:v}})},[c,e]),E=c?.trackEntities.edges.map(t=>t.node.entityRef)??[],{data:S,isLoading:T}=x({entityRefs:E}),b=z.compact(c?.trackEntities.edges.map(t=>{const l=S?.items.find(o=>!!o&&B(o)===t.node.entityRef);return l?F({trackDetails:t.node,track:g,entity:l}):void 0}))??[];return u.createElement("div",{className:m.tableContainer},u.createElement(R,{columns:N,data:b,options:{paging:!0,showFirstLastPageButtons:!1,paginationPosition:"both",emptyRowsWhenPaging:!1,pageSizeOptions:[10,25,50],pageSize:p??25,search:!1,showTitle:!1,padding:"dense"},onOrderChange:I,onPageChange:h,page:e.pageInfo.page,totalCount:c?.trackEntities.totalCount??0,isLoading:k||T,components:{Toolbar:()=>null}}))};export{W as TrackEntitiesTable};
2
2
  //# sourceMappingURL=TrackEntitiesTable.esm.js.map
@@ -1,2 +1,2 @@
1
- import{MarkdownContent as G,Content as N}from"@backstage/core-components";import{useRouteRef as Q}from"@backstage/core-plugin-api";import{EntityRefLink as W}from"@backstage/plugin-catalog-react";import{usePermission as T}from"@backstage/plugin-permission-react";import{makeStyles as $,Button as j,Paper as q,Tabs as J,Tab as L}from"@material-ui/core";import{soundcheckTrackReadPermission as K,soundcheckTrackUpdatePermission as X}from"@spotify/backstage-plugin-soundcheck-common";import t,{useState as Y,useMemo as E}from"react";import{useParams as Z,useNavigate as _}from"react-router-dom";import"@backstage/catalog-model";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import"../../hooks/useSoundcheckAlert.esm.js";import{useGetAllTracks as ee}from"../../hooks/tracks/useGetAllTracks.esm.js";import"../../hooks/useConfirmationModal.esm.js";import{useCertificationStatus as te}from"../../hooks/aggregations/useCertificationStatus.esm.js";import{useCertificationStatusHistory as re}from"../../hooks/aggregations/useCertificationStatusHistory.esm.js";import{useSearchParam as f}from"../../hooks/useSearchParam.esm.js";import{trackEditRouteRef as ie}from"../../routes.esm.js";import{LevelCard as ae}from"../LevelCard/LevelCard.esm.js";import{LoadingIndicator as ne}from"../LoadingIndicator/LoadingIndicator.esm.js";import{PageWarningMessage as oe}from"../PageWarningMessage/PageWarningMessage.esm.js";import"../SoundcheckHeader/SoundcheckHeader.esm.js";import"../SoundcheckHeader/SoundcheckHeaderContext.esm.js";import{useHeader as se}from"../SoundcheckHeader/useHeader.esm.js";import{FilterBar as ce}from"./FilterBar/FilterBar.esm.js";import{TrackEntitiesTable as le}from"./TrackEntitiesTable/TrackEntitiesTable.esm.js";import{TrackProgressCard as me}from"./TrackProgressCard.esm.js";const R=e=>{const{lifecycles:i,owners:c,types:a,systems:m}=e,n=i?.length?{"spec.lifecycle":i}:void 0,d=c?.length?{"relations.ownedBy":c}:void 0,o=a?.length?{"spec.type":a}:void 0,p=m?.length?{"relations.partOf":m}:void 0;if(n||d||o||p)return{...n,...d,...o,...p}},de=$(e=>({root:{height:"100%",background:e.palette.background.default},header:{backgroundColor:e.palette.background.paper,borderRadius:0,marginBottom:e.spacing(2)},trackProgressContainer:{marginBottom:e.spacing(3)},trackContainerContent:{paddingTop:e.spacing(1),paddingBottom:e.spacing(1),backgroundColor:e.palette.background.paper},levelCard:{margin:e.spacing(1,0,2)},editButton:{marginLeft:"auto"},tabsContainer:{margin:e.spacing(3,0)},trackEntitiesContainer:{marginTop:e.spacing(1)},headerDescription:{fontSize:e.typography.body2.fontSize,margin:e.spacing(.5,0,0),"& p":{margin:0},"& a":{color:"inherit",textDecoration:"underline"}},content:{paddingTop:0},ownerLink:{"& span":{color:"inherit","&:hover":{textDecoration:"underline"}}}}));function P({children:e,value:i,index:c}){return t.createElement("div",{hidden:i!==c},i===c&&e)}const pe=()=>{const e=de(),[i,c]=Y(0),[a,m]=f("owners"),[n,d]=f("lifecycles"),[o,p]=f("types"),[l,B]=f("systems"),S=(g,y)=>{c(y)},{trackId:s}=Z(),{data:x,isLoading:u,isError:D}=ee({ids:[s??""],first:1}),r=x?.edges?.[0]?.node,{data:k,isLoading:h,isError:I}=te({trackId:s,filter:R({lifecycles:n,owners:a,types:o,systems:l})},!!s),{data:M,isLoading:O,isError:z}=re({trackId:s,filter:R({lifecycles:n,owners:a,types:o,systems:l}),numberOfDays:30},!!s),{loading:F,allowed:H}=T({permission:K,resourceRef:s}),{loading:v,allowed:C}=T({permission:X,resourceRef:s}),w=_(),b=Q(ie),A=E(()=>r?.ownerEntityRef?t.createElement(W,{color:"inherit",entityRef:r.ownerEntityRef,className:e.ownerLink}):null,[r?.ownerEntityRef,e.ownerLink]),U=E(()=>!v&&C&&r?.isEditable?t.createElement(j,{className:e.editButton,variant:"contained",color:"primary",onClick:()=>{w(b({trackId:r.id}))}},"Edit Track"):null,[C,e.editButton,b,v,w,r]),V=E(()=>r?.description?t.createElement(G,{className:e.headerDescription,content:r.description}):null,[e.headerDescription,r?.description]);return se({title:r?.name,description:V,customSubtitle:A,sectionRight:U}),t.createElement("div",null,t.createElement(oe,{entityName:"track",entityId:s,showNotFound:!u&&!r,showCannotView:!F&&!H}),u&&t.createElement(ne,null),r&&t.createElement("div",{className:e.root},t.createElement(q,{elevation:1,className:e.header},t.createElement(N,{className:e.trackContainerContent},t.createElement(ce,{track:r,owners:a,setOwners:m,lifecycles:n,setLifecycles:d,types:o,setTypes:p,systems:l,setSystems:B}))),t.createElement(N,{className:e.content},t.createElement("div",{className:e.trackProgressContainer},t.createElement(me,{track:r,status:k,history:M,isLoading:u||h||O,isError:D||I||z})),t.createElement("div",{className:e.tabsContainer},t.createElement(J,{value:i,onChange:S},t.createElement(L,{label:"Levels"}),t.createElement(L,{label:"Entities"})),t.createElement(P,{value:i,index:0},r&&r.levels?.map((g,y)=>t.createElement("div",{className:e.levelCard,key:g.ordinal},t.createElement(ae,{track:r,level:g,index:y,data:k,isLoading:u||h,lifecycles:n,owners:a,types:o,systems:l})))),t.createElement(P,{value:i,index:1},r&&t.createElement("div",{className:e.trackEntitiesContainer},t.createElement(le,{track:r,lifecycles:n,owners:a,types:o,systems:l})))))))};export{pe as TrackPage};
1
+ import{MarkdownContent as V,Content as b}from"@backstage/core-components";import{useRouteRef as W}from"@backstage/core-plugin-api";import{EntityRefLink as $}from"@backstage/plugin-catalog-react";import{usePermission as w}from"@backstage/plugin-permission-react";import{makeStyles as j,Button as q,Paper as J,Tabs as K,Tab as L}from"@material-ui/core";import{soundcheckTrackReadPermission as Q,soundcheckTrackUpdatePermission as X}from"@spotify/backstage-plugin-soundcheck-common";import t,{useState as Y,useMemo as d}from"react";import{useParams as Z,useNavigate as _}from"react-router-dom";import"@backstage/catalog-model";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import"../../hooks/useSoundcheckAlert.esm.js";import{useGetAllTracks as ee}from"../../hooks/tracks/useGetAllTracks.esm.js";import"../../hooks/useConfirmationModal.esm.js";import{useCertificationStatus as te}from"../../hooks/aggregations/useCertificationStatus.esm.js";import{useCertificationStatusHistory as re}from"../../hooks/aggregations/useCertificationStatusHistory.esm.js";import{useSearchParam as p}from"../../hooks/useSearchParam.esm.js";import{trackEditRouteRef as ae}from"../../routes.esm.js";import{LevelCard as ie}from"../LevelCard/LevelCard.esm.js";import{LoadingIndicator as ne}from"../LoadingIndicator/LoadingIndicator.esm.js";import{PageWarningMessage as oe}from"../PageWarningMessage/PageWarningMessage.esm.js";import"../SoundcheckHeader/SoundcheckHeader.esm.js";import"../SoundcheckHeader/SoundcheckHeaderContext.esm.js";import{useHeader as se}from"../SoundcheckHeader/useHeader.esm.js";import{FilterBar as ce}from"./FilterBar/FilterBar.esm.js";import{toFilter as me}from"./FilterBar/util.esm.js";import{TrackEntitiesTable as le}from"./TrackEntitiesTable/TrackEntitiesTable.esm.js";import{TrackProgressCard as de}from"./TrackProgressCard.esm.js";const pe=j(e=>({root:{height:"100%",background:e.palette.background.default},header:{backgroundColor:e.palette.background.paper,borderRadius:0,marginBottom:e.spacing(2)},trackProgressContainer:{marginBottom:e.spacing(3)},trackContainerContent:{paddingTop:e.spacing(1),paddingBottom:e.spacing(1),backgroundColor:e.palette.background.paper},levelCard:{margin:e.spacing(1,0,2)},editButton:{marginLeft:"auto"},tabsContainer:{margin:e.spacing(3,0)},trackEntitiesContainer:{marginTop:e.spacing(1)},headerDescription:{fontSize:e.typography.body2.fontSize,margin:e.spacing(.5,0,0),"& p":{margin:0},"& a":{color:"inherit",textDecoration:"underline"}},content:{paddingTop:0},ownerLink:{"& span":{color:"inherit","&:hover":{textDecoration:"underline"}}}}));function N({children:e,value:i,index:n}){return t.createElement("div",{hidden:i!==n},i===n&&e)}const ue=()=>{const e=pe(),[i,n]=Y(0),[o,T]=p("owners"),[s,R]=p("lifecycles"),[c,P]=p("types"),[m,S]=p("systems"),B=(f,g)=>{n(g)},{trackId:a}=Z(),u=d(()=>me({lifecycles:s,owners:o,types:c,systems:m}),[s,o,c,m]),{data:x,isLoading:l,isError:D}=ee({ids:[a??""],first:1}),r=x?.edges?.[0]?.node,{data:k,isLoading:E,isError:I}=te({trackId:a,filter:u},!!a),{data:F,isLoading:M,isError:z}=re({trackId:a,filter:u,numberOfDays:30},!!a),{loading:H,allowed:O}=w({permission:Q,resourceRef:a}),{loading:y,allowed:C}=w({permission:X,resourceRef:a}),h=_(),v=W(ae),A=d(()=>r?.ownerEntityRef?t.createElement($,{color:"inherit",entityRef:r.ownerEntityRef,className:e.ownerLink}):null,[r?.ownerEntityRef,e.ownerLink]),G=d(()=>!y&&C&&r?.isEditable?t.createElement(q,{className:e.editButton,variant:"contained",color:"primary",onClick:()=>{h(v({trackId:r.id}))}},"Edit Track"):null,[C,e.editButton,v,y,h,r]),U=d(()=>r?.description?t.createElement(V,{className:e.headerDescription,content:r.description}):null,[e.headerDescription,r?.description]);return se({title:r?.name,description:U,customSubtitle:A,sectionRight:G}),t.createElement("div",null,t.createElement(oe,{entityName:"track",entityId:a,showNotFound:!l&&!r,showCannotView:!H&&!O}),l&&t.createElement(ne,null),r&&t.createElement("div",{className:e.root},t.createElement(J,{elevation:1,className:e.header},t.createElement(b,{className:e.trackContainerContent},t.createElement(ce,{track:r,owners:o,setOwners:T,lifecycles:s,setLifecycles:R,types:c,setTypes:P,systems:m,setSystems:S}))),t.createElement(b,{className:e.content},t.createElement("div",{className:e.trackProgressContainer},t.createElement(de,{track:r,status:k,history:F,isLoading:l||E||M,isError:D||I||z})),t.createElement("div",{className:e.tabsContainer},t.createElement(K,{value:i,onChange:B},t.createElement(L,{label:"Levels"}),t.createElement(L,{label:"Entities"})),t.createElement(N,{value:i,index:0},r&&r.levels?.map((f,g)=>t.createElement("div",{className:e.levelCard,key:f.ordinal},t.createElement(ie,{track:r,filter:u,level:f,index:g,data:k,isLoading:l||E})))),t.createElement(N,{value:i,index:1},r&&t.createElement("div",{className:e.trackEntitiesContainer},t.createElement(le,{track:r,lifecycles:s,owners:o,types:c,systems:m})))))))};export{ue as TrackPage};
2
2
  //# sourceMappingURL=TrackPage.esm.js.map
@@ -1,2 +1,2 @@
1
- import{makeStyles as o,Paper as l,Box as r,Typography as m}from"@material-ui/core";import t from"react";import{TrackHistoryChart as d}from"./TrackHistoryChart.esm.js";import{TrackLevelsChart as p}from"./TrackLevelsChart.esm.js";const f=o(e=>({card:{display:"flex",flexDirection:"column",border:`1px solid ${e.palette.divider}`},title:{fontWeight:"bold",fontSize:"1.1rem",lineHeight:`${e.typography.h5.fontSize}px`,cursor:"default"},header:{display:"flex",padding:e.spacing(1,1),borderBottom:`1px solid ${e.palette.divider}`,flexDirection:"column",gap:e.spacing(.5)},content:{padding:e.spacing(1,1,0),display:"flex",margin:e.spacing(1),gap:e.spacing(1)},leftSection:{width:"225px",minWidth:"225px"},summaryCard:{height:"100%",display:"flex",flexDirection:"column",justifyContent:"space-between"},chartSection:{flex:1,width:"100%",minWidth:"150px"}})),g=({track:e,status:c,history:s,isLoading:i,isError:n})=>{const a=f();return t.createElement(l,{className:a.card},t.createElement(r,{className:a.header},!i&&e&&t.createElement(m,{className:a.title},"Track Progress")),t.createElement(r,{className:a.content},t.createElement(r,{className:a.leftSection},t.createElement(r,{className:a.summaryCard},t.createElement(p,{data:c,isLoading:i}))),t.createElement(r,{className:a.chartSection},t.createElement(d,{track:e,data:s,isError:n}))))};export{g as TrackProgressCard};
1
+ import{makeStyles as l,Paper as m,Box as r,Typography as d}from"@material-ui/core";import t from"react";import{TrackHistoryChart as p}from"./TrackHistoryChart.esm.js";import{TrackLevelsChart as f}from"./TrackLevelsChart.esm.js";const g=l(e=>({card:{display:"flex",flexDirection:"column",border:`1px solid ${e.palette.divider}`},title:{fontWeight:"bold",fontSize:"1.1rem",lineHeight:`${e.typography.h5.fontSize}px`,cursor:"default"},header:{display:"flex",padding:e.spacing(1,1),borderBottom:`1px solid ${e.palette.divider}`,flexDirection:"column",gap:e.spacing(.5)},content:{padding:e.spacing(1,1,0),display:"flex",margin:e.spacing(1),gap:e.spacing(1)},leftSection:{width:"225px",minWidth:"225px"},summaryCard:{height:"100%",display:"flex",flexDirection:"column",justifyContent:"space-between"},chartSection:{flex:1,width:"100%",minWidth:"150px"}})),h=({track:e,status:c,history:s,isLoading:i,isError:n,title:o})=>{const a=g();return t.createElement(m,{className:a.card},t.createElement(r,{className:a.header},!i&&e&&t.createElement(d,{className:a.title},o??"Track Progress")),t.createElement(r,{className:a.content},t.createElement(r,{className:a.leftSection},t.createElement(r,{className:a.summaryCard},t.createElement(f,{data:c,isLoading:i}))),t.createElement(r,{className:a.chartSection},t.createElement(p,{track:e,data:s,isError:n}))))};export{h as TrackProgressCard};
2
2
  //# sourceMappingURL=TrackProgressCard.esm.js.map
@@ -388,6 +388,7 @@ ${u}`,H=i`
388
388
  certificationStatusHistory(input: $input) {
389
389
  numberOfEntities
390
390
  history {
391
+ date
391
392
  statusByLevel {
392
393
  ordinal
393
394
  passed
@@ -1,2 +1,2 @@
1
- import{useApi as m}from"@backstage/core-plugin-api";import{useQueryClient as c,useMutation as u}from"@tanstack/react-query";import{soundcheckApiRef as p}from"../../api.esm.js";import{MutationKeys as g,QueryKeys as o}from"../graphqlKeys.esm.js";import{useSoundcheckAlert as h}from"../useSoundcheckAlert.esm.js";const l="Error Archiving Campaign";function y(){const t=m(p),i=c(),{showAlert:n}=h(),s=async e=>{const r=await t.archiveCampaign(e);if(!r)throw new Error(`Failed to archive campaign ${e}`);return r};return u([g.ArchiveCampaign],s,{onSuccess:()=>{Promise.all([i.invalidateQueries({queryKey:[o.GetCampaigns]}),i.invalidateQueries({queryKey:[o.GetCampaignOwners]})])},onError:(e,r)=>{let a=`Failed to archive campaign ${r}`;e instanceof Error&&(a=e.message),n({severity:"error",title:l,message:a})}})}export{y as useArchiveCampaign};
1
+ import{useApi as m}from"@backstage/core-plugin-api";import{useQueryClient as c,useMutation as u}from"@tanstack/react-query";import{soundcheckApiRef as p}from"../../api.esm.js";import{MutationKeys as g,QueryKeys as o}from"../graphqlKeys.esm.js";import{useSoundcheckAlert as h}from"../useSoundcheckAlert.esm.js";const l="Error Archiving Campaign";function y(){const t=m(p),i=c(),{showAlert:n}=h(),s=async e=>{const r=await t.archiveCampaign(e);if(!r)throw new Error(`Failed to archive campaign ${e}`);return r};return u([g.ArchiveCampaign],s,{onSuccess:()=>Promise.all([i.invalidateQueries({queryKey:[o.GetCampaigns]}),i.invalidateQueries({queryKey:[o.GetCampaignOwners]})]),onError:(e,r)=>{let a=`Failed to archive campaign ${r}`;e instanceof Error&&(a=e.message),n({severity:"error",title:l,message:a})}})}export{y as useArchiveCampaign};
2
2
  //# sourceMappingURL=useArchiveCampaign.esm.js.map
@@ -1,2 +1,2 @@
1
- import{useApi as m}from"@backstage/core-plugin-api";import{useQueryClient as u,useMutation as c}from"@tanstack/react-query";import{soundcheckApiRef as p}from"../../api.esm.js";import{MutationKeys as l,QueryKeys as a}from"../graphqlKeys.esm.js";import{useSoundcheckAlert as g}from"../useSoundcheckAlert.esm.js";const y="Error Creating Campaign",i="Failed to create campaign.";function C(){const o=m(p),t=u(),{showAlert:n}=g(),s=async r=>{const e=await o.createCampaign(r);if(!e)throw new Error(i);return e};return c([l.CreateCampaign],s,{onSuccess:()=>{Promise.all([t.invalidateQueries({queryKey:[a.GetCampaigns]}),t.invalidateQueries({queryKey:[a.GetCampaignOwners]})])},onError:r=>{let e=i;r instanceof Error&&(e=r.message),n({severity:"error",title:y,message:e})}})}export{C as useCreateCampaign};
1
+ import{useApi as m}from"@backstage/core-plugin-api";import{useQueryClient as u,useMutation as c}from"@tanstack/react-query";import{soundcheckApiRef as p}from"../../api.esm.js";import{MutationKeys as l,QueryKeys as a}from"../graphqlKeys.esm.js";import{useSoundcheckAlert as g}from"../useSoundcheckAlert.esm.js";const y="Error Creating Campaign",i="Failed to create campaign.";function C(){const o=m(p),t=u(),{showAlert:n}=g(),s=async r=>{const e=await o.createCampaign(r);if(!e)throw new Error(i);return e};return c([l.CreateCampaign],s,{onSuccess:()=>Promise.all([t.invalidateQueries({queryKey:[a.GetCampaigns]}),t.invalidateQueries({queryKey:[a.GetCampaignOwners]})]),onError:r=>{let e=i;r instanceof Error&&(e=r.message),n({severity:"error",title:y,message:e})}})}export{C as useCreateCampaign};
2
2
  //# sourceMappingURL=useCreateCampaign.esm.js.map
@@ -1,2 +1,2 @@
1
- import{useApi as m}from"@backstage/core-plugin-api";import{useQueryClient as u,useMutation as l}from"@tanstack/react-query";import{soundcheckApiRef as p}from"../../api.esm.js";import{MutationKeys as c,QueryKeys as o}from"../graphqlKeys.esm.js";import{useSoundcheckAlert as g}from"../useSoundcheckAlert.esm.js";const y="Error Deleting Campaign";function d(){const a=m(p),t=u(),{showAlert:n}=g(),s=async e=>{const r=await a.deleteCampaign(e);if(!r)throw new Error(`Failed to delete campaign ${e}`);return r};return l([c.DeleteCampaign],s,{onSuccess:()=>{Promise.all([t.invalidateQueries({queryKey:[o.GetCampaigns]}),t.invalidateQueries({queryKey:[o.GetCampaignOwners]})])},onError:(e,r)=>{let i=`Failed to delete campaign ${r}`;e instanceof Error&&(i=e.message),n({severity:"error",title:y,message:i})}})}export{d as useDeleteCampaign};
1
+ import{useApi as m}from"@backstage/core-plugin-api";import{useQueryClient as u,useMutation as l}from"@tanstack/react-query";import{soundcheckApiRef as p}from"../../api.esm.js";import{MutationKeys as c,QueryKeys as o}from"../graphqlKeys.esm.js";import{useSoundcheckAlert as g}from"../useSoundcheckAlert.esm.js";const y="Error Deleting Campaign";function d(){const a=m(p),t=u(),{showAlert:n}=g(),s=async e=>{const r=await a.deleteCampaign(e);if(!r)throw new Error(`Failed to delete campaign ${e}`);return r};return l([c.DeleteCampaign],s,{onSuccess:()=>Promise.all([t.invalidateQueries({queryKey:[o.GetCampaigns]}),t.invalidateQueries({queryKey:[o.GetCampaignOwners]})]),onError:(e,r)=>{let i=`Failed to delete campaign ${r}`;e instanceof Error&&(i=e.message),n({severity:"error",title:y,message:i})}})}export{d as useDeleteCampaign};
2
2
  //# sourceMappingURL=useDeleteCampaign.esm.js.map
@@ -1,2 +1,2 @@
1
- import{useApi as i}from"@backstage/core-plugin-api";import{useQuery as o}from"@tanstack/react-query";import{soundcheckApiRef as n}from"../../api.esm.js";import{QueryKeys as s}from"../graphqlKeys.esm.js";function m(r){const t=i(n),e={ids:[r]};return o([s.GetCampaigns,JSON.stringify(e)],async()=>t.getCampaigns(e),{staleTime:5*60*1e3,refetchInterval:!1,refetchOnWindowFocus:!1})}export{m as useGetCampaign};
1
+ import{useApi as i}from"@backstage/core-plugin-api";import{useQuery as n}from"@tanstack/react-query";import{soundcheckApiRef as m}from"../../api.esm.js";import{QueryKeys as s}from"../graphqlKeys.esm.js";function a(r,o=!0){const t=i(m),e={ids:[r]};return n([s.GetCampaigns,e],async()=>t.getCampaigns(e),{staleTime:5*60*1e3,refetchInterval:!1,refetchOnWindowFocus:!1,enabled:o})}export{a as useGetCampaign};
2
2
  //# sourceMappingURL=useGetCampaign.esm.js.map
@@ -1,2 +1,2 @@
1
- import{useApi as a}from"@backstage/core-plugin-api";import{useQueryClient as n,useMutation as u}from"@tanstack/react-query";import{soundcheckApiRef as l}from"../../api.esm.js";import{MutationKeys as h,QueryKeys as o}from"../graphqlKeys.esm.js";import{useSoundcheckAlert as m}from"../useSoundcheckAlert.esm.js";const y="Error Creating Check";function k(){const i=a(l),t=n(),{showAlert:s}=m(),c=async r=>{const e=await i.createCheck(r);if(!e)throw new Error("Failed to create check.");return e};return u([h.CreateCheck],c,{onSuccess:()=>{Promise.all([t.invalidateQueries({queryKey:[o.GetChecks]}),t.invalidateQueries({queryKey:[o.GetCheckOwners]}),t.invalidateQueries({queryKey:[o.ExecutableChecks]})])},onError:r=>{let e="Failed to create check.";r instanceof Error&&(e=r.message),s({severity:"error",title:y,message:e})}})}export{k as useCreateCheck};
1
+ import{useApi as a}from"@backstage/core-plugin-api";import{useQueryClient as n,useMutation as u}from"@tanstack/react-query";import{soundcheckApiRef as l}from"../../api.esm.js";import{MutationKeys as h,QueryKeys as o}from"../graphqlKeys.esm.js";import{useSoundcheckAlert as m}from"../useSoundcheckAlert.esm.js";const y="Error Creating Check";function k(){const i=a(l),t=n(),{showAlert:s}=m(),c=async r=>{const e=await i.createCheck(r);if(!e)throw new Error("Failed to create check.");return e};return u([h.CreateCheck],c,{onSuccess:()=>Promise.all([t.invalidateQueries({queryKey:[o.GetChecks]}),t.invalidateQueries({queryKey:[o.GetCheckOwners]}),t.invalidateQueries({queryKey:[o.ExecutableChecks]})]),onError:r=>{let e="Failed to create check.";r instanceof Error&&(e=r.message),s({severity:"error",title:y,message:e})}})}export{k as useCreateCheck};
2
2
  //# sourceMappingURL=useCreateCheck.esm.js.map
@@ -1,2 +1,2 @@
1
- import{useApi as n}from"@backstage/core-plugin-api";import{useQueryClient as y,useMutation as l}from"@tanstack/react-query";import{useParams as m}from"react-router-dom";import{soundcheckApiRef as f}from"../../api.esm.js";import{MutationKeys as k,QueryKeys as t}from"../graphqlKeys.esm.js";import{useSoundcheckAlert as d}from"../useSoundcheckAlert.esm.js";const h="Error Executing Check";function p(){const a=n(f),e=y(),{showAlert:o}=d(),c=async r=>await a.executeCheck(r),{trackId:s}=m();return l([k.ExecuteCheck],c,{onSuccess:(r,{checkerId:i,entityRef:u})=>{Promise.all([e.invalidateQueries({queryKey:[t.CertificationDetails,u]}),e.invalidateQueries({queryKey:[t.CertificationStatus,u]}),e.invalidateQueries({queryKey:[t.Certifications,u]}),e.invalidateQueries({queryKey:[t.CheckDetails,u,s,i]}),e.invalidateQueries({queryKey:[t.CheckStatus,i,u]}),e.invalidateQueries({queryKey:[t.TrackEntities]})])},onError:r=>{let i="Failed to execute check.";r instanceof Error&&(i=r.message),o({severity:"error",title:h,message:i})}})}export{p as useExecuteCheck};
1
+ import{useApi as n}from"@backstage/core-plugin-api";import{useQueryClient as y,useMutation as l}from"@tanstack/react-query";import{useParams as m}from"react-router-dom";import{soundcheckApiRef as f}from"../../api.esm.js";import{MutationKeys as k,QueryKeys as t}from"../graphqlKeys.esm.js";import{useSoundcheckAlert as d}from"../useSoundcheckAlert.esm.js";const h="Error Executing Check";function p(){const a=n(f),e=y(),{showAlert:o}=d(),c=async r=>await a.executeCheck(r),{trackId:u}=m();return l([k.ExecuteCheck],c,{onSuccess:(r,{checkerId:i,entityRef:s})=>Promise.all([e.invalidateQueries({queryKey:[t.CertificationDetails,s]}),e.invalidateQueries({queryKey:[t.CertificationStatus,s]}),e.invalidateQueries({queryKey:[t.Certifications,s]}),e.invalidateQueries({queryKey:[t.CheckDetails,s,u,i]}),e.invalidateQueries({queryKey:[t.CheckStatus,i,s]}),e.invalidateQueries({queryKey:[t.TrackEntities]})]),onError:r=>{let i="Failed to execute check.";r instanceof Error&&(i=r.message),o({severity:"error",title:h,message:i})}})}export{p as useExecuteCheck};
2
2
  //# sourceMappingURL=useExecuteCheck.esm.js.map
@@ -1,2 +1,2 @@
1
- import{useApi as u}from"@backstage/core-plugin-api";import{useQueryClient as a,useMutation as n}from"@tanstack/react-query";import{soundcheckApiRef as h}from"../../api.esm.js";import{MutationKeys as l,QueryKeys as o}from"../graphqlKeys.esm.js";import{useSoundcheckAlert as m}from"../useSoundcheckAlert.esm.js";const p="Error Creating Check";function d(){const i=u(h),t=a(),{showAlert:s}=m(),c=async r=>{const e=await i.updateCheck(r);if(!e)throw new Error("Failed to update check.");return e};return n([l.UpdateCheck],c,{onSuccess:()=>{Promise.all([t.invalidateQueries({queryKey:[o.GetChecks]}),t.invalidateQueries({queryKey:[o.GetCheckOwners]}),t.invalidateQueries({queryKey:[o.ExecutableChecks]})])},onError:r=>{let e="Failed to update check.";r instanceof Error&&(e=r.message),s({severity:"error",title:p,message:e})}})}export{d as useUpdateCheck};
1
+ import{useApi as u}from"@backstage/core-plugin-api";import{useQueryClient as a,useMutation as n}from"@tanstack/react-query";import{soundcheckApiRef as h}from"../../api.esm.js";import{MutationKeys as l,QueryKeys as o}from"../graphqlKeys.esm.js";import{useSoundcheckAlert as m}from"../useSoundcheckAlert.esm.js";const p="Error Creating Check";function d(){const i=u(h),t=a(),{showAlert:s}=m(),c=async r=>{const e=await i.updateCheck(r);if(!e)throw new Error("Failed to update check.");return e};return n([l.UpdateCheck],c,{onSuccess:()=>Promise.all([t.invalidateQueries({queryKey:[o.GetChecks]}),t.invalidateQueries({queryKey:[o.GetCheckOwners]}),t.invalidateQueries({queryKey:[o.ExecutableChecks]})]),onError:r=>{let e="Failed to update check.";r instanceof Error&&(e=r.message),s({severity:"error",title:p,message:e})}})}export{d as useUpdateCheck};
2
2
  //# sourceMappingURL=useUpdateCheck.esm.js.map
@@ -1,2 +1,2 @@
1
- import{useApi as s}from"@backstage/core-plugin-api";import{useQueryClient as u,useMutation as a}from"@tanstack/react-query";import{soundcheckApiRef as c}from"../../api.esm.js";import{MutationKeys as l,QueryKeys as f}from"../graphqlKeys.esm.js";import{useSoundcheckAlert as g}from"../useSoundcheckAlert.esm.js";const p="Error Configuring Integration";function m(){const r=s(c),t=u(),{showAlert:i}=g(),n=async e=>{const o=await r.updateCollectorConfig(e);if(!o)throw new Error("Failed to update integration configuration.");return o};return a([l.UpdateCollectorConfig],n,{onSuccess:()=>{t.invalidateQueries({queryKey:[f.GetCollectors]})},onError:e=>{let o="Failed to update integration configuration.";e instanceof Error&&(o=e.message),i({severity:"error",title:p,message:o})}})}export{m as useUpdateCollectorConfig};
1
+ import{useApi as s}from"@backstage/core-plugin-api";import{useQueryClient as u,useMutation as a}from"@tanstack/react-query";import{soundcheckApiRef as c}from"../../api.esm.js";import{MutationKeys as l,QueryKeys as f}from"../graphqlKeys.esm.js";import{useSoundcheckAlert as g}from"../useSoundcheckAlert.esm.js";const p="Error Configuring Integration";function m(){const r=s(c),t=u(),{showAlert:i}=g(),n=async e=>{const o=await r.updateCollectorConfig(e);if(!o)throw new Error("Failed to update integration configuration.");return o};return a([l.UpdateCollectorConfig],n,{onSuccess:()=>t.invalidateQueries({queryKey:[f.GetCollectors]}),onError:e=>{let o="Failed to update integration configuration.";e instanceof Error&&(o=e.message),i({severity:"error",title:p,message:o})}})}export{m as useUpdateCollectorConfig};
2
2
  //# sourceMappingURL=useUpdateCollectorConfig.esm.js.map
@@ -1,2 +1,2 @@
1
- import{useApi as c}from"@backstage/core-plugin-api";import{useQueryClient as i,useMutation as u}from"@tanstack/react-query";import{soundcheckApiRef as m}from"../../api.esm.js";import{MutationKeys as l,QueryKeys as t}from"../graphqlKeys.esm.js";import{useSoundcheckAlert as f}from"../useSoundcheckAlert.esm.js";const k="Error Creating Track";function d(){const o=c(m),a=i(),{showAlert:s}=f(),n=async e=>{const r=await o.createProgram(e);if(!r)throw new Error("Failed to create track.");return r};return u([l.CreateProgram],n,{onSuccess:async()=>{const e=[t.GetAllPrograms,t.GetOverallTrackPassRateTrends,t.GetIndividualTrackPassRateTrends,t.GetTrackOwners];for(const r of e)a.invalidateQueries({queryKey:[r]})},onError:e=>{let r="Failed to create track.";e instanceof Error&&(r=e.message),s({severity:"error",title:k,message:r})}})}export{d as useCreateTrack};
1
+ import{useApi as i}from"@backstage/core-plugin-api";import{useQueryClient as c,useMutation as u}from"@tanstack/react-query";import{soundcheckApiRef as m}from"../../api.esm.js";import{MutationKeys as l,QueryKeys as t}from"../graphqlKeys.esm.js";import{useSoundcheckAlert as k}from"../useSoundcheckAlert.esm.js";const d="Error Creating Track";function f(){const a=i(m),o=c(),{showAlert:s}=k(),n=async e=>{const r=await a.createProgram(e);if(!r)throw new Error("Failed to create track.");return r};return u([l.CreateProgram],n,{onSuccess:async()=>{const e=[t.GetAllPrograms,t.GetOverallTrackPassRateTrends,t.GetIndividualTrackPassRateTrends,t.GetTrackOwners];return Promise.all(e.map(r=>o.invalidateQueries({queryKey:[r]})))},onError:e=>{let r="Failed to create track.";e instanceof Error&&(r=e.message),s({severity:"error",title:d,message:r})}})}export{f as useCreateTrack};
2
2
  //# sourceMappingURL=useCreateTrack.esm.js.map
@@ -1,2 +1,2 @@
1
- import{useApi as c}from"@backstage/core-plugin-api";import{useQueryClient as l,useMutation as u}from"@tanstack/react-query";import{soundcheckApiRef as m}from"../../api.esm.js";import{MutationKeys as d,QueryKeys as t}from"../graphqlKeys.esm.js";import{useSoundcheckAlert as f}from"../useSoundcheckAlert.esm.js";const k="Error Deleting Track";function p(){const s=c(m),a=l(),{showAlert:n}=f(),i=async e=>{const r=await s.deleteProgram(e);if(!r)throw new Error(`Failed to delete track ${e}`);return r};return u([d.DeleteProgram],i,{onSuccess:()=>{const e=[t.GetAllPrograms,t.GetOverallTrackPassRateTrends,t.GetIndividualTrackPassRateTrends,t.GetTrackOwners];for(const r of e)a.invalidateQueries({queryKey:[r]})},onError:(e,r)=>{let o=`Failed to delete track ${r}`;e instanceof Error&&(o=e.message),n({severity:"error",title:k,message:o})}})}export{p as useDeleteTrack};
1
+ import{useApi as l}from"@backstage/core-plugin-api";import{useQueryClient as c,useMutation as u}from"@tanstack/react-query";import{soundcheckApiRef as m}from"../../api.esm.js";import{MutationKeys as d,QueryKeys as t}from"../graphqlKeys.esm.js";import{useSoundcheckAlert as f}from"../useSoundcheckAlert.esm.js";const k="Error Deleting Track";function p(){const s=l(m),a=c(),{showAlert:n}=f(),i=async e=>{const r=await s.deleteProgram(e);if(!r)throw new Error(`Failed to delete track ${e}`);return r};return u([d.DeleteProgram],i,{onSuccess:()=>{const e=[t.GetAllPrograms,t.GetOverallTrackPassRateTrends,t.GetIndividualTrackPassRateTrends,t.GetTrackOwners];return Promise.all(e.map(r=>a.invalidateQueries({queryKey:[r]})))},onError:(e,r)=>{let o=`Failed to delete track ${r}`;e instanceof Error&&(o=e.message),n({severity:"error",title:k,message:o})}})}export{p as useDeleteTrack};
2
2
  //# sourceMappingURL=useDeleteTrack.esm.js.map