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
f2d2cbf0
Commit
f2d2cbf0
authored
Oct 11, 2021
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[zip] base64-encoded zip file upload
parent
456fa548
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
5 deletions
+9
-5
spago.dhall
spago.dhall
+1
-0
Upload.purs
...Gargantext/Components/Forest/Tree/Node/Action/Upload.purs
+8
-3
Types.purs
src/Gargantext/Types.purs
+0
-2
No files found.
spago.dhall
View file @
f2d2cbf0
...
...
@@ -19,6 +19,7 @@ to generate this file without the comments in this block.
, "argonaut-codecs"
, "argonaut-core"
, "arrays"
, "b64"
, "bifunctors"
, "colors"
, "console"
...
...
src/Gargantext/Components/Forest/Tree/Node/Action/Upload.purs
View file @
f2d2cbf0
...
...
@@ -2,12 +2,13 @@ module Gargantext.Components.Forest.Tree.Node.Action.Upload where
import Gargantext.Prelude
import Data.Either (Either, fromRight')
import Data.Either (Either
(..)
, fromRight')
import Data.Eq.Generic (genericEq)
import Data.Foldable (intercalate)
import Data.Generic.Rep (class Generic)
import Data.Maybe (Maybe(..), fromJust, fromMaybe, isNothing)
import Data.Newtype (class Newtype)
import Data.String.Base64 as B64
import Data.String.Regex as DSR
import Data.String.Regex.Flags as DSRF
import Data.Tuple (Tuple(..))
...
...
@@ -193,7 +194,6 @@ uploadButtonCpt = here.component "uploadButton" cpt
let disabled = isNothing mFile' || onPending
pure $
H.div
{ className: "action-upload-button" }
[
...
...
@@ -368,7 +368,12 @@ uploadFile { contents, fileType, id, nodeType, mName, session } = do
pure $ (\task -> GT.AsyncTaskWithType { task, typ }) <$> eTask
--postMultipartFormData session p fileContents
where
bodyParams = [ Tuple "_wf_data" (Just contents)
data' = case fileType of
ZIP -> case B64.btoa contents of
Left _err -> Nothing
Right dd -> Just dd
_ -> Just contents
bodyParams = [ Tuple "_wf_data" data'
, Tuple "_wf_filetype" (Just $ show fileType)
, Tuple "_wf_name" mName
]
...
...
src/Gargantext/Types.purs
View file @
f2d2cbf0
...
...
@@ -659,7 +659,6 @@ data AsyncTaskType = AddNode
| GraphRecompute
| ListUpload
| ListCSVUpload -- legacy v3 CSV upload for lists
| ListZIPUpload
| Query
| UpdateNgramsCharts
| UpdateNode
...
...
@@ -680,7 +679,6 @@ asyncTaskTypePath CorpusFormUpload = "add/form/async/"
asyncTaskTypePath GraphRecompute = "async/recompute/"
asyncTaskTypePath ListUpload = "add/form/async/"
asyncTaskTypePath ListCSVUpload = "csv/add/form/async/"
asyncTaskTypePath ListZIPUpload = "zip/add/form/async/"
asyncTaskTypePath Query = "query/"
asyncTaskTypePath UpdateNgramsCharts = "ngrams/async/charts/update/"
asyncTaskTypePath UpdateNode = "update/"
...
...
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