Skip to content

Commit 3f9a5c1

Browse files
authored
Fix issues in IntelliJ End game (#4455)
* Fix always creating application insights issue * Fix spring cloud properties refresh issue
1 parent 40b1111 commit 3f9a5c1

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

PluginsAndFeatures/azure-toolkit-for-intellij/src/com/microsoft/intellij/helpers/springcloud/SpringCloudAppPropertyView.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,10 +293,10 @@ protected void textChanged(@NotNull DocumentEvent documentEvent) {
293293
this.rxSubscription = SpringCloudStateManager.INSTANCE.subscribeSpringAppEvent(event -> {
294294
if (event.isUpdate()) {
295295
this.prepareViewModel(event.getAppInner(), event.getDeploymentInner());
296-
} else if (event.isDelete() && StringUtils.equals(event.getId(), this.appId)) {
296+
} else if (event.isDelete()) {
297297
closeEditor();
298298
}
299-
}, appId, clusterId);
299+
}, appId);
300300
}
301301

302302
@NotNull

PluginsAndFeatures/azure-toolkit-for-intellij/src/com/microsoft/intellij/runner/functions/deploy/ui/creation/FunctionCreationDialog.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,14 @@ private void toggleApplicationInsights(boolean enable) {
251251
pack();
252252
}
253253

254+
private boolean isApplicationInsightsEnabled() {
255+
return rdoEnableAI.isSelected();
256+
}
257+
258+
private boolean isCreateApplicationInsights() {
259+
return applicationInsightsPanel.isCreateNewInsights();
260+
}
261+
254262
private void createFunctionApp() {
255263
ProgressManager.getInstance().run(new Task.Modal(null, "Creating New Function App...", true) {
256264
@Override
@@ -284,8 +292,11 @@ public void run(ProgressIndicator progressIndicator) {
284292
}
285293

286294
private void bindingApplicationInsights(IntelliJFunctionContext functionConfiguration) throws IOException {
295+
if (!isApplicationInsightsEnabled()) {
296+
return;
297+
}
287298
String instrumentationKey = applicationInsightsPanel.getApplicationInsightsInstrumentKey();
288-
if (applicationInsightsPanel.isCreateNewInsights()) {
299+
if (isCreateApplicationInsights()) {
289300
final String region = appServicePlanPanel.getAppServicePlanRegion();
290301
final String insightsName = applicationInsightsPanel.getNewApplicationInsightsName();
291302
final ApplicationInsightsComponent insights =
@@ -305,6 +316,8 @@ private void sendTelemetry(boolean success, @Nullable String errorMsg) {
305316
telemetryMap.put("CreateNewSP", String.valueOf(appServicePlanPanel.isNewAppServicePlan()));
306317
telemetryMap.put("CreateNewRGP", String.valueOf(resourceGroupPanel.isNewResourceGroup()));
307318
telemetryMap.put("Success", String.valueOf(success));
319+
telemetryMap.put("EnableApplicationInsights", String.valueOf(isApplicationInsightsEnabled()));
320+
telemetryMap.put("CreateNewApplicationInsights", String.valueOf(isCreateApplicationInsights()));
308321
if (!success) {
309322
telemetryMap.put("ErrorMsg", errorMsg);
310323
}

0 commit comments

Comments
 (0)