diff --git a/web/src/admin/admin-settings/AdminSettingsForm.ts b/web/src/admin/admin-settings/AdminSettingsForm.ts index 803e64183..ae9aaffe6 100644 --- a/web/src/admin/admin-settings/AdminSettingsForm.ts +++ b/web/src/admin/admin-settings/AdminSettingsForm.ts @@ -10,8 +10,9 @@ import "@goauthentik/elements/forms/SearchSelect"; import "@goauthentik/elements/utils/TimeDeltaHelp"; import { msg } from "@lit/localize"; -import { TemplateResult, html } from "lit"; +import { CSSResult, TemplateResult, html } from "lit"; import { customElement, property } from "lit/decorators.js"; +import { ifDefined } from "lit/directives/if-defined.js"; import PFList from "@patternfly/patternfly/components/List/list.css"; @@ -45,47 +46,55 @@ export class AdminSettingsForm extends Form { ${msg( "Configure how authentik should show avatars for users. The following values can be set:", )}

-

-

${msg( "Multiple values can be set, comma-separated, and authentik will fallback to the next mode when no avatar could be found.", @@ -125,7 +134,7 @@ export class AdminSettingsForm extends Form { name="eventRetention" label=${msg("Event retention")} required - value="${this._settings?.eventRetention}" + value="${ifDefined(this._settings?.eventRetention)}" .bighelp=${html`

${msg("Duration after which events will be deleted from the database.")}

diff --git a/web/src/admin/admin-settings/AdminSettingsPage.ts b/web/src/admin/admin-settings/AdminSettingsPage.ts index 4f1a81e38..beec8881e 100644 --- a/web/src/admin/admin-settings/AdminSettingsPage.ts +++ b/web/src/admin/admin-settings/AdminSettingsPage.ts @@ -59,7 +59,7 @@ export class AdminSettingsPage extends AKElement { this.loadSettings(); } - async save(): void { + async save(): Promise { const form = this.shadowRoot?.querySelector("ak-admin-settings-form"); if (!form) { return; @@ -74,7 +74,7 @@ export class AdminSettingsPage extends AKElement { return; } this.loadSettings(); - form.settings = this.settings; + form.settings = this.settings!; form.resetForm(); }