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
120
Issues
120
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
gargantext
purescript-gargantext
Commits
b52c1b60
Commit
b52c1b60
authored
Apr 12, 2019
by
James Laver
Committed by
Alexandre Delanoë
Apr 28, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Comment extra logging and remove all but one warning from touched modules
parent
5e813179
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
21 deletions
+15
-21
AnnotatedField.purs
src/Gargantext/Components/Annotated/AnnotatedField.purs
+12
-17
Document.purs
src/Gargantext/Pages/Corpus/Document.purs
+3
-4
No files found.
src/Gargantext/Components/Annotated/AnnotatedField.purs
View file @
b52c1b60
...
...
@@ -12,26 +12,21 @@
module Gargantext.Components.Annotated.AnnotatedField where
import Prelude hiding (div)
import Data.Unit (Unit, unit)
import Data.Array (fromFoldable)
import Data.Map as Map
import Data.Maybe (Maybe(..), maybe)
import Data.Lens (Lens',
Prism', over, view,
lens)
import Data.Lens (Lens', lens)
import Data.List as List
import Data.List (List(..), mapWithIndex, toUnfoldable, sortBy)
import Data.Ordering (Ordering(..))
import Data.List (List(..))
import Data.Tuple (Tuple(..))
import Effect (Effect)
import Effect.Class.Console (log)
import Effect.Unsafe (unsafePerformEffect)
import React (
Children,
ReactElement, ReactClass, createElement)
import React.DOM (
a, div, p, span, nav
, text)
import React (ReactElement, ReactClass, createElement)
import React.DOM (
p, span
, text)
import React.DOM.Props (className, onContextMenu)
import Thermite ( PerformAction, Render, Spec
, defaultPerformAction, createClass, createReactSpec
, _render, modifyState, writeState, focus, focusState
, simpleSpec, withState)
import Gargantext.Types (TermList(..))
import Thermite (PerformAction, Render, createReactSpec, simpleSpec, writeState)
import Gargantext.Types (TermList)
import Gargantext.Components.NgramsTable (NgramsTable(..), highlightNgrams, termStyle)
import Gargantext.Utils.React (WithChildren)
import Gargantext.Utils.Selection (getSelection, toString)
...
...
@@ -95,7 +90,7 @@ forceRefresh props state =
do wrote <- writeState (compile props)
log $ msg wrote
pure unit
where msg = maybe "AnnotatedField: failed to write new state" (const "AnnotatedField:
wrote new state
")
where msg = maybe "AnnotatedField: failed to write new state" (const "AnnotatedField:
recompiled
")
-- showContextMenu :: PerformAction State Props String
-- showContextMenu p s = pure unit
...
...
@@ -107,13 +102,11 @@ compile :: Props -> State
compile props =
unsafePerformEffect $
do let ret = { runs: runs props.text, contextMenu: { visible: false } }
log "Compiling..."
--
log "Compiling..."
pure ret
where runs (Just txt) = highlight props.ngrams txt
runs _ = Nil
-- highlightNgrams :: NgramsTable -> String -> Array (Tuple String (Maybe TermList))
highlight :: NgramsTable -> String -> List Run
highlight n t = List.fromFoldable $ highlightNgrams n t
...
...
@@ -129,6 +122,8 @@ contextMenuHandler d e =
y <- pageY e
pure $ PageOffset { x, y }
_runs :: Lens' State (List Run)
_runs = lens (\a -> a.runs) (\a r -> a { runs = r })
_contextMenu = lens (\a -> a.contextMenu) (\a m -> a { contextMenu = m })
-- _contextMenu :: Lens' State ???
-- _contextMenu = lens (\a -> a.contextMenu) (\a m -> a { contextMenu = m })
src/Gargantext/Pages/Corpus/Document.purs
View file @
b52c1b60
module Gargantext.Pages.Corpus.Document where
import Data.Argonaut (class DecodeJson,
class EncodeJson, decodeJson, jsonEmptyObject, (.?), (.??), (:=), (~>
))
import Data.Argonaut (class DecodeJson,
decodeJson, (.?), (.??
))
import Data.Generic.Rep (class Generic)
import Data.Lens (Lens', lens, (?~))
import Data.Generic.Rep.Show (genericShow)
...
...
@@ -9,11 +9,10 @@ import Data.Map as Map
import Data.Set as Set
import Data.Tuple (Tuple(..))
import Data.Maybe (Maybe(..), maybe)
import Data.Either (Either(..))
import Effect.Aff (Aff)
import React (ReactElement)
import React.DOM (
a, button, div, h4, h6, input, li, nav, option, p, select
, span, text, ul)
import React.DOM.Props (
_data, _id, _type, aria, className, href, name, onChange, onInput, placeholder, role, styl
e, value)
import React.DOM (
div, h4, li, option, p
, span, text, ul)
import React.DOM.Props (
classNam
e, value)
import Thermite (PerformAction, Render, Spec, modifyState, simpleSpec)
import Unsafe.Coerce (unsafeCoerce)
import Control.Monad.Trans.Class (lift)
...
...
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