Commit 3fcf728c authored by Jan Marchel's avatar Jan Marchel
Browse files

problem with finding nodes

parent ed156508
Pipeline #16006 failed with stages
in 5 minutes and 54 seconds
......@@ -25,6 +25,7 @@ build-ui-docker:
- feature-byon-proactive-support
- feature-mor-20-dev
- undeploy_button
- no_node_candidates_found
image: docker:19.03.1
services:
- docker:19.03.1-dind
......
......@@ -11,11 +11,13 @@ import {CpSolutionViewComponent} from '../cp-solution-view/cp-solution-view.comp
import {CpVariablesViewComponent} from '../cp-variables-view/cp-variables-view.component';
import {DeploymentDifferenceComponent} from '../deployment-difference/deployment-difference.component';
import {AppConfigService} from '../../app-config/service/app-config.service';
import {ConfirmationDialogComponent} from "../../common-template/confirmation-dialog/confirmation-dialog.component";
@Component({
selector: 'app-process-view',
templateUrl: './process-view.component.html',
styleUrls: ['../../app.component.css', './process-view.component.css']
styleUrls: ['../../app.component.css', './process-view.component.css'].
})
export class ProcessViewComponent implements OnInit, AfterViewInit, OnDestroy {
......@@ -23,6 +25,7 @@ export class ProcessViewComponent implements OnInit, AfterViewInit, OnDestroy {
@ViewChild(CpVariablesViewComponent) cpVariablesViewComponent: CpVariablesViewComponent;
@ViewChild(DeploymentDifferenceComponent) deploymentDifferenceComponent: DeploymentDifferenceComponent;
apiUrl = `${AppConfigService.settings.apiUrl}/auth/environment`;
currentProcessVariables: ProcessVariables;
deploymentCompleted = false;
stopMonitoring = false;
......@@ -30,9 +33,11 @@ export class ProcessViewComponent implements OnInit, AfterViewInit, OnDestroy {
existingProcess: boolean;
processListDialog: MatDialogRef<ActiveProcessListComponent>;
totalNumberOffers = 0;
static counter = 0;
initialCheckingFetchingOffersState = true;
narrowWindowOnLastCheck = false;
loadingNumberOfOffersInProgress = false;
confirmationDialog: MatDialogRef<ConfirmationDialogComponent>;
constructor(private route: ActivatedRoute,
private router: Router,
......@@ -135,6 +140,17 @@ export class ProcessViewComponent implements OnInit, AfterViewInit, OnDestroy {
this.router.navigate(['/process/details/deployment']);
}
createConfirmationDialog(): MatDialogRef<ConfirmationDialogComponent> {
return this.dialog.open(ConfirmationDialogComponent, {
hasBackdrop: false,
data: {
title: 'Problem with finding Nodes',
message: `Do you want to stop process and change providers settings?`
},
width: '30%'
});
}
monitorProcess() {
this.processService.getInformationAboutProcess(localStorage.getItem('processId'))
.subscribe(value => {
......@@ -302,6 +318,13 @@ export class ProcessViewComponent implements OnInit, AfterViewInit, OnDestroy {
}
}
isProblemWithFindingNodes(): boolean {
if (this.counter === 7) {
return true;
}
return false;
}
getNumberOfColsForWideWindow(): number {
if (this.isReconfigurationProcess()) {
return 3;
......@@ -359,6 +382,8 @@ export class ProcessViewComponent implements OnInit, AfterViewInit, OnDestroy {
|| this.totalNumberOffers === 0)) {
this.loadingNumberOfOffersInProgress = true;
this.processService.getTotalOffersNumber().subscribe(value => {
if (this.isProblemWithFindingNodes()) this.openProblemWithFindingNodesDialog(this.currentProcessVariables.applicationId);
this.counter += 1;
this.totalNumberOffers = value;
this.loadingNumberOfOffersInProgress = false;
},
......@@ -398,4 +423,31 @@ export class ProcessViewComponent implements OnInit, AfterViewInit, OnDestroy {
this.deploymentDifferenceComponent.differenceAfterDeploymentDownloaded = true;
}
}
private openProblemWithFindingNodesDialog(applicationId: string) {
this.confirmationDialog = this.createConfirmationDialog();
this.processListDialog = this.dialog.open(ConfirmationDialogComponent, {
hasBackdrop: false,
data: {
activeProcess: applicationId
},
});
this.confirmationDialog.afterClosed().subscribe(value => {
if (value) {
console.log(`Confirmed deletion of process`);
this.deleteProcess(applicationId);
} else {
console.log(`Cancel deletion of process `);
}
});
}
deleteProcess(applicationId): Observable<{}> {
const url = `${this.apiUrl}/{processId}`;
return this.http.delete(url, httpOptions, applicationId).pipe(
tap(() => console.log('Process deletion started.'),
e => console.error(`Error by deletion of process: `, e))
);
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment