diff --git a/CHANGELOG.md b/CHANGELOG.md index a5611bf11..c2bb99906 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -62,6 +62,7 @@ - Display technicalUserManagement button based on role validation [#1073](https://github.com/eclipse-tractusx/portal-frontend/pull/1073) - **OSP Consent form** - Display invited company name in OSP consent form (Previously hard coded with 'BMW') [#1083](https://github.com/eclipse-tractusx/portal-frontend/pull/1083) + - Filter out roles not defined by OSP [#1114](https://github.com/eclipse-tractusx/portal-frontend/pull/1114) - Fix OSP consent form 400 submission error [#1102](https://github.com/eclipse-tractusx/portal-frontend/pull/1102/files) - **Use Case participation** - Removes use cases without verified credentials from the "Use Case Participation" list [#1088](https://github.com/eclipse-tractusx/portal-frontend/pull/1088) diff --git a/src/components/pages/OSPConsent/CompanyDetails.tsx b/src/components/pages/OSPConsent/CompanyDetails.tsx index 138f8aa0e..b96000ed9 100644 --- a/src/components/pages/OSPConsent/CompanyDetails.tsx +++ b/src/components/pages/OSPConsent/CompanyDetails.tsx @@ -250,37 +250,45 @@ export const CompanyDetails = ({ {t('osp.companyRole.subTitle')}
- {allConsentData?.companyRoles.map((role) => ( -
-
-
- { - handleCompanyRoleCheck(role.companyRole) - }} - checked={companyRoleChecked?.[role.companyRole]} - /> -
-
- - {t(`osp.companyRole.${role.companyRole}`)} - - - {role.descriptions['en' as keyof typeof role.descriptions]} - - {companyRoleChecked?.[role.companyRole] && - renderTermsSection(role)} + {allConsentData?.companyRoles + .filter((role) => + consentData?.companyRoles.includes(role.companyRole) + ) + .map((role) => ( +
+
+
+ { + handleCompanyRoleCheck(role.companyRole) + }} + checked={companyRoleChecked?.[role.companyRole]} + /> +
+
+ + {t(`osp.companyRole.${role.companyRole}`)} + + + { + role.descriptions[ + 'en' as keyof typeof role.descriptions + ] + } + + {companyRoleChecked?.[role.companyRole] && + renderTermsSection(role)} +
-
- ))} + ))}
{submitError && (