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 {} =
...
@@ -51,7 +51,7 @@ initialState {} =
}
}
data Action
data Action
= Load Int
= Load Int
Int
| ChangeString String
| ChangeString String
| SetInput String
| SetInput String
...
@@ -279,11 +279,10 @@ instance decodeDocument :: DecodeJson Document
...
@@ -279,11 +279,10 @@ instance decodeDocument :: DecodeJson Document
------------------------------------------------------------------------
------------------------------------------------------------------------
performAction :: PerformAction State {} Action
performAction :: PerformAction State {} Action
performAction (Load nId) _ _ = do
performAction (Load
lId
nId) _ _ = do
node <- lift $ getNode (Just nId)
node <- lift $ getNode (Just nId)
let listIds = [1]
(Versioned {version:_version, data:table}) <- lift $ loadNgramsTable {nodeId : nId
(Versioned {version:_version, data:table}) <- lift $ loadNgramsTable {nodeId : nId
, listIds :
listIds
, listIds :
[lId]
, params : { offset : 0, limit : 100, orderBy: Nothing}
, params : { offset : 0, limit : 100, orderBy: Nothing}
, tabType : (TabDocument (TabNgramType CTabTerms))
, tabType : (TabDocument (TabNgramType CTabTerms))
, searchQuery : ""
, searchQuery : ""
...
...
src/Gargantext/Pages/Layout.purs
View file @
38ab9629
...
@@ -49,9 +49,9 @@ dispatchAction dispatcher _ (Annuaire id) = do
...
@@ -49,9 +49,9 @@ dispatchAction dispatcher _ (Annuaire id) = do
dispatchAction dispatcher _ (Folder id) = do
dispatchAction dispatcher _ (Folder id) = do
dispatcher $ SetRoute $ Folder id
dispatcher $ SetRoute $ Folder id
dispatchAction dispatcher _ (Document n) = do
dispatchAction dispatcher _ (Document
i
n) = do
dispatcher $ SetRoute $ Document n
dispatcher $ SetRoute $ Document
i
n
dispatcher $ DocumentViewA $ Document.Load n
dispatcher $ DocumentViewA $ Document.Load
i
n
dispatchAction dispatcher _ (PGraphExplorer nid) = do
dispatchAction dispatcher _ (PGraphExplorer nid) = do
dispatcher $ SetRoute $ PGraphExplorer nid
dispatcher $ SetRoute $ PGraphExplorer nid
...
...
src/Gargantext/Pages/Layout/Specs.purs
View file @
38ab9629
...
@@ -59,7 +59,7 @@ pagesComponent s = case s.currentRoute of
...
@@ -59,7 +59,7 @@ pagesComponent s = case s.currentRoute of
selectSpec (Corpus i) = layout0 $ cmapProps (const {nodeId: i}) $ noState Corpus.layout
selectSpec (Corpus i) = layout0 $ cmapProps (const {nodeId: i}) $ noState Corpus.layout
selectSpec AddCorpus = layout0 $ focus _addCorpusState _addCorpusAction AC.layoutAddcorpus
selectSpec AddCorpus = layout0 $ focus _addCorpusState _addCorpusAction AC.layoutAddcorpus
selectSpec SearchView = layout0 $ focus _searchState _searchAction S.searchSpec
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 (PGraphExplorer i)= layout1 $ focus _graphExplorerState _graphExplorerAction GE.specOld
selectSpec Dashboard = layout0 $ noState Dsh.layoutDashboard
selectSpec Dashboard = layout0 $ noState Dsh.layoutDashboard
selectSpec (Annuaire i) = layout0 $ cmapProps (const {annuaireId: i}) $ noState A.layout
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
...
@@ -3,6 +3,7 @@ module Gargantext.Router where
import Gargantext.Prelude
import Gargantext.Prelude
import Control.Alt ((<|>))
import Control.Alt ((<|>))
import Data.Foldable (oneOf)
import Data.Int (floor)
import Data.Int (floor)
import Data.Maybe (Maybe(..))
import Data.Maybe (Maybe(..))
import Effect (Effect)
import Effect (Effect)
...
@@ -19,7 +20,7 @@ data Routes
...
@@ -19,7 +20,7 @@ data Routes
| Folder Int
| Folder Int
| Corpus Int
| Corpus Int
| AddCorpus
| AddCorpus
| Document Int
| Document
Int
Int
| PGraphExplorer Int
| PGraphExplorer Int
| Dashboard
| Dashboard
| Annuaire Int
| Annuaire Int
...
@@ -27,19 +28,20 @@ data Routes
...
@@ -27,19 +28,20 @@ data Routes
| ContactPage Int
| ContactPage Int
routing :: Match Routes
routing :: Match Routes
routing =
routing = oneOf
Login <$ route "login"
[ Login <$ route "login"
<|> SearchView <$ route "search"
, SearchView <$ route "search"
<|> AddCorpus <$ route "addCorpus"
, AddCorpus <$ route "addCorpus"
<|> Folder <$> (route "folder" *> int)
, Folder <$> (route "folder" *> int)
<|> Corpus <$> (route "corpus" *> int)
, Corpus <$> (route "corpus" *> int)
<|> Document <$> (route "document" *> int)
, Document <$> (route "list" *> int) <*> (lit "document" *> int)
<|> Dashboard <$ route "dashboard"
, Dashboard <$ route "dashboard"
<|> PGraphExplorer <$> (route "graph" *> int)
, PGraphExplorer <$> (route "graph" *> int)
<|> Annuaire <$> (route "annuaire" *> int)
, Annuaire <$> (route "annuaire" *> int)
<|> UserPage <$> (route "user" *> int)
, UserPage <$> (route "user" *> int)
<|> ContactPage <$> (route "contact" *> int)
, ContactPage <$> (route "contact" *> int)
<|> Home <$ lit ""
, Home <$ lit ""
]
where
where
route str = lit "" *> lit str
route str = lit "" *> lit str
...
@@ -53,7 +55,7 @@ instance showRoutes :: Show Routes where
...
@@ -53,7 +55,7 @@ instance showRoutes :: Show Routes where
show SearchView = "Search"
show SearchView = "Search"
show (UserPage i) = "User" <> show i
show (UserPage i) = "User" <> show i
show (ContactPage i) = "Contact" <> 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 (Corpus i) = "Corpus" <> show i
show (Annuaire i) = "Annuaire" <> show i
show (Annuaire i) = "Annuaire" <> show i
show (Folder i) = "Folder" <> 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