2020-04-08 14:13:33 +05:30
|
|
|
<script>
|
|
|
|
import BlobHeaderEdit from '~/blob/components/blob_edit_header.vue';
|
|
|
|
import BlobContentEdit from '~/blob/components/blob_edit_content.vue';
|
2020-04-22 19:07:51 +05:30
|
|
|
import { GlLoadingIcon } from '@gitlab/ui';
|
2020-04-08 14:13:33 +05:30
|
|
|
|
|
|
|
export default {
|
|
|
|
components: {
|
|
|
|
BlobHeaderEdit,
|
|
|
|
BlobContentEdit,
|
2020-04-22 19:07:51 +05:30
|
|
|
GlLoadingIcon,
|
2020-04-08 14:13:33 +05:30
|
|
|
},
|
2020-04-22 19:07:51 +05:30
|
|
|
inheritAttrs: false,
|
2020-04-08 14:13:33 +05:30
|
|
|
props: {
|
2020-04-22 19:07:51 +05:30
|
|
|
value: {
|
2020-04-08 14:13:33 +05:30
|
|
|
type: String,
|
2020-04-22 19:07:51 +05:30
|
|
|
required: false,
|
|
|
|
default: '',
|
2020-04-08 14:13:33 +05:30
|
|
|
},
|
|
|
|
fileName: {
|
|
|
|
type: String,
|
2020-04-22 19:07:51 +05:30
|
|
|
required: false,
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
isLoading: {
|
|
|
|
type: Boolean,
|
|
|
|
required: false,
|
|
|
|
default: true,
|
2020-04-08 14:13:33 +05:30
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
<template>
|
|
|
|
<div class="form-group file-editor">
|
|
|
|
<label>{{ s__('Snippets|File') }}</label>
|
|
|
|
<div class="file-holder snippet">
|
2020-05-24 23:13:21 +05:30
|
|
|
<blob-header-edit
|
|
|
|
:value="fileName"
|
2020-06-23 00:09:42 +05:30
|
|
|
data-qa-selector="file_name_field"
|
2020-05-24 23:13:21 +05:30
|
|
|
@input="$emit('name-change', $event)"
|
|
|
|
/>
|
2020-04-22 19:07:51 +05:30
|
|
|
<gl-loading-icon
|
|
|
|
v-if="isLoading"
|
|
|
|
:label="__('Loading snippet')"
|
|
|
|
size="lg"
|
|
|
|
class="loading-animation prepend-top-20 append-bottom-20"
|
|
|
|
/>
|
|
|
|
<blob-content-edit
|
|
|
|
v-else
|
|
|
|
:value="value"
|
|
|
|
:file-name="fileName"
|
|
|
|
@input="$emit('input', $event)"
|
|
|
|
/>
|
2020-04-08 14:13:33 +05:30
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|