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
4
Merge Requests
4
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
bbd5c907
Commit
bbd5c907
authored
Aug 11, 2020
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[upload] file upload implemented now, works with correct API endpoint
parent
e8976359
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
85 additions
and
79 deletions
+85
-79
App.purs
src/Gargantext/Components/App.purs
+2
-1
Node.purs
src/Gargantext/Components/Forest/Tree/Node.purs
+3
-2
Upload.purs
...Gargantext/Components/Forest/Tree/Node/Action/Upload.purs
+2
-11
Settings.purs
src/Gargantext/Components/Forest/Tree/Node/Settings.purs
+8
-0
Tools.purs
src/Gargantext/Components/Forest/Tree/Node/Tools.purs
+1
-1
Types.purs
src/Gargantext/Types.purs
+69
-64
No files found.
src/Gargantext/Components/App.purs
View file @
bbd5c907
...
...
@@ -4,10 +4,11 @@ import Data.Array (fromFoldable)
import Data.Foldable (intercalate)
import Data.Maybe (Maybe(..), maybe')
import Data.Tuple (fst, snd)
import Prelude
import Reactix as R
import Reactix.DOM.HTML as H
import Gargantext.Prelude
import Gargantext.Components.Forest (forest)
import Gargantext.Components.GraphExplorer (explorerLayout)
import Gargantext.Components.Lang (LandingLang(..))
...
...
src/Gargantext/Components/Forest/Tree/Node.purs
View file @
bbd5c907
...
...
@@ -120,8 +120,9 @@ nodeMainSpan p@{ dispatch, folderOpen, frontends, session, handed} = R.createEle
folderIcon nodeType folderOpen'@(open /\ _) =
H.a { className: "folder-icon"
, onClick: R2.effToggler folderOpen'
}
[ H.i {className: GT.fldr nodeType open} [] ]
} [
H.i {className: GT.fldr nodeType open} []
]
popOverIcon = H.a { className: "settings fa fa-cog" } []
...
...
src/Gargantext/Components/Forest/Tree/Node/Action/Upload.purs
View file @
bbd5c907
...
...
@@ -4,6 +4,7 @@ import Data.Maybe (Maybe(..), fromJust, fromMaybe)
import Data.Newtype (class Newtype)
import Data.Tuple (Tuple(..))
import Data.Tuple.Nested ((/\))
import DOM.Simple.Console (log2)
import Effect (Effect)
import Effect.Aff (Aff, launchAff, throwError)
import Effect.Class (liftEffect)
...
...
@@ -120,17 +121,6 @@ uploadFileViewCpt = R.hooksComponent "G.C.F.T.N.A.U.UploadFileView" cpt
liftEffect $ do
setMFile $ const $ Just $ {contents: UploadFileContents contents, name}
onChangeFileType :: forall e
. R.State FileType
-> e
-> Effect Unit
onChangeFileType (fileType /\ setFileType) e = do
setFileType $ const
$ unsafePartial
$ fromJust
$ read
$ R2.unsafeEventValue e
type UploadButtonProps =
( dispatch :: Action -> Aff Unit
...
...
@@ -167,6 +157,7 @@ uploadButtonCpt = R.hooksComponent "G.C.F.T.N.A.U.uploadButton" cpt
onClick e = do
let { contents, name } = unsafePartial $ fromJust mFile
log2 "[uploadButton] fileType" fileType
void $ launchAff do
case fileType of
Arbitrary ->
...
...
src/Gargantext/Components/Forest/Tree/Node/Settings.purs
View file @
bbd5c907
...
...
@@ -303,6 +303,14 @@ settingsBox NodeFrameCalc =
}
settingsBox NodeFile =
SettingsBox { show: true
, edit: true
, doc: Documentation NodeFile
, buttons: [ Delete ]
}
settingsBox _ =
SettingsBox { show : false
, edit : false
...
...
src/Gargantext/Components/Forest/Tree/Node/Tools.purs
View file @
bbd5c907
...
...
@@ -164,7 +164,7 @@ formChoice :: forall a b c d
formChoice nodeTypes defaultNodeType setNodeType =
H.div { className: "form-group"}
[ R2.select { className: "form-control"
, on: { change:
\_ ->
setNodeType
, on: { change: setNodeType
<<< const
<<< fromMaybe defaultNodeType
<<< read
...
...
src/Gargantext/Types.purs
View file @
bbd5c907
...
...
@@ -166,36 +166,38 @@ data NodeType = NodeUser
| NodeFrameWrite
| NodeFrameCalc
| NodePublic NodeType
| NodeFile
derive instance eqNodeType :: Eq NodeType
instance showNodeType :: Show NodeType where
show NodeUser = "NodeUser"
show Folder = "NodeFolder"
show FolderPrivate = "NodeFolderPrivate" -- Node Private Worktop
show FolderShared = "NodeFolderShared" -- Node Share Worktop
show FolderPublic = "NodeFolderPublic" -- Node Public Worktop
show Annuaire = "NodeAnnuaire"
show NodeContact = "NodeContact"
show Corpus = "NodeCorpus"
show Dashboard = "NodeDashboard"
show Url_Document = "NodeDocument"
show Error = "NodeError"
show Graph = "NodeGraph"
show Phylo = "NodePhylo"
show Individu = "NodeIndividu"
show Node = "Node"
show Nodes = "Nodes"
show Tree = "NodeTree"
show Team = "NodeTeam"
show NodeList = "NodeList"
show Texts = "NodeTexts"
show NodeFrameWrite = "NodeFrameWrite"
show NodeFrameCalc = "NodeFrameCalc"
show NodeUser
= "NodeUser"
show Folder
= "NodeFolder"
show FolderPrivate
= "NodeFolderPrivate" -- Node Private Worktop
show FolderShared
= "NodeFolderShared" -- Node Share Worktop
show FolderPublic
= "NodeFolderPublic" -- Node Public Worktop
show Annuaire
= "NodeAnnuaire"
show NodeContact
= "NodeContact"
show Corpus
= "NodeCorpus"
show Dashboard
= "NodeDashboard"
show Url_Document
= "NodeDocument"
show Error
= "NodeError"
show Graph
= "NodeGraph"
show Phylo
= "NodePhylo"
show Individu
= "NodeIndividu"
show Node
= "Node"
show Nodes
= "Nodes"
show Tree
= "NodeTree"
show Team
= "NodeTeam"
show NodeList
= "NodeList"
show Texts
= "NodeTexts"
show NodeFrameWrite
= "NodeFrameWrite"
show NodeFrameCalc
= "NodeFrameCalc"
show (NodePublic nt) = "NodePublic" <> show nt
show NodeFile = "NodeFile"
instance readNodeType :: Read NodeType where
...
...
@@ -204,25 +206,26 @@ instance readNodeType :: Read NodeType where
read "NodeFolderPrivate" = Just FolderPrivate
read "NodeFolderShared" = Just FolderShared
read "NodeFolderPublic" = Just FolderPublic
read "NodeAnnuaire" = Just Annuaire
read "NodeDashboard" = Just Dashboard
read "Document" = Just Url_Document
read "NodeGraph" = Just Graph
read "NodePhylo" = Just Phylo
read "Individu" = Just Individu
read "Node" = Just Node
read "Nodes" = Just Nodes
read "NodeCorpus" = Just Corpus
read "NodeContact" = Just NodeContact
read "Tree" = Just Tree
read "NodeTeam" = Just Team
read "NodeList" = Just NodeList
read "NodeTexts" = Just Texts
read "Annuaire" = Just Annuaire
read "NodeFrameWrite" = Just NodeFrameWrite
read "NodeFrameCalc" = Just NodeFrameCalc
read "NodeAnnuaire" = Just Annuaire
read "NodeDashboard" = Just Dashboard
read "Document" = Just Url_Document
read "NodeGraph" = Just Graph
read "NodePhylo" = Just Phylo
read "Individu" = Just Individu
read "Node" = Just Node
read "Nodes" = Just Nodes
read "NodeCorpus" = Just Corpus
read "NodeContact" = Just NodeContact
read "Tree" = Just Tree
read "NodeTeam" = Just Team
read "NodeList" = Just NodeList
read "NodeTexts" = Just Texts
read "Annuaire" = Just Annuaire
read "NodeFrameWrite" = Just NodeFrameWrite
read "NodeFrameCalc" = Just NodeFrameCalc
read "NodeFile" = Just NodeFile
-- TODO NodePublic read ?
read _ = Nothing
read _
= Nothing
fldr :: NodeType -> Boolean -> String
...
...
@@ -253,6 +256,7 @@ fldr Graph _ = "fa fa-hubzilla"
fldr Texts _ = "fa fa-newspaper-o"
fldr Dashboard _ = "fa fa-signal"
fldr NodeList _ = "fa fa-list"
fldr NodeFile _ = "fa fa-file" -- TODO depending on mime type we can use fa-file-image etc
fldr Annuaire true = "fa fa-address-card-o"
fldr Annuaire false = "fa fa-address-card"
...
...
@@ -299,29 +303,30 @@ instance encodeJsonNodeType :: EncodeJson NodeType where
encodeJson nodeType = encodeJson $ show nodeType
nodeTypePath :: NodeType -> String
nodeTypePath Folder = "folder"
nodeTypePath FolderPrivate = "folderPrivate"
nodeTypePath FolderShared = "folderShared"
nodeTypePath FolderPublic = "folderPublic"
nodeTypePath Annuaire = "annuaire"
nodeTypePath Corpus = "corpus"
nodeTypePath Dashboard = "dashboard"
nodeTypePath Url_Document = "document"
nodeTypePath Error = "ErrorNodeType"
nodeTypePath Graph = "graph"
nodeTypePath Phylo = "phylo"
nodeTypePath Individu = "individu"
nodeTypePath Node = "node"
nodeTypePath Nodes = "nodes"
nodeTypePath NodeUser = "user"
nodeTypePath NodeContact = "contact"
nodeTypePath Tree = "tree"
nodeTypePath NodeList = "lists"
nodeTypePath Texts = "texts"
nodeTypePath Team = "team"
nodeTypePath NodeFrameWrite = "write"
nodeTypePath NodeFrameCalc = "calc"
nodeTypePath Folder
= "folder"
nodeTypePath FolderPrivate
= "folderPrivate"
nodeTypePath FolderShared
= "folderShared"
nodeTypePath FolderPublic
= "folderPublic"
nodeTypePath Annuaire
= "annuaire"
nodeTypePath Corpus
= "corpus"
nodeTypePath Dashboard
= "dashboard"
nodeTypePath Url_Document
= "document"
nodeTypePath Error
= "ErrorNodeType"
nodeTypePath Graph
= "graph"
nodeTypePath Phylo
= "phylo"
nodeTypePath Individu
= "individu"
nodeTypePath Node
= "node"
nodeTypePath Nodes
= "nodes"
nodeTypePath NodeUser
= "user"
nodeTypePath NodeContact
= "contact"
nodeTypePath Tree
= "tree"
nodeTypePath NodeList
= "lists"
nodeTypePath Texts
= "texts"
nodeTypePath Team
= "team"
nodeTypePath NodeFrameWrite
= "write"
nodeTypePath NodeFrameCalc
= "calc"
nodeTypePath (NodePublic nt) = nodeTypePath nt
nodeTypePath NodeFile = "file"
------------------------------------------------------------
...
...
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