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
3df5b689
Commit
3df5b689
authored
Jan 27, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[TREE] Refresh (WIP)
parent
99ca6f6e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
5 deletions
+13
-5
Forest.purs
src/Gargantext/Components/Forest.purs
+10
-3
Tree.purs
src/Gargantext/Components/Forest/Tree.purs
+1
-0
Upload.purs
...Gargantext/Components/Forest/Tree/Node/Action/Upload.purs
+2
-2
No files found.
src/Gargantext/Components/Forest.purs
View file @
3df5b689
...
...
@@ -31,13 +31,20 @@ forestCpt :: R.Component Props
forestCpt = R.hooksComponent "G.C.Forest.forest" cpt where
cpt {frontends, route, sessions, showLogin } _ = do
openNodes <- R2.useLocalStorageState R2.openNodesKey (Set.empty :: Set TreeId)
R2.useCache (frontends /\ route /\ sessions /\ fst openNodes) (cpt' openNodes showLogin)
cpt' openNodes showLogin (frontends /\ route /\ sessions /\ openNodesState) = do
reload <- R.useState' (0 :: Int)
R2.useCache (frontends /\ route /\ sessions /\ fst openNodes) (cpt' reload openNodes showLogin)
cpt' reload openNodes showLogin (frontends /\ route /\ sessions /\ openNodesState) = do
pure $ R.fragment $ A.cons (plus showLogin) trees
where
trees = tree <$> unSessions sessions
tree s@(Session {treeId}) =
treeView { root: treeId, frontends, mCurrentRoute: Just route, session: s, openNodes }
treeView { root: treeId
, frontends
, mCurrentRoute: Just route
, session: s
, openNodes
, reload
}
plus :: R2.Setter Boolean -> R.Element
plus showLogin =
...
...
src/Gargantext/Components/Forest/Tree.purs
View file @
3df5b689
...
...
@@ -29,6 +29,7 @@ type Props = ( root :: ID
, session :: Session
, frontends :: Frontends
, openNodes :: R.State (Set TreeId)
, reload :: R.State Int
)
treeView :: Record Props -> R.Element
...
...
src/Gargantext/Components/Forest/Tree/Node/Action/Upload.purs
View file @
3df5b689
...
...
@@ -44,7 +44,7 @@ uploadFileViewCpt d = R.hooksComponent "UploadFileView" cpt
[ R2.select {className: "col-md-12 form-control"
, on: {change: onChangeFileType fileType}
}
(map renderOption [CSV,
PresseRIS
])
(map renderOption [CSV,
CSV_HAL
])
]
, H.div {}
[ uploadButton d id mContents fileType ]
...
...
@@ -127,7 +127,7 @@ fileTypeView d p (Just (DroppedFile {contents, fileType}) /\ setDroppedFile) (_
[ R2.select {className: "col-md-12 form-control"
, on: {change: onChange}
}
(map renderOption [CSV,
PresseRIS
])
(map renderOption [CSV,
CSV_HAL
])
]
where
onChange e =
...
...
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