diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d398621e..7dafffac7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,6 +51,8 @@ - Service Subscription - UI Changes - Add filters +- Digital Twin + - Code clean up - Usermanagement - Bulk upload UI Changes - Service Marketplace diff --git a/public/testdata/appDetails.json b/public/testdata/appDetails.json deleted file mode 100644 index a11d78e9c..000000000 --- a/public/testdata/appDetails.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "id": "demo-1234", - "name": "Digital Twin Debugger", - "leadPictureURI": "https://catenaxdev003util.blob.core.windows.net/assets/apps/images/demo-1234/lead.jpg", - "providerURI": "", - "provider": "Catena-X", - "contactEmail": "some.user@catena-x.net", - "contactNumber": "+49 0123 45678", - "detailPictures": [""], - "useCases": ["Digital Twin"], - "languages": ["DE", "EN"], - "descriptionLong": "", - "price": "free to use", - "rating": 4.3, - "purchased": false, - "tags": ["digital twin", "debugger"] -} diff --git a/src/assets/locales/de/main.json b/src/assets/locales/de/main.json index bf8858581..4c485cca7 100644 --- a/src/assets/locales/de/main.json +++ b/src/assets/locales/de/main.json @@ -11,7 +11,6 @@ "appdetails": "App Details", "datamanagement": "Datenmanagement", "semantichub": "Semantische Modelle", - "digitaltwin": "Digitale Zwillinge", "connector": "Konnektor", "partnernetwork": "Partner Network", "account": "Mein CX Account", @@ -334,32 +333,6 @@ "nomodelText": "Die verwendete URN ist entweder falsch, oder das Modell existiert noch nicht." } }, - "digitaltwin": { - "table": { - "title": "Übersicht Digitale Zwillinge", - "searchfielddefaulttext": "Teile-Instanz-ID des Assets", - "norows": "Keine Daten mit der Teile-Instanz-ID {data} gefunden", - "columns": { - "idShort": "Name", - "sm_count": "Anzahl Submodelle", - "asset_count": "Anzahl Assets" - } - }, - "detail": { - "error": "FEHLER: Es gibt keine Details zu diesem Asset.", - "no_description": "Dieses Asset hat keine Beschreibung.", - "assetId": "Specific Asset IDs", - "submodel_endpoints": "Submodell Endpunkte:", - "semanticid": "Semantic ID:", - "key": "Schlüssel:", - "value": "Wert:", - "endpoints": "Endpunkte:", - "interface": "Schnittstelle:", - "protocol": "Protokoll:", - "protocol_version": "Protokoll Version:", - "protocol_endpoint": "Aspekt Endpunkt:" - } - }, "organization": { "company": { "title": "Firmendetails", diff --git a/src/assets/locales/en/main.json b/src/assets/locales/en/main.json index cbdb9ce1c..406584010 100644 --- a/src/assets/locales/en/main.json +++ b/src/assets/locales/en/main.json @@ -11,7 +11,6 @@ "appdetails": "App Details", "datamanagement": "Data Management", "semantichub": "Semantic Hub", - "digitaltwin": "Digital Twins", "partnernetwork": "Partner Network", "connector": "Connector", "account": "My CX Account", @@ -333,32 +332,6 @@ "nomodelText": "The used URN is either incorrect or the model does not yet exist." } }, - "digitaltwin": { - "table": { - "title": "Overview Digital Twins", - "searchfielddefaulttext": "Part Instance ID of the Asset", - "norows": "no data found with the part instance id value {data}", - "columns": { - "idShort": "Name", - "sm_count": "Submodel Count", - "asset_count": "Asset Count" - } - }, - "detail": { - "error": "ERROR: No twin data available.", - "no_description": "This asset has no description.", - "assetId": "Specific asset IDs", - "submodel_endpoints": "Submodel endpoints:", - "semanticid": "Semantic ID:", - "key": "Key:", - "value": "Value:", - "endpoints": "Endpoints:", - "interface": "Interface:", - "protocol": "Protocol:", - "protocol_version": "Protocol version:", - "protocol_endpoint": "Aspect Endpoint:" - } - }, "organization": { "company": { "title": "Company Details", diff --git a/src/components/pages/DigitalTwins/DigitalTwinDetailDialog.tsx b/src/components/pages/DigitalTwins/DigitalTwinDetailDialog.tsx deleted file mode 100644 index c5fecdbb8..000000000 --- a/src/components/pages/DigitalTwins/DigitalTwinDetailDialog.tsx +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2021, 2023 T-Systems International GmbH and BMW Group AG - * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ - -import { - Dialog, - DialogContent, - DialogHeader, -} from '@catena-x/portal-shared-components' -import { useSelector } from 'react-redux' -import { twinsSelector } from 'features/digitalTwins/slice' -import { TwinDetails } from './TwinDetails' -import { Box, useTheme, CircularProgress } from '@mui/material' - -interface TwinDialogProps { - show: boolean - onClose: () => void -} -const DigitalTwinDetailDialog = ({ show, onClose }: TwinDialogProps) => { - const { twin, loading } = useSelector(twinsSelector) - const theme = useTheme() - - return ( - - - - {twin && } - {loading && ( - - - - )} - - - ) -} - -export default DigitalTwinDetailDialog diff --git a/src/components/pages/DigitalTwins/DigitalTwinsTableColumns.tsx b/src/components/pages/DigitalTwins/DigitalTwinsTableColumns.tsx deleted file mode 100644 index 98e44aecf..000000000 --- a/src/components/pages/DigitalTwins/DigitalTwinsTableColumns.tsx +++ /dev/null @@ -1,75 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2021, 2023 T-Systems International GmbH and BMW Group AG - * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ - -import { GridColDef } from '@mui/x-data-grid' -import { IconButton } from '@catena-x/portal-shared-components' -import ArrowForwardIcon from '@mui/icons-material/ArrowForward' -import { ShellDescriptor } from 'features/digitalTwins/types' - -// Columns definitions of Digital Twin page Data Grid -export const DigitalTwinsTableColumns = ( - translationHook: any, - onDetailClick: (id: string) => void -): Array => { - const { t } = translationHook() - - return [ - { - field: 'idShort', - headerName: t('content.digitaltwin.table.columns.idShort'), - flex: 3, - filterable: false, - }, - { - field: 'sm_count', - headerName: t('content.digitaltwin.table.columns.sm_count'), - flex: 2, - filterable: false, - valueGetter: ({ row }: { row: ShellDescriptor }) => - row.submodelDescriptors.length, - }, - { - field: 'asset_count', - headerName: t('content.digitaltwin.table.columns.asset_count'), - flex: 2, - filterable: false, - valueGetter: ({ row }: { row: ShellDescriptor }) => - row.specificAssetIds.length, - }, - { - field: 'detail', - headerName: 'Detail', - flex: 1, - sortable: false, - filterable: false, - width: 150, - renderCell: ({ row }: { row: ShellDescriptor }) => ( - onDetailClick(row.identification)} - color="secondary" - size="small" - style={{ alignSelf: 'center' }} - > - - - ), - }, - ] -} diff --git a/src/components/pages/DigitalTwins/TwinDetails.tsx b/src/components/pages/DigitalTwins/TwinDetails.tsx deleted file mode 100644 index d57d4b16b..000000000 --- a/src/components/pages/DigitalTwins/TwinDetails.tsx +++ /dev/null @@ -1,174 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2021, 2023 T-Systems International GmbH and BMW Group AG - * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ - -import { Typography, CustomAccordion } from '@catena-x/portal-shared-components' -import { - ShellDescriptor, - SubmodelDescriptors, -} from 'features/digitalTwins/types' -import { DetailGrid } from '../../shared/basic/DetailGrid' -import { Grid, Box, Divider, useTheme } from '@mui/material' -import { useTranslation } from 'react-i18next' - -export const TwinDetails = ({ twin }: { twin: ShellDescriptor }) => { - const theme = useTheme() - const { t } = useTranslation() - - const getDesciption = (elem: ShellDescriptor | SubmodelDescriptors) => ( - - {elem.description[0] - ? elem.description[0].text - : t('content.digitaltwin.detail.no_description')} - - ) - - const hasSubmodels = () => twin.submodelDescriptors.length > 0 - - const primaryContent = ( - <> - {getDesciption(twin)} - {hasSubmodels() && ( - <> - {twin.submodelDescriptors.length > 0 && ( - - )} - - - {t('content.digitaltwin.detail.assetId')} - - {twin.specificAssetIds.map((saId, index) => ( - - - - {saId.semanticId && ( - <> - - - - )} - {index + 1 !== twin.specificAssetIds.length && ( - - )} - - ))} - - )} - - ) - - const secondaryContent = ( - subModel: SubmodelDescriptors, - semId: string, - idKey: string - ) => ( - <> - {getDesciption(subModel)} - - - - - - {t('content.digitaltwin.detail.endpoints')} - - - {subModel.endpoints.map((endpoint, indexEndpoint) => ( - - - - - - - - ))} - - ) - - const accordionItems = () => { - let items = [ - { - title: twin.idShort, - id: 'panel1', - expanded: true, - color: 'background.background09', - children: primaryContent, - }, - ] - if (hasSubmodels()) { - twin.submodelDescriptors.forEach((subModel, indexSubmodel) => { - const idKey = `${subModel.idShort}_${indexSubmodel}` - const item = { - title: subModel.idShort, - id: idKey, - expanded: false, - children: secondaryContent( - subModel, - subModel.semanticId.value[0], - idKey - ), - color: '', - } - items.push(item) - }) - } - return items - } - - return -} diff --git a/src/components/pages/DigitalTwins/TwinTable.tsx b/src/components/pages/DigitalTwins/TwinTable.tsx deleted file mode 100644 index 2f92d0e85..000000000 --- a/src/components/pages/DigitalTwins/TwinTable.tsx +++ /dev/null @@ -1,126 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2021, 2023 T-Systems International GmbH and BMW Group AG - * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ - -import { Table } from '@catena-x/portal-shared-components' -import { useEffect, useState } from 'react' -import { useTranslation } from 'react-i18next' -import { useDispatch, useSelector } from 'react-redux' -import { - fetchDigitalTwins, - fetchTwinForSearch, -} from 'features/digitalTwins/actions' -import { twinsSelector } from 'features/digitalTwins/slice' -import { ShellDescriptor } from 'features/digitalTwins/types' -import { LoadMoreButton } from '../../shared/basic/LoadMoreButton' -import { DigitalTwinsTableColumns } from './DigitalTwinsTableColumns' -import uniqueId from 'lodash/uniqueId' -import Patterns from 'types/Patterns' -import { AppDispatch } from 'features/store' - -interface TwinTableProps { - onTwinSelect: (id: string) => void -} - -const TwinTable = ({ onTwinSelect }: TwinTableProps) => { - const { t } = useTranslation() - const dispatch = useDispatch() - const { twinList, loading } = useSelector(twinsSelector) - const [twins, setTwins] = useState([]) - const [pageNumber, setPageNumber] = useState(0) - const [searchValue, setSearchValue] = useState('') - const rowCount = 10 - - useEffect(() => { - dispatch( - fetchDigitalTwins({ filter: { page: pageNumber, pageSize: rowCount } }) - ) - }, [dispatch, pageNumber]) - - useEffect(() => { - setTwins((prevTwins) => prevTwins.concat(twinList.items)) - }, [twinList]) - - const checkForKeyType = ( - search: string - ): 'globalAssetId' | 'PartInstanceID' => { - return Patterns.prefix.URNID.test(search) - ? 'globalAssetId' - : 'PartInstanceID' - } - - const onSearch = (value: string) => { - setTwins([]) - setSearchValue(value) - const key = checkForKeyType(value) - dispatch(fetchTwinForSearch({ key, value })) - } - - const clearSearch = () => { - setSearchValue('') - dispatch( - fetchDigitalTwins({ filter: { page: pageNumber, pageSize: rowCount } }) - ) - } - - const columns = DigitalTwinsTableColumns(useTranslation, onTwinSelect) - - return ( -
- uniqueId(row.idShort)} - rowHeight={50} - hasBorder={false} - noRowsMsg={t('content.digitaltwin.table.norows').replace( - '{data}', - searchValue - )} - /> -
- {twinList.totalPages !== twinList.currentPage && ( - setPageNumber((prevState) => prevState + 1)} - /> - )} -
- - ) -} - -export default TwinTable diff --git a/src/components/pages/DigitalTwins/index.tsx b/src/components/pages/DigitalTwins/index.tsx deleted file mode 100644 index a9b0cb0a0..000000000 --- a/src/components/pages/DigitalTwins/index.tsx +++ /dev/null @@ -1,53 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2021, 2023 T-Systems International GmbH and BMW Group AG - * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ - -import TwinTable from './TwinTable' -import { useState } from 'react' -import DigitalTwinDetailDialog from './DigitalTwinDetailDialog' -import { useDispatch } from 'react-redux' -import { fetchTwinById } from 'features/digitalTwins/actions' -import StageHeader from 'components/shared/frame/StageHeader' -import { useTranslation } from 'react-i18next' -import { AppDispatch } from 'features/store' - -export default function DigitalTwins() { - const { t } = useTranslation() - const dispatch = useDispatch() - const [showTwin, setShowTwin] = useState(false) - - const onTwinSelect = (id: string) => { - setShowTwin(true) - const encodedId = encodeURIComponent(id) - dispatch(fetchTwinById(encodedId)) - } - - return ( - <> - -
- -
- setShowTwin(false)} - /> - - ) -} diff --git a/src/features/digitalTwins/actions.ts b/src/features/digitalTwins/actions.ts deleted file mode 100644 index 27a8e92f1..000000000 --- a/src/features/digitalTwins/actions.ts +++ /dev/null @@ -1,68 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2021, 2023 T-Systems International GmbH and BMW Group AG - * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ - -import { createAsyncThunk } from '@reduxjs/toolkit' -import { Api } from './api' -import { FilterParams } from './types' - -const fetchDigitalTwins = createAsyncThunk( - 'fetch twins', - async ({ filter }: { filter: FilterParams }) => { - try { - return await Api.getInstance().getTwins(filter) - } catch (error: unknown) { - console.error('api call error:', error) - throw Error('DigitalTwin api call error') - } - } -) -const fetchTwinById = createAsyncThunk( - 'fetch twin by id', - async (id: string) => { - try { - return await Api.getInstance().getTwinById(id) - } catch (error: unknown) { - console.error('api call error:', error) - throw Error('Get twin by id api call error') - } - } -) - -const fetchTwinForSearch = createAsyncThunk( - 'fetch twin for search', - async ({ key, value }: { key: string; value: string }) => { - try { - const response = await Api.getInstance().getTwinForSearch( - encodeURIComponent(JSON.stringify([{ key, value }])) - ) - - const mappedData = await Promise.all([ - ...response.map((id: string) => Api.getInstance().getTwinById(id)), - ]) - - return mappedData - } catch (error) { - console.error('api call error:', error) - throw Error('Get twin by id for search api call error') - } - } -) - -export { fetchDigitalTwins, fetchTwinById, fetchTwinForSearch } diff --git a/src/features/digitalTwins/api.ts b/src/features/digitalTwins/api.ts deleted file mode 100644 index 894d21679..000000000 --- a/src/features/digitalTwins/api.ts +++ /dev/null @@ -1,55 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2021, 2023 T-Systems International GmbH and BMW Group AG - * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ - -import qs from 'qs' -import { HttpClient } from 'utils/HttpClient' -import { FilterParams, ShellDescriptor, TwinList } from './types' -import { getSemanticApiBase } from 'services/EnvironmentService' -import { getHeaders } from 'services/RequestService' - -export class Api extends HttpClient { - private static classInstance?: Api - - public constructor() { - super(`${getSemanticApiBase()}/registry`) - } - - public static getInstance() { - if (!this.classInstance) { - this.classInstance = new Api() - } - return this.classInstance - } - - public getTwins = (filters: FilterParams) => - this.instance.get( - `/registry/shell-descriptors?${qs.stringify(filters)}`, - getHeaders() - ) - - public getTwinById = (id: string) => - this.instance.get( - `/registry/shell-descriptors/${id}`, - getHeaders() - ) - - public getTwinForSearch = (search: string) => - this.instance.get(`lookup/shells?assetIds=${search}`, getHeaders()) -} diff --git a/src/features/digitalTwins/slice.ts b/src/features/digitalTwins/slice.ts deleted file mode 100644 index 9c3bcb6ba..000000000 --- a/src/features/digitalTwins/slice.ts +++ /dev/null @@ -1,99 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2021, 2023 T-Systems International GmbH and BMW Group AG - * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ - -import { createSlice } from '@reduxjs/toolkit' -import { RootState } from 'features/store' -import { fetchDigitalTwins, fetchTwinById, fetchTwinForSearch } from './actions' -import { DigitalTwinsInitialState, ShellDescriptor, TwinList } from './types' - -const defaultTwins: TwinList = { - items: [], - totalItems: 0, - itemCount: 0, - currentPage: 0, - totalPages: 0, -} - -const initialState: DigitalTwinsInitialState = { - twinList: defaultTwins, - twin: null, - loading: false, - error: '', -} - -const twinsSlice = createSlice({ - name: 'twins', - initialState, - reducers: {}, - extraReducers: (builder) => { - builder.addCase(fetchDigitalTwins.pending, (state) => { - state.twinList = defaultTwins - state.loading = true - state.error = '' - }) - builder.addCase(fetchDigitalTwins.fulfilled, (state, { payload }) => { - state.twinList = payload as TwinList - state.loading = false - state.error = '' - }) - builder.addCase(fetchDigitalTwins.rejected, (state, action) => { - state.twinList = defaultTwins - state.loading = false - state.error = action.error.message as string - }) - - builder.addCase(fetchTwinById.pending, (state) => { - state.twin = null - state.loading = true - state.error = '' - }) - builder.addCase(fetchTwinById.fulfilled, (state, { payload }) => { - state.twin = payload as ShellDescriptor - state.loading = false - state.error = '' - }) - builder.addCase(fetchTwinById.rejected, (state, action) => { - state.twin = null - state.loading = false - state.error = action.error.message as string - }) - - builder.addCase(fetchTwinForSearch.pending, (state, { payload }) => { - state.twinList = defaultTwins - state.loading = true - state.error = '' - }) - builder.addCase(fetchTwinForSearch.fulfilled, (state, { payload }) => { - state.twinList = { ...state.twinList, currentPage: 0, items: payload } - state.error = '' - state.loading = false - }) - builder.addCase(fetchTwinForSearch.rejected, (state, action) => { - state.twinList = { ...state.twinList, items: [] } - state.loading = false - state.error = action.error.message as string - }) - }, -}) - -export const twinsSelector = (state: RootState): DigitalTwinsInitialState => - state.twins - -export default twinsSlice diff --git a/src/features/digitalTwins/types.ts b/src/features/digitalTwins/types.ts deleted file mode 100644 index 0d6673ebb..000000000 --- a/src/features/digitalTwins/types.ts +++ /dev/null @@ -1,87 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2021, 2023 T-Systems International GmbH and BMW Group AG - * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ - -import { Nullable } from 'types/MainTypes' - -export interface DigitalTwinsInitialState { - twinList: TwinList - twin: Nullable - loading: boolean - error: string -} - -export type FilterParams = { - readonly page: number - readonly pageSize: number -} - -export interface TwinList { - items: Array - totalItems: number - itemCount: number - currentPage: number - totalPages: number -} - -export interface ShellDescriptor { - description: Description[] - globalAssetId: { - value: [string] - } - idShort: string - identification: string - specificAssetIds: [ - { - key: string - semanticId: SemanticId - value: string - } - ] - submodelDescriptors: SubmodelDescriptors[] -} - -export interface SubmodelDescriptors { - description: Description[] - endpoints: Endpoints[] - idShort: string - identification: string - semanticId: SemanticId -} - -interface Description { - language: string - text: string -} - -interface Endpoints { - interface: string - protocolInformation: { - endpointAddress: string - endpointProtocol: string - endpointProtocolVersion: string - subprotocol: string - subprotocolBody: string - subprotocolBodyEncoding: string - } -} - -interface SemanticId { - value: string[] -} diff --git a/src/features/store.ts b/src/features/store.ts index f6e1df903..ba87447a5 100644 --- a/src/features/store.ts +++ b/src/features/store.ts @@ -26,7 +26,6 @@ import control from './control' import info from './info' import userSliceDep from './user/slice' import partnerNetworkSlice from './partnerNetwork/slice' -import twinsSlice from './digitalTwins/slice' import connectorSlice from './connector/slice' import notificationSliceDep from './notification/slice' import ErrorSlice from './error/slice' @@ -85,7 +84,6 @@ export const reducers = { semanticModels: modelsSlice.reducer, companyRoles: updateCompanyRoleSlice.reducer, user: userSliceDep, - twins: twinsSlice.reducer, partnerNetwork: partnerNetworkSlice.reducer, connector: connectorSlice.reducer, notification: notificationSliceDep.reducer, diff --git a/src/services/EnvironmentService.ts b/src/services/EnvironmentService.ts index 490632e0c..25a44bf38 100644 --- a/src/services/EnvironmentService.ts +++ b/src/services/EnvironmentService.ts @@ -39,8 +39,6 @@ export const getSemanticApiBase = () => export const getClientIdSemantic = () => 'Cl3-CX-Semantic' -export const getClientIdDigitalTwin = () => 'Cl4-CX-DigitalTwin' - export const getManagedIdentityWalletsNewBase = () => typeof ENV === 'undefined' ? '' : ENV.MANAGED_IDENTITY_WALLETS_NEW_URL @@ -52,7 +50,6 @@ const EnvironmentService = { getSemanticApiBase, getClientId, getClientIdSemantic, - getClientIdDigitalTwin, getManagedIdentityWalletsNewBase, } diff --git a/src/services/UserService.ts b/src/services/UserService.ts index 080d457ff..a8d9ae99c 100644 --- a/src/services/UserService.ts +++ b/src/services/UserService.ts @@ -26,7 +26,6 @@ import { getCentralIdp, getClientId, getClientIdSemantic, - getClientIdDigitalTwin, } from './EnvironmentService' import { error, info } from './LogService' import { store } from 'features/store' @@ -44,12 +43,6 @@ const keycloakConfigSemantic: Keycloak.KeycloakConfig = { clientId: getClientIdSemantic(), } -const keycloakConfigDigitalTwin: Keycloak.KeycloakConfig = { - url: getCentralIdp(), - realm: 'CX-Central', - clientId: getClientIdDigitalTwin(), -} - // TODO: add an ESLint exception until there is a solution /* eslint @typescript-eslint/no-explicit-any: "off" */ const KC = new (Keycloak as any)(keycloakConfig) @@ -110,8 +103,7 @@ const getTenant = () => KC.tokenParsed?.tenant // not sustainable because client roles need to be unique across all clients const getRoles = () => KC.tokenParsed?.resource_access[keycloakConfig.clientId]?.roles.concat( - KC.tokenParsed?.resource_access[keycloakConfigSemantic.clientId]?.roles, - KC.tokenParsed?.resource_access[keycloakConfigDigitalTwin.clientId]?.roles + KC.tokenParsed?.resource_access[keycloakConfigSemantic.clientId]?.roles ) const hasRole = (role: string) => getRoles()?.includes(role) diff --git a/src/types/Config.tsx b/src/types/Config.tsx index 6571924e9..1732555d4 100644 --- a/src/types/Config.tsx +++ b/src/types/Config.tsx @@ -30,7 +30,6 @@ import AppReleaseProcess from 'components/pages/AppReleaseProcess' import Connector from 'components/pages/Connector' import Contact from 'components/pages/Contact' import CookiePolicy from 'components/pages/CookiePolicy' -import DigitalTwins from 'components/pages/DigitalTwins' import EdcConnector from 'components/pages/EdcConnector' import Home from 'components/pages/Home' import Imprint from 'components/pages/Imprint' @@ -158,11 +157,6 @@ export const ALL_PAGES: IPage[] = [ role: ROLES.SEMANTICHUB_VIEW, element: , }, - { - name: PAGES.DIGITALTWIN, - role: ROLES.DIGITALTWIN_VIEW, - element: , - }, { name: PAGES.SEMANTICHUB, role: ROLES.SEMANTICHUB_VIEW, @@ -711,7 +705,7 @@ export const mainMenuFullTree = [ }, { name: PAGES.DATA_MANAGEMENT, - children: [{ name: PAGES.SEMANTICHUB }, { name: PAGES.DIGITALTWIN }], + children: [{ name: PAGES.SEMANTICHUB }], }, { name: PAGES.PARTNER_NETWORK }, { diff --git a/src/types/Constants.ts b/src/types/Constants.ts index 787cbf869..a9cda492f 100644 --- a/src/types/Constants.ts +++ b/src/types/Constants.ts @@ -37,7 +37,6 @@ export enum PAGES { SERVICE_MARKETPLACE_DETAIL = 'servicemarketplacedetail', APP_DETAIL = 'appdetail', DATA_MANAGEMENT = 'datamanagement', - DIGITALTWIN = 'digitaltwin', SEMANTICHUB = 'semantichub', CONNECTOR = 'connector', ACCOUNT = 'account', @@ -176,9 +175,6 @@ export enum ROLES { APPOVERVIEW_VIEW = 'add_apps', SERVICEOVERVIEW_VIEW = 'add_service_offering', CONNECTOR_SETUP = 'setup_connector', - DIGITALTWIN_VIEW = 'view_digital_twin', - DIGITALTWIN_ADD = 'add_digital_twin', - DIGITALTWIN_DELETE = 'delete_digital_twin', SEMANTICHUB_VIEW = 'view_semantic_model', SEMANTICHUB_ADD = 'add_semantic_model', SEMANTICHUB_DELETE = 'delete_semantic_model', diff --git a/src/types/Patterns.ts b/src/types/Patterns.ts index a78b7bdd0..325e7fa46 100644 --- a/src/types/Patterns.ts +++ b/src/types/Patterns.ts @@ -44,7 +44,6 @@ export const Patterns = { BPN: /^BPNL/i, URL: /^https:/i, MAIL: /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@/, - URNID: /^urn:uuid:[a-z0-9]{8}(-[a-z0-9]{4}){3}-[a-z0-9]{12}$/i, }, SEARCH: /^[a-zA-ZÀ-ÿ0-9 !?@&_\-.]{3,80}$/, appMarketCard: {