Commit 7919a363 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[Merge]

parents fd100074 7ceb40ec
......@@ -101,20 +101,30 @@ let additions =
, repo = "https://github.com/purescript-contrib/purescript-precise"
, version = "v4.0.0"
}
{- , reactix =
, reactix =
{ dependencies =
[ "aff"
, "arrays"
, "dom-simple"
, "effect"
, "ffi-simple"
, "foldable-traversable"
, "functions"
, "maybe"
, "nullable"
, "prelude"
, "psci-support"
, "refs"
, "spec"
, "spec-mocha"
, "strings"
, "tuples"
, "unfoldable"
, "unsafe-coerce"
]
, repo = "https://github.com/irresponsible/purescript-reactix"
, version = "v0.4.11"
} -}
, version = "v0.4.12"
}
, simple-json-generics =
{ dependencies =
[ "simple-json" ]
......@@ -172,8 +182,8 @@ let additions =
}
}
let localPackages = {
reactix = ../../purescript-reactix/spago.dhall as Location
}
--let localPackages = {
-- reactix = ../../purescript-reactix/spago.dhall as Location
-- }
in upstream // overrides // additions // localPackages
in upstream // overrides // additions -- // localPackages
......@@ -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
......
......@@ -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 }
......
......@@ -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
......
......@@ -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
......
......@@ -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 }
......
......@@ -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
......
......@@ -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
......
module Gargantext.Types where
import Data.Array as A
import Data.Generic.Rep (class Generic)
import Data.Eq.Generic (genericEq)
import Data.Ord.Generic (genericCompare)
import Data.Show.Generic (genericShow)
import Data.Generic.Rep (class Generic)
import Data.Int (toNumber)
import Data.Maybe (Maybe(..), fromMaybe, maybe)
import Data.Newtype (class Newtype)
import Data.Ord.Generic (genericCompare)
import Data.Show.Generic (genericShow)
import Data.String as S
import Effect.Aff (Aff)
import Foreign as F
import Gargantext.Components.Lang (class Translate, Lang(..))
import Gargantext.Prelude
import Gargantext.Utils.Glyphicon (classNamePrefix, glyphiconToCharCode)
import Prim.Row (class Union)
import Reactix as R
import Simple.JSON as JSON
import Simple.JSON.Generics as JSONG
import URI.Query (Query)
import Gargantext.Prelude
import Gargantext.Components.Lang (class Translate, Lang(..))
import Gargantext.Utils.Glyphicon (classNamePrefix, glyphiconToCharCode)
data Handed = LeftHanded | RightHanded
switchHanded :: forall a. a -> a -> Handed -> a
......
'use strict';
exports.isNull = function(v) {
return v === null;
};
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 .|
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