diff --git a/CHANGELOG.md b/CHANGELOG.md index 3edbe6366..7296d3063 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ - **App Subscription Management** - fixed 'read more' link by adding link [#1200](https://github.com/eclipse-tractusx/portal-frontend/pull/1200) +- **Connector Management** + - do not show regular overlay when error detail is shown. refetch connector details to fix cache issue in the details overlay ### Feature @@ -20,9 +22,9 @@ ### Change - **Service Subscriptions** - - rename 'Configure' button to 'Activate' button [#1150](https://github.com/eclipse-tractusx/portal-frontend/pull/1150) - +- **Application Request** + - display appropriate document information in the company details overlay [#1223](https://github.com/eclipse-tractusx/portal-frontend/pull/1223) - **Header** - moved company roles into enum [#1213](https://github.com/eclipse-tractusx/portal-frontend/pull/1213) - **Application Request** diff --git a/src/components/pages/Admin/components/RegistrationRequests/CompanyDetailOverlay/index.tsx b/src/components/pages/Admin/components/RegistrationRequests/CompanyDetailOverlay/index.tsx index 9977b9e0d..2bb2b28ef 100644 --- a/src/components/pages/Admin/components/RegistrationRequests/CompanyDetailOverlay/index.tsx +++ b/src/components/pages/Admin/components/RegistrationRequests/CompanyDetailOverlay/index.tsx @@ -192,9 +192,10 @@ const CompanyDetailOverlay = ({ key: '', value: ( <> - {company?.documents && company.documents.length > 0 ? ( + {selectedCompany?.documents && + selectedCompany.documents.length > 0 ? ( <> - {company.documents.map( + {selectedCompany.documents.map( (contract: { documentId: string documentType: string diff --git a/src/components/pages/CompanyData/components/FormFields.tsx b/src/components/pages/CompanyData/components/FormFields.tsx index 6967dc1fa..dec7a74c8 100644 --- a/src/components/pages/CompanyData/components/FormFields.tsx +++ b/src/components/pages/CompanyData/components/FormFields.tsx @@ -274,8 +274,8 @@ export const FormFields = ({ countryCode: newForm ? '' : companyData.address.physicalPostalAddress.country, - countryIdentifier: newForm ? '' : (identifier?.[0]?.type ?? ''), - identifierNumber: newForm ? '' : (identifier?.[0]?.value ?? ''), + countryIdentifier: newForm ? '' : identifier?.[0]?.type ?? '', + identifierNumber: newForm ? '' : identifier?.[0]?.value ?? '', } const [formData, setFormData] = useState>( responseToForm(data) diff --git a/src/components/pages/EdcConnector/ConnectorDetailsOverlay.tsx b/src/components/pages/EdcConnector/ConnectorDetailsOverlay.tsx index cc8169467..9fd527059 100644 --- a/src/components/pages/EdcConnector/ConnectorDetailsOverlay.tsx +++ b/src/components/pages/EdcConnector/ConnectorDetailsOverlay.tsx @@ -274,260 +274,267 @@ const ConnectorDetailsOverlay = ({ )} - - - - {isFetching ? ( -
- -
- ) : ( - <> - - - {t( - 'content.edcconnector.details.configureYourConnectorDetails' - )} - - - - - - - {t('content.edcconnector.details.name')} - - } - value={fetchConnectorDetails?.name ?? ''} - disabled={true} - sx={{ mb: 2 }} - /> - - - - {t('content.edcconnector.details.url')} - - } - value={connectorUrlValue} - disabled={enableConnectorUrl} - onChange={(e) => { - validateURL(e.target.value) - }} - /> - - {urlErrorMsg} + + + {isFetching ? ( +
+ +
+ ) : ( + <> + + + {t( + 'content.edcconnector.details.configureYourConnectorDetails' + )} -
- - {}} + variant="outlined" size="small" - sx={{ - mt: 8, - }} - onClick={() => { - setEnableConnectorUrl(false) - setEnableUrlApiErrorMsg(false) - }} - disabled={!userHasPortalRole(ROLES.MODIFY_CONNECTORS)} + disabled > - + + + + + {t('content.edcconnector.details.name')} + + } + value={fetchConnectorDetails?.name ?? ''} + disabled={true} + sx={{ mb: 2 }} + /> + + + + {t('content.edcconnector.details.url')} + + } + value={connectorUrlValue} + disabled={enableConnectorUrl} + onChange={(e) => { + validateURL(e.target.value) }} /> - - - {!enableConnectorUrl && ( - <> - - {t('content.edcconnector.details.note')} - - - {t('content.edcconnector.details.noteDesc')} + + {urlErrorMsg} - + + { + setEnableConnectorUrl(false) + setEnableUrlApiErrorMsg(false) + }} + disabled={!userHasPortalRole(ROLES.MODIFY_CONNECTORS)} > - - {confirmLoading ? ( - { - // do nothing - }} - loading={confirmLoading} - label={t('global.actions.confirm')} - loadIndicator="Loading..." - /> - ) : ( - )} - - - )} -
- {enableUrlApiErrorMsg && ( - - {t('content.edcconnector.details.urlErrorMessage')} - - )} - - {detailsData.map((item) => { - return ( - { + // do nothing + }} + loading={confirmLoading} + label={t('global.actions.confirm')} + loadIndicator="Loading..." + /> + ) : ( + + )} + + + )} + + {enableUrlApiErrorMsg && ( + - - - {item.key} - - - - {item.key === - t('content.edcconnector.details.SdRegistration') ? ( - - - - ) : ( - + {t('content.edcconnector.details.urlErrorMessage')} + + )} + + {detailsData.map((item) => { + return ( + + - {item.value} + {item.key} - )} + + {item.key === + t('content.edcconnector.details.SdRegistration') ? ( + + + + ) : ( + + + {item.value} + + + )} + + ) + })} + + + + {t('content.edcconnector.details.SdDocument')} + + + + + {fetchConnectorDetails?.selfDescriptionDocumentId === + null ? ( + t('content.edcconnector.details.noDocumentAvailable') + ) : ( + + + + + )} + - ) - })} - - - - {t('content.edcconnector.details.SdDocument')} - - - - - {fetchConnectorDetails?.selfDescriptionDocumentId === - null ? ( - t('content.edcconnector.details.noDocumentAvailable') - ) : ( - - - - - )} - - - - - )} -
- - - -
+ + + )} + + + + + + )} ) } diff --git a/src/components/pages/EdcConnector/index.tsx b/src/components/pages/EdcConnector/index.tsx index a8cd76b83..0b4e91024 100644 --- a/src/components/pages/EdcConnector/index.tsx +++ b/src/components/pages/EdcConnector/index.tsx @@ -356,6 +356,7 @@ const EdcConnector = () => { { + setOverlayData(undefined) setOpenDetailsOverlay(false) }} overlayData={overlayData} diff --git a/src/features/admin/registration/types.ts b/src/features/admin/registration/types.ts index 121480d0e..dc543f9f7 100644 --- a/src/features/admin/registration/types.ts +++ b/src/features/admin/registration/types.ts @@ -20,6 +20,7 @@ import type { PaginResult } from '@catena-x/portal-shared-components' import { initialPaginResult, RequestState } from 'types/MainTypes' +import { type DocumentMapper } from '../applicationRequestApiSlice' export const name = 'admin/registration' @@ -63,6 +64,7 @@ export type CompanyDetail = { uniqueIds?: Array countryAlpha2Code?: string companyUser: Array + documents: Array } export type RegistrationRequestDocument = { diff --git a/src/features/info/search/actions.ts b/src/features/info/search/actions.ts index 9cac4187f..6c00e5aeb 100644 --- a/src/features/info/search/actions.ts +++ b/src/features/info/search/actions.ts @@ -175,8 +175,8 @@ const fetchSearch = createAsyncThunk( .filter((item: AppMarketplaceApp) => uuid ? searchExpr.exec(item.id) - : ((item.name && searchExpr.exec(item.name)) ?? - (item.provider && searchExpr.exec(item.provider))) + : (item.name && searchExpr.exec(item.name)) ?? + (item.provider && searchExpr.exec(item.provider)) ) .map((item: AppMarketplaceApp) => appToSearchItem(item)), // Add an ESLint exception until there is a solution @@ -193,11 +193,11 @@ const fetchSearch = createAsyncThunk( users.content .filter((item: TenantUser) => uuid - ? (searchExpr.exec(item.userEntityId) ?? - searchExpr.exec(item.companyUserId)) - : (searchExpr.exec(item.firstName) ?? + ? searchExpr.exec(item.userEntityId) ?? + searchExpr.exec(item.companyUserId) + : searchExpr.exec(item.firstName) ?? searchExpr.exec(item.lastName) ?? - searchExpr.exec(item.email)) + searchExpr.exec(item.email) ) .map((item: TenantUser) => userToSearchItem(item)), ].flat()