Skip to content
Snippets Groups Projects
Commit c8bac178 authored by Joanna Kaźmierczak's avatar Joanna Kaźmierczak
Browse files

webhook

parent d099fc34
No related branches found
No related tags found
1 merge request!190Resolve "Improve new layout"
<h4 class="header">{{ 'WEBHOOKS.TITLE' | translate }}</h4>
<div style="display: flex; align-items: center; margin-top:20px"> <div style="display: flex; align-items: center; margin-top:20px">
<div style="margin-right:20px"> <div style=" display:flex; align-items: center;">
<div > <div style="margin-right:20px">
<button class="btn btn-primary" (click)="openModal()">{{'WEBHOOKS.NEW' | translate}}</button> <button class="btn btn-primary" (click)="openModal()">{{'WEBHOOKS.NEW' | translate}}</button>
</div> </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>
<div class="flex" style="margin-right:20px"> <div class="flex" style="margin-right:20px">
</div> </div>
</div> </div>
<h4 class="header">{{ 'WEBHOOKS.TITLE' | translate }}</h4>
<div class="background-section"> <div class="background-section">
<p-table <p-table
[value]="webkooks" [value]="filteredWebhooks"
[paginator]="true" [paginator]="true"
[rows]="maxItemsOnPage" [rows]="maxItemsOnPage"
[rowsPerPageOptions]="[15, 20, 25, 30, 50]" [rowsPerPageOptions]="[15, 20, 25, 30, 50]"
......
...@@ -14,11 +14,13 @@ export class WebhookListComponent implements OnInit { ...@@ -14,11 +14,13 @@ export class WebhookListComponent implements OnInit {
public addedWebhook: Webhook = new Webhook(); public addedWebhook: Webhook = new Webhook();
public maxItemsOnPage = 15; public maxItemsOnPage = 15;
public searchValue = '';
filteredWebhooks: Webhook[] = [];
public authRequired: boolean = false; public authRequired: boolean = false;
public type =[ public type = [
{ name: "DOMAIN_CREATION", value: "DOMAIN_CREATION" }, { name: "DOMAIN_CREATION", value: "DOMAIN_CREATION" },
{ name: "APPLICATION_DEPLOYMENT", value: "APPLICATION_DEPLOYMENT" }, { name: "APPLICATION_DEPLOYMENT", value: "APPLICATION_DEPLOYMENT" },
{ name: "USER_ASSIGNMENT", value: "USER_ASSIGNMENT" }, { name: "USER_ASSIGNMENT", value: "USER_ASSIGNMENT" },
{ name: "DOMAIN_GROUP_CHANGE", value: "DOMAIN_GROUP_CHANGE" } { name: "DOMAIN_GROUP_CHANGE", value: "DOMAIN_GROUP_CHANGE" }
...@@ -29,7 +31,7 @@ export class WebhookListComponent implements OnInit { ...@@ -29,7 +31,7 @@ export class WebhookListComponent implements OnInit {
constructor(private service: WebhookService) { constructor(private service: WebhookService) {
} }
ngOnInit() { ngOnInit() {
this.refreshList(); this.refreshList();
...@@ -38,6 +40,7 @@ export class WebhookListComponent implements OnInit { ...@@ -38,6 +40,7 @@ export class WebhookListComponent implements OnInit {
public refreshList() { public refreshList() {
this.service.getAll().subscribe(result => { this.service.getAll().subscribe(result => {
this.webkooks = result; this.webkooks = result;
this.filterWebhooks()
}) })
} }
...@@ -56,7 +59,13 @@ export class WebhookListComponent implements OnInit { ...@@ -56,7 +59,13 @@ export class WebhookListComponent implements OnInit {
this.modal.hide(); this.modal.hide();
this.refreshList(); this.refreshList();
}); });
} }
filterWebhooks() {
const value = this.searchValue?.toLowerCase() || '';
this.filteredWebhooks = this.webkooks.filter(webhook =>
webhook.name?.toLowerCase().includes(value) ||
webhook.id?.toString().includes(value)
);
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment