From d54fb0c52a0ee990dd6fed2452e74948527098ca Mon Sep 17 00:00:00 2001 From: SponsoredByPuma Date: Wed, 11 Oct 2023 10:40:34 +0200 Subject: [PATCH 1/7] frontend is done, problem in the backend can not send a null value --- backend/build.gradle | 1 + .../azuredevops/AzureDevOpsService.java | 6 ++++- .../jiraserver/JiraServerService.java | 26 ++++++++++++++----- .../src/components/UserStoryDescriptions.vue | 12 ++++++--- frontend/src/views/SessionPage.vue | 1 + 5 files changed, 36 insertions(+), 10 deletions(-) diff --git a/backend/build.gradle b/backend/build.gradle index 06b9ab076..007550ff5 100644 --- a/backend/build.gradle +++ b/backend/build.gradle @@ -28,6 +28,7 @@ dependencies { implementation 'com.google.code.gson:gson:2.10.1' implementation 'org.springdoc:springdoc-openapi-ui:1.7.0' implementation 'org.apache.httpcomponents:httpclient:4.5.14' + implementation 'org.json:json:20230618' testImplementation 'org.springframework.boot:spring-boot-starter-test' testImplementation 'de.flapdoodle.embed:de.flapdoodle.embed.mongo' diff --git a/backend/src/main/java/io/diveni/backend/service/projectmanagementproviders/azuredevops/AzureDevOpsService.java b/backend/src/main/java/io/diveni/backend/service/projectmanagementproviders/azuredevops/AzureDevOpsService.java index 8ee8d2234..dc1228ae7 100644 --- a/backend/src/main/java/io/diveni/backend/service/projectmanagementproviders/azuredevops/AzureDevOpsService.java +++ b/backend/src/main/java/io/diveni/backend/service/projectmanagementproviders/azuredevops/AzureDevOpsService.java @@ -210,7 +210,11 @@ public void updateIssue(String tokenIdentifier, UserStory story) { Map updateEstimation = new HashMap<>(); updateEstimation.put("op", "replace"); updateEstimation.put("path", fieldPrefix + API_FIELD_ESTIMATION); - updateEstimation.put("value", Double.parseDouble(story.getEstimation())); + if (story.getEstimation().equals("-")) { + updateEstimation.put("value", null); + } else { + updateEstimation.put("value", Double.parseDouble(story.getEstimation())); + } content.add(updateEstimation); } catch (NumberFormatException e) { LOGGER.error("Failed to parse estimation into double!"); diff --git a/backend/src/main/java/io/diveni/backend/service/projectmanagementproviders/jiraserver/JiraServerService.java b/backend/src/main/java/io/diveni/backend/service/projectmanagementproviders/jiraserver/JiraServerService.java index eb84be693..52c069d85 100644 --- a/backend/src/main/java/io/diveni/backend/service/projectmanagementproviders/jiraserver/JiraServerService.java +++ b/backend/src/main/java/io/diveni/backend/service/projectmanagementproviders/jiraserver/JiraServerService.java @@ -11,6 +11,8 @@ import java.util.List; import java.util.Map; +import org.json.JSONObject; + import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.ObjectNode; @@ -26,10 +28,7 @@ import com.google.api.client.json.gson.GsonFactory; import io.diveni.backend.Utils; -import io.diveni.backend.model.JiraRequestToken; -import io.diveni.backend.model.Project; -import io.diveni.backend.model.TokenIdentifier; -import io.diveni.backend.model.UserStory; +import io.diveni.backend.model.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; @@ -102,8 +101,14 @@ public boolean serviceEnabled() { private static HttpResponse getResponseFromUrl( OAuthParameters parameters, GenericUrl jiraUrl, String requestMethod, HttpContent content) throws IOException { + if (content != null) { + content.writeTo(System.out); + } HttpRequestFactory requestFactory = new NetHttpTransport().createRequestFactory(parameters); HttpRequest request = requestFactory.buildRequest(requestMethod, jiraUrl, content); + if (request.getContent() != null) { + request.getContent().writeTo(System.out); + } return request.execute(); } @@ -250,7 +255,11 @@ public void updateIssue(String tokenIdentifier, UserStory story) { fields.put("description", story.getDescription()); if (story.getEstimation() != null) { try { - fields.put(ESTIMATION_FIELD, Double.parseDouble(story.getEstimation())); + if (story.getEstimation().equals("-")) { + fields.put(ESTIMATION_FIELD, null); + } else { + fields.put(ESTIMATION_FIELD, Double.parseDouble(story.getEstimation())); + } } catch (NumberFormatException e) { LOGGER.error("Failed to parse estimation into double!"); throw new ResponseStatusException( @@ -263,12 +272,17 @@ public void updateIssue(String tokenIdentifier, UserStory story) { OAuthParameters parameters = jiraOAuthClient.getParameters( accessTokens.get(tokenIdentifier), CONSUMER_KEY, PRIVATE_KEY); + //System.out.println("Test: " + new JsonHttpContent(GsonFactory.getDefaultInstance(), content).getData().toString()); + // still has the ESTIMATION FIELD KEY with its null VALUE + for (Object o : content.entrySet()) { + System.out.println(" --> " + o); + } HttpResponse response = getResponseFromUrl( parameters, new GenericUrl(getJiraUrl() + "/issue/" + story.getId()), "PUT", - new JsonHttpContent(GsonFactory.getDefaultInstance(), content)); + new CustomJsonHttpContent(GsonFactory.getDefaultInstance(), content)); LOGGER.debug("<-- updateIssue() {}", response.parseAsString()); } catch (Exception e) { diff --git a/frontend/src/components/UserStoryDescriptions.vue b/frontend/src/components/UserStoryDescriptions.vue index 0be61f25d..f51f8e180 100644 --- a/frontend/src/components/UserStoryDescriptions.vue +++ b/frontend/src/components/UserStoryDescriptions.vue @@ -31,11 +31,10 @@ :disabled="!editDescription" :value="num" @click=" - userStories[idx].estimation = num; - publishChanges(idx); + setEstimation(num, idx); " > - {{ num }} + {{ num }} @@ -144,6 +143,13 @@ export default Vue.extend({ publishChanges(idx) { this.$emit("userStoriesChanged", { us: this.userStories, idx: idx, doRemove: false }); }, + setEstimation(num, idx) { + if (num === '-') { + //clear userstories + } + this.userStories[idx].estimation = num; + this.publishChanges(idx); + } // synchronizeJira(idx) { // this.$emit("synchronizeJira", { story: this.userStories[idx], doRemove: false }); // }, diff --git a/frontend/src/views/SessionPage.vue b/frontend/src/views/SessionPage.vue index 8ab129219..a2b17128b 100644 --- a/frontend/src/views/SessionPage.vue +++ b/frontend/src/views/SessionPage.vue @@ -297,6 +297,7 @@ export default Vue.extend({ mounted() { if (this.session_voteSetJson) { this.voteSet = JSON.parse(this.session_voteSetJson); + this.voteSet = ["-"].concat(this.voteSet); } this.connectToWebSocket(); if (this.session_sessionState === Constants.memberUpdateCommandStartVoting) { From 47a289f9f3b6af394d1f77ead7646a3f984406f2 Mon Sep 17 00:00:00 2001 From: SponsoredByPuma Date: Tue, 24 Oct 2023 10:35:34 +0200 Subject: [PATCH 2/7] resetting the estimation now works for JiraServer --- .../jiraserver/JiraServerService.java | 31 +++++++------------ .../src/components/UserStoryDescriptions.vue | 7 +---- frontend/src/views/SessionPage.vue | 2 +- 3 files changed, 14 insertions(+), 26 deletions(-) diff --git a/backend/src/main/java/io/diveni/backend/service/projectmanagementproviders/jiraserver/JiraServerService.java b/backend/src/main/java/io/diveni/backend/service/projectmanagementproviders/jiraserver/JiraServerService.java index 52c069d85..8081420ed 100644 --- a/backend/src/main/java/io/diveni/backend/service/projectmanagementproviders/jiraserver/JiraServerService.java +++ b/backend/src/main/java/io/diveni/backend/service/projectmanagementproviders/jiraserver/JiraServerService.java @@ -6,27 +6,25 @@ package io.diveni.backend.service.projectmanagementproviders.jiraserver; import java.io.IOException; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.json.JSONObject; +import com.google.api.client.http.*; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.ObjectNode; import com.google.api.client.auth.oauth.OAuthAuthorizeTemporaryTokenUrl; import com.google.api.client.auth.oauth.OAuthParameters; -import com.google.api.client.http.GenericUrl; -import com.google.api.client.http.HttpContent; -import com.google.api.client.http.HttpRequest; -import com.google.api.client.http.HttpRequestFactory; -import com.google.api.client.http.HttpResponse; import com.google.api.client.http.javanet.NetHttpTransport; import com.google.api.client.http.json.JsonHttpContent; import com.google.api.client.json.gson.GsonFactory; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; import io.diveni.backend.Utils; import io.diveni.backend.model.*; import org.slf4j.Logger; @@ -101,14 +99,8 @@ public boolean serviceEnabled() { private static HttpResponse getResponseFromUrl( OAuthParameters parameters, GenericUrl jiraUrl, String requestMethod, HttpContent content) throws IOException { - if (content != null) { - content.writeTo(System.out); - } HttpRequestFactory requestFactory = new NetHttpTransport().createRequestFactory(parameters); HttpRequest request = requestFactory.buildRequest(requestMethod, jiraUrl, content); - if (request.getContent() != null) { - request.getContent().writeTo(System.out); - } return request.execute(); } @@ -255,7 +247,7 @@ public void updateIssue(String tokenIdentifier, UserStory story) { fields.put("description", story.getDescription()); if (story.getEstimation() != null) { try { - if (story.getEstimation().equals("-")) { + if (story.getEstimation().equals("?")) { fields.put(ESTIMATION_FIELD, null); } else { fields.put(ESTIMATION_FIELD, Double.parseDouble(story.getEstimation())); @@ -268,21 +260,22 @@ public void updateIssue(String tokenIdentifier, UserStory story) { } content.put("fields", fields); try { + + GsonBuilder builder = new GsonBuilder(); + builder.serializeNulls(); + Gson gson = builder.create(); + HttpContent httpContent = new ByteArrayContent("application/json", gson.toJson(content).getBytes(StandardCharsets.UTF_8)); + JiraOAuthClient jiraOAuthClient = new JiraOAuthClient(JIRA_HOME); OAuthParameters parameters = jiraOAuthClient.getParameters( accessTokens.get(tokenIdentifier), CONSUMER_KEY, PRIVATE_KEY); - //System.out.println("Test: " + new JsonHttpContent(GsonFactory.getDefaultInstance(), content).getData().toString()); - // still has the ESTIMATION FIELD KEY with its null VALUE - for (Object o : content.entrySet()) { - System.out.println(" --> " + o); - } HttpResponse response = getResponseFromUrl( parameters, new GenericUrl(getJiraUrl() + "/issue/" + story.getId()), "PUT", - new CustomJsonHttpContent(GsonFactory.getDefaultInstance(), content)); + httpContent); LOGGER.debug("<-- updateIssue() {}", response.parseAsString()); } catch (Exception e) { diff --git a/frontend/src/components/UserStoryDescriptions.vue b/frontend/src/components/UserStoryDescriptions.vue index e14b48ec6..45611f2e4 100644 --- a/frontend/src/components/UserStoryDescriptions.vue +++ b/frontend/src/components/UserStoryDescriptions.vue @@ -24,7 +24,7 @@ :text="(userStories[idx].estimation ? userStories[idx].estimation : '?') + ' '" > , }; }, - computed: { - filteredCardSet(): Array { - return this.cardSet.filter((card) => card !== "?"); - }, - }, watch: { initialStories() { this.userStories = this.initialStories as Array<{ diff --git a/frontend/src/views/SessionPage.vue b/frontend/src/views/SessionPage.vue index 47bbf7934..4525c70cf 100644 --- a/frontend/src/views/SessionPage.vue +++ b/frontend/src/views/SessionPage.vue @@ -344,7 +344,7 @@ export default Vue.extend({ mounted() { if (this.session_voteSetJson) { this.voteSet = JSON.parse(this.session_voteSetJson); - this.voteSet = ["-"].concat(this.voteSet); + this.voteSet = ["?"].concat(this.voteSet); } this.connectToWebSocket(); if (this.session_sessionState === Constants.memberUpdateCommandStartVoting) { From 73632c501a02393dff74b833e5f7bbbdbb7a5d7c Mon Sep 17 00:00:00 2001 From: SponsoredByPuma Date: Tue, 24 Oct 2023 11:13:56 +0200 Subject: [PATCH 3/7] resetting the estimation now works for Azure Dev Ops --- .../azuredevops/AzureDevOpsService.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/backend/src/main/java/io/diveni/backend/service/projectmanagementproviders/azuredevops/AzureDevOpsService.java b/backend/src/main/java/io/diveni/backend/service/projectmanagementproviders/azuredevops/AzureDevOpsService.java index dc1228ae7..a8e13dd39 100644 --- a/backend/src/main/java/io/diveni/backend/service/projectmanagementproviders/azuredevops/AzureDevOpsService.java +++ b/backend/src/main/java/io/diveni/backend/service/projectmanagementproviders/azuredevops/AzureDevOpsService.java @@ -3,6 +3,7 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.gson.Gson; +import com.google.gson.GsonBuilder; import io.diveni.backend.Utils; import io.diveni.backend.controller.ErrorMessages; import io.diveni.backend.model.Project; @@ -208,11 +209,12 @@ public void updateIssue(String tokenIdentifier, UserStory story) { if (story.getEstimation() != null) { try { Map updateEstimation = new HashMap<>(); - updateEstimation.put("op", "replace"); - updateEstimation.put("path", fieldPrefix + API_FIELD_ESTIMATION); - if (story.getEstimation().equals("-")) { - updateEstimation.put("value", null); + if (story.getEstimation().equals("?")) { + updateEstimation.put("op", "remove"); + updateEstimation.put("path", fieldPrefix + API_FIELD_ESTIMATION); } else { + updateEstimation.put("op", "replace"); + updateEstimation.put("path", fieldPrefix + API_FIELD_ESTIMATION); updateEstimation.put("value", Double.parseDouble(story.getEstimation())); } content.add(updateEstimation); @@ -238,7 +240,6 @@ public void updateIssue(String tokenIdentifier, UserStory story) { testRev.put("path", "/rev"); testRev.put("value", node.get("rev").asText()); content.add(testRev); - executeRequest( String.format( AZURE_DEVOPS_API, From 51f7ebf6280075878c4517a8d17b245cf3f2c68f Mon Sep 17 00:00:00 2001 From: SponsoredByPuma Date: Tue, 24 Oct 2023 11:18:22 +0200 Subject: [PATCH 4/7] the "?" vote is now automatically an active value on each vote set --- frontend/src/components/CardSetComponent.vue | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/frontend/src/components/CardSetComponent.vue b/frontend/src/components/CardSetComponent.vue index 4a99e0672..2f30ed077 100644 --- a/frontend/src/components/CardSetComponent.vue +++ b/frontend/src/components/CardSetComponent.vue @@ -94,7 +94,7 @@ export default Vue.extend({ { name: this.$t("session.prepare.step.selection.cardSet.sets.fibonacci.label"), description: this.$t("session.prepare.step.selection.cardSet.sets.fibonacci.description"), - values: ["1", "2", "3", "5", "8", "13", "21", "34", "55", "?"], + values: ["1", "2", "3", "5", "8", "13", "21", "34", "55"], activeValues: ["1", "2", "3", "5", "8", "13", "21"], position: 1, }, @@ -103,21 +103,21 @@ export default Vue.extend({ description: this.$t( "session.prepare.step.selection.cardSet.sets.tShirtSizes.description" ), - values: ["XXS", "XS", "S", "M", "L", "XL", "XXL", "XXXL", "?"], + values: ["XXS", "XS", "S", "M", "L", "XL", "XXL", "XXXL"], activeValues: ["XS", "S", "M", "L", "XL"], position: 2, }, { name: this.$t("session.prepare.step.selection.cardSet.sets.hours.label"), description: this.$t("session.prepare.step.selection.cardSet.sets.hours.description"), - values: ["1", "2", "3", "4", "5", "6", "8", "10", "12", "16", "?"], + values: ["1", "2", "3", "4", "5", "6", "8", "10", "12", "16"], activeValues: ["1", "2", "3", "4", "5", "6", "8", "10", "12", "16"], position: 3, }, { name: this.$t("session.prepare.step.selection.cardSet.sets.numbers.label"), description: this.$t("session.prepare.step.selection.cardSet.sets.numbers.description"), - values: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "?"], + values: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10"], activeValues: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10"], position: 4, }, @@ -133,21 +133,21 @@ export default Vue.extend({ { name: this.$t("session.prepare.step.selection.cardSet.sets.fibonacci.label"), description: this.$t("session.prepare.step.selection.cardSet.sets.fibonacci.description"), - values: ["1", "2", "3", "5", "8", "13", "21", "34", "55", "?"], + values: ["1", "2", "3", "5", "8", "13", "21", "34", "55"], activeValues: ["1", "2", "3", "5", "8", "13", "21"], position: 1, }, { name: this.$t("session.prepare.step.selection.cardSet.sets.hours.label"), description: this.$t("session.prepare.step.selection.cardSet.sets.hours.description"), - values: ["1", "2", "3", "4", "5", "6", "8", "10", "12", "16", "?"], + values: ["1", "2", "3", "4", "5", "6", "8", "10", "12", "16"], activeValues: ["1", "2", "3", "4", "5", "6", "8", "10", "12", "16"], position: 2, }, { name: this.$t("session.prepare.step.selection.cardSet.sets.numbers.label"), description: this.$t("session.prepare.step.selection.cardSet.sets.numbers.description"), - values: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "?"], + values: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10"], activeValues: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10"], position: 3, }, From 5b21da7accfd4625a646e9bcb3ad98568423adcc Mon Sep 17 00:00:00 2001 From: github-actions <> Date: Tue, 24 Oct 2023 09:19:55 +0000 Subject: [PATCH 5/7] Google Java Format --- .../azuredevops/AzureDevOpsService.java | 1 - .../jiraserver/JiraServerService.java | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/src/main/java/io/diveni/backend/service/projectmanagementproviders/azuredevops/AzureDevOpsService.java b/backend/src/main/java/io/diveni/backend/service/projectmanagementproviders/azuredevops/AzureDevOpsService.java index a8e13dd39..971adaa66 100644 --- a/backend/src/main/java/io/diveni/backend/service/projectmanagementproviders/azuredevops/AzureDevOpsService.java +++ b/backend/src/main/java/io/diveni/backend/service/projectmanagementproviders/azuredevops/AzureDevOpsService.java @@ -3,7 +3,6 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; import io.diveni.backend.Utils; import io.diveni.backend.controller.ErrorMessages; import io.diveni.backend.model.Project; diff --git a/backend/src/main/java/io/diveni/backend/service/projectmanagementproviders/jiraserver/JiraServerService.java b/backend/src/main/java/io/diveni/backend/service/projectmanagementproviders/jiraserver/JiraServerService.java index 8081420ed..378a84ff7 100644 --- a/backend/src/main/java/io/diveni/backend/service/projectmanagementproviders/jiraserver/JiraServerService.java +++ b/backend/src/main/java/io/diveni/backend/service/projectmanagementproviders/jiraserver/JiraServerService.java @@ -264,7 +264,9 @@ public void updateIssue(String tokenIdentifier, UserStory story) { GsonBuilder builder = new GsonBuilder(); builder.serializeNulls(); Gson gson = builder.create(); - HttpContent httpContent = new ByteArrayContent("application/json", gson.toJson(content).getBytes(StandardCharsets.UTF_8)); + HttpContent httpContent = + new ByteArrayContent( + "application/json", gson.toJson(content).getBytes(StandardCharsets.UTF_8)); JiraOAuthClient jiraOAuthClient = new JiraOAuthClient(JIRA_HOME); OAuthParameters parameters = From 4cb75794a71cc3d15e4f3e7ee9e4a8d56423a4ef Mon Sep 17 00:00:00 2001 From: SponsoredByPuma Date: Tue, 24 Oct 2023 11:27:54 +0200 Subject: [PATCH 6/7] cleaned up the code a bit (removed unnecessary changes) --- backend/build.gradle | 1 - .../azuredevops/AzureDevOpsService.java | 2 +- .../jiraserver/JiraServerService.java | 5 ++++- frontend/src/components/UserStoryDescriptions.vue | 10 ++-------- 4 files changed, 7 insertions(+), 11 deletions(-) diff --git a/backend/build.gradle b/backend/build.gradle index cf0c39e0a..633e97363 100644 --- a/backend/build.gradle +++ b/backend/build.gradle @@ -28,7 +28,6 @@ dependencies { implementation 'com.google.code.gson:gson:2.10.1' implementation 'org.springdoc:springdoc-openapi-ui:1.7.0' implementation 'org.apache.httpcomponents:httpclient:4.5.14' - implementation 'org.json:json:20230618' testImplementation 'org.springframework.boot:spring-boot-starter-test' testImplementation 'de.flapdoodle.embed:de.flapdoodle.embed.mongo' diff --git a/backend/src/main/java/io/diveni/backend/service/projectmanagementproviders/azuredevops/AzureDevOpsService.java b/backend/src/main/java/io/diveni/backend/service/projectmanagementproviders/azuredevops/AzureDevOpsService.java index a8e13dd39..ec8853246 100644 --- a/backend/src/main/java/io/diveni/backend/service/projectmanagementproviders/azuredevops/AzureDevOpsService.java +++ b/backend/src/main/java/io/diveni/backend/service/projectmanagementproviders/azuredevops/AzureDevOpsService.java @@ -3,7 +3,6 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; import io.diveni.backend.Utils; import io.diveni.backend.controller.ErrorMessages; import io.diveni.backend.model.Project; @@ -240,6 +239,7 @@ public void updateIssue(String tokenIdentifier, UserStory story) { testRev.put("path", "/rev"); testRev.put("value", node.get("rev").asText()); content.add(testRev); + executeRequest( String.format( AZURE_DEVOPS_API, diff --git a/backend/src/main/java/io/diveni/backend/service/projectmanagementproviders/jiraserver/JiraServerService.java b/backend/src/main/java/io/diveni/backend/service/projectmanagementproviders/jiraserver/JiraServerService.java index 8081420ed..2c2e2a321 100644 --- a/backend/src/main/java/io/diveni/backend/service/projectmanagementproviders/jiraserver/JiraServerService.java +++ b/backend/src/main/java/io/diveni/backend/service/projectmanagementproviders/jiraserver/JiraServerService.java @@ -26,7 +26,10 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; import io.diveni.backend.Utils; -import io.diveni.backend.model.*; +import io.diveni.backend.model.JiraRequestToken; +import io.diveni.backend.model.Project; +import io.diveni.backend.model.TokenIdentifier; +import io.diveni.backend.model.UserStory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; diff --git a/frontend/src/components/UserStoryDescriptions.vue b/frontend/src/components/UserStoryDescriptions.vue index 45611f2e4..582d18904 100644 --- a/frontend/src/components/UserStoryDescriptions.vue +++ b/frontend/src/components/UserStoryDescriptions.vue @@ -29,7 +29,8 @@ :disabled="!editDescription" :value="num" @click=" - setEstimation(num, idx); + userStories[idx].estimation = num; + publishChanges(idx); $event.target.blur(); " > @@ -144,13 +145,6 @@ export default Vue.extend({ publishChanges(idx) { this.$emit("userStoriesChanged", { us: this.userStories, idx: idx, doRemove: false }); }, - setEstimation(num, idx) { - if (num === '-') { - //clear userstories - } - this.userStories[idx].estimation = num; - this.publishChanges(idx); - } // synchronizeJira(idx) { // this.$emit("synchronizeJira", { story: this.userStories[idx], doRemove: false }); // }, From 139097c153cbfa4b17de60e6943f50995c7bd1c1 Mon Sep 17 00:00:00 2001 From: SponsoredByPuma Date: Wed, 21 Feb 2024 11:28:54 +0100 Subject: [PATCH 7/7] fix build issues, removed unused code --- frontend/src/views/SessionPage.vue | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/frontend/src/views/SessionPage.vue b/frontend/src/views/SessionPage.vue index 2c7d5c542..f21ef2c0b 100644 --- a/frontend/src/views/SessionPage.vue +++ b/frontend/src/views/SessionPage.vue @@ -448,7 +448,6 @@ export default defineComponent({ }, }, async created() { - this.copyPropsToData(); this.store.clearStoreWithoutUserStories(); if (!this.sessionID || !this.adminID) { //check for cookie @@ -467,12 +466,9 @@ export default defineComponent({ if (this.rejoined === "false") { this.connectToWebSocket(); } - if (this.session_voteSetJson) { - this.voteSet = JSON.parse(this.session_voteSetJson); - this.voteSet = ["?"].concat(this.voteSet); - } if (this.voteSetJson) { this.voteSet = JSON.parse(this.voteSetJson); + this.voteSet = ["?"].concat(this.voteSet); } if (this.sessionState === Constants.memberUpdateCommandStartVoting) { this.planningStart = true; @@ -523,17 +519,6 @@ export default defineComponent({ } } }, - copyPropsToData() { - // if (this.adminID) { - // this.session_adminID = this.adminID; - // this.session_sessionID = this.sessionID; - // this.session_sessionState = this.sessionState; - // this.session_timerSecondsString = this.timerSecondsString; - // this.session_voteSetJson = this.voteSetJson; - // this.session_userStoryMode = this.userStoryMode; - // this.session_hostVoting = String(this.hostVoting).toLowerCase() === "true"; - // } - }, assignSessionToData(session) { if (Object.keys(session).length !== 0) { this.adminID = session.adminID;