diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 21:42:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 21:42:06 +0300 |
commit | 6e4e1050d9dba2b7b2523fdd1768823ab85feef4 (patch) | |
tree | 78be5963ec075d80116a932011d695dd33910b4e /app/assets/javascripts/add_context_commits_modal/components/add_context_commits_modal_trigger.vue | |
parent | 1ce776de4ae122aba3f349c02c17cebeaa8ecf07 (diff) |
Add latest changes from gitlab-org/gitlab@13-3-stable-ee
Diffstat (limited to 'app/assets/javascripts/add_context_commits_modal/components/add_context_commits_modal_trigger.vue')
-rw-r--r-- | app/assets/javascripts/add_context_commits_modal/components/add_context_commits_modal_trigger.vue | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/app/assets/javascripts/add_context_commits_modal/components/add_context_commits_modal_trigger.vue b/app/assets/javascripts/add_context_commits_modal/components/add_context_commits_modal_trigger.vue new file mode 100644 index 00000000000..78a575ffe96 --- /dev/null +++ b/app/assets/javascripts/add_context_commits_modal/components/add_context_commits_modal_trigger.vue @@ -0,0 +1,49 @@ +<script> +import { GlButton } from '@gitlab/ui'; +import { s__ } from '~/locale'; +import eventHub from '../event_hub'; + +export default { + components: { + GlButton, + }, + props: { + commitsEmpty: { + type: Boolean, + required: false, + default: false, + }, + contextCommitsEmpty: { + type: Boolean, + required: true, + }, + }, + computed: { + buttonText() { + return this.contextCommitsEmpty || this.commitsEmpty + ? s__('AddContextCommits|Add previously merged commits') + : s__('AddContextCommits|Add/remove'); + }, + }, + methods: { + openModal() { + eventHub.$emit('openModal'); + }, + }, +}; +</script> + +<template> + <gl-button + :class="[ + { + 'ml-3': !contextCommitsEmpty, + 'mt-3': !commitsEmpty && contextCommitsEmpty, + }, + ]" + :variant="commitsEmpty ? 'info' : 'default'" + @click="openModal" + > + {{ buttonText }} + </gl-button> +</template> |