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
51577839
Commit
51577839
authored
Jun 20, 2018
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[READ] cosmetics.
parent
8091879e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
34 deletions
+19
-34
DocView.purs
src/DocView.purs
+5
-6
PageRouter.purs
src/PageRouter.purs
+14
-28
No files found.
src/DocView.purs
View file @
51577839
...
...
@@ -143,7 +143,8 @@ performAction (ChangePageSize ps) _ _ = void (cotransform (\state -> changePage
performAction (ChangePage p) _ _ = void (cotransform (\(TableData td) -> TableData $ td { currentPage = p} ))
performAction LoadData _ _ = void do
res <- lift $ loadData
res <- lift $ loadData "http://localhost:8008/corpus/452132/facet/documents/table"
--res <- lift $ loadData "http://localhost:8009/corpus/1/facet/documents/table"
case res of
Left err -> cotransform $ \(state) -> state
Right resData -> do
...
...
@@ -379,13 +380,11 @@ showRow {row : (Corpus c), delete} =
true -> "fas "
false -> "far "
loadData :: forall eff. Aff ( console :: CONSOLE, ajax :: AJAX| eff) (Either String (Array Response))
loadData = do
loadData :: forall eff. String -> Aff ( console :: CONSOLE, ajax :: AJAX| eff) (Either String (Array Response))
loadData url = do
affResp <- liftAff $ attempt $ affjax defaultRequest
{ method = Left GET
, url =
"http://localhost:8009/corpus/1/facet/documents/table"
, url =
url
, headers = [ ContentType applicationJSON
, Accept applicationJSON
-- , RequestHeader "Authorization" $ "Bearer " <> token
...
...
src/PageRouter.purs
View file @
51577839
...
...
@@ -28,7 +28,6 @@ data Routes
| PGraphExplorer
| NGramsTable
instance showRoutes :: Show Routes where
show Home = "Home"
show Login = "Login"
...
...
@@ -37,43 +36,30 @@ instance showRoutes :: Show Routes where
show SearchView = "SearchView"
show UserPage = "UserPage"
show (AnnotationDocumentView i) = "DocumentView"
show Tabview = "Tabview"
show Tabview
= "Tabview"
show CorpusAnalysis = "corpus"
show PGraphExplorer = "graphExplorer"
show NGramsTable = "NGramsTable"
show PGraphExplorer
= "graphExplorer"
show NGramsTable
= "NGramsTable"
int :: Match Int
int = floor <$> num
routing :: Match Routes
routing =
loginRoute
<|>
tabview
<|>
documentView
<|>
userPageRoute
<|>
searchRoute
<|>
docviewRoute
<|>
addcorpusRoute
<|>
corpusAnalysis
<|>
graphExplorer
<|>
ngramsTable
<|>
home
Login <$ route "login"
<|>
Tabview <$ route "tabview"
<|>
AnnotationDocumentView <$> (route "documentView" *> int)
<|>
UserPage <$ route "userPage"
<|>
SearchView <$ route "search"
<|>
DocView <$ route "docView"
<|>
AddCorpus <$ route "addCorpus"
<|>
CorpusAnalysis <$ route "corpus"
<|>
PGraphExplorer <$ route "graphExplorer"
<|>
NGramsTable <$ route "ngrams"
<|>
Home <$ lit ""
where
ngramsTable = NGramsTable <$ route "ngrams"
tabview = Tabview <$ route "tabview"
documentView = AnnotationDocumentView <$> (route "documentView" *> int)
userPageRoute = UserPage <$ route "userPage"
searchRoute = SearchView <$ route "search"
docviewRoute = DocView <$ route "docView"
addcorpusRoute = AddCorpus <$ route "addCorpus"
loginRoute = Login <$ route "login"
corpusAnalysis = CorpusAnalysis <$ route "corpus"
graphExplorer = PGraphExplorer <$ route "graphExplorer"
home = Home <$ lit ""
route str = lit "" *> lit str
routeHandler :: forall e. ( Maybe Routes -> Routes -> Eff
( dom :: DOM
, console :: CONSOLE
...
...
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