diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-16 21:18:33 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-16 21:18:33 +0300 |
commit | f64a639bcfa1fc2bc89ca7db268f594306edfd7c (patch) | |
tree | a2c3c2ebcc3b45e596949db485d6ed18ffaacfa1 /app/assets/javascripts/projects/details/upload_button.vue | |
parent | bfbc3e0d6583ea1a91f627528bedc3d65ba4b10f (diff) |
Add latest changes from gitlab-org/gitlab@13-10-stable-eev13.10.0-rc40
Diffstat (limited to 'app/assets/javascripts/projects/details/upload_button.vue')
-rw-r--r-- | app/assets/javascripts/projects/details/upload_button.vue | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/app/assets/javascripts/projects/details/upload_button.vue b/app/assets/javascripts/projects/details/upload_button.vue new file mode 100644 index 00000000000..5b19f15c233 --- /dev/null +++ b/app/assets/javascripts/projects/details/upload_button.vue @@ -0,0 +1,59 @@ +<script> +import { GlButton, GlModalDirective } from '@gitlab/ui'; +import UploadBlobModal from '~/repository/components/upload_blob_modal.vue'; +import { trackFileUploadEvent } from '../upload_file_experiment_tracking'; + +const UPLOAD_BLOB_MODAL_ID = 'details-modal-upload-blob'; + +export default { + components: { + GlButton, + UploadBlobModal, + }, + directives: { + GlModal: GlModalDirective, + }, + inject: { + targetBranch: { + default: '', + }, + originalBranch: { + default: '', + }, + canPushCode: { + default: false, + }, + path: { + default: '', + }, + projectPath: { + default: '', + }, + }, + methods: { + trackOpenModal() { + trackFileUploadEvent('click_upload_modal_trigger'); + }, + }, + uploadBlobModalId: UPLOAD_BLOB_MODAL_ID, +}; +</script> +<template> + <span> + <gl-button + v-gl-modal="$options.uploadBlobModalId" + icon="upload" + data-testid="upload-file-button" + @click="trackOpenModal" + >{{ __('Upload File') }}</gl-button + > + <upload-blob-modal + :modal-id="$options.uploadBlobModalId" + :commit-message="__('Upload New File')" + :target-branch="targetBranch" + :original-branch="originalBranch" + :can-push-code="canPushCode" + :path="path" + /> + </span> +</template> |