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:
parent
40a1b2e288
commit
6a85358f81
@ -6,6 +6,8 @@ import { getInjectable } from "@ogre-tools/injectable";
|
|||||||
import { action } from "mobx";
|
import { action } from "mobx";
|
||||||
import createServiceAccountDialogStateInjectable from "./state.injectable";
|
import createServiceAccountDialogStateInjectable from "./state.injectable";
|
||||||
|
|
||||||
|
export type OpenCreateServiceAccountDialog = () => void;
|
||||||
|
|
||||||
const openCreateServiceAccountDialogInjectable = getInjectable({
|
const openCreateServiceAccountDialogInjectable = getInjectable({
|
||||||
id: "open-create-service-account-dialog",
|
id: "open-create-service-account-dialog",
|
||||||
instantiate: (di) => {
|
instantiate: (di) => {
|
||||||
|
|||||||
@ -18,6 +18,8 @@ import type { FilterByNamespace } from "../../+namespaces/namespace-select-filte
|
|||||||
import { withInjectables } from "@ogre-tools/injectable-react";
|
import { withInjectables } from "@ogre-tools/injectable-react";
|
||||||
import filterByNamespaceInjectable from "../../+namespaces/namespace-select-filter-model/filter-by-namespace.injectable";
|
import filterByNamespaceInjectable from "../../+namespaces/namespace-select-filter-model/filter-by-namespace.injectable";
|
||||||
import serviceAccountStoreInjectable from "./store.injectable";
|
import serviceAccountStoreInjectable from "./store.injectable";
|
||||||
|
import type { OpenCreateServiceAccountDialog } from "./create-dialog/open.injectable";
|
||||||
|
import openCreateServiceAccountDialogInjectable from "./create-dialog/open.injectable";
|
||||||
|
|
||||||
enum columnId {
|
enum columnId {
|
||||||
name = "name",
|
name = "name",
|
||||||
@ -28,6 +30,7 @@ enum columnId {
|
|||||||
interface Dependencies {
|
interface Dependencies {
|
||||||
serviceAccountStore: ServiceAccountStore;
|
serviceAccountStore: ServiceAccountStore;
|
||||||
filterByNamespace: FilterByNamespace;
|
filterByNamespace: FilterByNamespace;
|
||||||
|
openCreateServiceAccountDialog: OpenCreateServiceAccountDialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
@observer
|
@observer
|
||||||
@ -36,6 +39,7 @@ class NonInjectedServiceAccounts extends React.Component<Dependencies> {
|
|||||||
const {
|
const {
|
||||||
filterByNamespace,
|
filterByNamespace,
|
||||||
serviceAccountStore,
|
serviceAccountStore,
|
||||||
|
openCreateServiceAccountDialog,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -73,7 +77,7 @@ class NonInjectedServiceAccounts extends React.Component<Dependencies> {
|
|||||||
<KubeObjectAge key="age" object={account} />,
|
<KubeObjectAge key="age" object={account} />,
|
||||||
]}
|
]}
|
||||||
addRemoveButtons={{
|
addRemoveButtons={{
|
||||||
onAdd: () => CreateServiceAccountDialog.open(),
|
onAdd: () => openCreateServiceAccountDialog(),
|
||||||
addTooltip: "Create new Service Account",
|
addTooltip: "Create new Service Account",
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
@ -88,5 +92,6 @@ export const ServiceAccounts = withInjectables<Dependencies>(NonInjectedServiceA
|
|||||||
...props,
|
...props,
|
||||||
filterByNamespace: di.inject(filterByNamespaceInjectable),
|
filterByNamespace: di.inject(filterByNamespaceInjectable),
|
||||||
serviceAccountStore: di.inject(serviceAccountStoreInjectable),
|
serviceAccountStore: di.inject(serviceAccountStoreInjectable),
|
||||||
|
openCreateServiceAccountDialog: di.inject(openCreateServiceAccountDialogInjectable),
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user