diff --git a/src/assets/locales/de/main.json b/src/assets/locales/de/main.json
index f27b85ef7..df17ef8da 100644
--- a/src/assets/locales/de/main.json
+++ b/src/assets/locales/de/main.json
@@ -1675,6 +1675,20 @@
"status": "Status: "
},
"noData": "Derzeit bestehen keine Zertifikate für das Unternehmen. Sie können mit dem Hochladen eines Zertifikats beginnen, indem Sie oben auf die Schaltfläche „Zertifikat hochladen“ klicken."
+ },
+ "deleteCompany": {
+ "title": "Delete Company Account",
+ "description": "You have initiated the deletion of the company account {{companyName}} incl. your personal user account {name}. Please note that the deletion can not get reversed.",
+ "heading1": "Company Account {name} is getting deleted",
+ "heading2": "All linked user accounts are getting deleted:",
+ "deleteBtn": "Delete my company",
+ "successTitle": "Company Account Deletion was successful.",
+ "successDescription": "The deletion was successful. You can now close this page. An email confirmation was send.",
+ "errorTitle": "Company Account Deletion was unsuccessful.",
+ "errorDescription": "The deletion was unsuccessful. Try it again or contact the platform administrator.",
+ "retryBtn": "Retry Deletion",
+ "notSupportedTitle": "Company account deletion is not supported. You registration is already submitted/closed. To unsubscribe you need to use the platform off-boarding process.",
+ "notSupportedDescription": "You can close the screen now or redirect to the portal >> get to the platform"
}
},
"navigation": {
diff --git a/src/assets/locales/en/main.json b/src/assets/locales/en/main.json
index d7943d925..f0d9d62b2 100644
--- a/src/assets/locales/en/main.json
+++ b/src/assets/locales/en/main.json
@@ -1639,6 +1639,20 @@
"approvedMessage": "Credential Request Accepted successfully.",
"declinedMessage": "Credential Request Declined successfully.",
"errorMessage": "Something went wrong!"
+ },
+ "deleteCompany": {
+ "title": "Delete Company Account",
+ "description": "You have initiated the deletion of the company account {{companyName}} incl. your personal user account {{name}}. Please note that the deletion can not get reversed.",
+ "heading1": "Company Account {{name}} is getting deleted",
+ "heading2": "All linked user accounts are getting deleted:",
+ "deleteBtn": "Delete my company",
+ "successTitle": "Company Account Deletion was successful.",
+ "successDescription": "The deletion was successful. You can now close this page. An email confirmation was send.",
+ "errorTitle": "Company Account Deletion was unsuccessful.",
+ "errorDescription": "The deletion was unsuccessful. Try it again or contact the platform administrator.",
+ "retryBtn": "Retry Deletion",
+ "notSupportedTitle": "Company account deletion is not supported. You registration is already submitted/closed. To unsubscribe you need to use the platform off-boarding process.",
+ "notSupportedDescription": "You can close the screen now or redirect to the portal >> get to the platform"
}
},
"navigation": {
diff --git a/src/components/AuthorizingRouter.tsx b/src/components/AuthorizingRouter.tsx
index efd0b978c..896fc2dce 100644
--- a/src/components/AuthorizingRouter.tsx
+++ b/src/components/AuthorizingRouter.tsx
@@ -24,6 +24,7 @@ import NotFound from 'components/pages/NotFound'
import AccessService from 'services/AccessService'
import ScrollToTop from '../utils/ScrollToTop'
import ErrorBoundary from 'components/pages/ErrorBoundary'
+import DeleteCompany from './pages/DeleteCompany'
const AuthorizingRouter = () => {
return (
@@ -35,6 +36,7 @@ const AuthorizingRouter = () => {
{AccessService.permittedRoutes()}
} />
+ } />
)
diff --git a/src/components/pages/DeleteCompany/DeleteCompany.scss b/src/components/pages/DeleteCompany/DeleteCompany.scss
new file mode 100644
index 000000000..6860eec1c
--- /dev/null
+++ b/src/components/pages/DeleteCompany/DeleteCompany.scss
@@ -0,0 +1,87 @@
+/********************************************************************************
+ * Copyright (c) 2021, 2024 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Apache License, Version 2.0 which is available at
+ * https://www.apache.org/licenses/LICENSE-2.0.
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ ********************************************************************************/
+
+.loading {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ min-height: 100vh;
+}
+.deleteMain {
+ min-height: 100vh;
+ background-repeat: no-repeat;
+ background-size: cover;
+ padding: 70px 0 50px 0;
+
+ .d-flex {
+ display: flex;
+ }
+
+ .align-item-center {
+ align-items: center;
+ }
+
+ .text-center {
+ text-align: center;
+ }
+
+ .mr-10 {
+ margin-right: 10px !important;
+ }
+
+ .mb-15 {
+ margin-bottom: 15px !important;
+ }
+
+ .mb-20 {
+ margin-bottom: 20px !important;
+ }
+
+ .mb-25 {
+ margin-bottom: 25px !important;
+ }
+
+ .logo {
+ margin-bottom: 70px;
+
+ img {
+ height: 50px;
+ }
+ }
+
+ .content {
+ max-width: 650px;
+ margin: 0 auto;
+
+ .contentListing {
+ max-width: 80%;
+ margin: 0 auto;
+
+ .icon {
+ color: #0f71cb;
+ font-size: 20px;
+ padding-top: 2px;
+ }
+ }
+ }
+
+ .deleteBtn {
+ text-transform: capitalize;
+ }
+}
diff --git a/src/components/pages/DeleteCompany/index.tsx b/src/components/pages/DeleteCompany/index.tsx
new file mode 100644
index 000000000..bb15dc876
--- /dev/null
+++ b/src/components/pages/DeleteCompany/index.tsx
@@ -0,0 +1,211 @@
+/********************************************************************************
+ * Copyright (c) 2021, 2024 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Apache License, Version 2.0 which is available at
+ * https://www.apache.org/licenses/LICENSE-2.0.
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an 'AS IS' BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ ********************************************************************************/
+
+import { useEffect, useState } from 'react'
+import { Trans, useTranslation } from 'react-i18next'
+import { CircularProgress, Typography } from '@mui/material'
+import { uniqueId } from 'lodash'
+import CheckCircleOutlineIcon from '@mui/icons-material/CheckCircleOutline'
+import { getAssetBase } from 'services/EnvironmentService'
+import { Button, LoadingButton } from '@catena-x/portal-shared-components'
+import {
+ ApplicationStatus,
+ useDeclineRegistrationMutation,
+ useFetchDeclineDataQuery,
+} from 'features/deleteCompany/deleteCompanyApiSlice'
+import './DeleteCompany.scss'
+
+export default function DeleteCompany() {
+ const { t } = useTranslation()
+
+ const [initialPage, setInitialPage] = useState(false)
+ const [isSuccess, setIsSuccess] = useState(false)
+ const [isError, setIsError] = useState(false)
+ const [notSupported, setNotSupported] = useState(false)
+ const [isLoadingBtn, setIsLoadingBtn] = useState(false)
+
+ const { data, isLoading } = useFetchDeclineDataQuery()
+ const companyData = data?.[0]
+ const [declineRegistration] = useDeclineRegistrationMutation()
+
+ useEffect(() => {
+ if (
+ companyData &&
+ Object.values(ApplicationStatus).includes(companyData?.applicationStatus)
+ ) {
+ setInitialPage(true)
+ setNotSupported(false)
+ } else {
+ setNotSupported(true)
+ }
+ }, [companyData])
+
+ const handleDeleteCompany = async () => {
+ if (companyData) {
+ setIsLoadingBtn(true)
+ try {
+ await declineRegistration(companyData.applicationId).unwrap()
+ setInitialPage(false)
+ setIsSuccess(true)
+ setIsLoadingBtn(false)
+ } catch (err) {
+ setInitialPage(false)
+ setIsError(true)
+ setIsLoadingBtn(false)
+ }
+ }
+ }
+
+ const handleRetryDelete = () => {
+ setIsError(false)
+ setInitialPage(true)
+ }
+
+ return (
+ <>
+ {isLoading ? (
+