mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
id-based navigation (initial implementation)
This commit is contained in:
@@ -5,8 +5,8 @@
|
||||
[versioning] = "versioning"
|
||||
(onSuccess)="documentList.reload()">
|
||||
<alfresco-document-list-breadcrumb
|
||||
[currentFolderPath]="currentPath"
|
||||
(pathChanged)="onBreadcrumbPathChanged($event)" *ngIf="!currentFolderId">
|
||||
[target]="documentList"
|
||||
[folderNode]="documentList.folderNode">
|
||||
</alfresco-document-list-breadcrumb>
|
||||
<div *ngIf="errorMessage" class="error-message">
|
||||
<button (click)="resetError()" class="mdl-button mdl-js-button mdl-button--icon">
|
||||
@@ -16,8 +16,6 @@
|
||||
</div>
|
||||
<alfresco-document-list
|
||||
#documentList
|
||||
[rootFolderId]="rootFolderId"
|
||||
[currentFolderPath]="currentPath"
|
||||
[currentFolderId]="currentFolderId"
|
||||
[contextMenuActions]="true"
|
||||
[contentActions]="true"
|
||||
@@ -40,12 +38,6 @@
|
||||
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"
|
||||
@@ -116,34 +108,6 @@
|
||||
|
||||
<context-menu-holder></context-menu-holder>
|
||||
|
||||
<div class="p-10">
|
||||
<ul>
|
||||
<li>Current path: {{currentPath}}</li>
|
||||
<li>
|
||||
<button (click)="currentPath = '/'">Go to root</button>
|
||||
</li>
|
||||
<li>
|
||||
<button (click)="currentPath = '/Sites'">Go to Sites</button>
|
||||
</li>
|
||||
<li>
|
||||
<button (click)="currentPath = '/Sites/swsdp';">Go to Web Site Design Project site</button>
|
||||
</li>
|
||||
<li>
|
||||
<button (click)="currentPath = '/Sites/swsdp/documentLibrary';">Go to Document Library</button>
|
||||
</li>
|
||||
<li>
|
||||
<button (click)="currentPath = '/Sites/swsdp/documentLibrary/Agency Files/Contracts'">Go to Agency Contracts</button>
|
||||
</li>
|
||||
<li>
|
||||
<button (click)="currentPath = '!@£$%^&*()'">Go to the wrong path</button>
|
||||
</li>
|
||||
<li>
|
||||
<button (click)="fileDialog.toggleShowDialog()">Show/Hide File Dialog</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
<p style="width:250px;margin: 20px;">
|
||||
<label for="switch-multiple-file" class="mdl-switch mdl-js-switch mdl-js-ripple-effect">
|
||||
<input type="checkbox" id="switch-multiple-file" class="mdl-switch__input" (change)="toggleMultipleFileUpload()" >
|
||||
|
@@ -33,9 +33,8 @@ import { FormService } from 'ng2-activiti-form';
|
||||
styleUrls: ['./files.component.css']
|
||||
})
|
||||
export class FilesComponent implements OnInit {
|
||||
currentPath: string = '/Sites/swsdp/documentLibrary';
|
||||
rootFolderId: string = '-root-';
|
||||
currentFolderId: string = null;
|
||||
// The identifier of a node. You can also use one of these well-known aliases: -my- | -shared- | -root-
|
||||
currentFolderId: string = '-my-';
|
||||
|
||||
errorMessage: string = null;
|
||||
fileNodeId: any;
|
||||
@@ -48,11 +47,13 @@ export class FilesComponent implements OnInit {
|
||||
acceptedFilesType: string = '.jpg,.pdf,.js';
|
||||
|
||||
get uploadRootFolderId(): string {
|
||||
return this.currentFolderId || this.rootFolderId;
|
||||
return this.currentFolderId;
|
||||
}
|
||||
|
||||
// TODO: fix
|
||||
get uploadFolderPath(): string {
|
||||
return this.currentFolderId ? '/' : this.currentPath;
|
||||
// return this.currentFolderId ? '/' : this.currentPath;
|
||||
return null;
|
||||
}
|
||||
|
||||
@ViewChild(DocumentList)
|
||||
@@ -89,13 +90,8 @@ export class FilesComponent implements OnInit {
|
||||
|
||||
onFolderChanged(event?: any) {
|
||||
if (event) {
|
||||
this.currentPath = event.path;
|
||||
}
|
||||
}
|
||||
|
||||
onBreadcrumbPathChanged(event?: any) {
|
||||
if (event) {
|
||||
this.currentPath = event.value;
|
||||
// this.currentPath = event.path;
|
||||
console.log(event);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,7 +119,9 @@ export class FilesComponent implements OnInit {
|
||||
ngOnInit() {
|
||||
if (this.route) {
|
||||
this.route.params.forEach((params: Params) => {
|
||||
this.currentFolderId = params.hasOwnProperty('id') ? params['id'] : null;
|
||||
if (params['id']) {
|
||||
this.currentFolderId = params['id'];
|
||||
}
|
||||
});
|
||||
}
|
||||
if (this.auth.isBpmLoggedIn()) {
|
||||
|
Reference in New Issue
Block a user