mirror of
				https://github.com/Telecominfraproject/wlan-cloud-ui.git
				synced 2025-11-03 20:28:12 +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.alarms} component={Alarms} />
 | 
			
		||||
          <ProtectedRouteWithLayout exact path={ROUTES.account} component={EditAccount} />
 | 
			
		||||
          {user?.id !== 0 && (
 | 
			
		||||
            <ProtectedRouteWithLayout exact path={ROUTES.account} component={EditAccount} />
 | 
			
		||||
          )}
 | 
			
		||||
          {user?.roles?.[0] === 'SuperUser' && (
 | 
			
		||||
            <ProtectedRouteWithLayout exact path={ROUTES.users} component={Accounts} />
 | 
			
		||||
          )}
 | 
			
		||||
 
 | 
			
		||||
@@ -13,7 +13,7 @@ import { removeItem } from 'utils/localStorage';
 | 
			
		||||
import UserContext from 'contexts/UserContext';
 | 
			
		||||
 | 
			
		||||
const MasterLayout = ({ children }) => {
 | 
			
		||||
  const { roles, customerId } = useContext(UserContext);
 | 
			
		||||
  const { roles, customerId, id: currentUserId } = useContext(UserContext);
 | 
			
		||||
 | 
			
		||||
  const client = useApolloClient();
 | 
			
		||||
  const location = useLocation();
 | 
			
		||||
@@ -56,11 +56,15 @@ const MasterLayout = ({ children }) => {
 | 
			
		||||
      key: 'settings',
 | 
			
		||||
      text: 'Settings',
 | 
			
		||||
      children: [
 | 
			
		||||
        {
 | 
			
		||||
          key: 'editAccount',
 | 
			
		||||
          path: ROUTES.account,
 | 
			
		||||
          text: 'Edit Account',
 | 
			
		||||
        },
 | 
			
		||||
        ...(currentUserId !== 0
 | 
			
		||||
          ? [
 | 
			
		||||
              {
 | 
			
		||||
                key: 'editAccount',
 | 
			
		||||
                path: ROUTES.account,
 | 
			
		||||
                text: 'Edit Account',
 | 
			
		||||
              },
 | 
			
		||||
            ]
 | 
			
		||||
          : []),
 | 
			
		||||
        {
 | 
			
		||||
          key: 'logout',
 | 
			
		||||
          path: ROUTES.root,
 | 
			
		||||
@@ -90,6 +94,7 @@ const MasterLayout = ({ children }) => {
 | 
			
		||||
      menuItems={menuItems}
 | 
			
		||||
      mobileMenuItems={mobileMenuItems}
 | 
			
		||||
      totalAlarms={data && data.getAlarmCount}
 | 
			
		||||
      currentUserId={currentUserId}
 | 
			
		||||
    >
 | 
			
		||||
      {children}
 | 
			
		||||
    </Layout>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user