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,7 +18,7 @@
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 React, { useEffect, useState } from 'react'
Expand All @@ -36,8 +36,14 @@

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: filter !== '' ? [{ type: 'search', filterValue: filter }] : [] } } })

Check warning on line 46 in assets/js/src/core/modules/quantity-value/quantity-value-container.tsx

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Unexpected negated condition.

See more on https://sonarcloud.io/project/issues?id=pimcore_studio-ui-bundle&issues=AZ2bFKNKQ7FHawfCy0TP&open=AZ2bFKNKQ7FHawfCy0TP&pullRequest=3354

const handleRefetch = (): void => {
void refetch().catch(() => {
Expand Down Expand Up @@ -175,7 +181,7 @@
<Toolbar
justify='space-between'
margin={ {
x: 'mini',
x: 'extra-small',
y: 'none'
} }
theme='secondary'
Expand All @@ -189,6 +195,13 @@
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: 0 additions & 23 deletions public/build/6e638a4c-6b70-4deb-9182-9107f6d18700/entrypoints.json

This file was deleted.

Loading