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
140
Issues
140
List
Board
Labels
Milestones
Merge Requests
2
Merge Requests
2
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
5ddf1bee
Commit
5ddf1bee
authored
Jan 18, 2021
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into dev-bootstrap-v4-upgrade
parents
61f55710
6be8993a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
17 deletions
+37
-17
Types.purs
...text/Components/Forest/Tree/Node/Action/Search/Types.purs
+3
-3
Components.purs
src/Gargantext/Components/NgramsTable/Components.purs
+33
-13
Corpus.purs
src/Gargantext/Components/Nodes/Corpus.purs
+1
-1
No files found.
src/Gargantext/Components/Forest/Tree/Node/Action/Search/Types.purs
View file @
5ddf1bee
...
...
@@ -46,8 +46,8 @@ class Doc a where
dataFields :: Array DataField
dataFields = [ Gargantext
, Web
, External Nothing
, Web
-- , Files
]
...
...
@@ -59,8 +59,8 @@ data DataField = Gargantext
instance showDataField :: Show DataField where
show Gargantext = "Gargantext"
show (External _) = "
Others
" -- <> show x
show Web = "
W
eb"
show (External _) = "
Databases (APIs)
" -- <> show x
show Web = "
Soon: w
eb"
show Files = "Files"
instance docDataField :: Doc DataField where
...
...
src/Gargantext/Components/NgramsTable/Components.purs
View file @
5ddf1bee
...
...
@@ -115,7 +115,7 @@ renderNgramsTree p = R.createElement renderNgramsTreeCpt p []
renderNgramsTreeCpt :: R.Component RenderNgramsTree
renderNgramsTreeCpt = R.hooksComponentWithModule thisModule "renderNgramsTree" cpt
where
cpt { ngramsTable, ngrams, ngramsStyle, ngramsClick, ngramsEdit
} _ =
cpt { ngramsTable, ngrams, ngramsStyle, ngramsClick, ngramsEdit} _ =
pure $ H.ul {} [
H.span { className: "tree" } [
H.span { className: "righthanded" } [
...
...
@@ -133,12 +133,26 @@ renderNgramsTreeCpt = R.hooksComponentWithModule thisModule "renderNgramsTree" c
type NgramsDepth = {ngrams :: NgramsTerm, depth :: Int}
type NgramsClick = NgramsDepth -> Maybe (Effect Unit)
type T
ree
Props =
type T
ag
Props =
( ngramsClick :: NgramsClick
, ngramsDepth :: NgramsDepth
, ngramsEdit :: NgramsClick
, ngramsStyle :: Array DOM.Props
)
{- TODO refactor here
-- tag :: TagProps -> Array R.Element -> R.Element
tag tagProps =
case tagProps.ngramsClick tagProps.ngramsDepth of
Just effect ->
a (tagProps.ngramsStyle <> [DOM.onClick $ const effect])
Nothing ->
span tagProps.ngramsStyle
-}
type TreeProps =
( ngramsEdit :: NgramsClick
, ngramsTable :: NgramsTable
| TagProps
)
tree :: Record TreeProps -> R.Element
...
...
@@ -153,7 +167,8 @@ treeCpt = R.hooksComponentWithModule thisModule "tree" cpt
([ H.i { className, style } [] ]
<> [ R2.buff $ tag [ text $ " " <> ngramsTermText ngramsDepth.ngrams ] ]
<> maybe [] edit (ngramsEdit ngramsDepth)
<> [ forest cs ])
<> [ forest cs ]
)
where
tag =
case ngramsClick ngramsDepth of
...
...
@@ -214,18 +229,23 @@ renderNgramsItemCpt = R.hooksComponentWithModule thisModule "renderNgramsItem" c
, selected
, checkbox T.MapTerm
, checkbox T.StopTerm
, H.div {} [
if ngramsParent == Nothing
then renderNgramsTree { ngramsTable, ngrams, ngramsStyle, ngramsClick, ngramsEdit }
else
H.a { on: { click: const $ dispatch $ ToggleChild true ngrams } } [
H.i { className: "fa fa-plus" } []
, (R2.buff $ span ngramsStyle [text $ " " <> ngramsTermText ngrams])
]
]
, H.div {} ( if ngramsParent == Nothing
then [renderNgramsTree { ngramsTable, ngrams, ngramsStyle, ngramsClick, ngramsEdit }]
else [H.a { on: { click: const $ dispatch $ ToggleChild true ngrams } }
[ H.i { className: "glyphicon glyphicon-plus" } []]
, R2.buff $ tag [ text $ " " <> ngramsTermText ngramsDepth.ngrams ]
]
)
, H.text $ show (ngramsElement ^. _NgramsElement <<< _occurrences)
]
where
ngramsDepth= {ngrams, depth: 0 }
tag =
case ngramsClick ngramsDepth of
Just effect ->
a (ngramsStyle <> [DOM.onClick $ const effect])
Nothing ->
span ngramsStyle
onClick _ = do
R2.callTrigger toggleSidePanel unit
termList = ngramsElement ^. _NgramsElement <<< _list
...
...
src/Gargantext/Components/Nodes/Corpus.purs
View file @
5ddf1bee
...
...
@@ -314,7 +314,7 @@ renameableTextCpt = R.hooksComponentWithModule thisModule "renameableTextCpt" cp
cpt {isEditing: (true /\ setIsEditing), onRename, state: (text /\ setText)} _ = do
pure $ H.div { className: "input-group" } [
inputWithEnter {
autoFocus: false
autoFocus: false
, autoSave: false
, className: "form-control text"
, defaultValue: text
...
...
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