summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/ide/components/cannot_push_code_alert.vue
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-04-20 14:36:54 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-04-20 14:36:54 +0000
commitf61bb2a16a514b71bf33aabbbb999d6732016a24 (patch)
tree9548caa89e60b4f40b99bbd1dac030420b812aa8 /app/assets/javascripts/ide/components/cannot_push_code_alert.vue
parent35fc54e5d261f8898e390aea7c2f5ec5fdf0539d (diff)
downloadgitlab-ce-4a647b2732a66bd1012cef18484571aacad42b5a.tar.gz
Add latest changes from gitlab-org/gitlab@13-11-stable-eev13.11.0-rc42
Diffstat (limited to 'app/assets/javascripts/ide/components/cannot_push_code_alert.vue')
-rw-r--r--app/assets/javascripts/ide/components/cannot_push_code_alert.vue40
1 files changed, 40 insertions, 0 deletions
diff --git a/app/assets/javascripts/ide/components/cannot_push_code_alert.vue b/app/assets/javascripts/ide/components/cannot_push_code_alert.vue
new file mode 100644
index 00000000000..d3e51e6e140
--- /dev/null
+++ b/app/assets/javascripts/ide/components/cannot_push_code_alert.vue
@@ -0,0 +1,40 @@
+<script>
+import { GlAlert, GlButton } from '@gitlab/ui';
+
+export default {
+ components: {
+ GlAlert,
+ GlButton,
+ },
+ props: {
+ message: {
+ type: String,
+ required: true,
+ },
+ action: {
+ type: Object,
+ required: false,
+ default: null,
+ },
+ },
+ computed: {
+ hasAction() {
+ return Boolean(this.action?.href);
+ },
+ actionButtonMethod() {
+ return this.action?.isForm ? 'post' : null;
+ },
+ },
+};
+</script>
+
+<template>
+ <gl-alert :dismissible="false">
+ {{ message }}
+ <template v-if="hasAction" #actions>
+ <gl-button variant="confirm" :href="action.href" :data-method="actionButtonMethod">
+ {{ action.text }}
+ </gl-button>
+ </template>
+ </gl-alert>
+</template>