Commit 861ad9c2 authored by Marta Różańska's avatar Marta Różańska
Browse files

Merge branch 'no_node_candidates_found' into 'morphemic-rc1.5'

No node candidates found

See merge request !17
parents ed156508 7e9b6d83
Pipeline #16335 passed with stage
in 5 minutes and 48 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
......
This diff is collapsed.
......@@ -26,7 +26,7 @@
"hammerjs": "^2.0.8",
"ng-block-ui": "^2.1.8",
"rxjs": "~6.3.3",
"tslib": "^1.9.0",
"tslib": "^1.14.1",
"zone.js": "~0.8.26"
},
"devDependencies": {
......
......@@ -11,6 +11,14 @@ 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';
import {Observable} from 'rxjs';
import {tap} from 'rxjs/operators';
import {HttpClient, HttpHeaders} from '@angular/common/http';
const httpOptions = {
headers: new HttpHeaders({'Content-Type': 'application/json'})
};
@Component({
selector: 'app-process-view',
......@@ -23,6 +31,7 @@ export class ProcessViewComponent implements OnInit, AfterViewInit, OnDestroy {
@ViewChild(CpVariablesViewComponent) cpVariablesViewComponent: CpVariablesViewComponent;
@ViewChild(DeploymentDifferenceComponent) deploymentDifferenceComponent: DeploymentDifferenceComponent;
apiUrl = `${AppConfigService.settings.apiUrl}/auth/process`;
currentProcessVariables: ProcessVariables;
deploymentCompleted = false;
stopMonitoring = false;
......@@ -30,11 +39,14 @@ export class ProcessViewComponent implements OnInit, AfterViewInit, OnDestroy {
existingProcess: boolean;
processListDialog: MatDialogRef<ActiveProcessListComponent>;
totalNumberOffers = 0;
counter = 0;
initialCheckingFetchingOffersState = true;
narrowWindowOnLastCheck = false;
loadingNumberOfOffersInProgress = false;
confirmationDialog: MatDialogRef<ConfirmationDialogComponent>;
constructor(private route: ActivatedRoute,
private http: HttpClient,
private router: Router,
private processService: ProcessService,
private processHelperService: ProcessHelperService,
......@@ -135,6 +147,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 +325,10 @@ export class ProcessViewComponent implements OnInit, AfterViewInit, OnDestroy {
}
}
isProblemWithFindingNodes(): boolean {
return this.counter === 6;
}
getNumberOfColsForWideWindow(): number {
if (this.isReconfigurationProcess()) {
return 3;
......@@ -359,6 +386,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 +427,24 @@ export class ProcessViewComponent implements OnInit, AfterViewInit, OnDestroy {
this.deploymentDifferenceComponent.differenceAfterDeploymentDownloaded = true;
}
}
private openProblemWithFindingNodesDialog(applicationId: string) {
this.confirmationDialog = this.dialog.open(ConfirmationDialogComponent, {
hasBackdrop: false,
data: {
activeProcess: applicationId,
title: 'Problem with finding Nodes',
message: `Do you want to stop process and change providers settings?`
},
});
this.confirmationDialog.afterClosed().subscribe(value => {
if (value) {
console.log(`Confirmed deletion of process`);
this.processService.deleteProcess(localStorage.getItem('processId'));
} else {
console.log(`Cancel deletion of process`);
}
});
}
}
......@@ -65,4 +65,11 @@ export class ProcessService {
e => console.log(`Error by getting deployment difference:`, e))
);
}
deleteProcess(applicationId: string) {
const requestUrl = `${this.apiUrl}/${applicationId}`;
this.http.delete(requestUrl, httpOptions).subscribe(
() => console.log('Deletion of process with id: {} was successful', applicationId),
error => console.log('Error by deletion of process: {}', error));
}
}
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