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)
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.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.FTree (FTree, LNode(..), NTree(..), Tree)
import Gargantext.Ends (Frontends)
......@@ -205,7 +205,7 @@ performAction { reload: (_ /\ setReload)
performAction p@{ reload: (_ /\ setReload)
, session
, 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@{ openNodes: (_ /\ setOpenNodes)
......
......@@ -61,16 +61,17 @@ instance showNodeAction :: Show NodeAction where
glyphiconNodeAction :: NodeAction -> String
glyphiconNodeAction (Documentation _) = "question-sign"
glyphiconNodeAction (Documentation _) = "question-circle"
glyphiconNodeAction Delete = "trash"
glyphiconNodeAction (Add _) = "plus"
glyphiconNodeAction SearchBox = "search"
glyphiconNodeAction Upload = "upload"
glyphiconNodeAction (Link _) = "transfer"
glyphiconNodeAction (Link _) = "arrows-h"
glyphiconNodeAction Download = "download"
glyphiconNodeAction CopyFromCorpus = "random"
glyphiconNodeAction Refresh = "refresh"
glyphiconNodeAction Config = "wrench"
glyphiconNodeAction Share = "user-plus"
glyphiconNodeAction _ = ""
......@@ -110,6 +111,7 @@ settingsBox Team = SettingsBox {
, Folder
, Annuaire
]
, Share
, Delete]
}
......@@ -155,7 +157,6 @@ settingsBox Corpus =
]
, Upload
, Download
--, Share
--, Move
--, Clone
, Link Annuaire
......
......@@ -17,10 +17,15 @@ import Gargantext.Utils.Reactix as R2
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"
renameAction :: String -> Action
renameAction newName = RenameNode newName
------------------------------------------------------------------------
newtype RenameValue = RenameValue
{ text :: String }
......@@ -29,7 +34,7 @@ instance encodeJsonRenameValue :: EncodeJson RenameValue where
= "r_name" := text
~> jsonEmptyObject
------------------------------------------------------------------------
-- | START Rename Box
type TextInputBoxProps =
( id :: ID
......@@ -37,14 +42,11 @@ type TextInputBoxProps =
, text :: String
, isOpen :: R.State Boolean
, boxName :: String
, textAction :: String -> Action
, boxAction :: String -> Action
)
renameAction :: String -> Action
renameAction newName = RenameNode newName
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
el = R.hooksComponent (boxName <> "Box") cpt
cpt {id, text} _ = do
......@@ -71,7 +73,7 @@ textInputBox p@{ boxName, textAction, dispatch, isOpen: (true /\ setIsOpen) } =
, type: "button"
, onClick: mkEffectFn1 $ \_ -> do
setIsOpen $ const false
launchAff $ dispatch ( textAction newName )
launchAff $ dispatch ( boxAction newName )
, title: "Submit"
} []
cancelBtn =
......@@ -85,5 +87,5 @@ textInputBox p@{ boxName, isOpen: (false /\ _) } = R.createElement el p []
el = R.hooksComponent (boxName <> "Box") cpt
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
H.div {className: "panel-heading"}
[ R2.row
[ 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"}
[ if edit then editIcon isOpen else H.div {} []
, H.div {className: "col-md-1"}
[ H.a { "type" : "button"
, className: glyphicon "remove-circle"
, className: glyphicon "window-close"
, on: { click: \e -> p.onPopoverClose $ R2.unsafeEventTarget e }
, title : "Close"} []
]
......
......@@ -63,7 +63,7 @@ modalCpt = R.hooksComponent "G.C.Login.modal" cpt where
[ H.h2 {className: "text-primary center m-a-2"}
[
-- 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"
, "data": { dismiss: "modal" } }
......
......@@ -53,7 +53,7 @@ _unit :: forall s. Lens' s Unit
_unit = lens (\_ -> unit) (\s _ -> s)
glyphicon :: String -> String
glyphicon t = "btn glyphitem glyphicon glyphicon-" <> t
glyphicon t = "btn glyphitem fa fa-" <> t
glyphiconActive :: String -> Boolean -> String
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