@spotify/backstage-plugin-soundcheck 0.9.1 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/README.md +102 -0
- package/config.d.ts +0 -9
- package/dist/esm/EntitySoundcheckContent-fddf6ba7.esm.js +2 -0
- package/dist/esm/OverviewPageContent-8f5b5b64.esm.js +2 -0
- package/dist/esm/{RefetchingIndicator-a31faa1d.esm.js → RefetchingIndicator-fd4435c2.esm.js} +2 -2
- package/dist/esm/index-277bccda.esm.js +2 -0
- package/dist/esm/index-76a92dde.esm.js +2 -0
- package/dist/esm/index-88bfe2d5.esm.js +456 -0
- package/dist/esm/{index-920b177e.esm.js → index-df582cac.esm.js} +2 -2
- package/dist/images/pagerduty.svg +3 -0
- package/dist/index.esm.js +1 -1
- package/package.json +16 -14
- package/dist/esm/EntitySoundcheckContent-d8bf249e.esm.js +0 -2
- package/dist/esm/OverviewPageContent-5557813a.esm.js +0 -2
- package/dist/esm/index-293deb4d.esm.js +0 -2
- package/dist/esm/index-927a757e.esm.js +0 -2
- package/dist/esm/index-c3aebdd7.esm.js +0 -429
|
@@ -0,0 +1,456 @@
|
|
|
1
|
+
import{createApiRef as xe,createRouteRef as D,createSubRouteRef as f,createPlugin as Ae,createApiFactory as Be,discoveryApiRef as ze,fetchApiRef as Me,createRoutableExtension as N,createComponentExtension as Ue,useApi as F,errorApiRef as He,useRouteRef as X}from"@backstage/core-plugin-api";import{GraphQLClient as We}from"graphql-request";import c from"graphql-tag";import n,{createContext as Y,useState as O,useCallback as $,useContext as Z,useRef as Qe,useEffect as je,Fragment as Ke}from"react";import{QueryClient as Ve,QueryClientProvider as _e,useQuery as z}from"@tanstack/react-query";import{memoize as Je}from"lodash";import Xe from"@material-ui/core/styles/makeStyles";import{makeStyles as p,Typography as u,Modal as Ye,Box as ee,Button as te,Fade as Ze,alpha as w,Tooltip as et,withStyles as q,Divider as tt}from"@material-ui/core";import{MarkdownContent as ae,Link as re,InfoCard as at}from"@backstage/core-components";import{useEntity as ne,humanizeEntityRef as ie}from"@backstage/plugin-catalog-react";import{useAutoUpdatingRelativeTime as rt,SpotifyLicenseBanner as nt}from"@spotify/backstage-plugin-core";import{stringifyEntityRef as se,parseEntityRef as ce}from"@backstage/catalog-model";import{Alert as it,Skeleton as k}from"@material-ui/lab";import{Link as st}from"react-router-dom";import b from"classnames";import ct from"@material-ui/icons/Schedule";import{DateTime as oe}from"luxon";import ot from"@material-ui/icons/Check";import lt from"@material-ui/icons/Close";import dt from"@material-ui/icons/RemoveCircleOutline";import mt from"@material-ui/icons/HelpOutline";import ut from"../images/empty-state.svg";var le=(e=>(e.Medal="MEDAL",e))(le||{}),y=(e=>(e.Failed="FAILED",e.NotApplicable="NOT_APPLICABLE",e.NotReported="NOT_REPORTED",e.Passed="PASSED",e))(y||{});const pt=c`
|
|
2
|
+
fragment CertificationSummary on Certification {
|
|
3
|
+
entityRef
|
|
4
|
+
program {
|
|
5
|
+
id
|
|
6
|
+
name
|
|
7
|
+
type
|
|
8
|
+
}
|
|
9
|
+
highestLevel {
|
|
10
|
+
ordinal
|
|
11
|
+
name
|
|
12
|
+
description
|
|
13
|
+
badge {
|
|
14
|
+
... on BadgeVariantMedal {
|
|
15
|
+
variant
|
|
16
|
+
options {
|
|
17
|
+
level
|
|
18
|
+
color
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
`,gt=c`
|
|
25
|
+
fragment check on Check {
|
|
26
|
+
id
|
|
27
|
+
name
|
|
28
|
+
description
|
|
29
|
+
}
|
|
30
|
+
`,de=c`
|
|
31
|
+
fragment level on Level {
|
|
32
|
+
ordinal
|
|
33
|
+
name
|
|
34
|
+
description
|
|
35
|
+
checks {
|
|
36
|
+
...check
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
${gt}`,ht=c`
|
|
40
|
+
fragment milestone on Milestone {
|
|
41
|
+
id
|
|
42
|
+
name
|
|
43
|
+
description
|
|
44
|
+
targetPercent
|
|
45
|
+
targetCompletionDate
|
|
46
|
+
}
|
|
47
|
+
`,ft=c`
|
|
48
|
+
fragment CheckResultSummary on CheckResult {
|
|
49
|
+
id
|
|
50
|
+
name
|
|
51
|
+
result
|
|
52
|
+
timestamp
|
|
53
|
+
}
|
|
54
|
+
`,yt=c`
|
|
55
|
+
fragment LevelResultDetails on LevelResult {
|
|
56
|
+
ordinal
|
|
57
|
+
name
|
|
58
|
+
description
|
|
59
|
+
badge {
|
|
60
|
+
... on BadgeVariantMedal {
|
|
61
|
+
variant
|
|
62
|
+
options {
|
|
63
|
+
level
|
|
64
|
+
color
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
certified
|
|
69
|
+
checks {
|
|
70
|
+
...CheckResultSummary
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
${ft}`,kt=c`
|
|
74
|
+
fragment CheckResultDetails on CheckResult {
|
|
75
|
+
id
|
|
76
|
+
name
|
|
77
|
+
description
|
|
78
|
+
result
|
|
79
|
+
timestamp
|
|
80
|
+
notes
|
|
81
|
+
}
|
|
82
|
+
`,vt=c`
|
|
83
|
+
fragment OverviewLevelResult on OverviewLevelResult {
|
|
84
|
+
ordinal
|
|
85
|
+
name
|
|
86
|
+
checks {
|
|
87
|
+
check {
|
|
88
|
+
id
|
|
89
|
+
name
|
|
90
|
+
description
|
|
91
|
+
}
|
|
92
|
+
results {
|
|
93
|
+
id
|
|
94
|
+
entityRef
|
|
95
|
+
result
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
`,me=c`
|
|
100
|
+
fragment HighestLevel on LevelResult {
|
|
101
|
+
entityRef
|
|
102
|
+
ordinal
|
|
103
|
+
name
|
|
104
|
+
badge {
|
|
105
|
+
... on BadgeVariantMedal {
|
|
106
|
+
variant
|
|
107
|
+
options {
|
|
108
|
+
color
|
|
109
|
+
level
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
`,Ct=c`
|
|
115
|
+
mutation archiveCampaign($campaignId: String!) {
|
|
116
|
+
campaignArchived: archiveCampaign(campaignId: $campaignId)
|
|
117
|
+
}
|
|
118
|
+
`,Rt=c`
|
|
119
|
+
mutation createCampaign($input: CampaignInput!) {
|
|
120
|
+
campaign: createCampaign(input: $input) {
|
|
121
|
+
id
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
`,Et=c`
|
|
125
|
+
mutation createCheck($input: CheckerInput!) {
|
|
126
|
+
check: createChecker(input: $input) {
|
|
127
|
+
id
|
|
128
|
+
filter
|
|
129
|
+
name
|
|
130
|
+
description
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
`,Pt=c`
|
|
134
|
+
mutation createProgram($input: ProgramInput!) {
|
|
135
|
+
program: createProgram(input: $input) {
|
|
136
|
+
id
|
|
137
|
+
ownerEntityRef
|
|
138
|
+
name
|
|
139
|
+
description
|
|
140
|
+
documentationURL
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
`,$t=c`
|
|
144
|
+
mutation deleteCampaign($campaignId: String!) {
|
|
145
|
+
campaignDeleted: deleteCampaign(campaignId: $campaignId)
|
|
146
|
+
}
|
|
147
|
+
`,wt=c`
|
|
148
|
+
mutation deleteChecker($checkerId: String!) {
|
|
149
|
+
deleteChecker(checkerId: $checkerId)
|
|
150
|
+
}
|
|
151
|
+
`,bt=c`
|
|
152
|
+
mutation deleteProgram($programId: String!) {
|
|
153
|
+
programDeleted: deleteProgram(programId: $programId)
|
|
154
|
+
}
|
|
155
|
+
`,It=c`
|
|
156
|
+
mutation updateCampaign($input: CampaignInput!) {
|
|
157
|
+
campaign: updateCampaign(input: $input) {
|
|
158
|
+
id
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
`,St=c`
|
|
162
|
+
mutation updateCheck($input: CheckerInput!) {
|
|
163
|
+
check: updateChecker(input: $input) {
|
|
164
|
+
id
|
|
165
|
+
filter
|
|
166
|
+
name
|
|
167
|
+
description
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
`,Dt=c`
|
|
171
|
+
mutation updateCollectorConfig($input: CollectorConfigInput!) {
|
|
172
|
+
collector: setCollectorConfig(input: $input) {
|
|
173
|
+
id
|
|
174
|
+
factNames
|
|
175
|
+
collectionConfigs {
|
|
176
|
+
factRefs
|
|
177
|
+
filter
|
|
178
|
+
frequency
|
|
179
|
+
cache
|
|
180
|
+
}
|
|
181
|
+
config
|
|
182
|
+
configSchema
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
`,Nt=c`
|
|
186
|
+
mutation updateProgram($input: ProgramInput!) {
|
|
187
|
+
program: updateProgram(input: $input) {
|
|
188
|
+
id
|
|
189
|
+
ownerEntityRef
|
|
190
|
+
name
|
|
191
|
+
description
|
|
192
|
+
documentationURL
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
`,Ft=c`
|
|
196
|
+
query getAllCertifications($entityRef: String!) {
|
|
197
|
+
certifications(entityRef: $entityRef, includeFilteredChecks: false) {
|
|
198
|
+
...CertificationSummary
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
${pt}`,Ot=c`
|
|
202
|
+
query getTracks($programIds: [String!], $first: Int, $after: String, $type: String) {
|
|
203
|
+
programs(programIds: $programIds, first: $first, after: $after, type: $type) {
|
|
204
|
+
totalCount
|
|
205
|
+
endCursor
|
|
206
|
+
hasNextPage
|
|
207
|
+
edges {
|
|
208
|
+
cursor
|
|
209
|
+
program {
|
|
210
|
+
id
|
|
211
|
+
ownerEntityRef
|
|
212
|
+
name
|
|
213
|
+
description
|
|
214
|
+
documentationURL
|
|
215
|
+
filter
|
|
216
|
+
levels {
|
|
217
|
+
...level
|
|
218
|
+
}
|
|
219
|
+
isEditable
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
${de}`,qt=c`
|
|
225
|
+
query getCampaigns($filter: ListCampaignsFilter!) {
|
|
226
|
+
campaigns(filter: $filter) {
|
|
227
|
+
totalCount
|
|
228
|
+
endCursor
|
|
229
|
+
hasNextPage
|
|
230
|
+
edges {
|
|
231
|
+
cursor
|
|
232
|
+
campaign {
|
|
233
|
+
id
|
|
234
|
+
name
|
|
235
|
+
description
|
|
236
|
+
ownerEntityRef
|
|
237
|
+
supportChannel
|
|
238
|
+
archived
|
|
239
|
+
startDate
|
|
240
|
+
targetCompletionDate
|
|
241
|
+
milestones {
|
|
242
|
+
...milestone
|
|
243
|
+
}
|
|
244
|
+
track {
|
|
245
|
+
id
|
|
246
|
+
ownerEntityRef
|
|
247
|
+
name
|
|
248
|
+
description
|
|
249
|
+
documentationURL
|
|
250
|
+
filter
|
|
251
|
+
levels {
|
|
252
|
+
...level
|
|
253
|
+
}
|
|
254
|
+
isEditable
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
${ht}
|
|
261
|
+
${de}`,Tt=c`
|
|
262
|
+
query getCertificationDetails($entityRef: String!, $programId: String!) {
|
|
263
|
+
programCertification(
|
|
264
|
+
entityRef: $entityRef
|
|
265
|
+
programId: $programId
|
|
266
|
+
includeFilteredChecks: false
|
|
267
|
+
) {
|
|
268
|
+
program {
|
|
269
|
+
id
|
|
270
|
+
name
|
|
271
|
+
description
|
|
272
|
+
documentationURL
|
|
273
|
+
}
|
|
274
|
+
highestLevel {
|
|
275
|
+
...HighestLevel
|
|
276
|
+
}
|
|
277
|
+
levels {
|
|
278
|
+
...LevelResultDetails
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
${me}
|
|
283
|
+
${yt}`,Gt=c`
|
|
284
|
+
query getCheckResultDetails($entityRef: String!, $programId: String!, $checkId: String!) {
|
|
285
|
+
checkResult(entityRef: $entityRef, programId: $programId, checkId: $checkId) {
|
|
286
|
+
...CheckResultDetails
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
${kt}`,Lt=c`
|
|
290
|
+
query getCheckers($ids: [String!], $first: Int, $after: String, $orderAlphabetical: String, $searchByOwner: String, $searchByName: String) {
|
|
291
|
+
checkers(
|
|
292
|
+
ids: $ids
|
|
293
|
+
first: $first
|
|
294
|
+
after: $after
|
|
295
|
+
orderAlphabetical: $orderAlphabetical
|
|
296
|
+
searchByOwner: $searchByOwner
|
|
297
|
+
searchByName: $searchByName
|
|
298
|
+
) {
|
|
299
|
+
totalCount
|
|
300
|
+
endCursor
|
|
301
|
+
hasNextPage
|
|
302
|
+
edges {
|
|
303
|
+
cursor
|
|
304
|
+
checker {
|
|
305
|
+
id
|
|
306
|
+
ownerEntityRef
|
|
307
|
+
supportChannel
|
|
308
|
+
name
|
|
309
|
+
description
|
|
310
|
+
rule
|
|
311
|
+
passedMessage
|
|
312
|
+
failedMessage
|
|
313
|
+
filter
|
|
314
|
+
isEditable
|
|
315
|
+
schedule
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
`,xt=c`
|
|
321
|
+
query getEntityRefsForTechHealthFilter($ownerEntityRef: String) {
|
|
322
|
+
entityRefsForTechHealthFilter(ownerEntityRef: $ownerEntityRef)
|
|
323
|
+
}
|
|
324
|
+
`,At=c`
|
|
325
|
+
query getFacetsForOwner($ownerEntityRef: String!) {
|
|
326
|
+
facetsForOwner(ownerEntityRef: $ownerEntityRef) {
|
|
327
|
+
types {
|
|
328
|
+
kind
|
|
329
|
+
type
|
|
330
|
+
count
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
`,Bt=c`
|
|
335
|
+
query getCollectors($ids: [String!]) {
|
|
336
|
+
collectors(ids: $ids) {
|
|
337
|
+
id
|
|
338
|
+
name
|
|
339
|
+
description
|
|
340
|
+
factNames
|
|
341
|
+
config
|
|
342
|
+
isConfigurable
|
|
343
|
+
isEditable
|
|
344
|
+
collectionConfigs {
|
|
345
|
+
factRefs
|
|
346
|
+
filter
|
|
347
|
+
frequency
|
|
348
|
+
cache
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
`,zt=c`
|
|
353
|
+
query getFactSchemas($collectorId: String!, $factName: String!) {
|
|
354
|
+
factSchema(collectorId: $collectorId, factName: $factName) {
|
|
355
|
+
schema
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
`,Mt=c`
|
|
359
|
+
query getIndividualCheckPassRates($filter: Filter) {
|
|
360
|
+
individualCheckPassRates(filter: $filter) {
|
|
361
|
+
id
|
|
362
|
+
checkName
|
|
363
|
+
checkDescription
|
|
364
|
+
checkOwnerRef
|
|
365
|
+
snapshotPassRate
|
|
366
|
+
trendPassRates
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
`,Ut=c`
|
|
370
|
+
query getIndividualEntityPassRates($filter: Filter) {
|
|
371
|
+
individualEntityPassRates(filter: $filter) {
|
|
372
|
+
id
|
|
373
|
+
entityDescription
|
|
374
|
+
entityOwnerRef
|
|
375
|
+
snapshotPassRate
|
|
376
|
+
trendPassRates
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
`,Ht=c`
|
|
380
|
+
query getIndividualGroupPassRates($filter: Filter) {
|
|
381
|
+
groupPassRates(filter: $filter) {
|
|
382
|
+
id
|
|
383
|
+
groupTitle
|
|
384
|
+
memberRefs
|
|
385
|
+
snapshotPassRate
|
|
386
|
+
trendPassRates
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
`,Wt=c`
|
|
390
|
+
query getIndividualTrackPassRate($filter: Filter) {
|
|
391
|
+
individualTrackPassRate(filter: $filter) {
|
|
392
|
+
id
|
|
393
|
+
trackName
|
|
394
|
+
trackDescription
|
|
395
|
+
trackOwnerRef
|
|
396
|
+
levels {
|
|
397
|
+
levelOrdinal
|
|
398
|
+
levelName
|
|
399
|
+
snapshotPassRate
|
|
400
|
+
trendPassRates
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
`,Qt=c`
|
|
405
|
+
query getOverallCheckPassRates($filter: Filter) {
|
|
406
|
+
overallCheckPassRates(filter: $filter)
|
|
407
|
+
}
|
|
408
|
+
`,jt=c`
|
|
409
|
+
query getOverallEntityPassRates($filter: Filter) {
|
|
410
|
+
overallEntityPassRates(filter: $filter) {
|
|
411
|
+
id
|
|
412
|
+
trendPassRates
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
`,Kt=c`
|
|
416
|
+
query getOverallGroupPassRates($filter: Filter) {
|
|
417
|
+
groupPassRates(filter: $filter, limit: 5) {
|
|
418
|
+
id
|
|
419
|
+
groupTitle
|
|
420
|
+
snapshotPassRate
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
`,Vt=c`
|
|
424
|
+
query getOverallTrackPassRate($filter: Filter) {
|
|
425
|
+
overallTrackPassRate(filter: $filter) {
|
|
426
|
+
levelOrdinal
|
|
427
|
+
snapshotPassRate
|
|
428
|
+
trendPassRates
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
`,_t=c`
|
|
432
|
+
query getProgramOverviewForOwner($ownerEntityRef: String!, $facet: FacetInput) {
|
|
433
|
+
programOverviewForOwner(
|
|
434
|
+
ownerEntityRef: $ownerEntityRef
|
|
435
|
+
facet: $facet
|
|
436
|
+
includeFilteredChecks: false
|
|
437
|
+
) {
|
|
438
|
+
programs {
|
|
439
|
+
program {
|
|
440
|
+
id
|
|
441
|
+
name
|
|
442
|
+
type
|
|
443
|
+
}
|
|
444
|
+
highestLevels {
|
|
445
|
+
...HighestLevel
|
|
446
|
+
}
|
|
447
|
+
levels {
|
|
448
|
+
...OverviewLevelResult
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
entityRefs
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
${me}
|
|
455
|
+
${vt}`,Jt=(e,t,a)=>e();function Xt(e,t=Jt){return{archiveCampaign(a,r){return t(i=>e.request(Ct,a,{...r,...i}),"archiveCampaign","mutation")},createCampaign(a,r){return t(i=>e.request(Rt,a,{...r,...i}),"createCampaign","mutation")},createCheck(a,r){return t(i=>e.request(Et,a,{...r,...i}),"createCheck","mutation")},createProgram(a,r){return t(i=>e.request(Pt,a,{...r,...i}),"createProgram","mutation")},deleteCampaign(a,r){return t(i=>e.request($t,a,{...r,...i}),"deleteCampaign","mutation")},deleteChecker(a,r){return t(i=>e.request(wt,a,{...r,...i}),"deleteChecker","mutation")},deleteProgram(a,r){return t(i=>e.request(bt,a,{...r,...i}),"deleteProgram","mutation")},updateCampaign(a,r){return t(i=>e.request(It,a,{...r,...i}),"updateCampaign","mutation")},updateCheck(a,r){return t(i=>e.request(St,a,{...r,...i}),"updateCheck","mutation")},updateCollectorConfig(a,r){return t(i=>e.request(Dt,a,{...r,...i}),"updateCollectorConfig","mutation")},updateProgram(a,r){return t(i=>e.request(Nt,a,{...r,...i}),"updateProgram","mutation")},getAllCertifications(a,r){return t(i=>e.request(Ft,a,{...r,...i}),"getAllCertifications","query")},getTracks(a,r){return t(i=>e.request(Ot,a,{...r,...i}),"getTracks","query")},getCampaigns(a,r){return t(i=>e.request(qt,a,{...r,...i}),"getCampaigns","query")},getCertificationDetails(a,r){return t(i=>e.request(Tt,a,{...r,...i}),"getCertificationDetails","query")},getCheckResultDetails(a,r){return t(i=>e.request(Gt,a,{...r,...i}),"getCheckResultDetails","query")},getCheckers(a,r){return t(i=>e.request(Lt,a,{...r,...i}),"getCheckers","query")},getEntityRefsForTechHealthFilter(a,r){return t(i=>e.request(xt,a,{...r,...i}),"getEntityRefsForTechHealthFilter","query")},getFacetsForOwner(a,r){return t(i=>e.request(At,a,{...r,...i}),"getFacetsForOwner","query")},getCollectors(a,r){return t(i=>e.request(Bt,a,{...r,...i}),"getCollectors","query")},getFactSchemas(a,r){return t(i=>e.request(zt,a,{...r,...i}),"getFactSchemas","query")},getIndividualCheckPassRates(a,r){return t(i=>e.request(Mt,a,{...r,...i}),"getIndividualCheckPassRates","query")},getIndividualEntityPassRates(a,r){return t(i=>e.request(Ut,a,{...r,...i}),"getIndividualEntityPassRates","query")},getIndividualGroupPassRates(a,r){return t(i=>e.request(Ht,a,{...r,...i}),"getIndividualGroupPassRates","query")},getIndividualTrackPassRate(a,r){return t(i=>e.request(Wt,a,{...r,...i}),"getIndividualTrackPassRate","query")},getOverallCheckPassRates(a,r){return t(i=>e.request(Qt,a,{...r,...i}),"getOverallCheckPassRates","query")},getOverallEntityPassRates(a,r){return t(i=>e.request(jt,a,{...r,...i}),"getOverallEntityPassRates","query")},getOverallGroupPassRates(a,r){return t(i=>e.request(Kt,a,{...r,...i}),"getOverallGroupPassRates","query")},getOverallTrackPassRate(a,r){return t(i=>e.request(Vt,a,{...r,...i}),"getOverallTrackPassRate","query")},getProgramOverviewForOwner(a,r){return t(i=>e.request(_t,a,{...r,...i}),"getProgramOverviewForOwner","query")}}}var ue=(e,t,a)=>{if(!t.has(e))throw TypeError("Cannot "+a)},s=(e,t,a)=>(ue(e,t,"read from private field"),a?a.call(e):t.get(e)),I=(e,t,a)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,a)},M=(e,t,a,r)=>(ue(e,t,"write to private field"),r?r.call(e,a):t.set(e,a),a),T,G,o,U,l;const S=xe({id:"plugin.soundcheck"}),Yt=e=>"response"in e&&"errors"in e.response,Zt=e=>"response"in e&&"message"in e.response;class ea{constructor(t){I(this,T,void 0),I(this,G,void 0),I(this,o,void 0),I(this,U,r=>{var i,d,m;return Yt(r)?(m=(d=(i=r.response)==null?void 0:i.errors)==null?void 0:d[0].message)!=null?m:`${r}`:Zt(r)?r.response.message:`${r}`}),I(this,l,async r=>{try{return await r()}catch(i){throw new Error(`Error from Soundcheck backend: ${s(this,U).call(this,i)}`)}}),M(this,T,t.fetchApi),M(this,G,t.discoveryApi);const a=new We("/graphql",{fetch:async(r,i)=>{const d=`${await s(this,G).getBaseUrl("soundcheck")}${r}`;return s(this,T).fetch(d,i)}});M(this,o,Xt(a))}async getAllCertifications(t){return s(this,l).call(this,async()=>{const{certifications:a}=await s(this,o).getAllCertifications({entityRef:t});return a})}async getCertificationDetails(t,a){return s(this,l).call(this,async()=>{const{programCertification:r}=await s(this,o).getCertificationDetails({entityRef:t,programId:a});return r})}async getCheckResultDetails(t,a,r){return s(this,l).call(this,async()=>{const{checkResult:i}=await s(this,o).getCheckResultDetails({entityRef:t,programId:a,checkId:r});return i})}async getFacetsForOwner(t){return s(this,l).call(this,async()=>{const{facetsForOwner:a}=await s(this,o).getFacetsForOwner({ownerEntityRef:t});return a})}async getProgramOverviewForOwner(t,a){return s(this,l).call(this,async()=>{const{programOverviewForOwner:r}=await s(this,o).getProgramOverviewForOwner({ownerEntityRef:t,facet:a});return r})}async getTracks(t,a,r,i){return s(this,l).call(this,async()=>{const{programs:d}=await s(this,o).getTracks({programIds:t,first:a,after:r,type:i});return d})}async createProgram(t){return s(this,l).call(this,async()=>{const{program:a}=await s(this,o).createProgram({input:t});return a})}async updateProgram(t){return s(this,l).call(this,async()=>{const{program:a}=await s(this,o).updateProgram({input:t});return a})}async deleteProgram(t){return s(this,l).call(this,async()=>{const{programDeleted:a}=await s(this,o).deleteProgram({programId:t});return a})}async getChecks(t,a,r){return s(this,l).call(this,async()=>{const{checkers:i}=await s(this,o).getCheckers({ids:t,first:a,after:r});return i})}async createCheck(t){return s(this,l).call(this,async()=>{const{check:a}=await s(this,o).createCheck({input:t});return a})}async updateCheck(t){return s(this,l).call(this,async()=>{const{check:a}=await s(this,o).updateCheck({input:t});return a})}async deleteCheck(t){return s(this,l).call(this,async()=>await s(this,o).deleteChecker({checkerId:t}))}async getCollectors(t){return s(this,l).call(this,async()=>{const{collectors:a}=await s(this,o).getCollectors({ids:t});return a})}async getFactSchema(t,a){if(!(!t||!a))return s(this,l).call(this,async()=>{const{factSchema:r}=await s(this,o).getFactSchemas({collectorId:t,factName:a});return r})}async updateCollectorConfig(t){return s(this,l).call(this,async()=>{const{collector:a}=await s(this,o).updateCollectorConfig({input:t});return a})}async getOverallCheckPassRates(t){return s(this,l).call(this,async()=>await s(this,o).getOverallCheckPassRates({filter:t}))}async getIndividualCheckPassRates(t){return s(this,l).call(this,async()=>await s(this,o).getIndividualCheckPassRates({filter:t}))}async getOverallTrackPassRate(t){return s(this,l).call(this,async()=>await s(this,o).getOverallTrackPassRate({filter:t}))}async getIndividualTrackPassRate(t){return s(this,l).call(this,async()=>await s(this,o).getIndividualTrackPassRate({filter:t}))}async getOverallEntityPassRates(t){return s(this,l).call(this,async()=>await s(this,o).getOverallEntityPassRates({filter:t}))}async getIndividualEntityPassRates(t){return s(this,l).call(this,async()=>await s(this,o).getIndividualEntityPassRates({filter:t}))}async getOverallGroupPassRates(t){return s(this,l).call(this,async()=>await s(this,o).getOverallGroupPassRates({filter:t}))}async getIndividualGroupPassRates(t){return s(this,l).call(this,async()=>await s(this,o).getIndividualGroupPassRates({filter:t}))}async getEntityRefsForTechHealthFilter(t){return s(this,l).call(this,async()=>await s(this,o).getEntityRefsForTechHealthFilter({ownerEntityRef:t}))}async getCampaigns(t){return s(this,l).call(this,async()=>{const{campaigns:a}=await s(this,o).getCampaigns({filter:t});return a})}async createCampaign(t){return s(this,l).call(this,async()=>{const{campaign:a}=await s(this,o).createCampaign({input:t});return a})}async updateCampaign(t){return s(this,l).call(this,async()=>{const{campaign:a}=await s(this,o).updateCampaign({input:t});return a})}async deleteCampaign(t){return s(this,l).call(this,async()=>{const{campaignDeleted:a}=await s(this,o).deleteCampaign({campaignId:t});return a})}async archiveCampaign(t){return s(this,l).call(this,async()=>{const{campaignArchived:a}=await s(this,o).archiveCampaign({campaignId:t});return a})}}T=new WeakMap,G=new WeakMap,o=new WeakMap,U=new WeakMap,l=new WeakMap;const L=D({id:"soundcheck-entity"}),ta=D({id:"soundcheck-group"}),pe=f({id:"soundcheck-entity-certification-track-redirect",parent:L,path:"/:trackId"}),ge=f({id:"soundcheck-entity-certification",parent:L,path:"/:trackId/:checkId"}),aa=D({id:"soundcheck-overview"}),v=D({id:"soundcheck"}),ra=f({id:"soundcheck-checks",parent:v,path:"/checks"}),na=f({id:"soundcheck-check-details",parent:v,path:"/checks/:checkId"}),ia=f({id:"soundcheck-tracks",parent:v,path:"/tracks"}),sa=f({id:"soundcheck-track-details",parent:v,path:"/tracks/:trackId"}),ca=f({id:"soundcheck-campaigns",parent:v,path:"/campaigns"}),oa=f({id:"soundcheck-campaign-details",parent:v,path:"/campaigns/:campaignId"}),la=f({id:"soundcheck-campaign-edit",parent:v,path:"/campaigns/:campaignId/edit"}),da=f({id:"soundcheck-tech-health",parent:v,path:"/tech-health"}),E=Ae({id:"soundcheck",apis:[Be({api:S,deps:{discoveryApi:ze,fetchApi:Me},factory:e=>new ea(e)})],routes:{entityContent:L}}),ma=E.provide(N({name:"EntitySoundcheckContent",component:()=>import("./EntitySoundcheckContent-fddf6ba7.esm.js").then(e=>e.EntitySoundcheckContent),mountPoint:L})),ua=E.provide(Ue({name:"EntitySoundcheckCard",component:{lazy:()=>import("./index-df582cac.esm.js").then(e=>e.EntitySoundcheckCard)}})),pa=E.provide(N({name:"GroupSoundcheckContent",component:()=>import("./index-277bccda.esm.js").then(e=>e.FixedGroupOverviewPage),mountPoint:ta})),ga=E.provide(N({name:"SoundcheckOverviewPage",component:()=>import("./index-277bccda.esm.js").then(e=>e.OverviewPage),mountPoint:aa})),ha=E.provide(N({name:"SoundcheckRoutingPage",component:()=>import("./index-76a92dde.esm.js").then(e=>e.RoutingPage),mountPoint:v})),fa=Je(e=>new Ve({defaultOptions:{queries:{refetchInterval:6e4,refetchIntervalInBackground:!1,refetchOnWindowFocus:"always",retry:2,retryDelay:t=>{const a=450+Math.ceil(Math.random()*100);return Math.min(a*2**t,3e4)},onError:t=>e.post(t)}}})),ya=e=>{const t=F(He),a=fa(t);return n.createElement(_e,{client:a},e.children)};function he(e){const t=F(S),a=se(e);return z(["soundcheck/certifications",a],async()=>t.getAllCertifications(a))}function fe(e,t){const a=F(S),r=se(e);return z(["soundcheck/certifications",r,t],async()=>a.getCertificationDetails(r,t),{enabled:!!t})}var H=(e=>(e.GetAllPrograms="soundcheck/programs",e.GetChecks="soundcheck/checks",e.GetCollectors="soundcheck/collectors",e.GetFactSchema="soundcheck/collectors/schema",e.GetEntityFacets="soundcheck/catalog/facets",e.GetSoftwareEntityRefsForUser="soundcheck/entities/softwareEntityRefsForUser",e.GetCampaigns="soundcheck/campaigns",e.GetOverallCheckPassRates="soundcheck/charts/overallCheckPassRates",e.GetIndividualCheckPassRate="soundcheck/charts/getIndividualCheckPassRate",e.GetOverallTrackPassRate="soundcheck/charts/overallTrackPassRate",e.GetIndividualTrackPassRate="soundcheck/charts/individualTrackPassRate",e.GetOverallEntityPassRates="soundcheck/charts/overallEntityPassRates",e.GetIndividualEntityPassRate="soundcheck/charts/individualEntityPassRate",e.GetOverallGroupPassRates="soundcheck/charts/overallGroupPassRates",e.GetIndividualGroupPassRates="soundcheck/charts/individualGroupPassRates",e.EntityByRef="soundcheck/catalog/entityByRef",e.EntitiesByRefs="soundcheck/catalog/entitiesByRef",e))(H||{}),ye=(e=>(e.DeleteCheck="soundcheck/deleteCheck",e.CreateCheck="soundcheck/createCheck",e.UpdateCheck="soundcheck/updateCheck",e.DeleteProgram="soundcheck/deleteProgram",e.CreateProgram="soundcheck/createProgram",e.UpdateProgram="soundcheck/updateProgram",e.UpdateCollectorConfig="soundcheck/updateCollectorConfig",e.CreateCampaign="soundcheck/createCampaign",e.UpdateCampaign="soundcheck/updateCampaign",e.DeleteCampaign="soundcheck/deleteCampaign",e.ArchiveCampaign="soundcheck/archiveCampaign",e))(ye||{});const ka=p(e=>({root:{padding:e.spacing(3)},icon:{display:"none"},message:{padding:0},type:{fontWeight:700,lineHeight:1.75}})),x=e=>{const{type:t,...a}=ka();return n.createElement(it,{severity:e.severity,elevation:1,classes:a,onClose:e.onClose},n.createElement(u,{classes:{root:t}},e.title),e.children)},ke=Y({}),va=e=>{const[t,a]=O(),r=$(d=>{a(d)},[]),i=$(()=>{a(null)},[]);return n.createElement(ke.Provider,{value:{showAlert:r,clearAlert:i}},t&&n.createElement(x,{severity:t.severity,title:t.title,onClose:i},t.message),e.children)},Ca=()=>Z(ke);function ve(e){const t=F(S);return z([H.GetAllPrograms,e],async()=>t.getTracks([e]))}const Ra=p(e=>({modalContent:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",padding:"25px",backgroundColor:e.palette.type==="dark"?e.palette.grey[800]:e.palette.grey[200]},modalButtons:{display:"flex",justifyContent:"space-evenly","& button":{width:"40%",maxWidth:"185px"}},modalMessage:{margin:"15px 0 35px"}})),Ce=Y({}),Ea=e=>{const t=Ra(),[a,r]=O(!1),[i,d]=O(),m=Qe(),g=$(({title:R,message:C,error:Ge})=>(d({title:R,message:C,error:Ge}),r(!0),new Promise(Le=>{m.current=Le})),[]),P=$(()=>{m.current&&m.current(!0),r(!1)},[]),h=$(()=>{m.current&&m.current(!1),r(!1)},[]);return n.createElement(Ce.Provider,{value:{showModal:g}},e.children,i&&n.createElement(Ye,{open:a,onClose:h,"aria-labelledby":"confirmation-modal-title","aria-describedby":"confirmation-modal-description"},n.createElement(ee,{className:t.modalContent},n.createElement(u,{id:"confirmation-modal-title",variant:"h6"},i.title),n.createElement(u,{className:t.modalMessage,id:"confirmation-modal-description",variant:"body1"},i.message),n.createElement("div",{className:t.modalButtons},!i.error&&n.createElement(te,{onClick:h,variant:"contained","aria-label":"cancel"},"Cancel"),n.createElement(te,{color:"primary",onClick:P,variant:"contained","aria-label":"confirm"},i.error?"Ok":"Confirm")))))},Pa=()=>Z(Ce),Re=24,$a=11,W=e=>e==="small"?1:2,wa=p({root:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:"50%",borderWidth:"2px",fontWeight:700,width:({size:e})=>`${Re*W(e)}px`,height:({size:e})=>`${Re*W(e)}px`,fontSize:({size:e})=>`${$a*W(e)}px`}}),Q=({className:e,label:t,size:a="small"})=>{const r=wa({size:a});return n.createElement("span",{className:b(e,r.root),role:"img","aria-label":`${t} badge`},t)},ba=p(e=>({root:{background:({color:t})=>t,color:e.palette.common.black,borderColor:e.palette.common.black,borderStyle:"solid","&::after":{position:"absolute",display:"block",content:'""',top:0,left:0,width:"100%",height:"100%",borderRadius:"50%",boxShadow:["inset 0 -0.18em 0 0 rgba(0, 0, 0, 0.25)","inset 0px 0.18em 0px 0px rgba(255, 255, 255, 0.5)","inset 0px 1.3em 0px -0.5em rgba(255, 255, 255, 0.2)"].join(",")}}})),j=({className:e,badge:t,size:a="small"})=>{const r=ba({color:t.options.color,size:a});return n.createElement(Q,{className:b(e,r.root),size:a,label:`L${t.options.level}`})},Ia=p({root:{borderColor:"currentColor",borderStyle:"solid"}}),Ee=({className:e,size:t="small"})=>{const a=Ia();return n.createElement(Q,{className:b(e,a.root),size:t,label:"C"})},Sa=p({root:{borderColor:"currentColor",borderStyle:"dashed"}}),Pe=({className:e,size:t="small"})=>{const a=Sa();return n.createElement(Q,{className:b(e,a.root),size:t,label:"NL"})},$e=({badge:e,className:t,size:a="small",isCampaign:r})=>{const i=t||"";let d=n.createElement(Pe,{className:i,size:a});return r?d=n.createElement(Ee,{className:i,size:a}):e&&(d=n.createElement(j,{className:i,size:a,badge:e})),d},K=p(e=>({description:{padding:0,margin:0,display:"block","& p":{margin:0}},root:{padding:e.spacing(2),margin:0,display:"grid",gridTemplateColumns:"min-content auto",gridGap:e.spacing(2)},title:{fontSize:e.typography.pxToRem(18),fontWeight:700,lineHeight:1.235,marginBottom:"6px"},level:{textTransform:"uppercase",color:e.palette.text.secondary,fontWeight:700,letterSpacing:"1px"}}));function Da({description:e,documentationUrl:t}){const a=K();return t?n.createElement("div",{className:a.description},n.createElement(ae,{content:e}),n.createElement(re,{to:t},"Learn more")):n.createElement("div",{className:a.description},n.createElement(ae,{content:e}))}const we=({name:e,level:t,badge:a,description:r,documentationUrl:i,isCampaign:d=!1})=>{const m=K();return n.createElement("div",{className:m.root},n.createElement($e,{badge:a,isCampaign:d,size:"large"}),n.createElement("div",null,!d&&n.createElement(u,{variant:"caption",className:m.level},t!=null?t:"No Level"),n.createElement(u,{className:m.title},e),r&&n.createElement(Da,{description:r,documentationUrl:i})))},A=({children:e})=>{const[t,a]=O(!1);return je(()=>{const r=setTimeout(()=>{a(!0)},250);return()=>clearTimeout(r)},[]),n.createElement(Ze,{in:t,timeout:250},e)},V=({hideDescription:e=!1})=>{const t=K();return n.createElement(A,null,n.createElement("div",{className:t.root},n.createElement(k,{width:44,height:44}),n.createElement("div",null,n.createElement(u,{variant:"caption",className:t.level},n.createElement(k,{width:100})),n.createElement(u,{variant:"h4",className:t.title},n.createElement(k,{width:300})),!e&&n.createElement(u,{variant:"body2"},n.createElement(k,null)))))},be=p(e=>{const t=e.palette.type==="dark"?e.palette.grey[700]:e.palette.grey[100];return{wrapper:{backgroundColor:t,color:w(e.palette.getContrastText(t),.8),fontSize:e.typography.caption.fontSize,minHeight:"auto",borderTop:`1px solid ${e.palette.divider}`,borderBottom:`1px solid ${e.palette.divider}`,padding:e.spacing(1),display:"grid",gridTemplateAreas:({badge:a})=>[`"${a?"badge":"title"} title"`,`"${a?".":"description"} description"`].join(" "),gridTemplateColumns:"auto 1fr"},title:{gridArea:"title",textTransform:"uppercase",fontWeight:"bold",color:w(e.palette.getContrastText(t),.8),fontSize:e.typography.body2.fontSize,paddingTop:e.spacing(.5),paddingBottom:e.spacing(.5),lineHeight:1},badge:{gridArea:"badge",marginRight:e.spacing(1)},description:{gridArea:"description",color:w(e.palette.getContrastText(t),.8),fontSize:e.typography.subtitle2.fontSize,marginTop:e.spacing(1)}}}),Na=e=>{const t=be({badge:e.badge});return n.createElement("div",{className:t.wrapper},e.badge?n.createElement(j,{className:t.badge,badge:e.badge}):null,n.createElement(u,{className:t.title},e.title),e.description?n.createElement(u,{className:t.description},e.description):null)},Fa=()=>{const e=be({});return n.createElement(A,null,n.createElement("div",{className:e.wrapper},n.createElement(k,{className:e.title}),n.createElement(u,{className:e.description},n.createElement(k,null))))},Oa=p(e=>({root:{display:"inline-flex",alignItems:"center",gap:e.spacing(1)}})),Ie=({timestamp:e,description:t})=>{const a=Oa(),r=oe.fromISO(e).toLocaleString(oe.DATETIME_FULL),i=rt(e),d=t?`${t}: ${i}`:void 0;return n.createElement("div",{className:a.root},n.createElement(et,{title:r},n.createElement(u,{variant:"caption","aria-label":d},i)),n.createElement(ct,null))},qa=e=>({[y.Passed]:"Check passed",[y.NotReported]:"Check not reported",[y.Failed]:"Check failed",[y.NotApplicable]:"Check not applicable"})[e],Ta=q(e=>({root:{color:e.palette.success.main}}))(ot),Ga=q(e=>({root:{color:e.palette.error.main}}))(lt),La=q(e=>({root:{color:e.palette.info.main}}))(mt),xa=q(e=>({root:{color:e.palette.text.disabled}}))(dt),Se=({result:e,className:t})=>{const a={className:t,"aria-label":qa(e),"aria-hidden":!1};return e===y.Passed?n.createElement(Ta,{...a}):e===y.NotReported?n.createElement(La,{...a}):e===y.Failed?n.createElement(Ga,{...a}):e===y.NotApplicable?n.createElement(xa,{...a}):null},De=p(e=>({root:{display:"grid",width:"100%",gridTemplateColumns:"auto 1fr auto",gridColumnGap:e.spacing(1),padding:e.spacing(1),alignItems:"center","&.selected":{backgroundColor:w(e.palette.primary[e.palette.type],.2)},"&:hover, &:active, &:focus":{backgroundColor:w(e.palette.primary[e.palette.type],.3)}}})),Aa=({className:e,href:t,children:a})=>t?n.createElement(st,{to:t,className:e},a):n.createElement("div",{className:e},a),Ba=({result:e,name:t,timestamp:a,selected:r=!1,href:i})=>{const d=De(),m=b(d.root,{selected:r});return n.createElement(Aa,{href:i,className:m},n.createElement(Se,{result:e}),n.createElement(u,{variant:"body2"},t),a?n.createElement(Ie,{timestamp:a}):null)},_=()=>{const e=De();return n.createElement(A,null,n.createElement("div",{className:e.root},n.createElement(k,{width:24,height:24}),n.createElement(u,{variant:"body2"},n.createElement(k,null)),n.createElement(k,{width:100,height:24})))},za=()=>{const e=Ne();return n.createElement("div",{className:e.root},n.createElement(V,null),new Array(3).fill(null).map((t,a)=>n.createElement(n.Fragment,{key:`skeleton-level-${a}`},n.createElement(Fa,null),n.createElement("ul",{className:e.checks},n.createElement(_,null),n.createElement(_,null),n.createElement(_,null)))))},Ma=p(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"}}})),Ua=({checks:e,trackId:t,checkId:a})=>{const r=Ma(),i=X(ge);return e.length?n.createElement("ul",{className:r.checks},e.map(d=>n.createElement("li",{key:d.id,className:r.checkItem},n.createElement(Ba,{...d,selected:d.id===a,href:i({trackId:t,checkId:d.id})})))):n.createElement(u,{variant:"body2",className:r.noChecks},"No applicable checks at this level.")},Ha=({level:e,checkId:t,trackId:a,isCampaign:r})=>{var i;return n.createElement(n.Fragment,null,!r&&n.createElement(Na,{badge:e.badge,title:e.name,description:e.description}),n.createElement(Ua,{checks:(i=e.checks)!=null?i:[],trackId:a,checkId:t}))},Ne=p(e=>({root:{borderRight:`1px solid ${e.palette.divider}`},checks:{padding:0,margin:0,flex:1,listStyle:"none"}})),Wa=({trackId:e,checkId:t})=>{var a,r;const i=Ne(),{entity:d}=ne(),{data:m,isLoading:g,isError:P}=fe(d,e),{data:h}=ve(e!=null?e:""),R=!(h!=null&&h.totalCount);return P?n.createElement("div",{className:i.root},n.createElement(ee,{padding:2},n.createElement(x,{severity:"error",title:"Error loading certification"}))):g||!e?n.createElement(za,null):m?n.createElement("div",{className:i.root},n.createElement(we,{name:m.program.name,level:(a=m.highestLevel)==null?void 0:a.name,badge:(r=m.highestLevel)==null?void 0:r.badge,description:m.program.description,documentationUrl:m.program.documentationURL,isCampaign:!(h!=null&&h.totalCount)}),m==null?void 0:m.levels.map(C=>n.createElement(Ha,{key:C.ordinal,level:C,checkId:t,trackId:e,isCampaign:R}))):null},Qa=()=>n.createElement(n.Fragment,null,n.createElement(V,{hideDescription:!0}),n.createElement(V,{hideDescription:!0})),ja=p(e=>({card:{backgroundColor:e.palette.background.paper,border:`1px solid ${e.palette.border}`,borderRadius:e.shape.borderRadius,display:"flex",padding:e.spacing(5)},container:{margin:"0 auto",display:"flex",flexDirection:"row",alignItems:"center",gap:e.spacing(5)},content:{width:"20rem",display:"flex",flexDirection:"column",gap:e.spacing(2)},header:{display:"flex",flexDirection:"column",gap:e.spacing(2)},description:{color:e.palette.grey[600],fontWeight:500},action:{display:"inline-block"},img:{maxHeight:400}})),J=({title:e,description:t,imgSrc:a,action:r})=>{const i=ja();return n.createElement("div",{className:i.card},n.createElement("div",{className:i.container},n.createElement("div",{className:i.content},n.createElement("header",{className:i.header},n.createElement(u,{variant:"h5"},e),n.createElement(u,{variant:"body1",className:i.description},t)),r&&n.createElement("div",{className:i.action},r)),n.createElement("div",null,n.createElement("img",{src:a!=null?a:ut,className:i.img,alt:e}))))},Ka="No certifications available",Fe=({ownerEntityRef:e,selectGroupHint:t})=>{let a="There are no tracks configured that apply to this entity.";return e&&(a=`Looks like the group '${ie(ce(e),{defaultKind:"Group"})}' doesn't own any entities that have any applicable tracks configured. ${t}`),n.createElement(J,{title:Ka,description:a})},Va="Missing entities",_a=({ownerEntityRef:e,selectGroupHint:t})=>{if(!e)return null;const a=ie(ce(e),{defaultKind:"Group"});return n.createElement(J,{title:Va,description:`The group '${a}' doesn't own any entities. ${t!=null?t:""}`})},Oe="soundcheck",qe="Submitted check results will still be stored, but it will not be possible to view certifications or individual results until a valid license is present.",Te=Xe(e=>({certificationWrapper:{display:"flex",justifyContent:"space-between",alignItems:"center"},infoCard:{display:"grid",gridRowGap:e.spacing(2)},emptyState:{overflow:"hidden"}})),B=({children:e,title:t})=>{const a=Te();return n.createElement(at,{title:t},n.createElement("div",{className:a.infoCard},n.createElement(nt,{inline:!0,backend:Oe,invalidLicenseMessage:qe}),e))},Ja=({title:e="Soundcheck"})=>{const{entity:t}=ne(),a=Te(),{data:r,isError:i,isLoading:d}=he(t),m=X(pe);return i?n.createElement(B,{title:e},n.createElement(x,{severity:"error",title:"Error loading certifications"})):d||!r?n.createElement(B,{title:e},n.createElement(Qa,null)):r.length?n.createElement(B,{title:e},r.map((g,P)=>{var h,R,C;return n.createElement(Ke,{key:g.program.name},n.createElement("div",{className:a.certificationWrapper,"data-testid":"soundcheck-track-row"},n.createElement(we,{key:g.program.id,name:g.program.name,badge:(h=g.highestLevel)==null?void 0:h.badge,level:(R=g.highestLevel)==null?void 0:R.name,isCampaign:((C=g.program)==null?void 0:C.type)==="campaign"}),n.createElement(re,{to:m({trackId:g.program.id})},"View Details")),P<r.length-1?n.createElement(tt,null):null)})):n.createElement(B,{title:e},n.createElement("div",{className:a.emptyState},n.createElement(Fe,null)))};export{x as A,le as B,$e as C,va as D,J as E,A as F,E as G,ma as H,ua as I,pa as J,ga as K,j as L,ye as M,Fe as N,ha as O,H as Q,y as R,ya as S,Ie as a,ve as b,he as c,pe as d,Wa as e,Oe as f,ge as g,Ja as h,qe as i,Se as j,Pe as k,Ee as l,_a as m,oa as n,la as o,ca as p,Ca as q,Pa as r,S as s,na as t,fe as u,sa as v,Ea as w,ia as x,ra as y,da as z};
|
|
456
|
+
//# sourceMappingURL=index-88bfe2d5.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import t from"react";import{S as o,
|
|
2
|
-
//# sourceMappingURL=index-
|
|
1
|
+
import t from"react";import{S as o,h as i}from"./index-88bfe2d5.esm.js";import"@backstage/core-plugin-api";import"graphql-request";import"graphql-tag";import"@tanstack/react-query";import"lodash";import"@material-ui/core/styles/makeStyles";import"@material-ui/core";import"@backstage/core-components";import"@backstage/plugin-catalog-react";import"@spotify/backstage-plugin-core";import"@backstage/catalog-model";import"@material-ui/lab";import"react-router-dom";import"classnames";import"@material-ui/icons/Schedule";import"luxon";import"@material-ui/icons/Check";import"@material-ui/icons/Close";import"@material-ui/icons/RemoveCircleOutline";import"@material-ui/icons/HelpOutline";import"../images/empty-state.svg";const m=({title:r})=>t.createElement(o,null,t.createElement(i,{title:r}));export{m as EntitySoundcheckCard};
|
|
2
|
+
//# sourceMappingURL=index-df582cac.esm.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="512" height="512" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill="#22c55e" d="M6 16.673h2.93V22H6zM17.034 2.977C15.46 2.139 14.37 2 11.796 2H6v12.124h5.77c2.296 0 4.008-.14 5.517-1.141a5.769 5.769 0 0 0 2.499-4.997a5.487 5.487 0 0 0-2.752-5.01Zm-4.591 8.61H8.93V4.6l3.31-.026c3.018-.038 4.527 1.028 4.527 3.437c0 2.588-1.864 3.577-4.324 3.577Z"/>
|
|
3
|
+
</svg>
|
package/dist/index.esm.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{I as f,H as l,J as w,K as x,O as H,G as I}from"./esm/index-88bfe2d5.esm.js";import"react";import"@backstage/core-plugin-api";import"graphql-request";import"graphql-tag";import"@tanstack/react-query";import"lodash";import"@material-ui/core/styles/makeStyles";import"@material-ui/core";import"@backstage/core-components";import"@backstage/plugin-catalog-react";import"@spotify/backstage-plugin-core";import"@backstage/catalog-model";import"@material-ui/lab";import"react-router-dom";import"classnames";import"@material-ui/icons/Schedule";import"luxon";import"@material-ui/icons/Check";import"@material-ui/icons/Close";import"@material-ui/icons/RemoveCircleOutline";import"@material-ui/icons/HelpOutline";import"./images/empty-state.svg";export{f as EntitySoundcheckCard,l as EntitySoundcheckContent,w as GroupSoundcheckContent,x as SoundcheckOverviewPage,H as SoundcheckRoutingPage,I as soundcheckPlugin};
|
|
2
2
|
//# sourceMappingURL=index.esm.js.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spotify/backstage-plugin-soundcheck",
|
|
3
3
|
"description": "Ensure quality, reliability and alignment of software development with codified checks and guidance.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.10.0",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"homepage": "https://backstage.spotify.com",
|
|
7
7
|
"main": "dist/index.esm.js",
|
|
@@ -27,21 +27,22 @@
|
|
|
27
27
|
"prepare": "yarn generate"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@backstage/catalog-client": "^1.
|
|
30
|
+
"@backstage/catalog-client": "^1.5.0",
|
|
31
31
|
"@backstage/catalog-model": "^1.4.3",
|
|
32
|
-
"@backstage/core-components": "^0.13.
|
|
33
|
-
"@backstage/core-plugin-api": "^1.8.
|
|
34
|
-
"@backstage/plugin-catalog-react": "^1.9.
|
|
35
|
-
"@backstage/plugin-permission-react": "^0.4.
|
|
36
|
-
"@backstage/theme": "^0.
|
|
32
|
+
"@backstage/core-components": "^0.13.9",
|
|
33
|
+
"@backstage/core-plugin-api": "^1.8.1",
|
|
34
|
+
"@backstage/plugin-catalog-react": "^1.9.2",
|
|
35
|
+
"@backstage/plugin-permission-react": "^0.4.18",
|
|
36
|
+
"@backstage/theme": "^0.5.0",
|
|
37
37
|
"@backstage/types": "^1.1.1",
|
|
38
38
|
"@date-io/luxon": "^1.0.0",
|
|
39
|
+
"@hookform/resolvers": "^3.3.2",
|
|
39
40
|
"@material-ui/core": "^4.12.2",
|
|
40
41
|
"@material-ui/icons": "^4.9.1",
|
|
41
42
|
"@material-ui/lab": "4.0.0-alpha.61",
|
|
42
43
|
"@material-ui/pickers": "^3.3.10",
|
|
43
44
|
"@spotify/backstage-plugin-core": "^0.5.8",
|
|
44
|
-
"@spotify/backstage-plugin-soundcheck-common": "^0.
|
|
45
|
+
"@spotify/backstage-plugin-soundcheck-common": "^0.10.0",
|
|
45
46
|
"@tanstack/react-query": "^4.6.1",
|
|
46
47
|
"@types/react-csv": "^1.1.6",
|
|
47
48
|
"@uiw/react-md-editor": "3.19.5",
|
|
@@ -62,21 +63,22 @@
|
|
|
62
63
|
"react-window": "^1.8.8",
|
|
63
64
|
"recharts": "^2.8.0",
|
|
64
65
|
"rehype-sanitize": "^6.0.0",
|
|
65
|
-
"uuid": "^9.0.0"
|
|
66
|
+
"uuid": "^9.0.0",
|
|
67
|
+
"zod": "^3.20.0"
|
|
66
68
|
},
|
|
67
69
|
"peerDependencies": {
|
|
68
70
|
"react": "^16.13.1 || ^17.0.0",
|
|
69
71
|
"react-router-dom": "6.0.0-beta.0 || ^6.3.0"
|
|
70
72
|
},
|
|
71
73
|
"devDependencies": {
|
|
72
|
-
"@backstage/cli": "^0.
|
|
73
|
-
"@backstage/core-app-api": "^1.11.
|
|
74
|
-
"@backstage/dev-utils": "^1.0.
|
|
74
|
+
"@backstage/cli": "^0.25.0",
|
|
75
|
+
"@backstage/core-app-api": "^1.11.2",
|
|
76
|
+
"@backstage/dev-utils": "^1.0.25",
|
|
75
77
|
"@backstage/e2e-test-utils": "^0.1.0",
|
|
76
|
-
"@backstage/test-utils": "^1.4.
|
|
78
|
+
"@backstage/test-utils": "^1.4.6",
|
|
77
79
|
"@graphql-codegen/cli": "^5.0.0",
|
|
78
80
|
"@graphql-codegen/typescript": "^4.0.0",
|
|
79
|
-
"@graphql-codegen/typescript-graphql-request": "^
|
|
81
|
+
"@graphql-codegen/typescript-graphql-request": "^6.0.0",
|
|
80
82
|
"@graphql-codegen/typescript-operations": "^4.0.0",
|
|
81
83
|
"@playwright/test": "^1.32.3",
|
|
82
84
|
"@spotify/backstage-plugin-core-common": "^0.5.8",
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import e,{useState as W,useEffect as $}from"react";import{Link as O,useParams as Q,Routes as j,Route as k,Navigate as I}from"react-router-dom";import{makeStyles as p,Typography as f,Box as U,Tab as L,Tabs as T,Paper as V,Divider as Y}from"@material-ui/core";import{SpotifyLicenseBanner as q}from"@spotify/backstage-plugin-core";import{useEntity as u}from"@backstage/plugin-catalog-react";import{R as G}from"./RefetchingIndicator-a31faa1d.esm.js";import{s as H,R as c,A as y,F as B,a as J,u as x,L as K,N as X,b as C,c as g,d as Z,C as _,e as ee,i as te,f as F,S as ae}from"./index-c3aebdd7.esm.js";import{Skeleton as s}from"@material-ui/lab";import{MarkdownContent as P}from"@backstage/core-components";import{stringifyEntityRef as ne}from"@backstage/catalog-model";import{useApi as re,useRouteRef as b,useRouteRefParams as ie}from"@backstage/core-plugin-api";import{useQuery as le}from"@tanstack/react-query";import oe from"react-use/lib/useMeasure";import A from"react-use/lib/usePrevious";import ce from"react-confetti";import"react-use/lib/useDebounce";import"graphql-request";import"graphql-tag";import"lodash";import"@material-ui/core/styles/makeStyles";import"classnames";import"@material-ui/icons/Schedule";import"luxon";import"@material-ui/icons/Check";import"@material-ui/icons/Close";import"@material-ui/icons/RemoveCircleOutline";import"@material-ui/icons/HelpOutline";import"../images/empty-state.svg";function se(t,n,a){const r=re(H),i=ne(t);return le(["soundcheck/check-details",i,n,a],async()=>r.getCheckResultDetails(i,n,a),{enabled:!!n&&!!a})}const me=p({markdownContent:{"& :last-child":{marginBottom:0}}}),de=({state:t,notes:n})=>{const a=me(),r={[c.Passed]:"success",[c.Failed]:"error",[c.NotReported]:"info",[c.NotApplicable]:"info"}[t],i={[c.Passed]:"Check passed",[c.Failed]:"Check did not pass",[c.NotReported]:"Check not reported",[c.NotApplicable]:"Check not applicable"}[t];return e.createElement(y,{severity:r,title:i},n?e.createElement(P,{className:a.markdownContent,content:n}):null)},pe=()=>{const t=D();return e.createElement(B,null,e.createElement("div",{className:t.root,"data-testid":"check-details-view"},e.createElement("div",{className:t.topBar},e.createElement(f,{variant:"h2",className:t.title},e.createElement(s,{width:300,height:32})),e.createElement(s,{width:100,height:32})),e.createElement(s,{variant:"rect",height:120}),e.createElement("div",{"data-testid":"soundcheck-check-details-description"},e.createElement(f,{variant:"h3"},e.createElement(s,null)),e.createElement(s,null),e.createElement(s,null),e.createElement(s,null))))},D=p(t=>({root:{padding:`${t.spacing(3)}px ${t.spacing(5)}px`},title:{fontWeight:"normal",fontSize:t.typography.h5.fontSize},description:{padding:`${t.spacing(3)}px 0`},subtitle:{fontWeight:"normal",fontSize:t.typography.h6.fontSize},topBar:{display:"flex",justifyContent:"space-between",marginBottom:t.spacing(2)}})),ue=({programId:t,checkId:n})=>{const a=D(),{entity:r}=u(),{data:i,isLoading:l,isError:o}=se(r,t,n);if(o)return e.createElement(U,{padding:2},e.createElement(y,{severity:"error",title:"Error loading check details"}));if(l||!t||!n)return e.createElement(pe,null);if(!i)return null;const{name:h,description:d,result:v,timestamp:m,notes:E}=i;return e.createElement("div",{className:a.root,"data-testid":"check-details-view"},e.createElement("div",{className:a.topBar},e.createElement(f,{variant:"h2",className:a.title},h),m?e.createElement(J,{timestamp:m,description:"Last updated"}):null),e.createElement(de,{state:v,notes:E}),e.createElement("div",{className:a.description,"data-testid":"soundcheck-check-details-description"},e.createElement(f,{variant:"h3",className:a.subtitle},"Description"),e.createElement(P,{content:d})))},he=p(()=>({root:{position:"absolute",width:"100%",height:"100%"}})),Ee=({programId:t})=>{var n,a;const r=he(),{entity:i}=u(),{data:l,isLoading:o}=x(i,t),[h,{width:d,height:v}]=oe(),m=o?void 0:(a=(n=l==null?void 0:l.highestLevel)==null?void 0:n.ordinal)!=null?a:-1,E=A(m),R=A(t),[M,S]=W(!1);return $(()=>{typeof E!="undefined"&&typeof m!="undefined"&&t===R&&m>E&&S(!0)},[m,E,t,R]),M?e.createElement("div",{ref:h,className:r.root},e.createElement(ce,{width:d,height:v,numberOfPieces:1e3,gravity:1,initialVelocityY:20,recycle:!1,onConfettiComplete:()=>S(!1)})):null},z=p(t=>({root:{maxWidth:"80ch",textTransform:"uppercase",paddingTop:t.spacing(2),paddingBottom:t.spacing(2)},wrapper:{display:"inline-block",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},badge:{marginRight:t.spacing(1)}})),fe=({id:t,name:n,badge:a,href:r,selected:i=!1})=>{const l=z();return e.createElement(L,{className:l.root,classes:{wrapper:l.wrapper},value:t,label:e.createElement(e.Fragment,null,a?e.createElement(K,{badge:a,className:l.badge}):e.createElement(X,{className:l.badge}),n),component:O,to:r,selected:i})},w=()=>{const t=z();return e.createElement(L,{className:t.root,classes:{wrapper:t.wrapper},label:e.createElement(s,{width:180})})},ge=()=>e.createElement(B,null,e.createElement(T,{value:!1,indicatorColor:"primary"},e.createElement(w,null),e.createElement(w,null),e.createElement(w,null)));function ve(t=[],n){const a=t.findIndex(r=>r.program.id===n);return a<0?!1:a}const ke=({trackId:t})=>{const{entity:n}=u(),{isLoading:a,data:r}=C(n),i=b(g);if(a||!t)return e.createElement(ge,null);const l=ve(r,t);return e.createElement(T,{value:l,indicatorColor:"primary","aria-label":"Certifications",variant:"scrollable"},r&&r.map(({program:{id:o,name:h},highestLevel:d})=>e.createElement(fe,{key:o,id:o,name:h,badge:d==null?void 0:d.badge,selected:o===t,href:i({trackId:o})})))},ye=p({paper:{overflow:"hidden",position:"relative"},view:{display:"grid",gridTemplateColumns:"1fr 2fr"}}),Ce=()=>{const{trackId:t,checkId:n}=Q(),a=ye(),{entity:r}=u(),{isError:i,isFetched:l,data:o}=C(r);return i?e.createElement(y,{severity:"error",title:"Error loading certifications"}):l&&!(o!=null&&o.length)?e.createElement(Z,null):e.createElement(V,{className:a.paper},e.createElement(G,null),e.createElement(ke,{trackId:t}),e.createElement(Y,null),e.createElement("div",{"data-testid":"soundcheck-certification-view",className:a.view},e.createElement(_,{trackId:t,checkId:n}),e.createElement(ue,{programId:t,checkId:n}),e.createElement(Ee,{programId:t})))},be=p(t=>({root:{"&:not(:first-child)":{marginTop:t.spacing(2)}}})),N=()=>{const t=be();return e.createElement(e.Fragment,null,e.createElement(q,{backend:ee,invalidLicenseMessage:te,inline:!0}),e.createElement("div",{className:t.root},e.createElement(Ce,null)))},we=()=>{var t;const{entity:n}=u(),a=b(g),{data:r}=C(n),i=(t=r==null?void 0:r[0])==null?void 0:t.program.id;return i?e.createElement(I,{to:a({trackId:i}),replace:!0}):null},Ne=()=>{var t,n;const{entity:a}=u(),{trackId:r}=ie(g),i=b(F),{data:l}=x(a,r),o=(n=(t=l==null?void 0:l.levels[0])==null?void 0:t.checks[0])==null?void 0:n.id;return o?e.createElement(I,{to:i({trackId:r,checkId:o}),replace:!0}):null},Re=()=>e.createElement(j,null,e.createElement(k,{path:"/",element:e.createElement(e.Fragment,null,e.createElement(N,null),e.createElement(we,null))}),e.createElement(k,{path:g.path,element:e.createElement(e.Fragment,null,e.createElement(N,null),e.createElement(Ne,null))}),e.createElement(k,{path:F.path,element:e.createElement(N,null)})),Se=()=>e.createElement(ae,null,e.createElement(Re,null));export{Se as EntitySoundcheckContent};
|
|
2
|
-
//# sourceMappingURL=EntitySoundcheckContent-d8bf249e.esm.js.map
|