From 59cb91721c2ab42f97d73ba84295a58415df25d1 Mon Sep 17 00:00:00 2001 From: Beatriz Mendes Date: Mon, 8 May 2023 22:28:52 +0100 Subject: [PATCH] fix(popupMenu): include entry id in `popupMenu.trigger` Related to https://github.com/bpmn-io/bpmn-js-tracking/issues/21 --- lib/features/popup-menu/PopupMenu.js | 2 +- test/spec/features/popup-menu/PopupMenuSpec.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/features/popup-menu/PopupMenu.js b/lib/features/popup-menu/PopupMenu.js index a5bc177d9..e537e7e4a 100644 --- a/lib/features/popup-menu/PopupMenu.js +++ b/lib/features/popup-menu/PopupMenu.js @@ -532,7 +532,7 @@ PopupMenu.prototype.trigger = function(event, entry, action = 'click') { let element = domClosest(event.delegateTarget || event.target, '.entry', true); let entryId = domAttr(element, DATA_REF); - entry = this._getEntry(entryId); + entry = { id: entryId, ...this._getEntry(entryId) }; } const handler = entry.action; diff --git a/test/spec/features/popup-menu/PopupMenuSpec.js b/test/spec/features/popup-menu/PopupMenuSpec.js index e5e1409b9..94c852400 100755 --- a/test/spec/features/popup-menu/PopupMenuSpec.js +++ b/test/spec/features/popup-menu/PopupMenuSpec.js @@ -820,7 +820,7 @@ describe('features/popup-menu', function() { // then expect(triggerSpy).to.have.been.calledOnce; expect(triggerSpy.getCall(0).args[1]).to.eql({ - entry: popupMenu._getEntry('1'), + entry: { ...popupMenu._getEntry('1'), id: '1' }, event }); }));