Updated "Show on Map"

This commit is contained in:
Francesco Mangiacrapa 2023-05-02 15:36:03 +02:00
parent 2f7d93cd8e
commit 612e6a3814
2 changed files with 23 additions and 14 deletions

View File

@ -49,6 +49,8 @@ public class ConstantsGeoPortalDataEntryApp {
public static final String WORKFLOW_ACTION_POST_CREATION_ACTION_ID = "post_creation_action";
public static final DateTimeFormat DATE_TIME_FORMAT = DateTimeFormat.getFormat("dd MMMM yyyy");
public static final String SHOW_ON_MAP_NOT_AVAILABLE_IN_DRAFT = "The 'Show on Map' facility is not available in DRAFT phase";
public static final String ALERT_MESSAGE_PROJECT_NOT_EDITABLE = "A Project can only be updated in "
+ WORKFLOW_PHASE.DRAFT.name()

View File

@ -1441,18 +1441,32 @@ public class GeoPortalDataEntryApp implements EntryPoint {
switch (action) {
case VIEW_ON_MAP: {
final Modal modal = new Modal(true, true);
modal.setTitle("Show on Map the Project...");
modal.setCloseVisible(true);
if (resultDocumentDV.getLifecycleInfo() != null) {
String phase = resultDocumentDV.getLifecycleInfo().getPhase();
// IF the project is not in DRAFT phase, showing an alert and no Update Mode
// will
// be activated
if (phase != null && phase.compareToIgnoreCase(WORKFLOW_PHASE.DRAFT.getLabel()) == 0) {
Alert alert = new Alert(
ConstantsGeoPortalDataEntryApp.SHOW_ON_MAP_NOT_AVAILABLE_IN_DRAFT);
alert.setType(AlertType.WARNING);
alert.setClose(false);
modal.add(alert);
modal.show();
return;
}
}
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",
// "");
GeoportalDataEntryServiceAsync.Util.getInstance().getLinksFor(resultDocumentDV.getId(),
resultDocumentDV.getProfileID(), new AsyncCallback<GeoportalItemReferences>() {
@Override
@ -1576,15 +1590,7 @@ public class GeoPortalDataEntryApp implements EntryPoint {
isNotInDRAFT = true;
}
}
// EditModeRecord emr = new EditModeRecord(appManagerBus, resultDocumentDV);
// modal3.add(emr);
// modal3.show();
//
// if(isPublishedProject) {
// emr.noUpdateMode();
// }
UpdateRecord ur = new UpdateRecord(appManagerBus, resultDocumentDV.getProfileID(),
resultDocumentDV.getId(), width, height);
@ -1630,7 +1636,8 @@ public class GeoPortalDataEntryApp implements EntryPoint {
break;
}
//It is the show document
case SHOW_METADATA: {
GWT.log("VIEW SHOW_METADATA fired");
final Modal modal = new Modal(true, true);