summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/repository/components/blob_edit.vue
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-07-20 09:55:51 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-07-20 09:55:51 +0000
commite8d2c2579383897a1dd7f9debd359abe8ae8373d (patch)
treec42be41678c2586d49a75cabce89322082698334 /app/assets/javascripts/repository/components/blob_edit.vue
parentfc845b37ec3a90aaa719975f607740c22ba6a113 (diff)
downloadgitlab-ce-e8d2c2579383897a1dd7f9debd359abe8ae8373d.tar.gz
Add latest changes from gitlab-org/gitlab@14-1-stable-eev14.1.0-rc42
Diffstat (limited to 'app/assets/javascripts/repository/components/blob_edit.vue')
-rw-r--r--app/assets/javascripts/repository/components/blob_edit.vue47
1 files changed, 47 insertions, 0 deletions
diff --git a/app/assets/javascripts/repository/components/blob_edit.vue b/app/assets/javascripts/repository/components/blob_edit.vue
new file mode 100644
index 00000000000..3d97ebe89e4
--- /dev/null
+++ b/app/assets/javascripts/repository/components/blob_edit.vue
@@ -0,0 +1,47 @@
+<script>
+import { GlButton } from '@gitlab/ui';
+import { __ } from '~/locale';
+import WebIdeLink from '~/vue_shared/components/web_ide_link.vue';
+import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
+
+export default {
+ i18n: {
+ edit: __('Edit'),
+ webIde: __('Web IDE'),
+ },
+ components: {
+ GlButton,
+ WebIdeLink,
+ },
+ mixins: [glFeatureFlagsMixin()],
+ props: {
+ editPath: {
+ type: String,
+ required: true,
+ },
+ webIdePath: {
+ type: String,
+ required: true,
+ },
+ },
+};
+</script>
+
+<template>
+ <web-ide-link
+ v-if="glFeatures.consolidatedEditButton"
+ class="gl-mr-3"
+ :edit-url="editPath"
+ :web-ide-url="webIdePath"
+ :is-blob="true"
+ />
+ <div v-else>
+ <gl-button class="gl-mr-2" category="primary" variant="confirm" :href="editPath">
+ {{ $options.i18n.edit }}
+ </gl-button>
+
+ <gl-button class="gl-mr-3" category="primary" variant="confirm" :href="webIdePath">
+ {{ $options.i18n.webIde }}
+ </gl-button>
+ </div>
+</template>