From bd880489890399ebd4a638f221b431a7bf861d67 Mon Sep 17 00:00:00 2001 From: "francesco.mangiacrapa" Date: Tue, 13 Dec 2022 14:40:21 +0100 Subject: [PATCH 1/3] #24281 Fixed filtering selection label --- .classpath | 4 +-- .../com.gwtplugins.gdt.eclipse.core.prefs | 2 +- .settings/org.eclipse.wst.common.component | 29 ++++++++++------ CHANGELOG.md | 6 ++++ pom.xml | 2 +- .../client/ui/GeonaMainTabPanel.java | 25 +++++++------- .../ui/projects/ListOfProjectTablePanel.java | 34 ++++++++++++------- 7 files changed, 63 insertions(+), 39 deletions(-) diff --git a/.classpath b/.classpath index 733ce15..e799c8b 100644 --- a/.classpath +++ b/.classpath @@ -1,6 +1,6 @@ - + @@ -31,5 +31,5 @@ - + diff --git a/.settings/com.gwtplugins.gdt.eclipse.core.prefs b/.settings/com.gwtplugins.gdt.eclipse.core.prefs index f1cb019..a909db3 100644 --- a/.settings/com.gwtplugins.gdt.eclipse.core.prefs +++ b/.settings/com.gwtplugins.gdt.eclipse.core.prefs @@ -1,5 +1,5 @@ eclipse.preferences.version=1 jarsExcludedFromWebInfLib= -lastWarOutDir=/home/francescomangiacrapa/git/geoportal-data-entry-app/target/geoportal-data-entry-app-3.0.0 +lastWarOutDir=/home/francescomangiacrapa/git/geoportal-data-entry-app/target/geoportal-data-entry-app-3.0.1-SNAPSHOT warSrcDir=src/main/webapp warSrcDirIsOutput=false diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component index 7917f92..9f12540 100644 --- a/.settings/org.eclipse.wst.common.component +++ b/.settings/org.eclipse.wst.common.component @@ -1,5 +1,5 @@ - + @@ -70,8 +70,10 @@ - - + + + + @@ -143,7 +145,8 @@ - + + @@ -215,7 +218,8 @@ - + + @@ -287,7 +291,8 @@ - + + @@ -311,7 +316,8 @@ - + + @@ -383,7 +389,8 @@ - + + @@ -455,7 +462,8 @@ - + + @@ -527,7 +535,8 @@ - + + diff --git a/CHANGELOG.md b/CHANGELOG.md index 9358e4d..3052277 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [v3.0.1-SNAPSHOT] - 2022-12-13 + +#### Fixes + +- [#24281] Fixed filtering selection label +- [#24049] Fixed "Show on Map" facility vs Chrome browser ## [v3.0.0] - 2022-11-09 diff --git a/pom.xml b/pom.xml index 27494e0..fb36d00 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ org.gcube.portlets.user geoportal-data-entry-app war - 3.0.0 + 3.0.1-SNAPSHOT GeoPortal Data Entry App The GeoPortal Data Entry App is an application to build the web forms for data entries needed to create projects/documents (based on UCD) in the D4Science Geoportal service diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/GeonaMainTabPanel.java b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/GeonaMainTabPanel.java index 4bc1a4a..7d7c58a 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/GeonaMainTabPanel.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/GeonaMainTabPanel.java @@ -22,7 +22,6 @@ import org.gcube.application.geoportalcommon.shared.guipresentation.Header; import org.gcube.portlets.user.geoportaldataentry.client.ConstantsGeoPortalDataEntryApp; import org.gcube.portlets.user.geoportaldataentry.client.GeoPortalClientCaches.CacheSearchingFilterParametersFromConfig; import org.gcube.portlets.user.geoportaldataentry.client.events.CreateNewProjectEvent; -import org.gcube.portlets.user.geoportaldataentry.client.events.GetListOfRecordsEvent; import org.gcube.portlets.user.geoportaldataentry.client.events.OperationOnItemEvent; import org.gcube.portlets.user.geoportaldataentry.client.ui.form.GeonaDataEntryMainForm; import org.gcube.portlets.user.geoportaldataentry.client.ui.projects.ListOfProjectTablePanel; @@ -458,19 +457,21 @@ public class GeonaMainTabPanel extends Composite { if (dataListHandler != null) { - NavLink link = new NavLink(ucd.getName()); - link.addClickHandler(new ClickHandler() { - - @Override - public void onClick(ClickEvent event) { - - appManagerBus.fireEvent(new GetListOfRecordsEvent(false, ucd.getProfileID(), - getCurrentProjectsSearchingFilter(), true)); - } - }); +// NavLink link = new NavLink(ucd.getName()); +// link.addClickHandler(new ClickHandler() { +// +// @Override +// public void onClick(ClickEvent event) { +// +// appManagerBus.fireEvent(new GetListOfRecordsEvent(false, ucd.getProfileID(), +// getCurrentProjectsSearchingFilter(), true)); +// } +// }); ucdProjectTypesForListingDataView.add(ucd); - listOfProjectTablePanel.addProjectType(link); +// listOfProjectTablePanel.addProjectType(link); + + listOfProjectTablePanel.addProjectType(ucd); } diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/projects/ListOfProjectTablePanel.java b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/projects/ListOfProjectTablePanel.java index cd497bc..cfaf806 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/projects/ListOfProjectTablePanel.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/projects/ListOfProjectTablePanel.java @@ -203,15 +203,16 @@ public class ListOfProjectTablePanel extends Composite { alertSearchFor.setText(searchForFields.get(0).getDisplayName()); alertSortBy.setText(toLabelFilter((sortByFields.get(0)), SearchingFilter.ORDER.ASC)); - for (ItemFieldDV record_FIELD : searchForFields) { + for (final ItemFieldDV record_FIELD : searchForFields) { - NavLink nav = new NavLink(record_FIELD.getDisplayName()); - dropdownSearchFor.add(nav); + final NavLink navSearch = new NavLink(record_FIELD.getDisplayName()); + dropdownSearchFor.add(navSearch); - nav.addClickHandler(new ClickHandler() { + navSearch.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { + GWT.log("Search for: "+record_FIELD.getDisplayName()); alertSearchFor.setText(record_FIELD.getDisplayName()); if (searchField.getText().length() >= MIN_LENGHT_SERCHING_STRING) { @@ -318,8 +319,8 @@ public class ListOfProjectTablePanel extends Composite { public void execute() { //noProjectSelectionMessage.setVisible(true); - // SELECTION on the first item - if (ucdProjectTypesForListingDataView.size() > 0) { + // Selecting directly the unique UCD type. + if (ucdProjectTypesForListingDataView.size() == 1) { //noProjectSelectionMessage.setVisible(false); UseCaseDescriptorDV singleUCD = ucdProjectTypesForListingDataView.get(0); alertProjectType.setText(singleUCD.getName()); @@ -449,14 +450,21 @@ public class ListOfProjectTablePanel extends Composite { } - /** - * Adds the project type. - * - * @param link the link - */ - public void addProjectType(NavLink link) { - ddProjectType.add(link); + public void addProjectType(final UseCaseDescriptorDV ucd) { + + NavLink link = new NavLink(ucd.getName()); + link.addClickHandler(new ClickHandler() { + @Override + public void onClick(ClickEvent event) { + alertProjectType.setText(ucd.getName()); + appManagerBus.fireEvent(new GetListOfRecordsEvent(false, ucd.getProfileID(), + builtSearchingFilter(), true)); + } + }); + + ddProjectType.add(link); + } } From 1992d2227ad15278de030c490cdc80b61df695c5 Mon Sep 17 00:00:00 2001 From: "francesco.mangiacrapa" Date: Tue, 13 Dec 2022 14:41:33 +0100 Subject: [PATCH 2/3] only indentation --- .../ui/projects/ListOfProjectTablePanel.java | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/projects/ListOfProjectTablePanel.java b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/projects/ListOfProjectTablePanel.java index cfaf806..f086d53 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/projects/ListOfProjectTablePanel.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/projects/ListOfProjectTablePanel.java @@ -81,7 +81,7 @@ public class ListOfProjectTablePanel extends Composite { @UiField Dropdown ddProjectType; - + @UiField Hero noProjectSelectionMessage; @@ -212,7 +212,7 @@ public class ListOfProjectTablePanel extends Composite { @Override public void onClick(ClickEvent event) { - GWT.log("Search for: "+record_FIELD.getDisplayName()); + GWT.log("Search for: " + record_FIELD.getDisplayName()); alertSearchFor.setText(record_FIELD.getDisplayName()); if (searchField.getText().length() >= MIN_LENGHT_SERCHING_STRING) { @@ -314,22 +314,22 @@ public class ListOfProjectTablePanel extends Composite { this.ucdProjectTypesForListingDataView = ucdProjectTypesForListingDataView; Scheduler.get().scheduleDeferred(new ScheduledCommand() { - + @Override public void execute() { - //noProjectSelectionMessage.setVisible(true); + // noProjectSelectionMessage.setVisible(true); // Selecting directly the unique UCD type. if (ucdProjectTypesForListingDataView.size() == 1) { - //noProjectSelectionMessage.setVisible(false); + // noProjectSelectionMessage.setVisible(false); UseCaseDescriptorDV singleUCD = ucdProjectTypesForListingDataView.get(0); alertProjectType.setText(singleUCD.getName()); // setFilteringParameters(displayFields, sortByFields, searchForFields, // currentSearchingFilter); - appManagerBus.fireEvent( - new GetListOfRecordsEvent(true, singleUCD.getProfileID(), getCurrentSearchingFilter(), true)); + appManagerBus.fireEvent(new GetListOfRecordsEvent(true, singleUCD.getProfileID(), + getCurrentSearchingFilter(), true)); } - + } }); @@ -421,7 +421,7 @@ public class ListOfProjectTablePanel extends Composite { } public void showListOfProjectsView(GeonaRecordsPaginatedView grpw) { - GWT.log("showListOfProjectsView for: "+grpw); + GWT.log("showListOfProjectsView for: " + grpw); this.grpw = grpw; geonaListOfRecordsPanel.clear(); VerticalPanel verticalPanel = new VerticalPanel(); @@ -451,20 +451,20 @@ public class ListOfProjectTablePanel extends Composite { } public void addProjectType(final UseCaseDescriptorDV ucd) { - + NavLink link = new NavLink(ucd.getName()); link.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { alertProjectType.setText(ucd.getName()); - appManagerBus.fireEvent(new GetListOfRecordsEvent(false, ucd.getProfileID(), - builtSearchingFilter(), true)); + appManagerBus + .fireEvent(new GetListOfRecordsEvent(false, ucd.getProfileID(), builtSearchingFilter(), true)); } }); - + ddProjectType.add(link); - + } } From f053195d9238a8805c0e63715102e8650ac18caf Mon Sep 17 00:00:00 2001 From: "francesco.mangiacrapa" Date: Tue, 13 Dec 2022 15:30:47 +0100 Subject: [PATCH 3/3] #24049 Fixed "Show on Map" changing its behaviour --- .../client/GeoPortalDataEntryApp.java | 155 +++++++++++------- .../server/GeoportalDataEntryServiceImpl.java | 2 +- 2 files changed, 99 insertions(+), 58 deletions(-) diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoPortalDataEntryApp.java b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoPortalDataEntryApp.java index d452a39..1ce6b21 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoPortalDataEntryApp.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoPortalDataEntryApp.java @@ -61,7 +61,6 @@ import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.HTMLUtil; import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.HTMLUtil.HTML_TAG; import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.LoaderIcon; import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.ModalConfirm; -import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.NewBrowserWindow; import org.gcube.portlets.user.geoportaldataentry.shared.CommitReport; import org.gcube.portlets.user.geoportaldataentry.shared.GNADataEntryExtendedConfigProfile; import org.gcube.portlets.user.geoportaldataentry.shared.GeoNaFormDataObject; @@ -78,6 +77,7 @@ import com.github.gwtbootstrap.client.ui.Button; import com.github.gwtbootstrap.client.ui.Modal; import com.github.gwtbootstrap.client.ui.constants.AlertType; import com.github.gwtbootstrap.client.ui.constants.ButtonType; +import com.github.gwtbootstrap.client.ui.constants.LabelType; import com.google.gwt.core.client.EntryPoint; import com.google.gwt.core.client.GWT; import com.google.gwt.core.client.Scheduler; @@ -91,6 +91,7 @@ import com.google.gwt.event.logical.shared.ResizeHandler; import com.google.gwt.event.shared.HandlerManager; import com.google.gwt.user.client.Window; import com.google.gwt.user.client.rpc.AsyncCallback; +import com.google.gwt.user.client.ui.Anchor; import com.google.gwt.user.client.ui.HTML; import com.google.gwt.user.client.ui.HorizontalPanel; import com.google.gwt.user.client.ui.Image; @@ -388,10 +389,10 @@ public class GeoPortalDataEntryApp implements EntryPoint { resetUI(); mainTabPanel.setPageHeader(handlerDeclarationDV); - //TODO AVOIDING THE CACHE - //TODO I NEED TO CHECK WHY THE BY USING THE CACHE THE WEB-FORM IS FULL (EQUAL TO PREVIOUS ONE) AND NOT RESET PERFORMED - - + // TODO AVOIDING THE CACHE + // TODO I NEED TO CHECK WHY THE BY USING THE CACHE THE WEB-FORM IS FULL (EQUAL + // TO PREVIOUS ONE) AND NOT RESET PERFORMED + // List cardsPerIT = geoportalCaches.getGcubeProfilePerItemType(handlerDeclarationDV.getItemType()); // if (cardsPerIT != null) { // GWT.log("Profiles/Cards per Item Type are: " + cardsPerIT); @@ -437,12 +438,12 @@ public class GeoPortalDataEntryApp implements EntryPoint { // ordered values Collection gnaCardsModels = treemapOrderedGNAProfiles.values(); GWT.log("TreeMap values: " + gnaCardsModels); - List listGNAFormCardModel = new ArrayList(gnaCardsModels); + List listGNAFormCardModel = new ArrayList( + gnaCardsModels); geoportalCaches.putGcubeProfilePerItemType(handlerDeclarationDV.getItemType(), listGNAFormCardModel); // orderedCards.addAll(new ArrayList(gnaCardsModels)); - buildNewCards(profileID, handlerDeclarationDV.getItemType(), - listGNAFormCardModel); + buildNewCards(profileID, handlerDeclarationDV.getItemType(), listGNAFormCardModel); } } @@ -493,8 +494,8 @@ public class GeoPortalDataEntryApp implements EntryPoint { mainTabPanel.setLoaderVisible("Loading...", true); geoNaMainForm.setVisibleFormActions(true); resetUI(); - //geoNaMainForm.removeTree(treeItemPanel); - + // geoNaMainForm.removeTree(treeItemPanel); + geoNaMainForm.enableButtonSave(true); mainTabPanel.setLoaderVisible("", false); @@ -774,10 +775,10 @@ public class GeoPortalDataEntryApp implements EntryPoint { public void onGetList(GetListOfRecordsEvent getListOfRecordsEvent) { GWT.log("Fired: " + getListOfRecordsEvent); SearchingFilter searchingFilter = getListOfRecordsEvent.getSearchingFilter(); - - - CacheSearchingFilterParametersFromConfig seachingFilterParameters = - geoportalCaches.getFilterParametersForProfileId(getListOfRecordsEvent.getProfileID(), GEOPORTAL_DATA_HANDLER.geoportal_data_list); + + CacheSearchingFilterParametersFromConfig seachingFilterParameters = geoportalCaches + .getFilterParametersForProfileId(getListOfRecordsEvent.getProfileID(), + GEOPORTAL_DATA_HANDLER.geoportal_data_list); // CacheSearchingFilterParametersFromConfig seachingFilterParameters = geoportalCaches // .getFilterParametersForProfileId(getListOfRecordsEvent.getProfileID()); @@ -1195,56 +1196,70 @@ public class GeoPortalDataEntryApp implements EntryPoint { modalContainerPanel.remove(loader); } catch (Exception e) { } - - String stepString = wActionOnItem.getAction().getCallSteps().length==1?"Step":"Steps"; - + + String stepString = wActionOnItem.getAction().getCallSteps().length == 1 + ? "Step" + : "Steps"; + String stepsToString = ""; for (String step : wActionOnItem.getAction().getCallSteps()) { - stepsToString+=step+", "; + stepsToString += step + ", "; } - + Alert alert = new Alert( - stepString +" "+ stepsToString - + "performed correclty!"); + stepString + " " + stepsToString + "performed correclty!"); alert.setType(AlertType.INFO); alert.setClose(false); modal.add(alert); - - GeoportalDataEntryServiceAsync.Util.getInstance().getResultDocumentFoProjectByID(result.getProfileID(), result.getId(), new AsyncCallback() { - @Override - public void onFailure(Throwable caught) { - // TODO Auto-generated method stub - - } + GeoportalDataEntryServiceAsync.Util.getInstance() + .getResultDocumentFoProjectByID(result.getProfileID(), + result.getId(), new AsyncCallback() { - @Override - public void onSuccess(ResultDocumentDV theResultDocument) { - VerticalPanel vp = new VerticalPanel(); - vp.getElement().getStyle().setMarginTop(20, Unit.PX); - vp.add(new Label("Check outcome in the Publication Report")); - Button buttonShowPublicationReport = new Button( - "Show Publication Report"); - buttonShowPublicationReport.setType(ButtonType.INFO); - buttonShowPublicationReport.addClickHandler(new ClickHandler() { + @Override + public void onFailure(Throwable caught) { + // TODO Auto-generated method stub - @Override - public void onClick(ClickEvent event) { - modal.hide(); - appManagerBus.fireEvent(new OperationOnItemEvent( - Arrays.asList(theResultDocument), - OPERATION_ON_ITEM.VIEW_REPORT)); + } - } - }); - buttonShowPublicationReport.getElement().getStyle().setMarginTop(10, Unit.PX); - buttonShowPublicationReport.getElement().getStyle().setMarginBottom(20, Unit.PX); - vp.add(buttonShowPublicationReport); + @Override + public void onSuccess( + ResultDocumentDV theResultDocument) { + VerticalPanel vp = new VerticalPanel(); + vp.getElement().getStyle().setMarginTop(20, + Unit.PX); + vp.add(new Label( + "Check outcome in the Publication Report")); + Button buttonShowPublicationReport = new Button( + "Show Publication Report"); + buttonShowPublicationReport + .setType(ButtonType.INFO); + buttonShowPublicationReport + .addClickHandler(new ClickHandler() { - modal.add(vp); - - } - }); + @Override + public void onClick( + ClickEvent event) { + modal.hide(); + appManagerBus.fireEvent( + new OperationOnItemEvent( + Arrays.asList( + theResultDocument), + OPERATION_ON_ITEM.VIEW_REPORT)); + + } + }); + buttonShowPublicationReport.getElement() + .getStyle().setMarginTop(10, Unit.PX); + buttonShowPublicationReport.getElement() + .getStyle() + .setMarginBottom(20, Unit.PX); + vp.add(buttonShowPublicationReport); + + modal.add(vp); + + } + }); appManagerBus.fireEvent(new GetListOfRecordsEvent(false, resultDocumentDV.getProfileID(), @@ -1398,32 +1413,58 @@ public class GeoPortalDataEntryApp implements EntryPoint { case VIEW_ON_MAP: { final Modal modal = new Modal(true, true); + modal.setTitle("Show on Map the Project..."); modal.setCloseVisible(true); final HorizontalPanel hpGetLink = new HorizontalPanel(); final LoaderIcon lc = new LoaderIcon("Just moment getting link..."); hpGetLink.add(lc); modal.add(hpGetLink); - final NewBrowserWindow newBrowserWindow = NewBrowserWindow.open("", "_blank", ""); + // final NewBrowserWindow newBrowserWindow = NewBrowserWindow.open("", "_blank", + // ""); GeoportalDataEntryServiceAsync.Util.getInstance().getLinksFor(resultDocumentDV.getId(), resultDocumentDV.getProfileID(), new AsyncCallback() { @Override public void onFailure(Throwable caught) { - hpGetLink.clear(); + try { + hpGetLink.setVisible(false); + modal.remove(hpGetLink); + } catch (Exception e) { + // TODO: handle exception + } Alert alert = new Alert(caught.getMessage(), AlertType.ERROR); alert.setClose(false); hpGetLink.add(alert); - newBrowserWindow.close(); + // newBrowserWindow.close(); } @Override public void onSuccess(GeoportalItemReferences result) { + try { + hpGetLink.setVisible(false); + modal.remove(hpGetLink); + } catch (Exception e) { + // TODO: handle exception + } String theURL = result.getRestrictedLink().getShortURL() != null ? result.getRestrictedLink().getShortURL() : result.getRestrictedLink().getCompleteURL(); - newBrowserWindow.setUrl(theURL); - modal.hide(); + // newBrowserWindow.setUrl(theURL); + + Anchor anchor = new Anchor(theURL); + anchor.setHref(theURL); + anchor.setTarget("_blank"); + anchor.setTitle( + "Show on Map the project with id: " + resultDocumentDV.getId()); + com.github.gwtbootstrap.client.ui.Label label = new com.github.gwtbootstrap.client.ui.Label( + "Go to Map by clicking the link"); + label.setType(LabelType.SUCCESS); + + modal.add(label); + modal.add(new HTML("
")); + modal.add(anchor); + } }); diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/server/GeoportalDataEntryServiceImpl.java b/src/main/java/org/gcube/portlets/user/geoportaldataentry/server/GeoportalDataEntryServiceImpl.java index 002a044..7246dfd 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataentry/server/GeoportalDataEntryServiceImpl.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/server/GeoportalDataEntryServiceImpl.java @@ -482,7 +482,7 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen .getGeportalViewerResourceProfile(getThreadLocalRequest()); GeoportalCommon gc = new GeoportalCommon(grViewerProfile); GeoportalItemReferences item = new GeoportalItemReferences(itemId, profileID); - item = gc.getPublicLinksFor(item, false); + item = gc.getPublicLinksFor(item, true); LOG.info("Returning: " + item); return item; }