diff options
author | Paul Slaughter <pslaughter@gitlab.com> | 2019-01-15 11:59:31 -0600 |
---|---|---|
committer | Paul Slaughter <pslaughter@gitlab.com> | 2019-01-16 09:39:35 -0600 |
commit | 3420ec15dd929ccf28efe8262b9a625a7cc080ed (patch) | |
tree | 5423673fe85d3b510bea227e36bfea7e980411a6 /app | |
parent | d9e4e3f79661c01ea1f0dc30326ffae361228134 (diff) | |
download | gitlab-ce-3420ec15dd929ccf28efe8262b9a625a7cc080ed.tar.gz |
Handle emptyText in user_avatar_list
**Why?**
To reduce duplicate code, it's helpful to encapsulate this behavior
here.
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/vue_shared/components/user_avatar/user_avatar_list.vue | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/app/assets/javascripts/vue_shared/components/user_avatar/user_avatar_list.vue b/app/assets/javascripts/vue_shared/components/user_avatar/user_avatar_list.vue index 7361867edc5..8eaf8386b99 100644 --- a/app/assets/javascripts/vue_shared/components/user_avatar/user_avatar_list.vue +++ b/app/assets/javascripts/vue_shared/components/user_avatar/user_avatar_list.vue @@ -23,6 +23,11 @@ export default { required: false, default: 20, }, + emptyText: { + type: String, + required: false, + default: __('None'), + }, }, data() { return { @@ -65,7 +70,8 @@ export default { </script> <template> - <div> + <div v-if="!items.length">{{ emptyText }}</div> + <div v-else> <user-avatar-link v-for="item in visibleItems" :key="item.id" |