Skip to content

Commit

Permalink
fix(connector): show appropriate error component based on response st…
Browse files Browse the repository at this point in the history
…atus
  • Loading branch information
manojava-gk committed Jul 3, 2024
1 parent f9da8e1 commit 4eb610f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
- Page headers
- harmonization and standardization of page headers, added consistent headers and removed unused code
- Use scroll to top button from shared components
- Connect management details overlay
- Show appropriate error information to the user along with refetch button

## 2.0.0

Expand Down
25 changes: 23 additions & 2 deletions src/components/pages/EdcConnector/ConfigurationDetailsOverlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import {
type TableType,
Typography,
CircleProgress,
ErrorBar,
} from '@catena-x/portal-shared-components'
import { useFetchDecentralIdentityUrlsQuery } from 'features/connector/connectorApiSlice'
import './EdcConnector.scss'
Expand All @@ -45,7 +46,12 @@ const ConfigurationDetailsOverlay = ({
handleOverlayClose,
}: ConfigurationDetailsOverlayProps) => {
const { t } = useTranslation()
const { data, isFetching } = useFetchDecentralIdentityUrlsQuery()
const { data, isFetching, error, isError, refetch } =
useFetchDecentralIdentityUrlsQuery()

// To-Do fix the type issue with status and data from FetchBaseQueryError
// eslint-disable-next-line
const decentralIdentityUrlsError = error as any

const handleIconDisplay = (value: string | undefined) => {
if (value) return true
Expand Down Expand Up @@ -177,7 +183,22 @@ const ConfigurationDetailsOverlay = ({
</div>
) : (
<>
<StaticTable data={tableData} horizontal={true} />
{!isError ? (
<StaticTable data={tableData} horizontal={true} />
) : (
<ErrorBar
errorText={
decentralIdentityUrlsError.code !== 500
? t('error.description') +
' ' +
t('error.additionalDescription')
: t('error.errorBar')
}
showButton={decentralIdentityUrlsError.code === 500}
buttonText={t('error.tryAgain')}
handleButton={refetch}
/>
)}
<Typography
variant="label3"
sx={{
Expand Down

0 comments on commit 4eb610f

Please sign in to comment.