From 26e70d82b7c332cfcf66c8b2046455af7a84bd5b Mon Sep 17 00:00:00 2001 From: Nikhil Date: Mon, 3 Jan 2022 17:27:14 -0800 Subject: [PATCH] Move action issue fix #4663 (#4664) --- src/plugins/move/MoveAction.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/plugins/move/MoveAction.js b/src/plugins/move/MoveAction.js index 70d28cc58a..618eff9ef2 100644 --- a/src/plugins/move/MoveAction.js +++ b/src/plugins/move/MoveAction.js @@ -140,11 +140,13 @@ export default class MoveAction { } validate(currentParent) { - return (object, data) => { - const parentCandidate = data.value; + return (data) => { + const parentCandidatePath = data.value; + const parentCandidate = parentCandidatePath[0]; + let currentParentKeystring = this.openmct.objects.makeKeyString(currentParent.identifier); let parentCandidateKeystring = this.openmct.objects.makeKeyString(parentCandidate.identifier); - let objectKeystring = this.openmct.objects.makeKeyString(object.identifier); + let objectKeystring = this.openmct.objects.makeKeyString(this.object.identifier); if (!parentCandidateKeystring || !currentParentKeystring) { return false; @@ -163,7 +165,7 @@ export default class MoveAction { return false; } - return parentCandidate && this.openmct.composition.checkPolicy(parentCandidate, object); + return parentCandidate && this.openmct.composition.checkPolicy(parentCandidate, this.object); }; }