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 =
...
@@ -64,6 +64,7 @@ type Props =
, query :: Array String
, query :: Array String
, totalRecords :: Int
, totalRecords :: Int
, chart :: ReactElement
, chart :: ReactElement
, container :: T.TableContainerProps -> Array ReactElement
}
}
type State =
type State =
...
@@ -168,6 +169,7 @@ instance decodeResponse :: DecodeJson Response where
...
@@ -168,6 +169,7 @@ instance decodeResponse :: DecodeJson Response where
-- | Filter
-- | Filter
-- TODO: unused
filterSpec :: forall state props action. Spec state props action
filterSpec :: forall state props action. Spec state props action
filterSpec = simpleSpec defaultPerformAction render
filterSpec = simpleSpec defaultPerformAction render
where
where
...
@@ -196,7 +198,7 @@ layoutDocview = simpleSpec performAction render
...
@@ -196,7 +198,7 @@ layoutDocview = simpleSpec performAction render
}
}
render :: Render State Props Action
render :: Render State Props Action
render dispatch {nodeId, query, totalRecords, chart} deletionState _ =
render dispatch {nodeId, query, totalRecords, chart
, container
} deletionState _ =
[ br'
[ br'
, div [ style {textAlign : "center"}] [ text " Filter "
, div [ style {textAlign : "center"}] [ text " Filter "
, input [className "form-control", style {width : "120px", display : "inline-block"}, placeholder "Filter here"]
, input [className "form-control", style {width : "120px", display : "inline-block"}, placeholder "Filter here"]
...
@@ -212,6 +214,7 @@ layoutDocview = simpleSpec performAction render
...
@@ -212,6 +214,7 @@ layoutDocview = simpleSpec performAction render
, totalRecords
, totalRecords
, deletionState
, deletionState
, dispatch
, dispatch
, container
}
}
]
]
, div [className "col-md-12"]
, div [className "col-md-12"]
...
@@ -245,7 +248,7 @@ layoutDocviewGraph = simpleSpec performAction render
...
@@ -245,7 +248,7 @@ layoutDocviewGraph = simpleSpec performAction render
}
}
render :: Render State Props Action
render :: Render State Props Action
render dispatch {nodeId, query, totalRecords, chart} deletionState _ =
render dispatch {nodeId, query, totalRecords, chart
, container
} deletionState _ =
[ br'
[ br'
, p [] [text ""]
, p [] [text ""]
...
@@ -259,6 +262,7 @@ layoutDocviewGraph = simpleSpec performAction render
...
@@ -259,6 +262,7 @@ layoutDocviewGraph = simpleSpec performAction render
, totalRecords
, totalRecords
, deletionState
, deletionState
, dispatch
, dispatch
, container
}
}
, button [ style {backgroundColor: "peru", padding : "9px", color : "white", border : "white", float: "right"}
, button [ style {backgroundColor: "peru", padding : "9px", color : "white", border : "white", float: "right"}
, onClick $ (\_ -> dispatch Trash)
, onClick $ (\_ -> dispatch Trash)
...
@@ -311,6 +315,7 @@ type PageLoaderProps row =
...
@@ -311,6 +315,7 @@ type PageLoaderProps row =
, totalRecords :: Int
, totalRecords :: Int
, dispatch :: Action -> Effect Unit
, dispatch :: Action -> Effect Unit
, deletionState :: State
, deletionState :: State
, container :: T.TableContainerProps -> Array ReactElement
| row
| row
}
}
...
@@ -319,17 +324,18 @@ renderPage :: forall props path.
...
@@ -319,17 +324,18 @@ renderPage :: forall props path.
{ totalRecords :: Int
{ totalRecords :: Int
, dispatch :: Action -> Effect Unit
, dispatch :: Action -> Effect Unit
, deletionState :: State
, deletionState :: State
, container :: T.TableContainerProps -> Array ReactElement
| props
| props
}
}
(Loader.Action PageParams)
(Loader.Action PageParams)
renderPage _ _ {loaded: Nothing} _ = [] -- TODO loading spinner
renderPage _ _ {loaded: Nothing} _ = [] -- TODO loading spinner
renderPage loaderDispatch { totalRecords, dispatch
renderPage loaderDispatch { totalRecords, dispatch
, container
, deletionState: {documentIdsToDelete, documentIdsDeleted}}
, deletionState: {documentIdsToDelete, documentIdsDeleted}}
{currentPath: {nodeId, query}, loaded: Just res} _ =
{currentPath: {nodeId, query}, loaded: Just res} _ =
[ T.tableElt
[ T.tableElt
{ rows
{ rows
, setParams: \params -> liftEffect $ loaderDispatch (Loader.SetPath {nodeId, query, params})
, setParams: \params -> liftEffect $ loaderDispatch (Loader.SetPath {nodeId, query, params})
, container
: T.graphContainer { title: "Documents" }
, container
, colNames:
, colNames:
T.ColumnName <$>
T.ColumnName <$>
[ ""
[ ""
...
...
src/Gargantext/Components/Table.purs
View file @
885ba75b
...
@@ -187,13 +187,15 @@ defaultContainer {title} props =
...
@@ -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 :: String} -> TableContainerProps -> Array ReactElement
graphContainer {title} props =
graphContainer {title} props =
[ div [className "row"]
[ div [className "row"]
[ div [className "col-md-12"] [b [] [text title]]
[ 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.pageSizeControl]
, div [className "col-md-12", style {marginTop : "10px"}] [props.pageSizeDescription]
, 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"]
, table [ className "table"]
[ thead [className "thead-dark"] [ props.tableHead ]
[ thead [className "thead-dark"] [ props.tableHead ]
...
...
src/Gargantext/Pages/Corpus/Graph/Tabs.purs
View file @
885ba75b
...
@@ -7,6 +7,7 @@ import Data.Tuple (Tuple(..))
...
@@ -7,6 +7,7 @@ import Data.Tuple (Tuple(..))
import Gargantext.Config (TabType(..), TabSubType(..))
import Gargantext.Config (TabType(..), TabSubType(..))
import Gargantext.Components.GraphExplorer.Types (GraphSideCorpus(..))
import Gargantext.Components.GraphExplorer.Types (GraphSideCorpus(..))
import Gargantext.Components.FacetsTable as FT
import Gargantext.Components.FacetsTable as FT
import Gargantext.Components.Table as T
import Gargantext.Components.Tab as Tab
import Gargantext.Components.Tab as Tab
import React (ReactElement, ReactClass, Children, createElement)
import React (ReactElement, ReactClass, Children, createElement)
import Thermite ( Spec, PerformAction, Render, _performAction, _render
import Thermite ( Spec, PerformAction, Render, _performAction, _render
...
@@ -28,11 +29,12 @@ pureTabs = hideState (const {activeTab: 0}) statefulTabs
...
@@ -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 :: forall props state. Array String -> GraphSideCorpus -> Tuple String (Spec state props Tab.Action)
tab query (GraphSideCorpus {corpusId: nodeId, corpusLabel}) =
tab query (GraphSideCorpus {corpusId: nodeId, corpusLabel}) =
Tuple corpusLabel $
Tuple corpusLabel $
cmapProps (const {nodeId, query, chart, totalRecords: 4736}) $
cmapProps (const {nodeId, query, chart, totalRecords: 4736
, container
}) $
noState FT.docViewSpec
noState FT.docViewSpec
where
where
-- TODO totalRecords: probably need to insert a corpusLoader.
-- TODO totalRecords: probably need to insert a corpusLoader.
chart = mempty
chart = mempty
container = T.graphContainer {title: corpusLabel}
statefulTabs :: Spec Tab.State Props Tab.Action
statefulTabs :: Spec Tab.State Props Tab.Action
statefulTabs =
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