diff --git a/.changeset/hungry-dogs-agree.md b/.changeset/hungry-dogs-agree.md index a8c5b24c25..07d7e41483 100644 --- a/.changeset/hungry-dogs-agree.md +++ b/.changeset/hungry-dogs-agree.md @@ -1,6 +1,6 @@ --- '@backstage/core-app-api': patch -'@backstage/plugin-user-settings': patch +'@backstage/core-plugin-api': patch --- -Added Table with List of Available Icons and Documentation on Usage +Added `getSystemIcons()` function to the `AppManager` that will pull a list of all the icons that have been registered in the App. diff --git a/plugins/user-settings/src/components/General/UserSettingsAvailableIconsTable.tsx b/plugins/user-settings/src/components/General/UserSettingsAvailableIconsTable.tsx deleted file mode 100644 index d0e6034c66..0000000000 --- a/plugins/user-settings/src/components/General/UserSettingsAvailableIconsTable.tsx +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright 2022 The Backstage Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { IconComponent, useApp } from '@backstage/core-plugin-api'; -import { Table, TableColumn } from '@backstage/core-components'; - -import { Box } from '@material-ui/core'; -import LanguageIcon from '@material-ui/icons/Language'; -import React from 'react'; - -type SystemIcon = { - key: string; - icon: IconComponent; -}; - -const columns: TableColumn[] = [ - { - title: 'Icon', - field: 'icon', - width: 'auto', - render: (row: Partial) => ( - - {row.icon ? : } - - ), - }, - { - title: 'Key', - field: 'key', - width: 'auto', - defaultSort: 'asc', - }, -]; - -export const UserSettingsAvailableIconsTable = () => { - const app = useApp(); - const systemIcons = app.getSystemIcons(); - const systemIconList: SystemIcon[] = []; - for (const icon in systemIcons) { - if (Object.prototype.hasOwnProperty.call(systemIcons, icon)) { - const sysIcon = { - key: icon, - icon: systemIcons[icon], - }; - systemIconList.push(sysIcon); - } - } - - return ( - - ); -}; diff --git a/plugins/user-settings/src/components/General/UserSettingsGeneral.tsx b/plugins/user-settings/src/components/General/UserSettingsGeneral.tsx index e3a9567164..db7fdd7be6 100644 --- a/plugins/user-settings/src/components/General/UserSettingsGeneral.tsx +++ b/plugins/user-settings/src/components/General/UserSettingsGeneral.tsx @@ -18,7 +18,6 @@ import React from 'react'; import { UserSettingsProfileCard } from './UserSettingsProfileCard'; import { UserSettingsAppearanceCard } from './UserSettingsAppearanceCard'; import { UserSettingsIdentityCard } from './UserSettingsIdentityCard'; -import { UserSettingsAvailableIconsTable } from './UserSettingsAvailableIconsTable'; export const UserSettingsGeneral = () => { return ( @@ -32,9 +31,6 @@ export const UserSettingsGeneral = () => { - - - ); };