Commit 6d0ba6b4 authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

Code & imports cleanup

parent 3c62969a
...@@ -3,29 +3,25 @@ module Gargantext.Pages.Annuaire.User.Contacts.Specs ...@@ -3,29 +3,25 @@ module Gargantext.Pages.Annuaire.User.Contacts.Specs
where where
import Data.List (List, zipWith, catMaybes, toUnfoldable)
import Data.Map (Map, empty, keys, values, lookup)
import Data.Array (head) import Data.Array (head)
import Data.Semigroup ((<>)) import Data.List (zipWith, catMaybes, toUnfoldable)
import Data.Map (Map, keys, lookup)
import Data.Maybe (Maybe(..), fromMaybe, maybe) import Data.Maybe (Maybe(..), fromMaybe, maybe)
import Data.Set (toUnfoldable) as S
import Data.Tuple (Tuple(..), uncurry)
import Data.Unfoldable (class Unfoldable)
import Data.Maybe (Maybe(..))
import Data.Newtype (unwrap) import Data.Newtype (unwrap)
import Data.Set (toUnfoldable) as S
import Data.String (joinWith) import Data.String (joinWith)
import Effect.Aff (Aff, throwError) import Data.Tuple (Tuple(..))
import Effect.Exception (error) import Data.Unfoldable (class Unfoldable)
import Thermite (Render, Spec, defaultPerformAction, simpleSpec) import Effect.Aff (Aff)
import React as React import React (ReactElement)
import React (ReactClass, ReactElement) import React.DOM (div, h3, img, li, span, text, ul)
import React.DOM (div, h3, img, li, span, text, ul, text)
import React.DOM.Props (_id, className, src) import React.DOM.Props (_id, className, src)
import Reactix as R import Reactix as R
import Thermite (Spec)
import Gargantext.Prelude import Gargantext.Prelude
import Gargantext.Config (toUrl, End(..), NodeType(..), Path(..)) import Gargantext.Config (toUrl, End(..), NodeType(..))
import Gargantext.Config.REST (get) import Gargantext.Config.REST (get)
import Gargantext.Components.Node (NodePoly(..), HyperdataList(..))
import Gargantext.Components.Loader2 (useLoader) import Gargantext.Components.Loader2 (useLoader)
import Gargantext.Pages.Annuaire.User.Contacts.Types import Gargantext.Pages.Annuaire.User.Contacts.Types
import Gargantext.Pages.Annuaire.User.Contacts.Tabs.Specs as Tabs import Gargantext.Pages.Annuaire.User.Contacts.Tabs.Specs as Tabs
...@@ -61,11 +57,15 @@ mapMyMap f m = toUnfoldable ...@@ -61,11 +57,15 @@ mapMyMap f m = toUnfoldable
infixl 4 mapMyMap as <.~$> infixl 4 mapMyMap as <.~$>
getFirstName :: Maybe ContactWho -> String
getFirstName obj = fromMaybe "Empty title" $ getFirstName' <$> obj getFirstName obj = fromMaybe "Empty title" $ getFirstName' <$> obj
getFirstName' = fromMaybe "Empty first name" <<< _.firstName <<< unwrap where
getFirstName' = fromMaybe "Empty first name" <<< _.firstName <<< unwrap
getLastName :: Maybe ContactWho -> String
getLastName obj = fromMaybe "Empty title" $ getLastName' <$> obj getLastName obj = fromMaybe "Empty title" $ getLastName' <$> obj
getLastName' = fromMaybe "Empty last name" <<< _.lastName <<< unwrap where
getLastName' = fromMaybe "Empty last name" <<< _.lastName <<< unwrap
-- | ContactWhere infos -- | ContactWhere infos
-- TODO factor below -- TODO factor below
......
module Gargantext.Pages.Corpus where module Gargantext.Pages.Corpus where
import Data.Array (head)
import Data.Maybe (Maybe(..))
import Effect.Aff (Aff, throwError)
import Effect.Exception (error)
import Reactix as R import Reactix as R
import Reactix.DOM.HTML as H import Reactix.DOM.HTML as H
import Thermite (Spec) import Thermite (Spec)
-------------------------------------------------------- --------------------------------------------------------
import Gargantext.Prelude import Gargantext.Prelude
import Gargantext.Components.Node (NodePoly(..), HyperdataList)
import Gargantext.Components.Loader2 (useLoader)
import Gargantext.Components.Table as Table
import Gargantext.Config (toUrl, Path(..), NodeType(..), End(..))
import Gargantext.Config.REST (get)
import Gargantext.Pages.Texts.Tabs.Types (CorpusData, CorpusInfo(..))
import Gargantext.Pages.Texts.Tabs.Specs (elt) as Tabs
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
------------------------------------------------------------------------ ------------------------------------------------------------------------
......
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