diff --git a/web/src/admin/property-mappings/BasePropertyMappingForm.ts b/web/src/admin/property-mappings/BasePropertyMappingForm.ts index de2c7c831935..f6dae4334b0f 100644 --- a/web/src/admin/property-mappings/BasePropertyMappingForm.ts +++ b/web/src/admin/property-mappings/BasePropertyMappingForm.ts @@ -8,7 +8,7 @@ import { ifDefined } from "lit/directives/if-defined.js"; interface PropertyMapping { name: string; - expression: string; + expression?: string; } export abstract class BasePropertyMappingForm extends ModelForm< diff --git a/web/src/admin/property-mappings/PropertyMappingNotification.ts b/web/src/admin/property-mappings/PropertyMappingNotification.ts index e6cf2374974c..891555d7173e 100644 --- a/web/src/admin/property-mappings/PropertyMappingNotification.ts +++ b/web/src/admin/property-mappings/PropertyMappingNotification.ts @@ -1,14 +1,14 @@ +import { BasePropertyMappingForm } from "@goauthentik/admin/property-mappings/BasePropertyMappingForm"; import { DEFAULT_CONFIG } from "@goauthentik/common/api/config"; import "@goauthentik/elements/CodeMirror"; import "@goauthentik/elements/forms/HorizontalFormElement"; -import { ModelForm } from "@goauthentik/elements/forms/ModelForm"; import { customElement } from "lit/decorators.js"; import { NotificationWebhookMapping, PropertymappingsApi } from "@goauthentik/api"; @customElement("ak-property-mapping-notification-form") -export class PropertyMappingNotification extends ModelForm { +export class PropertyMappingNotification extends BasePropertyMappingForm { loadInstance(pk: string): Promise { return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsNotificationRetrieve({ pmUuid: pk, diff --git a/web/src/admin/property-mappings/PropertyMappingProviderRACForm.ts b/web/src/admin/property-mappings/PropertyMappingProviderRACForm.ts index baa941c0d8b2..d30d9202f577 100644 --- a/web/src/admin/property-mappings/PropertyMappingProviderRACForm.ts +++ b/web/src/admin/property-mappings/PropertyMappingProviderRACForm.ts @@ -1,10 +1,10 @@ +import { BasePropertyMappingForm } from "@goauthentik/admin/property-mappings/BasePropertyMappingForm"; import { DEFAULT_CONFIG } from "@goauthentik/common/api/config"; import { docLink } from "@goauthentik/common/global"; import "@goauthentik/elements/CodeMirror"; import { CodeMirrorMode } from "@goauthentik/elements/CodeMirror"; import "@goauthentik/elements/forms/FormGroup"; import "@goauthentik/elements/forms/HorizontalFormElement"; -import { ModelForm } from "@goauthentik/elements/forms/ModelForm"; import "@goauthentik/elements/forms/Radio"; import type { RadioOption } from "@goauthentik/elements/forms/Radio"; @@ -33,21 +33,13 @@ export const staticSettingOptions: RadioOption[] = [ ]; @customElement("ak-property-mapping-provider-rac-form") -export class PropertyMappingProviderRACForm extends ModelForm { +export class PropertyMappingProviderRACForm extends BasePropertyMappingForm { loadInstance(pk: string): Promise { return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsProviderRacRetrieve({ pmUuid: pk, }); } - getSuccessMessage(): string { - if (this.instance) { - return msg("Successfully updated mapping."); - } else { - return msg("Successfully created mapping."); - } - } - async send(data: RACPropertyMapping): Promise { if (this.instance) { return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsProviderRacUpdate({ diff --git a/web/src/admin/property-mappings/PropertyMappingSourceLDAPForm.ts b/web/src/admin/property-mappings/PropertyMappingSourceLDAPForm.ts index d078aff893e5..8ca03e9761a5 100644 --- a/web/src/admin/property-mappings/PropertyMappingSourceLDAPForm.ts +++ b/web/src/admin/property-mappings/PropertyMappingSourceLDAPForm.ts @@ -10,7 +10,7 @@ import { LDAPSourcePropertyMapping, PropertymappingsApi } from "@goauthentik/api @customElement("ak-property-mapping-source-ldap-form") export class PropertyMappingSourceLDAPForm extends BasePropertyMappingForm { docLink(): string { - return "/docs/sources/property-mappings/expression?utm_source=authentik"; + return "/docs/sources/property-mappings/expressions?utm_source=authentik"; } loadInstance(pk: string): Promise { diff --git a/web/src/admin/property-mappings/PropertyMappingSourceOAuthForm.ts b/web/src/admin/property-mappings/PropertyMappingSourceOAuthForm.ts index 1523d1c14a42..f1563e2bc19b 100644 --- a/web/src/admin/property-mappings/PropertyMappingSourceOAuthForm.ts +++ b/web/src/admin/property-mappings/PropertyMappingSourceOAuthForm.ts @@ -10,7 +10,7 @@ import { OAuthSourcePropertyMapping, PropertymappingsApi } from "@goauthentik/ap @customElement("ak-property-mapping-source-oauth-form") export class PropertyMappingSourceOAuthForm extends BasePropertyMappingForm { docLink(): string { - return "/docs/sources/property-mappings/expression?utm_source=authentik"; + return "/docs/sources/property-mappings/expressions?utm_source=authentik"; } loadInstance(pk: string): Promise { diff --git a/web/src/admin/property-mappings/PropertyMappingSourcePlexForm.ts b/web/src/admin/property-mappings/PropertyMappingSourcePlexForm.ts index bf4ad2233fc1..663805694cd0 100644 --- a/web/src/admin/property-mappings/PropertyMappingSourcePlexForm.ts +++ b/web/src/admin/property-mappings/PropertyMappingSourcePlexForm.ts @@ -10,7 +10,7 @@ import { PlexSourcePropertyMapping, PropertymappingsApi } from "@goauthentik/api @customElement("ak-property-mapping-source-plex-form") export class PropertyMappingSourcePlexForm extends BasePropertyMappingForm { docLink(): string { - return "/docs/sources/property-mappings/expression?utm_source=authentik"; + return "/docs/sources/property-mappings/expressions?utm_source=authentik"; } loadInstance(pk: string): Promise { diff --git a/web/src/admin/property-mappings/PropertyMappingSourceSAMLForm.ts b/web/src/admin/property-mappings/PropertyMappingSourceSAMLForm.ts index 6a428e680b86..f1f703581a56 100644 --- a/web/src/admin/property-mappings/PropertyMappingSourceSAMLForm.ts +++ b/web/src/admin/property-mappings/PropertyMappingSourceSAMLForm.ts @@ -10,7 +10,7 @@ import { PropertymappingsApi, SAMLSourcePropertyMapping } from "@goauthentik/api @customElement("ak-property-mapping-source-saml-form") export class PropertyMappingSourceSAMLForm extends BasePropertyMappingForm { docLink(): string { - return "/docs/sources/property-mappings/expression?utm_source=authentik"; + return "/docs/sources/property-mappings/expressions?utm_source=authentik"; } loadInstance(pk: string): Promise { diff --git a/web/src/admin/property-mappings/PropertyMappingSourceSCIMForm.ts b/web/src/admin/property-mappings/PropertyMappingSourceSCIMForm.ts index 2b915d6fe775..7ff39cadfcc4 100644 --- a/web/src/admin/property-mappings/PropertyMappingSourceSCIMForm.ts +++ b/web/src/admin/property-mappings/PropertyMappingSourceSCIMForm.ts @@ -10,7 +10,7 @@ import { PropertymappingsApi, SCIMSourcePropertyMapping } from "@goauthentik/api @customElement("ak-property-mapping-source-scim-form") export class PropertyMappingSourceSCIMForm extends BasePropertyMappingForm { docLink(): string { - return "/docs/sources/property-mappings/expression?utm_source=authentik"; + return "/docs/sources/property-mappings/expressions?utm_source=authentik"; } loadInstance(pk: string): Promise { diff --git a/website/sidebars.js b/website/sidebars.js index d4d527db4664..a7c0b98a598c 100644 --- a/website/sidebars.js +++ b/website/sidebars.js @@ -77,13 +77,17 @@ const docsSidebar = { items: [ { type: "category", - label: "Property Mappings", + label: "OAuth2 Provider", link: { type: "doc", - id: "providers/property-mappings/index", + id: "providers/oauth2/index", }, - items: ["providers/property-mappings/expression"], + items: [ + "providers/oauth2/client_credentials", + "providers/oauth2/device_code", + ], }, + "providers/saml/index", { type: "category", label: "Google Workspace Provider", @@ -117,19 +121,6 @@ const docsSidebar = { "providers/entra/add-entra-provider", ], }, - { - type: "category", - label: "OAuth2 Provider", - link: { - type: "doc", - id: "providers/oauth2/index", - }, - items: [ - "providers/oauth2/client_credentials", - "providers/oauth2/device_code", - ], - }, - "providers/saml/index", "providers/radius/index", { type: "category", @@ -167,6 +158,15 @@ const docsSidebar = { }, items: ["providers/rac/how-to-rac"], }, + { + type: "category", + label: "Property Mappings", + link: { + type: "doc", + id: "providers/property-mappings/index", + }, + items: ["providers/property-mappings/expression"], + }, ], }, {