Merge branch 'web/config-provider-2-tenant' into web/config-provider-2a-branded

* web/config-provider-2-tenant:
  web: prettier having opinions after merging with dependent branch
  web: Jens requested that the default subscription state for contexts be , and it's the right call.
  web: Jens requested that subscription be  by default, and it's the right call.
  web: prettier had opinions about the README
This commit is contained in:
Ken Sternberg 2023-12-04 10:52:36 -08:00
commit 8c6f83b88e
7 changed files with 7 additions and 16 deletions

View File

@ -110,9 +110,7 @@ export class RelatedUserAdd extends Form<{ users: number[] }> {
} }
@customElement("ak-user-related-list") @customElement("ak-user-related-list")
export class RelatedUserList extends WithBrandConfig( export class RelatedUserList extends WithBrandConfig(WithCapabilitiesConfig(Table<User>)) {
WithCapabilitiesConfig(Table<User>, true),
) {
expandable = true; expandable = true;
checkbox = true; checkbox = true;

View File

@ -25,7 +25,7 @@ import {
} from "@goauthentik/api"; } from "@goauthentik/api";
@customElement("ak-provider-ldap-form") @customElement("ak-provider-ldap-form")
export class LDAPProviderFormPage extends WithBrandConfig(ModelForm<LDAPProvider, number>, true) { export class LDAPProviderFormPage extends WithBrandConfig(ModelForm<LDAPProvider, number>) {
async loadInstance(pk: number): Promise<LDAPProvider> { async loadInstance(pk: number): Promise<LDAPProvider> {
return new ProvidersApi(DEFAULT_CONFIG).providersLdapRetrieve({ return new ProvidersApi(DEFAULT_CONFIG).providersLdapRetrieve({
id: pk, id: pk,

View File

@ -14,10 +14,7 @@ import { customElement } from "lit/decorators.js";
import { FlowsInstancesListDesignationEnum, ProvidersApi, RadiusProvider } from "@goauthentik/api"; import { FlowsInstancesListDesignationEnum, ProvidersApi, RadiusProvider } from "@goauthentik/api";
@customElement("ak-provider-radius-form") @customElement("ak-provider-radius-form")
export class RadiusProviderFormPage extends WithBrandConfig( export class RadiusProviderFormPage extends WithBrandConfig(ModelForm<RadiusProvider, number>) {
ModelForm<RadiusProvider, number>,
true,
) {
loadInstance(pk: number): Promise<RadiusProvider> { loadInstance(pk: number): Promise<RadiusProvider> {
return new ProvidersApi(DEFAULT_CONFIG).providersRadiusRetrieve({ return new ProvidersApi(DEFAULT_CONFIG).providersRadiusRetrieve({
id: pk, id: pk,

View File

@ -91,8 +91,7 @@ const recoveryButtonStyles = css`
`; `;
@customElement("ak-user-list") @customElement("ak-user-list")
export class UserListPage extends WithBrandConfig( export class UserListPage extends WithBrandConfig(WithCapabilitiesConfig(TablePage<User>)) {
WithCapabilitiesConfig(TablePage<User>, true)) {
expandable = true; expandable = true;
checkbox = true; checkbox = true;

View File

@ -10,7 +10,7 @@ type Constructor<T = object> = new (...args: any[]) => T;
export function WithAuthentikConfig<T extends Constructor<LitElement>>( export function WithAuthentikConfig<T extends Constructor<LitElement>>(
superclass: T, superclass: T,
subscribe = false, subscribe = true,
) { ) {
abstract class WithAkConfigProvider extends superclass { abstract class WithAkConfigProvider extends superclass {
@consume({ context: authentikConfigContext, subscribe }) @consume({ context: authentikConfigContext, subscribe })

View File

@ -47,7 +47,7 @@ class WCC {
export function WithCapabilitiesConfig<T extends Constructor<LitElement>>( export function WithCapabilitiesConfig<T extends Constructor<LitElement>>(
superclass: T, superclass: T,
subscribe = false, subscribe = true,
) { ) {
abstract class CapabilitiesContext extends superclass { abstract class CapabilitiesContext extends superclass {
@consume({ context: authentikConfigContext, subscribe }) @consume({ context: authentikConfigContext, subscribe })

View File

@ -31,10 +31,7 @@ import {
} from "@goauthentik/api"; } from "@goauthentik/api";
@customElement("ak-user-settings-flow-executor") @customElement("ak-user-settings-flow-executor")
export class UserSettingsFlowExecutor export class UserSettingsFlowExecutor extends WithBrandConfig(AKElement) implements StageHost {
extends WithBrandConfig(AKElement)
implements StageHost
{
@property() @property()
flowSlug?: string; flowSlug?: string;