From 87f01c53692ab6033b7acb2ef33091a64c8635ff Mon Sep 17 00:00:00 2001 From: Brian Fletcher Date: Fri, 26 Jul 2024 11:09:19 +0100 Subject: [PATCH 1/3] Add a component card for the shortcut plugin --- .changeset/moody-hounds-rest.md | 5 + .../backstage-plugin-shortcut/package.json | 2 +- .../src/api/ShortcutClient.ts | 26 +++-- .../src/api/types.ts | 6 ++ .../ComponentExtensions/EntityStoriesCard.tsx | 102 ++++++++++++++++++ .../components/Home/StoriesCardHomepage.tsx | 2 +- .../src/constants.ts | 16 +++ .../backstage-plugin-shortcut/src/index.ts | 8 +- .../src/isShortcutAvailable.ts | 20 ++++ .../backstage-plugin-shortcut/src/plugin.ts | 15 ++- yarn.lock | 87 +++++++++++++++ 11 files changed, 279 insertions(+), 10 deletions(-) create mode 100644 .changeset/moody-hounds-rest.md create mode 100644 plugins/frontend/backstage-plugin-shortcut/src/components/ComponentExtensions/EntityStoriesCard.tsx create mode 100644 plugins/frontend/backstage-plugin-shortcut/src/constants.ts create mode 100644 plugins/frontend/backstage-plugin-shortcut/src/isShortcutAvailable.ts diff --git a/.changeset/moody-hounds-rest.md b/.changeset/moody-hounds-rest.md new file mode 100644 index 000000000..56c07eb04 --- /dev/null +++ b/.changeset/moody-hounds-rest.md @@ -0,0 +1,5 @@ +--- +'@roadiehq/backstage-plugin-shortcut': minor +--- + +Add an entity card for the shortcut plugin. diff --git a/plugins/frontend/backstage-plugin-shortcut/package.json b/plugins/frontend/backstage-plugin-shortcut/package.json index a6854a375..c6bd2de77 100644 --- a/plugins/frontend/backstage-plugin-shortcut/package.json +++ b/plugins/frontend/backstage-plugin-shortcut/package.json @@ -41,7 +41,7 @@ "@material-ui/lab": "^4.0.0-alpha.45", "react-use": "^17.2.4", "msw": "^1.0.1", - "@backstage/plugin-home": "^0.7.3" + "@backstage/plugin-home-react": "^0.1.15" }, "peerDependencies": { "react": "^16.13.1 || ^17.0.0 || ^18.0.0" diff --git a/plugins/frontend/backstage-plugin-shortcut/src/api/ShortcutClient.ts b/plugins/frontend/backstage-plugin-shortcut/src/api/ShortcutClient.ts index 13e2e9372..093eb41f1 100644 --- a/plugins/frontend/backstage-plugin-shortcut/src/api/ShortcutClient.ts +++ b/plugins/frontend/backstage-plugin-shortcut/src/api/ShortcutClient.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { Story, User } from './types'; +import { Story, StoryResponse, User } from './types'; import { createApiRef, DiscoveryApi } from '@backstage/core-plugin-api'; const DEFAULT_PROXY_PATH = '/shortcut/api'; @@ -42,15 +42,29 @@ export class ShortcutClient { return proxyUrl + this.proxyPath; } - async fetchStories({ owner }: { owner?: string }): Promise { - const response = await fetch( - `${await this.getApiUrl()}/search/stories?page_size=25&query=owner:${owner}`, - ); + async fetch({ path }: { path?: string }): Promise { + const response = await fetch(`${await this.getApiUrl()}${path}`); const payload = await response.json(); if (!response.ok) { + if (payload.message) { + throw new Error(payload.message); + } throw new Error(payload.errors[0]); } - return payload.data; + + return payload; + } + + async fetchStories({ query }: { query: string }): Promise { + const encodedQuery = encodeURIComponent(query); + return await this.fetch({ + path: `/search/stories?page_size=25&query=${encodedQuery}`, + }); + } + + async fetchOwnedStories({ owner }: { owner?: string }): Promise { + const query = `owner:${owner}`; + return (await this.fetchStories({ query })).data; } async getUsers(): Promise { diff --git a/plugins/frontend/backstage-plugin-shortcut/src/api/types.ts b/plugins/frontend/backstage-plugin-shortcut/src/api/types.ts index fa9329a41..0e04c9299 100644 --- a/plugins/frontend/backstage-plugin-shortcut/src/api/types.ts +++ b/plugins/frontend/backstage-plugin-shortcut/src/api/types.ts @@ -26,6 +26,12 @@ export type Story = { app_url: string; }; +export type StoryResponse = { + next?: string; + total: number; + data: Array; +}; + export type User = { id: string; profile: Profile; diff --git a/plugins/frontend/backstage-plugin-shortcut/src/components/ComponentExtensions/EntityStoriesCard.tsx b/plugins/frontend/backstage-plugin-shortcut/src/components/ComponentExtensions/EntityStoriesCard.tsx new file mode 100644 index 000000000..0619c0e42 --- /dev/null +++ b/plugins/frontend/backstage-plugin-shortcut/src/components/ComponentExtensions/EntityStoriesCard.tsx @@ -0,0 +1,102 @@ +/* + * Copyright 2024 Larder Software Limited + * + * 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 React from 'react'; +import { ErrorPanel, Table, TableColumn } from '@backstage/core-components'; +import SyncIcon from '@material-ui/icons/Sync'; +import { shortcutApiRef } from '../../api'; +import { useApi } from '@backstage/core-plugin-api'; +import { useAsyncRetry } from 'react-use'; +import { useEntity } from '@backstage/plugin-catalog-react'; +import { SHORTCUT_QUERY_ANNOTATION } from '../../constants'; +import { Story, User } from '../../api/types'; + +const columnsBuilder: (users?: User[]) => TableColumn[] = ( + users?: User[], +) => [ + { + title: 'Name', + field: 'name', + }, + { + title: 'Status', + render: story => (story.started ? <>In progress : <>'Not started'), + }, + { + title: 'Owners', + render: story => { + return users + ?.filter(user => story.owner_ids.includes(user.id)) + .map(user => user.profile.name) + .join(', '); + }, + }, +]; + +export const EntityStoriesCard = (props: { + title?: string; + additionalQuery?: string; +}) => { + const shortcutApi = useApi(shortcutApiRef); + const { entity } = useEntity(); + + const { + value: data, + retry, + error, + loading, + } = useAsyncRetry(async () => { + let query = entity.metadata.annotations?.[SHORTCUT_QUERY_ANNOTATION]; + if (props.additionalQuery) { + query = `${query} ${props.additionalQuery}`; + } + if (query) { + return (await shortcutApi.fetchStories({ query })).data; + } + return []; + }); + + const { value: users } = useAsyncRetry(async () => { + return shortcutApi.getUsers(); + }); + + if (error) { + return ; + } + return ( + , + tooltip: 'Refresh', + isFreeAction: true, + onClick: () => retry(), + }, + ]} + /> + ); +}; diff --git a/plugins/frontend/backstage-plugin-shortcut/src/components/Home/StoriesCardHomepage.tsx b/plugins/frontend/backstage-plugin-shortcut/src/components/Home/StoriesCardHomepage.tsx index 2025483f5..ed4c794b5 100644 --- a/plugins/frontend/backstage-plugin-shortcut/src/components/Home/StoriesCardHomepage.tsx +++ b/plugins/frontend/backstage-plugin-shortcut/src/components/Home/StoriesCardHomepage.tsx @@ -224,7 +224,7 @@ const StoriesCardContent = () => { user => user.profile.email_address === profile.email, )?.profile.mention_name; - const stories = await api.fetchStories({ + const stories = await api.fetchOwnedStories({ owner: loggedUser ? loggedUser : undefined, }); diff --git a/plugins/frontend/backstage-plugin-shortcut/src/constants.ts b/plugins/frontend/backstage-plugin-shortcut/src/constants.ts new file mode 100644 index 000000000..2980bd3dc --- /dev/null +++ b/plugins/frontend/backstage-plugin-shortcut/src/constants.ts @@ -0,0 +1,16 @@ +/* + * Copyright 2024 Larder Software Limited + * + * 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. + */ +export const SHORTCUT_QUERY_ANNOTATION = 'shortcut.com/story-query'; diff --git a/plugins/frontend/backstage-plugin-shortcut/src/index.ts b/plugins/frontend/backstage-plugin-shortcut/src/index.ts index d588613c9..f6a88fb43 100644 --- a/plugins/frontend/backstage-plugin-shortcut/src/index.ts +++ b/plugins/frontend/backstage-plugin-shortcut/src/index.ts @@ -14,6 +14,12 @@ * limitations under the License. */ -export { backstagePluginShortcutPlugin, HomepageStoriesCard } from './plugin'; +export { + backstagePluginShortcutPlugin, + HomepageStoriesCard, + EntityShortcutStoriesCard, +} from './plugin'; export * from './api'; export * from './components/Home'; +export * from './constants'; +export * from './isShortcutAvailable'; diff --git a/plugins/frontend/backstage-plugin-shortcut/src/isShortcutAvailable.ts b/plugins/frontend/backstage-plugin-shortcut/src/isShortcutAvailable.ts new file mode 100644 index 000000000..03f8367b9 --- /dev/null +++ b/plugins/frontend/backstage-plugin-shortcut/src/isShortcutAvailable.ts @@ -0,0 +1,20 @@ +/* + * Copyright 2024 Larder Software Limited + * + * 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 { Entity } from '@backstage/catalog-model'; +import { SHORTCUT_QUERY_ANNOTATION } from './constants'; + +export const isShortcutAvailable = (entity: Entity) => + Boolean(entity?.metadata.annotations?.[SHORTCUT_QUERY_ANNOTATION]); diff --git a/plugins/frontend/backstage-plugin-shortcut/src/plugin.ts b/plugins/frontend/backstage-plugin-shortcut/src/plugin.ts index 65abe41b8..e6944aead 100644 --- a/plugins/frontend/backstage-plugin-shortcut/src/plugin.ts +++ b/plugins/frontend/backstage-plugin-shortcut/src/plugin.ts @@ -17,8 +17,9 @@ import { createApiFactory, createPlugin, discoveryApiRef, + createComponentExtension, } from '@backstage/core-plugin-api'; -import { createCardExtension } from '@backstage/plugin-home'; +import { createCardExtension } from '@backstage/plugin-home-react'; import { shortcutApiRef, ShortcutClient } from './api'; import { rootRouteRef } from './routes'; @@ -44,3 +45,15 @@ export const HomepageStoriesCard = backstagePluginShortcutPlugin.provide( components: () => import('./components/Home/StoriesCardHomepage'), }), ); + +export const EntityShortcutStoriesCard = backstagePluginShortcutPlugin.provide( + createComponentExtension({ + name: 'EntityStoriesCard ', + component: { + lazy: () => + import('./components/ComponentExtensions/EntityStoriesCard').then( + m => m.EntityStoriesCard, + ), + }, + }), +); diff --git a/yarn.lock b/yarn.lock index cbfb77f94..ad6d33c90 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4299,6 +4299,49 @@ zen-observable "^0.10.0" zod "^3.22.4" +"@backstage/core-components@^0.14.9": + version "0.14.9" + resolved "https://registry.yarnpkg.com/@backstage/core-components/-/core-components-0.14.9.tgz#bb1f40be18d8241b70538383d324aec233586382" + integrity sha512-tcwDUeQBMIKtM+EuLMl6BdwjWdjjTnvvUuQCJISdy5ot+Yp/znQK+d4KIA97wq3Fu/ufy1+tAAwGGaifHMRf1g== + dependencies: + "@backstage/config" "^1.2.0" + "@backstage/core-plugin-api" "^1.9.3" + "@backstage/errors" "^1.2.4" + "@backstage/theme" "^0.5.6" + "@backstage/version-bridge" "^1.0.8" + "@date-io/core" "^1.3.13" + "@material-table/core" "^3.1.0" + "@material-ui/core" "^4.12.2" + "@material-ui/icons" "^4.9.1" + "@material-ui/lab" "4.0.0-alpha.61" + "@react-hookz/web" "^24.0.0" + "@types/react" "^16.13.1 || ^17.0.0 || ^18.0.0" + "@types/react-sparklines" "^1.7.0" + ansi-regex "^6.0.1" + classnames "^2.2.6" + d3-selection "^3.0.0" + d3-shape "^3.0.0" + d3-zoom "^3.0.0" + dagre "^0.8.5" + linkify-react "4.1.3" + linkifyjs "4.1.3" + lodash "^4.17.21" + pluralize "^8.0.0" + qs "^6.9.4" + rc-progress "3.5.1" + react-helmet "6.1.0" + react-hook-form "^7.12.2" + react-idle-timer "5.7.2" + react-markdown "^8.0.0" + react-sparklines "^1.7.0" + react-syntax-highlighter "^15.4.5" + react-use "^17.3.2" + react-virtualized-auto-sizer "^1.0.11" + react-window "^1.8.6" + remark-gfm "^3.0.1" + zen-observable "^0.10.0" + zod "^3.22.4" + "@backstage/core-plugin-api@^1.9.2": version "1.9.2" resolved "https://registry.yarnpkg.com/@backstage/core-plugin-api/-/core-plugin-api-1.9.2.tgz#1a75865e567708829f5a8056ad23ea94233f4b7f" @@ -4311,6 +4354,18 @@ "@types/react" "^16.13.1 || ^17.0.0 || ^18.0.0" history "^5.0.0" +"@backstage/core-plugin-api@^1.9.3": + version "1.9.3" + resolved "https://registry.yarnpkg.com/@backstage/core-plugin-api/-/core-plugin-api-1.9.3.tgz#66b4b7dc620823c66b123c8a2d6db088e2936027" + integrity sha512-MV/RQv8nAPYVkVX926Z+VPW2W4ZzU9VN2s9NhWSWqoYuOzsmA4FgmfNDuwiPEAUKW7AlVCGI4A0deUZ22Orgyw== + dependencies: + "@backstage/config" "^1.2.0" + "@backstage/errors" "^1.2.4" + "@backstage/types" "^1.1.1" + "@backstage/version-bridge" "^1.0.8" + "@types/react" "^16.13.1 || ^17.0.0 || ^18.0.0" + history "^5.0.0" + "@backstage/dev-utils@^1.0.31": version "1.0.31" resolved "https://registry.yarnpkg.com/@backstage/dev-utils/-/dev-utils-1.0.31.tgz#db72e72df2d0b234501ac90878f0e0836e50a03c" @@ -4930,6 +4985,18 @@ "@rjsf/utils" "5.17.1" "@types/react" "^16.13.1 || ^17.0.0" +"@backstage/plugin-home-react@^0.1.15": + version "0.1.15" + resolved "https://registry.yarnpkg.com/@backstage/plugin-home-react/-/plugin-home-react-0.1.15.tgz#a7dc55babc2d642b73f148262660b1a7561f8808" + integrity sha512-t23LbSFlLMuFGIwnmvC/jJLZaojRozlWnqk+OX8YOHv8EHgAESLqORHYIMb5RdGIgjQesaAcxBY4One1mtdy0Q== + dependencies: + "@backstage/core-components" "^0.14.9" + "@backstage/core-plugin-api" "^1.9.3" + "@material-ui/core" "^4.12.2" + "@material-ui/icons" "^4.9.1" + "@rjsf/utils" "5.18.5" + "@types/react" "^16.13.1 || ^17.0.0" + "@backstage/plugin-home@^0.7.3": version "0.7.3" resolved "https://registry.yarnpkg.com/@backstage/plugin-home/-/plugin-home-0.7.3.tgz#775c1612ea8e60e45c55aee23f6e5be99b73d46a" @@ -5603,6 +5670,15 @@ "@emotion/styled" "^11.10.5" "@mui/material" "^5.12.2" +"@backstage/theme@^0.5.6": + version "0.5.6" + resolved "https://registry.yarnpkg.com/@backstage/theme/-/theme-0.5.6.tgz#18645cbe42fb5667946e0a5dd38f2fb0bb056597" + integrity sha512-7/0sZYAS+2p/eEWC8eBINWHNv4jas6R20e0R5f0fc1YvLnVQ8HhnpZ6+d2vDMe7X2A2TBBcyJbSCybHdRAKpAA== + dependencies: + "@emotion/react" "^11.10.5" + "@emotion/styled" "^11.10.5" + "@mui/material" "^5.12.2" + "@backstage/types@^1.1.1": version "1.1.1" resolved "https://registry.yarnpkg.com/@backstage/types/-/types-1.1.1.tgz#c9ccb30357005e7fb5fa2ac140198059976eb076" @@ -9146,6 +9222,17 @@ lodash-es "^4.17.21" react-is "^18.2.0" +"@rjsf/utils@5.18.5": + version "5.18.5" + resolved "https://registry.yarnpkg.com/@rjsf/utils/-/utils-5.18.5.tgz#638724740b29784804dd244b0574213aa181469b" + integrity sha512-b39ZSPv2lpH+VXUKrVsPnPyOKcTa9P08h50J0A1+7xHj6dm4KG1KY/mY4QCaNavZVXsQoieHOe8kmdFDlXirzA== + dependencies: + json-schema-merge-allof "^0.8.1" + jsonpointer "^5.0.1" + lodash "^4.17.21" + lodash-es "^4.17.21" + react-is "^18.2.0" + "@rjsf/validator-ajv8@5.17.1": version "5.17.1" resolved "https://registry.yarnpkg.com/@rjsf/validator-ajv8/-/validator-ajv8-5.17.1.tgz#9b5e4b22f3ab47316c7a19da22639812e4a91193" From 1d9d694b302c572a9feddc762f4ca1c57ca2b614 Mon Sep 17 00:00:00 2001 From: Brian Fletcher Date: Fri, 26 Jul 2024 11:32:26 +0100 Subject: [PATCH 2/3] revert dependency update --- .../backstage-plugin-shortcut/package.json | 2 +- .../backstage-plugin-shortcut/src/plugin.ts | 2 +- yarn.lock | 87 ------------------- 3 files changed, 2 insertions(+), 89 deletions(-) diff --git a/plugins/frontend/backstage-plugin-shortcut/package.json b/plugins/frontend/backstage-plugin-shortcut/package.json index c6bd2de77..a6854a375 100644 --- a/plugins/frontend/backstage-plugin-shortcut/package.json +++ b/plugins/frontend/backstage-plugin-shortcut/package.json @@ -41,7 +41,7 @@ "@material-ui/lab": "^4.0.0-alpha.45", "react-use": "^17.2.4", "msw": "^1.0.1", - "@backstage/plugin-home-react": "^0.1.15" + "@backstage/plugin-home": "^0.7.3" }, "peerDependencies": { "react": "^16.13.1 || ^17.0.0 || ^18.0.0" diff --git a/plugins/frontend/backstage-plugin-shortcut/src/plugin.ts b/plugins/frontend/backstage-plugin-shortcut/src/plugin.ts index e6944aead..8186c0876 100644 --- a/plugins/frontend/backstage-plugin-shortcut/src/plugin.ts +++ b/plugins/frontend/backstage-plugin-shortcut/src/plugin.ts @@ -19,7 +19,7 @@ import { discoveryApiRef, createComponentExtension, } from '@backstage/core-plugin-api'; -import { createCardExtension } from '@backstage/plugin-home-react'; +import { createCardExtension } from '@backstage/plugin-home'; import { shortcutApiRef, ShortcutClient } from './api'; import { rootRouteRef } from './routes'; diff --git a/yarn.lock b/yarn.lock index ad6d33c90..cbfb77f94 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4299,49 +4299,6 @@ zen-observable "^0.10.0" zod "^3.22.4" -"@backstage/core-components@^0.14.9": - version "0.14.9" - resolved "https://registry.yarnpkg.com/@backstage/core-components/-/core-components-0.14.9.tgz#bb1f40be18d8241b70538383d324aec233586382" - integrity sha512-tcwDUeQBMIKtM+EuLMl6BdwjWdjjTnvvUuQCJISdy5ot+Yp/znQK+d4KIA97wq3Fu/ufy1+tAAwGGaifHMRf1g== - dependencies: - "@backstage/config" "^1.2.0" - "@backstage/core-plugin-api" "^1.9.3" - "@backstage/errors" "^1.2.4" - "@backstage/theme" "^0.5.6" - "@backstage/version-bridge" "^1.0.8" - "@date-io/core" "^1.3.13" - "@material-table/core" "^3.1.0" - "@material-ui/core" "^4.12.2" - "@material-ui/icons" "^4.9.1" - "@material-ui/lab" "4.0.0-alpha.61" - "@react-hookz/web" "^24.0.0" - "@types/react" "^16.13.1 || ^17.0.0 || ^18.0.0" - "@types/react-sparklines" "^1.7.0" - ansi-regex "^6.0.1" - classnames "^2.2.6" - d3-selection "^3.0.0" - d3-shape "^3.0.0" - d3-zoom "^3.0.0" - dagre "^0.8.5" - linkify-react "4.1.3" - linkifyjs "4.1.3" - lodash "^4.17.21" - pluralize "^8.0.0" - qs "^6.9.4" - rc-progress "3.5.1" - react-helmet "6.1.0" - react-hook-form "^7.12.2" - react-idle-timer "5.7.2" - react-markdown "^8.0.0" - react-sparklines "^1.7.0" - react-syntax-highlighter "^15.4.5" - react-use "^17.3.2" - react-virtualized-auto-sizer "^1.0.11" - react-window "^1.8.6" - remark-gfm "^3.0.1" - zen-observable "^0.10.0" - zod "^3.22.4" - "@backstage/core-plugin-api@^1.9.2": version "1.9.2" resolved "https://registry.yarnpkg.com/@backstage/core-plugin-api/-/core-plugin-api-1.9.2.tgz#1a75865e567708829f5a8056ad23ea94233f4b7f" @@ -4354,18 +4311,6 @@ "@types/react" "^16.13.1 || ^17.0.0 || ^18.0.0" history "^5.0.0" -"@backstage/core-plugin-api@^1.9.3": - version "1.9.3" - resolved "https://registry.yarnpkg.com/@backstage/core-plugin-api/-/core-plugin-api-1.9.3.tgz#66b4b7dc620823c66b123c8a2d6db088e2936027" - integrity sha512-MV/RQv8nAPYVkVX926Z+VPW2W4ZzU9VN2s9NhWSWqoYuOzsmA4FgmfNDuwiPEAUKW7AlVCGI4A0deUZ22Orgyw== - dependencies: - "@backstage/config" "^1.2.0" - "@backstage/errors" "^1.2.4" - "@backstage/types" "^1.1.1" - "@backstage/version-bridge" "^1.0.8" - "@types/react" "^16.13.1 || ^17.0.0 || ^18.0.0" - history "^5.0.0" - "@backstage/dev-utils@^1.0.31": version "1.0.31" resolved "https://registry.yarnpkg.com/@backstage/dev-utils/-/dev-utils-1.0.31.tgz#db72e72df2d0b234501ac90878f0e0836e50a03c" @@ -4985,18 +4930,6 @@ "@rjsf/utils" "5.17.1" "@types/react" "^16.13.1 || ^17.0.0" -"@backstage/plugin-home-react@^0.1.15": - version "0.1.15" - resolved "https://registry.yarnpkg.com/@backstage/plugin-home-react/-/plugin-home-react-0.1.15.tgz#a7dc55babc2d642b73f148262660b1a7561f8808" - integrity sha512-t23LbSFlLMuFGIwnmvC/jJLZaojRozlWnqk+OX8YOHv8EHgAESLqORHYIMb5RdGIgjQesaAcxBY4One1mtdy0Q== - dependencies: - "@backstage/core-components" "^0.14.9" - "@backstage/core-plugin-api" "^1.9.3" - "@material-ui/core" "^4.12.2" - "@material-ui/icons" "^4.9.1" - "@rjsf/utils" "5.18.5" - "@types/react" "^16.13.1 || ^17.0.0" - "@backstage/plugin-home@^0.7.3": version "0.7.3" resolved "https://registry.yarnpkg.com/@backstage/plugin-home/-/plugin-home-0.7.3.tgz#775c1612ea8e60e45c55aee23f6e5be99b73d46a" @@ -5670,15 +5603,6 @@ "@emotion/styled" "^11.10.5" "@mui/material" "^5.12.2" -"@backstage/theme@^0.5.6": - version "0.5.6" - resolved "https://registry.yarnpkg.com/@backstage/theme/-/theme-0.5.6.tgz#18645cbe42fb5667946e0a5dd38f2fb0bb056597" - integrity sha512-7/0sZYAS+2p/eEWC8eBINWHNv4jas6R20e0R5f0fc1YvLnVQ8HhnpZ6+d2vDMe7X2A2TBBcyJbSCybHdRAKpAA== - dependencies: - "@emotion/react" "^11.10.5" - "@emotion/styled" "^11.10.5" - "@mui/material" "^5.12.2" - "@backstage/types@^1.1.1": version "1.1.1" resolved "https://registry.yarnpkg.com/@backstage/types/-/types-1.1.1.tgz#c9ccb30357005e7fb5fa2ac140198059976eb076" @@ -9222,17 +9146,6 @@ lodash-es "^4.17.21" react-is "^18.2.0" -"@rjsf/utils@5.18.5": - version "5.18.5" - resolved "https://registry.yarnpkg.com/@rjsf/utils/-/utils-5.18.5.tgz#638724740b29784804dd244b0574213aa181469b" - integrity sha512-b39ZSPv2lpH+VXUKrVsPnPyOKcTa9P08h50J0A1+7xHj6dm4KG1KY/mY4QCaNavZVXsQoieHOe8kmdFDlXirzA== - dependencies: - json-schema-merge-allof "^0.8.1" - jsonpointer "^5.0.1" - lodash "^4.17.21" - lodash-es "^4.17.21" - react-is "^18.2.0" - "@rjsf/validator-ajv8@5.17.1": version "5.17.1" resolved "https://registry.yarnpkg.com/@rjsf/validator-ajv8/-/validator-ajv8-5.17.1.tgz#9b5e4b22f3ab47316c7a19da22639812e4a91193" From fd847eef104da3f8d8179501cf52feaf1d1c8d78 Mon Sep 17 00:00:00 2001 From: Brian Fletcher Date: Fri, 26 Jul 2024 11:33:38 +0100 Subject: [PATCH 3/3] not optional --- .../backstage-plugin-shortcut/src/api/ShortcutClient.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/frontend/backstage-plugin-shortcut/src/api/ShortcutClient.ts b/plugins/frontend/backstage-plugin-shortcut/src/api/ShortcutClient.ts index 093eb41f1..6c2e650a0 100644 --- a/plugins/frontend/backstage-plugin-shortcut/src/api/ShortcutClient.ts +++ b/plugins/frontend/backstage-plugin-shortcut/src/api/ShortcutClient.ts @@ -42,7 +42,7 @@ export class ShortcutClient { return proxyUrl + this.proxyPath; } - async fetch({ path }: { path?: string }): Promise { + async fetch({ path }: { path: string }): Promise { const response = await fetch(`${await this.getApiUrl()}${path}`); const payload = await response.json(); if (!response.ok) {