import { ProjectData, ProjectDetails, QUOTAITEM, QUOTA_ITEMS } from 'ProjectModel';
import { ProjectService } from 'ProjectService';
import { RestService } from 'RestService';
-import { SharedService } from 'SharedService';
-import { isNullOrUndefined } from 'util';
+import { SharedService, isNullOrUndefined } from 'SharedService';
/**
* Creating component
}
/** Edit project @public */
public editProject(): void {
+ if (!this.projectForm.dirty) {
+ this.notifierService.notify('warning', this.translateService.instant('PAGE.TOPOLOGY.DATAEMPTY'));
+ return;
+ }
this.isLoadingResults = true;
const apiURLHeader: APIURLHEADER = {
url: environment.PROJECTS_URL + '/' + this.projectRef
this.isLoadingResults = false;
this.projectService.setHeaderProjects();
this.notifierService.notify('success', this.translateService.instant('PAGE.PROJECT.UPDATEDSUCCESSFULLY'));
+ this.activeModal.close(this.modalData);
}, (error: ERRORDATA): void => {
this.restService.handleError(error, 'patch');
this.isLoadingResults = false;
/** Used to get the AbstractControl of controlName passed @private */
private getFormControl(controlName: string): AbstractControl {
+ // eslint-disable-next-line security/detect-object-injection
return this.projectForm.controls[controlName];
}