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
154
Issues
154
List
Board
Labels
Milestones
Merge Requests
3
Merge Requests
3
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
43cc54f2
Verified
Commit
43cc54f2
authored
Oct 02, 2025
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[graph] add option to copy neighborhood terms to clipboard
parent
be93b32d
Pipeline
#7956
passed with stages
in 32 minutes and 24 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
2 deletions
+21
-2
Sidebar.purs
src/Gargantext/Components/GraphExplorer/Sidebar.purs
+19
-0
Clipboard.js
src/Gargantext/Utils/Clipboard.js
+2
-2
No files found.
src/Gargantext/Components/GraphExplorer/Sidebar.purs
View file @
43cc54f2
...
@@ -21,6 +21,7 @@ import Data.Tuple.Nested ((/\))
...
@@ -21,6 +21,7 @@ import Data.Tuple.Nested ((/\))
import Effect (Effect)
import Effect (Effect)
import Effect.Aff (launchAff_)
import Effect.Aff (launchAff_)
import Effect.Class (liftEffect)
import Effect.Class (liftEffect)
import Effect.Timer (setTimeout)
import Gargantext.Components.App.Store as AppStore
import Gargantext.Components.App.Store as AppStore
import Gargantext.Components.Bootstrap as B
import Gargantext.Components.Bootstrap as B
import Gargantext.Components.Bootstrap.Types (ButtonVariant(..), Elevation(..), Variant(..))
import Gargantext.Components.Bootstrap.Types (ButtonVariant(..), Elevation(..), Variant(..))
...
@@ -41,6 +42,7 @@ import Gargantext.Hooks.Sigmax.Types as SigmaxT
...
@@ -41,6 +42,7 @@ import Gargantext.Hooks.Sigmax.Types as SigmaxT
import Gargantext.Sessions (Session)
import Gargantext.Sessions (Session)
import Gargantext.Types (CTabNgramType, FrontendError(..), NodeID, SidePanelState(..), TabSubType(..), TabType(..), TermList(..), modeTabType)
import Gargantext.Types (CTabNgramType, FrontendError(..), NodeID, SidePanelState(..), TabSubType(..), TabType(..), TermList(..), modeTabType)
import Gargantext.Utils (getter, nbsp, setter, (?))
import Gargantext.Utils (getter, nbsp, setter, (?))
import Gargantext.Utils.Clipboard (modalClipboard)
import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.Toestand as T2
import Gargantext.Utils.Toestand as T2
import Partial.Unsafe (unsafePartial)
import Partial.Unsafe (unsafePartial)
...
@@ -487,6 +489,9 @@ neighborhoodCpt = R.memo' $ here.component "neighborhood" cpt
...
@@ -487,6 +489,9 @@ neighborhoodCpt = R.memo' $ here.component "neighborhood" cpt
termCount /\ termCountBox <-
termCount /\ termCountBox <-
R2.useBox' 0
R2.useBox' 0
copied <- T.useBox false
copied' <- T.useLive T.unequal copied
-- | Computed
-- | Computed
-- |
-- |
let
let
...
@@ -520,6 +525,11 @@ neighborhoodCpt = R.memo' $ here.component "neighborhood" cpt
...
@@ -520,6 +525,11 @@ neighborhoodCpt = R.memo' $ here.component "neighborhood" cpt
T.write_ neighbours' termListBox
T.write_ neighbours' termListBox
T.write_ false showMoreBox
T.write_ false showMoreBox
R.useEffect' $ do
let
labels = (_.label) <$> termList
modalClipboard ".copy" (intercalate ", " labels)
-- | Render
-- | Render
-- |
-- |
pure $
pure $
...
@@ -541,6 +551,15 @@ neighborhoodCpt = R.memo' $ here.component "neighborhood" cpt
...
@@ -541,6 +551,15 @@ neighborhoodCpt = R.memo' $ here.component "neighborhood" cpt
[ "text-info", "d-inline" ] $
[ "text-info", "d-inline" ] $
show termCount
show termCount
, H.text $ nbsp 1 <> "related terms"
, H.text $ nbsp 1 <> "related terms"
, B.iconButton
{ name: if copied' then "check" else "copy"
, title: if copied' then "Copied" else "Copy terms to clipboard"
, className: "copy copy-btn"
, callback: \_ -> do
T.write_ true copied
_ <- setTimeout 2000 (T.write_ false copied)
pure unit
}
,
,
-- Expand word cloud
-- Expand word cloud
B.iconButton
B.iconButton
...
...
src/Gargantext/Utils/Clipboard.js
View file @
43cc54f2
import
ClipboardJS
from
"clipboard"
;
import
ClipboardJS
from
"clipboard"
;
export
function
_modalClipboard
(
el
,
url
)
{
export
function
_modalClipboard
(
el
,
url
)
{
modal
_id
=
document
.
getElementsByClassName
(
"b-modal modal show"
)[
0
].
id
modal
El
=
document
.
getElementsByClassName
(
"b-modal modal show"
)[
0
]
return
new
ClipboardJS
(
el
,
{
return
new
ClipboardJS
(
el
,
{
container
:
document
.
getElementById
(
modal_id
)
,
container
:
modalEl
,
text
:
function
(
trigger
)
{
text
:
function
(
trigger
)
{
return
url
return
url
}
}
...
...
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