diff --git a/cypress/support/component.tsx b/cypress/support/component.tsx
index 78400390..7f7328b0 100644
--- a/cypress/support/component.tsx
+++ b/cypress/support/component.tsx
@@ -22,7 +22,7 @@ import { mount } from 'cypress/react';
import './commands';
import { FrontendConfigContext } from '../../src/context/FrontendConfigContext';
import { mockedFrontendConfig } from '../../src/utils/testing';
-
+import { ToastProvider } from '../../src/context/ToastContext.tsx';
// Augment the Cypress namespace to include type definitions for
// your custom command.
// Alternatively, can be defined in cypress/support/component.d.ts
@@ -36,12 +36,15 @@ declare global {
}
}
-
Cypress.Commands.add('mount', (component, options) => {
- return mount(
-
- {component}
-
- , options);
+ return mount(
+
+
+
+ {component}
+
+
+ ,
+ options,
+ );
});
-
diff --git a/public/locales/en.json b/public/locales/en.json
index 597090b5..a9f23741 100644
--- a/public/locales/en.json
+++ b/public/locales/en.json
@@ -56,9 +56,9 @@
"messageHeader": "Message",
"reasonHeader": "Reason",
"transitionHeader": "Last transition time"
- },
+ },
"CopyKubeconfigButton": {
- "copiedMessage": "Copied to Clipboard",
+ "copiedMessage": "Copied to Clipboard",
"failedMessage": "Failed to copy, Error:",
"menuDownload": "Download",
"menuCopy": "Copy to clipboard"
@@ -113,7 +113,6 @@
"errorMessage": "useCopyButton must be used within a CopyButtonProvider"
},
"CreateProjectWorkspaceDialog": {
- "learnButton": "Learn how to do this in code",
"createButton": "Create",
"cancelButton": "Cancel",
"chargingTargetLabel": "Charging Target",
@@ -146,6 +145,79 @@
"copiedMessage": "Copied To Clipboard",
"failedMessage": "Failed to copy"
},
+ "DeleteWorkspaceDialog": {
+ "title": "Delete a Workspace",
+ "introSection1": "The below instructions will help you delete the workspace \"{{workspaceName}}\" from project namespace \"{{projectNamespace}}\" using kubectl.",
+ "introSection2": "Remember that this action is irreversible and all resources within the workspace will be permanently deleted.",
+ "mainCommandDescription": "Run this command to delete the workspace:",
+ "verificationCommandDescription": "To verify the workspace has been deleted, run:"
+ },
+ "KubectlDeleteMcpDialog": {
+ "title": "Delete a Managed Control Plane",
+ "introSection1": "The below will help you delete the Managed Control Plane \"{{mcpName}}\" from workspace \"{{workspaceNamespace}}\" using kubectl.",
+ "introSection2": "Remember that this action is irreversible and all resources managed by this control plane will be permanently deleted.",
+ "annotateCommand": "First, annotate the ManagedControlPlane to confirm deletion:",
+ "deleteCommand": "Run this command to delete the Managed Control Plane:",
+ "verificationCommandDescription": "To verify the MCP has been deleted, run:"
+ },
+ "KubectlCreateProjectDialog": {
+ "title": "Create a Project",
+ "introSection": "A Project is the starting point to our ManagedControlPlane offering. Projects are usually created for each Organization/Team or similar root setups.",
+ "formFields": {
+ "projectName": {
+ "label": "Project Name",
+ "placeholder": "Enter project name"
+ },
+ "chargingTargetId": {
+ "label": "BTP Global Account ID",
+ "placeholder": "Enter your Global Account ID",
+ "defaultValue": ""
+ },
+ "userEmail": {
+ "label": "User Email",
+ "placeholder": "Enter your email address",
+ "defaultValue": ""
+ }
+ },
+ "mainCommandDescription": "Run this command to create a new project:",
+ "resultCommandDescription": "To see the result of the project creation, run the below command:",
+ "namespaceCommandDescription": "A namespace is automatically generated for your project:"
+ },
+ "KubectlCreateWorkspaceDialog": {
+ "title": "Create a Workspace",
+ "introSection": "Let's add a Workspace to our Project. We use workspaces to separate productive and non-productive ManagedControlPlanes.",
+ "formFields": {
+ "workspaceName": {
+ "label": "Workspace Name",
+ "placeholder": "Enter workspace name"
+ },
+ "chargingTargetId": {
+ "label": "BTP Global Account ID",
+ "placeholder": "Enter your Global Account ID",
+ "defaultValue": ""
+ },
+ "userEmail": {
+ "label": "User Email",
+ "placeholder": "Enter your email address",
+ "defaultValue": ""
+ }
+ },
+ "mainCommandDescription": "Run this command to create a new workspace in your project:",
+ "resultCommandDescription": "To see the result of the workspace creation, run the below command:"
+ },
+ "KubectlBaseDialog": {
+ "prerequisites": "Prerequisites",
+ "prerequisitesText": "Make sure you have installed kubectl and the kubelogin plugin. We recommend using krew which is a plugin manager for kubectl.",
+ "formFieldsNote": "Important: Before executing, modify the commands below:",
+ "onboardingGuide": "You can also use our Onboarding Guide for more information."
+ },
+ "CommonKubectl": {
+ "emphasis": {
+ "irreversible": "irreversible",
+ "permanentlyDeleted": "permanently deleted"
+ },
+ "learnButton": "Learn how to do this in code"
+ },
"App": {
"loading": "Loading..."
},
@@ -164,4 +236,4 @@
"userExists": "User with this email already exists!",
"atLeastOneUser": "You need to have at least one member assigned."
}
-}
\ No newline at end of file
+}
diff --git a/src/components/ControlPlanes/ControlPlaneCard.tsx b/src/components/ControlPlanes/ControlPlaneCard.tsx
index 3b80eeb8..e0ff996c 100644
--- a/src/components/ControlPlanes/ControlPlaneCard.tsx
+++ b/src/components/ControlPlanes/ControlPlaneCard.tsx
@@ -20,6 +20,7 @@ import {
} from '../../lib/api/types/crate/deleteMCP.ts';
import { DeleteConfirmationDialog } from '../Dialogs/DeleteConfirmationDialog.tsx';
import MCPHealthPopoverButton from '../ControlPlane/MCPHealthPopoverButton.tsx';
+import { KubectlDeleteMcp } from '../Dialogs/KubectlCommandInfo/Controllers/KubectlDeleteMcp.tsx';
interface Props {
controlPlane: ListControlPlanesType;
@@ -98,6 +99,13 @@ export function ControlPlaneCard({
+ }
isOpen={dialogDeleteMcpIsOpen}
setIsOpen={setDialogDeleteMcpIsOpen}
onDeletionConfirmed={async () => {
diff --git a/src/components/ControlPlanes/List/ControlPlaneListWorkspaceGridTile.tsx b/src/components/ControlPlanes/List/ControlPlaneListWorkspaceGridTile.tsx
index a421e2f7..d6a7ed12 100644
--- a/src/components/ControlPlanes/List/ControlPlaneListWorkspaceGridTile.tsx
+++ b/src/components/ControlPlanes/List/ControlPlaneListWorkspaceGridTile.tsx
@@ -27,6 +27,7 @@ import useApiResource, {
} from '../../../lib/api/useApiResource.ts';
import { DISPLAY_NAME_ANNOTATION } from '../../../lib/api/types/shared/keyNames.ts';
import { DeleteConfirmationDialog } from '../../Dialogs/DeleteConfirmationDialog.tsx';
+import { KubectlDeleteWorkspace } from '../../Dialogs/KubectlCommandInfo/Controllers/KubectlDeleteWorkspace.tsx';
import { useToast } from '../../../context/ToastContext.tsx';
import { ListControlPlanes } from '../../../lib/api/types/crate/controlPlanes.ts';
import IllustratedError from '../../Shared/IllustratedError.tsx';
@@ -154,6 +155,12 @@ export function ControlPlaneListWorkspaceGridTile({
+ }
isOpen={dialogDeleteWsIsOpen}
setIsOpen={setDialogDeleteWsIsOpen}
onDeletionConfirmed={async () => {
diff --git a/src/components/Dialogs/CreateProjectWorkspaceDialog.tsx b/src/components/Dialogs/CreateProjectWorkspaceDialog.tsx
index e6337e85..f0ac47ca 100644
--- a/src/components/Dialogs/CreateProjectWorkspaceDialog.tsx
+++ b/src/components/Dialogs/CreateProjectWorkspaceDialog.tsx
@@ -12,13 +12,16 @@ import {
import { Member } from '../../lib/api/types/shared/members';
import { ErrorDialog, ErrorDialogHandle } from '../Shared/ErrorMessageBox.tsx';
+import { FormEvent, useState } from 'react';
+import { KubectlInfoButton } from './KubectlCommandInfo/KubectlInfoButton.tsx';
+import { KubectlCreateWorkspaceDialog } from './KubectlCommandInfo/KubectlCreateWorkspaceDialog.tsx';
+import { KubectlCreateProjectDialog } from './KubectlCommandInfo/KubectlCreateProjectDialog.tsx';
+
import { EditMembers } from '../Members/EditMembers.tsx';
-import ButtonDesign from '@ui5/webcomponents/dist/types/ButtonDesign.js';
-import { useFrontendConfig } from '../../context/FrontendConfigContext.tsx';
+// import { useFrontendConfig } from '../../context/FrontendConfigContext.tsx';
import { useTranslation } from 'react-i18next';
import { CreateDialogProps } from './CreateWorkspaceDialogContainer.tsx';
-import { FormEvent } from 'react';
import { FieldErrors, UseFormRegister, UseFormSetValue } from 'react-hook-form';
export type OnCreatePayload = {
@@ -38,6 +41,7 @@ export interface CreateProjectWorkspaceDialogProps {
register: UseFormRegister;
errors: FieldErrors;
setValue: UseFormSetValue;
+ projectName?: string;
}
export function CreateProjectWorkspaceDialog({
@@ -50,9 +54,14 @@ export function CreateProjectWorkspaceDialog({
register,
errors,
setValue,
+ projectName,
}: CreateProjectWorkspaceDialogProps) {
- const { links } = useFrontendConfig();
+ // const { links } = useFrontendConfig();
const { t } = useTranslation();
+ const [isKubectlDialogOpen, setIsKubectlDialogOpen] = useState(false);
+
+ const openKubectlDialog = () => setIsKubectlDialogOpen(true);
+ const closeKubectlDialog = () => setIsKubectlDialogOpen(false);
return (
<>
@@ -65,16 +74,10 @@ export function CreateProjectWorkspaceDialog({
-
+