@spotify/backstage-plugin-soundcheck 0.15.1 → 0.16.1

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 (153) hide show
  1. package/CHANGELOG.md +79 -0
  2. package/dist/alpha.d.ts +62 -47
  3. package/dist/api.esm.js +1 -1
  4. package/dist/components/Badges/CampaignBadge.esm.js +1 -1
  5. package/dist/components/Badges/NoLevelBadge.esm.js +1 -1
  6. package/dist/components/Badges/PlaylistBadge.esm.js +1 -1
  7. package/dist/components/CampaignForm/CampaignForm.esm.js +1 -1
  8. package/dist/components/CampaignForm/Steps/CampaignDetailsStep/CampaignOwnerField.esm.js +1 -1
  9. package/dist/components/CampaignForm/hooks/useCampaignForm.esm.js +1 -1
  10. package/dist/components/CampaignForm/hooks/utils.esm.js +1 -1
  11. package/dist/components/CampaignForm/utils/campaignFormUtils.esm.js +2 -1
  12. package/dist/components/CampaignForm/utils/validation.esm.js +1 -1
  13. package/dist/components/CertificationAccordion/CertificationAccordion.esm.js +1 -1
  14. package/dist/components/CertificationSidebar/CertificationSidebar.esm.js +1 -1
  15. package/dist/components/CertificationSidebar/Check.esm.js +1 -1
  16. package/dist/components/CertificationSidebar/CheckResultInputPopup.esm.js +2 -0
  17. package/dist/components/CertificationSidebar/CheckResultSummaryList.esm.js +1 -1
  18. package/dist/components/CertificationSidebar/ExemptionJustificationDialog.esm.js +2 -0
  19. package/dist/components/CertificationsPage/CertificationTab.esm.js +1 -1
  20. package/dist/components/CertificationsPage/CertificationTabs.esm.js +1 -1
  21. package/dist/components/CertificationsPage/CertificationsPage.esm.js +1 -1
  22. package/dist/components/CertificationsPage/Playlist/PlaylistProgress.esm.js +1 -1
  23. package/dist/components/CheckCard/CheckCard.esm.js +1 -1
  24. package/dist/components/CheckDetails/CheckDetails.esm.js +1 -1
  25. package/dist/components/CheckDetails/CheckResultDetails.esm.js +2 -0
  26. package/dist/components/CheckDetails/CollapseRow.esm.js +1 -1
  27. package/dist/components/CheckDetails/FactTable.esm.js +2 -0
  28. package/dist/components/CheckDetails/JustificationDetails.esm.js +2 -0
  29. package/dist/components/CheckDetails/ResolvedValueTable.esm.js +2 -0
  30. package/dist/components/CheckDetails/ResultStateBox.esm.js +1 -1
  31. package/dist/components/CheckDetails/SelectedValueContext.esm.js +2 -0
  32. package/dist/components/CheckDetails/findUniqueFacts.esm.js +2 -0
  33. package/dist/components/CheckDryRun/CheckDryRun.esm.js +1 -1
  34. package/dist/components/CheckDryRun/CheckDryRunContext.esm.js +1 -1
  35. package/dist/components/CheckDryRun/CheckDryRunDetails.esm.js +1 -1
  36. package/dist/components/CheckDryRun/CheckDryRunDialog.esm.js +1 -1
  37. package/dist/components/CheckForm/CheckForm.esm.js +1 -1
  38. package/dist/components/CheckForm/FormFields/CheckPathResolverInput.esm.js +1 -1
  39. package/dist/components/CheckForm/FormFields/CheckScheduleSection/ScheduleSection.esm.js +1 -1
  40. package/dist/components/CheckForm/FormFields/CheckTypeInput/CheckTypeInput.esm.js +2 -0
  41. package/dist/components/CheckForm/FormFields/RuleInput/Conditions/FactValueDisplay.esm.js +1 -1
  42. package/dist/components/CheckForm/FormFields/RuleInput/Conditions/RuleConditionInput.esm.js +1 -1
  43. package/dist/components/CheckForm/FormFields/RuleInput/Conditions/ValueListInput.esm.js +1 -1
  44. package/dist/components/CheckForm/FormFields/TeamDetailsInput/TeamDetailsInput.esm.js +1 -1
  45. package/dist/components/CheckForm/Steps/CheckDetailsStep.esm.js +1 -1
  46. package/dist/components/CheckForm/Steps/CheckReviewStep.esm.js +1 -1
  47. package/dist/components/CheckForm/Steps/CheckRulesStep.esm.js +1 -1
  48. package/dist/components/CheckForm/useCheckForm.esm.js +1 -1
  49. package/dist/components/CheckForm/utils/checkFormUtils.esm.js +2 -1
  50. package/dist/components/CheckForm/utils/validation.esm.js +1 -1
  51. package/dist/components/CheckIcon/CheckIcon.esm.js +1 -1
  52. package/dist/components/CheckPage/CheckStatusHistoryChart.esm.js +1 -1
  53. package/dist/components/CheckPage/utils.esm.js +1 -1
  54. package/dist/components/CollectorPage/Configurators/AzureDevOps/AzureDevOpsConfigurator.esm.js +2 -0
  55. package/dist/components/CollectorPage/Configurators/AzureDevOps/NumberOfDaysComponent.esm.js +2 -0
  56. package/dist/components/CollectorPage/Configurators/AzureDevOps/NumberOfWorkItemsComponent.esm.js +2 -0
  57. package/dist/components/CollectorPage/Configurators/AzureDevOps/utils.esm.js +2 -0
  58. package/dist/components/CollectorPage/Configurators/AzureDevOps/validation.esm.js +2 -0
  59. package/dist/components/CollectorPage/Configurators/BigQuery/QueryFactDetailsComponent.esm.js +1 -1
  60. package/dist/components/CollectorPage/Configurators/Catalog/CatalogConfigurator.esm.js +2 -0
  61. package/dist/components/CollectorPage/Configurators/Catalog/utils.esm.js +2 -0
  62. package/dist/components/CollectorPage/Configurators/Common/CollectorOption.esm.js +1 -1
  63. package/dist/components/CollectorPage/Configurators/Common/FactCollectionConfig.esm.js +1 -1
  64. package/dist/components/CollectorPage/Configurators/Common/utils.esm.js +1 -1
  65. package/dist/components/CollectorPage/Configurators/Configurator.esm.js +1 -1
  66. package/dist/components/CollectorPage/Configurators/Github/CodeScanningAlertsFactDetails.esm.js +2 -0
  67. package/dist/components/CollectorPage/Configurators/Github/DependabotAlertsFactDetails.esm.js +2 -0
  68. package/dist/components/CollectorPage/Configurators/Github/GithubConfigurator.esm.js +1 -1
  69. package/dist/components/CollectorPage/Configurators/Github/SecretScanningAlertsFactDetails.esm.js +2 -0
  70. package/dist/components/CollectorPage/Configurators/Github/SecurityAdvisoriesFactDetails.esm.js +2 -0
  71. package/dist/components/CollectorPage/Configurators/Github/types.esm.js +2 -0
  72. package/dist/components/CollectorPage/Configurators/Github/utils.esm.js +1 -1
  73. package/dist/components/CollectorPage/Configurators/Github/validation.esm.js +2 -0
  74. package/dist/components/CollectorPage/Configurators/HTTP/HttpConfigurator.esm.js +2 -0
  75. package/dist/components/CollectorPage/Configurators/HTTP/HttpRequestComponent.esm.js +2 -0
  76. package/dist/components/CollectorPage/Configurators/HTTP/HttpResponseComponent.esm.js +2 -0
  77. package/dist/components/CollectorPage/Configurators/HTTP/HttpRetriesComponent.esm.js +2 -0
  78. package/dist/components/CollectorPage/Configurators/HTTP/HttpStatusesInput.esm.js +2 -0
  79. package/dist/components/CollectorPage/Configurators/HTTP/RequestFactDetailsComponent.esm.js +2 -0
  80. package/dist/components/CollectorPage/Configurators/HTTP/utils.esm.js +2 -0
  81. package/dist/components/CollectorPage/Configurators/HTTP/validation.esm.js +2 -0
  82. package/dist/components/CollectorPage/Configurators/SCM/JsonFactDetailsComponent.esm.js +1 -1
  83. package/dist/components/CollectorPage/Configurators/SCM/RegexFactDetailsComponent.esm.js +1 -1
  84. package/dist/components/CollectorPage/Configurators/SCM/utils.esm.js +1 -1
  85. package/dist/components/CollectorsPage/CollectorListPage/CollectorLogo.esm.js +1 -1
  86. package/dist/components/CollectorsPage/CollectorListPage/CollectorSummaryCard.esm.js +1 -1
  87. package/dist/components/EntityChip/EntityChip.esm.js +2 -0
  88. package/dist/components/EntitySoundcheckCard/Card.esm.js +1 -1
  89. package/dist/components/FactExplorer/FactExplorer.esm.js +1 -1
  90. package/dist/components/Filter/EntityAutocompletePicker.esm.js +1 -1
  91. package/dist/components/Filter/FilterComponent.esm.js +1 -1
  92. package/dist/components/Filter/FilterKeyValueInput.esm.js +2 -0
  93. package/dist/components/Filter/FilterPreviewTable/FilterPreviewTable.esm.js +1 -1
  94. package/dist/components/Filter/KeyValueInputDialog.esm.js +2 -0
  95. package/dist/components/Filter/types.esm.js +1 -1
  96. package/dist/components/Filter/utils.esm.js +1 -1
  97. package/dist/components/FormControlledAutocomplete/FormControlledMultipleAutocomplete.esm.js +2 -0
  98. package/dist/components/FormControlledSelect/FormControlledSelect.esm.js +1 -1
  99. package/dist/components/FormFilterSection/FormFilterSection.esm.js +1 -1
  100. package/dist/components/Frequency/FrequencyComponent.esm.js +1 -1
  101. package/dist/components/GroupSelector/GroupSelector.esm.js +1 -1
  102. package/dist/components/OrgHealth/OrgHealthPage.esm.js +2 -0
  103. package/dist/components/OverviewPage/OverviewPageHeader.esm.js +1 -1
  104. package/dist/components/OverviewTable/ResultsTable.esm.js +1 -1
  105. package/dist/components/OverviewTable/ResultsTableRow.esm.js +1 -1
  106. package/dist/components/Router.esm.js +1 -1
  107. package/dist/components/RoutingPage/RoutingPage.esm.js +1 -1
  108. package/dist/components/RuleResult/BranchResultComponent.esm.js +2 -0
  109. package/dist/components/RuleResult/ConditionResultComponent.esm.js +2 -0
  110. package/dist/components/RuleResult/RuleResultComponent.esm.js +2 -0
  111. package/dist/components/SearchBar/SearchBar.esm.js +1 -1
  112. package/dist/components/SoundcheckHeader/Breadcrumbs.esm.js +1 -1
  113. package/dist/components/SoundcheckHeader/SoundcheckHeader.esm.js +1 -1
  114. package/dist/components/SummaryCard/SummaryCardActionsMenu.esm.js +1 -1
  115. package/dist/components/TechHealth/Filters/FacetFilter.esm.js +1 -1
  116. package/dist/components/TechHealth/Filters/FilterProvider.esm.js +1 -1
  117. package/dist/components/TechHealthTabs/PassRateTabHeader.esm.js +1 -1
  118. package/dist/components/TrackEditPage/TrackEditView.esm.js +1 -1
  119. package/dist/components/TrackForm/Steps/TrackDetailsStep/TrackBadgeTypeSelect/TrackBadgeTypeSelect.esm.js +1 -1
  120. package/dist/components/TrackForm/Steps/TrackDetailsStep/TrackOwnerSelect/TrackOwnerSelect.esm.js +1 -1
  121. package/dist/components/TrackForm/TrackForm.esm.js +1 -1
  122. package/dist/components/TrackForm/utils/trackFormUtils.esm.js +2 -1
  123. package/dist/components/TrackForm/utils/useTrackForm.esm.js +1 -1
  124. package/dist/components/TrackForm/utils/validation.esm.js +1 -1
  125. package/dist/components/TrackPage/TrackEntitiesTable/utils.esm.js +1 -1
  126. package/dist/components/TracksPage/TracksPage.esm.js +1 -1
  127. package/dist/graphql/generated/index.esm.js +166 -126
  128. package/dist/hooks/certifications/useCertificationDetailsForTrack.esm.js +1 -1
  129. package/dist/hooks/certifications/useTrackOverviewForOwner.esm.js +2 -0
  130. package/dist/hooks/checks/useDeleteCheck.esm.js +1 -1
  131. package/dist/hooks/checks/useSetManualResult.esm.js +2 -0
  132. package/dist/hooks/exemptions/useDeleteExemption.esm.js +2 -0
  133. package/dist/hooks/exemptions/useGetExemption.esm.js +2 -0
  134. package/dist/hooks/exemptions/useSetEntityExempt.esm.js +2 -0
  135. package/dist/hooks/facets/useFacetFilters.esm.js +1 -1
  136. package/dist/hooks/graphqlKeys.esm.js +1 -1
  137. package/dist/hooks/tracks/useCreateTrack.esm.js +1 -1
  138. package/dist/hooks/tracks/useDeleteTrack.esm.js +1 -1
  139. package/dist/hooks/tracks/useGetAllTracks.esm.js +1 -1
  140. package/dist/hooks/tracks/useGetChecksMap.esm.js +1 -1
  141. package/dist/hooks/tracks/useUpdateTrack.esm.js +1 -1
  142. package/dist/images/azure-devops-rgb.svg +13 -0
  143. package/dist/images/azure-devops-white.svg +13 -0
  144. package/dist/images/http-rgb.svg +11 -0
  145. package/dist/images/http-white.svg +11 -0
  146. package/dist/index.d.ts +0 -1
  147. package/dist/text.esm.js +1 -1
  148. package/dist/utils/export.esm.js +3 -3
  149. package/dist/utils/validation.esm.js +1 -1
  150. package/package.json +30 -24
  151. package/dist/components/CheckDryRun/checkDryRunUtils.esm.js +0 -2
  152. package/dist/hooks/certifications/useProgramOverviewForOwner.esm.js +0 -2
  153. /package/dist/components/CollectorPage/Configurators/{BigQuery → Common}/css/prism-dark-sql.css.esm.js +0 -0
@@ -1,2 +1,2 @@
1
- import{makeStyles as w,useTheme as v,Box as o,Paper as k,Typography as b,Tooltip as D}from"@material-ui/core";import u from"@material-ui/lab/Skeleton";import{DateTime as R}from"luxon";import t from"react";import{CircularProgressbar as $,buildStyles as B}from"react-circular-progressbar";import{getChartFontColor as g,formatDate as P}from"../Charts/chartUtils.esm.js";import{getApplicableCheckCount as p}from"../TrackPage/TrackEntitiesTable/utils.esm.js";import{getProgressColor as x}from"../TrackPage/utils.esm.js";import{CheckHistoryChart as T}from"./CheckHistoryChart.esm.js";import{getCheckName as W}from"./utils.esm.js";const y=w(e=>({card:{display:"flex",flexDirection:"column",border:`1px solid ${e.palette.divider}`,width:"99%"},title:{fontWeight:"bold",fontSize:"0.9rem",cursor:"default",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},headerRow:{display:"flex",padding:e.spacing(1.5,2),borderBottom:`1px solid ${e.palette.divider}`,width:"100%"},headerSection:{display:"flex",flexDirection:"column",gap:e.spacing(.5),flexGrow:1,width:"100%"},contentRow:{padding:e.spacing(1.5,2,.5),display:"flex"},leftSection:{width:"75px",minWidth:"75px"},summaryCard:{height:"100%",display:"flex",flexDirection:"column",justifyContent:"space-between"},chartSection:{flex:1,width:"100%",minWidth:"150px"},chartSkeletonSection:{flex:1,width:"100%",minWidth:"150px",padding:e.spacing(0,0,1,1)},overallSummaryBox:{display:"flex",flexDirection:"column",height:"100%",color:g(e),textAlign:"center",gap:e.spacing(2)}})),z=()=>{const e=y();return t.createElement(o,{className:e.contentRow},t.createElement(o,{className:e.leftSection},t.createElement(o,{className:e.summaryCard},t.createElement(u,{variant:"circle",height:75}))),t.createElement(o,{className:e.chartSkeletonSection},t.createElement(u,{variant:"rect",height:92})))};function A(e){if(!e)return[];const{history:n}=e,a=R.utc();return n.map((l,r)=>{const i=p(l);return{name:P(a,n.length-r-1),passRate:i?Math.round(l.passed/i*100):0}})}function M(e){if(!e)return 0;const{passed:n}=e,a=p(e);return a?Math.round(n/a*100):0}function j(e){if(!e)return{numerator:0,denominator:0};const{passed:n}=e,a=p(e);return{numerator:n,denominator:a}}const F=({check:e,track:n,status:a,history:l})=>{const r=y(),i=v(),E={dataKey:"passRate",name:"Pass rate"},C=l?.history?.length??0,S=A(l),c=M(a);let m;a?m=`${c}%`:m="No Data";let d=!1,s;if(!a)s="No Data";else{const{numerator:N,denominator:f}=j(a);f>0?(d=!0,s=`${N} of ${f} entities passing`):s="No Applicable Entities"}const h=d?t.createElement(o,{className:r.overallSummaryBox},t.createElement($,{value:c,text:m,styles:B({textColor:g(i),pathColor:x(i,c),trailColor:i.palette.divider,textSize:C?void 0:10})})):null;return t.createElement(k,{className:r.card,elevation:0},t.createElement(o,{className:r.headerRow},t.createElement(o,{className:r.headerSection},t.createElement(b,{className:r.title},W(n,e)))),!a||!l?t.createElement(z,null):t.createElement(D,{title:s},t.createElement(o,{className:r.contentRow},h&&t.createElement(o,{className:r.leftSection},t.createElement(o,{className:r.summaryCard},h)),t.createElement(o,{className:r.chartSection},t.createElement(T,{data:d?S:[],lineConfig:E,color:x(i,c)})))))};export{F as CheckCard};
1
+ import{makeStyles as w,useTheme as v,Box as n,Paper as k,Typography as b,Tooltip as D}from"@material-ui/core";import u from"@material-ui/lab/Skeleton";import{DateTime as R}from"luxon";import t from"react";import{CircularProgressbar as $,buildStyles as B}from"react-circular-progressbar";import{getChartFontColor as x,formatDate as P}from"../Charts/chartUtils.esm.js";import{getApplicableCheckCount as d}from"../TrackPage/TrackEntitiesTable/utils.esm.js";import{getProgressColor as g}from"../TrackPage/utils.esm.js";import{CheckHistoryChart as T}from"./CheckHistoryChart.esm.js";import{getCheckName as W}from"./utils.esm.js";const y=w(e=>({card:{display:"flex",flexDirection:"column",border:`1px solid ${e.palette.divider}`,width:"99%"},title:{fontWeight:"bold",fontSize:"0.9rem",cursor:"default",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},headerRow:{display:"flex",padding:e.spacing(1.5,2),borderBottom:`1px solid ${e.palette.divider}`,width:"100%"},headerSection:{display:"flex",flexDirection:"column",gap:e.spacing(.5),flexGrow:1,width:"100%"},contentRow:{padding:e.spacing(1.5,2,.5),display:"flex"},leftSection:{width:"75px",minWidth:"75px"},summaryCard:{height:"100%",display:"flex",flexDirection:"column",justifyContent:"space-between"},chartSection:{flex:1,width:"100%",minWidth:"150px"},chartSkeletonSection:{flex:1,width:"100%",minWidth:"150px",padding:e.spacing(0,0,1,1)},overallSummaryBox:{display:"flex",flexDirection:"column",height:"100%",color:x(e),textAlign:"center",gap:e.spacing(2)}})),z=()=>{const e=y();return t.createElement(n,{className:e.contentRow},t.createElement(n,{className:e.leftSection},t.createElement(n,{className:e.summaryCard},t.createElement(u,{variant:"circle",height:75}))),t.createElement(n,{className:e.chartSkeletonSection},t.createElement(u,{variant:"rect",height:92})))};function A(e){if(!e)return[];const{history:i}=e,a=R.utc();return i.map((r,o)=>{const l=d(r);return{name:P(a,i.length-o-1),passRate:l?Math.round(r.passed/l*100):0}})}function M(e){if(!e)return 0;const{passed:i,exempt:a}=e,r=d(e);return r?Math.round((i+a)/r*100):0}function j(e){if(!e)return{numerator:0,denominator:0};const{passed:i,exempt:a}=e,r=d(e);return{numerator:i+a,denominator:r}}const F=({check:e,track:i,status:a,history:r})=>{const o=y(),l=v(),E={dataKey:"passRate",name:"Pass rate"},C=r?.history?.length??0,S=A(r),c=M(a);let m;a?m=`${c}%`:m="No Data";let p=!1,s;if(!a)s="No Data";else{const{numerator:N,denominator:f}=j(a);f>0?(p=!0,s=`${N} of ${f} entities passing`):s="No Applicable Entities"}const h=p?t.createElement(n,{className:o.overallSummaryBox},t.createElement($,{value:c,text:m,styles:B({textColor:x(l),pathColor:g(l,c),trailColor:l.palette.divider,textSize:C?void 0:10})})):null;return t.createElement(k,{className:o.card,elevation:0},t.createElement(n,{className:o.headerRow},t.createElement(n,{className:o.headerSection},t.createElement(b,{className:o.title},W(i,e)))),!a||!r?t.createElement(z,null):t.createElement(D,{title:s},t.createElement(n,{className:o.contentRow},h&&t.createElement(n,{className:o.leftSection},t.createElement(n,{className:o.summaryCard},h)),t.createElement(n,{className:o.chartSection},t.createElement(T,{data:p?S:[],lineConfig:E,color:g(l,c)})))))};export{F as CheckCard};
2
2
  //# sourceMappingURL=CheckCard.esm.js.map
@@ -1,2 +1,2 @@
1
- import{MarkdownContent as E}from"@backstage/core-components";import{useEntity as y}from"@backstage/plugin-catalog-react";import{makeStyles as k,Box as v,Typography as m}from"@material-ui/core";import t from"react";import"@backstage/catalog-model";import"@backstage/core-plugin-api";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import"@spotify/backstage-plugin-soundcheck-common";import{useCheckDetails as S}from"../../hooks/checks/useCheckDetails.esm.js";import{useGetChecks as x}from"../../hooks/checks/useGetChecks.esm.js";import"../../hooks/useSoundcheckAlert.esm.js";import"../../hooks/useConfirmationModal.esm.js";import"react-router-dom";import{AlertPanel as C}from"../AlertPanel/AlertPanel.esm.js";import{RelativeTime as B}from"../RelativeTime/RelativeTime.esm.js";import{ResultStateBox as N}from"./ResultStateBox.esm.js";import{CheckDetailsSkeleton as z}from"./skeletons/CheckDetailsSkeleton.esm.js";const s=k(e=>({root:{padding:`${e.spacing(3)}px ${e.spacing(5)}px`},title:{fontWeight:"normal",fontSize:e.typography.h5.fontSize},description:{padding:`${e.spacing(3)}px 0`},subtitle:{fontWeight:"normal",fontSize:e.typography.h6.fontSize},topBar:{display:"flex",justifyContent:"space-between",marginBottom:e.spacing(2)}})),D=({programId:e,checkId:r})=>{const i=s(),{entity:p}=y(),{data:o,isLoading:l,isError:c}=S(p,e,r),{data:d}=x({ids:[r??""],first:1}),f=d?.edges?.[0]?.node;if(c)return t.createElement(v,{padding:2},t.createElement(C,{severity:"error",title:"Error loading check details"}));if(l||!e||!r)return t.createElement(z,null);if(!o)return null;const{name:a,description:u,result:g,timestamp:n,notes:h}=o;return t.createElement("div",{className:i.root,"data-testid":"check-details-view"},t.createElement("div",{className:i.topBar},t.createElement(m,{variant:"h2",className:i.title},a),n?t.createElement(B,{timestamp:n,description:"Last updated"}):null),t.createElement(N,{name:a,state:g,notes:h,templateRef:f?.templateRef??void 0}),t.createElement("div",{className:i.description,"data-testid":"soundcheck-check-details-description"},t.createElement(m,{variant:"h3",className:i.subtitle},"Description"),t.createElement(E,{content:u})))};export{D as CheckDetails,s as useStyles};
1
+ import{stringifyEntityRef as p}from"@backstage/catalog-model";import{MarkdownContent as F}from"@backstage/core-components";import{useApi as j,configApiRef as G}from"@backstage/core-plugin-api";import{useEntity as W}from"@backstage/plugin-catalog-react";import{makeStyles as J,Box as o,Typography as m,Divider as k,Button as u,Tooltip as Z}from"@material-ui/core";import{Alert as $}from"@material-ui/lab";import e,{useState as S}from"react";import{ResultState as d}from"../../graphql/generated/index.esm.js";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import"@spotify/backstage-plugin-soundcheck-common";import{useCheckDetails as q}from"../../hooks/checks/useCheckDetails.esm.js";import{useGetChecks as H}from"../../hooks/checks/useGetChecks.esm.js";import"../../hooks/useSoundcheckAlert.esm.js";import{useGetExemption as K}from"../../hooks/exemptions/useGetExemption.esm.js";import"../../hooks/useConfirmationModal.esm.js";import"react-router-dom";import{useSetManualResult as Q}from"../../hooks/checks/useSetManualResult.esm.js";import{AlertPanel as U}from"../AlertPanel/AlertPanel.esm.js";import{CheckResultInputPopup as V}from"../CertificationSidebar/CheckResultInputPopup.esm.js";import{ExemptionJustificationDialog as X}from"../CertificationSidebar/ExemptionJustificationDialog.esm.js";import{RelativeTime as Y}from"../RelativeTime/RelativeTime.esm.js";import{ResultStateBox as _}from"./ResultStateBox.esm.js";import{CheckDetailsSkeleton as ee}from"./skeletons/CheckDetailsSkeleton.esm.js";const l=J(t=>({root:{padding:`${t.spacing(3)}px ${t.spacing(5)}px`},title:{fontWeight:"normal",fontSize:t.typography.h5.fontSize},description:{padding:`${t.spacing(3)}px 0`},subtitle:{fontWeight:"normal",fontSize:t.typography.h6.fontSize},topBar:{display:"flex",justifyContent:"space-between",marginBottom:t.spacing(2)},exemptButton:{marginLeft:t.spacing(1)},exemptAlert:{marginBottom:t.spacing(2)}})),v=({setPopupDisplayed:t})=>{const i=l();return e.createElement(u,{className:i.exemptButton,size:"small",color:"primary",onClick:()=>t(!0),"aria-label":"Set Check Status Button",variant:"contained"},"Set Check Status")},C=({isExempt:t,setPopupDisplayed:i})=>{const a=l();return e.createElement(Z,{title:t?"Remove Exemption":"Set Exempt From Check"},e.createElement(u,{className:a.exemptButton,size:"small",color:"inherit",onClick:()=>i(!0),"aria-label":"Exempt From Check"},t?"Remove Exemption":"Add Exemption"))},te=({programId:t,checkId:i})=>{const a=l(),{entity:n}=W(),{data:f,isLoading:R,isError:B}=q(n,t,i),[b,E]=S(!1),[D,c]=S(!1),{data:r,isLoading:N}=K(p(n),i??""),{data:A}=H({ids:[i??""],first:1}),{mutateAsync:T,isLoading:ie}=Q(),w=j(G).getOptionalStringArray("soundcheck.flags")?.includes("enable-MCE");if(B)return e.createElement(o,{padding:2},e.createElement(U,{severity:"error",title:"Error loading check details"}));if(R||!t||!i)return e.createElement(ee,null);if(!f)return null;const h=A?.edges?.[0]?.node,g=h?.type==="manual",{name:y,description:I,result:s,timestamp:x,details:z}=f,P=async(L,O)=>{if(!n||!i)return;const M=p(n);await T({checkId:i,entityRef:M,justification:O,state:L})};return e.createElement("div",{className:a.root,"data-testid":"check-details-view"},e.createElement("div",{className:a.topBar},e.createElement(m,{variant:"h2",className:a.title},y),e.createElement(o,{display:"flex",alignItems:"center"},x?e.createElement(Y,{timestamp:x,description:"Last updated"}):null,g&&!r?.exemption&&s!==d.NotReported&&e.createElement(v,{setPopupDisplayed:c}),!N&&w&&e.createElement(C,{isExempt:!!r?.exemption,setPopupDisplayed:E}))),e.createElement(X,{entityRef:p(n),checkId:i,isOpen:b,setIsOpen:E}),e.createElement(V,{isOpen:D,setIsOpen:c,setCallback:P}),!r?.exemption&&s===d.Exempt&&e.createElement($,{className:a.exemptAlert,severity:"warning",variant:"outlined"},"This check's exemption for this entity was recently removed. The recent exemption state will clear once the check has been run."),!!r?.exemption&&e.createElement(o,{marginBottom:2},e.createElement(k,null),e.createElement(m,{variant:"h6",color:"textSecondary"},"This entity has been exempted from this check."),e.createElement(k,null)),g&&!r?.exemption&&s===d.NotReported?e.createElement(o,null,e.createElement(m,null,"This check is manual and must have its state set by a user."),e.createElement(o,{marginTop:1},e.createElement(u,{variant:"contained",color:"primary",onClick:()=>c(!0),"aria-label":"Set Result",size:"small"},"Set Check Status"))):e.createElement(e.Fragment,null,e.createElement(m,{className:a.subtitle},"Most Recent Result:"),e.createElement(_,{name:y,state:s,details:z,templateRef:h?.templateRef??void 0})),e.createElement("div",{className:a.description,"data-testid":"soundcheck-check-details-description"},e.createElement(m,{variant:"h3",className:a.subtitle},"Description"),e.createElement(F,{content:I})))};export{te as CheckDetails,C as ExemptDialogButton,v as SetCheckStatusButton,l as useStyles};
2
2
  //# sourceMappingURL=CheckDetails.esm.js.map
@@ -0,0 +1,2 @@
1
+ import{Box as t,Typography as r}from"@material-ui/core";import e from"react";import{RuleResultComponent as a}from"../RuleResult/RuleResultComponent.esm.js";import{FactTable as m}from"./FactTable.esm.js";const n=({ruleResult:l})=>e.createElement(e.Fragment,null,e.createElement(t,{mt:2},e.createElement(r,{variant:"h3"},"Rule Evaluation"),e.createElement(t,{p:2},e.createElement(a,{ruleResult:l}))),e.createElement(r,{variant:"h3"},"Resolved Values"),e.createElement(t,{p:2},e.createElement(m,{ruleResult:l})));export{n as CheckResultDetails};
2
+ //# sourceMappingURL=CheckResultDetails.esm.js.map
@@ -1,2 +1,2 @@
1
- import{TableRow as t,TableCell as n,IconButton as i,Collapse as c}from"@material-ui/core";import p from"@material-ui/icons/KeyboardArrowDown";import u from"@material-ui/icons/KeyboardArrowUp";import e,{useState as s}from"react";const d=({title:a,children:o,defaultOpen:m=!0})=>{const[l,r]=s(m);return e.createElement(e.Fragment,null,e.createElement(t,null,e.createElement(n,{colSpan:2,padding:"normal",align:"left",size:"small"},e.createElement(i,{"aria-label":"expand row",size:"small",onClick:()=>r(!l)},l?e.createElement(u,null):e.createElement(p,null)),e.createElement("strong",null,a))),e.createElement(t,null,e.createElement(n,{style:{paddingBottom:0,paddingTop:0},colSpan:2,padding:"normal",align:"left",size:"small"},e.createElement(c,{in:l,timeout:"auto",unmountOnExit:!0},o))))};export{d as CollapseRow};
1
+ import{TableRow as t,TableCell as n,IconButton as i,Collapse as c}from"@material-ui/core";import p from"@material-ui/icons/KeyboardArrowDown";import u from"@material-ui/icons/KeyboardArrowUp";import e,{useState as s}from"react";const d=({title:a,children:o,defaultOpen:r=!0})=>{const[l,m]=s(r);return e.createElement(e.Fragment,null,e.createElement(t,null,e.createElement(n,{colSpan:2,padding:"normal",align:"left",size:"small"},e.createElement(i,{"aria-label":"expand row",size:"small",onClick:()=>m(!l)},l?e.createElement(u,null):e.createElement(p,null)),e.createElement("strong",null,a))),e.createElement(t,null,e.createElement(n,{style:{paddingBottom:0,paddingTop:0},colSpan:2,padding:"normal",align:"left",size:"small"},e.createElement(c,{in:l,timeout:"auto",unmountOnExit:!0},o))))};export{d as CollapseRow};
2
2
  //# sourceMappingURL=CollapseRow.esm.js.map
@@ -0,0 +1,2 @@
1
+ import{TableContainer as d,Paper as u,Table as f,TableBody as E,TableRow as r,TableCell as m,IconButton as g,Collapse as b,Box as C}from"@material-ui/core";import{makeStyles as T}from"@material-ui/core/styles";import w from"@material-ui/icons/KeyboardArrowDown";import v from"@material-ui/icons/KeyboardArrowUp";import{groupBy as y}from"lodash";import e,{useState as B,useMemo as R}from"react";import{findUniqueFacts as k}from"./findUniqueFacts.esm.js";import{ResolvedValueTable as x}from"./ResolvedValueTable.esm.js";const h=T(a=>({tableCell:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:200},selectedRow:{backgroundColor:a.palette.action.hover},factRow:{backgroundColor:a.palette.background.default},factCell:{paddingTop:a.spacing(1.5),paddingBottom:a.spacing(1.5),paddingLeft:`${a.spacing(2)}px !important`},dataCell:{"&::after":{display:"none"}}})),S=({ruleResult:a})=>{const o=h(),[n,c]=B({}),i=R(()=>y(k(a),"factRef"),[a]),p=t=>{c(l=>({...l,[t]:l[t]!==void 0?!l[t]:!1}))};return e.createElement(d,{component:u},e.createElement(f,null,e.createElement(E,null,Object.entries(i).map(([t,l],s)=>e.createElement(e.Fragment,{key:s},e.createElement(r,{className:o.factRow},e.createElement(m,{className:o.factCell},e.createElement(g,{size:"small",onClick:()=>p(t)},n[t]?e.createElement(v,null):e.createElement(w,null)),t)),e.createElement(r,null,e.createElement(m,{className:o.dataCell,style:{paddingBottom:0,paddingTop:0},colSpan:4},e.createElement(b,{in:n[t]===void 0||n[t],timeout:"auto",unmountOnExit:!0},e.createElement(C,{margin:1},e.createElement(x,{values:l}))))))))))};export{S as FactTable};
2
+ //# sourceMappingURL=FactTable.esm.js.map
@@ -0,0 +1,2 @@
1
+ import{MarkdownContent as o}from"@backstage/core-components";import{Divider as s,Typography as i}from"@material-ui/core";import{JustificationDetailsSchema as u}from"@spotify/backstage-plugin-soundcheck-common";import{DateTime as c}from"luxon";import e from"react";import{EntityChip as p}from"../EntityChip/EntityChip.esm.js";const f=({justification:m,type:n})=>{const r=u.safeParse(m);if(!r.success)return null;const a=r.data,l=c.fromISO(a.timestamp).toFormat("MM/dd/yyyy");let t;switch(n){case"exemption":t="Exemption Details:";break;case"manual":t="Manually Submitted Check Result Details:";break;default:t="Unknown Justification Type";break}return e.createElement("div",null,e.createElement(s,null),e.createElement(i,{variant:"h6"},t),e.createElement("br",null),e.createElement(i,null,e.createElement(p,{entityOrRef:a.submittedBy,style:{}}),"submitted ",n==="exemption"?"an exemption":"a manual result"," on ",l,"."),e.createElement("br",null),e.createElement(i,null,"Reasoning for the ",n==="exemption"?"exemption":"manual result"," ","was:"),e.createElement(o,{content:a.justification}))};export{f as JustificationDetails};
2
+ //# sourceMappingURL=JustificationDetails.esm.js.map
@@ -0,0 +1,2 @@
1
+ import{Table as d,TableHead as f,TableRow as m,TableCell as a,TableBody as E,Tooltip as r,IconButton as s}from"@material-ui/core";import{makeStyles as b}from"@material-ui/core/styles";import i from"@material-ui/icons/FileCopy";import h from"copy-to-clipboard";import e from"react";import{useSelectedValue as v}from"./SelectedValueContext.esm.js";const C=b(o=>({tableCell:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:200},selectedRow:{backgroundColor:o.palette.action.hover}})),V=({values:o})=>{const t=C(),{selectedValue:n}=v(),c=l=>{h(l)};return e.createElement(d,{size:"small",padding:"none"},e.createElement(f,null,e.createElement(m,null,e.createElement(a,{className:t.tableCell},"Path"),e.createElement(a,{className:t.tableCell},"Value"))),e.createElement(E,null,o.map((l,p)=>{const u=l.factRef===n.factRef&&l.path===n.path;return e.createElement(m,{key:p,className:u?t.selectedRow:""},e.createElement(a,{className:t.tableCell},l.path&&e.createElement(e.Fragment,null,e.createElement(r,{title:"Copy path to clipboard"},e.createElement(s,{onClick:()=>c(l.path)},e.createElement(i,{fontSize:"small"}))),e.createElement(r,{title:l.path},e.createElement("span",null,l.path)))),e.createElement(a,{className:t.tableCell},e.createElement(r,{title:"Copy value to clipboard"},e.createElement(s,{onClick:()=>c(typeof l.resolvedValue=="string"?l.resolvedValue:JSON.stringify(l.resolvedValue))},e.createElement(i,{fontSize:"small"}))),typeof l.resolvedValue=="string"?l.resolvedValue:JSON.stringify(l.resolvedValue)))})))};export{V as ResolvedValueTable};
2
+ //# sourceMappingURL=ResolvedValueTable.esm.js.map
@@ -1,2 +1,2 @@
1
- import{MarkdownContent as d}from"@backstage/core-components";import{useApi as g,configApiRef as f}from"@backstage/core-plugin-api";import{makeStyles as u,Paper as k,Typography as C,Box as h,Button as x}from"@material-ui/core";import t,{useState as E}from"react";import{ResultState as e}from"../../graphql/generated/index.esm.js";import{CheckIcon as R}from"../CheckIcon/CheckIcon.esm.js";import{FixMeDialog as b}from"./FixMeDialog.esm.js";const w=u(a=>({markdownContent:{"& :last-child":{marginBottom:0},"& pre":{background:`${a.palette.background.paper} !important`}},root:{padding:a.spacing(2),display:"flex",gap:a.spacing(1.5)},iconContainer:{marginTop:1},passed:{},failed:{},warning:{},notReported:{},notApplicable:{},error:{},icon:{}}),{name:"CheckResultStateBox"}),y={[e.Passed]:"Check passed",[e.Failed]:"Check did not pass",[e.Warning]:"Check produced warning(s)",[e.NotReported]:"Check not reported",[e.NotApplicable]:"Check not applicable",[e.Error]:"Check encountered an error."},N={[e.Passed]:"passed",[e.Failed]:"failed",[e.Warning]:"warning",[e.NotReported]:"notReported",[e.NotApplicable]:"notApplicable",[e.Error]:"error"},A=({name:a,state:n,notes:i,templateRef:l})=>{const o=w(),[c,r]=E(!1),p=g(f).getOptionalStringArray("soundcheck.flags")?.includes("enable-fix-me"),s=()=>{r(!0)},m=()=>{r(!1)};return t.createElement(k,{variant:"outlined",className:`${o.root} ${o[N[n]]}`},t.createElement("div",{className:o.iconContainer},t.createElement(R,{className:o.icon,result:n})),t.createElement("div",{style:{width:"100%"}},t.createElement(C,{variant:"subtitle1"},y[n]),i?t.createElement(d,{className:o.markdownContent,content:i}):null,p&&n===e.Failed&&l&&t.createElement(h,{display:"flex",flexDirection:"column",alignItems:"flex-end",mt:2,width:"100%"},t.createElement(x,{color:"primary",variant:"contained",onClick:s},"Fix"),t.createElement(b,{title:`Fix ${a}`,open:c,setOpen:r,onClose:m,templateRef:l}))))};export{A as ResultStateBox};
1
+ import{MarkdownContent as y}from"@backstage/core-components";import{useApi as B,configApiRef as F}from"@backstage/core-plugin-api";import{makeStyles as b,Paper as w,Typography as S,Divider as l,Box as g,Button as A}from"@material-ui/core";import{ToggleButtonGroup as D,ToggleButton as f}from"@material-ui/lab";import{NotesSchema as T}from"@spotify/backstage-plugin-soundcheck-common";import e,{useState as E}from"react";import{ResultState as t}from"../../graphql/generated/index.esm.js";import{CheckIcon as I}from"../CheckIcon/CheckIcon.esm.js";import{CheckResultDetails as P}from"./CheckResultDetails.esm.js";import{FixMeDialog as $}from"./FixMeDialog.esm.js";import{JustificationDetails as x}from"./JustificationDetails.esm.js";import{SelectedValueProvider as j}from"./SelectedValueContext.esm.js";const G=b(o=>({markdownContent:{"& :last-child":{marginBottom:0},"& pre":{background:`${o.palette.background.paper} !important`},"& :first-child":{marginTop:0}},root:{padding:o.spacing(2),display:"flex",flexDirection:"column",gap:o.spacing(1.5)},header:{display:"flex",alignItems:"center",justifyContent:"space-between"},iconContainer:{display:"flex",alignItems:"center"},toggleButtonGroup:{marginLeft:"auto"},toggleButton:{padding:o.spacing(.5),fontSize:o.typography.pxToRem(12)},passed:{},failed:{},warning:{},notReported:{},notApplicable:{},exempt:{},error:{},icon:{marginRight:o.spacing(.5)},divider:{marginTop:o.spacing(.5)}}),{name:"CheckResultStateBox"}),J={[t.Passed]:"Check passed",[t.Failed]:"Check did not pass",[t.Warning]:"Check produced warning(s)",[t.NotReported]:"Check not reported",[t.NotApplicable]:"Check not applicable",[t.Exempt]:"Exempt from check",[t.Error]:"Check encountered an error."},M={[t.Passed]:"passed",[t.Failed]:"failed",[t.Warning]:"warning",[t.NotReported]:"notReported",[t.NotApplicable]:"notApplicable",[t.Exempt]:"exempt",[t.Error]:"error"},O=({name:o,state:r,details:n,templateRef:c})=>{const a=G(),[h,i]=E(!1),[m,v]=E("notes"),k=B(F).getOptionalStringArray("soundcheck.flags")?.includes("enable-fix-me"),s=n&&n.ruleResult,C=()=>{i(!0)},N=()=>{i(!1)},R=(V,u)=>{u!==null&&v(u)},p=n?.notes?T.safeParse(n.notes):void 0,d=p?.success?p.data.data:void 0;return e.createElement(w,{variant:"outlined",className:`${a.root} ${a[M[r]]}`},e.createElement("div",{className:a.header},e.createElement("div",{className:a.iconContainer},e.createElement(I,{className:a.icon,result:r}),e.createElement(S,{variant:"subtitle1"},J[r])),s&&e.createElement(D,{value:m,exclusive:!0,onChange:R,className:a.toggleButtonGroup},e.createElement(f,{value:"notes",className:a.toggleButton},"Notes"),e.createElement(f,{value:"details",className:a.toggleButton},"Details"))),m==="notes"&&e.createElement(e.Fragment,null,n&&n.exemption&&e.createElement(e.Fragment,null,e.createElement(l,{className:a.divider}),e.createElement(x,{justification:n.exemption,type:"exemption"})),n&&n.manualResult&&e.createElement(e.Fragment,null,e.createElement(l,{className:a.divider}),e.createElement(x,{justification:n.manualResult,type:"manual"})),d&&e.createElement(g,{style:{maxHeight:"35vh",overflowY:"auto"}},e.createElement(l,{className:a.divider}),e.createElement(y,{className:a.markdownContent,content:d})),k&&r===t.Failed&&c&&e.createElement(g,{display:"flex",flexDirection:"column",alignItems:"flex-end",mt:2,width:"100%"},e.createElement(A,{color:"primary",variant:"contained",onClick:C},"Fix"),e.createElement($,{title:`Fix ${o}`,open:h,setOpen:i,onClose:N,templateRef:c}))),m==="details"&&e.createElement(e.Fragment,null,s&&e.createElement(e.Fragment,null,e.createElement(l,{className:a.divider}),e.createElement(j,null,e.createElement(P,{ruleResult:n.ruleResult})))))};export{O as ResultStateBox};
2
2
  //# sourceMappingURL=ResultStateBox.esm.js.map
@@ -0,0 +1,2 @@
1
+ import u,{createContext as o,useState as c,useContext as n}from"react";const t=o(void 0),a=({children:e})=>{const[r,l]=c({factRef:null,path:null});return u.createElement(t.Provider,{value:{selectedValue:r,setSelectedValue:l}},e)},d=()=>{const e=n(t);if(!e)throw new Error("useSelectedValue must be used within a SelectedProvider");return e};export{a as SelectedValueProvider,d as useSelectedValue};
2
+ //# sourceMappingURL=SelectedValueContext.esm.js.map
@@ -0,0 +1,2 @@
1
+ import{stringifyFactRef as i}from"@spotify/backstage-plugin-soundcheck-common";function l(e){const c=new Set,u=[];function r(n){if(s(n)){let{factRef:a,path:f}=n,t=`${a}-${f??""}`;c.has(t)||(c.add(t),u.push({factRef:i(a),path:f,resolvedValue:n.resolvedFactValue}));const o=n.value;typeof o=="object"&&"factRef"in o&&(a=i(o.factRef),f=o.path,t=`${a}-${f??""}`,c.has(t)||(c.add(t),u.push({factRef:a,path:f,resolvedValue:o.resolvedValue})))}else d(n)?n.all.forEach(r):h(n)?n.any.forEach(r):p(n)&&n.not.forEach(r)}return r(e),u}function s(e){return"factRef"in e&&"resolvedFactValue"in e}function d(e){return"all"in e}function h(e){return"any"in e}function p(e){return"not"in e}export{l as findUniqueFacts};
2
+ //# sourceMappingURL=findUniqueFacts.esm.js.map
@@ -1,2 +1,2 @@
1
- import{makeStyles as y,IconButton as E,CircularProgress as C}from"@material-ui/core";import b from"@material-ui/icons/Refresh";import e,{useState as a,useCallback as g}from"react";import{useExecuteCheck as z}from"../../hooks/checks/useExecuteCheck.esm.js";import{CheckIcon as S}from"../CheckIcon/CheckIcon.esm.js";import{StyledTooltip as x}from"../StyledTooltip/StyledTooltip.esm.js";import"../SoundcheckDialog/SoundcheckDialog.esm.js";import{CheckDryRunDialogButton as B}from"./CheckDryRunDialogButton.esm.js";import"./CheckDryRunDetails.esm.js";import"./CheckDryRunContext.esm.js";import"../CheckForm/utils/checkFormUtils.esm.js";const D=y(()=>({root:{display:"flex",alignItems:"center"},buttonWrapper:{height:24}})),I=({entityRef:l,check:s})=>{const{mutateAsync:n}=z(),[r,u]=a(),[o,p]=a(null),[c,i]=a(!1),[f,h]=a(),[k,d]=a(),m=D(),R=g(async()=>{if(c)return;i(!0);const t=await n({entityRef:l,checker:s,dryRun:!0,shouldRefreshFacts:!0}).catch($=>{});t?.details?.notes?.data&&p(t.details.notes.data),t?.facts&&h(t.facts),t?.ruleResults&&d(t.ruleResults),u(t?.result),i(!1)},[s,l,n,c]);return e.createElement("div",{className:m.root},r&&e.createElement(x,{arrow:!0,title:`${r}${o?`: ${o}`:""}`,placement:"left"},e.createElement("span",{className:m.buttonWrapper,"aria-label":"check result"},e.createElement(S,{result:r}))),e.createElement(E,{size:"small",color:"inherit",onClick:R,disabled:c,"aria-label":"refresh"},c?e.createElement(C,{size:16}):e.createElement(b,{fontSize:"small"})),r&&e.createElement(B,{entityRef:l,check:s,checkResult:{checkResult:r,notes:o},facts:f,ruleResults:k}))};export{I as CheckDryRun};
1
+ import{makeStyles as b,Tooltip as h,Box as o,IconButton as C,CircularProgress as $}from"@material-ui/core";import x from"@material-ui/icons/Refresh";import e,{useState as l,useCallback as D}from"react";import{useExecuteCheck as w}from"../../hooks/checks/useExecuteCheck.esm.js";import{CheckIcon as z}from"../CheckIcon/CheckIcon.esm.js";import"../SoundcheckDialog/SoundcheckDialog.esm.js";import{CheckDryRunDialogButton as B}from"./CheckDryRunDialogButton.esm.js";import"./CheckDryRunDetails.esm.js";import"./CheckDryRunContext.esm.js";import"../CheckForm/utils/checkFormUtils.esm.js";const F=b(()=>({root:{display:"flex",alignItems:"center"},buttonWrapper:{height:24}})),I=({entityRef:n,check:s,refreshFact:c=!1})=>{const{mutateAsync:m}=w(),[r,p]=l(),[i,d]=l(null),[a,u]=l(!1),[k,E]=l(),[y,R]=l(),f=F(),g=D(async()=>{if(a)return;u(!0);const t=await m({entityRef:n,checker:s,dryRun:!0,shouldRefreshFacts:c}).catch(S=>{});t?.details&&d(t.details),t?.facts&&E(t.facts),t?.ruleResults&&R(t.ruleResults),p(t?.result),u(!1)},[s,n,m,a,c]);return e.createElement("div",{className:f.root},r&&e.createElement(h,{arrow:!0,title:`${r}${i?`: ${i}`:""}`,placement:"left"},e.createElement("span",{className:f.buttonWrapper,"aria-label":"check result"},e.createElement(z,{result:r}))),e.createElement(h,{arrow:!0,placement:"top",title:e.createElement(o,null,a?e.createElement(e.Fragment,null,e.createElement(o,null,"Executing dry run..."),e.createElement(o,null,c?"Refreshing facts for dry run can take a significant amount of time.":"Dry run can take additional time if facts are not cached.")):`Dry runs will ${c?"refresh facts":"use cached facts if available"}.`)},e.createElement("span",null,e.createElement(C,{size:"small",color:"inherit",onClick:g,disabled:a,"aria-label":"refresh"},a?e.createElement($,{size:16}):e.createElement(x,{fontSize:"small"})))),r&&e.createElement(B,{entityRef:n,check:s,checkResult:{checkResult:r,details:i},facts:k,ruleResults:y}))};export{I as CheckDryRun};
2
2
  //# sourceMappingURL=CheckDryRun.esm.js.map
@@ -1,2 +1,2 @@
1
- import p,{createContext as C,useState as t,useCallback as y}from"react";import"./CheckDryRun.esm.js";import{CheckDryRunDialog as D}from"./CheckDryRunDialog.esm.js";import"@material-ui/core";import"./CheckDryRunDetails.esm.js";import"../CheckForm/utils/checkFormUtils.esm.js";const n=C({updateEntityRef:()=>{},updateCheck:()=>{},updateOpen:()=>{},updateResult:()=>{},setValues:()=>{},updateFacts:()=>{},updateRuleResults:()=>{},open:!1}),E=({children:o})=>{const[R,u]=t(!1),[i,s]=t(""),[d,a]=t(),[h,c]=t(),[k,l]=t(),[f,r]=t(),m=y(e=>{u(!0),e.entityRef&&s(e.entityRef),e.check&&a(e.check),e.checkResult&&c(e.checkResult),e.facts&&l(e.facts),e.ruleResults&&r(e.ruleResults)},[]);return p.createElement(n.Provider,{value:{entityRef:i,updateEntityRef:s,check:d,updateCheck:a,open:R,updateOpen:u,result:h,updateResult:c,setValues:m,facts:k,updateFacts:l,ruleResults:f,updateRuleResults:r}},p.createElement(D,null),o)};export{n as CheckDryRunContext,E as CheckDryRunProvider};
1
+ import p,{createContext as C,useState as t,useCallback as y}from"react";import"./CheckDryRun.esm.js";import{CheckDryRunDialog as D}from"./CheckDryRunDialog.esm.js";import"@material-ui/core";import"./CheckDryRunDetails.esm.js";import"../CheckForm/utils/checkFormUtils.esm.js";const n=C({updateEntityRef:()=>{},updateCheck:()=>{},updateOpen:()=>{},updateResult:()=>{},setValues:()=>{},updateFacts:()=>{},updateRuleResults:()=>{},open:!1}),E=({children:o})=>{const[R,u]=t(!1),[d,s]=t(""),[i,a]=t(),[h,c]=t(),[k,l]=t(),[f,r]=t(),m=y(e=>{u(!0),e.entityRef&&s(e.entityRef),e.check&&a(e.check),e.checkResult&&c(e.checkResult),e.facts&&l(e.facts),e.ruleResults&&r(e.ruleResults)},[]);return p.createElement(n.Provider,{value:{entityRef:d,updateEntityRef:s,check:i,updateCheck:a,open:R,updateOpen:u,result:h,updateResult:c,setValues:m,facts:k,updateFacts:l,ruleResults:f,updateRuleResults:r}},p.createElement(D,null),o)};export{n as CheckDryRunContext,E as CheckDryRunProvider};
2
2
  //# sourceMappingURL=CheckDryRunContext.esm.js.map
@@ -1,2 +1,2 @@
1
- import{EntityRefLink as b}from"@backstage/plugin-catalog-react";import{makeStyles as S,Box as c,Typography as a,Divider as f,Grid as l}from"@material-ui/core";import{parseFactRef as N,getRuleHash as k}from"@spotify/backstage-plugin-soundcheck-common";import e from"react";import{ResultState as R}from"../../graphql/generated/index.esm.js";import{ResultStateBox as B}from"../CheckDetails/ResultStateBox.esm.js";import{ExpressionTypeReadableMap as F,ExpressionType as T}from"../CheckForm/types/ExpressionType.esm.js";import"../Frequency/types.esm.js";import"../Frequency/util.esm.js";import"../Frequency/FrequencyComponent.esm.js";import"../CheckForm/types/Path.esm.js";import{mapRuleToExpression as P}from"../CheckForm/utils/checkFormUtils.esm.js";import{CheckIcon as w}from"../CheckIcon/CheckIcon.esm.js";import{ExpandableSection as z}from"../ExpandableSection/ExpandableSection.esm.js";import{FormattedPreview as x}from"../FormattedPreview/FormattedPreview.esm.js";const v=S(t=>({dryRunRoot:{padding:t.spacing(2)},dryRunSection:{marginBottom:t.spacing(2)},rulesSection:{padding:t.spacing(2),margin:0,width:"100%"},resultBox:{fontSize:t.typography.body1.fontSize},factBox:{padding:0,border:`1px solid ${t.palette.divider}`,overflow:"auto",fontSize:t.typography.body2.fontSize,maxHeight:500},nested:{margin:t.spacing(3)},expressionType:{padding:t.spacing(1,2)},expressionWrapper:{border:`1px solid ${t.palette.divider}`,marginBottom:t.spacing(2)},resultDisplay:{display:"flex",alignItems:"center"},resultIcon:{marginRight:t.spacing(.25)},ownerLink:{"& span":{"&:hover":{textDecoration:"underline"}},fontSize:t.typography.body1.fontSize},valueBox:{maxHeight:500,overflow:"auto"}})),D=({passed:t})=>{const n=v();return e.createElement(a,{variant:"body1",className:n.resultDisplay},e.createElement(w,{className:n.resultIcon,result:t?R.Passed:R.Failed})," ",t?"Passed":"Failed")},g=({check:t,expression:n,facts:i,ruleResults:m})=>{const o=v();return e.createElement(e.Fragment,null,e.createElement(c,{className:o.expressionWrapper},e.createElement(a,{className:o.expressionType,variant:"subtitle1"},F[n.expressionType??T.AllOf]),n.conditions?.map((r,s)=>{const p=r.operatorPrefix?`${r.operatorPrefix}:${r.operator}`:r.operator,d=N(r.factRef),y=i?.find(E=>E.factRef===r.factRef),h=k({factRef:d,value:r.value,operator:p,path:r.path}),u=m?.find(E=>E.name===h);return e.createElement("div",{key:`expression-${s}`},e.createElement(f,{variant:"middle"}),e.createElement(l,{container:!0,className:o.rulesSection,spacing:2},e.createElement(l,{item:!0,xs:6},e.createElement(a,{variant:"subtitle2",color:"textSecondary"},"Integration"),e.createElement(a,{variant:"body1"},d.source)),e.createElement(l,{item:!0,xs:6},e.createElement(a,{variant:"subtitle2",color:"textSecondary"},"Fact"),e.createElement(a,{variant:"body1"},d.name)),t?.pathResolver&&e.createElement(l,{item:!0,xs:6},e.createElement(a,{variant:"subtitle2",color:"textSecondary"},"Path Resolver"),e.createElement(a,{variant:"body1"},t.pathResolver)),e.createElement(l,{item:!0,xs:6},e.createElement(a,{variant:"subtitle2",color:"textSecondary"},"Path"),e.createElement(a,{variant:"body1"},r.path)),e.createElement(l,{item:!0,xs:6},e.createElement(a,{variant:"subtitle2",color:"textSecondary"},"Operator"),e.createElement(a,{variant:"body1"},p)),u?.result!==void 0&&e.createElement(l,{item:!0,xs:6},e.createElement(a,{variant:"subtitle2",color:"textSecondary"},"Result"),e.createElement(D,{passed:u.result})),e.createElement(l,{item:!0,xs:12},e.createElement(a,{variant:"subtitle2",color:"textSecondary"},"Expected"),e.createElement(a,{component:"div",variant:"body2",className:o.valueBox},e.createElement(x,{data:r?.value}))),e.createElement(l,{item:!0,xs:12},e.createElement(a,{variant:"subtitle2",color:"textSecondary"},"Resolved Value"),e.createElement(a,{component:"div",variant:"body2",className:o.valueBox},e.createElement(x,{data:u?.factResult}))),!!y&&e.createElement(l,{item:!0,xs:12},e.createElement(z,{elevation:0,title:"Related Fact"},e.createElement("div",{className:o.factBox},e.createElement(x,{data:y.data}))))))}),!!n?.expressions&&e.createElement(e.Fragment,null,e.createElement(f,{variant:"middle"}),e.createElement(c,{className:o.nested},n?.expressions?.map((r,s)=>e.createElement(g,{check:t,facts:i,ruleResults:m,expression:r,key:`nested-expression-${s}`}))))))},I=({entityRef:t,check:n,checkResult:i,notes:m,facts:o,ruleResults:r})=>{const s=v(),p=P(n?.rule);return e.createElement(c,{className:s.dryRunRoot},e.createElement(c,{className:s.dryRunSection},t&&e.createElement(e.Fragment,null,e.createElement(a,{variant:"h5"},"Entity"),e.createElement(a,{variant:"body1"},e.createElement(b,{className:s.ownerLink,entityRef:t})))),e.createElement(c,{className:s.dryRunSection},e.createElement(a,{variant:"h5"},"Check Result"),e.createElement("div",{className:s.resultBox},i?e.createElement(B,{name:n?.name??"",state:i,notes:m}):"No Results")),e.createElement(a,{variant:"h5"},"Rules"),e.createElement(g,{check:n,facts:o,ruleResults:r,expression:p}))};export{I as CheckDryRunDetails};
1
+ import{EntityRefLink as b}from"@backstage/plugin-catalog-react";import{makeStyles as S,Box as c,Typography as a,Divider as f,Grid as o}from"@material-ui/core";import{parseFactRef as N,getRuleHash as k}from"@spotify/backstage-plugin-soundcheck-common";import e from"react";import{ResultState as R}from"../../graphql/generated/index.esm.js";import{ResultStateBox as B}from"../CheckDetails/ResultStateBox.esm.js";import{ExpressionTypeReadableMap as F,ExpressionType as T}from"../CheckForm/types/ExpressionType.esm.js";import"../Frequency/types.esm.js";import"../Frequency/util.esm.js";import"../Frequency/FrequencyComponent.esm.js";import"../CheckForm/types/Path.esm.js";import{mapRuleToExpression as P}from"../CheckForm/utils/checkFormUtils.esm.js";import{CheckIcon as w}from"../CheckIcon/CheckIcon.esm.js";import{ExpandableSection as z}from"../ExpandableSection/ExpandableSection.esm.js";import{FormattedPreview as x}from"../FormattedPreview/FormattedPreview.esm.js";const v=S(t=>({dryRunRoot:{padding:t.spacing(2)},dryRunSection:{marginBottom:t.spacing(2)},rulesSection:{padding:t.spacing(2),margin:0,width:"100%"},resultBox:{fontSize:t.typography.body1.fontSize},factBox:{padding:0,border:`1px solid ${t.palette.divider}`,overflow:"auto",fontSize:t.typography.body2.fontSize,maxHeight:500},nested:{margin:t.spacing(3)},expressionType:{padding:t.spacing(1,2)},expressionWrapper:{border:`1px solid ${t.palette.divider}`,marginBottom:t.spacing(2)},resultDisplay:{display:"flex",alignItems:"center"},resultIcon:{marginRight:t.spacing(.25)},ownerLink:{"& span":{"&:hover":{textDecoration:"underline"}},fontSize:t.typography.body1.fontSize},valueBox:{maxHeight:500,overflow:"auto"}})),D=({passed:t})=>{const n=v();return e.createElement(a,{variant:"body1",className:n.resultDisplay},e.createElement(w,{className:n.resultIcon,result:t?R.Passed:R.Failed})," ",t?"Passed":"Failed")},g=({check:t,expression:n,facts:s,ruleResults:m})=>{const l=v();return e.createElement(e.Fragment,null,e.createElement(c,{className:l.expressionWrapper},e.createElement(a,{className:l.expressionType,variant:"subtitle1"},F[n.expressionType??T.AllOf]),n.conditions?.map((r,i)=>{const p=r.operatorPrefix?`${r.operatorPrefix}:${r.operator}`:r.operator,d=N(r.factRef),y=s?.find(E=>E.factRef===r.factRef),h=k({factRef:d,value:r.value,operator:p,path:r.path}),u=m?.find(E=>E.name===h);return e.createElement("div",{key:`expression-${i}`},e.createElement(f,{variant:"middle"}),e.createElement(o,{container:!0,className:l.rulesSection,spacing:2},e.createElement(o,{item:!0,xs:6},e.createElement(a,{variant:"subtitle2",color:"textSecondary"},"Integration"),e.createElement(a,{variant:"body1"},d.source)),e.createElement(o,{item:!0,xs:6},e.createElement(a,{variant:"subtitle2",color:"textSecondary"},"Fact"),e.createElement(a,{variant:"body1"},d.name)),t?.pathResolver&&e.createElement(o,{item:!0,xs:6},e.createElement(a,{variant:"subtitle2",color:"textSecondary"},"Path Resolver"),e.createElement(a,{variant:"body1"},t.pathResolver)),e.createElement(o,{item:!0,xs:6},e.createElement(a,{variant:"subtitle2",color:"textSecondary"},"Path"),e.createElement(a,{variant:"body1"},r.path)),e.createElement(o,{item:!0,xs:6},e.createElement(a,{variant:"subtitle2",color:"textSecondary"},"Operator"),e.createElement(a,{variant:"body1"},p)),u?.result!==void 0&&e.createElement(o,{item:!0,xs:6},e.createElement(a,{variant:"subtitle2",color:"textSecondary"},"Result"),e.createElement(D,{passed:u.result})),e.createElement(o,{item:!0,xs:12},e.createElement(a,{variant:"subtitle2",color:"textSecondary"},"Expected"),e.createElement(a,{component:"div",variant:"body2",className:l.valueBox},e.createElement(x,{data:r?.value}))),e.createElement(o,{item:!0,xs:12},e.createElement(a,{variant:"subtitle2",color:"textSecondary"},"Resolved Value"),e.createElement(a,{component:"div",variant:"body2",className:l.valueBox},e.createElement(x,{data:u?.factResult}))),!!y&&e.createElement(o,{item:!0,xs:12},e.createElement(z,{elevation:0,title:"Related Fact"},e.createElement("div",{className:l.factBox},e.createElement(x,{data:y.data}))))))}),!!n?.expressions&&e.createElement(e.Fragment,null,e.createElement(f,{variant:"middle"}),e.createElement(c,{className:l.nested},n?.expressions?.map((r,i)=>e.createElement(g,{check:t,facts:s,ruleResults:m,expression:r,key:`nested-expression-${i}`}))))))},I=({entityRef:t,check:n,checkResult:s,details:m,facts:l,ruleResults:r})=>{const i=v(),p=P(n?.rule);return e.createElement(c,{className:i.dryRunRoot},e.createElement(c,{className:i.dryRunSection},t&&e.createElement(e.Fragment,null,e.createElement(a,{variant:"h5"},"Entity"),e.createElement(a,{variant:"body1"},e.createElement(b,{className:i.ownerLink,entityRef:t})))),e.createElement(c,{className:i.dryRunSection},e.createElement(a,{variant:"h5"},"Check Result"),e.createElement("div",{className:i.resultBox},s?e.createElement(B,{name:n?.name??"",state:s,details:m}):"No Results")),e.createElement(a,{variant:"h5"},"Rules"),e.createElement(g,{check:n,facts:l,ruleResults:r,expression:p}))};export{I as CheckDryRunDetails};
2
2
  //# sourceMappingURL=CheckDryRunDetails.esm.js.map
@@ -1,2 +1,2 @@
1
- import o,{useContext as u}from"react";import{SoundcheckDialog as m}from"../SoundcheckDialog/SoundcheckDialog.esm.js";import"./CheckDryRun.esm.js";import"@material-ui/core";import{CheckDryRunDetails as i}from"./CheckDryRunDetails.esm.js";import{CheckDryRunContext as p}from"./CheckDryRunContext.esm.js";import"../CheckForm/utils/checkFormUtils.esm.js";const R=()=>{const{entityRef:r,open:c,updateOpen:n,check:e,result:t,facts:l,ruleResults:s}=u(p);return o.createElement(m,{handleClose:()=>n(!1),title:`${e?.name??"Check"} Run Results`,open:c,fullScreen:!1},o.createElement(i,{entityRef:r,check:e,checkResult:t?.checkResult,notes:t?.notes,facts:l,ruleResults:s}))};export{R as CheckDryRunDialog};
1
+ import o,{useContext as u}from"react";import{SoundcheckDialog as i}from"../SoundcheckDialog/SoundcheckDialog.esm.js";import"./CheckDryRun.esm.js";import"@material-ui/core";import{CheckDryRunDetails as m}from"./CheckDryRunDetails.esm.js";import{CheckDryRunContext as a}from"./CheckDryRunContext.esm.js";import"../CheckForm/utils/checkFormUtils.esm.js";const p=()=>{const{entityRef:r,open:c,updateOpen:n,check:e,result:t,facts:l,ruleResults:s}=u(a);return o.createElement(i,{handleClose:()=>n(!1),title:`${e?.name??"Check"} Run Results`,open:c,fullScreen:!1},o.createElement(m,{entityRef:r,check:e,checkResult:t?.checkResult,details:t?.details,facts:l,ruleResults:s}))};export{p as CheckDryRunDialog};
2
2
  //# sourceMappingURL=CheckDryRunDialog.esm.js.map
@@ -1,2 +1,2 @@
1
- import{Content as s}from"@backstage/core-components";import t from"react";import{FormProvider as d}from"react-hook-form";import"../../contexts/TrackFormContext.esm.js";import{useCheckFormContext as f}from"../../contexts/CheckFormContext.esm.js";import"../../contexts/CampaignFormContext.esm.js";import"../../contexts/UserProvider.esm.js";import{formStyles as h}from"../../utils/formStyles.esm.js";import"@material-ui/core";import"@material-ui/icons/Search";import"../SoundcheckDialog/SoundcheckDialog.esm.js";import"../FactExplorer/FactExplorer.esm.js";import{FactExplorerProvider as S}from"../FactExplorer/FactExplorerContext.esm.js";import{FormFilterSection as u}from"../FormFilterSection/FormFilterSection.esm.js";import{FormStepper as C}from"../FormStepper/FormStepper.esm.js";import"./FormFields/CheckNameInput/CheckNameInput.esm.js";import"./FormFields/PassFailMessageInput/PassFailMessageInput.esm.js";import"../FormMarkdownInput/FormMarkdownInput.esm.js";import{CHECK_FIELDS as E}from"./utils/checkFormUtils.esm.js";import"./FormFields/TeamDetailsInput/TeamDetailsInput.esm.js";import"./FormFields/RuleInput/AddMenuButton.esm.js";import"./FormFields/RuleInput/RuleInputBox.esm.js";import"./FormFields/RuleInput/Expressions/ExpressionBox.esm.js";import"./FormFields/RuleInput/Expressions/ExpressionTypeToggle.esm.js";import"@material-ui/icons/Close";import"@material-ui/icons/Delete";import"@material-ui/icons/List";import"@spotify/backstage-plugin-soundcheck-common";import"@backstage/core-plugin-api";import"@tanstack/react-query";import"../../api.esm.js";import"../FormControlledAutocomplete/FormControlledAutocomplete.esm.js";import"./FormFields/RuleInput/Conditions/styles.esm.js";import"@backstage/catalog-model";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"./FormFields/RuleInput/Conditions/ValueListInput.esm.js";import"./FormFields/RuleInput/Conditions/ConditionList.esm.js";import{ScheduleSection as b}from"./FormFields/CheckScheduleSection/ScheduleSection.esm.js";import"./FormFields/CheckPathResolverInput.esm.js";import{CheckDetailsStep as k}from"./Steps/CheckDetailsStep.esm.js";import{CheckRulesStep as F}from"./Steps/CheckRulesStep.esm.js";import{CheckReviewStep as g}from"./Steps/CheckReviewStep.esm.js";import"./types/ExpressionType.esm.js";import{CheckStepNameMapping as v}from"./types/CheckFormTypes.esm.js";import"../Frequency/types.esm.js";import"../Frequency/util.esm.js";import"../Frequency/FrequencyComponent.esm.js";import"./types/Path.esm.js";import{useCheckForm as y}from"./useCheckForm.esm.js";const O=({onSave:p,onClose:r})=>{const{isLoading:n,isReadOnly:o,selectedItem:l}=f(),{formMethods:e,onSubmit:m}=y(p),a=h(),i=[{label:"Enter check details",content:()=>t.createElement(k,null)},{label:"Add rules",content:()=>t.createElement(F,null)},{label:"Choose the affected entities (Optional)",content:()=>t.createElement(u,{name:"filtersStep.filter",control:e.control,disabled:o,description:E.filter.description})},{label:"Set the check schedule (Optional)",content:()=>t.createElement(b,{control:e.control,disabled:o})},{label:"Review and test (Optional)",content:()=>t.createElement(g,null)}],c=l?[...Array(i.length).keys()]:[0];return t.createElement(s,{className:a.formWrapper},t.createElement(d,{...e},t.createElement(S,null,t.createElement("form",{onSubmit:e.handleSubmit(m)},t.createElement(C,{onClose:()=>r?r():void 0,handleSubmit:e.handleSubmit,trigger:e.trigger,onSubmit:m,initialVisited:c,stepNameMap:v,steps:i,isLoading:n,isReadOnly:o,saveButtonText:"Save Check"})))))};export{O as CheckForm};
1
+ import{Content as s}from"@backstage/core-components";import e from"react";import{FormProvider as d}from"react-hook-form";import"../../contexts/TrackFormContext.esm.js";import{useCheckFormContext as f}from"../../contexts/CheckFormContext.esm.js";import"../../contexts/CampaignFormContext.esm.js";import"../../contexts/UserProvider.esm.js";import{formStyles as u}from"../../utils/formStyles.esm.js";import"@material-ui/core";import"@material-ui/icons/Search";import"../SoundcheckDialog/SoundcheckDialog.esm.js";import"../FactExplorer/FactExplorer.esm.js";import{FactExplorerProvider as S}from"../FactExplorer/FactExplorerContext.esm.js";import{FormFilterSection as h}from"../FormFilterSection/FormFilterSection.esm.js";import{FormStepper as C}from"../FormStepper/FormStepper.esm.js";import"./FormFields/CheckNameInput/CheckNameInput.esm.js";import"./FormFields/PassFailMessageInput/PassFailMessageInput.esm.js";import"../FormMarkdownInput/FormMarkdownInput.esm.js";import{CHECK_FIELDS as F}from"./utils/checkFormUtils.esm.js";import"./FormFields/TeamDetailsInput/TeamDetailsInput.esm.js";import"./FormFields/RuleInput/AddMenuButton.esm.js";import"./FormFields/RuleInput/RuleInputBox.esm.js";import"./FormFields/RuleInput/Expressions/ExpressionBox.esm.js";import"./FormFields/RuleInput/Expressions/ExpressionTypeToggle.esm.js";import"@material-ui/icons/Close";import"@material-ui/icons/Delete";import"@material-ui/icons/List";import"@spotify/backstage-plugin-soundcheck-common";import"@backstage/core-plugin-api";import"@tanstack/react-query";import"../../api.esm.js";import"../FormControlledAutocomplete/FormControlledAutocomplete.esm.js";import"./FormFields/RuleInput/Conditions/styles.esm.js";import"@backstage/catalog-model";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"./FormFields/RuleInput/Conditions/ValueListInput.esm.js";import"./FormFields/RuleInput/Conditions/ConditionList.esm.js";import{ScheduleSection as E}from"./FormFields/CheckScheduleSection/ScheduleSection.esm.js";import"./FormFields/CheckPathResolverInput.esm.js";import{CheckDetailsStep as b}from"./Steps/CheckDetailsStep.esm.js";import{CheckRulesStep as k}from"./Steps/CheckRulesStep.esm.js";import{CheckReviewStep as y}from"./Steps/CheckReviewStep.esm.js";import"./types/ExpressionType.esm.js";import{CheckStepNameMapping as g}from"./types/CheckFormTypes.esm.js";import"../Frequency/types.esm.js";import"../Frequency/util.esm.js";import"../Frequency/FrequencyComponent.esm.js";import"./types/Path.esm.js";import{useCheckForm as v}from"./useCheckForm.esm.js";const x=({onSave:p,onClose:o})=>{const{isLoading:l,isReadOnly:r,selectedItem:n}=f(),{formMethods:t,onSubmit:i}=v(p),a=u(),m=[{label:"Enter check details",content:()=>e.createElement(b,null)},{label:"Add rules",content:()=>e.createElement(k,null)},{label:"Choose the affected entities (Optional)",content:()=>e.createElement(h,{name:"filtersStep.filter",keyValueFilterName:"filtersStep.keyValueFilter",disabled:r,description:F.filter.description,excludeFilterName:"filtersStep.excludeFilter",excludeKeyValueFilterName:"filtersStep.excludeKeyValueFilter"})},{label:"Set the check schedule (Optional)",content:()=>e.createElement(E,{control:t.control,disabled:r})},{label:"Review and test (Optional)",content:()=>e.createElement(y,null)}],c=n?[...Array(m.length).keys()]:[0];return e.createElement(s,{className:a.formWrapper},e.createElement(d,{...t},e.createElement(S,null,e.createElement("form",{onSubmit:t.handleSubmit(i)},e.createElement(C,{onClose:()=>o?o():void 0,handleSubmit:t.handleSubmit,trigger:t.trigger,onSubmit:i,initialVisited:c,stepNameMap:g,steps:m,isLoading:l,isReadOnly:r,saveButtonText:"Save Check"})))))};export{x as CheckForm};
2
2
  //# sourceMappingURL=CheckForm.esm.js.map
@@ -1,2 +1,2 @@
1
- import{makeStyles as p}from"@material-ui/core";import t,{useMemo as n}from"react";import{useGetPathResolvers as m}from"../../../hooks/useGetPathResolvers.esm.js";import{FormControlledAutocomplete as i}from"../../FormControlledAutocomplete/FormControlledAutocomplete.esm.js";import"@material-ui/lab";import"../../ListboxVirtualized/ListboxVirtualized.esm.js";import{FormFieldLabel as c}from"../../FormFieldLabel/FormFieldLabel.esm.js";const d=p(o=>({wrapper:{marginBottom:o.spacing(2)}})),h=({control:o})=>{const a=d(),{data:r,isLoading:l}=m(),s=n(()=>r?.map(e=>e.id),[r]);return t.createElement("div",{className:a.wrapper},t.createElement(c,{title:"Path resolver (Optional)",docLink:"https://backstage.spotify.com/docs/plugins/soundcheck/core-concepts/checks#path-resolvers"}),t.createElement("div",null,t.createElement(i,{control:o,name:"rulesStep.pathResolver",disabled:l,options:s??[],freeSolo:!1,disableClearable:!0,width:250,getOptionLabel:e=>e==="jsonpath"?"jsonpath (default)":e,getOptionValue:e=>e&&e==="jsonpath (default)"?"jsonpath":e??"",placeholder:"path resolver"})))};export{h as CheckPathResolverInput};
1
+ import{makeStyles as s}from"@material-ui/core";import t,{useMemo as m}from"react";import{useGetPathResolvers as i}from"../../../hooks/useGetPathResolvers.esm.js";import{FormControlledAutocomplete as n}from"../../FormControlledAutocomplete/FormControlledAutocomplete.esm.js";import"@material-ui/icons/CheckBox";import"@material-ui/icons/CheckBoxOutlineBlank";import"@material-ui/lab";import"react-hook-form";import"../../ListboxVirtualized/ListboxVirtualized.esm.js";import{FormFieldLabel as c}from"../../FormFieldLabel/FormFieldLabel.esm.js";const d=s(o=>({wrapper:{marginBottom:o.spacing(2)}})),h=({control:o})=>{const a=d(),{data:r,isLoading:l}=i(),p=m(()=>r?.map(e=>e.id),[r]);return t.createElement("div",{className:a.wrapper},t.createElement(c,{title:"Path resolver (Optional)",docLink:"https://backstage.spotify.com/docs/plugins/soundcheck/core-concepts/checks#path-resolvers"}),t.createElement("div",null,t.createElement(n,{control:o,name:"rulesStep.pathResolver",disabled:l,options:p??[],freeSolo:!1,disableClearable:!0,width:250,getOptionLabel:e=>e==="jsonpath"?"jsonpath (default)":e,getOptionValue:e=>e&&e==="jsonpath (default)"?"jsonpath":e??"",placeholder:"path resolver"})))};export{h as CheckPathResolverInput};
2
2
  //# sourceMappingURL=CheckPathResolverInput.esm.js.map
@@ -1,2 +1,2 @@
1
- import{makeStyles as s,Typography as p,Grid as n,FormControlLabel as h,Checkbox as u}from"@material-ui/core";import e from"react";import{useWatch as E,Controller as l}from"react-hook-form";import"../../../Frequency/types.esm.js";import"../../../Frequency/util.esm.js";import{FrequencyComponent as b}from"../../../Frequency/FrequencyComponent.esm.js";import{CHECK_FIELDS as f}from"../../utils/checkFormUtils.esm.js";const C=s(t=>({container:{display:"flex",flexDirection:"column",gap:t.spacing(1)}})),y=({control:t,disabled:o})=>{const c=C(),a=E({control:t,name:"scheduleStep.schedule"}),{description:m,checkboxLabel:i}=f.schedule;return e.createElement("div",{className:c.container},e.createElement(p,{variant:"body2"},m),e.createElement(n,{item:!0,xs:12},e.createElement(n,{item:!0},e.createElement(l,{name:"scheduleStep.schedule.enabled",control:t,render:({field:r})=>e.createElement(h,{disabled:o,control:e.createElement(u,{checked:r.value,onChange:r.onChange}),label:i})})),e.createElement(n,{item:!0},e.createElement(l,{name:"scheduleStep.schedule.frequency",control:t,render:({field:r,fieldState:d})=>e.createElement(b,{disabled:o||!a.enabled,value:r.value,onChange:r.onChange,errors:d.error})}))))};export{y as ScheduleSection};
1
+ import{makeStyles as p,Typography as o,Grid as l,FormControlLabel as E,Checkbox as b}from"@material-ui/core";import e from"react";import{useWatch as f,useFormContext as y,Controller as m}from"react-hook-form";import"../../../Frequency/types.esm.js";import"../../../Frequency/util.esm.js";import{FrequencyComponent as C}from"../../../Frequency/FrequencyComponent.esm.js";import{CHECK_FIELDS as S}from"../../utils/checkFormUtils.esm.js";const v=p(t=>({container:{display:"flex",flexDirection:"column",gap:t.spacing(1)}})),x=({control:t,disabled:r})=>{const n=v(),d=f({control:t,name:"scheduleStep.schedule"}),{watch:s}=y(),c=s("detailsStep.type"),{description:i,checkboxLabel:u}=S.schedule;return e.createElement("div",{className:n.container},c==="manual"&&e.createElement("div",{className:n.container},e.createElement(o,null,"Schedules do not apply to manual checks. These types of checks are meant to be executed manually by users and so cannot be scheduled.")),c!=="manual"&&e.createElement("div",{className:n.container},e.createElement(o,{variant:"body2"},i),e.createElement(l,{item:!0,xs:12},e.createElement(l,{item:!0},e.createElement(m,{name:"scheduleStep.schedule.enabled",control:t,render:({field:a})=>e.createElement(E,{disabled:r,control:e.createElement(b,{checked:a.value,onChange:a.onChange}),label:u})})),e.createElement(l,{item:!0},e.createElement(m,{name:"scheduleStep.schedule.frequency",control:t,render:({field:a,fieldState:h})=>e.createElement(C,{disabled:r||!d.enabled,value:a.value,onChange:a.onChange,errors:h.error})})))))};export{x as ScheduleSection};
2
2
  //# sourceMappingURL=ScheduleSection.esm.js.map
@@ -0,0 +1,2 @@
1
+ import{Box as t,Typography as a}from"@material-ui/core";import e from"react";import{FormControlledSelect as c}from"../../../FormControlledSelect/FormControlledSelect.esm.js";import{CHECK_FIELDS as m}from"../../utils/checkFormUtils.esm.js";const i=({control:l,disabled:o,isLoading:n})=>{const{type:r}=m.details;return e.createElement(t,{marginTop:1},e.createElement(t,null,e.createElement(a,{variant:"subtitle2"},r.name),e.createElement(a,{variant:"caption"},"Choose the type of check. Manual checks have results set by users, not by Soundcheck.")),e.createElement(c,{name:"detailsStep.type",style:{width:250},control:l,disabled:o||n,options:[{value:"default",label:"Default"},{value:"manual",label:"Manual"}]}))};export{i as CheckTypeInput};
2
+ //# sourceMappingURL=CheckTypeInput.esm.js.map
@@ -1,2 +1,2 @@
1
- import{Box as r,IconButton as m,FormHelperText as c}from"@material-ui/core";import s from"@material-ui/icons/Close";import e from"react";import{useRuleConditionStyles as i}from"./styles.esm.js";const u=({value:t,handleClear:a,error:l})=>{const n=i(),o=t?.factRef&&t?.path?e.createElement(e.Fragment,null,e.createElement("strong",null,"Fact:")," ",t.factRef," ",e.createElement("strong",null,"Path:")," ",t.path):JSON.stringify(t);return e.createElement(e.Fragment,null,e.createElement(r,{className:n.valueDisplay},e.createElement(r,{overflow:"hidden",flexGrow:1},o),e.createElement(m,{onClick:a,size:"small"},e.createElement(s,null))),l&&e.createElement(c,{error:!0},l.message))};export{u as FactValueDisplay};
1
+ import{Box as r,IconButton as m,FormHelperText as c}from"@material-ui/core";import s from"@material-ui/icons/Close";import e from"react";import{useRuleConditionStyles as i}from"./styles.esm.js";const u=({value:t,handleClear:n,error:l})=>{const a=i(),o=t?.factRef&&t?.path?e.createElement(e.Fragment,null,e.createElement("strong",null,"Fact:")," ",t.factRef," ",e.createElement("strong",null,"Path:")," ",t.path):JSON.stringify(t);return e.createElement(e.Fragment,null,e.createElement(r,{className:a.valueDisplay},e.createElement(r,{overflow:"hidden",flexGrow:1},o),e.createElement(m,{onClick:n,size:"small"},e.createElement(s,null))),l&&e.createElement(c,{error:!0},l.message))};export{u as FactValueDisplay};
2
2
  //# sourceMappingURL=FactValueDisplay.esm.js.map
@@ -1,2 +1,2 @@
1
- import{Box as o,FormLabel as c,TextField as j,IconButton as C}from"@material-ui/core";import V from"@material-ui/icons/Close";import D from"@material-ui/icons/Delete";import T from"@material-ui/icons/List";import{asArray as k}from"@spotify/backstage-plugin-soundcheck-common";import e,{useMemo as y,useCallback as h}from"react";import{useFormContext as G,Controller as M}from"react-hook-form";import{useOperators as W}from"../../../../../hooks/operators/useOperators.esm.js";import{FactExplorerDialogButton as $}from"../../../../FactExplorer/FactExplorerDialog.esm.js";import"../../../../FactExplorer/FactExplorerContext.esm.js";import{FormControlledAutocomplete as E}from"../../../../FormControlledAutocomplete/FormControlledAutocomplete.esm.js";import{FactValueDisplay as z}from"./FactValueDisplay.esm.js";import{useRuleConditionStyles as H}from"./styles.esm.js";import{useRuleOptions as q}from"./useRuleOptions.esm.js";import{ValueListInputDialogButton as A}from"./ValueListInput.esm.js";const J=({name:a,handleDelete:F,disabled:i,disableDelete:b})=>{const r=H(),{control:s,setValue:m,watch:p,clearErrors:d}=G(),{data:N,isLoading:R}=W(),O=p("rulesStep.pathResolver")==="jsonpath",u=y(()=>N?.map(t=>({value:t.name,label:t.title})).sort((t,l)=>t.label.localeCompare(l.label))??[],[N]),w=y(()=>u.map(t=>t.value),[u]),{pathOptions:B,factRefOptions:f,isLoading:x}=q(a,s),S=y(()=>f?.map(t=>t.value)??[],[f]),I=h(({factRef:t,path:l})=>{m(`${a}.factRef`,t),m(`${a}.path`,l),d()},[d,a,m]),P=h(({factRef:t,path:l})=>{m(`${a}.value`,{factRef:t,path:l}),d()},[d,a,m]),g=h(t=>{m(`${a}.value`,t.length>0?t:""),d()},[d,a,m]),n=p(`${a}.value`),L=h(()=>{m(`${a}.value`,"")},[a,m]);return e.createElement(o,{className:r.container},e.createElement(o,{className:r.connector}),e.createElement(o,{paddingTop:2,paddingLeft:2,paddingRight:2,paddingBottom:2,width:"100%",className:r.innerContainer},e.createElement(o,{className:r.inputsContainer},f&&e.createElement(o,null,e.createElement(c,{className:r.formLabel},"Fact"),e.createElement(E,{name:`${a}.factRef`,control:s,placeholder:"Fact",options:S,getOptionLabel:t=>f?.find(l=>t===l.value)?.label??t,getOptionValue:t=>f?.find(l=>t===l.label)?.value??t??"",disabled:i||x,width:428})),e.createElement(o,{flexGrow:1},e.createElement(c,{className:r.formLabel},"Path"),e.createElement(E,{name:`${a}.path`,placeholder:"Path",control:s,disabled:i||x,options:O?B:[],fullWidth:!0})),e.createElement(o,null,e.createElement(c,{className:r.formLabel,style:{visibility:"hidden"}},"Explore"),e.createElement(o,{width:150},e.createElement($,{factRef:p(`${a}.factRef`),path:p(`${a}.path`),onSave:I,pathResolver:p("rulesStep.pathResolver"),className:r.exploreButton,hideIcon:!0})))),e.createElement(o,{className:r.inputsContainer},u&&e.createElement(e.Fragment,null,e.createElement(o,null,e.createElement(c,{className:r.formLabel},"Prefix (Optional)"),e.createElement(E,{name:`${a}.operatorPrefix`,control:s,placeholder:"Prefix",options:["all","any","none"],disabled:R||i,width:120})),e.createElement(o,null,e.createElement(c,{className:r.formLabel},"Operator"),e.createElement(E,{name:`${a}.operator`,control:s,placeholder:"Operator",options:w,disabled:R||i,getOptionLabel:t=>(l=>u?.find(v=>l===v.value)?.label??l??"")(t),getOptionValue:t=>(l=>u?.find(v=>l===v.label)?.value??l??"")(t),width:300}))),e.createElement(o,{flexGrow:1},e.createElement(c,{className:r.formLabel},"Value"),typeof n=="object"&&!Array.isArray(n)?e.createElement(z,{value:n,handleClear:L}):e.createElement(M,{name:`${a}.value`,control:s,defaultValue:"",render:({field:t,fieldState:l})=>e.createElement(j,{...t,variant:"outlined",placeholder:"Enter a value",FormHelperTextProps:{className:r.helperText},error:l.invalid,helperText:l.error?l.error.message:null,margin:"dense",disabled:i||typeof n=="object",className:r.noMargin,fullWidth:!0,InputProps:{endAdornment:e.createElement(C,{onClick:L,size:"small"},e.createElement(V,null)),startAdornment:Array.isArray(n)?e.createElement(A,{values:n,onSave:g,iconButton:e.createElement(T,null)}):null}})})),e.createElement(o,null,e.createElement(c,{className:r.formLabel,style:{visibility:"hidden"}},"Alternative Input"),e.createElement(o,{display:"flex",width:150},e.createElement($,{factRef:typeof n=="object"?n?.factRef:void 0,path:typeof n=="object"?n?.path:void 0,onSave:P,pathResolver:p("rulesStep.pathResolver"),className:r.exploreButton,text:"Fact",hideIcon:!0}),e.createElement(A,{values:typeof n=="object"&&!Array.isArray(n)?void 0:k(n),onSave:g}))))),e.createElement(C,{onClick:F,className:r.deleteButton,"data-test-id":`${a}-delete-button`,disabled:i||b,hidden:i||b,style:{visibility:i||b?"hidden":void 0}},e.createElement(D,{className:r.deleteIcon})))};export{J as RuleConditionInput};
1
+ import{Box as o,FormLabel as c,TextField as j,IconButton as L}from"@material-ui/core";import V from"@material-ui/icons/Close";import D from"@material-ui/icons/Delete";import T from"@material-ui/icons/List";import{asArray as k}from"@spotify/backstage-plugin-soundcheck-common";import e,{useMemo as y,useCallback as h}from"react";import{useFormContext as G,Controller as M}from"react-hook-form";import{useOperators as W}from"../../../../../hooks/operators/useOperators.esm.js";import{FactExplorerDialogButton as C}from"../../../../FactExplorer/FactExplorerDialog.esm.js";import"../../../../FactExplorer/FactExplorerContext.esm.js";import{FormControlledAutocomplete as E}from"../../../../FormControlledAutocomplete/FormControlledAutocomplete.esm.js";import{FactValueDisplay as z}from"./FactValueDisplay.esm.js";import{useRuleConditionStyles as H}from"./styles.esm.js";import{useRuleOptions as q}from"./useRuleOptions.esm.js";import{ValueListInputDialogButton as A}from"./ValueListInput.esm.js";const J=({name:a,handleDelete:F,disabled:i,disableDelete:b})=>{const r=H(),{control:s,setValue:m,watch:p,clearErrors:d}=G(),{data:N,isLoading:R}=W(),O=p("rulesStep.pathResolver")==="jsonpath",u=y(()=>N?.map(t=>({value:t.name,label:t.title})).sort((t,l)=>t.label.localeCompare(l.label))??[],[N]),w=y(()=>u.map(t=>t.value),[u]),{pathOptions:B,factRefOptions:f,isLoading:x}=q(a,s),S=y(()=>f?.map(t=>t.value)??[],[f]),I=h(({factRef:t,path:l})=>{m(`${a}.factRef`,t),m(`${a}.path`,l),d()},[d,a,m]),P=h(({factRef:t,path:l})=>{m(`${a}.value`,{factRef:t,path:l}),d()},[d,a,m]),g=h(t=>{m(`${a}.value`,t.length>0?t:""),d()},[d,a,m]),n=p(`${a}.value`),$=h(()=>{m(`${a}.value`,"")},[a,m]);return e.createElement(o,{className:r.container},e.createElement(o,{className:r.connector}),e.createElement(o,{paddingTop:2,paddingLeft:2,paddingRight:2,paddingBottom:2,width:"100%",className:r.innerContainer},e.createElement(o,{className:r.inputsContainer},f&&e.createElement(o,null,e.createElement(c,{className:r.formLabel},"Fact"),e.createElement(E,{name:`${a}.factRef`,control:s,placeholder:"Fact",options:S,getOptionLabel:t=>f?.find(l=>t===l.value)?.label??t,getOptionValue:t=>f?.find(l=>t===l.label)?.value??t??"",disabled:i||x,width:428})),e.createElement(o,{flexGrow:1},e.createElement(c,{className:r.formLabel},"Path"),e.createElement(E,{name:`${a}.path`,placeholder:"Path",control:s,disabled:i||x,options:O?B:[],fullWidth:!0})),e.createElement(o,null,e.createElement(c,{className:r.formLabel,style:{visibility:"hidden"}},"Explore"),e.createElement(o,{width:150},e.createElement(C,{factRef:p(`${a}.factRef`),path:p(`${a}.path`),onSave:I,pathResolver:p("rulesStep.pathResolver"),className:r.exploreButton,hideIcon:!0})))),e.createElement(o,{className:r.inputsContainer},u&&e.createElement(e.Fragment,null,e.createElement(o,null,e.createElement(c,{className:r.formLabel},"Prefix (Optional)"),e.createElement(E,{name:`${a}.operatorPrefix`,control:s,placeholder:"Prefix",options:["all","any","none"],disabled:R||i,width:120})),e.createElement(o,null,e.createElement(c,{className:r.formLabel},"Operator"),e.createElement(E,{name:`${a}.operator`,control:s,placeholder:"Operator",options:w,disabled:R||i,getOptionLabel:t=>(l=>u?.find(v=>l===v.value)?.label??l??"")(t),getOptionValue:t=>(l=>u?.find(v=>l===v.label)?.value??l??"")(t),width:300}))),e.createElement(o,{flexGrow:1},e.createElement(c,{className:r.formLabel},"Value"),typeof n=="object"&&!Array.isArray(n)?e.createElement(z,{value:n,handleClear:$}):e.createElement(M,{name:`${a}.value`,control:s,defaultValue:"",render:({field:t,fieldState:l})=>e.createElement(j,{...t,variant:"outlined",placeholder:"Enter a value",FormHelperTextProps:{className:r.helperText},error:l.invalid,helperText:l.error?l.error.message:null,margin:"dense",disabled:i||typeof n=="object",className:r.noMargin,fullWidth:!0,InputProps:{endAdornment:e.createElement(L,{onClick:$,size:"small"},e.createElement(V,null)),startAdornment:Array.isArray(n)?e.createElement(A,{values:n,onSave:g,iconButton:e.createElement(T,null)}):null}})})),e.createElement(o,null,e.createElement(c,{className:r.formLabel,style:{visibility:"hidden"}},"Alternative Input"),e.createElement(o,{display:"flex",width:150},e.createElement(C,{factRef:typeof n=="object"?n?.factRef:void 0,path:typeof n=="object"?n?.path:void 0,onSave:P,pathResolver:p("rulesStep.pathResolver"),className:r.exploreButton,text:"Fact",hideIcon:!0}),e.createElement(A,{values:typeof n=="object"&&!Array.isArray(n)?void 0:k(n),onSave:g}))))),e.createElement(L,{onClick:F,className:r.deleteButton,"data-test-id":`${a}-delete-button`,disabled:i||b,hidden:i||b,style:{visibility:i||b?"hidden":void 0}},e.createElement(D,{className:r.deleteIcon})))};export{J as RuleConditionInput};
2
2
  //# sourceMappingURL=RuleConditionInput.esm.js.map
@@ -1,2 +1,2 @@
1
- import{makeStyles as C,Box as p,Typography as k,TextField as x,IconButton as v,Button as d,Divider as y}from"@material-ui/core";import B from"@material-ui/icons/Add";import S from"@material-ui/icons/Delete";import e,{useContext as E,useCallback as r}from"react";import{SoundcheckDialog as V}from"../../../../SoundcheckDialog/SoundcheckDialog.esm.js";import{ValueListContext as f}from"./ValueListContext.esm.js";const h=C(t=>({dialogButton:{padding:t.spacing(1,1.5)}})),I=()=>{const{values:t,updateValues:n,updateOpen:i,onSave:o}=E(f),u=r((a,l)=>{const s=[...t];s[a]=l,n(s)},[n,t]),c=r(a=>{const l=[...t];l.splice(a,1),n(l)},[n,t]),m=r(()=>{const a=[...t,""];n(a)},[n,t]),g=r(()=>{o(t.filter(a=>!!a)),i(!1)},[o,i,t]);return e.createElement(p,{minWidth:640,paddingLeft:2,paddingRight:2,"data-testid":"rule-value-list-input"},e.createElement(k,{component:"div",variant:"subtitle2"},"Rule Value"),t.map((a,l)=>e.createElement(p,{display:"flex",marginBottom:1,alignItems:"center",key:l},e.createElement(x,{value:a,onChange:s=>u(l,s.currentTarget.value),variant:"outlined",margin:"dense",fullWidth:!0}),e.createElement(v,{onClick:()=>c(l),size:"small"},e.createElement(S,null)))),e.createElement(p,{marginTop:1,marginBottom:2},e.createElement(d,{onClick:m,startIcon:e.createElement(B,null),size:"small",variant:"outlined"},"Add")),e.createElement(y,null),e.createElement(p,{marginTop:2,display:"flex",gridGap:8,justifyContent:"flex-end"},e.createElement(d,{onClick:()=>i(!1),variant:"text"},"Cancel"),e.createElement(d,{onClick:g,variant:"contained",color:"primary"},"Save")))},L=({values:t=Array(5).fill(""),onSave:n,iconButton:i})=>{const{updateOpen:o,updateValues:u,updateOnSave:c}=E(f),m=r(()=>{const a=[...t.map(l=>String(l)),"","",""];o(!0),u(a),c(()=>n||(()=>{}))},[n,c,o,u,t]),g=h();return i?e.createElement(v,{"aria-label":"edit list",onClick:m,size:"small"},i):e.createElement(d,{className:g.dialogButton,onClick:m},"List")},T=()=>{const{open:t,updateOpen:n}=E(f);return e.createElement(V,{open:t,handleClose:()=>n(!1),title:"Input Value List",fullScreen:!1},e.createElement(I,null))};export{T as ValueListInputDialog,L as ValueListInputDialogButton};
1
+ import{makeStyles as C,Box as p,Typography as k,TextField as S,IconButton as f,Button as d,Divider as x}from"@material-ui/core";import y from"@material-ui/icons/Add";import B from"@material-ui/icons/Delete";import e,{useContext as E,useCallback as r}from"react";import{SoundcheckDialog as h}from"../../../../SoundcheckDialog/SoundcheckDialog.esm.js";import{ValueListContext as v}from"./ValueListContext.esm.js";const V=C(t=>({dialogButton:{padding:t.spacing(1,1.5)}})),I=()=>{const{values:t,updateValues:n,updateOpen:i,onSave:o}=E(v),u=r((a,l)=>{const s=[...t];s[a]=l,n(s)},[n,t]),c=r(a=>{const l=[...t];l.splice(a,1),n(l)},[n,t]),m=r(()=>{const a=[...t,""];n(a)},[n,t]),g=r(()=>{o(t.filter(a=>!!a)),i(!1)},[o,i,t]);return e.createElement(p,{minWidth:640,paddingLeft:2,paddingRight:2,"data-testid":"rule-value-list-input"},e.createElement(k,{component:"div",variant:"subtitle2"},"Rule Value"),t.map((a,l)=>e.createElement(p,{display:"flex",marginBottom:1,alignItems:"center",key:l},e.createElement(S,{value:a,onChange:s=>u(l,s.currentTarget.value),variant:"outlined",margin:"dense",fullWidth:!0}),e.createElement(f,{onClick:()=>c(l),size:"small"},e.createElement(B,null)))),e.createElement(p,{marginTop:1,marginBottom:2},e.createElement(d,{onClick:m,startIcon:e.createElement(y,null),size:"small",variant:"outlined"},"Add")),e.createElement(x,null),e.createElement(p,{marginTop:2,display:"flex",gridGap:8,justifyContent:"flex-end"},e.createElement(d,{onClick:()=>i(!1),variant:"text"},"Cancel"),e.createElement(d,{onClick:g,variant:"contained",color:"primary"},"Save")))},L=({values:t=Array(5).fill(""),onSave:n,iconButton:i})=>{const{updateOpen:o,updateValues:u,updateOnSave:c}=E(v),m=r(()=>{const a=[...t.map(l=>String(l)),"","",""];o(!0),u(a),c(()=>n||(()=>{}))},[n,c,o,u,t]),g=V();return i?e.createElement(f,{"aria-label":"edit list",onClick:m,size:"small"},i):e.createElement(d,{className:g.dialogButton,onClick:m},"List")},T=()=>{const{open:t,updateOpen:n}=E(v);return e.createElement(h,{open:t,handleClose:()=>n(!1),title:"Input Value List",fullScreen:!1},e.createElement(I,null))};export{T as ValueListInputDialog,L as ValueListInputDialogButton};
2
2
  //# sourceMappingURL=ValueListInput.esm.js.map
@@ -1,2 +1,2 @@
1
- import{parseEntityRef as v}from"@backstage/catalog-model";import{Typography as y}from"@material-ui/core";import{makeStyles as b}from"@material-ui/core/styles";import{uniqBy as g}from"lodash";import o from"react";import{useFormContext as h}from"react-hook-form";import"../../../../contexts/TrackFormContext.esm.js";import"../../../../contexts/CheckFormContext.esm.js";import"../../../../contexts/CampaignFormContext.esm.js";import{useLoggedInUser as w}from"../../../../contexts/UserProvider.esm.js";import{useGroupOptions as x}from"../../../../hooks/groups/useGroupOptions.esm.js";import{FormControlledAutocomplete as L}from"../../../FormControlledAutocomplete/FormControlledAutocomplete.esm.js";import{useLabelOptions as S}from"../../../FormControlledAutocomplete/useLabelOptions.esm.js";import"@material-ui/lab";import"../../../ListboxVirtualized/ListboxVirtualized.esm.js";import{CHECK_FIELDS as C}from"../../utils/checkFormUtils.esm.js";const R=b(a=>({container:{display:"flex",flexDirection:"column",gap:a.spacing(1)}})),T=({control:a,disabled:l,error:n})=>{const i=R(),{options:p,isLoading:s}=x();let e=g(p.map(m=>({value:m.ref,label:m.name})),"value");const{user:c,userEntityRef:r}=w();r&&(e=[{value:r,label:c?.metadata?.name??r},...e]);const{watch:u}=h(),t=u("detailsStep.ownerEntityRef");t&&r!==t&&!e.some(m=>m.value===t)&&(e=[{value:t,label:v(t).name},...e]);const f=S(e),{owner:{name:d,selectLabel:E}}=C.details;return o.createElement("div",{className:i.container},o.createElement("div",null,o.createElement(y,{variant:"subtitle2"},d)),o.createElement("div",null,o.createElement(L,{freeSolo:!1,name:"detailsStep.ownerEntityRef",control:a,placeholder:E,width:250,helperText:n?.message??void 0,disabled:l||s,...f})))};export{T as TeamDetailsInput};
1
+ import{parseEntityRef as v}from"@backstage/catalog-model";import{Typography as y}from"@material-ui/core";import{makeStyles as b}from"@material-ui/core/styles";import{uniqBy as g}from"lodash";import o from"react";import{useFormContext as h}from"react-hook-form";import"../../../../contexts/TrackFormContext.esm.js";import"../../../../contexts/CheckFormContext.esm.js";import"../../../../contexts/CampaignFormContext.esm.js";import{useLoggedInUser as w}from"../../../../contexts/UserProvider.esm.js";import{useGroupOptions as x}from"../../../../hooks/groups/useGroupOptions.esm.js";import{FormControlledAutocomplete as L}from"../../../FormControlledAutocomplete/FormControlledAutocomplete.esm.js";import"@material-ui/icons/CheckBox";import"@material-ui/icons/CheckBoxOutlineBlank";import"@material-ui/lab";import"../../../ListboxVirtualized/ListboxVirtualized.esm.js";import{useLabelOptions as S}from"../../../FormControlledAutocomplete/useLabelOptions.esm.js";import{CHECK_FIELDS as C}from"../../utils/checkFormUtils.esm.js";const R=b(a=>({container:{display:"flex",flexDirection:"column",gap:a.spacing(1)}})),T=({control:a,disabled:i,error:l})=>{const n=R(),{options:p,isLoading:s}=x();let e=g(p.map(m=>({value:m.ref,label:m.name})),"value");const{user:c,userEntityRef:r}=w();r&&(e=[{value:r,label:c?.metadata?.name??r},...e]);const{watch:u}=h(),t=u("detailsStep.ownerEntityRef");t&&r!==t&&!e.some(m=>m.value===t)&&(e=[{value:t,label:v(t).name},...e]);const f=S(e),{owner:{name:d,selectLabel:E}}=C.details;return o.createElement("div",{className:n.container},o.createElement("div",null,o.createElement(y,{variant:"subtitle2"},d)),o.createElement("div",null,o.createElement(L,{freeSolo:!1,name:"detailsStep.ownerEntityRef",control:a,placeholder:E,width:250,helperText:l?.message??void 0,disabled:i||s,...f})))};export{T as TeamDetailsInput};
2
2
  //# sourceMappingURL=TeamDetailsInput.esm.js.map
@@ -1,2 +1,2 @@
1
- import{makeStyles as p}from"@material-ui/core/styles";import t from"react";import{useFormContext as n}from"react-hook-form";import"../../../contexts/TrackFormContext.esm.js";import{useCheckFormContext as a}from"../../../contexts/CheckFormContext.esm.js";import"../../../contexts/CampaignFormContext.esm.js";import"../../../contexts/UserProvider.esm.js";import{CheckNameInput as s}from"../FormFields/CheckNameInput/CheckNameInput.esm.js";import"../FormFields/PassFailMessageInput/PassFailMessageInput.esm.js";import{CheckDescriptionInput as c}from"../FormFields/CheckDescriptionInput/CheckDescriptionInput.esm.js";import{TeamDetailsInput as l}from"../FormFields/TeamDetailsInput/TeamDetailsInput.esm.js";import"../FormFields/RuleInput/AddMenuButton.esm.js";import"../FormFields/RuleInput/RuleInputBox.esm.js";import"../FormFields/RuleInput/Expressions/ExpressionBox.esm.js";import"../FormFields/RuleInput/Expressions/ExpressionTypeToggle.esm.js";import"@material-ui/core";import"@material-ui/icons/Close";import"@material-ui/icons/Delete";import"@material-ui/icons/List";import"@spotify/backstage-plugin-soundcheck-common";import"@backstage/core-plugin-api";import"@tanstack/react-query";import"../../../api.esm.js";import"@material-ui/icons/Search";import"../../SoundcheckDialog/SoundcheckDialog.esm.js";import"../../FactExplorer/FactExplorer.esm.js";import"../../FactExplorer/FactExplorerContext.esm.js";import"../../FormControlledAutocomplete/FormControlledAutocomplete.esm.js";import"../FormFields/RuleInput/Conditions/styles.esm.js";import"@backstage/catalog-model";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"../utils/checkFormUtils.esm.js";import"../FormFields/RuleInput/Conditions/ValueListInput.esm.js";import"../FormFields/RuleInput/Conditions/ConditionList.esm.js";import"../FormFields/CheckScheduleSection/ScheduleSection.esm.js";import"../FormFields/CheckPathResolverInput.esm.js";const d=p(r=>({container:{display:"flex",flexDirection:"column",gap:r.spacing(1)}})),f=()=>{const r=d(),{isLoading:m,isReadOnly:o}=a(),{control:i,formState:{errors:e}}=n();return t.createElement("div",{className:r.container},t.createElement(s,{control:i,error:e?.detailsStep?.name,isLoading:m,disabled:o}),t.createElement(c,{control:i,error:e?.detailsStep?.description,isLoading:m,disabled:o}),t.createElement(l,{control:i,disabled:o,error:e?.detailsStep?.ownerEntityRef}))};export{f as CheckDetailsStep};
1
+ import{useApi as n,configApiRef as a}from"@backstage/core-plugin-api";import{makeStyles as s}from"@material-ui/core/styles";import t from"react";import{useFormContext as c}from"react-hook-form";import"../../../contexts/TrackFormContext.esm.js";import{useCheckFormContext as l}from"../../../contexts/CheckFormContext.esm.js";import"../../../contexts/CampaignFormContext.esm.js";import"../../../contexts/UserProvider.esm.js";import{CheckNameInput as d}from"../FormFields/CheckNameInput/CheckNameInput.esm.js";import"../FormFields/PassFailMessageInput/PassFailMessageInput.esm.js";import{CheckDescriptionInput as f}from"../FormFields/CheckDescriptionInput/CheckDescriptionInput.esm.js";import{TeamDetailsInput as u}from"../FormFields/TeamDetailsInput/TeamDetailsInput.esm.js";import"../FormFields/RuleInput/AddMenuButton.esm.js";import"../FormFields/RuleInput/RuleInputBox.esm.js";import"../FormFields/RuleInput/Expressions/ExpressionBox.esm.js";import"../FormFields/RuleInput/Expressions/ExpressionTypeToggle.esm.js";import"@material-ui/core";import"@material-ui/icons/Close";import"@material-ui/icons/Delete";import"@material-ui/icons/List";import"@spotify/backstage-plugin-soundcheck-common";import"@tanstack/react-query";import"../../../api.esm.js";import"@material-ui/icons/Search";import"../../SoundcheckDialog/SoundcheckDialog.esm.js";import"../../FactExplorer/FactExplorer.esm.js";import"../../FactExplorer/FactExplorerContext.esm.js";import"../../FormControlledAutocomplete/FormControlledAutocomplete.esm.js";import"../FormFields/RuleInput/Conditions/styles.esm.js";import"@backstage/catalog-model";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"../utils/checkFormUtils.esm.js";import"../FormFields/RuleInput/Conditions/ValueListInput.esm.js";import"../FormFields/RuleInput/Conditions/ConditionList.esm.js";import"../FormFields/CheckScheduleSection/ScheduleSection.esm.js";import"../FormFields/CheckPathResolverInput.esm.js";import{CheckTypeInput as g}from"../FormFields/CheckTypeInput/CheckTypeInput.esm.js";const C=s(i=>({container:{display:"flex",flexDirection:"column",gap:i.spacing(1)}})),k=()=>{const i=C(),{isLoading:e,isReadOnly:r}=l(),{control:o,formState:{errors:m}}=c(),p=n(a).getOptionalStringArray("soundcheck.flags")?.includes("enable-MCE");return t.createElement("div",{className:i.container},t.createElement(d,{control:o,error:m?.detailsStep?.name,isLoading:e,disabled:r}),t.createElement(f,{control:o,error:m?.detailsStep?.description,isLoading:e,disabled:r}),t.createElement(u,{control:o,disabled:r,error:m?.detailsStep?.ownerEntityRef}),p&&t.createElement(g,{control:o,disabled:r,isLoading:e}))};export{k as CheckDetailsStep};
2
2
  //# sourceMappingURL=CheckDetailsStep.esm.js.map
@@ -1,2 +1,2 @@
1
- import{stringifyEntityRef as l}from"@backstage/catalog-model";import{EntityListProvider as c}from"@backstage/plugin-catalog-react";import{makeStyles as s,Typography as d}from"@material-ui/core";import{isEqual as f}from"lodash";import t from"react";import{useFormContext as y}from"react-hook-form";import"../../../contexts/TrackFormContext.esm.js";import{useCheckFormContext as E}from"../../../contexts/CheckFormContext.esm.js";import"../../../contexts/CampaignFormContext.esm.js";import"../../../contexts/UserProvider.esm.js";import{CheckDryRun as g}from"../../CheckDryRun/CheckDryRun.esm.js";import"../../SoundcheckDialog/SoundcheckDialog.esm.js";import"../../CheckDryRun/CheckDryRunDetails.esm.js";import{CheckDryRunProvider as u}from"../../CheckDryRun/CheckDryRunContext.esm.js";import{mapToCheckerInput as v}from"../utils/checkFormUtils.esm.js";import{ExpandableSection as x}from"../../ExpandableSection/ExpandableSection.esm.js";import{FilterPreviewTable as h}from"../../Filter/FilterPreviewTable/FilterPreviewTable.esm.js";import{emptyFilters as m}from"../../Filter/types.esm.js";import{FormattedPreview as S}from"../../FormattedPreview/FormattedPreview.esm.js";const k=s(e=>({container:{display:"flex",flexDirection:"column",gap:e.spacing(2)},preview:{color:e.palette.text.primary,fontSize:e.typography.body1.fontSize,borderTop:`1px solid ${e.palette.divider}`,overflow:"auto",padding:e.spacing(1,2),maxHeight:420,"& pre":{marginTop:0,background:`${e.palette.background.paper} !important`}},previewSection:{marginBottom:e.spacing(2)}})),C=()=>{const e=k(),{getValues:i}=y(),{selectedItem:o}=E(),r=v(i(),o),a=i("filtersStep.filter"),n=f(a,m());return t.createElement(u,null,t.createElement(d,{variant:"body2"},"Take a moment to review your check and perform dry runs to ensure everything is working as expected before you save."),t.createElement("div",{className:e.container},t.createElement(x,{className:e.previewSection,title:"YAML"},t.createElement("div",{className:e.preview},t.createElement(S,{data:{...r,id:o?r.id:"<ID WILL BE GENERATED WHEN CHECK IS SAVED>"},dataType:"yaml"}))),t.createElement(c,{pagination:{limit:10}},t.createElement(h,{title:`Test Against ${n?"All Entities - Search to Get Started":"Applicable Entities"}`,filter:a??m(),hideTags:!0,additionalColumns:[{title:"Dry Run",cellStyle:{padding:"0px 16px 0px 20px"},id:"dry-run",render:p=>t.createElement(t.Fragment,null,t.createElement(g,{check:r,entityRef:l(p)}))}]}))))};export{C as CheckReviewStep};
1
+ import{stringifyEntityRef as x}from"@backstage/catalog-model";import{EntityListProvider as k}from"@backstage/plugin-catalog-react";import{makeStyles as v,Typography as h}from"@material-ui/core";import{isEqual as S,pickBy as F}from"lodash";import t,{useMemo as b}from"react";import{useFormContext as p}from"react-hook-form";import"../../../contexts/TrackFormContext.esm.js";import{useCheckFormContext as w}from"../../../contexts/CheckFormContext.esm.js";import"../../../contexts/CampaignFormContext.esm.js";import"../../../contexts/UserProvider.esm.js";import{CheckDryRun as T}from"../../CheckDryRun/CheckDryRun.esm.js";import"../../SoundcheckDialog/SoundcheckDialog.esm.js";import"../../CheckDryRun/CheckDryRunDetails.esm.js";import{CheckDryRunProvider as C}from"../../CheckDryRun/CheckDryRunContext.esm.js";import{mapToCheckerInput as D}from"../utils/checkFormUtils.esm.js";import{ExpandableSection as R}from"../../ExpandableSection/ExpandableSection.esm.js";import{FilterPreviewTable as A}from"../../Filter/FilterPreviewTable/FilterPreviewTable.esm.js";import{emptyFilters as n,emptyKeyValueFilters as c}from"../../Filter/types.esm.js";import{FormattedPreview as V}from"../../FormattedPreview/FormattedPreview.esm.js";const I=v(e=>({container:{display:"flex",flexDirection:"column",gap:e.spacing(2)},preview:{color:e.palette.text.primary,fontSize:e.typography.body1.fontSize,borderTop:`1px solid ${e.palette.divider}`,overflow:"auto",padding:e.spacing(1,2),maxHeight:420,"& pre":{marginTop:0,background:`${e.palette.background.paper} !important`}},previewSection:{marginBottom:e.spacing(2)}})),N=()=>{const e=I(),{getValues:r}=p(),{selectedItem:o}=w(),i=D(r(),o),m=r("filtersStep.filter"),s=r("filtersStep.keyValueFilter"),d=r("filtersStep.excludeFilter"),u=r("filtersStep.excludeKeyValueFilter"),y=S(m,n()),{watch:f}=p(),a=f("detailsStep.type")==="manual";a&&delete i.rule;const E=b(()=>{const l={...i,id:o?i.id:"<ID WILL BE GENERATED WHEN CHECK IS SAVED>"};return F(l,g=>!!g)},[i,o]);return t.createElement(C,null,t.createElement(h,{variant:"body2"},a?"Manual checks cannot be dry-run. These types of checks are meant to be executed manually by users.":"Take a moment to review your check and perform dry runs to ensure everything is working as expected before you save."),t.createElement("div",{className:e.container},t.createElement(R,{className:e.previewSection,title:"YAML"},t.createElement("div",{className:e.preview},t.createElement(V,{data:E,dataType:"yaml"}))),!a&&t.createElement(k,{pagination:{limit:10}},t.createElement(A,{title:`Test Against ${y?"Select Filters to Dry Run Against Applicable Entities":"Applicable Entities"}`,filter:m??n(),keyValueFilter:s??c(),excludeFilter:d??n(),excludeKeyValueFilter:u??c(),hideTags:!0,additionalColumns:[{title:"Dry Run",cellStyle:{padding:"0px 16px 0px 20px"},id:"dry-run",render:l=>t.createElement(t.Fragment,null,t.createElement(T,{check:i,entityRef:x(l)}))}]}))))};export{N as CheckReviewStep};
2
2
  //# sourceMappingURL=CheckReviewStep.esm.js.map
@@ -1,2 +1,2 @@
1
- import{Typography as n,FormControlLabel as p,Checkbox as c}from"@material-ui/core";import{makeStyles as s}from"@material-ui/core/styles";import e from"react";import{useFormContext as d,Controller as u}from"react-hook-form";import"../../../contexts/TrackFormContext.esm.js";import{useCheckFormContext as E}from"../../../contexts/CheckFormContext.esm.js";import"../../../contexts/CampaignFormContext.esm.js";import"../../../contexts/UserProvider.esm.js";import{FormFieldLabel as f}from"../../FormFieldLabel/FormFieldLabel.esm.js";import"../FormFields/CheckNameInput/CheckNameInput.esm.js";import{PassFailMessageInput as C}from"../FormFields/PassFailMessageInput/PassFailMessageInput.esm.js";import"../../FormMarkdownInput/FormMarkdownInput.esm.js";import{CHECK_FIELDS as h}from"../utils/checkFormUtils.esm.js";import"../FormFields/TeamDetailsInput/TeamDetailsInput.esm.js";import"../FormFields/RuleInput/AddMenuButton.esm.js";import{RuleInputBox as g}from"../FormFields/RuleInput/RuleInputBox.esm.js";import"../FormFields/RuleInput/Expressions/ExpressionBox.esm.js";import"../FormFields/RuleInput/Expressions/ExpressionTypeToggle.esm.js";import"@material-ui/icons/Close";import"@material-ui/icons/Delete";import"@material-ui/icons/List";import"@spotify/backstage-plugin-soundcheck-common";import"@backstage/core-plugin-api";import"@tanstack/react-query";import"../../../api.esm.js";import"@material-ui/icons/Search";import"../../SoundcheckDialog/SoundcheckDialog.esm.js";import"../../FactExplorer/FactExplorer.esm.js";import"../../FactExplorer/FactExplorerContext.esm.js";import"../../FormControlledAutocomplete/FormControlledAutocomplete.esm.js";import"../FormFields/RuleInput/Conditions/styles.esm.js";import"@backstage/catalog-model";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"../FormFields/RuleInput/Conditions/ValueListInput.esm.js";import"../FormFields/RuleInput/Conditions/ConditionList.esm.js";import"../FormFields/CheckScheduleSection/ScheduleSection.esm.js";import{CheckPathResolverInput as k}from"../FormFields/CheckPathResolverInput.esm.js";const v=s(t=>({container:{display:"flex",flexDirection:"column",gap:t.spacing(2)},innerContainer:{display:"flex",flexDirection:"column"}})),b=()=>{const t=v(),{isLoading:l,isReadOnly:r}=E(),{control:o}=d(),{rules:m,warnings:i}=h.rulesStep;return e.createElement("div",{className:t.container},e.createElement("div",{className:t.innerContainer},e.createElement(k,{control:o}),e.createElement("div",null,e.createElement(f,{title:m.name,docLink:"https://backstage.spotify.com/docs/plugins/soundcheck/core-concepts/checks#rules"}),e.createElement(n,{variant:"caption"},m.description)),e.createElement(g,{disabled:r,name:"rulesStep.expressions",depth:0})),e.createElement(C,{control:o,isLoading:l,disabled:r}),e.createElement("div",{className:t.container},e.createElement("div",{className:t.innerContainer},e.createElement("div",null,e.createElement(n,{variant:"subtitle2"},i.name),e.createElement(n,{variant:"caption"},i.description)),e.createElement(u,{name:"rulesStep.warning",control:o,render:({field:a})=>e.createElement(p,{disabled:r,control:e.createElement(c,{checked:a.value,onChange:a.onChange}),label:i.label})}))))};export{b as CheckRulesStep};
1
+ import{Typography as o,FormControlLabel as d,Checkbox as u}from"@material-ui/core";import{makeStyles as E}from"@material-ui/core/styles";import e from"react";import{useFormContext as c,Controller as h}from"react-hook-form";import"../../../contexts/TrackFormContext.esm.js";import{useCheckFormContext as f}from"../../../contexts/CheckFormContext.esm.js";import"../../../contexts/CampaignFormContext.esm.js";import"../../../contexts/UserProvider.esm.js";import{FormFieldLabel as C}from"../../FormFieldLabel/FormFieldLabel.esm.js";import"../FormFields/CheckNameInput/CheckNameInput.esm.js";import{PassFailMessageInput as v}from"../FormFields/PassFailMessageInput/PassFailMessageInput.esm.js";import"../../FormMarkdownInput/FormMarkdownInput.esm.js";import{CHECK_FIELDS as g}from"../utils/checkFormUtils.esm.js";import"../FormFields/TeamDetailsInput/TeamDetailsInput.esm.js";import"../FormFields/RuleInput/AddMenuButton.esm.js";import{RuleInputBox as k}from"../FormFields/RuleInput/RuleInputBox.esm.js";import"../FormFields/RuleInput/Expressions/ExpressionBox.esm.js";import"../FormFields/RuleInput/Expressions/ExpressionTypeToggle.esm.js";import"@material-ui/icons/Close";import"@material-ui/icons/Delete";import"@material-ui/icons/List";import"@spotify/backstage-plugin-soundcheck-common";import"@backstage/core-plugin-api";import"@tanstack/react-query";import"../../../api.esm.js";import"@material-ui/icons/Search";import"../../SoundcheckDialog/SoundcheckDialog.esm.js";import"../../FactExplorer/FactExplorer.esm.js";import"../../FactExplorer/FactExplorerContext.esm.js";import"../../FormControlledAutocomplete/FormControlledAutocomplete.esm.js";import"../FormFields/RuleInput/Conditions/styles.esm.js";import"@backstage/catalog-model";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"../FormFields/RuleInput/Conditions/ValueListInput.esm.js";import"../FormFields/RuleInput/Conditions/ConditionList.esm.js";import"../FormFields/CheckScheduleSection/ScheduleSection.esm.js";import{CheckPathResolverInput as y}from"../FormFields/CheckPathResolverInput.esm.js";const b=E(t=>({container:{display:"flex",flexDirection:"column",gap:t.spacing(2)},innerContainer:{display:"flex",flexDirection:"column"}})),x=()=>{const t=b(),{isLoading:p,isReadOnly:n}=f(),{control:i}=c(),{rules:m,warnings:a}=g.rulesStep,{watch:s}=c(),r=s("detailsStep.type");return e.createElement(e.Fragment,null,r==="manual"&&e.createElement("div",{className:t.container},e.createElement("div",{className:t.innerContainer},e.createElement(o,null,"Rules do not apply to manual checks. These types of checks are meant to have their state manually set by users, not executed by Soundcheck."))),(r==="default"||r===void 0||r===null)&&e.createElement("div",{className:t.container},e.createElement("div",{className:t.innerContainer},e.createElement(y,{control:i}),e.createElement("div",null,e.createElement(C,{title:m.name,docLink:"https://backstage.spotify.com/docs/plugins/soundcheck/core-concepts/checks#rules"}),e.createElement(o,{variant:"caption"},m.description)),e.createElement(k,{disabled:n,name:"rulesStep.expressions",depth:0})),e.createElement(v,{control:i,isLoading:p,disabled:n}),e.createElement("div",{className:t.container},e.createElement("div",{className:t.innerContainer},e.createElement("div",null,e.createElement(o,{variant:"subtitle2"},a.name),e.createElement(o,{variant:"caption"},a.description)),e.createElement(h,{name:"rulesStep.warning",control:i,render:({field:l})=>e.createElement(d,{disabled:n,control:e.createElement(u,{checked:l.value,onChange:l.onChange}),label:a.label})})))))};export{x as CheckRulesStep};
2
2
  //# sourceMappingURL=CheckRulesStep.esm.js.map
@@ -1,2 +1,2 @@
1
- import{zodResolver as n}from"@hookform/resolvers/zod";import{useForm as a}from"react-hook-form";import"../../contexts/TrackFormContext.esm.js";import{useCheckFormContext as c}from"../../contexts/CheckFormContext.esm.js";import"../../contexts/CampaignFormContext.esm.js";import"react";import{useLoggedInUser as u}from"../../contexts/UserProvider.esm.js";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"react-router-dom";import{mapCheckerToFormValues as l,mapToCheckerInput as d,DEFAULT_FORM_VALUES as h}from"./utils/checkFormUtils.esm.js";import{checkFormSchema as C}from"./utils/validation.esm.js";const S=m=>{const{selectedItem:e}=c(),{userEntityRef:t}=u();let o=h;e&&(o=l(e)),t&&!o.detailsStep.ownerEntityRef&&(o.detailsStep.ownerEntityRef=t);const i=a({defaultValues:o,mode:"onChange",resolver:n(C)}),{showModal:s}=f();return{formMethods:i,onSubmit:async r=>{if(!await s({title:"Save Check",message:`Are you sure you want to save check: ${r.detailsStep.name}?`,error:!1}))return;const p=d(r,e);m(p)}}};export{S as useCheckForm};
1
+ import{zodResolver as a}from"@hookform/resolvers/zod";import{useForm as u}from"react-hook-form";import"../../contexts/TrackFormContext.esm.js";import{useCheckFormContext as c}from"../../contexts/CheckFormContext.esm.js";import"../../contexts/CampaignFormContext.esm.js";import"react";import{useLoggedInUser as l}from"../../contexts/UserProvider.esm.js";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"react-router-dom";import{mapCheckerToFormValues as d,mapToCheckerInput as h,DEFAULT_FORM_VALUES as C}from"./utils/checkFormUtils.esm.js";import{manualCheckFormSchema as S,defaultCheckFormSchema as k}from"./utils/validation.esm.js";const F=p=>{const{selectedItem:r}=c(),{userEntityRef:m}=l();let e=C;r&&(e=d(r)),m&&!e.detailsStep.ownerEntityRef&&(e.detailsStep.ownerEntityRef=m);const s=u({defaultValues:e,mode:"onChange",resolver:(o,t,i)=>o.detailsStep.type==="manual"?a(S)(o,t,i):a(k)(o,t,i)}),{showModal:n}=f();return{formMethods:s,onSubmit:async o=>{if(!await n({title:"Save Check",message:`Are you sure you want to save check: ${o.detailsStep.name}?`,error:!1}))return;const t=h(o,r);p(t)}}};export{F as useCheckForm};
2
2
  //# sourceMappingURL=useCheckForm.esm.js.map
@@ -1,2 +1,3 @@
1
- import{FrequencySchema as S}from"@spotify/backstage-plugin-soundcheck-common";import{isObject as k}from"lodash";import{v4 as T}from"uuid";import{mapInputFilterToFormFilters as R,mapFiltersToCatalogFilter as y}from"../../Filter/utils.esm.js";import"../../Filter/FilterComponent.esm.js";import{emptyFilters as A}from"../../Filter/types.esm.js";import{TimeUnit as g}from"../../Frequency/types.esm.js";import{isTimeUnit as C}from"../../Frequency/util.esm.js";import"../../Frequency/FrequencyComponent.esm.js";import{ExpressionType as p}from"../types/ExpressionType.esm.js";import{defaultSchedule as O}from"../types/Schedule.esm.js";import"../types/Path.esm.js";import{CHECK_NAME_MAX_LENGTH as P}from"./validation.esm.js";const x=e=>{if(k(e)&&"frequency"in e){const r=S.safeParse(e.frequency);if(r.success){const t=r.data;if("cron"in t)return{enabled:!0,frequency:{type:"cron",unit:g.Hours,value:1,cron:t.cron}};const s=Object.keys(t);if(s.length){const o=s[0];if(C(o))return{enabled:!0,frequency:{type:"HumanDuration",unit:o,value:t[o]??1,cron:""}}}}}return{enabled:!1,frequency:{type:"HumanDuration",unit:g.Hours,value:1,cron:""}}},v=(e,r)=>{const{enabled:t,frequency:s}=e;if(t){const{cron:o,type:n,unit:a,value:l}=s;return n==="HumanDuration"?{frequency:{[a]:l},filter:y(r)}:{frequency:{cron:o}}}},h=e=>{if(Array.isArray(e))return e.map(r=>h(r));if(typeof e=="string"){if(e==="true")return!0;if(e==="false")return!1;const r=Number(e);if(!isNaN(r))return r}return e},f=e=>{if(!e)return{};if(e.expressionType){const r={[e.expressionType]:e.conditions?.map(t=>({factRef:t.factRef,path:t.path,operator:t.operatorPrefix?`${t.operatorPrefix}:${t.operator}`:t.operator,value:h(t.value)}))};return e.expressions&&e.expressions.forEach(t=>{r[e.expressionType]?.push(f(t))}),r}if(e.expressions)return e.expressions.map(f);if(e.conditions&&e.conditions.length===1){const r=e.conditions[0];return{factRef:r.factRef,path:r.path,operator:r.operatorPrefix?`${r.operatorPrefix}:${r.operator}`:r.operator,value:h(r.value)}}return{}},w=e=>{if(e?.match(/.:./)){const r=e.split(":");if(["all","any","none"].includes(r[0]))return{operator:r[1],operatorPrefix:r[0]}}return{}},m=(e,r=!0)=>{if(!e)return{conditions:[]};const t=Object.keys(e);let s=t.includes("all")||r&&!t.includes("any")?p.AllOf:p.AnyOf;if(t.includes("not")&&(s=p.Not),t.includes(s)||r){const a=e[s]||[e],l=[],u=[];return a.forEach(i=>{const d=Object.keys(i);if(d.includes("all")||d.includes("any")||d.includes("not"))u.push(m(i,!1));else{const{operator:E,operatorPrefix:b}=w(i.operator);l.push({factRef:i.factRef,path:i.path,operator:E??i.operator,value:i.value,operatorPrefix:b})}}),{expressions:u.length>0?u:void 0,conditions:l,expressionType:s}}const{operator:o,operatorPrefix:n}=w(e.operator);return{expressionType:p.AllOf,conditions:[{factRef:e.factRef,path:e.path,operator:o??e.operator,value:e.value,operatorPrefix:n}]}},M=e=>({detailsStep:{name:e.name??"",description:e.description??"",ownerEntityRef:e.ownerEntityRef??""},rulesStep:{pathResolver:e.pathResolver??"jsonpath",expressions:m(e.rule),passedMessage:e.passedMessage??void 0,failedMessage:e.failedMessage??void 0,warning:e.warning??!1},filtersStep:{filter:R(e.filter)},scheduleStep:{schedule:x(e.schedule)}}),F=(e,r)=>{const{detailsStep:t,rulesStep:s,filtersStep:o,scheduleStep:n}=e;return{id:r?r.id:T(),ownerEntityRef:t.ownerEntityRef??void 0,name:t.name,description:t.description,pathResolver:s.pathResolver,passedMessage:s.passedMessage??void 0,failedMessage:s.failedMessage??void 0,rule:f(s.expressions),warning:s.warning??!1,filter:o.filter?y(o.filter):void 0,schedule:v(n.schedule,o.filter)}},c=(e,r="$")=>{const t=[];if(e.type==="object"&&e.properties){const s=e.properties;for(const o in s)if(s.hasOwnProperty(o)){const n=`${r}.${o}`;t.push(n);const a=s[o];t.push(...c(a,n))}}if(e.type==="array"&&e.items){const s=`${r}[*]`;t.push(s);const o=Array.isArray(e.items)?e.items:[e.items];for(const n of o)t.push(...c(n,s))}if(e.oneOf){const s=Array.isArray(e.oneOf)?e.oneOf:[e.oneOf];for(const o of s)t.push(...c(o,r))}if(e.allOf){const s=Array.isArray(e.allOf)?e.allOf:[e.allOf];for(const o of s)t.push(...c(o,r))}return[...new Set(t)]},q={detailsStep:{name:"",description:"",ownerEntityRef:""},rulesStep:{pathResolver:"jsonpath",expressions:{expressionType:p.AllOf,expressions:void 0,conditions:[{factRef:"",path:"",operator:"",operatorPrefix:"",value:"",conditions:[]}]},warning:!1},filtersStep:{filter:A()},scheduleStep:{schedule:O()}},N={details:{name:{name:"Check name",helperText:`Max ${P} characters`,placeholder:"Name your check (e.g., 'Code Coverage\u2019)"},description:{name:"Check description",placeholder:"Describe your check clearly so others understand its purpose. e.g., 'Ensure code coverage meets the minimum threshold.'"},owner:{name:"Check owner",selectLabel:"Assign an owner"}},rulesStep:{rules:{name:"Check rules",description:"Define the rules the check will verify."},messages:{name:"Pass/Fail messages (Optional)",description:"Add the messages for check success and failure.",passMessagePlaceholder:"Enter pass message...",failMessagePlaceholder:"Enter fail message...",passedTabName:"Passed Message",failedTabName:"Failed Message"},warnings:{name:"Enable warnings",description:"Enable to classify failures as warnings, so they don\u2019t impact certification.",label:"Warning"}},filter:{description:'Setting the filters below will limit the scope of the Check so that only those Entities that match the filter will be monitored by the Check. As an example, choosing a "Kind" of "Component" will make this Check only apply to Entities whose Kind is indeed set to "Component". This would exclude Entities like Groups, Users, APIs, etc. from being impacted by the Check.'},schedule:{description:"Checks are automatically triggered whenever a dependent fact is updated. When collectors are scheduled, there is generally no need to schedule checks.",checkboxLabel:"Schedule check"}};export{N as CHECK_FIELDS,q as DEFAULT_FORM_VALUES,c as generateJsonPaths,M as mapCheckerToFormValues,f as mapExpressionToRule,x as mapInputScheduleToSchedule,m as mapRuleToExpression,v as mapScheduleToInputSchedule,F as mapToCheckerInput};
1
+ import{FrequencySchema as C}from"@spotify/backstage-plugin-soundcheck-common";import{isObject as R}from"lodash";import{v4 as O}from"uuid";import{mapInputFilterToFormFilters as x,mapCatalogFilterToFormKeyValueFilters as g,mapFiltersToCatalogFilter as h}from"../../Filter/utils.esm.js";import"../../Filter/FilterComponent.esm.js";import{emptyFilters as v,emptyKeyValueFilters as F}from"../../Filter/types.esm.js";import{TimeUnit as w}from"../../Frequency/types.esm.js";import{isTimeUnit as A}from"../../Frequency/util.esm.js";import"../../Frequency/FrequencyComponent.esm.js";import{ExpressionType as l}from"../types/ExpressionType.esm.js";import{defaultSchedule as P}from"../types/Schedule.esm.js";import"../types/Path.esm.js";import{CHECK_NAME_MAX_LENGTH as M}from"./validation.esm.js";const k=e=>{if(R(e)&&"frequency"in e){const r=C.safeParse(e.frequency);if(r.success){const t=r.data;if("cron"in t)return{enabled:!0,frequency:{type:"cron",unit:w.Hours,value:1,cron:t.cron}};const o=Object.keys(t);if(o.length){const s=o[0];if(A(s))return{enabled:!0,frequency:{type:"HumanDuration",unit:s,value:t[s]??1,cron:""}}}}}return{enabled:!1,frequency:{type:"HumanDuration",unit:w.Hours,value:1,cron:""}}},S=(e,r)=>{const{enabled:t,frequency:o}=e;if(t){const{cron:s,type:i,unit:a,value:p}=o;return i==="HumanDuration"?{frequency:{[a]:p},filter:h(r)}:{frequency:{cron:s}}}},m=e=>{if(Array.isArray(e))return e.map(r=>m(r));if(typeof e=="string"){if(e==="true")return!0;if(e==="false")return!1;const r=Number(e);if(!isNaN(r))return r}return e},u=e=>{if(!e)return{};if(e.expressionType){const r={[e.expressionType]:e.conditions?.map(t=>({factRef:t.factRef,path:t.path,operator:t.operatorPrefix?`${t.operatorPrefix}:${t.operator}`:t.operator,value:m(t.value)}))};return e.expressions&&e.expressions.forEach(t=>{r[e.expressionType]?.push(u(t))}),r}if(e.expressions)return e.expressions.map(u);if(e.conditions&&e.conditions.length===1){const r=e.conditions[0];return{factRef:r.factRef,path:r.path,operator:r.operatorPrefix?`${r.operatorPrefix}:${r.operator}`:r.operator,value:m(r.value)}}return{}},T=e=>{if(e?.match(/.:./)){const r=e.split(":");if(["all","any","none"].includes(r[0]))return{operator:r[1],operatorPrefix:r[0]}}return{}},y=(e,r=!0)=>{if(!e)return{conditions:[]};const t=Object.keys(e);let o=t.includes("all")||r&&!t.includes("any")?l.AllOf:l.AnyOf;if(t.includes("not")&&(o=l.Not),t.includes(o)||r){const a=e[o]||[e],p=[],f=[];return a.forEach(n=>{const d=Object.keys(n);if(d.includes("all")||d.includes("any")||d.includes("not"))f.push(y(n,!1));else{const{operator:b,operatorPrefix:E}=T(n.operator);p.push({factRef:n.factRef,path:n.path,operator:b??n.operator,value:n.value,operatorPrefix:E})}}),{expressions:f.length>0?f:void 0,conditions:p,expressionType:o}}const{operator:s,operatorPrefix:i}=T(e.operator);return{expressionType:l.AllOf,conditions:[{factRef:e.factRef,path:e.path,operator:s??e.operator,value:e.value,operatorPrefix:i}]}},V=e=>({detailsStep:{name:e.name??"",description:e.description??"",ownerEntityRef:e.ownerEntityRef??"",type:e.type??"default"},rulesStep:{pathResolver:e.pathResolver??"jsonpath",expressions:y(e.rule),passedMessage:e.passedMessage??void 0,failedMessage:e.failedMessage??void 0,warning:e.warning??!1},filtersStep:{filter:x(e.filter),keyValueFilter:g(e.filter),excludeFilter:x(e.exclude),excludeKeyValueFilter:g(e.exclude)},scheduleStep:{schedule:k(e.schedule)}}),N=(e,r)=>{const{detailsStep:t,rulesStep:o,filtersStep:s,scheduleStep:i}=e;return{id:r?r.id:O(),ownerEntityRef:t.ownerEntityRef??void 0,name:t.name,description:t.description,pathResolver:o.pathResolver,passedMessage:o.passedMessage??void 0,failedMessage:o.failedMessage??void 0,rule:t.type==="manual"?void 0:u(o.expressions),warning:o.warning??!1,filter:s.filter||s.keyValueFilter?h(s.filter,s.keyValueFilter):void 0,exclude:s.excludeFilter||s.excludeKeyValueFilter?h(s.excludeFilter,s.excludeKeyValueFilter):void 0,schedule:S(i.schedule,s.filter),type:t.type}},c=(e,r="$")=>{const t=[];if(e.type==="object"&&e.properties){const o=e.properties;for(const s in o)if(o.hasOwnProperty(s)){const i=`${r}.${s}`;t.push(i);const a=o[s];t.push(...c(a,i))}}if(e.type==="array"&&e.items){const o=`${r}[*]`;t.push(o);const s=Array.isArray(e.items)?e.items:[e.items];for(const i of s)t.push(...c(i,o))}if(e.oneOf){const o=Array.isArray(e.oneOf)?e.oneOf:[e.oneOf];for(const s of o)t.push(...c(s,r))}if(e.allOf){const o=Array.isArray(e.allOf)?e.allOf:[e.allOf];for(const s of o)t.push(...c(s,r))}return[...new Set(t)]},q={detailsStep:{name:"",description:"",ownerEntityRef:"",type:"default"},rulesStep:{pathResolver:"jsonpath",expressions:{expressionType:l.AllOf,expressions:void 0,conditions:[{factRef:"",path:"",operator:"",operatorPrefix:"",value:"",conditions:[]}]},warning:!1},filtersStep:{filter:v(),keyValueFilter:F(),excludeFilter:v(),excludeKeyValueFilter:F()},scheduleStep:{schedule:P()}},K={details:{name:{name:"Check name",helperText:`Max ${M} characters`,placeholder:"Name your check (e.g., 'Code Coverage\u2019)"},description:{name:"Check description",placeholder:"Describe your check clearly so others understand its purpose. e.g., 'Ensure code coverage meets the minimum threshold.'"},owner:{name:"Check owner",selectLabel:"Assign an owner"},type:{name:"Check Type",selectLabel:"Choose the type of check."}},rulesStep:{rules:{name:"Check rules",description:"Define the rules the check will verify."},messages:{name:"Pass/Fail messages (Optional)",description:"Add the messages for check success and failure.",passMessagePlaceholder:"Enter pass message...",failMessagePlaceholder:"Enter fail message...",passedTabName:"Passed Message",failedTabName:"Failed Message"},warnings:{name:"Enable warnings",description:"Enable to classify failures as warnings, so they don\u2019t impact certification.",label:"Warning"}},filter:{description:`Use the filters below to narrow the scope of the Check. Only Entities that match the selected include and exclude filters will be applicable to the Check. Exclude filters must be used with with an include filter.
2
+ For example, selecting an include filter of 'Kind' as 'Component' and an exclude filter of 'Type' as 'Service' will select all entities with kind Component where type is NOT Service.`},schedule:{description:"Checks are automatically triggered whenever a dependent fact is updated. When collectors are scheduled, there is generally no need to schedule checks.",checkboxLabel:"Schedule check"}};export{K as CHECK_FIELDS,q as DEFAULT_FORM_VALUES,c as generateJsonPaths,V as mapCheckerToFormValues,u as mapExpressionToRule,k as mapInputScheduleToSchedule,y as mapRuleToExpression,S as mapScheduleToInputSchedule,N as mapToCheckerInput};
2
3
  //# sourceMappingURL=checkFormUtils.esm.js.map
@@ -1,2 +1,2 @@
1
- import{CheckMessagingSchema as c,CheckDetailsSchema as p,parseFactRef as l}from"@spotify/backstage-plugin-soundcheck-common";import{z as e}from"zod";import{FiltersSchema as m,FrequencySchema as f}from"../../../utils/validation.esm.js";import{ExpressionType as t}from"../types/ExpressionType.esm.js";import"../../Frequency/types.esm.js";import"../../Frequency/util.esm.js";import"../../Frequency/FrequencyComponent.esm.js";import"../types/Path.esm.js";const i=r=>{try{return l(r),!0}catch{return"Invalid fact reference. [source]:[scope]/[name]."}},u=100,o=async r=>{if(!await i(r))throw new Error("Fact reference validation failed");return r},a=e.union([e.string().min(1,"Required"),e.number(),e.boolean()]),n=e.lazy(()=>e.strictObject({factRef:e.string().refine(o,{message:"Valid format: [source]:[scope]/[name]"}),path:e.string().min(1,"Required"),operator:e.string().min(1,"Required"),operatorPrefix:e.string().optional().nullable(),value:a.or(e.array(a).min(1,"Required")).or(e.strictObject({factRef:e.string().refine(o,{message:"Valid format: [source]:[scope]/[name]"}),path:e.string().min(1,"Required")})),conditions:e.array(n).optional()})),s=e.lazy(()=>e.strictObject({expressionType:e.enum([t.AllOf,t.AnyOf,t.Not]).optional(),expressions:e.array(s).optional(),conditions:e.array(n).optional()})),d=e.strictObject({expressions:s,pathResolver:e.string().optional()}).merge(c),h=e.strictObject({filter:m.optional()}),b=e.strictObject({enabled:e.boolean(),frequency:f}),g=e.strictObject({schedule:b.optional()}),y=e.strictObject({detailsStep:p,rulesStep:d,filtersStep:h,scheduleStep:g});export{u as CHECK_NAME_MAX_LENGTH,y as checkFormSchema,i as validateFactRef};
1
+ import{CheckMessagingSchema as p,DefaultCheckDetailsSchema as m,ManualCheckDetailsSchema as f,parseFactRef as u}from"@spotify/backstage-plugin-soundcheck-common";import{z as e}from"zod";import{FrequencySchema as d,formFiltersSchema as a}from"../../../utils/validation.esm.js";import{ExpressionType as r}from"../types/ExpressionType.esm.js";import"../../Frequency/types.esm.js";import"../../Frequency/util.esm.js";import"../../Frequency/FrequencyComponent.esm.js";import"../types/Path.esm.js";const i=t=>{try{return u(t),!0}catch{return"Invalid fact reference. [source]:[scope]/[name]."}},h=100,o=async t=>{if(!await i(t))throw new Error("Fact reference validation failed");return t},n=e.union([e.string().min(1,"Required"),e.number(),e.boolean()]),s=e.lazy(()=>e.strictObject({factRef:e.string().refine(o,{message:"Valid format: [source]:[scope]/[name]"}),path:e.string().min(1,"Required"),operator:e.string().min(1,"Required"),operatorPrefix:e.string().optional().nullable(),value:n.or(e.array(n).min(1,"Required")).or(e.strictObject({factRef:e.string().refine(o,{message:"Valid format: [source]:[scope]/[name]"}),path:e.string().min(1,"Required")})),conditions:e.array(s).optional()})),c=e.lazy(()=>e.strictObject({expressionType:e.enum([r.AllOf,r.AnyOf,r.Not]).optional(),expressions:e.array(c).optional(),conditions:e.array(s).optional()})),S=e.strictObject({expressions:c,pathResolver:e.string().optional()}).merge(p),y=e.strictObject({enabled:e.boolean(),frequency:d}),l=e.strictObject({schedule:y.optional()}),b=e.strictObject({detailsStep:m,rulesStep:S,filtersStep:a,scheduleStep:l}),g=e.strictObject({detailsStep:f,rulesStep:e.any(),filtersStep:a,scheduleStep:l});export{h as CHECK_NAME_MAX_LENGTH,b as defaultCheckFormSchema,g as manualCheckFormSchema,i as validateFactRef};
2
2
  //# sourceMappingURL=validation.esm.js.map
@@ -1,2 +1,2 @@
1
- import{withStyles as r}from"@material-ui/core";import i from"@material-ui/icons/Check";import c from"@material-ui/icons/Close";import n from"@material-ui/icons/HelpOutline";import l from"@material-ui/icons/RemoveCircleOutline";import p from"@material-ui/icons/ReportProblemOutlined";import o from"react";import{ResultState as a}from"../../graphql/generated/index.esm.js";import{resultToText as s}from"../../text.esm.js";const f=r(e=>({root:{color:e.palette.success.main}}))(i),d=r(e=>({root:{color:e.palette.error.main}}))(c),u=r(e=>({root:{color:e.palette.warning.main}}))(p),E=r(e=>({root:{color:e.palette.text.primary}}))(n),N=r(e=>({root:{color:e.palette.text.disabled}}))(l),b=r(e=>({root:{color:e.palette.error.main}}))(l),x=({result:e,className:m})=>{const t={className:m,"aria-label":s(e),"aria-hidden":!1};return e===a.Passed?o.createElement(f,{...t}):e===a.NotReported?o.createElement(E,{...t}):e===a.Failed?o.createElement(d,{...t}):e===a.Warning?o.createElement(u,{...t}):e===a.NotApplicable?o.createElement(N,{...t}):e===a.Error?o.createElement(b,{...t}):null};export{x as CheckIcon};
1
+ import{withStyles as r}from"@material-ui/core";import i from"@material-ui/icons/Check";import c from"@material-ui/icons/Close";import p from"@material-ui/icons/HelpOutline";import n from"@material-ui/icons/NotInterested";import l from"@material-ui/icons/RemoveCircleOutline";import s from"@material-ui/icons/ReportProblemOutlined";import o from"react";import{ResultState as a}from"../../graphql/generated/index.esm.js";import{resultToText as d}from"../../text.esm.js";const f=r(e=>({root:{color:e.palette.success.main}}))(i),E=r(e=>({root:{color:e.palette.error.main}}))(c),u=r(e=>({root:{color:e.palette.warning.main}}))(s),x=r(e=>({root:{color:e.palette.text.primary}}))(p),b=r(e=>({root:{color:e.palette.text.disabled}}))(l),N=r(e=>({root:{color:e.palette.text.disabled}}))(n),g=r(e=>({root:{color:e.palette.error.main}}))(l),h=({result:e,className:m})=>{const t={className:m,"aria-label":d(e),"aria-hidden":!1};return e===a.Passed?o.createElement(f,{...t}):e===a.NotReported?o.createElement(x,{...t}):e===a.Failed?o.createElement(E,{...t}):e===a.Warning?o.createElement(u,{...t}):e===a.NotApplicable?o.createElement(b,{...t}):e===a.Exempt?o.createElement(N,{...t}):e===a.Error?o.createElement(g,{...t}):null};export{h as CheckIcon};
2
2
  //# sourceMappingURL=CheckIcon.esm.js.map
@@ -1,2 +1,2 @@
1
- import{useTheme as E}from"@material-ui/core";import g from"@material-ui/lab/Skeleton";import{DateTime as x}from"luxon";import t from"react";import{LineChart as I,CartesianGrid as A,XAxis as C,YAxis as m,Label as s,Line as r}from"recharts";import{useCheckStatusHistory as v}from"../../hooks/aggregations/useCheckStatusHistory.esm.js";import{ChartWrapper as K}from"../Charts/ChartWrapper/ChartWrapper.esm.js";import"../Charts/LineChart/LineChart.esm.js";import"../Charts/ChartTypes.esm.js";import"../Charts/chartUtils.esm.js";import"../TechHealthSummary/SummaryAggregationsProvider.esm.js";import"@backstage/catalog-model";import"../Charts/BarChart/BarChart.esm.js";const W=({checkId:i,trackId:d,checkStatus:a,filter:c,states:l})=>{const e=E(),{data:n,isLoading:p}=v({checkId:i,trackId:d,filter:c,states:l,numberOfDays:30},!!i&&!!a);if(!a||p)return t.createElement(g,{variant:"rect",width:"100%",height:"100%"});const y=n?.history.every(({notReported:o})=>o>=0);return t.createElement(K,{height:"90%"},t.createElement(I,{data:n?.history??[],margin:{top:0,right:0,left:0,bottom:0}},t.createElement(A,{stroke:e.palette.divider,verticalPoints:[]}),t.createElement(C,{dataKey:"date",tickFormatter:o=>x.fromISO(o).toFormat("MMM d"),allowDuplicatedCategory:!1,height:40,tick:({x:o,y:h,fill:f,payload:k,tickFormatter:u})=>t.createElement("g",{transform:`translate(${o},${h})`},t.createElement("text",{x:0,y:0,dy:16,textAnchor:"end",fill:f,transform:"rotate(-20)",fontSize:12},u(k.value)))}),t.createElement(m,{yAxisId:"percentage",orientation:"right",domain:[0,100]},t.createElement(s,{value:"Percentage",position:"center",angle:90})),t.createElement(m,{yAxisId:"count",domain:[0,a?.numberOfEntities??0]},t.createElement(s,{value:"Count",position:"center",angle:270,offset:2})),t.createElement(r,{type:"monotone",dataKey:"passed",stroke:e.palette.success.main,yAxisId:"count",strokeWidth:2,dot:!1}),t.createElement(r,{type:"monotone",dataKey:"failed",stroke:e.palette.error.main,yAxisId:"count",strokeWidth:2,dot:!1}),t.createElement(r,{type:"monotone",dataKey:"warning",stroke:e.palette.warning.main,yAxisId:"count",strokeWidth:2,dot:!1}),t.createElement(r,{type:"monotone",dataKey:"notApplicable",stroke:e.palette.text.disabled,yAxisId:"count",strokeWidth:2,dot:!1}),t.createElement(r,{type:"monotone",dataKey:"error",stroke:e.palette.error.light,yAxisId:"count",strokeWidth:2,dot:!1}),y&&t.createElement(r,{type:"monotone",dataKey:"notReported",stroke:e.palette.info.main,yAxisId:"count",strokeWidth:2,dot:!1})))};export{W as CheckStatusHistoryChart};
1
+ import{useTheme as E}from"@material-ui/core";import g from"@material-ui/lab/Skeleton";import{DateTime as x}from"luxon";import t from"react";import{LineChart as I,CartesianGrid as A,XAxis as C,YAxis as m,Label as s,Line as r}from"recharts";import{useCheckStatusHistory as K}from"../../hooks/aggregations/useCheckStatusHistory.esm.js";import{ChartWrapper as W}from"../Charts/ChartWrapper/ChartWrapper.esm.js";import"../Charts/LineChart/LineChart.esm.js";import"../Charts/ChartTypes.esm.js";import"../Charts/chartUtils.esm.js";import"../TechHealthSummary/SummaryAggregationsProvider.esm.js";import"@backstage/catalog-model";import"../Charts/BarChart/BarChart.esm.js";const v=({checkId:n,trackId:d,checkStatus:a,filter:c,states:l})=>{const e=E(),{data:i,isLoading:p}=K({checkId:n,trackId:d,filter:c,states:l,numberOfDays:30},!!n&&!!a);if(!a||p)return t.createElement(g,{variant:"rect",width:"100%",height:"100%"});const y=i?.history.every(({notReported:o})=>o>=0);return t.createElement(W,{height:"90%"},t.createElement(I,{data:i?.history??[],margin:{top:0,right:0,left:0,bottom:0}},t.createElement(A,{stroke:e.palette.divider,verticalPoints:[]}),t.createElement(C,{dataKey:"date",tickFormatter:o=>x.fromISO(o).toFormat("MMM d"),allowDuplicatedCategory:!1,height:40,tick:({x:o,y:h,fill:k,payload:f,tickFormatter:u})=>t.createElement("g",{transform:`translate(${o},${h})`},t.createElement("text",{x:0,y:0,dy:16,textAnchor:"end",fill:k,transform:"rotate(-20)",fontSize:12},u(f.value)))}),t.createElement(m,{yAxisId:"percentage",orientation:"right",domain:[0,100]},t.createElement(s,{value:"Percentage",position:"center",angle:90})),t.createElement(m,{yAxisId:"count",domain:[0,a?.numberOfEntities??0]},t.createElement(s,{value:"Count",position:"center",angle:270,offset:2})),t.createElement(r,{type:"monotone",dataKey:"passed",stroke:e.palette.success.main,yAxisId:"count",strokeWidth:2,dot:!1}),t.createElement(r,{type:"monotone",dataKey:"failed",stroke:e.palette.error.main,yAxisId:"count",strokeWidth:2,dot:!1}),t.createElement(r,{type:"monotone",dataKey:"warning",stroke:e.palette.warning.main,yAxisId:"count",strokeWidth:2,dot:!1}),t.createElement(r,{type:"monotone",dataKey:"notApplicable",stroke:e.palette.text.disabled,yAxisId:"count",strokeWidth:2,dot:!1}),t.createElement(r,{type:"monotone",dataKey:"error",stroke:e.palette.error.light,yAxisId:"count",strokeWidth:2,dot:!1}),t.createElement(r,{type:"monotone",dataKey:"exempt",stroke:e.palette.warning.light,yAxisId:"count",strokeWidth:2,dot:!1}),y&&t.createElement(r,{type:"monotone",dataKey:"notReported",stroke:e.palette.info.main,yAxisId:"count",strokeWidth:2,dot:!1})))};export{v as CheckStatusHistoryChart};
2
2
  //# sourceMappingURL=CheckStatusHistoryChart.esm.js.map
@@ -1,2 +1,2 @@
1
- import{ResultState as e}from"../../graphql/generated/index.esm.js";const t=r=>{switch(r){case"PASSED":return e.Passed;case"FAILED":return e.Failed;case"WARNING":return e.Warning;case"NOT_APPLICABLE":return e.NotApplicable;case"NOT_REPORTED":return e.NotReported;case"ERROR":return e.Error;default:return}};export{t as toResultState};
1
+ import{ResultState as e}from"../../graphql/generated/index.esm.js";const t=r=>{switch(r){case"PASSED":return e.Passed;case"FAILED":return e.Failed;case"WARNING":return e.Warning;case"NOT_APPLICABLE":return e.NotApplicable;case"NOT_REPORTED":return e.NotReported;case"EXEMPT":return e.Exempt;case"ERROR":return e.Error;default:return}};export{t as toResultState};
2
2
  //# sourceMappingURL=utils.esm.js.map
@@ -0,0 +1,2 @@
1
+ import{zodResolver as E}from"@hookform/resolvers/zod";import{makeStyles as S,Paper as P,Divider as l}from"@material-ui/core";import e,{useCallback as k}from"react";import{useForm as B,FormProvider as A}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 I}from"../../../../hooks/collectors/useUpdateCollectorConfig.esm.js";import{integrationsPageRouteRef as N}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 q}from"../../../SoundcheckHeader/useHeader.esm.js";import{FactCollectionConfig as r}from"../Common/FactCollectionConfig.esm.js";import{defaultCollectorOption as s}from"../Common/CollectorOption.esm.js";import{collectorHeaderContent as z,confirmationModalContent as w}from"../Common/utils.esm.js";import{NumberOfDaysComponent as p}from"./NumberOfDaysComponent.esm.js";import{NumberOfWorkItemsComponent as M}from"./NumberOfWorkItemsComponent.esm.js";import{mapConfigToAzureDevOpsCollectorConfig as T,defaultAzureDevOpsConfig as x,numberOfDaysCollectorConfig as b,numberOfWorkItemsCollectorConfig as H,mapAzureDevOpsCollectorConfigToConfig as L}from"./utils.esm.js";import{azureDevOpsCollectorFormSchema as V}from"./validation.esm.js";const j=S(o=>({spacer:{height:o.spacing(8),width:"100%"},section:{marginBottom:o.spacing(2)}})),U=({disabled:o,selectedCollector:n})=>{const d=k(async(t,...a)=>{const i={enabled:!1,collectors:[]},D={repositoryDetails:t.repositoryDetails.enabled?t.repositoryDetails:s(),branchPolicies:t.branchPolicies.enabled?t.branchPolicies:s(),branchStatus:t.branchStatus.enabled?t.branchStatus:s(),numberOfBranches:t.numberOfBranches.enabled?t.numberOfBranches:i,numberOfActivePullRequests:t.numberOfActivePullRequests.enabled?t.numberOfActivePullRequests:i,numberOfWorkItems:t.numberOfWorkItems.enabled?t.numberOfWorkItems:i};return E(V)(D,...a)},[]),m=B({defaultValues:n?T(n.config):x(),mode:"onChange",resolver:d}),{formState:{isValid:C},handleSubmit:c}=m,u=j(),h=!C,{mutateAsync:g}=I(),[O,y]=R(N),{showModal:v}=F(),f=async t=>{if(!await v(w(n)))return;const a=L(t);await g({collectorId:n.id,config:a})&&y()};return q(z(n)),e.createElement(e.Fragment,null,e.createElement(P,{className:u.section},e.createElement(A,{...m},e.createElement("form",{onSubmit:c(f)},e.createElement(r,{name:"repositoryDetails",label:"Repository Details",description:"Collects details about an entity's repository.",disabled:o}),e.createElement(l,null),e.createElement(r,{name:"branchPolicies",label:"Branch Policies",description:"Collects branch policies information from an entity's repository.",disabled:o}),e.createElement(l,null),e.createElement(r,{name:"branchStatus",label:"Branch Status",description:"Collects the latest branch status information from an entity's repository.",disabled:o}),e.createElement(l,null),e.createElement(r,{name:"numberOfBranches",label:"Number Of Branches",description:"Collects the number of branches from an entity's repository.",disabled:o,FactDetailsComponent:p,multipleCollectors:{enable:!0,defaultConfig:b()}}),e.createElement(l,null),e.createElement(r,{name:"numberOfActivePullRequests",label:"Number Of Active Pull Requests",description:"Collects the number of active pull requests from an entity's repository.",disabled:o,FactDetailsComponent:p,multipleCollectors:{enable:!0,defaultConfig:b()}}),e.createElement(l,null),e.createElement(r,{name:"numberOfWorkItems",label:"Number Of Work Items",description:"Collects the number of work items from an entity's project.",disabled:o,FactDetailsComponent:M,multipleCollectors:{enable:!0,defaultConfig:H()}})))),e.createElement("div",{className:u.section},e.createElement(W,{onCancel:O,saveButtonText:"Save",isLoading:!1,onSave:c(f),disableSave:h})))};export{U as AzureDevOpsConfigurator};
2
+ //# sourceMappingURL=AzureDevOpsConfigurator.esm.js.map
@@ -0,0 +1,2 @@
1
+ import{makeStyles as u,Grid as l,Typography as i,TextField as c}from"@material-ui/core";import e from"react";import{useFormContext as h,Controller as p}from"react-hook-form";const g=u(t=>({root:{paddingTop:t.spacing(1)},textInput:{marginTop:0,width:"450px"},helperText:{marginLeft:0}})),f=({name:t,disabled:s})=>{const r=g(),{control:m}=h();return e.createElement(l,{container:!0,className:r.root,spacing:0,direction:"column"},e.createElement(p,{name:`${t}.factName`,control:m,render:({field:n,fieldState:{error:o}})=>e.createElement(l,{item:!0},e.createElement(i,{variant:"subtitle2"},"Fact Name"),e.createElement(c,{...n,type:"text",variant:"outlined",margin:"dense",placeholder:"Fact Name",className:r.textInput,disabled:s,error:!!o,helperText:o?.message??"Fact name must be unique",FormHelperTextProps:{className:r.helperText}}))}),e.createElement(p,{name:`${t}.numberOfDays`,control:m,render:({field:n,fieldState:{error:o}})=>e.createElement(l,{item:!0},e.createElement(i,{variant:"subtitle2"},t.startsWith("numberOfBranches")?"Last Commit More Than X Days Ago (Optional)":"Created More Than X Days Ago (Optional)"),e.createElement(c,{...n,onChange:a=>{if(a.target.value){const d=parseInt(a.target.value,10)??null;n.onChange({...a,target:{...a.target,value:d}})}else n.onChange({...a,target:{...a.target,value:null}})},type:"number",variant:"outlined",margin:"dense",placeholder:"Number Of Days",className:r.textInput,disabled:s,error:!!o,helperText:o?.message??(t.startsWith("numberOfBranches")?"If not provided collects a total number of branches in the entity's repository":"If not provided collects a total number of active pull requests that target the default branch in the entity's repository"),FormHelperTextProps:{className:r.helperText}}))}))};export{f as NumberOfDaysComponent};
2
+ //# sourceMappingURL=NumberOfDaysComponent.esm.js.map
@@ -0,0 +1,2 @@
1
+ import{makeStyles as h,Box as b,Grid as o,Typography as s,TextField as u,FormHelperText as y,IconButton as g}from"@material-ui/core";import I from"@material-ui/icons/Add";import T from"@material-ui/icons/Remove";import v from"classnames";import{highlight as N,languages as C}from"prismjs";import"prismjs/components/prism-sql";import e from"react";import{useFormContext as q,useFieldArray as F,Controller as c}from"react-hook-form";import k from"react-simple-code-editor";import{FormFieldLabel as S}from"../../../FormFieldLabel/FormFieldLabel.esm.js";import*as L from"../Common/css/prism-dark-sql.css.esm.js";import{numberOfWorkItemsDataConfig as $}from"./utils.esm.js";const w=h(t=>({...L,root:{paddingTop:t.spacing(1)},factNameInput:{marginTop:0,width:"450px"},labelInput:{marginTop:0,width:"255px"},labelInputArea:{height:"40px"},queryInput:{marginTop:0,width:"420px",minHeight:"40px",maxHeight:"300px",overflowY:"scroll",outline:`1px solid ${t.palette.action.disabled}`,borderRadius:"4px",display:"grid","&:hover":{outlineColor:t.palette.textContrast}},queryInputError:{outlineColor:t.palette.error.main,"&:hover":{outlineColor:t.palette.error.main}},queryTextarea:{outline:"none"},helperText:{marginLeft:0},caption:{margin:t.spacing(2,0)}})),H=({name:t,disabled:n})=>{const r=w(),{control:m}=q(),{fields:d,insert:x,remove:E}=F({control:m,name:`${t}.data`});return e.createElement(b,{className:r.root},e.createElement(c,{name:`${t}.factName`,control:m,render:({field:p,fieldState:{error:a}})=>e.createElement(o,{item:!0},e.createElement(s,{variant:"subtitle2"},"Fact Name"),e.createElement(u,{...p,type:"text",variant:"outlined",margin:"dense",placeholder:"Fact Name",className:r.factNameInput,disabled:n,error:!!a,helperText:a?.message??"Fact name must be unique",FormHelperTextProps:{className:r.helperText}}))}),e.createElement("div",{className:r.caption},e.createElement(s,{variant:"subtitle1"},"Queries"),e.createElement(s,{variant:"caption"},"List the WIQL syntax queries to filter work items by")),e.createElement(o,{container:!0,spacing:0,direction:"column"},d.map((p,a)=>e.createElement(o,{item:!0,container:!0,spacing:2,key:p.id},e.createElement(o,{item:!0},e.createElement(s,{variant:"subtitle2"},"Label"),e.createElement(c,{name:`${t}.data.${a}.name`,control:m,render:({field:i,fieldState:{error:l}})=>e.createElement(u,{...i,type:"text",variant:"outlined",margin:"dense",placeholder:"Label",className:r.labelInput,disabled:n,error:!!l,helperText:l?.message??" ",InputProps:{className:r.labelInputArea},FormHelperTextProps:{className:r.helperText}})})),e.createElement(o,{item:!0},e.createElement(S,{title:"WIQL Query",docLink:"https://learn.microsoft.com/en-us/azure/devops/boards/queries/wiql-syntax?view=azure-devops"}),e.createElement(c,{name:`${t}.data.${a}.query`,control:m,render:({field:i,fieldState:{error:l}})=>e.createElement(e.Fragment,null,e.createElement("div",{className:v(r.queryInput,l?r.queryInputError:void 0)},e.createElement(k,{...i,highlight:f=>N(f,C.sql,"sql"),onValueChange:i.onChange,padding:10,disabled:n,placeholder:"Example: SELECT [System.Id] FROM WorkItem",textareaClassName:r.queryTextarea})),e.createElement(y,{className:r.helperText,error:!!l},l?.message??" "))})),e.createElement(o,{item:!0,alignContent:"center"},e.createElement(g,{onClick:()=>E(a),disabled:n||d.length===1},e.createElement(T,{fontSize:"small"})),e.createElement(g,{onClick:()=>x(a+1,$()),disabled:n},e.createElement(I,{fontSize:"small"})))))))};export{H as NumberOfWorkItemsComponent};
2
+ //# sourceMappingURL=NumberOfWorkItemsComponent.esm.js.map
@@ -0,0 +1,2 @@
1
+ import{asArray as A}from"@spotify/backstage-plugin-soundcheck-common";import{defaultBaseCollectorOption as h,defaultCollectorOption as C}from"../Common/CollectorOption.esm.js";import{mapBackendConfigToFormIntegrationConfig as i,mapFormIntegrationConfigToBackendConfig as m}from"../Common/utils.esm.js";const d="repository_details",_="branch_policies",T="branch_status",u="number_of_branches",O="number_of_active_pull_requests",b="number_of_work_items",g="count",y="SELECT [System.Id] FROM WorkItem",E=(a,t)=>({...h(),factDetails:{factName:a??"",numberOfDays:t}}),D=(a,t)=>({name:a??"",query:t??""}),R=(a,t,f)=>({...h(),factDetails:{factName:a??"",data:[D(t,f)]}}),N=()=>({repositoryDetails:C(),branchPolicies:C(),branchStatus:C(),numberOfBranches:{enabled:!1,collectors:[E(u)]},numberOfActivePullRequests:{enabled:!1,collectors:[E(O)]},numberOfWorkItems:{enabled:!1,collectors:[R(b,g,y)]}});function L(a){const{repositoryDetails:t,branchPolicies:f,branchStatus:o,numberOfBranches:r,numberOfActivePullRequests:l,numberOfWorkItems:s}=a;if(t.enabled||f.enabled||o.enabled||r.enabled||l.enabled||s.enabled){const p={},c=[];return p.collects=c,t.enabled&&c.push(m({factType:d,configOption:t})),f.enabled&&c.push(m({factType:_,configOption:f})),o.enabled&&c.push(m({factType:T,configOption:o})),r.enabled&&r.collectors.forEach(n=>{c.push(m({factType:u,configOption:n,additionalParams:{factName:n.factDetails.factName,lastCommitMoreThanXDaysAgo:n.factDetails.numberOfDays?n.factDetails.numberOfDays:void 0}}))}),l.enabled&&l.collectors.forEach(n=>{c.push(m({factType:O,configOption:n,additionalParams:{factName:n.factDetails.factName,createdMoreThanXDaysAgo:n.factDetails.numberOfDays?n.factDetails.numberOfDays:void 0}}))}),s.enabled&&s.collectors.forEach(n=>{c.push(m({factType:b,configOption:n,additionalParams:{factName:n.factDetails.factName,data:n.factDetails.data}}))}),p}return{collects:[]}}function P(a){const t=N();if(a){const f=a.collects;if(f){const o=A(f),r=o.find(e=>e.type===d);r&&(t.repositoryDetails={...i({parentConfig:a,factTypeConfig:r}),enabled:!0});const l=o.find(e=>e.type===_);l&&(t.branchPolicies={...i({parentConfig:a,factTypeConfig:l}),enabled:!0});const s=o.find(e=>e.type===T);s&&(t.branchStatus={...i({parentConfig:a,factTypeConfig:s}),enabled:!0});const p=o.filter(e=>e.type===u);p.length&&(t.numberOfBranches={enabled:!0,collectors:p.map(e=>({...i({parentConfig:a,factTypeConfig:e}),factDetails:{factName:e.factName??u,numberOfDays:e.lastCommitMoreThanXDaysAgo}}))});const c=o.filter(e=>e.type===O);c.length&&(t.numberOfActivePullRequests={enabled:!0,collectors:c.map(e=>({...i({parentConfig:a,factTypeConfig:e}),factDetails:{factName:e.factName??O,numberOfDays:e.createdMoreThanXDaysAgo}}))});const n=o.filter(e=>e.type===b);n.length&&(t.numberOfWorkItems={enabled:!0,collectors:n.map(e=>({...i({parentConfig:a,factTypeConfig:e}),factDetails:{factName:e.factName??b,data:e.data?.length?e.data:[D(g,y)]}}))})}}return t}export{_ as BRANCH_POLICIES_COLLECTOR_TYPE,T as BRANCH_STATUS_COLLECTOR_TYPE,g as DEFAULT_NUMBER_OF_WORK_ITEMS_NAME,y as DEFAULT_NUMBER_OF_WORK_ITEMS_QUERY,O as NUMBER_OF_ACTIVE_PULL_REQUESTS_COLLECTOR_TYPE,u as NUMBER_OF_BRANCHES_COLLECTOR_TYPE,b as NUMBER_OF_WORK_ITEMS_COLLECTOR_TYPE,d as REPOSITORY_DETAILS_COLLECTOR_TYPE,N as defaultAzureDevOpsConfig,L as mapAzureDevOpsCollectorConfigToConfig,P as mapConfigToAzureDevOpsCollectorConfig,E as numberOfDaysCollectorConfig,R as numberOfWorkItemsCollectorConfig,D as numberOfWorkItemsDataConfig};
2
+ //# sourceMappingURL=utils.esm.js.map