From f9ba62b59b65de3412eb3b66a6584a8445c6821d Mon Sep 17 00:00:00 2001 From: Madmat8 Date: Tue, 14 Mar 2023 12:49:31 +0100 Subject: [PATCH 1/3] Add clear all filter button to filter drawer --- .../actor/src/components/dialog/FilterDialog.tsx.hbs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/judo-ui-react/src/main/resources/actor/src/components/dialog/FilterDialog.tsx.hbs b/judo-ui-react/src/main/resources/actor/src/components/dialog/FilterDialog.tsx.hbs index f1271a81..13d4e9d7 100644 --- a/judo-ui-react/src/main/resources/actor/src/components/dialog/FilterDialog.tsx.hbs +++ b/judo-ui-react/src/main/resources/actor/src/components/dialog/FilterDialog.tsx.hbs @@ -344,6 +344,11 @@ export const FilterDialog = ({ filters, filterOptions, resolve, open, handleClos resolve(tempFilters); }; + const clear = () => { + handleClose(); + resolve([]); + }; + return ( { t('judo.modal.filter.cancel', { defaultValue: 'Cancel' }) as string } + { tempFilters.length > 0 && + } From d2487bbb6bda7372be91735f52613b4a10e886c9 Mon Sep 17 00:00:00 2001 From: Madmat8 Date: Tue, 14 Mar 2023 14:15:55 +0100 Subject: [PATCH 2/3] Add translation to system tranlation files --- .../src/main/resources/actor/public/i18n/system_default.json.hbs | 1 + .../src/main/resources/actor/public/i18n/system_en-US.json.hbs | 1 + .../src/main/resources/actor/public/i18n/system_hu-HU.json.hbs | 1 + 3 files changed, 3 insertions(+) diff --git a/judo-ui-react/src/main/resources/actor/public/i18n/system_default.json.hbs b/judo-ui-react/src/main/resources/actor/public/i18n/system_default.json.hbs index a5e7e160..27141388 100644 --- a/judo-ui-react/src/main/resources/actor/public/i18n/system_default.json.hbs +++ b/judo-ui-react/src/main/resources/actor/public/i18n/system_default.json.hbs @@ -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", diff --git a/judo-ui-react/src/main/resources/actor/public/i18n/system_en-US.json.hbs b/judo-ui-react/src/main/resources/actor/public/i18n/system_en-US.json.hbs index a5e7e160..27141388 100644 --- a/judo-ui-react/src/main/resources/actor/public/i18n/system_en-US.json.hbs +++ b/judo-ui-react/src/main/resources/actor/public/i18n/system_en-US.json.hbs @@ -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", diff --git a/judo-ui-react/src/main/resources/actor/public/i18n/system_hu-HU.json.hbs b/judo-ui-react/src/main/resources/actor/public/i18n/system_hu-HU.json.hbs index 20713a10..1affaf2f 100644 --- a/judo-ui-react/src/main/resources/actor/public/i18n/system_hu-HU.json.hbs +++ b/judo-ui-react/src/main/resources/actor/public/i18n/system_hu-HU.json.hbs @@ -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", From 21bd669b1c1d19030d35c43440ae8cbcedae929e Mon Sep 17 00:00:00 2001 From: Madmat8 Date: Tue, 14 Mar 2023 14:33:41 +0100 Subject: [PATCH 3/3] Clear all button doest exit from filterdialog --- .../resources/actor/src/components/dialog/FilterDialog.tsx.hbs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/judo-ui-react/src/main/resources/actor/src/components/dialog/FilterDialog.tsx.hbs b/judo-ui-react/src/main/resources/actor/src/components/dialog/FilterDialog.tsx.hbs index 13d4e9d7..0d15f418 100644 --- a/judo-ui-react/src/main/resources/actor/src/components/dialog/FilterDialog.tsx.hbs +++ b/judo-ui-react/src/main/resources/actor/src/components/dialog/FilterDialog.tsx.hbs @@ -345,8 +345,7 @@ export const FilterDialog = ({ filters, filterOptions, resolve, open, handleClos }; const clear = () => { - handleClose(); - resolve([]); + setTempFilters([]); }; return (