web/admin: always override send method instead of assigning (#5426)

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
Jens L
2023-04-30 19:55:29 +03:00
committed by GitHub
parent bb8b87fcb3
commit fef841a458
66 changed files with 137 additions and 138 deletions

View File

@ -28,7 +28,7 @@ export class PropertyMappingLDAPForm extends ModelForm<LDAPPropertyMapping, stri
}
}
send = (data: LDAPPropertyMapping): Promise<LDAPPropertyMapping> => {
async send(data: LDAPPropertyMapping): Promise<LDAPPropertyMapping> {
if (this.instance) {
return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsLdapUpdate({
pmUuid: this.instance.pk || "",
@ -39,7 +39,7 @@ export class PropertyMappingLDAPForm extends ModelForm<LDAPPropertyMapping, stri
lDAPPropertyMappingRequest: data,
});
}
};
}
renderForm(): TemplateResult {
return html`<form class="pf-c-form pf-m-horizontal">

View File

@ -28,7 +28,7 @@ export class PropertyMappingNotification extends ModelForm<NotificationWebhookMa
}
}
send = (data: NotificationWebhookMapping): Promise<NotificationWebhookMapping> => {
async send(data: NotificationWebhookMapping): Promise<NotificationWebhookMapping> {
if (this.instance) {
return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsNotificationUpdate({
pmUuid: this.instance.pk || "",
@ -39,7 +39,7 @@ export class PropertyMappingNotification extends ModelForm<NotificationWebhookMa
notificationWebhookMappingRequest: data,
});
}
};
}
renderForm(): TemplateResult {
return html`<form class="pf-c-form pf-m-horizontal">

View File

@ -28,7 +28,7 @@ export class PropertyMappingSAMLForm extends ModelForm<SAMLPropertyMapping, stri
}
}
send = (data: SAMLPropertyMapping): Promise<SAMLPropertyMapping> => {
async send(data: SAMLPropertyMapping): Promise<SAMLPropertyMapping> {
if (this.instance) {
return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsSamlUpdate({
pmUuid: this.instance.pk || "",
@ -39,7 +39,7 @@ export class PropertyMappingSAMLForm extends ModelForm<SAMLPropertyMapping, stri
sAMLPropertyMappingRequest: data,
});
}
};
}
renderForm(): TemplateResult {
return html`<form class="pf-c-form pf-m-horizontal">

View File

@ -28,7 +28,7 @@ export class PropertyMappingSCIMForm extends ModelForm<SCIMMapping, string> {
}
}
send = (data: SCIMMapping): Promise<SCIMMapping> => {
async send(data: SCIMMapping): Promise<SCIMMapping> {
if (this.instance) {
return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsScimUpdate({
pmUuid: this.instance.pk || "",
@ -39,7 +39,7 @@ export class PropertyMappingSCIMForm extends ModelForm<SCIMMapping, string> {
sCIMMappingRequest: data,
});
}
};
}
renderForm(): TemplateResult {
return html`<form class="pf-c-form pf-m-horizontal">

View File

@ -28,7 +28,7 @@ export class PropertyMappingScopeForm extends ModelForm<ScopeMapping, string> {
}
}
send = (data: ScopeMapping): Promise<ScopeMapping> => {
async send(data: ScopeMapping): Promise<ScopeMapping> {
if (this.instance) {
return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsScopeUpdate({
pmUuid: this.instance.pk || "",
@ -39,7 +39,7 @@ export class PropertyMappingScopeForm extends ModelForm<ScopeMapping, string> {
scopeMappingRequest: data,
});
}
};
}
renderForm(): TemplateResult {
return html`<form class="pf-c-form pf-m-horizontal">

View File

@ -37,7 +37,7 @@ export class PolicyTestForm extends Form<PolicyTestRequest> {
return t`Successfully sent test-request.`;
}
send = async (data: PolicyTestRequest): Promise<PropertyMappingTestResult> => {
async send(data: PolicyTestRequest): Promise<PropertyMappingTestResult> {
this.request = data;
const result = await new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsAllTestCreate({
pmUuid: this.mapping?.pk || "",
@ -45,7 +45,7 @@ export class PolicyTestForm extends Form<PolicyTestRequest> {
formatResult: true,
});
return (this.result = result);
};
}
renderResult(): TemplateResult {
return html`<ak-form-element-horizontal label=${t`Result`}>