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
e85abd8b
Commit
e85abd8b
authored
Mar 15, 2018
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[TODO] Add the Tree in wrap function (template of all pages); before refactoring.
parent
a56c8af7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
31 deletions
+41
-31
DocView.purs
src/DocView.purs
+28
-28
Landing.purs
src/Landing.purs
+0
-1
Navigation.purs
src/Navigation.purs
+13
-2
No files found.
src/DocView.purs
View file @
e85abd8b
...
@@ -36,7 +36,7 @@ main :: forall e. Eff (dom:: DOM, console :: CONSOLE, ajax :: AJAX | e) Unit
...
@@ -36,7 +36,7 @@ main :: forall e. Eff (dom:: DOM, console :: CONSOLE, ajax :: AJAX | e) Unit
main = do
main = do
case createReactSpec spec tdata of
case createReactSpec spec tdata of
{ spec, dispatcher } -> void $ do
{ spec, dispatcher } -> void $ do
document <- DOM.window >>= DOM.document
document
<- DOM.window >>= DOM.document
container <- unsafePartial (fromJust <$> DOM.querySelector (QuerySelector "#app") (DOM.htmlDocumentToParentNode document))
container <- unsafePartial (fromJust <$> DOM.querySelector (QuerySelector "#app") (DOM.htmlDocumentToParentNode document))
RDOM.render (R.createFactory (R.createClass spec) {}) container
RDOM.render (R.createFactory (R.createClass spec) {}) container
...
@@ -96,8 +96,8 @@ instance decodeResponse :: DecodeJson Response where
...
@@ -96,8 +96,8 @@ instance decodeResponse :: DecodeJson Response where
type Name = String
type Name = String
type Open = Boolean
type Open = Boolean
type URL = String
type URL
= String
type ID = Int
type ID
= Int
data NTree a = NLeaf a | NNode ID Open Name (Array (NTree a))
data NTree a = NLeaf a | NNode ID Open Name (Array (NTree a))
...
@@ -111,7 +111,6 @@ toggleNode sid (NNode iid open name ary) =
...
@@ -111,7 +111,6 @@ toggleNode sid (NNode iid open name ary) =
toggleNode sid a = a
toggleNode sid a = a
spec :: Spec _ State _ Action
spec :: Spec _ State _ Action
spec = simpleSpec performAction render
spec = simpleSpec performAction render
where
where
...
@@ -195,7 +194,6 @@ exampleTree =
...
@@ -195,7 +194,6 @@ exampleTree =
]
]
]
]
------------------------------------------------------------------------
------------------------------------------------------------------------
-- TODO
-- TODO
-- alignment to the right
-- alignment to the right
...
@@ -405,23 +403,25 @@ greaterthan x y = x > y
...
@@ -405,23 +403,25 @@ greaterthan x y = x > y
newtype TableData a
newtype TableData a
= TableData
= TableData
{ rows :: Array {row :: a, delete :: Boolean}
{ rows :: Array { row :: a
, totalPages :: Int
, delete :: Boolean
, currentPage :: Int
}
, pageSize :: PageSizes
, totalPages :: Int
, currentPage :: Int
, pageSize :: PageSizes
, totalRecords :: Int
, totalRecords :: Int
, title :: String
, title
:: String
, tree :: FTree
, tree
:: FTree
}
}
newtype Corpus
newtype Corpus
= Corpus
= Corpus
{ _id :: Int
{ _id
:: Int
, url :: String
, url
:: String
, date :: String
, date
:: String
, title :: String
, title
:: String
, source :: String
, source :: String
, fav :: Boolean
, fav
:: Boolean
}
}
type CorpusTableData = TableData Corpus
type CorpusTableData = TableData Corpus
...
@@ -440,24 +440,24 @@ sdata = data' sampleData
...
@@ -440,24 +440,24 @@ sdata = data' sampleData
tdata :: CorpusTableData
tdata :: CorpusTableData
tdata = TableData
tdata = TableData
{ rows : sdata
{ rows
: sdata
, totalPages : 10
, totalPages
: 10
, currentPage : 1
, currentPage
: 1
, pageSize : PS10
, pageSize
: PS10
, totalRecords : 100
, totalRecords : 100
, title : "Documents"
, title
: "Documents"
, tree : exampleTree
, tree
: exampleTree
}
}
tdata' :: _ -> CorpusTableData
tdata' :: _ -> CorpusTableData
tdata' d = TableData
tdata' d = TableData
{ rows : d
{ rows
: d
, totalPages : 10
, totalPages
: 10
, currentPage : 1
, currentPage
: 1
, pageSize : PS10
, pageSize
: PS10
, totalRecords : 100
, totalRecords : 100
, title : "Documents"
, title
: "Documents"
, tree : exampleTree
, tree
: exampleTree
}
}
...
...
src/Landing.purs
View file @
e85abd8b
...
@@ -151,4 +151,3 @@ blocksRandomText = div [ className "row" ]
...
@@ -151,4 +151,3 @@ blocksRandomText = div [ className "row" ]
]
]
src/Navigation.purs
View file @
e85abd8b
...
@@ -156,11 +156,14 @@ pagesComponent s =
...
@@ -156,11 +156,14 @@ pagesComponent s =
routingSpec :: forall props eff. Spec (dom :: DOM |eff) AppState props Action
routingSpec :: forall props eff. Spec (dom :: DOM |eff) AppState props Action
routingSpec = simpleSpec performAction defaultRender
routingSpec = simpleSpec performAction defaultRender
wrap :: forall eff props. Spec (E eff) AppState props Action -> Spec (E eff) AppState props Action
wrap :: forall eff props. Spec (E eff) AppState props Action -> Spec (E eff) AppState props Action
wrap spec =
wrap spec =
fold
fold
[ sidebarnavSpec
[ sidebarnavSpec
--, tree
-- TODO Add Tree to the template
--, exampleTree'
, innerContainer $ spec
, innerContainer $ spec
, footerLegalInfo
, footerLegalInfo
]
]
...
@@ -172,6 +175,13 @@ wrap spec =
...
@@ -172,6 +175,13 @@ wrap spec =
div [className "container-fluid"] (render d p s c)
div [className "container-fluid"] (render d p s c)
]
]
]
]
-- TODO Add Tree to the template
-- exampleTree' :: forall props eff. Spec (dom :: DOM |eff) AppState props Action
-- exampleTree' = simpleSpec performAction render
-- where
-- render :: Render AppState props Action
-- render dispatch _ state _ = DV.toHtml dispatch DV.exampleTree
data LiNav = LiNav { title :: String
data LiNav = LiNav { title :: String
...
@@ -191,7 +201,7 @@ liNav (LiNav { title:tit
...
@@ -191,7 +201,7 @@ liNav (LiNav { title:tit
, title tit
, title tit
, href h
, href h
]
]
[ span [ className i ] []
[ span [ className i ] []
, text $ " " <> txt
, text $ " " <> txt
]
]
...
@@ -374,6 +384,7 @@ dispatchAction dispatcher _ UserPage = do
...
@@ -374,6 +384,7 @@ dispatchAction dispatcher _ UserPage = do
footerLegalInfo :: forall props eff. Spec (dom :: DOM |eff) AppState props Action
footerLegalInfo :: forall props eff. Spec (dom :: DOM |eff) AppState props Action
footerLegalInfo = simpleSpec performAction render
footerLegalInfo = simpleSpec performAction render
where
where
...
...
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