From 50c480ae18e4ea74160ce4b93a66dd61ccaae6e8 Mon Sep 17 00:00:00 2001 From: blam Date: Tue, 21 Mar 2023 09:31:16 +0100 Subject: [PATCH] chore: fix typescript and updating api-reports Signed-off-by: blam --- plugins/scaffolder-common/api-report.md | 5 ++++ plugins/scaffolder-react/alpha-api-report.md | 29 +++++++++++++++++++ .../TemplateGroups/TemplateGroups.tsx | 1 - plugins/scaffolder/alpha-api-report.md | 22 +------------- plugins/scaffolder/api-report.md | 8 ++--- plugins/scaffolder/src/alpha.ts | 3 -- plugins/scaffolder/src/next/Router/Router.tsx | 2 +- 7 files changed, 40 insertions(+), 30 deletions(-) diff --git a/plugins/scaffolder-common/api-report.md b/plugins/scaffolder-common/api-report.md index 8864c0d76d..fb21ac450f 100644 --- a/plugins/scaffolder-common/api-report.md +++ b/plugins/scaffolder-common/api-report.md @@ -10,6 +10,11 @@ import type { JsonValue } from '@backstage/types'; import { KindValidator } from '@backstage/catalog-model'; import type { UserEntity } from '@backstage/catalog-model'; +// @public +export const isTemplateEntityV1beta3: ( + entity: Entity, +) => entity is TemplateEntityV1beta3; + // @public export type TaskSpec = TaskSpecV1beta3; diff --git a/plugins/scaffolder-react/alpha-api-report.md b/plugins/scaffolder-react/alpha-api-report.md index c51f7ba518..319e3963f0 100644 --- a/plugins/scaffolder-react/alpha-api-report.md +++ b/plugins/scaffolder-react/alpha-api-report.md @@ -208,6 +208,12 @@ export const TemplateCategoryPicker: () => JSX.Element | null; // @alpha export const TemplateGroup: (props: TemplateGroupProps) => JSX.Element; +// @alpha (undocumented) +export type TemplateGroupFilter = { + title?: React_2.ReactNode; + filter: (entity: TemplateEntityV1beta3) => boolean; +}; + // @alpha export interface TemplateGroupProps { // (undocumented) @@ -229,6 +235,29 @@ export interface TemplateGroupProps { title: React_2.ReactNode; } +// @alpha (undocumented) +export const TemplateGroups: (props: TemplateGroupsProps) => JSX.Element | null; + +// @alpha (undocumented) +export interface TemplateGroupsProps { + // (undocumented) + additionalLinksForEntity?: (template: TemplateEntityV1beta3) => { + icon: IconComponent; + text: string; + url: string; + }[]; + // (undocumented) + groups: TemplateGroupFilter[]; + // (undocumented) + onTemplateSelected?: (template: TemplateEntityV1beta3) => void; + // (undocumented) + TemplateCardComponent?: React_2.ComponentType<{ + template: TemplateEntityV1beta3; + }>; + // (undocumented) + templateFilter?: (entity: TemplateEntityV1beta3) => boolean; +} + // @alpha export const useFormDataFromQuery: ( initialState?: Record, diff --git a/plugins/scaffolder-react/src/next/components/TemplateGroups/TemplateGroups.tsx b/plugins/scaffolder-react/src/next/components/TemplateGroups/TemplateGroups.tsx index 58e5e36173..50be7a4bdf 100644 --- a/plugins/scaffolder-react/src/next/components/TemplateGroups/TemplateGroups.tsx +++ b/plugins/scaffolder-react/src/next/components/TemplateGroups/TemplateGroups.tsx @@ -15,7 +15,6 @@ */ import React, { useCallback } from 'react'; -import { parseEntityRef, stringifyEntityRef } from '@backstage/catalog-model'; import { useEntityList } from '@backstage/plugin-catalog-react'; import { isTemplateEntityV1beta3, diff --git a/plugins/scaffolder/alpha-api-report.md b/plugins/scaffolder/alpha-api-report.md index d0bb627d4d..6ceacdc008 100644 --- a/plugins/scaffolder/alpha-api-report.md +++ b/plugins/scaffolder/alpha-api-report.md @@ -13,6 +13,7 @@ import { PropsWithChildren } from 'react'; import { default as React_2 } from 'react'; import { ScaffolderTaskOutput } from '@backstage/plugin-scaffolder-react'; import { TemplateEntityV1beta3 } from '@backstage/plugin-scaffolder-common'; +import { TemplateGroupFilter } from '@backstage/plugin-scaffolder-react/alpha'; // @alpha @deprecated export type FormProps = Pick< @@ -48,27 +49,6 @@ export const NextScaffolderPage: ( props: PropsWithChildren, ) => JSX.Element; -// @alpha (undocumented) -export type TemplateGroupFilter = { - title?: React_2.ReactNode; - filter: (entity: TemplateEntityV1beta3) => boolean; -}; - -// @alpha (undocumented) -export const TemplateGroups: (props: TemplateGroupsProps) => JSX.Element | null; - -// @alpha (undocumented) -export interface TemplateGroupsProps { - // (undocumented) - groups: TemplateGroupFilter[]; - // (undocumented) - TemplateCardComponent?: React_2.ComponentType<{ - template: TemplateEntityV1beta3; - }>; - // (undocumented) - templateFilter?: (entity: TemplateEntityV1beta3) => boolean; -} - // @alpha (undocumented) export type TemplateListPageProps = { TemplateCardComponent?: React_2.ComponentType<{ diff --git a/plugins/scaffolder/api-report.md b/plugins/scaffolder/api-report.md index 5b8ea034cc..8f37f7cf50 100644 --- a/plugins/scaffolder/api-report.md +++ b/plugins/scaffolder/api-report.md @@ -138,8 +138,8 @@ export const EntityTagsPickerFieldExtension: FieldExtensionComponent_2< string[], { showCounts?: boolean | undefined; - helperText?: string | undefined; kinds?: string[] | undefined; + helperText?: string | undefined; } >; @@ -148,8 +148,8 @@ export const EntityTagsPickerFieldSchema: FieldSchema< string[], { showCounts?: boolean | undefined; - helperText?: string | undefined; kinds?: string[] | undefined; + helperText?: string | undefined; } >; @@ -315,8 +315,8 @@ export const RepoUrlPickerFieldExtension: FieldExtensionComponent_2< | { azure?: string[] | undefined; github?: string[] | undefined; - bitbucket?: string[] | undefined; gitlab?: string[] | undefined; + bitbucket?: string[] | undefined; gerrit?: string[] | undefined; } | undefined; @@ -341,8 +341,8 @@ export const RepoUrlPickerFieldSchema: FieldSchema< | { azure?: string[] | undefined; github?: string[] | undefined; - bitbucket?: string[] | undefined; gitlab?: string[] | undefined; + bitbucket?: string[] | undefined; gerrit?: string[] | undefined; } | undefined; diff --git a/plugins/scaffolder/src/alpha.ts b/plugins/scaffolder/src/alpha.ts index 90b0680d27..d2bd762190 100644 --- a/plugins/scaffolder/src/alpha.ts +++ b/plugins/scaffolder/src/alpha.ts @@ -16,9 +16,6 @@ export { NextScaffolderPage } from './plugin'; export { - TemplateGroups, - type TemplateGroupFilter, - type TemplateGroupsProps, type NextRouterProps, type FormProps, type TemplateListPageProps, diff --git a/plugins/scaffolder/src/next/Router/Router.tsx b/plugins/scaffolder/src/next/Router/Router.tsx index e36bc7428a..9c50d0d979 100644 --- a/plugins/scaffolder/src/next/Router/Router.tsx +++ b/plugins/scaffolder/src/next/Router/Router.tsx @@ -23,6 +23,7 @@ import { import { NextFieldExtensionOptions, FormProps, + TemplateGroupFilter, } from '@backstage/plugin-scaffolder-react/alpha'; import { ScaffolderTaskOutput, @@ -32,7 +33,6 @@ import { } from '@backstage/plugin-scaffolder-react'; import { TemplateEntityV1beta3 } from '@backstage/plugin-scaffolder-common'; -import { TemplateGroupFilter } from '../TemplateListPage'; import { DEFAULT_SCAFFOLDER_FIELD_EXTENSIONS } from '../../extensions/default'; import {