Skip to content

Commit

Permalink
Merge pull request #28 from BlackBeltTechnology/feature/JNG-4631_Add_…
Browse files Browse the repository at this point in the history
…clear_all_filter_button

JNG-4460 Add clear all filter button to filter drawer
  • Loading branch information
Madmat8 authored Mar 14, 2023
2 parents 06ca4ef + 21bd669 commit 643c295
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"judo.modal.filter.add-new-filter": "Add new filter",
"judo.modal.filter.cancel": "Cancel",
"judo.modal.filter.apply": "Apply",
"judo.modal.filter.clear-all": "Clear all",
"judo.modal.confirm.confirm": "Yes",
"judo.modal.confirm.cancel": "No",
"judo.modal.close": "Close",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"judo.modal.filter.add-new-filter": "Add new filter",
"judo.modal.filter.cancel": "Cancel",
"judo.modal.filter.apply": "Apply",
"judo.modal.filter.clear-all": "Clear all",
"judo.modal.confirm.confirm": "Yes",
"judo.modal.confirm.cancel": "No",
"judo.modal.close": "Close",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"judo.modal.filter.add-new-filter": "Szűrő hozzáadása",
"judo.modal.filter.cancel": "Mégsem",
"judo.modal.filter.apply": "Alkalmaz",
"judo.modal.filter.clear-all": "Összes törlése",
"judo.modal.confirm.confirm": "Igen",
"judo.modal.confirm.cancel": "Nem",
"judo.modal.close": "Bezárás",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,10 @@ export const FilterDialog = ({ filters, filterOptions, resolve, open, handleClos
resolve(tempFilters);
};
const clear = () => {
setTempFilters([]);
};
return (
<Dialog
open={open}
Expand Down Expand Up @@ -422,6 +426,10 @@ export const FilterDialog = ({ filters, filterOptions, resolve, open, handleClos
<Button fullWidth variant="outlined" onClick={cancel}>
{ t('judo.modal.filter.cancel', { defaultValue: 'Cancel' }) as string }
</Button>
{ tempFilters.length > 0 &&
<Button id="clear-all-filters" fullWidth variant="outlined" onClick={clear}>
{t('judo.modal.filter.clear-all', { defaultValue: 'Clear all' }) as string}
</Button> }
<Button fullWidth onClick={ok}>
{ t('judo.modal.filter.apply', { defaultValue: 'Apply' }) as string } {'(' + tempFilters.length + ')'}
</Button>
Expand Down

0 comments on commit 643c295

Please sign in to comment.