@spotify/backstage-plugin-soundcheck 0.16.3 → 0.18.0
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.
- package/CHANGELOG.md +63 -0
- package/config.d.ts +14 -0
- package/dist/alpha/integrations.esm.js +2 -0
- package/dist/alpha/pages.esm.js +1 -1
- package/dist/alpha/plugin.esm.js +1 -1
- package/dist/alpha.d.ts +252 -17
- package/dist/api.esm.js +1 -1
- package/dist/blueprints/IntegrationPageBlueprint.esm.js +2 -0
- package/dist/components/Badges/LevelBadge.esm.js +1 -1
- package/dist/components/CampaignForm/hooks/utils.esm.js +1 -1
- package/dist/components/CampaignInsightsPage/CampaignInsightsPage.esm.js +1 -1
- package/dist/components/CampaignInsightsPage/CampaignStatusHistoryTile.esm.js +1 -1
- package/dist/components/CampaignsPage/CampaignListPage/CampaignListPage.esm.js +1 -1
- package/dist/components/CertificationSidebar/ExemptionJustificationDialog.esm.js +1 -1
- package/dist/components/CertificationsPage/CertificationTab.esm.js +1 -1
- package/dist/components/CertificationsPage/CertificationTabs.esm.js +1 -1
- package/dist/components/CheckDetails/CheckResultDetails.esm.js +1 -1
- package/dist/components/CheckDetails/FixMeDialog.esm.js +1 -1
- package/dist/components/CheckDetails/ResultStateBox.esm.js +1 -1
- package/dist/components/CheckDryRun/CheckDryRunDetails.esm.js +1 -1
- package/dist/components/CheckForm/FormFields/RuleInput/Conditions/ConditionList.esm.js +1 -1
- package/dist/components/CheckForm/FormFields/RuleInput/Conditions/FactValueDisplay.esm.js +1 -1
- package/dist/components/CheckForm/FormFields/RuleInput/Conditions/RuleConditionInput.esm.js +1 -1
- package/dist/components/CheckForm/FormFields/RuleInput/Expressions/ExpressionBox.esm.js +1 -1
- package/dist/components/CheckForm/FormFields/RuleInput/RuleInputBox.esm.js +1 -1
- package/dist/components/CheckForm/Steps/CheckApplicabilityStep.esm.js +1 -1
- package/dist/components/CheckForm/utils/checkFormUtils.esm.js +2 -2
- package/dist/components/CheckForm/utils/validation.esm.js +1 -1
- package/dist/components/CheckIcon/CheckIcon.esm.js +1 -1
- package/dist/components/CheckPage/CheckEntitiesTable/CheckEntitiesTable.esm.js +1 -1
- package/dist/components/CheckPage/CheckInsightsPage.esm.js +1 -1
- package/dist/components/CheckPage/CheckStatusHistoryChart.esm.js +1 -1
- package/dist/components/CheckPage/ExemptionsTable.esm.js +2 -0
- package/dist/components/ChecksPage/CheckListPage/CheckListPage.esm.js +1 -1
- package/dist/components/CollapsablePanel/CollapsablePanel.esm.js +2 -0
- package/dist/components/CollectorPage/CollectorPage.esm.js +1 -1
- package/dist/components/CollectorPage/Configurators/Common/FactCollectionConfig.esm.js +1 -1
- package/dist/components/CollectorPage/Configurators/HTTP/HttpStatusesInput.esm.js +1 -1
- package/dist/components/CollectorPage/Configurators/PagerDuty/PagerDutyConfigurator.esm.js +1 -1
- package/dist/components/CollectorPage/Configurators/PagerDuty/utils.esm.js +1 -1
- package/dist/components/CollectorsPage/CollectorListPage/CollectorListPage.esm.js +1 -1
- package/dist/components/CollectorsPage/CollectorListPage/CollectorSummaryCard.esm.js +1 -1
- package/dist/components/CollectorsPage/CollectorsPage.esm.js +1 -1
- package/dist/components/EntitiesAutocompletePicker/EntitiesAutocompletePicker.esm.js +1 -1
- package/dist/components/FactExplorer/FactExplorer.esm.js +1 -1
- package/dist/components/FactExplorer/FactExplorerDialog.esm.js +1 -1
- package/dist/components/FactExplorer/useFactOptions.esm.js +1 -1
- package/dist/components/Filter/EntityAutocompletePicker.esm.js +1 -1
- package/dist/components/Filter/FilterComponent.esm.js +1 -1
- package/dist/components/FilterSidebar/FilterSidebar.esm.js +1 -1
- package/dist/components/FilterSidebar/StateFilter.esm.js +1 -1
- package/dist/components/FormControlledAutocomplete/FormControlledMultipleAutocomplete.esm.js +1 -1
- package/dist/components/GroupSelector/GroupSelector.esm.js +1 -1
- package/dist/components/ImportExportPanel/ImportExportPanel.esm.js +2 -0
- package/dist/components/LevelsTable/CheckRowContent.esm.js +1 -1
- package/dist/components/LevelsTable/LevelsTable.esm.js +1 -1
- package/dist/components/MultiSelectFilter/MultiSelectFilter.esm.js +1 -1
- package/dist/components/OverviewPage/OverviewPageHeader.esm.js +1 -1
- package/dist/components/OverviewTable/Cell/CheckCell.esm.js +1 -1
- package/dist/components/OverviewTable/Cell/CheckNameCell.esm.js +1 -1
- package/dist/components/OverviewTable/Cell/TrackCheckStatusCount.esm.js +2 -0
- package/dist/components/OverviewTable/Cell/cellRenderer.esm.js +1 -1
- package/dist/components/OverviewTable/OverviewTableContent.esm.js +1 -1
- package/dist/components/OverviewTable/ResultsTable.esm.js +1 -1
- package/dist/components/OverviewTable/ResultsTableRow.esm.js +1 -1
- package/dist/components/PassingPercentProgressbar/PassPercentageProgressbar.esm.js +2 -0
- package/dist/components/Router.esm.js +1 -1
- package/dist/components/RoutingPage/RoutingPage.esm.js +1 -1
- package/dist/components/RoutingPage/index.esm.js +1 -1
- package/dist/components/SearchFilters/SearchFilters.esm.js +1 -1
- package/dist/components/SendCampaignNotificationDialog/SendCampaignNotificationDialog.esm.js +2 -0
- package/dist/components/SoundcheckDialog/SoundcheckDialog.esm.js +1 -1
- package/dist/components/SoundcheckHeader/headerUtil.esm.js +1 -1
- package/dist/components/SummaryCard/SummaryCard.esm.js +1 -1
- package/dist/components/TechHealth/Filters/FacetFilter.esm.js +1 -1
- package/dist/components/TechHealth/Filters/FilterProvider.esm.js +1 -1
- package/dist/components/TechHealth/Filters/utils.esm.js +1 -1
- package/dist/components/TechInsights/ColorLegend.esm.js +2 -0
- package/dist/components/TechInsights/LoadingOverlay.esm.js +2 -0
- package/dist/components/TechInsights/LowestPerformingTeams.esm.js +2 -0
- package/dist/components/TechInsights/NivoCirclePacking.esm.js +2 -0
- package/dist/components/TechInsights/NivoIcicle.esm.js +2 -0
- package/dist/components/TechInsights/NivoSunburst.esm.js +2 -0
- package/dist/components/TechInsights/NivoTreemap.esm.js +2 -0
- package/dist/components/TechInsights/TeamComparison/CheckComparison.esm.js +2 -0
- package/dist/components/TechInsights/TeamComparison/FailingComponentsTable.esm.js +2 -0
- package/dist/components/TechInsights/TeamComparison/LineChartContainer.esm.js +2 -0
- package/dist/components/TechInsights/TeamComparison/MultiCheckStatusHistoryChart.esm.js +2 -0
- package/dist/components/TechInsights/TeamComparison/MultiTrackHistoryChart.esm.js +2 -0
- package/dist/components/TechInsights/TeamComparison/TeamComparison.esm.js +2 -0
- package/dist/components/TechInsights/TeamComparison/TrackComparison.esm.js +2 -0
- package/dist/components/TechInsights/TeamPerformanceCard.esm.js +2 -0
- package/dist/components/TechInsights/TeamPerformanceListCard.esm.js +2 -0
- package/dist/components/TechInsights/TechInsightsGroupSelector.esm.js +2 -0
- package/dist/components/TechInsights/TechInsightsPage.esm.js +2 -0
- package/dist/components/TechInsights/TechInsightsPage2.esm.js +2 -0
- package/dist/components/TechInsights/TechInsightsSidebar.esm.js +2 -0
- package/dist/components/TechInsights/TechInsightsViewSelector.esm.js +2 -0
- package/dist/components/TechInsights/Tiles/CheckStatusTile.esm.js +2 -0
- package/dist/components/TechInsights/Tiles/TileUtils.esm.js +2 -0
- package/dist/components/TechInsights/Tiles/TrackStatusTile.esm.js +2 -0
- package/dist/components/TechInsights/TopPerformingTeams.esm.js +2 -0
- package/dist/components/TechInsights/TrackCardGrid.esm.js +2 -0
- package/dist/components/TechInsights/TrackCardGridBox.esm.js +2 -0
- package/dist/components/TechInsights/colorContrast.esm.js +2 -0
- package/dist/components/TechInsights/hierarchy/GroupNode.esm.js +2 -0
- package/dist/components/TechInsights/hierarchy/Hierarchy.esm.js +2 -0
- package/dist/components/TechInsights/hierarchy/VirtualRow.esm.js +2 -0
- package/dist/components/TechInsights/hierarchyToNivo.esm.js +2 -0
- package/dist/components/TechInsights/persistence/FavoriteViews.esm.js +2 -0
- package/dist/components/TechInsights/styles.esm.js +2 -0
- package/dist/components/TimePeriodBar/TimePeriodBar.esm.js +2 -0
- package/dist/components/TopFailingChecksTable/TopFailingChecksTable.esm.js +1 -1
- package/dist/components/TrackForm/Steps/TrackDetailsStep/TrackBadgeTypeSelect/TrackBadgeTypeSelect.esm.js +1 -1
- package/dist/components/TrackForm/utils/useTrackForm.esm.js +1 -1
- package/dist/components/TrackPage/TrackEntitiesTable/TrackEntitiesTable.esm.js +1 -1
- package/dist/components/TrackPage/TrackEntitiesTable/TrackStatusChip.esm.js +1 -1
- package/dist/components/TrackPage/TrackEntitiesTable/columns.esm.js +1 -1
- package/dist/components/TrackPage/TrackEntitiesTable/utils.esm.js +1 -1
- package/dist/components/TrackPage/TrackHistoryChart.esm.js +1 -1
- package/dist/components/TrackPage/TrackPage.esm.js +1 -1
- package/dist/components/TrackPage/TrackStatusBar.esm.js +1 -1
- package/dist/components/TrackPage/TrackStatusTable.esm.js +1 -1
- package/dist/components/TracksPage/TrackListPage/TrackListPage.esm.js +1 -1
- package/dist/contexts/UserProvider.esm.js +1 -1
- package/dist/graphql/generated/index.esm.js +283 -79
- package/dist/hooks/aggregations/useCertificationStatusHistories.esm.js +2 -0
- package/dist/hooks/aggregations/useCertificationStatuses.esm.js +2 -0
- package/dist/hooks/aggregations/useCheckStatus.esm.js +1 -1
- package/dist/hooks/aggregations/useCheckStatusByGroups.esm.js +2 -0
- package/dist/hooks/aggregations/useCheckStatusHistoriesMultiFilter.esm.js +2 -0
- package/dist/hooks/campaigns/useCreateCampaign.esm.js +1 -1
- package/dist/hooks/campaigns/useGetCampaigns.esm.js +1 -1
- package/dist/hooks/campaigns/useSendCampaignNotification.esm.js +2 -0
- package/dist/hooks/campaigns/useUpdateCampaign.esm.js +1 -1
- package/dist/hooks/certifications/useTrackOverviewForOwner.esm.js +1 -1
- package/dist/hooks/checks/useCreateCheck.esm.js +1 -1
- package/dist/hooks/checks/useImportChecks.esm.js +2 -0
- package/dist/hooks/checks/useSetManualResult.esm.js +1 -1
- package/dist/hooks/checks/useUpdateCheck.esm.js +1 -1
- package/dist/hooks/collectors/useUpdateCollectorConfig.esm.js +1 -1
- package/dist/hooks/exemptions/useDeleteExemption.esm.js +1 -1
- package/dist/hooks/exemptions/useExemptCheckIds.esm.js +1 -1
- package/dist/hooks/exemptions/useExemptions.esm.js +2 -0
- package/dist/hooks/exemptions/useGetExemption.esm.js +1 -1
- package/dist/hooks/exemptions/useSetEntityExempt.esm.js +1 -1
- package/dist/hooks/facets/useFacetFilters.esm.js +1 -1
- package/dist/hooks/graphqlKeys.esm.js +1 -1
- package/dist/hooks/groups/useAllGroups.esm.js +1 -1
- package/dist/hooks/groups/useUsersGroupClaims.esm.js +1 -1
- package/dist/hooks/heirarchy/useGetDescendentsOfGroups.esm.js +2 -0
- package/dist/hooks/heirarchy/useGroupHierarchy.esm.js +2 -0
- package/dist/hooks/heirarchy/useHierarchicalTrackStatus.esm.js +2 -0
- package/dist/hooks/heirarchy/useRootGroups.esm.js +2 -0
- package/dist/hooks/savedViews/useDeleteView.esm.js +2 -0
- package/dist/hooks/savedViews/useSaveView.esm.js +2 -0
- package/dist/hooks/savedViews/useSavedViews.esm.js +2 -0
- package/dist/hooks/tracks/useCreateTrack.esm.js +1 -1
- package/dist/hooks/tracks/useImportTracks.esm.js +2 -0
- package/dist/hooks/tracks/useUpdateTrack.esm.js +1 -1
- package/dist/index.d.ts +85 -1
- package/dist/index.esm.js +1 -1
- package/dist/utils/colors.esm.js +1 -1
- package/dist/utils/export.esm.js +7 -3
- package/dist/utils/helpers.esm.js +2 -0
- package/dist/utils/validation.esm.js +1 -1
- package/package.json +34 -18
- package/dist/components/CheckForm/FormFields/RuleInput/useRuleInputHandlers.esm.js +0 -2
- package/dist/components/OrgHealth/OrgHealthPage.esm.js +0 -2
- package/dist/components/OverviewTable/Cell/TrackCheckIndicator.esm.js +0 -2
- package/dist/utils/getGroupFilterFromConfig.esm.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as c,jsx as l,Fragment as K}from"react/jsx-runtime";import{makeStyles as w,FormControlLabel as G,Checkbox as
|
|
1
|
+
import{jsxs as c,jsx as l,Fragment as K}from"react/jsx-runtime";import{makeStyles as w,FormControlLabel as G,Checkbox as P,Box as q,Typography as F,Divider as L,Tabs as O,Tab as h,Grid as f,Button as x}from"@material-ui/core";import W from"@material-ui/icons/Add";import E from"@material-ui/icons/Remove";import{useState as H}from"react";import{useFormContext as J,useFieldArray as M,useWatch as Q,Controller as y}from"react-hook-form";import{validateCacheConfig as U}from"../../../../utils/collectors.esm.js";import"lodash";import"../../../Frequency/types.esm.js";import"../../../Frequency/util.esm.js";import"../../../Frequency/FrequencyComponent.esm.js";import{CacheConfigComponent as X}from"../../../CacheConfig/CacheConfigComponent.esm.js";import"@backstage/catalog-model";import"@spotify/backstage-plugin-soundcheck-common";import{FilterComponent as Y}from"../../../Filter/FilterComponent.esm.js";import{CollectorSchedulingOptions as Z}from"./CollectorSchedulingOptions.esm.js";const _=w(e=>({root:{padding:e.spacing(1.5,6)},tabsContainer:{marginRight:16},tab:{height:"64px",textAlign:"left"},contentContainer:{width:"100%",padding:e.spacing(1)},divider:{marginTop:e.spacing(1),marginBottom:e.spacing(1)},checkBox:{marginRight:e.spacing(1)},buttonsContainer:{marginTop:e.spacing(1),marginBottom:e.spacing(2)}})),g="FactDetails",u="Schedule",N="Filters",k="Caching",ee=({name:e,label:C,description:S,disabled:s,FactDetailsComponent:d,multipleCollectors:i})=>{const{control:m,formState:D}=J(),$=D.errors?.[e],{fields:B,insert:V,remove:A}=M({control:m,name:i?.enable?`${e}.collectors`:e}),p=i?.enable?B:[{id:e}],v=d?g:u,[t,b]=H(Array(p.length).fill(v)),T=(r,a,n)=>{b([...t.slice(0,n),a,...t.slice(n+1)])},R=r=>{V(r+1,i?.defaultConfig),b([...t.slice(0,r+1),v,...t.slice(r+1)])},j=r=>{A(r),b([...t.slice(0,r),...t.slice(r+1)])},z=Q({control:m,name:`${e}.enabled`}),o=_();return c("div",{className:o.root,children:[l(y,{name:`${e}.enabled`,control:m,render:({field:r})=>l(G,{control:l(P,{...r,checked:r.value,"data-testid":`${e}-switch`,disabled:s,className:o.checkBox}),label:c(q,{display:"flex",flexDirection:"column",children:[l(F,{variant:"body1",component:"span",children:l("b",{children:`${C}`})}),l(F,{variant:"caption",color:"textSecondary",component:"p",children:`${S}`})]})})}),z&&l("div",{children:p.map((r,a)=>c("div",{children:[a!==0&&l(L,{className:o.divider}),c(O,{orientation:"horizontal",variant:"scrollable",value:t[a],onChange:(n,I)=>T(n,I,a),className:o.tabsContainer,children:[d&&l(h,{label:"Fact Details",value:g,className:o.tab}),l(h,{label:"Schedule",value:u,className:o.tab}),l(h,{label:"Filters",value:N,className:o.tab}),l(h,{label:"Caching",value:k,className:o.tab})]}),c("div",{className:o.contentContainer,children:[t[a]===g&&d&&l(d,{name:i?.enable?`${e}.collectors.${a}.factDetails`:`${e}.factDetails`,disabled:s}),t[a]===u&&l(K,{children:l(Z,{name:i?.enable?`${e}.collectors.${a}`:e})}),t[a]===N&&l(Y,{disabled:s,filterName:i?.enable?`${e}.collectors.${a}.filters.filter`:`${e}.filters.filter`,errorPath:i?.enable?`${e}.collectors.${a}.filters`:`${e}.filters`,keyValueFilterName:i?.enable?`${e}.collectors.${a}.filters.keyValueFilter`:`${e}.filters.keyValueFilter`,excludeFilterName:i?.enable?`${e}.collectors.${a}.filters.excludeFilter`:`${e}.filters.excludeFilter`,excludeKeyValueFilterName:i?.enable?`${e}.collectors.${a}.filters.excludeKeyValueFilter`:`${e}.filters.excludeKeyValueFilter`}),t[a]===k&&l(y,{name:i?.enable?`${e}.collectors.${a}.cacheConfig`:`${e}.cacheConfig`,control:m,rules:{validate:U},render:({field:n})=>l(X,{disabled:s,value:n.value,onChange:n.onChange,errors:i?.enable?$?.collectors?.[a]?.cacheConfig:$?.cacheConfig})})]}),i?.enable&&c(f,{container:!0,spacing:1,className:o.buttonsContainer,children:[p.length>1&&l(f,{item:!0,children:l(x,{startIcon:l(E,{}),onClick:()=>j(a),disabled:s,variant:"outlined",size:"small",color:"secondary",children:"Remove"})}),l(f,{item:!0,children:c(x,{startIcon:l(W,{}),onClick:()=>R(a),disabled:s,variant:"outlined",size:"small",color:"primary",children:["Add ",C]})})]})]},r.id))})]})};export{ee as FactCollectionConfig};
|
|
2
2
|
//# sourceMappingURL=FactCollectionConfig.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as b,jsx as o}from"react/jsx-runtime";import{makeStyles as x,Box as c,Chip as
|
|
1
|
+
import{jsxs as b,jsx as o}from"react/jsx-runtime";import{makeStyles as x,Box as c,Chip as T,TextField as g,FormControlLabel as C,Checkbox as S}from"@material-ui/core";import v from"@material-ui/icons/CheckBox";import N from"@material-ui/icons/CheckBoxOutlineBlank";import{Autocomplete as k}from"@material-ui/lab";import{useState as I,useEffect as L}from"react";import{ListboxVirtualized as z}from"../../../ListboxVirtualized/ListboxVirtualized.esm.js";import{HTTP_STATUSES as p}from"./utils.esm.js";const H=x(a=>({statusInput:{marginTop:0},statusChips:{marginBottom:a.spacing(1)},helperText:{marginLeft:0}})),E=({value:a,onChange:i,disabled:r,errors:m,helperText:d})=>{const n=H(),[s,u]=I(a??[]);L(()=>{i&&i(s.map(e=>Number(e)))},[s,i]);const f=(e,t)=>{u(s?.filter(l=>l!==t))},h=(e,t)=>{const l=t.length?t[t.length-1]:void 0;l&&isNaN(Number(l))||u(t)};return b(c,{children:[o(c,{children:s.map(e=>o(T,{label:e,size:"small",className:n.statusChips,onDelete:t=>f(t,e),clickable:!1,disabled:r},e))}),o(k,{disableCloseOnSelect:!0,fullWidth:!0,multiple:!0,freeSolo:!0,popupIcon:null,renderTags:()=>null,disabled:r,options:p.map(e=>e.value),getOptionLabel:e=>p.find(t=>t.value===e)?.label??"",value:s,onChange:(e,t)=>h(e,t),ListboxComponent:z,ListboxProps:{itemHeight:40},renderInput:e=>o(g,{...e,variant:"outlined",margin:"dense",className:n.statusInput,placeholder:"Example: 500",disabled:r,error:!!m,helperText:m?.message??d,FormHelperTextProps:{className:n.helperText}}),renderOption:(e,{selected:t})=>o(C,{onClick:l=>l.preventDefault(),control:o(S,{icon:o(N,{fontSize:"small"}),checkedIcon:o(v,{fontSize:"small"}),checked:t,disabled:r}),label:p.find(l=>l.value===e)?.label??""})})]})};export{E as HttpStatusesInput};
|
|
2
2
|
//# sourceMappingURL=HttpStatusesInput.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as m,Fragment as y,jsx as o}from"react/jsx-runtime";import{zodResolver as b}from"@hookform/resolvers/zod";import{makeStyles as D,Paper as S,Divider as c}from"@material-ui/core";import{useForm as h,FormProvider as P}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"react";import"../../../../hooks/useSoundcheckAlert.esm.js";import{useConfirmationModal as T}from"../../../../hooks/useConfirmationModal.esm.js";import{useNavigateBack as L}from"../../../../hooks/useNavigateBack.esm.js";import{useUpdateCollectorConfig as E}from"../../../../hooks/collectors/useUpdateCollectorConfig.esm.js";import{integrationsPageRouteRef as w}from"../../../../routes.esm.js";import{FooterButtons as F}from"../../../FooterButtons/FooterButtons.esm.js";import"../../../SoundcheckHeader/SoundcheckHeader.esm.js";import"../../../SoundcheckHeader/SoundcheckHeaderContext.esm.js";import{useHeader as R}from"../../../SoundcheckHeader/useHeader.esm.js";import{FactCollectionConfig as r}from"../Common/FactCollectionConfig.esm.js";import{collectorHeaderContent as N,confirmationModalContent as I}from"../Common/utils.esm.js";import{IncidentsFactDetailsComponent as O}from"./IncidentsFactDetailsComponent.esm.js";import{mapConfigToPagerDutyCollectorConfig as _,defaultPagerDutyConfig as k,SERVICE_COLLECTOR_TYPE as x,STANDARDS_COLLECTOR_TYPE as B,INCIDENTS_COLLECTOR_TYPE as A,incidentsCollectorConfig as M,mapPagerDutyCollectorConfigToConfig as Y}from"./utils.esm.js";import{pagerDutyCollectorFormSchema as j}from"./validation.esm.js";const H=D(e=>({spacer:{height:e.spacing(8),width:"100%"},section:{marginBottom:e.spacing(2)}})),V=({disabled:e,selectedCollector:t})=>{const a=h({defaultValues:t?_(t.config):k(),mode:"onChange",resolver:b(j)}),{formState:{errors:i},handleSubmit:n}=a,s=H(),d=!!i.service||!!i.standards||!!i.incidents,{mutateAsync:p}=E(),[C,f]=L(w),{showModal:g}=T(),l=async u=>{if(!await g(I(t)))return;const v=Y(u);await p({collectorId:t.id,config:v})&&f()};return R(N(t)),m(y,{children:[o(S,{className:s.section,children:o(P,{...a,children:m("form",{onSubmit:n(l),children:[o(r,{name:x.toLowerCase(),label:"Service",description:"Collects details about PagerDuty service linked to an entity.",disabled:e}),o(c,{}),o(r,{name:B.toLowerCase(),label:"Standards",description:"Collects details about standards applied to a PagerDuty service linked to an entity.",disabled:e}),o(c,{}),o(r,{name:A.toLowerCase(),label:"Incidents",description:"Collects details about incidents associated with a PagerDuty service linked to an entity.",disabled:e,FactDetailsComponent:O,multipleCollectors:{enable:!0,defaultConfig:M()}})]})})}),o("div",{className:s.section,children:o(F,{onCancel:C,saveButtonText:"Save",isLoading:!1,onSave:n(l),disableSave:d})})]})};export{V as PagerDutyConfigurator};
|
|
1
|
+
import{jsxs as m,Fragment as y,jsx as o}from"react/jsx-runtime";import{zodResolver as b}from"@hookform/resolvers/zod";import{makeStyles as D,Paper as S,Divider as c}from"@material-ui/core";import{useForm as h,FormProvider as P}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"react";import"../../../../hooks/useSoundcheckAlert.esm.js";import{useConfirmationModal as T}from"../../../../hooks/useConfirmationModal.esm.js";import{useNavigateBack as L}from"../../../../hooks/useNavigateBack.esm.js";import{useUpdateCollectorConfig as E}from"../../../../hooks/collectors/useUpdateCollectorConfig.esm.js";import{integrationsPageRouteRef as w}from"../../../../routes.esm.js";import{FooterButtons as F}from"../../../FooterButtons/FooterButtons.esm.js";import"../../../SoundcheckHeader/SoundcheckHeader.esm.js";import"../../../SoundcheckHeader/SoundcheckHeaderContext.esm.js";import{useHeader as R}from"../../../SoundcheckHeader/useHeader.esm.js";import{FactCollectionConfig as r}from"../Common/FactCollectionConfig.esm.js";import{collectorHeaderContent as N,confirmationModalContent as I}from"../Common/utils.esm.js";import{IncidentsFactDetailsComponent as O}from"./IncidentsFactDetailsComponent.esm.js";import{mapConfigToPagerDutyCollectorConfig as _,defaultPagerDutyConfig as k,SERVICE_COLLECTOR_TYPE as x,STANDARDS_COLLECTOR_TYPE as B,INCIDENTS_COLLECTOR_TYPE as A,incidentsCollectorConfig as M,mapPagerDutyCollectorConfigToConfig as Y}from"./utils.esm.js";import{pagerDutyCollectorFormSchema as j}from"./validation.esm.js";const H=D(e=>({spacer:{height:e.spacing(8),width:"100%"},section:{marginBottom:e.spacing(2)}})),V=({disabled:e,selectedCollector:t})=>{const a=h({defaultValues:t?_(t.config):k(),mode:"onChange",resolver:b(j)}),{formState:{errors:i},handleSubmit:n}=a,s=H(),d=!!i.service||!!i.standards||!!i.incidents,{mutateAsync:p}=E(),[C,f]=L(w),{showModal:g}=T(),l=async u=>{if(!await g(I(t)))return;const v=Y(u);await p({collectorId:t.id,config:v})&&f()};return R(N(t)),m(y,{children:[o(S,{className:s.section,children:o(P,{...a,children:m("form",{onSubmit:n(l),children:[o(r,{name:x.toLowerCase(),label:"Service",description:"Collects details about PagerDuty service linked to an entity.",disabled:e}),o(c,{}),o(r,{name:B.toLowerCase(),label:"Standards",description:"Collects details about standards applied to a PagerDuty service linked to an entity.",disabled:e}),o(c,{}),o(r,{name:A.toLowerCase(),label:"Incidents",description:"Collects details about incidents associated with a PagerDuty service linked to an entity.",disabled:e,FactDetailsComponent:O,multipleCollectors:{enable:!0,defaultConfig:M(t.config)}})]})})}),o("div",{className:s.section,children:o(F,{onCancel:C,saveButtonText:"Save",isLoading:!1,onSave:n(l),disableSave:d})})]})};export{V as PagerDutyConfigurator};
|
|
2
2
|
//# sourceMappingURL=PagerDutyConfigurator.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{asArray as E}from"@spotify/backstage-plugin-soundcheck-common";import{defaultBaseCollectorOption as D,defaultCollectorOption as p}from"../Common/CollectorOption.esm.js";import{mapBackendConfigToFormIntegrationConfig as r,mapFormIntegrationConfigToBackendConfig as d}from"../Common/utils.esm.js";const f="Service",g="Standards",l="Incidents",C={triggered:!0,acknowledged:!0,resolved:!0},y={factDetails:{factName:{name:"Fact Name",helperText:"Fact name must be unique",placeholder:"Fact Name"},statuses:{name:"Statuses",description:"Return only incidents with the given statuses",helperText:"Select at least one status"}}},m=(a,
|
|
1
|
+
import{asArray as E}from"@spotify/backstage-plugin-soundcheck-common";import{defaultBaseCollectorOption as D,defaultCollectorOption as p}from"../Common/CollectorOption.esm.js";import{mapBackendConfigToFormIntegrationConfig as r,mapFormIntegrationConfigToBackendConfig as d}from"../Common/utils.esm.js";const f="Service",g="Standards",l="Incidents",C={triggered:!0,acknowledged:!0,resolved:!0},y={factDetails:{factName:{name:"Fact Name",helperText:"Fact name must be unique",placeholder:"Fact Name"},statuses:{name:"Statuses",description:"Return only incidents with the given statuses",helperText:"Select at least one status"}}},m=(t,a,n)=>({...D(t),factDetails:{factName:a??"",statuses:{triggered:n?.triggered??!1,acknowledged:n?.acknowledged??!1,resolved:n?.resolved??!1}}}),T=t=>({service:p(t),standards:p(t),incidents:{enabled:!1,collectors:[m(t,l.toLowerCase(),C)]}});function O(t){const{service:a,standards:n,incidents:s}=t;if(a.enabled||n.enabled||s.enabled){const c={},o=[];return c.collects=o,a.enabled&&o.push(d({factType:f,configOption:a})),n.enabled&&o.push(d({factType:g,configOption:n})),s.enabled&&s.collectors.forEach(i=>{o.push(d({factType:l,configOption:i,additionalParams:{factName:i.factDetails.factName,statuses:Object.entries(i.factDetails.statuses).filter(([e,u])=>u).map(([e,u])=>e)}}))}),c}return{collects:[]}}function h(t){const a=T(t);if(t){const n=t.collects;if(n){const s=E(n),c=s.find(e=>e.type===f);c&&(a.service={...r({parentConfig:t,factTypeConfig:c}),enabled:!0});const o=s.find(e=>e.type===g);o&&(a.standards={...r({parentConfig:t,factTypeConfig:o}),enabled:!0});const i=s.filter(e=>e.type===l);i.length&&(a.incidents={enabled:!0,collectors:i.map(e=>({...r({parentConfig:t,factTypeConfig:e}),factDetails:{factName:e.factName??l,statuses:{triggered:e.statuses?.length?e.statuses.includes("triggered"):!0,acknowledged:e.statuses?.length?e.statuses.includes("acknowledged"):!0,resolved:e.statuses?.length?e.statuses.includes("resolved"):!0}}}))})}}return a}export{C as DEFAULT_INCIDENT_STATUSES,l as INCIDENTS_COLLECTOR_TYPE,y as PAGERDUTY_COLLECTOR_FIELDS,f as SERVICE_COLLECTOR_TYPE,g as STANDARDS_COLLECTOR_TYPE,T as defaultPagerDutyConfig,m as incidentsCollectorConfig,h as mapConfigToPagerDutyCollectorConfig,O as mapPagerDutyCollectorConfigToConfig};
|
|
2
2
|
//# sourceMappingURL=utils.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{Grid as r}from"@material-ui/core";import{useGetCollectors as c}from"../../../hooks/collectors/useGetCollectors.esm.js";import{CollectorListSkeleton as s}from"./CollectorListSkeleton.esm.js";import{CollectorSummaryCard as m}from"./CollectorSummaryCard.esm.js";const a=["github","gitlab","scm","pagerduty","datadog","kubernetes","jira","sonarqube","newrelic","bigquery","catalog","azure","http","data-registry"],u=({integrations:l})=>{const{data:d,isLoading:n}=c(),o=l?.map(e=>e.integrationId)??a;return t(r,{container:!0,direction:"row",children:t(r,{container:!0,spacing:4,role:"list","aria-label":"checks",children:n?t(s,{}):d?.filter(e=>e.isConfigurable)?.sort((e,i)=>!o.includes(e.id)&&o.includes(i.id)?1:o.includes(e.id)&&!o.includes(i.id)?-1:(e.name??e.id).localeCompare(i.name??i.id))?.map(e=>t(r,{xs:12,sm:12,md:6,lg:4,xl:3,item:!0,role:"listitem","aria-label":`collector card ${e.id}`,children:t(m,{collector:e,hasNoCodeUI:o.includes(e.id),routePath:l?.find(i=>i.integrationId===e.id)?.routePath})},e.id))})})};export{u as CollectorListPage,a as ConfigurableCollectorIds};
|
|
2
2
|
//# sourceMappingURL=CollectorListPage.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as
|
|
1
|
+
import{jsxs as i,jsx as e}from"react/jsx-runtime";import{useRouteRef as I}from"@backstage/core-plugin-api";import{usePermission as T}from"@backstage/plugin-permission-react";import{makeStyles as S,CardContent as u,CardHeader as U,Typography as d,Tooltip as D,Divider as H,CardActions as A,Button as B}from"@material-ui/core";import{soundcheckCollectorUpdatePermission as L}from"@spotify/backstage-plugin-soundcheck-common";import{useNavigate as P}from"react-router-dom";import{integrationDetailsRouteRef as R}from"../../../routes.esm.js";import{SoundcheckMarkdownContent as $}from"../../SoundcheckMarkdownContent/SoundcheckMarkdownContent.esm.js";import"@backstage/core-components";import"react";import"react-markdown";import"rehype-raw";import"remark-gfm";import{useSummaryCardStyles as j,Card as M}from"../../SummaryCard/SummaryCard.esm.js";import{hasLogo as Y,CollectorLogo as w}from"./CollectorLogo.esm.js";const z=S(t=>({cardContent:{flex:1,paddingTop:t.spacing(1)},logoHeader:{paddingBottom:0,flex:0},headerContent:{display:"flex",alignItems:"center",height:t.spacing(5),marginBottom:t.spacing(1.5)},headerTypography:{marginBottom:0},usageText:{marginTop:t.spacing(.5)},checkUsageHover:{textDecoration:"underline",textDecorationStyle:"dotted","&:hover":{cursor:"default"}}})),E=({collector:t,hasNoCodeUI:l,routePath:f})=>{const{description:y,id:a,isConfigurable:m,isEditable:p,name:C}=t,{loading:g,allowed:h}=T({permission:L}),v=P(),b=I(R),n=j(),o=z(),k=l&&m&&p&&!g&&h,x=()=>{v(f??b({integrationId:a}))};let r;g||!h?r="You don't have permissions to configure this integration.":m?p?l?t.hasUIConfig&&(r="Configured via UI."):r="Integration can only be configured through YAML.":r="Integration is already configured via YAML and cannot be configured through the UI.":r="Integration is not configurable.";const s=t?.dependentChecks?.length??0,c=C??a;return i(M,{"data-testid":a,className:n.card,children:[Y(a)?e(u,{className:o.logoHeader,children:e(w,{collectorId:a})}):e(U,{title:c,titleTypographyProps:{className:`${n.summaryName} ${o.headerTypography}`},classes:{content:o.headerContent}}),i(u,{className:o.cardContent,children:[e(d,{variant:"body1",component:"div",children:e($,{className:n.summaryDescription,content:y??""})}),e(d,{color:"textSecondary",variant:"body2",children:r}),s>0&&i(d,{className:o.usageText,color:"textSecondary",variant:"body2",children:[e(D,{title:t.dependentChecks?.map(N=>N.name).join(", ")??"",children:i("span",{className:o.checkUsageHover,children:[s," check",s>1?"s":""]})})," ","use facts from this integration."]})]}),k&&i("div",{children:[e(H,{}),e(A,{className:n.actionArea,children:e(B,{"aria-label":`${c}-edit`,"data-testid":`${c}-button`,size:"medium",role:"link",onClick:x,className:n.button,variant:"outlined",children:"Configure"})})]})]})};export{E as CollectorSummaryCard};
|
|
2
2
|
//# sourceMappingURL=CollectorSummaryCard.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{makeStyles as e}from"@material-ui/core";import"../SoundcheckHeader/SoundcheckHeader.esm.js";import"../SoundcheckHeader/SoundcheckHeaderContext.esm.js";import{useSetHeaderDefault as i}from"../SoundcheckHeader/useHeader.esm.js";import{CollectorListPage as n}from"./CollectorListPage/CollectorListPage.esm.js";const a=e(o=>({container:{padding:o.spacing(3)}})),s=({integrations:o})=>{const r=a();return i(),t("div",{className:r.container,children:t(n,{integrations:o})})};export{s as CollectorsPage};
|
|
2
2
|
//# sourceMappingURL=CollectorsPage.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as e,jsxs as T}from"react/jsx-runtime";import{makeStyles as F,FormControlLabel as O,Checkbox as z,Typography as A,Box as w,TextField as I}from"@material-ui/core";import
|
|
1
|
+
import{jsx as e,jsxs as T}from"react/jsx-runtime";import{makeStyles as F,FormControlLabel as O,Checkbox as z,Typography as A,Box as w,TextField as I}from"@material-ui/core";import j from"@material-ui/icons/CheckBox";import B from"@material-ui/icons/CheckBoxOutlineBlank";import E from"@material-ui/icons/ExpandMore";import{Autocomplete as G}from"@material-ui/lab";import{useState as N,useMemo as m,useCallback as p}from"react";import{useGetEntityRefs as D}from"../../hooks/catalog/useGetEntityRefs.esm.js";import{FormFieldLabel as H}from"../FormFieldLabel/FormFieldLabel.esm.js";import{ListboxVirtualized as M}from"../ListboxVirtualized/ListboxVirtualized.esm.js";const P=F({container:{padding:0},formControl:{flexGrow:1},label:{lineHeight:"1em"}}),Q=({label:d,values:o,onChange:n,disabled:f,filter:g,renderOption:b,renderTags:h})=>{const i=P(),[C,a]=N(!1),{data:t,isLoading:u,error:k}=D(g),s=m(()=>o?.map(l=>l.toLocaleLowerCase("en-US"))??[],[o]),x=p((l,r)=>{n(r),t&&t.every(c=>r.includes(c))&&a(!1)},[t,n]),y=p(()=>{n(o?.length?o:void 0)},[o,n]),L=p((l,r)=>b?.(l,r)??e(O,{onClick:c=>c.preventDefault(),control:e(z,{icon:e(B,{fontSize:"small"}),checkedIcon:e(j,{fontSize:"small"}),checked:r.selected}),label:l,classes:{label:i.label}}),[b,i.label]),S=m(()=>f||u||!o?.length&&!t?.length,[f,u,o?.length,t?.length]),v=m(()=>Array.from(new Set([...t??[],...s])),[t,s]);return k?e(A,{color:"error",children:"Failed to load entities"}):T(w,{pb:1,pt:1,className:i.container,children:[e(H,{title:d,docLink:"https://backstage.spotify.com/docs/plugins/soundcheck/core-concepts/filters"}),e(G,{open:C,onOpen:()=>a(!0),onClose:()=>a(!1),className:i.formControl,multiple:!0,limitTags:4,disableCloseOnSelect:!0,"aria-label":d,options:v,value:s,onChange:x,onBlur:y,disabled:S,ListboxComponent:M,renderOption:L,renderTags:h,size:"small",popupIcon:e(E,{"data-testid":"selected-facets-expand"}),renderInput:l=>e(I,{...l,variant:"outlined"})})]})};export{Q as EntitiesAutocompletePicker};
|
|
2
2
|
//# sourceMappingURL=EntitiesAutocompletePicker.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as e,jsxs as o,Fragment as R}from"react/jsx-runtime";import{makeStyles as
|
|
1
|
+
import{jsx as e,jsxs as o,Fragment as R}from"react/jsx-runtime";import{makeStyles as _,Box as i,Typography as n,Button as j}from"@material-ui/core";import{Alert as q}from"@material-ui/lab";import{parseFactRef as X}from"@spotify/backstage-plugin-soundcheck-common";import Y from"lodash";import{useMemo as u,useState as b,useEffect as Z,useCallback as ee}from"react";import{useGetEntityRefs as te}from"../../hooks/catalog/useGetEntityRefs.esm.js";import{useGetCollectors as ae}from"../../hooks/collectors/useGetCollectors.esm.js";import{useGetFactSchema as oe}from"../../hooks/collectors/useGetFactSchema.esm.js";import{useGetFact as ie}from"../../hooks/useGetFact.esm.js";import{useGetPathResolvers as ne}from"../../hooks/useGetPathResolvers.esm.js";import{generateJsonPaths as re}from"../CheckForm/utils/checkFormUtils.esm.js";import{hasLogo as le,CollectorLogo as ce}from"../CollectorsPage/CollectorListPage/CollectorLogo.esm.js";import{ExpandableSection as B}from"../ExpandableSection/ExpandableSection.esm.js";import{mapFiltersToCatalogFilter as se}from"../Filter/utils.esm.js";import"../Filter/FilterComponent.esm.js";import{emptyFilters as de}from"../Filter/types.esm.js";import{FormattedPreview as C}from"../FormattedPreview/FormattedPreview.esm.js";import"../FormControlledAutocomplete/FormControlledAutocomplete.esm.js";import"@material-ui/icons/CheckBox";import"@material-ui/icons/CheckBoxOutlineBlank";import"react-hook-form";import"../ListboxVirtualized/ListboxVirtualized.esm.js";import{useLabelOptions as pe}from"../FormControlledAutocomplete/useLabelOptions.esm.js";import{ControlledAutocomplete as v}from"../FormControlledAutocomplete/ControlledAutocomplete.esm.js";import{LoadingIndicator as me}from"../LoadingIndicator/LoadingIndicator.esm.js";import{useFactOptions as he}from"./useFactOptions.esm.js";const fe=800,ue=_(t=>({content:{padding:t.spacing(2,3),width:fe},section:{margin:t.spacing(2,0)},expandedSection:{borderTop:`1px solid ${t.palette.divider}`,padding:t.spacing(0,2)},loading:{margin:t.spacing(2)},preview:{maxHeight:500,overflow:"auto",border:`1px solid ${t.palette.divider}`},pathSection:{display:"flex",alignItems:"center",margin:t.spacing(1,0)},testPathButton:{margin:t.spacing(1,1,.5,0)},collectorName:{fontSize:24}})),T=t=>{const g=!t||Object.values(t).every(d=>!d?.length)?{...de(),selectedKinds:["Component","System"]}:t;return se(g)},ve=({factRef:t,updateFactRef:g,path:d,updatePath:I,entityRef:m,updateEntityRef:k,pathResolver:s,filters:G,onSave:P})=>{const a=ue(),p=u(()=>{if(t)return X(t)},[t]),[S,L]=b(p?.source??null);Z(()=>{p?.source&&L(p.source)},[p?.source]);const[y,V]=b("jsonpath"),[F,w]=b(),[N,W]=b(),{data:E}=ne(),M=u(()=>E?.map(c=>c.id)??[],[E]),{data:h}=oe(p?.source,p?.name,!0),$=u(()=>h?re(h.schema):[],[h]),{data:x,isLoading:A}=ae(),D=x?.map(c=>c.id)?.sort()??[],{data:J,isLoading:z}=te(T(G),500),l=u(()=>x?.find(c=>c.id===S),[x,S]),{factOptions:H}=he({selectedCollector:l}),{options:K,getOptionLabel:O}=pe(H),{data:r,isLoading:f}=ie({factRef:t||"",entityRef:N||"",path:F,pathResolver:s??y??void 0},!!t&&!!N),Q=ee(()=>{w(d),W(m)},[m,d]),U=u(()=>!!l?.config?.cache,[l]);return e(i,{className:a.content,"data-testid":"fact-explorer",children:o(i,{children:[o(i,{children:[e(n,{variant:"subtitle1",children:"Select an Integration"}),e(v,{options:D,onChange:c=>{L(c),g("")},value:S,placeholder:"Integration",disabled:A,fullWidth:!0})]}),!!l&&e(R,{children:o(i,{className:a.section,children:[le(l.id)?e(ce,{noMargin:!0,collectorId:l.id}):o(n,{variant:"h5",className:a.collectorName,component:"div",children:[l.name??l.id," "]}),!!l.description&&e(n,{variant:"body2",children:l.description}),e(v,{options:K,onChange:g,value:t??null,placeholder:"Select Fact",getOptionLabel:O,noOptionsText:"No Facts",fullWidth:!0})]})}),!!t&&o(R,{children:[!!h?.schema&&e(i,{className:a.section,children:e(B,{elevation:1,title:"JSON Schema",children:e("div",{className:a.preview,children:e(C,{data:h.schema})})})}),o(i,{className:a.section,children:[e(n,{variant:"subtitle1",children:"Path Resolver"}),!s&&e(n,{variant:"caption",children:"Defaults to jsonpath"}),s?e(n,{variant:"body1",children:s}):e(v,{options:M,onChange:V,value:s??y,placeholder:"Path Resolver (Optional)",getOptionLabel:O,fullWidth:!0,disabled:!!s})]}),o(i,{className:a.section,children:[e(n,{variant:"subtitle1",children:"Path"}),e(v,{options:(s??y)==="jsonpath"?$:[],onChange:c=>{F&&w(void 0),I(c)},value:d??null,placeholder:"Path",fullWidth:!0,freeSolo:!0}),e("div",{className:a.pathSection,children:!!P&&e(j,{className:a.testPathButton,variant:"contained",onClick:()=>P({factRef:t,path:d??"",pathResolver:y??s??""}),disabled:!d,color:"primary",children:"Save"})})]})]}),!!t&&e(B,{elevation:0,title:"Sample Fact and Test Path",children:o(i,{className:a.expandedSection,children:[o(i,{marginBottom:1,children:[e(n,{variant:"subtitle1",children:"Select an Entity"}),o(n,{variant:"caption",children:["Fact will be sampled from this entity.",e("br",{}),"If you don't see the entity in the drop-down list, you can type its reference in the format ","<kind>:<namespace>/<name>","."]}),e(v,{options:J??[],onChange:k,value:m??null,placeholder:"Entity Selection",isLoading:z,freeSolo:!0,fullWidth:!0})]}),e(i,{children:e(j,{className:a.testPathButton,variant:"contained",onClick:Q,disabled:!m,color:"primary",children:"Sample Fact"})}),o(R,{children:[!!F&&!f&&o(i,{className:a.section,children:[e(n,{variant:"subtitle1",children:"Resolved Value"}),r?.resolvedValue!==null&&r?.resolvedValue!==void 0?e(i,{className:a.preview,children:e(C,{data:r?.resolvedValue})}):e(n,{color:"textSecondary",variant:"body2",children:"Could not resolve path"})]}),!!N&&o(i,{className:a.section,children:[e(n,{variant:"subtitle1",children:"Fact Data"}),U&&e(n,{variant:"caption",children:"Uses cache when available."}),!!f&&e("div",{className:a.loading,children:e(me,{})}),!f&&!!r?.fact&&e(i,{className:a.preview,children:r?.fact?.sensitive&&Y.isEmpty(r?.fact?.data)?e(i,{children:e(q,{severity:"info",children:"The associated fact contains potentially sensitive information and has been redacted."})}):e(C,{data:r?.fact?.data})}),!f&&!!r?.collectionError&&o(n,{color:"textSecondary",variant:"body2",children:["Failed to collect:"," ",r?.collectionError?.errorMessage]}),!f&&!r?.fact&&!r?.collectionError&&o(n,{color:"textSecondary",variant:"body2",children:["Fact ",t," unavailable for entity ",m]})]})]})]})})]})})};export{ve as FactExplorer,T as toEntityFilterQuery};
|
|
2
2
|
//# sourceMappingURL=FactExplorer.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as a}from"react/jsx-runtime";import{Button as R}from"@material-ui/core";import x from"@material-ui/icons/Search";import{useContext as u}from"react";import{SoundcheckDialog as v}from"../SoundcheckDialog/SoundcheckDialog.esm.js";import{FactExplorer as
|
|
1
|
+
import{jsx as a}from"react/jsx-runtime";import{Button as R}from"@material-ui/core";import x from"@material-ui/icons/Search";import{useContext as u}from"react";import{SoundcheckDialog as v}from"../SoundcheckDialog/SoundcheckDialog.esm.js";import{FactExplorer as F}from"./FactExplorer.esm.js";import{FactExplorerContext as d}from"./FactExplorerContext.esm.js";const E=()=>{const{open:t,updateOpen:o,onSave:r,factRef:p,updateFactRef:n,path:c,updatePath:l,entityRef:e,updateEntityRef:f,pathResolver:i,filters:s}=u(d);return a(v,{open:t,handleClose:()=>o(!1),title:"Fact Explorer",fullScreen:!1,children:a(F,{onSave:r,factRef:p,updateFactRef:n,path:c,updatePath:l,entityRef:e,updateEntityRef:f,pathResolver:i,filters:s})})},S=({onSave:t,factRef:o,path:r,pathResolver:p,className:n,text:c="Explore Facts",hideIcon:l})=>{const{updateOpen:e,updateOnSave:f,updateFactRef:i,updatePath:s,updatePathResolver:h}=u(d);return a(R,{onClick:()=>{e(!0),i(o??""),s(r??""),h(p??""),f(()=>m=>{t&&t(m),e(!1)})},className:n,variant:"text",startIcon:l?void 0:a(x,{}),children:c})};export{E as FactExplorerDialog,S as FactExplorerDialogButton};
|
|
2
2
|
//# sourceMappingURL=FactExplorerDialog.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{parseFactRef as p,stringifyFactRef as c}from"@spotify/backstage-plugin-soundcheck-common";import{useMemo as n}from"react";import"@backstage/catalog-model";import"@backstage/core-plugin-api";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"../../hooks/useSoundcheckAlert.esm.js";import{useGetAllTracks as l}from"../../hooks/tracks/useGetAllTracks.esm.js";import"../../hooks/useConfirmationModal.esm.js";import"react-router-dom";const s=({selectedCollector:
|
|
1
|
+
import{parseFactRef as p,stringifyFactRef as c}from"@spotify/backstage-plugin-soundcheck-common";import{useMemo as n}from"react";import"@backstage/catalog-model";import"@backstage/core-plugin-api";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"../../hooks/useSoundcheckAlert.esm.js";import{useGetAllTracks as l}from"../../hooks/tracks/useGetAllTracks.esm.js";import"../../hooks/useConfirmationModal.esm.js";import"react-router-dom";const s=({selectedCollector:e})=>{const{data:r}=l({});return{factOptions:n(()=>e?.factNames?.map(o=>{const t=p(o,{defaultSource:e.id,defaultScope:"default"});let m=t.name;if(e?.id==="soundcheck"){const a=r?.edges.find(i=>i.node.id===t.name)?.node;m=a?`${a.type==="campaign"?"Campaign: ":"Track: "}${a.name}`:t.name}return{label:m,value:c(t)}})?.sort((o,t)=>o.label.localeCompare(t.label))??[],[e?.factNames,e?.id,r])}};export{s as useFactOptions};
|
|
2
2
|
//# sourceMappingURL=useFactOptions.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as t,jsxs as L}from"react/jsx-runtime";import{makeStyles as z,FormControlLabel as A,Checkbox as I,Typography as
|
|
1
|
+
import{jsx as t,jsxs as L}from"react/jsx-runtime";import{makeStyles as z,FormControlLabel as A,Checkbox as I,Typography as j,Box as B,TextField as E}from"@material-ui/core";import G from"@material-ui/icons/CheckBox";import N from"@material-ui/icons/CheckBoxOutlineBlank";import U from"@material-ui/icons/ExpandMore";import{Autocomplete as V}from"@material-ui/lab";import{useState as $,useMemo as s,useCallback as d}from"react";import{useGetEntityFacets as D}from"../../hooks/catalog/useGetEntityFacets.esm.js";import{FormFieldLabel as H}from"../FormFieldLabel/FormFieldLabel.esm.js";import{ListboxVirtualized as M}from"../ListboxVirtualized/ListboxVirtualized.esm.js";const P=z({container:{padding:0},formControl:{flexGrow:1},label:{lineHeight:"1em"}}),q=({facet:f,label:b,values:l,onChange:n,disabled:g,filter:x,renderOption:u,renderTags:k,facetFilter:h})=>{const i=P(),[y,c]=$(!1),{data:r,isLoading:C,error:S}=D(f,x),o=s(()=>r?.filter(h??(()=>!0)).map(e=>e.toLocaleLowerCase("en-US")),[r,h]),m=s(()=>l?.map(e=>e.toLocaleLowerCase("en-US"))??[],[l]),F=d((e,a)=>{n(a),o&&o.every(p=>a.includes(p))&&c(!1)},[o,n]),T=d(()=>{n(l?.length?l:void 0)},[l,n]),v=d((e,a)=>u?.(e,a)??t(A,{onClick:p=>p.preventDefault(),control:t(I,{icon:t(N,{fontSize:"small"}),checkedIcon:t(G,{fontSize:"small"}),checked:a.selected}),label:e,classes:{label:i.label}}),[u,i.label]),O=s(()=>g||C||!l?.length&&(!r?.length||!o?.length),[g,C,l?.length,r?.length,o?.length]),w=s(()=>Array.from(new Set([...o??[],...m])),[o,m]);return S?L(j,{color:"error",children:["Failed to load facet: ",f]}):L(B,{pb:1,pt:1,className:i.container,children:[t(H,{title:b,docLink:"https://backstage.spotify.com/docs/plugins/soundcheck/core-concepts/filters"}),t(V,{open:y,onOpen:()=>c(!0),onClose:()=>c(!1),className:i.formControl,multiple:!0,limitTags:4,disableCloseOnSelect:!0,"aria-label":b,options:w,value:m,getOptionLabel:e=>r&&o?r[o.indexOf(e)]??e:e,onChange:F,onBlur:T,disabled:O,ListboxComponent:M,renderOption:v,renderTags:k,size:"small",popupIcon:t(U,{"data-testid":"selected-facets-expand"}),renderInput:e=>t(E,{...e,variant:"outlined"})})]})};export{q as EntityAutocompletePicker};
|
|
2
2
|
//# sourceMappingURL=EntityAutocompletePicker.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as i,Fragment as
|
|
1
|
+
import{jsxs as i,Fragment as k,jsx as e}from"react/jsx-runtime";import{makeStyles as z,Typography as f,Divider as X,Box as d,Tabs as Y,Tab as P,Grid as c,Paper as _,Chip as D,Switch as G,FormHelperText as H}from"@material-ui/core";import M,{isEmpty as I}from"lodash";import{useState as q,useMemo as K}from"react";import{useFormContext as J}from"react-hook-form";import Q from"react-use/lib/useLocalStorage";import{FormFieldLabel as w}from"../FormFieldLabel/FormFieldLabel.esm.js";import{EntityAutocompletePicker as U}from"./EntityAutocompletePicker.esm.js";import{FilterKeyValueInput as $}from"./FilterKeyValueInput.esm.js";import{FilterPreviewTable as Z}from"./FilterPreviewTable/FilterPreviewTable.esm.js";import{FILTER_OPTIONS as S,emptyFilters as ee}from"./types.esm.js";import{isValidOtherFilterKey as le}from"./utils.esm.js";const te=z(l=>({title:{fontWeight:700},filterContainer:{display:"flex",flexWrap:"wrap"},selectionTabs:{marginBottom:l.spacing(2)},divider:{marginTop:l.spacing(2)},filterDisplayBox:{padding:l.spacing(2),paddingLeft:l.spacing(4),border:`1px solid ${l.palette.divider}`,marginBottom:l.spacing(0),display:"flex",alignItems:"center",flex:1},error:{borderColor:l.palette.error.main}})),h=l=>I(l)?"":`${l.length>1?`[${l.join(", ")}]`:l[0]}`,ie=({filterValue:l,excludeFilter:g,keyValueFilter:y,excludeKeyValueFilter:m})=>{const o=(a=ee())=>S.map(t=>I(a[t.key])?"":`${t.facet}: ${h(a[t.key])}`).filter(t=>!!t),n=a=>[a?.selectedLabels?.map(t=>`metadata.labels.${t.key}: ${h(t.value)}`),a?.selectedAnnotations?.map(t=>`metadata.annotations.${t.key}: ${h(t.value)}`),a?.selectedOtherFilters?.map(t=>`${t.key}: ${h(t.value)}`)].flat(),s=[...o(l),...n(y)],x=[...o(g),...n(m)];return{includeFilterDisplay:s,excludeFilterDisplay:x}},re=({filterName:l,errorPath:g="filtersStep",disabled:y,keyValueFilterName:m,excludeFilterName:o,excludeKeyValueFilterName:n})=>{const s=te(),{setValue:x,watch:a,formState:t,trigger:A}=J(),[p,E]=q(0),[F,W]=Q("soundcheck-show-preview",!0),V=K(()=>p===0?l:o,[o,l,p]),u=K(()=>p===0?m:n,[n,m,p]),L=a(V??l),R=r=>v=>{x(V??l,{...L,[r]:v??[]}),A()},B=a(l),C=o?a(o):void 0,N=m?a(m):void 0,T=n?a(n):void 0,{includeFilterDisplay:j,excludeFilterDisplay:O}=ie({filterValue:B,excludeFilter:C,keyValueFilter:N,excludeKeyValueFilter:T}),b=M.get(t.errors,g,void 0);return i(k,{children:[i(f,{variant:"body2",children:[e("strong",{children:"Note:"})," For performance reasons, filter facets selected for inclusion cannot be used for exclusion and vice versa."]}),o&&i(k,{children:[e(X,{className:s.divider}),e(d,{className:s.selectionTabs,children:i(Y,{value:p,onChange:(r,v)=>E(v),children:[e(P,{label:"Include Filters","aria-label":"include filters"}),e(P,{label:"Exclude Filters","aria-label":"exclude filters"})]})})]}),i(c,{container:!0,spacing:6,children:[i(c,{item:!0,container:!0,className:s.filterContainer,spacing:2,children:[S.map(r=>e(c,{item:!0,xs:12,sm:6,md:4,children:e(U,{...r,values:L?.[r.key],onChange:R(r.key),disabled:y})},r.key)),u&&i(k,{children:[i(c,{item:!0,xs:12,sm:6,md:4,children:[e(w,{title:"Label",docLink:"https://backstage.spotify.com/docs/plugins/soundcheck/core-concepts/filters"}),e($,{name:`${u}.selectedLabels`,title:"Label Filter"})]}),i(c,{item:!0,xs:12,sm:6,md:4,children:[e(w,{title:"Annotation",docLink:"https://backstage.spotify.com/docs/plugins/soundcheck/core-concepts/filters"}),e($,{name:`${u}.selectedAnnotations`,title:"Annotation Filter"})]}),i(c,{item:!0,xs:12,sm:6,md:4,children:[e(w,{title:"Other",docLink:"https://backstage.spotify.com/docs/plugins/soundcheck/core-concepts/filters"}),e($,{name:`${u}.selectedOtherFilters`,title:"Other Catalog Filter",validateKey:le})]})]})]}),i(c,{item:!0,xs:12,children:[i(_,{className:`${s.filterDisplayBox} ${b?.message?s.error:""}`,elevation:0,children:[i(d,{flex:1,overflow:"auto",children:[i(d,{display:"flex",flexWrap:"wrap",alignItems:"center",style:{overflowX:"auto",overflowY:"hidden"},children:[e(f,{style:{marginRight:4,marginBottom:4},variant:"subtitle2",component:"span",children:"Filter:"}),j.map(r=>e(D,{size:"small",label:r,style:{marginBottom:4}},r))]}),O.length>0&&i(d,{display:"flex",flexWrap:"wrap",alignItems:"center",style:{overflowX:"auto",overflowY:"hidden"},children:[e(f,{style:{marginRight:4,marginBottom:4},variant:"subtitle2",component:"span",children:"Exclude:"}),O.map(r=>e(D,{size:"small",label:r,style:{marginBottom:4}},r))]})]}),e(f,{style:{marginLeft:10},variant:"subtitle2",component:"div",children:"Preview"}),e(d,{children:e(G,{checked:F,onChange:()=>{W(!F)},inputProps:{"aria-label":"toggle entity preview"}})})]}),e(d,{marginBottom:2,children:b?.message&&e(H,{error:!0,children:b?.message})}),F&&e(Z,{filter:B,keyValueFilter:N,excludeFilter:C,excludeKeyValueFilter:T})]})]})]})};export{re as FilterComponent};
|
|
2
2
|
//# sourceMappingURL=FilterComponent.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as s,jsx as e,Fragment as p}from"react/jsx-runtime";import{createElement as T}from"react";import{parseEntityRef as w}from"@backstage/catalog-model";import{useApi as E,configApiRef as L}from"@backstage/core-plugin-api";import{EntityDisplayName as h}from"@backstage/plugin-catalog-react";import{makeStyles as O,Box as f,Typography as R,Button as g,Grid as n,Checkbox as z,Chip as N}from"@material-ui/core";import{combineEntityFilterQueries as j}from"@spotify/backstage-plugin-soundcheck-common";import{
|
|
1
|
+
import{jsxs as s,jsx as e,Fragment as p}from"react/jsx-runtime";import{createElement as T}from"react";import{parseEntityRef as w}from"@backstage/catalog-model";import{useApi as E,configApiRef as L}from"@backstage/core-plugin-api";import{EntityDisplayName as h}from"@backstage/plugin-catalog-react";import{makeStyles as O,Box as f,Typography as R,Button as g,Grid as n,Checkbox as z,Chip as N}from"@material-ui/core";import{combineEntityFilterQueries as j,getGroupFilterFromConfig as B}from"@spotify/backstage-plugin-soundcheck-common";import{EntitiesAutocompletePicker as W}from"../EntitiesAutocompletePicker/EntitiesAutocompletePicker.esm.js";import{EntityAutocompletePicker as c}from"../Filter/EntityAutocompletePicker.esm.js";const y=(i,{selected:r})=>s(p,{children:[e(z,{value:i,checked:r,color:"primary"}),e(h,{entityRef:i})]}),u=(i,r)=>e(p,{children:i.map((l,a)=>T(N,{...r({index:a}),key:l,label:e(h,{entityRef:l}),size:"small"}))}),D=i=>{try{return w(i).kind.toLowerCase()==="system"}catch{return!1}},G=O(i=>({sidebar:{width:"275px",flexShrink:0,height:"100%",padding:i.spacing(3),display:"flex",flexDirection:"column",borderRight:`1px solid ${i.palette.divider}`},filterLabel:{fontWeight:"bold",marginBottom:i.spacing(1)},additionalFilters:{marginTop:i.spacing(2)}})),P=({trackFilter:i,stagedTypes:r,stagedLifecycles:l,stagedOwners:a,stagedSystems:d,onTypesChange:b,onLifecyclesChange:C,onOwnersChange:x,onSystemsChange:F,onApplyFilters:k,onClearFilters:v,hasFilterChanges:A,children:m})=>{const o=G(),S=E(L);return s("div",{className:o.sidebar,children:[s(f,{display:"flex",alignItems:"center",justifyContent:"space-between",mb:1,children:[e(R,{variant:"subtitle2",className:o.filterLabel,children:"Filters"}),(r.length>0||l.length>0||a.length>0||d.length>0)&&e(g,{size:"small",onClick:v,children:"Clear All"})]}),s(n,{container:!0,spacing:1,children:[e(n,{item:!0,xs:12,children:e(c,{facet:"spec.type",label:"Type",values:r,onChange:t=>b(t??[]),filter:i})}),e(n,{item:!0,xs:12,children:e(c,{facet:"spec.lifecycle",label:"Lifecycle",values:l,onChange:t=>C(t??[]),filter:i})}),e(n,{item:!0,xs:12,children:e(W,{label:"Owner",values:a,onChange:t=>x(t??[]),filter:j({kind:["group"]},B(S)),renderOption:y,renderTags:u})}),e(n,{item:!0,xs:12,children:e(c,{facet:"relations.partOf",label:"System",values:d,onChange:t=>F(t??[]),filter:i,renderOption:y,renderTags:u,facetFilter:D})})]}),m&&e("div",{className:o.additionalFilters,children:m}),e(f,{mt:2,children:e(g,{variant:"contained",color:"primary",size:"small",fullWidth:!0,onClick:k,disabled:!A,children:"Apply Filters"})})]})};export{P as FilterSidebar};
|
|
2
2
|
//# sourceMappingURL=FilterSidebar.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as s,jsx as e}from"react/jsx-runtime";import{makeStyles as h,Box as
|
|
1
|
+
import{jsxs as s,jsx as e}from"react/jsx-runtime";import{makeStyles as h,Box as r,TextField as C,FormControlLabel as S,Checkbox as b,Typography as g}from"@material-ui/core";import x from"@material-ui/icons/CheckBox";import k from"@material-ui/icons/CheckBoxOutlineBlank";import L from"@material-ui/icons/ExpandMore";import{Autocomplete as I}from"@material-ui/lab";import{useState as A,useEffect as F,useCallback as c}from"react";import{CheckIcon as T}from"../CheckIcon/CheckIcon.esm.js";import{FormFieldLabel as E}from"../FormFieldLabel/FormFieldLabel.esm.js";import{ListboxVirtualized as y}from"../ListboxVirtualized/ListboxVirtualized.esm.js";const N=["PASSED","FAILED","WARNING","EXEMPT","NOT_APPLICABLE"],O=h({container:{padding:0},formControl:{flexGrow:1},label:{lineHeight:"1em"}}),m=l=>l.toLowerCase().split("_").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" "),P=(l,{selected:t})=>e(S,{onClick:o=>o.preventDefault(),control:e(b,{icon:e(k,{fontSize:"small"}),checkedIcon:e(x,{fontSize:"small"}),checked:t}),label:s(r,{display:"flex",alignItems:"center",children:[e(T,{result:l}),e(r,{mr:1}),e(g,{children:m(l)})]})}),v=({states:l,stagedStates:t,onStagedStatesChange:o})=>{const a=O(),[p,n]=A(!1);F(()=>{o(l)},[l,o]);const d=c((i,u)=>{o(u)},[o]),f=c(()=>{o(t?.length?t:[])},[t,o]);return s(r,{pb:1,pt:1,className:a.container,children:[e(E,{title:"State",docLink:"https://backstage.spotify.com/docs/plugins/soundcheck/core-concepts/filters"}),e(I,{open:p,onOpen:()=>n(!0),onClose:()=>n(!1),className:a.formControl,multiple:!0,limitTags:4,disableCloseOnSelect:!0,"aria-label":"State",options:N,value:t,getOptionLabel:m,onChange:d,onBlur:f,ListboxComponent:y,renderOption:P,size:"small",popupIcon:e(L,{"data-testid":"selected-facets-expand"}),renderInput:i=>e(C,{...i,variant:"outlined"})})]})};export{v as StateFilter};
|
|
2
2
|
//# sourceMappingURL=StateFilter.esm.js.map
|
package/dist/components/FormControlledAutocomplete/FormControlledMultipleAutocomplete.esm.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{TextField as L,FormControlLabel as k,Checkbox as z}from"@material-ui/core";import F from"@material-ui/icons/CheckBox";import I from"@material-ui/icons/CheckBoxOutlineBlank";import{Autocomplete as O}from"@material-ui/lab";import{Controller as
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{TextField as L,FormControlLabel as k,Checkbox as z}from"@material-ui/core";import F from"@material-ui/icons/CheckBox";import I from"@material-ui/icons/CheckBoxOutlineBlank";import{Autocomplete as O}from"@material-ui/lab";import{Controller as W}from"react-hook-form";import{ListboxVirtualized as w}from"../ListboxVirtualized/ListboxVirtualized.esm.js";import{useStyles as y}from"./FormControlledAutocomplete.esm.js";const A=({name:i,rules:p,label:c,control:u,options:f,getOptionLabel:h,getOptionValue:m,onChange:b,disabled:C,placeholder:g,freeSolo:x=!0,width:s,helperText:v,disableClearable:S,fullWidth:d})=>{const a=y();return e(W,{name:i,control:u,rules:p,render:({field:l,fieldState:n})=>e(O,{...l,value:l.value,freeSolo:x,autoSelect:!0,"data-testid":`${i}-autocomplete`,style:s?{width:s}:{minWidth:d?void 0:250},disabled:C,options:f,getOptionLabel:h,classes:{clearIndicator:a.clearIndicator},disableClearable:S,fullWidth:d,multiple:!0,size:"small",renderInput:o=>e(L,{...o,variant:"outlined",label:c,error:n.invalid,placeholder:l.value?.length?"":g,FormHelperTextProps:{className:a.helperText},margin:"dense",className:a.noMargin,helperText:v??(n.error?n.error.message:null)}),renderOption:(o,{selected:t})=>e(k,{onClick:r=>r.preventDefault(),control:e(z,{icon:e(I,{fontSize:"small"}),checkedIcon:e(F,{fontSize:"small"}),checked:t}),label:o}),onChange:(o,t)=>{const r=m?t.map(T=>m(T)):t;b?.(r),l.onChange(r)},ListboxComponent:w})})};export{A as FormControlledMultipleAutocomplete};
|
|
2
2
|
//# sourceMappingURL=FormControlledMultipleAutocomplete.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as g,jsxs as v}from"react/jsx-runtime";import{useApi as O,configApiRef as x}from"@backstage/core-plugin-api";import{makeStyles as P,alpha as w,TextField as y,CircularProgress as E}from"@material-ui/core";import A from"@material-ui/lab/Autocomplete";import{useMemo as F,useCallback as I,useEffect as h,Fragment as G}from"react";import{useSearchParams as L}from"react-router-dom";import N from"react-use/lib/useLocalStorage";import{useGroupOptions as j}from"../../hooks/groups/useGroupOptions.esm.js";const R=P(o=>({root:{width:"100%",minWidth:250},textField:{"& $notchedOutline":{borderColor:w(o.page.fontColor,.25)},"&:hover $notchedOutline":{borderColor:o.page.fontColor}},input:{backgroundColor:"transparent",color:o.page.fontColor},clearIndicator:{color:o.page.fontColor},popupIndicator:{color:o.page.fontColor},notchedOutline:{}}),{name:"SoundcheckGroupSelector"}),T=({setError:o,margin:S,baseClass:a,searchParam:c="group"})=>{const{options:e,isLoading:i,isError:d}=j(),t=R(),[p,C]=L(),[n,b]=N("soundcheck.overview.groupRef",null),s=p.get(c),m=O(x).getOptionalString("soundcheck.overview.defaultSelectedGroupType"),f=F(()=>{if(!i&&e.length){if(s||n){const r=s??n;return e.find(u=>u.ref===r)??e[0]}else if(m)return e.find(r=>r.type===m)??e[0];return e[0]}return null},[m,i,e,s,n]),l=I((r,u)=>{r&&p.get(c)!==r&&(p.set(c,r),C(p,{replace:u}),b(r))},[c,p,b,C]),k=I((r,u)=>{l?.(u?.ref)},[l]);return h(()=>{n&&!s&&l(n,!0)},[n,s,l]),h(()=>{l(f?.ref,!0)},[l,f]),h(()=>{o?.(d?new Error("Error loading groups"):void 0)},[d,o]),d?null:g(A,{"aria-label":"Current group",className:a?"":t.root,classes:{clearIndicator:a?"":t.clearIndicator,popupIndicator:a?"":t.popupIndicator},disableClearable:!0,options:e??[],loading:i,groupBy:r=>r.key,value:f,freeSolo:!1,onChange:k,getOptionLabel:r=>r.name,renderInput:r=>g(y,{...r,variant:"outlined",placeholder:i?"Loading":"Select a group",className:t.textField,margin:S,InputProps:{...r.InputProps,className:a?"":t.input,classes:{notchedOutline:a?"":t.notchedOutline},endAdornment:v(G,{children:[i?g(E,{color:"inherit",size:20}):null,r.InputProps.endAdornment]})}})})};export{T as GroupSelector};
|
|
2
2
|
//# sourceMappingURL=GroupSelector.esm.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsxs as y,Fragment as F,jsx as r}from"react/jsx-runtime";import{makeStyles as L,Tooltip as $,IconButton as x,CircularProgress as b}from"@material-ui/core";import M from"@material-ui/icons/GetApp";import O from"@material-ui/icons/Publish";import P from"js-yaml";import{capitalize as a}from"lodash";import{useState as E}from"react";import{useSoundcheckAlert as H}from"../../hooks/useSoundcheckAlert.esm.js";const J=L(e=>({button:{height:"44px",lineHeight:"1.25rem",padding:e.spacing(1.5,1),marginRight:e.spacing(.5),borderRadius:"12px",color:e.palette.text.primary}})),V=({resourceType:e,disableImport:w,disableExport:I,onImport:A,onExport:S})=>{const k=`${a(e)} Import Success`,n=`Error Importing ${a(e)}s`,v=`Error Exporting ${a(e)}s`,l=J(),{showAlert:s}=H(),[z,c]=E(!1),[C,p]=E(!1),N=async()=>{try{p(!0),await S()}catch(t){s({title:v,message:`An error occurred while exporting ${e}s: ${t.message}`,severity:"error"})}finally{p(!1)}},R=async t=>{try{c(!0);const o=t.target?.files?.[0],m=new FileReader;o&&(m.readAsText(o,"utf-8"),m.onload=async T=>{const d=T.target?.result?.toString();if(d){const j=P.load(d);try{const{created:g,skipped:B,failed:i}=await A(j);let h=k,u="success",f=`Successfully imported ${g.length} ${e}(s), failed ${i.length} ${e}(s), ${B.length} ${e}(s) already existed.`;i.length&&(h=n,u=g.length?"warning":"error",f+=` Errors: ${JSON.stringify(i)}.`),s({title:h,message:f,severity:u})}catch{}}})}catch(o){s({title:n,message:`An error occurred while importing ${e}s: ${o.message}`,severity:"error"})}finally{t.target.value="",c(!1)}};return y(F,{children:[r($,{title:`Export all ${e}s`,children:r(x,{className:l.button,disabled:I,onClick:N,children:C?r(b,{size:24}):r(O,{})})}),r($,{title:`Import YAML ${e}(s)`,children:y(x,{className:l.button,disabled:w,component:"label",children:[z?r(b,{size:24}):r(M,{}),r("input",{type:"file",hidden:!0,onChange:R,accept:".yaml"})]})})]})};export{V as ImportExportPanel};
|
|
2
|
+
//# sourceMappingURL=ImportExportPanel.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as
|
|
1
|
+
import{jsxs as n,Fragment as r,jsx as e}from"react/jsx-runtime";import{Link as y}from"@backstage/core-components";import{useRouteRef as u}from"@backstage/core-plugin-api";import{TableCell as s,Box as c,Typography as d}from"@material-ui/core";import{makeStyles as N}from"@material-ui/core/styles";import{Skeleton as o}from"@material-ui/lab";import"react-circular-progressbar/dist/styles.css";import{useSearchParams as w}from"react-router-dom";import{trackCheckDetailsRouteRef as S}from"../../routes.esm.js";import{compactNumberFormatter as m}from"../../utils/formatters.esm.js";import{CheckStatusBar as B}from"../CheckStatusBar/CheckStatusBar.esm.js";import{PassPercentageProgressbar as C}from"../PassingPercentProgressbar/PassPercentageProgressbar.esm.js";const R=N(t=>({checkContent:{display:"flex",alignItems:"center",gap:t.spacing(2),width:"100%",paddingTop:t.spacing(1),paddingBottom:t.spacing(1)},checkStatus:{display:"flex",alignItems:"center",gap:t.spacing(1),minWidth:"fit-content"},checkName:{display:"flex",alignItems:"center"},checkNameLink:{color:"inherit",textDecoration:"none","&:hover":{textDecoration:"none"}},passingText:{color:t.palette.text.secondary,display:"flex",flexDirection:"column",alignItems:"flex-end",lineHeight:1.2,minWidth:"40px"},categoryBarSection:{display:"flex",flexDirection:"column",alignItems:"flex-end",width:"100%",justifyContent:"flex-end"},categoryBar:{"& .MuiBox-root > div":{height:"8px"},width:"100%"},skeleton:{backgroundColor:t.palette.action.hover},passingTextCell:{width:"100px",paddingRight:0,paddingTop:t.spacing(1),paddingBottom:t.spacing(1)}})),I=({check:t,status:a,theme:h,trackId:g})=>{const i=R(),x=u(S),[p]=w(),l=a?a.numberOfEntities-a.notApplicable-a.exempt:0,f=l>0?Math.round((a?.passed??0)/l*100):0,k=`${x({trackId:g,checkId:t.id})}${p.toString()?`?${p.toString()}`:""}`;return n(r,{children:[e(s,{style:{width:"120px",paddingRight:0},children:e(c,{className:i.checkStatus,children:a?e(C,{passPercentage:f}):n(r,{children:[e(o,{variant:"circle",width:24,height:24,className:i.skeleton}),e(o,{width:45,height:24,className:i.skeleton})]})})}),e(s,{style:{width:"300px",paddingRight:0},children:e(c,{className:i.checkName,children:e(y,{to:k,className:i.checkNameLink,children:e(d,{children:t.name})})})}),e(s,{style:{width:"250px",paddingRight:0},children:e(c,{className:i.categoryBarSection,children:a?e(c,{style:{width:"100%",display:"flex",justifyContent:"flex-end"},children:e(B,{status:a,className:i.categoryBar})}):e(o,{variant:"rect",width:250,height:8,className:i.skeleton})})}),e(s,{style:{width:"100px",paddingRight:0,paddingTop:h.spacing(1),paddingBottom:h.spacing(1)},children:e(c,{className:i.passingText,children:a?n(r,{children:[n(d,{variant:"caption",children:[m(a.passed)," of"," ",m(l)]}),e(d,{variant:"caption",children:"passing"})]}):n(r,{children:[e(o,{width:60,height:16,className:i.skeleton}),e(o,{width:40,height:16,className:i.skeleton})]})})})]})};export{I as CheckRowContent};
|
|
2
2
|
//# sourceMappingURL=CheckRowContent.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as e,
|
|
1
|
+
import{jsx as e,Fragment as o,jsxs as d}from"react/jsx-runtime";import{TableRow as s,useTheme as k,TableContainer as v,Table as m,TableBody as h,TableCell as p,Box as C,IconButton as x,Typography as y,Collapse as T}from"@material-ui/core";import{makeStyles as b}from"@material-ui/core/styles";import w from"@material-ui/icons/KeyboardArrowDown";import N from"@material-ui/icons/KeyboardArrowUp";import{memo as S,useState as I,useCallback as B}from"react";import{CheckRowContent as R}from"./CheckRowContent.esm.js";const g=b(l=>({root:{width:"100%"},levelCell:{display:"flex",alignItems:"flex-start",width:"100%",padding:l.spacing(1)},levelContent:{display:"flex",flexDirection:"column",gap:l.spacing(2),width:"100%"},levelHeader:{display:"flex",alignItems:"center"},levelName:{fontSize:"1rem",fontWeight:500,lineHeight:1,marginLeft:l.spacing(1)},headerCell:{fontWeight:500,color:l.palette.text.secondary,padding:l.spacing(2)}})),f=S(({checks:l,checkStatuses:i,theme:n,trackId:a})=>e(o,{children:l.map(t=>{const c=i?.find(r=>r.id===t.id);return e(s,{children:e(R,{check:t,status:c,theme:n,trackId:a})})})}));f.displayName="CheckRows";const u=({level:l,children:i})=>{const n=g(),[a,t]=I(!0),c=B(()=>{t(r=>!r)},[]);return d(o,{children:[e(s,{children:e(p,{colSpan:4,className:n.levelCell,children:d(C,{className:n.levelHeader,children:[e(x,{size:"small",onClick:c,children:a?e(N,{}):e(w,{})}),e(y,{className:n.levelName,children:l.name??`Level ${l.ordinal}`})]})})}),e(s,{children:e(p,{style:{paddingTop:0,paddingBottom:0},children:e(T,{in:a,timeout:"auto",unmountOnExit:!0,children:e(m,{size:"small",padding:"none",children:e(h,{children:i})})})})})]})},L=({track:l,checkStatuses:i})=>{const n=g(),a=k();return l.levels?.length?e(v,{component:"div",className:n.root,children:e(m,{children:e(h,{children:l.levels.map(t=>e(u,{level:t,children:e(f,{checks:t.checks,checkStatuses:i,theme:a,trackId:l.id})},t.ordinal))})})}):null};export{u as LevelRow,L as LevelsTable};
|
|
2
2
|
//# sourceMappingURL=LevelsTable.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as p,Fragment as s,jsx as r}from"react/jsx-runtime";import{withStyles as w,Button as C,makeStyles as S,Popover as P,TextField as
|
|
1
|
+
import{jsxs as p,Fragment as s,jsx as r}from"react/jsx-runtime";import{withStyles as w,Button as C,makeStyles as S,Popover as P,TextField as I,Checkbox as O}from"@material-ui/core";import T from"@material-ui/icons/ArrowDropDown";import{Autocomplete as z}from"@material-ui/lab";import{useState as F}from"react";import{ListboxVirtualized as L}from"../ListboxVirtualized/ListboxVirtualized.esm.js";const d=w(o=>({root:{color:o.palette.text.primary,paddingLeft:o.spacing(1),paddingRight:o.spacing(1),textTransform:"initial",fontSize:o.typography.body1.fontSize}}))(C),$=S(o=>({root:{borderBottom:`1px solid ${o.palette.grey.A100}`,padding:o.spacing(1.5),backgroundColor:o.palette.background.paper},popper:{width:300,height:400,overflow:"hidden"},paper:{boxShadow:"none",margin:0},popperDisablePortal:{width:"100% !important"},listbox:{border:"none",height:400},option:{padding:`${o.spacing(.5)}px !important`,'&[data-selected="true"]':{background:"inherit"}},chips:{display:"flex",flexWrap:"wrap"},chip:{margin:1}})),B=({name:o,options:c,label:l,icon:m,filters:h,setFilters:u,disabled:g,customRenderOption:f})=>{const t=$(),[n,a]=F(null),b=e=>{a(e.currentTarget)},x=()=>{a(null)},v=(e,i)=>{u(i)},y=e=>r(I,{...e,name:"filter",variant:"outlined",placeholder:"Filter",fullWidth:!0}),k=(e,{selected:i})=>p(s,{children:[r(O,{value:e,checked:i,color:"primary"}),e]});return p(s,{children:[r(d,{startIcon:m,endIcon:r(T,{}),onClick:b,disabled:g,children:l}),r(P,{id:`${l}-filter-popover`,open:!!n,anchorEl:n,onClose:x,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},PaperProps:{elevation:4,className:t.popper},children:r(z,{multiple:!0,disablePortal:!0,classes:{root:t.root,paper:t.paper,popperDisablePortal:t.popperDisablePortal,listbox:t.listbox,option:t.option},ListboxComponent:L,renderOption:f??k,id:`multi-select-filter-${o}--select`,value:h,options:c,limitTags:3,onChange:v,getOptionSelected:(e,i)=>e.toLowerCase()===i.toLowerCase(),renderInput:y,renderTags:()=>null,closeIcon:null,popupIcon:null,handleHomeEndKeys:!0,clearOnEscape:!0,open:!0})})]})};export{d as QuickFilterButton,B as default};
|
|
2
2
|
//# sourceMappingURL=MultiSelectFilter.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as
|
|
1
|
+
import{jsxs as p,jsx as n,Fragment as S}from"react/jsx-runtime";import{makeStyles as j,Typography as g,TextField as w,CircularProgress as R,Switch as V}from"@material-ui/core";import c from"@material-ui/core/Box";import z from"@material-ui/icons/Search";import{Autocomplete as D}from"@material-ui/lab";import{groupBy as H,sortBy as M,maxBy as N}from"lodash";import{useContext as X,useEffect as $,useMemo as v}from"react";import{useSearchParams as q}from"react-router-dom";import J from"react-use/lib/useLocalStorage";import{GroupSelector as Q}from"../GroupSelector/GroupSelector.esm.js";import{OverviewPageContext as U}from"./OverviewPageContent.esm.js";const Y=j(r=>({wrapper:{background:r.palette.background.default,paddingTop:r.spacing(0),paddingBottom:r.spacing(2),paddingRight:r.spacing(3),display:"flex",gap:r.spacing(3)},switchLabel:{marginLeft:r.spacing(1.5)}})),Z=({setError:r,unfilteredFacets:I,kind:h,type:d,onChange:x,isLoading:y,isFixedGroup:E})=>{const L=Y(),o={types:I?.types.filter(({count:e})=>e>0)??[]},[b,B]=J("soundcheck-overview-pivot-status",!1),[k]=q(),P=k.get("kind"),W=k.get("type"),{searchValue:A,updateSearchValue:F,pivot:m,updatePivot:T}=X(U);$(()=>{b!==m&&T(!!b)},[]);const s=v(()=>o?.types.map(({kind:e,type:t,count:a})=>{const i=`${e}|${t??""}`;return{facetKind:e,facetType:t,key:i,label:`${t??e} (${a>50?"50+":a})`,id:i,count:a}}).sort((e,t)=>e.key.localeCompare(t.key))??[],[o?.types]),C=v(()=>{const e=H(s,t=>t.facetKind);return Object.values(e).map(t=>t.reduce((a,i)=>{const u=a.count+i.count,l=`${i.facetKind}|all`;return{facetKind:i.facetKind,facetType:"all",count:u,key:l,id:l,label:`all ${i.facetKind.toLowerCase()}s (${u>50?"50+":u})`}},{count:0,facetType:"all",facetKind:"",key:"",label:"",id:""}))},[s]),K=v(()=>M([...s,...C],"facetKind"),[C,s]);$(()=>{if(y)return;const e=h??P,t=d??W,a=o?.types&&o.types.length>=0,i=!e&&a,u=!!e&&t!=="all"&&a&&!o?.types.find(({kind:l,type:f})=>e===l&&(!d&&!f||d===f));if(i||u){const l=N(s,f=>f.count);x(l?.facetKind??"",l?.facetType??"",!0)}},[h,P,d,y]);const G=K.find(e=>e.key===`${h}|${d??""}`)??null,O=o&&(o.types?.length??0)>0;return p(c,{className:L.wrapper,children:[!E&&p(c,{flex:1,maxWidth:364,children:[n(g,{variant:"subtitle2",component:"div",children:"Group"}),n(Q,{baseClass:!0,margin:"dense",setError:r})]}),O&&p(S,{children:[p(c,{flex:1,maxWidth:500,children:[n(g,{variant:"subtitle2",component:"div",children:"Entity Type"}),n(D,{"aria-label":"Entity Type Selection",disableClearable:!0,options:K??[],freeSolo:!1,groupBy:e=>e.facetKind,getOptionLabel:e=>e.label,value:G,onChange:(e,t)=>x(t.facetKind,t.facetType,!0),renderInput:e=>n(w,{...e,variant:"outlined",placeholder:"Select entity type",margin:"dense",fullWidth:!0,InputProps:{...e.InputProps,endAdornment:p(S,{children:[y?n(R,{color:"inherit",size:20}):null,e.InputProps.endAdornment]})}})})]}),p(c,{maxWidth:580,flex:1,children:[n(g,{variant:"subtitle2",component:"div",children:"Search Entities"}),n(w,{margin:"dense",placeholder:"Search entities",variant:"outlined",fullWidth:!0,value:A,onChange:e=>F(e.currentTarget.value),InputProps:{startAdornment:n(c,{marginRight:.75,display:"flex",alignItems:"center",children:n(z,{color:"inherit"})})}})]}),p(c,{display:"flex",flexDirection:"column",children:[n(g,{style:{marginLeft:10},variant:"subtitle2",component:"div",children:"Pivot"}),n(c,{flex:1,display:"flex",alignItems:"center",children:n(V,{checked:m,onChange:()=>{B(!m),T(!m)},inputProps:{"aria-label":"pivot overview table"}})})]})]})]})};export{Z as OverviewPageHeader};
|
|
2
2
|
//# sourceMappingURL=OverviewPageHeader.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{parseEntityRef as f}from"@backstage/catalog-model";import{Link as k}from"@backstage/core-components";import{makeStyles as u}from"@material-ui/core";import{memo as $}from"react";import{ResultState as p}from"../../../graphql/generated/index.esm.js";import{CheckIcon as v}from"../../CheckIcon/CheckIcon.esm.js";import{CheckCellTooltip as N}from"./CheckCellTooltip.esm.js";const g=u(i=>({root:{padding:0},iconWrapper:{padding:i.spacing(1.5),display:"flex",alignItems:"center",justifyContent:"center"},link:{"&:hover $iconWrapper, &:active $iconWrapper, &:focus $iconWrapper":{backgroundColor:i.palette.action.hover}},icon:{width:"17px",height:"17px"},virtualized:{borderBottom:`1px solid ${i.palette.divider}`,borderRight:`1px solid ${i.palette.divider}`}})),y=$(({trackId:i,check:c,entityRef:r,result:o,entityRoute:m,isVirtualized:a,timestamp:h})=>{const e=g();if(typeof r!="string"){const d=t("div",{className:e.iconWrapper,children:t("div",{className:e.icon})});return a?t("div",{className:`${e.root} ${e.virtualized}`,"aria-hidden":!0,children:d}):t("td",{className:e.root,"aria-hidden":!0,children:d})}const n=t(v,{className:e.icon,result:o??p.NotReported,timestamp:h}),l=t("div",{className:e.iconWrapper,children:n}),s=o&&o===p.NotApplicable?l:t(k,{className:e.link,to:`${m(f(r))}/soundcheck/tracks/${i}/checks/${c.id}`,children:l});return a?t("div",{className:`${e.root} ${e.virtualized}`,children:t(N,{check:c,icon:n,entityRef:r,children:s})}):t("td",{className:`${e.root}`,children:s})});export{y as CheckCell};
|
|
2
2
|
//# sourceMappingURL=CheckCell.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as c,jsxs as
|
|
1
|
+
import{jsx as c,jsxs as r}from"react/jsx-runtime";import{makeStyles as l,Typography as p}from"@material-ui/core";import{RowHeights as a}from"../resultsTableUtils.esm.js";import{TrackCheckStatusCount as n}from"./TrackCheckStatusCount.esm.js";const s=l(e=>({checkNameCell:{padding:0,backgroundColor:e.palette.background.paper},checkNameContent:{padding:`0 ${e.spacing(2)}px`,display:"flex",justifyContent:"space-between",alignItems:"center"},checkNameTypography:{overflow:"hidden",textOverflow:"ellipsis",fontWeight:e.typography.body1.fontWeight},checkIndicator:{flexBasis:e.spacing(8)},checkNameCellVirtualized:{height:`${a.check}px`,lineHeight:`${a.check}px`,borderBottom:`1px solid ${e.palette.divider}`,borderRight:`1px solid ${e.palette.divider}`}})),h=({name:e,progress:o,checkId:i})=>{const t=s();return c("div",{className:t.checkNameCell,"aria-label":`${e} check`,children:r("div",{className:`${t.checkNameContent} ${t.checkNameCellVirtualized}`,children:[c(p,{variant:"subtitle2",component:"p",className:t.checkNameTypography,children:e}),c(n,{progress:o,checkId:i})]})})};export{h as CheckNameCell};
|
|
2
2
|
//# sourceMappingURL=CheckNameCell.esm.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as r,jsxs as o,Fragment as d}from"react/jsx-runtime";import{useRouteRef as u}from"@backstage/core-plugin-api";import{makeStyles as k,Tooltip as g,Box as t}from"@material-ui/core";import{useCallback as S}from"react";import{useSearchParams as x,useNavigate as D}from"react-router-dom";import{ResultState as p}from"../../../graphql/generated/index.esm.js";import{checkDetailsRouteRef as I}from"../../../routes.esm.js";import{CheckIcon as h}from"../../CheckIcon/CheckIcon.esm.js";const y=k(()=>({icon:{fontSize:"inherit"},wrapper:{"&:hover":{cursor:"pointer"}}})),A=({checkId:c,progress:e})=>{const s=y(),[l]=x(),n=l.get("group"),i=l.get("type"),a=D(),m=u(I),f=S(()=>{a(`${m({checkId:c})}?owners=${n}${i&&i!=="all"?`&types=${i}`:""}`)},[c,m,i,a,n]);return r(g,{title:o(d,{children:[o(t,{children:[e.PASSED," ",e.PASSED===1?"entity":"entities"," ","passing check."]}),o(t,{children:[e.FAILED," ",e.FAILED===1?"entity":"entities"," ","failing check."]}),r(t,{children:"Click for more details."})]}),children:o(t,{onClick:f,className:s.wrapper,display:"flex",alignItems:"center",children:[r(h,{tooltip:!1,className:s.icon,result:p.Passed}),r(t,{marginRight:"4px",children:e.PASSED}),r(h,{tooltip:!1,className:s.icon,result:p.Failed}),r(t,{children:e.FAILED})]})})};export{A as TrackCheckStatusCount};
|
|
2
|
+
//# sourceMappingURL=TrackCheckStatusCount.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as l}from"react/jsx-runtime";import{CheckCell as o}from"./CheckCell.esm.js";import{CheckNameCell as i}from"./CheckNameCell.esm.js";import{EntityRefCell as d}from"./EntityRefCell.esm.js";import{TrackBadgeCell as s}from"./TrackBadgeCell.esm.js";import{TrackLevelHeaderCell as m,TrackLevelHeaderFill as k}from"./TrackLevelHeaderCell.esm.js";import{TrackTitleCell as y}from"./TrackTitleCell.esm.js";const p=e=>({type:"TrackHeader",render:()=>l(y,{name:e})}),C=e=>({type:"LevelHeader",render:()=>e?l(m,{name:e}):l(k,{})}),f=(e,t,r)=>l(i,{name:e,progress:t,checkId:r}),u=(e,t,r)=>({type:"CheckTitle",render:()=>f(e,t,r)}),h=({trackId:e,check:t,entityRef:r,result:c,entityRoute:n,timestamp:a})=>l(o,{check:t,entityRef:r,entityRoute:n,trackId:e,result:c,isVirtualized:!0,timestamp:a}),R=(e,t,r,c,n,a)=>({type:"CheckResult",render:()=>l(h,{trackId:e,check:t,entityRef:r,result:c,entityRoute:n,timestamp:a})}),T=(e,t)=>l(d,{entityRef:e,noTransform:t}),H=(e,t)=>({type:"EntityHeader",render:()=>T(e,t)}),v=(e,t,r)=>({type:"LevelBadge",render:()=>l(s,{small:r,trackStatus:e,trackType:t})}),I=e=>t=>{const r=e[t.rowIndex].cells[t.columnIndex];return r?l("div",{style:t.style,children:r.render()}):l("div",{style:t.style})};export{I as cellRenderer,R as checkResultCell,u as checkTitleCell,H as entityHeaderCell,C as levelHeaderCell,v as trackBadgeCell,p as trackHeaderCell};
|
|
2
2
|
//# sourceMappingURL=cellRenderer.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as i}from"react/jsx-runtime";import{uniq as y}from"lodash";import{useMemo as l}from"react";import{ResultsTable as f}from"./ResultsTable.esm.js";const d=({facets:r,ownerEntityRef:o,kind:m,type:a,setError:n})=>{const c=l(()=>{const s=new Map;r.types.forEach(({kind:e,type:t})=>{const p=`${e}|${t??""}`;s.set(p,i(f,{ownerEntityRef:o,kind:e,type:t,setError:n},p))});for(const e of y(r.types.map(t=>t.kind))){const t=`${e}|all`;s.set(t,i(f,{ownerEntityRef:o,kind:e,type:"all",setError:n},t))}return s},[r,o,n]);return i("div",{children:c.get(`${m}|${a??""}`)})};export{d as OverviewTableContent};
|
|
2
2
|
//# sourceMappingURL=OverviewTableContent.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as o,jsxs as P,Fragment as D}from"react/jsx-runtime";import{useRouteRef as M}from"@backstage/core-plugin-api";import{entityRouteRef as q}from"@backstage/plugin-catalog-react";import{makeStyles as B,Grid as I}from"@material-ui/core";import{useContext as J,useEffect as y,useState as K,useRef as Q,useLayoutEffect as U,useMemo as X}from"react";import{VariableSizeGrid as Y}from"react-window";import"@backstage/catalog-model";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import{useTrackOverviewForOwner as Z}from"../../hooks/certifications/useTrackOverviewForOwner.esm.js";import"@spotify/backstage-plugin-soundcheck-common";import"../../hooks/useSoundcheckAlert.esm.js";import"../../hooks/useConfirmationModal.esm.js";import"react-router-dom";import{EmptyState as _}from"../EmptyState/EmptyState.esm.js";import"../OverviewPage/OverviewPage.esm.js";import"@spotify/backstage-plugin-core";import"../SoundcheckQueryClientProvider/SoundcheckQueryClientProvider.esm.js";import{OverviewPageContext as ee}from"../OverviewPage/OverviewPageContent.esm.js";import"../Pagination/Pagination.esm.js";import{useCursorPagination as te,CursorPagination as re}from"../Pagination/CursorPagination.esm.js";import{cellRenderer as oe}from"./Cell/cellRenderer.esm.js";import{OverviewTableSkeleton as ie}from"./OverviewTableSkeleton.esm.js";import{ResultsTableHeader as ne}from"./ResultsTableHeader.esm.js";import{generateRowsPivoted as ae,generateRows as le,generateHeaderRowPivoted as se,generateHeaderRow as ue}from"./ResultsTableRow.esm.js";import{RowHeights as E,CellWidths as S,calculateTableWidth as me}from"./resultsTableUtils.esm.js";import
|
|
1
|
+
import{jsx as o,jsxs as P,Fragment as D}from"react/jsx-runtime";import{useRouteRef as M}from"@backstage/core-plugin-api";import{entityRouteRef as q}from"@backstage/plugin-catalog-react";import{makeStyles as B,Grid as I}from"@material-ui/core";import{useContext as J,useEffect as y,useState as K,useRef as Q,useLayoutEffect as U,useMemo as X}from"react";import{VariableSizeGrid as Y}from"react-window";import"@backstage/catalog-model";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import{useTrackOverviewForOwner as Z}from"../../hooks/certifications/useTrackOverviewForOwner.esm.js";import"@spotify/backstage-plugin-soundcheck-common";import"../../hooks/useSoundcheckAlert.esm.js";import"../../hooks/useConfirmationModal.esm.js";import"react-router-dom";import{EmptyState as _}from"../EmptyState/EmptyState.esm.js";import"../OverviewPage/OverviewPage.esm.js";import"@spotify/backstage-plugin-core";import"../SoundcheckQueryClientProvider/SoundcheckQueryClientProvider.esm.js";import{OverviewPageContext as ee}from"../OverviewPage/OverviewPageContent.esm.js";import"../Pagination/Pagination.esm.js";import{useCursorPagination as te,CursorPagination as re}from"../Pagination/CursorPagination.esm.js";import{cellRenderer as oe}from"./Cell/cellRenderer.esm.js";import{OverviewTableSkeleton as ie}from"./OverviewTableSkeleton.esm.js";import{ResultsTableHeader as ne}from"./ResultsTableHeader.esm.js";import{generateRowsPivoted as ae,generateRows as le,generateHeaderRowPivoted as se,generateHeaderRow as ue}from"./ResultsTableRow.esm.js";import{RowHeights as E,CellWidths as S,calculateTableWidth as me}from"./resultsTableUtils.esm.js";import ce from"./useWindowDimensions.esm.js";const W=25,pe=B(i=>({table:{backgroundColor:i.palette.background.paper,borderCollapse:"collapse",whiteSpace:"nowrap",textAlign:"left",overflow:"auto"},tableContainer:{backgroundColor:i.palette.background.paper}})),de=({setError:i,kind:c,type:l,ownerEntityRef:t})=>{const{cursor:x,pageSize:R,...p}=te({defaultPageSize:W,label:"entitiesPerPage"}),{debouncedSearchValue:s,pivot:u}=J(ee),{data:e,isLoading:d,isError:b}=Z(t,{kind:c,type:l==="all"?null:l},R,x,s);y(()=>{p.setCursor(""),p.setCurrentPage(0)},[s]);const k=pe(),g=M(q);y(()=>{i?.(b?new Error("Error loading track overview"):void 0)},[b,i]);const[H,z]=K(0),{height:T}=ce(),n=Q(null);U(()=>{e&&t&&n?.current&&z(n.current.clientWidth?n.current.clientWidth-16:100)},[n,e,t]);const{rows:h,headerRow:f,tableWidth:w,entityRefsWithPadding:N,getRowHeight:O,columnCount:V}=X(()=>{if(d||!e||!t)return{};const{tracks:a,entityRefs:r}=e;if(!r)return{};const m=r.length>=25?r:[...r,...Array.from({length:25-r.length},()=>{})],C=u?ae(a,r,g):le(a,m,g),v=C[0]?.cells?.length??m.length+1,G=u?se(a):ue(m),L=me(v-1)+60;return{rows:C,headerRow:G,tableWidth:L,entityRefsWithPadding:m,getRowHeight:j=>C[j]?.height??E.check,columnCount:v}},[e,g,d,t,u]);if(d)return o(ie,{});if(!e||!t)return null;const{totalCount:$,endCursor:A,prevCursor:F}=e;return!f||!w||!N||!h?.length?s?o(_,{title:"No Entities Found",description:`No entities found with name containing: '${s}'`}):null:P("div",{ref:n,children:[o(I,{"aria-label":`Check results for ${l??c}`,item:!0,xs:12,className:k.tableContainer,children:H>0&&P(D,{children:[o(ne,{headerRow:f,gridWidth:w}),o(Y,{className:k.table,columnCount:V,columnWidth:a=>a===0?S.trackTitle:S.checkResult,rowCount:h.length,rowHeight:O,height:T*.7-E.paginationControl-f.height,width:w,children:oe(h)},u?"entityView":"checkView")]})},`${c}|${l??""}`),o(re,{...p,totalCount:$,defaultPageSize:W,endCursor:A,prevCursor:F,pageSize:R,labelRowsPerPage:"Entities per page:"})]})};export{de as ResultsTable};
|
|
2
2
|
//# sourceMappingURL=ResultsTable.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as g}from"react/jsx-runtime";import{ResultState as R}from"../../graphql/generated/index.esm.js";import{entityHeaderCell as v,trackHeaderCell as w,trackBadgeCell as C,levelHeaderCell as H,checkTitleCell as E,checkResultCell as T}from"./Cell/cellRenderer.esm.js";import{CheckLabelCellType as y,CheckLabelCell as b}from"./Cell/CheckLabelCell.esm.js";import{TrackLevelHeaderFill as F}from"./Cell/TrackLevelHeaderCell.esm.js";import{findLongestRefTitle as L,calculateHeightForRefTitle as M,RowHeights as m}from"./resultsTableUtils.esm.js";const S=i=>{const r=L(i??[]);return{height:Math.min(M(r.length??1)-10,125),cells:[v(""),...i.map(t=>v(t||""))]}},A=(i,r,t)=>{const e=[];return i.forEach(({track:o,levels:s,trackStatuses:n})=>{e.push({height:m.trackTitle,cells:[w(o.name),...r.map(c=>{const l=c?n.find(a=>a.entityRef===c):void 0;return C(l,o.type??void 0)})]}),s.forEach(c=>{e.push({height:m.levelTitle,cells:[H(c.name),...r.map(l=>H(""))]}),c.checks.forEach(({check:l,results:a,totalPassing:k,totalFailing:p})=>{const f={PASSED:k,FAILED:p};e.push({height:m.check,cells:[E(l.name,f,l.id),...r.map(h=>{const d=a.find(u=>u.entityRef===h);return T(o.id,l,h,d?.result??R.NotApplicable,t,d?.timestamp??void 0)})]})})})}),e},P=i=>{const r=i.flatMap(({track:t,levels:e})=>{const o={label:t.name??t.id,description:t.description??"",cellType:y.track},s=e.flatMap(n=>{const c={label:n.name??`level ${n.ordinal}`,cellType:y.level},l=n.checks.map(({check:a})=>({label:a.name??a.id,description:a.description??"",cellType:y.check}));return[c,...l]});return[o,...s]});return{height:125,cells:[{type:"CheckHeader",render:()=>g(b,{})},...r.map(t=>({render:()=>g(b,{...t}),type:"CheckHeader"}))]}},x=(i,r,t)=>r.map(e=>{const o=v(e,!0),s=i.flatMap(({track:n,levels:c,trackStatuses:l})=>{const a=e?l.find(p=>p.entityRef===e):void 0,k=c.flatMap(p=>{const f=p.checks.map(({check:h,results:d})=>T(n.id,h,e,d.find(u=>u.entityRef===e)?.result??R.NotApplicable,t));return[{type:"Filler",render:()=>g(F,{pivot:!0})},...f]});return[C(a,n.type??void 0,!0),...k]});return[o,...s]}).map(e=>({height:m.check,cells:e}));export{S as generateHeaderRow,P as generateHeaderRowPivoted,A as generateRows,x as generateRowsPivoted};
|
|
2
2
|
//# sourceMappingURL=ResultsTableRow.esm.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsxs as a,Fragment as n,jsx as t}from"react/jsx-runtime";import{makeStyles as c,useTheme as p,Box as m,Typography as g}from"@material-ui/core";import d from"@material-ui/icons/Check";import{CircularProgressbarWithChildren as h,buildStyles as f}from"react-circular-progressbar";import{getPercentageColor as u}from"../../utils/colors.esm.js";const C=c(e=>({progressCircle:{width:"24px !important",height:"24px !important"},passPercentage:{fontWeight:"bold",fontSize:"1.25em",minWidth:"50px"},icon:{color:e.palette.background.default,fontSize:15}})),P=({passPercentage:e,getColor:i})=>{const r=p(),o=C(r),s=i||(l=>u(r,l));return a(n,{children:[t(m,{className:o.progressCircle,children:t(h,{value:e,strokeWidth:e===100?50:15,styles:f({strokeLinecap:"round",pathColor:s(e),trailColor:r.palette.divider}),children:e===100&&t(d,{className:o.icon})})}),a(g,{className:o.passPercentage,style:{color:s(e)},children:[e,"%"]})]})};export{P as PassPercentageProgressbar};
|
|
2
|
+
//# sourceMappingURL=PassPercentageProgressbar.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as t,jsxs as s,Fragment as d}from"react/jsx-runtime";import{useRouteRef as p,useRouteRefParams as
|
|
1
|
+
import{jsx as t,jsxs as s,Fragment as d}from"react/jsx-runtime";import{useRouteRef as p,useRouteRefParams as h}from"@backstage/core-plugin-api";import{useEntity as m}from"@backstage/plugin-catalog-react";import{SecretsContextProvider as L}from"@backstage/plugin-scaffolder-react";import{Routes as N,Route as l,Navigate as f}from"react-router-dom";import{ResultState as T}from"../graphql/generated/index.esm.js";import{useAllCertifications as S}from"../hooks/certifications/useAllCertifications.esm.js";import"@tanstack/react-query";import"../api.esm.js";import"../hooks/graphqlKeys.esm.js";import{useCertificationDetailsForTrack as P}from"../hooks/certifications/useCertificationDetailsForTrack.esm.js";import"@backstage/catalog-model";import"@spotify/backstage-plugin-soundcheck-common";import"react";import"../hooks/useSoundcheckAlert.esm.js";import"../hooks/useConfirmationModal.esm.js";import{usePlaylists as C}from"../hooks/playlists/usePlaylists.esm.js";import{certificationPlaylistTrackCheckRouteRef as x,certificationPlaylistTrackRouteRef as k,certificationPlaylistRouteRef as R,certificationTrackRouteRef as y,certificationRouteRef as g}from"../routes.esm.js";import{EntityContent as n}from"./EntityContent/EntityContent.esm.js";const b=()=>{const{entity:i}=m(),e=p(R),a=p(y),{isLoading:r,data:o}=C(i),{isLoading:c,data:A}=S(i);if(r||c)return null;const u=o?.[0]?.id,I=A?.[0]?.track.id;return!u&&!I?null:t(f,{to:u?e({playlistId:u}):a({trackId:I}),replace:!0})},v=()=>{const{entity:i}=m(),{playlistId:e}=h(R),a=p(k),{data:r}=C(i),o=r?.find(c=>c.id===e)?.trackIds[0];return o?t(f,{to:a({playlistId:e,trackId:o}),replace:!0}):null},F=i=>(i?.levels?.flatMap(e=>e.checks??[])??[]).filter(e=>e.result!==T.Exempt&&e.result!==T.NotApplicable)[0],E=()=>{const{entity:i}=m(),{playlistId:e,trackId:a}=h(k),{data:r}=P(i,a),o=p(x),c=F(r)?.id??r?.levels[0]?.checks[0]?.id;return c?t(f,{to:o({playlistId:e,trackId:a,checkId:c}),replace:!0}):null},j=()=>{const{entity:i}=m(),{trackId:e}=h(y),a=p(g),{data:r}=P(i,e),o=F(r)?.id??r?.levels?.find(c=>c.checks.length>0)?.checks[0].id;return o?t(f,{to:a({trackId:e,checkId:o}),replace:!0}):null},D=()=>t(L,{children:s(N,{children:[t(l,{path:x.path,element:t(n,{})}),t(l,{path:k.path,element:s(d,{children:[t(n,{}),t(E,{})]})}),t(l,{path:R.path,element:s(d,{children:[t(n,{}),t(v,{})]})}),t(l,{path:y.path,element:s(d,{children:[t(n,{}),t(j,{})]})}),t(l,{path:g.path,element:t(n,{})}),t(l,{path:"/",element:s(d,{children:[t(n,{}),t(b,{})]})})]})});export{j as RedirectToFirstCheck,v as RedirectToFirstPlaylistTrack,E as RedirectToFirstPlaylistTrackCheck,D as Router};
|
|
2
2
|
//# sourceMappingURL=Router.esm.js.map
|