mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-19 10:19:27 -05:00
Fix: tweak doc detail component behavior while awaiting metadata (#5546)
This commit is contained in:
parent
1e4d284b30
commit
6fb4daf03e
@ -324,7 +324,7 @@
|
|||||||
<ng-container i18n>Loading...</ng-container>
|
<ng-container i18n>Loading...</ng-container>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
} @else {
|
||||||
@switch (contentRenderType) {
|
@switch (contentRenderType) {
|
||||||
@case (ContentRenderType.PDF) {
|
@case (ContentRenderType.PDF) {
|
||||||
@if (!useNativePdfViewer) {
|
@if (!useNativePdfViewer) {
|
||||||
@ -364,4 +364,5 @@
|
|||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
@ -681,6 +681,7 @@ describe('DocumentDetailComponent', () => {
|
|||||||
|
|
||||||
it('should support Enter key in password field', () => {
|
it('should support Enter key in password field', () => {
|
||||||
initNormally()
|
initNormally()
|
||||||
|
component.metadata = { has_archive_version: true }
|
||||||
component.onError({ name: 'PasswordException' }) // normally dispatched by pdf viewer
|
component.onError({ name: 'PasswordException' }) // normally dispatched by pdf viewer
|
||||||
fixture.detectChanges()
|
fixture.detectChanges()
|
||||||
expect(component.password).toBeUndefined()
|
expect(component.password).toBeUndefined()
|
||||||
|
@ -82,6 +82,7 @@ enum ContentRenderType {
|
|||||||
Image = 'image',
|
Image = 'image',
|
||||||
Text = 'text',
|
Text = 'text',
|
||||||
Other = 'other',
|
Other = 'other',
|
||||||
|
Unknown = 'unknown',
|
||||||
}
|
}
|
||||||
|
|
||||||
enum ZoomSetting {
|
enum ZoomSetting {
|
||||||
@ -211,6 +212,7 @@ export class DocumentDetailComponent
|
|||||||
}
|
}
|
||||||
|
|
||||||
get contentRenderType(): ContentRenderType {
|
get contentRenderType(): ContentRenderType {
|
||||||
|
if (!this.metadata) return ContentRenderType.Unknown
|
||||||
const contentType = this.metadata?.has_archive_version
|
const contentType = this.metadata?.has_archive_version
|
||||||
? 'application/pdf'
|
? 'application/pdf'
|
||||||
: this.metadata?.original_mime_type
|
: this.metadata?.original_mime_type
|
||||||
|
Loading…
x
Reference in New Issue
Block a user