Skip to content

Commit

Permalink
separating upload modal and fixing broken test reference in package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
siddheshraze committed Feb 5, 2025
1 parent 4d44ab5 commit e2811bb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
13 changes: 12 additions & 1 deletion frontend/components/datagrids/measurementscommons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import DeleteIcon from '@mui/icons-material/DeleteOutlined';
import SaveIcon from '@mui/icons-material/Save';
import CancelIcon from '@mui/icons-material/Close';
import RefreshIcon from '@mui/icons-material/Refresh';
import UploadIcon from '@mui/icons-material/Upload';
import Box from '@mui/joy/Box';
import {
Button,
Expand Down Expand Up @@ -193,6 +194,9 @@ const EditToolbar = (props: EditToolbarProps) => {
.filter(column => !Object.keys(apiRef.current.state.columns.columnVisibilityModel).includes(column.field))
.map(column => column.field);

const uploadButton = dynamicButtons.find((button: any) => button.label === 'Upload');
const otherButtons = dynamicButtons.filter((button: any) => button.label !== 'Upload');

return (
<>
<GridToolbarContainer>
Expand Down Expand Up @@ -250,11 +254,18 @@ const EditToolbar = (props: EditToolbarProps) => {
>
Export as CSV...
</Button>
{uploadButton && (
<Tooltip title={uploadButton.tooltip} placement="bottom">
<Button variant="plain" color="primary" onClick={uploadButton.onClick} startDecorator={<UploadIcon />}>
{uploadButton.label}
</Button>
</Tooltip>
)}
<Stack direction={'row'} spacing={2}>
<Dropdown>
<MenuButton>Other</MenuButton>
<Menu>
{dynamicButtons.map((button: any, index: number) => (
{otherButtons.map((button: any, index: number) => (
<>
{button.tooltip ? (
<>
Expand Down
8 changes: 1 addition & 7 deletions frontend/components/loginlogout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,7 @@ export const LoginLogout = () => {
<Typography level="title-sm">Login to access</Typography>
<Typography level="body-xs">your information</Typography>
</Box>
<IconButton
size="sm"
variant="plain"
color="neutral"
onClick={() => handleRetryLogin()}
aria-label={'Login' + ' button'}
>
<IconButton size="sm" variant="plain" color="neutral" onClick={() => handleRetryLogin()} aria-label={'Login' + ' button'}>
<LoginRoundedIcon />
</IconButton>
</Box>
Expand Down
1 change: 0 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"lint": "next lint --fix && prettier --write .",
"format": "prettier --write .",
"cypress:open": "cypress open",
"test": "npm run component:headless && npm run e2e:headless",
"e2e": "start-server-and-test dev http://localhost:3000 \"cypress open --e2e\"",
"e2e:headless": "start-server-and-test start http://localhost:3000 \"cypress run --e2e\"",
"component": "cypress open --component",
Expand Down

0 comments on commit e2811bb

Please sign in to comment.