@backstage/plugin-scaffolder-react 1.15.0-next.0 → 1.15.0-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +38 -0
- package/dist/alpha.d.ts +22 -21
- package/dist/hooks/useCustomFieldExtensions.esm.js +2 -1
- package/dist/hooks/useCustomFieldExtensions.esm.js.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/layouts/createScaffolderLayout.esm.js.map +1 -1
- package/dist/next/components/Form/DescriptionFieldTemplate.esm.js +3 -3
- package/dist/next/components/Form/DescriptionFieldTemplate.esm.js.map +1 -1
- package/dist/next/components/Form/FieldTemplate.esm.js +18 -18
- package/dist/next/components/Form/FieldTemplate.esm.js.map +1 -1
- package/dist/next/components/Form/Form.esm.js +6 -5
- package/dist/next/components/Form/Form.esm.js.map +1 -1
- package/dist/next/components/PasswordWidget/PasswordWidget.esm.js +17 -14
- package/dist/next/components/PasswordWidget/PasswordWidget.esm.js.map +1 -1
- package/dist/next/components/ReviewState/ReviewState.esm.js +2 -2
- package/dist/next/components/ReviewState/ReviewState.esm.js.map +1 -1
- package/dist/next/components/ScaffolderField/ScaffolderField.esm.js +17 -15
- package/dist/next/components/ScaffolderField/ScaffolderField.esm.js.map +1 -1
- package/dist/next/components/ScaffolderPageContextMenu/ScaffolderPageContextMenu.esm.js +65 -44
- package/dist/next/components/ScaffolderPageContextMenu/ScaffolderPageContextMenu.esm.js.map +1 -1
- package/dist/next/components/SecretWidget/SecretWidget.esm.js +3 -2
- package/dist/next/components/SecretWidget/SecretWidget.esm.js.map +1 -1
- package/dist/next/components/Stepper/ErrorListTemplate/errorListTemplate.esm.js +11 -8
- package/dist/next/components/Stepper/ErrorListTemplate/errorListTemplate.esm.js.map +1 -1
- package/dist/next/components/Stepper/FieldOverrides/DescriptionField.esm.js +2 -2
- package/dist/next/components/Stepper/FieldOverrides/DescriptionField.esm.js.map +1 -1
- package/dist/next/components/Stepper/Stepper.esm.js +106 -90
- package/dist/next/components/Stepper/Stepper.esm.js.map +1 -1
- package/dist/next/components/TaskLogStream/TaskLogStream.esm.js +3 -3
- package/dist/next/components/TaskLogStream/TaskLogStream.esm.js.map +1 -1
- package/dist/next/components/TaskSteps/StepIcon.esm.js +10 -10
- package/dist/next/components/TaskSteps/StepIcon.esm.js.map +1 -1
- package/dist/next/components/TaskSteps/StepTime.esm.js +3 -2
- package/dist/next/components/TaskSteps/StepTime.esm.js.map +1 -1
- package/dist/next/components/TaskSteps/TaskBorder.esm.js +3 -3
- package/dist/next/components/TaskSteps/TaskBorder.esm.js.map +1 -1
- package/dist/next/components/TaskSteps/TaskSteps.esm.js +43 -38
- package/dist/next/components/TaskSteps/TaskSteps.esm.js.map +1 -1
- package/dist/next/components/TemplateCard/CardHeader.esm.js +15 -9
- package/dist/next/components/TemplateCard/CardHeader.esm.js.map +1 -1
- package/dist/next/components/TemplateCard/CardLink.esm.js +5 -2
- package/dist/next/components/TemplateCard/CardLink.esm.js.map +1 -1
- package/dist/next/components/TemplateCard/TemplateCard.esm.js +29 -19
- package/dist/next/components/TemplateCard/TemplateCard.esm.js.map +1 -1
- package/dist/next/components/TemplateCard/TemplateCardActions.esm.js +31 -25
- package/dist/next/components/TemplateCard/TemplateCardActions.esm.js.map +1 -1
- package/dist/next/components/TemplateCard/TemplateCardContent.esm.js +3 -3
- package/dist/next/components/TemplateCard/TemplateCardContent.esm.js.map +1 -1
- package/dist/next/components/TemplateCard/TemplateCardLinks.esm.js +35 -29
- package/dist/next/components/TemplateCard/TemplateCardLinks.esm.js.map +1 -1
- package/dist/next/components/TemplateCard/TemplateCardTags.esm.js +21 -18
- package/dist/next/components/TemplateCard/TemplateCardTags.esm.js.map +1 -1
- package/dist/next/components/TemplateCard/TemplateDetailButton.esm.js +13 -13
- package/dist/next/components/TemplateCard/TemplateDetailButton.esm.js.map +1 -1
- package/dist/next/components/TemplateCategoryPicker/TemplateCategoryPicker.esm.js +44 -41
- package/dist/next/components/TemplateCategoryPicker/TemplateCategoryPicker.esm.js.map +1 -1
- package/dist/next/components/TemplateGroup/TemplateGroup.esm.js +14 -11
- package/dist/next/components/TemplateGroup/TemplateGroup.esm.js.map +1 -1
- package/dist/next/components/TemplateGroups/TemplateGroups.esm.js +14 -8
- package/dist/next/components/TemplateGroups/TemplateGroups.esm.js.map +1 -1
- package/dist/next/components/TemplateOutputs/DefaultTemplateOutputs.esm.js +33 -27
- package/dist/next/components/TemplateOutputs/DefaultTemplateOutputs.esm.js.map +1 -1
- package/dist/next/components/TemplateOutputs/LinkOutputs.esm.js +4 -4
- package/dist/next/components/TemplateOutputs/LinkOutputs.esm.js.map +1 -1
- package/dist/next/components/TemplateOutputs/TextOutputs.esm.js +8 -8
- package/dist/next/components/TemplateOutputs/TextOutputs.esm.js.map +1 -1
- package/dist/next/components/Workflow/Workflow.esm.js +27 -23
- package/dist/next/components/Workflow/Workflow.esm.js.map +1 -1
- package/dist/secrets/SecretsContext.esm.js +6 -5
- package/dist/secrets/SecretsContext.esm.js.map +1 -1
- package/package.json +14 -14
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
1
2
|
import { UserIcon } from '@backstage/core-components';
|
|
2
3
|
import { useTranslationRef } from '@backstage/frontend-plugin-api';
|
|
3
4
|
import { EntityRefLinks } from '@backstage/plugin-catalog-react';
|
|
4
5
|
import Button from '@material-ui/core/Button';
|
|
5
6
|
import { makeStyles } from '@material-ui/core/styles';
|
|
6
|
-
import React from 'react';
|
|
7
7
|
import { scaffolderReactTranslationRef } from '../../../translation.esm.js';
|
|
8
8
|
|
|
9
9
|
const useStyles = makeStyles((theme) => ({
|
|
@@ -28,32 +28,38 @@ const TemplateCardActions = ({
|
|
|
28
28
|
}) => {
|
|
29
29
|
const { t } = useTranslationRef(scaffolderReactTranslationRef);
|
|
30
30
|
const styles = useStyles();
|
|
31
|
-
return /* @__PURE__ */
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
className: styles.ownedBy,
|
|
35
|
-
"data-testid": "template-card-actions--ownedby"
|
|
36
|
-
},
|
|
37
|
-
ownedByRelations.length > 0 && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(UserIcon, { fontSize: "small" }), /* @__PURE__ */ React.createElement(
|
|
38
|
-
EntityRefLinks,
|
|
31
|
+
return /* @__PURE__ */ jsxs("div", { className: styles.footer, "data-testid": "template-card-actions--footer", children: [
|
|
32
|
+
/* @__PURE__ */ jsx(
|
|
33
|
+
"div",
|
|
39
34
|
{
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
35
|
+
className: styles.ownedBy,
|
|
36
|
+
"data-testid": "template-card-actions--ownedby",
|
|
37
|
+
children: ownedByRelations.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
38
|
+
/* @__PURE__ */ jsx(UserIcon, { fontSize: "small" }),
|
|
39
|
+
/* @__PURE__ */ jsx(
|
|
40
|
+
EntityRefLinks,
|
|
41
|
+
{
|
|
42
|
+
style: { marginLeft: "8px" },
|
|
43
|
+
entityRefs: ownedByRelations,
|
|
44
|
+
defaultKind: "Group",
|
|
45
|
+
hideIcons: true
|
|
46
|
+
}
|
|
47
|
+
)
|
|
48
|
+
] })
|
|
44
49
|
}
|
|
45
|
-
)
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
50
|
+
),
|
|
51
|
+
canCreateTask ? /* @__PURE__ */ jsx(
|
|
52
|
+
Button,
|
|
53
|
+
{
|
|
54
|
+
size: "small",
|
|
55
|
+
variant: "outlined",
|
|
56
|
+
color: "primary",
|
|
57
|
+
"data-testid": "template-card-actions--create",
|
|
58
|
+
onClick: handleChoose,
|
|
59
|
+
children: t("templateCard.chooseButtonText")
|
|
60
|
+
}
|
|
61
|
+
) : null
|
|
62
|
+
] });
|
|
57
63
|
};
|
|
58
64
|
|
|
59
65
|
export { TemplateCardActions };
|
|
@@ -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';\
|
|
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,CAAU,KAAA,MAAA;AAAA,EAC5C,MAAQ,EAAA;AAAA,IACN,OAAS,EAAA,MAAA;AAAA,IACT,cAAgB,EAAA,eAAA;AAAA,IAChB,IAAM,EAAA,CAAA;AAAA,IACN,UAAY,EAAA;AAAA,GACd;AAAA,EACA,OAAS,EAAA;AAAA,IACP,OAAS,EAAA,MAAA;AAAA,IACT,UAAY,EAAA,QAAA;AAAA,IACZ,IAAM,EAAA,CAAA;AAAA,IACN,KAAA,EAAO,MAAM,OAAQ,CAAA;AAAA,GACvB;AAAA,EACA,iBAAiB,EAAE,OAAA,EAAS,QAAQ,IAAM,EAAA,CAAA,EAAG,YAAY,UAAW;AACtE,CAAE,CAAA,CAAA;AAWK,MAAM,sBAAsB,CAAC;AAAA,EAClC,aAAA;AAAA,EACA,YAAA;AAAA,EACA;AACF,CAAgC,KAAA;AAC9B,EAAA,MAAM,EAAE,CAAA,EAAM,GAAA,iBAAA,CAAkB,6BAA6B,CAAA;AAC7D,EAAA,MAAM,SAAS,SAAU,EAAA;AAEzB,EAAA,4BACG,KAAI,EAAA,EAAA,SAAA,EAAW,MAAO,CAAA,MAAA,EAAQ,eAAY,+BACzC,EAAA,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,KAAA;AAAA,MAAA;AAAA,QACC,WAAW,MAAO,CAAA,OAAA;AAAA,QAClB,aAAY,EAAA,gCAAA;AAAA,QAEX,QAAA,EAAA,gBAAA,CAAiB,MAAS,GAAA,CAAA,oBAEvB,IAAA,CAAA,QAAA,EAAA,EAAA,QAAA,EAAA;AAAA,0BAAC,GAAA,CAAA,QAAA,EAAA,EAAS,UAAS,OAAQ,EAAA,CAAA;AAAA,0BAC3B,GAAA;AAAA,YAAC,cAAA;AAAA,YAAA;AAAA,cACC,KAAA,EAAO,EAAE,UAAA,EAAY,KAAM,EAAA;AAAA,cAC3B,UAAY,EAAA,gBAAA;AAAA,cACZ,WAAY,EAAA,OAAA;AAAA,cACZ,SAAS,EAAA;AAAA;AAAA;AACX,SACF,EAAA;AAAA;AAAA,KAEJ;AAAA,IACC,aACC,mBAAA,GAAA;AAAA,MAAC,MAAA;AAAA,MAAA;AAAA,QACC,IAAK,EAAA,OAAA;AAAA,QACL,OAAQ,EAAA,UAAA;AAAA,QACR,KAAM,EAAA,SAAA;AAAA,QACN,aAAY,EAAA,+BAAA;AAAA,QACZ,OAAS,EAAA,YAAA;AAAA,QAER,YAAE,+BAA+B;AAAA;AAAA,KAElC,GAAA;AAAA,GACN,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
1
2
|
import { MarkdownContent } from '@backstage/core-components';
|
|
2
3
|
import { useTranslationRef } from '@backstage/frontend-plugin-api';
|
|
3
4
|
import Box from '@material-ui/core/Box';
|
|
4
5
|
import Grid from '@material-ui/core/Grid';
|
|
5
6
|
import { makeStyles } from '@material-ui/core/styles';
|
|
6
|
-
import React from 'react';
|
|
7
7
|
import { scaffolderReactTranslationRef } from '../../../translation.esm.js';
|
|
8
8
|
|
|
9
9
|
const useStyles = makeStyles(() => ({
|
|
@@ -24,13 +24,13 @@ const useStyles = makeStyles(() => ({
|
|
|
24
24
|
const TemplateCardContent = ({ template }) => {
|
|
25
25
|
const { t } = useTranslationRef(scaffolderReactTranslationRef);
|
|
26
26
|
const styles = useStyles();
|
|
27
|
-
return /* @__PURE__ */
|
|
27
|
+
return /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, "data-testid": "template-card-content-grid", children: /* @__PURE__ */ jsx(Box, { className: styles.box, "data-testid": "template-card-content-container", children: /* @__PURE__ */ jsx(
|
|
28
28
|
MarkdownContent,
|
|
29
29
|
{
|
|
30
30
|
className: styles.markdown,
|
|
31
31
|
content: template.metadata.description ?? t("templateCard.noDescription")
|
|
32
32
|
}
|
|
33
|
-
)));
|
|
33
|
+
) }) });
|
|
34
34
|
};
|
|
35
35
|
|
|
36
36
|
export { TemplateCardContent };
|
|
@@ -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';\
|
|
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,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;AAAA,GACxB;AAAA,EACA,QAAU,EAAA;AAAA;AAAA,IAER,gBAAkB,EAAA;AAAA,MAChB,MAAQ,EAAA;AAAA;AACV;AAEJ,CAAE,CAAA,CAAA;AASK,MAAM,mBAAsB,GAAA,CAAC,EAAE,QAAA,EAAyC,KAAA;AAC7E,EAAA,MAAM,EAAE,CAAA,EAAM,GAAA,iBAAA,CAAkB,6BAA6B,CAAA;AAC7D,EAAA,MAAM,SAAS,SAAU,EAAA;AACzB,EAAA,uBACG,GAAA,CAAA,IAAA,EAAA,EAAK,IAAI,EAAA,IAAA,EAAC,IAAI,EAAI,EAAA,aAAA,EAAY,4BAC7B,EAAA,QAAA,kBAAA,GAAA,CAAC,GAAI,EAAA,EAAA,SAAA,EAAW,MAAO,CAAA,GAAA,EAAK,eAAY,iCACtC,EAAA,QAAA,kBAAA,GAAA;AAAA,IAAC,eAAA;AAAA,IAAA;AAAA,MACC,WAAW,MAAO,CAAA,QAAA;AAAA,MAClB,OACE,EAAA,QAAA,CAAS,QAAS,CAAA,WAAA,IAAe,EAAE,4BAA4B;AAAA;AAAA,KAGrE,CACF,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
1
2
|
import { useApp } from '@backstage/core-plugin-api';
|
|
2
3
|
import Divider from '@material-ui/core/Divider';
|
|
3
4
|
import Grid from '@material-ui/core/Grid';
|
|
4
5
|
import { makeStyles } from '@material-ui/core/styles';
|
|
5
6
|
import LanguageIcon from '@material-ui/icons/Language';
|
|
6
|
-
import React from 'react';
|
|
7
7
|
import { CardLink } from './CardLink.esm.js';
|
|
8
8
|
|
|
9
9
|
const useStyles = makeStyles({});
|
|
@@ -14,34 +14,40 @@ const TemplateCardLinks = ({
|
|
|
14
14
|
const styles = useStyles();
|
|
15
15
|
const app = useApp();
|
|
16
16
|
const iconResolver = (key) => key ? app.getSystemIcon(key) ?? LanguageIcon : LanguageIcon;
|
|
17
|
-
return /* @__PURE__ */
|
|
18
|
-
Grid,
|
|
19
|
-
{
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
17
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
18
|
+
/* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(Divider, { "data-testid": "template-card-separator--links" }) }),
|
|
19
|
+
/* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 2, "data-testid": "template-card-links", children: [
|
|
20
|
+
additionalLinks?.map(({ icon, text, url }, index) => /* @__PURE__ */ jsx(
|
|
21
|
+
Grid,
|
|
22
|
+
{
|
|
23
|
+
className: styles.linkText,
|
|
24
|
+
item: true,
|
|
25
|
+
xs: 6,
|
|
26
|
+
"data-testid": "template-card-links--item",
|
|
27
|
+
children: /* @__PURE__ */ jsx(CardLink, { icon, text, url })
|
|
28
|
+
},
|
|
29
|
+
index
|
|
30
|
+
)),
|
|
31
|
+
template.metadata.links?.map(({ url, icon, title }, index) => /* @__PURE__ */ jsx(
|
|
32
|
+
Grid,
|
|
33
|
+
{
|
|
34
|
+
className: styles.linkText,
|
|
35
|
+
item: true,
|
|
36
|
+
xs: 6,
|
|
37
|
+
"data-testid": "template-card-links--metalink",
|
|
38
|
+
children: /* @__PURE__ */ jsx(
|
|
39
|
+
CardLink,
|
|
40
|
+
{
|
|
41
|
+
icon: iconResolver(icon),
|
|
42
|
+
text: title || url,
|
|
43
|
+
url
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
},
|
|
47
|
+
index
|
|
48
|
+
))
|
|
49
|
+
] }) })
|
|
50
|
+
] });
|
|
45
51
|
};
|
|
46
52
|
|
|
47
53
|
export { TemplateCardLinks };
|
|
@@ -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
|
|
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,UAAkB,CAAA,EAAE,CAAA;AAc/B,MAAM,oBAAoB,CAAC;AAAA,EAChC,QAAA;AAAA,EACA;AACF,CAA8B,KAAA;AAC5B,EAAA,MAAM,SAAS,SAAU,EAAA;AACzB,EAAA,MAAM,MAAM,MAAO,EAAA;AACnB,EAAM,MAAA,YAAA,GAAe,CAAC,GACpB,KAAA,GAAA,GAAM,IAAI,aAAc,CAAA,GAAG,KAAK,YAAe,GAAA,YAAA;AACjD,EAAA,uBAEI,IAAA,CAAA,QAAA,EAAA,EAAA,QAAA,EAAA;AAAA,oBAAC,GAAA,CAAA,IAAA,EAAA,EAAK,MAAI,IAAC,EAAA,EAAA,EAAI,IACb,QAAC,kBAAA,GAAA,CAAA,OAAA,EAAA,EAAQ,aAAY,EAAA,gCAAA,EAAiC,CACxD,EAAA,CAAA;AAAA,oBACC,GAAA,CAAA,IAAA,EAAA,EAAK,IAAI,EAAA,IAAA,EAAC,EAAI,EAAA,EAAA,EACb,QAAC,kBAAA,IAAA,CAAA,IAAA,EAAA,EAAK,SAAS,EAAA,IAAA,EAAC,OAAS,EAAA,CAAA,EAAG,eAAY,qBACrC,EAAA,QAAA,EAAA;AAAA,MAAA,eAAA,EAAiB,IAAI,CAAC,EAAE,MAAM,IAAM,EAAA,GAAA,IAAO,KAC1C,qBAAA,GAAA;AAAA,QAAC,IAAA;AAAA,QAAA;AAAA,UACC,WAAW,MAAO,CAAA,QAAA;AAAA,UAClB,IAAI,EAAA,IAAA;AAAA,UACJ,EAAI,EAAA,CAAA;AAAA,UAEJ,aAAY,EAAA,2BAAA;AAAA,UAEZ,QAAC,kBAAA,GAAA,CAAA,QAAA,EAAA,EAAS,IAAY,EAAA,IAAA,EAAY,GAAU,EAAA;AAAA,SAAA;AAAA,QAHvC;AAAA,OAKR,CAAA;AAAA,MACA,QAAA,CAAS,QAAS,CAAA,KAAA,EAAO,GAAI,CAAA,CAAC,EAAE,GAAK,EAAA,IAAA,EAAM,KAAM,EAAA,EAAG,KACnD,qBAAA,GAAA;AAAA,QAAC,IAAA;AAAA,QAAA;AAAA,UACC,WAAW,MAAO,CAAA,QAAA;AAAA,UAClB,IAAI,EAAA,IAAA;AAAA,UACJ,EAAI,EAAA,CAAA;AAAA,UAEJ,aAAY,EAAA,+BAAA;AAAA,UAEZ,QAAA,kBAAA,GAAA;AAAA,YAAC,QAAA;AAAA,YAAA;AAAA,cACC,IAAA,EAAM,aAAa,IAAI,CAAA;AAAA,cACvB,MAAM,KAAS,IAAA,GAAA;AAAA,cACf;AAAA;AAAA;AACF,SAAA;AAAA,QAPK;AAAA,OASR;AAAA,KAAA,EACH,CACF,EAAA;AAAA,GACF,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,26 +1,29 @@
|
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
1
2
|
import Chip from '@material-ui/core/Chip';
|
|
2
3
|
import Divider from '@material-ui/core/Divider';
|
|
3
4
|
import Grid from '@material-ui/core/Grid';
|
|
4
|
-
import React from 'react';
|
|
5
5
|
|
|
6
|
-
const TemplateCardTags = ({ template }) => /* @__PURE__ */
|
|
7
|
-
Grid,
|
|
8
|
-
{
|
|
9
|
-
|
|
10
|
-
item: true,
|
|
11
|
-
"data-testid": `template-card-tag-item-${tag}`
|
|
12
|
-
},
|
|
13
|
-
/* @__PURE__ */ React.createElement(
|
|
14
|
-
Chip,
|
|
6
|
+
const TemplateCardTags = ({ template }) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
7
|
+
/* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(Divider, { "data-testid": "template-card-separator--tags" }) }),
|
|
8
|
+
/* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(Grid, { container: true, spacing: 2, "data-testid": "template-card-tags", children: template.metadata.tags?.map((tag) => /* @__PURE__ */ jsx(
|
|
9
|
+
Grid,
|
|
15
10
|
{
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
11
|
+
item: true,
|
|
12
|
+
"data-testid": `template-card-tag-item-${tag}`,
|
|
13
|
+
children: /* @__PURE__ */ jsx(
|
|
14
|
+
Chip,
|
|
15
|
+
{
|
|
16
|
+
style: { margin: 0 },
|
|
17
|
+
size: "small",
|
|
18
|
+
"data-testid": `template-card-tag-chip-${tag}`,
|
|
19
|
+
label: tag
|
|
20
|
+
},
|
|
21
|
+
tag
|
|
22
|
+
)
|
|
23
|
+
},
|
|
24
|
+
`grid-${tag}`
|
|
25
|
+
)) }) })
|
|
26
|
+
] });
|
|
24
27
|
|
|
25
28
|
export { TemplateCardTags };
|
|
26
29
|
//# sourceMappingURL=TemplateCardTags.esm.js.map
|
|
@@ -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';\
|
|
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,gBAAmB,GAAA,CAAC,EAAE,QAAA,uBAE/B,IAAA,CAAA,QAAA,EAAA,EAAA,QAAA,EAAA;AAAA,kBAAC,GAAA,CAAA,IAAA,EAAA,EAAK,MAAI,IAAC,EAAA,EAAA,EAAI,IACb,QAAC,kBAAA,GAAA,CAAA,OAAA,EAAA,EAAQ,aAAY,EAAA,+BAAA,EAAgC,CACvD,EAAA,CAAA;AAAA,sBACC,IAAK,EAAA,EAAA,IAAA,EAAI,MAAC,EAAI,EAAA,EAAA,EACb,8BAAC,IAAK,EAAA,EAAA,SAAA,EAAS,IAAC,EAAA,OAAA,EAAS,GAAG,aAAY,EAAA,oBAAA,EACrC,mBAAS,QAAS,CAAA,IAAA,EAAM,IAAI,CAC3B,GAAA,qBAAA,GAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MAEC,IAAI,EAAA,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,CAAE,EAAA;AAAA,UACnB,IAAK,EAAA,OAAA;AAAA,UACL,aAAA,EAAa,0BAA0B,GAAG,CAAA,CAAA;AAAA,UAC1C,KAAO,EAAA;AAAA,SAAA;AAAA,QACF;AAAA;AACP,KAAA;AAAA,IAVK,QAAQ,GAAG,CAAA;AAAA,GAYnB,GACH,CACF,EAAA;AAAA,CACF,EAAA;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import Tooltip from '@material-ui/core/Tooltip';
|
|
3
3
|
import IconButton from '@material-ui/core/IconButton';
|
|
4
4
|
import Typography from '@material-ui/core/Typography';
|
|
@@ -18,23 +18,23 @@ const TemplateDetailButton = ({
|
|
|
18
18
|
const entityRef = stringifyEntityRef(template);
|
|
19
19
|
const app = useApp();
|
|
20
20
|
const TemplateIcon = app.getSystemIcon("kind:template") || DescriptionIcon;
|
|
21
|
-
return /* @__PURE__ */
|
|
21
|
+
return /* @__PURE__ */ jsx(Tooltip, { id: `tooltip-${entityRef}`, title: t("cardHeader.detailBtnTitle"), children: /* @__PURE__ */ jsx(
|
|
22
22
|
IconButton,
|
|
23
23
|
{
|
|
24
24
|
"aria-label": t("cardHeader.detailBtnTitle"),
|
|
25
25
|
id: `viewDetail-${entityRef}`,
|
|
26
26
|
style: { padding: 0 },
|
|
27
|
-
color: "inherit"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
));
|
|
27
|
+
color: "inherit",
|
|
28
|
+
children: /* @__PURE__ */ jsx(Typography, { component: "span", children: /* @__PURE__ */ jsx(
|
|
29
|
+
Link,
|
|
30
|
+
{
|
|
31
|
+
to: catalogEntityRoute(entityRouteParams(template)),
|
|
32
|
+
style: { display: "flex", alignItems: "center" },
|
|
33
|
+
children: /* @__PURE__ */ jsx(TemplateIcon, {})
|
|
34
|
+
}
|
|
35
|
+
) })
|
|
36
|
+
}
|
|
37
|
+
) });
|
|
38
38
|
};
|
|
39
39
|
|
|
40
40
|
export { TemplateDetailButton };
|
|
@@ -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
|
|
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}\n\nexport const TemplateDetailButton = ({\n template,\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 color=\"inherit\"\n >\n <Typography component=\"span\">\n <Link\n to={catalogEntityRoute(entityRouteParams(template))}\n style={{ display: 'flex', alignItems: 'center' }}\n >\n <TemplateIcon />\n </Link>\n </Typography>\n </IconButton>\n </Tooltip>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;AAiCO,MAAM,uBAAuB,CAAC;AAAA,EACnC;AACF,CAAiC,KAAA;AAC/B,EAAM,MAAA,kBAAA,GAAqB,YAAY,cAAc,CAAA;AACrD,EAAA,MAAM,EAAE,CAAA,EAAM,GAAA,iBAAA,CAAkB,6BAA6B,CAAA;AAC7D,EAAM,MAAA,SAAA,GAAY,mBAAmB,QAAQ,CAAA;AAE7C,EAAA,MAAM,MAAM,MAAO,EAAA;AACnB,EAAA,MAAM,YAAe,GAAA,GAAA,CAAI,aAAc,CAAA,eAAe,CAAK,IAAA,eAAA;AAE3D,EACE,uBAAA,GAAA,CAAC,WAAQ,EAAI,EAAA,CAAA,QAAA,EAAW,SAAS,CAAI,CAAA,EAAA,KAAA,EAAO,CAAE,CAAA,2BAA2B,CACvE,EAAA,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,CAAE,EAAA;AAAA,MACpB,KAAM,EAAA,SAAA;AAAA,MAEN,QAAA,kBAAA,GAAA,CAAC,UAAW,EAAA,EAAA,SAAA,EAAU,MACpB,EAAA,QAAA,kBAAA,GAAA;AAAA,QAAC,IAAA;AAAA,QAAA;AAAA,UACC,EAAI,EAAA,kBAAA,CAAmB,iBAAkB,CAAA,QAAQ,CAAC,CAAA;AAAA,UAClD,KAAO,EAAA,EAAE,OAAS,EAAA,MAAA,EAAQ,YAAY,QAAS,EAAA;AAAA,UAE/C,8BAAC,YAAa,EAAA,EAAA;AAAA;AAAA,OAElB,EAAA;AAAA;AAAA,GAEJ,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
1
2
|
import { Progress } from '@backstage/core-components';
|
|
2
3
|
import { useApi, alertApiRef } from '@backstage/core-plugin-api';
|
|
3
4
|
import { useTranslationRef } from '@backstage/frontend-plugin-api';
|
|
@@ -13,11 +14,10 @@ import CheckBoxOutlineBlankIcon from '@material-ui/icons/CheckBoxOutlineBlank';
|
|
|
13
14
|
import ExpandMoreIcon from '@material-ui/icons/ExpandMore';
|
|
14
15
|
import Autocomplete from '@material-ui/lab/Autocomplete';
|
|
15
16
|
import capitalize from 'lodash/capitalize';
|
|
16
|
-
import React from 'react';
|
|
17
17
|
import { scaffolderReactTranslationRef } from '../../../translation.esm.js';
|
|
18
18
|
|
|
19
|
-
const icon = /* @__PURE__ */
|
|
20
|
-
const checkedIcon = /* @__PURE__ */
|
|
19
|
+
const icon = /* @__PURE__ */ jsx(CheckBoxOutlineBlankIcon, { fontSize: "small" });
|
|
20
|
+
const checkedIcon = /* @__PURE__ */ jsx(CheckBoxIcon, { fontSize: "small" });
|
|
21
21
|
const useStyles = makeStyles(
|
|
22
22
|
{
|
|
23
23
|
root: {},
|
|
@@ -30,7 +30,7 @@ const TemplateCategoryPicker = () => {
|
|
|
30
30
|
const classes = useStyles();
|
|
31
31
|
const alertApi = useApi(alertApiRef);
|
|
32
32
|
const { error, loading, availableTypes, selectedTypes, setSelectedTypes } = useEntityTypeFilter();
|
|
33
|
-
if (loading) return /* @__PURE__ */
|
|
33
|
+
if (loading) return /* @__PURE__ */ jsx(Progress, {});
|
|
34
34
|
if (error) {
|
|
35
35
|
alertApi.post({
|
|
36
36
|
message: `Failed to load entity types with error: ${error}`,
|
|
@@ -39,43 +39,46 @@ const TemplateCategoryPicker = () => {
|
|
|
39
39
|
return null;
|
|
40
40
|
}
|
|
41
41
|
if (!availableTypes) return null;
|
|
42
|
-
return /* @__PURE__ */
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
{
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
42
|
+
return /* @__PURE__ */ jsxs(Box, { className: classes.root, pb: 1, pt: 1, children: [
|
|
43
|
+
/* @__PURE__ */ jsx(
|
|
44
|
+
Typography,
|
|
45
|
+
{
|
|
46
|
+
className: classes.label,
|
|
47
|
+
variant: "button",
|
|
48
|
+
component: "label",
|
|
49
|
+
htmlFor: "categories-picker",
|
|
50
|
+
children: t("templateCategoryPicker.title")
|
|
51
|
+
}
|
|
52
|
+
),
|
|
53
|
+
/* @__PURE__ */ jsx(
|
|
54
|
+
Autocomplete,
|
|
55
|
+
{
|
|
56
|
+
PopperComponent: (popperProps) => /* @__PURE__ */ jsx("div", { ...popperProps, children: popperProps.children }),
|
|
57
|
+
multiple: true,
|
|
58
|
+
id: "categories-picker",
|
|
59
|
+
options: availableTypes,
|
|
60
|
+
value: selectedTypes,
|
|
61
|
+
onChange: (_, value) => setSelectedTypes(value),
|
|
62
|
+
renderOption: (option, { selected }) => /* @__PURE__ */ jsx(
|
|
63
|
+
FormControlLabel,
|
|
64
|
+
{
|
|
65
|
+
control: /* @__PURE__ */ jsx(
|
|
66
|
+
Checkbox,
|
|
67
|
+
{
|
|
68
|
+
icon,
|
|
69
|
+
checkedIcon,
|
|
70
|
+
checked: selected
|
|
71
|
+
}
|
|
72
|
+
),
|
|
73
|
+
label: capitalize(option)
|
|
74
|
+
}
|
|
75
|
+
),
|
|
76
|
+
size: "small",
|
|
77
|
+
popupIcon: /* @__PURE__ */ jsx(ExpandMoreIcon, {}),
|
|
78
|
+
renderInput: (params) => /* @__PURE__ */ jsx(TextField, { ...params, variant: "outlined" })
|
|
79
|
+
}
|
|
80
|
+
)
|
|
81
|
+
] });
|
|
79
82
|
};
|
|
80
83
|
|
|
81
84
|
export { TemplateCategoryPicker };
|
|
@@ -1 +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 { Progress } from '@backstage/core-components';\nimport { alertApiRef, useApi } from '@backstage/core-plugin-api';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport { useEntityTypeFilter } from '@backstage/plugin-catalog-react';\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 capitalize from 'lodash/capitalize';\nimport
|
|
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 { Progress } from '@backstage/core-components';\nimport { alertApiRef, useApi } from '@backstage/core-plugin-api';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport { useEntityTypeFilter } from '@backstage/plugin-catalog-react';\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 capitalize from 'lodash/capitalize';\nimport { ReactNode } from 'react';\n\nimport { scaffolderReactTranslationRef } from '../../../translation';\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 { t } = useTranslationRef(scaffolderReactTranslationRef);\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 {t('templateCategoryPicker.title')}\n </Typography>\n <Autocomplete<string, true>\n PopperComponent={popperProps => (\n <div {...popperProps}>{popperProps.children as ReactNode}</div>\n )}\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":";;;;;;;;;;;;;;;;;;AAmCA,MAAM,IAAO,mBAAA,GAAA,CAAC,wBAAyB,EAAA,EAAA,QAAA,EAAS,OAAQ,EAAA,CAAA;AACxD,MAAM,WAAc,mBAAA,GAAA,CAAC,YAAa,EAAA,EAAA,QAAA,EAAS,OAAQ,EAAA,CAAA;AAKnD,MAAM,SAAY,GAAA,UAAA;AAAA,EAChB;AAAA,IACE,MAAM,EAAC;AAAA,IACP,OAAO;AAAC,GACV;AAAA,EACA,EAAE,MAAM,uCAAwC;AAClD,CAAA;AAOO,MAAM,yBAAyB,MAAM;AAC1C,EAAA,MAAM,EAAE,CAAA,EAAM,GAAA,iBAAA,CAAkB,6BAA6B,CAAA;AAC7D,EAAA,MAAM,UAAU,SAAU,EAAA;AAC1B,EAAM,MAAA,QAAA,GAAW,OAAO,WAAW,CAAA;AACnC,EAAA,MAAM,EAAE,KAAO,EAAA,OAAA,EAAS,gBAAgB,aAAe,EAAA,gBAAA,KACrD,mBAAoB,EAAA;AAEtB,EAAI,IAAA,OAAA,EAAgB,uBAAA,GAAA,CAAC,QAAS,EAAA,EAAA,CAAA;AAE9B,EAAA,IAAI,KAAO,EAAA;AACT,IAAA,QAAA,CAAS,IAAK,CAAA;AAAA,MACZ,OAAA,EAAS,2CAA2C,KAAK,CAAA,CAAA;AAAA,MACzD,QAAU,EAAA;AAAA,KACX,CAAA;AACD,IAAO,OAAA,IAAA;AAAA;AAGT,EAAI,IAAA,CAAC,gBAAuB,OAAA,IAAA;AAE5B,EACE,uBAAA,IAAA,CAAC,OAAI,SAAW,EAAA,OAAA,CAAQ,MAAM,EAAI,EAAA,CAAA,EAAG,IAAI,CACvC,EAAA,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,WAAW,OAAQ,CAAA,KAAA;AAAA,QACnB,OAAQ,EAAA,QAAA;AAAA,QACR,SAAU,EAAA,OAAA;AAAA,QACV,OAAQ,EAAA,mBAAA;AAAA,QAEP,YAAE,8BAA8B;AAAA;AAAA,KACnC;AAAA,oBACA,GAAA;AAAA,MAAC,YAAA;AAAA,MAAA;AAAA,QACC,iBAAiB,CACf,WAAA,qBAAA,GAAA,CAAC,SAAK,GAAG,WAAA,EAAc,sBAAY,QAAsB,EAAA,CAAA;AAAA,QAE3D,QAAQ,EAAA,IAAA;AAAA,QACR,EAAG,EAAA,mBAAA;AAAA,QACH,OAAS,EAAA,cAAA;AAAA,QACT,KAAO,EAAA,aAAA;AAAA,QACP,QAAU,EAAA,CAAC,CAAW,EAAA,KAAA,KAAoB,iBAAiB,KAAK,CAAA;AAAA,QAChE,YAAc,EAAA,CAAC,MAAQ,EAAA,EAAE,UACvB,qBAAA,GAAA;AAAA,UAAC,gBAAA;AAAA,UAAA;AAAA,YACC,OACE,kBAAA,GAAA;AAAA,cAAC,QAAA;AAAA,cAAA;AAAA,gBACC,IAAA;AAAA,gBACA,WAAA;AAAA,gBACA,OAAS,EAAA;AAAA;AAAA,aACX;AAAA,YAEF,KAAA,EAAO,WAAW,MAAM;AAAA;AAAA,SAC1B;AAAA,QAEF,IAAK,EAAA,OAAA;AAAA,QACL,SAAA,sBAAY,cAAe,EAAA,EAAA,CAAA;AAAA,QAC3B,aAAa,CAAU,MAAA,qBAAA,GAAA,CAAC,aAAW,GAAG,MAAA,EAAQ,SAAQ,UAAW,EAAA;AAAA;AAAA;AACnE,GACF,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { Content, ItemCardGrid, ContentHeader } from '@backstage/core-components';
|
|
3
3
|
import { stringifyEntityRef } from '@backstage/catalog-model';
|
|
4
4
|
import { TemplateCard } from '../TemplateCard/TemplateCard.esm.js';
|
|
@@ -10,20 +10,23 @@ const TemplateGroup = (props) => {
|
|
|
10
10
|
components: { CardComponent } = {},
|
|
11
11
|
onSelected
|
|
12
12
|
} = props;
|
|
13
|
-
const titleComponent = typeof title === "string" ? /* @__PURE__ */
|
|
13
|
+
const titleComponent = typeof title === "string" ? /* @__PURE__ */ jsx(ContentHeader, { title }) : title;
|
|
14
14
|
if (templates.length === 0) {
|
|
15
15
|
return null;
|
|
16
16
|
}
|
|
17
17
|
const Card = CardComponent || TemplateCard;
|
|
18
|
-
return /* @__PURE__ */
|
|
19
|
-
|
|
20
|
-
{
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
return /* @__PURE__ */ jsxs(Content, { children: [
|
|
19
|
+
titleComponent,
|
|
20
|
+
/* @__PURE__ */ jsx(ItemCardGrid, { children: templates.map(({ template, additionalLinks }) => /* @__PURE__ */ jsx(
|
|
21
|
+
Card,
|
|
22
|
+
{
|
|
23
|
+
additionalLinks,
|
|
24
|
+
template,
|
|
25
|
+
onSelected
|
|
26
|
+
},
|
|
27
|
+
stringifyEntityRef(template)
|
|
28
|
+
)) })
|
|
29
|
+
] });
|
|
27
30
|
};
|
|
28
31
|
|
|
29
32
|
export { TemplateGroup };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TemplateGroup.esm.js","sources":["../../../../src/next/components/TemplateGroup/TemplateGroup.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 { TemplateEntityV1beta3 } from '@backstage/plugin-scaffolder-common';\nimport
|
|
1
|
+
{"version":3,"file":"TemplateGroup.esm.js","sources":["../../../../src/next/components/TemplateGroup/TemplateGroup.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 { TemplateEntityV1beta3 } from '@backstage/plugin-scaffolder-common';\nimport { ReactNode, ComponentType } from 'react';\nimport {\n Content,\n ContentHeader,\n ItemCardGrid,\n} from '@backstage/core-components';\nimport { stringifyEntityRef } from '@backstage/catalog-model';\nimport { TemplateCardProps, TemplateCard } from '../TemplateCard';\nimport { IconComponent } from '@backstage/core-plugin-api';\n\n/**\n * The props for the {@link TemplateGroup} component.\n * @alpha\n */\nexport interface TemplateGroupProps {\n templates: {\n template: TemplateEntityV1beta3;\n additionalLinks?: {\n icon: IconComponent;\n text: string;\n url: string;\n }[];\n }[];\n onSelected: (template: TemplateEntityV1beta3) => void;\n title: ReactNode;\n components?: {\n CardComponent?: ComponentType<TemplateCardProps>;\n };\n}\n\n/**\n * The `TemplateGroup` component is used to display a group of templates with a title.\n * @alpha\n */\nexport const TemplateGroup = (props: TemplateGroupProps) => {\n const {\n templates,\n title,\n components: { CardComponent } = {},\n onSelected,\n } = props;\n const titleComponent =\n typeof title === 'string' ? <ContentHeader title={title} /> : title;\n\n if (templates.length === 0) {\n return null;\n }\n\n const Card = CardComponent || TemplateCard;\n\n return (\n <Content>\n {titleComponent}\n <ItemCardGrid>\n {templates.map(({ template, additionalLinks }) => (\n <Card\n key={stringifyEntityRef(template)}\n additionalLinks={additionalLinks}\n template={template}\n onSelected={onSelected}\n />\n ))}\n </ItemCardGrid>\n </Content>\n );\n};\n"],"names":[],"mappings":";;;;;AAkDa,MAAA,aAAA,GAAgB,CAAC,KAA8B,KAAA;AAC1D,EAAM,MAAA;AAAA,IACJ,SAAA;AAAA,IACA,KAAA;AAAA,IACA,UAAY,EAAA,EAAE,aAAc,EAAA,GAAI,EAAC;AAAA,IACjC;AAAA,GACE,GAAA,KAAA;AACJ,EAAA,MAAM,iBACJ,OAAO,KAAA,KAAU,2BAAY,GAAA,CAAA,aAAA,EAAA,EAAc,OAAc,CAAK,GAAA,KAAA;AAEhE,EAAI,IAAA,SAAA,CAAU,WAAW,CAAG,EAAA;AAC1B,IAAO,OAAA,IAAA;AAAA;AAGT,EAAA,MAAM,OAAO,aAAiB,IAAA,YAAA;AAE9B,EAAA,4BACG,OACE,EAAA,EAAA,QAAA,EAAA;AAAA,IAAA,cAAA;AAAA,oBACD,GAAA,CAAC,gBACE,QAAU,EAAA,SAAA,CAAA,GAAA,CAAI,CAAC,EAAE,QAAA,EAAU,iBAC1B,qBAAA,GAAA;AAAA,MAAC,IAAA;AAAA,MAAA;AAAA,QAEC,eAAA;AAAA,QACA,QAAA;AAAA,QACA;AAAA,OAAA;AAAA,MAHK,mBAAmB,QAAQ;AAAA,KAKnC,CACH,EAAA;AAAA,GACF,EAAA,CAAA;AAEJ;;;;"}
|