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
147629bf
Commit
147629bf
authored
Apr 24, 2023
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] #537 unselection ngramsSelection
parent
175fcd4d
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
20 deletions
+18
-20
Types.purs
src/Gargantext/Components/Document/Types.purs
+6
-10
NgramsTable.purs
src/Gargantext/Components/NgramsTable.purs
+1
-7
SyncResetButton.purs
src/Gargantext/Components/NgramsTable/SyncResetButton.purs
+1
-0
Functions.purs
src/Gargantext/Core/NgramsTable/Functions.purs
+4
-2
Types.purs
src/Gargantext/Core/NgramsTable/Types.purs
+6
-1
No files found.
src/Gargantext/Components/Document/Types.purs
View file @
147629bf
module Gargantext.Components.Document.Types where
import Data.Generic.Rep (class Generic)
import Data.Eq.Generic (genericEq)
import Data.Generic.Rep (class Generic)
import Data.Maybe (Maybe(..))
import Data.Newtype (class Newtype)
import Data.Show.Generic (genericShow)
import Data.Maybe (Maybe(..))
import Simple.JSON as JSON
import Gargantext.Prelude
import Gargantext.Components.Node (NodePoly(..))
import Gargantext.Core.NgramsTable.Types (CoreState, Versioned(..) , VersionedNgramsTable)
import Gargantext.Core.NgramsTable.Types (State, Versioned(..) , VersionedNgramsTable)
import Gargantext.Prelude
import Gargantext.Sessions (Session)
import Gargantext.Types (ListId, NodeID, TabType)
import Simple.JSON as JSON
type DocPath = {
listIds :: Array ListId
...
...
@@ -29,9 +27,6 @@ type LoadedData =
, ngramsTable :: VersionedNgramsTable
}
-- This is a subpart of NgramsTable.State.
type State = CoreState ()
initialState
:: forall props others
. { loaded :: { ngramsTable :: VersionedNgramsTable | others }
...
...
@@ -41,6 +36,7 @@ initialState {loaded: {ngramsTable: Versioned {version}}} =
{ ngramsLocalPatch: mempty
, ngramsStagePatch: mempty
, ngramsValidPatch: mempty
, ngramsSelection : mempty
, ngramsVersion: version
}
...
...
src/Gargantext/Components/NgramsTable.purs
View file @
147629bf
...
...
@@ -47,7 +47,7 @@ import Gargantext.Components.Table.Types (Params, orderByToGTOrderBy)
import Gargantext.Components.Table.Types as TT
import Gargantext.Config.REST (AffRESTError, RESTError, logRESTError)
import Gargantext.Core.NgramsTable.Functions (addNewNgramA, applyNgramsPatches, chartsAfterSync, commitPatch, convOrderBy, coreDispatch, filterTermSize, ngramsRepoElementToNgramsElement, normNgram, patchSetFromMap, singletonNgramsTablePatch, tablePatchHasNgrams, toVersioned)
import Gargantext.Core.NgramsTable.Types (Action(..), CoreAction(..),
Core
State, Dispatch, NgramsActionRef, NgramsClick, NgramsElement(..), NgramsPatch(..), NgramsTable, NgramsTablePatch(..), NgramsTerm(..), PageParams, PatchMap(..), Versioned(..), VersionedNgramsTable, VersionedWithCountNgramsTable, _NgramsElement, _NgramsRepoElement, _NgramsTable, _children, _list, _ngrams, _ngrams_repo_elements, _ngrams_scores, _occurrences, _root, applyPatchSet, ngramsTermText, replace)
import Gargantext.Core.NgramsTable.Types (Action(..), CoreAction(..), State, Dispatch, NgramsActionRef, NgramsClick, NgramsElement(..), NgramsPatch(..), NgramsTable, NgramsTablePatch(..), NgramsTerm(..), PageParams, PatchMap(..), Versioned(..), VersionedNgramsTable, VersionedWithCountNgramsTable, _NgramsElement, _NgramsRepoElement, _NgramsTable, _children, _list, _ngrams, _ngrams_repo_elements, _ngrams_scores, _occurrences, _root, applyPatchSet, ngramsTermText, replace)
import Gargantext.Hooks.Loader (useLoaderBox)
import Gargantext.Routes (SessionRoute(..)) as Routes
import Gargantext.Sessions (Session, get)
...
...
@@ -79,12 +79,6 @@ type TreeEdit =
, ngramsParent :: Maybe NgramsTerm -- Nothing means we are not currently grouping terms
}
type State =
CoreState (
ngramsSelection :: Set NgramsTerm
-- ^ The set of selected checkboxes of the first column.
)
initialTreeEdit :: TreeEdit
initialTreeEdit =
{ isEditing : false
...
...
src/Gargantext/Components/NgramsTable/SyncResetButton.purs
View file @
147629bf
...
...
@@ -50,6 +50,7 @@ syncResetButtonsCpt = here.component "syncResetButtons" cpt
synchronizeClick _ = delay unit $ \_ -> do
T.write_ true synchronizing
performAction $ Synchronize { afterSync: newAfterSync }
performAction ResetPatches
newAfterSync x = do
afterSync x
...
...
src/Gargantext/Core/NgramsTable/Functions.purs
View file @
147629bf
...
...
@@ -470,13 +470,15 @@ convOrderBy (T.DESC (T.ColumnName "Score")) = ScoreDesc
convOrderBy (T.ASC _) = TermAsc
convOrderBy (T.DESC _) = TermDesc
coreDispatch :: forall p s. CoreParams p -> T.Box
(CoreState s)
-> CoreDispatch
coreDispatch :: forall p s. CoreParams p -> T.Box
State
-> CoreDispatch
coreDispatch path state (Synchronize { afterSync }) =
syncPatches path state afterSync
coreDispatch _ state (CommitPatch pt) =
commitPatch pt state
coreDispatch _ state ResetPatches =
T.modify_ (_ { ngramsLocalPatch = mempty :: NgramsTablePatch }) state
T.modify_ (_ { ngramsLocalPatch = mempty :: NgramsTablePatch
, ngramsSelection = mempty :: Set NgramsTerm
}) state
isSingleNgramsTerm :: NgramsTerm -> Boolean
isSingleNgramsTerm nt = isSingleTerm $ ngramsTermText nt
...
...
src/Gargantext/Core/NgramsTable/Types.purs
View file @
147629bf
...
...
@@ -500,6 +500,12 @@ type CoreState s =
| s
}
type State =
CoreState (
ngramsSelection :: Set NgramsTerm
-- ^ The set of selected checkboxes of the first column.
)
type NgramsListByTabType = Map GT.TabType VersionedNgramsTable
data CoreAction
...
...
@@ -526,7 +532,6 @@ type CoreDispatch = CoreAction -> Effect Unit
type Dispatch = Action -> Effect Unit
type NgramsDepth = { ngrams :: NgramsTerm, depth :: Int }
type NgramsClick = NgramsDepth -> Maybe (Effect Unit)
type NgramsActionRef = R.Ref (Maybe (Unit -> Effect Unit))
...
...
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