diff --git a/src/app/appmarket/bulkDeployment/appDeployment/appSelection/appdeployment.component.html b/src/app/appmarket/bulkDeployment/appDeployment/appSelection/appdeployment.component.html index 45918f90b0bcfd91a4a826610ba347184a369133..2dcb31a8716d02e8016c06b0e47b9c997065a2fa 100644 --- a/src/app/appmarket/bulkDeployment/appDeployment/appSelection/appdeployment.component.html +++ b/src/app/appmarket/bulkDeployment/appDeployment/appSelection/appdeployment.component.html @@ -13,10 +13,10 @@ <h4>{{'BULK.APP.PARALLEL' | translate}}</h4> </div> <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 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> diff --git a/src/app/appmarket/bulkDeployment/appDeployment/appSelection/appdeployment.component.ts b/src/app/appmarket/bulkDeployment/appDeployment/appSelection/appdeployment.component.ts index e7c93ac3d68250de369c90c191744ba8e4b7df63..1abb283aa2f96e0124d324c47bdf9fa551b7921b 100644 --- a/src/app/appmarket/bulkDeployment/appDeployment/appSelection/appdeployment.component.ts +++ b/src/app/appmarket/bulkDeployment/appDeployment/appSelection/appdeployment.component.ts @@ -3,6 +3,7 @@ import {ApplicationBase} from '../../../../model/application-base'; import {AppsService, ConfigurationService} from '../../../../service'; import {AppdeploymentService} from '../../appdeployment.service'; import {Router} from '@angular/router'; +import { FormControl, FormGroup } from '@angular/forms'; @Component({ selector: 'app-appselection', @@ -15,14 +16,17 @@ export class AppdeploymentComponent implements OnInit { public selectedApp: ApplicationBase = null; - public parallelDeploymentsLimit = 0; + public parallelDeploymentsLimit = 1; public limitFromConfiguration = 50; + myGroup : FormGroup; + constructor(private readonly appService: AppsService, private readonly deployService: AppdeploymentService, private router: Router, private readonly configuration: ConfigurationService) { } + ngOnInit(): void { this.appService.getAllActiveApplicationBase().subscribe(data => { data.sort((a, b) => a.name.toLowerCase() > b.name.toLowerCase() ? 1 : -1); @@ -31,6 +35,7 @@ export class AppdeploymentComponent implements OnInit { this.configuration.getConfiguration().subscribe(configuration => { this.limitFromConfiguration = configuration.parallelDeploymentsLimit; console.log("Limit from config", this.limitFromConfiguration) + this.parallelDeploymentsLimit = configuration.parallelDeploymentsLimit; }) } @@ -38,7 +43,11 @@ export class AppdeploymentComponent implements OnInit { public onKeyPress(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) this.parallelDeploymentsLimit = this.limitFromConfiguration; }