Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/polite-apples-invent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@cloudoperators/juno-messages-provider": patch
"@cloudoperators/juno-app-greenhouse": patch
"@cloudoperators/juno-app-supernova": patch
"@cloudoperators/juno-app-doop": patch
---

Removes unused variables, imports, functions, and classes identified by static code analysis to improve code quality and maintainability.
2 changes: 1 addition & 1 deletion apps/doop/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

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

import { AppShellProvider, ContentHeading } from "@cloudoperators/juno-ui-components"
import { AppShellProvider } from "@cloudoperators/juno-ui-components"
import { RouterProvider, createBrowserHistory, createHashHistory, createRouter } from "@tanstack/react-router"
import { decodeV2, encodeV2, registerConsumer } from "@cloudoperators/juno-url-state-provider"
import styles from "./styles.css?inline"
Expand Down
2 changes: 1 addition & 1 deletion apps/doop/src/routes/violations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

import React, { useLayoutEffect } from "react"
import { createFileRoute, retainSearchParams } from "@tanstack/react-router"
import { createFileRoute } from "@tanstack/react-router"
import { z } from "zod"
import AppContent from "../components/AppContent"
import { convertUrlStateToAppState, getFiltersForUrl } from "../lib/urlStateUtils"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ describe("store tests", () => {
})

describe("Modify Cluster", () => {
const version = "greenhouse.sap/v1alpha1"

test("check valid modification", () => {
const { result } = renderHook(() => useStore())
act(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import React from "react"

import { Button, Stack, TextInput, FormSection, InputGroup, FormRow } from "@cloudoperators/juno-ui-components"
import { Button, TextInput, FormSection, InputGroup, FormRow } from "@cloudoperators/juno-ui-components"
/*
* This Element provides a form section for entering and editing key-value pairs.
* The key-value data and the setData function are passed as props.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ interface PluginEditProps {
}
const PluginEdit: React.FC<PluginEditProps> = (props: PluginEditProps) => {
const namespace = useStore((state: any) => state.namespace)
const showEditForm = useStore((state: any) => state.showEditForm)
const setShowEditForm = useStore((state: any) => state.setShowEditForm)

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

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

const onPanelClose = () => {
setShowEditForm(false)
}

const [submitMessage, setSubmitResultMessage] = React.useState<SubmitMessage>({ message: "", ok: false })
const onSubmit = async () => {
if (isPluginPreset) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

import React from "react"
import { PluginOptionValueFrom, Secret, SecretDataEntry } from "../../../types/types"
import { PluginOptionValueFrom } from "../../../types/types"

import { Stack, Select, SelectOption } from "@cloudoperators/juno-ui-components"
import usePluginDefinitionsStore from "../plugindefinitions/store"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { Plugin, PluginOptionValue, Secret, SecretDataEntry } from "../../../types/types"
import { PluginOptionValue } from "../../../types/types"
import { EditFormData } from "../plugindefinitions/store"

const handleFormChange = (e: React.ChangeEvent<HTMLInputElement>, editFormData: EditFormData): EditFormData => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ import {
DataGridHeadCell,
DataGridRow,
DataGridToolbar,
Panel,
PanelBody,
Stack,
} from "@cloudoperators/juno-ui-components"
import React, { useEffect } from "react"
import ReactMarkDown from "react-markdown"
Expand All @@ -34,7 +31,6 @@ interface PluginDefinitionDetailProps {
}

const PluginDefinitionDetail: React.FC<PluginDefinitionDetailProps> = (props: PluginDefinitionDetailProps) => {
const showPluginDefinitionDetails = useStore((state: any) => state.showPluginDefinitionDetails)
const setShowPluginDefinitionDetails = useStore((state: any) => state.setShowPluginDefinitionDetails)

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

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

const setEditFormData = useStore((state: any) => state.setEditFormData)
const setEditFormState = useStore((state: any) => state.setEditFormState)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ export const useApi = (debug?: boolean) => {

const get = useCallback(
async <T extends AllowedApiObject>(url: string, object: T, params?: any): Promise<ApiResponse> => {
let response: T

if (!client || !namespace) {
return { ok: false, message: "Client or namespace not available" }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,19 +95,4 @@ const useStore = create<State>((set: any) => ({
})),
}))

const updateSecrets = (existingSecrets: Secret[], newSecrets: Secret[]): Secret[] => {
let returnSecrets = existingSecrets
newSecrets.forEach((inputSecret) => {
const index = existingSecrets.findIndex((knownSecret: any) => {
return knownSecret.metadata!.name === inputSecret.metadata!.name
})
if (index >= 0) {
returnSecrets[index] = inputSecret
} else {
returnSecrets.push(inputSecret)
}
})
return returnSecrets
}

export default useStore
1 change: 0 additions & 1 deletion apps/supernova/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import styles from "./styles.css?inline"
import { StoreProvider } from "./components/StoreProvider"
import { routeTree } from "./routeTree.gen"
import { convertAppStateToUrlState, extractSearchStringFromHashFragment, readLegacyUrlState } from "./lib/urlStateUtils"
import { isObjectWithKeys } from "./lib/utils"

// Create a new router instance
const router = createRouter({
Expand Down
1 change: 0 additions & 1 deletion apps/supernova/src/components/StoreProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import React, { createContext, useContext } from "react"
import { createStore, useStore, StoreApi } from "zustand"
import { devtools } from "zustand/middleware"

import createSilencesSlice, { SilencesSlice } from "../lib/createSilencesSlice"
import createAlertsSlice, { AlertsSlice } from "../lib/createAlertsSlice"
Expand Down
2 changes: 1 addition & 1 deletion packages/messages-provider/src/useMessageStore.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

import * as React from "react"
import { renderHook, act, waitFor } from "@testing-library/react"
import { renderHook, act } from "@testing-library/react"
import { useMessages, useActions, MessagesProvider } from "./index"

const originalConsoleError = global.console.error
Expand Down
Loading