Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: filter out roles not defined by OSP #1114

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,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)
Expand Down
66 changes: 37 additions & 29 deletions src/components/pages/OSPConsent/CompanyDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -250,37 +250,45 @@ export const CompanyDetails = ({
{t('osp.companyRole.subTitle')}
</Typography>
<div className="rolesList">
{allConsentData?.companyRoles.map((role) => (
<div
className="companyRole-section"
key={uniqueId(role.companyRole)}
>
<div className="role-checkbox-row">
<div className="role-checkbox">
<Checkbox
label=""
onChange={() => {
handleCompanyRoleCheck(role.companyRole)
}}
checked={companyRoleChecked?.[role.companyRole]}
/>
</div>
<div className="role-checkbox-text">
<Typography
variant={isMobile ? 'label2' : 'label1'}
className="company-heading"
>
{t(`osp.companyRole.${role.companyRole}`)}
</Typography>
<Typography variant={isMobile ? 'body3' : 'body2'}>
{role.descriptions['en' as keyof typeof role.descriptions]}
</Typography>
{companyRoleChecked?.[role.companyRole] &&
renderTermsSection(role)}
{allConsentData?.companyRoles
.filter((role) =>
consentData?.companyRoles.includes(role.companyRole)
)
.map((role) => (
<div
className="companyRole-section"
key={uniqueId(role.companyRole)}
>
<div className="role-checkbox-row">
<div className="role-checkbox">
<Checkbox
label=""
onChange={() => {
handleCompanyRoleCheck(role.companyRole)
}}
checked={companyRoleChecked?.[role.companyRole]}
/>
</div>
<div className="role-checkbox-text">
<Typography
variant={isMobile ? 'label2' : 'label1'}
className="company-heading"
>
{t(`osp.companyRole.${role.companyRole}`)}
</Typography>
<Typography variant={isMobile ? 'body3' : 'body2'}>
{
role.descriptions[
'en' as keyof typeof role.descriptions
]
}
</Typography>
{companyRoleChecked?.[role.companyRole] &&
renderTermsSection(role)}
</div>
</div>
</div>
</div>
))}
))}
</div>
{submitError && (
<Typography variant="body3" className="submitError">
Expand Down
Loading