From 29ca06d6fae0d605cc1ac77a810803da2a096af3 Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 11 Dec 2020 16:30:42 +0100 Subject: [PATCH] Fix datepage not found --- .../data-page/data-page.component.html | 24 +++++++++---------- .../data-page/data-page.component.ts | 16 +++++++++---- 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/src/app/components/data-page/data-page.component.html b/src/app/components/data-page/data-page.component.html index 8f90975..d8a50f2 100644 --- a/src/app/components/data-page/data-page.component.html +++ b/src/app/components/data-page/data-page.component.html @@ -7,7 +7,7 @@

Seite konnte nicht gefunden werden :(

-
+

{{ getHeadline !== undefined ? getHeadline(data) : data[headlineDataPath] }} {{ headlineIconName }} @@ -24,7 +24,7 @@

{{ object.title }}

diff --git a/src/app/components/data-page/data-page.component.ts b/src/app/components/data-page/data-page.component.ts index 4342567..84349b0 100644 --- a/src/app/components/data-page/data-page.component.ts +++ b/src/app/components/data-page/data-page.component.ts @@ -91,9 +91,14 @@ export class DataPageComponent implements OnInit, OnDestroy { this.id = this.route.snapshot.paramMap.get('id'); this.reloadPageData(); this.dataService.pageData.subscribe((data) => { - // dont overwrite data when in edit mode and relock is performed - if (this.data?.isLockedByMe && data?.isLockedByMe) return; - this.data = flatten(data); + if (data == null) { + this.data = null; + } else if (this.data?.isLockedByMe && data?.isLockedByMe) { + // dont overwrite data when in edit mode and relock is performed + return; + } else { + this.data = flatten(data); + } }); this.dataService.isLoadingPageData.subscribe( (isLoading) => (this.isLoading = isLoading) @@ -103,7 +108,7 @@ export class DataPageComponent implements OnInit, OnDestroy { }); this.relockingInterval = setInterval(() => { - if (this.data.isLockedByMe) { + if (this.data?.isLockedByMe) { this.lock(); } }, this.relockingIntervalDuration); @@ -149,7 +154,8 @@ export class DataPageComponent implements OnInit, OnDestroy { prop.dataPath + ' on ' + this.pageDataGQLType - );} + ); + } prop.required = prop.required != null ? prop.required : typeInformation.isRequired;