From 7dbe309daba8cd40b083d17ea6836def8861635a Mon Sep 17 00:00:00 2001 From: Guille Date: Wed, 17 Oct 2018 12:14:15 +0200 Subject: [PATCH 1/2] Give the help panel a white background to hide the version note --- .../java/org/opendatakit/aggregate/client/AggregateUI.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/org/opendatakit/aggregate/client/AggregateUI.java b/src/main/java/org/opendatakit/aggregate/client/AggregateUI.java index a99f6df331..90bd1ab129 100644 --- a/src/main/java/org/opendatakit/aggregate/client/AggregateUI.java +++ b/src/main/java/org/opendatakit/aggregate/client/AggregateUI.java @@ -16,6 +16,7 @@ package org.opendatakit.aggregate.client; +import com.google.gwt.dom.client.Style; import java.util.ArrayList; import java.util.HashMap; @@ -172,6 +173,8 @@ private AggregateUI() { helpPanel.add(helpTree); helpPanel.getElement().setId("help_panel"); helpPanel.setVisible(false); + Style style = helpPanel.getElement().getStyle(); + style.setProperty("backgroundColor", "white"); wrappingLayoutPanel.add(helpPanel); From 6b9c6f593032297145ab31fa775b741ea7e1e2a9 Mon Sep 17 00:00:00 2001 From: Guille Date: Wed, 17 Oct 2018 13:34:38 +0200 Subject: [PATCH 2/2] Add padding to UI components that add the version note --- .../org/opendatakit/aggregate/client/ExportSubTab.java | 2 +- .../org/opendatakit/aggregate/client/FiltersDataPanel.java | 2 +- .../java/org/opendatakit/aggregate/client/FormsSubTab.java | 2 +- .../java/org/opendatakit/aggregate/client/LayoutUtils.java | 7 ++++++- .../opendatakit/aggregate/client/PermissionsSubTab.java | 2 +- .../opendatakit/aggregate/client/PreferencesSubTab.java | 3 ++- .../org/opendatakit/aggregate/client/PublishSubTab.java | 2 +- .../aggregate/client/SubmissionAdminSubTab.java | 3 ++- 8 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/main/java/org/opendatakit/aggregate/client/ExportSubTab.java b/src/main/java/org/opendatakit/aggregate/client/ExportSubTab.java index e9a459fa1b..cfe91b2955 100644 --- a/src/main/java/org/opendatakit/aggregate/client/ExportSubTab.java +++ b/src/main/java/org/opendatakit/aggregate/client/ExportSubTab.java @@ -39,7 +39,7 @@ public ExportSubTab() { exportTable = new ExportTable(); add(exportTable); - add(buildVersionNote()); + add(buildVersionNote(this)); } @Override diff --git a/src/main/java/org/opendatakit/aggregate/client/FiltersDataPanel.java b/src/main/java/org/opendatakit/aggregate/client/FiltersDataPanel.java index bc3a5bf236..019a4254e2 100644 --- a/src/main/java/org/opendatakit/aggregate/client/FiltersDataPanel.java +++ b/src/main/java/org/opendatakit/aggregate/client/FiltersDataPanel.java @@ -90,7 +90,7 @@ public FiltersDataPanel(FilterSubTab parentPanel) { filtersTree = new Tree(); panel.add(filtersTree); - panel.add(buildVersionNote()); + panel.add(buildVersionNote(panel)); // create the root as the new filter button addFilter = new AddFilterButton(parentPanel); diff --git a/src/main/java/org/opendatakit/aggregate/client/FormsSubTab.java b/src/main/java/org/opendatakit/aggregate/client/FormsSubTab.java index 18c3e835d5..584e46d9cb 100644 --- a/src/main/java/org/opendatakit/aggregate/client/FormsSubTab.java +++ b/src/main/java/org/opendatakit/aggregate/client/FormsSubTab.java @@ -62,7 +62,7 @@ public FormsSubTab(AggregateUI baseUI) { // add tables to panels add(newForm); add(listOfForms); - add(buildVersionNote()); + add(buildVersionNote(this)); } diff --git a/src/main/java/org/opendatakit/aggregate/client/LayoutUtils.java b/src/main/java/org/opendatakit/aggregate/client/LayoutUtils.java index 2e2aeadba4..ca42084bf7 100644 --- a/src/main/java/org/opendatakit/aggregate/client/LayoutUtils.java +++ b/src/main/java/org/opendatakit/aggregate/client/LayoutUtils.java @@ -4,6 +4,7 @@ import com.google.gwt.dom.client.Style; import com.google.gwt.user.client.ui.HTML; +import com.google.gwt.user.client.ui.UIObject; public class LayoutUtils { private static String latestVersion; @@ -16,7 +17,7 @@ static native String getLatestVersion() /*-{ return JSON.parse(req.responseText).tag_name; }-*/; - static HTML buildVersionNote() { + static HTML buildVersionNote(UIObject parent) { if (latestVersion == null) latestVersion = getLatestVersion(); String shortVersion = VERSION.contains("-") ? VERSION.substring(0, VERSION.indexOf("-")) : VERSION; @@ -30,6 +31,10 @@ static HTML buildVersionNote() { style.setProperty("left", "0"); style.setProperty("padding", "5px 10px"); style.setProperty("backgroundColor", "rgba(255,255,255,.9)"); + + Style parentStyle = parent.getElement().getStyle(); + parentStyle.setProperty("paddingBottom", "40px"); + return html; } } diff --git a/src/main/java/org/opendatakit/aggregate/client/PermissionsSubTab.java b/src/main/java/org/opendatakit/aggregate/client/PermissionsSubTab.java index 966afb6882..fe97ef1277 100644 --- a/src/main/java/org/opendatakit/aggregate/client/PermissionsSubTab.java +++ b/src/main/java/org/opendatakit/aggregate/client/PermissionsSubTab.java @@ -60,7 +60,7 @@ public void update() { if ( accessConfig == null ) { accessConfig = new AccessConfigurationSheet(this); add(accessConfig); - add(buildVersionNote()); + add(buildVersionNote(this)); } accessConfig.setVisible(true); } else { diff --git a/src/main/java/org/opendatakit/aggregate/client/PreferencesSubTab.java b/src/main/java/org/opendatakit/aggregate/client/PreferencesSubTab.java index 487bcc3223..782be9c2cc 100644 --- a/src/main/java/org/opendatakit/aggregate/client/PreferencesSubTab.java +++ b/src/main/java/org/opendatakit/aggregate/client/PreferencesSubTab.java @@ -18,6 +18,7 @@ import static org.opendatakit.aggregate.client.LayoutUtils.buildVersionNote; +import com.google.gwt.dom.client.Style; import org.opendatakit.aggregate.buildconfig.BuildConfig; import org.opendatakit.aggregate.client.preferences.Preferences; import org.opendatakit.aggregate.client.preferences.Preferences.PreferencesCompletionCallback; @@ -239,7 +240,7 @@ public PreferencesSubTab() { Preferences.getSkipMalformedSubmissions(), settingsChange); add(skipMalformedSubmissions); - add(buildVersionNote()); + add(buildVersionNote(this)); } @Override diff --git a/src/main/java/org/opendatakit/aggregate/client/PublishSubTab.java b/src/main/java/org/opendatakit/aggregate/client/PublishSubTab.java index 6263111c2d..a53395087b 100644 --- a/src/main/java/org/opendatakit/aggregate/client/PublishSubTab.java +++ b/src/main/java/org/opendatakit/aggregate/client/PublishSubTab.java @@ -59,7 +59,7 @@ public PublishSubTab() { // add tables to panels add(navTable); add(publishTable); - add(buildVersionNote()); + add(buildVersionNote(this)); } diff --git a/src/main/java/org/opendatakit/aggregate/client/SubmissionAdminSubTab.java b/src/main/java/org/opendatakit/aggregate/client/SubmissionAdminSubTab.java index 1afb7332b8..913a876a3a 100644 --- a/src/main/java/org/opendatakit/aggregate/client/SubmissionAdminSubTab.java +++ b/src/main/java/org/opendatakit/aggregate/client/SubmissionAdminSubTab.java @@ -18,6 +18,7 @@ import static org.opendatakit.aggregate.client.LayoutUtils.buildVersionNote; +import com.google.gwt.dom.client.Style; import com.google.gwt.event.dom.client.ChangeEvent; import com.google.gwt.event.dom.client.ChangeHandler; import com.google.gwt.user.client.rpc.AsyncCallback; @@ -78,7 +79,7 @@ public SubmissionAdminSubTab() { add(navTable); add(new Label("Incomplete Submissions:")); add(submissions); - add(buildVersionNote()); + add(buildVersionNote(this)); }