Skip to content

Commit a18540d

Browse files
committed
Merge branch 'endgame-july' into endgame-july.next
2 parents 49d941e + 48853aa commit a18540d

File tree

42 files changed

+542
-421
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+542
-421
lines changed

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
All notable changes to "Azure Toolkit for IntelliJ IDEA" will be documented in this file.
44

55
- [Change Log](#change-log)
6+
- [3.55.0](#3550)
67
- [3.54.0](#3540)
78
- [3.53.0](#3530)
89
- [3.52.0](#3520)
@@ -69,6 +70,31 @@ All notable changes to "Azure Toolkit for IntelliJ IDEA" will be documented in t
6970
- [3.0.7](#307)
7071
- [3.0.6](#306)
7172

73+
## 3.55.0
74+
### Added
75+
- New Azure Resource Connector explorer for connection management
76+
- List all resource connections connected to project
77+
- Create new connections between Azure resources and module in project
78+
- Edit/Delete existing connections
79+
- Navigate to resource properties view of an existing connection
80+
- Support native proxy settings in IntelliJ
81+
- Add unified `Open In Portal` support for Web App/VM/Resource Group in Azure explorer
82+
83+
### Changed
84+
- Enhance toolkit setting panel with more configuration
85+
- Enhance resource loading performance in Azure explorer
86+
- Support turn off Azure SDK deprecation notification
87+
- Support create Azure Spring Cloud app in Azure explorer
88+
- Update Azure icons to new style
89+
90+
### Fixed
91+
- [#5439](https://github.com/microsoft/azure-tools-for-java/issues/5439) Fix project already disposed excpetion while loading azure sdk reference book meta data
92+
- [PR#5437](https://github.com/microsoft/azure-tools-for-java/pull/5437) Fix exception while edit json in service principal dialog
93+
- [PR#5476](https://github.com/microsoft/azure-tools-for-java/pull/5476) Fix url render issue for toolkit notification
94+
- [PR#5535](https://github.com/microsoft/azure-tools-for-java/pull/5535) Fix evaluate effective pom will break app service/spring cloud deployment
95+
- [PR#5563](https://github.com/microsoft/azure-tools-for-java/pull/5563) Fix exception: type HTTP is not compatible with address null
96+
- [PR#5579](https://github.com/microsoft/azure-tools-for-java/pull/5579) Fix reporting error in azure explorer before sign in
97+
7298
## 3.54.0
7399
### Added
74100
- User would be reminded if deprecated Azure SDK libs are used in project.

PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-plugin-lib/src/main/java/com/microsoft/azure/toolkit/intellij/common/AzureComboBox.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import com.microsoft.azure.toolkit.lib.common.utils.TailingDebouncer;
1818
import lombok.Getter;
1919
import lombok.Setter;
20-
import org.apache.commons.collections.CollectionUtils;
20+
import org.apache.commons.collections4.CollectionUtils;
2121
import org.apache.commons.lang.StringUtils;
2222
import org.apache.commons.lang3.exception.ExceptionUtils;
2323
import rx.Observable;
@@ -223,6 +223,8 @@ protected synchronized void setItems(final List<? extends T> items) {
223223
}
224224

225225
public void clear() {
226+
this.value = null;
227+
this.valueNotSet = true;
226228
final DefaultComboBoxModel<T> model = (DefaultComboBoxModel<T>) this.getModel();
227229
model.removeAllElements();
228230
this.refreshValue();

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,14 @@ private void fixConsumerType(ResourceDefinition<? extends Resource> definition)
208208

209209
private void createUIComponents() {
210210
this.consumerTypeSelector = new AzureComboBoxSimple<>(() -> ResourceManager.getDefinitions(ResourceDefinition.CONSUMER));
211-
this.resourceTypeSelector = new AzureComboBoxSimple<>(() -> ResourceManager.getDefinitions(ResourceDefinition.RESOURCE));
211+
this.resourceTypeSelector = new AzureComboBoxSimple<>(() -> ResourceManager.getDefinitions(ResourceDefinition.RESOURCE)) {
212+
@Override
213+
protected String getItemText(final Object item) {
214+
if (item instanceof ResourceDefinition) {
215+
return ((ResourceDefinition<?>) item).getTitle();
216+
}
217+
return super.getItemText(item);
218+
}
219+
};
212220
}
213221
}

PluginsAndFeatures/azure-toolkit-for-intellij/resources/META-INF/plugin.xml

Lines changed: 47 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,57 @@
2525
<change-notes>
2626
<![CDATA[
2727
<html>
28-
<h3>3.54.0</h3>
28+
<h3>3.55.0</h3>
2929
<h4>Added</h4>
3030
<ul>
31-
<li>User would be reminded if deprecated Azure SDK libs are used in project.</li>
32-
<li>Development workflow for SQL Server on Azure: user can now connect SQL Server to local project from Azure Explorer, project, module or application.properties file.</li>
31+
<li>New Azure Resource Connector explorer for connection management</li>
32+
<ul>
33+
<li>List all resource connections connected to project</li>
34+
<li>Create new connections between Azure resources and module in project</li>
35+
<li>Edit/Delete existing connections</li>
36+
<li>Navigate to resource properties view of an existing connection</li>
37+
</ul>
38+
<li>Support native proxy settings in IntelliJ</li>
39+
<li>
40+
Add unified
41+
<code>Open In Portal</code>
42+
support for Web App/VM/Resource Group in Azure explorer
43+
</li>
3344
</ul>
34-
<h4>Updated</h4>
45+
<h4>Changed</h4>
3546
<ul>
36-
<li>Services are grouped by category in Azure SDK reference book so that user can quickly locate the libs they want.</li>
37-
<li>Error messages are unified.</li>
47+
<li>Enhance toolkit setting panel with more configuration</li>
48+
<li>Enhance resource loading performance in Azure explorer</li>
49+
<li>Support turn off Azure SDK deprecation notification</li>
50+
<li>Support create Azure Spring Cloud app in Azure explorer</li>
51+
<li>Update Azure icons to new style</li>
52+
</ul>
53+
<h4>Fixed</h4>
54+
<ul>
55+
<li>
56+
<a href="https://github.com/microsoft/azure-tools-for-java/issues/5439">#5439</a>
57+
Fix project already disposed excpetion while loading azure sdk reference book meta data
58+
</li>
59+
<li>
60+
<a href="https://github.com/microsoft/azure-tools-for-java/pull/5437">PR#5437</a>
61+
Fix exception while edit json in service principal dialog
62+
</li>
63+
<li>
64+
<a href="https://github.com/microsoft/azure-tools-for-java/pull/5476">PR#5476</a>
65+
Fix url render issue for toolkit notification
66+
</li>
67+
<li>
68+
<a href="https://github.com/microsoft/azure-tools-for-java/pull/5535">PR#5535</a>
69+
Fix evaluate effective pom will break app service/spring cloud deployment
70+
</li>
71+
<li>
72+
<a href="https://github.com/microsoft/azure-tools-for-java/pull/5563">PR#5563</a>
73+
Fix exception: type HTTP is not compatible with address null
74+
</li>
75+
<li>
76+
<a href="https://github.com/microsoft/azure-tools-for-java/pull/5579">PR#5579</a>
77+
Fix reporting error in azure explorer before sign in
78+
</li>
3879
</ul>
3980
<p>You may get the full change log <a href="https://github.com/Microsoft/azure-tools-for-java/blob/develop/CHANGELOG.md">here</a></p>
4081
</html>

PluginsAndFeatures/azure-toolkit-for-intellij/resources/whatsnew/whatsnew.md

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,39 @@
1-
<!-- Version: 3.51.0 -->
1+
<!-- Version: 3.55.0 -->
22
# What's new in Azure Toolkit for IntelliJ
33

4+
## 3.55.0
5+
### Added
6+
- New Azure Resource Connector explorer for connection management
7+
- List all resource connections connected to project
8+
- Create new connections between Azure resources and module in project
9+
- Edit/Delete existing connections
10+
- Navigate to resource properties view of an existing connection
11+
12+
<img src="https://user-images.githubusercontent.com/19339116/127592005-f7c9dd33-40de-4031-bba0-2a96e8e2fbd2.gif" />
13+
- Support native proxy settings in IntelliJ
14+
15+
<img src="https://user-images.githubusercontent.com/12445236/127419581-c3f8b3f6-891e-46e2-bf34-3f69676bd03b.png" />
16+
- Add unified `Open In Portal` support for Web App/VM/Resource Group in Azure explorer
17+
18+
<img src="https://user-images.githubusercontent.com/12445236/127419961-5e918811-96c6-41f7-b438-af97bc959abe.png" />
19+
20+
### Changed
21+
- Enhance toolkit setting panel with more configuration
22+
23+
<img src="https://user-images.githubusercontent.com/12445236/127420059-46bcc63e-525c-413b-9bba-b7e3de93502d.png" />
24+
- Enhance resource loading performance in Azure explorer
25+
- Support turn off Azure SDK deprecation notification
26+
- Support create Azure Spring Cloud app in Azure explorer
27+
- Update Azure icons to new style
28+
29+
### Fixed
30+
- [#5439](https://github.com/microsoft/azure-tools-for-java/issues/5439) Fix project already disposed excpetion while loading azure sdk reference book meta data
31+
- [PR#5437](https://github.com/microsoft/azure-tools-for-java/pull/5437) Fix exception while edit json in service principal dialog
32+
- [PR#5476](https://github.com/microsoft/azure-tools-for-java/pull/5476) Fix url render issue for toolkit notification
33+
- [PR#5535](https://github.com/microsoft/azure-tools-for-java/pull/5535) Fix evaluate effective pom will break app service/spring cloud deployment
34+
- [PR#5563](https://github.com/microsoft/azure-tools-for-java/pull/5563) Fix exception: type HTTP is not compatible with address null
35+
- [PR#5579](https://github.com/microsoft/azure-tools-for-java/pull/5579) Fix reporting error in azure explorer before sign in
36+
437
## 3.54.0
538
### Added
639
- User would be reminded if deprecated Azure SDK libs are used in project.

PluginsAndFeatures/azure-toolkit-for-intellij/src/com/microsoft/azure/toolkit/intellij/arm/action/CreateDeploymentAction.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@
1010
import com.intellij.openapi.wm.StatusBar;
1111
import com.intellij.openapi.wm.WindowManager;
1212
import com.microsoft.azure.toolkit.intellij.arm.CreateDeploymentForm;
13-
import com.microsoft.azuretools.authmanage.AuthMethodManager;
14-
import com.microsoft.intellij.actions.AzureSignInAction;
1513
import com.microsoft.intellij.AzurePlugin;
14+
import com.microsoft.intellij.actions.AzureSignInAction;
1615
import com.microsoft.intellij.ui.util.UIUtils;
1716
import com.microsoft.intellij.util.AzureLoginHelper;
1817
import com.microsoft.tooling.msservices.helpers.Name;
@@ -48,9 +47,7 @@ public AzureActionEnum getAction() {
4847

4948
@Override
5049
protected void actionPerformed(NodeActionEvent nodeActionEvent) {
51-
AzureSignInAction.doSignIn(AuthMethodManager.getInstance(), project).subscribe((isLoggedIn) -> {
52-
this.doActionPerformed(nodeActionEvent, isLoggedIn, project);
53-
});
50+
AzureSignInAction.requireSignedIn(project, () -> this.doActionPerformed(nodeActionEvent, true, project));
5451
}
5552

5653
private void doActionPerformed(NodeActionEvent e, boolean isLoggedIn, Project project) {

PluginsAndFeatures/azure-toolkit-for-intellij/src/com/microsoft/azure/toolkit/intellij/arm/action/UpdateDeploymentAction.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@
1010
import com.intellij.openapi.wm.StatusBar;
1111
import com.intellij.openapi.wm.WindowManager;
1212
import com.microsoft.azure.toolkit.intellij.arm.UpdateDeploymentForm;
13-
import com.microsoft.azuretools.authmanage.AuthMethodManager;
14-
import com.microsoft.intellij.actions.AzureSignInAction;
1513
import com.microsoft.intellij.AzurePlugin;
14+
import com.microsoft.intellij.actions.AzureSignInAction;
1615
import com.microsoft.intellij.ui.util.UIUtils;
1716
import com.microsoft.tooling.msservices.helpers.Name;
1817
import com.microsoft.tooling.msservices.serviceexplorer.NodeActionEvent;
@@ -33,9 +32,7 @@ public UpdateDeploymentAction(DeploymentNode deploymentNode) {
3332
@Override
3433
protected void actionPerformed(NodeActionEvent nodeActionEvent) {
3534
Project project = (Project) deploymentNode.getProject();
36-
AzureSignInAction.doSignIn(AuthMethodManager.getInstance(), project).subscribe((isSuccess) -> {
37-
this.doActionPerformed(nodeActionEvent, isSuccess, project);
38-
});
35+
AzureSignInAction.requireSignedIn(project, () -> this.doActionPerformed(nodeActionEvent, true, project));
3936
}
4037

4138
private void doActionPerformed(NodeActionEvent e, boolean isLoggedIn, Project project) {

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

Lines changed: 15 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,23 @@
1717
import com.microsoft.azure.toolkit.lib.common.operation.AzureOperation;
1818
import com.microsoft.azuretools.azurecommons.helpers.NotNull;
1919
import com.microsoft.azuretools.azurecommons.helpers.Nullable;
20-
import com.microsoft.tooling.msservices.components.DefaultLoader;
2120
import org.apache.commons.lang3.StringUtils;
2221
import rx.Subscription;
2322

2423
import javax.swing.*;
24+
import java.util.ArrayList;
2525
import java.util.List;
2626
import java.util.Objects;
27-
import java.util.function.Predicate;
28-
import java.util.stream.Collectors;
27+
import java.util.Optional;
2928

3029
import static com.microsoft.intellij.ui.messages.AzureBundle.message;
31-
import static com.microsoft.intellij.util.RxJavaUtils.unsubscribeSubscription;
3230

3331
public class AzureArtifactComboBox extends AzureComboBox<AzureArtifact> {
3432
private final Project project;
3533
private final boolean fileArtifactOnly;
3634
private Condition<? super VirtualFile> fileFilter;
3735
private Subscription subscription;
36+
private AzureArtifact cachedArtifact;
3837

3938
public AzureArtifactComboBox(Project project) {
4039
this(project, false);
@@ -50,29 +49,25 @@ public void setFileFilter(final Condition<? super VirtualFile> filter) {
5049
this.fileFilter = filter;
5150
}
5251

53-
public synchronized void refreshItems(AzureArtifact defaultArtifact) {
54-
unsubscribeSubscription(subscription);
55-
this.setLoading(true);
56-
subscription = this.loadItemsAsync()
57-
.subscribe(items -> DefaultLoader.getIdeHelper().invokeLater(() -> {
58-
this.setItems(items);
59-
this.setLoading(false);
60-
this.resetDefaultValue(defaultArtifact);
61-
}), this::handleLoadingError);
52+
public void setArtifact(@Nullable final AzureArtifact azureArtifact) {
53+
final AzureArtifactManager artifactManager = AzureArtifactManager.getInstance(this.project);
54+
this.cachedArtifact = azureArtifact;
55+
Optional.ofNullable(cachedArtifact).filter(artifact -> artifact.getType() == AzureArtifactType.File).ifPresent(this::addItem);
56+
this.setValue(new AzureComboBox.ItemReference<>(artifact -> artifactManager.equalsAzureArtifact(cachedArtifact, artifact)));
6257
}
6358

6459
@NotNull
6560
@Override
6661
@AzureOperation(
67-
name = "common|artifact.list.project",
68-
params = {"this.project.getName()"},
69-
type = AzureOperation.Type.SERVICE
62+
name = "common|artifact.list.project",
63+
params = {"this.project.getName()"},
64+
type = AzureOperation.Type.SERVICE
7065
)
7166
protected List<? extends AzureArtifact> loadItems() throws Exception {
72-
return AzureArtifactManager.getInstance(project).getAllSupportedAzureArtifacts()
73-
.stream()
74-
.filter(azureArtifact -> !fileArtifactOnly || azureArtifact.getType() == AzureArtifactType.File)
75-
.collect(Collectors.toList());
67+
final List<AzureArtifact> collect = fileArtifactOnly ?
68+
new ArrayList<>() : AzureArtifactManager.getInstance(project).getAllSupportedAzureArtifacts();
69+
Optional.ofNullable(cachedArtifact).filter(artifact -> artifact.getType() == AzureArtifactType.File).ifPresent(collect::add);
70+
return collect;
7671
}
7772

7873
@Nullable
@@ -134,22 +129,4 @@ private void addOrSelectExistingVirtualFile(VirtualFile virtualFile) {
134129
this.setSelectedItem(existingArtifact);
135130
}
136131
}
137-
138-
private void resetDefaultValue(final AzureArtifact defaultArtifact) {
139-
if (defaultArtifact == null) {
140-
return;
141-
}
142-
final List<AzureArtifact> artifacts = this.getItems();
143-
final AzureArtifactManager manager = AzureArtifactManager.getInstance(project);
144-
final Predicate<AzureArtifact> predicate = artifact -> manager.equalsAzureArtifact(defaultArtifact, artifact);
145-
final AzureArtifact toSelect = artifacts.stream().filter(predicate).findFirst().orElse(null);
146-
if (toSelect != null) {
147-
this.setSelectedItem(toSelect);
148-
} else if (defaultArtifact.getType() == AzureArtifactType.File) {
149-
this.addItem(defaultArtifact);
150-
this.setSelectedItem(defaultArtifact);
151-
} else {
152-
this.setSelectedItem(null);
153-
}
154-
}
155132
}

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

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,14 @@ public DatabaseResourcePanel(ResourceDefinition definition) {
8484
}
8585

8686
private void init() {
87-
final Dimension lastColumnSize = new Dimension(106, 30);
88-
passwordSaveComboBox.setPreferredSize(lastColumnSize);
89-
passwordSaveComboBox.setMaximumSize(lastColumnSize);
90-
passwordSaveComboBox.setSize(lastColumnSize);
91-
envPrefixTextField.setPreferredSize(lastColumnSize);
92-
envPrefixTextField.setMaximumSize(lastColumnSize);
93-
envPrefixTextField.setSize(lastColumnSize);
87+
final Dimension passwordSaveComboBoxSize = new Dimension(106, passwordSaveComboBox.getPreferredSize().height);
88+
passwordSaveComboBox.setPreferredSize(passwordSaveComboBoxSize);
89+
passwordSaveComboBox.setMaximumSize(passwordSaveComboBoxSize);
90+
passwordSaveComboBox.setSize(passwordSaveComboBoxSize);
91+
final Dimension envPrefixTextFieldSize = new Dimension(106, envPrefixTextField.getPreferredSize().height);
92+
envPrefixTextField.setPreferredSize(envPrefixTextFieldSize);
93+
envPrefixTextField.setMaximumSize(envPrefixTextFieldSize);
94+
envPrefixTextField.setSize(envPrefixTextFieldSize);
9495
testConnectionActionPanel.setVisible(false);
9596
testResultTextPane.setEditable(false);
9697
testConnectionButton.setEnabled(false);
@@ -145,16 +146,21 @@ private String getConnectResultMessage(DatabaseConnectionUtils.ConnectResult res
145146
}
146147

147148
private void onSubscriptionChanged(final ItemEvent e) {
148-
if (e.getStateChange() == ItemEvent.SELECTED || e.getStateChange() == ItemEvent.DESELECTED) {
149+
if (e.getStateChange() == ItemEvent.SELECTED) {
149150
final Subscription subscription = (Subscription) e.getItem();
150151
this.serverComboBox.setSubscription(subscription);
152+
} else if (e.getStateChange() == ItemEvent.DESELECTED) {
153+
this.serverComboBox.setSubscription(null);
151154
}
152155
}
153156

154157
private void onServerChanged(final ItemEvent e) {
155-
if (e.getStateChange() == ItemEvent.SELECTED || e.getStateChange() == ItemEvent.DESELECTED) {
158+
if (e.getStateChange() == ItemEvent.SELECTED) {
156159
this.databaseComboBox.setServer(e.getItem());
157160
this.usernameComboBox.setServer(e.getItem());
161+
} else if (e.getStateChange() == ItemEvent.DESELECTED) {
162+
this.databaseComboBox.setServer(null);
163+
this.usernameComboBox.setServer(null);
158164
}
159165
}
160166

@@ -288,7 +294,8 @@ private void createUIComponents() {
288294
this.serverComboBox.setItemTextFunc((Function<SqlServer, String>) server -> server.entity().getName());
289295
// database
290296
this.databaseComboBox = new DatabaseComboBox<SqlServer, SqlDatabaseEntity>();
291-
this.databaseComboBox.setItemsLoader(() -> Objects.isNull(this.databaseComboBox.getServer()) ?
297+
this.databaseComboBox.setItemsLoader(() -> Objects.isNull(this.databaseComboBox.getServer()) ||
298+
!StringUtils.equals("Ready", ((SqlServer) this.databaseComboBox.getServer()).entity().getState()) ?
292299
Collections.emptyList() : ((SqlServer) this.databaseComboBox.getServer()).databases());
293300
this.databaseComboBox.setItemTextFunc((Function<SqlDatabaseEntity, String>) databaseEntity -> databaseEntity.getName());
294301
// username
@@ -304,7 +311,8 @@ private void createUIComponents() {
304311
this.serverComboBox.setItemTextFunc((Function<MySqlServer, String>) server -> server.entity().getName());
305312
// database
306313
this.databaseComboBox = new DatabaseComboBox<MySqlServer, MySqlDatabaseEntity>();
307-
this.databaseComboBox.setItemsLoader(() -> Objects.isNull(this.databaseComboBox.getServer()) ?
314+
this.databaseComboBox.setItemsLoader(() -> Objects.isNull(this.databaseComboBox.getServer()) ||
315+
!StringUtils.equals("Ready", ((MySqlServer) this.databaseComboBox.getServer()).entity().getState()) ?
308316
Collections.emptyList() : ((MySqlServer) this.databaseComboBox.getServer()).databases());
309317
this.databaseComboBox.setItemTextFunc((Function<MySqlDatabaseEntity, String>) databaseEntity -> databaseEntity.getName());
310318
// username

0 commit comments

Comments
 (0)