web/forms: fix forms not resetting state when modal closes (#19562)

* web/forms: fix forms not resetting state when modal closes

Overview:

Forms were not properly resetting their state when closing modals, which caused stale values to persist when reopening forms. This affected all forms with @state() decorated properties.

Testing:

1. Create any item (user, token, application, etc.), close modal
2. Click Create again, form should show default/empty values
3. Edit an item, cancel, click Create - form should be empty
4. Edit an item, cancel, edit same item - should show correct data

Motivation:

Form inputs retained values from previous create/edit operations.

* Fix linter errors, types.

* Add property accessors, types.

---------

Co-authored-by: Teffen Ellis <592134+GirlBossRush@users.noreply.github.com>
This commit is contained in:
Dominic R
2026-01-21 01:15:14 -05:00
committed by GitHub
parent 61ddd761b5
commit 66d6d88ae7
89 changed files with 819 additions and 442 deletions

View File

@@ -28,6 +28,11 @@ import { html, TemplateResult } from "lit";
import { customElement } from "lit/decorators.js";
import { ifDefined } from "lit/directives/if-defined.js";
/**
* Flow Form
*
* @prop {string} instancePk - The primary key of the instance to load.
*/
@customElement("ak-flow-form")
export class FlowForm extends WithCapabilitiesConfig(ModelForm<Flow, string>) {
async loadInstance(pk: string): Promise<Flow> {