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
153
Issues
153
List
Board
Labels
Milestones
Merge Requests
3
Merge Requests
3
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
0249aa29
Commit
0249aa29
authored
Oct 16, 2025
by
Karen Konou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[home] refactor performAction
parent
419ef08b
Pipeline
#7980
passed with stages
in 35 minutes and 23 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
16 deletions
+29
-16
Home.purs
src/Gargantext/Components/Nodes/Home.purs
+29
-16
No files found.
src/Gargantext/Components/Nodes/Home.purs
View file @
0249aa29
...
...
@@ -60,6 +60,7 @@ import Gargantext.Sessions.Types (Session(..), cleanBackendUrl)
import Gargantext.Types (NodeType(..), ID)
import Gargantext.Config.Utils (handleRESTError)
import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.Toestand as T2
import Reactix as R
import Reactix.DOM.HTML as H
import Routing.Hash (setHash)
...
...
@@ -795,23 +796,35 @@ type PerformActionProps =
)
performAction :: NodeAction.Action -> Record PerformActionProps -> Aff Unit
performAction (NodeAction.DoSearch task) { boxes: { tasks }, id, visible } = liftEffect $ do
case head id of
Just i -> do
GAT.insert i task tasks
T.write_ false visible
Nothing -> pure unit
performAction (NodeAction.UploadFile nodeType fileType fileFormat lang mName contents selection) { boxes: { errors }, session, id, visible } = do
case head id of
Just i -> do
eTask <- uploadFile { contents, fileFormat, fileType, id: i, lang, mName, nodeType, selection, session }
handleRESTError (R2.herePrefix here "[uploadFile']") errors eTask $ \task -> liftEffect $ do
here.log2 "[uploadFile'] UploadFile, uploaded, task:" task
T.write_ false visible
Nothing -> pure unit
performAction = performAction'
where
performAction' (NodeAction.DoSearch task) { boxes: { tasks, reloadForest }, id, visible } = do
doSearch task tasks id visible
refreshTree reloadForest
performAction' (NodeAction.UploadFile nodeType fileType fileFormat lang mName contents selection) { boxes: { errors, reloadForest }, session, id, visible } = do
doUpload nodeType fileType fileFormat lang mName contents selection errors session id visible
refreshTree reloadForest
performAction _ _ = pure unit
performAction' _ _ = pure unit
doSearch task tasks id visible = liftEffect $ do
case head id of
Just i -> do
GAT.insert i task tasks
T.write_ false visible
Nothing -> pure unit
doUpload nodeType fileType fileFormat lang mName contents selection errors session id visible = do
case head id of
Just i -> do
eTask <- uploadFile { contents, fileFormat, fileType, id: i, lang, mName, nodeType, selection, session }
handleRESTError (R2.herePrefix here "[uploadFile']") errors eTask $ \task -> liftEffect $ do
here.log2 "[uploadFile'] UploadFile, uploaded, task:" task
T.write_ false visible
Nothing -> pure unit
refreshTree reloadForest = liftEffect $ T2.reload reloadForest
type FormData =
{ corpusName :: String
...
...
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