Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Check if User Story Title Exists Before Creating an Issue #895 #900

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions frontend/src/components/UserStoryDescriptions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import { defineComponent } from "vue";
import MarkdownEditor from "@/components/MarkdownEditor.vue";
import { useI18n } from "vue-i18n";
import { useToast } from "vue-toastification";

export default defineComponent({
name: "UserStoryDescriptions",
Expand All @@ -57,6 +58,7 @@ export default defineComponent({
editDescription: { type: Boolean, required: true, default: false },
gptDescriptionResponse: { type: Boolean, required: false, default: false },
updateComponent: { type: Boolean, required: false, default: false },
storyMode: { type: String, required: true },
acceptedStories: {
type: Array<{ storyID: string | null; issueType: string }>,
required: false,
Expand All @@ -66,7 +68,8 @@ export default defineComponent({
},
setup() {
const { t } = useI18n();
return { t };
const toast = useToast();
return { t, toast };
},
data() {
return {
Expand Down Expand Up @@ -101,8 +104,12 @@ export default defineComponent({
},
methods: {
valueChanged(idx, { markdown }) {
this.userStories[idx].description = markdown;
this.publishChanges(idx);
if (this.storyMode !== "US_JIRA" || this.userStories[idx].title?.trim()) {
this.userStories[idx].description = markdown;
this.publishChanges(idx);
} else {
this.toast.error(this.t("session.notification.messages.issueTrackerJiraMissingTitle"));
}
},
publishChanges(idx) {
this.$emit("userStoriesChanged", { us: this.userStories, idx: idx, doRemove: false });
Expand Down
1 change: 1 addition & 0 deletions frontend/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@
"issueTrackerSynchronizeSuccess": "Synchronized changes with Issue-Tracker",
"issueTrackerNothingChanged": "No changes were made",
"issueTrackerSynchronizeFailed": "Failed to synchronize changes with Issue-Tracker",
"issueTrackerJiraMissingTitle": "A title is required to create an issue in Jira. Please enter a title!",
"wrongID": "Wrong invitation code",
"password": "Wrong password"
}
Expand Down
1 change: 1 addition & 0 deletions frontend/src/views/SessionPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@
:initial-stories="userStories"
:edit-description="true"
:index="index!"
:story-mode="userStoryMode"
:gpt-description-response="gptDescriptionResponse"
:update-component="updateComponent"
:accepted-stories="acceptedStoriesDescription"
Expand Down