From 1a0616fa10a79eaadc8b91cf6ad91a6f2c96d2db Mon Sep 17 00:00:00 2001 From: Heikki Hellgren Date: Mon, 11 Sep 2023 09:45:47 +0300 Subject: [PATCH] fix: add missing resource app icon Signed-off-by: Heikki Hellgren --- .changeset/mean-dancers-burn.md | 7 +++++++ packages/app-defaults/src/defaults/icons.tsx | 2 ++ packages/core-app-api/api-report.md | 2 ++ packages/core-app-api/src/app/types.ts | 11 ++++++----- .../test-utils/src/testUtils/appWrappers.tsx | 19 ++++++++++--------- 5 files changed, 27 insertions(+), 14 deletions(-) create mode 100644 .changeset/mean-dancers-burn.md diff --git a/.changeset/mean-dancers-burn.md b/.changeset/mean-dancers-burn.md new file mode 100644 index 0000000000..a51ca7b8de --- /dev/null +++ b/.changeset/mean-dancers-burn.md @@ -0,0 +1,7 @@ +--- +'@backstage/core-app-api': patch +'@backstage/app-defaults': patch +'@backstage/test-utils': patch +--- + +Add missing resource and template app icons diff --git a/packages/app-defaults/src/defaults/icons.tsx b/packages/app-defaults/src/defaults/icons.tsx index 80fa4dcf12..fbdfb14e5b 100644 --- a/packages/app-defaults/src/defaults/icons.tsx +++ b/packages/app-defaults/src/defaults/icons.tsx @@ -35,6 +35,7 @@ import MuiPeopleIcon from '@material-ui/icons/People'; import MuiPersonIcon from '@material-ui/icons/Person'; import MuiWarningIcon from '@material-ui/icons/Warning'; import MuiWorkIcon from '@material-ui/icons/Work'; +import MuiFeaturedPlayListIcon from '@material-ui/icons/FeaturedPlayList'; export const icons = { brokenImage: MuiBrokenImageIcon as IconComponent, @@ -58,6 +59,7 @@ export const icons = { 'kind:system': MuiCategoryIcon as IconComponent, 'kind:user': MuiPersonIcon as IconComponent, 'kind:resource': MuiWorkIcon as IconComponent, + 'kind:template': MuiFeaturedPlayListIcon as IconComponent, user: MuiPersonIcon as IconComponent, warning: MuiWarningIcon as IconComponent, }; diff --git a/packages/core-app-api/api-report.md b/packages/core-app-api/api-report.md index 6824dbcf4c..05071255ba 100644 --- a/packages/core-app-api/api-report.md +++ b/packages/core-app-api/api-report.md @@ -179,6 +179,8 @@ export type AppIcons = { 'kind:location': IconComponent; 'kind:system': IconComponent; 'kind:user': IconComponent; + 'kind:resource': IconComponent; + 'kind:template': IconComponent; brokenImage: IconComponent; catalog: IconComponent; chat: IconComponent; diff --git a/packages/core-app-api/src/app/types.ts b/packages/core-app-api/src/app/types.ts index 523e35e9cb..9d2c77292c 100644 --- a/packages/core-app-api/src/app/types.ts +++ b/packages/core-app-api/src/app/types.ts @@ -18,13 +18,13 @@ import { ComponentType, PropsWithChildren } from 'react'; import { AnyApiFactory, AppTheme, - IconComponent, BackstagePlugin, + ExternalRouteRef, + FeatureFlag, + IconComponent, + IdentityApi, RouteRef, SubRouteRef, - ExternalRouteRef, - IdentityApi, - FeatureFlag, } from '@backstage/core-plugin-api'; import { AppConfig } from '@backstage/config'; @@ -99,7 +99,8 @@ export type AppIcons = { 'kind:location': IconComponent; 'kind:system': IconComponent; 'kind:user': IconComponent; - + 'kind:resource': IconComponent; + 'kind:template': IconComponent; brokenImage: IconComponent; catalog: IconComponent; chat: IconComponent; diff --git a/packages/test-utils/src/testUtils/appWrappers.tsx b/packages/test-utils/src/testUtils/appWrappers.tsx index ebded4d813..8bc69e184a 100644 --- a/packages/test-utils/src/testUtils/appWrappers.tsx +++ b/packages/test-utils/src/testUtils/appWrappers.tsx @@ -16,24 +16,23 @@ import React, { ComponentType, - ReactNode, - ReactElement, PropsWithChildren, + ReactElement, + ReactNode, } from 'react'; -import { MemoryRouter } from 'react-router-dom'; -import { Route } from 'react-router-dom'; -import { UnifiedThemeProvider, themes } from '@backstage/theme'; +import { MemoryRouter, Route } from 'react-router-dom'; +import { themes, UnifiedThemeProvider } from '@backstage/theme'; import MockIcon from '@material-ui/icons/AcUnit'; import { createSpecializedApp } from '@backstage/core-app-api'; import { - BootErrorPageProps, - RouteRef, - ExternalRouteRef, attachComponentData, + BootErrorPageProps, createRouteRef, + ExternalRouteRef, + RouteRef, } from '@backstage/core-plugin-api'; import { MatcherFunction, RenderResult } from '@testing-library/react'; -import { renderWithEffects, LegacyRootOption } from './testingLibrary'; +import { LegacyRootOption, renderWithEffects } from './testingLibrary'; import { defaultApis } from './defaultApis'; import { mockApis } from './mockApis'; @@ -45,6 +44,8 @@ const mockIcons = { 'kind:location': MockIcon, 'kind:system': MockIcon, 'kind:user': MockIcon, + 'kind:resource': MockIcon, + 'kind:template': MockIcon, brokenImage: MockIcon, catalog: MockIcon,