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
838ebba7
Commit
838ebba7
authored
Jun 21, 2022
by
Przemyslaw Kaminski
Committed by
Karen Konou
Jun 30, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ngramsTable] some more refactoring
parent
34d09662
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
31 deletions
+30
-31
Layout.purs
src/Gargantext/Components/Document/Layout.purs
+0
-1
NgramsTable.purs
src/Gargantext/Components/NgramsTable.purs
+20
-20
Core.purs
src/Gargantext/Components/NgramsTable/Core.purs
+7
-2
Tree.purs
src/Gargantext/Components/NgramsTable/Tree.purs
+1
-5
Texts.purs
src/Gargantext/Components/Nodes/Texts.purs
+2
-3
No files found.
src/Gargantext/Components/Document/Layout.purs
View file @
838ebba7
...
...
@@ -14,7 +14,6 @@ import Gargantext.Components.Bootstrap.Types (SpinnerTheme(..))
import Gargantext.Components.Document.Types (DocPath, Document(..), LoadedData, initialState)
import Gargantext.Components.NgramsTable.Core (addNewNgramA, applyNgramsPatches, coreDispatch, findNgramRoot, setTermListA)
import Gargantext.Components.NgramsTable.AutoSync (useAutoSync)
import Gargantext.Components.NgramsTable.SyncResetButton (syncResetButtons)
import Gargantext.Components.Node (NodePoly(..))
import Gargantext.Core.NgramsTable.Types (CoreAction(..), Versioned(..), replace)
import Gargantext.Utils as U
...
...
src/Gargantext/Components/NgramsTable.purs
View file @
838ebba7
...
...
@@ -36,10 +36,10 @@ import Effect.Class (liftEffect)
import Gargantext.Components.App.Store (Boxes)
import Gargantext.Components.Bootstrap as B
import Gargantext.Components.Bootstrap.Types (ButtonVariant(..), Variant(..))
import Gargantext.Components.NgramsTable.Core (addNewNgramA, applyNgramsPatches, chartsAfterSync, commitPatch, convOrderBy, coreDispatch, filterTermSize, ngramsRepoElementToNgramsElement, normNgram, patchSetFromMap, setTermListA, singletonNgramsTablePatch, toVersioned)
import Gargantext.Components.NgramsTable.Core (addNewNgramA, applyNgramsPatches, chartsAfterSync, commitPatch, convOrderBy, coreDispatch, filterTermSize, ngramsRepoElementToNgramsElement, normNgram, patchSetFromMap, setTermListA, singletonNgramsTablePatch, t
ablePatchHasNgrams, t
oVersioned)
import Gargantext.Components.NgramsTable.Search as NTS
import Gargantext.Components.NgramsTable.SelectionCheckbox as NTSC
import Gargantext.Components.NgramsTable.Tree
as NTT
import Gargantext.Components.NgramsTable.Tree
(renderNgramsItem, renderNgramsTree)
import Gargantext.Components.NgramsTable.Loader (useLoaderWithCacheAPI)
import Gargantext.Components.NgramsTable.SyncResetButton (syncResetButtons)
import Gargantext.Components.Nodes.Lists.Types as NT
...
...
@@ -357,14 +357,14 @@ loadedNgramsTableBodyCpt = here.component "loadedNgramsTableBody" cpt where
filteredConvertedRows = convertRow <$> filteredRows
convertRow ngramsElement =
{ row:
NTT.
renderNgramsItem { dispatch: performAction
, getNgramsChildren
, ngrams: ngramsElement ^. _NgramsElement <<< _ngrams
, ngramsElement
, ngramsLocalPatch
, ngramsParent
, ngramsSelection
, ngramsTable } []
{ row: renderNgramsItem { dispatch: performAction
, getNgramsChildren
, ngrams: ngramsElement ^. _NgramsElement <<< _ngrams
, ngramsElement
, ngramsLocalPatch
, ngramsParent
, ngramsSelection
, ngramsTable } []
, delete: false
}
...
...
@@ -551,7 +551,7 @@ displayRow { ngramsElement: NgramsElement {ngrams, root, list}
-- ^ and which satisfies the chosen term size
|| ngramsChildrenDiff ^. at ngrams == Just false
-- ^ unless they are scheduled to be removed.
||
NTT.
tablePatchHasNgrams ngramsLocalPatch ngrams
|| tablePatchHasNgrams ngramsLocalPatch ngrams
-- ^ unless they are being processed at the moment.
allNgramsSelectedOnFirstPage :: Set NgramsTerm -> PreConversionRows -> Boolean
...
...
@@ -688,15 +688,15 @@ ngramsTreeEditRealCpt = here.component "ngramsTreeEditReal" cpt where
pure $ H.div {}
[ H.p {}
[ H.text $ "Editing " <> ngramsTermText ngramsDepth.ngrams ]
,
NTT.
renderNgramsTree { getNgramsChildren: gnc
, ngramsClick
, ngramsDepth
, ngramsEdit
, ngramsStyle: []
, key: show ngramsParent'
<> "-" <> show ngramsChildren
<> "-" <> show ngramsChildrenDiff
}
, renderNgramsTree { getNgramsChildren: gnc
, ngramsClick
, ngramsDepth
, ngramsEdit
, ngramsStyle: []
, key: show ngramsParent'
<> "-" <> show ngramsChildren
<> "-" <> show ngramsChildrenDiff
}
, H.button { className: "btn btn-primary"
, on: { click: onSaveClick } --(const $ dispatch AddTermChildren)}
} [ H.text "Save" ]
...
...
src/Gargantext/Components/NgramsTable/Core.purs
View file @
838ebba7
...
...
@@ -8,7 +8,7 @@ import Data.Array (head)
import Data.Array as A
import Data.Either (Either(..))
import Data.Foldable (foldl)
import Data.Lens (use, view, (^?), (?=), (%~), (%=), (.~))
import Data.Lens (use, view, (^?), (
^.), (
?=), (%~), (%=), (.~))
import Data.Lens.At (at)
import Data.Lens.Common (_Just)
import Data.Lens.Fold (folded, traverseOf_)
...
...
@@ -17,7 +17,7 @@ import Data.List ((:), List(Nil))
import Data.List as L
import Data.Map (Map)
import Data.Map as Map
import Data.Maybe (Maybe(..), fromMaybe, fromMaybe')
import Data.Maybe (Maybe(..), fromMaybe, fromMaybe'
, isJust
)
import Data.Set (Set)
import Data.String as S
import Data.String.Common as DSC
...
...
@@ -518,3 +518,8 @@ postNgramsChartsAsync { listIds, nodeId, session, tabType } = do
acu = AsyncNgramsChartsUpdate { listId: head listIds
, tabType }
putNgramsAsync = PostNgramsChartsAsync (Just nodeId)
tablePatchHasNgrams :: NgramsTablePatch -> NgramsTerm -> Boolean
tablePatchHasNgrams (NgramsTablePatch ngramsPatches) ngrams =
isJust $ ngramsPatches ^. _PatchMap <<< at ngrams
src/Gargantext/Components/NgramsTable/Tree.purs
View file @
838ebba7
...
...
@@ -18,7 +18,7 @@ import DOM.Simple as DOM
import Effect (Effect)
import Effect.Aff (Aff, launchAff_)
import Effect.Class (liftEffect)
import Gargantext.Components.NgramsTable.Core (applyNgramsPatches, setTermListA)
import Gargantext.Components.NgramsTable.Core (applyNgramsPatches, setTermListA
, tablePatchHasNgrams
)
import Gargantext.Core.NgramsTable.Types (Action(..), NgramsClick, NgramsDepth, NgramsElement, NgramsTable, NgramsTablePatch(..), NgramsTerm, _NgramsElement, _NgramsRepoElement, _PatchMap, _children, _list, _ngrams, _occurrences, ngramsTermText, replace)
import Gargantext.Components.Table as Tbl
import Gargantext.Config.REST (logRESTError)
...
...
@@ -273,10 +273,6 @@ termStyle GT.CandidateTerm opacity = DOM.style
, opacity
}
tablePatchHasNgrams :: NgramsTablePatch -> NgramsTerm -> Boolean
tablePatchHasNgrams (NgramsTablePatch ngramsPatches) ngrams =
isJust $ ngramsPatches ^. _PatchMap <<< at ngrams
nextTermList :: GT.TermList -> GT.TermList
nextTermList GT.MapTerm = GT.StopTerm
...
...
src/Gargantext/Components/Nodes/Texts.purs
View file @
838ebba7
...
...
@@ -6,7 +6,6 @@ import Data.Generic.Rep (class Generic)
import Data.Maybe (Maybe(..))
import Data.Show.Generic (genericShow)
import Data.Tuple.Nested ((/\))
import Effect (Effect)
import Effect.Aff (launchAff_)
import Gargantext.Components.App.Store (Boxes)
import Gargantext.Components.App.Store as AppStore
...
...
@@ -128,7 +127,7 @@ textsLayoutWithKeyCpt = here.component "textsLayoutWithKey" cpt where
}
where
errorHandler = logRESTError here "[textsLayoutWithKey]"
afterCacheStateChange cacheState = do
afterCacheStateChange
_
cacheState = do
launchAff_ $ clearCache unit
-- TODO
--sessionUpdate $ setCacheState session nodeId cacheState
...
...
@@ -248,7 +247,7 @@ histoRender = R.createElement histoRenderCpt
histoRenderCpt :: R.Component HistoProps
histoRenderCpt = here.component "histoRender" cpt where
cpt { boxes, path, onClick, onInit, reload, session } _ = do
reload'
<- T.useLive T.unequal reload
_
<- T.useLive T.unequal reload
pure $ histo { boxes, path, onClick, onInit, session }
...
...
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