From 7bc70e4fd464d72f34115a94c257cb11f60f8587 Mon Sep 17 00:00:00 2001 From: lavanya-bmw <106523828+lavanya-bmw@users.noreply.github.com> Date: Mon, 7 Oct 2024 19:15:02 +0530 Subject: [PATCH 1/5] feat(ospm): enhance permission validation (#1176) https://github.com/eclipse-tractusx/portal-frontend/issues/1108 --- CHANGELOG.md | 2 ++ DEPENDENCIES | 4 ++-- src/components/shared/frame/Header/index.tsx | 21 +++++++++++++++++--- src/types/Config.tsx | 1 + src/types/Constants.ts | 1 + 5 files changed, 24 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e25723cff..2e840e6ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ - updated technical user details with user type and service endpoint fields. Also, updated copy icon color for better view and made copy icon available only when value is available [#1137](https://github.com/eclipse-tractusx/portal-frontend/pull/1137) - **Company Subscriptions** - update API query parameters and fix tab UI scroll [#1131](https://github.com/eclipse-tractusx/portal-frontend/pull/1131) +- **Onboarding Service Provider** + - enhanced permission and company role validation for Onboarding Service Provider [#1176](https://github.com/eclipse-tractusx/portal-frontend/pull/1176) ### Bugfixes diff --git a/DEPENDENCIES b/DEPENDENCIES index ee294e91b..3538e62bf 100644 --- a/DEPENDENCIES +++ b/DEPENDENCIES @@ -15,7 +15,7 @@ npm/npmjs/-/arg/4.1.3, MIT, approved, clearlydefined npm/npmjs/-/argparse/1.0.10, MIT, approved, #2174 npm/npmjs/-/argparse/2.0.1, Python-2.0, approved, CQ22954 npm/npmjs/-/aria-query/5.1.3, Apache-2.0, approved, clearlydefined -npm/npmjs/-/aria-query/5.3.0, Apache-2.0, approved, clearlydefined +npm/npmjs/-/aria-query/5.3.0, Apache-2.0, approved, #16427 npm/npmjs/-/array-buffer-byte-length/1.0.1, MIT, approved, #7548 npm/npmjs/-/array-includes/3.1.8, MIT, approved, #4577 npm/npmjs/-/array-union/2.1.0, MIT, approved, clearlydefined @@ -696,7 +696,7 @@ npm/npmjs/@react-hook/cache/1.1.1, MIT, approved, clearlydefined npm/npmjs/@react-hook/latest/1.0.3, MIT, approved, clearlydefined npm/npmjs/@reduxjs/toolkit/2.2.7, MIT AND (BSD-2-Clause AND ISC AND MIT) AND Apache-2.0, approved, #14170 npm/npmjs/@remix-run/router/1.15.3, MIT, approved, clearlydefined -npm/npmjs/@rollup/pluginutils/5.1.0, MIT, approved, clearlydefined +npm/npmjs/@rollup/pluginutils/5.1.0, MIT, approved, #16428 npm/npmjs/@rollup/rollup-android-arm-eabi/4.17.2, MIT, approved, clearlydefined npm/npmjs/@rollup/rollup-android-arm64/4.17.2, MIT, approved, clearlydefined npm/npmjs/@rollup/rollup-darwin-arm64/4.17.2, MIT, approved, clearlydefined diff --git a/src/components/shared/frame/Header/index.tsx b/src/components/shared/frame/Header/index.tsx index c792ec88d..d5eb52021 100644 --- a/src/components/shared/frame/Header/index.tsx +++ b/src/components/shared/frame/Header/index.tsx @@ -18,7 +18,7 @@ * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ -import { useState } from 'react' +import { useEffect, useState } from 'react' import { NavLink } from 'react-router-dom' import { useSelector, useDispatch } from 'react-redux' import { Trans, useTranslation } from 'react-i18next' @@ -49,6 +49,8 @@ import RegistrationReviewOverlay from './RegistrationReviewOverlay' import './Header.scss' import RegistrationReviewContent from './RegistrationReviewOverlay/RegistrationReviewContent' import RegistrationDeclinedOverlay from './RegistrationDeclinedOverlay' +import { useFetchOwnCompanyDetailsQuery } from 'features/admin/userApiSlice' +import { PAGES } from 'types/Constants' export const Header = ({ main, @@ -69,11 +71,24 @@ export const Header = ({ const { data } = useFetchApplicationsQuery() const companyData = data?.[0] - + const { data: companyDetails } = useFetchOwnCompanyDetailsQuery('') const [submittedOverlayOpen, setSubmittedOverlayOpen] = useState( companyData?.applicationStatus === ApplicationStatus.SUBMITTED ) const [headerNote, setHeaderNote] = useState(false) + const [pages, setPages] = useState([]) + + useEffect(() => { + if (companyDetails?.companyRole.includes('ONBOARDING_SERVICE_PROVIDER')) { + setPages(user) + } else { + setPages( + user.filter( + (item) => item !== PAGES.MANAGEMENT_ONBOARDING_SERVICE_PROVIDER + ) + ) + } + }, [companyDetails?.companyRole]) const addTitle = (items: Tree[] | undefined) => items?.map( @@ -187,7 +202,7 @@ export const Header = ({ > {t('pages.help')} - + diff --git a/src/types/Config.tsx b/src/types/Config.tsx index c0cdda614..ec79e4e27 100644 --- a/src/types/Config.tsx +++ b/src/types/Config.tsx @@ -599,6 +599,7 @@ export const ALL_PAGES: IPage[] = [ }, { name: PAGES.MANAGEMENT_ONBOARDING_SERVICE_PROVIDER, + allowTo: () => userHasPortalRole(ROLES.CONFIGURE_PARTNER_REGISTRATION), element: , }, ] diff --git a/src/types/Constants.ts b/src/types/Constants.ts index 40d9e282f..0a1ede6c5 100644 --- a/src/types/Constants.ts +++ b/src/types/Constants.ts @@ -233,6 +233,7 @@ export enum ROLES { REVOKE_CREDENTIALS_ISSUER = 'revoke_credentials_issuer', VIEW_REGISTRATION = 'view_registration', READ_PARTNER = 'read_partner', + CONFIGURE_PARTNER_REGISTRATION = 'configure_partner_registration', } export enum HINTS { From df8a53e4604840a6458c1a472c358d5b70e77bf6 Mon Sep 17 00:00:00 2001 From: lavanya-bmw <106523828+lavanya-bmw@users.noreply.github.com> Date: Mon, 7 Oct 2024 20:08:40 +0530 Subject: [PATCH 2/5] fix(company subscriptions): fix incorrect displaying of data (#1191) https://github.com/eclipse-tractusx/portal-frontend/issues/1190 --- CHANGELOG.md | 2 ++ src/components/pages/CompanySubscriptions/index.tsx | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e840e6ec..134a26bee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,8 @@ - fixed customer link selection and fixed resetting values [#1119](https://github.com/eclipse-tractusx/portal-frontend/pull/1119) - **Technical User Management** - fixed error message scenario post technical user deletion action +- **Company Subscriptions** + - fixed incorrect data display in service company subscriptions [#1191](https://github.com/eclipse-tractusx/portal-frontend/pull/1191) ## 2.2.0-alpha.1 diff --git a/src/components/pages/CompanySubscriptions/index.tsx b/src/components/pages/CompanySubscriptions/index.tsx index 5ed78576b..c121189c4 100644 --- a/src/components/pages/CompanySubscriptions/index.tsx +++ b/src/components/pages/CompanySubscriptions/index.tsx @@ -217,7 +217,7 @@ export default function CompanySubscriptions() { fetchHook={query} fetchHookArgs={fetchHookArgs} fetchHookRefresh={refresh} - getRowId={(row: { [key: string]: string }) => row.offerId} + getRowId={(row: { [key: string]: string }) => row.subscriptionId} columns={companySubscriptionsCols} /> From 5a2f397a12f3072e9f63cdc6d95515c786ef5fc9 Mon Sep 17 00:00:00 2001 From: Manojava Koushik <111366021+manojava-gk@users.noreply.github.com> Date: Mon, 7 Oct 2024 20:26:33 +0530 Subject: [PATCH 3/5] feat(company data): re-enable csv upload and revert setting of ready state (#1144) enabled feature is needed for R24.12 and setting of ready state is now taken care of from BDPM side due to changed configuration --- CHANGELOG.md | 3 +++ .../components/CompanyAddressList.tsx | 8 +++++++ .../pages/CompanyData/components/EditForm.tsx | 21 ++----------------- 3 files changed, 13 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 134a26bee..8907b976d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,9 @@ - updated technical user details with user type and service endpoint fields. Also, updated copy icon color for better view and made copy icon available only when value is available [#1137](https://github.com/eclipse-tractusx/portal-frontend/pull/1137) - **Company Subscriptions** - update API query parameters and fix tab UI scroll [#1131](https://github.com/eclipse-tractusx/portal-frontend/pull/1131) +- **Customer Data** + - re-enabled CSV upload [#1144](https://github.com/eclipse-tractusx/portal-frontend/pull/1144) + - reverted manual intervention with ready state api [#1144](https://github.com/eclipse-tractusx/portal-frontend/pull/1144) - **Onboarding Service Provider** - enhanced permission and company role validation for Onboarding Service Provider [#1176](https://github.com/eclipse-tractusx/portal-frontend/pull/1176) diff --git a/src/components/pages/CompanyData/components/CompanyAddressList.tsx b/src/components/pages/CompanyData/components/CompanyAddressList.tsx index 1c490f1fc..1505ee887 100644 --- a/src/components/pages/CompanyData/components/CompanyAddressList.tsx +++ b/src/components/pages/CompanyData/components/CompanyAddressList.tsx @@ -46,6 +46,9 @@ import { } from 'features/companyData/slice' import { statusColorMap } from 'utils/dataMapper' import AddCircleOutlineIcon from '@mui/icons-material/AddCircleOutline' +import { show } from 'features/control/overlay' +import { OVERLAYS } from 'types/Constants' +import UploadIcon from '@mui/icons-material/Upload' export const CompanyAddressList = ({ handleButtonClick, @@ -195,6 +198,11 @@ export const CompanyAddressList = ({ }, icon: , }, + { + title: t('content.companyData.csvUploadBtn'), + click: () => dispatch(show(OVERLAYS.CSV_UPLOAD_OVERLAY)), + icon: , + }, ]} autoFocus={false} onButtonClick={handleButtonClick} diff --git a/src/components/pages/CompanyData/components/EditForm.tsx b/src/components/pages/CompanyData/components/EditForm.tsx index 8fb21b180..37cee254b 100644 --- a/src/components/pages/CompanyData/components/EditForm.tsx +++ b/src/components/pages/CompanyData/components/EditForm.tsx @@ -35,7 +35,6 @@ import { type CompanyDataType, useUpdateCompanySiteAndAddressMutation, type CompanyDataFieldsType, - useUpdateCompanyStatusToReadyMutation, } from 'features/companyData/companyDataApiSlice' import { useSelector } from 'react-redux' import { @@ -68,7 +67,6 @@ export default function EditForm({ const [loading, setLoading] = useState(false) const [isValid, setIsValid] = useState(false) const [updateData] = useUpdateCompanySiteAndAddressMutation() - const [updateReadyState] = useUpdateCompanyStatusToReadyMutation() const companyData = useSelector(companyDataSelector) const [success, setSuccess] = useState(false) const [error, setError] = useState(false) @@ -123,11 +121,9 @@ export default function EditForm({ } } - const updateStateToReady = async (response: CompanyDataType[]) => { + const handleCreation = async () => { try { - await updateReadyState({ - externalIds: [response[0].externalId], - }) + await updateData([input]) .unwrap() .then(() => { setSuccess(true) @@ -138,19 +134,6 @@ export default function EditForm({ setLoading(false) } - const handleCreation = async () => { - try { - await updateData([input]) - .unwrap() - .then((response) => { - updateStateToReady(response) - }) - } catch (e) { - setError(true) - setLoading(false) - } - } - const getTitle = () => { if (newForm) { return isAddress From 68f07d2a32610e9a722daaf9557e187b693eaf74 Mon Sep 17 00:00:00 2001 From: Evelyn Gurschler Date: Mon, 7 Oct 2024 17:01:07 +0200 Subject: [PATCH 4/5] build(v2.3.0-alpha.2): bump version and update docs --- CHANGELOG.md | 6 ++++-- package.json | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8907b976d..65235eec9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 2.3.0-alpha.2 + ### Change - **Technical User Details** @@ -21,11 +23,11 @@ - **Connector Management** - fixed customer link selection and fixed resetting values [#1119](https://github.com/eclipse-tractusx/portal-frontend/pull/1119) - **Technical User Management** - - fixed error message scenario post technical user deletion action + - fixed error message scenario post technical user deletion action [#1164](https://github.com/eclipse-tractusx/portal-frontend/pull/1164) - **Company Subscriptions** - fixed incorrect data display in service company subscriptions [#1191](https://github.com/eclipse-tractusx/portal-frontend/pull/1191) -## 2.2.0-alpha.1 +## 2.3.0-alpha.1 ### Bugfixes diff --git a/package.json b/package.json index 4e41e25fd..3a513be6c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@catena-x/portal-frontend", - "version": "v2.3.0-alpha.1", + "version": "v2.3.0-alpha.2", "description": "Catena-X Portal Frontend", "author": "Catena-X Contributors", "license": "Apache-2.0", From bb8e63f7fd8f8f2f36b58cf6c2430dd585b84eae Mon Sep 17 00:00:00 2001 From: Manojava Koushik <111366021+manojava-gk@users.noreply.github.com> Date: Tue, 8 Oct 2024 15:16:34 +0530 Subject: [PATCH 5/5] feat(subscription): add hover information on the status icon (#1130) https://github.com/eclipse-tractusx/portal-frontend/issues/1123 --- CHANGELOG.md | 2 + src/assets/locales/de/main.json | 3 ++ src/assets/locales/en/main.json | 3 ++ .../Subscription/SubscriptionElements.tsx | 42 +++++++++++++++---- 4 files changed, 42 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 65235eec9..f8b93bd96 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ - updated technical user details with user type and service endpoint fields. Also, updated copy icon color for better view and made copy icon available only when value is available [#1137](https://github.com/eclipse-tractusx/portal-frontend/pull/1137) - **Company Subscriptions** - update API query parameters and fix tab UI scroll [#1131](https://github.com/eclipse-tractusx/portal-frontend/pull/1131) +- **App & Service Subscription Management** + - updated search place holder text - showing only available offer names at the top - and implemented hover information on the status icon of service subscription [#1130](https://github.com/eclipse-tractusx/portal-frontend/pull/1130) - **Customer Data** - re-enabled CSV upload [#1144](https://github.com/eclipse-tractusx/portal-frontend/pull/1144) - reverted manual intervention with ready state api [#1144](https://github.com/eclipse-tractusx/portal-frontend/pull/1144) diff --git a/src/assets/locales/de/main.json b/src/assets/locales/de/main.json index 9517608c6..699e2ef69 100644 --- a/src/assets/locales/de/main.json +++ b/src/assets/locales/de/main.json @@ -1488,6 +1488,9 @@ "pleaseEnterValidURL": "Please enter a valid URL", "error": "Error", "success": "Success", + "pending": "Das Abonnement steht noch aus", + "active": "Das Abonnement ist aktiv", + "process": "Das Abonnement ist in Bearbeitung", "tabs": { "request": "Request", "active": "Active", diff --git a/src/assets/locales/en/main.json b/src/assets/locales/en/main.json index 06080b3b2..627f5539b 100644 --- a/src/assets/locales/en/main.json +++ b/src/assets/locales/en/main.json @@ -1456,6 +1456,9 @@ "pleaseEnterValidURL": "Please enter a valid URL", "error": "Error", "success": "Success", + "pending": "Subscription is Pending", + "active": "Subscription is Active", + "process": "Subscription is in Progress", "tabs": { "request": "Request", "active": "Active", diff --git a/src/components/shared/templates/Subscription/SubscriptionElements.tsx b/src/components/shared/templates/Subscription/SubscriptionElements.tsx index fbea6df5e..380f4f69c 100644 --- a/src/components/shared/templates/Subscription/SubscriptionElements.tsx +++ b/src/components/shared/templates/Subscription/SubscriptionElements.tsx @@ -178,7 +178,15 @@ export default function SubscriptionElements({ subscription: CompanySubscriptionData ) => { if (subscription.offerSubscriptionStatus === SubscriptionStatus.ACTIVE) { - return + return ( + + + + ) } else if ( subscription.offerSubscriptionStatus === SubscriptionStatus.PENDING ) { @@ -211,7 +219,13 @@ export default function SubscriptionElements({ }) }} /> - + + + ) } else if ( @@ -226,16 +240,28 @@ export default function SubscriptionElements({ variant="filled" onClick={() => handleActivate(subscription.subscriptionId)} /> - + + + ) } else { return ( - subscription process + + subscription process + ) } } else {