mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-10 19:43:04 +00:00
filter out move operations where source and target are the same
This commit is contained in:
@@ -372,11 +372,15 @@ export class SectionFormOperationsService {
|
|||||||
pathCombiner.getPath(segmentedPath),
|
pathCombiner.getPath(segmentedPath),
|
||||||
value, true);
|
value, true);
|
||||||
} else {
|
} else {
|
||||||
|
const moveTo = pathCombiner.getPath(path);
|
||||||
|
const moveFrom = pathCombiner.getPath(segmentedPath + '/' + event.$event.previousIndex);
|
||||||
|
if (isNotEmpty(moveFrom.path) && isNotEmpty(moveTo.path) && moveFrom.path !== moveTo.path) {
|
||||||
this.operationsBuilder.move(
|
this.operationsBuilder.move(
|
||||||
pathCombiner.getPath(path),
|
moveTo,
|
||||||
pathCombiner.getPath(segmentedPath + '/' + event.$event.previousIndex).path
|
moveFrom.path
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else if (!value.hasValue()) {
|
} else if (!value.hasValue()) {
|
||||||
// New value is empty, so dispatch a remove operation
|
// New value is empty, so dispatch a remove operation
|
||||||
if (this.getArrayIndexFromEvent(event) === 0) {
|
if (this.getArrayIndexFromEvent(event) === 0) {
|
||||||
|
Reference in New Issue
Block a user