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
8fd75474
Commit
8fd75474
authored
Nov 25, 2019
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev-contact' into dev
parents
74760545
f6f39a24
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
42 additions
and
9 deletions
+42
-9
App.purs
src/Gargantext/Components/App.purs
+3
-3
Contacts.purs
src/Gargantext/Components/Nodes/Annuaire/User/Contacts.purs
+34
-1
Corpus.purs
src/Gargantext/Components/Nodes/Corpus.purs
+1
-1
Router.purs
src/Gargantext/Router.purs
+2
-2
Routes.purs
src/Gargantext/Routes.purs
+2
-2
No files found.
src/Gargantext/Components/App.purs
View file @
8fd75474
...
@@ -17,7 +17,7 @@ import Gargantext.Components.Login (login)
...
@@ -17,7 +17,7 @@ import Gargantext.Components.Login (login)
import Gargantext.Config (defaultFrontends, defaultBackends)
import Gargantext.Config (defaultFrontends, defaultBackends)
import Gargantext.Components.Folder (folder)
import Gargantext.Components.Folder (folder)
import Gargantext.Components.Nodes.Annuaire (annuaireLayout)
import Gargantext.Components.Nodes.Annuaire (annuaireLayout)
import Gargantext.Components.Nodes.Annuaire.User.Contacts (userLayout)
import Gargantext.Components.Nodes.Annuaire.User.Contacts (
annuaireUserLayout,
userLayout)
import Gargantext.Components.Nodes.Corpus (corpusLayout)
import Gargantext.Components.Nodes.Corpus (corpusLayout)
import Gargantext.Components.Nodes.Corpus.Document (documentLayout)
import Gargantext.Components.Nodes.Corpus.Document (documentLayout)
import Gargantext.Components.Nodes.Corpus.Dashboard (dashboardLayout)
import Gargantext.Components.Nodes.Corpus.Dashboard (dashboardLayout)
...
@@ -65,7 +65,7 @@ appCpt = R.hooksComponent "G.C.App.app" cpt where
...
@@ -65,7 +65,7 @@ appCpt = R.hooksComponent "G.C.App.app" cpt where
Dashboard sid _nodeId -> withSession sid $ \session -> forested $ dashboardLayout {}
Dashboard sid _nodeId -> withSession sid $ \session -> forested $ dashboardLayout {}
Annuaire sid nodeId -> withSession sid $ \session -> forested $ annuaireLayout { frontends, nodeId, session }
Annuaire sid nodeId -> withSession sid $ \session -> forested $ annuaireLayout { frontends, nodeId, session }
UserPage sid nodeId -> withSession sid $ \session -> forested $ userLayout { frontends, nodeId, session }
UserPage sid nodeId -> withSession sid $ \session -> forested $ userLayout { frontends, nodeId, session }
ContactPage sid
_aId nodeId -> withSession sid $ \session -> forested $ userLayout {
frontends, nodeId, session }
ContactPage sid
aId nodeId -> withSession sid $ \session -> forested $ annuaireUserLayout { annuaireId: aId,
frontends, nodeId, session }
CorpusDocument sid corpusId listId nodeId ->
CorpusDocument sid corpusId listId nodeId ->
withSession sid $ \session -> forested $ documentLayout { nodeId, listId, session, corpusId: Just corpusId }
withSession sid $ \session -> forested $ documentLayout { nodeId, listId, session, corpusId: Just corpusId }
Document sid listId nodeId ->
Document sid listId nodeId ->
...
...
src/Gargantext/Components/Nodes/Annuaire/User/Contacts.purs
View file @
8fd75474
module Gargantext.Components.Nodes.Annuaire.User.Contacts
module Gargantext.Components.Nodes.Annuaire.User.Contacts
( module Gargantext.Components.Nodes.Annuaire.User.Contacts.Types
( module Gargantext.Components.Nodes.Annuaire.User.Contacts.Types
, annuaireUserLayout
, userLayout )
, userLayout )
where
where
import Prelude (bind, pure, ($), (<<<), (<>), (<$>))
import Prelude (bind, pure, ($), (<<<), (<>), (<$>)
, show, discard
)
import Data.Array (head)
import Data.Array (head)
import Data.Maybe (Maybe(..), fromMaybe, maybe)
import Data.Maybe (Maybe(..), fromMaybe, maybe)
import Data.Tuple (Tuple(..))
import Data.Tuple (Tuple(..))
import Data.Tuple.Nested ((/\))
import Data.Tuple.Nested ((/\))
import Data.Newtype (unwrap)
import Data.Newtype (unwrap)
import Data.String (joinWith)
import Data.String (joinWith)
import DOM.Simple.Console (log2)
import Effect.Aff (Aff)
import Effect.Aff (Aff)
import Reactix as R
import Reactix as R
import Reactix.DOM.HTML as H
import Reactix.DOM.HTML as H
...
@@ -18,6 +20,7 @@ import Gargantext.Components.Nodes.Annuaire.User.Contacts.Types
...
@@ -18,6 +20,7 @@ import Gargantext.Components.Nodes.Annuaire.User.Contacts.Types
( Contact(..), ContactData, ContactTouch(..), ContactWhere(..)
( Contact(..), ContactData, ContactTouch(..), ContactWhere(..)
, ContactWho(..), HyperData(..), HyperdataContact(..) )
, ContactWho(..), HyperData(..), HyperdataContact(..) )
import Gargantext.Components.Nodes.Annuaire.User.Contacts.Tabs as Tabs
import Gargantext.Components.Nodes.Annuaire.User.Contacts.Tabs as Tabs
import Gargantext.Hooks.Loader (useLoader)
import Gargantext.Routes
import Gargantext.Routes
import Gargantext.Ends (Frontends)
import Gargantext.Ends (Frontends)
import Gargantext.Sessions (Session, get)
import Gargantext.Sessions (Session, get)
...
@@ -151,3 +154,33 @@ getContact session id = do
...
@@ -151,3 +154,33 @@ getContact session id = do
-- throwError $ error "Missing default list"
-- throwError $ error "Missing default list"
pure {contactNode, defaultListId: 424242}
pure {contactNode, defaultListId: 424242}
type AnnuaireLayoutProps =
( annuaireId :: Int
| LayoutProps )
annuaireUserLayout :: Record AnnuaireLayoutProps -> R.Element
annuaireUserLayout props = R.createElement annuaireUserLayoutCpt props []
annuaireUserLayoutCpt :: R.Component AnnuaireLayoutProps
annuaireUserLayoutCpt = R.hooksComponent "G.C.Nodes.Annuaire.User.Contacts.annuaireUserLayout" cpt
where
cpt {annuaireId, frontends, nodeId, session} _ = do
useLoader nodeId (getAnnuaireContact session annuaireId) $
\contactData@{contactNode: Contact {name, hyperdata}} ->
H.ul { className: "col-md-12 list-group" }
[ display (fromMaybe "no name" name) (contactInfos hyperdata)
, Tabs.tabs {frontends, nodeId, contactData, session} ]
getAnnuaireContact :: Session -> Int -> Int -> Aff ContactData
getAnnuaireContact session annuaireId id = do
contactNode <- get session $ NodeAPI Annuaire (Just annuaireId) $ "contact/" <> (show id)
-- TODO: we need a default list for the pairings
--defaultListIds <- get $ toUrl endConfigStateful Back (Children NodeList 0 1 Nothing) $ Just id
--case (head defaultListIds :: Maybe (NodePoly HyperdataList)) of
-- Just (NodePoly { id: defaultListId }) ->
-- pure {contactNode, defaultListId}
-- Nothing ->
-- throwError $ error "Missing default list"
pure {contactNode, defaultListId: 424242}
src/Gargantext/Components/Nodes/Corpus.purs
View file @
8fd75474
...
@@ -24,7 +24,7 @@ corpusLayoutCpt = R.staticComponent "G.P.Corpus.corpusLayout" cpt
...
@@ -24,7 +24,7 @@ corpusLayoutCpt = R.staticComponent "G.P.Corpus.corpusLayout" cpt
where
where
cpt {nodeId} _ =
cpt {nodeId} _ =
H.div {}
H.div {}
[ H.iframe { src: gargMd , width: "100%", height: "100%"} []
[ H.iframe { src: gargMd , width: "100%", height: "100%"
, style: {"border-style": "none"}
} []
]
]
gargMd = "https://hackmd.iscpif.fr/g9Aah4iwQtCayIzsKQjA0Q#"
gargMd = "https://hackmd.iscpif.fr/g9Aah4iwQtCayIzsKQjA0Q#"
newtype CorpusInfo =
newtype CorpusInfo =
...
...
src/Gargantext/Router.purs
View file @
8fd75474
...
@@ -21,10 +21,10 @@ router = oneOf
...
@@ -21,10 +21,10 @@ router = oneOf
, PGraphExplorer <$> (route "graph" *> sid) <*> int
, PGraphExplorer <$> (route "graph" *> sid) <*> int
, Texts <$> (route "texts" *> sid) <*> int
, Texts <$> (route "texts" *> sid) <*> int
, Lists <$> (route "lists" *> sid) <*> int
, Lists <$> (route "lists" *> sid) <*> int
, Annuaire <$> (route "annuaire" *> sid) <*> int
, UserPage <$> (route "user" *> sid) <*> int
, ContactPage <$> (route "annuaire" *> sid) <*> int
, ContactPage <$> (route "annuaire" *> sid) <*> int
<*> (lit "contact" *> int)
<*> (lit "contact" *> int)
, Annuaire <$> (route "annuaire" *> sid) <*> int
, UserPage <$> (route "user" *> sid) <*> int
, Home <$ lit ""
, Home <$ lit ""
]
]
where
where
...
...
src/Gargantext/Routes.purs
View file @
8fd75474
...
@@ -17,7 +17,7 @@ data AppRoute
...
@@ -17,7 +17,7 @@ data AppRoute
| Lists SessionId Int
| Lists SessionId Int
| Annuaire SessionId Int
| Annuaire SessionId Int
| UserPage SessionId Int
| UserPage SessionId Int
| ContactPage SessionId
AnnuaireId ContactId
| ContactPage SessionId
Int Int
type AnnuaireId = Int
type AnnuaireId = Int
type ContactId = Int
type ContactId = Int
...
@@ -47,7 +47,7 @@ instance showAppRoute :: Show AppRoute where
...
@@ -47,7 +47,7 @@ instance showAppRoute :: Show AppRoute where
show (Lists s i) = "lists" <> show i <> " (" <> show s <> ")"
show (Lists s i) = "lists" <> show i <> " (" <> show s <> ")"
show (Annuaire s i) = "Annuaire" <> show i <> " (" <> show s <> ")"
show (Annuaire s i) = "Annuaire" <> show i <> " (" <> show s <> ")"
show (UserPage s i) = "User" <> show i <> " (" <> show s <> ")"
show (UserPage s i) = "User" <> show i <> " (" <> show s <> ")"
show (ContactPage s
_a i) = "Contact"
<> show i <> " (" <> show s <> ")"
show (ContactPage s
a i) = "Contact" <> show a <> "::"
<> show i <> " (" <> show s <> ")"
appPath :: AppRoute -> String
appPath :: AppRoute -> String
appPath Home = ""
appPath Home = ""
...
...
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