@spotify/backstage-plugin-soundcheck 0.14.3 → 0.14.5

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