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
131
Issues
131
List
Board
Labels
Milestones
Merge Requests
3
Merge Requests
3
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
7f062bd6
Commit
7f062bd6
authored
Dec 03, 2020
by
Alexandre Delanoë
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIXME] Proposed default Name should be prettyNodeType instead
parent
36ba9be3
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
13 deletions
+22
-13
Add.purs
src/Gargantext/Components/Forest/Tree/Node/Action/Add.purs
+4
-4
Box.purs
src/Gargantext/Components/Forest/Tree/Node/Box.purs
+2
-2
Tools.purs
src/Gargantext/Components/Forest/Tree/Node/Tools.purs
+1
-6
Prelude.purs
src/Gargantext/Prelude.purs
+2
-1
Types.purs
src/Gargantext/Types.purs
+13
-0
No files found.
src/Gargantext/Components/Forest/Tree/Node/Action/Add.purs
View file @
7f062bd6
...
...
@@ -69,7 +69,7 @@ addNodeView p@{ dispatch, nodeType, nodeTypes } = R.createElement el p []
nodeName@(name' /\ setNodeName) <- R.useState' "Name"
nodeType'@(nt /\ setNodeType) <- R.useState' $ fromMaybe Folder $ head nodeTypes
let
let
SettingsBox {edit} = settingsBox nt
(maybeChoose /\ nt') = if length nodeTypes > 1
then ([ formChoiceSafe nodeTypes Error setNodeType ] /\ nt)
...
...
@@ -77,7 +77,7 @@ addNodeView p@{ dispatch, nodeType, nodeTypes } = R.createElement el p []
<> show defaultNt
<> " with name:"
]
] /\ defaultNt
] /\ defaultNt
)
where
defaultNt = (fromMaybe Error $ head nodeTypes)
...
...
@@ -87,8 +87,8 @@ addNodeView p@{ dispatch, nodeType, nodeTypes } = R.createElement el p []
, onValueChanged: \val -> setNodeName $ const val
, autoFocus: true
, className: "form-control"
, defaultValue: name'
, placeholder: name'
, defaultValue: name'
-- (prettyNodeType nt')
, placeholder: name'
-- (prettyNodeType nt')
, type: "text"
}
else H.div {} []
...
...
src/Gargantext/Components/Forest/Tree/Node/Box.purs
View file @
7f062bd6
...
...
@@ -28,9 +28,9 @@ 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.Settings (NodeAction(..), SettingsBox(..), glyphiconNodeAction, settingsBox)
import Gargantext.Components.Forest.Tree.Node.Status (Status(..), hasStatus)
import Gargantext.Components.Forest.Tree.Node.Tools (textInputBox, fragmentPT
, prettyNodeType
)
import Gargantext.Components.Forest.Tree.Node.Tools (textInputBox, fragmentPT)
import Gargantext.Sessions (Session)
import Gargantext.Types (Name, ID)
import Gargantext.Types (Name, ID
, prettyNodeType
)
import Gargantext.Types as GT
import Gargantext.Utils (glyphicon, glyphiconActive)
import Gargantext.Utils.Reactix as R2
...
...
src/Gargantext/Components/Forest/Tree/Node/Tools.purs
View file @
7f062bd6
...
...
@@ -262,11 +262,6 @@ checkboxes xs (val /\ set) =
) xs
prettyNodeType :: GT.NodeType -> String
prettyNodeType nt = S.replace (S.Pattern "Node") (S.Replacement " ")
$ S.replace (S.Pattern "Folder") (S.Replacement " ")
$ show nt
-- START node link
type NodeLinkProps = (
...
...
@@ -310,7 +305,7 @@ nodeLinkCpt = R.hooksComponentWithModule thisModule "nodeLink" cpt
]
, ReactTooltip.reactTooltip { id: tooltipId }
[ R2.row [ H.h4 {className: GT.fldr nodeType true}
[ H.text $ prettyNodeType nodeType ]
[ H.text $
GT.
prettyNodeType nodeType ]
]
, R2.row [ H.span {} [ H.text $ name ]]
]
...
...
src/Gargantext/Prelude.purs
View file @
7f062bd6
...
...
@@ -8,7 +8,6 @@ import Effect.Class (class MonadEffect, liftEffect)
import Effect.Exception (catchException, throwException)
import Effect.Unsafe (unsafePerformEffect)
-- | JL: Astonishingly, not in the prelude
-- AD: recent Preludes in Haskell much prefer identity
-- then id can be used as a variable name (in records for instance)
...
...
@@ -35,3 +34,5 @@ logExceptions message f x =
logs e
throwException e) do
pure $ f x
src/Gargantext/Types.purs
View file @
7f062bd6
...
...
@@ -4,6 +4,7 @@ import Data.Argonaut (class DecodeJson, class EncodeJson, decodeJson, encodeJson
import Data.Argonaut.Decode.Error (JsonDecodeError(..))
import Data.Array as A
import Data.Either (Either(..))
import Data.String as S
import Data.Generic.Rep (class Generic)
import Data.Generic.Rep.Eq (genericEq)
import Data.Generic.Rep.Ord (genericCompare)
...
...
@@ -743,3 +744,15 @@ progressPercent (AsyncProgress {log}) = perc
where
nom = toNumber $ failed + succeeded
denom = toNumber $ failed + succeeded + remaining
---------------------------------------------------------------------------
-- | GarganText Internal Sugar
prettyNodeType :: NodeType -> String
prettyNodeType nt = S.replace (S.Pattern "Node") (S.Replacement " ")
$ S.replace (S.Pattern "Folder") (S.Replacement " ")
$ show nt
delanoe
@anoe
mentioned in issue
#239 (closed)
·
Dec 03, 2020
mentioned in issue
#239 (closed)
mentioned in issue #239
Toggle commit list
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