Skip to content

Commit 5faafc0

Browse files
authored
Fix UI issues (#3184)
* Extend the resource template file editor adapt to the width of intellij editor * Format last modified time with the same format of portal
1 parent 3a25f74 commit 5faafc0

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed

PluginsAndFeatures/azure-toolkit-for-intellij/src/com/microsoft/intellij/helpers/arm/DeploymentPropertyView.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import com.microsoft.tooling.msservices.serviceexplorer.azure.arm.deployments.DeploymentNode;
3737
import com.microsoft.tooling.msservices.serviceexplorer.azure.arm.deployments.DeploymentPropertyMvpView;
3838
import com.microsoft.tooling.msservices.serviceexplorer.azure.arm.deployments.DeploymentPropertyViewPresenter;
39+
3940
import java.util.Map;
4041
import javax.swing.BorderFactory;
4142
import javax.swing.JButton;
@@ -48,10 +49,15 @@
4849
import javax.swing.tree.TreeModel;
4950
import org.jdesktop.swingx.JXLabel;
5051
import org.jetbrains.annotations.NotNull;
52+
import org.joda.time.DateTimeZone;
53+
import org.joda.time.format.DateTimeFormat;
54+
import org.joda.time.format.DateTimeFormatter;
5155

5256
public class DeploymentPropertyView extends BaseEditor implements DeploymentPropertyMvpView {
5357

5458
public static final String ID = "com.microsoft.intellij.helpers.arm.DeploymentPropertyView";
59+
public static final String DATETIME_FORMAT = "M/d/yyyy, h:mm:ss a";
60+
public static final DateTimeFormatter DATETIME_FORMATTER = DateTimeFormat.forPattern(DATETIME_FORMAT);
5561
private final DeploymentPropertyViewPresenter<DeploymentPropertyView> deploymentPropertyViewPresenter;
5662
private JPanel contentPane;
5763
private JPanel pnlOverviewHolder;
@@ -108,7 +114,7 @@ public void onLoadProperty(DeploymentNode deploymentNode) {
108114
public void onLoadProperty(DeploymentProperty deploymentProperty) {
109115
final Deployment deployment = deploymentProperty.getDeployment();
110116
deploymenNameLabel.setText(deployment.name());
111-
lastModifiedLabel.setText(deployment.timestamp().toString());
117+
lastModifiedLabel.setText(DATETIME_FORMATTER.print(deployment.timestamp().withZone(DateTimeZone.getDefault())));
112118
statusLabel.setText(deployment.provisioningState());
113119
deploymentModeLabel.setText(deployment.mode().name());
114120
StringBuffer sb = new StringBuffer();

PluginsAndFeatures/azure-toolkit-for-intellij/src/com/microsoft/intellij/helpers/arm/ResourceTemplateView.form

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.microsoft.intellij.helpers.arm.ResourceTemplateView">
3-
<grid id="cbd77" binding="contentPane" layout-manager="GridLayoutManager" row-count="2" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
3+
<grid id="cbd77" binding="contentPane" layout-manager="GridLayoutManager" row-count="2" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
44
<margin top="10" left="10" bottom="10" right="10"/>
55
<constraints>
66
<xy x="48" y="54" width="688" height="670"/>
@@ -13,7 +13,7 @@
1313
<grid id="7a0dd" binding="editorPanel" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
1414
<margin top="0" left="0" bottom="0" right="0"/>
1515
<constraints>
16-
<grid row="0" column="0" row-span="1" col-span="3" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
16+
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
1717
</constraints>
1818
<properties/>
1919
<border type="none"/>
@@ -22,7 +22,7 @@
2222
<grid id="6bda8" layout-manager="GridLayoutManager" row-count="1" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
2323
<margin top="0" left="0" bottom="0" right="0"/>
2424
<constraints>
25-
<grid row="1" column="0" row-span="1" col-span="3" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
25+
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
2626
</constraints>
2727
<properties/>
2828
<border type="none"/>
@@ -35,11 +35,6 @@
3535
<text value="Export Template File"/>
3636
</properties>
3737
</component>
38-
<hspacer id="c9d23">
39-
<constraints>
40-
<grid row="0" column="2" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
41-
</constraints>
42-
</hspacer>
4338
<component id="30960" class="javax.swing.JButton" binding="updateDeploymentButton" default-binding="true">
4439
<constraints>
4540
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
@@ -48,6 +43,11 @@
4843
<text value="Update Deployment"/>
4944
</properties>
5045
</component>
46+
<hspacer id="c9d23">
47+
<constraints>
48+
<grid row="0" column="2" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
49+
</constraints>
50+
</hspacer>
5151
</children>
5252
</grid>
5353
</children>

PluginsAndFeatures/azure-toolkit-for-intellij/src/com/microsoft/intellij/helpers/arm/ResourceTemplateView.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public void loadTemplate(DeploymentNode node, String template) {
7676
final String prettyTemplate = Utils.getPrettyJson(template);
7777
fileEditor = createEditor(prettyTemplate);
7878
GridConstraints constraints = new GridConstraints();
79-
constraints.setFill(GridConstraints.FILL_NONE);
79+
constraints.setFill(GridConstraints.FILL_BOTH);
8080
constraints.setAnchor(GridConstraints.ANCHOR_WEST);
8181
editorPanel.add(fileEditor.getComponent(), constraints);
8282

0 commit comments

Comments
 (0)