Skip to content
Snippets Groups Projects
Commit b8c3c3fa authored by kbeyro's avatar kbeyro
Browse files

Update remove button logic

parent 105963ed
No related branches found
No related tags found
2 merge requests!108Develop,!68Update remove button logic
<app-bulk-list [header]="'BULK.APP.HEADER'" [bulks]="bulks" [mode]="mode"></app-bulk-list> <app-bulk-list [header]="'BULK.APP.HEADER'" [bulks]="bulks" [mode]="mode" (refresh)="onRefresh()"></app-bulk-list>
...@@ -20,6 +20,10 @@ export class BulkAppListComponent implements OnInit { ...@@ -20,6 +20,10 @@ export class BulkAppListComponent implements OnInit {
} }
ngOnInit(): void { ngOnInit(): void {
this.onRefresh();
}
onRefresh() : void {
if (this.authService.getRoles().find(value => value === 'ROLE_VL_MANAGER') !== undefined) { if (this.authService.getRoles().find(value => value === 'ROLE_VL_MANAGER') !== undefined) {
this.deployService.getBulksAppDeploymentsOwner().subscribe(data => { this.deployService.getBulksAppDeploymentsOwner().subscribe(data => {
data = data.sort((a, b) => new Date(b.creationDate).getTime() - new Date(a.creationDate).getTime()) data = data.sort((a, b) => new Date(b.creationDate).getTime() - new Date(a.creationDate).getTime())
...@@ -32,4 +36,4 @@ export class BulkAppListComponent implements OnInit { ...@@ -32,4 +36,4 @@ export class BulkAppListComponent implements OnInit {
}); });
} }
} }
} }
import {Component, Input, QueryList, ViewChild, ViewChildren} from '@angular/core'; import {Component, EventEmitter, Input, Output, QueryList, ViewChild, ViewChildren} from '@angular/core';
import {BulkDeployment} from '../../../model/bulk-deployment'; import {BulkDeployment} from '../../../model/bulk-deployment';
import {BulkType} from '../../../model/bulk-response'; import {BulkType} from '../../../model/bulk-response';
import {SortableHeaderDirective} from '../../../service/sort-domain.directive'; import {SortableHeaderDirective} from '../../../service/sort-domain.directive';
...@@ -32,6 +32,9 @@ export class BulkListComponent { ...@@ -32,6 +32,9 @@ export class BulkListComponent {
@ViewChild(ModalComponent, {static: true}) @ViewChild(ModalComponent, {static: true})
public readonly modal: ModalComponent; public readonly modal: ModalComponent;
@Output()
public refresh: EventEmitter<boolean> = new EventEmitter<boolean>();
public readonly bulkTypeDomain = BulkType.DOMAIN; public readonly bulkTypeDomain = BulkType.DOMAIN;
public readonly bulkTypeApp = BulkType.APPLICATION; public readonly bulkTypeApp = BulkType.APPLICATION;
...@@ -151,8 +154,13 @@ export class BulkListComponent { ...@@ -151,8 +154,13 @@ export class BulkListComponent {
public removeBulk(): void { public removeBulk(): void {
this.appDeploy.removeBulkDeployment(this.removeBulkId, this.removeAll).subscribe(_ => { this.appDeploy.removeBulkDeployment(this.removeBulkId, this.removeAll).subscribe(_ => {
console.log("Bulk removed") this.refreshBulks();
this.modal.hide();
}) })
this.removeAll = false; this.removeAll = false;
} }
public refreshBulks(): void {
this.refresh.emit(true);
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment