2017-09-10 17:25:29 +05:30
|
|
|
<script>
|
2020-06-23 00:09:42 +05:30
|
|
|
import { GlButton, GlLink, GlLoadingIcon, GlSprintf, GlIcon } from '@gitlab/ui';
|
2018-12-05 23:21:45 +05:30
|
|
|
|
2018-12-13 13:39:08 +05:30
|
|
|
export default {
|
|
|
|
components: {
|
2020-06-23 00:09:42 +05:30
|
|
|
GlButton,
|
2018-12-13 13:39:08 +05:30
|
|
|
GlLink,
|
2020-04-08 14:13:33 +05:30
|
|
|
GlLoadingIcon,
|
2020-06-23 00:09:42 +05:30
|
|
|
GlSprintf,
|
|
|
|
GlIcon,
|
2018-12-13 13:39:08 +05:30
|
|
|
},
|
|
|
|
props: {
|
|
|
|
markdownDocsPath: {
|
|
|
|
type: String,
|
|
|
|
required: true,
|
2018-12-05 23:21:45 +05:30
|
|
|
},
|
2018-12-13 13:39:08 +05:30
|
|
|
quickActionsDocsPath: {
|
|
|
|
type: String,
|
|
|
|
required: false,
|
|
|
|
default: '',
|
2018-03-17 18:26:18 +05:30
|
|
|
},
|
2018-12-13 13:39:08 +05:30
|
|
|
canAttachFile: {
|
|
|
|
type: Boolean,
|
|
|
|
required: false,
|
|
|
|
default: true,
|
2017-09-10 17:25:29 +05:30
|
|
|
},
|
2018-12-13 13:39:08 +05:30
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
hasQuickActionsDocsPath() {
|
|
|
|
return this.quickActionsDocsPath !== '';
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
2017-09-10 17:25:29 +05:30
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<div class="comment-toolbar clearfix">
|
|
|
|
<div class="toolbar-text">
|
2018-03-17 18:26:18 +05:30
|
|
|
<template v-if="!hasQuickActionsDocsPath && markdownDocsPath">
|
2020-06-23 00:09:42 +05:30
|
|
|
<gl-link :href="markdownDocsPath" target="_blank">{{
|
2019-09-30 21:07:59 +05:30
|
|
|
__('Markdown is supported')
|
|
|
|
}}</gl-link>
|
2018-03-17 18:26:18 +05:30
|
|
|
</template>
|
|
|
|
<template v-if="hasQuickActionsDocsPath && markdownDocsPath">
|
2020-06-23 00:09:42 +05:30
|
|
|
<gl-sprintf
|
|
|
|
:message="
|
|
|
|
__(
|
|
|
|
'%{markdownDocsLinkStart}Markdown%{markdownDocsLinkEnd} and %{quickActionsDocsLinkStart}quick actions%{quickActionsDocsLinkEnd} are supported',
|
|
|
|
)
|
|
|
|
"
|
|
|
|
>
|
|
|
|
<template #markdownDocsLink="{content}">
|
|
|
|
<gl-link :href="markdownDocsPath" target="_blank">{{ content }}</gl-link>
|
|
|
|
</template>
|
|
|
|
<template #quickActionsDocsLink="{content}">
|
|
|
|
<gl-link :href="quickActionsDocsPath" target="_blank">{{ content }}</gl-link>
|
|
|
|
</template>
|
|
|
|
</gl-sprintf>
|
2018-03-17 18:26:18 +05:30
|
|
|
</template>
|
2017-09-10 17:25:29 +05:30
|
|
|
</div>
|
2019-02-15 15:39:39 +05:30
|
|
|
<span v-if="canAttachFile" class="uploading-container">
|
2018-03-17 18:26:18 +05:30
|
|
|
<span class="uploading-progress-container hide">
|
2020-06-23 00:09:42 +05:30
|
|
|
<template>
|
|
|
|
<gl-icon name="media" :size="16" />
|
|
|
|
</template>
|
2019-09-04 21:01:54 +05:30
|
|
|
<span class="attaching-file-message"></span>
|
2020-06-23 00:09:42 +05:30
|
|
|
<!-- eslint-disable-next-line @gitlab/vue-require-i18n-strings -->
|
2019-09-04 21:01:54 +05:30
|
|
|
<span class="uploading-progress">0%</span>
|
2020-04-08 14:13:33 +05:30
|
|
|
<gl-loading-icon inline class="align-text-bottom" />
|
2018-03-17 18:26:18 +05:30
|
|
|
</span>
|
|
|
|
<span class="uploading-error-container hide">
|
|
|
|
<span class="uploading-error-icon">
|
2020-06-23 00:09:42 +05:30
|
|
|
<template>
|
|
|
|
<gl-icon name="media" :size="16" />
|
|
|
|
</template>
|
2018-03-17 18:26:18 +05:30
|
|
|
</span>
|
|
|
|
<span class="uploading-error-message"></span>
|
2020-06-23 00:09:42 +05:30
|
|
|
|
|
|
|
<gl-sprintf
|
|
|
|
:message="
|
|
|
|
__(
|
|
|
|
'%{retryButtonStart}Try again%{retryButtonEnd} or %{newFileButtonStart}attach a new file%{newFileButtonEnd}',
|
|
|
|
)
|
|
|
|
"
|
|
|
|
>
|
|
|
|
<template #retryButton="{content}">
|
|
|
|
<button class="retry-uploading-link" type="button">{{ content }}</button>
|
|
|
|
</template>
|
|
|
|
<template #newFileButton="{content}">
|
|
|
|
<button class="attach-new-file markdown-selector" type="button">{{ content }}</button>
|
|
|
|
</template>
|
|
|
|
</gl-sprintf>
|
2018-03-17 18:26:18 +05:30
|
|
|
</span>
|
2020-06-23 00:09:42 +05:30
|
|
|
<gl-button class="markdown-selector button-attach-file" variant="link">
|
|
|
|
<template>
|
|
|
|
<gl-icon name="media" :size="16" />
|
|
|
|
</template>
|
|
|
|
<span class="text-attach-file">{{ __('Attach a file') }}</span>
|
|
|
|
</gl-button>
|
|
|
|
<gl-button class="btn btn-default btn-sm hide button-cancel-uploading-files" variant="link">
|
2019-09-30 21:07:59 +05:30
|
|
|
{{ __('Cancel') }}
|
2020-06-23 00:09:42 +05:30
|
|
|
</gl-button>
|
2018-03-17 18:26:18 +05:30
|
|
|
</span>
|
2017-09-10 17:25:29 +05:30
|
|
|
</div>
|
|
|
|
</template>
|