mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
update code as per code review
- upgrade demo project - extend readme - remove commented out unit tests
This commit is contained in:
@@ -19,13 +19,7 @@ import { NgModule, Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||
import { DocumentListModule, DocumentList, DocumentActionsService } from 'ng2-alfresco-documentlist';
|
||||
import {
|
||||
CoreModule,
|
||||
StorageService,
|
||||
AlfrescoSettingsService,
|
||||
AlfrescoAuthenticationService,
|
||||
AlfrescoTranslationService
|
||||
} from 'ng2-alfresco-core';
|
||||
import { CoreModule, StorageService, SettingsService, AuthService, AlfrescoTranslateService } from 'ng2-alfresco-core';
|
||||
|
||||
@Component({
|
||||
selector: 'alfresco-app-demo',
|
||||
@@ -39,24 +33,16 @@ import {
|
||||
operations.
|
||||
</div>
|
||||
<hr>
|
||||
<alfresco-document-list-breadcrumb
|
||||
[currentFolderPath]="currentPath"
|
||||
[target]="documentList">
|
||||
<alfresco-document-list-breadcrumb
|
||||
[target]="documentList"
|
||||
[folderNode]="documentList.folderNode">
|
||||
</alfresco-document-list-breadcrumb>
|
||||
<alfresco-document-list
|
||||
#documentList
|
||||
[currentFolderPath]="currentPath"
|
||||
[currentFolderId]="currentFolderId"
|
||||
[contextMenuActions]="true"
|
||||
[contentActions]="true"
|
||||
[creationMenuActions]="true"
|
||||
(folderChange)="onFolderChanged($event)">
|
||||
<!--
|
||||
<empty-folder-content>
|
||||
<template>
|
||||
<h1>Sorry, no content here</h1>
|
||||
</template>
|
||||
</empty-folder-content>
|
||||
-->
|
||||
[creationMenuActions]="true">
|
||||
<content-columns>
|
||||
<content-column key="$thumbnail" type="image"></content-column>
|
||||
<content-column
|
||||
@@ -65,12 +51,6 @@ import {
|
||||
sortable="true"
|
||||
class="full-width ellipsis-cell">
|
||||
</content-column>
|
||||
<!--
|
||||
<content-column
|
||||
title="Type"
|
||||
source="content.mimeType">
|
||||
</content-column>
|
||||
-->
|
||||
<content-column
|
||||
title="{{'DOCUMENT_LIST.COLUMNS.CREATED_BY' | translate}}"
|
||||
key="createdByUser.displayName"
|
||||
@@ -138,20 +118,18 @@ import {
|
||||
})
|
||||
class DocumentListDemo implements OnInit {
|
||||
|
||||
currentPath: string = '/';
|
||||
|
||||
// The identifier of a node. You can also use one of these well-known aliases: -my- | -shared- | -root-
|
||||
currentFolderId: string = '-my-';
|
||||
authenticated: boolean = false;
|
||||
|
||||
ecmHost: string = 'http://localhost:8080';
|
||||
|
||||
ticket: string;
|
||||
|
||||
@ViewChild(DocumentList)
|
||||
documentList: DocumentList;
|
||||
|
||||
constructor(private authService: AlfrescoAuthenticationService,
|
||||
private settingsService: AlfrescoSettingsService,
|
||||
private translation: AlfrescoTranslationService,
|
||||
constructor(private authService: AuthService,
|
||||
private settingsService: SettingsService,
|
||||
private translateService: AlfrescoTranslateService,
|
||||
private documentActions: DocumentActionsService,
|
||||
private storage: StorageService) {
|
||||
|
||||
@@ -162,7 +140,7 @@ class DocumentListDemo implements OnInit {
|
||||
this.ticket = this.authService.getTicketEcm();
|
||||
}
|
||||
|
||||
translation.addTranslationFolder();
|
||||
translateService.addTranslationFolder();
|
||||
documentActions.setHandler('my-handler', this.myDocumentActionHandler.bind(this));
|
||||
}
|
||||
|
||||
@@ -206,12 +184,6 @@ class DocumentListDemo implements OnInit {
|
||||
this.authenticated = false;
|
||||
});
|
||||
}
|
||||
|
||||
onFolderChanged(event?: any) {
|
||||
if (event) {
|
||||
this.currentPath = event.path;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@NgModule({
|
||||
|
Reference in New Issue
Block a user