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
195
Issues
195
List
Board
Labels
Milestones
Merge Requests
12
Merge Requests
12
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
565c8b01
Commit
565c8b01
authored
Jul 16, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[REFACT] lightning the code
parent
28993230
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
52 deletions
+7
-52
Node.hs
src/Gargantext/Database/Action/Node.hs
+2
-52
Error.hs
src/Gargantext/Database/Query/Table/Node/Error.hs
+5
-0
No files found.
src/Gargantext/Database/Action/Node.hs
View file @
565c8b01
...
@@ -27,7 +27,6 @@ import Gargantext.Database.Prelude (Cmd)
...
@@ -27,7 +27,6 @@ import Gargantext.Database.Prelude (Cmd)
import
Gargantext.Database.Query.Table.Node
import
Gargantext.Database.Query.Table.Node
import
Gargantext.Database.Query.Table.Node.Error
import
Gargantext.Database.Query.Table.Node.Error
import
Gargantext.Database.Query.Table.Node.UpdateOpaleye
(
updateHyperdata
)
import
Gargantext.Database.Query.Table.Node.UpdateOpaleye
(
updateHyperdata
)
import
Gargantext.Viz.Graph
(
defaultHyperdataGraph
)
import
Gargantext.Prelude
import
Gargantext.Prelude
import
Gargantext.Prelude.Utils
(
sha
)
import
Gargantext.Prelude.Utils
(
sha
)
import
Gargantext.Database.Prelude
import
Gargantext.Database.Prelude
...
@@ -50,63 +49,14 @@ mkNodeWithParent NodeUser Nothing uId name =
...
@@ -50,63 +49,14 @@ mkNodeWithParent NodeUser Nothing uId name =
mkNodeWithParent
_
Nothing
_
_
=
nodeError
HasParent
mkNodeWithParent
_
Nothing
_
_
=
nodeError
HasParent
------------------------------------------------------------------------
------------------------------------------------------------------------
mkNodeWithParent
NodeFolder
(
Just
i
)
uId
name
=
insertNodesWithParentR
(
Just
i
)
[
node
NodeFolder
name
hd
Nothing
uId
]
where
hd
=
defaultHyperdataFolder
mkNodeWithParent
NodeFolderPrivate
(
Just
i
)
uId
_
=
insertNodesWithParentR
(
Just
i
)
[
node
NodeFolderPrivate
"Private"
hd
Nothing
uId
]
where
hd
=
defaultHyperdataFolder
mkNodeWithParent
NodeFolderShared
(
Just
i
)
uId
_
=
insertNodesWithParentR
(
Just
i
)
[
node
NodeFolderShared
"Shared"
hd
Nothing
uId
]
where
hd
=
defaultHyperdataFolder
mkNodeWithParent
NodeFolderPublic
(
Just
i
)
uId
_
=
insertNodesWithParentR
(
Just
i
)
[
node
NodeFolderPublic
"Public"
hd
Nothing
uId
]
where
hd
=
defaultHyperdataFolder
mkNodeWithParent
NodeTeam
(
Just
i
)
uId
name
=
insertNodesWithParentR
(
Just
i
)
[
node
NodeTeam
name
hd
Nothing
uId
]
where
hd
=
defaultHyperdataFolder
------------------------------------------------------------------------
mkNodeWithParent
NodeCorpus
(
Just
i
)
uId
name
=
insertNodesWithParentR
(
Just
i
)
[
node
NodeCorpus
name
hd
Nothing
uId
]
where
hd
=
defaultHyperdataCorpus
mkNodeWithParent
NodeAnnuaire
(
Just
i
)
uId
name
=
insertNodesWithParentR
(
Just
i
)
[
node
NodeAnnuaire
name
hd
Nothing
uId
]
where
hd
=
defaultHyperdataAnnuaire
mkNodeWithParent
NodeList
(
Just
i
)
uId
name
=
insertNodesWithParentR
(
Just
i
)
[
node
NodeList
name
hd
Nothing
uId
]
where
hd
=
defaultHyperdataAnnuaire
mkNodeWithParent
NodeGraph
(
Just
i
)
uId
name
=
insertNodesWithParentR
(
Just
i
)
[
node
NodeGraph
name
hd
Nothing
uId
]
where
hd
=
defaultHyperdataGraph
mkNodeWithParent
NodeFrameWrite
i
u
n
=
mkNodeWithParent
NodeFrameWrite
i
u
n
=
mkNodeWithParent_ConfigureHyperdata
NodeFrameWrite
i
u
n
mkNodeWithParent_ConfigureHyperdata
NodeFrameWrite
i
u
n
mkNodeWithParent
NodeFrameCalc
i
u
n
=
mkNodeWithParent
NodeFrameCalc
i
u
n
=
mkNodeWithParent_ConfigureHyperdata
NodeFrameCalc
i
u
n
mkNodeWithParent_ConfigureHyperdata
NodeFrameCalc
i
u
n
{-
mkNodeWithParent
nt
(
Just
pId
)
uId
name
=
insertNode
nt
(
Just
name
)
Nothing
pId
uId
mkNodeWithParent n (Just i) uId name =
-- mkNodeWithParent _ _ _ _ = errorMsg "[G.D.A.Node.mkNodeWithParent] nees parent"
insertNodesWithParentR (Just i) [node NodeDashboard name (hasDefaultData n) Nothing uId]
-}
mkNodeWithParent
_
_
_
_
=
nodeError
NotImplYet
-- | Sugar to create a node, get his NodeId and update his Hyperdata after
-- | Sugar to create a node, get his NodeId and update his Hyperdata after
...
...
src/Gargantext/Database/Query/Table/Node/Error.hs
View file @
565c8b01
...
@@ -63,6 +63,11 @@ instance Show NodeError
...
@@ -63,6 +63,11 @@ instance Show NodeError
class
HasNodeError
e
where
class
HasNodeError
e
where
_NodeError
::
Prism'
e
NodeError
_NodeError
::
Prism'
e
NodeError
errorMsg
::
(
MonadError
e
m
,
HasNodeError
e
)
=>
Text
->
m
a
errorMsg
=
msg
msg
::
(
MonadError
e
m
msg
::
(
MonadError
e
m
,
HasNodeError
e
)
,
HasNodeError
e
)
=>
Text
->
m
a
=>
Text
->
m
a
...
...
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