Implemented - DELETE relation" operation allowed only in DRAFT phase
[#25104]
This commit is contained in:
parent
79e0e366f1
commit
4762ad4f35
|
@ -4,13 +4,14 @@
|
||||||
All notable changes to this project will be documented in this file.
|
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).
|
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
## [v3.2.0] - 2022-05-11
|
## [v3.2.0-SNAPSHOT] - 2022-05-11
|
||||||
|
|
||||||
- Implemented the Update facility [#24166]
|
- Implemented the Update facility [#24166]
|
||||||
- Integrated with the geoportal-data-mapper library [#24244]
|
- Integrated with the geoportal-data-mapper library [#24244]
|
||||||
- Integrated the Geoportal Data-Viewer Widget [#25015]
|
- Integrated the Geoportal Data-Viewer Widget [#25015]
|
||||||
- Passed to Geoportal_Resolver service [#25031]
|
- Passed to Geoportal_Resolver service [#25031]
|
||||||
- Provided the "View Document" and "View As JSON" facilities
|
- Provided the "View Document" and "View As JSON" facilities
|
||||||
|
- DELETE relation" operation allowed only in DRAFT phase [#25104]
|
||||||
|
|
||||||
## [v3.1.0] - 2023-03-06
|
## [v3.1.0] - 2023-03-06
|
||||||
|
|
||||||
|
|
2
pom.xml
2
pom.xml
|
@ -14,7 +14,7 @@
|
||||||
<groupId>org.gcube.portlets.user</groupId>
|
<groupId>org.gcube.portlets.user</groupId>
|
||||||
<artifactId>geoportal-data-entry-app</artifactId>
|
<artifactId>geoportal-data-entry-app</artifactId>
|
||||||
<packaging>war</packaging>
|
<packaging>war</packaging>
|
||||||
<version>3.2.0</version>
|
<version>3.2.0-SNAPSHOT</version>
|
||||||
<name>GeoPortal Data Entry App</name>
|
<name>GeoPortal Data Entry App</name>
|
||||||
<description>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</description>
|
<description>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</description>
|
||||||
<scm>
|
<scm>
|
||||||
|
|
|
@ -61,6 +61,12 @@ public class ConstantsGeoPortalDataEntryApp {
|
||||||
+ WORKFLOW_PHASE.DRAFT.name()
|
+ WORKFLOW_PHASE.DRAFT.name()
|
||||||
+ " phase. You need to perform the step 'Reject' or 'UnPublish' to take back the project in "
|
+ " phase. You need to perform the step 'Reject' or 'UnPublish' to take back the project in "
|
||||||
+ WORKFLOW_PHASE.DRAFT.name() + " phase.";
|
+ WORKFLOW_PHASE.DRAFT.name() + " phase.";
|
||||||
|
|
||||||
|
|
||||||
|
public static final String ALERT_MESSAGE_DELETE_RELATION_FORBIDDEN = "The Delete Relation operation can be performed only in "
|
||||||
|
+ WORKFLOW_PHASE.DRAFT.name()
|
||||||
|
+ " phase. You need to perform the step 'Reject' or 'UnPublish' to take back the project in "
|
||||||
|
+ WORKFLOW_PHASE.DRAFT.name() + " phase.";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Enum ACTION_PERFORMED_ON_ITEM.
|
* The Enum ACTION_PERFORMED_ON_ITEM.
|
||||||
|
|
|
@ -4,12 +4,17 @@ import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
|
import org.gcube.application.geoportalcommon.shared.config.OPERATION_ON_ITEM;
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.ResultDocumentDV;
|
import org.gcube.application.geoportalcommon.shared.geoportal.ResultDocumentDV;
|
||||||
|
import org.gcube.application.geoportalcommon.shared.geoportal.WORKFLOW_PHASE;
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.project.RelationshipDV;
|
import org.gcube.application.geoportalcommon.shared.geoportal.project.RelationshipDV;
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.project.TemporalReferenceDV;
|
import org.gcube.application.geoportalcommon.shared.geoportal.project.TemporalReferenceDV;
|
||||||
|
import org.gcube.portlets.user.geoportaldataentry.client.ConstantsGeoPortalDataEntryApp;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.GeoportalDataEntryServiceAsync;
|
import org.gcube.portlets.user.geoportaldataentry.client.GeoportalDataEntryServiceAsync;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.events.CloseCreateRelationGUIEvent;
|
import org.gcube.portlets.user.geoportaldataentry.client.events.CloseCreateRelationGUIEvent;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.events.RelationActionHandlerEvent;
|
import org.gcube.portlets.user.geoportaldataentry.client.events.RelationActionHandlerEvent;
|
||||||
|
import org.gcube.portlets.user.geoportaldataentry.client.resource.Images;
|
||||||
|
import org.gcube.portlets.user.geoportaldataentry.client.ui.ModalWindow;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.ui.report.ReportTemplateToHTML;
|
import org.gcube.portlets.user.geoportaldataentry.client.ui.report.ReportTemplateToHTML;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.HTMLUtil;
|
import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.HTMLUtil;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.LoaderIcon;
|
import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.LoaderIcon;
|
||||||
|
@ -17,6 +22,7 @@ import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.LoaderIcon;
|
||||||
import com.github.gwtbootstrap.client.ui.Button;
|
import com.github.gwtbootstrap.client.ui.Button;
|
||||||
import com.github.gwtbootstrap.client.ui.Label;
|
import com.github.gwtbootstrap.client.ui.Label;
|
||||||
import com.github.gwtbootstrap.client.ui.Modal;
|
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.ButtonType;
|
||||||
import com.github.gwtbootstrap.client.ui.constants.IconSize;
|
import com.github.gwtbootstrap.client.ui.constants.IconSize;
|
||||||
import com.github.gwtbootstrap.client.ui.constants.IconType;
|
import com.github.gwtbootstrap.client.ui.constants.IconType;
|
||||||
|
@ -35,6 +41,7 @@ import com.google.gwt.user.client.ui.FlexTable;
|
||||||
import com.google.gwt.user.client.ui.FlowPanel;
|
import com.google.gwt.user.client.ui.FlowPanel;
|
||||||
import com.google.gwt.user.client.ui.HTML;
|
import com.google.gwt.user.client.ui.HTML;
|
||||||
import com.google.gwt.user.client.ui.HTMLPanel;
|
import com.google.gwt.user.client.ui.HTMLPanel;
|
||||||
|
import com.google.gwt.user.client.ui.Image;
|
||||||
import com.google.gwt.user.client.ui.Widget;
|
import com.google.gwt.user.client.ui.Widget;
|
||||||
|
|
||||||
public class ViewRelationshipPanel extends Composite {
|
public class ViewRelationshipPanel extends Composite {
|
||||||
|
@ -170,7 +177,7 @@ public class ViewRelationshipPanel extends Composite {
|
||||||
Label label = new Label();
|
Label label = new Label();
|
||||||
label.setType(LabelType.INFO);
|
label.setType(LabelType.INFO);
|
||||||
label.setText(relationDV.getRelationshipName());
|
label.setText(relationDV.getRelationshipName());
|
||||||
|
|
||||||
FlowPanel panelContainer = new FlowPanel();
|
FlowPanel panelContainer = new FlowPanel();
|
||||||
Button deleteRelation = new Button("", IconType.TRASH);
|
Button deleteRelation = new Button("", IconType.TRASH);
|
||||||
deleteRelation.setTitle("Delete this relation");
|
deleteRelation.setTitle("Delete this relation");
|
||||||
|
@ -179,9 +186,31 @@ public class ViewRelationshipPanel extends Composite {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(ClickEvent event) {
|
public void onClick(ClickEvent event) {
|
||||||
ResultDocumentDV toProject = mapOfTargetProjectForId.get(relationDV.getTargetUCD());
|
|
||||||
appManagerBus.fireEvent(
|
// #24571
|
||||||
new RelationActionHandlerEvent(project, relationDV.getRelationshipName(), toProject));
|
boolean isNotInDRAFT = false;
|
||||||
|
|
||||||
|
if (fromTheProject.getLifecycleInfo() != null) {
|
||||||
|
String phase = fromTheProject.getLifecycleInfo().getPhase();
|
||||||
|
// IF the project is not in DRAFT, showing an alert and the no Update Mode will
|
||||||
|
// be activated
|
||||||
|
if (phase != null && phase.compareToIgnoreCase(WORKFLOW_PHASE.DRAFT.getLabel()) != 0) {
|
||||||
|
|
||||||
|
String msg = ConstantsGeoPortalDataEntryApp.ALERT_MESSAGE_DELETE_RELATION_FORBIDDEN;
|
||||||
|
ModalWindow modalW = new ModalWindow(new Image(Images.ICONS.accessDenied()),
|
||||||
|
"Forbidden: " + OPERATION_ON_ITEM.DELETE_RELATION, msg, AlertType.WARNING);
|
||||||
|
modalW.show();
|
||||||
|
|
||||||
|
isNotInDRAFT = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//If the project is in DRAFT, going to delete the releation after confirm
|
||||||
|
if(!isNotInDRAFT) {
|
||||||
|
ResultDocumentDV toProject = mapOfTargetProjectForId.get(relationDV.getTargetUCD());
|
||||||
|
appManagerBus.fireEvent(
|
||||||
|
new RelationActionHandlerEvent(project, relationDV.getRelationshipName(), toProject));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue