web: expressing success (#7830)
* web: expressing success Ever see an idiom that just, I dunno, *annoyed* you? Automated tools for the win. * web: repetition, repetition, repetition! [throws chair] * web: giving the de-duplication treatment to policy mappings. * Created a BaseStageForm with success message and canonical primary key type for for Providers, Sources, and Stages.
This commit is contained in:
@ -1,10 +1,10 @@
|
||||
import "@goauthentik/admin/common/ak-crypto-certificate-search";
|
||||
import { placeholderHelperText } from "@goauthentik/admin/helperText";
|
||||
import { BaseSourceForm } from "@goauthentik/admin/sources/BaseSourceForm";
|
||||
import { DEFAULT_CONFIG } from "@goauthentik/common/api/config";
|
||||
import { first } from "@goauthentik/common/utils";
|
||||
import "@goauthentik/elements/forms/FormGroup";
|
||||
import "@goauthentik/elements/forms/HorizontalFormElement";
|
||||
import { ModelForm } from "@goauthentik/elements/forms/ModelForm";
|
||||
import "@goauthentik/elements/forms/SearchSelect";
|
||||
|
||||
import { msg } from "@lit/localize";
|
||||
@ -24,7 +24,7 @@ import {
|
||||
} from "@goauthentik/api";
|
||||
|
||||
@customElement("ak-source-ldap-form")
|
||||
export class LDAPSourceForm extends ModelForm<LDAPSource, string> {
|
||||
export class LDAPSourceForm extends BaseSourceForm<LDAPSource> {
|
||||
loadInstance(pk: string): Promise<LDAPSource> {
|
||||
return new SourcesApi(DEFAULT_CONFIG).sourcesLdapRetrieve({
|
||||
slug: pk,
|
||||
@ -41,14 +41,6 @@ export class LDAPSourceForm extends ModelForm<LDAPSource, string> {
|
||||
|
||||
propertyMappings?: PaginatedLDAPPropertyMappingList;
|
||||
|
||||
getSuccessMessage(): string {
|
||||
if (this.instance) {
|
||||
return msg("Successfully updated source.");
|
||||
} else {
|
||||
return msg("Successfully created source.");
|
||||
}
|
||||
}
|
||||
|
||||
async send(data: LDAPSource): Promise<LDAPSource> {
|
||||
if (this.instance) {
|
||||
return new SourcesApi(DEFAULT_CONFIG).sourcesLdapPartialUpdate({
|
||||
|
||||
Reference in New Issue
Block a user