diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2018-08-07 16:06:38 +0100 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2018-08-07 16:06:38 +0100 |
commit | bcdc6f31195f176c6256c2960e6b87e56b62b522 (patch) | |
tree | d48daf07ceb830ab4deca120ee51893f88cede05 /app/assets/javascripts/reports/components/issue_status_icon.vue | |
parent | bf699ff49860aa186dc485a91f9b04081b346549 (diff) | |
download | gitlab-ce-bcdc6f31195f176c6256c2960e6b87e56b62b522.tar.gz |
Moves report components to reports folder
Diffstat (limited to 'app/assets/javascripts/reports/components/issue_status_icon.vue')
-rw-r--r-- | app/assets/javascripts/reports/components/issue_status_icon.vue | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/app/assets/javascripts/reports/components/issue_status_icon.vue b/app/assets/javascripts/reports/components/issue_status_icon.vue new file mode 100644 index 00000000000..85811698a37 --- /dev/null +++ b/app/assets/javascripts/reports/components/issue_status_icon.vue @@ -0,0 +1,57 @@ +<script> +import Icon from '~/vue_shared/components/icon.vue'; +import { + STATUS_FAILED, + STATUS_NEUTRAL, + STATUS_SUCCESS, +} from '../constants'; + +export default { + name: 'IssueStatusIcon', + components: { + Icon, + }, + props: { + // failed || success + status: { + type: String, + required: true, + }, + }, + computed: { + iconName() { + if (this.isStatusFailed) { + return 'status_failed_borderless'; + } else if (this.isStatusSuccess) { + return 'status_success_borderless'; + } + + return 'status_created_borderless'; + }, + isStatusFailed() { + return this.status === STATUS_FAILED; + }, + isStatusSuccess() { + return this.status === STATUS_SUCCESS; + }, + isStatusNeutral() { + return this.status === STATUS_NEUTRAL; + }, + }, +}; +</script> +<template> + <div + :class="{ + failed: isStatusFailed, + success: isStatusSuccess, + neutral: isStatusNeutral, + }" + class="report-block-list-icon" + > + <icon + :name="iconName" + :size="32" + /> + </div> +</template> |