Fix news component loading without author

pull/7056/head
Oliver Günther 6 years ago
parent e0d6320abb
commit 49f5746c8f
No known key found for this signature in database
GPG Key ID: A3A8BDAD7C0C552C
  1. 5
      frontend/src/app/modules/grids/widgets/news/news.component.html
  2. 4
      frontend/src/app/modules/grids/widgets/news/news.component.ts

@ -10,12 +10,14 @@
<ul class="widget-box--arrow-links">
<li class="-widget-box--arrow-multiline" *ngFor="let news of entries">
<div>
<ng-container *ngIf="news.author">
<img class="avatar avatar-mini avatar--fallback"
data-avatar-fallback-remove="true"
*ngIf="newsAuthorAvatar(news)"
[attr.src]="newsAuthorAvatar(news)"
[attr.title]="newsAuthorName(news)"
[attr.alt]="newsAuthorName(news)" />
</ng-container>
<a [href]="newsProjectPath(news)"
[textContent]="newsProjectName(news)">
</a>:
@ -23,7 +25,8 @@
[textContent]="news.title">
</a>
<p class="widget-box--additional-info">
<p *ngIf="news.author"
class="widget-box--additional-info">
{{text.createdBy}}
<a [href]="newsAuthorPath(news)"
[textContent]="newsAuthorName(news)">

@ -40,6 +40,10 @@ export class WidgetNewsComponent extends AbstractWidgetComponent implements OnIn
this.entriesLoaded = true;
this.entries.forEach((entry) => {
if (!entry.author) {
return;
}
this.userCache
.require(entry.author.idFromLink)
.then((user:UserResource) => {

Loading…
Cancel
Save