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
142
Issues
142
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
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
gargantext
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
Show 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
...
@@ -15,6 +15,7 @@ import Thermite ( Render, Spec, PerformAction, focus, hide
, defaultPerformAction, simpleSpec, modifyState)
, defaultPerformAction, simpleSpec, modifyState)
--------------------------------------------------------
--------------------------------------------------------
import Gargantext.Prelude
import Gargantext.Prelude
import Gargantext.Components.Node (NodePoly(..))
import Gargantext.Config (toUrl, NodeType(..), End(..))
import Gargantext.Config (toUrl, NodeType(..), End(..))
import Gargantext.Config.REST (get)
import Gargantext.Config.REST (get)
---------------------------------------------------------
---------------------------------------------------------
...
@@ -99,15 +100,6 @@ _tabAction = prism TabViewA \ action ->
...
@@ -99,15 +100,6 @@ _tabAction = prism TabViewA \ action ->
_-> Left 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
newtype CorpusInfo = CorpusInfo { title :: String
, desc :: String
, desc :: String
, query :: String
, query :: String
...
@@ -141,30 +133,6 @@ instance decodeCorpusInfo :: DecodeJson CorpusInfo where
...
@@ -141,30 +133,6 @@ instance decodeCorpusInfo :: DecodeJson CorpusInfo where
chart <- obj .? "chart"
chart <- obj .? "chart"
pure $ CorpusInfo {title, desc, query, authors, 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 :: Spec State {} Action
layout = corpusSpec <> facets
layout = corpusSpec <> facets
...
...
src/Gargantext/Pages/Corpus/Document.purs
View file @
1403e8a0
...
@@ -19,21 +19,16 @@ initialState =
...
@@ -19,21 +19,16 @@ initialState =
inputValue : ""
inputValue : ""
}
}
data Action
data Action
=
ChangeString String
=
Load Int
| Change
Another
String String
| ChangeString String
| SetInput String
| SetInput String
performAction :: PerformAction State {} Action
performAction :: PerformAction State {} Action
performAction (ChangeString ps) _ _ = pure unit
performAction (ChangeString ps) _ _ = pure unit
performAction (Load n) _ _ = pure unit
performAction (ChangeAnotherString ps) _ _ = pure unit
performAction (SetInput ps) _ _ = void <$> modifyState $ _ { inputValue = ps }
performAction (SetInput ps) _ _ = void do
modifyState $ _ { inputValue = ps }
docview :: Spec State {} Action
docview :: Spec State {} Action
...
@@ -55,11 +50,6 @@ docview = simpleSpec performAction render
...
@@ -55,11 +50,6 @@ docview = simpleSpec performAction render
, onChange (\e -> dispatch (ChangeString $ (unsafeCoerce e).target.value))
, onChange (\e -> dispatch (ChangeString $ (unsafeCoerce e).target.value))
] $ map optps aryPS
] $ 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"}]
, div [className "row", style { marginTop : "35px"}]
[
[
...
@@ -158,7 +148,7 @@ docview = simpleSpec performAction render
...
@@ -158,7 +148,7 @@ docview = simpleSpec performAction render
]
]
aryPS :: Array String
aryPS :: Array String
aryPS = ["
STOPLIST", "MAINLIST", "MAPLIST
"]
aryPS = ["
Map", "Main", "Stop
"]
aryPS1 :: Array String
aryPS1 :: Array String
aryPS1 = ["Nothing Selected","STOPLIST", "MAINLIST", "MAPLIST"]
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