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
1
Merge Requests
1
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
Przemyslaw Kaminski
purescript-gargantext
Commits
bbd5c907
Commit
bbd5c907
authored
4 years ago
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)
...
@@ -4,10 +4,11 @@ import Data.Array (fromFoldable)
import Data.Foldable (intercalate)
import Data.Foldable (intercalate)
import Data.Maybe (Maybe(..), maybe')
import Data.Maybe (Maybe(..), maybe')
import Data.Tuple (fst, snd)
import Data.Tuple (fst, snd)
import Prelude
import Reactix as R
import Reactix as R
import Reactix.DOM.HTML as H
import Reactix.DOM.HTML as H
import Gargantext.Prelude
import Gargantext.Components.Forest (forest)
import Gargantext.Components.Forest (forest)
import Gargantext.Components.GraphExplorer (explorerLayout)
import Gargantext.Components.GraphExplorer (explorerLayout)
import Gargantext.Components.Lang (LandingLang(..))
import Gargantext.Components.Lang (LandingLang(..))
...
...
This diff is collapsed.
Click to expand it.
src/Gargantext/Components/Forest/Tree/Node.purs
View file @
bbd5c907
...
@@ -120,8 +120,9 @@ nodeMainSpan p@{ dispatch, folderOpen, frontends, session, handed} = R.createEle
...
@@ -120,8 +120,9 @@ nodeMainSpan p@{ dispatch, folderOpen, frontends, session, handed} = R.createEle
folderIcon nodeType folderOpen'@(open /\ _) =
folderIcon nodeType folderOpen'@(open /\ _) =
H.a { className: "folder-icon"
H.a { className: "folder-icon"
, onClick: R2.effToggler folderOpen'
, 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" } []
popOverIcon = H.a { className: "settings fa fa-cog" } []
...
...
This diff is collapsed.
Click to expand it.
src/Gargantext/Components/Forest/Tree/Node/Action/Upload.purs
View file @
bbd5c907
...
@@ -4,6 +4,7 @@ import Data.Maybe (Maybe(..), fromJust, fromMaybe)
...
@@ -4,6 +4,7 @@ import Data.Maybe (Maybe(..), fromJust, fromMaybe)
import Data.Newtype (class Newtype)
import Data.Newtype (class Newtype)
import Data.Tuple (Tuple(..))
import Data.Tuple (Tuple(..))
import Data.Tuple.Nested ((/\))
import Data.Tuple.Nested ((/\))
import DOM.Simple.Console (log2)
import Effect (Effect)
import Effect (Effect)
import Effect.Aff (Aff, launchAff, throwError)
import Effect.Aff (Aff, launchAff, throwError)
import Effect.Class (liftEffect)
import Effect.Class (liftEffect)
...
@@ -120,17 +121,6 @@ uploadFileViewCpt = R.hooksComponent "G.C.F.T.N.A.U.UploadFileView" cpt
...
@@ -120,17 +121,6 @@ uploadFileViewCpt = R.hooksComponent "G.C.F.T.N.A.U.UploadFileView" cpt
liftEffect $ do
liftEffect $ do
setMFile $ const $ Just $ {contents: UploadFileContents contents, name}
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 =
type UploadButtonProps =
( dispatch :: Action -> Aff Unit
( dispatch :: Action -> Aff Unit
...
@@ -167,6 +157,7 @@ uploadButtonCpt = R.hooksComponent "G.C.F.T.N.A.U.uploadButton" cpt
...
@@ -167,6 +157,7 @@ uploadButtonCpt = R.hooksComponent "G.C.F.T.N.A.U.uploadButton" cpt
onClick e = do
onClick e = do
let { contents, name } = unsafePartial $ fromJust mFile
let { contents, name } = unsafePartial $ fromJust mFile
log2 "[uploadButton] fileType" fileType
void $ launchAff do
void $ launchAff do
case fileType of
case fileType of
Arbitrary ->
Arbitrary ->
...
...
This diff is collapsed.
Click to expand it.
src/Gargantext/Components/Forest/Tree/Node/Settings.purs
View file @
bbd5c907
...
@@ -303,6 +303,14 @@ settingsBox NodeFrameCalc =
...
@@ -303,6 +303,14 @@ settingsBox NodeFrameCalc =
}
}
settingsBox NodeFile =
SettingsBox { show: true
, edit: true
, doc: Documentation NodeFile
, buttons: [ Delete ]
}
settingsBox _ =
settingsBox _ =
SettingsBox { show : false
SettingsBox { show : false
, edit : false
, edit : false
...
...
This diff is collapsed.
Click to expand it.
src/Gargantext/Components/Forest/Tree/Node/Tools.purs
View file @
bbd5c907
...
@@ -164,7 +164,7 @@ formChoice :: forall a b c d
...
@@ -164,7 +164,7 @@ formChoice :: forall a b c d
formChoice nodeTypes defaultNodeType setNodeType =
formChoice nodeTypes defaultNodeType setNodeType =
H.div { className: "form-group"}
H.div { className: "form-group"}
[ R2.select { className: "form-control"
[ R2.select { className: "form-control"
, on: { change:
\_ ->
setNodeType
, on: { change: setNodeType
<<< const
<<< const
<<< fromMaybe defaultNodeType
<<< fromMaybe defaultNodeType
<<< read
<<< read
...
...
This diff is collapsed.
Click to expand it.
src/Gargantext/Types.purs
View file @
bbd5c907
...
@@ -166,36 +166,38 @@ data NodeType = NodeUser
...
@@ -166,36 +166,38 @@ data NodeType = NodeUser
| NodeFrameWrite
| NodeFrameWrite
| NodeFrameCalc
| NodeFrameCalc
| NodePublic NodeType
| NodePublic NodeType
| NodeFile
derive instance eqNodeType :: Eq NodeType
derive instance eqNodeType :: Eq NodeType
instance showNodeType :: Show NodeType where
instance showNodeType :: Show NodeType where
show NodeUser = "NodeUser"
show NodeUser
= "NodeUser"
show Folder = "NodeFolder"
show Folder
= "NodeFolder"
show FolderPrivate = "NodeFolderPrivate" -- Node Private Worktop
show FolderPrivate
= "NodeFolderPrivate" -- Node Private Worktop
show FolderShared = "NodeFolderShared" -- Node Share Worktop
show FolderShared
= "NodeFolderShared" -- Node Share Worktop
show FolderPublic = "NodeFolderPublic" -- Node Public Worktop
show FolderPublic
= "NodeFolderPublic" -- Node Public Worktop
show Annuaire = "NodeAnnuaire"
show Annuaire
= "NodeAnnuaire"
show NodeContact = "NodeContact"
show NodeContact
= "NodeContact"
show Corpus = "NodeCorpus"
show Corpus
= "NodeCorpus"
show Dashboard = "NodeDashboard"
show Dashboard
= "NodeDashboard"
show Url_Document = "NodeDocument"
show Url_Document
= "NodeDocument"
show Error = "NodeError"
show Error
= "NodeError"
show Graph = "NodeGraph"
show Graph
= "NodeGraph"
show Phylo = "NodePhylo"
show Phylo
= "NodePhylo"
show Individu = "NodeIndividu"
show Individu
= "NodeIndividu"
show Node = "Node"
show Node
= "Node"
show Nodes = "Nodes"
show Nodes
= "Nodes"
show Tree = "NodeTree"
show Tree
= "NodeTree"
show Team = "NodeTeam"
show Team
= "NodeTeam"
show NodeList = "NodeList"
show NodeList
= "NodeList"
show Texts = "NodeTexts"
show Texts
= "NodeTexts"
show NodeFrameWrite = "NodeFrameWrite"
show NodeFrameWrite
= "NodeFrameWrite"
show NodeFrameCalc = "NodeFrameCalc"
show NodeFrameCalc
= "NodeFrameCalc"
show (NodePublic nt) = "NodePublic" <> show nt
show (NodePublic nt) = "NodePublic" <> show nt
show NodeFile = "NodeFile"
instance readNodeType :: Read NodeType where
instance readNodeType :: Read NodeType where
...
@@ -204,25 +206,26 @@ instance readNodeType :: Read NodeType where
...
@@ -204,25 +206,26 @@ instance readNodeType :: Read NodeType where
read "NodeFolderPrivate" = Just FolderPrivate
read "NodeFolderPrivate" = Just FolderPrivate
read "NodeFolderShared" = Just FolderShared
read "NodeFolderShared" = Just FolderShared
read "NodeFolderPublic" = Just FolderPublic
read "NodeFolderPublic" = Just FolderPublic
read "NodeAnnuaire" = Just Annuaire
read "NodeAnnuaire" = Just Annuaire
read "NodeDashboard" = Just Dashboard
read "NodeDashboard" = Just Dashboard
read "Document" = Just Url_Document
read "Document" = Just Url_Document
read "NodeGraph" = Just Graph
read "NodeGraph" = Just Graph
read "NodePhylo" = Just Phylo
read "NodePhylo" = Just Phylo
read "Individu" = Just Individu
read "Individu" = Just Individu
read "Node" = Just Node
read "Node" = Just Node
read "Nodes" = Just Nodes
read "Nodes" = Just Nodes
read "NodeCorpus" = Just Corpus
read "NodeCorpus" = Just Corpus
read "NodeContact" = Just NodeContact
read "NodeContact" = Just NodeContact
read "Tree" = Just Tree
read "Tree" = Just Tree
read "NodeTeam" = Just Team
read "NodeTeam" = Just Team
read "NodeList" = Just NodeList
read "NodeList" = Just NodeList
read "NodeTexts" = Just Texts
read "NodeTexts" = Just Texts
read "Annuaire" = Just Annuaire
read "Annuaire" = Just Annuaire
read "NodeFrameWrite" = Just NodeFrameWrite
read "NodeFrameWrite" = Just NodeFrameWrite
read "NodeFrameCalc" = Just NodeFrameCalc
read "NodeFrameCalc" = Just NodeFrameCalc
read "NodeFile" = Just NodeFile
-- TODO NodePublic read ?
-- TODO NodePublic read ?
read _ = Nothing
read _
= Nothing
fldr :: NodeType -> Boolean -> String
fldr :: NodeType -> Boolean -> String
...
@@ -253,6 +256,7 @@ fldr Graph _ = "fa fa-hubzilla"
...
@@ -253,6 +256,7 @@ fldr Graph _ = "fa fa-hubzilla"
fldr Texts _ = "fa fa-newspaper-o"
fldr Texts _ = "fa fa-newspaper-o"
fldr Dashboard _ = "fa fa-signal"
fldr Dashboard _ = "fa fa-signal"
fldr NodeList _ = "fa fa-list"
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 true = "fa fa-address-card-o"
fldr Annuaire false = "fa fa-address-card"
fldr Annuaire false = "fa fa-address-card"
...
@@ -299,29 +303,30 @@ instance encodeJsonNodeType :: EncodeJson NodeType where
...
@@ -299,29 +303,30 @@ instance encodeJsonNodeType :: EncodeJson NodeType where
encodeJson nodeType = encodeJson $ show nodeType
encodeJson nodeType = encodeJson $ show nodeType
nodeTypePath :: NodeType -> String
nodeTypePath :: NodeType -> String
nodeTypePath Folder = "folder"
nodeTypePath Folder
= "folder"
nodeTypePath FolderPrivate = "folderPrivate"
nodeTypePath FolderPrivate
= "folderPrivate"
nodeTypePath FolderShared = "folderShared"
nodeTypePath FolderShared
= "folderShared"
nodeTypePath FolderPublic = "folderPublic"
nodeTypePath FolderPublic
= "folderPublic"
nodeTypePath Annuaire = "annuaire"
nodeTypePath Annuaire
= "annuaire"
nodeTypePath Corpus = "corpus"
nodeTypePath Corpus
= "corpus"
nodeTypePath Dashboard = "dashboard"
nodeTypePath Dashboard
= "dashboard"
nodeTypePath Url_Document = "document"
nodeTypePath Url_Document
= "document"
nodeTypePath Error = "ErrorNodeType"
nodeTypePath Error
= "ErrorNodeType"
nodeTypePath Graph = "graph"
nodeTypePath Graph
= "graph"
nodeTypePath Phylo = "phylo"
nodeTypePath Phylo
= "phylo"
nodeTypePath Individu = "individu"
nodeTypePath Individu
= "individu"
nodeTypePath Node = "node"
nodeTypePath Node
= "node"
nodeTypePath Nodes = "nodes"
nodeTypePath Nodes
= "nodes"
nodeTypePath NodeUser = "user"
nodeTypePath NodeUser
= "user"
nodeTypePath NodeContact = "contact"
nodeTypePath NodeContact
= "contact"
nodeTypePath Tree = "tree"
nodeTypePath Tree
= "tree"
nodeTypePath NodeList = "lists"
nodeTypePath NodeList
= "lists"
nodeTypePath Texts = "texts"
nodeTypePath Texts
= "texts"
nodeTypePath Team = "team"
nodeTypePath Team
= "team"
nodeTypePath NodeFrameWrite = "write"
nodeTypePath NodeFrameWrite
= "write"
nodeTypePath NodeFrameCalc = "calc"
nodeTypePath NodeFrameCalc
= "calc"
nodeTypePath (NodePublic nt) = nodeTypePath nt
nodeTypePath (NodePublic nt) = nodeTypePath nt
nodeTypePath NodeFile = "file"
------------------------------------------------------------
------------------------------------------------------------
...
...
This diff is collapsed.
Click to expand it.
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