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
142
Issues
142
List
Board
Labels
Milestones
Merge Requests
7
Merge Requests
7
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
gargantext
purescript-gargantext
Commits
cc142357
Commit
cc142357
authored
Jun 26, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DESIGN/ERGO/METHODO] improving test workflow for user: color code for Status of node functions
parent
e224f744
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
16 deletions
+41
-16
Box.purs
src/Gargantext/Components/Forest/Tree/Node/Box.purs
+20
-11
Settings.purs
src/Gargantext/Components/Forest/Tree/Node/Settings.purs
+0
-5
Status.purs
src/Gargantext/Components/Forest/Tree/Node/Status.purs
+21
-0
No files found.
src/Gargantext/Components/Forest/Tree/Node/Box.purs
View file @
cc142357
...
@@ -26,6 +26,7 @@ import Gargantext.Components.Forest.Tree.Node.Action.Link (linkNode)
...
@@ -26,6 +26,7 @@ import Gargantext.Components.Forest.Tree.Node.Action.Link (linkNode)
import Gargantext.Components.Forest.Tree.Node.Action.Merge (mergeNode)
import Gargantext.Components.Forest.Tree.Node.Action.Merge (mergeNode)
import Gargantext.Components.Forest.Tree.Node.Box.Types (NodePopupProps, NodePopupS)
import Gargantext.Components.Forest.Tree.Node.Box.Types (NodePopupProps, NodePopupS)
import Gargantext.Components.Forest.Tree.Node.Settings (NodeAction(..), SettingsBox(..), glyphiconNodeAction, settingsBox)
import Gargantext.Components.Forest.Tree.Node.Settings (NodeAction(..), SettingsBox(..), glyphiconNodeAction, settingsBox)
import Gargantext.Components.Forest.Tree.Node.Status (Status(..), hasStatus)
import Gargantext.Components.Forest.Tree.Node.Tools (textInputBox, fragmentPT)
import Gargantext.Components.Forest.Tree.Node.Tools (textInputBox, fragmentPT)
import Gargantext.Sessions (Session)
import Gargantext.Sessions (Session)
import Gargantext.Types (Name, ID)
import Gargantext.Types (Name, ID)
...
@@ -42,15 +43,6 @@ type CommonProps =
...
@@ -42,15 +43,6 @@ type CommonProps =
-- | START Popup View
-- | START Popup View
iconAStyle :: { color :: String
, paddingTop :: String
, paddingBottom :: String
}
iconAStyle = { color : "black"
, paddingTop : "6px"
, paddingBottom : "6px"
}
nodePopupView :: Record NodePopupProps -> R.Element
nodePopupView :: Record NodePopupProps -> R.Element
nodePopupView p = R.createElement nodePopupCpt p []
nodePopupView p = R.createElement nodePopupCpt p []
...
@@ -150,11 +142,13 @@ nodePopupCpt = R.hooksComponent "G.C.F.T.N.B.nodePopupView" cpt
...
@@ -150,11 +142,13 @@ nodePopupCpt = R.hooksComponent "G.C.F.T.N.B.nodePopupView" cpt
, H.div { className: "flex-center"}
, H.div { className: "flex-center"}
[ buttonClick { action: doc
[ buttonClick { action: doc
, state: nodePopupState
, state: nodePopupState
, nodeType
}
}
]
]
, H.div {className: "flex-center"}
, H.div {className: "flex-center"}
$ map (\t -> buttonClick { action: t
$ map (\t -> buttonClick { action: t
, state : nodePopupState
, state : nodePopupState
, nodeType
}
}
) buttons
) buttons
]
]
...
@@ -189,6 +183,7 @@ type ActionState =
...
@@ -189,6 +183,7 @@ type ActionState =
type ButtonClickProps =
type ButtonClickProps =
( action :: NodeAction
( action :: NodeAction
, state :: R.State (Record ActionState)
, state :: R.State (Record ActionState)
, nodeType :: GT.NodeType
)
)
buttonClick :: Record ButtonClickProps -> R.Element
buttonClick :: Record ButtonClickProps -> R.Element
...
@@ -197,9 +192,9 @@ buttonClick p = R.createElement buttonClickCpt p []
...
@@ -197,9 +192,9 @@ buttonClick p = R.createElement buttonClickCpt p []
buttonClickCpt :: R.Component ButtonClickProps
buttonClickCpt :: R.Component ButtonClickProps
buttonClickCpt = R.hooksComponent "G.C.F.T.N.B.buttonClick" cpt
buttonClickCpt = R.hooksComponent "G.C.F.T.N.B.buttonClick" cpt
where
where
cpt {action: todo, state: (node@{action} /\ setNodePopup)} _ = do
cpt {action: todo, state: (node@{action} /\ setNodePopup)
, nodeType
} _ = do
pure $ H.div {className: "col-md-1"}
pure $ H.div {className: "col-md-1"}
[ H.a { style:
iconAStyle
[ H.a { style:
(iconAStyle nodeType todo)
, className: glyphiconActive (glyphiconNodeAction todo)
, className: glyphiconActive (glyphiconNodeAction todo)
(action == (Just todo) )
(action == (Just todo) )
, id: show todo
, id: show todo
...
@@ -219,6 +214,20 @@ buttonClickCpt = R.hooksComponent "G.C.F.T.N.B.buttonClick" cpt
...
@@ -219,6 +214,20 @@ buttonClickCpt = R.hooksComponent "G.C.F.T.N.B.buttonClick" cpt
doToDo = setNodePopup
doToDo = setNodePopup
$ const (node { action = action' })
$ const (node { action = action' })
iconAStyle :: GT.NodeType -> NodeAction -> { color :: String
, paddingTop :: String
, paddingBottom :: String
}
iconAStyle n a = { color : hasColor (hasStatus n a)
, paddingTop : "6px"
, paddingBottom : "6px"
}
where
hasColor :: Status -> String
hasColor Prod = "black"
hasColor Test = "orange"
hasColor WIP = "red"
-- END Popup View
-- END Popup View
type NodeProps =
type NodeProps =
...
...
src/Gargantext/Components/Forest/Tree/Node/Settings.purs
View file @
cc142357
...
@@ -14,10 +14,6 @@ import Gargantext.Types
...
@@ -14,10 +14,6 @@ import Gargantext.Types
if user has access to node then he can do all his related actions
if user has access to node then he can do all his related actions
-}
-}
------------------------------------------------------------------------
------------------------------------------------------------------------
------------------------------------------------------------------------
-- Beta Status
data Status a = TODO a | WIP a | OnTest a | Beta a
data NodeAction = Documentation NodeType
data NodeAction = Documentation NodeType
| SearchBox
| SearchBox
| Download | Upload | Refresh | Config
| Download | Upload | Refresh | Config
...
@@ -28,7 +24,6 @@ data NodeAction = Documentation NodeType
...
@@ -28,7 +24,6 @@ data NodeAction = Documentation NodeType
| Move { subTreeParams :: SubTreeParams }
| Move { subTreeParams :: SubTreeParams }
| Link { subTreeParams :: SubTreeParams }
| Link { subTreeParams :: SubTreeParams }
| Clone
| Clone
------------------------------------------------------------------------
------------------------------------------------------------------------
-- TODO move elsewhere
-- TODO move elsewhere
data SubTreeParams = SubTreeParams { showtypes :: Array NodeType
data SubTreeParams = SubTreeParams { showtypes :: Array NodeType
...
...
src/Gargantext/Components/Forest/Tree/Node/Status.purs
0 → 100644
View file @
cc142357
module Gargantext.Components.Forest.Tree.Node.Status where
import Data.Generic.Rep (class Generic)
import Data.Generic.Rep.Show (genericShow)
import Data.Generic.Rep.Eq (genericEq)
import Gargantext.Prelude (class Eq, class Show, show, (&&), (<>), (==))
import Data.Array (foldl)
import Gargantext.Types
import Gargantext.Components.Forest.Tree.Node.Settings (NodeAction(..))
------------------------------------------------------------------------
------------------------------------------------------------------------
------------------------------------------------------------------------
-- Beta Status
data Status = Prod | Test | WIP
hasStatus :: NodeType -> NodeAction -> Status
hasStatus _ SearchBox = WIP
hasStatus _ (Documentation _) = Test
hasStatus _ _ = Prod
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