Skip to content

Commit

Permalink
fix: merge conflicts & remove cat gif
Browse files Browse the repository at this point in the history
  • Loading branch information
Till Wanner authored and Till Wanner committed Aug 7, 2024
1 parent 9b86546 commit be6f1ee
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 49 deletions.
2 changes: 1 addition & 1 deletion frontend/src/components/MarkdownEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export default defineComponent({
default: null
},
acceptedStories: {
type: Array<{ storyID: number | null, issueType: string }>,
type: Array<{ storyID: string | null, issueType: string }>,
required: false,
default: []
},
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/UserStories.vue
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ export default defineComponent({
},
addUserStory() {
const story: UserStory = {
id: this.storyMode === "US_JIRA" ? null : this.generateNumericUUID(),
id: this.storyMode === "US_JIRA" ? null : this.generateNumericUUID().toString(),
title: "",
description: "",
estimation: null,
Expand Down
35 changes: 4 additions & 31 deletions frontend/src/components/UserStoryDescriptions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,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 },
acceptedStories: { type: Array<{ storyID: number | null, issueType: string }>, required: false, default: []},
acceptedStories: { type: Array<{ storyID: string | null, issueType: string }>, required: false, default: []},
hasApiKey: { type: Boolean, required: false, default: false },
},
setup() {
Expand All @@ -67,7 +67,7 @@ export default defineComponent({
data() {
return {
userStories: [] as Array<{
id: number | null;
id: string | null;
title: string;
description: string;
estimation: string | null;
Expand All @@ -78,7 +78,7 @@ export default defineComponent({
watch: {
initialStories() {
this.userStories = this.initialStories as Array<{
id: number | null;
id: string | null;
title: string;
description: string;
estimation: string | null;
Expand All @@ -88,7 +88,7 @@ export default defineComponent({
},
created() {
this.userStories = this.initialStories as Array<{
id: number | null;
id: string | null;
title: string;
description: string;
estimation: string | null;
Expand Down Expand Up @@ -118,33 +118,6 @@ export default defineComponent({

<!-- Add "scoped" attribute to limit CSS/SCSS to this component only -->
<style lang="scss" scoped>
.animated-badge {
animation: Shake 3s linear infinite; /* Increased duration to account for the pause */
cursor: pointer;
}
@keyframes Shake {
0% {
transform: rotate(5deg);
}
25% {
transform: rotate(-6deg);
}
50% {
transform: rotate(5deg);
}
75% {
transform: rotate(-6deg);
}
100% {
transform: rotate(5deg);
}
}
.description-box {
background: transparent;
padding: 0;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/MemberVotePage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ export default defineComponent({
},
data() {
return {
index: null as number | null,
index: 0,
hostSelectedStoryIndex: undefined,
draggedVote: null,
voteSet: [] as string[],
Expand Down
11 changes: 10 additions & 1 deletion frontend/src/views/PrepareSessionPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ export default defineComponent({
isIssueTrackerEnabled: false,
theme: localStorage.getItem("user-theme"),
isJiraSelected: false,
generatedUUIDs: new Set<number>(),
tabs: [
{
title: this.t("session.prepare.step.wizard.modeSelection"),
Expand Down Expand Up @@ -443,6 +444,14 @@ export default defineComponent({
fileUpload.click();
}
},
generateNumericUUID() {
let uuid: number;
do {
uuid = Math.floor(Math.random() * 1e15) + Date.now();
} while (this.generatedUUIDs.has(uuid));
this.generatedUUIDs.add(uuid);
return uuid;
},
importStory(event: Event) {
const target = event.target as HTMLInputElement;
const files = target.files;
Expand All @@ -461,7 +470,7 @@ export default defineComponent({
const { title, description, estimation } = story;
stories.push({
id: Math.floor(Math.random() * 2000000).toString(),
id: this.generateNumericUUID().toString(),
title: title,
description: description,
estimation: estimation,
Expand Down
25 changes: 11 additions & 14 deletions frontend/src/views/SessionPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@
</b-row>

<div v-if="!planningStart">
<div id="catGifDiv">
<b-img :src="require('@/assets/LoadingCat.gif')" class="catGif" />
</div>
<copy-session-id-popup
:text-before-session-i-d="t('page.session.before.text.beforeID')"
:session-id="sessionID"
Expand Down Expand Up @@ -330,7 +327,7 @@
:host="true"
:initial-stories="userStories"
:card-set="voteSet"
:index="index"
:index="index!"
:hasApiKey="hasApiKey"
@userStoriesChanged="onUserStoriesChanged"
@improveTitle="improveTitle"
Expand All @@ -343,7 +340,7 @@
<user-story-descriptions
:initial-stories="userStories"
:edit-description="true"
:index="index"
:index="index!"
:gpt-description-response="gptDescriptionResponse"
:update-component="updateComponent"
:accepted-stories="acceptedStoriesDescription"
Expand Down Expand Up @@ -373,7 +370,7 @@
<user-story-descriptions
:initial-stories="userStories"
:edit-description="true"
:index="index"
:index="index!"
:gpt-description-response="gptDescriptionResponse"
:update-component="updateComponent"
:isJiraSelected="isJiraSelected"
Expand Down Expand Up @@ -851,16 +848,16 @@ export default defineComponent({
},
acceptSuggestionDescription({ description, originalText }) {
if (originalText) {
this.userStories[this.index].description = this.alternateDescription;
this.userStories[this.index!].description = this.alternateDescription;
} else {
this.userStories[this.index].description = description;
this.userStories[this.index!].description = description;
}
this.onUserStoriesChanged({ us: this.userStories, idx: this.index, doRemove: false });
this.updateComponent = !this.updateComponent;
this.acceptedStoriesDescription.push({ storyID: this.userStories[this.index].id, issueType: this.descriptionMode})
this.acceptedStoriesDescription.push({ storyID: this.userStories[this.index!].id, issueType: this.descriptionMode})
},
async retrySuggestionDescription() {
await this.improveDescription({userStory: this.userStories[this.index],description: this.userStories[this.index].description, issue: this. descriptionMode, confidentialData: this.confidentialData, language: this.userStoryLanguage});
await this.improveDescription({userStory: this.userStories[this.index!],description: this.userStories[this.index!].description, issue: this. descriptionMode, confidentialData: this.confidentialData, language: this.userStoryLanguage});
this.updateComponent = !this.updateComponent;
},
closeModal() {
Expand All @@ -870,21 +867,21 @@ export default defineComponent({
async aiEstimation({confidentialData}){
this.confidentialData = confidentialData;
this.showSpinner = true;
const response = await apiService.estimateUserStory(this.userStories[this.index], confidentialData, this.voteSet);
const response = await apiService.estimateUserStory(this.userStories[this.index!], confidentialData, this.voteSet);
this.showSpinner = false;
this.toast.info(this.t("general.aiFeature.estimationToast.startingText") + "\"" + this.userStories[this.index].title + "\"" + this.t("general.aiFeature.estimationToast.endingText") + response, {timeout: false});
this.toast.info(this.t("general.aiFeature.estimationToast.startingText") + "\"" + this.userStories[this.index!].title + "\"" + this.t("general.aiFeature.estimationToast.endingText") + response, {timeout: false});
},
async splitUserStory({confidentialData: confidentialData, language: language, retry: retry}) {
if(!retry) {
this.confidentialData = confidentialData;
this.language = language;
this.showSpinner = true;
const response = await apiService.splitUserStory(this.userStories[this.index], confidentialData, language);
const response = await apiService.splitUserStory(this.userStories[this.index!], confidentialData, language);
this.showSpinner = false;
this.splitted_user_stories = response;
} else {
this.showSpinner = true;
const response = await apiService.splitUserStory(this.userStories[this.index], this.confidentialData, this.language);
const response = await apiService.splitUserStory(this.userStories[this.index!], this.confidentialData, this.language);
this.showSpinner = false;
this.splitted_user_stories = response;
}
Expand Down

0 comments on commit be6f1ee

Please sign in to comment.