@backstage/plugin-scaffolder-react 1.1.0-next.2 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,34 @@
1
1
  # @backstage/plugin-scaffolder-react
2
2
 
3
+ ## 1.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - a07750745b: Added `DescriptionField` field override to the `next/scaffolder`
8
+ - a521379688: Migrating the `TemplateEditorPage` to work with the new components from `@backstage/plugin-scaffolder-react`
9
+ - 8c2966536b: Embed scaffolder workflow in other components
10
+ - 5555e17313: refactor `createAsyncValidators` to be recursive to ensure validators are called in nested schemas.
11
+
12
+ ### Patch Changes
13
+
14
+ - 04f717a8e1: `scaffolder/next`: bump `react-jsonschema-form` libraries to `v5-stable`
15
+ - b46f385eff: scaffolder/next: Implementing a simple `OngoingTask` page
16
+ - cbab8ac107: lock versions of `@rjsf/*-beta` packages
17
+ - 346d6b6630: Upgrade `@rjsf` version 5 dependencies to `beta.18`
18
+ - ccbf91051b: bump `@rjsf` `v5` dependencies to 5.1.0
19
+ - d2ddde2108: Add `ScaffolderLayouts` to `NextScaffolderPage`
20
+ - Updated dependencies
21
+ - @backstage/core-components@0.12.4
22
+ - @backstage/catalog-model@1.2.0
23
+ - @backstage/theme@0.2.17
24
+ - @backstage/core-plugin-api@1.4.0
25
+ - @backstage/plugin-catalog-react@1.3.0
26
+ - @backstage/catalog-client@1.3.1
27
+ - @backstage/errors@1.1.4
28
+ - @backstage/types@1.0.2
29
+ - @backstage/version-bridge@1.0.3
30
+ - @backstage/plugin-scaffolder-common@1.2.5
31
+
3
32
  ## 1.1.0-next.2
4
33
 
5
34
  ### Minor Changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-scaffolder-react",
3
- "version": "1.1.0-next.2",
3
+ "version": "1.1.0",
4
4
  "main": "../dist/index.esm.js",
5
5
  "types": "../dist/index.alpha.d.ts"
6
6
  }
@@ -2,13 +2,14 @@
2
2
 
3
3
  import { ApiHolder } from '@backstage/core-plugin-api';
4
4
  import { ApiRef } from '@backstage/core-plugin-api';
5
+ import { ComponentType } from 'react';
5
6
  import { Dispatch } from 'react';
6
7
  import { Extension } from '@backstage/core-plugin-api';
7
8
  import { FieldProps } from '@rjsf/core';
8
9
  import { FieldProps as FieldProps_2 } from '@rjsf/utils';
9
10
  import { FieldValidation } from '@rjsf/core';
10
11
  import { FieldValidation as FieldValidation_2 } from '@rjsf/utils';
11
- import type { FormProps as FormProps_2 } from '@rjsf/core-v5';
12
+ import { FormProps as FormProps_2 } from '@rjsf/core-v5';
12
13
  import { IconComponent } from '@backstage/core-plugin-api';
13
14
  import { JsonObject } from '@backstage/types';
14
15
  import { JSONSchema7 } from 'json-schema';
@@ -17,6 +18,7 @@ import { Observable } from '@backstage/types';
17
18
  import { PropsWithChildren } from 'react';
18
19
  import { default as React_2 } from 'react';
19
20
  import { ReactNode } from 'react';
21
+ import { RJSFSchema } from '@rjsf/utils';
20
22
  import { SetStateAction } from 'react';
21
23
  import { TaskSpec } from '@backstage/plugin-scaffolder-common';
22
24
  import { TaskStep } from '@backstage/plugin-scaffolder-common';
@@ -150,6 +152,9 @@ export declare type FieldExtensionOptions<TFieldReturnValue = unknown, TInputPro
150
152
  schema?: CustomFieldExtensionSchema;
151
153
  };
152
154
 
155
+ /** @alpha */
156
+ export declare const Form: ComponentType<FormProps_2<any, RJSFSchema, any>>;
157
+
153
158
  /**
154
159
  * Any `@rjsf/core` form properties that are publicly exposed to the `NextScaffolderpage`
155
160
  *
@@ -2,13 +2,14 @@
2
2
 
3
3
  import { ApiHolder } from '@backstage/core-plugin-api';
4
4
  import { ApiRef } from '@backstage/core-plugin-api';
5
+ import { ComponentType } from 'react';
5
6
  import { Dispatch } from 'react';
6
7
  import { Extension } from '@backstage/core-plugin-api';
7
8
  import { FieldProps } from '@rjsf/core';
8
9
  import { FieldProps as FieldProps_2 } from '@rjsf/utils';
9
10
  import { FieldValidation } from '@rjsf/core';
10
11
  import { FieldValidation as FieldValidation_2 } from '@rjsf/utils';
11
- import type { FormProps as FormProps_2 } from '@rjsf/core-v5';
12
+ import { FormProps as FormProps_2 } from '@rjsf/core-v5';
12
13
  import { IconComponent } from '@backstage/core-plugin-api';
13
14
  import { JsonObject } from '@backstage/types';
14
15
  import { JSONSchema7 } from 'json-schema';
@@ -17,6 +18,7 @@ import { Observable } from '@backstage/types';
17
18
  import { PropsWithChildren } from 'react';
18
19
  import { default as React_2 } from 'react';
19
20
  import { ReactNode } from 'react';
21
+ import { RJSFSchema } from '@rjsf/utils';
20
22
  import { SetStateAction } from 'react';
21
23
  import { TaskSpec } from '@backstage/plugin-scaffolder-common';
22
24
  import { TaskStep } from '@backstage/plugin-scaffolder-common';
@@ -124,6 +126,8 @@ export declare type FieldExtensionOptions<TFieldReturnValue = unknown, TInputPro
124
126
  schema?: CustomFieldExtensionSchema;
125
127
  };
126
128
 
129
+ /* Excluded from this release type: Form */
130
+
127
131
  /**
128
132
  * Any `@rjsf/core` form properties that are publicly exposed to the `NextScaffolderpage`
129
133
  *
package/dist/index.d.ts CHANGED
@@ -2,13 +2,14 @@
2
2
 
3
3
  import { ApiHolder } from '@backstage/core-plugin-api';
4
4
  import { ApiRef } from '@backstage/core-plugin-api';
5
+ import { ComponentType } from 'react';
5
6
  import { Dispatch } from 'react';
6
7
  import { Extension } from '@backstage/core-plugin-api';
7
8
  import { FieldProps } from '@rjsf/core';
8
9
  import { FieldProps as FieldProps_2 } from '@rjsf/utils';
9
10
  import { FieldValidation } from '@rjsf/core';
10
11
  import { FieldValidation as FieldValidation_2 } from '@rjsf/utils';
11
- import type { FormProps as FormProps_2 } from '@rjsf/core-v5';
12
+ import { FormProps as FormProps_2 } from '@rjsf/core-v5';
12
13
  import { IconComponent } from '@backstage/core-plugin-api';
13
14
  import { JsonObject } from '@backstage/types';
14
15
  import { JSONSchema7 } from 'json-schema';
@@ -17,6 +18,7 @@ import { Observable } from '@backstage/types';
17
18
  import { PropsWithChildren } from 'react';
18
19
  import { default as React_2 } from 'react';
19
20
  import { ReactNode } from 'react';
21
+ import { RJSFSchema } from '@rjsf/utils';
20
22
  import { SetStateAction } from 'react';
21
23
  import { TaskSpec } from '@backstage/plugin-scaffolder-common';
22
24
  import { TaskStep } from '@backstage/plugin-scaffolder-common';
@@ -124,6 +126,8 @@ export declare type FieldExtensionOptions<TFieldReturnValue = unknown, TInputPro
124
126
  schema?: CustomFieldExtensionSchema;
125
127
  };
126
128
 
129
+ /* Excluded from this release type: Form */
130
+
127
131
  /**
128
132
  * Any `@rjsf/core` form properties that are publicly exposed to the `NextScaffolderpage`
129
133
  *
package/dist/index.esm.js CHANGED
@@ -2,12 +2,12 @@ import { attachComponentData, createApiRef, useElementFilter, useApi, featureFla
2
2
  import { createVersionedContext, createVersionedValueMap, getOrCreateGlobalSingleton } from '@backstage/version-bridge';
3
3
  import React, { useState, useContext, useCallback, useMemo, useEffect } from 'react';
4
4
  import { makeStyles, Stepper as Stepper$1, Step, StepLabel, Button, useTheme, Card, CardContent, Grid, Box, Divider, Chip, CardActions, Typography, Paper } from '@material-ui/core';
5
- import { withTheme } from '@rjsf/core-v5';
6
5
  import { Draft07 } from 'json-schema-library';
7
- import { StructuredMetadataTable, ItemCardHeader, Link, MarkdownContent, UserIcon, Content, ItemCardGrid, ContentHeader, Progress, InfoCard } from '@backstage/core-components';
6
+ import { StructuredMetadataTable, MarkdownContent, ItemCardHeader, Link, UserIcon, Content, ItemCardGrid, ContentHeader, Progress, InfoCard } from '@backstage/core-components';
8
7
  import validator from '@rjsf/validator-ajv8';
9
8
  import qs from 'qs';
10
9
  import useAsync from 'react-use/lib/useAsync';
10
+ import { withTheme } from '@rjsf/core-v5';
11
11
  import { RELATION_OWNED_BY, stringifyEntityRef, parseEntityRef } from '@backstage/catalog-model';
12
12
  import { FavoriteEntity, getEntityRelations, EntityRefLinks, entityRouteRef } from '@backstage/plugin-catalog-react';
13
13
  import LanguageIcon from '@material-ui/icons/Language';
@@ -223,19 +223,28 @@ const createAsyncValidators = (rootSchema, validators, context) => {
223
223
  async function validate(formData, pathPrefix = "#", current = formData) {
224
224
  const parsedSchema = new Draft07(rootSchema);
225
225
  const formValidation = {};
226
+ const validateForm = async (validatorName, key, value) => {
227
+ const validator = validators[validatorName];
228
+ if (validator) {
229
+ const fieldValidation = createFieldValidation();
230
+ try {
231
+ await validator(value, fieldValidation, { ...context, formData });
232
+ } catch (ex) {
233
+ fieldValidation.addError(ex.message);
234
+ }
235
+ formValidation[key] = fieldValidation;
236
+ }
237
+ };
226
238
  for (const [key, value] of Object.entries(current)) {
227
239
  const path = `${pathPrefix}/${key}`;
228
240
  const definitionInSchema = parsedSchema.getSchema(path, formData);
229
241
  if (definitionInSchema && "ui:field" in definitionInSchema) {
230
- const validator = validators[definitionInSchema["ui:field"]];
231
- if (validator) {
232
- const fieldValidation = createFieldValidation();
233
- try {
234
- await validator(value, fieldValidation, { ...context, formData });
235
- } catch (ex) {
236
- fieldValidation.addError(ex.message);
237
- }
238
- formValidation[key] = fieldValidation;
242
+ if ("ui:field" in definitionInSchema) {
243
+ await validateForm(definitionInSchema["ui:field"], key, value);
244
+ }
245
+ } else if (definitionInSchema && definitionInSchema.items && "ui:field" in definitionInSchema.items) {
246
+ if ("ui:field" in definitionInSchema.items) {
247
+ await validateForm(definitionInSchema.items["ui:field"], key, value);
239
248
  }
240
249
  } else if (isObject(value)) {
241
250
  formValidation[key] = await validate(formData, path, value);
@@ -360,6 +369,15 @@ const useTransformSchemaToProps = (step, options = {}) => {
360
369
  };
361
370
  };
362
371
 
372
+ const DescriptionField = ({ description }) => description && /* @__PURE__ */ React.createElement(MarkdownContent, { content: description, linkTarget: "_blank" });
373
+
374
+ var FieldOverrides = /*#__PURE__*/Object.freeze({
375
+ __proto__: null,
376
+ DescriptionField: DescriptionField
377
+ });
378
+
379
+ const Form = withTheme(require("@rjsf/material-ui-v5").Theme);
380
+
363
381
  const useStyles$5 = makeStyles((theme) => ({
364
382
  backButton: {
365
383
  marginRight: theme.spacing(1)
@@ -373,7 +391,6 @@ const useStyles$5 = makeStyles((theme) => ({
373
391
  padding: theme.spacing(2)
374
392
  }
375
393
  }));
376
- const Form = withTheme(require("@rjsf/material-ui-v5").Theme);
377
394
  const Stepper = (stepperProps) => {
378
395
  var _a;
379
396
  const { layouts = [], components = {}, ...props } = stepperProps;
@@ -440,7 +457,7 @@ const Stepper = (stepperProps) => {
440
457
  schema: currentStep.schema,
441
458
  uiSchema: currentStep.uiSchema,
442
459
  onSubmit: handleNext,
443
- fields: extensions,
460
+ fields: { ...FieldOverrides, ...extensions },
444
461
  showErrorList: false,
445
462
  onChange: handleChange,
446
463
  ...(_a = props.FormProps) != null ? _a : {}
@@ -736,5 +753,5 @@ function createNextScaffolderFieldExtension(options) {
736
753
  };
737
754
  }
738
755
 
739
- export { DefaultTemplateOutputs, EmbeddableWorkflow, ReviewState, ScaffolderFieldExtensions, ScaffolderLayouts, SecretsContextProvider, Stepper, TemplateCard, TemplateGroup, Workflow, createFieldValidation, createNextScaffolderFieldExtension, createScaffolderFieldExtension, createScaffolderLayout, extractSchemaFromStep, scaffolderApiRef, useCustomFieldExtensions, useCustomLayouts, useFormDataFromQuery, useTemplateParameterSchema, useTemplateSchema, useTemplateSecrets };
756
+ export { DefaultTemplateOutputs, EmbeddableWorkflow, Form, ReviewState, ScaffolderFieldExtensions, ScaffolderLayouts, SecretsContextProvider, Stepper, TemplateCard, TemplateGroup, Workflow, createFieldValidation, createNextScaffolderFieldExtension, createScaffolderFieldExtension, createScaffolderLayout, extractSchemaFromStep, scaffolderApiRef, useCustomFieldExtensions, useCustomLayouts, useFormDataFromQuery, useTemplateParameterSchema, useTemplateSchema, useTemplateSecrets };
740
757
  //# sourceMappingURL=index.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":["../src/extensions/keys.ts","../src/extensions/index.tsx","../src/secrets/SecretsContext.tsx","../src/api/ref.ts","../src/hooks/useCustomFieldExtensions.ts","../src/layouts/keys.ts","../src/hooks/useCustomLayouts.ts","../src/layouts/createScaffolderLayout.ts","../src/next/lib/schema.ts","../src/next/components/Stepper/utils.ts","../src/next/components/Stepper/createAsyncValidators.ts","../src/next/components/ReviewState/ReviewState.tsx","../src/next/hooks/useTemplateSchema.ts","../src/next/hooks/useFormDataFromQuery.ts","../src/next/hooks/useTemplateParameterSchema.ts","../src/next/hooks/useTransformSchemaToProps.ts","../src/next/components/Stepper/Stepper.tsx","../src/next/components/TemplateCard/CardHeader.tsx","../src/next/components/TemplateCard/CardLink.tsx","../src/next/components/TemplateCard/TemplateCard.tsx","../src/next/components/TemplateGroup/TemplateGroup.tsx","../src/next/components/Workflow/Workflow.tsx","../src/next/components/TemplateOutputs/LinkOutputs.tsx","../src/next/components/TemplateOutputs/DefaultTemplateOutputs.tsx","../src/next/extensions/index.tsx"],"sourcesContent":["/*\n * Copyright 2023 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\nexport const FIELD_EXTENSION_WRAPPER_KEY = 'scaffolder.extensions.wrapper.v1';\n/**\n * The key used to store the field extension data for any `<FieldExtension />` component\n */\nexport const FIELD_EXTENSION_KEY = 'scaffolder.extensions.field.v1';\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 CustomFieldExtensionSchema,\n CustomFieldValidator,\n FieldExtensionOptions,\n FieldExtensionComponentProps,\n} from './types';\nimport { Extension, attachComponentData } from '@backstage/core-plugin-api';\nimport { FIELD_EXTENSION_KEY, FIELD_EXTENSION_WRAPPER_KEY } from './keys';\n\n/**\n * The type used to wrap up the Layout and embed the input props\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 React.PropsWithChildren<{}>\n> = (): JSX.Element | null => null;\n\nattachComponentData(\n ScaffolderFieldExtensions,\n FIELD_EXTENSION_WRAPPER_KEY,\n true,\n);\n\nexport type {\n CustomFieldExtensionSchema,\n CustomFieldValidator,\n FieldExtensionOptions,\n FieldExtensionComponentProps,\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 {\n createVersionedContext,\n createVersionedValueMap,\n} from '@backstage/version-bridge';\nimport React, {\n useState,\n useCallback,\n useContext,\n PropsWithChildren,\n} from 'react';\n\n/**\n * The contents of the `SecretsContext`\n */\ntype SecretsContextContents = {\n secrets: Record<string, string>;\n setSecrets: React.Dispatch<React.SetStateAction<Record<string, string>>>;\n};\n\n/**\n * The context to hold the Secrets.\n */\nconst SecretsContext = createVersionedContext<{\n 1: SecretsContextContents;\n}>('secrets-context');\n\n/**\n * The Context Provider that holds the state for the secrets.\n * @public\n */\nexport const SecretsContextProvider = ({ children }: PropsWithChildren<{}>) => {\n const [secrets, setSecrets] = useState<Record<string, string>>({});\n\n return (\n <SecretsContext.Provider\n value={createVersionedValueMap({ 1: { secrets, setSecrets } })}\n >\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 secrets: Record<string, string>;\n}\n\n/**\n * Hook to access the secrets context to be able to set secrets that are\n * passed to the Scaffolder backend.\n * @public\n */\nexport const useTemplateSecrets = (): ScaffolderUseTemplateSecrets => {\n const value = useContext(SecretsContext)?.atVersion(1);\n\n if (!value) {\n throw new Error(\n 'useTemplateSecrets must be used within a SecretsContextProvider',\n );\n }\n\n const { setSecrets: updateSecrets, secrets = {} } = value;\n\n const setSecrets = useCallback(\n (input: Record<string, string>) => {\n updateSecrets(currentSecrets => ({ ...currentSecrets, ...input }));\n },\n [updateSecrets],\n );\n\n return { setSecrets, secrets };\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 { createApiRef } from '@backstage/core-plugin-api';\nimport { ScaffolderApi } from './types';\nimport { getOrCreateGlobalSingleton } from '@backstage/version-bridge';\n\n/** @public */\nexport const scaffolderApiRef = getOrCreateGlobalSingleton(\n 'scaffolder:scaffolder-api-ref',\n () =>\n createApiRef<ScaffolderApi>({\n id: 'plugin.scaffolder.service',\n }),\n);\n","/*\n * Copyright 2023 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 { useElementFilter } from '@backstage/core-plugin-api';\nimport { FieldExtensionOptions } from '../extensions';\nimport {\n FIELD_EXTENSION_KEY,\n FIELD_EXTENSION_WRAPPER_KEY,\n} from '../extensions/keys';\n\n/**\n * Hook that returns all custom field extensions from the current outlet.\n * @public\n */\nexport const useCustomFieldExtensions = <\n TComponentDataType = FieldExtensionOptions,\n>(\n outlet: React.ReactNode,\n) => {\n return useElementFilter(outlet, elements =>\n elements\n .selectByComponentData({\n key: FIELD_EXTENSION_WRAPPER_KEY,\n })\n .findComponentData<TComponentDataType>({\n key: FIELD_EXTENSION_KEY,\n }),\n );\n};\n","/*\n * Copyright 2023 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 */\nexport const LAYOUTS_KEY = 'scaffolder.layout.v1';\nexport const LAYOUTS_WRAPPER_KEY = 'scaffolder.layouts.wrapper.v1';\n","/*\n * Copyright 2023 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 { useElementFilter } from '@backstage/core-plugin-api';\nimport { LAYOUTS_KEY, LAYOUTS_WRAPPER_KEY } from '../layouts/keys';\nimport { LayoutOptions } from '../layouts';\n\n/**\n * Hook that returns all custom field extensions from the current outlet.\n * @public\n */\nexport const useCustomLayouts = <TComponentDataType = LayoutOptions>(\n outlet: React.ReactNode,\n) => {\n return useElementFilter(outlet, elements =>\n elements\n .selectByComponentData({\n key: LAYOUTS_WRAPPER_KEY,\n })\n .findComponentData<TComponentDataType>({\n key: LAYOUTS_KEY,\n }),\n );\n};\n","/*\n * Copyright 2023 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 { LAYOUTS_KEY, LAYOUTS_WRAPPER_KEY } from './keys';\nimport { attachComponentData, Extension } from '@backstage/core-plugin-api';\nimport type { FormProps as SchemaFormProps } from '@rjsf/core-v5';\n\n/**\n * The field template from `@rjsf/core` which is a react component that gets passed `@rjsf/core` field related props.\n *\n * @public\n */\nexport type LayoutTemplate<T = any> = NonNullable<\n SchemaFormProps<T>['uiSchema']\n>['ui:ObjectFieldTemplate'];\n\n/**\n * The type of layouts that is passed to the TemplateForms\n *\n * @public\n */\nexport interface LayoutOptions<P = any> {\n name: string;\n component: LayoutTemplate<P>;\n}\n\n/**\n * A type used to wrap up the FieldExtension to embed the ReturnValue and the InputProps\n * @public\n */\nexport type LayoutComponent<_TInputProps> = () => null;\n\n/**\n * Method for creating custom Layouts that can be used in the scaffolder frontend form\n *\n * @public\n */\nexport function createScaffolderLayout<TInputProps = unknown>(\n options: LayoutOptions,\n): Extension<LayoutComponent<TInputProps>> {\n return {\n expose() {\n const LayoutDataHolder: any = () => null;\n\n attachComponentData(LayoutDataHolder, LAYOUTS_KEY, options);\n\n return LayoutDataHolder;\n },\n };\n}\n\n/**\n * The wrapping component for defining scaffolder layouts as children\n *\n * @public\n */\nexport const ScaffolderLayouts: React.ComponentType = (): JSX.Element | null =>\n null;\n\nattachComponentData(ScaffolderLayouts, LAYOUTS_WRAPPER_KEY, true);\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 { JsonObject } from '@backstage/types';\nimport { FieldValidation, UiSchema } from '@rjsf/utils';\n\nfunction isObject(value: unknown): value is JsonObject {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction extractUiSchema(schema: JsonObject, uiSchema: JsonObject) {\n if (!isObject(schema)) {\n return;\n }\n\n const { properties, items, anyOf, oneOf, allOf, dependencies } = schema;\n\n for (const propName in schema) {\n if (!schema.hasOwnProperty(propName)) {\n continue;\n }\n\n if (propName.startsWith('ui:')) {\n uiSchema[propName] = schema[propName];\n delete schema[propName];\n }\n }\n\n if (isObject(properties)) {\n for (const propName in properties) {\n if (!properties.hasOwnProperty(propName)) {\n continue;\n }\n\n const schemaNode = properties[propName];\n if (!isObject(schemaNode)) {\n continue;\n }\n const innerUiSchema = {};\n uiSchema[propName] = innerUiSchema;\n extractUiSchema(schemaNode, innerUiSchema);\n }\n }\n\n if (isObject(items)) {\n const innerUiSchema = {};\n uiSchema.items = innerUiSchema;\n extractUiSchema(items, innerUiSchema);\n }\n\n if (Array.isArray(anyOf)) {\n for (const schemaNode of anyOf) {\n if (!isObject(schemaNode)) {\n continue;\n }\n extractUiSchema(schemaNode, uiSchema);\n }\n }\n\n if (Array.isArray(oneOf)) {\n for (const schemaNode of oneOf) {\n if (!isObject(schemaNode)) {\n continue;\n }\n extractUiSchema(schemaNode, uiSchema);\n }\n }\n\n if (Array.isArray(allOf)) {\n for (const schemaNode of allOf) {\n if (!isObject(schemaNode)) {\n continue;\n }\n extractUiSchema(schemaNode, uiSchema);\n }\n }\n\n if (isObject(dependencies)) {\n for (const depName of Object.keys(dependencies)) {\n const schemaNode = dependencies[depName];\n if (!isObject(schemaNode)) {\n continue;\n }\n extractUiSchema(schemaNode, uiSchema);\n }\n }\n}\n\n/**\n * Takes a step from a Backstage Template Manifest and converts it to a JSON Schema and UI Schema for rjsf\n * @alpha\n */\nexport const extractSchemaFromStep = (\n inputStep: JsonObject,\n): { uiSchema: UiSchema; schema: JsonObject } => {\n const uiSchema: UiSchema = {};\n const returnSchema: JsonObject = JSON.parse(JSON.stringify(inputStep));\n extractUiSchema(returnSchema, uiSchema);\n return { uiSchema, schema: returnSchema };\n};\n\n/**\n * Creates a field validation object for use in react jsonschema form\n * @alpha\n */\nexport const createFieldValidation = (): FieldValidation => {\n const fieldValidation: FieldValidation = {\n __errors: [] as string[],\n addError: (message: string) => {\n fieldValidation.__errors?.push(message);\n },\n };\n\n return fieldValidation;\n};\n","/*\n * Copyright 2023 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 type { JsonObject, JsonValue } from '@backstage/types';\nimport type { FieldValidation } from '@rjsf/utils';\nimport { FormValidation } from './createAsyncValidators';\n\nfunction isFieldValidation(error: any): error is FieldValidation {\n return !!error && '__errors' in error;\n}\n\nexport function hasErrors(errors?: FormValidation): boolean {\n if (!errors) {\n return false;\n }\n\n for (const error of Object.values(errors)) {\n if (isFieldValidation(error)) {\n if ((error.__errors ?? []).length > 0) {\n return true;\n }\n\n continue;\n }\n\n return hasErrors(error);\n }\n\n return false;\n}\n\nexport function isObject(value: JsonValue | undefined): value is JsonObject {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\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 { FieldValidation } from '@rjsf/utils';\nimport type { JsonObject } from '@backstage/types';\nimport { ApiHolder } from '@backstage/core-plugin-api';\nimport { Draft07 as JSONSchema } from 'json-schema-library';\nimport { createFieldValidation } from '../../lib';\nimport { NextCustomFieldValidator } from '../../extensions';\nimport { isObject } from './utils';\n\n/**\n * @internal\n */\nexport type FormValidation = {\n [name: string]: FieldValidation | FormValidation;\n};\n\nexport const createAsyncValidators = (\n rootSchema: JsonObject,\n validators: Record<string, undefined | NextCustomFieldValidator<unknown>>,\n context: {\n apiHolder: ApiHolder;\n },\n) => {\n async function validate(\n formData: JsonObject,\n pathPrefix: string = '#',\n current: JsonObject = formData,\n ): Promise<FormValidation> {\n const parsedSchema = new JSONSchema(rootSchema);\n const formValidation: FormValidation = {};\n\n for (const [key, value] of Object.entries(current)) {\n const path = `${pathPrefix}/${key}`;\n const definitionInSchema = parsedSchema.getSchema(path, formData);\n\n if (definitionInSchema && 'ui:field' in definitionInSchema) {\n const validator = validators[definitionInSchema['ui:field']];\n if (validator) {\n const fieldValidation = createFieldValidation();\n try {\n await validator(value, fieldValidation, { ...context, formData });\n } catch (ex) {\n fieldValidation.addError(ex.message);\n }\n formValidation[key] = fieldValidation;\n }\n } else if (isObject(value)) {\n formValidation[key] = await validate(formData, path, value);\n }\n }\n\n return formValidation;\n }\n\n return async (formData: JsonObject) => {\n return await validate(formData);\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 { StructuredMetadataTable } from '@backstage/core-components';\nimport { JsonObject } from '@backstage/types';\nimport { Draft07 as JSONSchema } from 'json-schema-library';\nimport { ParsedTemplateSchema } from '../../hooks/useTemplateSchema';\n\n/**\n * The props for the {@link ReviewState} component.\n * @alpha\n */\nexport type ReviewStateProps = {\n schemas: ParsedTemplateSchema[];\n formState: JsonObject;\n};\n\n/**\n * The component used by the {@link Stepper} to render the review step.\n * @alpha\n */\nexport const ReviewState = (props: ReviewStateProps) => {\n const reviewData = Object.fromEntries(\n Object.entries(props.formState).map(([key, value]) => {\n for (const step of props.schemas) {\n const parsedSchema = new JSONSchema(step.mergedSchema);\n const definitionInSchema = parsedSchema.getSchema(\n `#/${key}`,\n props.formState,\n );\n if (definitionInSchema) {\n const backstageReviewOptions =\n definitionInSchema['ui:backstage']?.review;\n\n if (backstageReviewOptions) {\n if (backstageReviewOptions.mask) {\n return [key, backstageReviewOptions.mask];\n }\n if (backstageReviewOptions.show === false) {\n return [];\n }\n }\n\n if (definitionInSchema['ui:widget'] === 'password') {\n return [key, '******'];\n }\n }\n }\n return [key, value];\n }),\n );\n return <StructuredMetadataTable metadata={reviewData} />;\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 { featureFlagsApiRef, useApi } from '@backstage/core-plugin-api';\nimport { JsonObject } from '@backstage/types';\nimport { UiSchema } from '@rjsf/utils';\nimport { TemplateParameterSchema } from '../../types';\nimport { extractSchemaFromStep } from '../lib';\n\n/**\n * This is the parsed template schema that is returned from the {@link useTemplateSchema} hook.\n * @alpha\n */\nexport interface ParsedTemplateSchema {\n uiSchema: UiSchema;\n mergedSchema: JsonObject;\n schema: JsonObject;\n title: string;\n description?: string;\n}\n\n/**\n * This hook will parse the template schema and return the steps with the\n * parsed schema and uiSchema. Filtering out any steps or properties that\n * are not enabled with feature flags.\n * @alpha\n */\nexport const useTemplateSchema = (\n manifest: TemplateParameterSchema,\n): { steps: ParsedTemplateSchema[] } => {\n const featureFlags = useApi(featureFlagsApiRef);\n const steps = manifest.steps.map(({ title, description, schema }) => ({\n title,\n description,\n mergedSchema: schema,\n ...extractSchemaFromStep(schema),\n }));\n\n const returningSteps = steps\n // Filter out steps that are not enabled with the feature flags\n .filter(step => {\n const stepFeatureFlag = step.uiSchema['ui:backstage']?.featureFlag;\n return stepFeatureFlag ? featureFlags.isActive(stepFeatureFlag) : true;\n })\n // Then filter out the properties that are not enabled with feature flag\n .map(step => ({\n ...step,\n schema: {\n ...step.schema,\n // Title is rendered at the top of the page, so let's ignore this from jsonschemaform\n title: undefined,\n properties: Object.fromEntries(\n Object.entries(step.schema.properties as JsonObject).filter(\n ([key]) => {\n const stepFeatureFlag =\n step.uiSchema[key]?.['ui:backstage']?.featureFlag;\n return stepFeatureFlag\n ? featureFlags.isActive(stepFeatureFlag)\n : true;\n },\n ),\n ),\n },\n }));\n\n return {\n steps: returningSteps,\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 { JsonValue } from '@backstage/types';\nimport qs from 'qs';\nimport { useState } from 'react';\n\n/**\n * This hook is used to get the formData from the query string.\n * @alpha\n */\nexport const useFormDataFromQuery = (\n initialState?: Record<string, JsonValue>,\n) => {\n return useState<Record<string, any>>(() => {\n if (initialState) {\n return initialState;\n }\n\n const query = qs.parse(window.location.search, {\n ignoreQueryPrefix: true,\n });\n\n try {\n return JSON.parse(query.formData as string);\n } catch (e) {\n return {};\n }\n });\n};\n","import { useApi } from '@backstage/core-plugin-api';\n\n/*\n * Copyright 2023 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 useAsync from 'react-use/lib/useAsync';\nimport { scaffolderApiRef } from '../../api/ref';\n\n/**\n * @alpha\n */\nexport const useTemplateParameterSchema = (templateRef: string) => {\n const scaffolderApi = useApi(scaffolderApiRef);\n const { value, loading, error } = useAsync(\n () => scaffolderApi.getTemplateParameterSchema(templateRef),\n [scaffolderApi, templateRef],\n );\n\n return { manifest: value, loading, error };\n};\n","/*\n * Copyright 2023 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 { type ParsedTemplateSchema } from './useTemplateSchema';\nimport { type LayoutOptions } from '../../layouts';\n\ninterface Options {\n layouts?: LayoutOptions[];\n}\n\nexport const useTransformSchemaToProps = (\n step: ParsedTemplateSchema,\n options: Options = {},\n): ParsedTemplateSchema => {\n const { layouts = [] } = options;\n const objectFieldTemplate = step?.uiSchema['ui:ObjectFieldTemplate'] as\n | string\n | undefined;\n\n if (typeof objectFieldTemplate !== 'string') {\n return step;\n }\n\n const Layout = layouts.find(\n layout => layout.name === objectFieldTemplate,\n )?.component;\n\n if (!Layout) {\n return step;\n }\n\n return {\n ...step,\n uiSchema: {\n ...step.uiSchema,\n ['ui:ObjectFieldTemplate']: Layout,\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 { useAnalytics, useApiHolder } from '@backstage/core-plugin-api';\nimport { JsonValue } from '@backstage/types';\nimport {\n Stepper as MuiStepper,\n Step as MuiStep,\n StepLabel as MuiStepLabel,\n Button,\n makeStyles,\n} from '@material-ui/core';\nimport { type IChangeEvent, withTheme } from '@rjsf/core-v5';\nimport { ErrorSchema } from '@rjsf/utils';\nimport React, { useCallback, useMemo, useState, type ReactNode } from 'react';\nimport { NextFieldExtensionOptions } from '../../extensions';\nimport { TemplateParameterSchema } from '../../../types';\nimport {\n createAsyncValidators,\n type FormValidation,\n} from './createAsyncValidators';\nimport { ReviewState, type ReviewStateProps } from '../ReviewState';\nimport { useTemplateSchema } from '../../hooks/useTemplateSchema';\nimport validator from '@rjsf/validator-ajv8';\nimport { useFormDataFromQuery } from '../../hooks';\nimport { FormProps } from '../../types';\nimport { LayoutOptions } from '../../../layouts';\nimport { useTransformSchemaToProps } from '../../hooks/useTransformSchemaToProps';\nimport { hasErrors } from './utils';\n\nconst useStyles = makeStyles(theme => ({\n backButton: {\n marginRight: theme.spacing(1),\n },\n\n footer: {\n display: 'flex',\n flexDirection: 'row',\n justifyContent: 'right',\n },\n formWrapper: {\n padding: theme.spacing(2),\n },\n}));\n\n/**\n * The Props for {@link Stepper} component\n * @alpha\n */\nexport type StepperProps = {\n manifest: TemplateParameterSchema;\n extensions: NextFieldExtensionOptions<any, any>[];\n templateName?: string;\n FormProps?: FormProps;\n initialState?: Record<string, JsonValue>;\n onCreate: (values: Record<string, JsonValue>) => Promise<void>;\n components?: {\n ReviewStateComponent?: (props: ReviewStateProps) => JSX.Element;\n createButtonText?: ReactNode;\n reviewButtonText?: ReactNode;\n };\n layouts?: LayoutOptions[];\n};\n\n// TODO(blam): We require here, as the types in this package depend on @rjsf/core explicitly\n// which is what we're using here as the default types, it needs to depend on @rjsf/core-v5 because\n// of the re-writing we're doing. Once we've migrated, we can import this the exact same as before.\nconst Form = withTheme(require('@rjsf/material-ui-v5').Theme);\n\n/**\n * The `Stepper` component is the Wizard that is rendered when a user selects a template\n * @alpha\n */\nexport const Stepper = (stepperProps: StepperProps) => {\n const { layouts = [], components = {}, ...props } = stepperProps;\n const {\n ReviewStateComponent = ReviewState,\n createButtonText = 'Create',\n reviewButtonText = 'Review',\n } = components;\n const analytics = useAnalytics();\n const { steps } = useTemplateSchema(props.manifest);\n const apiHolder = useApiHolder();\n const [activeStep, setActiveStep] = useState(0);\n const [formState, setFormState] = useFormDataFromQuery(props.initialState);\n\n const [errors, setErrors] = useState<undefined | FormValidation>();\n const styles = useStyles();\n\n const extensions = useMemo(() => {\n return Object.fromEntries(\n props.extensions.map(({ name, component }) => [name, component]),\n );\n }, [props.extensions]);\n\n const validators = useMemo(() => {\n return Object.fromEntries(\n props.extensions.map(({ name, validation }) => [name, validation]),\n );\n }, [props.extensions]);\n\n const validation = useMemo(() => {\n return createAsyncValidators(steps[activeStep]?.mergedSchema, validators, {\n apiHolder,\n });\n }, [steps, activeStep, validators, apiHolder]);\n\n const handleBack = () => {\n setActiveStep(prevActiveStep => prevActiveStep - 1);\n };\n\n const handleChange = useCallback(\n (e: IChangeEvent) =>\n setFormState(current => ({ ...current, ...e.formData })),\n [setFormState],\n );\n\n const currentStep = useTransformSchemaToProps(steps[activeStep], { layouts });\n\n const handleNext = async ({\n formData = {},\n }: {\n formData?: Record<string, JsonValue>;\n }) => {\n // TODO(blam): What do we do about loading states, does each field extension get a chance\n // to display it's own loading? Or should we grey out the entire form.\n setErrors(undefined);\n\n const returnedValidation = await validation(formData);\n\n if (hasErrors(returnedValidation)) {\n setErrors(returnedValidation);\n } else {\n setErrors(undefined);\n setActiveStep(prevActiveStep => {\n const stepNum = prevActiveStep + 1;\n analytics.captureEvent('click', `Next Step (${stepNum})`);\n return stepNum;\n });\n }\n setFormState(current => ({ ...current, ...formData }));\n };\n\n return (\n <>\n <MuiStepper activeStep={activeStep} alternativeLabel variant=\"elevation\">\n {steps.map((step, index) => (\n <MuiStep key={index}>\n <MuiStepLabel>{step.title}</MuiStepLabel>\n </MuiStep>\n ))}\n <MuiStep>\n <MuiStepLabel>Review</MuiStepLabel>\n </MuiStep>\n </MuiStepper>\n <div className={styles.formWrapper}>\n {activeStep < steps.length ? (\n <Form\n validator={validator}\n extraErrors={errors as unknown as ErrorSchema}\n formData={formState}\n formContext={{ formData: formState }}\n schema={currentStep.schema}\n uiSchema={currentStep.uiSchema}\n onSubmit={handleNext}\n fields={extensions}\n showErrorList={false}\n onChange={handleChange}\n {...(props.FormProps ?? {})}\n >\n <div className={styles.footer}>\n <Button\n onClick={handleBack}\n className={styles.backButton}\n disabled={activeStep < 1}\n >\n Back\n </Button>\n <Button variant=\"contained\" color=\"primary\" type=\"submit\">\n {activeStep === steps.length - 1 ? reviewButtonText : 'Next'}\n </Button>\n </div>\n </Form>\n ) : (\n <>\n <ReviewStateComponent formState={formState} schemas={steps} />\n <div className={styles.footer}>\n <Button\n onClick={handleBack}\n className={styles.backButton}\n disabled={activeStep < 1}\n >\n Back\n </Button>\n <Button\n variant=\"contained\"\n onClick={() => {\n props.onCreate(formState);\n const name =\n typeof formState.name === 'string'\n ? formState.name\n : undefined;\n analytics.captureEvent(\n 'create',\n name ?? props.templateName ?? 'unknown',\n );\n }}\n >\n {createButtonText}\n </Button>\n </div>\n </>\n )}\n </div>\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 { makeStyles, useTheme } from '@material-ui/core';\nimport { ItemCardHeader } from '@backstage/core-components';\nimport { BackstageTheme } from '@backstage/theme';\nimport { TemplateEntityV1beta3 } from '@backstage/plugin-scaffolder-common';\nimport { FavoriteEntity } from '@backstage/plugin-catalog-react';\n\nconst useStyles = makeStyles<BackstageTheme, { cardBackgroundImage: string }>(\n () => ({\n header: {\n backgroundImage: ({ cardBackgroundImage }) => cardBackgroundImage,\n },\n subtitleWrapper: {\n display: 'flex',\n justifyContent: 'space-between',\n },\n }),\n);\n\n/**\n * Props for the CardHeader component\n */\nexport interface CardHeaderProps {\n template: TemplateEntityV1beta3;\n}\n\n/**\n * The Card Header with the background for the TemplateCard.\n */\nexport const CardHeader = (props: CardHeaderProps) => {\n const {\n template: {\n metadata: { title, name },\n spec: { type },\n },\n } = props;\n const { getPageTheme } = useTheme<BackstageTheme>();\n const themeForType = getPageTheme({ themeId: type });\n\n const styles = useStyles({\n cardBackgroundImage: themeForType.backgroundImage,\n });\n\n const SubtitleComponent = (\n <div className={styles.subtitleWrapper}>\n <div>{type}</div>\n <div>\n <FavoriteEntity entity={props.template} style={{ padding: 0 }} />\n </div>\n </div>\n );\n\n return (\n <ItemCardHeader\n title={title ?? name}\n subtitle={SubtitleComponent}\n classes={{ root: styles.header }}\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 { IconComponent } from '@backstage/core-plugin-api';\nimport { BackstageTheme } from '@backstage/theme';\nimport { Link } from '@backstage/core-components';\nimport { makeStyles } from '@material-ui/core';\nimport React from 'react';\n\ninterface CardLinkProps {\n icon: IconComponent;\n text: string;\n url: string;\n}\n\nconst useStyles = makeStyles<BackstageTheme>(() => ({\n linkText: {\n display: 'inline-flex',\n alignItems: 'center',\n },\n}));\n\nexport const CardLink = ({ icon: Icon, text, url }: CardLinkProps) => {\n const styles = useStyles();\n\n return (\n <div className={styles.linkText}>\n <Icon fontSize=\"small\" />\n <Link style={{ marginLeft: '8px' }} to={url}>\n {text || url}\n </Link>\n </div>\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 { RELATION_OWNED_BY } from '@backstage/catalog-model';\nimport { MarkdownContent, UserIcon } from '@backstage/core-components';\nimport { IconComponent, useApp } from '@backstage/core-plugin-api';\nimport {\n EntityRefLinks,\n getEntityRelations,\n} from '@backstage/plugin-catalog-react';\nimport { TemplateEntityV1beta3 } from '@backstage/plugin-scaffolder-common';\nimport { BackstageTheme } from '@backstage/theme';\nimport {\n Box,\n Card,\n CardActions,\n CardContent,\n Chip,\n Divider,\n Button,\n Grid,\n makeStyles,\n} from '@material-ui/core';\nimport LanguageIcon from '@material-ui/icons/Language';\nimport React from 'react';\nimport { CardHeader } from './CardHeader';\nimport { CardLink } from './CardLink';\n\nconst useStyles = makeStyles<BackstageTheme>(theme => ({\n box: {\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n display: '-webkit-box',\n '-webkit-line-clamp': 10,\n '-webkit-box-orient': 'vertical',\n },\n markdown: {\n /** to make the styles for React Markdown not leak into the description */\n '& :first-child': {\n margin: 0,\n },\n },\n label: {\n color: theme.palette.text.secondary,\n textTransform: 'uppercase',\n fontWeight: 'bold',\n letterSpacing: 0.5,\n lineHeight: 1,\n fontSize: '0.75rem',\n },\n footer: {\n display: 'flex',\n justifyContent: 'space-between',\n flex: 1,\n alignItems: 'center',\n },\n ownedBy: {\n display: 'flex',\n alignItems: 'center',\n flex: 1,\n color: theme.palette.link,\n },\n}));\n\n/**\n * The Props for the {@link TemplateCard} component\n * @alpha\n */\nexport interface TemplateCardProps {\n template: TemplateEntityV1beta3;\n additionalLinks?: {\n icon: IconComponent;\n text: string;\n url: string;\n }[];\n\n onSelected?: (template: TemplateEntityV1beta3) => void;\n}\n\n/**\n * The `TemplateCard` component that is rendered in a list for each template\n * @alpha\n */\nexport const TemplateCard = (props: TemplateCardProps) => {\n const { template } = props;\n const styles = useStyles();\n const ownedByRelations = getEntityRelations(template, RELATION_OWNED_BY);\n const app = useApp();\n const iconResolver = (key?: string): IconComponent =>\n key ? app.getSystemIcon(key) ?? LanguageIcon : LanguageIcon;\n\n return (\n <Card>\n <CardHeader template={template} />\n <CardContent>\n <Grid container spacing={2}>\n <Grid item xs={12}>\n <Box className={styles.box}>\n <MarkdownContent\n className={styles.markdown}\n content={template.metadata.description ?? 'No description'}\n />\n </Box>\n </Grid>\n {(template.metadata.tags?.length ?? 0) > 0 && (\n <>\n <Grid item xs={12}>\n <Divider />\n </Grid>\n <Grid item xs={12}>\n <Grid container spacing={2}>\n {template.metadata.tags?.map(tag => (\n <Grid item>\n <Chip\n style={{ margin: 0 }}\n size=\"small\"\n label={tag}\n key={tag}\n />\n </Grid>\n ))}\n </Grid>\n </Grid>\n </>\n )}\n {(props.additionalLinks || template.metadata.links?.length) && (\n <>\n <Grid item xs={12}>\n <Divider />\n </Grid>\n <Grid item xs={12}>\n <Grid container spacing={2}>\n {props.additionalLinks?.map(({ icon, text, url }) => (\n <Grid className={styles.linkText} item xs={6}>\n <CardLink icon={icon} text={text} url={url} />\n </Grid>\n ))}\n {template.metadata.links?.map(({ url, icon, title }) => (\n <Grid className={styles.linkText} item xs={6}>\n <CardLink\n icon={iconResolver(icon)}\n text={title || url}\n url={url}\n />\n </Grid>\n ))}\n </Grid>\n </Grid>\n </>\n )}\n </Grid>\n </CardContent>\n <CardActions style={{ padding: '16px' }}>\n <div className={styles.footer}>\n <div className={styles.ownedBy}>\n {ownedByRelations.length > 0 && (\n <>\n <UserIcon fontSize=\"small\" />\n <EntityRefLinks\n style={{ marginLeft: '8px' }}\n entityRefs={ownedByRelations}\n defaultKind=\"Group\"\n />\n </>\n )}\n </div>\n <Button\n size=\"small\"\n variant=\"outlined\"\n color=\"primary\"\n onClick={() => props.onSelected?.(template)}\n >\n Choose\n </Button>\n </div>\n </CardActions>\n </Card>\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 { TemplateEntityV1beta3 } from '@backstage/plugin-scaffolder-common';\nimport React from 'react';\nimport {\n Content,\n ContentHeader,\n ItemCardGrid,\n Link,\n} from '@backstage/core-components';\nimport { Typography } from '@material-ui/core';\nimport { stringifyEntityRef } from '@backstage/catalog-model';\nimport { TemplateCardProps, TemplateCard } from '../TemplateCard';\nimport { IconComponent } from '@backstage/core-plugin-api';\n\n/**\n * The props for the {@link TemplateGroup} component.\n * @alpha\n */\nexport interface TemplateGroupProps {\n templates: {\n template: TemplateEntityV1beta3;\n additionalLinks?: {\n icon: IconComponent;\n text: string;\n url: string;\n }[];\n }[];\n onSelected: (template: TemplateEntityV1beta3) => void;\n title: React.ReactNode;\n components?: {\n CardComponent?: React.ComponentType<TemplateCardProps>;\n };\n}\n\n/**\n * The `TemplateGroup` component is used to display a group of templates with a title.\n * @alpha\n */\nexport const TemplateGroup = (props: TemplateGroupProps) => {\n const {\n templates,\n title,\n components: { CardComponent } = {},\n onSelected,\n } = props;\n const titleComponent =\n typeof title === 'string' ? <ContentHeader title={title} /> : title;\n\n if (templates.length === 0) {\n return (\n <Content>\n {titleComponent}\n <Typography variant=\"body2\">\n No templates found that match your filter. Learn more about{' '}\n <Link to=\"https://backstage.io/docs/features/software-templates/adding-templates\">\n adding templates\n </Link>\n .\n </Typography>\n </Content>\n );\n }\n\n const Card = CardComponent || TemplateCard;\n\n return (\n <Content>\n {titleComponent}\n <ItemCardGrid>\n {templates.map(({ template, additionalLinks }) => (\n <Card\n key={stringifyEntityRef(template)}\n additionalLinks={additionalLinks}\n template={template}\n onSelected={onSelected}\n />\n ))}\n </ItemCardGrid>\n </Content>\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, { useEffect } from 'react';\nimport {\n Content,\n InfoCard,\n MarkdownContent,\n Progress,\n} from '@backstage/core-components';\nimport { stringifyEntityRef } from '@backstage/catalog-model';\nimport { makeStyles } from '@material-ui/core';\nimport { BackstageTheme } from '@backstage/theme';\nimport { errorApiRef, useApi } from '@backstage/core-plugin-api';\nimport { useTemplateParameterSchema } from '../../hooks/useTemplateParameterSchema';\nimport { Stepper, type StepperProps } from '../Stepper/Stepper';\nimport { SecretsContextProvider } from '../../../secrets/SecretsContext';\n\nconst useStyles = makeStyles<BackstageTheme>(() => ({\n markdown: {\n /** to make the styles for React Markdown not leak into the description */\n '& :first-child': {\n marginTop: 0,\n },\n '& :last-child': {\n marginBottom: 0,\n },\n },\n}));\n\n/**\n * @alpha\n */\nexport type WorkflowProps = {\n title?: string;\n description?: string;\n namespace: string;\n templateName: string;\n onError(error: Error | undefined): JSX.Element | null;\n} & Pick<\n StepperProps,\n | 'extensions'\n | 'FormProps'\n | 'components'\n | 'onCreate'\n | 'initialState'\n | 'layouts'\n>;\n\n/**\n * @alpha\n */\nexport const Workflow = (workflowProps: WorkflowProps): JSX.Element | null => {\n const { title, description, namespace, templateName, ...props } =\n workflowProps;\n\n const styles = useStyles();\n const templateRef = stringifyEntityRef({\n kind: 'Template',\n namespace: namespace,\n name: templateName,\n });\n\n const errorApi = useApi(errorApiRef);\n\n const { loading, manifest, error } = useTemplateParameterSchema(templateRef);\n\n useEffect(() => {\n if (error) {\n errorApi.post(new Error(`Failed to load template, ${error}`));\n }\n }, [error, errorApi]);\n\n if (error) {\n return props.onError(error);\n }\n\n return (\n <Content>\n {loading && <Progress />}\n {manifest && (\n <InfoCard\n title={title ?? manifest.title}\n subheader={\n <MarkdownContent\n className={styles.markdown}\n content={description ?? manifest.description ?? 'No description'}\n />\n }\n noPadding\n titleTypographyProps={{ component: 'h2' }}\n >\n <Stepper manifest={manifest} {...props} />\n </InfoCard>\n )}\n </Content>\n );\n};\n\n/**\n * @alpha\n */\nexport const EmbeddableWorkflow = (props: WorkflowProps) => (\n <SecretsContextProvider>\n <Workflow {...props} />\n </SecretsContextProvider>\n);\n","/*\n * Copyright 2023 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 { IconComponent, useApp, useRouteRef } from '@backstage/core-plugin-api';\nimport { entityRouteRef } from '@backstage/plugin-catalog-react';\nimport { Button, makeStyles } from '@material-ui/core';\nimport React from 'react';\nimport WebIcon from '@material-ui/icons/Web';\nimport { parseEntityRef } from '@backstage/catalog-model';\nimport { Link } from '@backstage/core-components';\nimport { ScaffolderTaskOutput } from '../../../api';\n\nconst useStyles = makeStyles({\n root: {\n '&:hover': {\n textDecoration: 'none',\n },\n },\n});\n\nexport const LinkOutputs = (props: { output: ScaffolderTaskOutput }) => {\n const { links = [] } = props.output;\n const classes = useStyles();\n const app = useApp();\n const entityRoute = useRouteRef(entityRouteRef);\n\n const iconResolver = (key?: string): IconComponent =>\n app.getSystemIcon(key!) ?? WebIcon;\n\n return (\n <>\n {links\n .filter(({ url, entityRef }) => url || entityRef)\n .map(({ url, entityRef, title, icon }) => {\n if (entityRef) {\n const entityName = parseEntityRef(entityRef);\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 const Icon = iconResolver(icon);\n return (\n <Link to={url} key={i} classes={{ root: classes.root }}>\n <Button startIcon={<Icon />} component=\"div\" color=\"primary\">\n {title}\n </Button>\n </Link>\n );\n })}\n </>\n );\n};\n","/*\n * Copyright 2023 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 { Box, Paper } from '@material-ui/core';\nimport { LinkOutputs } from './LinkOutputs';\nimport { ScaffolderTaskOutput } from '../../../api';\n\n/**\n * The DefaultOutputs renderer for the scaffolder task output\n *\n * @alpha\n */\nexport const DefaultTemplateOutputs = (props: {\n output?: ScaffolderTaskOutput;\n}) => {\n if (!props.output?.links) {\n return null;\n }\n\n return (\n <Box paddingBottom={2}>\n <Paper>\n <Box padding={2} justifyContent=\"center\" display=\"flex\" gridGap={16}>\n <LinkOutputs output={props.output} />\n </Box>\n </Paper>\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 {\n NextCustomFieldValidator,\n NextFieldExtensionOptions,\n NextFieldExtensionComponentProps,\n} from './types';\nimport { Extension, attachComponentData } from '@backstage/core-plugin-api';\nimport { UIOptionsType } from '@rjsf/utils';\nimport { FieldExtensionComponent } from '../../extensions';\nimport { FIELD_EXTENSION_KEY } from '../../extensions/keys';\n\n/**\n * Method for creating field extensions that can be used in the scaffolder\n * frontend form.\n * @alpha\n */\nexport function createNextScaffolderFieldExtension<\n TReturnValue = unknown,\n TInputProps extends UIOptionsType = {},\n>(\n options: NextFieldExtensionOptions<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\nexport type {\n NextCustomFieldValidator,\n NextFieldExtensionOptions,\n NextFieldExtensionComponentProps,\n};\n"],"names":["isObject","JSONSchema","useStyles","validation","_a","MuiStepper","MuiStep","MuiStepLabel"],"mappings":";;;;;;;;;;;;;;;AAgBO,MAAM,2BAA8B,GAAA,kCAAA,CAAA;AAIpC,MAAM,mBAAsB,GAAA,gCAAA;;ACkB5B,SAAS,+BAId,OAC+D,EAAA;AAC/D,EAAO,OAAA;AAAA,IACL,MAAS,GAAA;AACP,MAAA,MAAM,2BAAgC,MAAM,IAAA,CAAA;AAE5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retsContext.tsx","../src/api/ref.ts","../src/hooks/useCustomFieldExtensions.ts","../src/layouts/keys.ts","../src/hooks/useCustomLayouts.ts","../src/layouts/createScaffolderLayout.ts","../src/next/lib/schema.ts","../src/next/components/Stepper/utils.ts","../src/next/components/Stepper/createAsyncValidators.ts","../src/next/components/ReviewState/ReviewState.tsx","../src/next/hooks/useTemplateSchema.ts","../src/next/hooks/useFormDataFromQuery.ts","../src/next/hooks/useTemplateParameterSchema.ts","../src/next/hooks/useTransformSchemaToProps.ts","../src/next/components/Stepper/FieldOverrides/DescriptionField.tsx","../src/next/components/Form/Form.tsx","../src/next/components/Stepper/Stepper.tsx","../src/next/components/TemplateCard/CardHeader.tsx","../src/next/components/TemplateCard/CardLink.tsx","../src/next/components/TemplateCard/TemplateCard.tsx","../src/next/components/TemplateGroup/TemplateGroup.tsx","../src/next/components/Workflow/Workflow.tsx","../src/next/components/TemplateOutputs/LinkOutputs.tsx","../src/next/components/TemplateOutputs/DefaultTemplateOutputs.tsx","../src/next/extensions/index.tsx"],"sourcesContent":["/*\n * Copyright 2023 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\nexport const FIELD_EXTENSION_WRAPPER_KEY = 'scaffolder.extensions.wrapper.v1';\n/**\n * The key used to store the field extension data for any `<FieldExtension />` component\n */\nexport const FIELD_EXTENSION_KEY = 'scaffolder.extensions.field.v1';\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 CustomFieldExtensionSchema,\n CustomFieldValidator,\n FieldExtensionOptions,\n FieldExtensionComponentProps,\n} from './types';\nimport { Extension, attachComponentData } from '@backstage/core-plugin-api';\nimport { FIELD_EXTENSION_KEY, FIELD_EXTENSION_WRAPPER_KEY } from './keys';\n\n/**\n * The type used to wrap up the Layout and embed the input props\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 React.PropsWithChildren<{}>\n> = (): JSX.Element | null => null;\n\nattachComponentData(\n ScaffolderFieldExtensions,\n FIELD_EXTENSION_WRAPPER_KEY,\n true,\n);\n\nexport type {\n CustomFieldExtensionSchema,\n CustomFieldValidator,\n FieldExtensionOptions,\n FieldExtensionComponentProps,\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 {\n createVersionedContext,\n createVersionedValueMap,\n} from '@backstage/version-bridge';\nimport React, {\n useState,\n useCallback,\n useContext,\n PropsWithChildren,\n} from 'react';\n\n/**\n * The contents of the `SecretsContext`\n */\ntype SecretsContextContents = {\n secrets: Record<string, string>;\n setSecrets: React.Dispatch<React.SetStateAction<Record<string, string>>>;\n};\n\n/**\n * The context to hold the Secrets.\n */\nconst SecretsContext = createVersionedContext<{\n 1: SecretsContextContents;\n}>('secrets-context');\n\n/**\n * The Context Provider that holds the state for the secrets.\n * @public\n */\nexport const SecretsContextProvider = ({ children }: PropsWithChildren<{}>) => {\n const [secrets, setSecrets] = useState<Record<string, string>>({});\n\n return (\n <SecretsContext.Provider\n value={createVersionedValueMap({ 1: { secrets, setSecrets } })}\n >\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 secrets: Record<string, string>;\n}\n\n/**\n * Hook to access the secrets context to be able to set secrets that are\n * passed to the Scaffolder backend.\n * @public\n */\nexport const useTemplateSecrets = (): ScaffolderUseTemplateSecrets => {\n const value = useContext(SecretsContext)?.atVersion(1);\n\n if (!value) {\n throw new Error(\n 'useTemplateSecrets must be used within a SecretsContextProvider',\n );\n }\n\n const { setSecrets: updateSecrets, secrets = {} } = value;\n\n const setSecrets = useCallback(\n (input: Record<string, string>) => {\n updateSecrets(currentSecrets => ({ ...currentSecrets, ...input }));\n },\n [updateSecrets],\n );\n\n return { setSecrets, secrets };\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 { createApiRef } from '@backstage/core-plugin-api';\nimport { ScaffolderApi } from './types';\nimport { getOrCreateGlobalSingleton } from '@backstage/version-bridge';\n\n/** @public */\nexport const scaffolderApiRef = getOrCreateGlobalSingleton(\n 'scaffolder:scaffolder-api-ref',\n () =>\n createApiRef<ScaffolderApi>({\n id: 'plugin.scaffolder.service',\n }),\n);\n","/*\n * Copyright 2023 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 { useElementFilter } from '@backstage/core-plugin-api';\nimport { FieldExtensionOptions } from '../extensions';\nimport {\n FIELD_EXTENSION_KEY,\n FIELD_EXTENSION_WRAPPER_KEY,\n} from '../extensions/keys';\n\n/**\n * Hook that returns all custom field extensions from the current outlet.\n * @public\n */\nexport const useCustomFieldExtensions = <\n TComponentDataType = FieldExtensionOptions,\n>(\n outlet: React.ReactNode,\n) => {\n return useElementFilter(outlet, elements =>\n elements\n .selectByComponentData({\n key: FIELD_EXTENSION_WRAPPER_KEY,\n })\n .findComponentData<TComponentDataType>({\n key: FIELD_EXTENSION_KEY,\n }),\n );\n};\n","/*\n * Copyright 2023 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 */\nexport const LAYOUTS_KEY = 'scaffolder.layout.v1';\nexport const LAYOUTS_WRAPPER_KEY = 'scaffolder.layouts.wrapper.v1';\n","/*\n * Copyright 2023 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 { useElementFilter } from '@backstage/core-plugin-api';\nimport { LAYOUTS_KEY, LAYOUTS_WRAPPER_KEY } from '../layouts/keys';\nimport { LayoutOptions } from '../layouts';\n\n/**\n * Hook that returns all custom field extensions from the current outlet.\n * @public\n */\nexport const useCustomLayouts = <TComponentDataType = LayoutOptions>(\n outlet: React.ReactNode,\n) => {\n return useElementFilter(outlet, elements =>\n elements\n .selectByComponentData({\n key: LAYOUTS_WRAPPER_KEY,\n })\n .findComponentData<TComponentDataType>({\n key: LAYOUTS_KEY,\n }),\n );\n};\n","/*\n * Copyright 2023 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 { LAYOUTS_KEY, LAYOUTS_WRAPPER_KEY } from './keys';\nimport { attachComponentData, Extension } from '@backstage/core-plugin-api';\nimport type { FormProps as SchemaFormProps } from '@rjsf/core-v5';\n\n/**\n * The field template from `@rjsf/core` which is a react component that gets passed `@rjsf/core` field related props.\n *\n * @public\n */\nexport type LayoutTemplate<T = any> = NonNullable<\n SchemaFormProps<T>['uiSchema']\n>['ui:ObjectFieldTemplate'];\n\n/**\n * The type of layouts that is passed to the TemplateForms\n *\n * @public\n */\nexport interface LayoutOptions<P = any> {\n name: string;\n component: LayoutTemplate<P>;\n}\n\n/**\n * A type used to wrap up the FieldExtension to embed the ReturnValue and the InputProps\n * @public\n */\nexport type LayoutComponent<_TInputProps> = () => null;\n\n/**\n * Method for creating custom Layouts that can be used in the scaffolder frontend form\n *\n * @public\n */\nexport function createScaffolderLayout<TInputProps = unknown>(\n options: LayoutOptions,\n): Extension<LayoutComponent<TInputProps>> {\n return {\n expose() {\n const LayoutDataHolder: any = () => null;\n\n attachComponentData(LayoutDataHolder, LAYOUTS_KEY, options);\n\n return LayoutDataHolder;\n },\n };\n}\n\n/**\n * The wrapping component for defining scaffolder layouts as children\n *\n * @public\n */\nexport const ScaffolderLayouts: React.ComponentType = (): JSX.Element | null =>\n null;\n\nattachComponentData(ScaffolderLayouts, LAYOUTS_WRAPPER_KEY, true);\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 { JsonObject } from '@backstage/types';\nimport { FieldValidation, UiSchema } from '@rjsf/utils';\n\nfunction isObject(value: unknown): value is JsonObject {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction extractUiSchema(schema: JsonObject, uiSchema: JsonObject) {\n if (!isObject(schema)) {\n return;\n }\n\n const { properties, items, anyOf, oneOf, allOf, dependencies } = schema;\n\n for (const propName in schema) {\n if (!schema.hasOwnProperty(propName)) {\n continue;\n }\n\n if (propName.startsWith('ui:')) {\n uiSchema[propName] = schema[propName];\n delete schema[propName];\n }\n }\n\n if (isObject(properties)) {\n for (const propName in properties) {\n if (!properties.hasOwnProperty(propName)) {\n continue;\n }\n\n const schemaNode = properties[propName];\n if (!isObject(schemaNode)) {\n continue;\n }\n const innerUiSchema = {};\n uiSchema[propName] = innerUiSchema;\n extractUiSchema(schemaNode, innerUiSchema);\n }\n }\n\n if (isObject(items)) {\n const innerUiSchema = {};\n uiSchema.items = innerUiSchema;\n extractUiSchema(items, innerUiSchema);\n }\n\n if (Array.isArray(anyOf)) {\n for (const schemaNode of anyOf) {\n if (!isObject(schemaNode)) {\n continue;\n }\n extractUiSchema(schemaNode, uiSchema);\n }\n }\n\n if (Array.isArray(oneOf)) {\n for (const schemaNode of oneOf) {\n if (!isObject(schemaNode)) {\n continue;\n }\n extractUiSchema(schemaNode, uiSchema);\n }\n }\n\n if (Array.isArray(allOf)) {\n for (const schemaNode of allOf) {\n if (!isObject(schemaNode)) {\n continue;\n }\n extractUiSchema(schemaNode, uiSchema);\n }\n }\n\n if (isObject(dependencies)) {\n for (const depName of Object.keys(dependencies)) {\n const schemaNode = dependencies[depName];\n if (!isObject(schemaNode)) {\n continue;\n }\n extractUiSchema(schemaNode, uiSchema);\n }\n }\n}\n\n/**\n * Takes a step from a Backstage Template Manifest and converts it to a JSON Schema and UI Schema for rjsf\n * @alpha\n */\nexport const extractSchemaFromStep = (\n inputStep: JsonObject,\n): { uiSchema: UiSchema; schema: JsonObject } => {\n const uiSchema: UiSchema = {};\n const returnSchema: JsonObject = JSON.parse(JSON.stringify(inputStep));\n extractUiSchema(returnSchema, uiSchema);\n return { uiSchema, schema: returnSchema };\n};\n\n/**\n * Creates a field validation object for use in react jsonschema form\n * @alpha\n */\nexport const createFieldValidation = (): FieldValidation => {\n const fieldValidation: FieldValidation = {\n __errors: [] as string[],\n addError: (message: string) => {\n fieldValidation.__errors?.push(message);\n },\n };\n\n return fieldValidation;\n};\n","/*\n * Copyright 2023 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 type { JsonObject, JsonValue } from '@backstage/types';\nimport type { FieldValidation } from '@rjsf/utils';\nimport { FormValidation } from './createAsyncValidators';\n\nfunction isFieldValidation(error: any): error is FieldValidation {\n return !!error && '__errors' in error;\n}\n\nexport function hasErrors(errors?: FormValidation): boolean {\n if (!errors) {\n return false;\n }\n\n for (const error of Object.values(errors)) {\n if (isFieldValidation(error)) {\n if ((error.__errors ?? []).length > 0) {\n return true;\n }\n\n continue;\n }\n\n return hasErrors(error);\n }\n\n return false;\n}\n\nexport function isObject(value: JsonValue | undefined): value is JsonObject {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\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 { FieldValidation } from '@rjsf/utils';\nimport type { JsonObject, JsonValue } from '@backstage/types';\nimport { ApiHolder } from '@backstage/core-plugin-api';\nimport { Draft07 as JSONSchema } from 'json-schema-library';\nimport { createFieldValidation } from '../../lib';\nimport { NextCustomFieldValidator } from '../../extensions';\nimport { isObject } from './utils';\n\n/**\n * @internal\n */\nexport type FormValidation = {\n [name: string]: FieldValidation | FormValidation;\n};\n\nexport const createAsyncValidators = (\n rootSchema: JsonObject,\n validators: Record<string, undefined | NextCustomFieldValidator<unknown>>,\n context: {\n apiHolder: ApiHolder;\n },\n) => {\n async function validate(\n formData: JsonObject,\n pathPrefix: string = '#',\n current: JsonObject = formData,\n ): Promise<FormValidation> {\n const parsedSchema = new JSONSchema(rootSchema);\n const formValidation: FormValidation = {};\n\n const validateForm = async (\n validatorName: string,\n key: string,\n value: JsonValue | undefined,\n ) => {\n const validator = validators[validatorName];\n if (validator) {\n const fieldValidation = createFieldValidation();\n try {\n await validator(value, fieldValidation, { ...context, formData });\n } catch (ex) {\n fieldValidation.addError(ex.message);\n }\n formValidation[key] = fieldValidation;\n }\n };\n\n for (const [key, value] of Object.entries(current)) {\n const path = `${pathPrefix}/${key}`;\n const definitionInSchema = parsedSchema.getSchema(path, formData);\n\n if (definitionInSchema && 'ui:field' in definitionInSchema) {\n if ('ui:field' in definitionInSchema) {\n await validateForm(definitionInSchema['ui:field'], key, value);\n }\n } else if (\n definitionInSchema &&\n definitionInSchema.items &&\n 'ui:field' in definitionInSchema.items\n ) {\n if ('ui:field' in definitionInSchema.items) {\n await validateForm(definitionInSchema.items['ui:field'], key, value);\n }\n } else if (isObject(value)) {\n formValidation[key] = await validate(formData, path, value);\n }\n }\n\n return formValidation;\n }\n\n return async (formData: JsonObject) => {\n return await validate(formData);\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 { StructuredMetadataTable } from '@backstage/core-components';\nimport { JsonObject } from '@backstage/types';\nimport { Draft07 as JSONSchema } from 'json-schema-library';\nimport { ParsedTemplateSchema } from '../../hooks/useTemplateSchema';\n\n/**\n * The props for the {@link ReviewState} component.\n * @alpha\n */\nexport type ReviewStateProps = {\n schemas: ParsedTemplateSchema[];\n formState: JsonObject;\n};\n\n/**\n * The component used by the {@link Stepper} to render the review step.\n * @alpha\n */\nexport const ReviewState = (props: ReviewStateProps) => {\n const reviewData = Object.fromEntries(\n Object.entries(props.formState).map(([key, value]) => {\n for (const step of props.schemas) {\n const parsedSchema = new JSONSchema(step.mergedSchema);\n const definitionInSchema = parsedSchema.getSchema(\n `#/${key}`,\n props.formState,\n );\n if (definitionInSchema) {\n const backstageReviewOptions =\n definitionInSchema['ui:backstage']?.review;\n\n if (backstageReviewOptions) {\n if (backstageReviewOptions.mask) {\n return [key, backstageReviewOptions.mask];\n }\n if (backstageReviewOptions.show === false) {\n return [];\n }\n }\n\n if (definitionInSchema['ui:widget'] === 'password') {\n return [key, '******'];\n }\n }\n }\n return [key, value];\n }),\n );\n return <StructuredMetadataTable metadata={reviewData} />;\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 { featureFlagsApiRef, useApi } from '@backstage/core-plugin-api';\nimport { JsonObject } from '@backstage/types';\nimport { UiSchema } from '@rjsf/utils';\nimport { TemplateParameterSchema } from '../../types';\nimport { extractSchemaFromStep } from '../lib';\n\n/**\n * This is the parsed template schema that is returned from the {@link useTemplateSchema} hook.\n * @alpha\n */\nexport interface ParsedTemplateSchema {\n uiSchema: UiSchema;\n mergedSchema: JsonObject;\n schema: JsonObject;\n title: string;\n description?: string;\n}\n\n/**\n * This hook will parse the template schema and return the steps with the\n * parsed schema and uiSchema. Filtering out any steps or properties that\n * are not enabled with feature flags.\n * @alpha\n */\nexport const useTemplateSchema = (\n manifest: TemplateParameterSchema,\n): { steps: ParsedTemplateSchema[] } => {\n const featureFlags = useApi(featureFlagsApiRef);\n const steps = manifest.steps.map(({ title, description, schema }) => ({\n title,\n description,\n mergedSchema: schema,\n ...extractSchemaFromStep(schema),\n }));\n\n const returningSteps = steps\n // Filter out steps that are not enabled with the feature flags\n .filter(step => {\n const stepFeatureFlag = step.uiSchema['ui:backstage']?.featureFlag;\n return stepFeatureFlag ? featureFlags.isActive(stepFeatureFlag) : true;\n })\n // Then filter out the properties that are not enabled with feature flag\n .map(step => ({\n ...step,\n schema: {\n ...step.schema,\n // Title is rendered at the top of the page, so let's ignore this from jsonschemaform\n title: undefined,\n properties: Object.fromEntries(\n Object.entries(step.schema.properties as JsonObject).filter(\n ([key]) => {\n const stepFeatureFlag =\n step.uiSchema[key]?.['ui:backstage']?.featureFlag;\n return stepFeatureFlag\n ? featureFlags.isActive(stepFeatureFlag)\n : true;\n },\n ),\n ),\n },\n }));\n\n return {\n steps: returningSteps,\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 { JsonValue } from '@backstage/types';\nimport qs from 'qs';\nimport { useState } from 'react';\n\n/**\n * This hook is used to get the formData from the query string.\n * @alpha\n */\nexport const useFormDataFromQuery = (\n initialState?: Record<string, JsonValue>,\n) => {\n return useState<Record<string, any>>(() => {\n if (initialState) {\n return initialState;\n }\n\n const query = qs.parse(window.location.search, {\n ignoreQueryPrefix: true,\n });\n\n try {\n return JSON.parse(query.formData as string);\n } catch (e) {\n return {};\n }\n });\n};\n","import { useApi } from '@backstage/core-plugin-api';\n\n/*\n * Copyright 2023 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 useAsync from 'react-use/lib/useAsync';\nimport { scaffolderApiRef } from '../../api/ref';\n\n/**\n * @alpha\n */\nexport const useTemplateParameterSchema = (templateRef: string) => {\n const scaffolderApi = useApi(scaffolderApiRef);\n const { value, loading, error } = useAsync(\n () => scaffolderApi.getTemplateParameterSchema(templateRef),\n [scaffolderApi, templateRef],\n );\n\n return { manifest: value, loading, error };\n};\n","/*\n * Copyright 2023 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 { type ParsedTemplateSchema } from './useTemplateSchema';\nimport { type LayoutOptions } from '../../layouts';\n\ninterface Options {\n layouts?: LayoutOptions[];\n}\n\nexport const useTransformSchemaToProps = (\n step: ParsedTemplateSchema,\n options: Options = {},\n): ParsedTemplateSchema => {\n const { layouts = [] } = options;\n const objectFieldTemplate = step?.uiSchema['ui:ObjectFieldTemplate'] as\n | string\n | undefined;\n\n if (typeof objectFieldTemplate !== 'string') {\n return step;\n }\n\n const Layout = layouts.find(\n layout => layout.name === objectFieldTemplate,\n )?.component;\n\n if (!Layout) {\n return step;\n }\n\n return {\n ...step,\n uiSchema: {\n ...step.uiSchema,\n ['ui:ObjectFieldTemplate']: Layout,\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 React from 'react';\nimport { MarkdownContent } from '@backstage/core-components';\nimport { FieldProps } from '@rjsf/utils';\n\nexport const DescriptionField = ({ description }: FieldProps) =>\n description && <MarkdownContent content={description} linkTarget=\"_blank\" />;\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 { withTheme } from '@rjsf/core-v5';\n\n// TODO(blam): We require here, as the types in this package depend on @rjsf/core explicitly\n// which is what we're using here as the default types, it needs to depend on @rjsf/core-v5 because\n// of the re-writing we're doing. Once we've migrated, we can import this the exact same as before.\n/** @alpha */\nexport const Form = withTheme(require('@rjsf/material-ui-v5').Theme);\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 { useAnalytics, useApiHolder } from '@backstage/core-plugin-api';\nimport { JsonValue } from '@backstage/types';\nimport {\n Stepper as MuiStepper,\n Step as MuiStep,\n StepLabel as MuiStepLabel,\n Button,\n makeStyles,\n} from '@material-ui/core';\nimport { type IChangeEvent } from '@rjsf/core-v5';\nimport { ErrorSchema } from '@rjsf/utils';\nimport React, { useCallback, useMemo, useState, type ReactNode } from 'react';\nimport { NextFieldExtensionOptions } from '../../extensions';\nimport { TemplateParameterSchema } from '../../../types';\nimport {\n createAsyncValidators,\n type FormValidation,\n} from './createAsyncValidators';\nimport { ReviewState, type ReviewStateProps } from '../ReviewState';\nimport { useTemplateSchema } from '../../hooks/useTemplateSchema';\nimport validator from '@rjsf/validator-ajv8';\nimport { useFormDataFromQuery } from '../../hooks';\nimport { FormProps } from '../../types';\nimport { LayoutOptions } from '../../../layouts';\nimport { useTransformSchemaToProps } from '../../hooks/useTransformSchemaToProps';\nimport { hasErrors } from './utils';\nimport * as FieldOverrides from './FieldOverrides';\nimport { Form } from '../Form';\n\nconst useStyles = makeStyles(theme => ({\n backButton: {\n marginRight: theme.spacing(1),\n },\n\n footer: {\n display: 'flex',\n flexDirection: 'row',\n justifyContent: 'right',\n },\n formWrapper: {\n padding: theme.spacing(2),\n },\n}));\n\n/**\n * The Props for {@link Stepper} component\n * @alpha\n */\nexport type StepperProps = {\n manifest: TemplateParameterSchema;\n extensions: NextFieldExtensionOptions<any, any>[];\n templateName?: string;\n FormProps?: FormProps;\n initialState?: Record<string, JsonValue>;\n onCreate: (values: Record<string, JsonValue>) => Promise<void>;\n components?: {\n ReviewStateComponent?: (props: ReviewStateProps) => JSX.Element;\n createButtonText?: ReactNode;\n reviewButtonText?: ReactNode;\n };\n layouts?: LayoutOptions[];\n};\n\n/**\n * The `Stepper` component is the Wizard that is rendered when a user selects a template\n * @alpha\n */\nexport const Stepper = (stepperProps: StepperProps) => {\n const { layouts = [], components = {}, ...props } = stepperProps;\n const {\n ReviewStateComponent = ReviewState,\n createButtonText = 'Create',\n reviewButtonText = 'Review',\n } = components;\n const analytics = useAnalytics();\n const { steps } = useTemplateSchema(props.manifest);\n const apiHolder = useApiHolder();\n const [activeStep, setActiveStep] = useState(0);\n const [formState, setFormState] = useFormDataFromQuery(props.initialState);\n\n const [errors, setErrors] = useState<undefined | FormValidation>();\n const styles = useStyles();\n\n const extensions = useMemo(() => {\n return Object.fromEntries(\n props.extensions.map(({ name, component }) => [name, component]),\n );\n }, [props.extensions]);\n\n const validators = useMemo(() => {\n return Object.fromEntries(\n props.extensions.map(({ name, validation }) => [name, validation]),\n );\n }, [props.extensions]);\n\n const validation = useMemo(() => {\n return createAsyncValidators(steps[activeStep]?.mergedSchema, validators, {\n apiHolder,\n });\n }, [steps, activeStep, validators, apiHolder]);\n\n const handleBack = () => {\n setActiveStep(prevActiveStep => prevActiveStep - 1);\n };\n\n const handleChange = useCallback(\n (e: IChangeEvent) =>\n setFormState(current => ({ ...current, ...e.formData })),\n [setFormState],\n );\n\n const currentStep = useTransformSchemaToProps(steps[activeStep], { layouts });\n\n const handleNext = async ({\n formData = {},\n }: {\n formData?: Record<string, JsonValue>;\n }) => {\n // TODO(blam): What do we do about loading states, does each field extension get a chance\n // to display it's own loading? Or should we grey out the entire form.\n setErrors(undefined);\n\n const returnedValidation = await validation(formData);\n\n if (hasErrors(returnedValidation)) {\n setErrors(returnedValidation);\n } else {\n setErrors(undefined);\n setActiveStep(prevActiveStep => {\n const stepNum = prevActiveStep + 1;\n analytics.captureEvent('click', `Next Step (${stepNum})`);\n return stepNum;\n });\n }\n setFormState(current => ({ ...current, ...formData }));\n };\n\n return (\n <>\n <MuiStepper activeStep={activeStep} alternativeLabel variant=\"elevation\">\n {steps.map((step, index) => (\n <MuiStep key={index}>\n <MuiStepLabel>{step.title}</MuiStepLabel>\n </MuiStep>\n ))}\n <MuiStep>\n <MuiStepLabel>Review</MuiStepLabel>\n </MuiStep>\n </MuiStepper>\n <div className={styles.formWrapper}>\n {activeStep < steps.length ? (\n <Form\n validator={validator}\n extraErrors={errors as unknown as ErrorSchema}\n formData={formState}\n formContext={{ formData: formState }}\n schema={currentStep.schema}\n uiSchema={currentStep.uiSchema}\n onSubmit={handleNext}\n fields={{ ...FieldOverrides, ...extensions }}\n showErrorList={false}\n onChange={handleChange}\n {...(props.FormProps ?? {})}\n >\n <div className={styles.footer}>\n <Button\n onClick={handleBack}\n className={styles.backButton}\n disabled={activeStep < 1}\n >\n Back\n </Button>\n <Button variant=\"contained\" color=\"primary\" type=\"submit\">\n {activeStep === steps.length - 1 ? reviewButtonText : 'Next'}\n </Button>\n </div>\n </Form>\n ) : (\n <>\n <ReviewStateComponent formState={formState} schemas={steps} />\n <div className={styles.footer}>\n <Button\n onClick={handleBack}\n className={styles.backButton}\n disabled={activeStep < 1}\n >\n Back\n </Button>\n <Button\n variant=\"contained\"\n onClick={() => {\n props.onCreate(formState);\n const name =\n typeof formState.name === 'string'\n ? formState.name\n : undefined;\n analytics.captureEvent(\n 'create',\n name ?? props.templateName ?? 'unknown',\n );\n }}\n >\n {createButtonText}\n </Button>\n </div>\n </>\n )}\n </div>\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 { makeStyles, useTheme } from '@material-ui/core';\nimport { ItemCardHeader } from '@backstage/core-components';\nimport { BackstageTheme } from '@backstage/theme';\nimport { TemplateEntityV1beta3 } from '@backstage/plugin-scaffolder-common';\nimport { FavoriteEntity } from '@backstage/plugin-catalog-react';\n\nconst useStyles = makeStyles<BackstageTheme, { cardBackgroundImage: string }>(\n () => ({\n header: {\n backgroundImage: ({ cardBackgroundImage }) => cardBackgroundImage,\n },\n subtitleWrapper: {\n display: 'flex',\n justifyContent: 'space-between',\n },\n }),\n);\n\n/**\n * Props for the CardHeader component\n */\nexport interface CardHeaderProps {\n template: TemplateEntityV1beta3;\n}\n\n/**\n * The Card Header with the background for the TemplateCard.\n */\nexport const CardHeader = (props: CardHeaderProps) => {\n const {\n template: {\n metadata: { title, name },\n spec: { type },\n },\n } = props;\n const { getPageTheme } = useTheme<BackstageTheme>();\n const themeForType = getPageTheme({ themeId: type });\n\n const styles = useStyles({\n cardBackgroundImage: themeForType.backgroundImage,\n });\n\n const SubtitleComponent = (\n <div className={styles.subtitleWrapper}>\n <div>{type}</div>\n <div>\n <FavoriteEntity entity={props.template} style={{ padding: 0 }} />\n </div>\n </div>\n );\n\n return (\n <ItemCardHeader\n title={title ?? name}\n subtitle={SubtitleComponent}\n classes={{ root: styles.header }}\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 { IconComponent } from '@backstage/core-plugin-api';\nimport { BackstageTheme } from '@backstage/theme';\nimport { Link } from '@backstage/core-components';\nimport { makeStyles } from '@material-ui/core';\nimport React from 'react';\n\ninterface CardLinkProps {\n icon: IconComponent;\n text: string;\n url: string;\n}\n\nconst useStyles = makeStyles<BackstageTheme>(() => ({\n linkText: {\n display: 'inline-flex',\n alignItems: 'center',\n },\n}));\n\nexport const CardLink = ({ icon: Icon, text, url }: CardLinkProps) => {\n const styles = useStyles();\n\n return (\n <div className={styles.linkText}>\n <Icon fontSize=\"small\" />\n <Link style={{ marginLeft: '8px' }} to={url}>\n {text || url}\n </Link>\n </div>\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 { RELATION_OWNED_BY } from '@backstage/catalog-model';\nimport { MarkdownContent, UserIcon } from '@backstage/core-components';\nimport { IconComponent, useApp } from '@backstage/core-plugin-api';\nimport {\n EntityRefLinks,\n getEntityRelations,\n} from '@backstage/plugin-catalog-react';\nimport { TemplateEntityV1beta3 } from '@backstage/plugin-scaffolder-common';\nimport { BackstageTheme } from '@backstage/theme';\nimport {\n Box,\n Card,\n CardActions,\n CardContent,\n Chip,\n Divider,\n Button,\n Grid,\n makeStyles,\n} from '@material-ui/core';\nimport LanguageIcon from '@material-ui/icons/Language';\nimport React from 'react';\nimport { CardHeader } from './CardHeader';\nimport { CardLink } from './CardLink';\n\nconst useStyles = makeStyles<BackstageTheme>(theme => ({\n box: {\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n display: '-webkit-box',\n '-webkit-line-clamp': 10,\n '-webkit-box-orient': 'vertical',\n },\n markdown: {\n /** to make the styles for React Markdown not leak into the description */\n '& :first-child': {\n margin: 0,\n },\n },\n label: {\n color: theme.palette.text.secondary,\n textTransform: 'uppercase',\n fontWeight: 'bold',\n letterSpacing: 0.5,\n lineHeight: 1,\n fontSize: '0.75rem',\n },\n footer: {\n display: 'flex',\n justifyContent: 'space-between',\n flex: 1,\n alignItems: 'center',\n },\n ownedBy: {\n display: 'flex',\n alignItems: 'center',\n flex: 1,\n color: theme.palette.link,\n },\n}));\n\n/**\n * The Props for the {@link TemplateCard} component\n * @alpha\n */\nexport interface TemplateCardProps {\n template: TemplateEntityV1beta3;\n additionalLinks?: {\n icon: IconComponent;\n text: string;\n url: string;\n }[];\n\n onSelected?: (template: TemplateEntityV1beta3) => void;\n}\n\n/**\n * The `TemplateCard` component that is rendered in a list for each template\n * @alpha\n */\nexport const TemplateCard = (props: TemplateCardProps) => {\n const { template } = props;\n const styles = useStyles();\n const ownedByRelations = getEntityRelations(template, RELATION_OWNED_BY);\n const app = useApp();\n const iconResolver = (key?: string): IconComponent =>\n key ? app.getSystemIcon(key) ?? LanguageIcon : LanguageIcon;\n\n return (\n <Card>\n <CardHeader template={template} />\n <CardContent>\n <Grid container spacing={2}>\n <Grid item xs={12}>\n <Box className={styles.box}>\n <MarkdownContent\n className={styles.markdown}\n content={template.metadata.description ?? 'No description'}\n />\n </Box>\n </Grid>\n {(template.metadata.tags?.length ?? 0) > 0 && (\n <>\n <Grid item xs={12}>\n <Divider />\n </Grid>\n <Grid item xs={12}>\n <Grid container spacing={2}>\n {template.metadata.tags?.map(tag => (\n <Grid item>\n <Chip\n style={{ margin: 0 }}\n size=\"small\"\n label={tag}\n key={tag}\n />\n </Grid>\n ))}\n </Grid>\n </Grid>\n </>\n )}\n {(props.additionalLinks || template.metadata.links?.length) && (\n <>\n <Grid item xs={12}>\n <Divider />\n </Grid>\n <Grid item xs={12}>\n <Grid container spacing={2}>\n {props.additionalLinks?.map(({ icon, text, url }) => (\n <Grid className={styles.linkText} item xs={6}>\n <CardLink icon={icon} text={text} url={url} />\n </Grid>\n ))}\n {template.metadata.links?.map(({ url, icon, title }) => (\n <Grid className={styles.linkText} item xs={6}>\n <CardLink\n icon={iconResolver(icon)}\n text={title || url}\n url={url}\n />\n </Grid>\n ))}\n </Grid>\n </Grid>\n </>\n )}\n </Grid>\n </CardContent>\n <CardActions style={{ padding: '16px' }}>\n <div className={styles.footer}>\n <div className={styles.ownedBy}>\n {ownedByRelations.length > 0 && (\n <>\n <UserIcon fontSize=\"small\" />\n <EntityRefLinks\n style={{ marginLeft: '8px' }}\n entityRefs={ownedByRelations}\n defaultKind=\"Group\"\n />\n </>\n )}\n </div>\n <Button\n size=\"small\"\n variant=\"outlined\"\n color=\"primary\"\n onClick={() => props.onSelected?.(template)}\n >\n Choose\n </Button>\n </div>\n </CardActions>\n </Card>\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 { TemplateEntityV1beta3 } from '@backstage/plugin-scaffolder-common';\nimport React from 'react';\nimport {\n Content,\n ContentHeader,\n ItemCardGrid,\n Link,\n} from '@backstage/core-components';\nimport { Typography } from '@material-ui/core';\nimport { stringifyEntityRef } from '@backstage/catalog-model';\nimport { TemplateCardProps, TemplateCard } from '../TemplateCard';\nimport { IconComponent } from '@backstage/core-plugin-api';\n\n/**\n * The props for the {@link TemplateGroup} component.\n * @alpha\n */\nexport interface TemplateGroupProps {\n templates: {\n template: TemplateEntityV1beta3;\n additionalLinks?: {\n icon: IconComponent;\n text: string;\n url: string;\n }[];\n }[];\n onSelected: (template: TemplateEntityV1beta3) => void;\n title: React.ReactNode;\n components?: {\n CardComponent?: React.ComponentType<TemplateCardProps>;\n };\n}\n\n/**\n * The `TemplateGroup` component is used to display a group of templates with a title.\n * @alpha\n */\nexport const TemplateGroup = (props: TemplateGroupProps) => {\n const {\n templates,\n title,\n components: { CardComponent } = {},\n onSelected,\n } = props;\n const titleComponent =\n typeof title === 'string' ? <ContentHeader title={title} /> : title;\n\n if (templates.length === 0) {\n return (\n <Content>\n {titleComponent}\n <Typography variant=\"body2\">\n No templates found that match your filter. Learn more about{' '}\n <Link to=\"https://backstage.io/docs/features/software-templates/adding-templates\">\n adding templates\n </Link>\n .\n </Typography>\n </Content>\n );\n }\n\n const Card = CardComponent || TemplateCard;\n\n return (\n <Content>\n {titleComponent}\n <ItemCardGrid>\n {templates.map(({ template, additionalLinks }) => (\n <Card\n key={stringifyEntityRef(template)}\n additionalLinks={additionalLinks}\n template={template}\n onSelected={onSelected}\n />\n ))}\n </ItemCardGrid>\n </Content>\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, { useEffect } from 'react';\nimport {\n Content,\n InfoCard,\n MarkdownContent,\n Progress,\n} from '@backstage/core-components';\nimport { stringifyEntityRef } from '@backstage/catalog-model';\nimport { makeStyles } from '@material-ui/core';\nimport { BackstageTheme } from '@backstage/theme';\nimport { errorApiRef, useApi } from '@backstage/core-plugin-api';\nimport { useTemplateParameterSchema } from '../../hooks/useTemplateParameterSchema';\nimport { Stepper, type StepperProps } from '../Stepper/Stepper';\nimport { SecretsContextProvider } from '../../../secrets/SecretsContext';\n\nconst useStyles = makeStyles<BackstageTheme>(() => ({\n markdown: {\n /** to make the styles for React Markdown not leak into the description */\n '& :first-child': {\n marginTop: 0,\n },\n '& :last-child': {\n marginBottom: 0,\n },\n },\n}));\n\n/**\n * @alpha\n */\nexport type WorkflowProps = {\n title?: string;\n description?: string;\n namespace: string;\n templateName: string;\n onError(error: Error | undefined): JSX.Element | null;\n} & Pick<\n StepperProps,\n | 'extensions'\n | 'FormProps'\n | 'components'\n | 'onCreate'\n | 'initialState'\n | 'layouts'\n>;\n\n/**\n * @alpha\n */\nexport const Workflow = (workflowProps: WorkflowProps): JSX.Element | null => {\n const { title, description, namespace, templateName, ...props } =\n workflowProps;\n\n const styles = useStyles();\n const templateRef = stringifyEntityRef({\n kind: 'Template',\n namespace: namespace,\n name: templateName,\n });\n\n const errorApi = useApi(errorApiRef);\n\n const { loading, manifest, error } = useTemplateParameterSchema(templateRef);\n\n useEffect(() => {\n if (error) {\n errorApi.post(new Error(`Failed to load template, ${error}`));\n }\n }, [error, errorApi]);\n\n if (error) {\n return props.onError(error);\n }\n\n return (\n <Content>\n {loading && <Progress />}\n {manifest && (\n <InfoCard\n title={title ?? manifest.title}\n subheader={\n <MarkdownContent\n className={styles.markdown}\n content={description ?? manifest.description ?? 'No description'}\n />\n }\n noPadding\n titleTypographyProps={{ component: 'h2' }}\n >\n <Stepper manifest={manifest} {...props} />\n </InfoCard>\n )}\n </Content>\n );\n};\n\n/**\n * @alpha\n */\nexport const EmbeddableWorkflow = (props: WorkflowProps) => (\n <SecretsContextProvider>\n <Workflow {...props} />\n </SecretsContextProvider>\n);\n","/*\n * Copyright 2023 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 { IconComponent, useApp, useRouteRef } from '@backstage/core-plugin-api';\nimport { entityRouteRef } from '@backstage/plugin-catalog-react';\nimport { Button, makeStyles } from '@material-ui/core';\nimport React from 'react';\nimport WebIcon from '@material-ui/icons/Web';\nimport { parseEntityRef } from '@backstage/catalog-model';\nimport { Link } from '@backstage/core-components';\nimport { ScaffolderTaskOutput } from '../../../api';\n\nconst useStyles = makeStyles({\n root: {\n '&:hover': {\n textDecoration: 'none',\n },\n },\n});\n\nexport const LinkOutputs = (props: { output: ScaffolderTaskOutput }) => {\n const { links = [] } = props.output;\n const classes = useStyles();\n const app = useApp();\n const entityRoute = useRouteRef(entityRouteRef);\n\n const iconResolver = (key?: string): IconComponent =>\n app.getSystemIcon(key!) ?? WebIcon;\n\n return (\n <>\n {links\n .filter(({ url, entityRef }) => url || entityRef)\n .map(({ url, entityRef, title, icon }) => {\n if (entityRef) {\n const entityName = parseEntityRef(entityRef);\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 const Icon = iconResolver(icon);\n return (\n <Link to={url} key={i} classes={{ root: classes.root }}>\n <Button startIcon={<Icon />} component=\"div\" color=\"primary\">\n {title}\n </Button>\n </Link>\n );\n })}\n </>\n );\n};\n","/*\n * Copyright 2023 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 { Box, Paper } from '@material-ui/core';\nimport { LinkOutputs } from './LinkOutputs';\nimport { ScaffolderTaskOutput } from '../../../api';\n\n/**\n * The DefaultOutputs renderer for the scaffolder task output\n *\n * @alpha\n */\nexport const DefaultTemplateOutputs = (props: {\n output?: ScaffolderTaskOutput;\n}) => {\n if (!props.output?.links) {\n return null;\n }\n\n return (\n <Box paddingBottom={2}>\n <Paper>\n <Box padding={2} justifyContent=\"center\" display=\"flex\" gridGap={16}>\n <LinkOutputs output={props.output} />\n </Box>\n </Paper>\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 {\n NextCustomFieldValidator,\n NextFieldExtensionOptions,\n NextFieldExtensionComponentProps,\n} from './types';\nimport { Extension, attachComponentData } from '@backstage/core-plugin-api';\nimport { UIOptionsType } from '@rjsf/utils';\nimport { FieldExtensionComponent } from '../../extensions';\nimport { FIELD_EXTENSION_KEY } from '../../extensions/keys';\n\n/**\n * Method for creating field extensions that can be used in the scaffolder\n * frontend form.\n * @alpha\n */\nexport function createNextScaffolderFieldExtension<\n TReturnValue = unknown,\n TInputProps extends UIOptionsType = {},\n>(\n options: NextFieldExtensionOptions<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\nexport type {\n NextCustomFieldValidator,\n NextFieldExtensionOptions,\n NextFieldExtensionComponentProps,\n};\n"],"names":["isObject","JSONSchema","useStyles","validation","_a","MuiStepper","MuiStep","MuiStepLabel"],"mappings":";;;;;;;;;;;;;;;AAgBO,MAAM,2BAA8B,GAAA,kCAAA,CAAA;AAIpC,MAAM,mBAAsB,GAAA,gCAAA;;ACkB5B,SAAS,+BAId,OAC+D,EAAA;AAC/D,EAAO,OAAA;AAAA,IACL,MAAS,GAAA;AACP,MAAA,MAAM,2BAAgC,MAAM,IAAA,CAAA;AAE5C,MAAA,mBAAA;AAAA,QACE,wBAAA;AAAA,QACA,mBAAA;AAAA,QACA,OAAA;AAAA,OACF,CA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AA,OAAA,EAAS,CAAG,EAAA,cAAA,EAAe,UAAS,OAAQ,EAAA,MAAA,EAAO,OAAS,EAAA,EAAA,EAAA,kBAC9D,KAAA,CAAA,aAAA,CAAA,WAAA,EAAA,EAAY,QAAQ,KAAM,CAAA,MAAA,EAAQ,CACrC,CACF,CACF,CAAA,CAAA;AAEJ;;ACVO,SAAS,mCAId,OAC+D,EAAA;AAC/D,EAAO,OAAA;AAAA,IACL,MAAS,GAAA;AACP,MAAA,MAAM,2BAAgC,MAAM,IAAA,CAAA;AAE5C,MAAA,mBAAA;AAAA,QACE,wBAAA;AAAA,QACA,mBAAA;AAAA,QACA,OAAA;AAAA,OACF,CAAA;AAEA,MAAO,OAAA,wBAAA,CAAA;AAAA,KACT;AAAA,GACF,CAAA;AACF;;;;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@backstage/plugin-scaffolder-react",
3
3
  "description": "A frontend library that helps other Backstage plugins interact with the Scaffolder",
4
- "version": "1.1.0-next.2",
4
+ "version": "1.1.0",
5
5
  "main": "dist/index.esm.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "license": "Apache-2.0",
@@ -33,14 +33,14 @@
33
33
  "start": "backstage-cli package start"
34
34
  },
35
35
  "dependencies": {
36
- "@backstage/catalog-client": "^1.3.1-next.1",
37
- "@backstage/catalog-model": "^1.2.0-next.1",
38
- "@backstage/core-components": "^0.12.4-next.1",
39
- "@backstage/core-plugin-api": "^1.3.0",
36
+ "@backstage/catalog-client": "^1.3.1",
37
+ "@backstage/catalog-model": "^1.2.0",
38
+ "@backstage/core-components": "^0.12.4",
39
+ "@backstage/core-plugin-api": "^1.4.0",
40
40
  "@backstage/errors": "^1.1.4",
41
- "@backstage/plugin-catalog-react": "^1.3.0-next.2",
42
- "@backstage/plugin-scaffolder-common": "^1.2.5-next.1",
43
- "@backstage/theme": "^0.2.16",
41
+ "@backstage/plugin-catalog-react": "^1.3.0",
42
+ "@backstage/plugin-scaffolder-common": "^1.2.5",
43
+ "@backstage/theme": "^0.2.17",
44
44
  "@backstage/types": "^1.0.2",
45
45
  "@backstage/version-bridge": "^1.0.3",
46
46
  "@material-ui/core": "^4.12.2",
@@ -69,11 +69,11 @@
69
69
  "react-router-dom": "6.0.0-beta.0 || ^6.3.0"
70
70
  },
71
71
  "devDependencies": {
72
- "@backstage/cli": "^0.22.2-next.1",
73
- "@backstage/core-app-api": "^1.4.1-next.0",
74
- "@backstage/plugin-catalog": "^1.8.0-next.2",
75
- "@backstage/plugin-catalog-common": "^1.0.11-next.1",
76
- "@backstage/test-utils": "^1.2.5-next.0",
72
+ "@backstage/cli": "^0.22.2",
73
+ "@backstage/core-app-api": "^1.5.0",
74
+ "@backstage/plugin-catalog": "^1.8.0",
75
+ "@backstage/plugin-catalog-common": "^1.0.11",
76
+ "@backstage/test-utils": "^1.2.5",
77
77
  "@testing-library/jest-dom": "^5.10.1",
78
78
  "@testing-library/react": "^12.1.3",
79
79
  "@testing-library/react-hooks": "^8.0.0",