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
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
Grégoire Locqueville
purescript-gargantext
Commits
58c85c17
Commit
58c85c17
authored
Nov 22, 2019
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FOREST] fix warnings.
parent
d15f7da9
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
69 additions
and
89 deletions
+69
-89
Node.purs
src/Gargantext/Components/Forest/Tree/Node.purs
+36
-33
Action.purs
src/Gargantext/Components/Forest/Tree/Node/Action.purs
+5
-7
Add.purs
src/Gargantext/Components/Forest/Tree/Node/Action/Add.purs
+11
-35
Rename.purs
...Gargantext/Components/Forest/Tree/Node/Action/Rename.purs
+4
-3
Upload.purs
...Gargantext/Components/Forest/Tree/Node/Action/Upload.purs
+7
-8
Box.purs
src/Gargantext/Components/Forest/Tree/Node/Box.purs
+6
-3
No files found.
src/Gargantext/Components/Forest/Tree/Node.purs
View file @
58c85c17
...
@@ -71,6 +71,7 @@ glyphiconNodeAction _ = ""
...
@@ -71,6 +71,7 @@ glyphiconNodeAction _ = ""
data SettingsBox =
data SettingsBox =
SettingsBox { show :: Boolean
SettingsBox { show :: Boolean
, edit :: Boolean
, edit :: Boolean
, doc :: NodeAction
, buttons :: Array NodeAction
, buttons :: Array NodeAction
}
}
------------------------------------------------------------------------
------------------------------------------------------------------------
...
@@ -78,8 +79,8 @@ data SettingsBox =
...
@@ -78,8 +79,8 @@ data SettingsBox =
settingsBox :: NodeType -> SettingsBox
settingsBox :: NodeType -> SettingsBox
settingsBox NodeUser = SettingsBox { show : true
settingsBox NodeUser = SettingsBox { show : true
, edit : false
, edit : false
,
buttons : [
Documentation NodeUser
,
doc :
Documentation NodeUser
,
SearchBox
, buttons : [
SearchBox
, Add [ FolderPrivate
, Add [ FolderPrivate
, FolderShared
, FolderShared
, FolderPublic
, FolderPublic
...
@@ -90,8 +91,8 @@ settingsBox NodeUser = SettingsBox { show : true
...
@@ -90,8 +91,8 @@ settingsBox NodeUser = SettingsBox { show : true
settingsBox FolderPrivate = SettingsBox { show: true
settingsBox FolderPrivate = SettingsBox { show: true
, edit : false
, edit : false
,
buttons : [
Documentation FolderPrivate
,
doc :
Documentation FolderPrivate
,
SearchBox
, buttons : [
SearchBox
, Add [ Corpus
, Add [ Corpus
, Folder
, Folder
, Annuaire
, Annuaire
...
@@ -100,40 +101,40 @@ settingsBox FolderPrivate = SettingsBox { show: true
...
@@ -100,40 +101,40 @@ settingsBox FolderPrivate = SettingsBox { show: true
}
}
settingsBox Team = SettingsBox { show: true
settingsBox Team = SettingsBox { show: true
, edit : false
, edit : false
, buttons : [
Documentation Team
, doc :
Documentation Team
,
SearchBox
, buttons : [
SearchBox
, Add [ Corpus
, Add [ Corpus
, Folder
, Folder
, Annuaire
, Annuaire
]
]
, Delete]
, Delete]
}
}
settingsBox FolderShared = SettingsBox { show: true
settingsBox FolderShared = SettingsBox { show: true
, edit : true
, edit : true
,
buttons : [
Documentation FolderShared
,
doc :
Documentation FolderShared
,
Add [Team, FolderShared]
, buttons : [
Add [Team, FolderShared]
, Delete
, Delete
]
]
}
}
settingsBox FolderPublic = SettingsBox { show: true
settingsBox FolderPublic = SettingsBox { show
: true
, edit : false
, edit : false
,
buttons : [
Documentation FolderPublic
,
doc :
Documentation FolderPublic
{-, SearchBox
, buttons : [
{-, SearchBox
, Add [ Corpus
, Add [ Corpus
, Folder
, Folder
]-}
]-}
,
Delete
Delete
]
]
}
}
settingsBox Folder = SettingsBox { show : true
settingsBox Folder = SettingsBox { show : true
, edit : true
, edit : true
,
buttons : [
Documentation Folder
,
doc :
Documentation Folder
,
SearchBox
, buttons : [
SearchBox
, Add [ Corpus
, Add [ Corpus
, Folder
, Folder
, Annuaire
, Annuaire
...
@@ -144,32 +145,33 @@ settingsBox Folder = SettingsBox { show : true
...
@@ -144,32 +145,33 @@ settingsBox Folder = SettingsBox { show : true
settingsBox Corpus = SettingsBox { show : true
settingsBox Corpus = SettingsBox { show : true
, edit : true
, edit : true
,
buttons : [
Documentation Corpus
,
doc :
Documentation Corpus
,
SearchBox
, buttons : [
SearchBox
, Add [ NodeList
, Add [ NodeList
, Graph
, Graph
, Dashboard
, Dashboard
]
]
, Link Annuaire
, Upload
, Upload
, Download
, Download
--, Share
--, Share
--, Move
--, Move
--, Clone
--, Clone
, Link Annuaire
, Delete
, Delete
]
]
}
}
settingsBox Texts = SettingsBox { show : true
settingsBox Texts = SettingsBox { show : true
, edit : false
, edit : false
,
buttons : [
Documentation Texts
,
doc :
Documentation Texts
,
Upload
, buttons : [
Upload
, Download
, Download
]
]
}
}
settingsBox Graph = SettingsBox { show : true
settingsBox Graph = SettingsBox { show : true
, edit : false
, edit : false
, doc : Documentation Graph
, buttons : [ Documentation Graph
, buttons : [ Documentation Graph
, Download
, Download
]
]
...
@@ -177,21 +179,22 @@ settingsBox Graph = SettingsBox { show : true
...
@@ -177,21 +179,22 @@ settingsBox Graph = SettingsBox { show : true
settingsBox NodeList = SettingsBox { show : true
settingsBox NodeList = SettingsBox { show : true
, edit : false
, edit : false
,
buttons : [
Documentation NodeList
,
doc :
Documentation NodeList
,
Upload
, buttons : [
Upload
, Download
, Download
]
]
}
}
settingsBox Dashboard = SettingsBox { show : true
settingsBox Dashboard = SettingsBox { show : true
, edit : false
, edit : false
,
buttons : [
Documentation Dashboard
,
doc :
Documentation Dashboard
]
, buttons : [
]
}
}
settingsBox _ = SettingsBox { show : false
settingsBox _ = SettingsBox { show : false
, edit : false
, edit : false
, doc : Documentation NodeUser
, buttons : []
, buttons : []
}
}
...
...
src/Gargantext/Components/Forest/Tree/Node/Action.purs
View file @
58c85c17
...
@@ -4,12 +4,12 @@ import Data.Argonaut (class DecodeJson, class EncodeJson, decodeJson, jsonEmptyO
...
@@ -4,12 +4,12 @@ import Data.Argonaut (class DecodeJson, class EncodeJson, decodeJson, jsonEmptyO
import Data.Generic.Rep (class Generic)
import Data.Generic.Rep (class Generic)
import Data.Generic.Rep.Eq (genericEq)
import Data.Generic.Rep.Eq (genericEq)
import Data.Generic.Rep.Show (genericShow)
import Data.Generic.Rep.Show (genericShow)
import Data.Maybe (Maybe(..)
, fromJust
)
import Data.Maybe (Maybe(..))
import Data.Newtype (class Newtype)
import Data.Newtype (class Newtype)
import Effect.Aff (Aff
, launchAff, runAff
)
import Effect.Aff (Aff)
import Gargantext.Routes (
AppRoute,
SessionRoute(..))
import Gargantext.Routes (SessionRoute(..))
import Gargantext.Sessions (Session,
sessionId, get, put, post, postWwwUrlencoded
, delete)
import Gargantext.Sessions (Session,
get, put, post
, delete)
import Gargantext.Types (
class ToQuery, toQuery, NodeType(..), NodePath(..), readNodeType
)
import Gargantext.Types (
NodeType(..)
)
import Prelude hiding (div)
import Prelude hiding (div)
data Action = Submit String
data Action = Submit String
...
@@ -35,14 +35,12 @@ readFileType "CSV" = Just CSV
...
@@ -35,14 +35,12 @@ readFileType "CSV" = Just CSV
readFileType "PresseRIS" = Just PresseRIS
readFileType "PresseRIS" = Just PresseRIS
readFileType _ = Nothing
readFileType _ = Nothing
data DroppedFile = DroppedFile {
data DroppedFile = DroppedFile {
contents :: UploadFileContents
contents :: UploadFileContents
, fileType :: Maybe FileType
, fileType :: Maybe FileType
}
}
type FileHash = String
type FileHash = String
type Name = String
type Name = String
type ID = Int
type ID = Int
type Reload = Int
type Reload = Int
...
...
src/Gargantext/Components/Forest/Tree/Node/Action/Add.purs
View file @
58c85c17
module Gargantext.Components.Forest.Tree.Node.Action.Add where
module Gargantext.Components.Forest.Tree.Node.Action.Add where
import DOM.Simple.Console (log2)
import Data.Array (length, head)
import Data.Argonaut (class DecodeJson, class EncodeJson, decodeJson, jsonEmptyObject, (.:), (:=), (~>))
import Data.Maybe (Maybe(..), fromMaybe)
import Data.Array (filter, null, length, head, elem)
-- import Data.Newtype (class Newtype)
import Data.Generic.Rep (class Generic)
import Data.Generic.Rep.Eq (genericEq)
import Data.Generic.Rep.Show (genericShow)
import Data.Maybe (Maybe(..), fromJust, fromMaybe)
import Data.Newtype (class Newtype)
import Data.Tuple (Tuple)
import Data.Tuple.Nested ((/\))
import Data.Tuple.Nested ((/\))
import Effect.Aff (Aff, launchAff, runAff)
import Effect.Aff (Aff, launchAff)
import Effect.Class (liftEffect)
import Effect.Uncurried (mkEffectFn1)
import Effect.Uncurried (mkEffectFn1)
import FFI.Simple ((..))
import FFI.Simple ((..))
import Gargantext.Components.Forest.Tree.Node.Action
import Gargantext.Components.Forest.Tree.Node.Action (Action(..), ID, Name)
import Gargantext.Components.Forest.Tree.Node
import Gargantext.Components.Forest.Tree.Node (SettingsBox(..), settingsBox)
import Gargantext.Ends (Frontends, url)
import Gargantext.Types (NodeType(..), readNodeType)
import Gargantext.Components.Loader (loader)
import Gargantext.Routes (AppRoute, SessionRoute(..))
import Gargantext.Routes as Routes
import Gargantext.Sessions (Session, sessionId, get, put, post, postWwwUrlencoded, delete)
import Gargantext.Types (class ToQuery, toQuery, NodeType(..), NodePath(..), readNodeType)
import Gargantext.Utils (id, glyphicon)
import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.Reactix as R2
import Partial.Unsafe (unsafePartial)
import Prelude (Unit, bind, const, discard, map, pure, show, ($), (<>), (>))
import Prelude hiding (div)
import React.SyntheticEvent as E
import Reactix as R
import Reactix as R
import Reactix.DOM.HTML as H
import Reactix.DOM.HTML as H
import URI.Extra.QueryPairs as QP
import URI.Query as Q
import Web.File.File (toBlob)
import Web.File.FileList (FileList, item)
import Web.File.FileReader.Aff (readAsText)
-- START Create Node
-- START Create Node
...
@@ -55,10 +35,10 @@ createNodeView d p@{nodeType} (_ /\ setPopupOpen) nodeTypes = R.createElement el
...
@@ -55,10 +35,10 @@ createNodeView d p@{nodeType} (_ /\ setPopupOpen) nodeTypes = R.createElement el
el = R.hooksComponent "CreateNodeView" cpt
el = R.hooksComponent "CreateNodeView" cpt
cpt {id, name} _ = do
cpt {id, name} _ = do
nodeName <- R.useState' "Default Name"
nodeName <- R.useState' "Default Name"
nodeType <- R.useState' $ fromMaybe NodeUser $ head nodeTypes
nodeType
'
<- R.useState' $ fromMaybe NodeUser $ head nodeTypes
pure $ H.div {}
pure $ H.div {}
[ panelBody readNodeType nodeName nodeType
[ panelBody readNodeType nodeName nodeType
'
, panelFooter nodeName nodeType
, panelFooter nodeName nodeType
'
]
]
where
where
panelBody :: (String -> NodeType)
panelBody :: (String -> NodeType)
...
@@ -125,10 +105,6 @@ createNodeView d p@{nodeType} (_ /\ setPopupOpen) nodeTypes = R.createElement el
...
@@ -125,10 +105,6 @@ createNodeView d p@{nodeType} (_ /\ setPopupOpen) nodeTypes = R.createElement el
} [H.text "Add"]
} [H.text "Add"]
]
]
createNodeView _ _ _ _ = R.createElement el {} []
where
el = R.hooksComponent "CreateNodeView" cpt
cpt props _ = pure $ H.div {} []
-- END Create Node
-- END Create Node
...
...
src/Gargantext/Components/Forest/Tree/Node/Action/Rename.purs
View file @
58c85c17
module Gargantext.Components.Forest.Tree.Node.Action.Rename where
module Gargantext.Components.Forest.Tree.Node.Action.Rename where
import Data.Tuple.Nested ((/\))
import Data.Tuple.Nested ((/\))
import Effect.Aff (Aff, launchAff
, runAff
)
import Effect.Aff (Aff, launchAff)
import Effect.Uncurried (mkEffectFn1)
import Effect.Uncurried (mkEffectFn1)
import FFI.Simple ((..))
import FFI.Simple ((..))
import Gargantext.Components.Forest.Tree.Node.Action
import Gargantext.Components.Forest.Tree.Node.Action
import Gargantext.Types (NodeType
(..)
)
import Gargantext.Types (NodeType)
import Prelude
hiding (div
)
import Prelude
(Unit, bind, const, discard, pure, ($)
)
import Reactix as R
import Reactix as R
import Reactix.DOM.HTML as H
import Reactix.DOM.HTML as H
-- | START Rename Box
-- | START Rename Box
type RenameBoxProps =
type RenameBoxProps =
( id :: ID
( id :: ID
...
...
src/Gargantext/Components/Forest/Tree/Node/Action/Upload.purs
View file @
58c85c17
module Gargantext.Components.Forest.Tree.Node.Action.Upload where
module Gargantext.Components.Forest.Tree.Node.Action.Upload where
import Data.Newtype (class Newtype)
import Data.Newtype (class Newtype)
import Effect.Aff (Aff, launchAff
, runAff
)
import Effect.Aff (Aff, launchAff)
import Gargantext.Sessions (Session,
sessionId, get, put, post, postWwwUrlencoded, delete
)
import Gargantext.Sessions (Session,
postWwwUrlencoded
)
import Gargantext.Types (class ToQuery, toQuery, NodeType(..)
, NodePath(..), readNodeType
)
import Gargantext.Types (class ToQuery, toQuery, NodeType(..))
import Gargantext.Routes (
AppRoute,
SessionRoute(..))
import Gargantext.Routes (SessionRoute(..))
import Prelude
hiding (div
)
import Prelude
(class Show, Unit, const, discard, map, pure, show, ($), (<>)
)
import Data.Maybe (Maybe(..)
, fromJust
)
import Data.Maybe (Maybe(..))
import URI.Extra.QueryPairs as QP
import URI.Extra.QueryPairs as QP
import Gargantext.Components.Forest.Tree.Node.Action
import Gargantext.Components.Forest.Tree.Node.Action
import Reactix as R
import Reactix as R
...
@@ -15,11 +15,10 @@ import URI.Query as Q
...
@@ -15,11 +15,10 @@ import URI.Query as Q
import Reactix.DOM.HTML as H
import Reactix.DOM.HTML as H
import Effect.Uncurried (mkEffectFn1)
import Effect.Uncurried (mkEffectFn1)
import FFI.Simple ((..))
import FFI.Simple ((..))
import Gargantext.Utils (id
, glyphicon
)
import Gargantext.Utils (id)
import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.Reactix as R2
import Data.Tuple.Nested ((/\))
import Data.Tuple.Nested ((/\))
-- START File Type View
-- START File Type View
type FileTypeProps =
type FileTypeProps =
( id :: ID
( id :: ID
...
...
src/Gargantext/Components/Forest/Tree/Node/Box.purs
View file @
58c85c17
...
@@ -220,7 +220,7 @@ nodePopupView d p mPop@(Just NodePopup /\ setPopupOpen) = R.createElement el p [
...
@@ -220,7 +220,7 @@ nodePopupView d p mPop@(Just NodePopup /\ setPopupOpen) = R.createElement el p [
, placement: "right"}
, placement: "right"}
}
}
SettingsBox {edit, buttons} = settingsBox nodeType
SettingsBox {edit,
doc,
buttons} = settingsBox nodeType
removeCircleGeneral (Just _) setNodePopup = removeCircle setNodePopup
removeCircleGeneral (Just _) setNodePopup = removeCircle setNodePopup
removeCircleGeneral Nothing _ = H.div {} []
removeCircleGeneral Nothing _ = H.div {} []
...
@@ -259,8 +259,11 @@ nodePopupView d p mPop@(Just NodePopup /\ setPopupOpen) = R.createElement el p [
...
@@ -259,8 +259,11 @@ nodePopupView d p mPop@(Just NodePopup /\ setPopupOpen) = R.createElement el p [
editIcon (true /\ _) = H.div {} []
editIcon (true /\ _) = H.div {} []
panelBody nodePopupState d' =
panelBody nodePopupState d' =
H.div {className: "panel-body flex-center"}
H.div {className: "panel-body flex-space-between"}
$ map (buttonClick nodePopupState d') buttons
[ H.div {className: "flex-center"} [buttonClick nodePopupState d' doc]
, H.div {className: "flex-center"}
$ map (buttonClick nodePopupState d') buttons
]
searchIsTexIframe _id _session search@(search' /\ _) =
searchIsTexIframe _id _session search@(search' /\ _) =
if isIsTex search'.datafield then
if isIsTex search'.datafield then
...
...
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