[ADF-4480] Change Viewer behaviour when opening unsupported files (#4922)

* [ADF-4480] Change Viewer behaviour when opening unsuported files

* [ADF-4480] Fix identations

* [ADF-4480] Make timeout of rendition retry constant
This commit is contained in:
arditdomi
2019-07-13 11:35:21 +01:00
committed by Eugenio Romano
parent 18ed4e3c1d
commit dc450a3af2
3 changed files with 9 additions and 3 deletions

View File

@@ -298,7 +298,7 @@
"OF": "of" "OF": "of"
}, },
"LOADING": "Loading", "LOADING": "Loading",
"UNKNOWN_FORMAT": "Couldn't load preview", "UNKNOWN_FORMAT": "Couldn't load preview. Unknown format.",
"SIDEBAR": { "SIDEBAR": {
"THUMBNAILS": { "THUMBNAILS": {
"PAGE": "Page {{ pageNum }}" "PAGE": "Page {{ pageNum }}"

View File

@@ -1,6 +1,6 @@
<div class="adf-viewer__unknown-format-view"> <div class="adf-viewer__unknown-format-view">
<div> <div>
<mat-icon class="icon">wifi_tethering</mat-icon> <mat-icon class="icon">error</mat-icon>
<div class="label">{{ 'ADF_VIEWER.UNKNOWN_FORMAT' | translate }}</div> <div class="label">{{ 'ADF_VIEWER.UNKNOWN_FORMAT' | translate }}</div>
</div> </div>
</div> </div>

View File

@@ -200,6 +200,8 @@ export class ViewerComponent implements OnChanges, OnInit, OnDestroy {
@Output() @Output()
invalidSharedLink = new EventEmitter(); invalidSharedLink = new EventEmitter();
TRY_TIMEOUT: number = 2000;
viewerType = 'unknown'; viewerType = 'unknown';
isLoading = false; isLoading = false;
nodeEntry: NodeEntry; nodeEntry: NodeEntry;
@@ -692,8 +694,12 @@ export class ViewerComponent implements OnChanges, OnInit, OnDestroy {
this.viewerType = 'error_in_creation'; this.viewerType = 'error_in_creation';
return reject(); return reject();
}); });
} else {
this.isLoading = false;
this.viewerType = 'error_in_creation';
clearInterval(intervalId);
} }
}, 1000); }, this.TRY_TIMEOUT);
}); });
} }