diff --git a/client/src/app/shared/components/search-value-selector/search-value-selector.component.ts b/client/src/app/shared/components/search-value-selector/search-value-selector.component.ts index 06404d6f5..23b9c2e45 100644 --- a/client/src/app/shared/components/search-value-selector/search-value-selector.component.ts +++ b/client/src/app/shared/components/search-value-selector/search-value-selector.component.ts @@ -1,4 +1,4 @@ -import { Component, Input, ViewChild, OnDestroy } from '@angular/core'; +import { Component, Input, ViewChild, OnDestroy, ChangeDetectionStrategy } from '@angular/core'; import { FormControl } from '@angular/forms'; import { MatSelect } from '@angular/material'; @@ -34,7 +34,8 @@ import { Selectable } from '../selectable'; @Component({ selector: 'os-search-value-selector', templateUrl: './search-value-selector.component.html', - styleUrls: ['./search-value-selector.component.scss'] + styleUrls: ['./search-value-selector.component.scss'], + changeDetection: ChangeDetectionStrategy.OnPush }) export class SearchValueSelectorComponent implements OnDestroy { /** diff --git a/client/src/app/site/base/base-view.ts b/client/src/app/site/base/base-view.ts index e8871677e..97fa404f9 100644 --- a/client/src/app/site/base/base-view.ts +++ b/client/src/app/site/base/base-view.ts @@ -91,6 +91,14 @@ export abstract class BaseViewComponent extends BaseComponent implements OnDestr } } + /** + * Translate alternative avoid endless loops during change detection + * @param original the original string to translate + */ + public translateSync(original: string): string { + return this.translate.instant(original); + } + /** * To catch swipe gestures. * Should be overwritten by children which need swipe gestures diff --git a/client/src/app/site/mediafiles/components/mediafile-list/mediafile-list.component.html b/client/src/app/site/mediafiles/components/mediafile-list/mediafile-list.component.html index 18b0a77a6..c9fbd6b4a 100644 --- a/client/src/app/site/mediafiles/components/mediafile-list/mediafile-list.component.html +++ b/client/src/app/site/mediafiles/components/mediafile-list/mediafile-list.component.html @@ -51,7 +51,14 @@ - {{ directory.inherited_access_groups }} + + + {{ translateSync(group.getTitle()) }}, + + @@ -84,10 +91,8 @@
- - - {{ group.getTitle() | translate }}, - + + {{ translateSync(group.getTitle()) }},