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: display user management navigation button based on role validation #1073

Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
- Fixed 'activeTab' conditions to load data for Tab-2(Registration Process) [#1050](https://github.com/eclipse-tractusx/portal-frontend/pull/1050)
- **App Release Process**:
- Fixed role upload does not work using Firefox [#1003](https://github.com/eclipse-tractusx/portal-frontend/pull/1003)
- **Technical User Management**
- Display technicalUserManagement button based on role validation [#1073](https://github.com/eclipse-tractusx/portal-frontend/pull/1073)

## 2.2.0-RC2

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import { useEffect } from 'react'
import { SubNavigation } from '@catena-x/portal-shared-components'
import { useTranslation } from 'react-i18next'
import { useNavigate } from 'react-router-dom'
import UserService from 'services/UserService'
import { PAGES, ROLES } from 'types/Constants'

export const StageSubNavigation = () => {
const { t } = useTranslation()
Expand All @@ -44,9 +46,13 @@ export const StageSubNavigation = () => {

return (
<SubNavigation
buttonLabel={t('navigation.subNavigation.buttonLabel')}
buttonLabel={
(UserService.hasRole(ROLES.TECH_USER_VIEW) &&
t('navigation.subNavigation.buttonLabel')) ||
undefined
}
onButtonClick={() => {
navigate('/technicalUserManagement')
navigate(`/${PAGES.TECH_USER_MANAGEMENT}`)
}}
link1Label={t('navigation.subNavigation.link1Label')}
onLink1Click={() => {
Expand Down
Loading