Skip to content

Commit c8a6676

Browse files
authored
chore(apps): remove unused variables, imports, functions and classes (#1554)
* chore(apps): remove unused variables, imports, functions and classes * chore(apps): adds changeset
1 parent 47a432a commit c8a6676

14 files changed

Lines changed: 14 additions & 37 deletions

File tree

.changeset/polite-apples-invent.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
"@cloudoperators/juno-messages-provider": patch
3+
"@cloudoperators/juno-app-greenhouse": patch
4+
"@cloudoperators/juno-app-supernova": patch
5+
"@cloudoperators/juno-app-doop": patch
6+
---
7+
8+
Removes unused variables, imports, functions, and classes identified by static code analysis to improve code quality and maintainability.

apps/doop/src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import React, { StrictMode, useLayoutEffect } from "react"
77

8-
import { AppShellProvider, ContentHeading } from "@cloudoperators/juno-ui-components"
8+
import { AppShellProvider } from "@cloudoperators/juno-ui-components"
99
import { RouterProvider, createBrowserHistory, createHashHistory, createRouter } from "@tanstack/react-router"
1010
import { decodeV2, encodeV2, registerConsumer } from "@cloudoperators/juno-url-state-provider"
1111
import styles from "./styles.css?inline"

apps/doop/src/routes/violations.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55

66
import React, { useLayoutEffect } from "react"
7-
import { createFileRoute, retainSearchParams } from "@tanstack/react-router"
7+
import { createFileRoute } from "@tanstack/react-router"
88
import { z } from "zod"
99
import AppContent from "../components/AppContent"
1010
import { convertUrlStateToAppState, getFiltersForUrl } from "../lib/urlStateUtils"

apps/greenhouse/src/components/core-apps/org-admin/components/clusters/store.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ describe("store tests", () => {
4444
})
4545

4646
describe("Modify Cluster", () => {
47-
const version = "greenhouse.sap/v1alpha1"
48-
4947
test("check valid modification", () => {
5048
const { result } = renderHook(() => useStore())
5149
act(() => {

apps/greenhouse/src/components/core-apps/org-admin/components/plugins/plugin-edit/KeyValueInput.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import React from "react"
77

8-
import { Button, Stack, TextInput, FormSection, InputGroup, FormRow } from "@cloudoperators/juno-ui-components"
8+
import { Button, TextInput, FormSection, InputGroup, FormRow } from "@cloudoperators/juno-ui-components"
99
/*
1010
* This Element provides a form section for entering and editing key-value pairs.
1111
* The key-value data and the setData function are passed as props.

apps/greenhouse/src/components/core-apps/org-admin/components/plugins/plugin-edit/PluginEdit.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ interface PluginEditProps {
4242
}
4343
const PluginEdit: React.FC<PluginEditProps> = (props: PluginEditProps) => {
4444
const namespace = useStore((state: any) => state.namespace)
45-
const showEditForm = useStore((state: any) => state.showEditForm)
4645
const setShowEditForm = useStore((state: any) => state.setShowEditForm)
4746

4847
const editFormState = useStore((state: any) => state.editFormState)
@@ -148,10 +147,6 @@ const PluginEdit: React.FC<PluginEditProps> = (props: PluginEditProps) => {
148147

149148
const kindName = isPluginPreset ? "Plugin Preset" : "Plugin"
150149

151-
const onPanelClose = () => {
152-
setShowEditForm(false)
153-
}
154-
155150
const [submitMessage, setSubmitResultMessage] = React.useState<SubmitMessage>({ message: "", ok: false })
156151
const onSubmit = async () => {
157152
if (isPluginPreset) {

apps/greenhouse/src/components/core-apps/org-admin/components/plugins/plugin-edit/SecretKeySelect.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55

66
import React from "react"
7-
import { PluginOptionValueFrom, Secret, SecretDataEntry } from "../../../types/types"
7+
import { PluginOptionValueFrom } from "../../../types/types"
88

99
import { Stack, Select, SelectOption } from "@cloudoperators/juno-ui-components"
1010
import usePluginDefinitionsStore from "../plugindefinitions/store"

apps/greenhouse/src/components/core-apps/org-admin/components/plugins/plugin-edit/handleFormChange.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
import { Plugin, PluginOptionValue, Secret, SecretDataEntry } from "../../../types/types"
6+
import { PluginOptionValue } from "../../../types/types"
77
import { EditFormData } from "../plugindefinitions/store"
88

99
const handleFormChange = (e: React.ChangeEvent<HTMLInputElement>, editFormData: EditFormData): EditFormData => {

apps/greenhouse/src/components/core-apps/org-admin/components/plugins/plugindefinitions/components/PluginDefinitionDetail.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ import {
1212
DataGridHeadCell,
1313
DataGridRow,
1414
DataGridToolbar,
15-
Panel,
16-
PanelBody,
17-
Stack,
1815
} from "@cloudoperators/juno-ui-components"
1916
import React, { useEffect } from "react"
2017
import ReactMarkDown from "react-markdown"
@@ -34,7 +31,6 @@ interface PluginDefinitionDetailProps {
3431
}
3532

3633
const PluginDefinitionDetail: React.FC<PluginDefinitionDetailProps> = (props: PluginDefinitionDetailProps) => {
37-
const showPluginDefinitionDetails = useStore((state: any) => state.showPluginDefinitionDetails)
3834
const setShowPluginDefinitionDetails = useStore((state: any) => state.setShowPluginDefinitionDetails)
3935

4036
const setShowPluginDefinitionEdit = useStore((state: any) => state.setShowEditForm)
@@ -43,7 +39,6 @@ const PluginDefinitionDetail: React.FC<PluginDefinitionDetailProps> = (props: Pl
4339
const { getPluginsByLabelSelector: getPluginsByLabelSelector } = usePluginApi()
4440

4541
const { fetchMarkDown: fetchMarkDown } = useFetchMarkDown()
46-
const setIsEditMode = useStore((state: any) => state.setIsPluginEditMode)
4742

4843
const setEditFormData = useStore((state: any) => state.setEditFormData)
4944
const setEditFormState = useStore((state: any) => state.setEditFormState)

apps/greenhouse/src/components/core-apps/org-admin/components/secrets/hooks/useApi.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ export const useApi = (debug?: boolean) => {
1717

1818
const get = useCallback(
1919
async <T extends AllowedApiObject>(url: string, object: T, params?: any): Promise<ApiResponse> => {
20-
let response: T
21-
2220
if (!client || !namespace) {
2321
return { ok: false, message: "Client or namespace not available" }
2422
}

0 commit comments

Comments
 (0)