diff --git a/src/components/common/DeleteResource.tsx b/src/components/common/DeleteResource.tsx index ef959c6..7004540 100644 --- a/src/components/common/DeleteResource.tsx +++ b/src/components/common/DeleteResource.tsx @@ -22,7 +22,6 @@ import { API_DELETE_K8S_RESOURCE, API_GET_K8S_RESOURCE_STATUS, API_TO_POST_MANIFEST, - DELETE_K8S_RESOURCE_API, } from '@src/constants/Endpoints'; import { forEach } from 'lodash'; import { getFieldNameFromPath } from '@src/models/Manifest'; @@ -96,7 +95,7 @@ const ConfirmationPopup = (props: ConfirmationPopupProps) => { const { handleClose, onDelete } = props; const [notifyDelete, setNotifyDelete] = useState(false); const [deleteMessage, setDeleteMessage] = useState(); - let [deleteFromManifest, setDeleteFromManifest] = useState(false); + let [deleteFromManifest, setDeleteFromManifest] = useState(true); const { submitForm }: { submitForm: any } = useFormikContext(); const toggleDeleteFromManifest = () => { @@ -129,28 +128,26 @@ const ConfirmationPopup = (props: ConfirmationPopupProps) => { const NotifyDelete = () => { const classes = useStyles(); return ( - - - - - {deleteMessage} - - - - - - + + + + {deleteMessage} + - + + + + + ); }; @@ -167,7 +164,7 @@ const ConfirmationPopup = (props: ConfirmationPopupProps) => {

- + } label="Delete from manifest also" @@ -242,7 +239,6 @@ const DeleteResource = (props: DeleteResourceProps) => { const [loading, setLoading] = useState(false); function getPathAndIndex(fieldPath) { - console.log(fieldPath); const match = fieldPath.match(/\.(\d+)$/); const index = match ? parseInt(match[1], 10) : undefined; const pathWithoutIndex = match ? fieldPath.slice(0, fieldPath.lastIndexOf('.')) : fieldPath; @@ -298,8 +294,7 @@ const DeleteResource = (props: DeleteResourceProps) => { } const checkIfDeployed = () => { - if (!DeleteImplementedMap.hasOwnProperty(fieldName)) { - console.log('checking', fieldName); + if (!DeleteImplementedMap.hasOwnProperty(k8sResourceName)) { props.onDelete(); return; } @@ -329,7 +324,6 @@ const DeleteResource = (props: DeleteResourceProps) => { setLoading(false); toast.error( 'Could not check if resource is deployed on kubernetes, please reach out to Cloud-Platform team', - resJson.statusText, ); } }) diff --git a/src/components/common/FormikCardList.tsx b/src/components/common/FormikCardList.tsx index 8126ae6..b6d4a45 100644 --- a/src/components/common/FormikCardList.tsx +++ b/src/components/common/FormikCardList.tsx @@ -4,7 +4,6 @@ import * as React from 'react'; import AddIcon from '@material-ui/icons/Add'; import DeleteIcon from '@material-ui/icons/Delete'; import DeleteResource from './DeleteResource'; -import { path } from '@src/models/Manifest'; const useStyles = makeStyles({ root: { @@ -58,7 +57,7 @@ export const FormikCardList = (props: FormikCardListProps) => {