Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Knowledge Space WP Plugin
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
alg
Knowledge Space WP Plugin
Commits
57b6e001
Commit
57b6e001
authored
2 years ago
by
Maximilian Giller
Browse files
Options
Downloads
Patches
Plain Diff
Fixed bug in deleting elements
parent
36151759
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!2
Implemented editor in the react framework
Pipeline
#56564
passed
2 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/editor/js/structures/graph/graph.ts
+8
-5
8 additions, 5 deletions
src/editor/js/structures/graph/graph.ts
with
8 additions
and
5 deletions
src/editor/js/structures/graph/graph.ts
+
8
−
5
View file @
57b6e001
...
...
@@ -122,7 +122,7 @@ export class Graph extends ManagedData {
const
clean
:
GraphData
=
{
nodes
:
[],
links
:
[],
types
:
[]
types
:
[]
,
};
clean
.
links
=
data
.
links
.
map
((
link
)
=>
link
.
getCleanInstance
());
...
...
@@ -181,7 +181,7 @@ export class Graph extends ManagedData {
return
true
;
// Doesn't even exist in graph to begin with.
}
this
.
data
.
nodes
.
filter
((
n
:
Node
)
=>
n
!==
node
);
this
.
data
.
nodes
=
this
.
data
.
nodes
.
filter
((
n
:
Node
)
=>
n
.
id
!==
node
.
id
);
try
{
// No save points should be created when deleting the links
...
...
@@ -218,7 +218,7 @@ export class Graph extends ManagedData {
return
true
;
// Already exists in graph.
}
// Updateid
// Update
id
link
.
id
=
this
.
nextLinkId
;
this
.
nextLinkId
+=
1
;
...
...
@@ -241,7 +241,10 @@ export class Graph extends ManagedData {
return
true
;
// Doesn't even exist in graph to begin with.
}
this
.
data
.
links
.
filter
((
l
:
Link
)
=>
l
!==
link
);
this
.
data
.
links
=
this
.
data
.
links
.
filter
(
(
l
:
Link
)
=>
l
.
sourceId
!==
link
.
sourceId
||
l
.
targetId
!==
link
.
targetId
);
this
.
triggerOnChange
();
// TODO: Use toString implementation of link
...
...
@@ -254,7 +257,7 @@ export class Graph extends ManagedData {
const
data
:
GraphData
=
{
nodes
:
[],
links
:
[],
types
:
[]
types
:
[]
,
};
// Parse nodes
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment