bug fixing modal clear

This commit is contained in:
francesco 2020-10-22 18:37:04 +02:00
parent cc6b6705fd
commit 228023129d
4 changed files with 17 additions and 44 deletions

View File

@ -53,6 +53,9 @@
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<dependent-module archiveName="metadata-profile-form-builder-widget-1.0.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/metadata-profile-form-builder-widget/metadata-profile-form-builder-widget">
<dependency-type>uses</dependency-type>
</dependent-module>

View File

@ -120,6 +120,12 @@
<artifactId>geoportal-logic</artifactId>
<version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.gcube.portlets.user</groupId>

View File

@ -209,7 +209,10 @@ public class GeoPortalDataEntryApp implements EntryPoint {
@Override
public void onFailure(Throwable caught) {
modal.clear();
try {
modal.remove(loader);
}catch (Exception e) {
}
Alert alert = new Alert(caught.getMessage());
alert.setType(AlertType.ERROR);
alert.setClose(false);
@ -221,7 +224,10 @@ public class GeoPortalDataEntryApp implements EntryPoint {
@Override
public void onSuccess(CommitReport result) {
modal.clear();
try {
modal.remove(loader);
}catch (Exception e) {
}
Alert alert = new Alert(result.getMsg());
switch (result.getState()) {
case OK:

View File

@ -1,42 +0,0 @@
package org.gcube.portlets.user.geoportaldataentry.shared;
/**
* <p>
* FieldVerifier validates that the name the user enters is valid.
* </p>
* <p>
* This class is in the <code>shared</code> packing because we use it in both
* the client code and on the server. On the client, we verify that the name is
* valid before sending an RPC request so the user doesn't have to wait for a
* network round trip to get feedback. On the server, we verify that the name is
* correct to ensure that the input is correct regardless of where the RPC
* originates.
* </p>
* <p>
* When creating a class that is used on both the client and the server, be sure
* that all code is translatable and does not use native JavaScript. Code that
* is note translatable (such as code that interacts with a database or the file
* system) cannot be compiled into client side JavaScript. Code that uses native
* JavaScript (such as Widgets) cannot be run on the server.
* </p>
*/
public class FieldVerifier {
/**
* Verifies that the specified name is valid for our service.
*
* In this example, we only require that the name is at least four
* characters. In your application, you can use more complex checks to ensure
* that usernames, passwords, email addresses, URLs, and other fields have the
* proper syntax.
*
* @param name the name to validate
* @return true if valid, false if invalid
*/
public static boolean isValidName(String name) {
if (name == null) {
return false;
}
return name.length() > 3;
}
}