Add file manager patches for firefox

Lowers the change detection attempts to fix the file manager
for firefox
This commit is contained in:
Sean Engelhardt 2019-07-15 17:49:30 +02:00
parent 1c3d60fe39
commit d036fe6046
3 changed files with 21 additions and 7 deletions

View File

@ -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 {
/**

View File

@ -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

View File

@ -51,7 +51,14 @@
</span>
<span class="visibility" *ngIf="directory && directory.inherited_access_groups_id !== true">
<span class="visible-for" *ngIf="directory.has_inherited_access_groups" translate>
<os-icon-container icon="visibility" matTooltip="{{ 'Allowed access groups for this directory' | translate }}">{{ directory.inherited_access_groups }}</os-icon-container>
<os-icon-container
icon="visibility"
matTooltip="{{ 'Allowed access groups for this directory' | translate }}"
>
<span *ngFor="let group of directory.inherited_access_groups; let last = last">
{{ translateSync(group.getTitle()) }}<span *ngIf="!last">,</span>
</span>
</os-icon-container>
</span>
</span>
</div>
@ -84,10 +91,8 @@
<!-- Info column -->
<div *pblNgridCellDef="'info'; row as mediafile" class="fill clickable" (click)="onEditFile(mediafile)">
<os-icon-container *ngIf="mediafile.access_groups.length" icon="group">
<span>
<span *ngFor="let group of mediafile.access_groups; let last = last">
{{ group.getTitle() | translate }}<span *ngIf="!last">,</span>
</span>
<span *ngFor="let group of mediafile.access_groups; let last = last">
{{ translateSync(group.getTitle()) }}<span *ngIf="!last">,</span>
</span>
</os-icon-container>
</div>