+import { Location } from '@angular/common';
import { Component, OnDestroy, OnInit } from '@angular/core';
import { AbstractControl, FormControl, Validators } from '@angular/forms';
+import { ActivatedRoute } from '@angular/router';
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
import { Subscription } from 'rxjs';
public activeModal: NgbActiveModal,
public actionLabels: ActionLabelsI18n,
private rbdMirroringService: RbdMirroringService,
- private taskWrapper: TaskWrapperService
+ private taskWrapper: TaskWrapperService,
+ private route: ActivatedRoute,
+ private location: Location
) {
this.createForm();
}
}
ngOnInit() {
+ this.route.params.subscribe((params: { pool_name: string }) => {
+ this.poolName = params.pool_name;
+ });
this.pattern = `${this.poolName}`;
this.rbdMirroringService.getPool(this.poolName).subscribe((resp: PoolEditModeResponseModel) => {
this.setResponse(resp);
error: () => this.editModeForm.setErrors({ cdSubmitButton: true }),
complete: () => {
this.rbdMirroringService.refresh();
- this.activeModal.close();
+ this.location.back();
}
});
}