From 53d96679ea1c3be3c179b0ac77c99fc08a66c5b6 Mon Sep 17 00:00:00 2001 From: Mario Romano Date: Tue, 23 Oct 2018 14:35:44 +0100 Subject: [PATCH] [ADF-3609 ] fallback for metadata and undefined value check (#3838) * [ADF-3609 ] fallback for metadata and undefined value check * fix lint issues * make name new property optional --- .../app/components/files/files.component.html | 11 ++++++++++- .../app/components/files/files.component.ts | 19 ++++++++++--------- .../metadata-dialog-adapter.component.html | 3 ++- .../metadata-dialog-adapter.component.ts | 3 +++ .../organised-property-group.interface.ts | 1 + .../services/content-metadata.service.ts | 10 +++++++++- .../property-groups-translator.service.ts | 16 +++++++++++----- 7 files changed, 46 insertions(+), 17 deletions(-) diff --git a/demo-shell/src/app/components/files/files.component.html b/demo-shell/src/app/components/files/files.component.html index 3d0228cac3..34f761f0d6 100644 --- a/demo-shell/src/app/components/files/files.component.html +++ b/demo-shell/src/app/components/files/files.component.html @@ -409,7 +409,8 @@ + [node]="documentList.selection[0].entry" + [displayEmpty]="displayEmptyMetadata"> @@ -556,6 +557,14 @@ +
+ + Display Empty Metadata + +
+ +
Upload
diff --git a/demo-shell/src/app/components/files/files.component.ts b/demo-shell/src/app/components/files/files.component.ts index 1963953013..cc6360c5e8 100644 --- a/demo-shell/src/app/components/files/files.component.ts +++ b/demo-shell/src/app/components/files/files.component.ts @@ -186,6 +186,7 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy { thumbnails = false; enableCustomPermissionMessage = false; enableMediumTimeFormat = false; + displayEmptyMetadata = false; private onCreateFolder: Subscription; private onEditFolder: Subscription; @@ -415,7 +416,10 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy { if (this.contentService.hasPermission(contentEntry, 'update')) { this.dialog.open(MetadataDialogAdapterComponent, { - data: { contentEntry }, + data: { + contentEntry: contentEntry, + displayEmptyMetadata: this.displayEmptyMetadata + }, panelClass: 'adf-metadata-manager-dialog', width: '630px' }); @@ -439,8 +443,7 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy { hasOneFileSelected(): boolean { const selection: Array = this.documentList.selection; - const hasOneFileSelected = selection && selection.length === 1 && selection[0].entry.isFile; - return hasOneFileSelected; + return selection && selection.length === 1 && selection[0].entry.isFile; } userHasPermissionToManageVersions(): boolean { @@ -528,11 +531,9 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy { this.documentList.reload(); } - canDownloadNode = (node: MinimalNodeEntity): boolean => { - if (node && node.entry && node.entry.name === 'custom') { - return true; - } - return false; + canDownloadNode(node: MinimalNodeEntity): boolean { + return node && node.entry && node.entry.name === 'custom'; + } onBeginUpload(event: UploadFilesEvent) { @@ -558,7 +559,7 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy { } } - isCustomActionDisabled = (node: MinimalNodeEntity): boolean => { + isCustomActionDisabled(node: MinimalNodeEntity): boolean { if (node && node.entry && node.entry.name === 'custom') { return false; } diff --git a/demo-shell/src/app/components/files/metadata-dialog-adapter.component.html b/demo-shell/src/app/components/files/metadata-dialog-adapter.component.html index 70b69c389d..9e9a651fc7 100644 --- a/demo-shell/src/app/components/files/metadata-dialog-adapter.component.html +++ b/demo-shell/src/app/components/files/metadata-dialog-adapter.component.html @@ -1,6 +1,7 @@
{{'METADATA.DIALOG.TITLE' | translate}}
- +