Skip to content

Commit 1ca179f

Browse files
authored
Fix: Check if User Story Title Exists Before Creating an Issue #895 (#900)
* fix: add title input validation for jira + toast warning if missing * fix: alert message
1 parent 7e7b923 commit 1ca179f

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

frontend/src/components/UserStoryDescriptions.vue

+10-3
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
import { defineComponent } from "vue";
4848
import MarkdownEditor from "@/components/MarkdownEditor.vue";
4949
import { useI18n } from "vue-i18n";
50+
import { useToast } from "vue-toastification";
5051
5152
export default defineComponent({
5253
name: "UserStoryDescriptions",
@@ -57,6 +58,7 @@ export default defineComponent({
5758
editDescription: { type: Boolean, required: true, default: false },
5859
gptDescriptionResponse: { type: Boolean, required: false, default: false },
5960
updateComponent: { type: Boolean, required: false, default: false },
61+
storyMode: { type: String, required: true },
6062
acceptedStories: {
6163
type: Array<{ storyID: string | null; issueType: string }>,
6264
required: false,
@@ -66,7 +68,8 @@ export default defineComponent({
6668
},
6769
setup() {
6870
const { t } = useI18n();
69-
return { t };
71+
const toast = useToast();
72+
return { t, toast };
7073
},
7174
data() {
7275
return {
@@ -101,8 +104,12 @@ export default defineComponent({
101104
},
102105
methods: {
103106
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+
}
106113
},
107114
publishChanges(idx) {
108115
this.$emit("userStoriesChanged", { us: this.userStories, idx: idx, doRemove: false });

frontend/src/locales/en.json

+1
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,7 @@
382382
"issueTrackerSynchronizeSuccess": "Synchronized changes with Issue-Tracker",
383383
"issueTrackerNothingChanged": "No changes were made",
384384
"issueTrackerSynchronizeFailed": "Failed to synchronize changes with Issue-Tracker",
385+
"issueTrackerJiraMissingTitle": "A title is required to create/update an issue in Jira. Please enter a title!",
385386
"wrongID": "Wrong invitation code",
386387
"password": "Wrong password"
387388
}

frontend/src/views/SessionPage.vue

+1
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,7 @@
307307
:initial-stories="userStories"
308308
:edit-description="true"
309309
:index="index!"
310+
:story-mode="userStoryMode"
310311
:gpt-description-response="gptDescriptionResponse"
311312
:update-component="updateComponent"
312313
:accepted-stories="acceptedStoriesDescription"

0 commit comments

Comments
 (0)