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

Merge branch '239-update-bulk-view-details' into 'release/1.6.5'

Resolve "Update bulk view details"

See merge request !53
parents 53522d69 31a164d2
No related branches found
No related tags found
3 merge requests!57Develop,!55Resolve "Merge 1.6.5 to develop",!53Resolve "Update bulk view details"
...@@ -13,10 +13,10 @@ ...@@ -13,10 +13,10 @@
<h4>{{'BULK.APP.PARALLEL' | translate}}</h4> <h4>{{'BULK.APP.PARALLEL' | translate}}</h4>
</div> </div>
<div style="margin-top: 3rem;"> <div style="margin-top: 3rem;">
<input type="number" pInputText [(ngModel)]="parallelDeploymentsLimit" [max]="limitFromConfiguration" [min]="1" (ngModelChange)="onKeyPress($event)" > <input pInputText type="number" inputId="minmax" mode="decimal" ngDefaultControl [(ngModel)]="parallelDeploymentsLimit" [max]="limitFromConfiguration" [min]="1" />
</div> </div>
<div class="row .navbar-right" style="margin-top: 3rem; display: flex; justify-content: right"> <div class="row .navbar-right" style="margin-top: 3rem; display: flex; justify-content: right">
<button class="btn btn-primary" (click)="selectApp()"> {{'BULK.LIST.CONTINUE' | translate}}</button> <button class="btn btn-primary" [disabled]="selectApp?.name === null || parallelDeploymentsLimit < 1 || parallelDeploymentsLimit > limitFromConfiguration" (click)="selectApp()"> {{'BULK.LIST.CONTINUE' | translate}}</button>
</div> </div>
</div> </div>
...@@ -3,6 +3,7 @@ import {ApplicationBase} from '../../../../model/application-base'; ...@@ -3,6 +3,7 @@ import {ApplicationBase} from '../../../../model/application-base';
import {AppsService, ConfigurationService} from '../../../../service'; import {AppsService, ConfigurationService} from '../../../../service';
import {AppdeploymentService} from '../../appdeployment.service'; import {AppdeploymentService} from '../../appdeployment.service';
import {Router} from '@angular/router'; import {Router} from '@angular/router';
import { FormControl, FormGroup } from '@angular/forms';
@Component({ @Component({
selector: 'app-appselection', selector: 'app-appselection',
...@@ -15,14 +16,17 @@ export class AppdeploymentComponent implements OnInit { ...@@ -15,14 +16,17 @@ export class AppdeploymentComponent implements OnInit {
public selectedApp: ApplicationBase = null; public selectedApp: ApplicationBase = null;
public parallelDeploymentsLimit = 0; public parallelDeploymentsLimit = 1;
public limitFromConfiguration = 50; public limitFromConfiguration = 50;
myGroup : FormGroup;
constructor(private readonly appService: AppsService, constructor(private readonly appService: AppsService,
private readonly deployService: AppdeploymentService, private readonly deployService: AppdeploymentService,
private router: Router, private router: Router,
private readonly configuration: ConfigurationService) { } private readonly configuration: ConfigurationService) { }
ngOnInit(): void { ngOnInit(): void {
this.appService.getAllActiveApplicationBase().subscribe(data => { this.appService.getAllActiveApplicationBase().subscribe(data => {
data.sort((a, b) => a.name.toLowerCase() > b.name.toLowerCase() ? 1 : -1); data.sort((a, b) => a.name.toLowerCase() > b.name.toLowerCase() ? 1 : -1);
...@@ -31,6 +35,7 @@ export class AppdeploymentComponent implements OnInit { ...@@ -31,6 +35,7 @@ export class AppdeploymentComponent implements OnInit {
this.configuration.getConfiguration().subscribe(configuration => { this.configuration.getConfiguration().subscribe(configuration => {
this.limitFromConfiguration = configuration.parallelDeploymentsLimit; this.limitFromConfiguration = configuration.parallelDeploymentsLimit;
console.log("Limit from config", this.limitFromConfiguration) console.log("Limit from config", this.limitFromConfiguration)
this.parallelDeploymentsLimit = configuration.parallelDeploymentsLimit;
}) })
} }
...@@ -38,7 +43,11 @@ export class AppdeploymentComponent implements OnInit { ...@@ -38,7 +43,11 @@ export class AppdeploymentComponent implements OnInit {
public onKeyPress(event) { public onKeyPress(event) {
console.log(event); console.log(event);
if(event > this.limitFromConfiguration) { if(event < 1) {
this.parallelDeploymentsLimit = 1;
console.log("Changing limit to ", this.parallelDeploymentsLimit )
}
if(event > this.limitFromConfiguration ) {
console.log("Changing limit to ", this.limitFromConfiguration) console.log("Changing limit to ", this.limitFromConfiguration)
this.parallelDeploymentsLimit = this.limitFromConfiguration; this.parallelDeploymentsLimit = this.limitFromConfiguration;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment