diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-19 07:33:21 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-19 07:33:21 +0000 |
commit | 36a59d088eca61b834191dacea009677a96c052f (patch) | |
tree | e4f33972dab5d8ef79e3944a9f403035fceea43f /app/assets/javascripts/snippets/components/snippet_blob_actions_edit.vue | |
parent | a1761f15ec2cae7c7f7bbda39a75494add0dfd6f (diff) | |
download | gitlab-ce-36a59d088eca61b834191dacea009677a96c052f.tar.gz |
Add latest changes from gitlab-org/gitlab@15-0-stable-eev15.0.0-rc42
Diffstat (limited to 'app/assets/javascripts/snippets/components/snippet_blob_actions_edit.vue')
-rw-r--r-- | app/assets/javascripts/snippets/components/snippet_blob_actions_edit.vue | 38 |
1 files changed, 27 insertions, 11 deletions
diff --git a/app/assets/javascripts/snippets/components/snippet_blob_actions_edit.vue b/app/assets/javascripts/snippets/components/snippet_blob_actions_edit.vue index d221195ddc7..260ee496df0 100644 --- a/app/assets/javascripts/snippets/components/snippet_blob_actions_edit.vue +++ b/app/assets/javascripts/snippets/components/snippet_blob_actions_edit.vue @@ -1,5 +1,5 @@ <script> -import { GlButton } from '@gitlab/ui'; +import { GlButton, GlFormGroup } from '@gitlab/ui'; import { cloneDeep } from 'lodash'; import { s__, sprintf } from '~/locale'; import { SNIPPET_MAX_BLOBS } from '../constants'; @@ -10,12 +10,18 @@ export default { components: { SnippetBlobEdit, GlButton, + GlFormGroup, }, props: { initBlobs: { type: Array, required: true, }, + isValid: { + type: Boolean, + required: false, + default: true, + }, }, data() { return { @@ -124,16 +130,26 @@ export default { </script> <template> <div class="form-group"> - <label :for="firstInputId">{{ s__('Snippets|Files') }}</label> - <snippet-blob-edit - v-for="(blobId, index) in blobIds" - :key="blobId" - :class="{ 'gl-mt-3': index > 0 }" - :blob="blobs[blobId]" - :can-delete="canDelete" - @blob-updated="updateBlob(blobId, $event)" - @delete="deleteBlob(blobId)" - /> + <gl-form-group + :label="s__('Snippets|Files')" + :label-for="firstInputId" + :invalid-feedback=" + s__( + 'Snippets|Snippets can\'t contain empty files. Ensure all files have content, or delete them.', + ) + " + :state="isValid" + > + <snippet-blob-edit + v-for="(blobId, index) in blobIds" + :key="blobId" + :class="{ 'gl-mt-3': index > 0 }" + :blob="blobs[blobId]" + :can-delete="canDelete" + @blob-updated="updateBlob(blobId, $event)" + @delete="deleteBlob(blobId)" + /> + </gl-form-group> <gl-button :disabled="!canAdd" data-testid="add_button" |