Skip to content
Snippets Groups Projects

Update description field component

All threads resolved!
2 files
+ 10
23
Compare changes
  • Side-by-side
  • Inline
Files
2
<script>
<script>
import { GlButton, GlFormGroup, GlAlert, GlTooltipDirective } from '@gitlab/ui';
import { GlButton, GlFormGroup, GlAlert, GlTooltipDirective } from '@gitlab/ui';
import SafeHtml from '~/vue_shared/directives/safe_html';
import SafeHtml from '~/vue_shared/directives/safe_html';
import { __, s__ } from '~/locale';
import { s__ } from '~/locale';
import { helpPagePath } from '~/helpers/help_page_helper';
import { helpPagePath } from '~/helpers/help_page_helper';
import MarkdownEditor from '~/vue_shared/components/markdown/markdown_editor.vue';
import MarkdownEditor from '~/vue_shared/components/markdown/markdown_editor.vue';
import { renderGFM } from '~/behaviors/markdown/render_gfm';
import { renderGFM } from '~/behaviors/markdown/render_gfm';
@@ -25,7 +25,6 @@ export default {
@@ -25,7 +25,6 @@ export default {
GlTooltip: GlTooltipDirective,
GlTooltip: GlTooltipDirective,
},
},
i18n: {
i18n: {
edit: __('Edit'),
editDescription: s__('DesignManagement|Edit description'),
editDescription: s__('DesignManagement|Edit description'),
descriptionLabel: s__('DesignManagement|Description'),
descriptionLabel: s__('DesignManagement|Description'),
},
},
@@ -37,7 +36,6 @@ export default {
@@ -37,7 +36,6 @@ export default {
},
},
markdownDocsPath: helpPagePath('user/markdown'),
markdownDocsPath: helpPagePath('user/markdown'),
quickActionsDocsPath: helpPagePath('user/project/quick_actions'),
quickActionsDocsPath: helpPagePath('user/project/quick_actions'),
descriptionLabelClass: 'gl-line-height-20! gl-font-lg!',
props: {
props: {
design: {
design: {
type: Object,
type: Object,
@@ -51,7 +49,7 @@ export default {
@@ -51,7 +49,7 @@ export default {
type: Object,
type: Object,
required: true,
required: true,
},
},
openDescriptionForm: {
initiallyOpen: {
type: Boolean,
type: Boolean,
required: false,
required: false,
default: false,
default: false,
@@ -60,7 +58,7 @@ export default {
@@ -60,7 +58,7 @@ export default {
data() {
data() {
return {
return {
descriptionText: this.design.description || '',
descriptionText: this.design.description || '',
showEditor: this.openDescriptionForm,
showEditor: this.initiallyOpen,
isSubmitting: false,
isSubmitting: false,
errorMessage: '',
errorMessage: '',
autosaveKey: `Issue/${getIdFromGraphQLId(this.design.issue.id)}/Design/${getIdFromGraphQLId(
autosaveKey: `Issue/${getIdFromGraphQLId(this.design.issue.id)}/Design/${getIdFromGraphQLId(
@@ -172,7 +170,7 @@ export default {
@@ -172,7 +170,7 @@ export default {
v-if="showEditor"
v-if="showEditor"
class="design-description-form common-note-form"
class="design-description-form common-note-form"
:label="$options.i18n.descriptionLabel"
:label="$options.i18n.descriptionLabel"
:label-class="$options.descriptionLabelClass"
:label-class="'gl-line-height-20! gl-font-lg!'"
>
>
<div v-if="errorMessage" class="gl-pb-3">
<div v-if="errorMessage" class="gl-pb-3">
<gl-alert variant="danger" @dismiss="errorMessage = null">
<gl-alert variant="danger" @dismiss="errorMessage = null">
Loading