Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import { useFormModal } from '@Pimcore/components/modal/form-modal/hooks/use-for
import { ModalTitle } from '@Pimcore/components/modal/modal-title/modal-title'
import { Title } from '@Pimcore/components/title/title'
import { Toolbar } from '@Pimcore/components/toolbar/toolbar'
import { Box, IconTextButton, Pagination, Split } from '@sdk/components'
import { Box, IconTextButton, Pagination, SearchInput, Split } from '@sdk/components'
import { uuid } from '@sdk/utils'
import { isUndefined } from 'lodash'
import { isNil, isUndefined } from 'lodash'
import React, { useEffect, useState } from 'react'
import { useTranslation } from 'react-i18next'
import trackError, { ApiError, GeneralError } from '../app/error-handler'
Expand All @@ -36,8 +36,14 @@ export const QuantityValueContainer = (): React.JSX.Element => {

const [currentPage, setCurrentPage] = useState<number>(1)
const [pageSize, setPageSize] = useState<number>(20)
const [filter, setFilter] = useState<string>('')

const { data, isLoading, isFetching, error, refetch } = useUnitQuantityValueUnitsCollectionQuery({ body: { filters: { page: currentPage, pageSize } } })
const handleSearch = (value: string): void => {
setFilter(value)
setCurrentPage(1)
}

const { data, isLoading, isFetching, error, refetch } = useUnitQuantityValueUnitsCollectionQuery({ body: { filters: { page: currentPage, pageSize, columnFilters: isNil(filter) ? [] : [{ type: 'search', filterValue: filter }] } } })

const handleRefetch = (): void => {
void refetch().catch(() => {
Expand Down Expand Up @@ -175,7 +181,7 @@ export const QuantityValueContainer = (): React.JSX.Element => {
<Toolbar
justify='space-between'
margin={ {
x: 'mini',
x: 'extra-small',
y: 'none'
} }
theme='secondary'
Expand All @@ -189,6 +195,13 @@ export const QuantityValueContainer = (): React.JSX.Element => {
onClick={ openCreateModal }
>{t('quantity-values.new')}</IconTextButton>
</Flex>
<SearchInput
loading={ isFetching }
onSearch={ handleSearch }
placeholder={ t('quantity-values.search') }
withPrefix={ false }
withoutAddon={ false }
/>
</Toolbar>
}
>
Expand Down
22 changes: 0 additions & 22 deletions public/build/1a6066e8-0198-42c2-80e5-e7b0fbc075f7/entrypoints.json

This file was deleted.

33 changes: 0 additions & 33 deletions public/build/1a6066e8-0198-42c2-80e5-e7b0fbc075f7/manifest.json

This file was deleted.

23 changes: 23 additions & 0 deletions public/build/5fc6d71f-b469-4701-a486-ac66dc3b5bd7/entrypoints.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading