Don't allow recursive Preview actions #2775 (#2869)

* Don't allow recursive Preview actions #2775

* actionsToBeIncluded and actionsToBeSkipped passed in as options object.

* Revert "actionsToBeIncluded and actionsToBeSkipped passed in as options object."

This reverts commit f501d0b4ba.

* Revert "Don't allow recursive Preview actions #2775"

This reverts commit 5563cbea3a.

* Don't allow recursive Preview actions

Co-authored-by: Andrew Henry <akhenry@gmail.com>
This commit is contained in:
Nikhil 2020-05-01 09:33:10 -07:00 committed by GitHub
parent 3282934cf6
commit 23303c910e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,7 +36,12 @@ export default class PreviewAction {
* Dependencies
*/
this._openmct = openmct;
if (PreviewAction.isVisible === undefined) {
PreviewAction.isVisible = false;
}
}
invoke(objectPath) {
let preview = new Vue({
components: {
@ -59,12 +64,19 @@ export default class PreviewAction {
callback: () => overlay.dismiss()
}
],
onDestroy: () => preview.$destroy()
onDestroy: () => {
PreviewAction.isVisible = false;
preview.$destroy()
}
});
PreviewAction.isVisible = true;
}
appliesTo(objectPath) {
return !this._isNavigatedObject(objectPath) && !this._preventPreview(objectPath);
return !PreviewAction.isVisible && !this._isNavigatedObject(objectPath);
}
_isNavigatedObject(objectPath) {
let targetObject = objectPath[0];
let navigatedObject = this._openmct.router.path[0];