mirror of
https://github.com/Telecominfraproject/wlan-cloud-ui.git
synced 2025-11-20 04:44:56 +00:00
Merge pull request #92 from Telecominfraproject/bugfix/WIFI-1452
bugfix/WIFI-1452: Fixed bug on Edit User page
This commit is contained in:
@@ -92,7 +92,9 @@ const App = () => {
|
|||||||
<ProtectedRouteWithLayout exact path={ROUTES.addprofile} component={AddProfile} />
|
<ProtectedRouteWithLayout exact path={ROUTES.addprofile} component={AddProfile} />
|
||||||
|
|
||||||
<ProtectedRouteWithLayout exact path={ROUTES.alarms} component={Alarms} />
|
<ProtectedRouteWithLayout exact path={ROUTES.alarms} component={Alarms} />
|
||||||
|
{user?.id !== 0 && (
|
||||||
<ProtectedRouteWithLayout exact path={ROUTES.account} component={EditAccount} />
|
<ProtectedRouteWithLayout exact path={ROUTES.account} component={EditAccount} />
|
||||||
|
)}
|
||||||
{user?.roles?.[0] === 'SuperUser' && (
|
{user?.roles?.[0] === 'SuperUser' && (
|
||||||
<ProtectedRouteWithLayout exact path={ROUTES.users} component={Accounts} />
|
<ProtectedRouteWithLayout exact path={ROUTES.users} component={Accounts} />
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import { removeItem } from 'utils/localStorage';
|
|||||||
import UserContext from 'contexts/UserContext';
|
import UserContext from 'contexts/UserContext';
|
||||||
|
|
||||||
const MasterLayout = ({ children }) => {
|
const MasterLayout = ({ children }) => {
|
||||||
const { roles, customerId } = useContext(UserContext);
|
const { roles, customerId, id: currentUserId } = useContext(UserContext);
|
||||||
|
|
||||||
const client = useApolloClient();
|
const client = useApolloClient();
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
@@ -56,11 +56,15 @@ const MasterLayout = ({ children }) => {
|
|||||||
key: 'settings',
|
key: 'settings',
|
||||||
text: 'Settings',
|
text: 'Settings',
|
||||||
children: [
|
children: [
|
||||||
|
...(currentUserId !== 0
|
||||||
|
? [
|
||||||
{
|
{
|
||||||
key: 'editAccount',
|
key: 'editAccount',
|
||||||
path: ROUTES.account,
|
path: ROUTES.account,
|
||||||
text: 'Edit Account',
|
text: 'Edit Account',
|
||||||
},
|
},
|
||||||
|
]
|
||||||
|
: []),
|
||||||
{
|
{
|
||||||
key: 'logout',
|
key: 'logout',
|
||||||
path: ROUTES.root,
|
path: ROUTES.root,
|
||||||
@@ -90,6 +94,7 @@ const MasterLayout = ({ children }) => {
|
|||||||
menuItems={menuItems}
|
menuItems={menuItems}
|
||||||
mobileMenuItems={mobileMenuItems}
|
mobileMenuItems={mobileMenuItems}
|
||||||
totalAlarms={data && data.getAlarmCount}
|
totalAlarms={data && data.getAlarmCount}
|
||||||
|
currentUserId={currentUserId}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
</Layout>
|
</Layout>
|
||||||
|
|||||||
Reference in New Issue
Block a user