From c8bac178c467448c05994cf291f901909835c26c Mon Sep 17 00:00:00 2001 From: jkazmierczak <jkazmierczak@man.poznan.pl> Date: Thu, 22 May 2025 14:47:50 +0200 Subject: [PATCH] webhook --- .../webhook-list/webhook-list.component.html | 13 +++++++++---- .../webhook-list/webhook-list.component.ts | 17 +++++++++++++---- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/app/appmarket/admin/webhook/webhook-list/webhook-list.component.html b/src/app/appmarket/admin/webhook/webhook-list/webhook-list.component.html index 8158c52a..677a5006 100644 --- a/src/app/appmarket/admin/webhook/webhook-list/webhook-list.component.html +++ b/src/app/appmarket/admin/webhook/webhook-list/webhook-list.component.html @@ -1,19 +1,24 @@ +<h4 class="header">{{ 'WEBHOOKS.TITLE' | translate }}</h4> <div style="display: flex; align-items: center; margin-top:20px"> - <div style="margin-right:20px"> - <div > + <div style=" display:flex; align-items: center;"> + <div style="margin-right:20px"> <button class="btn btn-primary" (click)="openModal()">{{'WEBHOOKS.NEW' | translate}}</button> </div> + <span class="p-input-icon-right"> + <i class="pi pi-search" style="font-size: 13px; top: 16px; margin-right: 5px;"></i> + <input pInputText class="form-control" name="search" id="search" + placeholder="Search" type="text" [(ngModel)]="searchValue" (ngModelChange)="filterWebhooks()"> + </span> </div> <div class="flex" style="margin-right:20px"> </div> </div> - <h4 class="header">{{ 'WEBHOOKS.TITLE' | translate }}</h4> <div class="background-section"> <p-table - [value]="webkooks" + [value]="filteredWebhooks" [paginator]="true" [rows]="maxItemsOnPage" [rowsPerPageOptions]="[15, 20, 25, 30, 50]" diff --git a/src/app/appmarket/admin/webhook/webhook-list/webhook-list.component.ts b/src/app/appmarket/admin/webhook/webhook-list/webhook-list.component.ts index 63500136..4710b7e5 100644 --- a/src/app/appmarket/admin/webhook/webhook-list/webhook-list.component.ts +++ b/src/app/appmarket/admin/webhook/webhook-list/webhook-list.component.ts @@ -14,11 +14,13 @@ export class WebhookListComponent implements OnInit { public addedWebhook: Webhook = new Webhook(); public maxItemsOnPage = 15; + public searchValue = ''; + filteredWebhooks: Webhook[] = []; public authRequired: boolean = false; - public type =[ - { name: "DOMAIN_CREATION", value: "DOMAIN_CREATION" }, + public type = [ + { name: "DOMAIN_CREATION", value: "DOMAIN_CREATION" }, { name: "APPLICATION_DEPLOYMENT", value: "APPLICATION_DEPLOYMENT" }, { name: "USER_ASSIGNMENT", value: "USER_ASSIGNMENT" }, { name: "DOMAIN_GROUP_CHANGE", value: "DOMAIN_GROUP_CHANGE" } @@ -29,7 +31,7 @@ export class WebhookListComponent implements OnInit { constructor(private service: WebhookService) { - } + } ngOnInit() { this.refreshList(); @@ -38,6 +40,7 @@ export class WebhookListComponent implements OnInit { public refreshList() { this.service.getAll().subscribe(result => { this.webkooks = result; + this.filterWebhooks() }) } @@ -56,7 +59,13 @@ export class WebhookListComponent implements OnInit { this.modal.hide(); this.refreshList(); }); - } + filterWebhooks() { + const value = this.searchValue?.toLowerCase() || ''; + this.filteredWebhooks = this.webkooks.filter(webhook => + webhook.name?.toLowerCase().includes(value) || + webhook.id?.toString().includes(value) + ); + } } -- GitLab