web/admin: fix execute button on flow view

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-03-29 22:30:57 +02:00
parent e96d2fa666
commit 3945dc9f3f
2 changed files with 12 additions and 4 deletions

View File

@ -88,7 +88,7 @@ export class FlowListPage extends TablePage<Flow> {
</button>
</ak-forms-delete>
<button
class="pf-c-button pf-m-secondary ak-root-link"
class="pf-c-button pf-m-secondary"
@click=${() => {
new FlowsApi(DEFAULT_CONFIG).flowsInstancesExecute({
slug: item.slug
@ -98,7 +98,7 @@ export class FlowListPage extends TablePage<Flow> {
}}>
${gettext("Execute")}
</button>
<a class="pf-c-button pf-m-secondary ak-root-link" href="${`${DEFAULT_CONFIG.basePath}/flows/instances/${item.slug}/export/`}">
<a class="pf-c-button pf-m-secondary" href="${`${DEFAULT_CONFIG.basePath}/flows/instances/${item.slug}/export/`}">
${gettext("Export")}
</a>`,
];

View File

@ -80,9 +80,17 @@ export class FlowViewPage extends LitElement {
</dt>
<dd class="pf-c-description-list__description">
<div class="pf-c-description-list__text">
<a class="pf-c-button pf-m-secondary ak-root-link" href="${AdminURLManager.flows(`${this.flow.pk}/execute/?next=/%23${window.location.href}`)}">
<button
class="pf-c-button pf-m-secondary"
@click=${() => {
new FlowsApi(DEFAULT_CONFIG).flowsInstancesExecute({
slug: flow.slug
}).then(link => {
window.location.assign(`${link.link}?next=/%23${window.location.href}`);
});
}}>
${gettext("Execute")}
</a>
</button>
</div>
</dd>
</div>