From 4b4942915d5f60dd209f6dc81508e83c32d629df Mon Sep 17 00:00:00 2001 From: I741485 Date: Thu, 24 Apr 2025 16:10:56 +0100 Subject: [PATCH 1/2] Delete MCP toast trigger --- public/locales/en.json | 3 +++ .../ControlPlanes/ControlPlaneCard/ControlPlaneCard.tsx | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/public/locales/en.json b/public/locales/en.json index e5d5bf23..b0895130 100644 --- a/public/locales/en.json +++ b/public/locales/en.json @@ -47,6 +47,9 @@ "permissionErrorMessageSubtitle": "Ask a workspace admin to grant you access.", "loadingErrorMessage": "Failed to list mcps in workspace" }, + "ControlPlaneCard": { + "deleteConfirmationDialog": "MCP deletion triggered. The list will refresh automatically once completed." + }, "ControlPlaneListAllWorkspaces": { "emptyListTitleMessage": "No Workspaces created yet", "emptyListSubtitleMessage": "Create a workspace to get started" diff --git a/src/components/ControlPlanes/ControlPlaneCard/ControlPlaneCard.tsx b/src/components/ControlPlanes/ControlPlaneCard/ControlPlaneCard.tsx index a2308b83..025901ea 100644 --- a/src/components/ControlPlanes/ControlPlaneCard/ControlPlaneCard.tsx +++ b/src/components/ControlPlanes/ControlPlaneCard/ControlPlaneCard.tsx @@ -22,6 +22,8 @@ import { DeleteConfirmationDialog } from '../../Dialogs/DeleteConfirmationDialog import MCPHealthPopoverButton from '../../ControlPlane/MCPHealthPopoverButton.tsx'; import styles from './ControlPlaneCard.module.css'; import { KubectlDeleteMcp } from '../../Dialogs/KubectlCommandInfo/Controllers/KubectlDeleteMcp.tsx'; +import { useToast } from '../../../context/ToastContext.tsx'; +import { useTranslation } from 'react-i18next'; interface Props { controlPlane: ListControlPlanesType; @@ -35,6 +37,8 @@ export function ControlPlaneCard({ projectName, }: Props) { const [dialogDeleteMcpIsOpen, setDialogDeleteMcpIsOpen] = useState(false); + const toast = useToast(); + const { t } = useTranslation(); const { trigger: patchTrigger } = useApiResourceMutation( PatchMCPResourceForDeletion( @@ -109,6 +113,7 @@ export function ControlPlaneCard({ onDeletionConfirmed={async () => { await patchTrigger(PatchMCPResourceForDeletionBody); await deleteTrigger(); + toast.show(t('ControlPlaneCard.deleteConfirmationDialog')); }} /> From 5dce47b281e4ea5fb42e9f46406f058e87297849 Mon Sep 17 00:00:00 2001 From: fabianwolski Date: Fri, 2 May 2025 12:43:55 +0100 Subject: [PATCH 2/2] build fix --- .../ControlPlanes/ControlPlaneCard/ControlPlaneCard.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/ControlPlanes/ControlPlaneCard/ControlPlaneCard.tsx b/src/components/ControlPlanes/ControlPlaneCard/ControlPlaneCard.tsx index 453176d6..443bdb54 100644 --- a/src/components/ControlPlanes/ControlPlaneCard/ControlPlaneCard.tsx +++ b/src/components/ControlPlanes/ControlPlaneCard/ControlPlaneCard.tsx @@ -6,6 +6,7 @@ import ConnectButton from '../ConnectButton.tsx'; import TitleLevel from '@ui5/webcomponents/dist/types/TitleLevel.js'; import { useState } from 'react'; +import { useTranslation } from 'react-i18next'; import { DeleteConfirmationDialog } from '../../Dialogs/DeleteConfirmationDialog.tsx'; import MCPHealthPopoverButton from '../../ControlPlane/MCPHealthPopoverButton.tsx'; @@ -23,7 +24,9 @@ import { PatchMCPResourceForDeletion, PatchMCPResourceForDeletionBody, } from '../../../lib/api/types/crate/deleteMCP.ts'; + import { YamlViewButton } from '../../Yaml/YamlViewButton.tsx'; +import { useToast } from '../../../context/ToastContext.tsx'; interface Props { controlPlane: ListControlPlanesType;