@backstage/plugin-scaffolder-react 1.14.6-next.2 → 1.15.0-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,49 @@
1
1
  # @backstage/plugin-scaffolder-react
2
2
 
3
+ ## 1.15.0-next.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 5890016: add api to retrieve template extensions info from scaffolder-backend
8
+
9
+ ### Patch Changes
10
+
11
+ - 6ed42b7: Scaffolding - Template card - button to show template entity detail
12
+ - Updated dependencies
13
+ - @backstage/plugin-catalog-react@1.16.1-next.0
14
+ - @backstage/catalog-client@1.9.1
15
+ - @backstage/catalog-model@1.7.3
16
+ - @backstage/core-components@0.17.0
17
+ - @backstage/core-plugin-api@1.10.5
18
+ - @backstage/frontend-plugin-api@0.10.0
19
+ - @backstage/theme@0.6.4
20
+ - @backstage/types@1.2.1
21
+ - @backstage/version-bridge@1.0.11
22
+ - @backstage/plugin-permission-react@0.4.32
23
+ - @backstage/plugin-scaffolder-common@1.5.10
24
+
25
+ ## 1.14.6
26
+
27
+ ### Patch Changes
28
+
29
+ - 4d26652: Fix field extension validation not working when field is in dependencies in an array field
30
+ - b3b7c9c: Deprecated the alpha `ScaffolderFormFieldsApi` and `formFieldsApiRef` as these are being replaced with a different solution.
31
+ - 48aab13: Add i18n support for scaffolder-react plugin
32
+ - 3db64ba: Disable the submit button on creating
33
+ - 34ea3f5: Updated dependency `flatted` to `3.3.3`.
34
+ - Updated dependencies
35
+ - @backstage/core-components@0.17.0
36
+ - @backstage/core-plugin-api@1.10.5
37
+ - @backstage/frontend-plugin-api@0.10.0
38
+ - @backstage/plugin-catalog-react@1.16.0
39
+ - @backstage/plugin-scaffolder-common@1.5.10
40
+ - @backstage/plugin-permission-react@0.4.32
41
+ - @backstage/catalog-client@1.9.1
42
+ - @backstage/catalog-model@1.7.3
43
+ - @backstage/theme@0.6.4
44
+ - @backstage/types@1.2.1
45
+ - @backstage/version-bridge@1.0.11
46
+
3
47
  ## 1.14.6-next.2
4
48
 
5
49
  ### Patch Changes
package/dist/alpha.d.ts CHANGED
@@ -483,6 +483,7 @@ declare const scaffolderReactTranslationRef: _backstage_core_plugin_api_alpha.Tr
483
483
  readonly "templateCategoryPicker.title": "Categories";
484
484
  readonly "templateCard.noDescription": "No description";
485
485
  readonly "templateCard.chooseButtonText": "Choose";
486
+ readonly "cardHeader.detailBtnTitle": "Show template entity details";
486
487
  readonly "templateOutputs.title": "Text Output";
487
488
  }>;
488
489
 
package/dist/index.d.ts CHANGED
@@ -394,14 +394,22 @@ type ScaffolderTask = {
394
394
  createdAt: string;
395
395
  };
396
396
  /**
397
- * A single action example
397
+ * A single scaffolder usage example
398
398
  *
399
399
  * @public
400
400
  */
401
- type ActionExample = {
402
- description: string;
401
+ type ScaffolderUsageExample = {
402
+ description?: string;
403
403
  example: string;
404
+ notes?: string;
404
405
  };
406
+ /**
407
+ * A single action example
408
+ *
409
+ * @public
410
+ * @deprecated in favor of ScaffolderUsageExample
411
+ */
412
+ type ActionExample = ScaffolderUsageExample;
405
413
  /**
406
414
  * The response shape for a single action in the `listActions` call to the `scaffolder-backend`
407
415
  *
@@ -422,6 +430,54 @@ type Action = {
422
430
  * @public
423
431
  */
424
432
  type ListActionsResponse = Array<Action>;
433
+ /**
434
+ * The response shape for a single filter in the `listTemplateExtensions` call to the `scaffolder-backend`
435
+ *
436
+ * @public
437
+ */
438
+ type TemplateFilter = {
439
+ description?: string;
440
+ schema?: {
441
+ input?: JSONSchema7;
442
+ arguments?: JSONSchema7[];
443
+ output?: JSONSchema7;
444
+ };
445
+ examples?: ScaffolderUsageExample[];
446
+ };
447
+ /**
448
+ * The response shape for a single global function in the `listTemplateExtensions` call to the `scaffolder-backend`
449
+ *
450
+ * @public
451
+ */
452
+ type TemplateGlobalFunction = {
453
+ description?: string;
454
+ schema?: {
455
+ arguments?: JSONSchema7[];
456
+ output?: JSONSchema7;
457
+ };
458
+ examples?: ScaffolderUsageExample[];
459
+ };
460
+ /**
461
+ * The response shape for a single global value in the `listTemplateExtensions` call to the `scaffolder-backend`
462
+ *
463
+ * @public
464
+ */
465
+ type TemplateGlobalValue = {
466
+ description?: string;
467
+ value: JsonValue;
468
+ };
469
+ /**
470
+ * The response shape for the `listTemplateExtensions` call to the `scaffolder-backend`
471
+ *
472
+ * @public
473
+ */
474
+ type ListTemplateExtensionsResponse = {
475
+ filters: Record<string, TemplateFilter>;
476
+ globals: {
477
+ functions: Record<string, TemplateGlobalFunction>;
478
+ values: Record<string, TemplateGlobalValue>;
479
+ };
480
+ };
425
481
  /** @public */
426
482
  type ScaffolderOutputLink = {
427
483
  title?: string;
@@ -568,6 +624,10 @@ interface ScaffolderApi {
568
624
  * Returns a list of all installed actions.
569
625
  */
570
626
  listActions(): Promise<ListActionsResponse>;
627
+ /**
628
+ * Returns a structure describing the available templating extensions.
629
+ */
630
+ listTemplateExtensions?(): Promise<ListTemplateExtensionsResponse>;
571
631
  streamLogs(options: ScaffolderStreamLogsOptions): Observable<LogEvent>;
572
632
  dryRun?(options: ScaffolderDryRunOptions): Promise<ScaffolderDryRunResponse>;
573
633
  autocomplete?(options: {
@@ -688,4 +748,4 @@ interface FieldSchema<TReturn, TUiOptions> {
688
748
  readonly TOutput: TReturn;
689
749
  }
690
750
 
691
- export { type Action, type ActionExample, type CustomFieldExtensionSchema, type CustomFieldValidator, type FieldExtensionComponent, type FieldExtensionComponentProps, type FieldExtensionOptions, type FieldExtensionUiSchema, type FieldSchema, type FormProps, type LayoutComponent, type LayoutOptions, type LayoutTemplate, type ListActionsResponse, type LogEvent, type ReviewStepProps, type ScaffolderApi, type ScaffolderDryRunOptions, type ScaffolderDryRunResponse, ScaffolderFieldExtensions, type ScaffolderGetIntegrationsListOptions, type ScaffolderGetIntegrationsListResponse, ScaffolderLayouts, type ScaffolderOutputLink, type ScaffolderOutputText, type ScaffolderRJSFField, type ScaffolderRJSFFieldProps, type ScaffolderRJSFFormProps, type ScaffolderRJSFRegistryFieldsType, type ScaffolderScaffoldOptions, type ScaffolderScaffoldResponse, type ScaffolderStep, type ScaffolderStreamLogsOptions, type ScaffolderTask, type ScaffolderTaskOutput, type ScaffolderTaskStatus, type ScaffolderUseTemplateSecrets, SecretsContextProvider, type TaskStream, type TemplateGroupFilter, type TemplateParameterSchema, createScaffolderFieldExtension, createScaffolderLayout, makeFieldSchema, scaffolderApiRef, useCustomFieldExtensions, useCustomLayouts, useTaskEventStream, useTemplateSecrets };
751
+ export { type Action, type ActionExample, type CustomFieldExtensionSchema, type CustomFieldValidator, type FieldExtensionComponent, type FieldExtensionComponentProps, type FieldExtensionOptions, type FieldExtensionUiSchema, type FieldSchema, type FormProps, type LayoutComponent, type LayoutOptions, type LayoutTemplate, type ListActionsResponse, type ListTemplateExtensionsResponse, type LogEvent, type ReviewStepProps, type ScaffolderApi, type ScaffolderDryRunOptions, type ScaffolderDryRunResponse, ScaffolderFieldExtensions, type ScaffolderGetIntegrationsListOptions, type ScaffolderGetIntegrationsListResponse, ScaffolderLayouts, type ScaffolderOutputLink, type ScaffolderOutputText, type ScaffolderRJSFField, type ScaffolderRJSFFieldProps, type ScaffolderRJSFFormProps, type ScaffolderRJSFRegistryFieldsType, type ScaffolderScaffoldOptions, type ScaffolderScaffoldResponse, type ScaffolderStep, type ScaffolderStreamLogsOptions, type ScaffolderTask, type ScaffolderTaskOutput, type ScaffolderTaskStatus, type ScaffolderUsageExample, type ScaffolderUseTemplateSecrets, SecretsContextProvider, type TaskStream, type TemplateFilter, type TemplateGlobalFunction, type TemplateGlobalValue, type TemplateGroupFilter, type TemplateParameterSchema, createScaffolderFieldExtension, createScaffolderLayout, makeFieldSchema, scaffolderApiRef, useCustomFieldExtensions, useCustomLayouts, useTaskEventStream, useTemplateSecrets };
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import { makeStyles, useTheme } from '@material-ui/core/styles';
3
3
  import { ItemCardHeader } from '@backstage/core-components';
4
4
  import { FavoriteEntity } from '@backstage/plugin-catalog-react';
5
+ import { TemplateDetailButton } from './TemplateDetailButton.esm.js';
5
6
 
6
7
  const useStyles = makeStyles(() => ({
7
8
  header: {
@@ -26,7 +27,13 @@ const CardHeader = (props) => {
26
27
  cardFontColor: themeForType.fontColor,
27
28
  cardBackgroundImage: themeForType.backgroundImage
28
29
  });
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
+ const SubtitleComponent = /* @__PURE__ */ React.createElement("div", { className: styles.subtitleWrapper }, /* @__PURE__ */ React.createElement("div", null, type), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(TemplateDetailButton, { template: props.template }), /* @__PURE__ */ React.createElement(
31
+ FavoriteEntity,
32
+ {
33
+ entity: props.template,
34
+ style: { padding: 0, marginLeft: 6 }
35
+ }
36
+ )));
30
37
  return /* @__PURE__ */ React.createElement(
31
38
  ItemCardHeader,
32
39
  {
@@ -1 +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,GAChC;AAAA,EACA,eAAiB,EAAA;AAAA,IACf,OAAS,EAAA,MAAA;AAAA,IACT,cAAgB,EAAA;AAAA;AAEpB,CAAE,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;AAAA;AACf,GACE,GAAA,KAAA;AACJ,EAAM,MAAA,EAAE,YAAa,EAAA,GAAI,QAAS,EAAA;AAClC,EAAA,MAAM,YAAe,GAAA,YAAA,CAAa,EAAE,OAAA,EAAS,MAAM,CAAA;AAEnD,EAAA,MAAM,SAAS,SAAU,CAAA;AAAA,IACvB,eAAe,YAAa,CAAA,SAAA;AAAA,IAC5B,qBAAqB,YAAa,CAAA;AAAA,GACnC,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;AAGF,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,cAAA;AAAA,IAAA;AAAA,MACC,OAAO,KAAS,IAAA,IAAA;AAAA,MAChB,QAAU,EAAA,iBAAA;AAAA,MACV,OAAS,EAAA,EAAE,IAAM,EAAA,MAAA,CAAO,MAAO;AAAA;AAAA,GACjC;AAEJ;;;;"}
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 { makeStyles, Theme, useTheme } from '@material-ui/core/styles';\nimport { ItemCardHeader } from '@backstage/core-components';\nimport { TemplateEntityV1beta3 } from '@backstage/plugin-scaffolder-common';\nimport { FavoriteEntity } from '@backstage/plugin-catalog-react';\nimport { TemplateDetailButton } from './TemplateDetailButton.tsx';\n\nconst useStyles = makeStyles<\n Theme,\n {\n cardFontColor: string;\n cardBackgroundImage: string;\n }\n>(() => ({\n header: {\n backgroundImage: ({ cardBackgroundImage }) => cardBackgroundImage,\n color: ({ cardFontColor }) => cardFontColor,\n },\n subtitleWrapper: {\n display: 'flex',\n justifyContent: 'space-between',\n },\n}));\n\n/**\n * Props for the CardHeader component\n */\nexport interface CardHeaderProps {\n template: TemplateEntityV1beta3;\n}\n\n/**\n * The Card Header with the background for the TemplateCard.\n */\nexport const CardHeader = (props: CardHeaderProps) => {\n const {\n template: {\n metadata: { title, name },\n spec: { type },\n },\n } = props;\n const { getPageTheme } = useTheme();\n const themeForType = getPageTheme({ themeId: type });\n\n const styles = useStyles({\n cardFontColor: themeForType.fontColor,\n cardBackgroundImage: themeForType.backgroundImage,\n });\n\n const SubtitleComponent = (\n <div className={styles.subtitleWrapper}>\n <div>{type}</div>\n <div>\n <TemplateDetailButton template={props.template} />\n <FavoriteEntity\n entity={props.template}\n style={{ padding: 0, marginLeft: 6 }}\n />\n </div>\n </div>\n );\n\n return (\n <ItemCardHeader\n title={title ?? name}\n subtitle={SubtitleComponent}\n classes={{ root: styles.header }}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;AAuBA,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,GAChC;AAAA,EACA,eAAiB,EAAA;AAAA,IACf,OAAS,EAAA,MAAA;AAAA,IACT,cAAgB,EAAA;AAAA;AAEpB,CAAE,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;AAAA;AACf,GACE,GAAA,KAAA;AACJ,EAAM,MAAA,EAAE,YAAa,EAAA,GAAI,QAAS,EAAA;AAClC,EAAA,MAAM,YAAe,GAAA,YAAA,CAAa,EAAE,OAAA,EAAS,MAAM,CAAA;AAEnD,EAAA,MAAM,SAAS,SAAU,CAAA;AAAA,IACvB,eAAe,YAAa,CAAA,SAAA;AAAA,IAC5B,qBAAqB,YAAa,CAAA;AAAA,GACnC,CAAA;AAED,EAAA,MAAM,oCACH,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAI,SAAW,EAAA,MAAA,CAAO,mCACpB,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,IAAA,EAAK,IAAK,CAAA,sCACV,KACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,wBAAqB,QAAU,EAAA,KAAA,CAAM,UAAU,CAChD,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,cAAA;AAAA,IAAA;AAAA,MACC,QAAQ,KAAM,CAAA,QAAA;AAAA,MACd,KAAO,EAAA,EAAE,OAAS,EAAA,CAAA,EAAG,YAAY,CAAE;AAAA;AAAA,GAEvC,CACF,CAAA;AAGF,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,cAAA;AAAA,IAAA;AAAA,MACC,OAAO,KAAS,IAAA,IAAA;AAAA,MAChB,QAAU,EAAA,iBAAA;AAAA,MACV,OAAS,EAAA,EAAE,IAAM,EAAA,MAAA,CAAO,MAAO;AAAA;AAAA,GACjC;AAEJ;;;;"}
@@ -0,0 +1,41 @@
1
+ import React from 'react';
2
+ import Tooltip from '@material-ui/core/Tooltip';
3
+ import IconButton from '@material-ui/core/IconButton';
4
+ import Typography from '@material-ui/core/Typography';
5
+ import DescriptionIcon from '@material-ui/icons/Description';
6
+ import { Link } from '@backstage/core-components';
7
+ import { entityRouteRef, entityRouteParams } from '@backstage/plugin-catalog-react';
8
+ import { useRouteRef, useApp } from '@backstage/core-plugin-api';
9
+ import { stringifyEntityRef } from '@backstage/catalog-model';
10
+ import { scaffolderReactTranslationRef } from '../../../translation.esm.js';
11
+ import { useTranslationRef } from '@backstage/frontend-plugin-api';
12
+
13
+ const TemplateDetailButton = ({
14
+ template
15
+ }) => {
16
+ const catalogEntityRoute = useRouteRef(entityRouteRef);
17
+ const { t } = useTranslationRef(scaffolderReactTranslationRef);
18
+ const entityRef = stringifyEntityRef(template);
19
+ const app = useApp();
20
+ const TemplateIcon = app.getSystemIcon("kind:template") || DescriptionIcon;
21
+ return /* @__PURE__ */ React.createElement(Tooltip, { id: `tooltip-${entityRef}`, title: t("cardHeader.detailBtnTitle") }, /* @__PURE__ */ React.createElement(
22
+ IconButton,
23
+ {
24
+ "aria-label": t("cardHeader.detailBtnTitle"),
25
+ id: `viewDetail-${entityRef}`,
26
+ style: { padding: 0 },
27
+ color: "inherit"
28
+ },
29
+ /* @__PURE__ */ React.createElement(Typography, { component: "span" }, /* @__PURE__ */ React.createElement(
30
+ Link,
31
+ {
32
+ to: catalogEntityRoute(entityRouteParams(template)),
33
+ style: { display: "flex", alignItems: "center" }
34
+ },
35
+ /* @__PURE__ */ React.createElement(TemplateIcon, null)
36
+ ))
37
+ ));
38
+ };
39
+
40
+ export { TemplateDetailButton };
41
+ //# sourceMappingURL=TemplateDetailButton.esm.js.map
@@ -0,0 +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 React from 'react';\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":";;;;;;;;;;;;AAkCO,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,KAAA,CAAA,aAAA,CAAC,WAAQ,EAAI,EAAA,CAAA,QAAA,EAAW,SAAS,CAAI,CAAA,EAAA,KAAA,EAAO,CAAE,CAAA,2BAA2B,CACvE,EAAA,kBAAA,KAAA,CAAA,aAAA;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;AAAA,KAAA;AAAA,oBAEN,KAAA,CAAA,aAAA,CAAC,UAAW,EAAA,EAAA,SAAA,EAAU,MACpB,EAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,MAAC,IAAA;AAAA,MAAA;AAAA,QACC,EAAI,EAAA,kBAAA,CAAmB,iBAAkB,CAAA,QAAQ,CAAC,CAAA;AAAA,QAClD,KAAO,EAAA,EAAE,OAAS,EAAA,MAAA,EAAQ,YAAY,QAAS;AAAA,OAAA;AAAA,0CAE9C,YAAa,EAAA,IAAA;AAAA,KAElB;AAAA,GAEJ,CAAA;AAEJ;;;;"}
@@ -27,6 +27,9 @@ const scaffolderReactTranslationRef = createTranslationRef({
27
27
  noDescription: "No description",
28
28
  chooseButtonText: "Choose"
29
29
  },
30
+ cardHeader: {
31
+ detailBtnTitle: "Show template entity details"
32
+ },
30
33
  templateOutputs: {
31
34
  title: "Text Output"
32
35
  },
@@ -1 +1 @@
1
- {"version":3,"file":"translation.esm.js","sources":["../src/translation.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createTranslationRef } from '@backstage/core-plugin-api/alpha';\n\n/** @alpha */\nexport const scaffolderReactTranslationRef = createTranslationRef({\n id: 'scaffolder-react',\n messages: {\n passwordWidget: {\n content:\n 'This widget is insecure. Please use [`ui:field: Secret`](https://backstage.io/docs/features/software-templates/writing-templates/#using-secrets) instead of `ui:widget: password`',\n },\n scaffolderPageContextMenu: {\n moreLabel: 'more',\n createLabel: 'Create',\n editorLabel: 'Manage Templates',\n actionsLabel: 'Installed Actions',\n tasksLabel: 'Task List',\n },\n stepper: {\n backButtonText: 'Back',\n createButtonText: 'Create',\n reviewButtonText: 'Review',\n stepIndexLabel: 'Step {{index, number}}',\n nextButtonText: 'Next',\n },\n templateCategoryPicker: {\n title: 'Categories',\n },\n templateCard: {\n noDescription: 'No description',\n chooseButtonText: 'Choose',\n },\n templateOutputs: {\n title: 'Text Output',\n },\n workflow: {\n noDescription: 'No description',\n },\n },\n});\n"],"names":[],"mappings":";;AAkBO,MAAM,gCAAgC,oBAAqB,CAAA;AAAA,EAChE,EAAI,EAAA,kBAAA;AAAA,EACJ,QAAU,EAAA;AAAA,IACR,cAAgB,EAAA;AAAA,MACd,OACE,EAAA;AAAA,KACJ;AAAA,IACA,yBAA2B,EAAA;AAAA,MACzB,SAAW,EAAA,MAAA;AAAA,MACX,WAAa,EAAA,QAAA;AAAA,MACb,WAAa,EAAA,kBAAA;AAAA,MACb,YAAc,EAAA,mBAAA;AAAA,MACd,UAAY,EAAA;AAAA,KACd;AAAA,IACA,OAAS,EAAA;AAAA,MACP,cAAgB,EAAA,MAAA;AAAA,MAChB,gBAAkB,EAAA,QAAA;AAAA,MAClB,gBAAkB,EAAA,QAAA;AAAA,MAClB,cAAgB,EAAA,wBAAA;AAAA,MAChB,cAAgB,EAAA;AAAA,KAClB;AAAA,IACA,sBAAwB,EAAA;AAAA,MACtB,KAAO,EAAA;AAAA,KACT;AAAA,IACA,YAAc,EAAA;AAAA,MACZ,aAAe,EAAA,gBAAA;AAAA,MACf,gBAAkB,EAAA;AAAA,KACpB;AAAA,IACA,eAAiB,EAAA;AAAA,MACf,KAAO,EAAA;AAAA,KACT;AAAA,IACA,QAAU,EAAA;AAAA,MACR,aAAe,EAAA;AAAA;AACjB;AAEJ,CAAC;;;;"}
1
+ {"version":3,"file":"translation.esm.js","sources":["../src/translation.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createTranslationRef } from '@backstage/core-plugin-api/alpha';\n\n/** @alpha */\nexport const scaffolderReactTranslationRef = createTranslationRef({\n id: 'scaffolder-react',\n messages: {\n passwordWidget: {\n content:\n 'This widget is insecure. Please use [`ui:field: Secret`](https://backstage.io/docs/features/software-templates/writing-templates/#using-secrets) instead of `ui:widget: password`',\n },\n scaffolderPageContextMenu: {\n moreLabel: 'more',\n createLabel: 'Create',\n editorLabel: 'Manage Templates',\n actionsLabel: 'Installed Actions',\n tasksLabel: 'Task List',\n },\n stepper: {\n backButtonText: 'Back',\n createButtonText: 'Create',\n reviewButtonText: 'Review',\n stepIndexLabel: 'Step {{index, number}}',\n nextButtonText: 'Next',\n },\n templateCategoryPicker: {\n title: 'Categories',\n },\n templateCard: {\n noDescription: 'No description',\n chooseButtonText: 'Choose',\n },\n cardHeader: {\n detailBtnTitle: 'Show template entity details',\n },\n templateOutputs: {\n title: 'Text Output',\n },\n workflow: {\n noDescription: 'No description',\n },\n },\n});\n"],"names":[],"mappings":";;AAkBO,MAAM,gCAAgC,oBAAqB,CAAA;AAAA,EAChE,EAAI,EAAA,kBAAA;AAAA,EACJ,QAAU,EAAA;AAAA,IACR,cAAgB,EAAA;AAAA,MACd,OACE,EAAA;AAAA,KACJ;AAAA,IACA,yBAA2B,EAAA;AAAA,MACzB,SAAW,EAAA,MAAA;AAAA,MACX,WAAa,EAAA,QAAA;AAAA,MACb,WAAa,EAAA,kBAAA;AAAA,MACb,YAAc,EAAA,mBAAA;AAAA,MACd,UAAY,EAAA;AAAA,KACd;AAAA,IACA,OAAS,EAAA;AAAA,MACP,cAAgB,EAAA,MAAA;AAAA,MAChB,gBAAkB,EAAA,QAAA;AAAA,MAClB,gBAAkB,EAAA,QAAA;AAAA,MAClB,cAAgB,EAAA,wBAAA;AAAA,MAChB,cAAgB,EAAA;AAAA,KAClB;AAAA,IACA,sBAAwB,EAAA;AAAA,MACtB,KAAO,EAAA;AAAA,KACT;AAAA,IACA,YAAc,EAAA;AAAA,MACZ,aAAe,EAAA,gBAAA;AAAA,MACf,gBAAkB,EAAA;AAAA,KACpB;AAAA,IACA,UAAY,EAAA;AAAA,MACV,cAAgB,EAAA;AAAA,KAClB;AAAA,IACA,eAAiB,EAAA;AAAA,MACf,KAAO,EAAA;AAAA,KACT;AAAA,IACA,QAAU,EAAA;AAAA,MACR,aAAe,EAAA;AAAA;AACjB;AAEJ,CAAC;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-scaffolder-react",
3
- "version": "1.14.6-next.2",
3
+ "version": "1.15.0-next.0",
4
4
  "description": "A frontend library that helps other Backstage plugins interact with the Scaffolder",
5
5
  "backstage": {
6
6
  "role": "web-library",
@@ -68,12 +68,12 @@
68
68
  "dependencies": {
69
69
  "@backstage/catalog-client": "1.9.1",
70
70
  "@backstage/catalog-model": "1.7.3",
71
- "@backstage/core-components": "0.16.5-next.1",
72
- "@backstage/core-plugin-api": "1.10.4",
73
- "@backstage/frontend-plugin-api": "0.10.0-next.2",
74
- "@backstage/plugin-catalog-react": "1.16.0-next.2",
75
- "@backstage/plugin-permission-react": "0.4.31",
76
- "@backstage/plugin-scaffolder-common": "1.5.10-next.0",
71
+ "@backstage/core-components": "0.17.0",
72
+ "@backstage/core-plugin-api": "1.10.5",
73
+ "@backstage/frontend-plugin-api": "0.10.0",
74
+ "@backstage/plugin-catalog-react": "1.16.1-next.0",
75
+ "@backstage/plugin-permission-react": "0.4.32",
76
+ "@backstage/plugin-scaffolder-common": "1.5.10",
77
77
  "@backstage/theme": "0.6.4",
78
78
  "@backstage/types": "1.2.1",
79
79
  "@backstage/version-bridge": "1.0.11",
@@ -104,12 +104,12 @@
104
104
  "zod-to-json-schema": "^3.20.4"
105
105
  },
106
106
  "devDependencies": {
107
- "@backstage/cli": "0.31.0-next.1",
108
- "@backstage/core-app-api": "1.16.0-next.0",
109
- "@backstage/plugin-catalog": "1.28.0-next.2",
107
+ "@backstage/cli": "0.32.0-next.0",
108
+ "@backstage/core-app-api": "1.16.0",
109
+ "@backstage/plugin-catalog": "1.29.0-next.0",
110
110
  "@backstage/plugin-catalog-common": "1.1.3",
111
111
  "@backstage/plugin-permission-common": "0.8.4",
112
- "@backstage/test-utils": "1.7.6-next.0",
112
+ "@backstage/test-utils": "1.7.6",
113
113
  "@testing-library/dom": "^10.0.0",
114
114
  "@testing-library/jest-dom": "^6.0.0",
115
115
  "@testing-library/react": "^16.0.0",