-
diff --git a/web/src/admin/policies/event_matcher/EventMatcherPolicyForm.ts b/web/src/admin/policies/event_matcher/EventMatcherPolicyForm.ts
index 555f391f4..cb42a789b 100644
--- a/web/src/admin/policies/event_matcher/EventMatcherPolicyForm.ts
+++ b/web/src/admin/policies/event_matcher/EventMatcherPolicyForm.ts
@@ -10,9 +10,15 @@ import { t } from "@lingui/macro";
import { TemplateResult, html } from "lit";
import { customElement } from "lit/decorators.js";
import { ifDefined } from "lit/directives/if-defined.js";
-import { until } from "lit/directives/until.js";
-import { AdminApi, EventMatcherPolicy, EventsApi, PoliciesApi, TypeCreate } from "@goauthentik/api";
+import {
+ AdminApi,
+ App,
+ EventMatcherPolicy,
+ EventsApi,
+ PoliciesApi,
+ TypeCreate,
+} from "@goauthentik/api";
@customElement("ak-policy-event-matcher-form")
export class EventMatcherPolicyForm extends ModelForm {
@@ -22,6 +28,12 @@ export class EventMatcherPolicyForm extends ModelForm {
+ this.apps = await new AdminApi(DEFAULT_CONFIG).adminAppsList();
+ }
+
+ apps?: App[];
+
getSuccessMessage(): string {
if (this.instance) {
return t`Successfully updated policy.`;
@@ -118,19 +130,14 @@ export class EventMatcherPolicyForm extends ModelForm
---------
- ${until(
- new AdminApi(DEFAULT_CONFIG).adminAppsList().then((apps) => {
- return apps.map((app) => {
- return html`
- ${app.label}
- `;
- });
- }),
- html`${t`Loading...`} `,
- )}
+ ${this.apps?.map((app) => {
+ return html`
+ ${app.label}
+ `;
+ })}
${t`Match events created by selected application. When left empty, all applications are matched.`}
diff --git a/web/src/admin/providers/oauth2/OAuth2ProviderForm.ts b/web/src/admin/providers/oauth2/OAuth2ProviderForm.ts
index 9d764f8e5..cf539421e 100644
--- a/web/src/admin/providers/oauth2/OAuth2ProviderForm.ts
+++ b/web/src/admin/providers/oauth2/OAuth2ProviderForm.ts
@@ -11,9 +11,8 @@ import "@goauthentik/elements/utils/TimeDeltaHelp";
import { t } from "@lingui/macro";
import { TemplateResult, html } from "lit";
-import { customElement, property } from "lit/decorators.js";
+import { customElement, state } from "lit/decorators.js";
import { ifDefined } from "lit/directives/if-defined.js";
-import { until } from "lit/directives/until.js";
import {
CertificateKeyPair,
@@ -26,6 +25,8 @@ import {
FlowsInstancesListRequest,
IssuerModeEnum,
OAuth2Provider,
+ PaginatedOAuthSourceList,
+ PaginatedScopeMappingList,
PropertymappingsApi,
ProvidersApi,
SourcesApi,
@@ -34,19 +35,31 @@ import {
@customElement("ak-provider-oauth2-form")
export class OAuth2ProviderFormPage extends ModelForm {
- loadInstance(pk: number): Promise {
- return new ProvidersApi(DEFAULT_CONFIG)
- .providersOauth2Retrieve({
- id: pk,
- })
- .then((provider) => {
- this.showClientSecret = provider.clientType === ClientTypeEnum.Confidential;
- return provider;
- });
+ propertyMappings?: PaginatedScopeMappingList;
+ oauthSources?: PaginatedOAuthSourceList;
+
+ @state()
+ showClientSecret = true;
+
+ async loadInstance(pk: number): Promise {
+ const provider = await new ProvidersApi(DEFAULT_CONFIG).providersOauth2Retrieve({
+ id: pk,
+ });
+ this.showClientSecret = provider.clientType === ClientTypeEnum.Confidential;
+ return provider;
}
- @property({ type: Boolean })
- showClientSecret = true;
+ async load(): Promise {
+ this.propertyMappings = await new PropertymappingsApi(
+ DEFAULT_CONFIG,
+ ).propertymappingsScopeList({
+ ordering: "scope_name",
+ });
+ this.oauthSources = await new SourcesApi(DEFAULT_CONFIG).sourcesOauthList({
+ ordering: "name",
+ hasJwks: true,
+ });
+ }
getSuccessMessage(): string {
if (this.instance) {
@@ -287,36 +300,27 @@ ${this.instance?.redirectUris}
- ${until(
- new PropertymappingsApi(DEFAULT_CONFIG)
- .propertymappingsScopeList({
- ordering: "scope_name",
- })
- .then((scopes) => {
- return scopes.results.map((scope) => {
- let selected = false;
- if (!this.instance?.propertyMappings) {
- selected =
- scope.managed?.startsWith(
- "goauthentik.io/providers/oauth2/scope-",
- ) || false;
- } else {
- selected = Array.from(
- this.instance?.propertyMappings,
- ).some((su) => {
- return su == scope.pk;
- });
- }
- return html`
- ${scope.name}
- `;
- });
- }),
- html`${t`Loading...`} `,
- )}
+ ${this.propertyMappings?.results.map((scope) => {
+ let selected = false;
+ if (!this.instance?.propertyMappings) {
+ selected =
+ scope.managed?.startsWith(
+ "goauthentik.io/providers/oauth2/scope-",
+ ) || false;
+ } else {
+ selected = Array.from(this.instance?.propertyMappings).some(
+ (su) => {
+ return su == scope.pk;
+ },
+ );
+ }
+ return html`
+ ${scope.name}
+ `;
+ })}
${t`Select which scopes can be used by the client. The client still has to specify the scope to access the data.`}
@@ -413,29 +417,14 @@ ${this.instance?.redirectUris}
- ${until(
- new SourcesApi(DEFAULT_CONFIG)
- .sourcesOauthList({
- ordering: "name",
- hasJwks: true,
- })
- .then((sources) => {
- return sources.results.map((source) => {
- const selected = (
- this.instance?.jwksSources || []
- ).some((su) => {
- return su == source.pk;
- });
- return html`
- ${source.name} (${source.slug})
- `;
- });
- }),
- html`${t`Loading...`} `,
- )}
+ ${this.oauthSources?.results.map((source) => {
+ const selected = (this.instance?.jwksSources || []).some((su) => {
+ return su == source.pk;
+ });
+ return html`
+ ${source.name} (${source.slug})
+ `;
+ })}
${t`JWTs signed by certificates configured in the selected sources can be used to authenticate to this provider.`}
diff --git a/web/src/admin/providers/proxy/ProxyProviderForm.ts b/web/src/admin/providers/proxy/ProxyProviderForm.ts
index 3a9155289..dd4ed9461 100644
--- a/web/src/admin/providers/proxy/ProxyProviderForm.ts
+++ b/web/src/admin/providers/proxy/ProxyProviderForm.ts
@@ -13,7 +13,6 @@ import { CSSResult, css } from "lit";
import { TemplateResult, html } from "lit";
import { customElement, state } from "lit/decorators.js";
import { ifDefined } from "lit/directives/if-defined.js";
-import { until } from "lit/directives/until.js";
import PFContent from "@patternfly/patternfly/components/Content/content.css";
import PFList from "@patternfly/patternfly/components/List/list.css";
@@ -28,6 +27,8 @@ import {
FlowsApi,
FlowsInstancesListDesignationEnum,
FlowsInstancesListRequest,
+ PaginatedOAuthSourceList,
+ PaginatedScopeMappingList,
PropertymappingsApi,
ProvidersApi,
ProxyMode,
@@ -51,18 +52,30 @@ export class ProxyProviderFormPage extends ModelForm {
);
}
- loadInstance(pk: number): Promise {
- return new ProvidersApi(DEFAULT_CONFIG)
- .providersProxyRetrieve({
- id: pk,
- })
- .then((provider) => {
- this.showHttpBasic = first(provider.basicAuthEnabled, true);
- this.mode = first(provider.mode, ProxyMode.Proxy);
- return provider;
- });
+ async loadInstance(pk: number): Promise {
+ const provider = await new ProvidersApi(DEFAULT_CONFIG).providersProxyRetrieve({
+ id: pk,
+ });
+ this.showHttpBasic = first(provider.basicAuthEnabled, true);
+ this.mode = first(provider.mode, ProxyMode.Proxy);
+ return provider;
}
+ async load(): Promise {
+ this.propertyMappings = await new PropertymappingsApi(
+ DEFAULT_CONFIG,
+ ).propertymappingsScopeList({
+ ordering: "scope_name",
+ });
+ this.oauthSources = await new SourcesApi(DEFAULT_CONFIG).sourcesOauthList({
+ ordering: "name",
+ hasJwks: true,
+ });
+ }
+
+ propertyMappings?: PaginatedScopeMappingList;
+ oauthSources?: PaginatedOAuthSourceList;
+
@state()
showHttpBasic = true;
@@ -392,34 +405,23 @@ export class ProxyProviderFormPage extends ModelForm {
name="propertyMappings"
>
- ${until(
- new PropertymappingsApi(DEFAULT_CONFIG)
- .propertymappingsScopeList({
- ordering: "scope_name",
- })
- .then((scopes) => {
- return scopes.results
- .filter((scope) => {
- return !scope.managed?.startsWith(
- "goauthentik.io/providers",
- );
- })
- .map((scope) => {
- const selected = (
- this.instance?.propertyMappings || []
- ).some((su) => {
- return su == scope.pk;
- });
- return html`
- ${scope.name}
- `;
- });
- }),
- html`${t`Loading...`} `,
- )}
+ ${this.propertyMappings?.results
+ .filter((scope) => {
+ return !scope.managed?.startsWith("goauthentik.io/providers");
+ })
+ .map((scope) => {
+ const selected = (this.instance?.propertyMappings || []).some(
+ (su) => {
+ return su == scope.pk;
+ },
+ );
+ return html`
+ ${scope.name}
+ `;
+ })}
${t`Additional scope mappings, which are passed to the proxy.`}
@@ -497,29 +499,14 @@ ${this.instance?.skipPathRegex}
- ${until(
- new SourcesApi(DEFAULT_CONFIG)
- .sourcesOauthList({
- ordering: "name",
- hasJwks: true,
- })
- .then((sources) => {
- return sources.results.map((source) => {
- const selected = (
- this.instance?.jwksSources || []
- ).some((su) => {
- return su == source.pk;
- });
- return html`
- ${source.name} (${source.slug})
- `;
- });
- }),
- html`${t`Loading...`} `,
- )}
+ ${this.oauthSources?.results.map((source) => {
+ const selected = (this.instance?.jwksSources || []).some((su) => {
+ return su == source.pk;
+ });
+ return html`
+ ${source.name} (${source.slug})
+ `;
+ })}
${t`JWTs signed by certificates configured in the selected sources can be used to authenticate to this provider.`}
diff --git a/web/src/admin/providers/radius/RadiusProviderForm.ts b/web/src/admin/providers/radius/RadiusProviderForm.ts
index c4ff7e20a..a8566f976 100644
--- a/web/src/admin/providers/radius/RadiusProviderForm.ts
+++ b/web/src/admin/providers/radius/RadiusProviderForm.ts
@@ -9,9 +9,9 @@ import "@goauthentik/elements/forms/SearchSelect";
import { t } from "@lingui/macro";
-import { customElement } from "lit-element";
-import { TemplateResult, html } from "lit-html";
+import { TemplateResult, html } from "lit";
import { ifDefined } from "lit-html/directives/if-defined.js";
+import { customElement } from "lit/decorators.js";
import {
Flow,
diff --git a/web/src/admin/providers/radius/RadiusProviderViewPage.ts b/web/src/admin/providers/radius/RadiusProviderViewPage.ts
index 67184657b..1e6de7747 100644
--- a/web/src/admin/providers/radius/RadiusProviderViewPage.ts
+++ b/web/src/admin/providers/radius/RadiusProviderViewPage.ts
@@ -11,7 +11,8 @@ import "@goauthentik/elements/events/ObjectChangelog";
import { t } from "@lingui/macro";
-import { CSSResult, TemplateResult, customElement, html, property } from "lit-element";
+import { CSSResult, TemplateResult, html } from "lit";
+import { customElement, property } from "lit/decorators.js";
import PFButton from "@patternfly/patternfly/components/Button/button.css";
import PFCard from "@patternfly/patternfly/components/Card/card.css";
diff --git a/web/src/admin/providers/saml/SAMLProviderForm.ts b/web/src/admin/providers/saml/SAMLProviderForm.ts
index e1f3d9c31..181fafe92 100644
--- a/web/src/admin/providers/saml/SAMLProviderForm.ts
+++ b/web/src/admin/providers/saml/SAMLProviderForm.ts
@@ -12,7 +12,6 @@ import { t } from "@lingui/macro";
import { TemplateResult, html } from "lit";
import { customElement } from "lit/decorators.js";
import { ifDefined } from "lit/directives/if-defined.js";
-import { until } from "lit/directives/until.js";
import {
CertificateKeyPair,
@@ -23,6 +22,7 @@ import {
FlowsApi,
FlowsInstancesListDesignationEnum,
FlowsInstancesListRequest,
+ PaginatedSAMLPropertyMappingList,
PropertymappingsApi,
PropertymappingsSamlListRequest,
ProvidersApi,
@@ -40,6 +40,16 @@ export class SAMLProviderFormPage extends ModelForm {
});
}
+ async load(): Promise {
+ this.propertyMappings = await new PropertymappingsApi(
+ DEFAULT_CONFIG,
+ ).propertymappingsSamlList({
+ ordering: "saml_name",
+ });
+ }
+
+ propertyMappings?: PaginatedSAMLPropertyMappingList;
+
getSuccessMessage(): string {
if (this.instance) {
return t`Successfully updated provider.`;
@@ -241,36 +251,27 @@ export class SAMLProviderFormPage extends ModelForm {
name="propertyMappings"
>
- ${until(
- new PropertymappingsApi(DEFAULT_CONFIG)
- .propertymappingsSamlList({
- ordering: "saml_name",
- })
- .then((mappings) => {
- return mappings.results.map((mapping) => {
- let selected = false;
- if (!this.instance?.propertyMappings) {
- selected =
- mapping.managed?.startsWith(
- "goauthentik.io/providers/saml",
- ) || false;
- } else {
- selected = Array.from(
- this.instance?.propertyMappings,
- ).some((su) => {
- return su == mapping.pk;
- });
- }
- return html`
- ${mapping.name}
- `;
- });
- }),
- html`${t`Loading...`} `,
- )}
+ ${this.propertyMappings?.results.map((mapping) => {
+ let selected = false;
+ if (!this.instance?.propertyMappings) {
+ selected =
+ mapping.managed?.startsWith(
+ "goauthentik.io/providers/saml",
+ ) || false;
+ } else {
+ selected = Array.from(this.instance?.propertyMappings).some(
+ (su) => {
+ return su == mapping.pk;
+ },
+ );
+ }
+ return html`
+ ${mapping.name}
+ `;
+ })}
${t`Hold control/command to select multiple items.`}
diff --git a/web/src/admin/providers/scim/SCIMProviderForm.ts b/web/src/admin/providers/scim/SCIMProviderForm.ts
index 867683741..3f7e4b66c 100644
--- a/web/src/admin/providers/scim/SCIMProviderForm.ts
+++ b/web/src/admin/providers/scim/SCIMProviderForm.ts
@@ -11,12 +11,12 @@ import { t } from "@lingui/macro";
import { TemplateResult, html } from "lit";
import { customElement } from "lit/decorators.js";
import { ifDefined } from "lit/directives/if-defined.js";
-import { until } from "lit/directives/until.js";
import {
CoreApi,
CoreGroupsListRequest,
Group,
+ PaginatedSCIMMappingList,
PropertymappingsApi,
ProvidersApi,
SCIMProvider,
@@ -30,6 +30,16 @@ export class SCIMProviderFormPage extends ModelForm {
});
}
+ async load(): Promise {
+ this.propertyMappings = await new PropertymappingsApi(
+ DEFAULT_CONFIG,
+ ).propertymappingsScimList({
+ ordering: "managed",
+ });
+ }
+
+ propertyMappings?: PaginatedSCIMMappingList;
+
getSuccessMessage(): string {
if (this.instance) {
return t`Successfully updated provider.`;
@@ -147,36 +157,26 @@ export class SCIMProviderFormPage extends ModelForm {
name="propertyMappings"
>
- ${until(
- new PropertymappingsApi(DEFAULT_CONFIG)
- .propertymappingsScimList({
- ordering: "managed",
- })
- .then((mappings) => {
- return mappings.results.map((mapping) => {
- let selected = false;
- if (!this.instance?.propertyMappings) {
- selected =
- mapping.managed ===
- "goauthentik.io/providers/scim/user" ||
- false;
- } else {
- selected = Array.from(
- this.instance?.propertyMappings,
- ).some((su) => {
- return su == mapping.pk;
- });
- }
- return html`
- ${mapping.name}
- `;
- });
- }),
- html`${t`Loading...`} `,
- )}
+ ${this.propertyMappings?.results.map((mapping) => {
+ let selected = false;
+ if (!this.instance?.propertyMappings) {
+ selected =
+ mapping.managed === "goauthentik.io/providers/scim/user" ||
+ false;
+ } else {
+ selected = Array.from(this.instance?.propertyMappings).some(
+ (su) => {
+ return su == mapping.pk;
+ },
+ );
+ }
+ return html`
+ ${mapping.name}
+ `;
+ })}
${t`Property mappings used to user mapping.`}
@@ -191,35 +191,25 @@ export class SCIMProviderFormPage extends ModelForm {
name="propertyMappingsGroup"
>
- ${until(
- new PropertymappingsApi(DEFAULT_CONFIG)
- .propertymappingsScimList({
- ordering: "managed",
- })
- .then((mappings) => {
- return mappings.results.map((mapping) => {
- let selected = false;
- if (!this.instance?.propertyMappingsGroup) {
- selected =
- mapping.managed ===
- "goauthentik.io/providers/scim/group";
- } else {
- selected = Array.from(
- this.instance?.propertyMappingsGroup,
- ).some((su) => {
- return su == mapping.pk;
- });
- }
- return html`
- ${mapping.name}
- `;
- });
- }),
- html`${t`Loading...`} `,
- )}
+ ${this.propertyMappings?.results.map((mapping) => {
+ let selected = false;
+ if (!this.instance?.propertyMappingsGroup) {
+ selected =
+ mapping.managed === "goauthentik.io/providers/scim/group";
+ } else {
+ selected = Array.from(
+ this.instance?.propertyMappingsGroup,
+ ).some((su) => {
+ return su == mapping.pk;
+ });
+ }
+ return html`
+ ${mapping.name}
+ `;
+ })}
${t`Property mappings used to group creation.`}
diff --git a/web/src/admin/sources/ldap/LDAPSourceForm.ts b/web/src/admin/sources/ldap/LDAPSourceForm.ts
index bffe60f9b..f8df6fde3 100644
--- a/web/src/admin/sources/ldap/LDAPSourceForm.ts
+++ b/web/src/admin/sources/ldap/LDAPSourceForm.ts
@@ -10,7 +10,6 @@ import { t } from "@lingui/macro";
import { TemplateResult, html } from "lit";
import { customElement } from "lit/decorators.js";
import { ifDefined } from "lit/directives/if-defined.js";
-import { until } from "lit/directives/until.js";
import {
CertificateKeyPair,
@@ -21,6 +20,7 @@ import {
Group,
LDAPSource,
LDAPSourceRequest,
+ PaginatedLDAPPropertyMappingList,
PropertymappingsApi,
SourcesApi,
} from "@goauthentik/api";
@@ -33,6 +33,16 @@ export class LDAPSourceForm extends ModelForm {
});
}
+ async load(): Promise {
+ this.propertyMappings = await new PropertymappingsApi(
+ DEFAULT_CONFIG,
+ ).propertymappingsLdapList({
+ ordering: "managed,object_field",
+ });
+ }
+
+ propertyMappings?: PaginatedLDAPPropertyMappingList;
+
getSuccessMessage(): string {
if (this.instance) {
return t`Successfully updated source.`;
@@ -241,40 +251,31 @@ export class LDAPSourceForm extends ModelForm {
name="propertyMappings"
>
- ${until(
- new PropertymappingsApi(DEFAULT_CONFIG)
- .propertymappingsLdapList({
- ordering: "managed,object_field",
- })
- .then((mappings) => {
- return mappings.results.map((mapping) => {
- let selected = false;
- if (!this.instance?.propertyMappings) {
- selected =
- mapping.managed?.startsWith(
- "goauthentik.io/sources/ldap/default",
- ) ||
- mapping.managed?.startsWith(
- "goauthentik.io/sources/ldap/ms",
- ) ||
- false;
- } else {
- selected = Array.from(
- this.instance?.propertyMappings,
- ).some((su) => {
- return su == mapping.pk;
- });
- }
- return html`
- ${mapping.name}
- `;
- });
- }),
- html`${t`Loading...`} `,
- )}
+ ${this.propertyMappings?.results.map((mapping) => {
+ let selected = false;
+ if (!this.instance?.propertyMappings) {
+ selected =
+ mapping.managed?.startsWith(
+ "goauthentik.io/sources/ldap/default",
+ ) ||
+ mapping.managed?.startsWith(
+ "goauthentik.io/sources/ldap/ms",
+ ) ||
+ false;
+ } else {
+ selected = Array.from(this.instance?.propertyMappings).some(
+ (su) => {
+ return su == mapping.pk;
+ },
+ );
+ }
+ return html`
+ ${mapping.name}
+ `;
+ })}
${t`Property mappings used to user creation.`}
@@ -289,35 +290,26 @@ export class LDAPSourceForm extends ModelForm {
name="propertyMappingsGroup"
>
- ${until(
- new PropertymappingsApi(DEFAULT_CONFIG)
- .propertymappingsLdapList({
- ordering: "managed,object_field",
- })
- .then((mappings) => {
- return mappings.results.map((mapping) => {
- let selected = false;
- if (!this.instance?.propertyMappingsGroup) {
- selected =
- mapping.managed ===
- "goauthentik.io/sources/ldap/default-name";
- } else {
- selected = Array.from(
- this.instance?.propertyMappingsGroup,
- ).some((su) => {
- return su == mapping.pk;
- });
- }
- return html`
- ${mapping.name}
- `;
- });
- }),
- html`${t`Loading...`} `,
- )}
+ ${this.propertyMappings?.results.map((mapping) => {
+ let selected = false;
+ if (!this.instance?.propertyMappingsGroup) {
+ selected =
+ mapping.managed ===
+ "goauthentik.io/sources/ldap/default-name";
+ } else {
+ selected = Array.from(
+ this.instance?.propertyMappingsGroup,
+ ).some((su) => {
+ return su == mapping.pk;
+ });
+ }
+ return html`
+ ${mapping.name}
+ `;
+ })}
${t`Property mappings used to group creation.`}
diff --git a/web/src/admin/sources/oauth/OAuthSourceForm.ts b/web/src/admin/sources/oauth/OAuthSourceForm.ts
index 6084086f8..ac4fb496a 100644
--- a/web/src/admin/sources/oauth/OAuthSourceForm.ts
+++ b/web/src/admin/sources/oauth/OAuthSourceForm.ts
@@ -2,6 +2,7 @@ import { RenderFlowOption } from "@goauthentik/admin/flows/utils";
import { UserMatchingModeToLabel } from "@goauthentik/admin/sources/oauth/utils";
import { DEFAULT_CONFIG, config } from "@goauthentik/common/api/config";
import { first } from "@goauthentik/common/utils";
+import { rootInterface } from "@goauthentik/elements/Base";
import "@goauthentik/elements/CodeMirror";
import "@goauthentik/elements/forms/FormGroup";
import "@goauthentik/elements/forms/HorizontalFormElement";
@@ -13,7 +14,6 @@ import { t } from "@lingui/macro";
import { TemplateResult, html } from "lit";
import { customElement, property, state } from "lit/decorators.js";
import { ifDefined } from "lit/directives/if-defined.js";
-import { until } from "lit/directives/until.js";
import {
CapabilitiesEnum,
@@ -315,63 +315,52 @@ export class OAuthSourceForm extends ModelForm {
${t`Path template for users created. Use placeholders like \`%(slug)s\` to insert the source slug.`}
- ${until(
- config().then((c) => {
- if (c.capabilities.includes(CapabilitiesEnum.SaveMedia)) {
- return html`
-
- ${this.instance?.icon
- ? html`
-
- ${t`Currently set to:`} ${this.instance?.icon}
-
- `
- : html``}
-
- ${this.instance?.icon
- ? html`
-
-
- {
- const target = ev.target as HTMLInputElement;
- this.clearIcon = target.checked;
- }}
- />
-
-
-
-
-
-
- ${t`Clear icon`}
-
-
-
-
- ${t`Delete currently set icon.`}
-
-
- `
- : html``}`;
- }
- return html`
-
-
- ${t`Either input a full URL, a relative path, or use 'fa://fa-test' to use the Font Awesome icon "fa-test".`}
-
- `;
- }),
- )}
+ ${rootInterface()?.config?.capabilities.includes(CapabilitiesEnum.SaveMedia)
+ ? html`
+
+ ${this.instance?.icon
+ ? html`
+
+ ${t`Currently set to:`} ${this.instance?.icon}
+
+ `
+ : html``}
+
+ ${this.instance?.icon
+ ? html`
+
+
+ {
+ const target = ev.target as HTMLInputElement;
+ this.clearIcon = target.checked;
+ }}
+ />
+
+
+
+
+
+ ${t`Clear icon`}
+
+
+ ${t`Delete currently set icon.`}
+
+
+ `
+ : html``}`
+ : html`
+
+
+ ${t`Either input a full URL, a relative path, or use 'fa://fa-test' to use the Font Awesome icon "fa-test".`}
+
+ `}
${t`Protocol settings`}
diff --git a/web/src/admin/sources/plex/PlexSourceForm.ts b/web/src/admin/sources/plex/PlexSourceForm.ts
index 21908febd..8dcc72933 100644
--- a/web/src/admin/sources/plex/PlexSourceForm.ts
+++ b/web/src/admin/sources/plex/PlexSourceForm.ts
@@ -3,6 +3,7 @@ import { UserMatchingModeToLabel } from "@goauthentik/admin/sources/oauth/utils"
import { DEFAULT_CONFIG, config } from "@goauthentik/common/api/config";
import { PlexAPIClient, PlexResource, popupCenterScreen } from "@goauthentik/common/helpers/plex";
import { first, randomString } from "@goauthentik/common/utils";
+import { rootInterface } from "@goauthentik/elements/Base";
import "@goauthentik/elements/forms/FormGroup";
import "@goauthentik/elements/forms/HorizontalFormElement";
import { ModelForm } from "@goauthentik/elements/forms/ModelForm";
@@ -13,7 +14,6 @@ import { t } from "@lingui/macro";
import { TemplateResult, html } from "lit";
import { customElement, property, state } from "lit/decorators.js";
import { ifDefined } from "lit/directives/if-defined.js";
-import { until } from "lit/directives/until.js";
import {
CapabilitiesEnum,
@@ -267,63 +267,52 @@ export class PlexSourceForm extends ModelForm {
${t`Path template for users created. Use placeholders like \`%(slug)s\` to insert the source slug.`}
- ${until(
- config().then((c) => {
- if (c.capabilities.includes(CapabilitiesEnum.SaveMedia)) {
- return html`
-
- ${this.instance?.icon
- ? html`
-
- ${t`Currently set to:`} ${this.instance?.icon}
-
- `
- : html``}
-
- ${this.instance?.icon
- ? html`
-
-
- {
- const target = ev.target as HTMLInputElement;
- this.clearIcon = target.checked;
- }}
- />
-
-
-
-
-
-
- ${t`Clear icon`}
-
-
-
- ${t`Delete currently set icon.`}
-
-
- `
- : html``}`;
- }
- return html`
-
-
- ${t`Either input a full URL, a relative path, or use 'fa://fa-test' to use the Font Awesome icon "fa-test".`}
-
- `;
- }),
- )}
-
+ ${rootInterface()?.config?.capabilities.includes(CapabilitiesEnum.SaveMedia)
+ ? html`
+
+ ${this.instance?.icon
+ ? html`
+
+ ${t`Currently set to:`} ${this.instance?.icon}
+
+ `
+ : html``}
+
+ ${this.instance?.icon
+ ? html`
+
+
+ {
+ const target = ev.target as HTMLInputElement;
+ this.clearIcon = target.checked;
+ }}
+ />
+
+
+
+
+
+ ${t`Clear icon`}
+
+
+ ${t`Delete currently set icon.`}
+
+
+ `
+ : html``}`
+ : html`
+
+
+ ${t`Either input a full URL, a relative path, or use 'fa://fa-test' to use the Font Awesome icon "fa-test".`}
+
+ `}
${t`Protocol settings`}
diff --git a/web/src/admin/stages/identification/IdentificationStageForm.ts b/web/src/admin/stages/identification/IdentificationStageForm.ts
index 87b9e65ed..9ab098c4f 100644
--- a/web/src/admin/stages/identification/IdentificationStageForm.ts
+++ b/web/src/admin/stages/identification/IdentificationStageForm.ts
@@ -11,7 +11,6 @@ import { t } from "@lingui/macro";
import { TemplateResult, html } from "lit";
import { customElement } from "lit/decorators.js";
import { ifDefined } from "lit/directives/if-defined.js";
-import { until } from "lit/directives/until.js";
import {
Flow,
@@ -19,6 +18,7 @@ import {
FlowsInstancesListDesignationEnum,
FlowsInstancesListRequest,
IdentificationStage,
+ PaginatedSourceList,
SourcesApi,
Stage,
StagesApi,
@@ -34,6 +34,14 @@ export class IdentificationStageForm extends ModelForm {
+ this.sources = await new SourcesApi(DEFAULT_CONFIG).sourcesAllList({
+ ordering: "slug",
+ });
+ }
+
+ sources?: PaginatedSourceList;
+
getSuccessMessage(): string {
if (this.instance) {
return t`Successfully updated stage.`;
@@ -80,7 +88,7 @@ export class IdentificationStageForm extends ModelForm ${t`Stage-specific settings`}