Commit 1464bd7c authored by Tom Quirk's avatar Tom Quirk

Add loading spinner for design uploads in progress

parent d2f99986
<script> <script>
import { GlLoadingIcon } from '@gitlab/ui';
import Icon from '~/vue_shared/components/icon.vue'; import Icon from '~/vue_shared/components/icon.vue';
import Timeago from '~/vue_shared/components/time_ago_tooltip.vue'; import Timeago from '~/vue_shared/components/time_ago_tooltip.vue';
import { n__, __ } from '~/locale'; import { n__, __ } from '~/locale';
export default { export default {
components: { components: {
GlLoadingIcon,
Icon, Icon,
Timeago, Timeago,
}, },
...@@ -36,6 +38,9 @@ export default { ...@@ -36,6 +38,9 @@ export default {
}, },
}, },
computed: { computed: {
isLoading() {
return !this.image;
},
icon() { icon() {
const normalizedEvent = this.event.toLowerCase(); const normalizedEvent = this.event.toLowerCase();
const icons = { const icons = {
...@@ -74,13 +79,15 @@ export default { ...@@ -74,13 +79,15 @@ export default {
}" }"
class="card cursor-pointer text-plain js-design-list-item design-list-item" class="card cursor-pointer text-plain js-design-list-item design-list-item"
> >
<div class="card-body p-0 d-flex align-items-center overflow-hidden position-relative"> <div class="card-body p-0 d-flex-center overflow-hidden position-relative">
<div v-if="icon.name" class="design-event position-absolute"> <div v-if="icon.name" class="design-event position-absolute">
<span :title="icon.tooltip" :aria-label="icon.tooltip"> <span :title="icon.tooltip" :aria-label="icon.tooltip">
<icon :name="icon.name" :size="18" :class="icon.classes" /> <icon :name="icon.name" :size="18" :class="icon.classes" />
</span> </span>
</div> </div>
<gl-loading-icon v-if="isLoading" size="md" />
<img <img
v-else
:src="image" :src="image"
:alt="filename" :alt="filename"
class="block ml-auto mr-auto mw-100 mh-100 design-img" class="block ml-auto mr-auto mw-100 mh-100 design-img"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment