minor fixes. Also fixed the css of the modal to avoid conflicts with the one shown when session expires

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/gcube-ckan-datacatalog@135122 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Costantino Perciante 2016-11-30 15:06:13 +00:00
parent eeb2bb2f8f
commit 3774df4535
4 changed files with 17 additions and 9 deletions

View File

@ -31,6 +31,7 @@ import com.github.gwtbootstrap.client.ui.Modal;
import com.github.gwtbootstrap.client.ui.event.HideEvent;
import com.github.gwtbootstrap.client.ui.event.HideHandler;
import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.Element;
import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.user.client.rpc.AsyncCallback;
@ -88,6 +89,8 @@ public class CkanEventHandlerManager {
modal.setTitle("Publish Product");
modal.addStyleName("insert-metadata-modal-style");
modal.addStyleName("modal-top-custom");
((Element)modal.getElement().getChildNodes().getItem(1)).addClassName("modal-body-custom");
modal.add(new CreateDatasetForm(eventBus));
modal.setCloseVisible(true);
modal.show();

View File

@ -85,7 +85,7 @@ public class ManageProductWidget extends Composite{
private final static List<String> STATUS = Arrays.asList("Confirmed", "Rejected", "Pending");
private final static String STATUS_UPDATE_SUCCESS = "The product was correctly updated. Thanks for your collaboration!";
private final static String STATUS_UPDATE_ERROR = "Sorry, there was a problem while trying to update the status of this product";
protected static final String ERROR_ON_RETRIEVING_BEAN = "It seems there is a problem while contacting the service...";
protected static final String ERROR_ON_RETRIEVING_BEAN = "It seems there was a problem while contacting the service...";
private ManageProductBean bean;
public ManageProductWidget(String productIdentifier) {

View File

@ -120,7 +120,7 @@ public class GCubeCkanDataCatalogPanel extends BaseViewTemplate {
public void onSuccess(Boolean result) {
isManageProductToShow = result;
managementPanel.showManageProductButton(isManageProductToShow);
}
@Override
@ -366,6 +366,7 @@ public class GCubeCkanDataCatalogPanel extends BaseViewTemplate {
// The data sent with postMessage is stored in event.data
String height = null;
String productId = null;
boolean isProductKeyMissing = false;
try{
JSONValue parsedJSON = JSONParser.parseStrict(data);
@ -373,7 +374,10 @@ public class GCubeCkanDataCatalogPanel extends BaseViewTemplate {
GWT.log("Object is " + object);
if(object != null){
height = object.get("height").isString().stringValue();
productId = object.get("product").isString().stringValue();
if(object.containsKey("product"))
productId = object.get("product").isString().stringValue();
else
isProductKeyMissing = true;
}
}catch(Exception e){
GWT.log("Exception is " + e);
@ -383,9 +387,10 @@ public class GCubeCkanDataCatalogPanel extends BaseViewTemplate {
setIFrameHeight(height.toString());
// show or hide the manage product button
latestSelectedProductIdentifier = productId.toString();
managementPanel.enableManageProductButton(productId != null && !productId.isEmpty() && isManageProductToShow);
if(!isProductKeyMissing){
latestSelectedProductIdentifier = productId.toString();
managementPanel.enableManageProductButton(productId != null && !productId.isEmpty() && isManageProductToShow);
}
} else {
// The data hasn't been sent from your site!
// Be careful! Do not use it.

View File

@ -42,12 +42,12 @@ h1 {
margin-left: -600px !important;
}
.modal-body {
height: 550px;
.modal-body-custom {
height: 550px !important;
max-height: none !important;
}
.modal {
.modal-top-custom {
top: 2% !important;
}