Skip to content

Commit

Permalink
Remove errors button from table menu (#522)
Browse files Browse the repository at this point in the history
  • Loading branch information
guergana authored Aug 26, 2024
1 parent bb8cc5a commit 306656c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 34 deletions.
6 changes: 0 additions & 6 deletions client/components/Controllers/Table/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import * as menu from '../../Parts/Bars/Menu'
import * as store from '@client/store'

export default function Menu() {
const mode = store.useStore((state) => state.table?.mode)
const panel = store.useStore((state) => state.panel)
const report = store.useStore((state) => state.report)
const history = store.useStore((state) => state.table?.history)
Expand All @@ -25,11 +24,6 @@ export default function Menu() {
active={panel === 'source'}
onClick={() => store.togglePanel('source')}
/>
<menu.ErrorsButton
active={mode === 'errors'}
onClick={store.toggleTableErrorMode}
disabled={report?.valid}
/>
<menu.UndoButton
onClick={store.undoTableChange}
disabled={!history?.changes.length}
Expand Down
28 changes: 0 additions & 28 deletions client/components/Parts/Bars/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import RuleIcon from '@mui/icons-material/Rule'
import CompressIcon from '@mui/icons-material/Compress'
import DataObjectIcon from '@mui/icons-material/DataObject'
import FormatClearIcon from '@mui/icons-material/FormatClear'
import ReportGmailerrorredIcon from '@mui/icons-material/ReportGmailerrorred'
import SupportAgentIcon from '@mui/icons-material/SupportAgent'
import UndoIcon from '@mui/icons-material/Undo'
import RedoIcon from '@mui/icons-material/Redo'
Expand Down Expand Up @@ -181,33 +180,6 @@ export function ChatButton(props: ButtonProps) {
)
}

export function ErrorsButton(props: ButtonProps) {
const onClick = props.onClick || noop
let title = 'Toggle showing only errors [Ctrl+E]'
if (props.disabled) title = 'No errors to show'
useKeyPress(['ctrl.e'], (event) => {
event.preventDefault()
if (!props.disabled) {
onClick()
}
})
return (
<LightTooltip title={title}>
<Box>
<IconButton
small
variant="text"
label={props.label || 'Errors'}
Icon={ReportGmailerrorredIcon}
color={props.color || props.active ? 'warning' : undefined}
disabled={props.disabled}
onClick={() => onClick()}
/>
</Box>
</LightTooltip>
)
}

export function UndoButton(props: ButtonProps) {
const onClick = props.onClick || noop
let title = 'Undo last change [Ctrl+Z]'
Expand Down

0 comments on commit 306656c

Please sign in to comment.