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
efd8673a
Commit
efd8673a
authored
Nov 25, 2019
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Annuanire][Contacts] Routes.
parent
9ea1e59a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
+11
-6
Annuaire.purs
src/Gargantext/Components/Nodes/Annuaire.purs
+10
-5
Routes.purs
src/Gargantext/Routes.purs
+1
-1
No files found.
src/Gargantext/Components/Nodes/Annuaire.purs
View file @
efd8673a
...
...
@@ -13,6 +13,7 @@ import Gargantext.Components.Nodes.Annuaire.User.Contacts.Types (Contact(..), Hy
import Gargantext.Components.Table as T
import Gargantext.Ends (url, Frontends)
import Gargantext.Routes (SessionRoute(..))
import Gargantext.Routes as Routes
import Gargantext.Sessions (Session, sessionId, get)
import Gargantext.Types (NodePath(..), NodeType(..))
import Gargantext.Hooks.Loader (useLoader)
...
...
@@ -113,7 +114,7 @@ pageCpt = R.staticComponent "LoadedAnnuairePage" cpt
where
totalRecords = 4361 -- TODO
path = fst pagePath
rows = (\c -> {row: contactCells session path.frontends c, delete: false}) <$> annuaireTable
rows = (\c -> {row: contactCells session path.frontends
path.nodeId
c, delete: false}) <$> annuaireTable
container = T.defaultContainer { title: "Annuaire" } -- TODO
colNames = T.ColumnName <$> [ "", "Name", "Company", "Service", "Role"]
wrapColElts = const identity
...
...
@@ -121,14 +122,18 @@ pageCpt = R.staticComponent "LoadedAnnuairePage" cpt
pp {params = f ps, nodeId = fst annuairePath}
params = T.initialParams /\ setParams
contactCells :: Session -> Frontends -> Maybe Contact -> Array R.Element
contactCells session frontends = maybe [] render
type AnnuaireId = Int
contactCells :: Session -> Frontends -> AnnuaireId -> Maybe Contact -> Array R.Element
contactCells session frontends aId = maybe [] render
where
render (Contact { id, hyperdata : (HyperdataContact contact@{who: who, ou:ou} ) }) =
let nodepath = NodePath (sessionId session) NodeContact (Just id)
--let nodepath = NodePath (sessionId session) NodeContact (Just id)
let nodepath = Routes.ContactPage (sessionId session) aId id
href = url frontends nodepath in
[ H.text ""
, H.a { href, target: "blank" } [ H.text $ maybe "name" identity contact.title ]
, H.a { href} [ H.text $ maybe "name" identity contact.title ]
--, H.a { href, target: "blank" } [ H.text $ maybe "name" identity contact.title ]
, H.text $ maybe "No ContactWhere" contactWhereOrg (head $ ou)
, H.text $ maybe "No ContactWhere" contactWhereDept (head $ ou)
, H.div {className: "nooverflow"}
...
...
src/Gargantext/Routes.purs
View file @
efd8673a
...
...
@@ -62,4 +62,4 @@ appPath (Texts s i) = "texts/" <> show s <> "/" <> show i
appPath (Lists s i) = "lists/" <> show s <> "/" <> show i
appPath (Annuaire s i) = "annuaire/" <> show s <> "/" <> show i
appPath (UserPage s i) = "user/" <> show s <> "/" <> show i
appPath (ContactPage s a i) = "annuaire
"
<> show s <> "/" <> show a <> "/contact/" <> show i
appPath (ContactPage s a i) = "annuaire
/"
<> show s <> "/" <> show a <> "/contact/" <> show i
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