[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

@@ -9,6 +9,12 @@
"TITLE": "Manage Versions"
}
},
"METADATA": {
"DIALOG": {
"CLOSE": "Close",
"TITLE": "Metadata"
}
},
"APP_LAYOUT": {
"APP_NAME": "ADF Demo Application",
"HOME": "Home",
@@ -74,6 +80,8 @@
"DELETE":"Delete"
},
"ACTIONS": {
"VERSIONS": "Manage versions",
"METADATA": "Info",
"DOWNLOAD": "Download",
"FOLDER": {
"COPY": "Copy",

View File

@@ -36,6 +36,7 @@ import { WebscriptComponent } from './components/webscript/webscript.component';
import { TagComponent } from './components/tag/tag.component';
import { SocialComponent } from './components/social/social.component';
import { VersionManagerDialogAdapterComponent } from './components/files/version-manager-dialog-adapter.component';
import { MetadataDialogAdapterComponent } from './components/files/metadata-dialog-adapter.component';
import { ThemePickerModule } from './components/theme-picker/theme-picker';
import { DebugAppConfigService } from './services/debug-app-config.service';
@@ -87,6 +88,7 @@ import { SharedLinkViewComponent } from './components/shared-link-view/shared-li
SocialComponent,
CustomSourcesComponent,
VersionManagerDialogAdapterComponent,
MetadataDialogAdapterComponent,
TaskAttachmentsComponent,
ProcessAttachmentsComponent,
OverlayViewerComponent,
@@ -112,7 +114,8 @@ import { SharedLinkViewComponent } from './components/shared-link-view/shared-li
}
],
entryComponents: [
VersionManagerDialogAdapterComponent
VersionManagerDialogAdapterComponent,
MetadataDialogAdapterComponent
],
bootstrap: [AppComponent]
})

View File

@@ -245,11 +245,16 @@
(success)="onDeleteActionSuccess($event)"
handler="delete">
</content-action>
<content-action
icon="info"
title="{{'DOCUMENT_LIST.ACTIONS.METADATA' | translate}}"
(execute)="onManageMetadata($event)">
</content-action>
<!-- document actions -->
<content-action
icon="storage"
target="document"
title="Manage versions..."
title="{{'DOCUMENT_LIST.ACTIONS.VERSIONS' | translate}}"
(execute)="onManageVersions($event)">
</content-action>
<content-action
@@ -281,6 +286,7 @@
</adf-upload-drag-area>
<adf-info-drawer-layout *ngIf="showVersions" class="adf-manage-versions-sidebar" fxFlex="0 0 auto">
<div info-drawer-content>
<ng-container *ngIf="hasOneFileSelected();else choose_document_template">
<ng-container *ngIf="userHasPermissionToManageVersions(); else no_permission_to_versions">

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;
}

View File

@@ -0,0 +1,7 @@
<header mat-dialog-title>{{'METADATA.DIALOG.TITLE' | translate}}</header>
<section mat-dialog-content>
<adf-content-metadata-card [node]="contentEntry"></adf-content-metadata-card>
</section>
<footer mat-dialog-actions fxLayout="row" fxLayoutAlign="end center">
<button mat-button (click)="close()">{{'METADATA.DIALOG.CLOSE' | translate}}</button>
</footer>

View File

@@ -0,0 +1,38 @@
/*!
* @license
* Copyright 2016 Alfresco Software, Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Component, Inject, ViewEncapsulation } from '@angular/core';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material';
import { MinimalNodeEntryEntity } from 'alfresco-js-api';
@Component({
templateUrl: './metadata-dialog-adapter.component.html',
encapsulation: ViewEncapsulation.None
})
export class MetadataDialogAdapterComponent {
public contentEntry: MinimalNodeEntryEntity;
constructor(@Inject(MAT_DIALOG_DATA) data: any,
private containingDialog?: MatDialogRef<MetadataDialogAdapterComponent>) {
this.contentEntry = data.contentEntry;
}
close() {
this.containingDialog.close();
}
}