Commit 81bcc365 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[FIX|REFACT] warnings + icons

parent d1b90d3f
......@@ -13,6 +13,7 @@ import Gargantext.Routes (SessionRoute(..))
import Gargantext.Routes as GR
import Gargantext.Sessions (Session, get, put, post, delete)
import Gargantext.Types as GT
import Gargantext.Components.Forest.Tree.Node (NodeAction(..), glyphiconNodeAction)
type Props =
( dispatch :: Action -> Aff Unit
......@@ -21,7 +22,7 @@ type Props =
, session :: Session
)
data Action = AddNode String GT.NodeType
data Action = AddNode String GT.NodeType
| DeleteNode
| UpdateNode GT.AsyncTaskWithType
| RenameNode String
......@@ -30,6 +31,7 @@ data Action = AddNode String GT.NodeType
| RefreshTree
| ShareNode String
instance showShow :: Show Action where
show DeleteNode = "DeleteNode"
show RefreshTree = "RefreshTree"
......@@ -42,19 +44,27 @@ instance showShow :: Show Action where
-----------------------------------------------------------------------
icon :: Action -> String
icon DeleteNode = "trash"
icon (AddNode _ _) = "plus"
icon _ = "hand-o-right"
icon (AddNode _ _) = glyphiconNodeAction (Add [])
icon DeleteNode = glyphiconNodeAction Delete
icon (UpdateNode _) = glyphiconNodeAction Refresh
icon (RenameNode _) = glyphiconNodeAction Config
icon (DoSearch _) = glyphiconNodeAction SearchBox
icon (UploadFile _ _ _ _) = glyphiconNodeAction Upload
icon RefreshTree = glyphiconNodeAction Refresh
icon (ShareNode _) = glyphiconNodeAction Share
-- icon _ = "hand-o-right"
text :: Action -> String
text DeleteNode = "Delete !"
text (AddNode _ _) = "Add !"
text (UpdateNode _) = "Update !"
text (RenameNode _) = "Rename !"
text (DoSearch _) = "Launch search !"
text DeleteNode = "Delete !"
text RefreshTree = "Refresh Tree !"
text (AddNode _ _ )= "Add !"
text (UpdateNode _ )= "Update !"
text (RenameNode _ )= "Rename !"
text (DoSearch _ )= "Launch search !"
text (ShareNode _ )= "Share !"
text (UploadFile _ _ _ _)= "Upload File !"
text RefreshTree = "Refresh Tree !"
text (ShareNode _) = "Share !"
-----------------------------------------------------------------------
-- TODO move code below elsewhere
......
......@@ -4,7 +4,6 @@ import Data.Argonaut (class EncodeJson, jsonEmptyObject, (:=), (~>))
import Data.Maybe (Maybe(..))
import Effect.Aff (Aff)
import Prelude (($))
import Reactix as R
import Gargantext.Components.Forest.Tree.Node.Action
import Gargantext.Types as GT
import Gargantext.Types (ID)
......
module Gargantext.Components.Forest.Tree.Node.Action.Update where
import Data.Array (length, head)
import Data.Argonaut (class DecodeJson, class EncodeJson, decodeJson, jsonEmptyObject, (.:), (:=), (~>))
import Data.Maybe (Maybe(..), fromMaybe)
-- import Data.Newtype (class Newtype)
import Data.Tuple.Nested ((/\))
import Effect.Aff (Aff, launchAff)
import Effect.Uncurried (mkEffectFn1)
import Gargantext.Components.Forest.Tree.Node.Action (Action(..))
import Gargantext.Components.Forest.Tree.Node (SettingsBox(..), settingsBox)
import Gargantext.Types (NodeType(..), readNodeType)
import Gargantext.Utils.Reactix as R2
import Gargantext.Sessions (Session, post)
import Gargantext.Routes as GR
import Data.Argonaut (class EncodeJson, jsonEmptyObject, (:=), (~>))
import Effect.Aff (Aff)
import Gargantext.Components.Forest.Tree.Node.Action (Action)
import Gargantext.Types (NodeType)
import Gargantext.Types as GT
import Prelude (Unit, bind, const, discard, map, pure, show, ($), (<>), (>), (<<<))
import Reactix as R
import Reactix.DOM.HTML as H
import Gargantext.Prelude (Unit)
{-
updateNode :: Session -> ID -> UpdateNodeParams -> Aff (Array ID)
......
......@@ -180,7 +180,7 @@ fldr nt open = if open
color FolderPublic = ""
color FolderShared = " text-warning"
color _ = " text-danger"
-}
-}
-- START node text
......
......@@ -7,7 +7,7 @@ import Effect.Uncurried (mkEffectFn1)
import Gargantext.Components.Forest.Tree.Node.Action
import Gargantext.Types (ID)
import Gargantext.Utils.Reactix as R2
import Gargantext.Prelude (Unit, bind, const, discard, identity, map, pure, show, unit, void, ($), (+), (<>), (==), (<<<))
import Gargantext.Prelude (Unit, bind, const, discard, pure, show, ($), (<<<), (<>))
import Reactix as R
import Reactix.DOM.HTML as H
......@@ -83,5 +83,3 @@ submitButton action dispatch =
]
]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment