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
ebcacb43
Commit
ebcacb43
authored
Dec 02, 2021
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[graphql] remove ethercalc endpoint, use previous frame calc upload
parent
6bae5166
Pipeline
#2196
failed with stage
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
85 deletions
+5
-85
GraphQL.purs
src/Gargantext/Components/GraphQL.purs
+2
-6
Endpoints.purs
src/Gargantext/Components/GraphQL/Endpoints.purs
+1
-22
Node.purs
src/Gargantext/Components/GraphQL/Node.purs
+0
-4
Frame.purs
src/Gargantext/Components/Nodes/Frame.purs
+2
-53
No files found.
src/Gargantext/Components/GraphQL.purs
View file @
ebcacb43
...
...
@@ -6,13 +6,11 @@ import Affjax.RequestHeader as ARH
import Data.Argonaut.Decode (JsonDecodeError)
import Data.Bifunctor (lmap)
import Data.List.Types (NonEmptyList)
import Data.Maybe (Maybe)
import Effect (Effect)
import Effect.Aff (Aff)
import Effect.Class (liftEffect)
import Foreign (unsafeToForeign, ForeignError)
import Gargantext.Components.GraphQL.Node (Node, EthercalcCSVDownloadM)
import Gargantext.Components.GraphQL.Task as GQT
import Gargantext.Components.GraphQL.Node (Node)
import Gargantext.Components.GraphQL.User (User, UserInfo, UserInfoM)
import Gargantext.Sessions (Session(..))
import Gargantext.Utils.Reactix as R2
...
...
@@ -74,6 +72,4 @@ type Schema
}
type Mutation
= { ethercalc_csv_download :: EthercalcCSVDownloadM ==> { a :: Int } --Maybe GQT.AsyncTaskWithType
-- ethercalc_csv_download :: EthercalcCSVDownloadM ==> Int
, update_user_info :: UserInfoM ==> Int }
= { update_user_info :: UserInfoM ==> Int }
src/Gargantext/Components/GraphQL/Endpoints.purs
View file @
ebcacb43
...
...
@@ -16,7 +16,7 @@ import Gargantext.Config.REST (AffRESTError, RESTError(..))
import Gargantext.Sessions (Session)
import Gargantext.Types (AsyncTaskWithType(..), AsyncTask(..), AsyncTaskType(..), NodeType)
import Gargantext.Utils.Reactix as R2
import GraphQL.Client.Args (onlyArgs)
import GraphQL.Client.Args (onlyArgs
, (=>>)
)
import GraphQL.Client.Query (mutation)
import GraphQL.Client.Variables (withVars)
import Simple.JSON as JSON
...
...
@@ -41,24 +41,3 @@ getUserInfo session id = do
-- NOTE Contact is at G.C.N.A.U.C.Types
Just ui -> Right ui
triggerEthercalcCSVDownload :: Session -> Int -> Int -> Aff (Maybe AsyncTaskWithType)
triggerEthercalcCSVDownload session corpusId nodeId = do
client <- liftEffect $ getClient session
res <- mutation
client
"trigger ethercalc CSV download"
{ ethercalc_csv_download: onlyArgs { corpusId
, nodeId } }
pure Nothing
-- pure $ case res.ethercalc_csv_download of
-- Nothing -> Nothing
-- Just { task: { id, status }, typ } ->
-- case JSON.readJSON typ of
-- Left _ -> Nothing
-- Right typ_ ->
-- case JSON.readJSON status of
-- Left _ -> Nothing
-- Right status_ ->
-- Just $ AsyncTaskWithType { task: AsyncTask { id, status: status_ }
-- , typ: typ_ }
src/Gargantext/Components/GraphQL/Node.purs
View file @
ebcacb43
...
...
@@ -26,7 +26,3 @@ nodeParentQuery = { node_parent: { node_id: Var :: _ "id" Int
, parent_id: unit
, type_id: unit }
}
type EthercalcCSVDownloadM
= { corpusId :: Int
, nodeId :: Int }
src/Gargantext/Components/Nodes/Frame.purs
View file @
ebcacb43
...
...
@@ -3,29 +3,19 @@ module Gargantext.Components.Nodes.Frame where
import Gargantext.Prelude
import DOM.Simple as DOM
import Data.Array as A
import Data.Either (Either(..))
import Data.Eq.Generic (genericEq)
import Data.Generic.Rep (class Generic)
import Data.Maybe (Maybe(..))
import Data.Newtype (class Newtype)
import Data.Nullable (Nullable, null, toMaybe)
import Data.Show.Generic (genericShow)
import Data.Tuple (Tuple(..))
import Effect.Aff (launchAff_)
import Effect.Class (liftEffect)
import Gargantext.Components.FolderView as FV
import Gargantext.Components.Forest.Tree.Node.Action.Upload.Types (FileType(..))
import Gargantext.Components.GraphQL.Endpoints (getNodeParent, triggerEthercalcCSVDownload)
import Gargantext.Components.Node (NodePoly(..))
import Gargantext.Config.REST (
RESTError,
AffRESTError, logRESTError)
import Gargantext.Config.REST (AffRESTError, logRESTError)
import Gargantext.Hooks.Loader (useLoader)
import Gargantext.Routes (SessionRoute(NodeAPI))
import Gargantext.Routes as GR
import Gargantext.Sessions (Session, get, postWwwUrlencoded, sessionId)
import Gargantext.Sessions (Session, get, sessionId)
import Gargantext.Types (NodeType(..))
import Gargantext.Types as GT
import Gargantext.Utils.EtherCalc as EC
import Gargantext.Utils.JitsiMeet as JM
import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.Toestand as T2
...
...
@@ -116,7 +106,6 @@ frameLayoutViewCpt = here.component "frameLayoutView" cpt
_ ->
pure $ H.div{}
[ FV.backButton {} []
, importIntoListButton { hyperdata: h, nodeId, session } []
, H.div { className : "frame"
, rows: "100%,*" }
[ -- H.script { src: "https://visio.gargantext.org/external_api.js"} [],
...
...
@@ -127,46 +116,6 @@ frameLayoutViewCpt = here.component "frameLayoutView" cpt
]
]
type ImportIntoListButtonProps =
( hyperdata :: Hyperdata
, nodeId :: Int
, session :: Session )
importIntoListButton :: R2.Component ImportIntoListButtonProps
importIntoListButton = R.createElement importIntoListButtonCpt
importIntoListButtonCpt :: R.Component ImportIntoListButtonProps
importIntoListButtonCpt = here.component "importIntoListButton" cpt where
cpt { hyperdata: Hyperdata { base, frame_id }
, nodeId
, session } _ = do
pure $ H.div { className: "btn btn-default"
, on: { click: onClick } }
[ H.text $ "Import into list" ]
where
onClick _ = do
let url = base <> "/" <> frame_id
--task = GT.AsyncTaskWithType { task, typ: GT.ListCSVUpload }
launchAff_ $ do
-- Get corpus_id
corpusNodes <- getNodeParent session nodeId Corpus
case A.uncons corpusNodes of
Nothing -> liftEffect $ here.log2 "[importIntoListButton] corpusNodes empty" corpusNodes
Just { head: corpusNode } -> do
-- Use that corpus id
_ <- triggerEthercalcCSVDownload session corpusNode.id nodeId
-- eCsv <- EC.downloadCSV base frame_id
-- case eCsv of
-- Left err -> liftEffect $ here.log2 "[importIntoListButton] error with csv" err
-- Right csv -> do
-- let uploadPath = GR.NodeAPI NodeList (Just corpusNode.id) $ GT.asyncTaskTypePath GT.ListCSVUpload
-- eTask :: Either RESTError GT.AsyncTaskWithType <- postWwwUrlencoded
-- session
-- uploadPath
-- [ Tuple "_wf_data" (Just csv.body)
-- , Tuple "_wf_filetype" (Just $ show CSV)
-- , Tuple "_wf_name" (Just frame_id) ]
pure unit
type NodeFrameVisioProps =
( frame_id :: String
, reload :: T2.ReloadS
...
...
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