diff --git a/public/locales/ar.json b/public/locales/ar.json index 7a1d579dd..7fa46ef61 100644 --- a/public/locales/ar.json +++ b/public/locales/ar.json @@ -62,9 +62,11 @@ "unknown_error": "خطأ غير معروف" }, "filter": { - "deselect_all": "إلغاء تحديد الكل", - "only_on_map": "على الخريطة", - "select_all": "تحديد الكل" + "all_types": "جميع الأنواع", + "clear": "مسح", + "include_locations_from_tree_inventories": "مع مواقع جرد الأشجار", + "select_shown": "تحديد الكل المعروض", + "within_map_bounds": "ضمن حدود الخريطة" }, "form": { "button": { diff --git a/public/locales/de.json b/public/locales/de.json index b843d5d84..5e3a141cc 100644 --- a/public/locales/de.json +++ b/public/locales/de.json @@ -62,9 +62,11 @@ "unknown_error": "Unbekannter Fehler" }, "filter": { - "deselect_all": "Alle abwählen", - "only_on_map": "Auf der Karte", - "select_all": "Alle auswählen" + "all_types": "Alle Typen", + "clear": "Löschen", + "include_locations_from_tree_inventories": "Mit Baumkataster-Standorten", + "select_shown": "Alle angezeigten auswählen", + "within_map_bounds": "Innerhalb der Kartengrenzen" }, "form": { "button": { diff --git a/public/locales/el.json b/public/locales/el.json index 927804834..def3fd56d 100644 --- a/public/locales/el.json +++ b/public/locales/el.json @@ -62,9 +62,11 @@ "unknown_error": "Άγνωστο σφάλμα" }, "filter": { - "deselect_all": "Αποεπιλογή όλων", - "only_on_map": "Στον χάρτη", - "select_all": "Επιλογή όλων" + "all_types": "Όλοι οι τύποι", + "clear": "Εκκαθάριση", + "include_locations_from_tree_inventories": "Με τοποθεσίες απογραφής δέντρων", + "select_shown": "Επιλογή όλων", + "within_map_bounds": "Εντός ορίων χάρτη" }, "form": { "button": { diff --git a/public/locales/en.json b/public/locales/en.json index be000c14d..2eac5043b 100644 --- a/public/locales/en.json +++ b/public/locales/en.json @@ -62,9 +62,11 @@ "unknown_error": "Unknown error" }, "filter": { - "deselect_all": "Deselect all", - "only_on_map": "On the map", - "select_all": "Select all" + "all_types": "All types", + "clear": "Clear", + "include_locations_from_tree_inventories": "With tree inventory locations", + "select_shown": "Select all shown", + "within_map_bounds": "Within map bounds" }, "form": { "button": { diff --git a/public/locales/es.json b/public/locales/es.json index 11053f7f1..dde0dbcb8 100644 --- a/public/locales/es.json +++ b/public/locales/es.json @@ -62,9 +62,11 @@ "unknown_error": "Error desconocido" }, "filter": { - "deselect_all": "Deseleccionar todo", - "only_on_map": "En el mapa", - "select_all": "Seleccionar todo" + "all_types": "Todos los tipos", + "clear": "Limpiar", + "include_locations_from_tree_inventories": "Con ubicaciones de inventarios de árboles", + "select_shown": "Seleccionar todos los mostrados", + "within_map_bounds": "Dentro de los límites del mapa" }, "form": { "button": { diff --git a/public/locales/fr.json b/public/locales/fr.json index ef6f25333..f731e2086 100644 --- a/public/locales/fr.json +++ b/public/locales/fr.json @@ -62,9 +62,11 @@ "unknown_error": "Erreur inconnue" }, "filter": { - "deselect_all": "Désélectionner tous", - "only_on_map": "Sur la carte", - "select_all": "Sélectionner tous" + "all_types": "Tous les types", + "clear": "Effacer", + "include_locations_from_tree_inventories": "Avec les emplacements d'inventaires d'arbres", + "select_shown": "Tout sélectionner", + "within_map_bounds": "Dans les limites de la carte" }, "form": { "button": { diff --git a/public/locales/he.json b/public/locales/he.json index 81933fa71..ef39b48e6 100644 --- a/public/locales/he.json +++ b/public/locales/he.json @@ -62,9 +62,11 @@ "unknown_error": "שגיאה לא ידועה" }, "filter": { - "deselect_all": "בטל בחירת הכל", - "only_on_map": "על המפה", - "select_all": "בחר הכל" + "all_types": "כל הסוגים", + "clear": "נקה", + "include_locations_from_tree_inventories": "עם מיקומי מלאי עצים", + "select_shown": "בחר את כל המוצגים", + "within_map_bounds": "בתוך גבולות המפה" }, "form": { "button": { diff --git a/public/locales/it.json b/public/locales/it.json index 69675f25f..eb9e238fe 100644 --- a/public/locales/it.json +++ b/public/locales/it.json @@ -62,9 +62,11 @@ "unknown_error": "Errore sconosciuto" }, "filter": { - "deselect_all": "Deselect all", - "only_on_map": "On the map", - "select_all": "Select all" + "all_types": "Tutti i tipi", + "clear": "Cancella", + "include_locations_from_tree_inventories": "Con posizioni dell'inventario degli alberi", + "select_shown": "Seleziona tutti i mostrati", + "within_map_bounds": "Entro i confini della mappa" }, "form": { "button": { diff --git a/public/locales/nl.json b/public/locales/nl.json index b748179bd..f5493a185 100644 --- a/public/locales/nl.json +++ b/public/locales/nl.json @@ -62,9 +62,11 @@ "unknown_error": "Onbekende fout" }, "filter": { - "deselect_all": "Deselect all", - "only_on_map": "On the map", - "select_all": "Select all" + "all_types": "Alle types", + "clear": "Wissen", + "include_locations_from_tree_inventories": "Met bomeninventarislocaties", + "select_shown": "Selecteer alle getoonde", + "within_map_bounds": "Binnen kaartgrenzen" }, "form": { "button": { diff --git a/public/locales/pl.json b/public/locales/pl.json index 5de76581f..465ef9560 100644 --- a/public/locales/pl.json +++ b/public/locales/pl.json @@ -62,9 +62,11 @@ "unknown_error": "Nieznany błąd" }, "filter": { - "deselect_all": "Odznacz wszystko", - "only_on_map": "Na mapie", - "select_all": "Zaznacz wszystko" + "all_types": "Wszystkie typy", + "clear": "Wyczyść", + "include_locations_from_tree_inventories": "Z lokalizacjami z inwentaryzacji drzew", + "select_shown": "Zaznacz wszystkie pokazane", + "within_map_bounds": "W granicach mapy" }, "form": { "button": { diff --git a/public/locales/pt.json b/public/locales/pt.json index 318193c93..f6a3d00e6 100644 --- a/public/locales/pt.json +++ b/public/locales/pt.json @@ -62,9 +62,11 @@ "unknown_error": "Erro desconhecido" }, "filter": { - "deselect_all": "Desmarcar todos", - "only_on_map": "No mapa", - "select_all": "Selecionar todos" + "all_types": "Todos os tipos", + "clear": "Limpar", + "include_locations_from_tree_inventories": "Com localizações de inventário de árvores", + "select_shown": "Selecionar todos os exibidos", + "within_map_bounds": "Dentro dos limites do mapa" }, "form": { "button": { diff --git a/public/locales/ru.json b/public/locales/ru.json index 296f53dd3..bedb7b718 100644 --- a/public/locales/ru.json +++ b/public/locales/ru.json @@ -62,9 +62,11 @@ "unknown_error": "Неизвестная ошибка" }, "filter": { - "deselect_all": "Снять все", - "only_on_map": "На карте", - "select_all": "Выбрать все" + "all_types": "Все типы", + "clear": "Очистить", + "include_locations_from_tree_inventories": "С местоположениями из древесных инвентаризаций", + "select_shown": "Выбрать все показанные", + "within_map_bounds": "В пределах границ карты" }, "form": { "button": { diff --git a/public/locales/sv.json b/public/locales/sv.json index 144c860ba..e93615115 100644 --- a/public/locales/sv.json +++ b/public/locales/sv.json @@ -62,9 +62,11 @@ "unknown_error": "Okänt fel" }, "filter": { - "deselect_all": "Avmarkera alla", - "only_on_map": "På kartan", - "select_all": "Markera alla" + "all_types": "Alla typer", + "clear": "Rensa", + "include_locations_from_tree_inventories": "Med trädinventeringsplatser", + "select_shown": "Markera alla visade", + "within_map_bounds": "Inom kartgränser" }, "form": { "button": { diff --git a/public/locales/tr.json b/public/locales/tr.json index c9cfc9a7c..6fd7bc56f 100644 --- a/public/locales/tr.json +++ b/public/locales/tr.json @@ -62,9 +62,11 @@ "unknown_error": "Bilinmeyen hata" }, "filter": { - "deselect_all": "Tümünü kaldır", - "only_on_map": "Haritada", - "select_all": "Tümünü seç" + "all_types": "Tüm türler", + "clear": "Temizle", + "include_locations_from_tree_inventories": "Ağaç envanteri konumlarıyla birlikte", + "select_shown": "Gösterilenlerin tümünü seç", + "within_map_bounds": "Harita sınırları içinde" }, "form": { "button": { diff --git a/public/locales/uk.json b/public/locales/uk.json index 5739a1735..574122082 100644 --- a/public/locales/uk.json +++ b/public/locales/uk.json @@ -62,9 +62,11 @@ "unknown_error": "Невідома помилка" }, "filter": { - "deselect_all": "Скасувати вибір", - "only_on_map": "На карті", - "select_all": "Вибрати все" + "all_types": "Усі типи", + "clear": "Очистити", + "include_locations_from_tree_inventories": "З локаціями з інвентаризації дерев", + "select_shown": "Вибрати всі показані", + "within_map_bounds": "В межах меж карти" }, "form": { "button": { diff --git a/public/locales/vi.json b/public/locales/vi.json index 80b20481c..d42da0308 100644 --- a/public/locales/vi.json +++ b/public/locales/vi.json @@ -62,9 +62,11 @@ "unknown_error": "Lỗi không xác định" }, "filter": { - "deselect_all": "Bỏ chọn tất cả", - "only_on_map": "Trên bản đồ", - "select_all": "Chọn tất cả" + "all_types": "Tất cả các loại", + "clear": "Xóa", + "include_locations_from_tree_inventories": "Với vị trí kiểm kê cây", + "select_shown": "Chọn tất cả đã hiển thị", + "within_map_bounds": "Trong ranh giới bản đồ" }, "form": { "button": { diff --git a/public/locales/zh-hans.json b/public/locales/zh-hans.json index 514e27532..98668ae44 100644 --- a/public/locales/zh-hans.json +++ b/public/locales/zh-hans.json @@ -62,9 +62,11 @@ "unknown_error": "未知错误" }, "filter": { - "deselect_all": "取消全选", - "only_on_map": "在地图上", - "select_all": "全选" + "all_types": "所有类型", + "clear": "清除", + "include_locations_from_tree_inventories": "包含树木清单位置", + "select_shown": "选择所有显示的", + "within_map_bounds": "在地图边界内" }, "form": { "button": { diff --git a/public/locales/zh-hant.json b/public/locales/zh-hant.json index 4b875612b..047efe140 100644 --- a/public/locales/zh-hant.json +++ b/public/locales/zh-hant.json @@ -62,9 +62,11 @@ "unknown_error": "未知錯誤" }, "filter": { - "deselect_all": "取消全選", - "only_on_map": "在地圖上", - "select_all": "全選" + "all_types": "所有類型", + "clear": "清除", + "include_locations_from_tree_inventories": "包含樹木清單位置", + "select_shown": "選擇所有顯示的項目", + "within_map_bounds": "在地圖範圍內" }, "form": { "button": { diff --git a/src/components/filter/Filter.js b/src/components/filter/Filter.js index b14acc24b..1c956f6ea 100644 --- a/src/components/filter/Filter.js +++ b/src/components/filter/Filter.js @@ -9,42 +9,39 @@ import { muniChanged, selectionChanged } from '../../redux/viewChange' import buildSelectTree from '../../utils/buildSelectTree' import { useIsDesktop } from '../../utils/useBreakpoint' import Input from '../ui/Input' +import { Select } from '../ui/Select' import FilterButtons from './FilterButtons' import LabeledCheckbox from './LabeledCheckbox' import RCTreeSelectSkeleton from './RCTreeSelectSkeleton' import TreeSelect from './TreeSelect' -const EdibleTypeText = styled.p` - font-size: 0.875rem; - font-weight: bold; +const TypesHeader = styled.h5` color: ${({ theme }) => theme.secondaryText}; - margin-block-start: 1.25em; + margin-block: 0.75em; margin-block-end: 0.5em; - ${({ isDesktop }) => - !isDesktop && - ` - margin-block-start: 0em; - `} ` -const TreeFiltersContainer = styled.div` - margin-block: 0.5em; - /* Provide vertical space when buttons wrap over multiple lines */ - line-height: 1.5rem; +const SearchAndSelectContainer = styled.div` + display: flex; + flex-wrap: wrap; + gap: 5px; ` const SearchInput = styled(Input)` - height: 2.5em; - padding: 0; - flex: 0; + flex: 1; + min-width: 5em; + height: 2.65em; input { - margin-block: 1em; - margin-inline: 0.75em; - height: 100%; + margin-block: 0.5em; } ` -const MuniCheckbox = styled.div` - margin-block: 1em; + +const MapAreaSelectWrapper = styled.div` + width: 15em; +` + +const MunicipalTreeInventoriesCheckbox = styled.div` + margin-block-start: 1em; ` const Filter = () => { @@ -74,65 +71,70 @@ const Filter = () => { const isDesktop = useIsDesktop() const { t } = useTranslation() + const mapAreaOptions = [ + { value: 'map', label: t('filter.within_map_bounds') }, + { value: 'all', label: t('filter.all_types') }, + ] return ( - <> -
- - {t('glossary.type.other')} - - setSearchValueDebounced(e.target.value)} - placeholder={t('glossary.type.one')} +
+ + dispatch(muniChanged(checked))} /> - - dispatch(setShowOnlyOnMap(checked))} - style={{ display: 'inline-block', marginInlineEnd: '5px' }} - /> - { - const newSelection = [...new Set([...types, ...visibleTypeIds])] - dispatch(selectionChanged(newSelection)) - }} - onDeselectAllClick={() => { - const remainingSelection = types.filter( - (typeId) => !visibleTypeIds.some((t) => t === typeId), - ) - dispatch(selectionChanged(remainingSelection)) - }} - isSelectAllDisabled={visibleTypeIds.every((typeId) => - types.includes(typeId), - )} - isDeselectAllDisabled={visibleTypeIds.every( - (typeId) => !types.includes(typeId), + + + {t('glossary.type.other')} + + + +