Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/vue_shared/components/markdown/markdown_editor.vue')
-rw-r--r--app/assets/javascripts/vue_shared/components/markdown/markdown_editor.vue15
1 files changed, 12 insertions, 3 deletions
diff --git a/app/assets/javascripts/vue_shared/components/markdown/markdown_editor.vue b/app/assets/javascripts/vue_shared/components/markdown/markdown_editor.vue
index d9d4056e997..9fd606d775d 100644
--- a/app/assets/javascripts/vue_shared/components/markdown/markdown_editor.vue
+++ b/app/assets/javascripts/vue_shared/components/markdown/markdown_editor.vue
@@ -95,6 +95,11 @@ export default {
required: false,
default: false,
},
+ disableAttachments: {
+ type: Boolean,
+ required: false,
+ default: false,
+ },
},
data() {
return {
@@ -111,6 +116,9 @@ export default {
// Match textarea focus behavior
return this.autofocus && !this.autofocused ? 'end' : false;
},
+ markdownFieldRestrictedToolBarItems() {
+ return this.disableAttachments ? ['attach-file'] : [];
+ },
},
watch: {
value(val) {
@@ -231,7 +239,7 @@ export default {
v-bind="$attrs"
data-testid="markdown-field"
:markdown-preview-path="renderMarkdownPath"
- can-attach-file
+ :can-attach-file="!disableAttachments"
:textarea-value="markdown"
:uploads-path="uploadsPath"
:enable-autocomplete="enableAutocomplete"
@@ -240,6 +248,7 @@ export default {
:quick-actions-docs-path="quickActionsDocsPath"
:show-content-editor-switcher="enableContentEditor"
:drawio-enabled="drawioEnabled"
+ :restricted-tool-bar-items="markdownFieldRestrictedToolBarItems"
:remove-border="true"
@enableContentEditor="onEditingModeChange('contentEditor')"
@handleSuggestDismissed="() => $emit('handleSuggestDismissed')"
@@ -256,8 +265,7 @@ export default {
:disabled="disabled"
@input="updateMarkdownFromMarkdownField"
@keydown="$emit('keydown', $event)"
- >
- </textarea>
+ ></textarea>
</template>
</markdown-field>
<div v-else>
@@ -273,6 +281,7 @@ export default {
:enable-autocomplete="enableAutocomplete"
:autocomplete-data-sources="autocompleteDataSources"
:editable="!disabled"
+ :disable-attachments="disableAttachments"
@initialized="setEditorAsAutofocused"
@change="updateMarkdownFromContentEditor"
@keydown="$emit('keydown', $event)"