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
22d92f10
Commit
22d92f10
authored
Jun 28, 2021
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[sidebar] rename confusing function name (delete -> updateTerm)
parent
09145c47
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
25 deletions
+24
-25
Sidebar.purs
src/Gargantext/Components/GraphExplorer/Sidebar.purs
+24
-25
No files found.
src/Gargantext/Components/GraphExplorer/Sidebar.purs
View file @
22d92f10
...
...
@@ -209,15 +209,15 @@ selectedNodesCpt = here.component "selectedNodes" cpt
]
]
, RH.div { className: "tab-content flex-space-between" }
[
remove
Button (Record.merge { buttonType: "primary"
, rType: CandidateTerm
, nodesMap
, text: "Move as candidate" } commonProps) []
[
updateTerm
Button (Record.merge { buttonType: "primary"
, rType: CandidateTerm
, nodesMap
, text: "Move as candidate" } commonProps) []
, H.br {}
,
remove
Button (Record.merge { buttonType: "danger"
, nodesMap
, rType: StopTerm
, text: "Move as stop" } commonProps) []
,
updateTerm
Button (Record.merge { buttonType: "danger"
, nodesMap
, rType: StopTerm
, text: "Move as stop" } commonProps) []
]
]
]
...
...
@@ -246,7 +246,7 @@ neighborhoodCpt = here.component "neighborhood" cpt
]
type
Remove
ButtonProps = (
type
UpdateTerm
ButtonProps = (
buttonType :: String
, nodesMap :: SigmaxT.NodesMap
, rType :: TermList
...
...
@@ -254,11 +254,10 @@ type RemoveButtonProps = (
| Common
)
removeButton :: R2.Component RemoveButtonProps
removeButton = R.createElement removeButtonCpt
removeButtonCpt :: R.Component RemoveButtonProps
removeButtonCpt = here.component "removeButton" cpt
updateTermButton :: R2.Component UpdateTermButtonProps
updateTermButton = R.createElement updateTermButtonCpt
updateTermButtonCpt :: R.Component UpdateTermButtonProps
updateTermButtonCpt = here.component "updateTermButton" cpt
where
cpt { buttonType
, graphId
...
...
@@ -282,7 +281,7 @@ removeButtonCpt = here.component "removeButton" cpt
onClickRemove selectedNodeIds' e = do
let nodes = mapMaybe (\id -> Map.lookup id nodesMap)
$ Set.toUnfoldable selectedNodeIds'
deleteNod
es { graphId: graphId
sendPatch
es { graphId: graphId
, metaData: metaData
, nodes
, session: session
...
...
@@ -309,7 +308,7 @@ neighbourBadges :: SigmaxT.SGraph -> SigmaxT.NodeIds -> Seq.Seq (Record SigmaxT.
neighbourBadges graph selectedNodeIds = SigmaxT.neighbours graph selectedNodes' where
selectedNodes' = SigmaxT.graphNodes $ SigmaxT.nodesById graph selectedNodeIds
type
DeleteNod
es =
type
SendPatch
es =
( graphId :: NodeID
, metaData :: GET.MetaData
, nodes :: Array (Record SigmaxT.Node)
...
...
@@ -318,10 +317,10 @@ type DeleteNodes =
, termList :: TermList
)
deleteNodes :: Record DeleteNod
es -> Effect Unit
deleteNod
es { graphId, metaData, nodes, session, termList, reloadForest } = do
sendPatches :: Record SendPatch
es -> Effect Unit
sendPatch
es { graphId, metaData, nodes, session, termList, reloadForest } = do
launchAff_ do
patches <- (parTraverse (
deleteNode
termList session metaData) nodes) :: Aff (Array NTC.VersionedNgramsPatches)
patches <- (parTraverse (
sendPatch
termList session metaData) nodes) :: Aff (Array NTC.VersionedNgramsPatches)
let mPatch = last patches
case mPatch of
Nothing -> pure unit
...
...
@@ -329,12 +328,12 @@ deleteNodes { graphId, metaData, nodes, session, termList, reloadForest } = do
liftEffect $ T2.reload reloadForest
-- Why is this called delete node?
deleteNode
:: TermList
-> Session
-> GET.MetaData
-> Record SigmaxT.Node
-> Aff NTC.VersionedNgramsPatches
deleteNode
termList session (GET.MetaData metaData) node = do
sendPatch
:: TermList
-> Session
-> GET.MetaData
-> Record SigmaxT.Node
-> Aff NTC.VersionedNgramsPatches
sendPatch
termList session (GET.MetaData metaData) node = do
ret <- NTC.putNgramsPatches coreParams versioned
task <- NTC.postNgramsChartsAsync coreParams -- TODO add task
pure ret
...
...
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