diff --git a/src/Gargantext/Components/DocsTable/Types.purs b/src/Gargantext/Components/DocsTable/Types.purs index 73932b062a604a9aefcbbf4d984a43896594e40b..d2449a5f08810bc3f047126007e2a502c25d4c4e 100644 --- a/src/Gargantext/Components/DocsTable/Types.purs +++ b/src/Gargantext/Components/DocsTable/Types.purs @@ -33,16 +33,6 @@ derive instance Generic DocumentsView _ instance Eq DocumentsView where eq = genericEq -{- -derive instance Generic DocumentsView _ -instance Show DocumentsView where - show = genericShow -instance Argonaut.DecodeJson SearchType where - decodeJson = genericSumDecodeJson -instance Argonaut.EncodeJson SearchType where - encodeJson = genericSumEncodeJson - -} - instance JSON.ReadForeign DocumentsView where readImpl f = do { id, category, date, ngramCount, score, source, title, url } :: { id :: Int | DocumentsViewT } <- JSON.readImpl f diff --git a/src/Gargantext/Components/Forest/Tree/Node/Action/Contact/Types.purs b/src/Gargantext/Components/Forest/Tree/Node/Action/Contact/Types.purs index d8f0346d889bfa94a02b24999603eb6311834672..ec1124e5bd36e5abbac011ce81587a864a517b91 100644 --- a/src/Gargantext/Components/Forest/Tree/Node/Action/Contact/Types.purs +++ b/src/Gargantext/Components/Forest/Tree/Node/Action/Contact/Types.purs @@ -6,7 +6,6 @@ import Data.Show.Generic (genericShow) import Simple.JSON as JSON import Gargantext.Prelude (class Eq, class Show) -import Gargantext.Utils.Argonaut (genericSumDecodeJson, genericSumEncodeJson) newtype AddContactParams = AddContactParams { firstname :: String, lastname :: String } diff --git a/src/Gargantext/Components/Forest/Tree/Node/Action/Link.purs b/src/Gargantext/Components/Forest/Tree/Node/Action/Link.purs index eab8716434d8fb18af0aa96fd41269db188c9fe5..91c39ce3d4a08b9c744227a9d73eb2f6420e7d94 100644 --- a/src/Gargantext/Components/Forest/Tree/Node/Action/Link.purs +++ b/src/Gargantext/Components/Forest/Tree/Node/Action/Link.purs @@ -18,7 +18,6 @@ import Gargantext.Prelude import Gargantext.Routes (SessionRoute(..)) import Gargantext.Sessions (Session, post) import Gargantext.Types as GT -import Gargantext.Utils.Argonaut (genericSumDecodeJson, genericSumEncodeJson) import Gargantext.Utils.Reactix as R2 here :: R2.Here diff --git a/src/Gargantext/Components/Forest/Tree/Node/Action/Share.purs b/src/Gargantext/Components/Forest/Tree/Node/Action/Share.purs index aae98b7322103c6365e64b40748febdc56a34ccd..6c0ede46d204b75009833795ff3b70fbc7710df6 100644 --- a/src/Gargantext/Components/Forest/Tree/Node/Action/Share.purs +++ b/src/Gargantext/Components/Forest/Tree/Node/Action/Share.purs @@ -21,7 +21,6 @@ import Gargantext.Routes as GR import Gargantext.Sessions (Session, post) import Gargantext.Types (ID) import Gargantext.Types as GT -import Gargantext.Utils.Argonaut (genericSumDecodeJson, genericSumEncodeJson) import Gargantext.Utils.Reactix as R2 here :: R2.Here diff --git a/src/Gargantext/Components/Forest/Tree/Node/Action/Update/Types.purs b/src/Gargantext/Components/Forest/Tree/Node/Action/Update/Types.purs index 97fbf24257c65d2ed98eaf1a47d6952af64147c9..46cb9801c0dd93ccb6ca8abbdf8ef438b67e641a 100644 --- a/src/Gargantext/Components/Forest/Tree/Node/Action/Update/Types.purs +++ b/src/Gargantext/Components/Forest/Tree/Node/Action/Update/Types.purs @@ -8,8 +8,6 @@ import Simple.JSON.Generics as JSONG import Gargantext.Prelude -import Gargantext.Utils.Argonaut (genericSumDecodeJson, genericSumEncodeJson, genericEnumDecodeJson, genericEnumEncodeJson) - data UpdateNodeParams = UpdateNodeParamsList { methodList :: Method } | UpdateNodeParamsGraph { methodGraph :: GraphMetric } diff --git a/src/Gargantext/Components/Nodes/Frame.purs b/src/Gargantext/Components/Nodes/Frame.purs index eb99a52f69a735738f887f5b0d81e12134fdd585..dd1842e8d49380d2ae916764d2a4d3a9ff2ae529 100644 --- a/src/Gargantext/Components/Nodes/Frame.purs +++ b/src/Gargantext/Components/Nodes/Frame.purs @@ -21,7 +21,6 @@ import Gargantext.Hooks.Loader (useLoader) import Gargantext.Routes (SessionRoute(NodeAPI)) import Gargantext.Sessions (Session, get, sessionId) import Gargantext.Types (NodeType(..)) -import Gargantext.Utils.Argonaut (genericSumEncodeJson) import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Toestand as T2 diff --git a/src/Gargantext/Components/Nodes/Home/Public.purs b/src/Gargantext/Components/Nodes/Home/Public.purs index f1a65699877630d61f87f014b5530c12a9c487e0..14fa2f007adfe148ad3ca70d9cb7e7f51ce9ae19 100644 --- a/src/Gargantext/Components/Nodes/Home/Public.purs +++ b/src/Gargantext/Components/Nodes/Home/Public.purs @@ -16,7 +16,6 @@ import Gargantext.Config.REST (get) import Gargantext.Ends (backendUrl) import Gargantext.Hooks.Loader (useLoader) import Gargantext.Prelude -import Gargantext.Utils.Argonaut (genericSumDecodeJson, genericSumEncodeJson) import Gargantext.Utils.Reactix as R2 here :: R2.Here diff --git a/src/Gargantext/Utils/DecodeMaybe.js b/src/Gargantext/Utils/DecodeMaybe.js deleted file mode 100644 index 1f88a9e0d9c03b3af2daa0127e5949016108f951..0000000000000000000000000000000000000000 --- a/src/Gargantext/Utils/DecodeMaybe.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -exports.isNull = function(v) { - return v === null; -}; diff --git a/src/Gargantext/Utils/DecodeMaybe.purs b/src/Gargantext/Utils/DecodeMaybe.purs deleted file mode 100644 index 51d6920bcddf010b28b21256f413bd807b80d3cc..0000000000000000000000000000000000000000 --- a/src/Gargantext/Utils/DecodeMaybe.purs +++ /dev/null @@ -1,27 +0,0 @@ -module Gargantext.Utils.DecodeMaybe where - -import Prelude - -import Data.Argonaut (class DecodeJson, Json, getFieldOptional) -import Data.Argonaut.Decode.Error (JsonDecodeError(..)) -import Data.Either (Either) -import Data.Maybe (Maybe(..), fromMaybe) -import Foreign.Object (Object) - -foreign import isNull :: forall a. a -> Boolean - -getFieldOptional' :: forall a. DecodeJson a => - Object Json -> String -> Either JsonDecodeError (Maybe a) -getFieldOptional' o s = (case _ of - Just v -> if isNull v then Nothing else v - Nothing -> Nothing - ) <$> (getFieldOptional o s) - -infix 7 getFieldOptional' as .?| - -getFieldOptionalAsMempty :: forall a. DecodeJson a => - Monoid a => Object Json -> String -> Either JsonDecodeError a -getFieldOptionalAsMempty o s = - fromMaybe mempty <$> (getFieldOptional' o s) - -infix 7 getFieldOptionalAsMempty as .|