web/admin: show policy binding form when creating policy in bound list
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
@ -11,9 +11,15 @@ import { customElement } from "lit/decorators.js";
|
||||
*/
|
||||
@customElement("ak-wizard-page-form")
|
||||
export class FormWizardPage extends WizardPage {
|
||||
activePageCallback: (context: FormWizardPage) => Promise<void> = async () => {
|
||||
return Promise.resolve();
|
||||
};
|
||||
|
||||
activeCallback = async () => {
|
||||
this.host.isValid = true;
|
||||
this.activePageCallback(this);
|
||||
};
|
||||
|
||||
nextCallback = async () => {
|
||||
const form = this.querySelector<Form<unknown>>("*");
|
||||
if (!form) {
|
||||
@ -24,7 +30,9 @@ export class FormWizardPage extends WizardPage {
|
||||
return Promise.reject(t`Form didn't return a promise for submitting`);
|
||||
}
|
||||
return formPromise
|
||||
.then(() => {
|
||||
.then((data) => {
|
||||
this.host.state[this.slot] = data;
|
||||
this.host.canBack = false;
|
||||
return true;
|
||||
})
|
||||
.catch(() => {
|
||||
|
@ -22,9 +22,8 @@ export class WizardPage extends AKElement {
|
||||
return this.parentElement as Wizard;
|
||||
}
|
||||
|
||||
activeCallback: () => Promise<void> = () => {
|
||||
activeCallback: () => Promise<void> = async () => {
|
||||
this.host.isValid = false;
|
||||
return Promise.resolve();
|
||||
};
|
||||
|
||||
nextCallback: () => Promise<boolean> = async () => {
|
||||
|
Reference in New Issue
Block a user