Skip to content

Commit d3e739f

Browse files
authored
Rework Frontend (#49)
This commit reworks the structure of the frontend for the plugin. It contains the following changes: - Change folder structure to not use uppercase folder names for components - Split files into smaller files, seperated by components - Use `useAsync` hook for data fetching in components - Move AI action to the details menu of resources, instead of having a separate action button, to not run the enabled check for all rows in a table
1 parent 05a143b commit d3e739f

File tree

119 files changed

+3995
-4552
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+3995
-4552
lines changed

package-lock.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@
9898
"react": "18.2.0",
9999
"react-dom": "18.2.0",
100100
"react-router-dom": "^6.22.0",
101+
"react-use": "^17.6.0",
101102
"rxjs": "7.8.2",
102103
"yaml": "^2.8.1"
103104
},
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ import { AppRootProps } from '@grafana/data';
33
import { SceneApp, useSceneApp } from '@grafana/scenes';
44
import { initPluginTranslations } from '@grafana/i18n';
55

6-
import { PluginPropsContext } from '../../utils/utils.plugin';
7-
import { homePage } from '../../pages/Home/homePage';
8-
import { kubeconfigPage } from '../../pages/Kubeconfig/kubeconfigPage';
9-
import { resourcesPage } from '../../pages/Resources/resourcesPage';
10-
import { helmPage } from '../../pages/Helm/helmPage';
11-
import { fluxPage } from '../../pages/Flux/fluxPage';
6+
import { PluginPropsContext } from '../utils/utils.plugin';
7+
import { HomePage } from '../pages/home/HomePage';
8+
import { KubeconfigPage } from '../pages/kubeconfig/KubeconfigPage';
9+
import { ResourcesPage } from '../pages/resources/ResourcesPage';
10+
import { HelmPage } from '../pages/helm/HelmPage';
11+
import { FluxPage } from '../pages/flux/FluxPage';
1212

1313
/**
1414
* NOTE: Without this the plugin is not loaded and throws the following error:
@@ -20,7 +20,7 @@ initPluginTranslations('ricoberger-kubernetes-app');
2020

2121
function getSceneApp() {
2222
return new SceneApp({
23-
pages: [homePage, resourcesPage, helmPage, fluxPage, kubeconfigPage],
23+
pages: [HomePage, ResourcesPage, HelmPage, FluxPage, KubeconfigPage],
2424
urlSyncOptions: {
2525
updateUrlOnInit: true,
2626
createBrowserHistorySteps: true,

src/components/Kubeconfig/Datasources.tsx

Lines changed: 0 additions & 80 deletions
This file was deleted.

src/components/Kubeconfig/Kubeconfig.tsx

Lines changed: 0 additions & 103 deletions
This file was deleted.

src/components/Kubeconfig/types.ts

Lines changed: 0 additions & 69 deletions
This file was deleted.

0 commit comments

Comments
 (0)