Commit 5686b05c authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

[ps 0.15] this monstrocity is alive

parent bc02d207
Pipeline #3179 canceled with stage
This diff is collapsed.
<!doctype>
<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
......
<!doctype>
<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
......
......@@ -3,11 +3,10 @@
import
(
pkgs.fetchFromGitHub {
#owner = "justinwoo";
owner = "cgenie";
owner = "justinwoo";
repo = "easy-purescript-nix";
rev = "0d34a62a0bc531baa5350dc305fe56317f706be2";
sha256 = "0brdkkp60l3ggirab0zvhd7q11vk906gaxml7kmbg6gy029j7l5v";
rev = "master";
sha256 = "03g9xq451dmrkq8kiz989wnl8k0lmj60ajflz44bhp7cm08hf3bw";
}
) {
inherit pkgs;
......
......@@ -3,6 +3,6 @@
pkgs.fetchFromGitHub {
owner = "justinwoo";
repo = "psc-package-nix";
rev = "0f1f001e2ea17ad461871a1873050f6aef5f1284";
sha256 = "0gbwcvw8rvxhlg9p6avd0812y263jzim1sra5frbdi0s6q0ngsgi";
rev = "e00fdaf2a2628b6b056db12ff4a3069aa04cb536";
sha256 = "0p2cblmpma7s058r5nfwzpvdsi98qhh5isvc47052wjbmfinh8db";
}
This diff is collapsed.
......@@ -19,7 +19,6 @@
"globals",
"integers",
"js-timers",
"markdown-smolder",
"math",
"maybe",
"milkis",
......@@ -38,7 +37,6 @@
"simple-json",
"simple-json-generics",
"simplecrypto",
"smolder",
"spec-discovery",
"spec-quickcheck",
"string-parsers",
......
......@@ -15,6 +15,7 @@ to generate this file without the comments in this block.
[ "aff"
, "aff-promise"
, "affjax"
, "affjax-web"
, "argonaut"
, "argonaut-codecs"
, "argonaut-core"
......@@ -41,14 +42,14 @@ to generate this file without the comments in this block.
, "form-urlencoded"
, "formula"
, "functions"
, "globals"
, "graphql-client"
, "http-methods"
, "integers"
, "js-timers"
, "lists"
, "markdown"
, "markdown-smolder"
-- , "markdown"
, "markdown-it"
--, "markdown-smolder"
, "maybe"
, "media-types"
, "milkis"
......@@ -74,7 +75,7 @@ to generate this file without the comments in this block.
, "simple-json"
, "simple-json-generics"
, "simplecrypto"
, "smolder"
-- , "smolder"
, "strings"
, "strings-extra"
, "stringutils"
......
'use strict';
exports._show = show;
exports._hide = hide;
/**
* @function show
* @param {Window} window
* @param {string} querySelector
* @unpure {Object} window.$
*/
function show(window, querySelector) {
export function _show(window, querySelector) {
window.$(querySelector).modal('show');
}
/**
......@@ -17,7 +15,7 @@ function show(window, querySelector) {
* @param {string} querySelector
* @unpure {Object} window.$
*/
function hide(window, querySelector) {
export function _hide(window, querySelector) {
window.$(querySelector).modal('hide');
// @XXX Bootstrap not removing some modal elements on "hide" method
// @https://stackoverflow.com/questions/50168312/bootstrap-4-close-modal-backdrop-doesnt-disappear
......
'use strict';
const reactTooltip = require('react-tooltip');
import Tooltip from 'react-tooltip';
console.log('Tooltip', Tooltip);
if (typeof window !== 'undefined') {
window.ReactTooltip = reactTooltip;
window.ReactTooltip = Tooltip;
}
exports.reactTooltipCpt = reactTooltip;
export { Tooltip as reactTooltipCpt };
......@@ -7,7 +7,6 @@ module Gargantext.Components.Bootstrap.Tooltip
import Gargantext.Prelude
import ConvertableOptions as CO
import Data.Symbol (SProxy(..))
import Data.UUID as UUID
import Gargantext.Components.Bootstrap.Types (TooltipEffect(..), TooltipPosition(..), Variant(..))
import Gargantext.Utils.Reactix as R2
......@@ -15,6 +14,7 @@ import Reactix as R
import Reactix.DOM.HTML as H
import Record as Record
import Record.Extra as RX
import Type.Proxy (Proxy(..))
foreign import reactTooltipCpt :: R.Component Props
......@@ -61,20 +61,20 @@ tooltip props = R.rawCreateElement reactTooltipCpt props''
props' = CO.defaults options props
props'' = props'
# Record.set
(SProxy :: SProxy "effect")
(Proxy :: Proxy "effect")
(show props'.effect)
>>> Record.set
(SProxy :: SProxy "variant")
(Proxy :: Proxy "variant")
(show props'.variant)
>>> Record.rename
(SProxy :: SProxy "variant")
(SProxy :: SProxy "type")
(Proxy :: Proxy "variant")
(Proxy :: Proxy "type")
>>> Record.set
(SProxy :: SProxy "position")
(Proxy :: Proxy "position")
(show props'.position)
>>> Record.rename
(SProxy :: SProxy "position")
(SProxy :: SProxy "place")
(Proxy :: Proxy "position")
(Proxy :: Proxy "place")
-------------------------------------------------------------
......
......@@ -139,7 +139,8 @@ carousselCpt = here.component "caroussel" cpt
onClick c = \_-> do
setLocalCategories $ Map.insert r._id c
launchAff_ $ do
putCategories session nodeId $ CategoryQuery {nodeIds: [r._id], category: c}
_ <- putCategories session nodeId $ CategoryQuery {nodeIds: [r._id], category: c}
pure unit
icon :: Category -> Boolean -> String
icon cat b = btn b $ "fa fa-" <> (color $ size b $ icon' cat b)
......
......@@ -40,7 +40,7 @@ magenta :: Color
magenta = stringColor "magenta"
violet :: Color
violet = cssColor CSS.violet
violet = stringColor "violet"
black :: Color
black = stringColor "black"
......
"use strict";
var ReactEcharts = require("echarts-for-react");
import * as ReactEcharts from "echarts-for-react";
exports.eChartsClass = ReactEcharts.default;
let eChartsClass = ReactEcharts.default;
export { eChartsClass };
/**
* @XXX "echarts-for-react" unsuitable to proper PureScript implementation
......@@ -11,7 +12,7 @@ exports.eChartsClass = ReactEcharts.default;
* @param {function} fn
* @returns
*/
exports.listenerFn1 = function(fn) {
export function listenerFn1(fn) {
return function() {
var args = Array.prototype.slice.call(arguments);
fn(args[0])()
......@@ -24,7 +25,7 @@ exports.listenerFn1 = function(fn) {
* @param {object} opts
* @returns
*/
exports.dispatchAction = function(eChartsInstance) {
export function dispatchAction(eChartsInstance) {
return function(opts) {
return function() {
eChartsInstance.dispatchAction(opts);
......
......@@ -54,7 +54,7 @@ chartWith options =
refListener (Options { onInit }) = case onInit of
Nothing -> pure unit
Just fn -> listenerFn1 (_ # fn # execOnInit)
Just fn -> listenerFn1 (execOnInit fn)
execOnInit fn = toMaybe >>> case _ of
Nothing -> pure unit
......
......@@ -4,7 +4,6 @@ import Data.Array (foldl)
import Data.Generic.Rep (class Generic)
import Data.Maybe (Maybe(..), maybe)
import Data.Newtype (class Newtype)
import Data.Symbol (SProxy(..))
import Gargantext.Components.Charts.Options.Data (DataD1, DataD2)
import Gargantext.Components.Charts.Options.Font (ItemStyle, Tooltip)
import Gargantext.Components.Charts.Options.Legend (SelectedMode)
......@@ -13,6 +12,7 @@ import Prelude (class Eq, class Show, bind, map, pure, show, ($), (+), (<<<), (<
import Record as Record
import Record.Unsafe (unsafeSet)
import Simple.JSON as JSON
import Type.Proxy (Proxy(..))
import Unsafe.Coerce (unsafeCoerce)
......@@ -213,8 +213,8 @@ treeLeaf :: String -> Int -> TreeNode
treeLeaf n v = TreeNode { name : n, value : v, children : []}
nameP = SProxy :: SProxy "name"
labelP = SProxy :: SProxy "label"
nameP = Proxy :: Proxy "name"
labelP = Proxy :: Proxy "label"
-- | TODO
......
......@@ -11,12 +11,13 @@ import Data.String.Utils (endsWith)
import DOM.Simple.Types (Element)
import Effect (Effect)
import FFI.Simple ((.=))
import MarkdownIt (renderString)
import Reactix as R
import Reactix.DOM.HTML as H
import Text.Markdown.SlamDown.Parser (parseMd)
import Text.Markdown.SlamDown.Smolder as MD
import Text.Markdown.SlamDown.Syntax (SlamDownP)
import Text.Smolder.Renderer.String as Smolder
-- import Text.Markdown.SlamDown.Parser (parseMd)
-- import Text.Markdown.SlamDown.Smolder as MD
-- import Text.Markdown.SlamDown.Syntax (SlamDownP)
-- import Text.Smolder.Renderer.String as Smolder
import Toestand as T
import Gargantext.Prelude
......@@ -58,16 +59,18 @@ codeNlFix :: CodeType -> Code -> Code
codeNlFix _ "" = " "
codeNlFix _ c = if endsWith "\n" c then (c <> " ") else c
render :: CodeType -> Code -> Either Error Html
render Haskell code = Right $ renderHaskell $ codeNlFix Haskell code
render Python code = Right $ renderPython $ codeNlFix Python code
render JSON code = result
render :: CodeType -> Code -> Effect (Either Error Html)
render Haskell code = pure $ Right $ renderHaskell $ codeNlFix Haskell code
render Python code = pure $ Right $ renderPython $ codeNlFix Python code
render JSON code = pure result
where
parsedE = jsonParser code
result = case parsedE of
Left err -> Left err
Right parsed -> Right $ R2.stringify parsed 2
render Markdown code = Right $ renderMd $ codeNlFix Markdown code
render Markdown code = do
r <- renderMd $ codeNlFix Markdown code
pure $ Right r
previewPostProcess :: CodeType -> Element -> Effect Unit
previewPostProcess Haskell htmlEl = do
......@@ -83,13 +86,14 @@ previewPostProcess Markdown _ = pure unit
-- TODO Replace with markdown-it?
-- https://pursuit.purescript.org/packages/purescript-markdown-it
renderMd' :: forall e. MD.ToMarkupOptions e -> String -> String
renderMd' options input =
either identity (MD.toMarkup' options >>> Smolder.render)
(parseMd input :: Either String (SlamDownP String))
-- renderMd' :: forall e. MD.ToMarkupOptions e -> String -> String
-- renderMd' options input =
-- either identity (MD.toMarkup' options >>> Smolder.render)
-- (parseMd input :: Either String (SlamDownP String))
renderMd :: String -> String
renderMd = renderMd' MD.defaultToMarkupOptions
renderMd :: String -> Effect String
renderMd = renderString
--renderMd = renderMd' MD.defaultToMarkupOptions
renderHaskell :: String -> String
renderHaskell s = s
......@@ -189,7 +193,8 @@ renderHtml code codeType htmlElRef error =
case (toMaybe $ R.readRef htmlElRef) of
Nothing -> pure unit
Just htmlEl -> do
case render codeType code of
r <- render codeType code
case r of
Left err -> do
T.write_ (Just err) error
Right rendered -> do
......
......@@ -17,7 +17,6 @@ import Data.Ord.Down (Down(..))
import Data.Set (Set)
import Data.Set as Set
import Data.String as Str
import Data.Symbol (SProxy(..))
import Data.Tuple (Tuple(..))
import Data.Tuple.Nested ((/\))
import Effect (Effect)
......@@ -56,6 +55,7 @@ import Reactix.DOM.HTML as H
import Record.Extra as RX
import Simple.JSON as JSON
import Toestand as T
import Type.Proxy (Proxy(..))
here :: R2.Here
here = R2.here "Gargantext.Components.DocsTable"
......@@ -100,8 +100,8 @@ type PageLayoutProps =
| CommonProps
)
_documentIdsDeleted = prop (SProxy :: SProxy "documentIdsDeleted")
_localCategories = prop (SProxy :: SProxy "localCategories")
_documentIdsDeleted = prop (Proxy :: Proxy "documentIdsDeleted")
_localCategories = prop (Proxy :: Proxy "localCategories")
docViewLayout :: Record LayoutProps -> R.Element
docViewLayout props = R.createElement docViewLayoutCpt props []
......@@ -270,7 +270,7 @@ scanDocumentCreationProgress boxes session nodeId currentTask cbk = do
, GT.IsKilled
, GT.IsFailure
]
hasEndingStatus s = any (_ # s # eq) endingStatusList
hasEndingStatus s = any (eq s) endingStatusList
if (hasEndingStatus status)
then
......
......@@ -147,7 +147,9 @@ docViewCpt = here.component "docView" cpt
performDeletions :: Session -> Int -> T.Box Deletions -> Deletions -> Effect Unit
performDeletions session nodeId deletions deletions' = do
launchAff_ $ deleteDocuments session nodeId (DeleteDocumentQuery q)
launchAff_ $ do
_ <- deleteDocuments session nodeId (DeleteDocumentQuery q)
pure unit
T.modify_ del deletions
where
q = { documents: Set.toUnfoldable deletions'.pending }
......@@ -155,7 +157,9 @@ performDeletions session nodeId deletions deletions' = do
markCategory :: Session -> NodeID -> Category -> Array NodeID -> Effect Unit
markCategory session nodeId category nids =
void $ launchAff_ $ putCategories session nodeId (CategoryQuery q)
void $ launchAff_ $ do
_ <- putCategories session nodeId (CategoryQuery q)
pure unit
where -- TODO add array of delete rows here
q = {nodeIds: nids, category: favCategory category}
......
exports.nodeUserRegexp = /(@{1}.*).gargantext.org$/;
export const nodeUserRegexp = /(@{1}.*).gargantext.org$/;
......@@ -9,7 +9,6 @@ import Data.Array.NonEmpty as NArray
import Data.Foldable (intercalate)
import Data.Maybe (Maybe(..), maybe)
import Data.String.Regex as Regex
import Data.Symbol (SProxy(..))
import Data.Tuple.Nested ((/\))
import Effect (Effect)
import Effect.Aff (Aff, launchAff)
......@@ -44,6 +43,7 @@ import Reactix as R
import Reactix.DOM.HTML as H
import Record as Record
import Toestand as T
import Type.Proxy (Proxy(..))
-- (?) never been able to properly declare PureScript Regex...
foreign import nodeUserRegexp :: Regex.Regex
......@@ -544,7 +544,7 @@ nodeActionsCpt :: R.Component NodeActionsProps
nodeActionsCpt = here.component "nodeActions" cpt where
cpt props _ = pure (child props.nodeType)
where
nodeActionsP = SProxy :: SProxy "nodeType"
nodeActionsP = Proxy :: Proxy "nodeType"
childProps = Record.delete nodeActionsP props
......
......@@ -5,11 +5,12 @@ module Gargantext.Components.GraphExplorer.Sidebar
import Gargantext.Prelude
import Control.Parallel (parTraverse)
import Data.Array (last, mapWithIndex)
import Data.Array (last)
import Data.Array as A
import Data.Either (Either(..))
import Data.Foldable (intercalate)
import Data.Foldable as F
import Data.FunctorWithIndex (mapWithIndex)
import Data.Int (fromString)
import Data.Map as Map
import Data.Maybe (Maybe(..), fromJust)
......
......@@ -5,7 +5,8 @@ module Gargantext.Components.GraphExplorer.Toolbar.SlideButton
, mouseSelectorSizeButton
) where
import Global (readFloat)
import Data.Maybe (Maybe(..))
import Data.Number as DN
import Prelude
import Effect (Effect)
import Reactix as R
......@@ -29,7 +30,6 @@ type Props =
sizeButton :: Record Props -> R.Element
sizeButton props = R.createElement sizeButtonCpt props []
sizeButtonCpt :: R.Component Props
sizeButtonCpt = here.component "sizeButton" cpt where
cpt { state, caption, min, max, onChange } _ = do
......@@ -67,15 +67,18 @@ labelSizeButton sigmaRef state =
, max: 30.0
, onChange: \e -> do
let sigma = R.readRef sigmaRef
let newValue = readFloat $ R.unsafeEventValue e
Sigmax.dependOnSigma sigma "[labelSizeButton] sigma: Nothing" $ \s -> do
Sigma.setSettings s {
defaultLabelSize: newValue
, drawLabels: true
, maxNodeSize: newValue / 2.5
--, labelSizeRatio: newValue / 2.5
}
T.write_ newValue state
let newValue' = DN.fromString $ R.unsafeEventValue e
case newValue' of
Nothing -> pure unit
Just newValue ->
Sigmax.dependOnSigma sigma "[labelSizeButton] sigma: Nothing" $ \s -> do
Sigma.setSettings s {
defaultLabelSize: newValue
, drawLabels: true
, maxNodeSize: newValue / 2.5
--, labelSizeRatio: newValue / 2.5
}
T.write_ newValue state
}
mouseSelectorSizeButton :: R.Ref Sigmax.Sigma -> T.Box Number -> R.Element
......@@ -87,10 +90,13 @@ mouseSelectorSizeButton sigmaRef state =
, max: 50.0
, onChange: \e -> do
let sigma = R.readRef sigmaRef
let newValue = readFloat $ R.unsafeEventValue e
Sigmax.dependOnSigma sigma "[mouseSelectorSizeButton] sigma: Nothing" $ \s -> do
Sigma.setSettings s {
mouseSelectorSize: newValue
}
T.write_ newValue state
}
let newValue' = DN.fromString $ R.unsafeEventValue e
case newValue' of
Nothing -> pure unit
Just newValue ->
Sigmax.dependOnSigma sigma "[mouseSelectorSizeButton] sigma: Nothing" $ \s -> do
Sigma.setSettings s {
mouseSelectorSize: newValue
}
T.write_ newValue state
}
......@@ -9,10 +9,10 @@ import Data.Maybe (Maybe(..), fromJust)
import Data.Newtype (class Newtype)
import Data.Ord.Generic (genericCompare)
import Data.Show.Generic (genericShow)
import Data.Symbol (SProxy(..))
import Partial.Unsafe (unsafePartial)
import Record as Record
import Simple.JSON as JSON
import Type.Proxy (Proxy(..))
type GraphId = Int
......@@ -27,18 +27,18 @@ newtype Node = Node {
, y :: Number
}
x_coordP = SProxy :: SProxy "x_coord"
xP = SProxy :: SProxy "x"
y_coordP = SProxy :: SProxy "y_coord"
yP = SProxy :: SProxy "y"
clustDefaultP = SProxy :: SProxy "clustDefault"
clust_defaultP = SProxy :: SProxy "clust_default"
cameraP = SProxy :: SProxy "camera"
mCameraP = SProxy :: SProxy "mCamera"
idP = SProxy :: SProxy "id"
id_P = SProxy :: SProxy "id_"
typeP = SProxy :: SProxy "type"
type_P = SProxy :: SProxy "type_"
x_coordP = Proxy :: Proxy "x_coord"
xP = Proxy :: Proxy "x"
y_coordP = Proxy :: Proxy "y_coord"
yP = Proxy :: Proxy "y"
clustDefaultP = Proxy :: Proxy "clustDefault"
clust_defaultP = Proxy :: Proxy "clust_default"
cameraP = Proxy :: Proxy "camera"
mCameraP = Proxy :: Proxy "mCamera"
idP = Proxy :: Proxy "id"
id_P = Proxy :: Proxy "id_"
typeP = Proxy :: Proxy "type"
type_P = Proxy :: Proxy "type_"
derive instance Generic Node _
derive instance Newtype Node _
......
......@@ -4,7 +4,7 @@ module Gargantext.Components.GraphQL.AffjaxSimpleJSONClient
import Prelude
import Affjax (Error(..), Response, URL, defaultRequest, printError, request)
import Affjax.Web (Error(..), Response, URL, defaultRequest, printError, request)
import Affjax.RequestBody as RequestBody
import Affjax.RequestHeader (RequestHeader(..))
import Affjax.ResponseFormat as ResponseFormat
......@@ -21,18 +21,18 @@ import Simple.JSON as JSON
data AffjaxClient
= AffjaxClient URL (Array RequestHeader)
--
--
-- instance queryClient :: QueryClient AffjaxClient Unit Unit where
-- clientQuery _ (AffjaxClient url headers) name q vars = throwLeft =<< convertJsonResponse =<< queryPostForeign "query" url headers name q vars
-- clientMutation _ (AffjaxClient url headers) name q vars = throwLeft =<< convertJsonResponse =<< queryPostForeign "mutation" url headers name q vars
-- defQueryOpts = const unit
-- defMutationOpts = const unit
--
--
-- throwLeft :: forall r body. Either Error { body :: body | r } -> Aff body
-- throwLeft = case _ of
-- Left err -> throwError $ error $ printError err
-- Right { body } -> pure body
--
--
-- queryPostForeign ::
-- forall d.
-- JSON.WriteForeign d =>
......@@ -57,13 +57,13 @@ data AffjaxClient
-- }
-- , headers = headers <> [ ContentType applicationJSON ]
-- }
--
--
-- convertJsonResponse :: Either Error (Response String) -> Aff (Either Error (Response Json))
-- convertJsonResponse (Left err) = pure $ Left err
-- convertJsonResponse (Right res@{ body }) = pure $ case JSON.readJSON body of
-- Left err -> Left $ ResponseBodyError (DLN.head err) (res { body = unsafeToForeign body })
-- Right body' -> Right $ res { body = toJSON body' }
--
--
-- foreign import toJSON :: forall d. JSON.ReadForeign d => d -> Json
--
--
--
--
module Gargantext.Components.Login.Form where
import Prelude (Unit, bind, discard, not, notEq, pure, show, ($), (&&), (*>), (<>))
import Prelude (Unit, bind, discard, not, notEq, pure, show, unit, ($), (&&), (*>), (<>))
import Data.Either (Either(..))
import DOM.Simple.Event as DE
import Effect (Effect)
......@@ -107,13 +107,14 @@ submitForm { backend, sessions, visible } cell e = do
state <- T.read cell
launchAff_ $ do
res <- postAuthRequest backend (req state)
case res of
_ <- case res of
Left message -> liftEffect $ T.write (state { error = message }) cell
Right sess ->
liftEffect $
Sessions.change (Sessions.Login sess) sessions
*> T.write false visible
*> T.write (state { error = "" }) cell
pure unit
where
req { username, password } = AuthRequest { username, password }
......
......@@ -10,7 +10,6 @@ import Data.Generic.Rep (class Generic)
import Data.Maybe (Maybe(..), maybe, fromMaybe)
import Data.Newtype (class Newtype)
import Data.Sequence as Seq
import Data.Symbol (SProxy(..))
import Effect.Aff (launchAff_)
import Gargantext.Components.NgramsTable.Loader (clearCache)
import Gargantext.Components.Nodes.Annuaire.User.Contacts.Types as CT
......@@ -30,6 +29,7 @@ import Reactix.DOM.HTML as H
import Record as Record
import Simple.JSON as JSON
import Toestand as T
import Type.Proxy (Proxy(..))
here :: R2.Here
here = R2.here "Gargantext.Components.Nodes.Annuaire"
......@@ -150,7 +150,7 @@ pageLayoutCpt = here.component "pageLayout" cpt
where
errorHandler = logRESTError here "[pageLayout]"
type PageProps =
type PageProps =
( frontends :: Frontends
, pagePath :: T.Box PagePath
-- , info :: AnnuaireInfo
......@@ -263,10 +263,10 @@ instance JSON.ReadForeign AnnuaireInfo where
inst <- JSON.readImpl f
pure $ AnnuaireInfo $ Record.rename user_idP userIdP $ Record.rename parent_idP parentIdP inst
where
user_idP = SProxy :: SProxy "user_id"
userIdP = SProxy :: SProxy "userId"
parent_idP = SProxy :: SProxy "parent_id"
parentIdP = SProxy :: SProxy "parentId"
user_idP = Proxy :: Proxy "user_id"
userIdP = Proxy :: Proxy "userId"
parent_idP = Proxy :: Proxy "parent_id"
parentIdP = Proxy :: Proxy "parentId"
--newtype AnnuaireTable = AnnuaireTable { annuaireTable :: Array (Maybe Contact)}
......@@ -292,4 +292,3 @@ loadPage session {nodeId, params: { offset, limit }} =
getAnnuaireInfo :: Session -> Int -> AffRESTError AnnuaireInfo
getAnnuaireInfo session id = get session (NodeAPI Node (Just id) "")
......@@ -7,9 +7,9 @@ import Data.Lens (Lens', lens)
import Data.Maybe (Maybe(..), fromMaybe)
import Data.Newtype (class Newtype)
import Data.String as S
import Data.Symbol (SProxy(..))
import Record as Record
import Simple.JSON as JSON
import Type.Proxy (Proxy(..))
import Gargantext.Prelude (class Eq, bind, pure, ($))
......@@ -32,7 +32,7 @@ instance JSON.ReadForeign NodeContact where
readImpl f = do
inst <- JSON.readImpl f
pure $ NodeContact $ Record.rename parent_idP parentIdP $ Record.rename user_idP userIdP inst
----------------------------------------------------------------------------
newtype Contact' =
......@@ -347,8 +347,8 @@ _phone = lens getter setter
where
getter (ContactTouch {phone}) = fromMaybe "" phone
setter (ContactTouch ct) val = ContactTouch $ ct { phone = Just val }