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 8158c52a0252fe096e268b2f7036dfda7f05a424..677a5006c29f1b09b63dd1421c5b9cd44d9d1f25 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 63500136dd4095e6f6474f4bb86338b56d05322c..4710b7e5fd5b3fea959499bf4d22fbe59fb99b0d 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) + ); + } }