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
b0f85b12
Verified
Commit
b0f85b12
authored
Apr 17, 2024
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[graphql] breadcrumb: remove dead code, use node_id for argument
parent
524d698e
Pipeline
#5951
passed with stages
in 92 minutes and 48 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
24 deletions
+7
-24
Node.hs
src/Gargantext/API/GraphQL/Node.hs
+5
-12
TreeFirstLevel.hs
src/Gargantext/API/GraphQL/TreeFirstLevel.hs
+2
-2
Node.hs
src/Gargantext/Database/Query/Table/Node.hs
+0
-10
No files found.
src/Gargantext/API/GraphQL/Node.hs
View file @
b0f85b12
...
...
@@ -123,19 +123,12 @@ dbParentNodes node_id parentType = do
node
<-
lift
$
getNode
id
pure
[
toNode
node
]
dbChildNodes
::
(
CmdCommon
env
)
=>
Int
->
NodeType
->
GqlM
e
env
[
Node
]
dbChildNodes
::
(
CmdCommon
env
)
=>
Int
->
NodeType
->
GqlM
e
env
[
Node
]
dbChildNodes
node_id
childType
=
do
-- let mChildType = readEither (T.unpack child_type) :: Either Prelude.String NodeType
-- case mChildType of
-- Left err -> do
-- lift $ printDebug "[dbChildNodes] error reading parent type" (T.pack err)
-- pure []
-- Right childType -> do
childIds
<-
lift
$
getClosestChildrenByType
(
NN
.
UnsafeMkNodeId
node_id
)
childType
-- (fromNodeTypeId parent_type_id)
children
<-
lift
$
mapM
getNode
childIds
pure
$
toNode
<$>
children
childIds
<-
lift
$
getClosestChildrenByType
(
NN
.
UnsafeMkNodeId
node_id
)
childType
-- (fromNodeTypeId parent_type_id)
children
<-
lift
$
mapM
getNode
childIds
pure
$
toNode
<$>
children
toNode
::
NN
.
Node
json
->
Node
toNode
N
.
Node
{
..
}
=
Node
{
id
=
nid
...
...
src/Gargantext/API/GraphQL/TreeFirstLevel.hs
View file @
b0f85b12
...
...
@@ -55,7 +55,7 @@ data TreeFirstLevel m = TreeFirstLevel
data
BreadcrumbArgs
=
BreadcrumbArgs
{
node
I
d
::
Int
node
_i
d
::
Int
}
deriving
(
Generic
,
GQLType
)
data
BreadcrumbInfo
=
BreadcrumbInfo
...
...
@@ -118,7 +118,7 @@ nodeToTreeNode N.Node {..} =
Nothing
resolveBreadcrumb
::
(
CmdCommon
env
)
=>
BreadcrumbArgs
->
GqlM
e
env
BreadcrumbInfo
resolveBreadcrumb
BreadcrumbArgs
{
node
Id
}
=
dbRecursiveParents
nodeI
d
resolveBreadcrumb
BreadcrumbArgs
{
node
_id
}
=
dbRecursiveParents
node_i
d
convertDbTreeToTreeNode
::
HasCallStack
=>
T
.
DbTreeNode
->
TreeNode
convertDbTreeToTreeNode
T
.
DbTreeNode
{
_dt_name
,
_dt_nodeId
,
_dt_typeId
,
_dt_parentId
}
=
...
...
src/Gargantext/Database/Query/Table/Node.hs
View file @
b0f85b12
...
...
@@ -176,16 +176,6 @@ getChildrenByType nId nType = do
childrenFirstLevel
<-
getClosestChildrenByType
nId
nType
childrenLst
<-
mapM
(
\
id
->
getChildrenByType
id
nType
)
childrenFirstLevel
pure
$
childrenFirstLevel
++
concat
childrenLst
-- result <- runPGSQuery query (PGS.Only nId)
-- children_lst <- mapM (\(id, _) -> getChildrenByType id nType) result
-- pure $ concat $ [fst <$> filter (\(_, pTypename) -> pTypename == toDBid nType) result] ++ children_lst
-- where
-- query :: PGS.Query
-- query = [sql|
-- SELECT n.id, n.typename
-- FROM nodes n
-- WHERE n.parent_id = ?;
-- |]
-- | Given a node id, find all it's children (only first level) of
-- given node type.
...
...
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