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
cb39fda6
Commit
cb39fda6
authored
Oct 10, 2018
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] Type in Corpus.purs + cosmetics.
parent
b457affa
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
41 additions
and
38 deletions
+41
-38
Tree.purs
src/Gargantext/Components/Tree.purs
+4
-4
Corpus.purs
src/Gargantext/Pages/Corpus.purs
+9
-9
Documents.purs
src/Gargantext/Pages/Corpus/Doc/Facets/Documents.purs
+10
-7
Layout.purs
src/Gargantext/Pages/Layout.purs
+1
-1
Actions.purs
src/Gargantext/Pages/Layout/Actions.purs
+5
-5
Specs.purs
src/Gargantext/Pages/Layout/Specs.purs
+12
-12
No files found.
src/Gargantext/Components/Tree.purs
View file @
cb39fda6
...
...
@@ -216,8 +216,8 @@ toHtml d s@(NTree (LNode {id, name, nodeType, open, popOver, renameNodeValue}) [
( [ text (name <> " ")
]
<> nodeOptionsView false
<> (nodeOptionsRename d
tru
e)
<>[ if ((popOverValue s) == true) then (renameTreeView d s ) else (renameTreeView d s)]
<> (nodeOptionsRename d
fals
e)
--
<>[ if ((popOverValue s) == true) then (renameTreeView d s ) else (renameTreeView d s)]
)
]
]
...
...
@@ -233,8 +233,8 @@ toHtml d s@(NTree (LNode {id, name, nodeType, open, popOver, renameNodeValue}) a
map (toHtml d) ary
else []
<> nodeOptionsView false
<> (nodeOptionsRename d
tru
e)
<>[ if ((popOverValue s) == true) then (renameTreeView d s ) else (renameTreeView d s)]
<> (nodeOptionsRename d
fals
e)
--
<>[ if ((popOverValue s) == true) then (renameTreeView d s ) else (renameTreeView d s)]
)
]
...
...
src/Gargantext/Pages/Corpus.purs
View file @
cb39fda6
...
...
@@ -62,16 +62,16 @@ _tablens :: Lens' State Tab.State
_tablens = lens (\s -> s.activeTab) (\s ss -> s {activeTab = ss})
------------------------------------------------------------------------
data Action = Load Int
| DocviewA
D.Action
| DocviewA
ction
D.Action
| AuthorviewA A.Action
| SourceviewA S.Action
| TermsviewA T.Action
| TabViewA Tab.Action
_docAction :: Prism' Action D.Action
_docAction = prism DocviewA \ action ->
_docAction = prism DocviewA
ction
\ action ->
case action of
DocviewA laction -> Right laction
DocviewA
ction
laction -> Right laction
_-> Left action
_authorAction :: Prism' Action A.Action
...
...
@@ -215,7 +215,7 @@ performAction (Load nId) _ _ = do
(Left err) -> do
logs err
logs $ "Node Corpus fetched."
performAction (DocviewA a) _ _ = pure unit
performAction (DocviewA
ction
a) _ _ = pure unit
performAction (AuthorviewA _) _ _ = pure unit
performAction (SourceviewA _) _ _ = pure unit
performAction (TabViewA _) _ _ = pure unit
...
...
src/Gargantext/Pages/Corpus/Doc/Facets/Documents.purs
View file @
cb39fda6
...
...
@@ -132,6 +132,7 @@ filterSpec = simpleSpec defaultPerformAction render
, input []
]]
-- | Main layout of the Documents Tab of a Corpus
layoutDocview :: Spec State {} Action
layoutDocview = simpleSpec performAction render
where
...
...
@@ -168,14 +169,8 @@ layoutDocview = simpleSpec performAction render
performAction :: PerformAction State {} Action
performAction (ChangePageSize ps) _ _ =
void $ modifyState $ changePageSize ps
performAction (ChangePage p) _ _ =
void $ modifyState \(TableData td) -> TableData
$ td { currentPage = p }
performAction (LoadData n) _ _ = do
logs "loading documents page"
res <- lift $ loadPage n
case res of
Left err -> do
...
...
@@ -186,9 +181,17 @@ performAction (LoadData n) _ _ = do
_ <- modifyState $ const resData
pure unit
performAction (ChangePageSize ps) _ _ =
void $ modifyState $ changePageSize ps
performAction (ChangePage p) _ _ =
void $ modifyState \(TableData td) -> TableData
$ td { currentPage = p }
loadPage :: Int -> Aff (Either String CorpusTableData)
loadPage n = do
logs "loading documents page: loadPage"
res <- get $ toUrl Back Children n
-- TODO: offset and limit
-- res <- get "http://localhost:8008/corpus/472764/facet/documents/table?offset=0&limit=10"
...
...
src/Gargantext/Pages/Layout.purs
View file @
cb39fda6
...
...
@@ -43,7 +43,7 @@ dispatchAction dispatcher _ (DocView n) = do
dispatchAction dispatcher _ (Corpus n) = do
dispatcher $ SetRoute $ Corpus n
dispatcher $ CorpusAction $ Corpus.Load n
dispatcher $ CorpusAction $ Corpus.DocviewA
$ D.LoadData n
dispatcher $ CorpusAction $ Corpus.DocviewA
ction
$ D.LoadData n
dispatchAction dispatcher _ SearchView = do
dispatcher $ SetRoute SearchView
...
...
src/Gargantext/Pages/Layout/Actions.purs
View file @
cb39fda6
...
...
@@ -30,12 +30,12 @@ data Action
= Initialize
| LoginA LN.Action
| SetRoute Routes
| AddCorpusA AC.Action
| DocViewA DV.Action
| SearchA S.Action
| Search String
| TreeViewA Tree.Action
| CorpusAction Corpus.Action
| SearchA S.Action
| Search String
| AddCorpusA AC.Action
| DocViewA DV.Action
| GraphExplorerA GE.Action
| DocAnnotationViewA D.Action
| AnnuaireAction Annuaire.Action
...
...
src/Gargantext/Pages/Layout/Specs.purs
View file @
cb39fda6
...
...
@@ -48,27 +48,27 @@ layoutSpec =
(render d p s c)
pagesComponent :: AppState -> Spec AppState {} Action
pagesComponent s =
case s.currentRoute of
pagesComponent s = case s.currentRoute of
Just route -> selectSpec route
Nothing -> selectSpec Home
Nothing -> selectSpec Home
-- TODO add Error page here: url requested does not exist (with funny Garg image)
where
selectSpec :: Routes -> Spec AppState {} Action
selectSpec (Corpus i) = layout0 $ focus _corpusState _corpusAction Corpus.layout
selectSpec Login = focus _loginState _loginAction LN.renderSpec
selectSpec Home = layout0 $ noState (L.layoutLanding EN)
selectSpec Login = focus _loginState _loginAction LN.renderSpec
selectSpec (Folder i) = layout0 $ noState F.layoutFolder
selectSpec (Corpus i) = layout0 $ focus _corpusState _corpusAction Corpus.layout
selectSpec AddCorpus = layout0 $ focus _addCorpusState _addCorpusAction AC.layoutAddcorpus
selectSpec (DocView i) = layout0 $ focus _docViewState _docViewAction DV.layoutDocview
selectSpec (UserPage i) = layout0 $ focus _userPageState _userPageAction U.layoutUser
selectSpec (DocAnnotation i) = layout0 $ focus _docAnnotationViewState
_docAnnotationViewAction Annotation.docview
-- To be removed
selectSpec SearchView = layout0 $ focus _searchState _searchAction S.searchSpec
selectSpec
NGramsTable = layout0 $ noState NG.ngramsTableSpec
selectSpec
(DocAnnotation i) = layout0 $ focus _docAnnotationViewState _docAnnotationViewAction Annotation.docview
selectSpec PGraphExplorer = focus _graphExplorerState _graphExplorerAction GE.specOld
selectSpec Dashboard = layout0 $ noState Dsh.layoutDashboard
selectSpec (Annuaire i) = layout0 $ focus _annuaireState _annuaireAction A.layoutAnnuaire
selectSpec (Folder i) = layout0 $ noState F.layoutFolder
selectSpec (UserPage i) = layout0 $ focus _userPageState _userPageAction U.layoutUser
-- To be removed
selectSpec NGramsTable = layout0 $ noState NG.ngramsTableSpec
selectSpec (DocView i) = layout0 $ focus _docViewState _docViewAction DV.layoutDocview
-- selectSpec _ = simpleSpec defaultPerformAction defaultRender
...
...
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