![gcp-cherry-pick-bot[bot]](/assets/img/avatar_default.png) fb78303e8f
			
		
	
	fb78303e8f
	
	
	
		
			
			web/admin: fix notification property mapping forms (#11298) * fix incorrect base class * fix doclink url closes #11276 * fix sidebar order in website --------- Signed-off-by: Jens Langhammer <jens@goauthentik.io> Co-authored-by: Jens L. <jens@goauthentik.io>
		
			
				
	
	
		
			37 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			37 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| import { BasePropertyMappingForm } from "@goauthentik/admin/property-mappings/BasePropertyMappingForm";
 | |
| import { DEFAULT_CONFIG } from "@goauthentik/common/api/config";
 | |
| import "@goauthentik/elements/CodeMirror";
 | |
| import "@goauthentik/elements/forms/HorizontalFormElement";
 | |
| 
 | |
| import { customElement } from "lit/decorators.js";
 | |
| 
 | |
| import { NotificationWebhookMapping, PropertymappingsApi } from "@goauthentik/api";
 | |
| 
 | |
| @customElement("ak-property-mapping-notification-form")
 | |
| export class PropertyMappingNotification extends BasePropertyMappingForm<NotificationWebhookMapping> {
 | |
|     loadInstance(pk: string): Promise<NotificationWebhookMapping> {
 | |
|         return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsNotificationRetrieve({
 | |
|             pmUuid: pk,
 | |
|         });
 | |
|     }
 | |
| 
 | |
|     async send(data: NotificationWebhookMapping): Promise<NotificationWebhookMapping> {
 | |
|         if (this.instance) {
 | |
|             return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsNotificationUpdate({
 | |
|                 pmUuid: this.instance.pk,
 | |
|                 notificationWebhookMappingRequest: data,
 | |
|             });
 | |
|         } else {
 | |
|             return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsNotificationCreate({
 | |
|                 notificationWebhookMappingRequest: data,
 | |
|             });
 | |
|         }
 | |
|     }
 | |
| }
 | |
| 
 | |
| declare global {
 | |
|     interface HTMLElementTagNameMap {
 | |
|         "ak-property-mapping-notification-form": PropertyMappingNotification;
 | |
|     }
 | |
| }
 |