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