refs 3483: TDM - improve the quality of the error messages for Rules

Task-Url: https://support.d4science.org/issues/3483

Fixed Apply Rule messages error

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-rule-widget@128127 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2016-04-18 16:18:40 +00:00 committed by Giancarlo Panichi
parent eeb193ae78
commit 9444e41850
7 changed files with 49 additions and 25 deletions

View File

@ -1,4 +1,8 @@
<ReleaseNotes>
<Changeset component="${groupId}.${artifactId}.1-2-0"
date="2016-05-01">
<Change>Fixed share of rules [Ticket #3483]</Change>
</Changeset>
<Changeset component="${groupId}.${artifactId}.1-1-0"
date="2015-10-15">
<Change>Fixed dependencies</Change>

View File

@ -13,7 +13,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.gcube.portlets.user</groupId>
<artifactId>tabular-data-rule-widget</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<name>tabular-data-rule-widget</name>

View File

@ -1,8 +1,11 @@
package org.gcube.portlets.user.td.rulewidget.client;
import org.gcube.portlets.user.td.gwtservice.shared.rule.description.RuleDescriptionData;
import org.gcube.portlets.user.td.gwtservice.shared.user.UserInfo;
import org.gcube.portlets.user.td.rulewidget.client.resources.ResourceBundle;
import org.gcube.portlets.user.td.sharewidget.client.RuleShare;
import org.gcube.portlets.user.td.widgetcommonevent.client.CommonMessages;
import org.gcube.portlets.user.td.wizardwidget.client.util.UtilsGXT3;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.core.shared.GWT;
@ -19,24 +22,27 @@ import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
*/
public class RuleShareDialog extends Window {
private static final String WIDTH = "770px";
private static final String HEIGHT = "530px";
private static final String HEIGHT = "530px";
private EventBus eventBus;
private RuleShareMessages msgs;
private UserInfo userInfo;
private CommonMessages msgsCommon;
public RuleShareDialog(EventBus eventBus) {
public RuleShareDialog(UserInfo userInfo, EventBus eventBus) {
this.eventBus = eventBus;
this.userInfo = userInfo;
initMessages();
initWindow();
RuleSharePanel templateDeletePanel = new RuleSharePanel(this,
eventBus);
RuleSharePanel templateDeletePanel = new RuleSharePanel(this, eventBus);
add(templateDeletePanel);
}
protected void initMessages() {
msgs = GWT.create(RuleShareMessages.class);
msgsCommon = GWT.create(CommonMessages.class);
}
protected void initWindow() {
setWidth(WIDTH);
setHeight(HEIGHT);
@ -70,12 +76,17 @@ public class RuleShareDialog extends Window {
hide();
}
public void ruleShare(RuleDescriptionData ruleDescriptionData) {
Log.debug("Share Window");
@SuppressWarnings("unused")
RuleShare ruleShare = new RuleShare(ruleDescriptionData, eventBus);
close();
if (userInfo.getUsername().compareTo(
ruleDescriptionData.getOwnerLogin()) == 0) {
@SuppressWarnings("unused")
RuleShare ruleShare = new RuleShare(userInfo, ruleDescriptionData, eventBus);
close();
} else {
UtilsGXT3
.info(msgsCommon.attention(), msgs.attentionNotOwnerRule());
}
}

View File

@ -12,38 +12,41 @@ public interface RuleShareMessages extends Messages {
@DefaultMessage("Share Rule")
String dialogRuleShareHead();
@DefaultMessage("Name")
String nameCol();
@DefaultMessage("Description")
String descriptionCol();
@DefaultMessage("Owner")
String ownerCol();
@DefaultMessage("Creation Date")
String creationDateCol();
@DefaultMessage("Scope")
String scopeCol();
@DefaultMessage("Share")
String btnShareText();
@DefaultMessage("Share")
String btnShareToolTip();
@DefaultMessage("Error retrieving rules")
String errorRetrievingRulesHead();
@DefaultMessage("Error retrieving rules!")
String errorRetrievingRules();
@DefaultMessage("Select the rule")
String selectTheRule();
@DefaultMessage("Info")
String infoItemText();
@DefaultMessage("In order to share a rule you must be the owner of the rule. You are not the owner of this rule!")
String attentionNotOwnerRule();
}

View File

@ -9,4 +9,6 @@ btnShareToolTip = Share
errorRetrievingRulesHead = Error retrieving rules
errorRetrievingRules = Error retrieving rules!
selectTheRule = Select the rule
infoItemText = Info
infoItemText = Info
attentionNotOwnerRule = In order to share a rule you must be the owner of the rule. \
You are not the owner of this rule!

View File

@ -9,4 +9,6 @@ btnShareToolTip = Compartir regla
errorRetrievingRulesHead = Error al recuperar las reglas
errorRetrievingRules = Error al recuperar las reglas!
selectTheRule = Seleccione la regla!
infoItemText = Info
infoItemText = Info
attentionNotOwnerRule = Con el fin de compartir una regla que debe ser el propietario de la regla. \
No eres el propietario de esta regla!

View File

@ -10,3 +10,5 @@ errorRetrievingRulesHead = Errore recuperando le regole
errorRetrievingRules = Errore recuperando le regole!
selectTheRule = Seleziona la regola!
infoItemText = Info
attentionNotOwnerRule = Per poter condividere una regola bisogna essere il proprietario. \
Tu non sei il propietario di questa regola!