@spotify/backstage-plugin-soundcheck 0.15.0 → 0.16.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 +48 -0
- package/dist/alpha.d.ts +3 -3
- package/dist/api.esm.js +1 -1
- package/dist/components/CampaignForm/CampaignForm.esm.js +1 -1
- package/dist/components/CampaignForm/hooks/useCampaignForm.esm.js +1 -1
- package/dist/components/CampaignForm/hooks/utils.esm.js +1 -1
- package/dist/components/CampaignForm/utils/campaignFormUtils.esm.js +2 -1
- package/dist/components/CampaignForm/utils/validation.esm.js +1 -1
- package/dist/components/CertificationAccordion/CertificationAccordion.esm.js +1 -1
- package/dist/components/CertificationSidebar/CertificationSidebar.esm.js +1 -1
- package/dist/components/CertificationSidebar/Check.esm.js +1 -1
- package/dist/components/CertificationsPage/CertificationTab.esm.js +1 -1
- package/dist/components/CertificationsPage/CertificationTabs.esm.js +1 -1
- package/dist/components/CertificationsPage/Playlist/PlaylistProgress.esm.js +1 -1
- package/dist/components/CheckCard/CheckCard.esm.js +1 -1
- package/dist/components/CheckDetails/CheckDetails.esm.js +1 -1
- package/dist/components/CheckDetails/CheckResultDetails.esm.js +2 -0
- package/dist/components/CheckDetails/CollapseRow.esm.js +1 -1
- package/dist/components/CheckDetails/ExemptionDetails.esm.js +2 -0
- package/dist/components/CheckDetails/FactTable.esm.js +2 -0
- package/dist/components/CheckDetails/ResolvedValueTable.esm.js +2 -0
- package/dist/components/CheckDetails/ResultStateBox.esm.js +1 -1
- package/dist/components/CheckDetails/SelectedValueContext.esm.js +2 -0
- package/dist/components/CheckDetails/findUniqueFacts.esm.js +2 -0
- package/dist/components/CheckDryRun/CheckDryRun.esm.js +1 -1
- package/dist/components/CheckDryRun/CheckDryRunContext.esm.js +1 -1
- package/dist/components/CheckDryRun/CheckDryRunDetails.esm.js +1 -1
- package/dist/components/CheckDryRun/CheckDryRunDialog.esm.js +1 -1
- package/dist/components/CheckForm/CheckForm.esm.js +1 -1
- package/dist/components/CheckForm/FormFields/RuleInput/Conditions/FactValueDisplay.esm.js +1 -1
- package/dist/components/CheckForm/FormFields/RuleInput/Conditions/RuleConditionInput.esm.js +1 -1
- package/dist/components/CheckForm/FormFields/RuleInput/Conditions/ValueListInput.esm.js +1 -1
- package/dist/components/CheckForm/Steps/CheckReviewStep.esm.js +1 -1
- package/dist/components/CheckForm/utils/checkFormUtils.esm.js +2 -1
- package/dist/components/CheckForm/utils/validation.esm.js +1 -1
- package/dist/components/CheckIcon/CheckIcon.esm.js +1 -1
- package/dist/components/CheckPage/CheckStatusHistoryChart.esm.js +1 -1
- package/dist/components/CheckPage/FilterBar/FilterBar.esm.js +1 -1
- package/dist/components/CheckPage/utils.esm.js +1 -1
- package/dist/components/CollectorPage/Configurators/AzureDevOps/AzureDevOpsConfigurator.esm.js +2 -0
- package/dist/components/CollectorPage/Configurators/AzureDevOps/NumberOfDaysComponent.esm.js +2 -0
- package/dist/components/CollectorPage/Configurators/AzureDevOps/NumberOfWorkItemsComponent.esm.js +2 -0
- package/dist/components/CollectorPage/Configurators/AzureDevOps/utils.esm.js +2 -0
- package/dist/components/CollectorPage/Configurators/AzureDevOps/validation.esm.js +2 -0
- package/dist/components/CollectorPage/Configurators/BigQuery/QueryFactDetailsComponent.esm.js +1 -1
- package/dist/components/CollectorPage/Configurators/Catalog/CatalogConfigurator.esm.js +2 -0
- package/dist/components/CollectorPage/Configurators/Catalog/utils.esm.js +2 -0
- package/dist/components/CollectorPage/Configurators/Common/CollectorOption.esm.js +1 -1
- package/dist/components/CollectorPage/Configurators/Common/FactCollectionConfig.esm.js +1 -1
- package/dist/components/CollectorPage/Configurators/Common/utils.esm.js +1 -1
- package/dist/components/CollectorPage/Configurators/Configurator.esm.js +1 -1
- package/dist/components/CollectorPage/Configurators/HTTP/HttpConfigurator.esm.js +2 -0
- package/dist/components/CollectorPage/Configurators/HTTP/HttpRequestComponent.esm.js +2 -0
- package/dist/components/CollectorPage/Configurators/HTTP/HttpResponseComponent.esm.js +2 -0
- package/dist/components/CollectorPage/Configurators/HTTP/HttpRetriesComponent.esm.js +2 -0
- package/dist/components/CollectorPage/Configurators/HTTP/HttpStatusesInput.esm.js +2 -0
- package/dist/components/CollectorPage/Configurators/HTTP/RequestFactDetailsComponent.esm.js +2 -0
- package/dist/components/CollectorPage/Configurators/HTTP/utils.esm.js +2 -0
- package/dist/components/CollectorPage/Configurators/HTTP/validation.esm.js +2 -0
- package/dist/components/CollectorPage/Configurators/SCM/JsonFactDetailsComponent.esm.js +1 -1
- package/dist/components/CollectorPage/Configurators/SCM/RegexFactDetailsComponent.esm.js +1 -1
- package/dist/components/CollectorsPage/CollectorListPage/CollectorLogo.esm.js +1 -1
- package/dist/components/CollectorsPage/CollectorListPage/CollectorSummaryCard.esm.js +1 -1
- package/dist/components/EntityChip/EntityChip.esm.js +2 -0
- package/dist/components/EntitySoundcheckCard/Card.esm.js +1 -1
- package/dist/components/Filter/EntityAutocompletePicker.esm.js +1 -1
- package/dist/components/Filter/FilterComponent.esm.js +1 -1
- package/dist/components/Filter/FilterKeyValueInput.esm.js +2 -0
- package/dist/components/Filter/FilterPreviewTable/FilterPreviewTable.esm.js +1 -1
- package/dist/components/Filter/KeyValueInputDialog.esm.js +2 -0
- package/dist/components/Filter/types.esm.js +1 -1
- package/dist/components/Filter/utils.esm.js +1 -1
- package/dist/components/FormFilterSection/FormFilterSection.esm.js +1 -1
- package/dist/components/Frequency/FrequencyComponent.esm.js +1 -1
- package/dist/components/OverviewTable/ResultsTable.esm.js +1 -1
- package/dist/components/OverviewTable/ResultsTableRow.esm.js +1 -1
- package/dist/components/Router.esm.js +1 -1
- package/dist/components/RuleResult/BranchResultComponent.esm.js +2 -0
- package/dist/components/RuleResult/ConditionResultComponent.esm.js +2 -0
- package/dist/components/RuleResult/RuleResultComponent.esm.js +2 -0
- package/dist/components/SearchBar/SearchBar.esm.js +1 -1
- package/dist/components/SoundcheckHeader/Breadcrumbs.esm.js +1 -1
- package/dist/components/SoundcheckHeader/SoundcheckHeader.esm.js +1 -1
- package/dist/components/SummaryCard/SummaryCardActionsMenu.esm.js +1 -1
- package/dist/components/TechHealth/Filters/FacetFilter.esm.js +1 -1
- package/dist/components/TrackEditPage/TrackEditView.esm.js +1 -1
- package/dist/components/TrackForm/TrackForm.esm.js +1 -1
- package/dist/components/TrackForm/utils/trackFormUtils.esm.js +2 -1
- package/dist/components/TrackForm/utils/useTrackForm.esm.js +1 -1
- package/dist/components/TrackForm/utils/validation.esm.js +1 -1
- package/dist/components/TrackPage/TrackEntitiesTable/utils.esm.js +1 -1
- package/dist/graphql/generated/index.esm.js +127 -126
- package/dist/hooks/certifications/useTrackOverviewForOwner.esm.js +2 -0
- package/dist/hooks/checks/useDeleteCheck.esm.js +1 -1
- package/dist/hooks/graphqlKeys.esm.js +1 -1
- package/dist/hooks/tracks/useCreateTrack.esm.js +1 -1
- package/dist/hooks/tracks/useDeleteTrack.esm.js +1 -1
- package/dist/hooks/tracks/useGetAllTracks.esm.js +1 -1
- package/dist/hooks/tracks/useGetChecksMap.esm.js +1 -1
- package/dist/hooks/tracks/useUpdateTrack.esm.js +1 -1
- package/dist/images/azure-devops-rgb.svg +13 -0
- package/dist/images/azure-devops-white.svg +13 -0
- package/dist/images/http-rgb.svg +11 -0
- package/dist/images/http-white.svg +11 -0
- package/dist/text.esm.js +1 -1
- package/dist/utils/validation.esm.js +1 -1
- package/package.json +27 -21
- package/dist/hooks/certifications/useProgramOverviewForOwner.esm.js +0 -2
- /package/dist/components/CollectorPage/Configurators/{BigQuery → Common}/css/prism-dark-sql.css.esm.js +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,53 @@
|
|
|
1
1
|
# @spotify/backstage-plugin-soundcheck
|
|
2
2
|
|
|
3
|
+
## 0.16.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- **Migration Required.** Add exclusion filters to check, track, campagins and integration forms.
|
|
8
|
+
- Remove unused campaginProgress graphql endpoint.
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- Update to Backstage `v1.36.0`
|
|
13
|
+
- In line with the open source Backstage framework, support for React 16 has been dropped.
|
|
14
|
+
- Adds support to the Soundcheck Track and Check insights pages for the new 'exempt' check status.
|
|
15
|
+
- Add a free form filter select to filter section on forms.
|
|
16
|
+
- Updates Soundcheck's /results endpoint to authenticate based on passed credentials, and accept results for manual checks.
|
|
17
|
+
Updates Soundcheck's /facts endpoint to authenticate based on passed credentials, and deny users without the new update facts permission.
|
|
18
|
+
Adds support for exempted check results to the backend and to display these results on the frontend.
|
|
19
|
+
- Checks now record resolved values and rule evaluation information which can be displayed on the UI.
|
|
20
|
+
- Add MUI Override name SoundcheckHeader to allow theme customization. Classes to modify: title, breadcrumbs, and headerContent.
|
|
21
|
+
- Added No-Code UI configuration option for Azure DevOps.
|
|
22
|
+
- Adds a gql endpoint for submitting manual check results.
|
|
23
|
+
- Added Generic HTTP Fact Collector.
|
|
24
|
+
- Add front-end validatiojn for exclude filters and improve filter display.
|
|
25
|
+
- Enables filtering by system, type, lifecycle, and owner on the Check Insights page.
|
|
26
|
+
- Add annotations filter to soundcheck forms.
|
|
27
|
+
- Adds a GQL endpoint for submitting entity exemptions from checks.
|
|
28
|
+
- Add label filter selection to forms.
|
|
29
|
+
- Soundcheck - Fixes a bug in a react form.
|
|
30
|
+
- Check dry runs now use cached facts if they are available.
|
|
31
|
+
- Renames programs to tracks internally.
|
|
32
|
+
- Creates a new CheckExecutionService, removing the execution functionality from FactCheckerService.
|
|
33
|
+
- Added support for check result exemption details.
|
|
34
|
+
- Adds a new check result type of 'excluded'.
|
|
35
|
+
Prevents exclusions from executing.
|
|
36
|
+
Adds a new check type of 'manual'.
|
|
37
|
+
Prevents manual checks from being executed.
|
|
38
|
+
Updates check return types to include 'notes' and 'exemptions', and makes room for additional types in the future.
|
|
39
|
+
Updates GQL schemas to handle the new types.
|
|
40
|
+
Adds a store and service for manual check entries.
|
|
41
|
+
Adds database migrations to setup the new tables for manual check entries.
|
|
42
|
+
Adds a store to handle DB operations for exemptions.
|
|
43
|
+
Adds a service to handle interrogation of the DB via the store.
|
|
44
|
+
Modifies the FactCheckerService to not execute checks for which there are exemptions.
|
|
45
|
+
Updates the possible set of result states to include the 'exempt' state.
|
|
46
|
+
- Updated Software Catalog Fact Collector to be configurable (schedule, filters and caching).
|
|
47
|
+
- Updated dependencies
|
|
48
|
+
- @spotify/backstage-plugin-core@0.8.6
|
|
49
|
+
- @spotify/backstage-plugin-soundcheck-common@0.16.0
|
|
50
|
+
|
|
3
51
|
## 0.15.0
|
|
4
52
|
|
|
5
53
|
### Minor Changes
|
package/dist/alpha.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import * as _backstage_catalog_model_index from '@backstage/catalog-model/index';
|
|
3
3
|
import * as react from 'react';
|
|
4
|
-
import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api';
|
|
5
4
|
import * as _backstage_core_plugin_api_index from '@backstage/core-plugin-api/index';
|
|
5
|
+
import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* @public
|
|
@@ -15,10 +15,10 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{}, {}, {
|
|
|
15
15
|
name: undefined;
|
|
16
16
|
config: {};
|
|
17
17
|
configInput: {};
|
|
18
|
-
output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<
|
|
18
|
+
output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<_backstage_frontend_plugin_api.AnyApiFactory, "core.api.factory", {}>;
|
|
19
19
|
inputs: {};
|
|
20
20
|
params: {
|
|
21
|
-
factory:
|
|
21
|
+
factory: _backstage_frontend_plugin_api.AnyApiFactory;
|
|
22
22
|
};
|
|
23
23
|
}>;
|
|
24
24
|
"nav-item:soundcheck": _backstage_frontend_plugin_api.ExtensionDefinition<{
|
package/dist/api.esm.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createApiRef as c}from"@backstage/core-plugin-api";import{GraphQLClient as h}from"graphql-request";import{getSdk as u}from"./graphql/generated/index.esm.js";const
|
|
1
|
+
import{createApiRef as c}from"@backstage/core-plugin-api";import{GraphQLClient as h}from"graphql-request";import{getSdk as u}from"./graphql/generated/index.esm.js";const y=c({id:"plugin.soundcheck"}),o=s=>"response"in s&&"errors"in s.response,g=s=>"response"in s&&"message"in s.response;class l{#a;#s;#t;constructor(t){this.#a=t.fetchApi,this.#s=t.discoveryApi;const e=new h("/graphql",{fetch:async(a,n)=>{const r=`${await this.#s.getBaseUrl("soundcheck")}${a}`;return this.#a.fetch(r,n)}});this.#t=u(e)}#n=t=>o(t)?t.response?.errors?.[0].message??`${t}`:g(t)?t.response.message:`${t}`;#e=async t=>{try{return await t()}catch(e){throw new Error(`Error from Soundcheck backend: ${this.#n(e)}`)}};async getAllCertifications(t){return this.#e(async()=>{const{certifications:e}=await this.#t.getAllCertifications({entityRef:t});return e})}async getCertificationDetails(t){return this.#e(async()=>{const{certifications:e}=await this.#t.getCertificationDetails({entityRef:t});return e})}async getCertificationDetailsForTrack(t,e){return this.#e(async()=>{const{trackCertification:a}=await this.#t.getCertificationDetailsForTrack({entityRef:t,trackId:e});return a})}async getCheckResultDetails(t,e,a){return this.#e(async()=>{const{checkResult:n}=await this.#t.getCheckResultDetails({entityRef:t,trackId:e,checkId:a});return n})}async getFacetsForOwner(t){return this.#e(async()=>{const{facetsForOwner:e}=await this.#t.getFacetsForOwner({ownerEntityRef:t});return e})}async getTrackOverviewForOwner(t,e,a,n,r){return this.#e(async()=>{const{trackOverviewForOwner:i}=await this.#t.getTrackOverviewForOwner({ownerEntityRef:t,facet:e,first:a,after:n,entitySearch:r});return i})}async getTracks(t){return this.#e(async()=>{const{tracks:e}=await this.#t.getTracks({filter: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 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 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 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 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){return this.#e(async()=>{const{campaigns:e}=await this.#t.getCampaigns({filter:t});return e})}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 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 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 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 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})}}export{l as SoundcheckApi,y as soundcheckApiRef};
|
|
2
2
|
//# sourceMappingURL=api.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Content as
|
|
1
|
+
import{Content as E}from"@backstage/core-components";import e from"react";import{FormProvider as k}from"react-hook-form";import"../../contexts/TrackFormContext.esm.js";import"../../contexts/CheckFormContext.esm.js";import{useCampaignFormContext as y}from"../../contexts/CampaignFormContext.esm.js";import"../../contexts/UserProvider.esm.js";import L from"../../hooks/useFeatureFlag.esm.js";import{formStyles as x}from"../../utils/formStyles.esm.js";import{FormFilterSection as M}from"../FormFilterSection/FormFilterSection.esm.js";import{FormStepper as N}from"../FormStepper/FormStepper.esm.js";import{useCampaignForm as V}from"./hooks/useCampaignForm.esm.js";import{CampaignDetailsStep as v}from"./Steps/CampaignDetailsStep/CampaignDetailsStep.esm.js";import{CampaignTrackStep as A}from"./Steps/CampaignTrackStep.esm.js";import{CampaignMilestonesStep as D}from"./Steps/CampaignMilestonesStep.esm.js";import{StepNameMapping as O}from"./types/CampaignFormTypes.esm.js";import{CAMPAIGN_FIELDS as I}from"./utils/campaignFormUtils.esm.js";var c=(t=>(t.Details="Enter campaign details",t.Checks="Add checks",t.Entities="Choose the affected entities (Optional)",t.Milestones="Set campaign milestones",t))(c||{});const K=({onSave:t,onCancel:d,selectedCampaign:a})=>{const f=x(),{isLoading:r,isReadOnly:g}=y(),{formMethods:n,onSubmit:m,checkChips:S,checksLoading:u}=V(t,a),{getValues:C,control:i,formState:{errors:o},handleSubmit:l,trigger:h}=n,s=C(),F=s.detailsStep.startDate;L("debugMode")&&console.log(s);const p=[{label:"Enter campaign details",content:()=>e.createElement(v,{control:i,isLoading:r,disabled:!1,errors:o.detailsStep,startDate:F})},{label:"Add checks",content:()=>e.createElement(A,{control:i,isLoading:r||u,disabled:!1,errors:o.tracksStep,checkChips:S})},{label:"Choose the affected entities (Optional)",content:()=>e.createElement(M,{name:"filtersStep.filter",keyValueFilterName:"filtersStep.keyValueFilter",description:I.filter.description,excludeFilterName:"filtersStep.excludeFilter",excludeKeyValueFilterName:"filtersStep.excludeKeyValueFilter"})},{label:"Set campaign milestones",content:()=>e.createElement(D,{control:i,isLoading:r,disabled:!1,errors:o.milestonesStep})}],b=a?[...Array(p.length).keys()]:[0];return e.createElement(e.Fragment,null,e.createElement(E,{className:f.formWrapper},e.createElement(k,{...n},e.createElement("form",{onSubmit:l(m)},e.createElement(N,{onClose:d,handleSubmit:l,trigger:h,onSubmit:m,initialVisited:b,stepNameMap:O,steps:p,isLoading:r,isReadOnly:g,saveButtonText:"Save Campaign"})))))};export{K as CampaignForm,c as CampaignStepLabel};
|
|
2
2
|
//# sourceMappingURL=CampaignForm.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{zodResolver as
|
|
1
|
+
import{zodResolver as c}from"@hookform/resolvers/zod";import{useMemo as u}from"react";import{useForm as f}from"react-hook-form";import"@backstage/catalog-model";import"@backstage/core-plugin-api";import"@tanstack/react-query";import"../../../api.esm.js";import"../../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"@spotify/backstage-plugin-soundcheck-common";import"../../../hooks/useSoundcheckAlert.esm.js";import{useConfirmationModal as h}from"../../../hooks/useConfirmationModal.esm.js";import"react-router-dom";import{useGetChecksMap as g}from"../../../hooks/tracks/useGetChecksMap.esm.js";import{DEFAULT_FORM_VALUES as C}from"../utils/campaignFormUtils.esm.js";import{campaignFormSchema as d}from"../utils/validation.esm.js";import{mapCampaignToFormValues as l,mapCampaignFormDataToCampaignInput as F}from"./utils.esm.js";const M=(r,o)=>{const a=u(()=>o?l(o):C,[o]),e=f({defaultValues:a,mode:"onChange",resolver:c(d)}),{showModal:t}=h(),{checksMap:i,checkChips:p,checksLoading:s}=g();return{formMethods:e,onSubmit:async m=>{if(!await t({title:"Save Campaign",message:`Are you sure you want to save campaign: ${m.detailsStep.name}?`,error:!1}))return;const n=F(m,o,i);r(n)},checkChips:p,checksLoading:s}};export{M as useCampaignForm};
|
|
2
2
|
//# sourceMappingURL=useCampaignForm.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{v4 as
|
|
1
|
+
import{v4 as C}from"uuid";import{mapInputFilterToFormFilters as d,mapCatalogFilterToFormKeyValueFilters as u}from"../../Filter/utils.esm.js";import"../../Filter/FilterComponent.esm.js";import{mapTrackFormToInput as S}from"../../TrackForm/utils/useTrackForm.esm.js";const h=({name:l,ownerEntityRef:a,description:p,targetCompletionDate:o,supportChannel:i,milestones:s,startDate:r,track:t})=>({detailsStep:{name:l,description:p,ownerEntityRef:a,supportChannel:i,startDate:r,targetCompletionDate:o},tracksStep:{checks:t?.levels?.[0].checks.map(e=>({id:e.id,name:e.name??e.id,description:e.description}))},filtersStep:{filter:d(t.filter),keyValueFilter:u(t.filter),excludeFilter:d(t.exclude),excludeKeyValueFilter:u(t.exclude)},milestonesStep:{milestones:s.map(e=>({id:Number(e.id),name:e.name,description:e.description,passRate:e.targetPercent.toString()}))}}),D=(l,a,p)=>{const{tracksStep:{checks:o},detailsStep:{name:i,description:s,ownerEntityRef:r,supportChannel:t,startDate:e,targetCompletionDate:m},filtersStep:n,milestonesStep:{milestones:F}}=l,c=S({detailsStep:{name:`${i}`,description:`The checks for the ${i} campaign.`,ownerEntityRef:r},levelsStep:{levels:[{name:"Level 1",checks:o,description:""}]},filtersStep:{filter:n.filter,keyValueFilter:n.keyValueFilter,excludeFilter:n.excludeFilter,excludeKeyValueFilter:n.excludeKeyValueFilter}},p??{},a?.track);return{id:a?.id??C(),track:{...c,type:"campaign"},name:i,description:s,ownerEntityRef:r,supportChannel:t,startDate:e,targetCompletionDate:m,milestones:F.map(({id:f,name:k,description:g,passRate:y})=>({id:f,trackId:c.id,name:k,description:g,targetPercent:parseInt(y,10),targetCompletionDate:m}))}};export{D as mapCampaignFormDataToCampaignInput,h as mapCampaignToFormValues};
|
|
2
2
|
//# sourceMappingURL=utils.esm.js.map
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{emptyFilters as e,emptyKeyValueFilters as t}from"../../Filter/types.esm.js";import{CAMPAIGN_NAME_MAX_LENGTH as a,MILESTONE_NAME_MAX_LENGTH as i}from"./validation.esm.js";const n={detailsStep:{name:"",description:"",ownerEntityRef:"",supportChannel:"",startDate:null,targetCompletionDate:null},tracksStep:{checks:[]},filtersStep:{filter:e(),keyValueFilter:t(),excludeFilter:e(),excludeKeyValueFilter:t()},milestonesStep:{milestones:[{name:"",description:"",passRate:"0"}]}},l={details:{name:{name:"Campaign name",helperText:`Max ${a} characters`,placeholder:"Example: Check for latest version of javascript and Readme files"},description:{name:"Campaign description",placeholder:"Example: Check for the latest versions of JavaScript and README files to meet this quarter's quality standards."},owner:{name:"Campaign owner",description:"Add a team as the owner of this Campaign."},support:{name:"Support channel (Optional)",description:"Set up a Slack channel for notifications.",placeholder:"Channel name"},startingDate:{name:"Starting date",placeholder:"Starting date"},endingDate:{name:"Ending date",placeholder:"Ending date"}},milestones:{name:{name:"Milestone name",helperText:`Max ${i} characters`,placeholder:"Example: 80% pass rate"},description:{name:"Milestone description",description:"Provide a detailed description of this milestone, outlining its objectives.",placeholder:"Example: The track in my campaign expects a pass rate of 80% or above"},passrate:{name:"Milestone pass rate",description:"Enter the pass rate that your tracks have to meet.",placeholder:"Example: 80%"}},filter:{description:`Use the filters below to narrow the scope of the Campaign. Only Entities that match the selected include and exclude filters will be monitored. Exclude filters must be used with with an include filter.
|
|
2
|
+
For example, selecting an include filter of 'Kind' as 'Component' and an exclude filter of 'Type' as 'Service' will select all entities with kind Component where type is NOT Service.`}};export{l as CAMPAIGN_FIELDS,n as DEFAULT_FORM_VALUES};
|
|
2
3
|
//# sourceMappingURL=campaignFormUtils.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{TrackCheckSchema as o,CampaignDetailsSchema as S}from"@spotify/backstage-plugin-soundcheck-common";import{z as t}from"zod";import{CHECK_IS_REQUIRED_MSG as p,FIELD_IS_REQUIRED_MSG as a,
|
|
1
|
+
import{TrackCheckSchema as o,CampaignDetailsSchema as S}from"@spotify/backstage-plugin-soundcheck-common";import{z as t}from"zod";import{CHECK_IS_REQUIRED_MSG as p,FIELD_IS_REQUIRED_MSG as a,formFiltersSchema as E}from"../../../utils/validation.esm.js";const r=0,i=100,_=100,s=100,c="Ending date must come after the Starting Date",l=t.strictObject({checks:t.array(o.extend({key:t.string().optional()})).min(1,p)}),g=t.strictObject({id:t.number().optional(),name:t.string().min(1,a).max(s,`Input must be less than ${s} characters`),description:t.string().min(1,a),passRate:t.coerce.number().min(r,`Minimum pass rate is ${r}%`).max(i,`Maximum pass rate is ${i}%`)}),D=t.strictObject({milestones:t.array(g).min(1,a)}),m=t.coerce.string().nullable().refine(e=>e!==null,{message:a}),M=t.strictObject({startDate:m,targetCompletionDate:m}),A=({startDate:e,targetCompletionDate:n})=>e&&n?new Date(e)<new Date(n):!0,T=S.merge(M),h=e=>e.refine(A,{message:c,path:["targetCompletionDate"]}),I=t.strictObject({detailsStep:h(T),tracksStep:l,filtersStep:E,milestonesStep:D});export{_ as CAMPAIGN_NAME_MAX_LENGTH,c as END_AFTER_START_DATE_MSG,i as MILESTONE_MAX_PASS_RATE,r as MILESTONE_MIN_PASS_RATE,s as MILESTONE_NAME_MAX_LENGTH,m as campaignDateTimeSchema,I as campaignFormSchema};
|
|
2
2
|
//# sourceMappingURL=validation.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{useEntity as
|
|
1
|
+
import{useEntity as f}from"@backstage/plugin-catalog-react";import{styled as o,Accordion as g,AccordionSummary as E,AccordionDetails as b,makeStyles as k,Box as y}from"@material-ui/core";import R from"@material-ui/icons/ExpandMore";import e,{useRef as h}from"react";import"@backstage/catalog-model";import"@backstage/core-plugin-api";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import{useCertificationDetailsForTrack as x}from"../../hooks/certifications/useCertificationDetailsForTrack.esm.js";import"@spotify/backstage-plugin-soundcheck-common";import"../../hooks/useSoundcheckAlert.esm.js";import"../../hooks/useConfirmationModal.esm.js";import"react-router-dom";import{AlertPanel as v}from"../AlertPanel/AlertPanel.esm.js";import"../CertificationSidebar/CertificationSidebar.esm.js";import{CertificationSummary as I}from"../CertificationSidebar/CertificationSummary.esm.js";import{CertificationSidebarSkeleton as T}from"../CertificationSidebar/skeletons/CertificationSidebarSkeleton.esm.js";import"@material-ui/lab";import{CertificationLevel as C}from"../CertificationSidebar/CertificationLevel.esm.js";const L=o(g)(({theme:t})=>({margin:"0",border:`1px solid ${t.palette.divider}`,borderRadius:0,"&.Mui-expanded":{borderRadius:0},"&:first-child":{borderTopLeftRadius:0,borderTopRightRadius:0},"&:last-child":{borderBottomLeftRadius:0,borderBottomRightRadius:0},"&:not(:first-child)":{borderTop:`1px solid ${t.palette.divider}`},"&:not(:last-child)":{marginBottom:t.spacing(1)}})),S=o(({...t})=>e.createElement(E,{classes:{content:"content",expanded:"expanded"},...t}))(({theme:t})=>({borderRadius:0,paddingTop:0,paddingLeft:0,paddingRight:t.spacing(1),"& > .content":{margin:"0 !important",padding:"0 !important"},"& > .content.expanded":{margin:"0 !important",padding:"0 !important"}})),A=o(b)(()=>({margin:"0 !important",borderRadius:0,padding:0})),n=k(()=>({sidebar:{width:"100%"}})),B=({playlistId:t,trackId:i,checkId:d})=>{const m=n(),{entity:c}=f(),l=h(null),{data:r,isLoading:p,isError:s}=x(c,i);if(s)return e.createElement("div",null,e.createElement(y,{padding:2},e.createElement(v,{severity:"error",title:"Error loading certification"})));if(p||!i)return e.createElement(T,null);if(!r)return null;const u=r.track.type==="campaign";return e.createElement(L,{ref:l,defaultExpanded:!0,elevation:0},e.createElement(S,{expandIcon:e.createElement(R,null),"aria-controls":"certification-content",id:"certification-summary"},e.createElement(I,{name:r.track.name,badge:r.track.badge,description:r.track.description,documentationUrl:r.track.documentationURL,trackType:r.track.type})),e.createElement(A,null,e.createElement("div",{className:m.sidebar},r?.levels.map(a=>e.createElement(C,{key:a.ordinal,level:a,checkId:d,trackId:i,playlistId:t,isCampaign:u})))))};export{B as CertificationAccordion,n as useStyles};
|
|
2
2
|
//# sourceMappingURL=CertificationAccordion.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{useEntity as
|
|
1
|
+
import{useEntity as p}from"@backstage/plugin-catalog-react";import{makeStyles as d,Box as s}from"@material-ui/core";import e from"react";import"@backstage/catalog-model";import"@backstage/core-plugin-api";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import{useCertificationDetailsForTrack as f}from"../../hooks/certifications/useCertificationDetailsForTrack.esm.js";import"@spotify/backstage-plugin-soundcheck-common";import"../../hooks/useSoundcheckAlert.esm.js";import"../../hooks/useConfirmationModal.esm.js";import"react-router-dom";import{AlertPanel as k}from"../AlertPanel/AlertPanel.esm.js";import{CertificationLevel as u}from"./CertificationLevel.esm.js";import{CertificationSummary as y}from"./CertificationSummary.esm.js";import{CertificationSidebarSkeleton as E}from"./skeletons/CertificationSidebarSkeleton.esm.js";import"@material-ui/lab";const g=d(()=>({checks:{padding:0,margin:0,flex:1,listStyle:"none"}})),S=({playlistId:o,trackId:r,checkId:a})=>{const{entity:n}=p(),{data:t,isLoading:m,isError:c}=f(n,r);if(c)return e.createElement("div",null,e.createElement(s,{padding:2},e.createElement(k,{severity:"error",title:"Error loading certification"})));if(m||!r)return e.createElement(E,null);if(!t)return null;const l=t.track.type==="campaign";return e.createElement("div",null,e.createElement(y,{name:t.track.name,badge:t.track.badge,description:t.track.description,documentationUrl:t.track.documentationURL,trackType:t.track.type}),t?.levels.map(i=>e.createElement(u,{key:i.ordinal,level:i,checkId:a,trackId:r,playlistId:o,isCampaign:l})))};export{S as CertificationSidebar,g as useStyles};
|
|
2
2
|
//# sourceMappingURL=CertificationSidebar.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{stringifyEntityRef as h}from"@backstage/catalog-model";import{useEntity as b}from"@backstage/plugin-catalog-react";import{makeStyles as v,Typography as I,Tooltip as N,IconButton as x,CircularProgress as T}from"@material-ui/core";import z from"@material-ui/icons/Refresh";import S from"classnames";import e,{useState as
|
|
1
|
+
import{stringifyEntityRef as h}from"@backstage/catalog-model";import{useEntity as b}from"@backstage/plugin-catalog-react";import{makeStyles as v,Typography as I,Tooltip as N,IconButton as x,CircularProgress as T}from"@material-ui/core";import z from"@material-ui/icons/Refresh";import S from"classnames";import e,{useState as D,useMemo as F}from"react";import{Link as L}from"react-router-dom";import"@backstage/core-plugin-api";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import"@spotify/backstage-plugin-soundcheck-common";import{useGetChecks as w}from"../../hooks/checks/useGetChecks.esm.js";import"../../hooks/useSoundcheckAlert.esm.js";import"../../hooks/useConfirmationModal.esm.js";import{useExecuteCheck as A}from"../../hooks/checks/useExecuteCheck.esm.js";import"../CheckDryRun/CheckDryRun.esm.js";import"../SoundcheckDialog/SoundcheckDialog.esm.js";import{CheckDryRunDialogButton as B}from"../CheckDryRun/CheckDryRunDialogButton.esm.js";import"../CheckDryRun/CheckDryRunDetails.esm.js";import"../CheckDryRun/CheckDryRunContext.esm.js";import{mapCheckToCheckInput as G}from"../CheckDryRun/checkDryRunUtils.esm.js";import{CheckIcon as H}from"../CheckIcon/CheckIcon.esm.js";import{RelativeTime as M}from"../RelativeTime/RelativeTime.esm.js";const d=v(t=>({root:{display:"grid",width:"100%",gridTemplateColumns:"auto 1fr auto auto auto",gridColumnGap:t.spacing(.5),padding:t.spacing(1),alignItems:"center","&.selected":{backgroundColor:t.palette.action.hover},"&:hover, &:active, &:focus":{backgroundColor:t.palette.action.hover}},checkIcon:{height:20}})),P=({className:t,href:a,name:r,children:c})=>a?e.createElement(L,{"aria-label":`select check ${r}`,to:a,className:t},c):e.createElement("div",{className:t},c),$=({result:t,name:a,id:r,timestamp:c,isExecutable:f=!1,selected:k=!1,href:g})=>{const n=d(),E=S(n.root,{selected:k}),{entity:m}=b(),{mutateAsync:y,isLoading:l}=A(),[o,C]=D(),{data:s}=w({ids:r?[r]:[]},!!o),u=F(()=>{const i=s?.edges?.[0]?.node;return i?G(i):null},[s?.edges]),R=async()=>{if(!m||!r)return;const i=await y({checkerId:r,entityRef:h(m),shouldRefreshFacts:!0}).catch(j=>{});i&&C(i)},p=!m||!r||!f;return e.createElement(P,{href:g,className:E,name:a},e.createElement(H,{className:n.checkIcon,result:t}),e.createElement(I,{variant:"body2"},a),c&&!l?e.createElement(M,{timestamp:c}):null,!l&&e.createElement(e.Fragment,null,e.createElement(N,{title:"Execute Check",disableHoverListener:p},e.createElement("span",null,e.createElement(x,{size:"small",color:"inherit",onClick:R,disabled:p,"aria-label":"Execute Check"},e.createElement(z,{fontSize:"small"})))),!!o&&!!u&&e.createElement(B,{entityRef:h(m),check:u,checkResult:{checkResult:o.result,details:o.details??""},facts:o.facts,ruleResults:o.ruleResults,size:"small"})),l&&e.createElement(T,{color:"inherit",size:"1em"}))};export{$ as Check,d as useStyles};
|
|
2
2
|
//# sourceMappingURL=Check.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{useEntity as c}from"@backstage/plugin-catalog-react";import{makeStyles as l,Tab as d}from"@material-ui/core";import t from"react";import{Link as
|
|
1
|
+
import{useEntity as c}from"@backstage/plugin-catalog-react";import{makeStyles as l,Tab as d}from"@material-ui/core";import t from"react";import{Link as f}from"react-router-dom";import"@backstage/catalog-model";import"@backstage/core-plugin-api";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import{useCertificationDetailsForTrack as g}from"../../hooks/certifications/useCertificationDetailsForTrack.esm.js";import"@spotify/backstage-plugin-soundcheck-common";import"../../hooks/useSoundcheckAlert.esm.js";import"../../hooks/useConfirmationModal.esm.js";import{CertificationBadge as b}from"../Badges/CertificationBadge.esm.js";const a=l(e=>({root:{maxWidth:"80ch",textTransform:"uppercase",paddingTop:e.spacing(2),paddingBottom:e.spacing(2)},wrapper:{display:"inline-block",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},badge:{marginRight:e.spacing(1)}})),u=({id:e,name:i,badge:o,href:p,selected:m=!1})=>{const r=a(),{entity:n}=c(),{data:s}=g(n,e);return t.createElement(d,{className:r.root,classes:{wrapper:r.wrapper},value:e,label:t.createElement(t.Fragment,null,t.createElement(b,{badge:o,trackType:s?.track.type,className:r.badge}),i),component:f,to:p,selected:m})};export{u as CertificationTab,a as useStyles};
|
|
2
2
|
//# sourceMappingURL=CertificationTab.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{useRouteRef as
|
|
1
|
+
import{useRouteRef as f}from"@backstage/core-plugin-api";import{useEntity as y}from"@backstage/plugin-catalog-react";import{Tabs as b}from"@material-ui/core";import n from"react";import{useAllCertifications as k}from"../../hooks/certifications/useAllCertifications.esm.js";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import"@backstage/catalog-model";import"@spotify/backstage-plugin-soundcheck-common";import"../../hooks/useSoundcheckAlert.esm.js";import"../../hooks/useConfirmationModal.esm.js";import"react-router-dom";import{usePlaylists as C}from"../../hooks/playlists/usePlaylists.esm.js";import{certificationPlaylistRouteRef as R,certificationTrackRouteRef as g}from"../../routes.esm.js";import{CertificationTab as I}from"./CertificationTab.esm.js";import{PlaylistCertificationTab as T}from"./PlaylistCertificationTab.esm.js";import{CertificationTabsSkeleton as E}from"./skeletons/CertificationTabsSkeleton.esm.js";function h(m=[],e=[],a,l){if(a){const r=m.findIndex(o=>o.id===a);return r<0?!1:r}const i=e.findIndex(r=>r.track.id===l);return i<0?!1:i+m.length}const x=({playlistId:m,trackId:e})=>{const{entity:a}=y(),{isLoading:l,data:i}=k(a),{isLoading:r,data:o}=C(a),p=f(R),s=f(g);if(r||l||!e)return n.createElement(E,null);const d=h(o,i,m,e);return n.createElement(b,{value:d,indicatorColor:"primary","aria-label":"Certifications",variant:"scrollable"},o?.length&&o.map(({id:t,name:c})=>n.createElement(T,{key:t,id:t,name:c,selected:t===e,href:p({playlistId:t})})),i&&i.filter(({track:{type:t}})=>t!=="playlist").map(({track:{id:t,name:c,badge:u}})=>n.createElement(I,{key:t,id:t,name:c,badge:u,selected:t===e,href:s({trackId:t})})))};export{x as CertificationTabs};
|
|
2
2
|
//# sourceMappingURL=CertificationTabs.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{LinearGauge as
|
|
1
|
+
import{LinearGauge as p}from"@backstage/core-components";import{makeStyles as f,useTheme as u,Typography as g}from"@material-ui/core";import i from"lodash";import t,{useMemo as k}from"react";import{ResultState as c}from"../../../graphql/generated/index.esm.js";import{LevelBadge as y}from"../../Badges/LevelBadge.esm.js";import{NoLevelBadge as x}from"../../Badges/NoLevelBadge.esm.js";import"../../Badges/CampaignBadge.esm.js";import{usePlaylistCertificationContext as h}from"./PlaylistContext.esm.js";const v=(s,a)=>{if(a)return a.filter(e=>s.trackIds.includes(e.track.id)).map(e=>{const o=i.sumBy(e.levels,l=>i.filter(l.checks,{result:c.Passed}).length),m=i.sumBy(e.levels,l=>i.reject(l.checks,{result:c.NotApplicable||c.Exempt}).length),r=m===0?0:o/m;return{id:e.track.id,name:e.track.name,checkPassRate:r}})},n=f(()=>({root:{margin:0,width:"250px"},trackItem:{display:"flex",flexDirection:"column",alignItems:"flex-start"},badgeAndName:{display:"flex",flexDirection:"row",alignItems:"center"},trackName:{marginLeft:"8px"}})),N=({playlist:s})=>{const a=n(),{data:e}=h(),o=u(),m=k(()=>v(s,e),[e,s]);return t.createElement("div",{className:a.root},m&&m.map(r=>{const l=e?.find(d=>d.track.id===r.id)?.track?.badge;return t.createElement("div",{className:a.trackItem,key:r.id},t.createElement("div",{className:a.badgeAndName},l?t.createElement(y,{badge:l}):t.createElement(x,null),t.createElement(g,{variant:"caption",color:"textSecondary",className:a.trackName},r.name)),t.createElement("div",{style:{width:"100%",marginBottom:"8px"}},t.createElement(p,{value:r.checkPassRate,getColor:()=>o.palette.status.ok})))}))};export{N as PlaylistProgress,n as useStyles};
|
|
2
2
|
//# sourceMappingURL=PlaylistProgress.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{makeStyles as w,useTheme as v,Box as
|
|
1
|
+
import{makeStyles as w,useTheme as v,Box as n,Paper as k,Typography as b,Tooltip as D}from"@material-ui/core";import u from"@material-ui/lab/Skeleton";import{DateTime as R}from"luxon";import t from"react";import{CircularProgressbar as $,buildStyles as B}from"react-circular-progressbar";import{getChartFontColor as x,formatDate as P}from"../Charts/chartUtils.esm.js";import{getApplicableCheckCount as d}from"../TrackPage/TrackEntitiesTable/utils.esm.js";import{getProgressColor as g}from"../TrackPage/utils.esm.js";import{CheckHistoryChart as T}from"./CheckHistoryChart.esm.js";import{getCheckName as W}from"./utils.esm.js";const y=w(e=>({card:{display:"flex",flexDirection:"column",border:`1px solid ${e.palette.divider}`,width:"99%"},title:{fontWeight:"bold",fontSize:"0.9rem",cursor:"default",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},headerRow:{display:"flex",padding:e.spacing(1.5,2),borderBottom:`1px solid ${e.palette.divider}`,width:"100%"},headerSection:{display:"flex",flexDirection:"column",gap:e.spacing(.5),flexGrow:1,width:"100%"},contentRow:{padding:e.spacing(1.5,2,.5),display:"flex"},leftSection:{width:"75px",minWidth:"75px"},summaryCard:{height:"100%",display:"flex",flexDirection:"column",justifyContent:"space-between"},chartSection:{flex:1,width:"100%",minWidth:"150px"},chartSkeletonSection:{flex:1,width:"100%",minWidth:"150px",padding:e.spacing(0,0,1,1)},overallSummaryBox:{display:"flex",flexDirection:"column",height:"100%",color:x(e),textAlign:"center",gap:e.spacing(2)}})),z=()=>{const e=y();return t.createElement(n,{className:e.contentRow},t.createElement(n,{className:e.leftSection},t.createElement(n,{className:e.summaryCard},t.createElement(u,{variant:"circle",height:75}))),t.createElement(n,{className:e.chartSkeletonSection},t.createElement(u,{variant:"rect",height:92})))};function A(e){if(!e)return[];const{history:i}=e,a=R.utc();return i.map((r,o)=>{const l=d(r);return{name:P(a,i.length-o-1),passRate:l?Math.round(r.passed/l*100):0}})}function M(e){if(!e)return 0;const{passed:i,exempt:a}=e,r=d(e);return r?Math.round((i+a)/r*100):0}function j(e){if(!e)return{numerator:0,denominator:0};const{passed:i,exempt:a}=e,r=d(e);return{numerator:i+a,denominator:r}}const F=({check:e,track:i,status:a,history:r})=>{const o=y(),l=v(),E={dataKey:"passRate",name:"Pass rate"},C=r?.history?.length??0,S=A(r),c=M(a);let m;a?m=`${c}%`:m="No Data";let p=!1,s;if(!a)s="No Data";else{const{numerator:N,denominator:f}=j(a);f>0?(p=!0,s=`${N} of ${f} entities passing`):s="No Applicable Entities"}const h=p?t.createElement(n,{className:o.overallSummaryBox},t.createElement($,{value:c,text:m,styles:B({textColor:x(l),pathColor:g(l,c),trailColor:l.palette.divider,textSize:C?void 0:10})})):null;return t.createElement(k,{className:o.card,elevation:0},t.createElement(n,{className:o.headerRow},t.createElement(n,{className:o.headerSection},t.createElement(b,{className:o.title},W(i,e)))),!a||!r?t.createElement(z,null):t.createElement(D,{title:s},t.createElement(n,{className:o.contentRow},h&&t.createElement(n,{className:o.leftSection},t.createElement(n,{className:o.summaryCard},h)),t.createElement(n,{className:o.chartSection},t.createElement(T,{data:p?S:[],lineConfig:E,color:g(l,c)})))))};export{F as CheckCard};
|
|
2
2
|
//# sourceMappingURL=CheckCard.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{MarkdownContent as E}from"@backstage/core-components";import{useEntity as y}from"@backstage/plugin-catalog-react";import{makeStyles as k,Box as v,Typography as m}from"@material-ui/core";import t from"react";import"@backstage/catalog-model";import"@backstage/core-plugin-api";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import"@spotify/backstage-plugin-soundcheck-common";import{useCheckDetails as S}from"../../hooks/checks/useCheckDetails.esm.js";import{useGetChecks as x}from"../../hooks/checks/useGetChecks.esm.js";import"../../hooks/useSoundcheckAlert.esm.js";import"../../hooks/useConfirmationModal.esm.js";import"react-router-dom";import{AlertPanel as C}from"../AlertPanel/AlertPanel.esm.js";import{RelativeTime as B}from"../RelativeTime/RelativeTime.esm.js";import{ResultStateBox as N}from"./ResultStateBox.esm.js";import{CheckDetailsSkeleton as z}from"./skeletons/CheckDetailsSkeleton.esm.js";const s=k(e=>({root:{padding:`${e.spacing(3)}px ${e.spacing(5)}px`},title:{fontWeight:"normal",fontSize:e.typography.h5.fontSize},description:{padding:`${e.spacing(3)}px 0`},subtitle:{fontWeight:"normal",fontSize:e.typography.h6.fontSize},topBar:{display:"flex",justifyContent:"space-between",marginBottom:e.spacing(2)}})),D=({programId:e,checkId:r})=>{const i=s(),{entity:p}=y(),{data:
|
|
1
|
+
import{MarkdownContent as E}from"@backstage/core-components";import{useEntity as y}from"@backstage/plugin-catalog-react";import{makeStyles as k,Box as v,Typography as m}from"@material-ui/core";import t from"react";import"@backstage/catalog-model";import"@backstage/core-plugin-api";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import"@spotify/backstage-plugin-soundcheck-common";import{useCheckDetails as S}from"../../hooks/checks/useCheckDetails.esm.js";import{useGetChecks as x}from"../../hooks/checks/useGetChecks.esm.js";import"../../hooks/useSoundcheckAlert.esm.js";import"../../hooks/useConfirmationModal.esm.js";import"react-router-dom";import{AlertPanel as C}from"../AlertPanel/AlertPanel.esm.js";import{RelativeTime as B}from"../RelativeTime/RelativeTime.esm.js";import{ResultStateBox as N}from"./ResultStateBox.esm.js";import{CheckDetailsSkeleton as z}from"./skeletons/CheckDetailsSkeleton.esm.js";const s=k(e=>({root:{padding:`${e.spacing(3)}px ${e.spacing(5)}px`},title:{fontWeight:"normal",fontSize:e.typography.h5.fontSize},description:{padding:`${e.spacing(3)}px 0`},subtitle:{fontWeight:"normal",fontSize:e.typography.h6.fontSize},topBar:{display:"flex",justifyContent:"space-between",marginBottom:e.spacing(2)}})),D=({programId:e,checkId:r})=>{const i=s(),{entity:p}=y(),{data:a,isLoading:l,isError:c}=S(p,e,r),{data:d}=x({ids:[r??""],first:1}),f=d?.edges?.[0]?.node;if(c)return t.createElement(v,{padding:2},t.createElement(C,{severity:"error",title:"Error loading check details"}));if(l||!e||!r)return t.createElement(z,null);if(!a)return null;const{name:o,description:u,result:g,timestamp:n,details:h}=a;return t.createElement("div",{className:i.root,"data-testid":"check-details-view"},t.createElement("div",{className:i.topBar},t.createElement(m,{variant:"h2",className:i.title},o),n?t.createElement(B,{timestamp:n,description:"Last updated"}):null),t.createElement(N,{name:o,state:g,details:h,templateRef:f?.templateRef??void 0}),t.createElement("div",{className:i.description,"data-testid":"soundcheck-check-details-description"},t.createElement(m,{variant:"h3",className:i.subtitle},"Description"),t.createElement(E,{content:u})))};export{D as CheckDetails,s as useStyles};
|
|
2
2
|
//# sourceMappingURL=CheckDetails.esm.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Box as t,Typography as r}from"@material-ui/core";import e from"react";import{RuleResultComponent as a}from"../RuleResult/RuleResultComponent.esm.js";import{FactTable as m}from"./FactTable.esm.js";const n=({ruleResult:l})=>e.createElement(e.Fragment,null,e.createElement(t,{mt:2},e.createElement(r,{variant:"h3"},"Rule Evaluation"),e.createElement(t,{p:2},e.createElement(a,{ruleResult:l}))),e.createElement(r,{variant:"h3"},"Resolved Values"),e.createElement(t,{p:2},e.createElement(m,{ruleResult:l})));export{n as CheckResultDetails};
|
|
2
|
+
//# sourceMappingURL=CheckResultDetails.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{TableRow as t,TableCell as n,IconButton as i,Collapse as c}from"@material-ui/core";import p from"@material-ui/icons/KeyboardArrowDown";import u from"@material-ui/icons/KeyboardArrowUp";import e,{useState as s}from"react";const d=({title:a,children:o,defaultOpen:
|
|
1
|
+
import{TableRow as t,TableCell as n,IconButton as i,Collapse as c}from"@material-ui/core";import p from"@material-ui/icons/KeyboardArrowDown";import u from"@material-ui/icons/KeyboardArrowUp";import e,{useState as s}from"react";const d=({title:a,children:o,defaultOpen:r=!0})=>{const[l,m]=s(r);return e.createElement(e.Fragment,null,e.createElement(t,null,e.createElement(n,{colSpan:2,padding:"normal",align:"left",size:"small"},e.createElement(i,{"aria-label":"expand row",size:"small",onClick:()=>m(!l)},l?e.createElement(u,null):e.createElement(p,null)),e.createElement("strong",null,a))),e.createElement(t,null,e.createElement(n,{style:{paddingBottom:0,paddingTop:0},colSpan:2,padding:"normal",align:"left",size:"small"},e.createElement(c,{in:l,timeout:"auto",unmountOnExit:!0},o))))};export{d as CollapseRow};
|
|
2
2
|
//# sourceMappingURL=CollapseRow.esm.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{MarkdownContent as i}from"@backstage/core-components";import{useTheme as a,Divider as p,Typography as s}from"@material-ui/core";import{ExemptionDetailsSchema as c}from"@spotify/backstage-plugin-soundcheck-common";import{DateTime as l}from"luxon";import e from"react";import{EntityChip as d}from"../EntityChip/EntityChip.esm.js";const f=({exemption:m})=>{const o=a(),r=c.safeParse(m);if(!r.success)return null;const t=r.data,n=l.fromISO(t.timestamp).toFormat("MM/dd/yyyy");return e.createElement("div",null,e.createElement(i,{content:t.reason}),e.createElement(p,null),e.createElement("div",{style:{paddingTop:o.spacing(1)}},e.createElement(s,{variant:"caption"},e.createElement(d,{entityOrRef:t.submittedBy}),"submitted exemption on ",n,".")))};export{f as ExemptionDetails};
|
|
2
|
+
//# sourceMappingURL=ExemptionDetails.esm.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{TableContainer as s,Paper as d,Table as f,TableBody as E,TableRow as r,TableCell as n,IconButton as b,Collapse as g,Box as w}from"@material-ui/core";import{makeStyles as T}from"@material-ui/core/styles";import v from"@material-ui/icons/KeyboardArrowDown";import C from"@material-ui/icons/KeyboardArrowUp";import{groupBy as R}from"lodash";import e,{useMemo as k}from"react";import{findUniqueFacts as B}from"./findUniqueFacts.esm.js";import{ResolvedValueTable as x}from"./ResolvedValueTable.esm.js";const y=T(l=>({tableCell:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:200},selectedRow:{backgroundColor:l.palette.action.hover},factRow:{backgroundColor:l.palette.background.default}})),S=({ruleResult:l})=>{const m=y(),[a,c]=e.useState({}),i=k(()=>R(B(l),"factRef"),[l]),p=t=>{c(o=>({...o,[t]:o[t]!==void 0?!o[t]:!1}))};return e.createElement(s,{component:d},e.createElement(f,null,e.createElement(E,null,Object.entries(i).map(([t,o],u)=>e.createElement(e.Fragment,{key:u},e.createElement(r,{className:m.factRow},e.createElement(n,null,e.createElement(b,{size:"small",onClick:()=>p(t)},a[t]?e.createElement(C,null):e.createElement(v,null)),t)),e.createElement(r,null,e.createElement(n,{style:{paddingBottom:0,paddingTop:0},colSpan:4},e.createElement(g,{in:a[t]===void 0||a[t],timeout:"auto",unmountOnExit:!0},e.createElement(w,{margin:1},e.createElement(x,{values:o}))))))))))};export{S as FactTable};
|
|
2
|
+
//# sourceMappingURL=FactTable.esm.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Table as d,TableHead as f,TableRow as m,TableCell as a,TableBody as E,Tooltip as r,IconButton as s}from"@material-ui/core";import{makeStyles as b}from"@material-ui/core/styles";import i from"@material-ui/icons/FileCopy";import h from"copy-to-clipboard";import e from"react";import{useSelectedValue as v}from"./SelectedValueContext.esm.js";const C=b(o=>({tableCell:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:200},selectedRow:{backgroundColor:o.palette.action.hover}})),V=({values:o})=>{const t=C(),{selectedValue:n}=v(),c=l=>{h(l)};return e.createElement(d,{size:"small",padding:"none"},e.createElement(f,null,e.createElement(m,null,e.createElement(a,{className:t.tableCell},"Path"),e.createElement(a,{className:t.tableCell},"Value"))),e.createElement(E,null,o.map((l,p)=>{const u=l.factRef===n.factRef&&l.path===n.path;return e.createElement(m,{key:p,className:u?t.selectedRow:""},e.createElement(a,{className:t.tableCell},l.path&&e.createElement(e.Fragment,null,e.createElement(r,{title:"Copy path to clipboard"},e.createElement(s,{onClick:()=>c(l.path)},e.createElement(i,{fontSize:"small"}))),e.createElement(r,{title:l.path},e.createElement("span",null,l.path)))),e.createElement(a,{className:t.tableCell},e.createElement(r,{title:"Copy value to clipboard"},e.createElement(s,{onClick:()=>c(typeof l.resolvedValue=="string"?l.resolvedValue:JSON.stringify(l.resolvedValue))},e.createElement(i,{fontSize:"small"}))),typeof l.resolvedValue=="string"?l.resolvedValue:JSON.stringify(l.resolvedValue)))})))};export{V as ResolvedValueTable};
|
|
2
|
+
//# sourceMappingURL=ResolvedValueTable.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{MarkdownContent as
|
|
1
|
+
import{MarkdownContent as v}from"@backstage/core-components";import{useApi as R,configApiRef as N}from"@backstage/core-plugin-api";import{makeStyles as y,Paper as B,Typography as b,Box as S,Button as w}from"@material-ui/core";import{ToggleButtonGroup as A,ToggleButton as u}from"@material-ui/lab";import{NotesSchema as D}from"@spotify/backstage-plugin-soundcheck-common";import e,{useState as g}from"react";import{ResultState as t}from"../../graphql/generated/index.esm.js";import{CheckIcon as F}from"../CheckIcon/CheckIcon.esm.js";import{CheckResultDetails as I}from"./CheckResultDetails.esm.js";import{ExemptionDetails as P}from"./ExemptionDetails.esm.js";import{FixMeDialog as $}from"./FixMeDialog.esm.js";import{SelectedValueProvider as G}from"./SelectedValueContext.esm.js";const T=y(n=>({markdownContent:{"& :last-child":{marginBottom:0},"& pre":{background:`${n.palette.background.paper} !important`}},root:{padding:n.spacing(2),display:"flex",flexDirection:"column",gap:n.spacing(1.5)},header:{display:"flex",alignItems:"center",justifyContent:"space-between"},iconContainer:{display:"flex",alignItems:"center"},toggleButtonGroup:{marginLeft:"auto"},toggleButton:{padding:n.spacing(.5),fontSize:n.typography.pxToRem(12)},passed:{},failed:{},warning:{},notReported:{},notApplicable:{},exempt:{},error:{},icon:{}}),{name:"CheckResultStateBox"}),L={[t.Passed]:"Check passed",[t.Failed]:"Check did not pass",[t.Warning]:"Check produced warning(s)",[t.NotReported]:"Check not reported",[t.NotApplicable]:"Check not applicable",[t.Exempt]:"Exempt from check",[t.Error]:"Check encountered an error."},M={[t.Passed]:"passed",[t.Failed]:"failed",[t.Warning]:"warning",[t.NotReported]:"notReported",[t.NotApplicable]:"notApplicable",[t.Exempt]:"exempt",[t.Error]:"error"},O=({name:n,state:l,details:a,templateRef:m})=>{const o=T(),[f,r]=g(!1),[i,x]=g("notes"),E=R(N).getOptionalStringArray("soundcheck.flags")?.includes("enable-fix-me"),s=a&&a.ruleResult,h=()=>{r(!0)},k=()=>{r(!1)},C=(W,d)=>{d!==null&&x(d)},c=a?.notes?D.safeParse(a.notes):void 0,p=c?.success?c.data.data:void 0;return e.createElement(B,{variant:"outlined",className:`${o.root} ${o[M[l]]}`},e.createElement("div",{className:o.header},e.createElement("div",{className:o.iconContainer},e.createElement(F,{className:o.icon,result:l}),e.createElement(b,{variant:"subtitle1"},L[l])),s&&e.createElement(A,{value:i,exclusive:!0,onChange:C,className:o.toggleButtonGroup},e.createElement(u,{value:"notes",className:o.toggleButton},"Notes"),e.createElement(u,{value:"details",className:o.toggleButton},"Details"))),i==="notes"&&e.createElement("div",null,a&&a.exemption&&e.createElement(P,{exemption:a.exemption}),p&&e.createElement(v,{className:o.markdownContent,content:p}),E&&l===t.Failed&&m&&e.createElement(S,{display:"flex",flexDirection:"column",alignItems:"flex-end",mt:2,width:"100%"},e.createElement(w,{color:"primary",variant:"contained",onClick:h},"Fix"),e.createElement($,{title:`Fix ${n}`,open:f,setOpen:r,onClose:k,templateRef:m}))),i==="details"&&e.createElement("div",null,s&&e.createElement(G,null,e.createElement(I,{ruleResult:a.ruleResult}))))};export{O as ResultStateBox};
|
|
2
2
|
//# sourceMappingURL=ResultStateBox.esm.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import u,{createContext as o,useState as c,useContext as n}from"react";const t=o(void 0),a=({children:e})=>{const[r,l]=c({factRef:null,path:null});return u.createElement(t.Provider,{value:{selectedValue:r,setSelectedValue:l}},e)},d=()=>{const e=n(t);if(!e)throw new Error("useSelectedValue must be used within a SelectedProvider");return e};export{a as SelectedValueProvider,d as useSelectedValue};
|
|
2
|
+
//# sourceMappingURL=SelectedValueContext.esm.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{stringifyFactRef as i}from"@spotify/backstage-plugin-soundcheck-common";function l(e){const c=new Set,u=[];function r(n){if(s(n)){let{factRef:a,path:f}=n,t=`${a}-${f??""}`;c.has(t)||(c.add(t),u.push({factRef:i(a),path:f,resolvedValue:n.resolvedFactValue}));const o=n.value;typeof o=="object"&&"factRef"in o&&(a=i(o.factRef),f=o.path,t=`${a}-${f??""}`,c.has(t)||(c.add(t),u.push({factRef:a,path:f,resolvedValue:o.resolvedValue})))}else d(n)?n.all.forEach(r):h(n)?n.any.forEach(r):p(n)&&n.not.forEach(r)}return r(e),u}function s(e){return"factRef"in e&&"resolvedFactValue"in e}function d(e){return"all"in e}function h(e){return"any"in e}function p(e){return"not"in e}export{l as findUniqueFacts};
|
|
2
|
+
//# sourceMappingURL=findUniqueFacts.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{makeStyles as
|
|
1
|
+
import{makeStyles as b,Tooltip as h,Box as o,IconButton as C,CircularProgress as D}from"@material-ui/core";import x from"@material-ui/icons/Refresh";import e,{useState as l,useCallback as $}from"react";import{useExecuteCheck as w}from"../../hooks/checks/useExecuteCheck.esm.js";import{CheckIcon as z}from"../CheckIcon/CheckIcon.esm.js";import"../SoundcheckDialog/SoundcheckDialog.esm.js";import{CheckDryRunDialogButton as B}from"./CheckDryRunDialogButton.esm.js";import"./CheckDryRunDetails.esm.js";import"./CheckDryRunContext.esm.js";import"../CheckForm/utils/checkFormUtils.esm.js";const F=b(()=>({root:{display:"flex",alignItems:"center"},buttonWrapper:{height:24}})),I=({entityRef:n,check:s,refreshFact:c=!1})=>{const{mutateAsync:m}=w(),[r,p]=l(),[i,d]=l(null),[a,u]=l(!1),[k,E]=l(),[y,R]=l(),f=F(),g=$(async()=>{if(a)return;u(!0);const t=await m({entityRef:n,checker:s,dryRun:!0,shouldRefreshFacts:c}).catch(S=>{});t?.details&&d(t.details),t?.facts&&E(t.facts),t?.ruleResults&&R(t.ruleResults),p(t?.result),u(!1)},[s,n,m,a,c]);return e.createElement("div",{className:f.root},r&&e.createElement(h,{arrow:!0,title:`${r}${i?`: ${i}`:""}`,placement:"left"},e.createElement("span",{className:f.buttonWrapper,"aria-label":"check result"},e.createElement(z,{result:r}))),e.createElement(h,{arrow:!0,placement:"top",title:e.createElement(o,null,a?e.createElement(e.Fragment,null,e.createElement(o,null,"Executing dry run..."),e.createElement(o,null,c?"Refreshing facts for dry run can take a significant amount of time.":"Dry run can take additional time if facts are not cached.")):`Dry runs will ${c?"refresh facts":"use cached facts if available"}.`)},e.createElement("span",null,e.createElement(C,{size:"small",color:"inherit",onClick:g,disabled:a,"aria-label":"refresh"},a?e.createElement(D,{size:16}):e.createElement(x,{fontSize:"small"})))),r&&e.createElement(B,{entityRef:n,check:s,checkResult:{checkResult:r,details:i},facts:k,ruleResults:y}))};export{I as CheckDryRun};
|
|
2
2
|
//# sourceMappingURL=CheckDryRun.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import p,{createContext as C,useState as t,useCallback as y}from"react";import"./CheckDryRun.esm.js";import{CheckDryRunDialog as D}from"./CheckDryRunDialog.esm.js";import"@material-ui/core";import"./CheckDryRunDetails.esm.js";import"../CheckForm/utils/checkFormUtils.esm.js";const n=C({updateEntityRef:()=>{},updateCheck:()=>{},updateOpen:()=>{},updateResult:()=>{},setValues:()=>{},updateFacts:()=>{},updateRuleResults:()=>{},open:!1}),E=({children:o})=>{const[R,u]=t(!1),[
|
|
1
|
+
import p,{createContext as C,useState as t,useCallback as y}from"react";import"./CheckDryRun.esm.js";import{CheckDryRunDialog as D}from"./CheckDryRunDialog.esm.js";import"@material-ui/core";import"./CheckDryRunDetails.esm.js";import"../CheckForm/utils/checkFormUtils.esm.js";const n=C({updateEntityRef:()=>{},updateCheck:()=>{},updateOpen:()=>{},updateResult:()=>{},setValues:()=>{},updateFacts:()=>{},updateRuleResults:()=>{},open:!1}),E=({children:o})=>{const[R,u]=t(!1),[d,s]=t(""),[i,a]=t(),[h,c]=t(),[k,l]=t(),[f,r]=t(),m=y(e=>{u(!0),e.entityRef&&s(e.entityRef),e.check&&a(e.check),e.checkResult&&c(e.checkResult),e.facts&&l(e.facts),e.ruleResults&&r(e.ruleResults)},[]);return p.createElement(n.Provider,{value:{entityRef:d,updateEntityRef:s,check:i,updateCheck:a,open:R,updateOpen:u,result:h,updateResult:c,setValues:m,facts:k,updateFacts:l,ruleResults:f,updateRuleResults:r}},p.createElement(D,null),o)};export{n as CheckDryRunContext,E as CheckDryRunProvider};
|
|
2
2
|
//# sourceMappingURL=CheckDryRunContext.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{EntityRefLink as b}from"@backstage/plugin-catalog-react";import{makeStyles as S,Box as c,Typography as a,Divider as f,Grid as
|
|
1
|
+
import{EntityRefLink as b}from"@backstage/plugin-catalog-react";import{makeStyles as S,Box as c,Typography as a,Divider as f,Grid as o}from"@material-ui/core";import{parseFactRef as N,getRuleHash as k}from"@spotify/backstage-plugin-soundcheck-common";import e from"react";import{ResultState as R}from"../../graphql/generated/index.esm.js";import{ResultStateBox as B}from"../CheckDetails/ResultStateBox.esm.js";import{ExpressionTypeReadableMap as F,ExpressionType as T}from"../CheckForm/types/ExpressionType.esm.js";import"../Frequency/types.esm.js";import"../Frequency/util.esm.js";import"../Frequency/FrequencyComponent.esm.js";import"../CheckForm/types/Path.esm.js";import{mapRuleToExpression as P}from"../CheckForm/utils/checkFormUtils.esm.js";import{CheckIcon as w}from"../CheckIcon/CheckIcon.esm.js";import{ExpandableSection as z}from"../ExpandableSection/ExpandableSection.esm.js";import{FormattedPreview as x}from"../FormattedPreview/FormattedPreview.esm.js";const v=S(t=>({dryRunRoot:{padding:t.spacing(2)},dryRunSection:{marginBottom:t.spacing(2)},rulesSection:{padding:t.spacing(2),margin:0,width:"100%"},resultBox:{fontSize:t.typography.body1.fontSize},factBox:{padding:0,border:`1px solid ${t.palette.divider}`,overflow:"auto",fontSize:t.typography.body2.fontSize,maxHeight:500},nested:{margin:t.spacing(3)},expressionType:{padding:t.spacing(1,2)},expressionWrapper:{border:`1px solid ${t.palette.divider}`,marginBottom:t.spacing(2)},resultDisplay:{display:"flex",alignItems:"center"},resultIcon:{marginRight:t.spacing(.25)},ownerLink:{"& span":{"&:hover":{textDecoration:"underline"}},fontSize:t.typography.body1.fontSize},valueBox:{maxHeight:500,overflow:"auto"}})),D=({passed:t})=>{const n=v();return e.createElement(a,{variant:"body1",className:n.resultDisplay},e.createElement(w,{className:n.resultIcon,result:t?R.Passed:R.Failed})," ",t?"Passed":"Failed")},g=({check:t,expression:n,facts:s,ruleResults:m})=>{const l=v();return e.createElement(e.Fragment,null,e.createElement(c,{className:l.expressionWrapper},e.createElement(a,{className:l.expressionType,variant:"subtitle1"},F[n.expressionType??T.AllOf]),n.conditions?.map((r,i)=>{const p=r.operatorPrefix?`${r.operatorPrefix}:${r.operator}`:r.operator,d=N(r.factRef),y=s?.find(E=>E.factRef===r.factRef),h=k({factRef:d,value:r.value,operator:p,path:r.path}),u=m?.find(E=>E.name===h);return e.createElement("div",{key:`expression-${i}`},e.createElement(f,{variant:"middle"}),e.createElement(o,{container:!0,className:l.rulesSection,spacing:2},e.createElement(o,{item:!0,xs:6},e.createElement(a,{variant:"subtitle2",color:"textSecondary"},"Integration"),e.createElement(a,{variant:"body1"},d.source)),e.createElement(o,{item:!0,xs:6},e.createElement(a,{variant:"subtitle2",color:"textSecondary"},"Fact"),e.createElement(a,{variant:"body1"},d.name)),t?.pathResolver&&e.createElement(o,{item:!0,xs:6},e.createElement(a,{variant:"subtitle2",color:"textSecondary"},"Path Resolver"),e.createElement(a,{variant:"body1"},t.pathResolver)),e.createElement(o,{item:!0,xs:6},e.createElement(a,{variant:"subtitle2",color:"textSecondary"},"Path"),e.createElement(a,{variant:"body1"},r.path)),e.createElement(o,{item:!0,xs:6},e.createElement(a,{variant:"subtitle2",color:"textSecondary"},"Operator"),e.createElement(a,{variant:"body1"},p)),u?.result!==void 0&&e.createElement(o,{item:!0,xs:6},e.createElement(a,{variant:"subtitle2",color:"textSecondary"},"Result"),e.createElement(D,{passed:u.result})),e.createElement(o,{item:!0,xs:12},e.createElement(a,{variant:"subtitle2",color:"textSecondary"},"Expected"),e.createElement(a,{component:"div",variant:"body2",className:l.valueBox},e.createElement(x,{data:r?.value}))),e.createElement(o,{item:!0,xs:12},e.createElement(a,{variant:"subtitle2",color:"textSecondary"},"Resolved Value"),e.createElement(a,{component:"div",variant:"body2",className:l.valueBox},e.createElement(x,{data:u?.factResult}))),!!y&&e.createElement(o,{item:!0,xs:12},e.createElement(z,{elevation:0,title:"Related Fact"},e.createElement("div",{className:l.factBox},e.createElement(x,{data:y.data}))))))}),!!n?.expressions&&e.createElement(e.Fragment,null,e.createElement(f,{variant:"middle"}),e.createElement(c,{className:l.nested},n?.expressions?.map((r,i)=>e.createElement(g,{check:t,facts:s,ruleResults:m,expression:r,key:`nested-expression-${i}`}))))))},I=({entityRef:t,check:n,checkResult:s,details:m,facts:l,ruleResults:r})=>{const i=v(),p=P(n?.rule);return e.createElement(c,{className:i.dryRunRoot},e.createElement(c,{className:i.dryRunSection},t&&e.createElement(e.Fragment,null,e.createElement(a,{variant:"h5"},"Entity"),e.createElement(a,{variant:"body1"},e.createElement(b,{className:i.ownerLink,entityRef:t})))),e.createElement(c,{className:i.dryRunSection},e.createElement(a,{variant:"h5"},"Check Result"),e.createElement("div",{className:i.resultBox},s?e.createElement(B,{name:n?.name??"",state:s,details:m}):"No Results")),e.createElement(a,{variant:"h5"},"Rules"),e.createElement(g,{check:n,facts:l,ruleResults:r,expression:p}))};export{I as CheckDryRunDetails};
|
|
2
2
|
//# sourceMappingURL=CheckDryRunDetails.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import o,{useContext as u}from"react";import{SoundcheckDialog as
|
|
1
|
+
import o,{useContext as u}from"react";import{SoundcheckDialog as i}from"../SoundcheckDialog/SoundcheckDialog.esm.js";import"./CheckDryRun.esm.js";import"@material-ui/core";import{CheckDryRunDetails as m}from"./CheckDryRunDetails.esm.js";import{CheckDryRunContext as a}from"./CheckDryRunContext.esm.js";import"../CheckForm/utils/checkFormUtils.esm.js";const p=()=>{const{entityRef:r,open:c,updateOpen:n,check:e,result:t,facts:l,ruleResults:s}=u(a);return o.createElement(i,{handleClose:()=>n(!1),title:`${e?.name??"Check"} Run Results`,open:c,fullScreen:!1},o.createElement(m,{entityRef:r,check:e,checkResult:t?.checkResult,details:t?.details,facts:l,ruleResults:s}))};export{p as CheckDryRunDialog};
|
|
2
2
|
//# sourceMappingURL=CheckDryRunDialog.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Content as s}from"@backstage/core-components";import
|
|
1
|
+
import{Content as s}from"@backstage/core-components";import e from"react";import{FormProvider as d}from"react-hook-form";import"../../contexts/TrackFormContext.esm.js";import{useCheckFormContext as f}from"../../contexts/CheckFormContext.esm.js";import"../../contexts/CampaignFormContext.esm.js";import"../../contexts/UserProvider.esm.js";import{formStyles as u}from"../../utils/formStyles.esm.js";import"@material-ui/core";import"@material-ui/icons/Search";import"../SoundcheckDialog/SoundcheckDialog.esm.js";import"../FactExplorer/FactExplorer.esm.js";import{FactExplorerProvider as S}from"../FactExplorer/FactExplorerContext.esm.js";import{FormFilterSection as h}from"../FormFilterSection/FormFilterSection.esm.js";import{FormStepper as C}from"../FormStepper/FormStepper.esm.js";import"./FormFields/CheckNameInput/CheckNameInput.esm.js";import"./FormFields/PassFailMessageInput/PassFailMessageInput.esm.js";import"../FormMarkdownInput/FormMarkdownInput.esm.js";import{CHECK_FIELDS as F}from"./utils/checkFormUtils.esm.js";import"./FormFields/TeamDetailsInput/TeamDetailsInput.esm.js";import"./FormFields/RuleInput/AddMenuButton.esm.js";import"./FormFields/RuleInput/RuleInputBox.esm.js";import"./FormFields/RuleInput/Expressions/ExpressionBox.esm.js";import"./FormFields/RuleInput/Expressions/ExpressionTypeToggle.esm.js";import"@material-ui/icons/Close";import"@material-ui/icons/Delete";import"@material-ui/icons/List";import"@spotify/backstage-plugin-soundcheck-common";import"@backstage/core-plugin-api";import"@tanstack/react-query";import"../../api.esm.js";import"../FormControlledAutocomplete/FormControlledAutocomplete.esm.js";import"./FormFields/RuleInput/Conditions/styles.esm.js";import"@backstage/catalog-model";import"../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"../../hooks/useSoundcheckAlert.esm.js";import"../../hooks/useConfirmationModal.esm.js";import"react-router-dom";import"./FormFields/RuleInput/Conditions/ValueListInput.esm.js";import"./FormFields/RuleInput/Conditions/ConditionList.esm.js";import{ScheduleSection as E}from"./FormFields/CheckScheduleSection/ScheduleSection.esm.js";import"./FormFields/CheckPathResolverInput.esm.js";import{CheckDetailsStep as b}from"./Steps/CheckDetailsStep.esm.js";import{CheckRulesStep as k}from"./Steps/CheckRulesStep.esm.js";import{CheckReviewStep as y}from"./Steps/CheckReviewStep.esm.js";import"./types/ExpressionType.esm.js";import{CheckStepNameMapping as g}from"./types/CheckFormTypes.esm.js";import"../Frequency/types.esm.js";import"../Frequency/util.esm.js";import"../Frequency/FrequencyComponent.esm.js";import"./types/Path.esm.js";import{useCheckForm as v}from"./useCheckForm.esm.js";const x=({onSave:p,onClose:o})=>{const{isLoading:l,isReadOnly:r,selectedItem:n}=f(),{formMethods:t,onSubmit:i}=v(p),a=u(),m=[{label:"Enter check details",content:()=>e.createElement(b,null)},{label:"Add rules",content:()=>e.createElement(k,null)},{label:"Choose the affected entities (Optional)",content:()=>e.createElement(h,{name:"filtersStep.filter",keyValueFilterName:"filtersStep.keyValueFilter",disabled:r,description:F.filter.description,excludeFilterName:"filtersStep.excludeFilter",excludeKeyValueFilterName:"filtersStep.excludeKeyValueFilter"})},{label:"Set the check schedule (Optional)",content:()=>e.createElement(E,{control:t.control,disabled:r})},{label:"Review and test (Optional)",content:()=>e.createElement(y,null)}],c=n?[...Array(m.length).keys()]:[0];return e.createElement(s,{className:a.formWrapper},e.createElement(d,{...t},e.createElement(S,null,e.createElement("form",{onSubmit:t.handleSubmit(i)},e.createElement(C,{onClose:()=>o?o():void 0,handleSubmit:t.handleSubmit,trigger:t.trigger,onSubmit:i,initialVisited:c,stepNameMap:g,steps:m,isLoading:l,isReadOnly:r,saveButtonText:"Save Check"})))))};export{x as CheckForm};
|
|
2
2
|
//# sourceMappingURL=CheckForm.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Box as r,IconButton as m,FormHelperText as c}from"@material-ui/core";import s from"@material-ui/icons/Close";import e from"react";import{useRuleConditionStyles as i}from"./styles.esm.js";const u=({value:t,handleClear:
|
|
1
|
+
import{Box as r,IconButton as m,FormHelperText as c}from"@material-ui/core";import s from"@material-ui/icons/Close";import e from"react";import{useRuleConditionStyles as i}from"./styles.esm.js";const u=({value:t,handleClear:n,error:l})=>{const a=i(),o=t?.factRef&&t?.path?e.createElement(e.Fragment,null,e.createElement("strong",null,"Fact:")," ",t.factRef," ",e.createElement("strong",null,"Path:")," ",t.path):JSON.stringify(t);return e.createElement(e.Fragment,null,e.createElement(r,{className:a.valueDisplay},e.createElement(r,{overflow:"hidden",flexGrow:1},o),e.createElement(m,{onClick:n,size:"small"},e.createElement(s,null))),l&&e.createElement(c,{error:!0},l.message))};export{u as FactValueDisplay};
|
|
2
2
|
//# sourceMappingURL=FactValueDisplay.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Box as o,FormLabel as c,TextField as j,IconButton as
|
|
1
|
+
import{Box as o,FormLabel as c,TextField as j,IconButton as L}from"@material-ui/core";import V from"@material-ui/icons/Close";import D from"@material-ui/icons/Delete";import T from"@material-ui/icons/List";import{asArray as k}from"@spotify/backstage-plugin-soundcheck-common";import e,{useMemo as y,useCallback as h}from"react";import{useFormContext as G,Controller as M}from"react-hook-form";import{useOperators as W}from"../../../../../hooks/operators/useOperators.esm.js";import{FactExplorerDialogButton as C}from"../../../../FactExplorer/FactExplorerDialog.esm.js";import"../../../../FactExplorer/FactExplorerContext.esm.js";import{FormControlledAutocomplete as E}from"../../../../FormControlledAutocomplete/FormControlledAutocomplete.esm.js";import{FactValueDisplay as z}from"./FactValueDisplay.esm.js";import{useRuleConditionStyles as H}from"./styles.esm.js";import{useRuleOptions as q}from"./useRuleOptions.esm.js";import{ValueListInputDialogButton as A}from"./ValueListInput.esm.js";const J=({name:a,handleDelete:F,disabled:i,disableDelete:b})=>{const r=H(),{control:s,setValue:m,watch:p,clearErrors:d}=G(),{data:N,isLoading:R}=W(),O=p("rulesStep.pathResolver")==="jsonpath",u=y(()=>N?.map(t=>({value:t.name,label:t.title})).sort((t,l)=>t.label.localeCompare(l.label))??[],[N]),w=y(()=>u.map(t=>t.value),[u]),{pathOptions:B,factRefOptions:f,isLoading:x}=q(a,s),S=y(()=>f?.map(t=>t.value)??[],[f]),I=h(({factRef:t,path:l})=>{m(`${a}.factRef`,t),m(`${a}.path`,l),d()},[d,a,m]),P=h(({factRef:t,path:l})=>{m(`${a}.value`,{factRef:t,path:l}),d()},[d,a,m]),g=h(t=>{m(`${a}.value`,t.length>0?t:""),d()},[d,a,m]),n=p(`${a}.value`),$=h(()=>{m(`${a}.value`,"")},[a,m]);return e.createElement(o,{className:r.container},e.createElement(o,{className:r.connector}),e.createElement(o,{paddingTop:2,paddingLeft:2,paddingRight:2,paddingBottom:2,width:"100%",className:r.innerContainer},e.createElement(o,{className:r.inputsContainer},f&&e.createElement(o,null,e.createElement(c,{className:r.formLabel},"Fact"),e.createElement(E,{name:`${a}.factRef`,control:s,placeholder:"Fact",options:S,getOptionLabel:t=>f?.find(l=>t===l.value)?.label??t,getOptionValue:t=>f?.find(l=>t===l.label)?.value??t??"",disabled:i||x,width:428})),e.createElement(o,{flexGrow:1},e.createElement(c,{className:r.formLabel},"Path"),e.createElement(E,{name:`${a}.path`,placeholder:"Path",control:s,disabled:i||x,options:O?B:[],fullWidth:!0})),e.createElement(o,null,e.createElement(c,{className:r.formLabel,style:{visibility:"hidden"}},"Explore"),e.createElement(o,{width:150},e.createElement(C,{factRef:p(`${a}.factRef`),path:p(`${a}.path`),onSave:I,pathResolver:p("rulesStep.pathResolver"),className:r.exploreButton,hideIcon:!0})))),e.createElement(o,{className:r.inputsContainer},u&&e.createElement(e.Fragment,null,e.createElement(o,null,e.createElement(c,{className:r.formLabel},"Prefix (Optional)"),e.createElement(E,{name:`${a}.operatorPrefix`,control:s,placeholder:"Prefix",options:["all","any","none"],disabled:R||i,width:120})),e.createElement(o,null,e.createElement(c,{className:r.formLabel},"Operator"),e.createElement(E,{name:`${a}.operator`,control:s,placeholder:"Operator",options:w,disabled:R||i,getOptionLabel:t=>(l=>u?.find(v=>l===v.value)?.label??l??"")(t),getOptionValue:t=>(l=>u?.find(v=>l===v.label)?.value??l??"")(t),width:300}))),e.createElement(o,{flexGrow:1},e.createElement(c,{className:r.formLabel},"Value"),typeof n=="object"&&!Array.isArray(n)?e.createElement(z,{value:n,handleClear:$}):e.createElement(M,{name:`${a}.value`,control:s,defaultValue:"",render:({field:t,fieldState:l})=>e.createElement(j,{...t,variant:"outlined",placeholder:"Enter a value",FormHelperTextProps:{className:r.helperText},error:l.invalid,helperText:l.error?l.error.message:null,margin:"dense",disabled:i||typeof n=="object",className:r.noMargin,fullWidth:!0,InputProps:{endAdornment:e.createElement(L,{onClick:$,size:"small"},e.createElement(V,null)),startAdornment:Array.isArray(n)?e.createElement(A,{values:n,onSave:g,iconButton:e.createElement(T,null)}):null}})})),e.createElement(o,null,e.createElement(c,{className:r.formLabel,style:{visibility:"hidden"}},"Alternative Input"),e.createElement(o,{display:"flex",width:150},e.createElement(C,{factRef:typeof n=="object"?n?.factRef:void 0,path:typeof n=="object"?n?.path:void 0,onSave:P,pathResolver:p("rulesStep.pathResolver"),className:r.exploreButton,text:"Fact",hideIcon:!0}),e.createElement(A,{values:typeof n=="object"&&!Array.isArray(n)?void 0:k(n),onSave:g}))))),e.createElement(L,{onClick:F,className:r.deleteButton,"data-test-id":`${a}-delete-button`,disabled:i||b,hidden:i||b,style:{visibility:i||b?"hidden":void 0}},e.createElement(D,{className:r.deleteIcon})))};export{J as RuleConditionInput};
|
|
2
2
|
//# sourceMappingURL=RuleConditionInput.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{makeStyles as C,Box as p,Typography as k,TextField as
|
|
1
|
+
import{makeStyles as C,Box as p,Typography as k,TextField as S,IconButton as f,Button as d,Divider as x}from"@material-ui/core";import y from"@material-ui/icons/Add";import B from"@material-ui/icons/Delete";import e,{useContext as E,useCallback as r}from"react";import{SoundcheckDialog as h}from"../../../../SoundcheckDialog/SoundcheckDialog.esm.js";import{ValueListContext as v}from"./ValueListContext.esm.js";const V=C(t=>({dialogButton:{padding:t.spacing(1,1.5)}})),I=()=>{const{values:t,updateValues:n,updateOpen:i,onSave:o}=E(v),u=r((a,l)=>{const s=[...t];s[a]=l,n(s)},[n,t]),c=r(a=>{const l=[...t];l.splice(a,1),n(l)},[n,t]),m=r(()=>{const a=[...t,""];n(a)},[n,t]),g=r(()=>{o(t.filter(a=>!!a)),i(!1)},[o,i,t]);return e.createElement(p,{minWidth:640,paddingLeft:2,paddingRight:2,"data-testid":"rule-value-list-input"},e.createElement(k,{component:"div",variant:"subtitle2"},"Rule Value"),t.map((a,l)=>e.createElement(p,{display:"flex",marginBottom:1,alignItems:"center",key:l},e.createElement(S,{value:a,onChange:s=>u(l,s.currentTarget.value),variant:"outlined",margin:"dense",fullWidth:!0}),e.createElement(f,{onClick:()=>c(l),size:"small"},e.createElement(B,null)))),e.createElement(p,{marginTop:1,marginBottom:2},e.createElement(d,{onClick:m,startIcon:e.createElement(y,null),size:"small",variant:"outlined"},"Add")),e.createElement(x,null),e.createElement(p,{marginTop:2,display:"flex",gridGap:8,justifyContent:"flex-end"},e.createElement(d,{onClick:()=>i(!1),variant:"text"},"Cancel"),e.createElement(d,{onClick:g,variant:"contained",color:"primary"},"Save")))},L=({values:t=Array(5).fill(""),onSave:n,iconButton:i})=>{const{updateOpen:o,updateValues:u,updateOnSave:c}=E(v),m=r(()=>{const a=[...t.map(l=>String(l)),"","",""];o(!0),u(a),c(()=>n||(()=>{}))},[n,c,o,u,t]),g=V();return i?e.createElement(f,{"aria-label":"edit list",onClick:m,size:"small"},i):e.createElement(d,{className:g.dialogButton,onClick:m},"List")},T=()=>{const{open:t,updateOpen:n}=E(v);return e.createElement(h,{open:t,handleClose:()=>n(!1),title:"Input Value List",fullScreen:!1},e.createElement(I,null))};export{T as ValueListInputDialog,L as ValueListInputDialogButton};
|
|
2
2
|
//# sourceMappingURL=ValueListInput.esm.js.map
|