diff --git a/CHANGELOG.md b/CHANGELOG.md index b1073f21e..64014de1c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## 1.6.0-RC3 + +### Change + +- App Subscription Management + - Activation Approval Overlay (enhanced by customer name, bpn, technical user permission, appId) +- Technical User Management + - support managed tech user with app information +- Connector Registration + - managed connector option only available for app/service provider + - info message added for inactive select scenario + +### Bugfix + +- Managed connector registration api call - technicalUserID string empty instead of submitting the subscriptionID + ## 1.6.0-RC2 ### Change diff --git a/DEPENDENCIES b/DEPENDENCIES index 8dec45983..12a883a7c 100644 --- a/DEPENDENCIES +++ b/DEPENDENCIES @@ -1124,7 +1124,7 @@ npm/npmjs/@babel/template/7.22.5, MIT, approved, #9017 npm/npmjs/@babel/traverse/7.22.5, MIT, approved, #8954 npm/npmjs/@babel/types/7.22.5, MIT, approved, #8967 npm/npmjs/@bcoe/v8-coverage/0.2.3, ISC AND MIT, approved, clearlydefined -npm/npmjs/@catena-x/portal-shared-components/2.0.5, Apache-2.0 AND (BSD-3-Clause AND MIT), approved, #9187 +npm/npmjs/@catena-x/portal-shared-components/2.0.11, Apache-2.0 AND (BSD-3-Clause AND MIT), approved, #9187 npm/npmjs/@csstools/normalize.css/12.0.0, CC0-1.0, approved, clearlydefined npm/npmjs/@csstools/postcss-cascade-layers/1.1.1, CC0-1.0, approved, clearlydefined npm/npmjs/@csstools/postcss-color-function/1.1.1, CC0-1.0 AND (MIT AND W3C-20150513) AND W3C-20150513 AND MIT, approved, #3022 diff --git a/package.json b/package.json index ca3327cd6..393aa1d69 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@catena-x/portal-frontend", - "version": "v1.6.0-RC2", + "version": "v1.6.0-RC3", "description": "Catena-X Portal Frontend", "author": "Catena-X Contributors", "license": "Apache-2.0", @@ -26,7 +26,7 @@ ] }, "dependencies": { - "@catena-x/portal-shared-components": "^2.0.5", + "@catena-x/portal-shared-components": "^2.0.11", "@emotion/react": "^11.11.1", "@emotion/styled": "^11.11.0", "@hookform/error-message": "^2.0.1", diff --git a/src/assets/locales/de/main.json b/src/assets/locales/de/main.json index 4ad7adb94..3829be999 100644 --- a/src/assets/locales/de/main.json +++ b/src/assets/locales/de/main.json @@ -473,11 +473,13 @@ "modal": { "company": { "title": "Connect company connector", - "intro": "Registrierung eines Company Connectoren welcher im eigenen Firmennetz implementiert ist." + "intro": "Registrierung eines Company Connectoren welcher im eigenen Firmennetz implementiert ist.", + "disableDescription": "Diese Option ist nur verfügbar, wenn Ihr Unternehmen aktiver Teilnehmer ist. Unternehmensrollen können vom Unternehmensadministrator /company-role geändert werden" }, "managed": { "title": "Register Managed Connector", - "intro": "Register a managed connector of your customer / 3rd party provided. This selection is mainly service provider relevant, which offers managed connectors to data provider/consumer. If you want to register your own connector, please use the selection above." + "intro": "Register a managed connector of your customer / 3rd party provided. This selection is mainly service provider relevant, which offers managed connectors to data provider/consumer. If you want to register your own connector, please use the selection above.", + "disableDescription": "Diese Option ist nur verfügbar, wenn Ihr Unternehmen App-Anbieter oder Dienstanbieter ist. Unternehmensrollen können vom Unternehmensadministrator /company-role geändert werden" }, "daps": { "title": "Create DAPS Registration", @@ -1175,8 +1177,14 @@ "technicalUserDetailsDescription": "Below the technical user profile used to create the technical user for the app tenant is shared. With clicking on 'Confirm' below, the technical user is getting created with the respective configured permissions. Please note the technical user is customer specific.", "technicalUserProfileHeading": "Technical User Profile", "successDescription": "The app subscription got successfully activated, the customer got informed via email. Please find the technical user details below:", - "clientId": "Client Id", - "clientSecret": "Client Secret" + "clientDetails": "Client Details", + "customer": "Customer", + "bpn": "BPN", + "technicalDetails": "Technical Details", + "appClientId": "App Id (Client ID)", + "technicalClientId": "Technical User Client ID", + "technicalSecret": "Technical User Secret", + "technicalPermission": "Technical User Permission" }, "detailOverlay": { "title": "Provider View", @@ -1194,6 +1202,7 @@ "contact": "Contact", "technicalDetails": "Technical Details", "appTenantUrl": "App Tenant URL", + "appId": "App ID (clientID)", "technicalName": "Technical User Name", "technicalPermission": "Technical User Permission", "helpText": "For any questions regarding these change(s), please contact the Catena-X helpdesk:", @@ -1504,7 +1513,7 @@ }, "uploadCertificate": "Upload Certificate", "updateCertificate": { - "title": "Upload new certificate for {company name}", + "title": "Upload new certificate", "description": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard .Lorem Ipsum is simply dummy text of the printing and typesetting industry.", "selectLabel": "Type of certificate", "placeholder": "Please select", @@ -1595,7 +1604,10 @@ "permission": "Berechtigung", "userId": "Benutzeridentifikation", "redirectURI": "Redirect-URI", - "toBeUpdated": "To be updated" + "toBeUpdated": "To be updated", + "type": "Type", + "owner": "Owner", + "offerLink": "Offer Link" }, "actions": { "cancel": "Abbrechen", diff --git a/src/assets/locales/en/main.json b/src/assets/locales/en/main.json index 1fb9e45e1..d6d90ea73 100644 --- a/src/assets/locales/en/main.json +++ b/src/assets/locales/en/main.json @@ -472,11 +472,13 @@ "modal": { "company": { "title": "Connect company connector", - "intro": "Registration of a company connector which is implemented in your own company network." + "intro": "Registration of a company connector which is implemented in your own company network.", + "disableDescription": "This option is only available if your company is Active Participant. Company roles can get changed by the company admin /company-role" }, "managed": { "title": "Register Managed Connector", - "intro": "Register a managed connector of your customer / 3rd party provided. This selection is mainly service provider relevant, which offers managed connectors to data provider/consumer. If you want to register your own connector, please use the selection above." + "intro": "Register a managed connector of your customer / 3rd party provided. This selection is mainly service provider relevant, which offers managed connectors to data provider/consumer. If you want to register your own connector, please use the selection above.", + "disableDescription": "This option is only available if your company is App Provider or Service Provider. Company roles can get changed by the company admin /company-role" }, "daps": { "title": "Create DAPS Registration", @@ -1137,8 +1139,14 @@ "technicalUserDetailsDescription": "Below the technical user profile used to create the technical user for the app tenant is shared. With clicking on 'Confirm' below, the technical user is getting created with the respective configured permissions. Please note the technical user is customer specific.", "technicalUserProfileHeading": "Technical User Profile", "successDescription": "The app subscription got successfully activated, the customer got informed via email about the app activation. Please find the technical user details below:", - "clientId": "Client Id", - "clientSecret": "Client Secret" + "clientDetails": "Client Details", + "customer": "Customer", + "bpn": "BPN", + "technicalDetails": "Technical Details", + "appClientId": "App Id (Client ID)", + "technicalClientId": "Technical User Client ID", + "technicalSecret": "Technical User Secret", + "technicalPermission": "Technical User Permission" }, "detailOverlay": { "title": "Provider View", @@ -1156,6 +1164,7 @@ "contact": "Contact", "technicalDetails": "Technical Details", "appTenantUrl": "App Tenant URL", + "appId": "App ID (clientID)", "technicalName": "Technical User Name", "technicalPermission": "Technical User Permission", "helpText": "For any questions regarding these change(s), please contact the Catena-X helpdesk:", @@ -1443,7 +1452,7 @@ }, "uploadCertificate": "Upload Certificate", "updateCertificate": { - "title": "Upload new certificate for {company name}", + "title": "Upload new certificate", "description": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard .Lorem Ipsum is simply dummy text of the printing and typesetting industry.", "selectLabel": "Type of certificate", "placeholder": "Please select", @@ -1559,7 +1568,10 @@ "permission": "Permission", "userId": "User Id", "redirectURI": "Redirect URI", - "toBeUpdated": "To be updated" + "toBeUpdated": "To be updated", + "type": "Type", + "owner": "Owner", + "offerLink": "Offer Link" }, "actions": { "cancel": "Cancel", diff --git a/src/components/overlays/ActivateSubscription/index.tsx b/src/components/overlays/ActivateSubscription/index.tsx deleted file mode 100644 index 7190dd255..000000000 --- a/src/components/overlays/ActivateSubscription/index.tsx +++ /dev/null @@ -1,187 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2021, 2023 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 { - Button, - DialogActions, - DialogContent, - DialogHeader, - Input, - LoadingButton, - Typography, -} from '@catena-x/portal-shared-components' -import { useTranslation } from 'react-i18next' -import Patterns from 'types/Patterns' -import CheckCircleOutlinedIcon from '@mui/icons-material/CheckCircleOutlined' -import { - SubscriptionActivationResponse, - useAddUserSubscribtionMutation, -} from 'features/appSubscription/appSubscriptionApiSlice' -import { closeOverlay } from 'features/control/overlay' -import { useState } from 'react' -import { useDispatch } from 'react-redux' -import './style.scss' -import { store } from 'features/store' -import { setSuccessType } from 'features/appSubscription/slice' - -export default function ActivateSubscription({ id }: { id: string }) { - const { t } = useTranslation() - const dispatch = useDispatch() - const [inputURL, setInputURL] = useState('') - const [URLErrorMsg, setURLErrorMessage] = useState('') - const [loading, setLoading] = useState(false) - const [activationResponse, setActivationResponse] = - useState() - - const [addUserSubscribtion] = useAddUserSubscribtionMutation() - - const addInputURL = (value: string) => { - setInputURL(value) - if (!Patterns.URL.test(value.trim())) { - setURLErrorMessage(t('content.appSubscription.pleaseEnterValidURL')) - } else { - setURLErrorMessage('') - } - } - - const addTentantURL = async () => { - setLoading(true) - try { - const subscriptionData = await addUserSubscribtion({ - requestId: id, - offerUrl: inputURL, - }).unwrap() - setActivationResponse(subscriptionData) - } catch (error) { - console.log(error) - } - } - - const closeActivationOverlay = () => { - dispatch(setSuccessType(true)) - dispatch(closeOverlay()) - } - - return ( - <> - {activationResponse ? ( -
- - } - onCloseWithIcon={() => dispatch(closeOverlay())} - /> - - - - - - - - - - - - -
- - {t('content.appSubscription.activation.clientId')} - - - - {activationResponse && - activationResponse.technicalUserInfo.technicalClientId} - -
- - {t('content.appSubscription.activation.clientSecret')} - - - - {activationResponse && - activationResponse.technicalUserInfo - .technicalUserSecret} - -
-
- - - -
- ) : ( - <> - dispatch(closeOverlay()), - }} - /> - -
- addInputURL(e.target.value)} - value={inputURL} - /> -

{URLErrorMsg}

-
-
- - - {loading ? ( - {}} - sx={{ marginLeft: '10px' }} - /> - ) : ( - - )} - - - )} - - ) -} diff --git a/src/components/overlays/ActivateSubscription/style.scss b/src/components/overlays/ActivateSubscription/style.scss deleted file mode 100644 index 98c7735eb..000000000 --- a/src/components/overlays/ActivateSubscription/style.scss +++ /dev/null @@ -1,65 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2021, 2023 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 - ********************************************************************************/ - -.appSubscriptionMain { - ol { - color: #888888; - } - p { - color: #e43333; - } - .mt-30 { - margin-top: 30px; - } - .helpText { - display: flex; - color: #0d55af; - margin-top: 10px; - svg { - font-size: 20px; - } - } - .technicalUserProfile { - width: 90%; - margin: 30px auto; - } -} - -.activationOverlay { - p { - font-weight: 600; - } - - table { - width: 100%; - max-width: 600px; - margin: 0 auto; - border-collapse: collapse; - - tr td { - border-top: 1px solid rgb(220, 220, 220); - padding: 10px; - } - - tr:first-child td { - border: none; - } - } -} diff --git a/src/components/pages/AdminCredential/AdminCredential.scss b/src/components/pages/AdminCredential/AdminCredential.scss index d022717d1..4b907dfda 100644 --- a/src/components/pages/AdminCredential/AdminCredential.scss +++ b/src/components/pages/AdminCredential/AdminCredential.scss @@ -52,17 +52,12 @@ transform: translateX(-50%); } .document-icon { - color: #9c9c9c; + color: #1977cc; font-size: 20px; } .document-button-link { - background-color: transparent; - border: none; - text-decoration: underline; + margin: 0 auto; cursor: pointer; - font-size: 16px; - color: #1977cc; - margin-left: 10px; } .statusBtn { border-radius: 20px; diff --git a/src/components/pages/AdminCredential/AdminCredentialElements.tsx b/src/components/pages/AdminCredential/AdminCredentialElements.tsx index 2c831db3c..fe8a32e2f 100644 --- a/src/components/pages/AdminCredential/AdminCredentialElements.tsx +++ b/src/components/pages/AdminCredential/AdminCredentialElements.tsx @@ -33,6 +33,7 @@ import { import { download } from 'utils/downloadUtils' import { useFetchNewDocumentByIdMutation } from 'features/appManagement/apiSlice' import { error, success } from 'services/NotifyService' +import { uniqueId } from 'lodash' export interface DummyData { date: string @@ -130,7 +131,7 @@ export default function AdminCredentialElements() { flex: 2.5, }, { - field: 'companyId', + field: 'companyName', headerName: t('content.adminCertificate.table.companyInfo'), flex: 2, }, @@ -145,22 +146,17 @@ export default function AdminCredentialElements() { { field: 'document', headerName: t('content.adminCertificate.table.document'), - flex: 2, + flex: 1.5, renderCell: ({ row }: { row: CredentialData }) => ( - <> - - - + + handleDownloadClick( + row.document.documentId, + row.document.documentName + ) + } + /> ), }, { @@ -216,7 +212,7 @@ export default function AdminCredentialElements() { fetchHook={useFetchCredentialsQuery} fetchHookArgs={{ expr }} fetchHookRefresh={refresh} - getRowId={(row: { [key: string]: string }) => row.companyId} + getRowId={(row: { [key: string]: string }) => uniqueId(row.companyId)} columns={columns} defaultFilter={group} filterViews={filterButtons} diff --git a/src/components/pages/AppSubscription/ActivateSubscriptionOverlay/index.tsx b/src/components/pages/AppSubscription/ActivateSubscriptionOverlay/index.tsx index 9bec5e549..a10ff43f3 100644 --- a/src/components/pages/AppSubscription/ActivateSubscriptionOverlay/index.tsx +++ b/src/components/pages/AppSubscription/ActivateSubscriptionOverlay/index.tsx @@ -26,6 +26,8 @@ import { DialogHeader, Input, LoadingButton, + StaticTable, + TableType, Typography, } from '@catena-x/portal-shared-components' import HelpOutlineIcon from '@mui/icons-material/HelpOutline' @@ -44,6 +46,7 @@ import { store } from 'features/store' import { setSuccessType } from 'features/appSubscription/slice' import { Link } from 'react-router-dom' import { CustomDialogHeader } from 'components/shared/basic/Dailog/CustomDialogHeader' +import { closeOverlay } from 'features/control/overlay' const TentantHelpURL = '/documentation/?path=docs%2F04.App%28s%29%2F05.+App-Subscription%2F04.+Subscription+Activation%28App+Provider%29.md' @@ -55,6 +58,8 @@ interface ActivateSubscriptionProps { appId: string subscriptionId: string title: string + companyName: string + bpnNumber: string handleOverlayClose: () => void } @@ -63,6 +68,8 @@ const ActivateSubscriptionOverlay = ({ appId, subscriptionId, title, + companyName, + bpnNumber, handleOverlayClose, }: ActivateSubscriptionProps) => { const { t } = useTranslation() @@ -103,73 +110,59 @@ const ActivateSubscriptionOverlay = ({ handleOverlayClose() } + const tableData1: TableType = { + head: [t('content.appSubscription.activation.clientDetails'), ''], + body: [ + [t('content.appSubscription.activation.customer'), `${companyName}`], + [t('content.appSubscription.activation.bpn'), `${bpnNumber}`], + ], + } + + const tableData2: TableType = { + head: [t('content.appSubscription.activation.technicalDetails'), ''], + body: [ + [ + t('content.appSubscription.activation.appClientId'), + `${activationResponse?.clientInfo?.clientId}`, + ], + [ + t('content.appSubscription.activation.technicalClientId'), + `${activationResponse?.technicalUserInfo?.technicalClientId}`, + ], + [ + t('content.appSubscription.activation.technicalSecret'), + `${activationResponse?.technicalUserInfo?.technicalUserSecret}`, + ], + [ + t('content.appSubscription.activation.technicalPermission'), + `${activationResponse?.technicalUserInfo?.technicalUserPermissions.toString()}`, + ], + ], + } + return ( <> {activationResponse ? (
- - - } - onCloseWithIcon={() => handleOverlayClose()} - /> - - - - - - - - - - - - -
- - {t('content.appSubscription.activation.clientId')} - - - - { - activationResponse?.technicalUserInfo - .technicalClientId - } - -
- - {t('content.appSubscription.activation.clientSecret')} - - - - { - activationResponse?.technicalUserInfo - .technicalUserSecret - } - -
-
- - - -
+ + } + onCloseWithIcon={() => dispatch(closeOverlay())} + /> + + + + + + +
) : ( 0 @@ -144,6 +148,25 @@ const AppSubscriptionDetailOverlay = ({ errorMessage: t('content.appSubscription.pleaseEnterValidURL'), }, ], + [ + { + editIcon: false, + }, + { + editIcon: false, + }, + ], + [ + { + editIcon: false, + }, + { + editIcon: false, + clickableLink: data?.technicalUserData[0]?.id + ? `/techuserdetails/${data?.technicalUserData[0]?.id}` + : undefined, + }, + ], ], } diff --git a/src/components/pages/EdcConnector/AddConnectorOverlay/components/ConnectorTypeSelection.tsx b/src/components/pages/EdcConnector/AddConnectorOverlay/components/ConnectorTypeSelection.tsx index 952d55c68..e217a3e2d 100644 --- a/src/components/pages/EdcConnector/AddConnectorOverlay/components/ConnectorTypeSelection.tsx +++ b/src/components/pages/EdcConnector/AddConnectorOverlay/components/ConnectorTypeSelection.tsx @@ -22,28 +22,47 @@ import { useState } from 'react' import { useTranslation } from 'react-i18next' import { Typography, Checkbox } from '@catena-x/portal-shared-components' import { Box, Grid } from '@mui/material' - +import { CompanyDetails, CompanyRoleEnum } from 'features/admin/userApiSlice' // Static content // Add Connector Button action modal first step content const ConnectorTypeSelection = ({ selectedServiceCallback, + ownCompanyDetails, }: { selectedServiceCallback: (selected: any) => any + ownCompanyDetails?: CompanyDetails }) => { const { t } = useTranslation() - const checkBoxSelector = [ { title: t('content.edcconnector.modal.companyconnectorlabel'), type: 'COMPANY_CONNECTOR', descritpion: t('content.edcconnector.modal.company.intro'), id: 1, + disable: + !ownCompanyDetails?.companyRole || + ownCompanyDetails?.companyRole?.length === 0, + disableDescription: t( + 'content.edcconnector.modal.company.disableDescription' + ), }, { title: t('content.edcconnector.modal.connectorasaservice'), type: 'MANAGED_CONNECTOR', descritpion: t('content.edcconnector.modal.managed.intro'), id: 2, + disable: + !ownCompanyDetails?.companyRole || + ownCompanyDetails?.companyRole?.length === 0 || + (!ownCompanyDetails?.companyRole.includes( + CompanyRoleEnum.SERVICE_PROVIDER + ) && + !ownCompanyDetails?.companyRole.includes( + CompanyRoleEnum.APP_PROVIDER + )), + disableDescription: t( + 'content.edcconnector.modal.managed.disableDescription' + ), }, ] @@ -55,8 +74,14 @@ const ConnectorTypeSelection = ({ {checkBoxSelector.map((checkBox: any) => { return ( - + { @@ -64,10 +89,19 @@ const ConnectorTypeSelection = ({ selectedServiceCallback(checkBox) }} /> - - - {checkBox.descritpion} - + {checkBox.disable ? ( + + {checkBox.disableDescription} + + ) : ( + + {checkBox.descritpion} + + )} ) })} diff --git a/src/components/pages/EdcConnector/AddConnectorOverlay/index.tsx b/src/components/pages/EdcConnector/AddConnectorOverlay/index.tsx index dba0ec94a..045dead41 100644 --- a/src/components/pages/EdcConnector/AddConnectorOverlay/index.tsx +++ b/src/components/pages/EdcConnector/AddConnectorOverlay/index.tsx @@ -37,6 +37,7 @@ import { useFetchOfferSubscriptionsQuery, } from 'features/connector/connectorApiSlice' import Box from '@mui/material/Box' +import { useFetchOwnCompanyDetailsQuery } from 'features/admin/userApiSlice' interface AddCollectorOverlayProps { openDialog?: boolean @@ -74,6 +75,7 @@ const AddConnectorOverlay = ({ }: AddCollectorOverlayProps) => { const { t } = useTranslation() const { data } = useFetchOfferSubscriptionsQuery() + const { data: ownCompanyDetails } = useFetchOwnCompanyDetailsQuery() const { handleSubmit, getValues, @@ -140,7 +142,10 @@ const AddConnectorOverlay = ({ > {connectorStep === 0 ? ( <> - + ) : ( <> diff --git a/src/components/pages/EdcConnector/index.tsx b/src/components/pages/EdcConnector/index.tsx index bf49b641a..95af08ec7 100644 --- a/src/components/pages/EdcConnector/index.tsx +++ b/src/components/pages/EdcConnector/index.tsx @@ -154,7 +154,7 @@ const EdcConnector = () => { } else if (selectedService.type === ConnectType.MANAGED_CONNECTOR) { // body.append('providerBpn', data.ConnectorBPN) body.append('subscriptionId', data.ConnectorSubscription.subscriptionId) - body.append('technicalUserId', data.ConnectorSubscription.subscriptionId) + body.append('technicalUserId', '') await createManagedConnector(body) .unwrap() .then(() => showOverlay(true)) diff --git a/src/components/pages/TechnicalUserManagement/TechnicalUserTable.tsx b/src/components/pages/TechnicalUserManagement/TechnicalUserTable.tsx index d5d3460a3..d539bdf56 100644 --- a/src/components/pages/TechnicalUserManagement/TechnicalUserTable.tsx +++ b/src/components/pages/TechnicalUserManagement/TechnicalUserTable.tsx @@ -50,12 +50,31 @@ export const TechnicalUserTable = () => { { field: 'name', headerName: t('global.field.userName'), - flex: 3, + flex: 2, }, { field: 'clientId', headerName: t('global.field.clientId'), - flex: 2, + flex: 1, + }, + { + field: 'serviceAccountType', + headerName: t('global.field.type'), + flex: 1, + }, + { + field: 'offer', + headerName: t('global.field.offerLink'), + flex: 1.5, + valueGetter: ({ row }: { row: any }) => + row.offer ? row.offer?.name : '', + }, + { + field: 'isOwner', + headerName: t('global.field.owner'), + flex: 1, + valueGetter: ({ row }: { row: any }) => + row.isOwner ? 'Yes' : 'No', }, { field: 'details', diff --git a/src/components/shared/basic/CertificateCard/index.tsx b/src/components/shared/basic/CertificateCard/index.tsx index 332d909c4..cd36221e8 100644 --- a/src/components/shared/basic/CertificateCard/index.tsx +++ b/src/components/shared/basic/CertificateCard/index.tsx @@ -91,9 +91,6 @@ export const CertificateCard = ({ )} - - {t('content.certificates.certificateCard.type')} - {credentialType} diff --git a/src/components/shared/templates/Subscription/Subscription.scss b/src/components/shared/templates/Subscription/Subscription.scss index 6340b25f5..5a50be06e 100644 --- a/src/components/shared/templates/Subscription/Subscription.scss +++ b/src/components/shared/templates/Subscription/Subscription.scss @@ -196,7 +196,6 @@ } .forthSection { - width: 15%; margin-left: 0px; text-align: center; diff --git a/src/components/shared/templates/Subscription/SubscriptionElements.tsx b/src/components/shared/templates/Subscription/SubscriptionElements.tsx index 090d11e2d..a3085dfc7 100644 --- a/src/components/shared/templates/Subscription/SubscriptionElements.tsx +++ b/src/components/shared/templates/Subscription/SubscriptionElements.tsx @@ -18,7 +18,6 @@ * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ -import { useDispatch } from 'react-redux' import { useTranslation } from 'react-i18next' import { useTheme, CircularProgress } from '@mui/material' import ArrowForwardIcon from '@mui/icons-material/ArrowForward' @@ -28,19 +27,13 @@ import { Tooltips, Chip, } from '@catena-x/portal-shared-components' -import { show } from 'features/control/overlay' -import { OVERLAYS } from 'types/Constants' -import { - SubscriptionContent, - CompanySubscriptionData, -} from 'features/appSubscription/appSubscriptionApiSlice' +import { SubscriptionContent } from 'features/appSubscription/appSubscriptionApiSlice' import NoItems from 'components/pages/NoItems' import './Subscription.scss' import AppSubscriptionDetailOverlay from 'components/pages/AppSubscription/AppSubscriptionDetailOverlay' import ActivateSubscriptionOverlay from 'components/pages/AppSubscription/ActivateSubscriptionOverlay' import { useState } from 'react' import { SubscriptionStatus } from 'features/apps/apiSlice' -import { SubscriptionTypes } from '.' import { useReducer } from 'react' import ActivateServiceSubscription from 'components/overlays/ActivateServiceSubscription' @@ -58,12 +51,16 @@ type SubscriptionDataType = { appId: string subscriptionId: string title: string + companyName: string + bpnNumber: string } const SubscriptionInitialData = { appId: '', subscriptionId: '', title: '', + companyName: '', + bpnNumber: '', } enum ActionKind { @@ -132,7 +129,6 @@ export default function SubscriptionElements({ }) { const theme = useTheme() const { t } = useTranslation() - const dispatch = useDispatch() const [{ id, isTechUser, overlay, offerId, companyName }, setState] = useReducer(reducer, initialState) @@ -144,26 +140,6 @@ export default function SubscriptionElements({ return } - const showOverlay = ( - subscription: CompanySubscriptionData, - offerId: string - ) => { - if (type === SubscriptionTypes.APP_SUBSCRIPTION) { - dispatch(show(OVERLAYS.ADD_SUBSCRIPTION, subscription.subscriptionId)) - } else { - setState({ - type: ActionKind.SET_ID_OFFER_ID_TECH_USER_OVERLEY, - payload: { - id: subscription.subscriptionId, - offerId: offerId, - isTechUser: subscription.technicalUser, - overlay: true, - companyName: subscription.companyName, - }, - }) - } - } - return (
{subscriptions && subscriptions.length ? ( @@ -220,11 +196,19 @@ export default function SubscriptionElements({ appId: subscriptionData.offerId, subscriptionId: subscription.subscriptionId, title: subscriptionData.offerName, + companyName: subscription.companyName, + bpnNumber: subscription.bpnNumber, + }) + : setState({ + type: ActionKind.SET_ID_OFFER_ID_TECH_USER_OVERLEY, + payload: { + id: subscription.subscriptionId, + offerId: subscriptionData.offerId, + isTechUser: subscription.technicalUser, + overlay: true, + companyName: subscription.companyName, + }, }) - : showOverlay( - subscription, - subscriptionData.offerId - ) } />
@@ -284,6 +268,8 @@ export default function SubscriptionElements({ appId={subscriptionDetail.appId} subscriptionId={subscriptionDetail.subscriptionId} title={subscriptionDetail.title} + companyName={subscriptionDetail.companyName} + bpnNumber={subscriptionDetail.bpnNumber} handleOverlayClose={() => setSubscriptionDetail(SubscriptionInitialData) } diff --git a/src/features/admin/userApiSlice.ts b/src/features/admin/userApiSlice.ts index cd1e04a39..90f36aaf8 100644 --- a/src/features/admin/userApiSlice.ts +++ b/src/features/admin/userApiSlice.ts @@ -79,6 +79,11 @@ export type AdminData = { email: string } +export enum CompanyRoleEnum { + APP_PROVIDER = 'APP_PROVIDER', + SERVICE_PROVIDER = 'SERVICE_PROVIDER', +} + export interface CompanyDetails { bpn: string city: string @@ -93,6 +98,7 @@ export interface CompanyDetails { streetNumber: string taxId: string zipCode: string + companyRole: CompanyRoleEnum } export const apiSlice = createApi({ diff --git a/src/features/appSubscription/appSubscriptionApiSlice.ts b/src/features/appSubscription/appSubscriptionApiSlice.ts index 187ef45f2..350886891 100644 --- a/src/features/appSubscription/appSubscriptionApiSlice.ts +++ b/src/features/appSubscription/appSubscriptionApiSlice.ts @@ -42,6 +42,7 @@ export type TechnicalUserData = { export type SubscriptionDetailResponse = { id: string + appInstanceId: string offerSubscriptionStatus: string name: string customer: string @@ -69,6 +70,7 @@ export type MetaBody = { } export type CompanySubscriptionData = { + bpnNumber: string companyId: string companyName: string subscriptionId: string @@ -97,9 +99,11 @@ export type SubscriptionActivationResponse = { technicalUserId: string technicalUserSecret: string technicalClientId: string + technicalUserPermissions: string[] } clientInfo: { clientId: string + clientUrl: string } } diff --git a/src/services/AccessService.tsx b/src/services/AccessService.tsx index a56bdea3d..7954c5c0d 100644 --- a/src/services/AccessService.tsx +++ b/src/services/AccessService.tsx @@ -23,7 +23,6 @@ import UserService from './UserService' import { Route } from 'react-router-dom' import AppInfo from 'components/overlays/AppInfo' import AddBPN from 'components/overlays/AddBPN' -import ActivateSubscription from 'components/overlays/ActivateSubscription' import { AddUser } from 'components/overlays/AddUser' import NewsDetail from 'components/overlays/NewsDetail' import UserInfo from 'components/overlays/UserInfo' @@ -136,8 +135,6 @@ export const getOverlay = (overlay: OverlayState) => { return case OVERLAYS.ADD_BPN: return - case OVERLAYS.ADD_SUBSCRIPTION: - return case OVERLAYS.PARTNER: return case OVERLAYS.APP: diff --git a/src/types/Config.tsx b/src/types/Config.tsx index e50a21e76..0e4d97758 100644 --- a/src/types/Config.tsx +++ b/src/types/Config.tsx @@ -496,10 +496,6 @@ export const ALL_OVERLAYS: IOverlay[] = [ name: OVERLAYS.ADD_BPN, role: ROLES.MODIFY_USER_ACCOUNT, }, - { - name: OVERLAYS.ADD_SUBSCRIPTION, - role: ROLES.ACTIVATE_SUBSCRIPTION, - }, { name: OVERLAYS.ADD_USER, role: ROLES.USERMANAGEMENT_ADD, diff --git a/yarn.lock b/yarn.lock index 0e435d4ae..8745bd971 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1175,10 +1175,10 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@catena-x/portal-shared-components@^2.0.5": - version "2.0.5" - resolved "https://registry.yarnpkg.com/@catena-x/portal-shared-components/-/portal-shared-components-2.0.5.tgz#398efbc02e1ff9bf802b16f6c7acb78ce054256a" - integrity sha512-TDd0QcGXzEBFhOELpPQpbcapOiwZIR8aJcLkvSg618vU347gjoL6W2BZK7PCGLcVOXihn9deGtxLJwXcRpVjbQ== +"@catena-x/portal-shared-components@^2.0.11": + version "2.0.11" + resolved "https://registry.yarnpkg.com/@catena-x/portal-shared-components/-/portal-shared-components-2.0.11.tgz#be7d24d78dc3844d53a77d03b6b25e8bb2e2a395" + integrity sha512-vFZEVlqfJS5H8VSTfWhXXlCFCbbxI66x1Fz/qw48Tp2H5h+5H83e0XcvyEePG2ldk3DvRJyl6eaZyJQ1Ncg/7w== dependencies: "@mui/base" "^5.0.0-beta.3" "@mui/system" "^5.13.2"