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
Show 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,6 +166,7 @@ data NodeType = NodeUser
| NodeFrameWrite
| NodeFrameCalc
| NodePublic NodeType
| NodeFile
derive instance eqNodeType :: Eq NodeType
...
...
@@ -196,6 +197,7 @@ instance showNodeType :: Show NodeType where
show NodeFrameWrite = "NodeFrameWrite"
show NodeFrameCalc = "NodeFrameCalc"
show (NodePublic nt) = "NodePublic" <> show nt
show NodeFile = "NodeFile"
instance readNodeType :: Read NodeType where
...
...
@@ -221,6 +223,7 @@ instance readNodeType :: Read NodeType where
read "Annuaire" = Just Annuaire
read "NodeFrameWrite" = Just NodeFrameWrite
read "NodeFrameCalc" = Just NodeFrameCalc
read "NodeFile" = Just NodeFile
-- TODO NodePublic read ?
read _ = Nothing
...
...
@@ -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"
...
...
@@ -322,6 +326,7 @@ 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