diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-20 14:10:13 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-20 14:10:13 +0300 |
commit | 0ea3fcec397b69815975647f5e2aa5fe944a8486 (patch) | |
tree | 7979381b89d26011bcf9bdc989a40fcc2f1ed4ff /app/assets/javascripts/static_site_editor/rich_content_editor/modals/add_image/upload_image_tab.vue | |
parent | 72123183a20411a36d607d70b12d57c484394c8e (diff) |
Add latest changes from gitlab-org/gitlab@15-1-stable-eev15.1.0-rc42
Diffstat (limited to 'app/assets/javascripts/static_site_editor/rich_content_editor/modals/add_image/upload_image_tab.vue')
-rw-r--r-- | app/assets/javascripts/static_site_editor/rich_content_editor/modals/add_image/upload_image_tab.vue | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/app/assets/javascripts/static_site_editor/rich_content_editor/modals/add_image/upload_image_tab.vue b/app/assets/javascripts/static_site_editor/rich_content_editor/modals/add_image/upload_image_tab.vue deleted file mode 100644 index 9baa7f286d7..00000000000 --- a/app/assets/javascripts/static_site_editor/rich_content_editor/modals/add_image/upload_image_tab.vue +++ /dev/null @@ -1,56 +0,0 @@ -<script> -import { GlFormGroup } from '@gitlab/ui'; -import { __ } from '~/locale'; -import { MAX_FILE_SIZE } from '../../constants'; - -export default { - components: { - GlFormGroup, - }, - data() { - return { - file: null, - fileError: null, - }; - }, - fileLabel: __('Select file'), - methods: { - onInput(event) { - [this.file] = event.target.files; - - this.validateFile(); - - if (!this.fileError) { - this.$emit('input', this.file); - } - }, - validateFile() { - this.fileError = null; - - if (!this.file) { - this.fileError = __('Please choose a file'); - } else if (this.file.size > MAX_FILE_SIZE) { - this.fileError = __('Maximum file size is 2MB. Please select a smaller file.'); - } - }, - }, -}; -</script> -<template> - <gl-form-group - class="gl-mt-5 gl-mb-3" - :label="$options.fileLabel" - label-for="file-input" - :state="!Boolean(fileError)" - :invalid-feedback="fileError" - > - <input - id="file-input" - ref="fileInput" - class="gl-mt-3 gl-mb-2" - type="file" - accept="image/*" - @input="onInput" - /> - </gl-form-group> -</template> |