Skip to content

Commit

Permalink
chore(bpmn): integrate popup editor
Browse files Browse the repository at this point in the history
closes #3877
  • Loading branch information
marstamm committed Oct 16, 2023
1 parent 7976406 commit b09cb76
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/**
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
* under one or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information regarding copyright
* ownership.
*
* Camunda licenses this file to you under the MIT; you may not use this file
* except in compliance with the MIT License.
*/

export default class FeelPopupKeyboardBindings {
constructor(eventBus) {
this._eventBus = eventBus;

eventBus.on('feelPopup.opened', this._addEventListeners);
eventBus.on('feelPopup.close', this._removeEventListeners);
}

_addEventListeners = (event) => {
const container = event.domNode;

container.addEventListener('focusin', this.handleFocusin);
container.addEventListener('focusout', this.handleFocusout);
};

_removeEventListeners = () => {
const container = this._getContainer();

container.removeEventListener('focusin', this.handleFocusin);
container.removeEventListener('focusout', this.handleFocusout);
};

handleFocusin = () => {
this._eventBus.fire('feelPopup.focusin');
};

handleFocusout = () => {
this._eventBus.fire('feelPopup.focusout');
};

_getContainer() {
return document.querySelector('.bio-properties-panel-feel-popup');
}
}

FeelPopupKeyboardBindings.$inject = [ 'eventBus' ];
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
*/

import PropertiesPanelKeyboardBindings from './PropertiesPanelKeyboardBindings';
import FeelPopupKeyboardBindings from './FeelPopupKeyboardBindings';

export default {
__init__: [ 'propertiesPanelKeyboardBindings' ],
propertiesPanelKeyboardBindings: [ 'type', PropertiesPanelKeyboardBindings ]
__init__: [ 'propertiesPanelKeyboardBindings', 'feelPopupKeyboardBindings' ],
propertiesPanelKeyboardBindings: [ 'type', PropertiesPanelKeyboardBindings ],
feelPopupKeyboardBindings: [ 'type', FeelPopupKeyboardBindings ]
};
7 changes: 6 additions & 1 deletion client/src/app/tabs/cloud-bpmn/BpmnEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,11 @@ export class BpmnEditor extends CachedComponent {
'searchPad.closed',
'searchPad.opened',
'popupMenu.opened',
'popupMenu.closed'
'popupMenu.closed',
'feelPopup.opened',
'feelPopup.closed',
'feelPopup.focusin',
'feelPopup.focusout'
].forEach((event) => {
modeler[fn](event, this.handleChanged);
});
Expand Down Expand Up @@ -838,6 +842,7 @@ export class BpmnEditor extends CachedComponent {
},
propertiesPanel: {
feelTooltipContainer: '.editor',
feelPopupContainer: '.bjs-container',
layout: layout.propertiesPanel
},
elementTemplateChooser: false
Expand Down

0 comments on commit b09cb76

Please sign in to comment.