@spotify/backstage-plugin-soundcheck 0.14.1 → 0.14.2

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 (49) hide show
  1. package/CHANGELOG.md +15 -12
  2. package/alpha/package.json +1 -1
  3. package/dist/alpha.d.ts +36 -7
  4. package/dist/api.esm.js +1 -1
  5. package/dist/components/CampaignForm/Steps/CampaignDetailsStep/CampaignOwnerField.esm.js +1 -1
  6. package/dist/components/CertificationSidebar/Check.esm.js +1 -1
  7. package/dist/components/CertificationSidebar/CheckResultSummaryList.esm.js +1 -1
  8. package/dist/components/CheckDetails/CheckDetails.esm.js +1 -1
  9. package/dist/components/CheckDetails/CollapseRow.esm.js +2 -0
  10. package/dist/components/CheckDetails/FixMeDialog.esm.js +2 -0
  11. package/dist/components/CheckDetails/OngoingTaskComponent.esm.js +2 -0
  12. package/dist/components/CheckDetails/ResultStateBox.esm.js +1 -1
  13. package/dist/components/CheckDetails/ReviewStateComponent.esm.js +2 -0
  14. package/dist/components/CheckDryRun/CheckDryRunDetails.esm.js +1 -1
  15. package/dist/components/CheckForm/FormFields/RuleInput/Expressions/ExpressionTypeToggle.esm.js +1 -1
  16. package/dist/components/CheckForm/FormFields/TeamDetailsInput/TeamDetailsInput.esm.js +1 -1
  17. package/dist/components/CheckPage/FilterBar/FilterBar.esm.js +1 -1
  18. package/dist/components/ChecksPage/CheckListPage/CheckSummaryCard.esm.js +1 -1
  19. package/dist/components/CollectorPage/Configurators/Configurator.esm.js +1 -1
  20. package/dist/components/CollectorPage/Configurators/Github/GithubConfigurator.esm.js +1 -1
  21. package/dist/components/CollectorPage/Configurators/Gitlab/GitlabConfigurator.esm.js +2 -0
  22. package/dist/components/CollectorPage/Configurators/Gitlab/utils.esm.js +2 -0
  23. package/dist/components/CollectorPage/Configurators/NewRelic/NewRelicConfigurator.esm.js +2 -0
  24. package/dist/components/CollectorPage/Configurators/NewRelic/utils.esm.js +2 -0
  25. package/dist/components/CollectorsPage/CollectorListPage/CollectorLogo.esm.js +1 -1
  26. package/dist/components/CollectorsPage/CollectorListPage/CollectorSummaryCard.esm.js +1 -1
  27. package/dist/components/EntityContent/EntityContent.esm.js +1 -1
  28. package/dist/components/FormFieldLabel/FormFieldLabel.esm.js +1 -1
  29. package/dist/components/GroupSelector/GroupSelector.esm.js +1 -1
  30. package/dist/components/Router.esm.js +1 -1
  31. package/dist/components/RoutingPage/RoutingPage.esm.js +1 -1
  32. package/dist/components/SoundcheckHeader/SoundcheckHeaderContext.esm.js +1 -1
  33. package/dist/components/SoundcheckHeader/useHeader.esm.js +1 -1
  34. package/dist/components/TrackForm/Steps/TrackDetailsStep/TrackOwnerSelect/TrackOwnerSelect.esm.js +1 -1
  35. package/dist/components/TrackPage/FilterBar/FilterBar.esm.js +1 -1
  36. package/dist/components/TrackPage/TrackPage.esm.js +1 -1
  37. package/dist/contexts/UserProvider.esm.js +1 -1
  38. package/dist/graphql/generated/index.esm.js +34 -27
  39. package/dist/hooks/aggregations/useAggregatedTrackPassRateTrend.esm.js +1 -1
  40. package/dist/hooks/checks/useCreateCheck.esm.js +1 -1
  41. package/dist/hooks/checks/useDeleteCheck.esm.js +1 -1
  42. package/dist/hooks/checks/useExecutableChecks.esm.js +2 -0
  43. package/dist/hooks/checks/useUpdateCheck.esm.js +1 -1
  44. package/dist/hooks/graphqlKeys.esm.js +1 -1
  45. package/dist/hooks/groups/useGroupOptions.esm.js +2 -0
  46. package/dist/images/new-relic-rgb.svg +1 -0
  47. package/dist/images/new-relic-white.svg +1 -0
  48. package/package.json +23 -18
  49. package/dist/components/GroupSelector/useOptions.esm.js +0 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @spotify/backstage-plugin-soundcheck
2
2
 
3
+ ## 0.14.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Added No Code UI configuration option for GitLab Fact Collector.
8
+ - Add all groups to track and check insights filter selection.
9
+ - View is now the primary action for checks rather than edit.
10
+ - Custom default title for the header bar can now be set via the title property of the RoutingPage.
11
+ - Added No Code UI configuration option for New Relic Fact Collector.
12
+ - Soundcheck will now only enable the execute check buttons for checks that it can actually execute.
13
+ - Update to Backstage v1.32.0
14
+ - Updated dependencies
15
+ - @spotify/backstage-plugin-soundcheck-common@0.14.2
16
+ - @spotify/backstage-plugin-core@0.8.2
17
+
3
18
  ## 0.14.1
4
19
 
5
20
  ### Patch Changes
@@ -15,10 +30,6 @@
15
30
  - Resolved an issue with searching for campaigns, checks, and tracks by name.
16
31
  - Fix issue with sorting entities on the check insights page.
17
32
  - Add pivot function to overview table to flip x and y axis.
18
- - Updated dependencies
19
- - Updated dependencies
20
- - Updated dependencies
21
- - Updated dependencies
22
33
  - Updated dependencies
23
34
  - @spotify/backstage-plugin-core@0.8.1
24
35
  - @spotify/backstage-plugin-soundcheck-common@0.14.1
@@ -365,10 +376,6 @@
365
376
  - Fixed an issue with the loading state of the library pages in Soundcheck.
366
377
  - Add loading indicator to overview page.
367
378
  - Editable Collectors are now linkable via the following url structure `/collectors/:collectorId`.
368
- - Updated dependencies
369
- - Updated dependencies
370
- - Updated dependencies
371
- - Updated dependencies
372
379
  - Updated dependencies
373
380
  - @spotify/backstage-plugin-soundcheck-common@0.11.0
374
381
  - @spotify/backstage-plugin-core@0.5.9
@@ -389,10 +396,6 @@
389
396
  - Bug fix for switching to the card view on the Tech Health Checks tab.
390
397
  - Checks created through the UI now properly support boolean values.
391
398
  - Resolved an issue that could prevent filters from being applied to Github fact collections configured through the UI.
392
- - Updated dependencies
393
- - Updated dependencies
394
- - Updated dependencies
395
- - Updated dependencies
396
399
  - Updated dependencies
397
400
  - @spotify/backstage-plugin-soundcheck-common@0.10.0
398
401
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spotify/backstage-plugin-soundcheck__alpha",
3
- "version": "0.14.1",
3
+ "version": "0.14.2",
4
4
  "main": "../dist/alpha.esm.js",
5
5
  "module": "../dist/alpha.esm.js",
6
6
  "types": "../dist/alpha.d.ts"
package/dist/alpha.d.ts CHANGED
@@ -12,16 +12,17 @@ import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
12
12
  declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{}, {}, {
13
13
  "api:soundcheck": _backstage_frontend_plugin_api.ExtensionDefinition<{
14
14
  kind: "api";
15
- namespace: undefined;
16
15
  name: undefined;
17
16
  config: {};
18
17
  configInput: {};
19
18
  output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<_backstage_core_plugin_api.AnyApiFactory, "core.api.factory", {}>;
20
19
  inputs: {};
20
+ params: {
21
+ factory: _backstage_core_plugin_api.AnyApiFactory;
22
+ };
21
23
  }>;
22
24
  "entity-content:soundcheck/entity": _backstage_frontend_plugin_api.ExtensionDefinition<{
23
25
  kind: "entity-content";
24
- namespace: undefined;
25
26
  name: "entity";
26
27
  config: {
27
28
  path: string | undefined;
@@ -41,10 +42,16 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{}, {}, {
41
42
  optional: true;
42
43
  }>;
43
44
  inputs: {};
45
+ params: {
46
+ loader: () => Promise<JSX.Element>;
47
+ defaultPath: string;
48
+ defaultTitle: string;
49
+ routeRef?: _backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams> | undefined;
50
+ filter?: string | ((entity: _backstage_catalog_model.Entity) => boolean) | undefined;
51
+ };
44
52
  }>;
45
53
  "nav-item:soundcheck": _backstage_frontend_plugin_api.ExtensionDefinition<{
46
54
  kind: "nav-item";
47
- namespace: undefined;
48
55
  name: undefined;
49
56
  config: {};
50
57
  configInput: {};
@@ -54,10 +61,14 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{}, {}, {
54
61
  routeRef: _backstage_frontend_plugin_api.RouteRef<undefined>;
55
62
  }, "core.nav-item.target", {}>;
56
63
  inputs: {};
64
+ params: {
65
+ title: string;
66
+ icon: _backstage_core_plugin_api.IconComponent;
67
+ routeRef: _backstage_frontend_plugin_api.RouteRef<undefined>;
68
+ };
57
69
  }>;
58
70
  "entity-card:soundcheck/card": _backstage_frontend_plugin_api.ExtensionDefinition<{
59
71
  kind: "entity-card";
60
- namespace: undefined;
61
72
  name: "card";
62
73
  config: {
63
74
  filter: string | undefined;
@@ -71,10 +82,13 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{}, {}, {
71
82
  optional: true;
72
83
  }>;
73
84
  inputs: {};
85
+ params: {
86
+ loader: () => Promise<JSX.Element>;
87
+ filter?: string | ((entity: _backstage_catalog_model.Entity) => boolean) | undefined;
88
+ };
74
89
  }>;
75
90
  "entity-content:soundcheck/group": _backstage_frontend_plugin_api.ExtensionDefinition<{
76
91
  kind: "entity-content";
77
- namespace: undefined;
78
92
  name: "group";
79
93
  config: {
80
94
  path: string | undefined;
@@ -94,10 +108,16 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{}, {}, {
94
108
  optional: true;
95
109
  }>;
96
110
  inputs: {};
111
+ params: {
112
+ loader: () => Promise<JSX.Element>;
113
+ defaultPath: string;
114
+ defaultTitle: string;
115
+ routeRef?: _backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams> | undefined;
116
+ filter?: string | ((entity: _backstage_catalog_model.Entity) => boolean) | undefined;
117
+ };
97
118
  }>;
98
119
  "page:soundcheck/SoundcheckRoutingPage": _backstage_frontend_plugin_api.ExtensionDefinition<{
99
120
  kind: "page";
100
- namespace: undefined;
101
121
  name: "SoundcheckRoutingPage";
102
122
  config: {
103
123
  path: string | undefined;
@@ -109,10 +129,14 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{}, {}, {
109
129
  optional: true;
110
130
  }>;
111
131
  inputs: {};
132
+ params: {
133
+ defaultPath: string;
134
+ loader: () => Promise<JSX.Element>;
135
+ routeRef?: _backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams> | undefined;
136
+ };
112
137
  }>;
113
138
  "page:soundcheck/overview": _backstage_frontend_plugin_api.ExtensionDefinition<{
114
139
  kind: "page";
115
- namespace: undefined;
116
140
  name: "overview";
117
141
  config: {
118
142
  path: string | undefined;
@@ -124,6 +148,11 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{}, {}, {
124
148
  optional: true;
125
149
  }>;
126
150
  inputs: {};
151
+ params: {
152
+ defaultPath: string;
153
+ loader: () => Promise<JSX.Element>;
154
+ routeRef?: _backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams> | undefined;
155
+ };
127
156
  }>;
128
157
  }>;
129
158
 
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 o}from"./graphql/generated/index.esm.js";const u=c({id:"plugin.soundcheck"}),g=r=>"response"in r&&"errors"in r.response,y=r=>"response"in r&&"message"in r.response;class l{#a;#s;#t;constructor(t){this.#a=t.fetchApi,this.#s=t.discoveryApi;const e=new h("/graphql",{fetch:async(a,s)=>{const n=`${await this.#s.getBaseUrl("soundcheck")}${a}`;return this.#a.fetch(n,s)}});this.#t=o(e)}#r=t=>g(t)?t.response?.errors?.[0].message??`${t}`:y(t)?t.response.message:`${t}`;#e=async t=>{try{return await t()}catch(e){throw new Error(`Error from Soundcheck backend: ${this.#r(e)}`)}};async 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{programCertification:a}=await this.#t.getCertificationDetailsForTrack({entityRef:t,programId:e});return a})}async getCheckResultDetails(t,e,a){return this.#e(async()=>{const{checkResult:s}=await this.#t.getCheckResultDetails({entityRef:t,programId:e,checkId:a});return s})}async getFacetsForOwner(t){return this.#e(async()=>{const{facetsForOwner:e}=await this.#t.getFacetsForOwner({ownerEntityRef:t});return e})}async getProgramOverviewForOwner(t,e,a,s,n){return this.#e(async()=>{const{programOverviewForOwner:i}=await this.#t.getProgramOverviewForOwner({ownerEntityRef:t,facet:e,first:a,after:s,entitySearch:n});return i})}async getTracks(t){return this.#e(async()=>{const{programs:e}=await this.#t.getTracks({filter:t});return e})}async createProgram(t){return this.#e(async()=>{const{program:e}=await this.#t.createProgram({input:t});return e})}async updateProgram(t){return this.#e(async()=>{const{program:e}=await this.#t.updateProgram({input:t});return e})}async deleteProgram(t){return this.#e(async()=>{const{programDeleted:e}=await this.#t.deleteProgram({programId: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 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 getCampaignProgress(t,e,a){return this.#e(async()=>{const{campaignProgress:s}=await this.#t.getCampaignProgress({id:t,first:e,after:a});return s})}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 getCheckStatusHistory(t){return this.#e(async()=>(await this.#t.getCheckStatusHistory({input:t})).checkStatusHistory)}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,u 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 o=c({id:"plugin.soundcheck"}),g=r=>"response"in r&&"errors"in r.response,y=r=>"response"in r&&"message"in r.response;class l{#a;#s;#t;constructor(t){this.#a=t.fetchApi,this.#s=t.discoveryApi;const e=new h("/graphql",{fetch:async(a,s)=>{const n=`${await this.#s.getBaseUrl("soundcheck")}${a}`;return this.#a.fetch(n,s)}});this.#t=u(e)}#r=t=>g(t)?t.response?.errors?.[0].message??`${t}`:y(t)?t.response.message:`${t}`;#e=async t=>{try{return await t()}catch(e){throw new Error(`Error from Soundcheck backend: ${this.#r(e)}`)}};async 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{programCertification:a}=await this.#t.getCertificationDetailsForTrack({entityRef:t,programId:e});return a})}async getCheckResultDetails(t,e,a){return this.#e(async()=>{const{checkResult:s}=await this.#t.getCheckResultDetails({entityRef:t,programId:e,checkId:a});return s})}async getFacetsForOwner(t){return this.#e(async()=>{const{facetsForOwner:e}=await this.#t.getFacetsForOwner({ownerEntityRef:t});return e})}async getProgramOverviewForOwner(t,e,a,s,n){return this.#e(async()=>{const{programOverviewForOwner:i}=await this.#t.getProgramOverviewForOwner({ownerEntityRef:t,facet:e,first:a,after:s,entitySearch:n});return i})}async getTracks(t){return this.#e(async()=>{const{programs:e}=await this.#t.getTracks({filter:t});return e})}async createProgram(t){return this.#e(async()=>{const{program:e}=await this.#t.createProgram({input:t});return e})}async updateProgram(t){return this.#e(async()=>{const{program:e}=await this.#t.updateProgram({input:t});return e})}async deleteProgram(t){return this.#e(async()=>{const{programDeleted:e}=await this.#t.deleteProgram({programId: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 getCampaignProgress(t,e,a){return this.#e(async()=>{const{campaignProgress:s}=await this.#t.getCampaignProgress({id:t,first:e,after:a});return s})}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 getCheckStatusHistory(t){return this.#e(async()=>(await this.#t.getCheckStatusHistory({input:t})).checkStatusHistory)}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,o as soundcheckApiRef};
2
2
  //# sourceMappingURL=api.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{FormControlledAutocomplete as v}from"../../../FormControlledAutocomplete/FormControlledAutocomplete.esm.js";import{useLabelOptions as y}from"../../../FormControlledAutocomplete/useLabelOptions.esm.js";import"@material-ui/lab";import"../../../ListboxVirtualized/ListboxVirtualized.esm.js";import{useOptions as b}from"../../../GroupSelector/useOptions.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}=b(),{user:d,userEntityRef:a}=E();let r=g(c?.map(n=>({value:n.ref,label:n.name})),"value");const f=y(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(v,{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 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};
2
2
  //# sourceMappingURL=CampaignOwnerField.esm.js.map
@@ -1,2 +1,2 @@
1
- import{stringifyEntityRef as p}from"@backstage/catalog-model";import{useEntity as b}from"@backstage/plugin-catalog-react";import{makeStyles as v,Typography as z,Tooltip as I,IconButton as T,CircularProgress as x}from"@material-ui/core";import N from"@material-ui/icons/Refresh";import S from"classnames";import e,{useState as F,useMemo as L}from"react";import{Link as w}from"react-router-dom";import"@backstage/core-plugin-api";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import{useGetChecks as A}from"../../hooks/checks/useGetChecks.esm.js";import"../../hooks/useSoundcheckAlert.esm.js";import"../../hooks/useConfirmationModal.esm.js";import{useExecuteCheck as B}from"../../hooks/checks/useExecuteCheck.esm.js";import"../CheckDryRun/CheckDryRun.esm.js";import"../SoundcheckDialog/SoundcheckDialog.esm.js";import{CheckDryRunDialogButton as D}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 $}from"../CheckIcon/CheckIcon.esm.js";import{RelativeTime as H}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}}})),M=({className:t,href:a,name:r,children:m})=>a?e.createElement(w,{"aria-label":`select check ${r}`,to:a,className:t},m):e.createElement("div",{className:t},m),P=({result:t,name:a,id:r,timestamp:m,hasChecker:h=!1,selected:f=!1,href:k})=>{const g=d(),E=S(g.root,{selected:f}),{entity:i}=b(),{mutateAsync:C,isLoading:l}=B(),[o,y]=F(),{data:n}=A({ids:r?[r]:[]},!!o),s=L(()=>{const c=n?.edges?.[0]?.node;return c?G(c):null},[n?.edges]),R=async()=>{if(!i||!r)return;const c=await C({checkerId:r,entityRef:p(i),shouldRefreshFacts:!0}).catch(j=>{});c&&y(c)},u=!i||!r||!h;return e.createElement(M,{href:k,className:E,name:a},e.createElement($,{result:t}),e.createElement(z,{variant:"body2"},a),m&&!l?e.createElement(H,{timestamp:m}):null,!l&&e.createElement(e.Fragment,null,e.createElement(I,{title:"Execute Check",disableHoverListener:u},e.createElement("span",null,e.createElement(T,{size:"small",color:"inherit",onClick:R,disabled:u,"aria-label":"Execute Check"},e.createElement(N,{fontSize:"small"})))),!!o&&!!s&&e.createElement(D,{entityRef:p(i),check:s,checkResult:{checkResult:o.result,notes:o.details?.notes?.data??""},facts:o.facts,ruleResults:o.ruleResults,size:"small"})),l&&e.createElement(x,{color:"inherit",size:"1em"}))};export{P 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 v,Typography as x,Tooltip as z,IconButton as I,CircularProgress as T}from"@material-ui/core";import N from"@material-ui/icons/Refresh";import S from"classnames";import e,{useState as F,useMemo as L}from"react";import{Link as w}from"react-router-dom";import"@backstage/core-plugin-api";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import{useGetChecks as A}from"../../hooks/checks/useGetChecks.esm.js";import"../../hooks/useSoundcheckAlert.esm.js";import"../../hooks/useConfirmationModal.esm.js";import{useExecuteCheck as B}from"../../hooks/checks/useExecuteCheck.esm.js";import"../CheckDryRun/CheckDryRun.esm.js";import"../SoundcheckDialog/SoundcheckDialog.esm.js";import{CheckDryRunDialogButton as D}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 $}from"../CheckIcon/CheckIcon.esm.js";import{RelativeTime as H}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}}})),M=({className:t,href:a,name:r,children:m})=>a?e.createElement(w,{"aria-label":`select check ${r}`,to:a,className:t},m):e.createElement("div",{className:t},m),P=({result:t,name:a,id:r,timestamp:m,isExecutable:h=!1,selected:f=!1,href:g})=>{const k=d(),E=S(k.root,{selected:f}),{entity:i}=b(),{mutateAsync:y,isLoading:l}=B(),[o,C]=F(),{data:n}=A({ids:r?[r]:[]},!!o),s=L(()=>{const c=n?.edges?.[0]?.node;return c?G(c):null},[n?.edges]),R=async()=>{if(!i||!r)return;const c=await y({checkerId:r,entityRef:p(i),shouldRefreshFacts:!0}).catch(j=>{});c&&C(c)},u=!i||!r||!h;return e.createElement(M,{href:g,className:E,name:a},e.createElement($,{result:t}),e.createElement(x,{variant:"body2"},a),m&&!l?e.createElement(H,{timestamp:m}):null,!l&&e.createElement(e.Fragment,null,e.createElement(z,{title:"Execute Check",disableHoverListener:u},e.createElement("span",null,e.createElement(I,{size:"small",color:"inherit",onClick:R,disabled:u,"aria-label":"Execute Check"},e.createElement(N,{fontSize:"small"})))),!!o&&!!s&&e.createElement(D,{entityRef:p(i),check:s,checkResult:{checkResult:o.result,notes:o.details?.notes?.data??""},facts:o.facts,ruleResults:o.ruleResults,size:"small"})),l&&e.createElement(T,{color:"inherit",size:"1em"}))};export{P as Check,d as useStyles};
2
2
  //# sourceMappingURL=Check.esm.js.map
@@ -1,2 +1,2 @@
1
- import{useRouteRef as a}from"@backstage/core-plugin-api";import{makeStyles as h,Typography as f}from"@material-ui/core";import o from"react";import"@backstage/catalog-model";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import{useGetChecks as y}from"../../hooks/checks/useGetChecks.esm.js";import"../../hooks/useSoundcheckAlert.esm.js";import"../../hooks/useConfirmationModal.esm.js";import"react-router-dom";import{certificationRouteRef as u,certificationPlaylistTrackCheckRouteRef as I}from"../../routes.esm.js";import{Check as g}from"./Check.esm.js";const m=h(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"}}})),C=({checks:e,playlistId:c,trackId:i,checkId:l})=>{const r=m(),p=a(u),s=a(I),{data:d,isLoading:n}=y({ids:e.map(t=>t.id)});return e.length?o.createElement("ul",{className:r.checks},e.map(t=>o.createElement("li",{key:t.id,className:r.checkItem},o.createElement(g,{...t,hasChecker:!n&&(d?.edges??[]).map(k=>k.node.id).includes(t.id),selected:t.id===l,href:c?s({playlistId:c,trackId:i,checkId:t.id}):p({trackId:i,checkId:t.id})})))):o.createElement(f,{variant:"body2",className:r.noChecks},"No applicable checks at this level.")};export{C as CheckResultSummaryList,m as useStyles};
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};
2
2
  //# sourceMappingURL=CheckResultSummaryList.esm.js.map
@@ -1,2 +1,2 @@
1
- import{MarkdownContent as u}from"@backstage/core-components";import{useEntity as g}from"@backstage/plugin-catalog-react";import{makeStyles as E,Box as y,Typography as n}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{useCheckDetails as k}from"../../hooks/checks/useCheckDetails.esm.js";import"../../hooks/useSoundcheckAlert.esm.js";import"../../hooks/useConfirmationModal.esm.js";import"react-router-dom";import{AlertPanel as v}from"../AlertPanel/AlertPanel.esm.js";import{RelativeTime as S}from"../RelativeTime/RelativeTime.esm.js";import{ResultStateBox as x}from"./ResultStateBox.esm.js";import{CheckDetailsSkeleton as B}from"./skeletons/CheckDetailsSkeleton.esm.js";const m=E(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)}})),C=({programId:e,checkId:i})=>{const r=m(),{entity:s}=g(),{data:o,isLoading:p,isError:l}=k(s,e,i);if(l)return t.createElement(y,{padding:2},t.createElement(v,{severity:"error",title:"Error loading check details"}));if(p||!e||!i)return t.createElement(B,null);if(!o)return null;const{name:c,description:d,result:f,timestamp:a,notes:h}=o;return t.createElement("div",{className:r.root,"data-testid":"check-details-view"},t.createElement("div",{className:r.topBar},t.createElement(n,{variant:"h2",className:r.title},c),a?t.createElement(S,{timestamp:a,description:"Last updated"}):null),t.createElement(x,{state:f,notes:h}),t.createElement("div",{className:r.description,"data-testid":"soundcheck-check-details-description"},t.createElement(n,{variant:"h3",className:r.subtitle},"Description"),t.createElement(u,{content:d})))};export{C as CheckDetails,m as useStyles};
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{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,notes: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,notes:h,templateRef:f?.templateRef??void 0}),t.createElement("div",{className:i.description,"data-testid":"soundcheck-check-details-description"},t.createElement(m,{variant:"h3",className:i.subtitle},"Description"),t.createElement(E,{content:u})))};export{D as CheckDetails,s as useStyles};
2
2
  //# sourceMappingURL=CheckDetails.esm.js.map
@@ -0,0 +1,2 @@
1
+ import{TableRow as t,TableCell as n,IconButton as i,Collapse as c}from"@material-ui/core";import p from"@material-ui/icons/KeyboardArrowDown";import u from"@material-ui/icons/KeyboardArrowUp";import e,{useState as s}from"react";const d=({title:a,children:o,defaultOpen:m=!0})=>{const[l,r]=s(m);return e.createElement(e.Fragment,null,e.createElement(t,null,e.createElement(n,{colSpan:2,padding:"normal",align:"left",size:"small"},e.createElement(i,{"aria-label":"expand row",size:"small",onClick:()=>r(!l)},l?e.createElement(u,null):e.createElement(p,null)),e.createElement("strong",null,a))),e.createElement(t,null,e.createElement(n,{style:{paddingBottom:0,paddingTop:0},colSpan:2,padding:"normal",align:"left",size:"small"},e.createElement(c,{in:l,timeout:"auto",unmountOnExit:!0},o))))};export{d as CollapseRow};
2
+ //# sourceMappingURL=CollapseRow.esm.js.map
@@ -0,0 +1,2 @@
1
+ import{Progress as L}from"@backstage/core-components";import{useApi as u,errorApiRef as R}from"@backstage/core-plugin-api";import{useEntity as T}from"@backstage/plugin-catalog-react";import{scaffolderApiRef as b,useTemplateSecrets as I,useCustomFieldExtensions as B}from"@backstage/plugin-scaffolder-react";import{useTemplateParameterSchema as D,useFilteredSchemaProperties as F,Stepper as O}from"@backstage/plugin-scaffolder-react/alpha";import{makeStyles as P,Dialog as U,DialogTitle as A,Typography as N,IconButton as W,DialogContent as j}from"@material-ui/core";import G from"@material-ui/icons/Close";import J from"git-url-parse";import t,{useState as K,useEffect as M}from"react";import{useOutlet as Q}from"react-router-dom";import{OngoingTaskComponent as q}from"./OngoingTaskComponent.esm.js";import{ReviewStateComponent as z}from"./ReviewStateComponent.esm.js";class d{type;name;owner;lifecycle;title;description;sourceLocation;managedByLocation;slackChannel;entity;constructor(e){this.lifecycle=e.spec?.lifecycle||"unknown",this.name=e.metadata.name,this.owner=e.spec?.owner||"unknown",this.type=e.spec?.type||"unknown",this.title=e.metadata.title,this.description=e.metadata.description||"",this.sourceLocation=e.metadata.annotations?.["backstage.io/source-location"]?.replace("url:",""),this.managedByLocation=e.metadata.annotations?.["backstage.io/managed-by-location"],this.slackChannel=e.metadata.annotations?.["spotify.net/slack-channel"],this.entity=e}}const H=o=>{const e={};if(e.componentId=o.name,o.sourceLocation){const{name:n,owner:a,protocol:r,source:i}=J(o.sourceLocation);e.repoUrl=`${r}://${i}/${a}/${n}`,e.repo={host:i,org:a,repo:n,url:e.repoUrl,gitUrl:`git@${i}:${a}/${n}.git`,paramUrl:`${r}://${i}?owner=${a}&repo=${n}`}}e.facts=JSON.parse(o.entity.metadata.annotations?.["sysmodel.spotify.net/raw-component-facts"]||"{}");const s=o;return delete s.entity,{...e,...s}},V=P({titleContent:{display:"flex",justifyContent:"space-between",alignItems:"center"}}),X=o=>{const{title:e,open:s,setOpen:n,onClose:a,templateRef:r}=o,i=V(),c=u(R),y=u(b),{loading:g,manifest:h,error:l}=D(r),{secrets:w}=I(),E=Q(),k=B(E),m=F(h),{entity:C}=T(),[p,f]=K(void 0),$=async x=>{const{taskId:v}=await y.scaffold({templateRef:r,values:x,secrets:w});f(v)},S=()=>{n(!1),f(void 0)};return M(()=>{l&&c.post(new Error(`Failed to load template, ${l}`))},[l,c]),t.createElement(U,{open:s,onClose:a,fullWidth:!0,maxWidth:"md"},t.createElement(A,null,t.createElement("div",{className:i.titleContent},t.createElement(N,{variant:"h5"},e),t.createElement(W,{onClick:S},t.createElement(G,null)))),t.createElement(j,null,g&&t.createElement(L,null),p?t.createElement(q,{taskId:p}):m&&t.createElement(O,{manifest:m,onCreate:$,extensions:k,components:{createButtonText:"Execute",ReviewStateComponent:z},initialState:{backstage:H(new d(C))},...o})))};export{X as FixMeDialog,d as SimplifiedEntity};
2
+ //# sourceMappingURL=FixMeDialog.esm.js.map
@@ -0,0 +1,2 @@
1
+ import{Content as l,ErrorPanel as i}from"@backstage/core-components";import{useTaskEventStream as c}from"@backstage/plugin-scaffolder-react";import{TaskSteps as u,DefaultTemplateOutputs as f}from"@backstage/plugin-scaffolder-react/alpha";import{makeStyles as E,Box as n}from"@material-ui/core";import r,{useMemo as m}from"react";const d=E({contentWrapper:{display:"flex",flexDirection:"column"}}),k=s=>{const e=c(s.taskId),o=m(()=>e.task?.spec.steps.map(t=>({...t,...e?.steps?.[t.id]}))??[],[e]),p=m(()=>{for(let t=o.length-1;t>=0;t--)if(o[t].status!=="open")return t;return 0},[o]),a=d();return r.createElement(l,{className:a.contentWrapper},e.error?r.createElement(n,{paddingBottom:2},r.createElement(i,{error:e.error,title:e.error.message})):null,r.createElement(n,{paddingBottom:2},r.createElement(u,{steps:o,activeStep:p,isComplete:e.completed,isError:!!e.error})),r.createElement(f,{output:e.output}))};export{k as OngoingTaskComponent};
2
+ //# sourceMappingURL=OngoingTaskComponent.esm.js.map
@@ -1,2 +1,2 @@
1
- import{MarkdownContent as l}from"@backstage/core-components";import{makeStyles as m,useTheme as s,Paper as c,Typography as d}from"@material-ui/core";import g from"@material-ui/icons/CheckCircleOutlined";import u from"@material-ui/icons/ErrorOutline";import n from"@material-ui/icons/InfoOutlined";import k from"@material-ui/icons/RemoveCircleOutline";import f from"@material-ui/icons/WarningOutlined";import a from"react";import{ResultState as e}from"../../graphql/generated/index.esm.js";const C=m(t=>({markdownContent:{"& :last-child":{marginBottom:0},"& pre":{background:`${t.palette.background.paper} !important`}},root:{padding:t.spacing(2),display:"flex",gap:t.spacing(1.5)},iconContainer:{marginTop:1},passed:{},failed:{},warning:{},notReported:{},notApplicable:{},error:{},icon:{}}),{name:"CheckResultStateBox"}),N={[e.Passed]:g,[e.Failed]:u,[e.Warning]:f,[e.NotReported]:n,[e.NotApplicable]:n,[e.Error]:k},b={[e.Passed]:"Check passed",[e.Failed]:"Check did not pass",[e.Warning]:"Check produced warning(s)",[e.NotReported]:"Check not reported",[e.NotApplicable]:"Check not applicable",[e.Error]:"Check encountered an error."},h={[e.Passed]:"passed",[e.Failed]:"failed",[e.Warning]:"warning",[e.NotReported]:"notReported",[e.NotApplicable]:"notApplicable",[e.Error]:"error"},E=(t,r)=>({[e.Passed]:r.palette.success.main,[e.Failed]:r.palette.error.main,[e.Warning]:r.palette.warning.main,[e.NotReported]:r.palette.text.primary,[e.NotApplicable]:r.palette.text.primary,[e.Error]:r.palette.error.main})[t],R=({state:t,notes:r})=>{const o=C(),i=s(),p=N[t]??n;return a.createElement(c,{variant:"outlined",className:`${o.root} ${o[h[t]]}`},a.createElement("div",{className:o.iconContainer},a.createElement(p,{className:o.icon,htmlColor:E(t,i)})),a.createElement("div",null,a.createElement(d,{variant:"subtitle1"},b[t]),r?a.createElement(l,{className:o.markdownContent,content:r}):null))};export{R as ResultStateBox};
1
+ import{MarkdownContent as u}from"@backstage/core-components";import{useApi as k,configApiRef as C}from"@backstage/core-plugin-api";import{makeStyles as h,useTheme as x,Paper as E,Typography as R,Box as N,Button as b}from"@material-ui/core";import y from"@material-ui/icons/CheckCircleOutlined";import w from"@material-ui/icons/ErrorOutline";import i from"@material-ui/icons/InfoOutlined";import A from"@material-ui/icons/RemoveCircleOutline";import F from"@material-ui/icons/WarningOutlined";import r,{useState as S}from"react";import{ResultState as e}from"../../graphql/generated/index.esm.js";import{FixMeDialog as v}from"./FixMeDialog.esm.js";const B=h(a=>({markdownContent:{"& :last-child":{marginBottom:0},"& pre":{background:`${a.palette.background.paper} !important`}},root:{padding:a.spacing(2),display:"flex",gap:a.spacing(1.5)},iconContainer:{marginTop:1},passed:{},failed:{},warning:{},notReported:{},notApplicable:{},error:{},icon:{}}),{name:"CheckResultStateBox"}),P={[e.Passed]:y,[e.Failed]:w,[e.Warning]:F,[e.NotReported]:i,[e.NotApplicable]:i,[e.Error]:A},W={[e.Passed]:"Check passed",[e.Failed]:"Check did not pass",[e.Warning]:"Check produced warning(s)",[e.NotReported]:"Check not reported",[e.NotApplicable]:"Check not applicable",[e.Error]:"Check encountered an error."},$={[e.Passed]:"passed",[e.Failed]:"failed",[e.Warning]:"warning",[e.NotReported]:"notReported",[e.NotApplicable]:"notApplicable",[e.Error]:"error"},O=(a,t)=>({[e.Passed]:t.palette.success.main,[e.Failed]:t.palette.error.main,[e.Warning]:t.palette.warning.main,[e.NotReported]:t.palette.text.primary,[e.NotApplicable]:t.palette.text.primary,[e.Error]:t.palette.error.main})[a],T=({name:a,state:t,notes:l,templateRef:p})=>{const n=B(),m=x(),c=P[t]??i,[s,o]=S(!1),d=k(C).getOptionalStringArray("soundcheck.flags")?.includes("enable-fix-me"),g=()=>{o(!0)},f=()=>{o(!1)};return r.createElement(E,{variant:"outlined",className:`${n.root} ${n[$[t]]}`},r.createElement("div",{className:n.iconContainer},r.createElement(c,{className:n.icon,htmlColor:O(t,m)})),r.createElement("div",{style:{width:"100%"}},r.createElement(R,{variant:"subtitle1"},W[t]),l?r.createElement(u,{className:n.markdownContent,content:l}):null,d&&t===e.Failed&&p&&r.createElement(N,{display:"flex",flexDirection:"column",alignItems:"flex-end",mt:2,width:"100%"},r.createElement(b,{color:"primary",variant:"contained",onClick:g},"Fix"),r.createElement(v,{title:`Fix ${a}`,open:s,setOpen:o,onClose:f,templateRef:p}))))};export{T as ResultStateBox};
2
2
  //# sourceMappingURL=ResultStateBox.esm.js.map
@@ -0,0 +1,2 @@
1
+ import{useTheme as u,Typography as r,TableContainer as E,Table as o,TableBody as m,TableRow as d,TableCell as i}from"@material-ui/core";import{styled as f}from"@mui/styles";import e from"react";import{CollapseRow as c}from"./CollapseRow.esm.js";const s=f("pre")({fontSize:".9em",lineHeight:"1.6",maxHeight:"250px",width:"100%",overflow:"scroll"}),b=n=>{const p=u(),t={...n.formState};delete t.backstage;const g={...n.formState.backstage};return e.createElement(e.Fragment,null,e.createElement(r,{variant:"h6",style:{marginBottom:31}},"The codemod will run with the following input:"),e.createElement(E,null,e.createElement(o,{"aria-label":"collapsible table"},e.createElement(m,null,e.createElement(c,{title:"Context",defaultOpen:!1},e.createElement(s,null,JSON.stringify(g,null,2))),Object.keys(t).length>0&&e.createElement(c,{title:"Input"},e.createElement("div",{style:{width:"auto",paddingTop:p.spacing(1),alignContent:"center"}},e.createElement(o,{style:{width:"100%"}},e.createElement(m,null,Object.entries(t).map(([a,l])=>e.createElement(d,{key:a},e.createElement(i,{padding:"normal",align:"left",size:"small"},e.createElement("strong",null,a)),e.createElement(i,{padding:"normal",align:"left",size:"small"},typeof l=="object"?e.createElement(s,null,JSON.stringify(l,null,2)):e.createElement(r,null,l?.toString()))))))))))))};export{b as ReviewStateComponent};
2
+ //# sourceMappingURL=ReviewStateComponent.esm.js.map
@@ -1,2 +1,2 @@
1
- import{EntityRefLink as b}from"@backstage/plugin-catalog-react";import{makeStyles as S,Box as c,Typography as a,Divider as f,Grid as l}from"@material-ui/core";import{parseFactRef as N,getRuleHash as k}from"@spotify/backstage-plugin-soundcheck-common";import e from"react";import{ResultState as R}from"../../graphql/generated/index.esm.js";import{ResultStateBox as B}from"../CheckDetails/ResultStateBox.esm.js";import{ExpressionTypeReadableMap as F,ExpressionType as T}from"../CheckForm/types/ExpressionType.esm.js";import"../Frequency/types.esm.js";import"../Frequency/util.esm.js";import"../Frequency/FrequencyComponent.esm.js";import"../CheckForm/types/Path.esm.js";import{mapRuleToExpression as P}from"../CheckForm/utils/checkFormUtils.esm.js";import{CheckIcon as w}from"../CheckIcon/CheckIcon.esm.js";import{ExpandableSection as z}from"../ExpandableSection/ExpandableSection.esm.js";import{FormattedPreview as x}from"../FormattedPreview/FormattedPreview.esm.js";const v=S(t=>({dryRunRoot:{padding:t.spacing(2)},dryRunSection:{marginBottom:t.spacing(2)},rulesSection:{padding:t.spacing(2),margin:0,width:"100%"},resultBox:{fontSize:t.typography.body1.fontSize},factBox:{padding:0,border:`1px solid ${t.palette.divider}`,overflow:"auto",fontSize:t.typography.body2.fontSize,maxHeight:500},nested:{margin:t.spacing(3)},expressionType:{padding:t.spacing(1,2)},expressionWrapper:{border:`1px solid ${t.palette.divider}`,marginBottom:t.spacing(2)},resultDisplay:{display:"flex",alignItems:"center"},resultIcon:{marginRight:t.spacing(.25)},ownerLink:{"& span":{"&:hover":{textDecoration:"underline"}},fontSize:t.typography.body1.fontSize},valueBox:{maxHeight:500,overflow:"auto"}})),D=({passed:t})=>{const n=v();return e.createElement(a,{variant:"body1",className:n.resultDisplay},e.createElement(w,{className:n.resultIcon,result:t?R.Passed:R.Failed})," ",t?"Passed":"Failed")},g=({check:t,expression:n,facts:i,ruleResults:m})=>{const o=v();return e.createElement(e.Fragment,null,e.createElement(c,{className:o.expressionWrapper},e.createElement(a,{className:o.expressionType,variant:"subtitle1"},F[n.expressionType??T.AllOf]),n.conditions?.map((r,s)=>{const p=r.operatorPrefix?`${r.operatorPrefix}:${r.operator}`:r.operator,d=N(r.factRef),y=i?.find(E=>E.factRef===r.factRef),h=k({factRef:d,value:r.value,operator:p,path:r.path}),u=m?.find(E=>E.name===h);return e.createElement("div",{key:`expression-${s}`},e.createElement(f,{variant:"middle"}),e.createElement(l,{container:!0,className:o.rulesSection,spacing:2},e.createElement(l,{item:!0,xs:6},e.createElement(a,{variant:"subtitle2",color:"textSecondary"},"Integration"),e.createElement(a,{variant:"body1"},d.source)),e.createElement(l,{item:!0,xs:6},e.createElement(a,{variant:"subtitle2",color:"textSecondary"},"Fact"),e.createElement(a,{variant:"body1"},d.name)),t?.pathResolver&&e.createElement(l,{item:!0,xs:6},e.createElement(a,{variant:"subtitle2",color:"textSecondary"},"Path Resolver"),e.createElement(a,{variant:"body1"},t.pathResolver)),e.createElement(l,{item:!0,xs:6},e.createElement(a,{variant:"subtitle2",color:"textSecondary"},"Path"),e.createElement(a,{variant:"body1"},r.path)),e.createElement(l,{item:!0,xs:6},e.createElement(a,{variant:"subtitle2",color:"textSecondary"},"Operator"),e.createElement(a,{variant:"body1"},p)),u?.result!==void 0&&e.createElement(l,{item:!0,xs:6},e.createElement(a,{variant:"subtitle2",color:"textSecondary"},"Result"),e.createElement(D,{passed:u.result})),e.createElement(l,{item:!0,xs:12},e.createElement(a,{variant:"subtitle2",color:"textSecondary"},"Expected"),e.createElement(a,{component:"div",variant:"body2",className:o.valueBox},e.createElement(x,{data:r?.value}))),e.createElement(l,{item:!0,xs:12},e.createElement(a,{variant:"subtitle2",color:"textSecondary"},"Resolved Value"),e.createElement(a,{component:"div",variant:"body2",className:o.valueBox},e.createElement(x,{data:u?.factResult}))),!!y&&e.createElement(l,{item:!0,xs:12},e.createElement(z,{elevation:0,title:"Related Fact"},e.createElement("div",{className:o.factBox},e.createElement(x,{data:y.data}))))))}),!!n?.expressions&&e.createElement(e.Fragment,null,e.createElement(f,{variant:"middle"}),e.createElement(c,{className:o.nested},n?.expressions?.map((r,s)=>e.createElement(g,{check:t,facts:i,ruleResults:m,expression:r,key:`nested-expression-${s}`}))))))},I=({entityRef:t,check:n,checkResult:i,notes:m,facts:o,ruleResults:r})=>{const s=v(),p=P(n?.rule);return e.createElement(c,{className:s.dryRunRoot},e.createElement(c,{className:s.dryRunSection},t&&e.createElement(e.Fragment,null,e.createElement(a,{variant:"h5"},"Entity"),e.createElement(a,{variant:"body1"},e.createElement(b,{className:s.ownerLink,entityRef:t})))),e.createElement(c,{className:s.dryRunSection},e.createElement(a,{variant:"h5"},"Check Result"),e.createElement("div",{className:s.resultBox},i?e.createElement(B,{state:i,notes:m}):"No Results")),e.createElement(a,{variant:"h5"},"Rules"),e.createElement(g,{check:n,facts:o,ruleResults:r,expression:p}))};export{I as CheckDryRunDetails};
1
+ import{EntityRefLink as b}from"@backstage/plugin-catalog-react";import{makeStyles as S,Box as c,Typography as a,Divider as f,Grid as l}from"@material-ui/core";import{parseFactRef as N,getRuleHash as k}from"@spotify/backstage-plugin-soundcheck-common";import e from"react";import{ResultState as R}from"../../graphql/generated/index.esm.js";import{ResultStateBox as B}from"../CheckDetails/ResultStateBox.esm.js";import{ExpressionTypeReadableMap as F,ExpressionType as T}from"../CheckForm/types/ExpressionType.esm.js";import"../Frequency/types.esm.js";import"../Frequency/util.esm.js";import"../Frequency/FrequencyComponent.esm.js";import"../CheckForm/types/Path.esm.js";import{mapRuleToExpression as P}from"../CheckForm/utils/checkFormUtils.esm.js";import{CheckIcon as w}from"../CheckIcon/CheckIcon.esm.js";import{ExpandableSection as z}from"../ExpandableSection/ExpandableSection.esm.js";import{FormattedPreview as x}from"../FormattedPreview/FormattedPreview.esm.js";const v=S(t=>({dryRunRoot:{padding:t.spacing(2)},dryRunSection:{marginBottom:t.spacing(2)},rulesSection:{padding:t.spacing(2),margin:0,width:"100%"},resultBox:{fontSize:t.typography.body1.fontSize},factBox:{padding:0,border:`1px solid ${t.palette.divider}`,overflow:"auto",fontSize:t.typography.body2.fontSize,maxHeight:500},nested:{margin:t.spacing(3)},expressionType:{padding:t.spacing(1,2)},expressionWrapper:{border:`1px solid ${t.palette.divider}`,marginBottom:t.spacing(2)},resultDisplay:{display:"flex",alignItems:"center"},resultIcon:{marginRight:t.spacing(.25)},ownerLink:{"& span":{"&:hover":{textDecoration:"underline"}},fontSize:t.typography.body1.fontSize},valueBox:{maxHeight:500,overflow:"auto"}})),D=({passed:t})=>{const n=v();return e.createElement(a,{variant:"body1",className:n.resultDisplay},e.createElement(w,{className:n.resultIcon,result:t?R.Passed:R.Failed})," ",t?"Passed":"Failed")},g=({check:t,expression:n,facts:i,ruleResults:m})=>{const o=v();return e.createElement(e.Fragment,null,e.createElement(c,{className:o.expressionWrapper},e.createElement(a,{className:o.expressionType,variant:"subtitle1"},F[n.expressionType??T.AllOf]),n.conditions?.map((r,s)=>{const p=r.operatorPrefix?`${r.operatorPrefix}:${r.operator}`:r.operator,d=N(r.factRef),y=i?.find(E=>E.factRef===r.factRef),h=k({factRef:d,value:r.value,operator:p,path:r.path}),u=m?.find(E=>E.name===h);return e.createElement("div",{key:`expression-${s}`},e.createElement(f,{variant:"middle"}),e.createElement(l,{container:!0,className:o.rulesSection,spacing:2},e.createElement(l,{item:!0,xs:6},e.createElement(a,{variant:"subtitle2",color:"textSecondary"},"Integration"),e.createElement(a,{variant:"body1"},d.source)),e.createElement(l,{item:!0,xs:6},e.createElement(a,{variant:"subtitle2",color:"textSecondary"},"Fact"),e.createElement(a,{variant:"body1"},d.name)),t?.pathResolver&&e.createElement(l,{item:!0,xs:6},e.createElement(a,{variant:"subtitle2",color:"textSecondary"},"Path Resolver"),e.createElement(a,{variant:"body1"},t.pathResolver)),e.createElement(l,{item:!0,xs:6},e.createElement(a,{variant:"subtitle2",color:"textSecondary"},"Path"),e.createElement(a,{variant:"body1"},r.path)),e.createElement(l,{item:!0,xs:6},e.createElement(a,{variant:"subtitle2",color:"textSecondary"},"Operator"),e.createElement(a,{variant:"body1"},p)),u?.result!==void 0&&e.createElement(l,{item:!0,xs:6},e.createElement(a,{variant:"subtitle2",color:"textSecondary"},"Result"),e.createElement(D,{passed:u.result})),e.createElement(l,{item:!0,xs:12},e.createElement(a,{variant:"subtitle2",color:"textSecondary"},"Expected"),e.createElement(a,{component:"div",variant:"body2",className:o.valueBox},e.createElement(x,{data:r?.value}))),e.createElement(l,{item:!0,xs:12},e.createElement(a,{variant:"subtitle2",color:"textSecondary"},"Resolved Value"),e.createElement(a,{component:"div",variant:"body2",className:o.valueBox},e.createElement(x,{data:u?.factResult}))),!!y&&e.createElement(l,{item:!0,xs:12},e.createElement(z,{elevation:0,title:"Related Fact"},e.createElement("div",{className:o.factBox},e.createElement(x,{data:y.data}))))))}),!!n?.expressions&&e.createElement(e.Fragment,null,e.createElement(f,{variant:"middle"}),e.createElement(c,{className:o.nested},n?.expressions?.map((r,s)=>e.createElement(g,{check:t,facts:i,ruleResults:m,expression:r,key:`nested-expression-${s}`}))))))},I=({entityRef:t,check:n,checkResult:i,notes:m,facts:o,ruleResults:r})=>{const s=v(),p=P(n?.rule);return e.createElement(c,{className:s.dryRunRoot},e.createElement(c,{className:s.dryRunSection},t&&e.createElement(e.Fragment,null,e.createElement(a,{variant:"h5"},"Entity"),e.createElement(a,{variant:"body1"},e.createElement(b,{className:s.ownerLink,entityRef:t})))),e.createElement(c,{className:s.dryRunSection},e.createElement(a,{variant:"h5"},"Check Result"),e.createElement("div",{className:s.resultBox},i?e.createElement(B,{name:n?.name??"",state:i,notes:m}):"No Results")),e.createElement(a,{variant:"h5"},"Rules"),e.createElement(g,{check:n,facts:o,ruleResults:r,expression:p}))};export{I as CheckDryRunDetails};
2
2
  //# sourceMappingURL=CheckDryRunDetails.esm.js.map
@@ -1,2 +1,2 @@
1
- import{makeStyles as b,ButtonGroup as g,Button as f}from"@material-ui/core";import n,{useState as k}from"react";import{useFormContext as E,Controller as y}from"react-hook-form";import{ExpressionType as a,ExpressionTypeReadableMap as C}from"../../../types/ExpressionType.esm.js";import"../../../../Frequency/types.esm.js";import"../../../../Frequency/util.esm.js";import"../../../../Frequency/FrequencyComponent.esm.js";import"../../../types/Path.esm.js";const x=b(e=>({button:{backgroundColor:e.palette.background.default,padding:e.spacing(.5,1.5)},selectedButton:{backgroundColor:e.palette.action.hover}})),B=({name:e,disabled:l})=>{const o=x(),{control:p,getValues:m}=E(),s=`${e}`,c=m(s),[i,u]=k(c||a.AllOf),d=r=>{u(r)};return n.createElement(y,{control:p,name:e,render:({field:{onChange:r}})=>n.createElement(g,{color:"primary"},Object.values(a).map(t=>n.createElement(f,{key:t,className:i===t?`${o.selectedButton} ${o.button}`:`${o.button}`,onClick:()=>{d(t),r(t)},disabled:l},C[t])))})};export{B as ExpressionTypeToggle};
1
+ import{makeStyles as b,ButtonGroup as g,Button as k}from"@material-ui/core";import n,{useState as E}from"react";import{useFormContext as f,Controller as y}from"react-hook-form";import{ExpressionType as a,ExpressionTypeReadableMap as C}from"../../../types/ExpressionType.esm.js";import"../../../../Frequency/types.esm.js";import"../../../../Frequency/util.esm.js";import"../../../../Frequency/FrequencyComponent.esm.js";import"../../../types/Path.esm.js";const x=b(e=>({button:{backgroundColor:e.palette.background.paper,padding:e.spacing(.5,1.5)},selectedButton:{backgroundColor:e.palette.action.selected}})),B=({name:e,disabled:l})=>{const o=x(),{control:p,getValues:s}=f(),m=`${e}`,c=s(m),[i,u]=E(c||a.AllOf),d=r=>{u(r)};return n.createElement(y,{control:p,name:e,render:({field:{onChange:r}})=>n.createElement(g,{color:"primary"},Object.values(a).map(t=>n.createElement(k,{key:t,className:i===t?`${o.selectedButton} ${o.button}`:`${o.button}`,onClick:()=>{d(t),r(t)},disabled:l},C[t])))})};export{B as ExpressionTypeToggle};
2
2
  //# sourceMappingURL=ExpressionTypeToggle.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{FormControlledAutocomplete as x}from"../../../FormControlledAutocomplete/FormControlledAutocomplete.esm.js";import{useLabelOptions as L}from"../../../FormControlledAutocomplete/useLabelOptions.esm.js";import"@material-ui/lab";import"../../../ListboxVirtualized/ListboxVirtualized.esm.js";import{useOptions as S}from"../../../GroupSelector/useOptions.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}=S();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:f}=h(),t=f("detailsStep.ownerEntityRef");t&&r!==t&&!e.some(m=>m.value===t)&&(e=[{value:t,label:v(t).name},...e]);const u=L(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(x,{freeSolo:!1,name:"detailsStep.ownerEntityRef",control:a,placeholder:E,width:250,helperText:n?.message??void 0,disabled:l||s,...u})))};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{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};
2
2
  //# sourceMappingURL=TeamDetailsInput.esm.js.map
@@ -1,2 +1,2 @@
1
- import{parseEntityRef as x}from"@backstage/catalog-model";import{useApi as N,configApiRef as B}from"@backstage/core-plugin-api";import{EntityDisplayName as D}from"@backstage/plugin-catalog-react";import{makeStyles as T,Checkbox as m,Box as P,Typography as j}from"@material-ui/core";import G from"@material-ui/icons/Category";import M from"@material-ui/icons/Class";import U from"@material-ui/icons/Group";import _ from"@material-ui/icons/Loop";import H from"@material-ui/icons/PlaylistAddCheckRounded";import e,{useMemo as J}from"react";import{useGetEntityFacets as o}from"../../../hooks/catalog/useGetEntityFacets.esm.js";import{CheckIcon as K}from"../../CheckIcon/CheckIcon.esm.js";import l from"../../MultiSelectFilter/MultiSelectFilter.esm.js";function Q(t){return t.toLowerCase().split("_").map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join(" ")}const p=(t,{selected:r})=>e.createElement(e.Fragment,null,e.createElement(m,{value:t,checked:r,color:"primary"}),e.createElement(D,{entityRef:t,hideIcon:!0})),W=(t,{selected:r})=>e.createElement(e.Fragment,null,e.createElement(m,{value:t,checked:r,color:"primary"}),e.createElement(K,{result:t}),e.createElement(P,{mr:1}),e.createElement(j,null,Q(t))),q=T(t=>({root:{display:"flex",flexDirection:"row",alignItems:"center",gap:t.spacing(2)}})),z=({filter:t,states:r,setStates:f,owners:d,setOwners:y,lifecycles:E,setLifecycles:u,types:g,setTypes:h,systems:L,setSystems:b})=>{const F=q(),n=N(B).getOptionalStringArray("soundcheck.flags")?.includes("enable-check-insights"),{data:A,isLoading:k}=o("relations.ownedBy",t),{data:s,isLoading:w}=o("spec.lifecycle",t,n),{data:i,isLoading:S}=o("spec.type",t,n),{data:a,isLoading:O}=o("relations.partOf",t,n),c=J(()=>a?.filter(v=>{try{return x(v).kind.toLowerCase()==="system"}catch{return!1}}),[a]),C=(s||[]).length<=1,I=(i||[]).length<=1,R=(c||[]).length<=1;return e.createElement("div",{className:F.root},e.createElement(l,{name:"state",label:"State",icon:e.createElement(H,null),options:["PASSED","FAILED","WARNING","NOT_APPLICABLE"],filters:r,setFilters:f,customRenderOption:W}),n&&e.createElement("div",null,e.createElement(l,{name:"system",label:"System",icon:e.createElement(G,null),filters:L,setFilters:b,options:c??[],disabled:O||R,customRenderOption:p}),e.createElement(l,{name:"owner",label:"Owner",icon:e.createElement(U,null),filters:d,setFilters:y,options:A??[],disabled:k,customRenderOption:p}),e.createElement(l,{name:"type",label:"Type",icon:e.createElement(M,null),filters:g,setFilters:h,options:i??[],disabled:S||I}),e.createElement(l,{name:"lifecycle",label:"Lifecycle",icon:e.createElement(_,null),filters:E,setFilters:u,options:s??[],disabled:w||C})))};export{z as FilterBar};
1
+ import{parseEntityRef as T}from"@backstage/catalog-model";import{useApi as D,configApiRef as B}from"@backstage/core-plugin-api";import{EntityDisplayName as G}from"@backstage/plugin-catalog-react";import{makeStyles as P,Checkbox as f,Box as _,Typography as j}from"@material-ui/core";import q from"@material-ui/icons/Category";import z from"@material-ui/icons/Class";import K from"@material-ui/icons/Group";import M from"@material-ui/icons/Loop";import U from"@material-ui/icons/PlaylistAddCheckRounded";import e,{useMemo as d}from"react";import{useGetEntityFacets as s}from"../../../hooks/catalog/useGetEntityFacets.esm.js";import{useGroupOptions as V}from"../../../hooks/groups/useGroupOptions.esm.js";import{CheckIcon as W}from"../../CheckIcon/CheckIcon.esm.js";import l from"../../MultiSelectFilter/MultiSelectFilter.esm.js";function X(t){return t.toLowerCase().split("_").map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join(" ")}const y=(t,{selected:r})=>e.createElement(e.Fragment,null,e.createElement(f,{value:t,checked:r,color:"primary"}),e.createElement(G,{entityRef:t,hideIcon:!0})),$=(t,{selected:r})=>e.createElement(e.Fragment,null,e.createElement(f,{value:t,checked:r,color:"primary"}),e.createElement(W,{result:t}),e.createElement(_,{mr:1}),e.createElement(j,null,X(t))),H=P(t=>({root:{display:"flex",flexDirection:"row",alignItems:"center",gap:t.spacing(2)}})),J=({filter:t,states:r,setStates:u,owners:E,setOwners:g,lifecycles:h,setLifecycles:L,types:b,setTypes:A,systems:F,setSystems:k})=>{const O=H(),n=D(B).getOptionalStringArray("soundcheck.flags")?.includes("enable-check-insights"),{options:i,isLoading:w}=V(),S=d(()=>i.map(o=>o.ref),[i]),{data:a,isLoading:C}=s("spec.lifecycle",t,n),{data:m,isLoading:R}=s("spec.type",t,n),{data:c,isLoading:x}=s("relations.partOf",t,n),p=d(()=>c?.filter(o=>{try{return T(o).kind.toLowerCase()==="system"}catch{return!1}}),[c]),I=(a||[]).length<=1,N=(m||[]).length<=1,v=(p||[]).length<=1;return e.createElement("div",{className:O.root},e.createElement(l,{name:"state",label:"State",icon:e.createElement(U,null),options:["PASSED","FAILED","WARNING","NOT_APPLICABLE"],filters:r,setFilters:u,customRenderOption:$}),n&&e.createElement("div",null,e.createElement(l,{name:"system",label:"System",icon:e.createElement(q,null),filters:F,setFilters:k,options:p??[],disabled:x||v,customRenderOption:y}),e.createElement(l,{name:"owner",label:"Owner",icon:e.createElement(K,null),filters:E,setFilters:g,options:S??[],disabled:w,customRenderOption:y}),e.createElement(l,{name:"type",label:"Type",icon:e.createElement(z,null),filters:b,setFilters:A,options:m??[],disabled:R||N}),e.createElement(l,{name:"lifecycle",label:"Lifecycle",icon:e.createElement(M,null),filters:h,setFilters:L,options:a??[],disabled:C||I})))};export{J as FilterBar};
2
2
  //# sourceMappingURL=FilterBar.esm.js.map
@@ -1,2 +1,2 @@
1
- import{useRouteRef as d,useApi as A,configApiRef as P}from"@backstage/core-plugin-api";import{usePermission as l}from"@backstage/plugin-permission-react";import{soundcheckCheckUpdatePermission as v,soundcheckCheckDeletePermission as S}from"@spotify/backstage-plugin-soundcheck-common";import p,{useCallback as i}from"react";import{useNavigate as b}from"react-router-dom";import"@backstage/catalog-model";import"@tanstack/react-query";import"../../../api.esm.js";import"../../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"../../../hooks/useSoundcheckAlert.esm.js";import{useConfirmationModal as x}from"../../../hooks/useConfirmationModal.esm.js";import{useDeleteCheck as I}from"../../../hooks/checks/useDeleteCheck.esm.js";import{checkDetailsRouteRef as M,checkEditRouteRef as $}from"../../../routes.esm.js";import{exportCheck as N}from"../../../utils/export.esm.js";import{SummaryCard as O}from"../../SummaryCard/SummaryCard.esm.js";import{CheckMetadata as U}from"./CheckMetadata.esm.js";const V=({check:t})=>{const{id:e,name:r,description:h,isEditable:c,ownerEntityRef:u}=t,o=b(),m=d(M),a=d($),{loading:f,allowed:k}=l({permission:v,resourceRef:e}),{loading:C,allowed:R}=l({permission:S,resourceRef:e}),g=A(P).getOptionalStringArray("soundcheck.flags")?.includes("enable-check-insights"),{showModal:s}=x(),{mutate:n}=I(),y=i(async()=>{await s({title:"Delete Check",message:`Are you sure you want to delete the check '${r??e}'?`})&&n(e)},[s,r,n,e]),w=i(()=>{o(m({checkId:e}))},[m,e,o]),E=i(()=>{o(a({checkId:e}))},[a,e,o]),D=i(()=>{N(t)},[t]);return p.createElement(O,{title:r??e,description:h,children:u&&p.createElement(U,{check:t}),handleView:w,handleEdit:c&&!f&&k?E:void 0,handleDelete:c&&!C&&R?y:void 0,handleExport:D,viewIsPrimaryAction:g})};export{V as CheckSummaryCard};
1
+ import{useRouteRef as d}from"@backstage/core-plugin-api";import{usePermission as l}from"@backstage/plugin-permission-react";import{soundcheckCheckUpdatePermission as g,soundcheckCheckDeletePermission as P}from"@spotify/backstage-plugin-soundcheck-common";import p,{useCallback as r}from"react";import{useNavigate as v}from"react-router-dom";import"@backstage/catalog-model";import"@tanstack/react-query";import"../../../api.esm.js";import"../../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"../../../hooks/useSoundcheckAlert.esm.js";import{useConfirmationModal as x}from"../../../hooks/useConfirmationModal.esm.js";import{useDeleteCheck as I}from"../../../hooks/checks/useDeleteCheck.esm.js";import{checkDetailsRouteRef as M,checkEditRouteRef as S}from"../../../routes.esm.js";import{exportCheck as b}from"../../../utils/export.esm.js";import{SummaryCard as A}from"../../SummaryCard/SummaryCard.esm.js";import{CheckMetadata as $}from"./CheckMetadata.esm.js";const N=({check:o})=>{const{id:e,name:i,description:h,isEditable:m,ownerEntityRef:u}=o,t=v(),c=d(M),a=d(S),{loading:f,allowed:k}=l({permission:g,resourceRef:e}),{loading:C,allowed:R}=l({permission:P,resourceRef:e}),{showModal:s}=x(),{mutate:n}=I(),w=r(async()=>{await s({title:"Delete Check",message:`Are you sure you want to delete the check '${i??e}'?`})&&n(e)},[s,i,n,e]),y=r(()=>{t(c({checkId:e}))},[c,e,t]),E=r(()=>{t(a({checkId:e}))},[a,e,t]),D=r(()=>{b(o)},[o]);return p.createElement(A,{title:i??e,description:h,children:u&&p.createElement($,{check:o}),handleView:y,handleEdit:m&&!f&&k?E:void 0,handleDelete:m&&!C&&R?w:void 0,handleExport:D,viewIsPrimaryAction:!0})};export{N as CheckSummaryCard};
2
2
  //# sourceMappingURL=CheckSummaryCard.esm.js.map
@@ -1,2 +1,2 @@
1
- import t from"react";import{DataDogConfigurator as e}from"./DataDog/DataDogConfigurator.esm.js";import{GithubConfigurator as i}from"./Github/GithubConfigurator.esm.js";import{JiraConfigurator as a}from"./Jira/JiraConfigurator.esm.js";import{KubernetesConfigurator as m}from"./Kubernetes/KubernetesConfigurator.esm.js";import{PagerDutyConfigurator as n}from"./PagerDuty/PagerDutyConfigurator.esm.js";import{ScmConfigurator as u}from"./SCM/ScmConfigurator.esm.js";import{SonarQubeConfigurator as f}from"./SonarQube/SonarQubeConfigurator.esm.js";const g={github:i,scm:u,pagerduty:n,datadog:e,kubernetes:m,jira:a,sonarqube:f},c=({selectedCollector:o})=>{const r=g[o?.id];return t.createElement(r,{selectedCollector:o})};export{c as Configurator};
1
+ import t from"react";import{DataDogConfigurator as e}from"./DataDog/DataDogConfigurator.esm.js";import{GithubConfigurator as i}from"./Github/GithubConfigurator.esm.js";import{GitlabConfigurator as a}from"./Gitlab/GitlabConfigurator.esm.js";import{JiraConfigurator as m}from"./Jira/JiraConfigurator.esm.js";import{KubernetesConfigurator as f}from"./Kubernetes/KubernetesConfigurator.esm.js";import{NewRelicConfigurator as n}from"./NewRelic/NewRelicConfigurator.esm.js";import{PagerDutyConfigurator as u}from"./PagerDuty/PagerDutyConfigurator.esm.js";import{ScmConfigurator as g}from"./SCM/ScmConfigurator.esm.js";import{SonarQubeConfigurator as p}from"./SonarQube/SonarQubeConfigurator.esm.js";const c={github:i,gitlab:a,scm:g,pagerduty:u,datadog:e,kubernetes:f,jira:m,sonarqube:p,newrelic:n},C=({selectedCollector:r})=>{const o=c[r?.id];return t.createElement(o,{selectedCollector:r})};export{C as Configurator};
2
2
  //# sourceMappingURL=Configurator.esm.js.map
@@ -1,2 +1,2 @@
1
- import{makeStyles as b,Paper as h,Divider as m}from"@material-ui/core";import o from"react";import{useForm as y}from"react-hook-form";import"@backstage/catalog-model";import"@backstage/core-plugin-api";import"@tanstack/react-query";import"../../../../api.esm.js";import"../../../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"../../../../hooks/useSoundcheckAlert.esm.js";import{useConfirmationModal as E}from"../../../../hooks/useConfirmationModal.esm.js";import{useNavigateBack as S}from"../../../../hooks/useNavigateBack.esm.js";import{useUpdateCollectorConfig as v}from"../../../../hooks/collectors/useUpdateCollectorConfig.esm.js";import{integrationsPageRouteRef as B}from"../../../../routes.esm.js";import{FooterButtons as P}from"../../../FooterButtons/FooterButtons.esm.js";import"../../../SoundcheckHeader/SoundcheckHeader.esm.js";import"../../../SoundcheckHeader/SoundcheckHeaderContext.esm.js";import{useHeader as D}from"../../../SoundcheckHeader/useHeader.esm.js";import{FactCollectionConfig as i}from"../Common/FactCollectionConfig.esm.js";import{collectorHeaderContent as L,confirmationModalContent as w}from"../Common/utils.esm.js";import{mapConfigToGithubCollectorConfig as F,defaultGithubConfig as G,mapGithubCollectorConfigToConfig as R}from"./utils.esm.js";const x=b(e=>({spacer:{height:e.spacing(8),width:"100%"},section:{marginBottom:e.spacing(2)},form:{marginBottom:e.spacing(2)}})),M=({disabled:e,selectedCollector:r})=>{const{control:a,formState:{errors:t},handleSubmit:n}=y({defaultValues:r?F(r.config):G(),mode:"onChange"}),s=x(),c=!!t.branchProtections||!!t.repositoryDetails||!!t.repositoryLanguages,{mutateAsync:p}=v(),[f,g]=S(B),{showModal:u}=E(),l=async d=>{if(!await u(w(r)))return;const C=R(d);await p({collectorId:r.id,config:C})&&g()};return D(L(r)),o.createElement(o.Fragment,null,o.createElement(h,{className:s.form},o.createElement("form",{onSubmit:n(l)},o.createElement(i,{name:"branchProtections",label:"Branch Protections",description:"Collects branch protection information from an entity's repository.",control:a,disabled:e,errors:t.branchProtections}),o.createElement(m,null),o.createElement(i,{name:"repositoryDetails",label:"Repository Details",description:"Collects details about the an entity's repository.",control:a,disabled:e,errors:t.repositoryDetails}),o.createElement(m,null),o.createElement(i,{name:"repositoryLanguages",label:"Repository Languages",description:"Collects details about the languages used in an entity's repository.",control:a,disabled:e,errors:t.repositoryLanguages}))),o.createElement("div",{className:s.section},o.createElement(P,{onCancel:f,saveButtonText:"Save",isLoading:!1,onSave:n(l),disableSave:c})))};export{M as GithubConfigurator};
1
+ import{makeStyles as b,Paper as y,Divider as m}from"@material-ui/core";import o from"react";import{useForm as h}from"react-hook-form";import"@backstage/catalog-model";import"@backstage/core-plugin-api";import"@tanstack/react-query";import"../../../../api.esm.js";import"../../../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"../../../../hooks/useSoundcheckAlert.esm.js";import{useConfirmationModal as E}from"../../../../hooks/useConfirmationModal.esm.js";import{useNavigateBack as S}from"../../../../hooks/useNavigateBack.esm.js";import{useUpdateCollectorConfig as v}from"../../../../hooks/collectors/useUpdateCollectorConfig.esm.js";import{integrationsPageRouteRef as B}from"../../../../routes.esm.js";import{FooterButtons as P}from"../../../FooterButtons/FooterButtons.esm.js";import"../../../SoundcheckHeader/SoundcheckHeader.esm.js";import"../../../SoundcheckHeader/SoundcheckHeaderContext.esm.js";import{useHeader as D}from"../../../SoundcheckHeader/useHeader.esm.js";import{FactCollectionConfig as i}from"../Common/FactCollectionConfig.esm.js";import{collectorHeaderContent as L,confirmationModalContent as w}from"../Common/utils.esm.js";import{mapConfigToGithubCollectorConfig as F,defaultGithubConfig as G,mapGithubCollectorConfigToConfig as R}from"./utils.esm.js";const x=b(e=>({spacer:{height:e.spacing(8),width:"100%"},section:{marginBottom:e.spacing(2)},form:{marginBottom:e.spacing(2)}})),M=({disabled:e,selectedCollector:r})=>{const{control:a,formState:{errors:t},handleSubmit:n}=h({defaultValues:r?F(r.config):G(),mode:"onChange"}),s=x(),c=!!t.branchProtections||!!t.repositoryDetails||!!t.repositoryLanguages,{mutateAsync:p}=v(),[f,g]=S(B),{showModal:u}=E(),l=async d=>{if(!await u(w(r)))return;const C=R(d);await p({collectorId:r.id,config:C})&&g()};return D(L(r)),o.createElement(o.Fragment,null,o.createElement(y,{className:s.form},o.createElement("form",{onSubmit:n(l)},o.createElement(i,{name:"branchProtections",label:"Branch Protections",description:"Collects branch protection information from an entity's repository.",control:a,disabled:e,errors:t.branchProtections}),o.createElement(m,null),o.createElement(i,{name:"repositoryDetails",label:"Repository Details",description:"Collects details about an entity's repository.",control:a,disabled:e,errors:t.repositoryDetails}),o.createElement(m,null),o.createElement(i,{name:"repositoryLanguages",label:"Repository Languages",description:"Collects details about the languages used in an entity's repository.",control:a,disabled:e,errors:t.repositoryLanguages}))),o.createElement("div",{className:s.section},o.createElement(P,{onCancel:f,saveButtonText:"Save",isLoading:!1,onSave:n(l),disableSave:c})))};export{M as GithubConfigurator};
2
2
  //# sourceMappingURL=GithubConfigurator.esm.js.map
@@ -0,0 +1,2 @@
1
+ import{makeStyles as b,Paper as h,Divider as m}from"@material-ui/core";import e from"react";import{useForm as j}from"react-hook-form";import"@backstage/catalog-model";import"@backstage/core-plugin-api";import"@tanstack/react-query";import"../../../../api.esm.js";import"../../../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"../../../../hooks/useSoundcheckAlert.esm.js";import{useConfirmationModal as E}from"../../../../hooks/useConfirmationModal.esm.js";import{useNavigateBack as P}from"../../../../hooks/useNavigateBack.esm.js";import{useUpdateCollectorConfig as S}from"../../../../hooks/collectors/useUpdateCollectorConfig.esm.js";import{integrationsPageRouteRef as v}from"../../../../routes.esm.js";import{FooterButtons as y}from"../../../FooterButtons/FooterButtons.esm.js";import"../../../SoundcheckHeader/SoundcheckHeader.esm.js";import"../../../SoundcheckHeader/SoundcheckHeaderContext.esm.js";import{useHeader as B}from"../../../SoundcheckHeader/useHeader.esm.js";import{FactCollectionConfig as n}from"../Common/FactCollectionConfig.esm.js";import{collectorHeaderContent as D,confirmationModalContent as L}from"../Common/utils.esm.js";import{mapConfigToGitlabCollectorConfig as w,defaultGitlabConfig as F,mapGitlabCollectorConfigToConfig as G}from"./utils.esm.js";const k=b(o=>({spacer:{height:o.spacing(8),width:"100%"},section:{marginBottom:o.spacing(2)},form:{marginBottom:o.spacing(2)}})),M=({disabled:o,selectedCollector:r})=>{const{control:a,formState:{errors:t},handleSubmit:i}=j({defaultValues:r?w(r.config):F(),mode:"onChange"}),l=k(),s=!!t.branchProtections||!!t.projectDetails||!!t.projectLanguages,{mutateAsync:p}=S(),[f,g]=P(v),{showModal:d}=E(),c=async u=>{if(!await d(L(r)))return;const C=G(u);await p({collectorId:r.id,config:C})&&g()};return B(D(r)),e.createElement(e.Fragment,null,e.createElement(h,{className:l.form},e.createElement("form",{onSubmit:i(c)},e.createElement(n,{name:"branchProtections",label:"Branch Protections",description:"Collects branch protection information from an entity's project.",control:a,disabled:o,errors:t.branchProtections}),e.createElement(m,null),e.createElement(n,{name:"projectDetails",label:"Project Details",description:"Collects details about an entity's project.",control:a,disabled:o,errors:t.projectDetails}),e.createElement(m,null),e.createElement(n,{name:"projectLanguages",label:"Project Languages",description:"Collects details about the languages used in an entity's project.",control:a,disabled:o,errors:t.projectLanguages}))),e.createElement("div",{className:l.section},e.createElement(y,{onCancel:f,saveButtonText:"Save",isLoading:!1,onSave:i(c),disableSave:s})))};export{M as GitlabConfigurator};
2
+ //# sourceMappingURL=GitlabConfigurator.esm.js.map
@@ -0,0 +1,2 @@
1
+ import{asArray as b}from"@spotify/backstage-plugin-soundcheck-common";import{mapToCacheConfig as l,mapCacheConfigToHumanDurationOrBoolean as s}from"../../../CacheConfig/utils.esm.js";import"../../../CacheConfig/CacheConfigComponent.esm.js";import{mapCatalogFilterToFilters as u,mapFiltersToCatalogFilter as p}from"../../../Filter/utils.esm.js";import"../../../Filter/FilterComponent.esm.js";import"../../../Frequency/types.esm.js";import{mapHumanDurationOrCronToFrequency as C,mapFrequencyToHumanDurationOrCron as m}from"../../../Frequency/util.esm.js";import"../../../Frequency/FrequencyComponent.esm.js";import{defaultCollectorOption as h}from"../Common/CollectorOption.esm.js";const g="branch_protections",y="project_details",T="project_languages",q=()=>({branchProtections:h(),projectDetails:h(),projectLanguages:h()});function O(r){const{branchProtections:c,projectDetails:o,projectLanguages:e}=r;if(c.enabled||o.enabled||e.enabled){const n={},f=[];if(n.collects=f,c.enabled){const{cacheConfig:t,frequency:a,filters:i}=c;f.push({type:g,frequency:m(a),filter:p(i),cache:s(t)})}if(o.enabled){const{cacheConfig:t,frequency:a,filters:i}=o;f.push({type:y,frequency:m(a),filter:p(i),cache:s(t)})}if(e.enabled){const{cacheConfig:t,frequency:a,filters:i}=e;f.push({type:T,frequency:m(a),filter:p(i),cache:s(t)})}return n}return{collects:[]}}function d(r){const c=q();if(r){const o=r.collects;if(o)for(const e of b(o)){const n=e.type;n===g&&(c.branchProtections={enabled:!0,frequency:C(e.frequency??r.frequency),filters:u(e.filter??r.filter),cacheConfig:l(e.cache??r.cache)}),n===y&&(c.projectDetails={enabled:!0,frequency:C(e.frequency??r.frequency),filters:u(e.filter??r.filter),cacheConfig:l(e.cache??r.cache)}),n===T&&(c.projectLanguages={enabled:!0,frequency:C(e.frequency??r.frequency),filters:u(e.filter??r.filter),cacheConfig:l(e.cache??r.cache)})}}return c}export{g as BRANCH_PROTECTIONS_COLLECTOR_TYPE,y as PROJECT_DETAILS_COLLECTOR_TYPE,T as PROJECT_LANGUAGES_COLLECTOR_TYPE,q as defaultGitlabConfig,d as mapConfigToGitlabCollectorConfig,O as mapGitlabCollectorConfigToConfig};
2
+ //# sourceMappingURL=utils.esm.js.map
@@ -0,0 +1,2 @@
1
+ import{makeStyles as h,Paper as S,Divider as m}from"@material-ui/core";import e from"react";import{useForm as b}from"react-hook-form";import"@backstage/catalog-model";import"@backstage/core-plugin-api";import"@tanstack/react-query";import"../../../../api.esm.js";import"../../../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"../../../../hooks/useSoundcheckAlert.esm.js";import{useConfirmationModal as w}from"../../../../hooks/useConfirmationModal.esm.js";import{useNavigateBack as y}from"../../../../hooks/useNavigateBack.esm.js";import{useUpdateCollectorConfig as E}from"../../../../hooks/collectors/useUpdateCollectorConfig.esm.js";import{integrationsPageRouteRef as N}from"../../../../routes.esm.js";import{FooterButtons as R}from"../../../FooterButtons/FooterButtons.esm.js";import"../../../SoundcheckHeader/SoundcheckHeader.esm.js";import"../../../SoundcheckHeader/SoundcheckHeaderContext.esm.js";import{useHeader as v}from"../../../SoundcheckHeader/useHeader.esm.js";import{FactCollectionConfig as a}from"../Common/FactCollectionConfig.esm.js";import{collectorHeaderContent as B,confirmationModalContent as F}from"../Common/utils.esm.js";import{mapConfigToNewRelicCollectorConfig as M,defaultNewRelicConfig as P,mapNewRelicCollectorConfigToConfig as T}from"./utils.esm.js";const k=h(t=>({spacer:{height:t.spacing(8),width:"100%"},section:{marginBottom:t.spacing(2)},form:{marginBottom:t.spacing(2)}})),x=({disabled:t,selectedCollector:i})=>{const{control:r,formState:{errors:o},handleSubmit:n}=b({defaultValues:i?M(i.config):P(),mode:"onChange"}),l=k(),s=!!o.entity||!!o.entitySearch||!!o.policiesSearch,{mutateAsync:p}=E(),[f,d]=y(N),{showModal:u}=w(),c=async g=>{if(!await u(F(i)))return;const C=T(g);await p({collectorId:i.id,config:C})&&d()};return v(B(i)),e.createElement(e.Fragment,null,e.createElement(S,{className:l.form},e.createElement("form",{onSubmit:n(c)},e.createElement(a,{name:"entity",label:"Entity",description:"Collects details about New Relic entity with a specific id.",control:r,disabled:t,errors:o.entity}),e.createElement(m,null),e.createElement(a,{name:"entitySearch",label:"Entity Search",description:"Collects details about New Relic entities with a specific tag.",control:r,disabled:t,errors:o.entitySearch}),e.createElement(m,null),e.createElement(a,{name:"policiesSearch",label:"Policies Search",description:"Collects details about New Relic policies for a specific account.",control:r,disabled:t,errors:o.policiesSearch}))),e.createElement("div",{className:l.section},e.createElement(R,{onCancel:f,saveButtonText:"Save",isLoading:!1,onSave:n(c),disableSave:s})))};export{x as NewRelicConfigurator};
2
+ //# sourceMappingURL=NewRelicConfigurator.esm.js.map
@@ -0,0 +1,2 @@
1
+ import{asArray as d}from"@spotify/backstage-plugin-soundcheck-common";import{mapToCacheConfig as l,mapCacheConfigToHumanDurationOrBoolean as u}from"../../../CacheConfig/utils.esm.js";import"../../../CacheConfig/CacheConfigComponent.esm.js";import{mapCatalogFilterToFilters as s,mapFiltersToCatalogFilter as C}from"../../../Filter/utils.esm.js";import"../../../Filter/FilterComponent.esm.js";import"../../../Frequency/types.esm.js";import{mapHumanDurationOrCronToFrequency as p,mapFrequencyToHumanDurationOrCron as y}from"../../../Frequency/util.esm.js";import"../../../Frequency/FrequencyComponent.esm.js";import{defaultCollectorOption as h}from"../Common/CollectorOption.esm.js";const m="entity",T="entity-search",q="policies-search",g=()=>({entity:h(),entitySearch:h(),policiesSearch:h()});function E(c){const{entity:r,entitySearch:n,policiesSearch:e}=c;if(r.enabled||n.enabled||e.enabled){const i={},a=[];if(i.collects=a,r.enabled){const{cacheConfig:o,frequency:t,filters:f}=r;a.push({type:m,frequency:y(t),filter:C(f),cache:u(o)})}if(n.enabled){const{cacheConfig:o,frequency:t,filters:f}=n;a.push({type:T,frequency:y(t),filter:C(f),cache:u(o)})}if(e.enabled){const{cacheConfig:o,frequency:t,filters:f}=e;a.push({type:q,frequency:y(t),filter:C(f),cache:u(o)})}return i}return{collects:[]}}function O(c){const r=g();if(c){const n=c.collects;if(n)for(const e of d(n)){const i=e.type;i===m&&(r.entity={enabled:!0,frequency:p(e.frequency??c.frequency),filters:s(e.filter??c.filter),cacheConfig:l(e.cache??c.cache)}),i===T&&(r.entitySearch={enabled:!0,frequency:p(e.frequency??c.frequency),filters:s(e.filter??c.filter),cacheConfig:l(e.cache??c.cache)}),i===q&&(r.policiesSearch={enabled:!0,frequency:p(e.frequency??c.frequency),filters:s(e.filter??c.filter),cacheConfig:l(e.cache??c.cache)})}}return r}export{m as ENTITY_COLLECTOR_TYPE,T as ENTITY_SEARCH_COLLECTOR_TYPE,q as POLICIES_SEARCH_COLLECTOR_TYPE,g as defaultNewRelicConfig,O as mapConfigToNewRelicCollectorConfig,E as mapNewRelicCollectorConfigToConfig};
2
+ //# sourceMappingURL=utils.esm.js.map
@@ -1,2 +1,2 @@
1
- import{makeStyles as p,useTheme as s}from"@material-ui/core";import c from"react";import g from"../../../images/cat-blk.svg";import n from"../../../images/cat-wht.svg";import f from"../../../images/dd_logo_h_rgb.svg";import h from"../../../images/dd_logo_h_white.svg";import l from"../../../images/GitHub_Logo.svg";import u from"../../../images/GitHub_Logo_White.svg";import d from"../../../images/gitlab-rgb.svg";import b from"../../../images/gitlab-white.svg";import k from"../../../images/jira-rgb.svg";import y from"../../../images/jira-white.svg";import j from"../../../images/k8s_blue.svg";import q from"../../../images/k8s_white.svg";import B from"../../../images/pd-black.svg";import w from"../../../images/pd-white.svg";import x from"../../../images/SCM_DARK.svg";import I from"../../../images/SCM_LIGHT.svg";import L from"../../../images/sonarqube-rgb.svg";import S from"../../../images/sonarqube-white.svg";import T from"../../../images/soundcheck-black.svg";import D from"../../../images/soundcheck-white.svg";import E from"../../../images/tech-black.svg";import M from"../../../images/tech-white.svg";import{isDarkTheme as $}from"../../Charts/chartUtils.esm.js";const t={github:l,gitlab:d,datadog:f,scm:I,pagerduty:B,catalog:g,soundcheck:T,techinsights:E,kubernetes:j,jira:k,sonarqube:L},i={github:u,gitlab:b,datadog:h,scm:x,pagerduty:w,catalog:n,soundcheck:D,techinsights:M,kubernetes:q,jira:y,sonarqube:S},C=new Set(["catalog","soundcheck","techinsights","sonarqube"]),F=p(o=>({image:{objectFit:"contain",color:"white",height:o.spacing(5)-4,maxWidth:"100%",marginBottom:o.spacing(1.5)},tallImage:{height:o.spacing(6.5),marginBottom:o.spacing(0)}})),G=o=>!!t[o]&&!!i[o],N=({collectorId:o,noMargin:e})=>{const r=F(),a=s(),m=$(a)?i[o]:t[o];return m?c.createElement("img",{src:m,alt:o,style:e?{marginBottom:0}:{},className:`${r.image} ${C.has(o)?r.tallImage:""}`}):null};export{N as CollectorLogo,G as hasLogo};
1
+ import{makeStyles as p,useTheme as c}from"@material-ui/core";import s from"react";import g from"../../../images/cat-blk.svg";import n from"../../../images/cat-wht.svg";import f from"../../../images/dd_logo_h_rgb.svg";import l from"../../../images/dd_logo_h_white.svg";import h from"../../../images/GitHub_Logo.svg";import u from"../../../images/GitHub_Logo_White.svg";import d from"../../../images/gitlab-rgb.svg";import b from"../../../images/gitlab-white.svg";import k from"../../../images/jira-rgb.svg";import w from"../../../images/jira-white.svg";import y from"../../../images/k8s_blue.svg";import j from"../../../images/k8s_white.svg";import q from"../../../images/new-relic-rgb.svg";import B from"../../../images/new-relic-white.svg";import x from"../../../images/pd-black.svg";import I from"../../../images/pd-white.svg";import L from"../../../images/SCM_DARK.svg";import S from"../../../images/SCM_LIGHT.svg";import T from"../../../images/sonarqube-rgb.svg";import D from"../../../images/sonarqube-white.svg";import E from"../../../images/soundcheck-black.svg";import $ from"../../../images/soundcheck-white.svg";import A from"../../../images/tech-black.svg";import C from"../../../images/tech-white.svg";import{isDarkTheme as F}from"../../Charts/chartUtils.esm.js";const t={github:h,gitlab:d,datadog:f,scm:S,pagerduty:x,catalog:g,soundcheck:E,techinsights:A,kubernetes:y,jira:k,sonarqube:T,newrelic:q},i={github:u,gitlab:b,datadog:l,scm:L,pagerduty:I,catalog:n,soundcheck:$,techinsights:C,kubernetes:j,jira:w,sonarqube:D,newrelic:B},G=new Set(["catalog","soundcheck","techinsights","sonarqube"]),H=p(o=>({image:{objectFit:"contain",color:"white",height:o.spacing(5)-4,maxWidth:"100%",marginBottom:o.spacing(1.5)},tallImage:{height:o.spacing(6.5),marginBottom:o.spacing(0)}})),M=o=>!!t[o]&&!!i[o],N=({collectorId:o,noMargin:e})=>{const r=H(),a=c(),m=F(a)?i[o]:t[o];return m?s.createElement("img",{src:m,alt:o,style:e?{marginBottom:0}:{},className:`${r.image} ${G.has(o)?r.tallImage:""}`}):null};export{N as CollectorLogo,M as hasLogo};
2
2
  //# sourceMappingURL=CollectorLogo.esm.js.map
@@ -1,2 +1,2 @@
1
- import{MarkdownContent as E}from"@backstage/core-components";import{useRouteRef as v}from"@backstage/core-plugin-api";import{usePermission as N}from"@backstage/plugin-permission-react";import{makeStyles as I,CardContent as g,CardHeader as k,Typography as u,Divider as x,CardActions as S,Button as T}from"@material-ui/core";import{soundcheckCollectorUpdatePermission as $}from"@spotify/backstage-plugin-soundcheck-common";import e from"react";import{useNavigate as A}from"react-router-dom";import{integrationDetailsRouteRef as B}from"../../../routes.esm.js";import{useSummaryCardStyles as L,Card as M}from"../../SummaryCard/SummaryCard.esm.js";import{hasLogo as R,CollectorLogo as D}from"./CollectorLogo.esm.js";const H=I(o=>({cardContent:{flex:1,paddingTop:o.spacing(1)},logoHeader:{paddingBottom:0,flex:0},headerContent:{display:"flex",alignItems:"center",height:o.spacing(5),marginBottom:o.spacing(1.5)},headerTypography:{marginBottom:0}})),l=["github","scm","pagerduty","datadog","kubernetes","jira","sonarqube"],P=({collector:o})=>{const{description:p,id:t,isConfigurable:s,isEditable:m,name:f}=o,{loading:c,allowed:d}=N({permission:$}),y=A(),h=v(B),a=L(),n=H(),C=l.includes(t)&&s&&m&&!c&&d,b=()=>{y(h({integrationId:t}))};let r;c||!d?r="You don't have permissions to configure this integration.":s?m?l.includes(t)||(r="Integration can only be configured through YAML"):r="Integration is already configured via YAML and cannot be configured through the UI.":r="Integration is not configurable.";const i=f??t;return e.createElement(M,{"data-testid":t,className:a.card},R(t)?e.createElement(g,{className:n.logoHeader},e.createElement(D,{collectorId:t})):e.createElement(k,{title:i,titleTypographyProps:{className:`${a.summaryName} ${n.headerTypography}`},classes:{content:n.headerContent}}),e.createElement(g,{className:n.cardContent},e.createElement(u,{variant:"body1",component:"div"},e.createElement(E,{className:a.summaryDescription,content:p??""})),e.createElement(u,{color:"textSecondary",variant:"body2"},r)),C&&e.createElement("div",null,e.createElement(x,null),e.createElement(S,{className:a.actionArea},e.createElement(T,{"aria-label":`${i}-edit`,"data-testid":`${i}-button`,size:"medium",role:"link",onClick:b,className:a.button,variant:"outlined"},"Configure"))))};export{P as CollectorSummaryCard,l as ConfigurableCollectorIds};
1
+ import{MarkdownContent as E}from"@backstage/core-components";import{useRouteRef as v}from"@backstage/core-plugin-api";import{usePermission as N}from"@backstage/plugin-permission-react";import{makeStyles as I,CardContent as g,CardHeader as k,Typography as u,Divider as x,CardActions as S,Button as T}from"@material-ui/core";import{soundcheckCollectorUpdatePermission as $}from"@spotify/backstage-plugin-soundcheck-common";import e from"react";import{useNavigate as A}from"react-router-dom";import{integrationDetailsRouteRef as B}from"../../../routes.esm.js";import{useSummaryCardStyles as H,Card as L}from"../../SummaryCard/SummaryCard.esm.js";import{hasLogo as R,CollectorLogo as w}from"./CollectorLogo.esm.js";const D=I(o=>({cardContent:{flex:1,paddingTop:o.spacing(1)},logoHeader:{paddingBottom:0,flex:0},headerContent:{display:"flex",alignItems:"center",height:o.spacing(5),marginBottom:o.spacing(1.5)},headerTypography:{marginBottom:0}})),l=["github","gitlab","scm","pagerduty","datadog","kubernetes","jira","sonarqube","newrelic"],M=({collector:o})=>{const{description:p,id:t,isConfigurable:s,isEditable:m,name:f}=o,{loading:c,allowed:d}=N({permission:$}),y=A(),h=v(B),a=H(),n=D(),C=l.includes(t)&&s&&m&&!c&&d,b=()=>{y(h({integrationId:t}))};let r;c||!d?r="You don't have permissions to configure this integration.":s?m?l.includes(t)||(r="Integration can only be configured through YAML"):r="Integration is already configured via YAML and cannot be configured through the UI.":r="Integration is not configurable.";const i=f??t;return e.createElement(L,{"data-testid":t,className:a.card},R(t)?e.createElement(g,{className:n.logoHeader},e.createElement(w,{collectorId:t})):e.createElement(k,{title:i,titleTypographyProps:{className:`${a.summaryName} ${n.headerTypography}`},classes:{content:n.headerContent}}),e.createElement(g,{className:n.cardContent},e.createElement(u,{variant:"body1",component:"div"},e.createElement(E,{className:a.summaryDescription,content:p??""})),e.createElement(u,{color:"textSecondary",variant:"body2"},r)),C&&e.createElement("div",null,e.createElement(x,null),e.createElement(S,{className:a.actionArea},e.createElement(T,{"aria-label":`${i}-edit`,"data-testid":`${i}-button`,size:"medium",role:"link",onClick:b,className:a.button,variant:"outlined"},"Configure"))))};export{M as CollectorSummaryCard,l as ConfigurableCollectorIds};
2
2
  //# sourceMappingURL=CollectorSummaryCard.esm.js.map
@@ -1,2 +1,2 @@
1
- import{makeStyles as n}from"@material-ui/core";import{SpotifyLicenseBanner as r}from"@spotify/backstage-plugin-core";import e from"react";import{AlertProvider as o}from"../../hooks/useSoundcheckAlert.esm.js";import{soundcheckBackend as i,invalidLicenseMessage as a}from"../../utils/license.esm.js";import{CertificationsPage as m}from"../CertificationsPage/CertificationsPage.esm.js";const c=n(t=>({root:{"&:not(:first-child)":{marginTop:t.spacing(2)}}})),l=()=>{const t=c();return e.createElement(e.Fragment,null,e.createElement(o,null,e.createElement(r,{backend:i,invalidLicenseMessage:a,inline:!0}),e.createElement("div",{className:t.root},e.createElement(m,null))))};export{l as EntityContent};
1
+ import{useApi as r,githubAuthApiRef as l,configApiRef as f}from"@backstage/core-plugin-api";import{identityApiRef as p}from"@backstage/frontend-plugin-api";import{useTemplateSecrets as g}from"@backstage/plugin-scaffolder-react";import{makeStyles as d}from"@material-ui/core";import{SpotifyLicenseBanner as u}from"@spotify/backstage-plugin-core";import e from"react";import E from"react-use/lib/useAsync";import{AlertProvider as A}from"../../hooks/useSoundcheckAlert.esm.js";import{soundcheckBackend as y,invalidLicenseMessage as k}from"../../utils/license.esm.js";import{CertificationsPage as v}from"../CertificationsPage/CertificationsPage.esm.js";const h=d(t=>({root:{"&:not(:first-child)":{marginTop:t.spacing(2)}}})),L=()=>{const t=h(),o=r(l),i=r(p),n=r(f).getOptionalStringArray("soundcheck.flags")?.includes("enable-fix-me"),{setSecrets:a}=g();return E(async()=>{const[m,s,c]=await Promise.all([n?o.getAccessToken(void 0,{optional:!0}):Promise.resolve(""),i.getProfileInfo(),i.getBackstageIdentity()]);a({GHE_LOGIN:c.userEntityRef.replace("default/",""),GHE_EMAIL:s.email,GHE_TOKEN:m})},[o,i]),e.createElement(e.Fragment,null,e.createElement(A,null,e.createElement(u,{backend:y,invalidLicenseMessage:k,inline:!0}),e.createElement("div",{className:t.root},e.createElement(v,null))))};export{L as EntityContent};
2
2
  //# sourceMappingURL=EntityContent.esm.js.map
@@ -1,2 +1,2 @@
1
- import{makeStyles as l,Typography as m,Link as a}from"@material-ui/core";import i from"@material-ui/icons/InfoOutlined";import e from"react";const o=l(()=>({centerAlignment:{display:"flex",alignItems:"center"}})),c=({title:n,docLink:t})=>{const r=o();return e.createElement(m,{variant:"subtitle2",className:r.centerAlignment},n,t&&e.createElement(a,{className:r.centerAlignment,target:"_blank",rel:"noopener noreferrer",href:t},e.createElement(i,{style:{marginLeft:4},fontSize:"inherit"})))};export{c as FormFieldLabel};
1
+ import{makeStyles as l,Typography as m,Link as i}from"@material-ui/core";import a from"@material-ui/icons/InfoOutlined";import e from"react";const o=l(()=>({centerAlignment:{display:"flex",alignItems:"center"}})),c=({title:n,docLink:t})=>{const r=o();return e.createElement(m,{variant:"subtitle2",className:r.centerAlignment},n,t&&e.createElement(i,{className:r.centerAlignment,target:"_blank",rel:"noopener noreferrer",href:t},e.createElement(a,{style:{marginLeft:4},fontSize:"inherit"})))};export{c as FormFieldLabel};
2
2
  //# sourceMappingURL=FormFieldLabel.esm.js.map
@@ -1,2 +1,2 @@
1
- import{useApi as E,configApiRef as v}from"@backstage/core-plugin-api";import{makeStyles as O,alpha as k,TextField as w,CircularProgress as y}from"@material-ui/core";import P from"@material-ui/lab/Autocomplete";import s,{useMemo as x,useCallback as I,useEffect as f}from"react";import{useSearchParams as A}from"react-router-dom";import F from"react-use/lib/useLocalStorage";import{useOptions as G}from"./useOptions.esm.js";const L=O(r=>({root:{width:"100%",minWidth:250},textField:{"& $notchedOutline":{borderColor:k(r.page.fontColor,.25)},"&:hover $notchedOutline":{borderColor:r.page.fontColor}},input:{backgroundColor:"transparent",color:r.page.fontColor},clearIndicator:{color:r.page.fontColor},popupIndicator:{color:r.page.fontColor},notchedOutline:{}}),{name:"SoundcheckGroupSelector"}),N=({setError:r,margin:S,baseClass:a})=>{const{options:o,isLoading:i,isError:d}=G(),t=L(),[p,h]=A(),[n,C]=F("soundcheck.overview.groupRef",null),u=p.get("group"),m=E(v).getOptionalString("soundcheck.overview.defaultSelectedGroupType"),g=x(()=>{if(!i&&o.length){if(u||n){const e=u??n;return o.find(c=>c.ref===e)??o[0]}else if(m)return o.find(e=>e.type===m)??o[0];return o[0]}return null},[m,i,o,u,n]),l=I((e,c)=>{e&&p.get("group")!==e&&(p.set("group",e),h(p,{replace:c}),C(e))},[p,C,h]),b=I((e,c)=>{l?.(c?.ref)},[l]);return f(()=>{n&&!u&&l(n,!0)},[n,u,l]),f(()=>{l(g?.ref,!0)},[l,g]),f(()=>{r?.(d?new Error("Error loading groups"):void 0)},[d,r]),d?null:s.createElement(P,{"aria-label":"Current group",className:a?"":t.root,classes:{clearIndicator:a?"":t.clearIndicator,popupIndicator:a?"":t.popupIndicator},disableClearable:!0,options:o??[],loading:i,groupBy:e=>e.key,value:g,freeSolo:!1,onChange:b,getOptionLabel:e=>e.name,renderInput:e=>s.createElement(w,{...e,variant:"outlined",placeholder:i?"Loading":"Select a group",className:t.textField,margin:S,InputProps:{...e.InputProps,className:a?"":t.input,classes:{notchedOutline:a?"":t.notchedOutline},endAdornment:s.createElement(s.Fragment,null,i?s.createElement(y,{color:"inherit",size:20}):null,e.InputProps.endAdornment)}})})};export{N as GroupSelector};
1
+ import{useApi as E,configApiRef as v}from"@backstage/core-plugin-api";import{makeStyles as O,alpha as k,TextField as w,CircularProgress as y}from"@material-ui/core";import P from"@material-ui/lab/Autocomplete";import s,{useMemo as x,useCallback as I,useEffect as f}from"react";import{useSearchParams as A}from"react-router-dom";import F from"react-use/lib/useLocalStorage";import{useGroupOptions as G}from"../../hooks/groups/useGroupOptions.esm.js";const L=O(r=>({root:{width:"100%",minWidth:250},textField:{"& $notchedOutline":{borderColor:k(r.page.fontColor,.25)},"&:hover $notchedOutline":{borderColor:r.page.fontColor}},input:{backgroundColor:"transparent",color:r.page.fontColor},clearIndicator:{color:r.page.fontColor},popupIndicator:{color:r.page.fontColor},notchedOutline:{}}),{name:"SoundcheckGroupSelector"}),N=({setError:r,margin:S,baseClass:a})=>{const{options:o,isLoading:p,isError:d}=G(),t=L(),[i,h]=A(),[n,C]=F("soundcheck.overview.groupRef",null),u=i.get("group"),m=E(v).getOptionalString("soundcheck.overview.defaultSelectedGroupType"),g=x(()=>{if(!p&&o.length){if(u||n){const e=u??n;return o.find(c=>c.ref===e)??o[0]}else if(m)return o.find(e=>e.type===m)??o[0];return o[0]}return null},[m,p,o,u,n]),l=I((e,c)=>{e&&i.get("group")!==e&&(i.set("group",e),h(i,{replace:c}),C(e))},[i,C,h]),b=I((e,c)=>{l?.(c?.ref)},[l]);return f(()=>{n&&!u&&l(n,!0)},[n,u,l]),f(()=>{l(g?.ref,!0)},[l,g]),f(()=>{r?.(d?new Error("Error loading groups"):void 0)},[d,r]),d?null:s.createElement(P,{"aria-label":"Current group",className:a?"":t.root,classes:{clearIndicator:a?"":t.clearIndicator,popupIndicator:a?"":t.popupIndicator},disableClearable:!0,options:o??[],loading:p,groupBy:e=>e.key,value:g,freeSolo:!1,onChange:b,getOptionLabel:e=>e.name,renderInput:e=>s.createElement(w,{...e,variant:"outlined",placeholder:p?"Loading":"Select a group",className:t.textField,margin:S,InputProps:{...e.InputProps,className:a?"":t.input,classes:{notchedOutline:a?"":t.notchedOutline},endAdornment:s.createElement(s.Fragment,null,p?s.createElement(y,{color:"inherit",size:20}):null,e.InputProps.endAdornment)}})})};export{N as GroupSelector};
2
2
  //# sourceMappingURL=GroupSelector.esm.js.map
@@ -1,2 +1,2 @@
1
- import{useRouteRef as m,useRouteRefParams as d}from"@backstage/core-plugin-api";import{useEntity as s}from"@backstage/plugin-catalog-react";import e from"react";import{Routes as $,Route as i,Navigate as u}from"react-router-dom";import{useAllCertifications as v}from"../hooks/certifications/useAllCertifications.esm.js";import"@tanstack/react-query";import"../api.esm.js";import"../hooks/graphqlKeys.esm.js";import{useCertificationDetailsForTrack as R}from"../hooks/certifications/useCertificationDetailsForTrack.esm.js";import"@backstage/catalog-model";import"../hooks/useSoundcheckAlert.esm.js";import"../hooks/useConfirmationModal.esm.js";import{usePlaylists as y}from"../hooks/playlists/usePlaylists.esm.js";import{certificationPlaylistTrackCheckRouteRef as I,certificationPlaylistTrackRouteRef as E,certificationPlaylistRouteRef as f,certificationTrackRouteRef as k,certificationRouteRef as g}from"../routes.esm.js";import{EntityContent as o}from"./EntityContent/EntityContent.esm.js";const x=()=>{const{entity:r}=s(),t=m(f),a=m(k),{isLoading:c,data:l}=y(r),{isLoading:n,data:P}=v(r);if(c||n)return null;const p=l?.[0]?.id,h=P?.[0]?.program.id;return!p&&!h?null:e.createElement(u,{to:p?t({playlistId:p}):a({trackId:h}),replace:!0})},T=()=>{const{entity:r}=s(),{playlistId:t}=d(f),a=m(E),{data:c}=y(r),l=c?.find(n=>n.id===t)?.trackIds[0];return l?e.createElement(u,{to:a({playlistId:t,trackId:l}),replace:!0}):null},F=()=>{const{entity:r}=s(),{playlistId:t,trackId:a}=d(E),{data:c}=R(r,a),l=m(I),n=c?.levels[0]?.checks[0]?.id;return n?e.createElement(u,{to:l({playlistId:t,trackId:a,checkId:n}),replace:!0}):null},C=()=>{const{entity:r}=s(),{trackId:t}=d(k),a=m(g),{data:c}=R(r,t),l=c?.levels?.find(n=>n.checks.length>0)?.checks[0].id;return l?e.createElement(u,{to:a({trackId:t,checkId:l}),replace:!0}):null},L=()=>e.createElement($,null,e.createElement(i,{path:I.path,element:e.createElement(o,null)}),e.createElement(i,{path:E.path,element:e.createElement(e.Fragment,null,e.createElement(o,null),e.createElement(F,null))}),e.createElement(i,{path:f.path,element:e.createElement(e.Fragment,null,e.createElement(o,null),e.createElement(T,null))}),e.createElement(i,{path:k.path,element:e.createElement(e.Fragment,null,e.createElement(o,null),e.createElement(C,null))}),e.createElement(i,{path:g.path,element:e.createElement(o,null)}),e.createElement(i,{path:"/",element:e.createElement(e.Fragment,null,e.createElement(o,null),e.createElement(x,null))}));export{C as RedirectToFirstCheck,T as RedirectToFirstPlaylistTrack,F as RedirectToFirstPlaylistTrackCheck,L as Router};
1
+ import{useRouteRef as m,useRouteRefParams as d}from"@backstage/core-plugin-api";import{useEntity as s}from"@backstage/plugin-catalog-react";import{SecretsContextProvider as v}from"@backstage/plugin-scaffolder-react";import e from"react";import{Routes as $,Route as i,Navigate as u}from"react-router-dom";import{useAllCertifications as L}from"../hooks/certifications/useAllCertifications.esm.js";import"@tanstack/react-query";import"../api.esm.js";import"../hooks/graphqlKeys.esm.js";import{useCertificationDetailsForTrack as R}from"../hooks/certifications/useCertificationDetailsForTrack.esm.js";import"@backstage/catalog-model";import"../hooks/useSoundcheckAlert.esm.js";import"../hooks/useConfirmationModal.esm.js";import{usePlaylists as y}from"../hooks/playlists/usePlaylists.esm.js";import{certificationPlaylistTrackCheckRouteRef as I,certificationPlaylistTrackRouteRef as E,certificationPlaylistRouteRef as f,certificationTrackRouteRef as k,certificationRouteRef as g}from"../routes.esm.js";import{EntityContent as o}from"./EntityContent/EntityContent.esm.js";const x=()=>{const{entity:l}=s(),t=m(f),a=m(k),{isLoading:c,data:r}=y(l),{isLoading:n,data:C}=L(l);if(c||n)return null;const p=r?.[0]?.id,h=C?.[0]?.program.id;return!p&&!h?null:e.createElement(u,{to:p?t({playlistId:p}):a({trackId:h}),replace:!0})},T=()=>{const{entity:l}=s(),{playlistId:t}=d(f),a=m(E),{data:c}=y(l),r=c?.find(n=>n.id===t)?.trackIds[0];return r?e.createElement(u,{to:a({playlistId:t,trackId:r}),replace:!0}):null},F=()=>{const{entity:l}=s(),{playlistId:t,trackId:a}=d(E),{data:c}=R(l,a),r=m(I),n=c?.levels[0]?.checks[0]?.id;return n?e.createElement(u,{to:r({playlistId:t,trackId:a,checkId:n}),replace:!0}):null},P=()=>{const{entity:l}=s(),{trackId:t}=d(k),a=m(g),{data:c}=R(l,t),r=c?.levels?.find(n=>n.checks.length>0)?.checks[0].id;return r?e.createElement(u,{to:a({trackId:t,checkId:r}),replace:!0}):null},A=()=>e.createElement(v,null,e.createElement($,null,e.createElement(i,{path:I.path,element:e.createElement(o,null)}),e.createElement(i,{path:E.path,element:e.createElement(e.Fragment,null,e.createElement(o,null),e.createElement(F,null))}),e.createElement(i,{path:f.path,element:e.createElement(e.Fragment,null,e.createElement(o,null),e.createElement(T,null))}),e.createElement(i,{path:k.path,element:e.createElement(e.Fragment,null,e.createElement(o,null),e.createElement(P,null))}),e.createElement(i,{path:g.path,element:e.createElement(o,null)}),e.createElement(i,{path:"/",element:e.createElement(e.Fragment,null,e.createElement(o,null),e.createElement(x,null))})));export{P as RedirectToFirstCheck,T as RedirectToFirstPlaylistTrack,F as RedirectToFirstPlaylistTrackCheck,A as Router};
2
2
  //# sourceMappingURL=Router.esm.js.map