Skip to content

Commit 361aea0

Browse files
authored
feat(header): move company roles into enum (eclipse-tractusx#1213)
1 parent 870a5f6 commit 361aea0

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
- **Service Subscriptions**
2323

2424
- rename 'Configure' button to 'Activate' button [#1150](https://github.com/eclipse-tractusx/portal-frontend/pull/1150)
25+
26+
- **Header**
27+
- moved company roles into enum [#1213](https://github.com/eclipse-tractusx/portal-frontend/pull/1213)
2528
- **Application Request**
2629
- add separate end points for downloading company credential document and registration document [#1229](https://github.com/eclipse-tractusx/portal-frontend/pull/1229)
2730
- **Business Partner Invitation**
@@ -35,6 +38,7 @@
3538
### Bugfixes
3639

3740
- **Company Subscriptions**
41+
3842
- fixed wrong hyperlink and role requirement for technical user details in company subscription details [#1220](https://github.com/eclipse-tractusx/portal-frontend/pull/1220)
3943

4044
### Bugfixes

src/components/shared/frame/Header/index.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,10 @@ import RegistrationReviewOverlay from './RegistrationReviewOverlay'
4949
import './Header.scss'
5050
import RegistrationReviewContent from './RegistrationReviewOverlay/RegistrationReviewContent'
5151
import RegistrationDeclinedOverlay from './RegistrationDeclinedOverlay'
52-
import { useFetchOwnCompanyDetailsQuery } from 'features/admin/userApiSlice'
52+
import {
53+
CompanyRoleEnum,
54+
useFetchOwnCompanyDetailsQuery,
55+
} from 'features/admin/userApiSlice'
5356
import { PAGES } from 'types/Constants'
5457

5558
export const Header = ({
@@ -80,13 +83,17 @@ export const Header = ({
8083
useEffect(() => {
8184
if (!(companyData && companyDetails)) return
8285
setSubmittedOverlayOpen(
83-
!companyDetails?.companyRole.includes('OPERATOR') &&
86+
!companyDetails?.companyRole.includes(CompanyRoleEnum.OPERATOR) &&
8487
companyData?.applicationStatus === ApplicationStatus.SUBMITTED
8588
)
8689
}, [companyData, companyDetails])
8790

8891
useEffect(() => {
89-
if (companyDetails?.companyRole.includes('ONBOARDING_SERVICE_PROVIDER')) {
92+
if (
93+
companyDetails?.companyRole.includes(
94+
CompanyRoleEnum.ONBOARDING_SERVICE_PROVIDER
95+
)
96+
) {
9097
setPages(user)
9198
} else {
9299
setPages(

src/features/admin/userApiSlice.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ export type AdminData = {
8585
export enum CompanyRoleEnum {
8686
APP_PROVIDER = 'APP_PROVIDER',
8787
SERVICE_PROVIDER = 'SERVICE_PROVIDER',
88+
ONBOARDING_SERVICE_PROVIDER = 'ONBOARDING_SERVICE_PROVIDER',
89+
OPERATOR = 'OPERATOR',
8890
}
8991

9092
export interface CompanyDetails {

0 commit comments

Comments
 (0)