From 4618350aa80b9f67b3308d6626223ecb411faf37 Mon Sep 17 00:00:00 2001 From: blam Date: Fri, 25 Feb 2022 10:48:57 +0100 Subject: [PATCH] chore: some more deprecations for the scaffolder Signed-off-by: blam --- .changeset/little-carpets-itch.md | 2 ++ plugins/scaffolder/api-report.md | 4 ++-- .../scaffolder/src/components/TemplateList/TemplateList.tsx | 6 ++++++ .../scaffolder/src/components/TemplatePage/TemplatePage.tsx | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.changeset/little-carpets-itch.md b/.changeset/little-carpets-itch.md index 92a554624f..e1db4d23cd 100644 --- a/.changeset/little-carpets-itch.md +++ b/.changeset/little-carpets-itch.md @@ -5,7 +5,9 @@ Added some deprecations as follows: - **DEPRECATED**: `TemplateCardComponent` and `TaskPageComponent` props have been deprecated, and moved to a `components` prop instead. You can pass them in through there instead. +- **DEPRECATED**: `TemplateList` and `TemplateListProps` has been deprecated. Please use the `TemplateCard` to create your own list component instead. Other notable changes: - `scaffolderApi.scaffold()` `values` type has been narrowed from `Record` to `Record` instead. +- Moved all navigation internally over to using `routeRefs` and `subRouteRefs` diff --git a/plugins/scaffolder/api-report.md b/plugins/scaffolder/api-report.md index 3f1a14267c..f610e38a8b 100644 --- a/plugins/scaffolder/api-report.md +++ b/plugins/scaffolder/api-report.md @@ -427,7 +427,7 @@ export type TaskPageProps = { // Warning: (ae-missing-release-tag) "TemplateList" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // -// @public (undocumented) +// @public @deprecated (undocumented) export const TemplateList: ({ TemplateCardComponent, group, @@ -435,7 +435,7 @@ export const TemplateList: ({ // Warning: (ae-missing-release-tag) "TemplateListProps" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // -// @public (undocumented) +// @public @deprecated (undocumented) export type TemplateListProps = { TemplateCardComponent?: | ComponentType<{ diff --git a/plugins/scaffolder/src/components/TemplateList/TemplateList.tsx b/plugins/scaffolder/src/components/TemplateList/TemplateList.tsx index c95a8237eb..40ab2dfcdf 100644 --- a/plugins/scaffolder/src/components/TemplateList/TemplateList.tsx +++ b/plugins/scaffolder/src/components/TemplateList/TemplateList.tsx @@ -29,6 +29,9 @@ import { useEntityList } from '@backstage/plugin-catalog-react'; import { Typography } from '@material-ui/core'; import { TemplateCard } from '../TemplateCard'; +/** + * @deprecated this type is deprecated and will be removed in a future releases, please use the TemplateCard to render your own list. + */ export type TemplateListProps = { TemplateCardComponent?: | ComponentType<{ template: TemplateEntityV1beta2 }> @@ -40,6 +43,9 @@ export type TemplateListProps = { }; }; +/** + * @deprecated this component is deprecated and will be removed in a future releases, please use the TemplateCard to render your own list. + */ export const TemplateList = ({ TemplateCardComponent, group, diff --git a/plugins/scaffolder/src/components/TemplatePage/TemplatePage.tsx b/plugins/scaffolder/src/components/TemplatePage/TemplatePage.tsx index 92136d59b8..e69c4bab5c 100644 --- a/plugins/scaffolder/src/components/TemplatePage/TemplatePage.tsx +++ b/plugins/scaffolder/src/components/TemplatePage/TemplatePage.tsx @@ -18,7 +18,7 @@ import { LinearProgress } from '@material-ui/core'; import { FormValidation, IChangeEvent } from '@rjsf/core'; import qs from 'qs'; import React, { useCallback, useContext, useState } from 'react'; -import { generatePath, Navigate, useNavigate } from 'react-router'; +import { Navigate, useNavigate } from 'react-router'; import { useParams } from 'react-router-dom'; import useAsync from 'react-use/lib/useAsync'; import { scaffolderApiRef } from '../../api';