Skip to content

Commit e6ce69e

Browse files
authored
Merge pull request #2452 from digma-ai/fix/recheck
Added recheck response
2 parents 02b905f + 8094b9b commit e6ce69e

File tree

4 files changed

+176
-218
lines changed

4 files changed

+176
-218
lines changed

src/main/java/org/digma/intellij/plugin/insights/AbstractInsightsMessageRouterHandler.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public boolean doOnQuery(@NotNull Project project, @NotNull CefBrowser browser,
4646

4747
case "INSIGHTS/OPEN_HISTOGRAM" -> openHistogram(requestJsonNode);
4848

49-
case "INSIGHTS/RECALCULATE" -> recalculate(requestJsonNode);
49+
case "INSIGHTS/RECALCULATE" -> recalculate(browser, requestJsonNode);
5050

5151
case "INSIGHTS/GO_TO_TRACE" -> goToTrace(requestJsonNode);
5252

@@ -281,10 +281,12 @@ private void openLiveView(JsonNode jsonNode) throws JsonProcessingException {
281281
InsightsService.getInstance(getProject()).openLiveView(codeObjectId);
282282
}
283283

284-
285-
private void recalculate(JsonNode jsonNode) throws JsonProcessingException {
284+
private void recalculate(@NotNull CefBrowser browser, JsonNode jsonNode) throws JsonProcessingException {
286285
var insightId = getObjectMapper().readTree(jsonNode.get("payload").toString()).get("id").asText();
287286
InsightsService.getInstance(getProject()).recalculate(insightId);
287+
288+
var message = new SetInsightRecalculatedMessage(new SetInsightRecalculated(insightId));
289+
serializeAndExecuteWindowPostMessageJavaScript(browser, message);
288290
}
289291

290292
private void goToTrace(JsonNode jsonNode) {
@@ -310,7 +312,5 @@ private void goToTraceComparison(JsonNode jsonNode) {
310312
InsightsService.getInstance(getProject()).goToTraceComparison(traceId1, traceName1, traceId2, traceName2, insightType);
311313
}
312314
}
313-
314-
315315
}
316316

src/main/java/org/digma/intellij/plugin/insights/InsightsServiceImpl.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,11 @@ public void recalculate(@NotNull String insightId) {
9292
}
9393
}
9494

95-
9695
public void goToTrace(@NotNull String traceId, @NotNull String traceName, @NotNull String insightType, @Nullable String spanCodeObjectId) {
9796
JaegerUtilKt.openJaegerFromInsight(project, traceId, traceName, insightType, spanCodeObjectId);
9897
}
9998

10099
public void goToTraceComparison(@NotNull String traceId1, @NotNull String traceName1, @NotNull String traceId2, @NotNull String traceName2, @NotNull String insightType) {
101100
JaegerUtilKt.openJaegerComparisonFromInsight(project, traceId1, traceName1, traceId2, traceName2, insightType);
102101
}
103-
104-
105102
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package org.digma.intellij.plugin.ui.insights.model
2+
3+
import com.fasterxml.jackson.annotation.JsonCreator
4+
import com.fasterxml.jackson.annotation.JsonIgnoreProperties
5+
import org.digma.intellij.plugin.ui.jcef.JCEFGlobalConstants
6+
import java.beans.ConstructorProperties
7+
8+
9+
@JsonIgnoreProperties(ignoreUnknown = true)
10+
data class SetInsightRecalculated @JsonCreator(mode = JsonCreator.Mode.PROPERTIES)
11+
@ConstructorProperties("insightId")
12+
constructor(
13+
val insightId: String,
14+
)
15+
16+
data class SetInsightRecalculatedMessage(val payload: SetInsightRecalculated) {
17+
val type = JCEFGlobalConstants.REQUEST_MESSAGE_TYPE
18+
val action = "INSIGHTS/SET_RECALCULATED"
19+
}
20+

src/main/resources/webview/main/index.js

Lines changed: 151 additions & 210 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)