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
208bdfdf
Commit
208bdfdf
authored
May 09, 2022
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/382-dev-plane-navigation' into dev-merge
parents
36df4cc8
38615b10
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
129 additions
and
87 deletions
+129
-87
FolderView.purs
src/Gargantext/Components/FolderView.purs
+101
-75
GraphQL.purs
src/Gargantext/Components/GraphQL.purs
+1
-0
Endpoints.purs
src/Gargantext/Components/GraphQL/Endpoints.purs
+10
-1
Tree.purs
src/Gargantext/Components/GraphQL/Tree.purs
+4
-0
Corpus.purs
src/Gargantext/Components/Nodes/Corpus.purs
+13
-11
No files found.
src/Gargantext/Components/FolderView.purs
View file @
208bdfdf
This diff is collapsed.
Click to expand it.
src/Gargantext/Components/GraphQL.purs
View file @
208bdfdf
...
...
@@ -71,6 +71,7 @@ queryGql session name q = do
-- Schema
type Schema
= { imt_schools :: {} ==> Array GQLIMT.School
, nodes :: { node_id :: Int } ==> Array Node
, node_parent :: { node_id :: Int, parent_type :: String } ==> Array Node -- TODO: parent_type :: NodeType
, user_infos :: { user_id :: Int } ==> Array UserInfo
, users :: { user_id :: Int } ==> Array User
...
...
src/Gargantext/Components/GraphQL/Endpoints.purs
View file @
208bdfdf
...
...
@@ -2,7 +2,7 @@ module Gargantext.Components.GraphQL.Endpoints where
import Gargantext.Prelude
import Gargantext.Components.GraphQL.Node (Node, nodeParentQuery)
import Gargantext.Components.GraphQL.Node (Node, nodeParentQuery
, nodesQuery
)
import Gargantext.Components.GraphQL.Tree (TreeFirstLevel, treeFirstLevelQuery)
import Gargantext.Components.GraphQL.User (UserInfo, userInfoQuery)
...
...
@@ -30,6 +30,15 @@ getIMTSchools session = do
liftEffect $ here.log2 "[getIMTSchools] imt_schools" imt_schools
pure $ Right imt_schools
getNode :: Session -> Int -> AffRESTError Node
getNode session nodeId = do
{ nodes } <- queryGql session "get nodes" $
nodesQuery `withVars` { id: nodeId }
liftEffect $ here.log2 "[getNode] node" nodes
pure $ case A.head nodes of
Nothing -> Left (CustomError $ "node with id" <> show nodeId <>" not found")
Just node -> Right node
getNodeParent :: Session -> Int -> NodeType -> Aff (Array Node)
getNodeParent session nodeId parentType = do
{ node_parent } <- queryGql session "get node parent" $
...
...
src/Gargantext/Components/GraphQL/Tree.purs
View file @
208bdfdf
...
...
@@ -11,6 +11,7 @@ type TreeNode =
{ name :: String
, id :: Int
, node_type :: NodeType
, parent_id :: Maybe Int
}
type TreeFirstLevel =
{ root :: TreeNode
...
...
@@ -22,14 +23,17 @@ treeFirstLevelQuery = { tree: { root_id: Var :: _ "id" Int} =>>
{ root: { name: unit
, node_type: unit
, id: unit
, parent_id: unit
}
, children: { name: unit
, node_type: unit
, id: unit
, parent_id: unit
}
, parent: { name: unit
, node_type: unit
, id: unit
, parent_id: unit
}
}
}
src/Gargantext/Components/Nodes/Corpus.purs
View file @
208bdfdf
...
...
@@ -68,20 +68,22 @@ corpusLayoutMainCpt = here.component "corpusLayoutMain" cpt
pure $ GR.CorpusCode (sessionId session) nodeId
-- Render
pure $
H.div {}
[
tileMenu
{ boxes
, currentTile: Just corpusCodeRoute
, xTile: Just corpusCodeRoute
, yTile: Just corpusCodeRoute
}
[
H.button
{ className: "btn btn-primary" }
R2.row [
FV.backButtonSmart { nodeId, session } []
, tileMenu
{ boxes
, currentTile: Just corpusCodeRoute
, xTile: Just corpusCodeRoute
, yTile: Just corpusCodeRoute
}
[
H.i { className: "fa fa-code" } []
H.button
{ className: "btn btn-primary" }
[
H.i { className: "fa fa-code" } []
]
]
]
,
...
...
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