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

[FEAT] Node Document view.

parent 1403e8a0
module Gargantext.Components.Node
where
import Gargantext.Prelude
import Data.Argonaut (class DecodeJson, decodeJson, (.?))
newtype NodePoly a =
NodePoly { id :: Int
, typename :: Int
, userId :: Int
, parentId :: Int
, name :: String
, date :: String
, hyperdata :: a
}
instance decodeNodePoly :: (DecodeJson a)
=> DecodeJson (NodePoly a) where
decodeJson json = do
obj <- decodeJson json
id <- obj .? "id"
typename <- obj .? "typename"
userId <- obj .? "userId"
parentId <- obj .? "parentId"
name <- obj .? "name"
date <- obj .? "date"
hyperdata <- obj .? "hyperdata"
hyperdata' <- decodeJson hyperdata
pure $ NodePoly { id : id
, typename : typename
, userId : userId
, parentId : parentId
, name : name
, date : date
, hyperdata: hyperdata'
}
...@@ -114,7 +114,7 @@ data NodeType = NodeUser ...@@ -114,7 +114,7 @@ data NodeType = NodeUser
| Corpus | Corpus
| CorpusV3 | CorpusV3
| Dashboard | Dashboard
| Document | Url_Document
| Error | Error
| Folder | Folder
| Graph | Graph
...@@ -136,7 +136,7 @@ urlConfig Children = show Children ...@@ -136,7 +136,7 @@ urlConfig Children = show Children
urlConfig Corpus = show Corpus urlConfig Corpus = show Corpus
urlConfig CorpusV3 = show CorpusV3 urlConfig CorpusV3 = show CorpusV3
urlConfig Dashboard = show Dashboard urlConfig Dashboard = show Dashboard
urlConfig Document = show Document urlConfig Url_Document = show Url_Document
urlConfig Error = show Error urlConfig Error = show Error
urlConfig Folder = show Folder urlConfig Folder = show Folder
urlConfig Graph = show Graph urlConfig Graph = show Graph
...@@ -151,7 +151,7 @@ instance showNodeType :: Show NodeType where ...@@ -151,7 +151,7 @@ instance showNodeType :: Show NodeType where
show Corpus = "corpus" show Corpus = "corpus"
show CorpusV3 = "corpus" show CorpusV3 = "corpus"
show Dashboard = "dashboard" show Dashboard = "dashboard"
show Document = "document" show Url_Document = "document"
show Error = "ErrorNodeType" show Error = "ErrorNodeType"
show Folder = "folder" show Folder = "folder"
show Graph = "graph" show Graph = "graph"
...@@ -166,7 +166,7 @@ readNodeType :: String -> NodeType ...@@ -166,7 +166,7 @@ readNodeType :: String -> NodeType
readNodeType "Annuaire" = Annuaire readNodeType "Annuaire" = Annuaire
readNodeType "Children" = Children readNodeType "Children" = Children
readNodeType "Dashboard" = Dashboard readNodeType "Dashboard" = Dashboard
readNodeType "Document" = Document readNodeType "Document" = Url_Document
readNodeType "Folder" = Folder readNodeType "Folder" = Folder
readNodeType "Graph" = Graph readNodeType "Graph" = Graph
readNodeType "Individu" = Individu readNodeType "Individu" = Individu
......
...@@ -215,4 +215,3 @@ sourcePageSpec = focus _sourcelens _sourceAction S.sourcespec' ...@@ -215,4 +215,3 @@ sourcePageSpec = focus _sourcelens _sourceAction S.sourcespec'
termsPageSpec :: Spec State {} Action termsPageSpec :: Spec State {} Action
termsPageSpec = focus _termslens _termsAction T.termSpec' termsPageSpec = focus _termslens _termsAction T.termSpec'
This diff is collapsed.
...@@ -266,7 +266,7 @@ showRow {row : (DocumentsView c), delete} = ...@@ -266,7 +266,7 @@ showRow {row : (DocumentsView c), delete} =
[ td [] [div [className $ fa <> "fa-star"][]] [ td [] [div [className $ fa <> "fa-star"][]]
-- TODO show date: Year-Month-Day only -- TODO show date: Year-Month-Day only
, td [] [text c.date] , td [] [text c.date]
, td [] [ a [ href (toUrl Front Document c._id) ] [ text c.title ] ] , td [] [ a [ href (toUrl Front Url_Document c._id) ] [ text c.title ] ]
, td [] [text c.source] , td [] [text c.source]
, td [] [input [ _type "checkbox"]] , td [] [input [ _type "checkbox"]]
] ]
......
...@@ -5,9 +5,9 @@ import Prelude hiding (div) ...@@ -5,9 +5,9 @@ import Prelude hiding (div)
import Gargantext.Pages.Layout.Actions (Action(..)) import Gargantext.Pages.Layout.Actions (Action(..))
import Gargantext.Pages.Layout.Specs.AddCorpus as AC import Gargantext.Pages.Layout.Specs.AddCorpus as AC
-- import Gargantext.Pages.Corpus.Tabs as TV -- import Gargantext.Pages.Corpus.Tabs as TV
-- import Gargantext.Pages.Corpus.Document as D
import Gargantext.Pages.Corpus as Corpus import Gargantext.Pages.Corpus as Corpus
import Gargantext.Pages.Corpus.Document as Document
import Gargantext.Pages.Corpus.Tabs.Documents as D import Gargantext.Pages.Corpus.Tabs.Documents as D
import Gargantext.Pages.Corpus.Graph as GE import Gargantext.Pages.Corpus.Graph as GE
-- import Gargantext.Pages.Corpus.Tabs.Terms.NgramsTable as NG -- import Gargantext.Pages.Corpus.Tabs.Terms.NgramsTable as NG
...@@ -57,9 +57,9 @@ dispatchAction dispatcher _ (Annuaire id) = do ...@@ -57,9 +57,9 @@ dispatchAction dispatcher _ (Annuaire id) = do
dispatchAction dispatcher _ (Folder id) = do dispatchAction dispatcher _ (Folder id) = do
dispatcher $ SetRoute $ Folder id dispatcher $ SetRoute $ Folder id
dispatchAction dispatcher _ (Document i) = do dispatchAction dispatcher _ (Document n) = do
dispatcher $ SetRoute $ Document i dispatcher $ SetRoute $ Document n
-- dispatcher $ DocumentViewA TODO dispatcher $ DocumentViewA $ Document.Load n
dispatchAction dispatcher _ PGraphExplorer = do dispatchAction dispatcher _ PGraphExplorer = do
dispatcher $ SetRoute PGraphExplorer dispatcher $ SetRoute PGraphExplorer
......
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