Skip to content

Commit 7505250

Browse files
committed
Merge branch 'endgame-s187' into release
2 parents e913b47 + ec7d38b commit 7505250

File tree

12 files changed

+42
-21
lines changed

12 files changed

+42
-21
lines changed

PluginsAndFeatures/azure-toolkit-for-intellij/.idea/gradle.xml

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

PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-resource-connector-lib/src/main/java/com/microsoft/azure/toolkit/intellij/connector/ConnectionRunnerForRunConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public boolean isApplicableFor(@NotNull RunConfigurationBase<?> configuration) {
9696
final MyBeforeRunTask task = new MyBeforeRunTask();
9797
task.setEnabled(true);
9898
this.addTask(configuration, task);
99-
} else if (!myTasks.isEmpty()) {
99+
} else if (!applicable && !myTasks.isEmpty()) {
100100
tasks.removeAll(myTasks);
101101
}
102102
return applicable;

PluginsAndFeatures/azure-toolkit-for-intellij/azure-sdk-reference-book/src/main/java/com/microsoft/azure/toolkit/intellij/azuresdk/dependencesurvey/activity/WorkspaceTaggingActivity.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import com.intellij.openapi.application.ApplicationManager;
99
import com.intellij.openapi.project.Project;
1010
import com.intellij.openapi.roots.OrderEnumerator;
11-
import com.intellij.openapi.startup.StartupActivity;
1211
import com.microsoft.azure.toolkit.intellij.azuresdk.service.WorkspaceTaggingService;
1312
import com.microsoft.azure.toolkit.intellij.common.survey.CustomerSurvey;
1413
import com.microsoft.azure.toolkit.intellij.common.survey.CustomerSurveyManager;
@@ -26,7 +25,7 @@
2625
import java.util.regex.Matcher;
2726
import java.util.regex.Pattern;
2827

29-
public class WorkspaceTaggingActivity implements StartupActivity.DumbAware {
28+
public class WorkspaceTaggingActivity {
3029
private static final Logger logger = Logger.getLogger(WorkspaceTaggingActivity.class.getName());
3130

3231
private static final Pattern PATTERN = Pattern.compile("(Gradle|Maven): (.+):(.+):(.+)");
@@ -40,8 +39,8 @@ public class WorkspaceTaggingActivity implements StartupActivity.DumbAware {
4039
private static final String MGMT = "mgmt";
4140
private static final String SPRING = "spring";
4241

43-
@Override
44-
public void runActivity(@NotNull final Project project) {
42+
public static void runActivity(@NotNull final Project project) {
43+
4544
ApplicationManager.getApplication().executeOnPooledThread(() -> {
4645
try {
4746
final Set<String> workspaceTags = getWorkspaceTags(project);
@@ -54,7 +53,7 @@ public void runActivity(@NotNull final Project project) {
5453
});
5554
}
5655

57-
private void showCustomerSurvey(final Project project, final Set<String> workspaceTags) {
56+
private static void showCustomerSurvey(final Project project, final Set<String> workspaceTags) {
5857
if (workspaceTags.containsAll(Arrays.asList(CLIENT, MGMT))) {
5958
CustomerSurveyManager.getInstance().takeSurvey(project, CustomerSurvey.AZURE_SDK);
6059
}
@@ -68,9 +67,10 @@ private void showCustomerSurvey(final Project project, final Set<String> workspa
6867
if (workspaceTags.contains(CLIENT)) {
6968
CustomerSurveyManager.getInstance().takeSurvey(project, CustomerSurvey.AZURE_CLIENT_SDK);
7069
}
70+
CustomerSurveyManager.getInstance().takeSurvey(project, CustomerSurvey.AZURE_INTELLIJ_TOOLKIT);
7171
}
7272

73-
private Set<String> getWorkspaceTags(@NotNull final Project project) {
73+
private static Set<String> getWorkspaceTags(@NotNull final Project project) {
7474
final Set<String> tagSet = new HashSet<>();
7575
OrderEnumerator.orderEntries(project).forEachLibrary(library -> {
7676
if (StringUtils.isNotEmpty(library.getName())) {
@@ -87,7 +87,7 @@ private Set<String> getWorkspaceTags(@NotNull final Project project) {
8787
return tagSet;
8888
}
8989

90-
private void trackWorkspaceTagging(final Set<String> tagSet) {
90+
private static void trackWorkspaceTagging(final Set<String> tagSet) {
9191
final Map<String, String> properties = new HashMap<>();
9292
properties.put(SERVICE_NAME, SYSTEM);
9393
properties.put(OPERATION_NAME, WORKSPACE_TAGGING);

PluginsAndFeatures/azure-toolkit-for-intellij/azure-sdk-reference-book/src/main/resources/META-INF/azure-sdk-reference-book.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
<extensionPoints>
33
</extensionPoints>
44
<extensions defaultExtensionNs="com.intellij">
5-
<postStartupActivity implementation="com.microsoft.azure.toolkit.intellij.azuresdk.dependencesurvey.activity.WorkspaceTaggingActivity"/>
65
</extensions>
76
<actions>
87
<action id="AzureToolkit.OpenSdkReferenceBook"

PluginsAndFeatures/azure-toolkit-for-intellij/src/com/microsoft/azure/toolkit/intellij/database/RegionComboBox.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@ protected String getItemText(Object item) {
6868
}
6969

7070
@Override
71-
public void setSelectedItem(Object value) {
72-
if (!Objects.equals(value, getSelectedItem())) {
73-
super.setSelectedItem(value);
71+
public void setValue(Region value) {
72+
if (!Objects.equals(value, getValue())) {
73+
super.setValue(value);
7474
validateRequired = true;
7575
} else {
76-
super.setSelectedItem(value);
76+
super.setValue(value);
7777
}
7878
}
7979

PluginsAndFeatures/azure-toolkit-for-intellij/src/com/microsoft/azure/toolkit/intellij/mysql/creation/MySQLCreationAdvancedPanel.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ private void init() {
7070
passwordFieldInput = PasswordUtils.generatePasswordFieldInput(this.passwordField, this.adminUsernameTextField);
7171
confirmPasswordFieldInput = PasswordUtils.generateConfirmPasswordFieldInput(this.confirmPasswordField, this.passwordField);
7272
regionComboBox.setValidateFunction(new MySQLRegionValidator());
73+
serverNameTextField.setSubscriptionId(config.getSubscription().getId());
7374
serverNameTextField.setMinLength(3);
7475
serverNameTextField.setMaxLength(63);
7576
serverNameTextField.setValidateFunction(new SqlServerNameValidator());

PluginsAndFeatures/azure-toolkit-for-intellij/src/com/microsoft/azure/toolkit/intellij/sqlserver/creation/SqlServerCreationAdvancedPanel.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ private void init() {
6666
passwordFieldInput = PasswordUtils.generatePasswordFieldInput(this.passwordField, this.adminUsernameTextField);
6767
confirmPasswordFieldInput = PasswordUtils.generateConfirmPasswordFieldInput(this.confirmPasswordField, this.passwordField);
6868
regionComboBox.setValidateFunction(new SqlServerRegionValidator());
69+
serverNameTextField.setSubscriptionId(config.getSubscription().getId());
6970
serverNameTextField.setMinLength(1);
7071
serverNameTextField.setMaxLength(63);
7172
serverNameTextField.setValidateFunction(new SqlServerNameValidator());

PluginsAndFeatures/azure-toolkit-for-intellij/src/com/microsoft/intellij/AzurePlugin.java

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import com.intellij.util.containers.HashSet;
2727
import com.microsoft.applicationinsights.preference.ApplicationInsightsResource;
2828
import com.microsoft.applicationinsights.preference.ApplicationInsightsResourceRegistry;
29+
import com.microsoft.azure.toolkit.intellij.azuresdk.dependencesurvey.activity.WorkspaceTaggingActivity;
2930
import com.microsoft.azure.toolkit.lib.Azure;
3031
import com.microsoft.azuretools.authmanage.CommonSettings;
3132
import com.microsoft.azuretools.azurecommons.deploy.DeploymentEventArgs;
@@ -38,7 +39,6 @@
3839
import com.microsoft.azuretools.telemetrywrapper.EventType;
3940
import com.microsoft.azuretools.telemetrywrapper.EventUtil;
4041
import com.microsoft.azuretools.utils.TelemetryUtils;
41-
import com.microsoft.intellij.helpers.CustomerSurveyHelper;
4242
import com.microsoft.intellij.helpers.WhatsNewManager;
4343
import com.microsoft.intellij.ui.libraries.AILibraryHandler;
4444
import com.microsoft.intellij.ui.libraries.AzureLibrary;
@@ -50,6 +50,8 @@
5050
import org.apache.commons.lang.StringUtils;
5151
import org.jetbrains.annotations.NotNull;
5252
import org.w3c.dom.Document;
53+
import rx.Observable;
54+
import rx.schedulers.Schedulers;
5355

5456
import javax.swing.event.EventListenerList;
5557
import java.io.*;
@@ -58,6 +60,7 @@
5860
import java.util.List;
5961
import java.util.Objects;
6062
import java.util.Set;
63+
import java.util.concurrent.TimeUnit;
6164
import java.util.zip.ZipEntry;
6265
import java.util.zip.ZipInputStream;
6366

@@ -72,6 +75,7 @@ public class AzurePlugin implements StartupActivity.DumbAware {
7275
public static final String JDBC_LIBRARIES_VERSION = "6.1.0.jre8";
7376
public static final int REST_SERVICE_MAX_RETRY_COUNT = 7;
7477
private static PluginStateListener pluginStateListener = null;
78+
private static final int POP_UP_DELAY = 30;
7579

7680
// User-agent header for Azure SDK calls
7781
public static final String USER_AGENT = "Azure Toolkit for IntelliJ, v%s, machineid:%s";
@@ -105,7 +109,6 @@ public void runActivity(@NotNull Project project) {
105109

106110
initializeAIRegistry(project);
107111
// Showing dialog needs to be run in UI thread
108-
initializeFeedbackNotification(project);
109112
initializeWhatsNew(project);
110113

111114
if (!IS_ANDROID_STUDIO) {
@@ -117,6 +120,7 @@ public void runActivity(@NotNull Project project) {
117120
initializeTelemetry();
118121
clearTempDirectory();
119122
loadWebappsSettings(project);
123+
runWorkspaceTaggingActivity(project);
120124
} catch (ProcessCanceledException e) {
121125
throw e;
122126
} catch (Exception e) {
@@ -137,8 +141,13 @@ private void initializeWhatsNew(Project project) {
137141
});
138142
}
139143

140-
private void initializeFeedbackNotification(Project myProject) {
141-
CustomerSurveyHelper.INSTANCE.showFeedbackNotification(myProject);
144+
private void runWorkspaceTaggingActivity(Project myProject) {
145+
Observable.timer(POP_UP_DELAY, TimeUnit.SECONDS)
146+
.subscribeOn(Schedulers.newThread())
147+
.take(1)
148+
.subscribe(next -> {
149+
WorkspaceTaggingActivity.runActivity(myProject);
150+
});
142151
}
143152

144153
private synchronized void initializeTelemetry() throws Exception {

PluginsAndFeatures/azure-toolkit-for-intellij/src/com/microsoft/intellij/forms/CreateVirtualNetworkForm.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public void changedUpdate(DocumentEvent documentEvent) {
6262
subnetNameField.getDocument().addDocumentListener(docListener);
6363
subnetAddressRangeField.getDocument().addDocumentListener(docListener);
6464

65-
regionField.setText(region.toString());
65+
regionField.setText(region.getLabel().toString());
6666

6767
validateFields();
6868
init();

Utils/azure-explorer-common/src/com/microsoft/tooling/msservices/serviceexplorer/azure/sqlserver/SqlServerNode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ private void openInPortal() {
7777
this.openResourcesInPortal(this.subscriptionId, this.server.entity().getId());
7878
}
7979

80-
@AzureOperation(name = ActionConstants.MySQL.SHOW_PROPERTIES, type = AzureOperation.Type.ACTION)
80+
@AzureOperation(name = ActionConstants.SqlServer.SHOW_PROPERTIES, type = AzureOperation.Type.ACTION)
8181
private void showProperties() {
8282
DefaultLoader.getUIHelper().openSqlServerPropertyView(SqlServerNode.this);
8383
}

0 commit comments

Comments
 (0)