minor bug fixes

This commit is contained in:
Francesco Mangiacrapa 2021-04-26 17:05:09 +02:00
parent 9b6d715611
commit 56bdb79189
3 changed files with 12 additions and 3 deletions

View File

@ -154,7 +154,7 @@ public class CkanToZendoPublisherWidget {
if(!isValid)
allFormsAreValid = false;
}
if(allFormsAreValid) {
buttonPublish.setEnabled(false);
basicTabPanel.getElement().getStyle().setOpacity(0.5);

View File

@ -176,7 +176,8 @@ public class CreatorsFormView extends Composite implements FormValidator{
if(userRole.compareToIgnoreCase(ZenodoContributor.USER_ROLE)==0) {
author = new ZenodoContributor();
((ZenodoContributor) author).setType(contributorTypeValues);
}
}else
author = new ZenodoCreator();
CreatorView view = new CreatorView(author, userRole, eventBus,false);
listCreatorView.add(view);
@ -206,7 +207,7 @@ public class CreatorsFormView extends Composite implements FormValidator{
*/
public List<? extends ZenodoAuthor> readListOfCreatorsFromView(){
List<ZenodoAuthor> listAuthors = new ArrayList<>(listCreatorView.size());
List<ZenodoAuthor> listAuthors = new ArrayList<>();
for (CreatorView creatorView : listCreatorView) {
ZenodoAuthor author = creatorView.getAuthor();
@ -227,6 +228,7 @@ public class CreatorsFormView extends Composite implements FormValidator{
GWT.log("The fielName is null or empty skpping he/she from list of Authors");
}
GWT.log("returning list of authors: "+listAuthors);
return listAuthors;
}

View File

@ -554,6 +554,9 @@ public class BasicInformationView extends Composite implements FormValidator {
*/
public List<ZenodoCreator> getListOfCreators() {
List<ZenodoCreator> listOfCreators = new ArrayList<>();
if(listOfCreatorsView==null) {
return listOfCreators;
}
for (CreatorsFormView cfv : listOfCreatorsView) {
List<? extends ZenodoAuthor> listOfUsers = cfv.readListOfCreatorsFromView();
for (ZenodoAuthor zenodoAuthor : listOfUsers) {
@ -570,11 +573,15 @@ public class BasicInformationView extends Composite implements FormValidator {
*/
public List<ZenodoContributor> getListOfContributors() {
List<ZenodoContributor> listOfContributors = new ArrayList<>();
if(listOfContributorsView==null) {
return listOfContributors;
}
for (CreatorsFormView cfv : listOfContributorsView) {
List<? extends ZenodoAuthor> listOfUsers = cfv.readListOfCreatorsFromView();
for (ZenodoAuthor zenodoAuthor : listOfUsers) {
listOfContributors.add((ZenodoContributor) zenodoAuthor);
}
}
return listOfContributors;
}