From 9598549d905a381a0469f58bf4c2597cc36b949b Mon Sep 17 00:00:00 2001 From: Manojava Koushik <111366021+manojava-gk@users.noreply.github.com> Date: Thu, 7 Nov 2024 22:50:24 +0530 Subject: [PATCH] fix(connector management): resolve cache issue in details overlay (#1251) https://github.com/eclipse-tractusx/portal-frontend/issues/1243 https://github.com/eclipse-tractusx/portal-frontend/issues/1244 --- .../EdcConnector/ConnectorDetailsOverlay.tsx | 465 +++++++++--------- src/components/pages/EdcConnector/index.tsx | 1 + 2 files changed, 237 insertions(+), 229 deletions(-) diff --git a/src/components/pages/EdcConnector/ConnectorDetailsOverlay.tsx b/src/components/pages/EdcConnector/ConnectorDetailsOverlay.tsx index cc8169467..36db8c12e 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}