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
f4a8737b
Commit
f4a8737b
authored
Jun 22, 2018
by
Mael NICOLAS
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merged, resolved conflict
parent
ed8a2a4f
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
308 additions
and
0 deletions
+308
-0
Users.purs
src/Gargantext/Users.purs
+7
-0
Actions.purs
src/Gargantext/Users/Actions.purs
+5
-0
API.purs
src/Gargantext/Users/Actions/API.purs
+19
-0
Specs.purs
src/Gargantext/Users/Specs.purs
+19
-0
Renders.purs
src/Gargantext/Users/Specs/Renders.purs
+74
-0
Types.purs
src/Gargantext/Users/Types.purs
+36
-0
Lens.purs
src/Gargantext/Users/Types/Lens.purs
+53
-0
Types.purs
src/Gargantext/Users/Types/Types.purs
+95
-0
No files found.
src/Gargantext/Users.purs
0 → 100644
View file @
f4a8737b
module Gargantext.Users
(module Gargantext.Users.Types,
module Gargantext.Users.Specs)
where
import Gargantext.Users.Types
import Gargantext.Users.Specs
src/Gargantext/Users/Actions.purs
0 → 100644
View file @
f4a8737b
module Gargantext.Users.Actions
(module Gargantext.Users.Actions.API)
where
import Gargantext.Users.Actions.API
src/Gargantext/Users/Actions/API.purs
0 → 100644
View file @
f4a8737b
module Gargantext.Users.Actions.API
where
import Gargantext.Users.Types.Types
import Control.Monad.Aff (Aff, attempt, launchAff)
import Control.Monad.Aff.Class (liftAff)
import Control.Monad.Aff.Console (log)
import Data.Argonaut (decodeJson)
import Data.Either (Either(..))
import Data.HTTP.Method (Method(..))
import Data.Identity (Identity(..))
import Network.HTTP.Affjax (AJAX, affjax, defaultRequest, get)
import Prelude (pure, show, unit, bind, discard, (<<<), ($), (<>))
user userID = launchAff $ do
res <- get "http://localhost:8008/node/452146"
pure res
src/Gargantext/Users/Specs.purs
0 → 100644
View file @
f4a8737b
module Gargantext.Users.Specs
(module Gargantext.Users.Specs.Renders,
layoutUser)
where
import Gargantext.Users.Specs.Renders
import Control.Monad.Aff.Console (CONSOLE)
import DOM (DOM)
import Network.HTTP.Affjax (AJAX)
import Thermite (Spec, simpleSpec)
import Gargantext.Users.Types.Types (Action, State, performAction)
layoutUser :: forall props eff . Spec ( console :: CONSOLE
, ajax :: AJAX
, dom :: DOM
| eff
) State props Action
layoutUser = simpleSpec performAction render
src/Gargantext/Users/Specs/Renders.purs
0 → 100644
View file @
f4a8737b
module Gargantext.Users.Specs.Renders
where
import Control.Monad.Aff.Class (liftAff)
import Data.Tuple (Tuple(..))
import Prelude (($), (<<<))
import React (ReactElement)
import React.DOM (div, h4, li, span, text, ul)
import React.DOM.Props (_id, className)
import Thermite (Render)
import Gargantext.Users.Types.Types (Action, State)
infoRender :: forall props. Tuple String String -> Array ReactElement
infoRender (Tuple title content) =
[
span [className "font-weight-bold text-primary"] [text title],
span [className "pull-right"] [text content]
]
listElement :: forall props. Array ReactElement -> ReactElement
listElement = li [className "list-group-item justify-content-between"]
card :: forall props. String -> Array ReactElement -> Array ReactElement
card title elems =
[
div [className "card"]
[
div [className "card-header text-white bg-primary"]
[
h4 [] [text title]
],
div [className "card-body"]
elems
]
]
userInfos :: ReactElement
userInfos =
ul [className "list-group"]
[
listElement <<< infoRender $ Tuple "Fonction: " "Enseignant chercheur"
,listElement <<< infoRender $ Tuple "Entité, service: " "Mines Saint-Etienne SPIN -PTSI"
,listElement <<< infoRender $ Tuple "Téléphone: " "(+33) 4 77 42 00 70"
,listElement <<< infoRender $ Tuple "Courriel: " "gargantua@rabelais.fr"
,listElement <<< infoRender $ Tuple "Bureau: " "D1/10"
,listElement <<< infoRender $ Tuple "Appelation: " "Maître de conférences (EPA)"
,listElement <<< infoRender $ Tuple "Lieu: " "Saint-Etienne, 158 Cours Fauriel"
]
pbInfos :: ReactElement
pbInfos =
ul [className "list-group"]
[
listElement <<< infoRender $ Tuple "" "https://www.imt.fr/en/"
,listElement <<< infoRender $ Tuple "" "https://www.imt.fr/en/"
,listElement <<< infoRender $ Tuple "" "https://www.imt.fr/en/"
]
render :: forall props. Render State props Action
render dispatch _ state _ =
[
div [className "container-fluid"]
[
div [className "row", _id "user-page-info"]
[
div [className "row"]
[
div [className "col-md-8"]
$ card "Jean HEUDE" [userInfos]
]
]
]
]
src/Gargantext/Users/Types.purs
0 → 100644
View file @
f4a8737b
module Gargantext.Users.Types
(module Gargantext.Users.Types.Types,
module Gargantext.Users.Types.Lens,
brevetSpec,
projectSpec,
facets
)
where
import Gargantext.Users.Types.Lens
import Gargantext.Users.Types.Types
import Brevets as B
import Control.Monad.Aff.Console (CONSOLE)
import DOM (DOM)
import Data.List (fromFoldable)
import Data.Tuple (Tuple(..))
import Network.HTTP.Affjax (AJAX)
import Prelude (($))
import Projects as PS
import Tab (tabs)
import Thermite (Spec, focus)
brevetSpec :: forall eff props. Spec (dom :: DOM, console::CONSOLE, ajax :: AJAX | eff) State props Action
brevetSpec = focus _brevetslens _brevetsAction B.brevetsSpec
projectSpec :: forall eff props. Spec (dom :: DOM, console :: CONSOLE, ajax :: AJAX | eff) State props Action
projectSpec = focus _projectslens _projectsAction PS.projets
facets :: forall eff props. Spec ( dom :: DOM, console :: CONSOLE, ajax :: AJAX| eff) State props Action
facets = tabs _tablens _tabAction $ fromFoldable
[ Tuple "Publications(12)" publicationSpec
, Tuple "Brevets (2)" brevetSpec
, Tuple "Projets IMT (5)" projectSpec
]
src/Gargantext/Users/Types/Lens.purs
0 → 100644
View file @
f4a8737b
module Gargantext.Users.Types.Lens where
import Brevets as B
import Control.Monad.Aff.Console (CONSOLE)
import DOM (DOM)
import Data.Either (Either(..))
import Data.Lens (Lens', Prism', lens, prism)
import Network.HTTP.Affjax (AJAX)
import Projects as PS
import Publications as P
import Tab as Tab
import Thermite (Spec, focus)
import Gargantext.Users.Types.Types (State(..), Action(..))
_tablens :: Lens' State Tab.State
_tablens = lens (\s -> s.activeTab) (\s ss -> s {activeTab = ss})
_tabAction :: Prism' Action Tab.Action
_tabAction = prism TabA \ action ->
case action of
TabA laction -> Right laction
_-> Left action
_publens :: Lens' State P.State
_publens = lens (\s -> s.publications) (\s ss -> s { publications= ss})
_pubAction :: Prism' Action P.Action
_pubAction = prism PublicationA \ action ->
case action of
PublicationA laction -> Right laction
_-> Left action
publicationSpec :: forall eff props. Spec (dom :: DOM, console :: CONSOLE, ajax :: AJAX | eff) State props Action
publicationSpec = focus _publens _pubAction P.publicationSpec
_brevetslens :: Lens' State B.State
_brevetslens = lens (\s -> s.brevets) (\s ss -> s {brevets = ss})
_brevetsAction :: Prism' Action B.Action
_brevetsAction = prism BrevetsA \ action ->
case action of
BrevetsA laction -> Right laction
_-> Left action
_projectslens :: Lens' State PS.State
_projectslens = lens (\s -> s.projects) (\s ss -> s {projects = ss})
_projectsAction :: Prism' Action PS.Action
_projectsAction = prism ProjectsA \ action ->
case action of
ProjectsA laction -> Right laction
_-> Left action
src/Gargantext/Users/Types/Types.purs
0 → 100644
View file @
f4a8737b
module Gargantext.Users.Types.Types where
import Brevets as B
import Control.Monad.Aff.Console (CONSOLE)
import DOM (DOM)
import Data.Date (Date)
import Data.Generic (class Generic)
import Network.HTTP.Affjax (AJAX)
import Prelude (id, void)
import Projects as PS
import Publications as P
import Tab as Tab
import Thermite (PerformAction, modifyState)
type State =
{ activeTab :: Int
, publications :: P.State
, brevets :: B.State
, projects :: PS.State
}
initialState :: State
initialState =
{ activeTab : 0
, publications : P.initialState
, brevets : B.initialState
, projects : PS.initialState
}
data Action
= NoOp
| PublicationA P.Action
| BrevetsA B.Action
| ProjectsA PS.Action
| TabA Tab.Action
performAction :: forall eff props. PerformAction ( console :: CONSOLE
, ajax :: AJAX
, dom :: DOM
| eff ) State props Action
performAction NoOp _ _ = void do
modifyState id
performAction _ _ _ = void do
modifyState id
-- id 452146
-- typename 41
-- userId 1
-- parentId 452132
-- name "Pierre DEMUGNIER"
-- date "2018-06-18T14:27:50.670952Z"
-- hyperdata
-- bureau "V.305"
-- atel ""
-- fax ""
-- aprecision ""
-- service2 null
-- groupe ""
-- service "ARMINES"
-- lieu "Paris"
-- pservice ""
-- date_modification "07/06/2018"
-- pfonction ""
-- fonction "Service Développement Partenarial - Chargé de Projet France & International"
-- url ""
-- statut null
-- prenom "Pierre"
-- idutilentite "1055"
-- afonction ""
-- grprech ""
-- nom "DEMUGNIER"
-- entite "Armines"
-- entite2 null
-- id "11002"
-- tel "01.40.51.93.66"
-- idutilsiecoles null
-- groupe2 null
-- sexe "1"
-- mail "pierre.demugnier@mines-paristech.fr"
-- actif "1"
type User =
{
id :: Int,
typename :: Int,
userId :: Int,
parentId :: Int,
name :: String,
date :: Date,
hyperData :: HyperData
}
type HyperData =
{}
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