Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Arkindex
Frontend
Commits
e3e41c32
Commit
e3e41c32
authored
3 years ago
by
Erwan Rouchet
Committed by
Bastien Abadie
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Handle missing neighbor data when switching to another element
parent
a528f152
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1152
Handle missing neighbor data when switching to another element
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
vue/Element/Main.vue
+1
-1
1 addition, 1 deletion
vue/Element/Main.vue
vue/HeaderActions.vue
+3
-3
3 additions, 3 deletions
vue/HeaderActions.vue
with
4 additions
and
4 deletions
vue/Element/Main.vue
+
1
−
1
View file @
e3e41c32
...
...
@@ -220,7 +220,7 @@ export default {
})
},
isNeighbor
(
id
)
{
const
neighbors
=
this
.
neighbors
[
this
.
id
]
&&
this
.
neighbors
[
this
.
id
]
.
results
.
map
(
n
=>
n
.
element
.
id
)
const
neighbors
=
this
.
neighbors
[
this
.
id
]
?
.
results
.
map
(
n
=>
n
.
element
.
id
)
return
neighbors
&&
neighbors
.
includes
(
this
.
id
)
&&
neighbors
.
includes
(
id
)
}
},
...
...
This diff is collapsed.
Click to expand it.
vue/HeaderActions.vue
+
3
−
3
View file @
e3e41c32
...
...
@@ -473,17 +473,17 @@ export default {
return
this
.
getType
(
this
.
element
.
type
)
},
totalChildrenCount
()
{
return
this
.
elementId
&&
this
.
childrenPagination
[
this
.
elementId
]
&&
this
.
childrenPagination
[
this
.
elementId
]
.
count
return
this
.
elementId
&&
this
.
childrenPagination
[
this
.
elementId
]
?
.
count
},
firstParentId
()
{
// Returns the first parent element of this element. Used to redirect to a parent when deleting the element
if
(
!
this
.
elementId
||
!
this
.
neighbors
[
this
.
elementId
]
||
!
this
.
neighbors
[
this
.
elementId
]
.
results
)
return
null
if
(
!
this
.
elementId
||
!
this
.
neighbors
[
this
.
elementId
]
?
.
results
)
return
null
const
neighbor
=
this
.
neighbors
[
this
.
elementId
].
results
.
find
(
n
=>
n
.
element
&&
n
.
element
.
id
===
this
.
elementId
)
// Prevent errors on null parents since ListElementNeighbors can return null parents for paths with 'ghost elements'
return
[...
neighbor
?.
parents
].
reverse
().
find
(
parent
=>
parent
!==
null
)?.
id
},
elementDirectParents
()
{
if
(
!
this
.
elementId
||
!
this
.
neighbors
[
this
.
elementId
]
||
!
this
.
neighbors
[
this
.
elementId
]
.
results
)
return
null
if
(
!
this
.
elementId
||
!
this
.
neighbors
[
this
.
elementId
]
?
.
results
)
return
null
// Fetch all direct parents of this element.
const
firstParents
=
this
.
neighbors
[
this
.
elementId
].
results
.
filter
(
n
=>
n
.
element
&&
n
.
element
.
id
===
this
.
elementId
).
map
(
n
=>
n
.
parents
[
n
.
parents
.
length
-
1
])
// Prevent returning duplicated parents by filtering out identical objects.
...
...
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