[ https://issues.apache.org/jira/browse/ARTEMIS-4680?focusedWorklogId=911635&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-911635 ]
ASF GitHub Bot logged work on ARTEMIS-4680: ------------------------------------------- Author: ASF GitHub Bot Created on: 26/Mar/24 16:32 Start Date: 26/Mar/24 16:32 Worklog Time Spent: 10m Work Description: gemmellr commented on code in PR #3: URL: https://github.com/apache/activemq-artemis-console-plugin/pull/3#discussion_r1539396574 ########## README.md: ########## @@ -1 +1,61 @@ -# activemq-artemis-console-plugin +# Activemq Artemis Console Plugin + + +The Activemq Artemis Console Plugin is written using [Hawtio v4](https://github.com/hawtio/hawtio). Review Comment: ActiveMQ again. Would probably add a link to the website. ########## README.md: ########## @@ -1 +1,61 @@ -# activemq-artemis-console-plugin +# Activemq Artemis Console Plugin Review Comment: ActiveMQ rather than Activemq. I'd probably go with Apache ActiveMQ. ########## README.md: ########## @@ -1 +1,61 @@ -# activemq-artemis-console-plugin +# Activemq Artemis Console Plugin + + +The Activemq Artemis Console Plugin is written using [Hawtio v4](https://github.com/hawtio/hawtio). +The plugin is written in TypeScript. Since a Hawtio plugin is based on React and [Webpack Module Federation](https://module-federation.github.io/), +this project uses Yarn v3 and [CRACO](https://craco.js.org/) as the build tools. + +The War file created by this project is consumed by ActiveMQ-Artemis but can be developled and run standalone. Review Comment: WAR rather than War. ActiveMQ Artemis rather than ActiveMQ-Artemis. ########## README.md: ########## @@ -1 +1,61 @@ -# activemq-artemis-console-plugin +# Activemq Artemis Console Plugin + + +The Activemq Artemis Console Plugin is written using [Hawtio v4](https://github.com/hawtio/hawtio). +The plugin is written in TypeScript. Since a Hawtio plugin is based on React and [Webpack Module Federation](https://module-federation.github.io/), +this project uses Yarn v3 and [CRACO](https://craco.js.org/) as the build tools. + +The War file created by this project is consumed by ActiveMQ-Artemis but can be developled and run standalone. + + +### Build + +The following command first builds the `activemq-artemis-console-plugin` frontend project and then compiles and packages +the main Java project together. + +```console +mvn clean install +``` + +Building the frontend project can take time, so if you build it once and make no changes on the project afterwards, you +can speed up the whole build by skipping the frontend part next time. + +```console +mvn install -Dskip.yarn +``` + +### Test run + +You can quickly run and test the console by using `jetty-maven-plugin` configured in `pom.xml`. It launches an embedded +Jetty server and deploy the plugin WAR application, as well as the main `hawtio.war`. + +```console +mvn jetty:run -Dskip.yarn +``` + +You can access the Artemis console with the sample plugin at: <http://localhost:8080/console/> + +## Faster plugin development + +You could run `mvn install` or `mvn jetty:run` every time to incrementally develop the `activemq-artemis-console-plugin` +frontend project while checking its behaviour in the browser. But this is not suitable for running the fast development feedback cycle. + +As shown below, a faster development cycle can be achieved by directly running the `activemq-artemis-console-plugin` +frontend project itself in development mode with `yarn start`, + +### Development +Start the plugin project in development mode: + +```console +cd artemis-plugin +yarn start +``` + +Now you should be able to preview the plugins under development at <http://localhost:3001/hawtio/>. However, since it still +hasn't been connected to a backend JVM, You can then connect to a running Artemis instance using the connect tab using for Review Comment: "You" shouldn't be capitalised. ########## README.md: ########## @@ -1 +1,61 @@ -# activemq-artemis-console-plugin +# Activemq Artemis Console Plugin + + +The Activemq Artemis Console Plugin is written using [Hawtio v4](https://github.com/hawtio/hawtio). +The plugin is written in TypeScript. Since a Hawtio plugin is based on React and [Webpack Module Federation](https://module-federation.github.io/), +this project uses Yarn v3 and [CRACO](https://craco.js.org/) as the build tools. + +The War file created by this project is consumed by ActiveMQ-Artemis but can be developled and run standalone. + + +### Build + +The following command first builds the `activemq-artemis-console-plugin` frontend project and then compiles and packages +the main Java project together. + +```console +mvn clean install +``` + +Building the frontend project can take time, so if you build it once and make no changes on the project afterwards, you +can speed up the whole build by skipping the frontend part next time. + +```console +mvn install -Dskip.yarn +``` + +### Test run + +You can quickly run and test the console by using `jetty-maven-plugin` configured in `pom.xml`. It launches an embedded +Jetty server and deploy the plugin WAR application, as well as the main `hawtio.war`. Review Comment: deploys ########## artemis-plugin/craco.config.js: ########## @@ -0,0 +1,152 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + const { ModuleFederationPlugin } = require('webpack').container +const CracoEsbuildPlugin = require('craco-esbuild') +const { hawtioBackend } = require('@hawtio/backend-middleware') +const { dependencies } = require('./package.json') + +module.exports = { + plugins: [{ plugin: CracoEsbuildPlugin }], + webpack: { + plugins: { + add: [ + new ModuleFederationPlugin({ + // The container name corresponds to 'scope' passed to HawtioPlugin + name: 'artemisPlugin', + filename: 'remoteEntry.js', + // The key in exposes corresponds to 'remote' passed to HawtioPlugin + exposes: { + './plugin': './src/artemis-plugin', + }, + shared: { + ...dependencies, + react: { + singleton: true, + requiredVersion: dependencies['react'], + }, + 'react-dom': { + singleton: true, + requiredVersion: dependencies['react-dom'], + }, + 'react-router-dom': { + singleton: true, + requiredVersion: dependencies['react-router-dom'], + }, + '@hawtio/react': { + singleton: true, + requiredVersion: dependencies['@hawtio/react'], + }, + }, + }), + ], + }, + configure: webpackConfig => { + // Required for Module Federation + webpackConfig.output.publicPath = 'auto' + + webpackConfig.module.rules.push({ + test: /\.md/, + type: 'asset/source', + }) + + // For suppressing sourcemap warnings from dependencies + webpackConfig.ignoreWarnings = [/Failed to parse source map/] + + // To resolve errors for @module-federation/utilities 2.x + // https://github.com/module-federation/universe/issues/827 + webpackConfig.resolve = { + ...webpackConfig.resolve, + fallback: { + path: require.resolve('path-browserify'), + os: require.resolve('os-browserify'), + }, + } + + // MiniCssExtractPlugin - Ignore order as otherwise conflicting order warning is raised + const miniCssExtractPlugin = webpackConfig.plugins.find(p => p.constructor.name === 'MiniCssExtractPlugin') + if (miniCssExtractPlugin) { + miniCssExtractPlugin.options.ignoreOrder = true + } + + return webpackConfig + }, + }, + // For plugin development + devServer: { + setupMiddlewares: (middlewares, devServer) => { + // Enabling branding in dev mode + devServer.app.use((req, _, next) => { + if (req.url.startsWith('/artemis-plugin')) { + req.url = req.url.replace(/\/artemis-plugin(.*)/, '/hawtio$1') + } + next() + }) + // Redirect / or /console to /console/ + devServer.app.get('/', (_, res) => res.redirect('/console/')) + devServer.app.get('/console$', (_, res) => res.redirect('/console/')) + + const username = 'developer' + const proxyEnabled = true + const plugin = [] + const hawtconfig = {} + + /**const keycloakEnabled = false + const keycloakClientConfig = { + } + const keycloakClientConfig = { + realm: 'artemis-keycloak-demo', + clientId: 'artemis-console', + url: 'http://localhost:8080/', + jaas: false, + pkceMethod: 'S256', + }*/ + + // Hawtio backend API mock + let login = true + devServer.app.get('/console/user', (_, res) => { + login ? res.send(`"${username}"`) : res.sendStatus(403) + }) + devServer.app.post('/console/auth/login', (_, res) => { + login = true + res.send(String(login)) + }) + devServer.app.get('/console/auth/logout', (_, res) => { + login = false + res.redirect('/console/login') + }) + devServer.app.get('/console/proxy/enabled', (_, res) => res.send(String(proxyEnabled))) + devServer.app.get('/console/plugin', (_, res) => res.send(JSON.stringify(plugin))) + // devServer.app.get('/console/keycloak/enabled', (_, res) => res.send(String(keycloakEnabled))) + // devServer.app.get('/console/keycloak/client-config', (_, res) => res.send(JSON.stringify(keycloakClientConfig))) + // devServer.app.get('/console/keycloak/validate-subject-matches', (_, res) => res.send('true')) Review Comment: Remove commented out code? Or explain why its there / what to do with it? ########## artemis-plugin/.yarnrc.yml: ########## @@ -0,0 +1,19 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +nodeLinker: node-modules + +yarnPath: .yarn/releases/yarn-3.5.0.cjs Review Comment: I cant comment on the file itself as its too large and so cant be viewed or commented on...so I'll comment on this hard coded path to it. Do we need to commit a specific version of yarn? Googling suggests we should be able to configure the CI to install it rather than committing it. What licence is the file under? (Related, I see no LICENCE file at all, should be at least one.) ########## artemis-plugin/src/artemis-plugin/artemis/ArtemisNetwork.tsx: ########## @@ -0,0 +1,28 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import React from 'react' +import { PageSection, TextContent, PageSectionVariants, Text, Divider, Title } from '@patternfly/react-core'; +//import { Brokers } from './brokers/Brokers' Review Comment: Remove commented out import? ########## artemis-plugin/public/index.html: ########## @@ -0,0 +1,30 @@ +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + Architecture +--> +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="utf-8" /> + <base href="%PUBLIC_URL%/" /> + <meta name="description" content="Hawtio Example - Sample plugin" /> Review Comment: Description needs updated ########## artemis-plugin/public/branding/app.css: ########## @@ -0,0 +1,207 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/* You can customise the styles of your application here. */ + + +.pf-c-login, +.pf-c-about-modal-box__hero { + background-image: url("./background.png") !important; + background-size: cover; +} + +.pf-c-login__container { + justify-content: left; +} +.pf-c-login__main { + background-color: transparent; +} + +.pf-c-login__main-body label { + color: white; +} + +.pf-c-expandable-section__toggle { + display: flex; + padding: var(--pf-c-expandable-section__toggle--PaddingTop) var(--pf-c-expandable-section__toggle--PaddingRight) var(--pf-c-expandable-section__toggle--PaddingBottom) var(--pf-c-expandable-section__toggle--PaddingLeft); + margin-top: var(--pf-c-expandable-section__toggle--MarginTop); + color: var(--artemis-global--primary-color--100); + border: none; +} + +/*Uses ActiveMQ colors in broker diagram*/ +svg text { + font-family: PatternFlyIcons-webfont; +} + +.pf-topology__node.artemisBroker.pf-m-info .pf-topology__node__background { + stroke: #801944; + fill: #c12766; +} + + +.pf-topology__node.artemisAddress.pf-m-info .pf-topology__node__background { + stroke: #2b326e; + fill: #3e489f; +} + +.pf-topology__node.artemisQueue.pf-m-info .pf-topology__node__background { + stroke: #50621d; + fill: #78932c; +} + +.pf-topology__node.artemisInternalAddress.pf-m-info .pf-topology__node__background { + stroke: #2b326e; + fill: #fff; +} + + +.pf-topology__node.artemisInternalAddress.pf-m-info .pf-topology__node__background { + stroke: #50621d; + fill: #fff; +} + +.pf-c-button.pf-m-primary { + background-color: var(--artemis-global--primary-color--100); +} + +.pf-c-button.pf-m-primary.pf-m-hover, .pf-c-button.pf-m-primary:hover { + background-color: var(--artemis-global--primary-color--100); + background-image: linear-gradient(to bottom,var(--artemis-global--primary-color--100) 0,#B24E78 100%); + background: var(--artemis-global--primary-color-dark); + border-color: var(--artemis-global--primary-color--100); +} + +.pf-c-title.pf-m-3xl { + color: white; +} + +.btn-primary { + background-color: var(--artemis-global--primary-color--100); + background-image: linear-gradient(to bottom,var(--artemis-global--primary-color--100) 0,var(--artemis-global--primary-color--100) 100%); + background-repeat: repeat-x; + border-color: var(--artemis-global--primary-color--100); + color: #fff; +} +.btn-primary.active.focus, +.btn-primary.active:focus, +.btn-primary.active:hover, .btn-primary:active.focus, +.btn-primary:active:focus, +.btn-primary:active:hover, +.open .dropdown-toggle.btn-primary.focus, +.open .dropdown-toggle.btn-primary:focus, +.open .dropdown-toggle.btn-primary:hover { + background-color: var(--artemis-global--primary-color--100); + border-color: var(--artemis-global--primary-color-dark); +} + +/*These change the row ina table when hovered over*/ +.table-hover>tbody>tr:hover { + background-color: var(--artemis-global--primary-color--100); +} + +.table-hover>tbody>tr:hover td { + background-color: var(--artemis-global--primary-color--100); +} + +select>option:hover, +select>option:active { + background: var(--artemis-global--primary-color--100); + background-color: var(--artemis-global--primary-color--100); +} + +tbody>tr:hover { + background-color: var(--artemis-global--primary-color--100); +} + +/*This controls the color of the buttons when clicked, hovered or visited*/ +.btn-primary:hover, +.btn-primary.hover +.btn-primary:active, +.btn-primary.active, +.btn-primary:focus, +.btn-primary.focus, +.btn-primary:visited, +.btn-primary.visited{ + background-color: var(--artemis-global--primary-color--100); + background-image: linear-gradient(to bottom,var(--artemis-global--primary-color--100) 0,var(--artemis-global--primary-color--100) 100%); + background: var(--artemis-global--primary-color-dark); + border-color: var(--artemis-global--primary-color--100); +} + +/*This changes the color of the hover item in the JMX Tree*/ +.treeview-pf-hover .list-group-item:hover { + background-color: var(--artemis-global--primary-color--100)!important; + border-color: var(--artemis-global--primary-color--100)!important; +} + +/*This changes the color of the chosen selection in the JMX Tree*/ +.treeview-pf-select .list-group-item.node-selected { + background: var(--artemis-global--primary-color--100)!important; + border-color: var(--artemis-global--primary-color--100)!important; + color: #fff!important; +} + +/* This changes the color of the underline in the main left menuLeft hand menu tab underline*/ Review Comment: sentence fragment at the end seems out of place ########## pom.xml: ########## @@ -0,0 +1,253 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <groupId>org.apache.activemq</groupId> + <artifactId>artemis-console-plugin</artifactId> + <packaging>war</packaging> + <version>1.0.0-SNAPSHOT</version> + + <parent> + <groupId>org.apache</groupId> + <artifactId>apache</artifactId> + <version>23</version> + <relativePath>org.apache:apache</relativePath> + </parent> + + <name>ActiveMQ Artemis Console Plugin</name> + <url /> Review Comment: In addition to the empty URL, it seems to be missing scm, issueManagement, mailingLists etc details that should be there for an independently released component. Not sure it will fail the Central deployment checks, but it will certainly inherit all the wrong details from the parent. ########## artemis-plugin/public/branding/app.css: ########## @@ -0,0 +1,207 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/* You can customise the styles of your application here. */ + + +.pf-c-login, +.pf-c-about-modal-box__hero { + background-image: url("./background.png") !important; + background-size: cover; +} + +.pf-c-login__container { + justify-content: left; +} +.pf-c-login__main { + background-color: transparent; +} + +.pf-c-login__main-body label { + color: white; +} + +.pf-c-expandable-section__toggle { + display: flex; + padding: var(--pf-c-expandable-section__toggle--PaddingTop) var(--pf-c-expandable-section__toggle--PaddingRight) var(--pf-c-expandable-section__toggle--PaddingBottom) var(--pf-c-expandable-section__toggle--PaddingLeft); + margin-top: var(--pf-c-expandable-section__toggle--MarginTop); + color: var(--artemis-global--primary-color--100); + border: none; +} + +/*Uses ActiveMQ colors in broker diagram*/ +svg text { + font-family: PatternFlyIcons-webfont; +} + +.pf-topology__node.artemisBroker.pf-m-info .pf-topology__node__background { + stroke: #801944; + fill: #c12766; +} + + +.pf-topology__node.artemisAddress.pf-m-info .pf-topology__node__background { + stroke: #2b326e; + fill: #3e489f; +} + +.pf-topology__node.artemisQueue.pf-m-info .pf-topology__node__background { + stroke: #50621d; + fill: #78932c; +} + +.pf-topology__node.artemisInternalAddress.pf-m-info .pf-topology__node__background { + stroke: #2b326e; + fill: #fff; +} + + +.pf-topology__node.artemisInternalAddress.pf-m-info .pf-topology__node__background { + stroke: #50621d; + fill: #fff; +} + +.pf-c-button.pf-m-primary { + background-color: var(--artemis-global--primary-color--100); +} + +.pf-c-button.pf-m-primary.pf-m-hover, .pf-c-button.pf-m-primary:hover { + background-color: var(--artemis-global--primary-color--100); + background-image: linear-gradient(to bottom,var(--artemis-global--primary-color--100) 0,#B24E78 100%); + background: var(--artemis-global--primary-color-dark); + border-color: var(--artemis-global--primary-color--100); +} + +.pf-c-title.pf-m-3xl { + color: white; +} + +.btn-primary { + background-color: var(--artemis-global--primary-color--100); + background-image: linear-gradient(to bottom,var(--artemis-global--primary-color--100) 0,var(--artemis-global--primary-color--100) 100%); + background-repeat: repeat-x; + border-color: var(--artemis-global--primary-color--100); + color: #fff; +} +.btn-primary.active.focus, +.btn-primary.active:focus, +.btn-primary.active:hover, .btn-primary:active.focus, +.btn-primary:active:focus, +.btn-primary:active:hover, +.open .dropdown-toggle.btn-primary.focus, +.open .dropdown-toggle.btn-primary:focus, +.open .dropdown-toggle.btn-primary:hover { + background-color: var(--artemis-global--primary-color--100); + border-color: var(--artemis-global--primary-color-dark); +} + +/*These change the row ina table when hovered over*/ Review Comment: in a ########## artemis-plugin/craco.config.js: ########## @@ -0,0 +1,152 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + const { ModuleFederationPlugin } = require('webpack').container +const CracoEsbuildPlugin = require('craco-esbuild') +const { hawtioBackend } = require('@hawtio/backend-middleware') +const { dependencies } = require('./package.json') + +module.exports = { + plugins: [{ plugin: CracoEsbuildPlugin }], + webpack: { + plugins: { + add: [ + new ModuleFederationPlugin({ + // The container name corresponds to 'scope' passed to HawtioPlugin + name: 'artemisPlugin', + filename: 'remoteEntry.js', + // The key in exposes corresponds to 'remote' passed to HawtioPlugin + exposes: { + './plugin': './src/artemis-plugin', + }, + shared: { + ...dependencies, + react: { + singleton: true, + requiredVersion: dependencies['react'], + }, + 'react-dom': { + singleton: true, + requiredVersion: dependencies['react-dom'], + }, + 'react-router-dom': { + singleton: true, + requiredVersion: dependencies['react-router-dom'], + }, + '@hawtio/react': { + singleton: true, + requiredVersion: dependencies['@hawtio/react'], + }, + }, + }), + ], + }, + configure: webpackConfig => { + // Required for Module Federation + webpackConfig.output.publicPath = 'auto' + + webpackConfig.module.rules.push({ + test: /\.md/, + type: 'asset/source', + }) + + // For suppressing sourcemap warnings from dependencies + webpackConfig.ignoreWarnings = [/Failed to parse source map/] + + // To resolve errors for @module-federation/utilities 2.x + // https://github.com/module-federation/universe/issues/827 + webpackConfig.resolve = { + ...webpackConfig.resolve, + fallback: { + path: require.resolve('path-browserify'), + os: require.resolve('os-browserify'), + }, + } + + // MiniCssExtractPlugin - Ignore order as otherwise conflicting order warning is raised + const miniCssExtractPlugin = webpackConfig.plugins.find(p => p.constructor.name === 'MiniCssExtractPlugin') + if (miniCssExtractPlugin) { + miniCssExtractPlugin.options.ignoreOrder = true + } + + return webpackConfig + }, + }, + // For plugin development + devServer: { + setupMiddlewares: (middlewares, devServer) => { + // Enabling branding in dev mode + devServer.app.use((req, _, next) => { + if (req.url.startsWith('/artemis-plugin')) { + req.url = req.url.replace(/\/artemis-plugin(.*)/, '/hawtio$1') + } + next() + }) + // Redirect / or /console to /console/ + devServer.app.get('/', (_, res) => res.redirect('/console/')) + devServer.app.get('/console$', (_, res) => res.redirect('/console/')) + + const username = 'developer' + const proxyEnabled = true + const plugin = [] + const hawtconfig = {} + + /**const keycloakEnabled = false + const keycloakClientConfig = { + } + const keycloakClientConfig = { + realm: 'artemis-keycloak-demo', + clientId: 'artemis-console', + url: 'http://localhost:8080/', + jaas: false, + pkceMethod: 'S256', + }*/ Review Comment: Remove commented out code? Or explain why its there / what to do with it? ########## pom.xml: ########## @@ -0,0 +1,253 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <groupId>org.apache.activemq</groupId> + <artifactId>artemis-console-plugin</artifactId> + <packaging>war</packaging> Review Comment: Related to other comments, might having a root 'project' pom be warranted? Its likely going to want release plugin config, and at least a source-assembly configuration to ensure the appropriate contents are present for a source release, and not any of the installed javascript build stuff. In other components we tend to have a specific module for the latter. Thats also where e.g binary-assembly specific LICENCE/NOTICE files go, if different than the source assembly ones (tends to be the case). ########## pom.xml: ########## @@ -0,0 +1,253 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <groupId>org.apache.activemq</groupId> + <artifactId>artemis-console-plugin</artifactId> + <packaging>war</packaging> + <version>1.0.0-SNAPSHOT</version> + + <parent> + <groupId>org.apache</groupId> + <artifactId>apache</artifactId> + <version>23</version> Review Comment: This is ancient and should be updated. Artemis is on 31 currently, ideally this would match so the same plugins and related deps etc are being used for the two builds. ########## artemis-plugin/src/artemis-plugin/artemis/context.ts: ########## @@ -0,0 +1,126 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { eventService, EVENT_REFRESH,MBeanNode, MBeanTree, PluginNodeSelectionContext, workspace } from "@hawtio/react"; +import { TreeViewDataItem } from "@patternfly/react-core"; +import { createContext, useContext, useEffect, useState } from "react"; +import { useNavigate } from 'react-router-dom' +import { artemisPluginName, jmxDomain } from "./globals"; + +/** + * Custom React hook for using Camel MBean tree. + */ Review Comment: Description seems off ########## pom.xml: ########## @@ -0,0 +1,253 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <groupId>org.apache.activemq</groupId> + <artifactId>artemis-console-plugin</artifactId> + <packaging>war</packaging> + <version>1.0.0-SNAPSHOT</version> + + <parent> + <groupId>org.apache</groupId> + <artifactId>apache</artifactId> + <version>23</version> + <relativePath>org.apache:apache</relativePath> + </parent> + + <name>ActiveMQ Artemis Console Plugin</name> + <url /> + + <properties> + <maven.compiler.source>11</maven.compiler.source> + <maven.compiler.target>11</maven.compiler.target> Review Comment: Should add _maven.compiler.release_ too if nothing here is using non-public APIs that prevent it. ########## pom.xml: ########## @@ -0,0 +1,253 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <groupId>org.apache.activemq</groupId> + <artifactId>artemis-console-plugin</artifactId> + <packaging>war</packaging> + <version>1.0.0-SNAPSHOT</version> + + <parent> + <groupId>org.apache</groupId> + <artifactId>apache</artifactId> + <version>23</version> + <relativePath>org.apache:apache</relativePath> + </parent> + + <name>ActiveMQ Artemis Console Plugin</name> + <url /> + + <properties> + <maven.compiler.source>11</maven.compiler.source> + <maven.compiler.target>11</maven.compiler.target> + <! Issue Time Tracking ------------------- Worklog Id: (was: 911635) Time Spent: 20m (was: 10m) > Upgrade the console to use HawtIO 4 > ----------------------------------- > > Key: ARTEMIS-4680 > URL: https://issues.apache.org/jira/browse/ARTEMIS-4680 > Project: ActiveMQ Artemis > Issue Type: Improvement > Components: Web Console > Reporter: Andy Taylor > Assignee: Andy Taylor > Priority: Major > Time Spent: 20m > Remaining Estimate: 0h > > The current console is based upon HawtIO 1 which in turn is built on > Bootstrap. Bootstrap is old and no longer actively being maintained. > > This improvement is to migrate the current console to use HawtIO 4 which i > based on Typescript, react and Patternfly. > > A WIP can be found > [here|https://github.com/andytaylor/activemq-artemis/tree/artemis-console-ng] -- This message was sent by Atlassian Jira (v8.20.10#820010)