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
import Gargantext.Components.NgramsTable.SyncResetButton (syncResetButtons)
import Gargantext.Components.NgramsTable.Tree (renderNgramsItem, renderNgramsTree)
import Gargantext.Components.Nodes.Lists.Types as NT
import Gargantext.Components.Table (changePage)
import Gargantext.Components.Table as TT
import Gargantext.Components.Table.Types as TT
import Gargantext.Config.REST (AffRESTError, RESTError, logRESTError)
......@@ -155,6 +156,7 @@ tableContainerCpt { addCallback
, termSizeFilter
, params
} <- T.useLive T.unequal path
params <- T.useFocused (_.params) (\a b -> b { params = a }) path
-- | Computed
-- |
......@@ -218,7 +220,7 @@ tableContainerCpt { addCallback
{ id: "picklistmenu"
, className: "form-control custom-select"
, defaultValue: (maybe "" show termListFilter)
, on: {change: setTermListFilter <<< read <<< R.unsafeEventValue}
, on: {change: changeTermList params}
}
(map optps1 termLists)
]
......@@ -234,7 +236,7 @@ tableContainerCpt { addCallback
{ id: "picktermtype"
, className: "form-control custom-select"
, defaultValue: (maybe "" show termSizeFilter)
, on: {change: setTermSizeFilter <<< read <<< R.unsafeEventValue}
, on: {change: changeTermSize params}
}
(map optps1 termSizes)
]
......@@ -355,6 +357,14 @@ tableContainerCpt { addCallback
setTermSizeFilter x = T.modify (_ { termSizeFilter = x }) path
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 = not <<< Set.isEmpty
......
......@@ -426,7 +426,8 @@ sizeDDCpt = here.component "sizeDD" cpt
className = "form-control"
change e = do
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
option size = H.option {value} [H.text value]
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