Skip to content

Commit

Permalink
Fix issues in IntelliJ End game (#4455)
Browse files Browse the repository at this point in the history
* Fix always creating application insights issue

* Fix spring cloud properties refresh issue
  • Loading branch information
Flanker32 authored Jun 17, 2020
1 parent 40b1111 commit 3f9a5c1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -293,10 +293,10 @@ protected void textChanged(@NotNull DocumentEvent documentEvent) {
this.rxSubscription = SpringCloudStateManager.INSTANCE.subscribeSpringAppEvent(event -> {
if (event.isUpdate()) {
this.prepareViewModel(event.getAppInner(), event.getDeploymentInner());
} else if (event.isDelete() && StringUtils.equals(event.getId(), this.appId)) {
} else if (event.isDelete()) {
closeEditor();
}
}, appId, clusterId);
}, appId);
}

@NotNull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,14 @@ private void toggleApplicationInsights(boolean enable) {
pack();
}

private boolean isApplicationInsightsEnabled() {
return rdoEnableAI.isSelected();
}

private boolean isCreateApplicationInsights() {
return applicationInsightsPanel.isCreateNewInsights();
}

private void createFunctionApp() {
ProgressManager.getInstance().run(new Task.Modal(null, "Creating New Function App...", true) {
@Override
Expand Down Expand Up @@ -284,8 +292,11 @@ public void run(ProgressIndicator progressIndicator) {
}

private void bindingApplicationInsights(IntelliJFunctionContext functionConfiguration) throws IOException {
if (!isApplicationInsightsEnabled()) {
return;
}
String instrumentationKey = applicationInsightsPanel.getApplicationInsightsInstrumentKey();
if (applicationInsightsPanel.isCreateNewInsights()) {
if (isCreateApplicationInsights()) {
final String region = appServicePlanPanel.getAppServicePlanRegion();
final String insightsName = applicationInsightsPanel.getNewApplicationInsightsName();
final ApplicationInsightsComponent insights =
Expand All @@ -305,6 +316,8 @@ private void sendTelemetry(boolean success, @Nullable String errorMsg) {
telemetryMap.put("CreateNewSP", String.valueOf(appServicePlanPanel.isNewAppServicePlan()));
telemetryMap.put("CreateNewRGP", String.valueOf(resourceGroupPanel.isNewResourceGroup()));
telemetryMap.put("Success", String.valueOf(success));
telemetryMap.put("EnableApplicationInsights", String.valueOf(isApplicationInsightsEnabled()));
telemetryMap.put("CreateNewApplicationInsights", String.valueOf(isCreateApplicationInsights()));
if (!success) {
telemetryMap.put("ErrorMsg", errorMsg);
}
Expand Down

0 comments on commit 3f9a5c1

Please sign in to comment.