From 63203109e676b05e6f4fadc00435a6abb35d3c2d Mon Sep 17 00:00:00 2001 From: lavanya-bmw <106523828+lavanya-bmw@users.noreply.github.com> Date: Mon, 29 Apr 2024 14:13:20 +0530 Subject: [PATCH 1/7] feat(technical setup): connector registration overlay (#724) https://github.com/eclipse-tractusx/portal-frontend/issues/694 --- src/assets/locales/de/main.json | 2 +- src/assets/locales/en/main.json | 10 +-- .../overlays/AppMarketplaceRequest/index.tsx | 2 +- .../overlays/ServiceRequest/index.tsx | 2 +- .../CompanySubscriptions.scss | 6 +- .../components/ConnectorInsertForm.tsx | 13 ++-- .../AddConnectorOverlay/index.tsx | 68 +++++++++---------- src/types/Patterns.ts | 5 +- 8 files changed, 54 insertions(+), 54 deletions(-) diff --git a/src/assets/locales/de/main.json b/src/assets/locales/de/main.json index 8725eeab9..e48cf3ef4 100644 --- a/src/assets/locales/de/main.json +++ b/src/assets/locales/de/main.json @@ -1317,7 +1317,7 @@ } }, "serviceMarketplace": { - "headline": "Purchase Service Request", + "headline": "Service-Abonnement", "desc1": "Wenn Sie unten „Bestätigen“ auswählen, benachrichtigen Sie den App-Anbieter umgehend über Ihr Interesse an seinem Dienst und er beginnt mit dem Abonnementverfahren. Sollte der Anbieter weitere Einzelheiten benötigen, um fortzufahren, wird er sich direkt an Sie wenden.", "desc2": "Sobald alle notwendigen Informationen bestätigt und alle Fragen geklärt sind, wird der App-Anbieter mit der Aktivierung Ihres App-Mandanten fortfahren. Sie erhalten eine Benachrichtigung, die Sie durch alle weiteren Schritte führt, die Ihrerseits erforderlich sind.", "desc3": "WICHTIGER HINWEIS:WICHTIGER HINWEIS:", diff --git a/src/assets/locales/en/main.json b/src/assets/locales/en/main.json index f06a9411f..ac1b821c1 100644 --- a/src/assets/locales/en/main.json +++ b/src/assets/locales/en/main.json @@ -684,7 +684,9 @@ "tooltipMsg": "Description for new technical user", "mandatoryError": "Description is mandatory", "patternError": "Username should start with a letter. Allowed special characters are #. '!=()&” along with numbers and spaces" - } + }, + "minLength": "Minlength is", + "maxLength": "Maxlength is" }, "create": { "successTitle": "Create connector successfully completed", @@ -697,9 +699,7 @@ "successDescription": "Delete connector successfully completed.", "errorTitle": "Something went wrong", "errorDescription": "Something went wrong. Please try it later again or contact your administrator." - }, - "minLength": "Minlength is", - "maxLength": "Maxlength is" + } } }, "partnernetwork": { @@ -1279,7 +1279,7 @@ } }, "serviceMarketplace": { - "headline": "Purchase Service Request", + "headline": "Service Subscription", "desc1": "By selecting 'Confirm' below, you will promptly notify the app provider of your interest in their service, and they will commence the subscription procedure. Should the provider require further details to proceed, they will reach out to you directly.", "desc2": "Once all necessary information has been confirmed and any queries resolved, the app provider will proceed to activate your app tenant. You will receive a notification to guide you through any subsequent steps required on your part.", "desc3": "IMPORTANT NOTICE:", diff --git a/src/components/overlays/AppMarketplaceRequest/index.tsx b/src/components/overlays/AppMarketplaceRequest/index.tsx index 1fd5a391f..7ecbe46ab 100644 --- a/src/components/overlays/AppMarketplaceRequest/index.tsx +++ b/src/components/overlays/AppMarketplaceRequest/index.tsx @@ -131,7 +131,7 @@ export default function AppMarketplaceRequest({ id }: { id: string }) { {t('content.appMarketplace.desc2')} - + {t('content.appMarketplace.desc3')} diff --git a/src/components/overlays/ServiceRequest/index.tsx b/src/components/overlays/ServiceRequest/index.tsx index e00f15a1c..106aa1041 100644 --- a/src/components/overlays/ServiceRequest/index.tsx +++ b/src/components/overlays/ServiceRequest/index.tsx @@ -112,7 +112,7 @@ export default function ServiceRequest({ id }: { id: string }) { {t('content.serviceMarketplace.desc2')} - + {t('content.serviceMarketplace.desc3')} diff --git a/src/components/pages/CompanySubscriptions/CompanySubscriptions.scss b/src/components/pages/CompanySubscriptions/CompanySubscriptions.scss index 9974a8599..50985721c 100644 --- a/src/components/pages/CompanySubscriptions/CompanySubscriptions.scss +++ b/src/components/pages/CompanySubscriptions/CompanySubscriptions.scss @@ -50,7 +50,7 @@ } .statusButton { - text-transform: none; - pointer-events: 'none'; - padding-left: 0; + text-transform: none !important; + pointer-events: none !important; + padding-left: 0 !important; } diff --git a/src/components/pages/EdcConnector/AddConnectorOverlay/components/ConnectorInsertForm.tsx b/src/components/pages/EdcConnector/AddConnectorOverlay/components/ConnectorInsertForm.tsx index a34e587d1..42e3d7bee 100644 --- a/src/components/pages/EdcConnector/AddConnectorOverlay/components/ConnectorInsertForm.tsx +++ b/src/components/pages/EdcConnector/AddConnectorOverlay/components/ConnectorInsertForm.tsx @@ -37,6 +37,7 @@ import { ConnectType } from 'features/connector/connectorApiSlice' import { Dropzone } from '../../../../shared/basic/Dropzone' import { useEffect, useState } from 'react' import './EdcComponentStyles.scss' +import { ConnectorFormFields } from '..' const ConnectorFormInput = ({ control, @@ -216,7 +217,7 @@ any) => { placeholder={placeholder} onChangeItem={(e) => { onChange( - name === 'ConnectorTechnicalUser' + name === ConnectorFormFields.ConnectorTechnicalUser ? e.serviceAccountId : e.subscriptionId ) @@ -358,7 +359,7 @@ any) => { trigger, errors, type: 'select', - name: 'ConnectorTechnicalUser', + name: ConnectorFormFields.ConnectorTechnicalUser, rules: { required: true, }, @@ -499,7 +500,7 @@ any) => { trigger, errors, type: 'input', - name: 'ConnectorName', + name: ConnectorFormFields.ConnectorName, minLength: 2, maxLength: 20, pattern: Patterns.connectors.NAME, @@ -530,7 +531,7 @@ any) => { trigger, errors, type: 'input', - name: 'ConnectorURL', + name: ConnectorFormFields.ConnectorURL, pattern: Patterns.URL, rules: { required: t( @@ -555,7 +556,7 @@ any) => { trigger, errors, type: 'input', - name: 'ConnectorLocation', + name: ConnectorFormFields.ConnectorLocation, pattern: Patterns.connectors.COUNTRY, rules: { required: t( @@ -582,7 +583,7 @@ any) => { trigger, errors, type: 'select', - name: 'ConnectorSubscriptionId', + name: ConnectorFormFields.ConnectorSubscriptionId, rules: { required: true, }, diff --git a/src/components/pages/EdcConnector/AddConnectorOverlay/index.tsx b/src/components/pages/EdcConnector/AddConnectorOverlay/index.tsx index 1338bed48..e2e6488a4 100644 --- a/src/components/pages/EdcConnector/AddConnectorOverlay/index.tsx +++ b/src/components/pages/EdcConnector/AddConnectorOverlay/index.tsx @@ -74,6 +74,14 @@ const formFields = { TechnicalUserDescription: '', } +export enum ConnectorFormFields { + ConnectorSubscriptionId = 'ConnectorSubscriptionId', + ConnectorTechnicalUser = 'ConnectorTechnicalUser', + ConnectorLocation = 'ConnectorLocation', + ConnectorURL = 'ConnectorURL', + ConnectorName = 'ConnectorName', +} + const AddConnectorOverlay = ({ openDialog = false, connectorStep, @@ -115,11 +123,11 @@ const AddConnectorOverlay = ({ newTechnicalUSer && !newUserSuccess ? await trigger(['TechnicalUserName', 'TechnicalUserDescription']) : await trigger([ - 'ConnectorName', - 'ConnectorURL', - 'ConnectorLocation', - 'ConnectorSubscriptionId', - 'ConnectorTechnicalUser', + ConnectorFormFields.ConnectorName, + ConnectorFormFields.ConnectorURL, + ConnectorFormFields.ConnectorLocation, + ConnectorFormFields.ConnectorSubscriptionId, + ConnectorFormFields.ConnectorTechnicalUser, ]) if (validateFields) { newTechnicalUSer && !newUserSuccess @@ -132,35 +140,12 @@ const AddConnectorOverlay = ({ setSelected(service) } - const getTitle = () => { - if (connectorStep === 1 && selected.type === 'MANAGED_CONNECTOR') - return t('content.edcconnector.modal.managed.title') - else if ( - connectorStep === 1 && - selected.type === ConnectType.COMPANY_CONNECTOR - ) { - return t('content.edcconnector.modal.company.title') - } else return t('content.edcconnector.modal.title') - } - const getIntro = () => { - if ( - connectorStep === 1 && - selected.type === ConnectType.MANAGED_CONNECTOR - ) { - return t('content.edcconnector.modal.managed.intro') - } else if ( - connectorStep === 1 && - selected.type === ConnectType.COMPANY_CONNECTOR - ) { - return ( - - {t('content.edcconnector.modal.company.intro')} - - ) - } else { - return t('content.edcconnector.modal.intro') - } + const getTypeKey = (type: ConnectType | undefined) => { + if (connectorStep === 1) { + return type === ConnectType.MANAGED_CONNECTOR ? 'managed.' : 'company.' + } else return '' } + return (
+ {t( + `content.edcconnector.modal.${getTypeKey(selected.type)}intro` + )} + + ) : ( + t(`content.edcconnector.modal.${getTypeKey(selected.type)}intro`) + ) + } closeWithIcon={true} onCloseWithIcon={() => { setSelected({}) diff --git a/src/types/Patterns.ts b/src/types/Patterns.ts index 1be0f92ed..18b42d148 100644 --- a/src/types/Patterns.ts +++ b/src/types/Patterns.ts @@ -88,8 +88,9 @@ export const Patterns = { connectors: { NAME: /^[^-\s()'"#@.&](?!.*[%&?,';:!\s-]{2}).{1,19}$/, COUNTRY: /^[A-Z]{2}$/, - TECHNICAL_USER_NAME: /^[A-Za-z]+[a-zA-Z0-9 =.!&#'"()]{2,80}$/, - TECHNICAL_USER_DESCRIPTION: /^[A-Za-z]+[a-zA-Z0-9 =.!&#'"()]{2,120}$/, + TECHNICAL_USER_NAME: /^[A-Za-z][a-zA-ZÀ-ÿ0-9 !&#'"()_\-=/.,;:]{1,80}$/, + TECHNICAL_USER_DESCRIPTION: + /^[A-Za-z][a-zA-ZÀ-ÿ0-9 !@&#'"()_\-=/*.,;:]{1,120}$/, }, CANCEL_INPUT: /^[a-z0-9 ?*%$#@!-](?=)/i, techuser: { From a564a7ce7ebd72cbbeffdf868a2aee43158b291a Mon Sep 17 00:00:00 2001 From: nidhigarg-bmw <101316912+nidhigarg-bmw@users.noreply.github.com> Date: Tue, 30 Apr 2024 13:35:27 +0530 Subject: [PATCH 2/7] feat(partner network): improve overlay (#747) https://github.com/eclipse-tractusx/portal-frontend/issues/671 --- CHANGELOG.md | 6 + index.html | 2 +- scripts/inject-dynamic-env.sh | 2 +- src/assets/locales/de/main.json | 7 +- src/assets/locales/en/main.json | 7 +- .../overlays/BusinessPartnerInfo/index.tsx | 13 +- .../BusinessPartnerDetailContent.tsx | 188 +++++++----------- src/components/pages/PartnerNetwork/index.tsx | 5 +- .../shared/basic/KeyValueView/index.tsx | 1 - .../partnerNetworkApiSlice.ts | 19 +- 10 files changed, 118 insertions(+), 132 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 52900448d..18b16cfe9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 2.0.0-RC5 + +### Feature + +- Partner Network - Improve Overlay of Company Data + ## 2.0.0-RC4 ### Feature diff --git a/index.html b/index.html index 45159416a..79209426f 100644 --- a/index.html +++ b/index.html @@ -29,7 +29,7 @@
diff --git a/scripts/inject-dynamic-env.sh b/scripts/inject-dynamic-env.sh index 793f89883..c371fae97 100644 --- a/scripts/inject-dynamic-env.sh +++ b/scripts/inject-dynamic-env.sh @@ -22,7 +22,7 @@ # Define custom variable custom_env_vars='{PORTAL_ASSETS_URL:"'$PORTAL_ASSETS_URL'",PORTAL_BACKEND_URL:"'$PORTAL_BACKEND_URL'",CENTRALIDP_URL:"'$CENTRALIDP_URL'",SSI_CREDENTIAL_URL:"'$SSI_CREDENTIAL_URL'",BPDM_API_URL:"'$BPDM_API_URL'",SEMANTICS_URL:"'$SEMANTICS_URL'",MANAGED_IDENTITY_WALLETS_NEW_URL:"'$MANAGED_IDENTITY_WALLETS_NEW_URL'",REALM:"'$REALM'",CLIENT_ID:"'$CLIENT_ID'",CLIENT_ID_SEMANTIC:"'$CLIENT_ID_SEMANTIC'",CLIENT_ID_MIW:"'$CLIENT_ID_MIW'",CLIENT_ID_SSI_CREDENTIAL:"'$CLIENT_ID_SSI_CREDENTIAL'"}' # Define anchor variable -custom_env_vars_anchor='{PORTAL_ASSETS_URL:"http://localhost:3000/assets",PORTAL_BACKEND_URL:"https://portal-backend.example.org",CENTRALIDP_URL:"https://centralidp.example.org/auth",SSI_CREDENTIAL_URL:"https://ssi-credential-issuer.example.org",BPDM_API_URL:"https://business-partners.example.org/pool/api",SEMANTICS_URL:"https://semantics.example.org",MANAGED_IDENTITY_WALLETS_NEW_URL:"https://managed-identity-wallets-new.example.org",REALM:"CX-Central",CLIENT_ID:"Cl2-CX-Portal",CLIENT_ID_SEMANTIC:"Cl3-CX-Semantic",CLIENT_ID_MIW:"Cl5-CX-Custodian",CLIENT_ID_SSI_CREDENTIAL:"Cl24-CX-SSI-CredentialIssuer"}' +custom_env_vars_anchor='{PORTAL_ASSETS_URL:"http://localhost:3000/assets",PORTAL_BACKEND_URL:"https://portal-backend.example.org",CENTRALIDP_URL:"https://centralidp.example.org/auth",SSI_CREDENTIAL_URL:"https://ssi-credential-issuer.example.org",BPDM_API_URL:"https://business-partners.example.org/pool/v6",SEMANTICS_URL:"https://semantics.example.org",MANAGED_IDENTITY_WALLETS_NEW_URL:"https://managed-identity-wallets-new.example.org",REALM:"CX-Central",CLIENT_ID:"Cl2-CX-Portal",CLIENT_ID_SEMANTIC:"Cl3-CX-Semantic",CLIENT_ID_MIW:"Cl5-CX-Custodian",CLIENT_ID_SSI_CREDENTIAL:"Cl24-CX-SSI-CredentialIssuer"}' # Read content of the reference index.html file into the index_html_reference variable index_html_reference=`cat /usr/share/nginx/html/index.html.reference` # Replace the anchor variable with the custom variable in the index.html file diff --git a/src/assets/locales/de/main.json b/src/assets/locales/de/main.json index e48cf3ef4..3f8df80cd 100644 --- a/src/assets/locales/de/main.json +++ b/src/assets/locales/de/main.json @@ -728,9 +728,12 @@ "membershipnotificationdescription": "Bitte beachten Sie, dass die Mitgliedsinformationen möglicherweise falsch sind.", "searchbuttonlabel": "Suche", "overlay": { - "title": "Firmendetails", + "title": "Details zu Geschäftspartnerdaten", "companydatatitle": "Firmen Data", - "legalform": "Rechtsform" + "legalform": "Rechtsform", + "identifiers": "Identifiers", + "documents": "Documents", + "noData": "No data available" } }, "invite": { diff --git a/src/assets/locales/en/main.json b/src/assets/locales/en/main.json index ac1b821c1..70dfd76df 100644 --- a/src/assets/locales/en/main.json +++ b/src/assets/locales/en/main.json @@ -727,9 +727,12 @@ "membershipnotificationtitle": "Membership flag cannot be fetched.", "membershipnotificationdescription": "Please note that the membership information might be incorrect.", "overlay": { - "title": "Company Detail", + "title": "Business Partner Data Details", "companydatatitle": "Company Data", - "legalform": "Legal Form" + "legalform": "Legal Form", + "identifiers": "Identifiers", + "documents": "Documents", + "noData": "No data available" } }, "invite": { diff --git a/src/components/overlays/BusinessPartnerInfo/index.tsx b/src/components/overlays/BusinessPartnerInfo/index.tsx index ab8a242fd..68a1e1589 100644 --- a/src/components/overlays/BusinessPartnerInfo/index.tsx +++ b/src/components/overlays/BusinessPartnerInfo/index.tsx @@ -19,7 +19,12 @@ ********************************************************************************/ import BusinessPartnerDetail from 'components/pages/PartnerNetwork/components/BusinessPartnerDetailOverlay/BusinessPartnerDetail' -import { DialogContent, DialogHeader } from '@catena-x/portal-shared-components' +import { + Button, + DialogActions, + DialogContent, + DialogHeader, +} from '@catena-x/portal-shared-components' import { closeOverlay } from 'features/control/overlay' import { useTranslation } from 'react-i18next' import { useDispatch } from 'react-redux' @@ -43,6 +48,12 @@ export default function BusinessPartnerInfo({ id }: { id: string }) { + + + + ) } diff --git a/src/components/pages/PartnerNetwork/components/BusinessPartnerDetailOverlay/BusinessPartnerDetailContent.tsx b/src/components/pages/PartnerNetwork/components/BusinessPartnerDetailOverlay/BusinessPartnerDetailContent.tsx index 9360c9528..d86339045 100644 --- a/src/components/pages/PartnerNetwork/components/BusinessPartnerDetailOverlay/BusinessPartnerDetailContent.tsx +++ b/src/components/pages/PartnerNetwork/components/BusinessPartnerDetailOverlay/BusinessPartnerDetailContent.tsx @@ -18,14 +18,13 @@ * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ -import { Box, Grid, useTheme } from '@mui/material' +import { Box, Grid } from '@mui/material' import { useTranslation } from 'react-i18next' import { Typography } from '@catena-x/portal-shared-components' import type { BpdmTypeUUIDKeyPair, BusinessPartner, } from 'features/partnerNetwork/types' -import DetailGridRow from './DetailGridRow' import { useFetchCompanyCertificateQuery, useFetchDocumentQuery, @@ -33,6 +32,7 @@ import { import ArticleIcon from '@mui/icons-material/Article' import { useEffect, useState } from 'react' import { download } from 'utils/downloadUtils' +import { KeyValueView } from 'components/shared/basic/KeyValueView' const BusinessPartnerDetailContent = ({ selectedRowBPN, @@ -40,8 +40,6 @@ const BusinessPartnerDetailContent = ({ selectedRowBPN: BusinessPartner }) => { const { t } = useTranslation() - const theme = useTheme() - const { spacing } = theme const { data: certificates } = useFetchCompanyCertificateQuery( selectedRowBPN.bpnl ) @@ -58,119 +56,73 @@ const BusinessPartnerDetailContent = ({ } }, [document]) + const companyData = [ + { + key: t('content.partnernetwork.columns.name'), + value: selectedRowBPN.legalName ?? '', + }, + { + key: t('content.partnernetwork.columns.bpn'), + value: selectedRowBPN.bpnl ?? '', + }, + { + key: t('content.partnernetwork.overlay.legalform'), + value: selectedRowBPN.legalForm?.name ?? '', + }, + { + key: t('content.partnernetwork.columns.street'), + value: selectedRowBPN.legalAddress?.physicalPostalAddress?.street?.name, + }, + { + key: t('content.partnernetwork.columns.city'), + value: `${selectedRowBPN.legalAddress?.physicalPostalAddress?.postalCode} ${selectedRowBPN.legalAddress?.physicalPostalAddress?.city}`, + }, + { + key: t('content.partnernetwork.columns.country'), + value: + selectedRowBPN.legalAddress?.physicalPostalAddress?.country?.name ?? '', + }, + ] + + const identifierData = selectedRowBPN.identifiers?.map( + (identifier: BpdmTypeUUIDKeyPair) => { + return { + key: identifier.type?.name || identifier.type?.technicalKey, + value: identifier.value, + } + } + ) + return ( <> {selectedRowBPN && ( - - - - - {t('content.partnernetwork.overlay.companydatatitle')} - - - - - {selectedRowBPN.legalForm && ( - - )} - - Address - - - - - - Identifiers - - {selectedRowBPN.identifiers?.map( - (identifier: BpdmTypeUUIDKeyPair) => { - return ( - - ) - } - )} - - Certificates - - - + + + + 0 + ? '' + : t('content.partnernetwork.overlay.noData'), + }} + /> + {certificates?.map( (certificate: { documentId: string @@ -185,7 +137,13 @@ const BusinessPartnerDetailContent = ({ setDocumentId(certificate.documentId) }} > - + {certificate.companyCertificateType} { setAllItems([]) return } + const result = cData.content.map((x: BusinessPartner) => x.bpnl) - await mutationRequest(result) + await mutationRequest({ bpnLs: result, legalName: '' }) .unwrap() .then((payload: PaginResult) => { //new country attribute && member attributes based on the response let finalObj = JSON.parse(JSON.stringify(cData?.content)) finalObj = addCountryAttribute( finalObj, - payload as unknown as BusinessPartnerAddressResponse[] + payload.content as unknown as BusinessPartnerAddressResponse[] ) finalObj = addMemberAttribute(finalObj, data) setAllItems(finalObj) diff --git a/src/components/shared/basic/KeyValueView/index.tsx b/src/components/shared/basic/KeyValueView/index.tsx index a6078b9e5..27bd5e99d 100644 --- a/src/components/shared/basic/KeyValueView/index.tsx +++ b/src/components/shared/basic/KeyValueView/index.tsx @@ -176,7 +176,6 @@ export const KeyValueView = ({ key={JSON.stringify(items.value)} sx={{ padding: '18px 24px', - borderBottom: '1px solid #EDF0F4', }} > {renderValueItem(items)} diff --git a/src/features/newPartnerNetwork/partnerNetworkApiSlice.ts b/src/features/newPartnerNetwork/partnerNetworkApiSlice.ts index c8089dba1..3d692f9f0 100644 --- a/src/features/newPartnerNetwork/partnerNetworkApiSlice.ts +++ b/src/features/newPartnerNetwork/partnerNetworkApiSlice.ts @@ -28,6 +28,11 @@ import type { BusinessPartner } from './types' import Patterns from 'types/Patterns' import type { BusinessPartnerAddressResponse } from 'features/partnerNetwork/types' +export interface BusinessPartnerRequest { + bpnLs: string[] + legalName: string +} + const checkIfBPNLNumber = (text: string): boolean => Patterns.BPN.test(text.trim()) @@ -37,12 +42,12 @@ export const apiSlice = createApi({ endpoints: (builder) => ({ fetchBusinessPartnerAddress: builder.mutation< PaginResult, - string[] + BusinessPartnerRequest >({ - query: (arry) => ({ - url: '/catena/legal-entities/legal-addresses/search', + query: (body) => ({ + url: '/legal-entities/search?page=0&size=30', method: 'POST', - body: arry, + body, }), }), fetchBusinessPartners: builder.query< @@ -51,13 +56,13 @@ export const apiSlice = createApi({ >({ query: (fetchArgs) => { if (fetchArgs.args.expr && !checkIfBPNLNumber(fetchArgs.args.expr)) { - return `/catena/legal-entities?page=${ + return `/legal-entities?page=${ fetchArgs.page }&size=10&legalName=${fetchArgs.args!.expr}` } else if (checkIfBPNLNumber(fetchArgs.args.expr)) { - return `/catena/legal-entities/${fetchArgs.args!.expr}` + return `/legal-entities/${fetchArgs.args!.expr}` } else { - return `/catena/legal-entities?page=${fetchArgs.page}&size=10` + return `/legal-entities?page=${fetchArgs.page}&size=10` } }, // Add an ESLint exception until there is a solution From 4ebd73b908488def77294892f419fc2ceca9737f Mon Sep 17 00:00:00 2001 From: nidhigarg-bmw <101316912+nidhigarg-bmw@users.noreply.github.com> Date: Thu, 2 May 2024 10:51:36 +0530 Subject: [PATCH 3/7] feat(partner network): add translation and change type (#750) https://github.com/eclipse-tractusx/portal-frontend/issues/671 --- DEPENDENCIES | 2 +- src/assets/locales/de/main.json | 2 +- src/assets/locales/en/main.json | 2 +- .../BusinessPartnerDetailContent.tsx | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/DEPENDENCIES b/DEPENDENCIES index 975b6cc72..4951d8ba0 100644 --- a/DEPENDENCIES +++ b/DEPENDENCIES @@ -455,7 +455,7 @@ npm/npmjs/-/safe-regex-test/1.0.3, MIT, approved, clearlydefined npm/npmjs/-/safer-buffer/2.1.2, MIT, approved, clearlydefined npm/npmjs/-/sass/1.72.0, MIT, approved, clearlydefined npm/npmjs/-/saxes/6.0.0, ISC, approved, clearlydefined -npm/npmjs/-/scheduler/0.23.0, MIT, approved, clearlydefined +npm/npmjs/-/scheduler/0.23.0, MIT, approved, #14589 npm/npmjs/-/semver/6.3.1, ISC, approved, clearlydefined npm/npmjs/-/semver/7.6.0, ISC, approved, clearlydefined npm/npmjs/-/set-function-length/1.2.2, MIT, approved, #12772 diff --git a/src/assets/locales/de/main.json b/src/assets/locales/de/main.json index 3f8df80cd..b7a53e2f1 100644 --- a/src/assets/locales/de/main.json +++ b/src/assets/locales/de/main.json @@ -732,7 +732,7 @@ "companydatatitle": "Firmen Data", "legalform": "Rechtsform", "identifiers": "Identifiers", - "documents": "Documents", + "certificates": "Firmenzertifikate", "noData": "No data available" } }, diff --git a/src/assets/locales/en/main.json b/src/assets/locales/en/main.json index 70dfd76df..2aa3e0803 100644 --- a/src/assets/locales/en/main.json +++ b/src/assets/locales/en/main.json @@ -731,7 +731,7 @@ "companydatatitle": "Company Data", "legalform": "Legal Form", "identifiers": "Identifiers", - "documents": "Documents", + "certificates": "Company Certificates", "noData": "No data available" } }, diff --git a/src/components/pages/PartnerNetwork/components/BusinessPartnerDetailOverlay/BusinessPartnerDetailContent.tsx b/src/components/pages/PartnerNetwork/components/BusinessPartnerDetailOverlay/BusinessPartnerDetailContent.tsx index d86339045..c207d1576 100644 --- a/src/components/pages/PartnerNetwork/components/BusinessPartnerDetailOverlay/BusinessPartnerDetailContent.tsx +++ b/src/components/pages/PartnerNetwork/components/BusinessPartnerDetailOverlay/BusinessPartnerDetailContent.tsx @@ -113,7 +113,7 @@ const BusinessPartnerDetailContent = ({ /> Date: Thu, 2 May 2024 10:55:57 +0530 Subject: [PATCH 4/7] fix(application requests): fix wrong role (#751) https://github.com/eclipse-tractusx/portal-frontend/issues/716 --- CHANGELOG.md | 5 +++++ src/assets/locales/de/main.json | 1 + src/assets/locales/en/main.json | 1 + .../RegistrationRequests/CompanyDetailOverlay/index.tsx | 2 ++ 4 files changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 18b16cfe9..5f42322d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,11 @@ - Partner Network - Improve Overlay of Company Data +### Bugfix + +- Application Requests + - Company data overlay wrong role chipcard + ## 2.0.0-RC4 ### Feature diff --git a/src/assets/locales/de/main.json b/src/assets/locales/de/main.json index b7a53e2f1..8671fb01a 100644 --- a/src/assets/locales/de/main.json +++ b/src/assets/locales/de/main.json @@ -190,6 +190,7 @@ "roles": "Company Role(s)", "activeParticipation": "Teilnehmer", "appProvider": "App Anbieter", + "onboardingProvider": "Onboarding Service Anbieter", "serviceProvider": "Service Anbieter", "noinfo": "no data available", "commercialRegisterNumber": "Handelsregisternummer", diff --git a/src/assets/locales/en/main.json b/src/assets/locales/en/main.json index 2aa3e0803..363b8c5b7 100644 --- a/src/assets/locales/en/main.json +++ b/src/assets/locales/en/main.json @@ -189,6 +189,7 @@ "roles": "Company Role(s)", "activeParticipation": "Participant", "appProvider": "App Provider", + "onboardingProvider": "Onboarding Service Provider", "serviceProvider": "Service Provider", "noinfo": "no data available", "commercialRegisterNumber": "Commercial Register Number", diff --git a/src/components/pages/Admin/components/RegistrationRequests/CompanyDetailOverlay/index.tsx b/src/components/pages/Admin/components/RegistrationRequests/CompanyDetailOverlay/index.tsx index cabd586ca..6fa4db3d5 100644 --- a/src/components/pages/Admin/components/RegistrationRequests/CompanyDetailOverlay/index.tsx +++ b/src/components/pages/Admin/components/RegistrationRequests/CompanyDetailOverlay/index.tsx @@ -82,6 +82,8 @@ const CompanyDetailOverlay = ({ ) } else if (str === 'APP_PROVIDER') { return t('content.admin.registration-requests.overlay.appProvider') + } else if (str === 'ONBOARDING_SERVICE_PROVIDER') { + return t('content.admin.registration-requests.overlay.onboardingProvider') } else { return t('content.admin.registration-requests.overlay.serviceProvider') } From 5fb1a5a7a415443e497f273f31f774c7d525edf3 Mon Sep 17 00:00:00 2001 From: nidhigarg-bmw <101316912+nidhigarg-bmw@users.noreply.github.com> Date: Thu, 2 May 2024 12:02:13 +0530 Subject: [PATCH 5/7] feat(admin credential): adjust document data and sorting (#748) https://github.com/eclipse-tractusx/portal-frontend/issues/620 --- DEPENDENCIES | 2 +- package.json | 2 +- src/assets/locales/de/main.json | 13 +-- src/assets/locales/en/main.json | 13 +-- .../AdminCredential/AdminCredential.scss | 1 + .../AdminCredentialElements.tsx | 96 ++++++++++++------- .../components/AppUserDetailsTable/index.tsx | 6 +- .../certification/certificationApiSlice.tsx | 22 +++-- yarn.lock | 8 +- 9 files changed, 101 insertions(+), 62 deletions(-) diff --git a/DEPENDENCIES b/DEPENDENCIES index 4951d8ba0..508c0c626 100644 --- a/DEPENDENCIES +++ b/DEPENDENCIES @@ -599,7 +599,7 @@ npm/npmjs/@babel/template/7.24.0, MIT, approved, clearlydefined npm/npmjs/@babel/traverse/7.24.1, MIT AND (BSD-2-Clause AND ISC AND MIT) AND BSD-2-Clause AND BSD-3-Clause, approved, #13926 npm/npmjs/@babel/types/7.24.0, MIT, approved, clearlydefined npm/npmjs/@bcoe/v8-coverage/0.2.3, ISC AND MIT, approved, clearlydefined -npm/npmjs/@catena-x/portal-shared-components/3.0.4, Apache-2.0 AND CC-BY-4.0 AND OFL-1.1, approved, #14247 +npm/npmjs/@catena-x/portal-shared-components/3.0.7, Apache-2.0 AND CC-BY-4.0 AND OFL-1.1, approved, #14247 npm/npmjs/@cspotcode/source-map-support/0.8.1, MIT, approved, clearlydefined npm/npmjs/@date-io/core/3.0.0, MIT, approved, clearlydefined npm/npmjs/@date-io/date-fns/3.0.0, MIT, approved, #14023 diff --git a/package.json b/package.json index 627b91e44..70fb1b085 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ ] }, "dependencies": { - "@catena-x/portal-shared-components": "^3.0.4", + "@catena-x/portal-shared-components": "^3.0.7", "@emotion/react": "^11.11.4", "@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 8671fb01a..eb305e8e3 100644 --- a/src/assets/locales/de/main.json +++ b/src/assets/locales/de/main.json @@ -1746,13 +1746,14 @@ "search": "Suchen via Name der Firma", "tabs": { "all": "Alle", - "open": "Offen", - "confirmed": "Bestätigt", - "declined": "Abgelehnt" + "pending": "Ausstehend", + "active": "Aktiv", + "inactive": "Inaktiv", + "revoked": "Widerrufen" }, - "sortOptions": { - "name": "Company Name", - "date": "Date" + "sort": { + "bpnlasc": "Business Partner Asc", + "bpnldesc": "Business Partner Desc" }, "table": { "crendentialType": "Type", diff --git a/src/assets/locales/en/main.json b/src/assets/locales/en/main.json index 363b8c5b7..34fba0240 100644 --- a/src/assets/locales/en/main.json +++ b/src/assets/locales/en/main.json @@ -1817,13 +1817,14 @@ "search": "...search for Company Name", "tabs": { "all": "All", - "open": "Open", - "confirmed": "Confirmed", - "declined": "Declined" + "pending": "Pending", + "active": "Active", + "inactive": "Inactive", + "revoked": "Revoked" }, - "sortOptions": { - "name": "By Name", - "date": "By Date" + "sort": { + "bpnlasc": "Business Partner Asc", + "bpnldesc": "Business Partner Desc" }, "table": { "crendentialType": "Type", diff --git a/src/components/pages/AdminCredential/AdminCredential.scss b/src/components/pages/AdminCredential/AdminCredential.scss index d52b2814d..bdc70b988 100644 --- a/src/components/pages/AdminCredential/AdminCredential.scss +++ b/src/components/pages/AdminCredential/AdminCredential.scss @@ -57,6 +57,7 @@ align-items: center; justify-content: center; cursor: pointer; + margin-right: 10px; .document-icon { color: #1977cc; font-size: 20px; diff --git a/src/components/pages/AdminCredential/AdminCredentialElements.tsx b/src/components/pages/AdminCredential/AdminCredentialElements.tsx index b94c18c21..ad16b7395 100644 --- a/src/components/pages/AdminCredential/AdminCredentialElements.tsx +++ b/src/components/pages/AdminCredential/AdminCredentialElements.tsx @@ -43,14 +43,16 @@ import { interface FetchHookArgsType { filterType: string + sortingType?: string expr: string } enum FilterType { - ALL = 'all', - OPEN = 'open', - CONFIRMED = 'confirmed', - DECLINED = 'declined', + ALL = '', + PENDING = 'PENDING', + ACTIVE = 'ACTIVE', + REVOKED = 'REVOKED', + INACTIVE = 'INACTIVE', } enum StatusType { @@ -58,12 +60,18 @@ enum StatusType { DECLINE = 'decline', } +enum SortType { + BPNLASC = 'BpnlAsc', + BPNLDESC = 'BpnlDesc', +} + export default function AdminCredentialElements() { const { t } = useTranslation() const dispatch = useDispatch() const [refresh, setRefresh] = useState(0) const [group, setGroup] = useState(FilterType.ALL) + const [sortOption, setSortOption] = useState(SortType.BPNLASC) const [searchExpr, setSearchExpr] = useState('') const [filterValueAPI, setFilterValueAPI] = useState('') const [fetchHookArgs, setFetchHookArgs] = useState() @@ -76,23 +84,19 @@ export default function AdminCredentialElements() { const setView = (e: React.MouseEvent) => { const viewValue = e.currentTarget.value - if (viewValue === FilterType.OPEN) - setFilterValueAPI(SubscriptionStatus.PENDING) - else if (viewValue === FilterType.CONFIRMED) - setFilterValueAPI(SubscriptionStatus.ACTIVE) - else if (viewValue === FilterType.DECLINED) - setFilterValueAPI(SubscriptionStatus.INACTIVE) - else setFilterValueAPI('') + setFilterValueAPI(viewValue) setGroup(viewValue) setRefresh(Date.now()) } useEffect(() => { + console.log('sortOption', sortOption) setFetchHookArgs({ filterType: filterValueAPI, + sortingType: sortOption, expr: searchExpr, }) - }, [filterValueAPI, searchExpr]) + }, [filterValueAPI, sortOption, searchExpr]) const onValidate = (expr: string) => { const validateExpr = /^[ A-Za-z0-9]{1,1000}$/.test(expr) @@ -145,22 +149,38 @@ export default function AdminCredentialElements() { onButtonClick: setView, }, { - buttonText: t('content.adminCertificate.tabs.open'), - buttonValue: FilterType.OPEN, + buttonText: t('content.adminCertificate.tabs.pending'), + buttonValue: FilterType.PENDING, + onButtonClick: setView, + }, + { + buttonText: t('content.adminCertificate.tabs.active'), + buttonValue: FilterType.ACTIVE, onButtonClick: setView, }, { - buttonText: t('content.adminCertificate.tabs.confirmed'), - buttonValue: FilterType.CONFIRMED, + buttonText: t('content.adminCertificate.tabs.revoked'), + buttonValue: FilterType.REVOKED, onButtonClick: setView, }, { - buttonText: t('content.adminCertificate.tabs.declined'), - buttonValue: FilterType.DECLINED, + buttonText: t('content.adminCertificate.tabs.inactive'), + buttonValue: FilterType.INACTIVE, onButtonClick: setView, }, ] + const sortOptions = [ + { + label: t('content.adminCertificate.sort.bpnlasc'), + value: SortType.BPNLASC, + }, + { + label: t('content.adminCertificate.sort.bpnldesc'), + value: SortType.BPNLDESC, + }, + ] + const columns = [ { field: 'credentialType', @@ -184,22 +204,25 @@ export default function AdminCredentialElements() { field: 'document', headerName: t('content.adminCertificate.table.document'), flex: 1.5, - renderCell: ({ row }: { row: CredentialData }) => ( -
- - row.document.documentId && - handleDownloadClick( - row.document.documentId, - row.document.documentName - ) - } - /> -
- ), + renderCell: ({ row }: { row: CredentialData }) => + row.documents?.map((document) => { + return ( +
+ + document.documentId && + handleDownloadClick( + document.documentId, + document.documentName + ) + } + /> +
+ ) + }), }, { field: 'credentialDetailId', @@ -290,6 +313,11 @@ export default function AdminCredentialElements() { columns={columns} defaultFilter={group} filterViews={filterButtons} + defaultSortOption={sortOption} + sortOptions={sortOptions} + onSortClick={(value) => { + setSortOption(value) + }} />
) diff --git a/src/components/pages/AppUserManagement/components/AppUserDetailsTable/index.tsx b/src/components/pages/AppUserManagement/components/AppUserDetailsTable/index.tsx index 7990bed2e..2cddb26c4 100644 --- a/src/components/pages/AppUserManagement/components/AppUserDetailsTable/index.tsx +++ b/src/components/pages/AppUserManagement/components/AppUserDetailsTable/index.tsx @@ -35,7 +35,7 @@ export const AppUserDetailsTable = ({ roles, userRoleResponse, }: { - roles?: AppRole[] + roles: AppRole[] | undefined userRoleResponse: string }) => { const { t } = useTranslation() @@ -48,9 +48,9 @@ export const AppUserDetailsTable = ({ sectionTitle={'content.usermanagement.appUserDetails.subheadline'} addButtonLabel={'content.usermanagement.appUserDetails.table.add'} addButtonClick={() => dispatch(show(OVERLAYS.ADD_APP_USER_ROLES, appId))} - addButtonDisabled={!roles} + addButtonDisabled={roles && roles?.length <= 0} addButtonTooltip={ - !roles + roles && roles?.length <= 0 ? t('content.usermanagement.appUserDetails.table.buttonTooltip') : '' } diff --git a/src/features/certification/certificationApiSlice.tsx b/src/features/certification/certificationApiSlice.tsx index ae894f31e..692607f08 100644 --- a/src/features/certification/certificationApiSlice.tsx +++ b/src/features/certification/certificationApiSlice.tsx @@ -62,10 +62,10 @@ export type CredentialData = { useCase: string participantStatus: string expiryDate: string - document: { + documents: Array<{ documentId: string documentName: string - } + }> externalTypeDetail: { id: string verifiedCredentialExternalTypeId: string @@ -105,11 +105,19 @@ export const apiSlice = createApi({ }), fetchCredentialsSearch: builder.query( { - query: (fetchArgs) => ({ - url: `${getSsiBase()}/api/issuer?page=${ - fetchArgs.page - }&size=${PAGE_SIZE}`, - }), + query: (fetchArgs) => { + if (fetchArgs.args.filterType && fetchArgs.args.sortingType) { + return `${getSsiBase()}/api/issuer?page=${ + fetchArgs.page + }&size=${PAGE_SIZE}&sorting=${ + fetchArgs.args.sortingType ?? '' + }&companySsiDetailStatusId=${fetchArgs.args.filterType}` + } else { + return `${getSsiBase()}/api/issuer?page=${ + fetchArgs.page + }&size=${PAGE_SIZE}` + } + }, } ), approveCredential: builder.mutation({ diff --git a/yarn.lock b/yarn.lock index e72f49200..0e461d7e2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -336,10 +336,10 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@catena-x/portal-shared-components@^3.0.4": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@catena-x/portal-shared-components/-/portal-shared-components-3.0.4.tgz#d4121f48c6bba0e1ce1ae8b816f64b74be50eb89" - integrity sha512-83ztMjPKT77qCFqnkbj9sDhxvOBh9yL4Ck2yScz9TWfHGilyDKwU9D9HWVLxASgaSNs4Q6f5/t4jl/bZZYLm8g== +"@catena-x/portal-shared-components@^3.0.7": + version "3.0.7" + resolved "https://registry.yarnpkg.com/@catena-x/portal-shared-components/-/portal-shared-components-3.0.7.tgz#587c7cb83f84408c18500f5e6cb28a60e283e6af" + integrity sha512-mG3NUQajZquSnCWvcQ0jKR3tUkRi5JXBEtFTmjQln+MxnukLXcr7zyEfUT5P9tevlkc4qhHIZs/iAbAt2dgc8Q== dependencies: "@date-io/date-fns" "^3.0.0" "@emotion/react" "^11.11.4" From ee49a2091a2e9c4a83bbc885b6470882a7ab6b16 Mon Sep 17 00:00:00 2001 From: Evelyn Gurschler Date: Thu, 2 May 2024 16:47:25 +0200 Subject: [PATCH 6/7] docs(2.0.0-rc5): update changelog --- CHANGELOG.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f42322d5..7af422891 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,12 +4,14 @@ ### Feature -- Partner Network - Improve Overlay of Company Data +- Partner Network - improved overlay of Company Data +- Technical Setup - improved Connector Registration overlay +- Credential Management - adjusted document data and sorting ### Bugfix - Application Requests - - Company data overlay wrong role chipcard + - fixed displaying of incorrect company roles in case of requester company with role "Onboarding Service Provider" ## 2.0.0-RC4 From 433c7a9e197d66c94532a6f323d68fb3fc623405 Mon Sep 17 00:00:00 2001 From: Evelyn Gurschler Date: Thu, 2 May 2024 16:48:30 +0200 Subject: [PATCH 7/7] build(2.0.0-rc5): bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 70fb1b085..a2fffe860 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@catena-x/portal-frontend", - "version": "v2.0.0-RC4", + "version": "v2.0.0-RC5", "description": "Catena-X Portal Frontend", "author": "Catena-X Contributors", "license": "Apache-2.0",