Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
purescript-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Grégoire Locqueville
purescript-gargantext
Commits
4aeb7376
Commit
4aeb7376
authored
Nov 09, 2021
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[graphql] some cleanup in Contact.purs
parent
123756dd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
9 deletions
+2
-9
Contact.purs
src/Gargantext/Components/Nodes/Annuaire/User/Contact.purs
+2
-9
No files found.
src/Gargantext/Components/Nodes/Annuaire/User/Contact.purs
View file @
4aeb7376
...
@@ -154,20 +154,17 @@ itemEditingCpt :: R.Component ItemProps
...
@@ -154,20 +154,17 @@ itemEditingCpt :: R.Component ItemProps
itemEditingCpt = here.component "itemNotEditing" cpt where
itemEditingCpt = here.component "itemNotEditing" cpt where
cpt { defaultVal, isEditing, lens, onUpdateUserInfo, userInfo, valueBox } _ = do
cpt { defaultVal, isEditing, lens, onUpdateUserInfo, userInfo, valueBox } _ = do
valueBox' <- T.useLive T.unequal valueBox
valueBox' <- T.useLive T.unequal valueBox
pure $ H.div { className: "input-group col-sm-6" }
pure $ H.div { className: "input-group col-sm-6" }
[ inputWithEnter
[ inputWithEnter
{ autoFocus: true
{ autoFocus: true
, className: "form-control"
, className: "form-control"
, defaultValue: valueBox'
, defaultValue: valueBox'
--, defaultValue: R.readRef valueRef
, onBlur: \v -> T.write_ v valueBox
, onBlur: \v -> T.write_ v valueBox
--, onBlur: R.setRef valueRef
, onEnter: click
, onEnter: click
, onValueChanged: \v -> do
, onValueChanged: \v -> do
here.log2 "[itemEditingCpt] value Changed: " v
here.log2 "[itemEditingCpt] value Changed: " v
T.write_ v valueBox
T.write_ v valueBox
--, onValueChanged: R.setRef valueRef
, placeholder: defaultVal
, placeholder: defaultVal
, type: "text" }
, type: "text" }
, H.div { className: "btn input-group-append", on: { click } }
, H.div { className: "btn input-group-append", on: { click } }
...
@@ -177,7 +174,6 @@ itemEditingCpt = here.component "itemNotEditing" cpt where
...
@@ -177,7 +174,6 @@ itemEditingCpt = here.component "itemNotEditing" cpt where
cLens = L.cloneLens lens
cLens = L.cloneLens lens
click _ = do
click _ = do
T.write_ false isEditing
T.write_ false isEditing
--let newUserInfo = (L.over cLens (\_ -> R.readRef valueRef) userInfo) :: UserInfo
value <- T.read valueBox
value <- T.read valueBox
here.log2 "[itemEditing] value" value
here.log2 "[itemEditing] value" value
let newUserInfo = (L.set cLens value userInfo) :: UserInfo
let newUserInfo = (L.set cLens value userInfo) :: UserInfo
...
@@ -203,8 +199,6 @@ saveContactHyperdata session id = put session (Routes.NodeAPI Node (Just id) "")
...
@@ -203,8 +199,6 @@ saveContactHyperdata session id = put session (Routes.NodeAPI Node (Just id) "")
saveUserInfo :: Session -> Int -> UserInfo -> Aff (Either RESTError Int)
saveUserInfo :: Session -> Int -> UserInfo -> Aff (Either RESTError Int)
saveUserInfo session id ui = do
saveUserInfo session id ui = do
-- TODO GraphQL
-- pure $ Left $ CustomError "TODO implement graphql for saveUserInfo"
client <- liftEffect $ getClient session
client <- liftEffect $ getClient session
res <- mutationOpts
res <- mutationOpts
(\m -> m)
(\m -> m)
...
@@ -221,8 +215,7 @@ saveUserInfo session id ui = do
...
@@ -221,8 +215,7 @@ saveUserInfo session id ui = do
, ui_cwRole: ga ui.ui_cwRole
, ui_cwRole: ga ui.ui_cwRole
, ui_cwTouchPhone: ga ui.ui_cwTouchPhone
, ui_cwTouchPhone: ga ui.ui_cwTouchPhone
, ui_cwTouchMail: ga ui.ui_cwTouchMail } }
, ui_cwTouchMail: ga ui.ui_cwTouchMail } }
liftEffect $ here.log2 "[saveUserInfo] res" res
pure $ Right res.update_user_info
pure $ Right 0
where
where
ga Nothing = ArgL IgnoreArg
ga Nothing = ArgL IgnoreArg
ga (Just val) = ArgR val
ga (Just val) = ArgR val
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment