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
139
Issues
139
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
gargantext
purescript-gargantext
Commits
5302939d
Commit
5302939d
authored
Oct 22, 2021
by
arturo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
>>> continue: sync task XHR
parent
c024c3b6
Pipeline
#2003
failed with stage
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
6 deletions
+35
-6
DocsTable.purs
src/Gargantext/Components/DocsTable.purs
+16
-5
DocumentFormCreation.purs
...Gargantext/Components/DocsTable/DocumentFormCreation.purs
+16
-0
Ends.purs
src/Gargantext/Ends.purs
+2
-1
Routes.purs
src/Gargantext/Routes.purs
+1
-0
No files found.
src/Gargantext/Components/DocsTable.purs
View file @
5302939d
...
@@ -3,6 +3,7 @@ module Gargantext.Components.DocsTable where
...
@@ -3,6 +3,7 @@ module Gargantext.Components.DocsTable where
import Gargantext.Prelude
import Gargantext.Prelude
import DOM.Simple.Console (log2)
import DOM.Simple.Event as DE
import DOM.Simple.Event as DE
import Data.Array as A
import Data.Array as A
import Data.Either (Either)
import Data.Either (Either)
...
@@ -28,7 +29,7 @@ import Gargantext.Components.Bootstrap as B
...
@@ -28,7 +29,7 @@ import Gargantext.Components.Bootstrap as B
import Gargantext.Components.Bootstrap.Types (ComponentStatus(..))
import Gargantext.Components.Bootstrap.Types (ComponentStatus(..))
import Gargantext.Components.Category (rating)
import Gargantext.Components.Category (rating)
import Gargantext.Components.Category.Types (Star(..))
import Gargantext.Components.Category.Types (Star(..))
import Gargantext.Components.DocsTable.DocumentFormCreation
(documentFormCreation)
import Gargantext.Components.DocsTable.DocumentFormCreation
as DFC
import Gargantext.Components.DocsTable.Types (DocumentsView(..), Hyperdata(..), LocalUserScore, Query, Response(..), Year, sampleData)
import Gargantext.Components.DocsTable.Types (DocumentsView(..), Hyperdata(..), LocalUserScore, Query, Response(..), Year, sampleData)
import Gargantext.Components.Nodes.Lists.Types as NT
import Gargantext.Components.Nodes.Lists.Types as NT
import Gargantext.Components.Nodes.Texts.Types as TextsT
import Gargantext.Components.Nodes.Texts.Types as TextsT
...
@@ -148,11 +149,21 @@ docViewCpt = here.component "docView" cpt where
...
@@ -148,11 +149,21 @@ docViewCpt = here.component "docView" cpt where
-- @WIP: remote business for document creation
-- @WIP: remote business for document creation
createDocumentCallback <- pure $ \fdata -> launchAff_ do
createDocumentCallback <- pure $ \fdata -> launchAff_ do
liftEffect $ T.write_ true onDocumentCreationPendingBox
--
liftEffect $ T.write_ true onDocumentCreationPendingBox
delay $ Milliseconds 2000.0
-- delay $ Milliseconds 2000.0
-- liftEffect $ T.write_ false onDocumentCreationPendingBox
liftEffect $
T.write_ true onDocumentCreationPendingBox
res <- DFC.create session nodeId fdata
liftEffect do
log2 "RESULT" res
T.write_ false onDocumentCreationPendingBox
liftEffect $ T.write_ false onDocumentCreationPendingBox
-- Render
-- Render
pure $
pure $
...
@@ -203,7 +214,7 @@ docViewCpt = here.component "docView" cpt where
...
@@ -203,7 +214,7 @@ docViewCpt = here.component "docView" cpt where
, hasCollapsibleBackground: false
, hasCollapsibleBackground: false
}
}
[
[
documentFormCreation
DFC.
documentFormCreation
{ callback: createDocumentCallback
{ callback: createDocumentCallback
, status: onDocumentCreationPending ? Deferred $ Enabled
, status: onDocumentCreationPending ? Deferred $ Enabled
}
}
...
...
src/Gargantext/Components/DocsTable/DocumentFormCreation.purs
View file @
5302939d
module Gargantext.Components.DocsTable.DocumentFormCreation
module Gargantext.Components.DocsTable.DocumentFormCreation
( documentFormCreation
( documentFormCreation
, FormData
, FormData
, create
) where
) where
import Gargantext.Prelude
import Gargantext.Prelude
...
@@ -9,11 +10,16 @@ import DOM.Simple.Console (log3)
...
@@ -9,11 +10,16 @@ import DOM.Simple.Console (log3)
import Data.Either (Either(..))
import Data.Either (Either(..))
import Data.Foldable (foldl, intercalate)
import Data.Foldable (foldl, intercalate)
import Effect (Effect)
import Effect (Effect)
import Effect.Aff (Aff)
import Gargantext.Components.Bootstrap as B
import Gargantext.Components.Bootstrap as B
import Gargantext.Components.Bootstrap.Types (ComponentStatus(..))
import Gargantext.Components.Bootstrap.Types (ComponentStatus(..))
import Gargantext.Config.REST (RESTError)
import Gargantext.Hooks.FormValidation (VForm, useFormValidation)
import Gargantext.Hooks.FormValidation (VForm, useFormValidation)
import Gargantext.Hooks.FormValidation.Unboxed as FV
import Gargantext.Hooks.FormValidation.Unboxed as FV
import Gargantext.Hooks.StateRecord (useStateRecord)
import Gargantext.Hooks.StateRecord (useStateRecord)
import Gargantext.Routes as GR
import Gargantext.Sessions (Session, post)
import Gargantext.Types as GT
import Gargantext.Utils (nbsp, (?))
import Gargantext.Utils (nbsp, (?))
import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.Reactix as R2
import Reactix as R
import Reactix as R
...
@@ -197,3 +203,13 @@ documentFormValidation r = foldl append mempty rules
...
@@ -197,3 +203,13 @@ documentFormValidation r = foldl append mempty rules
, FV.nonEmpty "source" r.source
, FV.nonEmpty "source" r.source
, FV.nonEmpty "authors" r.authors
, FV.nonEmpty "authors" r.authors
]
]
---------------------------------------------------
create ::
Session
-> GT.ID
-> Record FormData
-> Aff (Either RESTError GT.ID)
create session id = post session $ GR.NodeDocument id
src/Gargantext/Ends.purs
View file @
5302939d
...
@@ -195,7 +195,8 @@ sessionPath (R.ChartHash { chartType, listId, tabType } i) =
...
@@ -195,7 +195,8 @@ sessionPath (R.ChartHash { chartType, listId, tabType } i) =
<> "&listType=" <> show MapTerm -- listId
<> "&listType=" <> show MapTerm -- listId
<> defaultListAddMaybe listId
<> defaultListAddMaybe listId
-- sessionPath (R.NodeAPI (NodeContact s a i) i) = sessionPath $ "annuaire/" <> show a <> "/contact/" <> show i
-- sessionPath (R.NodeAPI (NodeContact s a i) i) = sessionPath $ "annuaire/" <> show a <> "/contact/" <> show i
sessionPath (R.NodeAPI Phylo pId p) = "phyloscape?nodeId=" <> (show $ fromMaybe 0 pId) <> p
sessionPath (R.NodeDocument id) = "node/" <> (show id) <> "/document/upload/async"
------- misc routing stuff
------- misc routing stuff
...
...
src/Gargantext/Routes.purs
View file @
5302939d
...
@@ -57,6 +57,7 @@ data SessionRoute
...
@@ -57,6 +57,7 @@ data SessionRoute
| CorpusMetricsHash { listId :: ListId, tabType :: TabType } (Maybe Id)
| CorpusMetricsHash { listId :: ListId, tabType :: TabType } (Maybe Id)
| Chart ChartOpts (Maybe Id)
| Chart ChartOpts (Maybe Id)
| ChartHash { chartType :: ChartType, listId :: Maybe ListId, tabType :: TabType } (Maybe Id)
| ChartHash { chartType :: ChartType, listId :: Maybe ListId, tabType :: TabType } (Maybe Id)
| NodeDocument Id
-- | AnnuaireContact AnnuaireId DocId
-- | AnnuaireContact AnnuaireId DocId
instance Show AppRoute where
instance Show AppRoute where
...
...
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