Project

General

Profile

Revision 3f6bdfe5

ID3f6bdfe52a19ed5f291f6a034e8696b456a3e909
Parent 4ddb7672
Child 70729f83

Added by Katja Luther over 2 years ago

ref #7463: don't allow drag and drop to same parent

View differences:

eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/e4/TreeNodeDropAdapterE4.java
155 155
	                    return false;
156 156
	                }
157 157
			    boolean isSameTaxonNode = taxonNode.equals(target);
158
			    boolean isSameParent = taxonNode.getParentUUID().equals(((TaxonNodeDto) target).getUuid());
158 159
			    TaxonNode node = CdmStore.getService(ITaxonNodeService.class).load(taxonNode.getUuid());
159 160
				boolean hasTaxonNodePermission = CdmStore.currentAuthentiationHasPermission(node, UPDATE);
160 161

  
......
162 163
	        			CdmStore.currentAuthentiationHasPermission(node.getTaxon(), UPDATE);CdmStore.currentAuthentiationHasPermission(node.getTaxon(), UPDATE);
163 164
                if (
164 165
			        isSameTaxonNode
166
			        || isSameParent
165 167
			        || !hasTaxonNodePermission
166 168
    	            || !hasTaxonPermission
167 169
    	            ) {
......
215 217

  
216 218
		}
217 219
		//close possible open name editors for the moved taxon nodes
220

  
218 221
		taxonNodes.forEach(nodeDto->EditorUtil.closeObsoleteEditor(nodeDto, partService));
222

  
223
//		TaxonNodeDto unsavedNode = taxonNodes.stream().filter(nodeDto ->
224
//		    !EditorUtil.closeObsoleteEditor(nodeDto, partService)).findAny().orElse(null);
225
//		if (unsavedNode != null){
226
//		    return false;
227
//		}
219 228
		moveNodes(uuids, targetITaxonTreeNode.getUuid(), movingTypeInt);
220 229
        return true;
221 230
	}
......
229 238
                    public void run() {
230 239
                        AbstractUtility.executeMoniteredOperation("Move Taxon to new parent: ",
231 240
                                uuid,
232
                                1000,
241
                                500,
233 242
                                false,
234 243
                                TreeNodeDropAdapterE4.this,
235 244
                                null);

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)