Commit 3a3cd4cd authored by Mark Harding's avatar Mark Harding

(fix): various elastic feed fixes

1 merge request!373Refactor/es feeds
Pipeline #70053744 failed with stage
in 7 minutes and 37 seconds
......@@ -23,7 +23,9 @@ export class SortedService {
throw new Error('Invalid server response');
}
return response.entities;
return response.entities.map(entity => {
return entity.entity
});
} catch (e) {
console.error('SortedService.getMedia', e);
return [];
......
......@@ -35,8 +35,9 @@
></m-newsfeed__tiles>
</ng-container>
<ng-template #entityListView>
<ng-container *ngFor="let entity of (feedsService.feed | async); let i = index">
<minds-activity
*ngFor="let entity of (feedsService.feed | async); let i = index"
*ngIf="entity | async"
class="mdl-card item"
[object]="entity | async"
[canDelete]="group['is:owner'] || group['is:moderator']"
......@@ -48,16 +49,17 @@
<li
post-menu
class="mdl-menu__item"
*ngIf="group['is:owner']"
*ngIf="group['is:owner'] && (entity | async)"
(click)="kick(entity?.ownerObj)"
i18n="@@GROUPS__PROFILE__FEED__REMOVE_USER"
>Remove user</li>
</minds-activity>
</ng-container>
</ng-template>
<infinite-scroll
distance="25%"
(load)="load()"
(load)="loadMore()"
[moreData]="feedsService.hasMore | async"
[inProgress]="feedsService.inProgress | async"
></infinite-scroll>
......
......@@ -105,8 +105,8 @@ export class GroupProfileFeedSortedComponent {
this.detectChanges();
}
loadNext() {
this.feedsService.setOffset(this.feedsService.offset.getValue() + 12);
loadMore() {
this.feedsService.loadMore();
}
setFilter(type: string) {
......
......@@ -49,7 +49,9 @@ export class NewsfeedEntityComponent {
// Update the component
updateComponents() {
if (this.entity.type === 'user' || this.entity.type === 'group') {
if (this.entity
&& (this.entity.type === 'user' || this.entity.type === 'group')
) {
this.clear();
const componentFactory = this.componentFactoryResolver.resolveComponentFactory(this.getComponent(this.entity.type));
......
......@@ -9,7 +9,7 @@
[ngClass]="{ 'm-newsfeed-tiles__Tile--is-mature': attachment.shouldBeBlurred(entity) }"
[routerLink]="['/newsfeed', entity.guid]"
>
<img [src]="getThumbnailSrc(entity)" />
<img [src]="getThumbnailSrc(entity$ | async)" />
<i *ngIf="attachment.shouldBeBlurred(entity)" class="material-icons mature-icon">explicit</i>
<i *ngIf="isUnlisted(entity)" class="material-icons unlisted-icon">visibility_off</i>
</a>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment