Merge branch 'DEVELOP' of ssh://git.eclipse.org:29418/openk-coremodules/org.eclipse.openk-coremodules.contactBaseData.frontend into KON-605-NEW
diff --git a/README.md b/README.md
index bb03233..442ff0e 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
-# Angular architecture patterns
+# OpenKonsquenz Core Modules - Contact Base Data Frontend
 
-This application represents a demo project for **Angular architecture patterns** blog series at [http://netmedia.io](http://netmedia.io/blog/angular-architecture-patterns-high-level-project-architecture_5589). Frontend app is generated with [Angular CLI](https://github.com/angular/angular-cli). It uses it's own local dev server on `http://localhost:4200/`.
+This application represents a core module for **OpenKonsquenz**.
 
 ### Run Development
 
diff --git a/angular.json b/angular.json
index 51b699f..9f999ed 100644
--- a/angular.json
+++ b/angular.json
@@ -22,7 +22,8 @@
             "assets": [
               "src/assets",
               "src/favicon.ico",
-              "src/service-worker.js",
+              "src/service-worker.js",			  
+			  "src/WEB-INF",
               {
                 "glob": "**/*",
                 "input": "config",
@@ -112,6 +113,7 @@
               "src/assets",
               "src/favicon.ico",
               "src/service-worker.js",
+			  "src/WEB-INF",
               {
                 "glob": "**/*",
                 "input": "config",
diff --git a/i18n/admin.de.json b/i18n/admin.de.json
index 2f2278e..dc2864a 100644
--- a/i18n/admin.de.json
+++ b/i18n/admin.de.json
@@ -1,7 +1,7 @@
 {
   "Salutations": {
     "Link": "Anreden verwalten",
-    "Title": "Übersicht Anrede",
+    "Title": "Übersicht Anreden",
     "DetailsTitle": "Anrede Details",
     "Type": "Typ",
     "Description": "Beschreibung",
@@ -10,7 +10,7 @@
   "CommunicationTypes": {
     "Link": "Kommunikationstypen verwalten",
     "Title": "Übersicht Kommunikationstypen",
-    "DetailsTitle": "Kommunikationstypen Details",
+    "DetailsTitle": "Kommunikationstyp Details",
     "Type": "Typ",
     "Description": "Beschreibung",
     "Editable": "Editierbar",
@@ -20,7 +20,7 @@
   "PersonTypes": {
     "Link": "Personentypen verwalten",
     "Title": "Übersicht Personentypen",
-    "DetailsTitle": "Personentypen Details",
+    "DetailsTitle": "Personentyp Details",
     "Type": "Typ",
     "Description": "Beschreibung",
     "New": "Neuen Personentyp anlegen"
@@ -28,7 +28,7 @@
   "AddressTypes": {
     "Link": "Adresstypen verwalten",
     "Title": "Übersicht Adresstypen",
-    "DetailsTitle": "Adresstypen Details",
+    "DetailsTitle": "Adresstyp Details",
     "Type": "Typ",
     "Description": "Beschreibung",
     "New": "Neuen Adresstyp anlegen"
diff --git a/i18n/general.de.json b/i18n/general.de.json
index aa93212..e9992ab 100644
--- a/i18n/general.de.json
+++ b/i18n/general.de.json
@@ -4,6 +4,7 @@
   "ServerError404": "Nicht gefunden. Bitte kontaktieren Sie den Administrator.",
   "ServerError409": "Die Aktion kann nicht durchgeführt werden, weil eine Abhängigkeit zu einem anderen Datensatz existiert.",
   "ServerError500": "Ein Fehler ist aufgetreten. Bitte kontaktieren Sie den Administrator.",
+  "ServerError504": "Beim Warten auf ein Gateway ist ein Timeout aufgetreten. Bitte prüfen Sie Ihre Netzwerkverbindung oder kontaktieren Sie den Administrator.",
   "SuccessNotificationTitle": "Erfolg",
   "ErrorNotificationTitle": "Fehler",
   "InfoNotificationTitle": "Info",
diff --git a/package.json b/package.json
index f2edf8c..9644923 100644
--- a/package.json
+++ b/package.json
@@ -18,6 +18,7 @@
     "sy-post-build": "node hooks/post-build.js",
     "sy-build": "npm run sy-pre-build && ng build --base-href /contactdatabase/ --prod --aot && npm run sy-post-build",
     "sy-build-noprod": "npm run sy-pre-build && ng build --base-href /contactdatabase/ && npm run sy-post-build",
+	"sy-build-prod": "npm run sy-pre-build && ng build --prod --aot --base-href /contactdatabase/ && npm run sy-post-build",
     "start-in-docker": "npm run sy-pre-start && ng serve --optimization=false --vendor-chunk --common-chunk --host=0.0.0.0 --disableHostCheck=true --proxy-config proxy-docker.conf.json",
     "start-in-docker-unsecure": "npm run sy-pre-start && ng serve --optimization=false --vendor-chunk --common-chunk --host=0.0.0.0 --disableHostCheck=true --proxy-config proxy-docker-unsecure.conf.json"
   },
diff --git a/src/WEB-INF/web.xml b/src/WEB-INF/web.xml
new file mode 100644
index 0000000..94ac5db
--- /dev/null
+++ b/src/WEB-INF/web.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
+                      http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
+  version="3.1">
+
+	<error-page>
+         <error-code>404</error-code>
+         <location>/index.html</location>
+    </error-page>
+
+</web-app>
diff --git a/src/app/pages/contacts/contacts-list/contacts-list-column-definition.ts b/src/app/pages/contacts/contacts-list/contacts-list-column-definition.ts
index 940f047..5b4a5f4 100644
--- a/src/app/pages/contacts/contacts-list/contacts-list-column-definition.ts
+++ b/src/app/pages/contacts/contacts-list/contacts-list-column-definition.ts
@@ -46,6 +46,14 @@
     field: 'note',
     colId: 'note',
     headerName: 'Contacts.Note',
+    maxWidth: 130,
+    tooltipValueGetter: params => {
+      if (!!params.value && params.value.length >= 20) {
+        return params.value;
+      } else {
+        return '';
+      }
+    },
     filter: 'agTextColumnFilter',
     filterParams: {
       debounceMs: 1000,
@@ -53,11 +61,12 @@
   },
   {
     valueGetter: function(params) {
-      if (params.data.community || params.data.street || params.data.housenumber) {
-        return `${params.data.community}, ${params.data.street} ${params.data.housenumber}`;
-      } else {
-        return '';
-      }
+      let result = '';
+      if (params.data.community) result += `${params.data.community}`;
+      if (params.data.street) result += ',' + ` ${params.data.street}`;
+      if (params.data.housenumber) result += ` ${params.data.housenumber}`;
+
+      return result;
     },
     colId: 'mainaddress',
     headerName: 'Contacts.MainAddress',
diff --git a/src/app/pages/contacts/contacts-list/contacts-list.component.html b/src/app/pages/contacts/contacts-list/contacts-list.component.html
index da6b23c..37e26c1 100644
--- a/src/app/pages/contacts/contacts-list/contacts-list.component.html
+++ b/src/app/pages/contacts/contacts-list/contacts-list.component.html
@@ -150,7 +150,7 @@
       [queryParameter]="modifiedContacts"
       autoResizeColumns
       class="ag-theme-balham"
-      style="min-width: 984px; height: calc(100vh - 279px);"
+      style="min-width: 1130px; height: calc(100vh - 276px);"
       [gridOptions]="gridOptions"
       [columnDefs]="columnDefinition"
       [rowSelection]="'single'"
diff --git a/src/app/pages/contacts/contacts-list/contacts-list.component.scss b/src/app/pages/contacts/contacts-list/contacts-list.component.scss
index 5177a30..f71da6d 100644
--- a/src/app/pages/contacts/contacts-list/contacts-list.component.scss
+++ b/src/app/pages/contacts/contacts-list/contacts-list.component.scss
@@ -22,7 +22,7 @@
   display: flex;
   justify-content: space-between;
   align-content: center;
-  min-width: 982px;
+  min-width: 1130px;
   background-color: #f5f7f7;
   border: 1px solid rgb(189, 195, 199);
   padding: 7px 7px 5px 7px;
diff --git a/src/app/pages/contacts/contacts-list/contacts-list.component.spec.ts b/src/app/pages/contacts/contacts-list/contacts-list.component.spec.ts
index 5533293..3ed2d3e 100644
--- a/src/app/pages/contacts/contacts-list/contacts-list.component.spec.ts
+++ b/src/app/pages/contacts/contacts-list/contacts-list.component.spec.ts
@@ -236,4 +236,20 @@
     expect(component.modifiedContacts.moduleName).toBe(moduleName);
     expect(component.modifiedContacts.withoutAssignedModule).toBeFalsy();
   });
+
+  it('checks if function _resetDSGVOFilter works', () => {
+    (component as any)._deletionLockExceeded = true;
+    (component as any)._resetDSGVOFilter();
+    expect((component as any)._deletionLockExceeded).toBeFalsy();
+  });
+
+  it('checks if function showAdvancedDSGVOFilter() works', () => {
+    const spy = spyOn(component as any, '_resetDSGVOFilter');
+    component.isDSGVOFilterAdvancedVisible = true;
+    component.modifiedContacts.expiringDataInPast = true;
+    component.showAdvancedDSGVOFilter();
+
+    expect(component.isDSGVOFilterAdvancedVisible).toBeFalsy();
+    expect(spy).toHaveBeenCalled();
+  });
 });
diff --git a/src/app/pages/contacts/contacts-list/contacts-list.component.ts b/src/app/pages/contacts/contacts-list/contacts-list.component.ts
index d0cadd5..7a631da 100644
--- a/src/app/pages/contacts/contacts-list/contacts-list.component.ts
+++ b/src/app/pages/contacts/contacts-list/contacts-list.component.ts
@@ -205,6 +205,29 @@
     sessionStorage.setItem(Globals.SESSSION_STORAGE_KEYS.contactListSearchFilterKey, JSON.stringify(this.modifiedContacts));
   }
 
+  public showAdvancedDSGVOFilter() {
+    this.isDSGVOFilterAdvancedVisible = !this.isDSGVOFilterAdvancedVisible;
+    if (
+      !this.isDSGVOFilterAdvancedVisible &&
+      (this.modifiedContacts.moduleName != null ||
+        this.modifiedContacts.withoutAssignedModule ||
+        this.modifiedContacts.deletionLockExceeded ||
+        this.modifiedContacts.expiringDataInPast)
+    ) {
+      this._resetDSGVOFilter();
+    }
+  }
+
+  private _resetDSGVOFilter() {
+    this._deletionLockExceeded = false;
+    this._expiringDataInPast = false;
+    this.modifiedContacts.moduleName = null;
+    this.modifiedContacts.withoutAssignedModule = false;
+    this.modifiedContacts.deletionLockExceeded = false;
+    this.modifiedContacts.expiringDataInPast = false;
+    this.modifiedContacts = { ...this.modifiedContacts };
+  }
+
   private _setModifiedContactsSort() {
     if (this._sortingOrder && this._sortingContactType) {
       const sort = this._sortingContactType + ',' + this._sortingOrder;
diff --git a/src/app/pages/persons/internal-person/internal-person-details/internal-person-details.component.html b/src/app/pages/persons/internal-person/internal-person-details/internal-person-details.component.html
index 7865c91..a8950ec 100644
--- a/src/app/pages/persons/internal-person/internal-person-details/internal-person-details.component.html
+++ b/src/app/pages/persons/internal-person/internal-person-details/internal-person-details.component.html
@@ -49,6 +49,13 @@
           </div>
         </div>
 
+        <div class="syncAlertMessage" *ngIf="internalPersonSandBox.showSyncAlertMessage">
+          <span>
+            Achtung: <br />Dieser Kontakt wird mit einem anderen System synchronisiert. <br />
+            Manuelle Änderungen gehen möglicherweise verloren.
+          </span>
+        </div>
+
         <!-- title -->
         <div class="form-group row">
           <label for="title" class="col-sm-2 col-form-label">{{ 'Internal.PersonTitle' | translate }}</label>
@@ -123,7 +130,7 @@
               autocomplete="off"
             />
           </div>
-          <button type="button" (click)="internalPersonSandBox.setLdapUidValue(null)" class="tool-icon">
+          <button type="button" style="flex-basis: 10px;" (click)="internalPersonSandBox.setLdapUidValue(null)" class="tool-icon">
             <fa name="trash"></fa>
           </button>
         </div>
diff --git a/src/app/pages/persons/internal-person/internal-person-details/internal-person-details.component.scss b/src/app/pages/persons/internal-person/internal-person-details/internal-person-details.component.scss
index d73298c..4b7805a 100644
--- a/src/app/pages/persons/internal-person/internal-person-details/internal-person-details.component.scss
+++ b/src/app/pages/persons/internal-person/internal-person-details/internal-person-details.component.scss
@@ -52,3 +52,13 @@
 .expandable-module-assignment .collapse5 {
   height: 338px;
 }
+.syncAlertMessage {
+  position: absolute;
+  top: 0px;
+  left: 50vw;
+  margin: 20px 20px 20px 0;
+  padding: 14px;
+  font-size: 20px;
+  background-color: rgba(255, 178, 0, 0.2);
+  border: 1px solid rgba(0, 0, 0, 0.15);
+}
diff --git a/src/app/pages/persons/internal-person/internal-person-details/internal-person-details.sandbox.ts b/src/app/pages/persons/internal-person/internal-person-details/internal-person-details.sandbox.ts
index 707545e..b242671 100644
--- a/src/app/pages/persons/internal-person/internal-person-details/internal-person-details.sandbox.ts
+++ b/src/app/pages/persons/internal-person/internal-person-details/internal-person-details.sandbox.ts
@@ -49,7 +49,7 @@
   public isCommunicationsDataDetailViewVisible: boolean = false;
   public isAddressDataDetailViewVisible: boolean = false;
   public existMainAddress = false;
-  public showSynchAlertMessage = false;
+  public showSyncAlertMessage = false;
   public isCurrentAddressMainAddress = false;
   public internalPersonContactId: string;
   private _currentInternalPerson: InternalPerson = null;
@@ -255,6 +255,8 @@
     // subscribes to formState
     this.internalPersonDetailsFormState$.pipe(takeUntil(this._endSubscriptions$)).subscribe((formState: FormGroupState<InternalPerson>) => {
       this.internalPersonDetailsCurrentFormState = formState;
+
+      this.showSyncAlertMessage = !!formState.value && (!!formState.value.uid || !!formState.value.userRef) ? true : false;
     });
   }
 
diff --git a/src/app/shared/asyncServices/http/httpResponseHandler.service.ts b/src/app/shared/asyncServices/http/httpResponseHandler.service.ts
index eb5da94..8af4088 100644
--- a/src/app/shared/asyncServices/http/httpResponseHandler.service.ts
+++ b/src/app/shared/asyncServices/http/httpResponseHandler.service.ts
@@ -59,6 +59,9 @@
         this.handleServerError();
         break;
 
+      case 504:
+        this.handleServerTimeoutError();
+        break;
       default:
         break;
     }
@@ -160,7 +163,12 @@
       }
     }
   }
+  private handleServerTimeoutError(): void {
+    const message = this.translateService.instant('ServerError504'),
+      title = this.translateService.instant('ErrorNotificationTitle');
 
+    this.showNotificationError(title, message);
+  }
   /**
    * Extracts and returns translated value from server response
    *
diff --git a/src/app/shared/models/modifiedContacts.model.ts b/src/app/shared/models/modifiedContacts.model.ts
index ab6c092..233ca62 100644
--- a/src/app/shared/models/modifiedContacts.model.ts
+++ b/src/app/shared/models/modifiedContacts.model.ts
@@ -16,9 +16,9 @@
   public sort: string = null;
   public isDSGVOFilterAdvancedVisible: boolean = null;
   public moduleName: string = null;
-  public withoutAssignedModule: boolean = null;
-  public expiringDataInPast: boolean = null;
-  public deletionLockExceeded: boolean = null;
+  public withoutAssignedModule: boolean = false;
+  public expiringDataInPast: boolean = false;
+  public deletionLockExceeded: boolean = false;
 
   public constructor(data: any = null) {
     Object.keys(data || {})