web: (ESLint) No else return (#14558)

web: (ESLint) no-else-return.
This commit is contained in:
Teffen Ellis
2025-05-19 19:34:51 +02:00
committed by GitHub
parent b72d0e84c9
commit 40f598f3f1
79 changed files with 248 additions and 331 deletions

View File

@ -387,11 +387,11 @@
], ],
"prettier": "@goauthentik/prettier-config", "prettier": "@goauthentik/prettier-config",
"overrides": { "overrides": {
"rapidoc": {
"@apitools/openapi-parser@": "0.0.37"
},
"chromedriver": { "chromedriver": {
"axios": "^1.8.4" "axios": "^1.8.4"
},
"rapidoc": {
"@apitools/openapi-parser@": "0.0.37"
} }
} }
} }

View File

@ -33,12 +33,11 @@ export class WorkersStatusCard extends AdminStatusCard<Worker[]> {
icon: "fa fa-times-circle pf-m-danger", icon: "fa fa-times-circle pf-m-danger",
message: html`${msg("Worker with incorrect version connected.")}`, message: html`${msg("Worker with incorrect version connected.")}`,
}); });
} else { }
return Promise.resolve<AdminStatus>({ return Promise.resolve<AdminStatus>({
icon: "fa fa-check-circle pf-m-success", icon: "fa fa-check-circle pf-m-success",
}); });
} }
}
renderValue() { renderValue() {
return html`${this.value?.length}`; return html`${this.value?.length}`;

View File

@ -30,9 +30,8 @@ export class ApplicationEntitlementForm extends ModelForm<ApplicationEntitlement
getSuccessMessage(): string { getSuccessMessage(): string {
if (this.instance?.pbmUuid) { if (this.instance?.pbmUuid) {
return msg("Successfully updated entitlement."); return msg("Successfully updated entitlement.");
} else {
return msg("Successfully created entitlement.");
} }
return msg("Successfully created entitlement.");
} }
static get styles(): CSSResult[] { static get styles(): CSSResult[] {
@ -48,12 +47,11 @@ export class ApplicationEntitlementForm extends ModelForm<ApplicationEntitlement
pbmUuid: this.instance.pbmUuid || "", pbmUuid: this.instance.pbmUuid || "",
applicationEntitlementRequest: data, applicationEntitlementRequest: data,
}); });
} else { }
return new CoreApi(DEFAULT_CONFIG).coreApplicationEntitlementsCreate({ return new CoreApi(DEFAULT_CONFIG).coreApplicationEntitlementsCreate({
applicationEntitlementRequest: data, applicationEntitlementRequest: data,
}); });
} }
}
renderForm(): TemplateResult { renderForm(): TemplateResult {
return html` <ak-form-element-horizontal label=${msg("Name")} ?required=${true} name="name"> return html` <ak-form-element-horizontal label=${msg("Name")} ?required=${true} name="name">

View File

@ -58,12 +58,11 @@ export class BlueprintForm extends ModelForm<BlueprintInstance, string> {
instanceUuid: this.instance.pk, instanceUuid: this.instance.pk,
blueprintInstanceRequest: data, blueprintInstanceRequest: data,
}); });
} else { }
return new ManagedApi(DEFAULT_CONFIG).managedBlueprintsCreate({ return new ManagedApi(DEFAULT_CONFIG).managedBlueprintsCreate({
blueprintInstanceRequest: data, blueprintInstanceRequest: data,
}); });
} }
}
renderForm(): TemplateResult { renderForm(): TemplateResult {
return html` <ak-form-element-horizontal label=${msg("Name")} ?required=${true} name="name"> return html` <ak-form-element-horizontal label=${msg("Name")} ?required=${true} name="name">

View File

@ -42,12 +42,11 @@ export class BrandForm extends ModelForm<Brand, string> {
brandUuid: this.instance.brandUuid, brandUuid: this.instance.brandUuid,
brandRequest: data, brandRequest: data,
}); });
} else { }
return new CoreApi(DEFAULT_CONFIG).coreBrandsCreate({ return new CoreApi(DEFAULT_CONFIG).coreBrandsCreate({
brandRequest: data, brandRequest: data,
}); });
} }
}
renderForm(): TemplateResult { renderForm(): TemplateResult {
return html` <ak-form-element-horizontal label=${msg("Domain")} required name="domain"> return html` <ak-form-element-horizontal label=${msg("Domain")} required name="domain">

View File

@ -30,12 +30,11 @@ export class CertificateKeyPairForm extends ModelForm<CertificateKeyPair, string
kpUuid: this.instance.pk || "", kpUuid: this.instance.pk || "",
patchedCertificateKeyPairRequest: data, patchedCertificateKeyPairRequest: data,
}); });
} else { }
return new CryptoApi(DEFAULT_CONFIG).cryptoCertificatekeypairsCreate({ return new CryptoApi(DEFAULT_CONFIG).cryptoCertificatekeypairsCreate({
certificateKeyPairRequest: data as unknown as CertificateKeyPairRequest, certificateKeyPairRequest: data as unknown as CertificateKeyPairRequest,
}); });
} }
}
renderForm(): TemplateResult { renderForm(): TemplateResult {
return html` <ak-form-element-horizontal label=${msg("Name")} name="name" ?required=${true}> return html` <ak-form-element-horizontal label=${msg("Name")} name="name" ?required=${true}>

View File

@ -51,12 +51,11 @@ export class RuleForm extends ModelForm<NotificationRule, string> {
pbmUuid: this.instance.pk || "", pbmUuid: this.instance.pk || "",
notificationRuleRequest: data, notificationRuleRequest: data,
}); });
} else { }
return new EventsApi(DEFAULT_CONFIG).eventsRulesCreate({ return new EventsApi(DEFAULT_CONFIG).eventsRulesCreate({
notificationRuleRequest: data, notificationRuleRequest: data,
}); });
} }
}
renderForm(): TemplateResult { renderForm(): TemplateResult {
return html` <ak-form-element-horizontal label=${msg("Name")} ?required=${true} name="name"> return html` <ak-form-element-horizontal label=${msg("Name")} ?required=${true} name="name">

View File

@ -46,12 +46,11 @@ export class TransportForm extends ModelForm<NotificationTransport, string> {
uuid: this.instance.pk || "", uuid: this.instance.pk || "",
notificationTransportRequest: data, notificationTransportRequest: data,
}); });
} else { }
return new EventsApi(DEFAULT_CONFIG).eventsTransportsCreate({ return new EventsApi(DEFAULT_CONFIG).eventsTransportsCreate({
notificationTransportRequest: data, notificationTransportRequest: data,
}); });
} }
}
onModeChange(mode: string | undefined): void { onModeChange(mode: string | undefined): void {
if ( if (

View File

@ -39,9 +39,8 @@ export class StageBindingForm extends ModelForm<FlowStageBinding, string> {
getSuccessMessage(): string { getSuccessMessage(): string {
if (this.instance?.pk) { if (this.instance?.pk) {
return msg("Successfully updated binding."); return msg("Successfully updated binding.");
} else {
return msg("Successfully created binding.");
} }
return msg("Successfully created binding.");
} }
send(data: FlowStageBinding): Promise<unknown> { send(data: FlowStageBinding): Promise<unknown> {
@ -50,7 +49,7 @@ export class StageBindingForm extends ModelForm<FlowStageBinding, string> {
fsbUuid: this.instance.pk, fsbUuid: this.instance.pk,
patchedFlowStageBindingRequest: data, patchedFlowStageBindingRequest: data,
}); });
} else { }
if (this.targetPk) { if (this.targetPk) {
data.target = this.targetPk; data.target = this.targetPk;
} }
@ -58,7 +57,6 @@ export class StageBindingForm extends ModelForm<FlowStageBinding, string> {
flowStageBindingRequest: data, flowStageBindingRequest: data,
}); });
} }
}
async getOrder(): Promise<number> { async getOrder(): Promise<number> {
if (this.instance?.pk) { if (this.instance?.pk) {

View File

@ -54,13 +54,12 @@ export class GroupForm extends ModelForm<Group, string> {
groupUuid: this.instance.pk, groupUuid: this.instance.pk,
patchedGroupRequest: data, patchedGroupRequest: data,
}); });
} else { }
data.users = []; data.users = [];
return new CoreApi(DEFAULT_CONFIG).coreGroupsCreate({ return new CoreApi(DEFAULT_CONFIG).coreGroupsCreate({
groupRequest: data, groupRequest: data,
}); });
} }
}
renderForm(): TemplateResult { renderForm(): TemplateResult {
return html` <ak-form-element-horizontal label=${msg("Name")} ?required=${true} name="name"> return html` <ak-form-element-horizontal label=${msg("Name")} ?required=${true} name="name">

View File

@ -129,12 +129,11 @@ export class OutpostForm extends ModelForm<Outpost, string> {
uuid: this.instance.pk || "", uuid: this.instance.pk || "",
outpostRequest: data, outpostRequest: data,
}); });
} else { }
return new OutpostsApi(DEFAULT_CONFIG).outpostsInstancesCreate({ return new OutpostsApi(DEFAULT_CONFIG).outpostsInstancesCreate({
outpostRequest: data, outpostRequest: data,
}); });
} }
}
renderForm(): TemplateResult { renderForm(): TemplateResult {
const typeOptions = [ const typeOptions = [

View File

@ -31,12 +31,11 @@ export class ServiceConnectionDockerForm extends ModelForm<DockerServiceConnecti
uuid: this.instance.pk || "", uuid: this.instance.pk || "",
dockerServiceConnectionRequest: data, dockerServiceConnectionRequest: data,
}); });
} else { }
return new OutpostsApi(DEFAULT_CONFIG).outpostsServiceConnectionsDockerCreate({ return new OutpostsApi(DEFAULT_CONFIG).outpostsServiceConnectionsDockerCreate({
dockerServiceConnectionRequest: data, dockerServiceConnectionRequest: data,
}); });
} }
}
renderForm(): TemplateResult { renderForm(): TemplateResult {
return html` <ak-form-element-horizontal label=${msg("Name")} ?required=${true} name="name"> return html` <ak-form-element-horizontal label=${msg("Name")} ?required=${true} name="name">

View File

@ -35,12 +35,11 @@ export class ServiceConnectionKubernetesForm extends ModelForm<
uuid: this.instance.pk || "", uuid: this.instance.pk || "",
kubernetesServiceConnectionRequest: data, kubernetesServiceConnectionRequest: data,
}); });
} else { }
return new OutpostsApi(DEFAULT_CONFIG).outpostsServiceConnectionsKubernetesCreate({ return new OutpostsApi(DEFAULT_CONFIG).outpostsServiceConnectionsKubernetesCreate({
kubernetesServiceConnectionRequest: data, kubernetesServiceConnectionRequest: data,
}); });
} }
}
renderForm(): TemplateResult { renderForm(): TemplateResult {
return html` <ak-form-element-horizontal label=${msg("Name")} ?required=${true} name="name"> return html` <ak-form-element-horizontal label=${msg("Name")} ?required=${true} name="name">

View File

@ -72,9 +72,8 @@ export class BoundPoliciesList extends Table<PolicyBinding> {
return msg(str`Group ${item.groupObj?.name}`); return msg(str`Group ${item.groupObj?.name}`);
} else if (item.user) { } else if (item.user) {
return msg(str`User ${item.userObj?.name}`); return msg(str`User ${item.userObj?.name}`);
} else {
return msg("-");
} }
return msg("-");
} }
getPolicyUserGroupRow(item: PolicyBinding): TemplateResult { getPolicyUserGroupRow(item: PolicyBinding): TemplateResult {
@ -123,9 +122,8 @@ export class BoundPoliciesList extends Table<PolicyBinding> {
${msg("Edit User")} ${msg("Edit User")}
</button> </button>
</ak-forms-modal>`; </ak-forms-modal>`;
} else {
return html``;
} }
return html``;
} }
renderToolbarSelected(): TemplateResult { renderToolbarSelected(): TemplateResult {

View File

@ -72,9 +72,8 @@ export class PolicyBindingForm extends ModelForm<PolicyBinding, string> {
getSuccessMessage(): string { getSuccessMessage(): string {
if (this.instance?.pk) { if (this.instance?.pk) {
return msg("Successfully updated binding."); return msg("Successfully updated binding.");
} else {
return msg("Successfully created binding.");
} }
return msg("Successfully created binding.");
} }
static get styles(): CSSResult[] { static get styles(): CSSResult[] {
@ -111,12 +110,11 @@ export class PolicyBindingForm extends ModelForm<PolicyBinding, string> {
policyBindingUuid: this.instance.pk, policyBindingUuid: this.instance.pk,
policyBindingRequest: data, policyBindingRequest: data,
}); });
} else { }
return new PoliciesApi(DEFAULT_CONFIG).policiesBindingsCreate({ return new PoliciesApi(DEFAULT_CONFIG).policiesBindingsCreate({
policyBindingRequest: data, policyBindingRequest: data,
}); });
} }
}
async getOrder(): Promise<number> { async getOrder(): Promise<number> {
if (this.instance?.pk) { if (this.instance?.pk) {

View File

@ -24,12 +24,11 @@ export class DummyPolicyForm extends BasePolicyForm<DummyPolicy> {
policyUuid: this.instance.pk || "", policyUuid: this.instance.pk || "",
dummyPolicyRequest: data, dummyPolicyRequest: data,
}); });
} else { }
return new PoliciesApi(DEFAULT_CONFIG).policiesDummyCreate({ return new PoliciesApi(DEFAULT_CONFIG).policiesDummyCreate({
dummyPolicyRequest: data, dummyPolicyRequest: data,
}); });
} }
}
renderForm(): TemplateResult { renderForm(): TemplateResult {
return html` <span> return html` <span>

View File

@ -36,12 +36,11 @@ export class EventMatcherPolicyForm extends BasePolicyForm<EventMatcherPolicy> {
policyUuid: this.instance.pk || "", policyUuid: this.instance.pk || "",
eventMatcherPolicyRequest: data, eventMatcherPolicyRequest: data,
}); });
} else { }
return new PoliciesApi(DEFAULT_CONFIG).policiesEventMatcherCreate({ return new PoliciesApi(DEFAULT_CONFIG).policiesEventMatcherCreate({
eventMatcherPolicyRequest: data, eventMatcherPolicyRequest: data,
}); });
} }
}
renderForm(): TemplateResult { renderForm(): TemplateResult {
return html` <span> return html` <span>

View File

@ -24,12 +24,11 @@ export class PasswordExpiryPolicyForm extends BasePolicyForm<PasswordExpiryPolic
policyUuid: this.instance.pk || "", policyUuid: this.instance.pk || "",
passwordExpiryPolicyRequest: data, passwordExpiryPolicyRequest: data,
}); });
} else { }
return new PoliciesApi(DEFAULT_CONFIG).policiesPasswordExpiryCreate({ return new PoliciesApi(DEFAULT_CONFIG).policiesPasswordExpiryCreate({
passwordExpiryPolicyRequest: data, passwordExpiryPolicyRequest: data,
}); });
} }
}
renderForm(): TemplateResult { renderForm(): TemplateResult {
return html` <span> return html` <span>

View File

@ -27,12 +27,11 @@ export class ExpressionPolicyForm extends BasePolicyForm<ExpressionPolicy> {
policyUuid: this.instance.pk || "", policyUuid: this.instance.pk || "",
expressionPolicyRequest: data, expressionPolicyRequest: data,
}); });
} else { }
return new PoliciesApi(DEFAULT_CONFIG).policiesExpressionCreate({ return new PoliciesApi(DEFAULT_CONFIG).policiesExpressionCreate({
expressionPolicyRequest: data, expressionPolicyRequest: data,
}); });
} }
}
renderForm(): TemplateResult { renderForm(): TemplateResult {
return html` <span> return html` <span>

View File

@ -38,12 +38,11 @@ export class GeoIPPolicyForm extends BasePolicyForm<GeoIPPolicy> {
policyUuid: this.instance.pk || "", policyUuid: this.instance.pk || "",
geoIPPolicyRequest: data, geoIPPolicyRequest: data,
}); });
} else { }
return new PoliciesApi(DEFAULT_CONFIG).policiesGeoipCreate({ return new PoliciesApi(DEFAULT_CONFIG).policiesGeoipCreate({
geoIPPolicyRequest: data, geoIPPolicyRequest: data,
}); });
} }
}
renderForm(): TemplateResult { renderForm(): TemplateResult {
return html`<span> return html`<span>

View File

@ -37,12 +37,11 @@ export class PasswordPolicyForm extends BasePolicyForm<PasswordPolicy> {
policyUuid: this.instance.pk || "", policyUuid: this.instance.pk || "",
passwordPolicyRequest: data, passwordPolicyRequest: data,
}); });
} else { }
return new PoliciesApi(DEFAULT_CONFIG).policiesPasswordCreate({ return new PoliciesApi(DEFAULT_CONFIG).policiesPasswordCreate({
passwordPolicyRequest: data, passwordPolicyRequest: data,
}); });
} }
}
renderStaticRules(): TemplateResult { renderStaticRules(): TemplateResult {
return html` <ak-form-group> return html` <ak-form-group>

View File

@ -24,12 +24,11 @@ export class ReputationPolicyForm extends BasePolicyForm<ReputationPolicy> {
policyUuid: this.instance.pk || "", policyUuid: this.instance.pk || "",
reputationPolicyRequest: data, reputationPolicyRequest: data,
}); });
} else { }
return new PoliciesApi(DEFAULT_CONFIG).policiesReputationCreate({ return new PoliciesApi(DEFAULT_CONFIG).policiesReputationCreate({
reputationPolicyRequest: data, reputationPolicyRequest: data,
}); });
} }
}
renderForm(): TemplateResult { renderForm(): TemplateResult {
return html` <span> return html` <span>

View File

@ -24,12 +24,11 @@ export class UniquePasswordPolicyForm extends BasePolicyForm<UniquePasswordPolic
policyUuid: this.instance.pk || "", policyUuid: this.instance.pk || "",
uniquePasswordPolicyRequest: data, uniquePasswordPolicyRequest: data,
}); });
} else { }
return new PoliciesApi(DEFAULT_CONFIG).policiesUniquePasswordCreate({ return new PoliciesApi(DEFAULT_CONFIG).policiesUniquePasswordCreate({
uniquePasswordPolicyRequest: data, uniquePasswordPolicyRequest: data,
}); });
} }
}
renderForm(): TemplateResult { renderForm(): TemplateResult {
return html` <span> return html` <span>

View File

@ -21,13 +21,12 @@ export class PropertyMappingNotification extends BasePropertyMappingForm<Notific
pmUuid: this.instance.pk, pmUuid: this.instance.pk,
notificationWebhookMappingRequest: data, notificationWebhookMappingRequest: data,
}); });
} else { }
return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsNotificationCreate({ return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsNotificationCreate({
notificationWebhookMappingRequest: data, notificationWebhookMappingRequest: data,
}); });
} }
} }
}
declare global { declare global {
interface HTMLElementTagNameMap { interface HTMLElementTagNameMap {

View File

@ -25,7 +25,7 @@ export class PropertyMappingProviderGoogleWorkspaceForm extends BasePropertyMapp
pmUuid: this.instance.pk, pmUuid: this.instance.pk,
googleWorkspaceProviderMappingRequest: data, googleWorkspaceProviderMappingRequest: data,
}); });
} else { }
return new PropertymappingsApi( return new PropertymappingsApi(
DEFAULT_CONFIG, DEFAULT_CONFIG,
).propertymappingsProviderGoogleWorkspaceCreate({ ).propertymappingsProviderGoogleWorkspaceCreate({
@ -33,7 +33,6 @@ export class PropertyMappingProviderGoogleWorkspaceForm extends BasePropertyMapp
}); });
} }
} }
}
declare global { declare global {
interface HTMLElementTagNameMap { interface HTMLElementTagNameMap {

View File

@ -25,13 +25,12 @@ export class PropertyMappingProviderMicrosoftEntraForm extends BasePropertyMappi
pmUuid: this.instance.pk, pmUuid: this.instance.pk,
microsoftEntraProviderMappingRequest: data, microsoftEntraProviderMappingRequest: data,
}); });
} else {
return new PropertymappingsApi(
DEFAULT_CONFIG,
).propertymappingsProviderMicrosoftEntraCreate({
microsoftEntraProviderMappingRequest: data,
});
} }
return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsProviderMicrosoftEntraCreate(
{
microsoftEntraProviderMappingRequest: data,
},
);
} }
} }

View File

@ -46,12 +46,11 @@ export class PropertyMappingProviderRACForm extends BasePropertyMappingForm<RACP
pmUuid: this.instance.pk, pmUuid: this.instance.pk,
rACPropertyMappingRequest: data, rACPropertyMappingRequest: data,
}); });
} else { }
return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsProviderRacCreate({ return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsProviderRacCreate({
rACPropertyMappingRequest: data, rACPropertyMappingRequest: data,
}); });
} }
}
renderForm(): TemplateResult { renderForm(): TemplateResult {
return html` return html`

View File

@ -21,13 +21,12 @@ export class PropertyMappingProviderRadiusForm extends BasePropertyMappingForm<R
pmUuid: this.instance.pk, pmUuid: this.instance.pk,
radiusProviderPropertyMappingRequest: data, radiusProviderPropertyMappingRequest: data,
}); });
} else { }
return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsProviderRadiusCreate({ return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsProviderRadiusCreate({
radiusProviderPropertyMappingRequest: data, radiusProviderPropertyMappingRequest: data,
}); });
} }
} }
}
declare global { declare global {
interface HTMLElementTagNameMap { interface HTMLElementTagNameMap {

View File

@ -24,12 +24,11 @@ export class PropertyMappingProviderSAMLForm extends BasePropertyMappingForm<SAM
pmUuid: this.instance.pk, pmUuid: this.instance.pk,
sAMLPropertyMappingRequest: data, sAMLPropertyMappingRequest: data,
}); });
} else { }
return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsProviderSamlCreate({ return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsProviderSamlCreate({
sAMLPropertyMappingRequest: data, sAMLPropertyMappingRequest: data,
}); });
} }
}
renderExtraFields(): TemplateResult { renderExtraFields(): TemplateResult {
return html` <ak-form-element-horizontal return html` <ak-form-element-horizontal

View File

@ -21,13 +21,12 @@ export class PropertyMappingProviderSCIMForm extends BasePropertyMappingForm<SCI
pmUuid: this.instance.pk, pmUuid: this.instance.pk,
sCIMMappingRequest: data, sCIMMappingRequest: data,
}); });
} else { }
return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsProviderScimCreate({ return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsProviderScimCreate({
sCIMMappingRequest: data, sCIMMappingRequest: data,
}); });
} }
} }
}
declare global { declare global {
interface HTMLElementTagNameMap { interface HTMLElementTagNameMap {

View File

@ -24,12 +24,11 @@ export class PropertyMappingProviderScopeForm extends BasePropertyMappingForm<Sc
pmUuid: this.instance.pk, pmUuid: this.instance.pk,
scopeMappingRequest: data, scopeMappingRequest: data,
}); });
} else { }
return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsProviderScopeCreate({ return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsProviderScopeCreate({
scopeMappingRequest: data, scopeMappingRequest: data,
}); });
} }
}
renderExtraFields(): TemplateResult { renderExtraFields(): TemplateResult {
return html` <ak-form-element-horizontal return html` <ak-form-element-horizontal

View File

@ -25,13 +25,12 @@ export class PropertyMappingSourceKerberosForm extends BasePropertyMappingForm<K
pmUuid: this.instance.pk, pmUuid: this.instance.pk,
kerberosSourcePropertyMappingRequest: data, kerberosSourcePropertyMappingRequest: data,
}); });
} else { }
return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsSourceKerberosCreate({ return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsSourceKerberosCreate({
kerberosSourcePropertyMappingRequest: data, kerberosSourcePropertyMappingRequest: data,
}); });
} }
} }
}
declare global { declare global {
interface HTMLElementTagNameMap { interface HTMLElementTagNameMap {

View File

@ -25,13 +25,12 @@ export class PropertyMappingSourceLDAPForm extends BasePropertyMappingForm<LDAPS
pmUuid: this.instance.pk, pmUuid: this.instance.pk,
lDAPSourcePropertyMappingRequest: data, lDAPSourcePropertyMappingRequest: data,
}); });
} else { }
return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsSourceLdapCreate({ return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsSourceLdapCreate({
lDAPSourcePropertyMappingRequest: data, lDAPSourcePropertyMappingRequest: data,
}); });
} }
} }
}
declare global { declare global {
interface HTMLElementTagNameMap { interface HTMLElementTagNameMap {

View File

@ -25,13 +25,12 @@ export class PropertyMappingSourceOAuthForm extends BasePropertyMappingForm<OAut
pmUuid: this.instance.pk, pmUuid: this.instance.pk,
oAuthSourcePropertyMappingRequest: data, oAuthSourcePropertyMappingRequest: data,
}); });
} else { }
return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsSourceOauthCreate({ return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsSourceOauthCreate({
oAuthSourcePropertyMappingRequest: data, oAuthSourcePropertyMappingRequest: data,
}); });
} }
} }
}
declare global { declare global {
interface HTMLElementTagNameMap { interface HTMLElementTagNameMap {

View File

@ -25,13 +25,12 @@ export class PropertyMappingSourcePlexForm extends BasePropertyMappingForm<PlexS
pmUuid: this.instance.pk, pmUuid: this.instance.pk,
plexSourcePropertyMappingRequest: data, plexSourcePropertyMappingRequest: data,
}); });
} else { }
return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsSourcePlexCreate({ return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsSourcePlexCreate({
plexSourcePropertyMappingRequest: data, plexSourcePropertyMappingRequest: data,
}); });
} }
} }
}
declare global { declare global {
interface HTMLElementTagNameMap { interface HTMLElementTagNameMap {

View File

@ -25,13 +25,12 @@ export class PropertyMappingSourceSAMLForm extends BasePropertyMappingForm<SAMLS
pmUuid: this.instance.pk, pmUuid: this.instance.pk,
sAMLSourcePropertyMappingRequest: data, sAMLSourcePropertyMappingRequest: data,
}); });
} else { }
return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsSourceSamlCreate({ return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsSourceSamlCreate({
sAMLSourcePropertyMappingRequest: data, sAMLSourcePropertyMappingRequest: data,
}); });
} }
} }
}
declare global { declare global {
interface HTMLElementTagNameMap { interface HTMLElementTagNameMap {

View File

@ -25,13 +25,12 @@ export class PropertyMappingSourceSCIMForm extends BasePropertyMappingForm<SCIMS
pmUuid: this.instance.pk, pmUuid: this.instance.pk,
sCIMSourcePropertyMappingRequest: data, sCIMSourcePropertyMappingRequest: data,
}); });
} else { }
return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsSourceScimCreate({ return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsSourceScimCreate({
sCIMSourcePropertyMappingRequest: data, sCIMSourcePropertyMappingRequest: data,
}); });
} }
} }
}
declare global { declare global {
interface HTMLElementTagNameMap { interface HTMLElementTagNameMap {

View File

@ -41,12 +41,11 @@ export class GoogleWorkspaceProviderFormPage extends BaseProviderForm<GoogleWork
id: this.instance.pk, id: this.instance.pk,
googleWorkspaceProviderRequest: data, googleWorkspaceProviderRequest: data,
}); });
} else { }
return new ProvidersApi(DEFAULT_CONFIG).providersGoogleWorkspaceCreate({ return new ProvidersApi(DEFAULT_CONFIG).providersGoogleWorkspaceCreate({
googleWorkspaceProviderRequest: data, googleWorkspaceProviderRequest: data,
}); });
} }
}
renderForm(): TemplateResult { renderForm(): TemplateResult {
return html` <ak-form-element-horizontal label=${msg("Name")} ?required=${true} name="name"> return html` <ak-form-element-horizontal label=${msg("Name")} ?required=${true} name="name">

View File

@ -24,12 +24,11 @@ export class LDAPProviderFormPage extends WithBrandConfig(BaseProviderForm<LDAPP
id: this.instance.pk, id: this.instance.pk,
lDAPProviderRequest: data, lDAPProviderRequest: data,
}); });
} else { }
return new ProvidersApi(DEFAULT_CONFIG).providersLdapCreate({ return new ProvidersApi(DEFAULT_CONFIG).providersLdapCreate({
lDAPProviderRequest: data, lDAPProviderRequest: data,
}); });
} }
}
renderForm() { renderForm() {
return renderForm(this.instance ?? {}, [], this.brand); return renderForm(this.instance ?? {}, [], this.brand);

View File

@ -39,12 +39,11 @@ export class MicrosoftEntraProviderFormPage extends BaseProviderForm<MicrosoftEn
id: this.instance.pk, id: this.instance.pk,
microsoftEntraProviderRequest: data, microsoftEntraProviderRequest: data,
}); });
} else { }
return new ProvidersApi(DEFAULT_CONFIG).providersMicrosoftEntraCreate({ return new ProvidersApi(DEFAULT_CONFIG).providersMicrosoftEntraCreate({
microsoftEntraProviderRequest: data, microsoftEntraProviderRequest: data,
}); });
} }
}
renderForm(): TemplateResult { renderForm(): TemplateResult {
return html` <ak-form-element-horizontal label=${msg("Name")} ?required=${true} name="name"> return html` <ak-form-element-horizontal label=${msg("Name")} ?required=${true} name="name">

View File

@ -82,12 +82,11 @@ export class OAuth2ProviderFormPage extends BaseProviderForm<OAuth2Provider> {
id: this.instance.pk, id: this.instance.pk,
oAuth2ProviderRequest: data, oAuth2ProviderRequest: data,
}); });
} else { }
return new ProvidersApi(DEFAULT_CONFIG).providersOauth2Create({ return new ProvidersApi(DEFAULT_CONFIG).providersOauth2Create({
oAuth2ProviderRequest: data, oAuth2ProviderRequest: data,
}); });
} }
}
renderForm() { renderForm() {
const showClientSecretCallback = (show: boolean) => { const showClientSecretCallback = (show: boolean) => {

View File

@ -45,12 +45,11 @@ export class ProxyProviderFormPage extends BaseProviderForm<ProxyProvider> {
id: this.instance.pk, id: this.instance.pk,
proxyProviderRequest: data, proxyProviderRequest: data,
}); });
} else { }
return new ProvidersApi(DEFAULT_CONFIG).providersProxyCreate({ return new ProvidersApi(DEFAULT_CONFIG).providersProxyCreate({
proxyProviderRequest: data, proxyProviderRequest: data,
}); });
} }
}
renderForm() { renderForm() {
const onSetMode: SetMode = (ev) => { const onSetMode: SetMode = (ev) => {

View File

@ -45,12 +45,11 @@ export class EndpointForm extends ModelForm<Endpoint, string> {
pbmUuid: this.instance.pk || "", pbmUuid: this.instance.pk || "",
patchedEndpointRequest: data, patchedEndpointRequest: data,
}); });
} else { }
return new RacApi(DEFAULT_CONFIG).racEndpointsCreate({ return new RacApi(DEFAULT_CONFIG).racEndpointsCreate({
endpointRequest: data, endpointRequest: data,
}); });
} }
}
renderForm(): TemplateResult { renderForm(): TemplateResult {
return html` return html`

View File

@ -31,9 +31,8 @@ export class RACProviderFormPage extends ModelForm<RACProvider, number> {
getSuccessMessage(): string { getSuccessMessage(): string {
if (this.instance) { if (this.instance) {
return msg("Successfully updated provider."); return msg("Successfully updated provider.");
} else {
return msg("Successfully created provider.");
} }
return msg("Successfully created provider.");
} }
async send(data: RACProvider): Promise<RACProvider> { async send(data: RACProvider): Promise<RACProvider> {
@ -42,12 +41,11 @@ export class RACProviderFormPage extends ModelForm<RACProvider, number> {
id: this.instance.pk, id: this.instance.pk,
rACProviderRequest: data, rACProviderRequest: data,
}); });
} else { }
return new ProvidersApi(DEFAULT_CONFIG).providersRacCreate({ return new ProvidersApi(DEFAULT_CONFIG).providersRacCreate({
rACProviderRequest: data, rACProviderRequest: data,
}); });
} }
}
renderForm(): TemplateResult { renderForm(): TemplateResult {
return html` return html`

View File

@ -22,12 +22,11 @@ export class RadiusProviderFormPage extends WithBrandConfig(BaseProviderForm<Rad
id: this.instance.pk, id: this.instance.pk,
radiusProviderRequest: data, radiusProviderRequest: data,
}); });
} else { }
return new ProvidersApi(DEFAULT_CONFIG).providersRadiusCreate({ return new ProvidersApi(DEFAULT_CONFIG).providersRadiusCreate({
radiusProviderRequest: data, radiusProviderRequest: data,
}); });
} }
}
renderForm() { renderForm() {
return renderForm(this.instance ?? {}, [], this.brand); return renderForm(this.instance ?? {}, [], this.brand);

View File

@ -27,12 +27,11 @@ export class SAMLProviderFormPage extends BaseProviderForm<SAMLProvider> {
id: this.instance.pk, id: this.instance.pk,
sAMLProviderRequest: data, sAMLProviderRequest: data,
}); });
} else { }
return new ProvidersApi(DEFAULT_CONFIG).providersSamlCreate({ return new ProvidersApi(DEFAULT_CONFIG).providersSamlCreate({
sAMLProviderRequest: data, sAMLProviderRequest: data,
}); });
} }
}
renderForm() { renderForm() {
const setHasSigningKp = (ev: InputEvent) => { const setHasSigningKp = (ev: InputEvent) => {

View File

@ -21,12 +21,11 @@ export class SCIMProviderFormPage extends BaseProviderForm<SCIMProvider> {
id: this.instance.pk, id: this.instance.pk,
sCIMProviderRequest: data, sCIMProviderRequest: data,
}); });
} else { }
return new ProvidersApi(DEFAULT_CONFIG).providersScimCreate({ return new ProvidersApi(DEFAULT_CONFIG).providersScimCreate({
sCIMProviderRequest: data, sCIMProviderRequest: data,
}); });
} }
}
renderForm() { renderForm() {
return renderForm(this.instance ?? {}, []); return renderForm(this.instance ?? {}, []);

View File

@ -42,12 +42,11 @@ export class SSFProviderFormPage extends BaseProviderForm<SSFProvider> {
id: this.instance.pk, id: this.instance.pk,
sSFProviderRequest: data, sSFProviderRequest: data,
}); });
} else { }
return new ProvidersApi(DEFAULT_CONFIG).providersSsfCreate({ return new ProvidersApi(DEFAULT_CONFIG).providersSsfCreate({
sSFProviderRequest: data, sSFProviderRequest: data,
}); });
} }
}
renderForm(): TemplateResult { renderForm(): TemplateResult {
const provider = this.instance; const provider = this.instance;

View File

@ -46,12 +46,11 @@ export class InitialPermissionsForm extends ModelForm<InitialPermissions, string
id: this.instance.pk, id: this.instance.pk,
patchedInitialPermissionsRequest: data, patchedInitialPermissionsRequest: data,
}); });
} else { }
return new RbacApi(DEFAULT_CONFIG).rbacInitialPermissionsCreate({ return new RbacApi(DEFAULT_CONFIG).rbacInitialPermissionsCreate({
initialPermissionsRequest: data, initialPermissionsRequest: data,
}); });
} }
}
renderForm(): TemplateResult { renderForm(): TemplateResult {
return html`<form class="pf-c-form pf-m-horizontal"> return html`<form class="pf-c-form pf-m-horizontal">

View File

@ -32,12 +32,11 @@ export class RoleForm extends ModelForm<Role, string> {
uuid: this.instance.pk, uuid: this.instance.pk,
patchedRoleRequest: data, patchedRoleRequest: data,
}); });
} else { }
return new RbacApi(DEFAULT_CONFIG).rbacRolesCreate({ return new RbacApi(DEFAULT_CONFIG).rbacRolesCreate({
roleRequest: data, roleRequest: data,
}); });
} }
}
renderForm(): TemplateResult { renderForm(): TemplateResult {
return html`<ak-form-element-horizontal label=${msg("Name")} ?required=${true} name="name"> return html`<ak-form-element-horizontal label=${msg("Name")} ?required=${true} name="name">

View File

@ -32,12 +32,11 @@ export class SCIMSourceForm extends BaseSourceForm<SCIMSource> {
slug: this.instance.slug, slug: this.instance.slug,
patchedSCIMSourceRequest: data, patchedSCIMSourceRequest: data,
}); });
} else { }
return new SourcesApi(DEFAULT_CONFIG).sourcesScimCreate({ return new SourcesApi(DEFAULT_CONFIG).sourcesScimCreate({
sCIMSourceRequest: data as unknown as SCIMSourceRequest, sCIMSourceRequest: data as unknown as SCIMSourceRequest,
}); });
} }
}
renderForm(): TemplateResult { renderForm(): TemplateResult {
return html`<form class="pf-c-form pf-m-horizontal"> return html`<form class="pf-c-form pf-m-horizontal">

View File

@ -33,12 +33,11 @@ export class AuthenticatorDuoStageForm extends BaseStageForm<AuthenticatorDuoSta
stageUuid: this.instance.pk || "", stageUuid: this.instance.pk || "",
patchedAuthenticatorDuoStageRequest: data, patchedAuthenticatorDuoStageRequest: data,
}); });
} else { }
return new StagesApi(DEFAULT_CONFIG).stagesAuthenticatorDuoCreate({ return new StagesApi(DEFAULT_CONFIG).stagesAuthenticatorDuoCreate({
authenticatorDuoStageRequest: data as unknown as AuthenticatorDuoStageRequest, authenticatorDuoStageRequest: data as unknown as AuthenticatorDuoStageRequest,
}); });
} }
}
renderForm(): TemplateResult { renderForm(): TemplateResult {
return html` <span> return html` <span>

View File

@ -39,12 +39,11 @@ export class AuthenticatorEmailStageForm extends BaseStageForm<AuthenticatorEmai
stageUuid: this.instance.pk || "", stageUuid: this.instance.pk || "",
authenticatorEmailStageRequest: data, authenticatorEmailStageRequest: data,
}); });
} else { }
return new StagesApi(DEFAULT_CONFIG).stagesAuthenticatorEmailCreate({ return new StagesApi(DEFAULT_CONFIG).stagesAuthenticatorEmailCreate({
authenticatorEmailStageRequest: data, authenticatorEmailStageRequest: data,
}); });
} }
}
renderConnectionSettings(): TemplateResult { renderConnectionSettings(): TemplateResult {
if (!this.showConnectionSettings) { if (!this.showConnectionSettings) {

View File

@ -27,12 +27,11 @@ export class AuthenticatorEndpointGDTCStageForm extends BaseStageForm<Authentica
stageUuid: this.instance.pk || "", stageUuid: this.instance.pk || "",
patchedAuthenticatorEndpointGDTCStageRequest: data, patchedAuthenticatorEndpointGDTCStageRequest: data,
}); });
} else { }
return new StagesApi(DEFAULT_CONFIG).stagesAuthenticatorEndpointGdtcCreate({ return new StagesApi(DEFAULT_CONFIG).stagesAuthenticatorEndpointGdtcCreate({
authenticatorEndpointGDTCStageRequest: data, authenticatorEndpointGDTCStageRequest: data,
}); });
} }
}
static get styles() { static get styles() {
return super.styles.concat(PFBanner); return super.styles.concat(PFBanner);

View File

@ -50,12 +50,11 @@ export class AuthenticatorSMSStageForm extends BaseStageForm<AuthenticatorSMSSta
stageUuid: this.instance.pk || "", stageUuid: this.instance.pk || "",
authenticatorSMSStageRequest: data, authenticatorSMSStageRequest: data,
}); });
} else { }
return new StagesApi(DEFAULT_CONFIG).stagesAuthenticatorSmsCreate({ return new StagesApi(DEFAULT_CONFIG).stagesAuthenticatorSmsCreate({
authenticatorSMSStageRequest: data, authenticatorSMSStageRequest: data,
}); });
} }
}
renderProviderTwillio(): TemplateResult { renderProviderTwillio(): TemplateResult {
return html` <ak-form-element-horizontal return html` <ak-form-element-horizontal

View File

@ -31,12 +31,11 @@ export class AuthenticatorStaticStageForm extends BaseStageForm<AuthenticatorSta
stageUuid: this.instance.pk || "", stageUuid: this.instance.pk || "",
authenticatorStaticStageRequest: data, authenticatorStaticStageRequest: data,
}); });
} else { }
return new StagesApi(DEFAULT_CONFIG).stagesAuthenticatorStaticCreate({ return new StagesApi(DEFAULT_CONFIG).stagesAuthenticatorStaticCreate({
authenticatorStaticStageRequest: data, authenticatorStaticStageRequest: data,
}); });
} }
}
renderForm(): TemplateResult { renderForm(): TemplateResult {
return html` <span> return html` <span>

View File

@ -33,12 +33,11 @@ export class AuthenticatorTOTPStageForm extends BaseStageForm<AuthenticatorTOTPS
stageUuid: this.instance.pk || "", stageUuid: this.instance.pk || "",
authenticatorTOTPStageRequest: data, authenticatorTOTPStageRequest: data,
}); });
} else { }
return new StagesApi(DEFAULT_CONFIG).stagesAuthenticatorTotpCreate({ return new StagesApi(DEFAULT_CONFIG).stagesAuthenticatorTotpCreate({
authenticatorTOTPStageRequest: data, authenticatorTOTPStageRequest: data,
}); });
} }
}
renderForm(): TemplateResult { renderForm(): TemplateResult {
return html` <span> return html` <span>

View File

@ -57,12 +57,11 @@ export class AuthenticatorValidateStageForm extends BaseStageForm<AuthenticatorV
stageUuid: this.instance.pk || "", stageUuid: this.instance.pk || "",
authenticatorValidateStageRequest: data, authenticatorValidateStageRequest: data,
}); });
} else { }
return new StagesApi(DEFAULT_CONFIG).stagesAuthenticatorValidateCreate({ return new StagesApi(DEFAULT_CONFIG).stagesAuthenticatorValidateCreate({
authenticatorValidateStageRequest: data, authenticatorValidateStageRequest: data,
}); });
} }
}
isDeviceClassSelected(field: DeviceClassesEnum): boolean { isDeviceClassSelected(field: DeviceClassesEnum): boolean {
return ( return (

View File

@ -41,12 +41,11 @@ export class AuthenticatorWebAuthnStageForm extends BaseStageForm<AuthenticatorW
stageUuid: this.instance.pk || "", stageUuid: this.instance.pk || "",
authenticatorWebAuthnStageRequest: data, authenticatorWebAuthnStageRequest: data,
}); });
} else { }
return new StagesApi(DEFAULT_CONFIG).stagesAuthenticatorWebauthnCreate({ return new StagesApi(DEFAULT_CONFIG).stagesAuthenticatorWebauthnCreate({
authenticatorWebAuthnStageRequest: data, authenticatorWebAuthnStageRequest: data,
}); });
} }
}
renderForm(): TemplateResult { renderForm(): TemplateResult {
return html` <span> return html` <span>

View File

@ -26,12 +26,11 @@ export class CaptchaStageForm extends BaseStageForm<CaptchaStage> {
stageUuid: this.instance.pk || "", stageUuid: this.instance.pk || "",
patchedCaptchaStageRequest: data, patchedCaptchaStageRequest: data,
}); });
} else { }
return new StagesApi(DEFAULT_CONFIG).stagesCaptchaCreate({ return new StagesApi(DEFAULT_CONFIG).stagesCaptchaCreate({
captchaStageRequest: data as unknown as CaptchaStageRequest, captchaStageRequest: data as unknown as CaptchaStageRequest,
}); });
} }
}
renderForm(): TemplateResult { renderForm(): TemplateResult {
return html` <span> return html` <span>

View File

@ -33,12 +33,11 @@ export class ConsentStageForm extends BaseStageForm<ConsentStage> {
stageUuid: this.instance.pk || "", stageUuid: this.instance.pk || "",
consentStageRequest: data, consentStageRequest: data,
}); });
} else { }
return new StagesApi(DEFAULT_CONFIG).stagesConsentCreate({ return new StagesApi(DEFAULT_CONFIG).stagesConsentCreate({
consentStageRequest: data, consentStageRequest: data,
}); });
} }
}
renderForm(): TemplateResult { renderForm(): TemplateResult {
return html` <span> return html` <span>

View File

@ -23,12 +23,11 @@ export class DenyStageForm extends BaseStageForm<DenyStage> {
stageUuid: this.instance.pk || "", stageUuid: this.instance.pk || "",
denyStageRequest: data, denyStageRequest: data,
}); });
} else { }
return new StagesApi(DEFAULT_CONFIG).stagesDenyCreate({ return new StagesApi(DEFAULT_CONFIG).stagesDenyCreate({
denyStageRequest: data, denyStageRequest: data,
}); });
} }
}
renderForm(): TemplateResult { renderForm(): TemplateResult {
return html` return html`

View File

@ -23,12 +23,11 @@ export class DummyStageForm extends BaseStageForm<DummyStage> {
stageUuid: this.instance.pk || "", stageUuid: this.instance.pk || "",
dummyStageRequest: data, dummyStageRequest: data,
}); });
} else { }
return new StagesApi(DEFAULT_CONFIG).stagesDummyCreate({ return new StagesApi(DEFAULT_CONFIG).stagesDummyCreate({
dummyStageRequest: data, dummyStageRequest: data,
}); });
} }
}
renderForm(): TemplateResult { renderForm(): TemplateResult {
return html` <span> return html` <span>

View File

@ -36,12 +36,11 @@ export class EmailStageForm extends BaseStageForm<EmailStage> {
stageUuid: this.instance.pk || "", stageUuid: this.instance.pk || "",
patchedEmailStageRequest: data, patchedEmailStageRequest: data,
}); });
} else { }
return new StagesApi(DEFAULT_CONFIG).stagesEmailCreate({ return new StagesApi(DEFAULT_CONFIG).stagesEmailCreate({
emailStageRequest: data, emailStageRequest: data,
}); });
} }
}
renderConnectionSettings(): TemplateResult { renderConnectionSettings(): TemplateResult {
if (!this.showConnectionSettings) { if (!this.showConnectionSettings) {

View File

@ -34,12 +34,11 @@ export class InvitationForm extends ModelForm<Invitation, string> {
inviteUuid: this.instance.pk || "", inviteUuid: this.instance.pk || "",
invitationRequest: data, invitationRequest: data,
}); });
} else { }
return new StagesApi(DEFAULT_CONFIG).stagesInvitationInvitationsCreate({ return new StagesApi(DEFAULT_CONFIG).stagesInvitationInvitationsCreate({
invitationRequest: data, invitationRequest: data,
}); });
} }
}
renderForm(): TemplateResult { renderForm(): TemplateResult {
return html` <ak-form-element-horizontal return html` <ak-form-element-horizontal

View File

@ -23,12 +23,11 @@ export class InvitationStageForm extends BaseStageForm<InvitationStage> {
stageUuid: this.instance.pk || "", stageUuid: this.instance.pk || "",
invitationStageRequest: data, invitationStageRequest: data,
}); });
} else { }
return new StagesApi(DEFAULT_CONFIG).stagesInvitationStagesCreate({ return new StagesApi(DEFAULT_CONFIG).stagesInvitationStagesCreate({
invitationStageRequest: data, invitationStageRequest: data,
}); });
} }
}
renderForm(): TemplateResult { renderForm(): TemplateResult {
return html` <span> return html` <span>

View File

@ -34,12 +34,11 @@ export class PasswordStageForm extends BaseStageForm<PasswordStage> {
stageUuid: this.instance.pk || "", stageUuid: this.instance.pk || "",
passwordStageRequest: data, passwordStageRequest: data,
}); });
} else { }
return new StagesApi(DEFAULT_CONFIG).stagesPasswordCreate({ return new StagesApi(DEFAULT_CONFIG).stagesPasswordCreate({
passwordStageRequest: data, passwordStageRequest: data,
}); });
} }
}
isBackendSelected(field: BackendsEnum): boolean { isBackendSelected(field: BackendsEnum): boolean {
if (!this.instance) { if (!this.instance) {

View File

@ -54,12 +54,11 @@ export class PromptForm extends ModelForm<Prompt, string> {
promptUuid: this.instance.pk || "", promptUuid: this.instance.pk || "",
promptRequest: data, promptRequest: data,
}); });
} else { }
return new StagesApi(DEFAULT_CONFIG).stagesPromptPromptsCreate({ return new StagesApi(DEFAULT_CONFIG).stagesPromptPromptsCreate({
promptRequest: data, promptRequest: data,
}); });
} }
}
async loadInstance(pk: string): Promise<Prompt> { async loadInstance(pk: string): Promise<Prompt> {
const prompt = await new StagesApi(DEFAULT_CONFIG).stagesPromptPromptsRetrieve({ const prompt = await new StagesApi(DEFAULT_CONFIG).stagesPromptPromptsRetrieve({

View File

@ -35,12 +35,11 @@ export class PromptStageForm extends BaseStageForm<PromptStage> {
stageUuid: this.instance.pk || "", stageUuid: this.instance.pk || "",
promptStageRequest: data, promptStageRequest: data,
}); });
} else { }
return new StagesApi(DEFAULT_CONFIG).stagesPromptStagesCreate({ return new StagesApi(DEFAULT_CONFIG).stagesPromptStagesCreate({
promptStageRequest: data, promptStageRequest: data,
}); });
} }
}
renderForm(): TemplateResult { renderForm(): TemplateResult {
return html` <span> return html` <span>

View File

@ -38,12 +38,11 @@ export class RedirectStageForm extends BaseStageForm<RedirectStage> {
stageUuid: this.instance.pk || "", stageUuid: this.instance.pk || "",
redirectStageRequest: data, redirectStageRequest: data,
}); });
} else { }
return new StagesApi(DEFAULT_CONFIG).stagesRedirectCreate({ return new StagesApi(DEFAULT_CONFIG).stagesRedirectCreate({
redirectStageRequest: data, redirectStageRequest: data,
}); });
} }
}
renderForm(): TemplateResult { renderForm(): TemplateResult {
return html`<span> return html`<span>

View File

@ -31,12 +31,11 @@ export class SourceStageForm extends BaseStageForm<SourceStage> {
stageUuid: this.instance.pk || "", stageUuid: this.instance.pk || "",
sourceStageRequest: data, sourceStageRequest: data,
}); });
} else { }
return new StagesApi(DEFAULT_CONFIG).stagesSourceCreate({ return new StagesApi(DEFAULT_CONFIG).stagesSourceCreate({
sourceStageRequest: data, sourceStageRequest: data,
}); });
} }
}
renderForm(): TemplateResult { renderForm(): TemplateResult {
return html` return html`

View File

@ -23,12 +23,11 @@ export class UserDeleteStageForm extends BaseStageForm<UserDeleteStage> {
stageUuid: this.instance.pk || "", stageUuid: this.instance.pk || "",
userDeleteStageRequest: data, userDeleteStageRequest: data,
}); });
} else { }
return new StagesApi(DEFAULT_CONFIG).stagesUserDeleteCreate({ return new StagesApi(DEFAULT_CONFIG).stagesUserDeleteCreate({
userDeleteStageRequest: data, userDeleteStageRequest: data,
}); });
} }
}
renderForm(): TemplateResult { renderForm(): TemplateResult {
return html` <span> return html` <span>

View File

@ -25,12 +25,11 @@ export class UserLoginStageForm extends BaseStageForm<UserLoginStage> {
stageUuid: this.instance.pk || "", stageUuid: this.instance.pk || "",
userLoginStageRequest: data, userLoginStageRequest: data,
}); });
} else { }
return new StagesApi(DEFAULT_CONFIG).stagesUserLoginCreate({ return new StagesApi(DEFAULT_CONFIG).stagesUserLoginCreate({
userLoginStageRequest: data, userLoginStageRequest: data,
}); });
} }
}
renderForm(): TemplateResult { renderForm(): TemplateResult {
return html` <span>${msg("Log the currently pending user in.")}</span> return html` <span>${msg("Log the currently pending user in.")}</span>

View File

@ -23,12 +23,11 @@ export class UserLogoutStageForm extends BaseStageForm<UserLogoutStage> {
stageUuid: this.instance.pk || "", stageUuid: this.instance.pk || "",
userLogoutStageRequest: data, userLogoutStageRequest: data,
}); });
} else { }
return new StagesApi(DEFAULT_CONFIG).stagesUserLogoutCreate({ return new StagesApi(DEFAULT_CONFIG).stagesUserLogoutCreate({
userLogoutStageRequest: data, userLogoutStageRequest: data,
}); });
} }
}
renderForm(): TemplateResult { renderForm(): TemplateResult {
return html` <span>${msg("Remove the user from the current session.")}</span> return html` <span>${msg("Remove the user from the current session.")}</span>

View File

@ -34,12 +34,11 @@ export class UserWriteStageForm extends BaseStageForm<UserWriteStage> {
stageUuid: this.instance.pk || "", stageUuid: this.instance.pk || "",
userWriteStageRequest: data, userWriteStageRequest: data,
}); });
} else { }
return new StagesApi(DEFAULT_CONFIG).stagesUserWriteCreate({ return new StagesApi(DEFAULT_CONFIG).stagesUserWriteCreate({
userWriteStageRequest: data, userWriteStageRequest: data,
}); });
} }
}
renderForm(): TemplateResult { renderForm(): TemplateResult {
return html` <span> return html` <span>

View File

@ -37,12 +37,11 @@ export class TokenForm extends ModelForm<Token, string> {
identifier: this.instance.identifier, identifier: this.instance.identifier,
tokenRequest: data, tokenRequest: data,
}); });
} else { }
return new CoreApi(DEFAULT_CONFIG).coreTokensCreate({ return new CoreApi(DEFAULT_CONFIG).coreTokensCreate({
tokenRequest: data, tokenRequest: data,
}); });
} }
}
renderExpiry(): TemplateResult { renderExpiry(): TemplateResult {
return html`<ak-form-element-horizontal label=${msg("Expires on")} name="expires"> return html`<ak-form-element-horizontal label=${msg("Expires on")} name="expires">

View File

@ -46,13 +46,12 @@ export class UserForm extends ModelForm<User, number> {
getSuccessMessage(): string { getSuccessMessage(): string {
if (this.instance) { if (this.instance) {
return msg("Successfully updated user."); return msg("Successfully updated user.");
} else { }
if (this.group) { if (this.group) {
return msg(str`Successfully created user and added to group ${this.group.name}`); return msg(str`Successfully created user and added to group ${this.group.name}`);
} }
return msg("Successfully created user."); return msg("Successfully created user.");
} }
}
async send(data: User): Promise<User> { async send(data: User): Promise<User> {
if (data.attributes === null) { if (data.attributes === null) {

View File

@ -173,9 +173,8 @@ export class TreeView extends AKElement {
child.parent = item; child.parent = item;
} }
return item; return item;
} else {
return this.createNode(path, parentItem.childItems[idx], level + 1);
} }
return this.createNode(path, parentItem.childItems[idx], level + 1);
} }
parse(data: string[]): TreeViewItem { parse(data: string[]): TreeViewItem {

View File

@ -34,13 +34,12 @@ export class UserTokenForm extends ModelForm<Token, string> {
identifier: this.instance.identifier, identifier: this.instance.identifier,
tokenRequest: data, tokenRequest: data,
}); });
} else { }
data.intent = this.intent; data.intent = this.intent;
return new CoreApi(DEFAULT_CONFIG).coreTokensCreate({ return new CoreApi(DEFAULT_CONFIG).coreTokensCreate({
tokenRequest: data, tokenRequest: data,
}); });
} }
}
renderForm(): TemplateResult { renderForm(): TemplateResult {
const now = new Date(); const now = new Date();