improved behaviour on searching stage

This commit is contained in:
Francesco Mangiacrapa 2022-12-21 11:00:12 +01:00
parent 474832a663
commit c8ad962dfe
4 changed files with 38 additions and 15 deletions

View File

@ -388,6 +388,9 @@ public class GeoportalDataViewer implements EntryPoint {
boolean found = false;
GWT.log("Product with id: " + projectID + " found? " + found);
if (!showDetailsEvent.isEventFromTimeline())
timelineMS.hideTimelineProjectRelations();
GeoportalDataViewerServiceAsync.Util.getInstance().getProjectViewForId(profileID, projectID,
new AsyncCallback<ProjectView>() {
@ -646,7 +649,8 @@ public class GeoportalDataViewer implements EntryPoint {
String layerName = null;
try {
GCubeCollection toOpen = viewerConfig.getAvailableCollections().get(searchPerformedEvent.getProfileID());
GCubeCollection toOpen = viewerConfig.getAvailableCollections()
.get(searchPerformedEvent.getProfileID());
// Check if indexes is empty
if (toOpen.getIndexes() == null || toOpen.getIndexes().isEmpty()) {
GWT.log("SearchPerformedEvent Unexpected empty indexes in collection " + toOpen);

View File

@ -20,6 +20,7 @@ public class ShowDetailsEvent extends GwtEvent<ShowDetailsEventHandler> {
private String profileID;
private String projectID;
private boolean loadTimelineRelationships;
private boolean isEventFromTimeline;
/**
* Instantiates a new show details event.
@ -54,6 +55,24 @@ public class ShowDetailsEvent extends GwtEvent<ShowDetailsEventHandler> {
this.loadTimelineRelationships = loadTimelineRelationships;
}
/**
* Event from timeline.
*
* @param bool the bool
*/
public void setEventFromTimeline(boolean bool) {
this.isEventFromTimeline = bool;
}
/**
* Checks if is event from timeline.
*
* @return true, if is event from timeline
*/
public boolean isEventFromTimeline() {
return isEventFromTimeline;
}
/**
* Gets the type.
*

View File

@ -61,7 +61,6 @@ public class TimelineManagerStatus {
}
public void hideTimelineProjectRelations() {
GWT.log("hideTimelineProjectRelations");
RootPanel.get(GeoportalDataViewer.DIV_TIMELINE_DATA).setVisible(false);

View File

@ -144,7 +144,8 @@ public class TimelineRelationPanel extends Composite {
final String theProjectID = references[1];
GeoportalItemReferences gir = new GeoportalItemReferences(theProjectID, thePofileID);
ShowDetailsEvent showDetailsEvent = new ShowDetailsEvent(gir, null, false);
GWT.log("fireEvetn: " + showDetailsEvent);
showDetailsEvent.setEventFromTimeline(true);
GWT.log("fireEvent: " + showDetailsEvent);
applicationBus.fireEvent(showDetailsEvent);