Skip to content

Commit b03e5c4

Browse files
web: fix error handling bug in ui
# What When I converted all of the Provider forms over to a unified structure, the RAC form stood out as one that couldn't be directly converted, so two copies were retained. The error handling was updated to a new format, but this one bit of older handling was missed. For now, we're going back to using `Record<string, string>` for errors, to stay as close to the `./admin/providers/` style of handling. # Testing This error prevented the RAC Provider form from loading in the wizard. Seeing that it works in the wizard should be sufficient.
1 parent 50d2f69 commit b03e5c4

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

web/src/admin/applications/wizard/steps/providers/ApplicationWizardProviderForm.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export class ApplicationWizardProviderForm<T extends OneOfProvider> extends AKEl
2525
wizard!: ApplicationWizardState;
2626

2727
@property({ type: Object, attribute: false })
28-
errors: Map<string | number | symbol, string> = new Map();
28+
errors: Record<string | number | symbol, string> = {};
2929

3030
@query("form#providerform")
3131
form!: HTMLFormElement;
@@ -41,13 +41,13 @@ export class ApplicationWizardProviderForm<T extends OneOfProvider> extends AKEl
4141
}
4242

4343
get valid() {
44-
this.errors = new Map();
44+
this.errors = {};
4545
return this.form.checkValidity();
4646
}
4747

4848
errorMessages(name: string) {
49-
return this.errors.has(name)
50-
? [this.errors.get(name)]
49+
return name in this.errors
50+
? [this.errors[name]]
5151
: (this.wizard.errors?.provider?.[name] ??
5252
this.wizard.errors?.provider?.[camelToSnake(name)] ??
5353
[]);
@@ -56,7 +56,7 @@ export class ApplicationWizardProviderForm<T extends OneOfProvider> extends AKEl
5656
isValid(name: keyof T) {
5757
return !(
5858
(this.wizard.errors?.provider?.[name as string] ?? []).length > 0 ||
59-
this.errors.has(name)
59+
this.errors?.[name] !== undefined
6060
);
6161
}
6262
}

0 commit comments

Comments
 (0)