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
5f83b235
Verified
Commit
5f83b235
authored
Jun 21, 2023
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ngrams] child in group is clickable now
parent
34e6dd6a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
10 deletions
+12
-10
NgramsTable.purs
src/Gargantext/Components/NgramsTable.purs
+1
-1
Tree.purs
src/Gargantext/Components/NgramsTable/Tree.purs
+8
-8
Types.purs
src/Gargantext/Core/NgramsTable/Types.purs
+3
-1
No files found.
src/Gargantext/Components/NgramsTable.purs
View file @
5f83b235
...
@@ -902,7 +902,7 @@ ngramsTreeEditRealCpt = here.component "ngramsTreeEditReal" cpt where
...
@@ -902,7 +902,7 @@ ngramsTreeEditRealCpt = here.component "ngramsTreeEditReal" cpt where
-- | Computed
-- | Computed
-- |
-- |
let
let
ngramsDepth = { depth: 0, ngrams: ngramsParent' }
ngramsDepth = { depth: 0, ngrams: ngramsParent'
, parent: Nothing
}
ngramsChildrenPatched :: Set NgramsTerm
ngramsChildrenPatched :: Set NgramsTerm
ngramsChildrenPatched = applyPatchSet (patchSetFromMap ngramsChildrenDiff) $ Set.fromFoldable ngramsChildren
ngramsChildrenPatched = applyPatchSet (patchSetFromMap ngramsChildrenDiff) $ Set.fromFoldable ngramsChildren
...
...
src/Gargantext/Components/NgramsTable/Tree.purs
View file @
5f83b235
...
@@ -225,7 +225,7 @@ treeLoadedCpt = here.component "treeLoaded" cpt where
...
@@ -225,7 +225,7 @@ treeLoadedCpt = here.component "treeLoaded" cpt where
if depth > 10 then
if depth > 10 then
const $ H.text "ERROR DEPTH > 10"
const $ H.text "ERROR DEPTH > 10"
else
else
H.ul {} <<< map (\ngrams -> tree ((Record.delete (Proxy :: Proxy "ngramsChildren") params) { ngramsDepth = {depth, ngrams} })) <<< L.toUnfoldable
H.ul {} <<< map (\ngrams -> tree ((Record.delete (Proxy :: Proxy "ngramsChildren") params) { ngramsDepth = {depth, ngrams
, parent: Just ngramsDepth.ngrams
} })) <<< L.toUnfoldable
type RenderNgramsItem =
type RenderNgramsItem =
( boxes :: Boxes
( boxes :: Boxes
...
@@ -318,7 +318,7 @@ renderNgramsItemCpt = here.component "renderNgramsItem" cpt
...
@@ -318,7 +318,7 @@ renderNgramsItemCpt = here.component "renderNgramsItem" cpt
)
)
]
]
where
where
ngramsDepth = { ngrams, depth: 0 }
ngramsDepth = { ngrams, depth: 0
, parent: Nothing
}
tag =
tag =
case ngramsClick ngramsDepth of
case ngramsClick ngramsDepth of
Just effect ->
Just effect ->
...
@@ -346,14 +346,14 @@ renderNgramsItemCpt = here.component "renderNgramsItem" cpt
...
@@ -346,14 +346,14 @@ renderNgramsItemCpt = here.component "renderNgramsItem" cpt
getNgramsChildren' n = A.fromFoldable $ ngramsChildren n
getNgramsChildren' n = A.fromFoldable $ ngramsChildren n
ngramsChildren :: NgramsTerm -> List NgramsTerm
ngramsChildren :: NgramsTerm -> List NgramsTerm
ngramsChildren n = tbl ^.. ix n <<< _NgramsRepoElement <<< _children <<< folded
ngramsChildren n = tbl ^.. ix n <<< _NgramsRepoElement <<< _children <<< folded
ngramsClick :: { depth :: Int, ngrams :: NgramsTerm } -> Maybe (Effect Unit)
ngramsClick :: NgramsClick
ngramsClick p = Just $ do
ngramsClick p@{ depth: 0 } = Just $ do
-- here.log2 "[ngramsClick] p" p
if p.depth == 0 then
(dispatch <<< CoreAction <<< cycleTermListItem <<< view _ngrams) p
(dispatch <<< CoreAction <<< cycleTermListItem <<< view _ngrams) p
-- traverse_ (dispatch <<< CoreAction <<< cycleTermListItem) (A.cons p.ngrams $ getNgramsChildren' p.ngrams)
-- traverse_ (dispatch <<< CoreAction <<< cycleTermListItem) (A.cons p.ngrams $ getNgramsChildren' p.ngrams)
else
ngramsClick p@{ parent: Nothing } = Just $ do
pure unit
here.log2 "[renderNgramsItem] unexpected empty parent for ngrams depth" p
ngramsClick p@{ parent: Just p' } = Just $ do
(dispatch <<< CoreAction <<< cycleTermListItem) p'
-- ^ This is the old behavior it is nicer to use since one can
-- ^ This is the old behavior it is nicer to use since one can
-- rapidly change the ngram list without waiting for confirmation.
-- rapidly change the ngram list without waiting for confirmation.
-- However this might expose bugs. One of them can be reproduced
-- However this might expose bugs. One of them can be reproduced
...
...
src/Gargantext/Core/NgramsTable/Types.purs
View file @
5f83b235
...
@@ -545,7 +545,9 @@ type CoreDispatch = CoreAction -> Effect Unit
...
@@ -545,7 +545,9 @@ type CoreDispatch = CoreAction -> Effect Unit
type Dispatch = Action -> Effect Unit
type Dispatch = Action -> Effect Unit
type NgramsDepth = { ngrams :: NgramsTerm, depth :: Int }
type NgramsDepth = { ngrams :: NgramsTerm
, depth :: Int
, parent :: Maybe NgramsTerm }
type NgramsClick = NgramsDepth -> Maybe (Effect Unit)
type NgramsClick = NgramsDepth -> Maybe (Effect Unit)
type NgramsActionRef = R.Ref (Maybe (Unit -> 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