Skip to content

Commit 75bbfcb

Browse files
authored
Merge branch 'release-1.4' into RHIDP-4585-Release-Notes-1.4-Known-issues-bug-fixes-and-changes
2 parents c53bff9 + 206c39c commit 75bbfcb

11 files changed

+523
-364
lines changed

assemblies/assembly-customizing-the-appearance.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ include::modules/customizing-the-appearance/ref-customize-rhdh-default-rhdh.adoc
4242

4343
include::modules/customizing-the-appearance/ref-customize-rhdh-default-backstage.adoc[leveloffset=+1]
4444

45+
include::modules/customizing-the-appearance/proc-loading-custom-theme-using-dynamic-plugin.adoc[leveloffset=+1]
4546

4647
include::modules/customizing-the-appearance/ref-customize-rhdh-custom-components.adoc[leveloffset=+1]
4748

assemblies/dynamic-plugins/assembly-configuring-rhdh-plugins.adoc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,9 @@ include::../../artifacts/rhdh-plugins-reference/tekton/tekton-plugin-admin.adoc[
2121
include::../modules/dynamic-plugins/proc-topology-install.adoc[leveloffset=+2]
2222
include::../modules/dynamic-plugins/proc-topology-configure.adoc[leveloffset=+2]
2323

24-
2524
include::../assembly-bulk-importing-from-github.adoc[leveloffset=+1]
2625

27-
2826
include::../assembly-using-servicenow.adoc[leveloffset=+1]
2927

30-
28+
// Overriding Core Backend Service Configuration
29+
include::../modules/dynamic-plugins/con-overriding-core-backend-services.adoc[leveloffset=+1]

assemblies/dynamic-plugins/assembly-reference-rhdh-plugins.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ include::../modules/dynamic-plugins/proc-viewing-installed-plugins.adoc[leveloff
88
[id="rhdh-supported-plugins"]
99
include::../modules/dynamic-plugins/ref-rh-supported-plugins.adoc[leveloffset=+1]
1010
include::../modules/dynamic-plugins/ref-rh-tech-preview-plugins.adoc[leveloffset=+1]
11-
include::../modules/dynamic-plugins/ref-community-plugins.adoc[leveloffset=+1]
11+
// include::../modules/dynamic-plugins/ref-community-plugins.adoc[leveloffset=+1]

assemblies/dynamic-plugins/assembly-rhdh-installing-dynamic-plugins.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ include::../modules/dynamic-plugins/ref-rh-tech-preview-plugins.adoc[leveloffset
3333
====
3434

3535
// Community plugins
36-
[id="rhdh-community-plugins"]
37-
include::../modules/dynamic-plugins/ref-community-plugins.adoc[leveloffset=+4]
36+
// [id="rhdh-community-plugins"]
37+
// include::../modules/dynamic-plugins/ref-community-plugins.adoc[leveloffset=+4]
3838

3939
// Red Hat compatible plugins
4040
[id="rhdh-compatible-plugins"]
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// Module included in the following assemblies:
2+
// assembly-customize-rhdh-theme.adoc
3+
4+
[id="proc-loading-custom-theme-using-dynamic-plugin-_{context}"]
5+
= Loading a custom {product-short} theme by using a dynamic plugin
6+
7+
You can load a custom {product-short} theme from a dynamic plugin.
8+
9+
.Procedure
10+
11+
. Export a theme provider function in your dynamic plugin, for example:
12+
+
13+
.Sample `myTheme.ts` fragment
14+
[source,javascript]
15+
----
16+
import { lightTheme } from './lightTheme'; // some custom theme
17+
import { UnifiedThemeProvider } from '@backstage/theme';
18+
export const lightThemeProvider = ({ children }: { children: ReactNode }) => (
19+
<UnifiedThemeProvider theme={lightTheme} children={children} />
20+
);
21+
----
22+
+
23+
For more information about creating a custom theme, see link:https://backstage.io/docs/getting-started/app-custom-theme/#creating-a-custom-theme[Backstage documentation - Creating a Custom Theme].
24+
25+
. Configure {product-short} to load the theme in the UI by using the `themes` configuration field:
26+
+
27+
.`app-config-rhdh.yaml` fragment
28+
[source,yaml]
29+
----
30+
dynamicPlugins:
31+
frontend:
32+
example.my-custom-theme-plugin:
33+
themes:
34+
- id: light # <1>
35+
title: Light
36+
variant: light
37+
icon: someIconReference
38+
importName: lightThemeProvider
39+
----
40+
<1> Set your theme ID by specifying the desired value. Optionally, override the default {product-short} themes by using the following ID values: `light` to replace the default light theme, or `dark` to replace the default dark theme.
41+
42+
.Verification
43+
44+
* The theme is available in the {product-short} *Settings* page.
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
[id="overriding-core-backend-services_{context}"]
2+
= Overriding Core Backend Service Configuration
3+
4+
The {product} ({product-very-short}) backend platform consists of a number of core services that are well encapsulated. The {product-very-short} backend installs these default core services statically during initialization.
5+
6+
You can configure these core services by customizing the backend source code and rebuilding your {product-short} application. Alternatively, you can customize a core service by installing it as a `BackendFeature` by using dynamic plugin functionality.
7+
8+
To use the dynamic plugin functionality to customize a core service in your RHDH application, you must configure the backend to avoid statically installing a given default core service.
9+
10+
For example, adding a middleware function to handle all incoming requests can be done by installing a custom `configure` function for the root `HTTP` router backend service which allows access to the underlying Express application.
11+
12+
.Example of a `BackendFeature` middleware function to handle incoming `HTTP` requests
13+
14+
[source,javascript]
15+
----
16+
// Create the BackendFeature
17+
export const customRootHttpServerFactory: BackendFeature =
18+
rootHttpRouterServiceFactory({
19+
configure: ({ app, routes, middleware, logger }) => {
20+
logger.info(
21+
'Using custom root HttpRouterServiceFactory configure function',
22+
);
23+
app.use(middleware.helmet());
24+
app.use(middleware.cors());
25+
app.use(middleware.compression());
26+
app.use(middleware.logging());
27+
// Add a the custom middleware function before all
28+
// of the route handlers
29+
app.use(addTestHeaderMiddleware({ logger }));
30+
app.use(routes);
31+
app.use(middleware.notFound());
32+
app.use(middleware.error());
33+
},
34+
});
35+
36+
// Export the BackendFeature as the default entrypoint
37+
export default customRootHttpServerFactory;
38+
----
39+
40+
In the above example, as the `BackendFeature` overrides the default implementation of the HTTP router service, you must set the `ENABLE_CORE_ROOTHTTPROUTER_OVERRIDE` environment variable to `true` so that the {product-short} does not install the default implementation automatically.
41+
42+
== Overriding environment variables
43+
To allow a dynamic plugin to load a core service override, you must start the {product-short} backend with the corresponding core service ID environment variable set to `true`.
44+
45+
.Environment variables and core service IDs
46+
[cols="50%,50%", frame="all", options="header"]
47+
|===
48+
|Variable
49+
|Description
50+
51+
|`ENABLE_CORE_AUTH_OVERRIDE`
52+
|Override the `core.auth` service
53+
54+
| `ENABLE_CORE_CACHE_OVERRIDE`
55+
| Override the `core.cache` service
56+
57+
| `ENABLE_CORE_ROOTCONFIG_OVERRIDE`
58+
| Override the `core.rootConfig` service
59+
60+
| `ENABLE_CORE_DATABASE_OVERRIDE`
61+
| Override the `core.database` service
62+
63+
| `ENABLE_CORE_DISCOVERY_OVERRIDE`
64+
| Override the `core.discovery` service
65+
66+
| `ENABLE_CORE_HTTPAUTH_OVERRIDE`
67+
| Override the `core.httpAuth` service
68+
69+
| `ENABLE_CORE_HTTPROUTER_OVERRIDE`
70+
| Override the `core.httpRouter` service
71+
72+
| `ENABLE_CORE_LIFECYCLE_OVERRIDE`
73+
| Override the `core.lifecycle` service
74+
75+
| `ENABLE_CORE_LOGGER_OVERRIDE`
76+
| Override the `core.logger` service
77+
78+
| `ENABLE_CORE_PERMISSIONS_OVERRIDE`
79+
| Override the `core.permissions` service
80+
81+
| `ENABLE_CORE_ROOTHEALTH_OVERRIDE`
82+
| Override the `core.rootHealth` service
83+
84+
| `ENABLE_CORE_ROOTHTTPROUTER_OVERRIDE`
85+
| Override the `core.rootHttpRouter` service
86+
87+
| `ENABLE_CORE_ROOTLIFECYCLE_OVERRIDE`
88+
| Override the `core.rootLifecycle` service
89+
90+
| `ENABLE_CORE_SCHEDULER_OVERRIDE`
91+
| Override the `core.scheduler` service
92+
93+
| `ENABLE_CORE_USERINFO_OVERRIDE`
94+
| Override the `core.userInfo` service
95+
96+
| `ENABLE_CORE_URLREADER_OVERRIDE`
97+
| Override the `core.urlReader` service
98+
99+
| `ENABLE_EVENTS_SERVICE_OVERRIDE`
100+
| Override the `events.service` service
101+
|===

0 commit comments

Comments
 (0)