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
466f3e38
Commit
466f3e38
authored
Dec 12, 2018
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[UserPage][Contact/Page] Empty default info if nothing (still fix needed for Role).
parent
f28c0a8b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
Specs.purs
src/Gargantext/Pages/Annuaire/User/Contacts/Specs.purs
+8
-7
No files found.
src/Gargantext/Pages/Annuaire/User/Contacts/Specs.purs
View file @
466f3e38
...
...
@@ -69,7 +69,8 @@ getLastName' = fromMaybe "Empty last name" <<< _.lastName <<< unwrap
-- TODO factor below
getRole :: Array ContactWhere -> String
getRole obj = joinWith ", " $ getRole' <$> obj
getRole' = fromMaybe "no role" <<< _.role <<< unwrap
where
getRole' = fromMaybe "Empty role" <<< _.role <<< unwrap
getOrga :: Array ContactWhere -> String
getOrga = maybe "Emtpy Contact-Where" getOrga' <<< head
...
...
@@ -103,14 +104,14 @@ getTouch :: Array ContactWhere -> Maybe ContactTouch
getTouch = maybe Nothing (\(ContactWhere {touch:x}) -> x) <<< head
getPhone :: Array ContactWhere -> String
getPhone obj = fromMaybe "" $ getPhone' <$> (getTouch obj)
getPhone obj = fromMaybe "
Empty touch info
" $ getPhone' <$> (getTouch obj)
getPhone' :: ContactTouch -> String
getPhone' = fromMaybe "
no
phone" <<< _.phone <<< unwrap
getPhone' = fromMaybe "
Empty
phone" <<< _.phone <<< unwrap
getMail :: Array ContactWhere -> String
getMail obj = fromMaybe "" $ getMail' <$> (getTouch obj)
getMail obj = fromMaybe "
Empty info
" $ getMail' <$> (getTouch obj)
getMail' :: ContactTouch -> String
getMail' = fromMaybe "
no
mail" <<< _.mail <<< unwrap
getMail' = fromMaybe "
Empty
mail" <<< _.mail <<< unwrap
-- | TODO format data in better design (UI) shape
contactInfos :: HyperdataContact -> Array ReactElement
...
...
@@ -119,9 +120,9 @@ contactInfos (HyperdataContact {who:who, ou:ou}) =
, li [className "list-group-item"] (infoRender (Tuple "First name" $ " " <> getFirstName who))
, li [className "list-group-item"] (infoRender (Tuple "Organization" $ " " <> getOrga ou ))
, li [className "list-group-item"] (infoRender (Tuple "Lab/Team/Dept"$ " " <> getOrga ou ))
, li [className "list-group-item"] (infoRender (Tuple "Office" $ " " <> getOffice
ou ))
, li [className "list-group-item"] (infoRender (Tuple "Office" $ " " <> getOffice ou ))
, li [className "list-group-item"] (infoRender (Tuple "City" $ " " <> getCity ou ))
, li [className "list-group-item"] (infoRender (Tuple "Country" $ " " <> getCountry
ou ))
, li [className "list-group-item"] (infoRender (Tuple "Country" $ " " <> getCountry ou ))
, li [className "list-group-item"] (infoRender (Tuple "Role" $ " " <> getRole ou ))
, li [className "list-group-item"] (infoRender (Tuple "Phone" $ " " <> getPhone ou ))
, li [className "list-group-item"] (infoRender (Tuple "Mail" $ " " <> getMail ou ))
...
...
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