From 5b7a77a228fa7b89d535864627a8edd44c26dd77 Mon Sep 17 00:00:00 2001 From: lavanya-bmw Date: Thu, 10 Oct 2024 12:17:48 +0530 Subject: [PATCH 1/3] feat(header): moved company roles into enum --- CHANGELOG.md | 2 ++ src/components/shared/frame/Header/index.tsx | 13 ++++++++++--- src/features/admin/userApiSlice.ts | 2 ++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 21e76bb30..a18bd6085 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ - **Service Subscriptions** - rename 'Configure' button to 'Activate' button [#1150](https://github.com/eclipse-tractusx/portal-frontend/pull/1150) +- **Header** + - moved company roles into enum ## 2.3.0-alpha.2 diff --git a/src/components/shared/frame/Header/index.tsx b/src/components/shared/frame/Header/index.tsx index 559ead291..365ef2753 100644 --- a/src/components/shared/frame/Header/index.tsx +++ b/src/components/shared/frame/Header/index.tsx @@ -49,7 +49,10 @@ import RegistrationReviewOverlay from './RegistrationReviewOverlay' import './Header.scss' import RegistrationReviewContent from './RegistrationReviewOverlay/RegistrationReviewContent' import RegistrationDeclinedOverlay from './RegistrationDeclinedOverlay' -import { useFetchOwnCompanyDetailsQuery } from 'features/admin/userApiSlice' +import { + CompanyRoleEnum, + useFetchOwnCompanyDetailsQuery, +} from 'features/admin/userApiSlice' import { PAGES } from 'types/Constants' export const Header = ({ @@ -80,13 +83,17 @@ export const Header = ({ useEffect(() => { if (!(companyData && companyDetails)) return setSubmittedOverlayOpen( - !companyDetails?.companyRole.includes('OPERATOR') && + !companyDetails?.companyRole.includes(CompanyRoleEnum.OPERATOR) && companyData?.applicationStatus === ApplicationStatus.SUBMITTED ) }, [companyData, companyDetails]) useEffect(() => { - if (companyDetails?.companyRole.includes('ONBOARDING_SERVICE_PROVIDER')) { + if ( + companyDetails?.companyRole.includes( + CompanyRoleEnum.ONBOARDING_SERVICE_PROVIDER + ) + ) { setPages(user) } else { setPages( diff --git a/src/features/admin/userApiSlice.ts b/src/features/admin/userApiSlice.ts index 41982d8b4..5139dfa98 100644 --- a/src/features/admin/userApiSlice.ts +++ b/src/features/admin/userApiSlice.ts @@ -85,6 +85,8 @@ export type AdminData = { export enum CompanyRoleEnum { APP_PROVIDER = 'APP_PROVIDER', SERVICE_PROVIDER = 'SERVICE_PROVIDER', + ONBOARDING_SERVICE_PROVIDER = 'ONBOARDING_SERVICE_PROVIDER', + OPERATOR = 'OPERATOR', } export interface CompanyDetails { From d04342ed4c59607926b341e0e41e661be7bc5ea9 Mon Sep 17 00:00:00 2001 From: lavanya-bmw Date: Thu, 10 Oct 2024 12:20:33 +0530 Subject: [PATCH 2/3] feat(header): updated changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a18bd6085..372202029 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ - **Service Subscriptions** - rename 'Configure' button to 'Activate' button [#1150](https://github.com/eclipse-tractusx/portal-frontend/pull/1150) - **Header** - - moved company roles into enum + - moved company roles into enum [#1213](https://github.com/eclipse-tractusx/portal-frontend/pull/1213) ## 2.3.0-alpha.2 From 8ea06e7e652ae08f5611bcfc78b12ca9a58a9247 Mon Sep 17 00:00:00 2001 From: Martin Rohrmeier Date: Wed, 16 Oct 2024 17:11:54 +0200 Subject: [PATCH 3/3] fix: format changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b50e0169..513582bcf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ - **Service Subscriptions** - rename 'Configure' button to 'Activate' button [#1150](https://github.com/eclipse-tractusx/portal-frontend/pull/1150) + - **Header** - moved company roles into enum [#1213](https://github.com/eclipse-tractusx/portal-frontend/pull/1213) - **Application Request** @@ -37,6 +38,7 @@ ### Bugfixes - **Company Subscriptions** + - fixed wrong hyperlink and role requirement for technical user details in company subscription details [#1220](https://github.com/eclipse-tractusx/portal-frontend/pull/1220) ### Bugfixes