Commit 7a266422 authored by Alexandre Delanoë's avatar Alexandre Delanoë

Merge remote-tracking branch 'origin/425-dev-terms-page-reset' into dev-merge

parents a8ba5031 4eb82bba
...@@ -41,6 +41,7 @@ import Gargantext.Components.NgramsTable.SelectionCheckbox as NTSC ...@@ -41,6 +41,7 @@ import Gargantext.Components.NgramsTable.SelectionCheckbox as NTSC
import Gargantext.Components.NgramsTable.SyncResetButton (syncResetButtons) import Gargantext.Components.NgramsTable.SyncResetButton (syncResetButtons)
import Gargantext.Components.NgramsTable.Tree (renderNgramsItem, renderNgramsTree) import Gargantext.Components.NgramsTable.Tree (renderNgramsItem, renderNgramsTree)
import Gargantext.Components.Nodes.Lists.Types as NT import Gargantext.Components.Nodes.Lists.Types as NT
import Gargantext.Components.Table (changePage)
import Gargantext.Components.Table as TT import Gargantext.Components.Table as TT
import Gargantext.Components.Table.Types as TT import Gargantext.Components.Table.Types as TT
import Gargantext.Config.REST (AffRESTError, RESTError, logRESTError) import Gargantext.Config.REST (AffRESTError, RESTError, logRESTError)
...@@ -155,6 +156,7 @@ tableContainerCpt { addCallback ...@@ -155,6 +156,7 @@ tableContainerCpt { addCallback
, termSizeFilter , termSizeFilter
, params , params
} <- T.useLive T.unequal path } <- T.useLive T.unequal path
params <- T.useFocused (_.params) (\a b -> b { params = a }) path
-- | Computed -- | Computed
-- | -- |
...@@ -218,7 +220,7 @@ tableContainerCpt { addCallback ...@@ -218,7 +220,7 @@ tableContainerCpt { addCallback
{ id: "picklistmenu" { id: "picklistmenu"
, className: "form-control custom-select" , className: "form-control custom-select"
, defaultValue: (maybe "" show termListFilter) , defaultValue: (maybe "" show termListFilter)
, on: {change: setTermListFilter <<< read <<< R.unsafeEventValue} , on: {change: changeTermList params}
} }
(map optps1 termLists) (map optps1 termLists)
] ]
...@@ -234,7 +236,7 @@ tableContainerCpt { addCallback ...@@ -234,7 +236,7 @@ tableContainerCpt { addCallback
{ id: "picktermtype" { id: "picktermtype"
, className: "form-control custom-select" , className: "form-control custom-select"
, defaultValue: (maybe "" show termSizeFilter) , defaultValue: (maybe "" show termSizeFilter)
, on: {change: setTermSizeFilter <<< read <<< R.unsafeEventValue} , on: {change: changeTermSize params}
} }
(map optps1 termSizes) (map optps1 termSizes)
] ]
...@@ -355,6 +357,14 @@ tableContainerCpt { addCallback ...@@ -355,6 +357,14 @@ tableContainerCpt { addCallback
setTermSizeFilter x = T.modify (_ { termSizeFilter = x }) path setTermSizeFilter x = T.modify (_ { termSizeFilter = x }) path
setSelection term = dispatch $ setTermListSetA ngramsTableCache ngramsSelection term setSelection term = dispatch $ setTermListSetA ngramsTableCache ngramsSelection term
changeTermList params e = do
_ <- setTermListFilter $ read $ R.unsafeEventValue e
changePage 1 params
changeTermSize params e = do
_ <- setTermSizeFilter $ read $ R.unsafeEventValue e
changePage 1 params
selectionsExist :: Set NgramsTerm -> Boolean selectionsExist :: Set NgramsTerm -> Boolean
selectionsExist = not <<< Set.isEmpty selectionsExist = not <<< Set.isEmpty
......
...@@ -426,7 +426,8 @@ sizeDDCpt = here.component "sizeDD" cpt ...@@ -426,7 +426,8 @@ sizeDDCpt = here.component "sizeDD" cpt
className = "form-control" className = "form-control"
change e = do change e = do
let ps = string2PageSize $ R.unsafeEventValue e let ps = string2PageSize $ R.unsafeEventValue e
T.modify (\p -> stateParams $ (paramsState p) { pageSize = ps }) params _ <- T.modify (\p -> stateParams $ (paramsState p) { pageSize = ps }) params
changePage 1 params
sizes = map option pageSizes sizes = map option pageSizes
option size = H.option {value} [H.text value] option size = H.option {value} [H.text value]
where value = show size where value = show size
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment