|
| 1 | +<script> |
| 2 | +import { GlSkeletonLoader } from '@gitlab/ui'; |
| 3 | +
|
| 4 | +export default { |
| 5 | + name: 'WorkItemLoading', |
| 6 | + loader: { |
| 7 | + repeat: 10, |
| 8 | + width: 1000, |
| 9 | + height: 40, |
| 10 | + descriptionRepeat: 2, |
| 11 | + attributesRepeat: 6, |
| 12 | + }, |
| 13 | + components: { |
| 14 | + GlSkeletonLoader, |
| 15 | + }, |
| 16 | + props: { |
| 17 | + twoColumnView: { |
| 18 | + type: Boolean, |
| 19 | + required: false, |
| 20 | + default: false, |
| 21 | + }, |
| 22 | + }, |
| 23 | +}; |
| 24 | +</script> |
| 25 | + |
| 26 | +<template> |
| 27 | + <div v-if="twoColumnView" class="work-item-overview" data-testid="work-item-two-column-loading"> |
| 28 | + <section> |
| 29 | + <gl-skeleton-loader :height="60" :width="600" data-testid="work-title-and-meta-loading"> |
| 30 | + <!--- START work item title --> |
| 31 | + <rect width="500" height="20" x="5" y="0" rx="4" /> |
| 32 | + <!--- END work item title --> |
| 33 | + <!--- START work item meta --> |
| 34 | + <rect width="50" height="15" x="5" y="30" rx="6" /> |
| 35 | + <rect width="150" height="5" x="60" y="35" rx="2" /> |
| 36 | + <!--- END work item meta --> |
| 37 | + </gl-skeleton-loader> |
| 38 | + |
| 39 | + <!--- START work item description --> |
| 40 | + <div data-testid="work-item-description-loading"> |
| 41 | + <gl-skeleton-loader |
| 42 | + v-for="i in $options.loader.descriptionRepeat" |
| 43 | + :key="i" |
| 44 | + :width="600" |
| 45 | + :height="20" |
| 46 | + > |
| 47 | + <rect width="500" x="5" y="0" height="5" rx="2" /> |
| 48 | + <rect width="595" x="5" y="10" height="5" rx="2" /> |
| 49 | + </gl-skeleton-loader> |
| 50 | + |
| 51 | + <gl-skeleton-loader :width="600" :height="20"> |
| 52 | + <rect width="300" x="5" y="0" height="5" rx="2" /> |
| 53 | + </gl-skeleton-loader> |
| 54 | + |
| 55 | + <gl-skeleton-loader :width="600" :height="20"> |
| 56 | + <rect width="500" x="5" y="0" height="5" rx="2" /> |
| 57 | + <rect width="595" x="5" y="10" height="5" rx="2" /> |
| 58 | + </gl-skeleton-loader> |
| 59 | + |
| 60 | + <gl-skeleton-loader :width="600" :height="20"> |
| 61 | + <rect width="300" x="5" y="0" height="5" rx="2" /> |
| 62 | + </gl-skeleton-loader> |
| 63 | + </div> |
| 64 | + <!--- END work item description --> |
| 65 | + |
| 66 | + <!--- START work item attributes wrapper small/xs screen --> |
| 67 | + <div |
| 68 | + class="work-item-attributes-wrapper gl-md-display-none!" |
| 69 | + data-testid="work-item-attributes-xssm-loading" |
| 70 | + > |
| 71 | + <gl-skeleton-loader |
| 72 | + v-for="i in $options.loader.attributesRepeat" |
| 73 | + :key="i" |
| 74 | + :width="240" |
| 75 | + :height="20" |
| 76 | + > |
| 77 | + <rect width="50" x="2" y="0" height="2" rx="1" /> |
| 78 | + <rect width="100" x="2" y="5" height="4" rx="1" /> |
| 79 | + </gl-skeleton-loader> |
| 80 | + </div> |
| 81 | + <!--- END work item attributes wrapper small/xs screen --> |
| 82 | + |
| 83 | + <!--- START work item notes activity placeholder --> |
| 84 | + <gl-skeleton-loader |
| 85 | + :height="30" |
| 86 | + :width="600" |
| 87 | + data-testid="work-item-activity-placeholder-loading" |
| 88 | + > |
| 89 | + <rect width="100" height="15" x="5" y="0" rx="4" /> |
| 90 | + </gl-skeleton-loader> |
| 91 | + <!--- END work item notes activity placeholder --> |
| 92 | + |
| 93 | + <!--- START work item notes --> |
| 94 | + <gl-skeleton-loader |
| 95 | + v-for="i in $options.loader.repeat" |
| 96 | + :key="i" |
| 97 | + data-testid="work-item-notes-loading" |
| 98 | + :width="$options.loader.width" |
| 99 | + :height="$options.loader.height" |
| 100 | + preserve-aspect-ratio="xMinYMax meet" |
| 101 | + > |
| 102 | + <circle cx="20" cy="20" r="16" /> |
| 103 | + <rect width="950" x="45" y="15" height="10" rx="4" /> |
| 104 | + </gl-skeleton-loader> |
| 105 | + <!--- END work item notes --> |
| 106 | + </section> |
| 107 | + |
| 108 | + <!--- START work item attributes wrapper md/lg screens --> |
| 109 | + <aside |
| 110 | + class="work-item-overview-right-sidebar gl-md-display-block! gl-display-none" |
| 111 | + data-testid="work-item-attributes-mdup-loading" |
| 112 | + > |
| 113 | + <div class="work-item-attributes-wrapper"> |
| 114 | + <gl-skeleton-loader |
| 115 | + v-for="i in $options.loader.attributesRepeat" |
| 116 | + :key="i" |
| 117 | + :width="240" |
| 118 | + :height="50" |
| 119 | + > |
| 120 | + <rect width="100" x="0" y="25" height="5" rx="4" /> |
| 121 | + <rect width="240" x="0" y="35" height="10" rx="4" /> |
| 122 | + </gl-skeleton-loader> |
| 123 | + </div> |
| 124 | + </aside> |
| 125 | + <!--- END work item attributes wrapper md/lg screens --> |
| 126 | + </div> |
| 127 | + <div v-else data-testid="work-item-single-column-loading" class="gl-max-w-26 gl-py-5"> |
| 128 | + <!--- START work item loading original loader --> |
| 129 | + <gl-skeleton-loader :height="65" :width="240"> |
| 130 | + <rect width="240" height="20" x="5" y="0" rx="4" /> |
| 131 | + <rect width="100" height="20" x="5" y="45" rx="4" /> |
| 132 | + </gl-skeleton-loader> |
| 133 | + <!--- END work item loading original loader --> |
| 134 | + </div> |
| 135 | +</template> |
0 commit comments