@backstage/plugin-scaffolder 0.14.0 → 1.0.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 +119 -0
- package/dist/esm/{Router-ba25f61c.esm.js → Router-773d053b.esm.js} +359 -47
- package/dist/esm/Router-773d053b.esm.js.map +1 -0
- package/dist/esm/{index-da137e20.esm.js → index-25fdb62e.esm.js} +39 -203
- package/dist/esm/index-25fdb62e.esm.js.map +1 -0
- package/dist/index.d.ts +137 -35
- package/dist/index.esm.js +1 -2
- package/dist/index.esm.js.map +1 -1
- package/package.json +26 -21
- package/dist/esm/Router-ba25f61c.esm.js.map +0 -1
- package/dist/esm/index-da137e20.esm.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -3,14 +3,23 @@ import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
|
|
|
3
3
|
import { DiscoveryApi, FetchApi, ApiHolder, Extension } from '@backstage/core-plugin-api';
|
|
4
4
|
import { ScmIntegrationRegistry } from '@backstage/integration';
|
|
5
5
|
import { JsonObject, JsonValue, Observable } from '@backstage/types';
|
|
6
|
-
import { TaskSpec,
|
|
6
|
+
import { TaskSpec, TemplateEntityV1beta3 } from '@backstage/plugin-scaffolder-common';
|
|
7
7
|
import { JSONSchema7 } from 'json-schema';
|
|
8
8
|
import React, { ComponentType } from 'react';
|
|
9
9
|
import { FieldValidation, FieldProps } from '@rjsf/core';
|
|
10
10
|
import { Entity } from '@backstage/catalog-model';
|
|
11
11
|
|
|
12
|
+
/**
|
|
13
|
+
* The status of each task in a Scaffolder Job
|
|
14
|
+
*
|
|
15
|
+
* @public
|
|
16
|
+
*/
|
|
12
17
|
declare type ScaffolderTaskStatus = 'open' | 'processing' | 'failed' | 'completed' | 'skipped';
|
|
13
|
-
|
|
18
|
+
/**
|
|
19
|
+
* The shape of each task returned from the `scaffolder-backend`
|
|
20
|
+
*
|
|
21
|
+
* @public
|
|
22
|
+
*/
|
|
14
23
|
declare type ScaffolderTask = {
|
|
15
24
|
id: string;
|
|
16
25
|
spec: TaskSpec;
|
|
@@ -18,6 +27,11 @@ declare type ScaffolderTask = {
|
|
|
18
27
|
lastHeartbeatAt: string;
|
|
19
28
|
createdAt: string;
|
|
20
29
|
};
|
|
30
|
+
/**
|
|
31
|
+
* The response shape for the `listActions` call to the `scaffolder-backend`
|
|
32
|
+
*
|
|
33
|
+
* @public
|
|
34
|
+
*/
|
|
21
35
|
declare type ListActionsResponse = Array<{
|
|
22
36
|
id: string;
|
|
23
37
|
description?: string;
|
|
@@ -26,21 +40,25 @@ declare type ListActionsResponse = Array<{
|
|
|
26
40
|
output?: JSONSchema7;
|
|
27
41
|
};
|
|
28
42
|
}>;
|
|
43
|
+
/** @public */
|
|
29
44
|
declare type ScaffolderOutputLink = {
|
|
30
45
|
title?: string;
|
|
31
46
|
icon?: string;
|
|
32
47
|
url?: string;
|
|
33
48
|
entityRef?: string;
|
|
34
49
|
};
|
|
50
|
+
/** @public */
|
|
35
51
|
declare type ScaffolderTaskOutput = {
|
|
36
|
-
/** @deprecated use the `links` property to link out to relevant resources */
|
|
37
|
-
entityRef?: string;
|
|
38
|
-
/** @deprecated use the `links` property to link out to relevant resources */
|
|
39
|
-
remoteUrl?: string;
|
|
40
52
|
links?: ScaffolderOutputLink[];
|
|
41
53
|
} & {
|
|
42
54
|
[key: string]: unknown;
|
|
43
55
|
};
|
|
56
|
+
/**
|
|
57
|
+
* The shape of each entry of parameters which gets rendered
|
|
58
|
+
* as a separate step in the wizard input
|
|
59
|
+
*
|
|
60
|
+
* @public
|
|
61
|
+
*/
|
|
44
62
|
declare type TemplateParameterSchema = {
|
|
45
63
|
title: string;
|
|
46
64
|
steps: Array<{
|
|
@@ -48,6 +66,11 @@ declare type TemplateParameterSchema = {
|
|
|
48
66
|
schema: JsonObject;
|
|
49
67
|
}>;
|
|
50
68
|
};
|
|
69
|
+
/**
|
|
70
|
+
* The shape of a `LogEvent` message from the `scaffolder-backend`
|
|
71
|
+
*
|
|
72
|
+
* @public
|
|
73
|
+
*/
|
|
51
74
|
declare type LogEvent = {
|
|
52
75
|
type: 'log' | 'completion';
|
|
53
76
|
body: {
|
|
@@ -59,17 +82,37 @@ declare type LogEvent = {
|
|
|
59
82
|
id: string;
|
|
60
83
|
taskId: string;
|
|
61
84
|
};
|
|
85
|
+
/**
|
|
86
|
+
* The input options to the `scaffold` method of the `ScaffolderClient`.
|
|
87
|
+
*
|
|
88
|
+
* @public
|
|
89
|
+
*/
|
|
62
90
|
interface ScaffolderScaffoldOptions {
|
|
63
91
|
templateRef: string;
|
|
64
92
|
values: Record<string, JsonValue>;
|
|
65
93
|
secrets?: Record<string, string>;
|
|
66
94
|
}
|
|
95
|
+
/**
|
|
96
|
+
* The response shape of the `scaffold` method of the `ScaffolderClient`.
|
|
97
|
+
*
|
|
98
|
+
* @public
|
|
99
|
+
*/
|
|
67
100
|
interface ScaffolderScaffoldResponse {
|
|
68
101
|
taskId: string;
|
|
69
102
|
}
|
|
103
|
+
/**
|
|
104
|
+
* The arguments for `getIntegrationsList`.
|
|
105
|
+
*
|
|
106
|
+
* @public
|
|
107
|
+
*/
|
|
70
108
|
interface ScaffolderGetIntegrationsListOptions {
|
|
71
109
|
allowedHosts: string[];
|
|
72
110
|
}
|
|
111
|
+
/**
|
|
112
|
+
* The response shape for `getIntegrationsList`.
|
|
113
|
+
*
|
|
114
|
+
* @public
|
|
115
|
+
*/
|
|
73
116
|
interface ScaffolderGetIntegrationsListResponse {
|
|
74
117
|
integrations: {
|
|
75
118
|
type: string;
|
|
@@ -77,6 +120,11 @@ interface ScaffolderGetIntegrationsListResponse {
|
|
|
77
120
|
host: string;
|
|
78
121
|
}[];
|
|
79
122
|
}
|
|
123
|
+
/**
|
|
124
|
+
* The input options to the `streamLogs` method of the `ScaffolderClient`.
|
|
125
|
+
*
|
|
126
|
+
* @public
|
|
127
|
+
*/
|
|
80
128
|
interface ScaffolderStreamLogsOptions {
|
|
81
129
|
taskId: string;
|
|
82
130
|
after?: number;
|
|
@@ -173,6 +221,12 @@ interface FieldExtensionComponentProps<TFieldReturnValue, TUiOptions extends {}
|
|
|
173
221
|
};
|
|
174
222
|
}
|
|
175
223
|
|
|
224
|
+
/**
|
|
225
|
+
* The input props that can be specified under `ui:options` for the
|
|
226
|
+
* `RepoUrlPicker` field extension.
|
|
227
|
+
*
|
|
228
|
+
* @public
|
|
229
|
+
*/
|
|
176
230
|
interface RepoUrlPickerUiOptions {
|
|
177
231
|
allowedHosts?: string[];
|
|
178
232
|
allowedOwners?: string[];
|
|
@@ -187,10 +241,22 @@ interface RepoUrlPickerUiOptions {
|
|
|
187
241
|
};
|
|
188
242
|
}
|
|
189
243
|
|
|
244
|
+
/**
|
|
245
|
+
* The input props that can be specified under `ui:options` for the
|
|
246
|
+
* `EntityTagsPicker` field extension.
|
|
247
|
+
*
|
|
248
|
+
* @public
|
|
249
|
+
*/
|
|
190
250
|
interface EntityTagsPickerUiOptions {
|
|
191
251
|
kinds?: string[];
|
|
192
252
|
}
|
|
193
253
|
|
|
254
|
+
/**
|
|
255
|
+
* The input props that can be specified under `ui:options` for the
|
|
256
|
+
* `EntityPicker` field extension.
|
|
257
|
+
*
|
|
258
|
+
* @public
|
|
259
|
+
*/
|
|
194
260
|
interface EntityPickerUiOptions {
|
|
195
261
|
allowedKinds?: string[];
|
|
196
262
|
defaultKind?: string;
|
|
@@ -216,49 +282,101 @@ declare function createScaffolderFieldExtension<TReturnValue = unknown, TInputPr
|
|
|
216
282
|
*/
|
|
217
283
|
declare const ScaffolderFieldExtensions: React.ComponentType;
|
|
218
284
|
|
|
285
|
+
/**
|
|
286
|
+
* The input props that can be specified under `ui:options` for the
|
|
287
|
+
* `OwnedEntityPicker` field extension.
|
|
288
|
+
*
|
|
289
|
+
* @public
|
|
290
|
+
*/
|
|
219
291
|
interface OwnedEntityPickerUiOptions {
|
|
220
292
|
allowedKinds?: string[];
|
|
221
293
|
defaultKind?: string;
|
|
222
294
|
}
|
|
223
295
|
|
|
296
|
+
/**
|
|
297
|
+
* The props for the entrypoint `ScaffolderPage` component the plugin.
|
|
298
|
+
* @public
|
|
299
|
+
*/
|
|
224
300
|
declare type RouterProps = {
|
|
225
|
-
/** @deprecated use components.TemplateCardComponent instead */
|
|
226
|
-
TemplateCardComponent?: ComponentType<{
|
|
227
|
-
template: TemplateEntityV1beta2;
|
|
228
|
-
}> | undefined;
|
|
229
|
-
/** @deprecated use component.TaskPageComponent instead */
|
|
230
|
-
TaskPageComponent?: ComponentType<{}>;
|
|
231
301
|
components?: {
|
|
232
302
|
TemplateCardComponent?: ComponentType<{
|
|
233
|
-
template:
|
|
303
|
+
template: TemplateEntityV1beta3;
|
|
234
304
|
}> | undefined;
|
|
235
305
|
TaskPageComponent?: ComponentType<{}>;
|
|
236
306
|
};
|
|
237
307
|
groups?: Array<{
|
|
238
|
-
title?:
|
|
239
|
-
titleComponent?: React.ReactNode;
|
|
308
|
+
title?: React.ReactNode;
|
|
240
309
|
filter: (entity: Entity) => boolean;
|
|
241
310
|
}>;
|
|
311
|
+
defaultPreviewTemplate?: string;
|
|
242
312
|
};
|
|
243
313
|
|
|
314
|
+
/**
|
|
315
|
+
* The input props that can be specified under `ui:options` for the
|
|
316
|
+
* `OwnerPicker` field extension.
|
|
317
|
+
*
|
|
318
|
+
* @public
|
|
319
|
+
*/
|
|
244
320
|
interface OwnerPickerUiOptions {
|
|
245
321
|
allowedKinds?: string[];
|
|
246
322
|
}
|
|
247
323
|
|
|
324
|
+
/**
|
|
325
|
+
* The validation function for the `repoUrl` that is returned from the
|
|
326
|
+
* field extension. Ensures that you have all the required fields filled for
|
|
327
|
+
* the different providers that exist.
|
|
328
|
+
*
|
|
329
|
+
* @public
|
|
330
|
+
*/
|
|
248
331
|
declare const repoPickerValidation: (value: string, validation: FieldValidation, context: {
|
|
249
332
|
apiHolder: ApiHolder;
|
|
250
333
|
}) => void;
|
|
251
334
|
|
|
335
|
+
/**
|
|
336
|
+
* The main plugin export for the scaffolder.
|
|
337
|
+
* @public
|
|
338
|
+
*/
|
|
252
339
|
declare const scaffolderPlugin: _backstage_core_plugin_api.BackstagePlugin<{
|
|
253
340
|
root: _backstage_core_plugin_api.RouteRef<undefined>;
|
|
254
341
|
}, {
|
|
255
342
|
registerComponent: _backstage_core_plugin_api.ExternalRouteRef<undefined, true>;
|
|
256
343
|
}>;
|
|
344
|
+
/**
|
|
345
|
+
* A field extension for selecting an Entity that exists in the Catalog.
|
|
346
|
+
*
|
|
347
|
+
* @public
|
|
348
|
+
*/
|
|
257
349
|
declare const EntityPickerFieldExtension: FieldExtensionComponent<string, EntityPickerUiOptions>;
|
|
350
|
+
/**
|
|
351
|
+
* The field extension for selecting a name for a new Entity in the Catalog.
|
|
352
|
+
*
|
|
353
|
+
* @public
|
|
354
|
+
*/
|
|
258
355
|
declare const EntityNamePickerFieldExtension: FieldExtensionComponent<string, {}>;
|
|
356
|
+
/**
|
|
357
|
+
* The field extension which provides the ability to select a RepositoryUrl.
|
|
358
|
+
* Currently this is an encoded URL that looks something like the following `github.com?repo=myRepoName&owner=backstage`.
|
|
359
|
+
*
|
|
360
|
+
* @public
|
|
361
|
+
*/
|
|
259
362
|
declare const RepoUrlPickerFieldExtension: FieldExtensionComponent<string, RepoUrlPickerUiOptions>;
|
|
363
|
+
/**
|
|
364
|
+
* A field extension for picking users and groups out of the Catalog.
|
|
365
|
+
*
|
|
366
|
+
* @public
|
|
367
|
+
*/
|
|
260
368
|
declare const OwnerPickerFieldExtension: FieldExtensionComponent<string, OwnerPickerUiOptions>;
|
|
369
|
+
/**
|
|
370
|
+
* The Router and main entrypoint to the Scaffolder plugin.
|
|
371
|
+
*
|
|
372
|
+
* @public
|
|
373
|
+
*/
|
|
261
374
|
declare const ScaffolderPage: (props: RouterProps) => JSX.Element;
|
|
375
|
+
/**
|
|
376
|
+
* A field extension to show all the Entities that are owned by the current logged-in User for use in templates.
|
|
377
|
+
*
|
|
378
|
+
* @public
|
|
379
|
+
*/
|
|
262
380
|
declare const OwnedEntityPickerFieldExtension: FieldExtensionComponent<string, OwnedEntityPickerUiOptions>;
|
|
263
381
|
/**
|
|
264
382
|
* EntityTagsPickerFieldExtension
|
|
@@ -267,24 +385,10 @@ declare const OwnedEntityPickerFieldExtension: FieldExtensionComponent<string, O
|
|
|
267
385
|
declare const EntityTagsPickerFieldExtension: FieldExtensionComponent<string[], EntityTagsPickerUiOptions>;
|
|
268
386
|
|
|
269
387
|
/**
|
|
270
|
-
*
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
TemplateCardComponent?: ComponentType<{
|
|
274
|
-
template: TemplateEntityV1beta2;
|
|
275
|
-
}> | undefined;
|
|
276
|
-
group?: {
|
|
277
|
-
title?: React.ReactNode;
|
|
278
|
-
/** @deprecated use title instead, can be a string or a react component */
|
|
279
|
-
titleComponent?: React.ReactNode;
|
|
280
|
-
filter: (entity: Entity) => boolean;
|
|
281
|
-
};
|
|
282
|
-
};
|
|
283
|
-
/**
|
|
284
|
-
* @deprecated this component is deprecated and will be removed in a future releases, please use the TemplateCard to render your own list.
|
|
388
|
+
* The component to select the `type` of `Template` that you will see in the table.
|
|
389
|
+
*
|
|
390
|
+
* @public
|
|
285
391
|
*/
|
|
286
|
-
declare const TemplateList: ({ TemplateCardComponent, group, }: TemplateListProps) => JSX.Element | null;
|
|
287
|
-
|
|
288
392
|
declare const TemplateTypePicker: () => JSX.Element | null;
|
|
289
393
|
|
|
290
394
|
/**
|
|
@@ -292,8 +396,6 @@ declare const TemplateTypePicker: () => JSX.Element | null;
|
|
|
292
396
|
* @public
|
|
293
397
|
*/
|
|
294
398
|
interface ScaffolderUseTemplateSecrets {
|
|
295
|
-
/** @deprecated use setSecrets instead */
|
|
296
|
-
setSecret: (input: Record<string, string>) => void;
|
|
297
399
|
setSecrets: (input: Record<string, string>) => void;
|
|
298
400
|
}
|
|
299
401
|
/**
|
|
@@ -319,4 +421,4 @@ declare type TaskPageProps = {
|
|
|
319
421
|
*/
|
|
320
422
|
declare const TaskPage: ({ loadingText }: TaskPageProps) => JSX.Element;
|
|
321
423
|
|
|
322
|
-
export { CustomFieldValidator, EntityNamePickerFieldExtension, EntityPickerFieldExtension, EntityPickerUiOptions, EntityTagsPickerFieldExtension, EntityTagsPickerUiOptions, FieldExtensionComponent, FieldExtensionComponentProps, FieldExtensionOptions,
|
|
424
|
+
export { CustomFieldValidator, EntityNamePickerFieldExtension, EntityPickerFieldExtension, EntityPickerUiOptions, EntityTagsPickerFieldExtension, EntityTagsPickerUiOptions, FieldExtensionComponent, FieldExtensionComponentProps, FieldExtensionOptions, ListActionsResponse, LogEvent, OwnedEntityPickerFieldExtension, OwnedEntityPickerUiOptions, OwnerPickerFieldExtension, OwnerPickerUiOptions, RepoUrlPickerFieldExtension, RepoUrlPickerUiOptions, RouterProps, ScaffolderApi, ScaffolderClient, ScaffolderFieldExtensions, ScaffolderGetIntegrationsListOptions, ScaffolderGetIntegrationsListResponse, ScaffolderOutputLink, ScaffolderPage, ScaffolderScaffoldOptions, ScaffolderScaffoldResponse, ScaffolderStreamLogsOptions, ScaffolderTask, ScaffolderTaskOutput, ScaffolderTaskStatus, ScaffolderUseTemplateSecrets, TaskPage, TaskPageProps, TemplateParameterSchema, TemplateTypePicker, createScaffolderFieldExtension, repoPickerValidation, scaffolderApiRef, scaffolderPlugin, useTemplateSecrets };
|
package/dist/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { p as EntityNamePickerFieldExtension, o as EntityPickerFieldExtension, q as EntityTagsPickerFieldExtension, u as OwnedEntityPickerFieldExtension, t as OwnerPickerFieldExtension, v as RepoUrlPickerFieldExtension, l as ScaffolderClient, n as ScaffolderFieldExtensions, w as ScaffolderPage, k as TaskPage,
|
|
1
|
+
export { p as EntityNamePickerFieldExtension, o as EntityPickerFieldExtension, q as EntityTagsPickerFieldExtension, u as OwnedEntityPickerFieldExtension, t as OwnerPickerFieldExtension, v as RepoUrlPickerFieldExtension, l as ScaffolderClient, n as ScaffolderFieldExtensions, w as ScaffolderPage, k as TaskPage, T as TemplateTypePicker, m as createScaffolderFieldExtension, r as repoPickerValidation, f as scaffolderApiRef, x as scaffolderPlugin, y as useTemplateSecrets } from './esm/index-25fdb62e.esm.js';
|
|
2
2
|
import '@backstage/catalog-model';
|
|
3
3
|
import '@backstage/core-plugin-api';
|
|
4
4
|
import '@backstage/errors';
|
|
@@ -18,7 +18,6 @@ import '@material-ui/core/Input';
|
|
|
18
18
|
import '@material-ui/core/InputLabel';
|
|
19
19
|
import '@backstage/core-components';
|
|
20
20
|
import 'react-use/lib/useDebounce';
|
|
21
|
-
import '@material-ui/icons/Warning';
|
|
22
21
|
import 'lodash/capitalize';
|
|
23
22
|
import '@material-ui/icons/CheckBox';
|
|
24
23
|
import '@material-ui/icons/CheckBoxOutlineBlank';
|
package/dist/index.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-scaffolder",
|
|
3
3
|
"description": "The Backstage plugin that helps you create new things",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "1.0.0",
|
|
5
5
|
"main": "dist/index.esm.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"license": "Apache-2.0",
|
|
@@ -34,26 +34,30 @@
|
|
|
34
34
|
"clean": "backstage-cli package clean"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@backstage/catalog-client": "^0.
|
|
38
|
-
"@backstage/catalog-model": "^0.
|
|
39
|
-
"@backstage/config": "^0.
|
|
40
|
-
"@backstage/core-components": "^0.9.
|
|
41
|
-
"@backstage/core-plugin-api": "^0.
|
|
42
|
-
"@backstage/errors": "^0.
|
|
43
|
-
"@backstage/integration": "^0.
|
|
44
|
-
"@backstage/integration-react": "^0.
|
|
45
|
-
"@backstage/plugin-catalog-common": "^0.
|
|
46
|
-
"@backstage/plugin-catalog-react": "^0.
|
|
47
|
-
"@backstage/plugin-permission-react": "^0.3.
|
|
48
|
-
"@backstage/plugin-scaffolder-common": "^0.
|
|
37
|
+
"@backstage/catalog-client": "^1.0.0",
|
|
38
|
+
"@backstage/catalog-model": "^1.0.0",
|
|
39
|
+
"@backstage/config": "^1.0.0",
|
|
40
|
+
"@backstage/core-components": "^0.9.2",
|
|
41
|
+
"@backstage/core-plugin-api": "^1.0.0",
|
|
42
|
+
"@backstage/errors": "^1.0.0",
|
|
43
|
+
"@backstage/integration": "^1.0.0",
|
|
44
|
+
"@backstage/integration-react": "^1.0.0",
|
|
45
|
+
"@backstage/plugin-catalog-common": "^1.0.0",
|
|
46
|
+
"@backstage/plugin-catalog-react": "^1.0.0",
|
|
47
|
+
"@backstage/plugin-permission-react": "^0.3.4",
|
|
48
|
+
"@backstage/plugin-scaffolder-common": "^1.0.0",
|
|
49
49
|
"@backstage/theme": "^0.2.15",
|
|
50
|
-
"@backstage/types": "^0.
|
|
50
|
+
"@backstage/types": "^1.0.0",
|
|
51
|
+
"@codemirror/legacy-modes": "^0.19.0",
|
|
52
|
+
"@codemirror/panel": "^0.19.1",
|
|
53
|
+
"@codemirror/stream-parser": "^0.19.6",
|
|
51
54
|
"@material-ui/core": "^4.12.2",
|
|
52
55
|
"@material-ui/icons": "^4.9.1",
|
|
53
56
|
"@material-ui/lab": "4.0.0-alpha.57",
|
|
54
57
|
"@rjsf/core": "^3.2.1",
|
|
55
58
|
"@rjsf/material-ui": "^3.2.1",
|
|
56
59
|
"@types/json-schema": "^7.0.9",
|
|
60
|
+
"@uiw/react-codemirror": "^4.5.1",
|
|
57
61
|
"classnames": "^2.2.6",
|
|
58
62
|
"git-url-parse": "^11.6.0",
|
|
59
63
|
"humanize-duration": "^3.25.1",
|
|
@@ -66,6 +70,7 @@
|
|
|
66
70
|
"react-router-dom": "6.0.0-beta.0",
|
|
67
71
|
"react-use": "^17.2.4",
|
|
68
72
|
"use-immer": "^0.6.0",
|
|
73
|
+
"yaml": "^1.9.2",
|
|
69
74
|
"zen-observable": "^0.8.15"
|
|
70
75
|
},
|
|
71
76
|
"peerDependencies": {
|
|
@@ -73,13 +78,13 @@
|
|
|
73
78
|
"react": "^16.13.1 || ^17.0.0"
|
|
74
79
|
},
|
|
75
80
|
"devDependencies": {
|
|
76
|
-
"@backstage/cli": "^0.
|
|
77
|
-
"@backstage/core-app-api": "^0.
|
|
78
|
-
"@backstage/dev-utils": "^0.
|
|
79
|
-
"@backstage/plugin-catalog": "^0.
|
|
80
|
-
"@backstage/test-utils": "^0.
|
|
81
|
+
"@backstage/cli": "^0.16.0",
|
|
82
|
+
"@backstage/core-app-api": "^1.0.0",
|
|
83
|
+
"@backstage/dev-utils": "^1.0.0",
|
|
84
|
+
"@backstage/plugin-catalog": "^1.0.0",
|
|
85
|
+
"@backstage/test-utils": "^1.0.0",
|
|
81
86
|
"@testing-library/jest-dom": "^5.10.1",
|
|
82
|
-
"@testing-library/react": "^
|
|
87
|
+
"@testing-library/react": "^12.1.3",
|
|
83
88
|
"@testing-library/react-hooks": "^7.0.2",
|
|
84
89
|
"@testing-library/user-event": "^13.1.8",
|
|
85
90
|
"@types/humanize-duration": "^3.18.1",
|
|
@@ -92,5 +97,5 @@
|
|
|
92
97
|
"files": [
|
|
93
98
|
"dist"
|
|
94
99
|
],
|
|
95
|
-
"gitHead": "
|
|
100
|
+
"gitHead": "e9496f746b31600dbfac7fa76987479e66426257"
|
|
96
101
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Router-ba25f61c.esm.js","sources":["../../src/extensions/default.ts","../../src/components/ScaffolderPage/ScaffolderPage.tsx","../../src/components/MultistepJsonForm/schema.ts","../../src/components/MultistepJsonForm/FieldOverrides/DescriptionField.tsx","../../src/components/MultistepJsonForm/MultistepJsonForm.tsx","../../src/components/TemplatePage/TemplatePage.tsx","../../src/components/ActionsPage/ActionsPage.tsx","../../src/components/Router.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { EntityPicker } from '../components/fields/EntityPicker/EntityPicker';\nimport { EntityNamePicker } from '../components/fields/EntityNamePicker/EntityNamePicker';\nimport { entityNamePickerValidation } from '../components/fields/EntityNamePicker/validation';\nimport { EntityTagsPicker } from '../components/fields/EntityTagsPicker/EntityTagsPicker';\nimport { OwnerPicker } from '../components/fields/OwnerPicker/OwnerPicker';\nimport { RepoUrlPicker } from '../components/fields/RepoUrlPicker/RepoUrlPicker';\nimport { repoPickerValidation } from '../components/fields/RepoUrlPicker/validation';\nimport { OwnedEntityPicker } from '../components/fields/OwnedEntityPicker/OwnedEntityPicker';\n\nexport const DEFAULT_SCAFFOLDER_FIELD_EXTENSIONS = [\n {\n component: EntityPicker,\n name: 'EntityPicker',\n },\n {\n component: EntityNamePicker,\n name: 'EntityNamePicker',\n validation: entityNamePickerValidation,\n },\n {\n component: EntityTagsPicker,\n name: 'EntityTagsPicker',\n },\n {\n component: RepoUrlPicker,\n name: 'RepoUrlPicker',\n validation: repoPickerValidation,\n },\n {\n component: OwnerPicker,\n name: 'OwnerPicker',\n },\n {\n component: OwnedEntityPicker,\n name: 'OwnedEntityPicker',\n },\n];\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n Content,\n ContentHeader,\n CreateButton,\n Header,\n Lifecycle,\n Page,\n SupportButton,\n} from '@backstage/core-components';\nimport { Entity } from '@backstage/catalog-model';\nimport { TemplateEntityV1beta2 } from '@backstage/plugin-scaffolder-common';\nimport { useRouteRef } from '@backstage/core-plugin-api';\nimport {\n EntityKindPicker,\n EntityListProvider,\n EntitySearchBar,\n EntityTagPicker,\n UserListPicker,\n} from '@backstage/plugin-catalog-react';\nimport { makeStyles } from '@material-ui/core';\nimport React, { ComponentType } from 'react';\nimport { registerComponentRouteRef } from '../../routes';\nimport { TemplateList } from '../TemplateList';\nimport { TemplateTypePicker } from '../TemplateTypePicker';\nimport { catalogEntityCreatePermission } from '@backstage/plugin-catalog-common';\nimport { usePermission } from '@backstage/plugin-permission-react';\n\nconst useStyles = makeStyles(theme => ({\n contentWrapper: {\n display: 'grid',\n gridTemplateAreas: \"'filters' 'grid'\",\n gridTemplateColumns: '250px 1fr',\n gridColumnGap: theme.spacing(2),\n },\n}));\n\nexport type ScaffolderPageProps = {\n TemplateCardComponent?:\n | ComponentType<{ template: TemplateEntityV1beta2 }>\n | undefined;\n groups?: Array<{\n title?: React.ReactNode;\n /** @deprcated use title instead as it accepts a string and react component */\n titleComponent?: React.ReactNode;\n filter: (entity: Entity) => boolean;\n }>;\n};\n\nexport const ScaffolderPageContents = ({\n TemplateCardComponent,\n groups,\n}: ScaffolderPageProps) => {\n const styles = useStyles();\n const registerComponentLink = useRouteRef(registerComponentRouteRef);\n const otherTemplatesGroup = {\n title: groups ? 'Other Templates' : 'Templates',\n filter: (entity: Entity) => {\n const filtered = (groups ?? []).map(group => group.filter(entity));\n return !filtered.some(result => result === true);\n },\n };\n\n const { allowed } = usePermission(catalogEntityCreatePermission);\n\n return (\n <Page themeId=\"home\">\n <Header\n pageTitleOverride=\"Create a New Component\"\n title={\n <>\n Create a New Component <Lifecycle shorthand />\n </>\n }\n subtitle=\"Create new software components using standard templates\"\n />\n <Content>\n <ContentHeader title=\"Available Templates\">\n {allowed && (\n <CreateButton\n title=\"Register Existing Component\"\n to={registerComponentLink && registerComponentLink()}\n />\n )}\n <SupportButton>\n Create new software components using standard templates. Different\n templates create different kinds of components (services, websites,\n documentation, ...).\n </SupportButton>\n </ContentHeader>\n\n <div className={styles.contentWrapper}>\n <div>\n <EntitySearchBar />\n <EntityKindPicker initialFilter=\"template\" hidden />\n <UserListPicker\n initialFilter=\"all\"\n availableFilters={['all', 'starred']}\n />\n <TemplateTypePicker />\n <EntityTagPicker />\n </div>\n <div>\n {groups &&\n groups.map((group, index) => (\n <TemplateList\n key={index}\n TemplateCardComponent={TemplateCardComponent}\n group={group}\n />\n ))}\n <TemplateList\n key=\"other\"\n TemplateCardComponent={TemplateCardComponent}\n group={otherTemplatesGroup}\n />\n </div>\n </div>\n </Content>\n </Page>\n );\n};\n\nexport const ScaffolderPage = ({\n TemplateCardComponent,\n groups,\n}: ScaffolderPageProps) => (\n <EntityListProvider>\n <ScaffolderPageContents\n TemplateCardComponent={TemplateCardComponent}\n groups={groups}\n />\n </EntityListProvider>\n);\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { JsonObject } from '@backstage/types';\nimport { FormProps } from '@rjsf/core';\n\nfunction isObject(value: unknown): value is JsonObject {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction extractUiSchema(schema: JsonObject, uiSchema: JsonObject) {\n if (!isObject(schema)) {\n return;\n }\n\n const { properties, items, anyOf, oneOf, allOf, dependencies } = schema;\n\n for (const propName in schema) {\n if (!schema.hasOwnProperty(propName)) {\n continue;\n }\n\n if (propName.startsWith('ui:')) {\n uiSchema[propName] = schema[propName];\n delete schema[propName];\n }\n }\n\n if (isObject(properties)) {\n for (const propName in properties) {\n if (!properties.hasOwnProperty(propName)) {\n continue;\n }\n\n const schemaNode = properties[propName];\n if (!isObject(schemaNode)) {\n continue;\n }\n const innerUiSchema = {};\n uiSchema[propName] = innerUiSchema;\n extractUiSchema(schemaNode, innerUiSchema);\n }\n }\n\n if (isObject(items)) {\n const innerUiSchema = {};\n uiSchema.items = innerUiSchema;\n extractUiSchema(items, innerUiSchema);\n }\n\n if (Array.isArray(anyOf)) {\n for (const schemaNode of anyOf) {\n if (!isObject(schemaNode)) {\n continue;\n }\n extractUiSchema(schemaNode, uiSchema);\n }\n }\n\n if (Array.isArray(oneOf)) {\n for (const schemaNode of oneOf) {\n if (!isObject(schemaNode)) {\n continue;\n }\n extractUiSchema(schemaNode, uiSchema);\n }\n }\n\n if (Array.isArray(allOf)) {\n for (const schemaNode of allOf) {\n if (!isObject(schemaNode)) {\n continue;\n }\n extractUiSchema(schemaNode, uiSchema);\n }\n }\n\n if (isObject(dependencies)) {\n for (const depName of Object.keys(dependencies)) {\n const schemaNode = dependencies[depName];\n if (!isObject(schemaNode)) {\n continue;\n }\n extractUiSchema(schemaNode, uiSchema);\n }\n }\n}\n\nexport function transformSchemaToProps(inputSchema: JsonObject): {\n schema: FormProps<any>['schema'];\n uiSchema: FormProps<any>['uiSchema'];\n} {\n inputSchema.type = inputSchema.type || 'object';\n const schema = JSON.parse(JSON.stringify(inputSchema));\n delete schema.title; // Rendered separately\n const uiSchema = {};\n extractUiSchema(schema, uiSchema);\n return { schema, uiSchema };\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport { MarkdownContent } from '@backstage/core-components';\nimport { FieldProps } from '@rjsf/core';\n\nexport const DescriptionField = ({ description }: FieldProps) =>\n description && <MarkdownContent content={description} linkTarget=\"_blank\" />;\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { JsonObject } from '@backstage/types';\nimport {\n Box,\n Button,\n Paper,\n Step as StepUI,\n StepContent,\n StepLabel,\n Stepper,\n Typography,\n} from '@material-ui/core';\nimport {\n errorApiRef,\n useApi,\n featureFlagsApiRef,\n} from '@backstage/core-plugin-api';\nimport { FormProps, IChangeEvent, UiSchema, withTheme } from '@rjsf/core';\nimport { Theme as MuiTheme } from '@rjsf/material-ui';\nimport React, { useState } from 'react';\nimport { transformSchemaToProps } from './schema';\nimport { Content, StructuredMetadataTable } from '@backstage/core-components';\nimport cloneDeep from 'lodash/cloneDeep';\nimport * as fieldOverrides from './FieldOverrides';\n\nconst Form = withTheme(MuiTheme);\ntype Step = {\n schema: JsonObject;\n title: string;\n} & Partial<Omit<FormProps<any>, 'schema'>>;\n\ntype Props = {\n /**\n * Steps for the form, each contains title and form schema\n */\n steps: Step[];\n formData: Record<string, any>;\n onChange: (e: IChangeEvent) => void;\n onReset: () => void;\n onFinish: () => Promise<void>;\n widgets?: FormProps<any>['widgets'];\n fields?: FormProps<any>['fields'];\n};\n\nexport function getUiSchemasFromSteps(steps: Step[]): UiSchema[] {\n const uiSchemas: Array<UiSchema> = [];\n steps.forEach(step => {\n const schemaProps = step.schema.properties as JsonObject;\n for (const key in schemaProps) {\n if (schemaProps.hasOwnProperty(key)) {\n const uiSchema = schemaProps[key] as UiSchema;\n uiSchema.name = key;\n uiSchemas.push(uiSchema);\n }\n }\n });\n return uiSchemas;\n}\n\nexport function getReviewData(formData: Record<string, any>, steps: Step[]) {\n const uiSchemas = getUiSchemasFromSteps(steps);\n const reviewData: Record<string, any> = {};\n for (const key in formData) {\n if (formData.hasOwnProperty(key)) {\n const uiSchema = uiSchemas.find(us => us.name === key);\n\n if (!uiSchema) {\n reviewData[key] = formData[key];\n continue;\n }\n\n if (uiSchema['ui:widget'] === 'password') {\n reviewData[key] = '******';\n continue;\n }\n\n if (!uiSchema['ui:backstage'] || !uiSchema['ui:backstage'].review) {\n reviewData[key] = formData[key];\n continue;\n }\n\n const review = uiSchema['ui:backstage'].review as JsonObject;\n if (!review.show) {\n continue;\n }\n\n if (review.mask) {\n reviewData[key] = review.mask;\n continue;\n }\n reviewData[key] = formData[key];\n }\n }\n\n return reviewData;\n}\n\nexport const MultistepJsonForm = (props: Props) => {\n const { formData, onChange, onReset, onFinish, fields, widgets } = props;\n const [activeStep, setActiveStep] = useState(0);\n const [disableButtons, setDisableButtons] = useState(false);\n const errorApi = useApi(errorApiRef);\n const featureFlagApi = useApi(featureFlagsApiRef);\n const featureFlagKey = 'backstage:featureFlag';\n const filterOutProperties = (step: Step): Step => {\n const filteredStep = cloneDeep(step);\n const removedPropertyKeys: Array<string> = [];\n if (filteredStep.schema.properties) {\n filteredStep.schema.properties = Object.fromEntries(\n Object.entries(filteredStep.schema.properties).filter(\n ([key, value]) => {\n if (value[featureFlagKey]) {\n if (featureFlagApi.isActive(value[featureFlagKey])) {\n return true;\n }\n removedPropertyKeys.push(key);\n return false;\n }\n return true;\n },\n ),\n );\n\n // remove the feature flag property key from required if they are not active\n filteredStep.schema.required = Array.isArray(filteredStep.schema.required)\n ? filteredStep.schema.required?.filter(\n r => !removedPropertyKeys.includes(r as string),\n )\n : filteredStep.schema.required;\n }\n return filteredStep;\n };\n\n const steps = props.steps\n .filter(step => {\n const featureFlag = step.schema[featureFlagKey];\n return (\n typeof featureFlag !== 'string' || featureFlagApi.isActive(featureFlag)\n );\n })\n .map(filterOutProperties);\n\n const handleReset = () => {\n setActiveStep(0);\n onReset();\n };\n const handleNext = () => {\n setActiveStep(Math.min(activeStep + 1, steps.length));\n };\n const handleBack = () => setActiveStep(Math.max(activeStep - 1, 0));\n const handleCreate = async () => {\n setDisableButtons(true);\n try {\n await onFinish();\n } catch (err) {\n setDisableButtons(false);\n errorApi.post(err);\n }\n };\n\n return (\n <>\n <Stepper activeStep={activeStep} orientation=\"vertical\">\n {steps.map(({ title, schema, ...formProps }, index) => {\n return (\n <StepUI key={title}>\n <StepLabel\n aria-label={`Step ${index + 1} ${title}`}\n aria-disabled=\"false\"\n tabIndex={0}\n >\n <Typography variant=\"h6\" component=\"h3\">\n {title}\n </Typography>\n </StepLabel>\n <StepContent key={title}>\n <Form\n showErrorList={false}\n fields={{ ...fieldOverrides, ...fields }}\n widgets={widgets}\n noHtml5Validate\n formData={formData}\n onChange={onChange}\n onSubmit={e => {\n if (e.errors.length === 0) handleNext();\n }}\n {...formProps}\n {...transformSchemaToProps(schema)}\n >\n <Button disabled={activeStep === 0} onClick={handleBack}>\n Back\n </Button>\n <Button variant=\"contained\" color=\"primary\" type=\"submit\">\n Next step\n </Button>\n </Form>\n </StepContent>\n </StepUI>\n );\n })}\n </Stepper>\n {activeStep === steps.length && (\n <Content>\n <Paper square elevation={0}>\n <Typography variant=\"h6\">Review and create</Typography>\n <StructuredMetadataTable\n dense\n metadata={getReviewData(formData, steps)}\n />\n <Box mb={4} />\n <Button onClick={handleBack} disabled={disableButtons}>\n Back\n </Button>\n <Button onClick={handleReset} disabled={disableButtons}>\n Reset\n </Button>\n <Button\n variant=\"contained\"\n color=\"primary\"\n onClick={handleCreate}\n disabled={disableButtons}\n >\n Create\n </Button>\n </Paper>\n </Content>\n )}\n </>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { JsonObject, JsonValue } from '@backstage/types';\nimport { LinearProgress } from '@material-ui/core';\nimport { FormValidation, IChangeEvent } from '@rjsf/core';\nimport qs from 'qs';\nimport React, { useCallback, useContext, useState } from 'react';\nimport { Navigate, useNavigate } from 'react-router';\nimport { useParams } from 'react-router-dom';\nimport useAsync from 'react-use/lib/useAsync';\nimport { scaffolderApiRef } from '../../api';\nimport { CustomFieldValidator, FieldExtensionOptions } from '../../extensions';\nimport { SecretsContext } from '../secrets/SecretsContext';\nimport { rootRouteRef, scaffolderTaskRouteRef } from '../../routes';\nimport { MultistepJsonForm } from '../MultistepJsonForm';\n\nimport {\n Content,\n Header,\n InfoCard,\n Lifecycle,\n Page,\n} from '@backstage/core-components';\nimport {\n ApiHolder,\n errorApiRef,\n useApi,\n useApiHolder,\n useRouteRef,\n} from '@backstage/core-plugin-api';\nimport { stringifyEntityRef } from '@backstage/catalog-model';\n\nconst useTemplateParameterSchema = (templateRef: string) => {\n const scaffolderApi = useApi(scaffolderApiRef);\n const { value, loading, error } = useAsync(\n () => scaffolderApi.getTemplateParameterSchema(templateRef),\n [scaffolderApi, templateRef],\n );\n return { schema: value, loading, error };\n};\n\nfunction isObject(obj: unknown): obj is JsonObject {\n return typeof obj === 'object' && obj !== null && !Array.isArray(obj);\n}\n\nexport const createValidator = (\n rootSchema: JsonObject,\n validators: Record<string, undefined | CustomFieldValidator<unknown>>,\n context: {\n apiHolder: ApiHolder;\n },\n) => {\n function validate(\n schema: JsonObject,\n formData: JsonObject,\n errors: FormValidation,\n ) {\n const schemaProps = schema.properties;\n if (!isObject(schemaProps)) {\n return;\n }\n\n for (const [key, propData] of Object.entries(formData)) {\n const propValidation = errors[key];\n\n if (isObject(propData)) {\n const propSchemaProps = schemaProps[key];\n if (isObject(propSchemaProps)) {\n validate(\n propSchemaProps,\n propData as JsonObject,\n propValidation as FormValidation,\n );\n }\n } else {\n const propSchema = schemaProps[key];\n const fieldName =\n isObject(propSchema) && (propSchema['ui:field'] as string);\n if (fieldName && typeof validators[fieldName] === 'function') {\n validators[fieldName]!(\n propData as JsonValue,\n propValidation,\n context,\n );\n }\n }\n }\n }\n\n return (formData: JsonObject, errors: FormValidation) => {\n validate(rootSchema, formData, errors);\n return errors;\n };\n};\n\nexport const TemplatePage = ({\n customFieldExtensions = [],\n}: {\n customFieldExtensions?: FieldExtensionOptions<any, any>[];\n}) => {\n const apiHolder = useApiHolder();\n const secretsContext = useContext(SecretsContext);\n const errorApi = useApi(errorApiRef);\n const scaffolderApi = useApi(scaffolderApiRef);\n const { templateName } = useParams();\n const navigate = useNavigate();\n const scaffolderTaskRoute = useRouteRef(scaffolderTaskRouteRef);\n const rootRoute = useRouteRef(rootRouteRef);\n const { schema, loading, error } = useTemplateParameterSchema(templateName);\n const [formState, setFormState] = useState<Record<string, any>>(() => {\n const query = qs.parse(window.location.search, {\n ignoreQueryPrefix: true,\n });\n\n try {\n return JSON.parse(query.formData as string);\n } catch (e) {\n return query.formData ?? {};\n }\n });\n const handleFormReset = () => setFormState({});\n const handleChange = useCallback(\n (e: IChangeEvent) => setFormState(e.formData),\n [setFormState],\n );\n\n const handleCreate = async () => {\n const { taskId } = await scaffolderApi.scaffold({\n templateRef: stringifyEntityRef({\n name: templateName,\n kind: 'template',\n namespace: 'default',\n }),\n values: formState,\n secrets: secretsContext?.secrets,\n });\n\n const formParams = qs.stringify(\n { formData: formState },\n { addQueryPrefix: true },\n );\n const newUrl = `${window.location.pathname}${formParams}`;\n // We use direct history manipulation since useSearchParams and\n // useNavigate in react-router-dom cause unnecessary extra rerenders.\n // Also make sure to replace the state rather than pushing to avoid\n // extra back/forward slots.\n window.history?.replaceState(null, document.title, newUrl);\n\n navigate(scaffolderTaskRoute({ taskId }));\n };\n\n if (error) {\n errorApi.post(new Error(`Failed to load template, ${error}`));\n return <Navigate to={rootRoute()} />;\n }\n if (!loading && !schema) {\n errorApi.post(new Error('Template was not found.'));\n return <Navigate to={rootRoute()} />;\n }\n\n const customFieldComponents = Object.fromEntries(\n customFieldExtensions.map(({ name, component }) => [name, component]),\n );\n\n const customFieldValidators = Object.fromEntries(\n customFieldExtensions.map(({ name, validation }) => [name, validation]),\n );\n\n return (\n <Page themeId=\"home\">\n <Header\n pageTitleOverride=\"Create a New Component\"\n title={\n <>\n Create a New Component <Lifecycle shorthand />\n </>\n }\n subtitle=\"Create new software components using standard templates\"\n />\n <Content>\n {loading && <LinearProgress data-testid=\"loading-progress\" />}\n {schema && (\n <InfoCard\n title={schema.title}\n noPadding\n titleTypographyProps={{ component: 'h2' }}\n >\n <MultistepJsonForm\n formData={formState}\n fields={customFieldComponents}\n onChange={handleChange}\n onReset={handleFormReset}\n onFinish={handleCreate}\n steps={schema.steps.map(step => {\n return {\n ...step,\n validate: createValidator(\n step.schema,\n customFieldValidators,\n { apiHolder },\n ),\n };\n })}\n />\n </InfoCard>\n )}\n </Content>\n </Page>\n );\n};\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport React from 'react';\nimport useAsync from 'react-use/lib/useAsync';\nimport { scaffolderApiRef } from '../../api';\nimport {\n Typography,\n Paper,\n Table,\n TableBody,\n Box,\n TableCell,\n TableContainer,\n TableHead,\n TableRow,\n makeStyles,\n} from '@material-ui/core';\nimport { JSONSchema7, JSONSchema7Definition } from 'json-schema';\nimport classNames from 'classnames';\n\nimport { useApi } from '@backstage/core-plugin-api';\nimport {\n Progress,\n Content,\n Header,\n Page,\n ErrorPage,\n} from '@backstage/core-components';\n\nconst useStyles = makeStyles(theme => ({\n code: {\n fontFamily: 'Menlo, monospace',\n padding: theme.spacing(1),\n backgroundColor:\n theme.palette.type === 'dark'\n ? theme.palette.grey[700]\n : theme.palette.grey[300],\n display: 'inline-block',\n borderRadius: 5,\n border: `1px solid ${theme.palette.grey[500]}`,\n position: 'relative',\n },\n\n codeRequired: {\n '&::after': {\n position: 'absolute',\n content: '\"*\"',\n top: 0,\n right: theme.spacing(0.5),\n fontWeight: 'bolder',\n color: theme.palette.error.light,\n },\n },\n}));\n\nexport const ActionsPage = () => {\n const api = useApi(scaffolderApiRef);\n const classes = useStyles();\n const { loading, value, error } = useAsync(async () => {\n return api.listActions();\n });\n\n if (loading) {\n return <Progress />;\n }\n\n if (error) {\n return (\n <ErrorPage\n statusMessage=\"Failed to load installed actions\"\n status=\"500\"\n />\n );\n }\n\n const formatRows = (input: JSONSchema7) => {\n const properties = input.properties;\n if (!properties) {\n return undefined;\n }\n\n return Object.entries(properties).map(entry => {\n const [key] = entry;\n const props = entry[1] as unknown as JSONSchema7;\n const codeClassname = classNames(classes.code, {\n [classes.codeRequired]: input.required?.includes(key),\n });\n\n return (\n <TableRow key={key}>\n <TableCell>\n <div className={codeClassname}>{key}</div>\n </TableCell>\n <TableCell>{props.title}</TableCell>\n <TableCell>{props.description}</TableCell>\n <TableCell>\n <span className={classes.code}>{props.type}</span>\n </TableCell>\n </TableRow>\n );\n });\n };\n\n const renderTable = (input: JSONSchema7) => {\n if (!input.properties) {\n return undefined;\n }\n return (\n <TableContainer component={Paper}>\n <Table size=\"small\">\n <TableHead>\n <TableRow>\n <TableCell>Name</TableCell>\n <TableCell>Title</TableCell>\n <TableCell>Description</TableCell>\n <TableCell>Type</TableCell>\n </TableRow>\n </TableHead>\n <TableBody>{formatRows(input)}</TableBody>\n </Table>\n </TableContainer>\n );\n };\n\n const renderTables = (name: string, input?: JSONSchema7Definition[]) => {\n if (!input) {\n return undefined;\n }\n\n return (\n <>\n <Typography variant=\"h6\">{name}</Typography>\n {input.map((i, index) => (\n <div key={index}>{renderTable(i as unknown as JSONSchema7)}</div>\n ))}\n </>\n );\n };\n\n const items = value?.map(action => {\n if (action.id.startsWith('legacy:')) {\n return undefined;\n }\n\n const oneOf = renderTables('oneOf', action.schema?.input?.oneOf);\n return (\n <Box pb={4} key={action.id}>\n <Typography variant=\"h4\" className={classes.code}>\n {action.id}\n </Typography>\n <Typography>{action.description}</Typography>\n {action.schema?.input && (\n <Box pb={2}>\n <Typography variant=\"h5\">Input</Typography>\n {renderTable(action.schema.input)}\n {oneOf}\n </Box>\n )}\n {action.schema?.output && (\n <Box pb={2}>\n <Typography variant=\"h5\">Output</Typography>\n {renderTable(action.schema.output)}\n </Box>\n )}\n </Box>\n );\n });\n\n return (\n <Page themeId=\"home\">\n <Header\n pageTitleOverride=\"Create a New Component\"\n title=\"Installed actions\"\n subtitle=\"This is the collection of all installed actions\"\n />\n <Content>{items}</Content>\n </Page>\n );\n};\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { ComponentType } from 'react';\nimport { Routes, Route, useOutlet } from 'react-router';\nimport { Entity } from '@backstage/catalog-model';\nimport { TemplateEntityV1beta2 } from '@backstage/plugin-scaffolder-common';\nimport { ScaffolderPage } from './ScaffolderPage';\nimport { TemplatePage } from './TemplatePage';\nimport { TaskPage } from './TaskPage';\nimport { ActionsPage } from './ActionsPage';\nimport { SecretsContextProvider } from './secrets/SecretsContext';\n\nimport {\n FieldExtensionOptions,\n FIELD_EXTENSION_WRAPPER_KEY,\n FIELD_EXTENSION_KEY,\n DEFAULT_SCAFFOLDER_FIELD_EXTENSIONS,\n} from '../extensions';\nimport { useElementFilter } from '@backstage/core-plugin-api';\n\nexport type RouterProps = {\n /** @deprecated use components.TemplateCardComponent instead */\n TemplateCardComponent?:\n | ComponentType<{ template: TemplateEntityV1beta2 }>\n | undefined;\n /** @deprecated use component.TaskPageComponent instead */\n TaskPageComponent?: ComponentType<{}>;\n\n components?: {\n TemplateCardComponent?:\n | ComponentType<{ template: TemplateEntityV1beta2 }>\n | undefined;\n TaskPageComponent?: ComponentType<{}>;\n };\n groups?: Array<{\n title?: string;\n titleComponent?: React.ReactNode;\n filter: (entity: Entity) => boolean;\n }>;\n};\n\nexport const Router = (props: RouterProps) => {\n const {\n TemplateCardComponent: legacyTemplateCardComponent,\n TaskPageComponent: legacyTaskPageComponent,\n groups,\n components = {},\n } = props;\n\n if (legacyTemplateCardComponent || legacyTaskPageComponent) {\n // eslint-disable-next-line no-console\n console.warn(\n \"DEPRECATION: 'TemplateCardComponent' and 'TaskPageComponent' are deprecated when calling the 'ScaffolderPage'. Use 'components' prop to pass these component overrides instead.\",\n );\n }\n\n const { TemplateCardComponent, TaskPageComponent } = components;\n\n const outlet = useOutlet();\n const TaskPageElement =\n TaskPageComponent ?? legacyTaskPageComponent ?? TaskPage;\n\n const customFieldExtensions = useElementFilter(outlet, elements =>\n elements\n .selectByComponentData({\n key: FIELD_EXTENSION_WRAPPER_KEY,\n })\n .findComponentData<FieldExtensionOptions>({\n key: FIELD_EXTENSION_KEY,\n }),\n );\n\n const fieldExtensions = [\n ...customFieldExtensions,\n ...DEFAULT_SCAFFOLDER_FIELD_EXTENSIONS.filter(\n ({ name }) =>\n !customFieldExtensions.some(\n customFieldExtension => customFieldExtension.name === name,\n ),\n ),\n ];\n\n return (\n <Routes>\n <Route\n path=\"/\"\n element={\n <ScaffolderPage\n groups={groups}\n TemplateCardComponent={\n TemplateCardComponent ?? legacyTemplateCardComponent\n }\n />\n }\n />\n <Route\n path=\"/templates/:templateName\"\n element={\n <SecretsContextProvider>\n <TemplatePage customFieldExtensions={fieldExtensions} />\n </SecretsContextProvider>\n }\n />\n <Route path=\"/tasks/:taskId\" element={<TaskPageElement />} />\n <Route path=\"/actions\" element={<ActionsPage />} />\n </Routes>\n );\n};\n"],"names":["useStyles","isObject","MuiTheme","StepUI"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAwBa,sCAAsC;AAAA,EACjD;AAAA,IACE,WAAW;AAAA,IACX,MAAM;AAAA;AAAA,EAER;AAAA,IACE,WAAW;AAAA,IACX,MAAM;AAAA,IACN,YAAY;AAAA;AAAA,EAEd;AAAA,IACE,WAAW;AAAA,IACX,MAAM;AAAA;AAAA,EAER;AAAA,IACE,WAAW;AAAA,IACX,MAAM;AAAA,IACN,YAAY;AAAA;AAAA,EAEd;AAAA,IACE,WAAW;AAAA,IACX,MAAM;AAAA;AAAA,EAER;AAAA,IACE,WAAW;AAAA,IACX,MAAM;AAAA;AAAA;;ACNV,MAAMA,cAAY,WAAW;AAAU,EACrC,gBAAgB;AAAA,IACd,SAAS;AAAA,IACT,mBAAmB;AAAA,IACnB,qBAAqB;AAAA,IACrB,eAAe,MAAM,QAAQ;AAAA;AAAA;MAgBpB,yBAAyB,CAAC;AAAA,EACrC;AAAA,EACA;AAAA,MACyB;AACzB,QAAM,SAASA;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