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
ec45d3a8
Commit
ec45d3a8
authored
3 years ago
by
Bastien Abadie
Browse files
Options
Downloads
Plain Diff
Merge branch 'element-type-id' into 'master'
Support element type ID in element lists Closes
#958
See merge request
!1243
parents
c932f9be
c254158e
No related branches found
Branches containing commit
Tags
1.3.2-rc1
Tags containing commit
1 merge request
!1243
Support element type ID in element lists
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
vue/Navigation/ElementInLine.vue
+11
-3
11 additions, 3 deletions
vue/Navigation/ElementInLine.vue
vue/Navigation/ElementList.vue
+1
-1
1 addition, 1 deletion
vue/Navigation/ElementList.vue
vue/Navigation/ElementThumbnail.vue
+10
-2
10 additions, 2 deletions
vue/Navigation/ElementThumbnail.vue
with
22 additions
and
6 deletions
vue/Navigation/ElementInLine.vue
+
11
−
3
View file @
ec45d3a8
...
...
@@ -10,8 +10,8 @@
</
template
>
</p>
</td>
<td
:title=
"
typeName(
element
.t
ype
)
"
>
{{
typeName(
element
.t
ype
)
| truncateShort }}
<td
:title=
"element
T
ype
Name
"
>
{{ element
T
ype
Name
| truncateShort }}
</td>
<td
v-if=
"classDisplay"
>
{{ classDisplay }}
...
...
@@ -85,6 +85,14 @@ export default {
if
(
!
this
.
element
.
corpus
)
return
null
return
this
.
element
.
corpus
.
id
},
elementType
()
{
if
(
this
.
element
.
type
)
return
this
.
getType
(
this
.
element
.
type
)
else
if
(
this
.
element
.
type_id
&&
this
.
corpus
?.
types
)
return
Object
.
values
(
this
.
corpus
.
types
).
find
(({
id
})
=>
id
===
this
.
element
.
type_id
)
return
null
},
elementTypeName
()
{
return
this
.
elementType
?.
display_name
??
this
.
elementType
?.
slug
??
this
.
element
.
type
??
''
},
selected
()
{
return
this
.
corpusId
!==
null
&&
this
.
selection
[
this
.
corpusId
]?.
includes
(
this
.
element
.
id
)
},
...
...
@@ -101,7 +109,7 @@ export default {
* elements with a thumbnail URL.
*/
hasPreview
()
{
return
!
this
.
getType
(
this
.
element
.
t
ype
)
?.
folder
&&
this
.
element
.
thumbnail_url
return
!
this
.
element
T
ype
?.
folder
&&
this
.
element
.
thumbnail_url
}
},
methods
:
{
...
...
This diff is collapsed.
Click to expand it.
vue/Navigation/ElementList.vue
+
1
−
1
View file @
ec45d3a8
...
...
@@ -54,7 +54,7 @@ export default {
elements
:
{
type
:
Array
,
required
:
true
,
validator
:
elements
=>
elements
.
every
(
element
=>
element
.
id
&&
element
.
name
&&
element
.
type
&&
element
.
corpus
)
validator
:
elements
=>
elements
.
every
(
element
=>
element
.
id
&&
element
.
name
&&
(
element
.
type
||
element
.
type_id
)
&&
element
.
corpus
)
},
/**
* Make all actions unavailable on elements, to make the list appear as read-only.
...
...
This diff is collapsed.
Click to expand it.
vue/Navigation/ElementThumbnail.vue
+
10
−
2
View file @
ec45d3a8
...
...
@@ -33,7 +33,7 @@
</div>
</router-link>
<div
class=
"card-footer"
>
<span
class=
"type"
:title=
"
typeName(
element
.t
ype
)
"
>
{{
typeName(
element
.t
ype
)
| truncateShort }}
</span>
<span
class=
"type"
:title=
"element
T
ype
Name
"
>
{{ element
T
ype
Name
| truncateShort }}
</span>
<DeleteModal
:element=
"element"
>
<
template
v-slot:default=
"{ open, canDelete }"
>
<button
...
...
@@ -112,6 +112,14 @@ export default {
corpusId
()
{
return
this
.
element
.
corpus
.
id
},
elementType
()
{
if
(
this
.
element
.
type
)
return
this
.
getType
(
this
.
element
.
type
)
else
if
(
this
.
element
.
type_id
&&
this
.
corpus
?.
types
)
return
Object
.
values
(
this
.
corpus
.
types
).
find
(({
id
})
=>
id
===
this
.
element
.
type_id
)
return
null
},
elementTypeName
()
{
return
this
.
elementType
?.
display_name
??
this
.
elementType
?.
slug
??
this
.
element
.
type
??
''
},
selected
()
{
return
this
.
corpusId
!==
null
&&
this
.
selection
[
this
.
corpusId
]?.
includes
(
this
.
element
.
id
)
},
...
...
@@ -127,7 +135,7 @@ export default {
* elements with a thumbnail URL.
*/
hasPreview
()
{
return
!
this
.
getType
(
this
.
element
.
t
ype
)
?.
folder
&&
this
.
element
.
thumbnail_url
return
!
this
.
element
T
ype
?.
folder
&&
this
.
element
.
thumbnail_url
}
},
methods
:
{
...
...
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