@backstage/plugin-scaffolder-react 1.8.4 → 1.8.5-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.
Files changed (94) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/alpha/package.json +1 -1
  3. package/dist/alpha.esm.js +19 -1472
  4. package/dist/alpha.esm.js.map +1 -1
  5. package/dist/api/ref.esm.js +12 -0
  6. package/dist/api/ref.esm.js.map +1 -0
  7. package/dist/extensions/index.esm.js +25 -0
  8. package/dist/extensions/index.esm.js.map +1 -0
  9. package/dist/extensions/keys.esm.js +5 -0
  10. package/dist/extensions/keys.esm.js.map +1 -0
  11. package/dist/hooks/useCustomFieldExtensions.esm.js +16 -0
  12. package/dist/hooks/useCustomFieldExtensions.esm.js.map +1 -0
  13. package/dist/hooks/useCustomLayouts.esm.js +16 -0
  14. package/dist/hooks/useCustomLayouts.esm.js.map +1 -0
  15. package/dist/hooks/useEventStream.esm.js +167 -0
  16. package/dist/hooks/useEventStream.esm.js.map +1 -0
  17. package/dist/index.esm.js +7 -228
  18. package/dist/index.esm.js.map +1 -1
  19. package/dist/layouts/createScaffolderLayout.esm.js +17 -0
  20. package/dist/layouts/createScaffolderLayout.esm.js.map +1 -0
  21. package/dist/layouts/keys.esm.js +5 -0
  22. package/dist/layouts/keys.esm.js.map +1 -0
  23. package/dist/next/components/Form/DescriptionFieldTemplate.esm.js +37 -0
  24. package/dist/next/components/Form/DescriptionFieldTemplate.esm.js.map +1 -0
  25. package/dist/next/components/Form/FieldTemplate.esm.js +65 -0
  26. package/dist/next/components/Form/FieldTemplate.esm.js.map +1 -0
  27. package/dist/next/components/Form/Form.esm.js +44 -0
  28. package/dist/next/components/Form/Form.esm.js.map +1 -0
  29. package/dist/next/components/ReviewState/ReviewState.esm.js +43 -0
  30. package/dist/next/components/ReviewState/ReviewState.esm.js.map +1 -0
  31. package/dist/next/components/ScaffolderField/ScaffolderField.esm.js +52 -0
  32. package/dist/next/components/ScaffolderField/ScaffolderField.esm.js.map +1 -0
  33. package/dist/next/components/ScaffolderPageContextMenu/ScaffolderPageContextMenu.esm.js +63 -0
  34. package/dist/next/components/ScaffolderPageContextMenu/ScaffolderPageContextMenu.esm.js.map +1 -0
  35. package/dist/next/components/Stepper/ErrorListTemplate/errorListTemplate.esm.js +32 -0
  36. package/dist/next/components/Stepper/ErrorListTemplate/errorListTemplate.esm.js.map +1 -0
  37. package/dist/next/components/Stepper/FieldOverrides/DescriptionField.esm.js +7 -0
  38. package/dist/next/components/Stepper/FieldOverrides/DescriptionField.esm.js.map +1 -0
  39. package/dist/next/components/Stepper/FieldOverrides/index.esm.js +2 -0
  40. package/dist/next/components/Stepper/FieldOverrides/index.esm.js.map +1 -0
  41. package/dist/next/components/Stepper/Stepper.esm.js +203 -0
  42. package/dist/next/components/Stepper/Stepper.esm.js.map +1 -0
  43. package/dist/next/components/Stepper/createAsyncValidators.esm.js +80 -0
  44. package/dist/next/components/Stepper/createAsyncValidators.esm.js.map +1 -0
  45. package/dist/next/components/Stepper/utils.esm.js +27 -0
  46. package/dist/next/components/Stepper/utils.esm.js.map +1 -0
  47. package/dist/next/components/TaskLogStream/TaskLogStream.esm.js +23 -0
  48. package/dist/next/components/TaskLogStream/TaskLogStream.esm.js.map +1 -0
  49. package/dist/next/components/TaskSteps/StepIcon.esm.js +52 -0
  50. package/dist/next/components/TaskSteps/StepIcon.esm.js.map +1 -0
  51. package/dist/next/components/TaskSteps/StepTime.esm.js +36 -0
  52. package/dist/next/components/TaskSteps/StepTime.esm.js.map +1 -0
  53. package/dist/next/components/TaskSteps/TaskBorder.esm.js +29 -0
  54. package/dist/next/components/TaskSteps/TaskBorder.esm.js.map +1 -0
  55. package/dist/next/components/TaskSteps/TaskSteps.esm.js +54 -0
  56. package/dist/next/components/TaskSteps/TaskSteps.esm.js.map +1 -0
  57. package/dist/next/components/TemplateCard/CardHeader.esm.js +41 -0
  58. package/dist/next/components/TemplateCard/CardHeader.esm.js.map +1 -0
  59. package/dist/next/components/TemplateCard/CardLink.esm.js +17 -0
  60. package/dist/next/components/TemplateCard/CardLink.esm.js.map +1 -0
  61. package/dist/next/components/TemplateCard/TemplateCard.esm.js +114 -0
  62. package/dist/next/components/TemplateCard/TemplateCard.esm.js.map +1 -0
  63. package/dist/next/components/TemplateCategoryPicker/TemplateCategoryPicker.esm.js +80 -0
  64. package/dist/next/components/TemplateCategoryPicker/TemplateCategoryPicker.esm.js.map +1 -0
  65. package/dist/next/components/TemplateGroup/TemplateGroup.esm.js +30 -0
  66. package/dist/next/components/TemplateGroup/TemplateGroup.esm.js.map +1 -0
  67. package/dist/next/components/TemplateGroups/TemplateGroups.esm.js +52 -0
  68. package/dist/next/components/TemplateGroups/TemplateGroups.esm.js.map +1 -0
  69. package/dist/next/components/TemplateOutputs/DefaultTemplateOutputs.esm.js +51 -0
  70. package/dist/next/components/TemplateOutputs/DefaultTemplateOutputs.esm.js.map +1 -0
  71. package/dist/next/components/TemplateOutputs/LinkOutputs.esm.js +40 -0
  72. package/dist/next/components/TemplateOutputs/LinkOutputs.esm.js.map +1 -0
  73. package/dist/next/components/TemplateOutputs/TextOutputs.esm.js +39 -0
  74. package/dist/next/components/TemplateOutputs/TextOutputs.esm.js.map +1 -0
  75. package/dist/next/components/Workflow/Workflow.esm.js +83 -0
  76. package/dist/next/components/Workflow/Workflow.esm.js.map +1 -0
  77. package/dist/next/hooks/useFilteredSchemaProperties.esm.js +44 -0
  78. package/dist/next/hooks/useFilteredSchemaProperties.esm.js.map +1 -0
  79. package/dist/next/hooks/useFormDataFromQuery.esm.js +21 -0
  80. package/dist/next/hooks/useFormDataFromQuery.esm.js.map +1 -0
  81. package/dist/next/hooks/useTemplateParameterSchema.esm.js +19 -0
  82. package/dist/next/hooks/useTemplateParameterSchema.esm.js.map +1 -0
  83. package/dist/next/hooks/useTemplateSchema.esm.js +46 -0
  84. package/dist/next/hooks/useTemplateSchema.esm.js.map +1 -0
  85. package/dist/next/hooks/useTemplateTimeSaved.esm.js +25 -0
  86. package/dist/next/hooks/useTemplateTimeSaved.esm.js.map +1 -0
  87. package/dist/next/hooks/useTransformSchemaToProps.esm.js +24 -0
  88. package/dist/next/hooks/useTransformSchemaToProps.esm.js.map +1 -0
  89. package/dist/next/lib/schema.esm.js +108 -0
  90. package/dist/next/lib/schema.esm.js.map +1 -0
  91. package/dist/{esm/ref-NRtFlQHB.esm.js → secrets/SecretsContext.esm.js} +3 -11
  92. package/dist/secrets/SecretsContext.esm.js.map +1 -0
  93. package/package.json +15 -15
  94. package/dist/esm/ref-NRtFlQHB.esm.js.map +0 -1
@@ -0,0 +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 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 } 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,MAAU,IAAA,KAAA,IAAS,MAAM,IAAS,KAAA,OAAA,CAAA;AAG7B,MAAM,qBAAwB,GAAA,CACnC,UACA,EAAA,UAAA,EAIA,OAGG,KAAA;AACH,EAAA,eAAe,QACb,CAAA,QAAA,EACA,UAAqB,GAAA,GAAA,EACrB,UAAsB,QACG,EAAA;AAxD7B,IAAA,IAAA,EAAA,EAAA,EAAA,CAAA;AAyDI,IAAM,MAAA,YAAA,GAAe,IAAIA,OAAA,CAAW,UAAU,CAAA,CAAA;AAC9C,IAAA,MAAM,iBAAiC,EAAC,CAAA;AAExC,IAAA,MAAM,eAAe,OACnB,aAAA,EACA,GACA,EAAA,KAAA,EACA,QACA,QACG,KAAA;AACH,MAAM,MAAA,SAAA,GAAY,WAAW,aAAa,CAAA,CAAA;AAC1C,MAAA,IAAI,SAAW,EAAA;AACb,QAAA,MAAM,kBAAkB,qBAAsB,EAAA,CAAA;AAC9C,QAAI,IAAA;AACF,UAAM,MAAA,SAAA,CAAU,OAAO,eAAiB,EAAA;AAAA,YACtC,GAAG,OAAA;AAAA,YACH,QAAA;AAAA,YACA,MAAA;AAAA,YACA,QAAA;AAAA,WACD,CAAA,CAAA;AAAA,iBACM,EAAI,EAAA;AACX,UAAgB,eAAA,CAAA,QAAA,CAAS,GAAG,OAAO,CAAA,CAAA;AAAA,SACrC;AACA,QAAA,cAAA,CAAe,GAAG,CAAI,GAAA,eAAA,CAAA;AAAA,OACxB;AAAA,KACF,CAAA;AAEA,IAAA,KAAA,MAAW,CAAC,GAAK,EAAA,KAAK,KAAK,MAAO,CAAA,OAAA,CAAQ,OAAO,CAAG,EAAA;A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AA,QAAA,IAAY,UAAc,IAAA,kBAAA,CAAmB,KAAO,EAAA;AAC7D,QAAM,MAAA,UAAA,CAAW,mBAAmB,KAAK,CAAA,CAAA;AAAA,OAChC,MAAA,IAAA,QAAA,IAAY,kBAAmB,CAAA,KAAA,CAAM,SAAS,QAAU,EAAA;AACjE,QAAA,MAAM,cAAc,EAAmB,GAAA,CAAA,EAAA,GAAA,kBAAA,CAAA,KAAA,KAAnB,IAA0B,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,UAAA,KAA1B,YAClB,EAAC,CAAA;AACH,QAAA,KAAA,MAAW,GAAG,SAAS,KAAK,MAAO,CAAA,OAAA,CAAQ,UAAU,CAAG,EAAA;AACtD,UAAA,MAAM,WAAW,SAAS,CAAA,CAAA;AAAA,SAC5B;AAAA,OACF,MAAA,IAAW,QAAS,CAAA,KAAK,CAAG,EAAA;AAC1B,QAAA,cAAA,CAAe,GAAG,CAAI,GAAA,MAAM,QAAS,CAAA,QAAA,EAAU,SAAS,KAAK,CAAA,CAAA;AAAA,OAC/D;AAAA,KACF;AAEA,IAAO,OAAA,cAAA,CAAA;AAAA,GACT;AAEA,EAAA,OAAO,OAAO,QAAyB,KAAA;AACrC,IAAO,OAAA,MAAM,SAAS,QAAQ,CAAA,CAAA;AAAA,GAChC,CAAA;AACF;;;;"}
@@ -0,0 +1,27 @@
1
+ function isFieldValidation(error) {
2
+ return !!error && "__errors" in error;
3
+ }
4
+ function hasErrors(errors) {
5
+ var _a;
6
+ if (!errors) {
7
+ return false;
8
+ }
9
+ for (const error of Object.values(errors)) {
10
+ if (isFieldValidation(error)) {
11
+ if (((_a = error.__errors) != null ? _a : []).length > 0) {
12
+ return true;
13
+ }
14
+ continue;
15
+ }
16
+ if (hasErrors(error)) {
17
+ return true;
18
+ }
19
+ }
20
+ return false;
21
+ }
22
+ function isObject(value) {
23
+ return typeof value === "object" && value !== null && !Array.isArray(value);
24
+ }
25
+
26
+ export { hasErrors, isObject };
27
+ //# sourceMappingURL=utils.esm.js.map
@@ -0,0 +1 @@
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,KAAsC,EAAA;AAC/D,EAAO,OAAA,CAAC,CAAC,KAAA,IAAS,UAAc,IAAA,KAAA,CAAA;AAClC,CAAA;AAEO,SAAS,UAAU,MAAkC,EAAA;AAvB5D,EAAA,IAAA,EAAA,CAAA;AAwBE,EAAA,IAAI,CAAC,MAAQ,EAAA;AACX,IAAO,OAAA,KAAA,CAAA;AAAA,GACT;AAEA,EAAA,KAAA,MAAW,KAAS,IAAA,MAAA,CAAO,MAAO,CAAA,MAAM,CAAG,EAAA;AACzC,IAAI,IAAA,iBAAA,CAAkB,KAAK,CAAG,EAAA;AAC5B,MAAA,IAAA,CAAA,CAAK,WAAM,QAAN,KAAA,IAAA,GAAA,EAAA,GAAkB,EAAC,EAAG,SAAS,CAAG,EAAA;AACrC,QAAO,OAAA,IAAA,CAAA;AAAA,OACT;AAEA,MAAA,SAAA;AAAA,KACF;AAEA,IAAI,IAAA,SAAA,CAAU,KAAK,CAAG,EAAA;AACpB,MAAO,OAAA,IAAA,CAAA;AAAA,KACT;AAAA,GACF;AAEA,EAAO,OAAA,KAAA,CAAA;AACT,CAAA;AAEO,SAAS,SAAS,KAAmD,EAAA;AAC1E,EAAO,OAAA,OAAO,UAAU,QAAY,IAAA,KAAA,KAAU,QAAQ,CAAC,KAAA,CAAM,QAAQ,KAAK,CAAA,CAAA;AAC5E;;;;"}
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import { LogViewer } from '@backstage/core-components';
3
+ import { makeStyles } from '@material-ui/core/styles';
4
+
5
+ const useStyles = makeStyles({
6
+ root: {
7
+ width: "100%",
8
+ height: "100%",
9
+ position: "relative"
10
+ }
11
+ });
12
+ const TaskLogStream = (props) => {
13
+ const styles = useStyles();
14
+ return /* @__PURE__ */ React.createElement("div", { className: styles.root }, /* @__PURE__ */ React.createElement(
15
+ LogViewer,
16
+ {
17
+ text: Object.values(props.logs).map((l) => l.join("\n")).filter(Boolean).join("\n")
18
+ }
19
+ ));
20
+ };
21
+
22
+ export { TaskLogStream };
23
+ //# sourceMappingURL=TaskLogStream.esm.js.map
@@ -0,0 +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 React from 'react';\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":";;;;AAmBA,MAAM,YAAY,UAAW,CAAA;AAAA,EAC3B,IAAM,EAAA;AAAA,IACJ,KAAO,EAAA,MAAA;AAAA,IACP,MAAQ,EAAA,MAAA;AAAA,IACR,QAAU,EAAA,UAAA;AAAA,GACZ;AACF,CAAC,CAAA,CAAA;AAOY,MAAA,aAAA,GAAgB,CAAC,KAA+C,KAAA;AAC3E,EAAA,MAAM,SAAS,SAAU,EAAA,CAAA;AACzB,EAAA,uBACG,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAI,SAAW,EAAA,MAAA,CAAO,IACrB,EAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,SAAA;AAAA,IAAA;AAAA,MACC,MAAM,MAAO,CAAA,MAAA,CAAO,KAAM,CAAA,IAAI,EAC3B,GAAI,CAAA,CAAA,CAAA,KAAK,CAAE,CAAA,IAAA,CAAK,IAAI,CAAC,CAAA,CACrB,OAAO,OAAO,CAAA,CACd,KAAK,IAAI,CAAA;AAAA,KAAA;AAAA,GAEhB,CAAA,CAAA;AAEJ;;;;"}
@@ -0,0 +1,52 @@
1
+ import React from 'react';
2
+ import CircularProgress from '@material-ui/core/CircularProgress';
3
+ import { makeStyles } from '@material-ui/core/styles';
4
+ import RemoveCircleOutline from '@material-ui/icons/RemoveCircleOutline';
5
+ import PanoramaFishEyeIcon from '@material-ui/icons/PanoramaFishEye';
6
+ import classNames from 'classnames';
7
+ import CheckCircleOutline from '@material-ui/icons/CheckCircleOutline';
8
+ import ErrorOutline from '@material-ui/icons/ErrorOutline';
9
+
10
+ const useStepIconStyles = makeStyles((theme) => ({
11
+ root: {
12
+ color: theme.palette.text.disabled
13
+ },
14
+ completed: {
15
+ color: theme.palette.status.ok
16
+ },
17
+ error: {
18
+ color: theme.palette.status.error
19
+ }
20
+ }));
21
+ const StepIcon = (props) => {
22
+ const classes = useStepIconStyles();
23
+ const { active, completed, error, skipped } = props;
24
+ const getMiddle = () => {
25
+ if (active) {
26
+ return /* @__PURE__ */ React.createElement(CircularProgress, { size: "20px" });
27
+ }
28
+ if (completed) {
29
+ return /* @__PURE__ */ React.createElement(CheckCircleOutline, null);
30
+ }
31
+ if (error) {
32
+ return /* @__PURE__ */ React.createElement(ErrorOutline, null);
33
+ }
34
+ if (skipped) {
35
+ return /* @__PURE__ */ React.createElement(RemoveCircleOutline, null);
36
+ }
37
+ return /* @__PURE__ */ React.createElement(PanoramaFishEyeIcon, null);
38
+ };
39
+ return /* @__PURE__ */ React.createElement(
40
+ "div",
41
+ {
42
+ className: classNames(classes.root, {
43
+ [classes.completed]: completed,
44
+ [classes.error]: error
45
+ })
46
+ },
47
+ getMiddle()
48
+ );
49
+ };
50
+
51
+ export { StepIcon };
52
+ //# sourceMappingURL=StepIcon.esm.js.map
@@ -0,0 +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 React from 'react';\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":";;;;;;;;;AA0BA,MAAM,iBAAA,GAAoB,WAAW,CAAU,KAAA,MAAA;AAAA,EAC7C,IAAM,EAAA;AAAA,IACJ,KAAA,EAAO,KAAM,CAAA,OAAA,CAAQ,IAAK,CAAA,QAAA;AAAA,GAC5B;AAAA,EACA,SAAW,EAAA;AAAA,IACT,KAAA,EAAO,KAAM,CAAA,OAAA,CAAQ,MAAO,CAAA,EAAA;AAAA,GAC9B;AAAA,EACA,KAAO,EAAA;AAAA,IACL,KAAA,EAAO,KAAM,CAAA,OAAA,CAAQ,MAAO,CAAA,KAAA;AAAA,GAC9B;AACF,CAAE,CAAA,CAAA,CAAA;AAEW,MAAA,QAAA,GAAW,CAAC,KAAgD,KAAA;AACvE,EAAA,MAAM,UAAU,iBAAkB,EAAA,CAAA;AAClC,EAAA,MAAM,EAAE,MAAA,EAAQ,SAAW,EAAA,KAAA,EAAO,SAAY,GAAA,KAAA,CAAA;AAE9C,EAAA,MAAM,YAAY,MAAM;AACtB,IAAA,IAAI,MAAQ,EAAA;AACV,MAAO,uBAAA,KAAA,CAAA,aAAA,CAAC,gBAAiB,EAAA,EAAA,IAAA,EAAK,MAAO,EAAA,CAAA,CAAA;AAAA,KACvC;AACA,IAAA,IAAI,SAAW,EAAA;AACb,MAAA,2CAAQ,kBAAmB,EAAA,IAAA,CAAA,CAAA;AAAA,KAC7B;AAEA,IAAA,IAAI,KAAO,EAAA;AACT,MAAA,2CAAQ,YAAa,EAAA,IAAA,CAAA,CAAA;AAAA,KACvB;AAEA,IAAA,IAAI,OAAS,EAAA;AACX,MAAA,2CAAQ,mBAAoB,EAAA,IAAA,CAAA,CAAA;AAAA,KAC9B;AAEA,IAAA,2CAAQ,mBAAoB,EAAA,IAAA,CAAA,CAAA;AAAA,GAC9B,CAAA;AAEA,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAW,UAAW,CAAA,OAAA,CAAQ,IAAM,EAAA;AAAA,QAClC,CAAC,OAAQ,CAAA,SAAS,GAAG,SAAA;AAAA,QACrB,CAAC,OAAQ,CAAA,KAAK,GAAG,KAAA;AAAA,OAClB,CAAA;AAAA,KAAA;AAAA,IAEA,SAAU,EAAA;AAAA,GACb,CAAA;AAEJ;;;;"}
@@ -0,0 +1,36 @@
1
+ import React, { useState, useCallback } from 'react';
2
+ import useInterval from 'react-use/esm/useInterval';
3
+ import { DateTime, Interval } from 'luxon';
4
+ import humanizeDuration from 'humanize-duration';
5
+ import Typography from '@material-ui/core/Typography';
6
+ import { useMountEffect } from '@react-hookz/web';
7
+
8
+ const StepTime = (props) => {
9
+ const [time, setTime] = useState("");
10
+ const { step } = props;
11
+ const getDelay = () => {
12
+ if (step.startedAt && step.endedAt && time) {
13
+ return null;
14
+ }
15
+ if (step.startedAt && step.endedAt) {
16
+ return 1;
17
+ }
18
+ return 1e3;
19
+ };
20
+ const calculate = useCallback(() => {
21
+ if (!step.startedAt) {
22
+ setTime("");
23
+ return;
24
+ }
25
+ const end = step.endedAt ? DateTime.fromISO(step.endedAt) : DateTime.local();
26
+ const startedAt = DateTime.fromISO(step.startedAt);
27
+ const formatted = Interval.fromDateTimes(startedAt, end).toDuration().valueOf();
28
+ setTime(humanizeDuration(formatted, { round: true }));
29
+ }, [step.endedAt, step.startedAt]);
30
+ useMountEffect(calculate);
31
+ useInterval(calculate, getDelay());
32
+ return /* @__PURE__ */ React.createElement(Typography, { variant: "caption" }, time);
33
+ };
34
+
35
+ export { StepTime };
36
+ //# sourceMappingURL=StepTime.esm.js.map
@@ -0,0 +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 React, { 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":";;;;;;;AAsBa,MAAA,QAAA,GAAW,CAAC,KAOnB,KAAA;AACJ,EAAA,MAAM,CAAC,IAAA,EAAM,OAAO,CAAA,GAAI,SAAS,EAAE,CAAA,CAAA;AACnC,EAAM,MAAA,EAAE,MAAS,GAAA,KAAA,CAAA;AAEjB,EAAA,MAAM,WAAW,MAAM;AACrB,IAAA,IAAI,IAAK,CAAA,SAAA,IAAa,IAAK,CAAA,OAAA,IAAW,IAAM,EAAA;AAC1C,MAAO,OAAA,IAAA,CAAA;AAAA,KACT;AACA,IAAI,IAAA,IAAA,CAAK,SAAa,IAAA,IAAA,CAAK,OAAS,EAAA;AAClC,MAAO,OAAA,CAAA,CAAA;AAAA,KACT;AACA,IAAO,OAAA,GAAA,CAAA;AAAA,GACT,CAAA;AAEA,EAAM,MAAA,SAAA,GAAY,YAAY,MAAM;AAClC,IAAI,IAAA,CAAC,KAAK,SAAW,EAAA;AACnB,MAAA,OAAA,CAAQ,EAAE,CAAA,CAAA;AACV,MAAA,OAAA;AAAA,KACF;AAEA,IAAM,MAAA,GAAA,GAAM,KAAK,OACb,GAAA,QAAA,CAAS,QAAQ,IAAK,CAAA,OAAO,CAC7B,GAAA,QAAA,CAAS,KAAM,EAAA,CAAA;AAEnB,IAAA,MAAM,SAAY,GAAA,QAAA,CAAS,OAAQ,CAAA,IAAA,CAAK,SAAS,CAAA,CAAA;AACjD,IAAM,MAAA,SAAA,GAAY,SAAS,aAAc,CAAA,SAAA,EAAW,GAAG,CACpD,CAAA,UAAA,GACA,OAAQ,EAAA,CAAA;AAEX,IAAA,OAAA,CAAQ,iBAAiB,SAAW,EAAA,EAAE,KAAO,EAAA,IAAA,EAAM,CAAC,CAAA,CAAA;AAAA,KACnD,CAAC,IAAA,CAAK,OAAS,EAAA,IAAA,CAAK,SAAS,CAAC,CAAA,CAAA;AAEjC,EAAA,cAAA,CAAe,SAAS,CAAA,CAAA;AACxB,EAAY,WAAA,CAAA,SAAA,EAAW,UAAU,CAAA,CAAA;AAEjC,EAAA,uBAAQ,KAAA,CAAA,aAAA,CAAA,UAAA,EAAA,EAAW,OAAQ,EAAA,SAAA,EAAA,EAAW,IAAK,CAAA,CAAA;AAC7C;;;;"}
@@ -0,0 +1,29 @@
1
+ import React from 'react';
2
+ import LinearProgress from '@material-ui/core/LinearProgress';
3
+ import { makeStyles } from '@material-ui/core/styles';
4
+
5
+ const useStyles = makeStyles((theme) => ({
6
+ failed: {
7
+ backgroundColor: theme.palette.error.main
8
+ },
9
+ success: {
10
+ backgroundColor: theme.palette.success.main
11
+ }
12
+ }));
13
+ const TaskBorder = (props) => {
14
+ const styles = useStyles();
15
+ if (!props.isComplete) {
16
+ return /* @__PURE__ */ React.createElement(LinearProgress, { variant: "indeterminate" });
17
+ }
18
+ return /* @__PURE__ */ React.createElement(
19
+ LinearProgress,
20
+ {
21
+ variant: "determinate",
22
+ classes: { bar: props.isError ? styles.failed : styles.success },
23
+ value: 100
24
+ }
25
+ );
26
+ };
27
+
28
+ export { TaskBorder };
29
+ //# sourceMappingURL=TaskBorder.esm.js.map
@@ -0,0 +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 React from 'react';\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":";;;;AAoBA,MAAM,SAAA,GAAY,WAAW,CAAU,KAAA,MAAA;AAAA,EACrC,MAAQ,EAAA;AAAA,IACN,eAAA,EAAiB,KAAM,CAAA,OAAA,CAAQ,KAAM,CAAA,IAAA;AAAA,GACvC;AAAA,EACA,OAAS,EAAA;AAAA,IACP,eAAA,EAAiB,KAAM,CAAA,OAAA,CAAQ,OAAQ,CAAA,IAAA;AAAA,GACzC;AACF,CAAE,CAAA,CAAA,CAAA;AAKW,MAAA,UAAA,GAAa,CAAC,KAGrB,KAAA;AACJ,EAAA,MAAM,SAAS,SAAU,EAAA,CAAA;AAEzB,EAAI,IAAA,CAAC,MAAM,UAAY,EAAA;AACrB,IAAO,uBAAA,KAAA,CAAA,aAAA,CAAC,cAAe,EAAA,EAAA,OAAA,EAAQ,eAAgB,EAAA,CAAA,CAAA;AAAA,GACjD;AAEA,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,cAAA;AAAA,IAAA;AAAA,MACC,OAAQ,EAAA,aAAA;AAAA,MACR,OAAA,EAAS,EAAE,GAAK,EAAA,KAAA,CAAM,UAAU,MAAO,CAAA,MAAA,GAAS,OAAO,OAAQ,EAAA;AAAA,MAC/D,KAAO,EAAA,GAAA;AAAA,KAAA;AAAA,GACT,CAAA;AAEJ;;;;"}
@@ -0,0 +1,54 @@
1
+ import React from 'react';
2
+ import MuiStepper from '@material-ui/core/Stepper';
3
+ import MuiStep from '@material-ui/core/Step';
4
+ import MuiStepButton from '@material-ui/core/StepButton';
5
+ import MuiStepLabel from '@material-ui/core/StepLabel';
6
+ import Box from '@material-ui/core/Box';
7
+ import Paper from '@material-ui/core/Paper';
8
+ import { StepIcon } from './StepIcon.esm.js';
9
+ import { StepTime } from './StepTime.esm.js';
10
+ import { TaskBorder } from './TaskBorder.esm.js';
11
+
12
+ const TaskSteps = (props) => {
13
+ var _a, _b;
14
+ return /* @__PURE__ */ React.createElement(Paper, { style: { position: "relative", overflow: "hidden" } }, /* @__PURE__ */ React.createElement(
15
+ TaskBorder,
16
+ {
17
+ isComplete: (_a = props.isComplete) != null ? _a : false,
18
+ isError: (_b = props.isError) != null ? _b : false
19
+ }
20
+ ), /* @__PURE__ */ React.createElement(Box, { padding: 2 }, /* @__PURE__ */ React.createElement(
21
+ MuiStepper,
22
+ {
23
+ activeStep: props.activeStep,
24
+ alternativeLabel: true,
25
+ variant: "elevation",
26
+ style: { overflowX: "auto" }
27
+ },
28
+ props.steps.map((step) => {
29
+ const isCompleted = step.status === "completed";
30
+ const isFailed = step.status === "failed";
31
+ const isActive = step.status === "processing";
32
+ const isSkipped = step.status === "skipped";
33
+ const stepIconProps = {
34
+ completed: isCompleted,
35
+ error: isFailed,
36
+ active: isActive,
37
+ skipped: isSkipped
38
+ };
39
+ return /* @__PURE__ */ React.createElement(MuiStep, { key: step.id }, /* @__PURE__ */ React.createElement(MuiStepButton, null, /* @__PURE__ */ React.createElement(
40
+ MuiStepLabel,
41
+ {
42
+ StepIconProps: stepIconProps,
43
+ StepIconComponent: StepIcon,
44
+ "data-testid": "step-label"
45
+ },
46
+ /* @__PURE__ */ React.createElement(Box, null, step.name),
47
+ !isSkipped && /* @__PURE__ */ React.createElement(StepTime, { step })
48
+ )));
49
+ })
50
+ )));
51
+ };
52
+
53
+ export { TaskSteps };
54
+ //# sourceMappingURL=TaskSteps.esm.js.map
@@ -0,0 +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 React from 'react';\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":";;;;;;;;;;;AA8Ca,MAAA,SAAA,GAAY,CAAC,KAA0B,KAAA;AA9CpD,EAAA,IAAA,EAAA,EAAA,EAAA,CAAA;AA+CE,EACE,uBAAA,KAAA,CAAA,aAAA,CAAC,SAAM,KAAO,EAAA,EAAE,UAAU,UAAY,EAAA,QAAA,EAAU,UAC9C,EAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,UAAA,EAAA,CAAY,EAAM,GAAA,KAAA,CAAA,UAAA,KAAN,IAAoB,GAAA,EAAA,GAAA,KAAA;AAAA,MAChC,OAAA,EAAA,CAAS,EAAM,GAAA,KAAA,CAAA,OAAA,KAAN,IAAiB,GAAA,EAAA,GAAA,KAAA;AAAA,KAAA;AAAA,GAE5B,kBAAA,KAAA,CAAA,aAAA,CAAC,GAAI,EAAA,EAAA,OAAA,EAAS,CACZ,EAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,YAAY,KAAM,CAAA,UAAA;AAAA,MAClB,gBAAgB,EAAA,IAAA;AAAA,MAChB,OAAQ,EAAA,WAAA;AAAA,MACR,KAAA,EAAO,EAAE,SAAA,EAAW,MAAO,EAAA;AAAA,KAAA;AAAA,IAE1B,KAAA,CAAM,KAAM,CAAA,GAAA,CAAI,CAAQ,IAAA,KAAA;AACvB,MAAM,MAAA,WAAA,GAAc,KAAK,MAAW,KAAA,WAAA,CAAA;AACpC,MAAM,MAAA,QAAA,GAAW,KAAK,MAAW,KAAA,QAAA,CAAA;AACjC,MAAM,MAAA,QAAA,GAAW,KAAK,MAAW,KAAA,YAAA,CAAA;AACjC,MAAM,MAAA,SAAA,GAAY,KAAK,MAAW,KAAA,SAAA,CAAA;AAClC,MAAA,MAAM,aACJ,GAAA;AAAA,QACE,SAAW,EAAA,WAAA;AAAA,QACX,KAAO,EAAA,QAAA;AAAA,QACP,MAAQ,EAAA,QAAA;AAAA,QACR,OAAS,EAAA,SAAA;AAAA,OACX,CAAA;AAEF,MAAA,2CACG,OAAQ,EAAA,EAAA,GAAA,EAAK,IAAK,CAAA,EAAA,EAAA,sCAChB,aACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,QAAC,YAAA;AAAA,QAAA;AAAA,UACC,aAAe,EAAA,aAAA;AAAA,UACf,iBAAmB,EAAA,QAAA;AAAA,UACnB,aAAY,EAAA,YAAA;AAAA,SAAA;AAAA,wBAEZ,KAAA,CAAA,aAAA,CAAC,GAAK,EAAA,IAAA,EAAA,IAAA,CAAK,IAAK,CAAA;AAAA,QACf,CAAC,SAAA,oBAAc,KAAA,CAAA,aAAA,CAAA,QAAA,EAAA,EAAS,IAAY,EAAA,CAAA;AAAA,OAEzC,CACF,CAAA,CAAA;AAAA,KAEH,CAAA;AAAA,GAEL,CACF,CAAA,CAAA;AAEJ;;;;"}
@@ -0,0 +1,41 @@
1
+ import React from 'react';
2
+ import { makeStyles, useTheme } from '@material-ui/core/styles';
3
+ import { ItemCardHeader } from '@backstage/core-components';
4
+ import { FavoriteEntity } from '@backstage/plugin-catalog-react';
5
+
6
+ const useStyles = makeStyles(() => ({
7
+ header: {
8
+ backgroundImage: ({ cardBackgroundImage }) => cardBackgroundImage,
9
+ color: ({ cardFontColor }) => cardFontColor
10
+ },
11
+ subtitleWrapper: {
12
+ display: "flex",
13
+ justifyContent: "space-between"
14
+ }
15
+ }));
16
+ const CardHeader = (props) => {
17
+ const {
18
+ template: {
19
+ metadata: { title, name },
20
+ spec: { type }
21
+ }
22
+ } = props;
23
+ const { getPageTheme } = useTheme();
24
+ const themeForType = getPageTheme({ themeId: type });
25
+ const styles = useStyles({
26
+ cardFontColor: themeForType.fontColor,
27
+ cardBackgroundImage: themeForType.backgroundImage
28
+ });
29
+ const SubtitleComponent = /* @__PURE__ */ React.createElement("div", { className: styles.subtitleWrapper }, /* @__PURE__ */ React.createElement("div", null, type), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(FavoriteEntity, { entity: props.template, style: { padding: 0 } })));
30
+ return /* @__PURE__ */ React.createElement(
31
+ ItemCardHeader,
32
+ {
33
+ title: title != null ? title : name,
34
+ subtitle: SubtitleComponent,
35
+ classes: { root: styles.header }
36
+ }
37
+ );
38
+ };
39
+
40
+ export { CardHeader };
41
+ //# sourceMappingURL=CardHeader.esm.js.map
@@ -0,0 +1 @@
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 React from 'react';\nimport { Theme, makeStyles, 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';\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}));\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 <FavoriteEntity entity={props.template} style={{ padding: 0 }} />\n </div>\n </div>\n );\n\n return (\n <ItemCardHeader\n title={title ?? name}\n subtitle={SubtitleComponent}\n classes={{ root: styles.header }}\n />\n );\n};\n"],"names":[],"mappings":";;;;;AAsBA,MAAM,SAAA,GAAY,WAMhB,OAAO;AAAA,EACP,MAAQ,EAAA;AAAA,IACN,eAAiB,EAAA,CAAC,EAAE,mBAAA,EAA0B,KAAA,mBAAA;AAAA,IAC9C,KAAO,EAAA,CAAC,EAAE,aAAA,EAAoB,KAAA,aAAA;AAAA,GAChC;AAAA,EACA,eAAiB,EAAA;AAAA,IACf,OAAS,EAAA,MAAA;AAAA,IACT,cAAgB,EAAA,eAAA;AAAA,GAClB;AACF,CAAE,CAAA,CAAA,CAAA;AAYW,MAAA,UAAA,GAAa,CAAC,KAA2B,KAAA;AACpD,EAAM,MAAA;AAAA,IACJ,QAAU,EAAA;AAAA,MACR,QAAA,EAAU,EAAE,KAAA,EAAO,IAAK,EAAA;AAAA,MACxB,IAAA,EAAM,EAAE,IAAK,EAAA;AAAA,KACf;AAAA,GACE,GAAA,KAAA,CAAA;AACJ,EAAM,MAAA,EAAE,YAAa,EAAA,GAAI,QAAS,EAAA,CAAA;AAClC,EAAA,MAAM,YAAe,GAAA,YAAA,CAAa,EAAE,OAAA,EAAS,MAAM,CAAA,CAAA;AAEnD,EAAA,MAAM,SAAS,SAAU,CAAA;AAAA,IACvB,eAAe,YAAa,CAAA,SAAA;AAAA,IAC5B,qBAAqB,YAAa,CAAA,eAAA;AAAA,GACnC,CAAA,CAAA;AAED,EAAM,MAAA,iBAAA,uCACH,KAAI,EAAA,EAAA,SAAA,EAAW,OAAO,eACrB,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,KAAK,EAAA,IAAA,EAAA,IAAK,CACX,kBAAA,KAAA,CAAA,aAAA,CAAC,6BACE,KAAA,CAAA,aAAA,CAAA,cAAA,EAAA,EAAe,MAAQ,EAAA,KAAA,CAAM,QAAU,EAAA,KAAA,EAAO,EAAE,OAAS,EAAA,CAAA,EAAK,EAAA,CACjE,CACF,CAAA,CAAA;AAGF,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,cAAA;AAAA,IAAA;AAAA,MACC,OAAO,KAAS,IAAA,IAAA,GAAA,KAAA,GAAA,IAAA;AAAA,MAChB,QAAU,EAAA,iBAAA;AAAA,MACV,OAAS,EAAA,EAAE,IAAM,EAAA,MAAA,CAAO,MAAO,EAAA;AAAA,KAAA;AAAA,GACjC,CAAA;AAEJ;;;;"}
@@ -0,0 +1,17 @@
1
+ import { Link } from '@backstage/core-components';
2
+ import { makeStyles } from '@material-ui/core/styles';
3
+ import React from 'react';
4
+
5
+ const useStyles = makeStyles(() => ({
6
+ linkText: {
7
+ display: "inline-flex",
8
+ alignItems: "center"
9
+ }
10
+ }));
11
+ const CardLink = ({ icon: Icon, text, url }) => {
12
+ const styles = useStyles();
13
+ return /* @__PURE__ */ React.createElement("div", { className: styles.linkText }, /* @__PURE__ */ React.createElement(Icon, { fontSize: "small" }), /* @__PURE__ */ React.createElement(Link, { style: { marginLeft: "8px" }, to: url }, text || url));
14
+ };
15
+
16
+ export { CardLink };
17
+ //# sourceMappingURL=CardLink.esm.js.map
@@ -0,0 +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';\nimport React from 'react';\n\ninterface 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":";;;;AA2BA,MAAM,SAAA,GAAY,WAAW,OAAO;AAAA,EAClC,QAAU,EAAA;AAAA,IACR,OAAS,EAAA,aAAA;AAAA,IACT,UAAY,EAAA,QAAA;AAAA,GACd;AACF,CAAE,CAAA,CAAA,CAAA;AAEK,MAAM,WAAW,CAAC,EAAE,MAAM,IAAM,EAAA,IAAA,EAAM,KAAyB,KAAA;AACpE,EAAA,MAAM,SAAS,SAAU,EAAA,CAAA;AAEzB,EACE,uBAAA,KAAA,CAAA,aAAA,CAAC,SAAI,SAAW,EAAA,MAAA,CAAO,4BACpB,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAK,UAAS,OAAQ,EAAA,CAAA,sCACtB,IAAK,EAAA,EAAA,KAAA,EAAO,EAAE,UAAY,EAAA,KAAA,IAAS,EAAI,EAAA,GAAA,EAAA,EACrC,IAAQ,IAAA,GACX,CACF,CAAA,CAAA;AAEJ;;;;"}
@@ -0,0 +1,114 @@
1
+ import { RELATION_OWNED_BY } from '@backstage/catalog-model';
2
+ import { MarkdownContent, UserIcon } from '@backstage/core-components';
3
+ import { useApp } from '@backstage/core-plugin-api';
4
+ import { getEntityRelations, EntityRefLinks } from '@backstage/plugin-catalog-react';
5
+ import Box from '@material-ui/core/Box';
6
+ import Card from '@material-ui/core/Card';
7
+ import CardActions from '@material-ui/core/CardActions';
8
+ import CardContent from '@material-ui/core/CardContent';
9
+ import Chip from '@material-ui/core/Chip';
10
+ import Divider from '@material-ui/core/Divider';
11
+ import Button from '@material-ui/core/Button';
12
+ import Grid from '@material-ui/core/Grid';
13
+ import { makeStyles } from '@material-ui/core/styles';
14
+ import LanguageIcon from '@material-ui/icons/Language';
15
+ import React from 'react';
16
+ import { CardHeader } from './CardHeader.esm.js';
17
+ import { CardLink } from './CardLink.esm.js';
18
+
19
+ const useStyles = makeStyles((theme) => ({
20
+ box: {
21
+ overflow: "hidden",
22
+ textOverflow: "ellipsis",
23
+ display: "-webkit-box",
24
+ "-webkit-line-clamp": 10,
25
+ "-webkit-box-orient": "vertical"
26
+ },
27
+ markdown: {
28
+ /** to make the styles for React Markdown not leak into the description */
29
+ "& :first-child": {
30
+ margin: 0
31
+ }
32
+ },
33
+ label: {
34
+ color: theme.palette.text.secondary,
35
+ textTransform: "uppercase",
36
+ fontWeight: "bold",
37
+ letterSpacing: 0.5,
38
+ lineHeight: 1,
39
+ fontSize: "0.75rem"
40
+ },
41
+ footer: {
42
+ display: "flex",
43
+ justifyContent: "space-between",
44
+ flex: 1,
45
+ alignItems: "center"
46
+ },
47
+ ownedBy: {
48
+ display: "flex",
49
+ alignItems: "center",
50
+ flex: 1,
51
+ color: theme.palette.link
52
+ }
53
+ }));
54
+ const TemplateCard = (props) => {
55
+ var _a, _b, _c, _d, _e, _f, _g;
56
+ const { template } = props;
57
+ const styles = useStyles();
58
+ const ownedByRelations = getEntityRelations(template, RELATION_OWNED_BY);
59
+ const app = useApp();
60
+ const iconResolver = (key) => {
61
+ var _a2;
62
+ return key ? (_a2 = app.getSystemIcon(key)) != null ? _a2 : LanguageIcon : LanguageIcon;
63
+ };
64
+ const hasTags = !!((_a = template.metadata.tags) == null ? void 0 : _a.length);
65
+ const hasLinks = !!((_b = props.additionalLinks) == null ? void 0 : _b.length) || !!((_c = template.metadata.links) == null ? void 0 : _c.length);
66
+ const displayDefaultDivider = !hasTags && !hasLinks;
67
+ return /* @__PURE__ */ React.createElement(Card, null, /* @__PURE__ */ React.createElement(CardHeader, { template }), /* @__PURE__ */ React.createElement(CardContent, null, /* @__PURE__ */ React.createElement(Grid, { container: true, spacing: 2 }, /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(Box, { className: styles.box }, /* @__PURE__ */ React.createElement(
68
+ MarkdownContent,
69
+ {
70
+ className: styles.markdown,
71
+ content: (_d = template.metadata.description) != null ? _d : "No description"
72
+ }
73
+ ))), displayDefaultDivider && /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(Divider, { "data-testid": "template-card-separator" })), hasTags && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(Divider, { "data-testid": "template-card-separator--tags" })), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(Grid, { container: true, spacing: 2 }, (_e = template.metadata.tags) == null ? void 0 : _e.map((tag) => /* @__PURE__ */ React.createElement(Grid, { key: `grid-${tag}`, item: true }, /* @__PURE__ */ React.createElement(
74
+ Chip,
75
+ {
76
+ style: { margin: 0 },
77
+ size: "small",
78
+ label: tag,
79
+ key: tag
80
+ }
81
+ )))))), hasLinks && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(Divider, { "data-testid": "template-card-separator--links" })), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(Grid, { container: true, spacing: 2 }, (_f = props.additionalLinks) == null ? void 0 : _f.map(({ icon, text, url }, index) => /* @__PURE__ */ React.createElement(Grid, { className: styles.linkText, item: true, xs: 6, key: index }, /* @__PURE__ */ React.createElement(CardLink, { icon, text, url }))), (_g = template.metadata.links) == null ? void 0 : _g.map(
82
+ ({ url, icon, title }, index) => /* @__PURE__ */ React.createElement(Grid, { className: styles.linkText, item: true, xs: 6, key: index }, /* @__PURE__ */ React.createElement(
83
+ CardLink,
84
+ {
85
+ icon: iconResolver(icon),
86
+ text: title || url,
87
+ url
88
+ }
89
+ ))
90
+ )))))), /* @__PURE__ */ React.createElement(CardActions, { style: { padding: "16px", flex: 1, alignItems: "flex-end" } }, /* @__PURE__ */ React.createElement("div", { className: styles.footer }, /* @__PURE__ */ React.createElement("div", { className: styles.ownedBy }, ownedByRelations.length > 0 && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(UserIcon, { fontSize: "small" }), /* @__PURE__ */ React.createElement(
91
+ EntityRefLinks,
92
+ {
93
+ style: { marginLeft: "8px" },
94
+ entityRefs: ownedByRelations,
95
+ defaultKind: "Group",
96
+ hideIcons: true
97
+ }
98
+ ))), /* @__PURE__ */ React.createElement(
99
+ Button,
100
+ {
101
+ size: "small",
102
+ variant: "outlined",
103
+ color: "primary",
104
+ onClick: () => {
105
+ var _a2;
106
+ return (_a2 = props.onSelected) == null ? void 0 : _a2.call(props, template);
107
+ }
108
+ },
109
+ "Choose"
110
+ ))));
111
+ };
112
+
113
+ export { TemplateCard };
114
+ //# sourceMappingURL=TemplateCard.esm.js.map
@@ -0,0 +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 { MarkdownContent, UserIcon } from '@backstage/core-components';\nimport { IconComponent, useApp } from '@backstage/core-plugin-api';\nimport {\n EntityRefLinks,\n getEntityRelations,\n} from '@backstage/plugin-catalog-react';\nimport { TemplateEntityV1beta3 } from '@backstage/plugin-scaffolder-common';\nimport Box from '@material-ui/core/Box';\nimport Card from '@material-ui/core/Card';\nimport CardActions from '@material-ui/core/CardActions';\nimport CardContent from '@material-ui/core/CardContent';\nimport Chip from '@material-ui/core/Chip';\nimport Divider from '@material-ui/core/Divider';\nimport Button from '@material-ui/core/Button';\nimport Grid from '@material-ui/core/Grid';\nimport { makeStyles, Theme } from '@material-ui/core/styles';\nimport LanguageIcon from '@material-ui/icons/Language';\nimport React from 'react';\nimport { CardHeader } from './CardHeader';\nimport { CardLink } from './CardLink';\n\nconst useStyles = makeStyles<Theme>(theme => ({\n box: {\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n display: '-webkit-box',\n '-webkit-line-clamp': 10,\n '-webkit-box-orient': 'vertical',\n },\n markdown: {\n /** to make the styles for React Markdown not leak into the description */\n '& :first-child': {\n margin: 0,\n },\n },\n label: {\n color: theme.palette.text.secondary,\n textTransform: 'uppercase',\n fontWeight: 'bold',\n letterSpacing: 0.5,\n lineHeight: 1,\n fontSize: '0.75rem',\n },\n footer: {\n display: 'flex',\n justifyContent: 'space-between',\n flex: 1,\n alignItems: 'center',\n },\n ownedBy: {\n display: 'flex',\n alignItems: 'center',\n flex: 1,\n color: theme.palette.link,\n },\n}));\n\n/**\n * The Props for the {@link TemplateCard} component\n * @alpha\n */\nexport interface TemplateCardProps {\n template: TemplateEntityV1beta3;\n additionalLinks?: {\n icon: IconComponent;\n text: string;\n url: string;\n }[];\n\n onSelected?: (template: TemplateEntityV1beta3) => void;\n}\n\n/**\n * The `TemplateCard` component that is rendered in a list for each template\n * @alpha\n */\nexport const TemplateCard = (props: TemplateCardProps) => {\n const { template } = props;\n const styles = useStyles();\n const ownedByRelations = getEntityRelations(template, RELATION_OWNED_BY);\n const app = useApp();\n const iconResolver = (key?: string): IconComponent =>\n key ? app.getSystemIcon(key) ?? LanguageIcon : LanguageIcon;\n const hasTags = !!template.metadata.tags?.length;\n const hasLinks =\n !!props.additionalLinks?.length || !!template.metadata.links?.length;\n const displayDefaultDivider = !hasTags && !hasLinks;\n\n return (\n <Card>\n <CardHeader template={template} />\n <CardContent>\n <Grid container spacing={2}>\n <Grid item xs={12}>\n <Box className={styles.box}>\n <MarkdownContent\n className={styles.markdown}\n content={template.metadata.description ?? 'No description'}\n />\n </Box>\n </Grid>\n {displayDefaultDivider && (\n <Grid item xs={12}>\n <Divider data-testid=\"template-card-separator\" />\n </Grid>\n )}\n {hasTags && (\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}>\n {template.metadata.tags?.map(tag => (\n <Grid key={`grid-${tag}`} item>\n <Chip\n style={{ margin: 0 }}\n size=\"small\"\n label={tag}\n key={tag}\n />\n </Grid>\n ))}\n </Grid>\n </Grid>\n </>\n )}\n {hasLinks && (\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}>\n {props.additionalLinks?.map(({ icon, text, url }, index) => (\n <Grid className={styles.linkText} item xs={6} key={index}>\n <CardLink icon={icon} text={text} url={url} />\n </Grid>\n ))}\n {template.metadata.links?.map(\n ({ url, icon, title }, index) => (\n <Grid className={styles.linkText} item xs={6} key={index}>\n <CardLink\n icon={iconResolver(icon)}\n text={title || url}\n url={url}\n />\n </Grid>\n ),\n )}\n </Grid>\n </Grid>\n </>\n )}\n </Grid>\n </CardContent>\n <CardActions style={{ padding: '16px', flex: 1, alignItems: 'flex-end' }}>\n <div className={styles.footer}>\n <div className={styles.ownedBy}>\n {ownedByRelations.length > 0 && (\n <>\n <UserIcon fontSize=\"small\" />\n <EntityRefLinks\n style={{ marginLeft: '8px' }}\n entityRefs={ownedByRelations}\n defaultKind=\"Group\"\n hideIcons\n />\n </>\n )}\n </div>\n <Button\n size=\"small\"\n variant=\"outlined\"\n color=\"primary\"\n onClick={() => props.onSelected?.(template)}\n >\n Choose\n </Button>\n </div>\n </CardActions>\n </Card>\n );\n};\n"],"names":["_a"],"mappings":";;;;;;;;;;;;;;;;;;AAsCA,MAAM,SAAA,GAAY,WAAkB,CAAU,KAAA,MAAA;AAAA,EAC5C,GAAK,EAAA;AAAA,IACH,QAAU,EAAA,QAAA;AAAA,IACV,YAAc,EAAA,UAAA;AAAA,IACd,OAAS,EAAA,aAAA;AAAA,IACT,oBAAsB,EAAA,EAAA;AAAA,IACtB,oBAAsB,EAAA,UAAA;AAAA,GACxB;AAAA,EACA,QAAU,EAAA;AAAA;AAAA,IAER,gBAAkB,EAAA;AAAA,MAChB,MAAQ,EAAA,CAAA;AAAA,KACV;AAAA,GACF;AAAA,EACA,KAAO,EAAA;AAAA,IACL,KAAA,EAAO,KAAM,CAAA,OAAA,CAAQ,IAAK,CAAA,SAAA;AAAA,IAC1B,aAAe,EAAA,WAAA;AAAA,IACf,UAAY,EAAA,MAAA;AAAA,IACZ,aAAe,EAAA,GAAA;AAAA,IACf,UAAY,EAAA,CAAA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,WAAW,MAAO,CAAA,OAAA,EAAA,EACpB,gBAAiB,CAAA,MAAA,GAAS,qBAEvB,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,QAAS,EAAA,EAAA,QAAA,EAAS,SAAQ,CAC3B,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,cAAA;AAAA,IAAA;AAAA,MACC,KAAA,EAAO,EAAE,UAAA,EAAY,KAAM,EAAA;AAAA,MAC3B,UAAY,EAAA,gBAAA;AAAA,MACZ,WAAY,EAAA,OAAA;AAAA,MACZ,SAAS,EAAA,IAAA;AAAA,KAAA;AAAA,GAEb,CAEJ,CACA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,IAAK,EAAA,OAAA;AAAA,MACL,OAAQ,EAAA,UAAA;AAAA,MACR,KAAM,EAAA,SAAA;AAAA,MACN,SAAS,MAAG;AAhMxB,QAAAA,IAAAA,GAAAA,CAAAA;AAgM2B,QAAA,OAAA,CAAAA,GAAA,GAAA,KAAA,CAAM,UAAN,KAAA,IAAA,GAAA,KAAA,CAAA,GAAAA,IAAA,IAAmB,CAAA,KAAA,EAAA,QAAA,CAAA,CAAA;AAAA,OAAA;AAAA,KAAA;AAAA,IACnC,QAAA;AAAA,GAGH,CACF,CACF,CAAA,CAAA;AAEJ;;;;"}
@@ -0,0 +1,80 @@
1
+ import React from 'react';
2
+ import capitalize from 'lodash/capitalize';
3
+ import { Progress } from '@backstage/core-components';
4
+ import Box from '@material-ui/core/Box';
5
+ import Checkbox from '@material-ui/core/Checkbox';
6
+ import FormControlLabel from '@material-ui/core/FormControlLabel';
7
+ import TextField from '@material-ui/core/TextField';
8
+ import Typography from '@material-ui/core/Typography';
9
+ import { makeStyles } from '@material-ui/core/styles';
10
+ import CheckBoxIcon from '@material-ui/icons/CheckBox';
11
+ import CheckBoxOutlineBlankIcon from '@material-ui/icons/CheckBoxOutlineBlank';
12
+ import ExpandMoreIcon from '@material-ui/icons/ExpandMore';
13
+ import Autocomplete from '@material-ui/lab/Autocomplete';
14
+ import { useEntityTypeFilter } from '@backstage/plugin-catalog-react';
15
+ import { useApi, alertApiRef } from '@backstage/core-plugin-api';
16
+
17
+ const icon = /* @__PURE__ */ React.createElement(CheckBoxOutlineBlankIcon, { fontSize: "small" });
18
+ const checkedIcon = /* @__PURE__ */ React.createElement(CheckBoxIcon, { fontSize: "small" });
19
+ const useStyles = makeStyles(
20
+ {
21
+ root: {},
22
+ label: {}
23
+ },
24
+ { name: "ScaffolderReactTemplateCategoryPicker" }
25
+ );
26
+ const TemplateCategoryPicker = () => {
27
+ const classes = useStyles();
28
+ const alertApi = useApi(alertApiRef);
29
+ const { error, loading, availableTypes, selectedTypes, setSelectedTypes } = useEntityTypeFilter();
30
+ if (loading)
31
+ return /* @__PURE__ */ React.createElement(Progress, null);
32
+ if (error) {
33
+ alertApi.post({
34
+ message: `Failed to load entity types with error: ${error}`,
35
+ severity: "error"
36
+ });
37
+ return null;
38
+ }
39
+ if (!availableTypes)
40
+ return null;
41
+ return /* @__PURE__ */ React.createElement(Box, { className: classes.root, pb: 1, pt: 1 }, /* @__PURE__ */ React.createElement(
42
+ Typography,
43
+ {
44
+ className: classes.label,
45
+ variant: "button",
46
+ component: "label",
47
+ htmlFor: "categories-picker"
48
+ },
49
+ "Categories"
50
+ ), /* @__PURE__ */ React.createElement(
51
+ Autocomplete,
52
+ {
53
+ multiple: true,
54
+ id: "categories-picker",
55
+ options: availableTypes,
56
+ value: selectedTypes,
57
+ onChange: (_, value) => setSelectedTypes(value),
58
+ renderOption: (option, { selected }) => /* @__PURE__ */ React.createElement(
59
+ FormControlLabel,
60
+ {
61
+ control: /* @__PURE__ */ React.createElement(
62
+ Checkbox,
63
+ {
64
+ icon,
65
+ checkedIcon,
66
+ checked: selected
67
+ }
68
+ ),
69
+ label: capitalize(option)
70
+ }
71
+ ),
72
+ size: "small",
73
+ popupIcon: /* @__PURE__ */ React.createElement(ExpandMoreIcon, null),
74
+ renderInput: (params) => /* @__PURE__ */ React.createElement(TextField, { ...params, variant: "outlined" })
75
+ }
76
+ ));
77
+ };
78
+
79
+ export { TemplateCategoryPicker };
80
+ //# sourceMappingURL=TemplateCategoryPicker.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TemplateCategoryPicker.esm.js","sources":["../../../../src/next/components/TemplateCategoryPicker/TemplateCategoryPicker.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 React from 'react';\nimport capitalize from 'lodash/capitalize';\nimport { Progress } from '@backstage/core-components';\nimport Box from '@material-ui/core/Box';\nimport Checkbox from '@material-ui/core/Checkbox';\nimport FormControlLabel from '@material-ui/core/FormControlLabel';\nimport TextField from '@material-ui/core/TextField';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\nimport CheckBoxIcon from '@material-ui/icons/CheckBox';\nimport CheckBoxOutlineBlankIcon from '@material-ui/icons/CheckBoxOutlineBlank';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport Autocomplete from '@material-ui/lab/Autocomplete';\nimport { useEntityTypeFilter } from '@backstage/plugin-catalog-react';\nimport { alertApiRef, useApi } from '@backstage/core-plugin-api';\n\nconst icon = <CheckBoxOutlineBlankIcon fontSize=\"small\" />;\nconst checkedIcon = <CheckBoxIcon fontSize=\"small\" />;\n\n/** @alpha */\nexport type ScaffolderReactTemplateCategoryPickerClassKey = 'root' | 'label';\n\nconst useStyles = makeStyles(\n {\n root: {},\n label: {},\n },\n { name: 'ScaffolderReactTemplateCategoryPicker' },\n);\n\n/**\n * The Category Picker that is rendered on the left side for picking\n * categories and filtering the template list.\n * @alpha\n */\nexport const TemplateCategoryPicker = () => {\n const classes = useStyles();\n const alertApi = useApi(alertApiRef);\n const { error, loading, availableTypes, selectedTypes, setSelectedTypes } =\n useEntityTypeFilter();\n\n if (loading) return <Progress />;\n\n if (error) {\n alertApi.post({\n message: `Failed to load entity types with error: ${error}`,\n severity: 'error',\n });\n return null;\n }\n\n if (!availableTypes) return null;\n\n return (\n <Box className={classes.root} pb={1} pt={1}>\n <Typography\n className={classes.label}\n variant=\"button\"\n component=\"label\"\n htmlFor=\"categories-picker\"\n >\n Categories\n </Typography>\n <Autocomplete<string, true>\n multiple\n id=\"categories-picker\"\n options={availableTypes}\n value={selectedTypes}\n onChange={(_: object, value: string[]) => setSelectedTypes(value)}\n renderOption={(option, { selected }) => (\n <FormControlLabel\n control={\n <Checkbox\n icon={icon}\n checkedIcon={checkedIcon}\n checked={selected}\n />\n }\n label={capitalize(option)}\n />\n )}\n size=\"small\"\n popupIcon={<ExpandMoreIcon />}\n renderInput={params => <TextField {...params} variant=\"outlined\" />}\n />\n </Box>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAgCA,MAAM,IAAO,mBAAA,KAAA,CAAA,aAAA,CAAC,wBAAyB,EAAA,EAAA,QAAA,EAAS,OAAQ,EAAA,CAAA,CAAA;AACxD,MAAM,WAAc,mBAAA,KAAA,CAAA,aAAA,CAAC,YAAa,EAAA,EAAA,QAAA,EAAS,OAAQ,EAAA,CAAA,CAAA;AAKnD,MAAM,SAAY,GAAA,UAAA;AAAA,EAChB;AAAA,IACE,MAAM,EAAC;AAAA,IACP,OAAO,EAAC;AAAA,GACV;AAAA,EACA,EAAE,MAAM,uCAAwC,EAAA;AAClD,CAAA,CAAA;AAOO,MAAM,yBAAyB,MAAM;AAC1C,EAAA,MAAM,UAAU,SAAU,EAAA,CAAA;AAC1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