@spotify/backstage-plugin-soundcheck 0.19.9 → 0.21.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 +22 -0
- package/dist/api.esm.js +1 -1
- package/dist/blueprints/IntegrationPageBlueprint.esm.js +1 -1
- package/dist/components/Alert/Alert.esm.js +2 -0
- package/dist/components/Badge/Badge.esm.js +2 -0
- package/dist/components/CampaignPage/CampaignPageBUI.esm.js +1 -1
- package/dist/components/CampaignsPage/CampaignListPageBUI.esm.js +1 -1
- package/dist/components/CampaignsPage/EditCampaignView.esm.js +1 -1
- package/dist/components/Charts/chartUtils.esm.js +1 -1
- package/dist/components/CheckForm/FormFields/RuleInput/AddMenuButton.esm.js +1 -1
- package/dist/components/CheckPage/CheckEntitiesTable/CheckEntitiesTableBUI.esm.js +1 -1
- package/dist/components/CheckPage/CheckPageBUI.esm.js +1 -1
- package/dist/components/CheckPage/ExemptionsTableBUI.esm.js +1 -1
- package/dist/components/ChecksPage/ChecksListPageBUI.esm.js +1 -1
- package/dist/components/ChecksTable/ChecksTable.esm.js +1 -1
- package/dist/components/CollectorPage/CollectorFactTableBUI.esm.js +1 -1
- package/dist/components/CollectorPage/Configurators/Common/FactCollectionConfig.esm.js +1 -1
- package/dist/components/CollectorPage/Configurators/SCM/ScmConfigurator.esm.js +1 -1
- package/dist/components/CollectorsPage/IntegrationsListPageBUI.esm.js +1 -1
- package/dist/components/ExpandableSection/ExpandableSection.esm.js +1 -1
- package/dist/components/Loading/Loading.esm.js +2 -0
- package/dist/components/RoutingPage/RoutingPageBUI.esm.js +1 -1
- package/dist/components/SoundcheckHeader/SoundcheckHeaderBUI.esm.js +1 -1
- package/dist/components/Stepper/Stepper.esm.js +2 -0
- package/dist/components/SummaryCard/SummaryCard.esm.js +1 -1
- package/dist/components/SummaryCard/SummaryCardActionsMenu.esm.js +1 -1
- package/dist/components/TechInsights/TechInsightsTableBUI.esm.js +1 -1
- package/dist/components/TechInsightsExplorerTable/TechInsightsExplorerTable.esm.js +1 -1
- package/dist/components/TimePeriodBar/TimePeriodBarBUI.esm.js +1 -1
- package/dist/components/TopFailingChecksTable/TopFailingChecksTableBUI.esm.js +1 -1
- package/dist/components/TrackBuilderPage/RunFirstCheckStep.esm.js +2 -0
- package/dist/components/TrackBuilderPage/SelectTracksStep.esm.js +2 -0
- package/dist/components/TrackBuilderPage/TrackBuilderPage.esm.js +2 -0
- package/dist/components/TrackBuilderPage/mockData.esm.js +2 -0
- package/dist/components/TrackPage/TrackEntitiesTable/TrackEntitiesTableBUI.esm.js +1 -1
- package/dist/components/TrackPage/TrackPageBUI.esm.js +1 -1
- package/dist/components/TracksPage/TracksListPageBUI.esm.js +1 -1
- package/dist/graphql/generated/index.esm.js +42 -46
- package/dist/hooks/filters/useFilters.esm.js +1 -1
- package/dist/routes.esm.js +1 -1
- package/dist/utils/charts.esm.js +1 -1
- package/dist/utils/facetFilters/types.esm.js +2 -0
- package/dist/utils/facetFilters/utils.esm.js +2 -0
- package/package.json +16 -16
- package/dist/components/Charts/BarChart/BarChart.esm.js +0 -2
- package/dist/components/Charts/BarChart/BarChartPlaceholder.esm.js +0 -2
- package/dist/components/Charts/BarChart/GroupPassRateHistoryBarChart.esm.js +0 -2
- package/dist/components/Charts/BarChart/TrackSummaryBarChart.esm.js +0 -2
- package/dist/components/Charts/ChartTypes.esm.js +0 -2
- package/dist/components/Charts/ChartWrapper/ChartWrapper.esm.js +0 -2
- package/dist/components/Charts/LineChart/EntityPassRateHistoryLineChart.esm.js +0 -2
- package/dist/components/Charts/LineChart/LineChart.esm.js +0 -2
- package/dist/components/Charts/LineChart/LineChartPlaceholder.esm.js +0 -2
- package/dist/components/Charts/LineChart/PassRateHistoryLineChart.esm.js +0 -2
- package/dist/components/Charts/LineChart/TableLineChart.esm.js +0 -2
- package/dist/components/Charts/LineChart/TrackPassRateHistoryLineChart.esm.js +0 -2
- package/dist/components/CheckHistoryChartCard/CheckHistoryChartCard.esm.js +0 -2
- package/dist/components/CollapsablePanel/CollapsablePanel.esm.js +0 -2
- package/dist/components/EntityPassRateCard/EntityPassRateCard.esm.js +0 -2
- package/dist/components/Expand/Expand.esm.js +0 -2
- package/dist/components/GroupPassRateCard/GroupPassRateCard.esm.js +0 -2
- package/dist/components/OverviewChartCard/OverviewChartCard.esm.js +0 -2
- package/dist/components/OverviewChartCard/OverviewChartCardStyles.esm.js +0 -2
- package/dist/components/PassRateGrid/PassRateGrid.esm.js +0 -2
- package/dist/components/PassRateGrid/PassRateMetadata.esm.js +0 -2
- package/dist/components/PassRateGrid/types.esm.js +0 -2
- package/dist/components/PassRateTable/NewPassRateTable.esm.js +0 -2
- package/dist/components/PassRateTable/PassRateTable.esm.js +0 -4
- package/dist/components/PassRateTable/types.esm.js +0 -2
- package/dist/components/SearchBar/SearchBar.esm.js +0 -2
- package/dist/components/TechHealth/Filters/FacetFilter.esm.js +0 -2
- package/dist/components/TechHealth/Filters/FilterProvider.esm.js +0 -2
- package/dist/components/TechHealth/Filters/Filters.esm.js +0 -2
- package/dist/components/TechHealth/Filters/FiltersHeader.esm.js +0 -2
- package/dist/components/TechHealth/Filters/FiltersSection.esm.js +0 -2
- package/dist/components/TechHealth/Filters/NumberOfDaysFilter.esm.js +0 -2
- package/dist/components/TechHealth/Filters/types.esm.js +0 -2
- package/dist/components/TechHealth/Filters/useFacetOptions.esm.js +0 -2
- package/dist/components/TechHealth/Filters/utils.esm.js +0 -2
- package/dist/components/TechHealth/Loading/Loading.esm.js +0 -2
- package/dist/components/TechHealth/Loading/TechHealthLoading.esm.js +0 -2
- package/dist/components/TechHealth/TechHealth.esm.js +0 -2
- package/dist/components/TechHealthSummary/SummaryAggregationsProvider.esm.js +0 -2
- package/dist/components/TechHealthSummary/TechHealthSummary.esm.js +0 -2
- package/dist/components/TechHealthTabs/ActionColumn.esm.js +0 -2
- package/dist/components/TechHealthTabs/CampaignResultsTab/CampaignResultsTab.esm.js +0 -2
- package/dist/components/TechHealthTabs/CheckResultsTab/CheckResultsTab.esm.js +0 -2
- package/dist/components/TechHealthTabs/CheckResultsTab/CheckTrendColumn.esm.js +0 -2
- package/dist/components/TechHealthTabs/EntityResultsTab/EntityResultsTab.esm.js +0 -2
- package/dist/components/TechHealthTabs/EntityResultsTab/EntityTrendColumn.esm.js +0 -2
- package/dist/components/TechHealthTabs/GroupResultsTab/GroupResultsTab.esm.js +0 -2
- package/dist/components/TechHealthTabs/GroupResultsTab/GroupTrendColumn.esm.js +0 -2
- package/dist/components/TechHealthTabs/MostRecentColumn.esm.js +0 -2
- package/dist/components/TechHealthTabs/NameColumn.esm.js +0 -2
- package/dist/components/TechHealthTabs/OwnerColumn.esm.js +0 -2
- package/dist/components/TechHealthTabs/PassRateTabHeader.esm.js +0 -2
- package/dist/components/TechHealthTabs/PassRateTabStyles.esm.js +0 -2
- package/dist/components/TechHealthTabs/TechHealthExportFunctions.esm.js +0 -2
- package/dist/components/TechHealthTabs/TrackResultsTab/TrackLevelTrendColumn.esm.js +0 -2
- package/dist/components/TechHealthTabs/TrackResultsTab/TrackResultsTab.esm.js +0 -2
- package/dist/components/TechHealthTabs/techHealthTabUtils.esm.js +0 -2
- package/dist/components/TrackHistoryChartCard/TrackHistoryChartCard.esm.js +0 -2
- package/dist/hooks/aggregations/useAggregatedCheckPassRateTrend.esm.js +0 -2
- package/dist/hooks/aggregations/useAggregatedEntityPassRateTrend.esm.js +0 -2
- package/dist/hooks/aggregations/useAggregatedGroupPassRateTrend.esm.js +0 -2
- package/dist/hooks/aggregations/useAggregatedTrackPassRateTrend.esm.js +0 -2
- package/dist/hooks/aggregations/useCheckPassRateTrend.esm.js +0 -2
- package/dist/hooks/aggregations/useEntityPassRateTrend.esm.js +0 -2
- package/dist/hooks/aggregations/useGroupPassRateTrend.esm.js +0 -2
- package/dist/hooks/aggregations/useTrackPassRateTrend.esm.js +0 -2
- package/dist/hooks/cache/useEntityCountCached.esm.js +0 -2
- package/dist/hooks/cache/useTrackCountCached.esm.js +0 -2
- package/dist/hooks/catalog/useGetEntityCount.esm.js +0 -2
- package/dist/hooks/entities/useEntityRefsForUser.esm.js +0 -2
- package/dist/hooks/facets/useFacetFilters.esm.js +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @spotify/backstage-plugin-soundcheck
|
|
2
2
|
|
|
3
|
+
## 0.21.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Removed remnants of the deprecated Tech Health page. Includes changes to config (BREAKING).
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependency `backstage` to `1.47.0`.
|
|
12
|
+
- Soundcheck - Fixes a duplicate and conflicting react-aria dependency.
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
- @spotify/backstage-plugin-core@0.8.14
|
|
17
|
+
- @spotify/backstage-plugin-soundcheck-common@0.20.0
|
|
18
|
+
|
|
19
|
+
## 0.20.0
|
|
20
|
+
|
|
21
|
+
### Minor Changes
|
|
22
|
+
|
|
23
|
+
- Removed deprecated Tech Health page.
|
|
24
|
+
|
|
3
25
|
## 0.19.9
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
package/dist/api.esm.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createApiRef as u}from"@backstage/core-plugin-api";import{GraphQLClient as y}from"graphql-request";import o from"pako";import{getSdk as l}from"./graphql/generated/index.esm.js";const g=u({id:"plugin.soundcheck"}),k=i=>"response"in i&&"errors"in i.response,p=i=>"response"in i&&"message"in i.response;class w{#a;#s;#t;constructor(t){this.#a=t.fetchApi,this.#s=t.discoveryApi;const e=new y("/graphql",{fetch:async(a,s)=>{const r=`${await this.#s.getBaseUrl("soundcheck")}${a}`;return this.#a.fetch(r,s)}});this.#t=l(e)}#r=t=>k(t)?t.response?.errors?.[0].message??`${t}`:p(t)?t.response.message:`${t}`;#e=async t=>{try{return await t()}catch(e){throw new Error(`Error from Soundcheck backend: ${this.#r(e)}`)}};async getMultipleTrackStatuses(t){return this.#e(async()=>{const{multipleTrackStatuses:e}=await this.#t.getMultipleTrackStatuses({input:t});return e})}async getAllCertifications(t,e=!1,a=!1){return this.#e(async()=>{const{certifications:s}=await this.#t.getAllCertifications({entityRef:t,includeFilteredChecks:e,includeDraftTracks:a});return s})}async getCertificationDetails(t,e=!1,a=!1){return this.#e(async()=>{const{certifications:s}=await this.#t.getCertificationDetails({entityRef:t,includeFilteredChecks:e,includeDraftTracks:a});return s})}async getCertificationDetailsForTrack(t,e,a){return this.#e(async()=>{const{trackCertification:s}=await this.#t.getCertificationDetailsForTrack({entityRef:t,trackId:e,includeFilteredChecks:a});return s})}async getCheckResultDetails(t,e,a){return this.#e(async()=>{const{checkResult:s}=await this.#t.getCheckResultDetails({entityRef:t,trackId:e,checkId:a});return s})}async getFacetsForOwner(t){return this.#e(async()=>{const{facetsForOwner:e}=await this.#t.getFacetsForOwner({ownerEntityRef:t});return e})}async getTrackOverviewForOwner(t,e,a,s,r){return this.#e(async()=>{const{trackOverviewForOwner:n}=await this.#t.getTrackOverviewForOwner({ownerEntityRef:t,facet:e,first:a,after:s,entitySearch:r});return n})}async getTracks(t){return this.#e(async()=>{const{tracks:e}=await this.#t.getTracks({filter:t});return e})}async getTracksApplicableEntityCount(t,e){return this.#e(async()=>{const{tracks:a}=await this.#t.getTracksApplicableEntityCount({filter:t,groupRef:e});return a?.edges?.map(({node:s})=>({id:s.id,applicableEntityCount:s.applicableEntityCount??0}))})}async getTrack(t){return this.#e(async()=>{const{track:e}=await this.#t.getTrack({id:t});return e})}async createTrack(t){return this.#e(async()=>{const{track:e}=await this.#t.createTrack({input:t});return e})}async updateTrack(t){return this.#e(async()=>{const{track:e}=await this.#t.updateTrack({input:t});return e})}async deleteTrack(t){return this.#e(async()=>{const{trackDeleted:e}=await this.#t.deleteTrack({trackId:t});return e})}async importTracks(t){return this.#e(async()=>{const{status:e}=await this.#t.importTracks({tracks:t});return e})}async recertifyTrack(t,e,a){return this.#e(async()=>{const{trackRecertified:s}=await this.#t.recertifyTrack({trackId:t,numberOfDays:e,loggedInUserRef:a});return s})}async getPlaylists(t){return this.#e(async()=>{const{playlists:e}=await this.#t.getPlaylists({entityRef:t});return e})}async getOperators(){return this.#e(async()=>{const{operators:t}=await this.#t.getOperators();return t})}async getCheck(t){return this.#e(async()=>(await this.#t.getCheck({id:t})).check)}async getChecks(t){return this.#e(async()=>{const{checkers:e}=await this.#t.getCheckers({filter:t});return e})}async getExecutableChecks(){return this.#e(async()=>{const{executableChecks:t}=await this.#t.getExecutableChecks();return t})}async createCheck(t){return this.#e(async()=>{const{check:e}=await this.#t.createCheck({input:t});return e})}async updateCheck(t){return this.#e(async()=>{const{check:e}=await this.#t.updateCheck({input:t});return e})}async deleteCheck(t){return this.#e(async()=>await this.#t.deleteChecker({checkerId:t}))}async executeCheck(t){return this.#e(async()=>{const{result:e}=await this.#t.executeCheck({input:t});return e})}async importChecks(t){return this.#e(async()=>{const{status:e}=await this.#t.importCheckers({checkers:t});return e})}async setEntityExempt(t){return this.#e(async()=>{const{setEntityExempt:e}=await this.#t.setEntityExempt({input:t});return e})}async setManualCheckResult(t){return this.#e(async()=>await this.#t.setManualCheckResult({input:t}))}async deleteExemption(t,e){return this.#e(async()=>await this.#t.deleteExemption({checkId:t,entityRef:e}))}async getExemption(t,e){return this.#e(async()=>await this.#t.getExemption({checkId:t,entityRef:e}))}async getExemptions(t,e,a,s,r){return this.#e(async()=>await this.#t.getExemptions({checkId:t,first:e,after:a,last:s,before:r}))}async getExemptCheckIds(t,e){return this.#e(async()=>await this.#t.getExemptCheckIds({entityRef:t,trackId:e}))}async getCollectors(t){return this.#e(async()=>{const{collectors:e}=await this.#t.getCollectors({ids:t});return e})}async getFactSchema(t,e){if(!(!t||!e))return this.#e(async()=>{const{factSchema:a}=await this.#t.getFactSchemas({collectorId:t,factName:e});return a})}async updateCollectorConfig(t){return this.#e(async()=>{const{collector:e}=await this.#t.updateCollectorConfig({input:t});return e})}async deleteCollectorConfig(t){return this.#e(async()=>await this.#t.deleteCollectorConfig({collectorId:t}))}async getOverallCheckPassRates(t){return this.#e(async()=>await this.#t.getOverallCheckPassRates({filter:t}))}async getIndividualCheckPassRates(t){return this.#e(async()=>await this.#t.getIndividualCheckPassRates({filter:t}))}async getOverallTrackPassRate(t){return this.#e(async()=>await this.#t.getOverallTrackPassRate({filter:t}))}async getIndividualTrackPassRate(t){return this.#e(async()=>await this.#t.getIndividualTrackPassRate({filter:t}))}async getOverallEntityPassRates(t){return this.#e(async()=>await this.#t.getOverallEntityPassRates({filter:t}))}async getIndividualEntityPassRates(t){return this.#e(async()=>await this.#t.getIndividualEntityPassRates({input:t}))}async getOverallGroupPassRates(t){return this.#e(async()=>await this.#t.getOverallGroupPassRates({input:t}))}async getIndividualGroupPassRates(t){return this.#e(async()=>await this.#t.getIndividualGroupPassRates({input:t}))}async getEntityRefsForTechHealthFilter(t){return this.#e(async()=>await this.#t.getEntityRefsForTechHealthFilter({ownerEntityRef:t}))}async getTrackEntities(t){return this.#e(async()=>await this.#t.getTrackEntities({input:t}))}async getCampaigns(t,e){return this.#e(async()=>{const{campaigns:a}=await this.#t.getCampaigns({filter:t,byTrackIds:e});return a})}async createCampaign(t){return this.#e(async()=>{const{campaign:e}=await this.#t.createCampaign({input:t});return e})}async updateCampaign(t){return this.#e(async()=>{const{campaign:e}=await this.#t.updateCampaign({input:t});return e})}async deleteCampaign(t){return this.#e(async()=>{const{campaignDeleted:e}=await this.#t.deleteCampaign({campaignId:t});return e})}async sendCampaignNotification(t){return this.#e(async()=>{const{sendCampaignNotification:e}=await this.#t.sendCampaignNotification({input:t});return e})}async archiveCampaign(t){return this.#e(async()=>{const{campaignArchived:e}=await this.#t.archiveCampaign({campaignId:t});return e})}async getCampaignOwners(){return this.#e(async()=>{const{campaignOwners:t}=await this.#t.getCampaignOwners();return t})}async getCheckOwners(){return this.#e(async()=>{const{checkOwners:t}=await this.#t.getCheckOwners();return t})}async getTrackOwners(){return this.#e(async()=>{const{trackOwners:t}=await this.#t.getTrackOwners();return t})}async getCertificationStatus(t){return this.#e(async()=>this.#t.getCertificationStatus({input:t}))}async getCertificationStatusHistory(t){return this.#e(async()=>this.#t.getCertificationStatusHistory({input:t}))}async getTrackStatusHistory(t){return this.#e(async()=>(await this.#t.getTrackStatusHistory({input:t})).trackStatusHistory)}async getTrackStatusHistories(t){return this.#e(async()=>(await this.#t.getTrackStatusHistories({input:t})).trackStatusHistories)}async getCheckStatus(t){return this.#e(async()=>(await this.#t.getCheckStatus({input:t})).checkStatus)}async getCheckStatuses(t){return this.#e(async()=>(await this.#t.getCheckStatuses({input:t})).checkStatuses)}async getCheckStatusHistory(t){return this.#e(async()=>(await this.#t.getCheckStatusHistory({input:t})).checkStatusHistory)}async getCheckStatusHistoriesMultiFilter(t){return this.#e(async()=>(await this.#t.getCheckStatusHistoriesMultiFilter({input:t})).checkStatusHistoriesMultiFilter)}async getCheckStatusHistories(t){return this.#e(async()=>(await this.#t.getCheckStatusHistories({input:t})).checkStatusHistories)}async getCheckEntities(t){return this.#e(async()=>await this.#t.getCheckEntities({input:t}))}async getSavedViews(t){return this.#e(async()=>await this.#t.getSavedViews({input:t}))}async saveView(t){return this.#e(async()=>{const{saveView:e}=await this.#t.saveView({input:t});return e})}async deleteView(t){return this.#e(async()=>{const{deleteView:e}=await this.#t.deleteView({input:t});return e})}async getPathResolvers(){return this.#e(async()=>{const{pathResolvers:t}=await this.#t.getPathResolvers();return t})}async getCheckTemplates(){return this.#e(async()=>{const{checkerTemplates:t}=await this.#t.getCheckTemplates();return t})}async getFact(t){return this.#e(async()=>{const{fact:e}=await this.#t.getFact(t);return e})}async getGroupTypeHierarchy(){return this.#e(async()=>{const{groupTypeHierarchy:t}=await this.#t.getGroupTypeHierarchy();return t})}async getGroupHierarchy(t,e,a){return this.#e(async()=>{const{groupHierarchy:s}=await this.#t.getGroupHierarchy({groupRef:t,ownedEntitiesFilter:e,includeParent:a}),r=Uint8Array.from(atob(s.hierarchy),h=>h.charCodeAt(0)),n=o.inflate(r),c=new TextDecoder("utf-8").decode(n);return{hierarchy:JSON.parse(c)}})}async getHierarchicalTrackStatus(t,e){return this.#e(async()=>{const{hierarchicalTrackStatus:a}=await this.#t.getHierarchicalTrackStatus({trackId:t,groupRef:e});return a})}async getHierarchicalTrackStatuses(t,e){return this.#e(async()=>{const{hierarchicalTrackStatuses:a}=await this.#t.getHierarchicalTrackStatuses({trackIds:t,groupRef:e});return a})}async recordLoadTime(t){return this.#e(async()=>await this.#t.recordLoadTime({input:{metricType:t.metricType,routeName:t.routeName,loadTimeMs:t.loadTimeMs,additionalAttributes:t.additionalAttributes}}))}}export{w as SoundcheckApi,g as soundcheckApiRef};
|
|
1
|
+
import{createApiRef as u}from"@backstage/core-plugin-api";import{GraphQLClient as y}from"graphql-request";import o from"pako";import{getSdk as l}from"./graphql/generated/index.esm.js";const g=u({id:"plugin.soundcheck"}),k=i=>"response"in i&&"errors"in i.response,p=i=>"response"in i&&"message"in i.response;class w{#a;#s;#t;constructor(t){this.#a=t.fetchApi,this.#s=t.discoveryApi;const e=new y("/graphql",{fetch:async(a,s)=>{const r=`${await this.#s.getBaseUrl("soundcheck")}${a}`;return this.#a.fetch(r,s)}});this.#t=l(e)}#r=t=>k(t)?t.response?.errors?.[0].message??`${t}`:p(t)?t.response.message:`${t}`;#e=async t=>{try{return await t()}catch(e){throw new Error(`Error from Soundcheck backend: ${this.#r(e)}`)}};async getMultipleTrackStatuses(t){return this.#e(async()=>{const{multipleTrackStatuses:e}=await this.#t.getMultipleTrackStatuses({input:t});return e})}async getAllCertifications(t,e=!1,a=!1){return this.#e(async()=>{const{certifications:s}=await this.#t.getAllCertifications({entityRef:t,includeFilteredChecks:e,includeDraftTracks:a});return s})}async getCertificationDetails(t,e=!1,a=!1){return this.#e(async()=>{const{certifications:s}=await this.#t.getCertificationDetails({entityRef:t,includeFilteredChecks:e,includeDraftTracks:a});return s})}async getCertificationDetailsForTrack(t,e,a){return this.#e(async()=>{const{trackCertification:s}=await this.#t.getCertificationDetailsForTrack({entityRef:t,trackId:e,includeFilteredChecks:a});return s})}async getCheckResultDetails(t,e,a){return this.#e(async()=>{const{checkResult:s}=await this.#t.getCheckResultDetails({entityRef:t,trackId:e,checkId:a});return s})}async getFacetsForOwner(t){return this.#e(async()=>{const{facetsForOwner:e}=await this.#t.getFacetsForOwner({ownerEntityRef:t});return e})}async getTrackOverviewForOwner(t,e,a,s,r){return this.#e(async()=>{const{trackOverviewForOwner:n}=await this.#t.getTrackOverviewForOwner({ownerEntityRef:t,facet:e,first:a,after:s,entitySearch:r});return n})}async getTracks(t){return this.#e(async()=>{const{tracks:e}=await this.#t.getTracks({filter:t});return e})}async getTracksApplicableEntityCount(t,e){return this.#e(async()=>{const{tracks:a}=await this.#t.getTracksApplicableEntityCount({filter:t,groupRef:e});return a?.edges?.map(({node:s})=>({id:s.id,applicableEntityCount:s.applicableEntityCount??0}))})}async getTrack(t){return this.#e(async()=>{const{track:e}=await this.#t.getTrack({id:t});return e})}async createTrack(t){return this.#e(async()=>{const{track:e}=await this.#t.createTrack({input:t});return e})}async updateTrack(t){return this.#e(async()=>{const{track:e}=await this.#t.updateTrack({input:t});return e})}async deleteTrack(t){return this.#e(async()=>{const{trackDeleted:e}=await this.#t.deleteTrack({trackId:t});return e})}async importTracks(t){return this.#e(async()=>{const{status:e}=await this.#t.importTracks({tracks:t});return e})}async recertifyTrack(t,e,a){return this.#e(async()=>{const{trackRecertified:s}=await this.#t.recertifyTrack({trackId:t,numberOfDays:e,loggedInUserRef:a});return s})}async getPlaylists(t){return this.#e(async()=>{const{playlists:e}=await this.#t.getPlaylists({entityRef:t});return e})}async getOperators(){return this.#e(async()=>{const{operators:t}=await this.#t.getOperators();return t})}async getCheck(t){return this.#e(async()=>(await this.#t.getCheck({id:t})).check)}async getChecks(t){return this.#e(async()=>{const{checkers:e}=await this.#t.getCheckers({filter:t});return e})}async getExecutableChecks(){return this.#e(async()=>{const{executableChecks:t}=await this.#t.getExecutableChecks();return t})}async createCheck(t){return this.#e(async()=>{const{check:e}=await this.#t.createCheck({input:t});return e})}async updateCheck(t){return this.#e(async()=>{const{check:e}=await this.#t.updateCheck({input:t});return e})}async deleteCheck(t){return this.#e(async()=>await this.#t.deleteChecker({checkerId:t}))}async executeCheck(t){return this.#e(async()=>{const{result:e}=await this.#t.executeCheck({input:t});return e})}async importChecks(t){return this.#e(async()=>{const{status:e}=await this.#t.importCheckers({checkers:t});return e})}async setEntityExempt(t){return this.#e(async()=>{const{setEntityExempt:e}=await this.#t.setEntityExempt({input:t});return e})}async setManualCheckResult(t){return this.#e(async()=>await this.#t.setManualCheckResult({input:t}))}async deleteExemption(t,e){return this.#e(async()=>await this.#t.deleteExemption({checkId:t,entityRef:e}))}async getExemption(t,e){return this.#e(async()=>await this.#t.getExemption({checkId:t,entityRef:e}))}async getExemptions(t,e,a,s,r){return this.#e(async()=>await this.#t.getExemptions({checkId:t,first:e,after:a,last:s,before:r}))}async getExemptCheckIds(t,e){return this.#e(async()=>await this.#t.getExemptCheckIds({entityRef:t,trackId:e}))}async getCollectors(t){return this.#e(async()=>{const{collectors:e}=await this.#t.getCollectors({ids:t});return e})}async getFactSchema(t,e){if(!(!t||!e))return this.#e(async()=>{const{factSchema:a}=await this.#t.getFactSchemas({collectorId:t,factName:e});return a})}async updateCollectorConfig(t){return this.#e(async()=>{const{collector:e}=await this.#t.updateCollectorConfig({input:t});return e})}async deleteCollectorConfig(t){return this.#e(async()=>await this.#t.deleteCollectorConfig({collectorId:t}))}async getOverallCheckPassRates(t){return this.#e(async()=>await this.#t.getOverallCheckPassRates({filter:t}))}async getIndividualCheckPassRates(t){return this.#e(async()=>await this.#t.getIndividualCheckPassRates({filter:t}))}async getOverallTrackPassRate(t){return this.#e(async()=>await this.#t.getOverallTrackPassRate({filter:t}))}async getIndividualTrackPassRate(t){return this.#e(async()=>await this.#t.getIndividualTrackPassRate({filter:t}))}async getOverallEntityPassRates(t){return this.#e(async()=>await this.#t.getOverallEntityPassRates({filter:t}))}async getIndividualEntityPassRates(t){return this.#e(async()=>await this.#t.getIndividualEntityPassRates({input:t}))}async getOverallGroupPassRates(t){return this.#e(async()=>await this.#t.getOverallGroupPassRates({input:t}))}async getIndividualGroupPassRates(t){return this.#e(async()=>await this.#t.getIndividualGroupPassRates({input:t}))}async getTrackEntities(t){return this.#e(async()=>await this.#t.getTrackEntities({input:t}))}async getCampaigns(t,e){return this.#e(async()=>{const{campaigns:a}=await this.#t.getCampaigns({filter:t,byTrackIds:e});return a})}async createCampaign(t){return this.#e(async()=>{const{campaign:e}=await this.#t.createCampaign({input:t});return e})}async updateCampaign(t){return this.#e(async()=>{const{campaign:e}=await this.#t.updateCampaign({input:t});return e})}async deleteCampaign(t){return this.#e(async()=>{const{campaignDeleted:e}=await this.#t.deleteCampaign({campaignId:t});return e})}async sendCampaignNotification(t){return this.#e(async()=>{const{sendCampaignNotification:e}=await this.#t.sendCampaignNotification({input:t});return e})}async archiveCampaign(t){return this.#e(async()=>{const{campaignArchived:e}=await this.#t.archiveCampaign({campaignId:t});return e})}async getCampaignOwners(){return this.#e(async()=>{const{campaignOwners:t}=await this.#t.getCampaignOwners();return t})}async getCheckOwners(){return this.#e(async()=>{const{checkOwners:t}=await this.#t.getCheckOwners();return t})}async getTrackOwners(){return this.#e(async()=>{const{trackOwners:t}=await this.#t.getTrackOwners();return t})}async getCertificationStatus(t){return this.#e(async()=>this.#t.getCertificationStatus({input:t}))}async getCertificationStatusHistory(t){return this.#e(async()=>this.#t.getCertificationStatusHistory({input:t}))}async getTrackStatusHistory(t){return this.#e(async()=>(await this.#t.getTrackStatusHistory({input:t})).trackStatusHistory)}async getTrackStatusHistories(t){return this.#e(async()=>(await this.#t.getTrackStatusHistories({input:t})).trackStatusHistories)}async getCheckStatus(t){return this.#e(async()=>(await this.#t.getCheckStatus({input:t})).checkStatus)}async getCheckStatuses(t){return this.#e(async()=>(await this.#t.getCheckStatuses({input:t})).checkStatuses)}async getCheckStatusHistory(t){return this.#e(async()=>(await this.#t.getCheckStatusHistory({input:t})).checkStatusHistory)}async getCheckStatusHistoriesMultiFilter(t){return this.#e(async()=>(await this.#t.getCheckStatusHistoriesMultiFilter({input:t})).checkStatusHistoriesMultiFilter)}async getCheckStatusHistories(t){return this.#e(async()=>(await this.#t.getCheckStatusHistories({input:t})).checkStatusHistories)}async getCheckEntities(t){return this.#e(async()=>await this.#t.getCheckEntities({input:t}))}async getSavedViews(t){return this.#e(async()=>await this.#t.getSavedViews({input:t}))}async saveView(t){return this.#e(async()=>{const{saveView:e}=await this.#t.saveView({input:t});return e})}async deleteView(t){return this.#e(async()=>{const{deleteView:e}=await this.#t.deleteView({input:t});return e})}async getPathResolvers(){return this.#e(async()=>{const{pathResolvers:t}=await this.#t.getPathResolvers();return t})}async getCheckTemplates(){return this.#e(async()=>{const{checkerTemplates:t}=await this.#t.getCheckTemplates();return t})}async getFact(t){return this.#e(async()=>{const{fact:e}=await this.#t.getFact(t);return e})}async getGroupTypeHierarchy(){return this.#e(async()=>{const{groupTypeHierarchy:t}=await this.#t.getGroupTypeHierarchy();return t})}async getGroupHierarchy(t,e,a){return this.#e(async()=>{const{groupHierarchy:s}=await this.#t.getGroupHierarchy({groupRef:t,ownedEntitiesFilter:e,includeParent:a}),r=Uint8Array.from(atob(s.hierarchy),h=>h.charCodeAt(0)),n=o.inflate(r),c=new TextDecoder("utf-8").decode(n);return{hierarchy:JSON.parse(c)}})}async getHierarchicalTrackStatus(t,e){return this.#e(async()=>{const{hierarchicalTrackStatus:a}=await this.#t.getHierarchicalTrackStatus({trackId:t,groupRef:e});return a})}async getHierarchicalTrackStatuses(t,e){return this.#e(async()=>{const{hierarchicalTrackStatuses:a}=await this.#t.getHierarchicalTrackStatuses({trackIds:t,groupRef:e});return a})}async recordLoadTime(t){return this.#e(async()=>await this.#t.recordLoadTime({input:{metricType:t.metricType,routeName:t.routeName,loadTimeMs:t.loadTimeMs,additionalAttributes:t.additionalAttributes}}))}}export{w as SoundcheckApi,g as soundcheckApiRef};
|
|
2
2
|
//# sourceMappingURL=api.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as i}from"react/jsx-runtime";import{compatWrapper as u}from"@backstage/core-compat-api";import{createExtensionDataRef as c,createExtensionBlueprint as s,coreExtensionData as t,ExtensionBoundary as g}from"@backstage/frontend-plugin-api";import{lazy as l}from"react";import"@backstage/core-plugin-api";import"@backstage/plugin-permission-react";import"@backstage/ui";import"@spotify/backstage-plugin-soundcheck-common";import"react-helmet";import"react-router-dom";import"../routes.esm.js";import"../components/CampaignPage/CampaignPageBUI.esm.js";import"../components/CampaignPage/CampaignTechInsightsExplorerPage.esm.js";import"../components/CampaignsPage/CampaignListPage/useArchiveConfirmationModal.esm.js";import"../components/CampaignsPage/CampaignListPageBUI.esm.js";import"../contexts/TrackFormContext.esm.js";import"../contexts/CheckFormContext.esm.js";import"../contexts/CampaignFormContext.esm.js";import"../contexts/UserProvider.esm.js";import"@backstage/catalog-model";import"@tanstack/react-query";import"../api.esm.js";import"../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"../hooks/useSoundcheckAlert.esm.js";import"../hooks/useConfirmationModal.esm.js";import"react-use/lib/useLocalStorage";import"../components/CampaignForm/CampaignForm.esm.js";import"@remixicon/react";import"../components/SoundcheckHeader/SoundcheckHeader.esm.js";import"../components/SoundcheckHeader/SoundcheckHeaderContext.esm.js";import"../components/
|
|
1
|
+
import{jsx as i}from"react/jsx-runtime";import{compatWrapper as u}from"@backstage/core-compat-api";import{createExtensionDataRef as c,createExtensionBlueprint as s,coreExtensionData as t,ExtensionBoundary as g}from"@backstage/frontend-plugin-api";import{lazy as l}from"react";import"@backstage/core-plugin-api";import"@backstage/plugin-permission-react";import"@backstage/ui";import"@spotify/backstage-plugin-soundcheck-common";import"react-helmet";import"react-router-dom";import"../routes.esm.js";import"../components/CampaignPage/CampaignPageBUI.esm.js";import"../components/CampaignPage/CampaignTechInsightsExplorerPage.esm.js";import"../components/CampaignsPage/CampaignListPage/useArchiveConfirmationModal.esm.js";import"../components/CampaignsPage/CampaignListPageBUI.esm.js";import"../contexts/TrackFormContext.esm.js";import"../contexts/CheckFormContext.esm.js";import"../contexts/CampaignFormContext.esm.js";import"../contexts/UserProvider.esm.js";import"@backstage/catalog-model";import"@tanstack/react-query";import"../api.esm.js";import"../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"../hooks/useSoundcheckAlert.esm.js";import"../hooks/useConfirmationModal.esm.js";import"react-use/lib/useLocalStorage";import"../components/CampaignForm/CampaignForm.esm.js";import"@remixicon/react";import"../components/SoundcheckHeader/SoundcheckHeader.esm.js";import"../components/SoundcheckHeader/SoundcheckHeaderContext.esm.js";import"../components/Loading/Loading.esm.js";import"../components/PageWarningMessage/PageWarningMessage.esm.js";import"../components/CampaignsPage/CampaignEmptyState.esm.js";import"uuid";import"@backstage/core-components";import"react-hook-form";import"../utils/formStyles.esm.js";import"@material-ui/core";import"@material-ui/icons/Search";import"../components/SoundcheckDialog/SoundcheckDialog.esm.js";import"../components/FactExplorer/FactExplorer.esm.js";import"../components/FactExplorer/FactExplorerContext.esm.js";import"../components/FormStepper/FormStepper.esm.js";import"../components/CheckForm/FormFields/CheckNameInput/CheckNameInput.esm.js";import"../components/CheckForm/FormFields/PassFailMessageInput/PassFailMessageInput.esm.js";import"../components/FormMarkdownInput/FormMarkdownInput.esm.js";import"../components/CheckForm/utils/checkFormUtils.esm.js";import"../components/CheckForm/FormFields/TeamDetailsInput/TeamDetailsInput.esm.js";import"../components/CheckForm/FormFields/RuleInput/AddMenuButton.esm.js";import"../components/CheckForm/FormFields/RuleInput/RuleInputBox.esm.js";import"../components/CheckForm/FormFields/RuleInput/Expressions/ExpressionBox.esm.js";import"../components/CheckForm/FormFields/RuleInput/Expressions/ExpressionTypeToggle.esm.js";import"@material-ui/icons/Close";import"@material-ui/icons/Delete";import"@material-ui/icons/List";import"../components/FormControlledAutocomplete/FormControlledAutocomplete.esm.js";import"../components/CheckForm/FormFields/RuleInput/Conditions/styles.esm.js";import"../components/CheckForm/FormFields/RuleInput/Conditions/ValueListInput.esm.js";import"../components/CheckForm/FormFields/RuleInput/Conditions/ConditionList.esm.js";import"../components/CheckForm/FormFields/CheckScheduleSection/ScheduleSection.esm.js";import"../components/CheckForm/FormFields/CheckPathResolverInput.esm.js";import"../components/CheckForm/Steps/CheckDetailsStep.esm.js";import"../components/CheckForm/Steps/CheckRulesStep.esm.js";import"../components/CheckForm/Steps/CheckApplicabilityStep.esm.js";import"../components/CheckForm/Steps/CheckReviewStep.esm.js";import"../components/CheckForm/types/ExpressionType.esm.js";import"../components/Frequency/types.esm.js";import"../components/Frequency/util.esm.js";import"../components/Frequency/FrequencyComponent.esm.js";import"../components/CheckForm/types/Path.esm.js";import"@hookform/resolvers/zod";import"../components/CheckForm/utils/validation.esm.js";import"../components/LoadingIndicator/LoadingIndicator.esm.js";import"../components/CheckPage/CheckPageBUI.esm.js";import"../components/ChecksPage/ChecksListPageBUI.esm.js";import"../components/CheckTemplatesPage/CheckTemplatesPageBUI.esm.js";import"../components/CheckTemplatesPage/CheckTemplatesPageDeprecated.esm.js";import"../components/CollectorPage/Configurators/AzureDevOps/AzureDevOpsConfigurator.esm.js";import"../components/CollectorPage/Configurators/BigQuery/BigQueryConfigurator.esm.js";import"../components/CollectorPage/Configurators/Catalog/CatalogConfigurator.esm.js";import"../components/CollectorPage/Configurators/DataDog/DataDogConfigurator.esm.js";import"../components/CollectorPage/Configurators/DataRegistry/DataRegistryConfigurator.esm.js";import"../components/CollectorPage/Configurators/Github/GithubConfigurator.esm.js";import"../components/CollectorPage/Configurators/Gitlab/GitlabConfigurator.esm.js";import"../components/CollectorPage/Configurators/HTTP/HttpConfigurator.esm.js";import"../components/CollectorPage/Configurators/Jira/JiraConfigurator.esm.js";import"../components/CollectorPage/Configurators/Kubernetes/KubernetesConfigurator.esm.js";import"../components/CollectorPage/Configurators/NewRelic/NewRelicConfigurator.esm.js";import"../components/CollectorPage/Configurators/PagerDuty/PagerDutyConfigurator.esm.js";import"../components/CollectorPage/Configurators/SCM/ScmConfigurator.esm.js";import"../components/CollectorPage/Configurators/SonarQube/SonarQubeConfigurator.esm.js";import"../components/CollectorPage/CollectorDetailsPageBUI.esm.js";import"../components/CollectorPage/CollectorDetailsPageDeprecated.esm.js";import"../components/CollectorsPage/IntegrationsListPageBUI.esm.js";import"../components/OverviewPage/OverviewPageContent.esm.js";import"../components/TechInsights/TechInsightsPageBUI.esm.js";import"../components/TrackBuilderPage/TrackBuilderPage.esm.js";import"lodash";import"../components/Filter/FilterComponent.esm.js";import"../components/TrackForm/Steps/LevelsStep/LevelsStepNew.esm.js";import"../components/TrackForm/Steps/TrackDetailsStep/TrackDetailsStep.esm.js";import"../components/TrackForm/utils/validation.esm.js";import"../graphql/generated/index.esm.js";import"../components/TrackPage/TrackPageBUI.esm.js";import"../components/TrackPage/TrackTechInsightsExplorerPage.esm.js";import"../components/TracksPage/TracksListPageBUI.esm.js";import"@spotify/backstage-plugin-core";import"../components/SoundcheckQueryClientProvider/SoundcheckQueryClientProvider.esm.js";import{RoutingPageWrapper as f}from"../components/RoutingPage/RoutingPageWrapper.esm.js";const o=c().with({id:"soundcheck.integrationId"}),h=s({kind:"integration",attachTo:[{id:"page:soundcheck/SoundcheckRoutingPage",input:"integrations"},{id:"app/routes",input:"routes"}],output:[t.routePath,t.reactElement,t.routeRef.optional(),o],dataRefs:{integrationId:o},*factory({integrationId:r,loader:m,path:e,routeRef:p},{node:n}){const a=l(()=>m().then(d=>({default:()=>d})));yield t.routePath(e??`/soundcheck/integrations/${r}/edit`),yield t.reactElement(u(i(g,{node:n,children:i(f,{children:i(a,{})})}))),p&&(yield t.routeRef(p)),yield o(r)}});export{h as IntegrationPageBlueprint,o as integrationIdExtensionDataRef};
|
|
2
2
|
//# sourceMappingURL=IntegrationPageBlueprint.esm.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as r,jsxs as o}from"react/jsx-runtime";import{makeStyles as b}from"@material-ui/core";import{RiInformationLine as g,RiCheckLine as t,RiErrorWarningLine as u,RiCloseCircleLine as m}from"@remixicon/react";const f={info:{icon:r(g,{}),bg:"var(--bui-bg-solid-disabled)",border:"var(--bui-fg-disabled)",color:"var(--bui-fg-disabled)"},success:{icon:r(t,{}),bg:"var(--bui-bg-success)",border:"var(--bui-fg-success)",color:"var(--bui-fg-success)"},warning:{icon:r(u,{}),bg:"var(--bui-bg-warning)",border:"var(--bui-fg-warning)",color:"var(--bui-fg-warning)"},error:{icon:r(m,{}),bg:"var(--bui-bg-danger)",border:"var(--bui-fg-danger)",color:"var(--bui-fg-danger)"}},v=b(()=>({title:{margin:"0 0 0.5rem",fontWeight:"bold"},description:{margin:0}})),p=({title:i,children:n,variant:a="info"})=>{const e=v(),{icon:d,bg:s,border:c,color:l}=f[a];return r("div",{role:"alert",style:{margin:"1rem 0",padding:"1rem",backgroundColor:s,border:`1px solid ${c}`,borderRadius:"var(--bui-radius-3)"},children:o("div",{style:{display:"flex",gap:"1rem",alignItems:"flex-start",color:l},children:[r("div",{children:d}),o("div",{children:[i&&r("h4",{className:e.title,children:i}),r("p",{className:e.description,children:n})]})]})})};export{p as Alert};
|
|
2
|
+
//# sourceMappingURL=Alert.esm.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsxs as b,jsx as d}from"react/jsx-runtime";const l={default:{bg:"var(--bui-bg-solid-disabled)",color:"var(--bui-fg-disabled)",border:"1px solid var(--bui-border-disabled)"},success:{bg:"var(--bui-bg-success)",color:"var(--bui-fg-success)",border:"1px solid var(--bui-border-success)"},warning:{bg:"var(--bui-bg-warning)",color:"var(--bui-fg-warning)",border:"1px solid var(--bui-border-warning)"}},n=({children:i,icon:r,variant:a="default"})=>{const{bg:s,color:e,border:o}=l[a];return b("span",{style:{display:"inline-flex",alignItems:"center",padding:"var(--bui-space-1) var(--bui-space-3)",borderRadius:"var(--bui-radius-full)",backgroundColor:s,color:e,border:o},children:[r&&d("span",{style:{marginRight:"var(--bui-space-1)"},children:r}),i]})};export{n as Badge};
|
|
2
|
+
//# sourceMappingURL=Badge.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as e,jsxs as
|
|
1
|
+
import{jsx as e,jsxs as o,Fragment as W}from"react/jsx-runtime";import{parseEntityRef as Fe}from"@backstage/catalog-model";import{useRouteRef as R}from"@backstage/core-plugin-api";import{usePermission as Ne}from"@backstage/plugin-permission-react";import{Container as T,HeaderPage as Re,Box as m,Flex as Y,Text as u,Grid as P}from"@backstage/ui";import{makeStyles as Pe}from"@material-ui/core";import{toEntityFilterQuery as xe,soundcheckCampaignReadPermission as Ae}from"@spotify/backstage-plugin-soundcheck-common";import{isEmpty as He}from"lodash";import{DateTime as S}from"luxon";import{useState as b,useMemo as v,useEffect as Z}from"react";import{useParams as Oe,useSearchParams as De}from"react-router-dom";import Ke from"react-use/lib/useDebounce";import _e from"react-use/lib/useLocalStorage";import{useCheckStatuses as Me}from"../../hooks/aggregations/useCheckStatuses.esm.js";import{useFilters as je}from"../../hooks/filters/useFilters.esm.js";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"../../hooks/useSoundcheckAlert.esm.js";import{useGetCampaigns as Be}from"../../hooks/campaigns/useGetCampaigns.esm.js";import"../../hooks/useConfirmationModal.esm.js";import{useCertificationStatus as Ge}from"../../hooks/aggregations/useCertificationStatus.esm.js";import{useCertificationStatusHistory as Ue}from"../../hooks/aggregations/useCertificationStatusHistory.esm.js";import{useLCPReporting as Ve}from"../../hooks/useLCPReporting.esm.js";import{useLoadTimeReporting as $e}from"../../hooks/useLoadTimeReporting.esm.js";import{campaignsPageRouteRef as qe,campaignOverviewRouteRef as Qe,campaignExplorerRouteRef as We}from"../../routes.esm.js";import{DescriptionCard as Ye}from"../Cards/DescriptionCard/DescriptionCard.esm.js";import{HistoricalTrackStatusCard as Ze}from"../Cards/HistoricalTrackStatusCard/HistoricalTrackStatusCard.esm.js";import"../Cards/TrackStatusCard/TrackStatusCard.esm.js";import{ChecksTable as ze}from"../ChecksTable/ChecksTable.esm.js";import{ChipSelector as Je}from"../ChipSelector/ChipSelector.esm.js";import{EmptyStateBUI as z}from"../EmptyState/EmptyStateBUI.esm.js";import"../FilterSidebar/FilterSidebar.esm.js";import"../FilterSidebar/StateFilter.esm.js";import{useTrackFilterSidebar as Xe}from"../FilterSidebar/useTrackFilterSidebar.esm.js";import{toFilter as ei,CERTIFICATION_STATUS_MAP as ii}from"../FilterSidebar/util.esm.js";import{LoadingTableSkeleton as ti}from"../LoadingTableSkeleton/LoadingTableSkeleton.esm.js";import{SimpleMenu as ri}from"../Menus/SimpleMenu.esm.js";import{useCampaignActions as ai}from"../Menus/useCampaignActions.esm.js";import{PageCustomActions as oi}from"../PageCustomActions/PageCustomActions.esm.js";import{SendCampaignNotificationDialogBUI as si}from"../SendCampaignNotificationDialog/SendCampaignNotificationDialogBUI.esm.js";import{TopFailingChecksTableBUI as ni}from"../TopFailingChecksTable/TopFailingChecksTableBUI.esm.js";import{TrackEntitiesTableBUI as ci}from"../TrackPage/TrackEntitiesTable/TrackEntitiesTableBUI.esm.js";import{CampaignStatusCard as mi}from"./CampaignStatusCard.esm.js";const li=Pe(()=>({container:{marginBottom:"var(--bui-space-12)"},tableContent:{margin:"var(--bui-space-3) 0 0"},tabPanel:{padding:"var(--bui-space-6) 0 0"},tabs:{margin:"0 0 var(--bui-space-12)"},cards:{margin:"0 0 var(--bui-space-12)",display:"flex",gridGap:"var(--bui-space-4)"}})),a={CHECKS:"Checks",TOP_FAILING_CHECKS:"Top Failing Checks",ENTITIES:"Entities"},di={checks:a.CHECKS,"top-failing-checks":a.TOP_FAILING_CHECKS,entities:a.ENTITIES},pi={[a.CHECKS]:"checks",[a.TOP_FAILING_CHECKS]:"top-failing-checks",[a.ENTITIES]:"entities"},hi=()=>{const{owners:l,lifecycles:d,types:p,systems:h,certificationStatuses:x}=Xe(),{campaignId:s}=Oe(),J=R(qe),[n,C]=De(),[c,A]=b(n.get("search")||""),[H,X]=b(""),[O,ee]=b(()=>{const i=n.get("section"),I=i?di[i]:null;return new Set([I??a.CHECKS])}),y=O.values().next().value??a.CHECKS;Ke(()=>{X(c);const i=new URLSearchParams(n.toString());c?i.set("search",c):i.delete("search"),C(i,{replace:!0})},300,[c]);const D=v(()=>({routeName:"soundcheck-campaign-insights",additionalAttributes:{campaignId:s||"",filtersApplied:l.length+d.length+p.length+h.length,ownersFilter:l?.join(",")||"",lifecyclesFilter:d?.join(",")||"",typesFilter:p?.join(",")||"",systemsFilter:h?.join(",")||"",campaignsSearch:H||""}}),[s,l,d,p,h,H]),{reportContentLoaded:K}=$e(D),{reporter:ie}=Ve(D),f=li(),k=v(()=>ei({lifecycles:d,owners:l,types:p,systems:h}),[d,l,p,h]),{data:te,isLoading:g,isError:re}=Be({ids:[s],first:1}),t=te?.edges?.[0]?.node,{actions:_,showNotificationDialog:M,setShowNotificationDialog:ae}=ai(t??void 0),r=t?.track,oe=v(()=>r?.levels.flatMap(i=>i.checks),[r?.levels]),se=Array.from(new Set(r?.levels.flatMap(i=>i.checks).map(i=>i.id)??[])),{data:j,isLoading:ne}=Me({trackId:r?.id,checkIds:se,filter:k},!!r),ce=v(()=>xe(r?.filter),[r]),{filters:me,selected:le,setSelected:de,onRemoveTag:pe,selectedTags:he}=je({entityFilterQuery:ce,hasCertificationStatusFilters:!0}),{data:B,isLoading:w,isError:fe}=Ge({trackId:r?.id??"",filter:k},!!t),ge=S.fromISO(t?.startDate),ue=Math.max(Math.ceil(S.now().diff(ge,"days").days),1),{data:G,isLoading:Se,isError:Ce}=Ue({trackId:r?.id??"",filter:k,numberOfDays:ue},!!t),L=re||fe||Ce,{loading:ye,allowed:Ee}=Ne({permission:Ae,resourceRef:s}),U=ie?.getLCPValue();Z(()=>{!g&&!w&&K({lcp:U})},[g,w,K,U]);const[E,V]=b(!1),[F,N]=_e("campaign-overview-search-params","");Z(()=>{!E&&n?.toString()?(F!==n.toString()&&N(n.toString()),V(!0)):E?E&&F!==n.toString()&&N(n.toString()):V(!0)},[n,C,N,F,E]);const Ie=i=>{ee(i),A("");const I=i.values().next().value,Q=I?pi[I]:void 0;Q?C({section:Q},{replace:!0}):C({},{replace:!0})},Te=R(Qe),be=R(We);if(g)return e(T,{className:f.container,children:e(ti,{})});if(!g&&!t)return e(T,{className:f.container,children:e(z,{title:"Campaign not found",body:`There is no campaign with the requested id: ${s}.`})});if(!ye&&!Ee)return e(T,{className:f.container,children:e(z,{title:"Cannot view campaign",body:`No permission to view campaign with the requested id: ${s}.`})});const $=t?.ownerEntityRef,ve=$?Fe($).name:void 0,ke=S.fromISO(t?.startDate),q=S.fromISO(t?.targetCompletionDate),we=S.now(),Le=Math.max(Math.ceil(q.diff(we,"days").days),0);return o(W,{children:[e(Re,{title:t?.name,customActions:e(ri,{disabled:!_.length,placement:"left top",menuActions:_,label:"Campaign Actions"}),breadcrumbs:[{label:"Campaigns",href:J()}],tabs:[{id:"overview",label:"Campaign Overview",href:s?Te({campaignId:s}):""},{id:"explorer",label:"Tech Insights Explorer",href:s?be({campaignId:s}):""}]}),o(T,{className:f.container,children:[o(m,{className:f.cards,children:[e(Ye,{description:t?.description??void 0,owner:ve,isError:L,isLoading:g}),e(mi,{campaign:t,status:B,history:G,isError:L,isLoading:w,children:o(W,{children:[o(Y,{align:"baseline",mt:"3",children:[e(u,{as:"h1",variant:"title-medium",weight:"bold",children:Le}),e(u,{variant:"body-small",children:"Days remaining"})]}),o(P.Root,{children:[o(P.Item,{children:[e(m,{children:e(u,{color:"secondary",variant:"body-small",children:"Start date"})}),e(m,{children:e(u,{variant:"body-small",children:ke.toLocaleString({month:"short",day:"numeric",year:"numeric"})})})]}),o(P.Item,{children:[e(m,{children:e(u,{color:"secondary",variant:"body-small",children:"End date"})}),e(m,{children:e(u,{variant:"body-small",children:q.toLocaleString({month:"short",day:"numeric",year:"numeric"})})})]})]})]})}),e(Ze,{track:t?.track,history:G,isCampaign:!0,isError:L,isLoading:Se})]}),r&&o(m,{children:[o(Y,{justify:"between",children:[e(m,{minWidth:"16rem",children:e(Je,{options:["Checks","Top Failing Checks","Entities"],selected:O,ariaLabel:"Sections",onSelectionChange:Ie})}),e(oi,{searchValue:c,setSearchValue:i=>A(i),filters:me,selected:le,setSelected:de,onRemoveTag:pe,selectedTags:he,showSearch:y!==a.ENTITIES})]}),o(m,{className:f.tableContent,children:[y===a.CHECKS&&e(ze,{trackId:r.id,checks:oe,checkStatuses:j,isLoading:g||ne,searchValue:c}),y===a.TOP_FAILING_CHECKS&&e(ni,{track:r,checkStatuses:j,certificationStatus:B?.certificationStatus,searchValue:c}),y===a.ENTITIES&&e(ci,{isCampaign:!0,track:r,lifecycles:d,owners:l,types:p,systems:h,certificationStatus:He(x)?void 0:ii[x[0]],searchValue:c})]})]}),t&&M&&e(si,{campaign:t,isOpen:M,handleClose:()=>ae(!1)})]})]})};export{hi as CampaignPageBUI};
|
|
2
2
|
//# sourceMappingURL=CampaignPageBUI.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as i,jsxs as g,Fragment as I}from"react/jsx-runtime";import{useApi as Q,useRouteRef as T}from"@backstage/core-plugin-api";import{entityPresentationApiRef as Y}from"@backstage/plugin-catalog-react";import{usePermission as _}from"@backstage/plugin-permission-react";import{HeaderPage as q,Container as J,TableRoot as X,TableHeader as Z,Column as c,TableBody as ee,TablePagination as te}from"@backstage/ui";import{makeStyles as ie}from"@material-ui/core";import{RiCalendarLine as re}from"@remixicon/react";import{soundcheckCampaignCreatePermission as oe}from"@spotify/backstage-plugin-soundcheck-common";import{sortBy as ae,isEmpty as A}from"lodash";import{DateTime as x}from"luxon";import{useState as R,useMemo as l,useCallback as ne,useEffect as me}from"react";import se from"react-use/lib/useDebounce";import"@backstage/catalog-model";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import"../../hooks/useSoundcheckAlert.esm.js";import{useGetCampaigns as pe}from"../../hooks/campaigns/useGetCampaigns.esm.js";import"../../hooks/useConfirmationModal.esm.js";import"react-router-dom";import{usePagination as ce}from"../../hooks/usePagination.esm.js";import"react-use/lib/useLocalStorage";import{useSortSearchParams as de}from"../../hooks/useSortSearchParams.esm.js";import{useProfileImages as ge}from"../../hooks/catalog/useProfileImages.esm.js";import{useLCPReporting as le}from"../../hooks/useLCPReporting.esm.js";import{useLoadTimeReporting as fe}from"../../hooks/useLoadTimeReporting.esm.js";import{useSearchNameOwner as he}from"../../hooks/useSearchNameOwner.esm.js";import{campaignCreateRouteRef as ue,campaignDetailsRouteRef as Ce}from"../../routes.esm.js";import"../EmptyState/EmptyState.esm.js";import{EmptyStateBUI as Pe}from"../EmptyState/EmptyStateBUI.esm.js";import{EmptyStateNoCampaigns as we}from"../EmptyState/EmptyStateNoCampaigns.esm.js";import{ListPageCustomActions as ye}from"../ListPageCustomActions/ListPageCustomActions.esm.js";import{LoadingTableSkeleton as Se}from"../LoadingTableSkeleton/LoadingTableSkeleton.esm.js";import"../Menus/SimpleMenu.esm.js";import"js-yaml";import"../../contexts/TrackFormContext.esm.js";import"../../contexts/CheckFormContext.esm.js";import"../../contexts/CampaignFormContext.esm.js";import"../../contexts/UserProvider.esm.js";import{useCampaignActions as Re}from"../Menus/useCampaignActions.esm.js";import"@material-ui/icons/AddAlert";import"../FormControlledAutocomplete/FormControlledAutocomplete.esm.js";import"@material-ui/icons/CheckBox";import"@material-ui/icons/CheckBoxOutlineBlank";import"@material-ui/lab";import"react-hook-form";import"../ListboxVirtualized/ListboxVirtualized.esm.js";import"../FormControlledAutocomplete/ControlledAutocomplete.esm.js";import"../FormFieldLabel/FormFieldLabel.esm.js";import"../LoadingIndicator/LoadingIndicator.esm.js";import"../SoundcheckDialog/SoundcheckDialog.esm.js";import{SendCampaignNotificationDialogBUI as ve}from"../SendCampaignNotificationDialog/SendCampaignNotificationDialogBUI.esm.js";import{TableRowWithOwner as Le}from"../TableRowWithOwner/TableRowWithOwner.esm.js";const z=10,Ne=["name","status","days-remaining","owner"],B=t=>{const s=x.fromISO(t),r=x.now();return Math.max(Math.ceil(s.diff(r,"days").days),0)},De=({campaign:t,profileImageMap:s})=>{const r=l(()=>t.archived?0:B(t.targetCompletionDate),[t.archived,t.targetCompletionDate]),h=T(Ce),o=l(()=>t.track.levels.reduce((a,P)=>a+(P.checks?.length??0),0),[t.track.levels]),{actions:u,showNotificationDialog:p,setShowNotificationDialog:C}=Re(t);return g(I,{children:[i(Le,{ownerEntityRef:t.ownerEntityRef,href:h({campaignId:t.id}),profileImageSrc:s[t.ownerEntityRef],menuActions:u,name:t.name??"",description:t.description??"",cells:[{title:t.archived?"Archived":"Active"},{title:`${r} day${r===1?"":"s"} remaining`,icon:i(re,{size:16})},{title:`${o} Check${o===1?"":"s"}`}]}),t&&p&&i(ve,{campaign:t,isOpen:p,handleClose:()=>C(!1)})]})},Ee=ie(()=>({container:{marginBottom:"var(--bui-space-12)"}})),be=()=>{const t=Ee(),{updateSortParams:s,searchParams:r,setSearchParams:h}=de(),[o,u]=R(()=>r.get("search")??""),[p,C]=R(()=>r.get("sortDirection")==="descending"?"descending":"ascending"),[a,P]=R(()=>{const e=r.get("sort");return e&&Ne.includes(e)?e:""}),{data:v,isLoading:d}=pe({}),L=l(()=>v?.edges?.map(e=>e.node)??[],[v?.edges]),{profileImageMap:M}=ge(L.map(e=>e.ownerEntityRef)),N=Q(Y),w=he(L,o),f=l(()=>{if(!a)return w;const e=ae(w,m=>a==="owner"?N.forEntity(m.ownerEntityRef).snapshot.primaryTitle.toLowerCase():a==="status"?m.archived?"archived":"active":a==="days-remaining"?m.archived?-1:B(m.targetCompletionDate):m.name.toLowerCase());return p==="descending"&&e.reverse(),e},[N,a,p,w]),{paginatedItems:y,reset:S,paginationProps:n}=ce({pageParam:"perPage",defaultPageSize:z,items:f});se(()=>{S();const e=new URLSearchParams(r.toString());o?e.set("search",o):e.delete("search"),h(e,{replace:!0})},300,[o]);const O=ne(({direction:e,column:m})=>{const k=String(m);P(k),C(e),S(),s({sort:k,sortDirection:e})},[S,s]),{loading:H,allowed:U}=_({permission:oe}),$=T(ue),D=l(()=>({routeName:"soundcheck-campaigns",additionalAttributes:{}}),[]),{reportContentLoaded:E}=fe(D),{reporter:V}=le(D),b=V?.getLCPValue();me(()=>{d||E({lcp:b})},[d,E,b]);const j=!d&&!A(y),G=f.length>z,W=!d&&A(y),F=d,K=o?i(Pe,{title:"No campaigns found",body:"Your current search term did not return any campaigns. Please try a different search term."}):i(we,{});return g(I,{children:[i(q,{customActions:i(ye,{searchValue:o,setSearchValue:u,canCreate:!H&&U,createHref:$()}),title:"Campaigns"}),g(J,{className:t.container,children:[F&&i(Se,{rowCount:10}),W&&K,j&&g(X,{onSortChange:O,sortDescriptor:{direction:p,column:a},children:[g(Z,{children:[i(c,{allowsSorting:!0,isRowHeader:!0,id:"name",style:{width:"47%"},children:"Name"}),i(c,{allowsSorting:!0,id:"status",style:{width:"10%"},children:"Status"}),i(c,{allowsSorting:!0,id:"days-remaining",style:{width:"15%"},children:"Days Remaining"}),i(c,{id:"checks",style:{width:"10%"},children:"Checks"}),i(c,{id:"owner",allowsSorting:!0,style:{width:"15%"},children:"Campaign Owner"}),i(c,{id:"actions",style:{width:"3%"}})]}),i(ee,{children:y.map(e=>i(De,{campaign:e,profileImageMap:M??{}},e.id))})]}),G&&i(te,{totalCount:f.length,offset:n.offset,hasNextPage:n.offset+n.pageSize<(f.length??0),hasPreviousPage:n.offset>0,onNextPage:n.onNextPage,onPreviousPage:n.onPreviousPage,onPageSizeChange:n.onPageSizeChange,pageSize:n.pageSize})]})]})};export{be as CampaignListPageBUI};
|
|
2
2
|
//# sourceMappingURL=CampaignListPageBUI.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as o,jsxs as y,Fragment as n}from"react/jsx-runtime";import{useRouteRef as s}from"@backstage/core-plugin-api";import{usePermission as R}from"@backstage/plugin-permission-react";import{HeaderPage as b}from"@backstage/ui";import{soundcheckCampaignUpdatePermission as L}from"@spotify/backstage-plugin-soundcheck-common";import{useEffect as P}from"react";import{useParams as E}from"react-router-dom";import"../../contexts/TrackFormContext.esm.js";import"../../contexts/CheckFormContext.esm.js";import{useCampaignFormContext as w}from"../../contexts/CampaignFormContext.esm.js";import"../../contexts/UserProvider.esm.js";import"@backstage/catalog-model";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"../../hooks/useSoundcheckAlert.esm.js";import{useUpdateCampaign as x}from"../../hooks/campaigns/useUpdateCampaign.esm.js";import"../../hooks/useConfirmationModal.esm.js";import{useNavigateBack as I}from"../../hooks/useNavigateBack.esm.js";import"react-use/lib/useLocalStorage";import{useGetCampaign as U}from"../../hooks/campaigns/useGetCampaign.esm.js";import{campaignsPageRouteRef as p,campaignDetailsRouteRef as A}from"../../routes.esm.js";import{CampaignForm as D}from"../CampaignForm/CampaignForm.esm.js";import{DocLinkButton as F}from"../DocLinkButton/DocLinkButton.esm.js";import{
|
|
1
|
+
import{jsx as o,jsxs as y,Fragment as n}from"react/jsx-runtime";import{useRouteRef as s}from"@backstage/core-plugin-api";import{usePermission as R}from"@backstage/plugin-permission-react";import{HeaderPage as b}from"@backstage/ui";import{soundcheckCampaignUpdatePermission as L}from"@spotify/backstage-plugin-soundcheck-common";import{useEffect as P}from"react";import{useParams as E}from"react-router-dom";import"../../contexts/TrackFormContext.esm.js";import"../../contexts/CheckFormContext.esm.js";import{useCampaignFormContext as w}from"../../contexts/CampaignFormContext.esm.js";import"../../contexts/UserProvider.esm.js";import"@backstage/catalog-model";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"../../hooks/useSoundcheckAlert.esm.js";import{useUpdateCampaign as x}from"../../hooks/campaigns/useUpdateCampaign.esm.js";import"../../hooks/useConfirmationModal.esm.js";import{useNavigateBack as I}from"../../hooks/useNavigateBack.esm.js";import"react-use/lib/useLocalStorage";import{useGetCampaign as U}from"../../hooks/campaigns/useGetCampaign.esm.js";import{campaignsPageRouteRef as p,campaignDetailsRouteRef as A}from"../../routes.esm.js";import{CampaignForm as D}from"../CampaignForm/CampaignForm.esm.js";import{DocLinkButton as F}from"../DocLinkButton/DocLinkButton.esm.js";import{Loading as S}from"../Loading/Loading.esm.js";import{PageWarningMessage as j}from"../PageWarningMessage/PageWarningMessage.esm.js";import"../SoundcheckHeader/SoundcheckHeader.esm.js";import"../SoundcheckHeader/SoundcheckHeaderContext.esm.js";import{useHeader as v}from"../SoundcheckHeader/useHeader.esm.js";import{EmptyCampaignState as B}from"./CampaignEmptyState.esm.js";const H=()=>{v({title:"Update Campaign",description:"Update your campaign, including schedule, milestones, and other associated details.",docLink:"https://backstage.spotify.com/docs/plugins/soundcheck/core-concepts/campaigns"});const[c,d]=I(p),{campaignId:t}=E(),{setIsLoading:e}=w(),{mutateAsync:g,isLoading:a}=x(),{data:f,isLoading:m}=U(t??""),i=f?.edges?.[0]?.node,{loading:u,allowed:r}=R({permission:L,resourceRef:i?.id});P(()=>e(a),[e,a]);const l=s(p),C=s(A);if(!m&&!i)return o(B,{});const h=async k=>{await g(k,{onSuccess:d})};return y(n,{children:[o(b,{title:`Edit ${i?.name??t??"Campaign"}`,breadcrumbs:[{label:"All Campaigns",href:l()},{label:"Details",href:C({campaignId:t??""})}],customActions:o(F,{href:"https://backstage.spotify.com/docs/plugins/soundcheck/core-concepts/campaigns/"})}),o(j,{entityId:i?.id,entityName:i?.name??"",showCannotEdit:!u&&!r}),m?o(S,{}):o(n,{children:r&&o(D,{onSave:h,onCancel:c,selectedCampaign:i})})]})};export{H as EditCampaignView};
|
|
2
2
|
//# sourceMappingURL=EditCampaignView.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{map as
|
|
1
|
+
import{map as p}from"lodash";import{DateTime as h}from"luxon";import{compactNumberFormatter as u}from"../../utils/formatters.esm.js";const D=["#59A0F6","#95C90D","#FFA42C","#C87DFF","#7358FF","#F036A4"],E=["#3B82F6","#10B981","#8B5CF6","#F59E0B","#6B7280","#06B6D4","#EC4899","#84CC16","#D946EF"];var l=(t=>(t.RED="red",t.GREEN="green",t))(l||{});const f=t=>t?t.palette.type:"",y=t=>f(t).toLowerCase()==="dark",T=t=>y(t)?E:D;function F(t,e){return(e?t.minus({days:e}):t).toFormat("MMM dd")}const v=(t,e)=>{if(typeof t=="number"){const r=e.certificationStatusHistory.numberOfEntities??0,s=r>0?Math.round(t/r*100):0;return`${u(t)} of ${u(r)} (${s}%)`}return t},B=t=>{const e=t?.certificationStatusHistory.history??[],r=t?.certificationStatusHistory.numberOfEntities??0,s=h.utc();return p(e,(n,C)=>{let o={name:F(s,e.length-C-1)},m=0,c=0;n.statusByLevel.sort((a,i)=>i.ordinal-a.ordinal).forEach(a=>{const i=a.cumulativelyPassed-c;o={...o,[`Level ${a.ordinal}`]:i},m+=i,c=a.cumulativelyPassed}),n.statusByLevel.reverse();const d=Math.max(0,r-m);return o={...o,"No Level":d},o})};export{l as TrendLineColor,F as formatDate,v as formatTrackHistoryChartTooltip,T as getChartColors,f as getThemeType,B as getTrackHistoryLineChartData,y as isDarkTheme};
|
|
2
2
|
//# sourceMappingURL=chartUtils.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as i,jsx as e}from"react/jsx-runtime";import{makeStyles as m,Box as a,ButtonGroup as g,Button as b,Menu as h,MenuItem as l}from"@material-ui/core";import x from"@material-ui/icons/ArrowDropDown";import{useState as
|
|
1
|
+
import{jsxs as i,jsx as e}from"react/jsx-runtime";import{makeStyles as m,Box as a,ButtonGroup as g,Button as b,Menu as h,MenuItem as l}from"@material-ui/core";import x from"@material-ui/icons/ArrowDropDown";import{useState as C}from"react";const A=m(d=>({label:{padding:d.spacing(0,1.5,0,0)},icon:{borderLeft:`1px solid ${d.palette.divider}`,display:"flex",alignItems:"center",padding:0},menu:{margin:0,backgroundColor:d.palette.background.paper},button:{padding:d.spacing(.5,1.5),paddingRight:d.spacing(.5)}})),f=({onAddCondition:d,onAddExpression:p})=>{const n=A(),[r,s]=C(null),o=!!r,c=u=>{s(u.currentTarget)},t=()=>{s(null)};return i(a,{children:[e(g,{color:"primary",children:i(b,{className:n.button,"data-testid":"add-button",id:"add-button","aria-controls":o?"add-menu":void 0,"aria-haspopup":"true","aria-expanded":o?"true":void 0,onClick:c,size:"medium",children:[e(a,{className:n.label,children:"Add"}),e(a,{className:n.icon,children:e(x,{})})]})}),i(h,{id:"add-menu",anchorEl:r,open:o,onClose:t,classes:{paper:n.menu},MenuListProps:{"aria-labelledby":"add-button"},children:[e(l,{"data-testid":"add-condition",onClick:()=>{d(),t()},children:"Add Condition"}),e(l,{"data-testid":"add-expression",onClick:()=>{p(),t()},children:"Add Expression"})]})]})};export{f as AddMenuButton};
|
|
2
2
|
//# sourceMappingURL=AddMenuButton.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as t,jsxs as y,Fragment as
|
|
1
|
+
import{jsx as t,jsxs as y,Fragment as ie}from"react/jsx-runtime";import{stringifyEntityRef as F,parseEntityRef as oe,RELATION_OWNED_BY as ne,RELATION_PART_OF as re}from"@backstage/catalog-model";import{useRouteRef as ae}from"@backstage/core-plugin-api";import{entityRouteRef as se,getEntityRelations as j,humanizeEntityRef as C}from"@backstage/plugin-catalog-react";import{TableRoot as ce,TableHeader as le,Column as d,TableBody as de,TablePagination as pe,Row as fe,Flex as ge,CellText as u,CellProfile as me}from"@backstage/ui";import{RiCheckLine as ye,RiCloseLine as ue,RiAlertLine as he,RiErrorWarningFill as Ie,RiProhibitedLine as Re,RiIndeterminateCircleLine as we,RiInformationOffLine as ke}from"@remixicon/react";import{compact as Se,uniq as Ee,startCase as Ce}from"lodash";import{useState as b,useEffect as W,useMemo as P,useCallback as v}from"react";import{useNavigate as be}from"react-router-dom";import{ResultState as l,CheckEntityField as p,Direction as s}from"../../../graphql/generated/index.esm.js";import{useEntitiesByRefs as Pe}from"../../../hooks/catalog/useEntitiesByRefs.esm.js";import{useProfileImages as ve}from"../../../hooks/catalog/useProfileImages.esm.js";import{useCheckEntities as Le}from"../../../hooks/entities/useCheckEntities.esm.js";import{useSortSearchParams as ze}from"../../../hooks/useSortSearchParams.esm.js";import{CustomCell as Ne}from"../../CustomCell/CustomCell.esm.js";import"../../EmptyState/EmptyState.esm.js";import{EmptyStateBUI as Te}from"../../EmptyState/EmptyStateBUI.esm.js";import"@backstage/plugin-permission-react";import"@spotify/backstage-plugin-soundcheck-common";import"../../../routes.esm.js";import{LoadingTableSkeleton as Ae}from"../../LoadingTableSkeleton/LoadingTableSkeleton.esm.js";import{toResultState as _}from"../utils.esm.js";import{toCheckEntityRow as Be}from"./utils.esm.js";const K=10,De=["kind","metadata.name","metadata.namespace","spec.profile.displayName","metadata.title","relations","spec.lifecycle","spec.type"],Oe={[l.Passed]:t(ye,{style:{color:"var(--bui-fg-success)"}}),[l.Failed]:t(ue,{style:{color:"var(--bui-fg-danger)"}}),[l.Warning]:t(he,{}),[l.Error]:t(Ie,{}),[l.Exempt]:t(Re,{style:{color:"var(--bui-fg-disabled)"}}),[l.NotReported]:t(we,{style:{color:"var(--bui-fg-disabled)"}}),[l.NotApplicable]:t(ke,{style:{color:"var(--bui-fg-disabled)"}})},L={name:p.Name,owner:p.Owner,system:p.System,type:p.Type,lifecycle:p.Lifecycle},xe=({checkId:M,trackId:q,filter:h,states:I})=>{const{updateSortParams:z,searchParams:f}=ze(),[R,N]=b(()=>{const e=f.get("sortDirection");return e==="ascending"?s.Asc:e==="descending"?s.Desc:s.Asc}),[m,T]=b(()=>{const e=f.get("sort");return e&&L[e]?e:"name"}),H=R===s.Asc?"ascending":"descending",[i,A]=b({orderBy:void 0,filter:h,states:I?.map(_).filter(e=>e!==void 0),pageInfo:{page:0,pageSize:K,direction:"forward",cursor:null}});W(()=>{const e=f.get("sortDirection");(e==="ascending"||e==="descending")&&N(e==="ascending"?s.Asc:s.Desc);const o=f.get("sort");o&&L[o]&&T(o)},[f]),W(()=>{let e;m?e={field:L[m]??p.Name,direction:R}:e=void 0,A(o=>({...o,orderBy:e,pageInfo:{...o.pageInfo,page:0,cursor:null},filter:h,states:I?.map(_).filter(a=>a!==void 0)}))},[h,I,m,R]);const{data:r,isLoading:U}=Le({checkId:M,trackId:q,orderBy:i.orderBy,filter:i.filter,states:i.states?.length?i.states:void 0,[i.pageInfo.direction==="forward"?"first":"last"]:i.pageInfo.pageSize,[i.pageInfo.direction==="forward"?"after":"before"]:i.pageInfo.cursor}),Y=r?.checkEntities.edges.map(e=>e.node.entityRef)??[],{data:w,isLoading:$}=Pe({entityRefs:Y,fields:De}),G=P(()=>r?.checkEntities.edges??[],[r]),k=P(()=>r?.checkEntities.totalCount??0,[r]),J=k>K,S=v((e,o)=>{const a=e>i.pageInfo.page?"forward":"backward",E=a==="forward"?r?.checkEntities.pageInfo.endCursor??null:r?.checkEntities.pageInfo.startCursor??null;A({...i,pageInfo:{page:e,pageSize:o,direction:a,cursor:E}})},[r,i]),Q=v(({direction:e,column:o})=>{T(String(o)),N(e==="ascending"?s.Desc:s.Asc),z({sort:String(o),sortDirection:e})},[z]),B=P(()=>!r?.checkEntities.edges?.length||!w?.items?.length?[]:Se(r.checkEntities.edges.map(e=>{const o=w.items.find(a=>!!a&&F(a)===e.node.entityRef);return o?Be({checkDetails:e.node,entity:o}):void 0})),[r?.checkEntities.edges,w?.items]),V=({row:e})=>{const o=be(),a=ae(se),E=v(n=>{const c=oe(F(n)),g=a(c);o(`${g}/soundcheck`)},[o,a]),X=j(e.entity,ne).map(n=>C(n,{defaultKind:n.kind})).join(", "),Z=j(e.entity,re,{kind:"system"}).map(n=>C(n,{defaultKind:"system"})).join(", "),ee=Ee(B.flatMap(n=>n.entity.relations?.filter(({type:c,targetRef:g})=>c==="ownedBy"&&g).map(c=>c.targetRef)||[])),{profileImageMap:te}=ve(ee),D=e.entity.relations?.find(({type:n})=>n==="ownedBy")?.targetRef;let O;D&&(O=te?.[D]);const x=C(e.entity,{defaultKind:"Component"});return y(fe,{onAction:()=>E(e.entity),children:[t(Ne,{children:t(ge,{children:(n=>{const c=Oe[n],g=Ce(n.toLowerCase());return t("span",{title:g,children:c})})(e.state)})}),t(u,{title:x}),t(u,{title:Z}),t(me,{name:X,src:O??x}),t(u,{title:e.entity.spec?.type}),t(u,{title:e.entity.spec?.lifecycle})]},e.id)};return U||$?t(Ae,{}):G.length?y(ie,{children:[y(ce,{onSortChange:Q,sortDescriptor:{direction:H,column:m},children:[y(le,{children:[t(d,{id:"state",style:{width:"5%"}}),t(d,{id:"name",allowsSorting:!0,isRowHeader:!0,style:{width:"35%"},children:"Name"}),t(d,{id:"system",allowsSorting:!0,style:{width:"20%"},children:"System"}),t(d,{id:"owner",allowsSorting:!0,style:{width:"20%"},children:"Owner"}),t(d,{id:"type",allowsSorting:!0,style:{width:"10%"},children:"Type"}),t(d,{id:"lifecycle",allowsSorting:!0,style:{width:"10%"},children:"Lifecycle"})]}),t(de,{children:B.map(e=>t(V,{row:e},e.id))})]}),J&&t(pe,{showPageSizeOptions:!0,totalCount:k,pageSize:i.pageInfo.pageSize,offset:i.pageInfo.page*i.pageInfo.pageSize,onPreviousPage:()=>{const e=i.pageInfo.page-1;S(e,i.pageInfo.pageSize)},onNextPage:()=>{const e=i.pageInfo.page+1;S(e,i.pageInfo.pageSize)},onPageSizeChange:e=>{S(i.pageInfo.page,e)},hasNextPage:(i.pageInfo.page+1)*i.pageInfo.pageSize<k,hasPreviousPage:i.pageInfo.page>0})]}):t(Te,{title:"No check entities found",body:"There are no check entities found."})};export{xe as CheckEntitiesTableBUI};
|
|
2
2
|
//# sourceMappingURL=CheckEntitiesTableBUI.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as i,jsxs as h,Fragment as me}from"react/jsx-runtime";import{parseEntityRef as pe}from"@backstage/catalog-model";import{useRouteRef as R}from"@backstage/core-plugin-api";import{usePermission as de}from"@backstage/plugin-permission-react";import{Container as H,HeaderPage as fe,Flex as W,Box as P}from"@backstage/ui";import{makeStyles as he}from"@material-ui/core";import{toEntityFilterQuery as w,combineEntityFilterQueries as ue,soundcheckCheckReadPermission as ke}from"@spotify/backstage-plugin-soundcheck-common";import{useState as F,useMemo as a,useEffect as ge}from"react";import{useSearchParams as Ee,useParams as Ie}from"react-router-dom";import Se from"react-use/lib/useDebounce";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import{useCheck as Te}from"../../hooks/checks/useCheck.esm.js";import"../../hooks/useSoundcheckAlert.esm.js";import{useTrack as be}from"../../hooks/tracks/useTrack.esm.js";import"../../hooks/useConfirmationModal.esm.js";import{useCheckStatus as ye}from"../../hooks/aggregations/useCheckStatus.esm.js";import"react-use/lib/useLocalStorage";import{useFilters as Ce}from"../../hooks/filters/useFilters.esm.js";import{useLCPReporting as ve}from"../../hooks/useLCPReporting.esm.js";import{useLoadTimeReporting as Ne}from"../../hooks/useLoadTimeReporting.esm.js";import{trackDetailsRouteRef as Re,checksPageRouteRef as Pe,tracksPageRouteRef as we}from"../../routes.esm.js";import"../../utils/facetFilters/types.esm.js";import{parseNumberOfDays as Fe}from"../../utils/facetFilters/utils.esm.js";import{DescriptionCard as Le}from"../Cards/DescriptionCard/DescriptionCard.esm.js";import"../Cards/HistoricalTrackStatusCard/HistoricalTrackStatusCard.esm.js";import"../Cards/TrackStatusCard/TrackStatusCard.esm.js";import{CheckStatusCard as xe}from"../Cards/CheckStatusCard/CheckStatusCard.esm.js";import{HistoricalCheckStatusCard as Ae}from"../Cards/HistoricalCheckStatusCard/HistoricalCheckStatusCard.esm.js";import{ChipSelector as je}from"../ChipSelector/ChipSelector.esm.js";import"../EmptyState/EmptyState.esm.js";import{EmptyStateBUI as L}from"../EmptyState/EmptyStateBUI.esm.js";import"@remixicon/react";import"../FilterSidebar/FilterSidebar.esm.js";import"../FilterSidebar/StateFilter.esm.js";import"lodash";import{toFilter as Me}from"../FilterSidebar/util.esm.js";import{LoadingTableSkeleton as Oe}from"../LoadingTableSkeleton/LoadingTableSkeleton.esm.js";import{SimpleMenu as Be}from"../Menus/SimpleMenu.esm.js";import{useCheckActions as De}from"../Menus/useCheckActions.esm.js";import{PageCustomActions as Ue}from"../PageCustomActions/PageCustomActions.esm.js";import{CheckEntitiesTableBUI as Xe}from"./CheckEntitiesTable/CheckEntitiesTableBUI.esm.js";import{ExemptionsTableBUI as qe}from"./ExemptionsTableBUI.esm.js";const Ve=he(()=>({container:{marginBottom:"var(--bui-space-12)"},tables:{margin:"var(--bui-space-12) 0 0"},tableContent:{margin:"var(--bui-space-3) 0 0"}})),s={ENTITIES:"Entities",EXEMPTIONS:"Exemptions"},Qe={entities:s.ENTITIES,exemptions:s.EXEMPTIONS},$e={[s.ENTITIES]:"entities",[s.EXEMPTIONS]:"exemptions"},He=(p,e)=>p.levels.flatMap(({checks:l})=>l).find(({id:l})=>l===e)||null,We=()=>{const p=Ve(),[e,l]=Ee(),{trackId:o,checkId:r}=Ie(),{data:c,isLoading:k,isError:_}=be(o),{data:g,isLoading:u,isError:z}=Te(r),x=g?.ownerEntityRef,G=x?pe(x).name:void 0,A=De(g??void 0),J=R(Re),K=R(Pe),Y=R(we),[j,Z]=F(()=>{const t=e.get("section"),f=t?Qe[t]:null;return new Set([f??s.ENTITIES])}),b=j.values().next().value??s.ENTITIES,[d,M]=F(e.get("search")||""),[O,ee]=F(""),te=t=>{Z(t),M("");const f=t.values().next().value,$=f?$e[f]:void 0;$?l({section:$},{replace:!0}):l({},{replace:!0})},n=a(()=>e.getAll("states"),[e]),E=a(()=>e.getAll("owners"),[e]),I=a(()=>e.getAll("lifecycles"),[e]),S=a(()=>e.getAll("types"),[e]),T=a(()=>e.getAll("systems"),[e]),y=a(()=>Fe(e.get("numberOfDays")),[e]);Se(()=>{ee(d);const t=new URLSearchParams(e.toString());d?t.set("search",d):t.delete("search"),l(t,{replace:!0})},300,[d]);const B=a(()=>({routeName:"soundcheck-check-insights",additionalAttributes:{checkId:r||"",trackId:o||"",filtersApplied:E.length+I.length+S.length+T.length+n.length,ownersFilter:E.join(",")||"",lifecyclesFilter:I.join(",")||"",typesFilter:S.join(",")||"",systemsFilter:T.join(",")||"",statesFilter:n.join(",")||"",numberOfDays:y,checkSearch:O}}),[r,o,E,I,S,T,n,y,O]),{reportContentLoaded:D}=Ne(B),{reporter:re}=ve(B),m=a(()=>g??c?.levels.flatMap(t=>t.checks).find(t=>t.id===r),[g,r,c?.levels]),C=Me({lifecycles:I,owners:E,types:S,systems:T}),{data:U,isLoading:v,isError:ie}=ye({checkId:r,trackId:o,filter:C,states:n?.length?n:void 0},!!r);let N;if(r)if(c){const t=w(c.filter),f=w(He(c,r)?.filter);N=ue(t,f)}else m?.filter&&(N=w(m.filter));const{loading:X,allowed:q}=de({permission:ke,resourceRef:r}),oe=a(()=>!!m&&!X&&!q,[q,m,X]),{filters:se,selected:ae,setSelected:ce,onRemoveTag:ne,selectedTags:le}=Ce({entityFilterQuery:N,hasStatusFilters:!0}),V=_||z||ie,Q=re?.getLCPValue();return ge(()=>{!u&&!v&&(!o||!k)&&D({lcp:Q})},[u,v,k,o,D,Q]),u||o&&k?i(Oe,{}):!u&&!m?i(H,{className:p.container,children:i(L,{title:"Check not found",body:`There is no check with the requested id: ${r}.`})}):oe?i(L,{title:"Cannot view check",body:`No permission to view check with the requested id: ${r}.`}):o&&!k&&!c?i(L,{title:"No track found",body:`There is no track with the requested id: ${o}.`}):h(me,{children:[i(fe,{title:m?.name??"",breadcrumbs:o?[{label:"Tracks",href:Y()},{label:c?.name??"Track",href:J({trackId:o})}]:[{label:"Checks",href:K()}],customActions:i(Be,{label:"Check Actions",disabled:!A.length,placement:"left top",menuActions:A})}),h(H,{className:p.container,children:[h(W,{children:[i(Le,{description:m?.description??void 0,owner:G,isError:V,isLoading:u}),i(xe,{states:n,status:U,isLoading:v,isError:V}),i(Ae,{checkId:r,trackId:o,filter:C,states:n,checkStatus:U,numberOfDays:y})]}),h(P,{className:p.tables,children:[h(W,{justify:"between",children:[i(P,{minWidth:"12rem",children:i(je,{options:Object.values(s),selected:j,ariaLabel:"Sections",onSelectionChange:te})}),i(Ue,{searchValue:d,setSearchValue:t=>M(t),filters:se,selected:ae,setSelected:ce,onRemoveTag:ne,selectedTags:le,showSearch:b!==s.ENTITIES})]}),h(P,{className:p.tableContent,children:[b===s.ENTITIES&&i(Xe,{checkId:r,trackId:c?.id,filter:C,states:n}),b===s.EXEMPTIONS&&i(qe,{checkId:r,searchValue:d})]})]})]})]})};export{We as CheckPageBUI};
|
|
2
2
|
//# sourceMappingURL=CheckPageBUI.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as i,jsxs as
|
|
1
|
+
import{jsx as i,jsxs as l,Fragment as I}from"react/jsx-runtime";import{parseEntityRef as n}from"@backstage/catalog-model";import{useRouteRef as W,useApi as U}from"@backstage/core-plugin-api";import{entityRouteRef as $,entityPresentationApiRef as D}from"@backstage/plugin-catalog-react";import{TableRoot as F,TableHeader as H,Column as f,TableBody as M,Row as O,CellText as P,TooltipTrigger as J,Button as V,Tooltip as q,TablePagination as G}from"@backstage/ui";import{makeStyles as K}from"@material-ui/core";import{useState as T,useMemo as p,useCallback as Q}from"react";import{useNavigate as X}from"react-router-dom";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import"@spotify/backstage-plugin-soundcheck-common";import"../../hooks/useSoundcheckAlert.esm.js";import"../../hooks/useConfirmationModal.esm.js";import{usePagination as Y}from"../../hooks/usePagination.esm.js";import"react-use/lib/useLocalStorage";import{useExemptions as Z}from"../../hooks/exemptions/useExemptions.esm.js";import{formatTimestamp as ee}from"../../utils/time.esm.js";import{CustomCell as te}from"../CustomCell/CustomCell.esm.js";import"../EmptyState/EmptyState.esm.js";import{EmptyStateBUI as _}from"../EmptyState/EmptyStateBUI.esm.js";import"@backstage/plugin-permission-react";import"@remixicon/react";import"../../routes.esm.js";import{LoadingTableSkeleton as ie}from"../LoadingTableSkeleton/LoadingTableSkeleton.esm.js";const j=10,oe=K(u=>({justificationCell:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",whiteSpace:"pre-line",wordBreak:"break-word",fontWeight:"normal",textAlign:"left",background:"none !important",padding:0},emptyStateWrapper:{padding:u.spacing(2)}})),re=({checkId:u,searchValue:g})=>{const v=oe(),x=X(),S=W($),[c,R]=T("ascending"),[h,E]=T("entity"),{data:d,isLoading:z,error:B}=Z(u),y=p(()=>d?.totalCount??0,[d]),w=p(()=>d?.edges??[],[d]),N=Q(t=>{const e=n(t),o=S(e);x(`${o}/soundcheck`)},[x,S]),m=p(()=>{const t=(e,o)=>e<o?c==="ascending"?-1:1:e>o?c==="ascending"?1:-1:0;return[...w].sort((e,o)=>{const a=e.node,s=o.node;switch(h){case"entity":return t(n(a.entity_ref).name,n(s.entity_ref).name);case"justification":return t(a.justification??"",s.justification??"");case"user":return t(n(a.user_ref).name,n(s.user_ref).name);case"date":return t(a.timestamp,s.timestamp);default:return 0}})},[w,h,c]),b=U(D),C=p(()=>{const t=new Map;for(const{node:e}of m){const o=b.forEntity(e.entity_ref)?.snapshot?.primaryTitle;o&&t.set(e.entity_ref,o)}return t},[m,b]),k=p(()=>{if(!g?.length)return m;const t=g.toLowerCase().trim();return m.filter(({node:e})=>C.get(e.entity_ref)?.toLowerCase().includes(t))},[m,g,C]),L=y>j,{paginatedItems:A,paginationProps:r}=Y({pageParam:"perPage",defaultPageSize:j,items:k});return z?i(ie,{}):B?i(_,{title:"Exemptions failed",body:"Failed to load exemptions."}):!w.length||!k.length?i(_,{title:"No check exemptions found",body:"There are no check exemptions found."}):l(I,{children:[l(F,{onSortChange:({direction:t,column:e})=>{E(e),R(t)},sortDescriptor:{direction:c,column:h},children:[l(H,{children:[i(f,{id:"entity",allowsSorting:!0,isRowHeader:!0,style:{width:"35%"},children:"Entity"}),i(f,{id:"justification",style:{width:"40%"},children:"Justification"}),i(f,{id:"user",allowsSorting:!0,style:{width:"15%"},children:"User"}),i(f,{id:"date",allowsSorting:!0,style:{width:"10%"},children:"Date"})]}),i(M,{children:A.map(t=>{const e=t.node,o=ee(e.timestamp),a=n(e.user_ref),s=n(e.entity_ref);return l(O,{onAction:()=>N(e.entity_ref),children:[i(P,{title:s.name}),i(te,{children:l(J,{children:[i(V,{variant:"tertiary",className:v.justificationCell,children:e.justification}),i(q,{children:e.justification})]})}),i(P,{title:a.name}),i(P,{title:o})]},`${e.entity_ref}-${e.check_id}`)})})]}),L&&i(G,{totalCount:y,offset:r.offset,hasNextPage:r.offset+r.pageSize<y,hasPreviousPage:r.offset>0,onNextPage:r.onNextPage,onPreviousPage:r.onPreviousPage,onPageSizeChange:r.onPageSizeChange,pageSize:r.pageSize})]})};export{re as ExemptionsTableBUI};
|
|
2
2
|
//# sourceMappingURL=ExemptionsTableBUI.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as t,jsxs as m,Fragment as
|
|
1
|
+
import{jsx as t,jsxs as m,Fragment as W}from"react/jsx-runtime";import{useRouteRef as T,useApi as A}from"@backstage/core-plugin-api";import{entityPresentationApiRef as Y}from"@backstage/plugin-catalog-react";import{usePermission as _}from"@backstage/plugin-permission-react";import{HeaderPage as q,Flex as K,Container as Q,TableRoot as X,TableHeader as Z,Column as y,TableBody as $,TablePagination as ee}from"@backstage/ui";import{makeStyles as te}from"@material-ui/core";import{soundcheckCheckCreatePermission as re}from"@spotify/backstage-plugin-soundcheck-common";import{sortBy as oe,isEmpty as P}from"lodash";import{useState as k,useMemo as N}from"react";import{useSearchParams as ie}from"react-router-dom";import ne from"react-use/lib/useDebounce";import{soundcheckApiRef as ae}from"../../api.esm.js";import"@backstage/catalog-model";import"@tanstack/react-query";import"../../hooks/graphqlKeys.esm.js";import{useGetChecks as se}from"../../hooks/checks/useGetChecks.esm.js";import"../../hooks/useSoundcheckAlert.esm.js";import"../../hooks/useConfirmationModal.esm.js";import{usePagination as me}from"../../hooks/usePagination.esm.js";import"react-use/lib/useLocalStorage";import{useProfileImages as ce}from"../../hooks/catalog/useProfileImages.esm.js";import{useImportChecks as pe}from"../../hooks/checks/useImportChecks.esm.js";import{useSearchNameOwner as le}from"../../hooks/useSearchNameOwner.esm.js";import{checkTemplatesRouteRef as fe,checkDetailsRouteRef as de}from"../../routes.esm.js";import{exportChecks as ge}from"../../utils/export.esm.js";import"../EmptyState/EmptyState.esm.js";import{EmptyStateBUI as he}from"../EmptyState/EmptyStateBUI.esm.js";import"@remixicon/react";import{EmptyStateNoChecks as ue}from"../EmptyState/EmptyStateNoChecks.esm.js";import{ImportExportPanelBUI as we}from"../ImportExportPanel/ImportExportPanelBUI.esm.js";import"../ImportExportPanel/ImportExportPanelDeprecated.esm.js";import{ListPageCustomActions as ye}from"../ListPageCustomActions/ListPageCustomActions.esm.js";import{LoadingTableSkeleton as Pe}from"../LoadingTableSkeleton/LoadingTableSkeleton.esm.js";import"../Menus/SimpleMenu.esm.js";import{useCheckActions as ke}from"../Menus/useCheckActions.esm.js";import"../../contexts/TrackFormContext.esm.js";import"../../contexts/CheckFormContext.esm.js";import"../../contexts/CampaignFormContext.esm.js";import"../../contexts/UserProvider.esm.js";import"uuid";import"../CampaignsPage/CampaignListPage/useArchiveConfirmationModal.esm.js";import{TableRowWithOwner as Ce}from"../TableRowWithOwner/TableRowWithOwner.esm.js";const L=10,Re=["name","owner"],Se=({check:o,profileImageMap:a})=>{const c=T(de),i=ke(o);return t(Ce,{ownerEntityRef:o.ownerEntityRef??"",href:c({checkId:o.id}),profileImageSrc:a[o.ownerEntityRef??""],menuActions:i,name:o.name??o.id,description:o.description??"",cells:[]})},Ee=te(()=>({container:{marginBottom:"var(--bui-space-12)"}})),Ie=()=>{const o=Ee(),[a,c]=ie(),[i,z]=k(()=>a.get("search")??""),[d,B]=k(()=>a.get("sortDirection")==="descending"?"descending":"ascending"),[s,v]=k(()=>{const e=a.get("sort");return e&&Re.includes(e)?e:""}),{isLoading:p,data:C}=se({}),g=N(()=>C?.edges?.map(e=>e.node)??[],[C?.edges]),{loading:R,allowed:S}=_({permission:re}),U=T(fe),{profileImageMap:D}=ce(g.filter(e=>e.ownerEntityRef).map(e=>e.ownerEntityRef)),E=A(Y),h=le(g,i),l=N(()=>{if(!s)return h;const e=oe(h,r=>s==="owner"?r.ownerEntityRef?E.forEntity(r.ownerEntityRef).snapshot.primaryTitle:-1:s==="type"?r.type?r.type:"default":r?.name?.toLowerCase()??r.id.toLowerCase());return d==="descending"&&e.reverse(),e},[s,h,d,E]),{mutateAsync:H}=pe(),M=async e=>H(e),O=A(ae),F=async()=>{const e=await O.getChecks({orderAlphabetical:"asc"});return ge(e.edges.map(r=>r.node))},{paginatedItems:u,reset:I,paginationProps:n}=me({pageParam:"perPage",defaultPageSize:L,items:l});ne(()=>{I();const e=new URLSearchParams(a.toString());i?e.set("search",i):e.delete("search"),c(e,{replace:!0})},300,[i]);const V=({direction:e,column:r})=>{const w=String(r);v(w),B(e),I();const f=new URLSearchParams(a);w?f.set("sort",w):f.delete("sort"),f.set("sortDirection",e),c(f,{replace:!0})},j=p,b=!p&&P(u),G=!p&&!P(u),J=l.length>L;let x=null;return b&&(x=i?t(he,{title:"No checks found",body:"Your current search term did not return any checks. Please try a different search term."}):t(ue,{})),m(W,{children:[t(q,{customActions:m(K,{gap:"2",align:"center",children:[t(we,{resourceType:"check",disableImport:!R&&!S,disableExport:p||P(g),onImport:M,onExport:F}),t(ye,{searchValue:i,setSearchValue:z,canCreate:!R&&S,createHref:U()})]}),title:"Checks"}),m(Q,{className:o.container,children:[j&&t(Pe,{rowCount:10}),b&&x,G&&m(X,{onSortChange:V,sortDescriptor:{direction:d,column:s},children:[m(Z,{children:[t(y,{id:"name",allowsSorting:!0,isRowHeader:!0,style:{width:"82%"},children:"Name"}),t(y,{id:"owner",allowsSorting:!0,style:{width:"15%"},children:"Check Owner"}),t(y,{id:"actions",style:{width:"3%"}})]}),t($,{children:u.map(e=>t(Se,{check:e,profileImageMap:D??{}},e.id))})]}),J&&t(ee,{totalCount:l.length,offset:n.offset,hasNextPage:n.offset+n.pageSize<(l.length??0),hasPreviousPage:n.offset>0,onNextPage:n.onNextPage,onPreviousPage:n.onPreviousPage,onPageSizeChange:n.onPageSizeChange,pageSize:n.pageSize})]})]})};export{Ie as ChecksListPageBUI};
|
|
2
2
|
//# sourceMappingURL=ChecksListPageBUI.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as t,jsxs as p,Fragment as j}from"react/jsx-runtime";import{useRouteRef as A}from"@backstage/core-plugin-api";import{Row as U,CellText as y,Flex as F,Box as x,Text as H,TableRoot as O,TableHeader as M,Column as C,TableBody as V,TablePagination as W}from"@backstage/ui";import{makeStyles as q}from"@material-ui/core";import{sortBy as J}from"lodash";import{memo as I,useMemo as S,useState as N,useEffect as K,useCallback as Q}from"react";import{CircularProgressbar as X}from"react-circular-progressbar";import{useNavigate as Y}from"react-router-dom";import"@backstage/catalog-model";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"@spotify/backstage-plugin-soundcheck-common";import"../../hooks/useSoundcheckAlert.esm.js";import"../../hooks/useConfirmationModal.esm.js";import{usePagination as Z}from"../../hooks/usePagination.esm.js";import"react-use/lib/useLocalStorage";import{useSortSearchParams as _}from"../../hooks/useSortSearchParams.esm.js";import{trackCheckDetailsRouteRef as ee}from"../../routes.esm.js";import{getPercentage as B}from"../../utils/formatters.esm.js";import"../CheckStatusBar/CheckStatusBar.esm.js";import{CheckStatusBarBUI as te}from"../CheckStatusBar/CheckStatusBarBUI.esm.js";import{CustomCell as re}from"../CustomCell/CustomCell.esm.js";import"../EmptyState/EmptyState.esm.js";import{EmptyStateBUI as oe}from"../EmptyState/EmptyStateBUI.esm.js";import"@backstage/plugin-permission-react";import"@remixicon/react";const ie=q(()=>({statusBar:{width:"45%"},customCell:{padding:"0 var(--bui-space-3)"},circularProgressbar:{width:"var(--bui-space-7)"}})),R=10,se=["compliance","name","checks"],b=o=>se.includes(o),ae=I(()=>t("svg",{width:"0",height:"0",style:{position:"absolute",visibility:"hidden"},children:t("defs",{children:p("linearGradient",{id:"progressGradient",x1:"1",y1:"0",x2:"0",y2:"1",children:[t("stop",{offset:"0%",stopColor:"var(--bui-fg-warning)"}),t("stop",{offset:"100%",stopColor:"var(--bui-fg-success)"})]})})})),T=(o,i)=>i?.find(g=>g.id===o),z=o=>o?o.numberOfEntities-o.notApplicable-o.exempt:0,ne=I(({trackId:o,check:i,checkStatuses:g,searchParams:u})=>{const s=ie(),P=A(ee),a=Y(),n=T(i.id,g),{passPercent:c,applicableChecks:h}=S(()=>{const l=z(n);return{passPercent:B(n?.passed,l),applicableChecks:l}},[n]);return p(U,{onAction:()=>{const l=P({trackId:o,checkId:i.id});a(u?`${l}${u}`:l)},children:[t(y,{leadingIcon:p("div",{className:s.circularProgressbar,title:`${c}%`,children:[t(ae,{}),t(X,{value:c,strokeWidth:12,styles:{path:{stroke:"url(#progressGradient)"},trail:{stroke:'rgba(var("--bui-fg-secondary"), 0.25)'}}})]}),title:`${c}%`}),t(y,{title:i.name}),t(re,{children:p(F,{align:"center",gap:"3",justify:"between",children:[t(x,{children:p(H,{color:"secondary",children:[n?.passed??0," of ",h," checks passing"]})}),t(x,{className:s.statusBar,children:t(te,{status:n})})]})})]},i.id)}),ce=({trackId:o,checks:i,checkStatuses:g,searchValue:u,levelOrdinal:s})=>{const{updateSortParams:P,searchParams:a}=_(),n=a.get("level"),c=s===void 0||n!==null&&String(s)===n,[h,l]=N(()=>{if(c){const e=a.get("sortDirection");if(e==="ascending"||e==="descending")return e}return"descending"}),[f,v]=N(()=>{if(c){const e=a.get("sort");if(e&&b(e))return e}return"compliance"}),D=S(()=>{const e=new URLSearchParams(a.toString());e.set("sort",f),e.set("sortDirection",h),typeof s=="number"?e.set("level",String(s)):e.delete("level");const r=e.toString();return r?`?${r}`:""},[s,a,f,h]);K(()=>{if(!c)return;const e=a.get("sortDirection");(e==="ascending"||e==="descending")&&l(e);const r=a.get("sort");r&&b(r)&&v(r)},[c,a]);const L=Q(({direction:e,column:r})=>{const m=String(r);b(m)&&v(m),l(e),P({sort:b(m)?m:"compliance",sortDirection:e,level:s})},[s,P]),w=S(()=>{if(!u?.length)return i??[];const e=u.toLowerCase();return i?.filter(({name:r})=>r.toLowerCase().includes(e))??[]},[i,u]),k=S(()=>{const e=J([...w],r=>{const m=T(r.id,g);if(f==="compliance"){const G=z(m);return B(m?.passed,G)}return f==="checks"?m?.passed:r.name.toLowerCase()});return h==="descending"&&e.reverse(),e},[w,g,f,h]),{paginatedItems:$,paginationProps:d}=Z({pageParam:"perPage",defaultPageSize:R,items:k}),E=k.length>R;return k?.length?p(j,{children:[p(O,{onSortChange:L,sortDescriptor:{direction:h,column:f},children:[p(M,{children:[t(C,{id:"compliance",allowsSorting:!0,style:{width:"8%"},children:"Compliance"}),t(C,{id:"name",allowsSorting:!0,isRowHeader:!0,style:{width:"67%"},children:"Name"}),t(C,{id:"checks",allowsSorting:!0,style:{width:"25%"},children:"Checks"})]}),t(V,{children:$.map(e=>t(ne,{trackId:o,check:e,checkStatuses:g,searchParams:D},e.id))})]}),E&&t(W,{totalCount:k.length,offset:d.offset,hasNextPage:d.offset+d.pageSize<(k.length??0),hasPreviousPage:d.offset>0,onNextPage:d.onNextPage,onPreviousPage:d.onPreviousPage,onPageSizeChange:d.onPageSizeChange,pageSize:d.pageSize})]}):t(oe,{title:"No checks",body:"There are no checks found."})};export{ce as ChecksTable};
|
|
2
2
|
//# sourceMappingURL=ChecksTable.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as r,jsxs as i}from"react/jsx-runtime";import{
|
|
1
|
+
import{jsx as r,jsxs as i}from"react/jsx-runtime";import{TableRoot as b,TableHeader as C,Row as s,Column as n,TableBody as g,CellText as f,Box as a,Text as d}from"@backstage/ui";import{makeStyles as v}from"@material-ui/core";import{isEmpty as x}from"lodash";import{getCronDescription as N}from"../../utils/cron.esm.js";import{CustomCell as p}from"../CustomCell/CustomCell.esm.js";import"../EmptyState/EmptyState.esm.js";import{EmptyStateBUI as T}from"../EmptyState/EmptyStateBUI.esm.js";import"@backstage/core-plugin-api";import"@backstage/plugin-permission-react";import"@remixicon/react";import"@spotify/backstage-plugin-soundcheck-common";import"react-router-dom";import"../../routes.esm.js";import{FactExplorerDialogButtonBUI as F}from"../FactExplorer/FactExplorerDialogBUI.esm.js";const S=v(()=>({noConfig:{color:"var(--bui-fg-disabled)"}})),B=({frequency:o})=>{if(o){let e;return o.cron?e=r(a,{children:i(d,{variant:"body-small",children:["cron(",o.cron,") ",N(o.cron)]})}):e=r(a,{children:i(d,{variant:"body-small",color:"secondary",children:["Every ",Object.values(o)[0]," ",Object.keys(o)[0]]})}),r(a,{pt:"1",pb:"1",children:e})}return r(d,{color:"secondary",children:"No Schedule Configured"})},q=({facts:o})=>{const e=S(),u=(l,t)=>l?t?"UI":"YAML":"No Config";return x(o)?r(T,{title:"No Available Facts Found",body:"No Available Facts Found for Integration."}):i(b,{children:[r(C,{children:i(s,{children:[r(n,{id:"fact-name",allowsSorting:!0,isRowHeader:!0,style:{width:"35%"},children:"Fact Name"}),r(n,{children:"Source"}),r(n,{children:"Schedule"}),r(n,{children:"Test"})]})}),r(g,{children:o.map(({factName:l,config:t,uiConfig:h,factRef:m,parentConfig:c})=>{const y=t?.frequency??(Array.isArray(c)?c[0]?.frequency:c?.frequency);return i(s,{children:[r(f,{title:l}),r(f,{className:t?void 0:e.noConfig,title:u(t,h)}),r(p,{children:r(B,{frequency:y})}),r(p,{children:r(F,{factRef:m,size:"small",text:"Test",variant:"secondary"})})]},m)})})]})};export{q as CollectorFactTableBUI};
|
|
2
2
|
//# sourceMappingURL=CollectorFactTableBUI.esm.js.map
|