Commit 0bf8fdc8 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[DESIGN] icons bootstrap -> fork awesome

parent 88290311
...@@ -20,7 +20,7 @@ import Gargantext.Components.Forest.Tree.Node.Action (Action(..),deleteNode) ...@@ -20,7 +20,7 @@ import Gargantext.Components.Forest.Tree.Node.Action (Action(..),deleteNode)
import Gargantext.Components.Forest.Tree.Node.Action.CopyFrom (loadNode) import Gargantext.Components.Forest.Tree.Node.Action.CopyFrom (loadNode)
import Gargantext.Components.Forest.Tree.Node.Action.Add (AddNodeValue(..), addNode) import Gargantext.Components.Forest.Tree.Node.Action.Add (AddNodeValue(..), addNode)
import Gargantext.Components.Forest.Tree.Node.Action.Upload (uploadFile) import Gargantext.Components.Forest.Tree.Node.Action.Upload (uploadFile)
import Gargantext.Components.Forest.Tree.Node.Action.Rename (RenameValue(..), renameNode) import Gargantext.Components.Forest.Tree.Node.Action.Rename (RenameValue(..), rename)
import Gargantext.Components.Forest.Tree.Node.Box (nodeMainSpan, Tasks, tasksStruct) import Gargantext.Components.Forest.Tree.Node.Box (nodeMainSpan, Tasks, tasksStruct)
import Gargantext.Components.Forest.Tree.Node.FTree (FTree, LNode(..), NTree(..), Tree) import Gargantext.Components.Forest.Tree.Node.FTree (FTree, LNode(..), NTree(..), Tree)
import Gargantext.Ends (Frontends) import Gargantext.Ends (Frontends)
...@@ -205,7 +205,7 @@ performAction { reload: (_ /\ setReload) ...@@ -205,7 +205,7 @@ performAction { reload: (_ /\ setReload)
performAction p@{ reload: (_ /\ setReload) performAction p@{ reload: (_ /\ setReload)
, session , session
, tree: (NTree (LNode {id}) _) } (RenameNode name) = do , tree: (NTree (LNode {id}) _) } (RenameNode name) = do
void $ renameNode session id $ RenameValue {text:name} void $ rename session id $ RenameValue {text:name}
performAction p RefreshTree performAction p RefreshTree
performAction p@{ openNodes: (_ /\ setOpenNodes) performAction p@{ openNodes: (_ /\ setOpenNodes)
......
...@@ -61,16 +61,17 @@ instance showNodeAction :: Show NodeAction where ...@@ -61,16 +61,17 @@ instance showNodeAction :: Show NodeAction where
glyphiconNodeAction :: NodeAction -> String glyphiconNodeAction :: NodeAction -> String
glyphiconNodeAction (Documentation _) = "question-sign" glyphiconNodeAction (Documentation _) = "question-circle"
glyphiconNodeAction Delete = "trash" glyphiconNodeAction Delete = "trash"
glyphiconNodeAction (Add _) = "plus" glyphiconNodeAction (Add _) = "plus"
glyphiconNodeAction SearchBox = "search" glyphiconNodeAction SearchBox = "search"
glyphiconNodeAction Upload = "upload" glyphiconNodeAction Upload = "upload"
glyphiconNodeAction (Link _) = "transfer" glyphiconNodeAction (Link _) = "arrows-h"
glyphiconNodeAction Download = "download" glyphiconNodeAction Download = "download"
glyphiconNodeAction CopyFromCorpus = "random" glyphiconNodeAction CopyFromCorpus = "random"
glyphiconNodeAction Refresh = "refresh" glyphiconNodeAction Refresh = "refresh"
glyphiconNodeAction Config = "wrench" glyphiconNodeAction Config = "wrench"
glyphiconNodeAction Share = "user-plus"
glyphiconNodeAction _ = "" glyphiconNodeAction _ = ""
...@@ -110,6 +111,7 @@ settingsBox Team = SettingsBox { ...@@ -110,6 +111,7 @@ settingsBox Team = SettingsBox {
, Folder , Folder
, Annuaire , Annuaire
] ]
, Share
, Delete] , Delete]
} }
...@@ -155,7 +157,6 @@ settingsBox Corpus = ...@@ -155,7 +157,6 @@ settingsBox Corpus =
] ]
, Upload , Upload
, Download , Download
--, Share
--, Move --, Move
--, Clone --, Clone
, Link Annuaire , Link Annuaire
......
...@@ -17,10 +17,15 @@ import Gargantext.Utils.Reactix as R2 ...@@ -17,10 +17,15 @@ import Gargantext.Utils.Reactix as R2
import Gargantext.Sessions (Session, get, put, post, delete) import Gargantext.Sessions (Session, get, put, post, delete)
renameNode :: Session -> ID -> RenameValue -> Aff (Array ID) ------------------------------------------------------------------------
renameNode session renameNodeId = rename :: Session -> ID -> RenameValue -> Aff (Array ID)
rename session renameNodeId =
put session $ GR.NodeAPI GT.Node (Just renameNodeId) "rename" put session $ GR.NodeAPI GT.Node (Just renameNodeId) "rename"
renameAction :: String -> Action
renameAction newName = RenameNode newName
------------------------------------------------------------------------
newtype RenameValue = RenameValue newtype RenameValue = RenameValue
{ text :: String } { text :: String }
...@@ -29,7 +34,7 @@ instance encodeJsonRenameValue :: EncodeJson RenameValue where ...@@ -29,7 +34,7 @@ instance encodeJsonRenameValue :: EncodeJson RenameValue where
= "r_name" := text = "r_name" := text
~> jsonEmptyObject ~> jsonEmptyObject
------------------------------------------------------------------------
-- | START Rename Box -- | START Rename Box
type TextInputBoxProps = type TextInputBoxProps =
( id :: ID ( id :: ID
...@@ -37,14 +42,11 @@ type TextInputBoxProps = ...@@ -37,14 +42,11 @@ type TextInputBoxProps =
, text :: String , text :: String
, isOpen :: R.State Boolean , isOpen :: R.State Boolean
, boxName :: String , boxName :: String
, textAction :: String -> Action , boxAction :: String -> Action
) )
renameAction :: String -> Action
renameAction newName = RenameNode newName
textInputBox :: Record TextInputBoxProps -> R.Element textInputBox :: Record TextInputBoxProps -> R.Element
textInputBox p@{ boxName, textAction, dispatch, isOpen: (true /\ setIsOpen) } = R.createElement el p [] textInputBox p@{ boxName, boxAction, dispatch, isOpen: (true /\ setIsOpen) } = R.createElement el p []
where where
el = R.hooksComponent (boxName <> "Box") cpt el = R.hooksComponent (boxName <> "Box") cpt
cpt {id, text} _ = do cpt {id, text} _ = do
...@@ -71,7 +73,7 @@ textInputBox p@{ boxName, textAction, dispatch, isOpen: (true /\ setIsOpen) } = ...@@ -71,7 +73,7 @@ textInputBox p@{ boxName, textAction, dispatch, isOpen: (true /\ setIsOpen) } =
, type: "button" , type: "button"
, onClick: mkEffectFn1 $ \_ -> do , onClick: mkEffectFn1 $ \_ -> do
setIsOpen $ const false setIsOpen $ const false
launchAff $ dispatch ( textAction newName ) launchAff $ dispatch ( boxAction newName )
, title: "Submit" , title: "Submit"
} [] } []
cancelBtn = cancelBtn =
...@@ -85,5 +87,5 @@ textInputBox p@{ boxName, isOpen: (false /\ _) } = R.createElement el p [] ...@@ -85,5 +87,5 @@ textInputBox p@{ boxName, isOpen: (false /\ _) } = R.createElement el p []
el = R.hooksComponent (boxName <> "Box") cpt el = R.hooksComponent (boxName <> "Box") cpt
cpt {text} _ = pure $ H.div {} [] cpt {text} _ = pure $ H.div {} []
-- END Rename Box -- | END Rename Box
...@@ -443,13 +443,13 @@ nodePopupCpt = R.hooksComponent "G.C.F.T.N.B.nodePopupView" cpt ...@@ -443,13 +443,13 @@ nodePopupCpt = R.hooksComponent "G.C.F.T.N.B.nodePopupView" cpt
H.div {className: "panel-heading"} H.div {className: "panel-heading"}
[ R2.row [ R2.row
[ H.div {className: "col-md-8"} [ H.div {className: "col-md-8"}
[ textInputBox { textAction: renameAction, boxName: "Rename", dispatch, id, text:name, isOpen } ] [ textInputBox { boxAction: renameAction, boxName: "Rename", dispatch, id, text:name, isOpen } ]
, H.div {className: "flex-end"} , H.div {className: "flex-end"}
[ if edit then editIcon isOpen else H.div {} [] [ if edit then editIcon isOpen else H.div {} []
, H.div {className: "col-md-1"} , H.div {className: "col-md-1"}
[ H.a { "type" : "button" [ H.a { "type" : "button"
, className: glyphicon "remove-circle" , className: glyphicon "window-close"
, on: { click: \e -> p.onPopoverClose $ R2.unsafeEventTarget e } , on: { click: \e -> p.onPopoverClose $ R2.unsafeEventTarget e }
, title : "Close"} [] , title : "Close"} []
] ]
......
...@@ -63,7 +63,7 @@ modalCpt = R.hooksComponent "G.C.Login.modal" cpt where ...@@ -63,7 +63,7 @@ modalCpt = R.hooksComponent "G.C.Login.modal" cpt where
[ H.h2 {className: "text-primary center m-a-2"} [ H.h2 {className: "text-primary center m-a-2"}
[ [
-- H.i {className: "material-icons md-36"} [ H.text "control_point" ] -- H.i {className: "material-icons md-36"} [ H.text "control_point" ]
H.span {className: "icon-text"} [ H.text "Gargantext" ] ] ] H.span {className: "icon-text"} [ H.text "GarganText" ] ] ]
closing = H.button { "type": "button", className: "close" closing = H.button { "type": "button", className: "close"
, "data": { dismiss: "modal" } } , "data": { dismiss: "modal" } }
......
...@@ -53,7 +53,7 @@ _unit :: forall s. Lens' s Unit ...@@ -53,7 +53,7 @@ _unit :: forall s. Lens' s Unit
_unit = lens (\_ -> unit) (\s _ -> s) _unit = lens (\_ -> unit) (\s _ -> s)
glyphicon :: String -> String glyphicon :: String -> String
glyphicon t = "btn glyphitem glyphicon glyphicon-" <> t glyphicon t = "btn glyphitem fa fa-" <> t
glyphiconActive :: String -> Boolean -> String glyphiconActive :: String -> Boolean -> String
glyphiconActive icon b = glyphicon icon <> if b then " active" else "" glyphiconActive icon b = glyphicon icon <> if b then " active" else ""
......
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