From 0748f0f2ef025c0a9b0f496f8edc6392bba2d2dd Mon Sep 17 00:00:00 2001 From: charmi-v Date: Mon, 2 Sep 2024 17:44:59 +0530 Subject: [PATCH 1/3] chore: replacing logs using LogService --- .../overlays/ActivateServiceSubscription/index.tsx | 4 ++-- src/components/pages/SemanticHub/ModelDetailDialog.tsx | 2 +- .../components/MarketplaceHeader/index.tsx | 3 ++- src/components/pages/Test/index.dropzone.tsx | 9 +++++---- src/components/pages/Test/index.form.tsx | 5 +++-- src/components/pages/Test/index.image.tsx | 3 ++- .../shared/basic/ProgressVerificationButton/index.tsx | 10 ++++------ .../ReleaseProcess/TechnicalIntegration/index.tsx | 5 +++-- src/components/shared/basic/SearchResultItem/index.tsx | 1 - .../shared/basic/UserDetailInfo/UserDetailCard.tsx | 3 ++- src/features/apps/marketplaceDeprecated/slice.ts | 3 ++- src/services/CommonService.ts | 7 ++++--- 12 files changed, 30 insertions(+), 25 deletions(-) diff --git a/src/components/overlays/ActivateServiceSubscription/index.tsx b/src/components/overlays/ActivateServiceSubscription/index.tsx index 1806fc8d1..7f8b23c1d 100644 --- a/src/components/overlays/ActivateServiceSubscription/index.tsx +++ b/src/components/overlays/ActivateServiceSubscription/index.tsx @@ -75,7 +75,7 @@ export default function ActivateserviceSubscription({ [data] ) - const handleConfrim = async () => { + const handleConfirm = async () => { setLoading(true) try { const result = await subscribe({ @@ -296,7 +296,7 @@ export default function ActivateserviceSubscription({ sx={{ marginLeft: '10px' }} /> ) : ( - )} diff --git a/src/components/pages/SemanticHub/ModelDetailDialog.tsx b/src/components/pages/SemanticHub/ModelDetailDialog.tsx index 6935e7666..1da6962d7 100644 --- a/src/components/pages/SemanticHub/ModelDetailDialog.tsx +++ b/src/components/pages/SemanticHub/ModelDetailDialog.tsx @@ -215,7 +215,7 @@ const ModelDetailDialog = ({ show, onClose }: ModelDetailDialogProps) => { )} {diagramError.length > 0 && ( - t('content.semantichub.detail.fileError') + {t('content.semantichub.detail.fileError')} )} diff --git a/src/components/pages/ServiceMarketplaceDetail/components/MarketplaceHeader/index.tsx b/src/components/pages/ServiceMarketplaceDetail/components/MarketplaceHeader/index.tsx index d2ba478d0..6328c9e64 100644 --- a/src/components/pages/ServiceMarketplaceDetail/components/MarketplaceHeader/index.tsx +++ b/src/components/pages/ServiceMarketplaceDetail/components/MarketplaceHeader/index.tsx @@ -29,6 +29,7 @@ import UserService from 'services/UserService' import './MarketplaceHeader.scss' import { setSuccessType } from 'features/serviceMarketplace/slice' import { getAssetBase } from 'services/EnvironmentService' +import { info } from 'services/LogService' import { Box } from '@mui/material' import { ServiceTypeIdsEnum } from 'features/serviceManagement/apiSlice' @@ -54,7 +55,7 @@ export default function MarketplaceHeader({ color="success" className="subscribe-btn" onClick={() => { - console.log('click function') + info('click function') }} > {t('content.appdetail.subscribed')} diff --git a/src/components/pages/Test/index.dropzone.tsx b/src/components/pages/Test/index.dropzone.tsx index 20014d6d7..1165d2796 100644 --- a/src/components/pages/Test/index.dropzone.tsx +++ b/src/components/pages/Test/index.dropzone.tsx @@ -23,6 +23,7 @@ import { Cards } from '@catena-x/portal-shared-components' import { appToCard } from 'features/apps/mapper' import { isString } from 'lodash' import { useState } from 'react' +import { info } from 'services/LogService' import ItemProcessor from './ItemProcessor' export default function Test() { @@ -45,10 +46,10 @@ export default function Test() { .forEach((file: File) => { const reader = new FileReader() reader.onabort = () => { - console.log('file reading was aborted') + info('file reading was aborted') } reader.onerror = () => { - console.log('file reading has failed') + info('file reading has failed') } reader.onload = () => { const str = reader.result @@ -66,10 +67,10 @@ export default function Test() { .forEach((file: File) => { const reader = new FileReader() reader.onabort = () => { - console.log('file reading was aborted') + info('file reading was aborted') } reader.onerror = () => { - console.log('file reading has failed') + info('file reading has failed') } reader.onload = () => { const str = reader.result diff --git a/src/components/pages/Test/index.form.tsx b/src/components/pages/Test/index.form.tsx index 8a1f98f12..1f84e72e9 100644 --- a/src/components/pages/Test/index.form.tsx +++ b/src/components/pages/Test/index.form.tsx @@ -23,6 +23,7 @@ import BasicInput, { InputType } from 'components/shared/basic/Input/BasicInput' import { Button, Checkbox } from '@catena-x/portal-shared-components' import { useState } from 'react' import { isMail } from 'types/Patterns' +import { info } from 'services/LogService' const TestValueBar = ({ onValue }: { onValue: (value: string) => void }) => { return ( @@ -87,7 +88,7 @@ const BasicFormTest = () => { error ? 'password length must be at least 8 characters' : undefined } onValue={(value?: string) => { - console.log(value) + info(value!) }} />
 {
         }
         validate={(expr) => expr.length >= 8}
         onValid={(_name: string, value?: string) => {
-          console.log(value ?? '')
+          info(value ?? '')
         }}
         debounceTime={Number.parseInt(debounceTime)}
       />
diff --git a/src/components/pages/Test/index.image.tsx b/src/components/pages/Test/index.image.tsx
index c71419ffa..06c66f936 100644
--- a/src/components/pages/Test/index.image.tsx
+++ b/src/components/pages/Test/index.image.tsx
@@ -25,6 +25,7 @@ import {
 import { useEffect, useState } from 'react'
 import { getApiBase, getAssetBase } from 'services/EnvironmentService'
 import { fetchImageWithToken } from 'services/ImageService'
+import { info } from 'services/LogService'
 
 export default function ImageTest() {
   const style = { margin: '10px', width: '240px', height: '240px' }
@@ -37,7 +38,7 @@ export default function ImageTest() {
         setData(URL.createObjectURL(new Blob([buffer], { type: 'image/png' })))
       })
       .catch((err) => {
-        console.log(err)
+        info(err)
       })
   }, [])
 
diff --git a/src/components/shared/basic/ProgressVerificationButton/index.tsx b/src/components/shared/basic/ProgressVerificationButton/index.tsx
index 85485a6c8..62cb5b4cc 100644
--- a/src/components/shared/basic/ProgressVerificationButton/index.tsx
+++ b/src/components/shared/basic/ProgressVerificationButton/index.tsx
@@ -41,6 +41,7 @@ import './style.scss'
 import { useReducer } from 'react'
 import { useDispatch } from 'react-redux'
 import { refreshApplicationRequest } from 'features/admin/registration/actions'
+import { info } from 'services/LogService'
 
 enum ActionKind {
   SET_RETRIGGER_LOADING = 'SET_RETRIGGER_LOADING',
@@ -170,7 +171,7 @@ export const ProgressVerificationButton = ({
     await approveChecklist(selectedRequestId)
       .unwrap()
       .then((payload) => {
-        console.log('fulfilled', payload)
+        info('fulfilled', payload)
       })
       .catch((error) => {
         setState({ type: ActionKind.SET_ERROR, payload: error.data.title })
@@ -192,7 +193,7 @@ export const ProgressVerificationButton = ({
     })
       .unwrap()
       .then((payload) => {
-        console.log('fulfilled', payload)
+        info('fulfilled', payload)
       })
       .catch((error) => {
         setState({ type: ActionKind.SET_ERROR, payload: error.data.title })
@@ -206,10 +207,7 @@ export const ProgressVerificationButton = ({
 
   const onRetrigger = () => {
     if (!selectedRequestId) return
-    console.log(
-      'props.retriggerableProcessSteps',
-      props.retriggerableProcessSteps
-    )
+    info('props.retriggerableProcessSteps', props.retriggerableProcessSteps)
     setState({ type: ActionKind.SET_RETRIGGER_LOADING, payload: true })
     props.retriggerableProcessSteps &&
       props.retriggerableProcessSteps.forEach(async (process: string) => {
diff --git a/src/components/shared/basic/ReleaseProcess/TechnicalIntegration/index.tsx b/src/components/shared/basic/ReleaseProcess/TechnicalIntegration/index.tsx
index cfa7520e4..b41fd04d2 100644
--- a/src/components/shared/basic/ReleaseProcess/TechnicalIntegration/index.tsx
+++ b/src/components/shared/basic/ReleaseProcess/TechnicalIntegration/index.tsx
@@ -56,6 +56,7 @@ import { setAppStatus } from 'features/appManagement/actions'
 import SnackbarNotificationWithButtons from '../components/SnackbarNotificationWithButtons'
 import { ErrorType } from 'features/appManagement/types'
 import { error, success } from 'services/NotifyService'
+import { info } from 'services/LogService'
 import { ButtonLabelTypes } from '..'
 
 export default function TechnicalIntegration() {
@@ -267,10 +268,10 @@ export default function TechnicalIntegration() {
       .forEach((file: File) => {
         const reader = new FileReader()
         reader.onabort = () => {
-          console.log('file reading was aborted')
+          info('file reading was aborted')
         }
         reader.onerror = () => {
-          console.log('file reading has failed')
+          info('file reading has failed')
         }
         reader.onload = () => {
           const str = reader.result
diff --git a/src/components/shared/basic/SearchResultItem/index.tsx b/src/components/shared/basic/SearchResultItem/index.tsx
index 8d89a8f6f..447e3897b 100644
--- a/src/components/shared/basic/SearchResultItem/index.tsx
+++ b/src/components/shared/basic/SearchResultItem/index.tsx
@@ -134,7 +134,6 @@ export const SearchResultItem = ({
         },
       }}
       onClick={() => {
-        console.log(item.category)
         switch (item.category) {
           case SearchCategory.PAGE:
             dispatch(setAppear({ SEARCH: false }))
diff --git a/src/components/shared/basic/UserDetailInfo/UserDetailCard.tsx b/src/components/shared/basic/UserDetailInfo/UserDetailCard.tsx
index 3ebc5c93f..1f558c4ca 100644
--- a/src/components/shared/basic/UserDetailInfo/UserDetailCard.tsx
+++ b/src/components/shared/basic/UserDetailInfo/UserDetailCard.tsx
@@ -32,6 +32,7 @@ import EditIcon from '@mui/icons-material/ModeEditOutlineOutlined'
 import { OVERLAYS } from 'types/Constants'
 import { useParams } from 'react-router-dom'
 import ContentCopyIcon from '@mui/icons-material/ContentCopy'
+import { info } from 'services/LogService'
 
 export type UserDetail = {
   companyUserId: string
@@ -74,7 +75,7 @@ export const UserDetailCard = ({
   const copyText = (value: string | string[]) => {
     setCopied(true)
     navigator.clipboard.writeText(value as string).catch((err) => {
-      console.log(err)
+      info(err)
     })
   }
 
diff --git a/src/features/apps/marketplaceDeprecated/slice.ts b/src/features/apps/marketplaceDeprecated/slice.ts
index fe4e60bd9..d8e4be1f2 100644
--- a/src/features/apps/marketplaceDeprecated/slice.ts
+++ b/src/features/apps/marketplaceDeprecated/slice.ts
@@ -21,6 +21,7 @@
 import type { CardItems } from '@catena-x/portal-shared-components'
 import { createSlice } from '@reduxjs/toolkit'
 import type { RootState } from 'features/store'
+import { info } from 'services/LogService'
 import { fetchActive, fetchLatest, fetchSubscriptionStatus } from './actions'
 import {
   type AppMarketplaceApp,
@@ -124,7 +125,7 @@ export const subscribedAppsSelector = (state: RootState) => {
       )
     })
     .forEach((result: AppMarketplaceApp) => {
-      console.log('result', appToCard(result))
+      info('result', appToCard(result))
       return appToCard(result)
     })
 }
diff --git a/src/services/CommonService.ts b/src/services/CommonService.ts
index ec009fd95..8ef771dec 100644
--- a/src/services/CommonService.ts
+++ b/src/services/CommonService.ts
@@ -25,6 +25,7 @@ import type { ImageType } from '@catena-x/portal-shared-components'
 import { fetchImageWithToken } from './ImageService'
 import type { RoleDescData } from 'components/pages/RoleDetails'
 import type { RolesData } from 'features/companyRoles/companyRoleApiSlice'
+import { info } from './LogService'
 
 const getName = (app: AppMarketplaceApp) => app.name ?? ''
 const getDescription = (app: AppMarketplaceApp) =>
@@ -82,7 +83,7 @@ const getRoleDescription = (callback: (data: RoleDescData[]) => void) => {
       callback(data)
     })
     .catch((err) => {
-      console.log(err)
+      info('Fetching Role Description Failed', err)
     })
 }
 
@@ -95,8 +96,8 @@ const getCompanyRoleUpdateData = (callback: (data: RolesData) => void) => {
     .then((data) => {
       callback(data)
     })
-    .catch((error: unknown) => {
-      console.log('Fetching Company Roles Data Failed', error)
+    .catch((error) => {
+      info('Fetching Company Roles Data Failed', error)
     })
 }
 

From d9f54306fb8c79218b5dac46792ec66acb7b6f3f Mon Sep 17 00:00:00 2001
From: charmi-v 
Date: Tue, 3 Sep 2024 18:17:38 +0530
Subject: [PATCH 2/3] chore: replaced console with Notifyservice & LogService

---
 .../ActivateServiceSubscription/index.tsx     |  6 ++-
 .../overlays/AddMultipleUser/index.tsx        |  7 ++--
 .../overlays/AddTechnicalUser/index.tsx       |  5 ++-
 src/components/overlays/AddusersIDP/index.tsx |  5 ++-
 .../overlays/DeleteTechnicalUser/index.tsx    | 33 ++++++++-------
 .../overlays/EnableIDP/EnableIDPContent.tsx   |  3 +-
 src/components/overlays/EnableIDP/index.tsx   |  3 +-
 .../overlays/UpdateCompanyRole/index.tsx      | 10 +++--
 .../CompanyDetailOverlay/index.tsx            |  6 ++-
 .../components/RegistrationRequests/index.tsx |  5 ++-
 .../components/BoardDocuments/index.tsx       |  6 ++-
 .../components/BoardHeader/index.tsx          |  5 ++-
 .../components/AppDetailDocuments/index.tsx   |  6 ++-
 .../components/AppDetailHeader/index.tsx      |  5 ++-
 .../FavoriteSection/FavoriteItem.tsx          |  6 ++-
 .../pages/AppOverview/AddRolesOverlay.tsx     |  5 ++-
 .../pages/AppOverview/AppOverViewDetails.tsx  |  6 ++-
 .../ActivateSubscriptionOverlay/index.tsx     |  6 ++-
 .../CompanySubscriptionsTableColumns.tsx      |  3 +-
 .../pages/IDPManagement/IDPList.tsx           |  5 ++-
 .../components/InviteList/index.tsx           |  3 +-
 .../NotificationCenter/NotificationItem.tsx   |  3 +-
 .../pages/OSPConsent/CompanyDetails.tsx       | 41 +++++++++----------
 .../pages/SemanticHub/ModelDetailDialog.tsx   |  3 +-
 .../pages/ServiceAdminBoardDetail/index.tsx   |  6 ++-
 .../components/MarketplaceDocuments/index.tsx |  6 ++-
 .../components/ServiceDetails.tsx             |  6 ++-
 src/components/pages/Test/index.dropzone.tsx  |  2 +-
 .../ReleaseProcess/AppMarketCard/index.tsx    |  6 ++-
 .../basic/ReleaseProcess/OfferCard/index.tsx  |  5 ++-
 .../components/CommonContractAndConsent.tsx   |  9 ++--
 .../components/CommonValidateAndPublish.tsx   | 10 +++--
 src/features/admin/registration/actions.ts    |  9 ++--
 src/features/admin/userDeprecated/actions.ts  |  9 ++--
 src/features/admin/userOwn/actions.ts         |  9 ++--
 src/features/appManagement/apiSlice.ts        |  4 +-
 src/features/apps/apiSlice.ts                 |  2 +-
 src/features/apps/details/actions.ts          |  5 ++-
 src/features/apps/favorites/actions.ts        | 13 +++---
 .../apps/marketplaceDeprecated/actions.ts     | 13 +++---
 src/features/connector/actions.ts             | 13 +++---
 src/features/info/news/actions.ts             |  5 ++-
 src/features/info/search/actions.ts           |  5 ++-
 src/features/partnerNetwork/actions.ts        | 13 +++---
 src/features/semanticModels/actions.ts        | 23 ++++++-----
 src/features/serviceManagement/apiSlice.ts    |  2 +-
 src/services/I18nService.ts                   |  3 +-
 47 files changed, 208 insertions(+), 156 deletions(-)

diff --git a/src/components/overlays/ActivateServiceSubscription/index.tsx b/src/components/overlays/ActivateServiceSubscription/index.tsx
index 7f8b23c1d..e3bbc6a68 100644
--- a/src/components/overlays/ActivateServiceSubscription/index.tsx
+++ b/src/components/overlays/ActivateServiceSubscription/index.tsx
@@ -40,6 +40,8 @@ import {
   useFetchServiceTechnicalUserProfilesQuery,
 } from 'features/serviceManagement/apiSlice'
 import { Link } from 'react-router-dom'
+import { type LogData } from 'services/LogService'
+import { error } from 'services/NotifyService'
 
 const ProfileHelpURL =
   '/documentation/?path=user%2F05.+Service%28s%29%2F03.+Service+Subscription%2F01.+Service+Subscription.md'
@@ -85,9 +87,9 @@ export default function ActivateserviceSubscription({
       setActivationResponse(true)
       setTechuserInfo(result)
       setLoading(false)
-    } catch (error) {
+    } catch (e) {
       setLoading(false)
-      console.log(error)
+      error('ERROR ON SERVICE SUBSCRIPTION', '', e as LogData)
     }
   }
 
diff --git a/src/components/overlays/AddMultipleUser/index.tsx b/src/components/overlays/AddMultipleUser/index.tsx
index 7ee6f0053..0eebc4cea 100644
--- a/src/components/overlays/AddMultipleUser/index.tsx
+++ b/src/components/overlays/AddMultipleUser/index.tsx
@@ -66,6 +66,7 @@ import Papa from 'papaparse'
 import { AddUserDeny } from '../AddUser/AddUserDeny'
 import { error } from 'services/NotifyService'
 import ArrowForwardIcon from '@mui/icons-material/ArrowForward'
+import LogService from 'services/LogService'
 
 const HelpPageURL =
   '/documentation/?path=user%2F03.+User+Management%2F01.+User+Account%2F04.+Create+new+user+account+%28bulk%29.md'
@@ -168,10 +169,10 @@ export default function AddMultipleUser() {
       }
       // Add an ESLint exception until there is a solution
       // eslint-disable-next-line
-    } catch (error: any) {
+    } catch (e: any) {
       setLoading(false)
-      setIsError(error.data.errors.document[0])
-      console.log(error)
+      setIsError(e.data.errors.document[0])
+      LogService.error(e as string)
     }
   }
 
diff --git a/src/components/overlays/AddTechnicalUser/index.tsx b/src/components/overlays/AddTechnicalUser/index.tsx
index f368eaf1f..2a5f0792e 100644
--- a/src/components/overlays/AddTechnicalUser/index.tsx
+++ b/src/components/overlays/AddTechnicalUser/index.tsx
@@ -44,6 +44,7 @@ import { ServerResponseOverlay } from '../ServerResponse'
 import ErrorOutlineIcon from '@mui/icons-material/ErrorOutline'
 import HelpOutlineIcon from '@mui/icons-material/HelpOutline'
 import './TechnicalUserAddForm.scss'
+import LogService from 'services/LogService'
 
 export const AddTechnicalUser = () => {
   const { t } = useTranslation()
@@ -63,13 +64,13 @@ export const AddTechnicalUser = () => {
         authenticationType: ServiceAccountType.SECRET,
         roleIds: [formValues.TechnicalUserService],
       }).unwrap()
-      console.log(result)
+      LogService.info('', result)
       setResponse(result)
       setLoading(false)
       setError(false)
       dispatch(updateData(UPDATES.TECHUSER_LIST))
     } catch (err) {
-      console.log(err)
+      LogService.error(err as string)
       setLoading(false)
       setError(true)
     }
diff --git a/src/components/overlays/AddusersIDP/index.tsx b/src/components/overlays/AddusersIDP/index.tsx
index 2990fb182..b81c8d0f3 100644
--- a/src/components/overlays/AddusersIDP/index.tsx
+++ b/src/components/overlays/AddusersIDP/index.tsx
@@ -50,6 +50,7 @@ import {
   FORMS,
   storeForm,
 } from 'features/control/form'
+import { info } from 'services/LogService'
 import { error, success } from 'services/NotifyService'
 import HelpOutlineIcon from '@mui/icons-material/HelpOutline'
 import DownloadIcon from '@mui/icons-material/Download'
@@ -433,10 +434,10 @@ export const AddusersIDP = ({ id }: { id: string }) => {
       }
       const reader = new FileReader()
       reader.onabort = () => {
-        console.log('file reading was aborted')
+        info('file reading was aborted')
       }
       reader.onerror = () => {
-        console.log('file reading has failed')
+        info('file reading has failed')
       }
       reader.onload = () => {
         if (!reader.result) return
diff --git a/src/components/overlays/DeleteTechnicalUser/index.tsx b/src/components/overlays/DeleteTechnicalUser/index.tsx
index 30fd7b9d7..6405647ba 100644
--- a/src/components/overlays/DeleteTechnicalUser/index.tsx
+++ b/src/components/overlays/DeleteTechnicalUser/index.tsx
@@ -32,6 +32,7 @@ import { updateData, UPDATES } from 'features/control/updates'
 import { closeOverlay } from 'features/control/overlay'
 import DeleteUserContent from 'components/shared/basic/DeleteObjectContent'
 import { SuccessErrorType } from 'features/admin/appuserApiSlice'
+import { error } from 'services/LogService'
 
 export const DeleteTechnicalUser = ({ id }: { id: string }) => {
   const { t } = useTranslation()
@@ -75,25 +76,23 @@ export const DeleteTechnicalUser = ({ id }: { id: string }) => {
       deleteUserSuccess()
     } catch (err: unknown) {
       deleteUserError(err)
-      console.log(err)
+      error(err as string)
     }
   }
   return data ? (
-    <>
-      
-    
+    
   ) : null
 }
diff --git a/src/components/overlays/EnableIDP/EnableIDPContent.tsx b/src/components/overlays/EnableIDP/EnableIDPContent.tsx
index 499989277..dffc0b698 100644
--- a/src/components/overlays/EnableIDP/EnableIDPContent.tsx
+++ b/src/components/overlays/EnableIDP/EnableIDPContent.tsx
@@ -28,6 +28,7 @@ import type { IHashMap } from 'types/MainTypes'
 import { useTranslation } from 'react-i18next'
 import ValidatingInput from 'components/shared/basic/Input/ValidatingInput'
 import { getApiBase } from 'services/EnvironmentService'
+import { error } from 'services/LogService'
 import UserService from 'services/UserService'
 
 const EnableIDPForm = ({
@@ -102,7 +103,7 @@ export const EnableIDPContent = ({
         setUserId(data.userId)
       })
       .catch((e) => {
-        console.log(e)
+        error(e as string)
       })
   }, [identityProviderId, companyUserId])
 
diff --git a/src/components/overlays/EnableIDP/index.tsx b/src/components/overlays/EnableIDP/index.tsx
index 690969e2b..243a86143 100644
--- a/src/components/overlays/EnableIDP/index.tsx
+++ b/src/components/overlays/EnableIDP/index.tsx
@@ -43,6 +43,7 @@ import { EnableIDPContent } from './EnableIDPContent'
 import { useFetchOwnUserDetailsQuery } from 'features/admin/userApiSlice'
 import { OVERLAYS } from 'types/Constants'
 import { success } from 'services/NotifyService'
+import { error } from 'services/LogService'
 
 export const EnableIDP = ({ id }: { id: string }) => {
   const { t } = useTranslation('idp')
@@ -101,7 +102,7 @@ export const EnableIDP = ({ id }: { id: string }) => {
       }
       setLoading(false)
     } catch (err) {
-      console.log(err)
+      error(err as string)
     }
   }
 
diff --git a/src/components/overlays/UpdateCompanyRole/index.tsx b/src/components/overlays/UpdateCompanyRole/index.tsx
index 7809264d4..1f0e1f4be 100644
--- a/src/components/overlays/UpdateCompanyRole/index.tsx
+++ b/src/components/overlays/UpdateCompanyRole/index.tsx
@@ -54,6 +54,8 @@ import {
 } from 'features/companyRoles/slice'
 import { useFetchFrameDocumentByIdMutation } from 'features/appManagement/apiSlice'
 import uniq from 'lodash.uniq'
+import LogService, { type LogData } from 'services/LogService'
+import { error } from 'services/NotifyService'
 
 export enum AgreementStatus {
   ACTIVE = 'ACTIVE',
@@ -139,8 +141,8 @@ export default function UpdateCompanyRole({ roles }: { roles: string[] }) {
       const fileType = response.headers.get('content-type')
       const file = response.data
       download(file, fileType, documentName)
-    } catch (error) {
-      console.error(error, 'ERROR WHILE FETCHING DOCUMENT')
+    } catch (e) {
+      error('ERROR WHILE FETCHING DOCUMENT', '', e as LogData)
     }
   }
 
@@ -208,8 +210,8 @@ export default function UpdateCompanyRole({ roles }: { roles: string[] }) {
       await updateCompanyRoles(filterRoles).unwrap()
       dispatch(setCompanyRoleSuccess(true))
       close()
-    } catch (error) {
-      console.log(error)
+    } catch (e) {
+      LogService.error(e as string)
       dispatch(setCompanyRoleError(true))
       close()
     }
diff --git a/src/components/pages/Admin/components/RegistrationRequests/CompanyDetailOverlay/index.tsx b/src/components/pages/Admin/components/RegistrationRequests/CompanyDetailOverlay/index.tsx
index 9977b9e0d..dbd4e988f 100644
--- a/src/components/pages/Admin/components/RegistrationRequests/CompanyDetailOverlay/index.tsx
+++ b/src/components/pages/Admin/components/RegistrationRequests/CompanyDetailOverlay/index.tsx
@@ -48,6 +48,8 @@ import { getIntro, getTitle } from './CompanyDetailsHelper'
 import { useFetchNewDocumentByIdMutation } from 'features/appManagement/apiSlice'
 import { type UniqueIdType } from 'features/admin/registration/types'
 import { StatusProgress } from '../registrationTableColumns'
+import { type LogData } from 'services/LogService'
+import { error } from 'services/NotifyService'
 
 interface CompanyDetailOverlayProps {
   openDialog?: boolean
@@ -103,8 +105,8 @@ const CompanyDetailOverlay = ({
       const file = response.data
 
       download(file, fileType, documentType)
-    } catch (error) {
-      console.error(error, 'ERROR WHILE FETCHING DOCUMENT')
+    } catch (e) {
+      error('ERROR WHILE FETCHING DOCUMENT', '', e as LogData)
     }
   }
 
diff --git a/src/components/pages/Admin/components/RegistrationRequests/index.tsx b/src/components/pages/Admin/components/RegistrationRequests/index.tsx
index b81004afb..5f718f99b 100644
--- a/src/components/pages/Admin/components/RegistrationRequests/index.tsx
+++ b/src/components/pages/Admin/components/RegistrationRequests/index.tsx
@@ -40,6 +40,7 @@ import ErrorOutlineIcon from '@mui/icons-material/ErrorOutline'
 import AddBpnOveraly from './ConfirmationOverlay/AddBpnOverlay'
 import ConfirmCancelOverlay from './ConfirmationOverlay/ConfirmCancelOverlay'
 import type { AppDispatch } from 'features/store'
+import { info } from 'services/LogService'
 
 enum TableField {
   DETAIL = 'detail',
@@ -104,7 +105,7 @@ export default function RegistrationRequests() {
       await approveRequest(selectedRequestId)
         .unwrap()
         .then((payload) => {
-          console.log('fulfilled', payload)
+          info('fulfilled', payload)
         })
         .catch((error) => {
           setShowErrorAlert(error.data.title)
@@ -116,7 +117,7 @@ export default function RegistrationRequests() {
       })
         .unwrap()
         .then((payload) => {
-          console.log('fulfilled', payload)
+          info('fulfilled', payload)
         })
         .catch((error) => {
           setShowErrorAlert(error.data.title)
diff --git a/src/components/pages/AdminBoardDetail/components/BoardDocuments/index.tsx b/src/components/pages/AdminBoardDetail/components/BoardDocuments/index.tsx
index 10058558e..27476f301 100644
--- a/src/components/pages/AdminBoardDetail/components/BoardDocuments/index.tsx
+++ b/src/components/pages/AdminBoardDetail/components/BoardDocuments/index.tsx
@@ -30,6 +30,8 @@ import {
 import { useFetchDocumentByIdMutation } from 'features/apps/apiSlice'
 import { download } from 'utils/downloadUtils'
 import { DocumentTypeId } from 'features/appManagement/apiSlice'
+import { type LogData } from 'services/LogService'
+import { error } from 'services/NotifyService'
 
 export default function BoardDocuments({
   type,
@@ -56,8 +58,8 @@ export default function BoardDocuments({
       const fileType = response.headers.get('content-type')
       const file = response.data
       download(file, fileType, documentName)
-    } catch (error) {
-      console.error(error, 'ERROR WHILE FETCHING DOCUMENT')
+    } catch (e) {
+      error('ERROR WHILE FETCHING DOCUMENT', '', e as LogData)
     }
   }
 
diff --git a/src/components/pages/AdminBoardDetail/components/BoardHeader/index.tsx b/src/components/pages/AdminBoardDetail/components/BoardHeader/index.tsx
index 82082ef68..4a9d3bbb3 100644
--- a/src/components/pages/AdminBoardDetail/components/BoardHeader/index.tsx
+++ b/src/components/pages/AdminBoardDetail/components/BoardHeader/index.tsx
@@ -24,6 +24,7 @@ import { useTranslation } from 'react-i18next'
 import type { AppDetails } from 'features/apps/details/types'
 import { useFetchDocumentByIdMutation } from 'features/apps/apiSlice'
 import CommonService from 'services/CommonService'
+import { error } from 'services/LogService'
 import './BoardHeader.scss'
 import { Grid } from '@mui/material'
 
@@ -56,8 +57,8 @@ export default function BoardHeader({ item }: AppDetailHeaderProps) {
       }).unwrap()
       const file = response.data
       setImage(URL.createObjectURL(file))
-    } catch (error) {
-      console.log(error)
+    } catch (e) {
+      error(e as string)
     }
   }
 
diff --git a/src/components/pages/AppDetail/components/AppDetailDocuments/index.tsx b/src/components/pages/AppDetail/components/AppDetailDocuments/index.tsx
index 84037c92c..64ba14ff6 100644
--- a/src/components/pages/AppDetail/components/AppDetailDocuments/index.tsx
+++ b/src/components/pages/AppDetail/components/AppDetailDocuments/index.tsx
@@ -27,6 +27,8 @@ import { useFetchDocumentByIdMutation } from 'features/apps/apiSlice'
 import { download } from 'utils/downloadUtils'
 import '../../AppDetail.scss'
 import { DocumentTypeId } from 'features/appManagement/apiSlice'
+import { error } from 'services/NotifyService'
+import { type LogData } from 'services/LogService'
 
 export default function AppDetailDocuments({ item }: { item: AppDetails }) {
   const { t } = useTranslation()
@@ -45,8 +47,8 @@ export default function AppDetailDocuments({ item }: { item: AppDetails }) {
       const fileType = response.headers.get('content-type')
       const file = response.data
       download(file, fileType, documentName)
-    } catch (error) {
-      console.error(error, 'ERROR WHILE FETCHING DOCUMENT')
+    } catch (e) {
+      error('ERROR WHILE FETCHING DOCUMENT', '', e as LogData)
     }
   }
   return (
diff --git a/src/components/pages/AppDetail/components/AppDetailHeader/index.tsx b/src/components/pages/AppDetail/components/AppDetailHeader/index.tsx
index f2f41a6c1..a44d4acca 100644
--- a/src/components/pages/AppDetail/components/AppDetailHeader/index.tsx
+++ b/src/components/pages/AppDetail/components/AppDetailHeader/index.tsx
@@ -35,6 +35,7 @@ import { useEffect, useState } from 'react'
 import { SubscriptionStatus } from 'features/apps/types'
 import { useFetchDocumentByIdMutation } from 'features/apps/apiSlice'
 import CommonService from 'services/CommonService'
+import { error } from 'services/LogService'
 import type { UseCaseType } from 'features/appManagement/types'
 import type { RootState } from 'features/store'
 
@@ -176,8 +177,8 @@ export default function AppDetailHeader({ item }: AppDetailHeaderProps) {
       }).unwrap()
       const file = response.data
       setImage(URL.createObjectURL(file))
-    } catch (error) {
-      console.log(error)
+    } catch (e) {
+      error(e as string)
     }
   }
 
diff --git a/src/components/pages/AppMarketplace/components/FavoriteSection/FavoriteItem.tsx b/src/components/pages/AppMarketplace/components/FavoriteSection/FavoriteItem.tsx
index 02c391d62..812ef22bb 100644
--- a/src/components/pages/AppMarketplace/components/FavoriteSection/FavoriteItem.tsx
+++ b/src/components/pages/AppMarketplace/components/FavoriteSection/FavoriteItem.tsx
@@ -27,6 +27,8 @@ import { useDispatch } from 'react-redux'
 import CommonService from 'services/CommonService'
 import type { AppDispatch } from 'features/store'
 import { useFetchDocumentByIdMutation } from 'features/apps/apiSlice'
+import { error } from 'services/LogService'
+
 interface FavoriteItemProps {
   // Add an ESLint exception until there is a solution
   // eslint-disable-next-line
@@ -65,8 +67,8 @@ export default function FavoriteItem({
         documentId: id,
       }).unwrap()
       setCardImage(URL.createObjectURL(result.data))
-    } catch (error) {
-      console.log(error)
+    } catch (e) {
+      error(e as string)
     }
   }
 
diff --git a/src/components/pages/AppOverview/AddRolesOverlay.tsx b/src/components/pages/AppOverview/AddRolesOverlay.tsx
index 269916f6c..a91767958 100644
--- a/src/components/pages/AppOverview/AddRolesOverlay.tsx
+++ b/src/components/pages/AppOverview/AddRolesOverlay.tsx
@@ -41,6 +41,7 @@ import { useState } from 'react'
 import { useUpdateActiveAppMutation } from 'features/appManagement/apiSlice'
 import { useNavigate } from 'react-router-dom'
 import { error, success } from 'services/NotifyService'
+import { info } from 'services/LogService'
 
 interface AddRolesOverlayProps {
   openDialog: boolean
@@ -79,10 +80,10 @@ const AddRolesOverlay = ({
       .forEach((file: File) => {
         const reader = new FileReader()
         reader.onerror = () => {
-          console.log('file reading has failed')
+          info('file reading has failed')
         }
         reader.onabort = () => {
-          console.log('file reading was aborted')
+          info('file reading was aborted')
         }
         reader.onload = () => {
           const str = reader.result
diff --git a/src/components/pages/AppOverview/AppOverViewDetails.tsx b/src/components/pages/AppOverview/AppOverViewDetails.tsx
index da9ae5a73..982664af0 100644
--- a/src/components/pages/AppOverview/AppOverViewDetails.tsx
+++ b/src/components/pages/AppOverview/AppOverViewDetails.tsx
@@ -38,6 +38,8 @@ import {
 } from 'features/appManagement/types'
 import CommonValidateAndPublish from 'components/shared/basic/ReleaseProcess/components/CommonValidateAndPublish'
 import { useFetchDocumentByIdMutation } from 'features/apps/apiSlice'
+import { type LogData } from 'services/LogService'
+import { error } from 'services/NotifyService'
 
 export default function AppOverViewDetails({
   item,
@@ -100,8 +102,8 @@ export default function AppOverViewDetails({
         }).unwrap()
         const file = response.data
         setCardImage(URL.createObjectURL(file))
-      } catch (error) {
-        console.error(error, 'ERROR WHILE FETCHING IMAGE')
+      } catch (e) {
+        error('ERROR WHILE FETCHING IMAGE', '', e as LogData)
       }
     },
     [fetchDocumentById, id]
diff --git a/src/components/pages/AppSubscription/ActivateSubscriptionOverlay/index.tsx b/src/components/pages/AppSubscription/ActivateSubscriptionOverlay/index.tsx
index 10182e211..bf302757a 100644
--- a/src/components/pages/AppSubscription/ActivateSubscriptionOverlay/index.tsx
+++ b/src/components/pages/AppSubscription/ActivateSubscriptionOverlay/index.tsx
@@ -47,6 +47,8 @@ import { setSuccessType } from 'features/appSubscription/slice'
 import { Link } from 'react-router-dom'
 import { closeOverlay } from 'features/control/overlay'
 import { useFetchTechnicalUserProfilesQuery } from 'features/appManagement/apiSlice'
+import { type LogData } from 'services/LogService'
+import { error } from 'services/NotifyService'
 
 const TentantHelpURL =
   '/documentation/?path=user%2F04.+App%28s%29%2F05.+App+Subscription%2F04.+Subscription+Activation+%28App+Provider%29.md'
@@ -100,8 +102,8 @@ const ActivateSubscriptionOverlay = ({
         offerUrl: inputURL,
       }).unwrap()
       setActivationResponse(subscriptionData)
-    } catch (error) {
-      console.log(error)
+    } catch (e) {
+      error('ERROR WHILE ADDING USER SUBSCRIPTION', '', e as LogData)
     }
     setLoading(false)
   }
diff --git a/src/components/pages/CompanySubscriptions/CompanySubscriptionsTableColumns.tsx b/src/components/pages/CompanySubscriptions/CompanySubscriptionsTableColumns.tsx
index 87029a91f..f55dd26d5 100644
--- a/src/components/pages/CompanySubscriptions/CompanySubscriptionsTableColumns.tsx
+++ b/src/components/pages/CompanySubscriptions/CompanySubscriptionsTableColumns.tsx
@@ -31,6 +31,7 @@ import {
 } from 'features/apps/types'
 import { getApiBase } from 'services/EnvironmentService'
 import { fetchImageWithToken } from 'services/ImageService'
+import { info } from 'services/LogService'
 import { PAGES } from 'types/Constants'
 import { useNavigate } from 'react-router'
 import CheckCircleOutlineIcon from '@mui/icons-material/CheckCircleOutline'
@@ -169,7 +170,7 @@ export const CompanySubscriptionsTableColumns = (
             sx={{ textTransform: 'none' }}
             onClick={(e) => {
               handleOverlay?.(row, true)
-              console.log('row.offerId', row.offerId)
+              info('row.offerId', row.offerId)
               e.stopPropagation()
             }}
           >
diff --git a/src/components/pages/IDPManagement/IDPList.tsx b/src/components/pages/IDPManagement/IDPList.tsx
index 15c75cf8b..05942049e 100644
--- a/src/components/pages/IDPManagement/IDPList.tsx
+++ b/src/components/pages/IDPManagement/IDPList.tsx
@@ -34,6 +34,7 @@ import {
 import IDPStateProgress from './IDPStateProgress'
 import { show } from 'features/control/overlay'
 import { OVERLAYS } from 'types/Constants'
+import LogService from 'services/LogService'
 import { error, success } from 'services/NotifyService'
 import {
   type IdentityProvider,
@@ -65,8 +66,8 @@ const MenuItemOpenOverlay = ({
     try {
       e.stopPropagation()
       dispatch(show(overlay, id))
-    } catch (error) {
-      console.log(error)
+    } catch (e) {
+      LogService.error(e as string)
     }
   }
 
diff --git a/src/components/pages/InviteBusinessPartner/components/InviteList/index.tsx b/src/components/pages/InviteBusinessPartner/components/InviteList/index.tsx
index 4bb369ccb..5eb209119 100644
--- a/src/components/pages/InviteBusinessPartner/components/InviteList/index.tsx
+++ b/src/components/pages/InviteBusinessPartner/components/InviteList/index.tsx
@@ -33,6 +33,7 @@ import dayjs from 'dayjs'
 import { setSearchInput } from 'features/appManagement/actions'
 import { updateInviteSelector } from 'features/control/updates'
 import { isCompanyName } from 'types/Patterns'
+import { info } from 'services/LogService'
 
 interface FetchHookArgsType {
   expr: string
@@ -127,7 +128,7 @@ export const InviteList = ({
                 disabled={true}
                 color="secondary"
                 onClick={() => {
-                  console.log('on details click: Company Name', row.companyName)
+                  info('on details click: Company Name', row.companyName)
                 }}
               >
                 
diff --git a/src/components/pages/NotificationCenter/NotificationItem.tsx b/src/components/pages/NotificationCenter/NotificationItem.tsx
index 60bd90892..5a1c7dbdc 100644
--- a/src/components/pages/NotificationCenter/NotificationItem.tsx
+++ b/src/components/pages/NotificationCenter/NotificationItem.tsx
@@ -32,6 +32,7 @@ import {
 import { useState } from 'react'
 import { Trans, useTranslation } from 'react-i18next'
 import { NavLink } from 'react-router-dom'
+import { info } from 'services/LogService'
 import UserService from 'services/UserService'
 import relativeTime from 'dayjs/plugin/relativeTime'
 import './Notifications.scss'
@@ -256,7 +257,7 @@ export default function NotificationItem({
       item.isRead = flag
       setUserRead(flag)
     } catch (error: unknown) {
-      console.log(error)
+      info(error as string)
     }
   }
 
diff --git a/src/components/pages/OSPConsent/CompanyDetails.tsx b/src/components/pages/OSPConsent/CompanyDetails.tsx
index c5348b7cd..f6c0d8b45 100644
--- a/src/components/pages/OSPConsent/CompanyDetails.tsx
+++ b/src/components/pages/OSPConsent/CompanyDetails.tsx
@@ -40,6 +40,8 @@ import { getApiBase } from 'services/EnvironmentService'
 import UserService from 'services/UserService'
 import { download } from 'utils/downloadUtils'
 import './style.scss'
+import { type LogData } from 'services/LogService'
+import { error } from 'services/NotifyService'
 
 interface CompanyDetailsProps {
   applicationId: string
@@ -129,27 +131,24 @@ export const CompanyDetails = ({
 
   const handleDownloadClick = (documentId: string, documentName: string) => {
     if (!documentId) return
-    try {
-      fetch(
-        `${getApiBase()}/api/registration/registrationDocuments/${documentId}`,
-        {
-          method: 'GET',
-          headers: {
-            authorization: `Bearer ${UserService.getToken()}`,
-          },
-        }
-      )
-        .then(async (res) => {
-          const fileType = res.headers.get('content-type') ?? ''
-          const file = await res.blob()
-          download(file, fileType, documentName)
-        })
-        .catch((error) => {
-          console.log(error)
-        })
-    } catch (error) {
-      console.error(error, 'ERROR WHILE FETCHING DOCUMENT')
-    }
+
+    fetch(
+      `${getApiBase()}/api/registration/registrationDocuments/${documentId}`,
+      {
+        method: 'GET',
+        headers: {
+          authorization: `Bearer ${UserService.getToken()}`,
+        },
+      }
+    )
+      .then(async (res) => {
+        const fileType = res.headers.get('content-type') ?? ''
+        const file = await res.blob()
+        download(file, fileType, documentName)
+      })
+      .catch((e) => {
+        error('ERROR WHILE FETCHING DOCUMENT', '', e as LogData)
+      })
   }
 
   const renderTermsText = (agreement: AgreementData) => {
diff --git a/src/components/pages/SemanticHub/ModelDetailDialog.tsx b/src/components/pages/SemanticHub/ModelDetailDialog.tsx
index 1da6962d7..3efcb1cf1 100644
--- a/src/components/pages/SemanticHub/ModelDetailDialog.tsx
+++ b/src/components/pages/SemanticHub/ModelDetailDialog.tsx
@@ -50,6 +50,7 @@ import {
 import UserService from 'services/UserService'
 import { ROLES } from 'types/Constants'
 import { getSemanticApiBase } from 'services/EnvironmentService'
+import { info } from 'services/LogService'
 import { getHeaders } from 'services/RequestService'
 import { Status } from 'features/semanticModels/types'
 import type { AppDispatch } from 'features/store'
@@ -110,7 +111,7 @@ const ModelDetailDialog = ({ show, onClose }: ModelDetailDialogProps) => {
           }
         })
         .catch((err) => {
-          console.log(err)
+          info(err)
         })
       setShowDeleteBtn(
         UserService.hasRole(ROLES.SEMANTICHUB_DELETE) &&
diff --git a/src/components/pages/ServiceAdminBoardDetail/index.tsx b/src/components/pages/ServiceAdminBoardDetail/index.tsx
index 356680a28..bc3abed11 100644
--- a/src/components/pages/ServiceAdminBoardDetail/index.tsx
+++ b/src/components/pages/ServiceAdminBoardDetail/index.tsx
@@ -42,6 +42,8 @@ import { Grid, Box, Divider } from '@mui/material'
 import { download } from 'utils/downloadUtils'
 import { DocumentTypeText } from 'features/apps/types'
 import { DocumentTypeId } from 'features/appManagement/apiSlice'
+import { type LogData } from 'services/LogService'
+import { error } from 'services/NotifyService'
 
 enum TableData {
   SUCCESS = 'SUCCESS',
@@ -87,8 +89,8 @@ export default function ServiceAdminBoardDetail() {
       const fileType = response.headers.get('content-type')
       const file = response.data
       download(file, fileType, item.documentName)
-    } catch (error) {
-      console.error(error, 'ERROR WHILE FETCHING DOCUMENT')
+    } catch (e) {
+      error('ERROR WHILE FETCHING DOCUMENT', '', e as LogData)
     }
   }
 
diff --git a/src/components/pages/ServiceMarketplaceDetail/components/MarketplaceDocuments/index.tsx b/src/components/pages/ServiceMarketplaceDetail/components/MarketplaceDocuments/index.tsx
index 8725f5f85..49154662f 100644
--- a/src/components/pages/ServiceMarketplaceDetail/components/MarketplaceDocuments/index.tsx
+++ b/src/components/pages/ServiceMarketplaceDetail/components/MarketplaceDocuments/index.tsx
@@ -29,6 +29,8 @@ import type {
 } from 'features/serviceMarketplace/serviceApiSlice'
 import { useFetchDocumentMutation } from 'features/serviceManagement/apiSlice'
 import { DocumentTypeId } from 'features/appManagement/apiSlice'
+import { type LogData } from 'services/LogService'
+import { error } from 'services/NotifyService'
 
 export default function MarketplaceDocuments({
   item,
@@ -51,8 +53,8 @@ export default function MarketplaceDocuments({
       const fileType = response.headers.get('content-type')
       const file = response.data
       download(file, fileType, documentName)
-    } catch (error) {
-      console.error(error, 'ERROR WHILE FETCHING DOCUMENT')
+    } catch (e) {
+      error('ERROR WHILE FETCHING DOCUMENT', '', e as LogData)
     }
   }
 
diff --git a/src/components/pages/ServiceReleaseProcess/components/ServiceDetails.tsx b/src/components/pages/ServiceReleaseProcess/components/ServiceDetails.tsx
index 19063b0bd..c34a82c91 100644
--- a/src/components/pages/ServiceReleaseProcess/components/ServiceDetails.tsx
+++ b/src/components/pages/ServiceReleaseProcess/components/ServiceDetails.tsx
@@ -40,6 +40,8 @@ import { download } from 'utils/downloadUtils'
 import { getAssetBase } from 'services/EnvironmentService'
 import { type DocumentData } from 'features/apps/types'
 import { DocumentTypeId } from 'features/appManagement/apiSlice'
+import { type LogData } from 'services/LogService'
+import { error } from 'services/NotifyService'
 
 export default function ServiceDetails() {
   const { t } = useTranslation('servicerelease')
@@ -72,8 +74,8 @@ export default function ServiceDetails() {
       const fileType = response.headers.get('content-type')
       const file = response.data
       download(file, fileType, item.documentName)
-    } catch (error) {
-      console.error(error, 'ERROR WHILE FETCHING DOCUMENT')
+    } catch (e) {
+      error('ERROR WHILE FETCHING DOCUMENT', '', e as LogData)
     }
   }
 
diff --git a/src/components/pages/Test/index.dropzone.tsx b/src/components/pages/Test/index.dropzone.tsx
index 1165d2796..9dc21ae93 100644
--- a/src/components/pages/Test/index.dropzone.tsx
+++ b/src/components/pages/Test/index.dropzone.tsx
@@ -90,7 +90,7 @@ export default function Test() {
           acceptFormat={{ 'application/json': [] }}
           maxFilesToUpload={20}
         />
-        
+        
       
       
diff --git a/src/components/shared/basic/ReleaseProcess/AppMarketCard/index.tsx b/src/components/shared/basic/ReleaseProcess/AppMarketCard/index.tsx index efee886a8..02d320270 100644 --- a/src/components/shared/basic/ReleaseProcess/AppMarketCard/index.tsx +++ b/src/components/shared/basic/ReleaseProcess/AppMarketCard/index.tsx @@ -74,6 +74,8 @@ import { type UseCaseType, } from 'features/appManagement/types' import { useFetchDocumentByIdMutation } from 'features/apps/apiSlice' +import { error } from 'services/NotifyService' +import { type LogData } from 'services/LogService' type FormDataType = { title: string @@ -286,9 +288,9 @@ export default function AppMarketCard() { const file = response.data setFileStatus(documentId, documentName, UploadStatus.UPLOAD_SUCCESS) setCardImage(URL.createObjectURL(file)) - } catch (error) { + } catch (e) { setFileStatus(documentId, documentName, UploadStatus.UPLOAD_SUCCESS) - console.error(error, 'ERROR WHILE FETCHING IMAGE') + error('ERROR WHILE FETCHING IMAGE', '', e as LogData) } } diff --git a/src/components/shared/basic/ReleaseProcess/OfferCard/index.tsx b/src/components/shared/basic/ReleaseProcess/OfferCard/index.tsx index c41657f6d..f4abbf37f 100644 --- a/src/components/shared/basic/ReleaseProcess/OfferCard/index.tsx +++ b/src/components/shared/basic/ReleaseProcess/OfferCard/index.tsx @@ -63,6 +63,7 @@ import { } from 'features/serviceManagement/actions' import { ButtonLabelTypes } from '..' import RetryOverlay from '../components/RetryOverlay' +import { type LogData } from 'services/LogService' import { success, error } from 'services/NotifyService' import { DocumentTypeId } from 'features/appManagement/apiSlice' import { PAGES } from 'types/Constants' @@ -172,8 +173,8 @@ export default function OfferCard() { id: documentId, status: UploadStatus.UPLOAD_SUCCESS, }) - } catch (error) { - console.error(error, 'ERROR WHILE FETCHING IMAGE') + } catch (e) { + error('ERROR WHILE FETCHING IMAGE', '', e as LogData) } }, [fetchDocumentById, serviceId, setValue] diff --git a/src/components/shared/basic/ReleaseProcess/components/CommonContractAndConsent.tsx b/src/components/shared/basic/ReleaseProcess/components/CommonContractAndConsent.tsx index 99ed1c767..5f36f2c91 100644 --- a/src/components/shared/basic/ReleaseProcess/components/CommonContractAndConsent.tsx +++ b/src/components/shared/basic/ReleaseProcess/components/CommonContractAndConsent.tsx @@ -63,6 +63,7 @@ import { serviceReleaseStepDecrement, } from 'features/serviceManagement/slice' import { ButtonLabelTypes } from '..' +import { type LogData } from 'services/LogService' import { error, success } from 'services/NotifyService' type AgreementDataType = { @@ -419,8 +420,8 @@ export default function CommonContractAndConsent({ const file = response.data download(file, fileType, documentName) - } catch (error) { - console.error(error, 'ERROR WHILE FETCHING DOCUMENT') + } catch (e) { + error('ERROR WHILE FETCHING DOCUMENT', '', e as LogData) } } @@ -436,8 +437,8 @@ export default function CommonContractAndConsent({ const file = response.data download(file, fileType, documentName) - } catch (error) { - console.error(error, 'ERROR WHILE FETCHING DOCUMENT') + } catch (e) { + error('ERROR WHILE FETCHING DOCUMENT', '', e as LogData) } } diff --git a/src/components/shared/basic/ReleaseProcess/components/CommonValidateAndPublish.tsx b/src/components/shared/basic/ReleaseProcess/components/CommonValidateAndPublish.tsx index 2e7597e70..b9a5b9320 100644 --- a/src/components/shared/basic/ReleaseProcess/components/CommonValidateAndPublish.tsx +++ b/src/components/shared/basic/ReleaseProcess/components/CommonValidateAndPublish.tsx @@ -69,6 +69,8 @@ import { PrivacyPolicyType } from 'features/adminBoard/adminBoardApiSlice' import { Apartment, Person, LocationOn, Web, Info } from '@mui/icons-material' import '../../../../pages/AppDetail/components/AppDetailPrivacy/AppDetailPrivacy.scss' import 'components/styles/document.scss' +import { type LogData } from 'services/LogService' +import NotifyService from 'services/NotifyService' export interface DefaultValueType { images: Array @@ -158,8 +160,8 @@ export default function CommonValidateAndPublish({ }).unwrap() const file = response.data setCardImage(URL.createObjectURL(file)) - } catch (error) { - console.error(error, 'ERROR WHILE FETCHING IMAGE') + } catch (e) { + NotifyService.error('ERROR WHILE FETCHING IMAGE', '', e as LogData) } }, [fetchDocumentById, id] @@ -204,8 +206,8 @@ export default function CommonValidateAndPublish({ const file = response.data download(file, fileType, documentName) - } catch (error) { - console.error(error, 'ERROR WHILE FETCHING DOCUMENT') + } catch (e) { + NotifyService.error('ERROR WHILE FETCHING DOCUMENT', '', e as LogData) } } diff --git a/src/features/admin/registration/actions.ts b/src/features/admin/registration/actions.ts index d62f88958..f63087ad3 100644 --- a/src/features/admin/registration/actions.ts +++ b/src/features/admin/registration/actions.ts @@ -22,14 +22,15 @@ import { createAsyncThunk, createAction } from '@reduxjs/toolkit' import { Api } from './api' import { name } from './types' import type { SearchParams } from '../../connector/types' +import { error, type LogData } from 'services/LogService' const fetchRegistrationRequests = createAsyncThunk( `${name}/fetchRegistrationRequests`, async ({ params }: { params: SearchParams }) => { try { await Api.getInstance().getRegistrationRequests(params) - } catch (error: unknown) { - console.error('api call error:', error) + } catch (e: unknown) { + error('api call error:', e as LogData) throw Error(`${name}/fetchRegistrationRequests error`) } } @@ -40,8 +41,8 @@ const fetchCompanyDetail = createAsyncThunk( async (applicationId: string) => { try { return await Api.getInstance().getCompanyDetail(applicationId) - } catch (error: unknown) { - console.error('api call error:', error) + } catch (e: unknown) { + error('api call error:', e as LogData) throw Error(`${name}/fetchCompanyDetail error`) } } diff --git a/src/features/admin/userDeprecated/actions.ts b/src/features/admin/userDeprecated/actions.ts index 2e401b308..67e82c573 100644 --- a/src/features/admin/userDeprecated/actions.ts +++ b/src/features/admin/userDeprecated/actions.ts @@ -23,6 +23,7 @@ import type { GridRowId } from '@mui/x-data-grid' import { Api } from './api' import { type AddUser, name } from './types' import type { IHashMap } from 'types/MainTypes' +import { error, type LogData } from 'services/LogService' const openAdd = createAction(`${name}/openAdd`) const closeAdd = createAction(`${name}/closeAdd`) @@ -37,8 +38,8 @@ const addTenantUsers = createAsyncThunk( async (users: AddUser[]) => { try { return await Api.getInstance().addTenantUsers(users) - } catch (error: unknown) { - console.error('api call error:', error) + } catch (e: unknown) { + error('api call error:', e as LogData) throw Error(`${name}/add error`) } } @@ -47,8 +48,8 @@ const addTenantUsers = createAsyncThunk( const fetchTenantUsers = createAsyncThunk(`${name}/fetch`, async () => { try { return await Api.getInstance().getTenantUsers() - } catch (error: unknown) { - console.error('api call error:', error) + } catch (e: unknown) { + error('api call error:', e as LogData) throw Error(`${name}/fetch error`) } }) diff --git a/src/features/admin/userOwn/actions.ts b/src/features/admin/userOwn/actions.ts index fb47be65c..a2f8099c4 100644 --- a/src/features/admin/userOwn/actions.ts +++ b/src/features/admin/userOwn/actions.ts @@ -21,12 +21,13 @@ import { createAsyncThunk } from '@reduxjs/toolkit' import { Api } from './api' import { name } from './types' +import { error, type LogData } from 'services/LogService' const fetchOwn = createAsyncThunk(`${name}/fetchOwn`, async () => { try { return await Api.getInstance().getUserOwn() - } catch (error: unknown) { - console.error('api call error:', error) + } catch (e: unknown) { + error('api call error:', e as LogData) throw Error(`${name}/fetchOwn error`) } }) @@ -36,8 +37,8 @@ const fetchAny = createAsyncThunk( async (companyUserId: string) => { try { return await Api.getInstance().getUserInfo(companyUserId) - } catch (error: unknown) { - console.error('api call error:', error) + } catch (e: unknown) { + error('api call error:', e as LogData) throw Error(`${name}/fetchAny error`) } } diff --git a/src/features/appManagement/apiSlice.ts b/src/features/appManagement/apiSlice.ts index ce73a8bbf..958aa14b3 100644 --- a/src/features/appManagement/apiSlice.ts +++ b/src/features/appManagement/apiSlice.ts @@ -327,7 +327,7 @@ export const apiSlice = createApi({ url: `${getSsiBase()}/api/credential/documents/${documentId}`, responseHandler: async (response) => ({ headers: response.headers, - data: await response.blob(), + data: response.ok ? await response.blob() : await response.json(), }), }), }), @@ -339,7 +339,7 @@ export const apiSlice = createApi({ url: `/api/administration/documents/frameDocuments/${documentId}`, responseHandler: async (response) => ({ headers: response.headers, - data: await response.blob(), + data: response.ok ? await response.blob() : await response.json(), }), }), }), diff --git a/src/features/apps/apiSlice.ts b/src/features/apps/apiSlice.ts index 6a686c987..92822c537 100644 --- a/src/features/apps/apiSlice.ts +++ b/src/features/apps/apiSlice.ts @@ -124,7 +124,7 @@ export const apiSlice = createApi({ url: `/api/apps/${data.appId}/appDocuments/${data.documentId}`, responseHandler: async (response) => ({ headers: response.headers, - data: await response.blob(), + data: response.ok ? await response.blob() : await response.json(), }), }), }), diff --git a/src/features/apps/details/actions.ts b/src/features/apps/details/actions.ts index adedfb149..567fff106 100644 --- a/src/features/apps/details/actions.ts +++ b/src/features/apps/details/actions.ts @@ -21,12 +21,13 @@ import { createAsyncThunk } from '@reduxjs/toolkit' import { Api } from './api' import { name } from './types' +import { error, type LogData } from 'services/LogService' const fetch = createAsyncThunk(`${name}/fetch`, async (appId: string) => { try { return await Api.getInstance().getItem(appId) - } catch (error: unknown) { - console.error('api call error:', error) + } catch (e: unknown) { + error('api call error:', e as LogData) throw Error(`${name}/fetch api call error`) } }) diff --git a/src/features/apps/favorites/actions.ts b/src/features/apps/favorites/actions.ts index 6507ef6c7..75e590f66 100644 --- a/src/features/apps/favorites/actions.ts +++ b/src/features/apps/favorites/actions.ts @@ -21,12 +21,13 @@ import { createAsyncThunk } from '@reduxjs/toolkit' import { Api } from './api' import { name } from './types' +import { error, type LogData } from 'services/LogService' const fetchItems = createAsyncThunk(`${name}/fetch`, async () => { try { return await Api.getInstance().getItems() - } catch (error: unknown) { - console.error('api call error:', error) + } catch (e: unknown) { + error('api call error:', e as LogData) throw Error(`${name}/fetch api call error`) } }) @@ -34,8 +35,8 @@ const fetchItems = createAsyncThunk(`${name}/fetch`, async () => { const addItem = createAsyncThunk(`${name}/add`, async (id: string) => { try { return await Api.getInstance().putItem(id) - } catch (error: unknown) { - console.error('api call error:', error) + } catch (e: unknown) { + error('api call error:', e as LogData) throw Error(`${name}/add api call error`) } }) @@ -43,8 +44,8 @@ const addItem = createAsyncThunk(`${name}/add`, async (id: string) => { const removeItem = createAsyncThunk(`${name}/remove`, async (id: string) => { try { return await Api.getInstance().deleteItem(id) - } catch (error: unknown) { - console.error('api call error:', error) + } catch (e: unknown) { + error('api call error:', e as LogData) throw Error(`${name}/remove api call error`) } }) diff --git a/src/features/apps/marketplaceDeprecated/actions.ts b/src/features/apps/marketplaceDeprecated/actions.ts index 7a3a13816..772667adf 100644 --- a/src/features/apps/marketplaceDeprecated/actions.ts +++ b/src/features/apps/marketplaceDeprecated/actions.ts @@ -21,12 +21,13 @@ import { createAsyncThunk } from '@reduxjs/toolkit' import { Api } from './api' import { name } from './types' +import { error, type LogData } from 'services/LogService' const fetchActive = createAsyncThunk(`${name}/active/fetch`, async () => { try { return await Api.getInstance().getActive() - } catch (error: unknown) { - console.error('api call error:', error) + } catch (e: unknown) { + error('api call error:', e as LogData) throw Error(`${name}/active/fetch error`) } }) @@ -34,8 +35,8 @@ const fetchActive = createAsyncThunk(`${name}/active/fetch`, async () => { const fetchLatest = createAsyncThunk(`${name}/latest/fetch`, async () => { try { return await Api.getInstance().getLatest() - } catch (error: unknown) { - console.error('api call error:', error) + } catch (e: unknown) { + error('api call error:', e as LogData) throw Error(`${name}/latest/fetch error`) } }) @@ -45,8 +46,8 @@ const fetchSubscriptionStatus = createAsyncThunk( async () => { try { return await Api.getInstance().getSubscriptionStatus() - } catch (error: unknown) { - console.error('api call error:', error) + } catch (e: unknown) { + error('api call error:', e as LogData) throw Error(`${name}/subscribed/subscription-status error`) } } diff --git a/src/features/connector/actions.ts b/src/features/connector/actions.ts index e614fe6a1..771b459aa 100644 --- a/src/features/connector/actions.ts +++ b/src/features/connector/actions.ts @@ -22,6 +22,7 @@ import { createAsyncThunk } from '@reduxjs/toolkit' import { ConnectorApi } from './api' import type { SearchParams } from 'types/MainTypes' import type { ConnectorCreateBody } from './types' +import { error, type LogData } from 'services/LogService' const fetchConnectors = createAsyncThunk( 'connector/fetchConnectors', @@ -29,8 +30,8 @@ const fetchConnectors = createAsyncThunk( try { // Call axios instance to get values return await ConnectorApi.getInstance().getAllConnector(params) - } catch (error: unknown) { - console.error('api call error:', error) + } catch (e: unknown) { + error('api call error:', e as LogData) throw Error('fetchConnectors api call error') } } @@ -53,8 +54,8 @@ const createConnector = createAsyncThunk( // Call axios instance to get values return await ConnectorApi.getInstance().createConnector(newConnectorBody) - } catch (error: unknown) { - console.error('api call error:', error) + } catch (e: unknown) { + error('api call error:', e as LogData) throw Error('createConnectors api call error') } } @@ -66,8 +67,8 @@ const deleteConnector = createAsyncThunk( try { // Call axios instance to get values return await ConnectorApi.getInstance().deleteConnector(connectorID) - } catch (error: unknown) { - console.error('api call error:', error) + } catch (e: unknown) { + error('api call error:', e as LogData) throw Error('deleteConnector api call error') } } diff --git a/src/features/info/news/actions.ts b/src/features/info/news/actions.ts index d56ffbdcb..13ee38a2e 100644 --- a/src/features/info/news/actions.ts +++ b/src/features/info/news/actions.ts @@ -21,12 +21,13 @@ import { createAsyncThunk } from '@reduxjs/toolkit' import { Api } from './api' import { name } from './types' +import { error, type LogData } from 'services/LogService' const fetchItems = createAsyncThunk(`${name}/fetch`, async () => { try { return await Api.getInstance().getItems() - } catch (error: unknown) { - console.error('api call error:', error) + } catch (e: unknown) { + error('api call error:', e as LogData) throw Error(`${name}/fetch error`) } }) diff --git a/src/features/info/search/actions.ts b/src/features/info/search/actions.ts index 3854fba58..77ebd32c5 100644 --- a/src/features/info/search/actions.ts +++ b/src/features/info/search/actions.ts @@ -46,6 +46,7 @@ import { hasAccessAction, hasAccessOverlay, } from 'services/AccessService' +import { error, type LogData } from 'services/LogService' import { initialPaginResult } from 'types/MainTypes' import type { AppMarketplaceApp } from 'features/apps/types' @@ -200,8 +201,8 @@ const fetchSearch = createAsyncThunk( ) .map((item: TenantUser) => userToSearchItem(item)), ].flat() - } catch (error: unknown) { - console.error('api call error:', error) + } catch (e: unknown) { + error('api call error:', e as LogData) throw Error(`${name}/fetch error`) } } diff --git a/src/features/partnerNetwork/actions.ts b/src/features/partnerNetwork/actions.ts index 7c31c6818..847df4419 100644 --- a/src/features/partnerNetwork/actions.ts +++ b/src/features/partnerNetwork/actions.ts @@ -21,6 +21,7 @@ import { createAsyncThunk } from '@reduxjs/toolkit' import type { SearchParams } from 'types/MainTypes' import { PartnerNetworkApi } from './api' +import { error, type LogData } from 'services/LogService' const fetchMemberCompaniesData = createAsyncThunk( 'partnerNetwork/fetchMemberCompaniesData', @@ -28,8 +29,8 @@ const fetchMemberCompaniesData = createAsyncThunk( try { // Call axios instance to get values return await PartnerNetworkApi.getInstance().getAllMemberCompanies() - } catch (error: unknown) { - console.error('api call error:', error) + } catch (e: unknown) { + error('api call error:', e as LogData) throw new Error('Error while fetching membership data') } } @@ -47,8 +48,8 @@ const fetchBusinessPartners = createAsyncThunk( } // Call axios instance to get values return await PartnerNetworkApi.getInstance().getAllBusinessPartner(params) - } catch (error: unknown) { - console.error('api call error:', error) + } catch (e: unknown) { + error('api call error:', e as LogData) throw Error('fetchBusinessPartners api call error') } } @@ -59,8 +60,8 @@ const getOneBusinessPartner = createAsyncThunk( try { // Call axios instance to get values return await PartnerNetworkApi.getInstance().getBusinessPartnerByBpn(bpn) - } catch (error: unknown) { - console.error('api call error:', error) + } catch (e: unknown) { + error('api call error:', e as LogData) throw Error('getOneBusinessPartner api call error') } } diff --git a/src/features/semanticModels/actions.ts b/src/features/semanticModels/actions.ts index 7f6b262bc..a6df7d2b0 100644 --- a/src/features/semanticModels/actions.ts +++ b/src/features/semanticModels/actions.ts @@ -21,6 +21,7 @@ import { createAsyncThunk } from '@reduxjs/toolkit' import { Api } from './api' import type { ErrorResponse, FilterParams, NewSemanticModel } from './types' +import { error, type LogData } from 'services/LogService' const message = 'The server responded with an error.' @@ -29,9 +30,9 @@ const fetchSemanticModels = createAsyncThunk( async ({ filter }: { filter: FilterParams }) => { try { return await Api.getInstance().getModels(filter) - } catch (error: unknown) { - console.error('api call error:', error) - throw Error(JSON.stringify((error as ErrorResponse).response.status)) + } catch (e: unknown) { + error('api call error:', e as LogData) + throw Error(JSON.stringify((e as ErrorResponse).response.status)) } } ) @@ -41,8 +42,8 @@ const fetchSemanticModelById = createAsyncThunk( async (id: string) => { try { return await Api.getInstance().getModelById(id) - } catch (error: unknown) { - console.error('api call error:', error) + } catch (e: unknown) { + error('api call error:', e as LogData) throw Error(`Fetching model failed: ${message}`) } } @@ -57,8 +58,8 @@ const deleteSemanticModelById = createAsyncThunk( return await Api.getInstance() .deleteModelById(encodedUrn) .then(() => id) - } catch (error: unknown) { - console.error('api call error:', error) + } catch (e: unknown) { + error('api call error:', e as LogData) throw Error(`Deleting model failed: ${message}`) } } @@ -69,8 +70,8 @@ const postSemanticModel = createAsyncThunk( async (model: NewSemanticModel) => { try { return await Api.getInstance().postSemanticModel(model) - } catch (error: unknown) { - console.error('api call error:', error) + } catch (e: unknown) { + error('api call error:', e as LogData) throw Error(`${error}. Adding a new model failed.`) } } @@ -81,8 +82,8 @@ const changeOpenApiUrl = createAsyncThunk( const { id, url } = params try { return await Api.getInstance().getOpenAPIUrl(id, url) - } catch (error: unknown) { - console.error('api call error:', error) + } catch (e: unknown) { + error('api call error:', e as LogData) throw Error('Change open API URL call error.') } } diff --git a/src/features/serviceManagement/apiSlice.ts b/src/features/serviceManagement/apiSlice.ts index b152590e0..454f6258a 100644 --- a/src/features/serviceManagement/apiSlice.ts +++ b/src/features/serviceManagement/apiSlice.ts @@ -258,7 +258,7 @@ export const apiSlice = createApi({ url: `/api/services/${obj.appId}/serviceDocuments/${obj.documentId}`, responseHandler: async (response) => ({ headers: response.headers, - data: await response.blob(), + data: response.ok ? await response.blob() : await response.json(), }), }), }), diff --git a/src/services/I18nService.ts b/src/services/I18nService.ts index 633ec8355..0941171cc 100644 --- a/src/services/I18nService.ts +++ b/src/services/I18nService.ts @@ -36,6 +36,7 @@ import servicereleaseEN from '../assets/locales/en/servicerelease.json' import registrationDE from '../assets/locales/de/registration.json' import registrationEN from '../assets/locales/en/registration.json' import type { NotificationType } from 'features/notification/types' +import { error } from './LogService' const resources = { de: { @@ -75,7 +76,7 @@ const init = (): void => { }, }) .catch((e) => { - console.error('Translation library init got error:', e) + error('Translation library init got error:', e) }) } From c2e78a033be39e25b48f7d21a1f1a69888339e0a Mon Sep 17 00:00:00 2001 From: charmi-v Date: Wed, 4 Sep 2024 10:37:54 +0530 Subject: [PATCH 3/3] chore: modified changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 03c339bd2..52c3f8937 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,8 @@ - Fixed 'activeTab' conditions to load data for Tab-2(Registration Process) [#1050](https://github.com/eclipse-tractusx/portal-frontend/pull/1050) - **App Release Process**: - Fixed role upload does not work using Firefox [#1003](https://github.com/eclipse-tractusx/portal-frontend/pull/1003) +- **Error Handling** + - Replaced logs with appropriate handler [#1072](https://github.com/eclipse-tractusx/portal-frontend/pull/1072) ## 2.2.0-RC2