Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

Commit

Permalink
Merge pull request #328 from ggalmazor/new_version_notice
Browse files Browse the repository at this point in the history
Small UI improvements to the version note
  • Loading branch information
yanokwa authored Oct 19, 2018
2 parents c19494f + 6b9c6f5 commit 5221a11
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package org.opendatakit.aggregate.client;

import com.google.gwt.dom.client.Style;
import java.util.ArrayList;
import java.util.HashMap;

Expand Down Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public ExportSubTab() {

exportTable = new ExportTable();
add(exportTable);
add(buildVersionNote());
add(buildVersionNote(this));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public FormsSubTab(AggregateUI baseUI) {
// add tables to panels
add(newForm);
add(listOfForms);
add(buildVersionNote());
add(buildVersionNote(this));

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -239,7 +240,7 @@ public PreferencesSubTab() {
Preferences.getSkipMalformedSubmissions(), settingsChange);
add(skipMalformedSubmissions);

add(buildVersionNote());
add(buildVersionNote(this));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public PublishSubTab() {
// add tables to panels
add(navTable);
add(publishTable);
add(buildVersionNote());
add(buildVersionNote(this));
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -78,7 +79,7 @@ public SubmissionAdminSubTab() {
add(navTable);
add(new Label("Incomplete Submissions:"));
add(submissions);
add(buildVersionNote());
add(buildVersionNote(this));
}


Expand Down

0 comments on commit 5221a11

Please sign in to comment.