Commit 6bae5166 authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

[graphql] ethercalc csv download endpoint commented so that it compiles

parent ad1307fb
module Gargantext.Components.GraphQL where module Gargantext.Components.GraphQL where
import Gargantext.Prelude
import Affjax.RequestHeader as ARH import Affjax.RequestHeader as ARH
import Data.Argonaut.Decode (JsonDecodeError) import Data.Argonaut.Decode (JsonDecodeError)
import Data.Bifunctor (lmap) import Data.Bifunctor (lmap)
...@@ -9,10 +11,9 @@ import Effect (Effect) ...@@ -9,10 +11,9 @@ import Effect (Effect)
import Effect.Aff (Aff) import Effect.Aff (Aff)
import Effect.Class (liftEffect) import Effect.Class (liftEffect)
import Foreign (unsafeToForeign, ForeignError) import Foreign (unsafeToForeign, ForeignError)
import Gargantext.Components.GraphQL.Node (EthercalcCSVDownloadM, Node) import Gargantext.Components.GraphQL.Node (Node, EthercalcCSVDownloadM)
import Gargantext.Components.GraphQL.User (User, UserInfo, UserInfoM)
import Gargantext.Components.GraphQL.Task as GQT import Gargantext.Components.GraphQL.Task as GQT
import Gargantext.Prelude import Gargantext.Components.GraphQL.User (User, UserInfo, UserInfoM)
import Gargantext.Sessions (Session(..)) import Gargantext.Sessions (Session(..))
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
import GraphQL.Client.Args (type (==>)) import GraphQL.Client.Args (type (==>))
...@@ -73,5 +74,6 @@ type Schema ...@@ -73,5 +74,6 @@ type Schema
} }
type Mutation type Mutation
= { ethercalc_csv_download :: EthercalcCSVDownloadM ==> Maybe GQT.AsyncTaskWithType = { ethercalc_csv_download :: EthercalcCSVDownloadM ==> { a :: Int } --Maybe GQT.AsyncTaskWithType
-- ethercalc_csv_download :: EthercalcCSVDownloadM ==> Int
, update_user_info :: UserInfoM ==> Int } , update_user_info :: UserInfoM ==> Int }
...@@ -11,6 +11,7 @@ import Data.Unit (unit) ...@@ -11,6 +11,7 @@ import Data.Unit (unit)
import Effect.Aff (Aff) import Effect.Aff (Aff)
import Effect.Class (liftEffect) import Effect.Class (liftEffect)
import Gargantext.Components.GraphQL (getClient, queryGql) import Gargantext.Components.GraphQL (getClient, queryGql)
import Gargantext.Components.GraphQL.Task as GQLT
import Gargantext.Config.REST (AffRESTError, RESTError(..)) import Gargantext.Config.REST (AffRESTError, RESTError(..))
import Gargantext.Sessions (Session) import Gargantext.Sessions (Session)
import Gargantext.Types (AsyncTaskWithType(..), AsyncTask(..), AsyncTaskType(..), NodeType) import Gargantext.Types (AsyncTaskWithType(..), AsyncTask(..), AsyncTaskType(..), NodeType)
...@@ -60,4 +61,4 @@ triggerEthercalcCSVDownload session corpusId nodeId = do ...@@ -60,4 +61,4 @@ triggerEthercalcCSVDownload session corpusId nodeId = do
-- Right status_ -> -- Right status_ ->
-- Just $ AsyncTaskWithType { task: AsyncTask { id, status: status_ } -- Just $ AsyncTaskWithType { task: AsyncTask { id, status: status_ }
-- , typ: typ_ } -- , typ: typ_ }
--
...@@ -7,10 +7,9 @@ module Gargantext.Components.Nodes.Annuaire.User.Contact ...@@ -7,10 +7,9 @@ module Gargantext.Components.Nodes.Annuaire.User.Contact
, saveUserInfo , saveUserInfo
) where ) where
import Gargantext.Components.GraphQL.User import Gargantext.Components.GraphQL.User (UserInfo, _ui_cwCity, _ui_cwCountry, _ui_cwFirstName, _ui_cwLabTeamDeptsFirst, _ui_cwLastName, _ui_cwOffice, _ui_cwOrganizationFirst, _ui_cwRole, _ui_cwTouchMail, _ui_cwTouchPhone)
import Gargantext.Prelude import Gargantext.Prelude (Unit, bind, discard, pure, show, ($), (<$>), (<>))
import Data.Array as A
import Data.Either (Either(..)) import Data.Either (Either(..))
import Data.Lens as L import Data.Lens as L
import Data.Maybe (Maybe(..), fromMaybe) import Data.Maybe (Maybe(..), fromMaybe)
......
...@@ -153,7 +153,7 @@ importIntoListButtonCpt = here.component "importIntoListButton" cpt where ...@@ -153,7 +153,7 @@ importIntoListButtonCpt = here.component "importIntoListButton" cpt where
Nothing -> liftEffect $ here.log2 "[importIntoListButton] corpusNodes empty" corpusNodes Nothing -> liftEffect $ here.log2 "[importIntoListButton] corpusNodes empty" corpusNodes
Just { head: corpusNode } -> do Just { head: corpusNode } -> do
-- Use that corpus id -- Use that corpus id
triggerEthercalcCSVDownload session corpusNode.id nodeId _ <- triggerEthercalcCSVDownload session corpusNode.id nodeId
-- eCsv <- EC.downloadCSV base frame_id -- eCsv <- EC.downloadCSV base frame_id
-- case eCsv of -- case eCsv of
-- Left err -> liftEffect $ here.log2 "[importIntoListButton] error with csv" err -- Left err -> liftEffect $ here.log2 "[importIntoListButton] error with csv" err
...@@ -165,7 +165,7 @@ importIntoListButtonCpt = here.component "importIntoListButton" cpt where ...@@ -165,7 +165,7 @@ importIntoListButtonCpt = here.component "importIntoListButton" cpt where
-- [ Tuple "_wf_data" (Just csv.body) -- [ Tuple "_wf_data" (Just csv.body)
-- , Tuple "_wf_filetype" (Just $ show CSV) -- , Tuple "_wf_filetype" (Just $ show CSV)
-- , Tuple "_wf_name" (Just frame_id) ] -- , Tuple "_wf_name" (Just frame_id) ]
pure unit pure unit
type NodeFrameVisioProps = type NodeFrameVisioProps =
( frame_id :: String ( frame_id :: String
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment