@backstage/plugin-scaffolder-react 1.19.0-next.1 → 1.19.1-next.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 +41 -0
- package/dist/alpha.d.ts +3 -5
- package/dist/api/ref.esm.js.map +1 -1
- package/dist/extensions/createScaffolderFieldExtension.esm.js.map +1 -1
- package/dist/extensions/keys.esm.js.map +1 -1
- package/dist/hooks/useCustomFieldExtensions.esm.js.map +1 -1
- package/dist/hooks/useCustomLayouts.esm.js.map +1 -1
- package/dist/hooks/useEventStream.esm.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/layouts/createScaffolderLayout.esm.js.map +1 -1
- package/dist/layouts/keys.esm.js.map +1 -1
- package/dist/next/api/FormFieldsApi.esm.js +1 -1
- package/dist/next/api/FormFieldsApi.esm.js.map +1 -1
- package/dist/next/api/ref.esm.js.map +1 -1
- package/dist/next/blueprints/FormDecoratorBlueprint.esm.js.map +1 -1
- package/dist/next/blueprints/FormFieldBlueprint.esm.js.map +1 -1
- package/dist/next/components/Form/DescriptionFieldTemplate.esm.js.map +1 -1
- package/dist/next/components/Form/FieldTemplate.esm.js.map +1 -1
- package/dist/next/components/Form/Form.esm.js.map +1 -1
- package/dist/next/components/PasswordWidget/PasswordWidget.esm.js.map +1 -1
- package/dist/next/components/ReviewState/ReviewState.esm.js +1 -1
- package/dist/next/components/ReviewState/ReviewState.esm.js.map +1 -1
- package/dist/next/components/ReviewState/util.esm.js.map +1 -1
- package/dist/next/components/ScaffolderField/ScaffolderField.esm.js.map +1 -1
- package/dist/next/components/ScaffolderPageContextMenu/ScaffolderPageContextMenu.esm.js.map +1 -1
- package/dist/next/components/SecretWidget/SecretWidget.esm.js.map +1 -1
- package/dist/next/components/Stepper/ErrorListTemplate/errorListTemplate.esm.js.map +1 -1
- package/dist/next/components/Stepper/FieldOverrides/DescriptionField.esm.js.map +1 -1
- package/dist/next/components/Stepper/Stepper.esm.js.map +1 -1
- package/dist/next/components/Stepper/createAsyncValidators.esm.js.map +1 -1
- package/dist/next/components/Stepper/utils.esm.js.map +1 -1
- package/dist/next/components/TaskLogStream/TaskLogStream.esm.js.map +1 -1
- package/dist/next/components/TaskSteps/StepIcon.esm.js.map +1 -1
- package/dist/next/components/TaskSteps/StepTime.esm.js.map +1 -1
- package/dist/next/components/TaskSteps/TaskBorder.esm.js.map +1 -1
- package/dist/next/components/TaskSteps/TaskSteps.esm.js.map +1 -1
- package/dist/next/components/TemplateCard/CardHeader.esm.js.map +1 -1
- package/dist/next/components/TemplateCard/CardLink.esm.js.map +1 -1
- package/dist/next/components/TemplateCard/TemplateCard.esm.js.map +1 -1
- package/dist/next/components/TemplateCard/TemplateCardActions.esm.js.map +1 -1
- package/dist/next/components/TemplateCard/TemplateCardContent.esm.js.map +1 -1
- package/dist/next/components/TemplateCard/TemplateCardLinks.esm.js.map +1 -1
- package/dist/next/components/TemplateCard/TemplateCardTags.esm.js.map +1 -1
- package/dist/next/components/TemplateCard/TemplateDetailButton.esm.js.map +1 -1
- package/dist/next/components/TemplateCategoryPicker/TemplateCategoryPicker.esm.js.map +1 -1
- package/dist/next/components/TemplateGroup/TemplateGroup.esm.js.map +1 -1
- package/dist/next/components/TemplateGroups/TemplateGroups.esm.js.map +1 -1
- package/dist/next/components/TemplateOutputs/DefaultTemplateOutputs.esm.js.map +1 -1
- package/dist/next/components/TemplateOutputs/LinkOutputs.esm.js.map +1 -1
- package/dist/next/components/TemplateOutputs/TextOutputs.esm.js.map +1 -1
- package/dist/next/components/Workflow/Workflow.esm.js +1 -1
- package/dist/next/components/Workflow/Workflow.esm.js.map +1 -1
- package/dist/next/extensions/createScaffolderFormDecorator.esm.js.map +1 -1
- package/dist/next/hooks/useFilteredSchemaProperties.esm.js.map +1 -1
- package/dist/next/hooks/useFormDataFromQuery.esm.js.map +1 -1
- package/dist/next/hooks/useTemplateParameterSchema.esm.js.map +1 -1
- package/dist/next/hooks/useTemplateSchema.esm.js.map +1 -1
- package/dist/next/hooks/useTemplateTimeSaved.esm.js.map +1 -1
- package/dist/next/hooks/useTransformSchemaToProps.esm.js.map +1 -1
- package/dist/next/lib/schema.esm.js.map +1 -1
- package/dist/packages/opaque-internal/src/OpaqueType.esm.js.map +1 -1
- package/dist/packages/scaffolder-internal/src/wiring/InternalFormDecorator.esm.js.map +1 -1
- package/dist/packages/scaffolder-internal/src/wiring/InternalFormField.esm.js.map +1 -1
- package/dist/secrets/SecretsContext.esm.js +1 -1
- package/dist/secrets/SecretsContext.esm.js.map +1 -1
- package/dist/translation.esm.js.map +1 -1
- package/dist/utils.esm.js.map +1 -1
- package/package.json +10 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SecretWidget.esm.js","sources":["../../../../src/next/components/SecretWidget/SecretWidget.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 { WidgetProps } from '@rjsf/utils';\nimport { useTemplateSecrets } from '@backstage/plugin-scaffolder-react';\nimport TextField from '@material-ui/core/TextField';\nimport { ChangeEvent, useMemo, useState } from 'react';\nimport debounce from 'lodash/debounce';\n\n/**\n * Secret Widget for overriding the default password input widget\n * @alpha\n */\nexport const SecretWidget = (\n props: Pick<\n WidgetProps,\n 'name' | 'onChange' | 'schema' | 'required' | 'disabled'\n >,\n) => {\n const { setSecrets, secrets } = useTemplateSecrets();\n const {\n name,\n onChange,\n schema: { title, minLength, maxLength },\n required,\n disabled,\n } = props;\n\n const [localValue, setLocalValue] = useState(secrets[name] ?? '');\n\n // Memoize the debounced function so it persists across re-renders\n const debouncedSetSecrets = useMemo(\n () =>\n debounce((value: string) => {\n setSecrets({ [name]: value });\n }, 300),\n [setSecrets, name],\n );\n\n const handleChange = (e: ChangeEvent<HTMLInputElement>) => {\n const newValue = e.target.value;\n setLocalValue(newValue);\n onChange(Array(newValue.length).fill('*').join(''));\n debouncedSetSecrets(newValue);\n };\n\n return (\n <TextField\n id={title}\n label={title}\n aria-describedby={title}\n onChange={handleChange}\n value={localValue}\n type=\"password\"\n autoComplete=\"off\"\n required={required}\n disabled={disabled}\n inputProps={{\n minLength,\n maxLength,\n }}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"SecretWidget.esm.js","sources":["../../../../src/next/components/SecretWidget/SecretWidget.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 { WidgetProps } from '@rjsf/utils';\nimport { useTemplateSecrets } from '@backstage/plugin-scaffolder-react';\nimport TextField from '@material-ui/core/TextField';\nimport { ChangeEvent, useMemo, useState } from 'react';\nimport debounce from 'lodash/debounce';\n\n/**\n * Secret Widget for overriding the default password input widget\n * @alpha\n */\nexport const SecretWidget = (\n props: Pick<\n WidgetProps,\n 'name' | 'onChange' | 'schema' | 'required' | 'disabled'\n >,\n) => {\n const { setSecrets, secrets } = useTemplateSecrets();\n const {\n name,\n onChange,\n schema: { title, minLength, maxLength },\n required,\n disabled,\n } = props;\n\n const [localValue, setLocalValue] = useState(secrets[name] ?? '');\n\n // Memoize the debounced function so it persists across re-renders\n const debouncedSetSecrets = useMemo(\n () =>\n debounce((value: string) => {\n setSecrets({ [name]: value });\n }, 300),\n [setSecrets, name],\n );\n\n const handleChange = (e: ChangeEvent<HTMLInputElement>) => {\n const newValue = e.target.value;\n setLocalValue(newValue);\n onChange(Array(newValue.length).fill('*').join(''));\n debouncedSetSecrets(newValue);\n };\n\n return (\n <TextField\n id={title}\n label={title}\n aria-describedby={title}\n onChange={handleChange}\n value={localValue}\n type=\"password\"\n autoComplete=\"off\"\n required={required}\n disabled={disabled}\n inputProps={{\n minLength,\n maxLength,\n }}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;AA0BO,MAAM,YAAA,GAAe,CAC1B,KAAA,KAIG;AACH,EAAA,MAAM,EAAE,UAAA,EAAY,OAAA,EAAQ,GAAI,kBAAA,EAAmB;AACnD,EAAA,MAAM;AAAA,IACJ,IAAA;AAAA,IACA,QAAA;AAAA,IACA,MAAA,EAAQ,EAAE,KAAA,EAAO,SAAA,EAAW,SAAA,EAAU;AAAA,IACtC,QAAA;AAAA,IACA;AAAA,GACF,GAAI,KAAA;AAEJ,EAAA,MAAM,CAAC,YAAY,aAAa,CAAA,GAAI,SAAS,OAAA,CAAQ,IAAI,KAAK,EAAE,CAAA;AAGhE,EAAA,MAAM,mBAAA,GAAsB,OAAA;AAAA,IAC1B,MACE,QAAA,CAAS,CAAC,KAAA,KAAkB;AAC1B,MAAA,UAAA,CAAW,EAAE,CAAC,IAAI,GAAG,OAAO,CAAA;AAAA,IAC9B,GAAG,GAAG,CAAA;AAAA,IACR,CAAC,YAAY,IAAI;AAAA,GACnB;AAEA,EAAA,MAAM,YAAA,GAAe,CAAC,CAAA,KAAqC;AACzD,IAAA,MAAM,QAAA,GAAW,EAAE,MAAA,CAAO,KAAA;AAC1B,IAAA,aAAA,CAAc,QAAQ,CAAA;AACtB,IAAA,QAAA,CAAS,KAAA,CAAM,SAAS,MAAM,CAAA,CAAE,KAAK,GAAG,CAAA,CAAE,IAAA,CAAK,EAAE,CAAC,CAAA;AAClD,IAAA,mBAAA,CAAoB,QAAQ,CAAA;AAAA,EAC9B,CAAA;AAEA,EAAA,uBACE,GAAA;AAAA,IAAC,SAAA;AAAA,IAAA;AAAA,MACC,EAAA,EAAI,KAAA;AAAA,MACJ,KAAA,EAAO,KAAA;AAAA,MACP,kBAAA,EAAkB,KAAA;AAAA,MAClB,QAAA,EAAU,YAAA;AAAA,MACV,KAAA,EAAO,UAAA;AAAA,MACP,IAAA,EAAK,UAAA;AAAA,MACL,YAAA,EAAa,KAAA;AAAA,MACb,QAAA;AAAA,MACA,QAAA;AAAA,MACA,UAAA,EAAY;AAAA,QACV,SAAA;AAAA,QACA;AAAA;AACF;AAAA,GACF;AAEJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errorListTemplate.esm.js","sources":["../../../../../src/next/components/Stepper/ErrorListTemplate/errorListTemplate.tsx"],"sourcesContent":["/*\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 { ErrorListProps, RJSFValidationError } from '@rjsf/utils';\nimport List from '@material-ui/core/List';\nimport ListItem from '@material-ui/core/ListItem';\nimport ListItemIcon from '@material-ui/core/ListItemIcon';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport Paper from '@material-ui/core/Paper';\nimport { Theme, createStyles, makeStyles } from '@material-ui/core/styles';\nimport ErrorIcon from '@material-ui/icons/Error';\nimport startCase from 'lodash/startCase';\n\nconst useStyles = makeStyles((_theme: Theme) =>\n createStyles({\n list: {\n width: '100%',\n },\n text: {\n textWrap: 'wrap',\n },\n }),\n);\n\n/**\n * Shows a list of errors found in the form\n *\n * @public\n */\nexport const ErrorListTemplate = ({ errors, schema }: ErrorListProps) => {\n const classes = useStyles();\n\n function formatErrorMessage(error: RJSFValidationError) {\n if (error.property && error.message) {\n const propertyName = error.property.startsWith('.')\n ? error.property.substring(1)\n : error.property;\n if (schema.properties && propertyName in schema.properties) {\n const property = schema.properties[propertyName];\n\n if (typeof property === 'object' && 'title' in property) {\n return `'${property.title}' ${error.message}`;\n }\n }\n // fall back to property name\n return `'${startCase(propertyName)}' ${error.message}`;\n }\n // fall back if property does not exist\n return error.stack;\n }\n\n return (\n <Paper>\n <List dense className={classes.list}>\n {errors.map((error, index) => (\n <ListItem key={index}>\n <ListItemIcon>\n <ErrorIcon color=\"error\" />\n </ListItemIcon>\n <ListItemText\n classes={{ primary: classes.text }}\n primary={formatErrorMessage(error)}\n />\n </ListItem>\n ))}\n </List>\n </Paper>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;AAyBA,MAAM,
|
|
1
|
+
{"version":3,"file":"errorListTemplate.esm.js","sources":["../../../../../src/next/components/Stepper/ErrorListTemplate/errorListTemplate.tsx"],"sourcesContent":["/*\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 { ErrorListProps, RJSFValidationError } from '@rjsf/utils';\nimport List from '@material-ui/core/List';\nimport ListItem from '@material-ui/core/ListItem';\nimport ListItemIcon from '@material-ui/core/ListItemIcon';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport Paper from '@material-ui/core/Paper';\nimport { Theme, createStyles, makeStyles } from '@material-ui/core/styles';\nimport ErrorIcon from '@material-ui/icons/Error';\nimport startCase from 'lodash/startCase';\n\nconst useStyles = makeStyles((_theme: Theme) =>\n createStyles({\n list: {\n width: '100%',\n },\n text: {\n textWrap: 'wrap',\n },\n }),\n);\n\n/**\n * Shows a list of errors found in the form\n *\n * @public\n */\nexport const ErrorListTemplate = ({ errors, schema }: ErrorListProps) => {\n const classes = useStyles();\n\n function formatErrorMessage(error: RJSFValidationError) {\n if (error.property && error.message) {\n const propertyName = error.property.startsWith('.')\n ? error.property.substring(1)\n : error.property;\n if (schema.properties && propertyName in schema.properties) {\n const property = schema.properties[propertyName];\n\n if (typeof property === 'object' && 'title' in property) {\n return `'${property.title}' ${error.message}`;\n }\n }\n // fall back to property name\n return `'${startCase(propertyName)}' ${error.message}`;\n }\n // fall back if property does not exist\n return error.stack;\n }\n\n return (\n <Paper>\n <List dense className={classes.list}>\n {errors.map((error, index) => (\n <ListItem key={index}>\n <ListItemIcon>\n <ErrorIcon color=\"error\" />\n </ListItemIcon>\n <ListItemText\n classes={{ primary: classes.text }}\n primary={formatErrorMessage(error)}\n />\n </ListItem>\n ))}\n </List>\n </Paper>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;AAyBA,MAAM,SAAA,GAAY,UAAA;AAAA,EAAW,CAAC,WAC5B,YAAA,CAAa;AAAA,IACX,IAAA,EAAM;AAAA,MACJ,KAAA,EAAO;AAAA,KACT;AAAA,IACA,IAAA,EAAM;AAAA,MACJ,QAAA,EAAU;AAAA;AACZ,GACD;AACH,CAAA;AAOO,MAAM,iBAAA,GAAoB,CAAC,EAAE,MAAA,EAAQ,QAAO,KAAsB;AACvE,EAAA,MAAM,UAAU,SAAA,EAAU;AAE1B,EAAA,SAAS,mBAAmB,KAAA,EAA4B;AACtD,IAAA,IAAI,KAAA,CAAM,QAAA,IAAY,KAAA,CAAM,OAAA,EAAS;AACnC,MAAA,MAAM,YAAA,GAAe,KAAA,CAAM,QAAA,CAAS,UAAA,CAAW,GAAG,CAAA,GAC9C,KAAA,CAAM,QAAA,CAAS,SAAA,CAAU,CAAC,CAAA,GAC1B,KAAA,CAAM,QAAA;AACV,MAAA,IAAI,MAAA,CAAO,UAAA,IAAc,YAAA,IAAgB,MAAA,CAAO,UAAA,EAAY;AAC1D,QAAA,MAAM,QAAA,GAAW,MAAA,CAAO,UAAA,CAAW,YAAY,CAAA;AAE/C,QAAA,IAAI,OAAO,QAAA,KAAa,QAAA,IAAY,OAAA,IAAW,QAAA,EAAU;AACvD,UAAA,OAAO,CAAA,CAAA,EAAI,QAAA,CAAS,KAAK,CAAA,EAAA,EAAK,MAAM,OAAO,CAAA,CAAA;AAAA,QAC7C;AAAA,MACF;AAEA,MAAA,OAAO,IAAI,SAAA,CAAU,YAAY,CAAC,CAAA,EAAA,EAAK,MAAM,OAAO,CAAA,CAAA;AAAA,IACtD;AAEA,IAAA,OAAO,KAAA,CAAM,KAAA;AAAA,EACf;AAEA,EAAA,uBACE,GAAA,CAAC,KAAA,EAAA,EACC,QAAA,kBAAA,GAAA,CAAC,IAAA,EAAA,EAAK,OAAK,IAAA,EAAC,SAAA,EAAW,OAAA,CAAQ,IAAA,EAC5B,iBAAO,GAAA,CAAI,CAAC,KAAA,EAAO,KAAA,0BACjB,QAAA,EAAA,EACC,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,YAAA,EAAA,EACC,QAAA,kBAAA,GAAA,CAAC,SAAA,EAAA,EAAU,KAAA,EAAM,SAAQ,CAAA,EAC3B,CAAA;AAAA,oBACA,GAAA;AAAA,MAAC,YAAA;AAAA,MAAA;AAAA,QACC,OAAA,EAAS,EAAE,OAAA,EAAS,OAAA,CAAQ,IAAA,EAAK;AAAA,QACjC,OAAA,EAAS,mBAAmB,KAAK;AAAA;AAAA;AACnC,GAAA,EAAA,EAPa,KAQf,CACD,CAAA,EACH,CAAA,EACF,CAAA;AAEJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DescriptionField.esm.js","sources":["../../../../../src/next/components/Stepper/FieldOverrides/DescriptionField.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\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"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"DescriptionField.esm.js","sources":["../../../../../src/next/components/Stepper/FieldOverrides/DescriptionField.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\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"],"names":[],"mappings":";;;AAmBO,MAAM,gBAAA,GAAmB,CAAC,EAAE,WAAA,EAAY,KAC7C,WAAA,oBAAe,GAAA,CAAC,eAAA,EAAA,EAAgB,OAAA,EAAS,WAAA,EAAa,UAAA,EAAW,QAAA,EAAS;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stepper.esm.js","sources":["../../../../src/next/components/Stepper/Stepper.tsx"],"sourcesContent":["/*\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 { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport {\n FieldExtensionOptions,\n FormProps,\n LayoutOptions,\n ReviewStepProps,\n TemplateParameterSchema,\n} from '@backstage/plugin-scaffolder-react';\nimport { JsonValue } from '@backstage/types';\nimport Button from '@material-ui/core/Button';\nimport LinearProgress from '@material-ui/core/LinearProgress';\nimport MuiStep from '@material-ui/core/Step';\nimport MuiStepLabel from '@material-ui/core/StepLabel';\nimport MuiStepper from '@material-ui/core/Stepper';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { type IChangeEvent } from '@rjsf/core';\nimport { ErrorSchema } from '@rjsf/utils';\nimport { customizeValidator } from '@rjsf/validator-ajv8';\nimport ajvErrors from 'ajv-errors';\nimport { merge } from 'lodash';\nimport {\n ComponentType,\n useCallback,\n useEffect,\n useMemo,\n useState,\n type ReactNode,\n} from 'react';\n\nimport { scaffolderReactTranslationRef } from '../../../translation';\nimport { useFormDataFromQuery, useTemplateSchema } from '../../hooks';\nimport { useTransformSchemaToProps } from '../../hooks/useTransformSchemaToProps';\nimport { Form } from '../Form';\nimport { PasswordWidget } from '../PasswordWidget/PasswordWidget';\nimport { ReviewState, type ReviewStateProps } from '../ReviewState';\nimport {\n createAsyncValidators,\n type FormValidation,\n} from './createAsyncValidators';\nimport { ErrorListTemplate } from './ErrorListTemplate';\nimport * as FieldOverrides from './FieldOverrides';\nimport { hasErrors } from './utils';\n\nconst validator = customizeValidator();\najvErrors(validator.ajv);\n\n/** @alpha */\nexport type BackstageTemplateStepperClassKey =\n | 'backButton'\n | 'footer'\n | 'formWrapper';\n\nconst useStyles = makeStyles(\n theme => ({\n backButton: {\n marginRight: theme.spacing(1),\n },\n footer: {\n display: 'flex',\n flexDirection: 'row',\n justifyContent: 'right',\n marginTop: theme.spacing(2),\n },\n formWrapper: {\n padding: theme.spacing(2),\n },\n }),\n { name: 'BackstageTemplateStepper' },\n);\n\n/**\n * The Props for {@link Stepper} component\n * @alpha\n */\nexport type StepperProps = {\n manifest: TemplateParameterSchema;\n extensions: FieldExtensionOptions<any, any>[];\n /**\n * @deprecated This was only ever used for analytics tracking purposes, which\n * is now handled in the `<Workflow />` component. Passing it in will have no\n * effect.\n */\n templateName?: string;\n formProps?: FormProps;\n initialState?: Record<string, JsonValue>;\n onCreate: (values: Record<string, JsonValue>) => Promise<void>;\n components?: {\n ReviewStepComponent?: ComponentType<ReviewStepProps>;\n ReviewStateComponent?: (props: ReviewStateProps) => JSX.Element;\n backButtonText?: ReactNode;\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 { t } = useTranslationRef(scaffolderReactTranslationRef);\n const { layouts = [], components = {}, onCreate, ...props } = stepperProps;\n const {\n ReviewStateComponent = ReviewState,\n ReviewStepComponent,\n backButtonText = t('stepper.backButtonText'),\n createButtonText = t('stepper.createButtonText'),\n reviewButtonText = t('stepper.reviewButtonText'),\n } = components;\n const analytics = useAnalytics();\n const { presentation, steps } = useTemplateSchema(props.manifest);\n const apiHolder = useApiHolder();\n const [activeStep, setActiveStep] = useState(0);\n const [isValidating, setIsValidating] = useState(false);\n const [initialState] = useFormDataFromQuery(props.initialState);\n const [stepsState, setStepsState] =\n useState<Record<string, JsonValue>>(initialState);\n\n const [errors, setErrors] = useState<undefined | FormValidation>();\n const styles = useStyles();\n\n const backLabel =\n presentation?.buttonLabels?.backButtonText ?? backButtonText;\n const createLabel =\n presentation?.buttonLabels?.createButtonText ?? createButtonText;\n const reviewLabel =\n presentation?.buttonLabels?.reviewButtonText ?? reviewButtonText;\n\n const extensions = useMemo(() => {\n return Object.fromEntries(\n props.extensions.map(({ name, component }) => [name, component]),\n );\n }, [props.extensions]);\n\n const fields = useMemo(\n () => ({ ...FieldOverrides, ...extensions }),\n [extensions],\n );\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 = useCallback(() => {\n setActiveStep(prevActiveStep => prevActiveStep - 1);\n }, [setActiveStep]);\n\n const currentStep = useTransformSchemaToProps(steps[activeStep], { layouts });\n\n const {\n formContext: propFormContext,\n uiSchema: propUiSchema,\n liveOmit: _shouldLiveOmit,\n omitExtraData: _shouldOmitExtraData,\n ...restFormProps\n } = props.formProps ?? {};\n\n const handleChange = useCallback(\n (e: IChangeEvent) => {\n setStepsState(current => {\n return { ...current, ...e.formData };\n });\n },\n [setStepsState],\n );\n\n const handleNext = useCallback(\n async ({ formData = {} }: { formData?: Record<string, JsonValue> }) => {\n // The validation should never throw, as the validators are wrapped in a try/catch.\n // This makes it fine to set and unset state without try/catch.\n setErrors(undefined);\n setIsValidating(true);\n\n const returnedValidation = await validation(formData);\n\n setStepsState(current => ({\n ...current,\n ...formData,\n }));\n\n setIsValidating(false);\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 },\n [validation, analytics],\n );\n\n useEffect(() => {\n const main = document.querySelector('main');\n if (main && typeof main.scrollTo === 'function') {\n main.scrollTo({ top: 0, behavior: 'auto' });\n }\n }, [activeStep]);\n\n const mergedUiSchema = merge({}, propUiSchema, currentStep?.uiSchema);\n\n const [isCreating, setIsCreating] = useState(false);\n\n const handleCreate = useCallback(async () => {\n setIsCreating(true);\n analytics.captureEvent('click', `${createLabel}`);\n try {\n await onCreate(stepsState);\n } finally {\n setIsCreating(false);\n }\n }, [analytics, createLabel, onCreate, stepsState]);\n\n return (\n <>\n {isValidating && <LinearProgress variant=\"indeterminate\" />}\n <MuiStepper\n activeStep={activeStep}\n alternativeLabel\n variant=\"elevation\"\n style={{ overflowX: 'auto' }}\n >\n {steps.map((step, index) => {\n const isAllowedLabelClick = activeStep > index;\n return (\n <MuiStep key={index}>\n <MuiStepLabel\n aria-label={t('stepper.stepIndexLabel', { index: index + 1 })}\n style={{ cursor: isAllowedLabelClick ? 'pointer' : 'default' }}\n onClick={() => {\n if (isAllowedLabelClick) setActiveStep(index);\n }}\n >\n {step.title}\n </MuiStepLabel>\n </MuiStep>\n );\n })}\n <MuiStep>\n <MuiStepLabel>{reviewLabel}</MuiStepLabel>\n </MuiStep>\n </MuiStepper>\n <div className={styles.formWrapper}>\n {/* eslint-disable-next-line no-nested-ternary */}\n {activeStep < steps.length ? (\n <Form\n key={activeStep}\n validator={validator}\n extraErrors={errors as unknown as ErrorSchema}\n formData={stepsState}\n formContext={{ ...propFormContext, formData: stepsState }}\n schema={currentStep.schema}\n uiSchema={mergedUiSchema}\n onSubmit={handleNext}\n fields={fields}\n showErrorList=\"top\"\n templates={{ ErrorListTemplate }}\n onChange={handleChange}\n widgets={{ password: PasswordWidget }}\n experimental_defaultFormStateBehavior={{\n allOf: 'populateDefaults',\n }}\n {...restFormProps}\n >\n <div className={styles.footer}>\n <Button\n onClick={handleBack}\n className={styles.backButton}\n disabled={activeStep < 1 || isValidating}\n >\n {backLabel}\n </Button>\n <Button\n variant=\"contained\"\n color=\"primary\"\n type=\"submit\"\n disabled={isValidating}\n >\n {activeStep === steps.length - 1\n ? reviewLabel\n : t('stepper.nextButtonText')}\n </Button>\n </div>\n </Form>\n ) : // TODO: potentially move away from this pattern, deprecate?\n ReviewStepComponent ? (\n <ReviewStepComponent\n disableButtons={isValidating}\n formData={stepsState}\n handleBack={handleBack}\n handleReset={() => {}}\n steps={steps}\n handleCreate={handleCreate}\n />\n ) : (\n <>\n <ReviewStateComponent formState={stepsState} schemas={steps} />\n <div className={styles.footer}>\n <Button\n onClick={handleBack}\n className={styles.backButton}\n disabled={activeStep < 1}\n >\n {backLabel}\n </Button>\n <Button\n disabled={isCreating}\n variant=\"contained\"\n color=\"primary\"\n onClick={handleCreate}\n >\n {createLabel}\n </Button>\n </div>\n </>\n )}\n </div>\n </>\n );\n};\n"],"names":["FieldOverrides","validation"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2DA,MAAM,YAAY,kBAAmB,EAAA;AACrC,SAAA,CAAU,UAAU,GAAG,CAAA;AAQvB,MAAM,SAAY,GAAA,UAAA;AAAA,EAChB,CAAU,KAAA,MAAA;AAAA,IACR,UAAY,EAAA;AAAA,MACV,WAAA,EAAa,KAAM,CAAA,OAAA,CAAQ,CAAC;AAAA,KAC9B;AAAA,IACA,MAAQ,EAAA;AAAA,MACN,OAAS,EAAA,MAAA;AAAA,MACT,aAAe,EAAA,KAAA;AAAA,MACf,cAAgB,EAAA,OAAA;AAAA,MAChB,SAAA,EAAW,KAAM,CAAA,OAAA,CAAQ,CAAC;AAAA,KAC5B;AAAA,IACA,WAAa,EAAA;AAAA,MACX,OAAA,EAAS,KAAM,CAAA,OAAA,CAAQ,CAAC;AAAA;AAC1B,GACF,CAAA;AAAA,EACA,EAAE,MAAM,0BAA2B;AACrC,CAAA;AAgCa,MAAA,OAAA,GAAU,CAAC,YAA+B,KAAA;AACrD,EAAA,MAAM,EAAE,CAAA,EAAM,GAAA,iBAAA,CAAkB,6BAA6B,CAAA;AAC7D,EAAM,MAAA,EAAE,OAAU,GAAA,EAAI,EAAA,UAAA,GAAa,EAAI,EAAA,QAAA,EAAU,GAAG,KAAA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AA,OACF,EAAA;AAAA,KAEJ,EAAA;AAAA,GACF,EAAA,CAAA;AAEJ;;;;"}
|
|
1
|
+
{"version":3,"file":"Stepper.esm.js","sources":["../../../../src/next/components/Stepper/Stepper.tsx"],"sourcesContent":["/*\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 { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport {\n FieldExtensionOptions,\n FormProps,\n LayoutOptions,\n ReviewStepProps,\n TemplateParameterSchema,\n} from '@backstage/plugin-scaffolder-react';\nimport { JsonValue } from '@backstage/types';\nimport Button from '@material-ui/core/Button';\nimport LinearProgress from '@material-ui/core/LinearProgress';\nimport MuiStep from '@material-ui/core/Step';\nimport MuiStepLabel from '@material-ui/core/StepLabel';\nimport MuiStepper from '@material-ui/core/Stepper';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { type IChangeEvent } from '@rjsf/core';\nimport { ErrorSchema } from '@rjsf/utils';\nimport { customizeValidator } from '@rjsf/validator-ajv8';\nimport ajvErrors from 'ajv-errors';\nimport { merge } from 'lodash';\nimport {\n ComponentType,\n useCallback,\n useEffect,\n useMemo,\n useState,\n type ReactNode,\n} from 'react';\n\nimport { scaffolderReactTranslationRef } from '../../../translation';\nimport { useFormDataFromQuery, useTemplateSchema } from '../../hooks';\nimport { useTransformSchemaToProps } from '../../hooks/useTransformSchemaToProps';\nimport { Form } from '../Form';\nimport { PasswordWidget } from '../PasswordWidget/PasswordWidget';\nimport { ReviewState, type ReviewStateProps } from '../ReviewState';\nimport {\n createAsyncValidators,\n type FormValidation,\n} from './createAsyncValidators';\nimport { ErrorListTemplate } from './ErrorListTemplate';\nimport * as FieldOverrides from './FieldOverrides';\nimport { hasErrors } from './utils';\n\nconst validator = customizeValidator();\najvErrors(validator.ajv);\n\n/** @alpha */\nexport type BackstageTemplateStepperClassKey =\n | 'backButton'\n | 'footer'\n | 'formWrapper';\n\nconst useStyles = makeStyles(\n theme => ({\n backButton: {\n marginRight: theme.spacing(1),\n },\n footer: {\n display: 'flex',\n flexDirection: 'row',\n justifyContent: 'right',\n marginTop: theme.spacing(2),\n },\n formWrapper: {\n padding: theme.spacing(2),\n },\n }),\n { name: 'BackstageTemplateStepper' },\n);\n\n/**\n * The Props for {@link Stepper} component\n * @alpha\n */\nexport type StepperProps = {\n manifest: TemplateParameterSchema;\n extensions: FieldExtensionOptions<any, any>[];\n /**\n * @deprecated This was only ever used for analytics tracking purposes, which\n * is now handled in the `<Workflow />` component. Passing it in will have no\n * effect.\n */\n templateName?: string;\n formProps?: FormProps;\n initialState?: Record<string, JsonValue>;\n onCreate: (values: Record<string, JsonValue>) => Promise<void>;\n components?: {\n ReviewStepComponent?: ComponentType<ReviewStepProps>;\n ReviewStateComponent?: (props: ReviewStateProps) => JSX.Element;\n backButtonText?: ReactNode;\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 { t } = useTranslationRef(scaffolderReactTranslationRef);\n const { layouts = [], components = {}, onCreate, ...props } = stepperProps;\n const {\n ReviewStateComponent = ReviewState,\n ReviewStepComponent,\n backButtonText = t('stepper.backButtonText'),\n createButtonText = t('stepper.createButtonText'),\n reviewButtonText = t('stepper.reviewButtonText'),\n } = components;\n const analytics = useAnalytics();\n const { presentation, steps } = useTemplateSchema(props.manifest);\n const apiHolder = useApiHolder();\n const [activeStep, setActiveStep] = useState(0);\n const [isValidating, setIsValidating] = useState(false);\n const [initialState] = useFormDataFromQuery(props.initialState);\n const [stepsState, setStepsState] =\n useState<Record<string, JsonValue>>(initialState);\n\n const [errors, setErrors] = useState<undefined | FormValidation>();\n const styles = useStyles();\n\n const backLabel =\n presentation?.buttonLabels?.backButtonText ?? backButtonText;\n const createLabel =\n presentation?.buttonLabels?.createButtonText ?? createButtonText;\n const reviewLabel =\n presentation?.buttonLabels?.reviewButtonText ?? reviewButtonText;\n\n const extensions = useMemo(() => {\n return Object.fromEntries(\n props.extensions.map(({ name, component }) => [name, component]),\n );\n }, [props.extensions]);\n\n const fields = useMemo(\n () => ({ ...FieldOverrides, ...extensions }),\n [extensions],\n );\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 = useCallback(() => {\n setActiveStep(prevActiveStep => prevActiveStep - 1);\n }, [setActiveStep]);\n\n const currentStep = useTransformSchemaToProps(steps[activeStep], { layouts });\n\n const {\n formContext: propFormContext,\n uiSchema: propUiSchema,\n liveOmit: _shouldLiveOmit,\n omitExtraData: _shouldOmitExtraData,\n ...restFormProps\n } = props.formProps ?? {};\n\n const handleChange = useCallback(\n (e: IChangeEvent) => {\n setStepsState(current => {\n return { ...current, ...e.formData };\n });\n },\n [setStepsState],\n );\n\n const handleNext = useCallback(\n async ({ formData = {} }: { formData?: Record<string, JsonValue> }) => {\n // The validation should never throw, as the validators are wrapped in a try/catch.\n // This makes it fine to set and unset state without try/catch.\n setErrors(undefined);\n setIsValidating(true);\n\n const returnedValidation = await validation(formData);\n\n setStepsState(current => ({\n ...current,\n ...formData,\n }));\n\n setIsValidating(false);\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 },\n [validation, analytics],\n );\n\n useEffect(() => {\n const main = document.querySelector('main');\n if (main && typeof main.scrollTo === 'function') {\n main.scrollTo({ top: 0, behavior: 'auto' });\n }\n }, [activeStep]);\n\n const mergedUiSchema = merge({}, propUiSchema, currentStep?.uiSchema);\n\n const [isCreating, setIsCreating] = useState(false);\n\n const handleCreate = useCallback(async () => {\n setIsCreating(true);\n analytics.captureEvent('click', `${createLabel}`);\n try {\n await onCreate(stepsState);\n } finally {\n setIsCreating(false);\n }\n }, [analytics, createLabel, onCreate, stepsState]);\n\n return (\n <>\n {isValidating && <LinearProgress variant=\"indeterminate\" />}\n <MuiStepper\n activeStep={activeStep}\n alternativeLabel\n variant=\"elevation\"\n style={{ overflowX: 'auto' }}\n >\n {steps.map((step, index) => {\n const isAllowedLabelClick = activeStep > index;\n return (\n <MuiStep key={index}>\n <MuiStepLabel\n aria-label={t('stepper.stepIndexLabel', { index: index + 1 })}\n style={{ cursor: isAllowedLabelClick ? 'pointer' : 'default' }}\n onClick={() => {\n if (isAllowedLabelClick) setActiveStep(index);\n }}\n >\n {step.title}\n </MuiStepLabel>\n </MuiStep>\n );\n })}\n <MuiStep>\n <MuiStepLabel>{reviewLabel}</MuiStepLabel>\n </MuiStep>\n </MuiStepper>\n <div className={styles.formWrapper}>\n {/* eslint-disable-next-line no-nested-ternary */}\n {activeStep < steps.length ? (\n <Form\n key={activeStep}\n validator={validator}\n extraErrors={errors as unknown as ErrorSchema}\n formData={stepsState}\n formContext={{ ...propFormContext, formData: stepsState }}\n schema={currentStep.schema}\n uiSchema={mergedUiSchema}\n onSubmit={handleNext}\n fields={fields}\n showErrorList=\"top\"\n templates={{ ErrorListTemplate }}\n onChange={handleChange}\n widgets={{ password: PasswordWidget }}\n experimental_defaultFormStateBehavior={{\n allOf: 'populateDefaults',\n }}\n {...restFormProps}\n >\n <div className={styles.footer}>\n <Button\n onClick={handleBack}\n className={styles.backButton}\n disabled={activeStep < 1 || isValidating}\n >\n {backLabel}\n </Button>\n <Button\n variant=\"contained\"\n color=\"primary\"\n type=\"submit\"\n disabled={isValidating}\n >\n {activeStep === steps.length - 1\n ? reviewLabel\n : t('stepper.nextButtonText')}\n </Button>\n </div>\n </Form>\n ) : // TODO: potentially move away from this pattern, deprecate?\n ReviewStepComponent ? (\n <ReviewStepComponent\n disableButtons={isValidating}\n formData={stepsState}\n handleBack={handleBack}\n handleReset={() => {}}\n steps={steps}\n handleCreate={handleCreate}\n />\n ) : (\n <>\n <ReviewStateComponent formState={stepsState} schemas={steps} />\n <div className={styles.footer}>\n <Button\n onClick={handleBack}\n className={styles.backButton}\n disabled={activeStep < 1}\n >\n {backLabel}\n </Button>\n <Button\n disabled={isCreating}\n variant=\"contained\"\n color=\"primary\"\n onClick={handleCreate}\n >\n {createLabel}\n </Button>\n </div>\n </>\n )}\n </div>\n </>\n );\n};\n"],"names":["FieldOverrides","validation"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2DA,MAAM,YAAY,kBAAA,EAAmB;AACrC,SAAA,CAAU,UAAU,GAAG,CAAA;AAQvB,MAAM,SAAA,GAAY,UAAA;AAAA,EAChB,CAAA,KAAA,MAAU;AAAA,IACR,UAAA,EAAY;AAAA,MACV,WAAA,EAAa,KAAA,CAAM,OAAA,CAAQ,CAAC;AAAA,KAC9B;AAAA,IACA,MAAA,EAAQ;AAAA,MACN,OAAA,EAAS,MAAA;AAAA,MACT,aAAA,EAAe,KAAA;AAAA,MACf,cAAA,EAAgB,OAAA;AAAA,MAChB,SAAA,EAAW,KAAA,CAAM,OAAA,CAAQ,CAAC;AAAA,KAC5B;AAAA,IACA,WAAA,EAAa;AAAA,MACX,OAAA,EAAS,KAAA,CAAM,OAAA,CAAQ,CAAC;AAAA;AAC1B,GACF,CAAA;AAAA,EACA,EAAE,MAAM,0BAAA;AACV,CAAA;AAgCO,MAAM,OAAA,GAAU,CAAC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GAAa,CAAA;AAAA,cAEtB,QAAA,EAAA;AAAA;AAAA,WACH;AAAA,0BACA,GAAA;AAAA,YAAC,MAAA;AAAA,YAAA;AAAA,cACC,QAAA,EAAU,UAAA;AAAA,cACV,OAAA,EAAQ,WAAA;AAAA,cACR,KAAA,EAAM,SAAA;AAAA,cACN,OAAA,EAAS,YAAA;AAAA,cAER,QAAA,EAAA;AAAA;AAAA;AACH,SAAA,EACF;AAAA,OAAA,EACF;AAAA,KAAA,EAEJ;AAAA,GAAA,EACF,CAAA;AAEJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createAsyncValidators.esm.js","sources":["../../../../src/next/components/Stepper/createAsyncValidators.ts"],"sourcesContent":["/*\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 {\n Draft07 as JSONSchema,\n JsonError,\n JsonSchema,\n} from 'json-schema-library';\nimport { createFieldValidation, extractSchemaFromStep } from '../../lib';\nimport {\n CustomFieldValidator,\n FieldExtensionUiSchema,\n} from '@backstage/plugin-scaffolder-react';\nimport { isObject } from './utils';\n\n/** @alpha */\nexport type FormValidation = {\n [name: string]: FieldValidation | FormValidation;\n};\n\nconst isJsonError = (\n value: JsonError | JsonSchema,\n): value is { type: 'error'; message: string } =>\n 'type' in value && value.type === 'error';\n\n/** @alpha */\nexport const createAsyncValidators = (\n rootSchema: JsonObject,\n validators: Record<\n string,\n undefined | CustomFieldValidator<unknown, unknown>\n >,\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 schema: JsonObject,\n uiSchema: FieldExtensionUiSchema<unknown, unknown>,\n ) => {\n const validator = validators[validatorName];\n if (validator) {\n const fieldValidation = createFieldValidation();\n try {\n await validator(value, fieldValidation, {\n ...context,\n formData,\n schema,\n uiSchema,\n });\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 pointer = `${pathPrefix}/${key}`;\n const definitionInSchema = parsedSchema.getSchema({\n pointer,\n data: formData,\n });\n\n if (!definitionInSchema) {\n continue;\n }\n\n if (isJsonError(definitionInSchema)) {\n throw new Error(definitionInSchema.message);\n }\n\n const { schema, uiSchema } = extractSchemaFromStep(\n definitionInSchema as JsonObject,\n );\n\n const hasItems = definitionInSchema && definitionInSchema.items;\n\n const doValidateItem = async (\n propValue: JsonObject,\n itemSchema: JsonObject,\n itemUiSchema: FieldExtensionUiSchema<unknown, unknown>,\n ) => {\n await validateForm(\n propValue['ui:field'] as string,\n key,\n value,\n itemSchema,\n itemUiSchema,\n );\n };\n\n const doValidate = async (propValue: JsonObject) => {\n if ('ui:field' in propValue) {\n const { schema: itemsSchema, uiSchema: itemsUiSchema } =\n extractSchemaFromStep(definitionInSchema.items);\n await doValidateItem(propValue, itemsSchema, itemsUiSchema);\n }\n };\n\n const doValidateDependency = async (propValue: JsonObject) => {\n const { schema: itemsSchema, uiSchema: itemsUiSchema } =\n extractSchemaFromStep(propValue);\n await doValidateItem(propValue, itemsSchema, itemsUiSchema);\n\n const iterable = Array.isArray(value) ? value : [value];\n for (const item of iterable) {\n if (item && isObject(item)) {\n const keys = Object.keys(item);\n for (const k of keys) {\n if (itemsUiSchema[k] && 'ui:field' in itemsUiSchema[k]) {\n await validateForm(\n itemsUiSchema[k]['ui:field'],\n k,\n item[k],\n itemsSchema,\n itemsUiSchema,\n );\n }\n }\n }\n }\n };\n\n if ('ui:field' in definitionInSchema) {\n await doValidateItem(definitionInSchema, schema, uiSchema);\n } else if (hasItems && 'ui:field' in definitionInSchema.items) {\n await doValidate(definitionInSchema.items);\n } else if (hasItems && definitionInSchema.items.type === 'object') {\n const properties = (definitionInSchema.items?.properties ??\n []) as JsonObject[];\n for (const [, propValue] of Object.entries(properties)) {\n await doValidate(propValue);\n }\n\n const dependencies = (definitionInSchema.items?.dependencies ??\n []) as JsonObject[];\n for (const [, propValue] of Object.entries(dependencies)) {\n await doValidateDependency(propValue);\n }\n } else if (isObject(value)) {\n formValidation[key] = await validate(formData, pointer, value);\n }\n }\n\n return formValidation;\n }\n\n return async (formData: JsonObject) => {\n return await validate(formData);\n };\n};\n"],"names":["JSONSchema"],"mappings":";;;;AAoCA,MAAM,cAAc,CAClB,KAAA,KAEA,
|
|
1
|
+
{"version":3,"file":"createAsyncValidators.esm.js","sources":["../../../../src/next/components/Stepper/createAsyncValidators.ts"],"sourcesContent":["/*\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 {\n Draft07 as JSONSchema,\n JsonError,\n JsonSchema,\n} from 'json-schema-library';\nimport { createFieldValidation, extractSchemaFromStep } from '../../lib';\nimport {\n CustomFieldValidator,\n FieldExtensionUiSchema,\n} from '@backstage/plugin-scaffolder-react';\nimport { isObject } from './utils';\n\n/** @alpha */\nexport type FormValidation = {\n [name: string]: FieldValidation | FormValidation;\n};\n\nconst isJsonError = (\n value: JsonError | JsonSchema,\n): value is { type: 'error'; message: string } =>\n 'type' in value && value.type === 'error';\n\n/** @alpha */\nexport const createAsyncValidators = (\n rootSchema: JsonObject,\n validators: Record<\n string,\n undefined | CustomFieldValidator<unknown, unknown>\n >,\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 schema: JsonObject,\n uiSchema: FieldExtensionUiSchema<unknown, unknown>,\n ) => {\n const validator = validators[validatorName];\n if (validator) {\n const fieldValidation = createFieldValidation();\n try {\n await validator(value, fieldValidation, {\n ...context,\n formData,\n schema,\n uiSchema,\n });\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 pointer = `${pathPrefix}/${key}`;\n const definitionInSchema = parsedSchema.getSchema({\n pointer,\n data: formData,\n });\n\n if (!definitionInSchema) {\n continue;\n }\n\n if (isJsonError(definitionInSchema)) {\n throw new Error(definitionInSchema.message);\n }\n\n const { schema, uiSchema } = extractSchemaFromStep(\n definitionInSchema as JsonObject,\n );\n\n const hasItems = definitionInSchema && definitionInSchema.items;\n\n const doValidateItem = async (\n propValue: JsonObject,\n itemSchema: JsonObject,\n itemUiSchema: FieldExtensionUiSchema<unknown, unknown>,\n ) => {\n await validateForm(\n propValue['ui:field'] as string,\n key,\n value,\n itemSchema,\n itemUiSchema,\n );\n };\n\n const doValidate = async (propValue: JsonObject) => {\n if ('ui:field' in propValue) {\n const { schema: itemsSchema, uiSchema: itemsUiSchema } =\n extractSchemaFromStep(definitionInSchema.items);\n await doValidateItem(propValue, itemsSchema, itemsUiSchema);\n }\n };\n\n const doValidateDependency = async (propValue: JsonObject) => {\n const { schema: itemsSchema, uiSchema: itemsUiSchema } =\n extractSchemaFromStep(propValue);\n await doValidateItem(propValue, itemsSchema, itemsUiSchema);\n\n const iterable = Array.isArray(value) ? value : [value];\n for (const item of iterable) {\n if (item && isObject(item)) {\n const keys = Object.keys(item);\n for (const k of keys) {\n if (itemsUiSchema[k] && 'ui:field' in itemsUiSchema[k]) {\n await validateForm(\n itemsUiSchema[k]['ui:field'],\n k,\n item[k],\n itemsSchema,\n itemsUiSchema,\n );\n }\n }\n }\n }\n };\n\n if ('ui:field' in definitionInSchema) {\n await doValidateItem(definitionInSchema, schema, uiSchema);\n } else if (hasItems && 'ui:field' in definitionInSchema.items) {\n await doValidate(definitionInSchema.items);\n } else if (hasItems && definitionInSchema.items.type === 'object') {\n const properties = (definitionInSchema.items?.properties ??\n []) as JsonObject[];\n for (const [, propValue] of Object.entries(properties)) {\n await doValidate(propValue);\n }\n\n const dependencies = (definitionInSchema.items?.dependencies ??\n []) as JsonObject[];\n for (const [, propValue] of Object.entries(dependencies)) {\n await doValidateDependency(propValue);\n }\n } else if (isObject(value)) {\n formValidation[key] = await validate(formData, pointer, value);\n }\n }\n\n return formValidation;\n }\n\n return async (formData: JsonObject) => {\n return await validate(formData);\n };\n};\n"],"names":["JSONSchema"],"mappings":";;;;AAoCA,MAAM,cAAc,CAClB,KAAA,KAEA,MAAA,IAAU,KAAA,IAAS,MAAM,IAAA,KAAS,OAAA;AAG7B,MAAM,qBAAA,GAAwB,CACnC,UAAA,EACA,UAAA,EAIA,OAAA,KAGG;AACH,EAAA,eAAe,QAAA,CACb,QAAA,EACA,UAAA,GAAqB,GAAA,EACrB,UAAsB,QAAA,EACG;AACzB,IAAA,MAAM,YAAA,GAAe,IAAIA,OAAA,CAAW,UAAU,CAAA;AAC9C,IAAA,MAAM,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ors\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 if (hasErrors(error)) {\n return true;\n }\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"],"names":[],"mappings":"AAmBA,SAAS,kBAAkB,
|
|
1
|
+
{"version":3,"file":"utils.esm.js","sources":["../../../../src/next/components/Stepper/utils.ts"],"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 */\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 if (hasErrors(error)) {\n return true;\n }\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"],"names":[],"mappings":"AAmBA,SAAS,kBAAkB,KAAA,EAAsC;AAC/D,EAAA,OAAO,CAAC,CAAC,KAAA,IAAS,UAAA,IAAc,KAAA;AAClC;AAEO,SAAS,UAAU,MAAA,EAAkC;AAC1D,EAAA,IAAI,CAAC,MAAA,EAAQ;AACX,IAAA,OAAO,KAAA;AAAA,EACT;AAEA,EAAA,KAAA,MAAW,KAAA,IAAS,MAAA,CAAO,MAAA,CAAO,MAAM,CAAA,EAAG;AACzC,IAAA,IAAI,iBAAA,CAAkB,KAAK,CAAA,EAAG;AAC5B,MAAA,IAAA,CAAK,KAAA,CAAM,QAAA,IAAY,EAAC,EAAG,SAAS,CAAA,EAAG;AACrC,QAAA,OAAO,IAAA;AAAA,MACT;AAEA,MAAA;AAAA,IACF;AAEA,IAAA,IAAI,SAAA,CAAU,KAAK,CAAA,EAAG;AACpB,MAAA,OAAO,IAAA;AAAA,IACT;AAAA,EACF;AAEA,EAAA,OAAO,KAAA;AACT;AAEO,SAAS,SAAS,KAAA,EAAmD;AAC1E,EAAA,OAAO,OAAO,UAAU,QAAA,IAAY,KAAA,KAAU,QAAQ,CAAC,KAAA,CAAM,QAAQ,KAAK,CAAA;AAC5E;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TaskLogStream.esm.js","sources":["../../../../src/next/components/TaskLogStream/TaskLogStream.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 */\nimport { LogViewer } from '@backstage/core-components';\nimport { makeStyles } from '@material-ui/core/styles';\n\nconst useStyles = makeStyles({\n root: {\n width: '100%',\n height: '100%',\n position: 'relative',\n },\n});\n\n/**\n * The text of the event stream\n *\n * @alpha\n */\nexport const TaskLogStream = (props: { logs: { [k: string]: string[] } }) => {\n const styles = useStyles();\n return (\n <div className={styles.root}>\n <LogViewer\n text={Object.values(props.logs)\n .map(l => l.join('\\n'))\n .filter(Boolean)\n .join('\\n')}\n />\n </div>\n );\n};\n"],"names":[],"mappings":";;;;AAkBA,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"TaskLogStream.esm.js","sources":["../../../../src/next/components/TaskLogStream/TaskLogStream.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 */\nimport { LogViewer } from '@backstage/core-components';\nimport { makeStyles } from '@material-ui/core/styles';\n\nconst useStyles = makeStyles({\n root: {\n width: '100%',\n height: '100%',\n position: 'relative',\n },\n});\n\n/**\n * The text of the event stream\n *\n * @alpha\n */\nexport const TaskLogStream = (props: { logs: { [k: string]: string[] } }) => {\n const styles = useStyles();\n return (\n <div className={styles.root}>\n <LogViewer\n text={Object.values(props.logs)\n .map(l => l.join('\\n'))\n .filter(Boolean)\n .join('\\n')}\n />\n </div>\n );\n};\n"],"names":[],"mappings":";;;;AAkBA,MAAM,YAAY,UAAA,CAAW;AAAA,EAC3B,IAAA,EAAM;AAAA,IACJ,KAAA,EAAO,MAAA;AAAA,IACP,MAAA,EAAQ,MAAA;AAAA,IACR,QAAA,EAAU;AAAA;AAEd,CAAC,CAAA;AAOM,MAAM,aAAA,GAAgB,CAAC,KAAA,KAA+C;AAC3E,EAAA,MAAM,SAAS,SAAA,EAAU;AACzB,EAAA,uBACE,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,MAAA,CAAO,IAAA,EACrB,QAAA,kBAAA,GAAA;AAAA,IAAC,SAAA;AAAA,IAAA;AAAA,MACC,MAAM,MAAA,CAAO,MAAA,CAAO,KAAA,CAAM,IAAI,EAC3B,GAAA,CAAI,CAAA,CAAA,KAAK,CAAA,CAAE,IAAA,CAAK,IAAI,CAAC,CAAA,CACrB,OAAO,OAAO,CAAA,CACd,KAAK,IAAI;AAAA;AAAA,GACd,EACF,CAAA;AAEJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StepIcon.esm.js","sources":["../../../../src/next/components/TaskSteps/StepIcon.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\nimport CircularProgress from '@material-ui/core/CircularProgress';\nimport { StepIconProps } from '@material-ui/core/StepIcon';\nimport { makeStyles } from '@material-ui/core/styles';\nimport RemoveCircleOutline from '@material-ui/icons/RemoveCircleOutline';\nimport PanoramaFishEyeIcon from '@material-ui/icons/PanoramaFishEye';\nimport classNames from 'classnames';\nimport CheckCircleOutline from '@material-ui/icons/CheckCircleOutline';\nimport ErrorOutline from '@material-ui/icons/ErrorOutline';\n\nconst useStepIconStyles = makeStyles(theme => ({\n root: {\n color: theme.palette.text.disabled,\n },\n completed: {\n color: theme.palette.status.ok,\n },\n error: {\n color: theme.palette.status.error,\n },\n}));\n\nexport const StepIcon = (props: StepIconProps & { skipped: boolean }) => {\n const classes = useStepIconStyles();\n const { active, completed, error, skipped } = props;\n\n const getMiddle = () => {\n if (active) {\n return <CircularProgress size=\"20px\" />;\n }\n if (completed) {\n return <CheckCircleOutline />;\n }\n\n if (error) {\n return <ErrorOutline />;\n }\n\n if (skipped) {\n return <RemoveCircleOutline />;\n }\n\n return <PanoramaFishEyeIcon />;\n };\n\n return (\n <div\n className={classNames(classes.root, {\n [classes.completed]: completed,\n [classes.error]: error,\n })}\n >\n {getMiddle()}\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AAyBA,MAAM,iBAAA,GAAoB,WAAW,
|
|
1
|
+
{"version":3,"file":"StepIcon.esm.js","sources":["../../../../src/next/components/TaskSteps/StepIcon.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\nimport CircularProgress from '@material-ui/core/CircularProgress';\nimport { StepIconProps } from '@material-ui/core/StepIcon';\nimport { makeStyles } from '@material-ui/core/styles';\nimport RemoveCircleOutline from '@material-ui/icons/RemoveCircleOutline';\nimport PanoramaFishEyeIcon from '@material-ui/icons/PanoramaFishEye';\nimport classNames from 'classnames';\nimport CheckCircleOutline from '@material-ui/icons/CheckCircleOutline';\nimport ErrorOutline from '@material-ui/icons/ErrorOutline';\n\nconst useStepIconStyles = makeStyles(theme => ({\n root: {\n color: theme.palette.text.disabled,\n },\n completed: {\n color: theme.palette.status.ok,\n },\n error: {\n color: theme.palette.status.error,\n },\n}));\n\nexport const StepIcon = (props: StepIconProps & { skipped: boolean }) => {\n const classes = useStepIconStyles();\n const { active, completed, error, skipped } = props;\n\n const getMiddle = () => {\n if (active) {\n return <CircularProgress size=\"20px\" />;\n }\n if (completed) {\n return <CheckCircleOutline />;\n }\n\n if (error) {\n return <ErrorOutline />;\n }\n\n if (skipped) {\n return <RemoveCircleOutline />;\n }\n\n return <PanoramaFishEyeIcon />;\n };\n\n return (\n <div\n className={classNames(classes.root, {\n [classes.completed]: completed,\n [classes.error]: error,\n })}\n >\n {getMiddle()}\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AAyBA,MAAM,iBAAA,GAAoB,WAAW,CAAA,KAAA,MAAU;AAAA,EAC7C,IAAA,EAAM;AAAA,IACJ,KAAA,EAAO,KAAA,CAAM,OAAA,CAAQ,IAAA,CAAK;AAAA,GAC5B;AAAA,EACA,SAAA,EAAW;AAAA,IACT,KAAA,EAAO,KAAA,CAAM,OAAA,CAAQ,MAAA,CAAO;AAAA,GAC9B;AAAA,EACA,KAAA,EAAO;AAAA,IACL,KAAA,EAAO,KAAA,CAAM,OAAA,CAAQ,MAAA,CAAO;AAAA;AAEhC,CAAA,CAAE,CAAA;AAEK,MAAM,QAAA,GAAW,CAAC,KAAA,KAAgD;AACvE,EAAA,MAAM,UAAU,iBAAA,EAAkB;AAClC,EAAA,MAAM,EAAE,MAAA,EAAQ,SAAA,EAAW,KAAA,EAAO,SAAQ,GAAI,KAAA;AAE9C,EAAA,MAAM,YAAY,MAAM;AACtB,IAAA,IAAI,MAAA,EAAQ;AACV,MAAA,uBAAO,GAAA,CAAC,gBAAA,EAAA,EAAiB,IAAA,EAAK,MAAA,EAAO,CAAA;AAAA,IACvC;AACA,IAAA,IAAI,SAAA,EAAW;AACb,MAAA,2BAAQ,kBAAA,EAAA,EAAmB,CAAA;AAAA,IAC7B;AAEA,IAAA,IAAI,KAAA,EAAO;AACT,MAAA,2BAAQ,YAAA,EAAA,EAAa,CAAA;AAAA,IACvB;AAEA,IAAA,IAAI,OAAA,EAAS;AACX,MAAA,2BAAQ,mBAAA,EAAA,EAAoB,CAAA;AAAA,IAC9B;AAEA,IAAA,2BAAQ,mBAAA,EAAA,EAAoB,CAAA;AAAA,EAC9B,CAAA;AAEA,EAAA,uBACE,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAW,UAAA,CAAW,OAAA,CAAQ,IAAA,EAAM;AAAA,QAClC,CAAC,OAAA,CAAQ,SAAS,GAAG,SAAA;AAAA,QACrB,CAAC,OAAA,CAAQ,KAAK,GAAG;AAAA,OAClB,CAAA;AAAA,MAEA,QAAA,EAAA,SAAA;AAAU;AAAA,GACb;AAEJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StepTime.esm.js","sources":["../../../../src/next/components/TaskSteps/StepTime.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 */\nimport { useCallback, useState } from 'react';\nimport useInterval from 'react-use/esm/useInterval';\nimport { DateTime, Interval } from 'luxon';\nimport humanizeDuration from 'humanize-duration';\nimport Typography from '@material-ui/core/Typography';\nimport { useMountEffect } from '@react-hookz/web';\n\nexport const StepTime = (props: {\n step: {\n id: string;\n name: string;\n startedAt?: string;\n endedAt?: string;\n };\n}) => {\n const [time, setTime] = useState('');\n const { step } = props;\n\n const getDelay = () => {\n if (step.startedAt && step.endedAt && time) {\n return null;\n }\n if (step.startedAt && step.endedAt) {\n return 1;\n }\n return 1000;\n };\n\n const calculate = useCallback(() => {\n if (!step.startedAt) {\n setTime('');\n return;\n }\n\n const end = step.endedAt\n ? DateTime.fromISO(step.endedAt)\n : DateTime.local();\n\n const startedAt = DateTime.fromISO(step.startedAt);\n const formatted = Interval.fromDateTimes(startedAt, end)\n .toDuration()\n .valueOf();\n\n setTime(humanizeDuration(formatted, { round: true }));\n }, [step.endedAt, step.startedAt]);\n\n useMountEffect(calculate);\n useInterval(calculate, getDelay());\n\n return <Typography variant=\"caption\">{time}</Typography>;\n};\n"],"names":[],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"StepTime.esm.js","sources":["../../../../src/next/components/TaskSteps/StepTime.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 */\nimport { useCallback, useState } from 'react';\nimport useInterval from 'react-use/esm/useInterval';\nimport { DateTime, Interval } from 'luxon';\nimport humanizeDuration from 'humanize-duration';\nimport Typography from '@material-ui/core/Typography';\nimport { useMountEffect } from '@react-hookz/web';\n\nexport const StepTime = (props: {\n step: {\n id: string;\n name: string;\n startedAt?: string;\n endedAt?: string;\n };\n}) => {\n const [time, setTime] = useState('');\n const { step } = props;\n\n const getDelay = () => {\n if (step.startedAt && step.endedAt && time) {\n return null;\n }\n if (step.startedAt && step.endedAt) {\n return 1;\n }\n return 1000;\n };\n\n const calculate = useCallback(() => {\n if (!step.startedAt) {\n setTime('');\n return;\n }\n\n const end = step.endedAt\n ? DateTime.fromISO(step.endedAt)\n : DateTime.local();\n\n const startedAt = DateTime.fromISO(step.startedAt);\n const formatted = Interval.fromDateTimes(startedAt, end)\n .toDuration()\n .valueOf();\n\n setTime(humanizeDuration(formatted, { round: true }));\n }, [step.endedAt, step.startedAt]);\n\n useMountEffect(calculate);\n useInterval(calculate, getDelay());\n\n return <Typography variant=\"caption\">{time}</Typography>;\n};\n"],"names":[],"mappings":";;;;;;;;AAsBO,MAAM,QAAA,GAAW,CAAC,KAAA,KAOnB;AACJ,EAAA,MAAM,CAAC,IAAA,EAAM,OAAO,CAAA,GAAI,SAAS,EAAE,CAAA;AACnC,EAAA,MAAM,EAAE,MAAK,GAAI,KAAA;AAEjB,EAAA,MAAM,WAAW,MAAM;AACrB,IAAA,IAAI,IAAA,CAAK,SAAA,IAAa,IAAA,CAAK,OAAA,IAAW,IAAA,EAAM;AAC1C,MAAA,OAAO,IAAA;AAAA,IACT;AACA,IAAA,IAAI,IAAA,CAAK,SAAA,IAAa,IAAA,CAAK,OAAA,EAAS;AAClC,MAAA,OAAO,CAAA;AAAA,IACT;AACA,IAAA,OAAO,GAAA;AAAA,EACT,CAAA;AAEA,EAAA,MAAM,SAAA,GAAY,YAAY,MAAM;AAClC,IAAA,IAAI,CAAC,KAAK,SAAA,EAAW;AACnB,MAAA,OAAA,CAAQ,EAAE,CAAA;AACV,MAAA;AAAA,IACF;AAEA,IAAA,MAAM,GAAA,GAAM,KAAK,OAAA,GACb,QAAA,CAAS,QAAQ,IAAA,CAAK,OAAO,CAAA,GAC7B,QAAA,CAAS,KAAA,EAAM;AAEnB,IAAA,MAAM,SAAA,GAAY,QAAA,CAAS,OAAA,CAAQ,IAAA,CAAK,SAAS,CAAA;AACjD,IAAA,MAAM,SAAA,GAAY,SAAS,aAAA,CAAc,SAAA,EAAW,GAAG,CAAA,CACpD,UAAA,GACA,OAAA,EAAQ;AAEX,IAAA,OAAA,CAAQ,iBAAiB,SAAA,EAAW,EAAE,KAAA,EAAO,IAAA,EAAM,CAAC,CAAA;AAAA,EACtD,GAAG,CAAC,IAAA,CAAK,OAAA,EAAS,IAAA,CAAK,SAAS,CAAC,CAAA;AAEjC,EAAA,cAAA,CAAe,SAAS,CAAA;AACxB,EAAA,WAAA,CAAY,SAAA,EAAW,UAAU,CAAA;AAEjC,EAAA,uBAAO,GAAA,CAAC,UAAA,EAAA,EAAW,OAAA,EAAQ,SAAA,EAAW,QAAA,EAAA,IAAA,EAAK,CAAA;AAC7C;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TaskBorder.esm.js","sources":["../../../../src/next/components/TaskSteps/TaskBorder.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\nimport LinearProgress from '@material-ui/core/LinearProgress';\nimport { makeStyles } from '@material-ui/core/styles';\n\nconst useStyles = makeStyles(theme => ({\n failed: {\n backgroundColor: theme.palette.error.main,\n },\n success: {\n backgroundColor: theme.palette.success.main,\n },\n}));\n\n/**\n * The visual progress of the task event stream\n */\nexport const TaskBorder = (props: {\n isComplete: boolean;\n isError: boolean;\n}) => {\n const styles = useStyles();\n\n if (!props.isComplete) {\n return <LinearProgress variant=\"indeterminate\" />;\n }\n\n return (\n <LinearProgress\n variant=\"determinate\"\n classes={{ bar: props.isError ? styles.failed : styles.success }}\n value={100}\n />\n );\n};\n"],"names":[],"mappings":";;;;AAmBA,MAAM,SAAA,GAAY,WAAW,
|
|
1
|
+
{"version":3,"file":"TaskBorder.esm.js","sources":["../../../../src/next/components/TaskSteps/TaskBorder.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\nimport LinearProgress from '@material-ui/core/LinearProgress';\nimport { makeStyles } from '@material-ui/core/styles';\n\nconst useStyles = makeStyles(theme => ({\n failed: {\n backgroundColor: theme.palette.error.main,\n },\n success: {\n backgroundColor: theme.palette.success.main,\n },\n}));\n\n/**\n * The visual progress of the task event stream\n */\nexport const TaskBorder = (props: {\n isComplete: boolean;\n isError: boolean;\n}) => {\n const styles = useStyles();\n\n if (!props.isComplete) {\n return <LinearProgress variant=\"indeterminate\" />;\n }\n\n return (\n <LinearProgress\n variant=\"determinate\"\n classes={{ bar: props.isError ? styles.failed : styles.success }}\n value={100}\n />\n );\n};\n"],"names":[],"mappings":";;;;AAmBA,MAAM,SAAA,GAAY,WAAW,CAAA,KAAA,MAAU;AAAA,EACrC,MAAA,EAAQ;AAAA,IACN,eAAA,EAAiB,KAAA,CAAM,OAAA,CAAQ,KAAA,CAAM;AAAA,GACvC;AAAA,EACA,OAAA,EAAS;AAAA,IACP,eAAA,EAAiB,KAAA,CAAM,OAAA,CAAQ,OAAA,CAAQ;AAAA;AAE3C,CAAA,CAAE,CAAA;AAKK,MAAM,UAAA,GAAa,CAAC,KAAA,KAGrB;AACJ,EAAA,MAAM,SAAS,SAAA,EAAU;AAEzB,EAAA,IAAI,CAAC,MAAM,UAAA,EAAY;AACrB,IAAA,uBAAO,GAAA,CAAC,cAAA,EAAA,EAAe,OAAA,EAAQ,eAAA,EAAgB,CAAA;AAAA,EACjD;AAEA,EAAA,uBACE,GAAA;AAAA,IAAC,cAAA;AAAA,IAAA;AAAA,MACC,OAAA,EAAQ,aAAA;AAAA,MACR,OAAA,EAAS,EAAE,GAAA,EAAK,KAAA,CAAM,UAAU,MAAA,CAAO,MAAA,GAAS,OAAO,OAAA,EAAQ;AAAA,MAC/D,KAAA,EAAO;AAAA;AAAA,GACT;AAEJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TaskSteps.esm.js","sources":["../../../../src/next/components/TaskSteps/TaskSteps.tsx"],"sourcesContent":["/*\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 MuiStepper from '@material-ui/core/Stepper';\nimport MuiStep from '@material-ui/core/Step';\nimport MuiStepButton from '@material-ui/core/StepButton';\nimport MuiStepLabel from '@material-ui/core/StepLabel';\nimport { StepIconProps } from '@material-ui/core/StepIcon';\nimport Box from '@material-ui/core/Box';\nimport Paper from '@material-ui/core/Paper';\nimport { TaskStep } from '@backstage/plugin-scaffolder-common';\nimport { StepIcon } from './StepIcon';\nimport { StepTime } from './StepTime';\nimport { TaskBorder } from './TaskBorder';\nimport { ScaffolderStep } from '@backstage/plugin-scaffolder-react';\n\n/**\n * Props for the TaskSteps component\n *\n * @alpha\n */\nexport interface TaskStepsProps {\n steps: (TaskStep & ScaffolderStep)[];\n activeStep?: number;\n isComplete?: boolean;\n isError?: boolean;\n}\n\n/**\n * The visual stepper of the task event stream\n *\n * @alpha\n */\nexport const TaskSteps = (props: TaskStepsProps) => {\n return (\n <Paper style={{ position: 'relative', overflow: 'hidden' }}>\n <TaskBorder\n isComplete={props.isComplete ?? false}\n isError={props.isError ?? false}\n />\n <Box padding={2}>\n <MuiStepper\n activeStep={props.activeStep}\n alternativeLabel\n variant=\"elevation\"\n style={{ overflowX: 'auto' }}\n >\n {props.steps.map(step => {\n const isCompleted = step.status === 'completed';\n const isFailed = step.status === 'failed';\n const isActive = step.status === 'processing';\n const isSkipped = step.status === 'skipped';\n const stepIconProps: Partial<StepIconProps & { skipped: boolean }> =\n {\n completed: isCompleted,\n error: isFailed,\n active: isActive,\n skipped: isSkipped,\n };\n\n return (\n <MuiStep key={step.id}>\n <MuiStepButton>\n <MuiStepLabel\n StepIconProps={stepIconProps}\n StepIconComponent={StepIcon}\n data-testid=\"step-label\"\n >\n <Box>{step.name}</Box>\n {!isSkipped && <StepTime step={step} />}\n </MuiStepLabel>\n </MuiStepButton>\n </MuiStep>\n );\n })}\n </MuiStepper>\n </Box>\n </Paper>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"TaskSteps.esm.js","sources":["../../../../src/next/components/TaskSteps/TaskSteps.tsx"],"sourcesContent":["/*\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 MuiStepper from '@material-ui/core/Stepper';\nimport MuiStep from '@material-ui/core/Step';\nimport MuiStepButton from '@material-ui/core/StepButton';\nimport MuiStepLabel from '@material-ui/core/StepLabel';\nimport { StepIconProps } from '@material-ui/core/StepIcon';\nimport Box from '@material-ui/core/Box';\nimport Paper from '@material-ui/core/Paper';\nimport { TaskStep } from '@backstage/plugin-scaffolder-common';\nimport { StepIcon } from './StepIcon';\nimport { StepTime } from './StepTime';\nimport { TaskBorder } from './TaskBorder';\nimport { ScaffolderStep } from '@backstage/plugin-scaffolder-react';\n\n/**\n * Props for the TaskSteps component\n *\n * @alpha\n */\nexport interface TaskStepsProps {\n steps: (TaskStep & ScaffolderStep)[];\n activeStep?: number;\n isComplete?: boolean;\n isError?: boolean;\n}\n\n/**\n * The visual stepper of the task event stream\n *\n * @alpha\n */\nexport const TaskSteps = (props: TaskStepsProps) => {\n return (\n <Paper style={{ position: 'relative', overflow: 'hidden' }}>\n <TaskBorder\n isComplete={props.isComplete ?? false}\n isError={props.isError ?? false}\n />\n <Box padding={2}>\n <MuiStepper\n activeStep={props.activeStep}\n alternativeLabel\n variant=\"elevation\"\n style={{ overflowX: 'auto' }}\n >\n {props.steps.map(step => {\n const isCompleted = step.status === 'completed';\n const isFailed = step.status === 'failed';\n const isActive = step.status === 'processing';\n const isSkipped = step.status === 'skipped';\n const stepIconProps: Partial<StepIconProps & { skipped: boolean }> =\n {\n completed: isCompleted,\n error: isFailed,\n active: isActive,\n skipped: isSkipped,\n };\n\n return (\n <MuiStep key={step.id}>\n <MuiStepButton>\n <MuiStepLabel\n StepIconProps={stepIconProps}\n StepIconComponent={StepIcon}\n data-testid=\"step-label\"\n >\n <Box>{step.name}</Box>\n {!isSkipped && <StepTime step={step} />}\n </MuiStepLabel>\n </MuiStepButton>\n </MuiStep>\n );\n })}\n </MuiStepper>\n </Box>\n </Paper>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;AA6CO,MAAM,SAAA,GAAY,CAAC,KAAA,KAA0B;AAClD,EAAA,uBACE,IAAA,CAAC,SAAM,KAAA,EAAO,EAAE,UAAU,UAAA,EAAY,QAAA,EAAU,UAAS,EACvD,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,UAAA,EAAY,MAAM,UAAA,IAAc,KAAA;AAAA,QAChC,OAAA,EAAS,MAAM,OAAA,IAAW;AAAA;AAAA,KAC5B;AAAA,oBACA,GAAA,CAAC,GAAA,EAAA,EAAI,OAAA,EAAS,CAAA,EACZ,QAAA,k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"CardHeader.esm.js","sources":["../../../../src/next/components/TemplateCard/CardHeader.tsx"],"sourcesContent":["/*\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 { makeStyles, Theme, useTheme } from '@material-ui/core/styles';\nimport { ItemCardHeader } from '@backstage/core-components';\nimport { TemplateEntityV1beta3 } from '@backstage/plugin-scaffolder-common';\nimport { FavoriteEntity } from '@backstage/plugin-catalog-react';\nimport { TemplateDetailButton } from './TemplateDetailButton.tsx';\n\nconst useStyles = makeStyles<\n Theme,\n {\n cardFontColor: string;\n cardBackgroundImage: string;\n }\n>(() => ({\n header: {\n backgroundImage: ({ cardBackgroundImage }) => cardBackgroundImage,\n color: ({ cardFontColor }) => cardFontColor,\n },\n subtitleWrapper: {\n display: 'flex',\n justifyContent: 'space-between',\n },\n detailIcon: {\n color: ({ cardFontColor }) => cardFontColor,\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();\n const themeForType = getPageTheme({ themeId: type });\n\n const styles = useStyles({\n cardFontColor: themeForType.fontColor,\n cardBackgroundImage: themeForType.backgroundImage,\n });\n\n const SubtitleComponent = (\n <div className={styles.subtitleWrapper}>\n <div>{type}</div>\n <div>\n <TemplateDetailButton\n className={styles.detailIcon}\n template={props.template}\n />\n <FavoriteEntity\n entity={props.template}\n style={{ padding: 0, marginLeft: 6 }}\n />\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"],"names":[],"mappings":";;;;;;AAsBA,MAAM,SAAA,GAAY,WAMhB,OAAO;AAAA,EACP,
|
|
1
|
+
{"version":3,"file":"CardHeader.esm.js","sources":["../../../../src/next/components/TemplateCard/CardHeader.tsx"],"sourcesContent":["/*\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 { makeStyles, Theme, useTheme } from '@material-ui/core/styles';\nimport { ItemCardHeader } from '@backstage/core-components';\nimport { TemplateEntityV1beta3 } from '@backstage/plugin-scaffolder-common';\nimport { FavoriteEntity } from '@backstage/plugin-catalog-react';\nimport { TemplateDetailButton } from './TemplateDetailButton.tsx';\n\nconst useStyles = makeStyles<\n Theme,\n {\n cardFontColor: string;\n cardBackgroundImage: string;\n }\n>(() => ({\n header: {\n backgroundImage: ({ cardBackgroundImage }) => cardBackgroundImage,\n color: ({ cardFontColor }) => cardFontColor,\n },\n subtitleWrapper: {\n display: 'flex',\n justifyContent: 'space-between',\n },\n detailIcon: {\n color: ({ cardFontColor }) => cardFontColor,\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();\n const themeForType = getPageTheme({ themeId: type });\n\n const styles = useStyles({\n cardFontColor: themeForType.fontColor,\n cardBackgroundImage: themeForType.backgroundImage,\n });\n\n const SubtitleComponent = (\n <div className={styles.subtitleWrapper}>\n <div>{type}</div>\n <div>\n <TemplateDetailButton\n className={styles.detailIcon}\n template={props.template}\n />\n <FavoriteEntity\n entity={props.template}\n style={{ padding: 0, marginLeft: 6 }}\n />\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"],"names":[],"mappings":";;;;;;AAsBA,MAAM,SAAA,GAAY,WAMhB,OAAO;AAAA,EACP,MAAA,EAAQ;AAAA,IACN,eAAA,EAAiB,CAAC,EAAE,mBAAA,EAAoB,KAAM,mBAAA;AAAA,IAC9C,KAAA,EAAO,CAAC,EAAE,aAAA,EAAc,KAAM;AAAA,GAChC;AAAA,EACA,eAAA,EAAiB;AAAA,IACf,OAAA,EAAS,MAAA;AAAA,IACT,cAAA,EAAgB;AAAA,GAClB;AAAA,EACA,UAAA,EAAY;AAAA,IACV,KAAA,EAAO,CAAC,EAAE,aAAA,EAAc,KAAM;AAAA;AAElC,CAAA,CAAE,CAAA;AAYK,MAAM,UAAA,GAAa,CAAC,KAAA,KAA2B;AACpD,EAAA,MAAM;AAAA,IACJ,QAAA,EAAU;AAAA,MACR,QAAA,EAAU,EAAE,KAAA,EAAO,IAAA,EAAK;AAAA,MACxB,IAAA,EAAM,EAAE,IAAA;AAAK;AACf,GACF,GAAI,KAAA;AACJ,EAAA,MAAM,EAAE,YAAA,EAAa,GAAI,QAAA,EAAS;AAClC,EAAA,MAAM,YAAA,GAAe,YAAA,CAAa,EAAE,OAAA,EAAS,MAAM,CAAA;AAEnD,EAAA,MAAM,SAAS,SAAA,CAAU;AAAA,IACvB,eAAe,YAAA,CAAa,SAAA;AAAA,IAC5B,qBAAqB,YAAA,CAAa;AAAA,GACnC,CAAA;AAED,EAAA,MAAM,iBAAA,mBACJ,IAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,OAAO,eAAA,EACrB,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,SAAK,QAAA,EAAA,IAAA,EAAK,CAAA;AAAA,yBACV,KAAA,EAAA,EACC,QAAA,EAAA;AAAA,sBAAA,GAAA;AAAA,QAAC,oBAAA;AAAA,QAAA;AAAA,UACC,WAAW,MAAA,CAAO,UAAA;AAAA,UAClB,UAAU,KAAA,CAAM;AAAA;AAAA,OAClB;AAAA,sBACA,GAAA;AAAA,QAAC,cAAA;AAAA,QAAA;AAAA,UACC,QAAQ,KAAA,CAAM,QAAA;AAAA,UACd,KAAA,EAAO,EAAE,OAAA,EAAS,CAAA,EAAG,YAAY,CAAA;AAAE;AAAA;AACrC,KAAA,EACF;AAAA,GAAA,EACF,CAAA;AAGF,EAAA,uBACE,GAAA;AAAA,IAAC,cAAA;AAAA,IAAA;AAAA,MACC,OAAO,KAAA,IAAS,IAAA;AAAA,MAChB,QAAA,EAAU,iBAAA;AAAA,MACV,OAAA,EAAS,EAAE,IAAA,EAAM,MAAA,CAAO,MAAA;AAAO;AAAA,GACjC;AAEJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardLink.esm.js","sources":["../../../../src/next/components/TemplateCard/CardLink.tsx"],"sourcesContent":["/*\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 { IconComponent } from '@backstage/core-plugin-api';\nimport { Link } from '@backstage/core-components';\nimport { makeStyles } from '@material-ui/core/styles';\n\nexport interface CardLinkProps {\n icon: IconComponent;\n text: string;\n url: string;\n}\n\nconst useStyles = makeStyles(() => ({\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"],"names":[],"mappings":";;;;AA0BA,MAAM,SAAA,GAAY,WAAW,OAAO;AAAA,EAClC,
|
|
1
|
+
{"version":3,"file":"CardLink.esm.js","sources":["../../../../src/next/components/TemplateCard/CardLink.tsx"],"sourcesContent":["/*\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 { IconComponent } from '@backstage/core-plugin-api';\nimport { Link } from '@backstage/core-components';\nimport { makeStyles } from '@material-ui/core/styles';\n\nexport interface CardLinkProps {\n icon: IconComponent;\n text: string;\n url: string;\n}\n\nconst useStyles = makeStyles(() => ({\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"],"names":[],"mappings":";;;;AA0BA,MAAM,SAAA,GAAY,WAAW,OAAO;AAAA,EAClC,QAAA,EAAU;AAAA,IACR,OAAA,EAAS,aAAA;AAAA,IACT,UAAA,EAAY;AAAA;AAEhB,CAAA,CAAE,CAAA;AAEK,MAAM,WAAW,CAAC,EAAE,MAAM,IAAA,EAAM,IAAA,EAAM,KAAI,KAAqB;AACpE,EAAA,MAAM,SAAS,SAAA,EAAU;AAEzB,EAAA,uBACE,IAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,MAAA,CAAO,QAAA,EACrB,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,IAAA,EAAA,EAAK,UAAS,OAAA,EAAQ,CAAA;AAAA,oBACvB,GAAA,CAAC,IAAA,EAAA,EAAK,KAAA,EAAO,EAAE,UAAA,EAAY,OAAM,EAAG,EAAA,EAAI,GAAA,EACrC,QAAA,EAAA,IAAA,IAAQ,GAAA,EACX;AAAA,GAAA,EACF,CAAA;AAEJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TemplateCard.esm.js","sources":["../../../../src/next/components/TemplateCard/TemplateCard.tsx"],"sourcesContent":["/*\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 { RELATION_OWNED_BY } from '@backstage/catalog-model';\nimport { IconComponent, useAnalytics } from '@backstage/core-plugin-api';\nimport { getEntityRelations } from '@backstage/plugin-catalog-react';\nimport { TemplateEntityV1beta3 } from '@backstage/plugin-scaffolder-common';\nimport Card from '@material-ui/core/Card';\nimport CardActions from '@material-ui/core/CardActions';\nimport CardContent from '@material-ui/core/CardContent';\nimport Divider from '@material-ui/core/Divider';\nimport Grid from '@material-ui/core/Grid';\nimport { makeStyles, Theme } from '@material-ui/core/styles';\nimport { useCallback } from 'react';\nimport { CardHeader } from './CardHeader';\nimport { usePermission } from '@backstage/plugin-permission-react';\nimport { taskCreatePermission } from '@backstage/plugin-scaffolder-common/alpha';\nimport { TemplateCardContent } from './TemplateCardContent';\nimport { TemplateCardTags } from './TemplateCardTags';\nimport { TemplateCardLinks } from './TemplateCardLinks';\nimport { TemplateCardActions } from './TemplateCardActions';\n\nconst useStyles = makeStyles<Theme>(() => ({\n actionContainer: { padding: '16px', flex: 1, alignItems: 'flex-end' },\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 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 { additionalLinks, onSelected, template } = props;\n const styles = useStyles();\n const analytics = useAnalytics();\n const ownedByRelations = getEntityRelations(template, RELATION_OWNED_BY);\n const hasTags = !!template.metadata.tags?.length;\n const hasLinks =\n !!additionalLinks?.length || !!template.metadata.links?.length;\n const displayDefaultDivider = !hasTags && !hasLinks;\n\n const { allowed: canCreateTask } = usePermission({\n permission: taskCreatePermission,\n });\n const handleChoose = useCallback(() => {\n analytics.captureEvent('click', `Template has been opened`);\n onSelected?.(template);\n }, [analytics, onSelected, template]);\n\n return (\n <Card>\n <CardHeader template={template} data-testid=\"template-card-header\" />\n <CardContent>\n <Grid container spacing={2} data-testid=\"template-card-content\">\n <TemplateCardContent template={template} />\n {displayDefaultDivider && (\n <Grid item xs={12}>\n <Divider data-testid=\"template-card-separator\" />\n </Grid>\n )}\n {hasTags && <TemplateCardTags template={template} />}\n {hasLinks && (\n <TemplateCardLinks\n template={template}\n additionalLinks={additionalLinks}\n />\n )}\n </Grid>\n </CardContent>\n <CardActions\n className={styles.actionContainer}\n data-testid=\"template-card-actions\"\n >\n <TemplateCardActions\n canCreateTask={canCreateTask}\n handleChoose={handleChoose}\n ownedByRelations={ownedByRelations}\n />\n </CardActions>\n </Card>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAmCA,MAAM,SAAA,GAAY,WAAkB,OAAO;AAAA,EACzC,iBAAiB,EAAE,OAAA,EAAS,QAAQ,
|
|
1
|
+
{"version":3,"file":"TemplateCard.esm.js","sources":["../../../../src/next/components/TemplateCard/TemplateCard.tsx"],"sourcesContent":["/*\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 { RELATION_OWNED_BY } from '@backstage/catalog-model';\nimport { IconComponent, useAnalytics } from '@backstage/core-plugin-api';\nimport { getEntityRelations } from '@backstage/plugin-catalog-react';\nimport { TemplateEntityV1beta3 } from '@backstage/plugin-scaffolder-common';\nimport Card from '@material-ui/core/Card';\nimport CardActions from '@material-ui/core/CardActions';\nimport CardContent from '@material-ui/core/CardContent';\nimport Divider from '@material-ui/core/Divider';\nimport Grid from '@material-ui/core/Grid';\nimport { makeStyles, Theme } from '@material-ui/core/styles';\nimport { useCallback } from 'react';\nimport { CardHeader } from './CardHeader';\nimport { usePermission } from '@backstage/plugin-permission-react';\nimport { taskCreatePermission } from '@backstage/plugin-scaffolder-common/alpha';\nimport { TemplateCardContent } from './TemplateCardContent';\nimport { TemplateCardTags } from './TemplateCardTags';\nimport { TemplateCardLinks } from './TemplateCardLinks';\nimport { TemplateCardActions } from './TemplateCardActions';\n\nconst useStyles = makeStyles<Theme>(() => ({\n actionContainer: { padding: '16px', flex: 1, alignItems: 'flex-end' },\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 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 { additionalLinks, onSelected, template } = props;\n const styles = useStyles();\n const analytics = useAnalytics();\n const ownedByRelations = getEntityRelations(template, RELATION_OWNED_BY);\n const hasTags = !!template.metadata.tags?.length;\n const hasLinks =\n !!additionalLinks?.length || !!template.metadata.links?.length;\n const displayDefaultDivider = !hasTags && !hasLinks;\n\n const { allowed: canCreateTask } = usePermission({\n permission: taskCreatePermission,\n });\n const handleChoose = useCallback(() => {\n analytics.captureEvent('click', `Template has been opened`);\n onSelected?.(template);\n }, [analytics, onSelected, template]);\n\n return (\n <Card>\n <CardHeader template={template} data-testid=\"template-card-header\" />\n <CardContent>\n <Grid container spacing={2} data-testid=\"template-card-content\">\n <TemplateCardContent template={template} />\n {displayDefaultDivider && (\n <Grid item xs={12}>\n <Divider data-testid=\"template-card-separator\" />\n </Grid>\n )}\n {hasTags && <TemplateCardTags template={template} />}\n {hasLinks && (\n <TemplateCardLinks\n template={template}\n additionalLinks={additionalLinks}\n />\n )}\n </Grid>\n </CardContent>\n <CardActions\n className={styles.actionContainer}\n data-testid=\"template-card-actions\"\n >\n <TemplateCardActions\n canCreateTask={canCreateTask}\n handleChoose={handleChoose}\n ownedByRelations={ownedByRelations}\n />\n </CardActions>\n </Card>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAmCA,MAAM,SAAA,GAAY,WAAkB,OAAO;AAAA,EACzC,iBAAiB,EAAE,OAAA,EAAS,QAAQ,IAAA,EAAM,CAAA,EAAG,YAAY,UAAA;AAC3D,CAAA,CAAE,CAAA;AAoBK,MAAM,YAAA,GAAe,CAAC,KAAA,KAA6B;AACxD,EAAA,MAAM,EAAE,eAAA,EAAiB,UAAA,EAAY,QAAA,EAAS,GAAI,KAAA;AAClD,EAAA,MAAM,SA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CAAA,EACjD,CAAA;AAAA,MAED,OAAA,oBAAW,GAAA,CAAC,gBAAA,EAAA,EAAiB,QAAA,EAAoB,CAAA;AAAA,MACjD,QAAA,oBACC,GAAA;AAAA,QAAC,iBAAA;AAAA,QAAA;AAAA,UACC,QAAA;AAAA,UACA;AAAA;AAAA;AACF,KAAA,EAEJ,CAAA,EACF,CAAA;AAAA,oBACA,GAAA;AAAA,MAAC,WAAA;AAAA,MAAA;AAAA,QACC,WAAW,MAAA,CAAO,eAAA;AAAA,QAClB,aAAA,EAAY,uBAAA;AAAA,QAEZ,QAAA,kBAAA,GAAA;AAAA,UAAC,mBAAA;AAAA,UAAA;AAAA,YACC,aAAA;AAAA,YACA,YAAA;AAAA,YACA;AAAA;AAAA;AACF;AAAA;AACF,GAAA,EACF,CAAA;AAEJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TemplateCardActions.esm.js","sources":["../../../../src/next/components/TemplateCard/TemplateCardActions.tsx"],"sourcesContent":["/*\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 { UserIcon } from '@backstage/core-components';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport { EntityRefLinks } from '@backstage/plugin-catalog-react';\nimport Button from '@material-ui/core/Button';\nimport { makeStyles, Theme } from '@material-ui/core/styles';\n\nimport { scaffolderReactTranslationRef } from '../../../translation';\n\nconst useStyles = makeStyles<Theme>(theme => ({\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 actionContainer: { padding: '16px', flex: 1, alignItems: 'flex-end' },\n}));\n\n/**\n * The Props for the {@link TemplateCardActions} component\n * @alpha\n */\nexport interface TemplateCardActionsProps {\n ownedByRelations: any;\n canCreateTask: boolean;\n handleChoose: () => void;\n}\nexport const TemplateCardActions = ({\n canCreateTask,\n handleChoose,\n ownedByRelations,\n}: TemplateCardActionsProps) => {\n const { t } = useTranslationRef(scaffolderReactTranslationRef);\n const styles = useStyles();\n\n return (\n <div className={styles.footer} data-testid=\"template-card-actions--footer\">\n <div\n className={styles.ownedBy}\n data-testid=\"template-card-actions--ownedby\"\n >\n {ownedByRelations.length > 0 && (\n <>\n <UserIcon fontSize=\"small\" />\n <EntityRefLinks\n style={{ marginLeft: '8px' }}\n entityRefs={ownedByRelations}\n defaultKind=\"Group\"\n hideIcons\n />\n </>\n )}\n </div>\n {canCreateTask ? (\n <Button\n size=\"small\"\n variant=\"outlined\"\n color=\"primary\"\n data-testid=\"template-card-actions--create\"\n onClick={handleChoose}\n >\n {t('templateCard.chooseButtonText')}\n </Button>\n ) : null}\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;;AAwBA,MAAM,SAAA,GAAY,WAAkB,
|
|
1
|
+
{"version":3,"file":"TemplateCardActions.esm.js","sources":["../../../../src/next/components/TemplateCard/TemplateCardActions.tsx"],"sourcesContent":["/*\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 { UserIcon } from '@backstage/core-components';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport { EntityRefLinks } from '@backstage/plugin-catalog-react';\nimport Button from '@material-ui/core/Button';\nimport { makeStyles, Theme } from '@material-ui/core/styles';\n\nimport { scaffolderReactTranslationRef } from '../../../translation';\n\nconst useStyles = makeStyles<Theme>(theme => ({\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 actionContainer: { padding: '16px', flex: 1, alignItems: 'flex-end' },\n}));\n\n/**\n * The Props for the {@link TemplateCardActions} component\n * @alpha\n */\nexport interface TemplateCardActionsProps {\n ownedByRelations: any;\n canCreateTask: boolean;\n handleChoose: () => void;\n}\nexport const TemplateCardActions = ({\n canCreateTask,\n handleChoose,\n ownedByRelations,\n}: TemplateCardActionsProps) => {\n const { t } = useTranslationRef(scaffolderReactTranslationRef);\n const styles = useStyles();\n\n return (\n <div className={styles.footer} data-testid=\"template-card-actions--footer\">\n <div\n className={styles.ownedBy}\n data-testid=\"template-card-actions--ownedby\"\n >\n {ownedByRelations.length > 0 && (\n <>\n <UserIcon fontSize=\"small\" />\n <EntityRefLinks\n style={{ marginLeft: '8px' }}\n entityRefs={ownedByRelations}\n defaultKind=\"Group\"\n hideIcons\n />\n </>\n )}\n </div>\n {canCreateTask ? (\n <Button\n size=\"small\"\n variant=\"outlined\"\n color=\"primary\"\n data-testid=\"template-card-actions--create\"\n onClick={handleChoose}\n >\n {t('templateCard.chooseButtonText')}\n </Button>\n ) : null}\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;;AAwBA,MAAM,SAAA,GAAY,WAAkB,CAAA,KAAA,MAAU;AAAA,EAC5C,MAAA,EAAQ;AAAA,IACN,OAAA,EAAS,MAAA;AAAA,IACT,cAAA,EAAgB,eAAA;AAAA,IAChB,IAAA,EAAM,CAAA;AAAA,IACN,UAAA,EAAY;AAAA,GACd;AAAA,EACA,OAAA,EAAS;AAAA,IACP,OAAA,EAAS,MAAA;AAAA,IACT,UAAA,EA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YAAA;AAAA,QAER,YAAE,+BAA+B;AAAA;AAAA,KACpC,GACE;AAAA,GAAA,EACN,CAAA;AAEJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TemplateCardContent.esm.js","sources":["../../../../src/next/components/TemplateCard/TemplateCardContent.tsx"],"sourcesContent":["/*\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 { MarkdownContent } from '@backstage/core-components';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport type { TemplateEntityV1beta3 } from '@backstage/plugin-scaffolder-common';\nimport Box from '@material-ui/core/Box';\nimport Grid from '@material-ui/core/Grid';\nimport { makeStyles } from '@material-ui/core/styles';\n\nimport { scaffolderReactTranslationRef } from '../../../translation';\n\nconst useStyles = makeStyles(() => ({\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}));\n\n/**\n * The Props for the {@link TemplateCardContent} component\n * @alpha\n */\nexport interface TemplateCardContentProps {\n template: TemplateEntityV1beta3;\n}\nexport const TemplateCardContent = ({ template }: TemplateCardContentProps) => {\n const { t } = useTranslationRef(scaffolderReactTranslationRef);\n const styles = useStyles();\n return (\n <Grid item xs={12} data-testid=\"template-card-content-grid\">\n <Box className={styles.box} data-testid=\"template-card-content-container\">\n <MarkdownContent\n className={styles.markdown}\n content={\n template.metadata.description ?? t('templateCard.noDescription')\n }\n />\n </Box>\n </Grid>\n );\n};\n"],"names":[],"mappings":";;;;;;;;AAyBA,MAAM,SAAA,GAAY,WAAW,OAAO;AAAA,EAClC,
|
|
1
|
+
{"version":3,"file":"TemplateCardContent.esm.js","sources":["../../../../src/next/components/TemplateCard/TemplateCardContent.tsx"],"sourcesContent":["/*\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 { MarkdownContent } from '@backstage/core-components';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport type { TemplateEntityV1beta3 } from '@backstage/plugin-scaffolder-common';\nimport Box from '@material-ui/core/Box';\nimport Grid from '@material-ui/core/Grid';\nimport { makeStyles } from '@material-ui/core/styles';\n\nimport { scaffolderReactTranslationRef } from '../../../translation';\n\nconst useStyles = makeStyles(() => ({\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}));\n\n/**\n * The Props for the {@link TemplateCardContent} component\n * @alpha\n */\nexport interface TemplateCardContentProps {\n template: TemplateEntityV1beta3;\n}\nexport const TemplateCardContent = ({ template }: TemplateCardContentProps) => {\n const { t } = useTranslationRef(scaffolderReactTranslationRef);\n const styles = useStyles();\n return (\n <Grid item xs={12} data-testid=\"template-card-content-grid\">\n <Box className={styles.box} data-testid=\"template-card-content-container\">\n <MarkdownContent\n className={styles.markdown}\n content={\n template.metadata.description ?? t('templateCard.noDescription')\n }\n />\n </Box>\n </Grid>\n );\n};\n"],"names":[],"mappings":";;;;;;;;AAyBA,MAAM,SAAA,GAAY,WAAW,OAAO;AAAA,EAClC,GAAA,EAAK;AAAA,IACH,QAAA,EAAU,QAAA;AAAA,IACV,YAAA,EAAc,UAAA;AAAA,IACd,OAAA,EAAS,aAAA;AAAA,IACT,oBAAA,EAAsB,EAAA;AAAA,IACtB,oBAAA,EAAsB;AAAA,GACxB;AAAA,EACA,QAAA,EAAU;AAAA;AAAA,IAER,gBAAA,EAAkB;AAAA,MAChB,MAAA,EAAQ;AAAA;AACV;AAEJ,CAAA,CAAE,CAAA;AASK,MAAM,mBAAA,GAAsB,CAAC,EAAE,QAAA,EAAS,KAAgC;AAC7E,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,6BAA6B,CAAA;AAC7D,EAAA,MAAM,SAAS,SAAA,EAAU;AACzB,EAAA,uBACE,GAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAI,IAAA,EAAC,IAAI,EAAA,EAAI,aAAA,EAAY,4BAAA,EAC7B,QAAA,kBAAA,GAAA,CAAC,GAAA,EAAA,EAAI,SAAA,EAAW,MAAA,CAAO,GAAA,EAAK,eAAY,iCAAA,EACtC,QAAA,kBAAA,GAAA;AAAA,IAAC,eAAA;AAAA,IAAA;AAAA,MACC,WAAW,MAAA,CAAO,QAAA;AAAA,MAClB,OAAA,EACE,QAAA,CAAS,QAAA,CAAS,WAAA,IAAe,EAAE,4BAA4B;AAAA;AAAA,KAGrE,CAAA,EACF,CAAA;AAEJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TemplateCardLinks.esm.js","sources":["../../../../src/next/components/TemplateCard/TemplateCardLinks.tsx"],"sourcesContent":["/*\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 { IconComponent, useApp } from '@backstage/core-plugin-api';\nimport { TemplateEntityV1beta3 } from '@backstage/plugin-scaffolder-common';\nimport Divider from '@material-ui/core/Divider';\nimport Grid from '@material-ui/core/Grid';\nimport { makeStyles, Theme } from '@material-ui/core/styles';\nimport LanguageIcon from '@material-ui/icons/Language';\nimport { CardLink } from './CardLink';\n\nconst useStyles = makeStyles<Theme>({});\n\n/**\n * The Props for the {@link TemplateCardLinks} component\n * @alpha\n */\nexport interface TemplateCardLinksProps {\n template: TemplateEntityV1beta3;\n additionalLinks?: {\n icon: IconComponent;\n text: string;\n url: string;\n }[];\n}\nexport const TemplateCardLinks = ({\n template,\n additionalLinks,\n}: TemplateCardLinksProps) => {\n const styles = useStyles();\n const app = useApp();\n const iconResolver = (key?: string): IconComponent =>\n key ? app.getSystemIcon(key) ?? LanguageIcon : LanguageIcon;\n return (\n <>\n <Grid item xs={12}>\n <Divider data-testid=\"template-card-separator--links\" />\n </Grid>\n <Grid item xs={12}>\n <Grid container spacing={2} data-testid=\"template-card-links\">\n {additionalLinks?.map(({ icon, text, url }, index) => (\n <Grid\n className={styles.linkText}\n item\n xs={6}\n key={index}\n data-testid=\"template-card-links--item\"\n >\n <CardLink icon={icon} text={text} url={url} />\n </Grid>\n ))}\n {template.metadata.links?.map(({ url, icon, title }, index) => (\n <Grid\n className={styles.linkText}\n item\n xs={6}\n key={index}\n data-testid=\"template-card-links--metalink\"\n >\n <CardLink\n icon={iconResolver(icon)}\n text={title || url}\n url={url}\n />\n </Grid>\n ))}\n </Grid>\n </Grid>\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;;AAwBA,MAAM,SAAA,GAAY,
|
|
1
|
+
{"version":3,"file":"TemplateCardLinks.esm.js","sources":["../../../../src/next/components/TemplateCard/TemplateCardLinks.tsx"],"sourcesContent":["/*\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 { IconComponent, useApp } from '@backstage/core-plugin-api';\nimport { TemplateEntityV1beta3 } from '@backstage/plugin-scaffolder-common';\nimport Divider from '@material-ui/core/Divider';\nimport Grid from '@material-ui/core/Grid';\nimport { makeStyles, Theme } from '@material-ui/core/styles';\nimport LanguageIcon from '@material-ui/icons/Language';\nimport { CardLink } from './CardLink';\n\nconst useStyles = makeStyles<Theme>({});\n\n/**\n * The Props for the {@link TemplateCardLinks} component\n * @alpha\n */\nexport interface TemplateCardLinksProps {\n template: TemplateEntityV1beta3;\n additionalLinks?: {\n icon: IconComponent;\n text: string;\n url: string;\n }[];\n}\nexport const TemplateCardLinks = ({\n template,\n additionalLinks,\n}: TemplateCardLinksProps) => {\n const styles = useStyles();\n const app = useApp();\n const iconResolver = (key?: string): IconComponent =>\n key ? app.getSystemIcon(key) ?? LanguageIcon : LanguageIcon;\n return (\n <>\n <Grid item xs={12}>\n <Divider data-testid=\"template-card-separator--links\" />\n </Grid>\n <Grid item xs={12}>\n <Grid container spacing={2} data-testid=\"template-card-links\">\n {additionalLinks?.map(({ icon, text, url }, index) => (\n <Grid\n className={styles.linkText}\n item\n xs={6}\n key={index}\n data-testid=\"template-card-links--item\"\n >\n <CardLink icon={icon} text={text} url={url} />\n </Grid>\n ))}\n {template.metadata.links?.map(({ url, icon, title }, index) => (\n <Grid\n className={styles.linkText}\n item\n xs={6}\n key={index}\n data-testid=\"template-card-links--metalink\"\n >\n <CardLink\n icon={iconResolver(icon)}\n text={title || url}\n url={url}\n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CAAS,KAAA,EAAO,GAAA,CAAI,CAAC,EAAE,GAAA,EAAK,IAAA,EAAM,KAAA,EAAM,EAAG,KAAA,qBACnD,GAAA;AAAA,QAAC,IAAA;AAAA,QAAA;AAAA,UACC,WAAW,MAAA,CAAO,QAAA;AAAA,UAClB,IAAA,EAAI,IAAA;AAAA,UACJ,EAAA,EAAI,CAAA;AAAA,UAEJ,aAAA,EAAY,+BAAA;AAAA,UAEZ,QAAA,kBAAA,GAAA;AAAA,YAAC,QAAA;AAAA,YAAA;AAAA,cACC,IAAA,EAAM,aAAa,IAAI,CAAA;AAAA,cACvB,MAAM,KAAA,IAAS,GAAA;AAAA,cACf;AAAA;AAAA;AACF,SAAA;AAAA,QAPK;AAAA,OASR;AAAA,KAAA,EACH,CAAA,EACF;AAAA,GAAA,EACF,CAAA;AAEJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TemplateCardTags.esm.js","sources":["../../../../src/next/components/TemplateCard/TemplateCardTags.tsx"],"sourcesContent":["/*\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 type { TemplateEntityV1beta3 } from '@backstage/plugin-scaffolder-common';\nimport Chip from '@material-ui/core/Chip';\nimport Divider from '@material-ui/core/Divider';\nimport Grid from '@material-ui/core/Grid';\n\n/**\n * The Props for the {@link TemplateCardTags} component\n * @alpha\n */\nexport interface TemplateCardTagsProps {\n template: TemplateEntityV1beta3;\n}\nexport const TemplateCardTags = ({ template }: TemplateCardTagsProps) => (\n <>\n <Grid item xs={12}>\n <Divider data-testid=\"template-card-separator--tags\" />\n </Grid>\n <Grid item xs={12}>\n <Grid container spacing={2} data-testid=\"template-card-tags\">\n {template.metadata.tags?.map(tag => (\n <Grid\n key={`grid-${tag}`}\n item\n data-testid={`template-card-tag-item-${tag}`}\n >\n <Chip\n style={{ margin: 0 }}\n size=\"small\"\n data-testid={`template-card-tag-chip-${tag}`}\n label={tag}\n key={tag}\n />\n </Grid>\n ))}\n </Grid>\n </Grid>\n </>\n);\n"],"names":[],"mappings":";;;;;AA4BO,MAAM,
|
|
1
|
+
{"version":3,"file":"TemplateCardTags.esm.js","sources":["../../../../src/next/components/TemplateCard/TemplateCardTags.tsx"],"sourcesContent":["/*\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 type { TemplateEntityV1beta3 } from '@backstage/plugin-scaffolder-common';\nimport Chip from '@material-ui/core/Chip';\nimport Divider from '@material-ui/core/Divider';\nimport Grid from '@material-ui/core/Grid';\n\n/**\n * The Props for the {@link TemplateCardTags} component\n * @alpha\n */\nexport interface TemplateCardTagsProps {\n template: TemplateEntityV1beta3;\n}\nexport const TemplateCardTags = ({ template }: TemplateCardTagsProps) => (\n <>\n <Grid item xs={12}>\n <Divider data-testid=\"template-card-separator--tags\" />\n </Grid>\n <Grid item xs={12}>\n <Grid container spacing={2} data-testid=\"template-card-tags\">\n {template.metadata.tags?.map(tag => (\n <Grid\n key={`grid-${tag}`}\n item\n data-testid={`template-card-tag-item-${tag}`}\n >\n <Chip\n style={{ margin: 0 }}\n size=\"small\"\n data-testid={`template-card-tag-chip-${tag}`}\n label={tag}\n key={tag}\n />\n </Grid>\n ))}\n </Grid>\n </Grid>\n </>\n);\n"],"names":[],"mappings":";;;;;AA4BO,MAAM,gBAAA,GAAmB,CAAC,EAAE,QAAA,uBACjC,IAAA,CAAA,QAAA,EAAA,EACE,QAAA,EAAA;AAAA,kBAAA,GAAA,CAAC,IAAA,EAAA,EAAK,MAAI,IAAA,EAAC,EAAA,EAAI,IACb,QAAA,kBAAA,GAAA,CAAC,OAAA,EAAA,EAAQ,aAAA,EAAY,+BAAA,EAAgC,CAAA,EACvD,CAAA;AAAA,sBACC,IAAA,EAAA,EAAK,IAAA,EAAI,MAAC,EAAA,EAAI,EAAA,EACb,8BAAC,IAAA,EAAA,EAAK,SAAA,EAAS,IAAA,EAAC,OAAA,EAAS,GAAG,aAAA,EAAY,oBAAA,EACrC,mBAAS,QAAA,CAAS,IAAA,EAAM,IAAI,CAAA,GAAA,qBAC3B,GAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MAEC,IAAA,EAAI,IAAA;AAAA,MACJ,aAAA,EAAa,0BAA0B,GAAG,CAAA,CAAA;AAAA,MAE1C,QAAA,kBAAA,GAAA;AAAA,QAAC,IAAA;AAAA,QAAA;AAAA,UACC,KAAA,EAAO,EAAE,MAAA,EAAQ,CAAA,EAAE;AAAA,UACnB,IAAA,EAAK,OAAA;AAAA,UACL,aAAA,EAAa,0BAA0B,GAAG,CAAA,CAAA;AAAA,UAC1C,KAAA,EAAO;AAAA,SAAA;AAAA,QACF;AAAA;AACP,KAAA;AAAA,IAVK,QAAQ,GAAG,CAAA;AAAA,GAYnB,GACH,CAAA,EACF;AAAA,CAAA,EACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TemplateDetailButton.esm.js","sources":["../../../../src/next/components/TemplateCard/TemplateDetailButton.tsx"],"sourcesContent":["/*\n * Copyright 2025 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 Tooltip from '@material-ui/core/Tooltip';\nimport IconButton from '@material-ui/core/IconButton';\nimport Typography from '@material-ui/core/Typography';\nimport DescriptionIcon from '@material-ui/icons/Description';\nimport { Link } from '@backstage/core-components';\nimport {\n entityRouteParams,\n entityRouteRef,\n} from '@backstage/plugin-catalog-react';\nimport { useApp, useRouteRef } from '@backstage/core-plugin-api';\nimport { Entity, stringifyEntityRef } from '@backstage/catalog-model';\nimport { scaffolderReactTranslationRef } from '../../../translation';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\n\nexport interface TemplateDetailButtonProps {\n template: Entity;\n className?: string;\n}\n\nexport const TemplateDetailButton = ({\n template,\n className,\n}: TemplateDetailButtonProps) => {\n const catalogEntityRoute = useRouteRef(entityRouteRef);\n const { t } = useTranslationRef(scaffolderReactTranslationRef);\n const entityRef = stringifyEntityRef(template);\n\n const app = useApp();\n const TemplateIcon = app.getSystemIcon('kind:template') || DescriptionIcon;\n\n return (\n <Tooltip id={`tooltip-${entityRef}`} title={t('cardHeader.detailBtnTitle')}>\n <IconButton\n aria-label={t('cardHeader.detailBtnTitle')}\n id={`viewDetail-${entityRef}`}\n style={{ padding: 0 }}\n >\n <Typography component=\"span\">\n <Link\n to={catalogEntityRoute(entityRouteParams(template))}\n style={{ display: 'flex', alignItems: 'center' }}\n >\n <TemplateIcon className={className} />\n </Link>\n </Typography>\n </IconButton>\n </Tooltip>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;AAkCO,MAAM,uBAAuB,CAAC;AAAA,EACnC,QAAA;AAAA,EACA;AACF,
|
|
1
|
+
{"version":3,"file":"TemplateDetailButton.esm.js","sources":["../../../../src/next/components/TemplateCard/TemplateDetailButton.tsx"],"sourcesContent":["/*\n * Copyright 2025 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 Tooltip from '@material-ui/core/Tooltip';\nimport IconButton from '@material-ui/core/IconButton';\nimport Typography from '@material-ui/core/Typography';\nimport DescriptionIcon from '@material-ui/icons/Description';\nimport { Link } from '@backstage/core-components';\nimport {\n entityRouteParams,\n entityRouteRef,\n} from '@backstage/plugin-catalog-react';\nimport { useApp, useRouteRef } from '@backstage/core-plugin-api';\nimport { Entity, stringifyEntityRef } from '@backstage/catalog-model';\nimport { scaffolderReactTranslationRef } from '../../../translation';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\n\nexport interface TemplateDetailButtonProps {\n template: Entity;\n className?: string;\n}\n\nexport const TemplateDetailButton = ({\n template,\n className,\n}: TemplateDetailButtonProps) => {\n const catalogEntityRoute = useRouteRef(entityRouteRef);\n const { t } = useTranslationRef(scaffolderReactTranslationRef);\n const entityRef = stringifyEntityRef(template);\n\n const app = useApp();\n const TemplateIcon = app.getSystemIcon('kind:template') || DescriptionIcon;\n\n return (\n <Tooltip id={`tooltip-${entityRef}`} title={t('cardHeader.detailBtnTitle')}>\n <IconButton\n aria-label={t('cardHeader.detailBtnTitle')}\n id={`viewDetail-${entityRef}`}\n style={{ padding: 0 }}\n >\n <Typography component=\"span\">\n <Link\n to={catalogEntityRoute(entityRouteParams(template))}\n style={{ display: 'flex', alignItems: 'center' }}\n >\n <TemplateIcon className={className} />\n </Link>\n </Typography>\n </IconButton>\n </Tooltip>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;AAkCO,MAAM,uBAAuB,CAAC;AAAA,EACnC,QAAA;AAAA,EACA;AACF,CAAA,KAAiC;AAC/B,EAAA,MAAM,kBAAA,GAAqB,YAAY,cAAc,CAAA;AACrD,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,6BAA6B,CAAA;AAC7D,EAAA,MAAM,SAAA,GAAY,mBAAmB,QAAQ,CAAA;AAE7C,EAAA,MAAM,MAAM,MAAA,EAAO;AACnB,EAAA,MAAM,YAAA,GAAe,GAAA,CAAI,aAAA,CAAc,eAAe,CAAA,IAAK,eAAA;AAE3D,EAAA,uBACE,GAAA,CAAC,WAAQ,EAAA,EAAI,CAAA,QAAA,EAAW,SAAS,CAAA,CAAA,EAAI,KAAA,EAAO,CAAA,CAAE,2BAA2B,CAAA,EACvE,QAAA,kBAAA,GAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,YAAA,EAAY,EAAE,2BAA2B,CAAA;AAAA,MACzC,EAAA,EAAI,cAAc,SAAS,CAAA,CAAA;AAAA,MAC3B,KAAA,EAAO,EAAE,OAAA,EAAS,CAAA,EAAE;AAAA,MAEpB,QAAA,kBAAA,GAAA,CAAC,UAAA,EAAA,EAAW,SAAA,EAAU,MAAA,EACpB,QAAA,kBAAA,GAAA;AAAA,QAAC,IAAA;AAAA,QAAA;AAAA,UACC,EAAA,EAAI,kBAAA,CAAmB,iBAAA,CAAkB,QAAQ,CAAC,CAAA;AAAA,UAClD,KAAA,EAAO,EAAE,OAAA,EAAS,MAAA,EAAQ,YAAY,QAAA,EAAS;AAAA,UAE/C,QAAA,kBAAA,GAAA,CAAC,gBAAa,SAAA,EAAsB;AAAA;AAAA,OACtC,EACF;AAAA;AAAA,GACF,EACF,CAAA;AAEJ;;;;"}
|