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
c5b11698
Commit
c5b11698
authored
Mar 12, 2021
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[toestand] some NgramsTable work
parent
38f1fe6f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
37 deletions
+37
-37
NgramsTable.purs
src/Gargantext/Components/NgramsTable.purs
+37
-37
No files found.
src/Gargantext/Components/NgramsTable.purs
View file @
c5b11698
...
@@ -306,27 +306,7 @@ loadedNgramsTableCpt = here.component "loadedNgramsTable" cpt where
...
@@ -306,27 +306,7 @@ loadedNgramsTableCpt = here.component "loadedNgramsTable" cpt where
-- R.useEffectOnce' $ do
-- R.useEffectOnce' $ do
-- T.listen (\_ -> TT.changePage 1 params) searchQuery
-- T.listen (\_ -> TT.changePage 1 params) searchQuery
-- filteredRows :: PreConversionRows
let rows :: PreConversionRows
-- no need to filter offset if cache is off
let filteredRows = if cacheState == NT.CacheOn then TT.filterRows { params: params' } rows else rows
filteredConvertedRows :: TT.Rows
filteredConvertedRows = convertRow <$> filteredRows
convertRow ngramsElement =
{ row: NTC.renderNgramsItem { dispatch: performAction
, ngrams: ngramsElement ^. _NgramsElement <<< _ngrams
, ngramsElement
, ngramsLocalPatch
, ngramsParent
, ngramsSelection
, ngramsTable
, sidePanelTriggers } []
, delete: false
}
allNgramsSelected = allNgramsSelectedOnFirstPage ngramsSelection filteredRows
rows :: PreConversionRows
rows = orderWith (
rows = orderWith (
Seq.mapMaybe (\(Tuple ng nre) ->
Seq.mapMaybe (\(Tuple ng nre) ->
let Additive s = ng_scores ^. at ng <<< _Just in
let Additive s = ng_scores ^. at ng <<< _Just in
...
@@ -347,6 +327,26 @@ loadedNgramsTableCpt = here.component "loadedNgramsTable" cpt where
...
@@ -347,6 +327,26 @@ loadedNgramsTableCpt = here.component "loadedNgramsTable" cpt where
Just TermDesc -> sortWith \x -> Down $ x ^. _NgramsElement <<< _ngrams
Just TermDesc -> sortWith \x -> Down $ x ^. _NgramsElement <<< _ngrams
_ -> identity -- the server ordering is enough here
_ -> identity -- the server ordering is enough here
-- filteredRows :: PreConversionRows
-- no need to filter offset if cache is off
filteredRows = if cacheState == NT.CacheOn then TT.filterRows { params: params' } rows else rows
filteredConvertedRows :: TT.Rows
filteredConvertedRows = convertRow <$> filteredRows
convertRow ngramsElement =
{ row: NTC.renderNgramsItem { dispatch: performAction
, ngrams: ngramsElement ^. _NgramsElement <<< _ngrams
, ngramsElement
, ngramsLocalPatch
, ngramsParent
, ngramsSelection
, ngramsTable
, sidePanelTriggers } []
, delete: false
}
allNgramsSelected = allNgramsSelectedOnFirstPage ngramsSelection filteredRows
totalRecords = fromMaybe (Seq.length rows) mTotalRows
totalRecords = fromMaybe (Seq.length rows) mTotalRows
performAction = mkDispatch { filteredRows
performAction = mkDispatch { filteredRows
...
@@ -380,23 +380,23 @@ loadedNgramsTableCpt = here.component "loadedNgramsTable" cpt where
...
@@ -380,23 +380,23 @@ loadedNgramsTableCpt = here.component "loadedNgramsTable" cpt where
, NTC.searchInput { key: "search-input"
, NTC.searchInput { key: "search-input"
, searchQuery }
, searchQuery }
, TT.table
, TT.table
{ colNames
{ colNames
, container: tableContainer
, container: tableContainer
{ dispatch: performAction
{ dispatch: performAction
, ngramsChildren
, ngramsChildren
, ngramsParent
, ngramsParent
, ngramsSelection
, ngramsSelection
, ngramsTable
, ngramsTable
, path
, path
, syncResetButton: [ syncResetButton path' ]
, tabNgramType }
, params
, rows: filteredConvertedRows
, syncResetButton: [ syncResetButton path' ]
, syncResetButton: [ syncResetButton path' ]
, tabNgramType }
, totalRecords
, params
, wrapColElts:
, rows: filteredConvertedRows
wrapColElts { allNgramsSelected, dispatch: performAction, ngramsSelection }
, syncResetButton: [ syncResetButton path' ]
}
, totalRecords
, wrapColElts:
wrapColElts { allNgramsSelected, dispatch: performAction, ngramsSelection }
}
, syncResetButton path'
, syncResetButton path'
]
]
...
...
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