diff options
author | Phil Hughes <me@iamphill.com> | 2018-05-24 11:49:57 +0100 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2018-05-24 11:49:57 +0100 |
commit | 4b4618936d0af203820be3a9392d7e555464cf3f (patch) | |
tree | ae8f82462b794c2c36dc17bae9b94f1116915d6b /app/assets/javascripts/vue_shared/components/ci_icon.vue | |
parent | d61a27d57ef8a97f36a1787db6fd8e2b4235cc42 (diff) | |
download | gitlab-ce-4b4618936d0af203820be3a9392d7e555464cf3f.tar.gz |
improve design of job items
allow ci icon to have a different size & be borderless
Diffstat (limited to 'app/assets/javascripts/vue_shared/components/ci_icon.vue')
-rw-r--r-- | app/assets/javascripts/vue_shared/components/ci_icon.vue | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/app/assets/javascripts/vue_shared/components/ci_icon.vue b/app/assets/javascripts/vue_shared/components/ci_icon.vue index fcab8f571dd..03f924ba99d 100644 --- a/app/assets/javascripts/vue_shared/components/ci_icon.vue +++ b/app/assets/javascripts/vue_shared/components/ci_icon.vue @@ -22,6 +22,8 @@ import Icon from '../../vue_shared/components/icon.vue'; * - Jobs show view header * - Jobs show view sidebar */ +const validSizes = [8, 12, 16, 18, 24, 32, 48, 72]; + export default { components: { Icon, @@ -31,17 +33,36 @@ export default { type: Object, required: true, }, + size: { + type: Number, + required: false, + default: 16, + validator(value) { + return validSizes.includes(value); + }, + }, + borderless: { + type: Boolean, + required: false, + default: false, + }, }, computed: { cssClass() { const status = this.status.group; return `ci-status-icon ci-status-icon-${status} js-ci-status-icon-${status}`; }, + icon() { + return this.borderless ? `${this.status.icon}_borderless` : this.status.icon; + }, }, }; </script> <template> <span :class="cssClass"> - <icon :name="status.icon" /> + <icon + :name="icon" + :size="size" + /> </span> </template> |