47
47
import { defineComponent } from " vue" ;
48
48
import MarkdownEditor from " @/components/MarkdownEditor.vue" ;
49
49
import { useI18n } from " vue-i18n" ;
50
+ import { useToast } from " vue-toastification" ;
50
51
51
52
export default defineComponent ({
52
53
name: " UserStoryDescriptions" ,
@@ -57,6 +58,7 @@ export default defineComponent({
57
58
editDescription: { type: Boolean , required: true , default: false },
58
59
gptDescriptionResponse: { type: Boolean , required: false , default: false },
59
60
updateComponent: { type: Boolean , required: false , default: false },
61
+ storyMode: { type: String , required: true },
60
62
acceptedStories: {
61
63
type: Array < { storyID: string | null ; issueType : string }> ,
62
64
required: false ,
@@ -66,7 +68,8 @@ export default defineComponent({
66
68
},
67
69
setup() {
68
70
const { t } = useI18n ();
69
- return { t };
71
+ const toast = useToast ();
72
+ return { t , toast };
70
73
},
71
74
data() {
72
75
return {
@@ -101,8 +104,12 @@ export default defineComponent({
101
104
},
102
105
methods: {
103
106
valueChanged(idx , { markdown }) {
104
- this .userStories [idx ].description = markdown ;
105
- this .publishChanges (idx );
107
+ if (this .storyMode !== " US_JIRA" || this .userStories [idx ].title ?.trim ()) {
108
+ this .userStories [idx ].description = markdown ;
109
+ this .publishChanges (idx );
110
+ } else {
111
+ this .toast .error (this .t (" session.notification.messages.issueTrackerJiraMissingTitle" ));
112
+ }
106
113
},
107
114
publishChanges(idx ) {
108
115
this .$emit (" userStoriesChanged" , { us: this .userStories , idx: idx , doRemove: false });
0 commit comments