Commit 2bd26184 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[FIX] warnings

parent ce6fac2b
...@@ -7,14 +7,20 @@ import Data.Generic.Rep.Show (genericShow) ...@@ -7,14 +7,20 @@ import Data.Generic.Rep.Show (genericShow)
import Data.Maybe (Maybe(..)) import Data.Maybe (Maybe(..))
import Data.Newtype (class Newtype) import Data.Newtype (class Newtype)
import Effect.Aff (Aff) import Effect.Aff (Aff)
import Prelude hiding (div) import Gargantext.Prelude
import Gargantext.Components.Lang (Lang) import Gargantext.Components.Lang (Lang)
import Gargantext.Routes (SessionRoute(..)) import Gargantext.Routes (SessionRoute(..))
import Gargantext.Sessions (Session, get, put, post, delete)
import Gargantext.Routes as GR import Gargantext.Routes as GR
import Gargantext.Sessions (Session, get, put, post, delete)
import Gargantext.Types as GT import Gargantext.Types as GT
type Props =
( dispatch :: Action -> Aff Unit
, id :: Int
, nodeType :: GT.NodeType
, session :: Session
)
data Action = AddNode String GT.NodeType data Action = AddNode String GT.NodeType
| DeleteNode | DeleteNode
| UpdateNode GT.AsyncTaskWithType | UpdateNode GT.AsyncTaskWithType
...@@ -24,7 +30,6 @@ data Action = AddNode String GT.NodeType ...@@ -24,7 +30,6 @@ data Action = AddNode String GT.NodeType
| RefreshTree | RefreshTree
| ShareNode String | ShareNode String
instance showShow :: Show Action where instance showShow :: Show Action where
show DeleteNode = "DeleteNode" show DeleteNode = "DeleteNode"
show RefreshTree = "RefreshTree" show RefreshTree = "RefreshTree"
...@@ -35,12 +40,7 @@ instance showShow :: Show Action where ...@@ -35,12 +40,7 @@ instance showShow :: Show Action where
show (AddNode _ _) = "AddNode" show (AddNode _ _) = "AddNode"
show (UploadFile _ _ _ _)= "UploadFile" show (UploadFile _ _ _ _)= "UploadFile"
-----------------------------------------------------
-- TODO Delete with asyncTaskWithType
deleteNode :: Session -> GT.ID -> Aff GT.ID
deleteNode session nodeId = delete session $ NodeAPI GT.Node (Just nodeId) ""
----------------------------------------------------------------------- -----------------------------------------------------------------------
icon :: Action -> String icon :: Action -> String
icon DeleteNode = "trash" icon DeleteNode = "trash"
icon (AddNode _ _) = "plus" icon (AddNode _ _) = "plus"
...@@ -57,15 +57,11 @@ text RefreshTree = "Refresh Tree !" ...@@ -57,15 +57,11 @@ text RefreshTree = "Refresh Tree !"
text (ShareNode _) = "Share !" text (ShareNode _) = "Share !"
----------------------------------------------------------------------- -----------------------------------------------------------------------
-- TODO move code below elsewhere
type Props = -- TODO Delete with asyncTaskWithType
( dispatch :: Action -> Aff Unit deleteNode :: Session -> GT.ID -> Aff GT.ID
, id :: Int deleteNode session nodeId = delete session $ NodeAPI GT.Node (Just nodeId) ""
, nodeType :: GT.NodeType
, session :: Session
)
-- TODO remove these types from here
data FileType = CSV | CSV_HAL | WOS | PresseRIS data FileType = CSV | CSV_HAL | WOS | PresseRIS
...@@ -77,6 +73,4 @@ instance eqFileType :: Eq FileType where ...@@ -77,6 +73,4 @@ instance eqFileType :: Eq FileType where
instance showFileType :: Show FileType where instance showFileType :: Show FileType where
show = genericShow show = genericShow
newtype UploadFileContents = UploadFileContents String newtype UploadFileContents = UploadFileContents String
module Gargantext.Components.Forest.Tree.Node.Action.Add where module Gargantext.Components.Forest.Tree.Node.Action.Add where
import Data.Argonaut (class EncodeJson, jsonEmptyObject, (:=), (~>))
import Data.Array (length, head) import Data.Array (length, head)
import Data.Argonaut (class DecodeJson, class EncodeJson, decodeJson, jsonEmptyObject, (.:), (:=), (~>))
import Data.Maybe (Maybe(..), fromMaybe) import Data.Maybe (Maybe(..), fromMaybe)
-- import Data.Newtype (class Newtype)
import Data.Tuple.Nested ((/\)) import Data.Tuple.Nested ((/\))
import Effect.Aff (Aff, launchAff) import Effect.Aff (Aff, launchAff)
import Effect.Uncurried (mkEffectFn1) import Effect.Uncurried (mkEffectFn1)
import Gargantext.Components.Forest.Tree.Node.Action (Action(..))
import Gargantext.Components.Forest.Tree.Node (SettingsBox(..), settingsBox) import Gargantext.Components.Forest.Tree.Node (SettingsBox(..), settingsBox)
import Gargantext.Components.Forest.Tree.Node.Action (Action(..))
import Gargantext.Components.Forest.Tree.Node.Tools (submitButton) import Gargantext.Components.Forest.Tree.Node.Tools (submitButton)
import Gargantext.Types (NodeType(..), readNodeType)
import Gargantext.Utils.Reactix as R2
import Gargantext.Sessions (Session, post)
import Gargantext.Routes as GR import Gargantext.Routes as GR
import Gargantext.Sessions (Session, post)
import Gargantext.Types as GT import Gargantext.Types as GT
import Gargantext.Types (NodeType(..), readNodeType)
import Gargantext.Utils.Reactix as R2
import Prelude (Unit, bind, const, discard, map, pure, show, ($), (<>), (>), (<<<)) import Prelude (Unit, bind, const, discard, map, pure, show, ($), (<>), (>), (<<<))
import Reactix as R import Reactix as R
import Reactix.DOM.HTML as H import Reactix.DOM.HTML as H
......
module Gargantext.Components.Forest.Tree.Node.Action.CopyFrom where module Gargantext.Components.Forest.Tree.Node.Action.CopyFrom where
import Data.Array as A
import Data.Maybe (Maybe(..), fromJust)
import Data.Newtype (class Newtype)
import Data.Tuple (Tuple(..))
import Data.Tuple.Nested ((/\))
import DOM.Simple.Console (log2) import DOM.Simple.Console (log2)
import Effect.Aff (Aff, launchAff) import Data.Array as A
import Effect.Class (liftEffect) import Data.Maybe (Maybe(..))
import Effect (Effect) import Effect.Aff (Aff)
import Partial.Unsafe (unsafePartial) import Gargantext.Components.Forest.Tree.Node.Action (Props)
import React.SyntheticEvent as E import Gargantext.Components.Forest.Tree.Node.FTree (FTree, LNode(..), NTree(..))
import Reactix as R
import Reactix.DOM.HTML as H
import URI.Extra.QueryPairs as QP
import Web.File.FileReader.Aff (readAsText)
import Gargantext.Prelude (class Show, Unit, bind, const, discard, map, pure, show, unit, void, ($), (&&), (/=), (<>), id)
import Gargantext.Components.Lang (readLang, Lang(..))
import Gargantext.Components.Forest.Tree.Node.Action (Action(..), Props)
import Gargantext.Components.Forest.Tree.Node.FTree (FTree, ID, LNode(..), NTree(..))
import Gargantext.Hooks.Loader (useLoader) import Gargantext.Hooks.Loader (useLoader)
import Gargantext.Prelude (discard, map, pure, show, unit, ($), (&&), (/=), (<>))
import Gargantext.Routes as GR import Gargantext.Routes as GR
import Gargantext.Sessions (Session(..), postWwwUrlencoded, get) import Gargantext.Sessions (Session(..), get)
import Gargantext.Types as GT import Gargantext.Types as GT
import Gargantext.Utils.Reactix as R2 import Reactix as R
import Reactix.DOM.HTML as H
loadNode :: Session -> GT.ID -> Aff FTree loadNode :: Session -> GT.ID -> Aff FTree
......
module Gargantext.Components.Forest.Tree.Node.Action.Upload where module Gargantext.Components.Forest.Tree.Node.Action.Upload where
import Data.Array as A
import Data.Maybe (Maybe(..), fromJust) import Data.Maybe (Maybe(..), fromJust)
import Data.Newtype (class Newtype) import Data.Newtype (class Newtype)
import Data.Tuple (Tuple(..)) import Data.Tuple (Tuple(..))
import Data.Tuple.Nested ((/\)) import Data.Tuple.Nested ((/\))
import DOM.Simple.Console (log2) import Effect (Effect)
import Effect.Aff (Aff, launchAff) import Effect.Aff (Aff, launchAff)
import Effect.Class (liftEffect) import Effect.Class (liftEffect)
import Effect (Effect) import Gargantext.Components.Forest.Tree.Node.Action (Action(..), Props, FileType(..), UploadFileContents(..))
import Gargantext.Components.Lang (readLang, Lang(..))
import Gargantext.Prelude (class Show, Unit, discard, bind, const, id, map, pure, show, unit, void, ($))
import Gargantext.Routes as GR
import Gargantext.Sessions (Session, postWwwUrlencoded)
import Gargantext.Types as GT
import Gargantext.Types (ID)
import Gargantext.Utils.Reactix as R2
import Partial.Unsafe (unsafePartial) import Partial.Unsafe (unsafePartial)
import React.SyntheticEvent as E import React.SyntheticEvent as E
import Reactix as R import Reactix as R
...@@ -16,17 +22,6 @@ import Reactix.DOM.HTML as H ...@@ -16,17 +22,6 @@ import Reactix.DOM.HTML as H
import URI.Extra.QueryPairs as QP import URI.Extra.QueryPairs as QP
import Web.File.FileReader.Aff (readAsText) import Web.File.FileReader.Aff (readAsText)
import Gargantext.Prelude (class Show, Unit, bind, const, discard, map, pure, show, unit, void, ($), (&&), (/=), (<>), id)
import Gargantext.Components.Lang (readLang, Lang(..))
import Gargantext.Components.Forest.Tree.Node.Action (Action(..), Props, FileType(..), UploadFileContents(..))
import Gargantext.Components.Forest.Tree.Node.FTree (FTree, ID, LNode(..), NTree(..))
import Gargantext.Hooks.Loader (useLoader)
import Gargantext.Routes as GR
import Gargantext.Sessions (Session(..), postWwwUrlencoded, get)
import Gargantext.Types as GT
import Gargantext.Utils.Reactix as R2
-- UploadFile Action -- UploadFile Action
-- file upload types -- file upload types
data DroppedFile = data DroppedFile =
......
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