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
1391a677
Unverified
Commit
1391a677
authored
Dec 03, 2018
by
Nicolas Pouillard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Annuaire] pass offset and limit params
parent
113500f8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
22 deletions
+14
-22
Config.purs
src/Gargantext/Config.purs
+2
-2
Annuaire.purs
src/Gargantext/Pages/Annuaire.purs
+12
-20
No files found.
src/Gargantext/Config.purs
View file @
1391a677
...
@@ -157,11 +157,11 @@ data NodeType = NodeUser
...
@@ -157,11 +157,11 @@ data NodeType = NodeUser
instance showNodeType :: Show NodeType where
instance showNodeType :: Show NodeType where
show NodeUser = "NodeUser"
show NodeUser = "NodeUser"
show Annuaire = "Annuaire"
show Annuaire = "Annuaire"
show NodeContact = "NodeDocument"
show NodeContact = "NodeDocument"
-- TODO anoe
show Corpus = "NodeCorpus"
show Corpus = "NodeCorpus"
show CorpusV3 = "NodeCorpusV3"
show CorpusV3 = "NodeCorpusV3"
show Dashboard = "NodeDashboard"
show Dashboard = "NodeDashboard"
show Url_Document = "NodeD
ashboard
"
show Url_Document = "NodeD
ocument
"
--show NodeDocument = "NodeDocument"
--show NodeDocument = "NodeDocument"
show Error = "NodeError"
show Error = "NodeError"
show Folder = "NodeFolder"
show Folder = "NodeFolder"
...
...
src/Gargantext/Pages/Annuaire.purs
View file @
1391a677
...
@@ -5,14 +5,11 @@ import Data.Argonaut (class DecodeJson, decodeJson, (.?), (.??))
...
@@ -5,14 +5,11 @@ import Data.Argonaut (class DecodeJson, decodeJson, (.?), (.??))
import Data.Lens (Prism', prism)
import Data.Lens (Prism', prism)
import Data.Either (Either(..))
import Data.Either (Either(..))
import Data.Maybe (Maybe(..), maybe)
import Data.Maybe (Maybe(..), maybe)
import Data.Map (lookup)
import Effect (Effect)
import Effect.Aff (Aff)
import Effect.Aff (Aff)
import React (ReactClass, ReactElement, Children)
import React (ReactClass, ReactElement, Children)
import React as React
import React as React
import React.DOM (a, b, b', br', div, h3, hr, i, input, p, table, tbody, td, text, th, thead, tr)
import React.DOM (a, br', div, input, p, text)
import React.DOM (a, br', div, input, p, text)
import React.DOM.Props (
className, href, scope, style
)
import React.DOM.Props (
href
)
import Effect.Class (liftEffect)
import Effect.Class (liftEffect)
import Thermite ( Render, Spec
import Thermite ( Render, Spec
, createClass, simpleSpec, defaultPerformAction
, createClass, simpleSpec, defaultPerformAction
...
@@ -25,7 +22,7 @@ import Gargantext.Components.Tab as Tab
...
@@ -25,7 +22,7 @@ import Gargantext.Components.Tab as Tab
import Gargantext.Components.Table as T
import Gargantext.Components.Table as T
import Gargantext.Config (toUrl, Path(..), NodeType(..), TabType(..), End(..))
import Gargantext.Config (toUrl, Path(..), NodeType(..), TabType(..), End(..))
import Gargantext.Config.REST (get)
import Gargantext.Config.REST (get)
import Gargantext.Pages.Annuaire.User.Contacts.Types (Contact(..), Hyper
Data(..), Hyper
dataContact(..), ContactWhere(..))
import Gargantext.Pages.Annuaire.User.Contacts.Types (Contact(..), HyperdataContact(..), ContactWhere(..))
------------------------------------------------------------------------------
------------------------------------------------------------------------------
type Props = Loader.InnerProps Int AnnuaireInfo ()
type Props = Loader.InnerProps Int AnnuaireInfo ()
...
@@ -71,18 +68,6 @@ defaultAnnuaireInfo = AnnuaireInfo { id : 0
...
@@ -71,18 +68,6 @@ defaultAnnuaireInfo = AnnuaireInfo { id : 0
toRows :: AnnuaireTable -> Array (Maybe Contact)
toRows :: AnnuaireTable -> Array (Maybe Contact)
toRows (AnnuaireTable a) = a.annuaireTable
toRows (AnnuaireTable a) = a.annuaireTable
{-
layoutAnnuaire :: Spec State {} Action
layoutAnnuaire = simpleSpec performAction render
where
render :: Render {} {annuaireId :: Int} Void
render _ {annuaireId} _ _ =
[ annuaireLoader
{ path: annuaireId
, component: createClass "LoadedAnnuaire" loadedAnnuaireSpec (const {})
} ]
-}
layout :: Spec {} {annuaireId :: Int} Void
layout :: Spec {} {annuaireId :: Int} Void
layout = simpleSpec defaultPerformAction render
layout = simpleSpec defaultPerformAction render
where
where
...
@@ -237,9 +222,16 @@ instance decodeAnnuaireTable :: DecodeJson AnnuaireTable where
...
@@ -237,9 +222,16 @@ instance decodeAnnuaireTable :: DecodeJson AnnuaireTable where
pure $ AnnuaireTable { annuaireTable : rows}
pure $ AnnuaireTable { annuaireTable : rows}
------------------------------------------------------------------------
------------------------------------------------------------------------
loadPage :: PageParams -> Aff AnnuaireTable
loadPage :: PageParams -> Aff AnnuaireTable
loadPage {nodeId, params} = get $ toUrl Back (Children NodeContact 0 10 Nothing) (Just nodeId)
loadPage {nodeId, params: { offset, limit, orderBy }} =
-- TODO Tab TabDocs is not the right API call
get $ toUrl Back (Tab TabDocs offset limit Nothing {-(convOrderBy <$> orderBy)-})
-- TODO params, see loadPage in Documents
(Just nodeId)
-- TODO Tab TabDocs is this what we want in the end?
-- TODO orderBy
-- where
-- convOrderBy (T.ASC (T.ColumnName "Name")) = NameAsc
-- convOrderBy (T.DESC (T.ColumnName "Name")) = NameDesc
-- ...
-- convOrderBy _ = NameAsc -- TODO
getAnnuaireInfo :: Int -> Aff AnnuaireInfo
getAnnuaireInfo :: Int -> Aff AnnuaireInfo
getAnnuaireInfo id = get $ toUrl Back Node (Just id)
getAnnuaireInfo id = get $ toUrl Back Node (Just id)
...
...
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