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
e05ff3b4
Commit
e05ff3b4
authored
Apr 17, 2020
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ngrams] save/reset buttons
parent
ecb2608c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
NgramsTable.purs
src/Gargantext/Components/NgramsTable.purs
+10
-2
No files found.
src/Gargantext/Components/NgramsTable.purs
View file @
e05ff3b4
...
@@ -91,6 +91,7 @@ data Action
...
@@ -91,6 +91,7 @@ data Action
| ToggleSelect NgramsTerm
| ToggleSelect NgramsTerm
-- ^ Toggles the NgramsTerm in the `Set` `ngramsSelection`.
-- ^ Toggles the NgramsTerm in the `Set` `ngramsSelection`.
| ToggleSelectAll
| ToggleSelectAll
| ResetPatches
setTermListA :: NgramsTerm -> Replace TermList -> Action
setTermListA :: NgramsTerm -> Replace TermList -> Action
setTermListA n patch_list =
setTermListA n patch_list =
...
@@ -305,7 +306,8 @@ loadedNgramsTableSpec = Thermite.simpleSpec performAction render
...
@@ -305,7 +306,8 @@ loadedNgramsTableSpec = Thermite.simpleSpec performAction render
syncPatches path state
syncPatches path state
performAction (CommitPatch pt) _ {ngramsVersion} =
performAction (CommitPatch pt) _ {ngramsVersion} =
commitPatch (Versioned {version: ngramsVersion, data: pt})
commitPatch (Versioned {version: ngramsVersion, data: pt})
performAction ResetPatches _ {ngramsVersion} =
modifyState_ $ \s -> s { ngramsLocalPatch = { ngramsNewElems: mempty, ngramsPatches: mempty } }
performAction AddTermChildren _ {ngramsParent: Nothing} =
performAction AddTermChildren _ {ngramsParent: Nothing} =
-- impossible but harmless
-- impossible but harmless
pure unit
pure unit
...
@@ -329,7 +331,7 @@ loadedNgramsTableSpec = Thermite.simpleSpec performAction render
...
@@ -329,7 +331,7 @@ loadedNgramsTableSpec = Thermite.simpleSpec performAction render
state@{ ngramsParent, ngramsChildren, ngramsLocalPatch
state@{ ngramsParent, ngramsChildren, ngramsLocalPatch
, ngramsSelection, ngramsSelectAll }
, ngramsSelection, ngramsSelectAll }
_reactChildren =
_reactChildren =
(autoUpdate <> [
(autoUpdate <>
resetSaveButtons <>
[
R2.scuff $ T.table { colNames
R2.scuff $ T.table { colNames
, container
, container
, params: params /\ setParams -- TODO-LENS
, params: params /\ setParams -- TODO-LENS
...
@@ -340,6 +342,12 @@ loadedNgramsTableSpec = Thermite.simpleSpec performAction render
...
@@ -340,6 +342,12 @@ loadedNgramsTableSpec = Thermite.simpleSpec performAction render
])
])
where
where
autoUpdate = if withAutoUpdate then [ autoUpdateElt { duration: 5000, effect: dispatch Synchronize } ] else []
autoUpdate = if withAutoUpdate then [ autoUpdateElt { duration: 5000, effect: dispatch Synchronize } ] else []
resetButton = H.button { className: "btn btn-primary"
, on: { click: \_ -> dispatch ResetPatches } } [ H.text "Reset" ]
saveButton = H.button { className: "btn btn-primary"
, on: { click: \_ -> dispatch Synchronize }} [ H.text "Save" ]
resetSaveButtons = if ngramsLocalPatch == mempty then [] else
[ R2.scuff $ H.div {} [ resetButton, saveButton ] ]
totalRecords = A.length rows
totalRecords = A.length rows
filteredRows = T.filterRows { params } rows
filteredRows = T.filterRows { params } rows
colNames = T.ColumnName <$> ["Select", "Map", "Stop", "Terms", "Score"] -- see convOrderBy
colNames = T.ColumnName <$> ["Select", "Map", "Stop", "Terms", "Score"] -- see convOrderBy
...
...
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