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
1403e8a0
Commit
1403e8a0
authored
Oct 10, 2018
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Type] NodePoly escaping from Corpus.
parent
e68a4d62
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
48 deletions
+6
-48
Corpus.purs
src/Gargantext/Pages/Corpus.purs
+1
-33
Document.purs
src/Gargantext/Pages/Corpus/Document.purs
+5
-15
No files found.
src/Gargantext/Pages/Corpus.purs
View file @
1403e8a0
...
...
@@ -15,6 +15,7 @@ import Thermite ( Render, Spec, PerformAction, focus, hide
, defaultPerformAction, simpleSpec, modifyState)
--------------------------------------------------------
import Gargantext.Prelude
import Gargantext.Components.Node (NodePoly(..))
import Gargantext.Config (toUrl, NodeType(..), End(..))
import Gargantext.Config.REST (get)
---------------------------------------------------------
...
...
@@ -99,15 +100,6 @@ _tabAction = prism TabViewA \ action ->
_-> Left action
------------------------------------------------------------------------
newtype NodePoly a = NodePoly { id :: Int
, typename :: Int
, userId :: Int
, parentId :: Int
, name :: String
, date :: String
, hyperdata :: a
}
newtype CorpusInfo = CorpusInfo { title :: String
, desc :: String
, query :: String
...
...
@@ -141,30 +133,6 @@ instance decodeCorpusInfo :: DecodeJson CorpusInfo where
chart <- obj .? "chart"
pure $ CorpusInfo {title, desc, query, authors, chart}
instance decodeNode :: (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'
}
------------------------------------------------------------------------
layout :: Spec State {} Action
layout = corpusSpec <> facets
...
...
src/Gargantext/Pages/Corpus/Document.purs
View file @
1403e8a0
...
...
@@ -19,21 +19,16 @@ initialState =
inputValue : ""
}
data Action
=
ChangeString String
| Change
Another
String String
=
Load Int
| ChangeString String
| SetInput String
performAction :: PerformAction State {} Action
performAction (ChangeString ps) _ _ = pure unit
performAction (ChangeAnotherString ps) _ _ = pure unit
performAction (SetInput ps) _ _ = void do
modifyState $ _ { inputValue = ps }
performAction (Load n) _ _ = pure unit
performAction (SetInput ps) _ _ = void <$> modifyState $ _ { inputValue = ps }
docview :: Spec State {} Action
...
...
@@ -55,11 +50,6 @@ docview = simpleSpec performAction render
, onChange (\e -> dispatch (ChangeString $ (unsafeCoerce e).target.value))
] $ map optps aryPS
]
, div [ className "col-md-12 form-control input-group mb-3"]
[ select [ className "form-control custom-select"
, onChange (\e -> dispatch (ChangeAnotherString $ (unsafeCoerce e).target.value)) ]
$ map optps aryPS1
]
]
, div [className "row", style { marginTop : "35px"}]
[
...
...
@@ -158,7 +148,7 @@ docview = simpleSpec performAction render
]
aryPS :: Array String
aryPS = ["
STOPLIST", "MAINLIST", "MAPLIST
"]
aryPS = ["
Map", "Main", "Stop
"]
aryPS1 :: Array String
aryPS1 = ["Nothing Selected","STOPLIST", "MAINLIST", "MAPLIST"]
...
...
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