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
38ab9629
Commit
38ab9629
authored
May 06, 2019
by
James Laver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make document be routed also by list id
parent
03f40a8a
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
23 deletions
+24
-23
Document.purs
src/Gargantext/Pages/Corpus/Document.purs
+3
-4
Layout.purs
src/Gargantext/Pages/Layout.purs
+3
-3
Specs.purs
src/Gargantext/Pages/Layout/Specs.purs
+1
-1
Router.purs
src/Gargantext/Router.purs
+17
-15
No files found.
src/Gargantext/Pages/Corpus/Document.purs
View file @
38ab9629
...
...
@@ -51,7 +51,7 @@ initialState {} =
}
data Action
= Load Int
= Load Int
Int
| ChangeString String
| SetInput String
...
...
@@ -279,11 +279,10 @@ instance decodeDocument :: DecodeJson Document
------------------------------------------------------------------------
performAction :: PerformAction State {} Action
performAction (Load nId) _ _ = do
performAction (Load
lId
nId) _ _ = do
node <- lift $ getNode (Just nId)
let listIds = [1]
(Versioned {version:_version, data:table}) <- lift $ loadNgramsTable {nodeId : nId
, listIds :
listIds
, listIds :
[lId]
, params : { offset : 0, limit : 100, orderBy: Nothing}
, tabType : (TabDocument (TabNgramType CTabTerms))
, searchQuery : ""
...
...
src/Gargantext/Pages/Layout.purs
View file @
38ab9629
...
...
@@ -49,9 +49,9 @@ dispatchAction dispatcher _ (Annuaire id) = do
dispatchAction dispatcher _ (Folder id) = do
dispatcher $ SetRoute $ Folder id
dispatchAction dispatcher _ (Document n) = do
dispatcher $ SetRoute $ Document n
dispatcher $ DocumentViewA $ Document.Load n
dispatchAction dispatcher _ (Document
i
n) = do
dispatcher $ SetRoute $ Document
i
n
dispatcher $ DocumentViewA $ Document.Load
i
n
dispatchAction dispatcher _ (PGraphExplorer nid) = do
dispatcher $ SetRoute $ PGraphExplorer nid
...
...
src/Gargantext/Pages/Layout/Specs.purs
View file @
38ab9629
...
...
@@ -59,7 +59,7 @@ pagesComponent s = case s.currentRoute of
selectSpec (Corpus i) = layout0 $ cmapProps (const {nodeId: i}) $ noState Corpus.layout
selectSpec AddCorpus = layout0 $ focus _addCorpusState _addCorpusAction AC.layoutAddcorpus
selectSpec SearchView = layout0 $ focus _searchState _searchAction S.searchSpec
selectSpec (Document i) = layout0 $ focus _documentViewState _documentViewAction Annotation.docview
selectSpec (Document
l
i) = layout0 $ focus _documentViewState _documentViewAction Annotation.docview
selectSpec (PGraphExplorer i)= layout1 $ focus _graphExplorerState _graphExplorerAction GE.specOld
selectSpec Dashboard = layout0 $ noState Dsh.layoutDashboard
selectSpec (Annuaire i) = layout0 $ cmapProps (const {annuaireId: i}) $ noState A.layout
...
...
src/Gargantext/Router.purs
View file @
38ab9629
...
...
@@ -3,6 +3,7 @@ module Gargantext.Router where
import Gargantext.Prelude
import Control.Alt ((<|>))
import Data.Foldable (oneOf)
import Data.Int (floor)
import Data.Maybe (Maybe(..))
import Effect (Effect)
...
...
@@ -19,7 +20,7 @@ data Routes
| Folder Int
| Corpus Int
| AddCorpus
| Document Int
| Document
Int
Int
| PGraphExplorer Int
| Dashboard
| Annuaire Int
...
...
@@ -27,19 +28,20 @@ data Routes
| ContactPage Int
routing :: Match Routes
routing =
Login <$ route "login"
<|> SearchView <$ route "search"
<|> AddCorpus <$ route "addCorpus"
<|> Folder <$> (route "folder" *> int)
<|> Corpus <$> (route "corpus" *> int)
<|> Document <$> (route "document" *> int)
<|> Dashboard <$ route "dashboard"
<|> PGraphExplorer <$> (route "graph" *> int)
<|> Annuaire <$> (route "annuaire" *> int)
<|> UserPage <$> (route "user" *> int)
<|> ContactPage <$> (route "contact" *> int)
<|> Home <$ lit ""
routing = oneOf
[ Login <$ route "login"
, SearchView <$ route "search"
, AddCorpus <$ route "addCorpus"
, Folder <$> (route "folder" *> int)
, Corpus <$> (route "corpus" *> int)
, Document <$> (route "list" *> int) <*> (lit "document" *> int)
, Dashboard <$ route "dashboard"
, PGraphExplorer <$> (route "graph" *> int)
, Annuaire <$> (route "annuaire" *> int)
, UserPage <$> (route "user" *> int)
, ContactPage <$> (route "contact" *> int)
, Home <$ lit ""
]
where
route str = lit "" *> lit str
...
...
@@ -53,7 +55,7 @@ instance showRoutes :: Show Routes where
show SearchView = "Search"
show (UserPage i) = "User" <> show i
show (ContactPage i) = "Contact" <> show i
show (Document
i) = "Document"
show (Document
_ i) = "Document" <> show i
show (Corpus i) = "Corpus" <> show i
show (Annuaire i) = "Annuaire" <> show i
show (Folder i) = "Folder" <> 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