Commit 6d0e4a5e authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

[ngrams] add pagination links, set DESC score by default

parent dd7c94bd
...@@ -184,14 +184,26 @@ tableContainerCpt { dispatch ...@@ -184,14 +184,26 @@ tableContainerCpt { dispatch
] ]
] ]
, editor , editor
, selectButtons (selectionsExist ngramsSelection) , H.li {className: "list-group-item"} [
selectButtons (selectionsExist ngramsSelection)
]
, H.div {id: "terms_table", className: "panel-body"} , H.div {id: "terms_table", className: "panel-body"}
[ H.table {className: "table able"} [ H.table {className: "table able"}
[ H.thead {className: "tableHeader"} [props.tableHead] [ H.thead {className: "tableHeader"} [props.tableHead]
, H.tbody {} props.tableBody] , H.tbody {} props.tableBody
] ]
, selectButtons (selectionsExist ngramsSelection) , H.li {className: "list-group-item"} [
H.div { className: "row" } [
H.div { className: "col-md-4" } [
selectButtons (selectionsExist ngramsSelection)
]
, H.div { className: "col-md-4 col-md-offset-4" } [
props.paginationLinks
]
]
]
]
] ]
] ]
] ]
...@@ -224,7 +236,7 @@ tableContainerCpt { dispatch ...@@ -224,7 +236,7 @@ tableContainerCpt { dispatch
selectButtons false = H.div {} [] selectButtons false = H.div {} []
selectButtons true = selectButtons true =
H.li {className: " list-group-item"} [ H.div {} [
H.button { className: "btn btn-primary" H.button { className: "btn btn-primary"
, on: { click: const $ setSelection GraphTerm } , on: { click: const $ setSelection GraphTerm }
} [ H.text "Map" ] } [ H.text "Map" ]
...@@ -281,7 +293,7 @@ loadedNgramsTableCpt = R.hooksComponent "G.C.NT.loadedNgramsTable" cpt ...@@ -281,7 +293,7 @@ loadedNgramsTableCpt = R.hooksComponent "G.C.NT.loadedNgramsTable" cpt
, ngramsSelection , ngramsSelection
} }
} }
] ] <> resetSaveButtons
where where
autoUpdate :: Array R.Element autoUpdate :: Array R.Element
autoUpdate = if withAutoUpdate then [ R2.buff $ autoUpdateElt { duration: 5000, effect: performAction Synchronize } ] else [] autoUpdate = if withAutoUpdate then [ R2.buff $ autoUpdateElt { duration: 5000, effect: performAction Synchronize } ] else []
......
...@@ -76,7 +76,7 @@ import Data.Lens.Record (prop) ...@@ -76,7 +76,7 @@ import Data.Lens.Record (prop)
import Data.List ((:), List(Nil)) import Data.List ((:), List(Nil))
import Data.Map (Map) import Data.Map (Map)
import Data.Map as Map import Data.Map as Map
import Data.Maybe (Maybe(..), isNothing, maybe) import Data.Maybe (Maybe(..), maybe)
import Data.Newtype (class Newtype) import Data.Newtype (class Newtype)
import Data.Set (Set) import Data.Set (Set)
import Data.Set as Set import Data.Set as Set
...@@ -126,7 +126,7 @@ initialPageParams :: Session -> Int -> Array Int -> TabType -> PageParams ...@@ -126,7 +126,7 @@ initialPageParams :: Session -> Int -> Array Int -> TabType -> PageParams
initialPageParams session nodeId listIds tabType = initialPageParams session nodeId listIds tabType =
{ nodeId { nodeId
, listIds , listIds
, params: T.initialParams , params
, tabType , tabType
, termSizeFilter: Nothing , termSizeFilter: Nothing
, termListFilter: Just GraphTerm , termListFilter: Just GraphTerm
...@@ -134,6 +134,8 @@ initialPageParams session nodeId listIds tabType = ...@@ -134,6 +134,8 @@ initialPageParams session nodeId listIds tabType =
, scoreType: Occurrences , scoreType: Occurrences
, session , session
} }
where
params = T.initialParams { orderBy = Just (T.DESC $ T.ColumnName "Score") }
newtype NgramsTerm = NormNgramsTerm String newtype NgramsTerm = NormNgramsTerm String
......
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