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
aeb9b674
Verified
Commit
aeb9b674
authored
Apr 28, 2023
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[annotation] don't allow spaces in doc annotation selection
parent
fc1136e1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
15 deletions
+11
-15
Field.purs
src/Gargantext/Components/Annotation/Field.purs
+11
-14
Menu.purs
src/Gargantext/Components/Annotation/Menu.purs
+0
-1
No files found.
src/Gargantext/Components/Annotation/Field.purs
View file @
aeb9b674
...
...
@@ -13,18 +13,18 @@ module Gargantext.Components.Annotation.Field where
import Gargantext.Prelude
import DOM.Simple.Event as DE
import Data.Array as A
import Data.List (List(..), (:))
import Data.Maybe (Maybe(..), maybe)
import Data.String.Common (joinWith)
import Data.Tuple (Tuple(..), snd)
import Data.Tuple.Nested ((/\))
import DOM.Simple.Event as DE
import Effect (Effect)
import Gargantext.Components.Annotation.Menu (annotationMenu, AnnotationMenu)
import Gargantext.Components.Annotation.Types (MenuType(..), ModeType(..), termClass)
import Gargantext.Core.NgramsTable.Functions (findNgramTermList, highlightNgrams, normNgram)
import Gargantext.Core.NgramsTable.Types (NgramsTable, NgramsTerm)
import Gargantext.Core.NgramsTable.Types (NgramsTable, NgramsTerm
(..)
)
import Gargantext.Types (CTabNgramType(..), TermList)
import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.Selection as Sel
...
...
@@ -35,7 +35,7 @@ import Record as Record
import Toestand as T
here :: R2.Here
here = R2.here "Gargantext.Components.Annotation.
Annotated
Field"
here = R2.here "Gargantext.Components.Annotation.Field"
-- @NOTE #386: add parameter "type" ("Authors", "Terms")
type Props =
...
...
@@ -52,7 +52,6 @@ type MouseEvent = E.SyntheticEvent DE.MouseEvent
annotatedField :: R2.Leaf Props
annotatedField = R2.leaf annotatedFieldCpt
annotatedFieldCpt :: R.Component Props
annotatedFieldCpt = here.component "annotatedField" cpt where
cpt props _ = do
...
...
@@ -71,7 +70,6 @@ type InnerProps =
annotatedFieldInner :: R2.Leaf InnerProps
annotatedFieldInner = R2.leaf annotatedFieldInnerCpt
annotatedFieldInnerCpt :: R.Component InnerProps
annotatedFieldInnerCpt = here.component "annotatedFieldInner" cpt where
cpt { menuRef
...
...
@@ -159,14 +157,14 @@ onAnnotationSelect
s <- Sel.getSelection
case s of
Just sel -> do
case
Sel.selectionToString sel
of
"" -> hideMenu { menuRef, redrawMenu }
case
(normNgram CTabTerms $ Sel.selectionToString sel)
of
NormNgramsTerm
"" -> hideMenu { menuRef, redrawMenu }
sel' -> do
showMenu { event
, getList: findNgramTermList ngrams
, menuRef
, menuType: NewNgram
, ngram:
normNgram CTabTerms sel'
, ngram: sel' --
normNgram CTabTerms sel'
, redrawMenu
, setTermList }
Nothing -> hideMenu { menuRef, redrawMenu }
...
...
@@ -241,7 +239,6 @@ type RunProps =
annotateRun :: R2.Leaf RunProps
annotateRun = R2.leaf annotatedRunCpt
annotatedRunCpt :: R.Component RunProps
annotatedRunCpt = here.component "annotatedRun" cpt where
cpt { list, onSelect, text } _ = pure $ case list of
...
...
src/Gargantext/Components/Annotation/Menu.purs
View file @
aeb9b674
...
...
@@ -36,7 +36,6 @@ type AnnotationMenu =
annotationMenu :: R2.Leaf Props
annotationMenu = R2.leaf annotationMenuCpt
annotationMenuCpt :: R.Component Props
annotationMenuCpt = here.component "main" cpt where
cpt { menuRef } _ = do
...
...
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