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
885ba75b
Unverified
Commit
885ba75b
authored
Dec 19, 2018
by
Nicolas Pouillard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[GRAPH] container is now a prop of FacetsTable allowing customization in graph
parent
39181a8c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
6 deletions
+16
-6
FacetsTable.purs
src/Gargantext/Components/FacetsTable.purs
+10
-4
Table.purs
src/Gargantext/Components/Table.purs
+3
-1
Tabs.purs
src/Gargantext/Pages/Corpus/Graph/Tabs.purs
+3
-1
No files found.
src/Gargantext/Components/FacetsTable.purs
View file @
885ba75b
...
...
@@ -64,6 +64,7 @@ type Props =
, query :: Array String
, totalRecords :: Int
, chart :: ReactElement
, container :: T.TableContainerProps -> Array ReactElement
}
type State =
...
...
@@ -168,6 +169,7 @@ instance decodeResponse :: DecodeJson Response where
-- | Filter
-- TODO: unused
filterSpec :: forall state props action. Spec state props action
filterSpec = simpleSpec defaultPerformAction render
where
...
...
@@ -196,7 +198,7 @@ layoutDocview = simpleSpec performAction render
}
render :: Render State Props Action
render dispatch {nodeId, query, totalRecords, chart} deletionState _ =
render dispatch {nodeId, query, totalRecords, chart
, container
} deletionState _ =
[ br'
, div [ style {textAlign : "center"}] [ text " Filter "
, input [className "form-control", style {width : "120px", display : "inline-block"}, placeholder "Filter here"]
...
...
@@ -212,6 +214,7 @@ layoutDocview = simpleSpec performAction render
, totalRecords
, deletionState
, dispatch
, container
}
]
, div [className "col-md-12"]
...
...
@@ -245,7 +248,7 @@ layoutDocviewGraph = simpleSpec performAction render
}
render :: Render State Props Action
render dispatch {nodeId, query, totalRecords, chart} deletionState _ =
render dispatch {nodeId, query, totalRecords, chart
, container
} deletionState _ =
[ br'
, p [] [text ""]
...
...
@@ -259,6 +262,7 @@ layoutDocviewGraph = simpleSpec performAction render
, totalRecords
, deletionState
, dispatch
, container
}
, button [ style {backgroundColor: "peru", padding : "9px", color : "white", border : "white", float: "right"}
, onClick $ (\_ -> dispatch Trash)
...
...
@@ -311,6 +315,7 @@ type PageLoaderProps row =
, totalRecords :: Int
, dispatch :: Action -> Effect Unit
, deletionState :: State
, container :: T.TableContainerProps -> Array ReactElement
| row
}
...
...
@@ -319,17 +324,18 @@ renderPage :: forall props path.
{ totalRecords :: Int
, dispatch :: Action -> Effect Unit
, deletionState :: State
, container :: T.TableContainerProps -> Array ReactElement
| props
}
(Loader.Action PageParams)
renderPage _ _ {loaded: Nothing} _ = [] -- TODO loading spinner
renderPage loaderDispatch { totalRecords, dispatch
renderPage loaderDispatch { totalRecords, dispatch
, container
, deletionState: {documentIdsToDelete, documentIdsDeleted}}
{currentPath: {nodeId, query}, loaded: Just res} _ =
[ T.tableElt
{ rows
, setParams: \params -> liftEffect $ loaderDispatch (Loader.SetPath {nodeId, query, params})
, container
: T.graphContainer { title: "Documents" }
, container
, colNames:
T.ColumnName <$>
[ ""
...
...
src/Gargantext/Components/Table.purs
View file @
885ba75b
...
...
@@ -187,13 +187,15 @@ defaultContainer {title} props =
]
]
-- TODO: this needs to be in Gargantext.Pages.Corpus.Graph.Tabs
graphContainer :: {title :: String} -> TableContainerProps -> Array ReactElement
graphContainer {title} props =
[ div [className "row"]
[ div [className "col-md-12"] [b [] [text title]]
, div [className "col-md-12", style {marginTop : "10px"}] [props.pageSizeControl]
, div [className "col-md-12", style {marginTop : "10px"}] [props.pageSizeDescription]
, div [className "col-md-12", style {marginTop : "10px"}] [props.paginationLinks]
-- TODO better rendering of the paginationLinks
-- , div [className "col-md-12", style {marginTop : "10px"}] [props.paginationLinks]
]
, table [ className "table"]
[ thead [className "thead-dark"] [ props.tableHead ]
...
...
src/Gargantext/Pages/Corpus/Graph/Tabs.purs
View file @
885ba75b
...
...
@@ -7,6 +7,7 @@ import Data.Tuple (Tuple(..))
import Gargantext.Config (TabType(..), TabSubType(..))
import Gargantext.Components.GraphExplorer.Types (GraphSideCorpus(..))
import Gargantext.Components.FacetsTable as FT
import Gargantext.Components.Table as T
import Gargantext.Components.Tab as Tab
import React (ReactElement, ReactClass, Children, createElement)
import Thermite ( Spec, PerformAction, Render, _performAction, _render
...
...
@@ -28,11 +29,12 @@ pureTabs = hideState (const {activeTab: 0}) statefulTabs
tab :: forall props state. Array String -> GraphSideCorpus -> Tuple String (Spec state props Tab.Action)
tab query (GraphSideCorpus {corpusId: nodeId, corpusLabel}) =
Tuple corpusLabel $
cmapProps (const {nodeId, query, chart, totalRecords: 4736}) $
cmapProps (const {nodeId, query, chart, totalRecords: 4736
, container
}) $
noState FT.docViewSpec
where
-- TODO totalRecords: probably need to insert a corpusLoader.
chart = mempty
container = T.graphContainer {title: corpusLabel}
statefulTabs :: Spec Tab.State Props Tab.Action
statefulTabs =
...
...
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