Skip to content

Commit

Permalink
docs(global-header): add initial tech docs (#413)
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Jerolimov <[email protected]>
  • Loading branch information
christoph-jerolimov authored Feb 13, 2025
1 parent f35b797 commit 2f73462
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 5 deletions.
7 changes: 3 additions & 4 deletions workspaces/global-header/app-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,14 @@ catalog:
locations:
# Local example data, file locations are relative to the backend process, typically `packages/backend`
- type: file
target: ../../examples/entities.yaml
target: ../../catalog-info.yaml

# Local example template
- type: file
target: ../../examples/entities.yaml
- type: file
target: ../../examples/template/template.yaml
rules:
- allow: [Template]

# Local example organizational data
- type: file
target: ../../examples/org.yaml
rules:
Expand Down
3 changes: 2 additions & 1 deletion workspaces/global-header/catalog-info.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ metadata:
title: RHDH Global Header plugin
description: The global header plugins provides an extendable way for the RHDH header. It provides a set of default components and also allow other plugins can contribute components to the header.
annotations:
backstage.io/techdocs-ref: dir:.
github.com/project-slug: redhat-developer/rhdh-plugins
github.com/team-slug: redhat-developer/rhdh-plugins-contributers
#sonarqube.org/project-key: redhat-developer_rhdh-plugins
Expand All @@ -14,7 +15,7 @@ metadata:
- plugin
spec:
type: backstage-plugin
lifecycle: development
lifecycle: production
owner: rhdh-ui-team
system: rhdh
subcomponentOf: rhdh-plugins
8 changes: 8 additions & 0 deletions workspaces/global-header/docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Global header

Red Hat Developer Hub includes a new configable and highly extendable global header plugin starting with RHDH 1.5.

By default it includes a Search input field, Create, Support[^1] and Notifications[^2] icon buttons and a user profile dropdown.

[^1]: Only when the Support URL is configured in the `app-config.yaml`.
[^2]: Only when the notification plugin is installed.
7 changes: 7 additions & 0 deletions workspaces/global-header/mkdocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
site_name: RHDH Global Header

plugins:
- techdocs-core

nav:
- About: index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Configuration

The Red Hat Developer Hub Global Header can be configured via [dynamic plugins](https://github.com/redhat-developer/rhdh/blob/main/docs/dynamic-plugins/index.md) and [dynamic plugin mount points](https://github.com/redhat-developer/rhdh/blob/main/docs/dynamic-plugins/frontend-plugin-wiring.md).

It is the RHDH default "[application header](https://github.com/redhat-developer/rhdh/blob/main/docs/dynamic-plugins/frontend-plugin-wiring.md#adding-application-header)" implementation that customers can extend or replace.

There are multiple level of extension points (mount points) involved.

1. Red Hat Developer Hub loads all "application headers"
2. The Global Header plugin is loaded by default (it's of only header implementation)
- The header itself can be extended with additional buttons, dropdowns via dynamic plugins
- Also the Create and Profile Dropdowns can be extended with additional options

## Disabling the Global Header

The RHDH Global Header can be disabled competely by disabling the right plugin:

```yaml
# Disabling global header
- package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-global-header
disabled: true
```
## Replacing the Global Header with your own header
To replace the RHDH Global Header with a completly custom header, the default should be disabled as well (see above).
After that customers can implement and install their own header as a dynamic plugin and include a configuration like this:
```yaml
# Custom header implementation
- package: <npm or oci package-reference>
disabled: false
pluginConfig:
dynamicPlugins:
frontend:
<package_name>:
mountPoints:
- mountPoint: application/header
importName: <Header component name>
config:
layout:
position: above-main-content
```
<!--
## Disable Global Header features
## Add custom components to the Global Header
-->

0 comments on commit 2f73462

Please sign in to comment.