[ADF-2311] fix metadata components with folders (#2985)

* fix metadata folders

* remove dead code

* fix check mimetype
This commit is contained in:
Eugenio Romano
2018-02-23 10:41:03 +00:00
committed by GitHub
parent ad3dbd4d0b
commit 7f63b76d37
9 changed files with 142 additions and 26 deletions

View File

@@ -34,6 +34,7 @@ import { DocumentListComponent, PermissionStyleModel } from '@alfresco/adf-conte
import { SelectAppsDialogComponent } from '@alfresco/adf-process-services';
import { VersionManagerDialogAdapterComponent } from './version-manager-dialog-adapter.component';
import { MetadataDialogAdapterComponent } from './metadata-dialog-adapter.component';
import { Subscription } from 'rxjs/Subscription';
const DEFAULT_FOLDER_TO_SHOW = '-my-';
@@ -342,6 +343,21 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
}
}
onManageMetadata(event) {
const contentEntry = event.value.entry;
if (this.contentService.hasPermission(contentEntry, 'update')) {
this.dialog.open(MetadataDialogAdapterComponent, {
data: { contentEntry },
panelClass: 'adf-metadata-manager-dialog',
width: '630px'
});
} else {
const translatedErrorMessage: any = this.translateService.get('OPERATION.ERROR.PERMISSION');
this.notificationService.openSnackMessage(translatedErrorMessage.value, 4000);
}
}
getSiteContent(site: SiteEntry) {
this.currentFolderId = site && site.entry.guid ? site.entry.guid : DEFAULT_FOLDER_TO_SHOW;
}