Skip to content

Commit

Permalink
Merge pull request #909 from ishpaul777/develop
Browse files Browse the repository at this point in the history
Fixes issue #907
  • Loading branch information
shreeharsha-factly authored Jul 19, 2023
2 parents cac9a82 + ff7acff commit a2e44e1
Showing 1 changed file with 24 additions and 17 deletions.
41 changes: 24 additions & 17 deletions studio/src/components/GlobalNav/Sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ function Sidebar({ superOrg, permission, orgs, loading, applications, services,
children.map((route, childIndex) => {
return resource.includes(route.title.toLowerCase()) ? (
['Events', 'Permissions'].indexOf(route.title) !== -1 &&
route.isAdmin !== superOrg.is_admin ? null : (
route.isAdmin !== superOrg.is_admin ? null : (
<Menu.Item key={route.menuKey}>
<Link to={route.path}>
<span>{route.title}</span>
Expand Down Expand Up @@ -180,14 +180,19 @@ function Sidebar({ superOrg, permission, orgs, loading, applications, services,
background: '#F1F1F1',
}}
>
<div className="menu-header" style={{ width: '100%' }}>
<div className="menu-header" style={{
width: '100%',
display: "flex",
alignItems: "center",
justifyContent: "center",
}}>
{collapsed ? (
<img
alt="logo"
className="menu-logo"
src={
details[selected]?.fav_icon?.url?.[
window.REACT_APP_ENABLE_IMGPROXY ? 'proxy' : 'raw'
window.REACT_APP_ENABLE_IMGPROXY ? 'proxy' : 'raw'
] || degaImg
}
/>
Expand All @@ -214,7 +219,7 @@ function Sidebar({ superOrg, permission, orgs, loading, applications, services,
<Avatar
src={
details[selected]?.fav_icon?.url?.[
window.REACT_APP_ENABLE_IMGPROXY ? 'proxy' : 'raw'
window.REACT_APP_ENABLE_IMGPROXY ? 'proxy' : 'raw'
] || degaImg
}
/>
Expand All @@ -239,14 +244,14 @@ function Sidebar({ superOrg, permission, orgs, loading, applications, services,
return menu.title === 'CORE' && !showCoreMenu
? null
: !menu.isService
? !menu.isAdmin
? getSubMenuItems(menu, index, Icon)
: permission.filter((each) => each.resource === 'admin').length > 0
? getSubMenuItems(menu, index, Icon)
: null
: services?.includes(maker(menu.title))
? getSubMenuItems(menu, index, Icon)
: null;
? !menu.isAdmin
? getSubMenuItems(menu, index, Icon)
: permission.filter((each) => each.resource === 'admin').length > 0
? getSubMenuItems(menu, index, Icon)
: null
: services?.includes(maker(menu.title))
? getSubMenuItems(menu, index, Icon)
: null;
})}
</Menu>
{!collapsed ? (
Expand All @@ -265,9 +270,11 @@ function Sidebar({ superOrg, permission, orgs, loading, applications, services,
>
<AccountMenu />
<div>
<Button style={{ ...buttonStyle }} onClick={() => alert('Setting page')}>
<SettingOutlined />
</Button>
<Link to="/settings">
<Button style={{ ...buttonStyle }}>
<SettingOutlined />
</Button>
</Link>
{applications.length > 0 ? (
<>
<Popover
Expand Down Expand Up @@ -337,12 +344,12 @@ function Sidebar({ superOrg, permission, orgs, loading, applications, services,
background: '#f0f2f5',
}}
>
<Button style={buttonStyle} onClick={() => onCollapse(false)}>
<Button style={{...buttonStyle, margin: 'auto'}} onClick={() => onCollapse(false)}>
<MenuUnfoldOutlined />
</Button>
</div>
)}
</Sider>
</Sider >
</>
);
}
Expand Down

0 comments on commit a2e44e1

Please sign in to comment.