Skip to content

Commit

Permalink
Remove router (#114)
Browse files Browse the repository at this point in the history
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  • Loading branch information
jkroepke and renovate[bot] authored Oct 28, 2024
1 parent 9346aa7 commit d86c93f
Show file tree
Hide file tree
Showing 9 changed files with 301 additions and 380 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/is-compatible.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ jobs:
run: yarn build

- name: Compatibility check
run: npx @grafana/levitate@latest is-compatible --path src/module.ts --target @grafana/data@9.3.2,@grafana/ui@9.3.2,@grafana/runtime@9.3.2
run: npx @grafana/levitate@latest is-compatible --path src/module.ts --target @grafana/data@11.1.3,@grafana/ui@11.1.3,@grafana/runtime@11.1.3
31 changes: 18 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@
"license": "Apache-2.0",
"devDependencies": {
"@babel/core": "^7.21.4",
"@grafana/eslint-config": "^7.0.0",
"@grafana/e2e-selectors": "11.3.0",
"@grafana/eslint-config": "^8.0.0",
"@grafana/plugin-e2e": "^1.10.0",
"@grafana/tsconfig": "^2.0.0",
"@grafana/plugin-meta-extractor": "^0.0.8",
"@grafana/tsconfig": "^2.0.0",
"@playwright/test": "^1.47.1",
"@swc/core": "^1.7.26",
"@swc/helpers": "^0.5.0",
Expand All @@ -50,50 +51,54 @@
"@types/jest": "^29.5.0",
"@types/lodash": "^4.14.194",
"@types/node": "^22.5.4",
"@types/testing-library__jest-dom": "5.14.9",
"@types/react-router-dom": "^5.3.3",
"copy-webpack-plugin": "^12.0.0",
"css-loader": "^7.1.2",
"eslint-plugin-deprecation": "^3.0.0",
"eslint-webpack-plugin": "^4.0.1",
"fork-ts-checker-webpack-plugin": "^9.0.0",
"glob": "^11.0.0",
"identity-obj-proxy": "3.0.0",
"imports-loader": "^5.0.0",
"jest": "^29.5.0",
"jest-environment-jsdom": "^29.5.0",
"prettier": "^3.3.3",
"raw-loader": "^4.0.2",
"replace-in-file-webpack-plugin": "^1.0.6",
"sass": "1.80.4",
"sass-loader": "16.0.2",
"semver": "^7.6.3",
"style-loader": "4.0.0",
"swc-loader": "^0.2.3",
"terser-webpack-plugin": "^5.3.10",
"ts-node": "^10.9.2",
"tsconfig-paths": "^4.2.0",
"typescript": "5.6.3",
"webpack": "^5.94.0",
"webpack-cli": "^5.1.4",
"webpack-livereload-plugin": "^3.0.2",
"imports-loader": "^5.0.0",
"webpack-virtual-modules": "^0.6.2",
"@grafana/e2e-selectors": "11.3.0",
"semver": "^7.6.3",
"terser-webpack-plugin": "^5.3.10",
"webpack-subresource-integrity": "^5.1.0"
"webpack-subresource-integrity": "^5.1.0",
"webpack-virtual-modules": "^0.6.2"
},
"engines": {
"node": ">=20"
},
"dependencies": {
"@emotion/css": "11.13.4",
"@grafana/data": "^11.2.2",
"@grafana/runtime": "^11.2.2",
"@grafana/ui": "^11.2.2",
"@grafana/experimental": "2.1.2",
"@grafana/runtime": "^11.2.2",
"@grafana/schema": "^11.2.2",
"@grafana/ui": "^11.2.2",
"@stylistic/eslint-plugin-ts": "^2.9.0",
"@typescript-eslint/eslint-plugin": "^8.12.1",
"@typescript-eslint/parser": "^8.12.1",
"eslint": "8",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-jsdoc": "^50.4.3",
"eslint-plugin-react": "^7.37.2",
"eslint-plugin-react-hooks": "^5.0.0",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-router-dom": "^5.2.0",
"rxjs": "7.8.1",
"tslib": "2.8.0"
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/App/App.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import * as React from 'react';
import { AppRootProps } from '@grafana/data';
import { PluginPropsContext } from '../../utils/utils.plugin';
import { Routes } from '../Routes';
import { Status } from "../../pages/Status";

export class App extends React.PureComponent<AppRootProps> {
render() {
return (
<PluginPropsContext.Provider value={this.props}>
<Routes />
<Status />
</PluginPropsContext.Provider>
);
}
Expand Down
12 changes: 0 additions & 12 deletions src/components/Routes/Routes.tsx

This file was deleted.

1 change: 0 additions & 1 deletion src/components/Routes/index.tsx

This file was deleted.

6 changes: 3 additions & 3 deletions src/pages/Status/Status.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { getBackendSrv, PluginPage } from "@grafana/runtime";
import { PageLayoutType } from "@grafana/data";
import { testIds } from "../../components/testIds";
import { useAsync } from "react-use";
import { Badge, HorizontalGroup, LinkButton } from "@grafana/ui";
import { Badge, Stack, LinkButton } from "@grafana/ui";
// import { prefixRoute } from "../../utils/utils.routing";
import { ROUTES, NAVIGATION } from "../../constants";

Expand Down Expand Up @@ -38,12 +38,12 @@ export const Status = () => {
return (
<PluginPage layout={PageLayoutType.Canvas}>
<div data-testid={testIds.Status.container}>
<HorizontalGroup>
<Stack>
<h3>Plugin Health Check</h3>{" "}
<span data-testid={testIds.Status.health}>
{renderHealth(health?.message)}
</span>
</HorizontalGroup>
</Stack>
<div style={{ marginBottom: "25px" }}>
Only users with Admin role can modify the configuration of the plugin
</div>
Expand Down
37 changes: 0 additions & 37 deletions src/utils/utils.routing.ts

This file was deleted.

2 changes: 2 additions & 0 deletions tests/fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ export const test = base.extend<AppTestFixture>({
const configPage = await gotoAppConfigPage({
pluginId: pluginJson.id,
});
// eslint-disable-next-line react-hooks/rules-of-hooks
await use(configPage);
},
gotoPage: async ({ gotoAppPage }, use) => {
// eslint-disable-next-line react-hooks/rules-of-hooks
await use((path) =>
gotoAppPage({
path,
Expand Down
Loading

0 comments on commit d86c93f

Please sign in to comment.