Skip to content
Snippets Groups Projects

Update description field component

All threads resolved!
3 files
+ 64
14
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -27,7 +27,7 @@ export default {
@@ -27,7 +27,7 @@ export default {
i18n: {
i18n: {
edit: __('Edit'),
edit: __('Edit'),
editDescription: s__('DesignManagement|Edit description'),
editDescription: s__('DesignManagement|Edit description'),
descriptionLabel: s__('DesignManagement|Design description'),
descriptionLabel: s__('DesignManagement|Description'),
},
},
formFieldProps: {
formFieldProps: {
id: 'design-description',
id: 'design-description',
@@ -50,11 +50,16 @@ export default {
@@ -50,11 +50,16 @@ export default {
type: Object,
type: Object,
required: true,
required: true,
},
},
 
openDescriptionForm: {
 
type: Boolean,
 
required: false,
 
default: false,
 
},
},
},
data() {
data() {
return {
return {
descriptionText: this.design.description || '',
descriptionText: this.design.description || '',
showEditor: false,
showEditor: this.openDescriptionForm,
isSubmitting: false,
isSubmitting: false,
errorMessage: '',
errorMessage: '',
autosaveKey: `Issue/${getIdFromGraphQLId(this.design.issue.id)}/Design/${getIdFromGraphQLId(
autosaveKey: `Issue/${getIdFromGraphQLId(this.design.issue.id)}/Design/${getIdFromGraphQLId(
@@ -82,6 +87,7 @@ export default {
@@ -82,6 +87,7 @@ export default {
this.showEditor = true;
this.showEditor = true;
},
},
closeForm() {
closeForm() {
 
this.$emit('editorClosed');
this.showEditor = false;
this.showEditor = false;
},
},
async renderGFM() {
async renderGFM() {
@@ -208,12 +214,13 @@ export default {
@@ -208,12 +214,13 @@ export default {
v-gl-tooltip
v-gl-tooltip
class="gl-ml-auto"
class="gl-ml-auto"
size="small"
size="small"
data-testid="edit-description"
category="tertiary"
:aria-label="$options.i18n.editDescription"
:aria-label="$options.i18n.editDescription"
 
:title="$options.i18n.editDescription"
 
data-testid="edit-description"
 
icon="pencil"
@click="startEditing"
@click="startEditing"
>
/>
{{ $options.i18n.edit }}
</gl-button>
</div>
</div>
<div
<div
v-if="!design.descriptionHtml"
v-if="!design.descriptionHtml"
Loading