Skip to content

Commit cbfd48d

Browse files
feat(Connector): added a view for provided connector (#1569)
eclipse-tractusx/portal-backend#1087
1 parent 75a312f commit cbfd48d

File tree

5 files changed

+80
-20
lines changed

5 files changed

+80
-20
lines changed

src/assets/locales/de/main.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,8 @@
603603
"sdDescription": "SD Registration",
604604
"sdRegistrationToolTip": "Das SD-Dokument ist noch nicht geladen. Dies könnte auf die Deaktivierung der SD-Fabrik zurückzuführen sein. Dieser Prozess wird so bald wie möglich vom CX-Administrator neu ausgelöst.",
605605
"hostCompanyName": "Host",
606-
"providerCompanyName": "Customer",
606+
"customerCompanyName": "Customer",
607+
"providerCompanyName": "Provider",
607608
"connectorUrl": "Connector-URL"
608609
},
609610
"details": {
@@ -673,6 +674,8 @@
673674
"tabletitle": "Owned Connectors",
674675
"managedtabletitle": "Managed Connectors",
675676
"noConnectorsMessage": "Derzeit sind keine Konnektoren vorhanden. Neue Konnektoren werden hier hinzugefügt, sobald diese hinzugefügt wurden.",
677+
"providedtabletitle": "Provided Connectors",
678+
"noProvidedConnectorsMessage": "Derzeit stellt Ihr Unternehmen Ihrem Kunden keinen Konnektor zur Verfügung.",
676679
"imagetext": "Connectoren kombiniert die Vorteile von IDS-Konnektoren (sichere und standardisierte Kommunikation, Kontrolle der Datennutzung) mit der Interoperabilität.",
677680
"addconnectorbutton": "Connector registrieren",
678681
"snackbar": {

src/assets/locales/en/main.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,8 @@
603603
"sdDescription": "SD Registration",
604604
"sdRegistrationToolTip": "The SD Document is not yet loaded. This could be due to the deactivation of the Sd Factory. This process will be retriggered as soon as possible by the CX Admin",
605605
"hostCompanyName": "Host",
606-
"providerCompanyName": "Customer",
606+
"customerCompanyName": "Customer",
607+
"providerCompanyName": "Provider",
607608
"connectorUrl": "Connector URL"
608609
},
609610
"details": {
@@ -673,6 +674,8 @@
673674
"tabletitle": "Owned Connectors",
674675
"managedtabletitle": "Managed Connectors",
675676
"noConnectorsMessage": "Currently there are no onboarded connectors existing. New registered connectors will get added here as soon as available.",
677+
"providedTableTitle": "Provided Connectors",
678+
"noProvidedConnectorsMessage": "Currently there are no connector provided by your company to your customer.",
676679
"imagetext": "The connector combines the benefits of IDS connectors (secure and standardized communication, data usage control) with the interoperability. To register your connector inside the network and create your connector self-description, please register your connector below.",
677680
"addconnectorbutton": "Register Connector",
678681
"snackbar": {
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/********************************************************************************
2+
* Copyright (c) 2025 Contributors to the Eclipse Foundation
3+
*
4+
* See the NOTICE file(s) distributed with this work for additional
5+
* information regarding copyright ownership.
6+
*
7+
* This program and the accompanying materials are made available under the
8+
* terms of the Apache License, Version 2.0 which is available at
9+
* https://www.apache.org/licenses/LICENSE-2.0.
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14+
* License for the specific language governing permissions and limitations
15+
* under the License.
16+
*
17+
* SPDX-License-Identifier: Apache-2.0
18+
********************************************************************************/
19+
20+
import type { GridColDef } from '@mui/x-data-grid'
21+
import { useTranslation } from 'react-i18next'
22+
23+
export const ProvidedConnectorTableColumns = (): Array<GridColDef> => {
24+
const { t } = useTranslation()
25+
26+
return [
27+
{
28+
field: 'hostCompanyName',
29+
headerName: t('content.edcconnector.columns.customerCompanyName'),
30+
flex: 1,
31+
sortable: false,
32+
disableColumnMenu: true,
33+
},
34+
]
35+
}

src/components/pages/EdcConnector/index.tsx

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ import {
4949
type ConnectorResponseBody,
5050
useFetchManagedConnectorsQuery,
5151
type ConnectorDetailsType,
52+
useFetchProvidedConnectorsQuery,
5253
} from 'features/connector/connectorApiSlice'
5354
import { ServerResponseOverlay } from 'components/overlays/ServerResponse'
5455
import ErrorOutlineIcon from '@mui/icons-material/ErrorOutline'
@@ -65,6 +66,7 @@ import ConnectorDetailsOverlay from './ConnectorDetailsOverlay'
6566
import AddCircleOutlineIcon from '@mui/icons-material/AddCircleOutline'
6667
import ArrowForwardIcon from '@mui/icons-material/ArrowForward'
6768
import { Box } from '@mui/material'
69+
import { ProvidedConnectorTableColumns } from './edcProvidedConnectorTableColumns'
6870

6971
const EdcConnector = () => {
7072
const { t } = useTranslation()
@@ -148,10 +150,13 @@ const EdcConnector = () => {
148150
const rawColumns = ConnectorTableColumns(onDelete) // Common col values for own and managed connectors
149151
let ownConnectorCols = OwnConnectorTableColumns() // unique col values from own connectors
150152
let managedConnectorCols = ManagedConnectorTableColumns() // unique col values from managed connectors
153+
let providedConnectorCols = ProvidedConnectorTableColumns() // unique col values from provided connectors
151154
ownConnectorCols.push(...rawColumns)
152155
ownConnectorCols = swap(ownConnectorCols, 2, 0) //swap position according to the design
153156
managedConnectorCols.push(...rawColumns)
154157
managedConnectorCols = swap(managedConnectorCols, 2, 0) //swap position according to the design
158+
providedConnectorCols.push(...rawColumns)
159+
providedConnectorCols = swap(providedConnectorCols, 2, 0) //swap position according to the design
155160

156161
const closeAndResetModalState = () => {
157162
setAddConnectorOverlayCurrentStep(0)
@@ -467,35 +472,24 @@ const EdcConnector = () => {
467472
<Tab
468473
icon={getTabIcon(1)}
469474
iconPosition="start"
470-
sx={{
471-
width: '100%',
472-
maxWidth: '550px',
473-
'&.Mui-selected': {
474-
borderBottom: '3px solid #0f71cb',
475-
},
476-
textTransform: 'none',
477-
display: 'inline-flex',
478-
}}
479475
label={t('content.edcconnector.tabletitle')}
480476
id={`simple-tab-${activeTab}`}
481477
aria-controls={`simple-tabpanel-${activeTab}`}
482478
/>
483479
<Tab
484480
icon={getTabIcon(2)}
485481
iconPosition="start"
486-
sx={{
487-
width: '100%',
488-
maxWidth: '550px',
489-
'&.Mui-selected': {
490-
borderBottom: '3px solid #0f71cb',
491-
},
492-
textTransform: 'none',
493-
display: 'inline-flex',
494-
}}
495482
label={t('content.edcconnector.managedtabletitle')}
496483
id={`simple-tab-${activeTab}`}
497484
aria-controls={`simple-tabpanel-${activeTab}`}
498485
/>
486+
<Tab
487+
icon={getTabIcon(3)}
488+
iconPosition="start"
489+
label={t('content.edcconnector.providedTableTitle')}
490+
id={`simple-tab-${activeTab}`}
491+
aria-controls={`simple-tabpanel-${activeTab}`}
492+
/>
499493
</Tabs>
500494
<TabPanel value={activeTab} index={0}>
501495
<div className="connector-table-container">
@@ -530,6 +524,23 @@ const EdcConnector = () => {
530524
/>
531525
</div>
532526
</TabPanel>
527+
<TabPanel value={activeTab} index={2}>
528+
<div className="connector-table-container">
529+
<PageLoadingTable<ConnectorResponseBody, unknown>
530+
toolbarVariant="premium"
531+
title={t('content.edcconnector.providedTableTitle')}
532+
loadLabel={t('global.actions.more')}
533+
fetchHook={useFetchProvidedConnectorsQuery}
534+
fetchHookRefresh={refresh}
535+
getRowId={(row: { [key: string]: string }) => row.id}
536+
columns={providedConnectorCols}
537+
noRowsMsg={t('content.edcconnector.noProvidedConnectorsMessage')}
538+
onCellClick={(params: GridCellParams) => {
539+
onTableCellClick(params)
540+
}}
541+
/>
542+
</div>
543+
</TabPanel>
533544
</Box>
534545
{response && (
535546
<ServerResponseOverlay

src/features/connector/connectorApiSlice.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,13 @@ export const apiSlice = createApi({
156156
query: (filters) =>
157157
`/api/administration/connectors/managed?page=${filters.page}&size=10`,
158158
}),
159+
fetchProvidedConnectors: builder.query<
160+
PaginResult<ConnectorResponseBody>,
161+
PaginFetchArgs
162+
>({
163+
query: (filters) =>
164+
`/api/administration/Connectors/provided?page=${filters.page}&size=10`,
165+
}),
159166
fetchOfferSubscriptions: builder.query<EdcSubscriptionsType[], void>({
160167
query: () => ({
161168
url: '/api/administration/Connectors/offerSubscriptions?connectorIdSet=false',
@@ -195,6 +202,7 @@ export const apiSlice = createApi({
195202
export const {
196203
useCreateConnectorMutation,
197204
useCreateManagedConnectorMutation,
205+
useFetchProvidedConnectorsQuery,
198206
useFetchConnectorDetailsQuery,
199207
useDeleteConnectorMutation,
200208
useFetchConnectorsQuery,

0 commit comments

Comments
 (0)