diff --git a/app/src/examples/example2/Example2.tsx b/app/src/examples/example2/Example2.tsx index f7cb7f018..5842c95cb 100644 --- a/app/src/examples/example2/Example2.tsx +++ b/app/src/examples/example2/Example2.tsx @@ -1,11 +1,32 @@ -import { PageSection, PageSectionVariants, Text, TextContent } from '@patternfly/react-core' +import { CodeBlock, CodeBlockCode, PageSection, PageSectionVariants, Text, TextContent } from '@patternfly/react-core' import React from 'react' export const Example2: React.FunctionComponent = () => ( Example 2 - This is another example plugin. + + This is another example plugin that demonstrates how you can customise hawtconfig.json from an + external plugin. + + + See: app/src/examples/example2/index.ts + + + + {`configManager.configure(config => { + if (!config.about) { + config.about = {} + } + const description = config.about.description + config.about.description = (description ?? '') + ' This text is added by the example 2 plugin.' + if (!config.about.productInfo) { + config.about.productInfo = [] + } + config.about.productInfo.push({ name: 'Example 2', value: '1.0.0' }) +})`} + + ) diff --git a/app/src/examples/example2/index.ts b/app/src/examples/example2/index.ts index 780629274..d0345c6a0 100644 --- a/app/src/examples/example2/index.ts +++ b/app/src/examples/example2/index.ts @@ -18,4 +18,8 @@ configManager.configure(config => { } const description = config.about.description config.about.description = (description ?? '') + ' This text is added by the example 2 plugin.' + if (!config.about.productInfo) { + config.about.productInfo = [] + } + config.about.productInfo.push({ name: 'Example 2', value: '1.0.0' }) }) diff --git a/packages/hawtio/src/core/core.ts b/packages/hawtio/src/core/core.ts index 2e4a2f8df..4949d4c92 100644 --- a/packages/hawtio/src/core/core.ts +++ b/packages/hawtio/src/core/core.ts @@ -181,13 +181,14 @@ class HawtioCore { async bootstrap() { log.info('Bootstrapping Hawtio...') + // Load plugins + await this.loadPlugins() + // Apply branding + // Branding should be applied after loading plugins as plugins may customise hawtconfig. const brandingApplied = await configManager.applyBranding() log.info('Branding applied:', brandingApplied) - // Load plugins - await this.loadPlugins() - log.info('Bootstrapped Hawtio') }