Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions public/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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;
Expand All @@ -37,6 +40,8 @@ export function ControlPlaneCard({
projectName,
}: Props) {
const [dialogDeleteMcpIsOpen, setDialogDeleteMcpIsOpen] = useState(false);
const toast = useToast();
const { t } = useTranslation();

const { trigger: patchTrigger } = useApiResourceMutation<DeleteMCPType>(
PatchMCPResourceForDeletion(
Expand Down Expand Up @@ -122,6 +127,7 @@ export function ControlPlaneCard({
onDeletionConfirmed={async () => {
await patchTrigger(PatchMCPResourceForDeletionBody);
await deleteTrigger();
toast.show(t('ControlPlaneCard.deleteConfirmationDialog'));
}}
/>
</>
Expand Down
Loading