Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
148
Issues
148
List
Board
Labels
Milestones
Merge Requests
10
Merge Requests
10
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
haskell-gargantext
Commits
81caa483
Commit
81caa483
authored
Oct 02, 2018
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[API][DB] Tree NodeTree: done.
parent
fbc34579
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
5 deletions
+14
-5
Node.hs
src/Gargantext/API/Node.hs
+2
-1
Config.hs
src/Gargantext/Database/Config.hs
+12
-4
No files found.
src/Gargantext/API/Node.hs
View file @
81caa483
...
...
@@ -44,6 +44,7 @@ import Gargantext.Database.Node ( getNodesWithParentId
,
deleteNode
,
deleteNodes
)
import
Gargantext.Database.Facet
(
FacetDoc
,
getDocFacet
,
FacetChart
)
import
Gargantext.Database.Tree
(
treeDB
)
-- Graph
import
Gargantext.TextFlow
...
...
@@ -116,7 +117,7 @@ graphAPI _ _ = liftIO $ textFlow (Mono EN) (Contexts contextText)
type
TreeAPI
=
Get
'[
J
SON
]
(
Tree
NodeTree
)
treeAPI
::
Connection
->
NodeId
->
Server
TreeAPI
treeAPI
_
_
=
undefined
treeAPI
c
n
=
liftIO
$
treeDB
c
n
nodeAPI
::
Connection
->
NodeId
->
Server
NodeAPI
...
...
src/Gargantext/Database/Config.hs
View file @
81caa483
...
...
@@ -19,7 +19,9 @@ Gargantext's database.
module
Gargantext.Database.Config
where
import
Data.Text
(
pack
)
import
Data.Tuple.Extra
(
swap
)
import
Data.Maybe
(
fromMaybe
)
import
Data.List
(
lookup
)
...
...
@@ -28,9 +30,13 @@ import Gargantext.Prelude
-- | Nodes are typed in the database according to a specific ID
--
nodeTypeInv
::
[(
NodeTypeId
,
NodeType
)]
nodeTypeInv
=
map
swap
nodeTypes
nodeTypes
::
[(
NodeType
,
NodeTypeId
)]
nodeTypes
=
[
(
NodeUser
,
1
)
,
(
Folder
,
2
)
,
(
NodeCorpus
,
3
)
,
(
NodeCorpus
,
30
)
,
(
Annuaire
,
31
)
,
(
Document
,
4
)
...
...
@@ -65,4 +71,6 @@ nodeTypeId tn = fromMaybe (panic $ pack $ "Typename " <> show tn <> " does not e
(
lookup
tn
nodeTypes
)
typeId2node
::
NodeTypeId
->
NodeType
typeId2node
tId
=
fromMaybe
(
panic
$
pack
$
"Type Id "
<>
show
tId
<>
" does not exist"
)
(
lookup
tId
nodeTypeInv
)
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