From ddfb91e9eee0902fba8b972e2724b2eb4707654a Mon Sep 17 00:00:00 2001 From: Lisa Knox Date: Tue, 3 Oct 2023 10:02:15 -0400 Subject: [PATCH] 15768: removed submit func from ms popover Arvados-DCO-1.1-Signed-off-by: Lisa Knox --- .../data-table-multiselect-popover.tsx | 87 +++++++++---------- 1 file changed, 41 insertions(+), 46 deletions(-) diff --git a/src/components/data-table-multiselect-popover/data-table-multiselect-popover.tsx b/src/components/data-table-multiselect-popover/data-table-multiselect-popover.tsx index 6a38581e2d..08ff6b02c7 100644 --- a/src/components/data-table-multiselect-popover/data-table-multiselect-popover.tsx +++ b/src/components/data-table-multiselect-popover/data-table-multiselect-popover.tsx @@ -2,34 +2,34 @@ // // SPDX-License-Identifier: AGPL-3.0 -import React, { useEffect } from 'react'; -import { WithStyles, withStyles, ButtonBase, StyleRulesCallback, Theme, Popover, Card, Tooltip, IconButton } from '@material-ui/core'; -import classnames from 'classnames'; -import { DefaultTransformOrigin } from 'components/popover/helpers'; -import debounce from 'lodash/debounce'; -import { grey } from '@material-ui/core/colors'; -import { TCheckedList } from 'components/data-table/data-table'; +import React, { useEffect } from "react"; +import { WithStyles, withStyles, ButtonBase, StyleRulesCallback, Theme, Popover, Card, Tooltip, IconButton } from "@material-ui/core"; +import classnames from "classnames"; +import { DefaultTransformOrigin } from "components/popover/helpers"; +import debounce from "lodash/debounce"; +import { grey } from "@material-ui/core/colors"; +import { TCheckedList } from "components/data-table/data-table"; -export type CssRules = 'root' | 'icon' | 'iconButton' | 'disabled' | 'optionsContainer' | 'option'; +export type CssRules = "root" | "icon" | "iconButton" | "disabled" | "optionsContainer" | "option"; const styles: StyleRulesCallback = (theme: Theme) => ({ root: { - borderRadius: '7px', - '&:hover': { + borderRadius: "7px", + "&:hover": { backgroundColor: grey[200], }, - '&:focus': { + "&:focus": { color: theme.palette.text.primary, }, }, icon: { - cursor: 'pointer', + cursor: "pointer", fontSize: 20, - userSelect: 'none', - '&:hover': { + userSelect: "none", + "&:hover": { color: theme.palette.text.primary, }, - paddingBottom: '5px', + paddingBottom: "5px", }, iconButton: { color: theme.palette.text.primary, @@ -41,17 +41,17 @@ const styles: StyleRulesCallback = (theme: Theme) => ({ color: grey[500], }, optionsContainer: { - padding: '1rem 0', + padding: "1rem 0", flex: 1, }, option: { - cursor: 'pointer', - display: 'flex', - padding: '3px 2rem', - fontSize: '0.9rem', - alignItems: 'center', - '&:hover': { - backgroundColor: 'rgba(0, 0, 0, 0.08)', + cursor: "pointer", + display: "flex", + padding: "3px 2rem", + fontSize: "0.9rem", + alignItems: "center", + "&:hover": { + backgroundColor: "rgba(0, 0, 0, 0.08)", }, }, }); @@ -83,13 +83,25 @@ export const DataTableMultiselectPopover = withStyles(styles)( const { classes, children, options, checkedList, disabled } = this.props; return ( <> - - {} : this.open} disableRipple> + + {} : this.open} + disableRipple + > {children} - + @@ -120,7 +132,6 @@ export const DataTableMultiselectPopover = withStyles(styles)( - ); } @@ -129,24 +140,8 @@ export const DataTableMultiselectPopover = withStyles(styles)( this.setState({ anchorEl: this.icon.current || undefined }); }; - submit = debounce(() => { - // const { onChange } = this.props; - // if (onChange) { - // onChange(this.state.filters); - // } - }, 1000); - - MountHandler = () => { - useEffect(() => { - return () => { - this.submit.cancel(); - }; - }, []); - return null; - }; - close = () => { - this.setState((prev) => ({ + this.setState(prev => ({ ...prev, anchorEl: undefined, })); -- 2.30.2