All Downloads are FREE. Search and download functionalities are using the official Maven repository.

dev-ui.zeebe.components.zeebe-incident-resolve-dialog.js Maven / Gradle / Ivy

import { JsonRpc } from 'jsonrpc';
import { LitElement, html } from 'lit';
import { dialogRenderer, dialogFooterRenderer } from '@vaadin/dialog/lit.js';
import { notifier } from 'notifier';

export class ZeebeIncidentResolveDialog extends LitElement {

    static properties = {
        _opened: { state: true },
        context: {},
        _item: { state: true },
        _retries: { state: true },
        _isJobKey: { state: true },
    }

    connectedCallback() {
        super.connectedCallback();
        this.jsonRpc = new JsonRpc(this.context.extension);
        this._opened = false;
        this._item = null;
        this._retries = 0;
        this._isJobKey = false;
    }

    open(item) {
        this._item = item;
        this._isJobKey = this._item.item.record.value.jobKey > 0;
        this._retries = 1;
        this._opened = true;
    }

    render() {
        return html`
             {this._opened = e.detail.value;}}
                           ${dialogRenderer(() => this._render(), [this._retries, this._isJobKey, this._item])}
                           ${dialogFooterRenderer(this._footer, [this._retries])}
            >
                        
        `;
    }

    _render() {
        return html`
            
                

Make sure you have fixed the error

{this._retries = e.detail.value;}}>
`; } _footer = () => html` Close Resolve `; _close() { this._opened = false } _action() { this.jsonRpc.resolveIncident({key: this._item.item.record.key, jobKey: this._item.item.record.value.jobKey, retries: Number(this._retries)}) .then(response => { console.log(response); this._close(); }) .catch(e => { console.log(e); notifier.showErrorMessage('Resolve incident error: ' + e.error.code + ' detail: ' + e.error.message, null); }); } } customElements.define('zeebe-incident-resolve-dialog', ZeebeIncidentResolveDialog);




© 2015 - 2025 Weber Informatics LLC | Privacy Policy