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

webhook

parent d099fc34
Branches
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="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]"
......
......@@ -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)
);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment