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
142
Issues
142
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
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
gargantext
purescript-gargantext
Commits
6f236437
Commit
6f236437
authored
Dec 19, 2018
by
Sudhir Kumar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
table changes with duplication
parent
8f8915c3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
2 deletions
+66
-2
FacetsTable.purs
src/Gargantext/Components/FacetsTable.purs
+50
-2
Table.purs
src/Gargantext/Components/Table.purs
+16
-0
No files found.
src/Gargantext/Components/FacetsTable.purs
View file @
6f236437
...
...
@@ -176,7 +176,7 @@ filterSpec = simpleSpec defaultPerformAction render
]]
docViewSpec :: Spec {} Props Void
docViewSpec = hideState (const initialState) layoutDocview
docViewSpec = hideState (const initialState) layoutDocview
Graph
-- | Main layout of the Documents Tab of a Corpus
layoutDocview :: Spec State Props Action
...
...
@@ -226,6 +226,54 @@ layoutDocview = simpleSpec performAction render
]
]
layoutDocviewGraph :: Spec State Props Action
layoutDocviewGraph = simpleSpec performAction render
where
performAction :: PerformAction State Props Action
performAction (MarkFavorites nids) {nodeId} _ =
void $ lift $ putFavorites nodeId (FavoriteQuery {favorites: nids})
--TODO add array of delete rows here
performAction (ToggleDocumentToDelete nid) _ _ =
modifyState_ \state -> state {documentIdsToDelete = toggleSet nid state.documentIdsToDelete}
performAction Trash {nodeId} {documentIdsToDelete} = do
void $ lift $ deleteDocuments nodeId (DeleteDocumentQuery {documents: Set.toUnfoldable documentIdsToDelete})
modifyState_ \{documentIdsToDelete, documentIdsDeleted} ->
{ documentIdsToDelete: mempty
, documentIdsDeleted: documentIdsDeleted <> documentIdsToDelete
}
render :: Render State Props Action
render dispatch {nodeId, query, totalRecords, chart} deletionState _ =
[ br'
, p [] [text ""]
, br'
, div [className "container-fluid"]
[ div [className "row"]
[ chart
, div [className "col-md-12"]
[ pageLoader
{ path: initialPageParams {nodeId, query}
, totalRecords
, deletionState
, dispatch
}
, button [ style {backgroundColor: "peru", padding : "9px", color : "white", border : "white", float: "right"}
, onClick $ (\_ -> dispatch Trash)
]
[ i [className "glyphitem glyphicon glyphicon-trash", style {marginRight : "9px"}] []
, text "Trash it !"
]
]
]
]
]
type PageParams = {nodeId :: Int, query :: Array String, params :: T.Params}
initialPageParams :: {nodeId :: Int, query :: Array String} -> PageParams
...
...
@@ -281,7 +329,7 @@ renderPage loaderDispatch { totalRecords, dispatch
[ T.tableElt
{ rows
, setParams: \params -> liftEffect $ loaderDispatch (Loader.SetPath {nodeId, query, params})
, container: T.
default
Container { title: "Documents" }
, container: T.
graph
Container { title: "Documents" }
, colNames:
T.ColumnName <$>
[ ""
...
...
src/Gargantext/Components/Table.purs
View file @
6f236437
...
...
@@ -187,6 +187,22 @@ defaultContainer {title} props =
]
]
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]
]
, table [ className "table"]
[ thead [className "thead-dark"] [ props.tableHead ]
, tbody [] props.tableBody
]
]
stateParams :: State -> Params
stateParams {pageSize, currentPage, orderBy} = {offset, limit, orderBy}
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