1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Fix create service account dialog

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2023-01-04 09:15:04 -05:00
parent 40a1b2e288
commit 6a85358f81
2 changed files with 8 additions and 1 deletions

View File

@ -6,6 +6,8 @@ import { getInjectable } from "@ogre-tools/injectable";
import { action } from "mobx";
import createServiceAccountDialogStateInjectable from "./state.injectable";
export type OpenCreateServiceAccountDialog = () => void;
const openCreateServiceAccountDialogInjectable = getInjectable({
id: "open-create-service-account-dialog",
instantiate: (di) => {

View File

@ -18,6 +18,8 @@ import type { FilterByNamespace } from "../../+namespaces/namespace-select-filte
import { withInjectables } from "@ogre-tools/injectable-react";
import filterByNamespaceInjectable from "../../+namespaces/namespace-select-filter-model/filter-by-namespace.injectable";
import serviceAccountStoreInjectable from "./store.injectable";
import type { OpenCreateServiceAccountDialog } from "./create-dialog/open.injectable";
import openCreateServiceAccountDialogInjectable from "./create-dialog/open.injectable";
enum columnId {
name = "name",
@ -28,6 +30,7 @@ enum columnId {
interface Dependencies {
serviceAccountStore: ServiceAccountStore;
filterByNamespace: FilterByNamespace;
openCreateServiceAccountDialog: OpenCreateServiceAccountDialog;
}
@observer
@ -36,6 +39,7 @@ class NonInjectedServiceAccounts extends React.Component<Dependencies> {
const {
filterByNamespace,
serviceAccountStore,
openCreateServiceAccountDialog,
} = this.props;
return (
@ -73,7 +77,7 @@ class NonInjectedServiceAccounts extends React.Component<Dependencies> {
<KubeObjectAge key="age" object={account} />,
]}
addRemoveButtons={{
onAdd: () => CreateServiceAccountDialog.open(),
onAdd: () => openCreateServiceAccountDialog(),
addTooltip: "Create new Service Account",
}}
/>
@ -88,5 +92,6 @@ export const ServiceAccounts = withInjectables<Dependencies>(NonInjectedServiceA
...props,
filterByNamespace: di.inject(filterByNamespaceInjectable),
serviceAccountStore: di.inject(serviceAccountStoreInjectable),
openCreateServiceAccountDialog: di.inject(openCreateServiceAccountDialogInjectable),
}),
});