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
137
Issues
137
List
Board
Labels
Milestones
Merge Requests
5
Merge Requests
5
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
df0e31d2
Verified
Commit
df0e31d2
authored
Apr 09, 2025
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[upload] fix upload sending 'Nothing' as lang
parent
9c06952e
Pipeline
#7528
passed with stages
in 26 minutes and 56 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
Upload.purs
...Gargantext/Components/Forest/Tree/Node/Action/Upload.purs
+6
-7
Lang.purs
src/Gargantext/Components/Lang.purs
+2
-1
No files found.
src/Gargantext/Components/Forest/Tree/Node/Action/Upload.purs
View file @
df0e31d2
...
...
@@ -386,9 +386,6 @@ onChangeContents
T.write_ (Just $ { blob: UploadFileBlob blob, name }) mFile
checkFileUpdateParams props
uploadButton :: R2.Component UploadFileProps
uploadButton = R.createElement uploadButtonCpt
-- | String pattern used to parse extensions in file paths
fileExtensionPattern :: String
fileExtensionPattern = "(.*)\\.(.*)"
...
...
@@ -509,6 +506,9 @@ checkFileUpdateParams
T.write_ "The file extension is invalid." message
T.write_ "alert-danger" alertType
uploadButton :: R2.Component UploadFileProps
uploadButton = R.createElement uploadButtonCpt
uploadButtonCpt :: R.Component UploadFileProps
uploadButtonCpt = here.component "uploadButton" cpt
where
...
...
@@ -861,14 +861,14 @@ uploadFile { contents, fileFormat, lang, fileType, id, nodeType, mName, selectio
postWwwUrlencoded session p body
--postMultipartFormData session p fileContents
where
langParam key = if lang == No_extraction then [] else [ Tuple key (Just $ show lang) ]
bodyParams =
[ Tuple "_wf_data" (Just contents)
, Tuple "_wf_filetype" (Just $ show fileType)
, Tuple "_wf_fileformat" (Just $ show fileFormat)
, Tuple "_wf_lang" (Just $ show lang)
, Tuple "_wf_name" mName
, Tuple "_wf_selection" (Just $ show selection)
]
]
<> (langParam "_wf_lang")
jsonBodyParams =
[ Tuple "_wjf_data" (Just contents)
, Tuple "_wjf_filetype" (Just $ show fileType)
...
...
@@ -878,10 +878,9 @@ uploadFile { contents, fileFormat, lang, fileType, id, nodeType, mName, selectio
[ Tuple "_wtf_data" (Just contents)
, Tuple "_wtf_filetype" (Just $ show fileType)
, Tuple "_wtf_fileformat" (Just $ show fileFormat)
, Tuple "_wf_lang" (Just $ show lang)
, Tuple "_wtf_name" mName
, Tuple "_wtf_selection" (Just $ show selection)
]
]
<> (langParam "_wtf_lang")
(typ /\ p /\ body) = case nodeType of
Corpus -> GT.CorpusFormUpload /\ (GR.NodeAPI nodeType (Just id) $ GT.asyncTaskTypePath GT.CorpusFormUpload) /\ bodyParams
...
...
src/Gargantext/Components/Lang.purs
View file @
df0e31d2
...
...
@@ -53,7 +53,7 @@ derive instance Generic Lang _
derive instance Ord Lang
instance Show Lang where
show No_extraction = "No
thing
"
show No_extraction = "No
language extraction
"
show s = genericShow s
langReader :: String -> Maybe Lang
...
...
@@ -72,6 +72,7 @@ instance JSON.ReadForeign Lang where
Just l -> pure l
instance JSON.WriteForeign Lang where
writeImpl No_extraction = JSON.writeImpl (Nothing :: Maybe String)
writeImpl l = JSON.writeImpl $ show l
data ServerType = CoreNLP | Spacy | JohnSnow
...
...
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