Index: modules/uoa-repository-dashboard-gui/trunk/src/app/pages/sources/sources-register/register-new-datasource.component.ts
===================================================================
--- modules/uoa-repository-dashboard-gui/trunk/src/app/pages/sources/sources-register/register-new-datasource.component.ts	(revision 55617)
+++ modules/uoa-repository-dashboard-gui/trunk/src/app/pages/sources/sources-register/register-new-datasource.component.ts	(revision 55618)
@@ -8,7 +8,7 @@
 import { DatasourceNewInterfaceFormComponent } from '../sources-forms/datasource-new-interface-form.component';
 import { from, of } from 'rxjs';
 import { concatMap } from 'rxjs/operators';
-import { formErrorRegisterRepo, noInterfacesSaved } from '../../../domain/shared-messages';
+import { errorsInInterfaces, formErrorRegisterRepo, noInterfacesSaved } from '../../../domain/shared-messages';
 
 @Component({
   selector: 'app-register-new-datasource',
@@ -21,6 +21,7 @@
   datasourceType: string;
   repo: Repository = null;
   repoInterfaces: RepositoryInterface[] = [];
+  interfacesToDelete: string[] = [];
 
   /* queryParams are used to follow the steps without refreshing the page
    * This was needed for Help Service [which sends back info according to the current router.url].
@@ -89,11 +90,17 @@
       this.registerDatasource.registerDatasource();
     } else if (this.currentStep === 2) {
       of(this.getInterfaces()).subscribe(
-        () => {
-          if (this.repoInterfaces.length > 0) {
-            this.addRepository();
+        errors => {
+          if (errors > 0) {
+            this.errorMessage = errorsInInterfaces;
+            window.scrollTo(1, 1);
           } else {
-            this.errorMessage = noInterfacesSaved;
+            if (this.repoInterfaces.length > 0) {
+              this.addRepository();
+            } else {
+              this.errorMessage = noInterfacesSaved;
+              window.scrollTo(1, 1);
+            }
           }
         }
       );
@@ -130,13 +137,21 @@
 
   getInterfaces() {
     this.repoInterfaces = [];
+    let invalidFormsCount = 0;
     for (const el of this.interfacesArray.toArray()) {
       const intrf = el.getInterface();
       if (intrf) {
         this.repoInterfaces.push(intrf);
         console.log(JSON.stringify(intrf));
+      } else {
+        invalidFormsCount = invalidFormsCount + 1;
+        const repo_interface = el.getCurrentValues();
+        this.repoInterfaces.push(repo_interface);
+        console.log(JSON.stringify(repo_interface));
       }
     }
+    console.log('new interfaces is ', this.repoInterfaces);
+    return invalidFormsCount;
   }
 
   fillInterfacesForms() {
Index: modules/uoa-repository-dashboard-gui/trunk/src/app/pages/sources/sources-register/register-existing-datasource.component.ts
===================================================================
--- modules/uoa-repository-dashboard-gui/trunk/src/app/pages/sources/sources-register/register-existing-datasource.component.ts	(revision 55617)
+++ modules/uoa-repository-dashboard-gui/trunk/src/app/pages/sources/sources-register/register-existing-datasource.component.ts	(revision 55618)
@@ -12,6 +12,7 @@
 import { from, of } from 'rxjs';
 import { concatMap } from 'rxjs/operators';
 import {
+  errorsInInterfaces,
   formErrorRegisterRepo,
   formInfoLoading, formInterfacesLoading, loadingInterfacesError, loadingRepoError,
   noInterfacesSaved
@@ -32,6 +33,7 @@
   datasourceId: string;
   repo: Repository;
   repoInterfaces: RepositoryInterface[] = [];
+  interfacesToDelete: string[] = [];
 
   /* queryParams are used to follow the steps without refreshing the page
    * This was needed for Help Service [which sends back info according to the current router.url].
@@ -100,18 +102,6 @@
     this.bottomHelperContent.ngOnInit();
   }
 
-  navigateToStep(step: string) {
-    this.router.navigateByUrl(`/sources/register/${this.datasourceType}?step=${step}`);
-      /*.then( () => {
-          // this.getStep();
-          this.rightHelperContent.ngOnInit();
-          this.topHelperContent.ngOnInit();
-          this.leftHelperContent.ngOnInit();
-          this.bottomHelperContent.ngOnInit();
-        }
-      );*/
-  }
-
   moveAStep() {
     this.errorMessage = '';
     if (this.currentStep === 0) {
@@ -123,11 +113,17 @@
       this.registerDatasource.updateRepo();
     } else if (this.currentStep === 2) {
       of(this.getInterfaces()).subscribe(
-        () => {
-          if (this.repoInterfaces.length > 0) {
-            this.registerRepository();
+        errors => {
+          if (errors > 0) {
+            this.errorMessage = errorsInInterfaces;
+            window.scrollTo(1, 1);
           } else {
-            this.errorMessage = noInterfacesSaved;
+            if (this.repoInterfaces.length > 0) {
+              this.registerRepository();
+            } else {
+              this.errorMessage = noInterfacesSaved;
+              window.scrollTo(1, 1);
+            }
           }
         }
       );
@@ -161,6 +157,9 @@
   removeInterfaceFromList(i: number) {
     const tempArray = this.dataForInterfaceComp;
     this.dataForInterfaceComp = [];
+    if (tempArray[i] && tempArray[i][3] && tempArray[i][3].id) {
+      this.interfacesToDelete.push(tempArray[i][3].id);
+    }
     tempArray.splice(i, 1);
     this.dataForInterfaceComp = tempArray;
     console.log(JSON.stringify(this.dataForInterfaceComp));
@@ -167,15 +166,32 @@
   }
 
   getInterfaces() {
-    this.repoInterfaces = [];
+    // this.repoInterfaces = [];
+    let invalidFormsCount = 0;
     for (const el of this.interfacesArray.toArray()) {
       const intrf = el.getInterface();
       if (intrf) {
-        this.repoInterfaces.push(intrf);
+        if (intrf.id && this.repoInterfaces.some(intr => intr.id === intrf.id)) {
+          const i = this.repoInterfaces.findIndex( intr => intr.id === intrf.id );
+          this.repoInterfaces[i] = intrf;
+        } else {
+          this.repoInterfaces.push(intrf);
+        }
         console.log(JSON.stringify(intrf));
+      } else {
+        invalidFormsCount = invalidFormsCount + 1;
+        const repo_interface = el.getCurrentValues();
+        if (repo_interface.id && this.repoInterfaces.some(intr => intr.id === repo_interface.id)) {
+          const i = this.repoInterfaces.findIndex( intr => intr.id === repo_interface.id );
+          this.repoInterfaces[i] = repo_interface;
+        } else {
+          this.repoInterfaces.push(repo_interface);
+        }
+        console.log(JSON.stringify(repo_interface));
       }
     }
     console.log('new interfaces is ', this.repoInterfaces);
+    return invalidFormsCount;
   }
 
   fillInterfacesForms() {
@@ -265,6 +281,7 @@
           console.log(error);
           this.errorMessage = loadingInterfacesError;
           this.loadingMessage = '';
+          window.scrollTo(1, 1);
         },
       () => {
         this.loadingMessage = '';
@@ -279,27 +296,6 @@
     window.open('../../../../assets/imgs/3_0ValidatedLogo.png', '_blank', 'enabledstatus=0,toolbar=0,menubar=0,location=0');
   }
 
-  // updateRepository() {
-  //   if (this.repo) {
-  //     this.loadingMessage = 'Saving changes';
-  //     this.errorMessage = '';
-  //     this.repoService.updateRepository(this.repo).subscribe(
-  //       response => {
-  //         console.log(`updateRepository responded: ${response.id}, ${response.registeredBy}`);
-  //         this.repo = response;
-  //       },
-  //       error => {
-  //         console.log(error);
-  //         this.loadingMessage = '';
-  //         this.errorMessage = formErrorRegisterRepo;
-  //       },
-  //       () => {
-  //         this.saveNewInterfaces();
-  //       }
-  //     );
-  //   }
-  // }
-
   registerRepository() {
     if (this.repo) {
       this.loadingMessage = 'Saving changes';
@@ -313,6 +309,7 @@
           console.log(error);
           this.loadingMessage = '';
           this.errorMessage = formErrorRegisterRepo;
+          window.scrollTo(1, 1);
         },
         () => {
           this.saveNewInterfaces();
@@ -326,7 +323,13 @@
       from(this.repoInterfaces).pipe(
         concatMap(intrf => {
           if (intrf.id) {
-            return this.repoService.updateInterface(this.repo.id, this.repo.registeredBy, intrf);
+            let req;
+            if (this.interfacesToDelete.some(id => id === intrf.id)) {
+              req = this.repoService.deleteInterface(intrf.id, this.repo.registeredBy);
+            } else {
+              req = this.repoService.updateInterface(this.repo.id, this.repo.registeredBy, intrf);
+            }
+            return req;
           } else {
             return this.repoService.addInterface(this.repo.datasourceType, this.repo.id, this.repo.registeredBy, intrf);
           }
@@ -337,6 +340,7 @@
           console.log(er);
           this.loadingMessage = '';
           this.errorMessage = 'Not all changes were saved. Please try again';
+          window.scrollTo(1, 1);
         },
         () => {
           this.loadingMessage = '';
Index: modules/uoa-repository-dashboard-gui/trunk/src/app/pages/sources/sources-forms/datasource-new-interface-form.component.ts
===================================================================
--- modules/uoa-repository-dashboard-gui/trunk/src/app/pages/sources/sources-forms/datasource-new-interface-form.component.ts	(revision 55617)
+++ modules/uoa-repository-dashboard-gui/trunk/src/app/pages/sources/sources-forms/datasource-new-interface-form.component.ts	(revision 55618)
@@ -4,12 +4,8 @@
 import { InterfaceInformation, RepositoryInterface } from '../../../domain/typeScriptClasses';
 import { ValidatorService } from '../../../services/validator.service';
 import { RepositoryService } from '../../../services/repository.service';
-import {
-  formErrorWasntSaved,
-  formInfoLoading, formSubmitting, formSuccessAddedInterface, formSuccessUpdatedInterface, invalidCustomBaseUrl,
-  nonRemovableInterface,
-  noServiceMessage
-} from '../../../domain/shared-messages';
+import { formErrorWasntSaved, formInfoLoading, formSubmitting, formSuccessAddedInterface, formSuccessUpdatedInterface, invalidCustomBaseUrl,
+         nonRemovableInterface, noServiceMessage } from '../../../domain/shared-messages';
 
 export class RepoFields {
   id: string;
@@ -29,8 +25,8 @@
 
   @Input() data: any[] = []; // expects an array containing at least 3 of the 4 below fields in this order
   inRegister: boolean;
-  interfaceID: number;     // holds the interface index in the interfaces array as displayed
-  currentRepo: RepoFields; // a fraction of the Repository class
+  interfaceID: number;      // holds the interface index in the interfaces array as displayed
+  currentRepo: RepoFields;  // a fraction of the Repository class
   currentInterface: RepositoryInterface;
 
   @Output() emitDeleteInterface: EventEmitter<number> = new EventEmitter<number>();
@@ -175,7 +171,7 @@
   checkIfValid() {
     if (this.formIsValid()) {
       if (this.inRegister) {
-        this.successMessage = 'The interface will be stored when the registration procedure is completed';
+        this.successMessage = 'The interface will be stored when the registration procedure is completed.';
         this.saveInterface();
       }
     } else {
@@ -212,9 +208,35 @@
       }
     } else {
       this.interfaceToExport = null;
+      this.errorMessage = 'Please make sure all required fields are filled with acceptable values.';
     }
   }
 
+  getCurrentValues() {
+    let intrf = this.currentInterface;
+    if (intrf == null) {
+      intrf = new RepositoryInterface();
+    }
+    intrf.baseUrl = this.repoInterfaceForm.get('baseUrl').value;
+    if (this.existingValSet) {
+      intrf.accessSet = this.repoInterfaceForm.get('selectValidationSet').value;
+      intrf.accessParams = {'set': this.repoInterfaceForm.get('selectValidationSet').value};
+    } else {
+      intrf.accessSet = this.repoInterfaceForm.get('customValidationSet').value;
+      intrf.accessParams = {'set': this.repoInterfaceForm.get('customValidationSet').value};
+    }
+    if (this.repoInterfaceForm.get('compatibilityLevel').value) {
+      intrf.desiredCompatibilityLevel = this.repoInterfaceForm.get('compatibilityLevel').value;
+      intrf.compliance = this.repoInterfaceForm.get('compatibilityLevel').value;
+    } else {
+      intrf.desiredCompatibilityLevel = this.existingCompLevel;
+      intrf.compliance = this.existingCompLevel;
+    }
+    intrf.typology = this.currentRepo.datasourceClass;
+
+    return intrf;
+  }
+
   addCurrent (baseUrl: string, valset: string, compLvl: string) {
     const currentInterface = new RepositoryInterface();
     currentInterface.baseUrl = baseUrl;
@@ -309,7 +331,7 @@
     this.errorMessage = '';
     this.successMessage = '';
     if (this.interfaceID > 0) {
-      if (this.currentInterface && (this.currentInterface.id !== null)) {
+      if (this.currentInterface && (this.currentInterface.id !== null) && !this.inRegister) {
         this.repoService.deleteInterface(this.currentInterface.id, this.currentRepo.registeredBy).subscribe(
           res => console.log(`deleteInterface responded: ${JSON.stringify(res)}`),
           er => console.log(er),
Index: modules/uoa-repository-dashboard-gui/trunk/src/app/domain/shared-messages.ts
===================================================================
--- modules/uoa-repository-dashboard-gui/trunk/src/app/domain/shared-messages.ts	(revision 55617)
+++ modules/uoa-repository-dashboard-gui/trunk/src/app/domain/shared-messages.ts	(revision 55618)
@@ -17,7 +17,8 @@
 export const noAggregationHistory = 'There is no aggregation history for this repository at the moment';
 
 /* Interfaces Messages */
-export const noInterfacesSaved = 'You have to create at least one interface';
+export const noInterfacesSaved = 'You have to create at least one interface.';
+export const errorsInInterfaces = 'There are still invalid interfaces. Please correct or remove them.';
 export const nonRemovableInterface = 'This interface can not be removed!';
 
 /* Rules Messages */
