Skip to content

Commit

Permalink
fix(global-header): added some changes for integration with rhdh (#270)
Browse files Browse the repository at this point in the history
  • Loading branch information
ciiay authored Jan 10, 2025
1 parent 0e17490 commit 68cb7be
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# please keep this in sync with rhdh/dynamic-plugins.default.yaml
dynamicPlugins:
frontend:
red-hat-developer-hub.backstage-plugin-global-header:
mountPoints:
- mountPoint: application/header
importName: GlobalHeader
config:
layout:
position: above-main-content
5 changes: 5 additions & 0 deletions workspaces/global-header/plugins/global-header/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@
"react-use": "^17.2.4"
},
"peerDependencies": {
"@backstage/core-components": "0.15.1",
"@backstage/core-plugin-api": "^1.10.0",
"@backstage/plugin-search": "1.4.18",
"@backstage/plugin-search-react": "1.8.1",
"@backstage/theme": "0.6.0",
"react": "^16.13.1 || ^17.0.0 || ^18.0.0",
"react-router-dom": "^6.0.0"
},
Expand Down
7 changes: 7 additions & 0 deletions workspaces/global-header/plugins/global-header/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { unstable_ClassNameGenerator as ClassNameGenerator } from '@mui/material/className';

ClassNameGenerator.configure(componentName => {
return componentName.startsWith('v5-')
? componentName
: `v5-${componentName}`;
});

export { globalHeaderPlugin, GlobalHeader } from './plugin';
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const GlobalHeader = globalHeaderPlugin.provide(
createComponentExtension({
name: 'GlobalHeader',
component: {
lazy: () => import('./components').then(m => m.GlobalHeader),
lazy: () => import('./components/GlobalHeader').then(m => m.GlobalHeader),
},
}),
);
5 changes: 5 additions & 0 deletions workspaces/global-header/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10001,6 +10001,11 @@ __metadata:
react-router-dom: ^6.0.0
react-use: ^17.2.4
peerDependencies:
"@backstage/core-components": 0.15.1
"@backstage/core-plugin-api": ^1.10.0
"@backstage/plugin-search": 1.4.18
"@backstage/plugin-search-react": 1.8.1
"@backstage/theme": 0.6.0
react: ^16.13.1 || ^17.0.0 || ^18.0.0
react-router-dom: ^6.0.0
languageName: unknown
Expand Down

0 comments on commit 68cb7be

Please sign in to comment.