fixed issue on unshare. changed rename message on root shared folder

This commit is contained in:
Francesco Mangiacrapa 2020-06-29 16:28:13 +02:00
parent 274223ca18
commit af41cc8c4e
3 changed files with 12 additions and 5 deletions

View File

@ -9,6 +9,7 @@ import java.util.Map;
import org.gcube.portlets.user.workspace.client.resources.Resources; import org.gcube.portlets.user.workspace.client.resources.Resources;
import org.gcube.portlets.user.workspace.shared.accounting.GxtAccountingEntryType; import org.gcube.portlets.user.workspace.shared.accounting.GxtAccountingEntryType;
import org.gcube.portlets.user.workspace.shared.accounting.GxtAccountingField; import org.gcube.portlets.user.workspace.shared.accounting.GxtAccountingField;
import org.gcube.portlets.widgets.workspacesharingwidget.shared.InfoContactModel;
import com.extjs.gxt.ui.client.Style.ButtonScale; import com.extjs.gxt.ui.client.Style.ButtonScale;
import com.extjs.gxt.ui.client.Style.HorizontalAlignment; import com.extjs.gxt.ui.client.Style.HorizontalAlignment;
@ -342,7 +343,13 @@ public class AccoutingInfoContainer extends LayoutContainer {
// typeStoreOperation.add(type((gxtAccountingField.getOperation().getId()))); // typeStoreOperation.add(type((gxtAccountingField.getOperation().getId())));
} }
baseModel.set(USER, gxtAccountingField.getUser().getName()); InfoContactModel user = gxtAccountingField.getUser();
if(user!=null)
baseModel.set(USER, user.getName());
else
baseModel.set(USER, "");
baseModel.set(DATE, gxtAccountingField.getDate()); baseModel.set(DATE, gxtAccountingField.getDate());
listModelData.add(baseModel); listModelData.add(baseModel);

View File

@ -1441,7 +1441,7 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
workspaceLogger.error("Renaming item error:", e); workspaceLogger.error("Renaming item error:", e);
StringBuilder error = new StringBuilder(); StringBuilder error = new StringBuilder();
if(sourceItemIsShared) { if(sourceItemIsShared) {
error.append("Ops! This operation is not allowed, we're working hard to make this possible soon."); error.append("Renaming shared folders is not supported");
throw new SHUBOperationNotAllowedException(error.toString()); throw new SHUBOperationNotAllowedException(error.toString());
}else { }else {
error.append("Ops an error occurred renaming the item! Either you have not the permission to rename it or a server error occurred. Please, refresh and try again"); error.append("Ops an error occurred renaming the item! Either you have not the permission to rename it or a server error occurred. Please, refresh and try again");

View File

@ -689,13 +689,13 @@ public class StorageHubToWorkpaceConverter implements Serializable{
//see Task #19544 //see Task #19544
if(shubAccEntry.getUser().equalsIgnoreCase("ALL")) { if(shubAccEntry.getUser().equalsIgnoreCase("ALL")) {
//CASE ALL //CASE ALL
msg+= "is no longer shared"; msg= "The folder is no longer shared with others";
user = new InfoContactModel(theUser, "n.a.", "n.a.", null, false); user = new InfoContactModel(theUser, "n.a.", "n.a.", null, false);
}else { }else {
msg+= "is no longer shared with "+user.getName(); msg+= "is no longer shared with "+user.getName();
user = new InfoContactModel(theUser, "Owner / Admin", "Owner / Admin", null, false); user = new InfoContactModel(theUser, "Owner / Admin", "Owner / Admin", null, false);
} }
af.setUser(user);
af.setDescription(msg); af.setDescription(msg);
} }
break; break;