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