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
2ba91fc2
Commit
2ba91fc2
authored
Jun 10, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[REFACT] Forest.Tree.Action split delete
parent
2bd26184
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
10 deletions
+22
-10
Tree.purs
src/Gargantext/Components/Forest/Tree.purs
+2
-1
Action.purs
src/Gargantext/Components/Forest/Tree/Node/Action.purs
+5
-9
Delete.purs
...Gargantext/Components/Forest/Tree/Node/Action/Delete.purs
+15
-0
No files found.
src/Gargantext/Components/Forest/Tree.purs
View file @
2ba91fc2
...
...
@@ -9,9 +9,10 @@ import Data.Tuple.Nested ((/\))
import Effect.Aff (Aff)
import Effect.Class (liftEffect)
import Gargantext.AsyncTasks as GAT
import Gargantext.Components.Forest.Tree.Node.Action (Action(..)
,deleteNode
)
import Gargantext.Components.Forest.Tree.Node.Action (Action(..))
import Gargantext.Components.Forest.Tree.Node.Action.Add (AddNodeValue(..), addNode)
import Gargantext.Components.Forest.Tree.Node.Action.CopyFrom (loadNode)
import Gargantext.Components.Forest.Tree.Node.Action.Delete (deleteNode)
import Gargantext.Components.Forest.Tree.Node.Action.Rename (RenameValue(..), rename)
import Gargantext.Components.Forest.Tree.Node.Action.Share (ShareValue(..), share)
import Gargantext.Components.Forest.Tree.Node.Action.Upload (uploadFile)
...
...
src/Gargantext/Components/Forest/Tree/Node/Action.purs
View file @
2ba91fc2
...
...
@@ -31,8 +31,8 @@ data Action = AddNode String GT.NodeType
| ShareNode String
instance showShow :: Show Action where
show
DeleteNode
= "DeleteNode"
show
RefreshTree
= "RefreshTree"
show
DeleteNode
= "DeleteNode"
show
RefreshTree
= "RefreshTree"
show (ShareNode _) = "ShareNode"
show (UpdateNode _) = "UpdateNode"
show (RenameNode _) = "RenameNode"
...
...
@@ -42,9 +42,9 @@ instance showShow :: Show Action where
-----------------------------------------------------------------------
icon :: Action -> String
icon DeleteNode = "trash"
icon (AddNode _ _)
= "plus"
icon _ = "hand-o-right"
icon DeleteNode
= "trash"
icon (AddNode _ _) = "plus"
icon _
= "hand-o-right"
text :: Action -> String
text DeleteNode = "Delete !"
...
...
@@ -59,10 +59,6 @@ text (ShareNode _) = "Share !"
-- TODO move code below elsewhere
-- TODO Delete with asyncTaskWithType
deleteNode :: Session -> GT.ID -> Aff GT.ID
deleteNode session nodeId = delete session $ NodeAPI GT.Node (Just nodeId) ""
data FileType = CSV | CSV_HAL | WOS | PresseRIS
derive instance genericFileType :: Generic FileType _
...
...
src/Gargantext/Components/Forest/Tree/Node/Action/Delete.purs
0 → 100644
View file @
2ba91fc2
module Gargantext.Components.Forest.Tree.Node.Action.Delete
where
import Data.Maybe (Maybe(..))
import Gargantext.Prelude
import Effect.Aff (Aff)
import Gargantext.Types as GT
import Gargantext.Sessions (Session, delete)
import Gargantext.Routes (SessionRoute(..))
-- TODO Delete with asyncTaskWithType
deleteNode :: Session -> GT.ID -> Aff GT.ID
deleteNode session nodeId = delete session $ NodeAPI GT.Node (Just nodeId) ""
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