Commit bcd18e87 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[NGRAMSTABLE] WIP fix default behavior.

parent eef156fc
......@@ -343,7 +343,7 @@ loadPage session {nodeId, tabType, query, listId, corpusId, params: {limit, offs
let docs = res2corpus <$> res.docs
pure $
if mock then
Tuple 4737 (take limit $ drop offset sampleData)
Tuple 0 (take limit $ drop offset sampleData)
else
Tuple res.count docs
where
......
......@@ -167,7 +167,10 @@ tableContainer { path: {searchQuery, termListFilter, termSizeFilter} /\ setPath
, H.div {} (
if A.null props.tableBody && searchQuery /= "" then [
H.button { className: "btn btn-primary"
, on: {click: const $ dispatch $ addNewNgramA $ normNgram tabNgramType searchQuery}
, on: {click: const $ dispatch
$ addNewNgramA
$ normNgram tabNgramType searchQuery
}
}
[ H.text ("Add " <> searchQuery) ]
] else [])]
......@@ -336,7 +339,7 @@ loadedNgramsTableSpec = Thermite.simpleSpec performAction render
}
]
where
totalRecords = 47361 -- TODO
totalRecords = 0 -- TODO, 0 to show first users that it is fake (until it is fixed)
colNames = T.ColumnName <$> ["Select", "Map", "Stop", "Terms", "Score"] -- see convOrderBy
selected =
input
......@@ -365,7 +368,12 @@ loadedNgramsTableSpec = Thermite.simpleSpec performAction render
ngramsParentRoot :: Maybe NgramsTerm
ngramsParentRoot =
(\np -> ngramsTable ^? at np <<< _Just <<< _NgramsElement <<< _root <<< _Just) =<< ngramsParent
(\np -> ngramsTable ^? at np
<<< _Just
<<< _NgramsElement
<<< _root
<<< _Just
) =<< ngramsParent
displayRow (NgramsElement {ngrams, root}) =
root == Nothing
......
......@@ -79,7 +79,7 @@ type TableHeaderLayoutProps =
)
initialParams :: Params
initialParams = stateParams {page: 1, pageSize: PS10, orderBy: Nothing}
initialParams = stateParams {page: 1, pageSize: PS10, orderBy: Just (DESC $ ColumnName "Score")}
-- TODO: Not sure this is the right place for this
tableHeaderLayout :: Record TableHeaderLayoutProps -> R.Element
......
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