@backstage/plugin-scaffolder 1.3.0 → 1.4.0-next.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -389,7 +389,7 @@ const OwnerPicker = (props) => {
389
389
  const GithubRepoPicker = (props) => {
390
390
  const { allowedOwners = [], rawErrors, state, onChange } = props;
391
391
  const ownerItems = allowedOwners ? allowedOwners.map((i) => ({ label: i, value: i })) : [{ label: "Loading...", value: "loading" }];
392
- const { owner, repoName } = state;
392
+ const { owner } = state;
393
393
  return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(FormControl, {
394
394
  margin: "normal",
395
395
  required: true,
@@ -407,23 +407,13 @@ const GithubRepoPicker = (props) => {
407
407
  id: "ownerInput",
408
408
  onChange: (e) => onChange({ owner: e.target.value }),
409
409
  value: owner
410
- })), /* @__PURE__ */ React.createElement(FormHelperText, null, "The organization, user or project that this repo will belong to")), /* @__PURE__ */ React.createElement(FormControl, {
411
- margin: "normal",
412
- required: true,
413
- error: (rawErrors == null ? void 0 : rawErrors.length) > 0 && !repoName
414
- }, /* @__PURE__ */ React.createElement(InputLabel, {
415
- htmlFor: "repoNameInput"
416
- }, "Repository"), /* @__PURE__ */ React.createElement(Input, {
417
- id: "repoNameInput",
418
- onChange: (e) => onChange({ repoName: e.target.value }),
419
- value: repoName
420
- }), /* @__PURE__ */ React.createElement(FormHelperText, null, "The name of the repository")));
410
+ })), /* @__PURE__ */ React.createElement(FormHelperText, null, "The organization, user or project that this repo will belong to")));
421
411
  };
422
412
 
423
413
  const GitlabRepoPicker = (props) => {
424
- const { allowedOwners = [], rawErrors, state, onChange } = props;
414
+ const { allowedOwners = [], state, onChange, rawErrors } = props;
425
415
  const ownerItems = allowedOwners ? allowedOwners.map((i) => ({ label: i, value: i })) : [{ label: "Loading...", value: "loading" }];
426
- const { owner, repoName } = state;
416
+ const { owner } = state;
427
417
  return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(FormControl, {
428
418
  margin: "normal",
429
419
  required: true,
@@ -443,22 +433,12 @@ const GitlabRepoPicker = (props) => {
443
433
  id: "ownerInput",
444
434
  onChange: (e) => onChange({ owner: e.target.value }),
445
435
  value: owner
446
- })), /* @__PURE__ */ React.createElement(FormHelperText, null, "The organization, groups, subgroups, user, project (also known as namespaces in gitlab), that this repo will belong to")), /* @__PURE__ */ React.createElement(FormControl, {
447
- margin: "normal",
448
- required: true,
449
- error: (rawErrors == null ? void 0 : rawErrors.length) > 0 && !repoName
450
- }, /* @__PURE__ */ React.createElement(InputLabel, {
451
- htmlFor: "repoNameInput"
452
- }, "Repository"), /* @__PURE__ */ React.createElement(Input, {
453
- id: "repoNameInput",
454
- onChange: (e) => onChange({ repoName: e.target.value }),
455
- value: repoName
456
- }), /* @__PURE__ */ React.createElement(FormHelperText, null, "The name of the repository")));
436
+ })), /* @__PURE__ */ React.createElement(FormHelperText, null, "The organization, groups, subgroups, user, project (also known as namespaces in gitlab), that this repo will belong to")));
457
437
  };
458
438
 
459
439
  const AzureRepoPicker = (props) => {
460
440
  const { rawErrors, state, onChange } = props;
461
- const { organization, repoName, owner } = state;
441
+ const { organization, owner } = state;
462
442
  return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(FormControl, {
463
443
  margin: "normal",
464
444
  required: true,
@@ -479,22 +459,12 @@ const AzureRepoPicker = (props) => {
479
459
  id: "ownerInput",
480
460
  onChange: (e) => onChange({ owner: e.target.value }),
481
461
  value: owner
482
- }), /* @__PURE__ */ React.createElement(FormHelperText, null, "The Owner that this repo will belong to")), /* @__PURE__ */ React.createElement(FormControl, {
483
- margin: "normal",
484
- required: true,
485
- error: (rawErrors == null ? void 0 : rawErrors.length) > 0 && !repoName
486
- }, /* @__PURE__ */ React.createElement(InputLabel, {
487
- htmlFor: "repoNameInput"
488
- }, "Repository"), /* @__PURE__ */ React.createElement(Input, {
489
- id: "repoNameInput",
490
- onChange: (e) => onChange({ repoName: e.target.value }),
491
- value: repoName
492
- }), /* @__PURE__ */ React.createElement(FormHelperText, null, "The name of the repository")));
462
+ }), /* @__PURE__ */ React.createElement(FormHelperText, null, "The Owner that this repo will belong to")));
493
463
  };
494
464
 
495
465
  const BitbucketRepoPicker = (props) => {
496
466
  const { onChange, rawErrors, state } = props;
497
- const { host, workspace, project, repoName } = state;
467
+ const { host, workspace, project } = state;
498
468
  return /* @__PURE__ */ React.createElement(React.Fragment, null, host === "bitbucket.org" && /* @__PURE__ */ React.createElement(FormControl, {
499
469
  margin: "normal",
500
470
  required: true,
@@ -515,22 +485,12 @@ const BitbucketRepoPicker = (props) => {
515
485
  id: "projectInput",
516
486
  onChange: (e) => onChange({ project: e.target.value }),
517
487
  value: project
518
- }), /* @__PURE__ */ React.createElement(FormHelperText, null, "The Project that this repo will belong to")), /* @__PURE__ */ React.createElement(FormControl, {
519
- margin: "normal",
520
- required: true,
521
- error: (rawErrors == null ? void 0 : rawErrors.length) > 0 && !repoName
522
- }, /* @__PURE__ */ React.createElement(InputLabel, {
523
- htmlFor: "repoNameInput"
524
- }, "Repository"), /* @__PURE__ */ React.createElement(Input, {
525
- id: "repoNameInput",
526
- onChange: (e) => onChange({ repoName: e.target.value }),
527
- value: repoName
528
- }), /* @__PURE__ */ React.createElement(FormHelperText, null, "The name of the repository")));
488
+ }), /* @__PURE__ */ React.createElement(FormHelperText, null, "The Project that this repo will belong to")));
529
489
  };
530
490
 
531
491
  const GerritRepoPicker = (props) => {
532
492
  const { onChange, rawErrors, state } = props;
533
- const { workspace, repoName, owner } = state;
493
+ const { workspace, owner } = state;
534
494
  return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(FormControl, {
535
495
  margin: "normal",
536
496
  required: true,
@@ -551,17 +511,7 @@ const GerritRepoPicker = (props) => {
551
511
  id: "parentInput",
552
512
  onChange: (e) => onChange({ workspace: e.target.value }),
553
513
  value: workspace
554
- }), /* @__PURE__ */ React.createElement(FormHelperText, null, "The project parent that the repo will belong to")), /* @__PURE__ */ React.createElement(FormControl, {
555
- margin: "normal",
556
- required: true,
557
- error: (rawErrors == null ? void 0 : rawErrors.length) > 0 && !repoName
558
- }, /* @__PURE__ */ React.createElement(InputLabel, {
559
- htmlFor: "repoNameInput"
560
- }, "Repository"), /* @__PURE__ */ React.createElement(Input, {
561
- id: "repoNameInput",
562
- onChange: (e) => onChange({ repoName: e.target.value }),
563
- value: repoName
564
- }), /* @__PURE__ */ React.createElement(FormHelperText, null, "The name of the repository")));
514
+ }), /* @__PURE__ */ React.createElement(FormHelperText, null, "The project parent that the repo will belong to")));
565
515
  };
566
516
 
567
517
  const RepoUrlPickerHost = (props) => {
@@ -600,6 +550,36 @@ const RepoUrlPickerHost = (props) => {
600
550
  }), /* @__PURE__ */ React.createElement(FormHelperText, null, "The host where the repository will be created")));
601
551
  };
602
552
 
553
+ const RepoUrlPickerRepoName = (props) => {
554
+ const { repoName, allowedRepos, onChange, rawErrors } = props;
555
+ useEffect(() => {
556
+ if (!repoName) {
557
+ if (allowedRepos == null ? void 0 : allowedRepos.length) {
558
+ onChange(allowedRepos[0]);
559
+ }
560
+ }
561
+ }, [allowedRepos, repoName, onChange]);
562
+ const repoItems = allowedRepos ? allowedRepos.map((i) => ({ label: i, value: i })) : [{ label: "Loading...", value: "loading" }];
563
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(FormControl, {
564
+ margin: "normal",
565
+ required: true,
566
+ error: (rawErrors == null ? void 0 : rawErrors.length) > 0 && !repoName
567
+ }, (allowedRepos == null ? void 0 : allowedRepos.length) ? /* @__PURE__ */ React.createElement(Select, {
568
+ native: true,
569
+ label: "Repositories Available",
570
+ onChange: (selected) => String(Array.isArray(selected) ? selected[0] : selected),
571
+ disabled: allowedRepos.length === 1,
572
+ selected: repoName,
573
+ items: repoItems
574
+ }) : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(InputLabel, {
575
+ htmlFor: "repoNameInput"
576
+ }, "Repository"), /* @__PURE__ */ React.createElement(Input, {
577
+ id: "repoNameInput",
578
+ onChange: (e) => onChange(String(e.target.value)),
579
+ value: repoName
580
+ })), /* @__PURE__ */ React.createElement(FormHelperText, null, "The name of the repository")));
581
+ };
582
+
603
583
  function serializeRepoPickerUrl(data) {
604
584
  if (!data.host) {
605
585
  return void 0;
@@ -678,6 +658,10 @@ const RepoUrlPicker = (props) => {
678
658
  var _a2, _b2;
679
659
  return (_b2 = (_a2 = uiSchema == null ? void 0 : uiSchema["ui:options"]) == null ? void 0 : _a2.allowedOwners) != null ? _b2 : [];
680
660
  }, [uiSchema]);
661
+ const allowedRepos = useMemo(() => {
662
+ var _a2, _b2;
663
+ return (_b2 = (_a2 = uiSchema == null ? void 0 : uiSchema["ui:options"]) == null ? void 0 : _a2.allowedRepos) != null ? _b2 : [];
664
+ }, [uiSchema]);
681
665
  useEffect(() => {
682
666
  onChange(serializeRepoPickerUrl(state));
683
667
  }, [state, onChange]);
@@ -686,6 +670,11 @@ const RepoUrlPicker = (props) => {
686
670
  setState((prevState) => ({ ...prevState, owner: allowedOwners[0] }));
687
671
  }
688
672
  }, [setState, allowedOwners]);
673
+ useEffect(() => {
674
+ if (allowedRepos.length === 1) {
675
+ setState((prevState) => ({ ...prevState, repoName: allowedRepos[0] }));
676
+ }
677
+ }, [setState, allowedRepos]);
689
678
  const updateLocalState = useCallback((newState) => {
690
679
  setState((prevState) => ({ ...prevState, ...newState }));
691
680
  }, [setState]);
@@ -737,6 +726,11 @@ const RepoUrlPicker = (props) => {
737
726
  rawErrors,
738
727
  state,
739
728
  onChange: updateLocalState
729
+ }), /* @__PURE__ */ React.createElement(RepoUrlPickerRepoName, {
730
+ repoName: state.repoName,
731
+ allowedRepos,
732
+ onChange: (repoName) => setState((prevState) => ({ ...prevState, repoName })),
733
+ rawErrors
740
734
  }));
741
735
  };
742
736
 
@@ -770,7 +764,7 @@ const repoPickerValidation = (value, validation, context) => {
770
764
  };
771
765
 
772
766
  const OwnedEntityPicker = (props) => {
773
- var _a, _b;
767
+ var _a, _b, _c, _d;
774
768
  const {
775
769
  onChange,
776
770
  schema: { title = "Entity", description = "An entity from the catalog" },
@@ -782,6 +776,7 @@ const OwnedEntityPicker = (props) => {
782
776
  } = props;
783
777
  const allowedKinds = (_a = uiSchema["ui:options"]) == null ? void 0 : _a.allowedKinds;
784
778
  const defaultKind = (_b = uiSchema["ui:options"]) == null ? void 0 : _b.defaultKind;
779
+ const allowArbitraryValues = (_d = (_c = uiSchema["ui:options"]) == null ? void 0 : _c.allowArbitraryValues) != null ? _d : true;
785
780
  const { ownedEntities, loading } = useOwnedEntities(allowedKinds);
786
781
  const entityRefs = ownedEntities == null ? void 0 : ownedEntities.items.map((e) => humanizeEntityRef(e, { defaultKind })).filter((n) => n);
787
782
  const onSelect = (_, value) => {
@@ -798,7 +793,7 @@ const OwnedEntityPicker = (props) => {
798
793
  onChange: onSelect,
799
794
  options: entityRefs || [],
800
795
  autoSelect: true,
801
- freeSolo: true,
796
+ freeSolo: allowArbitraryValues,
802
797
  renderInput: (params) => /* @__PURE__ */ React.createElement(TextField, {
803
798
  ...params,
804
799
  label: title,
@@ -932,7 +927,7 @@ const OwnerPickerFieldExtension = scaffolderPlugin.provide(createScaffolderField
932
927
  }));
933
928
  const ScaffolderPage = scaffolderPlugin.provide(createRoutableExtension({
934
929
  name: "ScaffolderPage",
935
- component: () => import('./Router-2a5afa3f.esm.js').then((m) => m.Router),
930
+ component: () => import('./Router-fbba0f54.esm.js').then((m) => m.Router),
936
931
  mountPoint: rootRouteRef
937
932
  }));
938
933
  const OwnedEntityPickerFieldExtension = scaffolderPlugin.provide(createScaffolderFieldExtension({
@@ -945,7 +940,7 @@ const EntityTagsPickerFieldExtension = scaffolderPlugin.provide(createScaffolder
945
940
  }));
946
941
  const NextScaffolderPage = scaffolderPlugin.provide(createRoutableExtension({
947
942
  name: "NextScaffolderPage",
948
- component: () => import('./index-6ce26c9f.esm.js').then((m) => m.Router),
943
+ component: () => import('./index-a72ba1c5.esm.js').then((m) => m.Router),
949
944
  mountPoint: rootRouteRef
950
945
  }));
951
946
 
@@ -1386,4 +1381,4 @@ const TaskPage = ({ loadingText }) => {
1386
1381
  };
1387
1382
 
1388
1383
  export { OwnedEntityPickerFieldExtension as A, RepoUrlPickerFieldExtension as B, ScaffolderPage as C, scaffolderPlugin as D, EntityPicker as E, FIELD_EXTENSION_WRAPPER_KEY as F, useTemplateSecrets as G, NextScaffolderPage as N, OwnerPicker as O, RepoUrlPicker as R, SecretsContext as S, TemplateTypePicker as T, actionsRouteRef as a, scaffolderListTaskRouteRef as b, scaffolderApiRef as c, scaffolderTaskRouteRef as d, editRouteRef as e, rootRouteRef as f, TaskStatusStepper as g, TaskPageLinks as h, FIELD_EXTENSION_KEY as i, SecretsContextProvider as j, TaskPage as k, legacySelectedTemplateRouteRef as l, EntityNamePicker as m, entityNamePickerValidation as n, EntityTagsPicker as o, repoPickerValidation as p, OwnedEntityPicker as q, registerComponentRouteRef as r, selectedTemplateRouteRef as s, ScaffolderClient as t, createScaffolderFieldExtension as u, ScaffolderFieldExtensions as v, EntityPickerFieldExtension as w, EntityNamePickerFieldExtension as x, EntityTagsPickerFieldExtension as y, OwnerPickerFieldExtension as z };
1389
- //# sourceMappingURL=index-6712a69a.esm.js.map
1384
+ //# sourceMappingURL=index-a2c4b694.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-a2c4b694.esm.js","sources":["../../src/api.ts","../../src/components/fields/EntityPicker/EntityPicker.tsx","../../src/components/fields/EntityNamePicker/EntityNamePicker.tsx","../../src/components/fields/EntityNamePicker/validation.ts","../../src/components/fields/EntityTagsPicker/EntityTagsPicker.tsx","../../src/components/fields/OwnerPicker/OwnerPicker.tsx","../../src/components/fields/RepoUrlPicker/GithubRepoPicker.tsx","../../src/components/fields/RepoUrlPicker/GitlabRepoPicker.tsx","../../src/components/fields/RepoUrlPicker/AzureRepoPicker.tsx","../../src/components/fields/RepoUrlPicker/BitbucketRepoPicker.tsx","../../src/components/fields/RepoUrlPicker/GerritRepoPicker.tsx","../../src/components/fields/RepoUrlPicker/RepoUrlPickerHost.tsx","../../src/components/fields/RepoUrlPicker/RepoUrlPickerRepoName.tsx","../../src/components/fields/RepoUrlPicker/utils.ts","../../src/components/secrets/SecretsContext.tsx","../../src/components/fields/RepoUrlPicker/RepoUrlPicker.tsx","../../src/components/fields/RepoUrlPicker/validation.ts","../../src/components/fields/OwnedEntityPicker/OwnedEntityPicker.tsx","../../src/extensions/index.tsx","../../src/routes.ts","../../src/plugin.ts","../../src/components/TemplateTypePicker/TemplateTypePicker.tsx","../../src/components/hooks/useEventStream.ts","../../src/components/TaskPage/IconLink.tsx","../../src/components/TaskPage/TaskPageLinks.tsx","../../src/components/TaskPage/TaskPage.tsx"],"sourcesContent":["/*\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 { parseEntityRef } from '@backstage/catalog-model';\nimport {\n createApiRef,\n DiscoveryApi,\n FetchApi,\n IdentityApi,\n} from '@backstage/core-plugin-api';\nimport { ResponseError } from '@backstage/errors';\nimport { ScmIntegrationRegistry } from '@backstage/integration';\nimport { Observable } from '@backstage/types';\nimport qs from 'qs';\nimport ObservableImpl from 'zen-observable';\nimport {\n ListActionsResponse,\n LogEvent,\n ScaffolderApi,\n TemplateParameterSchema,\n ScaffolderScaffoldOptions,\n ScaffolderScaffoldResponse,\n ScaffolderStreamLogsOptions,\n ScaffolderGetIntegrationsListOptions,\n ScaffolderGetIntegrationsListResponse,\n ScaffolderTask,\n ScaffolderDryRunOptions,\n ScaffolderDryRunResponse,\n} from './types';\nimport queryString from 'qs';\n\n/**\n * Utility API reference for the {@link ScaffolderApi}.\n *\n * @public\n */\nexport const scaffolderApiRef = createApiRef<ScaffolderApi>({\n id: 'plugin.scaffolder.service',\n});\n\n/**\n * An API to interact with the scaffolder backend.\n *\n * @public\n */\nexport class ScaffolderClient implements ScaffolderApi {\n private readonly discoveryApi: DiscoveryApi;\n private readonly scmIntegrationsApi: ScmIntegrationRegistry;\n private readonly fetchApi: FetchApi;\n private readonly identityApi?: IdentityApi;\n private readonly useLongPollingLogs: boolean;\n\n constructor(options: {\n discoveryApi: DiscoveryApi;\n fetchApi: FetchApi;\n identityApi?: IdentityApi;\n scmIntegrationsApi: ScmIntegrationRegistry;\n useLongPollingLogs?: boolean;\n }) {\n this.discoveryApi = options.discoveryApi;\n this.fetchApi = options.fetchApi ?? { fetch };\n this.scmIntegrationsApi = options.scmIntegrationsApi;\n this.useLongPollingLogs = options.useLongPollingLogs ?? false;\n this.identityApi = options.identityApi;\n }\n\n async listTasks(options: {\n filterByOwnership: 'owned' | 'all';\n }): Promise<{ tasks: ScaffolderTask[] }> {\n if (!this.identityApi) {\n throw new Error(\n 'IdentityApi is not available in the ScaffolderClient, please pass through the IdentityApi to the ScaffolderClient constructor in order to use the listTasks method',\n );\n }\n const baseUrl = await this.discoveryApi.getBaseUrl('scaffolder');\n const { userEntityRef } = await this.identityApi.getBackstageIdentity();\n\n const query = queryString.stringify(\n options.filterByOwnership === 'owned' ? { createdBy: userEntityRef } : {},\n );\n\n const response = await this.fetchApi.fetch(`${baseUrl}/v2/tasks?${query}`);\n if (!response.ok) {\n throw await ResponseError.fromResponse(response);\n }\n\n return await response.json();\n }\n\n async getIntegrationsList(\n options: ScaffolderGetIntegrationsListOptions,\n ): Promise<ScaffolderGetIntegrationsListResponse> {\n const integrations = [\n ...this.scmIntegrationsApi.azure.list(),\n ...this.scmIntegrationsApi.bitbucket\n .list()\n .filter(\n item =>\n !this.scmIntegrationsApi.bitbucketCloud.byHost(item.config.host) &&\n !this.scmIntegrationsApi.bitbucketServer.byHost(item.config.host),\n ),\n ...this.scmIntegrationsApi.bitbucketCloud.list(),\n ...this.scmIntegrationsApi.bitbucketServer.list(),\n ...this.scmIntegrationsApi.gerrit.list(),\n ...this.scmIntegrationsApi.github.list(),\n ...this.scmIntegrationsApi.gitlab.list(),\n ]\n .map(c => ({ type: c.type, title: c.title, host: c.config.host }))\n .filter(c => options.allowedHosts.includes(c.host));\n\n return {\n integrations,\n };\n }\n\n async getTemplateParameterSchema(\n templateRef: string,\n ): Promise<TemplateParameterSchema> {\n const { namespace, kind, name } = parseEntityRef(templateRef, {\n defaultKind: 'template',\n });\n\n const baseUrl = await this.discoveryApi.getBaseUrl('scaffolder');\n const templatePath = [namespace, kind, name]\n .map(s => encodeURIComponent(s))\n .join('/');\n\n const url = `${baseUrl}/v2/templates/${templatePath}/parameter-schema`;\n\n const response = await this.fetchApi.fetch(url);\n if (!response.ok) {\n throw await ResponseError.fromResponse(response);\n }\n\n const schema: TemplateParameterSchema = await response.json();\n return schema;\n }\n\n /**\n * Executes the scaffolding of a component, given a template and its\n * parameter values.\n *\n * @param options - The {@link ScaffolderScaffoldOptions} the scaffolding.\n */\n async scaffold(\n options: ScaffolderScaffoldOptions,\n ): Promise<ScaffolderScaffoldResponse> {\n const { templateRef, values, secrets = {} } = options;\n const url = `${await this.discoveryApi.getBaseUrl('scaffolder')}/v2/tasks`;\n const response = await this.fetchApi.fetch(url, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n templateRef,\n values: { ...values },\n secrets,\n }),\n });\n\n if (response.status !== 201) {\n const status = `${response.status} ${response.statusText}`;\n const body = await response.text();\n throw new Error(`Backend request failed, ${status} ${body.trim()}`);\n }\n\n const { id } = (await response.json()) as { id: string };\n return { taskId: id };\n }\n\n async getTask(taskId: string): Promise<ScaffolderTask> {\n const baseUrl = await this.discoveryApi.getBaseUrl('scaffolder');\n const url = `${baseUrl}/v2/tasks/${encodeURIComponent(taskId)}`;\n\n const response = await this.fetchApi.fetch(url);\n if (!response.ok) {\n throw await ResponseError.fromResponse(response);\n }\n\n return await response.json();\n }\n\n streamLogs(options: ScaffolderStreamLogsOptions): Observable<LogEvent> {\n if (this.useLongPollingLogs) {\n return this.streamLogsPolling(options);\n }\n\n return this.streamLogsEventStream(options);\n }\n\n async dryRun(\n options: ScaffolderDryRunOptions,\n ): Promise<ScaffolderDryRunResponse> {\n const baseUrl = await this.discoveryApi.getBaseUrl('scaffolder');\n const response = await this.fetchApi.fetch(`${baseUrl}/v2/dry-run`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n template: options.template,\n values: options.values,\n secrets: options.secrets,\n directoryContents: options.directoryContents,\n }),\n });\n\n if (!response.ok) {\n throw await ResponseError.fromResponse(response);\n }\n\n return response.json();\n }\n\n private streamLogsEventStream({\n taskId,\n after,\n }: {\n taskId: string;\n after?: number;\n }): Observable<LogEvent> {\n return new ObservableImpl(subscriber => {\n const params = new URLSearchParams();\n if (after !== undefined) {\n params.set('after', String(Number(after)));\n }\n\n this.discoveryApi.getBaseUrl('scaffolder').then(\n baseUrl => {\n const url = `${baseUrl}/v2/tasks/${encodeURIComponent(\n taskId,\n )}/eventstream`;\n const eventSource = new EventSource(url, { withCredentials: true });\n eventSource.addEventListener('log', (event: any) => {\n if (event.data) {\n try {\n subscriber.next(JSON.parse(event.data));\n } catch (ex) {\n subscriber.error(ex);\n }\n }\n });\n eventSource.addEventListener('completion', (event: any) => {\n if (event.data) {\n try {\n subscriber.next(JSON.parse(event.data));\n } catch (ex) {\n subscriber.error(ex);\n }\n }\n eventSource.close();\n subscriber.complete();\n });\n eventSource.addEventListener('error', event => {\n subscriber.error(event);\n });\n },\n error => {\n subscriber.error(error);\n },\n );\n });\n }\n\n private streamLogsPolling({\n taskId,\n after: inputAfter,\n }: {\n taskId: string;\n after?: number;\n }): Observable<LogEvent> {\n let after = inputAfter;\n\n return new ObservableImpl(subscriber => {\n this.discoveryApi.getBaseUrl('scaffolder').then(async baseUrl => {\n while (!subscriber.closed) {\n const url = `${baseUrl}/v2/tasks/${encodeURIComponent(\n taskId,\n )}/events?${qs.stringify({ after })}`;\n const response = await this.fetchApi.fetch(url);\n\n if (!response.ok) {\n // wait for one second to not run into an\n await new Promise(resolve => setTimeout(resolve, 1000));\n continue;\n }\n\n const logs = (await response.json()) as LogEvent[];\n\n for (const event of logs) {\n after = Number(event.id);\n\n subscriber.next(event);\n\n if (event.type === 'completion') {\n subscriber.complete();\n return;\n }\n }\n }\n });\n });\n }\n\n async listActions(): Promise<ListActionsResponse> {\n const baseUrl = await this.discoveryApi.getBaseUrl('scaffolder');\n const response = await this.fetchApi.fetch(`${baseUrl}/v2/actions`);\n if (!response.ok) {\n throw await ResponseError.fromResponse(response);\n }\n\n return await response.json();\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 { useApi } from '@backstage/core-plugin-api';\nimport {\n catalogApiRef,\n humanizeEntityRef,\n} from '@backstage/plugin-catalog-react';\nimport { TextField } from '@material-ui/core';\nimport FormControl from '@material-ui/core/FormControl';\nimport Autocomplete from '@material-ui/lab/Autocomplete';\nimport React, { useCallback, useEffect } from 'react';\nimport useAsync from 'react-use/lib/useAsync';\nimport { FieldExtensionComponentProps } from '../../../extensions';\n\n/**\n * The input props that can be specified under `ui:options` for the\n * `EntityPicker` field extension.\n *\n * @public\n */\nexport interface EntityPickerUiOptions {\n allowedKinds?: string[];\n defaultKind?: string;\n allowArbitraryValues?: boolean;\n}\n\n/**\n * The underlying component that is rendered in the form for the `EntityPicker`\n * field extension.\n *\n * @public\n */\nexport const EntityPicker = (\n props: FieldExtensionComponentProps<string, EntityPickerUiOptions>,\n) => {\n const {\n onChange,\n schema: { title = 'Entity', description = 'An entity from the catalog' },\n required,\n uiSchema,\n rawErrors,\n formData,\n idSchema,\n } = props;\n const allowedKinds = uiSchema['ui:options']?.allowedKinds;\n const defaultKind = uiSchema['ui:options']?.defaultKind;\n\n const catalogApi = useApi(catalogApiRef);\n\n const { value: entities, loading } = useAsync(() =>\n catalogApi.getEntities(\n allowedKinds ? { filter: { kind: allowedKinds } } : undefined,\n ),\n );\n\n const entityRefs = entities?.items.map(e =>\n humanizeEntityRef(e, { defaultKind }),\n );\n\n const onSelect = useCallback(\n (_: any, value: string | null) => {\n onChange(value || '');\n },\n [onChange],\n );\n\n useEffect(() => {\n if (entityRefs?.length === 1) {\n onChange(entityRefs[0]);\n }\n }, [entityRefs, onChange]);\n\n return (\n <FormControl\n margin=\"normal\"\n required={required}\n error={rawErrors?.length > 0 && !formData}\n >\n <Autocomplete\n disabled={entityRefs?.length === 1}\n id={idSchema?.$id}\n value={(formData as string) || ''}\n loading={loading}\n onChange={onSelect}\n options={entityRefs || []}\n autoSelect\n freeSolo={uiSchema['ui:options']?.allowArbitraryValues ?? true}\n renderInput={params => (\n <TextField\n {...params}\n label={title}\n margin=\"normal\"\n helperText={description}\n variant=\"outlined\"\n required={required}\n InputProps={params.InputProps}\n />\n )}\n />\n </FormControl>\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 { FieldExtensionComponentProps } from '../../../extensions';\nimport { TextField } from '@material-ui/core';\n\n/**\n * EntityName Picker\n */\nexport const EntityNamePicker = (\n props: FieldExtensionComponentProps<string>,\n) => {\n const {\n onChange,\n required,\n schema: { title = 'Name', description = 'Unique name of the component' },\n rawErrors,\n formData,\n uiSchema: { 'ui:autofocus': autoFocus },\n idSchema,\n placeholder,\n } = props;\n\n return (\n <TextField\n id={idSchema?.$id}\n label={title}\n placeholder={placeholder}\n helperText={description}\n required={required}\n value={formData ?? ''}\n onChange={({ target: { value } }) => onChange(value)}\n margin=\"normal\"\n error={rawErrors?.length > 0 && !formData}\n inputProps={{ autoFocus }}\n />\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 { FieldValidation } from '@rjsf/core';\nimport { KubernetesValidatorFunctions } from '@backstage/catalog-model';\n\nexport const entityNamePickerValidation = (\n value: string,\n validation: FieldValidation,\n) => {\n if (!KubernetesValidatorFunctions.isValidObjectName(value)) {\n validation.addError(\n 'must start and end with an alphanumeric character, and contain only alphanumeric characters, hyphens, underscores, and periods. Maximum length is 63 characters.',\n );\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, { useState } from 'react';\nimport useAsync from 'react-use/lib/useAsync';\nimport useEffectOnce from 'react-use/lib/useEffectOnce';\nimport { GetEntitiesRequest } from '@backstage/catalog-client';\nimport { Entity, makeValidator } from '@backstage/catalog-model';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { catalogApiRef } from '@backstage/plugin-catalog-react';\nimport { FormControl, TextField } from '@material-ui/core';\nimport { Autocomplete } from '@material-ui/lab';\nimport { FieldExtensionComponentProps } from '../../../extensions';\n\n/**\n * The input props that can be specified under `ui:options` for the\n * `EntityTagsPicker` field extension.\n *\n * @public\n */\nexport interface EntityTagsPickerUiOptions {\n kinds?: string[];\n}\n\n/**\n * The underlying component that is rendered in the form for the `EntityTagsPicker`\n * field extension.\n *\n * @public\n */\nexport const EntityTagsPicker = (\n props: FieldExtensionComponentProps<string[], EntityTagsPickerUiOptions>,\n) => {\n const { formData, onChange, uiSchema } = props;\n const catalogApi = useApi(catalogApiRef);\n const [inputValue, setInputValue] = useState('');\n const [inputError, setInputError] = useState(false);\n const tagValidator = makeValidator().isValidTag;\n const kinds = uiSchema['ui:options']?.kinds;\n\n const { loading, value: existingTags } = useAsync(async () => {\n const tagsRequest: GetEntitiesRequest = { fields: ['metadata.tags'] };\n if (kinds) {\n tagsRequest.filter = { kind: kinds };\n }\n\n const entities = await catalogApi.getEntities(tagsRequest);\n\n return [\n ...new Set(\n entities.items\n .flatMap((e: Entity) => e.metadata?.tags)\n .filter(Boolean) as string[],\n ),\n ].sort();\n });\n\n const setTags = (_: React.ChangeEvent<{}>, values: string[] | null) => {\n // Reset error state in case all tags were removed\n let hasError = false;\n let addDuplicate = false;\n const currentTags = formData || [];\n\n // If adding a new tag\n if (values?.length && currentTags.length < values.length) {\n const newTag = (values[values.length - 1] = values[values.length - 1]\n .toLocaleLowerCase('en-US')\n .trim());\n hasError = !tagValidator(newTag);\n addDuplicate = currentTags.indexOf(newTag) !== -1;\n }\n\n setInputError(hasError);\n setInputValue(!hasError ? '' : inputValue);\n if (!hasError && !addDuplicate) {\n onChange(values || []);\n }\n };\n\n // Initialize field to always return an array\n useEffectOnce(() => onChange(formData || []));\n\n return (\n <FormControl margin=\"normal\">\n <Autocomplete\n multiple\n freeSolo\n filterSelectedOptions\n onChange={setTags}\n value={formData || []}\n inputValue={inputValue}\n loading={loading}\n options={existingTags || []}\n ChipProps={{ size: 'small' }}\n renderInput={params => (\n <TextField\n {...params}\n label=\"Tags\"\n onChange={e => setInputValue(e.target.value)}\n error={inputError}\n helperText=\"Add any relevant tags, hit 'Enter' to add new tags. Valid format: [a-z0-9+#] separated by [-], at most 63 characters\"\n />\n )}\n />\n </FormControl>\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 { EntityPicker } from '../EntityPicker/EntityPicker';\nimport { FieldExtensionComponentProps } from '../../../extensions';\n\n/**\n * The input props that can be specified under `ui:options` for the\n * `OwnerPicker` field extension.\n *\n * @public\n */\nexport interface OwnerPickerUiOptions {\n allowedKinds?: string[];\n}\n\n/**\n * The underlying component that is rendered in the form for the `OwnerPicker`\n * field extension.\n *\n * @public\n */\nexport const OwnerPicker = (\n props: FieldExtensionComponentProps<string, OwnerPickerUiOptions>,\n) => {\n const {\n schema: { title = 'Owner', description = 'The owner of the component' },\n uiSchema,\n ...restProps\n } = props;\n\n const ownerUiSchema = {\n ...uiSchema,\n 'ui:options': {\n allowedKinds: (uiSchema['ui:options']?.allowedKinds || [\n 'Group',\n 'User',\n ]) as string[],\n defaultKind: 'Group',\n },\n };\n\n return (\n <EntityPicker\n {...restProps}\n schema={{ title, description }}\n uiSchema={ownerUiSchema}\n />\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 FormControl from '@material-ui/core/FormControl';\nimport FormHelperText from '@material-ui/core/FormHelperText';\nimport Input from '@material-ui/core/Input';\nimport InputLabel from '@material-ui/core/InputLabel';\nimport { Select, SelectItem } from '@backstage/core-components';\nimport { RepoUrlPickerState } from './types';\n\nexport const GithubRepoPicker = (props: {\n allowedOwners?: string[];\n rawErrors: string[];\n state: RepoUrlPickerState;\n onChange: (state: RepoUrlPickerState) => void;\n}) => {\n const { allowedOwners = [], rawErrors, state, onChange } = props;\n const ownerItems: SelectItem[] = allowedOwners\n ? allowedOwners.map(i => ({ label: i, value: i }))\n : [{ label: 'Loading...', value: 'loading' }];\n\n const { owner } = state;\n\n return (\n <>\n <FormControl\n margin=\"normal\"\n required\n error={rawErrors?.length > 0 && !owner}\n >\n {allowedOwners?.length ? (\n <Select\n native\n label=\"Owner Available\"\n onChange={s =>\n onChange({ owner: String(Array.isArray(s) ? s[0] : s) })\n }\n disabled={allowedOwners.length === 1}\n selected={owner}\n items={ownerItems}\n />\n ) : (\n <>\n <InputLabel htmlFor=\"ownerInput\">Owner</InputLabel>\n <Input\n id=\"ownerInput\"\n onChange={e => onChange({ owner: e.target.value })}\n value={owner}\n />\n </>\n )}\n <FormHelperText>\n The organization, user or project that this repo will belong to\n </FormHelperText>\n </FormControl>\n </>\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 FormControl from '@material-ui/core/FormControl';\nimport FormHelperText from '@material-ui/core/FormHelperText';\nimport Input from '@material-ui/core/Input';\nimport InputLabel from '@material-ui/core/InputLabel';\nimport { Select, SelectItem } from '@backstage/core-components';\nimport { RepoUrlPickerState } from './types';\n\nexport const GitlabRepoPicker = (props: {\n allowedOwners?: string[];\n allowedRepos?: string[];\n state: RepoUrlPickerState;\n onChange: (state: RepoUrlPickerState) => void;\n rawErrors: string[];\n}) => {\n const { allowedOwners = [], state, onChange, rawErrors } = props;\n const ownerItems: SelectItem[] = allowedOwners\n ? allowedOwners.map(i => ({ label: i, value: i }))\n : [{ label: 'Loading...', value: 'loading' }];\n\n const { owner } = state;\n\n return (\n <>\n <FormControl\n margin=\"normal\"\n required\n error={rawErrors?.length > 0 && !owner}\n >\n {allowedOwners?.length ? (\n <Select\n native\n label=\"Owner Available\"\n onChange={selected =>\n onChange({\n owner: String(Array.isArray(selected) ? selected[0] : selected),\n })\n }\n disabled={allowedOwners.length === 1}\n selected={owner}\n items={ownerItems}\n />\n ) : (\n <>\n <InputLabel htmlFor=\"ownerInput\">Owner</InputLabel>\n <Input\n id=\"ownerInput\"\n onChange={e => onChange({ owner: e.target.value })}\n value={owner}\n />\n </>\n )}\n <FormHelperText>\n The organization, groups, subgroups, user, project (also known as\n namespaces in gitlab), that this repo will belong to\n </FormHelperText>\n </FormControl>\n </>\n );\n};\n","/*\n * Copyright 2022 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 FormControl from '@material-ui/core/FormControl';\nimport FormHelperText from '@material-ui/core/FormHelperText';\nimport Input from '@material-ui/core/Input';\nimport InputLabel from '@material-ui/core/InputLabel';\nimport { RepoUrlPickerState } from './types';\n\nexport const AzureRepoPicker = (props: {\n state: RepoUrlPickerState;\n onChange: (state: RepoUrlPickerState) => void;\n rawErrors: string[];\n}) => {\n const { rawErrors, state, onChange } = props;\n const { organization, owner } = state;\n return (\n <>\n <FormControl\n margin=\"normal\"\n required\n error={rawErrors?.length > 0 && !organization}\n >\n <InputLabel htmlFor=\"orgInput\">Organization</InputLabel>\n <Input\n id=\"orgInput\"\n onChange={e => onChange({ organization: e.target.value })}\n value={organization}\n />\n <FormHelperText>\n The organization that this repo will belong to\n </FormHelperText>\n </FormControl>\n <FormControl\n margin=\"normal\"\n required\n error={rawErrors?.length > 0 && !owner}\n >\n <InputLabel htmlFor=\"ownerInput\">Owner</InputLabel>\n <Input\n id=\"ownerInput\"\n onChange={e => onChange({ owner: e.target.value })}\n value={owner}\n />\n <FormHelperText>The Owner that this repo will belong to</FormHelperText>\n </FormControl>\n </>\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 FormControl from '@material-ui/core/FormControl';\nimport FormHelperText from '@material-ui/core/FormHelperText';\nimport Input from '@material-ui/core/Input';\nimport InputLabel from '@material-ui/core/InputLabel';\nimport { RepoUrlPickerState } from './types';\n\nexport const BitbucketRepoPicker = (props: {\n onChange: (state: RepoUrlPickerState) => void;\n state: RepoUrlPickerState;\n rawErrors: string[];\n}) => {\n const { onChange, rawErrors, state } = props;\n const { host, workspace, project } = state;\n return (\n <>\n {host === 'bitbucket.org' && (\n <FormControl\n margin=\"normal\"\n required\n error={rawErrors?.length > 0 && !workspace}\n >\n <InputLabel htmlFor=\"workspaceInput\">Workspace</InputLabel>\n <Input\n id=\"workspaceInput\"\n onChange={e => onChange({ workspace: e.target.value })}\n value={workspace}\n />\n <FormHelperText>\n The Organization that this repo will belong to\n </FormHelperText>\n </FormControl>\n )}\n <FormControl\n margin=\"normal\"\n required\n error={rawErrors?.length > 0 && !project}\n >\n <InputLabel htmlFor=\"projectInput\">Project</InputLabel>\n <Input\n id=\"projectInput\"\n onChange={e => onChange({ project: e.target.value })}\n value={project}\n />\n <FormHelperText>\n The Project that this repo will belong to\n </FormHelperText>\n </FormControl>\n </>\n );\n};\n","/*\n * Copyright 2022 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 FormControl from '@material-ui/core/FormControl';\nimport FormHelperText from '@material-ui/core/FormHelperText';\nimport Input from '@material-ui/core/Input';\nimport InputLabel from '@material-ui/core/InputLabel';\nimport { RepoUrlPickerState } from './types';\n\nexport const GerritRepoPicker = (props: {\n onChange: (state: RepoUrlPickerState) => void;\n state: RepoUrlPickerState;\n rawErrors: string[];\n}) => {\n const { onChange, rawErrors, state } = props;\n const { workspace, owner } = state;\n return (\n <>\n <FormControl\n margin=\"normal\"\n required\n error={rawErrors?.length > 0 && !workspace}\n >\n <InputLabel htmlFor=\"ownerInput\">Owner</InputLabel>\n <Input\n id=\"ownerInput\"\n onChange={e => onChange({ owner: e.target.value })}\n value={owner}\n />\n <FormHelperText>The owner of the project</FormHelperText>\n </FormControl>\n <FormControl\n margin=\"normal\"\n required\n error={rawErrors?.length > 0 && !workspace}\n >\n <InputLabel htmlFor=\"parentInput\">Parent</InputLabel>\n <Input\n id=\"parentInput\"\n onChange={e => onChange({ workspace: e.target.value })}\n value={workspace}\n />\n <FormHelperText>\n The project parent that the repo will belong to\n </FormHelperText>\n </FormControl>\n </>\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, { useEffect } from 'react';\nimport { Progress, Select, SelectItem } from '@backstage/core-components';\nimport FormControl from '@material-ui/core/FormControl';\nimport FormHelperText from '@material-ui/core/FormHelperText';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { scaffolderApiRef } from '../../../api';\nimport useAsync from 'react-use/lib/useAsync';\n\nexport const RepoUrlPickerHost = (props: {\n host?: string;\n hosts?: string[];\n onChange: (host: string) => void;\n rawErrors: string[];\n}) => {\n const { host, hosts, onChange, rawErrors } = props;\n const scaffolderApi = useApi(scaffolderApiRef);\n\n const { value: { integrations } = { integrations: [] }, loading } = useAsync(\n async () => {\n return await scaffolderApi.getIntegrationsList({\n allowedHosts: hosts ?? [],\n });\n },\n );\n\n useEffect(() => {\n // If there is no host chosen currently\n if (!host) {\n // Set the first of the allowedHosts option if that available\n if (hosts?.length) {\n onChange(hosts[0]);\n // if there's no hosts provided, fallback to using the first integration\n } else if (integrations?.length) {\n onChange(integrations[0].host);\n }\n }\n }, [hosts, host, onChange, integrations]);\n\n // If there are no allowedHosts provided, then show all integrations. Otherwise, only show integrations\n // that are provided in the dropdown for the user to choose from.\n const hostsOptions: SelectItem[] = integrations\n ? integrations\n .filter(i => (hosts?.length ? hosts?.includes(i.host) : true))\n .map(i => ({ label: i.title, value: i.host }))\n : [{ label: 'Loading...', value: 'loading' }];\n\n if (loading) {\n return <Progress />;\n }\n\n return (\n <>\n <FormControl\n margin=\"normal\"\n required\n error={rawErrors?.length > 0 && !host}\n >\n <Select\n native\n disabled={hosts?.length === 1 ?? false}\n label=\"Host\"\n onChange={s => onChange(String(Array.isArray(s) ? s[0] : s))}\n selected={host}\n items={hostsOptions}\n data-testid=\"host-select\"\n />\n\n <FormHelperText>\n The host where the repository will be created\n </FormHelperText>\n </FormControl>\n </>\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, { useEffect } from 'react';\nimport { Select, SelectItem } from '@backstage/core-components';\nimport FormControl from '@material-ui/core/FormControl';\nimport FormHelperText from '@material-ui/core/FormHelperText';\nimport Input from '@material-ui/core/Input';\nimport InputLabel from '@material-ui/core/InputLabel';\n\nexport const RepoUrlPickerRepoName = (props: {\n repoName?: string;\n allowedRepos?: string[];\n onChange: (host: string) => void;\n rawErrors: string[];\n}) => {\n const { repoName, allowedRepos, onChange, rawErrors } = props;\n\n useEffect(() => {\n // If there is no repoName chosen currently\n if (!repoName) {\n // Set the first of the allowedRepos option if that available\n if (allowedRepos?.length) {\n onChange(allowedRepos[0]);\n }\n }\n }, [allowedRepos, repoName, onChange]);\n\n const repoItems: SelectItem[] = allowedRepos\n ? allowedRepos.map(i => ({ label: i, value: i }))\n : [{ label: 'Loading...', value: 'loading' }];\n\n return (\n <>\n <FormControl\n margin=\"normal\"\n required\n error={rawErrors?.length > 0 && !repoName}\n >\n {allowedRepos?.length ? (\n <Select\n native\n label=\"Repositories Available\"\n onChange={selected =>\n String(Array.isArray(selected) ? selected[0] : selected)\n }\n disabled={allowedRepos.length === 1}\n selected={repoName}\n items={repoItems}\n />\n ) : (\n <>\n <InputLabel htmlFor=\"repoNameInput\">Repository</InputLabel>\n <Input\n id=\"repoNameInput\"\n onChange={e => onChange(String(e.target.value))}\n value={repoName}\n />\n </>\n )}\n <FormHelperText>The name of the repository</FormHelperText>\n </FormControl>\n </>\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 { RepoUrlPickerState } from './types';\n\nexport function serializeRepoPickerUrl(data: RepoUrlPickerState) {\n if (!data.host) {\n return undefined;\n }\n\n const params = new URLSearchParams();\n if (data.owner) {\n params.set('owner', data.owner);\n }\n if (data.repoName) {\n params.set('repo', data.repoName);\n }\n if (data.organization) {\n params.set('organization', data.organization);\n }\n if (data.workspace) {\n params.set('workspace', data.workspace);\n }\n if (data.project) {\n params.set('project', data.project);\n }\n\n return `${data.host}?${params.toString()}`;\n}\n\nexport function parseRepoPickerUrl(\n url: string | undefined,\n): RepoUrlPickerState {\n let host = '';\n let owner = '';\n let repoName = '';\n let organization = '';\n let workspace = '';\n let project = '';\n\n try {\n if (url) {\n const parsed = new URL(`https://${url}`);\n host = parsed.host;\n owner = parsed.searchParams.get('owner') || '';\n repoName = parsed.searchParams.get('repo') || '';\n organization = parsed.searchParams.get('organization') || '';\n workspace = parsed.searchParams.get('workspace') || '';\n project = parsed.searchParams.get('project') || '';\n }\n } catch {\n /* ok */\n }\n\n return { host, owner, repoName, organization, workspace, project };\n}\n","/*\n * Copyright 2022 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, {\n useState,\n useCallback,\n useContext,\n createContext,\n PropsWithChildren,\n} from 'react';\n\ntype SecretsContextContents = {\n secrets: Record<string, string>;\n setSecrets: React.Dispatch<React.SetStateAction<Record<string, string>>>;\n};\n\n/**\n * The actual context object.\n */\nexport const SecretsContext = createContext<SecretsContextContents | undefined>(\n undefined,\n);\n\n/**\n * The Context Provider that holds the state for the secrets.\n *\n * @public\n */\nexport const SecretsContextProvider = ({ children }: PropsWithChildren<{}>) => {\n const [secrets, setSecrets] = useState<Record<string, string>>({});\n\n return (\n <SecretsContext.Provider value={{ secrets, setSecrets }}>\n {children}\n </SecretsContext.Provider>\n );\n};\n\n/**\n * The return type from the useTemplateSecrets hook.\n * @public\n */\nexport interface ScaffolderUseTemplateSecrets {\n setSecrets: (input: Record<string, string>) => void;\n}\n\n/**\n * Hook to access the secrets context.\n * @public\n */\nexport const useTemplateSecrets = (): ScaffolderUseTemplateSecrets => {\n const value = useContext(SecretsContext);\n if (!value) {\n throw new Error(\n 'useTemplateSecrets must be used within a SecretsContextProvider',\n );\n }\n\n const { setSecrets: updateSecrets } = value;\n\n const setSecrets = useCallback(\n (input: Record<string, string>) => {\n updateSecrets(currentSecrets => ({ ...currentSecrets, ...input }));\n },\n [updateSecrets],\n );\n\n return { setSecrets };\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 { useApi } from '@backstage/core-plugin-api';\nimport {\n scmIntegrationsApiRef,\n scmAuthApiRef,\n} from '@backstage/integration-react';\nimport React, { useEffect, useState, useMemo, useCallback } from 'react';\nimport { GithubRepoPicker } from './GithubRepoPicker';\nimport { GitlabRepoPicker } from './GitlabRepoPicker';\nimport { AzureRepoPicker } from './AzureRepoPicker';\nimport { BitbucketRepoPicker } from './BitbucketRepoPicker';\nimport { GerritRepoPicker } from './GerritRepoPicker';\nimport { FieldExtensionComponentProps } from '../../../extensions';\nimport { RepoUrlPickerHost } from './RepoUrlPickerHost';\nimport { RepoUrlPickerRepoName } from './RepoUrlPickerRepoName';\nimport { parseRepoPickerUrl, serializeRepoPickerUrl } from './utils';\nimport { RepoUrlPickerState } from './types';\nimport useDebounce from 'react-use/lib/useDebounce';\nimport { useTemplateSecrets } from '../../secrets';\n\n/**\n * The input props that can be specified under `ui:options` for the\n * `RepoUrlPicker` field extension.\n *\n * @public\n */\nexport interface RepoUrlPickerUiOptions {\n allowedHosts?: string[];\n allowedOwners?: string[];\n allowedRepos?: string[];\n requestUserCredentials?: {\n secretsKey: string;\n additionalScopes?: {\n gerrit?: string[];\n github?: string[];\n gitlab?: string[];\n bitbucket?: string[];\n azure?: string[];\n };\n };\n}\n\n/**\n * The underlying component that is rendered in the form for the `RepoUrlPicker`\n * field extension.\n *\n * @public\n */\nexport const RepoUrlPicker = (\n props: FieldExtensionComponentProps<string, RepoUrlPickerUiOptions>,\n) => {\n const { uiSchema, onChange, rawErrors, formData } = props;\n const [state, setState] = useState<RepoUrlPickerState>(\n parseRepoPickerUrl(formData),\n );\n const integrationApi = useApi(scmIntegrationsApiRef);\n const scmAuthApi = useApi(scmAuthApiRef);\n const { setSecrets } = useTemplateSecrets();\n const allowedHosts = useMemo(\n () => uiSchema?.['ui:options']?.allowedHosts ?? [],\n [uiSchema],\n );\n const allowedOwners = useMemo(\n () => uiSchema?.['ui:options']?.allowedOwners ?? [],\n [uiSchema],\n );\n const allowedRepos = useMemo(\n () => uiSchema?.['ui:options']?.allowedRepos ?? [],\n [uiSchema],\n );\n\n useEffect(() => {\n onChange(serializeRepoPickerUrl(state));\n }, [state, onChange]);\n\n /* we deal with calling the repo setting here instead of in each components for ease */\n useEffect(() => {\n if (allowedOwners.length === 1) {\n setState(prevState => ({ ...prevState, owner: allowedOwners[0] }));\n }\n }, [setState, allowedOwners]);\n useEffect(() => {\n if (allowedRepos.length === 1) {\n setState(prevState => ({ ...prevState, repoName: allowedRepos[0] }));\n }\n }, [setState, allowedRepos]);\n\n const updateLocalState = useCallback(\n (newState: RepoUrlPickerState) => {\n setState(prevState => ({ ...prevState, ...newState }));\n },\n [setState],\n );\n\n useDebounce(\n async () => {\n const { requestUserCredentials } = uiSchema?.['ui:options'] ?? {};\n\n if (\n !requestUserCredentials ||\n !(state.host && state.owner && state.repoName)\n ) {\n return;\n }\n\n const [host, owner, repoName] = [\n state.host,\n state.owner,\n state.repoName,\n ].map(encodeURIComponent);\n\n // user has requested that we use the users credentials\n // so lets grab them using the scmAuthApi and pass through\n // any additional scopes from the ui:options\n const { token } = await scmAuthApi.getCredentials({\n url: `https://${host}/${owner}/${repoName}`,\n additionalScope: {\n repoWrite: true,\n customScopes: requestUserCredentials.additionalScopes,\n },\n });\n\n // set the secret using the key provided in the the ui:options for use\n // in the templating the manifest with ${{ secrets[secretsKey] }}\n setSecrets({ [requestUserCredentials.secretsKey]: token });\n },\n 500,\n [state, uiSchema],\n );\n\n const hostType =\n (state.host && integrationApi.byHost(state.host)?.type) ?? null;\n\n return (\n <>\n <RepoUrlPickerHost\n host={state.host}\n hosts={allowedHosts}\n onChange={host => setState(prevState => ({ ...prevState, host }))}\n rawErrors={rawErrors}\n />\n {hostType === 'github' && (\n <GithubRepoPicker\n allowedOwners={allowedOwners}\n rawErrors={rawErrors}\n state={state}\n onChange={updateLocalState}\n />\n )}\n {hostType === 'gitlab' && (\n <GitlabRepoPicker\n allowedOwners={allowedOwners}\n rawErrors={rawErrors}\n state={state}\n onChange={updateLocalState}\n />\n )}\n {hostType === 'bitbucket' && (\n <BitbucketRepoPicker\n rawErrors={rawErrors}\n state={state}\n onChange={updateLocalState}\n />\n )}\n {hostType === 'azure' && (\n <AzureRepoPicker\n rawErrors={rawErrors}\n state={state}\n onChange={updateLocalState}\n />\n )}\n {hostType === 'gerrit' && (\n <GerritRepoPicker\n rawErrors={rawErrors}\n state={state}\n onChange={updateLocalState}\n />\n )}\n <RepoUrlPickerRepoName\n repoName={state.repoName}\n allowedRepos={allowedRepos}\n onChange={repoName =>\n setState(prevState => ({ ...prevState, repoName }))\n }\n rawErrors={rawErrors}\n />\n </>\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 { FieldValidation } from '@rjsf/core';\nimport { ApiHolder } from '@backstage/core-plugin-api';\nimport { scmIntegrationsApiRef } from '@backstage/integration-react';\n\n/**\n * The validation function for the `repoUrl` that is returned from the\n * field extension. Ensures that you have all the required fields filled for\n * the different providers that exist.\n *\n * @public\n */\nexport const repoPickerValidation = (\n value: string,\n validation: FieldValidation,\n context: { apiHolder: ApiHolder },\n) => {\n try {\n const { host, searchParams } = new URL(`https://${value}`);\n\n const integrationApi = context.apiHolder.get(scmIntegrationsApiRef);\n\n if (!host) {\n validation.addError(\n 'Incomplete repository location provided, host not provided',\n );\n } else {\n if (integrationApi?.byHost(host)?.type === 'bitbucket') {\n // workspace is only applicable for bitbucket cloud\n if (host === 'bitbucket.org' && !searchParams.get('workspace')) {\n validation.addError(\n 'Incomplete repository location provided, workspace not provided',\n );\n }\n\n if (!searchParams.get('project')) {\n validation.addError(\n 'Incomplete repository location provided, project not provided',\n );\n }\n }\n // For anything other than bitbucket\n else {\n if (!searchParams.get('owner')) {\n validation.addError(\n 'Incomplete repository location provided, owner not provided',\n );\n }\n }\n\n // Do this for all hosts\n if (!searchParams.get('repo')) {\n validation.addError(\n 'Incomplete repository location provided, repo not provided',\n );\n }\n }\n } catch {\n validation.addError('Unable to parse the Repository URL');\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 { GetEntitiesResponse } from '@backstage/catalog-client';\nimport { RELATION_OWNED_BY } from '@backstage/catalog-model';\nimport { identityApiRef, useApi } from '@backstage/core-plugin-api';\nimport {\n catalogApiRef,\n humanizeEntityRef,\n} from '@backstage/plugin-catalog-react';\nimport { TextField } from '@material-ui/core';\nimport FormControl from '@material-ui/core/FormControl';\nimport Autocomplete from '@material-ui/lab/Autocomplete';\nimport React, { useMemo } from 'react';\nimport useAsync from 'react-use/lib/useAsync';\n\nimport { FieldExtensionComponentProps } from '../../../extensions';\n\n/**\n * The input props that can be specified under `ui:options` for the\n * `OwnedEntityPicker` field extension.\n *\n * @public\n */\nexport interface OwnedEntityPickerUiOptions {\n allowedKinds?: string[];\n defaultKind?: string;\n allowArbitraryValues?: boolean;\n}\n\n/**\n * The underlying component that is rendered in the form for the `OwnedEntityPicker`\n * field extension.\n *\n * @public\n */\nexport const OwnedEntityPicker = (\n props: FieldExtensionComponentProps<string, OwnedEntityPickerUiOptions>,\n) => {\n const {\n onChange,\n schema: { title = 'Entity', description = 'An entity from the catalog' },\n required,\n uiSchema,\n rawErrors,\n formData,\n idSchema,\n } = props;\n\n const allowedKinds = uiSchema['ui:options']?.allowedKinds;\n const defaultKind = uiSchema['ui:options']?.defaultKind;\n const allowArbitraryValues =\n uiSchema['ui:options']?.allowArbitraryValues ?? true;\n const { ownedEntities, loading } = useOwnedEntities(allowedKinds);\n\n const entityRefs = ownedEntities?.items\n .map(e => humanizeEntityRef(e, { defaultKind }))\n .filter(n => n);\n\n const onSelect = (_: any, value: string | null) => {\n onChange(value || '');\n };\n\n return (\n <FormControl\n margin=\"normal\"\n required={required}\n error={rawErrors?.length > 0 && !formData}\n >\n <Autocomplete\n id={idSchema?.$id}\n value={(formData as string) || ''}\n loading={loading}\n onChange={onSelect}\n options={entityRefs || []}\n autoSelect\n freeSolo={allowArbitraryValues}\n renderInput={params => (\n <TextField\n {...params}\n label={title}\n margin=\"normal\"\n helperText={description}\n variant=\"outlined\"\n required={required}\n InputProps={params.InputProps}\n />\n )}\n />\n </FormControl>\n );\n};\n\n/**\n * Takes the relevant parts of the Backstage identity, and translates them into\n * a list of entities which are owned by the user. Takes an optional parameter\n * to filter the entities based on allowedKinds\n *\n *\n * @param allowedKinds - Array of allowed kinds to filter the entities\n */\nfunction useOwnedEntities(allowedKinds?: string[]): {\n loading: boolean;\n ownedEntities: GetEntitiesResponse | undefined;\n} {\n const identityApi = useApi(identityApiRef);\n const catalogApi = useApi(catalogApiRef);\n\n const { loading, value: refs } = useAsync(async () => {\n const identity = await identityApi.getBackstageIdentity();\n const identityRefs = identity.ownershipEntityRefs;\n const catalogs = await catalogApi.getEntities(\n allowedKinds\n ? {\n filter: {\n kind: allowedKinds,\n [`relations.${RELATION_OWNED_BY}`]: identityRefs || [],\n },\n }\n : {\n filter: {\n [`relations.${RELATION_OWNED_BY}`]: identityRefs || [],\n },\n },\n );\n return catalogs;\n }, []);\n\n const ownedEntities = useMemo(() => {\n return refs;\n }, [refs]);\n\n return useMemo(() => ({ loading, ownedEntities }), [loading, ownedEntities]);\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 {\n CustomFieldValidator,\n FieldExtensionOptions,\n FieldExtensionComponentProps,\n} from './types';\nimport { Extension, attachComponentData } from '@backstage/core-plugin-api';\n\nexport const FIELD_EXTENSION_WRAPPER_KEY = 'scaffolder.extensions.wrapper.v1';\nexport const FIELD_EXTENSION_KEY = 'scaffolder.extensions.field.v1';\n\n/**\n * A type used to wrap up the FieldExtension to embed the ReturnValue and the InputProps\n *\n * @public\n */\nexport type FieldExtensionComponent<_TReturnValue, _TInputProps> = () => null;\n\n/**\n * Method for creating field extensions that can be used in the scaffolder\n * frontend form.\n * @public\n */\nexport function createScaffolderFieldExtension<\n TReturnValue = unknown,\n TInputProps = unknown,\n>(\n options: FieldExtensionOptions<TReturnValue, TInputProps>,\n): Extension<FieldExtensionComponent<TReturnValue, TInputProps>> {\n return {\n expose() {\n const FieldExtensionDataHolder: any = () => null;\n\n attachComponentData(\n FieldExtensionDataHolder,\n FIELD_EXTENSION_KEY,\n options,\n );\n\n return FieldExtensionDataHolder;\n },\n };\n}\n\n/**\n * The Wrapping component for defining fields extensions inside\n *\n * @public\n */\nexport const ScaffolderFieldExtensions: React.ComponentType =\n (): JSX.Element | null => null;\n\nattachComponentData(\n ScaffolderFieldExtensions,\n FIELD_EXTENSION_WRAPPER_KEY,\n true,\n);\n\nexport type {\n CustomFieldValidator,\n FieldExtensionOptions,\n FieldExtensionComponentProps,\n};\n\nexport { DEFAULT_SCAFFOLDER_FIELD_EXTENSIONS } from './default';\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 {\n createExternalRouteRef,\n createRouteRef,\n createSubRouteRef,\n} from '@backstage/core-plugin-api';\n\nexport const registerComponentRouteRef = createExternalRouteRef({\n id: 'register-component',\n optional: true,\n});\n\nexport const rootRouteRef = createRouteRef({\n id: 'scaffolder',\n});\n\n/**\n * @deprecated This is the old template route, can be deleted before next major release\n */\nexport const legacySelectedTemplateRouteRef = createSubRouteRef({\n id: 'scaffolder/legacy/selected-template',\n parent: rootRouteRef,\n path: '/templates/:templateName',\n});\n\nexport const selectedTemplateRouteRef = createSubRouteRef({\n id: 'scaffolder/selected-template',\n parent: rootRouteRef,\n path: '/templates/:namespace/:templateName',\n});\n\nexport const scaffolderTaskRouteRef = createSubRouteRef({\n id: 'scaffolder/task',\n parent: rootRouteRef,\n path: '/tasks/:taskId',\n});\n\nexport const scaffolderListTaskRouteRef = createSubRouteRef({\n id: 'scaffolder/list-tasks',\n parent: rootRouteRef,\n path: '/tasks',\n});\n\nexport const actionsRouteRef = createSubRouteRef({\n id: 'scaffolder/actions',\n parent: rootRouteRef,\n path: '/actions',\n});\n\nexport const editRouteRef = createSubRouteRef({\n id: 'scaffolder/edit',\n parent: rootRouteRef,\n path: '/edit',\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 { scmIntegrationsApiRef } from '@backstage/integration-react';\nimport { scaffolderApiRef, ScaffolderClient } from './api';\nimport { EntityPicker } from './components/fields/EntityPicker/EntityPicker';\nimport { entityNamePickerValidation } from './components/fields/EntityNamePicker';\nimport { EntityNamePicker } from './components/fields/EntityNamePicker/EntityNamePicker';\nimport { OwnerPicker } from './components/fields/OwnerPicker/OwnerPicker';\nimport { repoPickerValidation } from './components/fields/RepoUrlPicker';\nimport { RepoUrlPicker } from './components/fields/RepoUrlPicker/RepoUrlPicker';\nimport { createScaffolderFieldExtension } from './extensions';\nimport { registerComponentRouteRef, rootRouteRef } from './routes';\nimport {\n createApiFactory,\n createPlugin,\n createRoutableExtension,\n discoveryApiRef,\n fetchApiRef,\n identityApiRef,\n} from '@backstage/core-plugin-api';\nimport { OwnedEntityPicker } from './components/fields/OwnedEntityPicker/OwnedEntityPicker';\nimport { EntityTagsPicker } from './components/fields/EntityTagsPicker/EntityTagsPicker';\n\n/**\n * The main plugin export for the scaffolder.\n * @public\n */\nexport const scaffolderPlugin = createPlugin({\n id: 'scaffolder',\n apis: [\n createApiFactory({\n api: scaffolderApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n scmIntegrationsApi: scmIntegrationsApiRef,\n fetchApi: fetchApiRef,\n identityApi: identityApiRef,\n },\n factory: ({ discoveryApi, scmIntegrationsApi, fetchApi, identityApi }) =>\n new ScaffolderClient({\n discoveryApi,\n scmIntegrationsApi,\n fetchApi,\n identityApi,\n }),\n }),\n ],\n routes: {\n root: rootRouteRef,\n },\n externalRoutes: {\n registerComponent: registerComponentRouteRef,\n },\n});\n\n/**\n * A field extension for selecting an Entity that exists in the Catalog.\n *\n * @public\n */\nexport const EntityPickerFieldExtension = scaffolderPlugin.provide(\n createScaffolderFieldExtension({\n component: EntityPicker,\n name: 'EntityPicker',\n }),\n);\n\n/**\n * The field extension for selecting a name for a new Entity in the Catalog.\n *\n * @public\n */\nexport const EntityNamePickerFieldExtension = scaffolderPlugin.provide(\n createScaffolderFieldExtension({\n component: EntityNamePicker,\n name: 'EntityNamePicker',\n validation: entityNamePickerValidation,\n }),\n);\n\n/**\n * The field extension which provides the ability to select a RepositoryUrl.\n * Currently this is an encoded URL that looks something like the following `github.com?repo=myRepoName&owner=backstage`.\n *\n * @public\n */\nexport const RepoUrlPickerFieldExtension = scaffolderPlugin.provide(\n createScaffolderFieldExtension({\n component: RepoUrlPicker,\n name: 'RepoUrlPicker',\n validation: repoPickerValidation,\n }),\n);\n\n/**\n * A field extension for picking users and groups out of the Catalog.\n *\n * @public\n */\nexport const OwnerPickerFieldExtension = scaffolderPlugin.provide(\n createScaffolderFieldExtension({\n component: OwnerPicker,\n name: 'OwnerPicker',\n }),\n);\n\n/**\n * The Router and main entrypoint to the Scaffolder plugin.\n *\n * @public\n */\nexport const ScaffolderPage = scaffolderPlugin.provide(\n createRoutableExtension({\n name: 'ScaffolderPage',\n component: () => import('./components/Router').then(m => m.Router),\n mountPoint: rootRouteRef,\n }),\n);\n\n/**\n * A field extension to show all the Entities that are owned by the current logged-in User for use in templates.\n *\n * @public\n */\nexport const OwnedEntityPickerFieldExtension = scaffolderPlugin.provide(\n createScaffolderFieldExtension({\n component: OwnedEntityPicker,\n name: 'OwnedEntityPicker',\n }),\n);\n\n/**\n * EntityTagsPickerFieldExtension\n * @public\n */\nexport const EntityTagsPickerFieldExtension = scaffolderPlugin.provide(\n createScaffolderFieldExtension({\n component: EntityTagsPicker,\n name: 'EntityTagsPicker',\n }),\n);\n\n/**\n * @alpha\n * The Router and main entrypoint to the Alpha Scaffolder plugin.\n */\nexport const NextScaffolderPage = scaffolderPlugin.provide(\n createRoutableExtension({\n name: 'NextScaffolderPage',\n component: () => import('./next/Router').then(m => m.Router),\n mountPoint: rootRouteRef,\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 from 'react';\nimport capitalize from 'lodash/capitalize';\nimport { Progress } from '@backstage/core-components';\nimport {\n Box,\n Checkbox,\n FormControlLabel,\n TextField,\n Typography,\n} from '@material-ui/core';\nimport CheckBoxIcon from '@material-ui/icons/CheckBox';\nimport CheckBoxOutlineBlankIcon from '@material-ui/icons/CheckBoxOutlineBlank';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport { Autocomplete } from '@material-ui/lab';\nimport { useEntityTypeFilter } from '@backstage/plugin-catalog-react';\nimport { alertApiRef, useApi } from '@backstage/core-plugin-api';\n\nconst icon = <CheckBoxOutlineBlankIcon fontSize=\"small\" />;\nconst checkedIcon = <CheckBoxIcon fontSize=\"small\" />;\n\n/**\n * The component to select the `type` of `Template` that you will see in the table.\n *\n * @public\n */\nexport const TemplateTypePicker = () => {\n const alertApi = useApi(alertApiRef);\n const { error, loading, availableTypes, selectedTypes, setSelectedTypes } =\n useEntityTypeFilter();\n\n if (loading) return <Progress />;\n\n if (!availableTypes) return null;\n\n if (error) {\n alertApi.post({\n message: `Failed to load entity types`,\n severity: 'error',\n });\n return null;\n }\n\n return (\n <Box pb={1} pt={1}>\n <Typography variant=\"button\">Categories</Typography>\n <Autocomplete\n multiple\n aria-label=\"Categories\"\n options={availableTypes}\n value={selectedTypes}\n onChange={(_: object, value: string[]) => setSelectedTypes(value)}\n renderOption={(option, { selected }) => (\n <FormControlLabel\n control={\n <Checkbox\n icon={icon}\n checkedIcon={checkedIcon}\n checked={selected}\n />\n }\n label={capitalize(option)}\n />\n )}\n size=\"small\"\n popupIcon={<ExpandMoreIcon data-testid=\"categories-picker-expand\" />}\n renderInput={params => <TextField {...params} variant=\"outlined\" />}\n />\n </Box>\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 { useImmerReducer } from 'use-immer';\nimport { useEffect } from 'react';\nimport { scaffolderApiRef } from '../../api';\nimport {\n ScaffolderTask,\n ScaffolderTaskStatus,\n ScaffolderTaskOutput,\n LogEvent,\n} from '../../types';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { Subscription } from '@backstage/types';\n\ntype Step = {\n id: string;\n status: ScaffolderTaskStatus;\n endedAt?: string;\n startedAt?: string;\n};\n\nexport type TaskStream = {\n loading: boolean;\n error?: Error;\n stepLogs: { [stepId in string]: string[] };\n completed: boolean;\n task?: ScaffolderTask;\n steps: { [stepId in string]: Step };\n output?: ScaffolderTaskOutput;\n};\n\ntype ReducerLogEntry = {\n createdAt: string;\n body: {\n stepId?: string;\n status?: ScaffolderTaskStatus;\n message: string;\n output?: ScaffolderTaskOutput;\n };\n};\n\ntype ReducerAction =\n | { type: 'INIT'; data: ScaffolderTask }\n | { type: 'LOGS'; data: ReducerLogEntry[] }\n | { type: 'COMPLETED'; data: ReducerLogEntry }\n | { type: 'ERROR'; data: Error };\n\nfunction reducer(draft: TaskStream, action: ReducerAction) {\n switch (action.type) {\n case 'INIT': {\n draft.steps = action.data.spec.steps.reduce((current, next) => {\n current[next.id] = { status: 'open', id: next.id };\n return current;\n }, {} as { [stepId in string]: Step });\n draft.stepLogs = action.data.spec.steps.reduce((current, next) => {\n current[next.id] = [];\n return current;\n }, {} as { [stepId in string]: string[] });\n draft.loading = false;\n draft.error = undefined;\n draft.completed = false;\n draft.task = action.data;\n return;\n }\n\n case 'LOGS': {\n const entries = action.data;\n const logLines = [];\n\n for (const entry of entries) {\n const logLine = `${entry.createdAt} ${entry.body.message}`;\n logLines.push(logLine);\n\n if (!entry.body.stepId || !draft.steps?.[entry.body.stepId]) {\n continue;\n }\n\n const currentStepLog = draft.stepLogs?.[entry.body.stepId];\n const currentStep = draft.steps?.[entry.body.stepId];\n\n if (entry.body.status && entry.body.status !== currentStep.status) {\n currentStep.status = entry.body.status;\n\n if (currentStep.status === 'processing') {\n currentStep.startedAt = entry.createdAt;\n }\n\n if (\n ['cancelled', 'failed', 'completed'].includes(currentStep.status)\n ) {\n currentStep.endedAt = entry.createdAt;\n }\n }\n\n currentStepLog?.push(logLine);\n }\n\n return;\n }\n\n case 'COMPLETED': {\n draft.completed = true;\n draft.output = action.data.body.output;\n return;\n }\n\n case 'ERROR': {\n draft.error = action.data;\n draft.loading = false;\n draft.completed = true;\n return;\n }\n\n default:\n return;\n }\n}\n\nexport const useTaskEventStream = (taskId: string): TaskStream => {\n const scaffolderApi = useApi(scaffolderApiRef);\n const [state, dispatch] = useImmerReducer(reducer, {\n loading: true,\n completed: false,\n stepLogs: {} as { [stepId in string]: string[] },\n steps: {} as { [stepId in string]: Step },\n });\n\n useEffect(() => {\n let didCancel = false;\n let subscription: Subscription | undefined;\n let logPusher: NodeJS.Timeout | undefined;\n\n scaffolderApi.getTask(taskId).then(\n task => {\n if (didCancel) {\n return;\n }\n dispatch({ type: 'INIT', data: task });\n\n // TODO(blam): Use a normal fetch to fetch the current log for the event stream\n // and use that for an INIT_EVENTs dispatch event, and then\n // use the last event ID to subscribe using after option to\n // stream logs. Without this, if you have a lot of logs, it can look like the\n // task is being rebuilt on load as it progresses through the steps at a slower\n // rate whilst it builds the status from the event logs\n const observable = scaffolderApi.streamLogs({ taskId });\n\n const collectedLogEvents = new Array<LogEvent>();\n\n function emitLogs() {\n if (collectedLogEvents.length) {\n const logs = collectedLogEvents.splice(\n 0,\n collectedLogEvents.length,\n );\n dispatch({ type: 'LOGS', data: logs });\n }\n }\n\n logPusher = setInterval(emitLogs, 500);\n\n subscription = observable.subscribe({\n next: event => {\n switch (event.type) {\n case 'log':\n return collectedLogEvents.push(event);\n case 'completion':\n emitLogs();\n dispatch({ type: 'COMPLETED', data: event });\n return undefined;\n default:\n throw new Error(\n `Unhandled event type ${event.type} in observer`,\n );\n }\n },\n error: error => {\n emitLogs();\n dispatch({ type: 'ERROR', data: error });\n },\n });\n },\n error => {\n if (!didCancel) {\n dispatch({ type: 'ERROR', data: error });\n }\n },\n );\n\n return () => {\n didCancel = true;\n if (subscription) {\n subscription.unsubscribe();\n }\n if (logPusher) {\n clearInterval(logPusher);\n }\n };\n }, [scaffolderApi, dispatch, taskId]);\n\n return state;\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 React from 'react';\nimport { Grid, LinkProps, makeStyles, Typography } from '@material-ui/core';\nimport LanguageIcon from '@material-ui/icons/Language';\n\nimport { IconComponent } from '@backstage/core-plugin-api';\nimport { Link } from '@backstage/core-components';\n\nconst useStyles = makeStyles({\n svgIcon: {\n display: 'inline-block',\n '& svg': {\n display: 'inline-block',\n fontSize: 'inherit',\n verticalAlign: 'baseline',\n },\n },\n});\n\nexport const IconLink = (\n props: {\n href: string;\n text?: string;\n Icon?: IconComponent;\n } & LinkProps,\n) => {\n const { href, text, Icon, ...linkProps } = props;\n\n const classes = useStyles();\n\n return (\n <Grid container direction=\"row\" spacing={1}>\n <Grid item>\n <Typography component=\"div\" className={classes.svgIcon}>\n {Icon ? <Icon /> : <LanguageIcon />}\n </Typography>\n </Grid>\n <Grid item>\n <Link to={href} {...linkProps}>\n {text || href}\n </Link>\n </Grid>\n </Grid>\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 { parseEntityRef } from '@backstage/catalog-model';\nimport { entityRouteRef } from '@backstage/plugin-catalog-react';\nimport { Box } from '@material-ui/core';\nimport LanguageIcon from '@material-ui/icons/Language';\nimport React from 'react';\nimport { ScaffolderTaskOutput } from '../../types';\nimport { IconLink } from './IconLink';\nimport { IconComponent, useApp, useRouteRef } from '@backstage/core-plugin-api';\n\ntype TaskPageLinksProps = {\n output: ScaffolderTaskOutput;\n};\n\nexport const TaskPageLinks = ({ output }: TaskPageLinksProps) => {\n const { links = [] } = output;\n const app = useApp();\n const entityRoute = useRouteRef(entityRouteRef);\n\n const iconResolver = (key?: string): IconComponent =>\n key ? app.getSystemIcon(key) ?? LanguageIcon : LanguageIcon;\n\n return (\n <Box px={3} pb={3}>\n {links\n .filter(({ url, entityRef }) => url || entityRef)\n .map(({ url, entityRef, title, icon }) => {\n if (entityRef) {\n const entityName = parseEntityRef(entityRef, {\n defaultKind: '<unknown>',\n defaultNamespace: '<unknown>',\n });\n const target = entityRoute(entityName);\n return { title, icon, url: target };\n }\n return { title, icon, url: url! };\n })\n .map(({ url, title, icon }, i) => (\n <IconLink\n key={`output-link-${i}`}\n href={url}\n text={title ?? url}\n Icon={iconResolver(icon)}\n target=\"_blank\"\n />\n ))}\n </Box>\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 { parseEntityRef } from '@backstage/catalog-model';\nimport {\n Content,\n ErrorPage,\n Header,\n Page,\n LogViewer,\n Progress,\n} from '@backstage/core-components';\nimport { useRouteRef } from '@backstage/core-plugin-api';\nimport { BackstageTheme } from '@backstage/theme';\nimport {\n Button,\n CircularProgress,\n Paper,\n StepButton,\n StepIconProps,\n} from '@material-ui/core';\nimport Grid from '@material-ui/core/Grid';\nimport Step from '@material-ui/core/Step';\nimport StepLabel from '@material-ui/core/StepLabel';\nimport Stepper from '@material-ui/core/Stepper';\nimport { createStyles, makeStyles, Theme } from '@material-ui/core/styles';\nimport Typography from '@material-ui/core/Typography';\nimport Cancel from '@material-ui/icons/Cancel';\nimport Check from '@material-ui/icons/Check';\nimport FiberManualRecordIcon from '@material-ui/icons/FiberManualRecord';\nimport classNames from 'classnames';\nimport { DateTime, Interval } from 'luxon';\nimport qs from 'qs';\nimport React, { memo, useEffect, useMemo, useState } from 'react';\nimport { useNavigate, useParams } from 'react-router';\nimport useInterval from 'react-use/lib/useInterval';\nimport { rootRouteRef, selectedTemplateRouteRef } from '../../routes';\nimport { ScaffolderTaskStatus, ScaffolderTaskOutput } from '../../types';\nimport { useTaskEventStream } from '../hooks/useEventStream';\nimport { TaskPageLinks } from './TaskPageLinks';\n\n// typings are wrong for this library, so fallback to not parsing types.\nconst humanizeDuration = require('humanize-duration');\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n root: {\n width: '100%',\n },\n button: {\n marginBottom: theme.spacing(2),\n marginLeft: theme.spacing(2),\n },\n actionsContainer: {\n marginBottom: theme.spacing(2),\n },\n resetContainer: {\n padding: theme.spacing(3),\n },\n labelWrapper: {\n display: 'flex',\n flex: 1,\n flexDirection: 'row',\n justifyContent: 'space-between',\n },\n stepWrapper: {\n width: '100%',\n },\n }),\n);\n\ntype TaskStep = {\n id: string;\n name: string;\n status: ScaffolderTaskStatus;\n startedAt?: string;\n endedAt?: string;\n};\n\nconst StepTimeTicker = ({ step }: { step: TaskStep }) => {\n const [time, setTime] = useState('');\n\n useInterval(() => {\n if (!step.startedAt) {\n setTime('');\n return;\n }\n\n const end = step.endedAt\n ? DateTime.fromISO(step.endedAt)\n : DateTime.local();\n\n const startedAt = DateTime.fromISO(step.startedAt);\n const formatted = Interval.fromDateTimes(startedAt, end)\n .toDuration()\n .valueOf();\n\n setTime(humanizeDuration(formatted, { round: true }));\n }, 1000);\n\n return <Typography variant=\"caption\">{time}</Typography>;\n};\n\nconst useStepIconStyles = makeStyles((theme: BackstageTheme) =>\n createStyles({\n root: {\n color: theme.palette.text.disabled,\n display: 'flex',\n height: 22,\n alignItems: 'center',\n },\n completed: {\n color: theme.palette.status.ok,\n },\n error: {\n color: theme.palette.status.error,\n },\n }),\n);\n\nfunction TaskStepIconComponent(props: StepIconProps) {\n const classes = useStepIconStyles();\n const { active, completed, error } = props;\n\n const getMiddle = () => {\n if (active) {\n return <CircularProgress size=\"24px\" />;\n }\n if (completed) {\n return <Check />;\n }\n if (error) {\n return <Cancel />;\n }\n return <FiberManualRecordIcon />;\n };\n\n return (\n <div\n className={classNames(classes.root, {\n [classes.completed]: completed,\n [classes.error]: error,\n })}\n >\n {getMiddle()}\n </div>\n );\n}\n\nexport const TaskStatusStepper = memo(\n (props: {\n steps: TaskStep[];\n currentStepId: string | undefined;\n onUserStepChange: (id: string) => void;\n classes?: {\n root?: string;\n };\n }) => {\n const { steps, currentStepId, onUserStepChange } = props;\n const classes = useStyles(props);\n\n return (\n <div className={classes.root}>\n <Stepper\n activeStep={steps.findIndex(s => s.id === currentStepId)}\n orientation=\"vertical\"\n nonLinear\n >\n {steps.map((step, index) => {\n const isCompleted = step.status === 'completed';\n const isFailed = step.status === 'failed';\n const isActive = step.status === 'processing';\n const isSkipped = step.status === 'skipped';\n\n return (\n <Step key={String(index)} expanded>\n <StepButton onClick={() => onUserStepChange(step.id)}>\n <StepLabel\n StepIconProps={{\n completed: isCompleted,\n error: isFailed,\n active: isActive,\n }}\n StepIconComponent={TaskStepIconComponent}\n className={classes.stepWrapper}\n >\n <div className={classes.labelWrapper}>\n <Typography variant=\"subtitle2\">{step.name}</Typography>\n {isSkipped ? (\n <Typography variant=\"caption\">Skipped</Typography>\n ) : (\n <StepTimeTicker step={step} />\n )}\n </div>\n </StepLabel>\n </StepButton>\n </Step>\n );\n })}\n </Stepper>\n </div>\n );\n },\n);\n\nconst hasLinks = ({ links = [] }: ScaffolderTaskOutput): boolean =>\n links.length > 0;\n\n/**\n * TaskPageProps for constructing a TaskPage\n * @param loadingText - Optional loading text shown before a task begins executing.\n *\n * @public\n */\nexport type TaskPageProps = {\n loadingText?: string;\n};\n\n/**\n * TaskPage for showing the status of the taskId provided as a param\n * @param loadingText - Optional loading text shown before a task begins executing.\n *\n * @public\n */\nexport const TaskPage = ({ loadingText }: TaskPageProps) => {\n const classes = useStyles();\n const navigate = useNavigate();\n const rootPath = useRouteRef(rootRouteRef);\n const templateRoute = useRouteRef(selectedTemplateRouteRef);\n const [userSelectedStepId, setUserSelectedStepId] = useState<\n string | undefined\n >(undefined);\n const [lastActiveStepId, setLastActiveStepId] = useState<string | undefined>(\n undefined,\n );\n const { taskId } = useParams();\n const taskStream = useTaskEventStream(taskId);\n const completed = taskStream.completed;\n const steps = useMemo(\n () =>\n taskStream.task?.spec.steps.map(step => ({\n ...step,\n ...taskStream?.steps?.[step.id],\n })) ?? [],\n [taskStream],\n );\n\n useEffect(() => {\n const mostRecentFailedOrActiveStep = steps.find(step =>\n ['failed', 'processing'].includes(step.status),\n );\n if (completed && !mostRecentFailedOrActiveStep) {\n setLastActiveStepId(steps[steps.length - 1]?.id);\n return;\n }\n\n setLastActiveStepId(mostRecentFailedOrActiveStep?.id);\n }, [steps, completed]);\n\n const currentStepId = userSelectedStepId ?? lastActiveStepId;\n\n const logAsString = useMemo(() => {\n if (!currentStepId) {\n return loadingText ? loadingText : 'Loading...';\n }\n const log = taskStream.stepLogs[currentStepId];\n\n if (!log?.length) {\n return 'Waiting for logs...';\n }\n return log.join('\\n');\n }, [taskStream.stepLogs, currentStepId, loadingText]);\n\n const taskNotFound =\n taskStream.completed === true &&\n taskStream.loading === false &&\n !taskStream.task;\n\n const { output } = taskStream;\n\n const handleStartOver = () => {\n if (!taskStream.task || !taskStream.task?.spec.templateInfo?.entityRef) {\n navigate(rootPath());\n return;\n }\n\n const formData = taskStream.task!.spec.parameters;\n\n const { name, namespace } = parseEntityRef(\n taskStream.task!.spec.templateInfo?.entityRef,\n );\n\n navigate(\n `${templateRoute({ templateName: name, namespace })}?${qs.stringify({\n formData: JSON.stringify(formData),\n })}`,\n );\n };\n\n return (\n <Page themeId=\"home\">\n <Header\n pageTitleOverride={`Task ${taskId}`}\n title=\"Task Activity\"\n subtitle={`Activity for task: ${taskId}`}\n />\n <Content>\n {taskNotFound ? (\n <ErrorPage\n status=\"404\"\n statusMessage=\"Task not found\"\n additionalInfo=\"No task found with this ID\"\n />\n ) : (\n <div>\n <Grid container>\n <Grid item xs={3}>\n <Paper>\n <TaskStatusStepper\n steps={steps}\n currentStepId={currentStepId}\n onUserStepChange={setUserSelectedStepId}\n />\n {output && hasLinks(output) && (\n <TaskPageLinks output={output} />\n )}\n <Button\n className={classes.button}\n onClick={handleStartOver}\n disabled={!completed}\n variant=\"contained\"\n color=\"primary\"\n >\n Start Over\n </Button>\n </Paper>\n </Grid>\n <Grid item xs={9}>\n {!currentStepId && <Progress />}\n\n <div style={{ height: '80vh' }}>\n <LogViewer text={logAsString} />\n </div>\n </Grid>\n </Grid>\n </div>\n )}\n </Content>\n </Page>\n );\n};\n"],"names":["queryString","FormControl","Autocomplete","useStyles","makeStyles","Typography","Grid"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQY,MAAC,gBAAgB,GAAG,YAAY,CAAC;AAC7C,EAAE,EAAE,EAAE,2BAA2B;AACjC,CAAC,EAAE;AACI,MAAM,gBAAgB,CAAC;AAC9B,EAAE,WAAW,CAAC,OAAO,EAAE;AACvB,IAAI,IAAI,EAAE,EAAE,EAAE,CAAC;AACf,IAAI,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;AAC7C,IAAI,IAAI,CAAC,QAAQ,GAAG,CAAC,EAAE,GAAG,OAAO,CAAC,QAAQ,KAAK,IAAI,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;AACrE,IAAI,IAAI,CAAC,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAC;AACzD,IAAI,IAAI,CAAC,kBAAkB,GAAG,CAAC,EAAE,GAAG,OAAO,CAAC,kBAAkB,KAAK,IAAI,GAAG,EAAE,GAAG,KAAK,CAAC;AACrF,IAAI,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;AAC3C,GAAG;AACH,EAAE,MAAM,SAAS,CAAC,OAAO,EAAE;AAC3B,IAAI,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;AAC3B,MAAM,MAAM,IAAI,KAAK,CAAC,oKAAoK,CAAC,CAAC;AAC5L,KAAK;AACL,IAAI,MAAM,OAAO,GAAG,MAAM,I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