Skip to content

Commit

Permalink
work on 447
Browse files Browse the repository at this point in the history
  • Loading branch information
barbalex committed Jan 24, 2025
1 parent 943c366 commit cae882a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 15 deletions.
11 changes: 1 addition & 10 deletions src/components/EkPlan/Table/CellHeaderFixedTpopStatus/Option.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,14 @@ export const Option = memo(
const filterStatus = filterStatusIn ? getSnapshot(filterStatusIn) : []
const checked = filterStatus.includes(option.code)

console.log('Option', { option, filterStatus, checked })

const onChange = useCallback(() => {
const newStatus =
filterStatus.includes(option.code) ?
filterStatus.filter((el) => el !== option.code)
: [...new Set([...filterStatus, option.code])]

console.log('Option onChange', {
newStatus,
code: option.code,
filterStatus,
includes: filterStatus.includes(option.code),
})

setFilterStatus(newStatus)
refetch()
// refetch()
}, [filterStatus, setFilterStatus, option.code])

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,10 @@ import { useQuery } from '@apollo/client'
import { Option } from './Option.jsx'
import { query } from './query.js'

export const Options = memo(({refetch}) => {
export const Options = memo(({ refetch }) => {
const { data } = useQuery(query)

const options = data?.allPopStatusWertes?.nodes ?? []

console.log('Options', options)

return (
<FormGroup>
<FormLabel>Gewünschte Stati wählen:</FormLabel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ export const CellHeaderFixedTpopStatus = memo(({ style, column, refetch }) => {

const [anchorEl, setAnchorEl] = useState(null)

const closeMenu = useCallback(() => setAnchorEl(null), [])
const closeMenu = useCallback(() => {
setAnchorEl(null)
refetch()
}, [])
const onClickCell = useCallback((e) => setAnchorEl(e.currentTarget), [])
const onClickFilterEmptyValues = useCallback(() => {
if (!filterStatusEmpty && filterStatus) {
Expand Down

0 comments on commit cae882a

Please sign in to comment.