Skip to content

Commit

Permalink
Merge pull request #1729 from Inist-CNRS/feat/remove-obsolete-instanc…
Browse files Browse the repository at this point in the history
…es-links

Feat: remove obsolete instances links
  • Loading branch information
arimet authored Oct 16, 2023
2 parents f66e3cb + 33a64af commit 5600d42
Showing 1 changed file with 0 additions and 77 deletions.
77 changes: 0 additions & 77 deletions src/app/js/admin/Appbar/Menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,6 @@ const MenuComponent = ({
setSubMenuToShow('advanced');
};

const handleOpenTenantMenu = () => {
setSubMenuToShow('tenant');
};

const handleCloseSubMenu = () => {
setSubMenuToShow(null);
};
Expand All @@ -134,10 +130,6 @@ const MenuComponent = ({
}
};

function setTenant(tenant) {
window.location.href = `/instance/${tenant}/admin`;
}

const modelMenuItems = [
<div
key="import_fields"
Expand Down Expand Up @@ -240,45 +232,6 @@ const MenuComponent = ({
</MenuItem>,
];

const instanceMenuItems = [
<MenuItem
key="instance_default"
onClick={() => handleCloseMenu(() => setTenant('default'))}
>
<StorageIcon />
<Box component="span" ml={1}>
Default
</Box>
</MenuItem>,
<MenuItem
key="instance_one"
onClick={() => handleCloseMenu(() => setTenant('instance_one'))}
>
<StorageIcon />
<Box component="span" ml={1}>
Instance 1
</Box>
</MenuItem>,
<MenuItem
key="instance_two"
onClick={() => handleCloseMenu(() => setTenant('instance_two'))}
>
<StorageIcon />
<Box component="span" ml={1}>
Instance 2
</Box>
</MenuItem>,
<MenuItem
key="instance_three"
onClick={() => handleCloseMenu(() => setTenant('instance_three'))}
>
<StorageIcon />
<Box component="span" ml={1}>
Instance 3
</Box>
</MenuItem>,
];

return (
<>
<Box
Expand Down Expand Up @@ -373,36 +326,6 @@ const MenuComponent = ({
</Paper>
</Fade>
</Box>
<Box
onMouseEnter={handleOpenTenantMenu}
onMouseLeave={handleCloseSubMenu}
sx={{
position: 'relative',
}}
>
<MenuItem
sx={{
justifyContent: 'space-between',
}}
>
<Box component="span" mr={1}>
Instances
</Box>
<ChevronRightIcon />
</MenuItem>
<Fade in={subMenuToShow === 'tenant'}>
<Paper
elevation={8}
sx={{
position: 'absolute',
top: 0,
transform: 'translateX(-100%)',
}}
>
<MenuList>{instanceMenuItems}</MenuList>
</Paper>
</Fade>
</Box>
<Divider />
<MenuItem
onClick={() => handleCloseMenu(onSignOut)}
Expand Down

0 comments on commit 5600d42

Please sign in to comment.