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
880a1bd6
Commit
880a1bd6
authored
2 years ago
by
Bastien Abadie
Browse files
Options
Downloads
Plain Diff
Merge branch 'fix-corpus-id-undefined' into 'master'
Prevent TypeErrors when looking for an element's corpusId Closes
#1004
See merge request
!1286
parents
566b2fcf
3be9dc20
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1286
Prevent TypeErrors when looking for an element's corpusId
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
vue/Element/Main.vue
+7
-3
7 additions, 3 deletions
vue/Element/Main.vue
with
7 additions
and
3 deletions
vue/Element/Main.vue
+
7
−
3
View file @
880a1bd6
...
...
@@ -144,10 +144,14 @@ export default {
element
()
{
return
this
.
elements
[
this
.
id
]
},
/**
* The corporaMixin requires a corpusId property to be defined to be able to retrieve the current corpus.
* It should either return a corpus ID, or null is there is no corpus.
* Returning `undefined` can cause a warning in the console, as the mixin thinks the property may not be defined.
* @returns {string | null}
*/
corpusId
()
{
// Corpus ID for the corpora mixin
if
(
!
this
.
element
)
return
null
return
this
.
element
.
corpus
.
id
return
this
.
element
?.
corpus
?.
id
??
null
},
elementType
()
{
return
this
.
element
&&
this
.
getType
(
this
.
element
.
type
)
...
...
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