diff --git a/.classpath b/.classpath
index ce272c8..a427a9b 100644
--- a/.classpath
+++ b/.classpath
@@ -1,12 +1,12 @@
-
+
-
+
@@ -27,7 +27,6 @@
-
@@ -35,5 +34,5 @@
-
+
diff --git a/.settings/com.gwtplugins.gdt.eclipse.core.prefs b/.settings/com.gwtplugins.gdt.eclipse.core.prefs
index 3f6f7f3..c875387 100644
--- a/.settings/com.gwtplugins.gdt.eclipse.core.prefs
+++ b/.settings/com.gwtplugins.gdt.eclipse.core.prefs
@@ -1,5 +1,5 @@
eclipse.preferences.version=1
jarsExcludedFromWebInfLib=
-lastWarOutDir=/home/francesco/git/geoportal-data-entry-app/target/geoportal-data-entry-app-1.0.0-SNAPSHOT
+lastWarOutDir=/home/francescomangiacrapa/git/geoportal-data-entry-app/target/geoportal-data-entry-app-1.0.1-SNAPSHOT
warSrcDir=src/main/webapp
warSrcDirIsOutput=false
diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component
index 4ec8b3e..d895209 100644
--- a/.settings/org.eclipse.wst.common.component
+++ b/.settings/org.eclipse.wst.common.component
@@ -77,9 +77,6 @@
-
- uses
-
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c7a2c14..d51a196 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,13 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+## [v1.0.1-SNAPSHOT] - 2020-11-04
+
+#### Bug fixes
+
+[#20063] Fixes for data-entry components
+
+
## [v1.0.0] - 2020-10-07
[#19916] First release
diff --git a/pom.xml b/pom.xml
index 35dd044..447df2e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -14,7 +14,7 @@
org.gcube.portlets.user
geoportal-data-entry-app
war
- 1.0.0
+ 1.0.1-SNAPSHOT
GeoPortal Data Entry App
The GeoPortal Data Entry App is an application to build the web forms for data entries needed to GeoNa project
diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoPortalDataEntryApp.java b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoPortalDataEntryApp.java
index 3d520e9..93aaee5 100644
--- a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoPortalDataEntryApp.java
+++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoPortalDataEntryApp.java
@@ -30,6 +30,7 @@ import com.google.gwt.core.client.GWT;
import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.RootPanel;
/**
@@ -64,7 +65,7 @@ public class GeoPortalDataEntryApp implements EntryPoint {
private LinkedHashMap> savedMap = new LinkedHashMap>();
- //private List orderedListMetadataProfilesForGeona = null;
+ private boolean projectSavedWithSuccess;
/**
* This is the entry point method.
@@ -119,6 +120,7 @@ public class GeoPortalDataEntryApp implements EntryPoint {
}
private void buildNewCards(Collection orderedCards) {
+ projectSavedWithSuccess = false; //resetting state of saving
mainPanel.setLoaderVisible("Loading...", true);
resetUI();
//ordered values
@@ -204,14 +206,20 @@ public class GeoPortalDataEntryApp implements EntryPoint {
final Modal modal = new Modal(true);
modal.setCloseVisible(false);
+ modal.setTitle("Saving project...");
+ modal.hide(false);
+ final HorizontalPanel modalContainerPanel = new HorizontalPanel();
final LoaderIcon loader = new LoaderIcon();
loader.setText("Trying to save the data, please wait...");
- modal.add(loader);
-
+ modalContainerPanel.add(loader);
+ modal.add(modalContainerPanel);
+
GeoportalDataEntryServiceAsync.Util.getInstance().saveGeonaDataForms(saveGeonaDataFormsEvent.getListGeonaDataForms(), new AsyncCallback() {
@Override
public void onFailure(Throwable caught) {
+ modalContainerPanel.clear();
+ modal.setCloseVisible(true);
try {
modal.remove(loader);
}catch (Exception e) {
@@ -220,7 +228,6 @@ public class GeoPortalDataEntryApp implements EntryPoint {
alert.setType(AlertType.ERROR);
alert.setClose(false);
modal.add(alert);
- modal.setCloseVisible(true);
//resetUI();
geoNaMainForm.enableButtonSave(true);
}
@@ -235,6 +242,7 @@ public class GeoPortalDataEntryApp implements EntryPoint {
switch (result.getState()) {
case OK:
alert.setType(AlertType.SUCCESS);
+ projectSavedWithSuccess = true;
purgeFileUploaded();
break;
case WARN:
@@ -250,7 +258,7 @@ public class GeoPortalDataEntryApp implements EntryPoint {
}
alert.setClose(false);
modal.add(alert);
- modal.setCloseVisible(true);
+
try {
savedMap.put(result.getRecordId(), saveGeonaDataFormsEvent.getListGeonaDataForms());
}catch (Exception e) {
@@ -274,17 +282,22 @@ public class GeoPortalDataEntryApp implements EntryPoint {
@Override
public void onCreateNewProject(CreateNewProjectEvent newProjectEvent) {
- //means the form was not submitted
- if(savedMap.size()==0) {
- boolean confirm = Window.confirm("Creating a new project, the current project (is not saved) and will be lost, Confirm?");
- if(confirm)
+ // means the form was not submitted
+ if (savedMap.size() == 0) {
+ boolean confirm = Window.confirm(
+ "Creating a new project, the current project (is not saved) and will be lost, Confirm?");
+ if (confirm)
buildNewCards(orderedCards);
- }else {
+ } else if (projectSavedWithSuccess) {
+ //means the project has been saved
+ buildNewCards(orderedCards);
+ } else {
+ //means the project reported one ore more errors after the submit
boolean confirm = Window.confirm("Creating a new project, the web-forms will be cleaned, Confirm?");
- if(confirm)
+ if (confirm)
buildNewCards(orderedCards);
}
-
+
}
});
}
diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/card/MetadataFormCard.java b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/card/MetadataFormCard.java
index 8a95a87..ca9d64c 100644
--- a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/card/MetadataFormCard.java
+++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/card/MetadataFormCard.java
@@ -205,6 +205,7 @@ public class MetadataFormCard {
if(bool) {
tab.setIcon(IconType.OK_SIGN);
tab.asWidget().getElement().removeClassName("red-text");
+ tab.asWidget().getElement().addClassName("green-text");
}
else {
tab.setIcon(IconType.MINUS_SIGN);