summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/content_editor/components/content_editor_error.vue
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/content_editor/components/content_editor_error.vue')
-rw-r--r--app/assets/javascripts/content_editor/components/content_editor_error.vue31
1 files changed, 31 insertions, 0 deletions
diff --git a/app/assets/javascripts/content_editor/components/content_editor_error.vue b/app/assets/javascripts/content_editor/components/content_editor_error.vue
new file mode 100644
index 00000000000..031ea92a7e9
--- /dev/null
+++ b/app/assets/javascripts/content_editor/components/content_editor_error.vue
@@ -0,0 +1,31 @@
+<script>
+import { GlAlert } from '@gitlab/ui';
+import EditorStateObserver from './editor_state_observer.vue';
+
+export default {
+ components: {
+ GlAlert,
+ EditorStateObserver,
+ },
+ data() {
+ return {
+ error: null,
+ };
+ },
+ methods: {
+ displayError({ error }) {
+ this.error = error;
+ },
+ dismissError() {
+ this.error = null;
+ },
+ },
+};
+</script>
+<template>
+ <editor-state-observer @error="displayError">
+ <gl-alert v-if="error" class="gl-mb-6" variant="danger" @dismiss="dismissError">
+ {{ error }}
+ </gl-alert>
+ </editor-state-observer>
+</template>