Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PMM-13235 Grafana 11 #1615

Merged
merged 12 commits into from
Sep 18, 2024
Merged
2 changes: 1 addition & 1 deletion pmm-app/.config/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* In order to extend the configuration follow the steps in
* https://grafana.com/developers/plugin-tools/create-a-plugin/extend-a-plugin/extend-configurations#extend-the-eslint-config
*/
{
{
"extends": ["@grafana/eslint-config"],
"root": true,
"rules": {
Expand Down
2 changes: 1 addition & 1 deletion pmm-app/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": ["@grafana/eslint-config", "plugin:react/recommended", "airbnb"],
"extends": ["./.config/.eslintrc", "plugin:react/recommended", "airbnb"],
"env": {
"jest/globals": true,
"browser": true
Expand Down
7 changes: 5 additions & 2 deletions pmm-app/config/jest-setup.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { configure } from 'enzyme';
import Adapter from '@wojtekmaj/enzyme-adapter-react-17';
// eslint-disable-next-line import/no-extraneous-dependencies
import Adapter from '@cfaester/enzyme-adapter-react-18';
import { TextEncoder, TextDecoder } from 'util';
import 'jest-canvas-mock';

configure({ adapter: new Adapter() });

// Missing in jsdom
Object.assign(global, { TextDecoder, TextEncoder });
7 changes: 6 additions & 1 deletion pmm-app/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
// force timezone to UTC to allow tests to work regardless of local timezone
// generally used by snapshots, but can affect specific tests
const baseConfig = require('./.config/jest.config');

process.env.TZ = 'GMT';

module.exports = {
// Jest configuration provided by Grafana scaffolding
...require('./.config/jest.config'),
...baseConfig,
snapshotSerializers: ['enzyme-to-json/serializer'],
verbose: true,
collectCoverage: true,
Expand All @@ -17,4 +18,8 @@ module.exports = {
'!**/*module.{ts,tsx}',
'!**/*types.ts',
],
moduleNameMapper: {
...baseConfig.moduleNameMapper,
d3: '<rootDir>/node_modules/d3/dist/d3.min.js',
},
};
53 changes: 28 additions & 25 deletions pmm-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,33 +35,34 @@
"grafana"
],
"dependencies": {
"@ant-design/compatible": "^5.1.2",
"@ant-design/compatible": "^5.1.3",
"@ant-design/cssinjs": "^1.21.0",
"@ant-design/icons": "^5.3.5",
"@emotion/css": "11.10.6",
"@grafana/data": "10.4.2",
"@grafana/runtime": "10.4.2",
"@grafana/schema": "10.4.2",
"@grafana/ui": "10.4.2",
"@grafana/data": "^11.1.5",
"@grafana/runtime": "^11.1.5",
"@grafana/schema": "^11.1.5",
"@grafana/ui": "^11.1.5",
"@tippyjs/react": "^4.2.6",
"antd": "^5.15.4",
"axios": "^0.26.0",
"antd": "^5.19.2",
"axios": "^1.7.7",
"chart.js": "^3.7.0",
"chartjs-plugin-datalabels": "^2.0.0",
"d3": "^5.16.0",
"d3": "^7.9.0",
"exponential-backoff": "^3.1.0",
"final-form": "^4.20.2",
"highlight.js": "^11.4.0",
"history": "^4.10.1",
"lodash": "^4.17.20",
"moment": "^2.29.4",
"numeral": "^2.0.6",
"react": "17.0.2",
"react": "18.2.0",
"react-chartjs-2": "^4.0.1",
"react-dom": "17.0.2",
"react-dom": "18.2.0",
"react-final-form": "^6.5.3",
"react-horizontal-stacked-bar-chart": "^8.15.2",
"react-json-view": "^1.19.1",
"react-router-dom": "^5.2.0",
"react-router-dom": "^6.22.0",
"react-split-pane": "^0.1.91",
"react-table": "^7.6.2",
"react-viewport-list": "^7.1.1",
Expand All @@ -76,28 +77,29 @@
"devDependencies": {
"@babel/core": "^7.21.4",
"@babel/preset-env": "^7.21.4",
"@grafana/eslint-config": "^6.0.0",
"@cfaester/enzyme-adapter-react-18": "^0.8.0",
"@grafana/eslint-config": "^7.0.0",
"@grafana/tsconfig": "^1.2.0-rc1",
"@swc/core": "^1.3.90",
"@swc/helpers": "^0.5.0",
"@swc/jest": "^0.2.26",
"@testing-library/jest-dom": "5.11.5",
"@testing-library/react": "11.1.2",
"@swc/jest": "^0.2.36",
"@testing-library/jest-dom": "6.4.6",
"@testing-library/react": "14.0.0",
"@testing-library/react-hooks": "^3.2.1",
"@testing-library/user-event": "^12.1.3",
"@types/d3": "^7.4.3",
"@types/enzyme": "^3.10.5",
"@types/enzyme-adapter-react-16": "^1.0.6",
"@types/grafana": "https://[email protected]/CorpGlory/types-grafana.git",
"@types/jest": "^29.5.11",
"@types/jest": "^29.5.0",
"@types/lodash": "^4.14.194",
"@types/mocha": "^8.0.3",
"@types/node": "^20.8.7",
"@types/react": "^16.9.34",
"@types/react-dom": "^16.9.9",
"@types/react-router-dom": "^5.1.5",
"@types/react-scrollbar": "^0.5.1",
"@types/testing-library__jest-dom": "5.14.8",
"@typescript-eslint/eslint-plugin": "^4.28.0",
"@wojtekmaj/enzyme-adapter-react-17": "0.3.1",
"codecov": "^3.6.5",
"copy-webpack-plugin": "^11.0.0",
"css-loader": "^6.7.3",
Expand All @@ -115,14 +117,14 @@
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-react": "^7.22.0",
"eslint-plugin-react-hooks": "^4.2.0",
"eslint-webpack-plugin": "^4.0.1",
"eslint-webpack-plugin": "^4.2.0",
"fork-ts-checker-webpack-plugin": "^8.0.0",
"glob": "^10.2.7",
"identity-obj-proxy": "3.0.0",
"influx": "^5.5.2",
"jest": "^29.5.0",
"jest-canvas-mock": "^2.5.2",
"jest-environment-jsdom": "^29.5.0",
"jest-environment-jsdom": "^29.7.0",
"less": "^4.2.0",
"less-loader": "^11.1.3",
"mockdate": "^3.0.2",
Expand All @@ -136,15 +138,16 @@
"ts-node": "^10.9.1",
"tsconfig-paths": "^4.2.0",
"typescript": "4.8.4",
"webpack": "^5.86.0",
"webpack": "^5.94.0",
"webpack-cli": "^5.1.4",
"webpack-livereload-plugin": "^3.0.2"
},
"resolutions": {
"react": "17.0.2",
"react-dom": "17.0.2",
"@types/react-dom": "17.0.2",
"wrap-ansi": "7.0.0"
"braces": "^3.0.3",
"inline-style-prefixer": "7.0.1",
"wrap-ansi": "7.0.0",
"ws": "8.18.0",
"micromatch": ""
},
"engines": {
"node": ">=18"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,9 @@ exports[`PluginTooltip Renders with right props 1`] = `
mouseLeaveDelay={0.1}
onVisibleChange={[Function]}
overlay={
<NoCompactStyle>
<ContextIsolator
space={true}
>
<React.Fragment>
test tooltip text

Expand All @@ -290,9 +292,9 @@ exports[`PluginTooltip Renders with right props 1`] = `
<br />
</div>
</React.Fragment>
</NoCompactStyle>
</ContextIsolator>
}
overlayClassName="css-dev-only-do-not-override-42nv3w"
overlayClassName="css-dev-only-do-not-override-p8b6i"
overlayInnerStyle={{}}
overlayStyle={{}}
placement="topLeft"
Expand Down Expand Up @@ -549,7 +551,7 @@ exports[`PluginTooltip Renders with right props 1`] = `
onPopupVisibleChange={[Function]}
popup={[Function]}
popupAlign={{}}
popupClassName="css-dev-only-do-not-override-42nv3w"
popupClassName="css-dev-only-do-not-override-p8b6i"
popupMotion={
{
"motionDeadline": 1000,
Expand Down Expand Up @@ -732,7 +734,7 @@ exports[`PluginTooltip Renders with right props 1`] = `
}
}
autoDestroy={false}
className="css-dev-only-do-not-override-42nv3w ant-tooltip-placement-topLeft"
className="css-dev-only-do-not-override-p8b6i ant-tooltip-placement-topLeft"
keepDom={false}
maskMotion={null}
motion={
Expand Down
Loading
Loading