File tree Expand file tree Collapse file tree 4 files changed +9
-22
lines changed
packages/plugin-utils/src/hooks
plugins/dynamic-plugins-info Expand file tree Collapse file tree 4 files changed +9
-22
lines changed Original file line number Diff line number Diff line change 11export { useDynamicPluginConfig } from './useDynamicPlugin' ;
2+ export { default as useMountPoints } from './useMountPoints' ;
Original file line number Diff line number Diff line change 3939 "@material-table/core" : " 3.2.5" ,
4040 "@mui/icons-material" : " 5.18.0" ,
4141 "@mui/material" : " 5.18.0" ,
42- "@scalprum/react-core " : " 0.9.5 " ,
42+ "@red-hat-developer-hub/plugin-utils " : " workspace:* " ,
4343 "react-use" : " 17.6.0"
4444 },
4545 "peerDependencies" : {
Original file line number Diff line number Diff line change 77 TabbedLayout ,
88} from '@backstage/core-components' ;
99
10- import { useScalprum } from '@scalprum/react-core ' ;
10+ import { useMountPoints } from '@red-hat-developer-hub/plugin-utils ' ;
1111
1212export interface PluginTab {
1313 Component : React . ComponentType ;
@@ -17,31 +17,17 @@ export interface PluginTab {
1717 } ;
1818}
1919
20- export interface ScalprumState {
21- api ?: {
22- dynamicRootConfig ?: {
23- mountPoints ?: {
24- 'internal.plugins/tab' : PluginTab [ ] ;
25- } ;
26- } ;
27- } ;
28- }
29-
3020export const DynamicPluginsInfoPage = ( ) => {
31- const scalprum = useScalprum < ScalprumState > ( ) ;
32-
33- const tabs =
34- scalprum . api ?. dynamicRootConfig ?. mountPoints ?. [ 'internal.plugins/tab' ] ||
35- [ ] ;
36-
21+ // this coercion is necessary to preserve compatability with
22+ // the original configuration definition
23+ const tabs = useMountPoints ( 'internal.plugins/tab' ) as unknown as PluginTab [ ] ;
3724 const FirstComponent = tabs [ 0 ] ?. Component ;
38-
3925 return (
4026 < Page themeId = "extensions" >
4127 < Header title = "Extensions" />
4228 { tabs . length > 1 ? (
4329 < TabbedLayout >
44- { tabs . map ( ( { Component, config } ) => (
30+ { tabs . map ( ( { Component, config } : PluginTab ) => (
4531 < TabbedLayout . Route
4632 key = { config . path }
4733 path = { config . path }
Original file line number Diff line number Diff line change @@ -7734,7 +7734,7 @@ __metadata:
77347734 "@material-table/core": 3.2.5
77357735 "@mui/icons-material": 5.18.0
77367736 "@mui/material": 5.18.0
7737- "@scalprum/react-core ": 0.9.5
7737+ "@red-hat-developer-hub/plugin-utils ": "workspace:*"
77387738 "@testing-library/jest-dom": 6.6.4
77397739 "@testing-library/react": 14.3.1
77407740 "@testing-library/user-event": 14.6.1
@@ -12081,7 +12081,7 @@ __metadata:
1208112081 languageName: node
1208212082 linkType: hard
1208312083
12084- "@red-hat-developer-hub/
[email protected] , @red-hat-developer-hub/plugin-utils@workspace:packages/plugin-utils":
12084+ "@red-hat-developer-hub/
[email protected] , @red-hat-developer-hub/plugin-utils@workspace:
*, @red-hat-developer-hub/plugin-utils@workspace: packages/plugin-utils":
1208512085 version: 0.0.0-use.local
1208612086 resolution: "@red-hat-developer-hub/plugin-utils@workspace:packages/plugin-utils"
1208712087 dependencies:
You can’t perform that action at this time.
0 commit comments