Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
purescript-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Grégoire Locqueville
purescript-gargantext
Commits
1f4462b0
Commit
1f4462b0
authored
Nov 22, 2019
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Graph][FacetsTable] add authors to table & fix other table columns
parent
a8ce0a41
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
22 deletions
+25
-22
FacetsTable.purs
src/Gargantext/Components/FacetsTable.purs
+25
-22
No files found.
src/Gargantext/Components/FacetsTable.purs
View file @
1f4462b0
...
...
@@ -83,6 +83,7 @@ newtype DocumentsView =
, date :: String
, title :: String
, source :: String
, authors :: String
, score :: Int
, pairs :: Array Pair
, delete :: Boolean
...
...
@@ -106,8 +107,9 @@ newtype Response = Response
}
newtype Hyperdata = Hyperdata
{ title :: String
, source :: String
{ authors :: String
, title :: String
, source :: String
}
--instance decodeHyperdata :: DecodeJson Hyperdata where
...
...
@@ -127,9 +129,10 @@ instance decodePair :: DecodeJson Pair where
instance decodeHyperdata :: DecodeJson Hyperdata where
decodeJson json = do
obj <- decodeJson json
authors <- obj .| "authors"
title <- obj .| "title"
source <- obj .| "source"
pure $ Hyperdata { title,source }
pure $ Hyperdata {
authors,
title,source }
{-
instance decodeResponse :: DecodeJson Response where
...
...
@@ -239,8 +242,8 @@ loadPage {session, nodeId, listId, query, params: {limit, offset, orderBy}} = do
where
res2corpus :: Response -> DocumentsView
res2corpus (Response { id, created: date, ngramCount: score, category
, hyperdata: Hyperdata {title, source} }) =
DocumentsView { id, date, title, source, score, category, pairs: [], delete: false }
, hyperdata: Hyperdata {
authors,
title, source} }) =
DocumentsView { id, date, title, source, score,
authors,
category, pairs: [], delete: false }
convOrderBy (T.ASC (T.ColumnName "Date")) = DateAsc
convOrderBy (T.DESC (T.ColumnName "Date")) = DateDesc
convOrderBy (T.ASC (T.ColumnName "Title")) = TitleAsc
...
...
@@ -293,24 +296,24 @@ pageCpt = R.staticComponent "G.C.FacetsTable.Page" cpt
| otherwise = H.text label
comma = H.span {} [ H.text ", " ]
rows = row <$> filter (not <<< isDeleted) documents
row dv@(DocumentsView {id,score,title,source,date, authors,pairs,delete,category}) =
{ row:
[ H.a { className: gi category, on: {click: markClick} } []
-- TODO show date: Year-Month-Day only
, maybeStricken delete [ H.text date ]
, maybeStricken delete [ H.text title ]
, maybeStricken delete [ H.text source ]
, maybeStricken delete [ H.text authors ]
-- , maybeStricken $ intercalate [comma] (pairUrl <$> pairs)
, H.input { type: "checkbox", checked: isChecked id, on: { click: toggleClick } }
]
, delete: true }
where
row (DocumentsView {id,score,title,source,date,pairs,delete,category}) =
{ row:
[ H.a { className, on: {click: markClick} } []
-- TODO show date: Year-Month-Day only
, maybeStricken [ H.text date ]
, maybeStricken [ H.text source ]
-- , maybeStricken $ intercalate [comma] (pairUrl <$> pairs)
, H.input { type: "checkbox", checked: isChecked id, on: { click: toggleClick } }
]
, delete: true }
where
markClick _ = markCategory session nodeId category [id]
toggleClick _ = togglePendingDeletion deletions id
className = gi category
maybeStricken
| delete = H.div { style: { textDecoration: "line-through" } }
| otherwise = H.div {}
markClick _ = markCategory session nodeId category [id]
toggleClick _ = togglePendingDeletion deletions id
maybeStricken delete
| delete = H.div { style: { textDecoration: "line-through" } }
| otherwise = H.div {}
---------------------------------------------------------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment