X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=src%2Fapp%2Fprojects%2Fproject-create-update%2FProjectCreateUpdateComponent.ts;h=2d45ef6d2d37ad7c2c8021b0a9eea99d78af07f5;hb=c84f1123f8ba69f9e2211b2d816bb415e595efaa;hp=bb1207aeff0eb1893c94555a50f5ff7fa795836d;hpb=b1ec4c3fd775b8c9f8c9576cd232d2a4711056a3;p=osm%2FNG-UI.git diff --git a/src/app/projects/project-create-update/ProjectCreateUpdateComponent.ts b/src/app/projects/project-create-update/ProjectCreateUpdateComponent.ts index bb1207a..2d45ef6 100644 --- a/src/app/projects/project-create-update/ProjectCreateUpdateComponent.ts +++ b/src/app/projects/project-create-update/ProjectCreateUpdateComponent.ts @@ -29,8 +29,7 @@ import { environment } from 'environment'; 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 @@ -213,6 +212,10 @@ export class ProjectCreateUpdateComponent implements OnInit { } /** 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 @@ -226,6 +229,7 @@ export class ProjectCreateUpdateComponent implements OnInit { 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; @@ -245,6 +249,7 @@ export class ProjectCreateUpdateComponent implements OnInit { /** 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]; }