mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
#9 new 'folderChange' event
- introduce new ‘folderChange’ event - deprecated ‘folderClick’ event - improved automation-id generation for cells
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
<alfresco-upload-drag-area [showUploadDialog]="true" currentFolderPath="{{absolutePath}}" uploaddirectory="{{relativePath}}"
|
||||
(onSuccess)="refreshDocumentList($event)">
|
||||
<alfresco-upload-drag-area
|
||||
[showUploadDialog]="true"
|
||||
currentFolderPath="{{absolutePath}}"
|
||||
uploaddirectory="{{relativePath}}"
|
||||
(onSuccess)="refreshDocumentList($event)">
|
||||
<alfresco-document-list
|
||||
(folderClick)="refreshDirectyory($event)"
|
||||
currentFolderPath="{{absolutePath}}"
|
||||
[breadcrumb]="breadcrumb">
|
||||
[currentFolderPath]="absolutePath"
|
||||
[breadcrumb]="breadcrumb"
|
||||
(folderChange)="onFolderChanged($event)">
|
||||
<content-columns>
|
||||
<content-column source="$thumbnail"></content-column>
|
||||
<content-column
|
||||
@@ -96,6 +99,13 @@
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="p-10">
|
||||
<ul>
|
||||
<li>Relative path: {{relativePath}}</li>
|
||||
<li>Absolute path: {{absolutePath}}</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<h5>Single file upload</h5>
|
||||
<alfresco-upload-button data-automation-id="single-file-upload" uploaddirectory="{{relativePath}}" currentFolderPath="{{absolutePath}}"
|
||||
(onSuccess)="refreshDocumentList($event)"></alfresco-upload-button>
|
||||
|
@@ -38,7 +38,6 @@ declare let __moduleName: string;
|
||||
export class FilesComponent {
|
||||
breadcrumb: boolean = false;
|
||||
navigation: boolean = true;
|
||||
events: any[] = [];
|
||||
absolutePath: string = '/Sites/swsdp/documentLibrary';
|
||||
relativePath: string = '';
|
||||
|
||||
@@ -60,20 +59,14 @@ export class FilesComponent {
|
||||
alert('Custom folder action for ' + event.value.displayName);
|
||||
}
|
||||
|
||||
refreshDirectyory(event: any) {
|
||||
this.absolutePath = event.value;
|
||||
this.relativePath = this.getRelativeDirectory(this.absolutePath);
|
||||
}
|
||||
|
||||
refreshDocumentList(event: Object) {
|
||||
refreshDocumentList() {
|
||||
this.absolutePath += '/';
|
||||
}
|
||||
|
||||
getRelativeDirectory(currentFolderPath: string): string {
|
||||
if (currentFolderPath.indexOf('/Sites/swsdp/documentLibrary/') !== -1) {
|
||||
return currentFolderPath.replace('/Sites/swsdp/documentLibrary/', '');
|
||||
} else {
|
||||
return currentFolderPath.replace('/Sites/swsdp/documentLibrary', '');
|
||||
onFolderChanged(event?: any) {
|
||||
if (event) {
|
||||
this.absolutePath = event.absolutePath;
|
||||
this.relativePath = event.relativePath;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user