Skip to content

Commit b6fed99

Browse files
jdneoadashen
authored andcommitted
fix some UI bug
1 parent 9edb4dc commit b6fed99

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed

PluginsAndFeatures/azure-toolkit-for-intellij/src/com/microsoft/intellij/ui/webapp/deploysetting/WebAppSettingPanel.form

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@
191191
</constraints>
192192
<properties>
193193
<enabled value="true"/>
194-
<text value=""/>
194+
<text value="N/A"/>
195195
<verifyInputWhenFocusTarget value="false"/>
196196
</properties>
197197
</component>
@@ -201,7 +201,7 @@
201201
</constraints>
202202
<properties>
203203
<enabled value="true"/>
204-
<text value=""/>
204+
<text value="N/A"/>
205205
</properties>
206206
</component>
207207
<component id="b3d20" class="javax.swing.JRadioButton" binding="rdoCreateAppServicePlan">

PluginsAndFeatures/azure-toolkit-for-intellij/src/com/microsoft/intellij/ui/webapp/deploysetting/WebAppSettingPanel.java

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ public void customize(JList list, ResourceGroup resourceGroup, int
193193
}
194194
});
195195

196-
cbExistResGrp.addActionListener(e-> {
196+
cbExistResGrp.addActionListener(e -> {
197197
ResourceGroup resGrp = (ResourceGroup) cbExistResGrp.getSelectedItem();
198198
if (resGrp == null) {
199199
return;
@@ -225,6 +225,11 @@ public void customize(JList list, Subscription subscription, int
225225
}
226226
String selectedSid = subscription.subscriptionId();
227227
if (!Comparing.equal(lastSelectedSid, selectedSid)) {
228+
cbExistResGrp.removeAllItems();
229+
cbLocation.removeAllItems();
230+
cbExistAppServicePlan.removeAllItems();
231+
lblLocation.setText(NOT_APPLICABLE);
232+
lblPricing.setText(NOT_APPLICABLE);
228233
webAppDeployViewPresenter.onLoadResourceGroups(selectedSid);
229234
webAppDeployViewPresenter.onLoadLocation(selectedSid);
230235
lastSelectedSid = selectedSid;
@@ -585,6 +590,10 @@ public void actionPerformed(AnActionEvent anActionEvent) {
585590
@Override
586591
public void fillSubscription(List<Subscription> subscriptions) {
587592
cbSubscription.removeAllItems();
593+
if (subscriptions.size() == 0) {
594+
lastSelectedSid = null;
595+
return;
596+
}
588597
for (Subscription subscription: subscriptions) {
589598
cbSubscription.addItem(subscription);
590599
if (Comparing.equal(subscription.subscriptionId(), webAppConfiguration.getSubscriptionId())) {
@@ -596,6 +605,10 @@ public void fillSubscription(List<Subscription> subscriptions) {
596605
@Override
597606
public void fillResourceGroup(List<ResourceGroup> resourceGroups) {
598607
cbExistResGrp.removeAllItems();
608+
if (resourceGroups.size() == 0) {
609+
lastSelectedResGrp = null;
610+
return;
611+
}
599612
resourceGroups.stream()
600613
.sorted(Comparator.comparing(ResourceGroup::name))
601614
.forEach((group) -> {
@@ -609,6 +622,11 @@ public void fillResourceGroup(List<ResourceGroup> resourceGroups) {
609622
@Override
610623
public void fillAppServicePlan(List<AppServicePlan> appServicePlans) {
611624
cbExistAppServicePlan.removeAllItems();
625+
if (appServicePlans.size() == 0) {
626+
lblLocation.setText(NOT_APPLICABLE);
627+
lblPricing.setText(NOT_APPLICABLE);
628+
return;
629+
}
612630
appServicePlans.stream()
613631
.filter(item -> Comparing.equal(item.operatingSystem(), OperatingSystem.WINDOWS))
614632
.sorted(Comparator.comparing(AppServicePlan::name))
@@ -623,6 +641,10 @@ public void fillAppServicePlan(List<AppServicePlan> appServicePlans) {
623641
@Override
624642
public void fillLocation(List<Location> locations) {
625643
cbLocation.removeAllItems();
644+
if (locations.size() == 0) {
645+
lastSelectedLocation = null;
646+
return;
647+
}
626648
locations.stream()
627649
.sorted(Comparator.comparing(Location::displayName))
628650
.forEach((location) -> {

0 commit comments

Comments
 (0)