Skip to content

Commit 245093d

Browse files
Merge branch 'main' into guoda-test
2 parents eaf0bd3 + c8a6676 commit 245093d

23 files changed

Lines changed: 41 additions & 59 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.

.changeset/tricky-moons-wear.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@cloudoperators/juno-app-greenhouse": patch
3+
---
4+
5+
Add foldGutter and foldKeymap extensions to enable collapsing/expanding YAML attributes in the viewer. Users can now click fold icons in the gutter to collapse nested structures.

.github/workflows/build-push-greenhouse-image.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ jobs:
143143
failed: ${{ steps.set-failure-output.outputs.failed }}
144144
steps:
145145
- name: Run Trivy vulnerability scanner
146-
uses: aquasecurity/trivy-action@97e0b3872f55f89b95b2f65b3dbab56962816478 # 0.34.2
146+
uses: aquasecurity/trivy-action@57a97c7e7821a5776cebc9bb87c984fa69cba8f1 # 0.35.0
147147
with:
148148
image-ref: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:latest
149149
ignore-unfixed: true
@@ -153,7 +153,7 @@ jobs:
153153

154154
- name: Trivy vulnerability scanner (table output)
155155
id: table-trivy
156-
uses: aquasecurity/trivy-action@97e0b3872f55f89b95b2f65b3dbab56962816478 # 0.34.2
156+
uses: aquasecurity/trivy-action@57a97c7e7821a5776cebc9bb87c984fa69cba8f1 # 0.35.0
157157
env:
158158
TRIVY_SKIP_DB_UPDATE: true
159159
TRIVY_SKIP_JAVA_DB_UPDATE: true

.github/workflows/build-push-supernova-image.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ jobs:
162162
failed: ${{ steps.set-failure-output.outputs.failed }}
163163
steps:
164164
- name: Run Trivy vulnerability scanner
165-
uses: aquasecurity/trivy-action@97e0b3872f55f89b95b2f65b3dbab56962816478 # 0.34.2
165+
uses: aquasecurity/trivy-action@57a97c7e7821a5776cebc9bb87c984fa69cba8f1 # 0.35.0
166166
with:
167167
image-ref: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:${{ github.sha }}
168168
ignore-unfixed: true
@@ -172,7 +172,7 @@ jobs:
172172

173173
- name: Trivy vulnerability scanner (table output)
174174
id: table-trivy
175-
uses: aquasecurity/trivy-action@97e0b3872f55f89b95b2f65b3dbab56962816478 # 0.34.2
175+
uses: aquasecurity/trivy-action@57a97c7e7821a5776cebc9bb87c984fa69cba8f1 # 0.35.0
176176
env:
177177
TRIVY_SKIP_DB_UPDATE: true
178178
TRIVY_SKIP_JAVA_DB_UPDATE: true

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/lib/store/index.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,9 @@ import createGlobalsSlice from "./createGlobalsSlice"
1313
export default (options: any) =>
1414
createStore(
1515
devtools((set, get) => ({
16-
// @ts-expect-error TS(2554) FIXME: Expected 1 arguments, but got 2.
17-
...createUserActivitySlice(set, get),
16+
...createUserActivitySlice(set),
1817
...createFiltersSlice(set, get, options),
1918
...createDataSlice(set, get),
20-
// @ts-expect-error TS(2554) FIXME: Expected 1 arguments, but got 2.
21-
...createGlobalsSlice(set, get),
19+
...createGlobalsSlice(set),
2220
}))
2321
)

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/admin/common/YamlViewer.tsx

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

66
import React, { useMemo, useRef, useEffect } from "react"
7-
import { EditorView, highlightWhitespace, lineNumbers } from "@codemirror/view"
7+
import { EditorView, highlightWhitespace, lineNumbers, keymap } from "@codemirror/view"
88
import { EditorState } from "@codemirror/state"
99
import { yaml } from "@codemirror/lang-yaml"
10+
import { foldGutter, foldKeymap } from "@codemirror/language"
1011
import { oneDark } from "@codemirror/theme-one-dark"
1112
import yamlParser from "js-yaml"
1213
import { ErrorMessage } from "../common/ErrorBoundary/ErrorMessage"
@@ -22,6 +23,8 @@ function createEditorExtensions() {
2223
oneDark,
2324
highlightWhitespace(),
2425
lineNumbers(),
26+
foldGutter(),
27+
keymap.of(foldKeymap),
2528
EditorView.editable.of(false),
2629
EditorView.lineWrapping,
2730
EditorView.theme({

apps/greenhouse/src/components/core-apps/org-admin/StoreProvider.tsx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,17 @@
66
import React, { createContext, useContext } from "react"
77

88
import { useStore as create } from "zustand"
9-
import createStore from "./lib/store"
9+
import createStoreFactory from "./lib/store"
1010

11-
// @ts-expect-error TS(2554): Expected 1 arguments, but got 0.
12-
const StoreContext = createContext()
13-
const StoreProvider = ({ options, children }: any) => (
14-
// @ts-expect-error TS(2554): Expected 0 arguments, but got 1.
15-
<StoreContext.Provider value={createStore(options)}>{children}</StoreContext.Provider>
11+
const StoreContext = createContext<ReturnType<typeof createStoreFactory> | null>(null)
12+
const StoreProvider = ({ children }: any) => (
13+
<StoreContext.Provider value={createStoreFactory()}>{children}</StoreContext.Provider>
1614
)
17-
// @ts-expect-error TS(2554): Expected 1 arguments, but got 0.
18-
const useAppStore = (selector: any) => create(useContext(StoreContext), selector)
15+
const useAppStore = (selector: any) => {
16+
const store = useContext(StoreContext)
17+
if (!store) throw new Error("useAppStore must be used within StoreProvider")
18+
return create(store, selector)
19+
}
1920

2021
export const useActivePlugin = () => useAppStore((state: any) => state.active)
2122
export const useActions = () => useAppStore((state: any) => state.actions)

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(() => {

0 commit comments

Comments
 (0)