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
2370d69c
Commit
2370d69c
authored
Jul 18, 2018
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FACTO] adding AddCorpus to Specs of Layout and Corpus description to the right place.
parent
0b6ad414
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
124 additions
and
131 deletions
+124
-131
Corpus.purs
src/Gargantext/Pages/Corpus.purs
+70
-8
Body.purs
src/Gargantext/Pages/Corpus/Doc/Body.purs
+0
-63
Layout.purs
src/Gargantext/Pages/Layout.purs
+2
-2
Actions.purs
src/Gargantext/Pages/Layout/Actions.purs
+3
-3
Specs.purs
src/Gargantext/Pages/Layout/Specs.purs
+3
-3
AddCorpus.purs
src/Gargantext/Pages/Layout/Specs/AddCorpus.purs
+10
-0
Actions.purs
src/Gargantext/Pages/Layout/Specs/AddCorpus/Actions.purs
+2
-2
Specs.purs
src/Gargantext/Pages/Layout/Specs/AddCorpus/Specs.purs
+27
-43
States.purs
src/Gargantext/Pages/Layout/Specs/AddCorpus/States.purs
+1
-1
Search.purs
src/Gargantext/Pages/Layout/Specs/Search.purs
+2
-2
States.purs
src/Gargantext/Pages/Layout/States.purs
+4
-4
No files found.
src/Gargantext/Pages/Corpus.purs
View file @
2370d69c
module Gargantext.Pages.Corpus
module Gargantext.Pages.Corpus where
( module Gargantext.Pages.Corpus.States
, module Gargantext.Pages.Corpus.Actions
, module Gargantext.Pages.Corpus.Specs
) where
import Gargantext.Pages.Corpus.States
import Prelude hiding (div)
import Gargantext.Pages.Corpus.Actions
import Gargantext.Pages.Corpus.Specs
import Control.Monad.Eff.Console (CONSOLE)
import DOM (DOM)
import Data.Array (fold)
import Gargantext.Components.Charts.Options.ECharts (chart)
import Gargantext.Pages.Corpus.Doc.Facets.Dashboard (globalPublis)
import Gargantext.Pages.Corpus.Doc.Facets as Tab
import Network.HTTP.Affjax (AJAX)
import React.DOM (div, h3, hr, i, p, text)
import React.DOM.Props (className, style)
import Thermite (Render, Spec, defaultPerformAction, simpleSpec)
type State = Tab.State
type Action = Tab.Action
type Corpus = { title :: String
, desc :: String
, query :: String
, date :: String
, authors :: String
}
initialState :: State
initialState = Tab.initialState
spec' :: forall eff props. Spec (dom :: DOM, console :: CONSOLE, ajax :: AJAX | eff) Tab.State props Tab.Action
spec' = fold [ corpusSpec
, Tab.tab1
]
corpusSpec :: forall props eff . Spec eff Tab.State props Tab.Action
corpusSpec = simpleSpec defaultPerformAction render
where
render :: Render Tab.State props Tab.Action
render dispatch _ state _ =
[ div [className "row"]
[ div [className "col-md-3"] [ h3 [] [text corpus.title] ]
, div [className "col-md-9"] [ hr [style {height : "2px",backgroundColor : "black"}] [] ]
]
, div [className "row"] [ div [className "jumbotron1", style {padding : "12px 0px 20px 12px"}]
[ div [ className "col-md-8 content"]
[ p [] [ i [className "fa fa-globe"] []
, text corpus.desc
]
, p [] [ i [className "fab fa-searchengin"] []
, text corpus.query
]
]
, div [ className "col-md-4 content"]
[ p [] [ i [className "fa fa-calendar"] []
, text corpus.date
]
, p [] [ i [className "fa fa-user"] []
, text corpus.authors
]
]
]
]
, chart globalPublis
]
where
corpus :: Corpus
corpus = { title : "IMT Global Publications"
, desc : " Hal Database"
, query : " Query: all publications"
, date : " June. 26 2018, 10:59 am"
, authors : " Author(s): françois.pineau"
}
src/Gargantext/Pages/Corpus/Doc/Body.purs
deleted
100644 → 0
View file @
0b6ad414
module Gargantext.Pages.Corpus.Doc.Body where
import Prelude hiding (div)
import Control.Monad.Eff.Console (CONSOLE)
import DOM (DOM)
import Data.Array (fold)
import Gargantext.Components.Charts.Options.ECharts (chart)
import Gargantext.Pages.Corpus.Doc.Facets.Dashboard (globalPublis)
import Gargantext.Pages.Corpus.Doc.Facets as Tab
import Network.HTTP.Affjax (AJAX)
import React.DOM (div, h3, hr, i, p, text)
import React.DOM.Props (className, style)
import Thermite (Render, Spec, defaultPerformAction, simpleSpec)
type State = Tab.State
type Action = Tab.Action
initialState :: State
initialState = Tab.initialState
spec' :: forall eff props. Spec (dom :: DOM, console :: CONSOLE, ajax :: AJAX | eff) Tab.State props Tab.Action
spec' = fold [ corpusAnalysisSpec
, Tab.tab1
]
corpusAnalysisSpec :: forall props eff . Spec eff Tab.State props Tab.Action
corpusAnalysisSpec = simpleSpec defaultPerformAction render
where
render :: Render Tab.State props Tab.Action
render dispatch _ state _ =
[ div [className "row"]
[ div [className "col-md-3"]
[ h3 [] [text "IMT Global publications"]
]
, div [className "col-md-9"]
[ hr [style {height : "2px",backgroundColor : "black"}] []
]
]
, div [className "row"]
[ div [className "jumbotron1", style {padding : "12px 0px 20px 12px"}]
[ div [ className "col-md-8 content"]
[ p [] [ i [className "fa fa-globe"] []
, text " Hal Database"
]
, p [] [ i [className "fab fa-searchengin"] []
, text " Query: all publications with all schools ids"
]
]
, div [ className "col-md-4 content"]
[ p [] [ i [className "fa fa-calendar"] []
, text " June. 26 2018, 10:59 am"
]
, p [] [ i [className "fa fa-user"] []
, text " Author(s): françois.pineau"
]
]
]
]
, chart globalPublis
]
src/Gargantext/Pages/Layout.purs
View file @
2370d69c
...
@@ -3,7 +3,7 @@ module Gargantext.Pages.Layout where
...
@@ -3,7 +3,7 @@ module Gargantext.Pages.Layout where
import Prelude hiding (div)
import Prelude hiding (div)
import Gargantext.Components.Login as LN
import Gargantext.Components.Login as LN
import Gargantext.Pages.Layout.Actions (Action(..))
import Gargantext.Pages.Layout.Actions (Action(..))
import Gargantext.Pages.Corpus as AC
import Gargantext.Pages.
Layout.Specs.Add
Corpus as AC
import Gargantext.Pages.Corpus.Doc.Annotation as D
import Gargantext.Pages.Corpus.Doc.Annotation as D
import Gargantext.Pages.Corpus.Doc.Document as DV
import Gargantext.Pages.Corpus.Doc.Document as DV
import Gargantext.Pages.Corpus.Doc.Facets as TV
import Gargantext.Pages.Corpus.Doc.Facets as TV
...
@@ -11,7 +11,7 @@ import Gargantext.Pages.Corpus.Doc.Facets.Graph as GE
...
@@ -11,7 +11,7 @@ import Gargantext.Pages.Corpus.Doc.Facets.Graph as GE
import Gargantext.Pages.Corpus.Doc.Facets.Terms.NgramsTable as NG
import Gargantext.Pages.Corpus.Doc.Facets.Terms.NgramsTable as NG
import Gargantext.Pages.Corpus.User.Users as U
import Gargantext.Pages.Corpus.User.Users as U
import Gargantext.Pages.Home as L
import Gargantext.Pages.Home as L
import Gargantext.Pages.Search as S
import Gargantext.Pages.
Layout.Specs.
Search as S
import Gargantext.Router (Routes(..))
import Gargantext.Router (Routes(..))
dispatchAction :: forall t115 t445 t447.
dispatchAction :: forall t115 t445 t447.
...
...
src/Gargantext/Pages/Layout/Actions.purs
View file @
2370d69c
...
@@ -13,9 +13,9 @@ import Data.Lens (Prism', prism)
...
@@ -13,9 +13,9 @@ import Data.Lens (Prism', prism)
import Gargantext.Components.Login as LN
import Gargantext.Components.Login as LN
import Gargantext.Components.Modals.Modal (modalShow)
import Gargantext.Components.Modals.Modal (modalShow)
import Gargantext.Components.Tree as Tree
import Gargantext.Components.Tree as Tree
import Gargantext.Pages.
Corpus
as AC
import Gargantext.Pages.
Layout.Specs.AddCorpus
as AC
import Gargantext.Pages.Corpus.Doc.Annotation as D
import Gargantext.Pages.Corpus.Doc.Annotation as D
import Gargantext.Pages.Corpus
.Doc.Body
as CA
import Gargantext.Pages.Corpus
as CA
import Gargantext.Pages.Corpus.Doc.Document as DV
import Gargantext.Pages.Corpus.Doc.Document as DV
import Gargantext.Pages.Corpus.Doc.Facets as TV
import Gargantext.Pages.Corpus.Doc.Facets as TV
import Gargantext.Pages.Corpus.Doc.Facets.Dashboard as Dsh
import Gargantext.Pages.Corpus.Doc.Facets.Dashboard as Dsh
...
@@ -24,7 +24,7 @@ import Gargantext.Pages.Corpus.Doc.Facets.Terms.NgramsTable as NG
...
@@ -24,7 +24,7 @@ import Gargantext.Pages.Corpus.Doc.Facets.Terms.NgramsTable as NG
import Gargantext.Pages.Corpus.User.Users as U
import Gargantext.Pages.Corpus.User.Users as U
import Gargantext.Pages.Home as L
import Gargantext.Pages.Home as L
import Gargantext.Pages.Layout.States (AppState)
import Gargantext.Pages.Layout.States (AppState)
import Gargantext.Pages.
Search
as S
import Gargantext.Pages.
Layout.Specs.Search
as S
import Gargantext.Router (Routes)
import Gargantext.Router (Routes)
import Network.HTTP.Affjax (AJAX)
import Network.HTTP.Affjax (AJAX)
...
...
src/Gargantext/Pages/Layout/Specs.purs
View file @
2370d69c
...
@@ -42,9 +42,9 @@ import Gargantext.Pages.Layout.Actions ( _addCorpusAction
...
@@ -42,9 +42,9 @@ import Gargantext.Pages.Layout.Actions ( _addCorpusAction
, _treeAction
, _treeAction
, _userPageAction
, _userPageAction
)
)
import Gargantext.Pages.Corpus as AC
import Gargantext.Pages.
Layout.Specs.Add
Corpus as AC
import Gargantext.Pages.Corpus.Doc.Annotation as D
import Gargantext.Pages.Corpus.Doc.Annotation as D
import Gargantext.Pages.Corpus
.Doc.Body
as CA
import Gargantext.Pages.Corpus as CA
import Gargantext.Pages.Corpus.Doc.Document as DV
import Gargantext.Pages.Corpus.Doc.Document as DV
import Gargantext.Pages.Corpus.Doc.Facets as TV
import Gargantext.Pages.Corpus.Doc.Facets as TV
import Gargantext.Pages.Corpus.Doc.Facets.Dashboard as Dsh
import Gargantext.Pages.Corpus.Doc.Facets.Dashboard as Dsh
...
@@ -54,7 +54,7 @@ import Gargantext.Pages.Corpus.User.Users as U
...
@@ -54,7 +54,7 @@ import Gargantext.Pages.Corpus.User.Users as U
import Gargantext.Pages.Home as L
import Gargantext.Pages.Home as L
import Gargantext.Pages.Layout.Actions (Action(..), performAction)
import Gargantext.Pages.Layout.Actions (Action(..), performAction)
import Gargantext.Pages.Layout.States (AppState, E)
import Gargantext.Pages.Layout.States (AppState, E)
import Gargantext.Pages.Search as S
import Gargantext.Pages.
Layout.Specs.
Search as S
import Gargantext.Router (Routes(..))
import Gargantext.Router (Routes(..))
import Network.HTTP.Affjax (AJAX)
import Network.HTTP.Affjax (AJAX)
...
...
src/Gargantext/Pages/Layout/Specs/AddCorpus.purs
0 → 100644
View file @
2370d69c
module Gargantext.Pages.Layout.Specs.AddCorpus
( module Gargantext.Pages.Layout.Specs.AddCorpus.States
, module Gargantext.Pages.Layout.Specs.AddCorpus.Actions
, module Gargantext.Pages.Layout.Specs.AddCorpus.Specs
) where
import Gargantext.Pages.Layout.Specs.AddCorpus.States
import Gargantext.Pages.Layout.Specs.AddCorpus.Actions
import Gargantext.Pages.Layout.Specs.AddCorpus.Specs
src/Gargantext/Pages/Corpus/Actions.purs
→
src/Gargantext/Pages/
Layout/Specs/Add
Corpus/Actions.purs
View file @
2370d69c
module Gargantext.Pages.Corpus.Actions where
module Gargantext.Pages.
Layout.Specs.Add
Corpus.Actions where
import Prelude hiding (div)
import Prelude hiding (div)
...
@@ -17,7 +17,7 @@ import Data.Maybe (Maybe(Just))
...
@@ -17,7 +17,7 @@ import Data.Maybe (Maybe(Just))
import Data.MediaType.Common (applicationJSON)
import Data.MediaType.Common (applicationJSON)
import Gargantext.Components.Modals.Modal (modalHide)
import Gargantext.Components.Modals.Modal (modalHide)
import Gargantext.Pages.Corpus.States
import Gargantext.Pages.
Layout.Specs.Add
Corpus.States
import Network.HTTP.Affjax (AJAX, affjax, defaultRequest)
import Network.HTTP.Affjax (AJAX, affjax, defaultRequest)
import Network.HTTP.RequestHeader (RequestHeader(..))
import Network.HTTP.RequestHeader (RequestHeader(..))
...
...
src/Gargantext/Pages/Corpus/Specs.purs
→
src/Gargantext/Pages/
Layout/Specs/Add
Corpus/Specs.purs
View file @
2370d69c
module Gargantext.Pages.Corpus.Specs where
module Gargantext.Pages.
Layout.Specs.Add
Corpus.Specs where
import Prelude hiding (div)
import Prelude hiding (div)
...
@@ -18,8 +18,8 @@ import Data.MediaType.Common (applicationJSON)
...
@@ -18,8 +18,8 @@ import Data.MediaType.Common (applicationJSON)
import Gargantext.Components.Modals.Modal (modalHide)
import Gargantext.Components.Modals.Modal (modalHide)
import Gargantext.Pages.Corpus.States
import Gargantext.Pages.
Layout.Specs.Add
Corpus.States
import Gargantext.Pages.Corpus.Actions
import Gargantext.Pages.
Layout.Specs.Add
Corpus.Actions
import Network.HTTP.Affjax (AJAX, affjax, defaultRequest)
import Network.HTTP.Affjax (AJAX, affjax, defaultRequest)
import Network.HTTP.RequestHeader (RequestHeader(..))
import Network.HTTP.RequestHeader (RequestHeader(..))
...
@@ -30,40 +30,32 @@ import Routing.Hash.Aff (setHash)
...
@@ -30,40 +30,32 @@ import Routing.Hash.Aff (setHash)
import Thermite (PerformAction, Render, Spec, _render, cotransform, modifyState, simpleSpec)
import Thermite (PerformAction, Render, Spec, _render, cotransform, modifyState, simpleSpec)
modalSpec :: forall eff props. Boolean -> String -> Spec eff State props Action -> Spec eff State props Action
modalSpec :: forall eff props. Boolean -> String -> Spec eff State props Action -> Spec eff State props Action
modalSpec sm t = over _render \render d p s c ->
modalSpec sm t = over _render \render d p s c ->
[ div [ _id "addCorpus", className $ "modal myModal" <> if sm then "" else " fade"
[ div [ _id "addCorpus", className $ "modal myModal" <> if sm then "" else " fade"
, role "dialog"
, role "dialog"
, _data {show : true}
, _data {show : true}
][ div [ className "modal-dialog"
][ div [ className "modal-dialog", role "document"]
, role "document"
[ div [ className "modal-content"]
] [ div [ className "modal-content"]
[ div [ className "modal-header"]
[ div [ className "modal-header"]
[ h5 [ className "modal-title" ] [ text $ t ]
[ h5 [ className "modal-title"
, button [ _type "button"
]
, className "close"
[ text $ t
, _data { dismiss : "modal"}
] [ span [ aria {hidden : true}] [ text "X"] ]
]
]
, button [ _type "button"
, className "close"
, div [ className "modal-body"] (render d p s c)
, _data { dismiss : "modal"}
]
] [ span [ aria {hidden : true}]
]
[ text "X"]
]
]
]
]
, div [ className "modal-body"]
(render d p s c)
]
]
]
]
spec' :: forall eff props. Spec (console:: CONSOLE, ajax :: AJAX, dom :: DOM | eff) State props Action
spec' :: forall eff props. Spec (console:: CONSOLE, ajax :: AJAX, dom :: DOM | eff) State props Action
spec' = modalSpec true "Search Results" layoutAddcorpus
spec' = modalSpec true "Search Results" layoutAddcorpus
layoutModal :: forall e. { response :: Array Response | e} -> Array ReactElement
layoutModal :: forall e. { response :: Array Response | e} -> Array ReactElement
layoutModal state =
layoutModal state =
[button [ _type "button"
[button [ _type "button"
...
@@ -78,10 +70,8 @@ layoutModal state =
...
@@ -78,10 +70,8 @@ layoutModal state =
, role "document"
, role "document"
] [ div [ className "modal-content"]
] [ div [ className "modal-content"]
[ div [ className "modal-header"]
[ div [ className "modal-header"]
[ h5 [ className "modal-title"
[ h5 [className "modal-title"]
]
[text "CorpusView" ]
[ text "CorpusView"
]
, button [ _type "button"
, button [ _type "button"
, className "close"
, className "close"
, _data { dismiss : "modal"}
, _data { dismiss : "modal"}
...
@@ -112,27 +102,21 @@ layoutModal state =
...
@@ -112,27 +102,21 @@ layoutModal state =
]
]
layoutAddcorpus :: forall props eff . Spec (console::CONSOLE, ajax::AJAX, dom::DOM | eff) State props Action
layoutAddcorpus :: forall props eff . Spec (console::CONSOLE, ajax::AJAX, dom::DOM | eff) State props Action
layoutAddcorpus = simpleSpec performAction render
layoutAddcorpus = simpleSpec performAction render
where
where
render :: Render State props Action
render :: Render State props Action
render dispatch _ state _ =
render dispatch _ state _ =
[
[ div [className "container1"] []
div [className "container1"] []
, div [className "container1"]
, div [className "container1"]
[ div [className "jumbotron"]
[
div [className "jumbotron"]
[ div [className "row"]
[ div [className "row"]
[
[ div [className "col-md-6"] (layoutModal state)
div [className "col-md-6"] (layoutModal state)
, div [className "col-md-6"]
, div [className "col-md-6"]
[
[ h3 [] [text "Corpusview"]
h3 [] [text "Corpusview"]
, ul [className "list-group"] $ map fn1 state.response
, ul [className "list-group"] $ map fn1 state.response
, button [onClick \_ -> dispatch GO] [text "GO"]
, button [onClick \_ -> dispatch GO] [text "GO"]
]
]
]
]
]
]
]
]
...
...
src/Gargantext/Pages/Corpus/States.purs
→
src/Gargantext/Pages/
Layout/Specs/Add
Corpus/States.purs
View file @
2370d69c
module Gargantext.Pages.Corpus.States where
module Gargantext.Pages.
Layout.Specs.Add
Corpus.States where
import Prelude hiding (div)
import Prelude hiding (div)
import Data.Argonaut (class DecodeJson, class EncodeJson, decodeJson, encodeJson, jsonEmptyObject, (.?), (:=), (~>))
import Data.Argonaut (class DecodeJson, class EncodeJson, decodeJson, encodeJson, jsonEmptyObject, (.?), (:=), (~>))
...
...
src/Gargantext/Pages/Search.purs
→
src/Gargantext/Pages/
Layout/Specs/
Search.purs
View file @
2370d69c
module Gargantext.Pages.Search where
module Gargantext.Pages.
Layout.Specs.
Search where
import Control.Monad.Aff.Console (CONSOLE)
import Control.Monad.Aff.Console (CONSOLE)
import Control.Monad.Cont.Trans (lift)
import Control.Monad.Cont.Trans (lift)
...
@@ -21,7 +21,7 @@ type State =
...
@@ -21,7 +21,7 @@ type State =
initialState :: State
initialState :: State
initialState =
initialState =
{
{
query : ""
query : "
empty query
"
}
}
...
...
src/Gargantext/Pages/Layout/States.purs
View file @
2370d69c
...
@@ -9,9 +9,9 @@ import Data.Maybe (Maybe(Just))
...
@@ -9,9 +9,9 @@ import Data.Maybe (Maybe(Just))
import Gargantext.Components.Login as LN
import Gargantext.Components.Login as LN
import Gargantext.Components.Tree as Tree
import Gargantext.Components.Tree as Tree
import Gargantext.Pages.Corpus as AC
import Gargantext.Pages.Layout.Specs.AddCorpus as AC
import Gargantext.Pages.Corpus as CA
import Gargantext.Pages.Corpus.Doc.Annotation as D
import Gargantext.Pages.Corpus.Doc.Annotation as D
import Gargantext.Pages.Corpus.Doc.Body as CA
import Gargantext.Pages.Corpus.Doc.Document as DV
import Gargantext.Pages.Corpus.Doc.Document as DV
import Gargantext.Pages.Corpus.Doc.Facets as TV
import Gargantext.Pages.Corpus.Doc.Facets as TV
import Gargantext.Pages.Corpus.Doc.Facets.Dashboard as Dsh
import Gargantext.Pages.Corpus.Doc.Facets.Dashboard as Dsh
...
@@ -19,7 +19,7 @@ import Gargantext.Pages.Corpus.Doc.Facets.Graph as GE
...
@@ -19,7 +19,7 @@ import Gargantext.Pages.Corpus.Doc.Facets.Graph as GE
import Gargantext.Pages.Corpus.Doc.Facets.Terms.NgramsTable as NG
import Gargantext.Pages.Corpus.Doc.Facets.Terms.NgramsTable as NG
import Gargantext.Pages.Corpus.User.Users as U
import Gargantext.Pages.Corpus.User.Users as U
import Gargantext.Pages.Home as L
import Gargantext.Pages.Home as L
import Gargantext.Pages.
Search
as S
import Gargantext.Pages.
Layout.Specs.Search
as S
import Gargantext.Router (Routes(..))
import Gargantext.Router (Routes(..))
import Network.HTTP.Affjax (AJAX)
import Network.HTTP.Affjax (AJAX)
...
@@ -37,7 +37,7 @@ type AppState =
...
@@ -37,7 +37,7 @@ type AppState =
, docAnnotationState :: D.State
, docAnnotationState :: D.State
, ntreeState :: Tree.State
, ntreeState :: Tree.State
, tabviewState :: TV.State
, tabviewState :: TV.State
, search :: String
, search
:: String
, corpusState :: CA.State
, corpusState :: CA.State
, showLogin :: Boolean
, showLogin :: Boolean
, showCorpus :: Boolean
, showCorpus :: Boolean
...
...
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