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
cb87d66d
Commit
cb87d66d
authored
Nov 07, 2018
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX][DOCUMENT] Type adapted to WOS parser.
parent
ad5157f3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
37 deletions
+35
-37
Document.purs
src/Gargantext/Pages/Corpus/Document.purs
+33
-35
Router.purs
src/Gargantext/Router.purs
+2
-2
No files found.
src/Gargantext/Pages/Corpus/Document.purs
View file @
cb87d66d
...
...
@@ -22,7 +22,7 @@ import Gargantext.Components.Node (NodePoly(..))
type State =
{ document :: Maybe (NodePoly Document
V3
)
{ document :: Maybe (NodePoly Document)
, inputValue :: String
}
...
...
@@ -99,22 +99,21 @@ data Document =
Document { abstract :: Maybe String
, authors :: Maybe String
, bdd :: Maybe String
, doi :: Maybe
Int
, doi :: Maybe
String
, language_iso2 :: Maybe String
, language_iso3 :: Maybe String
, page :: Maybe Int
-- , page :: Maybe Int
, publication_date :: Maybe String
, publication_second :: Maybe Int
, publication_minute :: Maybe Int
, publication_hour :: Maybe Int
, publication_day :: Maybe
String
--
, publication_second :: Maybe Int
--
, publication_minute :: Maybe Int
--
, publication_hour :: Maybe Int
, publication_day :: Maybe
Int
, publication_month :: Maybe Int
, publication_year :: Maybe Int
, source :: Maybe String
, title :: Maybe String
, uniqId :: Maybe String
, url :: Maybe String
, text :: Maybe String
--
, url :: Maybe String
--
, text :: Maybe String
}
defaultNodeDocument :: NodePoly Document
...
...
@@ -128,6 +127,7 @@ defaultNodeDocument =
, hyperdata : defaultDocument
}
-- TODO: BUG if DOI does not exist, page is not shown
defaultDocument :: Document
defaultDocument =
Document { abstract : Nothing
...
...
@@ -135,20 +135,19 @@ defaultDocument =
, bdd : Nothing
, doi : Nothing
, language_iso2 : Nothing
, language_iso3 : Nothing
, page : Nothing
--, page : Nothing
, publication_date : Nothing
, publication_second : Nothing
, publication_minute : Nothing
, publication_hour : Nothing
--
, publication_second : Nothing
--
, publication_minute : Nothing
--
, publication_hour : Nothing
, publication_day : Nothing
, publication_month : Nothing
, publication_year : Nothing
, source : Nothing
, title : Nothing
, uniqId : Nothing
, url : Nothing
, text : Nothing
--
, url : Nothing
--
, text : Nothing
}
derive instance genericDocument :: Generic Document _
...
...
@@ -223,39 +222,37 @@ instance decodeDocument :: DecodeJson Document
bdd <- obj .? "bdd"
doi <- obj .? "doi"
language_iso2 <- obj .? "language_iso2"
language_iso3 <- obj .? "language_iso3"
page <- obj .? "page"
-- page <- obj .? "page"
publication_date <- obj .? "publication_date"
publication_second <- obj .? "publication_second"
publication_minute <- obj .? "publication_minute"
publication_hour <- obj .? "publication_hour"
--
publication_second <- obj .? "publication_second"
--
publication_minute <- obj .? "publication_minute"
--
publication_hour <- obj .? "publication_hour"
publication_day <- obj .? "publication_day"
publication_month <- obj .? "publication_month"
publication_year <- obj .? "publication_year"
source <- obj .? "source"
title <- obj .? "title"
uniqId <- obj .? "uniqId"
url <- obj .? "url"
text <- obj .? "text"
--
url <- obj .? "url"
--
text <- obj .? "text"
pure $ Document { abstract
, authors
, bdd
, doi
, language_iso2
, language_iso3
, page
-- , page
, publication_date
, publication_second
, publication_minute
, publication_hour
--
, publication_second
--
, publication_minute
--
, publication_hour
, publication_day
, publication_month
, publication_year
, source
, title
, uniqId
, url
, text
--
, url
--
, text
}
------------------------------------------------------------------------
...
...
@@ -267,10 +264,11 @@ performAction (Load nId) _ _ = do
performAction (ChangeString ps) _ _ = pure unit
performAction (SetInput ps) _ _ = void <$> modifyState $ _ { inputValue = ps }
getNode :: Int -> Aff (NodePoly DocumentV3)
getNode :: Int -> Aff (NodePoly Document)
getNode = get <<< toUrl Back Node
_document :: Lens' State (Maybe (NodePoly Document
V3
))
_document :: Lens' State (Maybe (NodePoly Document))
_document = lens (\s -> s.document) (\s ss -> s{document = ss})
------------------------------------------------------------------------
...
...
@@ -394,8 +392,8 @@ docview = simpleSpec performAction render
text' x = text $ maybe "Nothing" identity x
badge s = span [className "badge badge-default badge-pill"] [text s]
NodePoly {hyperdata : Document
V3
document} =
maybe defaultNodeDocument
V3
identity state.document
NodePoly {hyperdata : Document document} =
maybe defaultNodeDocument identity state.document
aryPS :: Array String
aryPS = ["Map", "Main", "Stop"]
...
...
src/Gargantext/Router.purs
View file @
cb87d66d
...
...
@@ -34,7 +34,7 @@ routing =
<|> Folder <$> (route "folder" *> int)
<|> Corpus <$> (route "corpus" *> int)
<|> NGramsTable <$ route "ngrams"
<|> Document <$> (route "document" *> int)
<|> Document
<$> (route "document" *> int)
<|> Dashboard <$ route "dashboard"
<|> PGraphExplorer <$ route "graph"
<|> Annuaire <$> (route "annuaire" *> int)
...
...
@@ -52,7 +52,7 @@ instance showRoutes :: Show Routes where
show AddCorpus = "AddCorpus"
show SearchView = "Search"
show (UserPage i) = "User" <> show i
show (Document i)= "Document"
show (Document i)
= "Document"
show (Corpus i) = "Corpus" <> show i
show NGramsTable = "NGramsTable"
show (Annuaire i) = "Annuaire" <> 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