Skip to content

Commit

Permalink
Upgrade to Hawtio 4.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tadayosi committed Apr 18, 2024
1 parent c10571d commit 9ea07d8
Show file tree
Hide file tree
Showing 14 changed files with 7,128 additions and 14,239 deletions.
13 changes: 6 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>io.hawt.examples</groupId>
<artifactId>hawtio-sample-war-plugin</artifactId>
<version>1.0.0</version>
<version>4.0.0</version>
<name>Hawtio Sample WAR Plugin</name>
<packaging>war</packaging>

Expand All @@ -16,13 +16,12 @@
<maven.compiler.target>11</maven.compiler.target>

<!-- Versions -->
<spring-boot-version>3.2.3</spring-boot-version>
<hawtio-version>4.0.0-RC1</hawtio-version>
<hawtio-version>4.0.0</hawtio-version>
<servlet-api-version>5.0.0</servlet-api-version>
<slf4j-version>2.0.12</slf4j-version>
<logback-version>1.4.14</logback-version>
<node-version>v20.9.0</node-version>
<yarn-version>v1.22.21</yarn-version>
<logback-version>1.5.6</logback-version>
<node-version>v20.12.2</node-version>
<yarn-version>v1.22.22</yarn-version>
<frontend-maven-plugin-version>1.15.0</frontend-maven-plugin-version>
<jetty-version>11.0.20</jetty-version>

Expand Down Expand Up @@ -136,7 +135,7 @@
<artifactItems>
<artifactItem>
<groupId>io.hawt</groupId>
<artifactId>hawtio-war</artifactId>
<artifactId>hawtio-war-minimal</artifactId>
<version>${hawtio-version}</version>
<type>war</type>
<outputDirectory>${project.build.directory}/deploy</outputDirectory>
Expand Down
3 changes: 0 additions & 3 deletions sample-plugin/.env

This file was deleted.

2 changes: 1 addition & 1 deletion sample-plugin/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/.pnp
.pnp.js

# yarn (zero-installs)
# yarn (non zero-installs)
.pnp.*
.yarn/*
!.yarn/patches
Expand Down
873 changes: 0 additions & 873 deletions sample-plugin/.yarn/releases/yarn-3.5.0.cjs

This file was deleted.

893 changes: 893 additions & 0 deletions sample-plugin/.yarn/releases/yarn-4.1.1.cjs

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion sample-plugin/.yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
compressionLevel: mixed

enableGlobalCache: false

nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-3.5.0.cjs
yarnPath: .yarn/releases/yarn-4.1.1.cjs
131 changes: 0 additions & 131 deletions sample-plugin/craco.config.js

This file was deleted.

38 changes: 17 additions & 21 deletions sample-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,35 @@
"license": "Apache-2.0",
"private": true,
"scripts": {
"start": "craco start",
"build": "craco build && yarn replace-version",
"test": "craco test",
"start": "webpack serve --mode development",
"build": "webpack --mode production",
"test": "jest --passWithNoTests",
"replace-version": "replace __PACKAGE_VERSION_PLACEHOLDER__ $npm_package_version ./build/static/js -r --include=\"*.js\""
},
"dependencies": {
"@hawtio/react": "^1.1.2",
"@hawtio/react": "^1.2.2",
"@patternfly/react-charts": "~6.94.21",
"@patternfly/react-core": "^4.278.1",
"@patternfly/react-table": "~4.113.7",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.22.3",
"react-scripts": "^5.0.1"
"react-router-dom": "^6.22.3"
},
"devDependencies": {
"@craco/craco": "^7.1.0",
"@hawtio/backend-middleware": "^1.0.4",
"craco-esbuild": "^0.5.2",
"os-browserify": "^0.3.0",
"path-browserify": "^1.0.1",
"replace": "^1.2.2"
"@swc/core": "^1.4.11",
"copy-webpack-plugin": "^12.0.2",
"css-loader": "^6.10.0",
"html-webpack-plugin": "^5.6.0",
"jest": "^29.7.0",
"replace": "^1.2.2",
"style-loader": "^3.3.4",
"swc-loader": "^0.2.6",
"webpack": "^5.91.0",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^5.0.4"
},
"resolutions": {
"@typescript-eslint/eslint-plugin": "6.9.0",
"@typescript-eslint/parser": "6.9.0",
"fork-ts-checker-webpack-plugin": "6.5.3",
"victory-area": "36.8.6",
"victory-bar": "36.8.6",
"victory-brush-container": "36.8.6",
Expand All @@ -48,12 +50,6 @@
"victory-voronoi-container": "36.8.6",
"victory-zoom-container": "36.8.6"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
Expand All @@ -66,5 +62,5 @@
"last 1 safari version"
]
},
"packageManager": "yarn@3.5.0"
"packageManager": "yarn@4.1.1"
}
3 changes: 2 additions & 1 deletion sample-plugin/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<base href="%PUBLIC_URL%/" />
<meta name="description" content="Hawtio Example - Sample plugin" />
<!-- Hawtio branding styles placeholder -->
<link id="branding" rel="stylesheet" type="text/css" href="" />
<title>Hawtio Sample Plugin</title>
</head>
<body>
Expand Down
1 change: 0 additions & 1 deletion sample-plugin/src/react-app-env.d.ts

This file was deleted.

9 changes: 3 additions & 6 deletions sample-plugin/src/sample-plugin/app-jmx/AppJmx.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import {
Text,
Title,
TreeView,
TreeViewProps
TreeViewProps,
} from '@patternfly/react-core'
import { CubesIcon } from '@patternfly/react-icons'
import React, { useContext } from 'react'
import { NavLink, Navigate, Route, Routes, useLocation, useNavigate } from 'react-router-dom'
import { NavLink, Navigate, Route, Routes, useLocation } from 'react-router-dom'
import Split from 'react-split'
import './AppJmx.css'
import { AppJmxContext, useAppJmx } from './context'
Expand Down Expand Up @@ -51,13 +51,10 @@ export const AppJmx: React.FunctionComponent = () => {

const AppJmxTreeView: React.FunctionComponent = () => {
const { tree, selectedNode, setSelectedNode } = useContext(AppJmxContext)
const navigate = useNavigate()

const onSelect: TreeViewProps['onSelect'] = (_, item) => {
log.debug('Selected node:', item)
setSelectedNode(item as MBeanNode)
// TODO: Workaround for the issue that otherwise the attributes are not updated immediately
navigate(pluginPath)
}

return (
Expand Down Expand Up @@ -92,7 +89,7 @@ const AppJmxContent: React.FunctionComponent = () => {
const navItems = [
{ id: 'attributes', title: 'Attributes', component: Attributes },
{ id: 'operations', title: 'Operations', component: Operations },
{ id: 'chart', title: 'Chart', component: Chart }
{ id: 'chart', title: 'Chart', component: Chart },
]

const mbeanNav = (
Expand Down
6 changes: 3 additions & 3 deletions sample-plugin/src/sample-plugin/app-jmx/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { HawtioPlugin, hawtio } from '@hawtio/react'
import { log, pluginName, pluginPath, pluginTitle } from './globals'
import { HawtioPlugin, hawtio, workspace } from '@hawtio/react'
import { AppJmx } from './AppJmx'
import { jmxDomain, log, pluginName, pluginPath, pluginTitle } from './globals'

/**
* This example demonstrates how you can create a plugin that reuses the views
Expand All @@ -15,6 +15,6 @@ export const appJmx: HawtioPlugin = () => {
title: pluginTitle,
path: pluginPath,
component: AppJmx,
isActive: async () => true,
isActive: async () => workspace.treeContainsDomainAndProperties(jmxDomain),
})
}
Loading

0 comments on commit 9ea07d8

Please sign in to comment.