From 19ffa4c4bbf5c93ed72f25d13096c05bff7f8a5d Mon Sep 17 00:00:00 2001 From: Cilibiu Bogdan Date: Mon, 2 Jul 2018 21:33:09 +0300 Subject: [PATCH] [ACA-1513] Metadata - image EXIF option not rendering (#477) * get aspectNames for image type if there is none * checkspell and checktype * cspell --- cspell.json | 3 ++- .../info-drawer/info-drawer.component.ts | 15 ++++++++++++++- src/app/directives/document-list.directive.ts | 2 +- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/cspell.json b/cspell.json index 44f998e9e..6401bf8bd 100644 --- a/cspell.json +++ b/cspell.json @@ -35,7 +35,8 @@ "xpath", "tooltip", "tooltips", - "unindent" + "unindent", + "exif" ], "dictionaries": [ "html" diff --git a/src/app/components/info-drawer/info-drawer.component.ts b/src/app/components/info-drawer/info-drawer.component.ts index 57baa23e2..c6df10aa0 100644 --- a/src/app/components/info-drawer/info-drawer.component.ts +++ b/src/app/components/info-drawer/info-drawer.component.ts @@ -74,11 +74,24 @@ export class InfoDrawerComponent implements OnChanges { // workaround for Favorite files this.loadNodeInfo(entry.id); } else { - this.displayNode = this.node.entry; + // workaround Recent + if (this.isTypeImage(entry) && !this.hasAspectNames(entry)) { + this.loadNodeInfo(this.node.entry.id); + } else { + this.displayNode = this.node.entry; + } } } } + private hasAspectNames(entry: MinimalNodeEntryEntity) { + return entry.aspectNames && entry.aspectNames.includes('exif:exif'); + } + + private isTypeImage(entry) { + return entry.content.mimeType.includes('image/'); + } + private loadNodeInfo(nodeId: string) { if (nodeId) { this.isLoading = true; diff --git a/src/app/directives/document-list.directive.ts b/src/app/directives/document-list.directive.ts index e2ca0d6b8..28ab6e701 100644 --- a/src/app/directives/document-list.directive.ts +++ b/src/app/directives/document-list.directive.ts @@ -51,7 +51,7 @@ export class DocumentListDirective implements OnInit, OnDestroy { ) {} ngOnInit() { - this.documentList.includeFields = ['isFavorite']; + this.documentList.includeFields = ['isFavorite', 'aspectNames']; this.documentList.allowDropFiles = false; if (this.sortingPreferenceKey) {