@spotify/backstage-plugin-soundcheck 0.16.0 → 0.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/dist/alpha.d.ts +60 -45
  3. package/dist/api.esm.js +1 -1
  4. package/dist/components/Badges/CampaignBadge.esm.js +1 -1
  5. package/dist/components/Badges/NoLevelBadge.esm.js +1 -1
  6. package/dist/components/Badges/PlaylistBadge.esm.js +1 -1
  7. package/dist/components/CampaignForm/Steps/CampaignDetailsStep/CampaignOwnerField.esm.js +1 -1
  8. package/dist/components/CertificationSidebar/CertificationSidebar.esm.js +1 -1
  9. package/dist/components/CertificationSidebar/Check.esm.js +1 -1
  10. package/dist/components/CertificationSidebar/CheckResultInputPopup.esm.js +2 -0
  11. package/dist/components/CertificationSidebar/CheckResultSummaryList.esm.js +1 -1
  12. package/dist/components/CertificationSidebar/ExemptionJustificationDialog.esm.js +2 -0
  13. package/dist/components/CertificationsPage/CertificationTabs.esm.js +1 -1
  14. package/dist/components/CertificationsPage/CertificationsPage.esm.js +1 -1
  15. package/dist/components/CheckDetails/CheckDetails.esm.js +1 -1
  16. package/dist/components/CheckDetails/FactTable.esm.js +1 -1
  17. package/dist/components/CheckDetails/JustificationDetails.esm.js +2 -0
  18. package/dist/components/CheckDetails/ResultStateBox.esm.js +1 -1
  19. package/dist/components/CheckDryRun/CheckDryRun.esm.js +1 -1
  20. package/dist/components/CheckForm/FormFields/CheckPathResolverInput.esm.js +1 -1
  21. package/dist/components/CheckForm/FormFields/CheckScheduleSection/ScheduleSection.esm.js +1 -1
  22. package/dist/components/CheckForm/FormFields/CheckTypeInput/CheckTypeInput.esm.js +2 -0
  23. package/dist/components/CheckForm/FormFields/TeamDetailsInput/TeamDetailsInput.esm.js +1 -1
  24. package/dist/components/CheckForm/Steps/CheckDetailsStep.esm.js +1 -1
  25. package/dist/components/CheckForm/Steps/CheckReviewStep.esm.js +1 -1
  26. package/dist/components/CheckForm/Steps/CheckRulesStep.esm.js +1 -1
  27. package/dist/components/CheckForm/useCheckForm.esm.js +1 -1
  28. package/dist/components/CheckForm/utils/checkFormUtils.esm.js +2 -2
  29. package/dist/components/CheckForm/utils/validation.esm.js +1 -1
  30. package/dist/components/CollectorPage/Configurators/AzureDevOps/NumberOfWorkItemsComponent.esm.js +1 -1
  31. package/dist/components/CollectorPage/Configurators/BigQuery/QueryFactDetailsComponent.esm.js +1 -1
  32. package/dist/components/CollectorPage/Configurators/Github/CodeScanningAlertsFactDetails.esm.js +2 -0
  33. package/dist/components/CollectorPage/Configurators/Github/DependabotAlertsFactDetails.esm.js +2 -0
  34. package/dist/components/CollectorPage/Configurators/Github/GithubConfigurator.esm.js +1 -1
  35. package/dist/components/CollectorPage/Configurators/Github/SecretScanningAlertsFactDetails.esm.js +2 -0
  36. package/dist/components/CollectorPage/Configurators/Github/SecurityAdvisoriesFactDetails.esm.js +2 -0
  37. package/dist/components/CollectorPage/Configurators/Github/types.esm.js +2 -0
  38. package/dist/components/CollectorPage/Configurators/Github/utils.esm.js +1 -1
  39. package/dist/components/CollectorPage/Configurators/Github/validation.esm.js +2 -0
  40. package/dist/components/CollectorPage/Configurators/HTTP/HttpRequestComponent.esm.js +1 -1
  41. package/dist/components/CollectorPage/Configurators/HTTP/HttpStatusesInput.esm.js +1 -1
  42. package/dist/components/CollectorPage/Configurators/SCM/utils.esm.js +1 -1
  43. package/dist/components/EntityChip/EntityChip.esm.js +1 -1
  44. package/dist/components/FactExplorer/FactExplorer.esm.js +1 -1
  45. package/dist/components/Filter/EntityAutocompletePicker.esm.js +1 -1
  46. package/dist/components/FormControlledAutocomplete/FormControlledMultipleAutocomplete.esm.js +2 -0
  47. package/dist/components/FormControlledSelect/FormControlledSelect.esm.js +1 -1
  48. package/dist/components/GroupSelector/GroupSelector.esm.js +1 -1
  49. package/dist/components/OrgHealth/OrgHealthPage.esm.js +2 -0
  50. package/dist/components/OverviewPage/OverviewPageHeader.esm.js +1 -1
  51. package/dist/components/RoutingPage/RoutingPage.esm.js +1 -1
  52. package/dist/components/RuleResult/BranchResultComponent.esm.js +1 -1
  53. package/dist/components/TechHealth/Filters/FacetFilter.esm.js +1 -1
  54. package/dist/components/TechHealth/Filters/FilterProvider.esm.js +1 -1
  55. package/dist/components/TechHealthTabs/PassRateTabHeader.esm.js +1 -1
  56. package/dist/components/TrackForm/Steps/TrackDetailsStep/TrackBadgeTypeSelect/TrackBadgeTypeSelect.esm.js +1 -1
  57. package/dist/components/TrackForm/Steps/TrackDetailsStep/TrackOwnerSelect/TrackOwnerSelect.esm.js +1 -1
  58. package/dist/components/TracksPage/TracksPage.esm.js +1 -1
  59. package/dist/graphql/generated/index.esm.js +93 -54
  60. package/dist/hooks/certifications/useCertificationDetailsForTrack.esm.js +1 -1
  61. package/dist/hooks/checks/useSetManualResult.esm.js +2 -0
  62. package/dist/hooks/exemptions/useDeleteExemption.esm.js +2 -0
  63. package/dist/hooks/exemptions/useGetExemption.esm.js +2 -0
  64. package/dist/hooks/exemptions/useSetEntityExempt.esm.js +2 -0
  65. package/dist/hooks/facets/useFacetFilters.esm.js +1 -1
  66. package/dist/hooks/graphqlKeys.esm.js +1 -1
  67. package/dist/index.d.ts +0 -1
  68. package/dist/utils/export.esm.js +3 -3
  69. package/package.json +21 -21
  70. package/dist/components/CheckDetails/ExemptionDetails.esm.js +0 -2
  71. package/dist/components/CheckDryRun/checkDryRunUtils.esm.js +0 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,36 @@
1
1
  # @spotify/backstage-plugin-soundcheck
2
2
 
3
+ ## 0.16.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Update to Backstage `v1.37.0`
8
+ - Updated dependency `@hookform/resolvers` to `^4.0.0`.
9
+ - Pass/fail messages now have a maximum height and will show scroll bars when needed.
10
+ - Checks which are not applicable or exempt are no longer shown on an entity's Soundcheck tab. Their visibility can be toggled and this option is persisted.
11
+ - Adds a configuration setting for MCE.
12
+ - Added support for the new GitHub fact types:
13
+
14
+ - Code Scanning Alerts
15
+ - Dependabot Alerts
16
+ - Secret Scanning Alerts
17
+ - Security Advisories
18
+
19
+ - Fix Exporting Checks and Tracks to YAML
20
+ - Soundcheck - Adds support for exempting an entity from a check.
21
+ - Soundcheck - Exporting a check now also exports the check's type when necessary.
22
+ - Ownership filters now only show groups matching the `soundcheck.entityFilters.groupFilter` filter if provided.
23
+ - Soundcheck - Adds the ability to specify a result for manual type checks.
24
+ - Misc UI and UX improvements on certification page.
25
+ - Soundcheck - Adds the ability to create manual-style checks via NCUI.
26
+ - Updated dependencies
27
+ - Updated dependencies
28
+ - Updated dependencies
29
+ - Updated dependencies
30
+ - Updated dependencies
31
+ - @spotify/backstage-plugin-core@0.8.7
32
+ - @spotify/backstage-plugin-soundcheck-common@0.16.1
33
+
3
34
  ## 0.16.0
4
35
 
5
36
  ### Minor Changes
@@ -48,6 +79,12 @@
48
79
  - @spotify/backstage-plugin-core@0.8.6
49
80
  - @spotify/backstage-plugin-soundcheck-common@0.16.0
50
81
 
82
+ ## 0.15.1
83
+
84
+ ### Patch Changes
85
+
86
+ - Enables filtering by system, type, lifecycle, and owner on the Check Insights page.
87
+
51
88
  ## 0.15.0
52
89
 
53
90
  ### Minor Changes
package/dist/alpha.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- /// <reference types="react" />
1
+ import * as _backstage_core_plugin_api__ from '@backstage/core-plugin-api/*';
2
2
  import * as _backstage_catalog_model_index from '@backstage/catalog-model/index';
3
3
  import * as react from 'react';
4
- import * as _backstage_core_plugin_api_index from '@backstage/core-plugin-api/index';
4
+ import * as _backstage_plugin_catalog_react_alpha from '@backstage/plugin-catalog-react/alpha';
5
5
  import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api';
6
6
 
7
7
  /**
@@ -21,21 +21,29 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{}, {}, {
21
21
  factory: _backstage_frontend_plugin_api.AnyApiFactory;
22
22
  };
23
23
  }>;
24
- "nav-item:soundcheck": _backstage_frontend_plugin_api.ExtensionDefinition<{
25
- kind: "nav-item";
26
- name: undefined;
27
- config: {};
28
- configInput: {};
29
- output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<{
30
- title: string;
31
- icon: _backstage_core_plugin_api_index.IconComponent;
32
- routeRef: _backstage_frontend_plugin_api.RouteRef<undefined>;
33
- }, "core.nav-item.target", {}>;
24
+ "entity-card:soundcheck/card": _backstage_frontend_plugin_api.ExtensionDefinition<{
25
+ kind: "entity-card";
26
+ name: "card";
27
+ config: {
28
+ filter: _backstage_plugin_catalog_react_alpha.EntityPredicate | undefined;
29
+ type: "content" | "summary" | "info" | undefined;
30
+ };
31
+ configInput: {
32
+ filter?: _backstage_plugin_catalog_react_alpha.EntityPredicate | undefined;
33
+ type?: "content" | "summary" | "info" | undefined;
34
+ };
35
+ output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<react.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<(entity: _backstage_catalog_model_index.Entity) => boolean, "catalog.entity-filter-function", {
36
+ optional: true;
37
+ }> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "catalog.entity-filter-expression", {
38
+ optional: true;
39
+ }> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<_backstage_plugin_catalog_react_alpha.EntityCardType, "catalog.entity-card-type", {
40
+ optional: true;
41
+ }>;
34
42
  inputs: {};
35
43
  params: {
36
- title: string;
37
- icon: _backstage_core_plugin_api_index.IconComponent;
38
- routeRef: _backstage_frontend_plugin_api.RouteRef<undefined>;
44
+ loader: () => Promise<JSX.Element>;
45
+ filter?: string | _backstage_plugin_catalog_react_alpha.EntityPredicate | ((entity: _backstage_catalog_model_index.Entity) => boolean);
46
+ type?: _backstage_plugin_catalog_react_alpha.EntityCardType;
39
47
  };
40
48
  }>;
41
49
  "entity-content:soundcheck/entity": _backstage_frontend_plugin_api.ExtensionDefinition<{
@@ -44,12 +52,14 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{}, {}, {
44
52
  config: {
45
53
  path: string | undefined;
46
54
  title: string | undefined;
47
- filter: string | undefined;
55
+ filter: _backstage_plugin_catalog_react_alpha.EntityPredicate | undefined;
56
+ group: string | false | undefined;
48
57
  };
49
58
  configInput: {
50
- filter?: string | undefined;
59
+ filter?: _backstage_plugin_catalog_react_alpha.EntityPredicate | undefined;
51
60
  title?: string | undefined;
52
61
  path?: string | undefined;
62
+ group?: string | false | undefined;
53
63
  };
54
64
  output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<react.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "core.routing.path", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<_backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams>, "core.routing.ref", {
55
65
  optional: true;
@@ -57,34 +67,17 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{}, {}, {
57
67
  optional: true;
58
68
  }> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "catalog.entity-filter-expression", {
59
69
  optional: true;
70
+ }> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "catalog.entity-content-group", {
71
+ optional: true;
60
72
  }>;
61
73
  inputs: {};
62
74
  params: {
63
75
  loader: () => Promise<JSX.Element>;
64
76
  defaultPath: string;
65
77
  defaultTitle: string;
66
- routeRef?: _backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams> | undefined;
67
- filter?: string | ((entity: _backstage_catalog_model_index.Entity) => boolean) | undefined;
68
- };
69
- }>;
70
- "entity-card:soundcheck/card": _backstage_frontend_plugin_api.ExtensionDefinition<{
71
- kind: "entity-card";
72
- name: "card";
73
- config: {
74
- filter: string | undefined;
75
- };
76
- configInput: {
77
- filter?: string | undefined;
78
- };
79
- output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<react.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<(entity: _backstage_catalog_model_index.Entity) => boolean, "catalog.entity-filter-function", {
80
- optional: true;
81
- }> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "catalog.entity-filter-expression", {
82
- optional: true;
83
- }>;
84
- inputs: {};
85
- params: {
86
- loader: () => Promise<JSX.Element>;
87
- filter?: string | ((entity: _backstage_catalog_model_index.Entity) => boolean) | undefined;
78
+ defaultGroup?: ("development" | "documentation" | "deployment" | "observability") | (string & {});
79
+ routeRef?: _backstage_frontend_plugin_api.RouteRef;
80
+ filter?: string | _backstage_plugin_catalog_react_alpha.EntityPredicate | ((entity: _backstage_catalog_model_index.Entity) => boolean);
88
81
  };
89
82
  }>;
90
83
  "entity-content:soundcheck/group": _backstage_frontend_plugin_api.ExtensionDefinition<{
@@ -93,12 +86,14 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{}, {}, {
93
86
  config: {
94
87
  path: string | undefined;
95
88
  title: string | undefined;
96
- filter: string | undefined;
89
+ filter: _backstage_plugin_catalog_react_alpha.EntityPredicate | undefined;
90
+ group: string | false | undefined;
97
91
  };
98
92
  configInput: {
99
- filter?: string | undefined;
93
+ filter?: _backstage_plugin_catalog_react_alpha.EntityPredicate | undefined;
100
94
  title?: string | undefined;
101
95
  path?: string | undefined;
96
+ group?: string | false | undefined;
102
97
  };
103
98
  output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<react.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "core.routing.path", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<_backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams>, "core.routing.ref", {
104
99
  optional: true;
@@ -106,14 +101,34 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{}, {}, {
106
101
  optional: true;
107
102
  }> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "catalog.entity-filter-expression", {
108
103
  optional: true;
104
+ }> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "catalog.entity-content-group", {
105
+ optional: true;
109
106
  }>;
110
107
  inputs: {};
111
108
  params: {
112
109
  loader: () => Promise<JSX.Element>;
113
110
  defaultPath: string;
114
111
  defaultTitle: string;
115
- routeRef?: _backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams> | undefined;
116
- filter?: string | ((entity: _backstage_catalog_model_index.Entity) => boolean) | undefined;
112
+ defaultGroup?: ("development" | "documentation" | "deployment" | "observability") | (string & {});
113
+ routeRef?: _backstage_frontend_plugin_api.RouteRef;
114
+ filter?: string | _backstage_plugin_catalog_react_alpha.EntityPredicate | ((entity: _backstage_catalog_model_index.Entity) => boolean);
115
+ };
116
+ }>;
117
+ "nav-item:soundcheck": _backstage_frontend_plugin_api.ExtensionDefinition<{
118
+ kind: "nav-item";
119
+ name: undefined;
120
+ config: {};
121
+ configInput: {};
122
+ output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<{
123
+ title: string;
124
+ icon: _backstage_core_plugin_api__.IconComponent;
125
+ routeRef: _backstage_frontend_plugin_api.RouteRef<undefined>;
126
+ }, "core.nav-item.target", {}>;
127
+ inputs: {};
128
+ params: {
129
+ title: string;
130
+ icon: _backstage_core_plugin_api__.IconComponent;
131
+ routeRef: _backstage_frontend_plugin_api.RouteRef<undefined>;
117
132
  };
118
133
  }>;
119
134
  "page:soundcheck/SoundcheckRoutingPage": _backstage_frontend_plugin_api.ExtensionDefinition<{
@@ -132,7 +147,7 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{}, {}, {
132
147
  params: {
133
148
  defaultPath: string;
134
149
  loader: () => Promise<JSX.Element>;
135
- routeRef?: _backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams> | undefined;
150
+ routeRef?: _backstage_frontend_plugin_api.RouteRef;
136
151
  };
137
152
  }>;
138
153
  "page:soundcheck/overview": _backstage_frontend_plugin_api.ExtensionDefinition<{
@@ -151,7 +166,7 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{}, {}, {
151
166
  params: {
152
167
  defaultPath: string;
153
168
  loader: () => Promise<JSX.Element>;
154
- routeRef?: _backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams> | undefined;
169
+ routeRef?: _backstage_frontend_plugin_api.RouteRef;
155
170
  };
156
171
  }>;
157
172
  }>;
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 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};
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=n=>"response"in n&&"errors"in n.response,g=n=>"response"in n&&"message"in n.response;class l{#s;#a;#t;constructor(t){this.#s=t.fetchApi,this.#a=t.discoveryApi;const e=new h("/graphql",{fetch:async(s,a)=>{const i=`${await this.#a.getBaseUrl("soundcheck")}${s}`;return this.#s.fetch(i,a)}});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,s){return this.#e(async()=>{const{trackCertification:a}=await this.#t.getCertificationDetailsForTrack({entityRef:t,trackId:e,includeFilteredChecks:s});return a})}async getCheckResultDetails(t,e,s){return this.#e(async()=>{const{checkResult:a}=await this.#t.getCheckResultDetails({entityRef:t,trackId:e,checkId:s});return a})}async getFacetsForOwner(t){return this.#e(async()=>{const{facetsForOwner:e}=await this.#t.getFacetsForOwner({ownerEntityRef:t});return e})}async getTrackOverviewForOwner(t,e,s,a,i){return this.#e(async()=>{const{trackOverviewForOwner:r}=await this.#t.getTrackOverviewForOwner({ownerEntityRef:t,facet:e,first:s,after:a,entitySearch:i});return r})}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 getCheck(t){return this.#e(async()=>await this.#t.getCheck({id: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 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 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:s}=await this.#t.getFactSchemas({collectorId:t,factName:e});return s})}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{makeStyles as t}from"@material-ui/core";import m from"classnames";import a from"react";import{BaseBadge as s}from"./BaseBadge.esm.js";const l=t({root:{borderColor:"currentColor",borderStyle:"solid"}}),i=({className:o,size:r="small"})=>{const e=l();return a.createElement(s,{className:m(o,e.root),size:r,label:"C"})};export{i as CampaignBadge};
1
+ import{makeStyles as t}from"@material-ui/core";import m from"classnames";import a from"react";import{BaseBadge as s}from"./BaseBadge.esm.js";const l=t({root:{borderColor:"currentColor",borderStyle:"solid"}}),c=({className:o,size:r="small"})=>{const e=l();return a.createElement(s,{className:m(o,e.root),size:r,label:"C"})};export{c as CampaignBadge};
2
2
  //# sourceMappingURL=CampaignBadge.esm.js.map
@@ -2,5 +2,5 @@ import{MarkdownContent as a}from"@backstage/core-components";import{makeStyles a
2
2
  **No Level / Not Certified**
3
3
 
4
4
  Pass all checks within a level to earn a certification badge.
5
- `,d=s(e=>({root:{borderColor:e.palette.text.disabled,borderStyle:"dashed",color:e.palette.text.disabled}})),c=({className:e,showTooltip:o,size:l="small"})=>{const r=d();return t.createElement(m,{className:i(e,r.root),size:l,label:"NL",tooltip:o?t.createElement(a,{content:n}):null})};export{c as NoLevelBadge};
5
+ `,c=s(e=>({root:{borderColor:e.palette.text.disabled,borderStyle:"dashed",color:e.palette.text.disabled}})),d=({className:e,showTooltip:o,size:l="small"})=>{const r=c();return t.createElement(m,{className:i(e,r.root),size:l,label:"NL",tooltip:o?t.createElement(a,{content:n}):null})};export{d as NoLevelBadge};
6
6
  //# sourceMappingURL=NoLevelBadge.esm.js.map
@@ -1,2 +1,2 @@
1
- import{makeStyles as t}from"@material-ui/core";import s from"classnames";import l from"react";import{BaseBadge as m}from"./BaseBadge.esm.js";const a=t({root:{borderColor:"currentColor",borderStyle:"solid"}}),i=({className:o,size:r="small"})=>{const e=a();return l.createElement(m,{className:s(o,e.root),size:r,label:"\u25BA"})};export{i as PlaylistBadge};
1
+ import{makeStyles as t}from"@material-ui/core";import s from"classnames";import l from"react";import{BaseBadge as m}from"./BaseBadge.esm.js";const a=t({root:{borderColor:"currentColor",borderStyle:"solid"}}),c=({className:o,size:r="small"})=>{const e=a();return l.createElement(m,{className:s(o,e.root),size:r,label:"\u25BA"})};export{c as PlaylistBadge};
2
2
  //# sourceMappingURL=PlaylistBadge.esm.js.map
@@ -1,2 +1,2 @@
1
- import{makeStyles as u,Typography as l}from"@material-ui/core";import{uniqBy as g}from"lodash";import e from"react";import"../../../../contexts/TrackFormContext.esm.js";import"../../../../contexts/CheckFormContext.esm.js";import"../../../../contexts/CampaignFormContext.esm.js";import{useLoggedInUser as E}from"../../../../contexts/UserProvider.esm.js";import{useGroupOptions as v}from"../../../../hooks/groups/useGroupOptions.esm.js";import{FormControlledAutocomplete as y}from"../../../FormControlledAutocomplete/FormControlledAutocomplete.esm.js";import{useLabelOptions as b}from"../../../FormControlledAutocomplete/useLabelOptions.esm.js";import"@material-ui/lab";import"../../../ListboxVirtualized/ListboxVirtualized.esm.js";import{CAMPAIGN_FIELDS as h}from"../../utils/campaignFormUtils.esm.js";const w=u(t=>({helperText:{marginLeft:0},selectField:{display:"flex",flexDirection:"column",gap:t.spacing(1),marginBottom:t.spacing(2)},fieldContainer:{width:"250px"}})),x=({control:t,errors:m,isLoading:p,disabled:s})=>{const o=w(),{owner:i}=h.details,{options:c}=v(),{user:d,userEntityRef:a}=E();let r=g(c?.map(n=>({value:n.ref,label:n.name})),"value");const f=b(r);return a&&(r=[{value:a,label:d?.metadata.name},...r]),e.createElement("div",{className:o.selectField},e.createElement("header",null,e.createElement(l,{variant:"subtitle2"},i.name),e.createElement(l,{variant:"caption"},i.description)),e.createElement("div",{className:o.fieldContainer},e.createElement(y,{name:"detailsStep.ownerEntityRef",control:t,placeholder:"Owner",freeSolo:!1,disabled:s||p,helperText:m?.ownerEntityRef?.message??void 0,...f})))};export{x as CampaignOwnerField};
1
+ import{makeStyles as u,Typography as n}from"@material-ui/core";import{uniqBy as g}from"lodash";import e from"react";import"../../../../contexts/TrackFormContext.esm.js";import"../../../../contexts/CheckFormContext.esm.js";import"../../../../contexts/CampaignFormContext.esm.js";import{useLoggedInUser as E}from"../../../../contexts/UserProvider.esm.js";import{useGroupOptions as v}from"../../../../hooks/groups/useGroupOptions.esm.js";import{FormControlledAutocomplete as y}from"../../../FormControlledAutocomplete/FormControlledAutocomplete.esm.js";import"@material-ui/icons/CheckBox";import"@material-ui/icons/CheckBoxOutlineBlank";import"@material-ui/lab";import"react-hook-form";import"../../../ListboxVirtualized/ListboxVirtualized.esm.js";import{useLabelOptions as b}from"../../../FormControlledAutocomplete/useLabelOptions.esm.js";import{CAMPAIGN_FIELDS as h}from"../../utils/campaignFormUtils.esm.js";const w=u(t=>({helperText:{marginLeft:0},selectField:{display:"flex",flexDirection:"column",gap:t.spacing(1),marginBottom:t.spacing(2)},fieldContainer:{width:"250px"}})),x=({control:t,errors:l,isLoading:p,disabled:s})=>{const o=w(),{owner:i}=h.details,{options:c}=v(),{user:d,userEntityRef:a}=E();let r=g(c?.map(m=>({value:m.ref,label:m.name})),"value");const f=b(r);return a&&(r=[{value:a,label:d?.metadata.name},...r]),e.createElement("div",{className:o.selectField},e.createElement("header",null,e.createElement(n,{variant:"subtitle2"},i.name),e.createElement(n,{variant:"caption"},i.description)),e.createElement("div",{className:o.fieldContainer},e.createElement(y,{name:"detailsStep.ownerEntityRef",control:t,placeholder:"Owner",freeSolo:!1,disabled:s||p,helperText:l?.ownerEntityRef?.message??void 0,...f})))};export{x as CampaignOwnerField};
2
2
  //# sourceMappingURL=CampaignOwnerField.esm.js.map
@@ -1,2 +1,2 @@
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};
1
+ import{useEntity as k}from"@backstage/plugin-catalog-react";import{makeStyles as y,Box as E}from"@material-ui/core";import e from"react";import{ResultState as o}from"../../graphql/generated/index.esm.js";import"@backstage/catalog-model";import"@backstage/core-plugin-api";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import{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"react-router-dom";import{AlertPanel as S}from"../AlertPanel/AlertPanel.esm.js";import{CertificationLevel as b}from"./CertificationLevel.esm.js";import{CertificationSummary as h}from"./CertificationSummary.esm.js";import{CertificationSidebarSkeleton as v}from"./skeletons/CertificationSidebarSkeleton.esm.js";import"@material-ui/lab";const x=y(()=>({checks:{padding:0,margin:0,flex:1,listStyle:"none"}})),C=({playlistId:m,trackId:a,checkId:l,showNotApplicable:c,showExempt:n})=>{const{entity:p}=k(),{data:t,isLoading:s,isError:d}=g(p,a,!0);if(d)return e.createElement("div",null,e.createElement(E,{padding:2},e.createElement(S,{severity:"error",title:"Error loading certification"})));if(s||!a)return e.createElement(v,null);if(!t)return null;const f=t.track.type==="campaign",u=t.levels.map(r=>({...r,checks:r.checks?.filter(i=>c&&i.result===o.NotApplicable||n&&i.result===o.Exempt||i.result!==o.NotApplicable&&i.result!==o.Exempt)}));return e.createElement("div",null,e.createElement(h,{name:t.track.name,badge:t.track.badge,description:t.track.description,documentationUrl:t.track.documentationURL,trackType:t.track.type}),u.map(r=>e.createElement(b,{key:r.ordinal,level:r,checkId:l,trackId:a,playlistId:m,isCampaign:f})))};export{C as CertificationSidebar,x 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 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};
1
+ import{stringifyEntityRef as p}from"@backstage/catalog-model";import{useEntity as b}from"@backstage/plugin-catalog-react";import{makeStyles as C,Box as $,Typography as v,Tooltip as N,IconButton as I,CircularProgress as R}from"@material-ui/core";import S from"@material-ui/icons/Refresh";import T from"classnames";import e from"react";import{Link as z}from"react-router-dom";import{ResultState as h}from"../../graphql/generated/index.esm.js";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"../../hooks/useSoundcheckAlert.esm.js";import{useGetExemption as A}from"../../hooks/exemptions/useGetExemption.esm.js";import"../../hooks/useConfirmationModal.esm.js";import{useExecuteCheck as w}from"../../hooks/checks/useExecuteCheck.esm.js";import{CheckIcon as B}from"../CheckIcon/CheckIcon.esm.js";import{RelativeTime as F}from"../RelativeTime/RelativeTime.esm.js";const u=C(t=>({root:{display:"flex",width:"100%",gridTemplateColumns:"auto 1fr auto 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}})),G=({className:t,href:r,name:c,children:a})=>r?e.createElement(z,{"aria-label":`select check ${c}`,to:r,className:t},a):e.createElement("div",{className:t},a),L=({result:t,name:r,id:c,timestamp:a,isExecutable:m=!1,selected:d=!1,href:f})=>{const n=u(),k=T(n.root,{selected:d}),{entity:i}=b(),{mutateAsync:y,isLoading:l}=w(),{data:s}=A(p(i),c),E=async()=>{if(!(!i||!c))try{await y({checkerId:c,entityRef:p(i),shouldRefreshFacts:!0})}catch{}},g=!i||!c||!m||l||!!s?.exemption||t===h.NotApplicable,x=()=>{const o="Cannot execute check";return i?c?m?l?`${o} - check is already executing.`:s?.exemption?`${o} - entity has been exempted from this check.`:t===h.NotApplicable?`${o} - check is not applicable to entity.`:"Execute Check":`${o} - check is not executable by Soundcheck`:`${o} - no check id.`:`${o} - no entity.`};return e.createElement(G,{href:f,className:k,name:r},e.createElement(B,{className:n.checkIcon,result:t}),e.createElement($,{flex:1},e.createElement(v,{variant:"body2"},r)),a&&!l?e.createElement(F,{timestamp:a}):null,!l&&e.createElement(e.Fragment,null,e.createElement(N,{title:x()},e.createElement("span",null,e.createElement(I,{size:"small",color:"inherit",onClick:E,disabled:g,"aria-label":"Execute Check"},e.createElement(S,{fontSize:"small"}))))),l&&e.createElement(R,{color:"inherit",size:"1em"}))};export{L as Check,u as useStyles};
2
2
  //# sourceMappingURL=Check.esm.js.map
@@ -0,0 +1,2 @@
1
+ import{makeStyles as g,DialogContent as f,Box as h,Typography as S,Select as C,MenuItem as E,TextField as b,DialogActions as k,Button as r}from"@material-ui/core";import e from"react";import{ResultState as c}from"../../graphql/generated/index.esm.js";import{FormFieldLabel as s}from"../FormFieldLabel/FormFieldLabel.esm.js";import{SoundcheckDialog as v}from"../SoundcheckDialog/SoundcheckDialog.esm.js";const m=g(a=>({buttonArea:{paddingLeft:a.spacing(1),paddingBottom:0,justifyContent:"flex-start"},content:{minWidth:600,width:"61.8%",marginTop:a.spacing(0),paddingLeft:a.spacing(1),paddingTop:a.spacing(0)}})),y=({isOpen:a,setIsOpen:n,setCallback:u})=>{const l=m(),[i,p]=e.useState(c.Passed),[o,d]=e.useState("");return e.createElement(v,{title:"Set Check Status",open:a,handleClose:()=>n(!1),fullScreen:!1},e.createElement(f,{className:l.content},e.createElement(h,{marginBottom:2},e.createElement(s,{title:"State"}),e.createElement(S,{variant:"caption"},"Set the state of the check for this entity."),e.createElement(C,{labelId:"result-state-label",value:i,onChange:t=>p(t.target.value),label:"Select State",variant:"outlined",fullWidth:!0,margin:"dense"},Object.values(c).map(t=>e.createElement(E,{key:t,value:t},t)))),e.createElement(s,{title:"Justification"}),e.createElement(b,{margin:"dense",fullWidth:!0,value:o,variant:"outlined",inputProps:{"aria-label":"Check Status Justification"},onChange:t=>d(t.target.value)})),e.createElement(k,{className:l.buttonArea},e.createElement(r,{onClick:()=>{n(!1),u(i,o)},color:"primary",variant:"contained"},"Submit"),e.createElement(r,{onClick:()=>n(!1),color:"primary"},"Cancel")))};export{y as CheckResultInputPopup,m as useStyles};
2
+ //# sourceMappingURL=CheckResultInputPopup.esm.js.map
@@ -1,2 +1,2 @@
1
- import{useRouteRef as i}from"@backstage/core-plugin-api";import{makeStyles as k,Typography as h}from"@material-ui/core";import c from"react";import{useExecutableChecks as f}from"../../hooks/checks/useExecutableChecks.esm.js";import{certificationRouteRef as y,certificationPlaylistTrackCheckRouteRef as u}from"../../routes.esm.js";import{Check as I}from"./Check.esm.js";const l=k(e=>({noChecks:{padding:e.spacing(1)},checks:{padding:0,margin:0,flex:1,listStyle:"none"},checkItem:{borderBottom:`1px solid ${e.palette.divider}`,"&:last-of-type":{borderBottom:"0"},color:e.palette.text.primary,"& a":{color:e.palette.text.primary,textDecoration:"none"}}})),x=({checks:e,playlistId:o,trackId:r,checkId:s})=>{const a=l(),m=i(y),d=i(u),{data:n,isLoading:p}=f();return e.length?c.createElement("ul",{className:a.checks},e.map(t=>c.createElement("li",{key:t.id,className:a.checkItem},c.createElement(I,{...t,isExecutable:!p&&n?.includes(t.id),selected:t.id===s,href:o?d({playlistId:o,trackId:r,checkId:t.id}):m({trackId:r,checkId:t.id})})))):c.createElement(h,{variant:"body2",className:a.noChecks},"No applicable checks at this level.")};export{x as CheckResultSummaryList,l as useStyles};
1
+ import{useRouteRef as l}from"@backstage/core-plugin-api";import{makeStyles as k,Typography as h}from"@material-ui/core";import c from"react";import{useExecutableChecks as y}from"../../hooks/checks/useExecutableChecks.esm.js";import{certificationRouteRef as f,certificationPlaylistTrackCheckRouteRef as u}from"../../routes.esm.js";import{Check as g}from"./Check.esm.js";const r=k(e=>({noChecks:{padding:e.spacing(1)},checks:{padding:0,margin:0,flex:1,listStyle:"none"},checkItem:{borderBottom:`1px solid ${e.palette.divider}`,"&:last-of-type":{borderBottom:"0"},color:e.palette.text.primary,"& a":{color:e.palette.text.primary,textDecoration:"none"}}})),I=({checks:e,playlistId:o,trackId:i,checkId:s})=>{const a=r(),m=l(f),d=l(u),{data:n,isLoading:p}=y();return e.length?c.createElement("ul",{className:a.checks},e.map(t=>c.createElement("li",{key:t.id,className:a.checkItem},c.createElement(g,{...t,isExecutable:!p&&n?.includes(t.id),selected:t.id===s,href:o?d({playlistId:o,trackId:i,checkId:t.id}):m({trackId:i,checkId:t.id})})))):c.createElement(h,{variant:"body2",className:a.noChecks},"No applicable checks at this level. Toggle your visibility settings to see not applicable checks.")};export{I as CheckResultSummaryList,r as useStyles};
2
2
  //# sourceMappingURL=CheckResultSummaryList.esm.js.map
@@ -0,0 +1,2 @@
1
+ import{makeStyles as k,DialogContent as S,Box as b,Typography as w,TextField as R,FormHelperText as C,DialogActions as A,Button as u}from"@material-ui/core";import t,{useState as f,useEffect as F,useCallback as x}from"react";import{ResultState as T}from"../../graphql/generated/index.esm.js";import"@backstage/catalog-model";import"@backstage/core-plugin-api";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"@spotify/backstage-plugin-soundcheck-common";import{useSoundcheckAlert as D}from"../../hooks/useSoundcheckAlert.esm.js";import{useGetExemption as L}from"../../hooks/exemptions/useGetExemption.esm.js";import{useSetEntityExempt as I}from"../../hooks/exemptions/useSetEntityExempt.esm.js";import"../../hooks/useConfirmationModal.esm.js";import"react-router-dom";import{useDeleteExemption as J}from"../../hooks/exemptions/useDeleteExemption.esm.js";import{FormFieldLabel as j}from"../FormFieldLabel/FormFieldLabel.esm.js";import{SoundcheckDialog as B}from"../SoundcheckDialog/SoundcheckDialog.esm.js";const y=k(e=>({buttonArea:{paddingLeft:e.spacing(1),paddingBottom:0,justifyContent:"flex-start"},content:{minWidth:480,width:"61.8%",marginTop:e.spacing(0),paddingLeft:e.spacing(1),paddingTop:e.spacing(0)}})),N=({entityRef:e,checkId:n,isOpen:g,setIsOpen:a})=>{const[P,r]=f(),{showAlert:m}=D(),l=y(),[o,s]=f(""),{mutateAsync:p}=I(),{mutateAsync:c}=J(),{data:i,isLoading:d}=L(e,n);F(()=>{i?.exemption&&s(i.exemption.justification)},[i?.exemption]);const E=x(async()=>{!e||!n||await p({checkId:n,entityRef:e,justification:o})&&r({id:n,entityRef:e,result:T.Exempt,details:{notes:{type:"notes",data:o,version:1}},facts:[],ruleResults:[]})},[e,n,o,p,r]),h=x(async()=>{if(!(!e||!n))try{await c({checkId:n,entityRef:e})}catch{m({severity:"error",title:"Failure",message:"Failed to delete exemption."})}},[e,n,c,m]);return t.createElement(t.Fragment,null,d&&t.createElement("div",null,"Loading..."),!d&&t.createElement(B,{open:g,handleClose:()=>a(!1),title:i?.exemption?"Remove Exemption?":"Justify Exemption",fullScreen:!1},t.createElement(S,{className:l.content},t.createElement(b,null,t.createElement(j,{title:i?.exemption?"Existing Justification":"Exemption Justification"}),!i?.exemption&&t.createElement(w,{variant:"caption"},"Please explain why this exemption is necessary. Supports limited markdown."),t.createElement(R,{disabled:!!i?.exemption,variant:"outlined",margin:"dense",fullWidth:!0,value:o,inputProps:{"aria-label":"Exemption Reason"},multiline:!0,onChange:v=>s(v.target.value)}),t.createElement(C,null,"Note: The act of adding or removing an exemption is tied to your user id and is monitored and recorded. Exemptions should only be added or removed with proper cause."))),t.createElement(A,{className:l.buttonArea},t.createElement(u,{variant:"contained",onClick:async()=>{a(!1),i?.exemption?await h():await E()},color:"primary",disabled:!i?.exemption&&(!o||o?.length===0)},i?.exemption?"Remove":"Submit"),t.createElement(u,{onClick:()=>a(!1),color:"primary"},"Cancel"))))};export{N as ExemptionJustificationDialog,y as useStyles};
2
+ //# sourceMappingURL=ExemptionJustificationDialog.esm.js.map
@@ -1,2 +1,2 @@
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};
1
+ import{useRouteRef as u}from"@backstage/core-plugin-api";import{useEntity as T}from"@backstage/plugin-catalog-react";import{makeStyles as v,Tabs as N,IconButton as A,Menu as B,MenuItem as h,Switch as g}from"@material-ui/core";import P from"@material-ui/icons/ArrowDropDown";import L from"@material-ui/icons/Settings.js";import t,{useState as M,useEffect as O}from"react";import k from"react-use/lib/useLocalStorage";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 Q}from"../../hooks/playlists/usePlaylists.esm.js";import{certificationPlaylistRouteRef as j,certificationTrackRouteRef as q}from"../../routes.esm.js";import{CertificationTab as D}from"./CertificationTab.esm.js";import{PlaylistCertificationTab as F}from"./PlaylistCertificationTab.esm.js";import{CertificationTabsSkeleton as G}from"./skeletons/CertificationTabsSkeleton.esm.js";function H(a=[],o=[],n,l){if(n){const i=a.findIndex(r=>r.id===n);return i<0?!1:i}const c=o.findIndex(i=>i.track.id===l);return c<0?!1:c+a.length}const J=v(a=>({tabsContainer:{display:"flex",alignItems:"center"},tabs:{flex:1},settingsButton:{display:"flex",alignItems:"center",marginRight:a.spacing(1)}})),U=({playlistId:a,trackId:o,onSettingsChange:n})=>{const l=J(),[c,i]=M(null),[r,E]=k("soundcheck.certifications.showNotApplicable",!1),[s,b]=k("soundcheck.certifications.showExempt",!0);O(()=>{n?.({showNotApplicable:!!r,showExempt:!!s})},[r,s,n]);const C=e=>{i(e.currentTarget)},y=()=>{i(null)},{entity:d}=T(),{isLoading:I,data:m}=K(d),{isLoading:x,data:f}=Q(d),S=u(j),w=u(q);if(x||I||!o)return t.createElement(G,null);const z=H(f,m,a,o);return t.createElement("div",{className:l.tabsContainer},t.createElement(N,{className:l.tabs,value:z,indicatorColor:"primary","aria-label":"Certifications",variant:"scrollable"},f?.length&&f.map(({id:e,name:p})=>t.createElement(F,{key:e,id:e,name:p,selected:e===o,href:S({playlistId:e})})),m&&m.filter(({track:{type:e}})=>e!=="playlist").map(({track:{id:e,name:p,badge:R}})=>t.createElement(D,{key:e,id:e,name:p,badge:R,selected:e===o,href:w({trackId:e})}))),t.createElement(A,{className:l.settingsButton,onClick:C,size:"small"},t.createElement(L,{fontSize:"small"}),t.createElement(P,{fontSize:"small"})),t.createElement(B,{anchorEl:c,open:!!c,onClose:y,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},t.createElement(h,{onClick:()=>{E(!r)},dense:!0},t.createElement(g,{size:"small",checked:r}),"Show Not Applicable Checks"),t.createElement(h,{onClick:()=>{b(!s)},dense:!0},t.createElement(g,{size:"small",checked:s}),"Show Exempt Checks")))};export{U as CertificationTabs};
2
2
  //# sourceMappingURL=CertificationTabs.esm.js.map
@@ -1,2 +1,2 @@
1
- import{stringifyEntityRef as u}from"@backstage/catalog-model";import{useEntity as v}from"@backstage/plugin-catalog-react";import{makeStyles as h,Paper as I,Divider as k}from"@material-ui/core";import e from"react";import{useParams as g}from"react-router-dom";import{useAllCertifications as C}from"../../hooks/certifications/useAllCertifications.esm.js";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"../../hooks/useSoundcheckAlert.esm.js";import"../../hooks/useConfirmationModal.esm.js";import{usePlaylists as P}from"../../hooks/playlists/usePlaylists.esm.js";import{AlertPanel as l}from"../AlertPanel/AlertPanel.esm.js";import{CertificationSidebar as b}from"../CertificationSidebar/CertificationSidebar.esm.js";import"../CertificationSidebar/CertificationSummary.esm.js";import"@material-ui/lab";import"../CertificationSidebar/Check.esm.js";import"../CertificationSidebar/LevelSummary.esm.js";import{isDarkTheme as R}from"../Charts/chartUtils.esm.js";import{CheckDetails as w}from"../CheckDetails/CheckDetails.esm.js";import"../CheckDryRun/CheckDryRun.esm.js";import"../SoundcheckDialog/SoundcheckDialog.esm.js";import"../CheckDryRun/CheckDryRunDetails.esm.js";import{CheckDryRunProvider as D}from"../CheckDryRun/CheckDryRunContext.esm.js";import"../CheckForm/utils/checkFormUtils.esm.js";import{NoCertifications as N}from"../EmptyState/EmptyState.esm.js";import{LevelUpParty as $}from"../LevelUpParty/LevelUpParty.esm.js";import{RefetchingIndicator as x}from"../RefetchingIndicator/RefetchingIndicator.esm.js";import{CertificationTabs as S}from"./CertificationTabs.esm.js";import{PlaylistComponent as T}from"./Playlist/PlaylistComponent.esm.js";const n=h(t=>({paper:{overflow:"hidden",position:"relative",border:R(t)?`1px solid ${t.palette.divider}`:void 0},view:{display:"grid",gridTemplateColumns:"1fr 2fr"},sidebar:{borderRight:`1px solid ${t.palette.divider}`}})),A=()=>{const{playlistId:t,trackId:r,checkId:a}=g(),m=n(),{entity:i}=v(),{isError:p,isFetched:s,data:c}=C(i),{isError:d,data:f}=P(i);if(p||d)return e.createElement(l,{severity:"error",title:"Error loading certifications"});const o=t&&f?.find(E=>E.id===t);if(t&&!o)return e.createElement(l,{severity:"error",title:"Playlist ${playlistId} not found."});if(s&&!c?.length)return e.createElement(N,null);const y=i?u(i):void 0;return e.createElement(D,null,e.createElement(I,{className:m.paper},e.createElement(x,null),e.createElement(S,{playlistId:t,trackId:r}),e.createElement(k,null),o&&e.createElement(T,{playlist:o,entityRef:y}),!o&&r&&e.createElement("div",{"data-testid":"soundcheck-certification-view",className:m.view},e.createElement("div",{className:m.sidebar},e.createElement(b,{trackId:r,checkId:a})),e.createElement(w,{programId:r,checkId:a}),e.createElement($,{programId:r}))))};export{A as CertificationsPage,n as useStyles};
1
+ import{stringifyEntityRef as b}from"@backstage/catalog-model";import{useEntity as g}from"@backstage/plugin-catalog-react";import{makeStyles as k,Paper as I,Divider as C}from"@material-ui/core";import e,{useState as N,useCallback as P}from"react";import{useParams as x}from"react-router-dom";import{useAllCertifications as A}from"../../hooks/certifications/useAllCertifications.esm.js";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"../../hooks/useSoundcheckAlert.esm.js";import"../../hooks/useConfirmationModal.esm.js";import{usePlaylists as R}from"../../hooks/playlists/usePlaylists.esm.js";import{AlertPanel as n}from"../AlertPanel/AlertPanel.esm.js";import{CertificationSidebar as S}from"../CertificationSidebar/CertificationSidebar.esm.js";import"../CertificationSidebar/CertificationSummary.esm.js";import"@material-ui/lab";import"../CertificationSidebar/Check.esm.js";import"../CertificationSidebar/LevelSummary.esm.js";import{isDarkTheme as D}from"../Charts/chartUtils.esm.js";import{CheckDetails as $}from"../CheckDetails/CheckDetails.esm.js";import"../CheckDryRun/CheckDryRun.esm.js";import"../SoundcheckDialog/SoundcheckDialog.esm.js";import"../CheckDryRun/CheckDryRunDetails.esm.js";import{CheckDryRunProvider as T}from"../CheckDryRun/CheckDryRunContext.esm.js";import"../CheckForm/utils/checkFormUtils.esm.js";import{NoCertifications as F}from"../EmptyState/EmptyState.esm.js";import{LevelUpParty as L}from"../LevelUpParty/LevelUpParty.esm.js";import{RefetchingIndicator as U}from"../RefetchingIndicator/RefetchingIndicator.esm.js";import{CertificationTabs as j}from"./CertificationTabs.esm.js";import{PlaylistComponent as q}from"./Playlist/PlaylistComponent.esm.js";const c=k(t=>({paper:{overflow:"hidden",position:"relative",border:D(t)?`1px solid ${t.palette.divider}`:void 0},view:{display:"grid",gridTemplateColumns:"1fr 2fr"},sidebar:{borderRight:`1px solid ${t.palette.divider}`}})),z=()=>{const{playlistId:t,trackId:r,checkId:l}=x(),m=c(),{entity:i}=g(),{isError:d,isFetched:f,data:h}=A(i),{isError:E,data:u}=R(i),[p,s]=N({showNotApplicable:!1,showExempt:!1}),y=P(({showNotApplicable:a,showExempt:w})=>{s({showNotApplicable:a,showExempt:w})},[s]);if(d||E)return e.createElement(n,{severity:"error",title:"Error loading certifications"});const o=t&&u?.find(a=>a.id===t);if(t&&!o)return e.createElement(n,{severity:"error",title:"Playlist ${playlistId} not found."});if(f&&!h?.length)return e.createElement(F,null);const v=i?b(i):void 0;return e.createElement(T,null,e.createElement(I,{className:m.paper},e.createElement(U,null),e.createElement(j,{playlistId:t,trackId:r,onSettingsChange:y}),e.createElement(C,null),o&&e.createElement(q,{playlist:o,entityRef:v}),!o&&r&&e.createElement("div",{"data-testid":"soundcheck-certification-view",className:m.view},e.createElement("div",{className:m.sidebar},e.createElement(S,{trackId:r,checkId:l,showNotApplicable:p.showNotApplicable,showExempt:p.showExempt})),e.createElement($,{programId:r,checkId:l}),e.createElement(L,{programId:r}))))};export{z as CertificationsPage,c as useStyles};
2
2
  //# sourceMappingURL=CertificationsPage.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: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};
1
+ import{stringifyEntityRef as p}from"@backstage/catalog-model";import{MarkdownContent as F}from"@backstage/core-components";import{useApi as j,configApiRef as G}from"@backstage/core-plugin-api";import{useEntity as W}from"@backstage/plugin-catalog-react";import{makeStyles as J,Box as o,Typography as m,Divider as k,Button as u,Tooltip as Z}from"@material-ui/core";import{Alert as $}from"@material-ui/lab";import e,{useState as S}from"react";import{ResultState as d}from"../../graphql/generated/index.esm.js";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import"@spotify/backstage-plugin-soundcheck-common";import{useCheckDetails as q}from"../../hooks/checks/useCheckDetails.esm.js";import{useGetChecks as H}from"../../hooks/checks/useGetChecks.esm.js";import"../../hooks/useSoundcheckAlert.esm.js";import{useGetExemption as K}from"../../hooks/exemptions/useGetExemption.esm.js";import"../../hooks/useConfirmationModal.esm.js";import"react-router-dom";import{useSetManualResult as Q}from"../../hooks/checks/useSetManualResult.esm.js";import{AlertPanel as U}from"../AlertPanel/AlertPanel.esm.js";import{CheckResultInputPopup as V}from"../CertificationSidebar/CheckResultInputPopup.esm.js";import{ExemptionJustificationDialog as X}from"../CertificationSidebar/ExemptionJustificationDialog.esm.js";import{RelativeTime as Y}from"../RelativeTime/RelativeTime.esm.js";import{ResultStateBox as _}from"./ResultStateBox.esm.js";import{CheckDetailsSkeleton as ee}from"./skeletons/CheckDetailsSkeleton.esm.js";const l=J(t=>({root:{padding:`${t.spacing(3)}px ${t.spacing(5)}px`},title:{fontWeight:"normal",fontSize:t.typography.h5.fontSize},description:{padding:`${t.spacing(3)}px 0`},subtitle:{fontWeight:"normal",fontSize:t.typography.h6.fontSize},topBar:{display:"flex",justifyContent:"space-between",marginBottom:t.spacing(2)},exemptButton:{marginLeft:t.spacing(1)},exemptAlert:{marginBottom:t.spacing(2)}})),v=({setPopupDisplayed:t})=>{const i=l();return e.createElement(u,{className:i.exemptButton,size:"small",color:"primary",onClick:()=>t(!0),"aria-label":"Set Check Status Button",variant:"contained"},"Set Check Status")},C=({isExempt:t,setPopupDisplayed:i})=>{const a=l();return e.createElement(Z,{title:t?"Remove Exemption":"Set Exempt From Check"},e.createElement(u,{className:a.exemptButton,size:"small",color:"inherit",onClick:()=>i(!0),"aria-label":"Exempt From Check"},t?"Remove Exemption":"Add Exemption"))},te=({programId:t,checkId:i})=>{const a=l(),{entity:n}=W(),{data:f,isLoading:R,isError:B}=q(n,t,i),[b,E]=S(!1),[D,c]=S(!1),{data:r,isLoading:N}=K(p(n),i??""),{data:A}=H({ids:[i??""],first:1}),{mutateAsync:T,isLoading:ie}=Q(),w=j(G).getOptionalStringArray("soundcheck.flags")?.includes("enable-MCE");if(B)return e.createElement(o,{padding:2},e.createElement(U,{severity:"error",title:"Error loading check details"}));if(R||!t||!i)return e.createElement(ee,null);if(!f)return null;const h=A?.edges?.[0]?.node,g=h?.type==="manual",{name:y,description:I,result:s,timestamp:x,details:z}=f,P=async(L,O)=>{if(!n||!i)return;const M=p(n);await T({checkId:i,entityRef:M,justification:O,state:L})};return e.createElement("div",{className:a.root,"data-testid":"check-details-view"},e.createElement("div",{className:a.topBar},e.createElement(m,{variant:"h2",className:a.title},y),e.createElement(o,{display:"flex",alignItems:"center"},x?e.createElement(Y,{timestamp:x,description:"Last updated"}):null,g&&!r?.exemption&&s!==d.NotReported&&e.createElement(v,{setPopupDisplayed:c}),!N&&w&&e.createElement(C,{isExempt:!!r?.exemption,setPopupDisplayed:E}))),e.createElement(X,{entityRef:p(n),checkId:i,isOpen:b,setIsOpen:E}),e.createElement(V,{isOpen:D,setIsOpen:c,setCallback:P}),!r?.exemption&&s===d.Exempt&&e.createElement($,{className:a.exemptAlert,severity:"warning",variant:"outlined"},"This check's exemption for this entity was recently removed. The recent exemption state will clear once the check has been run."),!!r?.exemption&&e.createElement(o,{marginBottom:2},e.createElement(k,null),e.createElement(m,{variant:"h6",color:"textSecondary"},"This entity has been exempted from this check."),e.createElement(k,null)),g&&!r?.exemption&&s===d.NotReported?e.createElement(o,null,e.createElement(m,null,"This check is manual and must have its state set by a user."),e.createElement(o,{marginTop:1},e.createElement(u,{variant:"contained",color:"primary",onClick:()=>c(!0),"aria-label":"Set Result",size:"small"},"Set Check Status"))):e.createElement(e.Fragment,null,e.createElement(m,{className:a.subtitle},"Most Recent Result:"),e.createElement(_,{name:y,state:s,details:z,templateRef:h?.templateRef??void 0})),e.createElement("div",{className:a.description,"data-testid":"soundcheck-check-details-description"},e.createElement(m,{variant:"h3",className:a.subtitle},"Description"),e.createElement(F,{content:I})))};export{te as CheckDetails,C as ExemptDialogButton,v as SetCheckStatusButton,l as useStyles};
2
2
  //# sourceMappingURL=CheckDetails.esm.js.map
@@ -1,2 +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};
1
+ import{TableContainer as d,Paper as u,Table as f,TableBody as E,TableRow as r,TableCell as m,IconButton as g,Collapse as b,Box as C}from"@material-ui/core";import{makeStyles as T}from"@material-ui/core/styles";import w from"@material-ui/icons/KeyboardArrowDown";import v from"@material-ui/icons/KeyboardArrowUp";import{groupBy as y}from"lodash";import e,{useState as B,useMemo as R}from"react";import{findUniqueFacts as k}from"./findUniqueFacts.esm.js";import{ResolvedValueTable as x}from"./ResolvedValueTable.esm.js";const h=T(a=>({tableCell:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:200},selectedRow:{backgroundColor:a.palette.action.hover},factRow:{backgroundColor:a.palette.background.default},factCell:{paddingTop:a.spacing(1.5),paddingBottom:a.spacing(1.5),paddingLeft:`${a.spacing(2)}px !important`},dataCell:{"&::after":{display:"none"}}})),S=({ruleResult:a})=>{const o=h(),[n,c]=B({}),i=R(()=>y(k(a),"factRef"),[a]),p=t=>{c(l=>({...l,[t]:l[t]!==void 0?!l[t]:!1}))};return e.createElement(d,{component:u},e.createElement(f,null,e.createElement(E,null,Object.entries(i).map(([t,l],s)=>e.createElement(e.Fragment,{key:s},e.createElement(r,{className:o.factRow},e.createElement(m,{className:o.factCell},e.createElement(g,{size:"small",onClick:()=>p(t)},n[t]?e.createElement(v,null):e.createElement(w,null)),t)),e.createElement(r,null,e.createElement(m,{className:o.dataCell,style:{paddingBottom:0,paddingTop:0},colSpan:4},e.createElement(b,{in:n[t]===void 0||n[t],timeout:"auto",unmountOnExit:!0},e.createElement(C,{margin:1},e.createElement(x,{values:l}))))))))))};export{S as FactTable};
2
2
  //# sourceMappingURL=FactTable.esm.js.map
@@ -0,0 +1,2 @@
1
+ import{MarkdownContent as o}from"@backstage/core-components";import{Divider as s,Typography as i}from"@material-ui/core";import{JustificationDetailsSchema as u}from"@spotify/backstage-plugin-soundcheck-common";import{DateTime as c}from"luxon";import e from"react";import{EntityChip as p}from"../EntityChip/EntityChip.esm.js";const f=({justification:m,type:n})=>{const r=u.safeParse(m);if(!r.success)return null;const a=r.data,l=c.fromISO(a.timestamp).toFormat("MM/dd/yyyy");let t;switch(n){case"exemption":t="Exemption Details:";break;case"manual":t="Manually Submitted Check Result Details:";break;default:t="Unknown Justification Type";break}return e.createElement("div",null,e.createElement(s,null),e.createElement(i,{variant:"h6"},t),e.createElement("br",null),e.createElement(i,null,e.createElement(p,{entityOrRef:a.submittedBy,style:{}}),"submitted ",n==="exemption"?"an exemption":"a manual result"," on ",l,"."),e.createElement("br",null),e.createElement(i,null,"Reasoning for the ",n==="exemption"?"exemption":"manual result"," ","was:"),e.createElement(o,{content:a.justification}))};export{f as JustificationDetails};
2
+ //# sourceMappingURL=JustificationDetails.esm.js.map
@@ -1,2 +1,2 @@
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};
1
+ import{MarkdownContent as y}from"@backstage/core-components";import{useApi as B,configApiRef as F}from"@backstage/core-plugin-api";import{makeStyles as b,Paper as w,Typography as S,Divider as l,Box as g,Button as A}from"@material-ui/core";import{ToggleButtonGroup as D,ToggleButton as f}from"@material-ui/lab";import{NotesSchema as T}from"@spotify/backstage-plugin-soundcheck-common";import e,{useState as E}from"react";import{ResultState as t}from"../../graphql/generated/index.esm.js";import{CheckIcon as I}from"../CheckIcon/CheckIcon.esm.js";import{CheckResultDetails as P}from"./CheckResultDetails.esm.js";import{FixMeDialog as $}from"./FixMeDialog.esm.js";import{JustificationDetails as x}from"./JustificationDetails.esm.js";import{SelectedValueProvider as j}from"./SelectedValueContext.esm.js";const G=b(o=>({markdownContent:{"& :last-child":{marginBottom:0},"& pre":{background:`${o.palette.background.paper} !important`},"& :first-child":{marginTop:0}},root:{padding:o.spacing(2),display:"flex",flexDirection:"column",gap:o.spacing(1.5)},header:{display:"flex",alignItems:"center",justifyContent:"space-between"},iconContainer:{display:"flex",alignItems:"center"},toggleButtonGroup:{marginLeft:"auto"},toggleButton:{padding:o.spacing(.5),fontSize:o.typography.pxToRem(12)},passed:{},failed:{},warning:{},notReported:{},notApplicable:{},exempt:{},error:{},icon:{marginRight:o.spacing(.5)},divider:{marginTop:o.spacing(.5)}}),{name:"CheckResultStateBox"}),J={[t.Passed]:"Check passed",[t.Failed]:"Check did not pass",[t.Warning]:"Check produced warning(s)",[t.NotReported]:"Check not reported",[t.NotApplicable]:"Check not applicable",[t.Exempt]:"Exempt from check",[t.Error]:"Check encountered an error."},M={[t.Passed]:"passed",[t.Failed]:"failed",[t.Warning]:"warning",[t.NotReported]:"notReported",[t.NotApplicable]:"notApplicable",[t.Exempt]:"exempt",[t.Error]:"error"},O=({name:o,state:r,details:n,templateRef:c})=>{const a=G(),[h,i]=E(!1),[m,v]=E("notes"),k=B(F).getOptionalStringArray("soundcheck.flags")?.includes("enable-fix-me"),s=n&&n.ruleResult,C=()=>{i(!0)},N=()=>{i(!1)},R=(V,u)=>{u!==null&&v(u)},p=n?.notes?T.safeParse(n.notes):void 0,d=p?.success?p.data.data:void 0;return e.createElement(w,{variant:"outlined",className:`${a.root} ${a[M[r]]}`},e.createElement("div",{className:a.header},e.createElement("div",{className:a.iconContainer},e.createElement(I,{className:a.icon,result:r}),e.createElement(S,{variant:"subtitle1"},J[r])),s&&e.createElement(D,{value:m,exclusive:!0,onChange:R,className:a.toggleButtonGroup},e.createElement(f,{value:"notes",className:a.toggleButton},"Notes"),e.createElement(f,{value:"details",className:a.toggleButton},"Details"))),m==="notes"&&e.createElement(e.Fragment,null,n&&n.exemption&&e.createElement(e.Fragment,null,e.createElement(l,{className:a.divider}),e.createElement(x,{justification:n.exemption,type:"exemption"})),n&&n.manualResult&&e.createElement(e.Fragment,null,e.createElement(l,{className:a.divider}),e.createElement(x,{justification:n.manualResult,type:"manual"})),d&&e.createElement(g,{style:{maxHeight:"35vh",overflowY:"auto"}},e.createElement(l,{className:a.divider}),e.createElement(y,{className:a.markdownContent,content:d})),k&&r===t.Failed&&c&&e.createElement(g,{display:"flex",flexDirection:"column",alignItems:"flex-end",mt:2,width:"100%"},e.createElement(A,{color:"primary",variant:"contained",onClick:C},"Fix"),e.createElement($,{title:`Fix ${o}`,open:h,setOpen:i,onClose:N,templateRef:c}))),m==="details"&&e.createElement(e.Fragment,null,s&&e.createElement(e.Fragment,null,e.createElement(l,{className:a.divider}),e.createElement(j,null,e.createElement(P,{ruleResult:n.ruleResult})))))};export{O as ResultStateBox};
2
2
  //# sourceMappingURL=ResultStateBox.esm.js.map
@@ -1,2 +1,2 @@
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};
1
+ import{makeStyles as b,Tooltip as h,Box as o,IconButton as C,CircularProgress as $}from"@material-ui/core";import x from"@material-ui/icons/Refresh";import e,{useState as l,useCallback as D}from"react";import{useExecuteCheck as w}from"../../hooks/checks/useExecuteCheck.esm.js";import{CheckIcon as z}from"../CheckIcon/CheckIcon.esm.js";import"../SoundcheckDialog/SoundcheckDialog.esm.js";import{CheckDryRunDialogButton as B}from"./CheckDryRunDialogButton.esm.js";import"./CheckDryRunDetails.esm.js";import"./CheckDryRunContext.esm.js";import"../CheckForm/utils/checkFormUtils.esm.js";const F=b(()=>({root:{display:"flex",alignItems:"center"},buttonWrapper:{height:24}})),I=({entityRef:n,check:s,refreshFact:c=!1})=>{const{mutateAsync:m}=w(),[r,p]=l(),[i,d]=l(null),[a,u]=l(!1),[k,E]=l(),[y,R]=l(),f=F(),g=D(async()=>{if(a)return;u(!0);const t=await m({entityRef:n,checker:s,dryRun:!0,shouldRefreshFacts:c}).catch(S=>{});t?.details&&d(t.details),t?.facts&&E(t.facts),t?.ruleResults&&R(t.ruleResults),p(t?.result),u(!1)},[s,n,m,a,c]);return e.createElement("div",{className:f.root},r&&e.createElement(h,{arrow:!0,title:`${r}${i?`: ${i}`:""}`,placement:"left"},e.createElement("span",{className:f.buttonWrapper,"aria-label":"check result"},e.createElement(z,{result:r}))),e.createElement(h,{arrow:!0,placement:"top",title:e.createElement(o,null,a?e.createElement(e.Fragment,null,e.createElement(o,null,"Executing dry run..."),e.createElement(o,null,c?"Refreshing facts for dry run can take a significant amount of time.":"Dry run can take additional time if facts are not cached.")):`Dry runs will ${c?"refresh facts":"use cached facts if available"}.`)},e.createElement("span",null,e.createElement(C,{size:"small",color:"inherit",onClick:g,disabled:a,"aria-label":"refresh"},a?e.createElement($,{size:16}):e.createElement(x,{fontSize:"small"})))),r&&e.createElement(B,{entityRef:n,check:s,checkResult:{checkResult:r,details:i},facts:k,ruleResults:y}))};export{I as CheckDryRun};
2
2
  //# sourceMappingURL=CheckDryRun.esm.js.map
@@ -1,2 +1,2 @@
1
- import{makeStyles as p}from"@material-ui/core";import t,{useMemo as n}from"react";import{useGetPathResolvers as m}from"../../../hooks/useGetPathResolvers.esm.js";import{FormControlledAutocomplete as i}from"../../FormControlledAutocomplete/FormControlledAutocomplete.esm.js";import"@material-ui/lab";import"../../ListboxVirtualized/ListboxVirtualized.esm.js";import{FormFieldLabel as c}from"../../FormFieldLabel/FormFieldLabel.esm.js";const d=p(o=>({wrapper:{marginBottom:o.spacing(2)}})),h=({control:o})=>{const a=d(),{data:r,isLoading:l}=m(),s=n(()=>r?.map(e=>e.id),[r]);return t.createElement("div",{className:a.wrapper},t.createElement(c,{title:"Path resolver (Optional)",docLink:"https://backstage.spotify.com/docs/plugins/soundcheck/core-concepts/checks#path-resolvers"}),t.createElement("div",null,t.createElement(i,{control:o,name:"rulesStep.pathResolver",disabled:l,options:s??[],freeSolo:!1,disableClearable:!0,width:250,getOptionLabel:e=>e==="jsonpath"?"jsonpath (default)":e,getOptionValue:e=>e&&e==="jsonpath (default)"?"jsonpath":e??"",placeholder:"path resolver"})))};export{h as CheckPathResolverInput};
1
+ import{makeStyles as s}from"@material-ui/core";import t,{useMemo as m}from"react";import{useGetPathResolvers as i}from"../../../hooks/useGetPathResolvers.esm.js";import{FormControlledAutocomplete as n}from"../../FormControlledAutocomplete/FormControlledAutocomplete.esm.js";import"@material-ui/icons/CheckBox";import"@material-ui/icons/CheckBoxOutlineBlank";import"@material-ui/lab";import"react-hook-form";import"../../ListboxVirtualized/ListboxVirtualized.esm.js";import{FormFieldLabel as c}from"../../FormFieldLabel/FormFieldLabel.esm.js";const d=s(o=>({wrapper:{marginBottom:o.spacing(2)}})),h=({control:o})=>{const a=d(),{data:r,isLoading:l}=i(),p=m(()=>r?.map(e=>e.id),[r]);return t.createElement("div",{className:a.wrapper},t.createElement(c,{title:"Path resolver (Optional)",docLink:"https://backstage.spotify.com/docs/plugins/soundcheck/core-concepts/checks#path-resolvers"}),t.createElement("div",null,t.createElement(n,{control:o,name:"rulesStep.pathResolver",disabled:l,options:p??[],freeSolo:!1,disableClearable:!0,width:250,getOptionLabel:e=>e==="jsonpath"?"jsonpath (default)":e,getOptionValue:e=>e&&e==="jsonpath (default)"?"jsonpath":e??"",placeholder:"path resolver"})))};export{h as CheckPathResolverInput};
2
2
  //# sourceMappingURL=CheckPathResolverInput.esm.js.map
@@ -1,2 +1,2 @@
1
- import{makeStyles as s,Typography as p,Grid as n,FormControlLabel as h,Checkbox as u}from"@material-ui/core";import e from"react";import{useWatch as E,Controller as l}from"react-hook-form";import"../../../Frequency/types.esm.js";import"../../../Frequency/util.esm.js";import{FrequencyComponent as b}from"../../../Frequency/FrequencyComponent.esm.js";import{CHECK_FIELDS as f}from"../../utils/checkFormUtils.esm.js";const C=s(t=>({container:{display:"flex",flexDirection:"column",gap:t.spacing(1)}})),y=({control:t,disabled:o})=>{const c=C(),a=E({control:t,name:"scheduleStep.schedule"}),{description:m,checkboxLabel:i}=f.schedule;return e.createElement("div",{className:c.container},e.createElement(p,{variant:"body2"},m),e.createElement(n,{item:!0,xs:12},e.createElement(n,{item:!0},e.createElement(l,{name:"scheduleStep.schedule.enabled",control:t,render:({field:r})=>e.createElement(h,{disabled:o,control:e.createElement(u,{checked:r.value,onChange:r.onChange}),label:i})})),e.createElement(n,{item:!0},e.createElement(l,{name:"scheduleStep.schedule.frequency",control:t,render:({field:r,fieldState:d})=>e.createElement(b,{disabled:o||!a.enabled,value:r.value,onChange:r.onChange,errors:d.error})}))))};export{y as ScheduleSection};
1
+ import{makeStyles as p,Typography as o,Grid as l,FormControlLabel as E,Checkbox as b}from"@material-ui/core";import e from"react";import{useWatch as f,useFormContext as y,Controller as m}from"react-hook-form";import"../../../Frequency/types.esm.js";import"../../../Frequency/util.esm.js";import{FrequencyComponent as C}from"../../../Frequency/FrequencyComponent.esm.js";import{CHECK_FIELDS as S}from"../../utils/checkFormUtils.esm.js";const v=p(t=>({container:{display:"flex",flexDirection:"column",gap:t.spacing(1)}})),x=({control:t,disabled:r})=>{const n=v(),d=f({control:t,name:"scheduleStep.schedule"}),{watch:s}=y(),c=s("detailsStep.type"),{description:i,checkboxLabel:u}=S.schedule;return e.createElement("div",{className:n.container},c==="manual"&&e.createElement("div",{className:n.container},e.createElement(o,null,"Schedules do not apply to manual checks. These types of checks are meant to be executed manually by users and so cannot be scheduled.")),c!=="manual"&&e.createElement("div",{className:n.container},e.createElement(o,{variant:"body2"},i),e.createElement(l,{item:!0,xs:12},e.createElement(l,{item:!0},e.createElement(m,{name:"scheduleStep.schedule.enabled",control:t,render:({field:a})=>e.createElement(E,{disabled:r,control:e.createElement(b,{checked:a.value,onChange:a.onChange}),label:u})})),e.createElement(l,{item:!0},e.createElement(m,{name:"scheduleStep.schedule.frequency",control:t,render:({field:a,fieldState:h})=>e.createElement(C,{disabled:r||!d.enabled,value:a.value,onChange:a.onChange,errors:h.error})})))))};export{x as ScheduleSection};
2
2
  //# sourceMappingURL=ScheduleSection.esm.js.map
@@ -0,0 +1,2 @@
1
+ import{Box as t,Typography as a}from"@material-ui/core";import e from"react";import{FormControlledSelect as c}from"../../../FormControlledSelect/FormControlledSelect.esm.js";import{CHECK_FIELDS as m}from"../../utils/checkFormUtils.esm.js";const i=({control:l,disabled:o,isLoading:n})=>{const{type:r}=m.details;return e.createElement(t,{marginTop:1},e.createElement(t,null,e.createElement(a,{variant:"subtitle2"},r.name),e.createElement(a,{variant:"caption"},"Choose the type of check. Manual checks have results set by users, not by Soundcheck.")),e.createElement(c,{name:"detailsStep.type",style:{width:250},control:l,disabled:o||n,options:[{value:"default",label:"Default"},{value:"manual",label:"Manual"}]}))};export{i as CheckTypeInput};
2
+ //# sourceMappingURL=CheckTypeInput.esm.js.map
@@ -1,2 +1,2 @@
1
- import{parseEntityRef as v}from"@backstage/catalog-model";import{Typography as y}from"@material-ui/core";import{makeStyles as b}from"@material-ui/core/styles";import{uniqBy as g}from"lodash";import o from"react";import{useFormContext as h}from"react-hook-form";import"../../../../contexts/TrackFormContext.esm.js";import"../../../../contexts/CheckFormContext.esm.js";import"../../../../contexts/CampaignFormContext.esm.js";import{useLoggedInUser as w}from"../../../../contexts/UserProvider.esm.js";import{useGroupOptions as x}from"../../../../hooks/groups/useGroupOptions.esm.js";import{FormControlledAutocomplete as L}from"../../../FormControlledAutocomplete/FormControlledAutocomplete.esm.js";import{useLabelOptions as S}from"../../../FormControlledAutocomplete/useLabelOptions.esm.js";import"@material-ui/lab";import"../../../ListboxVirtualized/ListboxVirtualized.esm.js";import{CHECK_FIELDS as C}from"../../utils/checkFormUtils.esm.js";const R=b(a=>({container:{display:"flex",flexDirection:"column",gap:a.spacing(1)}})),T=({control:a,disabled:l,error:n})=>{const i=R(),{options:p,isLoading:s}=x();let e=g(p.map(m=>({value:m.ref,label:m.name})),"value");const{user:c,userEntityRef:r}=w();r&&(e=[{value:r,label:c?.metadata?.name??r},...e]);const{watch:u}=h(),t=u("detailsStep.ownerEntityRef");t&&r!==t&&!e.some(m=>m.value===t)&&(e=[{value:t,label:v(t).name},...e]);const f=S(e),{owner:{name:d,selectLabel:E}}=C.details;return o.createElement("div",{className:i.container},o.createElement("div",null,o.createElement(y,{variant:"subtitle2"},d)),o.createElement("div",null,o.createElement(L,{freeSolo:!1,name:"detailsStep.ownerEntityRef",control:a,placeholder:E,width:250,helperText:n?.message??void 0,disabled:l||s,...f})))};export{T as TeamDetailsInput};
1
+ import{parseEntityRef as v}from"@backstage/catalog-model";import{Typography as y}from"@material-ui/core";import{makeStyles as b}from"@material-ui/core/styles";import{uniqBy as g}from"lodash";import o from"react";import{useFormContext as h}from"react-hook-form";import"../../../../contexts/TrackFormContext.esm.js";import"../../../../contexts/CheckFormContext.esm.js";import"../../../../contexts/CampaignFormContext.esm.js";import{useLoggedInUser as w}from"../../../../contexts/UserProvider.esm.js";import{useGroupOptions as x}from"../../../../hooks/groups/useGroupOptions.esm.js";import{FormControlledAutocomplete as L}from"../../../FormControlledAutocomplete/FormControlledAutocomplete.esm.js";import"@material-ui/icons/CheckBox";import"@material-ui/icons/CheckBoxOutlineBlank";import"@material-ui/lab";import"../../../ListboxVirtualized/ListboxVirtualized.esm.js";import{useLabelOptions as S}from"../../../FormControlledAutocomplete/useLabelOptions.esm.js";import{CHECK_FIELDS as C}from"../../utils/checkFormUtils.esm.js";const R=b(a=>({container:{display:"flex",flexDirection:"column",gap:a.spacing(1)}})),T=({control:a,disabled:i,error:l})=>{const n=R(),{options:p,isLoading:s}=x();let e=g(p.map(m=>({value:m.ref,label:m.name})),"value");const{user:c,userEntityRef:r}=w();r&&(e=[{value:r,label:c?.metadata?.name??r},...e]);const{watch:u}=h(),t=u("detailsStep.ownerEntityRef");t&&r!==t&&!e.some(m=>m.value===t)&&(e=[{value:t,label:v(t).name},...e]);const f=S(e),{owner:{name:d,selectLabel:E}}=C.details;return o.createElement("div",{className:n.container},o.createElement("div",null,o.createElement(y,{variant:"subtitle2"},d)),o.createElement("div",null,o.createElement(L,{freeSolo:!1,name:"detailsStep.ownerEntityRef",control:a,placeholder:E,width:250,helperText:l?.message??void 0,disabled:i||s,...f})))};export{T as TeamDetailsInput};
2
2
  //# sourceMappingURL=TeamDetailsInput.esm.js.map
@@ -1,2 +1,2 @@
1
- import{makeStyles as p}from"@material-ui/core/styles";import t from"react";import{useFormContext as n}from"react-hook-form";import"../../../contexts/TrackFormContext.esm.js";import{useCheckFormContext as a}from"../../../contexts/CheckFormContext.esm.js";import"../../../contexts/CampaignFormContext.esm.js";import"../../../contexts/UserProvider.esm.js";import{CheckNameInput as s}from"../FormFields/CheckNameInput/CheckNameInput.esm.js";import"../FormFields/PassFailMessageInput/PassFailMessageInput.esm.js";import{CheckDescriptionInput as c}from"../FormFields/CheckDescriptionInput/CheckDescriptionInput.esm.js";import{TeamDetailsInput as l}from"../FormFields/TeamDetailsInput/TeamDetailsInput.esm.js";import"../FormFields/RuleInput/AddMenuButton.esm.js";import"../FormFields/RuleInput/RuleInputBox.esm.js";import"../FormFields/RuleInput/Expressions/ExpressionBox.esm.js";import"../FormFields/RuleInput/Expressions/ExpressionTypeToggle.esm.js";import"@material-ui/core";import"@material-ui/icons/Close";import"@material-ui/icons/Delete";import"@material-ui/icons/List";import"@spotify/backstage-plugin-soundcheck-common";import"@backstage/core-plugin-api";import"@tanstack/react-query";import"../../../api.esm.js";import"@material-ui/icons/Search";import"../../SoundcheckDialog/SoundcheckDialog.esm.js";import"../../FactExplorer/FactExplorer.esm.js";import"../../FactExplorer/FactExplorerContext.esm.js";import"../../FormControlledAutocomplete/FormControlledAutocomplete.esm.js";import"../FormFields/RuleInput/Conditions/styles.esm.js";import"@backstage/catalog-model";import"../../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"../../../hooks/useSoundcheckAlert.esm.js";import"../../../hooks/useConfirmationModal.esm.js";import"react-router-dom";import"../utils/checkFormUtils.esm.js";import"../FormFields/RuleInput/Conditions/ValueListInput.esm.js";import"../FormFields/RuleInput/Conditions/ConditionList.esm.js";import"../FormFields/CheckScheduleSection/ScheduleSection.esm.js";import"../FormFields/CheckPathResolverInput.esm.js";const d=p(r=>({container:{display:"flex",flexDirection:"column",gap:r.spacing(1)}})),f=()=>{const r=d(),{isLoading:m,isReadOnly:o}=a(),{control:i,formState:{errors:e}}=n();return t.createElement("div",{className:r.container},t.createElement(s,{control:i,error:e?.detailsStep?.name,isLoading:m,disabled:o}),t.createElement(c,{control:i,error:e?.detailsStep?.description,isLoading:m,disabled:o}),t.createElement(l,{control:i,disabled:o,error:e?.detailsStep?.ownerEntityRef}))};export{f as CheckDetailsStep};
1
+ import{useApi as n,configApiRef as a}from"@backstage/core-plugin-api";import{makeStyles as s}from"@material-ui/core/styles";import t from"react";import{useFormContext as c}from"react-hook-form";import"../../../contexts/TrackFormContext.esm.js";import{useCheckFormContext as l}from"../../../contexts/CheckFormContext.esm.js";import"../../../contexts/CampaignFormContext.esm.js";import"../../../contexts/UserProvider.esm.js";import{CheckNameInput as d}from"../FormFields/CheckNameInput/CheckNameInput.esm.js";import"../FormFields/PassFailMessageInput/PassFailMessageInput.esm.js";import{CheckDescriptionInput as f}from"../FormFields/CheckDescriptionInput/CheckDescriptionInput.esm.js";import{TeamDetailsInput as u}from"../FormFields/TeamDetailsInput/TeamDetailsInput.esm.js";import"../FormFields/RuleInput/AddMenuButton.esm.js";import"../FormFields/RuleInput/RuleInputBox.esm.js";import"../FormFields/RuleInput/Expressions/ExpressionBox.esm.js";import"../FormFields/RuleInput/Expressions/ExpressionTypeToggle.esm.js";import"@material-ui/core";import"@material-ui/icons/Close";import"@material-ui/icons/Delete";import"@material-ui/icons/List";import"@spotify/backstage-plugin-soundcheck-common";import"@tanstack/react-query";import"../../../api.esm.js";import"@material-ui/icons/Search";import"../../SoundcheckDialog/SoundcheckDialog.esm.js";import"../../FactExplorer/FactExplorer.esm.js";import"../../FactExplorer/FactExplorerContext.esm.js";import"../../FormControlledAutocomplete/FormControlledAutocomplete.esm.js";import"../FormFields/RuleInput/Conditions/styles.esm.js";import"@backstage/catalog-model";import"../../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"../../../hooks/useSoundcheckAlert.esm.js";import"../../../hooks/useConfirmationModal.esm.js";import"react-router-dom";import"../utils/checkFormUtils.esm.js";import"../FormFields/RuleInput/Conditions/ValueListInput.esm.js";import"../FormFields/RuleInput/Conditions/ConditionList.esm.js";import"../FormFields/CheckScheduleSection/ScheduleSection.esm.js";import"../FormFields/CheckPathResolverInput.esm.js";import{CheckTypeInput as g}from"../FormFields/CheckTypeInput/CheckTypeInput.esm.js";const C=s(i=>({container:{display:"flex",flexDirection:"column",gap:i.spacing(1)}})),k=()=>{const i=C(),{isLoading:e,isReadOnly:r}=l(),{control:o,formState:{errors:m}}=c(),p=n(a).getOptionalStringArray("soundcheck.flags")?.includes("enable-MCE");return t.createElement("div",{className:i.container},t.createElement(d,{control:o,error:m?.detailsStep?.name,isLoading:e,disabled:r}),t.createElement(f,{control:o,error:m?.detailsStep?.description,isLoading:e,disabled:r}),t.createElement(u,{control:o,disabled:r,error:m?.detailsStep?.ownerEntityRef}),p&&t.createElement(g,{control:o,disabled:r,isLoading:e}))};export{k as CheckDetailsStep};
2
2
  //# sourceMappingURL=CheckDetailsStep.esm.js.map