From 0f504d0582b02c07d611e2171cb0173caca97f39 Mon Sep 17 00:00:00 2001 From: Dan Bryant Date: Wed, 4 Jan 2023 11:13:51 +0000 Subject: [PATCH] use ShowCheckedErrorNotification Signed-off-by: Dan Bryant --- .../+workloads-statefulsets/statefulset-menu.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/renderer/components/+workloads-statefulsets/statefulset-menu.tsx b/src/renderer/components/+workloads-statefulsets/statefulset-menu.tsx index f68fb2860c..942c9674e6 100644 --- a/src/renderer/components/+workloads-statefulsets/statefulset-menu.tsx +++ b/src/renderer/components/+workloads-statefulsets/statefulset-menu.tsx @@ -7,23 +7,26 @@ import type { KubeObjectMenuProps } from "../kube-object-menu"; import type { StatefulSet, StatefulSetApi } from "../../../common/k8s-api/endpoints"; import { MenuItem } from "../menu"; import { Icon } from "../icon"; -import { Notifications } from "../notifications"; import { withInjectables } from "@ogre-tools/injectable-react"; import statefulSetApiInjectable from "../../../common/k8s-api/endpoints/stateful-set.api.injectable"; import type { OpenConfirmDialog } from "../confirm-dialog/open.injectable"; import openConfirmDialogInjectable from "../confirm-dialog/open.injectable"; +import type { ShowCheckedErrorNotification } from "../notifications/show-checked-error.injectable"; +import showCheckedErrorNotificationInjectable from "../notifications/show-checked-error.injectable"; export interface StatefulSetMenuProps extends KubeObjectMenuProps {} interface Dependencies { statefulsetApi: StatefulSetApi; openConfirmDialog: OpenConfirmDialog; + showCheckedErrorNotification: ShowCheckedErrorNotification; } const NonInjectedStatefulSetMenu = ({ statefulsetApi, object, toolbar, + showCheckedErrorNotification, openConfirmDialog, }: Dependencies & StatefulSetMenuProps) => ( <> @@ -37,7 +40,7 @@ const NonInjectedStatefulSetMenu = ({ name: object.getName(), }); } catch (err) { - Notifications.checkedError(err, "Unknown error occured while restarting statefulset"); + showCheckedErrorNotification(err, "Unknown error occured while restarting statefulset"); } }, labelOk: "Restart", @@ -63,6 +66,7 @@ const NonInjectedStatefulSetMenu = ({ export const StatefulSetMenu = withInjectables(NonInjectedStatefulSetMenu, { getProps: (di, props) => ({ ...props, + showCheckedErrorNotification: di.inject(showCheckedErrorNotificationInjectable), statefulsetApi: di.inject(statefulSetApiInjectable), openConfirmDialog: di.inject(openConfirmDialogInjectable), }),