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
6
Merge Requests
6
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
d1a59258
Commit
d1a59258
authored
Feb 16, 2022
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ngrams table] fix for batch tag change
parent
dcdc8e5e
Pipeline
#2486
failed with stage
in 0 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
65 additions
and
64 deletions
+65
-64
NgramsTable.purs
src/Gargantext/Components/NgramsTable.purs
+63
-60
Components.purs
src/Gargantext/Components/NgramsTable/Components.purs
+2
-3
Core.purs
src/Gargantext/Components/NgramsTable/Core.purs
+0
-1
No files found.
src/Gargantext/Components/NgramsTable.purs
View file @
d1a59258
...
...
@@ -27,7 +27,7 @@ import Effect (Effect)
import Effect.Aff (Aff)
import Gargantext.Components.App.Data (Boxes)
import Gargantext.Components.NgramsTable.Components as NTC
import Gargantext.Components.NgramsTable.Core (Action(..), CoreAction(..), CoreState, Dispatch, NgramsElement(..), NgramsPatch(..), NgramsTable, NgramsTerm, PageParams, PatchMap(..), Versioned(..), VersionedNgramsTable, VersionedWithCountNgramsTable, _NgramsElement, _NgramsRepoElement, _NgramsTable, _children, _list, _ngrams, _ngrams_repo_elements, _ngrams_scores, _occurrences, _root, addNewNgramA, applyNgramsPatches, applyPatchSet, chartsAfterSync, commitPatch, convOrderBy, coreDispatch, filterTermSize, fromNgramsPatches, ngramsRepoElementToNgramsElement, ngramsTermText, normNgram, patchSetFromMap, replace, singletonNgramsTablePatch, syncResetButtons, toVersioned)
import Gargantext.Components.NgramsTable.Core (Action(..), CoreAction(..), CoreState, Dispatch, NgramsElement(..), NgramsPatch(..), NgramsTable, NgramsTerm, PageParams, PatchMap(..), Versioned(..), VersionedNgramsTable, VersionedWithCountNgramsTable, _NgramsElement, _NgramsRepoElement, _NgramsTable, _children, _list, _ngrams, _ngrams_repo_elements, _ngrams_scores, _occurrences, _root, addNewNgramA, applyNgramsPatches, applyPatchSet, chartsAfterSync, commitPatch, convOrderBy, coreDispatch, filterTermSize, fromNgramsPatches, ngramsRepoElementToNgramsElement, ngramsTermText, normNgram, patchSetFromMap, replace, s
etTermListA, s
ingletonNgramsTablePatch, syncResetButtons, toVersioned)
import Gargantext.Components.NgramsTable.Loader (useLoaderWithCacheAPI)
import Gargantext.Components.Nodes.Lists.Types as NT
import Gargantext.Components.Table as TT
...
...
@@ -81,7 +81,10 @@ setTermListSetA ngramsTable ns new_list =
f n _unit = NgramsPatch { patch_list, patch_children: mempty }
where
cur_list = ngramsTable ^? at n <<< _Just <<< _NgramsRepoElement <<< _list
patch_list = maybe mempty (replace new_list) cur_list
--patch_list = maybe mempty (replace new_list) cur_list
patch_list = case cur_list of
Nothing -> mempty
Just cl -> replace cl new_list
toMap :: forall a. Set a -> Map a Unit
toMap = unsafeCoerce
-- TODO https://github.com/purescript/purescript-ordered-collections/pull/21
...
...
@@ -119,63 +122,63 @@ tableContainerCpt { dispatch
cpt props _ = do
{ searchQuery, termListFilter, termSizeFilter } <- T.useLive T.unequal path
pure $ H.div {className: "container-fluid"}
[
R2.row
[ H.div {className: "card col-12"}
[ H.div {className: "card-header"}
[
R2.row [ H.div {className: "col-md-2", style: {marginTop: "6px"}
}
[ H.div {} syncResetButton
, if (not queryExactMatches || A.null props.tableBody) && searchQuery /= "" then
-- , if (not $ Set.member (normNgram tabNgramType searchQuery) ngramsSelection) && searchQuery /= "" then
H.li { className: "list-group-item" } [
H.button { className: "btn btn-primary"
, on: { click: const $ dispatch
$ CoreAction
$ addNewNgramA
(normNgram tabNgramType searchQuery)
MapTerm
}
}
[ H.text ("Add " <> searchQuery) ]
] else H.div {} []
]
, H.div {className: "col-md-2", style: {marginTop : "6px"}}
[ H.li {className: "list-group-item"}
[ R2.select { id: "picklistmenu"
, className: "form-control custom-select"
, defaultValue: (maybe "" show termListFilter)
, on: {change: setTermListFilter <<< read <<< R.unsafeEventValue}}
(map optps1 termLists)]
]
, H.div {className: "col-md-2", style: {marginTop : "6px"}}
[ H.li {className: "list-group-item"}
[ R2.select {id: "picktermtype"
, className: "form-control custom-select"
, defaultValue: (maybe "" show termSizeFilter)
, on: {change: setTermSizeFilter <<< read <<< R.unsafeEventValue}}
(map optps1 termSizes)]
]
, H.div { className: "col-md-2", style: { marginTop: "6px" } }
[ H.li {className: "list-group-item"}
[ H.div { className: "form-inline" }
[ H.div { className: "form-group" }
[ props.pageSizeControl
, H.label {} [ H.text " items" ]
-- H.div { className: "col-md-6" } [ props.pageSizeControl ]
-- , H.div { className: "col-md-6" } [
-- ]
]
]
]
]
, H.div {className: "col-md-4", style: {marginTop : "6px", marginBottom : "1px"}}
[ H.li {className: "list-group-item"}
[ props.pageSizeDescription
, props.paginationLinks
]
]
]
pure $ H.div {className: "container-fluid"}
[
R2.row
[ H.div {className: "card col-12"}
[ H.div {className: "card-header"}
[ R2.row
[ H.div { className: "col-md-2", style: {marginTop: "6px" }
}
[ H.div {} syncResetButton
, if (not queryExactMatches || A.null props.tableBody) && searchQuery /= "" then
-- , if (not $ Set.member (normNgram tabNgramType searchQuery) ngramsSelection) && searchQuery /= "" then
H.li { className: "list-group-item" }
[
H.button { className: "btn btn-primary"
, on: { click: const $ dispatch
$ CoreAction
$ addNewNgramA
(normNgram tabNgramType searchQuery)
MapTerm
}
}
[ H.text ("Add " <> searchQuery) ]
] else H.div {} []
]
, H.div {className: "col-md-2", style: {marginTop : "6px"}}
[ H.li {className: "list-group-item"}
[ R2.select { id: "picklistmenu"
, className: "form-control custom-select"
, defaultValue: (maybe "" show termListFilter)
, on: {change: setTermListFilter <<< read <<< R.unsafeEventValue}}
(map optps1 termLists)]
]
, H.div {className: "col-md-2", style: {marginTop : "6px"}}
[ H.li {className: "list-group-item"}
[ R2.select {id: "picktermtype"
, className: "form-control custom-select"
, defaultValue: (maybe "" show termSizeFilter)
, on: {change: setTermSizeFilter <<< read <<< R.unsafeEventValue}}
(map optps1 termSizes)]
]
, H.div { className: "col-md-2", style: { marginTop: "6px" } }
[ H.li {className: "list-group-item"}
[ H.div { className: "form-inline" }
[ H.div { className: "form-group" }
[ props.pageSizeControl
, H.label {} [ H.text " items" ]
-- H.div { className: "col-md-6" } [ props.pageSizeControl ]
-- , H.div { className: "col-md-6" } [
-- ]
]
]
]
]
, H.div {className: "col-md-4", style: {marginTop : "6px", marginBottom : "1px"}}
[ H.li {className: "list-group-item"}
[ props.pageSizeDescription
, props.paginationLinks
]
]
]
]
, editor
, if (selectionsExist ngramsSelection)
...
...
@@ -202,7 +205,7 @@ tableContainerCpt { dispatch
-- WHY setPath f = origSetPageParams (const $ f path)
setTermListFilter x = T.modify (_ { termListFilter = x }) path
setTermSizeFilter x = T.modify (_ { termSizeFilter = x }) path
setSelection
= dispatch <<< setTermListSetA ngramsTableCache ngramsSelection
setSelection
term = dispatch $ setTermListSetA ngramsTableCache ngramsSelection term
editor = H.div {} $ maybe [] edit ngramsParent
where
...
...
src/Gargantext/Components/NgramsTable/Components.purs
View file @
d1a59258
...
...
@@ -222,7 +222,6 @@ type RenderNgramsItem = (
renderNgramsItem :: R2.Component RenderNgramsItem
renderNgramsItem = R.createElement renderNgramsItemCpt
renderNgramsItemCpt :: R.Component RenderNgramsItem
renderNgramsItemCpt = here.component "renderNgramsItem" cpt
where
...
...
@@ -265,8 +264,8 @@ renderNgramsItemCpt = here.component "renderNgramsItem" cpt
termList = ngramsElement ^. _NgramsElement <<< _list
ngramsStyle = [termStyle termList ngramsOpacity]
ngramsEdit = Just <<< dispatch <<< SetParentResetChildren <<< Just <<< view _ngrams
ngramsClick
=
Just <<< dispatch <<< CoreAction <<< cycleTermListItem <<< view _ngrams
ngramsClick
=
Just <<< dispatch <<< CoreAction <<< cycleTermListItem <<< view _ngrams
-- ^ This is the old behavior it is nicer to use since one can
-- rapidly change the ngram list without waiting for confirmation.
-- However this might expose bugs. One of them can be reproduced
...
...
src/Gargantext/Components/NgramsTable/Core.purs
View file @
d1a59258
...
...
@@ -1067,7 +1067,6 @@ type SyncResetButtonsProps =
syncResetButtons :: Record SyncResetButtonsProps -> R.Element
syncResetButtons p = R.createElement syncResetButtonsCpt p []
syncResetButtonsCpt :: R.Component SyncResetButtonsProps
syncResetButtonsCpt = here.component "syncResetButtons" cpt
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