Commit d576e672 authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

Merge branch 'dev' into feature/sigmax-graph-explorer

parents cf37cb01 afec4c08
......@@ -139,7 +139,8 @@ layoutDocview query tableParams@(params /\ _) p = R.createElement el p []
, if showSearch then searchBar query else H.div {} []
, H.div {className: "col-md-12"}
[ pageLoader tableParams {nodeId, totalRecords, tabType, listId, corpusId, query: fst query} ]
, H.div {className: "col-md-1 col-md-offset-11"}
{-, H.div {className: "col-md-1 col-md-offset-11"}
[ H.button { className: "btn"
, style: {backgroundColor: "peru", color : "white", border : "white"}
, onClick: onClickTrashAll nodeId
......@@ -148,6 +149,7 @@ layoutDocview query tableParams@(params /\ _) p = R.createElement el p []
, H.text "Trash all"
]
]
-}
]
]
......@@ -162,17 +164,16 @@ searchBar (query /\ setQuery) = R.createElement el {} []
queryText <- R.useState' query
pure $ H.div {className: "row"}
[ H.div {className: "col col-md-3 form-group"}
[ H.div {className: "col col-md-3"} []
, H.div {className: "col col-md-1"} [if query /= "" then clearButton else H.div {} []]
, H.div {className: "col col-md-3 form-group"}
[ H.input { type: "text"
, className: "form-control"
, on: {change: onSearchChange queryText, keyUp: onSearchKeyup queryText}
, placeholder: query
, defaultValue: query}
]
, H.div {className: "col col-md-1"}
[ searchButton queryText
, if query /= "" then clearButton else H.div {} []
]
, H.div {className: "col col-md-1"} [searchButton queryText]
]
onSearchChange :: forall e. R.State Query -> e -> Effect Unit
......@@ -265,8 +266,8 @@ renderPage (_ /\ setTableParams) p res = R.createElement el p []
, container: T.defaultContainer { title: "Documents" }
, colNames:
T.ColumnName <$>
[ "Map"
, "Stop"
[ "Favorites"
, "Trash"
, "Date"
, "Title"
, "Source"
......
......@@ -168,8 +168,9 @@ instance decodeResponse :: DecodeJson Response where
created <- obj .? "created"
hyperdata <- obj .? "hyperdata"
favorite <- obj .? "favorite"
ngramCount <- obj .? "ngramCount"
pure $ Response { id, created, hyperdata, category: decodeCategory favorite, ngramCount }
--ngramCount <- obj .? "ngramCount"
let ngramCount = 1
pure $ Response { id, created, hyperdata, category: decodeCategory favorite, ngramCount}
-- | Filter
-- TODO: unused
......
......@@ -39,7 +39,7 @@ instance encodeJsonDatabase :: EncodeJson Database where
allDatabases :: Array Database
allDatabases = [All, HAL, IsTex, PubMed]
allDatabases = [All, PubMed]
data SearchOrder
= DateAsc
......
......@@ -4,7 +4,7 @@ import Prelude hiding (div)
import DOM.Simple.Console (log2)
import Data.Argonaut (class DecodeJson, class EncodeJson, decodeJson, jsonEmptyObject, (.:), (:=), (~>))
import Data.Array (filter)
import Data.Array (filter, sortWith)
import Data.Generic.Rep (class Generic)
import Data.Generic.Rep.Eq (genericEq)
import Data.Generic.Rep.Show (genericShow)
......@@ -198,10 +198,13 @@ toHtml setReload setState@({tree: (NTree (LNode {id, name, nodeType}) ary)} /\ _
cpt props _ = do
folderOpen <- R.useState' true
let withId (NTree (LNode {id}) _) = id
pure $ H.ul {}
[ H.li {}
( [ nodeMainSpan pAction {id, name, nodeType, mCurrentRoute} folderOpen ]
<> childNodes setReload folderOpen mCurrentRoute ary
<> childNodes setReload folderOpen mCurrentRoute (sortWith withId ary)
)
]
......
......@@ -12,4 +12,6 @@ layout :: Spec {} {nodeId :: Int} Void
layout = R2.elSpec $ R.hooksComponent "CorpusLoader" cpt
where
cpt {nodeId} _children = do
pure $ H.div {} [H.text "Empty page"]
pure $ H.div {} [ H.h1 {} [H.text "Corpus Description"]
, H.p {} [H.text "Soon: corpus synthesis here (when all others charts/features will be stabilized)."]
]
......@@ -79,7 +79,7 @@ readTermList _ = Nothing
termLists :: Array { desc :: String, mval :: Maybe TermList }
termLists = [ { desc: "All terms", mval: Nothing }
, { desc: "Graph terms", mval: Just GraphTerm }
, { desc: "Map terms", mval: Just GraphTerm }
, { desc: "Stop terms", mval: Just StopTerm }
, { desc: "Candidate terms", mval: Just CandidateTerm }
]
......
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