dev-ui.zeebe.zeebe-signals.js Maven / Gradle / Ivy
import { LitElement, html } from 'lit';
import { JsonRpc } from 'jsonrpc';
import {ref, createRef} from 'lit/directives/ref.js';
import { columnBodyRenderer } from '@vaadin/grid/lit.js';
import './components/zeebe-table.js';
export class ZeebeSignals extends LitElement {
static properties = {
_items: {state: true},
navigation: {},
context: {},
};
connectedCallback() {
super.connectedCallback();
this.jsonRpc = new JsonRpc(this.context.extension);
this._fetchData();
this._observer = this.jsonRpc.notifications().onNext(response => {
if (response.result.event === 'SIGNAL') {
if (response.result.type === 'UPDATED') {
this._fetchData();
}
}
});
}
_sendSignalDialogRef = createRef();
disconnectedCallback() {
this._observer.cancel();
super.disconnectedCallback()
}
_fetchData() {
this.jsonRpc.signals()
.then(itemResponse => {
this._items = itemResponse.result.map((item) => ({
...item,
searchTerms: `${item.record.value.signalName}`
}));
});
}
render() {
return html`
this._sendSignalDialogRef.value.open(null, true)}>
Broadcast signal
`;
}
_variablesRenderer(item) {
return html`${JSON.stringify(item.record.value.variables)}`
}
}
customElements.define('zeebe-signals', ZeebeSignals);
© 2015 - 2025 Weber Informatics LLC | Privacy Policy