Skip to content

Commit

Permalink
fix(pci-object-storage): adapte search filter to MRC ods18 version
Browse files Browse the repository at this point in the history
ref: DTCORE-2950
Signed-off-by: LIDRISSI Hamid <[email protected]>
  • Loading branch information
seven-amid committed Jan 13, 2025
1 parent 01ccbad commit 3d27f1c
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 99 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export default function ListingPage() {
});
}}
/>
<div className="justify-between flex space-x-4">
<div className="flex justify-center gap-4">
<OdsButton
size="sm"
variant="outline"
Expand All @@ -101,41 +101,40 @@ export default function ListingPage() {
label=""
/>
<OdsInput
type="search"
name="searchField"
className="w-[70%]"
className="min-w-[15rem]"
value={searchField}
onKeyDown={(event) => {
if (event.key === 'Enter') {
setPagination({
pageIndex: 0,
pageSize: pagination.pageSize,
});
addFilter({
key: 'name',
value: searchField,
comparator: FilterComparator.Includes,
label: '',
});
setSearchField('');
}
}}
onOdsChange={(event) => {
const value = event.detail.value.toString();
setSearchField(value);
onOdsChange={({ detail }) => setSearchField(detail.value as string)}
/>
<OdsButton
label=""
icon="magnifying-glass"
size="sm"
onClick={() => {
setPagination({
pageIndex: 0,
pageSize: pagination.pageSize,
});
addFilter({
key: 'name',
value: searchField,
comparator: FilterComparator.Includes,
label: '',
});
setSearchField('');
}}
/>
<div>
<OdsButton
slot="popover-trigger"
id="popover-filter"
size="sm"
color="primary"
label={t('pci-common:common_criteria_adder_filter_label')}
variant="outline"
icon="filter"
/>
</div>

<OdsButton
slot="popover-trigger"
id="popover-filter"
size="sm"
color="primary"
label={t('pci-common:common_criteria_adder_filter_label')}
variant="outline"
icon="filter"
/>

<OdsPopover triggerId="popover-filter">
<FilterAdd
columns={[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -459,41 +459,42 @@ export default function ObjectPage() {
size="sm"
/>

<div className="justify-between flex">
<div className="flex justify-center gap-4">
<OdsInput
type="search"
name="searchField"
className="w-[70%]"
className="min-w-[15rem]"
value={searchField}
onKeyDown={(event) => {
if (event.key === 'Enter') {
if (searchField) {
setSearchField('');
addFilter({
key: 'name',
value: searchField,
comparator: FilterComparator.Includes,
label: '',
});
}
}
}}
onOdsChange={(event) => {
const value = event.detail.value.toString();
setSearchField(value);
onOdsChange={({ detail }) =>
setSearchField(detail.value as string)
}
/>
<OdsButton
label=""
icon="magnifying-glass"
size="sm"
onClick={() => {
setPagination({
pageIndex: 0,
pageSize: pagination.pageSize,
});
addFilter({
key: 'search',
value: searchField,
comparator: FilterComparator.Includes,
label: '',
});
setSearchField('');
}}
/>

<OdsButton
id="filterPopoverTrigger"
slot="popover-trigger"
class="ml-4"
label={tFilter('common_criteria_adder_filter_label')}
icon="filter"
size="sm"
color="primary"
label={tFilter('common_criteria_adder_filter_label')}
variant="outline"
icon="filter"
/>

<OdsPopover triggerId="filterPopoverTrigger">
<FilterAdd
columns={[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,57 +90,50 @@ export default function Listing() {
}}
/>

<div className="justify-between flex">
<div className="flex justify-center gap-4">
<OdsButton
data-testid="refresh-button"
label=""
size="sm"
icon="refresh"
variant="outline"
color="primary"
className="xs:mb-0.5 sm:mb-0 mr-4"
onClick={() => {
refresh();
}}
></OdsButton>
className="xs:mb-0.5 sm:mb-0"
onClick={refresh}
icon="refresh"
label=""
/>
<OdsInput
data-testid="search-bar"
className="w-[14rem]"
value={searchField}
type="search"
color="primary"
name="searchField"
onKeyDown={(event) => {
if (event.key === 'Enter') {
setPagination({
pageIndex: 0,
pageSize: pagination.pageSize,
});
addFilter({
key: 'search',
value: searchField,
comparator: FilterComparator.Includes,
label: '',
});
setSearchField('');
}
}}
onOdsChange={(event) => {
const value = event.detail.value.toString();
setSearchField(value);
className="min-w-[15rem]"
value={searchField}
onOdsChange={({ detail }) => setSearchField(detail.value as string)}
/>
<OdsButton
label=""
icon="magnifying-glass"
size="sm"
onClick={() => {
setPagination({
pageIndex: 0,
pageSize: pagination.pageSize,
});
addFilter({
key: 'search',
value: searchField,
comparator: FilterComparator.Includes,
label: '',
});
setSearchField('');
}}
/>
<div>
<OdsButton
label={tFilter('common_criteria_adder_filter_label')}
size="sm"
color="primary"
id="popover-filter"
icon="filter"
variant="outline"
class="ml-4"
/>
</div>

<OdsButton
slot="popover-trigger"
id="popover-filter"
size="sm"
color="primary"
label={t('pci-common:common_criteria_adder_filter_label')}
variant="outline"
icon="filter"
/>
<OdsPopover triggerId="popover-filter">
<FilterAdd
columns={[
Expand Down

0 comments on commit 3d27f1c

Please sign in to comment.