Skip to content
Snippets Groups Projects
Commit ef520faa authored by Lukasz Lopatowski's avatar Lukasz Lopatowski
Browse files

Merge branch 'Fix-removed-button' into 'develop'

Update remove button logic

See merge request !68
parents 57fe1bb7 b8c3c3fa
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 {
}
ngOnInit(): void {
this.onRefresh();
}
onRefresh() : void {
if (this.authService.getRoles().find(value => value === 'ROLE_VL_MANAGER') !== undefined) {
this.deployService.getBulksAppDeploymentsOwner().subscribe(data => {
data = data.sort((a, b) => new Date(b.creationDate).getTime() - new Date(a.creationDate).getTime())
......@@ -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 {BulkType} from '../../../model/bulk-response';
import {SortableHeaderDirective} from '../../../service/sort-domain.directive';
......@@ -32,6 +32,9 @@ export class BulkListComponent {
@ViewChild(ModalComponent, {static: true})
public readonly modal: ModalComponent;
@Output()
public refresh: EventEmitter<boolean> = new EventEmitter<boolean>();
public readonly bulkTypeDomain = BulkType.DOMAIN;
public readonly bulkTypeApp = BulkType.APPLICATION;
......@@ -151,8 +154,13 @@ export class BulkListComponent {
public removeBulk(): void {
this.appDeploy.removeBulkDeployment(this.removeBulkId, this.removeAll).subscribe(_ => {
console.log("Bulk removed")
this.refreshBulks();
this.modal.hide();
})
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