From 6c3a816e421937f21d0f6f45388ad75324865ee2 Mon Sep 17 00:00:00 2001 From: I531348 Date: Wed, 19 Aug 2026 08:12:10 +0200 Subject: [PATCH] remove legacy code Signed-off-by: I531348 --- .changeset/forty-grapes-jog.md | 5 + apps/greenhouse/package.json | 2 - .../src/components/admin/types/schema.d.ts | 317 --------------- .../core-apps/org-admin/AppContent.tsx | 8 - .../org-admin/components/SideNav.tsx | 2 - .../org-admin/components/secrets/App.test.tsx | 20 - .../org-admin/components/secrets/App.tsx | 51 --- .../components/secrets/AppContent.tsx | 30 -- .../secrets/components/AsyncWorker.tsx | 37 -- .../secrets/components/KeyValueInput.tsx | 97 ----- .../secrets/components/SecretEdit.tsx | 46 --- .../secrets/components/SecretFormBody.tsx | 86 ----- .../secrets/components/SecretFormButtons.tsx | 71 ---- .../secrets/components/SecretFormHeader.tsx | 13 - .../secrets/components/SecretList.tsx | 56 --- .../secrets/components/SecretListItem.tsx | 34 -- .../secrets/components/StoreProvider.tsx | 32 -- .../secrets/components/secretUtils.ts | 41 -- .../components/secrets/hooks/.gitkeep | 0 .../components/secrets/hooks/useApi.ts | 264 ------------- .../components/secrets/hooks/useClient.ts | 18 - .../secrets/hooks/useIsAuthorized.ts | 35 -- .../components/secrets/hooks/useSecretApi.ts | 77 ---- .../components/secrets/hooks/useUrlState.ts | 58 --- .../secrets/lib/store/createGlobalsSlice.ts | 37 -- .../components/secrets/lib/store/index.ts | 15 - .../org-admin/components/secrets/store.ts | 98 ----- .../org-admin/components/secrets/styles.css | 32 -- .../org-admin/components/teams/App.test.tsx | 19 - .../org-admin/components/teams/App.tsx | 49 --- .../org-admin/components/teams/AppContent.tsx | 46 --- .../teams/components/AsyncWorker.tsx | 13 - .../teams/components/StoreProvider.test.tsx | 58 --- .../teams/components/StoreProvider.tsx | 28 -- .../teams/components/filter/Filter.tsx | 40 -- .../teams/components/team/TeamList.test.tsx | 80 ---- .../teams/components/team/TeamList.tsx | 70 ---- .../components/team/TeamListItem.test.tsx | 24 -- .../teams/components/team/TeamListItem.tsx | 20 - .../org-admin/components/teams/db.json | 251 ------------ .../org-admin/components/teams/hooks/.gitkeep | 0 .../hooks/helper/updateTeamMemberships.ts | 74 ---- .../components/teams/hooks/useAPI.ts | 58 --- .../components/teams/hooks/useClient.ts | 16 - .../components/teams/hooks/useUrlState.ts | 52 --- .../org-admin/components/teams/lib/helpers.ts | 36 -- .../components/teams/lib/store.test.ts | 46 --- .../org-admin/components/teams/lib/store.ts | 31 -- .../org-admin/components/teams/styles.css | 8 - .../core-apps/org-admin/types/schema.d.ts | 363 ------------------ pnpm-lock.yaml | 16 - 51 files changed, 5 insertions(+), 2975 deletions(-) create mode 100644 .changeset/forty-grapes-jog.md delete mode 100644 apps/greenhouse/src/components/core-apps/org-admin/components/secrets/App.test.tsx delete mode 100644 apps/greenhouse/src/components/core-apps/org-admin/components/secrets/App.tsx delete mode 100644 apps/greenhouse/src/components/core-apps/org-admin/components/secrets/AppContent.tsx delete mode 100644 apps/greenhouse/src/components/core-apps/org-admin/components/secrets/components/AsyncWorker.tsx delete mode 100644 apps/greenhouse/src/components/core-apps/org-admin/components/secrets/components/KeyValueInput.tsx delete mode 100644 apps/greenhouse/src/components/core-apps/org-admin/components/secrets/components/SecretEdit.tsx delete mode 100644 apps/greenhouse/src/components/core-apps/org-admin/components/secrets/components/SecretFormBody.tsx delete mode 100644 apps/greenhouse/src/components/core-apps/org-admin/components/secrets/components/SecretFormButtons.tsx delete mode 100644 apps/greenhouse/src/components/core-apps/org-admin/components/secrets/components/SecretFormHeader.tsx delete mode 100644 apps/greenhouse/src/components/core-apps/org-admin/components/secrets/components/SecretList.tsx delete mode 100644 apps/greenhouse/src/components/core-apps/org-admin/components/secrets/components/SecretListItem.tsx delete mode 100644 apps/greenhouse/src/components/core-apps/org-admin/components/secrets/components/StoreProvider.tsx delete mode 100644 apps/greenhouse/src/components/core-apps/org-admin/components/secrets/components/secretUtils.ts delete mode 100644 apps/greenhouse/src/components/core-apps/org-admin/components/secrets/hooks/.gitkeep delete mode 100644 apps/greenhouse/src/components/core-apps/org-admin/components/secrets/hooks/useApi.ts delete mode 100644 apps/greenhouse/src/components/core-apps/org-admin/components/secrets/hooks/useClient.ts delete mode 100644 apps/greenhouse/src/components/core-apps/org-admin/components/secrets/hooks/useIsAuthorized.ts delete mode 100644 apps/greenhouse/src/components/core-apps/org-admin/components/secrets/hooks/useSecretApi.ts delete mode 100644 apps/greenhouse/src/components/core-apps/org-admin/components/secrets/hooks/useUrlState.ts delete mode 100644 apps/greenhouse/src/components/core-apps/org-admin/components/secrets/lib/store/createGlobalsSlice.ts delete mode 100644 apps/greenhouse/src/components/core-apps/org-admin/components/secrets/lib/store/index.ts delete mode 100644 apps/greenhouse/src/components/core-apps/org-admin/components/secrets/store.ts delete mode 100644 apps/greenhouse/src/components/core-apps/org-admin/components/secrets/styles.css delete mode 100644 apps/greenhouse/src/components/core-apps/org-admin/components/teams/App.test.tsx delete mode 100644 apps/greenhouse/src/components/core-apps/org-admin/components/teams/App.tsx delete mode 100644 apps/greenhouse/src/components/core-apps/org-admin/components/teams/AppContent.tsx delete mode 100644 apps/greenhouse/src/components/core-apps/org-admin/components/teams/components/AsyncWorker.tsx delete mode 100644 apps/greenhouse/src/components/core-apps/org-admin/components/teams/components/StoreProvider.test.tsx delete mode 100644 apps/greenhouse/src/components/core-apps/org-admin/components/teams/components/StoreProvider.tsx delete mode 100644 apps/greenhouse/src/components/core-apps/org-admin/components/teams/components/filter/Filter.tsx delete mode 100644 apps/greenhouse/src/components/core-apps/org-admin/components/teams/components/team/TeamList.test.tsx delete mode 100644 apps/greenhouse/src/components/core-apps/org-admin/components/teams/components/team/TeamList.tsx delete mode 100644 apps/greenhouse/src/components/core-apps/org-admin/components/teams/components/team/TeamListItem.test.tsx delete mode 100644 apps/greenhouse/src/components/core-apps/org-admin/components/teams/components/team/TeamListItem.tsx delete mode 100644 apps/greenhouse/src/components/core-apps/org-admin/components/teams/db.json delete mode 100644 apps/greenhouse/src/components/core-apps/org-admin/components/teams/hooks/.gitkeep delete mode 100644 apps/greenhouse/src/components/core-apps/org-admin/components/teams/hooks/helper/updateTeamMemberships.ts delete mode 100644 apps/greenhouse/src/components/core-apps/org-admin/components/teams/hooks/useAPI.ts delete mode 100644 apps/greenhouse/src/components/core-apps/org-admin/components/teams/hooks/useClient.ts delete mode 100644 apps/greenhouse/src/components/core-apps/org-admin/components/teams/hooks/useUrlState.ts delete mode 100644 apps/greenhouse/src/components/core-apps/org-admin/components/teams/lib/helpers.ts delete mode 100644 apps/greenhouse/src/components/core-apps/org-admin/components/teams/lib/store.test.ts delete mode 100644 apps/greenhouse/src/components/core-apps/org-admin/components/teams/lib/store.ts delete mode 100644 apps/greenhouse/src/components/core-apps/org-admin/components/teams/styles.css diff --git a/.changeset/forty-grapes-jog.md b/.changeset/forty-grapes-jog.md new file mode 100644 index 0000000000..20f7225854 --- /dev/null +++ b/.changeset/forty-grapes-jog.md @@ -0,0 +1,5 @@ +--- +"@cloudoperators/juno-app-greenhouse": patch +--- + +Remove legacy teams and secrets code diff --git a/apps/greenhouse/package.json b/apps/greenhouse/package.json index 991a92251b..94876c0e4f 100644 --- a/apps/greenhouse/package.json +++ b/apps/greenhouse/package.json @@ -17,7 +17,6 @@ "@testing-library/react": "16.3.2", "@testing-library/user-event": "14.6.1", "@types/js-yaml": "4.0.9", - "@types/lodash": "4.17.24", "@types/react": "19.2.17", "@types/react-dom": "19.2.3", "@vitejs/plugin-react": "6.0.4", @@ -64,7 +63,6 @@ "@tanstack/react-query": "5.100.14", "@tanstack/react-router": "1.170.18", "js-yaml": "4.3.0", - "lodash": "4.18.1", "zod": "4.4.3" } } diff --git a/apps/greenhouse/src/components/admin/types/schema.d.ts b/apps/greenhouse/src/components/admin/types/schema.d.ts index 3a634aeb43..5a677b038b 100644 --- a/apps/greenhouse/src/components/admin/types/schema.d.ts +++ b/apps/greenhouse/src/components/admin/types/schema.d.ts @@ -1247,323 +1247,6 @@ export interface components { weight?: number } } - /** - * TeamRoleBinding - * @description TeamRoleBinding is the Schema for the rolebindings API - */ - TeamRoleBinding: { - /** - * @description APIVersion defines the versioned schema of this representation of an object. - * Servers should convert recognized schemas to the latest internal value, and - * may reject unrecognized values. - * More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - */ - apiVersion?: string - /** - * @description Kind is a string value representing the REST resource this object represents. - * Servers may infer this from the endpoint the client submits requests to. - * Cannot be updated. - * In CamelCase. - * More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - */ - kind?: string - metadata?: { - name?: string - namespace?: string - /** Format: uuid */ - uid?: string - resourceVersion?: string - /** Format: date-time */ - creationTimestamp?: string - /** Format: date-time */ - deletionTimestamp?: string - labels?: { - [key: string]: string - } - annotations?: { - [key: string]: string - } - } - /** @description TeamRoleBindingSpec defines the desired state of a TeamRoleBinding */ - spec?: { - /** @description ClusterSelector is used to select a Cluster or Clusters the TeamRoleBinding should be deployed to. */ - clusterSelector?: { - /** @description Name of a single Cluster to select. */ - clusterName?: string - /** @description LabelSelector is a label query over a set of Clusters. */ - labelSelector?: { - /** @description matchExpressions is a list of label selector requirements. The requirements are ANDed. */ - matchExpressions?: { - /** @description key is the label key that the selector applies to. */ - key: string - /** - * @description operator represents a key's relationship to a set of values. - * Valid operators are In, NotIn, Exists and DoesNotExist. - */ - operator: string - /** - * @description values is an array of string values. If the operator is In or NotIn, - * the values array must be non-empty. If the operator is Exists or DoesNotExist, - * the values array must be empty. This array is replaced during a strategic - * merge patch. - */ - values?: string[] - }[] - /** - * @description matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - * map is equivalent to an element of matchExpressions, whose key field is "key", the - * operator is "In", and the values array contains only "value". The requirements are ANDed. - */ - matchLabels?: { - [key: string]: string - } - } - } - /** - * @description CreateNamespaces when enabled the controller will create namespaces for RoleBindings if they do not exist. - * @default false - */ - createNamespaces: boolean - /** - * @description Namespaces is a list of namespaces in the Greenhouse Clusters to apply the RoleBinding to. - * If empty, a ClusterRoleBinding will be created on the remote cluster, otherwise a RoleBinding per namespace. - */ - namespaces?: string[] - /** @description TeamRef references a Greenhouse Team by name */ - teamRef?: string - /** @description TeamRoleRef references a Greenhouse TeamRole by name */ - teamRoleRef?: string - /** @description Usernames defines list of users to add to the (Cluster-)RoleBindings */ - usernames?: string[] - } - /** @description TeamRoleBindingStatus defines the observed state of the TeamRoleBinding */ - status?: { - /** @description PropagationStatus is the list of clusters the TeamRoleBinding is applied to */ - clusters?: { - /** @description ClusterName is the name of the cluster the rbacv1 resources are created on. */ - clusterName: string - /** @description Condition is the overall Status of the rbacv1 resources created on the cluster */ - condition?: { - /** - * Format: date-time - * @description LastTransitionTime is the last time the condition transitioned from one status to another. - */ - lastTransitionTime: string - /** @description Message is an optional human-readable message indicating details about the last transition. */ - message?: string - /** @description Reason is a one-word, CamelCase reason for the condition's last transition. */ - reason?: string - /** @description Status of the condition. */ - status: string - /** @description Type of the condition. */ - type: string - } - }[] - /** @description StatusConditions contain the different conditions that constitute the status of the TeamRoleBinding. */ - statusConditions?: { - conditions?: { - /** - * Format: date-time - * @description LastTransitionTime is the last time the condition transitioned from one status to another. - */ - lastTransitionTime: string - /** @description Message is an optional human-readable message indicating details about the last transition. */ - message?: string - /** @description Reason is a one-word, CamelCase reason for the condition's last transition. */ - reason?: string - /** @description Status of the condition. */ - status: string - /** @description Type of the condition. */ - type: string - }[] - } - } - } - /** - * TeamRole - * @description TeamRole is the Schema for the TeamRoles API - */ - TeamRole: { - /** - * @description APIVersion defines the versioned schema of this representation of an object. - * Servers should convert recognized schemas to the latest internal value, and - * may reject unrecognized values. - * More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - */ - apiVersion?: string - /** - * @description Kind is a string value representing the REST resource this object represents. - * Servers may infer this from the endpoint the client submits requests to. - * Cannot be updated. - * In CamelCase. - * More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - */ - kind?: string - metadata?: { - name?: string - namespace?: string - /** Format: uuid */ - uid?: string - resourceVersion?: string - /** Format: date-time */ - creationTimestamp?: string - /** Format: date-time */ - deletionTimestamp?: string - labels?: { - [key: string]: string - } - annotations?: { - [key: string]: string - } - } - /** @description TeamRoleSpec defines the desired state of a TeamRole */ - spec?: { - /** @description AggregationRule describes how to locate ClusterRoles to aggregate into the ClusterRole on the remote cluster */ - aggregationRule?: { - /** - * @description ClusterRoleSelectors holds a list of selectors which will be used to find ClusterRoles and create the rules. - * If any of the selectors match, then the ClusterRole's permissions will be added - */ - clusterRoleSelectors?: { - /** @description matchExpressions is a list of label selector requirements. The requirements are ANDed. */ - matchExpressions?: { - /** @description key is the label key that the selector applies to. */ - key: string - /** - * @description operator represents a key's relationship to a set of values. - * Valid operators are In, NotIn, Exists and DoesNotExist. - */ - operator: string - /** - * @description values is an array of string values. If the operator is In or NotIn, - * the values array must be non-empty. If the operator is Exists or DoesNotExist, - * the values array must be empty. This array is replaced during a strategic - * merge patch. - */ - values?: string[] - }[] - /** - * @description matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - * map is equivalent to an element of matchExpressions, whose key field is "key", the - * operator is "In", and the values array contains only "value". The requirements are ANDed. - */ - matchLabels?: { - [key: string]: string - } - }[] - } - /** - * @description Labels are applied to the ClusterRole created on the remote cluster. - * This allows using TeamRoles as part of AggregationRules by other TeamRoles - */ - labels?: { - [key: string]: string - } - /** @description Rules is a list of rbacv1.PolicyRules used on a managed RBAC (Cluster)Role */ - rules?: { - /** - * @description APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of - * the enumerated resources in any API group will be allowed. "" represents the core API group and "*" represents all API groups. - */ - apiGroups?: string[] - /** - * @description NonResourceURLs is a set of partial urls that a user should have access to. *s are allowed, but only as the full, final step in the path - * Since non-resource URLs are not namespaced, this field is only applicable for ClusterRoles referenced from a ClusterRoleBinding. - * Rules can either apply to API resources (such as "pods" or "secrets") or non-resource URL paths (such as "/api"), but not both. - */ - nonResourceURLs?: string[] - /** @description ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed. */ - resourceNames?: string[] - /** @description Resources is a list of resources this rule applies to. '*' represents all resources. */ - resources?: string[] - /** @description Verbs is a list of Verbs that apply to ALL the ResourceKinds contained in this rule. '*' represents all verbs. */ - verbs: string[] - }[] - } - /** @description TeamRoleStatus defines the observed state of a TeamRole */ - status?: Record - } - /** - * Team - * @description Team is the Schema for the teams API - */ - Team: { - /** - * @description APIVersion defines the versioned schema of this representation of an object. - * Servers should convert recognized schemas to the latest internal value, and - * may reject unrecognized values. - * More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - */ - apiVersion?: string - /** - * @description Kind is a string value representing the REST resource this object represents. - * Servers may infer this from the endpoint the client submits requests to. - * Cannot be updated. - * In CamelCase. - * More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - */ - kind?: string - metadata?: { - name?: string - namespace?: string - /** Format: uuid */ - uid?: string - resourceVersion?: string - /** Format: date-time */ - creationTimestamp?: string - /** Format: date-time */ - deletionTimestamp?: string - labels?: { - [key: string]: string - } - annotations?: { - [key: string]: string - } - } - /** @description TeamSpec defines the desired state of Team */ - spec?: { - /** @description Description provides additional details of the team. */ - description?: string - /** @description URL to join the IdP group. */ - joinUrl?: string - /** @description IdP group id matching team. */ - mappedIdPGroup?: string - } - /** @description TeamStatus defines the observed state of Team */ - status?: { - members?: { - /** @description Email of the user. */ - email: string - /** @description FirstName of the user. */ - firstName: string - /** @description ID is the unique identifier of the user. */ - id: string - /** @description LastName of the user. */ - lastName: string - }[] - /** - * @description A StatusConditions contains a list of conditions. - * Only one condition of a given type may exist in the list. - */ - statusConditions: { - conditions?: { - /** - * Format: date-time - * @description LastTransitionTime is the last time the condition transitioned from one status to another. - */ - lastTransitionTime: string - /** @description Message is an optional human-readable message indicating details about the last transition. */ - message?: string - /** @description Reason is a one-word, CamelCase reason for the condition's last transition. */ - reason?: string - /** @description Status of the condition. */ - status: string - /** @description Type of the condition. */ - type: string - }[] - } - } - } /** * PluginsWithExposedServices * @description PluginsWithExposedServices is the Schema for plugins filtered by those that have exposed services diff --git a/apps/greenhouse/src/components/core-apps/org-admin/AppContent.tsx b/apps/greenhouse/src/components/core-apps/org-admin/AppContent.tsx index 93ebbd787e..4165718a6d 100644 --- a/apps/greenhouse/src/components/core-apps/org-admin/AppContent.tsx +++ b/apps/greenhouse/src/components/core-apps/org-admin/AppContent.tsx @@ -7,9 +7,7 @@ import React from "react" import { useActivePlugin } from "./StoreProvider" import { lazy, Suspense } from "react" const Clusters = lazy(() => import("./components/clusters/App")) -const Secrets = lazy(() => import("./components/secrets/App")) const Plugins = lazy(() => import("./components/plugins/App")) -const Teams = lazy(() => import("./components/teams/App")) // import Plugin from "./Plugin" @@ -22,15 +20,9 @@ const AppContainer = ({ apiEndpoint, auth }: any) => { case "clusters": ActivePlugin = Clusters break - case "secrets": - ActivePlugin = Secrets - break case "plugins": ActivePlugin = Plugins break - case "teams": - ActivePlugin = Teams - break default: ActivePlugin = Clusters } diff --git a/apps/greenhouse/src/components/core-apps/org-admin/components/SideNav.tsx b/apps/greenhouse/src/components/core-apps/org-admin/components/SideNav.tsx index cbc46e0afb..d3bcb5df56 100644 --- a/apps/greenhouse/src/components/core-apps/org-admin/components/SideNav.tsx +++ b/apps/greenhouse/src/components/core-apps/org-admin/components/SideNav.tsx @@ -10,9 +10,7 @@ import { useActivePlugin, useActions } from "../StoreProvider" const PLUGINS = [ { name: "clusters", label: "Clusters" }, - { name: "teams", label: "Teams" }, { name: "plugins", label: "Plugins", beta: true }, - { name: "secrets", label: "Secrets", beta: true }, ] const SideNav = () => { diff --git a/apps/greenhouse/src/components/core-apps/org-admin/components/secrets/App.test.tsx b/apps/greenhouse/src/components/core-apps/org-admin/components/secrets/App.test.tsx deleted file mode 100644 index 5e09147ad0..0000000000 --- a/apps/greenhouse/src/components/core-apps/org-admin/components/secrets/App.test.tsx +++ /dev/null @@ -1,20 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Juno contributors - * SPDX-License-Identifier: Apache-2.0 - */ - -import React from "react" - -import { act, render } from "@testing-library/react" -// support shadow dom queries -// https://reactjsexample.com/an-extension-of-dom-testing-library-to-provide-hooks-into-the-shadow-dom/ - -import { screen } from "shadow-dom-testing-library" -import App from "./App" - -test("renders app", async () => { - await act(() => render()) - - let loginTitle = await screen.queryAllByShadowText(/Converged Cloud/i) - expect(loginTitle.length > 0).toBe(true) -}) diff --git a/apps/greenhouse/src/components/core-apps/org-admin/components/secrets/App.tsx b/apps/greenhouse/src/components/core-apps/org-admin/components/secrets/App.tsx deleted file mode 100644 index c7867e814b..0000000000 --- a/apps/greenhouse/src/components/core-apps/org-admin/components/secrets/App.tsx +++ /dev/null @@ -1,51 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Juno contributors - * SPDX-License-Identifier: Apache-2.0 - */ - -import React from "react" - -import { AppShell, AppShellProvider } from "@cloudoperators/juno-ui-components" -import StoreProvider from "./components/StoreProvider" -import { MessagesProvider } from "@cloudoperators/juno-messages-provider" -import AppContent from "./AppContent" -import styles from "./styles.css?inline" -import AsyncWorker from "./components/AsyncWorker" -import useStore from "./store" - -const App = (props = {}) => { - const initializeStore = useStore((state: any) => state.initialize) - - // Create query client which it can be used from overall in - // on app initial load save Endpoint - // used from overall in the application - // @ts-expect-error TS(2339): Property 'apiEndpoint' does not exist on type '{}'... Remove this comment to see the full error message - initializeStore(props.apiEndpoint, props.token, props.namespace) - - return ( - - {/* @ts-expect-error TS(2339): Property 'embedded' does not exist on type '{}'. */} - - {/* @ts-expect-error TS(2741): Property 'consumerId' is missing in type '{}' but ... Remove this comment to see the full error message */} - - {/* @ts-expect-error TS(2322): Type '{ props: {}; }' is not assignable to type 'I... Remove this comment to see the full error message */} - - - - ) -} - -const StyledApp = (props: any) => { - return ( - // @ts-expect-error TS(2339): Property 'theme' does not exist on type 'any'. - - {/* load styles inside the shadow dom */} - - - - - - ) -} - -export default StyledApp diff --git a/apps/greenhouse/src/components/core-apps/org-admin/components/secrets/AppContent.tsx b/apps/greenhouse/src/components/core-apps/org-admin/components/secrets/AppContent.tsx deleted file mode 100644 index 00e5206599..0000000000 --- a/apps/greenhouse/src/components/core-apps/org-admin/components/secrets/AppContent.tsx +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Juno contributors - * SPDX-License-Identifier: Apache-2.0 - */ -import React from "react" - -import { Container } from "@cloudoperators/juno-ui-components" -import SecretEdit from "./components/SecretEdit" -import SecretList from "./components/SecretList" - -import { MessagesProvider } from "@cloudoperators/juno-messages-provider" - -import useStore from "./store" - -const AppContent = () => { - const showSecretEdit = useStore((state: any) => state.showSecretEdit) - - return ( - - - {showSecretEdit && ( - - - - )} - - ) -} - -export default AppContent diff --git a/apps/greenhouse/src/components/core-apps/org-admin/components/secrets/components/AsyncWorker.tsx b/apps/greenhouse/src/components/core-apps/org-admin/components/secrets/components/AsyncWorker.tsx deleted file mode 100644 index dbcd0c382a..0000000000 --- a/apps/greenhouse/src/components/core-apps/org-admin/components/secrets/components/AsyncWorker.tsx +++ /dev/null @@ -1,37 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Juno contributors - * SPDX-License-Identifier: Apache-2.0 - */ - -import { useActions } from "@cloudoperators/juno-messages-provider" -import { useEffect } from "react" -import useSecretApi from "../hooks/useSecretApi" -import useUrlState from "../hooks/useUrlState" - -interface AsyncWorkerProps { - consumerId: string -} - -const AsyncWorker: React.FC = (props: AsyncWorkerProps) => { - useUrlState(props.consumerId) - const { addMessage } = useActions() - const { watchSecretsWithoutHelm } = useSecretApi() - - useEffect(() => { - watchSecretsWithoutHelm().then((res) => { - // we bubble up the error message, if user is not authorized - if (!res.ok) { - if (res.message && res.status == 403) { - addMessage({ - variant: "error", - text: res.message, - }) - } - } - }) - }, []) - - return null -} - -export default AsyncWorker diff --git a/apps/greenhouse/src/components/core-apps/org-admin/components/secrets/components/KeyValueInput.tsx b/apps/greenhouse/src/components/core-apps/org-admin/components/secrets/components/KeyValueInput.tsx deleted file mode 100644 index 524d55ad55..0000000000 --- a/apps/greenhouse/src/components/core-apps/org-admin/components/secrets/components/KeyValueInput.tsx +++ /dev/null @@ -1,97 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Juno contributors - * SPDX-License-Identifier: Apache-2.0 - */ - -import React from "react" - -import { Button, Stack, TextInput, FormSection, Textarea } 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. - * A mutateValue function can be passed as a prop to modify the value before it is stored. - */ - -export interface KeyValueInputProps { - data?: { [key: string]: string } - setData: (data: { [key: string]: string }) => void - mutateValue?: (value: string) => string - title?: string - dataName?: string - isSecret?: boolean -} -const KeyValueInput: React.FC = (props: KeyValueInputProps) => { - const dataName = props.dataName ? props.dataName : "Data" - const isSecret = props.isSecret ? props.isSecret : false - const handleDataEntryChange = (key: any, value: string) => { - // key is in format dataKey.key or dataValue.key - let keyInfo = key.split(".") - let keyIdentifier = keyInfo[0] - let keyData = keyInfo[1] - - switch (keyIdentifier) { - case "dataKey": - // remove entry with old key and add new entry with new key - let data = { ...props.data } - let dataValue = data[keyData] - delete data[keyData] - data[value] = dataValue - props.setData(data) - break - case "dataValue": - if (props.mutateValue) { - value = props.mutateValue(value) - } - props.setData({ - ...props.data, - [keyData]: value, - }) - break - default: - console.log("keyIdentifier not found") - break - } - } - - const deleteDataEntry = (key: string) => { - let data = { ...props.data } - delete data[key] - props.setData(data) - } - - const addNewDataEntry = () => { - props.setData({ - ...props.data, - "": "", - }) - } - - return ( - - {props.data && - Object.keys(props.data).length > 0 && - Object.keys(props.data).map((dataKey) => ( - - handleDataEntryChange("dataKey." + dataKey, e.target.value)} - /> - -